mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-13 15:39:02 +00:00
Require ls-lisp in Tramp only when needed
* lisp/net/tramp-compat.el (ls-lisp): Require only on MS Windows. (Bug#64124) * lisp/net/tramp-sh.el (ls-lisp-use-insert-directory-program): Declare. (tramp-sh-handle-insert-directory): Simplify. * lisp/net/tramp.el (ls-lisp-use-insert-directory-program): Declare. (tramp-handle-insert-directory): Require ls-lisp. Simplify.
This commit is contained in:
parent
3d930b928f
commit
948b471756
3 changed files with 7 additions and 3 deletions
|
@ -31,11 +31,13 @@
|
||||||
|
|
||||||
(require 'auth-source)
|
(require 'auth-source)
|
||||||
(require 'format-spec)
|
(require 'format-spec)
|
||||||
(require 'ls-lisp) ;; Due to `tramp-handle-insert-directory'.
|
|
||||||
(require 'parse-time)
|
(require 'parse-time)
|
||||||
(require 'shell)
|
(require 'shell)
|
||||||
(require 'subr-x)
|
(require 'subr-x)
|
||||||
|
|
||||||
|
(when (memq system-type '(ms-dos windows-nt))
|
||||||
|
(require 'ls-lisp))
|
||||||
|
|
||||||
(declare-function tramp-compat-rx "tramp")
|
(declare-function tramp-compat-rx "tramp")
|
||||||
(declare-function tramp-error "tramp")
|
(declare-function tramp-error "tramp")
|
||||||
(declare-function tramp-file-name-handler "tramp")
|
(declare-function tramp-file-name-handler "tramp")
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
(declare-function dired-compress-file "dired-aux")
|
(declare-function dired-compress-file "dired-aux")
|
||||||
(declare-function dired-remove-file "dired-aux")
|
(declare-function dired-remove-file "dired-aux")
|
||||||
(defvar dired-compress-file-suffixes)
|
(defvar dired-compress-file-suffixes)
|
||||||
|
(defvar ls-lisp-use-insert-directory-program)
|
||||||
;; Added in Emacs 28.1.
|
;; Added in Emacs 28.1.
|
||||||
(defvar process-file-return-signal-string)
|
(defvar process-file-return-signal-string)
|
||||||
(defvar vc-handled-backends)
|
(defvar vc-handled-backends)
|
||||||
|
@ -2659,7 +2660,7 @@ The method used must be an out-of-band method."
|
||||||
(access-file filename "Reading directory"))
|
(access-file filename "Reading directory"))
|
||||||
(with-parsed-tramp-file-name (expand-file-name filename) nil
|
(with-parsed-tramp-file-name (expand-file-name filename) nil
|
||||||
(if (and (featurep 'ls-lisp)
|
(if (and (featurep 'ls-lisp)
|
||||||
(not (symbol-value 'ls-lisp-use-insert-directory-program)))
|
(not ls-lisp-use-insert-directory-program))
|
||||||
(tramp-handle-insert-directory
|
(tramp-handle-insert-directory
|
||||||
filename switches wildcard full-directory-p)
|
filename switches wildcard full-directory-p)
|
||||||
(when (stringp switches)
|
(when (stringp switches)
|
||||||
|
|
|
@ -63,6 +63,7 @@
|
||||||
(declare-function file-notify-rm-watch "filenotify")
|
(declare-function file-notify-rm-watch "filenotify")
|
||||||
(declare-function netrc-parse "netrc")
|
(declare-function netrc-parse "netrc")
|
||||||
(defvar auto-save-file-name-transforms)
|
(defvar auto-save-file-name-transforms)
|
||||||
|
(defvar ls-lisp-use-insert-directory-program)
|
||||||
|
|
||||||
;; Reload `tramp-compat' when we reload `tramp-autoloads' of the GNU
|
;; Reload `tramp-compat' when we reload `tramp-autoloads' of the GNU
|
||||||
;; ELPA package.
|
;; ELPA package.
|
||||||
|
@ -4181,6 +4182,7 @@ Let-bind it when necessary.")
|
||||||
(defun tramp-handle-insert-directory
|
(defun tramp-handle-insert-directory
|
||||||
(filename switches &optional wildcard full-directory-p)
|
(filename switches &optional wildcard full-directory-p)
|
||||||
"Like `insert-directory' for Tramp files."
|
"Like `insert-directory' for Tramp files."
|
||||||
|
(require 'ls-lisp)
|
||||||
(unless switches (setq switches ""))
|
(unless switches (setq switches ""))
|
||||||
;; Mark trailing "/".
|
;; Mark trailing "/".
|
||||||
(when (and (directory-name-p filename)
|
(when (and (directory-name-p filename)
|
||||||
|
@ -4193,7 +4195,6 @@ Let-bind it when necessary.")
|
||||||
(with-tramp-progress-reporter v 0 (format "Opening directory %s" filename)
|
(with-tramp-progress-reporter v 0 (format "Opening directory %s" filename)
|
||||||
(let (ls-lisp-use-insert-directory-program start)
|
(let (ls-lisp-use-insert-directory-program start)
|
||||||
;; Silence byte compiler.
|
;; Silence byte compiler.
|
||||||
(ignore ls-lisp-use-insert-directory-program)
|
|
||||||
(tramp-run-real-handler
|
(tramp-run-real-handler
|
||||||
#'insert-directory
|
#'insert-directory
|
||||||
(list filename switches wildcard full-directory-p))
|
(list filename switches wildcard full-directory-p))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue