Skip to content

Running a function (e.g. comment-region) on inserted region in :post #131

Answered by pmiam
ArsenArsen asked this question in Q&A
Discussion options

You must be logged in to vote

hello!

The mark needs to be set explicitly. This is usually done interactively by the user during the normal navigation of text, but can also be done while the template is being "auto-typed" by evaluating s-exps at strategic points. For instance:

(cpr (push-mark) "Copyright (C) " copyright-current-year "  "
     user-full-name " <" user-mail-address ">" n
     :post (comment-region (mark) (point)))

This should work well as a standalone template, but I did find that it causes problems when included in a larger template using the tempel-include element as defined in the README. Trying to use this form in that way causes the encapsulating template to fail before evaluating comment-region wit…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ArsenArsen
Comment options

Answer selected by ArsenArsen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #130 on March 21, 2024 16:11.