[Top][All Lists]

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

Re: Tests involving post-command-hook

From: Stefan Monnier
Subject: Re: Tests involving post-command-hook
Date: Wed, 01 Aug 2018 07:51:06 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> 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)

We don't want call-interactively to run those hooks, because commands
may internally call call-interactively themselves.


reply via email to

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