arthur miller <[email protected]> writes:

>> I have updated the documentation. Hopefully the ambiguity will not be
>> there anymore.
>> https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=0f534d5d6
>
> To be honest to you, and I hope I am not misstaken to be some a petitess
> person, that is not my intention, but I think the problem here is the
> usage of the word "expression", since symbol expression has a determined
> and clear meaning in Lisp. I think the problem here is that placeholders
> are using parenthesis, and a symbolic expression is also using
> parenthesis for lists. When I see this %(), I see a placeholder
> notation.  And when I see EXP or expression, I see something can be (+ 2
> 3). Thus if you put together those, I see %((+ 2 3)) as the natural
> result. However, the implementation turns the placeholder to be the part
> of the expression. Thus the placeholder is just "%", somehow. But we
> still can't type somethin like %default-directory, so it all comes out
> weird to me. Just my 2c as they say.

I see that things are not yet clear for you. Any ideas how to make
documentation more clear for you? (It is hard for me to improve further,
because I never saw the current way documentation explains things as a
problem to start with).

>> Also, I find %((EXP)) less intuitive than %(EXP) and I never had any
>> issues with the existing format, so your perspective, while valid, is
>> not unique.
>
> I find it on the contrary, since I am thinking from the Lisp side of
> things, as explained above.
> ...
> I think it would be a bit shame to not make it more general, since it is
> so little extra work needed. See the previous patch in the other mail.

I am open to your patches, as long as some more people find them useful.

> There are also two other problems. org-capture-fill-template calls
> unconditionally untabify. There is no note why the original author calls
> this, but that seems unfortunate, since it does respect the users
> choice. A user might wish to have a tab in their expanded template. For
> my part for example, consider a templatized Makefile, something like
> this: ...

Can you please open a new thread for this?

> Finally, for some reason, each expansion ends up with a new line? Is
> that some necessary feature that org-capture templates rely on?
>
> Consider if I would to generate a file with a name expanded from a tempalte:
>
> %(project-name).asd
> %(project-name).asd
>
> I have to call (string-trim ...) everywhere where I call
> org-capture-fill-template. Can we remove that ending new line, or is
> that expected in expanded templates?

Maybe. Again, could you please open a new email thread?

> In my personal patched version I don't untabify, and I do remove the new line.
> Are there some Ert tests org org-capture?

Yes, there are tests. testing/lisp/test-org-capture.el.

> We have Skeleton and Tempo/Tempel as alternative, but they are extremely
> clunky since they depend on custom DSL and string
> concatenation. Placeholders, as seen from example are much nicer
> alternative.
>
> Now, I haven't used this extensively yet, but hopefully this gives idea
> that org-capture template can become useful in a broader context, and
> how we could do more with just built-in stuff, with less external tools
> and less various other languages. For example for cookiecutter you would
> use perhaps Python to run hooks, JS to define the template variables,
> and their notation, {{ }}, for templates.

Have you seen https://github.com/progfolio/doct ?

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to