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

Just can't get the capture templates to work: Capture abort: Unknown template placeholder: "%^G" #21

Open
herop opened this issue Sep 23, 2021 · 9 comments
Labels
it's not me It's someone else, I swear! question hey, what's going on?

Comments

@herop
Copy link

herop commented Sep 23, 2021

I use the 1:1 version of your capture config (and much more).
I tried with / without the %{extra} and of course doct is installed correctly ...
I of course checked the org-mode docs and for sure %^G is legit.

Please help me out here.

I MUST say your configuration infused even more pleasure using DOOM. Your implementation of fonts are amazing.

BTW: What could your use of <> possibly mean?
Even though I know it has its place in referencing for org-files, my literate config.org trows an error if used.

Thank you in advance for your support and have a great day,
Jochen

@tecosaur
Copy link
Owner

I just tested the k action, and %{extra} is working as intended for me.

Regarding bits like <<thing>> in my config, that's something called no-web. See https://orgmode.org/manual/Noweb-Reference-Syntax.html.

@tecosaur tecosaur added it's not me It's someone else, I swear! question hey, what's going on? labels Sep 23, 2021
@herop
Copy link
Author

herop commented Sep 24, 2021

Well aware of that and didn't imply that at all. As I said, the code for sure is legit.
But still, since I wasn't able at to find any resources on why:
Capture abort: Unknown template placeholder: "%^G" that happens, I hoped you might come up with an idea on what I could do.
Without cutting short on functionality of course ;-)
While I'm at it: your (pieces of) configuration is a huge step for me and made my DOOM 3 times better already.
Please tell me how I can support your work (the GH Sponsor is just not for people like me, I suppose).

Thanks again,
Jochen.

@tecosaur
Copy link
Owner

since I wasn't able at to find any resources on why Capture abort: Unknown template placeholder: "%^G" happens, I hoped you might come up with an idea on what I could do.

Unfortunately, without being able to reproduce the issue, I don't have much to go off.

While I'm at it: your (pieces of) configuration is a huge step for me and made my DOOM 3 times better already.

Glad to hear it's been helpful 😀.

Please tell me how I can support your work (the GH Sponsor is just not for people like me, I suppose).

That's really nice of you. I've added GH sponsor and Buy me a coffee just as options for people who are able to and would like to show their appreciation that way. If you're looking for non-financial ways of supporting me, I don't really think any exist. I suppose there are also the packages I maintain for which bug reports and fixes etc. are always welcome. Don't feel obligated in any way though, I do this because I like it, and everything past that is a bonus 🙂.

@herop
Copy link
Author

herop commented Sep 24, 2021

Now I understand better how "Sponsor" works and tried to provide USD50.
Tell me, please, if you received it, since after completing with PayPal I, for one, didn't receive a message.

One more thing, reg. the "issue:
(after! org-capture
<<prettify-capture>>

(defun +doct-...
``
Omitting your <<prettify-capture>> is not very like to be the culprit, right?

Btw. I also tried without the %^G since I don't need to choose tags. But then neither the Deadline nor the Schedule text appaears.

@tecosaur
Copy link
Owner

Now I understand better how "Sponsor" works and tried to provide USD50.

That's fantastically generous of you! Many thanks 😀.
I can confirm it's come through.

<<prettify-capture>>

Hmm, I don't suspect so. If you want to see what it expands to, here's the "expanded" version of that code block: http://ix.io/3zRh.
Basically it changes the capture interface to look like this:

image

Perhaps it would be worth trying to construct a minimal example and seeing if that works? Something like,

(doct `(("Test" :keys "t"
         :file "/tmp/somefile.org"
         :headline "Test"
         :type entry
         :template ("* TODO %? %^G%{extra}"
                    "%i %a")
         :children (("General Test" :keys "t" :extra "some test")))))

For me that generates the following:

(("t" "Test")
 ("tt" "General Test" entry
  (file+headline "/tmp/somefile.org" "Test")
  #'doct--fill-template :doct
  (:doct-name "General Test" :keys "t" :extra "some test" :inherited-keys "tt" :file "/tmp/somefile.org" :headline "Test" :type entry :template
              ("* TODO %? %^G%{extra}" "%i %a")
              :doct-custom
              (:extra "some test"))))

@herop
Copy link
Author

herop commented Sep 26, 2021

You're welcome. And of course, well deserved 💯 😄
Your suggestions:

  • I do see the capture turning up as shown in your image
  • Only if I choose k d or s respectively the mentioned error occurs
  • If I evaluate your code, I get exactly the same as you
  • But if I implement the code in my config and using t t to trigger it, I get the same error as always:
    Capture abort: Unknown template placeholder: "%^G"
    So, I assume, we're coming closer: Since the code - as always assumed - is correct, why does the error only occurs if implemented and run inside org?

image
image

@tecosaur
Copy link
Owner

Does %^G appear in the docstring of org-capture-templates for you?

@herop
Copy link
Author

herop commented Sep 27, 2021

It does, yes:
image

Do I understand that right: Pasting your code in scratch buffer and evaluating?
It then does print the string, which I show, partly, in the screenshot.
Maybe you were referring to the docstring from org-capture-templates, so here you go (spoiler: %^G%is present).
image

@jjungnickel
Copy link

I'm feeling bad that I can't provide anything valuable to this issue besides a report that this is happening for me too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
it's not me It's someone else, I swear! question hey, what's going on?
Projects
None yet
Development

No branches or pull requests

3 participants