From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuan Fu Newsgroups: gmane.emacs.bugs Subject: bug#60397: 29.0.60; c++-ts-mode could report better defun names Date: Sat, 7 Jan 2023 16:06:18 -0800 Message-ID: References: <87358yejw4.fsf@oracle.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3696.120.41.1.1\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33840"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60397@debbugs.gnu.org To: Knut Anders Hatlen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 08 01:07:12 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pEJDU-0008aq-FE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 08 Jan 2023 01:07:12 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pEJDL-0008Em-V3; Sat, 07 Jan 2023 19:07:03 -0500 Original-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 1pEJDK-0008Ee-MH for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 19:07:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pEJDK-0007x3-DN for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 19:07:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pEJDJ-0007TA-Ol for bug-gnu-emacs@gnu.org; Sat, 07 Jan 2023 19:07:01 -0500 X-Loop: help-debbugs@gnu.org In-Reply-To: <87358yejw4.fsf@oracle.com> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 08 Jan 2023 00:07:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60397 X-GNU-PR-Package: emacs Original-Received: via spool by 60397-submit@debbugs.gnu.org id=B60397.167313638828673 (code B ref 60397); Sun, 08 Jan 2023 00:07:01 +0000 Original-Received: (at 60397) by debbugs.gnu.org; 8 Jan 2023 00:06:28 +0000 Original-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 Original-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 Original-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) Original-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) X-Mailer: Apple Mail (2.3696.120.41.1.1) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:252846 Archived-At: 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