diff options
| author | Alan Mackenzie | 2023-07-04 12:43:31 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2023-07-04 12:43:31 +0000 |
| commit | 793a416653af0e4be5b6adec9323a1dafd1545eb (patch) | |
| tree | 1ccba869ee0bc5f6b56b8d310797f1b22fc3b54d | |
| parent | ec89acba5f5652b661f364c5f4e9c43b85a2f433 (diff) | |
| download | emacs-793a416653af0e4be5b6adec9323a1dafd1545eb.tar.gz emacs-793a416653af0e4be5b6adec9323a1dafd1545eb.zip | |
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.
| -rw-r--r-- | lisp/progmodes/cc-engine.el | 6 | ||||
| -rw-r--r-- | 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." | |||
| 10219 | (prog1 | 10219 | (prog1 |
| 10220 | (setq found | 10220 | (setq found |
| 10221 | (c-syntactic-re-search-forward | 10221 | (c-syntactic-re-search-forward |
| 10222 | "[;:,]\\|\\(=\\|\\s(\\)" | 10222 | ;; Consider making the next regexp a |
| 10223 | ;; c-lang-defvar (2023-07-04). | ||
| 10224 | (if (c-major-mode-is 'objc-mode) | ||
| 10225 | "\\(?:@end\\)\\|[;:,]\\|\\(=\\|[[(]\\)" | ||
| 10226 | "[;:,]\\|\\(=\\|\\s(\\)") | ||
| 10223 | limit 'limit t)) | 10227 | limit 'limit t)) |
| 10224 | (setq got-init | 10228 | (setq got-init |
| 10225 | (and found (match-beginning 1)))) | 10229 | (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 @@ | |||
| 387 | (parse-sexp-lookup-properties | 387 | (parse-sexp-lookup-properties |
| 388 | (cc-eval-when-compile | 388 | (cc-eval-when-compile |
| 389 | (boundp 'parse-sexp-lookup-properties)))) | 389 | (boundp 'parse-sexp-lookup-properties)))) |
| 390 | ,(c-make-font-lock-search-form regexp highlights)) | 390 | ,(c-make-font-lock-search-form regexp highlights t)) |
| 391 | nil))) | 391 | nil))) |
| 392 | 392 | ||
| 393 | (defun c-make-font-lock-BO-decl-search-function (regexp &rest highlights) | 393 | (defun c-make-font-lock-BO-decl-search-function (regexp &rest highlights) |