emacs-diffs
[Top][All Lists]
Advanced

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

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


From: Juri Linkov
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r110091: * lisp/dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file
Date: Wed, 19 Sep 2012 01:57:45 +0300
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 110091
fixes bug: http://debbugs.gnu.org/10624
committer: Juri Linkov <address@hidden>
branch nick: trunk
timestamp: Wed 2012-09-19 01:57:45 +0300
message:
  * lisp/dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file
  attributes for M-n are pulled from the file at point.
  (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix.
  Suggested by Drew Adams.
modified:
  etc/NEWS
  lisp/ChangeLog
  lisp/dired-aux.el
  lisp/dired.el
=== modified file 'etc/NEWS'
--- a/etc/NEWS  2012-09-16 04:52:38 +0000
+++ b/etc/NEWS  2012-09-18 22:57:45 +0000
@@ -459,6 +459,10 @@
 if the command ends in `;' (when operating on multiple files).
 Otherwise, it executes the command on each file in parallel.
 
+*** Typing M-n in the minibuffer of `dired-do-chmod', `dired-do-chgrp',
+`dired-do-chown', `dired-do-touch' pulls the file attributes of the
+file at point.
+
 *** The minibuffer default for `=' (`dired-diff) has changed.
 It is now the backup file for the file at point, if one exists, rather
 than the file at the mark.

=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2012-09-18 22:10:19 +0000
+++ b/lisp/ChangeLog    2012-09-18 22:57:45 +0000
@@ -1,3 +1,10 @@
+2012-09-18  Juri Linkov  <address@hidden>
+
+       * dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file
+       attributes for M-n are pulled from the file at point.
+       (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix.
+       Suggested by Drew Adams.  (Bug#10624)
+
 2012-09-18  Dmitry Gutov  <address@hidden>
 
        * progmodes/ruby-mode.el (ruby-brace-to-do-end): Don't add extra

=== modified file 'lisp/dired-aux.el'
--- a/lisp/dired-aux.el 2012-09-14 22:58:43 +0000
+++ b/lisp/dired-aux.el 2012-09-18 22:57:45 +0000
@@ -223,10 +223,17 @@
   ;; 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 (and (eq op-symbol 'touch)
-                      (stringp (car files))
-                      (format-time-string "%Y%m%d%H%M.%S"
-                                          (nth 5 (file-attributes (car 
files))))))
+        ;; The source of default file attributes is the file at point.
+        (default-file (dired-get-filename t))
+        (default (when default-file
+                   (cond ((eq op-symbol 'touch)
+                          (format-time-string
+                           "%Y%m%d%H%M.%S"
+                           (nth 5 (file-attributes default-file))))
+                         ((eq op-symbol 'chown)
+                          (nth 2 (file-attributes default-file 'string)))
+                         ((eq op-symbol 'chgrp)
+                          (nth 3 (file-attributes default-file 'string))))))
         (prompt (concat "Change " attribute-name " of %s to"
                         (if (eq op-symbol 'touch)
                             " (default now): "
@@ -263,11 +270,15 @@
 ;;;###autoload
 (defun dired-do-chmod (&optional arg)
   "Change the mode of the marked (or next ARG) files.
-Symbolic modes like `g+w' are allowed."
+Symbolic modes like `g+w' are allowed.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer."
   (interactive "P")
   (let* ((files (dired-get-marked-files t arg))
-        (modestr (and (stringp (car files))
-                      (nth 8 (file-attributes (car files)))))
+        ;; The source of default file attributes is the file at point.
+        (default-file (dired-get-filename t))
+        (modestr (when default-file
+                   (nth 8 (file-attributes default-file))))
         (default
           (and (stringp modestr)
                (string-match "^.\\(...\\)\\(...\\)\\(...\\)$" modestr)
@@ -300,7 +311,9 @@
 
 ;;;###autoload
 (defun dired-do-chgrp (&optional arg)
-  "Change the group of the marked (or next ARG) files."
+  "Change the group of the marked (or next ARG) files.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer."
   (interactive "P")
   (if (memq system-type '(ms-dos windows-nt))
       (error "chgrp not supported on this system"))
@@ -308,7 +321,9 @@
 
 ;;;###autoload
 (defun dired-do-chown (&optional arg)
-  "Change the owner of the marked (or next ARG) files."
+  "Change the owner of the marked (or next ARG) files.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer."
   (interactive "P")
   (if (memq system-type '(ms-dos windows-nt))
       (error "chown not supported on this system"))
@@ -317,7 +332,9 @@
 ;;;###autoload
 (defun dired-do-touch (&optional arg)
   "Change the timestamp of the marked (or next ARG) files.
-This calls touch."
+This calls touch.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer."
   (interactive "P")
   (dired-do-chxxx "Timestamp" dired-touch-program 'touch arg))
 

=== modified file 'lisp/dired.el'
--- a/lisp/dired.el     2012-09-15 10:20:56 +0000
+++ b/lisp/dired.el     2012-09-18 22:57:45 +0000
@@ -3744,7 +3744,7 @@
 ;;;;;;  dired-run-shell-command dired-do-shell-command 
dired-do-async-shell-command
 ;;;;;;  dired-clean-directory dired-do-print dired-do-touch dired-do-chown
 ;;;;;;  dired-do-chgrp dired-do-chmod dired-compare-directories 
dired-backup-diff
-;;;;;;  dired-diff) "dired-aux" "dired-aux.el" 
"3c768e470d5d053d0049e0286ce38da7")
+;;;;;;  dired-diff) "dired-aux" "dired-aux.el" 
"3650b53533253c50b10e2aa8c9005ebf")
 ;;; Generated autoloads from dired-aux.el
 
 (autoload 'dired-diff "dired-aux" "\
@@ -3798,22 +3798,30 @@
 (autoload 'dired-do-chmod "dired-aux" "\
 Change the mode of the marked (or next ARG) files.
 Symbolic modes like `g+w' are allowed.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer.
 
 \(fn &optional ARG)" t nil)
 
 (autoload 'dired-do-chgrp "dired-aux" "\
 Change the group of the marked (or next ARG) files.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer.
 
 \(fn &optional ARG)" t nil)
 
 (autoload 'dired-do-chown "dired-aux" "\
 Change the owner of the marked (or next ARG) files.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer.
 
 \(fn &optional ARG)" t nil)
 
 (autoload 'dired-do-touch "dired-aux" "\
 Change the timestamp of the marked (or next ARG) files.
 This calls touch.
+Type M-n to pull the file attributes of the file at point
+into the minibuffer.
 
 \(fn &optional ARG)" t nil)
 


reply via email to

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