Subject: [PATCH] image-dired: Add extra keybinds for navigation

From: Gabriel Santos <[email-masked]>
Date: Mon, 06 Jan 2025 17:07:24 -0300

Greetings,

I discovered this mode through a blog post from Sacha:

<https://sachachua.com/blog/2025/01/using-image-dired-to-browse-the-latest-screenshots-from-multiple-directories/>

And I really liked it.

Though, I felt that it was missing something:

Some keybinds for navigation besides C-n and C-p, like those found in
other read-only modes, such as dired-mode.

This patch binds the following keys in `image-dired-thumbnail-mode-map':

- "f" :: `image-dired-forward-image'
- "b" :: `image-dired-backward-image'
- "n" :: `image-dired-next-line'
- "p" :: `image-dired-previous-line'
- "a" :: `image-dired-move-beginning-of-line'
- "e" :: `image-dired-move-end-of-line'

These keys are currently unused in the mode.

Regards,

--
Gabriel Santos

>From 8f7a1234ce7642f587e435347bf7ba22b397ce18 Mon Sep 17 00:00:00 2001
From: Gabriel Santos <[email-masked]>
Date: Mon, 6 Jan 2025 16:56:31 -0300
Subject: [PATCH] image-dired: Add extra keybinds for navigation

* lisp/image/image-dired.el (image-dired-thumbnail-mode-map):
Bind previously unused keys for alternative navigation.
---
 lisp/image/image-dired.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lisp/image/image-dired.el b/lisp/image/image-dired.el
index 71c272e4388..b35199c60d4 100644
--- a/lisp/image/image-dired.el
+++ b/lisp/image/image-dired.el
@@ -944,6 +944,15 @@ You probably want to use this together with
 
 (defvar-keymap image-dired-thumbnail-mode-map
   :doc "Keymap for `image-dired-thumbnail-mode'."
+
+  ;; Regular navigation
+  "f"          #'image-dired-forward-image
+  "b"          #'image-dired-backward-image
+  "n"          #'image-dired-next-line
+  "p"          #'image-dired-previous-line
+  "a"          #'image-dired-move-beginning-of-line
+  "e"          #'image-dired-move-end-of-line
+
   "d"          #'image-dired-flag-thumb-original-file
   "<delete>"   #'image-dired-flag-thumb-original-file
   "m"          #'image-dired-mark-thumb-original-file
-- 
2.47.1