From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: emacs-devel@gnu.org, npostavs@users.sourceforge.net
Subject: Re: goto-char doesn't stick
Date: Thu, 15 Jun 2017 17:30:29 +0300 [thread overview]
Message-ID: <83injx2uii.fsf@gnu.org> (raw)
In-Reply-To: <jwvlgotgzgu.fsf-monnier+Inbox@gnu.org> (message from Stefan Monnier on Thu, 15 Jun 2017 09:24:15 -0400)
> From: Stefan Monnier <monnier@IRO.UMontreal.CA>
> Date: Thu, 15 Jun 2017 09:24:15 -0400
> Cc: Emacs developers <emacs-devel@gnu.org>
>
> >>>> (progn
> >>>> (set-buffer "z")
> >>>> (goto-char LOCATION))
> >> [...]
> >>> It's a feature, new in Emacs 26. If you don't like it, turn off
> >>> switch-to-buffer-preserve-window-point.
> >> Really? Why would set-buffer+goto-char be affected by a variable named
> >> switch-to-buffer-* ?
> > The switch-to-buffer-preserve-window-point affects point when you
> > switch to buffer "z" later.
>
> I don't understand the scenario you have in mind. If I do
>
> M-: (with-current-buffer "z" (goto-char (1+ (point))) (point))
>
> repeatedly, when "z" is not displayed, I see an increasing sequence, so
> the value of point is correctly preserved.
Of course.
> > No, I verified that it happens when "z" is not displayed in any window.
>
> I wonder what's the difference between your test and mine.
You need to switch to "z" so that it is displayed in a window,
e.g. with "C-x b". switch-to-buffer-preserve-window-point does its
thing at that time.
IOW, "goto-char doesn't stick" is based n an illusion, created by
making "z" the current buffer in the window, after running the snippet
above.
next prev parent reply other threads:[~2017-06-15 14:30 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-14 9:45 goto-char doesn't stick Elias Mårtenson
2017-06-14 9:48 ` Andreas Schwab
2017-06-14 10:02 ` Elias Mårtenson
2017-06-14 10:29 ` Andreas Schwab
2017-06-14 10:32 ` Elias Mårtenson
2017-06-14 11:01 ` Yuri Khan
[not found] ` <CADtN0WJdwdFhTL2_=ZQbADKT0p+PKCJKfkjqt7hNdQduq5bmCQ@mail.gmail.com>
2017-06-14 11:09 ` Elias Mårtenson
2017-06-14 10:22 ` Peder O. Klingenberg
2017-06-14 10:26 ` Noam Postavsky
2017-06-14 10:30 ` Elias Mårtenson
2017-06-14 11:13 ` Eli Zaretskii
2017-06-14 11:16 ` Elias Mårtenson
2017-06-14 14:33 ` Eli Zaretskii
2017-06-14 14:59 ` Elias Mårtenson
2017-06-14 15:28 ` Eli Zaretskii
2017-06-15 3:53 ` Alex
2017-06-14 14:05 ` Drew Adams
2017-06-14 14:53 ` Eli Zaretskii
2017-06-15 6:59 ` Stefan Monnier
2017-06-15 11:37 ` Noam Postavsky
2017-06-15 12:55 ` martin rudalics
2017-06-15 13:24 ` Stefan Monnier
2017-06-15 14:30 ` Eli Zaretskii [this message]
2017-06-15 17:11 ` Stefan Monnier
2017-06-15 18:25 ` Eli Zaretskii
2017-06-15 19:10 ` Elias Mårtenson
2017-06-15 19:25 ` Eli Zaretskii
2017-06-15 22:51 ` martin rudalics
2017-06-16 2:00 ` Stefan Monnier
2017-06-15 14:32 ` Eli Zaretskii
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=83injx2uii.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@IRO.UMontreal.CA \
--cc=npostavs@users.sourceforge.net \
/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).