aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorMichael Albinus2010-04-21 21:48:42 +0200
committerMichael Albinus2010-04-21 21:48:42 +0200
commitacd1f317f366add05cd172b27d12fed18550587a (patch)
tree09c3f0066725a34332cd4eee5b06b5f10ed76573 /lisp
parent56bae7c7b7947084b7bd71e54b322a73d9f887af (diff)
downloademacs-acd1f317f366add05cd172b27d12fed18550587a.tar.gz
emacs-acd1f317f366add05cd172b27d12fed18550587a.zip
Fix Bug#5840.
* icomplete.el (icomplete-completions): Use `non-essential'. * net/tramp.el (tramp-connectable-p): New defun. (tramp-handle-expand-file-name) (tramp-completion-handle-file-name-all-completions) (tramp-completion-handle-file-name-completion): Use it.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/icomplete.el3
-rw-r--r--lisp/net/tramp.el19
3 files changed, 28 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 451498175ca..ad8f74c7489 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12010-04-21 Michael Albinus <michael.albinus@gmx.de>
2
3 Fix Bug#5840.
4
5 * icomplete.el (icomplete-completions): Use `non-essential'.
6
7 * net/tramp.el (tramp-connectable-p): New defun.
8 (tramp-handle-expand-file-name)
9 (tramp-completion-handle-file-name-all-completions)
10 (tramp-completion-handle-file-name-completion): Use it.
11
12010-04-21 Stefan Monnier <monnier@iro.umontreal.ca> 122010-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
2 13
3 * emacs-lisp/lisp.el (lisp-completion-at-point): Try and handle errors. 14 * emacs-lisp/lisp.el (lisp-completion-at-point): Try and handle errors.
diff --git a/lisp/icomplete.el b/lisp/icomplete.el
index 94822a60a63..645981539d4 100644
--- a/lisp/icomplete.el
+++ b/lisp/icomplete.el
@@ -283,7 +283,8 @@ The displays for unambiguous matches have ` [Matched]' appended
283matches exist. \(Keybindings for uniquely matched commands 283matches exist. \(Keybindings for uniquely matched commands
284are exhibited within the square braces.)" 284are exhibited within the square braces.)"
285 285
286 (let* ((comps (completion-all-sorted-completions)) 286 (let* ((non-essential t)
287 (comps (completion-all-sorted-completions))
287 (last (if (consp comps) (last comps))) 288 (last (if (consp comps) (last comps)))
288 (base-size (cdr last)) 289 (base-size (cdr last))
289 (open-bracket (if require-match "(" "[")) 290 (open-bracket (if require-match "(" "["))
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 07759e84376..5ba1b184bc5 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -4225,7 +4225,7 @@ the result will be a local, non-Tramp, filename."
4225 (unless (file-name-absolute-p name) 4225 (unless (file-name-absolute-p name)
4226 (setq name (concat (file-name-as-directory dir) name))) 4226 (setq name (concat (file-name-as-directory dir) name)))
4227 ;; If NAME is not a Tramp file, run the real handler. 4227 ;; If NAME is not a Tramp file, run the real handler.
4228 (if (not (tramp-tramp-file-p name)) 4228 (if (not (tramp-connectable-p name))
4229 (tramp-run-real-handler 'expand-file-name (list name nil)) 4229 (tramp-run-real-handler 'expand-file-name (list name nil))
4230 ;; Dissect NAME. 4230 ;; Dissect NAME.
4231 (with-parsed-tramp-file-name name nil 4231 (with-parsed-tramp-file-name name nil
@@ -5647,6 +5647,15 @@ should never be set globally, the intention is to let-bind it.")
5647 (funcall (symbol-function 'event-to-character) 5647 (funcall (symbol-function 'event-to-character)
5648 last-input-event) ?\ ))))))) 5648 last-input-event) ?\ )))))))
5649 5649
5650(defun tramp-connectable-p (filename)
5651 "Check, whether it is possible to connect the remote host w/o side-effects.
5652This is true, if either the remote host is already connected, or if we are
5653not in completion mode."
5654 (and (tramp-tramp-file-p filename)
5655 (with-parsed-tramp-file-name filename nil
5656 (or (get-buffer (tramp-buffer-name v))
5657 (not (tramp-completion-mode-p))))))
5658
5650;; Method, host name and user name completion. 5659;; Method, host name and user name completion.
5651;; `tramp-completion-dissect-file-name' returns a list of 5660;; `tramp-completion-dissect-file-name' returns a list of
5652;; tramp-file-name structures. For all of them we return possible completions. 5661;; tramp-file-name structures. For all of them we return possible completions.
@@ -5710,8 +5719,9 @@ should never be set globally, the intention is to let-bind it.")
5710 (append 5719 (append
5711 result1 5720 result1
5712 (condition-case nil 5721 (condition-case nil
5713 (tramp-completion-run-real-handler 5722 (when (tramp-connectable-p fullname)
5714 'file-name-all-completions (list filename directory)) 5723 (tramp-completion-run-real-handler
5724 'file-name-all-completions (list filename directory)))
5715 (error nil))))) 5725 (error nil)))))
5716 5726
5717;; Method, host name and user name completion for a file. 5727;; Method, host name and user name completion for a file.
@@ -5722,7 +5732,8 @@ should never be set globally, the intention is to let-bind it.")
5722 (try-completion 5732 (try-completion
5723 filename 5733 filename
5724 (mapcar 'list (file-name-all-completions filename directory)) 5734 (mapcar 'list (file-name-all-completions filename directory))
5725 (when predicate 5735 (when (and predicate
5736 (tramp-connectable-p (expand-file-name filename directory)))
5726 (lambda (x) (funcall predicate (expand-file-name (car x) directory)))))) 5737 (lambda (x) (funcall predicate (expand-file-name (car x) directory))))))
5727 5738
5728;; I misuse a little bit the tramp-file-name structure in order to handle 5739;; I misuse a little bit the tramp-file-name structure in order to handle