[Top][All Lists]

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

[AUCTeX-devel] Re: multi-file support

From: Ralf Angeli
Subject: [AUCTeX-devel] Re: multi-file support
Date: Sat, 14 May 2005 12:15:14 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux)

* Richard Lewis (2005-05-13) writes:

> (Also, if you open just a master file and generate previews for the
> whole document, the slave files are opened and you get asked for the
> master file for each slave)
> As a workaround, how about forcing the buffer to be visible when the
> question gets asked:
> --- tex.el    09 May 2005 16:27:10 +0100      5.512
> +++ tex.el    13 May 2005 16:39:18 +0100      
> @@ -1240,6 +1240,7 @@
>        ;; For files shared between many documents.
>        ((and (eq 'shared TeX-master) ask)
> +       (pop-to-buffer (current-buffer))
>         (setq TeX-master
>               (TeX-strip-extension
>                (let ((default (or (TeX-dwim-master) "this file")))

That's too drastic.  My suggestion would be to include the file name
in the prompt for the master file in case the buffer is not visible.
The following patch accomplishes this:

Index: tex.el
RCS file: /cvsroot/auctex/auctex/tex.el,v
retrieving revision 5.515
diff -u -r5.515 tex.el
--- tex.el      12 May 2005 12:09:50 -0000      5.515
+++ tex.el      14 May 2005 10:11:01 -0000
@@ -1243,7 +1243,11 @@
          (setq TeX-master
                 (let ((default (or (TeX-dwim-master) "this file")))
-                  (read-file-name (format "Master file: (default %s) " default)
+                  (read-file-name
+                   (if (get-buffer-window (current-buffer))
+                       (format "Master file: (default %s) " default)
+                     (format "Master file of %s: (default %s) "
+                             (file-relative-name (buffer-file-name)) default))
                                   nil default))
                 (list TeX-default-extension)
Drawbacks: The prompt may become very long and the file name is not
only included in the example with preview-latex you mentioned but also
when an existing file with a shared master is opened because
`switch-to-buffer' is the last thing executed by `find-file', i.e. the
buffer will not be displayed when the question is asked.  Maybe
somebody knows a better test?


reply via email to

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