[Top][All Lists]

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

[AUCTeX] Avoiding multiple calls to kpsewhich

From: jfbu
Subject: [AUCTeX] Avoiding multiple calls to kpsewhich
Date: Thu, 30 Apr 2015 12:22:53 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:31.0) Gecko/20100101 Thunderbird/31.6.0


although the situation is *much* improved with upcoming
TeXLive 2015, kpsewhich is quite slow for querying paths
on Mac OS X:

texlive 2014:

$ time kpsewhich article.cls

real    0m0.568s
user    0m0.544s
sys     0m0.015s

texlive 2015:

$ time kpsewhich article.cls

real    0m0.099s
user    0m0.085s
sys     0m0.008s

The situation is the same when one only attempts
to get the installation repertories locations,

$ time kpsewhich --var-value TEXMFHOME

real    0m0.516s
user    0m0.499s
sys     0m0.013s

(It appears that kpsewhich parses completely
various ls-R files even when used only as above
to query the TEXMFHOME repertory.)

During initial load, AUCTeX makes calls to kpsewhich.
(nine such calls with my set-up)

Would it be possible to get TeX-tree-expand
in tex.el to make a single kpsewhich call, and not one for
each passed 'var' of the list

(defun TeX-tree-expand (vars program &optional subdirs)
  "Return directories corresponding to the kpathsea variables VARS.
This is done calling `kpsewhich --expand-path' for each variable.

My question is whether it is possible to arrange TeX-tree-expand
to do rather a single kpsewhich call.

This should be possible as seen from that example:

kpsewhich --progname latex --expand-path 



(notice that SYSTEXMF by itself by default already expands to the
first three in the ouput as one finds

I am putting quotes as I am testing this from command line
and must avoid shell expansion of $

The kpsewhich manual is at :

5.5.3 Auxiliary tasks

‘--expand-path=string’ outputs the complete expansion of string, with
each element separated by the usual path separator on the current
system (‘;’ on Windows, ‘:’ otherwise).

I have no idea whether kpsewhich evolved on that point and
assuming the current functionality would break old systems.

Another issue is that during the loading of AUCTeX it appears that
twice. Could this also be avoided ?

A single kpsewhich call rather than 9 would almost divide by 9 the loading
time of AUCTeX on Mac OS X systems (because it appears that most of
this loading time is taken up by the calls to kpsewhich)


reply via email to

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