From 50dd037338784381300f411c64d39a9fbaaa7f5a Mon Sep 17 00:00:00 2001 From: Philip K Date: Sat, 8 Aug 2020 13:52:46 +0200 Subject: [PATCH] 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). --- lisp/outline.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 -- 2.39.2