emacs-diffs
[Top][All Lists]
Advanced

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

master 793a416653a: objc-mode: Fix exceptions in fontification.


From: Alan Mackenzie
Subject: master 793a416653a: objc-mode: Fix exceptions in fontification.
Date: Tue, 4 Jul 2023 08:45:42 -0400 (EDT)

branch: master
commit 793a416653af0e4be5b6adec9323a1dafd1545eb
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    objc-mode: Fix exceptions in fontification.
    
    These exceptions ("Invalid search bound (wrong side of point)")
    were observed in test suite file class-24.m when moving point
    up and down a line at a time.
    
    * lisp/progmodes/cc-engine.el (c-forward-declarator): In the
    c-syntactic-re-search-forward ~30 lines from the end of the
    function amend the regexp for objc-mode such that "@end"
    terminates the search, but "<" doesn't.
    
    * lisp/progmodes/cc-fonts.el
    (c-make-font-lock-search-function): supply a non-nil
    CHECK-POINT argument to c-make-font-lock-search-form.
---
 lisp/progmodes/cc-engine.el | 6 +++++-
 lisp/progmodes/cc-fonts.el  | 2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 721daf9d53f..abcc20fcb82 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -10219,7 +10219,11 @@ point unchanged and return nil."
                               (prog1
                                   (setq found
                                         (c-syntactic-re-search-forward
-                                         "[;:,]\\|\\(=\\|\\s(\\)"
+                                         ;; Consider making the next regexp a
+                                         ;; c-lang-defvar (2023-07-04).
+                                         (if (c-major-mode-is 'objc-mode)
+                                             
"\\(?:@end\\)\\|[;:,]\\|\\(=\\|[[(]\\)"
+                                           "[;:,]\\|\\(=\\|\\s(\\)")
                                          limit 'limit t))
                                 (setq got-init
                                       (and found (match-beginning 1))))
diff --git a/lisp/progmodes/cc-fonts.el b/lisp/progmodes/cc-fonts.el
index afbf841bcb1..5d5ada4c99d 100644
--- a/lisp/progmodes/cc-fonts.el
+++ b/lisp/progmodes/cc-fonts.el
@@ -387,7 +387,7 @@
              (parse-sexp-lookup-properties
               (cc-eval-when-compile
                 (boundp 'parse-sexp-lookup-properties))))
-         ,(c-make-font-lock-search-form regexp highlights))
+         ,(c-make-font-lock-search-form regexp highlights t))
        nil)))
 
   (defun c-make-font-lock-BO-decl-search-function (regexp &rest highlights)



reply via email to

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