[cp-org] indent cursor at the end of cp-org-insert-src
This commit is contained in:
parent
3b10f4c876
commit
5119a791f4
|
@ -119,12 +119,14 @@
|
||||||
(org-link-set-parameters "gemini" :export #'org-link-gemini-export-link))
|
(org-link-set-parameters "gemini" :export #'org-link-gemini-export-link))
|
||||||
|
|
||||||
(defun cp-org-insert-src (&optional lang)
|
(defun cp-org-insert-src (&optional lang)
|
||||||
(let ((col (- (point) (point-at-bol))))
|
(let* ((col (- (point) (point-at-bol)))
|
||||||
|
(indent (make-string col ?\ )))
|
||||||
(insert (format "#+BEGIN_SRC %s\n"
|
(insert (format "#+BEGIN_SRC %s\n"
|
||||||
(if (stringp lang) lang "")))
|
(if (stringp lang) lang "")))
|
||||||
(let ((pos (point)))
|
(let ((pos (point)))
|
||||||
(insert (format "\n%s#+END_SRC" (make-string col ?\ )))
|
(insert (format "\n%s#+END_SRC" indent))
|
||||||
(goto-char pos))))
|
(goto-char pos)
|
||||||
|
(insert indent))))
|
||||||
|
|
||||||
(defhydra cp-org-src (:color blue)
|
(defhydra cp-org-src (:color blue)
|
||||||
"Org source block"
|
"Org source block"
|
||||||
|
|
Loading…
Reference in New Issue