[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-25 02bf7cc: Properly handle unquoting in wdired (bug
From: |
Andreas Schwab |
Subject: |
[Emacs-diffs] emacs-25 02bf7cc: Properly handle unquoting in wdired (bug 22938) |
Date: |
Tue, 08 Mar 2016 20:46:58 +0000 |
branch: emacs-25
commit 02bf7cc4632dae6bd679f34307fc83ccc8510471
Author: Andreas Schwab <address@hidden>
Commit: Andreas Schwab <address@hidden>
Properly handle unquoting in wdired (bug 22938)
The recorded old names are not quoted, don't unquote them.
* lisp/wdired.el (wdired-normalize-filename): Add argument
unquotep, only unquote if non-nil.
(wdired-get-filename): Don't unquote the old file name.
(wdired-get-previous-link): Always unquote.
---
lisp/wdired.el | 22 ++++++++++++----------
1 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/lisp/wdired.el b/lisp/wdired.el
index 795e50d..16ea67d 100644
--- a/lisp/wdired.el
+++ b/lisp/wdired.el
@@ -294,14 +294,15 @@ or \\[wdired-abort-changes] to abort changes")))
(put-text-property b-protection (point-max) 'read-only t))))
;; This code is a copy of some dired-get-filename lines.
-(defsubst wdired-normalize-filename (file)
- (setq file
- ;; FIXME: shouldn't we check for a `b' argument or somesuch before
- ;; doing such unquoting? --Stef
- (read (concat
- "\"" (replace-regexp-in-string
- "\\([^\\]\\|\\`\\)\"" "\\1\\\\\"" file)
- "\"")))
+(defsubst wdired-normalize-filename (file unquotep)
+ (when unquotep
+ (setq file
+ ;; FIXME: shouldn't we check for a `b' argument or somesuch before
+ ;; doing such unquoting? --Stef
+ (read (concat
+ "\"" (replace-regexp-in-string
+ "\\([^\\]\\|\\`\\)\"" "\\1\\\\\"" file)
+ "\""))))
(and file buffer-file-coding-system
(not file-name-coding-system)
(not default-file-name-coding-system)
@@ -329,7 +330,8 @@ non-nil means return old filename."
;; deletion.
(setq end (next-single-property-change beg 'end-name))
(setq file (buffer-substring-no-properties (1+ beg) end)))
- (and file (setq file (wdired-normalize-filename file))))
+ ;; Don't unquote the old name, it wasn't quoted in the first place
+ (and file (setq file (wdired-normalize-filename file (not old)))))
(if (or no-dir old)
file
(and file (> (length file) 0)
@@ -627,7 +629,7 @@ If OLD, return the old target. If MOVE, move point before
it."
(setq end (next-single-property-change beg 'end-link))
(setq target (buffer-substring-no-properties (1+ beg) end)))
(if move (goto-char (1- beg)))))
- (and target (wdired-normalize-filename target))))
+ (and target (wdired-normalize-filename target t))))
(declare-function make-symbolic-link "fileio.c")
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-25 02bf7cc: Properly handle unquoting in wdired (bug 22938),
Andreas Schwab <=