Commit 40047858 authored by Glenn Morris's avatar Glenn Morris
Browse files

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
parent 21f50183
......@@ -4,6 +4,9 @@
2012-01-25 Glenn Morris <rgm@gnu.org>
* dired.el (dired-goto-file): Handle some of the more common
characters that `ls -b' escapes. (Bug#10596)
* progmodes/compile.el (compilation-next-error-function):
Respect compilation-first-column in the "*compilation*" buffer.
* progmodes/grep.el (grep-first-column): New variable. (Bug#10594)
......
......@@ -2640,6 +2640,20 @@ instead of `dired-actual-switches'."
(replace-regexp-in-string "\^m" "\\^m" base nil t))
(setq search-string
(replace-regexp-in-string "\\\\" "\\\\" search-string nil t))
(and (dired-switches-escape-p dired-actual-switches)
(string-match "[ \t\n]" search-string)
;; FIXME to fix this for all possible file names
;; (embedded control characters etc), we need to
;; escape everything that `ls -b' does.
(setq search-string
(replace-regexp-in-string " " "\\ "
search-string nil t)
search-string
(replace-regexp-in-string "\t" "\\t"
search-string nil t)
search-string
(replace-regexp-in-string "\n" "\\n"
search-string nil t)))
(while (and (not found)
;; filenames are preceded by SPC, this makes
;; the search faster (e.g. for the filename "-"!).
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment