Mercurial > emacs
changeset 70888:b84970723553
Added new parameter to `tumme-display-thumbs' to be used from `tumme-next-line-and-display' and similar commands.
author | Mathias Dahl <mathias.dahl@gmail.com> |
---|---|
date | Wed, 24 May 2006 16:58:21 +0000 |
parents | 9de7d5cf6d99 |
children | fdfa8d35537f |
files | lisp/tumme.el |
diffstat | 1 files changed, 18 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/tumme.el Wed May 24 16:53:18 2006 +0000 +++ b/lisp/tumme.el Wed May 24 16:58:21 2006 +0000 @@ -547,7 +547,7 @@ :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)))) @@ -701,7 +701,7 @@ (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))) @@ -710,7 +710,7 @@ (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))) @@ -729,7 +729,7 @@ (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))) @@ -818,7 +818,7 @@ (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 @@ -830,7 +830,14 @@ `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) @@ -862,7 +869,9 @@ 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. @@ -1658,13 +1667,13 @@ (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'.