From: Luc Teirlinck <teirllm@dms.auburn.edu>
Cc: emacs-devel@gnu.org
Subject: Re: with-current-buffer
Date: Sun, 11 Sep 2005 15:23:11 -0500 (CDT) [thread overview]
Message-ID: <200509112023.j8BKNB300964@raven.dms.auburn.edu> (raw)
In-Reply-To: <gn64t78x96.fsf@tiscali.de> (message from Emilio Lopes on Sun, 11 Sep 2005 17:00:53 +0200)
Emilio Lopes wrote:
Display a buffer, let's say "FOO", with some content. Move point to
its beginning.
Insert the following code in the "*scratch*" buffer:
(with-current-buffer "FOO"
(goto-char (point-max))
(insert "bar"))
Now execute the code above in these two different situations:
1- The buffer "FOO" is visible along with the "*scratch*" buffer.
2- The buffer "FOO" is not visible.
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.
Point in the buffer is not restored in either case. Just execute:
(with-current-buffer "FOO" (point)) immediately afterwards. You will
see that point _in the buffer_ really is where you expect it to be.
But each window that displays the buffer has its own value of point.
That value would not be restored either, if you would change it. But
your code never changes it. You should use set-window-point, if that
is what you want to do,
Is that intended behavior?
I definitely believe that it is intended.
Sincerely,
Luc.
next prev parent reply other threads:[~2005-09-11 20:23 UTC|newest]
Thread overview: 18+ 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 ` with-current-buffer Stefan Monnier
2005-09-12 17:15 ` with-current-buffer Emilio Lopes
2005-09-11 20:23 ` Luc Teirlinck [this message]
-- strict thread matches above, loose matches on Subject: below --
2019-11-11 8:31 with-current-buffer Andreas Röhler
2019-11-11 9:04 ` with-current-buffer tomas
2019-11-11 10:58 ` with-current-buffer Andreas Röhler
2019-11-11 11:09 ` with-current-buffer tomas
2019-11-11 11:17 ` with-current-buffer Joost Kremers
2019-11-11 11:16 ` with-current-buffer Joost Kremers
2019-11-11 11:31 ` with-current-buffer Andreas Röhler
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200509112023.j8BKNB300964@raven.dms.auburn.edu \
--to=teirllm@dms.auburn.edu \
--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.