From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: with-current-buffer
Date: Sun, 11 Sep 2005 17:15:53 -0400 [thread overview]
Message-ID: <87psrfs40c.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <ksy86376js.fsf@tiscali.de> (Emilio Lopes's message of "Sun, 11 Sep 2005 21:23:03 +0200")
>>> In both cases the insertion is done at the right spot, but in case
>>> 1 point in buffer "FOO" is restored after the code is executed.
>>> Is that intended behavior?
>>> I expected point to be moved permanently in both cases.
>> Which point?
> The point in buffer "FOO", of course.
If foo is displayed in a window, it has 2 points: its own and the one of
the window.
> I expected the point to stay at point max after `with-current-buffer' exits.
It does stay there. Try
(progn
(with-current-buffer "FOO"
(goto-char (point-max))
(insert "bar"))
(with-current-buffer "FOO"
(point)))
> In the case 1 explained in the original message the code behaves as if it
> were wrapped with `save-excursion'.
No, it's just that the window's point gets copied to the buffer's point,
probably during redisplay.
> Can you reproduce it?
Of course,
Stefan
next prev parent reply other threads:[~2005-09-11 21:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-11 15:00 with-current-buffer Emilio Lopes
2005-09-11 16:52 ` with-current-buffer Stefan Monnier
2005-09-11 19:23 ` with-current-buffer Emilio Lopes
2005-09-11 21:15 ` Stefan Monnier [this message]
2005-09-12 17:15 ` with-current-buffer Emilio Lopes
2005-09-11 20:23 ` with-current-buffer Luc Teirlinck
-- strict thread matches above, loose matches on Subject: below --
2005-06-24 5:36 fit-window-to-buffer Richard M. Stallman
2005-06-26 23:33 ` with-current-buffer (was: fit-window-to-buffer) Juri Linkov
2005-06-27 6:28 ` Miles Bader
2005-06-28 0:04 ` with-current-buffer Juri Linkov
2005-06-28 17:28 ` with-current-buffer Kevin Rodgers
2005-06-29 3:45 ` with-current-buffer Stefan Monnier
2005-06-29 17:45 ` with-current-buffer Kevin Rodgers
2005-06-28 18:47 ` with-current-buffer Richard M. 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=87psrfs40c.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--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).