From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Mauro Aranda Newsgroups: gmane.emacs.bugs Subject: bug#32403: 27.0.50; cc mode: c-display-defun-name doesn't work when return type is a pointer Date: Sun, 26 Aug 2018 11:40:38 -0300 Message-ID: References: <83ftzdgxb1.fsf@gnu.org> <20180817203707.GA6556@ACM> <20180826112501.GA1867@ACM> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b26cf705745797c8" X-Trace: blaine.gmane.org 1535295382 11324 195.159.176.226 (26 Aug 2018 14:56:22 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 26 Aug 2018 14:56:22 +0000 (UTC) Cc: 32403@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Aug 26 16:56:18 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftwSg-0002rx-El for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Aug 2018 16:56:18 +0200 Original-Received: from localhost ([::1]:49376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftwUm-0007Qb-RU for geb-bug-gnu-emacs@m.gmane.org; Sun, 26 Aug 2018 10:58:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41907) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ftwTK-0006K9-Tg for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 10:57:02 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ftwDy-0005PK-9C for bug-gnu-emacs@gnu.org; Sun, 26 Aug 2018 10:41:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:56425) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ftwDu-0005Ng-DK; Sun, 26 Aug 2018 10:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ftwDu-0000hD-B4; Sun, 26 Aug 2018 10:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mauro Aranda Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Sun, 26 Aug 2018 14:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32403 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: Original-Received: via spool by 32403-submit@debbugs.gnu.org id=B32403.15352944472647 (code B ref 32403); Sun, 26 Aug 2018 14:41:02 +0000 Original-Received: (at 32403) by debbugs.gnu.org; 26 Aug 2018 14:40:47 +0000 Original-Received: from localhost ([127.0.0.1]:33210 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftwDf-0000gc-1y for submit@debbugs.gnu.org; Sun, 26 Aug 2018 10:40:47 -0400 Original-Received: from mail-lj1-f180.google.com ([209.85.208.180]:44660) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ftwDd-0000gO-Lx for 32403@debbugs.gnu.org; Sun, 26 Aug 2018 10:40:46 -0400 Original-Received: by mail-lj1-f180.google.com with SMTP id q127-v6so10277361ljq.11 for <32403@debbugs.gnu.org>; Sun, 26 Aug 2018 07:40:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=M91M/BGFJqWFk0y0x4A7KvwNIfrOTrEp/YbhtD1Uo1Y=; b=Mz1xZF+iO8p55k7HGeoeJemAx6JSjwY0x+N4WxMdazhDFsOLJX/v4glDGx/UjeCaEl u7ayeVSs6eD2J5dnJlo8NH2y2VDI8NIzosLSeOGm5yFvH7GKmOb2huaxWmHlKgU0LKN8 xE2DO8jnu+r7VNs3MJUcWZ/DAd3qSIqNMKzQIjWKIEV8sD/6IFvcn7Wx6ZHU9/TTXPqy naEI3Fkby378ExBQPF11SU9lBSND5dYzkW3wJ+usbPIIbiU0CIHcML5pZgBjUIgQWfN3 ubx2RQqC6I7COsI6DD1tRI+T1QZngygvEIFmZ83FoT0hv02qPoZhtJIjv+TioE5VM6So NPlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=M91M/BGFJqWFk0y0x4A7KvwNIfrOTrEp/YbhtD1Uo1Y=; b=AruzmrywVSnhnSE9e9TXom55ZQ8lzXZnCFjZVSW62gq6U9S7ZmPWU43sj/G2Ohkod6 enQydW7+KUVCnTklDHZwFrPIoxvfTnX81NN/Oen6EwPkvBOv8tWoZKgCjuDVILBgjLJf dcS6lqQKLSRkuS2LZAPnHSE+b6/FPG2jmokGJIjWLu/zqBJ0wyLzaCGyv00xUJ1m7E7X zJDjNvObQnwmCsOlAgS6tAdOe3zY9Rdlza6friRmdIdv/QwuAoTODGM4C1wd8wtVK+/h nLPBz/DKU43TOlEwLwNOasMvSbUwRWB5d/yd43s5FO2Bhf5kb1g3VoheRWng/qbXS6FW glIQ== X-Gm-Message-State: APzg51BvIvsv14UWVUv3kwMttwNCRecUCtCiE+twGhhQ7eN79/bY9l8A xvZhHmZRQTxfBV/7/ZscQ4y+dWya0Yt1wSU3ZCI= X-Google-Smtp-Source: ANB0VdYQR/5vW45CAkhUQmf95aONFnROKZECfISeF/cavs04Xq4MzOwuHSGsMao6IPjWm/WaJYnJT8j1tS/rMHFupQc= X-Received: by 2002:a2e:5719:: with SMTP id l25-v6mr6074003ljb.125.1535294439581; Sun, 26 Aug 2018 07:40:39 -0700 (PDT) Original-Received: by 2002:a19:de11:0:0:0:0:0 with HTTP; Sun, 26 Aug 2018 07:40:38 -0700 (PDT) In-Reply-To: <20180826112501.GA1867@ACM> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:149758 Archived-At: --000000000000b26cf705745797c8 Content-Type: text/plain; charset="UTF-8" Hi Alan, The fix works great. Thank you! 2018-08-26 8:25 GMT-03:00 Alan Mackenzie : > Hello, Mauro, hello, Eli. > > On Fri, Aug 17, 2018 at 20:37:07 +0000, Alan Mackenzie wrote: > > On Fri, Aug 17, 2018 at 12:24:50 +0300, Eli Zaretskii wrote: > > > > From: Mauro Aranda > > > > Date: Wed, 8 Aug 2018 17:18:58 -0300 > > > > > Hello. I'm sending this report here because I tested in GNU Emacs > 26.1.50 and the problem is not present. If > > > > it belongs to the CC Mode mailing list, please let me know. > > > > > I run: emacs -Q and visit a C file. > > > > > Inside a function that doesn't return a pointer, > c-display-defun-name works just fine. Example: > > > > > int > > > > dummy_returnint(int ret) > > > > { > > > > return ret; > > > > } > > > > > Minibuffer displays: dummy_returnint > > > > > But when the function returns a pointer, c-display-defun-name fails > to display the function name in the > > > > minibuffer. Example: > > > > > int * > > > > dummy_returnpointertoint(int *ret) > > > > { > > > > return ret; > > > > } > > > > > Minibuffer displays nothing > > > > Confirmed. Alan, could you please take a look at this? > > > Yes, certainly. I've worked out a patch for Mauro's failure case (with > > the function's type being a pointer). > > > Additionally, I've found a couple of edge cases which currently aren't > > working right: > > > struct foo bar = {0, 0}; > > > returns "struct foo" on C-c C-z. It ought to return "bar"; > > > struct foo {int a; int b} bar = {0, 0}; > > > also ought to return "bar". > > > It shouldn't be too much work to fix these two, too. I hope to have this > > done by tomorrow (European time) or, at the latest, on Sunday. > > I've committed a fix for this to master. It was a bit trickier than I'd > anticipated. > > Mauro, would you please test the fix with your real source code and > either confirm to me that the problem has indeed been fixed, or tell me > where it's still failing. Thanks! > > -- > Alan Mackenzie (Nuremberg, Germany). > --000000000000b26cf705745797c8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Alan,

The fix works great= .=C2=A0 Thank you!



2018-08-26 8:25 GMT-03:00 Alan Mackenzie <acm@muc= .de>:
Hello, Mauro, hello, = Eli.

On Fri, Aug 17, 2018 at 20:37:07 +0000, Alan Mackenzie wrote:
> On Fri, Aug 17, 2018 at 12:24:50 +0300, Eli Zaretskii wrote:
> > > From: Mauro Aranda <maurooaranda@gmail.com>
> > > Date: Wed, 8 Aug 2018 17:18:58 -0300

> > > Hello. I'm sending this report here because I tested in = GNU Emacs 26.1.50 and the problem is not present. If
> > > it belongs to the CC Mode mailing list, please let me know.<= br>
> > > I run: emacs -Q and visit a C file.

> > > Inside a function that doesn't return a pointer, c-displ= ay-defun-name works just fine. Example:

> > > int
> > > dummy_returnint(int ret)
> > > {
> > >=C2=A0 =C2=A0return ret;
> > > }

> > > Minibuffer displays: dummy_returnint

> > > But when the function returns a pointer, c-display-defun-nam= e fails to display the function name in the
> > > minibuffer. Example:

> > > int *
> > > dummy_returnpointertoint(int *ret)
> > > {
> > >=C2=A0 =C2=A0return ret;
> > > }

> > > Minibuffer displays nothing

> > Confirmed.=C2=A0 Alan, could you please take a look at this?

> Yes, certainly.=C2=A0 I've worked out a patch for Mauro's fail= ure case (with
> the function's type being a pointer).

> Additionally, I've found a couple of edge cases which currently ar= en't
> working right:

>=C2=A0 =C2=A0 =C2=A0struct foo bar =3D {0, 0};

> returns "struct foo" on C-c C-z.=C2=A0 It ought to return &q= uot;bar";

>=C2=A0 =C2=A0 =C2=A0struct foo {int a; int b} bar =3D {0, 0};

> also ought to return "bar".

> It shouldn't be too much work to fix these two, too.=C2=A0 I hope = to have this
> done by tomorrow (European time) or, at the latest, on Sunday.

I've committed a fix for this to master.=C2=A0 It was a bit= trickier than I'd
anticipated.

Mauro, would you please test the fix with your real source code and
either confirm to me that the problem has indeed been fixed, or tell me
where it's still failing.=C2=A0 Thanks!

--
Alan Mackenzie (Nuremberg, Germany).

--000000000000b26cf705745797c8--