     ;; https://github.com/abo-abo/hydra/wiki/Org-mode-block-templates
 
     (defun modi/org-template-expand (str &optional lang)
-      "Expand Org template."
+      "Expand Org template based on STR.
+
+STR is always prefixed with \"<\".  The string following that
+\"<\" must match with the `car' of one of the elements in
+`org-structure-template-alist' (examples: \"<e\", \"<s\").
+
+If no region is selected, this function behaves like
+`org-try-structure-completion' (See (org) Easy templates).  If a
+region is selected, the selected text is wrapped with that org
+template.
+
+If the \"#+BEGIN_SRC\" block is inserted and LANG is a string,
+that source block is annotated with that LANG.  Instead, if LANG
+is nil, point is returned to the end of the \"#+BEGIN_SRC\" line
+after the template insertion."
       (let* ((is-region? (use-region-p))
              (beg (if is-region?
                       (region-beginning)

        ;; Now if a region was selected, and `content' was saved from that,
        ;; paste it back in.
        (when content
          ;; A special case for org source blocks.. need to escape "*" and "#+"
          ;; with commas -- (org) Literal examples.
          (when (string= "org" lang)
            (setq content (org-escape-code-in-string content)))
          (insert content)
          (deactivate-mark)

      ("Q" nil "quit"))

    (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)
          (self-insert-command 1))))
