all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* inserting code based on syntactic information in cc-mode
@ 2009-11-23  9:38 SameerDS
  2009-11-23  9:44 ` Joost Kremers
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: SameerDS @ 2009-11-23  9:38 UTC (permalink / raw)
  To: help-gnu-emacs

Hello,

I want to write elisp functions that can insert code based on the
syntactic information at the point where they are invoked. For
example, typing an opening brace at the start of a function definition
should automatically insert the closing brace and put point on a new
line between the two. But when an opening brace is typed at the start
of a class description, it should also insert a semi-colon after the
closing brace. Such a function might be easily written as a skeleton.
What I need is a way to inspect the local syntactic information when
the '{' key is pressed and then call the appropriate function.

For this, I've been going through the documentation for CC-mode
looking for a function that returns the syntax information for the
current line. Basically a function that is equivalent to c-show-
syntactic-information, but which can be used in elisp code directly. I
couldn't find such a function ... is there a way to do this at all in
CC-mode?

Sameer.


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

end of thread, other threads:[~2009-12-12  3:14 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-23  9:38 inserting code based on syntactic information in cc-mode SameerDS
2009-11-23  9:44 ` Joost Kremers
2009-11-23  9:58   ` SameerDS
2009-11-23 10:42 ` Pascal J. Bourguignon
2009-11-23 11:03   ` SameerDS
2009-12-11 11:16   ` SameerDS
2009-12-11 16:42     ` Lennart Borgman
2009-12-11 17:09     ` harven
2009-12-11 18:38 ` Alan Mackenzie
2009-12-12  3:14   ` SameerDS

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.