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

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

Re: abbrevs, skeletons, and comments


From: Tim X
Subject: Re: abbrevs, skeletons, and comments
Date: Sun, 03 Jun 2007 13:24:00 +1000
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

nobrowser@gmail.com writes:

> 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?
>

maybe use an error handler that catches that specific error and ignores it?

Tim
-- 
tcross (at) rapttech dot com dot au


reply via email to

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