emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r112078: * net/tramp-compat.el (tramp


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r112078: * net/tramp-compat.el (tramp-compat-user-error): New defun.
Date: Mon, 18 Mar 2013 14:04:13 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 112078
committer: Michael Albinus <address@hidden
branch nick: trunk
timestamp: Mon 2013-03-18 14:04:13 +0100
message:
  * 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.
modified:
  lisp/ChangeLog
  lisp/net/tramp-adb.el
  lisp/net/tramp-compat.el
  lisp/net/tramp-gvfs.el
  lisp/net/tramp.el
  lisp/net/trampver.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-03-18 09:16:15 +0000
+++ b/lisp/ChangeLog    2013-03-18 13:04:13 +0000
@@ -1,3 +1,16 @@
+2013-03-18  Michael Albinus  <address@hidden>
+
+       * 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  <address@hidden>
 
        Make sure eldoc can be turned off properly.

=== modified file 'lisp/net/tramp-adb.el'
--- a/lisp/net/tramp-adb.el     2013-03-17 17:23:05 +0000
+++ b/lisp/net/tramp-adb.el     2013-03-18 13:04:13 +0000
@@ -856,7 +856,7 @@
     (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

=== modified file 'lisp/net/tramp-compat.el'
--- a/lisp/net/tramp-compat.el  2013-03-05 15:55:53 +0000
+++ b/lisp/net/tramp-compat.el  2013-03-18 13:04:13 +0000
@@ -533,6 +533,11 @@
                        "`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)))

=== modified file 'lisp/net/tramp-gvfs.el'
--- a/lisp/net/tramp-gvfs.el    2013-03-09 11:06:23 +0000
+++ b/lisp/net/tramp-gvfs.el    2013-03-18 13:04:13 +0000
@@ -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.")

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2013-03-09 11:06:23 +0000
+++ b/lisp/net/tramp.el 2013-03-18 13:04:13 +0000
@@ -1203,7 +1203,7 @@
                  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 @@
 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 @@
          (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 @@
     (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

=== modified file 'lisp/net/trampver.el'
--- a/lisp/net/trampver.el      2013-03-15 14:17:25 +0000
+++ b/lisp/net/trampver.el      2013-03-18 13:04:13 +0000
@@ -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)))


reply via email to

[Prev in Thread] Current Thread [Next in Thread]