(lambda (string1 string2)
(eq t (compare-strings string1 nil nil string2 nil nil t)))))
+;; Function `auth-source-netrc-parse-all' is new in Emacs 29.1.
+;; `netrc-parse' has been obsoleted in parallel.
+(defalias 'tramp-compat-auth-source-netrc-parse-all
+ (if (fboundp 'auth-source-netrc-parse-all)
+ #'auth-source-netrc-parse-all
+ (lambda (&optional file)
+ (declare-function netrc-parse "netrc")
+ (autoload 'netrc-parse "netrc")
+ (netrc-parse file))))
+
(dolist (elt (all-completions "tramp-compat-" obarray 'functionp))
(put (intern elt) 'tramp-suppress-trace t))
(defun tramp-parse-netrc (filename)
"Return a list of (user host) tuples allowed to access.
User may be nil."
- ;; The declaration is not sufficient at runtime, because netrc.el is
- ;; not autoloaded.
(mapcar
(lambda (item)
(and (assoc "machine" item)
`(,(cdr (assoc "login" item)) ,(cdr (assoc "machine" item)))))
- (auth-source-netrc-parse-all filename)))
+ (tramp-compat-auth-source-netrc-parse-all filename)))
(defun tramp-parse-putty (registry-or-dirname)
"Return a list of (user host) tuples allowed to access.