Commit graph

78 commits

Author SHA1 Message Date
Paul Eggert
365e01cc9f Update copyright year to 2020
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2020-01-01 00:59:52 +00:00
Dmitry Gutov
181f571651 Fix up requires
* lisp/progmodes/project.el (project-files):
Remove (require 'xref).
(project--files-in-directory): Add it here instead.
(project-find-regexp, project-or-external-find-regexp): And here.
For 'xref--show-xrefs'.
2019-12-29 15:46:44 +03:00
Dmitry Gutov
43f66c3368 Extract xref-matches-in-files from project--find-regexp-in-files
* lisp/progmodes/xref.el (xref-matches-in-files): Extract from
project--find-regexp-in-files.

* lisp/dired-aux.el (dired-do-find-regexp): Also use it here.
2019-12-29 15:46:44 +03:00
Dmitry Gutov
3f2788d4ac project--vc-list-files: Recurse into submodules
* lisp/progmodes/project.el (project-try-vc): Do not treat a Git
submodule as a project root, go up to the parent repo.
(project--git-submodules): New function.
(project--vc-list-files): Use it.  Recurse into submodules.
2019-12-27 18:30:16 +03:00
Dmitry Gutov
219b91eb2c ; project--find-regexp-in-files: Avoid prepending remote-id twice (bug#34343) 2019-12-27 17:19:00 +03:00
Dmitry Gutov
6ab40c1a51 ; Clarify the assumption 2019-12-26 17:31:11 +02:00
Dmitry Gutov
be38e39fcc project--find-regexp-in-files: Support remote files
* lisp/progmodes/project.el (project--find-regexp-in-files):
Support remote files (bug#34343).
2019-12-26 16:00:06 +02:00
Dmitry Gutov
bb8f46d55b project-find-regexp: Default to symbol at point
* lisp/progmodes/project.el (project--read-regexp):
Don't rely on the Xref backend to provide the default value.
2019-12-09 16:27:28 +02:00
Paul Eggert
6b4a97c1c7 Fix some quoting glitches in doc strings 2019-11-11 10:32:53 -08:00
Dmitry Gutov
677d620930 (project--vc-list-files): Make sure to expand file names
* lisp/progmodes/project.el (project--vc-list-files): Make sure to
expand file names.  Turns out, Grep doesn't like abbreviated ones.
2019-10-05 12:33:25 +03:00
Dmitry Gutov
9a3089fea0 (project--vc-list-files): Optimize the Hg implementation
* lisp/progmodes/project.el (project--vc-list-files):
Optimize the Hg implementation.
2019-10-04 15:50:24 +03:00
Dmitry Gutov
d8c2da46e7 ; Fix reported warnings 2019-10-04 12:13:25 +03:00
Dmitry Gutov
7844846e3f Use file-name-as-directory
* lisp/progmodes/project.el (project--vc-list-files): Use
file-name-as-directory, to be on the safe side.
2019-10-04 12:13:25 +03:00
Dmitry Gutov
a750770ba0 Speed up project-files for Git projects
* lisp/progmodes/project.el (project-files): New method.
Implementation for VC projects that uses 'git ls-files' or 'hg
status --all' for listing.  With gratitude to Tassilo Horn who has
done most of the legwork and wrote the first version of the code
(https://lists.gnu.org/archive/html/emacs-devel/2019-10/msg00069.html).
(project--vc-list-files): New function, to be used by the above.
(project--find-regexp-in-files):
Silence warnings about nonexistent files.
2019-10-04 02:03:23 +03:00
Lars Ingebrigtsen
69d3d69d4c project.el compilation warning fix
* lisp/progmodes/project.el (xref--regexp-to-extended)
(xref--convert-hits): Declare more xref functions to avoid
compilation warnings.
2019-06-13 16:16:57 +02:00
Dmitry Gutov
8cdb9d9d24 Merge branch 'master' of git.sv.gnu.org:/srv/git/emacs 2019-05-24 04:53:39 +03:00
Dmitry Gutov
62349fe82a Support "reverting" Xref buffers (bug#35702)
* lisp/progmodes/xref.el (xref--fetcher): New variable.
(xref--xref-buffer-mode-map): Add binding for 'g'.
(xref--revert-xref-buffer): New command.
(xref--show-xref-buffer): Accept a function as the first argument.
(xref--show-xrefs): Same.
(xref--find-xrefs): Pass the above a fetcher function.

* lisp/progmodes/project.el (project-find-regexp)
(project-or-external-find-regexp): Same.

* lisp/dired-aux.el (dired-do-find-regexp): Same.
2019-05-24 04:50:44 +03:00
Stephen Leake
fb3b78f7b0 Revert recent project-find-file change
* lisp/progmodes/project.el (project-find-file): Delete recently added
'filename' arg; just use project-find-file-in.
2019-05-20 15:24:47 -07:00
Stephen Leake
2be537e643 Minor updates to project.el
* lisp/progmodes/project.el (project-find-file): Add optional 'filename' arg.
(project--completing-read-strict): Ignore 'default' set to empty string.
2019-05-19 10:28:46 -07:00
Basil L. Contovounesios
b2c0eb63dd Add docstring to project--read-file-cpd-relative
For discussion, see thread starting at:
https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00460.html
* lisp/progmodes/project.el (project--read-file-cpd-relative):
Describe arglist as promised by user option
project-read-file-name-function.
2019-05-16 23:26:27 +01:00
Juri Linkov
c11c990356 * lisp/progmodes/project.el (project-read-file-name-function): Fix type. 2019-05-14 23:40:31 +03:00
Dmitry Gutov
e0ee41d155 Allow customizing the display of project file names when reading
To hopefully resolve a long-running discussion
(https://lists.gnu.org/archive/html/emacs-devel/2019-05/msg00162.html).

* lisp/progmodes/project.el (project-read-file-name-function):
New variable.
(project--read-file-absolute, project--read-file-cpd-relative):
New functions, possible values for the above.
(project-find-file-in): Use the introduced variable.
(project--completing-read-strict): Retain just the logic that fits
the name.
2019-05-14 05:11:18 +03:00
Dmitry Gutov
1cd4a5e5e5 Allow project-find-regexp'ing inside an ignored dir
* lisp/progmodes/project.el (project-find-regexp): Don't pass
project's ignores to project--files-in-directory.  The FILES glob
should be enough, and we don't want to prohibit searching inside
ignored directories this way (it can be counter-intuitive).
2019-05-03 01:53:11 +03:00
Dmitry Gutov
f0e026a849 Fix project-find-regexp search for '--'
* lisp/progmodes/project.el (project--find-regexp-in-files):
Add an explicit '-e' before the pattern.  Fixing the ability to
search for '--'.  Reported by Juri Linkov <juri@linkov.net>.
2019-04-25 02:26:45 +03:00
Dmitry Gutov
ae78bda5b8 Sort files in the default impl of project-files alphabetically
* lisp/progmodes/project.el (project--files-in-directory):
Sort the files alphabetically
(https://debbugs.gnu.org/cgi/bugreport.cgi?bug=23179#296).
2019-04-15 00:39:57 +03:00
Dmitry Gutov
5aefaf4385 project--find-regexp-in-files: Use 'grep -E'
* lisp/progmodes/project.el (project--find-regexp-in-files): Use
'grep -E' because we convert the regexp to extended already.
2019-03-11 02:30:57 +02:00
Dmitry Gutov
33dbe23bb8 Rename project-query-replace to project-query-replace-regexp
* lisp/progmodes/project.el (project-query-replace): Rename to
project-query-replace-regexp.
2019-02-14 04:09:09 +03:00
Dmitry Gutov
3d6d8d795b Avoid unnecessary consing in project--files-in-directory
* lisp/progmodes/project.el (project--remote-file-names): New function.
(project--files-in-directory): Use it.
2019-02-07 14:22:47 +03:00
Dmitry Gutov
5e627fa5f5 Rename multifile.el to fileloop.el
* lisp/multifile.el: Rename to fileloop.el as discussed in
https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00475.html.
Update symbol prefixes and all callers
2019-02-07 12:23:09 +03:00
Dmitry Gutov
1289ae999b ; project-ignores: Add some TODOs 2019-02-07 12:23:08 +03:00
Felicián Németh
2f55b971b4 Fix Bug#34221
* lisp/progmodes/project.el (project--files-in-directory):
Support remote files.  (Bug#34221)
2019-02-02 13:22:53 +01:00
Dmitry Gutov
8198d4be6b ; Update the commentary 2019-01-19 03:57:58 +03:00
Dmitry Gutov
b6af090022 Misc ignore-related project.el changes
* lisp/progmodes/project.el (project-ignores): Don't append the
default ignores list, just use vc-directory-exclusion-list.
(project--dir-ignores): Use the default ignores if the dir is
outside of the current project.
(project-files): Use project--dir-ignores to support external
roots better.
2019-01-19 03:54:58 +03:00
Dmitry Gutov
fbe87d0f8f Rebase project-find-regexp on top of project-files
* lisp/progmodes/project.el (project--files-in-directory):
New function.
(project-files, project-find-regexp): Use it.
(project--dir-ignores): New function.
(project--find-regexp-in): Remove.
(project--process-file-region): New function.
(project--find-regexp-in-files): New function.
(project-find-regexp, project-or-external-find-regexp): Use it, and
project-files as well.
2019-01-18 06:46:36 +03:00
Dmitry Gutov
afc8a41f48 ; Update the number 2019-01-18 06:46:35 +03:00
Dmitry Gutov
d8da0916ff Make 'project-files' the "canonical" generic of the two
* lisp/progmodes/project.el (project-files): Move the actual
command building and invocation here.
(project-file-completion-table): Delegate to 'project-files'.
2019-01-18 06:46:35 +03:00
Paul Eggert
ba809612c0 Merge from origin/emacs-26
2fcf2df Fix copyright years by hand
26bed8b Update copyright year to 2019
2814292 Fix value of default frame height.  (Bug#33921)
2018-12-31 17:57:29 -08:00
Paul Eggert
26bed8ba10 Update copyright year to 2019
Run 'TZ=UTC0 admin/update-copyright $(git ls-files)'.
2019-01-01 01:01:13 +00:00
Dmitry Gutov
8f9d93f305 project-find-file: Move the common parent directory to the prompt
* lisp/progmodes/project.el (project--completing-read-strict):
Extract the common parent directory of all files first
(https://lists.gnu.org/archive/html/emacs-devel/2018-12/msg00444.html).
2018-12-29 02:15:35 +02:00
Stefan Monnier
55ec674f50 * lisp/multifile.el: New file, extracted from etags.el
The main motivation for this change was the introduction of
project-query-replace.  dired's multi-file query&replace was implemented
on top of etags.el even though it did not use TAGS in any way, so I moved
this generic multifile code into its own package, with a nicer interface,
and then used that in project.el.

* lisp/progmodes/project.el (project-files): New generic function.
(project-search, project-query-replace): New commands.

* lisp/dired-aux.el (dired-do-search, dired-do-query-replace-regexp):
Use multifile.el instead of etags.el.

* lisp/progmodes/etags.el: Remove redundant :groups.
(next-file-list): Remove var.
(tags-loop-revert-buffers): Make it an obsolete alias.
(next-file): Don't autoload (it can't do anything useful before some
other etags.el function setup the multifile operation).
(tags--all-files): New function, extracted from next-file.
(tags-next-file): Rename from next-file.
Rewrite using tags--all-files and multifile-next-file.
(next-file): Keep it as an obsolete alias.
(tags-loop-operate, tags-loop-scan): Mark as obsolete.
(tags--compat-files, tags--compat-initialize): New function.
(tags-loop-continue): Rewrite using multifile-continue.  Mark as obsolete.
(tags--last-search-operate-function): New var.
(tags-search, tags-query-replace): Rewrite using multifile.el.

* lisp/emacs-lisp/generator.el (iter-end-of-sequence): Use 'define-error'.
(iter-make): New macro.
(iter-empty): New iterator.

* lisp/menu-bar.el (menu-bar-search-menu, menu-bar-replace-menu):
tags-loop-continue -> multifile-continue.
2018-09-22 11:46:35 -04:00
Paul Eggert
5c7dd8a783 Update copyright year to 2018
Run admin/update-copyright.
2018-01-01 00:57:59 -08:00
Robert Pluim
104f3e51fe Document how to enter whitespace when using grep-read-files
* lisp/progmodes/grep.el (lgrep, rgrep, grep-read-files): Explain
how to enter whitespace when using grep-read-files.  (Bug#29303)
* lisp/progmodes/project.el (project-find-regexp): Likewise.
* lisp/vc/vc-git.el (vc-git-grep): Likewise.
2017-11-17 15:39:02 +02:00
Paul Eggert
bc511a64f6 Prefer HTTPS to FTP and HTTP in documentation
Most of this change is to boilerplate commentary such as license URLs.
This change was prompted by ftp://ftp.gnu.org's going-away party,
planned for November.  Change these FTP URLs to https://ftp.gnu.org
instead.  Make similar changes for URLs to other organizations moving
away from FTP.  Also, change HTTP to HTTPS for URLs to gnu.org and
fsf.org when this works, as this will further help defend against
man-in-the-middle attacks (for this part I omitted the MS-DOS and
MS-Windows sources and the test tarballs to keep the workload down).
HTTPS is not fully working to lists.gnu.org so I left those URLs alone
for now.
2017-09-13 15:54:37 -07:00
Paul Eggert
5badc81c1c Update copyright year to 2017
Run admin/update-copyright.
2016-12-31 19:42:26 -08:00
Dmitry Gutov
ab3ba912fc shell-quote-argument DIR when appropriate
* lisp/progmodes/project.el (project-file-completion-table):
`shell-quote-argument' DIR as well.

* lisp/progmodes/xref.el (xref--rgrep-command): Pass DIR through
`shell-quote-argument' (bug#23453).  Thanks for Kaushal Modi for
pointing out the problem.  Assert that DIR doesn't start with `~'.
2016-05-05 04:15:23 +03:00
Eli Zaretskii
570e0fa357 Revert "Don't use 'find-program'"
This reverts commit 10597c977d.
2016-04-21 05:07:27 +03:00
Eli Zaretskii
10597c977d Don't use 'find-program'
* lisp/progmodes/project.el (project-file-completion-table): Use
'grep-find-program', rather than the obsolete 'find-program'.
2016-04-11 19:41:48 +03:00
Dmitry Gutov
20686f7a64 Add a `transient' project type
* lisp/progmodes/project.el (project-roots): Implement for the
`transient' project type (bug#23224).
(project-current): Instead of signaling an error, return a
transient project instance rooted in the chosen directory.
2016-04-07 02:02:26 +03:00
Dmitry Gutov
a089d6a211 Don't fiddle with DEFAULT
* lisp/progmodes/project.el (project--completing-read-strict):
Don't change DEFAULT, whether is has any matches in
COLLECTION, or not.
2016-01-30 11:58:17 +03:00
Dmitry Gutov
2b87dea0b8 Improve project-find-file yet again!
* lisp/progmodes/project.el (project--completing-read-strict):
New function.
(project-find-file-in): Use it.
(project-file-completion-table): Move the default
implementation inside the cl-defgeneric form.
(http://lists.gnu.org/archive/html/emacs-devel/2016-01/msg01720.html)
2016-01-30 07:21:31 +03:00