volatile-highlights.el
volatile-highlights.el copied to clipboard
occur-mode-goto-occurence crashes with wrong type error
Calling occur
and clicking any line to call occur-mode-goto-occurence
crashes with error (wrong-type-error markerp ...
. I expect it to instead go to that line in the other buffer in which it is searching.
I've been able to correct the code locally, but I don't fully understand the package so I hesitate to make a pull request. My change, however, is:
➜ ~ diff volatile-highlights.el volatile-highlights.new.el
9c9,11
< ;; Revision: $Id$
---
> ;; Package-Version: 20230301.1402
> ;; Package-Commit: fcf6e2778454ce514c189a7d1fe70e03ad81c325
> ;; Revision: $Id: 1a65157904ec58ed515858a20cbebcde528a51db $
684,685c686,687
< (let ((marker (and *occur-str*
< (get-text-property 0 'occur-target *occur-str*)))
---
> (let ((marker (car (car (and *occur-str*
> (get-text-property 0 'occur-target *occur-str*)))))
Respectfully submitted if this helps someone else.
In fact, occur now does its own highlighting when visiting an occurrence. Perhaps volatile-highlights should just do nothing if the Emacs version is new enough? (The functionality was introduced into occur in https://github.com/emacsmirror/emacs/commit/abe7c22da96694ced1bc80ec7eb9eb8a662a568b, so starting in Emacs 28)
Seems reasonable to me @bcc32 ; though, the above patch seems to be holding steady for me with Emacs 29.3 whatever the default behavior is.