auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] Re: auto-load \include-files when opening master-file.


From: Ralf Angeli
Subject: Re: [AUCTeX] Re: auto-load \include-files when opening master-file.
Date: Thu, 28 Aug 2008 20:28:28 +0200

* inu (2008-08-27) writes:

>> Or you could assign a function doing something
>> like (mapcar 'find-file-noselect (reftex-all-document-files)) to a key
>> binding of your liking.
>
> I have no clue how to create such a function. I read the part about
> function, mapcar and find-file-noselect of the lisp manual, but I have
> big problems with understanding it/using it (and lisp in general).
> Thus I added this to my .emacs-file, but it doesnt work:
> (defun addchapters () (mapcar 'find-file-noselect 
> (reftex-all-document-files)))
> (global-set-key [f10] 'addchapters)

You don't want to <F10> to do this in all of Emacs, so better add it
only to the keymap of LaTeX mode:

(eval-after-load "latex"
  '(define-key LaTeX-mode-map (kbd "<f10>")
     (lambda ()
       (interactive)
       (mapcar 'find-file-noselect (reftex-all-document-files)))))

You could also work with `local-set-key' and execute that every time
`LaTeX-mode-hook' is run.

Also note that the function is marked as being interactive.

If it still does not work, the culprit could be that RefTeX hasn't
parsed the file yet.  In that case try executing `Ref --> Parse Document
--> Entire Document' from the menu.

>> I fail to see how the use of tabs would make a difference here, but oh
>> well.
>
> I am accustomed to the way Projects are handled in other
> LaTeX-Editors.

Other LaTeX editors always open all files of a project?  If they are
anything like common IDEs I highly doubt that.

The rationale for not opening all files at once is that one usually is
only working on certain parts of a document and then the other files are
just distracting.  In Emacs this becomes quite apparent when they are
cluttering the buffer list.

-- 
Ralf




reply via email to

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