[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit d74494f833 3/3: magit--with-connection-local-va
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit d74494f833 3/3: magit--with-connection-local-variables: Silence byte-compiler |
Date: |
Sun, 23 Jan 2022 23:58:08 -0500 (EST) |
branch: elpa/git-commit
commit d74494f833c8d4b55b2f02462e64d890556c375c
Author: Kyle Meyer <kyle@kyleam.com>
Commit: Kyle Meyer <kyle@kyleam.com>
magit--with-connection-local-variables: Silence byte-compiler
With Emacs versions before 27.1, spots that use the recently added
magit--with-connection-local-variables compatibility kludge trigger
byte-compiler warnings about tramp-dissect-file-name and
tramp-get-method-parameter being unknown functions. Given that this
code is executed only when `file-remote-p' returns non-nil, I suspect
that in practice it is unreachable without Tramp loaded, but load
Tramp explicitly to be sure.
---
lisp/magit-utils.el | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/lisp/magit-utils.el b/lisp/magit-utils.el
index 92d62e0aaa..d028dd4a5e 100644
--- a/lisp/magit-utils.el
+++ b/lisp/magit-utils.el
@@ -1220,14 +1220,16 @@ This kludge provides the minimal functionality required
by
Magit."
`(if (file-remote-p default-directory)
(pcase-let ((`(,shell-file-name ,shell-command-switch)
- (let ((vec (tramp-dissect-file-name
- default-directory)))
- (list (tramp-get-method-parameter
- vec 'tramp-remote-shell)
- (mapconcat #'identity
- (tramp-get-method-parameter
- vec 'tramp-remote-shell-args)
- " ")))))
+ (with-no-warnings ; about unknown tramp functions
+ (require 'tramp)
+ (let ((vec (tramp-dissect-file-name
+ default-directory)))
+ (list (tramp-get-method-parameter
+ vec 'tramp-remote-shell)
+ (mapconcat #'identity
+ (tramp-get-method-parameter
+ vec 'tramp-remote-shell-args)
+ " "))))))
,@body)
,@body)))