summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-archive.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2022-09-09 17:10:28 +0200
committerMichael Albinus <michael.albinus@gmx.de>2022-09-09 17:10:28 +0200
commit08cc6c4d9e42079f88c6c30d9a2324dd6f0cec2b (patch)
treea5f6e5325a24feb9a481df77c20e27e3b42683e7 /lisp/net/tramp-archive.el
parent72c64dd73c93a92f91431435a0295d748588a4ed (diff)
downloademacs-08cc6c4d9e42079f88c6c30d9a2324dd6f0cec2b.tar.gz
emacs-08cc6c4d9e42079f88c6c30d9a2324dd6f0cec2b.tar.bz2
emacs-08cc6c4d9e42079f88c6c30d9a2324dd6f0cec2b.zip
Make use of rx in Tramp backward compatoble
* lisp/net/tramp-compat.el (tramp-compat-rx--runtime-params): New defvar. (tramp-compat-rx--transform-items) (tramp-compat-rx--transform-item, tramp-compat-rx--transform): New defuns. Suggested by Mattias EngdegÄrd <mattiase@acm.org>. (tramp-compat-rx): New defalias or defmacro. (tramp-compat-string-replace, tramp-compat-string-search): Use regexp-quote. * lisp/net/tramp.el: * lisp/net/tramp-adb.el: * lisp/net/tramp-archive.el: * lisp/net/tramp-cmds.el: * lisp/net/tramp-crypt.el: * lisp/net/tramp-fuse.el: * lisp/net/tramp-gvfs.el: * lisp/net/tramp-sh.el: * lisp/net/tramp-smb.el: * lisp/net/tramp-sudoedit.el: Use `tramp-compat-rx' where indicated. * test/lisp/net/tramp-archive-tests.el: * test/lisp/net/tramp-tests.el: Use `tramp-compat-rx' where indicated.
Diffstat (limited to 'lisp/net/tramp-archive.el')
-rw-r--r--lisp/net/tramp-archive.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 21a1e94e418..9ff5d6ac75d 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -184,17 +184,18 @@ It must be supported by libarchive(3).")
;;;###autoload
(progn (defmacro tramp-archive-autoload-file-name-regexp ()
"Regular expression matching archive file names."
- '(rx bos
- ;; This group is used in `tramp-archive-file-name-archive'.
- (group
- (+ nonl)
- ;; Default suffixes ...
- "." (regexp (regexp-opt tramp-archive-suffixes))
- ;; ... with compression.
- (? "." (regexp (regexp-opt tramp-archive-compression-suffixes))))
- ;; This group is used in `tramp-archive-file-name-localname'.
- (group "/" (* nonl))
- eos)))
+ `(rx
+ bos
+ ;; This group is used in `tramp-archive-file-name-archive'.
+ (group
+ (+ nonl)
+ ;; Default suffixes ...
+ "." ,(cons '| tramp-archive-suffixes)
+ ;; ... with compression.
+ (? "." ,(cons '| tramp-archive-compression-suffixes)))
+ ;; This group is used in `tramp-archive-file-name-localname'.
+ (group "/" (* nonl))
+ eos)))
(put #'tramp-archive-autoload-file-name-regexp 'tramp-autoload t)