unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Anders Lindgren <andlind@gmail.com>
Cc: 23179@debbugs.gnu.org
Subject: bug#23179: 25.0.92; Restore `M-,' to continue etags search
Date: Sun, 3 Apr 2016 23:59:49 +0300	[thread overview]
Message-ID: <8c1fc5c4-1f80-b889-3f16-55673836ed13@yandex.ru> (raw)
In-Reply-To: <CABr8ebZPvBj-ruJMRziPfbmcaZpNBGf9rMiyavZn_AGii9oiDQ@mail.gmail.com>

On 04/03/2016 09:32 PM, Anders Lindgren wrote:

> Ideally, xref should define a regexp search command that work with all
> backends. The only thing tags-specific in your code is getting the list
> of files -- if you would expand the xref backend interface with a
> corresponding function it would work with all backends.

I'm still waiting for the specification, including a reply to 
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23179#47.

> I would suggest that xref should provide two kinds of searches:
> one incremental (like `tags-search') and one `find-all' (like the
> provided function).

Patch welcome, I suppose, but the current API is not amenable to such 
usage, so see below (++).

> * The xref UI window is not updated to reflect the current location. For
> example, in a *grep* buffer, the cursor move and an arrow in the left
> fringe reflect the current location.

Not updated when? When you call `next-error'? I imagine that's something 
to implement in that facility, then, so that every other mode 
implementing next-error-function benefits.

> * I like the touch that the matches in the *xref* buffer are syntax
> highlighted. Unfortunately, not all matches are highlighted. It appears
> as though only matches in previously viewed parts of source files retain
> syntax highlighting.

Only those already visited by font-lock, yes.

> * `next-error' issued from an *xref* search don't reuse the source
> windows (whereas a `next-error' issued from a grep buffer does).
> * `next-error' in ChangeLog buffers cause Emacs to go to the
> corresponding change. This makes it hard to step past irrelevant xref
> matches if they occur a ChangeLog file.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20489
http://debbugs.gnu.org/cgi/bugreport.cgi?bug=20493

Help welcome.

> +++ Using "etags *.h *.m *.c" in the Emacs "src" directory,
> `(tags-search "nstrace")' find the first occurrence in 0.7 seconds,
> whereas the new `tags-find-regexp' takes over 8 seconds to perform a
> full search.

The previous UI has pathological cases as well. Take e.g. some project 
where "xyz" only occurs in the last file among those listed in TAGS. 
Searching through all of those, by opening each one in Emacs in 
sequence, with re-search-forward, is surely slower that using Grep.

On the other hand, yes, the fact that the matches don't appear as soon 
as they're available, is a problem. Could you open a separate bug for that?

(++)

If your sole goal is to implement an incremental search UI, I fear the 
change to the xref API will become needlessly complex.

I think we should be able to extend the API to return some concurrency 
data structure, like a generator, using generator.el. I haven't 
investigated that yet (+++), and I'd welcome someone else taking the charge.

(+++) Is is feasible to turn Grep output into a generator? Is the result 
easy to render in an xref buffer, while indicating that the search is 
not yet done? Is the generator's overhead small enough in most cases?

>> xref-query-replace-in-results
>
> This is not quite true. `tags-query-replace' do an incremental search
> and replace in the source files referred to by a tags file directly.

The word "equivalent" doesn't necessarily imply the same UI.

> `xref-query-replace-in-results' requires a user to first do a search (to
> get stuff into the xref buffer), then run the command to replace. It
> sounds very awkward to me.

It looks very natural to me. And considering it handles different result 
sets, in the end you have N+1 command, rather than 2N commands, for N 
kinds things to search in.

> In other words, I would prefer if we would add an incremental xref
> query-replace command along the lines I suggested for the search command
> above.

It would need to know where to get the matches from. Or you'll end with 
N new query-replace commands, just like we have now (tags-query-replace, 
dired-do-query-replace-regexp, etc).

> Finally, if all the tags commands should be made obsolete, their
> documentations should be updated with references to the commands that
> are intended to replace them.

We do that with "(declare (obsolete ...".





  parent reply	other threads:[~2016-04-03 20:59 UTC|newest]

Thread overview: 106+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-01  8:55 bug#23179: 25.0.92; Restore `M-,' to continue etags search Anders Lindgren
2016-04-01  9:02 ` Dmitry Gutov
2016-04-01 10:35   ` Anders Lindgren
2016-04-01 11:03     ` Eli Zaretskii
2016-04-01 23:44       ` Dmitry Gutov
2016-04-02  6:58         ` Eli Zaretskii
2016-04-02 23:39           ` Dmitry Gutov
2016-04-03 15:32             ` Eli Zaretskii
2016-04-03 17:21               ` Dmitry Gutov
2016-04-03 17:28                 ` Eli Zaretskii
2016-04-03 18:32             ` Anders Lindgren
2016-04-03 18:42               ` Eli Zaretskii
2016-04-03 18:49                 ` Anders Lindgren
2016-04-03 18:59                   ` Eli Zaretskii
2016-04-03 19:11                     ` Anders Lindgren
2016-04-03 19:15                       ` Eli Zaretskii
2016-04-03 20:15                         ` Andy Moreton
2016-04-04  2:46                           ` Eli Zaretskii
2016-04-04  8:46                             ` Andy Moreton
2016-04-04 14:57                               ` Eli Zaretskii
2016-04-03 20:30                         ` Anders Lindgren
2016-04-04  2:48                           ` Eli Zaretskii
2016-04-04  4:22                             ` Anders Lindgren
2016-04-04 15:49                               ` Eli Zaretskii
2016-04-04 16:53                                 ` Dmitry Gutov
2016-04-05 15:12                                   ` Eli Zaretskii
2016-04-05 15:27                                     ` Dmitry Gutov
2016-04-05 15:56                                       ` Eli Zaretskii
2016-04-05 16:00                                         ` Dmitry Gutov
2016-04-05 16:18                                           ` Eli Zaretskii
2016-04-05 17:40                                             ` Dmitry Gutov
2016-04-05 18:10                                               ` John Wiegley
2016-04-05 18:12                                                 ` Dmitry Gutov
2016-04-05 19:32                                                   ` John Wiegley
2016-04-05 20:34                                                     ` Dmitry Gutov
2016-04-06  0:55                                                       ` John Wiegley
2016-04-06 10:23                                                         ` Dmitry Gutov
2016-04-05 19:23                                               ` Eli Zaretskii
2016-04-05 20:19                                                 ` Dmitry Gutov
2016-04-08  8:17                                     ` Eli Zaretskii
2016-04-08  8:56                                       ` Anders Lindgren
2016-04-08  9:18                                         ` Eli Zaretskii
2016-04-08 10:28                                           ` Anders Lindgren
2016-04-08 10:32                                             ` Eli Zaretskii
2016-04-08 10:38                                               ` Dmitry Gutov
2016-04-08 10:53                                               ` Anders Lindgren
2016-04-08 13:13                                                 ` Dmitry Gutov
2016-04-09  7:40                                                 ` Eli Zaretskii
2016-04-03 19:36               ` Eli Zaretskii
2016-04-03 20:59               ` Dmitry Gutov [this message]
2016-04-03 22:44                 ` John Wiegley
2016-04-03 23:00                   ` Dmitry Gutov
2016-04-04  8:43                 ` Anders Lindgren
2016-04-04 10:41                   ` Dmitry Gutov
2016-04-04 16:58                     ` Anders Lindgren
2016-04-04 17:25                       ` Dmitry Gutov
2016-04-04 17:54                         ` Eli Zaretskii
2016-04-04 20:19                           ` Dmitry Gutov
2016-04-04 17:47                       ` Eli Zaretskii
2016-04-05  5:43                     ` Anders Lindgren
2016-04-05 12:54                       ` Dmitry Gutov
2016-04-05 14:41                         ` Eli Zaretskii
2016-04-05 15:30                           ` Dmitry Gutov
2016-04-05 15:57                             ` Eli Zaretskii
2016-04-04  8:54                 ` Anders Lindgren
2016-04-04 10:46                   ` Dmitry Gutov
2016-04-04 15:03                     ` Eli Zaretskii
2016-04-04 15:00                   ` Eli Zaretskii
2016-04-01 23:48     ` Dmitry Gutov
2019-04-01  6:40   ` pklammer
2019-04-01  9:36     ` Eli Zaretskii
2019-04-02 14:47       ` pklammer
2019-04-02 15:20         ` Eli Zaretskii
2019-04-02 15:35           ` Dmitry Gutov
2019-04-06 21:12             ` Juri Linkov
2019-04-07  0:38               ` Dmitry Gutov
2019-04-07 20:27                 ` Juri Linkov
2019-04-07 23:07                   ` Dmitry Gutov
2019-04-08 19:55                     ` Juri Linkov
2019-04-08 23:34                       ` Dmitry Gutov
2019-04-11 20:40                 ` Juri Linkov
2019-04-12  1:11                   ` Dmitry Gutov
2019-04-13 21:57                     ` Juri Linkov
2019-04-14 12:52                       ` Dmitry Gutov
2019-04-14 19:55                         ` Juri Linkov
2019-04-14 21:41                           ` Dmitry Gutov
2019-04-24 20:33                 ` Juri Linkov
2019-04-24 23:31                   ` Dmitry Gutov
2019-04-29 19:32                     ` Juri Linkov
2016-04-01  9:23 ` Eli Zaretskii
2016-04-01 10:13   ` Anders Lindgren
2016-04-01 10:59     ` Eli Zaretskii
2016-04-02 19:46       ` Anders Lindgren
2016-04-02 19:58         ` Eli Zaretskii
2016-04-02 21:42         ` John Wiegley
2016-04-02 22:28           ` Dmitry Gutov
2016-04-03 17:31             ` John Wiegley
2016-04-03 17:40               ` Dmitry Gutov
2016-04-03 18:04                 ` John Wiegley
2016-04-03 18:10                   ` Dmitry Gutov
2016-04-04  2:39                   ` Eli Zaretskii
2016-04-03 18:22               ` Eli Zaretskii
2016-04-02 22:54         ` Dmitry Gutov
2016-04-04  8:21           ` Anders Lindgren
2016-04-04 11:00             ` Dmitry Gutov
2020-08-24 18:18 ` Lars Ingebrigtsen

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=8c1fc5c4-1f80-b889-3f16-55673836ed13@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=23179@debbugs.gnu.org \
    --cc=andlind@gmail.com \
    /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).