auctex-diffs
[Top][All Lists]
Advanced

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

main 2d9e319b 1/2: Pacify the compiler for `if-let'


From: Arash Esbati
Subject: main 2d9e319b 1/2: Pacify the compiler for `if-let'
Date: Mon, 28 Oct 2024 08:02:45 -0400 (EDT)

branch: main
commit 2d9e319b8e0d2dc844900308d4b0d2e3c1ffd6e0
Author: Arash Esbati <arash@gnu.org>
Commit: Arash Esbati <arash@gnu.org>

    Pacify the compiler for `if-let'
    
    * preview.el (preview-gs-place):
    * tex-fold.el (TeX-fold--last-name, TeX-fold-expand-spec):
    * tex.el (TeX-master-output-file): Use `if-let*' instead of
    `if-let' which is declared obsolete with Emacs 31.
---
 preview.el  | 20 ++++++++++----------
 tex-fold.el | 14 +++++++-------
 tex.el      |  2 +-
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/preview.el b/preview.el
index 814eda9d..7f1027dc 100644
--- a/preview.el
+++ b/preview.el
@@ -1246,16 +1246,16 @@ for the file extension."
   (overlay-put ov 'preview-image
                (let ((default (list (preview-icon-copy 
preview-nonready-icon))))
                  (if preview-leave-open-previews-visible
-                     (if-let ((img
-                               (car
-                                (delq
-                                 nil
-                                 (mapcar
-                                  (lambda (ovr)
-                                    (and
-                                     (eq (overlay-start ovr) (overlay-start 
ov))
-                                     (overlay-get ovr 'preview-image)))
-                                  (overlays-at (overlay-start ov)))))))
+                     (if-let* ((img
+                                (car
+                                 (delq
+                                  nil
+                                  (mapcar
+                                   (lambda (ovr)
+                                     (and
+                                      (eq (overlay-start ovr) (overlay-start 
ov))
+                                      (overlay-get ovr 'preview-image)))
+                                   (overlays-at (overlay-start ov)))))))
                          img
                        default)
                    default)))
diff --git a/tex-fold.el b/tex-fold.el
index a79aca8d..0f317feb 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -807,7 +807,7 @@ environment name, ARGS are ignored.  Returns a string of 
the form
   "Return string consisting of last name of NAME.
 NAME should be of the form \"Last, First\" or \"First Last\", possibly
 with some additional non-alphabetical characters such as braces."
-  (if-let ((comma (string-match "," name)))
+  (if-let* ((comma (string-match "," name)))
       (setq name (substring name 0 comma))
     (when-let ((space (string-match " " name)))
       (setq name (substring name space))))
@@ -1178,12 +1178,12 @@ Replace them with the respective macro argument."
         ((expand (spec &optional index)
            ;; If there is something to replace and the closing delimiter
            ;; matches the opening one…
-           (if-let (((string-match "\\([[{<(]\\)\\([1-9]\\)\\([]}>)]\\)"
-                                   spec index))
-                    (open (string-to-char (match-string 1 spec)))
-                    (num (string-to-number (match-string 2 spec)))
-                    (close (string-to-char (match-string 3 spec)))
-                    ((equal close (cdr (assoc open delims)))))
+           (if-let* (((string-match "\\([[{<(]\\)\\([1-9]\\)\\([]}>)]\\)"
+                                    spec index))
+                     (open (string-to-char (match-string 1 spec)))
+                     (num (string-to-number (match-string 2 spec)))
+                     (close (string-to-char (match-string 3 spec)))
+                     ((equal close (cdr (assoc open delims)))))
                ;; … then replace it and move on.  Otherwise, it must have been
                ;; a spurious spec, so abort.
                (when-let ((arg (car (save-match-data
diff --git a/tex.el b/tex.el
index f95930a8..94d72afa 100644
--- a/tex.el
+++ b/tex.el
@@ -2605,7 +2605,7 @@ If `TeX-output-dir' is nil, then defer to 
`TeX-master-file'.  Otherwise,
 return the file of the same name, but in the build directory specified by
 `TeX-output-dir'."
   (let ((master (TeX-master-file extension)))
-    (if-let ((output-dir (TeX--master-output-dir (TeX-master-directory) t)))
+    (if-let* ((output-dir (TeX--master-output-dir (TeX-master-directory) t)))
         (concat output-dir (file-name-nondirectory master))
       master)))
 



reply via email to

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