unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@jurta.org>
To: "Tobias C. Rittweiler" <tcr@freebits.de>
Cc: 4947@emacsbugs.donarmstrong.com
Subject: bug#4947: Comments on misearch.el
Date: Mon, 30 Nov 2009 23:45:43 +0200	[thread overview]
Message-ID: <87ljhng0gg.fsf@mail.jurta.org> (raw)
In-Reply-To: <87my2lj8wj.fsf@freebits.de> (Tobias C. Rittweiler's message of "Tue, 17 Nov 2009 19:36:28 +0100")

> I just tried misearch.el which provides the ability to search through
> multiple files / buffers via isearch. Thank you, Juri, for writing it,
> it's exactly what I need.
>
> I do have some comments on it:
>
>   * The docstring of `multi-isearch-next-buffer-function' says that the
>     function is called with the current buffer as first argument.
>
>     However, in case of the initial buffer, it's actually called with
>     `nil' as first argument.
>
>    Is that intended? If so, the docstring should reflect that.
>    I now have in my next-buffer function
>
>      (setq current-buffer (or current-buffer (current-buffer)))
>
>    as a workaround.

Thanks for the suggestion.  I fixed `multi-isearch-next-buffer-function'
to always provide a non-nil value of the argument `buffer'.

>   * It'd be nice, not only to display "Repeat for next buffer", but
>     actually include the next buffer's name.

I see two problems with this:

1. A buffer name might be too long to display in the prompt.

2. To get a buffer name, we should preemptively call
`multi-isearch-next-buffer-function' that might break it
if this function expects that we call it only when we really
are going to switch to the next buffer (not just to get and
display its name).

> There's another wishlist item, though it's not that important: I'd like
> to see a small buffer pop up which contains all the files we're going to
> search through, and highlight where we currently are.

`list-buffers' (`C-x C-b') already allows selecting buffers to Isearch.
So we could mark the currently searched buffer in the *Buffer List*.

>   * If I'm in a file that contains matches, and I'm at the last match,
>     it exhibits the following behaviour in the minibuffer:
>
>       Multi Isearch: ...                         (pressing C-s)
>
>       Failing multi Isearch: ... [Repeat ...]    (pressing C-s)
>
>       jumps to first match in next buffer
>
>    However, if I'm in a buffer that won't have a match, I see the
>    following behaviour:
>
>       Multi Isearch: ..(incremently typing)..    --> turns to
>       Failing multi Isearch: ... [Repeat ...]    (pressing C-s)
>
>       Failing multi Isearch: ...                 (pressing C-s)
>
>       goes to next file
>
>    I.e., as you can hopefully see, it expects one C-s too much. (The
>    line without the "[Repeat ...]" is superfluous.)

Actually this is the intended behaviour.

The first

      Failing multi Isearch: ... [Repeat ...]    (pressing C-s)

says "There are no more matches in the current buffer, try to search
in the next buffer".

And the second

      Failing multi Isearch: ...                 (pressing C-s)

says "I've tried to search all buffers and there are no more matches
in all remaining buffers".

And

      goes to next file

actually wraps to the first file/buffer.

-- 
Juri Linkov
http://www.jurta.org/emacs/





  reply	other threads:[~2009-11-30 21:45 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-17 18:36 bug#4947: Comments on misearch.el [repost from emacs-devel] Tobias C. Rittweiler
2009-11-30 21:45 ` Juri Linkov [this message]
2021-06-03  9:30   ` Lars Ingebrigtsen
2021-06-03 20:24     ` Juri Linkov

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=87ljhng0gg.fsf@mail.jurta.org \
    --to=juri@jurta.org \
    --cc=4947@emacsbugs.donarmstrong.com \
    --cc=tcr@freebits.de \
    /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).