aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2012-10-27 12:17:14 +0300
committerJuri Linkov2012-10-27 12:17:14 +0300
commite2f022a3fa6986eea4df942dc52a00ae70ec193f (patch)
tree2f5bd2c6516471c70568c956c546989abc25e160
parentdf171c230cc8a5da73684740ff5cfa364fa8c1c4 (diff)
downloademacs-e2f022a3fa6986eea4df942dc52a00ae70ec193f.tar.gz
emacs-e2f022a3fa6986eea4df942dc52a00ae70ec193f.zip
* lisp/wdired.el (wdired-keep-marker-rename): New defcustom.
(wdired-do-renames): Use it instead of `dired-keep-marker-rename'. * lisp/dired.el (dired-keep-marker-rename): Add reference to `wdired-keep-marker-rename' in the docstring. Add default character value ?R to display initially in Customization UI instead of ?@. Fixes: debbugs:11795
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/dired.el7
-rw-r--r--lisp/wdired.el25
3 files changed, 38 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index defa35f09ee..c6e940ba0fa 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12012-10-27 Juri Linkov <juri@jurta.org>
2
3 * wdired.el (wdired-keep-marker-rename): New defcustom.
4 (wdired-do-renames): Use it instead of `dired-keep-marker-rename'.
5 (Bug#11795)
6
7 * dired.el (dired-keep-marker-rename): Add reference to
8 `wdired-keep-marker-rename' in the docstring.
9 Add default character value ?R to display initially in
10 Customization UI instead of ?@.
11
12012-10-27 Martin Rudalics <rudalics@gmx.at> 122012-10-27 Martin Rudalics <rudalics@gmx.at>
2 13
3 * window.el (display-buffer): In doc-string describe 14 * window.el (display-buffer): In doc-string describe
diff --git a/lisp/dired.el b/lisp/dired.el
index fb2f7281130..5f7ee48a810 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -137,9 +137,12 @@ A value of t means move to first file."
137 "Controls marking of renamed files. 137 "Controls marking of renamed files.
138If t, files keep their previous marks when they are renamed. 138If t, files keep their previous marks when they are renamed.
139If a character, renamed files (whether previously marked or not) 139If a character, renamed files (whether previously marked or not)
140are afterward marked with that character." 140are afterward marked with that character.
141This option affects only files renamed by `dired-do-rename' and
142`dired-do-rename-regexp'. See `wdired-keep-marker-rename'
143if you want to do the same for files renamed in WDired mode."
141 :type '(choice (const :tag "Keep" t) 144 :type '(choice (const :tag "Keep" t)
142 (character :tag "Mark")) 145 (character :tag "Mark" :value ?R))
143 :group 'dired-mark) 146 :group 'dired-mark)
144 147
145(defcustom dired-keep-marker-copy ?C 148(defcustom dired-keep-marker-copy ?C
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 266d1993389..9851b2046d9 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -140,6 +140,20 @@ program `dired-chmod-program', which must exist."
140 (other :tag "Bits freely editable" advanced)) 140 (other :tag "Bits freely editable" advanced))
141 :group 'wdired) 141 :group 'wdired)
142 142
143(defcustom wdired-keep-marker-rename t
144 ;; Use t as default so that renamed files "take their markers with them".
145 "Controls marking of files renamed in WDired.
146If t, files keep their previous marks when they are renamed.
147If a character, renamed files (whether previously marked or not)
148are afterward marked with that character.
149This option affects only files renamed by `wdired-finish-edit'.
150See `dired-keep-marker-rename' if you want to do the same for files
151renamed by `dired-do-rename' and `dired-do-rename-regexp'."
152 :type '(choice (const :tag "Keep" t)
153 (character :tag "Mark" :value ?R))
154 :version "24.3"
155 :group 'wdired)
156
143(defvar wdired-mode-map 157(defvar wdired-mode-map
144 (let ((map (make-sparse-keymap))) 158 (let ((map (make-sparse-keymap)))
145 (define-key map "\C-x\C-s" 'wdired-finish-edit) 159 (define-key map "\C-x\C-s" 'wdired-finish-edit)
@@ -416,6 +430,8 @@ non-nil means return old filename."
416 (set-buffer-modified-p nil) 430 (set-buffer-modified-p nil)
417 (setq buffer-undo-list nil)) 431 (setq buffer-undo-list nil))
418 432
433(declare-function dired-add-entry "dired-aux" (filename &optional marker-char relative))
434
419(defun wdired-do-renames (renames) 435(defun wdired-do-renames (renames)
420 "Perform RENAMES in parallel." 436 "Perform RENAMES in parallel."
421 (let ((residue ()) 437 (let ((residue ())
@@ -471,9 +487,12 @@ non-nil means return old filename."
471 (dired-rename-file file-ori file-new 487 (dired-rename-file file-ori file-new
472 overwrite) 488 overwrite)
473 (dired-remove-file file-ori) 489 (dired-remove-file file-ori)
474 (dired-add-file file-new (if (integerp dired-keep-marker-rename) 490 (dired-add-file
475 dired-keep-marker-rename 491 file-new
476 old-mark))) 492 (cond ((integerp wdired-keep-marker-rename)
493 wdired-keep-marker-rename)
494 (wdired-keep-marker-rename old-mark)
495 (t nil))))
477 (error 496 (error
478 (setq errors (1+ errors)) 497 (setq errors (1+ errors))
479 (dired-log (concat "Rename `" file-ori "' to `" 498 (dired-log (concat "Rename `" file-ori "' to `"