all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Small change in image-dired.el
@ 2008-03-29 20:08 Mathias Dahl
  2008-03-29 20:27 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Mathias Dahl @ 2008-03-29 20:08 UTC (permalink / raw)
  To: emacs-devel

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




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-30  0:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-29 20:08 Small change in image-dired.el Mathias Dahl
2008-03-29 20:27 ` Stefan Monnier
2008-03-29 21:27   ` Reiner Steib
2008-03-29 21:38     ` Stefan Monnier
2008-03-30  0:55   ` Mathias Dahl

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.