From: Juri Linkov <juri@linkov.net>
To: Dmitry Gutov <dmitry@gutov.dev>
Cc: sbaugh@janestreet.com, Eli Zaretskii <eliz@gnu.org>,
63469@debbugs.gnu.org
Subject: bug#63469: 29.0.90; project.el doesn't add menu-bar entries
Date: Thu, 25 May 2023 09:29:49 +0300 [thread overview]
Message-ID: <867csw53fm.fsf@mail.linkov.net> (raw)
In-Reply-To: <6a5c2251-52a8-e389-f2ab-08da775fab82@gutov.dev> (Dmitry Gutov's message of "Thu, 25 May 2023 04:14:41 +0300")
[-- Attachment #1: Type: text/plain, Size: 1253 bytes --]
>> I see no way to set the same project name both for
>> non-file and file buffers.
>
> Please try the patch below. It might have non-negligible effect on
> performance though. Please try and report back.
>
> diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
> index 7c51778d5d4..1494665d565 100644
> --- a/lisp/progmodes/project.el
> +++ b/lisp/progmodes/project.el
> @@ -816,8 +816,8 @@ project-buffers
> (push buf bufs)))
> (nreverse bufs)))
>
> -(cl-defmethod project-name ((_project (head vc)))
> - (or project-vc-name
> +(cl-defmethod project-name ((project (head vc)))
> + (or (project--value-in-dir 'project-vc-name (project-root project))
> (cl-call-next-method)))
Thanks, I confirm this uses project-vc-name from dir-locals in non-file buffers.
>> The standard solution is just to use e.g.:
>> ;;;###autoload(put 'compilation-directory 'safe-local-variable 'stringp)
>
> Huh, so the attribute :safe only makes proper sense for preloaded packages
> and autoloaded defcustom forms (which are discouraged anyway).
>
> Do you want to write a patch for all those vars in project.el? It will
> probably make sense to push it to emacs-29.
With this patch the problem is solved. I can push it to emacs-29.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: project-autoload-safe.patch --]
[-- Type: text/x-diff, Size: 2728 bytes --]
diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el
index 7c51778d5d4..8b5a1abf900 100644
--- a/lisp/progmodes/project.el
+++ b/lisp/progmodes/project.el
@@ -412,8 +412,8 @@ project-vc
(defcustom project-vc-ignores nil
"List of patterns to add to `project-ignores'."
- :type '(repeat string)
- :safe #'listp)
+ :type '(repeat string))
+;;;###autoload(put 'project-vc-ignores 'safe-local-variable #'listp)
(defcustom project-vc-merge-submodules t
"Non-nil to consider submodules part of the parent project.
@@ -422,14 +422,14 @@ project-vc-merge-submodules
you might have to restart Emacs to see the effect."
:type 'boolean
:version "28.1"
- :package-version '(project . "0.2.0")
- :safe #'booleanp)
+ :package-version '(project . "0.2.0"))
+;;;###autoload(put 'project-vc-merge-submodules 'safe-local-variable #'booleanp)
(defcustom project-vc-include-untracked t
"When non-nil, the VC-aware project backend includes untracked files."
:type 'boolean
- :version "29.1"
- :safe #'booleanp)
+ :version "29.1")
+;;;###autoload(put 'project-vc-include-untracked 'safe-local-variable #'booleanp)
(defcustom project-vc-name nil
"When non-nil, the name of the current VC-aware project.
@@ -439,8 +439,8 @@ project-vc-name
:type '(choice (const :tag "Default to the base name" nil)
(string :tag "Custom name"))
:version "29.1"
- :package-version '(project . "0.9.0")
- :safe #'stringp)
+ :package-version '(project . "0.9.0"))
+;;;###autoload(put 'project-vc-name 'safe-local-variable #'stringp)
;; Not using regexps because these wouldn't work in Git pathspecs, in
;; case we decide we need to be able to list nested projects.
@@ -467,8 +467,8 @@ project-vc-extra-root-markers
variables, such as `project-vc-ignores' or `project-vc-name'."
:type '(repeat string)
:version "29.1"
- :package-version '(project . "0.9.0")
- :safe (lambda (val) (and (listp val) (cl-every #'stringp val))))
+ :package-version '(project . "0.9.0"))
+;;;###autoload(put 'project-vc-extra-root-markers 'safe-local-variable (lambda (val) (and (listp val) (cl-every #'stringp val))))
;; FIXME: Using the current approach, major modes are supposed to set
;; this variable to a buffer-local value. So we don't have access to
@@ -1476,8 +1476,8 @@ project-kill-buffers-display-buffer-list
:type 'boolean
:version "29.1"
:group 'project
- :package-version '(project . "0.8.2")
- :safe #'booleanp)
+ :package-version '(project . "0.8.2"))
+;;;###autoload(put 'project-kill-buffers-display-buffer-list 'safe-local-variable #'booleanp)
(defun project--buffer-check (buf conditions)
"Check if buffer BUF matches any element of the list CONDITIONS.
next prev parent reply other threads:[~2023-05-25 6:29 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-12 17:48 bug#63469: 29.0.90; project.el doesn't add menu-bar entries Spencer Baugh
2023-05-12 19:09 ` Eli Zaretskii
2023-05-12 19:25 ` Dmitry Gutov
2023-05-15 16:49 ` Juri Linkov
2023-05-15 18:15 ` Spencer Baugh
2023-05-15 18:19 ` Eli Zaretskii
2023-05-15 18:11 ` Spencer Baugh
2023-05-15 18:37 ` Eli Zaretskii
2023-05-15 18:46 ` Spencer Baugh
2023-05-16 16:09 ` Eli Zaretskii
2023-05-16 17:09 ` Spencer Baugh
2023-05-17 11:30 ` Eli Zaretskii
2023-05-17 14:50 ` Spencer Baugh
2023-05-18 6:53 ` Dmitry Gutov
2023-05-18 7:01 ` Eli Zaretskii
2023-05-18 9:49 ` Dmitry Gutov
2023-05-18 10:23 ` Eli Zaretskii
2023-05-18 14:30 ` Spencer Baugh
2023-05-18 15:15 ` Eli Zaretskii
2023-05-18 15:57 ` Juri Linkov
2023-05-18 16:06 ` Eli Zaretskii
2023-05-18 19:34 ` Dmitry Gutov
2023-05-19 6:56 ` Juri Linkov
2023-05-19 10:44 ` Eli Zaretskii
2023-05-19 17:46 ` Juri Linkov
2023-05-19 18:28 ` Eli Zaretskii
2023-05-22 17:48 ` Juri Linkov
2023-05-22 18:20 ` Eli Zaretskii
2023-05-22 19:49 ` Spencer Baugh
2023-05-22 19:54 ` Dmitry Gutov
2023-05-22 21:20 ` Spencer Baugh
2023-05-22 21:30 ` Dmitry Gutov
2023-05-23 13:57 ` Michael Albinus
2023-05-24 1:07 ` Dmitry Gutov
2023-05-24 8:38 ` Michael Albinus
2023-05-23 6:52 ` Juri Linkov
2023-05-23 11:17 ` Eli Zaretskii
2023-05-23 18:08 ` Juri Linkov
2023-05-24 1:10 ` Dmitry Gutov
2023-05-24 6:25 ` Juri Linkov
2023-05-25 1:15 ` Dmitry Gutov
2023-05-25 6:35 ` Juri Linkov
2023-05-25 16:17 ` Dmitry Gutov
2023-05-23 6:49 ` Juri Linkov
2023-05-22 19:59 ` Dmitry Gutov
2023-05-23 6:46 ` Juri Linkov
2023-05-23 18:11 ` Juri Linkov
2023-05-24 1:03 ` Dmitry Gutov
2023-05-24 6:29 ` Juri Linkov
2023-05-25 1:14 ` Dmitry Gutov
2023-05-25 6:29 ` Juri Linkov [this message]
2023-05-25 16:14 ` Dmitry Gutov
2023-05-25 18:41 ` Juri Linkov
2023-05-25 22:19 ` Dmitry Gutov
2023-05-30 17:51 ` Juri Linkov
2023-06-02 2:11 ` Dmitry Gutov
2023-06-02 6:37 ` Juri Linkov
2023-06-03 1:36 ` Dmitry Gutov
2023-05-24 1:00 ` Dmitry Gutov
2023-05-19 14:42 ` Spencer Baugh
2023-05-19 17:41 ` Juri Linkov
2023-06-28 0:54 ` Spencer Baugh
2023-06-28 6:52 ` Juri Linkov
2023-06-29 15:30 ` Spencer Baugh
2023-06-29 17:31 ` Juri Linkov
2023-06-29 18:03 ` Eli Zaretskii
2023-06-29 19:22 ` Spencer Baugh
2023-06-30 5:32 ` Eli Zaretskii
2023-06-30 15:55 ` Spencer Baugh
2023-07-01 9:44 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=867csw53fm.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=63469@debbugs.gnu.org \
--cc=dmitry@gutov.dev \
--cc=eliz@gnu.org \
--cc=sbaugh@janestreet.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).