aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-01-25 00:20:24 -0800
committerGlenn Morris2012-01-25 00:20:24 -0800
commit40047858c6c270c3a7eb842abcbea042bb2781fd (patch)
tree3c641696f2a43d8174878b3a89474c8f3c72ad86
parent21f50183955a2d7ba016b96ba3442aae3d3cf2c3 (diff)
downloademacs-40047858c6c270c3a7eb842abcbea042bb2781fd.tar.gz
emacs-40047858c6c270c3a7eb842abcbea042bb2781fd.zip
dired-goto-file fix for some `ls -b' escapes.
* lisp/dired.el (dired-goto-file): Handle some of the more common characters that `ls -b' escapes. Fixes: debbugs:10596
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/dired.el14
2 files changed, 17 insertions, 0 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index e1038b89072..6a47a9f0ece 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -4,6 +4,9 @@
4 4
52012-01-25 Glenn Morris <rgm@gnu.org> 52012-01-25 Glenn Morris <rgm@gnu.org>
6 6
7 * dired.el (dired-goto-file): Handle some of the more common
8 characters that `ls -b' escapes. (Bug#10596)
9
7 * progmodes/compile.el (compilation-next-error-function): 10 * progmodes/compile.el (compilation-next-error-function):
8 Respect compilation-first-column in the "*compilation*" buffer. 11 Respect compilation-first-column in the "*compilation*" buffer.
9 * progmodes/grep.el (grep-first-column): New variable. (Bug#10594) 12 * progmodes/grep.el (grep-first-column): New variable. (Bug#10594)
diff --git a/lisp/dired.el b/lisp/dired.el
index 57f67ca7c8c..bb38d32785d 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -2640,6 +2640,20 @@ instead of `dired-actual-switches'."
2640 (replace-regexp-in-string "\^m" "\\^m" base nil t)) 2640 (replace-regexp-in-string "\^m" "\\^m" base nil t))
2641 (setq search-string 2641 (setq search-string
2642 (replace-regexp-in-string "\\\\" "\\\\" search-string nil t)) 2642 (replace-regexp-in-string "\\\\" "\\\\" search-string nil t))
2643 (and (dired-switches-escape-p dired-actual-switches)
2644 (string-match "[ \t\n]" search-string)
2645 ;; FIXME to fix this for all possible file names
2646 ;; (embedded control characters etc), we need to
2647 ;; escape everything that `ls -b' does.
2648 (setq search-string
2649 (replace-regexp-in-string " " "\\ "
2650 search-string nil t)
2651 search-string
2652 (replace-regexp-in-string "\t" "\\t"
2653 search-string nil t)
2654 search-string
2655 (replace-regexp-in-string "\n" "\\n"
2656 search-string nil t)))
2643 (while (and (not found) 2657 (while (and (not found)
2644 ;; filenames are preceded by SPC, this makes 2658 ;; filenames are preceded by SPC, this makes
2645 ;; the search faster (e.g. for the filename "-"!). 2659 ;; the search faster (e.g. for the filename "-"!).