unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Mathias Dahl" <mathias.dahl@gmail.com>
To: emacs-devel@gnu.org
Subject: Small change in image-dired.el
Date: Sat, 29 Mar 2008 21:08:21 +0100	[thread overview]
Message-ID: <7dbe73ed0803291308o2c127601k6ceeb3351d3a1f83@mail.gmail.com> (raw)

When cleaning my mailbox I found an old request from Stefan Reichör
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-dired.el
*** /home/mathias/image-dired.el	2008-03-29 20:46:03.000000000 +0100
--- /home/mathias/prj/emacs/lisp/image-dired.el	2008-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-dir').
  Create the thumbnails directory if it does not exist."
***************
*** 1923,1929 ****
  		      "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 ----
  		      "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




             reply	other threads:[~2008-03-29 20:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-29 20:08 Mathias Dahl [this message]
2008-03-29 20:27 ` Small change in image-dired.el Stefan Monnier
2008-03-29 21:27   ` Reiner Steib
2008-03-29 21:38     ` Stefan Monnier
2008-03-30  0:55   ` 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=7dbe73ed0803291308o2c127601k6ceeb3351d3a1f83@mail.gmail.com \
    --to=mathias.dahl@gmail.com \
    --cc=emacs-devel@gnu.org \
    /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).