help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: I'd like to advise a /keybinding/, how do I do it?


From: Bob Newell
Subject: Re: I'd like to advise a /keybinding/, how do I do it?
Date: Wed, 28 Apr 2021 14:29:45 -1000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

>> A "finishing" action is often bound to C-c C-c (sending an email and
>> commiting something to Git come to mind), so I'd like to advise whatever
>> C-c C-c calls to check the buffer for occurrences of a string like TODO.

> Or you could do it by advising the command bound to the particular key

I've done this when I want the underlying command to be
affected in all cases. For instance I don't wish send out an
email until I've verified that I have a network connection, so
I advise "message-send" and "message-send-and-exit" rather
than the associated keystrokes.

But be at least a little wary. Sometimes the keystrokes fool
you about the underlying function. In my Gnus reply buffer
right now, C-h k on C-c C-c shows 'orgtbl-ctrl-c-ctrl-c'.

> Or you could do it with a minor-mode map (i.e. without modifying any

I've done this on several occasions when I don't want to mess
with the use of a command outside of a particular minor
mode. That's a less common case, I think, but still very
useful for certain things.

-- 
Bob Newell
Honolulu, Hawai`i

- Via GNU/Linux/Emacs/Gnus/BBDB



reply via email to

[Prev in Thread] Current Thread [Next in Thread]