[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 7863f42 13/42: Prevent possible infinite loop
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 7863f42 13/42: Prevent possible infinite loop |
Date: |
Thu, 23 Nov 2017 06:06:10 -0500 (EST) |
branch: externals/auctex
commit 7863f42363d0ac53663cfb6759537ee221158060
Author: Ikumi Keita <address@hidden>
Commit: Ikumi Keita <address@hidden>
Prevent possible infinite loop
* tex.el (TeX-delete-duplicate-strings): Make sure that comparison is
done with valid list elements.
(TeX-delete-dups-by-car): Ditto.
Use `TeX-sort-strings' and `TeX-car-string-lessp'.
(TeX-car-string-lessp): Move the position of defun before the
defcustom of `TeX-engine'. Since the defcustom requires
`TeX-delete-dups-by-car' at load time, all the functions used in
`TeX-delete-dups-by-car' must be defined before the defcustom.
---
tex.el | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/tex.el b/tex.el
index 79b59b8..e4012b0 100644
--- a/tex.el
+++ b/tex.el
@@ -914,12 +914,11 @@ overlays."
"Return a list of all elements in ALIST, but each car only once.
Elements of KEEP-LIST are not removed even if duplicate."
;; Copy of `reftex-uniquify-by-car' (written by David Kastrup).
- (setq keep-list (sort (copy-sequence keep-list) #'string<))
+ (setq keep-list (TeX-sort-strings keep-list))
(setq alist (sort (copy-sequence alist)
- (lambda (a b)
- (string< (car a) (car b)))))
+ #'TeX-car-string-lessp))
(let ((new alist) elt)
- (while new
+ (while (cdr new)
(setq elt (caar new))
(while (and keep-list (string< (car keep-list) elt))
(setq keep-list (cdr keep-list)))
@@ -933,7 +932,7 @@ Elements of KEEP-LIST are not removed even if duplicate."
"Return a list of all strings in LIST, but each only once."
(setq list (TeX-sort-strings list))
(let ((new list) elt)
- (while new
+ (while (cdr new)
(setq elt (car new))
(while (string= elt (cadr new))
(setcdr new (cddr new)))
@@ -944,6 +943,11 @@ Elements of KEEP-LIST are not removed even if duplicate."
"Return sorted list of all strings in LIST."
(sort (copy-sequence list) #'string<))
+(defun TeX-car-string-lessp (s1 s2)
+ "Compare the cars of S1 and S2 in lexicographic order.
+Return t if first is less than second in lexicographic order."
+ (string-lessp (car s1) (car s2)))
+
;;; Buffer
(defgroup TeX-output nil
@@ -4737,11 +4741,6 @@ If optional argument STRIP is non-nil, remove file
extension."
;; Some of these functions has little to do with TeX, but nonetheless we
;; should use the "TeX-" prefix to avoid name clashes.
-(defun TeX-car-string-lessp (s1 s2)
- "Compare the cars of S1 and S2 in lexicographic order.
-Return t if first is less than second in lexicographic order."
- (string-lessp (car s1) (car s2)))
-
(defun TeX-listify (elt)
"Return a newly created list with element ELT.
If ELT already is a list, return ELT."
- [elpa] externals/auctex 433b5f9 15/42: Parse package/class option with comments correctly, (continued)
- [elpa] externals/auctex 433b5f9 15/42: Parse package/class option with comments correctly, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 01224b6 11/42: Add test for my commit on Aug 18, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex bfaa079 14/42: Conform to elisp coding convention, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 075eab7 07/42: Improvements for tex-info.el, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex aaf22a9 08/42: Add new style/arabxetex.el, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex cf0ff70 16/42: Add test for infinite loop, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 9e5e5f6 20/42: ; * tex.el (TeX-doc-backend-alist): Use `TeX-search-files-by-type'., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex b43ec94 04/42: * style/XCharter.el ("XCharter"): Update to package v1.094 from 2017/08/08., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex ff07544 05/42: Delay setting Japanese TeX engine in `japanese-latex-mode', Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 6dcf0e1 18/42: Add a new option for evince compatible viewer., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 7863f42 13/42: Prevent possible infinite loop,
Tassilo Horn <=
- [elpa] externals/auctex cfad977 17/42: Make correct extensions are returned, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 5a538cb 19/42: Prevent possible truncation of list value, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex a944077 12/42: Use `delete' correctly for list variable, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 20b6fd0 21/42: Add test abount truncation of list, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 474cc4f 23/42: ; * doc/tex-ref.tex (): Fix typo and copyright year., Tassilo Horn, 2017/11/23
- [elpa] externals/auctex fe06211 24/42: Fix doc strings and comments, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 9e1aa85 22/42: Make preview-latex parsing robust to fix Bug#20773, Bug#27088, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 5d8ac95 25/42: Cosmetic Change, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex 837d590 27/42: Remove use of .runandhide operator, Tassilo Horn, 2017/11/23
- [elpa] externals/auctex f362325 28/42: ; * latex.el (LaTeX-document-style-hook): Fix a typo., Tassilo Horn, 2017/11/23