emacs-devel
[Top][All Lists]
Advanced

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

Re: unreading a command key sequence


From: Stefan Monnier
Subject: Re: unreading a command key sequence
Date: Wed, 07 May 2008 21:43:25 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> I do this in pre-command-hook and I just did forget that this-command still
> will be carried out (and that was what I wanted to prevent). I think this is
> what I should do instead:

>   (setq this-command 'tunnel-last-command)
>   (setq unread-command-events
>         (append unread-command-events
>                 (listify-key-sequence
>                  (this-command-keys-vector))
>                 nil))
>   (defun tunnel-last-command ()
>     "Set `this-command' to `last-command'."
>     (interactive)
>     (setq this-command last-command))

> This works for in the tests I have made (including some with Viper undo
> involved). If this is the way to do such things in pre-command-hook then
> this might be worth documenting.

You seem to be thinking out loud.  I don't know what you mean by "such
things".


        Stefan




reply via email to

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