dangom / writefreely.el

*Frictionless* blogging with Org Mode. No setup required.
90 stars 7 forks source link

error "Eager macro-expansion failure: (gv-invalid-place \"token\")" #26

Closed DaviRaubach closed 1 year ago

DaviRaubach commented 1 year ago

Hello,

I am trying your package and I am getting this:

Debugger entered--Lisp error: (error "Eager macro-expansion failure: (gv-invalid-place \"token\")")
  error("Eager macro-expansion failure: %S" (gv-invalid-place "token"))
  internal-macroexpand-for-load((defalias 'writefreely--json-encode-data #'(lambda (title body &optional post-token) "Encode TITLE and BODY string data as json for request.\nIf POST-TOKEN, encode it as well." (let* ((alist `...) (language (writefreely--get-orgmode-keyword "LANGUAGE")) (created-date (writefreely--formatted-date-from-keyword))) (when post-token (push alist `...)) (when language (push alist `...)) (when (and writefreely-maybe-publish-created-date created-date) (push alist `...)) (encode-coding-string (json-encode alist) 'utf-8)))) t)
  load-with-code-conversion("/Users/davi/.emacs.d/elpa/writefreely-20221024.221/writefreely.el" "/Users/davi/.emacs.d/elpa/writefreely-20221024.221..." nil t)
  command-execute(writefreely-publish-or-update record)
  counsel-M-x-action("writefreely-publish-or-update")
  #f(compiled-function (x) #<bytecode 0x5a63086a1741380>)("writefreely-publish-or-update")
  ivy-call()
  #<subr ivy-read>("M-x " [zls magit-section-show-headings :closed-icon Read\ manual tag-end lsp-pwsh-help-completion lsp-treemacs-cycle-severity embark--cache-info--completion-list docid access-label :maxLength c-electric-lt-gt lsp-rust-analyzer-injected-modifier-face c-state-min-scan-pos treemacs-icon-icon-refresh &error flycheck-mode-line-prefix cl-struct-flycheck-syntax-check-tags js--find-newline-backward f-ancestor-of? org-roam-ui--get-nodes edebug-mode-on-hook message-expand-name-databases C-i treemacs--button-symbol-switch c-make-ml-string-opener-re-function smie-config--guess-value kotlin-language-server ns-l-compact-sequence which-key--stop-timer c-list-found-types flycheck-pug-executable lsp-elixir-suggest-specs org-table-get-range mhtml--submode-keymap another-occurrence Above lsp-pyls-plugins-flake8-hang-closing lsp-pylsp-plugins-rope-completion-enabled treemacs--get-label-of lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-brackets lsp-lua-hint-enable utf7-direct-encoding-chars TeX-command-default no-truncate Futura core-accessing-symbol angle-bracket-arglist-escape tramp-handle-make-auto-save-file-name js--split-name ...] :predicate #f(compiled-function (sym) #<bytecode 0x11ea062cab4fccc3>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x :sort t)
  apply(#<subr ivy-read> ("M-x " [zls magit-section-show-headings :closed-icon Read\ manual tag-end lsp-pwsh-help-completion lsp-treemacs-cycle-severity embark--cache-info--completion-list docid access-label :maxLength c-electric-lt-gt lsp-rust-analyzer-injected-modifier-face c-state-min-scan-pos treemacs-icon-icon-refresh &error flycheck-mode-line-prefix cl-struct-flycheck-syntax-check-tags js--find-newline-backward f-ancestor-of? org-roam-ui--get-nodes edebug-mode-on-hook message-expand-name-databases C-i treemacs--button-symbol-switch c-make-ml-string-opener-re-function smie-config--guess-value kotlin-language-server ns-l-compact-sequence which-key--stop-timer c-list-found-types flycheck-pug-executable lsp-elixir-suggest-specs org-table-get-range mhtml--submode-keymap another-occurrence Above lsp-pyls-plugins-flake8-hang-closing lsp-pylsp-plugins-rope-completion-enabled treemacs--get-label-of lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-brackets lsp-lua-hint-enable utf7-direct-encoding-chars TeX-command-default no-truncate Futura core-accessing-symbol angle-bracket-arglist-escape tramp-handle-make-auto-save-file-name js--split-name ...] :predicate #f(compiled-function (sym) #<bytecode 0x11ea062cab4fccc3>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x :sort t))
  ivy-read("M-x " [zls magit-section-show-headings :closed-icon Read\ manual tag-end lsp-pwsh-help-completion lsp-treemacs-cycle-severity embark--cache-info--completion-list docid access-label :maxLength c-electric-lt-gt lsp-rust-analyzer-injected-modifier-face c-state-min-scan-pos treemacs-icon-icon-refresh &error flycheck-mode-line-prefix cl-struct-flycheck-syntax-check-tags js--find-newline-backward f-ancestor-of? org-roam-ui--get-nodes edebug-mode-on-hook message-expand-name-databases C-i treemacs--button-symbol-switch c-make-ml-string-opener-re-function smie-config--guess-value kotlin-language-server ns-l-compact-sequence which-key--stop-timer c-list-found-types flycheck-pug-executable lsp-elixir-suggest-specs org-table-get-range mhtml--submode-keymap another-occurrence Above lsp-pyls-plugins-flake8-hang-closing lsp-pylsp-plugins-rope-completion-enabled treemacs--get-label-of lsp-typescript-format-insert-space-after-opening-and-before-closing-nonempty-brackets lsp-lua-hint-enable utf7-direct-encoding-chars TeX-command-default no-truncate Futura core-accessing-symbol angle-bracket-arglist-escape tramp-handle-make-auto-save-file-name js--split-name ...] :predicate #f(compiled-function (sym) #<bytecode 0x11ea062cab4fccc3>) :require-match t :history counsel-M-x-history :action counsel-M-x-action :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  command-execute(counsel-M-x)

I would like to solve that and get it to work.

Thank you!

Emacs 29, Macos 10.13.6

dangom commented 1 year ago

If you evaluate writefreely-auth-token, do you see your token as a string, as shown in the README?

DaviRaubach commented 1 year ago

I get nil

More context: I am not using write.as. I can get the token:

curl "https://blog.anartist.org/api/auth/login" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{"alias": "...", "pass": "..."}'

result: {"code":200,"data":{"access_token":" etc.

I copied the token to my init file:

 (use-package ox-gfm)
 (use-package writefreely
   :after org
   :ensure t
   ;; Authentification token, if wanted.
   ;; Alternatively (setq writefreely-auth-token "00000000-0000-0000-0000-000000000000")
   :config
   (setq writefreely-instance-url "https://blog.anartist.org")
   (setq writefreely-instance-api-endpoint "https://blog.anartist.org/api")
   (setq writefreely-auth-token "mytoken"))

But the error raised when I installed the package: Compilation log:

In toplevel form:
writefreely.el:42:11: Warning: Package cl is deprecated

In writefreely--org-as-md-string:
writefreely.el:128:20: Warning: Unused lexical variable `org-ref-bibliography-entry-format'

In writefreely--get-user-collections:
writefreely.el:160:33: Warning: ‘function*’ is an obsolete alias (as of 27.1); use ‘cl-function’ instead.
writefreely.el:161:60: Warning: Unused lexical variable `&allow-other-keys&rest'
writefreely.el:176:8: Error: Invalid place expression: "token"

And also when I try writefreely-publish-or-update, I get

internal-macroexpand-for-load: Eager macro-expansion failure: (gv-invalid-place "token")

Let me know if I am doing something stupid.

Thank you

dangom commented 1 year ago

Can you see if #27 fixes your issues?

DaviRaubach commented 1 year ago

Yes, it does.

Thank you!