]> git.eshelyaron.com Git - emacs.git/commitdiff
Improve Tramp's initial warnings
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 3 Apr 2025 12:57:06 +0000 (14:57 +0200)
committerEshel Yaron <me@eshelyaron.com>
Tue, 8 Apr 2025 05:36:04 +0000 (07:36 +0200)
* lisp/net/tramp-cache.el (tramp-dump-connection-properties):
Adapt comment.

* lisp/net/tramp-compat.el (tramp-warning): Declare and use it.

* lisp/net/tramp-message.el (tramp-warning): Declare `indent'.

(cherry picked from commit fd5f817882a81b6f64471971c88bdd3d0c126956)

lisp/net/tramp-cache.el
lisp/net/tramp-compat.el
lisp/net/tramp-message.el

index 7512a77c79987256faabc991e4a29ed9886f1c28..0078a2ed38bc954bba1f7d20502220071ab2714f 100644 (file)
@@ -590,12 +590,11 @@ PROPERTIES is a list of file properties (strings)."
            print-length print-level)
        ;; Remove `tramp-null-hop'.
        (remhash tramp-null-hop cache)
-       ;; Remove temporary data.  If there is the key "login-as", we
-       ;; don't save either, because all other properties might
-       ;; depend on the login name, and we want to give the
-       ;; possibility to use another login name later on.  Key
-       ;; "started" exists for the "ftp" method only, which must not
-       ;; be kept persistent.
+       ;; If there is the key "login-as", we don't save, because all
+       ;; other properties might depend on the login name, and we
+       ;; want to give the possibility to use another login name
+       ;; later on.  Key "started" exists for the "ftp" method only,
+       ;; which must not be kept persistent.
        (maphash
         (lambda (key value)
           (if (and (tramp-file-name-p key) (hash-table-p value)
index 7ed9e0d6fca1ca1ff5823fa9c551cf9ee040e437..5d1e4e973a765141c18a36d02456e55164eb8bb9 100644 (file)
 (require 'xdg)
 
 (declare-function tramp-error "tramp-message")
+(declare-function tramp-warning "tramp-message")
 (declare-function tramp-tramp-file-p "tramp")
 (defvar tramp-temp-name-prefix)
 
 (defconst tramp-compat-emacs-compiled-version (eval-when-compile emacs-version)
   "The Emacs version used for compilation.")
 
-(unless (= emacs-major-version
-          (car (version-to-list tramp-compat-emacs-compiled-version)))
-  (lwarn 'tramp :warning
-        "Tramp has been compiled with Emacs %s, this is Emacs %s"
-       tramp-compat-emacs-compiled-version emacs-version))
-
-(with-eval-after-load 'docker-tramp
-  (lwarn 'tramp :warning
-        (concat "Package `docker-tramp' has been obsoleted, "
-                "please use integrated package `tramp-container'")))
-(with-eval-after-load 'kubernetes-tramp
-  (lwarn 'tramp :warning
-        (concat "Package `kubernetes-tramp' has been obsoleted, "
-                "please use integrated package `tramp-container'")))
-(with-eval-after-load 'tramp-nspawn
-  (lwarn 'tramp :warning
-        (concat "Package `tramp-nspawn' has been obsoleted, "
-                "please use integrated package `tramp-container'")))
+(with-eval-after-load 'tramp
+  (unless (= emacs-major-version
+            (car (version-to-list tramp-compat-emacs-compiled-version)))
+    (tramp-warning nil
+      "Tramp has been compiled with Emacs %s, this is Emacs %s"
+      tramp-compat-emacs-compiled-version emacs-version))
+
+  (with-eval-after-load 'docker-tramp
+    (tramp-warning nil
+      (concat "Package `docker-tramp' has been obsoleted, "
+             "please use integrated package `tramp-container'")))
+
+  (with-eval-after-load 'kubernetes-tramp
+    (tramp-warning nil
+      (concat "Package `kubernetes-tramp' has been obsoleted, "
+             "please use integrated package `tramp-container'")))
+
+  (with-eval-after-load 'tramp-nspawn
+    (tramp-warning nil
+      (concat "Package `tramp-nspawn' has been obsoleted, "
+             "please use integrated package `tramp-container'"))))
 
 ;; For not existing functions, obsolete functions, or functions with a
 ;; changed argument list, there are compiler warnings.  We want to
index 9135522a51e67349f27a56e3ad72c4206de59715..cf75d60e32faeea40e115ed0061e5b13c43ac4d5 100644 (file)
@@ -462,7 +462,7 @@ the resulting error message."
   "Show a warning.
 VEC-OR-PROC identifies the connection to use, remaining arguments passed
 to `tramp-message'."
-  (declare (tramp-suppress-trace t))
+  (declare (indent 1) (tramp-suppress-trace t))
   (let (signal-hook-function)
     (apply 'tramp-message vec-or-proc 2 fmt-string arguments)
     (apply 'lwarn 'tramp :warning fmt-string arguments)))