Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!rpi!pawl!shadow
From: shadow@pawl.rpi.edu (Deven T. Corzine)
Newsgroups: comp.sys.amiga.tech
Subject: Re: vi versus emacs regexps? (was Re: Minix, Unix)
Message-ID: 
Date: 11 Aug 89 12:25:42 GMT
References: <3352@sol.warwick.ac.uk> <4031@cps3xx.UUCP> <7559@cbmvax.UUCP>
	<5067@ucdavis.ucdavis.edu> <439@xdos.UUCP>
	 <441@xdos.UUCP>
Sender: usenet@rpi.edu
Organization: Rensselaer Polytechnic Institute, Troy, NY
Lines: 70
In-reply-to: doug@xdos.UUCP's message of 10 Aug 89 19:26:08 GMT


On 10 Aug 89 19:26:08 GMT,
doug@xdos.UUCP (Doug Merritt) said:
Doug> Summary: Oops! I was wrong.

Doug> I had said that vi's global search-and-replace surpasses emacs. Deven
Doug> was surprised:

In article  shadow@pawl.rpi.edu
(Deven T. Corzine) writes:

Deven> *That* I find hard to believe.  GNU Emacs has not only
Deven> query-replace (a very nice function) but also
Deven> query-replace-regexp.

Doug> Correction, I was wrong. I hadn't used any version of emacs very
Doug> much since about 1981 or so; I speaking on the basis of
Doug> conversations with emacs fans. Turns out I was misinformed. GNU
Doug> emacs adopted all of vi's regular expression features, plus
Doug> egrep alternation, long ago (and yes, vi was the influence). I
Doug> found this out when I actually checked the GNU Emacs Manual this
Doug> morning.

The one particular bit about vi regexps I had pointed out to me was the
substitution of text which matched certain parts of the searching
regexp when doing a replace.  Whether GNU Emacs has this when you do a
query-replace-regexp, I don't know.  [quite possibly]  Certainly, it
is quite capable of it.

Doug> I disagree with the default bindings (no default binding
Doug> backward search), but what else is new...easy enough to
Doug> customize.

C-r [control-r] is normally bound to isearch-backward.

Deven> [A regexp I-search would be pretty incredible...]

Doug> The manual says it's supported: "isearch-forward-regexp".

Indeed.  Someone Emailed and pointed that out to me.  I had thought I
had looked, but if I did, it must have been long ago when I had no
clue how to effectively search within Emacs for a specific
functionality...

And yes, a Regexp I-Search is very neat...

Doug> So given that, only my conditioned reflexes stand in the way of
Doug> my switching, and I've been trying to talk myself into taking
Doug> the hit for about a year now. Someday soon...

Yeah, it took me about a year to switch to Emacs from vi...  but it
was well worth it.  (Now, I mess myself up if I try to use vi...  my
reflexes are now conditioned for Emacs.)

For an intermediate step, check out vip-mode... it's a major mode in
Emacs which emulates (closely) vi...  to start it, type M-x vip-mode.
[M-x is Meta-x, Alt-x or Esc-x as appropriate.]  There is also
"vi-mode", but it is not as close emulation of vi.

Doug> Hmmm. I wonder if any of the Amiga Emacs' support as full a
Doug> regexp set as full Gnu Emacs?

I should hope so.  Maybe in mg3a, Mike?  ;-)

Deven
--
Deven T. Corzine        Internet:  deven@rpi.edu, shadow@pawl.rpi.edu
Snail:  2214 12th Street, Troy, NY 12180       Phone:  (518) 271-0750
Bitnet:  deven@rpitsmts, userfxb6@rpitsmts     UUCP:  uunet!rpi!deven
Simple things should be simple and complex things should be possible.