diff options
| author | Juri Linkov | 2012-11-23 09:59:43 +0200 |
|---|---|---|
| committer | Juri Linkov | 2012-11-23 09:59:43 +0200 |
| commit | 61a2a12285951942d007929973f8bdd59f82ea53 (patch) | |
| tree | 7464bb3b20f09b53e6d654f4ed55602cbeb2456a | |
| parent | bccffa83747ae14e9a45779be7e8e570f8d70be5 (diff) | |
| download | emacs-61a2a12285951942d007929973f8bdd59f82ea53.tar.gz emacs-61a2a12285951942d007929973f8bdd59f82ea53.zip | |
* lisp/dired.el (dired-mark): Add optional arg `interactive'.
Check for `use-region-p' if `interactive' is non-nil.
(dired-unmark, dired-flag-file-deletion): Add optional arg
`interactive'. Call `dired-mark' with the arg `interactive'.
Fixes: debbugs:10624
| -rw-r--r-- | lisp/ChangeLog | 8 | ||||
| -rw-r--r-- | lisp/dired.el | 18 |
2 files changed, 17 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a020790e4fd..eed11358baf 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -4,6 +4,14 @@ | |||
| 4 | 4 | ||
| 5 | 2012-11-23 Juri Linkov <juri@jurta.org> | 5 | 2012-11-23 Juri Linkov <juri@jurta.org> |
| 6 | 6 | ||
| 7 | * dired.el (dired-mark): Add optional arg `interactive'. | ||
| 8 | Check for `use-region-p' if `interactive' is non-nil. | ||
| 9 | (dired-unmark, dired-flag-file-deletion): Add optional arg | ||
| 10 | `interactive'. Call `dired-mark' with the arg `interactive'. | ||
| 11 | (Bug#10624) | ||
| 12 | |||
| 13 | 2012-11-23 Juri Linkov <juri@jurta.org> | ||
| 14 | |||
| 7 | * wdired.el: Revert 2012-10-17 change partly and replace it with | 15 | * wdired.el: Revert 2012-10-17 change partly and replace it with |
| 8 | Patch by Christopher Schmidt <christopher@ch.ristopher.com>. | 16 | Patch by Christopher Schmidt <christopher@ch.ristopher.com>. |
| 9 | (wdired-finish-edit): Add marks for new file names to | 17 | (wdired-finish-edit): Add marks for new file names to |
diff --git a/lisp/dired.el b/lisp/dired.el index 5f7ee48a810..b62b4d1ad08 100644 --- a/lisp/dired.el +++ b/lisp/dired.el | |||
| @@ -3109,7 +3109,7 @@ argument or confirmation)." | |||
| 3109 | (insert dired-marker-char))) | 3109 | (insert dired-marker-char))) |
| 3110 | (forward-line 1)))) | 3110 | (forward-line 1)))) |
| 3111 | 3111 | ||
| 3112 | (defun dired-mark (arg) | 3112 | (defun dired-mark (arg &optional interactive) |
| 3113 | "Mark the file at point in the Dired buffer. | 3113 | "Mark the file at point in the Dired buffer. |
| 3114 | If the region is active, mark all files in the region. | 3114 | If the region is active, mark all files in the region. |
| 3115 | Otherwise, with a prefix arg, mark files on the next ARG lines. | 3115 | Otherwise, with a prefix arg, mark files on the next ARG lines. |
| @@ -3119,10 +3119,10 @@ If on a subdir headerline, mark all its files except `.' and `..'. | |||
| 3119 | Use \\[dired-unmark-all-files] to remove all marks | 3119 | Use \\[dired-unmark-all-files] to remove all marks |
| 3120 | and \\[dired-unmark] on a subdir to remove the marks in | 3120 | and \\[dired-unmark] on a subdir to remove the marks in |
| 3121 | this subdir." | 3121 | this subdir." |
| 3122 | (interactive "P") | 3122 | (interactive (list current-prefix-arg t)) |
| 3123 | (cond | 3123 | (cond |
| 3124 | ;; Mark files in the active region. | 3124 | ;; Mark files in the active region. |
| 3125 | ((and transient-mark-mode mark-active) | 3125 | ((and interactive (use-region-p)) |
| 3126 | (save-excursion | 3126 | (save-excursion |
| 3127 | (let ((beg (region-beginning)) | 3127 | (let ((beg (region-beginning)) |
| 3128 | (end (region-end))) | 3128 | (end (region-end))) |
| @@ -3139,7 +3139,7 @@ this subdir." | |||
| 3139 | (prefix-numeric-value arg) | 3139 | (prefix-numeric-value arg) |
| 3140 | (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) | 3140 | (function (lambda () (delete-char 1) (insert dired-marker-char)))))))) |
| 3141 | 3141 | ||
| 3142 | (defun dired-unmark (arg) | 3142 | (defun dired-unmark (arg &optional interactive) |
| 3143 | "Unmark the file at point in the Dired buffer. | 3143 | "Unmark the file at point in the Dired buffer. |
| 3144 | If the region is active, unmark all files in the region. | 3144 | If the region is active, unmark all files in the region. |
| 3145 | Otherwise, with a prefix arg, unmark files on the next ARG lines. | 3145 | Otherwise, with a prefix arg, unmark files on the next ARG lines. |
| @@ -3147,11 +3147,11 @@ Otherwise, with a prefix arg, unmark files on the next ARG lines. | |||
| 3147 | If looking at a subdir, unmark all its files except `.' and `..'. | 3147 | If looking at a subdir, unmark all its files except `.' and `..'. |
| 3148 | If the region is active in Transient Mark mode, unmark all files | 3148 | If the region is active in Transient Mark mode, unmark all files |
| 3149 | in the active region." | 3149 | in the active region." |
| 3150 | (interactive "P") | 3150 | (interactive (list current-prefix-arg t)) |
| 3151 | (let ((dired-marker-char ?\040)) | 3151 | (let ((dired-marker-char ?\040)) |
| 3152 | (dired-mark arg))) | 3152 | (dired-mark arg interactive))) |
| 3153 | 3153 | ||
| 3154 | (defun dired-flag-file-deletion (arg) | 3154 | (defun dired-flag-file-deletion (arg &optional interactive) |
| 3155 | "In Dired, flag the current line's file for deletion. | 3155 | "In Dired, flag the current line's file for deletion. |
| 3156 | If the region is active, flag all files in the region. | 3156 | If the region is active, flag all files in the region. |
| 3157 | Otherwise, with a prefix arg, flag files on the next ARG lines. | 3157 | Otherwise, with a prefix arg, flag files on the next ARG lines. |
| @@ -3159,9 +3159,9 @@ Otherwise, with a prefix arg, flag files on the next ARG lines. | |||
| 3159 | If on a subdir headerline, flag all its files except `.' and `..'. | 3159 | If on a subdir headerline, flag all its files except `.' and `..'. |
| 3160 | If the region is active in Transient Mark mode, flag all files | 3160 | If the region is active in Transient Mark mode, flag all files |
| 3161 | in the active region." | 3161 | in the active region." |
| 3162 | (interactive "P") | 3162 | (interactive (list current-prefix-arg t)) |
| 3163 | (let ((dired-marker-char dired-del-marker)) | 3163 | (let ((dired-marker-char dired-del-marker)) |
| 3164 | (dired-mark arg))) | 3164 | (dired-mark arg interactive))) |
| 3165 | 3165 | ||
| 3166 | (defun dired-unmark-backward (arg) | 3166 | (defun dired-unmark-backward (arg) |
| 3167 | "In Dired, move up lines and remove marks or deletion flags there. | 3167 | "In Dired, move up lines and remove marks or deletion flags there. |