From: Le Wang <l26wang@gmail.com>
To: Paul Madden <Paul.A.Madden@noaa.gov>
Cc: help-gnu-emacs@gnu.org
Subject: Re: restore region after replace-string
Date: Mon, 17 Jan 2011 10:22:20 +0800 [thread overview]
Message-ID: <AANLkTi=MzA1gTKFiAxrK0FCotshKaZ03XZMtMtWTU9fE@mail.gmail.com> (raw)
In-Reply-To: <4D33260E.5080901@noaa.gov>
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
On Mon, Jan 17, 2011 at 1:08 AM, Paul Madden <Paul.A.Madden@noaa.gov> wrote:
> (defun rs ()
> (interactive)
> (let (deactivate-mark)
> (save-excursion (call interactively 'replace-string)))
> (exchange-point-and-mark)
> (exchange-point-and-mark))
>
>
You don't need the exchange-point-and-mark calls. As a part of the Emacs
commandloop, deactivate-mark is checked after executing your command, `rs'.
As long as you prevent your buffer modification code from setting
`deactivate-mark' to not-nil, the region should be active.
--
Le
[-- Attachment #2: Type: text/html, Size: 866 bytes --]
next prev parent reply other threads:[~2011-01-17 2:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.10.1295051790.18911.help-gnu-emacs@gnu.org>
2011-01-15 13:23 ` restore region after replace-string LanX
2011-01-15 20:07 ` Paul Madden
2011-01-16 10:28 ` Le Wang
2011-01-16 17:08 ` Paul Madden
2011-01-17 2:22 ` Le Wang [this message]
2011-01-17 2:38 ` Paul Madden
[not found] ` <mailman.15.1295181948.22773.help-gnu-emacs@gnu.org>
2011-01-16 18:24 ` LanX
2011-01-14 22:57 Paul Madden
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=MzA1gTKFiAxrK0FCotshKaZ03XZMtMtWTU9fE@mail.gmail.com' \
--to=l26wang@gmail.com \
--cc=Paul.A.Madden@noaa.gov \
--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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.