[cp-org] indent closing element of cp-org-insert-src

This commit is contained in:
contrapunctus 2021-02-15 06:12:33 +05:30
parent 78c6df891c
commit bc7ceca83e
1 changed files with 6 additions and 5 deletions

View File

@ -119,11 +119,12 @@
(org-link-set-parameters "gemini" :export #'org-link-gemini-export-link))
(defun cp-org-insert-src (&optional lang)
(insert (format "#+BEGIN_SRC %s\n"
(if (stringp lang) lang "")))
(let ((pos (point)))
(insert "\n#+END_SRC")
(goto-char pos)))
(let ((col (- (point) (point-at-bol))))
(insert (format "#+BEGIN_SRC %s\n"
(if (stringp lang) lang "")))
(let ((pos (point)))
(insert (format "\n%s#+END_SRC" (make-string col ?\ )))
(goto-char pos))))
(defhydra cp-org-src (:color blue)
"Org source block"