diff --git a/tex.el b/tex.el index 8b76f98d..74832ad7 100644 --- a/tex.el +++ b/tex.el @@ -3963,6 +3963,15 @@ Generated by `TeX-auto-add-type'.") :group 'TeX-parse :type 'boolean) +(defcustom TeX-auto-save-aggregate t + "Non-nil means saving in \"auto\" subdirectory of master file. + +Save in each \"auto\" subdirectory otherwise. + +Subdirectory name is actually taken from `TeX-auto-local'." + :group 'TeX-parse + :type 'boolean) + (defun TeX-auto-write () "Save all relevant TeX information from the current buffer." (if TeX-auto-untabify @@ -3973,7 +3982,9 @@ Generated by `TeX-auto-add-type'.") (file-name-as-directory TeX-auto-local) (TeX-strip-extension nil TeX-all-extensions t) ".el") - (TeX-master-directory))) + (if TeX-auto-save-aggregate + (TeX-master-directory) + default-directory))) (dir (file-name-directory file))) ;; Create auto directory if possible. (if (not (file-exists-p dir))