emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: thumbs.el and transparency


From: Mathias Dahl
Subject: Re: thumbs.el and transparency
Date: Mon, 30 Jan 2006 23:16:40 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Mathias Dahl <address@hidden> writes:

> "Richard M. Stallman" <address@hidden> writes:
>
>>     (defun tumme-show-all-from-dir (dir)
>>       "Make a preview buffer for all images in DIR and display it.
>>
>> I am having trouble following the code of this--it is quite complex.
>> Does it create a dired buffer?  Or does it create something else
>> instead of a dired buffer?
>
> It creates a buffer called *tumme* with thumbnails of all image files
> in DIR, just like what happens if you mark files in dired and press
> `C-t d' (`tumme-display-thumbs'), but skipping the dired step, for
> convenience. A lot of people, including you, seem to have missed this
> feature from thumbs.el and I wanted to make a quick hack to see if it
> was possible to do. And it was, quite easily. The "only" problem with
> it, which `thumbs' have too AFAIK, is that it does not generate the
> thumbnails "in the background" (asynchronously or whatever).
>

I just wrote another version that did not require any change in
`tumme-display-thumbs' and which also has the benefit of opening
dired, so that you get full integration:

(defcustom tumme-show-all-from-dir-max-files 50
  "*Maximum number of files to show using`tumme-show-all-from-dir'.
 before warning the user."
  :type 'integer
  :group 'tumme)

(defun tumme-show-all-from-dir (dir)
  (interactive "DDir: ")
  ;; Create dired buffer so that we can, if we want
  ;; use the nice integrations between tumme and dired.
  (dired dir)
  (dired-mark-files-regexp (image-file-name-regexp))
  (let ((files (dired-get-marked-files)))
    (if (or (<= (length files) tumme-show-all-from-dir-max-files)
            (and (> (length files) tumme-show-all-from-dir-max-files)
                 (y-or-n-p 
                  (format 
                   "Directory contains more than %d image files. Proceed? " 
                   tumme-show-all-from-dir-max-files))))
        (progn
          (tumme-display-thumbs)
          (switch-to-buffer tumme-thumbnail-buffer))
      (message "Cancelled."))))

/Mathias





reply via email to

[Prev in Thread] Current Thread [Next in Thread]