From 2c7fc0fcfc56e916fc387e60b541c9132c263261 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Sat, 19 Oct 2024 16:51:25 +0200 Subject: [PATCH] Fix a few more warnings --- lisp/dired.el | 86 ++++++++++++++++++++++++++------------------------- lisp/svg.el | 10 +++--- 2 files changed, 49 insertions(+), 47 deletions(-) diff --git a/lisp/dired.el b/lisp/dired.el index 30a1b68ec29..a8421a67995 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -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))) diff --git a/lisp/svg.el b/lisp/svg.el index f5c76145136..da63d2cfb0e 100644 --- a/lisp/svg.el +++ b/lisp/svg.el @@ -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) -- 2.39.2