From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: A few issues with thumbs.el Date: Thu, 09 Jun 2005 09:22:12 -0400 Message-ID: <87wtp3d626.fsf-monnier+emacs@gnu.org> References: <87br6zuerw.fsf-monnier+emacs@gnu.org> <87u0kqrsur.fsf-monnier+emacs@gnu.org> <87hdgon2p2.fsf@jurta.org> <87vf508myc.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118324477 6012 80.91.229.2 (9 Jun 2005 13:41:17 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Jun 2005 13:41:17 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 09 15:41:10 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DgMzb-0007Xo-5h for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 15:22:43 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgN3Q-0004DZ-6m for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 09:26:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DgN2s-00046i-Pf for emacs-devel@gnu.org; Thu, 09 Jun 2005 09:26:07 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DgN2p-000455-3w for emacs-devel@gnu.org; Thu, 09 Jun 2005 09:26:03 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgN2o-00044k-UW for emacs-devel@gnu.org; Thu, 09 Jun 2005 09:26:02 -0400 Original-Received: from [209.226.175.74] (helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DgMzH-0002ea-Gy for emacs-devel@gnu.org; Thu, 09 Jun 2005 09:22:23 -0400 Original-Received: from alfajor ([70.48.82.205]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050609132213.FAIK19894.tomts20-srv.bellnexxia.net@alfajor>; Thu, 9 Jun 2005 09:22:13 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 186E7D73A3; Thu, 9 Jun 2005 09:22:13 -0400 (EDT) Original-To: Juanma Barranquero In-Reply-To: (Juanma Barranquero's message of "Thu, 9 Jun 2005 04:00:37 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:38429 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38429 >> ;; 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