Open Alexander-Shukaev opened 4 years ago
Ah, so it's here:
(defvar evil--jumps-buffer-targets "\\*\\(new\\|scratch\\)\\*"
"Regexp to match against `buffer-name' to determine whether it's a valid jump target.")
(defun evil--jumps-push ()
"Pushes the current cursor/file position to the jump list."
(let ((target-list (evil--jumps-get-window-jump-list)))
(let ((file-name (buffer-file-name))
(buffer-name (buffer-name))
(current-pos (point-marker))
(first-pos nil)
(first-file-name nil)
(excluded nil))
(when (and (not file-name)
(string-match-p evil--jumps-buffer-targets buffer-name))
(setq file-name buffer-name))
Why would *scratch*
have some special treatment? Plus,
(defun evil--jumps-savehist-sync ()
"Updates the printable value of window jumps for `savehist'."
(setq evil-jumps-history
(cl-remove-if-not #'identity
(mapcar #'(lambda (jump)
(let* ((mark (car jump))
(pos (if (markerp mark)
(marker-position mark)
mark))
(file-name (cadr jump)))
(if (and (not (file-remote-p file-name))
(file-exists-p file-name)
pos)
(list pos file-name)
nil)))
(ring-elements (evil--jumps-get-window-jump-list))))))
where (not (file-remote-p file-name))
would always return true for "*scratch*"
and hence try (file-exists-p file-name)
, which when in TRAMP buffer... well, you know.
Issue type
Environment
Emacs version:
GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.14.13) of 2019-04-25
Operating System: RHEL7.2 Evil version:Evil version 1.13.0
Evil installation type: MELPA Graphical/Terminal: X Tested in amake emacs
session (see CONTRIBUTING.md): NoJust encountered a hang in TRAMP buffer and upon quit generated the following backtrace:
I looked over
evil--jumps-savehist-sync
and I guess somewhere it incorrectly assumes that*scratch*
is a file-visiting buffer, while it's not. It must bebuffer-file-name
check missing somewhere inevil-jumps
.