1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 02:20:21 -08:00
Commit graph

244 commits

Author SHA1 Message Date
Dmitry Gutov
c0275555f2 ; More the note about reporting problems further up 2020-05-25 22:29:06 +03:00
Dmitry Gutov
5044c19001 project.el: A project has only one main root now
Practice shows that the vast majority of projects only use one main
root.  The users of this API very often make this assumption as well.
The rest of the "roots" should be possible to express through
project-external-roots.

* lisp/progmodes/project.el: Update the commentary.
Only 4 non-obsolete generics now.
(project-root): Replacement for `project-roots'.
All callers updated.  Implementations too.
(project-roots): Declare obsolete.
(project-external-roots): Simplify the docstring.
(project-ignores): Update the docstring.
(project-find-regexp): Omit the second arg to project-files.
(project--dir-ignores): Simplify.
(project-compile): Simplify, remove outdated comment.

* lisp/cedet/ede.el: Add a FIXME.
2020-05-23 04:54:42 +03:00
Philip K
babdd2e90e Add project-compile command
* lisp/progmodes/project.el (project-compile):
  New function.
2020-05-20 02:07:01 +03:00
Dmitry Gutov
3c2624e188 project--vc-list-files: Don't list conflicted files thrice
* lisp/progmodes/project.el (project--vc-list-files):
Use delete-consecutive-dups.
2020-05-20 02:07:01 +03:00
Dmitry Gutov
2216468786 Update the package version
* lisp/progmodes/project.el: Update the package version.
(project-vc-merge-submodules): Update the docstring.
(project-try-vc): Add a FIXME.
2020-05-18 03:45:38 +03:00
Dmitry Gutov
30e8d560aa Add user option project-vc-merge-submodules
* lisp/progmodes/project.el (project-vc): Update the docstring.
(project-vc-merge-submodules): New user option.
(project-try-vc): Use it.
(project--submodule-p): Extract from project-try-vc.
2020-05-18 03:36:43 +03:00
Dmitry Gutov
1fc4e3fb3f ; Bump the project.el version to trigger a new release 2020-05-17 05:01:09 +03:00
Stefan Monnier
dba8f3783b * lisp/progmodes/project.el (project-try-vc): Fix regexp typo. 2020-05-15 17:30:47 -04:00
Dmitry Gutov
4307a84fd8 Fix submodules, second try
* lisp/progmodes/project.el (project-try-vc):
Call the backend directly instead of binding default-directory.
2020-05-16 00:06:55 +03:00
Dmitry Gutov
afca37343d Fix Git submodules detection breakage
* lisp/progmodes/project.el (project-try-vc):
Use the absolute name of .git both times.
2020-05-15 22:10:25 +03:00
Dmitry Gutov
779bc886f9 Improve detection of Git submodules
* lisp/progmodes/project.el (project-try-vc):
Improve detection of Git submodules
(https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg02008.html).
2020-05-15 08:10:22 +03:00
João Távora
9ebf51999c Turn Eldoc, Xref and Project into GNU ELPA :core packages
The new packages state they require Emacs 26.3 to function, but a
small part of project.el breaks this "soft" rule: the two functions
requiring fileloop.el are incompatible with Emacs 26.3.

* lisp/jsonrpc.el: Tweak comment near Package-Requires.

* lisp/emacs-lisp/eldoc.el: Add Version and Package-Requires.

* lisp/progmodes/flymake.el: Add comment near Package-Requires.

* lisp/progmodes/project.el: Add Version and Package-Requires.

* lisp/progmodes/xref.el: Add Version and Package-Requires.
2020-05-13 11:31:35 +01:00
Dmitry Gutov
1f17193e00 Expand file name for remote dirs as well
* lisp/progmodes/project.el (project--files-in-directory):
Expand file name for remote dirs as well (bug#40940).
2020-04-29 22:46:17 +03:00
Eli Zaretskii
7a12ab5ea2 Fix project.el commands in "transient" projects
* lisp/progmodes/project.el (project--files-in-directory): Run
local DIR directory names through 'expand-file-name', so that "~/"
is expanded, in case the shell doesn't or the shell's notion of
the home directory is different from that of Emacs.  (Bug#40940)
2020-04-29 18:58:42 +03:00
Dmitry Gutov
ac3da1dd96 Handle project--files-in-directory finding no files better
* lisp/progmodes/project.el (project--find-regexp-in-files):
Signal user-error when passed an empty list of files.

* lisp/progmodes/xref.el (xref-matches-in-files):
Make sure FILES is not empty.
2020-03-30 23:16:27 +03:00
Eli Zaretskii
561e9fb91b Improve documentation of project.el commands
* lisp/progmodes/project.el (project-find-regexp): Require 'grep'
to be able to call 'grep-read-files'.
(project-search, project-query-replace-regexp): Doc fixes.

* doc/emacs/maintaining.texi (Projects): New section.
* doc/emacs/emacs.texi (Top): Add "Projects" to the detailed menu.
2020-03-21 13:26:19 +02:00
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