Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 2
    The command is widget-button-click as the help display shows. That may not be what you meant (you probably meant which function in notmuch-hello is called to clear the search history), but that is the command that is called: it just happens to be implemented using the widget library which adds some layers of indirection to the call sequence before you get back into notmuch-hello. The function that clears the search history is notmuch-hello-insert-recent-searches - which as its name implies, does more than clear the search history. Commented Aug 30, 2024 at 14:34
  • 1
    This doesn't answer the question. Clicking on the button triggers some command, that's hardly surprising. The question is which command. Commented Aug 30, 2024 at 15:13
  • 1
    No, I deliberately answered the metaquestion of how to find the command that a button click will execute because I don't want to have to answer the same question for every single button in Emacs. Besides, I couldn’t even get a working buffer out of notmuch-hello until I installed notmuch and configured it, which I didn’t want to bother to do. I’d forgotten that all widget buttons just execute widget-button-click though, that is annoying. Commented Aug 30, 2024 at 15:46
  • 2
    @Gilles'SO-stopbeingevil' I disagree (at least for the current form of the answer): it answers the question completely - the answer is widget-button-click. If you were talking about the earlier one-line form of the answer, I agree that it was a bit too cryptic, although using C-h k, the OP was able to come up with the answer, even if he did not quite realize it. The most important point IMO is the one on the first liine: C-h k works for events, not just keys. Commented Aug 31, 2024 at 2:06
  • 1
    The only criticism of the answer I have (and it can be argued that it is off-topic: you cannot explain everything starting from first principles in an SE answer) is that in the "not super-helpful" case, the OP is basically stuck: it is often the case that these callbacks are fairly simple, so they are implemented as anonymous lambdas and after compilation, they are unrecognizable. Some guidance might be helpful for that case. Commented Aug 31, 2024 at 2:23