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.
This commit is contained in:
Michael Albinus 2017-02-26 12:45:06 +01:00
parent 8db75f0ef9
commit 618310c22d
2 changed files with 16 additions and 10 deletions

View file

@ -641,6 +641,9 @@ manual documents how to configure ssh and PuTTY accordingly.
'tramp-remote-process-environment' enables reading of shell
initialization files.
---
*** Variable 'tramp-completion-mode' is obsoleted.
---
** 'auto-revert-use-notify' is set back to t in 'global-auto-revert-mode'.

View file

@ -2268,25 +2268,28 @@ This is necessary, because Tramp uses a heuristic depending on last
input event. This fails when external packages use other characters
but <TAB>, <SPACE> or ?\\? for file name completion. This variable
should never be set globally, the intention is to let-bind it.")
(make-obsolete-variable 'tramp-completion-mode 'non-essential "26.1")
;; Necessary because `tramp-file-name-regexp-unified' and
;; `tramp-completion-file-name-regexp-unified' aren't different. If
;; nil, `tramp-completion-run-real-handler' is called (i.e. forwarding
;; to `tramp-file-name-handler'). Otherwise, it takes
;; `tramp-run-real-handler'. Using `last-input-event' is a little bit
;; risky, because completing a file might require loading other files,
;; like "~/.netrc", and for them it shouldn't be decided based on that
;; variable. On the other hand, those files shouldn't have partial
;; Tramp file name syntax. Maybe another variable should be introduced
;; overwriting this check in such cases. Or we change Tramp file name
;; syntax in order to avoid ambiguities.
;; nil is returned, `tramp-completion-run-real-handler' is called
;; (i.e. forwarding to `tramp-file-name-handler'). Otherwise, it
;; takes `tramp-run-real-handler'. Using `last-input-event' is a
;; little bit risky, because completing a file might require loading
;; other files, like "~/.netrc", and for them it shouldn't be decided
;; based on that variable. On the other hand, those files shouldn't
;; have partial Tramp file name syntax.
;;;###autoload
(progn (defun tramp-completion-mode-p ()
"Check, whether method / user name / host name completion is active."
(or
;; Signal from outside. `non-essential' has been introduced in Emacs 24.
(and (boundp 'non-essential) (symbol-value 'non-essential))
tramp-completion-mode)))
;; This variable has been obsoleted in Emacs 26.
tramp-completion-mode
;; Fallback. Some completion packages still don't support
;; `non-essential' sufficiently.
(equal last-input-event 'tab))))
(defun tramp-connectable-p (filename)
"Check, whether it is possible to connect the remote host w/o side-effects.