all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* display reftex-toc automatically
@ 2005-06-13 10:40 Fabian Braennstroem
  2005-06-13 20:55 ` carsten_dominik
  0 siblings, 1 reply; 3+ messages in thread
From: Fabian Braennstroem @ 2005-06-13 10:40 UTC (permalink / raw)


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?

Greetings, Fabian

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: display reftex-toc automatically
  2005-06-13 10:40 display reftex-toc automatically Fabian Braennstroem
@ 2005-06-13 20:55 ` carsten_dominik
  2005-06-16  6:48   ` Fabian Braennstroem
  0 siblings, 1 reply; 3+ messages in thread
From: carsten_dominik @ 2005-06-13 20:55 UTC (permalink / raw)




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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: display reftex-toc automatically
  2005-06-13 20:55 ` carsten_dominik
@ 2005-06-16  6:48   ` Fabian Braennstroem
  0 siblings, 0 replies; 3+ messages in thread
From: Fabian Braennstroem @ 2005-06-16  6:48 UTC (permalink / raw)


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-06-16  6:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-13 10:40 display reftex-toc automatically Fabian Braennstroem
2005-06-13 20:55 ` carsten_dominik
2005-06-16  6:48   ` Fabian Braennstroem

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.