auctex-diffs
[Top][All Lists]
Advanced

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

[AUCTeX-diffs] [elpa] externals/auctex e5fa92a61f 4/6: Make TeX-insert-q


From: Tassilo Horn
Subject: [AUCTeX-diffs] [elpa] externals/auctex e5fa92a61f 4/6: Make TeX-insert-quote robust for corner case (bug#52852)
Date: Fri, 14 Jan 2022 04:44:36 -0500 (EST)

branch: externals/auctex
commit e5fa92a61ffa684e040652184f2af478dd1c1329
Author: Andrea Greselin <greselin.andrea@gmail.com>
Commit: Ikumi Keita <ikumi@ikumi.que.jp>

    Make TeX-insert-quote robust for corner case (bug#52852)
    
    * tex.el (TeX-insert-quote): Go back only when there's enough room to
    do so.
    
    Copyright-paperwork-exempt: yes
---
 tex.el | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/tex.el b/tex.el
index 3cf8f65ec2..03027d699b 100644
--- a/tex.el
+++ b/tex.el
@@ -6169,14 +6169,16 @@ With prefix argument FORCE, always inserts \" 
characters."
                        ?\")
                       ((= (preceding-char) ?\")
                        ?\")
-                      ((save-excursion
-                         (forward-char (- (length open-quote)))
-                         (looking-at (regexp-quote open-quote)))
+                      ((and (<= (length open-quote) (- (point) (point-min)))
+                            (save-excursion
+                              (forward-char (- (length open-quote)))
+                              (looking-at (regexp-quote open-quote))))
                        (delete-char (- (length open-quote)))
                        ?\")
-                      ((save-excursion
-                         (forward-char (- (length close-quote)))
-                         (looking-at (regexp-quote close-quote)))
+                      ((and (<= (length open-quote) (- (point) (point-min)))
+                            (save-excursion
+                              (forward-char (- (length close-quote)))
+                              (looking-at (regexp-quote close-quote))))
                        (delete-char (- (length close-quote)))
                        ?\")
                       ((save-excursion




reply via email to

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