unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Drew Adams <drew.adams@oracle.com>
To: martin rudalics <rudalics@gmx.at>, 20421@debbugs.gnu.org, eliz@gnu.org
Subject: bug#20421: 25.0.50; doc string of `insert-buffer-substring'
Date: Sat, 25 Apr 2015 07:22:31 -0700 (PDT)	[thread overview]
Message-ID: <bf652df5-d83a-428e-ac6e-c7485a9ca588@default> (raw)
In-Reply-To: <553B714A.8050002@gmx.at>

>  > 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.

Good info, which helps supplement the Q&A at SE (which links to
this thread).

I wasn't even aware of `window-point-insertion-type', which was
introduced in Emacs 23 apparently.





  reply	other threads:[~2015-04-25 14:22 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
2015-04-25 14:22     ` Drew Adams [this message]
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

  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=bf652df5-d83a-428e-ac6e-c7485a9ca588@default \
    --to=drew.adams@oracle.com \
    --cc=20421@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=rudalics@gmx.at \
    /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).