]> git.eshelyaron.com Git - emacs.git/commitdiff
objc-mode: Fix exceptions in fontification.
authorAlan Mackenzie <acm@muc.de>
Tue, 4 Jul 2023 12:43:31 +0000 (12:43 +0000)
committerAlan Mackenzie <acm@muc.de>
Tue, 4 Jul 2023 12:43:31 +0000 (12:43 +0000)
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
lisp/progmodes/cc-fonts.el

index 721daf9d53fa17d250cfdf3c0a22e86a8296fb0d..abcc20fcb8224228b53be5a78ca5aabfeb3e32e3 100644 (file)
@@ -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))))
index afbf841bcb1cb8c480582437f94b0908aec792d0..5d5ada4c99d42d338287026ea281b16c6275b325 100644 (file)
              (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)