:group 'tumme)
(defun tumme-dir ()
- "Return the current thumbnails directory (from `tumme-dir').
+ "Return the current thumbnails directory (from variable `tumme-dir').
Create the thumbnails directory if it does not exist."
(let ((tumme-dir (file-name-as-directory
(expand-file-name tumme-dir))))
(interactive)
(dired-next-line 1)
(tumme-display-thumbs
- t (or tumme-append-when-browsing nil))
+ t (or tumme-append-when-browsing nil) t)
(if tumme-dired-disp-props
(tumme-dired-display-properties)))
(interactive)
(dired-previous-line 1)
(tumme-display-thumbs
- t (or tumme-append-when-browsing nil))
+ t (or tumme-append-when-browsing nil) t)
(if tumme-dired-disp-props
(tumme-dired-display-properties)))
(interactive)
(dired-mark 1)
(tumme-display-thumbs
- t (or tumme-append-when-browsing nil))
+ t (or tumme-append-when-browsing nil) t)
(if tumme-dired-disp-props
(tumme-dired-display-properties)))
(message "No saved window configuration")))
;;;###autoload
-(defun tumme-display-thumbs (&optional arg append)
+(defun tumme-display-thumbs (&optional arg append do-not-pop)
"Display thumbnails of all marked files, in `tumme-thumbnail-buffer'.
If a thumbnail image does not exist for a file, it is created on the
fly. With prefix argument ARG, display only thumbnail for file at
`tumme-thumbnail-buffer' buffer in the right window.
With optional argument APPEND, append thumbnail to thumbnail buffer
-instead of erasing it first."
+instead of erasing it first.
+
+Option argument DO-NOT-POP controls if `pop-to-buffer' should be
+used or not. If non-nil, use `display-buffer' instead of
+`pop-to-buffer'. This is used from functions like
+`tumme-next-line-and-display' and
+`tumme-previous-line-and-display' where we do not want the
+thumbnail buffer to be selected."
(interactive "P")
(let ((buf (tumme-create-thumbnail-buffer))
curr-file thumb-name files count dired-buf beg)
nil)
(t
(tumme-line-up-dynamic))))
- (pop-to-buffer tumme-thumbnail-buffer)))
+ (if do-not-pop
+ (display-buffer tumme-thumbnail-buffer)
+ (pop-to-buffer tumme-thumbnail-buffer))))
(defun tumme-show-all-from-dir (dir)
"Make a preview buffer for all images in DIR and display it.
(defun tumme-display-thumbs-append ()
"Append thumbnails to `tumme-thumbnail-buffer'."
(interactive)
- (tumme-display-thumbs nil t))
+ (tumme-display-thumbs nil t t))
;;;###autoload
(defun tumme-display-thumb ()
"Shorthard for `tumme-display-thumbs' with prefix argument."
(interactive)
- (tumme-display-thumbs t))
+ (tumme-display-thumbs t nil t))
(defun tumme-line-up ()
"Line up thumbnails according to `tumme-thumbs-per-row'.