help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A problem (apparently) connected with window point


From: Eli Zaretskii
Subject: Re: A problem (apparently) connected with window point
Date: Fri, 02 Apr 2021 08:54:55 +0300

> 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 via email to

[Prev in Thread] Current Thread [Next in Thread]