+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.
(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
"`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)))
(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.")
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.
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))
(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
(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
;; 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
(= 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)))