From: Sean McAfee <eefacm@gmail.com>
To: Noam Postavsky <npostavs@gmail.com>
Cc: 35334@debbugs.gnu.org
Subject: bug#35334: 26.2; Changes to position of point are undone during with-current-buffer if window is visible but not current
Date: Sun, 21 Apr 2019 16:32:48 -0700 [thread overview]
Message-ID: <CANan03aBgC2n7P=NT+msBVGW=5YjUbiS0VMWL01rTG=Vs9yv-A@mail.gmail.com> (raw)
In-Reply-To: <8736mduxjh.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2061 bytes --]
On Fri, Apr 19, 2019 at 9:10 PM Noam Postavsky <npostavs@gmail.com> wrote:
> Sean McAfee <eefacm@gmail.com> writes:
> > I would expect point to move to position 8 in both cases, and I don't
> > see anything in the documentation for with-current-buffer or goto-char
> > to suggest that it ever wouldn't.
>
> How about in (elisp) Window Point?
>
> * Selecting a window sets the value of point in its buffer from the
> window's value of point. Conversely, deselecting a window sets the
> window's value of point from that of the buffer.
>
Okay, I wasn't fully aware of these window-point semantics. I'll take a
step back and describe my actual problem, of which the bug I thought I was
reporting was the simplest case I could reduce it to.
Starting with two windows visible, the scratch buffer and a window showing
empty buffer "a", I evaluate this expression in the scratch buffer:
(start-process "count" "a" "bash" "-c" "for i in {1..10}; echo $i; sleep 1;
done")
I see the numbers 1-10 inserted into buffer "a", one second apart, as
expected. The position of point in buffer "a" follows the new lines as
they're inserted.
Now I define the function ordinary-insertion-filter, as found on this page:
https://www.gnu.org/software/emacs/manual/html_node/elisp/Filter-Functions.html
That function is described as "mimicking the actions of the default
filter." However, if I erase buffer "a" and evaluate this expression in
the scratch buffer:
(let ((proc (start-process "count" "a" "bash" "-c" "for i in {1..10}; echo
$i; sleep 1; done")))
(set-process-filter proc #'ordinary-insertion-filter))
...then I see the numbers inserted as before, but now the position of point
in buffer "a" doesn't move; it stays at the beginning of the buffer. If I
select the window showing buffer "a" as the numbers are still being
inserted and move point to the end of the buffer, then point starts
following the new numbers. But if I select the scratch buffer again, point
in buffer "a" stops following the new numbers.
Is this the expected behavior?
[-- Attachment #2: Type: text/html, Size: 3005 bytes --]
next prev parent reply other threads:[~2019-04-21 23:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-20 4:00 bug#35334: 26.2; Changes to position of point are undone during with-current-buffer if window is visible but not current Sean McAfee
2019-04-20 4:10 ` Noam Postavsky
2019-04-21 23:32 ` Sean McAfee [this message]
2019-04-22 2:38 ` Noam Postavsky
2019-04-22 7:22 ` Eli Zaretskii
2019-04-27 21:05 ` Sean McAfee
2019-04-28 2:19 ` Noam Postavsky
2019-04-30 21:58 ` Sean McAfee
2019-05-01 0:55 ` Noam Postavsky
2019-04-27 21:07 ` Noam Postavsky
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='CANan03aBgC2n7P=NT+msBVGW=5YjUbiS0VMWL01rTG=Vs9yv-A@mail.gmail.com' \
--to=eefacm@gmail.com \
--cc=35334@debbugs.gnu.org \
--cc=npostavs@gmail.com \
/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.