]> git.eshelyaron.com Git - emacs.git/commitdiff
Better fix for bug#32550
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Sep 2018 16:03:52 +0000 (12:03 -0400)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Sep 2018 16:03:52 +0000 (12:03 -0400)
* 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.

lisp/net/tramp.el
lisp/rfn-eshadow.el

index 22fcccb8b6513fc2bcd845567cff0c2413dffb92..452e70ec3533007b2288415d38e7396f0dddcbd5 100644 (file)
@@ -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)))))))
 
index 847db68a7761b2da309c42a6cc23e3be385b0086..cf71996660525bf84053a93eaa37bfd8d4d7fda1 100644 (file)
@@ -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)
 \f
 ;;; Hook functions