🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98461

shell-command-on-region on its output

#98461
From: macrakis
Date: Fri, 14 Jun 1991 18:47
22 lines
1435 bytes
GNU Emacs 18.55.121 on NeXT 2.0

If you run shell-command-on-region on a buffer produced by another
shell-command-on-region command, it sends the empty string to the
shell command (i.e. it clears the buffer before sending it).  Here's
code to fix the bug:

  (if (or flag (equal (buffer-name) "*Shell Command Output*"))
      ;; Replace specified region with output from command.
      (let ((swap (and interactive (< (point) (mark)))))
	(if flag
	    nil
	  (delete-region (point-min) (min (point) (mark)))
	  (delete-region (point-max) (max (point) (mark)))
	  (setq start (point-min)
		end (point-max)))

Current (18.55) code for reference:

  (if flag
      ;; Replace specified region with output from command.
      (let ((swap (and interactive (< (point) (mark)))))
Technical Details
Message-ID: <9106141847.AA00686@.next1.osf.org.>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!tut.cis.ohio-state.edu!unreplyable!garbage

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,938fe7f4d879286a,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-06-14 11:47:12 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!usenet.ins.cwru.edu!tut.cis.ohio-state.edu!unreplyable!garbage
From: macrakis@osf.org
Newsgroups: gnu.emacs.bug
Subject: shell-command-on-region on its output
Message-ID: <9106141847.AA00686@.next1.osf.org.>
Date: 14 Jun 91 18:47:12 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 22
Approved: bug-gnu-emacs@prep.ai.mit.edu