Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
31d42b37
Commit
31d42b37
authored
Sep 05, 2008
by
Chong Yidong
Browse files
(dired-get-filename): Rewrite octal escape character processor
(bug#885).
parent
80372fd3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
11 deletions
+5
-11
lisp/dired.el
lisp/dired.el
+5
-11
No files found.
lisp/dired.el
View file @
31d42b37
...
...
@@ -1915,17 +1915,11 @@ Otherwise, an error occurs in these cases."
;; 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.
;; Using read to unquote is much faster than substituting
;; \007 (4 chars) -> ^G (1 char) etc. in a lisp loop.
(
setq
file
(
read
(
concat
"\""
;; Some ls -b don't escape quotes, argh!
;; This is not needed for GNU ls, though.
(
or
(
dired-string-replace-match
"\\([^\\]\\|\\`\\)\""
file
"\\1\\\\\""
nil
t
)
file
)
"\""
)))
(
while
(
string-match
"\\(?:[^\\]\\|\\`\\)\\(\\\\[0-7][0-7][0-7]\\)"
file
)
(
setq
file
(
replace-match
(
read
(
concat
"\""
(
match-string
1
file
)
"\""
))
nil
t
file
1
)))
;; The above `read' will return a unibyte string if FILE
;; contains eight-bit-control/graphic characters.
(
if
(
and
enable-multibyte-characters
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment