On Mon, Oct 23, 2017 at 10:00 AM Carsten Dominik <[email protected]> wrote:
> I am not sure I understand, at least with transient-region turned on.
> Typing <e will deactivate the region, so there is no effect.
>
You're correct.
> Or do you mean to actually put "<" into a keymap?
>
I actually do that in my personal config .. Maybe binding "<" in org keymap
is the simplest way.
I have this function in my config bound to "<":
(defun modi/org-template-maybe ()
"Insert org-template if point is at the beginning of the line,
or if a region is selected. Else call `self-insert-command'."
(interactive)
(let ((is-region? (use-region-p)))
(if (or is-region?
(and (not is-region?)
(looking-back "^[[:blank:]]*")))
(hydra-org-template/body) ;Wrapper function for
`org-try-structure-completion'
(self-insert-command 1))))
--
Kaushal Modi