1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-22 05:31:01 -08:00
Commit graph

350 commits

Author SHA1 Message Date
Dmitry Gutov
785fa80159 New user option: project-vc-extra-root-markers
* lisp/progmodes/project.el: Commentary update.
(project-vc, project-vc-include-untracked, project-vc-name):
Update docstrings.  Rename 'VC project' to 'VC-aware project'.
(project-vc-extra-root-markers): New option (bug#41572).
(project-try-vc): Use it.  Construct a single regexp from all and
validate it using the MATCH argument of 'directory-files'.  Call
'locate-dominating-file' directly.
(project-ignores): Support VC-aware project instances with nil
value of VC backend.

* test/lisp/progmodes/project-tests.el (project-vc-recognizes-git)
(project-vc-extra-root-markers-supports-wildcards)
New tests.
(project-tests--this-file): New variable.
2022-12-01 04:09:14 +02:00
Dmitry Gutov
2a8f31b996 project-current: Improve the docstring
* lisp/progmodes/project.el (project-current):
Improve the docstring (bug#59722).
2022-11-30 17:25:55 +02:00
Augusto Stoffel
13bb49bc0b In project-find-file, add abbreviated file names to history
* lisp/progmodes/project.el (project--read-file-cpd-relative):
Use 'abbreviate-file-name' (bug#58447).
2022-11-29 18:15:09 +02:00
Dmitry Gutov
4dab5f8671 * lisp/progmodes/project.el (project-vc-name): Fix the :type form (bug#48747). 2022-11-29 18:01:55 +02:00
Augusto Stoffel
24c06a92e9 In project-find-file and the like, add absolute file name to history
* lisp/progmodes/project.el (project--read-file-cpd-relative): Add
absolute file name to history.
2022-11-26 14:34:11 +02:00
Dmitry Gutov
2389158a31 Drop project--value-in-dir
Drop the project--value-in-dir mechanics, where the user could edit
the value in .dir-locals.el and have it applied instantly without
reverting the current buffer.  It made working in remote buffers with
enable-remote-dir-locals non-nil slower, which doesn't seem worth it
for a minor improvement of an infrequent operation.  Also less
compexity overall.

* lisp/progmodes/project.el (project-try-vc, project-files)
(project--vc-list-files, project-ignores, project-buffers):
Use the user options directly.
(project--vc-merge-submodules-p, project--value-in-dir):
Delete functions.
2022-11-25 23:52:46 +02:00
Dmitry Gutov
b37604c263 project-switch-project: Use a different fix for bug#58784
* lisp/progmodes/project.el (project-current-inhibit-prompt):
Rename to 'project-current-directory-override', and make it a
string value.
(project-current): Refer to it.
(project-switch-project): Bind it.  Drop the temp buffer (bug#58784).
2022-11-24 04:33:14 +02:00
Dmitry Gutov
efe599df31 Add a way to override project name for project-vc backend
* lisp/progmodes/project.el (project-vc-name): New user option.
(project-name): Override for VC project backend (bug#48747).
2022-11-23 04:17:06 +02:00
Stephen Leake
361297c6f4 * lisp/progmodes/project.el (project-name): New 2022-11-22 10:55:59 -08:00
Juri Linkov
125b5684c3 New command 'project-list-buffers' bound to 'C-x p C-b' (bug#59153)
* doc/emacs/maintaining.texi (Project Buffer Commands):
Add 'project-list-buffers'.

* lisp/buff-menu.el (Buffer-menu-filter-predicate): New defvar-local.
(list-buffers-noselect): Add new optional arg 'filter-predicate'.
Set 'Buffer-menu-filter-predicate' to 'filter-predicate'.
(list-buffers--refresh): Use 'Buffer-menu-filter-predicate'.

* lisp/progmodes/project.el (project-prefix-map): Bind "\C-b" to
'project-list-buffers'.
(project-list-buffers): New command.
2022-11-15 20:54:39 +02:00
Dmitry Gutov
c0474ca21d Hardcode "-name" instead of using find-name-arg
* lisp/progmodes/project.el (project--files-in-directory):
Hardcode "-name" instead of using find-name-arg (bug#59023).
2022-11-14 02:19:10 +02:00
Dmitry Gutov
d2f956807e project--buffer-list: Remove as unused
* lisp/progmodes/project.el (project--buffer-list):
Remove as unused (pointed out in bug#59153 by Juri).
2022-11-12 03:34:41 +02:00
Juri Linkov
8a49a88853 ; * lisp/progmodes/project.el (project-kill-buffer-conditions): Fix typo. 2022-11-05 19:45:57 +02:00
Dmitry Gutov
06f0d4793c project-kill-buffer-conditions: Tweak
* lisp/progmodes/project.el (project-kill-buffer-conditions): Tweak.
2022-11-05 02:54:32 +02:00
Eli Zaretskii
dcb11202ac ; * lisp/progmodes/project.el (project-buffers): Doc fix. 2022-11-04 15:56:30 +02:00
Dmitry Gutov
a248eb3d18 ; Minor rephrase 2022-11-04 12:41:00 +02:00
Dmitry Gutov
7d47651d01 project-buffers: Describe the default implementation
* lisp/progmodes/project.el (project-buffers):
Describe what the default implementation is doing (bug#58784).
2022-11-04 03:16:36 +02:00
Dmitry Gutov
ef45bfacb2 project-kill-buffer-conditions: Skip Gnus modes as well
* lisp/progmodes/project.el (project-kill-buffer-conditions):
Skip Gnus modes as well (bug#58839).
2022-11-04 03:03:29 +02:00
Dmitry Gutov
44f23dac25 project-kill-buffer-conditions: Skip hidden ones
* lisp/progmodes/project.el (project-kill-buffer-conditions):
Make exception for "hidden" buffers (bug#58839).
2022-11-04 02:59:12 +02:00
Dmitry Gutov
835295381b project-switch-project: Avoid altering default-directory in cb
* lisp/progmodes/project.el (project-switch-project):
Avoid altering default-directory in the current buffer, even
temporarily (bug#58784).
2022-11-02 01:30:08 +02:00
Dmitry Gutov
ef6e518035 ; lisp/progmodes/project.el: Bump version 2022-10-12 00:04:54 +03:00
ookami
4cf9c92e27 Fix project-remember-projects-under when recursing
* lisp/progmodes/project.el (project-remember-projects-under):
Actually recurse into directories (bug#57714).

Copyright-paperwork-exempt: yes
2022-09-10 14:57:48 +02:00
Dmitry Gutov
4aca0d818f buffer-match-p: Resolve backward compat concerns
* doc/lispref/buffers.texi (Buffer List): Document 'major-mode'
and 'derived-mode' predicates.  Fix some typos.

* lisp/subr.el (buffer-match-p): Use the structure initially
pioneered by project-kill-buffer-conditions as-is (bug#54296).

* lisp/progmodes/project.el (project-kill-buffer-conditions)
(project--buffer-check): Revert the latest change.
(project--buffer-check): Add support for lambda predicates.
2022-06-17 15:23:01 +03:00
Dmitry Gutov
915b34d280 project--git-submodules: Parse more strictly
* lisp/progmodes/project.el (project--git-submodules):
Don't mistake 'load-path' for 'path' (bug#55396).
2022-06-14 04:00:22 +03:00
Dmitry Gutov
7fed00f9ba Post-review additions
* lisp/progmodes/project.el (project-vc-include-untracked):
Add :version.
(project--vc-list-files): Use 'and' instead of 'when'.
2022-06-04 03:42:00 +03:00
Jan Synáček
526971df64 Add new user option project-vc-include-untracked
* doc/emacs/maintaining.texi (Projects): Document it.
* lisp/progmodes/project.el (project--vc-list-files): Use it.
2022-06-04 03:31:10 +03:00
Dmitry Gutov
db82347269 project-query-replace-regexp: Filter out non-regular files
* lisp/progmodes/project.el (project-query-replace-regexp):
Filter out non-regular files (bug#55382).
2022-06-04 03:13:42 +03:00
Juri Linkov
4132223d89 * lisp/progmodes/project.el: Improve file-reading history and default values.
(project-find-file): Use relative file name of the
currently visited file as an alternative default value.
(project-find-file-in, project-find-dir): Use 'file-name-history' (bug#55267).
2022-05-30 19:30:54 +03:00
Eli Zaretskii
b3023de543 Merge from origin/emacs-28
# Conflicts:
#	lisp/progmodes/xref.el
2022-04-28 18:37:34 +03:00
Eli Zaretskii
16d1ab02af Add minimum instructions to 'query-replace' commands
* lisp/vc/vc-dir.el (vc-dir-query-replace-regexp):
* lisp/textmodes/reftex-global.el (reftex-query-replace-document):
* lisp/progmodes/project.el (project-query-replace-regexp):
* lisp/progmodes/etags.el (tags-query-replace):
* lisp/progmodes/ebrowse.el (ebrowse-tags-query-replace):
* lisp/isearch.el (isearch-query-replace, isearch-occur):
* lisp/emulation/viper-cmd.el (viper-query-replace):
* lisp/dired-aux.el (dired-do-query-replace-regexp)
(dired-do-find-regexp-and-replace):
* lisp/progmodes/xref.el (xref-query-replace-in-results):
* lisp/replace.el (query-replace, query-replace-regexp)
(query-replace-regexp-eval, map-query-replace-regexp): Add minimal
instructions for dealing with matches, with a link to the command
that shows the full instructions.  (Bug#55050)
2022-04-21 14:54:45 +03:00
Lars Ingebrigtsen
d5b9b1a913 Document project-kill-buffers-display-buffer-list
* doc/emacs/maintaining.texi (Project Buffer Commands): Mention
project-kill-buffers-display-buffer-list.

* lisp/progmodes/project.el (project-kill-buffers): Link to
project-kill-buffers-display-buffer-list.
2022-04-16 17:30:32 +02:00
Philip Kaludercic
1a3bad431d Update project-kill-buffer-conditions to match buffer-match-p
* project.el (project-kill-buffer-conditions): Document the
deprecation of the use of derived-mode
(project--buffer-check): Have `major-mode' behave like `derived-mode'
did previously, and issue a warning of `derived-mode' is used.
2022-04-15 10:06:36 +02:00
Dmitry Gutov
a658be7742 project-shell: Ensure the resulting buffer is live
* lisp/progmodes/project.el (project-shell):
Make sure to recreate the shell if the buffer exists but not live
(https://lists.gnu.org/archive/html/emacs-devel/2022-03/msg00017.html).
2022-03-05 04:33:10 +02:00
Dmitry Gutov
86969f9658 Cache the backend value together with the project root
* lisp/progmodes/project.el (project-try-vc):
Cache the backend value together with the root.
(project-root, project-files, project-ignores):
Update to access the new data structure.
2022-03-03 05:41:46 +02:00
Manuel Uberti
bc0d1f1c46 Add project-ignore-buffer-conditions
* lisp/progmodes/project.el (project-ignore-buffer-conditions):
New defcustom.
(project--read-project-buffer):
Use it (bug#54100).
2022-02-27 05:25:01 +02:00
Dmitry Gutov
3d106897fd Public-ize xref-show-xrefs
* lisp/progmodes/xref.el (xref-show-xrefs):
New function (wrapper for an older, private one, bug#42967).
2022-02-21 03:57:27 +02:00
Juri Linkov
749ba35bf5 * lisp/replace.el (query-replace-read-from-default): New variable.
(query-replace-read-from-regexp-default): New variable.
(query-replace-read-from): Use new variables.

* lisp/progmodes/project.el (project-query-replace-regexp):
Let-bind query-replace-read-from-regexp-default to find-tag-default-as-regexp.

* lisp/progmodes/xref.el (xref-find-references-and-replace):
Let-bind query-replace-read-from-default to find-tag-default.

https://lists.gnu.org/archive/html/emacs-devel/2022-01/msg01909.html
2022-02-01 22:08:22 +02:00
Juri Linkov
4765487d5d More fixes for display-comint-buffer-action
* lisp/window.el (display-comint-buffer-action):
Use display-buffer--same-window-action as the default value.

* lisp/progmodes/sh-script.el (sh-show-shell):
* lisp/shell.el (shell): Add display-comint-buffer-action to pop-to-buffer.

* lisp/progmodes/project.el (project-shell, project-eshell): Use
`bound-and-true-p display-comint-buffer-action' for backward-compatibility.

https://lists.gnu.org/archive/html/emacs-devel/2021-12/msg02964.html
2022-01-11 19:19:37 +02:00
Stefan Kangas
d763c12796 Merge from origin/emacs-28
e7aa3ece52 Fix vc-git with old Git over Tramp and cygwin-mount.el
c0cfbca311 * lisp/emacs-lisp/checkdoc.el (bytecomp): Add missing require

# Conflicts:
#	etc/NEWS
2022-01-05 06:30:39 +01:00
Dmitry Gutov
e7aa3ece52 Fix vc-git with old Git over Tramp and cygwin-mount.el
* lisp/vc/vc-git.el (vc-git-use-literal-pathspecs): New variable.
(vc-git-command, vc-git--call): Use it to determine whether to set
GIT_LITERAL_PATHSPECS=1 (bug#51497).
(vc-git--literal-pathspec, vc-git--literal-pathspecs): Remove.
Update all callers.  This reverts the previous solution for bug#39452.

* lisp/progmodes/project.el (project--vc-list-files):
Use the new variable.
2022-01-05 04:08:10 +02:00
Eli Zaretskii
dcd76bd48d Merge from origin/emacs-28
836be7a112 ; * etc/refcards/ru-refcard.tex: Update Copyright year.
86cbc6ee4a * lisp/net/tramp-sh.el: Adapt copyright year
ebe8772f65 ; Minor fixes related to copyright years
23c1ee6989 ; * test/manual/etags/ETAGS.good_N: Adjust to copyright ye...
8d3fc7ec89 * src/xfaces.c (face_for_font): Make 'hash' be uintptr_t.
19dcb237b5 ; Add 2022 to copyright years.

# Conflicts:
#	etc/NEWS
#	etc/refcards/ru-refcard.tex
#	lib/cdefs.h
#	lisp/erc/erc-dcc.el
#	lisp/erc/erc-imenu.el
#	lisp/erc/erc-replace.el
#	lisp/image-dired.el
#	lisp/progmodes/xref.el
#	m4/alloca.m4
#	m4/byteswap.m4
#	m4/errno_h.m4
#	m4/getopt.m4
#	m4/gnulib-common.m4
#	m4/inttypes.m4
#	m4/stddef_h.m4
#	m4/stdint.m4
#	m4/sys_socket_h.m4
2022-01-01 07:03:03 -05:00
Eli Zaretskii
19dcb237b5 ; Add 2022 to copyright years. 2022-01-01 02:45:51 -05:00
Sam Steingold
18b680cfd1 Fix bug#52467 by adding a new custom variable 'display-comint-buffer-action'
* lisp/window.el (display-comint-buffer-action): New `defcustom`,
defaults to 'display-buffer-same-window' for backward compatibility.
* lisp/cmuscheme.el (run-scheme, switch-to-scheme): Pass
'display-comint-buffer-action' to 'pop-to-buffer' instead
of using 'pop-to-buffer-same-window'.
* lisp/eshell/eshell.el (eshell): Likewise.
* lisp/shell.el (shell): Likewise.
* lisp/org/ol-eshell.el (org-eshell-open): Likewise.
* lisp/progmodes/inf-lisp.el (inferior-lisp): Likewise.
* lisp/progmodes/project.el (project-shell, project-eshell): Likewise.
* lisp/textmodes/tex-mode.el (tex-display-shell, tex-compile-default)
(tex-recenter-output-buffer): Pass 'display-comint-buffer-action'
to 'pop-to-buffer'.
2021-12-28 17:28:49 -05:00
Dmitry Gutov
32d12840e6 Kill eshell-mode project buffers too
* lisp/progmodes/project.el (project-kill-buffer-conditions):
Add 'eshell-mode' too (bug#49465).
2021-12-17 04:20:50 +03:00
Dmitry Gutov
ad768d767b project-kill-buffers-display-buffer-list: Fix :package-version value
* lisp/progmodes/project.el (project-kill-buffers-display-buffer-list):
Fix :package-version value.
2021-12-15 02:58:45 +03:00
Dmitry Gutov
38977b6134 Add 'comint-mode' and 'change-log-mode' to project-kill-buffer-conditions
* lisp/progmodes/project.el (project-kill-buffer-conditions):
Add 'comint-mode' and 'change-log-mode' to the list (bug#52465).
2021-12-15 02:57:20 +03:00
Matthias Meulien
0d2f184a11 project-kill-buffers can display list of buffers to kill
* lisp/progmodes/project.el
(project-kill-buffers-display-buffer-list): Option to toggle
temporarily display of the list of buffers to kill when calling
project-kill-buffers
(project-kill-buffers): Handle
project-kill-buffers-display-buffer-list option (bug#52148).
2021-11-29 16:42:02 +01:00
Dmitry Gutov
7dedba1cc0 Special-case the "Permission denied" messages
* lisp/progmodes/project.el (project--files-in-directory):
Special-case the "Permission denied" messages, to make sure the
user sees the unreadable directory's name
(https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg01015.html).
2021-10-15 15:12:29 +03:00
Dmitry Gutov
14bfb31dba Add new argument INCLUDE-ALL to project-find-file
* lisp/progmodes/project.el (project-find-file):
Add new argument INCLUDE-ALL.  Have 'C-u' make it non-nil.
(project-or-external-find-file): Ditto.
(project-find-file-in): Add new argument INCLUDE-ALL.
(https://lists.gnu.org/archive/html/emacs-devel/2021-10/msg00209.html)
2021-10-14 03:43:42 +03:00
Dmitry Gutov
6bf29072e9 Avoid mapping file names through 'substring'
* lisp/progmodes/project.el (project--files-in-directory):
Avoid mapping file names through 'substring'.  Reducing the amount
of garbage generated.  Better perf by up to 20%.
Bump the package version.
2021-10-10 04:15:42 +03:00