[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/cdlatex a0153ef889 2/2: Try to keep indentation when inser
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/cdlatex a0153ef889 2/2: Try to keep indentation when inserting templates |
Date: |
Sun, 9 Jul 2023 12:59:24 -0400 (EDT) |
branch: elpa/cdlatex
commit a0153ef8898b0604be5e690de02a37cad56d3f17
Author: Carsten Dominik <dominik@carstens-mbp.speedport.ip>
Commit: Carsten Dominik <dominik@carstens-mbp.speedport.ip>
Try to keep indentation when inserting templates
---
cdlatex.el | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/cdlatex.el b/cdlatex.el
index 15a37adced..0e7a20cb9e 100644
--- a/cdlatex.el
+++ b/cdlatex.el
@@ -1072,10 +1072,10 @@ the template. This is mainly useful for \"items\" of
environments, where
template prefix)
(if (not env)
(setq env (completing-read "Environment: " cdlatex-env-alist-comb
nil nil "")))
- (if (looking-back "^[ \t]*" (point-at-bol))
- (setq prefix (match-string 0))
- (setq prefix "")
- (newline))
+ (if (looking-back "^\\([ \t]*\\)\\([^ \t].*\\)?" (point-at-bol))
+ (progn
+ (setq prefix (match-string 1))
+ (if (match-end 2) (progn (newline) (insert prefix)))))
(setq begpos (point))
(if (try-completion env cdlatex-env-alist-comb)
(progn