GNU bug report logs - #21663
Subject: 25.0.50; isearch-edit-string dont resume multi isearches

Previous Next

Package: emacs;

Reported by: Tino Calancha <f92capac <at> gmail.com>

Date: Sun, 11 Oct 2015 04:55:02 UTC

Severity: normal

Tags: patch

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 21663 in the body.
You can then email your comments to 21663 AT debbugs.gnu.org in the normal way.

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#21663; Package emacs. (Sun, 11 Oct 2015 04:55:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Tino Calancha <f92capac <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 11 Oct 2015 04:55:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Subject: 25.0.50; isearch-edit-string dont resume multi isearches
Date: Sun, 11 Oct 2015 13:57:51 +0900 (JST)
[Message part 1 (text/plain, inline)]
Start fresh session:
emacs -Q

C-x C-b
M-x multi-isearch-buffer RET *scratch* RET *Buffer List* RET RET s
(Using C-s several times will search "s" on the two buffers).

M-s e
(Now C-s should keep searching the same string "s" in the two buffers,
 but the string is searched just in the current buffer).
[isearch.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21663; Package emacs. (Mon, 12 Oct 2015 15:23:01 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: 21663 <at> debbugs.gnu.org
Subject: 25.0.50; isearch-edit-string dont resume multi-isearch-files
Date: Tue, 13 Oct 2015 00:25:12 +0900 (JST)
[Message part 1 (text/plain, inline)]
Previous patch would not work for `multi-isearch-files'
because it is not checking `multi-isearch-file-list', so that
`multi-isearch-end' would be called.

We may replace
(if (and nopush edit multi-isearch-buffer-list)
with
(if (and nopush edit (or multi-isearch-buffer-list multi-isearch-file-list))
but just
(if (and nopush edit)
wold work in any situation and its shorter.

[new-patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21663; Package emacs. (Mon, 12 Oct 2015 20:29:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Tino Calancha <f92capac <at> gmail.com>
Cc: 21663 <at> debbugs.gnu.org
Subject: Re: bug#21663: 25.0.50;
 isearch-edit-string dont resume multi-isearch-files
Date: Mon, 12 Oct 2015 23:17:15 +0300
>> Start fresh session:
>> emacs -Q
>>
>> C-x C-b
>> M-x multi-isearch-buffer RET *scratch* RET *Buffer List* RET RET s
>> (Using C-s several times will search "s" on the two buffers).
>>
>> M-s e
>> (Now C-s should keep searching the same string "s" in the two buffers,
>>  but the string is searched just in the current buffer).
>
> Previous patch would not work for `multi-isearch-files'
> because it is not checking `multi-isearch-file-list', so that
> `multi-isearch-end' would be called.
>
> We may replace
> (if (and nopush edit multi-isearch-buffer-list)
> with
> (if (and nopush edit (or multi-isearch-buffer-list multi-isearch-file-list))
> but just
> (if (and nopush edit)
> wold work in any situation and its shorter.

I wonder why ‘isearch-mode-end-hook-quit’ is not initialized as
‘(and nopush edit)’ in the first place?  If it was so, then
you could just check for it in ‘multi-isearch-end’.

But please note that not finishing multi-isearch correctly has such
side effects as e.g. after ‘M-s e’ switching from the minibuffer
to another buffer and starting another ordinary search in it will still
use multi-isearch, etc.  Instead of not finishing multi-isearch,
have you tried to re-initialize multi-isearch on resuming isearch
after exiting from the minibuffer?  (This could be achieved by
remembering its state variables).




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21663; Package emacs. (Tue, 13 Oct 2015 01:33:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: 21663 <at> debbugs.gnu.org
Cc: Tino Calancha <f92capac <at> gmail.com>
Subject: Re: bug#21663: 25.0.50; isearch-edit-string dont resume
 multi-isearch-files
Date: Tue, 13 Oct 2015 10:35:31 +0900 (JST)
[Message part 1 (text/plain, inline)]
> I wonder why ‘isearch-mode-end-hook-quit’ is not initialized as
> ‘(and nopush edit)’ in the first place?  If it was so, then
> you could just check for it in ‘multi-isearch-end’.

My understanding about that variable (i may be wrong) is that is should
be non nil just when the user quit the search with
C-g
we dont want this variable being non nil in the case of editing the string
with the idea to resume the same kind of search.

> have you tried to re-initialize multi-isearch on resuming isearch
> after exiting from the minibuffer?  (This could be achieved by
> remembering its state variables).

I like your proposal: this way is more consistent with the original code.
See attached new patch.
[isearch_3.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21663; Package emacs. (Tue, 13 Oct 2015 05:16:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: 21663 <at> debbugs.gnu.org
Cc: Tino Calancha <f92capac <at> gmail.com>
Subject: 25.0.50; isearch-edit-string dont resume multi isearches
Date: Tue, 13 Oct 2015 14:18:25 +0900 (JST)
[Message part 1 (text/plain, inline)]
In previous patch (isearch_3.patch) the variables are not
restored because they were bind to the same symbol name, and
multi-isearch-end will set them to nil.

In addition, multi-isearch-end need to be added again to 
isearch-mode-end-hook, otherwise, even after exiting with C-g, C-s will 
start a multisearch instead of a normal isearch in the current buffer.

See attached patch: isearch_4.patch
[isearch_4.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21663; Package emacs. (Tue, 13 Oct 2015 22:07:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Tino Calancha <f92capac <at> gmail.com>
Cc: 21663 <at> debbugs.gnu.org
Subject: Re: bug#21663: 25.0.50;
 isearch-edit-string dont resume multi isearches
Date: Wed, 14 Oct 2015 01:04:29 +0300
> In previous patch (isearch_3.patch) the variables are not
> restored because they were bind to the same symbol name, and
> multi-isearch-end will set them to nil.

Thanks, it's a safer approach to restore them explicitly.

> In addition, multi-isearch-end need to be added again to
> isearch-mode-end-hook, otherwise, even after exiting with C-g, C-s will
> start a multisearch instead of a normal isearch in the current buffer.

To avoid the need to add multi-isearch-end to isearch-mode-end-hook,
you could try to restore saved variables before calling isearch-mode.
Then multi-isearch-setup called from isearch-mode should take care of
adding multi-isearch-end to isearch-mode-end-hook when necessary
variables are already restored, i.e. when you save the variable
multi-isearch-next-buffer-function instead of
multi-isearch-next-buffer-current-function.  But OTOH
multi-isearch-current-buffer still needs to be restored after
isearch-mode in the same place where you already added it in your patch.
This way restarting isearch will emulate binding local variables
multi-isearch-next-buffer-function and multi-isearch-buffer-list in
multi-isearch-buffers before starting multi-buffer search.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21663; Package emacs. (Wed, 14 Oct 2015 06:46:02 GMT) Full text and rfc822 format available.

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

From: Tino Calancha <f92capac <at> gmail.com>
To: 21663 <at> debbugs.gnu.org
Subject: Re: bug#21663: 25.0.50; isearch-edit-string dont resume multi
 isearches
Date: Wed, 14 Oct 2015 15:48:22 +0900 (JST)
[Message part 1 (text/plain, inline)]
Thank you Juri for your help on this.

I have tested the attached patch (isearch-5.patch)
with `multi-isearch-buffers'/`multi-isearch-files': it seems
OK now.

< To avoid the need to add multi-isearch-end to isearch-mode-end-hook,
< you could try to restore saved variables before calling isearch-mode.
< Then multi-isearch-setup called from isearch-mode should take care of
< adding multi-isearch-end to isearch-mode-end-hook when necessary
< variables are already restored, i.e. when you save the variable
< multi-isearch-next-buffer-function instead of
< multi-isearch-next-buffer-current-function.
I got the point. Actually I bind multi-isearch-next-buffer-function
to multi-isearch-next-buffer-current-function, because the former was nil
and multi-isearch-setup makes a non-nil test for this variable at the
beginning


< multi-isearch-current-buffer still needs to be restored after
< isearch-mode in the same place where you already added it in your patch.
OK.
[isearch-5.patch (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#21663; Package emacs. (Wed, 14 Oct 2015 16:31:02 GMT) Full text and rfc822 format available.

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

From: Juri Linkov <juri <at> linkov.net>
To: Tino Calancha <f92capac <at> gmail.com>
Cc: 21663 <at> debbugs.gnu.org
Subject: Re: bug#21663: 25.0.50;
 isearch-edit-string dont resume multi isearches
Date: Wed, 14 Oct 2015 19:17:30 +0300
Thank you Tino, I have tested your patch and it works OK,
so please commit it.




Reply sent to Juri Linkov <juri <at> linkov.net>:
You have taken responsibility. (Sat, 04 Jun 2016 22:09:03 GMT) Full text and rfc822 format available.

Notification sent to Tino Calancha <f92capac <at> gmail.com>:
bug acknowledged by developer. (Sat, 04 Jun 2016 22:09:03 GMT) Full text and rfc822 format available.

Message #31 received at 21663-done <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: 21663-done <at> debbugs.gnu.org
Subject: Re: bug#21663: 25.0.50;
 isearch-edit-string dont resume multi isearches
Date: Sun, 05 Jun 2016 01:06:55 +0300
> Lars Ingebrigtsen wrote:
>
>> Thanks; I've now applied this to the trunk.  Seems to be working great,
>> and it's a feature I've missed for years.
>
> Was a copyright assignment ever completed?
> I don't see one on file.
>
> http://debbugs.gnu.org/21684#14
>
> Juri Linkov wrote:
>
>> Have you already signed FSF copyright assignment papers?
>>
>> Your patch for bug#21663 is short enough to be installed without the
>> copyright paperwork, but your changes for bug#21684 require it.

Thanks for the reminder.  This is now installed (required merging
with other changes in the same function).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 03 Jul 2016 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 358 days ago.

Previous Next


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