diff options
| author | Juri Linkov | 2012-09-19 02:18:06 +0300 |
|---|---|---|
| committer | Juri Linkov | 2012-09-19 02:18:06 +0300 |
| commit | 42917e790eb8e92e40dc79e34846d6598279ca61 (patch) | |
| tree | 954c7fd1b9ce93d73a9a7494fdea0cf4f3a04ffa | |
| parent | 20f70ede43c938dd9c3c67f231ae6c645464f16e (diff) | |
| download | emacs-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/NEWS | 4 | ||||
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/dired.el | 33 |
3 files changed, 37 insertions, 7 deletions
| @@ -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 |
| 464 | file at point. | 464 | file 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') | ||
| 468 | mark/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. |
| 467 | It is now the backup file for the file at point, if one exists, rather | 471 | It is now the backup file for the file at point, if one exists, rather |
| 468 | than the file at the mark. | 472 | than 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 @@ | |||
| 1 | 2012-09-18 Juri Linkov <juri@jurta.org> | 1 | 2012-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 | |||
| 8 | 2012-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. |
| 3099 | If on a subdir headerline, mark all its files except `.' and `..'. | 3099 | If on a subdir headerline, mark all its files except `.' and `..'. |
| 3100 | If the region is active in Transient Mark mode, mark all files | ||
| 3101 | in the active region. | ||
| 3100 | 3102 | ||
| 3101 | Use \\[dired-unmark-all-files] to remove all marks | 3103 | Use \\[dired-unmark-all-files] to remove all marks |
| 3102 | and \\[dired-unmark] on a subdir to remove the marks in | 3104 | and \\[dired-unmark] on a subdir to remove the marks in |
| 3103 | this subdir." | 3105 | this 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. |
| 3114 | If looking at a subdir, unmark all its files except `.' and `..'." | 3128 | If looking at a subdir, unmark all its files except `.' and `..'. |
| 3129 | If the region is active in Transient Mark mode, unmark all files | ||
| 3130 | in 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. |
| 3121 | With prefix arg, repeat over several lines. | 3137 | With prefix arg, repeat over several lines. |
| 3122 | 3138 | If on a subdir headerline, flag all its files except `.' and `..'. | |
| 3123 | If on a subdir headerline, mark all its files except `.' and `..'." | 3139 | If the region is active in Transient Mark mode, flag all files |
| 3140 | in 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. |
| 3130 | Optional prefix ARG says how many lines to unmark/unflag; default | 3147 | Optional prefix ARG says how many lines to unmark/unflag; default |
| 3131 | is one line." | 3148 | is one line. |
| 3149 | If the region is active in Transient Mark mode, unmark all files | ||
| 3150 | in the active region." | ||
| 3132 | (interactive "p") | 3151 | (interactive "p") |
| 3133 | (dired-unmark (- arg))) | 3152 | (dired-unmark (- arg))) |
| 3134 | 3153 | ||