emacs-diffs
[Top][All Lists]
Advanced

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

master 4707f6adf6a: Fontify "extern foo (); " correctly inside a functio


From: Alan Mackenzie
Subject: master 4707f6adf6a: Fontify "extern foo (); " correctly inside a function
Date: Wed, 3 May 2023 06:04:14 -0400 (EDT)

branch: master
commit 4707f6adf6a2e4f40692fa149023552f5a4f7866
Author: Alan Mackenzie <acm@muc.de>
Commit: Alan Mackenzie <acm@muc.de>

    Fontify "extern foo ();" correctly inside a function
    
    This fixes bug#63224.
    
    * lisp/progmodes/cc-engine.el (c-forward-type): Handle the "("
    as a special case by trying to parse it with
    c-forward-declarator and accepting it as a typeless function
    when that fails.
---
 lisp/progmodes/cc-engine.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index f7320da5629..8b34daf03c2 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -9279,7 +9279,11 @@ multi-line strings (but not C++, for example)."
             (setq pos (point))
             (c-forward-syntactic-ws)
             (and (not (looking-at c-symbol-start))
-                 (not (looking-at c-type-decl-prefix-key)))))
+                 (or
+                  (not (looking-at c-type-decl-prefix-key))
+                  (and (eq (char-after) ?\()
+                       (not (save-excursion
+                              (c-forward-declarator))))))))
       ;; A C specifier followed by an implicit int, e.g.
       ;; "register count;"
       (goto-char prefix-end-pos)



reply via email to

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