]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix a few more warnings
authorEshel Yaron <me@eshelyaron.com>
Sat, 19 Oct 2024 14:51:25 +0000 (16:51 +0200)
committerEshel Yaron <me@eshelyaron.com>
Sat, 19 Oct 2024 14:51:25 +0000 (16:51 +0200)
lisp/dired.el
lisp/svg.el

index 30a1b68ec2996de37c8e4b65de5431dbfb3c3417..a8421a679954b128592e16e6cc6b369010b36deb 100644 (file)
@@ -967,48 +967,50 @@ marked file, return (t FILENAME) instead of (FILENAME)."
   ;;This warning should not apply any longer, sk  2-Sep-1991 14:10.
   `(prog1
        (let ((inhibit-read-only t) case-fold-search found results)
-        (if (and ,arg (not (eq ,arg 'marked)))
-            (if (integerp ,arg)
-                (progn ;; no save-excursion, want to move point.
-                  (dired-repeat-over-lines
-                   ,arg
-                   (lambda ()
-                     ,@(when show-progress
-                          `((if ,show-progress (sit-for 0))))
-                     (setq results (cons ,body results))))
-                  (when (< ,arg 0)
-                    (setq results (nreverse results)))
-                  results)
-              ;; non-nil, non-integer, non-marked ARG means use current file:
-               (list ,body))
-          (let ((regexp (dired-marker-regexp)) next-position)
-            (save-excursion
-              (goto-char (point-min))
-              ;; remember position of next marked file before BODY
-              ;; can insert lines before the just found file,
-              ;; confusing us by finding the same marked file again
-              ;; and again and...
-              (setq next-position (and (re-search-forward regexp nil t)
-                                       (point-marker))
-                    found (not (null next-position)))
-              (while next-position
-                (goto-char next-position)
-                ,@(when show-progress
-                     `((if ,show-progress (sit-for 0))))
-                (setq results (cons ,body results))
-                ;; move after last match
-                (goto-char next-position)
-                (forward-line 1)
-                (set-marker next-position nil)
-                (setq next-position (and (re-search-forward regexp nil t)
-                                         (point-marker)))))
-            ,@(when distinguish-one-marked
-                 `((if (and ,distinguish-one-marked (= (length results) 1))
-                       (setq results (cons t results)))))
-            (if found
-                results
-               (unless (eq ,arg 'marked)
-                (list ,body))))))
+         ,(let ((else `(let ((regexp (dired-marker-regexp)) next-position)
+                        (save-excursion
+                          (goto-char (point-min))
+                          ;; remember position of next marked file before BODY
+                          ;; can insert lines before the just found file,
+                          ;; confusing us by finding the same marked file again
+                          ;; and again and...
+                          (setq next-position (and (re-search-forward regexp nil t)
+                                                   (point-marker))
+                                found (not (null next-position)))
+                          (while next-position
+                            (goto-char next-position)
+                            ,@(when show-progress
+                                 `((if ,show-progress (sit-for 0))))
+                            (setq results (cons ,body results))
+                            ;; move after last match
+                            (goto-char next-position)
+                            (forward-line 1)
+                            (set-marker next-position nil)
+                            (setq next-position (and (re-search-forward regexp nil t)
+                                                     (point-marker)))))
+                        ,@(when distinguish-one-marked
+                             `((if (and ,distinguish-one-marked (= (length results) 1))
+                                   (setq results (cons t results)))))
+                        (if found
+                            results
+                           (unless (eq ,arg 'marked)
+                            (list ,body))))))
+            (if (byte-compile-nilconstp arg) else
+              `(if (and ,arg (not (eq ,arg 'marked)))
+                  (if (integerp ,arg)
+                      (progn ;; no save-excursion, want to move point.
+                        (dired-repeat-over-lines
+                         ,arg
+                         (lambda ()
+                           ,@(when show-progress
+                                `((if ,show-progress (sit-for 0))))
+                           (setq results (cons ,body results))))
+                        (when (< ,arg 0)
+                          (setq results (nreverse results)))
+                        results)
+                    ;; non-nil, non-integer, non-marked ARG means use current file:
+                     (list ,body))
+                 ,else))))
      ;; save-excursion loses, again
      (dired-move-to-filename)))
 
index f5c76145136adf56e74c4ad36d682668b90d24d4..da63d2cfb0e314ab2cf703396a597086c4b4b257 100644 (file)
@@ -175,16 +175,16 @@ POINTS is a list of x/y pairs."
                            ", "))
       ,@(svg--arguments svg args)))))
 
-(defun svg-embed (svg image image-type datap &rest args)
+(defun svg-embed (svg image img-type datap &rest args)
   "Insert IMAGE into the SVG structure.
 IMAGE should be a file name if DATAP is nil, and a binary string
-otherwise.  IMAGE-TYPE should be a MIME image type, like
+otherwise.  IMG-TYPE should be a MIME image type, like
 \"image/jpeg\" or the like."
   (svg--append
    svg
    (dom-node
     'image
-    `((xlink:href . ,(svg--image-data image image-type datap))
+    `((xlink:href . ,(svg--image-data image img-type datap))
       ,@(svg--arguments svg args)))))
 
 (defun svg-embed-base-uri-image (svg relative-filename &rest args)
@@ -242,7 +242,7 @@ function is much faster than `svg-embed'."
       (dom-append-child svg node)))
   (svg-possibly-update-image svg))
 
-(defun svg--image-data (image image-type datap)
+(defun svg--image-data (image img-type datap)
   (with-temp-buffer
     (set-buffer-multibyte nil)
     (if datap
@@ -250,7 +250,7 @@ function is much faster than `svg-embed'."
       (insert-file-contents image))
     (base64-encode-region (point-min) (point-max) t)
     (goto-char (point-min))
-    (insert "data:" image-type ";base64,")
+    (insert "data:" img-type ";base64,")
     (buffer-string)))
 
 (defun svg--arguments (svg args)