diff options
| author | Michael Albinus | 2018-09-04 11:59:39 +0200 |
|---|---|---|
| committer | Michael Albinus | 2018-09-04 11:59:39 +0200 |
| commit | 30d94e4b926fb62c4cb0d2635c7bb6b580c68c4a (patch) | |
| tree | 2153b139ed8a426d42d12a8031cb08deb6538d6c | |
| parent | 57bcdc76e0518f53cd171c76e726e6bdf646bf9a (diff) | |
| download | emacs-30d94e4b926fb62c4cb0d2635c7bb6b580c68c4a.tar.gz emacs-30d94e4b926fb62c4cb0d2635c7bb6b580c68c4a.zip | |
Fix Bug#32550
* lisp/net/tramp.el (tramp-rfn-eshadow-setup-minibuffer): Do not
use `symbol-value'.
(tramp-rfn-eshadow-update-overlay): Do not use `symbol-value'. Do
not let-bind `rfn-eshadow-overlay', assign it directly (due to
lexical binding). (Bug#32550)
| -rw-r--r-- | lisp/net/tramp.el | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 13447575599..22fcccb8b65 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -1892,7 +1892,6 @@ For definition of that list see `tramp-set-completion-function'." | |||
| 1892 | ;; The method related defaults. | 1892 | ;; The method related defaults. |
| 1893 | (cdr (assoc method tramp-completion-function-alist)))) | 1893 | (cdr (assoc method tramp-completion-function-alist)))) |
| 1894 | 1894 | ||
| 1895 | |||
| 1896 | ;;; Fontification of `read-file-name': | 1895 | ;;; Fontification of `read-file-name': |
| 1897 | 1896 | ||
| 1898 | (defvar tramp-rfn-eshadow-overlay) | 1897 | (defvar tramp-rfn-eshadow-overlay) |
| @@ -1902,11 +1901,11 @@ For definition of that list see `tramp-set-completion-function'." | |||
| 1902 | "Set up a minibuffer for `file-name-shadow-mode'. | 1901 | "Set up a minibuffer for `file-name-shadow-mode'. |
| 1903 | Adds another overlay hiding filename parts according to Tramp's | 1902 | Adds another overlay hiding filename parts according to Tramp's |
| 1904 | special handling of `substitute-in-file-name'." | 1903 | special handling of `substitute-in-file-name'." |
| 1905 | (when (symbol-value 'minibuffer-completing-file-name) | 1904 | (when minibuffer-completing-file-name |
| 1906 | (setq tramp-rfn-eshadow-overlay | 1905 | (setq tramp-rfn-eshadow-overlay |
| 1907 | (make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end))) | 1906 | (make-overlay (minibuffer-prompt-end) (minibuffer-prompt-end))) |
| 1908 | ;; Copy rfn-eshadow-overlay properties. | 1907 | ;; Copy rfn-eshadow-overlay properties. |
| 1909 | (let ((props (overlay-properties (symbol-value 'rfn-eshadow-overlay)))) | 1908 | (let ((props (overlay-properties rfn-eshadow-overlay))) |
| 1910 | (while props | 1909 | (while props |
| 1911 | ;; The `field' property prevents correct minibuffer | 1910 | ;; The `field' property prevents correct minibuffer |
| 1912 | ;; completion; we exclude it. | 1911 | ;; completion; we exclude it. |
| @@ -1931,26 +1930,24 @@ This is intended to be used as a minibuffer `post-command-hook' for | |||
| 1931 | been set up by `rfn-eshadow-setup-minibuffer'." | 1930 | been set up by `rfn-eshadow-setup-minibuffer'." |
| 1932 | ;; In remote files name, there is a shadowing just for the local part. | 1931 | ;; In remote files name, there is a shadowing just for the local part. |
| 1933 | (ignore-errors | 1932 | (ignore-errors |
| 1934 | (let ((end (or (overlay-end (symbol-value 'rfn-eshadow-overlay)) | 1933 | (let ((end (or (overlay-end rfn-eshadow-overlay) |
| 1935 | (minibuffer-prompt-end))) | 1934 | (minibuffer-prompt-end))) |
| 1936 | ;; We do not want to send any remote command. | 1935 | ;; We do not want to send any remote command. |
| 1937 | (non-essential t)) | 1936 | (non-essential t)) |
| 1938 | (when | 1937 | (when |
| 1939 | (tramp-tramp-file-p | 1938 | (tramp-tramp-file-p |
| 1940 | (buffer-substring-no-properties end (point-max))) | 1939 | (buffer-substring-no-properties end (point-max))) |
| 1941 | (save-excursion | 1940 | (save-restriction |
| 1942 | (save-restriction | 1941 | (narrow-to-region |
| 1943 | (narrow-to-region | 1942 | (1+ (or (string-match |
| 1944 | (1+ (or (string-match | 1943 | (tramp-rfn-eshadow-update-overlay-regexp) |
| 1945 | (tramp-rfn-eshadow-update-overlay-regexp) | 1944 | (buffer-string) end) |
| 1946 | (buffer-string) end) | 1945 | end)) |
| 1947 | end)) | 1946 | (point-max)) |
| 1948 | (point-max)) | 1947 | (setq rfn-eshadow-overlay tramp-rfn-eshadow-overlay) |
| 1949 | (let ((rfn-eshadow-overlay tramp-rfn-eshadow-overlay) | 1948 | (let (rfn-eshadow-update-overlay-hook file-name-handler-alist) |
| 1950 | (rfn-eshadow-update-overlay-hook nil) | 1949 | (move-overlay rfn-eshadow-overlay (point-max) (point-max)) |
| 1951 | file-name-handler-alist) | 1950 | (rfn-eshadow-update-overlay))))))) |
| 1952 | (move-overlay rfn-eshadow-overlay (point-max) (point-max)) | ||
| 1953 | (rfn-eshadow-update-overlay)))))))) | ||
| 1954 | 1951 | ||
| 1955 | (add-hook 'rfn-eshadow-update-overlay-hook | 1952 | (add-hook 'rfn-eshadow-update-overlay-hook |
| 1956 | 'tramp-rfn-eshadow-update-overlay) | 1953 | 'tramp-rfn-eshadow-update-overlay) |
| @@ -4616,8 +4613,6 @@ Only works for Bourne-like shells." | |||
| 4616 | ;; strange when doing zerop, we should kill the process and start | 4613 | ;; strange when doing zerop, we should kill the process and start |
| 4617 | ;; again. (Greg Stark) | 4614 | ;; again. (Greg Stark) |
| 4618 | ;; | 4615 | ;; |
| 4619 | ;; * Make shadowfile.el grok Tramp filenames. (Bug#4526, Bug#4846) | ||
| 4620 | ;; | ||
| 4621 | ;; * I was wondering if it would be possible to use tramp even if I'm | 4616 | ;; * I was wondering if it would be possible to use tramp even if I'm |
| 4622 | ;; actually using sshfs. But when I launch a command I would like | 4617 | ;; actually using sshfs. But when I launch a command I would like |
| 4623 | ;; to get it executed on the remote machine where the files really | 4618 | ;; to get it executed on the remote machine where the files really |