From unknown Fri Jun 20 18:10:02 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#59816 <59816@debbugs.gnu.org> To: bug#59816 <59816@debbugs.gnu.org> Subject: Status: 29.0.60; c++-ts-mode handles one-line comments badly Reply-To: bug#59816 <59816@debbugs.gnu.org> Date: Sat, 21 Jun 2025 01:10:02 +0000 retitle 59816 29.0.60; c++-ts-mode handles one-line comments badly reassign 59816 emacs submitter 59816 Herman, G=C3=A9za severity 59816 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Dec 04 07:59:05 2022 Received: (at submit) by debbugs.gnu.org; 4 Dec 2022 12:59:06 +0000 Received: from localhost ([127.0.0.1]:57551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1oaH-0007mm-Cj for submit@debbugs.gnu.org; Sun, 04 Dec 2022 07:59:05 -0500 Received: from lists.gnu.org ([209.51.188.17]:44376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p1oaC-0007mO-9v for submit@debbugs.gnu.org; Sun, 04 Dec 2022 07:59:03 -0500 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 1p1oaC-0004rF-3Z for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 07:59:00 -0500 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p1oa9-0004rG-El for bug-gnu-emacs@gnu.org; Sun, 04 Dec 2022 07:58:59 -0500 Received: by mail-ej1-x633.google.com with SMTP id vv4so21803998ejc.2 for ; Sun, 04 Dec 2022 04:58:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:from:to:cc:subject:date :message-id:reply-to; bh=B5f+QxFHThJsSNOe30NMgdixmIjXkMXsW0Ee6f7bfXA=; b=fKkddG/kemOxOcmXpOG5OsqB/hzOWTMh5CdIHiATIUIyrqt46Vv+dLgXZAHJEYaGyi D4c7+JtP3+lLZnJHmB14rsGxJeM+wRfDW89ANxj+/8s6EgHV9jCqhB+Y8FnHtxaEJDHU RkL3Pexc/DzJqq3IwbyaUiNb4WR6a+Gy73U2o0bplMObV4r8DN6fmhObHlK1AQ8jW+ZH zdi/sDcfVLGcMOgwP/OxngFMpvGYQjWyy/HsFkbV/YNbJjWnOqDaWXXX0k4qM0JseTkm YVi3wabyVx98W1OJ4vK0lXg3MEeQvw0Kg0+F4pz6OHG0LTT2IVD0iVNQrqG/6GSFxgOX Xufw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:subject:from:to:content-language :user-agent:mime-version:date:message-id:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=B5f+QxFHThJsSNOe30NMgdixmIjXkMXsW0Ee6f7bfXA=; b=4aQS5fHDHsyS5/pnvPI8g/+BCjIdqh9uAFs1+2bbE2dnm7KOuXT3S4/+LpRnk4YnQN SbjtoZp+a44GWPliMonM2hqyN7KLITqLcrVUyOJorjJvAXlbY0wDQWdsy2yfq/ODr9cs DHZ2ekJWFc4vEx0likI9uMRo9Or1Ubk7txRkZtzCQ6E3kdMSDlcJStWW9j/qHiLhfvJ0 Bxxzq5OjJgNcBAmkjT/gYUQ2mXgljLnVE4rgfRWZNhZkJGelQcjs4Nt1M0Q6wgAWAsdA Mc9cIPbFEX0xpFAOOwtpWUozuI8G0w9LG/XUJJ846DdAT0760r4Cl0RepCnv2mvNKSh+ V48g== X-Gm-Message-State: ANoB5pn0XifkdiuxrKpcYIc07B+NBJE4/ZcjGMBwrFbrA5OQATReb2L3 u4gRb8ISHZyPXY47Q4MSP7F+ZecJ8EY= X-Google-Smtp-Source: AA0mqf6rWK1hiA0ks9HsqtJfDSgBEaYFQKZormE2O8G4coLDAbsB+6J2nQRIaVKe5OUjOOKG5vqUUw== X-Received: by 2002:a17:907:a78a:b0:7c0:ada7:f1b6 with SMTP id vx10-20020a170907a78a00b007c0ada7f1b6mr13281652ejc.173.1670158734706; Sun, 04 Dec 2022 04:58:54 -0800 (PST) Received: from [192.168.8.4] (netacc-gpn-204-20-128.pool.yettel.hu. [5.204.20.128]) by smtp.gmail.com with ESMTPSA id w19-20020a17090649d300b007c0a7286c0asm4690098ejv.58.2022.12.04.04.58.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Dec 2022 04:58:54 -0800 (PST) Message-ID: <08257d6b-2426-bbdf-0ed4-edd161801ad6@gmail.com> Date: Sun, 4 Dec 2022 13:58:52 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Content-Language: sv-FI To: bug-gnu-emacs@gnu.org From: =?UTF-8?Q?Herman=2c_G=c3=a9za?= Subject: 29.0.60; c++-ts-mode handles one-line comments badly Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=geza.herman@gmail.com; helo=mail-ej1-x633.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) 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 (--) With the following simple program, emacs reports that "int a;" is in a comment: --------------------- void foo() {    // c    int a; } --------------------- Repro steps: - install tree-sitter-cpp available at https://github.com/tree-sitter/tree-sitter-cpp - copy the program above into a buffer - switch to c++-ts-mode - at the line "int a;", put the cursor at the 'i' (or anywhere in the line, exact position doesn't seem to matter) - M-: (nth 4 (syntax-ppss (point))) For me, this incorrectly returns "t". In c++-mode (without tree sitter), this correctly returns "nil". If I replace "// c" with "/* c */", the bug doesn't happen. It seems that one line comments don't end at the end of the line but last until the end of the buffer. The AST looks like this (with both comment styles there are the same) using treesit-explore-mode: (function_definition type: (primitive_type)  declarator:   (function_declarator declarator: (identifier)    parameters: (parameter_list ( )))  body:   (compound_statement { (comment)    (declaration type: (primitive_type) declarator: (identifier) ;)    })) Note I'm not sure whether this is an emacs, tree-sitter or tree-sitter-cpp bug. But because the AST is the same for /* */ kind of comment, and also if press RET on "(comment)" then only the "// c" comment is highlighted (so tree-sitter reports the correct area for the comment), I suppose that this is an emacs-related problem. In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version  3.24.20, cairo version 1.16.0) of 2022-12-04 built on zetor Repository revision: 84214578f5a2ff0d45312d9385442583f6877fb5 Repository branch: HEAD Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Debian GNU/Linux bullseye/sid Configured using:  'configure --with-native-compilation --without-compress-install  --with-xinput2 --with-xwidgets --with-tree-sitter  'CFLAGS=-fno-omit-frame-pointer -g3 -O2'' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM XWIDGETS GTK3 ZLIB Important settings:   value of $LC_ALL: C.UTF-8   value of $LANG: en_US.UTF-8   value of $XMODIFIERS: @im=none   locale-coding-system: utf-8-unix Major mode: C++//l Minor modes in effect:   tooltip-mode: t   global-eldoc-mode: t   show-paren-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   line-number-mode: t   indent-tabs-mode: t   transient-mark-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t   abbrev-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs c-ts-mode treesit cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads xwidget-internal dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 108555 6531)  (symbols 48 9153 0)  (strings 32 26241 1411)  (string-bytes 1 905477)  (vectors 16 18498)  (vector-slots 8 368704 14814)  (floats 8 42 316)  (intervals 56 400 0)  (buffers 992 11)) From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 07:44:57 2022 Received: (at 59816) by debbugs.gnu.org; 5 Dec 2022 12:44:57 +0000 Received: from localhost ([127.0.0.1]:35808 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Aq8-0000R8-Nv for submit@debbugs.gnu.org; Mon, 05 Dec 2022 07:44:57 -0500 Received: from out2.migadu.com ([188.165.223.204]:49777) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Aq5-0000R2-Vr for 59816@debbugs.gnu.org; Mon, 05 Dec 2022 07:44:55 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1670244292; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=fyFaYERT4GRt2sZV2+aXF8lIg1WYg+mLAm89HQJ4fPY=; b=bHl3c3We8jTHiwtpXHrjjidQExQHEg0IgKHXiyNVZcqwC9+zUoxvVmLra+dMd5X6gy2E4K eXmRb78wrGs0yvn5m0f73YYylsxhFreHulKYhtaeExcT9cmn4sYK/KM6vhd54mYwdE70UZ HuCeJ8aETCgnp12goeteZenuwGNTtCwUdtWjqQjiplv1xsVxewjdE91iRKLrPAB/M6KKDM e91SzOIrx9Z0PLpu32POSeLH3XR8RjgpeHcR95A8M2sD93rMJo6mnrPIJFKhchpmBAoMiW 4ZQ7UHTHp5KwL9A5TgFUIxcN0NwnZH4cG7lA1PupvcwKAB3kATUUCeE5Ra4rzg== From: Theodor Thornhill To: 59816@debbugs.gnu.org Subject: [PATCH]: bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly In-Reply-To: <08257d6b-2426-bbdf-0ed4-edd161801ad6@gmail.com> (Herman's message of "Sun, 4 Dec 2022 13:58:52 +0100") References: <08257d6b-2426-bbdf-0ed4-edd161801ad6@gmail.com> Date: Mon, 05 Dec 2022 13:44:49 +0100 Message-ID: <878rjmdnpa.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59816 Cc: eliz@gnu.org, geza.herman@gmail.com 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 (-) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Herman, G=C3=A9za writes: > With the following simple program, emacs reports that "int a;" is in a co= mment: > > --------------------- > void foo() { > =C2=A0=C2=A0 // c > =C2=A0=C2=A0 int a; > } > --------------------- > > Repro steps: > - install tree-sitter-cpp available at > https://github.com/tree-sitter/tree-sitter-cpp > - copy the program above into a buffer > - switch to c++-ts-mode > - at the line "int a;", put the cursor at the 'i' (or anywhere in the lin= e, > exact position doesn't seem to matter) > - M-: (nth 4 (syntax-ppss (point))) > > For me, this incorrectly returns "t". In c++-mode (without tree sitter), = this > correctly returns "nil". > You're right. This is my bad. This patch addresses it. What do you think, Eli? BTW - I see that many modes in general don't refer to their syntax-tables in their define-derived-mode form. Is that intentional? Theo --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Fix-syntax-table-for-tree-sitter-modes.patch >From b59c4cf3b238291fab57e6de47c60c5bdca3bc4f Mon Sep 17 00:00:00 2001 From: Theodor Thornhill Date: Mon, 5 Dec 2022 13:37:58 +0100 Subject: [PATCH] Fix syntax-table for tree-sitter modes When adapting the 'c-populate-syntax-table' for tree-sitter, I misread the code, and thus some crucial entries were missing. For the relevant modes we use the same table as specified in the non-tree-sitter major mode. * lisp/progmodes/c-ts-mode.el (c-ts-mode--syntax-table): Add new entries. * lisp/progmodes/csharp-mode.el (csharp-ts-mode): Add new entries. * lisp/progmodes/java-ts-mode.el (java-ts-mode--syntax-table): Add new entries. * lisp/progmodes/json-ts-mode.el (json-ts-mode--syntax-table): Add new entries. * lisp/progmodes/typescript-ts-mode.el (typescript-ts-mode--syntax-table): Add new entries. * lisp/textmodes/css-mode.el (css-ts-mode): Add new entries. --- lisp/progmodes/c-ts-mode.el | 2 ++ lisp/progmodes/csharp-mode.el | 1 + lisp/progmodes/java-ts-mode.el | 5 +++++ lisp/progmodes/json-ts-mode.el | 8 +++++--- lisp/progmodes/typescript-ts-mode.el | 9 +++++++-- lisp/textmodes/css-mode.el | 1 + 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el index 1bd093cfa2..0fcc9b9fe4 100644 --- a/lisp/progmodes/c-ts-mode.el +++ b/lisp/progmodes/c-ts-mode.el @@ -79,6 +79,8 @@ c-ts-mode--syntax-table (modify-syntax-entry ?\240 "." table) (modify-syntax-entry ?/ ". 124b" table) (modify-syntax-entry ?* ". 23" table) + (modify-syntax-entry ?\n "> b" table) + (modify-syntax-entry ?\^m "> b" table) table) "Syntax table for `c-ts-mode'.") diff --git a/lisp/progmodes/csharp-mode.el b/lisp/progmodes/csharp-mode.el index 054dabfed0..bb721e248a 100644 --- a/lisp/progmodes/csharp-mode.el +++ b/lisp/progmodes/csharp-mode.el @@ -890,6 +890,7 @@ csharp-mode ;;;###autoload (define-derived-mode csharp-ts-mode prog-mode "C#" "Major mode for editing C# code." + :syntax-table (csharp--make-mode-syntax-table) (unless (treesit-ready-p 'c-sharp) (error "Tree-sitter for C# isn't available")) diff --git a/lisp/progmodes/java-ts-mode.el b/lisp/progmodes/java-ts-mode.el index 2c42505ac9..f947efc5a4 100644 --- a/lisp/progmodes/java-ts-mode.el +++ b/lisp/progmodes/java-ts-mode.el @@ -58,6 +58,11 @@ java-ts-mode--syntax-table (modify-syntax-entry ?| "." table) (modify-syntax-entry ?\' "\"" table) (modify-syntax-entry ?\240 "." table) + (modify-syntax-entry ?/ ". 124b" table) + (modify-syntax-entry ?* ". 23" table) + (modify-syntax-entry ?\n "> b" table) + (modify-syntax-entry ?\^m "> b" table) + (modify-syntax-entry ?@ "'" table) table) "Syntax table for `java-ts-mode'.") diff --git a/lisp/progmodes/json-ts-mode.el b/lisp/progmodes/json-ts-mode.el index 101e873cf6..cd96b139be 100644 --- a/lisp/progmodes/json-ts-mode.el +++ b/lisp/progmodes/json-ts-mode.el @@ -46,9 +46,7 @@ json-ts-mode-indent-offset (defvar json-ts-mode--syntax-table (let ((table (make-syntax-table))) - ;; Taken from the cc-langs version (modify-syntax-entry ?_ "_" table) - (modify-syntax-entry ?$ "_" table) (modify-syntax-entry ?\\ "\\" table) (modify-syntax-entry ?+ "." table) (modify-syntax-entry ?- "." table) @@ -58,8 +56,12 @@ json-ts-mode--syntax-table (modify-syntax-entry ?> "." table) (modify-syntax-entry ?& "." table) (modify-syntax-entry ?| "." table) - (modify-syntax-entry ?` "\"" table) + (modify-syntax-entry ?\' "\"" table) (modify-syntax-entry ?\240 "." table) + (modify-syntax-entry ?/ ". 124b" table) + (modify-syntax-entry ?* ". 23" table) + (modify-syntax-entry ?\n "> b" table) + (modify-syntax-entry ?\^m "> b" table) table) "Syntax table for `json-ts-mode'.") diff --git a/lisp/progmodes/typescript-ts-mode.el b/lisp/progmodes/typescript-ts-mode.el index 48ac1169fe..c7edbb40f8 100644 --- a/lisp/progmodes/typescript-ts-mode.el +++ b/lisp/progmodes/typescript-ts-mode.el @@ -45,7 +45,6 @@ typescript-ts-mode--syntax-table (let ((table (make-syntax-table))) ;; Taken from the cc-langs version (modify-syntax-entry ?_ "_" table) - (modify-syntax-entry ?$ "_" table) (modify-syntax-entry ?\\ "\\" table) (modify-syntax-entry ?+ "." table) (modify-syntax-entry ?- "." table) @@ -55,8 +54,14 @@ typescript-ts-mode--syntax-table (modify-syntax-entry ?> "." table) (modify-syntax-entry ?& "." table) (modify-syntax-entry ?| "." table) - (modify-syntax-entry ?` "\"" table) + (modify-syntax-entry ?\' "\"" table) (modify-syntax-entry ?\240 "." table) + (modify-syntax-entry ?/ ". 124b" table) + (modify-syntax-entry ?* ". 23" table) + (modify-syntax-entry ?\n "> b" table) + (modify-syntax-entry ?\^m "> b" table) + (modify-syntax-entry ?$ "_" table) + (modify-syntax-entry ?` "\"" table) table) "Syntax table for `typescript-ts-mode'.") diff --git a/lisp/textmodes/css-mode.el b/lisp/textmodes/css-mode.el index b82886e397..b3654eaa7f 100644 --- a/lisp/textmodes/css-mode.el +++ b/lisp/textmodes/css-mode.el @@ -1822,6 +1822,7 @@ css-ts-mode can also be used to fill comments. \\{css-mode-map}" + :syntax-table css-mode-syntax-table (when (treesit-ready-p 'css) ;; Borrowed from `css-mode'. (add-hook 'completion-at-point-functions -- 2.34.1 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 08:01:50 2022 Received: (at 59816) by debbugs.gnu.org; 5 Dec 2022 13:01:50 +0000 Received: from localhost ([127.0.0.1]:35894 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2B6U-0000eX-AT for submit@debbugs.gnu.org; Mon, 05 Dec 2022 08:01:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2B6S-0000eR-EE for 59816@debbugs.gnu.org; Mon, 05 Dec 2022 08:01:48 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2B6L-0001vb-5Q; Mon, 05 Dec 2022 08:01:42 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=D43QJzkV0aaybXI4bi07Q6vQPJh7n2HboKIHykyTpv4=; b=bI58jc8RJQoVyw02O9zj /phND7FS4IuUZ+WzOtZ6u6HHpTGNcmqY97kmg+iuJVtTIRmszML6VlohLDl/gxxmUVjCqmR0BWM5u divyR3Bg4uA8ak4g+T/R7nxaluDbGyURo/ps2U2rT8rqULIzsIo6vk5m4oQyS7MN/C4OcFOHOk/zt e1yep25T61OlwttJ+PAojXA+XXfNoktAxreKCJMa9n8m29zv+syFG/QE8NYIMVU8LA2cYZFvXYQv+ HU8RrVwq9RfrLbRU/zbeoHv+IUVHCfBgSZ4H1O0dh0AiYhpxQw5rs4Vvz6DimsOZ+lkHKlWq+N3fz AIGbKYk6xVxJpQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2B6C-0000jV-8L; Mon, 05 Dec 2022 08:01:38 -0500 Date: Mon, 05 Dec 2022 15:01:16 +0200 Message-Id: <83sfhu80o3.fsf@gnu.org> From: Eli Zaretskii To: Theodor Thornhill In-Reply-To: <878rjmdnpa.fsf@thornhill.no> (message from Theodor Thornhill on Mon, 05 Dec 2022 13:44:49 +0100) Subject: Re: [PATCH]: bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly References: <08257d6b-2426-bbdf-0ed4-edd161801ad6@gmail.com> <878rjmdnpa.fsf@thornhill.no> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59816 Cc: 59816@debbugs.gnu.org, geza.herman@gmail.com 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: -3.3 (---) > From: Theodor Thornhill > Cc: geza.herman@gmail.com, eliz@gnu.org > Date: Mon, 05 Dec 2022 13:44:49 +0100 > > You're right. This is my bad. This patch addresses it. What do you > think, Eli? I'll defer to people who know more than I do about these modes. > BTW - I see that many modes in general don't refer to their > syntax-tables in their define-derived-mode form. Is that intentional? The ELisp manual says: -- Macro: define-derived-mode variant parent name docstring keyword-args... body... This macro defines VARIANT as a major mode command, using NAME as the string form of the mode name. VARIANT and PARENT should be unquoted symbols. The new command VARIANT is defined to call the function PARENT, then override certain aspects of that parent mode: [...] • The new mode has its own syntax table, kept in the variable ‘VARIANT-syntax-table’, unless you override this using the ‘:syntax-table’ keyword (see below). ‘define-derived-mode’ makes the parent mode’s syntax-table the parent of ‘VARIANT-syntax-table’, unless the latter is already set and already has a parent different from the standard syntax table. So there's no need to mention it because it happens automatically. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 08:21:16 2022 Received: (at 59816) by debbugs.gnu.org; 5 Dec 2022 13:21:16 +0000 Received: from localhost ([127.0.0.1]:35989 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2BPH-0000ov-Oo for submit@debbugs.gnu.org; Mon, 05 Dec 2022 08:21:16 -0500 Received: from out2.migadu.com ([188.165.223.204]:28576) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2BPE-0000op-L5 for 59816@debbugs.gnu.org; Mon, 05 Dec 2022 08:21:14 -0500 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1670246471; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZSdsAa54msHihXoEQzN4ok4RfN8GRJvBmcfkjjaaVRg=; b=P5SRVlju3DoC2njQPPeYRFuhQGF+P4I1zwfpfeJ3tRUQsTNUBA8RbKmrbDoH8JPJdzVS12 u2Om4CiSdaNHOCULaCASLbm1ytuGVHa+DoBhqZZ7hcpgB/qDycr6/e34jLXJ7NJIk0YDIe jk/Ai/ElCheZhugZRXLSJ4x4qFFMKFJ+Sq5U9DRnAISNwBHhBmPcfyJ1iaWBVeIU5Q65Kn yc+ays4WAeZ9zqd8s8r95wUFtn187PduXz70PcnOEws4XqeWCNJ+hr0l3XAzXDdE0DRO6u axywfI9IoUJFhNqON2MXtIwahOZY8dSC6+fCJtwAhPotw6dMxm3ilPRfYh1l1w== From: Theodor Thornhill To: Eli Zaretskii Subject: Re: [PATCH]: bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly In-Reply-To: <83sfhu80o3.fsf@gnu.org> References: <08257d6b-2426-bbdf-0ed4-edd161801ad6@gmail.com> <878rjmdnpa.fsf@thornhill.no> <83sfhu80o3.fsf@gnu.org> Date: Mon, 05 Dec 2022 14:21:10 +0100 Message-ID: <87y1rmvveh.fsf@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59816 Cc: casuri@gmail.com, 59816@debbugs.gnu.org, geza.herman@gmail.com 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 (-) Eli Zaretskii writes: >> From: Theodor Thornhill >> Cc: geza.herman@gmail.com, eliz@gnu.org >> Date: Mon, 05 Dec 2022 13:44:49 +0100 >>=20 >> You're right. This is my bad. This patch addresses it. What do you >> think, Eli? > > I'll defer to people who know more than I do about these modes. > Sure, added Yuan to CC. >> BTW - I see that many modes in general don't refer to their >> syntax-tables in their define-derived-mode form. Is that intentional? > > The ELisp manual says: > > -- Macro: define-derived-mode variant parent name docstring > keyword-args... body... > This macro defines VARIANT as a major mode command, using NAME as > the string form of the mode name. VARIANT and PARENT should be > unquoted symbols. > > The new command VARIANT is defined to call the function PARENT, > then override certain aspects of that parent mode: > > [...] > > =E2=80=A2 The new mode has its own syntax table, kept in the vari= able > =E2=80=98VARIANT-syntax-table=E2=80=99, unless you override thi= s using the > =E2=80=98:syntax-table=E2=80=99 keyword (see below). =E2=80=98= define-derived-mode=E2=80=99 > makes the parent mode=E2=80=99s syntax-table the parent of > =E2=80=98VARIANT-syntax-table=E2=80=99, unless the latter is al= ready set and > already has a parent different from the standard syntax table. > > So there's no need to mention it because it happens automatically. Right, thanks! Can you test this patch, Herman, and see if it works for you now? Theo From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 11:44:23 2022 Received: (at 59816) by debbugs.gnu.org; 5 Dec 2022 16:44:23 +0000 Received: from localhost ([127.0.0.1]:37120 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2EZr-0005CG-20 for submit@debbugs.gnu.org; Mon, 05 Dec 2022 11:44:23 -0500 Received: from mx3.muc.de ([193.149.48.5]:28519) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2EZq-0005C9-08 for 59816@debbugs.gnu.org; Mon, 05 Dec 2022 11:44:22 -0500 Received: (qmail 40710 invoked by uid 3782); 5 Dec 2022 17:44:15 +0100 Received: from acm.muc.de (p4fe15a8e.dip0.t-ipconnect.de [79.225.90.142]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 05 Dec 2022 17:44:14 +0100 Received: (qmail 7189 invoked by uid 1000); 5 Dec 2022 16:44:14 -0000 Date: Mon, 5 Dec 2022 16:44:14 +0000 To: Theodor Thornhill Subject: Re: 29.0.60; c++-ts-mode handles one-line comments badly Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: 59816 Cc: 59816@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, Theodor, Perhaps a little different from the original bug report, but while you're at it, you may want to handle continued C++ line comments (I haven't checked whether you've done this already, so apologies if so). Here, in a comment, if the last character on the comment line is a \, this continues the comment onto the next line. This backslash cannot itself be escaped, so a comment line ending in \\ continues on to the next line, too. All the best with it! -- Alan Mackenzie (Nuremberg, Germany). From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 12:08:45 2022 Received: (at 59816) by debbugs.gnu.org; 5 Dec 2022 17:08:45 +0000 Received: from localhost ([127.0.0.1]:37261 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2ExQ-0007lF-RK for submit@debbugs.gnu.org; Mon, 05 Dec 2022 12:08:45 -0500 Received: from out2.migadu.com ([188.165.223.204]:27888) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2ExO-0007l8-NM for 59816@debbugs.gnu.org; Mon, 05 Dec 2022 12:08:44 -0500 Date: Mon, 05 Dec 2022 18:07:49 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1670260120; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RuWKddpcjtExQpv2kjDFzc4vzpY5i0nJ18fJ/5PcoN8=; b=coKGJJDgmpZ53NJTKe98FMoY0wDQ6nRewgxrtS1FIdDEB3PpxN4aGBGnVD9QrBx8Anbh0w u8VymsXJBVLiyWI6QX8Z7aTI2QXkhs1ReRBilaxa6YhZ8cbO4iiZKmxqsozOY9dgHFpmbR HtwfFIxkmzvuLkufQuE2MRHzWa9mqfV/UGbujgerxLIW7K8E1Kurhiq3Jv0kRs9b/cfnOp 7zTJgT44JAaU6Y1iIozXPaO+VtiacVrPtsIwhnjdpVRq3ua/voFJ5H+t0sqdW9OOD+34sn X62C7D2fYBn+cvKgR6i6+i7gtvR7FqWkjlzqMVOGlULSLoy2mcWpBrJnOH8yHA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill To: Alan Mackenzie Subject: Re: 29.0.60; c++-ts-mode handles one-line comments badly In-Reply-To: References: Message-ID: <734CA190-781F-4C62-BED0-2355F2F7B624@thornhill.no> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59816 Cc: 59816@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 (-) On 5 December 2022 17:44:14 CET, Alan Mackenzie wrote: >Hello, Theodor, > >Perhaps a little different from the original bug report, but while you're >at it, you may want to handle continued C++ line comments (I haven't >checked whether you've done this already, so apologies if so)=2E > >Here, in a comment, if the last character on the comment line is a \, >this continues the comment onto the next line=2E This backslash cannot >itself be escaped, so a comment line ending in \\ continues on to the >next line, too=2E > Do you mean fontlock-wise or syntax-wise? Maybe both? >All the best with it! > Thanks, and thanks for the tip! Theo :) From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 18:17:03 2022 Received: (at 59816) by debbugs.gnu.org; 5 Dec 2022 23:17:03 +0000 Received: from localhost ([127.0.0.1]:38988 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Khr-0002p4-05 for submit@debbugs.gnu.org; Mon, 05 Dec 2022 18:17:03 -0500 Received: from mail-ej1-f54.google.com ([209.85.218.54]:43815) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Khp-0002oe-H6 for 59816@debbugs.gnu.org; Mon, 05 Dec 2022 18:17:02 -0500 Received: by mail-ej1-f54.google.com with SMTP id gu23so2094332ejb.10 for <59816@debbugs.gnu.org>; Mon, 05 Dec 2022 15:17:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=5n+hkhw3OCNj9VGfFHbIxASwrOBG6g1qxL3uCNJHPA0=; b=NOa9l3shprcQ2vUuDMLiigxPJGJM/NZ+bD/WGNKKE3N0G3adFbhSJZBMQJpfeih5A4 JExOIwFS7IdF4s3LyN1tjDBmj4D3Z7Fy0oyVJ7/uIORImYCDSsioL0u/iXs+rs8vEwM+ M+LFDSdxoy2u39vKcw5/Pn3yEd4M6n6uLjhNXl7H7g/3LWtkZa6oB3Q1trlX4T2DDfwB IDGMT/sxKoSMOCR8kj2xLBh1pg/rZCUoXpL7tOlzZ+tvaAlH/wFjV0VcAW7rM4BW1IwH 6ID8ei0csAGjyF5uNSjmHKoszeU2kd353aDSQfOY5Pt2BN5mdw4gzXakz0nunJEW+QWn IAjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5n+hkhw3OCNj9VGfFHbIxASwrOBG6g1qxL3uCNJHPA0=; b=TQlch9vfX05OyEDP+aHXEdHOP7iiMCWkS/phj+zXwa4JbmNANYCDkVDmxYaXKHwwHH oSsGRoxRr7Y2fKt/9OQ+0nwwAqsDijh65RlZzJQQU/bZ4X0pZs3sjDtVvLyXOWO3MgSs oZnzczoOuwoEHz94lLxnXnbIvtFVFEAPhFAx9MnV1qoyrJBeJ5z02FRC294arj4vfL8d qLbtPA0Axj/ja4m9liiHJQQ1As+cu/kpPagSc3h5otn6GZljrRF5MusmtUY4yC0/mhc8 C/EXH31XlVnqo54ViqwlCJxpz3PwZPog3NRak8Wiqx6E9uxHsdil0b0yRBbo5fVrWJKy cLjg== X-Gm-Message-State: ANoB5pkfsuEIMBd6TeQfpZo2DDtZL1KTyz42U8PGBvkyf45wCNFNXoL7 P+5AOLDn7aIP5AKo8SW57L4= X-Google-Smtp-Source: AA0mqf5XtDY1fijxMAnE9UaZcNRBrmPEtBtBVKwOVtwTBEYfwgsp9V1TZk7v5AvjN5OVDHLdpJGbzQ== X-Received: by 2002:a17:906:3952:b0:7b9:2a28:f6ff with SMTP id g18-20020a170906395200b007b92a28f6ffmr53352391eje.61.1670282215510; Mon, 05 Dec 2022 15:16:55 -0800 (PST) Received: from [192.168.8.4] (netacc-gpn-204-103-46.pool.yettel.hu. [5.204.103.46]) by smtp.gmail.com with ESMTPSA id o17-20020a170906769100b00782fbb7f5f7sm6681415ejm.113.2022.12.05.15.16.54 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Dec 2022 15:16:54 -0800 (PST) Message-ID: <0546f952-a765-2c59-1655-b15da41d6d25@gmail.com> Date: Tue, 6 Dec 2022 00:16:53 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH]: bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly Content-Language: sv-FI To: Theodor Thornhill , Eli Zaretskii References: <08257d6b-2426-bbdf-0ed4-edd161801ad6@gmail.com> <878rjmdnpa.fsf@thornhill.no> <83sfhu80o3.fsf@gnu.org> <87y1rmvveh.fsf@thornhill.no> From: =?UTF-8?Q?Herman=2c_G=c3=a9za?= In-Reply-To: <87y1rmvveh.fsf@thornhill.no> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59816 Cc: casuri@gmail.com, 59816@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 Theo, yes, it works correctly with your patch, thanks! On 12/5/22 14:21, Theodor Thornhill wrote: > Eli Zaretskii writes: > >>> From: Theodor Thornhill >>> Cc: geza.herman@gmail.com, eliz@gnu.org >>> Date: Mon, 05 Dec 2022 13:44:49 +0100 >>> >>> You're right. This is my bad. This patch addresses it. What do you >>> think, Eli? >> I'll defer to people who know more than I do about these modes. >> > Sure, added Yuan to CC. > >>> BTW - I see that many modes in general don't refer to their >>> syntax-tables in their define-derived-mode form. Is that intentional? >> The ELisp manual says: >> >> -- Macro: define-derived-mode variant parent name docstring >> keyword-args... body... >> This macro defines VARIANT as a major mode command, using NAME as >> the string form of the mode name. VARIANT and PARENT should be >> unquoted symbols. >> >> The new command VARIANT is defined to call the function PARENT, >> then override certain aspects of that parent mode: >> >> [...] >> >> • The new mode has its own syntax table, kept in the variable >> ‘VARIANT-syntax-table’, unless you override this using the >> ‘:syntax-table’ keyword (see below). ‘define-derived-mode’ >> makes the parent mode’s syntax-table the parent of >> ‘VARIANT-syntax-table’, unless the latter is already set and >> already has a parent different from the standard syntax table. >> >> So there's no need to mention it because it happens automatically. > Right, thanks! > > Can you test this patch, Herman, and see if it works for you now? > > Theo From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 06 02:02:04 2022 Received: (at 59816) by debbugs.gnu.org; 6 Dec 2022 07:02:04 +0000 Received: from localhost ([127.0.0.1]:41089 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Rxs-0003jR-9S for submit@debbugs.gnu.org; Tue, 06 Dec 2022 02:02:04 -0500 Received: from out-87.mta0.migadu.com ([91.218.175.87]:43632) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Rxp-0003j4-5K for 59816@debbugs.gnu.org; Tue, 06 Dec 2022 02:02:02 -0500 Date: Tue, 06 Dec 2022 08:00:56 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=thornhill.no; s=key1; t=1670310119; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=yA39g4tYG7+e8bYJweih6GwR4INRNBxqN7N4/7rf58c=; b=Ud81+g5p+b9g9bpoylvZgDcSTBP0A7N7uh5P4qcO2KMK9Kize+X5gg07QUc+NloPtz6BvS u0hjS1VgoJbh2VsKqndO9BJFoXhSk2WbjC03MYT2q9manBjV+3qkX9QlUP8eLJWzF4gpGc ijEt8DyGUleC4X7+JN0ujZeH4kE5kKn6woPtMFAd7kHkNkLRC1LijsZ03xKZekByNr5cHL jFW1+uKzFn4DIBDKUxa5C9mJ9OzZFbl5PPuHDtx8MrwicSYHl2zX8lHWhp07HFNeRfRzb8 RdwHgsyQhlKrR/s/shh0YrYCdzZb3s3zBmlbm17k6pnkeujJjDxIz9Tq5qsNQA== X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Theodor Thornhill To: =?ISO-8859-1?Q?Herman=2C_G=E9za?= , Eli Zaretskii Subject: =?US-ASCII?Q?Re=3A_=5BPATCH=5D=3A_bug=2359816=3A_29=2E0=2E60=3B_c++-t?= =?US-ASCII?Q?s-mode_handles_one-line_comments_badly?= In-Reply-To: <0546f952-a765-2c59-1655-b15da41d6d25@gmail.com> References: <08257d6b-2426-bbdf-0ed4-edd161801ad6@gmail.com> <878rjmdnpa.fsf@thornhill.no> <83sfhu80o3.fsf@gnu.org> <87y1rmvveh.fsf@thornhill.no> <0546f952-a765-2c59-1655-b15da41d6d25@gmail.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 59816 Cc: casuri@gmail.com, 59816@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 (-) On 6 December 2022 00:16:53 CET, "Herman, G=C3=A9za" wrote: >Hi Theo, yes, it works correctly with your patch, thanks! > >On 12/5/22 14:21, Theodor Thornhill wrote: >> Eli Zaretskii writes: >>=20 >>>> From: Theodor Thornhill >>>> Cc: geza=2Eherman@gmail=2Ecom, eliz@gnu=2Eorg >>>> Date: Mon, 05 Dec 2022 13:44:49 +0100 >>>>=20 >>>> You're right=2E This is my bad=2E This patch addresses it=2E What = do you >>>> think, Eli? >>> I'll defer to people who know more than I do about these modes=2E >>>=20 >> Sure, added Yuan to CC=2E >>=20 >>>> BTW - I see that many modes in general don't refer to their >>>> syntax-tables in their define-derived-mode form=2E Is that intention= al? >>> The ELisp manual says: >>>=20 >>> -- Macro: define-derived-mode variant parent name docstring >>> keyword-args=2E=2E=2E body=2E=2E=2E >>> This macro defines VARIANT as a major mode command, using NAME a= s >>> the string form of the mode name=2E VARIANT and PARENT should b= e >>> unquoted symbols=2E >>>=20 >>> The new command VARIANT is defined to call the function PARENT, >>> then override certain aspects of that parent mode: >>>=20 >>> [=2E=2E=2E] >>>=20 >>> =E2=80=A2 The new mode has its own syntax table, kept in the = variable >>> =E2=80=98VARIANT-syntax-table=E2=80=99, unless you override= this using the >>> =E2=80=98:syntax-table=E2=80=99 keyword (see below)=2E =E2= =80=98define-derived-mode=E2=80=99 >>> makes the parent mode=E2=80=99s syntax-table the parent of >>> =E2=80=98VARIANT-syntax-table=E2=80=99, unless the latter i= s already set and >>> already has a parent different from the standard syntax tab= le=2E >>>=20 >>> So there's no need to mention it because it happens automatically=2E >> Right, thanks! >>=20 >> Can you test this patch, Herman, and see if it works for you now? >>=20 >> Theo > Nice, thanks for testing! Yuan, will you apply this patch? Theo From debbugs-submit-bounces@debbugs.gnu.org Wed Dec 07 14:37:11 2022 Received: (at 59816-done) by debbugs.gnu.org; 7 Dec 2022 19:37:11 +0000 Received: from localhost ([127.0.0.1]:51853 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p30EA-0000KU-Lk for submit@debbugs.gnu.org; Wed, 07 Dec 2022 14:37:11 -0500 Received: from mail-pf1-f176.google.com ([209.85.210.176]:33536) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p30E6-0000K7-FA for 59816-done@debbugs.gnu.org; Wed, 07 Dec 2022 14:37:09 -0500 Received: by mail-pf1-f176.google.com with SMTP id 124so18420438pfy.0 for <59816-done@debbugs.gnu.org>; Wed, 07 Dec 2022 11:37:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=H+R2FZ5N5VEX1cGWVwknCDcAIo4SSvxsSupG9nB8JDU=; b=Ri/KHT1mqu5RnlqH4aHDAU74+42J5ZpbFD0hNaFEwvgjmi+YsfnjOlkd70VXe5Vmvm b6R//tyPwPMjGDOzqt4KS1J6uC1ch/eLdebvG2KAfYLQHW/KeGO0YXx2u3E7aXybsZvb eZBBtuQPbBmZV+YGjTLCbIfLZNUFxvAGI85uHEwlMs0/v/uxHyUU4IikeuMyydm8Cohl S2P5whLO1BJ8b4tW/VfwTQB6zLYaubEe4yjbZg7W2B1pFekZT9C5ewyuoPPS4NbB6OaH G0EyShql+wfM/cy6FHzUhSFF/7a0aSQzIMoGSfBJPfke+EyFBE7eq/QEk9hNijkDRuCo 0SnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H+R2FZ5N5VEX1cGWVwknCDcAIo4SSvxsSupG9nB8JDU=; b=18MawxPpbMANd4VjEGqPMMnxbR8bL+/LkYHuc7aEA+jo6ggE+HQDWBIklXZAmInQcB xPfQW25tFxDjpMv1VgUD6P62Uq/lUadG1VTx6VBc6UK5Zvm+UeNNOn6JeaTdpZEcsqev EX8GgHx61QWasrSaaknIqm+QFxzGVUdqafgdvWtzQy9MkJvJcZH+3CCpvTzi0UQ7l0ZL 5IAryZl9rkkCG71kPd8Jqdo709kxTCOGUmAuI4oNgKCAVLAhfiF/DdrU9AeZZiDA91ge 7INfcbNNJuSVbhycqomVB8aAqhjAP0/NfCyrVmVPOmQNPR7CZzeEE9QgrI4BJ5b0A7CN 4e7g== X-Gm-Message-State: ANoB5pm2TTxRRPTtGXdXFJvlO38+n0dLwpBFIey2ReI9NrDLj7+DtYOX MJBqn23GHYh21KbLxsiE170= X-Google-Smtp-Source: AA0mqf7pewlwf9wbEJ61UsrQpcUTqV4u13NxCDMGQ1qCJcsqQyglQKR+YKxZOqTLGJfZ5Wtmwf4qQA== X-Received: by 2002:a05:6a00:4096:b0:577:9673:473f with SMTP id bw22-20020a056a00409600b005779673473fmr2479967pfb.63.1670441820665; Wed, 07 Dec 2022 11:37:00 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id n13-20020a170903404d00b00189548573a2sm14970627pla.161.2022.12.07.11.36.59 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Dec 2022 11:36:59 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#59816: 29.0.60; c++-ts-mode handles one-line comments badly Message-Id: Date: Wed, 7 Dec 2022 11:36:58 -0800 To: Theodor Thornhill X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 59816-done Cc: 59816-done@debbugs.gnu.org, Eli Zaretskii , casuri@gmail.com, geza.herman@gmail.com 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 (-) Theodor Thornhill writes: > On 6 December 2022 00:16:53 CET, "Herman, G=C3=A9za" = wrote: >>Hi Theo, yes, it works correctly with your patch, thanks! >> >>On 12/5/22 14:21, Theodor Thornhill wrote: >>> Eli Zaretskii writes: >>>=20 >>>>> From: Theodor Thornhill >>>>> Cc: geza.herman@gmail.com, eliz@gnu.org >>>>> Date: Mon, 05 Dec 2022 13:44:49 +0100 >>>>>=20 >>>>> You're right. This is my bad. This patch addresses it. What do = you >>>>> think, Eli? >>>> I'll defer to people who know more than I do about these modes. >>>>=20 >>> Sure, added Yuan to CC. >>>=20 >>>>> BTW - I see that many modes in general don't refer to their >>>>> syntax-tables in their define-derived-mode form. Is that = intentional? >>>> The ELisp manual says: >>>>=20 >>>> -- Macro: define-derived-mode variant parent name docstring >>>> keyword-args... body... >>>> This macro defines VARIANT as a major mode command, using = NAME as >>>> the string form of the mode name. VARIANT and PARENT should = be >>>> unquoted symbols. >>>>=20 >>>> The new command VARIANT is defined to call the function = PARENT, >>>> then override certain aspects of that parent mode: >>>>=20 >>>> [...] >>>>=20 >>>> =E2=80=A2 The new mode has its own syntax table, kept in = the variable >>>> =E2=80=98VARIANT-syntax-table=E2=80=99, unless you = override this using the >>>> =E2=80=98:syntax-table=E2=80=99 keyword (see below). = =E2=80=98define-derived-mode=E2=80=99 >>>> makes the parent mode=E2=80=99s syntax-table the parent = of >>>> =E2=80=98VARIANT-syntax-table=E2=80=99, unless the = latter is already set and >>>> already has a parent different from the standard syntax = table. >>>>=20 >>>> So there's no need to mention it because it happens automatically. >>> Right, thanks! >>>=20 >>> Can you test this patch, Herman, and see if it works for you now? >>>=20 >>> Theo >> > > Nice, thanks for testing! > Yuan, will you apply this patch? > Theo Applied the patch, Thanks! Yuan From unknown Fri Jun 20 18:10:02 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 05 Jan 2023 12:24:04 +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