emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r114006: * minibuffer.el: Revert change from 2013-08


From: Michael Albinus
Subject: [Emacs-diffs] trunk r114006: * minibuffer.el: Revert change from 2013-08-20.
Date: Mon, 26 Aug 2013 13:17:43 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 114006
revision-id: address@hidden
parent: address@hidden
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Mon 2013-08-26 15:17:22 +0200
message:
  * minibuffer.el: Revert change from 2013-08-20.
  
  * net/tramp.el (tramp-find-method, tramp-find-user): Mark result
  with text property `tramp-default', if appropriate.
  (tramp-check-proper-host): New defun.
  (tramp-dissect-file-name): Do not check hostname.  Revert change
  of 2013-03-18.
  (tramp-backtrace): Make VEC-OR-PROC optional.
  
  * net/tramp-adb.el (tramp-adb-maybe-open-connection):
  * net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
  * net/tramp-sh.el (tramp-maybe-open-connection):
  * net/tramp-smb.el (tramp-smb-maybe-open-connection): Apply
  `tramp-check-proper-host'.
modified:
  lisp/ChangeLog                 changelog-20091113204419-o5vbwnq5f7feedwu-1432
  lisp/minibuffer.el             
minibuffer.el-20091113204419-o5vbwnq5f7feedwu-8622
  lisp/net/tramp-adb.el          trampadb.el-20121204164216-03wyr5miam215d7f-1
  lisp/net/tramp-compat.el       
trampcompat.el-20091113204419-o5vbwnq5f7feedwu-7298
  lisp/net/tramp-gvfs.el         
trampgvfs.el-20091113204419-o5vbwnq5f7feedwu-10898
  lisp/net/tramp-sh.el           trampsh.el-20100913133439-a1faifh29eqoi4nh-1
  lisp/net/tramp-smb.el          
trampsmb.el-20091113204419-o5vbwnq5f7feedwu-2515
  lisp/net/tramp.el              tramp.el-20091113204419-o5vbwnq5f7feedwu-2427
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2013-08-26 11:03:09 +0000
+++ b/lisp/ChangeLog    2013-08-26 13:17:22 +0000
@@ -1,3 +1,20 @@
+2013-08-26  Michael Albinus  <address@hidden>
+
+       * minibuffer.el: Revert change from 2013-08-20.
+
+       * net/tramp.el (tramp-find-method, tramp-find-user): Mark result
+       with text property `tramp-default', if appropriate.
+       (tramp-check-proper-host): New defun.
+       (tramp-dissect-file-name): Do not check hostname.  Revert change
+       of 2013-03-18.
+       (tramp-backtrace): Make VEC-OR-PROC optional.
+
+       * net/tramp-adb.el (tramp-adb-maybe-open-connection):
+       * net/tramp-gvfs.el (tramp-gvfs-maybe-open-connection):
+       * net/tramp-sh.el (tramp-maybe-open-connection):
+       * net/tramp-smb.el (tramp-smb-maybe-open-connection): Apply
+       `tramp-check-proper-host'.
+
 2013-08-26  Tassilo Horn  <address@hidden>
 
        * epa-hook.el (epa-file-encrypt-to): Quote `safe-local-variable'

=== modified file 'lisp/minibuffer.el'
--- a/lisp/minibuffer.el        2013-08-20 10:04:13 +0000
+++ b/lisp/minibuffer.el        2013-08-26 13:17:22 +0000
@@ -2246,8 +2246,7 @@
   ;; - Cygwin (substitute-in-file-name "C:\bin") => "/usr/bin"
   ;;          (substitute-in-file-name "C:\") => "/"
   ;;          (substitute-in-file-name "C:\bi") => "/bi"
-  (let* ((non-essential t)
-        (ustr (substitute-in-file-name qstr))
+  (let* ((ustr (substitute-in-file-name qstr))
          (uprefix (substring ustr 0 upos))
          qprefix)
     ;; Main assumption: nothing after qpos should affect the text before upos,

=== modified file 'lisp/net/tramp-adb.el'
--- a/lisp/net/tramp-adb.el     2013-08-17 10:20:15 +0000
+++ b/lisp/net/tramp-adb.el     2013-08-26 13:17:22 +0000
@@ -1092,6 +1092,8 @@
   "Maybe open a connection VEC.
 Does not do anything if a connection is already open, but re-opens the
 connection if a previous connection has died for some reason."
+  (tramp-check-proper-host vec)
+
   (let* ((buf (tramp-get-connection-buffer vec))
         (p (get-buffer-process buf))
         (host (tramp-file-name-host vec))

=== modified file 'lisp/net/tramp-compat.el'
--- a/lisp/net/tramp-compat.el  2013-08-15 17:02:09 +0000
+++ b/lisp/net/tramp-compat.el  2013-08-26 13:17:22 +0000
@@ -521,6 +521,7 @@
 ;; `user-error' has been added to Emacs 24.3.
 (defun tramp-compat-user-error (format &rest args)
   "Signal a pilot error."
+;  (tramp-backtrace)
   (apply (if (fboundp 'user-error) 'user-error 'error) format args))
 
 (add-hook 'tramp-unload-hook

=== modified file 'lisp/net/tramp-gvfs.el'
--- a/lisp/net/tramp-gvfs.el    2013-08-17 10:20:15 +0000
+++ b/lisp/net/tramp-gvfs.el    2013-08-26 13:17:22 +0000
@@ -1469,6 +1469,7 @@
   "Maybe open a connection VEC.
 Does not do anything if a connection is already open, but re-opens the
 connection if a previous connection has died for some reason."
+  (tramp-check-proper-host vec)
 
   ;; We set the file name, in case there are incoming D-Bus signals or
   ;; D-Bus errors.

=== modified file 'lisp/net/tramp-sh.el'
--- a/lisp/net/tramp-sh.el      2013-08-26 06:59:53 +0000
+++ b/lisp/net/tramp-sh.el      2013-08-26 13:17:22 +0000
@@ -4326,6 +4326,8 @@
   "Maybe open a connection VEC.
 Does not do anything if a connection is already open, but re-opens the
 connection if a previous connection has died for some reason."
+  (tramp-check-proper-host vec)
+
   (catch 'uname-changed
     (let ((p (tramp-get-connection-process vec))
          (process-name (tramp-get-connection-property vec "process-name" nil))

=== modified file 'lisp/net/tramp-smb.el'
--- a/lisp/net/tramp-smb.el     2013-08-15 17:02:09 +0000
+++ b/lisp/net/tramp-smb.el     2013-08-26 13:17:22 +0000
@@ -1564,6 +1564,8 @@
 connection if a previous connection has died for some reason.
 If ARGUMENT is non-nil, use it as argument for
 `tramp-smb-winexe-program', and suppress any checks."
+  (tramp-check-proper-host vec)
+
   (let* ((share (tramp-smb-get-share vec))
         (buf (tramp-get-connection-buffer vec))
         (p (get-buffer-process buf)))

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2013-08-17 10:20:15 +0000
+++ b/lisp/net/tramp.el 2013-08-26 13:17:22 +0000
@@ -1239,23 +1239,31 @@
       ;; This works with the current set of `tramp-obsolete-methods'.
       ;; Must be improved, if their are more sophisticated replacements.
       (setq result (substring result 0 -1)))
-    result))
+    ;; We must mark, whether a default value has been used.
+    (if (or method (null result))
+       result
+      (propertize result 'tramp-default t))))
 
 (defun tramp-find-user (method user host)
   "Return the right user string to use.
 This is USER, if non-nil. Otherwise, do a lookup in
 `tramp-default-user-alist'."
-  (or user
-      (let ((choices tramp-default-user-alist)
-           luser item)
-       (while choices
-         (setq item (pop choices))
-         (when (and (string-match (or (nth 0 item) "") (or method ""))
-                    (string-match (or (nth 1 item) "") (or host "")))
-           (setq luser (nth 2 item))
-           (setq choices nil)))
-       luser)
-      tramp-default-user))
+  (let ((result
+        (or user
+            (let ((choices tramp-default-user-alist)
+                  luser item)
+              (while choices
+                (setq item (pop choices))
+                (when (and (string-match (or (nth 0 item) "") (or method ""))
+                           (string-match (or (nth 1 item) "") (or host "")))
+                  (setq luser (nth 2 item))
+                  (setq choices nil)))
+              luser)
+            tramp-default-user)))
+    ;; We must mark, whether a default value has been used.
+    (if (or user (null result))
+       result
+      (propertize result 'tramp-default t))))
 
 (defun tramp-find-host (method user host)
   "Return the right host string to use.
@@ -1272,6 +1280,18 @@
        lhost)
       tramp-default-host))
 
+(defun tramp-check-proper-host (vec)
+  "Check host name of VEC."
+  (let ((method (tramp-file-name-method vec))
+       (user (tramp-file-name-user vec))
+       (host (tramp-file-name-host vec)))
+    (when (and (equal tramp-syntax 'ftp) host
+              (or (null method) (get-text-property 0 'tramp-default method))
+              (or (null user) (get-text-property 0 'tramp-default user))
+              (member host (mapcar 'car tramp-methods)))
+      (tramp-compat-user-error
+       "Host name must not match method `%s'" host))))
+
 (defun tramp-dissect-file-name (name &optional nodefault)
   "Return a `tramp-file-name' structure.
 The structure consists of remote method, remote user, remote host
@@ -1290,12 +1310,7 @@
          (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)))
-         (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)))
+           (setq host (replace-match "" nil t host))))
        (if nodefault
            (vector method user host localname hop)
          (vector
@@ -1537,10 +1552,14 @@
                   (concat (format "(%d) # " level) fmt-string)
                   arguments)))))))
 
-(defsubst tramp-backtrace (vec-or-proc)
+(defsubst tramp-backtrace (&optional vec-or-proc)
   "Dump a backtrace into the debug buffer.
-This function is meant for debugging purposes."
-  (tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace))))
+If VEC-OR-PROC is nil, the buffer *debug tramp* is used.  This
+function is meant for debugging purposes."
+  (if vec-or-proc
+      (tramp-message vec-or-proc 10 "\n%s" (with-output-to-string (backtrace)))
+    (if (<= 10 tramp-verbose)
+       (with-output-to-temp-buffer "*debug tramp*" (backtrace)))))
 
 (defsubst tramp-error (vec-or-proc signal fmt-string &rest arguments)
   "Emit an error.


reply via email to

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