Emacs: easy to navigate through idle images?

I want the -style style eogwhen I click von the image in the buffer with the buffer. I searched a bit on the Internet but found nothing. There image-dired, but the sketches are not what I want.

I want the behavior that already exists for most file types vin standby mode to show the file in view-mode, where n, pand qdo the obvious thing.

I hacked some things around dired-view-next, but I wonder if there is already a package there that does a good job?

+4
source share
3 answers

, Emacs 24.4. IOW, Emacs 24.

v Dired , : . n, p q , : () . image-mode, n .. DTRT.

, image-mode.el dev . , , Emacs 24.3 ( Emacs, ).

+5

Image Dired image-dired-display-thumbnail-original-image. , v image-dired-display-thumbnail-original-image, .

, , . , n p / . q . , .

+1

I put my code here if there is no better equivalent. It works the way I want, but the implementation is a bit dumb:

(defmacro image-view (direction)
  `(lambda ()
     (interactive)
     (quit-window)
     (let ((pt (point))
           filename)
       (or (ignore-errors
             (catch 'filename
               (while (dired-next-line ,direction)
                 (when (image-type-from-file-name
                        (setq filename (dired-get-filename)))
                   (throw 'filename filename)))))
           (goto-char pt))
       (dired-view-file))))

(eval-after-load "image-mode"
  '(progn
    (define-key image-mode-map "n" (image-view 1))
    (define-key image-mode-map "h" (image-view -1))))
0
source

All Articles