aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/textmodes
diff options
context:
space:
mode:
authorMattias EngdegÄrd2021-07-25 13:04:43 +0200
committerMattias EngdegÄrd2021-07-25 16:41:46 +0200
commitf4d04931b7a2f32dd24bd45307cf4efb050793af (patch)
tree5d3f273a3bdff51697189b24cc66a60d558e459a /lisp/textmodes
parent697341d7fd80091a4243a813e2aecc07fd49b10c (diff)
downloademacs-f4d04931b7a2f32dd24bd45307cf4efb050793af.tar.gz
emacs-f4d04931b7a2f32dd24bd45307cf4efb050793af.zip
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).
Diffstat (limited to 'lisp/textmodes')
-rw-r--r--lisp/textmodes/tex-mode.el30
1 files changed, 16 insertions, 14 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index ababd775d5f..d9d8059f960 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."
1426 ;; Skip "Mismatches:" header line. 1426 ;; Skip "Mismatches:" header line.
1427 (forward-line 1) 1427 (forward-line 1)
1428 (setq num-matches (1+ num-matches)) 1428 (setq num-matches (1+ num-matches))
1429 (insert-buffer-substring buffer start end) 1429 (let ((inhibit-read-only t))
1430 (let ((text-end (point-marker)) 1430 (insert-buffer-substring buffer start end)
1431 (inhibit-read-only t) 1431 (let ((text-end (point-marker))
1432 text-beg) 1432 text-beg)
1433 (forward-char (- start end)) 1433 (forward-char (- start end))
1434 (setq text-beg (point-marker)) 1434 (setq text-beg (point-marker))
1435 (insert (format "%3d: " linenum)) 1435 (insert (format "%3d: " linenum))
1436 (add-text-properties 1436 (add-text-properties
1437 text-beg (- text-end 1) 1437 text-beg (- text-end 1)
1438 '(mouse-face highlight 1438 '(mouse-face highlight
1439 help-echo 1439 help-echo
1440 "mouse-2: go to this invalidity")) 1440 "mouse-2: go to this invalidity"))
1441 (put-text-property text-beg (- text-end 1) 1441 (put-text-property (point) (- text-end 1)
1442 'occur-target tem)))))))) 1442 'occur-match t)
1443 (put-text-property text-beg text-end
1444 'occur-target tem)))))))))
1443 (with-current-buffer standard-output 1445 (with-current-buffer standard-output
1444 (let ((no-matches (zerop num-matches)) 1446 (let ((no-matches (zerop num-matches))
1445 (inhibit-read-only t)) 1447 (inhibit-read-only t))