emacs-devel
[Top][All Lists]
Advanced

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

Re: A few issues with thumbs.el


From: Stefan Monnier
Subject: Re: A few issues with thumbs.el
Date: Thu, 09 Jun 2005 09:22:12 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>> ;; Make sure auto-image-file-mode is ON.
>> (auto-image-file-mode t)
> Removed.

Thanks.

>> (when thumbs-thumbsdir-auto-clean
>> (thumbs-cleanup-thumbsdir))

> This is the only extant top-level action. The question is, what to do
> with the thumbsdir cleanup? It could be an interactive command issued
> by the user (not pretty, but not entirely unreasonable), or it could
> be automatically triggered by the functions that create new
> thumbnails.  If so, in order to be efficient, it should be called
> *after* creating the thumbnails, passing it a list of recently-created
> thumbnails that it should preserve; otherwise, when the directory has
> reached the limit, every single thumbnail creation would trigger
> deletion of old thumbnails, which, in directories with many images,
> would mean that a lot of thumbnails are deleted just to be recreated
> immediately.

> Alternatively, the cleanup could be triggered periodically, via timers
> or by any other means.

> The problem with both alternatives is that there will be circumstances
> when the thumbnails directory will be bigger (perhaps much bigger)
> than `thumbs-thumbsdir-max-size'; but this is no different of what
> happens right now.

Indeed, the delete-upon-load is also a heuristic and it's not necessarily
better than any other.  I think anything is OK, as long as it's run at least
once per Emacs session where you use thumbs without being run too often to
slow everything down.

> Another question. Are things like:

> (defcustom thumbs-conversion-program
>   ...
>   (or (executable-find "convert")
>    ...

> kosher? I ask because this is, after all, a top-level action executed
> on loading.

executable-find is not expected to modify any state: it doesn't
create/modify/delete any file for exemple.  It's more or less
a "pure" function.  Some files even run programs upon load (typically
things like "ispell --version"), and while it's often sub-optimal, it's
still OK as long as the program itself won't change any state either.

>> - I wish there was a way to put the thumbs directly next to the original
>> image files.  E.g. instead of ~/.emacs-thumbs/foo!bar!baz!toto!NNNN.jpg
>> I'd like to use ~/foo/bar/baz/.emacs-thumbs/toto_NNNN.jpg.

> Hmm. Is NNNN.jpg an image on toto/, or toto_NNNN.jpg an image on baz/?

toto_NNNN.jpg would be the thumb for (e.g.) baz/toto.gif.
The NNNN is in case you want to add a hash or counter.


        Stefan




reply via email to

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