* bug#68979: Outline mode menu
@ 2024-02-07 17:40 Juri Linkov
2024-02-09 7:12 ` Juri Linkov
0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2024-02-07 17:40 UTC (permalink / raw)
To: 68979
While adding new commands ‘outline-cycle’ and ‘outline-cycle-buffer’
to the outline mode menu, I noticed a strange menu definition.
It looks like "Hide", "Show" and "Headings" were intended to be a submenu,
but due to the broken menus these titles are not used.
(define-key map [hide] (cons "Hide" (make-sparse-keymap "Hide")))
(define-key map [hide outline-hide-other]
(define-key map [show] (cons "Show" (make-sparse-keymap "Show")))
(define-key map [show outline-show-subtree]
(define-key map [headings] (cons "Headings" (make-sparse-keymap "Headings")))
(define-key map [headings demote-subtree]
Probably this should be transformed to 'easy-menu-define'.
^ permalink raw reply [flat|nested] 3+ messages in thread
* bug#68979: Outline mode menu
2024-02-07 17:40 bug#68979: Outline mode menu Juri Linkov
@ 2024-02-09 7:12 ` Juri Linkov
2024-02-10 17:34 ` Juri Linkov
0 siblings, 1 reply; 3+ messages in thread
From: Juri Linkov @ 2024-02-09 7:12 UTC (permalink / raw)
To: 68979
> While adding new commands ‘outline-cycle’ and ‘outline-cycle-buffer’
> to the outline mode menu, I noticed a strange menu definition.
>
> It looks like "Hide", "Show" and "Headings" were intended to be a submenu,
> but due to the broken menus these titles are not used.
>
> (define-key map [hide] (cons "Hide" (make-sparse-keymap "Hide")))
> (define-key map [hide outline-hide-other]
>
> (define-key map [show] (cons "Show" (make-sparse-keymap "Show")))
> (define-key map [show outline-show-subtree]
>
> (define-key map [headings] (cons "Headings" (make-sparse-keymap "Headings")))
> (define-key map [headings demote-subtree]
>
> Probably this should be transformed to 'easy-menu-define'.
Actually this implementation is intentional as the comments explain.
So there is nothing to do here.
Also I failed to add new commands ‘outline-cycle’ and ‘outline-cycle-buffer’
because they equally fit into both submenus "Show" and "Hide".
So this request could be closed with the following patch that adds the
menu item for outline-minor-mode to make it more prominent as discussed
in bug#68824.
diff --git a/lisp/menu-bar.el b/lisp/menu-bar.el
index 47c6a8f0613..5b290899ff5 100644
--- a/lisp/menu-bar.el
+++ b/lisp/menu-bar.el
@@ -1353,6 +1353,15 @@ menu-bar-showhide-menu
(frame-visible-p
(symbol-value 'speedbar-frame))))))
+ (bindings--define-key menu [showhide-outline-minor-mode]
+ '(menu-item "Outlines" outline-minor-mode
+ :help "Turn outline-minor-mode on/off"
+ :visible (seq-some #'local-variable-p
+ '(outline-search-function
+ outline-regexp outline-level))
+ :button (:toggle . (and (boundp 'outline-minor-mode)
+ outline-minor-mode))))
+
(bindings--define-key menu [showhide-tab-line-mode]
'(menu-item "Window Tab Line" global-tab-line-mode
:help "Turn window-local tab-lines on/off"
^ permalink raw reply related [flat|nested] 3+ messages in thread
* bug#68979: Outline mode menu
2024-02-09 7:12 ` Juri Linkov
@ 2024-02-10 17:34 ` Juri Linkov
0 siblings, 0 replies; 3+ messages in thread
From: Juri Linkov @ 2024-02-10 17:34 UTC (permalink / raw)
To: 68979
close 68979 30.0.50
quit
> So this request could be closed with the following patch that adds the
> menu item for outline-minor-mode to make it more prominent as discussed
> in bug#68824.
Now pushed to master and closed.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-02-10 17:34 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-07 17:40 bug#68979: Outline mode menu Juri Linkov
2024-02-09 7:12 ` Juri Linkov
2024-02-10 17:34 ` Juri Linkov
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).