emacs-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] fix goto-line


From: Juri Linkov
Subject: Re: [PATCH] fix goto-line
Date: Fri, 29 Jul 2011 18:28:46 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (x86_64-pc-linux-gnu)

> There are improvements and not bug fixes, so please file this as a
> wishlist item for 24.2 (and do not forget to add the "patch" tag).

These are improvements, but changes in the default value of `dired-do-touch'
is a regression.  I'd like to fix this regression with the following patch.
It restores the old pre-24 essential behavior, but still keeps the
requirement asked by the reporter of bug#6887 to use the current time.
More changes from http://thread.gmane.org/gmane.emacs.devel/81414/focus=82988
could be postponed to 24.2.

=== modified file 'lisp/dired-aux.el'
--- lisp/dired-aux.el   2011-07-25 08:23:29 +0000
+++ lisp/dired-aux.el   2011-07-29 15:27:45 +0000
@@ -227,20 +227,6 @@ (defun dired-files-attributes (dir)
    (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)))
-
 (defun dired-do-chxxx (attribute-name program op-symbol arg)
   ;; Change file attributes (mode, group, owner, timestamp) of marked files and
   ;; refresh their file lines.
@@ -249,11 +235,18 @@ (defun dired-do-chxxx (attribute-name pr
   ;; 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" (current-time))))
+        (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]