Article View: gnu.emacs.help
Article #188756Defining abbrevs for LaTeX mode
From: Simon Marshall
Date: Tue, 02 Jul 1991 13:16
Date: Tue, 02 Jul 1991 13:16
34 lines
2234 bytes
2234 bytes
In article 1699 Massimo Poesio (poesio@cs.rochester.edu) writes:
| I would like to define an abbrevs table to be used when I edit a LaTeX file
| which contains abbreviations for the most common LaTeX commands - so that,
| for example, I can type "\beSPC" and this gets expanded to "\begin", etc.
| [Some correct stuff deleted]
| (define-abbrev LaTeX-abbrev-table "\be" "\begin" nil)
| "^He"
`\' is a quote char, so what define-abbrev sees in "^He" as its
second arg and "^Hegin" as the its third arg (since "\b" == backspace
== "^H"). To get as actual `\', you must use `\\', which will be
evalled (passed) as `\' to define-abbrev. So, what you want is:
(define-abbrev LaTeX-abbrev-table "\\be" "\\begin" nil)
You must make sure that a `\' is recognised as being part of a
`word' in the LaTeX buffer. To see what I mean, type \be M-b (or
whatever backward-word is bound to) in the buffer. The cursor is
under the `b' and not the `\', right? If `\' was part of a word,
then the cursor would be under it.
To modify an entry for the current mode, type:
(modify-syntax-entry 92 "w")
92 being ASCII for "\". Now try, it worked for me!
Simon.
_______________________________________________________________________________
Simon Marshall, Dept. of Computer Science, University of Hull, Hull HU6 7RX, UK
"``La la la la la la la la la'' means I love you."
Email: S.Marshall@Hull.ac.uk Phone: +44 482 465951 (office) Fax: 466666
Technical Details
Message-ID:
<9107021511.AA11181@life.ai.mit.edu>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!sequent.cc.HUll.ac.UK!S.MarshallShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103b8b,7f90ea2ea55c3ed8,start X-Google-Attributes: gid103b8b,public X-Google-Thread: 102b9a,7f90ea2ea55c3ed8,start X-Google-Attributes: gid102b9a,public X-Google-ArrivalTime: 1991-07-02 10:10:32 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!cis.ohio-state.edu!sequent.cc.HUll.ac.UK!S.Marshall From: S.Marshall@sequent.cc.HUll.ac.UK (Simon Marshall) Newsgroups: gnu.emacs.help,comp.emacs Subject: Defining abbrevs for LaTeX mode Message-ID: <9107021511.AA11181@life.ai.mit.edu> Date: 2 Jul 91 13:16:07 GMT Sender: daemon@cis.ohio-state.edu Organization: Gatewayed from the GNU Project mailing list help-gnu-emacs@prep.ai.mit.edu Lines: 34