aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2025-02-18 05:56:02 +0100
committerStefan Kangas2025-02-18 20:04:16 +0100
commit93206cd138ff01d9c2a56e52dd0e5edd8e386ec0 (patch)
treedd37866bc79a745a65138b72d475612a54761abe
parent20edecd21f777848d51b1b892c4ed6192a088fc7 (diff)
downloademacs-93206cd138ff01d9c2a56e52dd0e5edd8e386ec0.tar.gz
emacs-93206cd138ff01d9c2a56e52dd0e5edd8e386ec0.zip
Prefer plusp to open-coding it in image-dired
* lisp/image/image-dired.el (image-dired-display-thumbs) (image-dired-forward-image, image-dired-slideshow-start) (image-dired-line-up-interactive): Prefer plusp to open-coding it.
-rw-r--r--lisp/image/image-dired.el18
1 files changed, 9 insertions, 9 deletions
diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index 906e3521a61..8edc73d09b8 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -609,7 +609,7 @@ thumbnail buffer to be selected."
609 (image-dired-insert-thumbnail 609 (image-dired-insert-thumbnail
610 (image-dired--get-create-thumbnail-file file) file dired-buf) 610 (image-dired--get-create-thumbnail-file file) file dired-buf)
611 (cl-incf image-dired--number-of-thumbnails)))) 611 (cl-incf image-dired--number-of-thumbnails))))
612 (if (> image-dired--number-of-thumbnails 0) 612 (if (plusp image-dired--number-of-thumbnails)
613 (if do-not-pop 613 (if do-not-pop
614 (display-buffer buf) 614 (display-buffer buf)
615 (pop-to-buffer buf)) 615 (pop-to-buffer buf))
@@ -697,21 +697,21 @@ point is on the last image, move to the last one and vice versa."
697 (setq arg (or arg 1)) 697 (setq arg (or arg 1))
698 (let (pos) 698 (let (pos)
699 (dotimes (_ (abs arg)) 699 (dotimes (_ (abs arg))
700 (if (and (not (if (> arg 0) (eobp) (bobp))) 700 (if (and (not (if (plusp arg) (eobp) (bobp)))
701 (save-excursion 701 (save-excursion
702 (forward-char (if (> arg 0) 1 -1)) 702 (forward-char (if (plusp arg) 1 -1))
703 (while (and (not (if (> arg 0) (eobp) (bobp))) 703 (while (and (not (if (plusp arg) (eobp) (bobp)))
704 (not (image-dired-image-at-point-p))) 704 (not (image-dired-image-at-point-p)))
705 (forward-char (if (> arg 0) 1 -1))) 705 (forward-char (if (plusp arg) 1 -1)))
706 (setq pos (point)) 706 (setq pos (point))
707 (image-dired-image-at-point-p))) 707 (image-dired-image-at-point-p)))
708 (goto-char pos) 708 (goto-char pos)
709 (if wrap-around 709 (if wrap-around
710 (goto-char (if (> arg 0) 710 (goto-char (if (plusp arg)
711 (point-min) 711 (point-min)
712 ;; There are two spaces after the last image. 712 ;; There are two spaces after the last image.
713 (- (point-max) 2))) 713 (- (point-max) 2)))
714 (message "At %s image" (if (> arg 0) "last" "first")))))) 714 (message "At %s image" (if (plusp arg) "last" "first"))))))
715 (image-dired--update-header-line) 715 (image-dired--update-header-line)
716 (when image-dired-track-movement 716 (when image-dired-track-movement
717 (image-dired-track-original-file))) 717 (image-dired-track-original-file)))
@@ -1133,7 +1133,7 @@ With a negative prefix argument, prompt user for the delay."
1133 (let ((delay 1133 (let ((delay
1134 (cond ((not arg) 1134 (cond ((not arg)
1135 image-dired-slideshow-delay) 1135 image-dired-slideshow-delay)
1136 ((> arg 0) 1136 ((plusp arg)
1137 arg) 1137 arg)
1138 ((<= arg 0) 1138 ((<= arg 0)
1139 (string-to-number 1139 (string-to-number
@@ -1247,7 +1247,7 @@ Ask user how many thumbnails should be displayed per row."
1247 (interactive nil image-dired-thumbnail-mode) 1247 (interactive nil image-dired-thumbnail-mode)
1248 (let ((image-dired-thumbs-per-row 1248 (let ((image-dired-thumbs-per-row
1249 (string-to-number (read-string "How many thumbs per row: ")))) 1249 (string-to-number (read-string "How many thumbs per row: "))))
1250 (if (not (> image-dired-thumbs-per-row 0)) 1250 (if (not (plusp image-dired-thumbs-per-row))
1251 (message "Number must be greater than 0") 1251 (message "Number must be greater than 0")
1252 (image-dired-line-up)))) 1252 (image-dired-line-up))))
1253 1253