emacs-devel
[Top][All Lists]
Advanced

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

Re: What primitive has moved point?


From: Stefan Monnier
Subject: Re: What primitive has moved point?
Date: Fri, 06 Nov 2009 10:36:05 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> After point has been moved, how can I determine exactly which primitive
> did the moving?

Down this path lies madness.

> (possibly by the use of point-entered/left text properties),

...more madness.

> However, if the user gets to brace B with forward-line (e.g., with C-p)
> I want to leave point well alone.

I think your "feature" will be a misfeature, but if you really really
want to implement it, the sanest way is probably to consider not the
primitive used, but the direction of the movement: remember point in
pre-command-hook, and compare in post-command-hook.  Otherwise: wrap all
the relevant primitives (via defadvice, for example) and make them do
what you want.


        Stefan




reply via email to

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