(when (setq buffer (get-buffer buffer))
(mode-local-describe-bindings-1 buffer (called-interactively-p 'any))))
+(put 'describe-mode-local-bindings 'minibuffer-action "describe")
+
(defun describe-mode-local-bindings-in-mode (mode)
"Display mode local bindings active in MODE hierarchy."
(interactive
- (list (completing-read
- "Mode: " obarray
- (lambda (s) (get s 'mode-local-symbol-table))
- t (symbol-name major-mode))))
+ (list (let ((def (when (get major-mode 'mode-local-symbol-table)
+ major-mode)))
+ (completing-read
+ (format-prompt "Mode" def) obarray
+ (lambda (s) (get s 'mode-local-symbol-table))
+ t nil nil def))))
(when (setq mode (intern-soft mode))
(mode-local-describe-bindings-1 mode (called-interactively-p 'any))))
+
+(put 'describe-mode-local-bindings-in-mode 'minibuffer-action "describe")
+
\f
(add-hook 'find-file-hook #'mode-local-post-major-mode-change)
(add-hook 'change-major-mode-hook #'mode-local-on-major-mode-change)