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)
This commit is contained in:
parent
f2e3d2f125
commit
2026cba0c9
1 changed files with 20 additions and 0 deletions
|
@ -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
|
|||
"<remap> <end-of-buffer>" #'image-dired-end-of-buffer
|
||||
"<remap> <move-beginning-of-line>" #'image-dired-move-beginning-of-line
|
||||
"<remap> <move-end-of-line>" #'image-dired-move-end-of-line
|
||||
"<remap> <scroll-up-command>" #'image-dired-scroll-up
|
||||
"<remap> <scroll-down-command>" #'image-dired-scroll-down
|
||||
|
||||
:menu
|
||||
'("Image-Dired"
|
||||
|
|
Loading…
Add table
Reference in a new issue