GNU bug report logs - #14637
recent viper-mode regression

Previous Next

Package: emacs;

Reported by: Jim Meyering <jim <at> meyering.net>

Date: Sun, 16 Jun 2013 23:01:02 UTC

Severity: normal

Done: Juri Linkov <juri <at> jurta.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Juri Linkov <juri <at> jurta.org>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#14637: closed (recent viper-mode regression)
Date: Tue, 18 Jun 2013 20:31:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Tue, 18 Jun 2013 23:25:20 +0300
with message-id <87y5a7xj2m.fsf <at> mail.jurta.org>
and subject line Re: bug#14637: recent viper-mode regression
has caused the debbugs.gnu.org bug report #14637,
regarding recent viper-mode regression
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
14637: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=14637
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Jim Meyering <jim <at> meyering.net>
To: bug-emacs <at> gnu.org
Subject: recent viper-mode regression
Date: Mon, 17 Jun 2013 00:59:55 +0200
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<cmd> 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


[Message part 3 (message/rfc822, inline)]
From: Juri Linkov <juri <at> jurta.org>
To: Jim Meyering <jim <at> meyering.net>
Cc: 14637-done <at> debbugs.gnu.org
Subject: Re: bug#14637: recent viper-mode regression
Date: Tue, 18 Jun 2013 23:25:20 +0300
> 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



This bug report was last modified 12 years and 33 days ago.

Previous Next


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