* Ralf Angeli (2007-10-05) writes:

> * Bjørn Haagensen (2007-10-05) writes:
>
>> If a function 'file' is defined running 'TeX-command-master' fails
>> with the following backtrace:
>
> An easy way out would be to rename the symbol to something less generic,
> e.g. `TeX-master-or-region-file'.  A nicer way would be to get rid of
> the whole awkward construct of a locally defined function.

The attached patch should do that.  It still has the shortcoming of
`TeX-master-or-region-file' relying on `file' being defined outside of
it and indicating the function to call.  Any better suggestions?

-- 
Ralf
Index: tex.el
===================================================================
RCS file: /cvsroot/auctex/auctex/tex.el,v
retrieving revision 5.613
diff -u -r5.613 tex.el
--- tex.el	14 Aug 2007 22:00:08 -0000	5.613
+++ tex.el	6 Oct 2007 17:26:29 -0000
@@ -525,8 +525,8 @@
 				 (funcall TeX-sync-output-page-function)
 			       "")))
     ;; `file' means to call `TeX-master-file' or `TeX-region-file'
-    ("%s" file nil t)
-    ("%t" file t t)
+    ("%s" TeX-master-or-region-file nil t)
+    ("%t" TeX-master-or-region-file t t)
     ("%`" (lambda nil
 	    (setq TeX-command-pos t TeX-command-text "")))
     (" \"\\" (lambda nil
@@ -565,8 +565,8 @@
 		  "")
 	      (setq TeX-command-text nil))))
     ("%n" TeX-current-line)
-    ("%d" file "dvi" t)
-    ("%f" file "ps" t)
+    ("%d" TeX-master-or-region-file "dvi" t)
+    ("%f" TeX-master-or-region-file "ps" t)
     ("%o" (lambda nil (funcall file (TeX-output-extension) t)))
     ;; for source specials the file name generated for the xdvi
     ;; command needs to be relative to the master file, just in
Index: tex-buf.el
===================================================================
RCS file: /cvsroot/auctex/auctex/tex-buf.el,v
retrieving revision 1.262
diff -u -r1.262 tex-buf.el
--- tex-buf.el	8 Aug 2007 17:45:52 -0000	1.262
+++ tex-buf.el	6 Oct 2007 17:26:31 -0000
@@ -284,6 +284,12 @@
     (TeX-process-set-variable file 'TeX-command-next TeX-command-Show)
     (funcall hook name command file)))
 
+(defun TeX-master-or-region-file (&rest args)
+  (shell-quote-argument
+   (concat (and (stringp TeX-command-pos) TeX-command-pos)
+	   (apply file args)
+	   (and (stringp TeX-command-pos) TeX-command-pos))))
+
 (defun TeX-command-expand (command file &optional list)
   "Expand COMMAND for FILE as described in LIST.
 LIST default to `TeX-expand-list'.  As a special exception,
@@ -292,11 +298,6 @@
   (let (pat
 	pos
 	entry TeX-command-text TeX-command-pos
-	(file `(lambda (&rest args)
-		 (shell-quote-argument
-		  (concat (and (stringp TeX-command-pos) TeX-command-pos)
-			  (apply ',file args)
-			  (and (stringp TeX-command-pos) TeX-command-pos)))))
 	case-fold-search string expansion arguments)
     (setq list (cons
 		(list "%%" (lambda nil
_______________________________________________
bug-auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to