From: Stefan Monnier Date: Tue, 4 Sep 2018 16:03:52 +0000 (-0400) Subject: Better fix for bug#32550 X-Git-Tag: emacs-26.1.90~170 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9618e16efa5607664b794795fb80bdf5862fbe4b;p=emacs.git Better fix for bug#32550 * lisp/rfn-eshadow.el (rfn-eshadow-overlay): Give it a global default. * lisp/net/tramp.el (rfn-eshadow-overlay): Declare it as dynamically scoped. (tramp-rfn-eshadow-update-overlay): Revert the corresponding part of last change. --- diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 22fcccb8b65..452e70ec353 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el @@ -1923,6 +1923,13 @@ special handling of `substitute-in-file-name'." (defun tramp-rfn-eshadow-update-overlay-regexp () (format "[^%s/~]*\\(/\\|~\\)" tramp-postfix-host-format)) +;; Package rfn-eshadow is preloaded in Emacs, but for some reason, +;; it only did (defvar rfn-eshadow-overlay) without giving it a global +;; value, so it was only declared as dynamically-scoped within the +;; rfn-eshadow.el file. This is now fixed in Emacs>26.1 but we still need +;; this defvar here for older releases. +(defvar rfn-eshadow-overlay) + (defun tramp-rfn-eshadow-update-overlay () "Update `rfn-eshadow-overlay' to cover shadowed part of minibuffer input. This is intended to be used as a minibuffer `post-command-hook' for @@ -1944,8 +1951,9 @@ been set up by `rfn-eshadow-setup-minibuffer'." (buffer-string) end) end)) (point-max)) - (setq rfn-eshadow-overlay tramp-rfn-eshadow-overlay) - (let (rfn-eshadow-update-overlay-hook file-name-handler-alist) + (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) + (rfn-eshadow-update-overlay-hook nil) + file-name-handler-alist) (move-overlay rfn-eshadow-overlay (point-max) (point-max)) (rfn-eshadow-update-overlay))))))) diff --git a/lisp/rfn-eshadow.el b/lisp/rfn-eshadow.el index 847db68a776..cf719966605 100644 --- a/lisp/rfn-eshadow.el +++ b/lisp/rfn-eshadow.el @@ -132,9 +132,7 @@ system, `file-name-shadow-properties' is used instead." ;; An overlay covering the shadowed part of the filename (local to the ;; minibuffer). -(defvar rfn-eshadow-overlay) -(make-variable-buffer-local 'rfn-eshadow-overlay) - +(defvar-local rfn-eshadow-overlay nil) ;;; Hook functions