Stefan Kangas <stefan@marxist.se> writes:
> Stefan Kangas <stefan@marxist.se> writes:
>
>> So perhaps this feature request is relevant anymore. WDYT?
>
> I now see that Glenn mentioned resizing as well, where using the
> built-in image scaling seems very relevant. We currently jump through
> some unnecessary hoops in `image-dired-display-image' when we could just
> resize the image in memory.
>
> Is there any reason why `image-dired-display-image-mode' doesn't just
> inherit `image-mode'? That would avoid code duplication and also allow
> us to immediately benefit from any improvements to `image-mode'.
Hi, sorry for coming late to the party.
I cannot remember any good reason for not inheriting from `image-mode', but
I opened image-dired.el now and found this:
(defvar image-dired-display-image-mode-map
(let ((map (make-sparse-keymap)))
;; `image-mode-map' has bindings that do not make sense in image-dired
;; (set-keymap-parent map image-mode-map)
(define-key map "f" 'image-dired-display-current-image-full)
(define-key map "s" 'image-dired-display-current-image-sized)
(define-key map "g" nil)
;; Useful bindings from `image-mode-map'
(define-key map [remap forward-char] 'image-forward-hscroll)
(define-key map [remap backward-char] 'image-backward-hscroll)
...
It seems I knew about `image-mode' but perhaps it never crossed my mind
to inherit from it. 16 years later, my memory fails me...
At any rate I have nothing against it, if someone wants to give it a try.
/Mathias