1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00
Commit graph

324 commits

Author SHA1 Message Date
Stefan Kangas
f8bdc8dff0 ; Normalize GNU ELPA :core package statements
* lisp/emacs-lisp/let-alist.el:
* lisp/progmodes/project.el: Normalize GNU ELPA :core package
statement.
2023-10-01 01:35:23 +02:00
Stefan Kangas
8cbd4a02a2 Delete comment saying that project.el is experimental
* lisp/progmodes/project.el (Commentary): Delete comment saying that
the API is "still experimental".  It is to be considered stable
starting with the version released with Emacs 29.
Ref: https://lists.gnu.org/r/emacs-devel/2023-07/msg00415.html
2023-08-04 12:34:14 +02:00
Dmitry Gutov
753f8aa1f1 Fix project-name for vc-aware backend in non-file buffers
* lisp/progmodes/project.el (project-name): Make sure
project-vc-name is picked up from dir-locals in all
non-file-visiting buffers too (mentioned in bug#63469).
2023-06-02 05:10:15 +03:00
Mattias Engdegård
5e7c826bfa ; * lisp/progmodes/project.el: avoid warning in loaddefs.
(cherry picked from commit 1eb5faa261)
2023-05-26 15:41:12 +03:00
Juri Linkov
e5f42706ce * lisp/progmodes/project.el: Move :safe from defcustom to autoload (bug#63469)
(project-vc-ignores, project-vc-merge-submodules)
(project-vc-include-untracked, project-vc-name)
(project-vc-extra-root-markers, project-kill-buffers-display-buffer-list):
Autoload the line that puts 'safe-local-variable' property on defcustom symbol
instead of using the :safe keyword.
2023-05-25 21:40:38 +03:00
Eli Zaretskii
fe22bf503f ; * lisp/progmodes/project.el (project-switch-use-entire-map): Doc fix. 2023-05-22 21:31:56 +03:00
Dmitry Gutov
589959fb09 project-search: Pipe the list of files through 'file-regular-p'
* lisp/progmodes/project.el (project-search): Pipe the list of
files through 'file-regular-p' to skip directories (bug#62735).
2023-04-10 02:09:45 +03:00
Omar Polo
6c0d821017 (project-try-vc): Remove unused defvar/require
* lisp/progmodes/project.el (project-try-vc):
Remove unused defvar/require (bug#61577).
2023-02-18 15:11:13 +02:00
Dmitry Gutov
a40b1745d4 (project-vc-backend-markers-alist): Add entry for vc-got
* lisp/progmodes/project.el (project-vc-backend-markers-alist):
Add entry for vc-got (bug#61577).  Bump the version.
2023-02-18 00:55:03 +02:00
Dmitry Gutov
18e96ed7c8 project.el: Extract backend->marker association for a defvar
* lisp/progmodes/project.el (project-vc-backend-markers-alist):
Extract from 'project-try-vc'.
(project-try-vc): Update accordingly (bug#61577).
2023-02-18 00:54:39 +02:00
Dmitry Gutov
128a999bfe Make project-current not error out inside non-existent dirs
* lisp/progmodes/project.el (project-try-vc):
Use condition-case to catch 'file-missing' (bug#61107).

* test/lisp/progmodes/project-tests.el
(project-vc-nonexistent-directory-no-error): New test.
2023-01-28 03:20:29 +02:00
Dmitry Gutov
67ee627c38 (project-try-vc): Add string-start and string-end anchors to marker-re
* lisp/progmodes/project.el (project-try-vc):
Add string-start and string-end anchors to marker-re (bug#60956).
2023-01-20 18:44:17 +02:00
Dmitry Gutov
f16cc7c49c ; project.el: Bump version 2023-01-10 02:07:12 +02:00
Eli Zaretskii
cae528457c ; Add 2023 to copyright years. 2023-01-01 05:31:12 -05:00
Juri Linkov
cfbfd393b4 * lisp/progmodes/project.el (project--read-file-cpd-relative): Optimize. 2022-12-19 21:47:28 +02:00
Juri Linkov
399433cc2b * lisp/progmodes/project.el: Filter out empty strings from history (bug#58447)
(project--read-file-cpd-relative): Do not include empty strings (when
prefix has the same length as the string).
2022-12-19 19:54:08 +02:00
Dmitry Gutov
c8d75046a2 When completing relative project file names, use relative history
* lisp/progmodes/project.el: Require 'cl-lib'.

* lisp/progmodes/project.el (project--read-file-cpd-relative):
Pre-process history entries around completing-read (bug#58447).

This includes both filtering by common-parent-directory prefix and
mapping into relative names.
2022-12-16 00:46:20 +02:00
Juri Linkov
a99d0e7e6c Support a function in the BUFFER-LIST arg of list-buffers-noselect (bug#59935)
* lisp/buff-menu.el (Buffer-menu-buffer-list): New buffer-local variable.
(list-buffers-noselect): Set Buffer-menu-buffer-list to 'buffer-list'
that now keeps the buffer-local value of the provided buffer list
or a function that returns the buffer list.
(list-buffers--refresh): Handle buffer-list and Buffer-menu-buffer-list
as a function and as a list.

* lisp/progmodes/project.el (project-list-buffers): Let-bind
'buffer-list-function' used by both legacy code and the new version
of list-buffers-noselect that supports its arg BUFFER-LIST as a function.
2022-12-13 19:48:45 +02:00
Dmitry Gutov
04b7e01885 ; project.el: Bump version. 2022-12-12 01:14:14 +02:00
Dmitry Gutov
33a8415eb7 Use 'project--value-in-dir' for 'project-vc-include-untracked' too
* lisp/progmodes/project.el (project--vc-list-files): Use
'project--value-in-dir' for 'project-vc-include-untracked' too.
So that is can be reliably set through dir-locals.
2022-12-09 23:21:28 +02:00
Dmitry Gutov
d268ab1c5d Bring back the project--value-in-dir logic
Essentialy revert commit 2389158a31, restoring the changes
and fixing the conflicts.  Motivated by the problem brought up in
bug#59722 (behavior of project-find-files/regexp when switching
projects).  We should find other ways to improve performance.

* lisp/progmodes/project.el
(project--value-in-dir, project--vc-merge-submodules-p): Restore.
(project-try-vc, project-files, project--vc-list-files)
(project-ignores, project-buffers): Use.

* test/lisp/progmodes/project-tests.el
(project-vc-supports-project-in-different-dir): New test.

* test/lisp/progmodes/project-resources/.dir-locals.el:
* test/lisp/progmodes/project-resources/foo:
* test/lisp/progmodes/project-resources/etc: New files.
2022-12-09 18:19:36 +02:00
Randy Taylor
1b567f5a67 Use file-name-nondirectory to determine default project-name
* lisp/progmodes/project.el (project-name):
Use file-name-nondirectory instead of file-name-base (bug#59756).
2022-12-02 17:12:43 +02:00
Dmitry Gutov
3bccef6f52 project-files (VC-aware): Make sure the VC backend is loaded
* lisp/progmodes/project.el (project-files):
Make sure the VC backend is loaded (bug#59734).
2022-12-02 04:03:19 +02:00
Mattias Engdegård
4b2f5425d7 Fix types in various defcustom declarations
* lisp/org/ob-clojure.el
(ob-clojure-babashka-command, ob-clojure-nbb-command):
Account for the possibility of nil (commands absent).
* lisp/org/org.el (org-safe-remote-resources):
* lisp/org/ox-md.el (org-md-toplevel-hlevel):
* lisp/progmodes/project.el (project-vc-extra-root-markers):
Fix incorrect or invalid types.
2022-12-01 13:03:19 +01:00
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