1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-26 07:33:47 +00:00

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.
This commit is contained in:
Stefan Monnier 2018-09-04 12:03:52 -04:00
parent 30d94e4b92
commit 9618e16efa
2 changed files with 11 additions and 5 deletions

View 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)))))))

View 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)
;;; Hook functions