aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-10-23 17:58:52 +0200
committerMichael Albinus2017-10-23 17:58:52 +0200
commit529a9c09d3f6b5d5a61b81b306bdb8ffa0da50f0 (patch)
tree362848eae5306baac1a8eb35d40aff3e716b3e24
parentc6deabaf4d77fb3ed137c0dbabf98a420cc5c7f9 (diff)
downloademacs-529a9c09d3f6b5d5a61b81b306bdb8ffa0da50f0.tar.gz
emacs-529a9c09d3f6b5d5a61b81b306bdb8ffa0da50f0.zip
Further work on Bug#28889
* lisp/net/tramp.el (tramp-set-syntax): New defun. (tramp-syntax): Use it. Change :package-version. (Bug#28889)
-rw-r--r--lisp/net/tramp.el74
1 files changed, 40 insertions, 34 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5a59dd622dd..736c28c4aa8 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -674,48 +674,54 @@ Do not change the value by `setq', it must be changed only by
674`custom-set-variables'. See also `tramp-change-syntax'." 674`custom-set-variables'. See also `tramp-change-syntax'."
675 :group 'tramp 675 :group 'tramp
676 :version "26.1" 676 :version "26.1"
677 :package-version '(Tramp . "2.3.2") 677 :package-version '(Tramp . "2.3.3")
678 :type '(choice (const :tag "Default" default) 678 :type '(choice (const :tag "Default" default)
679 (const :tag "Ange-FTP" simplified) 679 (const :tag "Ange-FTP" simplified)
680 (const :tag "XEmacs" separate)) 680 (const :tag "XEmacs" separate))
681 :require 'tramp 681 :require 'tramp
682 :initialize 'custom-initialize-set 682 :initialize 'custom-initialize-set
683 :set (lambda (symbol value) 683 :set 'tramp-set-syntax)
684 ;; Check allowed values. 684
685 (unless (memq value (tramp-syntax-values)) 685(defun tramp-set-syntax (symbol value)
686 (tramp-compat-user-error "Wrong `tramp-syntax' %s" tramp-syntax)) 686 "Set SYMBOL to value VALUE.
687 ;; Cleanup existing buffers. 687Used in user option `tramp-syntax'. There are further variables
688 (unless (eq (symbol-value symbol) value) 688to be set, depending on VALUE."
689 (tramp-cleanup-all-buffers)) 689 ;; Check allowed values.
690 ;; Set the value: 690 (unless (memq value (tramp-syntax-values))
691 (set-default symbol value) 691 (tramp-compat-user-error "Wrong `tramp-syntax' %s" tramp-syntax))
692 ;; Reset the depending variables. 692 ;; Cleanup existing buffers.
693 (with-no-warnings 693 (unless (eq (symbol-value symbol) value)
694 (setq tramp-prefix-format (tramp-build-prefix-format) 694 (tramp-cleanup-all-buffers))
695 tramp-prefix-regexp (tramp-build-prefix-regexp) 695 ;; Set the value:
696 tramp-method-regexp (tramp-build-method-regexp) 696 (set-default symbol value)
697 tramp-postfix-method-format (tramp-build-postfix-method-format) 697 ;; Reset the depending variables.
698 tramp-postfix-method-regexp (tramp-build-postfix-method-regexp) 698 (with-no-warnings
699 tramp-prefix-ipv6-format (tramp-build-prefix-ipv6-format) 699 (setq tramp-prefix-format (tramp-build-prefix-format)
700 tramp-prefix-ipv6-regexp (tramp-build-prefix-ipv6-regexp) 700 tramp-prefix-regexp (tramp-build-prefix-regexp)
701 tramp-postfix-ipv6-format (tramp-build-postfix-ipv6-format) 701 tramp-method-regexp (tramp-build-method-regexp)
702 tramp-postfix-ipv6-regexp (tramp-build-postfix-ipv6-regexp) 702 tramp-postfix-method-format (tramp-build-postfix-method-format)
703 tramp-postfix-host-format (tramp-build-postfix-host-format) 703 tramp-postfix-method-regexp (tramp-build-postfix-method-regexp)
704 tramp-postfix-host-regexp (tramp-build-postfix-host-regexp) 704 tramp-prefix-ipv6-format (tramp-build-prefix-ipv6-format)
705 tramp-remote-file-name-spec-regexp 705 tramp-prefix-ipv6-regexp (tramp-build-prefix-ipv6-regexp)
706 (tramp-build-remote-file-name-spec-regexp) 706 tramp-postfix-ipv6-format (tramp-build-postfix-ipv6-format)
707 tramp-file-name-structure (tramp-build-file-name-structure) 707 tramp-postfix-ipv6-regexp (tramp-build-postfix-ipv6-regexp)
708 tramp-file-name-regexp (tramp-build-file-name-regexp) 708 tramp-postfix-host-format (tramp-build-postfix-host-format)
709 tramp-completion-file-name-regexp 709 tramp-postfix-host-regexp (tramp-build-postfix-host-regexp)
710 (tramp-build-completion-file-name-regexp))) 710 tramp-remote-file-name-spec-regexp
711 ;; Rearrange file name handlers. 711 (tramp-build-remote-file-name-spec-regexp)
712 (tramp-register-file-name-handlers))) 712 tramp-file-name-structure (tramp-build-file-name-structure)
713 tramp-file-name-regexp (tramp-build-file-name-regexp)
714 tramp-completion-file-name-regexp
715 (tramp-build-completion-file-name-regexp)))
716 ;; Rearrange file name handlers.
717 (tramp-register-file-name-handlers))
713 718
714;; Initialize the Tramp syntax variables. We want to override initial 719;; Initialize the Tramp syntax variables. We want to override initial
715;; values of `tramp-file-name-regexp' and 720;; value of `tramp-file-name-regexp'. Other Tramp syntax variables
716;; `tramp-completion-file-name-regexp'. 721;; must be initialized as well to proper values. We do not call
722;; `custom-set-variable', this would load Tramp via custom.el.
717(eval-after-load 'tramp 723(eval-after-load 'tramp
718 '(custom-set-variables `(tramp-syntax ',(tramp-compat-tramp-syntax)))) 724 '(tramp-set-syntax 'tramp-syntax (tramp-compat-tramp-syntax)))
719 725
720(defun tramp-syntax-values () 726(defun tramp-syntax-values ()
721 "Return possible values of `tramp-syntax', a list" 727 "Return possible values of `tramp-syntax', a list"