[Top][All Lists]

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

What primitive has moved point?

From: Alan Mackenzie
Subject: What primitive has moved point?
Date: Fri, 6 Nov 2009 11:48:53 +0000
User-agent: Mutt/1.5.9i

Hi Richard, Hi Emacs!

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

The reason I want to know is so as to handle "unbalanced" braces
properly in CC Mode when they're inside #if and friends.  Such as:

int foo (int bar, int baz) {   // <========= brace A
int foo (int bar) {    // <========== brace B

If the user arrives at brace B through scan-lists (e.g. with C-M-u) I
want to catch this (possibly by the use of point-entered/left text
properties), and according to some user options, perhaps adjust point to
brace A.

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

I want to draw this distinction regardless of whether point is moved
directly by the user or inside CC Mode's analysis functions.

Is there any way I can tell which of these primitives got me to brace B?

Thanks in advance!

Alan Mackenzie (Nuremberg, Germany).

reply via email to

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