emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/auctex 59c40b0 30/62: Ensure the trailing slash for dir


From: Tassilo Horn
Subject: [elpa] externals/auctex 59c40b0 30/62: Ensure the trailing slash for directory
Date: Sun, 20 Dec 2020 10:39:58 -0500 (EST)

branch: externals/auctex
commit 59c40b0140651ba8764b78bcafcdd523741cfcc4
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Ensure the trailing slash for directory
    
    * tex.el (TeX-parse-path, TeX-strip-extension): Apply
    `file-name-as-directory' for `TeX-macro-global' and
    `TeX-macro-private' in case their entries lack the trailing slash.
    * tex-site.el.in (TeX-auto-global): Delete obsolete sentence.
---
 tex-site.el.in |  1 -
 tex.el         | 14 +++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/tex-site.el.in b/tex-site.el.in
index fd28869..12287d5 100644
--- a/tex-site.el.in
+++ b/tex-site.el.in
@@ -75,7 +75,6 @@ TeX-auto-* (automatically generated lisp).")
 (defcustom TeX-auto-global
     @lispautodir@
   "*Directory containing automatically generated information.
-Must end with a directory separator.
 
 For storing automatic extracted information about the TeX macros
 shared by all users of a site."
diff --git a/tex.el b/tex.el
index 43cc8d1..d722587 100644
--- a/tex.el
+++ b/tex.el
@@ -2612,6 +2612,9 @@ If REGEXP is nil, or \"\", an error will occur."
                       (TeX-split-string
                        (if (string-match ";" value) ";" ":")
                        value)))
+        (global (append '("/" "\\")
+                        (mapcar #'file-name-as-directory
+                                TeX-macro-global)))
         entry
         answers)
     (while entries
@@ -2622,7 +2625,7 @@ If REGEXP is nil, or \"\", an error will occur."
                       (substring entry 0 (match-beginning 0))
                     entry)))
       (or (not (file-name-absolute-p entry))
-         (member entry (append '("/" "\\") TeX-macro-global))
+         (member entry global)
          (setq answers (cons entry answers))))
     answers))
 
@@ -4483,8 +4486,9 @@ If EXTENSIONS is not specified or nil, the value of
 (defun TeX-strip-extension (&optional string extensions nodir nostrip)
   "Return STRING without any trailing extension in EXTENSIONS.
 If NODIR is t, also remove directory part of STRING.
-If NODIR is `path', remove directory part of STRING if it is equal to
-the current directory, `TeX-macro-private' or `TeX-macro-global'.
+If NODIR is `path', remove directory part of STRING if it is
+equal to the current directory or is a member of
+`TeX-macro-private' or `TeX-macro-global'.
 If NOSTRIP is set, do not remove extension after all.
 STRING defaults to the name of the current buffer.
 EXTENSIONS defaults to `TeX-file-extensions'."
@@ -4502,8 +4506,8 @@ EXTENSIONS defaults to `TeX-file-extensions'."
         (dir (expand-file-name (or (file-name-directory strip) "./"))))
     (if (or (eq nodir t)
            (string-equal dir (expand-file-name "./"))
-           (member dir TeX-macro-global)
-           (member dir TeX-macro-private))
+           (member dir (mapcar #'file-name-as-directory TeX-macro-global))
+           (member dir (mapcar #'file-name-as-directory TeX-macro-private)))
        (file-name-nondirectory strip)
       strip)))
 



reply via email to

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