]> git.eshelyaron.com Git - emacs.git/commitdiff
tramp: Tweak the ls-lisp declarations
authorStefan Monnier <monnier@iro.umontreal.ca>
Sun, 4 Feb 2024 04:05:03 +0000 (23:05 -0500)
committerEshel Yaron <me@eshelyaron.com>
Sun, 4 Feb 2024 11:05:49 +0000 (12:05 +0100)
* lisp/net/tramp-sh.el (ls-lisp-use-insert-directory-program): Don't
declare its existence...
(tramp-sh-handle-insert-directory): ...test it instead.

* lisp/net/tramp.el (ls-lisp-dirs-first, ls-lisp-emulation)
(ls-lisp-ignore-case, ls-lisp-use-insert-directory-program)
(ls-lisp-verbosity): Move declaration...
(tramp-handle-insert-directory): ...to the point where we have a good
reason to think these variables exist.

(cherry picked from commit 45125e019c3698ff74ccb2183b789c25f9d3f574)

lisp/net/tramp-sh.el
lisp/net/tramp.el

index 526cc6e3fd2319791c862aa68c132a1472a1d8c9..a29507b539977a35cbd649ce456532be733f1ece 100644 (file)
@@ -38,7 +38,6 @@
 (declare-function dired-compress-file "dired-aux")
 (declare-function dired-remove-file "dired-aux")
 (defvar dired-compress-file-suffixes)
-(defvar ls-lisp-use-insert-directory-program)
 ;; Added in Emacs 28.1.
 (defvar process-file-return-signal-string)
 (defvar vc-handled-backends)
@@ -2647,7 +2646,7 @@ The method used must be an out-of-band method."
 (defun tramp-sh-handle-insert-directory
     (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for Tramp files."
-  (if (and (featurep 'ls-lisp)
+  (if (and (boundp 'ls-lisp-use-insert-directory-program)
           (not ls-lisp-use-insert-directory-program))
       (tramp-handle-insert-directory
        filename switches wildcard full-directory-p)
index 9b8a5ddc350f8c1e3bed88a53c78d0b34b4cb313..c4e4229b82f7df80136b668abd4631b8deabcffe 100644 (file)
 (declare-function file-notify-rm-watch "filenotify")
 (declare-function netrc-parse "netrc")
 (defvar auto-save-file-name-transforms)
-(defvar ls-lisp-dirs-first)
-(defvar ls-lisp-emulation)
-(defvar ls-lisp-ignore-case)
-(defvar ls-lisp-use-insert-directory-program)
-(defvar ls-lisp-verbosity)
 (defvar tramp-prefix-format)
 (defvar tramp-prefix-regexp)
 (defvar tramp-method-regexp)
@@ -4190,6 +4185,11 @@ Let-bind it when necessary.")
     (filename switches &optional wildcard full-directory-p)
   "Like `insert-directory' for Tramp files."
   (require 'ls-lisp)
+  (defvar ls-lisp-dirs-first)
+  (defvar ls-lisp-emulation)
+  (defvar ls-lisp-ignore-case)
+  (defvar ls-lisp-use-insert-directory-program)
+  (defvar ls-lisp-verbosity)
   (unless switches (setq switches ""))
   ;; Mark trailing "/".
   (when (and (directory-name-p filename)