From 1c8fc379b8d462d87f86e5cf1a98ba3594b7ea87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?El=C3=ADas=20Gabriel=20P=C3=A9rez?= Date: Thu, 2 Oct 2025 19:41:40 -0600 Subject: [PATCH] hideshow: Define new keymap for all the commands. bug#79569 * lisp/progmodes/hideshow.el (hs-prefix-map): New keymap. (hs-minor-mode-map): Use the new keymap. --- lisp/progmodes/hideshow.el | 27 ++++++++++++++++----------- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/lisp/progmodes/hideshow.el b/lisp/progmodes/hideshow.el index dd6f4d3fef7..bbe42a7de91 100644 --- a/lisp/progmodes/hideshow.el +++ b/lisp/progmodes/hideshow.el @@ -471,20 +471,25 @@ info node `(elisp)Overlays'." "Non-nil if using hideshow mode as a minor mode of some other mode. Use the command `hs-minor-mode' to toggle or set this variable.") +(defvar-keymap hs-prefix-map + :doc "Keymap for hideshow commands." + :prefix t + ;; These bindings roughly imitate those used by Outline mode. + "C-h" #'hs-hide-block + "C-s" #'hs-show-block + "C-M-h" #'hs-hide-all + "C-M-s" #'hs-show-all + "C-l" #'hs-hide-level + "C-c" #'hs-toggle-hiding + "C-a" #'hs-show-all + "C-t" #'hs-hide-all + "C-d" #'hs-hide-block + "C-e" #'hs-toggle-hiding) + (defvar-keymap hs-minor-mode-map :doc "Keymap for hideshow minor mode." - ;; These bindings roughly imitate those used by Outline mode. - "C-c @ C-h" #'hs-hide-block - "C-c @ C-s" #'hs-show-block - "C-c @ C-M-h" #'hs-hide-all - "C-c @ C-M-s" #'hs-show-all - "C-c @ C-l" #'hs-hide-level - "C-c @ C-c" #'hs-toggle-hiding - "C-c @ C-a" #'hs-show-all - "C-c @ C-t" #'hs-hide-all - "C-c @ C-d" #'hs-hide-block - "C-c @ C-e" #'hs-toggle-hiding "S-" #'hs-toggle-hiding + "C-c @" hs-prefix-map " " #'hs-indicator-mouse-toggle-hidding) (defvar-keymap hs-indicators-map