Commit graph

239 commits

Author SHA1 Message Date
Philip Kaludercic
8761d30da0
Avoid failing if vc backend doesn't implement ignore-completion-table
* project.el (project-ignores): Handle vc-not-supported signals
2021-08-31 23:36:55 +02:00
Eli Zaretskii
742ae84a9c ; * lisp/progmodes/project.el: Fix punctuation in the commentary. 2021-08-21 10:10:28 +03:00
Dmitry Gutov
28170b7d48 Speed up project--read-project-buffer in remote buffers
* lisp/progmodes/project.el (project-buffers): New generic function.
(project--read-project-buffer): Use it here (bug#49264).
(project--buffers-to-kill): And here.
(project-buffers): Specialized implementation for vc-project.
2021-08-21 05:26:12 +03:00
Dmitry Gutov
3b32d057ff project.el: Bump the version
* lisp/progmodes/project.el: Bump the version.
2021-08-08 14:13:49 +03:00
Dmitry Gutov
35cea6c94c Add colon-space after prompt
* lisp/progmodes/project.el (project--completing-read-strict):
Fix last change's regression (bug#49865).
2021-08-06 11:36:14 +03:00
Dmitry Gutov
fa895379d6 Change how project-find-file's completion works
* lisp/progmodes/project.el (project--completing-read-strict):
Allow to choose a non-existent file, with confirmation
(bug#49204).
Don't use the string at point as a "real" default, and instead
only include it in "future history": meaning, it will be inserted
on 'M-n' (bug#49865).
2021-08-06 03:30:10 +03:00
Juri Linkov
a6f67d60e1 * lisp/progmodes/project.el (project-switch-project): Use 'let*' (bug#49635).
This allows overriding-local-map to have effect on read-key-sequence.
2021-08-01 23:43:37 +03:00
Philipp Stephani
2e55201b80 Fix find invocation for macOS (Bug#48471).
* lisp/progmodes/project.el (project--files-in-directory): Instead of
appending a slash (which doesn't work well with macOS find), remove
trailing slash and pass -H instead.
2021-05-23 13:03:49 +02:00
Jim Porter
704755a568 Shell-quote the directory when finding a project's files
* lisp/progmodes/project.el (project--files-in-directory):
Shell-quote the directory (bug48247).
2021-05-06 20:44:50 +03:00
Dmitry Gutov
8616e4f747 project--buffer-list: Tighten the check
* lisp/progmodes/project.el (project--buffer-list): Tighten the
check to speed up in the presence of multiple Tramp sessions, too.
(https://lists.gnu.org/archive/html/emacs-devel/2021-05/msg00152.html)
2021-05-06 20:43:02 +03:00
Philip K
3c4619edeb project--buffer-list: Avoid Tramp buffers when possible
* project.el (project--buffer-list): Add file-remote-p check.
2021-05-04 00:36:00 +03:00
Dmitry Gutov
1054525ae3 * lisp/progmodes/project.el: Also bump version. 2021-04-29 05:02:13 +03:00
Juri Linkov
bc026835df * lisp/progmodes/project.el: Use project-prefixed-buffer-name in more places.
(project-shell, project-eshell): Use project-prefixed-buffer-name (bug#47975).
(project-compilation-buffer-name-function): Add :version tag.
2021-04-25 00:54:01 +03:00
Dmitry Gutov
08fab316a1 Misc changes
* lisp/progmodes/project.el (project-shell, project-eshell):
Simplify.
(project-switch-commands, project-switch-use-entire-map):
Add :group keywords (to fix misattribution to project-vc).
2021-04-23 03:24:47 +03:00
Ivan Sokolov
1c3a86e7fc Introduce project-compilation-buffer-name-function
* lisp/progmodes/project.el (project-compilation-buffer-name-function):
New option.
(project-compile): Use it.
(project-prefixed-buffer-name): New function.

Copyright-paperwork-exempt: yes
2021-04-23 03:14:44 +03:00
Dmitry Gutov
eadf4cff7c Move part of the fix from project to xref
* lisp/progmodes/project.el (project--find-regexp-in-files):
Don't unquote file names here.

* lisp/progmodes/xref.el (xref-matches-in-files): Do it here.
And only if the first element in the list is quoted (bug#47799).
2021-04-22 17:40:30 +03:00
Philipp Stephani
6ebc6e12cf Add quoted filename support to 'project-find-regexp' (Bug#47799).
This is only a band-aid; it would be better to fix xref.el to work
with quoted filenames as well.

* lisp/progmodes/project.el (project--find-regexp-in-files): Unquote
filenames before passing them to 'xref-matches-in-files'.
* test/lisp/progmodes/project-tests.el (project/quoted-directory):
Also test 'project-find-regexp'.
2021-04-18 21:59:25 +02:00
Dmitry Gutov
f955df1788 Improve quoting of directory names in project/xref
* lisp/progmodes/project.el (project--files-in-directory):
Quote LOCALDIR a bit earlier, to affect
xref--find-ignores-arguments as well (bug#47799).

* lisp/progmodes/xref.el (xref-matches-in-directory):
Quote the dir passed to xref--rgrep-command.
2021-04-16 03:52:44 +03:00
Dmitry Gutov
4180429d5d project--files-in-directory: Handle errors reported by 'find'
* lisp/progmodes/project.el (project--files-in-directory):
Handle errors reported by 'find' (bug#47799).
2021-04-16 03:38:23 +03:00
Philipp Stephani
157bfc1812 Improve project support for quoted directory names (Bug#47799)
* lisp/progmodes/project.el (project--files-in-directory): Unquote
directory name before passing it to 'find'.
(project--remote-file-names): Requote local filenames if the original
directory is quoted.
* test/lisp/progmodes/project-tests.el (project/quoted-directory): New
unit test.
2021-04-15 18:41:04 +02:00
Dmitry Gutov
1ff7cde102 Add explicit support for C-g or ESC ESC ESC after keymap prompt
* lisp/progmodes/project.el (project-switch-project):
Add explicit support for C-g or ESC ESC ESC after keymap prompt
(bug#47620).
2021-04-07 03:25:18 +03:00
Dario Gjorgjevski
5d293f4f74 Allow complex key bindings in project-switch-project
* lisp/progmodes/project.el (project-switch-project): Replace
read-event with an overriding local map and read-key-sequence to allow
for complex key bindings to be read (bug#47620).
2021-04-07 03:24:49 +03:00
Dario Gjorgjevski
ddc4bba413 Do not search the global keymap in project--keymap-prompt
* lisp/progmodes/project.el: (project--keymap-prompt) Pass
project--keymap-prompt as a list to where-is-internal so that the
global keymap is not searched at all (bug#47501).
2021-04-05 18:15:16 +02:00
Dmitry Gutov
4798dc0c51 Fix C-u project-find-regexp's default dir
* lisp/progmodes/project.el (project-find-regexp):
Default read-directory-name to the current default-directory when
called with C-u (bug#47012).
2021-04-02 01:24:57 +03:00
Juri Linkov
b6552b1d7c * lisp/progmodes/project.el (project-regexp-history-variable): New variable.
(project--read-regexp): Use it as HISTORY arg of 'read-regexp' with
'grep-regexp-history' default (bug#47012).
2021-03-29 22:34:51 +03:00
Dmitry Gutov
c678b137ab Fix typo
* lisp/progmodes/project.el (project-remove-known-project):
Fix typo (bug#47287).
2021-03-25 01:20:26 +02:00
Theodor Thornhill
275be44dd4 Add command project-remove-known-project
* etc/NEWS: Mention the new command.

* lisp/progmodes/project.el (project--remove-from-project-list): Add
new argument, report-message, used to signal various messages when
removal has happened.

* lisp/progmodes/project.el (project-remove-known-project): New
command that removes the selected directory from the project-list-file.

* lisp/progmodes/project.el (project-current): Add the report message.

* doc/emacs/maintaining.text: Add information about the new command to
the manual.
2021-03-25 01:15:50 +02:00
Theodor Thornhill
70b64e0d04 Use pop-to-buffer-same-window for shell
* lisp/progmodes/project.el (project-shell): Behave the same way as
'M-x project-eshell'.
* lisp/shell.el (shell): Behave the same way as 'M-x eshell'.
* etc/NEWS: Add news entry describing the change.
* lisp/tutorial.el: Use lexical-binding.
2021-03-21 14:40:32 +02:00
Dmitry Gutov
c28ba11778 Leave signaling the exact error to cl-generic's internals
* lisp/progmodes/project.el (project-root): Extract default
definition to a new method, predicated on a context
(https://lists.gnu.org/archive/html/emacs-devel/2021-03/msg00771.html).
2021-03-18 02:35:10 +02:00
Dmitry Gutov
6e796b52e1 Stop project-root from going into infinite recursion
* lisp/progmodes/project.el (project--within-roots-fallback):
New variable.
(project-root, project-roots): Use it (bug#47168).
2021-03-17 18:49:14 +02:00
Basil L. Contovounesios
17cdb732a7 ; Fix some typos. 2021-03-11 22:51:42 +00:00
Dmitry Gutov
de9b19cbfd (project-switch-commands): Remove the ###autoload instruction
* lisp/progmodes/project.el (project-switch-commands):
Remove the ###autoload instruction.  It's unnecessary and can
cause surprises in some circumstances (bug#46986).
2021-03-10 03:08:37 +02:00
Dmitry Gutov
8538108132 Strip text properties from the default string
* lisp/progmodes/project.el (project--read-regexp):
Strip text properties from the default string (bug#47012).
2021-03-09 04:06:01 +02:00
Simen Heggestøyl
432c1aaa80 Use pop-to-buffer-same-window' in project-eshell'
* lisp/progmodes/project.el (project-eshell): Use
`pop-to-buffer-same-window' instead of `pop-to-buffer' to match the
behavior of `M-x eshell'.
2021-03-08 12:58:10 +01:00
Dmitry Gutov
06e1e5eeac Revert "Fix the previous change"
This reverts commit fc37dc298f.

That change was only needed in the release branch.
2021-02-06 22:59:00 +02:00
Glenn Morris
3c0f86312e Merge from origin/emacs-27
8c27af3ff4 Clarify how transient indentation modes are exited in the ...
fc37dc298f Fix the previous change
2021-02-06 08:05:29 -08:00
Dmitry Gutov
fc37dc298f Fix the previous change
* lisp/progmodes/project.el (project-find-regexp):
Fix the previous change (project-root is not defined in this version).
(project-or-external-find-regexp): Same.
2021-02-05 01:17:09 +02:00
Dmitry Gutov
b99848c72c Bind default-directory to the project root
* lisp/progmodes/project.el (project-find-regexp):
Bind default-directory to the project root, to save this value
in the resulting buffer (esp. if the project selector was used,
(https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg00140.html).
(project-or-external-find-regexp): Same.

(cherry picked from commit c07ebfcbe0)
2021-02-04 22:06:16 +02:00
Dmitry Gutov
c07ebfcbe0 Bind default-directory to the project root
* lisp/progmodes/project.el (project-find-regexp):
Bind default-directory to the project root, to save this value
in the resulting buffer (esp. if the project selector was used,
(https://lists.gnu.org/archive/html/emacs-devel/2021-02/msg00140.html).
(project-or-external-find-regexp): Same.
2021-02-04 03:38:42 +02:00
João Távora
2a71831eb3 Allow project/xref packages to be used in Emacs 26.1
* lisp/progmodes/project.el: Change Package-Requires to Emacs 26.1
(bug#44671).

* lisp/progmodes/xref.el: Ditto.
2021-01-28 04:18:12 +01:00
Juri Linkov
5065698c81 Move the ‘declare’ form before the interactive spec in 10 functions.
* lisp/emacs-lisp/package.el (package-menu-hide-package):
* lisp/font-lock.el (font-lock-debug-fontify):
* lisp/image.el (image-jpeg-p):
* lisp/mail/flow-fill.el (fill-flowed-test):
* lisp/mh-e/mh-speed.el (mh-speed-toggle, mh-speed-view):
* lisp/progmodes/project.el (project-async-shell-command)
(project-shell-command, project-compile):
* lisp/progmodes/sh-script.el (sh-assignment):
Fix special forms to follow in this order: docstring, declare, interactive.
2021-01-20 21:19:23 +02:00
Dmitry Gutov
8725f7690a Declare some project commands interactive-only
* lisp/progmodes/project.el (project-async-shell-command)
(project-shell-command, project-compile):
Declare interactive-only (bug#45765).
2021-01-19 21:50:11 +02:00
Kévin Le Gouguec
1513ee37a4 Change default-directory before prompting in project-compile
This causes command completion to work from the project root, letting
users complete top-level folders, make targets, etc (bug#45765).

* lisp/progmodes/project.el (project-compile): Simplify using
call-interactively, as done with project(-async)-shell-command.
2021-01-16 06:00:22 +02:00
Dmitry Gutov
665b4e7c4e Proof some searches and file listings against symlinks
* lisp/progmodes/project.el (project--files-in-directory):
Make sure the directory includes the trailing slash in case it's
a symlink, discussed in
https://lists.gnu.org/archive/html/emacs-devel/2021-01/msg00345.html.

* lisp/progmodes/xref.el (xref-matches-in-directory): Same.

* lisp/cedet/semantic/symref/grep.el (semantic-symref-perform-search):
Same.
2021-01-06 23:07:22 +02:00
Paul Eggert
ba05d005e5 Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright".
2021-01-01 01:13:56 -08:00
Paul Eggert
8c1fe1e5ef Update copyright year to 2021
Run "TZ=UTC0 admin/update-copyright $(git ls-files)".
2021-01-01 00:32:32 -08:00
Dmitry Gutov
32e781b2f1 Jamie Beardslee <beardsleejamie@gmail.com>
* lisp/progmodes/project.el (project-execute-extended-command):
New command.
(project-prefix-map): Binding for it.

Copyright-paperwork-exempt: yes
2020-12-20 00:16:48 +02:00
Mattias Engdegård
6858119bcd ; * lisp/progmodes/project.el (project-switch-use-entire-map): Typo 2020-12-14 12:33:05 +01:00
Dmitry Gutov
51698f77dd Remove the duplication from project-switch-commands's config
Based on an older patch by Philip K (https://debbugs.gnu.org/41890#127).

* lisp/progmodes/project.el: (project-switch-commands): Change to
'defcustom', alter the value format, add :type.
(project-switch-use-entire-map): New option.
(project--keymap-prompt, project-switch-project):
Update accordingly, while keeping compatibility with user-defined
values in the previous format (for some transition period).

Co-authored-by: Philip K. <philipk@posteo.net>
2020-12-13 22:50:55 +02:00
Dmitry Gutov
2d790c6c57 Bump project.el version
* lisp/progmodes/project.el: Bump the version.
2020-12-13 04:12:35 +02:00