From: Mathias Dahl <brakjoller@gmail.com>
Subject: Re: thumbs.el and transparency
Date: Sun, 29 Jan 2006 17:01:11 +0100 [thread overview]
Message-ID: <m28xszaurc.fsf@gmail.com> (raw)
In-Reply-To: E1F2i3T-0003fG-5L@fencepost.gnu.org
"Richard M. Stallman" <rms@gnu.org> writes:
> Thumbs operation on the other hand is er, pretty obvious and
> straight-forward, and it seems reasonably useful for what it does...
> At the least, I got a buffer full of thumbnails with the first command
> I tried. I never did figure out how to make tumme do that.
>
> We need to make it tumme simpler to invoke.
Here is an example of such a command. It tries to mirror the way the
`thumbs' command works. I added a new defcustom, a new defun with a
defalias and made a slight change to `tumme-display-thumbs'. Basic
code proudly copied from thumbs.el:
(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)
;;;###autoload
(defun tumme-show-all-from-dir (dir)
"Make a preview buffer for all images in DIR and display it.
If the number of files in DIR that matches
`image-file-name-regexp' exceeds
`tumme-show-all-from-dir-max-files', a warning will be
displayed.
Note: you won't get the same integration (movement tracking,
marking, automatic jumping to the correct dired buffer etc) using
this command as if you had used `tumme-display-thumbs' directly
from a dired buffer, but for basic thumbnail and image viewing it
works well."
(interactive "DDir: ")
(let* ((files (directory-files
dir t (image-file-name-regexp))))
(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 files. Proceed? "
tumme-show-all-from-dir-max-files))))
(progn
(tumme-display-thumbs nil nil files)
(switch-to-buffer tumme-thumbnail-buffer))
(message "Cancelled."))))
;;;###autoload
(defalias 'tumme 'tumme-show-all-from-dir)
(defun tumme-display-thumbs (&optional arg append files)
"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 point (this is useful if you have marked some files but
want to show another one).
Optional argument FILES is a list of file names that will be used
instead of using file names from dired.
With optional argument APPEND, append thumbnail to thumbnail buffer
instead of erasing it first.
Recommended usage is to split the current frame horizontally so
that you have the dired buffer in the left window and the
`tumme-thumbnail-buffer' buffer in the right window."
(interactive "P")
(let ((buf (tumme-create-thumbnail-buffer))
curr-file thumb-name file-list count dired-buf beg)
(if files
(progn
(setq file-list files)
(setq dired-buf nil))
(setq dired-buf (current-buffer))
(if arg
(setq files (list (dired-get-filename)))
(setq files (dired-get-marked-files))))
(save-excursion
(set-buffer buf)
(let ((inhibit-read-only t))
(if (not append)
(erase-buffer)
(goto-char (point-max)))
(mapcar
(lambda (curr-file)
(setq thumb-name (tumme-thumb-name curr-file))
(if (and (not (file-exists-p thumb-name))
(not (= 0 (tumme-create-thumb curr-file thumb-name))))
(message "Thumb could not be created for file %s" curr-file)
(tumme-insert-thumbnail thumb-name curr-file dired-buf)))
file-list))
(cond ((eq 'dynamic tumme-line-up-method)
(tumme-line-up-dynamic))
((eq 'fixed tumme-line-up-method)
(tumme-line-up))
((eq 'interactive tumme-line-up-method)
(tumme-line-up-interactive))
((eq 'none tumme-line-up-method)
nil)
(t
(tumme-line-up-dynamic))))))
Combined with one of the example defuns I posted earlier I think that this
would indeed be quite easy to use for a beginner, or at least match
the easiness (?) of thumbs:
(defun tumme-display-thumbnail-original-image-and-buffer (&optional arg)
"Call `tumme-display-thumbnail-original-image' and display display buffer.
See command `tumme-display-thumbnail-original-image' for
details."
(interactive "P")
(tumme-display-thumbnail-original-image arg)
(display-buffer tumme-display-image-buffer))
Rebind RET:
(define-key tumme-thumbnail-mode-map "\C-m"
'tumme-display-thumbnail-original-image-and-buffer)
It would be great if someone could test the usefullness of this.
/Mathias
next prev parent reply other threads:[~2006-01-29 16:01 UTC|newest]
Thread overview: 127+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-01-25 1:08 thumbs.el and transparency Nick Roberts
2006-01-25 7:59 ` Juri Linkov
2006-01-25 9:20 ` Nick Roberts
2006-01-26 18:54 ` Mathias Dahl
2006-01-26 21:59 ` Nick Roberts
2006-01-27 3:46 ` Miles Bader
2006-01-27 9:27 ` Nick Roberts
2006-01-28 4:50 ` Richard M. Stallman
2006-01-28 23:58 ` Nick Roberts
2006-01-29 13:41 ` Mathias Dahl
2006-01-29 21:10 ` Nick Roberts
2006-01-29 22:42 ` Mathias Dahl
2006-01-30 10:26 ` Kim F. Storm
2006-01-30 11:23 ` Juanma Barranquero
2006-01-30 15:12 ` Chong Yidong
2006-01-30 15:41 ` Juanma Barranquero
2006-01-30 18:43 ` Chong Yidong
2006-01-31 15:31 ` CUA-related problem (was: Re: thumbs.el and transparency) Kim F. Storm
2006-01-31 15:41 ` Juanma Barranquero
2006-01-31 18:19 ` Luc Teirlinck
2006-01-31 19:32 ` Juanma Barranquero
2006-01-31 18:04 ` thumbs.el and transparency Richard M. Stallman
2006-01-31 19:47 ` Juanma Barranquero
2006-01-31 21:10 ` Luc Teirlinck
2006-01-31 23:08 ` Kim F. Storm
2006-01-31 23:45 ` Luc Teirlinck
2006-02-01 10:41 ` Kim F. Storm
2006-02-02 2:07 ` Luc Teirlinck
2006-02-02 9:26 ` Juanma Barranquero
2006-02-02 9:35 ` Kim F. Storm
2006-01-31 23:54 ` Luc Teirlinck
2006-02-01 10:45 ` Juanma Barranquero
2006-01-30 23:25 ` Richard M. Stallman
2006-01-31 9:26 ` Juanma Barranquero
2006-01-29 9:38 ` Sascha Wilde
2006-01-29 13:46 ` Mathias Dahl
2006-01-29 16:38 ` Miles Bader
2006-01-29 18:13 ` David Kastrup
2006-01-29 22:35 ` Mathias Dahl
2006-01-29 16:50 ` David Kastrup
2006-01-29 22:33 ` Mathias Dahl
2006-01-27 16:53 ` Mathias Dahl
2006-01-29 0:03 ` Nick Roberts
2006-01-30 0:56 ` Richard M. Stallman
2006-01-30 11:35 ` Mathias Dahl
2006-01-29 2:33 ` Miles Bader
2006-01-29 14:07 ` Mathias Dahl
2006-01-29 14:34 ` Mathias Dahl
2006-01-29 16:22 ` Robert J. Chassell
2006-01-29 18:01 ` Chong Yidong
2006-01-29 20:13 ` Nick Roberts
2006-01-30 1:04 ` Robert J. Chassell
2006-01-30 2:08 ` Nick Roberts
2006-01-30 14:44 ` Robert J. Chassell
2006-01-29 22:04 ` Mathias Dahl
2006-01-29 23:13 ` Chong Yidong
2006-01-30 11:57 ` Mathias Dahl
2006-01-30 14:18 ` Mathias Dahl
2006-01-30 1:49 ` Robert J. Chassell
2006-01-30 12:08 ` Mathias Dahl
2006-01-28 4:51 ` Richard M. Stallman
2006-01-29 16:01 ` Mathias Dahl [this message]
2006-01-30 18:46 ` Richard M. Stallman
2006-01-30 21:49 ` Mathias Dahl
2006-01-30 22:16 ` Mathias Dahl
2006-01-31 18:03 ` Richard M. Stallman
2006-02-01 10:44 ` Mathias Dahl
2006-02-02 4:16 ` Richard M. Stallman
2006-02-02 16:34 ` Mathias Dahl
2006-02-04 18:27 ` Richard M. Stallman
2006-02-05 12:03 ` Mathias Dahl
2006-02-05 20:36 ` Juri Linkov
2006-02-05 22:05 ` Mathias Dahl
2006-02-06 0:22 ` Miles Bader
2006-02-06 7:27 ` Juri Linkov
2006-02-06 17:37 ` Mathias Dahl
2006-02-07 10:59 ` Juri Linkov
2006-02-07 17:46 ` Mathias Dahl
2006-02-08 9:17 ` Juri Linkov
2006-02-08 15:27 ` Mathias Dahl
2006-02-09 17:29 ` Juri Linkov
2006-02-09 22:46 ` Mathias Dahl
2006-02-10 1:29 ` Juri Linkov
2006-02-10 10:14 ` Mathias Dahl
2006-02-10 10:28 ` Miles Bader
2006-02-10 13:45 ` tumme testing Robert J. Chassell
2006-02-10 14:26 ` Mattis
2006-02-10 18:18 ` Robert J. Chassell
2006-02-11 0:17 ` Mattis
2006-02-11 12:57 ` Robert J. Chassell
2006-02-11 21:54 ` Mathias Dahl
2006-02-11 1:22 ` Juri Linkov
2006-02-11 9:21 ` Mathias Dahl
2006-02-12 17:45 ` Juri Linkov
2006-02-12 21:21 ` Mathias Dahl
2006-02-12 23:41 ` Mathias Dahl
2006-02-13 0:24 ` Robert J. Chassell
2006-02-13 17:55 ` Juri Linkov
2006-02-13 18:41 ` Drew Adams
2006-02-14 6:18 ` Tomas Zerolo
2006-02-14 17:45 ` Juri Linkov
2006-02-13 20:21 ` Mathias Dahl
2006-02-10 16:47 ` Mathias Dahl
2006-02-11 16:45 ` thumbs.el and transparency Richard M. Stallman
2006-02-09 23:47 ` Miles Bader
2006-02-10 10:12 ` Mathias Dahl
2006-02-10 23:02 ` Richard M. Stallman
2006-02-10 23:56 ` Mathias Dahl
2006-02-11 1:21 ` Juri Linkov
2006-02-11 9:30 ` Mathias Dahl
2006-02-12 17:45 ` Juri Linkov
2006-02-12 18:35 ` Mathias Dahl
2006-02-12 4:30 ` Richard M. Stallman
2006-02-12 14:38 ` Mattis
2006-02-12 17:47 ` Juri Linkov
2006-02-12 18:39 ` Mathias Dahl
2006-02-13 17:57 ` Juri Linkov
2006-02-06 2:06 ` Richard M. Stallman
2006-02-06 21:19 ` Can someone verify my changes to tumme and dired? (was: thumbs.el and transparency) Mathias Dahl
2006-02-06 22:17 ` Can someone verify my changes to tumme and dired? Mathias Dahl
2006-02-06 23:33 ` David Kastrup
2006-02-07 12:58 ` Mathias Dahl
2006-01-27 4:12 ` thumbs.el and transparency Miles Bader
2006-01-27 4:50 ` Nick Roberts
-- strict thread matches above, loose matches on Subject: below --
2006-01-29 13:57 Xavier Maillard
2006-01-29 20:14 ` Nick Roberts
2006-01-29 22:11 ` Mathias Dahl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m28xszaurc.fsf@gmail.com \
--to=brakjoller@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).