aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2017-02-26 12:45:06 +0100
committerMichael Albinus2017-02-26 12:45:06 +0100
commit618310c22d8e26a1654e796b47cc2d248650de0d (patch)
treec467ca775b684cd839f128322834779d0f04da7a
parent8db75f0ef9ad821bab0a2613bb8e549edbf14eb6 (diff)
downloademacs-618310c22d8e26a1654e796b47cc2d248650de0d.tar.gz
emacs-618310c22d8e26a1654e796b47cc2d248650de0d.zip
Work on `tramp-completion-mode-p'
* etc/NEWS: Say that `tramp-completion-mode' is obsolete. * lisp/net/tramp.el (tramp-completion-mode): Make it obsolete. (tramp-completion-mode-p): Reintroduce the check for 'tab.
-rw-r--r--etc/NEWS3
-rw-r--r--lisp/net/tramp.el23
2 files changed, 16 insertions, 10 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 05f380fe19c..31b7e4789e1 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -642,6 +642,9 @@ manual documents how to configure ssh and PuTTY accordingly.
642initialization files. 642initialization files.
643 643
644--- 644---
645*** Variable 'tramp-completion-mode' is obsoleted.
646
647---
645** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'. 648** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'.
646 649
647--- 650---
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 891f9612458..406cd02b52d 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -2268,25 +2268,28 @@ This is necessary, because Tramp uses a heuristic depending on last
2268input event. This fails when external packages use other characters 2268input event. This fails when external packages use other characters
2269but <TAB>, <SPACE> or ?\\? for file name completion. This variable 2269but <TAB>, <SPACE> or ?\\? for file name completion. This variable
2270should never be set globally, the intention is to let-bind it.") 2270should never be set globally, the intention is to let-bind it.")
2271(make-obsolete-variable 'tramp-completion-mode 'non-essential "26.1")
2271 2272
2272;; Necessary because `tramp-file-name-regexp-unified' and 2273;; Necessary because `tramp-file-name-regexp-unified' and
2273;; `tramp-completion-file-name-regexp-unified' aren't different. If 2274;; `tramp-completion-file-name-regexp-unified' aren't different. If
2274;; nil, `tramp-completion-run-real-handler' is called (i.e. forwarding 2275;; nil is returned, `tramp-completion-run-real-handler' is called
2275;; to `tramp-file-name-handler'). Otherwise, it takes 2276;; (i.e. forwarding to `tramp-file-name-handler'). Otherwise, it
2276;; `tramp-run-real-handler'. Using `last-input-event' is a little bit 2277;; takes `tramp-run-real-handler'. Using `last-input-event' is a
2277;; risky, because completing a file might require loading other files, 2278;; little bit risky, because completing a file might require loading
2278;; like "~/.netrc", and for them it shouldn't be decided based on that 2279;; other files, like "~/.netrc", and for them it shouldn't be decided
2279;; variable. On the other hand, those files shouldn't have partial 2280;; based on that variable. On the other hand, those files shouldn't
2280;; Tramp file name syntax. Maybe another variable should be introduced 2281;; have partial Tramp file name syntax.
2281;; overwriting this check in such cases. Or we change Tramp file name
2282;; syntax in order to avoid ambiguities.
2283;;;###autoload 2282;;;###autoload
2284(progn (defun tramp-completion-mode-p () 2283(progn (defun tramp-completion-mode-p ()
2285 "Check, whether method / user name / host name completion is active." 2284 "Check, whether method / user name / host name completion is active."
2286 (or 2285 (or
2287 ;; Signal from outside. `non-essential' has been introduced in Emacs 24. 2286 ;; Signal from outside. `non-essential' has been introduced in Emacs 24.
2288 (and (boundp 'non-essential) (symbol-value 'non-essential)) 2287 (and (boundp 'non-essential) (symbol-value 'non-essential))
2289 tramp-completion-mode))) 2288 ;; This variable has been obsoleted in Emacs 26.
2289 tramp-completion-mode
2290 ;; Fallback. Some completion packages still don't support
2291 ;; `non-essential' sufficiently.
2292 (equal last-input-event 'tab))))
2290 2293
2291(defun tramp-connectable-p (filename) 2294(defun tramp-connectable-p (filename)
2292 "Check, whether it is possible to connect the remote host w/o side-effects. 2295 "Check, whether it is possible to connect the remote host w/o side-effects.