Commit graph

268 commits

Author SHA1 Message Date
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
Stephen Leake
545ad84a8c Fix typo in previous commits
* lisp/progmodes/project.el (project-find-file-in):
* lisp/vc/vc-mtn.el (vc-mtn-find-ignore-file): Fix typo in previous
commit.
2016-01-29 17:53:35 -06:00
Stephen Leake
7deeab6ff0 Improve project-find-file
* lisp/progmodes/project.el (project-file-completion-table): New.
(project-find-file, project-or-external-find-file): Default to filename
at point.
(project-file-completion-table): New, split out from
project--find-file-in.
(project-find-file-in): Renamed from project--find-file-in, use
project-file-completion-table.

* lisp/progmodes/xref.el (ede-minor-mode): New declaration.
(xref--find-ignores-arguments): Add doc string.
2016-01-29 17:46:18 -06:00
Dmitry Gutov
4e559f22a0 * lisp/progmodes/project.el (project--read-regexp): Quote the identifier. 2016-01-18 22:14:17 +03:00
Glenn Morris
e85e0d5951 Add some missing version tags.
* lisp/electric.el (electric-quote-comment)
(electric-quote-string, electric-quote-paragraph):
* lisp/epg-config.el (epg-gpgconf-program):
* lisp/rect.el (rectangle-preview):
* lisp/emacs-lisp/check-declare.el (check-declare-ext-errors):
* lisp/emacs-lisp/package.el (package-selected-packages)
(package-hidden-regexps):
* lisp/erc/erc.el (erc-network-hide-list, erc-channel-hide-list):
* lisp/eshell/em-term.el (eshell-destroy-buffer-when-process-dies):
* lisp/gnus/mml-sec.el (mml1991-signers, mml2015-signers)
(mml-smime-signers, mml1991-encrypt-to-self, mml2015-encrypt-to-self)
(mml-smime-encrypt-to-self, mml2015-sign-with-sender)
(mml-smime-sign-with-sender, mml2015-always-trust)
(mml-secure-fail-when-key-problem, mml-secure-key-preferences):
* lisp/net/browse-url.el (browse-url-conkeror-new-window-is-buffer)
(browse-url-conkeror-arguments):
* lisp/net/newst-reader.el (newsticker-download-logos):
* lisp/progmodes/gud.el (gud-guiler-command-name):
* lisp/progmodes/prog-mode.el (prettify-symbols-unprettify-at-point):
* lisp/progmodes/project.el (project-vc):
* lisp/progmodes/python.el (python-indent-guess-indent-offset-verbose)
(python-shell-remote-exec-path, python-shell-first-prompt-hook)
(python-shell-completion-native-disabled-interpreters)
(python-shell-completion-native-enable)
(python-shell-completion-native-output-timeout)
(python-shell-completion-native-try-output-timeout):
* lisp/progmodes/xref.el (xref):
* lisp/term/screen.el (xterm-screen-extra-capabilities):
* lisp/term/xterm.el (xterm-max-cut-length):
Add missing version tags.
2016-01-12 20:06:49 -05:00
Eli Zaretskii
cc140bcec6 Document user-level functions in project.el
* lisp/progmodes/project.el (project-find-file)
(project-or-external-find-file): Add doc strings.
2016-01-09 21:45:33 +02:00
Dmitry Gutov
a034dd384c Fix two project-find-file issues
* lisp/progmodes/project.el (project--value-in-dir):
Temporarily set enable-local-variables to :all.
(project-find-file, project-or-external-find-file):
All autoloads.
(project--find-file-in): Require xref.
2016-01-08 14:32:39 +03:00
Dmitry Gutov
648de81b0b ; Add NEWS entry for project.el 2016-01-08 02:54:50 +03:00
Dmitry Gutov
ed41d117a4 Add project-find-file and project-or-external-find-file
* lisp/minibuffer.el (completion-category-defaults):
Add `project-file' category.

* lisp/progmodes/project.el (project-find-file)
(project-or-external-find-file): New commands.
(project--find-file-in): New private function.

* lisp/progmodes/xref.el (xref-collect-matches): Use
`expand-file-name' on DIR, to expand the tildes.
(xref--find-ignores-arguments): Extract from
`xref--rgrep-command'.
2016-01-07 20:56:09 +03:00
Paul Eggert
0e963201d0 Update copyright year to 2016
Run admin/update-copyright.
2016-01-01 01:34:24 -08:00
Paul Eggert
00beafafd7 Spelling fix 2015-12-28 19:06:14 -08:00