Commit graph

239 commits

Author SHA1 Message Date
Basil L. Contovounesios
a4d3897d8f Replace some uses of cl-mapcan with mapcan
* lisp/progmodes/project.el (project-files, project-files):
* lisp/progmodes/xref.el (xref-backend-references)
(xref--convert-hits):
* test/lisp/emacs-lisp/package-tests.el
(package-test-strip-version): Replace cl-mapcan with equivalent
calls to mapcan.
2020-06-21 14:33:16 +01:00
Dmitry Gutov
a1b487eac0 ; project-shell, project-eshell: Docstring tweaks 2020-06-21 04:19:29 +03:00
Theodor Thornhill
c1056b0387 Pop to an existing Eshell buffer by default
* lisp/progmodes/project.el (project-shell): Improve docstring to
include information about an implementation detail.

* list/progmodes/project.el (project-eshell): Modelled after
'project-shell', change default behavior such that we don't create too
many eshell buffers by default.  Use universal argument to create
subsequent buffers.
2020-06-21 04:07:44 +03:00
Theodor Thornhill
be5d0c0f63 project-shell: Pop to an existing shell buffer by default
* lisp/progmodes/project.el (project-shell):
Pop to an existing shell buffer by default.
If there's none, or if universal argument is used, open a subsequent
shell buffer and jump to it.  Prefix shell buffer name with the base
name of project root directory. (Bug#41858)
2020-06-20 04:02:18 +03:00
Eli Zaretskii
2eda8199bf Fix last change in doc strings of project.el
* lisp/progmodes/project.el (project-switch-to-buffer): More accurate
doc string.
2020-06-19 21:50:30 +03:00
Eli Zaretskii
1e3b0f2d95 Improve doc strings of project.el
* lisp/progmodes/project.el (project-dired, project-shell)
(project-eshell, project-switch-to-buffer, project-kill-buffers)
(project-list-file, 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-prompt-project-dir)
(project-switch-commands, project-switch-project): Fix wording and
formatting of doc strings.
2020-06-19 10:52:00 +03:00
Andrii Kolomoiets
6fe5c21c72 project-switch-to-buffer: Use the "other buffer" as default
* lisp/progmodes/project.el
(project-switch-to-buffer): Pass the "other buffer" as DEF to
read-buffer if it belongs to the current project (bug#41879).
2020-06-19 03:44:01 +03:00
Dmitry Gutov
363d981811 Add binding for project-kill-buffers
* lisp/progmodes/project.el (project-prefix-map):
Add binding for project-kill-buffers (bug#41868).
2020-06-18 18:42:38 +03:00
Philip K
7c177ecb84 New command: project-kill-buffers
* lisp/progmodes/project.el
(project-kill-buffers-skip-conditions): New variable.
(project--buffer-list): New function.
(project-kill-buffers): New command (bug#41868).
2020-06-18 04:04:13 +03:00
Dmitry Gutov
4b9b9cb43a ; Add a heading and a binding 2020-06-18 02:11:51 +03:00
Theodor Thornhill
eb3b03c1c6 New command: project-switch-to-buffer
* lisp/progmodes/project.el (project-switch-to-buffer): New command.
2020-06-18 02:09:41 +03:00
Theodor Thornhill
2f231fcfb7 Add global bindings for project commands
* lisp/progmodes/project.el
(project-prefix-map): New variable.
Add the new keymap to ctl-x-map.
2020-06-18 02:05:31 +03:00
Dmitry Gutov
2cc48d3d10 Fix setting project-vc-merge-submodules via .dir-locals.el
* lisp/progmodes/project.el
(project--vc-merge-submodules-p): New function.
(project-try-vc, project--vc-list-files): Use it.
2020-06-18 01:30:32 +03:00
Dmitry Gutov
3bff583337 Bump the project.el package version
* lisp/progmodes/project.el: Bump the package version.
2020-06-17 01:27:37 +03:00
Dmitry Gutov
1d2c0a2527 Change the key for project-find-regexp
* lisp/progmodes/project.el (project-switch-commands):
Change the key for 'project-find-regexp' to 'g', which seems to be
the consensus.
2020-06-17 01:24:40 +03:00
Dmitry Gutov
6e777a6639 Make project file name completion adhere to customization
* lisp/progmodes/project.el (project-find-file-in):
Bind completion-ignore-case to the value of
read-file-name-completion-ignore-case (bug#41902).
2020-06-17 01:24:40 +03:00
Basil L. Contovounesios
9e04d0f289 ; Simplify last change
* lisp/progmodes/project.el (project--read-project-list): We are
already at BOB after insert-file-contents.
2020-06-10 01:00:01 +01:00
Simen Heggestøyl
d4e7087b68 Save project list as lisp data
Save the project list file as lisp data instead of line separated
strings to make it more extendable in the future.

* lisp/progmodes/project.el (project--read-project-list)
(project--write-project-list, project--add-to-project-list-front)
(project--remove-from-project-list): Adjust to `project--list' now
being an alist.
2020-06-09 20:45:55 +02:00
Simen Heggestøyl
f4568bac56 Change default project list filename to "projects"
* lisp/progmodes/project.el (project-list-file): Change the default
filename to "projects".
2020-06-04 20:16:54 +02:00
Simen Heggestøyl
e7fb0a48a6 Use characters for keys in project-switch-commands
* lisp/progmodes/project.el (project-switch-commands): Use
characters for keys instead of string for better future
compatibility with 'read-multiple-choice'.
(project-switch-project): Adjust to above change.
2020-06-04 20:14:02 +02:00
Simen Heggestøyl
b41be0ee83 ; Small cleanup in project.el
* lisp/progmodes/project.el (project--add-to-project-list-front):
Minor simplification after recent changes.
2020-06-04 20:11:58 +02:00
Basil L. Contovounesios
74966904b0 ; Clean up recent project.el additions
* lisp/progmodes/project.el (project): Add :version tag.
(project-list-file): Fix custom :type and add :version tag.
2020-06-03 11:45:54 +01:00
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