unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Peter Dyballa <Peter_Dyballa@Web.DE>
To: David Combs <dkcombs@panix.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: #1: How to do vi's 'g/foo/s/x/y/'  #2: + with a Q-R "yes/no?"
Date: Sun, 8 Apr 2007 21:07:04 +0200	[thread overview]
Message-ID: <A1D5B054-1BB2-45FD-B72E-B11E8D9EBC75@Web.DE> (raw)
In-Reply-To: <ev8lno$p4e$1@panix2.panix.com>


Am 07.04.2007 um 19:51 schrieb David Combs:

> (1) How to do, in gnu-emacs,  vi's 'g/foo/s/x/y/':

	M-x replace-regexp RET ^\(.*foo.*\)x\(.*\)$ RET \1y\2 RET and
	M-x replace-regexp RET ^\(.*\)x\(.*foo.*\)$ RET \1y\2 RET ?

I think it's necessary to distinguish the two cases where the MUST  
HAVE is left or right of the MUST NOT BE. Instead of replace-regexp  
you can also use query-replace-regexp.

It might be possible to unite these into one expression using  
alternatives.

--
Greetings

   Pete

Claiming that the Macintosh is inferior to Windows because most  
people use Windows, is like saying that all other restaurants serve  
food that is inferior to McDonald's.

  parent reply	other threads:[~2007-04-08 19:07 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-07 17:51 #1: How to do vi's 'g/foo/s/x/y/' #2: + with a Q-R "yes/no?" David Combs
2007-04-08 10:28 ` Sam Peterson
2007-04-08 18:48   ` Markus Triska
2007-04-08 19:07 ` Peter Dyballa [this message]
2007-04-09  7:48 ` Drew Adams
     [not found] <mailman.1852.1176105200.7795.help-gnu-emacs@gnu.org>
2007-04-23  3:32 ` David Combs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=A1D5B054-1BB2-45FD-B72E-B11E8D9EBC75@Web.DE \
    --to=peter_dyballa@web.de \
    --cc=dkcombs@panix.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).