`tramp-check-proper-host'. Check for a valid method name.
* net/tramp-adb.el (tramp-adb-maybe-open-connection):
* net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
* net/tramp-sh.el (tramp-maybe-open-connection):
* net/tramp-smb.el (tramp-smb-maybe-open-connection): Call it.
* net/tramp-cache.el (tramp-cache-print): Don't print text properties
also for hash values.
+2013-09-13 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp.el (tramp-check-proper-method-and-host): Rename it from
+ `tramp-check-proper-host'. Check for a valid method name.
+
+ * net/tramp-adb.el (tramp-adb-maybe-open-connection):
+ * net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
+ * net/tramp-sh.el (tramp-maybe-open-connection):
+ * net/tramp-smb.el (tramp-smb-maybe-open-connection): Call it.
+
+ * net/tramp-cache.el (tramp-cache-print): Don't print text properties
+ also for hash values.
+
2013-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
* term/ns-win.el (parameters): Don't declare as dynamic.
"Maybe open a connection VEC.
Does not do anything if a connection is already open, but re-opens the
connection if a previous connection has died for some reason."
- (tramp-check-proper-host vec)
+ (tramp-check-proper-method-and-host vec)
(let* ((buf (tramp-get-connection-buffer vec))
(p (get-buffer-process buf))
(let (result)
(maphash
(lambda (key value)
- ;; Remove text properties from KEY.
- (when (vectorp key)
- (dotimes (i (length key))
- (when (stringp (aref key i))
- (aset key i
- (funcall
- ;; `substring-no-properties' does not exist in XEmacs.
- (if (functionp 'substring-no-properties)
- 'substring-no-properties 'identity)
- (aref key i))))))
+ ;; Remove text properties from KEY and VALUE.
+ ;; `substring-no-properties' does not exist in XEmacs.
+ (when (functionp 'substring-no-properties)
+ (when (vectorp key)
+ (dotimes (i (length key))
+ (when (stringp (aref key i))
+ (aset key i (funcall 'substring-no-properties (aref key i))))))
+ (when (stringp key)
+ (setq key (funcall 'substring-no-properties key)))
+ (when (stringp value)
+ (setq value (funcall 'substring-no-properties value))))
+ ;; Dump.
(let ((tmp (format
"(%s %s)"
(if (processp key)
"Maybe open a connection VEC.
Does not do anything if a connection is already open, but re-opens the
connection if a previous connection has died for some reason."
- (tramp-check-proper-host vec)
+ (tramp-check-proper-method-and-host vec)
;; We set the file name, in case there are incoming D-Bus signals or
;; D-Bus errors.
"Maybe open a connection VEC.
Does not do anything if a connection is already open, but re-opens the
connection if a previous connection has died for some reason."
- (tramp-check-proper-host vec)
+ (tramp-check-proper-method-and-host vec)
(let ((p (tramp-get-connection-process vec))
(process-name (tramp-get-connection-property vec "process-name" nil))
connection if a previous connection has died for some reason.
If ARGUMENT is non-nil, use it as argument for
`tramp-smb-winexe-program', and suppress any checks."
- (tramp-check-proper-host vec)
+ (tramp-check-proper-method-and-host vec)
(let* ((share (tramp-smb-get-share vec))
(buf (tramp-get-connection-buffer vec))
lhost)
tramp-default-host))
-(defun tramp-check-proper-host (vec)
- "Check host name of VEC."
+(defun tramp-check-proper-method-and-host (vec)
+ "Check method and host name of VEC."
(let ((method (tramp-file-name-method vec))
(user (tramp-file-name-user vec))
- (host (tramp-file-name-host vec)))
+ (host (tramp-file-name-host vec))
+ (methods (mapcar 'car tramp-methods)))
+ (when (and method (not (member method methods)))
+ (tramp-cleanup-connection vec)
+ (tramp-user-error vec "Unknown method \"%s\"" method))
(when (and (equal tramp-syntax 'ftp) host
(or (null method) (get-text-property 0 'tramp-default method))
(or (null user) (get-text-property 0 'tramp-default user))
- (member host (mapcar 'car tramp-methods)))
+ (member host methods))
(tramp-cleanup-connection vec)
(tramp-user-error vec "Host name must not match method \"%s\"" host))))