From: Manuel Giraud Date: Thu, 9 Mar 2023 13:35:31 +0000 (+0100) Subject: Scroll up and down in image-dired X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2026cba0c998c60c60ed4d87e81b537f2a931cb7;p=emacs.git Scroll up and down in image-dired * lisp/image/image-dired.el (image-dired-scroll): Function to manage scroll in image-dired. (image-dired-scroll-up, image-dired-scroll-down): Scroll up and down command in image-dired. (image-dired-thumbnail-mode-map): Use them. (Bug#65052) --- diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el index 9a92cae8ad5..8e2e4c6f644 100644 --- a/lisp/image/image-dired.el +++ b/lisp/image/image-dired.el @@ -770,6 +770,24 @@ On reaching end or beginning of buffer, stop and show a message." (interactive nil image-dired-thumbnail-mode) (image-dired--movement-command (pos-eol) 'reverse)) +(defun image-dired-scroll (&optional down) + "Scroll in the thumbnail buffer." + (let ((goal-column (current-column))) + (if down (scroll-down) (scroll-up)) + (move-to-column goal-column) + (image-dired--movement-ensure-point-pos down) + (when image-dired-track-movement + (image-dired-track-original-file)) + (image-dired--update-header-line))) + +(defun image-dired-scroll-up () + (interactive nil image-dired-thumbnail-mode) + (image-dired-scroll)) + +(defun image-dired-scroll-down () + (interactive nil image-dired-thumbnail-mode) + (image-dired-scroll 'down)) + ;;; Header line @@ -980,6 +998,8 @@ You probably want to use this together with " " #'image-dired-end-of-buffer " " #'image-dired-move-beginning-of-line " " #'image-dired-move-end-of-line + " " #'image-dired-scroll-up + " " #'image-dired-scroll-down :menu '("Image-Dired"