From 9d5a24cfac3a4e89b161ecedddbf68b83eb22f13 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Fri, 3 Apr 2026 04:38:59 +0300 Subject: [PATCH] grep-edit--prepare-buffer: Fix allowed insertion positions * lisp/progmodes/grep.el (grep-edit--prepare-buffer): Fix allowed insertion positions, like previously in xref-edit--prepare-buffer. --- lisp/progmodes/grep.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 128952a2dd4..72a05a082bb 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -1089,11 +1089,15 @@ list is empty)." match) (while (setq match (text-property-search-forward 'compilation-annotation)) (add-text-properties (prop-match-beginning match) (prop-match-end match) - '(read-only t))) + '(read-only t front-sticky t))) (goto-char (point-min)) (while (setq match (text-property-search-forward 'compilation-message)) (add-text-properties (prop-match-beginning match) (prop-match-end match) - '(read-only t occur-prefix t)) + '( read-only t occur-prefix t + ;; Allow insertion of text right + ;; after prefix, but not before. + front-sticky t + rear-nonsticky t)) (let ((loc (compilation--message->loc (prop-match-value match))) m) ;; Update the markers if necessary.