[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master a5841b196f: Do not register Tramp file name handlers twice
From: |
Michael Albinus |
Subject: |
master a5841b196f: Do not register Tramp file name handlers twice |
Date: |
Mon, 28 Mar 2022 06:02:33 -0400 (EDT) |
branch: master
commit a5841b196f12894df4c1bb073f28ddadb6faa3cf
Author: Michael Albinus <michael.albinus@gmx.de>
Commit: Michael Albinus <michael.albinus@gmx.de>
Do not register Tramp file name handlers twice
* lisp/net/tramp.el (tramp-register-autoload-file-name-handlers):
* lisp/net/tramp-archive.el (tramp-register-archive-file-name-handler):
Check, whether the real file name handler is already registered.
---
lisp/net/tramp-archive.el | 4 +++-
lisp/net/tramp.el | 9 +++++----
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/lisp/net/tramp-archive.el b/lisp/net/tramp-archive.el
index 788e457367..890c8dbb75 100644
--- a/lisp/net/tramp-archive.el
+++ b/lisp/net/tramp-archive.el
@@ -374,7 +374,9 @@ arguments to pass to the OPERATION."
;;;###autoload
(progn (defun tramp-register-archive-file-name-handler ()
"Add archive file name handler to `file-name-handler-alist'."
- (when tramp-archive-enabled
+ (when (and tramp-archive-enabled
+ (not
+ (rassq #'tramp-archive-file-name-handler
file-name-handler-alist)))
(add-to-list 'file-name-handler-alist
(cons (tramp-archive-autoload-file-name-regexp)
#'tramp-archive-autoload-file-name-handler))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 0192a63a10..580cfea1f8 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2756,10 +2756,11 @@ Falls back to normal file name handler if no Tramp file
name handler exists."
;;;###autoload
(progn (defun tramp-register-autoload-file-name-handlers ()
"Add Tramp file name handlers to `file-name-handler-alist' during autoload."
- (add-to-list 'file-name-handler-alist
- (cons tramp-autoload-file-name-regexp
- #'tramp-autoload-file-name-handler))
- (put #'tramp-autoload-file-name-handler 'safe-magic t)))
+ (unless (rassq #'tramp-file-name-handler file-name-handler-alist)
+ (add-to-list 'file-name-handler-alist
+ (cons tramp-autoload-file-name-regexp
+ #'tramp-autoload-file-name-handler))
+ (put #'tramp-autoload-file-name-handler 'safe-magic t))))
(put #'tramp-register-autoload-file-name-handlers 'tramp-autoload t)
;;;###autoload (tramp-register-autoload-file-name-handlers)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master a5841b196f: Do not register Tramp file name handlers twice,
Michael Albinus <=