From unknown Thu Jun 19 14:23:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72223: 31.0.50; c-ts-mode-indent-style custom function should accept a `mode`(c/c++) parameter Resent-From: Meow King Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jul 2024 08:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72223 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 72223@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17215512122741 (code B ref -1); Sun, 21 Jul 2024 08:41:02 +0000 Received: (at submit) by debbugs.gnu.org; 21 Jul 2024 08:40:12 +0000 Received: from localhost ([127.0.0.1]:54704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVS71-0000i6-Hs for submit@debbugs.gnu.org; Sun, 21 Jul 2024 04:40:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:33350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVAn4-0004k5-5m for submit@debbugs.gnu.org; Sat, 20 Jul 2024 10:10:26 -0400 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 1sVAn3-0006QQ-B6 for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2024 10:10:25 -0400 Received: from latitanza.investici.org ([2001:888:2000:56::19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVAn0-0002Jt-Qq for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2024 10:10:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anche.no; s=stigmate; t=1721484610; bh=Ba7QLV1l61dzg7NsZUwj9MYLzThKD8/R0W+SY+fI+xI=; h=From:To:Cc:Subject:Date:From; b=na3CnsOhJwAQUV7gDVZTkPG+6UH5AK0nb/GnUGyagMXSXufpevn+fIztO95PgfNhT PNmTmacgBx1o+ur0+X7NIlTieH7hwhkbgF+BH6IMWOUJySDihW+pCzcNfOigCcAuYX Nlnn2U++XXX3HKc+GQ3PwUt3CDfjn1NMK18akdLI= Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4WR7jG6QnhzGp4N for ; Sat, 20 Jul 2024 14:10:10 +0000 (UTC) Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: mr.meowking@anche.no) by localhost (Postfix) with ESMTPSA id 4WR7jG3FvZzGp4L for ; Sat, 20 Jul 2024 14:10:10 +0000 (UTC) From: Meow King Message-ID: <87ed7otatf.fsf@anche.no> Date: Sat, 20 Jul 2024 22:10:06 +0800 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:888:2000:56::19; envelope-from=mr.meowking@anche.no; helo=latitanza.investici.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Mailman-Approved-At: Sun, 21 Jul 2024 04:40:10 -0400 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.4 (--) Currently, the `c-ts-mode--get-indent-style` function: ``` (defun c-ts-mode--get-indent-style (mode) "Helper function to set indentation style. MODE is either `c' or `cpp'." (let ((style (if (functionp c-ts-mode-indent-style) (funcall c-ts-mode-indent-style) (alist-get c-ts-mode-indent-style (c-ts-mode--indent-styles mode))))) `((,mode ,@style)))) ``` We can use `c-ts-mode-indent-style` to customize our indentation. However, the function doesn't accept a `mode` parameter, without which we cannot determine the current customizing indentation style of what language (c/c++). --- In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) Repository revision: 3a790abd869ddadc343710deb0c4368227ba6611 Repository branch: master System Description: NixOS 24.11 (Vicuna) From unknown Thu Jun 19 14:23:39 2025 X-Loop: help-debbugs@gnu.org Subject: bug#72223: 31.0.50; c-ts-mode-indent-style custom function should accept a `mode`(c/c++) parameter Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 21 Jul 2024 08:47:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72223 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Meow King Cc: 72223@debbugs.gnu.org Received: via spool by 72223-submit@debbugs.gnu.org id=B72223.17215516083409 (code B ref 72223); Sun, 21 Jul 2024 08:47:01 +0000 Received: (at 72223) by debbugs.gnu.org; 21 Jul 2024 08:46:48 +0000 Received: from localhost ([127.0.0.1]:54714 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVSDQ-0000su-85 for submit@debbugs.gnu.org; Sun, 21 Jul 2024 04:46:48 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40588) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVSDO-0000sg-5n for 72223@debbugs.gnu.org; Sun, 21 Jul 2024 04:46:47 -0400 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 1sVSDH-00077M-AS; Sun, 21 Jul 2024 04:46:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=vwscR0+2k7a70cYaXAU1QZVEI2c0sMUHwFZqE/rvUMI=; b=l48t7MdD0Ll5 0tRVUpmn6JCb3Tyj0Wwt7FjGTtHmKulH4gHqZ0FRdTZBdtXPvAGexcGqwybFNjkj49WVv0RXYv7nR iPdLkuk9RUmTzibArT0w0sqneIJOgoL86BS7kMkhZ3z1dX+jV09//IBuMVaP2blcsyGuLERNSU4j3 x7nxaPDeD8x2UE2Lwn1bQCURo+7WNHsAlwfMo4ltrQAWOpcMkkZh9npOHNDVX7md3nPbW2mQV4ZjL 5qOojekhpnqwXgDR3xLN7IkM6x4m8IPicwsR9tiq7LpPvlJca69JM33Y/pjtebgBCdHuoUqTSUYqr 9DtI+CnoXcsaiA6wjQilZQ==; Date: Sun, 21 Jul 2024 11:46:36 +0300 Message-Id: <86a5ibcetv.fsf@gnu.org> From: Eli Zaretskii In-Reply-To: <87ed7otatf.fsf@anche.no> (bug-gnu-emacs@gnu.org) References: <87ed7otatf.fsf@anche.no> X-Spam-Score: -2.3 (--) 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 (---) > Date: Sat, 20 Jul 2024 22:10:06 +0800 > From: Meow King via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > > Currently, the `c-ts-mode--get-indent-style` function: > ``` > (defun c-ts-mode--get-indent-style (mode) > "Helper function to set indentation style. > MODE is either `c' or `cpp'." > (let ((style > (if (functionp c-ts-mode-indent-style) > (funcall c-ts-mode-indent-style) > (alist-get c-ts-mode-indent-style (c-ts-mode--indent-styles mode))))) > `((,mode ,@style)))) > ``` > We can use `c-ts-mode-indent-style` to customize our indentation. > However, the function doesn't accept a `mode` parameter, without which > we cannot determine the current customizing indentation style of what > language (c/c++). Isn't the mode available as the value of major-mode? From unknown Thu Jun 19 14:23:39 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Meow King Subject: bug#72223: closed (Re: bug#72223: 31.0.50; c-ts-mode-indent-style custom function should accept a `mode`(c/c++) parameter) Message-ID: References: <865xszcck5.fsf@gnu.org> <87ed7otatf.fsf@anche.no> X-Gnu-PR-Message: they-closed 72223 X-Gnu-PR-Package: emacs Reply-To: 72223@debbugs.gnu.org Date: Sun, 21 Jul 2024 09:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1721554562-19157-1" This is a multi-part message in MIME format... ------------=_1721554562-19157-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #72223: 31.0.50; c-ts-mode-indent-style custom function should accept a `mo= de`(c/c++) parameter=20 which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 72223@debbugs.gnu.org. --=20 72223: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D72223 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1721554562-19157-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 72223-done) by debbugs.gnu.org; 21 Jul 2024 09:35:53 +0000 Received: from localhost ([127.0.0.1]:54738 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVSyv-0004yf-6Q for submit@debbugs.gnu.org; Sun, 21 Jul 2024 05:35:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58036) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVSyt-0004yR-8g for 72223-done@debbugs.gnu.org; Sun, 21 Jul 2024 05:35:52 -0400 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 1sVSyl-00074Y-6q; Sun, 21 Jul 2024 05:35:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=G2lKEs64s0ZjL5+snusyPd11YpcimXyKVakodYk7DyY=; b=Vw3eP7HdiSHj wpqnGx7EBDBODXHF7jRffm2/pbBo7rfLaZo+wTP4NAhAGT6DTAfN8nSJieh48yXq5MSfsWV1Xm32Z ViQeHGkSxU+mkr4GA2tbYkybhAKh5iZDkBLngma4UYujfiOey46Aytc5Mf37M/j6lCCcoAKDQG5cb WvHQPCl6woY5l+ZuBUDu9WU7wWEeWBpoBoInWvsO3yt0K8CYpcm4E2p5Bu5oUywRazDz3JfzAeiW+ Zz4jrfG7wGmYoLOPED0TAholWmTFG4x5gS4EmALVyXhAPiqvNJkdI6+FwzR8uT1Md3dHwymo5IuDL +bx9A4k+L3SxA9xWRS0ztQ==; Date: Sun, 21 Jul 2024 12:35:38 +0300 Message-Id: <865xszcck5.fsf@gnu.org> From: Eli Zaretskii To: Meow King In-Reply-To: <87h6cjm7ic.fsf@anche.no> (message from Meow King on Sun, 21 Jul 2024 17:14:35 +0800) Subject: Re: bug#72223: 31.0.50; c-ts-mode-indent-style custom function should accept a `mode`(c/c++) parameter References: <87ed7otatf.fsf@anche.no> <86a5ibcetv.fsf@gnu.org> <87h6cjm7ic.fsf@anche.no> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72223-done Cc: 72223-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Meow King > Cc: > Date: Sun, 21 Jul 2024 17:14:35 +0800 > > Eli Zaretskii writes: > > > Isn't the mode available as the value of major-mode? > > Yes, after testing, this approach is proved to be right. > > My `major-mode` related thoughts was immediately discarded since the > function call is inside `define-derived-mode` block, and not even the > `after-hook`. After testing, it is proved that the `major-mode` variable > is already settled. Though, I think it's better to give it a mention in the doc. > > Thank you for your reply and your awesome work! Thanks, so I'm closing this bug report. P.S. Please in the future use Reply All to reply, so that the bug tracker is CC'ed. ------------=_1721554562-19157-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 21 Jul 2024 08:40:12 +0000 Received: from localhost ([127.0.0.1]:54704 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVS71-0000i6-Hs for submit@debbugs.gnu.org; Sun, 21 Jul 2024 04:40:12 -0400 Received: from lists.gnu.org ([209.51.188.17]:33350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sVAn4-0004k5-5m for submit@debbugs.gnu.org; Sat, 20 Jul 2024 10:10:26 -0400 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 1sVAn3-0006QQ-B6 for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2024 10:10:25 -0400 Received: from latitanza.investici.org ([2001:888:2000:56::19]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sVAn0-0002Jt-Qq for bug-gnu-emacs@gnu.org; Sat, 20 Jul 2024 10:10:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anche.no; s=stigmate; t=1721484610; bh=Ba7QLV1l61dzg7NsZUwj9MYLzThKD8/R0W+SY+fI+xI=; h=From:To:Cc:Subject:Date:From; b=na3CnsOhJwAQUV7gDVZTkPG+6UH5AK0nb/GnUGyagMXSXufpevn+fIztO95PgfNhT PNmTmacgBx1o+ur0+X7NIlTieH7hwhkbgF+BH6IMWOUJySDihW+pCzcNfOigCcAuYX Nlnn2U++XXX3HKc+GQ3PwUt3CDfjn1NMK18akdLI= Received: from mx3.investici.org (unknown [127.0.0.1]) by latitanza.investici.org (Postfix) with ESMTP id 4WR7jG6QnhzGp4N for ; Sat, 20 Jul 2024 14:10:10 +0000 (UTC) Received: from [82.94.249.234] (mx3.investici.org [82.94.249.234]) (Authenticated sender: mr.meowking@anche.no) by localhost (Postfix) with ESMTPSA id 4WR7jG3FvZzGp4L for ; Sat, 20 Jul 2024 14:10:10 +0000 (UTC) From: Meow King To: bug-gnu-emacs@gnu.org Subject: 31.0.50; c-ts-mode-indent-style custom function should accept a `mode`(c/c++) parameter Message-ID: <87ed7otatf.fsf@anche.no> X-Debbugs-Cc: Date: Sat, 20 Jul 2024 22:10:06 +0800 MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2001:888:2000:56::19; envelope-from=mr.meowking@anche.no; helo=latitanza.investici.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 21 Jul 2024 04:40:10 -0400 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.4 (--) Currently, the `c-ts-mode--get-indent-style` function: ``` (defun c-ts-mode--get-indent-style (mode) "Helper function to set indentation style. MODE is either `c' or `cpp'." (let ((style (if (functionp c-ts-mode-indent-style) (funcall c-ts-mode-indent-style) (alist-get c-ts-mode-indent-style (c-ts-mode--indent-styles mode))))) `((,mode ,@style)))) ``` We can use `c-ts-mode-indent-style` to customize our indentation. However, the function doesn't accept a `mode` parameter, without which we cannot determine the current customizing indentation style of what language (c/c++). --- In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.42, cairo version 1.18.0) Repository revision: 3a790abd869ddadc343710deb0c4368227ba6611 Repository branch: master System Description: NixOS 24.11 (Vicuna) ------------=_1721554562-19157-1--