From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Herman@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= Newsgroups: gmane.emacs.bugs Subject: bug#70435: 30.0.50; cc-mode: <> are sometimes not reconized as parentheses Date: Sun, 28 Apr 2024 18:47:47 +0200 Message-ID: <87y18xifpb.fsf@gmail.com> References: <87le5cuuyq.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9472"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Herman@muc.de, Eli Zaretskii , 70435@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 28 19:03:02 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s17vZ-00024A-9d for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Apr 2024 19:03:01 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s17vJ-000660-Jm; Sun, 28 Apr 2024 13:02:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s17vH-000659-7z for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 13:02:43 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s17vG-0001F9-VM for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 13:02:42 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1s17va-0001Mj-1k for bug-gnu-emacs@gnu.org; Sun, 28 Apr 2024 13:03:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Herman@debbugs.gnu.org, =?UTF-8?Q?G=C3=A9za?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Apr 2024 17:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70435 X-GNU-PR-Package: emacs Original-Received: via spool by 70435-submit@debbugs.gnu.org id=B70435.17143237445231 (code B ref 70435); Sun, 28 Apr 2024 17:03:02 +0000 Original-Received: (at 70435) by debbugs.gnu.org; 28 Apr 2024 17:02:24 +0000 Original-Received: from localhost ([127.0.0.1]:51237 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s17ux-0001MJ-Mc for submit@debbugs.gnu.org; Sun, 28 Apr 2024 13:02:24 -0400 Original-Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]:50544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1s17uu-0001M8-S6 for 70435@debbugs.gnu.org; Sun, 28 Apr 2024 13:02:21 -0400 Original-Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-56e6acb39d4so4443390a12.1 for <70435@debbugs.gnu.org>; Sun, 28 Apr 2024 10:02:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714323715; x=1714928515; darn=debbugs.gnu.org; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :references:from:to:cc:subject:date:message-id:reply-to; bh=Ee6WH+blKBrgELRiykasdvQvzxNp3yAA73DZ0oT0OnY=; b=OSm1AW2Lhh6RK7GRQrBoej0sSwJkarxYd4vXltdwFCnokKN9/iH8i5q5Z+48SO2BSi N5NS23nQLhNO8utto1bVwGAZgwrR/J8VBipW7MLpwg1aCCcqV8AFzPD798AHBWf+9baP 0APZESu6uliPWu309ZZNmHDdC6zLaqwGTe+VbJZTUH6hnuxKBGMzGDXXluFu+mw6LbRn CWIXMhlZd2eHEgPBoXmi8bboAtTGcazSRHKckFhbQRr09Hcd5OfgHPz3J5FJbZ3mKi2J 8Xc988q5fvZPqy2zxMdVw5T9yA5wDDeUXv6bLBU4YOQ7EQ3awKxnUOeBtYxjT/jzU+9d ruJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714323715; x=1714928515; h=mime-version:message-id:in-reply-to:date:subject:cc:to:from :references:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Ee6WH+blKBrgELRiykasdvQvzxNp3yAA73DZ0oT0OnY=; b=i3tgLuKV+ID/P5SC86mkaP6NQx7RW3aITH84u6V0qab3QJzdjp8xU86uijSJXyntc4 Zs4w92/GXEkGsnMqSchZM1UE6ms3z1HVxjnop3LSk51/fXN4tZ1Zv4xY03w1L+u907N9 Bm1o4liciQgylftnc7rrOYMBR2HQMteX9XNdwt8XXFCYW+oAM14UwEFjTqOz0Si3DUIL SH6AqQIfxAN6zcWezHr4sHxT3p24OkKgVa8ssK88wlGj1RIjXIHCszo7XGl31SS6ybiA rTzC+hAGRBpzarigKslEdWR96hk+HtYNfLbuBoJJxD3XWYXBmfIsWIMKX+9yRfjXLeou REXQ== X-Forwarded-Encrypted: i=1; AJvYcCXo9fNmeeCLJSKcpY23gGiDQx5T+k9Yd4zFqOAAT/da+GdCH30ycXC7d+Ljzwe3mGzipvHsJY9koHZoQdOwaNqb0xCjwX0= X-Gm-Message-State: AOJu0Yz/dqShZjjFZ4eDNyrh8Fq1cgYDjSxDqRtR1OQRC7aYuSPd0xf2 YoNFNeWs/VfzHkzS0dJix/Lv5lz2cV8+qumVuz4DFNovv6oMLUat X-Google-Smtp-Source: AGHT+IFM911F7k7oz/qf87YRnuwzBsqw8kA6JnZdmHR3q9IIlYXCG3GkXLo9I/JPs2bNee1MsIdQyw== X-Received: by 2002:a17:906:16d7:b0:a58:86c0:1275 with SMTP id t23-20020a17090616d700b00a5886c01275mr4880181ejd.30.1714323715030; Sun, 28 Apr 2024 10:01:55 -0700 (PDT) Original-Received: from localhost (netacc-gpn-4-8-242.pool.yettel.hu. [84.224.8.242]) by smtp.gmail.com with ESMTPSA id ld14-20020a170906f94e00b00a58ff5adad2sm444145ejb.90.2024.04.28.10.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 10:01:54 -0700 (PDT) In-reply-to: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:284099 Archived-At: Hello Alan, Alan Mackenzie writes: > You've been a little less than fully explicit, but I think > you're > executing these commands in the *scratch* buffer. The first two > lines, > which are commented out in emacs-lisp-mode, are no longer > commented out > in C++ Mode. There is a whole line of garbage after the last > end of > statement marker, the (double) semicolon on line 2. > > On using ig to insert the snippet, it is hardly surprising > that CC > Mode's syntactic analysis gets confused. If you first comment > out those > first two lines (put the region around them and do C-c C-c), > then the > inserted snippet appears to get the correct syntax on its > template > markers. > > I don't think there's a bug here. If you could show ig > producing > the effect when typed inside a syntactically correct context, > things > might be different. Can you reproduce the effect in correct C++ > code? You're right, it seems that the example I provided wasn't the best (this issue happens with me in real code, I tried to create a minimal reproducible example). If you delete the garbage from the scratch buffer, the bug doesn't reproduce indeed. But, if you run (setq font-lock-maximum-decoration 2) before switching to c++-mode, the issue reproduces with an empty scratch buffer. I use this setting because font-lock runs much faster this way, and I rely on the LSP server to do the "full" highlighting. Sorry about the bad example, here are the fixed repro steps: Repro: - put the yasnippet file (included below) into /snippets/c++-mode/something - install yasnippet - start emacs, scratch buffer appears - delete the contents of the scratch buffer - M-: (setq font-lock-maximum-decoration 2) - M-x c++-mode - M-x yas-minor-mode - load snippets with "M-x yas-reload-all" - write "ig", then press TAB to "yas-expand" the snippet - move the cursor on the opening "<", and execute "M-x describe-char" - notice that it will say "syntax: . which means: punctuation" - if you edit the buffer (like add a space somewhere), and execute describe-char again, Emacs will say "syntax: > which means: open, matches >", so the syntax class becomes correct. Geza