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: Tue, 17 Jan 2023 01:39:40 -0800 Message-ID: <8CF91E69-4784-4735-AECA-251901322018@gmail.com> 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="39868"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 60397-done@debbugs.gnu.org To: Knut Anders Hatlen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 17 10:40:34 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 1pHiSH-000AEf-RY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 17 Jan 2023 10:40:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHiS5-0006qx-Se; Tue, 17 Jan 2023 04:40:21 -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 1pHiRo-0006pu-SN for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 04:40:12 -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 1pHiRn-0004KW-CW for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 04:40:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pHiRn-0000pN-7S for bug-gnu-emacs@gnu.org; Tue, 17 Jan 2023 04:40:03 -0500 In-Reply-To: <87358yejw4.fsf@oracle.com> Resent-From: Yuan Fu Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 17 Jan 2023 09:40:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 60397 X-GNU-PR-Package: emacs Mail-Followup-To: 60397@debbugs.gnu.org, casouri@gmail.com, kahatlen@gmail.com Original-Received: via spool by 60397-done@debbugs.gnu.org id=D60397.16739483893136 (code D ref 60397); Tue, 17 Jan 2023 09:40:03 +0000 Original-Received: (at 60397-done) by debbugs.gnu.org; 17 Jan 2023 09:39:49 +0000 Original-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 Original-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 Original-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) 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 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) 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:253535 Archived-At: 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