summaryrefslogtreecommitdiff
path: root/lisp/image-dired.el
diff options
context:
space:
mode:
authorStefan Kangas <stefan@marxist.se>2021-12-07 12:59:18 +0100
committerStefan Kangas <stefan@marxist.se>2021-12-07 13:00:24 +0100
commit00e6aeacf2540b0dc621208577c1c725e3a533b2 (patch)
tree72dac3f254f3062b0ebcaa3b80a6b22b11a4b604 /lisp/image-dired.el
parent8aa2aac5002873cfc44899dc570e843742ea7855 (diff)
downloademacs-00e6aeacf2540b0dc621208577c1c725e3a533b2.tar.gz
image-dired: Fix behavior of slideshow command
* lisp/image-dired.el (image-dired-slideshow-start): Fix behavior to match documentation. Minor simplification of docstring.
Diffstat (limited to 'lisp/image-dired.el')
-rw-r--r--lisp/image-dired.el19
1 files changed, 10 insertions, 9 deletions
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index fe0c3b7c226..33f28a3440f 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -1777,21 +1777,22 @@ This is used by `image-dired-slideshow-start'."
(image-dired-slideshow-stop)))
(defun image-dired-slideshow-start (&optional arg)
- "Start a slideshow.
-Wait `image-dired-slideshow-delay' seconds before showing the
-next image.
+ "Start a slideshow, waiting `image-dired-slideshow-delay' between images.
With prefix argument ARG, wait that many seconds before going to
the next image.
With a negative prefix argument, prompt user for the delay."
(interactive "P" image-dired-thumbnail-mode image-dired-display-image-mode)
- (let ((delay (if (> arg 0)
- arg
- (string-to-number
- (read-string
- (let ((delay (number-to-string image-dired-slideshow-delay)))
- (format-prompt "Delay, in seconds. Decimals are accepted" delay) delay))))))
+ (let ((delay (if (not arg)
+ image-dired-slideshow-delay
+ (if (> arg 0)
+ arg
+ (string-to-number
+ (let ((delay (number-to-string image-dired-slideshow-delay)))
+ (read-string
+ (format-prompt "Delay, in seconds. Decimals are accepted" delay))
+ delay))))))
(setq image-dired--slideshow-timer
(run-with-timer
0 delay