unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: "Drew Adams" <drew.adams@oracle.com>
Cc: 10624@debbugs.gnu.org
Subject: bug#10624: 24.0.92; default value of `dired-do-ch*'
Date: Sat, 15 Sep 2012 02:47:41 +0300	[thread overview]
Message-ID: <87392k2ml9.fsf@mail.jurta.org> (raw)
In-Reply-To: <60BBA8177B8C4157BBB5426B2F6A8204@us.oracle.com> (Drew Adams's message of "Fri, 27 Jan 2012 08:23:19 -0800")

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): "





  reply	other threads:[~2012-09-14 23:47 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-27 15:35 bug#10624: 24.0.92; default value of `dired-do-ch*' Drew Adams
2012-01-27 16:23 ` Drew Adams
2012-09-14 23:47   ` Juri Linkov [this message]
2012-09-15  0:37     ` Drew Adams
2012-09-15 22:50       ` Juri Linkov
2012-09-16  4:47         ` Drew Adams
2012-09-16 23:48           ` Juri Linkov
2012-09-17  0:39             ` Drew Adams
2012-09-18 23:22             ` Juri Linkov
2012-09-15 22:54       ` Juri Linkov
2012-09-16  4:47         ` Drew Adams
2012-09-16 23:45           ` bug#10624: Dired-marking all files in the region Juri Linkov
2012-11-22  9:49             ` Juri Linkov
2012-11-22 15:27               ` Drew Adams
2012-11-23  7:51                 ` Juri Linkov
2012-11-23 17:12                   ` Drew Adams
2012-11-25  9:16                     ` Juri Linkov
2012-11-25 15:49                       ` Drew Adams
2012-11-25 16:12                         ` Juri Linkov
2012-11-25 17:02                           ` Drew Adams
2012-11-22 15:40               ` Stefan Monnier
2012-11-23  7:59                 ` Juri Linkov

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=87392k2ml9.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=10624@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    /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).