tecosaur / emacs-config

My configuration for Doom Emacs. Mirror of https://git.tecosaur.net/tec/emacs-config.
MIT License
1.03k stars 118 forks source link

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

Open herop opened 2 years ago

herop commented 2 years ago

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 commented 2 years ago

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 2 years ago

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 2 years ago

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 2 years ago

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<>` 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 2 years ago

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

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 commented 2 years ago

You're welcome. And of course, well deserved :100: :smile: Your suggestions:

image image

tecosaur commented 2 years ago

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

herop commented 2 years ago

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 commented 2 years ago

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