emacs-devel
[Top][All Lists]
Advanced

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

Re: hexl: doesn't play nicely with dynamic-completion-mode


From: Johan Bockgård
Subject: Re: hexl: doesn't play nicely with dynamic-completion-mode
Date: Thu, 13 Sep 2007 10:26:54 +0200
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> hexl-mode should probably install a before-change-function that checks that
>>> this-command is among the supported ones.  This won't fix those problems,
>>> but will at least catch them before they corrupt the buffer.
>
>> Is there some way for a before-change-function to prevent a change?
>> It can call 'error to prevent the change once, but this clears the
>> before-change-function handler, so the 'bad' key won't be caught
>> a 2nd time.
>
> Good point.  Not only it clears this function but any other
> before-change-functions as well, so it's clearly undesirable.  Hmm....

pre-command-hook can be used to divert commands on the fly. I don't know
if this solves your problem.

    ;; Example
    (defun foo ()
      (when (eq this-command 'self-insert-command)
        (setq this-command 'ignore)))

    (add-hook 'pre-command-hook 'foo nil t)

-- 
Johan Bockgård





reply via email to

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