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: Stefan Monnier
Subject: Re: hexl: doesn't play nicely with dynamic-completion-mode
Date: Mon, 10 Sep 2007 16:20:13 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.50 (gnu/linux)

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

Of course, we could use a big ugly hack which saves the
before-change-functions value somewhere before signalling the error and
restores it from post-command-hook or run-with-timer.  Yuck!

> Also, I notice that 'this-command is
> 'completion-separator-self-insert-command rather than
> 'self-insert-command in the hexl-mode before-change-function (after
> applying Richard's fix), so hexl-mode would need to know about all the
> modes which remap self-insert-command.

Indeed checking this-command is probably a bad idea.  Maybe better check
a `hexl-aware-text-modification' variable which defaults to nil and is bound
to t in functions that know about hexl.


        Stefan




reply via email to

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