summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2013-03-18 14:04:13 +0100
committerMichael Albinus <michael.albinus@gmx.de>2013-03-18 14:04:13 +0100
commit64ab82d1da79084384d27d366b4cfc41f7cae5b6 (patch)
tree6bc9b95f784543b4683863e32e8c0a0e47210d81
parent0cb77136f890bc9db5c3f928ae39a8e8111fc4d4 (diff)
downloademacs-64ab82d1da79084384d27d366b4cfc41f7cae5b6.tar.gz
* net/tramp-compat.el (tramp-compat-user-error): New defun.
* net/tramp-adb.el (tramp-adb-handle-shell-command): * net/tramp-gvfs.el (top): * net/tramp.el (tramp-find-method, tramp-dissect-file-name) (tramp-handle-shell-command): Use it. (tramp-dissect-file-name): Raise an error when hostname is a method name, and neither method nor user is specified. * net/trampver.el: Update release number.
-rw-r--r--lisp/ChangeLog13
-rw-r--r--lisp/net/tramp-adb.el2
-rw-r--r--lisp/net/tramp-compat.el5
-rw-r--r--lisp/net/tramp-gvfs.el2
-rw-r--r--lisp/net/tramp.el13
-rw-r--r--lisp/net/trampver.el4
6 files changed, 31 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7bd027a81d4..bd1cbbcf5bb 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,16 @@
+2013-03-18 Michael Albinus <michael.albinus@gmx.de>
+
+ * net/tramp-compat.el (tramp-compat-user-error): New defun.
+
+ * net/tramp-adb.el (tramp-adb-handle-shell-command):
+ * net/tramp-gvfs.el (top):
+ * net/tramp.el (tramp-find-method, tramp-dissect-file-name)
+ (tramp-handle-shell-command): Use it.
+ (tramp-dissect-file-name): Raise an error when hostname is a
+ method name, and neither method nor user is specified.
+
+ * net/trampver.el: Update release number.
+
2013-03-18 Leo Liu <sdl.web@gmail.com>
Make sure eldoc can be turned off properly.
diff --git a/lisp/net/tramp-adb.el b/lisp/net/tramp-adb.el
index 8b4e610b728..a71df54db58 100644
--- a/lisp/net/tramp-adb.el
+++ b/lisp/net/tramp-adb.el
@@ -856,7 +856,7 @@ PRESERVE-UID-GID and PRESERVE-EXTENDED-ATTRIBUTES are completely ignored."
(when p
(if (yes-or-no-p "A command is running. Kill it? ")
(ignore-errors (kill-process p))
- (error "Shell command in progress")))
+ (tramp-compat-user-error "Shell command in progress")))
(if current-buffer-p
(progn
diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el
index d4639817b18..ed61fbcfa76 100644
--- a/lisp/net/tramp-compat.el
+++ b/lisp/net/tramp-compat.el
@@ -533,6 +533,11 @@ EOL-TYPE can be one of `dos', `unix', or `mac'."
"`dos', `unix', or `mac'")))))
(t (error "Can't change EOL conversion -- is MULE missing?"))))
+;; `user-error' has been added to Emacs 24.3.
+(defun tramp-compat-user-error (format &rest args)
+ "Signal a pilot error."
+ (apply (if (fboundp 'user-error) 'user-error 'error) format args))
+
(add-hook 'tramp-unload-hook
(lambda ()
(unload-feature 'tramp-compat 'force)))
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index e3850653263..6f066f56a2b 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -153,7 +153,7 @@
(unless (and (tramp-compat-funcall 'dbus-get-unique-name :session)
(or (tramp-compat-process-running-p "gvfs-fuse-daemon")
(tramp-compat-process-running-p "gvfsd-fuse")))
- (error "Package `tramp-gvfs' not supported"))
+ (tramp-compat-user-error "Package `tramp-gvfs' not supported"))
(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker"
"The object path of the GVFS daemon.")
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index dc3dffd857b..86f7f338b27 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -1203,7 +1203,7 @@ their replacement."
result (substring result 0 -1))
(unless (y-or-n-p (format "Method %s is obsolete, use %s? "
result (substring result 0 -1)))
- (error 'file-error "Method \"%s\" not supported" result)))
+ (tramp-compat-user-error "Method \"%s\" not supported" result)))
(add-to-list 'tramp-warned-obsolete-methods result))
;; This works with the current set of `tramp-obsolete-methods'.
;; Must be improved, if their are more sophisticated replacements.
@@ -1249,7 +1249,7 @@ non-nil, the file name parts are not expanded to their default
values."
(save-match-data
(let ((match (string-match (nth 0 tramp-file-name-structure) name)))
- (unless match (error "Not a Tramp file name: %s" name))
+ (unless match (tramp-compat-user-error "Not a Tramp file name: %s" name))
(let ((method (match-string (nth 1 tramp-file-name-structure) name))
(user (match-string (nth 2 tramp-file-name-structure) name))
(host (match-string (nth 3 tramp-file-name-structure) name))
@@ -1259,7 +1259,12 @@ values."
(when (string-match tramp-prefix-ipv6-regexp host)
(setq host (replace-match "" nil t host)))
(when (string-match tramp-postfix-ipv6-regexp host)
- (setq host (replace-match "" nil t host))))
+ (setq host (replace-match "" nil t host)))
+ (when (and (equal tramp-syntax 'ftp) (null method) (null user)
+ (member host (mapcar 'car tramp-methods))
+ (not (tramp-completion-mode-p)))
+ (tramp-compat-user-error
+ "Host name must not match method `%s'" host)))
(if nodefault
(vector method user host localname hop)
(vector
@@ -3179,7 +3184,7 @@ User is always nil."
(when p
(if (yes-or-no-p "A command is running. Kill it? ")
(ignore-errors (kill-process p))
- (error "Shell command in progress")))
+ (tramp-compat-user-error "Shell command in progress")))
(if current-buffer-p
(progn
diff --git a/lisp/net/trampver.el b/lisp/net/trampver.el
index 64053c202b7..0e54cd60d98 100644
--- a/lisp/net/trampver.el
+++ b/lisp/net/trampver.el
@@ -31,7 +31,7 @@
;; should be changed only there.
;;;###tramp-autoload
-(defconst tramp-version "2.2.7"
+(defconst tramp-version "2.2.8-pre"
"This version of Tramp.")
;;;###tramp-autoload
@@ -44,7 +44,7 @@
(= emacs-major-version 21)
(>= emacs-minor-version 4)))
"ok"
- (format "Tramp 2.2.7 is not fit for %s"
+ (format "Tramp 2.2.8-pre is not fit for %s"
(when (string-match "^.*$" (emacs-version))
(match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x)))