From: Uday S Reddy <u.s.reddy@cs.bham.ac.uk>
To: emacs-devel@gnu.org
Subject: Re: save-excursion again
Date: Sat, 26 Jun 2010 12:03:38 +0100 [thread overview]
Message-ID: <i04mqj$915$1@dough.gmane.org> (raw)
In-Reply-To: <jwvpqzeg6c6.fsf-monnier+emacs@gnu.org>
On 6/25/2010 10:20 PM, Stefan Monnier wrote:
>> Which brings up a question for Stefan. Are you saying that the
>> condition-case-save-point-and-mark aspect of `save-excursion' should
>> be abstracted out (say as `save-region') and separated from the
>> save-buffer aspect?
>
> Not sure what you mean. If you mean we should introduce
> a save-excursion-but-not-buffer, then I think it's a bad idea, because
> such a thing would still have to save a marker (so there's no
> improvement in terms of the amount of data saved) and the semantics of
> "restore point in another buffer" is murky in Emacs.
I think the point is that save-excursion has been saving too much. So, when we
see a save-excursion in a piece of code, we are not sure whether it was meant
to save the point and mark, or the current-buffer, or both. It seems that the
original developers were themselves unsure after a while.
I took Stephen's point as saying that, if we have separate save-current-buffer
and save-region, with save-excursion strongly discouraged, we would promote a
clearer programming style.
Cheers,
Uday
next prev parent reply other threads:[~2010-06-26 11:03 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-18 7:42 save-excursion again Uday S Reddy
2010-06-18 13:51 ` Stefan Monnier
2010-06-18 14:02 ` David Kastrup
2010-06-18 15:29 ` Stefan Monnier
2010-06-18 17:16 ` Uday S Reddy
2010-06-18 18:37 ` Stefan Monnier
2010-06-19 14:50 ` Stephen J. Turnbull
2010-06-19 14:56 ` Lennart Borgman
2010-06-19 14:58 ` Lennart Borgman
2010-06-19 17:23 ` Stephen J. Turnbull
2010-06-19 17:30 ` Lennart Borgman
2010-06-25 21:20 ` Stefan Monnier
2010-06-26 0:40 ` Stephen J. Turnbull
2010-07-01 0:26 ` Stefan Monnier
2010-07-01 4:34 ` Stephen J. Turnbull
2010-07-04 17:07 ` Stefan Monnier
2010-06-26 11:03 ` Uday S Reddy [this message]
2010-07-01 0:30 ` Stefan Monnier
2010-07-01 1:54 ` Lennart Borgman
2010-07-04 17:08 ` Stefan Monnier
2010-06-19 16:22 ` Uday S Reddy
2010-06-18 15:04 ` Davis Herring
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='i04mqj$915$1@dough.gmane.org' \
--to=u.s.reddy@cs.bham.ac.uk \
--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 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.