unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: A problem (apparently) connected with window point
Date: Fri, 02 Apr 2021 08:54:55 +0300	[thread overview]
Message-ID: <83eeftfcy8.fsf@gnu.org> (raw)
In-Reply-To: <875z159val.fsf@mbork.pl> (message from Marcin Borkowski on Fri,  02 Apr 2021 06:15:14 +0200)

> From: Marcin Borkowski <mbork@mbork.pl>
> Date: Fri, 02 Apr 2021 06:15:14 +0200
> 
> The idea is that I select a region, call `reorder-sentence' (which then
> prepares a buffer to construct the reordered sentence), and then call
> `reorder-sentence-copy-word-at-point' with the point at words in the
> order I want them in the reordered sentence.

I'm probably missing something, because the description above doesn't
seem to be covered by the code you presented.  Specifically, the "with
the point at words in the order I want them in the reordered sentence"
part: where is it?  Since position of point is the main issue here, I
think showing that is important.

> The problem is that `reorder-sentence-copy-word-at-point' inserts every
> word at the beginning of the buffer.  (Try it, following the steps
> above.)  I very much suspect that this is because of the window point:
> if I do not /display/ that buffer, it works correctly (i.e., puts
> subsequent words one after another), and if I change the code to use
> `with-selected-window' instead of `with-current-buffer', it also works
> correctly.

A stub in the dark: did you try setting
switch-to-buffer-preserve-window-point to the nil value?



  reply	other threads:[~2021-04-02  5:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-02  4:15 A problem (apparently) connected with window point Marcin Borkowski
2021-04-02  5:54 ` Eli Zaretskii [this message]
2021-04-02 12:13 ` Stefan Monnier
2021-04-03  3:25   ` Marcin Borkowski
2021-04-03 15:22     ` Stefan Monnier

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=83eeftfcy8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=help-gnu-emacs@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.
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).