From: martin rudalics <rudalics@gmx.at>
To: 20421@debbugs.gnu.org, eliz@gnu.org, drew.adams@oracle.com
Subject: bug#20421: 25.0.50; doc string of `insert-buffer-substring'
Date: Sat, 25 Apr 2015 12:49:46 +0200 [thread overview]
Message-ID: <553B714A.8050002@gmx.at> (raw)
In-Reply-To: <83siboy7aq.fsf@gnu.org>
> I think that reader misunderstood something else: the difference
> between point and window-point.
IIUC the issue at hand is more contrived. Conceptually, `window-point'
prescribes the position where to display the cursor in the corresponding
window and `window-point-insertion-type' prescribes how the cursor
should move when text is inserted at that position. But we also say:
As long as the selected window displays the current buffer, the
window's point and the buffer's point always move together; they
remain equal.
So inherently Emacs does override [at least the default value which is
nil of] `window-point-insertion-type' when appending at `window-point'
in the selected window.
Now apparently that code in `append-to-buffer'
(dolist (window windows)
(when (= (window-point window) point)
(set-window-point window (point))))
tries to mimic the same behavior for all non-selected windows that show
the same buffer and whose `window-point' equals the pre-append position
of `point' in that buffer.
Our reader should be able to see why this code makes a difference with
emacs -Q as follows:
- Make a frame with two windows showing the same buffer
- Make one of these windows the selected one
- Make sure that both windows have the same value of `window-point'
(show the cursor at the same position)
- Call `append-to-buffer' to add some text to these windows' buffer.
With the code above, both windows should have the same value of
`window-point' now. Without that code, the point of the non-selected
window should have staid behind the added text.
I have no idea why `append-to-buffer' deliberately overrides the value
of `window-point-insertion-type' or why the default value of
`window-point-insertion-type' is nil. Maybe Stefan can clarify.
martin
next prev parent reply other threads:[~2015-04-25 10:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-24 23:19 bug#20421: 25.0.50; doc string of `insert-buffer-substring' Drew Adams
2015-04-25 7:51 ` Eli Zaretskii
2015-04-25 10:49 ` martin rudalics [this message]
2015-04-25 14:22 ` Drew Adams
2015-04-25 14:49 ` Stefan Monnier
2015-04-25 14:58 ` Eli Zaretskii
2015-04-25 15:34 ` Drew Adams
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=553B714A.8050002@gmx.at \
--to=rudalics@gmx.at \
--cc=20421@debbugs.gnu.org \
--cc=drew.adams@oracle.com \
--cc=eliz@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.