From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Bob Floyd" Newsgroups: gmane.emacs.bugs Subject: bug#45617: loses the edit region. Works in 23.3, broke in 26.3 Date: Wed, 20 Jan 2021 15:23:00 -0800 Message-ID: <000401d6ef83$32407e50$96c17af0$@net> References: <000001d6e16c$984bcb70$c8e36250$@net> <83turycc18.fsf@gnu.org> <87ble4ob6v.fsf@mail.linkov.net> <000601d6e2ea$8f6601e0$ae3205a0$@net> <877dorkznt.fsf@mail.linkov.net> <002701d6e39b$4ac35680$e04a0380$@net> <8735ze9e09.fsf@mail.linkov.net> <83mtxm0vzd.fsf@gnu.org> <002d01d6e478$ca50cdf0$5ef269d0$@net> <87k0sgirr0.fsf@mail.linkov.net> <002101d6eadc$e816a070$b843e150$@net> <87k0sezj07.fsf@mail.linkov.net> <000c01d6eb68$f3f675f0$dbe361d0$@net> <877do8eull.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36033"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 45617@debbugs.gnu.org To: "'Juri Linkov'" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jan 21 00:25:32 2021 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 1l2Mqx-0009H3-Ul for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 21 Jan 2021 00:25:32 +0100 Original-Received: from localhost ([::1]:34184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l2Mqx-0003h7-1O for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 20 Jan 2021 18:25:31 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36064) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l2MpW-0001WN-RD for bug-gnu-emacs@gnu.org; Wed, 20 Jan 2021 18:24:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:44902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l2MpW-00061v-IA for bug-gnu-emacs@gnu.org; Wed, 20 Jan 2021 18:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l2MpW-0005DM-CK for bug-gnu-emacs@gnu.org; Wed, 20 Jan 2021 18:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: "Bob Floyd" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 20 Jan 2021 23:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45617 X-GNU-PR-Package: emacs Original-Received: via spool by 45617-submit@debbugs.gnu.org id=B45617.161118498919984 (code B ref 45617); Wed, 20 Jan 2021 23:24:02 +0000 Original-Received: (at 45617) by debbugs.gnu.org; 20 Jan 2021 23:23:09 +0000 Original-Received: from localhost ([127.0.0.1]:56448 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2Mof-0005CG-Fk for submit@debbugs.gnu.org; Wed, 20 Jan 2021 18:23:09 -0500 Original-Received: from resqmta-po-12v.sys.comcast.net ([96.114.154.171]:54691) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l2Moe-0005C0-6j for 45617@debbugs.gnu.org; Wed, 20 Jan 2021 18:23:08 -0500 Original-Received: from resomta-po-03v.sys.comcast.net ([96.114.154.227]) by resqmta-po-12v.sys.comcast.net with ESMTP id 2MEwl3Tk4sJ0M2MoYltrAa; Wed, 20 Jan 2021 23:23:02 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1611184982; bh=FAHyakSAssaHCTQkXBLz9ewy01yZ/9SWJgtdugjXGcM=; h=Received:Received:From:To:Subject:Date:Message-ID:MIME-Version: Content-Type; b=Go+uupU+egxCQDmBsXQF4+gHVz0K+jhHbSO/L/LNsX2UiltkVSM4MwEQUCzW5Kbav BbgJu2Rvdv7gUXTmDDWVe4xmkEmUpq5LEeIUmGO2vCqTmBmzbbi8Nqly9asYJt0gx8 LkT1K+QcANOUjo2t6dDe8ZlSaHEDOE/pwDCa1Sp8yZSWkE0rK01TRFLtyQMcTNEfdY BHc4/KUpiiyFa/iBqitiYM/uGno7VznFJ8yGTZyeT8W/hsW1WrRfBO+w82V9S+Y4WR HgrCl1OMEsidB0ohGCFY7NsDxUaBbXumnV6NzQ0DtseisMPGW1rU8kGY7xBd3dshNq 9CjyJeI8NhFVw== Original-Received: from Cache ([IPv6:2601:647:6100:1480::5a21]) by resomta-po-03v.sys.comcast.net with ESMTPA id 2MoWlQ2xtjnlV2MoXllrYN; Wed, 20 Jan 2021 23:23:01 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit In-Reply-To: <877do8eull.fsf@mail.linkov.net> X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: AdbujMV6VnrkSH4mQVi4/sj4pC/NNwA87+Ng Content-Language: en-us 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" Xref: news.gmane.io gmane.emacs.bugs:198304 Archived-At: Sorry, sorry, my bad. Ignore my last email! I'm now using the last version: ---------------------------------------------------- (defun query-replace-read-args (prompt regexp-flag &optional noerror) (unless noerror (barf-if-buffer-read-only)) (save-mark-and-excursion (let* ((from (query-replace-read-from prompt regexp-flag)) (to (if (consp from) (prog1 (cdr from) (setq from (car from))) (query-replace-read-to from prompt regexp-flag)))) (list from to (or (and current-prefix-arg (not (eq current-prefix-arg '-))) (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) (get-text-property 0 'isearch-regexp-function from))) (and current-prefix-arg (eq current-prefix-arg '-)))))) ---------------------------------------------------- And this test: ----------------------------------------------------- void DHroot::ModuleToGoverningParamsets:: Insert (IObj const& _iDfnGoverned, IObj const& _iBDHparamset) { std::pair _pr ( TBase::Insert( _iDfnGoverned, ParamsetsGoverningModule() ) ); ParamsetsGoverningModule& _prmsets( (*_pr.first).second ); _prmsets.Insert( _iBDHparamset, Unused() ); } ---------------------------------------------------- Do this: 1. Select entire region by dragging left mouse down from the BOTTOM to the TOP. 2. Begin In the command window: Query replace in region: 3. Double left mouse click on "_iDfnGoverned" at line 4 to select it: (IObj const& _iDfnGoverned <---THIS ONE , IObj const& _iBDHparamset) 4. middle mouse click in the command window to insert, then enter: Query replace in region: _iDfnGoverned with: Notice the selection region changes to lines 1-4 and is never restored. 5. middle mouse click in the command window to insert it again and edit: Query replace in region _iDfnGoverned with: _iBDHdfnGoverned 6. Enter Nothing happens! Middle mouse click: mouse-yank-at-click Hope you can reproduce this!!! -----Original Message----- From: Juri Linkov [mailto:juri@linkov.net] Sent: Tuesday, January 19, 2021 9:44 AM To: Bob Floyd Cc: 'Eli Zaretskii'; 45617@debbugs.gnu.org Subject: Re: bug#45617: loses the edit region. Works in 23.3, broke in 26.3 > I'm having an issue with the new patch. fails! Sorry, I tried your test case, but can't reproduce the problem. > 1. Select entire region by dragging mouse. > 2. Begin > In the command window: Query replace in region: > 3. Enter RL using the keyboard > In the command window: Query replace in region RL with: > 4. Now, with the mouse, select RL at line 12 ... > paramset P2 RL; <--- THIS ONE > ... then yank it to the command window and with keyboard enter X: The most important line of your test case is the line above, but I don't understand what you mean by yanking the selected text. I tried to drag the selected text "RL" to the minibuffer window, as all other apps allow to do, but Emacs fails to do the same. Please help to clarify how do you yank the selected text. > In the command window: Query replace in region RL with: RLX > 5. Enter > Only one of the two RL's in the region are selected, depending on > if the region was selected from top-to-bottom or bottom-to-top. > > It should select both RL's! It selects both RL's when I tried. > Just in case I misread the diff, this is the function as I have manually > patched it: > > (defun query-replace-read-args (prompt regexp-flag &optional noerror) > (unless noerror > (barf-if-buffer-read-only)) > (save-mark-and-excursion > (let* ((from (query-replace-read-from prompt regexp-flag)) > (to (if (consp from) (prog1 (cdr from) (setq from (car from))) > (query-replace-read-to from prompt regexp-flag)))) > (or (and current-prefix-arg (not (eq current-prefix-arg '-))) > (and (plist-member (text-properties-at 0 from) > 'isearch-regexp-function) > (get-text-property 0 'isearch-regexp-function from))) > (list from to > (and current-prefix-arg (not (eq current-prefix-arg '-))) > (and current-prefix-arg (eq current-prefix-arg '-)))))) This function is very much messed up. Please try the function below: (defun query-replace-read-args (prompt regexp-flag &optional noerror) (unless noerror (barf-if-buffer-read-only)) (save-mark-and-excursion (let* ((from (query-replace-read-from prompt regexp-flag)) (to (if (consp from) (prog1 (cdr from) (setq from (car from))) (query-replace-read-to from prompt regexp-flag)))) (list from to (or (and current-prefix-arg (not (eq current-prefix-arg '-))) (and (plist-member (text-properties-at 0 from) 'isearch-regexp-function) (get-text-property 0 'isearch-regexp-function from))) (and current-prefix-arg (eq current-prefix-arg '-))))))