From 00e6aeacf2540b0dc621208577c1c725e3a533b2 Mon Sep 17 00:00:00 2001 From: Stefan Kangas Date: Tue, 7 Dec 2021 12:59:18 +0100 Subject: [PATCH] image-dired: Fix behavior of slideshow command * lisp/image-dired.el (image-dired-slideshow-start): Fix behavior to match documentation. Minor simplification of docstring. --- etc/NEWS | 11 +++++++---- lisp/image-dired.el | 19 ++++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/etc/NEWS b/etc/NEWS index a8b7dc56bac..3bdbdde5513 100644 --- 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. 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 -- 2.39.2