From 618310c22d8e26a1654e796b47cc2d248650de0d Mon Sep 17 00:00:00 2001 From: Michael Albinus Date: Sun, 26 Feb 2017 12:45:06 +0100 Subject: [PATCH] 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. --- etc/NEWS | 3 +++ lisp/net/tramp.el | 23 +++++++++++++---------- 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 @@ -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'. 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 input event. This fails when external packages use other characters but , 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. -- 2.39.5