[emacs-w3m:13510] Bug in w3m--get-page-anchors

Michael Heerdegen <[email protected]>
Newsgroups gmane.emacs.w3m
Message-ID <[email protected]>
Hi,

(I'm directly CC'ing Yamaoka because the last time I tried to post to
this group something went wrong).

This is Emacs master (doesn't matter AFAICT) with recent w3m installed
from Melpa, 20190801.156 (does matter, the problem is quite new).

Recipe: I open some page, say, https://de.wikipedia.org/wiki/Lie-Gruppe (also
doesn't matter), click on any anchor and get this error:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("\\`cite_.*[0-9]\\'" nil)
  #f(compiled-function (x) #<bytecode 0x1559a52f6745>)((nil . 29925))
  cl-remove(nil (("p-search" . 29926) (nil . 29925) ("p-search" . 29918) (nil . 29916) ("p-search" . 29910) (nil . 29909) ("p-search" . 29880) ("mw-head" . 29613) ("Weblinks" . 28992) ("Literatur" . 26591) ("cite_note-8" . 26571) ("cite_note-hawkins-p100-7" . 26543) ("cite_note-hawkins-p43-6" . 26516) ("cite_note-hawkins-p76-5" . 26489) ("cite_note-hawkins-p2-4" . 26463) ("cite_note-hawkins-p1-3" . 26431) ("cite_note-2" . 25259) ("cite_note-1" . 25164) ("Anmerkungen" . 25116) ("Klassifikationsmöglichkeiten" . 23571) ("Differentialgeometrie_von_Lie-Gruppen" . 21971) ("cite_ref-8" . 21823) ("cite_ref-hawkins-p100_7-0" . 21010) ("cite_ref-hawkins-p43_6-0" . 19543) ("cite_ref-hawkins-p76_5-0" . 18227) ("cite_ref-hawkins-p2_4-0" . 17957) ("cite_ref-hawkins-p1_3-1" . 17696) ("cite_ref-hawkins-p1_3-0" . 17401) ("Frühgeschichte" . 17281) ("Beispiele" . 13894) ("Lie-Untergruppe" . 13211) ("Lie-Gruppen-Homomorphismus" . 12055) ("Lie-Algebra_der_Lie-Gruppe" . 9284) ("Lie-Gruppe" . 8637) ("Definitionen" . 8588) ("Erste_Beispiele" . 1775) ("cite_ref-2" . 738) ("cite_ref-1" . 263) ("top" . 105) ("footer-poweredbyico" . 31618) ("footer-copyrightico" . 31606) ("footer-icons" . 31602) ("footer-places-mobileview" . 31586) ("footer-places-cookiestatement" . 31557) ("footer-places-developers" . 31542) ("footer-places-disclaimer" . 31528) ("footer-places-about" . 31509) ("footer-places-privacy" . 31493) ("footer-places" . 31489) ("footer-info-copyright-info" . 30951) ...) :if #f(compiled-function (x) #<bytecode 0x1559a52f6745>))
  apply(cl-remove nil (("p-search" . 29926) (nil . 29925) ("p-search" . 29918) (nil . 29916) ("p-search" . 29910) (nil . 29909) ("p-search" . 29880) ("mw-head" . 29613) ("Weblinks" . 28992) ("Literatur" . 26591) ("cite_note-8" . 26571) ("cite_note-hawkins-p100-7" . 26543) ("cite_note-hawkins-p43-6" . 26516) ("cite_note-hawkins-p76-5" . 26489) ("cite_note-hawkins-p2-4" . 26463) ("cite_note-hawkins-p1-3" . 26431) ("cite_note-2" . 25259) ("cite_note-1" . 25164) ("Anmerkungen" . 25116) ("Klassifikationsmöglichkeiten" . 23571) ("Differentialgeometrie_von_Lie-Gruppen" . 21971) ("cite_ref-8" . 21823) ("cite_ref-hawkins-p100_7-0" . 21010) ("cite_ref-hawkins-p43_6-0" . 19543) ("cite_ref-hawkins-p76_5-0" . 18227) ("cite_ref-hawkins-p2_4-0" . 17957) ("cite_ref-hawkins-p1_3-1" . 17696) ("cite_ref-hawkins-p1_3-0" . 17401) ("Frühgeschichte" . 17281) ("Beispiele" . 13894) ("Lie-Untergruppe" . 13211) ("Lie-Gruppen-Homomorphismus" . 12055) ("Lie-Algebra_der_Lie-Gruppe" . 9284) ("Lie-Gruppe" . 8637) ("Definitionen" . 8588) ("Erste_Beispiele" . 1775) ("cite_ref-2" . 738) ("cite_ref-1" . 263) ("top" . 105) ("footer-poweredbyico" . 31618) ("footer-copyrightico" . 31606) ("footer-icons" . 31602) ("footer-places-mobileview" . 31586) ("footer-places-cookiestatement" . 31557) ("footer-places-developers" . 31542) ("footer-places-disclaimer" . 31528) ("footer-places-about" . 31509) ("footer-places-privacy" . 31493) ("footer-places" . 31489) ("footer-info-copyright-info" . 30951) ...) :if #f(compiled-function (x) #<bytecode 0x1559a52f6745>) nil)
  cl-remove-if(#f(compiled-function (x) #<bytecode 0x1559a52f6745>) (("p-search" . 29926) (nil . 29925) ("p-search" . 29918) (nil . 29916) ("p-search" . 29910) (nil . 29909) ("p-search" . 29880) ("mw-head" . 29613) ("Weblinks" . 28992) ("Literatur" . 26591) ("cite_note-8" . 26571) ("cite_note-hawkins-p100-7" . 26543) ("cite_note-hawkins-p43-6" . 26516) ("cite_note-hawkins-p76-5" . 26489) ("cite_note-hawkins-p2-4" . 26463) ("cite_note-hawkins-p1-3" . 26431) ("cite_note-2" . 25259) ("cite_note-1" . 25164) ("Anmerkungen" . 25116) ("Klassifikationsmöglichkeiten" . 23571) ("Differentialgeometrie_von_Lie-Gruppen" . 21971) ("cite_ref-8" . 21823) ("cite_ref-hawkins-p100_7-0" . 21010) ("cite_ref-hawkins-p43_6-0" . 19543) ("cite_ref-hawkins-p76_5-0" . 18227) ("cite_ref-hawkins-p2_4-0" . 17957) ("cite_ref-hawkins-p1_3-1" . 17696) ("cite_ref-hawkins-p1_3-0" . 17401) ("Frühgeschichte" . 17281) ("Beispiele" . 13894) ("Lie-Untergruppe" . 13211) ("Lie-Gruppen-Homomorphismus" . 12055) ("Lie-Algebra_der_Lie-Gruppe" . 9284) ("Lie-Gruppe" . 8637) ("Definitionen" . 8588) ("Erste_Beispiele" . 1775) ("cite_ref-2" . 738) ("cite_ref-1" . 263) ("top" . 105) ("footer-poweredbyico" . 31618) ("footer-copyrightico" . 31606) ("footer-icons" . 31602) ("footer-places-mobileview" . 31586) ("footer-places-cookiestatement" . 31557) ("footer-places-developers" . 31542) ("footer-places-disclaimer" . 31528) ("footer-places-about" . 31509) ("footer-places-privacy" . 31493) ("footer-places" . 31489) ("footer-info-copyright-info" . 30951) ...))
  w3m--filter-page-anchors((("p-search" . 29926) (nil . 29925) ("p-search" . 29918) (nil . 29916) ("p-search" . 29910) (nil . 29909) ("p-search" . 29880) ("mw-head" . 29613) ("Weblinks" . 28992) ("Literatur" . 26591) ("cite_note-8" . 26571) ("cite_note-hawkins-p100-7" . 26543) ("cite_note-hawkins-p43-6" . 26516) ("cite_note-hawkins-p76-5" . 26489) ("cite_note-hawkins-p2-4" . 26463) ("cite_note-hawkins-p1-3" . 26431) ("cite_note-2" . 25259) ("cite_note-1" . 25164) ("Anmerkungen" . 25116) ("Klassifikationsmöglichkeiten" . 23571) ("Differentialgeometrie_von_Lie-Gruppen" . 21971) ("cite_ref-8" . 21823) ("cite_ref-hawkins-p100_7-0" . 21010) ("cite_ref-hawkins-p43_6-0" . 19543) ("cite_ref-hawkins-p76_5-0" . 18227) ("cite_ref-hawkins-p2_4-0" . 17957) ("cite_ref-hawkins-p1_3-1" . 17696) ("cite_ref-hawkins-p1_3-0" . 17401) ("Frühgeschichte" . 17281) ("Beispiele" . 13894) ("Lie-Untergruppe" . 13211) ("Lie-Gruppen-Homomorphismus" . 12055) ("Lie-Algebra_der_Lie-Gruppe" . 9284) ("Lie-Gruppe" . 8637) ("Definitionen" . 8588) ("Erste_Beispiele" . 1775) ("cite_ref-2" . 738) ("cite_ref-1" . 263) ("top" . 105) ("footer-poweredbyico" . 31618) ("footer-copyrightico" . 31606) ("footer-icons" . 31602) ("footer-places-mobileview" . 31586) ("footer-places-cookiestatement" . 31557) ("footer-places-developers" . 31542) ("footer-places-disclaimer" . 31528) ("footer-places-about" . 31509) ("footer-places-privacy" . 31493) ("footer-places" . 31489) ("footer-info-copyright-info" . 30951) ...))
  w3m--get-page-anchors()
  [...]
  w3m-goto-url("https://de.wikipedia.org/wiki/Lie-Gruppe#Erste_Bei..." nil)
  w3m-view-this-url(nil nil)

Note the ill alist `w3m--filter-page-anchors' receives: every second key
is nil.  It is from `w3m--get-page-anchors': see this loop:

(while (setq pos (next-single-property-change pos 'w3m-name-anchor))
	(push (cons (car (get-text-property pos 'w3m-name-anchor)) pos)
	      anchor-list))

`next-single-property-change' also stops where the propertized text
ends, I think this is where the nil entries come from.

TIA, Michael.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.