Commit 64ab82d1 authored by Michael Albinus's avatar Michael Albinus
Browse files

* 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.
parent 0cb77136
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.
......
......@@ -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
......
......@@ -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)))
......
......@@ -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.")
......
......@@ -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
......
......@@ -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)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment