3

I have Emacs 24.4 with AuCTeX 11.88, running on windows 8.1, on a strong computer.

Any time I run emacs, opening the first tex file takes 6 seconds, even if the tex file empty. This happens either when the tex file is the first file I open, or if emacs is already running (on a non-tex file). Opening a large non-tex file is very fast. This is why I suspect the culprit is AuCTeX. Opening the second tex file is also fast, even if I close the first tex file.

I ran the cpu profiler to see where most time is spent:

- command-execute                                                  44  70%
 - call-interactively                                              44  70%
  - find-file                                                      27  43%
   - find-file-noselect                                            27  43%
    - find-file-noselect-1                                         27  43%
     - after-find-file                                             27  43%
      - normal-mode                                                25  40%
       - funcall                                                   25  40%
         - set-auto-mode                                           25  40%
          - set-auto-mode-0                                        25  40%
           - tex-mode                                              24  38%
            - apply                                                21  33%
             - TeX-tex-mode                                        21  33%
              - latex-mode                                         15  24%
               - apply                                             15  24%
                - TeX-latex-mode                                   15  24%
                 + LaTeX-common-initialization                      6   9%
                 + byte-code                                        3   4%
                 + LaTeX-maybe-install-toolbar                      2   3%
                 + file-truename                                    1   1%
                 + custom-declare-variable                          1   1%
                 + defvar                                           1   1%
                 + TeX-run-mode-hooks                               1   1%
              + byte-code                                           5   8%
              + file-truename                                       1   1%
            + byte-code                                             3   4%
      + run-hooks                                                   2   3%
  - menu-find-file-existing                                        16  25%
   - find-file-read-args                                           16  25%
    - read-file-name                                               16  25%
       read-file-name-default                                      16  25%

1 Answers1

3

This issue is addressed in AUCTeX 11.88.5. (the micro version number .5 refers to ELPA version). Emacs has built-in capabilities to install packages from ELPA. You can find more detailed information about installation from ELPA in this answer. When you install AUCTeX from ELPA, it is crucial not to have the following line in your .emacs:

(load "auctex.el" nil t t)
Arash Esbati
  • 7,416