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

- Carsten

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to