unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Stefan Monnier <monnier@iro.umontreal.ca>, Eli Zaretskii <eliz@gnu.org>
Cc: 19466@debbugs.gnu.org
Subject: bug#19466: 25.0.50; xref-find-def doesn't find C functions
Date: Fri, 02 Jan 2015 19:52:54 +0200	[thread overview]
Message-ID: <54A6DAF6.5070605@yandex.ru> (raw)
In-Reply-To: <jwvr3vgahn9.fsf-monnier+emacsbugs@gnu.org>

On 12/31/2014 12:44 AM, Stefan Monnier wrote:

> I think it's not just a matter of combining several major modes: you
> need to know where the various files are and how they relate.  IOW there
> needs to be some other logic on top of it and different systems will
> require different such logic.

Or, to put it another way: if someone is editing ELPA code in its own 
repo and presses `C-u M-.', I'm not sure it's reasonable to include all 
C functions and macros in the list of suggested identifiers. After all, 
they are writing Elisp, not C.

One way to deal with this would be to add a minor mode, one that people 
could enable on by-file or by-project basis (say, in Emacs's 
.dir-locals.el).

This xref-emacs-sources-mode would merge identifiers from both the Elisp 
and Etags backends, and try to merge the search results for different 
search actions as well.

It will return duplicate results, though. And filtering them out will be 
non-trivial.

For instance, if find-func and src/TAGS are merge, jumping to `car' 
would yield one xref-elisp-location, and one xref-file-location. How do 
you compare them, if one has fields with values "car" and "src/data.c", 
and the other "DEFUN ("car", Fcar," and "/full/p/t/emacs/src/data.c"?

Do we really want to include lisp/TAGS? It has both pros and cons.

Pros: we can jump to all functions, even non-autoloaded ones in all 
packages.

Cons: we do see all the functions, even ones we don't care about (their 
packages aren't loaded). Based on my positive experience with find-func, 
maybe 98% of the time the user won't really need them.

And duplicates, a lot more than with src/TAGS.

So someone should really consider if we ever need find-func and 
lisp/TAGS used together. Because if Eli only wants to use tag files when 
working on Emacs, the respective minor mode looks a lot simpler:

(defvar xref-etags-mode--save nil)

(define-minor-mode xref-etags-mode
   "Toggle using only the tag files for navigation."
   :lighter ""
   (if xref-etags-mode
       (progn
         (setq xref-etags-mode--save
               (cons xref-find-function
                     xref-identifier-completion-table-function))
         (kill-local-variable 'xref-find-function)
         (kill-local-variable 'xref-identifier-completion-table-function))
     (setq-local xref-find-function (car xref-etags-mode--save))
     (setq-local xref-identifier-completion-table-function
                 (cdr xref-etags-mode--save))))

Add it to find-file-hook, maybe predicated on buffer-file-name.





  reply	other threads:[~2015-01-02 17:52 UTC|newest]

Thread overview: 62+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-29 19:27 bug#19466: 25.0.50; xref-find-def doesn't find C functions Eli Zaretskii
2014-12-30  4:57 ` Dmitry Gutov
2014-12-30 15:31   ` Eli Zaretskii
2014-12-30 18:05     ` Stefan Monnier
2014-12-30 18:25       ` Dmitry Gutov
2014-12-30 18:34         ` Eli Zaretskii
2014-12-30 18:38           ` Dmitry Gutov
2014-12-30 22:44           ` Stefan Monnier
2015-01-02 17:52             ` Dmitry Gutov [this message]
2015-01-04 20:10               ` Stefan Monnier
2015-01-04 20:29                 ` Eli Zaretskii
2015-01-04 23:14                   ` Dmitry Gutov
2015-01-05  3:36                     ` Eli Zaretskii
2015-01-05  6:11                       ` Stefan Monnier
2015-01-16  3:37                       ` Dmitry Gutov
2015-01-16  7:47                         ` martin rudalics
2015-01-16  9:04                           ` Eli Zaretskii
2015-01-16  9:28                             ` martin rudalics
2015-01-19  3:31                           ` Dmitry Gutov
2015-01-19  8:28                             ` martin rudalics
2015-01-19 13:32                               ` Dmitry Gutov
2015-01-20  8:01                                 ` martin rudalics
2015-01-20 12:14                                   ` Dmitry Gutov
2015-01-20 14:51                                     ` martin rudalics
2015-01-21  7:20                                       ` Dmitry Gutov
2015-01-21 10:49                                         ` martin rudalics
2015-01-21 14:24                                           ` Dmitry Gutov
2015-01-21 16:54                                             ` martin rudalics
2015-01-21 18:00                                               ` martin rudalics
2015-01-21 20:02                                                 ` Stefan Monnier
2015-01-22  2:32                                                   ` Dmitry Gutov
2015-01-22 18:22                                                   ` martin rudalics
2015-01-21 19:02                                               ` Dmitry Gutov
2015-01-22  2:26                                               ` Dmitry Gutov
2015-01-22 18:22                                                 ` martin rudalics
2015-01-19 17:41                               ` Eli Zaretskii
2015-01-20  2:54                                 ` Dmitry Gutov
2015-01-20 17:24                                   ` Eli Zaretskii
2015-01-20 20:49                                     ` Dmitry Gutov
2015-01-21 16:25                                       ` Eli Zaretskii
2015-01-22  2:43                                         ` Dmitry Gutov
2015-01-22 18:02                                           ` Eli Zaretskii
2015-01-22 21:02                                             ` Dmitry Gutov
2015-01-23  9:03                                               ` Eli Zaretskii
2015-01-23 17:34                                                 ` Dmitry Gutov
2015-01-23 21:03                                                   ` Eli Zaretskii
2015-01-23 22:23                                                     ` Dmitry Gutov
2015-01-24  9:40                                                       ` Eli Zaretskii
2015-01-24 16:47                                                         ` Dmitry Gutov
2015-01-31  8:52                                                           ` Eli Zaretskii
2015-02-01  2:24                                                             ` Dmitry Gutov
2015-02-01 16:01                                                               ` Eli Zaretskii
2015-02-01 20:11                                                                 ` Dmitry Gutov
2015-02-01 20:30                                                                   ` Eli Zaretskii
2015-02-01 20:53                                                                     ` Dmitry Gutov
2015-02-02  3:32                                                                       ` Eli Zaretskii
2015-02-23  2:01                                                                         ` Dmitry Gutov
2015-01-23 21:15                                                   ` Stefan Monnier
2015-01-23 21:34                                                     ` Eli Zaretskii
2015-01-16  9:00                         ` Eli Zaretskii
2015-01-04 22:14                 ` Dmitry Gutov
2014-12-30 20:43     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54A6DAF6.5070605@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=19466@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).