help-gnu-emacs
[Top][All Lists]
Advanced

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

abbrevs, skeletons, and comments


From: nobrowser
Subject: abbrevs, skeletons, and comments
Date: Sat, 02 Jun 2007 07:34:49 -0700
User-agent: G2/1.0

In a module I'm writing, I'd like to bind abbrevs to code skeletons,
similar to what is done e.g. by sml-mode.  But expanding the abbrevs
makes no sense when the point is inside a comment (or a string
literal).  So I'd like to conditionally stop expansion.  The main
opportunity for that seems to be pre-abbrev-expand-hook, but there are
only two ways it can stop an expansion: 1, throw an error, 2, change
the abbrev bindings (either by making changes in the current table or
by swapping in a whole new table). 1 is unacceptable - how many errors
before user gets mad and disables abbrevs altogether? 2, how to undo
the changes when the point leaves the comment or string?



reply via email to

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