unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: David Kastrup <dak@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: Search nodes in Emacs manual
Date: 19 Jun 2004 20:52:19 +0200	[thread overview]
Message-ID: <x5ekobv0rg.fsf@lola.goethe.zz> (raw)
In-Reply-To: <87oenfo0d7.fsf@mail.jurta.org>

Juri Linkov <juri@jurta.org> writes:

> David Kastrup <dak@gnu.org> writes:
> > Juri Linkov <juri@jurta.org> writes:
> >> But perhaps with the latest changes this example can be replaced
> >> with more advanced like this:
> >> 
> >>     M-x replace-regexp <RET> \(x\|y\) <RET> \,(if (equal \& "x") "y"
> >>     "x") <RET>
> >
> > Cute.  Of course \(x\|y\) is shorter as [xy]
> 
> I intended to make it as an example of exchanging words which might
> be more useful than exchanging characters.  So that example
> could be rewritten as something like below, and be placed into
> (info "(emacs)Regexp Replace") instead of the current
> (info "(emacs)Unconditional Replace"), or to the same node
> where you might document this new feature.
> 
>   M-x replace-regexp <RET> \(ab\|cd\) <RET>
>                            \,(if (equal \& "ab") "cd" "ab") <RET>

You'd better use string=, or font-lock might surprise you.

How about

M-x replace-regexp <RET> \(\(ab\)\|cd\) <RET>
                         \,(if \2 "cd" "ab") <RET>

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

  reply	other threads:[~2004-06-19 18:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-18 19:35 Search nodes in Emacs manual Juri Linkov
2004-06-18 21:46 ` David Kastrup
2004-06-19 18:42   ` Juri Linkov
2004-06-19 18:52     ` David Kastrup [this message]
2004-06-19 21:22       ` Juri Linkov
2004-06-21 16:38   ` Juri Linkov
2004-06-19  3:19 ` Richard Stallman

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=x5ekobv0rg.fsf@lola.goethe.zz \
    --to=dak@gnu.org \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).