astoff / devdocs.el

Emacs viewer for DevDocs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

On Emacs master devdocs lookup does not jump to target anymore

canatella opened this issue · comments

Its seems shr has changed the way it stores target ids in property, its now a list of ids. Using

(defun devdocs-goto-target ()
  "Go to the original position in a DevDocs buffer."
  (interactive)
  (goto-char (point-min))
  (when-let ((match (text-property-search-forward 'shr-target-id shr-target-id #'member t)))
    (goto-char (prop-match-beginning match))))

fixes the problem

What Emacs version are you using (and since when shr has changed)? It still works for me on Emacs 28.

I'm on the master branch on commit bef9fcc999, it seems to have been changed recently in https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=7904cae492062ac70ae1539be5b21c5274dcdf46

7904cae492062ac70ae1539be5b21c5274dcdf46
Author:     Lars Ingebrigtsen <larsi@gnus.org>
AuthorDate: Sun Dec 19 13:44:21 2021 +0100
Commit:     Lars Ingebrigtsen <larsi@gnus.org>
CommitDate: Sun Dec 19 13:44:21 2021 +0100

Parent:     ae289486d0 Fix prompt in `sql-sqlite'
Contained:  master
Follows:    emacs-27.1 (12486)

Rework how shr sets <span id='foo'> targets to make it more reliable

* lisp/net/eww.el (eww-display-html): The target is now a list.
* lisp/net/shr.el (shr--link-targets): New variable.
(shr-insert-document): Set the targets.
(shr-descend): Save targets and apply them later.
(shr-ensure-paragraph): Remove hack to avoid filling from removing
targets.
(shr-tag-a): Save targets for later.
(shr-render-td-1): Bind and set targets (bug#52512).