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
6c106712
Commit
6c106712
authored
Jul 30, 2017
by
Michael Albinus
Browse files
* lisp/dired.el (dired-insert-directory): Move `file-remote-p' check up.
parent
65d42822
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
lisp/dired.el
lisp/dired.el
+16
-10
No files found.
lisp/dired.el
View file @
6c106712
...
@@ -1209,19 +1209,20 @@ If HDR is non-nil, insert a header line with the directory name."
...
@@ -1209,19 +1209,20 @@ If HDR is non-nil, insert a header line with the directory name."
;; as indicated by `ls-lisp-use-insert-directory-program'.
;; as indicated by `ls-lisp-use-insert-directory-program'.
(
not
(
and
(
featurep
'ls-lisp
)
(
not
(
and
(
featurep
'ls-lisp
)
(
null
ls-lisp-use-insert-directory-program
)))
(
null
ls-lisp-use-insert-directory-program
)))
(
not
(
and
(
featurep
'eshell
)
(
bound-and-true-p
eshell-ls-use-in-dired
)))
(
not
(
and
(
featurep
'eshell
)
(
or
(
if
(
eq
dired-use-ls-dired
'unspecified
)
(
bound-and-true-p
eshell-ls-use-in-dired
)))
(
or
(
file-remote-p
dir
)
(
if
(
eq
dired-use-ls-dired
'unspecified
)
;; Check whether "ls --dired" gives exit code 0, and
;; Check whether "ls --dired" gives exit code 0, and
;; save the answer in `dired-use-ls-dired'.
;; save the answer in `dired-use-ls-dired'.
(
or
(
setq
dired-use-ls-dired
(
or
(
setq
dired-use-ls-dired
(
eq
0
(
call-process
insert-directory-program
(
eq
0
(
call-process
insert-directory-program
nil
nil
nil
"--dired"
)))
nil
nil
nil
"--dired"
)))
(
progn
(
progn
(
message
"
ls
does
not
support
--dired
; \
(
message
"
ls
does
not
support
--dired
; \
see
`
dired-use-ls-dired
'
for
more
details.
")
see
`
dired-use-ls-dired
'
for
more
details.
")
nil))
nil))
dired-use-ls-dired)
dired-use-ls-dired)))
(file-remote-p dir)))
(setq switches (concat "
--dired
" switches)))
(setq switches (concat "
--dired
" switches)))
;; Expand directory wildcards and fill file-list.
;; Expand directory wildcards and fill file-list.
(let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir)))
(let ((dir-wildcard (insert-directory-wildcard-in-dir-p dir)))
...
@@ -1229,13 +1230,18 @@ see `dired-use-ls-dired' for more details.")
...
@@ -1229,13 +1230,18 @@ see `dired-use-ls-dired' for more details.")
(setq switches (concat "
-d
" switches))
(setq switches (concat "
-d
" switches))
(let ((default-directory (car dir-wildcard))
(let ((default-directory (car dir-wildcard))
(script (format "
ls
%s
%s
" switches (cdr dir-wildcard))))
(script (format "
ls
%s
%s
" switches (cdr dir-wildcard))))
(unless (zerop (process-file "
/bin/sh
" nil (current-buffer) nil "
-c
" script))
(unless
(user-error "
%s:
No
files
matching
wildcard
" (cdr dir-wildcard)))
(zerop
(process-file
"
/bin/sh
" nil (current-buffer) nil "
-c
" script))
(user-error
"
%s:
No
files
matching
wildcard
" (cdr dir-wildcard)))
(insert-directory-clean (point) switches)))
(insert-directory-clean (point) switches)))
(t
(t
;; We used to specify the C locale here, to force English month names;
;; We used to specify the C locale here, to force English
;; but this should not be necessary any more,
;; month names; but this should not be necessary any
;; with the new value of `directory-listing-before-filename-regexp'.
;; more, with the new value of
;; `directory-listing-before-filename-regexp'.
(if file-list
(if file-list
(dolist (f file-list)
(dolist (f file-list)
(let ((beg (point)))
(let ((beg (point)))
...
...
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