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
f808da9e
Commit
f808da9e
authored
Dec 28, 2002
by
Richard M. Stallman
Browse files
(dired-goto-file): Handle \ and ^M quoted by backslash. Fix error message.
parent
4ad1689f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
2 deletions
+8
-2
lisp/dired.el
lisp/dired.el
+8
-2
No files found.
lisp/dired.el
View file @
f808da9e
...
...
@@ -1957,7 +1957,7 @@ instead of `dired-actual-switches'."
(
setq
file
(
directory-file-name
file
))
; does no harm if no directory
(
let
(
found
case-fold-search
dir
)
(
setq
dir
(
or
(
file-name-directory
file
)
(
error
"
Need absolute pathname for %s
"
file
)))
(
error
"
File name `%s' is not absolute
"
file
)))
(
save-excursion
;; The hair here is to get the result of dired-goto-subdir
;; without really calling it if we don't have any subdirs.
...
...
@@ -1966,11 +1966,17 @@ instead of `dired-actual-switches'."
(
and
(
cdr
dired-subdir-alist
)
(
dired-goto-subdir
dir
)))
(
let
((
base
(
file-name-nondirectory
file
))
search-string
(
boundary
(
dired-subdir-max
)))
(
setq
search-string
(
replace-regexp-in-string
"\^m"
"\\^m"
base
nil
t
))
(
setq
search-string
(
replace-regexp-in-string
"\\\\"
"\\\\"
search-string
nil
t
))
(
while
(
and
(
not
found
)
;; filenames are preceded by SPC, this makes
;; the search faster (e.g. for the filename "-"!).
(
search-forward
(
concat
" "
base
)
boundary
'move
))
(
search-forward
(
concat
" "
search-string
)
boundary
'move
))
;; Match could have BASE just as initial substring or
;; or in permission bits or date or
;; not be a proper filename at all:
...
...
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