[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [patch] Re: regexp repacement, how to present replacement to user?
From: |
Paul Pogonyshev |
Subject: |
Re: [patch] Re: regexp repacement, how to present replacement to user? |
Date: |
Sun, 28 Oct 2007 16:41:28 +0200 |
User-agent: |
KMail/1.7.2 |
Richard Stallman wrote:
> I think the main part of it is the offsetting and that may be used at
> other places. So it's the only part we want to provide.
>
> The originally proposed function was much cleaner and easier to use
> than this offsetting function. If this facility is useful enough to
> justify adding someting to Emacs, better to add the originally
> proposed function.
>
> The question is whether this is useful enough to be a reason to add
> anything.
Sorry for long delay.
How about this addition using new function right inside Emacs. In
`query-replace-regexp', hitting `t' (or anything else, doesn't matter)
will toggle between
Query replacing REGEXP with REPLACEMENT: (C-h for help)
and
Replace REGEXP with SUBSTITUTED-REPLACEMENT? (C-h for help)
This way you can preview replacement result, which can be useful if
your replacement string is complicated enough.
E.g. you will be able to toggle between
Query replacing \([a-z]+\) \([a-z]+\) with \1 \2 \1: (C-h for help)
and
Replace \([a-z]+\) \([a-z]+\) with foo bar foo? (C-h for help)
Optionally we can also toggle to `Replace MATCH...' instead of
`Replace REGEXP...', but that is probably not very useful given that
the match is highlighted in the buffer anyway.
Paul
- Re: regexp repacement, how to present replacement to user?, (continued)
- Re: regexp repacement, how to present replacement to user?, Juri Linkov, 2007/10/16
- Re: regexp repacement, how to present replacement to user?, David Kastrup, 2007/10/17
- Re: regexp repacement, how to present replacement to user?, Paul Pogonyshev, 2007/10/17
- [patch] Re: regexp repacement, how to present replacement to user?, Paul Pogonyshev, 2007/10/20
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Richard Stallman, 2007/10/21
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Paul Pogonyshev, 2007/10/21
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Juri Linkov, 2007/10/21
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Paul Pogonyshev, 2007/10/21
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Stefan Monnier, 2007/10/21
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Richard Stallman, 2007/10/25
- Re: [patch] Re: regexp repacement, how to present replacement to user?,
Paul Pogonyshev <=
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Richard Stallman, 2007/10/29
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Juri Linkov, 2007/10/30
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Richard Stallman, 2007/10/31
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Paul Pogonyshev, 2007/10/31
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Richard Stallman, 2007/10/23
- Re: [patch] Re: regexp repacement, how to present replacement to user?, David Kastrup, 2007/10/23
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Richard Stallman, 2007/10/23
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Lennart Borgman (gmail), 2007/10/23
- Re: [patch] Re: regexp repacement, how to present replacement to user?, Richard Stallman, 2007/10/24