auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX] 11.87; C-c C-c suffers delay when many styles are active on win


From: Ikumi Keita
Subject: [AUCTeX] 11.87; C-c C-c suffers delay when many styles are active on windows.
Date: Fri, 14 Dec 2012 16:42:33 +0900

Hi, AUCTeX developers.  Thanks a lot for releasing AUCTeX 11.87.

Unfortunately, I have a trouble after upgrading to AUCTeX 11.87.  Under
certain conditions(described below), the lapse between typing C-c C-c
and the appearance of the prompt "Command:" is now about 1 or 2 seconds.
Such delay is pretty unconfortable to me.  I hope the previous quick
response to come back again.

The environment I experienced the delay is:
* OS: windows 7 64bit professional.  (On my FreeBSD box, such problem
  doesn't occur.  I don't know whether other kinds of windows platforms
  share the problem or not.)
* Emacs version: 24.2. (NTEmacs)
* AUCTeX version: 11.87.  With 11.86, such problem doesn't occur.
* The number of the active style files is not small.  Sample file is
  attached below.  Turn on the option TeX-parse-self to t and open the
  file with AUCTeX.  With this example, (length (TeX-style-list))
  returns 45.  More simple example with few active style files does not
  exhibit the behaviour in question.

(Apparently the attached file contains spuriously many \usepackage's.
This is only an example to illustrate the situation, so please don't
consider that the situation with over 40 active style files is
unrealistic.  Note that, when package A loads another package B
internally and B loads yet another package C internally and so on, the
number of the active style files can grow significantly sometimes.  In
fact the files I actually use fit such cases.)

With these conditions met, the delay between C-c C-c and the prompt
"Command:" can't be neglected, at least to me.  When the file is on the
network drive, the delay is about 2 seconds.  When the file is on the
local drive, the delay is about 1 second.

I had a look at tex-buf.el, and with some experiments found that the
delay comes from TeX-check-files.  Evaluating manually the form

(TeX-check-files "sample.dvi"
                 (cons "sample" (TeX-style-list))
                 TeX-file-extensions)

caused the delay with about the same length of duration.  And when I
type C-M-x over the defun of TeX-check-files of AUCTeX 11.86, the delay
disappears.

Here is the relavant code quoted from tex-buf.el of AUCTeX 11.87:
------------------------------------------------------------------
(defun TeX-check-files (derived originals extensions)
[...]
    (dolist (path (mapcar (lambda (dir)
                            (expand-file-name (file-name-as-directory dir)))
                          TeX-check-path))
      (dolist (orig originals)
        (dolist (ext extensions)
          (let ((filepath (concat path orig "." ext)))
            (if (file-exists-p filepath)
                (setq existingoriginals (cons filepath existingoriginals)))))))
[...]
-------------------------------------------------------------------
The function TeX-check-files is called in TeX-save-document as

  (TeX-check-files (concat name "." (TeX-output-extension))
                   (cons name (TeX-style-list))
                   TeX-file-extensions)

where `name' refers to the master file name when C-c C-c is typed.  On
my environment the variables TeX-check-path and TeX-file-extensions are
lists of 4 and 7 elements respectively, so the above nested dolist loop
repeats 4*(45+1)*7=1288 times.  I'm afraid that repeating file-exists-p
over thousand times is the source of slowness I'm talking about.  I
suspect that file-exists-p on windows platform is not fast enough as on
unix, especially with network drive, so the delay occurs.

Currently, I personally reverted the definition of TeX-check-files to
the version of AUCTeX 11.86 and can live peacefully, but I hope that the
number of loops is somehow reduced and official AUCTeX again runs
smoothly without any modification.

Regards,
Ikumi Keita

%%%% SAMPLE FILE sample.tex %%%%% START %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\documentclass[a4paper,10pt]{article}
\usepackage[centertags,fleqn,intlimits,namelimits,sumlimits]{amsmath}
\usepackage{calc}
\usepackage{trig}
\usepackage{keyval}
\usepackage{ifthen}
\usepackage{enumerate}
\usepackage{delarray}
\usepackage{graphicx}
\usepackage{color}
\usepackage{afterpage}
\usepackage{bm}
\usepackage{hhline}
\usepackage{indentfirst}
\usepackage[dvipdfmx,CJKbookmarks,bookmarks]{hyperref}
\usepackage{longtable}
\usepackage[infoshow]{tabularx}
\usepackage[markshow]{multicol}
\usepackage{showkeys}
\usepackage{theorem}
\usepackage{verbatim}
\usepackage{xspace}
\usepackage{fancybox}
\usepackage{fancyhdr}

\begin{document}
abc
\end{document}
%%%% SAMPLE FILE %%%%% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

------------------------------------------------------------------------

Emacs  : GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601)
 of 2012-12-01 on GNUPACK
Package: 11.87

current state:
==============
(setq
 AUCTeX-date "2012-11-30"
 window-system 'w32
 LaTeX-version "2e"
 TeX-style-path '("c:/NTmacs/var/auctex" "c:/NTEmacs/site-lisp/auctex/style"
                  "w:/kousi/ikumi/.emacs.d/auctex/auto"
                  "w:/kousi/ikumi/.emacs.d/auctex/style" "auto" "style")
 TeX-auto-save nil
 TeX-parse-self t
 TeX-master t
 TeX-command-list '(("PDF" "dvipdfmx %d" TeX-run-command t (latex-mode) :help
                     "Generate PDF file")
                    ("jTeX" "%(PDF)jtex %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX 
nil
                     (plain-tex-mode) :help "Run NTT jTeX")
                    ("jLaTeX" "%(PDF)jlatex %`%S%(PDFout)%(mode)%' %t" 
TeX-run-TeX nil
                     (latex-mode) :help "Run NTT jLaTeX")
                    ("pTeX" "%(PDF)ptex %(kanjiopt)%`%S%(PDFout)%(mode)%' %t"
                     TeX-run-TeX nil (plain-tex-mode) :help "Run ASCII pTeX")
                    ("pLaTeX" "%(PDF)platex %(kanjiopt)%`%S%(PDFout)%(mode)%' 
%t"
                     TeX-run-TeX nil (latex-mode) :help "Run ASCII pLaTeX")
                    ("Mendex" "mendex %(mendexkopt)%s" TeX-run-command nil t 
:help
                     "Create index file with mendex")
                    ("jBibTeX" "jbibtex %s" TeX-run-BibTeX nil t :help "Run 
jBibTeX")
                    ("pBibTeX" "pbibtex %(kanjiopt)%s" TeX-run-BibTeX nil t 
:help
                     "Run pBibTeX")
                    ("-" "" ignore nil t)
                    ("TeX" "%(PDF)%(tex) %`%S%(PDFout)%(mode)%' %t" TeX-run-TeX 
nil
                     (plain-tex-mode ams-tex-mode texinfo-mode) :help "Run 
plain TeX")
                    ("LaTeX" "%`%l%(mode)%' %t" TeX-run-TeX nil (latex-mode 
doctex-mode)
                     :help "Run LaTeX")
                    ("Makeinfo" "makeinfo %t" TeX-run-compile nil 
(texinfo-mode) :help
                     "Run Makeinfo with Info output")
                    ("Makeinfo HTML" "makeinfo --html %t" TeX-run-compile nil
                     (texinfo-mode) :help "Run Makeinfo with HTML output")
                    ("AmSTeX" "%(PDF)amstex %`%S%(PDFout)%(mode)%' %t" 
TeX-run-TeX nil
                     (ams-tex-mode) :help "Run AMSTeX")
                    ("ConTeXt" "texexec --once --texutil %(execopts)%t" 
TeX-run-TeX nil
                     (context-mode) :help "Run ConTeXt once")
                    ("ConTeXt Full" "texexec %(execopts)%t" TeX-run-TeX nil
                     (context-mode) :help "Run ConTeXt until completion")
                    ("BibTeX" "%(bibtex) %s" TeX-run-BibTeX nil t :help "Run 
BibTeX")
                    ("Biber" "biber %s" TeX-run-Biber nil t :help "Run Biber")
                    ("View" "%V" TeX-run-discard-or-function t t :help "Run 
Viewer")
                    ("Print" "%p" TeX-run-command t t :help "Print the file")
                    ("Queue" "%q" TeX-run-background nil t :help
                     "View the printer queue" :visible TeX-queue-command)
                    ("File" "%(o?)dvips %d -o %f " TeX-run-command t t :help
                     "Generate PostScript file")
                    ("Index" "%(makeindex) %s" TeX-run-command nil t :help
                     "Create index file")
                    ("Check" "lacheck %s" TeX-run-compile nil (latex-mode) :help
                     "Check LaTeX file for correctness")
                    ("Spell" "(TeX-ispell-document \"\")" TeX-run-function nil 
t :help
                     "Spell-check the document")
                    ("Clean" "TeX-clean" TeX-run-function nil t :help
                     "Delete generated intermediate files")
                    ("Clean All" "(TeX-clean t)" TeX-run-function nil t :help
                     "Delete generated intermediate and output files")
                    ("Other" "" TeX-run-command t t :help "Run an arbitrary 
command"))
 )



reply via email to

[Prev in Thread] Current Thread [Next in Thread]