[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-diffs] [elpa] externals/auctex 163dcb75bd 02/60: Fix label inser
From: |
Tassilo Horn |
Subject: |
[AUCTeX-diffs] [elpa] externals/auctex 163dcb75bd 02/60: Fix label insertion at env. insertion with active region (bug#28382) |
Date: |
Fri, 8 Apr 2022 11:52:45 -0400 (EDT) |
branch: externals/auctex
commit 163dcb75bd0b67e850b9e4c4f3ba2f2d310360a0
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>
Fix label insertion at env. insertion with active region (bug#28382)
* latex.el (LaTeX-env-label): Add management of positions of point and
mark and indent region when region is active.
---
latex.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/latex.el b/latex.el
index 27c865a420..bfd5b8c605 100644
--- a/latex.el
+++ b/latex.el
@@ -1274,9 +1274,18 @@ Just like array and tabular."
(defun LaTeX-env-label (environment)
"Insert ENVIRONMENT and prompt for label."
(LaTeX-insert-environment environment)
+ (when (TeX-active-mark)
+ ;; Point is at the end of the region. Move it back to the
+ ;; beginning of the region.
+ (exchange-point-and-mark)
+ (indent-according-to-mode))
(when (LaTeX-label environment 'environment)
(LaTeX-newline)
- (indent-according-to-mode)))
+ (indent-according-to-mode))
+ (when (TeX-active-mark)
+ (indent-region (point) (mark))
+ ;; Restore the positions of point and mark.
+ (exchange-point-and-mark)))
(defun LaTeX-env-list (environment)
"Insert ENVIRONMENT and the first item."
- [AUCTeX-diffs] [elpa] externals/auctex updated (8ff369bd92 -> 03ed9004cd), Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 90b1803b02 10/60: Use DEFAULT argument in latex.el where appropriate, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex e625dc05ea 01/60: Improve keymap handling, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 0847db39c9 03/60: Improve file query in style/ltxtable.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 7119e9b58c 14/60: ; Fix tests relying on font-lock has put syntax properties already, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 3e95554c27 19/60: Reduce code duplication in style/sidecap.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 163dcb75bd 02/60: Fix label insertion at env. insertion with active region (bug#28382),
Tassilo Horn <=
- [AUCTeX-diffs] [elpa] externals/auctex f464242eab 29/60: Enable indent by square bracket, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex f686fbca6d 16/60: Add new test, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex e37c7a8b39 31/60: Revise documentation about simultaneous process, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 844e758a47 07/60: Improve indent in tabular-like environments, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 0e0551126d 17/60: * doc/changes.texi: Document switch from initial input to default., Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex ab3bfaf103 13/60: Don't use obsolete font-lock-syntactic-keywords, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex 2be733a3e3 28/60: Add new style/l3doc.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex dff1592319 09/60: Adjust argument list of `TeX-arg-length', Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex c43d21326d 42/60: Follow similar update of latex.el in context.el, Tassilo Horn, 2022/04/08
- [AUCTeX-diffs] [elpa] externals/auctex b2cea20056 53/60: ; Delete unnecessary quoting in docstrings, Tassilo Horn, 2022/04/08