From unknown Sat Sep 20 16:17:22 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#74448 <74448@debbugs.gnu.org> To: bug#74448 <74448@debbugs.gnu.org> Subject: Status: 30.0.92; c-ts-mode outlines only work with GNU or emacs style Reply-To: bug#74448 <74448@debbugs.gnu.org> Date: Sat, 20 Sep 2025 23:17:22 +0000 retitle 74448 30.0.92; c-ts-mode outlines only work with GNU or emacs style reassign 74448 emacs submitter 74448 Filippo Argiolas severity 74448 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 20 17:22:34 2024 Received: (at submit) by debbugs.gnu.org; 20 Nov 2024 22:22:34 +0000 Received: from localhost ([127.0.0.1]:48105 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDt5m-0003a3-9m for submit@debbugs.gnu.org; Wed, 20 Nov 2024 17:22:34 -0500 Received: from lists.gnu.org ([209.51.188.17]:52790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tDt5h-0003Zs-Es for submit@debbugs.gnu.org; Wed, 20 Nov 2024 17:22:33 -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 1tDt5f-0003pP-Bj for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2024 17:22:27 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tDt5d-0005pH-Rq for bug-gnu-emacs@gnu.org; Wed, 20 Nov 2024 17:22:27 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-382423e1f7aso115922f8f.2 for ; Wed, 20 Nov 2024 14:22:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732141342; x=1732746142; darn=gnu.org; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=PJTeZ1GuJnnpWrIBB9mkoo4epOfE/LHLa8UyaZ3y3i8=; b=PHDF1mRhh9KpfdcltOTDasUhEBDWleEPRR7sZ7vKezwzpb3NFP2TUPv+ZDmd3EU/Qr h8SDlfDGaACEMl1q+FlA3i+C9qXokUpI00cdbiaTWIJA/aOdN+rHOzUybkdONtyKz5ZX AtWDXQjNdv2c9IJMBCnqkiMKlUbJQOU+hEZv4FPDB1ioMNdZcERXvPOv+/fnFAcqpMLp lR+BAHA94wsdaAgI6hSNsLz9t+JjFuHMN6JdD8DTa4T5jifgInX4q2oE4+SiPGieR3qh qu5aBAH/dFFdEMANNc1RSHQZwux2fVvtn2DlU1zSXUdaU+8HYT+MdT8een+voVT2v+Zy OeWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732141342; x=1732746142; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=PJTeZ1GuJnnpWrIBB9mkoo4epOfE/LHLa8UyaZ3y3i8=; b=ZSBzbx7G2R2CMQ6zMv+PkB6k1fABDsIP0oMHbahrpu5ylVTPsqSnwfBf+/axBta5G4 8na0P5wbZWshQMshzdQQMYcPe7jtKzA1zfv+VDL0UAPbEIyRkjEuGodnHNIcKlgQqkjv CjgnX/nWy4wD3dyMr9m059HdFlno4VzHQM1N96FksWvvCZlJ1eC0rPTjHotzqK1CSHyE Kz4HA6F8aYufdEQWMGkDg4oAZJvmx7ksESkvAX0agbn4QrvbaPA66EZ0xHJ+Mhi/2QSQ /h3XQ8r5OtLPvpBrMO07KkmFvFWDosquT3NR9re1pjRYB+MyckzNqMmLbE2dFFQBNlo2 tzZQ== X-Gm-Message-State: AOJu0Yx7dRmRhbrODl0LgpehXlM1u69MNWwcEGmo9kl0Zi2ypMQvKfNW HCa/MLSEhecfG8nHGsSkheLq7XRgn1GpiMe/e3eLDvIn1ZIoTJB7l03fMv/k X-Google-Smtp-Source: AGHT+IHW1xXESf58Kv1DOjEEDPu6PsKybMmZt0u8GSu/JAl8d1CuCofjM5522g4Cxxtz8+sicuP+CA== X-Received: by 2002:a5d:64c6:0:b0:382:442c:2c54 with SMTP id ffacd0b85a97d-38254afc65fmr3262928f8f.28.1732141342437; Wed, 20 Nov 2024 14:22:22 -0800 (PST) Received: from mba ([151.81.191.240]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3825490c682sm3170095f8f.31.2024.11.20.14.22.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 14:22:20 -0800 (PST) From: Filippo Argiolas To: bug-gnu-emacs@gnu.org Subject: 30.0.92; c-ts-mode outlines only work with GNU or emacs style X-Debbugs-Cc: Date: Wed, 20 Nov 2024 23:22:19 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=filippo.argiolas@gmail.com; helo=mail-wr1-x434.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 (--) Hi, I've been playing with the new treesitter based outline minor mode and c-ts-mode. It seems that `outline-hide-subtree' is only working properly when code is formatted with either GNU or emacs style. To test try it with a function where the function declarator is preceded on the same line by either type or storage class and type. It will fold the function heading instead of the function body. Problem seems `c-ts-mode--outline-predicate' only checks for function_declarator nodes at the beginning of line (like in GNU coding style) but other coding style will start the function line with either storage class (e.g. static) or type. Something like this seems to work a little better: (defun c-ts-mode--outline-predicate (node) "Match outlines on lines with function names." (or (and (or (equal (treesit-node-type node) "function_declarator") (equal (treesit-node-type node) "storage_class_specifier") (equal (treesit-node-type node) "primitive_type") (equal (treesit-node-type node) "type_identifier")) (equal (treesit-node-type (treesit-node-parent node)) "function_definition")) ;; DEFUNs in Emacs sources. (and c-ts-mode-emacs-sources-support (c-ts-mode--emacs-defun-p node)))) But it kind of breaks GNU style by adding two outlines per function definition. Also it seems a bit ugly to enumerate all the node types by hand, there probably is a nicer way to detect a line with a function_declarator not at bol. Any better idea? Thanks, Filippo From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 21 02:45:30 2024 Received: (at 74448) by debbugs.gnu.org; 21 Nov 2024 07:45:30 +0000 Received: from localhost ([127.0.0.1]:48933 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE1sY-0003iA-8c for submit@debbugs.gnu.org; Thu, 21 Nov 2024 02:45:30 -0500 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:57527) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE1sW-0003hp-D3 for 74448@debbugs.gnu.org; Thu, 21 Nov 2024 02:45:28 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id F419F60007; Thu, 21 Nov 2024 07:44:57 +0000 (UTC) From: Juri Linkov To: Filippo Argiolas Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: (Filippo Argiolas's message of "Wed, 20 Nov 2024 23:22:19 +0100") Organization: LINKOV.NET References: Date: Thu, 21 Nov 2024 09:42:27 +0200 Message-ID: <875xoh9gnw.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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.7 (-) > Hi, I've been playing with the new treesitter based outline minor mode > and c-ts-mode. > > It seems that `outline-hide-subtree' is only working properly when code > is formatted with either GNU or emacs style. > > To test try it with a function where the function declarator is preceded on the > same line by either type or storage class and type. It will fold the > function heading instead of the function body. > > Problem seems `c-ts-mode--outline-predicate' only checks for > function_declarator nodes at the beginning of line (like in GNU coding > style) but other coding style will start the function line with either > storage class (e.g. static) or type. > > Something like this seems to work a little better: > > (defun c-ts-mode--outline-predicate (node) > "Match outlines on lines with function names." > (or (and (or (equal (treesit-node-type node) "function_declarator") > (equal (treesit-node-type node) "storage_class_specifier") > (equal (treesit-node-type node) "primitive_type") > (equal (treesit-node-type node) "type_identifier")) > (equal (treesit-node-type (treesit-node-parent node)) > "function_definition")) > ;; DEFUNs in Emacs sources. > (and c-ts-mode-emacs-sources-support > (c-ts-mode--emacs-defun-p node)))) > > But it kind of breaks GNU style by adding two outlines per function > definition. Also it seems a bit ugly to enumerate all the node types by > hand, there probably is a nicer way to detect a line with a > function_declarator not at bol. > > Any better idea? Could you please send a few of short examples of each style. This would help to make a better decision. And later these examples could be added to tests. From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 21 04:48:47 2024 Received: (at 74448) by debbugs.gnu.org; 21 Nov 2024 09:48:47 +0000 Received: from localhost ([127.0.0.1]:49125 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE3nq-0000tF-La for submit@debbugs.gnu.org; Thu, 21 Nov 2024 04:48:47 -0500 Received: from mail-wm1-f50.google.com ([209.85.128.50]:49523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tE3no-0000t0-BV for 74448@debbugs.gnu.org; Thu, 21 Nov 2024 04:48:45 -0500 Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4316a44d1bbso5417365e9.3 for <74448@debbugs.gnu.org>; Thu, 21 Nov 2024 01:48:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732182458; x=1732787258; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=U4/3mTGG1RMdT7OGIu0jYEwWImxPTtW39Blw7X85QzU=; b=mQWlMPMOhHbPK5sohv61aY7Mb5acJy+mICQBvYkr2sVarE1CFL9GuwPF4giBi7D0lp oIF955dYjCbE/yxklsPV3eJ/lh6JrHcwKLTExsIx2h6btudiUvE2bWc5H1irBDFLQDh7 lP/IWMqy3myQIhY3zsXZ3QtEQ/8NkPqXvkpzytp6JUFs/tAuaFvw5+zKZgpTyldezut8 yb7HMMWma05x9VammMUKmEOxN839PGO0tyrjfh8suPt00dMIwM8+GCU7QXfwV32tpGV1 47sbe7wy+H/qZPUq5fzRR/ALLkcKTQQrQux4F8ObRL6gTL2ufeLNOEtYCmrDoP1WlEB+ 3Ijw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732182458; x=1732787258; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=U4/3mTGG1RMdT7OGIu0jYEwWImxPTtW39Blw7X85QzU=; b=YTwXGLvQLrAVU8RL4egiScHy4SqEuzfdWOi5hKhTZg+uugEh2zY3Mgv5p011kBmFqr NDdp49QQD4F1/ce33I8DKNUhKrXfLrPPomsAnw8FjOYap2WqtEWet7tLnY0DQ+6bWiyg OzmuWy9D0QpEsCV4v7LWC7mm68R5jxHxA9zun0BEMKdXPaHmrTzSwKpq7ta1LnnV10rs 5eDpPsg7EoVZpSRPPgtjPWXdMJZYmYvL1nVQzEa8zukOLkq5dmySNAzOhFOv0kWk5Lhw tfHMBDU/a+O5+E7xeASJmEPncefcq5Ipq2pC5PnwLjTi8x9m4UMnuGbQMxhKmHpZBUQs gxBw== X-Gm-Message-State: AOJu0Yz9e6+uBn6yp3/BFTXA6wbJUSgbu+LqR8uV/hFId9TmzL/OZTmk l1j32GDuhbiiOkRjeSEEYHE53IrpGc1yMk0WT+afOaEwwN3+mawSTasgRLYg X-Google-Smtp-Source: AGHT+IHpucrLKgw/Xz43ZxjSXsswLwVeCVBT5SybLSha69+AK1aUEjdWWmt7HhnXk0aBp1ifPo8bpw== X-Received: by 2002:a05:600c:1f89:b0:431:60ac:9b0c with SMTP id 5b1f17b1804b1-4334f022976mr47552145e9.20.1732182457746; Thu, 21 Nov 2024 01:47:37 -0800 (PST) Received: from mba ([151.81.191.240]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b46029acsm48218485e9.18.2024.11.21.01.47.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 01:47:37 -0800 (PST) From: Filippo Argiolas To: Juri Linkov Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: <875xoh9gnw.fsf@mail.linkov.net> References: <875xoh9gnw.fsf@mail.linkov.net> Date: Thu, 21 Nov 2024 10:47:35 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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 (-) Juri Linkov writes: >> Hi, I've been playing with the new treesitter based outline minor mode >> and c-ts-mode. >> >> It seems that `outline-hide-subtree' is only working properly when code >> is formatted with either GNU or emacs style. >> >> To test try it with a function where the function declarator is preceded on the >> same line by either type or storage class and type. It will fold the >> function heading instead of the function body. >> >> Problem seems `c-ts-mode--outline-predicate' only checks for >> function_declarator nodes at the beginning of line (like in GNU coding >> style) but other coding style will start the function line with either >> storage class (e.g. static) or type. >> >> Something like this seems to work a little better: >> >> (defun c-ts-mode--outline-predicate (node) >> "Match outlines on lines with function names." >> (or (and (or (equal (treesit-node-type node) "function_declarator") >> (equal (treesit-node-type node) "storage_class_specifier") >> (equal (treesit-node-type node) "primitive_type") >> (equal (treesit-node-type node) "type_identifier")) >> (equal (treesit-node-type (treesit-node-parent node)) >> "function_definition")) >> ;; DEFUNs in Emacs sources. >> (and c-ts-mode-emacs-sources-support >> (c-ts-mode--emacs-defun-p node)))) >> >> But it kind of breaks GNU style by adding two outlines per function >> definition. Also it seems a bit ugly to enumerate all the node types by >> hand, there probably is a nicer way to detect a line with a >> function_declarator not at bol. >> >> Any better idea? > > Could you please send a few of short examples of each style. > This would help to make a better decision. > And later these examples could be added to tests. You should be able to see it with this example int bar(void) { return 1; } static int foo (int bar) { return 2; } int main(void) { return 3; } If you go to the third function and call `outline-hide-subtree' it replaces the function name with an ellipsis. Now if you call `outline-show-all' and try to collapse the second function (GNU style) it will show foo (int bar) {... which looks correct to me. If you show all again and collapse the first one it will do nothing and say "Before the first heading". This while still showing the outline icon in the margin. At the moment I am experimenting with this solution (DEFUN part omitted for brevity) but it's probably missing some edge case I am not aware of: (defun c-ts-mode--outline-predicate (node) "Match outlines on lines with function names." (when-let* ((decl (treesit-node-child-by-field-name (treesit-node-parent node) "declarator")) (node-pos (treesit-node-start node)) (decl-pos (treesit-node-start decl)) (eol (save-excursion (goto-char node-pos) (line-end-position)))) (and (equal (treesit-node-type decl) "function_declarator") (<= node-pos decl-pos) (< decl-pos eol)))) Idea is to match a function declarator in the same line as `node' no matter what node is at bol. Ciao, Filippo From debbugs-submit-bounces@debbugs.gnu.org Thu Nov 21 13:28:39 2024 Received: (at 74448) by debbugs.gnu.org; 21 Nov 2024 18:28:39 +0000 Received: from localhost ([127.0.0.1]:51667 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEBux-0008MA-5k for submit@debbugs.gnu.org; Thu, 21 Nov 2024 13:28:39 -0500 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:42941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEBuv-0008Lv-F9 for 74448@debbugs.gnu.org; Thu, 21 Nov 2024 13:28:38 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 2870440006; Thu, 21 Nov 2024 18:28:07 +0000 (UTC) From: Juri Linkov To: Filippo Argiolas Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: (Filippo Argiolas's message of "Thu, 21 Nov 2024 10:47:35 +0100") Organization: LINKOV.NET References: <875xoh9gnw.fsf@mail.linkov.net> Date: Thu, 21 Nov 2024 20:17:05 +0200 Message-ID: <87v7wge93a.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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.7 (-) > At the moment I am experimenting with this solution (DEFUN part omitted > for brevity) but it's probably missing some edge case I am not aware of: > > (defun c-ts-mode--outline-predicate (node) > "Match outlines on lines with function names." > (when-let* ((decl (treesit-node-child-by-field-name > (treesit-node-parent node) "declarator")) > (node-pos (treesit-node-start node)) > (decl-pos (treesit-node-start decl)) > (eol (save-excursion (goto-char node-pos) (line-end-position)))) > (and (equal (treesit-node-type decl) "function_declarator") > (<= node-pos decl-pos) > (< decl-pos eol)))) > > Idea is to match a function declarator in the same line as `node' no > matter what node is at bol. Thanks, I confirm your solution is better than the current state. Hope you could find a common denominator that covers all possible cases. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 22 01:02:42 2024 Received: (at 74448) by debbugs.gnu.org; 22 Nov 2024 06:02:42 +0000 Received: from localhost ([127.0.0.1]:52749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEMkc-0006nb-2X for submit@debbugs.gnu.org; Fri, 22 Nov 2024 01:02:42 -0500 Received: from mail-wm1-f45.google.com ([209.85.128.45]:42426) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEMkZ-0006nL-9I for 74448@debbugs.gnu.org; Fri, 22 Nov 2024 01:02:40 -0500 Received: by mail-wm1-f45.google.com with SMTP id 5b1f17b1804b1-4315eac969aso9308265e9.1 for <74448@debbugs.gnu.org>; Thu, 21 Nov 2024 22:02:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732255293; x=1732860093; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=40wRLmzIrdOMVNcybRsuFQBMeYieqHwQh3c1Oe3694s=; b=SSs06OoJcPSTCi53lnnHJy2vHlfmWIHCn6bKb2ZiEYqJM8hqBlrIFJwscR3ZoAPPCj t9CdF1ug+uSMVWbsWN0LDMiUcdBQkg2NzbYIRH5gHc/et6YUW2of2psMMjuvTufp94dG j0SkLpzsNVBZGjpk78PWLbdNH2Kxe8YPp+jGN7zNx5ztzAXXVu+uQQ7gIGJv1O7BHPka r79US+9tLYfDIszJc0S19FbNxR5HShDp2zVH+ZCIOoUVC/v0G9y/DecZJ20AA7JtO6u0 U14bY3VG7tYx7c0sygGXs9b6Yid9/LS5lp3LCMl4Hy03h1MXAeI3dfqw/ESOHih0vGQ+ WcWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732255293; x=1732860093; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=40wRLmzIrdOMVNcybRsuFQBMeYieqHwQh3c1Oe3694s=; b=qWRT2MFhDSw7JCX1Z5gKHSk5cnU2Kt1pXBoAzEqHoquTWysVTHjzj3GIngUlnwQtkE uhGUqGdnIgumQ0rB8X/ItDtcMquCZTXj2R+s+Fo7EeE4eitVOgxorpAxRqdUJbDrgKOm 7LOj9GOxQNrqrzv/SlvuoqzWyhTPG4B0DTJgYWBL6RRW7wLZWYGRHEg7/546gsQfJd9Z HZPVzwEb67xU+akR1DUiL1jioU3lW0SOAalq+juJ8y8XjQBMN6FXwsLBy3gCe47b+glt sfuc+1biy6NualnICQyG4CADUb2kAgKemYWcqM4llqzLoUFOk3eW9f2B3RHhCe8aVhc2 N0fQ== X-Gm-Message-State: AOJu0Yy12AoaoBpJgRIkPg0cu4+YhmW/rdGCCmraEqUwfnUjuJmw4HGZ Ah8lYpQS0rwqZktTbRnOnnK+8y3uuXQKEXTKyKjBd5OT8AI+qNF8EXMVv+nS X-Gm-Gg: ASbGncvrf/I0iSCVgbtX1JYbvD70CCSc51mvkPW5/14JG0tumASGzbUaPjK6EOr1AIB PW0RUb8UmpUNlP+kbIRnBiy7nRBFEa6fLBIA2MwufOxL0+PukZ0wN0QQhBnYqscaV4CvmKW/eDZ xcX66Hwbv5sMqMD5yLVzsBfuBnLcY98yyxtpdNo/K12+cqtJEjJqNfVIt2Dsu4mx0yv9l7pnsy0 ygqtJs1wZPWTr4/Rehat/1PxKib5SL6A7H7ETPG2YbvSctiTIyQSXHjYZo= X-Google-Smtp-Source: AGHT+IHeZTuGqjOMw+THaNKzCl2Ndb1mLaOL8Iw9B/eQOIeAAZ68eq0+fTs5XNnUiOCZSk3cAk/aVg== X-Received: by 2002:a05:600c:a296:b0:42c:b826:a26c with SMTP id 5b1f17b1804b1-433c5ca2428mr47080895e9.8.1732255292624; Thu, 21 Nov 2024 22:01:32 -0800 (PST) Received: from mba ([151.81.191.240]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b463ab5fsm81739335e9.27.2024.11.21.22.01.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2024 22:01:31 -0800 (PST) From: Filippo Argiolas To: Juri Linkov Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: <87v7wge93a.fsf@mail.linkov.net> References: <875xoh9gnw.fsf@mail.linkov.net> <87v7wge93a.fsf@mail.linkov.net> Date: Fri, 22 Nov 2024 07:01:30 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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 (-) Juri Linkov writes: >> At the moment I am experimenting with this solution (DEFUN part omitted >> for brevity) but it's probably missing some edge case I am not aware of: >> >> (defun c-ts-mode--outline-predicate (node) >> "Match outlines on lines with function names." >> (when-let* ((decl (treesit-node-child-by-field-name >> (treesit-node-parent node) "declarator")) >> (node-pos (treesit-node-start node)) >> (decl-pos (treesit-node-start decl)) >> (eol (save-excursion (goto-char node-pos) (line-end-position)))) >> (and (equal (treesit-node-type decl) "function_declarator") >> (<= node-pos decl-pos) >> (< decl-pos eol)))) >> >> Idea is to match a function declarator in the same line as `node' no >> matter what node is at bol. > > Thanks, I confirm your solution is better than the current state. > Hope you could find a common denominator that covers all possible cases. Seems to work with the code I tested. Guess it's still not perfect, if a function declaration is splitted over multiple lines it will be folded where the function name is and I think that's what we want. A minor problem is with GNU style declarations type and storage class specifier will go in to the previous subtree when you collapse everything. But it's probably good enough. As far as I can tell the way it works now it folds from one outline to the next. The treesitter way would be to fold up to where the toplevel node ends. Maybe that's the job for a more specialized treesit folding package and this is already good for outline-minor-mode. By the way, the complete defun with Emacs source parsing restored is: (defun c-ts-mode--outline-predicate (node) "Match outlines on lines with function names." (or (when-let* ((decl (treesit-node-child-by-field-name (treesit-node-parent node) "declarator")) (node-pos (treesit-node-start node)) (decl-pos (treesit-node-start decl)) (eol (save-excursion (goto-char node-pos) (line-end-position)))) (and (equal (treesit-node-type decl) "function_declarator") (<= node-pos decl-pos) (< decl-pos eol))) ;; DEFUNs in Emacs sources. (and c-ts-mode-emacs-sources-support (c-ts-mode--emacs-defun-p node)))) Feel free to improve on this if you decide to install it, I never did the copyright assignment but I think it's trivial enough to enter without it. Thanks! Filippo From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 22 02:50:11 2024 Received: (at 74448) by debbugs.gnu.org; 22 Nov 2024 07:50:11 +0000 Received: from localhost ([127.0.0.1]:52901 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEOQc-0003RN-JX for submit@debbugs.gnu.org; Fri, 22 Nov 2024 02:50:10 -0500 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:45399) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tEOQX-0003Q4-Qb for 74448@debbugs.gnu.org; Fri, 22 Nov 2024 02:50:06 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id C63E51C0003; Fri, 22 Nov 2024 07:49:57 +0000 (UTC) From: Juri Linkov To: Filippo Argiolas Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: (Filippo Argiolas's message of "Fri, 22 Nov 2024 07:01:30 +0100") Organization: LINKOV.NET References: <875xoh9gnw.fsf@mail.linkov.net> <87v7wge93a.fsf@mail.linkov.net> Date: Fri, 22 Nov 2024 09:39:16 +0200 Message-ID: <87o727ohf9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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.7 (-) >> Thanks, I confirm your solution is better than the current state. >> Hope you could find a common denominator that covers all possible cases. > > Seems to work with the code I tested. Guess it's still not perfect, if a > function declaration is splitted over multiple lines it will be folded > where the function name is and I think that's what we want. > > A minor problem is with GNU style declarations type and storage class > specifier will go in to the previous subtree when you collapse > everything. > > But it's probably good enough. As far as I can tell the way it works now > it folds from one outline to the next. The treesitter way would be to > fold up to where the toplevel node ends. > > Maybe that's the job for a more specialized treesit folding package and > this is already good for outline-minor-mode. outline-minor-mode is designed to always fold from the current heading line until the next heading line. Maybe outline-minor-mode could be extended to detach the heading from the outline boundaries. For example, by adding separate regexps/functions to match outline boundaries while outline-regexp/outline-search-function will still be used only for the heading line. > By the way, the complete defun with Emacs source parsing restored is: > > (defun c-ts-mode--outline-predicate (node) > "Match outlines on lines with function names." > (or (when-let* ((decl (treesit-node-child-by-field-name > (treesit-node-parent node) "declarator")) > (node-pos (treesit-node-start node)) > (decl-pos (treesit-node-start decl)) > (eol (save-excursion (goto-char node-pos) (line-end-position)))) > (and (equal (treesit-node-type decl) "function_declarator") > (<= node-pos decl-pos) > (< decl-pos eol))) > ;; DEFUNs in Emacs sources. > (and c-ts-mode-emacs-sources-support > (c-ts-mode--emacs-defun-p node)))) > > > Feel free to improve on this if you decide to install it, I never did > the copyright assignment but I think it's trivial enough to enter > without it. Thanks, will test it more before installing. From debbugs-submit-bounces@debbugs.gnu.org Fri Nov 29 02:38:32 2024 Received: (at 74448) by debbugs.gnu.org; 29 Nov 2024 07:38:32 +0000 Received: from localhost ([127.0.0.1]:40769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGvaC-00084T-2N for submit@debbugs.gnu.org; Fri, 29 Nov 2024 02:38:32 -0500 Received: from relay7-d.mail.gandi.net ([217.70.183.200]:42211) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGva9-000843-U9; Fri, 29 Nov 2024 02:38:30 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 30D1D20004; Fri, 29 Nov 2024 07:38:20 +0000 (UTC) From: Juri Linkov To: Filippo Argiolas Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: (Filippo Argiolas's message of "Fri, 22 Nov 2024 07:01:30 +0100") Organization: LINKOV.NET References: <875xoh9gnw.fsf@mail.linkov.net> <87v7wge93a.fsf@mail.linkov.net> Date: Fri, 29 Nov 2024 09:35:59 +0200 Message-ID: <87mshi4hls.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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.7 (-) close 74448 31.0.50 thanks > Seems to work with the code I tested. Guess it's still not perfect, if a > function declaration is splitted over multiple lines it will be folded > where the function name is and I think that's what we want. > > A minor problem is with GNU style declarations type and storage class > specifier will go in to the previous subtree when you collapse > everything. Actually this problem exists not only for declarations, but also for preprocessor directives. For example: #ifdef HAVE_XDBE static void x_set_inhibit_double_buffering (struct frame *f, Lisp_Object new_value, Lisp_Object old_value) a dangling #ifdef will inevitably remain in the previous outline. And I see no clear way to split such code to outlines with function declaration headings. > But it's probably good enough. As far as I can tell the way it works now > it folds from one outline to the next. The treesitter way would be to > fold up to where the toplevel node ends. Probably it would be sufficient to define one additional function 'outline-prefix-function' that will find the beginning of either the current outline or the next outline. And it can be called after every call of 'outline-search-function' to adjust the found position, but only for hiding outlines. Still not sure if it can theoretically handle all cases. > Maybe that's the job for a more specialized treesit folding package and > this is already good for outline-minor-mode. Indeed, maybe simpler would be to write a new package from scratch, since the design of outline-minor-mode is too line-oriented. > By the way, the complete defun with Emacs source parsing restored is: > > (defun c-ts-mode--outline-predicate (node) > "Match outlines on lines with function names." > (or (when-let* ((decl (treesit-node-child-by-field-name > (treesit-node-parent node) "declarator")) > (node-pos (treesit-node-start node)) > (decl-pos (treesit-node-start decl)) > (eol (save-excursion (goto-char node-pos) (line-end-position)))) > (and (equal (treesit-node-type decl) "function_declarator") > (<= node-pos decl-pos) > (< decl-pos eol))) > ;; DEFUNs in Emacs sources. > (and c-ts-mode-emacs-sources-support > (c-ts-mode--emacs-defun-p node)))) > > > Feel free to improve on this if you decide to install it, I never did > the copyright assignment but I think it's trivial enough to enter > without it. Thanks, this logic makes sense. So after testing more cases I pushed it to master. From unknown Sat Sep 20 16:17:22 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Fri, 27 Dec 2024 12:24:07 +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 From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 30 02:23:40 2025 Received: (at control) by debbugs.gnu.org; 30 Jan 2025 07:23:40 +0000 Received: from localhost ([127.0.0.1]:44093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tdOto-0004kK-HZ for submit@debbugs.gnu.org; Thu, 30 Jan 2025 02:23:40 -0500 Received: from relay9-d.mail.gandi.net ([217.70.183.199]:54397) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tdOsf-0004hY-Hy for control@debbugs.gnu.org; Thu, 30 Jan 2025 02:22:30 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id A8F2C44293 for ; Thu, 30 Jan 2025 07:22:19 +0000 (UTC) From: Juri Linkov To: control@debbugs.gnu.org Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: (Filippo Argiolas's message of "Wed, 20 Nov 2024 23:22:19 +0100") Organization: LINKOV.NET References: Date: Thu, 30 Jan 2025 09:20:59 +0200 Message-ID: <87ikpwzs10.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: 0 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdehvddtucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecunecujfgurhephffvufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpedutdffjedvtdelgfdtffejkeekjeejleduudektddutedtfeffkeegjeelvdejhfenucfkphepledurdduvdelrdeliedrledtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrdeliedrledtpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepuddprhgtphhtthhopegtohhnthhrohhlseguvggssghughhsrdhgnhhurdhorhhg X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: control 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.7 (-) unarchive 74448 stop From debbugs-submit-bounces@debbugs.gnu.org Thu Jan 30 02:29:07 2025 Received: (at 74448) by debbugs.gnu.org; 30 Jan 2025 07:29:07 +0000 Received: from localhost ([127.0.0.1]:44118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tdOz5-00050o-4l for submit@debbugs.gnu.org; Thu, 30 Jan 2025 02:29:07 -0500 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:47435) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tdOz2-000506-Sk for 74448@debbugs.gnu.org; Thu, 30 Jan 2025 02:29:05 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id A696844338; Thu, 30 Jan 2025 07:28:56 +0000 (UTC) From: Juri Linkov To: Filippo Argiolas Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: (Filippo Argiolas's message of "Fri, 22 Nov 2024 07:01:30 +0100") Organization: LINKOV.NET References: <875xoh9gnw.fsf@mail.linkov.net> <87v7wge93a.fsf@mail.linkov.net> Date: Thu, 30 Jan 2025 09:28:15 +0200 Message-ID: <87sep0yd4g.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdehvdduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuifetpfffkfdpucggtfgfnhhsuhgsshgtrhhisggvnecuuegrihhlohhuthemuceftddunecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufgjohhffffkfgggtgesthdtredttdertdenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucggtffrrghtthgvrhhnpeffgeetfeevlefhleejfeeuheeiudeitdffhfdutdekfeffgffhveehteegueekheenucfkphepledurdduvdelrdeliedrledtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrdeliedrledtpdhhvghlohepmhgrihhlrdhgrghnughirdhnvghtpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhgspghrtghpthhtohepvddprhgtphhtthhopeejgeeggeekseguvggssghughhsrdhgnhhurdhorhhgpdhrtghpthhtohepfhhilhhiphhpohdrrghrghhiohhlrghssehgmhgrihhlrdgtohhm X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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.7 (-) > Feel free to improve on this if you decide to install it Hi, Filippo. Do you remember why we removed this condition from 'c-ts-mode--defun-name': (equal (treesit-node-type (treesit-node-parent node)) "function_definition") Without this condition outline headings are added to every single line of function_declarator, e.g.: int clusterAddNode(clusterNode *node); int clusterLoadConfig(char *filename) { FILE *fp = fopen(filename,"r"); } => (translation_unit (declaration type: (primitive_type) declarator: (function_declarator declarator: (identifier) ... ;) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) ... The first function_declarator should not be matched because it has no function_definition parent. From debbugs-submit-bounces@debbugs.gnu.org Sun Feb 02 02:57:37 2025 Received: (at 74448) by debbugs.gnu.org; 2 Feb 2025 07:57:37 +0000 Received: from localhost ([127.0.0.1]:32968 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1teUrJ-0001dF-1B for submit@debbugs.gnu.org; Sun, 02 Feb 2025 02:57:37 -0500 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:53730) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1teUrG-0001d1-PN for 74448@debbugs.gnu.org; Sun, 02 Feb 2025 02:57:35 -0500 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-4361f796586so38911485e9.3 for <74448@debbugs.gnu.org>; Sat, 01 Feb 2025 23:57:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738483048; x=1739087848; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=qI9+aIT1M/dzK7THcwzYLtj1lp2NbWWwjjKjRuoh2UY=; b=ZKHezcZWu2GyWmwsRdMACaFrzqdnjspRTdqe39KvxKEpUCFYhb4QaZThW+8nJnLcjq 3J/lhvUxyZlFT/aDKFRFSB97rvyENyL99IzTRuyAbWP6CrCN3yeTGr5O0W3D2XcUO5wB crqgV2AQBVLRXoBYa0mshoPfs/usvcb5ir4bqSQ3sjxSPwWZRl4OfZINSea8doTYSYHF SnPge6AcrNvhnneeTMqYZhxXHbF3akicbcp/EyW/WEW9ZIgoQl6ZAd+a3FX9hWCi+das D2Hpx0Fd5vnX7kl/Nnvl2EYTGQ/c/LGMX4wiVg2BXaLxE8VlxKbPuzKlpdDaRRVt2rR3 zMoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738483048; x=1739087848; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=qI9+aIT1M/dzK7THcwzYLtj1lp2NbWWwjjKjRuoh2UY=; b=adHDegO5j8kLjG+63ea+Asky6hRDNy6vZbKi/EZ3qECfgz+Ap5ZEF2zAQFzphEwiuy 9ihcIuVzP0HBjhQBMGD9K1n/58Pk81t0TAj5tgGGqge/177nlOpxuCYYKjgqn0Mq1xux LwrKHFWKkoRvlnw1gBpYApUF6t6n8BVuNVhR4GkXcNBwjpr3BfC/WKZuut0SqXFC9Oiv 9HotEIfOMbH3uvShxXXz5OrK+p4ti49g381ETTEnAFGCJr0jykCDOznTDXppentwugIy QyKU1ihPCAkECZC2Me2P2AmRAPlyoa8tv3O5GanRMkPgD0L1bBHBzQdSopGrT/+7+Ctm qaLg== X-Gm-Message-State: AOJu0YzaXFIcOjW5s4wcMya9ObkiD3YGsRkEoNPsz0rmvqc9/g1EdHV+ +L3tmSOO2WIRqHdIroAO02bGExaOnQYUy/3a0sNc/z3DjVWBtiDd+Zk/xf5R X-Gm-Gg: ASbGnctfC2FZt5SoNkNd2x8QafPBoutna5E5qwjePFbUHxt0avLSaFbLfzCNeuvApkl WitCtNzoO7uixNu+RYr/lRqT5J1tNifncilu6BsxTuj13pZ+JEKgIU5brIGnYpBcUZZMxKQz4/9 B487CWQF7G1If7XJuj7ey74xe4c6UWWd+Fkx8aPGG7G6xHb110W+bLDsyLXVcUv2vzIUNV6l4qo gTe1Pg/0PSd4M0Yug4EjD3dIl9FlKXQYezRSWInJl/nYXGIEOtbfjWnsLdJwby9ZEHC6gpmeq5d F8CWptIvlALqVBSPpi/c X-Google-Smtp-Source: AGHT+IHQWyRYnlOGGVJpoJTd5w9dflwmgM5H7ax27IYEW0hk8RkPZnl759gbVJsKK1Lai5h/E4/XOQ== X-Received: by 2002:a05:600c:1d26:b0:436:916b:aaf4 with SMTP id 5b1f17b1804b1-438dc3c31a3mr194002685e9.10.1738483047624; Sat, 01 Feb 2025 23:57:27 -0800 (PST) Received: from mba ([151.56.0.80]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c5c0ecc9bsm9211912f8f.2.2025.02.01.23.57.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Feb 2025 23:57:25 -0800 (PST) From: Filippo Argiolas To: Juri Linkov Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: <87sep0yd4g.fsf@mail.linkov.net> References: <875xoh9gnw.fsf@mail.linkov.net> <87v7wge93a.fsf@mail.linkov.net> <87sep0yd4g.fsf@mail.linkov.net> Date: Sun, 02 Feb 2025 08:57:23 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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 (-) Juri Linkov writes: >> Feel free to improve on this if you decide to install it > > Hi, Filippo. > > Do you remember why we removed this condition from > 'c-ts-mode--defun-name': > > (equal (treesit-node-type (treesit-node-parent node)) > "function_definition") Hi Juri, Sorry for the late reply! Don't remember the exact reason, seems a mistake looking at it now. Probably got lost while trying to find a good matcher for declarators and didn't have stand-alone prototypes in my test case to show the issue. I'd say to restore that check. Did a brief test here and it does not seem to break anything else. Filippo From debbugs-submit-bounces@debbugs.gnu.org Tue Feb 11 12:45:22 2025 Received: (at 74448) by debbugs.gnu.org; 11 Feb 2025 17:45:22 +0000 Received: from localhost ([127.0.0.1]:58423 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1thuK2-0007TP-5e for submit@debbugs.gnu.org; Tue, 11 Feb 2025 12:45:22 -0500 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:45775) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1thuJz-0007Oe-Mx for 74448@debbugs.gnu.org; Tue, 11 Feb 2025 12:45:20 -0500 Received: by mail.gandi.net (Postfix) with ESMTPSA id 311DF44369; Tue, 11 Feb 2025 17:45:10 +0000 (UTC) From: Juri Linkov To: Filippo Argiolas Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: Organization: LINKOV.NET References: <875xoh9gnw.fsf@mail.linkov.net> <87v7wge93a.fsf@mail.linkov.net> <87sep0yd4g.fsf@mail.linkov.net> Date: Tue, 11 Feb 2025 19:42:53 +0200 Message-ID: <87zfiscr8i.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdegudeigecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghofhffkfgfgggtsehttdertddtredtnecuhfhrohhmpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqnecuggftrfgrthhtvghrnhepffegteefveelhfeljeefueehieduiedtfffhuddtkeeffffghfevheetgeeukeehnecukfhppeeluddruddvledrleekrdehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepledurdduvdelrdelkedrhedphhgvlhhopehmrghilhdrghgrnhguihdrnhgvthdpmhgrihhlfhhrohhmpehjuhhriheslhhinhhkohhvrdhnvghtpdhnsggprhgtphhtthhopedvpdhrtghpthhtohepjeeggeegkeesuggvsggsuhhgshdrghhnuhdrohhrghdprhgtphhtthhopehfihhlihhpphhordgrrhhgihholhgrshesghhmrghilhdrtghomh X-GND-Sasl: juri@linkov.net X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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.7 (-) >> Do you remember why we removed this condition from >> 'c-ts-mode--defun-name': >> >> (equal (treesit-node-type (treesit-node-parent node)) >> "function_definition") > > Don't remember the exact reason, seems a mistake looking at it > now. Probably got lost while trying to find a good matcher for > declarators and didn't have stand-alone prototypes in my test case to > show the issue. > > I'd say to restore that check. Did a brief test here and it does not > seem to break anything else. Now 'treesit-outline-search' was fixed that allowed to simplify 'c-ts-mode--defun-name' and also handle the case with "pointer_declarator" between "function_definition" and "function_declarator". From debbugs-submit-bounces@debbugs.gnu.org Thu Feb 13 01:02:54 2025 Received: (at 74448) by debbugs.gnu.org; 13 Feb 2025 06:02:54 +0000 Received: from localhost ([127.0.0.1]:39660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tiSJK-0002jS-6c for submit@debbugs.gnu.org; Thu, 13 Feb 2025 01:02:54 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:42259) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1tiSJI-0002iy-Eo for 74448@debbugs.gnu.org; Thu, 13 Feb 2025 01:02:53 -0500 Received: by mail-wr1-x42e.google.com with SMTP id ffacd0b85a97d-38ddc36b81dso245887f8f.1 for <74448@debbugs.gnu.org>; Wed, 12 Feb 2025 22:02:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1739426565; x=1740031365; darn=debbugs.gnu.org; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=XWtPhz+7ccAPFkp6YaJj5uznqhU6vDe9Yf6W+0VcKzw=; b=NK9zHe6GtEoX91lhWR9xo3xhpdSvWBiQfw4CD7pmGSRhhciXhl2RiHwgH+eLOACaWc ugxLQX5InbdKQuzKQNtWDpbV+CiNXHDxQ3Cjvtnbkg/Z7ragSiGUKDBfugvd7fVhim8s PeuVowlJZGddt4ZUFSpvkwSU5npHCo28Ct6z4oh1uwAYQhfntT+7TMEJu8Z9GzTq5jeh SwqyJOlnOWxsMOadU3qgWn62Ut8VefL1IXD+aFbQEZmEhSaWvkg6V9vwDZbTyTNIwMS7 KL6oCBko5kME4bZFOARzPMpoUbNT7oVzkwlH+VAXPfTfaCeEK/IFkzq2S+q5KJXho1f2 IMZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739426565; x=1740031365; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=XWtPhz+7ccAPFkp6YaJj5uznqhU6vDe9Yf6W+0VcKzw=; b=BQlRLH683EBrBvtjFEqu5mJad3SyV3bfAua/k82k1vpFaNa5T1DEPerSEZYD83RP6X ZbcYkZ6tQblWgtZDRf/3KMDCSqQULkc3cExlPX7GFBEboN1eSbxmh1U85mtGTYX90zEl jn+2i21JoxoCW4OKwfqEcxvB4ON2IfmLu526v2MkDbRjLnQQNp62A3gkRudrmpx3u+yK zfP9EwTk3zCGarwHyrW4poVu4i7UIo0oo+bxk/C+g/2WJ8ihBBgE8NhaBJcxJWb9jcKR dvBBmiWvNjeEi5f5nGY9ANvycntiPvo6BnYRWJadDfJTeUqXluep5O6Mfi1j9QHHCyNI RTWg== X-Gm-Message-State: AOJu0YyB+kLUIbrCAUQ9uHPRKkHr2Lj1biZ9OplvAvqmA8gyYMrfe/nf CwDBSVuT0Zo2uOU+MsfUeLAoZw4zF07JQu6EoRnx8quSkwHaTRgT0x4dCVi0 X-Gm-Gg: ASbGncuSXx3yxxPnTjMr78JXS47rH1AjrpmD1I+IB7VSRq+Tv7qqw3vladJAQtA8awp zYtq5YezAlWIRUSjEhFzFMKgAdk8tmx2XQeuFsNEWlfnZNuyKpuuJuRIXs3xrYOyumfmUKq9K53 AKxIrzSEn6UIt0pwjOrvarB9cVa2pjSvLSfkQ5IV09jvsKz8KncP0nGEoLFGozmm1rccfSm2kDd mutns9qaA+0c7KVvJncKDWT8nlwBfTb6kHQjAKcPgOLu5B6w0bdthWgV0SRumjbx8ORUipWpSnr iN1hQqXVGriO6QXy47nRPW8= X-Google-Smtp-Source: AGHT+IFoDLnwUKWzCSekBfv45M/0C0L+sddwBtr7LanhR7icdEWl32SeAx8HzyHj7rTNhgg3F0pDeA== X-Received: by 2002:a05:6000:4617:b0:38a:8b34:76b0 with SMTP id ffacd0b85a97d-38f24daa4d2mr1116413f8f.27.1739426565183; Wed, 12 Feb 2025 22:02:45 -0800 (PST) Received: from mba ([151.81.191.85]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4395cf084d5sm21602105e9.1.2025.02.12.22.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Feb 2025 22:02:44 -0800 (PST) From: Filippo Argiolas To: Juri Linkov Subject: Re: bug#74448: 30.0.92; c-ts-mode outlines only work with GNU or emacs style In-Reply-To: <87zfiscr8i.fsf@mail.linkov.net> References: <875xoh9gnw.fsf@mail.linkov.net> <87v7wge93a.fsf@mail.linkov.net> <87sep0yd4g.fsf@mail.linkov.net> <87zfiscr8i.fsf@mail.linkov.net> Date: Thu, 13 Feb 2025 07:02:41 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.7 (/) X-Debbugs-Envelope-To: 74448 Cc: 74448@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: -0.3 (/) Juri Linkov writes: >>> Do you remember why we removed this condition from >>> 'c-ts-mode--defun-name': >>> >>> (equal (treesit-node-type (treesit-node-parent node)) >>> "function_definition") >> >> Don't remember the exact reason, seems a mistake looking at it >> now. Probably got lost while trying to find a good matcher for >> declarators and didn't have stand-alone prototypes in my test case to >> show the issue. >> >> I'd say to restore that check. Did a brief test here and it does not >> seem to break anything else. > > Now 'treesit-outline-search' was fixed that allowed > to simplify 'c-ts-mode--defun-name' and also handle > the case with "pointer_declarator" between "function_definition" > and "function_declarator". Looks good to me, thanks for working on this! From unknown Sat Sep 20 16:17:22 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, 13 Mar 2025 11:24:20 +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