Subject: [PATCH] Adjust outline-minor-mode-map when prefix is changed

From: Philip K <[email-masked]>
Date: Mon, 4 May 2020 11:48:03 +0200

---
 lisp/outline.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/outline.el b/lisp/outline.el
index 15fd6ea02e..aa8ed58ad9 100644
--- a/lisp/outline.el
+++ b/lisp/outline.el
@@ -289,12 +289,18 @@ outline-mode
 	(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 'key-sequence
-  :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.20.1