GNU bug report logs - #20650
25.0.50; xref seems not to pick C++ destructors

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Mon, 25 May 2015 15:30:04 UTC

Severity: normal

Found in version 25.0.50

To reply to this bug, email your comments to 20650 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20650; Package emacs. (Mon, 25 May 2015 15:30:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Eli Zaretskii <eliz <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 25 May 2015 15:30:06 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 25.0.50; xref seems not to pick C++ destructors
Date: Mon, 25 May 2015 18:27:44 +0300
From: eliz <at> HOME-C4E4A596F7.i-did-not-set--mail-host-address--so-tickle-me
--text follows this line--
To reproduce:

 emacs -Q
 C-x C-f test/etags/cp-src/c.C RET
 C-s ~A

This should land you on line 118 of c.C, which says:

struct A {
    ~A();  <<<<<<<<<<<<<<<<<<<<<<< line 118
};

Now, with point on "A" in "~A", type "M-." and when Emacs prompts for
TAGS table, direct it to use test/etags/ETAGS.good_1.  The result is
that you are presented with a 17-line *xref* buffer showing the
possible candidates, but it is clear that xref thought you wanted to
find the symbol "A".

Now switch back to the buffer visiting c.C and type:

 C-u M-. ~A RET

Result: you are immediately placed on the line of c.C that defines the
destructor for class A.  IOW, the tags table is OK, it's xref that
didn't understand that when point is on "~A", you want ~A, not A.


In GNU Emacs 25.0.50.82 (i686-pc-mingw32)
 of 2015-05-25 on HOME-C4E4A596F7
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --prefix=/d/usr --enable-checking=yes,glyphs
 'CFLAGS=-gdwarf-4 -g3 -O0''

Configured features:
XPM JPEG TIFF GIF PNG RSVG SOUND NOTIFY ACL GNUTLS LIBXML2 ZLIB

Important settings:
  value of $LANG: ENU
  locale-coding-system: cp1255

Major mode: C/l

Minor modes in effect:
  diff-auto-refine-mode: t
  tooltip-mode: t
  global-eldoc-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  abbrev-mode: t

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.
Mark set
Starting a new list of tags tables

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message dired format-spec
rfc822 mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils pulse compile comint ansi-color
cl-macs thingatpt etags xref cl-seq eieio byte-opt gv bytecomp
byte-compile cl-extra seq cconv eieio-core ring vc cl-loaddefs pcase
cl-lib vc-dispatcher vc-git diff-mode easy-mmode cc-mode cc-fonts
easymenu cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs time-date mule-util tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type mwheel dos-w32 ls-lisp disp-table w32-win
w32-vars term/common-win tool-bar dnd fontset image regexp-opt fringe
tabulated-list newcomment elisp-mode lisp-mode prog-mode register page
menu-bar rfn-eshadow timer select scroll-bar mouse jit-lock font-lock
syntax facemenu font-core frame cl-generic 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 case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp
files text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote w32notify w32 multi-tty
make-network-process emacs)

Memory information:
((conses 8 124602 4439)
 (symbols 32 23214 0)
 (miscs 32 55 152)
 (strings 16 26670 4578)
 (string-bytes 1 866172)
 (vectors 8 17026)
 (vector-slots 4 473904 2152)
 (floats 8 180 106)
 (intervals 28 1101 344)
 (buffers 516 14))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20650; Package emacs. (Mon, 25 May 2015 23:22:02 GMT) Full text and rfc822 format available.

Message #8 received at 20650 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>, 20650 <at> debbugs.gnu.org
Subject: Re: bug#20650: 25.0.50; xref seems not to pick C++ destructors
Date: Tue, 26 May 2015 02:21:41 +0300
On 05/25/2015 06:27 PM, Eli Zaretskii wrote:

> the tags table is OK, it's xref that
> didn't understand that when point is on "~A", you want ~A, not A.

You're welcome to suggest a better implementation for 
xref-default-identifier-at-point (keep in mind that it should be 
language-agnostic), but while it uses (thing-at-point 'symbol), maybe 
c++-mode should propertize ~ in those positions to have syntax class 
"symbol".

Normally it's performed with a syntax-propertize-function, but c++-mode 
doesn't have it.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20650; Package emacs. (Tue, 26 May 2015 02:40:03 GMT) Full text and rfc822 format available.

Message #11 received at 20650 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 20650 <at> debbugs.gnu.org
Subject: Re: bug#20650: 25.0.50; xref seems not to pick C++ destructors
Date: Tue, 26 May 2015 05:38:59 +0300
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> Date: Tue, 26 May 2015 02:21:41 +0300
> 
> On 05/25/2015 06:27 PM, Eli Zaretskii wrote:
> 
> > the tags table is OK, it's xref that
> > didn't understand that when point is on "~A", you want ~A, not A.
> 
> You're welcome to suggest a better implementation for 
> xref-default-identifier-at-point (keep in mind that it should be 
> language-agnostic), but while it uses (thing-at-point 'symbol), maybe 
> c++-mode should propertize ~ in those positions to have syntax class 
> "symbol".

My point was precisely that xref is not smart enough when it picks the
symbol.  If we need some languages to help it, we should make sure all
supported languages provide that.  It's no use asking etags for better
precision when xref cannot pick up the right symbol.

> Normally it's performed with a syntax-propertize-function, but c++-mode 
> doesn't have it.

Well, perhaps it should.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20650; Package emacs. (Tue, 26 May 2015 09:59:02 GMT) Full text and rfc822 format available.

Message #14 received at 20650 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20650 <at> debbugs.gnu.org
Subject: Re: bug#20650: 25.0.50; xref seems not to pick C++ destructors
Date: Tue, 26 May 2015 12:58:15 +0300
On 05/26/2015 05:38 AM, Eli Zaretskii wrote:
> If we need some languages to help it, we should make sure all
> supported languages provide that.

Right, and we usually try to make it so that in every language the 
notion of symbol makes sense.

> Well, perhaps it should.

Indeed, but I'm not holding my breath.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20650; Package emacs. (Thu, 26 Nov 2015 03:17:02 GMT) Full text and rfc822 format available.

Message #17 received at 20650 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 20650 <at> debbugs.gnu.org
Subject: Re: bug#20650: 25.0.50; xref seems not to pick C++ destructors
Date: Thu, 26 Nov 2015 05:16:19 +0200
Dmitry Gutov <dgutov <at> yandex.ru> writes:

> maybe
> c++-mode should propertize ~ in those positions to have syntax class
> "symbol".

Alternatively, c++-mode can define a specialized
find-tag-default-function that would include the tilde when it comes at
the beginning of a symbol.




This bug report was last modified 9 years and 206 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.