]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/outline.el: 'S-<down-mouse-1>' on buffer buttons cycles all outlines.
authorJuri Linkov <juri@linkov.net>
Wed, 23 Nov 2022 08:50:23 +0000 (10:50 +0200)
committerJuri Linkov <juri@linkov.net>
Wed, 23 Nov 2022 08:50:23 +0000 (10:50 +0200)
(outline--create-button-icons, outline--insert-button): Bind 'S-<mouse-1>' to
'outline-cycle-buffer' as it's already done for buttons on the margins.
Ignore 'S-<down-mouse-1>'.  Don't hard-code 'help-echo' since it should be
customizable by the ':help-echo' keyword in 'define-icon'.

lisp/outline.el

index 2465a4963abb9eb7d5da07f2e197c1609d419b02..86ac19aa415950f53e8ee2e557ce4856a8f5280c 100644 (file)
@@ -1777,7 +1777,12 @@ With a prefix argument, show headings up to that LEVEL."
         (propertize (icon-string icon-name)
                     'mouse-face 'default
                     'follow-link 'mouse-face
-                    'keymap (define-keymap "<mouse-2>" #'outline-cycle)))
+                    'keymap (define-keymap
+                              "<mouse-2>" #'outline-cycle
+                              ;; Need to override the global binding
+                              ;; `mouse-appearance-menu' with <down->:
+                              "S-<down-mouse-1>" #'ignore
+                              "S-<mouse-1>" #'outline-cycle-buffer)))
       (list 'outline-open
             (if outline--use-rtl 'outline-close-rtl 'outline-close))))))
 
@@ -1805,10 +1810,11 @@ With a prefix argument, show headings up to that LEVEL."
            (overlay-put o 'mouse-face 'highlight)
            (overlay-put o 'keymap (define-keymap
                                     "RET" #'outline-cycle
-                                    "<mouse-2>" #'outline-cycle))
-           (overlay-put o 'help-echo (if (eq type 'close)
-                                         "Click to show"
-                                       "Click to hide")))
+                                    "<mouse-2>" #'outline-cycle
+                                    ;; Need to override the global binding
+                                    ;; `mouse-appearance-menu' with <down->:
+                                    "S-<down-mouse-1>" #'ignore
+                                    "S-<mouse-1>" #'outline-cycle-buffer)))
           ('in-margins
            (overlay-put o 'before-string icon)
            (overlay-put o 'keymap (define-keymap "RET" #'outline-cycle)))