1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-16 02:50:26 -08:00

Unset `non-essential' in Tramp when not needed anymore

* doc/misc/trampver.texi:
* lisp/net/trampver.el: Change version to "2.3.2-pre".

* lisp/net/tramp-sh.el (tramp-maybe-open-connection):
Use `tramp-completion-mode-p'.

* lisp/net/tramp.el (tramp-file-name-handler): Unset `non-essential'
when file name doesn't match `tramp-completion-file-name-regexp'.
This commit is contained in:
Michael Albinus 2017-02-18 14:29:19 +01:00
parent ba6e7232d0
commit 6ad34b3d54
4 changed files with 11 additions and 8 deletions

View file

@ -8,7 +8,7 @@
@c In the Tramp GIT, the version number is auto-frobbed from @c In the Tramp GIT, the version number is auto-frobbed from
@c configure.ac, so you should edit that file and run @c configure.ac, so you should edit that file and run
@c "autoconf && ./configure" to change the version number. @c "autoconf && ./configure" to change the version number.
@set trampver 2.3.1 @set trampver 2.3.2-pre
@c Other flags from configuration @c Other flags from configuration
@set instprefix /usr/local @set instprefix /usr/local

View file

@ -4653,12 +4653,11 @@ connection if a previous connection has died for some reason."
(condition-case err (condition-case err
(unless (tramp-compat-process-live-p p) (unless (tramp-compat-process-live-p p)
;; If `non-essential' is non-nil, don't reopen a new connection. ;; During completion, don't reopen a new connection. We
;; This variable has been introduced with Emacs 24.1. ;; check this for the process related to
;; We check this for the process related to
;; `tramp-buffer-name'; otherwise `start-file-process' ;; `tramp-buffer-name'; otherwise `start-file-process'
;; wouldn't run ever when `non-essential' is non-nil. ;; wouldn't run ever when `non-essential' is non-nil.
(when (and (boundp 'non-essential) (symbol-value 'non-essential) (when (and (tramp-completion-mode-p)
(null (get-process (tramp-buffer-name vec)))) (null (get-process (tramp-buffer-name vec))))
(throw 'non-essential 'non-essential)) (throw 'non-essential 'non-essential))

View file

@ -2021,6 +2021,10 @@ Falls back to normal file name handler if no Tramp file name handler exists."
(if (and tramp-mode (tramp-tramp-file-p filename)) (if (and tramp-mode (tramp-tramp-file-p filename))
(save-match-data (save-match-data
(let* ((filename (tramp-replace-environment-variables filename)) (let* ((filename (tramp-replace-environment-variables filename))
(non-essential
(and non-essential
(string-match
tramp-completion-file-name-regexp filename)))
(completion (tramp-completion-mode-p)) (completion (tramp-completion-mode-p))
(foreign (foreign
(tramp-find-foreign-file-name-handler (tramp-find-foreign-file-name-handler

View file

@ -6,7 +6,7 @@
;; Author: Kai Großjohann <kai.grossjohann@gmx.net> ;; Author: Kai Großjohann <kai.grossjohann@gmx.net>
;; Keywords: comm, processes ;; Keywords: comm, processes
;; Package: tramp ;; Package: tramp
;; Version: 2.3.1 ;; Version: 2.3.2-pre
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
@ -32,7 +32,7 @@
;; should be changed only there. ;; should be changed only there.
;;;###tramp-autoload ;;;###tramp-autoload
(defconst tramp-version "2.3.1" (defconst tramp-version "2.3.2-pre"
"This version of Tramp.") "This version of Tramp.")
;;;###tramp-autoload ;;;###tramp-autoload
@ -54,7 +54,7 @@
;; Check for Emacs version. ;; Check for Emacs version.
(let ((x (if (>= emacs-major-version 23) (let ((x (if (>= emacs-major-version 23)
"ok" "ok"
(format "Tramp 2.3.1 is not fit for %s" (format "Tramp 2.3.2-pre is not fit for %s"
(when (string-match "^.*$" (emacs-version)) (when (string-match "^.*$" (emacs-version))
(match-string 0 (emacs-version))))))) (match-string 0 (emacs-version)))))))
(unless (string-match "\\`ok\\'" x) (error "%s" x))) (unless (string-match "\\`ok\\'" x) (error "%s" x)))