auctex-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[AUCTeX-diffs] [elpa] externals/auctex 4a0bfe3 17/26: Clean up temporal


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex 4a0bfe3 17/26: Clean up temporal markers
Date: Thu, 12 Aug 2021 11:18:23 -0400 (EDT)

branch: externals/auctex
commit 4a0bfe342160c7935159b37a5ffbf99cd0f3a21d
Author: Ikumi Keita <ikumi@ikumi.que.jp>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Clean up temporal markers
    
    * latex.el (LaTeX-env-figure, LaTeX-fill-region-as-paragraph)
    (LaTeX-fill-region-as-para-do,LaTeX-fill-paragraph)
    (LaTeX-fill-region):
    * style/dinbrief.el (LaTeX-dinbrief-env-recipient):
    * style/letter.el (LaTeX-env-recipient):
    * tex-info.el (Texinfo-reftex-section-info):
    * tex.el (TeX-parse-argument):
    Clean up temporal markers after their usage so that they don't slow
    down the subsequent editing in the buffer.
---
 latex.el          | 24 ++++++++++++++++++------
 style/dinbrief.el |  3 ++-
 style/letter.el   |  3 ++-
 tex-info.el       |  6 ++++--
 tex.el            |  3 ++-
 5 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/latex.el b/latex.el
index 74ec036..083e530 100644
--- a/latex.el
+++ b/latex.el
@@ -1205,7 +1205,9 @@ If SHORT-CAPTION is non-nil pass it as an optional 
argument to
                               (unless (zerop (length float))
                                 (concat LaTeX-optop float
                                         LaTeX-optcl)))
-    (when active-mark (goto-char start-marker))
+    (when active-mark
+      (goto-char start-marker)
+      (set-marker start-marker nil))
     (when center
       (insert TeX-esc "centering")
       (indent-according-to-mode)
@@ -1227,7 +1229,9 @@ If SHORT-CAPTION is non-nil pass it as an optional 
argument to
               (LaTeX-newline)
               (indent-according-to-mode)))
         ;; bottom caption (default)
-        (when active-mark (goto-char end-marker))
+        (when active-mark
+          (goto-char end-marker)
+          (set-marker end-marker nil))
         (save-excursion
           (LaTeX-newline)
           (indent-according-to-mode)
@@ -4026,7 +4030,8 @@ performed in that case."
             ;; ELSE part follows - loop termination relies on a fact
             ;; that (LaTeX-fill-region-as-para-do) moves point past
             ;; the filled region
-            (LaTeX-fill-region-as-para-do from end-marker justify-flag)))))))
+            (LaTeX-fill-region-as-para-do from end-marker justify-flag)))))
+    (set-marker end-marker nil)))
 
 ;; The content of `LaTeX-fill-region-as-para-do' was copied from the
 ;; function `fill-region-as-paragraph' in `fill.el' (CVS Emacs,
@@ -4086,7 +4091,10 @@ space does not end a sentence, so don't break a line 
there."
     (goto-char from-plus-indent))
 
   (if (not (> to (point)))
-      nil ;; There is no paragraph, only whitespace: exit now.
+      ;; There is no paragraph, only whitespace: exit now.
+      (progn
+        (set-marker to nil)
+        nil)
 
     (or justify (setq justify (current-justification)))
 
@@ -4211,10 +4219,12 @@ space does not end a sentence, so don't break a line 
there."
                          (concat "^\\([ \t]*" TeX-comment-start-regexp "+\\)*"
                                  "[ \t]*")
                          (line-beginning-position)))
-              (LaTeX-fill-newline)))))
+              (LaTeX-fill-newline)))
+          (set-marker end-marker nil)))
       ;; Leave point after final newline.
       (goto-char to)
       (unless (eobp) (forward-char 1))
+      (set-marker to nil)
       ;; Return the fill-prefix we used
       fill-prefix)))
 
@@ -4492,7 +4502,8 @@ depends on the value of `LaTeX-syntactic-comments'."
                                               (line-beginning-position 2)
                                               justify)
               (goto-char end-marker)
-              (beginning-of-line)))
+              (beginning-of-line)
+              (set-marker end-marker nil)))
           (LaTeX-fill-code-comment justify)))
        ;; Syntax-aware filling:
        ;; * `LaTeX-syntactic-comments' enabled: Everything.
@@ -4634,6 +4645,7 @@ formatting."
                        (concat "^\\($\\|[ \t]+$\\|[ \t]*"
                                TeX-comment-start-regexp "+[ \t]*$\\)")))
             (forward-line 1))))
+      (set-marker next-par nil)
       (set-marker to nil)))
   (message "Formatting%s...done" (or what "")))
 
diff --git a/style/dinbrief.el b/style/dinbrief.el
index 57bf773..fe8a5e9 100644
--- a/style/dinbrief.el
+++ b/style/dinbrief.el
@@ -169,7 +169,8 @@
                             (marker-position addr-end) 'move)
                       (progn
                         (newline)
-                        (indent-to addr-column))))))))
+                        (indent-to addr-column)))))
+              (set-marker addr-end nil))))
       (LaTeX-dinbrief-insert "\n")
       (indent-to indentation))
     (if (not (zerop (length postremark)))
diff --git a/style/letter.el b/style/letter.el
index a07aba5..5c64c28 100644
--- a/style/letter.el
+++ b/style/letter.el
@@ -146,7 +146,8 @@
                             (marker-position addr-end) 'move)
                       (progn
                         (newline)
-                        (indent-to addr-column))))))))
+                        (indent-to addr-column)))))
+              (set-marker addr-end nil))))
       (insert "\n")
       (indent-to indentation))
     (insert TeX-esc "opening"
diff --git a/tex-info.el b/tex-info.el
index ea6cab0..4a7aed0 100644
--- a/tex-info.el
+++ b/tex-info.el
@@ -478,8 +478,10 @@ is assumed by default."
            (if (nth 1 reftex-label-menu-flags) ; section number flag
                (concat section-number " "))
            text))
-    (list 'toc "toc" text file marker level section-number
-          literal (marker-position marker))))
+    (prog1
+        (list 'toc "toc" text file marker level section-number
+              literal (marker-position marker))
+      (set-marker marker nil))))
 
 (defun Texinfo-reftex-hook ()
   "Hook function to plug Texinfo into RefTeX."
diff --git a/tex.el b/tex.el
index d07b479..2c5da74 100644
--- a/tex.el
+++ b/tex.el
@@ -3502,7 +3502,8 @@ See `TeX-parse-macro' for details."
                       (insert TeX-arg-opening-brace)
                       (goto-char (marker-position end))
                       (insert TeX-arg-closing-brace)
-                      (setq insert-flag t))))
+                      (setq insert-flag t)
+                      (set-marker end nil))))
                  ((= arg 0)) ; nop for clarity
                  ((> arg 0)
                   (TeX-parse-argument optional t)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]