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

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

Re: display reftex-toc automatically


From: Fabian Braennstroem
Subject: Re: display reftex-toc automatically
Date: 16 Jun 2005 06:48:21 GMT
User-agent: slrn/0.9.8.1/rt (Linux)

Hi Carsten,

On 2005-06-13, carsten_dominik@web.de <carsten_dominik@web.de> wrote:
> 
> 
>  Fabian Braennstroem schrieb:
> > Hi,
> >
> > I would like to display the reftex-toc automatically when I open an
> > existing tex-file. It would be nice if the automatic start just works
> > for an 'article' (and similark class and not for any letter-class.
> > Do you have any idea?
> >
> 
>  Untested:
> 
> 
>  (add-hook 'reftex-mode-hook
>         (lambda ()
>           (let ((class (save-excursion
>                          (goto-char (point-min))
>                          (if (re-search-forward
>                               "\\documentclass.*?{\\([^}]+\\)}" nil t)
>                              (match-string 1)))))
>             (if (member class '("article" "book" "report"))
>                 (reftex-toc)))))

Thanks! Tested it now. Unfortunately it doesn't work.
I get:

  Loading /home/fab/HOME/HomePage/latex_dissertation.rel...done
  Loading reftex-parse...done
  Building *toc* buffer...
  Loading reftex-sel...done
  Building *toc* buffer...done.
  file-name-extension: Wrong type argument: stringp, nil

when I open a tex-file which is an 'article'. For other classes than
book, report and article there is no problem. It seems that the search
for those classes works fine but opening up the toc makes problems.
Maybe, you have a second idea!?


Greetings, Fabian


reply via email to

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