From: Philip K Date: Sat, 8 Aug 2020 11:52:46 +0000 (+0200) Subject: Make Customize changes to outline-minor-mode-prefix happen immediately X-Git-Tag: emacs-28.0.90~6752 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=50dd037338784381300f411c64d39a9fbaaa7f5a;p=emacs.git Make Customize changes to outline-minor-mode-prefix happen immediately * lisp/outline.el (outline-minor-mode-prefix): Update the key map after changing the value in Customize (bug#41073). --- diff --git a/lisp/outline.el b/lisp/outline.el index 28ea8a86e6f..d2a5d42d74a 100644 --- a/lisp/outline.el +++ b/lisp/outline.el @@ -289,12 +289,18 @@ Turning on outline mode calls the value of `text-mode-hook' and then of (list (list nil (concat "^\\(?:" outline-regexp "\\).*$") 0))) (add-hook 'change-major-mode-hook 'outline-show-all nil t)) +(defvar outline-minor-mode-map) + (defcustom outline-minor-mode-prefix "\C-c@" "Prefix key to use for Outline commands in Outline minor mode. The value of this variable is checked as part of loading Outline mode. After that, changing the prefix key requires manipulating keymaps." :type 'string - :group 'outlines) + :group 'outlines + :set (lambda (sym val) + (define-key outline-minor-mode-map outline-minor-mode-prefix nil) + (define-key outline-minor-mode-map val outline-mode-prefix-map) + (set-default sym val))) ;;;###autoload (define-minor-mode outline-minor-mode