aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2013-03-18 14:04:13 +0100
committerMichael Albinus2013-03-18 14:04:13 +0100
commit64ab82d1da79084384d27d366b4cfc41f7cae5b6 (patch)
tree6bc9b95f784543b4683863e32e8c0a0e47210d81
parent0cb77136f890bc9db5c3f928ae39a8e8111fc4d4 (diff)
downloademacs-64ab82d1da79084384d27d366b4cfc41f7cae5b6.tar.gz
emacs-64ab82d1da79084384d27d366b4cfc41f7cae5b6.zip
* 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 @@
12013-03-18 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp-compat.el (tramp-compat-user-error): New defun.
4
5 * net/tramp-adb.el (tramp-adb-handle-shell-command):
6 * net/tramp-gvfs.el (top):
7 * net/tramp.el (tramp-find-method, tramp-dissect-file-name)
8 (tramp-handle-shell-command): Use it.
9 (tramp-dissect-file-name): Raise an error when hostname is a
10 method name, and neither method nor user is specified.
11
12 * net/trampver.el: Update release number.
13
12013-03-18 Leo Liu <sdl.web@gmail.com> 142013-03-18 Leo Liu <sdl.web@gmail.com>
2 15
3 Make sure eldoc can be turned off properly. 16 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."
856 (when p 856 (when p
857 (if (yes-or-no-p "A command is running. Kill it? ") 857 (if (yes-or-no-p "A command is running. Kill it? ")
858 (ignore-errors (kill-process p)) 858 (ignore-errors (kill-process p))
859 (error "Shell command in progress"))) 859 (tramp-compat-user-error "Shell command in progress")))
860 860
861 (if current-buffer-p 861 (if current-buffer-p
862 (progn 862 (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'."
533 "`dos', `unix', or `mac'"))))) 533 "`dos', `unix', or `mac'")))))
534 (t (error "Can't change EOL conversion -- is MULE missing?")))) 534 (t (error "Can't change EOL conversion -- is MULE missing?"))))
535 535
536;; `user-error' has been added to Emacs 24.3.
537(defun tramp-compat-user-error (format &rest args)
538 "Signal a pilot error."
539 (apply (if (fboundp 'user-error) 'user-error 'error) format args))
540
536(add-hook 'tramp-unload-hook 541(add-hook 'tramp-unload-hook
537 (lambda () 542 (lambda ()
538 (unload-feature 'tramp-compat 'force))) 543 (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 @@
153(unless (and (tramp-compat-funcall 'dbus-get-unique-name :session) 153(unless (and (tramp-compat-funcall 'dbus-get-unique-name :session)
154 (or (tramp-compat-process-running-p "gvfs-fuse-daemon") 154 (or (tramp-compat-process-running-p "gvfs-fuse-daemon")
155 (tramp-compat-process-running-p "gvfsd-fuse"))) 155 (tramp-compat-process-running-p "gvfsd-fuse")))
156 (error "Package `tramp-gvfs' not supported")) 156 (tramp-compat-user-error "Package `tramp-gvfs' not supported"))
157 157
158(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker" 158(defconst tramp-gvfs-path-mounttracker "/org/gtk/vfs/mounttracker"
159 "The object path of the GVFS daemon.") 159 "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."
1203 result (substring result 0 -1)) 1203 result (substring result 0 -1))
1204 (unless (y-or-n-p (format "Method %s is obsolete, use %s? " 1204 (unless (y-or-n-p (format "Method %s is obsolete, use %s? "
1205 result (substring result 0 -1))) 1205 result (substring result 0 -1)))
1206 (error 'file-error "Method \"%s\" not supported" result))) 1206 (tramp-compat-user-error "Method \"%s\" not supported" result)))
1207 (add-to-list 'tramp-warned-obsolete-methods result)) 1207 (add-to-list 'tramp-warned-obsolete-methods result))
1208 ;; This works with the current set of `tramp-obsolete-methods'. 1208 ;; This works with the current set of `tramp-obsolete-methods'.
1209 ;; Must be improved, if their are more sophisticated replacements. 1209 ;; 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
1249values." 1249values."
1250 (save-match-data 1250 (save-match-data
1251 (let ((match (string-match (nth 0 tramp-file-name-structure) name))) 1251 (let ((match (string-match (nth 0 tramp-file-name-structure) name)))
1252 (unless match (error "Not a Tramp file name: %s" name)) 1252 (unless match (tramp-compat-user-error "Not a Tramp file name: %s" name))
1253 (let ((method (match-string (nth 1 tramp-file-name-structure) name)) 1253 (let ((method (match-string (nth 1 tramp-file-name-structure) name))
1254 (user (match-string (nth 2 tramp-file-name-structure) name)) 1254 (user (match-string (nth 2 tramp-file-name-structure) name))
1255 (host (match-string (nth 3 tramp-file-name-structure) name)) 1255 (host (match-string (nth 3 tramp-file-name-structure) name))
@@ -1259,7 +1259,12 @@ values."
1259 (when (string-match tramp-prefix-ipv6-regexp host) 1259 (when (string-match tramp-prefix-ipv6-regexp host)
1260 (setq host (replace-match "" nil t host))) 1260 (setq host (replace-match "" nil t host)))
1261 (when (string-match tramp-postfix-ipv6-regexp host) 1261 (when (string-match tramp-postfix-ipv6-regexp host)
1262 (setq host (replace-match "" nil t host)))) 1262 (setq host (replace-match "" nil t host)))
1263 (when (and (equal tramp-syntax 'ftp) (null method) (null user)
1264 (member host (mapcar 'car tramp-methods))
1265 (not (tramp-completion-mode-p)))
1266 (tramp-compat-user-error
1267 "Host name must not match method `%s'" host)))
1263 (if nodefault 1268 (if nodefault
1264 (vector method user host localname hop) 1269 (vector method user host localname hop)
1265 (vector 1270 (vector
@@ -3179,7 +3184,7 @@ User is always nil."
3179 (when p 3184 (when p
3180 (if (yes-or-no-p "A command is running. Kill it? ") 3185 (if (yes-or-no-p "A command is running. Kill it? ")
3181 (ignore-errors (kill-process p)) 3186 (ignore-errors (kill-process p))
3182 (error "Shell command in progress"))) 3187 (tramp-compat-user-error "Shell command in progress")))
3183 3188
3184 (if current-buffer-p 3189 (if current-buffer-p
3185 (progn 3190 (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 @@
31;; should be changed only there. 31;; should be changed only there.
32 32
33;;;###tramp-autoload 33;;;###tramp-autoload
34(defconst tramp-version "2.2.7" 34(defconst tramp-version "2.2.8-pre"
35 "This version of Tramp.") 35 "This version of Tramp.")
36 36
37;;;###tramp-autoload 37;;;###tramp-autoload
@@ -44,7 +44,7 @@
44 (= emacs-major-version 21) 44 (= emacs-major-version 21)
45 (>= emacs-minor-version 4))) 45 (>= emacs-minor-version 4)))
46 "ok" 46 "ok"
47 (format "Tramp 2.2.7 is not fit for %s" 47 (format "Tramp 2.2.8-pre is not fit for %s"
48 (when (string-match "^.*$" (emacs-version)) 48 (when (string-match "^.*$" (emacs-version))
49 (match-string 0 (emacs-version))))))) 49 (match-string 0 (emacs-version)))))))
50 (unless (string-match "\\`ok\\'" x) (error "%s" x))) 50 (unless (string-match "\\`ok\\'" x) (error "%s" x)))