[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 26f8ce1 09/11: Speed up kpsewhich calls by expan
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 26f8ce1 09/11: Speed up kpsewhich calls by expanding all vars in one call |
Date: |
Fri, 01 May 2015 08:58:59 +0000 |
branch: externals/auctex
commit 26f8ce19ea92ef00a8da872a1ad469ba4bec12b9
Author: Tassilo Horn <address@hidden>
Commit: Tassilo Horn <address@hidden>
Speed up kpsewhich calls by expanding all vars in one call
* tex.el (TeX-tree-expand): Expand all given vars in just one single
call of kpsewhich. Users reported that on some windows and mac systems,
kpsewhich is extremely slow leading to auctex startup times of several
seconds.
---
ChangeLog | 7 +++++++
tex.el | 43 ++++++++++++++++++++++---------------------
2 files changed, 29 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 3f387e4..dd3dcc2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-05-01 Tassilo Horn <address@hidden>
+
+ * tex.el (TeX-tree-expand): Expand all given vars in just one
+ single call of kpsewhich. Users reported that on some windows and
+ mac systems, kpsewhich is extremely slow leading to auctex startup
+ times of several seconds.
+
2015-04-29 Tassilo Horn <address@hidden>
* tex.el (TeX-string-divide-number-unit): Fix docstring.
diff --git a/tex.el b/tex.el
index b7ffc1f..fb0c9e6 100644
--- a/tex.el
+++ b/tex.el
@@ -640,7 +640,7 @@ overlays between two existing ones.")
(when (featurep 'xemacs)
(defun TeX-read-string
- (prompt &optional initial-input history default-value)
+ (prompt &optional initial-input history default-value)
(condition-case nil
(read-string prompt initial-input history default-value t)
(wrong-number-of-arguments
@@ -2356,35 +2356,36 @@ trees. Only existing directories are returned."
;; FIXME: The GNU convention only uses "path" to mean "list of directories"
;; and uses "filename" for the name of a file even if it contains possibly
;; several elements separated by "/".
- (let (path-list path exit-status input-dir-list)
- (condition-case nil
- (dolist (var vars)
- (setq path (with-output-to-string
- (setq exit-status (call-process
- "kpsewhich" nil
- (list standard-output nil) nil
- "--progname" program
- "--expand-path" var))))
- (when (zerop exit-status)
- (pushnew path path-list :test #'equal)))
- (error nil))
- (dolist (elt (nreverse path-list))
- (let ((separators (if (string-match "^[A-Za-z]:" elt)
+ (let* ((exit-status 1)
+ (path-list (ignore-errors
+ (with-output-to-string
+ (setq exit-status
+ (call-process
+ "kpsewhich" nil
+ (list standard-output nil) nil
+ "--progname" program
+ "--expand-path"
+ (mapconcat #'identity vars
+ (if (eq system-type 'windows-nt)
+ ";" ":"))))))))
+ (when (zerop exit-status)
+ (let ((separators (if (string-match "^[A-Za-z]:" path-list)
"[\n\r;]"
- "[\n\r:]")))
+ "[\n\r:]"))
+ path input-dir-list)
(dolist (item (condition-case nil
- (split-string elt separators t)
+ (split-string path-list separators t)
;; COMPATIBILITY for XEmacs <= 21.4.15
- (error (delete "" (split-string elt separators)))))
+ (error (delete "" (split-string path-list
separators)))))
(if subdirs
(dolist (subdir subdirs)
(setq path (file-name-as-directory (concat item subdir)))
(when (file-exists-p path)
- (pushnew path input-dir-list :test #'equal)))
+ (pushnew path input-dir-list :test #'equal)))
(setq path (file-name-as-directory item))
(when (file-exists-p path)
- (pushnew path input-dir-list :test #'equal))))))
- (nreverse input-dir-list)))
+ (pushnew path input-dir-list :test #'equal))))
+ (nreverse input-dir-list)))))
(defun TeX-macro-global ()
"Return directories containing the site's TeX macro and style files."
- [elpa] externals/auctex updated (05e30be -> 2c9e820), Tassilo Horn, 2015/05/01
- [elpa] externals/auctex 7f0360d 02/11: New style attachfile.el., Tassilo Horn, 2015/05/01
- [elpa] externals/auctex 07c2d23 03/11: Fix bug#20301, Tassilo Horn, 2015/05/01
- [elpa] externals/auctex f4c405b 04/11: Delete vars preview-lispdir and preview-datadir, Tassilo Horn, 2015/05/01
- [elpa] externals/auctex e64c692 06/11: Complete last commit, Tassilo Horn, 2015/05/01
- [elpa] externals/auctex e80221c 05/11: Regexp-quote TeX-region-file in TeX-clean, Tassilo Horn, 2015/05/01
- [elpa] externals/auctex 7c120b0 07/11: Improve TeX-parse-macro docstring, Tassilo Horn, 2015/05/01
- [elpa] externals/auctex 563f0e6 08/11: Fix docstring and spelling errors, Tassilo Horn, 2015/05/01
- [elpa] externals/auctex d35db3e 01/11: Improve/update styles., Tassilo Horn, 2015/05/01
- [elpa] externals/auctex 26f8ce1 09/11: Speed up kpsewhich calls by expanding all vars in one call,
Tassilo Horn <=
- [elpa] externals/auctex 2c9e820 11/11: Release GNU AUCTeX 11.88.5, Tassilo Horn, 2015/05/01
- [elpa] externals/auctex afc1ef0 10/11: Merge branch 'master' into elpa, Tassilo Horn, 2015/05/01