[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d33d8c089b9: Silence compiler error
From: |
Michael Albinus |
Subject: |
master d33d8c089b9: Silence compiler error |
Date: |
Mon, 9 Sep 2024 09:22:50 -0400 (EDT) |
branch: master
commit d33d8c089b909b1fa64a799146557fcb68096269
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Silence compiler error
* lisp/net/tramp.el (tramp-file-name*): Embed `function-put' calls
with `tramp--with-startup'.
(tramp-active-command-completion-p)
* lisp/net/tramp-cache.el (tramp-get-hash-table): Remove declare
form. Add `tramp-suppress-trace' function property.
---
lisp/net/tramp-cache.el | 7 ++++++-
lisp/net/tramp.el | 28 +++++++++++++++++-----------
2 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/lisp/net/tramp-cache.el b/lisp/net/tramp-cache.el
index 2d9d58b51ac..a5bdacb4d91 100644
--- a/lisp/net/tramp-cache.el
+++ b/lisp/net/tramp-cache.el
@@ -131,7 +131,7 @@ details see the info pages."
If it doesn't exist yet, it is created and initialized with
matching entries of `tramp-connection-properties'.
If KEY is `tramp-cache-undefined', don't create anything, and return nil."
- (declare (tramp-suppress-trace t))
+ ;; (declare (tramp-suppress-trace t))
(unless (eq key tramp-cache-undefined)
(or (gethash key tramp-cache-data)
(let ((hash
@@ -144,6 +144,11 @@ If KEY is `tramp-cache-undefined', don't create anything,
and return nil."
(tramp-set-connection-property key (nth 1 elt) (nth 2 elt)))))
hash))))
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-get-hash-table 'tramp-suppress-trace t)
+
;;;###tramp-autoload
(defun tramp-get-file-property (key file property &optional default)
"Get the PROPERTY of FILE from the cache context of KEY.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 709f6458e83..1d9e2c4df04 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1516,17 +1516,18 @@ calling HANDLER.")
;; so .... here we are.
;;;###tramp-autoload(require 'cl-lib)
;;;###tramp-autoload
-(progn
- (cl-defstruct (tramp-file-name (:type list) :named)
- method user domain host port localname hop))
+(cl-defstruct (tramp-file-name (:type list) :named)
+ method user domain host port localname hop)
-(function-put #'tramp-file-name-method 'tramp-suppress-trace t)
-(function-put #'tramp-file-name-user 'tramp-suppress-trace t)
-(function-put #'tramp-file-name-domain 'tramp-suppress-trace t)
-(function-put #'tramp-file-name-host 'tramp-suppress-trace t)
-(function-put #'tramp-file-name-port 'tramp-suppress-trace t)
-(function-put #'tramp-file-name-localname 'tramp-suppress-trace t)
-(function-put #'tramp-file-name-hop 'tramp-suppress-trace t)
+(tramp--with-startup
+ (function-put #'tramp-file-name-method 'tramp-suppress-trace t)
+ (function-put #'tramp-file-name-user 'tramp-suppress-trace t)
+ (function-put #'tramp-file-name-domain 'tramp-suppress-trace t)
+ (function-put #'tramp-file-name-host 'tramp-suppress-trace t)
+ (function-put #'tramp-file-name-port 'tramp-suppress-trace t)
+ (function-put #'tramp-file-name-localname 'tramp-suppress-trace t)
+ (function-put #'tramp-file-name-hop 'tramp-suppress-trace t)
+ (function-put #'make-tramp-file-name 'tramp-suppress-trace t))
;;;###tramp-autoload
(defconst tramp-null-hop
@@ -2715,11 +2716,16 @@ They are completed by `M-x TAB' only if the current
buffer is remote."
(defun tramp-active-command-completion-p (_symbol _buffer)
"A predicate for Tramp interactive commands.
They are completed by `M-x TAB' only if there's an active connection or
buffer."
- (declare (tramp-suppress-trace t))
+ ;; (declare (tramp-suppress-trace t))
(or (and (hash-table-p tramp-cache-data)
(not (zerop (hash-table-count tramp-cache-data))))
(tramp-list-remote-buffers)))
+;; We cannot use the `declare' form for `tramp-suppress-trace' in
+;; autoloaded functions, because the tramp-loaddefs.el generation
+;; would fail.
+(function-put #'tramp-active-command-completion-p 'tramp-suppress-trace t)
+
(defun tramp-connectable-p (vec-or-filename)
"Check if it is possible to connect the remote host without side-effects.
This is true, if either the remote host is already connected, or if we are
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master d33d8c089b9: Silence compiler error,
Michael Albinus <=