1

In Emacs 24.3.1, I upgraded Mediawiki package to the latest version, 20150403..., using the package manager. After restarting, I found that I can't access remote Mediawiki sites any more, after inputting user name and password as usual, I got a

Wrong type argument: listp, 0 

error in the mini buffer. Anybody else? Any idea how to fix it?

Edit:

This is what I get in a backtrace buffer:

Debugger entered--Lisp error: (wrong-type-argument listp 0)
  mediawiki-page-get-revision((page ((pageid . "1") (ns . "0") (title . "Main Page") (contentmodel . "wikitext") (pagelanguage . "en") (touched . "2014-03-12T04:57:54Z") (lastrevid . "505") (counter . "2691") (length . "141") (starttimestamp . "2015-05-29T07:52:26Z") (edittoken . "b3b54027c1c571738764f73dee1e4abd+\\")) (revisions nil (rev ((revid . "505") (parentid . "454") (user . "XXX") (timestamp . "2014-03-12T04:57:54Z") (comment . "") (contentformat . "text/x-wiki") (contentmodel . "wikitext") (xml:space . "preserve")) "Main page."))) 0 timestamp)
  mediawiki-save-metadata("1" (page ((pageid . "1") (ns . "0") (title . "Main Page") (contentmodel . "wikitext") (pagelanguage . "en") (touched . "2014-03-12T04:57:54Z") (lastrevid . "505") (counter . "2691") (length . "141") (starttimestamp . "2015-05-29T07:52:26Z") (edittoken . "b3b54027c1c571738764f73dee1e4abd+\\")) (revisions nil (rev ((revid . "505") (parentid . "454") (user . "XXX") (timestamp . "2014-03-12T04:57:54Z") (comment . "") (contentformat . "text/x-wiki") (contentmodel . "wikitext") (xml:space . "preserve")) "Main page."))))
  mediawiki-get("1" "Main Page")
  mediawiki-edit("1" "Main_Page")
  mediawiki-site()
  call-interactively(mediawiki-site record nil)
  command-execute(mediawiki-site record)
  execute-extended-command(nil "mediawiki-site")
  call-interactively(execute-extended-command nil nil)
  • Maybe you should upgrade to latest Emacs 24.5. – Tu Do May 23 '15 at 6:19
  • Tried that to no avail. – Meng Lu May 23 '15 at 16:37
  • Fails for me as well with emacs 24.5 and latest mediawiki from melpa – user8441 May 28 '15 at 10:32
  • 2
    You might want to report that issue on the bug tracker for the package: github.com/hexmode/mediawiki-el – T. Verron May 28 '15 at 13:53
  • 1
    I'd like to help, but I need the backtrace. That, or which (public) wiki you are trying this on. (Sorry about the delay in responding... someone pinged me about this while I was at a conference.) – hexmode May 28 '15 at 18:13
2

I fixed it by changing lines 177 and following from:

  (cadr revision))
 ((assoc bit (car revision))
  (cdr (assoc bit (car revision))))
 (t revision))))

to:

  (cadr rev))
 ((assoc bit (car rev))
  (cdr (assoc bit (car rev))))
 (t rev))))
  • Since I reported the issue, I restored the older version when the project hadn't moved to GitHub, and it worked. Now I'll try your fix. I still hope the official author of the mode could fix it in the official version. – Meng Lu Jun 21 '15 at 18:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.