From unknown Wed Jun 18 00:25:47 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#60397 <60397@debbugs.gnu.org> To: bug#60397 <60397@debbugs.gnu.org> Subject: Status: 29.0.60; c++-ts-mode could report better defun names Reply-To: bug#60397 <60397@debbugs.gnu.org> Date: Wed, 18 Jun 2025 07:25:47 +0000 retitle 60397 29.0.60; c++-ts-mode could report better defun names reassign 60397 emacs submitter 60397 Knut Anders Hatlen severity 60397 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 29 02:42:14 2022 Received: (at submit) by debbugs.gnu.org; 29 Dec 2022 07:42:14 +0000 Received: from localhost ([127.0.0.1]:59174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAnYM-0000Kz-5S for submit@debbugs.gnu.org; Thu, 29 Dec 2022 02:42:14 -0500 Received: from lists.gnu.org ([209.51.188.17]:40734) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pAnYJ-0000Kq-KW for submit@debbugs.gnu.org; Thu, 29 Dec 2022 02:42:12 -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 1pAnYJ-0000on-8y for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2022 02:42:11 -0500 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pAnYH-0005bl-An for bug-gnu-emacs@gnu.org; Thu, 29 Dec 2022 02:42:11 -0500 Received: by mail-lf1-x133.google.com with SMTP id bp15so26479732lfb.13 for ; Wed, 28 Dec 2022 23:42:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:subject:to:from:from:to:cc:subject :date:message-id:reply-to; bh=BsckB9NXclfuz2RTT/SgOY9CGo2QpsDc0TtXcVghNO4=; b=kD2jW4Qk3nZ/rfavErX0G3Brh131hM5v8OXfe0DVRlSuj06d6DuoKqGSDQp12pxzLQ P5Ctaazu1NGql0DyxRx+W+P2Dl2Th713HH8BDzZTp5cKbfXVX3sMymW/Ufo5pnGVMfzP hJXboKIQhM021diyJvULyD2kkcvd4vtCqU7VmwkIizVTOm6WQTbzZRPm2iDEIq1zr5wJ Qrxq1QHwrYFMifVCiMKcuOqsSEfMGvcb2pYXm5VdSFVeAThQK6APMtzfcbSoesHGmpsT 6IJ1A+INHzQAMRPCZLFYCQnQgsN6+/SLof8MNcoGRWz+pjq5aZ3ODyBvrM6VJPjce+86 a2wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:subject:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=BsckB9NXclfuz2RTT/SgOY9CGo2QpsDc0TtXcVghNO4=; b=G1U39hk7soWsfek1wnQYGlVI6bNehjCk7YgGgHUWsX2cUM/zPBFTpdVY0Plg7FsMQf Frkv9j8CU/eerH6LCMNqs7Cj2s11s+5CqwenpWEEzD8bUG2Pl59tmq7wunRcVuVy79Jj 8/6MmyS2CCtkLNAumDrmKB18BoTDbZZQBFHFpL0ET6U80mPL2z0UnLgMqH62KJ4C/IMU 1xwCw3mvzLanRJ4eYhvLXg1fVS044z3ycmErXfYoqXz35nEUJPnVS+wgR7ra7cAe446d 79+dtH1TB8LRDq2P+qXiZY2OF33jrbf86Qw4RpktWZIKGq620ngqi8n0dXyekNs5H68q Cu9Q== X-Gm-Message-State: AFqh2krBnhyPCDZ/4ySwM9BEQOA2nHETOSJSxhTJIGwQi3/t1uJa6q8q gM7nxgzFAp8D1uLiog3bxNvr72CEkQ== X-Google-Smtp-Source: AMrXdXsv4YSQx/+69lcI9QokI8aWBGyGIkIPaufhvuSzbQIjSOcpcTtR/K6ymHLaOB1zOaBFAgyH9Q== X-Received: by 2002:ac2:5082:0:b0:4c8:eceb:60d2 with SMTP id f2-20020ac25082000000b004c8eceb60d2mr7867560lfm.46.1672299726891; Wed, 28 Dec 2022 23:42:06 -0800 (PST) Received: from dell ([2a02:1660:692e:dd00::44c]) by smtp.gmail.com with ESMTPSA id o17-20020a05651205d100b00498f77cfa63sm2992102lfo.280.2022.12.28.23.42.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Dec 2022 23:42:06 -0800 (PST) From: Knut Anders Hatlen To: bug-gnu-emacs@gnu.org Subject: 29.0.60; c++-ts-mode could report better defun names Date: Thu, 29 Dec 2022 08:42:03 +0100 Message-ID: <87358yejw4.fsf@oracle.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=kahatlen@gmail.com; helo=mail-lf1-x133.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 (--) The defun names reported by c++-ts-mode could still need a couple of improvements: 1) In a buffer with c++-ts-mode and which-function-mode enabled, and this content: struct S { int f1(int x) { return x + 1; } int g1(int x); }; int S::g1(int x) { return x + 1; } Inside the inline f1 function definition, which-function-mode shows "S.f1". But inside the out-of-line g1 function definition, it shows "n/a" instead of "S.g1". (Not limited to structs. Classes have the same problem.) 2) Namespaces are not handled. Given this content: namespace n { int f1(int x) { return x + 1; } } namespace { int f2(int x) { return x + 1; } } Inside the f1 and f2 function bodies, which-function-mode shows "f1" and "f2", respectively. It would be better if it showed "n.f1" for the former, and perhaps something like "(anonymous).f2" for the latter. In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.35, cairo version 1.16.0) of 2022-12-29 built on dell Repository revision: 909091d7578b7225601b202fb9257dedae879e9a Repository branch: emacs-29 System Description: Debian GNU/Linux bookworm/sid Configured using: 'configure --with-json --with-xml2 --with-modules --prefix=/usr/local/stow/emacs --with-pgtk --without-x --with-native-compilation --with-tree-sitter' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LANG: nn_NO.UTF-8 value of $XMODIFIERS: @im=ibus locale-coding-system: utf-8-unix Major mode: C++ Minor modes in effect: shell-dirtrack-mode: t treesit-explore-mode: t flyspell-mode: t hl-line-mode: t electric-pair-mode: t display-line-numbers-mode: t elide-head-mode: t flymake-mode: t winner-mode: t windmove-mode: t server-mode: t which-function-mode: t savehist-mode: t save-place-mode: t repeat-mode: t recentf-mode: t minibuffer-depth-indicate-mode: t marginalia-mode: t global-so-long-mode: t global-auto-revert-mode: t dynamic-completion-mode: t tooltip-mode: t global-eldoc-mode: t eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tab-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/kah/.emacs.d/elpa/29/transient-0.3.7/transient hides /usr/local/stow/emacs/share/emacs/29.0.60/lisp/transient Features: (shadow sort mail-extr emacsbug message yank-media puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils shell pcomplete cus-start pulse color noutline outline jka-compr find-func orderless cl-print cc-langs cc-mode cc-fonts cc-guess cc-menus cc-cmds help-fns radix-tree cc-styles cc-align cc-engine cc-vars cc-defs mule-util etags fileloop generator xref misearch multi-isearch vc-git diff-mode easy-mmode vc-dispatcher c-ts-mode treesit add-log comp comp-cstr flyspell ispell hl-line elec-pair display-line-numbers elide-head time-date checkdoc lisp-mnt flymake-proc flymake project compile text-property-search comint ansi-osc ansi-color warnings thingatpt cus-edit pp rx winner ring windmove disp-table server icons cl-extra help-mode which-func imenu savehist saveplace repeat recentf tree-widget wid-edit mb-depth marginalia magit-autorevert magit-git magit-section magit-utils crm dash so-long autorevert filenotify completion cus-load embark-autoloads boxquote-autoloads slime-autoloads marginalia-autoloads orderless-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk lcms2 multi-tty make-network-process native-compile emacs) Memory information: ((conses 16 349779 18327) (symbols 48 18948 0) (strings 32 98089 2630) (string-bytes 1 3434581) (vectors 16 60037) (vector-slots 8 864811 38865) (floats 8 312 302) (intervals 56 3318 0) (buffers 984 24)) -- Knut Anders From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 01 19:27:17 2023 Received: (at 60397) by debbugs.gnu.org; 2 Jan 2023 00:27:17 +0000 Received: from localhost ([127.0.0.1]:42036 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC8fc-0006jR-TW for submit@debbugs.gnu.org; Sun, 01 Jan 2023 19:27:17 -0500 Received: from mail-pj1-f52.google.com ([209.85.216.52]:44963) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pC8fa-0006jC-Lg for 60397@debbugs.gnu.org; Sun, 01 Jan 2023 19:27:15 -0500 Received: by mail-pj1-f52.google.com with SMTP id o31-20020a17090a0a2200b00223fedffb30so26907867pjo.3 for <60397@debbugs.gnu.org>; Sun, 01 Jan 2023 16:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=YFgfSWGFdIcDrgrDim+UXCIFJqOLvo4QQJLFPdQdp48=; b=qNEZ7S5M/TcLcDoljv3AuCvrXrjM3gdFQV7u/xESrZoQAnd1aPQYvvayNEPiqWnCCz gJWsDlRqZBhbOhFPiksf88P7oKOODprWFwIfJolGQU2sY1414B4K/wtvkg3iHkCT6HyV rlbWcNupwAUugX9WW4Xoy4iwFzjJDg3IuFuM7kgQVdWfWfpwbytI+2d4bV4G0EetmNLE UwykAN1OoLLBHet9c66Scet6GcUuzdUzA826tfF8PfVhK45IYgtdsXhQ0WyvlTAEwzuF UmiAHpFqgdDg28xQLpdlWQ1R3v7QE8U/1qqI8VrGI2shqZbGaJUe+sG6y8Y8SuCiCgko qMnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YFgfSWGFdIcDrgrDim+UXCIFJqOLvo4QQJLFPdQdp48=; b=Lw5pEGlQI5KhE7iDvCOd1n+zrKfRZ1UdqejZ99SZvcOYAxdgBGnlYqKFkHPZwiqP99 PrMXk7FBMy6xMuGy/Z9lNWxkxIJfKusPwjCyRxen1EeAN82cZKT3MoY248MmO2Zr6gNx qkwnx4dUZBpV+RtHAS27jeGUd1u6DcxZAjC5wl6TxRZgdu8hzLqxCW5JUekvaF2q1B/P Fsp+eLwsidSIq9fHpLsOA0TnJoaD0NwI9Q9dKC1T3z5mh6diBonTo0U4RS0rK5HAD69J r/eRk4jk34hkMB5+/U+G1WH+24QzQbB31G/FF5DDnT/bo0meYvlbNxw/OSpKiYNK3AsS dkQw== X-Gm-Message-State: AFqh2kpyiCBgM2QnmS2vydvpkvwJsnHX2HrRLuVqz1gdbv/kOqL4TD1X 2EMb6r5nYAbKUOi2+ayCe004dG8NLGdaZA== X-Google-Smtp-Source: AMrXdXuLOW/H06URQZWh87ZkAoCxcTGRVNVadVzIPBZXC+DCx3Um8IUZOx/DPV5AS1ZAKQ5Ep6BDHg== X-Received: by 2002:a05:6a20:b297:b0:9d:efbf:7880 with SMTP id ei23-20020a056a20b29700b0009defbf7880mr41790591pzb.53.1672619228995; Sun, 01 Jan 2023 16:27:08 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id 13-20020a62180d000000b0057737e403d9sm17081476pfy.209.2023.01.01.16.27.08 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Jan 2023 16:27:08 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60397: 29.0.60; c++-ts-mode could report better defun names Message-Id: Date: Sun, 1 Jan 2023 16:27:08 -0800 To: Knut Anders Hatlen X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60397 Cc: 60397@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 (-) Knut Anders Hatlen writes: > The defun names reported by c++-ts-mode could still need a couple of > improvements: > > 1) In a buffer with c++-ts-mode and which-function-mode enabled, and > this content: > > struct S { > int f1(int x) { > return x + 1; > } > int g1(int x); > }; > > int S::g1(int x) { > return x + 1; > } > > Inside the inline f1 function definition, which-function-mode shows > "S.f1". But inside the out-of-line g1 function definition, it shows > "n/a" instead of "S.g1". (Not limited to structs. Classes have the = same > problem.) > > 2) Namespaces are not handled. Given this content: > > namespace n { > int f1(int x) { > return x + 1; > } > } > > namespace { > int f2(int x) { > return x + 1; > } > } > > Inside the f1 and f2 function bodies, which-function-mode shows "f1" = and > "f2", respectively. It would be better if it showed "n.f1" for the > former, and perhaps something like "(anonymous).f2" for the latter. Thanks for the report. I=E2=80=99ll work on this :-) Yuan From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 19:06:28 2023 Received: (at 60397) by debbugs.gnu.org; 8 Jan 2023 00:06:28 +0000 Received: from localhost ([127.0.0.1]:59323 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEJCm-0007SO-8B for submit@debbugs.gnu.org; Sat, 07 Jan 2023 19:06:28 -0500 Received: from mail-pl1-f181.google.com ([209.85.214.181]:34454) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEJCk-0007SB-3D for 60397@debbugs.gnu.org; Sat, 07 Jan 2023 19:06:27 -0500 Received: by mail-pl1-f181.google.com with SMTP id v23so756043plo.1 for <60397@debbugs.gnu.org>; Sat, 07 Jan 2023 16:06:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=6LYA5zCqgHNSFL51rjUZK2x1ZFXyqCnoKE+GhjW+jV4=; b=K+UIIafle5/QquXNumCgC92qSz6auyCgCNgzQbuHzGVdFARmrndf3OTMqj+MEyyg08 F2HdRlgw3j4K1uruRrhxvGzFTkga+IriGK+AL6bQ8wY5fq0tZMU3UihY3OtmzmHLh3Ok afx3RJ/3Rv0+ZWEzXlvNtQbu3J5E0z6btnSIXJP/CVdm49ctDs7Mg07CIYMgGB2ZUqsX mvnOuia1Q8FKNf1iX6IVVJsstGHA5+2DeHf7U0tIJ6qWhZA+V6Kh0Ndm7VEa3RCYjzl0 V0/QahCj6jcH49WXd2CKIRAjHa/EiUCGyiYU7PFQipvGNbQ/2tGtqdCV5AkPyJ/IzZsC 3QTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6LYA5zCqgHNSFL51rjUZK2x1ZFXyqCnoKE+GhjW+jV4=; b=yyBnKZpvbXJCR4uGZ/TQndUPMNzNlqWRvw801IUWdcb8btOMcCzhlzpJrG9qBQ90mk epPvItQ5Hbr28UCH+WmDFzB4ZMXWRRceEhaKOsp7IClylcj9pBoXX0p7c/71BpYDKuIe Lu3gQHiI/CIZYEFQcVYZN1+o37ojDCo/Nm5GcFhNzRBpBpfC2IZe3DvceACy88j4Y2s4 Z4Qzkh3Jql4hdMfMCcvwhhqZckj+STnrM36/29MptsujpcQZetys9wk+jPK0j5z8DbV9 IrSxyhaGRoXCz8L0VjznAwluxOSwSlyKk+1lkGaxWFaeReTuKKuJTAkBiPm9+hux4zQa LcfA== X-Gm-Message-State: AFqh2kqPimIrBZIGg8KdGvFzDiPaiYzuWDhVfYXYrEu0dY3MzLR4g2mX aCxlbsdJtVnT+VgXLp0d09M= X-Google-Smtp-Source: AMrXdXvKaaoCK4azoBsIJoDfng3it10cexzuy9nuLUGBTmXUb7Tvcb9Y7CLJFBbQpjICZ26L3v1emA== X-Received: by 2002:a17:902:7601:b0:192:8e8b:bcf with SMTP id k1-20020a170902760100b001928e8b0bcfmr39288224pll.56.1673136380208; Sat, 07 Jan 2023 16:06:20 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id u11-20020a170902e80b00b00174c0dd29f0sm3285718plg.144.2023.01.07.16.06.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Jan 2023 16:06:19 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60397: 29.0.60; c++-ts-mode could report better defun names Message-Id: Date: Sat, 7 Jan 2023 16:06:18 -0800 To: Knut Anders Hatlen X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60397 Cc: 60397@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 (-) Knut Anders Hatlen writes: > The defun names reported by c++-ts-mode could still need a couple of > improvements: > > 1) In a buffer with c++-ts-mode and which-function-mode enabled, and > this content: > > struct S { > int f1(int x) { > return x + 1; > } > int g1(int x); > }; > > int S::g1(int x) { > return x + 1; > } > > Inside the inline f1 function definition, which-function-mode shows > "S.f1". But inside the out-of-line g1 function definition, it shows > "n/a" instead of "S.g1". (Not limited to structs. Classes have the = same > problem.) Now the second function is displayed as S::g1. > 2) Namespaces are not handled. Given this content: > > namespace n { > int f1(int x) { > return x + 1; > } > } > > namespace { > int f2(int x) { > return x + 1; > } > } > > Inside the f1 and f2 function bodies, which-function-mode shows "f1" = and > "f2", respectively. It would be better if it showed "n.f1" for the > former, and perhaps something like "(anonymous).f2" for the latter. Now the first function is shown as n.f1, the second is shown as f2. Making it (anonymous).f2 isn=E2=80=99t necessarily better than f2 IMO, = and requires some non-trivial change to the current code, so I didn=E2=80=99t = do it. Yuan From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 02:05:41 2023 Received: (at 60397) by debbugs.gnu.org; 8 Jan 2023 07:05:41 +0000 Received: from localhost ([127.0.0.1]:59742 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEPkS-0006XE-PQ for submit@debbugs.gnu.org; Sun, 08 Jan 2023 02:05:41 -0500 Received: from mail-lf1-f48.google.com ([209.85.167.48]:45043) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEPkQ-0006Wi-4q for 60397@debbugs.gnu.org; Sun, 08 Jan 2023 02:05:38 -0500 Received: by mail-lf1-f48.google.com with SMTP id m6so8253387lfj.11 for <60397@debbugs.gnu.org>; Sat, 07 Jan 2023 23:05:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6IaB8AsKASTdXPYeJz3Dgl7qVHkGaWVuWII+hGRNRrc=; b=GNV8wMGCTlDIiTEaNQPfAGxP9cbiSY8adCOCDnKJNFGBfPyVcmOn0lY9UO40DXD2Pj 7JtUcB4xzOYqi9mGYe+tc716Wu4L5326h8+iVS9xOMjxZqQ/mrbnxhptJslJBwyppIGw NKll/Udby1z5Abos9mbMMcpis7kBrG9rTcWg9v0qjGgIgVP2Cyy8SuKyTpvN34MW6dbH X3VK0FlIYKaU5d+YasnK2ypTAMu9P/RqTy+QIu3RBnsVwrI3DkJYXXiX2Lk8bZPi99TU ZawiGf9q/WhToN7YhXvUCYqwjXOEYcsaFVfmBMMsUO/wXF41Pgb1SlMz28LIqfu50Fi0 kWlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent: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=6IaB8AsKASTdXPYeJz3Dgl7qVHkGaWVuWII+hGRNRrc=; b=SNoGh2V5vc3jqAAGjnqw68dW++UgaxHrwgPqS5e3nk3Pdk08LVeaukWtMaSW8lPZyK 9nN4jERFIXEZBERHwjbVGmnPieQnSwnoW9cDDcJ+zMbpeP/ueBhGFgSMxIhjTkPQHWl+ BdUzK8/den0BT1ByZtqKSnCY/vmbs1zxr4hhHehW6nT9zdHZOZbY+PBJolvyp3Z8kq1Y NFzefvjL9CYwCWlgjF0VFjqifAjqxlBdAeb9lqCHbdHoiyMqQUsd8RtU3XIjlWfS+ocm +VxwMF0oKzvJeI0FOAODlh4OiQpdsqbmI1oo/4KpNZ2rha0e3EekZYtx3hWk7g9sU9bZ aHTQ== X-Gm-Message-State: AFqh2koLaxlypMLP1/c/U34Lt9NoQNVdO7f7eA2+7UTC2II6ra2sx+cm RaGh1OD517Tzrj3q87cLNr19lqYWyw== X-Google-Smtp-Source: AMrXdXuHTunBdbBxs44x4oKRlmH8UDFb0XgMUk+ocjIyx8enOAkESJCXrpO6dGYAvns6oUZpbk95xQ== X-Received: by 2002:ac2:4e8b:0:b0:4bb:dedf:f38b with SMTP id o11-20020ac24e8b000000b004bbdedff38bmr14888201lfr.34.1673161531818; Sat, 07 Jan 2023 23:05:31 -0800 (PST) Received: from dell ([2a02:2121:6c3:44bd:8c6:f8dd:8e65:1136]) by smtp.gmail.com with ESMTPSA id m9-20020ac24ac9000000b004cafe65883dsm929739lfp.122.2023.01.07.23.05.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Jan 2023 23:05:31 -0800 (PST) From: Knut Anders Hatlen To: Yuan Fu Subject: Re: bug#60397: 29.0.60; c++-ts-mode could report better defun names In-Reply-To: (Yuan Fu's message of "Sat, 7 Jan 2023 16:06:18 -0800") References: Date: Sun, 08 Jan 2023 08:05:30 +0100 Message-ID: <87ilhhzeth.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60397 Cc: 60397@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 (-) Yuan Fu writes: > Knut Anders Hatlen writes: > >> The defun names reported by c++-ts-mode could still need a couple of >> improvements: >> >> 1) In a buffer with c++-ts-mode and which-function-mode enabled, and >> this content: >> >> struct S { >> int f1(int x) { >> return x + 1; >> } >> int g1(int x); >> }; >> >> int S::g1(int x) { >> return x + 1; >> } >> >> Inside the inline f1 function definition, which-function-mode shows >> "S.f1". But inside the out-of-line g1 function definition, it shows >> "n/a" instead of "S.g1". (Not limited to structs. Classes have the same >> problem.) > > Now the second function is displayed as S::g1. Looks good now. Classes seem to be handled fine too. >> 2) Namespaces are not handled. Given this content: >> >> namespace n { >> int f1(int x) { >> return x + 1; >> } >> } >> >> namespace { >> int f2(int x) { >> return x + 1; >> } >> } >> >> Inside the f1 and f2 function bodies, which-function-mode shows "f1" and >> "f2", respectively. It would be better if it showed "n.f1" for the >> former, and perhaps something like "(anonymous).f2" for the latter. > > Now the first function is shown as n.f1, the second is shown as f2. > Making it (anonymous).f2 isn=E2=80=99t necessarily better than f2 IMO, and > requires some non-trivial change to the current code, so I didn=E2=80=99t= do it. Fair enough. Thanks! --=20 Knut Anders From debbugs-submit-bounces@debbugs.gnu.org Tue Jan 17 04:39:49 2023 Received: (at 60397-done) by debbugs.gnu.org; 17 Jan 2023 09:39:49 +0000 Received: from localhost ([127.0.0.1]:35793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHiRY-0000oW-Rd for submit@debbugs.gnu.org; Tue, 17 Jan 2023 04:39:49 -0500 Received: from mail-pl1-f171.google.com ([209.85.214.171]:36475) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHiRW-0000oE-Sk for 60397-done@debbugs.gnu.org; Tue, 17 Jan 2023 04:39:47 -0500 Received: by mail-pl1-f171.google.com with SMTP id 20so5631650plo.3 for <60397-done@debbugs.gnu.org>; Tue, 17 Jan 2023 01:39:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:from:to:cc:subject:date:message-id :reply-to; bh=9oQJvoB2eRYLslLqCwq399DcQqn8Ddy1x+L66El1kKM=; b=nHWhb/kWzxYi2UrRl8m39oiEnXDOMMa5SKnALuusE4senDweSE0ugzjLQIK6DrBWs+ 6yJP0O+73EYH7DFq60GvwCUhfMFUqhLpkmPjzOSf64bOioi3Kn2emakv59TOTOlQEi1L 0fRVeS1R+xNbVCP33BzjfBlJr/x2pAmAevf/2EUjZBY/kADF/4Be/feM1BWxrXYK/FA1 pMLOb76pqdpgCrhHE4eBfvIV5ZaUm6dPvPWheQpUU5e3qwr58/1UBkz/3y/Bh+6vVwyw AKBtvnw/S/aWMizWgZPJaXPKTOALyx8865BJ9+Mpui6jcwrNbuQlHMOkg+5TquzawknZ CxFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:cc:date:message-id:subject:mime-version :content-transfer-encoding:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9oQJvoB2eRYLslLqCwq399DcQqn8Ddy1x+L66El1kKM=; b=1PszJstKSID0IBdCdJdj+PmuVpzVzTCh/Ig3ezGuQZE0pFqxGECt5VUw86eH+dMlM0 PZ9Bpgzumi5X+FjUWOwAdQruAOjy/Eeo76eHoH6XsiBuvBYcomF/nnzirB0O8pX2sA5Y XfXVvqETlQoFH5Hp1po1oIrTVylA7voDW5U43AF5szblZ0gI71VHTH/bKdzYc73y/q8g kBZ9vvlxbSITp9x/Eb8AyiS8vYjhj9Dymjy9qAqpSpOVNhs3TGXTkEZ9PnJP9Cupb8rk eJpVthln42V1R+QLKmCfGBryfAh+NhokQD6uNjEGdfAgxKl2NxcioaP8hbIEysOOaduU mChw== X-Gm-Message-State: AFqh2krZniC4fEpFKfA6pkVJBSDxErnmExZS8ZfKAu92TuKH+Chsw5SW iyIMutrpWLRP76KVh07sg6D/7zMgGig= X-Google-Smtp-Source: AMrXdXvwn/hvK4i25oPiSUSRGgm4WQSVt0GE61YDw4zx/9bCVX/4LHhHrLf3BhkgQH4K9ooCuoWBvA== X-Received: by 2002:a17:902:8492:b0:18f:438a:cfe1 with SMTP id c18-20020a170902849200b0018f438acfe1mr2463580plo.59.1673948381132; Tue, 17 Jan 2023 01:39:41 -0800 (PST) Received: from smtpclient.apple (cpe-172-117-161-177.socal.res.rr.com. [172.117.161.177]) by smtp.gmail.com with ESMTPSA id a14-20020a170902710e00b00194516b2d88sm11466446pll.260.2023.01.17.01.39.40 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 17 Jan 2023 01:39:40 -0800 (PST) From: Yuan Fu Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Subject: Re: bug#60397: 29.0.60; c++-ts-mode could report better defun names Message-Id: <8CF91E69-4784-4735-AECA-251901322018@gmail.com> Date: Tue, 17 Jan 2023 01:39:40 -0800 To: Knut Anders Hatlen X-Mailer: Apple Mail (2.3696.120.41.1.1) X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 60397-done Cc: 60397-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: -1.0 (-) Knut Anders Hatlen writes: > Yuan Fu writes: > >> Knut Anders Hatlen writes: >> >>> The defun names reported by c++-ts-mode could still need a couple of >>> improvements: >>> >>> 1) In a buffer with c++-ts-mode and which-function-mode enabled, and >>> this content: >>> >>> struct S { >>> int f1(int x) { >>> return x + 1; >>> } >>> int g1(int x); >>> }; >>> >>> int S::g1(int x) { >>> return x + 1; >>> } >>> >>> Inside the inline f1 function definition, which-function-mode shows >>> "S.f1". But inside the out-of-line g1 function definition, it shows >>> "n/a" instead of "S.g1". (Not limited to structs. Classes have the = same >>> problem.) >> >> Now the second function is displayed as S::g1. > > Looks good now. Classes seem to be handled fine too. > >>> 2) Namespaces are not handled. Given this content: >>> >>> namespace n { >>> int f1(int x) { >>> return x + 1; >>> } >>> } >>> >>> namespace { >>> int f2(int x) { >>> return x + 1; >>> } >>> } >>> >>> Inside the f1 and f2 function bodies, which-function-mode shows "f1" = and >>> "f2", respectively. It would be better if it showed "n.f1" for the >>> former, and perhaps something like "(anonymous).f2" for the latter. >> >> Now the first function is shown as n.f1, the second is shown as f2. >> Making it (anonymous).f2 isn=E2=80=99t necessarily better than f2 = IMO, and >> requires some non-trivial change to the current code, so I didn=E2=80=99= t do it. > > Fair enough. Thanks! Closing this since I think the problem=E2=80=99s fixed :-) Yuan From unknown Wed Jun 18 00:25:47 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 14 Feb 2023 12:24:15 +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