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

Update template example for newer Org, and add autoload for function #30

Open
sotte opened this issue Feb 1, 2020 · 3 comments
Open
Assignees
Milestone

Comments

@sotte
Copy link

sotte commented Feb 1, 2020

I used the snippet from the code to setup my org-capture template:

 ("w" "web site from clipboard" entry (file "~/org/articles.org")
  "%(org-web-tools--url-as-readable-org)")

but I get the error Template is not a valid Org entry or tree.

Not sure what's going on here.

@alphapapa
Copy link
Owner

Please provide a complete example of the code you're using and steps you're taking. Also, please review C-h v org-capture-templates RET.

@sotte
Copy link
Author

sotte commented Feb 2, 2020

@alphapapa thanks for getting back so quickly and thanks for the package!

org-web-tools is installed via the spacemacs equivalent of (require 'org-web-tools) which is dotspacemacs-additional-packages '(org-web-tools).
Just calling (e.g.) org-web-tools-insert-web-page-as-entry work fine.

It seems that the following is an invalid template:

 ("w" "web site from clipboard" entry (file "~/org/articles.org")
  "%(org-web-tools--url-as-readable-org)")

but this is valid (note the *):

 ("w" "web site from clipboard" entry (file "~/org/articles.org")
  "* %(org-web-tools--url-as-readable-org)")

However, when using the now fixed capture template via org-capture with a URL of the website to capture in the clipboard I get this in my capture buffer:

* %![Error: (void-function org-web-tools--url-as-readable-org)]

org-version is 9.3.2.

@alphapapa
Copy link
Owner

Probably a change in Org requires the leading *.

You will need to load the library before calling that function in the template. Maybe I should make it autoloaded.

Thanks for reporting these issues.

@alphapapa alphapapa self-assigned this Feb 2, 2020
@alphapapa alphapapa changed the title org-capture template in code seems to be invalid Update template example for newer Org, and add autoload for function Feb 2, 2020
@alphapapa alphapapa added this to the 1.4 milestone Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants