summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Beffa <beffa@fbengineering.ch>2014-07-31 11:08:44 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2014-08-09 09:50:53 +0200
commitb3fbd31f17fe6a18d49253867bb5714da26c4e88 (patch)
treee9943b874171b26200a177512df184d5ec626135
parentd2c0bbcf52dee58a6f71690983395f891ba7869d (diff)
downloadorg-mode-b3fbd31f17fe6a18d49253867bb5714da26c4e88.tar.gz
org.el: Add function to indent environment inserted by cdlatex-enviroment
* lisp/org.el (org-cdlatex-environment-indent): New function. New function is bound to "\C-c{" in `org-cdlatex-mode-map' to add a LaTeX environment and indent it. TINYCHANGE
-rwxr-xr-x[-rw-r--r--]lisp/org.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/org.el b/lisp/org.el
index 35b9fc7..8eed2cc 100644..100755
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -18412,7 +18412,7 @@ When a buffer is unmodified, it is just killed. When modified, it is saved
(org-defkey org-cdlatex-mode-map "^" 'org-cdlatex-underscore-caret)
(org-defkey org-cdlatex-mode-map "`" 'cdlatex-math-symbol)
(org-defkey org-cdlatex-mode-map "'" 'org-cdlatex-math-modify)
-(org-defkey org-cdlatex-mode-map "\C-c{" 'cdlatex-environment)
+(org-defkey org-cdlatex-mode-map "\C-c{" 'org-cdlatex-environment-indent)
(defvar org-cdlatex-texmathp-advice-is-done nil
"Flag remembering if we have applied the advice to texmathp already.")
@@ -18490,6 +18490,13 @@ Revert to the normal definition outside of these fragments."
(let (org-cdlatex-mode)
(call-interactively (key-binding (vector last-input-event))))))
+(defun org-cdlatex-environment-indent (&optional environment item)
+ "Execute `cdlatex-environment' and indent the inserted environment."
+ (interactive)
+ (cdlatex-environment environment item)
+ (let ((element (org-element-at-point)))
+ (org-indent-region (org-element-property :begin element)
+ (org-element-property :end element))))
;;;; LaTeX fragments