Many Emacs commands alter their behavior when called with one or more C-u prefixes. In some cases the default behavior of a command is less useful to me than the behavior I get when prefixing it with C-u. At the same time, I do not want to get rid of the default behavior completely.
To give a concrete example, the quit-window
command (bound to q
in help-mode
) quits the current window and buries the buffer displayed in it by default. When called with C-u it kills the buffer instead. I would like the command to kill the buffer by default and bury it when called with a C-u prefix.
Q: How can I tell Emacs to make a command behave as if it was called with a C-u prefix by default while moving the default behavior to the C-u prefix?
I know that I could address this by redefining the original command or wrapping it in a custom command that passes prefix args according to my preferences. But I'd rather do something like this:
(swap-args 'quit-window)