[OS X Emacs] Abbrevs with '\' character don't work in Aquamacs 1.5
Jochen Küpper
kuepper.jochen at googlemail.com
Sat Oct 11 05:00:57 EDT 2008
On 10.10.2008, at 23:55, Ian Eure wrote:
> On Oct 8, 2008, at 2:29 PM, Adrian wrote:
>
>> I'm trying to define some abbrevs for LaTeX commands. However, if
>> I try to define any abbrevs beginning with a '\' character, the
>> abbrev is not completed when I type a space after the word. I have
>> included several examples from my abbrevs file below:
>>
>> (define-abbrev-table 'text-mode-abbrev-table '(
>> ("teh" "the " nil 0)
>> ("\\c" "\\chapter{}" backward-char 0)
>> ("\\i" "\\item" nil 0)
>> ; abbreviations calling functions (which are defined in my-
>> latex.el)
>> ("\\ce" "" my-latex-center 0)
>> ))
>>
>> Of these examples, the first works fine in LaTeX mode. However,
>> none of the others produce any results when I type a space after
>> the desired abbrev. For example, "\c " will remain as "\c" and not
>> expand to "\chapter{}" as desired. I have tried altering the
>> syntax of the abbrevs a bit. If I remove one of the preceding
>> slash characters, so the abbrev definition looks like "\c" "\
>> \chapter{}" etc., the abbrev is inserted when I type "c " with no
>> preceding slash. Also, if I try to define an abbrev using the
>> command line key sequence C-x a g, the resulting abbrev is still
>> not functional. For example, typing C-x a g after "\ref{}" and
>> assigning the abbrev "\foo", I see a new line in my list of abbrevs
>> that looks just like the ones above: ("\\foo" "\\ref{}" nil 0).
>> However, this abbrev, like the ones I have defined for myself, also
>> fails. It seems that Emacs doesn't know how to read its own
>> syntax...?
>>
>> I hope what I am trying to do is possible in Emacs, as it seems
>> like fairly basic functionality. If not, is there a better way to
>> handle LaTeX completions in Emacs?
>>
> Define abbrevs which are sequences of word-syntax characters. e.g.
> `chap', `itm', `cen', etc.
Of course for the general LaTeX command the idea is simply to use
auctex bindings, i.e., C-c C-s toi insert chapter/section/... or C-c C-
e for environemnts and M-TAB to get a new item... That's faster than
any abbrevs, and you are free to use the abbrevs for actual writing;-)
Greetings,
Jochen
--
Einigkeit und Recht und Freiheit http://www.Jochen-Kuepper.de
Liberté, Égalité, Fraternité GnuPG key: CC1B0B4D
Sex, drugs and rock-n-roll
More information about the MacOSX-Emacs
mailing list