org2blog / org2blog

Blog from Org mode to WordPress.
https://github.com/org2blog/org2blog/wiki
GNU General Public License v3.0
563 stars 75 forks source link

Symbol’s value as variable is void: org2blog-pkg #330

Open Schievel1 opened 2 years ago

Schievel1 commented 2 years ago

Thank you for filling out this bug report (BR). Please perform every step and answer every question to the best of your ability. That will make it easier for you and more accessible for us to address the issue with the highest level of quality in the shortest amount of time.

Description

After installing org2blog via doom emacs' package manager and running M-x org2blog-user-interface I only get Symbol’s value as variable is void: org2blog-pkg in the minibuffer. I installed Sacha Chuas fork from here https://github.com/sachac/org2blog and it works.

Prerequisites

Environment

OS: Linux 5.10.102.1-microsoft-standard-WSL2 #1 SMP Wed Mar 2 00:30:59 UTC 2022 x86_64 11th Gen Intel(R) Core(TM) i7-11800H @ 2.30GHz GenuineIntel GNU/Linux Emacs: GNU Emacs 28.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.34) of 2022-11-07, installed from Gentoos repos ran as GUI. org2blog/wp-version: 1.1.15 org2blog-version-info gives same error: Symbol’s value as variable is void: org2blog-pkg

grettke commented 2 years ago

Hi @Schievel1 thank you for sharing this and going through the Q&A: it is greatly appreciated.

Well that is frustrating that org2blog-pkg is void.

Can you please M-x toggle-debug-on-error RET and watch for the message Debug on Error enabled globally and then M-x org2blog-user-interface again? I'm hoping that we can see what leads up to this error. The stack trace will tell us more.

The next easy test is to try using Org2Blog via use-package like this. That is if you are already a user.

The most laborious and easily diagnosed way to load Org2Blog is by hand. If you are curious you might like that, and we are far from needing this.

Schievel1 commented 2 years ago

Hi, thanks for your fast response.

Here is what the debugger spits out.

  byte-code("\306\10\11\n\307\310!\13%\210\306\f\11\n\15\16\11\16\n\16\13\16\f\16\15\16\16\16\17\16\20\16\21\16\22\16\23&\17\207" [org2blog-pkg name version url org2blog-def wordpress-version cl-defstruct version-prefix "" metaweblog ox-wp doc emacs emacs-api org requirements keywords authors maintainer homepage] 16)
  command-execute(org2blog-user-interface record)
  helm-M-x-execute-command(org2blog-user-interface)
  helm-execute-selection-action-1()
  helm-execute-selection-action()
  helm-internal((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1ea8465e0e99955c>)) (candidates . helm-candidates-in-buffer) (keymap keymap (keymap ...) keymap (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f13 lambda nil ... ...) (f12 lambda nil ... ...) (f11 lambda nil ... ...) (f10 lambda nil ... ...) (f9 lambda nil ... ...) (f8 lambda nil ... ...) (f7 lambda nil ... ...) (f6 lambda nil ... ...) (f5 lambda nil ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_15> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc504338d85c7417>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x7cb8b27392e0eeb>)) (candidates . helm-candidates-in-buffer) (keymap keymap (keymap ...) keymap (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f13 lambda nil ... ...) (f12 lambda nil ... ...) (f11 lambda nil ... ...) (f10 lambda nil ... ...) (f9 lambda nil ... ...) (f8 lambda nil ... ...) (f7 lambda nil ... ...) (f6 lambda nil ... ...) (f5 lambda nil ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_15> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x338900dcac0054f>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  helm((((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1ea8465e0e99955c>)) (candidates . helm-candidates-in-buffer) (keymap keymap (keymap ...) keymap (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f13 lambda nil ... ...) (f12 lambda nil ... ...) (f11 lambda nil ... ...) (f10 lambda nil ... ...) (f9 lambda nil ... ...) (f8 lambda nil ... ...) (f7 lambda nil ... ...) (f6 lambda nil ... ...) (f5 lambda nil ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_15> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc504338d85c7417>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x7cb8b27392e0eeb>)) (candidates . helm-candidates-in-buffer) (keymap keymap (keymap ...) keymap (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f13 lambda nil ... ...) (f12 lambda nil ... ...) (f11 lambda nil ... ...) (f10 lambda nil ... ...) (f9 lambda nil ... ...) (f8 lambda nil ... ...) (f7 lambda nil ... ...) (f6 lambda nil ... ...) (f5 lambda nil ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_15> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x338900dcac0054f>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) nil "M-x " nil nil "*helm M-x*" nil nil helm-M-x-input-history)
  helm(:sources (((name . "Emacs Commands history") (init #f(compiled-function () #<bytecode -0x1ea8465e0e99955c>)) (candidates . helm-candidates-in-buffer) (keymap keymap (keymap ...) keymap (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f13 lambda nil ... ...) (f12 lambda nil ... ...) (f11 lambda nil ... ...) (f10 lambda nil ... ...) (f9 lambda nil ... ...) (f8 lambda nil ... ...) (f7 lambda nil ... ...) (f6 lambda nil ... ...) (f5 lambda nil ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_15> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0xc504338d85c7417>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search)) ((name . "Emacs Commands") (init #f(compiled-function () #<bytecode 0x7cb8b27392e0eeb>)) (candidates . helm-candidates-in-buffer) (keymap keymap (keymap ...) keymap (21 . helm-M-x-universal-argument) keymap (127 . helm-mode-delete-char-backward-maybe) (27 keymap ...) (C-return . helm-cr-empty-string) keymap (tab . helm-execute-persistent-action) (33554448 . helm-previous-source) (33554446 . helm-next-source) (33554438 . helm-previous-page) (remap keymap ... ...) (insert-state keymap ... ... "Auxiliary keymap for Insert stat...") (33554443 . helm-previous-source) (33554442 . helm-next-source) (26 . helm-select-action) (21 . helm-delete-minibuffer-contents) (18 . evil-paste-from-register) (1 . move-beginning-of-line) (escape . abort-recursive-edit) (f13 lambda nil ... ...) (f12 lambda nil ... ...) (f11 lambda nil ... ...) (f10 lambda nil ... ...) (f9 lambda nil ... ...) (f8 lambda nil ... ...) (f7 lambda nil ... ...) (f6 lambda nil ... ...) (f5 lambda nil ... ...) ...) (action . helm-type-command-actions) (persistent-action . helm-M-x-persistent-action) (persistent-help . "Describe this command") (help-message . helm-M-x-help-message) (requires-pattern . 0) (filtered-candidate-transformer helm-M-x-transformer-no-sort #<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_15> helm-fuzzy-highlight-matches) (volatile . t) (match identity) (fuzzy-match . t) (redisplay . identity) (nomark . t) (coerce . helm-symbolify) (header-line . #("TAB: Describe this command (keep..." 0 3 ...)) (multimatch . t) (must-match . t) (group . helm-command) (data . #f(compiled-function () #<bytecode -0x338900dcac0054f>)) (get-line . buffer-substring-no-properties) (search helm-mm-exact-search helm-mm-search helm-candidates-in-buffer-search-default-fn helm-fuzzy-search))) :prompt "M-x " :buffer "*helm M-x*" :history helm-M-x-input-history)
  helm-M-x-read-extended-command([evil-collection-magit-toggle-text-minor-mode magit-section-show-headings AND soap-xs-complex-type-is-group--cmacro make-rxt-char-category tramp-completion-handle-file-name-all-completions projectile-get-project-directories org-clock-get-sum-start python-nav-beginning-of-defun-regexp Reduce\ To:\ to\ Cc: curr-btn c-electric-lt-gt helm-completing-read-inbuffer-default-handler yas-x-prompt news-inews &error magit-buffer-lock-functions C-c helm-ff-query-replace-fnames-history-to racket-insert-closing-bracket evil-collection-org-maps edebug-mode-on-hook message-expand-name-databases transient:magit-diff-refresh:--irreversible-delete treemacs--button-symbol-switch tree-widget-button-keymap traversed magit-list-modified-modules :where which-key--stop-timer EXPLAIN gdb-thread-number tramp-sudoedit-handle-set-file-acl xref--push-markers mhtml--submode-keymap About allout-post-undo-hook org-agenda-regexp-filter-preset python-skeleton-available treemacs--get-label-of pages-directory-mode-hook helm-grep-save-results-1 dired-do-chmod projectile-unserialize copy-soap-xs-attribute-group tramp-adb-connection-local-default-shell-variables Info-breadcrumbs transient:magit-log:--dense Hardlink\.\.\. ls-lisp-handle-switches ...])
  helm-M-x(nil)
  funcall-interactively(helm-M-x nil)
  command-execute(helm-M-x)

I tried the use-package approach already, with the same resutlt. I will try loading it by hand an the next step. / If I download the package from MELPA and install it via package-install-file it says helm-M-x-execute-command: Package ‘htmlize-1.56’ is unavailable. So maybe thats a hint.

Schievel1 commented 2 years ago

It works when loading it completely by hand.

noiseOnTheNet commented 2 years ago

I have the same problem. Looking into the installed packages I see there is htmlize but version 1.57: can this be an issue?

grettke commented 2 years ago

When you can please the existing org2blog folder in your .emacs.d, download the attached zip, rename its extension tar, and in emacs do a M-x package-install-file and choose the tar file. Then try runnign one of the commands again.

org2blog-20221120.2045.tar.zip

grettke commented 2 years ago

@noiseOnTheNet I think the the htmlize version should be OK.

Schievel1 commented 2 years ago

Thanks for those fast responses. I will test that tar out today.

Schievel1 commented 2 years ago

It says Package ‘htmlize-1.56’ is unavailable even though I have htmlize installed by cloning the github repo and using these two lines in my config:

(add-to-list 'load-path "/home/pascal/org2blog/htmlize")
(require 'htmlize)

This is the same htmlize that works when I manually installed org2blog. I commented all the other lines from manually installing and restarted emacs before trying to install the package.

grettke commented 2 years ago

To your point htmlize is loading manually from the Git checkout. That seems to be the case in both examples. However the issue seems to be coming from Package, not your load.

Are you using a package manager anywhere else that loads htmlize?

For example if you are loading org2blog from the package manager, then I'm assuming package manager tries to load htmlize from the package cache.

Schievel1 commented 2 years ago

I Never pulled it in directly but it could be some other package pulls htmlize as a dependency.

Doom is quite a framework, I don't know if I can figure out what pulls in what where

grettke commented 1 year ago

Would you consider testing org2blog via [use-package](https://github.com/org2blog/org2blog#use-package?

Schievel1 commented 1 year ago

sure, I will give it a try tommorow. Although I am afraid this wont change much. As far as I understand it Dooms package! is only a wrapper around use-package

grettke commented 1 year ago

@Schievel1 Thank you. Could you try it out without using Doom?

Schievel1 commented 1 year ago

Yup, without Doom it works like a charm. So it seems Doom is causing the problem here. Should I open this issue on their repo instead?

Here is what I did for future reference: Created a file .emacs in ~/tmp/ with this content:

(require 'package)
(add-to-list 'package-archives '("gnu"   . "https://elpa.gnu.org/packages/"))
(add-to-list 'package-archives '("melpa" . "https://melpa.org/packages/"))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))
(eval-and-compile
  (setq use-package-always-ensure t
        use-package-expand-minimally t))

(use-package org2blog
             :ensure t)

Started emacs with

HOME=/home/pascal/tmp emacs

This basically tells emacs to look for config files in ~/tmp, so it will not load Doom on startup.

grettke commented 1 year ago

Should I open this issue on their repo instead?

I wouldn't yet. The reason is that I still not sure why the package install is complaining. Here is why:

org2blog wants htmlize v1.56 or greater. The package installation is installing htmize v1.57. That should work fine. And I just installed org2blog via use-package and found this to be the case. org2blog worked fine with htmlize 1.57.

My confusion, the unknown, is there, where Package ‘htmlize-1.56’ is unavailable.

When does it happen?

I don't know doom. Is there a way to force doom to load org2blog before other packages?

Even if that does work, I want to be transparent here: I don't understand where the problem is happening, and I am figuring it out with you.

Schievel1 commented 1 year ago

I don't know doom. Is there a way to force doom to load org2blog before other packages?

I read the docs a bit but it seems there is not. I can fiddle with early-init.el a bit and see what happens.

benthamite commented 1 year ago

I'm also experiencing this problem, and I don't use Doom. I understand that Doom uses straight, which I do use, so that may be the culprit.

The only way I can get the package to load is to evaluate (load-file "/Users/pablostafforini/.emacs.d/straight/repos/org2blog/org2blog.el").

Org2Blog Runtime: Org2Blog 1.1.16, Emacs 28.2, Org Mode 9.6-pre,
  MetaWeblog 1.1.16, XML-RPC 1.6.16, HTMLize 1.57

Let me know if you need any additional information.

mhatta commented 1 year ago

I suffer the same problem. I'm using straight.el & use-package(and leaf.el), and my guess is the culprit is straight.el (& org2blog) since straight.el doesn't use package.el (which contains define-package, which tries to load org2blog-pkg.el if existed).

I attach my barebone init.el(extention is changed to .txt). Remove ~/.emacs.d/straight if existed, put this init.el, then run Emacs. Hopefully error message

Error (use-package): org2blog/:catch: Symbol’s value as variable is void: org2blog-pkg

will show up. init.el.txt

grettke commented 1 year ago

Thank you everyone I will keep looking at this with the goal of reproducing it. And figuring out what the issue is, and resolving it. I just am not seeing it yet :|.

mhatta commented 1 year ago

Sorry for being not helpful much, anyway as @Schievel1 mentioned earlier, I found the old org2blog (like Sacha's fork https://github.com/sachac/org2blog, ca. 2020) works. So I guess org2blog is enbugged somewhere between 2020-2022 (182 commits!).

xiaoruoruo commented 1 year ago

I also have the same issue. straight-use-package cannot load the package, but manual (require) works.

grettke commented 1 year ago

@xiaoruoruo Thanks for letting us know.

charlemana commented 1 year ago

Thanks @mhatta. Your solution worked for me

mhatta commented 1 year ago

Seems this commit is the culprit: https://github.com/org2blog/org2blog/commit/8b568348d7c6cd1e21e9dedaaf01eed8f90df436 (before this, it works).

It calls org2blog-pkg related functions several times, but can't assume org2blog-pkg is declared before when you use staright.el or such? I don't quite figure it out yet.

benthamite commented 1 year ago

This appears to be fixed.