Hello, this is a long thread so I did not read everything, just want to mention that in org-dp.el I did something similar using
- tempo templates (for a programmer who wants to insert an org-dp-create call in his emacs-lisp program) and - a universal (org) prompt function for a user who wants to insert a src-block in his org file. This one for productive use in emacs-lisp programs (note that there is tab completion for values): ,----[ C-h f tempo-template-org-dp-create RET ] | tempo-template-org-dp-create is an interactive Lisp function. | | (tempo-template-org-dp-create &optional ARG) | | Insert org-dp-create template. | | [back] `---- This one with comments to give a bit more explanation to the programmer: ,----[ C-h f tempo-template-org-dp-create-with-comments RET ] | tempo-template-org-dp-create-with-comments is an interactive Lisp | function. | | (tempo-template-org-dp-create-with-comments &optional ARG) | | Insert org-dp-create template. | | [back] `---- This one is on the user level (in org files), C-c w w ist just my personnal key binding from my .emacs: ,----[ C-h f org-dp-wrap-in-block RET ] | org-dp-wrap-in-block is an interactive Lisp function in | ‘org-dp-lib.el’. | | It is bound to C-c w w. | | (org-dp-wrap-in-block &optional LINES USER-INFO &rest PROMPT-SPEC) | | Wrap sexp-at-point or region in Org block. | | A region instead of the sexp-at-point is wrapped if either | | - optional arg LINES is an (positive or negative) integer or | | - the region is active | | In the first case the region is determined by moving LINES lines | up (LINES is positive) or down (LINES is negative) from point | using ‘forward-line’, in the second case the active region is | used. | | If point is already inside of a block, modify it or unwrap its | content/value instead of wrapping it in another block, except if | explicitly asked for by user. | | If USER-INFO is given, it should be a list in the format returned | by ‘org-dp-prompt-all’, i.e. | | (elem-type contents replace affiliated args) | | Look up that function’s docstring for more information about the | list’s elements. A non-nil USER-INFO suppresses calls to | ‘org-dp-prompt-all’ and is used instead of its return value. | | Possible &rest PROMPT-SPEC should be keyword/value pairs used for | restricting user-prompting via ‘org-dp-prompt-all’, e.g. | | :noprompt-affiliated t :noprompt-replace t | | see the docstring of that function for more info. | | [back] `---- org-dp-prompt-all is the universal function, with &rest argument PROMPT-SPEC you can reduce the prompting and such easily create your own specific 'wrap in block' utility commands without much programming. Hope this is not off-topic. -- cheers, Thorsten