1

Right now the name "Prefix" is standing next to all my prefix keys, in org-agenda.

Is there any way to rename this "help text"?

EDIT: if you have entries with e.g. two-letter keys where the first letter is the same, then org-agenda will call the first letter a Prefix key and group the entries into a sub-menu. So when you do M-x org-agenda the *Agenda Commands* window looks like this:

Press key for an agenda command:
--------------------------------        <   Buffer, subtree/region restriction
a   Agenda for current week or day      >   Remove restriction
t   List of all TODO entries            e   Export agenda views
m   Match a TAGS/PROP/TODO query        T   Entries with special TODO kwd
s   Search for keywords                 M   Like m, but only TODO entries
/   Multi-occur                         S   Like s, but only TODO entries
?   Find :FLAGGED: entries              C   Configure custom agenda commands
*   Toggle sticky agenda views          #   List stuck projects (!=configure)


h    Prefix key
...

Pressing h will bring up a sub-menu of the org-agenda-custom-commands that share h as a prefix key. I want to change the label Prefix key above to something else. How do I do that?

5
  • I'm sorry, which help text is this? Is this in a *Help* buffer? Please edit your question and provide an example if you can.
    – Trevoke
    Commented Aug 1, 2023 at 12:33
  • Sadly, I can't copy it. It is the text that is displayed next to the Prefix, when I issue the command org-agenda Commented Aug 1, 2023 at 12:50
  • That tells you that if you type any of the prefix keys, you will get a submenu with all the possible continuations of that prefix key, right? What would you rather have it do?
    – NickD
    Commented Aug 1, 2023 at 18:38
  • The string "Prefix key" is hardwired in org-agenda-get-restriction-and-command - there is no way to change it except by modifying the code of this function.
    – NickD
    Commented Aug 1, 2023 at 18:44
  • Disregard the last comment: look at the answer instead :-)
    – NickD
    Commented Aug 1, 2023 at 20:41

1 Answer 1

1

Maybe this will help although I have not tried it out. The doc string of org-agenda-custom-commands says, in part:

...
When using several characters as key to a command, the first characters
are prefix commands.  For the dispatcher to display useful information, you
should provide a description for the prefix, like

(setq org-agenda-custom-commands
   '(("h" . "HOME + Name tag searches") ; describe prefix "h"
     ("hl" tags "+HOME+Lisa")
     ("hp" tags "+HOME+Peter")
     ("hk" tags "+HOME+Kim")))

EDIT: unfortunately there is a bug in org-agenda-get-restriction-and-command and the description line causes it to barf, at least in my case.

There is nothing wrong with the function: PEBKAC. So if you set your org-agenda-custom-commands like this:

(setq hk-command '("hk" tags "+HOME+Kim"))
(setq hl-command '("hl" tags "+HOME+Lisa"))
(setq hp-command '("hp" tags "+HOME+Peter"))

(setq org-agenda-custom-commands (list hk-command hk-command hp-command))

you can add a description entry for the prefix h as follows:

(setq h-entry '("h" . "Here is a nice description of the prefix h"))

(add-to-list 'org-agenda-custom-commands h-entry)

and you'll get the nice description of the prefix h indeed.

Here's a screenshot with what I did in the *scratch* buffer in the top window, before doing M-x org-agenda to get the agenda menu in the bottom window:

enter image description here

Basically, org-agenda-custom-commands is a list of lists (not necessarily proper). An improper list like the h entry above, whose car and cdr are both strings, modifies the label of the prefix key.

3
  • Can you please try this and respond one way or another? Does it work? You ask a lot of questions but you seem to either not look at the answers or not provide any feedback. Providing feedback on answers is an integral part of how the site is supposed to work.
    – NickD
    Commented Aug 4, 2023 at 11:57
  • 1
    Yes, thanks alot. It works. I'm sorry that I sometime take time to mark it as an answer and I will mark all my questions or follow up on them. It's just that when I get stuck, I tend to work on something else, then get back to the original problem;) Commented Aug 6, 2023 at 12:55
  • OK - thanks! I don't know if anybody else feels this way, but for me as the author of an answer, there is nothing worse than silence :-) So thanks for following up on this (and I hope on your other questions that have received answers as well: I think their authors would appreciate it).
    – NickD
    Commented Aug 6, 2023 at 18:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.