Hi all,

the command "TeX-clean" fails, for instance, in plain TeX mode: You
get an error message like "append: Symbol's value as variable is void:
plain-TeX-clean-intermediate-suffixes" (and you have the same problem
with "plain-TeX-clean-output-suffixes"). The code of "TeX-clean" shows
that this function only works for LaTeX, docTeX and ConTeXt modes. One
way to fix that to use the value of
"TeX-clean-default-intermediate-suffixes"
("TeX-clean-default-output-suffixes") if there is not
"<mode>-clean-intermediate-suffixes" ("<mode>-clean-output-suffixes")
for the respective (La)TeX mode <mode>.

I have added a patch (for AUCTeX's current CVS version) to implement
this behavior.

Dirk
diff -u orig/tex.el new/tex.el
--- orig/tex.el	2008-12-08 22:53:52.000000000 +0100
+++ new/tex.el	2008-12-08 22:54:01.000000000 +0100
@@ -1382,19 +1382,28 @@
 
 (autoload 'dired-mark-pop-up "dired")
 
+(defun TeX-symbol-value-safe (symbol default)
+  "Return the symbol value of SYMBOL, if this value is defined,
+and DEFAULT otherwise."
+  (condition-case nil
+      (symbol-value symbol)
+    (void-variable default)))
+
 (defun TeX-clean (&optional arg)
   "Delete generated files associated with current master and region files.
 If prefix ARG is non-nil, not only remove intermediate but also
 output files."
   (interactive "P")
   (let* ((mode-prefix (TeX-mode-prefix))
-	 (suffixes (append (symbol-value
+	 (suffixes (append (TeX-symbol-value-safe
 			    (intern (concat mode-prefix
-					    "-clean-intermediate-suffixes")))
+					    "-clean-intermediate-suffixes"))
+			    TeX-clean-default-intermediate-suffixes)
 			   (when arg
-			     (symbol-value
+			     (TeX-symbol-value-safe
 			      (intern (concat mode-prefix
-					      "-clean-output-suffixes"))))))
+					      "-clean-output-suffixes"))
+			      TeX-clean-default-output-suffixes))))
 	 (master (TeX-active-master))
 	 (master-dir (file-name-directory master))
 	 (regexp (concat "\\("
_______________________________________________
auctex mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/auctex

Reply via email to