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

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

[elpa] externals/auctex ba79584 32/43: Replace cl with cl-lib in other f


From: Tassilo Horn
Subject: [elpa] externals/auctex ba79584 32/43: Replace cl with cl-lib in other files
Date: Tue, 20 Mar 2018 11:34:12 -0400 (EDT)

branch: externals/auctex
commit ba79584eae4fccd9fd9af4752d2d7870eac881ea
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>

    Replace cl with cl-lib in other files
    
    * latex.el (LaTeX-hanging-ampersand-position):
    * tex-fold.el (require):
    (TeX-fold-region-macro-or-env):
    (TeX-fold-update-at-point):
    * tex-info.el (require):
    (Texinfo-make-node-list):
    * toolbar-x.el (require):
    (toolbarx-good-option-list-p): Replace cl with cl-lib and corresponding 
macros.
---
 latex.el     | 30 +++++++++++++++---------------
 tex-fold.el  |  9 +++++----
 tex-info.el  | 23 ++++++++++++-----------
 toolbar-x.el |  5 +++--
 4 files changed, 35 insertions(+), 32 deletions(-)

diff --git a/latex.el b/latex.el
index 411db0e..7354c23 100644
--- a/latex.el
+++ b/latex.el
@@ -6524,21 +6524,21 @@ function would return non-nil and `(match-string 1)' 
would return
 
 (defun LaTeX-hanging-ampersand-position ()
   "Return indent column for a hanging ampersand (i.e. ^\\s-*&)."
-  (destructuring-bind
-   (beg-pos . beg-col)
-   (LaTeX-env-beginning-pos-col)
-   (let* ((cur-pos (point)))
-     (save-excursion
-       (if (re-search-backward "\\\\\\\\" beg-pos t)
-          (let ((cur-idx (how-many "[^\\]&" (point) cur-pos)))
-            (goto-char beg-pos)
-            (re-search-forward "[^\\]&" cur-pos t (+ 1 cur-idx))
-            ;; If the above searchs fails, i.e. no "&" found,
-            ;; (- (current-column) 1) returns -1, which is wrong.  So
-            ;; we use a fallback (+ 2 beg-col) whenever this happens:
-            (max (- (current-column) 1)
-                 (+ 2 beg-col)))
-        (+ 2 beg-col))))))
+  (cl-destructuring-bind
+      (beg-pos . beg-col)
+      (LaTeX-env-beginning-pos-col)
+    (let* ((cur-pos (point)))
+      (save-excursion
+       (if (re-search-backward "\\\\\\\\" beg-pos t)
+           (let ((cur-idx (how-many "[^\\]&" (point) cur-pos)))
+             (goto-char beg-pos)
+             (re-search-forward "[^\\]&" cur-pos t (+ 1 cur-idx))
+             ;; If the above searchs fails, i.e. no "&" found,
+             ;; (- (current-column) 1) returns -1, which is wrong.  So
+             ;; we use a fallback (+ 2 beg-col) whenever this happens:
+             (max (- (current-column) 1)
+                  (+ 2 beg-col)))
+         (+ 2 beg-col))))))
 
 (defun LaTeX-indent-tabular ()
   "Return indent column for the current tabular-like line."
diff --git a/tex-fold.el b/tex-fold.el
index 72e1a58..16dacae 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -44,7 +44,8 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 (require 'tex)
 (autoload 'LaTeX-forward-paragraph "latex")
@@ -334,8 +335,8 @@ for macros and 'math for math macros."
                          ((eq type 'math) TeX-fold-math-spec-list-internal)
                          (t TeX-fold-macro-spec-list-internal)))
        (dolist (i (cadr item))
-          (pushnew (list i (car item)) fold-list :test #'equal)
-         (pushnew i item-list :test #'equal)))
+          (cl-pushnew (list i (car item)) fold-list :test #'equal)
+         (cl-pushnew i item-list :test #'equal)))
       (when item-list
        (setq regexp (cond ((and (eq type 'env)
                                 (eq major-mode 'context-mode))
@@ -701,7 +702,7 @@ breaks will be replaced by spaces."
     (dolist (ov (overlays-at (point)))
       (when (and (eq (overlay-get ov 'category) 'TeX-fold)
                 (numberp (overlay-get ov 'TeX-fold-display-string-spec)))
-       (pushnew ov overlays)))
+       (cl-pushnew ov overlays)))
     (when overlays
       ;; Sort list according to descending starts.
       (setq overlays (sort (copy-sequence overlays)
diff --git a/tex-info.el b/tex-info.el
index 1716627..f990f0f 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -25,7 +25,8 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 (require 'tex)
 
@@ -327,16 +328,16 @@ commands. Return the resulting string."
     (let (nodes dups)
       (while (re-search-forward "address@hidden" nil t)
        (skip-chars-forward "[:blank:]")
-       (pushnew (list (Texinfo-nodename-de-escape
-                       (buffer-substring-no-properties
-                        (point) (progn (skip-chars-forward "^\r\n,")
-                                       (skip-chars-backward "[:blank:]")
-                                       (point)))))
-                nodes
-                :test (lambda (a b)
-                        (when (equal a b)
-                          (push (cons a (line-number-at-pos (point))) dups)
-                          t))))
+       (cl-pushnew (list (Texinfo-nodename-de-escape
+                          (buffer-substring-no-properties
+                           (point) (progn (skip-chars-forward "^\r\n,")
+                                          (skip-chars-backward "[:blank:]")
+                                          (point)))))
+                   nodes
+                   :test (lambda (a b)
+                           (when (equal a b)
+                             (push (cons a (line-number-at-pos (point))) dups)
+                             t))))
       (when dups
        (display-warning
         'AUCTeX
diff --git a/toolbar-x.el b/toolbar-x.el
index f61000d..79dacdc 100644
--- a/toolbar-x.el
+++ b/toolbar-x.el
@@ -106,7 +106,8 @@
 
 ;;; Code:
 
-(eval-when-compile (require 'cl))
+(eval-when-compile
+  (require 'cl-lib))
 
 ;; Note that this just gives a useful default.  Icons are expected to
 ;; be in subdirectory "images" or "toolbar" relative to the load-path.
@@ -179,7 +180,7 @@ different.  OPTION-LIST equal to nil is a good option list."
     (dotimes (i n)
       (when (> i 0)
        (setq temp-opt-list (cddr temp-opt-list)))
-      (pushnew (car temp-opt-list) list-diff :test #'equal)
+      (cl-pushnew (car temp-opt-list) list-diff :test #'equal)
       (setq elt-in-valid (and elt-in-valid
                              (memq (car temp-opt-list)
                                    valid-options))))



reply via email to

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