unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* What primitive has moved point?
@ 2009-11-06 11:48 Alan Mackenzie
  2009-11-06 15:36 ` Stefan Monnier
  2009-11-07 12:39 ` Richard Stallman
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Mackenzie @ 2009-11-06 11:48 UTC (permalink / raw)
  To: Richard Stallman, emacs-devel

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:

#if NEW_VERSION
int foo (int bar, int baz) {   // <========= brace A
#else
int foo (int bar) {    // <========== brace B
#endif

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).




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-11-17 23:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-06 11:48 What primitive has moved point? Alan Mackenzie
2009-11-06 15:36 ` Stefan Monnier
2009-11-07 13:25   ` Alan Mackenzie
2009-11-08  2:48     ` Stefan Monnier
2009-11-17 23:56       ` Alan Mackenzie
2009-11-07 12:39 ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).