emacs-devel
[Top][All Lists]
Advanced

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

Re: position on changing defaults?


From: Kim F. Storm
Subject: Re: position on changing defaults?
Date: Sat, 08 Mar 2008 21:56:01 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.91 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> BTW, why is using a pre- or post- command hook so bad?
>
> These tend to be brittle (e.g. when entering/exiting minibuffer prompts
> or recursive edits) and difficult to debug.  I think the need for
> pre/post command-hook is often a sign of a missing
> functionality elsewhere.

It seems I could get by with the following hooks:

pre-command-shifted-key-hook

        Called before executing command if transient-mark-mode
        is enabled and current command is invoked by a shifted key.

pre-command-mark-active-hook

        Called before executing command if transient-mark-mode
        is enabled and mark is active.

post-command-mark-active-hook

        Called after executing command if transient-mark-mode
        is enabled and mark is active.  Called before checking
        value of deactivate-mark!


I can probably do without the two mark-active hooks if it is
ok to use activate-mark-hook and deactivate-mark-hook to
add and remove functions on the general pre-command-hook
and post-command-hook, but having dedicated hooks would
be easier.



-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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