diff --git a/etc/NEWS b/etc/NEWS index 8c65b195b1a..016b6c590d3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -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. diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el index 1685357fab6..6a68ad63a5b 100644 --- a/lisp/menu-bar.el +++ b/lisp/menu-bar.el @@ -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")) diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index e2cd5bfa231..cb0cc038585 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -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