unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#4808: 23.1.50; calc-quit move point to another window
@ 2009-10-26 13:56 Leo
  2009-10-27  2:30 ` Jay Belanger
  2011-09-05  8:53 ` martin rudalics
  0 siblings, 2 replies; 5+ messages in thread
From: Leo @ 2009-10-26 13:56 UTC (permalink / raw)
  To: emacs-pretest-bug

Please describe exactly what actions triggered the bug
and the precise symptoms of the bug:

Lately I have been using a three-window setup for writing in LaTeX and I
have found that calc move point to another window, which I am not sure
is desirable.

My frame setup is as follows with point in window 1.

    +------------------+----------+
    |                  |          |
    |                  |     2    |
    |                  |          |
    |                  |          |
    |         1        +----------+
    |                  |          |
    |                  |     3    |
    |                  |          |
    |                  |          |
    +------------------+----------+

Now `M-x calc' and then quit it with 'q'. You will see point moved to
window 2. This is reproducible with Emacs -q.

In GNU Emacs 23.1.50.1 (i386-apple-darwin9.8.0, NS apple-appkit-949.54)
 of 2009-09-22 on neutron.local
Windowing system distributor `Apple', version 10.3.949
configured using `configure  '--with-ns''


Leo

Emacs-Uptime: "34 days, 5 hours, 7 minutes, 6 seconds"





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4808: 23.1.50; calc-quit move point to another window
  2009-10-26 13:56 bug#4808: 23.1.50; calc-quit move point to another window Leo
@ 2009-10-27  2:30 ` Jay Belanger
  2009-10-27  8:23   ` Leo
  2009-10-27  8:31   ` martin rudalics
  2011-09-05  8:53 ` martin rudalics
  1 sibling, 2 replies; 5+ messages in thread
From: Jay Belanger @ 2009-10-27  2:30 UTC (permalink / raw)
  To: Leo; +Cc: emacs-pretest-bug, 4808


Leo <sdl.web@gmail.com> writes:
...
> Lately I have been using a three-window setup for writing in LaTeX and I
> have found that calc move point to another window, which I am not sure
> is desirable.
>
> My frame setup is as follows with point in window 1.
>
>     +------------------+----------+
>     |                  |          |
>     |                  |     2    |
>     |                  |          |
>     |                  |          |
>     |         1        +----------+
>     |                  |          |
>     |                  |     3    |
>     |                  |          |
>     |                  |          |
>     +------------------+----------+
>
> Now `M-x calc' and then quit it with 'q'. You will see point moved to
> window 2. This is reproducible with Emacs -q.

I'm not sure this is a Calc problem; `calc-quit' will (aside from some
bookkeeping) delete the calc window and bury the buffer.  If, in the
above configuration, you split window 1

     +------------------+----------+
     |                  |          |
     |                  |     2    |
     |        1         |          |
     |                  |          |
     |------------------+----------+
     |                  |          |
     |        4         |     3    |
     |                  |          |
     |                  |          |
     +------------------+----------+

(and have 4 a different buffer, of course), move the cursor from window
1 to window 4, then delete window 4, the cursor will end up in window 2.
This seems more like a quirk of deleting windows than anything else.
Calc could make efforts to avoid this particular situation, but relying
on standard Emacs behavior seems like the best choice.

Jay





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4808: 23.1.50; calc-quit move point to another window
  2009-10-27  2:30 ` Jay Belanger
@ 2009-10-27  8:23   ` Leo
  2009-10-27  8:31   ` martin rudalics
  1 sibling, 0 replies; 5+ messages in thread
From: Leo @ 2009-10-27  8:23 UTC (permalink / raw)
  To: jay.p.belanger; +Cc: emacs-pretest-bug, 4808

On 2009-10-27 02:30 +0000, Jay Belanger wrote:
> This seems more like a quirk of deleting windows than anything else.
> Calc could make efforts to avoid this particular situation, but relying
> on standard Emacs behavior seems like the best choice.

I agree it needs to be fixed in delete-window. It is more intuitive for
the point to remain in the window that is enlarged by delete-window.

Leo





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4808: 23.1.50; calc-quit move point to another window
  2009-10-27  2:30 ` Jay Belanger
  2009-10-27  8:23   ` Leo
@ 2009-10-27  8:31   ` martin rudalics
  1 sibling, 0 replies; 5+ messages in thread
From: martin rudalics @ 2009-10-27  8:31 UTC (permalink / raw)
  To: jay.p.belanger, 4808; +Cc: Leo

 >> Lately I have been using a three-window setup for writing in LaTeX and I
 >> have found that calc move point to another window, which I am not sure
 >> is desirable.
 >>
 >> My frame setup is as follows with point in window 1.
 >>
 >>     +------------------+----------+
 >>     |                  |          |
 >>     |                  |     2    |
 >>     |                  |          |
 >>     |                  |          |
 >>     |         1        +----------+
 >>     |                  |          |
 >>     |                  |     3    |
 >>     |                  |          |
 >>     |                  |          |
 >>     +------------------+----------+
 >>
 >> Now `M-x calc' and then quit it with 'q'. You will see point moved to
 >> window 2. This is reproducible with Emacs -q.

I can't reproduce your problem but I haven't built from CVS sources for
quite a while.  The algorithm for selecting a window after deleting the
selected one is contrived and I never understood it completely.
Conceptually, it should select the window "preceding" the deleted one
"in the cyclic ordering of windows".  Only if no preceding window
exists, the window "following" the deleted one "in the cyclic ordering
of windows" should be chosen.  However, since a preceding (previous) and
following (next) window should invariantly exist for any window, this
part of the selection procedure is what I fail to understand.

In your case the window returned by `previous-window' when you are in
the calc window (which here pops up below window 1) should give you the
window that will be selected after the calc window got deleted.  On my
Emacs window 1 gets selected.  Can you tell whether there was a change
in behavior over the past weeks or months?

 > I'm not sure this is a Calc problem; `calc-quit' will (aside from some
 > bookkeeping) delete the calc window and bury the buffer.  If, in the
 > above configuration, you split window 1
 >
 >      +------------------+----------+
 >      |                  |          |
 >      |                  |     2    |
 >      |        1         |          |
 >      |                  |          |
 >      |------------------+----------+
 >      |                  |          |
 >      |        4         |     3    |
 >      |                  |          |
 >      |                  |          |
 >      +------------------+----------+
 >
 > (and have 4 a different buffer, of course),

The buffer identity should not matter.

 > move the cursor from window
 > 1 to window 4, then delete window 4, the cursor will end up in window 2.
 > This seems more like a quirk of deleting windows than anything else.
 > Calc could make efforts to avoid this particular situation, but relying
 > on standard Emacs behavior seems like the best choice.

It's difficult to judge your example since I don't know whether your
first split was horizontally or vertically.  However, iIf window 2 _is_
the window preceding window 4 in the "cyclic ordering of windows" you
essentially get the behavior explained above.

For some reason here I can never get window 2 selected when deleting
window 4 so I'm merely surprised by the behavior of _my_ Emacs ;-)

martin





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#4808: 23.1.50; calc-quit move point to another window
  2009-10-26 13:56 bug#4808: 23.1.50; calc-quit move point to another window Leo
  2009-10-27  2:30 ` Jay Belanger
@ 2011-09-05  8:53 ` martin rudalics
  1 sibling, 0 replies; 5+ messages in thread
From: martin rudalics @ 2011-09-05  8:53 UTC (permalink / raw)
  To: 4808-done

> My frame setup is as follows with point in window 1.
> 
>     +------------------+----------+
>     |                  |          |
>     |                  |     2    |
>     |                  |          |
>     |                  |          |
>     |         1        +----------+
>     |                  |          |
>     |                  |     3    |
>     |                  |          |
>     |                  |          |
>     +------------------+----------+
> 
> Now `M-x calc' and then quit it with 'q'. You will see point moved to
> window 2. This is reproducible with Emacs -q.

Should be fixed in current trunk.

martin






^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-09-05  8:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-26 13:56 bug#4808: 23.1.50; calc-quit move point to another window Leo
2009-10-27  2:30 ` Jay Belanger
2009-10-27  8:23   ` Leo
2009-10-27  8:31   ` martin rudalics
2011-09-05  8:53 ` martin rudalics

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