alphapapa / pocket-reader.el

Emacs client for Pocket reading list (getpocket.com)
GNU General Public License v3.0
223 stars 12 forks source link

Spacemacs seems to force use of old/incorrect version of ht.el library #13

Closed Fabs closed 4 years ago

Fabs commented 5 years ago

I have spacemacs on emacs 26. I installed pocket-reader and the first run was asked to authenticate with pocket, all good. Then first time I tred to run pocket-reader I got the follwing error.


helm-M-x: Wrong number of arguments: (lambda (alist) "Create a hash table with initial values according to ALIST." (let ((h (ht-create))) (let ((--dolist-tail-- (reverse alist)) pair) (while --dolist-tail-- (setq pair (car --dolist-tail--)) (let ((key (car pair)) (value (cdr pair))) (ht-set! h key value)) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq pair nil) h))), 2```
alphapapa commented 5 years ago

Please provide a backtrace by enabling debug-on-error and running it again. Also, note that helm-M-x makes it a bit harder to follow the error, so try calling pocket-reader directly or with execute-extended-command.

Fabs commented 5 years ago

Thanks @alphapapa, I have debug-on-error turned on, but I do not get the buffer to open with the error (as I have seem happened before with some othe errors). the error knows point the function:

Contacting host: getpocket.com:443
pocket-reader--add-items: Wrong number of arguments: (lambda (alist) "Create a hash table with initial values according to ALIST." (let ((h (ht-create))) (let ((--dolist-tail-- (reverse alist)) pair) (while --dolist-tail-- (setq pair (car --dolist-tail--)) (let ((key (car pair)) (value (cdr pair))) (ht-set! h key value)) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq pair nil) h))), 2
alphapapa commented 5 years ago

I'm guessing that the authentication failed, but I can't diagnose the problem further without an actual backtrace. Try to reproduce it in plain emacs -q.

Fabs commented 5 years ago

Thanks again @alphapapa. I think auth is fine, I can see the token saved on my emacs.d. Also the backtrace contained a list with many (if not all) my pocket articles. I had to redact (....) it unfortunately, hope you can still figure something out of it.

It was not done with emacs -q but after a clean restart of my emacs.

Debugger entered--Lisp error: (wrong-number-of-arguments (lambda (alist) "Create a hash table with initial values according to ALIST." (let ((h (ht-create))) (let ((--dolist-tail-- (reverse alist)) pair) (while --dolist-tail-- (setq pair (car --dolist-tail--)) (let ((key (car pair)) (value (cdr pair))) (ht-set! h key value)) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq pair nil) h))) 2)
  ht<-alist(((item_id . "2400205164") (resolved_id . "1984423682") (given_url . "https://www.amazon.de/Oxygen-Advantage-scientifically-breathing-revolutionise-ebook/dp/B00V3KJWN2/ref=tmm_kin_swatch_0?_encoding=UTF8&qid=&sr=") (given_title . "The Oxygen Advantage: The simple, scientifically proven breathing technique") (favorite . "0") (status . "0") (time_added . "1543244878") (time_updated . "1543244880") (time_read . "0") (time_favorited . "0") (sort_id . 0) (resolved_title . "The Oxygen Advantage: The simple, scientifically proven breathing technique that will revolutionise your health and fitness (English Edition)") (resolved_url . "https://www.amazon.de/Oxygen-Advantage-scientifically-breathing-revolutionise-ebook/dp/B00V3KJWN2") (excerpt . "McKeown's research and suggestions for breathing dramatically changed my life.   The book explains more than diet, posture, blood chemistry, pharmaceuticals, or exercise, breathing is the key to changing how we develop physically. It determines how is our short- and long-term health.") (is_article . "1") (is_index . "0") (has_video . "0") (has_image . "0") (word_count . "402") (lang . "en") (domain_metadata (name . "Amazon.de") (logo . "https://logo.clearbit.com/amazon.de?size=800") (greyscale_logo . "https://logo.clearbit.com/amazon.de?size=800&greyscale=true")) (listen_duration_estimate . 156)) eq)
  pocket-reader--add-items(((\2400205164 (item_id . "2400205164") (resolved_id . "1984423682") (given_url . "https://www.amazon.de/Oxygen-Advantage-scientifically-breathing-revolutionise-ebook/dp/B00V3KJWN2/ref=tmm_kin_swatch_0?_encoding=UTF8&qid=&sr=") (given_title . "The Oxygen Advantage: The simple, scientifically proven breathing technique") (favorite . "0") (status . "0") (time_added . "1543244878") (time_updated . "1543244880") (time_read . "0") (time_favorited . "0") (sort_id . 0) (resolved_title . "The Oxygen Advantage: The simple, scientifically proven breathing technique that will revolutionise your health and fitness (English Edition)") (resolved_url . "https://www.amazon.de/Oxygen-Advantage-scientifically-breathing-revolutionise-ebook/dp/B00V3KJWN2") (excerpt . "McKeown's research and suggestions for breathing dramatically changed my life.   The book explains more than diet, posture, blood chemistry, pharmaceuticals, or exercise, breathing is the key to changing how we develop physically. It determines how is our short- and long-term health.") (is_article . "1") (is_index . "0") (has_video . "0") (has_image . "0") (word_count . "402") (lang . "en") (domain_metadata (name . "Amazon.de") (logo . "https://logo.clearbit.com/amazon.de?size=800") (greyscale_logo . "https://logo.clearbit.com/amazon.de?size=800&greyscale=true")) (listen_duration_estimate . 156)) (....))
  pocket-reader-search(nil)
  pocket-reader-refresh()
  pocket-reader-mode()
  pocket-reader()
  funcall-interactively(pocket-reader)
  call-interactively(pocket-reader record nil)
  command-execute(pocket-reader record)
  helm-M-x(nil #("pocket-reader" 0 13 (match-part "pocket-reader")))
  funcall-interactively(helm-M-x nil #("pocket-reader" 0 13 (match-part "pocket-reader")))
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)
Fabs commented 5 years ago

This article I left was added this morning, so I don´t believe he is the particular problem (because I was having the issue yesterday). But what that tells me is that it is probabbly data on some of the articles I have.

alphapapa commented 5 years ago

Unfortunately it would be very hard for me to debug it without an example of an item that causes the error. If you can narrow it down to one that causes the problem, I can probably fix it.

Fabs commented 5 years ago

Right. Thanks for all the help @alphapapa. I have 500+ items so I guess it will be a tricky thing to do. I will let you know if I find the culprit. Thanks once more.

alphapapa commented 5 years ago

Please verify that you have a recent version of ht.el installed. That might be the problem.

Fabs commented 5 years ago

I am using spacemacs. I have two ht.el files. ./elpa/ht-20180129.2234/ht.el -> version 2.3 https://gist.github.com/Fabs/1b0128c43e1f109fe45aecb74beb001f

./core/libs/ht.el -> version 2.0 https://gist.github.com/Fabs/a1715c0576e7f3201b370e3e9965981c

I would assume that your library is using the first.

alphapapa commented 5 years ago

Only one instance of a library with the same name can be loaded into Emacs. I don't know how Spacemacs handles that. Please try to reproduce the problem with plain Emacs, i.e. emacs -q, to ensure Spacemacs is not the problem.

codicef commented 5 years ago

Same error here, I'm using Spacemacs develop. helm-M-x: Wrong number of arguments: (lambda (alist) "Create a hash table with initial values according to ALIST." (let ((h (ht-create))) (let ((--dolist-tail-- (reverse alist)) pair) (while --dolist-tail-- (setq pair (car --dolist-tail--)) (let ((key (car pair)) (value (cdr pair))) (ht-set! h key value)) (setq --dolist-tail-- (cdr --dolist-tail--))) (setq pair nil) h))), 2

alphapapa commented 5 years ago

@codicef See my previous comment. If there are two different versions of ht installed into your Emacs config, that's a configuration problem. If Spacemacs is forcing that to happen, it's a Spacemacs bug. If you can't reproduce the problem with emacs -q, then it's a configuration and/or a Spacemacs problem, not a bug in this package.

codicef commented 5 years ago

You're right, I temporarily fixed the problem re-loading the correct version of ht.

alphapapa commented 5 years ago

@codicef Thank you. You might consider mentioning that to the Spacemacs project.

dorneanu commented 4 years ago

@codicef can you please share how you did that? I'm having exactly the same issue (2 different version of ht with spacemacs).

EDITED: Never mind. For all spacemacs users just load the newer library by using: load-library RET ht. Afterwards you can use pocket-reader.

alphapapa commented 4 years ago

@dorneanu Please report this bug to the Spacemacs tracker so it can be fixed in Spacemacs.