syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.7k stars 4.9k forks source link

(wrong-type-argument listp #<subr org-agenda-files>) #15861

Closed real-or-random closed 1 year ago

real-or-random commented 1 year ago

Description :octocat:

I get this error on startup:

(wrong-type-argument listp #<subr org-agenda-files>)

raised from https://github.com/syl20bnr/spacemacs/blob/178a3ab186dd33e2561a73941a45aa33ad12aa2e/core/core-spacemacs-buffer.el#L1283

This was touched in #15851 by @sunlin7 yesterday. Checkout out 025e9f7e325ef2c71de1aee9ba0ef3d52c8dc5b21 seems to work.

And indeed, (symbol-function 'org-agenda-files) gives me just #<subr org-agenda-files>, so org-agenda-files is natively compiled here. This can be checked by (subr-native-elisp-p (symbol-function 'org-agenda-files)) or probably better, (subr (symbol-function 'org-agenda-files)), which both return t here.

This is org 9.6 on Emacs: 29.0.60.

Reproduction guide :beetle:

System Info :computer:

Backtrace :paw_prints:


Debugger entered--Lisp error: (wrong-type-argument listp #<subr org-agenda-files>)
  car(#<subr org-agenda-files>)
  (eq 'autoload (car (symbol-function 'org-agenda-files)))
  (or (not (fboundp 'org-agenda-files)) (eq 'autoload (car (symbol-function 'org-agenda-files))))
  (if (or (not (fboundp 'org-agenda-files)) (eq 'autoload (car (symbol-function 'org-agenda-files)))) (and (boundp 'org-agenda-files) org-agenda-files) (org-agenda-files))
  (let ((default-directory (or (and (boundp 'org-directory) org-directory) default-directory)) (files (if (or (not (fboundp 'org-agenda-files)) (eq 'autoload (car (symbol-function ...)))) (and (boundp 'org-agenda-files) org-agenda-files) (org-agenda-files)))) (mapcar #'expand-file-name files))
  (let ((agenda-files (let ((default-directory (or (and ... org-directory) default-directory)) (files (if (or ... ...) (and ... org-agenda-files) (org-agenda-files)))) (mapcar #'expand-file-name files))) (ignore-directory (or (and (boundp 'org-directory) (expa
sunlin7 commented 1 year ago

I'll upgrade to org-9.6 and try to reproduce on my local.

sunlin7 commented 1 year ago

Hi @real-or-random I can't reproduce this issue on my local side. Could you help replace the (eq 'autoload (car (symbol-function 'org-agenda-files))) to (autoloadp 'org-agenda-files) and try it again? Thanks

opie4624 commented 1 year ago

@sunlin7 The fix proposed in #15864 gives me a new error: Lisp error: (void-function org-assert-version)

sunlin7 commented 1 year ago

Hi @opie4624 Ithe org-assert-version maybe not related to current change. Current change will try to avoid loading the org mode. Maybe your local configurations run into follow issue ? https://www.reddit.com/r/emacs/comments/zd3l7p/org_mode_elpa_intall_invalid_function/

opie4624 commented 1 year ago

No, I don't have package-archives set separately from what Spacemacs already sets. The org-assert-version issue only happens when I check out the fix-15861 branch from your fork of the repo, the one you've submitted as the PR.

opie4624 commented 1 year ago

@smile13241324 This patch appears broken and without a good fix. Can we revert until a better tested PR comes along?

sunlin7 commented 1 year ago

Hi @opie4624 Could you debug out the root cause for why the org-assert-version is void-function? Thanks

The PR is moving toward to a correct way for Spacemacs, if we revert the PR, we maybe never have chance to get the truth.

sunlin7 commented 1 year ago

The latest comment on previouse reddit topic has a link: https://www.reddit.com/r/emacs/comments/z7qulo/comment/iygt1xx/. Dose it work on your local?

sunlin7 commented 1 year ago

I had update the https://github.com/syl20bnr/spacemacs/pull/15864. Please help try it again. Thanks.

opie4624 commented 1 year ago

The PR is moving toward to a correct way for Spacemacs, if we revert the PR, we maybe never have chance to get the truth.

Reverting the PR unbreaks it for everyone while you continue to work on the solution. No one is asking you to stop working on it. We don't take all the cars off the road because you need to work on your car.

sd44 commented 1 year ago

I had update the #15864. Please help try it again. Thanks.

It's fixed for me.thx.

sunlin7 commented 1 year ago

@sd44 Thank you for verify it.

smile13241324 commented 1 year ago

The org mismatch comes from an loading order issue, frankly speaking the banner scale will load build-in org, layers however will load elpa org creating a mismatch depending on which version of emacs you are using. I am currently working on a fix but I am not yet finished, load order changes are difficult as hell.

A quick fix is to reduce the content of dotspacemacs start up list to an empty list this will prevent the issue for now.

I'll keep you posted.

sunlin7 commented 1 year ago

@smile13241324 Thanks for helping on investigate the root cause, that's really help a lot. I saw several users turned from Spacemacs to Doom Emacs for Spacemacs are heavy and slow. So what I'm doing is enhance Spacemacs to be more light and quick to compare with doom.

smile13241324 commented 1 year ago

I have posted a hotfix to avoid the org version mismatch, please report how the behaviour changed for you. One drawback for now is that the start buffer is not configurable, I plan to fix this later, but for now the version mismatch has priority.

real-or-random commented 1 year ago

I have posted a hotfix to avoid the org version mismatch, please report how the behaviour changed for you.

Well, everything works before your commit (but after #15864) and it works after your commit. :)

Is there anything specific you want us to test?

opie4624 commented 1 year ago

Confirmed fixed for me as well. @sunlin7 It's definitely faster, too. Nice job.

sunlin7 commented 1 year ago

Thank you so much guys, no other testing requests now, @real-or-random @opie4624 . And the commit https://github.com/syl20bnr/spacemacs/commit/e71a68633b17f8ac69fcf33d3d486184e71fcf8d pushed by @smile13241324 should be a better. Thank you all !

lebensterben commented 1 year ago

fixed in #15864