My Emacs 24.3 come with BibTex mode, which is enabled automatically when editing .bib file. I got a strangely problem: whenever i make some modifications to a .bib file, i found a folder named "auto" is generated, and a .el file is saved there in the folder. for instance, when I edit a file called abc.bib, a abs.el file is generated in the folder "auto", which has content as follows:

(TeX-add-style-hook "abc"

 (lambda ()


what is that for? and how can i disable that?



My best guess is that it comes from tex.el. I do not think that behavior can be disabled and still maintain the functionality contemplated by AUCTeX. However, it looks like you could probably modify the path to go into a temporary folder instead -- e.g., /tmp/auto -- but you would need to make sure you look at all the functions within AUCTeX that use the variable TeX-auto-local and adjust those paths accordingly (if needed).

(defcustom TeX-auto-local "auto"
  "*Directory containing automatically generated TeX information.

This correspond to TeX macros found in the current directory, and must
be relative to that."
  :group 'TeX-file
  :type 'string)

Here is a quick word-search for that variable:

 1993    :type 'directory)
 1995: (defcustom TeX-auto-local "auto"
 1996    "*Directory containing automatically generated TeX information.
 2122  (defcustom TeX-auto-private
 2123:   (list (expand-file-name TeX-auto-local
 2124             (or (and (boundp 'user-emacs-directory)
 2125                  (concat user-emacs-directory "auctex/"))
 2155       (append (list TeX-auto-global TeX-style-global)
 2156           TeX-auto-private TeX-style-private
 2157:          (list TeX-auto-local TeX-style-local)))
 2158      path)
 2159    "List of directories to search for AUCTeX style files.
 2160  Per default the list is built from the values of the variables
 2161  `TeX-auto-global', `TeX-style-global', `TeX-auto-private',
 2162: `TeX-style-private', `TeX-auto-local', and `TeX-style-local'."
 2163    :group 'TeX-file
 2164    :type '(repeat (file :format "%v")))
 2198                 "./"))
 2199       (TeX-style-path (append (list (expand-file-name
 2200:                         TeX-auto-local dir)
 2201                         (expand-file-name
 2202:                         TeX-auto-local master-dir)
 2203                         (expand-file-name
 2204                          TeX-style-local dir)
 3167    (if TeX-auto-untabify
 3168        (untabify (point-min) (point-max)))
 3169:   (if (and TeX-auto-save TeX-auto-local)
 3170        (let* ((file (expand-file-name
 3171           (concat
 3172:           (file-name-as-directory TeX-auto-local)
 3173            (TeX-strip-extension nil TeX-all-extensions t)
 3174            ".el")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.