[Top][All Lists]

[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: Sat, 07 Nov 2009 21:48:38 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

>> > 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.
> Actually, users have been complaining for a long time about "alternative"
> parens in branches of #if's not scanning or parsing properly.  I WANT TO
> FIX THIS, difficult though it might be.

I know it's difficult, and it's not even clear what it means in general.

> Maybe this would be a better idea:
> (i) "Neutralize" the syntactic value of every character inside a #define
> or each branch of #if/#elseif/#else apart from the favoured one.  Do this
> neutralization by splatting the area with syntax-table text properties,
> whilst remembering what the "real" properties should be.
> (ii) Each time point enters such a "splatted" region, restore the
> properties.  Also restore them for the purpose of font locking.

Doesn't sound like an attractive solution, since you have to choose one
of the alternatives, and then the user will be surprised when the other
alternatives don't work right.

The "right way" would be to extend syntax-tables so they can jump from
#else to #endif (or to #if when going backwards).

> (iii) Each time point leaves such a region, splat the properties again.
> What do you think?

I also think down this way lies madness.  It's just piling up hacks over
hacks, and while it may improve some behaviors it will screw up others.


reply via email to

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