Unset unused markers

In case of overlay leaks.
This commit is contained in:
Henrik Lissner 2020-12-12 15:00:30 -05:00
parent c4a0174fe2
commit 765b6dcfca
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
3 changed files with 26 additions and 22 deletions

View file

@ -163,18 +163,20 @@ This can be passed nil as its second argument to unset handlers for MODES. e.g.
(+lookup--run-handlers handler identifier origin)
(user-error "No lookup handler selected"))
(run-hook-wrapped handlers #'+lookup--run-handlers identifier origin))))
(when (cond ((null result)
(message "No lookup handler could find %S" identifier)
nil)
((markerp result)
(funcall (or display-fn #'switch-to-buffer)
(marker-buffer result))
(goto-char result)
result)
(result))
(with-current-buffer (marker-buffer origin)
(better-jumper-set-jump (marker-position origin)))
result)))
(unwind-protect
(when (cond ((null result)
(message "No lookup handler could find %S" identifier)
nil)
((markerp result)
(funcall (or display-fn #'switch-to-buffer)
(marker-buffer result))
(goto-char result)
result)
(result))
(with-current-buffer (marker-buffer origin)
(better-jumper-set-jump (marker-position origin)))
result)
(set-marker origin nil))))
;;