* 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.
This commit is contained in:
Juri Linkov 2023-05-25 21:40:38 +03:00
parent 3afe4a42e9
commit e5f42706ce

View file

@ -401,8 +401,8 @@ the buffer's value of `default-directory'."
(defcustom project-vc-ignores nil (defcustom project-vc-ignores nil
"List of patterns to add to `project-ignores'." "List of patterns to add to `project-ignores'."
:type '(repeat string) :type '(repeat string))
:safe #'listp) ;;;###autoload(put 'project-vc-ignores 'safe-local-variable #'listp)
(defcustom project-vc-merge-submodules t (defcustom project-vc-merge-submodules t
"Non-nil to consider submodules part of the parent project. "Non-nil to consider submodules part of the parent project.
@ -411,14 +411,14 @@ After changing this variable (using Customize or .dir-locals.el)
you might have to restart Emacs to see the effect." you might have to restart Emacs to see the effect."
:type 'boolean :type 'boolean
:version "28.1" :version "28.1"
:package-version '(project . "0.2.0") :package-version '(project . "0.2.0"))
:safe #'booleanp) ;;;###autoload(put 'project-vc-merge-submodules 'safe-local-variable #'booleanp)
(defcustom project-vc-include-untracked t (defcustom project-vc-include-untracked t
"When non-nil, the VC-aware project backend includes untracked files." "When non-nil, the VC-aware project backend includes untracked files."
:type 'boolean :type 'boolean
:version "29.1" :version "29.1")
:safe #'booleanp) ;;;###autoload(put 'project-vc-include-untracked 'safe-local-variable #'booleanp)
(defcustom project-vc-name nil (defcustom project-vc-name nil
"When non-nil, the name of the current VC-aware project. "When non-nil, the name of the current VC-aware project.
@ -428,8 +428,8 @@ its name, is by setting this in .dir-locals.el."
:type '(choice (const :tag "Default to the base name" nil) :type '(choice (const :tag "Default to the base name" nil)
(string :tag "Custom name")) (string :tag "Custom name"))
:version "29.1" :version "29.1"
:package-version '(project . "0.9.0") :package-version '(project . "0.9.0"))
:safe #'stringp) ;;;###autoload(put 'project-vc-name 'safe-local-variable #'stringp)
;; Not using regexps because these wouldn't work in Git pathspecs, in ;; Not using regexps because these wouldn't work in Git pathspecs, in
;; case we decide we need to be able to list nested projects. ;; case we decide we need to be able to list nested projects.
@ -456,8 +456,8 @@ In either case, their behavior will still obey the relevant
variables, such as `project-vc-ignores' or `project-vc-name'." variables, such as `project-vc-ignores' or `project-vc-name'."
:type '(repeat string) :type '(repeat string)
:version "29.1" :version "29.1"
:package-version '(project . "0.9.0") :package-version '(project . "0.9.0"))
:safe (lambda (val) (and (listp val) (cl-every #'stringp val)))) ;;;###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 ;; 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 ;; this variable to a buffer-local value. So we don't have access to
@ -1453,8 +1453,8 @@ Used by `project-kill-buffers'."
:type 'boolean :type 'boolean
:version "29.1" :version "29.1"
:group 'project :group 'project
:package-version '(project . "0.8.2") :package-version '(project . "0.8.2"))
:safe #'booleanp) ;;;###autoload(put 'project-kill-buffers-display-buffer-list 'safe-local-variable #'booleanp)
(defun project--buffer-check (buf conditions) (defun project--buffer-check (buf conditions)
"Check if buffer BUF matches any element of the list CONDITIONS. "Check if buffer BUF matches any element of the list CONDITIONS.