emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 618310c: Work on `tramp-completion-mode-p'


From: Michael Albinus
Subject: [Emacs-diffs] master 618310c: Work on `tramp-completion-mode-p'
Date: Sun, 26 Feb 2017 06:45:26 -0500 (EST)

branch: master
commit 618310c22d8e26a1654e796b47cc2d248650de0d
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>

    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 05f380f..31b7e47 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -642,6 +642,9 @@ manual documents how to configure ssh and PuTTY accordingly.
 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 891f961..406cd02 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 <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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]