Add 'project-customize-dirlocals'

* etc/NEWS: Add command entry.
* lisp/menu-bar.el (menu-bar-project-menu): Add command entry to
project menu.
* lisp/progmodes/project.el (project-customize-dirlocals):
New command.  (Bug#77229)
This commit is contained in:
Elías Gabriel Pérez 2025-03-23 21:35:32 -06:00 committed by Dmitry Gutov
parent a4ec9ca129
commit da6da5744b
3 changed files with 14 additions and 0 deletions

View file

@ -362,6 +362,11 @@ docstring for arguments passed to a help-text function.
*** New command 'project-root-find-file'.
It is equivalent to running project-any-command with find-file.
---
*** New command 'project-customize-dirlocals'.
It is equivalent to running project-any-command with
customize-dirlocals.
---
*** Improved prompt for 'project-switch-project'.
The prompt now displays the chosen project on which to invoke a command.

View file

@ -1830,6 +1830,7 @@ mail status in mode line"))
(define-key menu [project-compile] '(menu-item "Compile..." project-compile :help "Invoke compiler or Make for current project, view errors"))
(define-key menu [separator-project-programs] menu-bar-separator)
(define-key menu [project-switch-project] '(menu-item "Switch Project..." project-switch-project :help "Switch to another project and then run a command"))
(define-key menu [project-customize-dirlocals] '(menu-item "Customize Directory Local Variables" project-customize-dirlocals :help "Customize current project Directory Local Variables."))
(define-key menu [project-vc-dir] '(menu-item "VC Dir" project-vc-dir :help "Show the VC status of the project repository"))
(define-key menu [project-dired] '(menu-item "Open Project Root" project-dired :help "Read the root directory of the current project, to operate on its files"))
(define-key menu [project-find-dir] '(menu-item "Open Directory..." project-find-dir :help "Open existing directory that belongs to current project"))

View file

@ -1391,6 +1391,14 @@ The current buffer's `default-directory' is available as part of
(interactive)
(vc-dir (project-root (project-current t))))
;;;###autoload
(defun project-customize-dirlocals ()
"Run `customize-dirlocals' in current project's root."
(interactive)
(customize-dirlocals
(expand-file-name ".dir-locals.el"
(project-root (project-current t)))))
(declare-function comint-check-proc "comint")
;;;###autoload