From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Mathias Dahl" Newsgroups: gmane.emacs.devel Subject: Small change in image-dired.el Date: Sat, 29 Mar 2008 21:08:21 +0100 Message-ID: <7dbe73ed0803291308o2c127601k6ceeb3351d3a1f83@mail.gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1206821319 17106 80.91.229.12 (29 Mar 2008 20:08:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Mar 2008 20:08:39 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Mar 29 21:09:10 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JfhMS-0006MZ-Q3 for ged-emacs-devel@m.gmane.org; Sat, 29 Mar 2008 21:09:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfhLr-0000F7-5G for ged-emacs-devel@m.gmane.org; Sat, 29 Mar 2008 16:08:31 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfhLm-0000Es-Uf for emacs-devel@gnu.org; Sat, 29 Mar 2008 16:08:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfhLk-0000Eg-Gr for emacs-devel@gnu.org; Sat, 29 Mar 2008 16:08:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfhLk-0000Ed-B7 for emacs-devel@gnu.org; Sat, 29 Mar 2008 16:08:24 -0400 Original-Received: from wa-out-1112.google.com ([209.85.146.181]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JfhLj-0002Xg-Ty for emacs-devel@gnu.org; Sat, 29 Mar 2008 16:08:24 -0400 Original-Received: by wa-out-1112.google.com with SMTP id k34so1027466wah.10 for ; Sat, 29 Mar 2008 13:08:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; bh=p7YlvlhhqRGk9Ysrh7AbaKITpgUbIWgXSGneVXyRhlA=; b=j+sJR3jG5g/FMnQbfMLhifox84InQR8Ozx5cV7YShCgZ/aOrdEC5k+8/A+3Wcms4ybdlcwiXYtR9nY5yeprzfRtFkOFcpmx0F/00FXzXD+21k24g6pQVvDpaOcDIx1UpyQE/scjtVeYkYQZsYg5enJMj3IEKBAHuZUh246Nwmfw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=message-id:date:from:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=ngHwpxUWi0kTnHOsFEDJfOJyZiZPuz/ifD7HWMM0f2sGiEE9J6khb6wVyxhqJOaiU2rHQZ3Ofo5bAg1hFxQ6alkFrEVddCVWIy4nlYQ4k8gT9wfv9t4ejfsDPRoS3ApPd0jbnyE7AQq3ocMEfZj/Y6RBaPGwZT711c5snwf3vTU= Original-Received: by 10.114.124.1 with SMTP id w1mr6588580wac.45.1206821301718; Sat, 29 Mar 2008 13:08:21 -0700 (PDT) Original-Received: by 10.114.146.9 with HTTP; Sat, 29 Mar 2008 13:08:21 -0700 (PDT) Content-Disposition: inline X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:93831 Archived-At: When cleaning my mailbox I found an old request from Stefan Reich=F6r asking if tumme (as it was called back then) could preserve the timestamp of rotated original files. He sent a patch which I implemented (although slightly changed) today. I made it customizable and by default it works as before, i.e. not preserving timestamp. If people are OK with the change, could someone check this in for me (it was a long time since I did any CVS commit and I don't want to mess up)? diff -c /home/mathias/image-dired.el /home/mathias/prj/emacs/lisp/image-dir= ed.el *** /home/mathias/image-dired.el=092008-03-29 20:46:03.000000000 +0100 --- /home/mathias/prj/emacs/lisp/image-dired.el=092008-03-29 20:58:28.000000000 +0100 *************** *** 516,521 **** --- 516,528 ---- :type 'integer :group 'image-dired) + (defcustom image-dired-rotate-original-preserve-timestamp nil + "If non-nil, try to preserve the timestamp of the image file. + Used by `image-dired-rotate-original'. Requires the `touch' + program to work." + :type 'boolean + :group 'image-dired) + (defun image-dired-dir () "Return the current thumbnails directory (from variable `image-dired-di= r'). Create the thumbnails directory if it does not exist." *************** *** 1923,1929 **** =09=09 "Rotate to temp file OK. Overwrite original image? ")) (not image-dired-rotate-original-ask-before-overwrite)) (progn ! (copy-file image-dired-temp-rotate-image-file file t) (image-dired-refresh-thumb)) (image-dired-display-image file)))))) --- 1930,1942 ---- =09=09 "Rotate to temp file OK. Overwrite original image? ")) (not image-dired-rotate-original-ask-before-overwrite)) (progn ! (let ((time-stamp (dired-touch-initial (list file))) ! touch-program) ! (copy-file image-dired-temp-rotate-image-file file t) ! (when (and image-dired-rotate-original-preserve-timestamp ! (setq touch-program (executable-find "touch"))= ) ! (call-process shell-file-name nil nil nil shell-command-switch ! (format "touch -t %s \"%s\"" time-stamp file)))) (image-dired-refresh-thumb)) (image-dired-display-image file)))))) Diff finished. Sat Mar 29 21:01:35 2008 /Mathias