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

317 commits

Author SHA1 Message Date
Dmitry Gutov
1fe1c84b18 Small cleanup
* lisp/progmodes/project.el (project--add-to-project-list-front):
Small simplification.
(project--remove-from-project-list): Remove oudated comment.
2020-06-03 00:33:14 +03:00
Dmitry Gutov
8b71bfb891 project-list-file: New user option
* lisp/progmodes/project.el (project): New custom group.
(project-vc): Use it as parent.
(project-vc-merge-submodules): Tag with Emacs version.
(project-read-file-name-function): Assign to the 'project' group.
(project-list-file): New user option (bug#41600).
(project--write-project-list, project--read-project-list): Use it.
2020-06-03 00:27:29 +03:00
Simen Heggestøyl
9afcf2bd39 Write project list to file only when changed
* lisp/progmodes/project.el (project--add-to-project-list-front):
Write the project list to file only when it has changed.
2020-06-02 19:27:55 +02:00
Simen Heggestøyl
e7065459d9 Remove 'project--ensure-file-exists'
* lisp/progmodes/project.el (project--ensure-file-exists): Remove.
(project--read-project-list): Set 'project--list' to nil when the
project list file doesn't exist.
2020-06-02 19:12:19 +02:00
Juri Linkov
2c1e5b9e77 * lisp/progmodes/project.el (project-vc-dir, project-shell): New commands.
(project-compile): Add args and interactive spec like in 'compile'.
(project-switch-commands): Bind project-vc-dir to "v",
project-shell to "s", and rebind project-find-regexp from "s" to "r".

* doc/emacs/maintaining.texi (Project File Commands):
Describe project-vc-dir and project-shell.
2020-06-02 02:01:25 +03:00
Dmitry Gutov
780f674a82 Don't return transient projects with MAYBE-PROMPT=nil
* lisp/progmodes/project.el (project-current): Only return
transient projects when called with non-nil MAYBE-PROMPT.
Also only update the known projects lists in this case.
(https://lists.gnu.org/archive/html/emacs-devel/2020-05/msg03375.html).
2020-05-30 19:57:38 +03:00
Dmitry Gutov
ba292ea330 project-prompt-project-dir: Use more consistent prompts
* lisp/progmodes/project.el (project-prompt-project-dir):
Use more consistent prompts.
2020-05-29 21:37:12 +03:00
Dmitry Gutov
7af4e72de2 ; project.el: Update TODO 2020-05-29 02:05:05 +03:00
Simen Heggestøyl
b7dffcb501 Simplify the previous commit
* lisp/progmodes/project.el (project--read-project-list): Simplify the
previous commit by utilizing the optional OMIT-NULLS argument to
'split-string'.
2020-05-27 17:26:25 +02:00
Simen Heggestøyl
449810bbe9 Avoid adding the empty string to the project list
* lisp/progmodes/project.el (project--read-project-list): Avoid adding
the empty string to the project list.
2020-05-26 17:42:32 +02:00
Simen Heggestøyl
5a48ede3ac Adapt project functions to the new 'project-root'
* lisp/progmodes/project.el (project-dired, project-eshell)
(project--read-project-list, project--write-project-list)
(project--add-to-project-list-front)
(project--remove-from-project-list): Adapt to the new 'project-root'.
2020-05-26 17:42:24 +02:00
Dmitry Gutov
0b057ca9bc Teach project-current to inhibit the prompt
* lisp/progmodes/project.el:
(project-current-inhibit-prompt): New variable.
(project-current, project-switch-project): Use it.
2020-05-26 17:41:45 +02:00
Simen Heggestøyl
70824683fd Rename 'project-switch-menu' to 'project-switch-commands'
* lisp/progmodes/project.el (project-switch-commands): Rename from
'project-switch-menu'.
(project--keymap-prompt, project-switch-project): Update after the
renaming.
2020-05-26 17:41:24 +02:00
Simen Heggestøyl
c6e80fdb65 Simplify 'project--keymap-prompt' a bit
* lisp/progmodes/project.el: Remove seq requirement.
(project--keymap-prompt): Simplify with 'mapconcat'.
2020-05-26 17:41:24 +02:00
Simen Heggestøyl
c6f56bd279 Turn project switch menu var into a public alist
* lisp/progmodes/project.el: Require seq.
(project--switch-alist): Remove in favor of the public
'project-switch-menu'.
(project-add-switch-command): Remove; not needed now that
'project-switch-menu' is a public alist.
(project-switch-menu): New variable mapping keys to project switching
menu entries.
(project--keymap-prompt, project-switch-project): Adjust to the new
'project-switch-menu' format.
2020-05-26 17:41:24 +02:00
Simen Heggestøyl
46bb2cbd00 Change dispatch binding of 'project-find-regexp'
* lisp/progmodes/project.el: Change default dispatch binding of
'project-find-regexp' to 's'.
2020-05-26 17:41:24 +02:00
Dmitry Gutov
02e1ee95a8 Integrate project-switch-project with project-find-regexp
* lisp/progmodes/project.el:
(project-find-regexp): Add to the list of 'switch' commands.
(project-switch-project): Use call-interactively so that the
former can read its arguments.
2020-05-26 17:41:24 +02:00
Dmitry Gutov
afb96da611 Move project-dired and project-eshell higher
* lisp/progmodes/project.el:
(project-dired, project-eshell): Move higher in the file,
according to their universal utility.
2020-05-26 17:41:24 +02:00
Dmitry Gutov
c8cca68751 Use an alist instead of a keymap
* lisp/progmodes/project.el:
(project--switch-alist): New variable to use instead of
project-switch-keymap, which remove.  Update all references.
2020-05-26 17:41:24 +02:00
Dmitry Gutov
9422fb5e68 Improve project name completion
* lisp/progmodes/project.el:
(project-prompt-project-dir): Use REQUIRE-MATCH=t.  Make sure the
'substring' completion style is used by default.
2020-05-26 17:41:24 +02:00
Dmitry Gutov
9f88356b67 Simplify a little, and avoid duplicate commands
* lisp/progmodes/project.el:
(project--transient-p) Remove, not needed.
(project-current): Move project-find based on the directory here.
(project--remove-from-project-list): Only write if the list changed.
(project-find-project): Rename to project-prompt-project-dir.
Simply return the directory selected by the user.
(project-switch-project-find-file): Remove.
(project-switch-project-dired): Rename to project-dired and make
it follow the convention of existing projec tcommands.
(project-switch-project-eshell): Ditto.
(project-switch-project): Instead of passing the project instance
to the command, just bind default-directory.
2020-05-26 17:41:24 +02:00
Simen Heggestøyl
afb7602a24 Add project switching functionality
* lisp/progmodes/project.el: Require subr-x.
(project--transient-p, project--ensure-file-exists)
(project--read-project-list, project--ensure-read-project-list)
(project--write-project-list)
(project--add-to-project-list-front)
(project--remove-from-project-list, project-find-project)
(project-switch-project-find-file, project-switch-project-dired)
(project-switch-project-eshell, project-add-switch-command)
(project--keymap-prompt, project-switch-project): New functions.
(project--list, project-switch-keymap): New variables.
(project-current): Call 'project-find-project' when no project is
current.
2020-05-26 17:41:22 +02:00
Dmitry Gutov
3f66908ee0 Bump project.el version
* project.el: Bump the version
2020-05-25 22:29:47 +03:00
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