Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when attempting to review cards: "org-fc-index: Symbol’s function definition is void: org-fc-awk-index" #67

Open
MattHood opened this issue Aug 27, 2021 · 7 comments

Comments

@MattHood
Copy link

Thanks for your work on org-fc - I'm very keen to get started with it! I'm just having an issue getting set up: when I attempt to review cards, the following error appears in the mini buffer:

org-fc-index: Symbol’s function definition is void: org-fc-awk-index

This occurs even when running M-x org-fc-demo - the demo.org file opens, but the above error appears and nothing else happens.

My system:
OS: macOS Big Sur 11.5.2
Emacs: Mituharu's Emacs-mac, emacs version 27.2. Also replicated on emacs-plus, with emacs version 28.
Relevant emacs config:

(straight-use-package 'hydra)
(straight-use-package
 '(org-fc
   :type git :repo "https://git.sr.ht/~l3kn/org-fc"
   :files (:defaults "awk" "demo.org")
   :custom (org-fc-directories '("~/Org/"))
   :config
   (require 'org-fc-hydra)))

Dependencies installed via

> brew install gawk findutils

Any help would be greatly appreciated.

Matt.

@l3kn
Copy link
Owner

l3kn commented Aug 27, 2021

Can you do a C-h f (describe-function) and check if any of the org-fc-awk-... functions show up?

@MattHood
Copy link
Author

MattHood commented Aug 27, 2021

Thank you for your quick response :)

For org-fc-awk-index:

org-fc-awk-index is a compiled Lisp function in ‘org-fc-awk.el’.

(org-fc-awk-index PATHS &optional FILTER)

Find cards in PATHS matching an optional FILTER predicate.
FILTER can be either nil or a function taking a single card as
  its input.

Another, org-fc-awk-combine-tags:

org-fc-awk-combine-tags is a compiled Lisp function in
‘org-fc-awk.el’.

(org-fc-awk-combine-tags ITAGS LTAGS)

Simulate org tag inheritance on ITAGS and LTAGS.
ITAGS and LTAGS are strings ‘":tag1:tag2:"’

Is there any other output that might be helpful?

@MattHood
Copy link
Author

MattHood commented Aug 28, 2021

I've made some progress. By evaluating (require 'org-fc-awk) in a scratch buffer, I was able to begin the review process in org-fc-demo without error.

However, upon arriving at a review of the "Compact Double Card" heading, the review session ceased, with the error:
No such flashcard type: double. I found then that many of the (require ...) statements can be found in org-fc.el, so I evaluated (require 'org-fc). Following this, I was able to successfully review.

I then tried modifying the :config part of my straight-use-package declaration to include (require 'org-fc) to fix the issue on startup, but this didn't work; I still need to manually evaluate (require 'org-fc).

@chuxubank
Copy link

chuxubank commented Nov 3, 2021

@MattHood I just meet this problem when I want to defer load the org-fc package (with only :defer t).

I find that when I use :after org in use-package's config, the problem is solved. So maybe you should require this package after org is loaded.

As a reference, you can check my config file.

@MattHood
Copy link
Author

MattHood commented Nov 4, 2021

Thanks for your suggestion @chuxubank - unfortunately it didn't change anything, there must just be something weird about my setup.

I hope it works for someone else who may stumble upon this thread in the future.

@doolio
Copy link

doolio commented Oct 27, 2022

I too experienced this error. The suggestion by @chuxubank removes the error. However, @l3kn C-h f does not find any org-fc-awk-* functions for me.

My org-fc config is as follows:

(use-package org-fc
  :straight (:type git :repo "https://git.sr.ht/~l3kn/org-fc"
                   :files (:defaults "awk" "demo.org"))
  :after org
  :bind ("H-f" . org-fc-hydra/body)
  :config
  (require 'org-fc-hydra))

I can confirm that straight creates symlinks in the ~/.emacs.d/straight/build/org-fc directory to all the .el files in the ~/.emacs.d/straight/repos/org-fc directory as well as the .awk files in the awk sub-directory. There is also no autoloads for org-fc-awk from what I can tell in the org-fc-autoloads.el file.

Since org-fc-core.el contains the function org-fc-index which calls out to org-fc-awk.el and specifically org-fc-awk-index via org-fc-index-function is it a case where we need to add (require 'org-fc-awk) to the recommended use-package form as we currently do for org-fc-hydra?

Edit: I think the :after org line is necessary as if I'm not mistaken you don't (require 'org) anywhere, no?

@l3kn
Copy link
Owner

l3kn commented Oct 27, 2022

Interesting, maybe I can't replicate the error because in my config org-mode is loaded before any of the code for org-fc. In that case, adding (require 'org) inside org-fc seems like a better solution than a :after org in the use-package definition.

org-fc-hydra is required separately because it's considered an optional feature,
unlike org-fc-awk without which org-fc would be unusable.

I'll try to move some code around in my emacs config to replicate this,
then try the (require 'org) fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants