1

I'm using yasnippets to create code blocks in org mode to document and execute DevOps activities. To improve productivity, it would be nice to have a possibility to create org tables with rows of values and instantiate my snippet for each row in the table, using the respective values as input. A simple example:

Table:

| one  | two  | three |
| four | five | six   |

Snippet:

echo "$0 $1 $2"

Result:

echo "one two three"
echo "four five six"

Is something like this possible without major elisp programming efforts? Any hint is very appreciated.

//Michael

  • Welcome! Interesting question! Would you add some clarification, please? Are you trying to use snippets to output tables from your shell code? Are you trying to use snippets to help with data entry into the tables. The reason I ask is because I'm not sure how you're going to use the tables. For perspective, I use org-tables everyday for DevOps for documentation, as data for src code blocks, output from src code, auto-converting arrays-of-arrays between different formats and programming languages. e.g. org-table -> python, ruby, bash, csv, elisp, json, yaml, and in between etc... – Melioratus Mar 7 at 2:13
  • I forgot to mention I also use org-tables as input into src blocks to generate new code which kind of seems to be what you're asking how to do with snippets. So If that's what you really looking for I have a few ways to do that. Including calling src code block which will prompt you for input like a snippet would. Is that what you're looking for? – Melioratus Mar 7 at 2:18
  • As @Melioratus says, it's not clear what you are asking: could you add some clarification? – NickD Mar 7 at 15:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.