]> git.eshelyaron.com Git - emacs.git/commitdiff
image-dired: Fix behavior of slideshow command
authorStefan Kangas <stefan@marxist.se>
Tue, 7 Dec 2021 11:59:18 +0000 (12:59 +0100)
committerStefan Kangas <stefan@marxist.se>
Tue, 7 Dec 2021 12:00:24 +0000 (13:00 +0100)
* lisp/image-dired.el (image-dired-slideshow-start): Fix behavior
to match documentation.  Minor simplification of docstring.

etc/NEWS
lisp/image-dired.el

index a8b7dc56bacb2f74a072b1a9e285acb1e0cc78bf..3bdbdde55139e918d7c14722220f46a0f19518a2 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -583,13 +583,16 @@ used for images that are flagged for deletion in the Dired buffer
 associated with Image-Dired.
 
 ---
-*** The 'image-dired-slideshow-start' command has been revamped.
+*** 'image-dired-slideshow-start' is now bound to 'S'.
+It is bound in both the thumbnail and display buffer.
+
+---
+*** The 'image-dired-slideshow-start' command no longer prompts.
 It no longer inconveniently prompts for a number of images and a
 delay: it runs indefinitely, but stops automatically on any command.
 You can set the delay with a prefix argument, or a negative prefix
-argument to prompt anyways.  Customize the user option
-'image-dired-slideshow-delay' to change the default, which is 5
-seconds.  It is bound to 'S' in the thumbnail and display buffer.
+argument to prompt for a delay.  Customize the user option
+'image-dired-slideshow-delay' to change the default from 5 seconds.
 
 ---
 *** Support for bookmark.el.
index fe0c3b7c2266d004f19bde845f1ca98f8fc870a2..33f28a3440f840c0a0e15c267f242da701e80e69 100644 (file)
@@ -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