aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2010-04-16 00:19:01 +0200
committerMichael Albinus2010-04-16 00:19:01 +0200
commit4874f5e6d6a2d6d121814cb1638d78e5f1cd3b83 (patch)
tree43bb05dace0300087f0cb59a9f681ec1e37d9fe6 /lisp
parent00030710427af3bb3a1798690985d83e1bcba67c (diff)
downloademacs-4874f5e6d6a2d6d121814cb1638d78e5f1cd3b83.tar.gz
emacs-4874f5e6d6a2d6d121814cb1638d78e5f1cd3b83.zip
* 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.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog8
-rw-r--r--lisp/net/tramp.el39
2 files changed, 33 insertions, 14 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4fe7bdca807..5ac0723343b 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,11 @@
12010-04-15 Michael Albinus <michael.albinus@gmx.de>
2
3 * net/tramp.el (tramp-error-with-buffer): Don't show the
4 connection buffer when we are in completion mode.
5 (tramp-file-name-handler): Catch the error for some operations
6 when we are in completion mode. This gives the user the chance to
7 correct the file name in the minibuffer.
8
12010-04-15 Glenn Morris <rgm@gnu.org> 92010-04-15 Glenn Morris <rgm@gnu.org>
2 10
3 * progmodes/verilog-mode.el (verilog-forward-sexp): Avoid free variable. 11 * progmodes/verilog-mode.el (verilog-forward-sexp): Avoid free variable.
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 5354d898341..fa17ba2f4f8 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2170,7 +2170,9 @@ an input event arrives. The other arguments are passed to `tramp-error'."
2170 (save-window-excursion 2170 (save-window-excursion
2171 (unwind-protect 2171 (unwind-protect
2172 (apply 'tramp-error vec-or-proc signal fmt-string args) 2172 (apply 'tramp-error vec-or-proc signal fmt-string args)
2173 (when (and vec-or-proc (not (zerop tramp-verbose))) 2173 (when (and vec-or-proc
2174 (not (zerop tramp-verbose))
2175 (not (tramp-completion-mode-p)))
2174 (let ((enable-recursive-minibuffers t)) 2176 (let ((enable-recursive-minibuffers t))
2175 (pop-to-buffer 2177 (pop-to-buffer
2176 (or (and (bufferp buffer) buffer) 2178 (or (and (bufferp buffer) buffer)
@@ -5425,19 +5427,28 @@ Falls back to normal file name handler if no Tramp file name handler exists."
5425 (completion (tramp-completion-mode-p)) 5427 (completion (tramp-completion-mode-p))
5426 (foreign (tramp-find-foreign-file-name-handler filename))) 5428 (foreign (tramp-find-foreign-file-name-handler filename)))
5427 (with-parsed-tramp-file-name filename nil 5429 (with-parsed-tramp-file-name filename nil
5428 (cond 5430 ;; Call the backend function.
5429 ;; When we are in completion mode, some operations 5431 (if foreign
5430 ;; shouldn't be handled by backend. 5432 (condition-case err
5431 ((and completion (zerop (length localname)) 5433 (apply foreign operation args)
5432 (memq operation '(file-exists-p file-directory-p))) 5434 (error
5433 t) 5435 (cond
5434 ((and completion (zerop (length localname)) 5436 ;; When we are in completion mode, some failed
5435 (memq operation '(file-name-as-directory))) 5437 ;; operations shall return at least a default
5436 filename) 5438 ;; value in order to give the user a chance to
5437 ;; Call the backend function. 5439 ;; correct the file name in the minibuffer.
5438 (foreign (apply foreign operation args)) 5440 ((and completion (zerop (length localname))
5439 ;; Nothing to do for us. 5441 (memq operation '(file-exists-p file-directory-p)))
5440 (t (tramp-run-real-handler operation args)))))) 5442 t)
5443 ((and completion (zerop (length localname))
5444 (memq operation
5445 '(expand-file-name file-name-as-directory)))
5446 filename)
5447 ;; Propagate the error.
5448 (t (signal (car err) (cdr err))))))
5449 ;; Nothing to do for us.
5450 (tramp-run-real-handler operation args)))))
5451
5441 ;; When `tramp-mode' is not enabled, we don't do anything. 5452 ;; When `tramp-mode' is not enabled, we don't do anything.
5442 (tramp-run-real-handler operation args))) 5453 (tramp-run-real-handler operation args)))
5443 5454