]> git.eshelyaron.com Git - emacs.git/commitdiff
Check Emacs version used for Tramp compilation
authorMichael Albinus <michael.albinus@gmx.de>
Thu, 1 Oct 2020 10:16:59 +0000 (12:16 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 1 Oct 2020 10:16:59 +0000 (12:16 +0200)
* lisp/net/tramp-compat.el (tramp-compat-emacs-compiled-version):
New defconst.  Raise a warning, when it is not equal to the Emacs
version.

lisp/net/tramp-compat.el

index 3f25afedb9931ea968b0d60ff1f79988e4996857..b7a7cc4f00362d1f1bbdd1e35bf84fdde0e87b56 100644 (file)
 ;; `temporary-file-directory' as function is introduced with Emacs 26.1.
 (declare-function tramp-handle-temporary-file-directory "tramp")
 
+(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)))
+  (warn "Tramp has been compiled with Emacs %s, this is Emacs %s"
+       tramp-compat-emacs-compiled-version emacs-version))
+
 ;; For not existing functions, obsolete functions, or functions with a
 ;; changed argument list, there are compiler warnings.  We want to
 ;; avoid them in cases we know what we do.