diff options
author | Michael Albinus <michael.albinus@gmx.de> | 2017-10-23 14:05:49 +0200 |
---|---|---|
committer | Michael Albinus <michael.albinus@gmx.de> | 2017-10-23 14:05:49 +0200 |
commit | c6deabaf4d77fb3ed137c0dbabf98a420cc5c7f9 (patch) | |
tree | 8abf856be805de23e70d9ba0f0646357706e8d0f /lisp/net/tramp-compat.el | |
parent | 8093e82e429d598d72ae7e51d4a2d5a49d98902e (diff) | |
download | emacs-c6deabaf4d77fb3ed137c0dbabf98a420cc5c7f9.tar.gz |
Improve Tramp backward compatibility
* lisp/net/tramp-compat.el (tramp-compat-tramp-file-name-slots):
New defmacro.
* lisp/net/tramp.el (with-parsed-tramp-file-name): Use it.
Diffstat (limited to 'lisp/net/tramp-compat.el')
-rw-r--r-- | lisp/net/tramp-compat.el | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 214ad040a17..9326f7b1864 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -235,6 +235,12 @@ If NAME is a remote file name, the local part of NAME is unquoted." ((eq tramp-syntax 'sep) 'separate) (t tramp-syntax))) +;; `cl-struct-slot-info' has been introduced with Emacs 25. +(defmacro tramp-compat-tramp-file-name-slots () + (if (fboundp 'cl-struct-slot-info) + `(cdr (mapcar 'car (cl-struct-slot-info 'tramp-file-name))) + `(cdr (mapcar 'car (get 'tramp-file-name 'cl-struct-slots))))) + (provide 'tramp-compat) ;;; TODO: |