Make tramp-archive autoloads robust for older Emacs versions
* lisp/net/tramp-archive.el (tramp-archive-file-name-regexp): Use `eval-when-compile'. Set it explicitly for older Emacs versions.
This commit is contained in:
parent
3941cc29df
commit
50d18bb6ea
1 changed files with 8 additions and 1 deletions
|
@ -215,11 +215,18 @@ It must be supported by libarchive(3).")
|
||||||
;; In older Emacs (prior 27.1), `tramp-archive-autoload-file-name-regexp'
|
;; In older Emacs (prior 27.1), `tramp-archive-autoload-file-name-regexp'
|
||||||
;; is not autoloaded. So we cannot expect it to be known in
|
;; is not autoloaded. So we cannot expect it to be known in
|
||||||
;; tramp-loaddefs.el. But it exists, when tramp-archive.el is loaded.
|
;; tramp-loaddefs.el. But it exists, when tramp-archive.el is loaded.
|
||||||
|
;; We must wrap it into `eval-when-compile'. Otherwise, there could
|
||||||
|
;; be an "Eager macro-expansion failure" when unloading/reloading Tramp.
|
||||||
;;;###tramp-autoload
|
;;;###tramp-autoload
|
||||||
(defconst tramp-archive-file-name-regexp
|
(defconst tramp-archive-file-name-regexp
|
||||||
(ignore-errors (tramp-archive-autoload-file-name-regexp))
|
(eval-when-compile (ignore-errors (tramp-archive-autoload-file-name-regexp)))
|
||||||
"Regular expression matching archive file names.")
|
"Regular expression matching archive file names.")
|
||||||
|
|
||||||
|
;; The value above is nil for Emacs 26. Set it now.
|
||||||
|
(if (<= emacs-major-version 26)
|
||||||
|
(setq tramp-archive-file-name-regexp
|
||||||
|
(ignore-errors (tramp-archive-autoload-file-name-regexp))))
|
||||||
|
|
||||||
;;;###tramp-autoload
|
;;;###tramp-autoload
|
||||||
(defconst tramp-archive-method "archive"
|
(defconst tramp-archive-method "archive"
|
||||||
"Method name for archives in GVFS.")
|
"Method name for archives in GVFS.")
|
||||||
|
|
Loading…
Add table
Reference in a new issue