GNU bug report logs - #10624
24.0.92; default value of `dired-do-ch*'

Previous Next

Package: emacs;

Reported by: "Drew Adams" <drew.adams <at> oracle.com>

Date: Fri, 27 Jan 2012 15:37:01 UTC

Severity: minor

Found in version 24.0.92

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Juri Linkov <juri <at> jurta.org>
To: "Drew Adams" <drew.adams <at> oracle.com>
Cc: 10624 <at> debbugs.gnu.org
Subject: bug#10624: 24.0.92; default value of `dired-do-ch*'
Date: Sat, 15 Sep 2012 02:47:41 +0300
This request for enhancement is implemented with the following patch
where the user will be able to mark the target file with the mark.
Otherwise, the marked file is used as target only when it is a single file
in the list of marked files:

=== modified file 'lisp/dired-aux.el'
--- lisp/dired-aux.el	2012-09-13 23:42:39 +0000
+++ lisp/dired-aux.el	2012-09-14 23:45:05 +0000
@@ -223,10 +237,16 @@ (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))
+	 (default-file (or (if (and transient-mark-mode mark-active)
+			       (save-excursion (goto-char (mark t))
+					       (dired-get-filename t t)))
+			   (if (and (= (length files) 1)
+				    (stringp (car files)))
+			       (car files))))
 	 (default (and (eq op-symbol 'touch)
-		       (stringp (car files))
+		       default-file
 		       (format-time-string "%Y%m%d%H%M.%S"
-					   (nth 5 (file-attributes (car files))))))
+					   (nth 5 (file-attributes default-file)))))
 	 (prompt (concat "Change " attribute-name " of %s to"
 			 (if (eq op-symbol 'touch)
 			     " (default now): "




This bug report was last modified 12 years and 181 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.