dash-docs-el / helm-dash

Browse Dash docsets inside emacs
511 stars 59 forks source link

helm-dash-available-docsets: Wrong type argument: integer-or-marker-p, nil #132

Open oiwn opened 8 years ago

oiwn commented 8 years ago

Trying to install dash docsets using helm-dash-install-docstes

got error

Contacting host: api.github.com:443
helm-dash-available-docsets: Wrong type argument: integer-or-marker-p, nil

what could be wrong?

kidd commented 8 years ago

I just tried the latest version and works fine here. Only thing that occurs to me is that you didn't have internet connection and the response is invalid.... but not sure

elheremes commented 5 years ago

I've got the same problem too!

kidd commented 5 years ago

can you try with toggle-edebug-on-error ?

elheremes commented 5 years ago

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil) helm-dash-read-json-from-url("https://api.github.com/repos/Kapeli/feeds/contents/") helm-dash-official-docsets() byte-code("\300\301\302 \"C\207" [helm-dash-read-docset "Install docset" helm-dash-official-docsets] 3) call-interactively(helm-dash-install-docset record nil) command-execute(helm-dash-install-docset record) execute-extended-command(nil "helm-dash-install-docset") smex-read-and-run(("toggle-debug-on-error" "helm-dash-install-docset" "package-autoremove" "list-packages" "pyvenv-workon" "python-mode" "query-replace" "comment-region" "uncomment-region" "eshell" "eval-region" "org-latex-export-as-latex" "customize-variable" "shell" "text-mode" "replace-string" "google-this" "org-table-convert-region" "pdf-view-shrink" "irony-install-server" "helm-dash" "eval-defun" "xwidget-webkit-browse-url" "helm-dash-install-user-docset" "count-matches" "google-this-search" "package-install" "TeX-mode" "org-mode" "count-lines-page" "org-md-export-as-markdown" "pdf-view-fit-width-to-window" "revert-buffer" "pdf-tools-install" "recover-this-file" "all-the-icons-install-fonts" "pdf-view-fit-page-to-window" "tramp-cleanup-all-connections" "org-trello-install-key-and-token" "org-trello-install-board-metadata" "neotree" "shell-pop" "comment-box" "elpy-enable" "view-buffer" "doc-view-mode" "pdf-view-mode" "package-delete" "google-this-word" "toggle-word-wrap" ...)) smex() funcall-interactively(smex) call-interactively(smex nil nil) command-execute(smex)

Here

starenka commented 5 years ago

happens to me also w/ helm-dash-install-docset (in like 99% of cases):

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p nil)
  helm-dash-read-json-from-url("https://api.github.com/repos/Kapeli/feeds/contents/")
  helm-dash-official-docsets()
  byte-code("\300\301\302 \"C\207" [helm-dash-read-docset "Install docset" helm-dash-official-docsets] 3)
  call-interactively(helm-dash-install-docset record nil)
  command-execute(helm-dash-install-docset record)
  #f(compiled-function (arg &optional command-name) "Preconfigured `helm' for Emacs commands.\nIt is `helm' replacement of regular `M-x' `execute-extended-command'.\n\nUnlike regular `M-x' emacs vanilla `execute-extended-command' command,\nthe prefix args if needed, can be passed AFTER starting `helm-M-x'.\nWhen a prefix arg is passed BEFORE starting `helm-M-x', the first `C-u'\nwhile in `helm-M-x' session will disable it.\n\nYou can get help on each command by persistent action." (interactive #f(compiled-function () #<bytecode 0x1e73b35>)) #<bytecode 0x2c5976d>)(nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset")))
  apply(#f(compiled-function (arg &optional command-name) "Preconfigured `helm' for Emacs commands.\nIt is `helm' replacement of regular `M-x' `execute-extended-command'.\n\nUnlike regular `M-x' emacs vanilla `execute-extended-command' command,\nthe prefix args if needed, can be passed AFTER starting `helm-M-x'.\nWhen a prefix arg is passed BEFORE starting `helm-M-x', the first `C-u'\nwhile in `helm-M-x' session will disable it.\n\nYou can get help on each command by persistent action." (interactive #f(compiled-function () #<bytecode 0x2352405>)) #<bytecode 0x2c5976d>) (nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset"))))
  helm-M-x(nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset")))
  funcall-interactively(helm-M-x nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset")))
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)
  recursive-edit()
  debug(debug)
  debug--implement-debug-on-entry(nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset")))
  apply(debug--implement-debug-on-entry (nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset"))))
* helm-M-x(nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset")))
  funcall-interactively(helm-M-x nil #("helm-dash-install-docset" 0 24 (match-part "helm-dash-install-docset")))
  call-interactively(helm-M-x nil nil)
  command-execute(helm-M-x)
starenka /tmp % wget -S https://api.github.com/repos/Kapeli/feeds/contents/
--2019-01-19 12:40:30--  https://api.github.com/repos/Kapeli/feeds/contents/
Resolving api.github.com (api.github.com)... 192.30.253.117, 192.30.253.116
Connecting to api.github.com (api.github.com)|192.30.253.117|:443... connected.
HTTP request sent, awaiting response... 
  HTTP/1.1 200 OK
  Server: GitHub.com
  Date: Sat, 19 Jan 2019 11:40:31 GMT
  Content-Type: application/json; charset=utf-8
  Content-Length: 171028
  Status: 200 OK
  X-RateLimit-Limit: 60
  X-RateLimit-Remaining: 49
  X-RateLimit-Reset: 1547900950
  Cache-Control: public, max-age=60, s-maxage=60
  Vary: Accept
  ETag: "28fd584855890e4891595bd3e2048a4d3ea810cc"
  Last-Modified: Fri, 18 Jan 2019 03:42:27 GMT
  X-GitHub-Media-Type: github.v3; format=json
  Access-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type
  Access-Control-Allow-Origin: *
  Strict-Transport-Security: max-age=31536000; includeSubdomains; preload
  X-Frame-Options: deny
  X-Content-Type-Options: nosniff
  X-XSS-Protection: 1; mode=block
  Referrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin
  Content-Security-Policy: default-src 'none'
  X-GitHub-Request-Id: BB86:3FDF:7ACE41:1390C43:5C430CAE
Length: 171028 (167K) [application/json]
Saving to: ‘index.html’

index.html                                       100%[========================================================================================================>] 167.02K   361KB/s    in 0.5s    

2019-01-19 12:40:32 (361 KB/s) - ‘index.html’ saved [171028/171028]

It seems the JSON containing list of docset is genereted via Github API, which has rate-limiting. Maybe this is the issue. Perhaps caching of this generated file would help (beyond mi lisp-fu :( )?