emacs-diffs
[Top][All Lists]
Advanced

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

master f4d0493 2/2: Fix tex-validate-buffer


From: Mattias Engdegård
Subject: master f4d0493 2/2: Fix tex-validate-buffer
Date: Sun, 25 Jul 2021 10:42:54 -0400 (EDT)

branch: master
commit f4d04931b7a2f32dd24bd45307cf4efb050793af
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    Fix tex-validate-buffer
    
    * lisp/textmodes/tex-mode.el (tex-validate-buffer):
    Set `inhibit-read-only` around all modifications of the
    read-protected *Occur* buffer (bug#19326).
    Add the `occur-match` property, and adjust the extent of the
    `occur-target` property, so that next-error and previous-error work
    correctly (bug#39121).
---
 lisp/textmodes/tex-mode.el | 30 ++++++++++++++++--------------
 1 file changed, 16 insertions(+), 14 deletions(-)

diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index ababd77..d9d8059 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -1426,20 +1426,22 @@ on the line for the invalidity you want to see."
                    ;; Skip "Mismatches:" header line.
                    (forward-line 1)
                    (setq num-matches (1+ num-matches))
-                   (insert-buffer-substring buffer start end)
-                   (let ((text-end (point-marker))
-                          (inhibit-read-only t)
-                          text-beg)
-                     (forward-char (- start end))
-                     (setq text-beg (point-marker))
-                     (insert (format "%3d: " linenum))
-                     (add-text-properties
-                      text-beg (- text-end 1)
-                      '(mouse-face highlight
-                                   help-echo
-                                   "mouse-2: go to this invalidity"))
-                     (put-text-property text-beg (- text-end 1)
-                                        'occur-target tem))))))))
+                    (let ((inhibit-read-only t))
+                     (insert-buffer-substring buffer start end)
+                     (let ((text-end (point-marker))
+                            text-beg)
+                       (forward-char (- start end))
+                       (setq text-beg (point-marker))
+                       (insert (format "%3d: " linenum))
+                       (add-text-properties
+                        text-beg (- text-end 1)
+                        '(mouse-face highlight
+                                     help-echo
+                                     "mouse-2: go to this invalidity"))
+                       (put-text-property (point) (- text-end 1)
+                                          'occur-match t)
+                       (put-text-property text-beg text-end
+                                          'occur-target tem)))))))))
       (with-current-buffer standard-output
        (let ((no-matches (zerop num-matches))
               (inhibit-read-only t))



reply via email to

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