From unknown Fri Jun 20 05:29:11 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#62825 <62825@debbugs.gnu.org> To: bug#62825 <62825@debbugs.gnu.org> Subject: Status: 29.0.90; c-ts-mode doesn't recognize DEFUN functions Reply-To: bug#62825 <62825@debbugs.gnu.org> Date: Fri, 20 Jun 2025 12:29:11 +0000 retitle 62825 29.0.90; c-ts-mode doesn't recognize DEFUN functions reassign 62825 emacs submitter 62825 Eli Zaretskii severity 62825 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 02:44:33 2023 Received: (at submit) by debbugs.gnu.org; 14 Apr 2023 06:44:33 +0000 Received: from localhost ([127.0.0.1]:45296 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnDAb-0002e5-Mw for submit@debbugs.gnu.org; Fri, 14 Apr 2023 02:44:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:41294) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnDAZ-0002dx-25 for submit@debbugs.gnu.org; Fri, 14 Apr 2023 02:44:27 -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 1pnDAY-0006nR-JW for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 02:44:26 -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 1pnDAY-0002ZS-AH for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 02:44:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=P2/1BX0kviywYOuN/cFc5HU6LNJ2cV2CHuwz+GFXubA=; b=Xf0Kb5Gmem+Xz4 o7hNrKZrPINYlK0qpcCEc6m80By+QaGfRTU53TBjbUorrKdNNg4GwEUxldhzg4ugkTCrSCNCEeCqO VISzMAQXaViUofu1OeeeU9eW1V5d/vZ4s6Rk4BNxYKbJWk1PS/Y2UOtX4aceJCN3hm3yRiZZQ0/DW ifXd95JyXM05lC0aXQsTJXQqzENCr2+FTDXOoI2CyY4phlum58/Y6mgTXuSFH0ACBMHcb6+wSVAQP YxfqOyhlVzF+VprT7Mo9ZbPbtUS4Qts7UJJhqVn1upBjVqFf3dLPnFeaf7NoHgWK/+pKWLz0YsABy ARiQ+qVHmzXCbgCiJ82A==; 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 1pnDAX-0007Te-Fw for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 02:44:25 -0400 Date: Fri, 14 Apr 2023 09:44:22 +0300 Message-Id: <831qkngdyx.fsf@gnu.org> From: Eli Zaretskii To: bug-gnu-emacs@gnu.org Subject: 29.0.90; c-ts-mode doesn't recognize DEFUN functions X-Spam-Score: -2.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: -3.3 (---) Evaluating '(treesit-defun-at-point)' inside a function defined via the DEFUN macro yields nil, when the buffer is under c-ts-mode. This gets in the way of significant functionalities, like c-ts-mode-indent-defun and generating ChangeLog-style log entries using "C-x 4 a" and the likes. To reproduce, visit any of the Emacs C source files, like treesit.c, with c-ts-mode, move point to a function defined via DEFUN, and type "C-x 4 a". The resulting ChangeLog entry will have the file name, but not the expected function name in parentheses. Please fix this ASAP, this is a bad regression for those, like myself, who want to use c-ts-mode. In GNU Emacs 29.0.90 (build 2, i686-pc-mingw32) of 2023-04-10 built on HOME-C4E4A596F7 Windowing system distributor 'Microsoft Corp.', version 5.1.2600 System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600) Configured using: 'configure --prefix=/d/usr --with-wide-int --with-native-compilation 'CFLAGS=-O2 -gdwarf-4 -g3'' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NATIVE_COMP NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XPM ZLIB Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t 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 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 cl-loaddefs comp comp-cstr warnings icons subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win 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 w32notify w32 lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 83196 14093) (symbols 48 8277 0) (strings 16 22852 2978) (string-bytes 1 598231) (vectors 16 16223) (vector-slots 8 320282 14191) (floats 8 30 46) (intervals 40 293 0) (buffers 888 12)) From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 02:59:54 2023 Received: (at 62825) by debbugs.gnu.org; 14 Apr 2023 06:59:55 +0000 Received: from localhost ([127.0.0.1]:45328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnDPW-0003FA-JV for submit@debbugs.gnu.org; Fri, 14 Apr 2023 02:59:54 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40486) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnDPU-0003Ew-FK for 62825@debbugs.gnu.org; Fri, 14 Apr 2023 02:59:53 -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 1pnDPN-0005gK-9J; Fri, 14 Apr 2023 02:59:45 -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=sZQ5qa5FHOBkKrYG+YC+3X0dTTFjw7iMTFyvPytaOhw=; b=cvEIrCc5nijI t/l9Nr3f/SPmhc3yY8+wbnDDRgGIXiuc8ZrPB+tAhzp+Az0LdyriqK9WPRab3GuhYGWKFhxDDX2+l OPOEO0O/+FpckdQg5SUP4lhjxfogvkr58m1es8QXmUJ2o55hf81LRk4GyD58wj95eJbmJ3E8SsUfP xSWbtU1aHCDMgOcen+CvMWY6VhBh4z3d+PRqAPRnzfS6S5bMBI/ZaBeov1OFbNkmYGfevbIipAeE6 XODhf7q8rNJ+Rksszjyfd/Rj6/wFNrPvx1sxVObsYUyl1ukSDvowVONcRxNYbgCbMu79mwRlQj4Ny 309I5gjAY9BXut87V0Acbw==; 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 1pnDPM-0003dX-DI; Fri, 14 Apr 2023 02:59:44 -0400 Date: Fri, 14 Apr 2023 09:59:42 +0300 Message-Id: <83v8hzeyox.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu , Theodor Thornhill In-Reply-To: <831qkngdyx.fsf@gnu.org> (message from Eli Zaretskii on Fri, 14 Apr 2023 09:44:22 +0300) Subject: Re: bug#62825: 29.0.90; c-ts-mode doesn't recognize DEFUN functions References: <831qkngdyx.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62825 Cc: 62825@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: Fri, 14 Apr 2023 09:44:22 +0300 > From: Eli Zaretskii > > Evaluating '(treesit-defun-at-point)' inside a function defined via > the DEFUN macro yields nil, when the buffer is under c-ts-mode. This > gets in the way of significant functionalities, like > c-ts-mode-indent-defun and generating ChangeLog-style log entries > using "C-x 4 a" and the likes. > > To reproduce, visit any of the Emacs C source files, like treesit.c, > with c-ts-mode, move point to a function defined via DEFUN, and type > "C-x 4 a". The resulting ChangeLog entry will have the file name, but > not the expected function name in parentheses. > > Please fix this ASAP, this is a bad regression for those, like myself, > who want to use c-ts-mode. Using treesit-explore-mode I see that c-ts-mode regards DEFUN functions as a sequence of 2 expression_statement nodes. Here's the tree corresponding to the DEFUN macro call: (expression_statement (call_expression function: (call_expression function: (identifier) <<<<<<<<<<<<<<<<<<< arguments: (argument_list ( (string_literal " ") , (identifier) , (identifier) , (number_literal) , (number_literal) , (number_literal) , (identifier) (ERROR :) (comment) ))) arguments: (argument_list ( (identifier) (ERROR (identifier)) , (identifier) (ERROR (identifier)) ))) ;) The identifier node on the line indicated with "<<<<<" is "DEFUN", so maybe we can recognize this. The body of the DEFUN is another compound_statement node, following the DEFUN's node. From debbugs-submit-bounces@debbugs.gnu.org Fri Apr 14 16:20:01 2023 Received: (at 62825) by debbugs.gnu.org; 14 Apr 2023 20:20:01 +0000 Received: from localhost ([127.0.0.1]:47795 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnPtp-0001Fj-6W for submit@debbugs.gnu.org; Fri, 14 Apr 2023 16:20:01 -0400 Received: from mail-pj1-f49.google.com ([209.85.216.49]:52879) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnPtn-0001FU-EO for 62825@debbugs.gnu.org; Fri, 14 Apr 2023 16:19:59 -0400 Received: by mail-pj1-f49.google.com with SMTP id hg12so5014472pjb.2 for <62825@debbugs.gnu.org>; Fri, 14 Apr 2023 13:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681503593; x=1684095593; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=KbGWXMksJOhUN/i4M8mA0gjy8Ub+UoA9zUWRY/3J3w0=; b=KOkvNduR0sZkIOBYlNIk/LJoTDpxkE014Y/a2FZM7Kw6s+6cklPyM4jJ3g3HvmRBhH 13Tgr4Q9E8cF1476M5D1/dC/PxsK3iG+dgua9DIBjuGXgXMDn8XhUv02A2U0ZTSUzZdf 4e/GpEsQHuW+MB2F2Uv2trrWqlg0yycDOCu5MBruBbCazdQKczW6Netoewny2arMdgX4 aIaauNF9WfUcCLfFmfg0YjnQjiDtNHhoDXs6J28k2hrGqZDoM5RBhM8GBTmK9+zS0ixo oAca4yeOYgwYO7hRkU0b2q3QI2y4oOOKEV0RzKSBlU7NnoDpEvmIvrC0pBe4gAL5Gmbi CYvQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681503593; x=1684095593; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=KbGWXMksJOhUN/i4M8mA0gjy8Ub+UoA9zUWRY/3J3w0=; b=Gx2lL+Cx81Rj9nEvEMndxfwxw9bHNMig6oT/DtyaN05krzeOjNnCK7ip7SZybmxyUp 94opio4IW2Oa8W6+/aj1B/QMJ0JOcMJ7QLfAzG5klRdlbEMiP0luvJLrZrA6IxRPaZtt h+AMPkKKS+pYnwSUu2QS3ic9a27nOL9F3RGKSLELHI2UC5HG4jBWe1ugaan6yVP7sKre OrZiw0JuZRgTn7zWGFkkVSk6O1vX7aEgC9NvbNqMFGcLAOhjbY79pA0re9Szc3pIFZeH fhDk/CBXLnKO67KYdH4KsroDri2lH3BGdu4nbR54JXQLzn/PrTcNmlFEcaxqAdORbzS2 lXUQ== X-Gm-Message-State: AAQBX9f07tcEwd+7cdoEs/ti4oM8VKysBO3wr/TBFoTX5MrF+TAfswwC PqF4JcIdUT2xk26B5Q0oFnE= X-Google-Smtp-Source: AKy350a/M0uCkfrLmz4jispHpt26ox2+WRc/u+dCrgT3q4kQc/Qf0lALu5hBgya2XLZCVBzE/1H5YA== X-Received: by 2002:a17:902:ea03:b0:1a6:8442:545d with SMTP id s3-20020a170902ea0300b001a68442545dmr4360392plg.0.1681503593178; Fri, 14 Apr 2023 13:19:53 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id je13-20020a170903264d00b001a50dcd10c8sm3413099plb.277.2023.04.14.13.19.52 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 14 Apr 2023 13:19:52 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: bug#62825: 29.0.90; c-ts-mode doesn't recognize DEFUN functions From: Yuan Fu In-Reply-To: <83v8hzeyox.fsf@gnu.org> Date: Fri, 14 Apr 2023 13:19:41 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <831qkngdyx.fsf@gnu.org> <83v8hzeyox.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3731.500.231) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62825 Cc: 62825@debbugs.gnu.org, Theodor Thornhill 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 Apr 13, 2023, at 11:59 PM, Eli Zaretskii wrote: >=20 >> Date: Fri, 14 Apr 2023 09:44:22 +0300 >> From: Eli Zaretskii >>=20 >> Evaluating '(treesit-defun-at-point)' inside a function defined via >> the DEFUN macro yields nil, when the buffer is under c-ts-mode. This >> gets in the way of significant functionalities, like >> c-ts-mode-indent-defun and generating ChangeLog-style log entries >> using "C-x 4 a" and the likes. >>=20 >> To reproduce, visit any of the Emacs C source files, like treesit.c, >> with c-ts-mode, move point to a function defined via DEFUN, and type >> "C-x 4 a". The resulting ChangeLog entry will have the file name, = but >> not the expected function name in parentheses. >>=20 >> Please fix this ASAP, this is a bad regression for those, like = myself, >> who want to use c-ts-mode. >=20 > Using treesit-explore-mode I see that c-ts-mode regards DEFUN > functions as a sequence of 2 expression_statement nodes. Here's the > tree corresponding to the DEFUN macro call: >=20 > (expression_statement > (call_expression > function:=20 > (call_expression function: (identifier) <<<<<<<<<<<<<<<<<<< > arguments:=20 > (argument_list ( > (string_literal " ") > , (identifier) , (identifier) , (number_literal) , (number_literal) , > (number_literal) > , (identifier) > (ERROR :) > (comment) ))) > arguments:=20 > (argument_list ( (identifier) > (ERROR (identifier)) > , (identifier) > (ERROR (identifier)) > ))) > ;) >=20 > The identifier node on the line indicated with "<<<<<" is "DEFUN", so > maybe we can recognize this. The body of the DEFUN is another > compound_statement node, following the DEFUN's node. Ok, I fixed indent-defund and add-log. Because a DEFUN is made of two = nodes in the parse tree rather than one, it=E2=80=99s a bit hard to = incorporate it into the normal treesit-defun-at-point, etc, functions. = And we probably have to fix DEFUN case-by-case. Yuan From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 15 03:49:06 2023 Received: (at 62825) by debbugs.gnu.org; 15 Apr 2023 07:49:06 +0000 Received: from localhost ([127.0.0.1]:48165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnaef-0001Lw-La for submit@debbugs.gnu.org; Sat, 15 Apr 2023 03:49:05 -0400 Received: from eggs.gnu.org ([209.51.188.92]:58958) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnaed-0001LS-Fx for 62825@debbugs.gnu.org; Sat, 15 Apr 2023 03:49:04 -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 1pnaeX-0003KI-Bo; Sat, 15 Apr 2023 03:48:57 -0400 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=bYo7ZuM5kcO3dKZzMRGoaXsbJXYe1ToOcOs3TLrTQ1Y=; b=H41lhiqBiiDBI2a/mLpW w7gZdaA1GIBw/1ib/qkeQo8dDnNl6qyWI46A115RK6LMk0hH0nMsMFqsPULPWsAUiCwL930cTBkew JscBAbkxo2G5x3RwBsHjGyHlRGHQ+SHZAQWnI0LBcByxGBLwY16be9O4+tzrIF5epsQEOm+tPE0YR vPlT8iP4QFQy/sB/zMonZS9nv+Pg0PL0Tp1wAXCedNDmTzNh1VZif2BgxI0XPgrC8/+y4FwL/oBGN 5d4p0rsJPSz0FT7JgcQBWC55uWoysaOMPTvV3dTSiQ2GxT23p4jb+9BxTtutxaowEwrPIK+VB/ykI F+d/cYCJ6F4Iyw==; 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 1pnaeW-0007z8-Hk; Sat, 15 Apr 2023 03:48:57 -0400 Date: Sat, 15 Apr 2023 10:48:54 +0300 Message-Id: <83fs91egbd.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: (message from Yuan Fu on Fri, 14 Apr 2023 13:19:41 -0700) Subject: Re: bug#62825: 29.0.90; c-ts-mode doesn't recognize DEFUN functions References: <831qkngdyx.fsf@gnu.org> <83v8hzeyox.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62825 Cc: 62825@debbugs.gnu.org, theo@thornhill.no 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: Yuan Fu > Date: Fri, 14 Apr 2023 13:19:41 -0700 > Cc: Theodor Thornhill , > 62825@debbugs.gnu.org > > Ok, I fixed indent-defund and add-log. Because a DEFUN is made of two nodes in the parse tree rather than one, it’s a bit hard to incorporate it into the normal treesit-defun-at-point, etc, functions. And we probably have to fix DEFUN case-by-case. Thanks. But I wonder why do we need the c-ts-mode-emacs-devel knob. Why not recognize DEFUN by default everywhere? CC Mode does that, AFAIK, so why shouldn't c-ts-mode do the same? From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 16 01:37:23 2023 Received: (at 62825) by debbugs.gnu.org; 16 Apr 2023 05:37:23 +0000 Received: from localhost ([127.0.0.1]:50470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnv4k-0003Vl-JS for submit@debbugs.gnu.org; Sun, 16 Apr 2023 01:37:22 -0400 Received: from mail-pj1-f54.google.com ([209.85.216.54]:42568) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnv4i-0003VX-9Q for 62825@debbugs.gnu.org; Sun, 16 Apr 2023 01:37:20 -0400 Received: by mail-pj1-f54.google.com with SMTP id fw22-20020a17090b129600b00247255b2f40so8889708pjb.1 for <62825@debbugs.gnu.org>; Sat, 15 Apr 2023 22:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681623434; x=1684215434; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=HcNM5N6RUiQAkWK0cY8MfL0xUSwBw7TAecS5AL6ypWs=; b=Roq7rfJMISo7pH1m584hh8I7b+OM2u1Gtsu51D+6fM+W3viiKmWXIObnPHnkZ2wvKy MJ1dCE5dPFYu3hepbSBaGOCgj4phlvNfV44MEwirxncaZPy6hDNFOtpWaKmqTSXcFgSS b7TZI59HQHGnK/dFSB9HmJxoRYFrqnUVGaqtfcLDWaX3ZTzVp9432ZyV6hcAKePyx7K4 WJ+HQfbVspB8YhrYqY/TB5gLFqB6CaYQqoDVxEuZ/XMu6ftu8FaCjyz0ltIlZhKGIO/y mkByj4oDg0JrP2sq0QBCBEVWwa3HSGMTlKTMyOqa6TWbP31u40kTRIM551gnCVQh7bN4 CxNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681623434; x=1684215434; 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=HcNM5N6RUiQAkWK0cY8MfL0xUSwBw7TAecS5AL6ypWs=; b=lpBwlgap9T3Y0y15fZQauugWCxG3cF/PmW1LC4aEDitwOev+rP5Rm24RSb6EReLtID cXonWB6+fYqeCaX2o7gpLId+Pn21ZGk+MnKgPDLUtOqKbECeFSCewddNqcG9n+8iHTwN zIVz88ipzTULWw2e7ebVzvQILL+f8T7dgGZ4soOV5oodiVof+PW+5r6I1T+sos0H+pn5 VoTU75lOeFdabHnGScCzCpH908Hq1YF1wAjEyS0xbOG+e1iCJ35XLs2C4MjJGHuws3P0 TgWEdd3r4RnL20JeEZiBoXUcNBwny/u4WQd41Tln9FZJ8QkqRwYBfGH+15KErjOlPiPR ukOQ== X-Gm-Message-State: AAQBX9cQJfykv6YCoKK198n3f4xOQ94ISfsTSLRrQsp+dAY4FCfNTllv 7qPw6ka5FLO4t5kjIKDtNrU= X-Google-Smtp-Source: AKy350b86JHz69JueKNO4oVYjEQF8ZSA2ZuHmyfp283HWbn2JhjjXui5WjtetSTjhwLz/x4bF6oK1Q== X-Received: by 2002:a17:902:e747:b0:1a6:6090:7114 with SMTP id p7-20020a170902e74700b001a660907114mr9858829plf.69.1681623434542; Sat, 15 Apr 2023 22:37:14 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id 6-20020a170902c20600b001a6d08dc847sm244505pll.173.2023.04.15.22.37.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 15 Apr 2023 22:37:14 -0700 (PDT) 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 \(3731.500.231\)) Subject: Re: bug#62825: 29.0.90; c-ts-mode doesn't recognize DEFUN functions Message-Id: <80353D80-21FD-4ADE-8982-4B67C59B7E7B@gmail.com> Date: Sat, 15 Apr 2023 22:37:02 -0700 To: Eli Zaretskii X-Mailer: Apple Mail (2.3731.500.231) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62825 Cc: theo@thornhill.no, 62825@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 (-) Eli Zaretskii writes: >> From: Yuan Fu >> Date: Fri, 14 Apr 2023 13:19:41 -0700 >> Cc: Theodor Thornhill , >> 62825@debbugs.gnu.org >>=20 >> Ok, I fixed indent-defund and add-log. Because a DEFUN is made of >> two nodes in the parse tree rather than one, it=E2=80=99s a bit hard = to >> incorporate it into the normal treesit-defun-at-point, etc, >> functions. And we probably have to fix DEFUN case-by-case. > > Thanks. But I wonder why do we need the c-ts-mode-emacs-devel knob. > Why not recognize DEFUN by default everywhere? CC Mode does that, > AFAIK, so why shouldn't c-ts-mode do the same? I just thought the fix is a bit hacky, and does add some overhead, so people who don=E2=80=99t need it might not be happy to know that they = can=E2=80=99t turn it off. Yuan From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 16 04:14:33 2023 Received: (at 62825) by debbugs.gnu.org; 16 Apr 2023 08:14:33 +0000 Received: from localhost ([127.0.0.1]:50572 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnxWr-0002EX-GV for submit@debbugs.gnu.org; Sun, 16 Apr 2023 04:14:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:55350) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnxWp-0002EJ-Mo for 62825@debbugs.gnu.org; Sun, 16 Apr 2023 04:14:32 -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 1pnxWi-0001rD-Sc; Sun, 16 Apr 2023 04:14:24 -0400 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=FdvCjDUzCOaGFtTWKbM0OQEe4rMW9vOv/Dy/uSeyl8s=; b=FovoAl4n6z4zvo/lROmD EvrbAfAunpBuMDH1INExvIABglqylWZdAUfrbiScGFOp8/zurvN7K5sqqdYR1SGYyVP6C4rz9cOBQ s+dvzcgewCtLCzDRz/YpkfxLsVzAp+xRjxS+0f7Yl1j3PP79xQYGus5ifE0ZybdLW5ThnkofPgmkw G7E7C5NQmnfx426ii73eM92SepcPPYAX+vyUXdmcnRBrq/fcrYf/ZTANKcYQxHZUUDmjcoSRqNmxm 2+oOwLT6zMn3p6gc3Qo0U4MhrL9TS7BEaOn1kaf0va8emlw+4VN5TVe6VJyhB3g1K8gCODNnXbOo2 BCYIzZWz+j8j2Q==; 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 1pnxWg-0001PI-PY; Sun, 16 Apr 2023 04:14:24 -0400 Date: Sun, 16 Apr 2023 11:14:25 +0300 Message-Id: <83jzycb5we.fsf@gnu.org> From: Eli Zaretskii To: Yuan Fu In-Reply-To: <80353D80-21FD-4ADE-8982-4B67C59B7E7B@gmail.com> (message from Yuan Fu on Sat, 15 Apr 2023 22:37:02 -0700) Subject: Re: bug#62825: 29.0.90; c-ts-mode doesn't recognize DEFUN functions References: <80353D80-21FD-4ADE-8982-4B67C59B7E7B@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62825 Cc: theo@thornhill.no, 62825@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: Yuan Fu > Date: Sat, 15 Apr 2023 22:37:02 -0700 > Cc: 62825@debbugs.gnu.org, > theo@thornhill.no > > > Eli Zaretskii writes: > > > Thanks. But I wonder why do we need the c-ts-mode-emacs-devel knob. > > Why not recognize DEFUN by default everywhere? CC Mode does that, > > AFAIK, so why shouldn't c-ts-mode do the same? > > I just thought the fix is a bit hacky, and does add some overhead, so > people who don’t need it might not be happy to know that they can’t turn > it off. OK, but I made it into a defcustom and turned this on by default. I also renamed a few symbols, please take a look. Btw, should the code you added to c-ts-mode--defun-name recognize DEFUN nodes only when this variable is non-nil? From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 19 15:11:37 2023 Received: (at 62825) by debbugs.gnu.org; 19 Apr 2023 19:11:37 +0000 Received: from localhost ([127.0.0.1]:35870 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppDDM-0005hf-S0 for submit@debbugs.gnu.org; Wed, 19 Apr 2023 15:11:37 -0400 Received: from mail-pj1-f45.google.com ([209.85.216.45]:50451) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ppDDL-0005hS-Pt for 62825@debbugs.gnu.org; Wed, 19 Apr 2023 15:11:36 -0400 Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-24756a12ba0so65930a91.1 for <62825@debbugs.gnu.org>; Wed, 19 Apr 2023 12:11:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681931490; x=1684523490; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=pqeZ44Kgs3u41b2tebHPwUpKKwQaaTYEphSi7u3FaR4=; b=sh5VvjMItUl5ucjfGdtjXvyrVFYmlNGRsXacJ6l0cJRsV96EkVTaj1UiKg+x8kVGvS zijn7jJrWr0doDrf4WkHMAa+fJU/811P9ZS7nFbqx35h7jtxVos3h/a9T2ucHt5JbIkT vj0C3lROgi9u63KE+jwNcaE6ZFsaV9WyvAIh0QrsulvTX2GiIgGOPhEMmnGGvrxRAdLc RFycbKtpmk+76n+47//yFvOl5dlLswqvTJCxc52BQo0Jaa+mJx7ppv9wtRlwp61WxD9Z CG8y0sIG/0mvj/ZaAGIlo4z0CSl1YdHR4zV7BZPlUOk5pQJJsprFZe4Q2z6ttgrqWj8i idQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681931490; x=1684523490; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=pqeZ44Kgs3u41b2tebHPwUpKKwQaaTYEphSi7u3FaR4=; b=mCnRBlyGdmHOpRHa7nVRGWRUtJOUBNqk33PBcvDBnJ/6WyOzejb9FvZ5O3NKxcWdn4 CqnQu8zPMLMog6CHtDfPHgNlOO9KQz6O190ZfhKqIZe+kmlgAcHrYOybwUfjIKf5YG+A +t8TGvh0EDEn7mfbhd6GnsZ88Mni1tYyxgw1/UmfZZJWCSWsKUpitUr624KnuGT4LSQn /ejNXf99VaHCPuwEWWDtHvEYHJIH79aoTf0CqlBGkjZcdGcTPQyZRKbsBO5GWYE+Kl0q b2Stw0+kx2P3jc/kJrbGlr41GnIIFWXPryOkZ/Jwk4nkYR/F27E9uXlV0HAHEsVTBpRC labA== X-Gm-Message-State: AAQBX9fyrQxz+izpQqLP4h3kZrediF4cmuZmX8SYgIyPZzIHwuuNSsRt VcXKqShcpCiO/4xX56qaGk8nEamO6lT5bA== X-Google-Smtp-Source: AKy350a8G8CrRZgB2lt7TBZYaUuiZed/nzcG7bpzk84oW619ASYGIMcPqhJgZM26aYE7eypaXGPJPA== X-Received: by 2002:a17:90a:d42:b0:246:f8a8:af02 with SMTP id 2-20020a17090a0d4200b00246f8a8af02mr3727377pju.5.1681931489988; Wed, 19 Apr 2023 12:11:29 -0700 (PDT) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id d23-20020a17090ad3d700b0023440af7aafsm1749731pjw.9.2023.04.19.12.11.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 19 Apr 2023 12:11:29 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: bug#62825: 29.0.90; c-ts-mode doesn't recognize DEFUN functions From: Yuan Fu In-Reply-To: <83jzycb5we.fsf@gnu.org> Date: Wed, 19 Apr 2023 12:11:18 -0700 Content-Transfer-Encoding: quoted-printable Message-Id: References: <80353D80-21FD-4ADE-8982-4B67C59B7E7B@gmail.com> <83jzycb5we.fsf@gnu.org> To: Eli Zaretskii X-Mailer: Apple Mail (2.3731.500.231) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 62825 Cc: theo@thornhill.no, 62825@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 Apr 16, 2023, at 1:14 AM, Eli Zaretskii wrote: >=20 >> From: Yuan Fu >> Date: Sat, 15 Apr 2023 22:37:02 -0700 >> Cc: 62825@debbugs.gnu.org, >> theo@thornhill.no >>=20 >>=20 >> Eli Zaretskii writes: >>=20 >>> Thanks. But I wonder why do we need the c-ts-mode-emacs-devel knob. >>> Why not recognize DEFUN by default everywhere? CC Mode does that, >>> AFAIK, so why shouldn't c-ts-mode do the same? >>=20 >> I just thought the fix is a bit hacky, and does add some overhead, so >> people who don=E2=80=99t need it might not be happy to know that they = can=E2=80=99t turn >> it off. >=20 > OK, but I made it into a defcustom and turned this on by default. I > also renamed a few symbols, please take a look. Thanks. >=20 > Btw, should the code you added to c-ts-mode--defun-name recognize > DEFUN nodes only when this variable is non-nil? I don=E2=80=99t think it=E2=80=99s necessary, we only need to inhibit = creating DEFUN nodes when the feature is turned-off, ie, we only need to = control the entry points.=20 Yuan=