From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: A few issues with thumbs.el Date: Thu, 9 Jun 2005 04:00:37 +0200 Message-ID: References: <87br6zuerw.fsf-monnier+emacs@gnu.org> <87u0kqrsur.fsf-monnier+emacs@gnu.org> <87hdgon2p2.fsf@jurta.org> <87vf508myc.fsf-monnier+emacs@gnu.org> Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1118282881 15474 80.91.229.2 (9 Jun 2005 02:08:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 9 Jun 2005 02:08:01 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jun 09 04:07:59 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DgCRx-0002fc-D2 for ged-emacs-devel@m.gmane.org; Thu, 09 Jun 2005 04:07:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgCYm-0000en-Q5 for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 22:14:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DgCXE-0000E8-Jh for emacs-devel@gnu.org; Wed, 08 Jun 2005 22:12:46 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DgCXB-0000CS-NO for emacs-devel@gnu.org; Wed, 08 Jun 2005 22:12:42 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DgCXA-00008q-Mk for emacs-devel@gnu.org; Wed, 08 Jun 2005 22:12:40 -0400 Original-Received: from [64.233.182.194] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DgCLj-0003p1-49 for emacs-devel@gnu.org; Wed, 08 Jun 2005 22:00:51 -0400 Original-Received: by nproxy.gmail.com with SMTP id i2so100393nfe for ; Wed, 08 Jun 2005 19:00:37 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=F38124HMmAl+yd+4/k2PG1b644maYMOi7eRxAw2cGjf8D1GMxNIriz6X1EbkezW/vjV+Rx/YOJdILo5dbfcVoxtXCY77lM9raCH11uxdvlh16PaUpYYr56a8JNkjXOcJ7E8iJ02JeiwREsByrLRbl5XctGLDZyDZ21LNi5zRWWc= Original-Received: by 10.48.240.16 with SMTP id n16mr1115nfh; Wed, 08 Jun 2005 19:00:37 -0700 (PDT) Original-Received: by 10.48.250.5 with HTTP; Wed, 8 Jun 2005 19:00:37 -0700 (PDT) Original-To: emacs-devel@gnu.org In-Reply-To: <87vf508myc.fsf-monnier+emacs@gnu.org> Content-Disposition: inline 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:38400 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38400 On 5/30/05, Stefan Monnier wrote: > These are bugs and should be fixed. I'm thinking of: >=20 > ;; Make sure auto-image-file-mode is ON. > (auto-image-file-mode t) Removed. >=20 > ;; Create the thumbs directory if it does not exists. > (setq thumbs-thumbsdir (expand-file-name thumbs-thumbsdir)) >=20 > (when (not (file-directory-p thumbs-thumbsdir)) > (progn > (make-directory thumbs-thumbsdir) > (message "Creating thumbnails directory"))) I've added a new function to return the thumbnails dir, creating it if need= ed. Additionally, I've had to change a few more things, like thumbs-temp-file, which got created and didn't update when thumbs-thumbdir changed; now it is a function. I've also turned thumbs-gensym into a CL gensym clone; there was no point in having a different default prefix or anything (no one in his/her sane mind is gonna load thumbs.el just in order to have gensym). > (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. 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. > - 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/? --=20 /L/e/k/t/u