emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r105357: * lisp/dired-aux.el (dired-t


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r105357: * lisp/dired-aux.el (dired-touch-initial): Remove function.
Date: Sat, 30 Jul 2011 12:14:58 +0300
User-agent: Bazaar (2.3.1)

------------------------------------------------------------
revno: 105357
fixes bug(s): http://debbugs.gnu.org/6887
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Sat 2011-07-30 12:14:58 +0300
message:
  * lisp/dired-aux.el (dired-touch-initial): Remove function.
  (dired-do-chxxx): For op-symbol `touch', set `initial' to the
  current time, and `default' to the last modification time of the
  current marked file.
modified:
  lisp/ChangeLog
  lisp/dired-aux.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2011-07-28 14:05:07 +0000
+++ b/lisp/ChangeLog    2011-07-30 09:14:58 +0000
@@ -1,7 +1,14 @@
+2011-07-30  Juri Linkov  <address@hidden>
+
+       * dired-aux.el (dired-touch-initial): Remove function.
+       (dired-do-chxxx): For op-symbol `touch', set `initial' to the
+       current time, and `default' to the last modification time of the
+       current marked file (bug#6887).
+
 2011-07-28  Jose E. Marchesi  <address@hidden>
 
        * simple.el (goto-line): Use string-to-number to provide a
-       numeric argument to read-number.
+       numeric argument to read-number (bug#9163).
 
 2011-07-27  Michael Albinus  <address@hidden>
 

=== modified file 'lisp/dired-aux.el'
--- a/lisp/dired-aux.el 2011-07-12 02:54:26 +0000
+++ b/lisp/dired-aux.el 2011-07-30 09:14:58 +0000
@@ -226,34 +226,28 @@
              (file-attributes full-file-name))))
    (directory-files dir)))
 
-
-(defun dired-touch-initial (files)
-  "Create initial input value for `touch' command."
-  ;; Nobody can explain what this version is supposed to do.  (Bug#6887)
-  ;; Also, the manual says it uses "the present time".
-  ;;; (let (initial)
-  ;;;   (while files
-  ;;;     (let ((current (nth 5 (file-attributes (car files)))))
-  ;;;       (if (and initial (not (equal initial current)))
-  ;;;           (setq initial (current-time) files nil)
-  ;;;         (setq initial current))
-  ;;;       (setq files (cdr files))))
-  ;;;   (format-time-string "%Y%m%d%H%M.%S" initial)))
-  (format-time-string "%Y%m%d%H%M.%S" (current-time)))
+;;; Change file attributes
 
 (defun dired-do-chxxx (attribute-name program op-symbol arg)
-  ;; Change file attributes (mode, group, owner, timestamp) of marked files and
+  ;; Change file attributes (group, owner, timestamp) of marked files and
   ;; refresh their file lines.
   ;; ATTRIBUTE-NAME is a string describing the attribute to the user.
   ;; PROGRAM is the program used to change the attribute.
-  ;; OP-SYMBOL is the type of operation (for use in dired-mark-pop-up).
-  ;; ARG describes which files to use, as in dired-get-marked-files.
+  ;; OP-SYMBOL is the type of operation (for use in `dired-mark-pop-up').
+  ;; ARG describes which files to use, as in `dired-get-marked-files'.
   (let* ((files (dired-get-marked-files t arg))
+        (initial
+         (if (eq op-symbol 'touch)
+             (format-time-string "%Y%m%d%H%M.%S")))
+        (default
+          (if (eq op-symbol 'touch)
+              (and (stringp (car files))
+                   (format-time-string "%Y%m%d%H%M.%S"
+                                       (nth 5 (file-attributes (car 
files)))))))
         (new-attribute
          (dired-mark-read-string
           (concat "Change " attribute-name " of %s to: ")
-          (if (eq op-symbol 'touch) (dired-touch-initial files))
-          op-symbol arg files))
+          initial op-symbol arg files default))
         (operation (concat program " " new-attribute))
         failures)
     (setq failures


reply via email to

[Prev in Thread] Current Thread [Next in Thread]