🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1607

replace-string

#1607
From: kgk
Date: Wed, 19 Apr 1989 14:51
26 lines
1398 bytes
In GNU Emacs 18.53.1 of Sun Apr 16 1989 on fred (berkeley-unix)

I like replace-string and replace-regexp to stay at point after
performing any replacements, like in Zmacs.  The following patch
is one possible way to implement it.  The default would remain as
with the current behavior.

(defvar replace-move-point t
  "If non-nil, if there are any replacements made in a non-query
replacement, then move to the end of the last replacement made.
Otherwise, stay at point.")

(defun perform-replace (from-string to-string
		        query-flag regexp-flag delimited-flag)
  (if (or replace-move-point query-flag)
      (perform-replace-1 from-string to-string query-flag
                         regexp-flag delimited-flag)
      (save-excursion
        (perform-replace-1 from-string to-string query-flag
                           regexp-flag delimited-flag))))

;; The following function would be the present perform-replace.

(defun perform-replace-1 (...)
  )
Technical Details
Message-ID: <8904191451.AA22857@bimini.cs.brown.edu>
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!CS.BROWN.EDU!kgk

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!telly!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!CS.BROWN.EDU!kgk
From: kgk@CS.BROWN.EDU
Newsgroups: gnu.emacs.bug
Subject: replace-string
Message-ID: <8904191451.AA22857@bimini.cs.brown.edu>
Date: 19 Apr 89 14:51:36 GMT
Sender: chh@tut.cis.ohio-state.edu
Reply-To: kgk@cs.brown.edu (Keiji Kanazawa)
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 26