[Top][All Lists]

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

Re: Point of wrong window used in read-from-minibuffer?

From: Stefan Monnier
Subject: Re: Point of wrong window used in read-from-minibuffer?
Date: Mon, 25 Apr 2005 12:57:35 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin)

>> I'm saying that changing it to
>> (save-excursion (save-window-excursion (select-window (next-window))))
>> ought to solve the problem too, and the approach is less risky.

>     That's true.  But what about:

>       (save-window-excursion (forward-char 1) (select-window (next-window)))

>     I'd expect this to move the window's cursor by one char.

> No, that is not what it should do.  (select-window (next-window))
> positions point at the position for the other window, and that is the
> value that should remain in effect.

> So I think there is no bug here.

I have a hard time believing you tyhink this behavior is desirable.
So just to double check: you do realize I'm talking about the window's
cursor.  Not the buffer's point.  Whether the buffer's point is changed or
not doesn't bother me.

Another way to look at the problem:
A save-selected-window around a save-window-excursion is redundant because
save-window-excursion saves/restores the selected window.  I.e.

     (save-selected-window (save-window-excursion BODY))
     (save-window-excursion BODY)

Yet the "reverse" is not true (with the current code):

     (save-window-excursion (save-selected-window BODY))
     (save-window-excursion BODY)

I find this very unintuitive at least, and inconvenient in the above case.


reply via email to

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