From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#71927: 29.4; ibuffer-do-isearch and ibuffer-do-isearch-regexp not prompting for input Date: Sat, 06 Jul 2024 23:13:27 +0200 Message-ID: References: <86ikxltzhx.fsf@mail.linkov.net> <861q49a8vt.fsf@gnu.org> <86y16h8olf.fsf@gnu.org> <878qyh79ov.fsf@gmx.net> <86zfqxqi6e.fsf@mail.linkov.net> <87v81l5aal.fsf@gmx.net> <864j9581zr.fsf@gnu.org> <87r0c957v2.fsf@gmx.net> <86y16h6llv.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37257"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: basil@contovou.net, Stephen Berman , 71927@debbugs.gnu.org, kickingvegas@gmail.com, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jul 07 08:27:24 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sQLMq-0009Rg-1P for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 07 Jul 2024 08:27:24 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQLMR-0001p4-Nx; Sun, 07 Jul 2024 02:26:59 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sQLMQ-0001mm-11 for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2024 02:26:58 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sQLMP-0006Hn-PO for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2024 02:26:57 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sQLMT-0004nY-Pq for bug-gnu-emacs@gnu.org; Sun, 07 Jul 2024 02:27:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 07 Jul 2024 06:27:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71927 X-GNU-PR-Package: emacs Original-Received: via spool by 71927-submit@debbugs.gnu.org id=B71927.172033361818433 (code B ref 71927); Sun, 07 Jul 2024 06:27:01 +0000 Original-Received: (at 71927) by debbugs.gnu.org; 7 Jul 2024 06:26:58 +0000 Original-Received: from localhost ([127.0.0.1]:47155 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQLMP-0004nF-IR for submit@debbugs.gnu.org; Sun, 07 Jul 2024 02:26:58 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:58900 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sQLMM-0004n6-TN for 71927@debbugs.gnu.org; Sun, 07 Jul 2024 02:26:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1720333610; bh=Yk3yQ2994TTbdDAHVAEtOICJi3YHfzrEW3cS3cpw6nM=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FHr+jNZLQgcJWAvIzvvyAUObCkXSWoTuwVxTYCMxTc3sz3RR5VKR/RxF1YQMVMhOd 9zmS5rUMa24W5fYlPudYR6TPWbjZ5PjuDYN5h+9HKSrSZ/VdytaG4JD09V7OumybIE abEs6pCcG4XybiwAThVFqVlbpruMLw7eJAobCQs7A8UEGPuqktjrnJQNZdbifc75gO JbBmZgALXSstAi/7s6voKsXmaBRmBwZd/bp+GyAsJQVhwzKhbCjOhPLFu9jJ1qMkci ynTJMe6eZ5WIxV1fK9d213+2+Ch52lu1GsYdJhGKTGq45Gu1bx795nov64QH7BL7bM 0G1C5JaefzrQw== In-Reply-To: <86y16h6llv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 04 Jul 2024 21:46:52 +0300") X-Hashcash: 1:20:240706:eliz@gnu.org::tfqlHYmJvMswePnZ:7UF X-Hashcash: 1:20:240706:juri@linkov.net::0AlXocfR3DwmS+BF:0KYD X-Hashcash: 1:20:240706:kickingvegas@gmail.com::Ygth+f50JNhhv2D8:n9j X-Hashcash: 1:20:240706:71927@debbugs.gnu.org::LdevNyYXA1VGLmfc:2RGm X-Hashcash: 1:20:240706:basil@contovou.net::UTrLWnlb8eo124TN:1w4o X-Hashcash: 1:20:240706:stephen.berman@gmx.net::Ae3nc8rbjt0qIk3y:5Zla X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:288542 Archived-At: Eli Zaretskii writes: >> From: Stephen Berman >>=20 >> On Thu, 04 Jul 2024 21:07:36 +0300 Eli Zaretskii wrote: >>=20 >> >> From: Stephen Berman >> >> Cc: Eli Zaretskii , Eshel Yaron , >> >> kickingvegas@gmail.com, 71927@debbugs.gnu.org, basil@contovou.net, >> >> jpw@gnu.org >> >> Date: Thu, 04 Jul 2024 19:36:34 +0200 >> >> >> >> On Thu, 04 Jul 2024 19:04:42 +0300 Juri Linkov wrot= e: >> >> >> >> >>>> FWIW, AFAICT everything is working correctly, it's just that the >> >> >>>> "Operation finished" message hides the prompt. ibuffer-do-isear= ch >> >> >>>> should tell define-ibuffer-op not to display that message, someh= ow. >> >> >>> >> >> >>> I don't see how this could be considered "correct": the "Operation >> >> >>> finished" message is supposed to be shown only after the Isearch = is >> >> >>> finished in all the marked buffer, not before. It looks like we = need >> >> >>> a function that will not return until all the buffers where searc= hed, >> >> >>> because that's what define-ibuffer-op expects. Don't you agree? >> >> > >> >> > It intentionally uses 'no-recursive-edit' set to t, so ibuffer-do-i= search >> >> > correctly exits immediately while leaving isearch-mode enabled. >> >> > >> >> >> The attached patch appears to DTRT, but I only tested it briefly. >> >> >> ... >> >> >> (define-ibuffer-op ibuffer-do-isearch () >> >> >> "Perform a `isearch-forward' in marked buffers." >> >> >> (:interactive () >> >> >> - :opstring "searched in" >> >> >> + :no-opstring t >> >> > >> >> > Thanks for the patch. I confirm this is the right thing to do. >> >> > Maybe instead of :no-opstring would be better to use some special v= alue >> >> > like :opstring 'no? But I'm not sure if this is better than :no-op= string. >> >> >> >> Suppressing the message when :opstring has the value 'no is fine with >> >> me. If Eli is willing to accept this approach, I can go ahead and >> >> commit it (to master, presumably, since this is a longstanding issue). >> > >> > I already said this didn't sound the right solution here, and I >> > explained why. I'd be interested in hearing counter-arguments, if >> > there are any. >>=20 >> I gave a mild counterargument upthread, that making >> ibuffer-do-isearch{-regexp} defuns independent of define-ibuffer-op >> seems like accepting the inadequacy of the latter instead of trying to >> improve it. > > It is indeed inadequate for commands that just put Emacs in a special > state and return, as opposed to commands that don't return before they > did the complete job of operating on the marked buffers. Actually, there's another problem with the way ibuffer-do-isearch is currently defined via define-ibuffer-op: the BODY of the definition is a call to multi-isearch-buffers, but the BODY is called for each marked buffer, not once for all of them, so this command currently calls multi-isearch-buffers repeatedly when there are multiple marked buffers. This causes multi-isearch-setup to be called while multi-buffer Isearch is already in progress, which unfortunately breaks regular Isearch for the rest of the session. To see this effect, invoke ibuffer-do-isearch with two or more marked buffers, quit or finish the search (e.g. type C-g), and then try regular Isearch with C-s and repeat C-s until wrapping around. But instead of wrapping around as expected, Emacs displays an error: Symbol=E2=80=99s function definition is void: nil A simple solution is to use plain defun for these commands, as follows: diff --git a/lisp/ibuf-ext.el b/lisp/ibuf-ext.el index 95ff014aa5b..33b68b96ff2 100644 --- a/lisp/ibuf-ext.el +++ b/lisp/ibuf-ext.el @@ -594,22 +594,16 @@ revert :modifier-p :maybe) (revert-buffer t t)) =20 -;;;###autoload (autoload 'ibuffer-do-isearch "ibuf-ext") -(define-ibuffer-op ibuffer-do-isearch () +;;;###autoload +(defun ibuffer-do-isearch () "Perform a `isearch-forward' in marked buffers." - (:interactive () - :opstring "searched in" - :complex t - :modifier-p :maybe) + (interactive "" ibuffer-mode) (multi-isearch-buffers (ibuffer-get-marked-buffers))) =20 -;;;###autoload (autoload 'ibuffer-do-isearch-regexp "ibuf-ext") -(define-ibuffer-op ibuffer-do-isearch-regexp () +;;;###autoload +(defun ibuffer-do-isearch-regexp () "Perform a `isearch-forward-regexp' in marked buffers." - (:interactive () - :opstring "searched regexp in" - :complex t - :modifier-p :maybe) + (interactive "" ibuffer-mode) (multi-isearch-buffers-regexp (ibuffer-get-marked-buffers))) =20 ;;;###autoload (autoload 'ibuffer-do-replace-regexp "ibuf-ext")