auctex-devel
[Top][All Lists]
Advanced

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

[AUCTeX-devel] Possible truncation of the value of list variable


From: Ikumi Keita
Subject: [AUCTeX-devel] Possible truncation of the value of list variable
Date: Sun, 17 Sep 2017 16:06:59 +0900

Greetings,

As I mentioned in another thread, I found possible truncation of the
value of list variable due to the combination of `delete-dups' and
`append' in `TeX-search-files-by-type' of tex.el.

[How to confirm]
(1) After activating AUCTeX, evaluate the following forms in order.

(setq var '("str1" "str2"))
(let ((TeX-kpathsea-path-delimiter nil)
      (TeX-search-files-type-alist
       '((abc "${dummy}" ("str2" var) TeX-file-extensions))))
  (TeX-search-files-by-type 'abc 'global))

(2) Examine the value of `var'.  It is truncated to ("str1"), where
"str2" was thrown away as duplication with another "str2".

This indicates that if a variable symbol is the last element of the 3rd
element of a entry in `TeX-search-files-type-alist', its value can be
truncated as side effect when non-kpathsea fallback part in
`TeX-search-files-by-type' runs.

I will install the attached fix, which replaces `delete-dups' with
`TeX-delete-duplicate-strings'.  Unlike `delete-dups',
`TeX-delete-duplicate-strings' does not preserve the order of its
argument, but I think that it wouldn't matter considering the way in
which `TeX-search-files-by-type' is used.

And I'm afraid that the combination of `delete-dups' and `append' might
cause similar truncation of list variable in other places, i.e.,
caption.el, enumitem.el, floatrow.el, mdframed.el and
menukeys.el.  Arash, could you please check these files as the author of
them?

Best regards,
Ikumi Keita

Attachment: prevent-truncation-of-list
Description: patch


reply via email to

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