This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU AUCTeX".

The branch, master has been updated
       via  163dcb75bd0b67e850b9e4c4f3ba2f2d310360a0 (commit)
      from  e625dc05ea31846ee0aaffde7104602bea22b581 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 163dcb75bd0b67e850b9e4c4f3ba2f2d310360a0
Author: Ikumi Keita <ik...@ikumi.que.jp>
Date:   Thu Feb 25 00:47:01 2021 +0900

    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.

diff --git a/latex.el b/latex.el
index 27c865a4..bfd5b8c6 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."

-----------------------------------------------------------------------

Summary of changes:
 latex.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
GNU AUCTeX

_______________________________________________
auctex-diffs mailing list
auctex-di...@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex-diffs

Reply via email to