(defvar-local custom-dirlocals-file-widget nil
"Widget that holds the name of the dir-locals file being customized.")
-(defvar-keymap custom-dirlocals-map
+(define-obsolete-variable-alias 'custom-dirlocals-map
+ 'Custom-dirlocals-mode-map "31.1")
+(defvar-keymap Custom-dirlocals-mode-map
:doc "Keymap used in the \"*Customize Dirlocals*\" buffer."
:full t
:parent widget-keymap
See `custom-commands' for further explanation.")
(easy-menu-define
- Custom-dirlocals-menu (list custom-dirlocals-map
+ Custom-dirlocals-menu (list Custom-dirlocals-mode-map
custom-dirlocals-field-map)
"Menu used in dirlocals customization buffers."
(nconc (list "Custom"
(add-hook 'widget-forward-hook #'custom-dirlocals-maybe-update-cons nil t))
(define-derived-mode Custom-dirlocals-mode nil "Custom dirlocals"
- "Major mode for customizing Directory Local Variables in current directory.
-Entry to this mode calls the value of `Custom-mode-hook' if its value
-is non-nil.
-
-\\{custom-dirlocals-map}"
- (kill-all-local-variables)
+ "Major mode for customizing Directory Local Variables in current directory."
(custom-dirlocals--set-widget-vars)
- (setq-local major-mode #'Custom-dirlocals-mode)
(setq-local text-conversion-style 'action)
(setq-local touch-screen-keyboard-function
#'Custom-display-on-screen-keyboard-p)
(mapc
(lambda (arg)
(tool-bar-local-item-from-menu
- (nth 1 arg) (nth 4 arg) map custom-dirlocals-map
+ (nth 1 arg) (nth 4 arg) map Custom-dirlocals-mode-map
:label (nth 5 arg)))
custom-dirlocals-commands)
(setq custom-dirlocals-tool-bar-map map))))
- (use-local-map custom-dirlocals-map)
- (run-hooks 'Custom-mode-hook))
+ (run-mode-hooks 'Custom-mode-hook))
+;; As discussed in bug#77228, deriving from `Custom-mode' would
+;; include all their settings that are not necessary for
+;; `customize-dirlocals' and that can break it.
+;; FIXME: Introduce a `Custom-base-mode', which could be useful
+;; also for `gnus-custom-mode'.
(derived-mode-add-parents 'Custom-dirlocals-mode '(Custom-mode))
(defmacro custom-dirlocals-with-buffer (&rest body)