mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2025-01-07 15:21:46 +00:00
Restore tramp-achive's Emacs 26 compatibility
* lisp/net/tramp-archive.el (tramp-archive-autoload-file-name-regexp): Special handling of Emacs 26. Simplify the other part. * test/lisp/net/tramp-tests.el (tramp-test48-unload): Special case of `tramp-register-archive-file-name-handler'.
This commit is contained in:
parent
9f4306cd8d
commit
1524fe427d
@ -183,23 +183,32 @@ It must be supported by libarchive(3).")
|
|||||||
;; The definition of `tramp-archive-file-name-regexp' contains calls
|
;; The definition of `tramp-archive-file-name-regexp' contains calls
|
||||||
;; to `regexp-opt', which cannot be autoloaded while loading
|
;; to `regexp-opt', which cannot be autoloaded while loading
|
||||||
;; loaddefs.el. So we use a macro, which is evaluated only when needed.
|
;; loaddefs.el. So we use a macro, which is evaluated only when needed.
|
||||||
;; When tramp-archive.el is unloaded and reloaded, it gripes about
|
;; Emacs 26 and earlier cannot use the autoload form
|
||||||
;; missing `tramp-archive{-compression]-suffixes'. We protect this.
|
;; `tramp-compat-rx'. So we refrain from using `rx'.
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(progn (defmacro tramp-archive-autoload-file-name-regexp ()
|
(progn (defmacro tramp-archive-autoload-file-name-regexp ()
|
||||||
"Regular expression matching archive file names."
|
"Regular expression matching archive file names."
|
||||||
`(tramp-compat-rx
|
(if (<= emacs-major-version 26)
|
||||||
|
'(concat
|
||||||
|
"\\`" "\\(" ".+" "\\."
|
||||||
|
;; Default suffixes ...
|
||||||
|
(regexp-opt tramp-archive-suffixes)
|
||||||
|
;; ... with compression.
|
||||||
|
"\\(?:" "\\." (regexp-opt tramp-archive-compression-suffixes) "\\)*"
|
||||||
|
"\\)" ;; \1
|
||||||
|
"\\(" "/" ".*" "\\)" "\\'") ;; \2
|
||||||
|
`(rx
|
||||||
bos
|
bos
|
||||||
;; This group is used in `tramp-archive-file-name-archive'.
|
;; This group is used in `tramp-archive-file-name-archive'.
|
||||||
(group
|
(group
|
||||||
(+ nonl)
|
(+ nonl)
|
||||||
;; Default suffixes ...
|
;; Default suffixes ...
|
||||||
"." ,(cons '| (bound-and-true-p tramp-archive-suffixes))
|
"." (| ,@tramp-archive-suffixes)
|
||||||
;; ... with compression.
|
;; ... with compression.
|
||||||
(? "." ,(cons '| (bound-and-true-p tramp-archive-compression-suffixes))))
|
(? "." (| ,@tramp-archive-compression-suffixes)))
|
||||||
;; This group is used in `tramp-archive-file-name-localname'.
|
;; This group is used in `tramp-archive-file-name-localname'.
|
||||||
(group "/" (* nonl))
|
(group "/" (* nonl))
|
||||||
eos)))
|
eos))))
|
||||||
|
|
||||||
(put #'tramp-archive-autoload-file-name-regexp 'tramp-autoload t)
|
(put #'tramp-archive-autoload-file-name-regexp 'tramp-autoload t)
|
||||||
|
|
||||||
|
@ -7630,6 +7630,9 @@ Since it unloads Tramp, it shall be the last test to run."
|
|||||||
(string-prefix-p "tramp" (symbol-name x))
|
(string-prefix-p "tramp" (symbol-name x))
|
||||||
;; `tramp-completion-mode' is autoloaded in Emacs < 28.1.
|
;; `tramp-completion-mode' is autoloaded in Emacs < 28.1.
|
||||||
(not (eq 'tramp-completion-mode x))
|
(not (eq 'tramp-completion-mode x))
|
||||||
|
;; `tramp-register-archive-file-name-handler' is autoloaded
|
||||||
|
;; in Emacs < 29.1.
|
||||||
|
(not (eq 'tramp-register-archive-file-name-handler x))
|
||||||
(not (string-match-p
|
(not (string-match-p
|
||||||
(rx bol "tramp" (? "-archive") (** 1 2 "-") "test")
|
(rx bol "tramp" (? "-archive") (** 1 2 "-") "test")
|
||||||
(symbol-name x)))
|
(symbol-name x)))
|
||||||
|
Loading…
Reference in New Issue
Block a user