emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r99912: * net/tramp.el (tramp-error-w


From: Michael Albinus
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99912: * net/tramp.el (tramp-error-with-buffer): Don't show the
Date: Fri, 16 Apr 2010 00:19:01 +0200
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99912
committer: Michael Albinus <address@hidden>
branch nick: trunk
timestamp: Fri 2010-04-16 00:19:01 +0200
message:
  * net/tramp.el (tramp-error-with-buffer): Don't show the
  connection buffer when we are in completion mode.
  (tramp-file-name-handler): Catch the error for some operations
  when we are in completion mode.  This gives the user the chance to
  correct the file name in the minibuffer.
modified:
  lisp/ChangeLog
  lisp/net/tramp.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-04-15 17:14:10 +0000
+++ b/lisp/ChangeLog    2010-04-15 22:19:01 +0000
@@ -1,3 +1,11 @@
+2010-04-15  Michael Albinus  <address@hidden>
+
+       * net/tramp.el (tramp-error-with-buffer): Don't show the
+       connection buffer when we are in completion mode.
+       (tramp-file-name-handler): Catch the error for some operations
+       when we are in completion mode.  This gives the user the chance to
+       correct the file name in the minibuffer.
+
 2010-04-15  Glenn Morris  <address@hidden>
 
        * progmodes/verilog-mode.el (verilog-forward-sexp): Avoid free variable.

=== modified file 'lisp/net/tramp.el'
--- a/lisp/net/tramp.el 2010-04-14 22:05:14 +0000
+++ b/lisp/net/tramp.el 2010-04-15 22:19:01 +0000
@@ -2170,7 +2170,9 @@
   (save-window-excursion
     (unwind-protect
        (apply 'tramp-error vec-or-proc signal fmt-string args)
-      (when (and vec-or-proc (not (zerop tramp-verbose)))
+      (when (and vec-or-proc
+                (not (zerop tramp-verbose))
+                (not (tramp-completion-mode-p)))
        (let ((enable-recursive-minibuffers t))
          (pop-to-buffer
           (or (and (bufferp buffer) buffer)
@@ -5425,19 +5427,28 @@
               (completion (tramp-completion-mode-p))
               (foreign (tramp-find-foreign-file-name-handler filename)))
          (with-parsed-tramp-file-name filename nil
-           (cond
-            ;; When we are in completion mode, some operations
-            ;; shouldn't be handled by backend.
-            ((and completion (zerop (length localname))
-                  (memq operation '(file-exists-p file-directory-p)))
-             t)
-            ((and completion (zerop (length localname))
-                  (memq operation '(file-name-as-directory)))
-             filename)
-            ;; Call the backend function.
-            (foreign (apply foreign operation args))
-            ;; Nothing to do for us.
-            (t (tramp-run-real-handler operation args))))))
+           ;; Call the backend function.
+           (if foreign
+               (condition-case err
+                   (apply foreign operation args)
+                 (error
+                  (cond
+                   ;; When we are in completion mode, some failed
+                   ;; operations shall return at least a default
+                   ;; value in order to give the user a chance to
+                   ;; correct the file name in the minibuffer.
+                   ((and completion (zerop (length localname))
+                         (memq operation '(file-exists-p file-directory-p)))
+                    t)
+                   ((and completion (zerop (length localname))
+                         (memq operation
+                               '(expand-file-name file-name-as-directory)))
+                    filename)
+                   ;; Propagate the error.
+                   (t (signal (car err) (cdr err))))))
+             ;; Nothing to do for us.
+             (tramp-run-real-handler operation args)))))
+
     ;; When `tramp-mode' is not enabled, we don't do anything.
     (tramp-run-real-handler operation args)))
 


reply via email to

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