alphapapa / pocket-reader.el

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

Please go to the URL in the clipboard/kill-ring to authorize ‘pocket-lib’, then try again after `M-x pocket-reader` #2

Closed c02y closed 6 years ago

c02y commented 7 years ago
Please go to the URL in the clipboard/kill-ring to authorize ‘pocket-lib’, then try again

How to do that exactly?

alphapapa commented 7 years ago

Open your web browser, paste the URL into the address bar, hit Enter, and follow the instructions to authorize it.

cactail commented 7 years ago

I get pocket-lib--request: Symbol’s value as variable is void: request-token after run pocket-reader. I have nothing on my clipboard.

alphapapa commented 7 years ago

@cactail Thanks. Would you please run toggle-debug-on-error, run pocket-reader again, and paste the backtrace here? Also, what version of Emacs and what platform are you on?

cactail commented 7 years ago

Backtrace

Debugger entered--Lisp error: (void-variable request-token)
  pocket-lib--authorize()
  pocket-lib--request(get :data (:offset 0 :count 50 :detailType "complete" :state nil :favorite nil :tag nil :content-type nil :sort nil :search "" :domain nil :since nil) :sync t)
  pocket-lib-get(:detail-type "complete" :count 50 :offset 0 :search "" :state nil :favorite nil :tag nil)
  pocket-reader--get-items(nil)
  pocket-reader-search()
  pocket-reader-mode()
  pocket-reader()
  funcall-interactively(pocket-reader)
  call-interactively(pocket-reader record nil)
  command-execute(pocket-reader record)
  execute-extended-command(nil "pocket-reader" "pocket-rea")
  funcall-interactively(execute-extended-command nil "pocket-reader" "pocket-rea")
  call-interactively(execute-extended-command nil nil)
  command-execute(execute-extended-command)

Platform GNU Emacs 25.3.1 (x86_64-pc-linux-gnu, GTK+ Version 3.22.19) of 2017-09-16

alphapapa commented 7 years ago

@cactail Thanks. I don't understand how that error could be happening, because I don't see how that variable could be void. And it works for me and other users as well, so this is really a mystery.

Would you please evaluate this and paste the result, and any backtrace if you get one?

(pocket-lib--request-token :force nil)
cactail commented 7 years ago

Running that with eval-expression I have this -> f8d9f683-9061-ddcf-51f4-1ca47a. May be I did something wrong. Which are the exactly steps to get pocket-reader ready to use?

alphapapa commented 7 years ago

Wow, that's even stranger, because that indicates that that function call worked.

At this point the only idea I have is to ask you to test with emacs -q, in case it's a configuration issue. If you don't already know, that means you'll have to open your init file and eval the package-initialize lines manually, then (require 'pocket-reader) and then run pocket-reader. I don't know what else to suggest, because I can't see any reason for the void-variable error.

cactail commented 7 years ago

Ok. It's not a config issue, same response with emacs -q.

I need to logout of pocket and then run pocket-reader? -> NO, it's not the problem.

alphapapa commented 7 years ago

I need to logout of pocket and then run pocket-reader? -> NO, it's not the problem.

No, it's not even to that stage of the process yet.

Ok. It's not a config issue, same response with emacs -q.

Thanks for testing that. I'm sorry to say that I'm out of ideas at the moment. Well, here's one: if you have any other computers you can test on, especially on other OS/Emacs versions, please try it on them. Other than that, I'm stumped, because I don't understand how the (void-variable request-token) error could happen in this code:

      (if-let ((request-token (pocket-lib--request-token :force force))
               (access-token (pocket-lib--access-token request-token :force force)))
          (pocket-lib--save-access-token access-token)
        (error "Unable to authorize (request-token:%s)" request-token))

Which Linux distro are you on? Not that that should matter, but I don't know what else to ask.

alphapapa commented 7 years ago

Wait, of course, it must be coming from the error call. But since (pocket-lib--request-token :force nil) returned a string when you evaluated it, it should work in this code too. For example, this displays the error correctly:

(if-let ((one nil)
         (res (list one 2)))
    res
  (error "Nope: %s" one))

So how is request-token not being set...

This probably won't make any difference, but please try running the pocket-lib-reset-auth command and then pocket-reader again.

c02y commented 7 years ago

Open your web browser, paste the URL into the address bar, hit Enter, and follow the instructions to authorize it.

@alphapapa I just noticed that you put a getpocket.com link into my system paste board, this kind of thing never happens to me. Sorry about that. Maybe you should just include the link in the error message.

I installed the latest version of pocket-reader.el and try it again, it shows

Wrong type argument: arrayp, nil

Nothing more happens.

alphapapa commented 7 years ago

I just noticed that you put a getpocket.com link into my system paste board, this kind of thing never happens to me.

Sorry, what do you mean, "this kind of thing"?

The URL is in the Emacs kill-ring as well. You can access it there.

Maybe you should just include the link in the error message.

Maybe, but I think that would make the error message too long. It already says that the URL is in the kill-ring, so it's just waiting there to be retrieved.

I installed the latest version of pocket-reader.el and try it again, it shows

Wrong type argument: arrayp, nil Nothing more happens.

Thanks. Please run toggle-debug-on-error, run pocket-reader again, and paste the backtrace. Make sure to restart Emacs after installing the new package version, or the old version will still be loaded.

c02y commented 7 years ago

"this kind of thing"

String is put into system paste board automatically.

Normally, I copy things into kill-ring or system paste board manually.

Please run toggle-debug-on-error, run pocket-reader again, and paste the backtrace.

Debugger entered--Lisp error: (file-error "Cannot open load file" "No such file or directory" "thing-at-pt")
  require(thing-at-pt)
  eval-buffer(#<buffer  *load*> nil "/home/chz/.emacs.d/elpa/pocket-reader-20171010.1753/pocket-reader.el" nil t)  ; Reading at buffer position 2774
  load-with-code-conversion("/home/chz/.emacs.d/elpa/pocket-reader-20171010.1753/pocket-reader.el" "/home/chz/.emacs.d/elpa/pocket-reader-20171010.1753/pocket-reader.el" nil t)
  autoload-do-load((autoload "pocket-reader" "Show Pocket reading list.\n\n(fn)" t nil) pocket-reader)
  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)
alphapapa commented 7 years ago

String is put into system paste board automatically. Normally, I copy things into kill-ring or system paste board manually.

This depends on the platform and Emacs configuration. X, especially, has a confusing clipboard system. On my system, kill-new also adds to the system clipboard. That's why the message says "kill-ring/clipboard": if it's not on the clipboard, it is definitely in the kill-ring.

Debugger entered--Lisp error: (file-error "Cannot open load file" "No such file or directory" "thing-at-pt") require(thing-at-pt)

Thank you, this error is unrelated, but is now fixed. When MELPA rebuilds it, you can update the package and try again (or you can load the file manually now if you don't want to wait).

c02y commented 7 years ago

I remove pocket-reader-20171010.1753 directory and restart Emacs and use load-file to load the latest pocket-reader.el file in the github repo, and M-x pocket-reader, it shows

Wrong type argument: arrayp, nil

After M-x toggle-debug-on-error and M-x pocket-reader again, it shows:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("\\`\\(?:www\\)\\." "" nil)
  pocket-reader--url-domain(nil)
  (vector (pocket-reader--format-timestamp (string-to-number (plist-get it :time_added))) (pocket-reader--favorite-string (plist-get it :favorite)) title (pocket-reader--url-domain (plist-get it :resolved_url)) tags)
  (list (plist-get it :item_id) (vector (pocket-reader--format-timestamp (string-to-number (plist-get it :time_added))) (pocket-reader--favorite-string (plist-get it :favorite)) title (pocket-reader--url-domain (plist-get it :resolved_url)) tags))
  (cons (list (plist-get it :item_id) (vector (pocket-reader--format-timestamp (string-to-number (plist-get it :time_added))) (pocket-reader--favorite-string (plist-get it :favorite)) title (pocket-reader--url-domain (plist-get it :resolved_url)) tags)) --cl-var--)
  (setq --cl-var-- (cons (list (plist-get it :item_id) (vector (pocket-reader--format-timestamp (string-to-number (plist-get it :time_added))) (pocket-reader--favorite-string (plist-get it :favorite)) title (pocket-reader--url-domain (plist-get it :resolved_url)) tags)) --cl-var--))
  (while (consp --cl-var--) (setq it (car --cl-var--)) (setq title (pocket-reader--not-empty-string (apply (function propertize) (pocket-reader--or-string-not-blank (plist-get it :resolved_title) (plist-get it :given_title) "[untitled]") (let* ((--cl-var-- pocket-reader-keys) (key nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key (car --cl-var--)) (if (consp key) (progn ...)) (setq --cl-var-- (nconc ... --cl-var--)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--))))) (setq tags (pocket-reader--not-empty-string (s-join "," (plist-get it :tags)))) (setq --cl-var-- (cons (list (plist-get it :item_id) (vector (pocket-reader--format-timestamp (string-to-number (plist-get it :time_added))) (pocket-reader--favorite-string (plist-get it :favorite)) title (pocket-reader--url-domain (plist-get it :resolved_url)) tags)) --cl-var--)) (setq --cl-var-- (cdr --cl-var--)))
  (let* ((--cl-var-- item-plists) (it nil) (title nil) (tags nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq it (car --cl-var--)) (setq title (pocket-reader--not-empty-string (apply (function propertize) (pocket-reader--or-string-not-blank (plist-get it :resolved_title) (plist-get it :given_title) "[untitled]") (let* ((--cl-var-- pocket-reader-keys) (key nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq key ...) (if ... ...) (setq --cl-var-- ...) (setq --cl-var-- ...)) (nreverse --cl-var--))))) (setq tags (pocket-reader--not-empty-string (s-join "," (plist-get it :tags)))) (setq --cl-var-- (cons (list (plist-get it :item_id) (vector (pocket-reader--format-timestamp (string-to-number ...)) (pocket-reader--favorite-string (plist-get it :favorite)) title (pocket-reader--url-domain (plist-get it :resolved_url)) tags)) --cl-var--)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--))
  (let* ((query (or query "")) (query-words (s-split " " query)) (state (car (last (let* ((--cl-var-- ...) (keyword nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq keyword ...) (if ... ...) (setq --cl-var-- ...)) (nreverse --cl-var--))))) (favorite (if (car (last (let* (... ... ...) (while ... ... ... ...) (nreverse --cl-var--)))) (progn 1))) (count (setq pocket-reader-show-count (or (let ((it ...)) (if it (progn ...))) pocket-reader-show-count))) (tag (car (last (let* ((--cl-var-- query-words) (string nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq string ...) (if ... ...) (setq --cl-var-- ...)) (nreverse --cl-var--))))) (query-string (s-join " " query-words)) (items (cdr (car (cdr (cdr (pocket-lib-get :detail-type "complete" :count count :offset pocket-reader-offset :search query-string :state state :favorite favorite :tag tag)))))) (item-plists (mapcar (function (lambda (it) (let* (... ... ... ... ... ...) (while ... ... ... ... ... ... ...) (nreverse --cl-var--)))) items))) (let* ((--cl-var-- item-plists) (it nil) (title nil) (tags nil) (--cl-var-- nil)) (while (consp --cl-var--) (setq it (car --cl-var--)) (setq title (pocket-reader--not-empty-string (apply (function propertize) (pocket-reader--or-string-not-blank (plist-get it :resolved_title) (plist-get it :given_title) "[untitled]") (let* (... ... ...) (while ... ... ... ... ...) (nreverse --cl-var--))))) (setq tags (pocket-reader--not-empty-string (s-join "," (plist-get it :tags)))) (setq --cl-var-- (cons (list (plist-get it :item_id) (vector (pocket-reader--format-timestamp ...) (pocket-reader--favorite-string ...) title (pocket-reader--url-domain ...) tags)) --cl-var--)) (setq --cl-var-- (cdr --cl-var--))) (nreverse --cl-var--)))
  pocket-reader--get-items(nil)
  (let ((items (pocket-reader--get-items query))) (pocket-reader--add-items items) (if items nil (message "No items for query: %s" query)))
  pocket-reader-search()
  (let ((delay-mode-hooks t)) (tabulated-list-mode) (setq major-mode (quote pocket-reader-mode)) (setq mode-name "Pocket Reader") (progn (if (get (quote tabulated-list-mode) (quote mode-class)) (put (quote pocket-reader-mode) (quote mode-class) (get (quote tabulated-list-mode) (quote mode-class)))) (if (keymap-parent pocket-reader-mode-map) nil (set-keymap-parent pocket-reader-mode-map (current-local-map))) (let ((parent (char-table-parent pocket-reader-mode-syntax-table))) (if (and parent (not (eq parent (standard-syntax-table)))) nil (set-char-table-parent pocket-reader-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get pocket-reader-mode-abbrev-table :parents) (eq pocket-reader-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put pocket-reader-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map pocket-reader-mode-map) (set-syntax-table pocket-reader-mode-syntax-table) (setq local-abbrev-table pocket-reader-mode-abbrev-table) (advice-add (quote tabulated-list--sort-by-column-name) :after (quote pocket-reader--finalize)) (add-hook (quote kill-buffer-hook) (function (lambda nil (advice-remove (quote tabulated-list--sort-by-column-name) (quote pocket-reader--finalize)))) (quote append) (quote local)) (setq tabulated-list-sort-key (quote ("Added"))) (pocket-reader-search) (if (cdr tabulated-list-sort-key) nil (tabulated-list-sort 0)))
  (progn (make-local-variable (quote delay-mode-hooks)) (let ((delay-mode-hooks t)) (tabulated-list-mode) (setq major-mode (quote pocket-reader-mode)) (setq mode-name "Pocket Reader") (progn (if (get (quote tabulated-list-mode) (quote mode-class)) (put (quote pocket-reader-mode) (quote mode-class) (get (quote tabulated-list-mode) (quote mode-class)))) (if (keymap-parent pocket-reader-mode-map) nil (set-keymap-parent pocket-reader-mode-map (current-local-map))) (let ((parent (char-table-parent pocket-reader-mode-syntax-table))) (if (and parent (not (eq parent ...))) nil (set-char-table-parent pocket-reader-mode-syntax-table (syntax-table)))) (if (or (abbrev-table-get pocket-reader-mode-abbrev-table :parents) (eq pocket-reader-mode-abbrev-table local-abbrev-table)) nil (abbrev-table-put pocket-reader-mode-abbrev-table :parents (list local-abbrev-table)))) (use-local-map pocket-reader-mode-map) (set-syntax-table pocket-reader-mode-syntax-table) (setq local-abbrev-table pocket-reader-mode-abbrev-table) (advice-add (quote tabulated-list--sort-by-column-name) :after (quote pocket-reader--finalize)) (add-hook (quote kill-buffer-hook) (function (lambda nil (advice-remove (quote tabulated-list--sort-by-column-name) (quote pocket-reader--finalize)))) (quote append) (quote local)) (setq tabulated-list-sort-key (quote ("Added"))) (pocket-reader-search) (if (cdr tabulated-list-sort-key) nil (tabulated-list-sort 0))))
  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)

Just wondering:

Since it never works, have you ever tried it? Is it working in your environment?

alphapapa commented 7 years ago

After M-x toggle-debug-on-error and M-x pocket-reader again, it shows:

Thank you. As you can see from the backtrace, it is a different issue. I just pushed a fix for it.

Just wondering:

Since it never works, have you ever tried it? Is it working in your environment?

I don't understand why you would ask that. I have been using this project since I started it, before I ever published it to MELPA. I even posted it to Reddit asking for testers before I submitted it to MELPA, so that I could try to avoid problems like this, because every piece of software encounters problems when run by other users in other environments. Unfortunately no one on Reddit gave me any feedback. It currently has 42 downloads on MELPA, some of which have even posted here in other issues, indicating that it works for them. I use it every day. I'm using it right now. There are screenshots in the readme showing it working. And I would not publish untested code to MELPA in the first place.

You seem to have a talent for finding problems that other users haven't, which is a valuable skill. ;) I wish I had more testers like you earlier in the process.

Incidentally, this last backtrace you posted indicates that the original problem you reported in this thread is solved for you, because it's progressed to the stage of fetching items from Pocket and processing them for display. Hopefully this will be the last obstacle to your using it. Please let me know if it works now.

cactail commented 7 years ago

Well, I don't know why, but now pocket-reader works well for me.

alphapapa commented 7 years ago

Well, I don't know why, but now pocket-reader works well for me.

Because I fixed my bugs. ;) Unfortunately I can't catch them all myself. Thanks for your help.

Oh, wait, you had that weird bug that I still can't explain. Probably caused by outdated packages loaded in Emacs, a hazard native to the territory. Oh well, glad it's working now! :)

c02y commented 7 years ago

I don't understand why you would ask that. I have been using this project since I started it, before I ever published it to MELPA. ......

Sorry about that I was rude, I was irritable back then since I tried different versions of pocket-reader several times and it still doesn't work, I'll let you know any info until it works for me.

c02y commented 7 years ago

Finally, it works, partially, it can load my list in Pocket into Emacs. But when I tried to Enter on items in the list to open it, it failed to load the content(it took too long and had to M-g to stop it) and/or produced some error messages.

I tries several different items in the list, and none of them was loaded into Emacs successfully:

Contacting host: chrismm.com:443
gnutls.c: [0] (Emacs) Received alert:  Handshake failed
gnutls.el: (err=[-12] A TLS fatal alert has been received.) boot: (:priority NORMAL :hostname chrismm.com :loglevel 0 :min-prime-bits 256 :trustfiles (/etc/pki/tls/certs/ca-bundle.crt) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :callbacks nil)
gnutls-negotiate: GnuTLS error: #<process chrismm.com>, -12
Contacting host: changelog.com:443
Quit
Contacting host: jamesclear.com:80
gnutls.c: [0] (Emacs) Received alert:  Handshake failed
gnutls.el: (err=[-12] A TLS fatal alert has been received.) boot: (:priority NORMAL :hostname jamesclear.com :loglevel 0 :min-prime-bits 256 :trustfiles (/etc/pki/tls/certs/ca-bundle.crt) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :callbacks nil)
error in process filter: gnutls-negotiate: GnuTLS error: #<process jamesclear.com<1>>, -12
error in process filter: GnuTLS error: #<process jamesclear.com<1>>, -12
Quit
Contacting host: www.simplydjango.com:80
open-network-stream: www.simplydjango.com/80 Name or service not known
Contacting host: www.scotthyoung.com:443
org-back-to-heading: Before first headline at position 1 in buffer  *temp*
alphapapa commented 7 years ago

Sorry about that I was rude, I was irritable back then since I tried different versions of pocket-reader several times and it still doesn't work, I'll let you know any info until it works for me.

It's okay, I understand how frustrating software can be. Trust me, haha.

But when I tried to Enter on items in the list to open it, it failed to load the content(it took too long and had to M-g to stop it) and/or produced some error messages. I tries several different items in the list, and none of them was loaded into Emacs successfully:

Unfortunately those errors have nothing to do with pocket-reader, so I can't fix them:

open-network-stream: www.simplydjango.com/80 Name or service not known

That site is down due to a DNS error. I just tried it myself.

gnutls.c: [0] (Emacs) Received alert: Handshake failed

There is something wrong with your Emacs or system configuration, because the TLS handshake is failing. I guess it isn't failing for all sites though, since it can access the Pocket servers over TLS.

You might need to upgrade Emacs, upgrade curl, etc. But that doesn't have anything to do with pocket-reader. You might also try changing the request-method option, which pocket-lib uses.

c02y commented 7 years ago

You might need to upgrade Emacs, upgrade curl, etc.

Emacs version: GNU Emacs 25.2.2 (i686-pc-linux-gnu, GTK+ Version 2.20.1) curl version: curl 7.52.1 (i686-pc-linux-gnu) libcurl/7.52.1 OpenSSL/1.0.2l zlib/1.2.11

My OS is old, CentOS6.5 32-bit, unable to upgrade it, since it is my working environment in my company.

curl (, OpenSSL and zlib) is the latest version from yum.

I'll try pocket-reader in the new version of Linux (Fedora) in my home later, then let you know the result.

You might also try changing the request-method option, which pocket-lib uses.

request-method? I only got url-request-method variable in Emacs, it's variable is nil, if it is the variable I should change, what value should it be?

BTW, there is no string named request-method inside pocket-lib directory.

alphapapa commented 7 years ago

My OS is old, CentOS6.5 32-bit, unable to upgrade it, since it is my working environment in my company.

Might be the problem.

request-method? I only got url-request-method variable in Emacs, it's variable is nil, if it is the variable I should change, what value should it be?

Oops, I meant request-backend.

c02y commented 7 years ago

Oops, I meant request-backend.

Its value is curl.

Anyway, I'll try it in Fedora later.

alphapapa commented 7 years ago

Oops, I meant request-backend.

Its value is curl.

Use customize-option to change it.

alphapapa commented 7 years ago

@c02y Did you have any luck?

By the way, if you are interested, I'm testing a new branch that changes a few things internally and improves consistency. I think it's about ready to push to master, but if you would like to help test it, that would be great: https://github.com/alphapapa/pocket-reader.el/tree/ht

c02y commented 6 years ago

Sorry about the delay, I tried the master branch in Fedora 25, the content of the item will not be loaded into Emacs.

I tried to open several items in my list, all of them failed to be loaded with error message like:

org-back-to-heading: Before first headline at position 1 in buffer  *temp*-629084

I tried the ht branch in Fedora 25, the item list is not able to be loaded into Emacs with error message:

Wrong type argument: arrayp, nil

Didn't try ht branch in my old CentOS6.5 32bit.

alphapapa commented 6 years ago

Well, thanks for trying, but I don't understand why you'd get those errors. Only suggestions I have are to update all of your packages and then run with emacs -q.

c02y commented 6 years ago

In Fedora25, the error did come out after all the packages were updated. I executed pocket-reader after updating all the packages.

Just tested the ht branch in my old CentOS6.5 32bit, the list won't be loaded into Emacs with error message:

Wrong type argument: arrayp, nil
alphapapa commented 6 years ago

In Fedora25, the error did come out after all the packages were updated. I executed pocket-reader after updating all the packages.

Note that you have to restart Emacs for the updated packages to be loaded instead of the old versions.

Just tested the ht branch in my old CentOS6.5 32bit, the list won't be loaded into Emacs with error message:

I'll need a backtrace, because the error by itself isn't helpful.

c02y commented 6 years ago

Note that you have to restart Emacs for the updated packages to be loaded instead of the old versions.

Yes, I tested it after restarting.

backtrace

After active debug-on-error, load the latest version of ht branch of pocket-reader and M-x pocket-reader, since the backtrace is long, I wrote it into a file:

backtrace.log

alphapapa commented 6 years ago

Yes, I tested it after restarting.

Thanks, just making sure. I forget to do this myself sometimes.

After active debug-on-error, load the latest version of ht branch of pocket-reader and M-x pocket-reader, since the backtrace is long, I wrote it into a file:

Thank you. It looks like the non-ht branch was loaded, because the list of items is a list of alists rather than hash tables.

However, I see the problem causing that and am pushing a fix for it now. Thank you for your help with this.

The current commit on the ht branch should no longer have this problem, and I will fix it on the stable and master branches as well.

c02y commented 6 years ago

Just restarted and loaded the latest version of ht branch of pocket-reader on CentOS6.5, executed M-x pocket-reader, the list failed to be loaded into Emacs with error message:

Symbol’s function definition is void: ht-get*

backtrace info: backtrace.log

alphapapa commented 6 years ago

Please update the ht library.

c02y commented 6 years ago

I already checked my package manager before the test, and no updated version of ht package available.

my ht package version in package manager is 20171020.1146

and ht-get* are actually already defined in ht-20171020.1146

snapshot9

I just made another test, the this time it works, the list is loaded into Emacs, weird, I made two times last time (restart and load the el file), and the list failed to be loaded into Emacs.

Anyway, the list is loaded into Emacs this time, but with message (with debug-on-error enabled):

Args out of range: 4169, 4193

and the list is a little weird. The last old items are at the top of the window, the rest of the window is empty, and I have to scroll my window to get the full list. AND there are multiple blanks lines before the top item in the list.

And I tried to open items in the list (4 times), pocket-reader won't load any content with error messages:

Contacting host: chrismm.com:443
gnutls.c: [0] (Emacs) Received alert:  Handshake failed
gnutls.el: (err=[-12] A TLS fatal alert has been received.) boot: (:priority NORMAL :hostname chrismm.com :loglevel 0 :min-prime-bits 256 :trustfiles (/etc/pki/tls/certs/ca-bundle.crt) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :callbacks nil)
gnutls-negotiate: GnuTLS error: #<process chrismm.com>, -12
Contacting host: changelog.com:443
org-back-to-heading: Before first headline at position 1 in buffer  *temp*
Contacting host: jamesclear.com:443
gnutls.c: [0] (Emacs) Received alert:  Handshake failed
gnutls.el: (err=[-12] A TLS fatal alert has been received.) boot: (:priority NORMAL :hostname jamesclear.com :loglevel 0 :min-prime-bits 256 :trustfiles (/etc/pki/tls/certs/ca-bundle.crt) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :callbacks nil)
gnutls-negotiate: GnuTLS error: #<process jamesclear.com>, -12
Contacting host: www.scotthyoung.com:443
org-back-to-heading: Before first headline at position 1 in buffer  *temp*
alphapapa commented 6 years ago

I just made another test, the this time it works, the list is loaded into Emacs, weird, I made two times last time (restart and load the el file), and the list failed to be loaded into Emacs.

That's really strange. Sometimes I notice similar problems after updating packages, and it usually is fixed by deleting the package and reinstalling it. It seems that sometimes old byte-compiled files are left around, but I can't explain why.

Anyway, the list is loaded into Emacs this time, but with message (with debug-on-error enabled):

Args out of range: 4169, 4193

Without a backtrace it would be hard for me to track this down. My best guess is that it's related to Unicode, since you have non-ASCII characters in some of your items, but I thought Emacs should handle that correctly, so I don't know why that would happen.

If it happens again, and still doesn't give a backtrace, you may be able to find out which function gave that error by looking in the *Messages* buffer. For some reason, the minibuffer doesn't show the name of the calling function.

and the list is a little weird. The last old items are at the top of the window, the rest of the window is empty, and I have to scroll my window to get the full list.

I've been tweaking this. I should probably have it fixed soon.

AND there are multiple blanks lines before the top item in the list.

That seems strange, but I can't debug it without more information. If this happens again and you are still interested in this (I wouldn't blame you if you had had enough by now, haha), please go to the *scratch* buffer (or any empty emacs-lisp-mode buffer), type pocket-reader-items, run the pp-eval-last-sexp command, then copy and paste the contents of the window that opens. Note that this will show all the Pocket items that have been retrieved so far, so if you want to protect your privacy, you may want to redact some of the data before posting it here.

And I tried to open items in the list (4 times), pocket-reader won't load any content with error messages:

Contacting host: chrismm.com:443 gnutls.c: [0] (Emacs) Received alert: Handshake failed gnutls.el: (err=[-12] A TLS fatal alert has been received.) boot: (:priority NORMAL :hostname chrismm.com :loglevel 0 :min-prime-bits 256 :trustfiles (/etc/pki/tls/certs/ca-bundle.crt) :crlfiles nil :keylist nil :verify-flags nil :verify-error nil :callbacks nil) gnutls-negotiate: GnuTLS error: #, -12

This is a problem with your system's or Emacs's HTTPS/SSL/TLS setup. If you have any items in your list that are non-HTTPS URLs, they should work. You should also be able to open them in an external browser by pressing b.

c02y commented 6 years ago

Just test latest version of ht branch of pocket-reader, after M-x pocket-reader, the similar error message occurred, this following file is the backtrace file:

backtrace.log

Note that the backtrace.log is much shorter than the previous ones, and there are no non-ASCII characters in it anymore.

The last old items are at the top of the window, the rest of the window is empty, and I have to scroll my window to get the full list. AND there are multiple blanks lines before the top item in the list.

This issue still happens.

alphapapa commented 6 years ago

Just test latest version of ht branch of pocket-reader, after M-x pocket-reader, the similar error message occurred, this following file is the backtrace file:

backtrace.log

Note that the backtrace.log is much shorter than the previous ones, and there are no non-ASCII characters in it anymore.

Thank you. It's hard for me to be sure what's causing this, without being able to see the items in your list, but I just pushed a commit that I hope will fix this bug. I think it only happens in certain circumstances, depending on what items are being displayed, which is why it hasn't happened to me.

This issue still happens.

Yes, I haven't fixed that yet. Thanks for reminding me, though. ;)

I appreciate your help tracking down these bugs!

c02y commented 6 years ago

The message like:

Args out of range: 4169, 4193

is gone now. Thank you.

I appreciate your help tracking down these bugs!

You are welcome. I would like to use pocket in Emacs, so, tracking down bugs is what I should do.

alphapapa commented 6 years ago

Great!

I'm going to close this bug now, as it's gotten pretty long, but I'll open a new issue for the window-scrolling issue.