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
    Check the disccusion here. If that applies to you, install the latest version from ELPA and see if that helps. – Arash Esbati Jun 25 '15 at 20:05
  • All I could find is the file auctex-11.88.6.tar which I believe is not for windows (in here). How can I know if it applies to me? I added emacs profiler output. – MrX Jun 26 '15 at 8:12
  • How did you install AUCTeX? – giordano Jun 26 '15 at 8:57
  • Using the windows site of AuCTeX. They have version 11.88, but that fix is in version 11.88.5 forward, which seems to be available for Unix-based OS only. – MrX Jun 26 '15 at 10:24
  • 1
    Try and uninstall that package, and then install AUCTeX using the Emacs builtin package manager with M-x package-install RET auctex RET. Please, reply to messages here starting with @username, with username being the user you want to address, otherwise he/she won't be notified. – giordano Jun 26 '15 at 10:33
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)

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.