aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2012-09-19 02:18:06 +0300
committerJuri Linkov2012-09-19 02:18:06 +0300
commit42917e790eb8e92e40dc79e34846d6598279ca61 (patch)
tree954c7fd1b9ce93d73a9a7494fdea0cf4f3a04ffa
parent20f70ede43c938dd9c3c67f231ae6c645464f16e (diff)
downloademacs-42917e790eb8e92e40dc79e34846d6598279ca61.tar.gz
emacs-42917e790eb8e92e40dc79e34846d6598279ca61.zip
* lisp/dired.el (dired-mark): If the region is active in Transient Mark
mode, mark all files in the active region. Doc fix. (dired-unmark, dired-flag-file-deletion, dired-unmark-backward): Doc fix. Fixes: debbugs:10624
-rw-r--r--etc/NEWS4
-rw-r--r--lisp/ChangeLog7
-rw-r--r--lisp/dired.el33
3 files changed, 37 insertions, 7 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 35d540a9b85..c972180bbbd 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -463,6 +463,10 @@ Otherwise, it executes the command on each file in parallel.
463`dired-do-chown', `dired-do-touch' pulls the file attributes of the 463`dired-do-chown', `dired-do-touch' pulls the file attributes of the
464file at point. 464file at point.
465 465
466*** When the region is active, `m' (`dired-mark'), `u' (`dired-unmark'),
467`DEL' (`dired-unmark-backward'), `d' (`dired-flag-file-deletion')
468mark/unmark/flag all files in the active region.
469
466*** The minibuffer default for `=' (`dired-diff) has changed. 470*** The minibuffer default for `=' (`dired-diff) has changed.
467It is now the backup file for the file at point, if one exists, rather 471It is now the backup file for the file at point, if one exists, rather
468than the file at the mark. 472than the file at the mark.
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 43eddd7c699..66927960d25 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,12 @@
12012-09-18 Juri Linkov <juri@jurta.org> 12012-09-18 Juri Linkov <juri@jurta.org>
2 2
3 * dired.el (dired-mark): If the region is active in Transient Mark
4 mode, mark all files in the active region. Doc fix.
5 (dired-unmark, dired-flag-file-deletion, dired-unmark-backward):
6 Doc fix. (Bug#10624)
7
82012-09-18 Juri Linkov <juri@jurta.org>
9
3 * dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file 10 * dired-aux.el (dired-do-chxxx, dired-do-chmod): Default file
4 attributes for M-n are pulled from the file at point. 11 attributes for M-n are pulled from the file at point.
5 (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix. 12 (dired-do-chgrp, dired-do-chown, dired-do-touch): Doc fix.
diff --git a/lisp/dired.el b/lisp/dired.el
index df1b5698f12..abbd5acaf4f 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -3097,21 +3097,37 @@ argument or confirmation)."
3097(defun dired-mark (arg) 3097(defun dired-mark (arg)
3098 "Mark the current (or next ARG) files. 3098 "Mark the current (or next ARG) files.
3099If on a subdir headerline, mark all its files except `.' and `..'. 3099If on a subdir headerline, mark all its files except `.' and `..'.
3100If the region is active in Transient Mark mode, mark all files
3101in the active region.
3100 3102
3101Use \\[dired-unmark-all-files] to remove all marks 3103Use \\[dired-unmark-all-files] to remove all marks
3102and \\[dired-unmark] on a subdir to remove the marks in 3104and \\[dired-unmark] on a subdir to remove the marks in
3103this subdir." 3105this subdir."
3104 (interactive "P") 3106 (interactive "P")
3105 (if (dired-get-subdir) 3107 (cond
3106 (save-excursion (dired-mark-subdir-files)) 3108 ;; Mark files in the active region.
3109 ((and transient-mark-mode mark-active)
3110 (save-excursion
3111 (let ((beg (region-beginning))
3112 (end (region-end)))
3113 (dired-mark-files-in-region
3114 (progn (goto-char beg) (line-beginning-position))
3115 (progn (goto-char end) (line-beginning-position))))))
3116 ;; Mark subdir files from the subdir headerline.
3117 ((dired-get-subdir)
3118 (save-excursion (dired-mark-subdir-files)))
3119 ;; Mark the current (or next ARG) files.
3120 (t
3107 (let ((inhibit-read-only t)) 3121 (let ((inhibit-read-only t))
3108 (dired-repeat-over-lines 3122 (dired-repeat-over-lines
3109 (prefix-numeric-value arg) 3123 (prefix-numeric-value arg)
3110 (function (lambda () (delete-char 1) (insert dired-marker-char))))))) 3124 (function (lambda () (delete-char 1) (insert dired-marker-char))))))))
3111 3125
3112(defun dired-unmark (arg) 3126(defun dired-unmark (arg)
3113 "Unmark the current (or next ARG) files. 3127 "Unmark the current (or next ARG) files.
3114If looking at a subdir, unmark all its files except `.' and `..'." 3128If looking at a subdir, unmark all its files except `.' and `..'.
3129If the region is active in Transient Mark mode, unmark all files
3130in the active region."
3115 (interactive "P") 3131 (interactive "P")
3116 (let ((dired-marker-char ?\040)) 3132 (let ((dired-marker-char ?\040))
3117 (dired-mark arg))) 3133 (dired-mark arg)))
@@ -3119,8 +3135,9 @@ If looking at a subdir, unmark all its files except `.' and `..'."
3119(defun dired-flag-file-deletion (arg) 3135(defun dired-flag-file-deletion (arg)
3120 "In Dired, flag the current line's file for deletion. 3136 "In Dired, flag the current line's file for deletion.
3121With prefix arg, repeat over several lines. 3137With prefix arg, repeat over several lines.
3122 3138If on a subdir headerline, flag all its files except `.' and `..'.
3123If on a subdir headerline, mark all its files except `.' and `..'." 3139If the region is active in Transient Mark mode, flag all files
3140in the active region."
3124 (interactive "P") 3141 (interactive "P")
3125 (let ((dired-marker-char dired-del-marker)) 3142 (let ((dired-marker-char dired-del-marker))
3126 (dired-mark arg))) 3143 (dired-mark arg)))
@@ -3128,7 +3145,9 @@ If on a subdir headerline, mark all its files except `.' and `..'."
3128(defun dired-unmark-backward (arg) 3145(defun dired-unmark-backward (arg)
3129 "In Dired, move up lines and remove marks or deletion flags there. 3146 "In Dired, move up lines and remove marks or deletion flags there.
3130Optional prefix ARG says how many lines to unmark/unflag; default 3147Optional prefix ARG says how many lines to unmark/unflag; default
3131is one line." 3148is one line.
3149If the region is active in Transient Mark mode, unmark all files
3150in the active region."
3132 (interactive "p") 3151 (interactive "p")
3133 (dired-unmark (- arg))) 3152 (dired-unmark (- arg)))
3134 3153