emacs-devel
[Top][All Lists]
Advanced

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

before-change-functions (was: 23.0.50; delete-seletion-mode and read-onl


From: Johan Bockgård
Subject: before-change-functions (was: 23.0.50; delete-seletion-mode and read-only text)
Date: Tue, 22 Jan 2008 14:12:53 +0100
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.50 (gnu/linux)

martin rudalics <address@hidden> writes:

>> In delete-seletion-mode, trying to self insert in read-only text when
>> there is a selection signals an error that clears pre-command-hook.
>
> Does the attached patch fix it?

It should fix this case, but delete-region can fail for other reasons,
so rms's fix might be better.

E.g. Customize (Widget) uses before-change-functions to prevent edits.
What happens when you select a region in a customize buffer and press
C-y (in delete-seletion-mode) is that the yank succeeds, but deleting
the selection fails

    Error in pre-command-hook: (text-read-only Attempt to change text
    outside editable field)

before-change-functions signals an error inside pre-command-hook,
something which causes both hooks to be cleared.  The yank then
proceeds uninhibited. (This is related to
http://lists.gnu.org/archive/html/emacs-devel/2007-09/msg01002.html "Is
there some way for a before-change-function to prevent a change [without
signaling an error]?")

-- 
Johan Bockgård





reply via email to

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