GNU bug report logs - #68979
Outline mode menu

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Wed, 7 Feb 2024 17:48:02 UTC

Severity: normal

Fixed in version 30.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68979 in the body.
You can then email your comments to 68979 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#68979; Package emacs. (Wed, 07 Feb 2024 17:48:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Juri Linkov <juri <at> linkov.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 07 Feb 2024 17:48:03 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: bug-gnu-emacs <at> gnu.org
Subject: Outline mode menu
Date: Wed, 07 Feb 2024 19:40:50 +0200
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'.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68979; Package emacs. (Fri, 09 Feb 2024 07:23:03 GMT) Full text and rfc822 format available.

Message #8 received at 68979 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 68979 <at> debbugs.gnu.org
Subject: Re: bug#68979: Outline mode menu
Date: Fri, 09 Feb 2024 09:12:58 +0200
> 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"




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#68979; Package emacs. (Sat, 10 Feb 2024 17:38:02 GMT) Full text and rfc822 format available.

Message #11 received at 68979 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 68979 <at> debbugs.gnu.org
Subject: Re: bug#68979: Outline mode menu
Date: Sat, 10 Feb 2024 19:34:32 +0200
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.




bug marked as fixed in version 30.0.50, send any further explanations to 68979 <at> debbugs.gnu.org and Juri Linkov <juri <at> linkov.net> Request was from Juri Linkov <juri <at> linkov.net> to control <at> debbugs.gnu.org. (Sat, 10 Feb 2024 17:38:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 10 Mar 2024 11:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.