summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2024-05-05 11:34:14 +0000
committerAlan Mackenzie <acm@muc.de>2024-05-05 11:34:14 +0000
commit71491fe6f4a944457cb56f6323983ef431e0c422 (patch)
treed118e5276b05fae7e549addc194d95f35fb8b838
parent8098ad9679c7f5ea19493bdae18227f7a81b3eb4 (diff)
downloademacs-71491fe6f4a944457cb56f6323983ef431e0c422.tar.gz
Run c-unmark-<>-around-region in after-change-functions always.
This fixes bug#70435. * lisp/progmodes/cc-engine.el (c-unmark-<>-around-region): Run its contents in after-change-functions for a deletion, so that c-new-BEG and c-new-END get set. Add a new test (> end beg) in a check for unterminated string handling.
-rw-r--r--lisp/progmodes/cc-engine.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 8c505e9556a..0b50844732f 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -7146,7 +7146,7 @@ comment at the start of cc-engine.el for more info."
;; FIXME!!! This routine ignores the possibility of macros entirely.
;; 2010-01-29.
- (when (> end beg)
+ (when (or old-len (> end beg))
;; Extend the region (BEG END) to deal with any complicating literals.
(let* ((lit-search-beg (if (memq (char-before beg) '(?/ ?*))
(1- beg) beg))
@@ -7220,7 +7220,8 @@ comment at the start of cc-engine.el for more info."
(c-put-char-properties beg end 'syntax-table '(1))
;; If an open string's opener has just been neutralized,
;; do the same to the terminating LF.
- (when (and end-literal-end
+ (when (and (> end beg)
+ end-literal-end
(eq (char-before end-literal-end) ?\n)
(equal (c-get-char-property
(1- end-literal-end) 'syntax-table)