Xref: utzoo gnu.emacs.help:1606 comp.text.tex:6529 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!rphroy!caen!uwm.edu!bionet!snorkelwacker.mit.edu!bloom-beacon!eru!hagbard!sunic!mcsun!ukc!warwick!nott-cs!mws1.Berkeley.EDU!pczdcd From: pczdcd@uk.ac.nott.mips (Clyde Davies) Newsgroups: gnu.emacs.help,comp.text.tex Subject: Re: GNU EMACS latex-mode, setting hooks, ... Message-ID: <1991Mar28.172108.15210@cs.nott.ac.uk> Date: 28 Mar 91 17:21:08 GMT References: Sender: news@cs.nott.ac.uk Organization: Nottingham University Lines: 59 In article , fritzz@zoot.ldgo.columbia.edu (fritz zaucker) writes: > Xref: nott-cs gnu.emacs.help:1397 comp.text.tex:5813 > Path: nott-cs!ukc!mcsun!uunet!ukma!wuarchive!zaphod.mps.ohio-state.edu!sol.ctr .columbia.edu!cunixf.cc.columbia.edu!lamont!zoot!fritzz > From: fritzz@zoot.ldgo.columbia.edu (fritz zaucker) > Newsgroups: gnu.emacs.help,comp.text.tex > Subject: GNU EMACS latex-mode, setting hooks, ... > Message-ID: > Date: 24 Mar 91 21:19:16 GMT > Sender: fritzz@lamont.ldgo.columbia.edu > Organization: Lamont-Doherty Geological Observatory, Columbia University, New > Lines: 21 > > > Hi, > > I use GNU EMACS to edit LaTeX files and I use latex.el (from Nelson > Beebe). > I would like to set mode-hooks, so that if I switch to LaTeX-mode, the > following happens automatically: > > latex.el is loaded > outline-regexp is set to something like "[\\][(sub\\)]*section". > > I just couldn't get it to work. Has anybody done that? Do you have a > complete LaTeX outline-regexp? > > Thanks for any help, I'll summarize. > > Fritz > -- > -- > Fritz Zaucker > Lamont-Doherty Geological Observatory of Columbia University New York > Palisades, NY 10964 (914) 359-2900 x703 EMAIL: fritzz@lamont.ldgo.columbia.edu It's a little hairy to figure out the regexp yourself (it took me three days...) so here goes. The thing to remember is that backslashes need to be doubly escaped when putting into a regexp, and also in Elisp. hence all backslashes need to be *quadruply* escaped in the regexp when eventually intended for LaTeX. The Elisp I use (and it works most of the time) is: (setq outline-regexp "^\\\\cha\\|^\\\\\\(sub\\)*se\\|^\\\\\\(sub\\)*paragraph) try this and see. 'Scope