emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/lisp ChangeLog dired.el


From: Chong Yidong
Subject: [Emacs-diffs] emacs/lisp ChangeLog dired.el
Date: Thu, 02 Apr 2009 22:16:24 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Chong Yidong <cyd>      09/04/02 22:16:23

Modified files:
        lisp           : ChangeLog dired.el 

Log message:
        * dired.el (dired-get-filename): Always pass filename through
        `read' to ensure unquoting is performed (Bug#2862).

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/ChangeLog?cvsroot=emacs&r1=1.15544&r2=1.15545
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/dired.el?cvsroot=emacs&r1=1.421&r2=1.422

Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/emacs/emacs/lisp/ChangeLog,v
retrieving revision 1.15544
retrieving revision 1.15545
diff -u -b -r1.15544 -r1.15545
--- ChangeLog   2 Apr 2009 21:12:54 -0000       1.15544
+++ ChangeLog   2 Apr 2009 22:16:17 -0000       1.15545
@@ -1,3 +1,8 @@
+2009-04-02  Chong Yidong  <address@hidden>
+
+       * dired.el (dired-get-filename): Always pass filename through
+       `read' to ensure unquoting is performed (Bug#2862).
+
 2009-04-02  Stefan Monnier  <address@hidden>
 
        * doc-view.el (doc-view-mode): Don't give up if the file doesn't exist.

Index: dired.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/dired.el,v
retrieving revision 1.421
retrieving revision 1.422
diff -u -b -r1.421 -r1.422
--- dired.el    27 Jan 2009 03:53:07 -0000      1.421
+++ dired.el    2 Apr 2009 22:16:23 -0000       1.422
@@ -1950,11 +1950,14 @@
          ;; Get rid of the mouse-face property that file names have.
          (set-text-properties 0 (length file) nil file)
          ;; Unquote names quoted by ls or by dired-insert-directory.
-         (while (string-match
-                 "\\(?:[^\\]\\|\\`\\)\\(\\\\[0-7][0-7][0-7]\\)" file)
-           (setq file (replace-match
-                       (read (concat "\"" (match-string 1 file)  "\""))
-                       nil t file 1)))
+         ;; This code was written using `read' to unquote, because
+          ;; it's faster than substituting \007 (4 chars) -> ^G (1
+          ;; char) etc. in a lisp loop.  Unfortunately, this decision
+          ;; has necessitated hacks such as dealing with filenames
+          ;; with quotation marks in their names.
+         (while (string-match "\\(?:[^\\]\\|\\`\\)\\(\"\\)" file)
+           (setq file (replace-match "\\\"" nil t file 1)))
+          (setq file (read (concat "\"" file "\"")))
          ;; The above `read' will return a unibyte string if FILE
          ;; contains eight-bit-control/graphic characters.
          (if (and enable-multibyte-characters




reply via email to

[Prev in Thread] Current Thread [Next in Thread]