emacs-diffs
[Top][All Lists]
Advanced

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

master a0cd986e675: c-indent-new-comment-line: don't test for a macro in


From: Alan Mackenzie
Subject: master a0cd986e675: c-indent-new-comment-line: don't test for a macro in a comment
Date: Sun, 15 Oct 2023 06:56:47 -0400 (EDT)

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

    c-indent-new-comment-line: don't test for a macro in a comment
    
    This fixes bug#9860.
    
    * lisp/progmodes/cc-cmds (c-indent-new-comment-line): Test for
    a comment/string before testing for a macro, thus preventing a
    "macro" being spuriously recognized in a comment.  This allows
    auto-fill-mode to work on a line beginning with # in a comment.
---
 lisp/progmodes/cc-cmds.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/cc-cmds.el b/lisp/progmodes/cc-cmds.el
index 15b103a081f..658892414bc 100644
--- a/lisp/progmodes/cc-cmds.el
+++ b/lisp/progmodes/cc-cmds.el
@@ -4909,7 +4909,8 @@ If a fill prefix is specified, it overrides all the 
above."
           (setq c-lit-limits (c-literal-limits nil nil t)))
         (unless c-lit-type
           (setq c-lit-type (c-literal-type c-lit-limits)))
-        (if (memq (cond ((c-query-and-set-macro-start) 'cpp)
+        (if (memq (cond ((memq c-lit-type '(c c++ string)) c-lit-type)
+                        ((c-query-and-set-macro-start) 'cpp)
                         ((null c-lit-type) 'code)
                         (t c-lit-type))
                   c-ignore-auto-fill)



reply via email to

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