[Top][All Lists]

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

Re: Tests involving post-command-hook

From: Stephen Berman
Subject: Re: Tests involving post-command-hook
Date: Wed, 01 Aug 2018 14:37:40 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

On Wed, 01 Aug 2018 07:51:06 -0400 Stefan Monnier <address@hidden> wrote:

>> I'm using ERT to test for the hl-line face property and it appears that
>> in the test environment, the function hl-line-highlight is not
>> automatically run from post-command-hook as it should be, although I use
>> call-interactively to mimic a command invocation.  It works only if I
> pre/post-command-hook is run by the command *loop*, not by call-interactively.
> The command loop is the chunk of C code which does something like:
>     (while t
>       (let ((keys (read-key-sequence)))
>         (run-hooks 'pre-command-hook)
>         (call-interactively (key-binding keys))
>         (run-hooks 'post-command-hook)
>         (redisplay)))
> We don't want call-interactively to run those hooks, because commands
> may internally call call-interactively themselves.

My misunderstanding, thanks for clarifying.  In any case, as Noam
Postavsky pointed out, I can get the job done with ert-simulate-command.

Steve Berman

reply via email to

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