From unknown Sat Aug 16 20:57:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#14637 <14637@debbugs.gnu.org> To: bug#14637 <14637@debbugs.gnu.org> Subject: Status: recent viper-mode regression Reply-To: bug#14637 <14637@debbugs.gnu.org> Date: Sun, 17 Aug 2025 03:57:11 +0000 retitle 14637 recent viper-mode regression reassign 14637 emacs submitter 14637 Jim Meyering severity 14637 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sun Jun 16 19:00:14 2013 Received: (at submit) by debbugs.gnu.org; 16 Jun 2013 23:00:14 +0000 Received: from localhost ([127.0.0.1]:49084 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UoLvh-0002Kh-0M for submit@debbugs.gnu.org; Sun, 16 Jun 2013 19:00:13 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39839) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UoLvb-0002Jg-4h for submit@debbugs.gnu.org; Sun, 16 Jun 2013 19:00:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoLvU-00086A-Qe for submit@debbugs.gnu.org; Sun, 16 Jun 2013 19:00:01 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-101.9 required=5.0 tests=BAYES_00, USER_IN_WHITELIST autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36243) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoLvU-000866-NC for submit@debbugs.gnu.org; Sun, 16 Jun 2013 19:00:00 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41558) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoLvT-0003gD-GR for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2013 19:00:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoLvS-00085c-Ng for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2013 18:59:59 -0400 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51631) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoLvS-00085Y-Kz for bug-gnu-emacs@gnu.org; Sun, 16 Jun 2013 18:59:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37475) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1UoLvS-0001g6-Bw for bug-emacs@gnu.org; Sun, 16 Jun 2013 18:59:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UoLvR-00085E-EZ for bug-emacs@gnu.org; Sun, 16 Jun 2013 18:59:58 -0400 Received: from mx.meyering.net ([88.168.87.75]:55225) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UoLvR-000852-7t for bug-emacs@gnu.org; Sun, 16 Jun 2013 18:59:57 -0400 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id D1A2D6011C for ; Mon, 17 Jun 2013 00:59:55 +0200 (CEST) From: Jim Meyering To: bug-emacs@gnu.org Subject: recent viper-mode regression Date: Mon, 17 Jun 2013 00:59:55 +0200 Message-ID: <87sj0hfyqc.fsf@rho.meyering.net> Lines: 30 MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) Hello, I periodically use built-from-git emacs and noticed that in the last couple of weeks a common command in viper-mode, "!Ggrep ..." had begun to malfunction. Normally, !G runs CMD on the contents of the buffer (from the line with point to EOF) and replaces those lines with the output of the command. Now, however, it merely appends the result, instead of replacing the source lines. E.g., if you run this, seq 10 > k; emacs -q -nw -f viper-mode k then type "!Ggrep 3", you'll end up with this in your buffer: 1 2 3 4 5 6 7 8 9 10 3 Instead, the buffer should (and used to) contain this single line: 3 From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 16:30:30 2013 Received: (at 14637-done) by debbugs.gnu.org; 18 Jun 2013 20:30:30 +0000 Received: from localhost ([127.0.0.1]:53880 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Up2Xt-0001NU-KN for submit@debbugs.gnu.org; Tue, 18 Jun 2013 16:30:30 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:50209 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Up2Xq-0001NF-2v for 14637-done@debbugs.gnu.org; Tue, 18 Jun 2013 16:30:27 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 30FA6258B9E915; Tue, 18 Jun 2013 13:30:24 -0700 (PDT) From: Juri Linkov To: Jim Meyering Subject: Re: bug#14637: recent viper-mode regression Organization: JURTA References: <87sj0hfyqc.fsf@rho.meyering.net> Date: Tue, 18 Jun 2013 23:25:20 +0300 In-Reply-To: <87sj0hfyqc.fsf@rho.meyering.net> (Jim Meyering's message of "Mon, 17 Jun 2013 00:59:55 +0200") Message-ID: <87y5a7xj2m.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 14637-done Cc: 14637-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > Now, however, it merely appends the result, instead of replacing the > source lines. I know nothing about viper-mode, but apparently this regression is caused by revno:112695 that now requires for the callers of `shell-command-on-region' to explicitly specify its argument REPLACE as documented in its docstring for a long time. However, this fix breaks such callers that don't care about providing the correct non-nil REPLACE argument to behave according to the documentation. Grepping for `shell-command-on-region' revealed the exhaustive list of the callers that are fixed now with this patch to set both args OUTPUT-BUFFER and REPLACE to the same value in unison: === modified file 'lisp/emulation/vi.el' --- lisp/emulation/vi.el 2012-09-17 05:41:04 +0000 +++ lisp/emulation/vi.el 2013-06-18 20:17:20 +0000 @@ -1148,7 +1148,8 @@ (defun vi-shell-op (motion-command arg & (cond ((null shell-command) (setq shell-command (read-string "!" nil)) (setq vi-last-shell-command shell-command))) - (shell-command-on-region begin end shell-command (not (vi-prefix-char-value arg))) + (shell-command-on-region begin end shell-command (not (vi-prefix-char-value arg)) + (not (vi-prefix-char-value arg))) t))) (defun vi-shift-op (motion-command arg amount) === modified file 'lisp/emulation/vip.el' --- lisp/emulation/vip.el 2013-03-12 02:08:21 +0000 +++ lisp/emulation/vip.el 2013-06-18 20:17:24 +0000 @@ -775,7 +775,7 @@ (defun vip-execute-com (m-com val com) (if (= com ?!) (setq vip-last-shell-com (vip-read-string "!")) vip-last-shell-com) - t))) + t t))) ((= com ?=) (save-excursion (set-mark vip-com-point) @@ -3042,7 +3042,7 @@ (defun ex-command () (goto-char beg) (set-mark end) (vip-enlarge-region (point) (mark)) - (shell-command-on-region (point) (mark) command t)) + (shell-command-on-region (point) (mark) command t t)) (goto-char beg))))) (defun ex-line-no () === modified file 'lisp/emulation/viper-cmd.el' --- lisp/emulation/viper-cmd.el 2013-05-22 03:21:30 +0000 +++ lisp/emulation/viper-cmd.el 2013-06-18 20:17:31 +0000 @@ -1548,7 +1548,7 @@ (defun viper-exec-bang (m-com com) (car viper-shell-history) )) viper-last-shell-com) - t))) + t t))) (defun viper-exec-equals (m-com com) (save-excursion === modified file 'lisp/emulation/viper-ex.el' --- lisp/emulation/viper-ex.el 2013-05-22 03:21:30 +0000 +++ lisp/emulation/viper-ex.el 2013-06-18 20:17:34 +0000 @@ -2176,7 +2176,7 @@ (defun ex-command () (goto-char beg) (set-mark end) (viper-enlarge-region (point) (mark t)) - (shell-command-on-region (point) (mark t) command t)) + (shell-command-on-region (point) (mark t) command t t)) (goto-char beg))))) (defun ex-compile () === modified file 'lisp/mh-e/mh-alias.el' --- lisp/mh-e/mh-alias.el 2013-01-01 09:11:05 +0000 +++ lisp/mh-e/mh-alias.el 2013-06-18 20:17:37 +0000 @@ -141,7 +141,7 @@ (defun mh-alias-local-users () (insert-file-contents "/etc/passwd"))) ((stringp mh-alias-local-users) (insert mh-alias-local-users "\n") - (shell-command-on-region (point-min) (point-max) mh-alias-local-users t) + (shell-command-on-region (point-min) (point-max) mh-alias-local-users t t) (goto-char (point-min)))) (while (< (point) (point-max)) (cond From debbugs-submit-bounces@debbugs.gnu.org Tue Jun 18 20:28:28 2013 Received: (at 14637) by debbugs.gnu.org; 19 Jun 2013 00:28:28 +0000 Received: from localhost ([127.0.0.1]:54144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Up6GB-0001zC-NS for submit@debbugs.gnu.org; Tue, 18 Jun 2013 20:28:28 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:31059) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Up6G9-0001yt-4m for 14637@debbugs.gnu.org; Tue, 18 Jun 2013 20:28:25 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA2IQgaxH5AOjWGDKQOkeoFegxM X-IPAS-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA2IQgaxH5AOjWGDKQOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="16687475" Received: from 69-165-149-114.dsl.teksavvy.com (HELO pastel.home) ([69.165.149.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 18 Jun 2013 20:28:13 -0400 Received: by pastel.home (Postfix, from userid 20848) id 281F562D1B; Tue, 18 Jun 2013 20:28:18 -0400 (EDT) From: Stefan Monnier To: 14637@debbugs.gnu.org Subject: Re: bug#14637: recent viper-mode regression Message-ID: References: <87sj0hfyqc.fsf@rho.meyering.net> <87y5a7xj2m.fsf@mail.jurta.org> Date: Tue, 18 Jun 2013 20:28:18 -0400 In-Reply-To: <87y5a7xj2m.fsf@mail.jurta.org> (Juri Linkov's message of "Tue, 18 Jun 2013 23:25:20 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 14637 Cc: juri@jurta.org, jim@meyering.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > Grepping for `shell-command-on-region' revealed the exhaustive list > of the callers that are fixed now with this patch to set both args > OUTPUT-BUFFER and REPLACE to the same value in unison: Do all the callers need to be fixed? Most of them? A minority only? If it's not just a minority, then maybe the better fix is to revert revno:112695 (or at least change it) so that existing code doesn't need to be changed. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 04:56:56 2013 Received: (at 14637) by debbugs.gnu.org; 19 Jun 2013 08:56:57 +0000 Received: from localhost ([127.0.0.1]:54745 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UpECG-0005GC-HK for submit@debbugs.gnu.org; Wed, 19 Jun 2013 04:56:56 -0400 Received: from mx.meyering.net ([88.168.87.75]:57469) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UpECC-0005Fz-JT for 14637@debbugs.gnu.org; Wed, 19 Jun 2013 04:56:53 -0400 Received: from rho.meyering.net (rho.meyering.net [127.0.0.1]) by rho.meyering.net (Acme Bit-Twister) with ESMTP id 269C5600EE; Wed, 19 Jun 2013 10:56:51 +0200 (CEST) From: Jim Meyering To: help-debbugs@gnu.org (GNU bug Tracking System) Subject: Re: bug#14637: closed (Re: bug#14637: recent viper-mode regression) In-Reply-To: (GNU bug Tracking System's message of "Tue, 18 Jun 2013 20:31:02 +0000") References: <87y5a7xj2m.fsf@mail.jurta.org> <87sj0hfyqc.fsf@rho.meyering.net> Date: Wed, 19 Jun 2013 10:56:51 +0200 Message-ID: <87bo721nsc.fsf@rho.meyering.net> Lines: 12 MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -3.5 (---) X-Debbugs-Envelope-To: 14637 Cc: 14637@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.5 (---) GNU bug Tracking System wrote: > Your bug report > > #14637: recent viper-mode regression > > which was filed against the emacs package, has been closed. > > The explanation is attached below, along with your original report. > If you require more details, please reply to 14637@debbugs.gnu.org. Confirmed. Thank you for tracking that down and fixing it! From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 17:05:05 2013 Received: (at 14637) by debbugs.gnu.org; 19 Jun 2013 21:05:05 +0000 Received: from localhost ([127.0.0.1]:56485 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UpPYu-0007CA-MD for submit@debbugs.gnu.org; Wed, 19 Jun 2013 17:05:05 -0400 Received: from ps18281.dreamhost.com ([69.163.218.105]:54032 helo=ps18281.dreamhostps.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UpPYr-0007Bk-De for 14637@debbugs.gnu.org; Wed, 19 Jun 2013 17:05:02 -0400 Received: from localhost (ps18281.dreamhostps.com [69.163.218.105]) by ps18281.dreamhostps.com (Postfix) with ESMTP id 9C517258B9E91C; Wed, 19 Jun 2013 14:04:59 -0700 (PDT) From: Juri Linkov To: Stefan Monnier Subject: Re: bug#14637: recent viper-mode regression Organization: JURTA References: <87sj0hfyqc.fsf@rho.meyering.net> <87y5a7xj2m.fsf@mail.jurta.org> Date: Wed, 19 Jun 2013 23:53:07 +0300 In-Reply-To: (Stefan Monnier's message of "Tue, 18 Jun 2013 20:28:18 -0400") Message-ID: <87ehbx7vog.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 14637 Cc: 14637@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> Grepping for `shell-command-on-region' revealed the exhaustive list >> of the callers that are fixed now with this patch to set both args >> OUTPUT-BUFFER and REPLACE to the same value in unison: > > Do all the callers need to be fixed? Most of them? A minority only? > If it's not just a minority, then maybe the better fix is to revert > revno:112695 (or at least change it) so that existing code doesn't need > to be changed. I fixed all the callers that missed the required REPLACE arg: 5 were in vi mode, and 1 in mh-e. They are just a minority out of total 25 occurrences of `shell-command-on-region'. From debbugs-submit-bounces@debbugs.gnu.org Wed Jun 19 22:02:48 2013 Received: (at 14637) by debbugs.gnu.org; 20 Jun 2013 02:02:48 +0000 Received: from localhost ([127.0.0.1]:57021 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UpUD1-0003Zj-MK for submit@debbugs.gnu.org; Wed, 19 Jun 2013 22:02:48 -0400 Received: from ironport2-out.teksavvy.com ([206.248.154.182]:41261) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1UpUCy-0003ZV-DI for 14637@debbugs.gnu.org; Wed, 19 Jun 2013 22:02:44 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IPAS-Result: Av4EABK/CFFFpZVy/2dsb2JhbABEvw4Xc4IeAQEEAVYjBQsLNBIUGA0kiB4GwS2RCgOkeoFegxM X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="16765875" Received: from 69-165-149-114.dsl.teksavvy.com (HELO pastel.home) ([69.165.149.114]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 19 Jun 2013 22:02:33 -0400 Received: by pastel.home (Postfix, from userid 20848) id 0FBB562D47; Wed, 19 Jun 2013 22:02:38 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Subject: Re: bug#14637: recent viper-mode regression Message-ID: References: <87sj0hfyqc.fsf@rho.meyering.net> <87y5a7xj2m.fsf@mail.jurta.org> <87ehbx7vog.fsf@mail.jurta.org> Date: Wed, 19 Jun 2013 22:02:38 -0400 In-Reply-To: <87ehbx7vog.fsf@mail.jurta.org> (Juri Linkov's message of "Wed, 19 Jun 2013 23:53:07 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.3 (/) X-Debbugs-Envelope-To: 14637 Cc: 14637@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) > I fixed all the callers that missed the required REPLACE arg: > 5 were in vi mode, and 1 in mh-e. They are just a minority > out of total 25 occurrences of `shell-command-on-region'. OK, then, go ahead, thank you, Stefan From unknown Sat Aug 16 20:57:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 18 Jul 2013 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator