From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 04:40:12 2024 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) From debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 04:46:48 2024 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 To: Meow King In-Reply-To: <87ed7otatf.fsf@anche.no> (bug-gnu-emacs@gnu.org) 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> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 72223 Cc: 72223@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 (---) > 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 debbugs-submit-bounces@debbugs.gnu.org Sun Jul 21 05:35:53 2024 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. From unknown Thu Jun 19 14:04:48 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 18 Aug 2024 11:24:05 +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