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

Open
opened 2021-09-23 09:40:07 +00:00 by herop · 9 comments
herop commented 2021-09-23 09:40:07 +00:00 (Migrated from github.com)

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

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 <<prettify-capture>> 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 commented 2021-09-23 20:20:47 +00:00 (Migrated from github.com)

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.

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.
herop commented 2021-09-24 13:47:07 +00:00 (Migrated from github.com)

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.

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 commented 2021-09-24 13:57:46 +00:00 (Migrated from github.com)

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 🙂.

> 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 :grinning:. > 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 :slightly_smiling_face:.
herop commented 2021-09-24 16:04:20 +00:00 (Migrated from github.com)

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.

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 commented 2021-09-24 18:01:51 +00:00 (Migrated from github.com)

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"))))
> Now I understand better how "Sponsor" works and tried to provide USD50. That's fantastically generous of you! Many thanks :grinning:. 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](https://user-images.githubusercontent.com/20903656/134719992-2e496ec7-4027-487b-a9e5-38665c7c19ae.png) Perhaps it would be worth trying to construct a minimal example and seeing if that works? Something like, ```lisp (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: ```lisp (("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 commented 2021-09-26 15:25:25 +00:00 (Migrated from github.com)

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

You're welcome. And of course, well deserved :100: :smile: 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](https://user-images.githubusercontent.com/658323/134814203-dceab38b-b393-443f-8351-3d6e2d23a757.png) ![image](https://user-images.githubusercontent.com/658323/134814233-2a24befd-d051-446b-9a30-d330175962c1.png)
tecosaur commented 2021-09-26 15:36:00 +00:00 (Migrated from github.com)

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

Does `%^G` appear in the docstring of `org-capture-templates` for you?
herop commented 2021-09-27 06:19:45 +00:00 (Migrated from github.com)

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

It does, yes: ![image](https://user-images.githubusercontent.com/658323/134854553-72b637f3-3669-4fb0-af29-21c814252ffb.png) 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](https://user-images.githubusercontent.com/658323/134860142-7774c9f4-db18-43a4-8456-a7136f2dc2ee.png)
jjungnickel commented 2021-10-08 09:24:52 +00:00 (Migrated from github.com)

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

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 in to join this conversation.
No description provided.