emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] function for inserting a block


From: Kaushal Modi
Subject: Re: [O] function for inserting a block
Date: Mon, 23 Oct 2017 14:46:41 +0000

On Mon, Oct 23, 2017 at 10:00 AM Carsten Dominik <address@hidden> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]