I have a non-interactive function F
to do post processing after each command. F
is buffer locally hooked to post-command-hook
.
Whenever F
is hooked the prefix argument is eaten and the next command does not get it.
How can I preserve the prefix argument when hooking a function to post-command-hook
?
EDIT: There is no issue with the prefix argument and the function F
being hooked as the selected answer shows.
My issue was that the function (let's call it A
) that did not worked properly could be either called directly (which had a working behavior) or called from a push-button
(in this case the prefix argument was not passed to A
).
post-command-hook
and then reset it tonil
once that hook runs its course?C
. If I hookF
topost-hook-command
thenC
never sees the prefix argument.F
is hooked the prefix argument is eaten and the next command does not get it." What "next command"? Functions in thepost-command-hook
are ran after the actual command.C-u 3 a
”), the behavior you observe, and the behavior you want to achieve instead.F
hooked inpost-command-hook
. Then pressing1 RET
(in this case the command is bound to RET) does not receive the prefix argument. There is not much to say than this.