~protesilaos/denote

3 2

Denote menu shouldn't be the first menu in the menu bar

Kai von Fintel <fintel@mit.edu>
Details
Message ID
<2B60992C-0FC9-42CC-B669-69A544450FEF@mit.edu>
DKIM signature
missing
Download raw message
It is unusual for something like “Denote” to put its menu in the first position of the menu bar, to the left of the “File” menu. I looked at the source code in `denote.el` and couldn’t quite see what would need to be changed to put it more towards the right (for example, to the right of the “Tools” menu). But this post on SO might point out a way to do this: https://stackoverflow.com/a/29396939.

— Kai.
Details
Message ID
<87354xrj21.fsf@protesilaos.com>
In-Reply-To
<2B60992C-0FC9-42CC-B669-69A544450FEF@mit.edu> (view parent)
DKIM signature
missing
Download raw message
Hello Kai,

> From: Kai von Fintel <fintel@mit.edu>
> Date: Mon, 17 Apr 2023 16:34:41 -0400
>
> It is unusual for something like “Denote” to put its menu in the first
> position of the menu bar, to the left of the “File” menu.

I agree.

> I looked at the source code in `denote.el` and couldn’t quite see what
> would need to be changed to put it more towards the right (for
> example, to the right of the “Tools” menu). But this post on SO might
> point out a way to do this: https://stackoverflow.com/a/29396939.

I read the documentation on menus.  Here is the part that mentions
'define-key-after':
https://www.gnu.org/software/emacs/manual/html_node/elisp/Modifying-Menus.html

I cannot get it to work.

I tried variations of the following, but still get undesired results:

    (easy-menu-define denote-global-menu global-map
      "Menu with all Denote commands, each available in the right context."
      denote--menu-contents)

    ;; This
    (easy-menu-add-item global-map nil denote-global-menu '("Help"))

    ;; Or
    (define-key-after global-map [menu-bar denote] denote-global-menu 'tools)

Either the menu will not appear at all, or I am creating duplicate
entries in the menu bar.

I did M-x find-library to check the source of files such as
elisp-mode.el, org.el, menu-bar.el and did not find the code that is
responsible for this task.

I am happy to do the right thing here, but don't know how to proceed.

All the best,
Prot

-- 
Protesilaos Stavrou
https://protesilaos.com
Details
Message ID
<86bkjltsc2.fsf@nobiot.com>
In-Reply-To
<87354xrj21.fsf@protesilaos.com> (view parent)
DKIM signature
missing
Download raw message
Protesilaos Stavrou <info@protesilaos.com> writes:
> I did M-x find-library to check the source of files such as
> elisp-mode.el, org.el, menu-bar.el and did not find the code that is
> responsible for this task.
>
> I am happy to do the right thing here, but don't know how to proceed.

I think I had the same or similar challenge using easy-menu -- for me it
wasn't easy.

In the end, this way [1] has worked for my package
Org-remark. Basically, I worked from most detailed going a way up to the
menu-bar. I constructed each menu item frist, then grouped some of them
into a drop-down menu, and finally put all of them into a menu-bar
level. "Org-remark" menu gets placed just before "Help".

[1]: https://github.com/nobiot/org-remark/blob/main/org-remark.el#L282-L351


– nobiot
Details
Message ID
<874jp6nadg.fsf@protesilaos.com>
In-Reply-To
<86bkjltsc2.fsf@nobiot.com> (view parent)
DKIM signature
missing
Download raw message
> From: Noboru Ota <me@nobiot.com>
> Date: Tue, 18 Apr 2023 12:09:17 +0200
>
> Protesilaos Stavrou <info@protesilaos.com> writes:
>> I did M-x find-library to check the source of files such as
>> elisp-mode.el, org.el, menu-bar.el and did not find the code that is
>> responsible for this task.
>>
>> I am happy to do the right thing here, but don't know how to proceed.
>
> I think I had the same or similar challenge using easy-menu -- for me it
> wasn't easy.
>
> In the end, this way [1] has worked for my package
> Org-remark. Basically, I worked from most detailed going a way up to the
> menu-bar. I constructed each menu item frist, then grouped some of them
> into a drop-down menu, and finally put all of them into a menu-bar
> level. "Org-remark" menu gets placed just before "Help".
>
> [1]: https://github.com/nobiot/org-remark/blob/main/org-remark.el#L282-L351

Thank you, nobiot!  This is an unfortunate situation.  I will research
it further, otherwise I will have to do it the other way.

-- 
Protesilaos Stavrou
https://protesilaos.com
Reply to thread Export thread (mbox)