From unknown Mon Sep 22 23:12:38 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#53605 <53605@debbugs.gnu.org> To: bug#53605 <53605@debbugs.gnu.org> Subject: Status: CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted Reply-To: bug#53605 <53605@debbugs.gnu.org> Date: Tue, 23 Sep 2025 06:12:38 +0000 retitle 53605 CC Mode 5.35.1 (C++//l); C++11 string literal operator mishig= hlighted reassign 53605 cc-mode submitter 53605 Richard Copley severity 53605 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jan 28 09:54:26 2022 Received: (at submit) by debbugs.gnu.org; 28 Jan 2022 14:54:27 +0000 Received: from localhost ([127.0.0.1]:57970 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDSdu-0007Wt-Hm for submit@debbugs.gnu.org; Fri, 28 Jan 2022 09:54:26 -0500 Received: from lists.gnu.org ([209.51.188.17]:36950) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDSds-0007Wl-GL for submit@debbugs.gnu.org; Fri, 28 Jan 2022 09:54:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47302) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nDSdr-0005j9-LN for bug-gnu-emacs@gnu.org; Fri, 28 Jan 2022 09:54:24 -0500 Received: from [2a00:1450:4864:20::530] (port=37496 helo=mail-ed1-x530.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nDSdp-0000Dp-VZ for bug-gnu-emacs@gnu.org; Fri, 28 Jan 2022 09:54:23 -0500 Received: by mail-ed1-x530.google.com with SMTP id c24so10403398edy.4 for ; Fri, 28 Jan 2022 06:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=KbSkcy/ttNTJqcngn6tM2lKYEIwfD1OcH3NQqLYZVvw=; b=QdGJpo5Du6128NhGL6aqQY2Likqu/qpRsnrmwOjO2QMqssfZaiPd3ofRjO5hoT/qgv OPT5+Y87+FTmAAchwaPP92HMHgtOmbwkDUO/E20sdLU8K5MZAIgu5dNLco2MVfgArkWX DT7XPL+MxUnDFDk3zaoRu8HM/M2oEmTpMHyRQemdHmZcTmPmJv/eCUlGZW/Mm3E5O3Uh kQbNDY7PL/0RuExOhQx9KV8zZnLgb4r7F/FrkzrjzHlsTF0iBPrLU6PP0lGdxnDpMgh7 ipgs8hwCk6aXhZOT9/B7VPeUkyop0AE+y3J/BINU3OPLZDeq2KePNHvn3NyMAb32fOyh 8Pwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to :content-transfer-encoding; bh=KbSkcy/ttNTJqcngn6tM2lKYEIwfD1OcH3NQqLYZVvw=; b=wD94imFb4zLPa/Bw+XNDhuimrrzP5FhRbETb4/RDaHIV9HWi3oaqN3MVLXPpqRihfB GH/6/Wq6X4gLK0Vgk4yRo/9egqv4hyqMm9GmoRaxpG/1lq/f1b6XITSEYGOr6zCbMGNl km2mSdjGIsl4Wn44VfiRsqLUPP20JFOiELbPToYCe8OOlBsFCkQqPLXmOWBi17L3IJgh y8e7jEdaEoZSglXw8RXEiwIFSHIBj9YYb2HBU9S0X/89jFp7IUnTzsYzHBD4/8C6X12y mi7CdlsCppvz8Zfq25wVHDysd72vLuWAa/97wKQKbKqJX0NRaMs66Wo9VeMZztPTs+KH iv3w== X-Gm-Message-State: AOAM531UMR7byBIIjXNhKhIWytrCJEtSD1Oe7ztsuyJQrUh1PMBKLrge DPufQEr2hR/+OGjveK23BbeMVms1nPBcpxXZ5hmzcfV2HXQ= X-Google-Smtp-Source: ABdhPJzUzWNAMc3ekyANhwX/1xwDgckAXkRiwGGwkzlaRaGGwnOxlTiQypdoiqlkZIm2O22jzdR5OiEn5O/oCKN1+FA= X-Received: by 2002:a05:6402:184d:: with SMTP id v13mr8540873edy.109.1643381628076; Fri, 28 Jan 2022 06:53:48 -0800 (PST) MIME-Version: 1.0 From: Richard Copley Date: Fri, 28 Jan 2022 14:53:20 +0000 Message-ID: Subject: CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted To: bug-gnu-emacs@gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::530 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=rcopley@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.1 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Package: cc-mode Hi Alan, The code below (which is valid since C++11) is mishighlighted, with the open-paren after "_opcode" in font-lock-warning face and the subsequent characters in font-lock-string-face. This is unstable: inserting and deleting a character before the open- paren fixes the highlighting, and [M-x normal-mode RET] breaks it again. < int operator""_opcode(const char *p, std::size_t size) { return 0; } END Emacs : GNU Emacs 29.0.50 (build 3, x86_64-w64-mingw32) of 2022-01-28 (on master) Package: CC Mode 5.35.1 (C++//l) Buffer Style: gnu c-emacs-features: (pps-extended-state col-0-paren posix-char-classes gen-string-delim gen-comment-delim syntax-properties 1-bit) current state: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (setq c-basic-offset 2 c-comment-only-line-offset '(0 . 0) c-indent-comment-alist '((anchored-comment column . 0) (end-block space . 1) (cpp-end-block space . 2)) c-indent-comments-syntactically-p nil c-block-comment-prefix "" c-comment-prefix-regexp '((pike-mode . "//+!?\\|\\**") (awk-mode . "#+") (other . "//+\\|\\**")) c-doc-comment-style '((java-mode . javadoc) (pike-mode . autodoc) (c-mode . gtkdoc) (c++-mode . gtkdoc)) c-cleanup-list '(scope-operator) c-hanging-braces-alist '((substatement-open before after) (arglist-cont-nonempty)) c-hanging-colons-alist nil c-hanging-semi&comma-criteria '(c-semi&comma-inside-parenlist) c-backslash-column 48 c-backslash-max-column 72 c-special-indent-hook '(t c-gnu-impose-minimum) c-label-minimum-indentation 1 c-offsets-alist '((inexpr-class . +) (inexpr-statement . +) (lambda-intro-cont . +) (inlambda . 0) (template-args-cont c-lineup-template-args +) (incomposition . +) (inmodule . +) (innamespace . +) (inextern-lang . +) (composition-close . 0) (module-close . 0) (namespace-close . 0) (extern-lang-close . 0) (composition-open . 0) (module-open . 0) (namespace-open . 0) (extern-lang-open . 0) (objc-method-call-cont c-lineup-ObjC-method-call-colons c-lineup-ObjC-method-call +) (objc-method-args-cont . c-lineup-ObjC-method-args) (objc-method-intro . [0]) (friend . 0) (cpp-define-intro c-lineup-cpp-define +) (cpp-macro-cont . +) (cpp-macro . [0]) (inclass . +) (stream-op . c-lineup-streamop) (arglist-cont-nonempty c-lineup-gcc-asm-reg c-lineup-arglist) (arglist-cont c-lineup-gcc-asm-reg 0) (comment-intro c-lineup-knr-region-comment c-lineup-comment) (catch-clause . 0) (else-clause . 0) (do-while-closure . 0) (access-label . -) (case-label . 0) (substatement . +) (statement-case-intro . +) (statement . 0) (brace-entry-open . 0) (brace-list-entry . 0) (brace-list-close . 0) (block-close . 0) (block-open . 0) (inher-cont . c-lineup-multi-inher) (inher-intro . +) (member-init-cont . c-lineup-multi-inher) (member-init-intro . +) (annotation-var-cont . +) (annotation-top-cont . 0) (topmost-intro . 0) (knr-argdecl . 0) (func-decl-cont . +) (inline-close . 0) (class-close . 0) (class-open . 0) (defun-block-intro . +) (defun-close . 0) (defun-open . 0) (c . c-lineup-C-comments) (string . c-lineup-dont-change) (topmost-intro-cont first c-lineup-topmost-intro-cont c-lineup-gnu-DEFUN-intro-cont) (brace-list-intro first c-lineup-2nd-brace-entry-in-arglist c-lineup-class-decl-init-+ +) (brace-list-open . +) (inline-open . 0) (arglist-close . c-lineup-arglist) (arglist-intro . c-lineup-arglist-intro-after-paren) (statement-cont . +) (statement-case-open . +) (label . 0) (substatement-label . 0) (substatement-open . +) (knr-argdecl-intro . 5) (statement-block-intro . +) ) c-buffer-is-cc-mode 'c++-mode c-tab-always-indent t c-syntactic-indentation t c-syntactic-indentation-in-macros t c-ignore-auto-fill '(string cpp code) c-auto-align-backslashes t c-backspace-function 'backward-delete-char-untabify c-delete-function 'delete-char c-electric-pound-behavior nil c-default-style '((java-mode . "java") (awk-mode . "awk") (other . "gnu")) c-enable-xemacs-performance-kludge-p nil c-old-style-variable-behavior nil defun-prompt-regexp nil tab-width 8 comment-column 32 parse-sexp-ignore-comments t parse-sexp-lookup-properties t auto-fill-function nil comment-multi-line t comment-start-skip "\\(?://+\\|/\\*+\\)\\s *" fill-prefix nil fill-column 70 paragraph-start "[ ]*\\(//+\\|\\**\\)[ ]*$\\|^\f" adaptive-fill-mode t adaptive-fill-regexp "[ ]*\\(//+\\|\\**\\)[ ]*\\([ ]*\\([-=E2=80=93!|#%;>*=C2=B7=E2=80=A2=E2=80=A3=E2=81=83=E2=97=A6]+[ ]*= \\)*\\)" ) From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 29 06:34:53 2022 Received: (at 53605) by debbugs.gnu.org; 29 Jan 2022 11:34:53 +0000 Received: from localhost ([127.0.0.1]:32837 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nDm0L-0007YD-7T for submit@debbugs.gnu.org; Sat, 29 Jan 2022 06:34:53 -0500 Received: from colin.muc.de ([193.149.48.1]:58155 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1nDm0K-0007Xx-1C for 53605@debbugs.gnu.org; Sat, 29 Jan 2022 06:34:52 -0500 Received: (qmail 81133 invoked by uid 3782); 29 Jan 2022 11:34:45 -0000 Received: from acm.muc.de (p4fe158ec.dip0.t-ipconnect.de [79.225.88.236]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 29 Jan 2022 12:34:45 +0100 Received: (qmail 7555 invoked by uid 1000); 29 Jan 2022 11:34:44 -0000 Date: Sat, 29 Jan 2022 11:34:44 +0000 To: Richard Copley Subject: Re: bug#53605: CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53605 Cc: 53605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Richard. Thanks for the bug report. On Fri, Jan 28, 2022 at 14:53:20 +0000, Richard Copley wrote: > Package: cc-mode > Hi Alan, > The code below (which is valid since C++11) is mishighlighted, > with the open-paren after "_opcode" in font-lock-warning face > and the subsequent characters in font-lock-string-face. This is > unstable: inserting and deleting a character before the open- > paren fixes the highlighting, and [M-x normal-mode RET] breaks > it again. > < #include > int operator""_opcode(const char *p, std::size_t size) { > return 0; > } > END It looks like the r""_opcode( has been mistaken for the raw string delimiter R""_opcode(, and the ( is in warning face because there's no matching closing delimiter. case-fold-search ought to be nil here, but appears not to be. And the check for the "R" ought to exclude other alphanumeric characters. I'll have a closer look at it in the next few days. I'm a bit short of time right at the moment. (Sorry.) > Emacs : GNU Emacs 29.0.50 (build 3, x86_64-w64-mingw32) > of 2022-01-28 (on master) > Package: CC Mode 5.35.1 (C++//l) > Buffer Style: gnu > c-emacs-features: (pps-extended-state col-0-paren posix-char-classes > gen-string-delim gen-comment-delim syntax-properties 1-bit) [ .... thanks for the (snipped) status dump! ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 30 10:42:13 2022 Received: (at 53605) by debbugs.gnu.org; 30 Jan 2022 15:42:13 +0000 Received: from localhost ([127.0.0.1]:37357 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nECLF-0007l5-I5 for submit@debbugs.gnu.org; Sun, 30 Jan 2022 10:42:13 -0500 Received: from colin.muc.de ([193.149.48.1]:46717 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1nECLC-0007kr-UJ for 53605@debbugs.gnu.org; Sun, 30 Jan 2022 10:42:12 -0500 Received: (qmail 67595 invoked by uid 3782); 30 Jan 2022 15:42:03 -0000 Received: from acm.muc.de (p2e5d54eb.dip0.t-ipconnect.de [46.93.84.235]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 30 Jan 2022 16:42:03 +0100 Received: (qmail 26680 invoked by uid 1000); 30 Jan 2022 15:42:03 -0000 Date: Sun, 30 Jan 2022 15:42:03 +0000 To: Richard Copley Subject: Re: bug#53605: CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53605 Cc: 53605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello again, Richard. On Fri, Jan 28, 2022 at 14:53:20 +0000, Richard Copley wrote: > Package: cc-mode > Hi Alan, > The code below (which is valid since C++11) is mishighlighted, > with the open-paren after "_opcode" in font-lock-warning face > and the subsequent characters in font-lock-string-face. This is > unstable: inserting and deleting a character before the open- > paren fixes the highlighting, and [M-x normal-mode RET] breaks > it again. > < #include > int operator""_opcode(const char *p, std::size_t size) { > return 0; > } > END Yes. Please try out the following patch, and confirm that it has fixed the problem (or let me know what is still not right). It's actually a small patch, just binding `case-fold-search' to nil in a function, but reindenting the entire function. As I said earlier, the r""_opcode( was getting confused for R""_opcode(, which would be a valid raw string delimiter. Thanks! diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el index 3a3413dc36..957a0b8a7c 100644 --- a/lisp/progmodes/cc-mode.el +++ b/lisp/progmodes/cc-mode.el @@ -798,43 +798,44 @@ c-common-init `c-basic-common-init' for details. It's only optional to be compatible with old code; callers should always specify it." - (unless mode - ;; Called from an old third party package. The fallback is to - ;; initialize for C. - (c-init-language-vars-for 'c-mode)) - - (c-basic-common-init mode c-default-style) - (when mode - ;; Only initialize font locking if we aren't called from an old package. - (c-font-lock-init)) - - ;; Starting a mode is a sort of "change". So call the change functions... - (save-restriction - (widen) - (setq c-new-BEG (point-min)) - (setq c-new-END (point-max)) - (save-excursion - (let (before-change-functions after-change-functions) - (mapc (lambda (fn) - (funcall fn (point-min) (point-max))) - c-get-state-before-change-functions) - (mapc (lambda (fn) - (funcall fn (point-min) (point-max) - (- (point-max) (point-min)))) - c-before-font-lock-functions)))) - - (set (make-local-variable 'outline-regexp) "[^#\n\^M]") - (set (make-local-variable 'outline-level) 'c-outline-level) - (set (make-local-variable 'add-log-current-defun-function) - (lambda () - (or (c-cpp-define-name) (car (c-defun-name-and-limits nil))))) - (let ((rfn (assq mode c-require-final-newline))) - (when rfn - (if (boundp 'mode-require-final-newline) - (and (cdr rfn) - (set (make-local-variable 'require-final-newline) - mode-require-final-newline)) - (set (make-local-variable 'require-final-newline) (cdr rfn)))))) + (let (case-fold-search) + (unless mode + ;; Called from an old third party package. The fallback is to + ;; initialize for C. + (c-init-language-vars-for 'c-mode)) + + (c-basic-common-init mode c-default-style) + (when mode + ;; Only initialize font locking if we aren't called from an old package. + (c-font-lock-init)) + + ;; Starting a mode is a sort of "change". So call the change functions... + (save-restriction + (widen) + (setq c-new-BEG (point-min)) + (setq c-new-END (point-max)) + (save-excursion + (let (before-change-functions after-change-functions) + (mapc (lambda (fn) + (funcall fn (point-min) (point-max))) + c-get-state-before-change-functions) + (mapc (lambda (fn) + (funcall fn (point-min) (point-max) + (- (point-max) (point-min)))) + c-before-font-lock-functions)))) + + (set (make-local-variable 'outline-regexp) "[^#\n\^M]") + (set (make-local-variable 'outline-level) 'c-outline-level) + (set (make-local-variable 'add-log-current-defun-function) + (lambda () + (or (c-cpp-define-name) (car (c-defun-name-and-limits nil))))) + (let ((rfn (assq mode c-require-final-newline))) + (when rfn + (if (boundp 'mode-require-final-newline) + (and (cdr rfn) + (set (make-local-variable 'require-final-newline) + mode-require-final-newline)) + (set (make-local-variable 'require-final-newline) (cdr rfn))))))) (defun c-count-cfss (lv-alist) ;; LV-ALIST is an alist like `file-local-variables-alist'. Count how many [ .... ] -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 09:37:47 2022 Received: (at 53605) by debbugs.gnu.org; 31 Jan 2022 14:37:47 +0000 Received: from localhost ([127.0.0.1]:38760 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEXoR-00051T-D4 for submit@debbugs.gnu.org; Mon, 31 Jan 2022 09:37:47 -0500 Received: from mail-ej1-f51.google.com ([209.85.218.51]:39933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEXoP-00051C-SO for 53605@debbugs.gnu.org; Mon, 31 Jan 2022 09:37:46 -0500 Received: by mail-ej1-f51.google.com with SMTP id j2so43258862ejk.6 for <53605@debbugs.gnu.org>; Mon, 31 Jan 2022 06:37:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=B+9n9S977dHvg8WAg0oxEn6mqKGJizKtj20M9n+F0ns=; b=cx0iKMgBh5a2ACeE0+UnItbyqzshmNIrfJ84KXgicj8aMcvqEgiUahXO1DrlWGhZjp LCeTx8xcOZ8wn9DjbewWpV99KA1BTMjohBjozKNNQw3mZkAlG7kXA2+vFn3GHJ97kC+4 DuymFnJBKa2tO5KSKEKSpGqHU1IzDHC0fSXAXTOLPVvf/LqfuHH2zZZiNt7iciqkx8V+ enMM2ZaHUXp6Bsug7dVVTselOt6wLQw8zUkmKDRTYOIl8CMsyqHtYTIBh3BhXGl858zK yYIxO2FnuAmb0YPEh+yCFhxPGH25mzG8ZELZctiKtxQS4qwms89goz3WJAtX0wHJJRuN /ouA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=B+9n9S977dHvg8WAg0oxEn6mqKGJizKtj20M9n+F0ns=; b=NdWdouA47WDp92wVV64bAUbLeUWljmOXd8uDXzlRaj+nh9msYFYygGoShCx36xkCJw +GRC+Bp9WtHwOt9PQdXIGb6yVdmfcj7CsmsrhfuF7sHOzxuiroBQb3ha/tQ0mml4kisz q11Ic/FI2dp0Y+CwOt9d3KxwZ6eE1Y+kd1xT6/MojnffHpQLBfWrBPauMqGEoq0jhocr Xu3Amge+EPbjJmJ2WQ2zwe5t2RGZweTLI7tTiN1IKlI4PaqEYbpK8V7fBCCYpQKtAKwh c9SQT5s9dLwE5pjdwSzEkb9sPWU2chs7nh6hBUaD/BlmfohyhGk91lLiK40PU6lmKOsQ flnA== X-Gm-Message-State: AOAM532nq5SGWRga9JwosThrue3k341hc6upA62fCIMltRww7YPM22OJ 8nAULL228HmDkGuTZEjton2lqR4ueD9yZ9FZZHc= X-Google-Smtp-Source: ABdhPJzV8pGOkuUHSMvE7E7L2gh+gkESWD4ew5+P/s+ioFPUeYLnAxyEiVXCwPEGQBFkiBlhTRwtl8cyjhRCrlVxm2s= X-Received: by 2002:a17:906:1e06:: with SMTP id g6mr17203493ejj.517.1643639859728; Mon, 31 Jan 2022 06:37:39 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Richard Copley Date: Mon, 31 Jan 2022 14:37:12 +0000 Message-ID: Subject: Re: bug#53605: CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted To: Alan Mackenzie Content-Type: text/plain; charset="UTF-8" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53605 Cc: 53605@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hi Alan, On Sun, 30 Jan 2022 at 15:42, Alan Mackenzie wrote: > > Hello again, Richard. > > Yes. Please try out the following patch, and confirm that it has fixed > the problem (or let me know what is still not right). It's actually a > small patch, just binding `case-fold-search' to nil in a function, but > reindenting the entire function. Works for me. Thank you! > As I said earlier, the r""_opcode( was getting confused for R""_opcode(, > which would be a valid raw string delimiter. > > Thanks! > > > diff --git a/lisp/progmodes/cc-mode.el b/lisp/progmodes/cc-mode.el > index 3a3413dc36..957a0b8a7c 100644 > --- a/lisp/progmodes/cc-mode.el > +++ b/lisp/progmodes/cc-mode.el > @@ -798,43 +798,44 @@ c-common-init > `c-basic-common-init' for details. It's only optional to be > compatible with old code; callers should always specify it." > > - (unless mode > - ;; Called from an old third party package. The fallback is to > - ;; initialize for C. > - (c-init-language-vars-for 'c-mode)) > - > - (c-basic-common-init mode c-default-style) > - (when mode > - ;; Only initialize font locking if we aren't called from an old package. > - (c-font-lock-init)) > - > - ;; Starting a mode is a sort of "change". So call the change functions... > - (save-restriction > - (widen) > - (setq c-new-BEG (point-min)) > - (setq c-new-END (point-max)) > - (save-excursion > - (let (before-change-functions after-change-functions) > - (mapc (lambda (fn) > - (funcall fn (point-min) (point-max))) > - c-get-state-before-change-functions) > - (mapc (lambda (fn) > - (funcall fn (point-min) (point-max) > - (- (point-max) (point-min)))) > - c-before-font-lock-functions)))) > - > - (set (make-local-variable 'outline-regexp) "[^#\n\^M]") > - (set (make-local-variable 'outline-level) 'c-outline-level) > - (set (make-local-variable 'add-log-current-defun-function) > - (lambda () > - (or (c-cpp-define-name) (car (c-defun-name-and-limits nil))))) > - (let ((rfn (assq mode c-require-final-newline))) > - (when rfn > - (if (boundp 'mode-require-final-newline) > - (and (cdr rfn) > - (set (make-local-variable 'require-final-newline) > - mode-require-final-newline)) > - (set (make-local-variable 'require-final-newline) (cdr rfn)))))) > + (let (case-fold-search) > + (unless mode > + ;; Called from an old third party package. The fallback is to > + ;; initialize for C. > + (c-init-language-vars-for 'c-mode)) > + > + (c-basic-common-init mode c-default-style) > + (when mode > + ;; Only initialize font locking if we aren't called from an old package. > + (c-font-lock-init)) > + > + ;; Starting a mode is a sort of "change". So call the change functions... > + (save-restriction > + (widen) > + (setq c-new-BEG (point-min)) > + (setq c-new-END (point-max)) > + (save-excursion > + (let (before-change-functions after-change-functions) > + (mapc (lambda (fn) > + (funcall fn (point-min) (point-max))) > + c-get-state-before-change-functions) > + (mapc (lambda (fn) > + (funcall fn (point-min) (point-max) > + (- (point-max) (point-min)))) > + c-before-font-lock-functions)))) > + > + (set (make-local-variable 'outline-regexp) "[^#\n\^M]") > + (set (make-local-variable 'outline-level) 'c-outline-level) > + (set (make-local-variable 'add-log-current-defun-function) > + (lambda () > + (or (c-cpp-define-name) (car (c-defun-name-and-limits nil))))) > + (let ((rfn (assq mode c-require-final-newline))) > + (when rfn > + (if (boundp 'mode-require-final-newline) > + (and (cdr rfn) > + (set (make-local-variable 'require-final-newline) > + mode-require-final-newline)) > + (set (make-local-variable 'require-final-newline) (cdr rfn))))))) > > (defun c-count-cfss (lv-alist) > ;; LV-ALIST is an alist like `file-local-variables-alist'. Count how many > > > [ .... ] > > -- > Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Jan 31 12:50:56 2022 Received: (at 53605-done) by debbugs.gnu.org; 31 Jan 2022 17:50:56 +0000 Received: from localhost ([127.0.0.1]:40690 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nEapM-00044R-DM for submit@debbugs.gnu.org; Mon, 31 Jan 2022 12:50:56 -0500 Received: from colin.muc.de ([193.149.48.1]:33103 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1nEapJ-000448-Us for 53605-done@debbugs.gnu.org; Mon, 31 Jan 2022 12:50:55 -0500 Received: (qmail 62995 invoked by uid 3782); 31 Jan 2022 17:50:47 -0000 Received: from acm.muc.de (p4fe159eb.dip0.t-ipconnect.de [79.225.89.235]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 31 Jan 2022 18:50:46 +0100 Received: (qmail 30646 invoked by uid 1000); 31 Jan 2022 17:50:44 -0000 Date: Mon, 31 Jan 2022 17:50:44 +0000 To: Richard Copley Subject: Re: bug#53605: CC Mode 5.35.1 (C++//l); C++11 string literal operator mishighlighted Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 53605-done Cc: 53605-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Richard. On Mon, Jan 31, 2022 at 14:37:12 +0000, Richard Copley wrote: > Hi Alan, > On Sun, 30 Jan 2022 at 15:42, Alan Mackenzie wrote: > > Yes. Please try out the following patch, and confirm that it has > > fixed the problem (or let me know what is still not right). It's > > actually a small patch, just binding `case-fold-search' to nil in a > > function, but reindenting the entire function. > Works for me. Thank you! Thanks for the quick response! I've committed the fix to CC Mode and the Emacs master branch at savannah, and I'm closing the bug with this post. -- Alan Mackenzie (Nuremberg, Germany). From unknown Mon Sep 22 23:12:38 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 01 Mar 2022 12:24:03 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator