unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [rudalics@gmx.at: check_min_window_sizes]
@ 2006-02-13  4:40 Richard M. Stallman
  2006-02-18  3:58 ` Chong Yidong
  0 siblings, 1 reply; 18+ messages in thread
From: Richard M. Stallman @ 2006-02-13  4:40 UTC (permalink / raw)


Would someone please debug this and ack?

------- Start of forwarded message -------
Date: Thu, 09 Feb 2006 08:46:50 +0100
From: martin rudalics <rudalics@gmx.at>
MIME-Version: 1.0
To: emacs-pretest-bug <emacs-pretest-bug@gnu.org>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Subject: check_min_window_sizes

With Emacs -q evaluating

(progn
   (split-window-horizontally)
   (let ((window-min-width 1))
     (shrink-window (1- (window-width)) t)))

removes scrollbars from both emanating windows and makes the left window
inaccessible.  For some strange reason `check_min_window_sizes' seems to
fail here.



_______________________________________________
emacs-pretest-bug mailing list
emacs-pretest-bug@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
------- End of forwarded message -------

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-13  4:40 [rudalics@gmx.at: check_min_window_sizes] Richard M. Stallman
@ 2006-02-18  3:58 ` Chong Yidong
  2006-02-18 11:10   ` martin rudalics
                     ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Chong Yidong @ 2006-02-18  3:58 UTC (permalink / raw)
  Cc: martin rudalics, emacs-devel

> With Emacs -q evaluating
>
> (progn
>    (split-window-horizontally)
>    (let ((window-min-width 1))
>      (shrink-window (1- (window-width)) t)))
>
> removes scrollbars from both emanating windows and makes the left window
> inaccessible.  For some strange reason `check_min_window_sizes' seems to
> fail here.

This patch removes the bug.  But I am not very familiar with the
window code, so if someone could check that this is correct, it'd be
great.

*** emacs/src/window.c.~1.534.~	2006-02-17 22:53:49.000000000 -0500
--- emacs/src/window.c	2006-02-17 22:56:56.000000000 -0500
***************
*** 4064,4070 ****
  		    this_one = delta;
  
  		  (*setsizefun) (next, (*sizefun) (next) - this_one, 0);
! 		  (*setsizefun) (window, XINT (*sizep) + this_one, 0);
  
  		  delta -= this_one;
  		}
--- 4064,4070 ----
  		    this_one = delta;
  
  		  (*setsizefun) (next, (*sizefun) (next) - this_one, 0);
! 		  (*setsizefun) (window, XINT (*sizep) + this_one, 1);
  
  		  delta -= this_one;
  		}

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18  3:58 ` Chong Yidong
@ 2006-02-18 11:10   ` martin rudalics
  2006-02-18 13:06   ` martin rudalics
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 18+ messages in thread
From: martin rudalics @ 2006-02-18 11:10 UTC (permalink / raw)
  Cc: rms, emacs-devel

 > This patch removes the bug.  But I am not very familiar with the
 > window code, so if someone could check that this is correct, it'd be
 > great.

Thanks for fixing this.  A minor issue: When I now split a window with

(progn
   (split-window-horizontally)
   (let ((window-min-width 1))
     (shrink-window (1- (window-width)) t)))

I get two windows where the left one has width 1 - I'm not sure whether
windows with width 1 are valid as such.  Evaluating

(with-selected-window (split-window-horizontally)
   (let ((window-min-width 1))
     (shrink-window (1- (window-width)) t)))

the new window is deleted immediately.  Hence the behavior has become
asymmetric.  Since you didn't change line 4091 of window.c the way you
changed line 4067 that case is apparently handled in a different manner.

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18  3:58 ` Chong Yidong
  2006-02-18 11:10   ` martin rudalics
@ 2006-02-18 13:06   ` martin rudalics
  2006-02-19 22:48     ` Richard M. Stallman
  2006-02-18 15:28   ` Chong Yidong
  2006-02-19 17:45   ` Richard M. Stallman
  3 siblings, 1 reply; 18+ messages in thread
From: martin rudalics @ 2006-02-18 13:06 UTC (permalink / raw)
  Cc: rms, emacs-devel

By the way: Evaluating

(with-selected-window (split-window-horizontally)
   (let ((window-min-width 1))
     (shrink-window (1- (window-width)) t)
     (message "?????")))

doesn't display messages any more.  In the sequel Emacs may behave
rather strangely.  It already twice locked up my task monitor and I had
to reboot Windows.  Can you reproduce something similar?

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18  3:58 ` Chong Yidong
  2006-02-18 11:10   ` martin rudalics
  2006-02-18 13:06   ` martin rudalics
@ 2006-02-18 15:28   ` Chong Yidong
  2006-02-18 18:21     ` martin rudalics
  2006-02-19 17:45     ` Richard M. Stallman
  2006-02-19 17:45   ` Richard M. Stallman
  3 siblings, 2 replies; 18+ messages in thread
From: Chong Yidong @ 2006-02-18 15:28 UTC (permalink / raw)
  Cc: martin rudalics, emacs-devel

>> (progn
>>    (split-window-horizontally)
>>    (let ((window-min-width 1))
>>      (shrink-window (1- (window-width)) t)))
>>
>> removes scrollbars from both emanating windows and makes the left window
>> inaccessible.  For some strange reason `check_min_window_sizes' seems to
>> fail here.
>
> This patch removes the bug.

On second thought, the patch I posted was the wrong fix.  I believe
this one is correct (basically, size_window was checking for a
safe_min_size that included the width of window fringes and
scrollbars, but window_min_size_1 did not check for it).

*** emacs/src/window.c.~1.534.~	2006-02-18 10:15:46.000000000 -0500
--- emacs/src/window.c	2006-02-18 10:23:42.000000000 -0500
***************
*** 2568,2574 ****
    else
      {
        if (width_p)
! 	size = window_min_width;
        else
  	{
  	  if (MINI_WINDOW_P (w)
--- 2568,2577 ----
    else
      {
        if (width_p)
! 	size = max (window_min_width,
! 		    (MIN_SAFE_WINDOW_WIDTH
! 		     + WINDOW_FRINGE_COLS (w)
! 		     + WINDOW_SCROLL_BAR_COLS (w)));
        else
  	{
  	  if (MINI_WINDOW_P (w)

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18 15:28   ` Chong Yidong
@ 2006-02-18 18:21     ` martin rudalics
  2006-02-18 22:14       ` Chong Yidong
  2006-02-19 17:45     ` Richard M. Stallman
  1 sibling, 1 reply; 18+ messages in thread
From: martin rudalics @ 2006-02-18 18:21 UTC (permalink / raw)
  Cc: rms, emacs-devel

 > On second thought, the patch I posted was the wrong fix.  I believe
 > this one is correct (basically, size_window was checking for a
 > safe_min_size that included the width of window fringes and
 > scrollbars, but window_min_size_1 did not check for it).

Excellent, both problems disappeared.  Thanks again.

I know I'm getting bothersome, but maybe you could also look at the
following.  First remove all fringes.  Now do

(with-selected-window (split-window-horizontally)
   (let ((window-min-width 2))
     (shrink-window (- (window-width) 2) t)))

This should get you a right window with two columns only.  Now add the
fringes again.  This makes the right window display fringes only and no
text.

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18 18:21     ` martin rudalics
@ 2006-02-18 22:14       ` Chong Yidong
  2006-02-19  9:44         ` martin rudalics
                           ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Chong Yidong @ 2006-02-18 22:14 UTC (permalink / raw)
  Cc: rms, emacs-devel

martin rudalics <rudalics@gmx.at> writes:

>  > On second thought, the patch I posted was the wrong fix.  I believe
>  > this one is correct (basically, size_window was checking for a
>  > safe_min_size that included the width of window fringes and
>  > scrollbars, but window_min_size_1 did not check for it).
>
> Excellent, both problems disappeared.  Thanks again.

Good, I checked in the patch.

> I know I'm getting bothersome, but maybe you could also look at the
> following.  First remove all fringes.  Now do
>
> (with-selected-window (split-window-horizontally)
>    (let ((window-min-width 2))
>      (shrink-window (- (window-width) 2) t)))
>
> This should get you a right window with two columns only.  Now add the
> fringes again.  This makes the right window display fringes only and no
> text.

That's to be expected, no?  Or do you think that turning on the fringe
is supposed to increase the size of the window (I don't)?

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18 22:14       ` Chong Yidong
@ 2006-02-19  9:44         ` martin rudalics
  2006-02-20 10:11           ` martin rudalics
  2006-02-19 13:31         ` Kim F. Storm
  2006-02-19 22:47         ` Richard M. Stallman
  2 siblings, 1 reply; 18+ messages in thread
From: martin rudalics @ 2006-02-19  9:44 UTC (permalink / raw)
  Cc: rms, emacs-devel

 >>I know I'm getting bothersome, but maybe you could also look at the
 >>following.  First remove all fringes.  Now do
 >>
 >>(with-selected-window (split-window-horizontally)
 >>   (let ((window-min-width 2))
 >>     (shrink-window (- (window-width) 2) t)))
 >>
 >>This should get you a right window with two columns only.  Now add the
 >>fringes again.  This makes the right window display fringes only and no
 >>text.
 >
 >
 > That's to be expected, no?  Or do you think that turning on the fringe
 > is supposed to increase the size of the window (I don't)?

I agree with you.  Unfortunately, Emacs doesn't.  When, in the sequel, I
try to drag the vertical divider between the two windows Emacs tells me
something like:

Debugger entered--Lisp error: (error "Attempt to drag rightmost scrollbar")
   signal(error ("Attempt to drag rightmost scrollbar"))
   error("Attempt to drag rightmost scrollbar")
   mouse-drag-vertical-line((down-mouse-1 (#<window 10 on *scratch*> vertical-line (1226 . 848) 3399399 nil 126 (0 . 3) nil (0 . 794) (1 . 18))))
   call-interactively(mouse-drag-vertical-line)

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18 22:14       ` Chong Yidong
  2006-02-19  9:44         ` martin rudalics
@ 2006-02-19 13:31         ` Kim F. Storm
  2006-02-19 22:47         ` Richard M. Stallman
  2 siblings, 0 replies; 18+ messages in thread
From: Kim F. Storm @ 2006-02-19 13:31 UTC (permalink / raw)
  Cc: martin rudalics, rms, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

>> This should get you a right window with two columns only.  Now add the
>> fringes again.  This makes the right window display fringes only and no
>> text.
>
> That's to be expected, no?  Or do you think that turning on the fringe
> is supposed to increase the size of the window (I don't)?

Neither do I.

This behaviour is ok.

Messing with fringes and very narrow windows is not for the average
user -- it is something a mode may do for specific purposes -- and
then it can do the necessary stuff to undo things as well.

-- 
Kim F. Storm <storm@cua.dk> http://www.cua.dk

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18  3:58 ` Chong Yidong
                     ` (2 preceding siblings ...)
  2006-02-18 15:28   ` Chong Yidong
@ 2006-02-19 17:45   ` Richard M. Stallman
  3 siblings, 0 replies; 18+ messages in thread
From: Richard M. Stallman @ 2006-02-19 17:45 UTC (permalink / raw)
  Cc: rudalics, emacs-devel

    This patch removes the bug.  But I am not very familiar with the
    window code, so if someone could check that this is correct, it'd be
    great.

That is part of a loop which aims to

      /* Look at one sibling at a time,
	 moving away from this window in both directions alternately,
	 and take as much as we can get without deleting that sibling.  */

It tries to calculate precisely how much space it can take from each
sibling without causing it to be deleted:

	      int this_one = ((*sizefun) (next)
			      - window_min_size (XWINDOW (next),
						 horiz_flag, 0, &fixed_p));

If taking that much space causes the sibling to be deleted, I would
say that is a bug in the calculation of this_one.  The value must
be too large.

Can you figure out why it is too large, and what the correct value
should be?

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18 15:28   ` Chong Yidong
  2006-02-18 18:21     ` martin rudalics
@ 2006-02-19 17:45     ` Richard M. Stallman
  1 sibling, 0 replies; 18+ messages in thread
From: Richard M. Stallman @ 2006-02-19 17:45 UTC (permalink / raw)
  Cc: rudalics, emacs-devel

    On second thought, the patch I posted was the wrong fix.  I believe
    this one is correct (basically, size_window was checking for a
    safe_min_size that included the width of window fringes and
    scrollbars, but window_min_size_1 did not check for it).

This looks like the right kind of fix to me.

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18 22:14       ` Chong Yidong
  2006-02-19  9:44         ` martin rudalics
  2006-02-19 13:31         ` Kim F. Storm
@ 2006-02-19 22:47         ` Richard M. Stallman
  2 siblings, 0 replies; 18+ messages in thread
From: Richard M. Stallman @ 2006-02-19 22:47 UTC (permalink / raw)
  Cc: rudalics, emacs-devel

    > (with-selected-window (split-window-horizontally)
    >    (let ((window-min-width 2))
    >      (shrink-window (- (window-width) 2) t)))
    >
    > This should get you a right window with two columns only.  Now add the
    > fringes again.  This makes the right window display fringes only and no
    > text.

    That's to be expected, no?  Or do you think that turning on the fringe
    is supposed to increase the size of the window (I don't)?

I think it should delete the window.

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-18 13:06   ` martin rudalics
@ 2006-02-19 22:48     ` Richard M. Stallman
  2006-02-20 10:16       ` martin rudalics
  0 siblings, 1 reply; 18+ messages in thread
From: Richard M. Stallman @ 2006-02-19 22:48 UTC (permalink / raw)
  Cc: cyd, emacs-devel

    (with-selected-window (split-window-horizontally)
       (let ((window-min-width 1))
	 (shrink-window (1- (window-width)) t)
	 (message "?????")))

    doesn't display messages any more.

Is this before, or after, Yidong's latest change?

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-19  9:44         ` martin rudalics
@ 2006-02-20 10:11           ` martin rudalics
  2006-02-27  8:59             ` Richard Stallman
  2006-03-06 18:35             ` Richard Stallman
  0 siblings, 2 replies; 18+ messages in thread
From: martin rudalics @ 2006-02-20 10:11 UTC (permalink / raw)
  Cc: Chong Yidong, rms, emacs-devel

[-- Attachment #1: Type: text/plain, Size: 1209 bytes --]

  >  > That's to be expected, no?  Or do you think that turning on the fringe
  >  > is supposed to increase the size of the window (I don't)?
  >
  > I agree with you.  Unfortunately, Emacs doesn't.  When, in the sequel, I
  > try to drag the vertical divider between the two windows Emacs tells me
  > something like:
  >
  > Debugger entered--Lisp error: (error "Attempt to drag rightmost scrollbar")
  >   signal(error ("Attempt to drag rightmost scrollbar"))
  >   error("Attempt to drag rightmost scrollbar")
  >   mouse-drag-vertical-line((down-mouse-1 (#<window 10 on *scratch*>
  > vertical-line (1226 . 848) 3399399 nil 126 (0 . 3) nil (0 . 794) (1 .
  > 18))))
  >   call-interactively(mouse-drag-vertical-line)

That's a bug in `mouse-drag-vertical-line'.  It can be reproduced by
removing fringes and customizing window-min-width to 2.  If you now
split a window horizontally and drag the vertical divider such that the
right window shrinks to its minimum width you can't enlarge it anymore.

The bug occurs because `mouse-drag-vertical-line' compares coordinates
returned by `window-edges' with `frame-width'.  I believe that
`window-inside-edges' should be used here, see the attached patch.



[-- Attachment #2: mouse-patch --]
[-- Type: text/plain, Size: 2471 bytes --]

	* mouse.el (mouse-drag-vertical-line): Use window-inside-edges instead
	of window-edges.  Remove start-nwindows since it's not needed.


*** mouse.el	Thu Jan  5 07:44:38 2006
--- mouse.el	Mon Feb 20 10:47:32 2006
***************
*** 551,569 ****
  	 (echo-keystrokes 0)
  	 (start-event-frame (window-frame (car (car (cdr start-event)))))
  	 (start-event-window (car (car (cdr start-event))))
- 	 (start-nwindows (count-windows t))
  	 event mouse x left right edges wconfig growth
  	 (which-side
  	  (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
  	      'right)))
!     (if (one-window-p t)
! 	(error "Attempt to resize sole ordinary window"))
!     (if (eq which-side 'right)
! 	(if (= (nth 2 (window-edges start-event-window))
! 	       (frame-width start-event-frame))
! 	    (error "Attempt to drag rightmost scrollbar"))
!       (if (= (nth 0 (window-edges start-event-window)) 0)
! 	  (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
  	;; enlarge-window only works on the selected window, so
--- 551,570 ----
  	 (echo-keystrokes 0)
  	 (start-event-frame (window-frame (car (car (cdr start-event)))))
  	 (start-event-window (car (car (cdr start-event))))
  	 event mouse x left right edges wconfig growth
  	 (which-side
  	  (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
  	      'right)))
!     (cond
!      ((one-window-p t)
!       (error "Attempt to resize sole ordinary window"))
!      ((and (eq which-side 'right)
! 	   (= (nth 2 (window-inside-edges start-event-window))
! 	      (frame-width start-event-frame)))
!       (error "Attempt to drag rightmost scrollbar"))
!      ((and (eq which-side 'left)
! 	   (= (nth 0 (window-inside-edges start-event-window)) 0))
!       (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
  	;; enlarge-window only works on the selected window, so
***************
*** 609,615 ****
  			  (previous-window))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
! 			 edges (window-edges window)
  			 left (nth 0 edges)
  			 right (nth 2 edges))
  		   ;; scale back a move that would make the
--- 610,616 ----
  			  (previous-window))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
! 			 edges (window-inside-edges window)
  			 left (nth 0 edges)
  			 right (nth 2 edges))
  		   ;; scale back a move that would make the

[-- Attachment #3: Type: text/plain, Size: 142 bytes --]

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-19 22:48     ` Richard M. Stallman
@ 2006-02-20 10:16       ` martin rudalics
  0 siblings, 0 replies; 18+ messages in thread
From: martin rudalics @ 2006-02-20 10:16 UTC (permalink / raw)
  Cc: cyd, emacs-devel

>     (with-selected-window (split-window-horizontally)
>        (let ((window-min-width 1))
> 	 (shrink-window (1- (window-width)) t)
> 	 (message "?????")))
> 
>     doesn't display messages any more.
> 
> Is this before, or after, Yidong's latest change?

Before.  Hence, this problem has been resolved.

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-20 10:11           ` martin rudalics
@ 2006-02-27  8:59             ` Richard Stallman
  2006-03-06 18:35             ` Richard Stallman
  1 sibling, 0 replies; 18+ messages in thread
From: Richard Stallman @ 2006-02-27  8:59 UTC (permalink / raw)
  Cc: rudalics, cyd, emacs-devel

    That's a bug in `mouse-drag-vertical-line'.  It can be reproduced by
    removing fringes and customizing window-min-width to 2.  If you now
    split a window horizontally and drag the vertical divider such that the
    right window shrinks to its minimum width you can't enlarge it anymore.

    The bug occurs because `mouse-drag-vertical-line' compares coordinates
    returned by `window-edges' with `frame-width'.  I believe that
    `window-inside-edges' should be used here, see the attached patch.

Has this been fixed?

Does anyone see a problem in Martin's patch?


That's a bug in `mouse-drag-vertical-line'.  It can be reproduced by
removing fringes and customizing window-min-width to 2.  If you now
split a window horizontally and drag the vertical divider such that the
right window shrinks to its minimum width you can't enlarge it anymore.

The bug occurs because `mouse-drag-vertical-line' compares coordinates
returned by `window-edges' with `frame-width'.  I believe that
`window-inside-edges' should be used here, see the attached patch.



--------------090804020609060500080901
Content-Type: text/plain;
 name="mouse-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="mouse-patch"

	* mouse.el (mouse-drag-vertical-line): Use window-inside-edges instead
	of window-edges.  Remove start-nwindows since it's not needed.


*** mouse.el	Thu Jan  5 07:44:38 2006
--- mouse.el	Mon Feb 20 10:47:32 2006
***************
*** 551,569 ****
  	 (echo-keystrokes 0)
  	 (start-event-frame (window-frame (car (car (cdr start-event)))))
  	 (start-event-window (car (car (cdr start-event))))
- 	 (start-nwindows (count-windows t))
  	 event mouse x left right edges wconfig growth
  	 (which-side
  	  (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
  	      'right)))
!     (if (one-window-p t)
! 	(error "Attempt to resize sole ordinary window"))
!     (if (eq which-side 'right)
! 	(if (= (nth 2 (window-edges start-event-window))
! 	       (frame-width start-event-frame))
! 	    (error "Attempt to drag rightmost scrollbar"))
!       (if (= (nth 0 (window-edges start-event-window)) 0)
! 	  (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
  	;; enlarge-window only works on the selected window, so
--- 551,570 ----
  	 (echo-keystrokes 0)
  	 (start-event-frame (window-frame (car (car (cdr start-event)))))
  	 (start-event-window (car (car (cdr start-event))))
  	 event mouse x left right edges wconfig growth
  	 (which-side
  	  (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
  	      'right)))
!     (cond
!      ((one-window-p t)
!       (error "Attempt to resize sole ordinary window"))
!      ((and (eq which-side 'right)
! 	   (= (nth 2 (window-inside-edges start-event-window))
! 	      (frame-width start-event-frame)))
!       (error "Attempt to drag rightmost scrollbar"))
!      ((and (eq which-side 'left)
! 	   (= (nth 0 (window-inside-edges start-event-window)) 0))
!       (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
  	;; enlarge-window only works on the selected window, so
***************
*** 609,615 ****
  			  (previous-window))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
! 			 edges (window-edges window)
  			 left (nth 0 edges)
  			 right (nth 2 edges))
  		   ;; scale back a move that would make the
--- 610,616 ----
  			  (previous-window))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
! 			 edges (window-inside-edges window)
  			 left (nth 0 edges)
  			 right (nth 2 edges))
  		   ;; scale back a move that would make the

--------------090804020609060500080901--

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-02-20 10:11           ` martin rudalics
  2006-02-27  8:59             ` Richard Stallman
@ 2006-03-06 18:35             ` Richard Stallman
  2006-03-06 18:45               ` Chong Yidong
  1 sibling, 1 reply; 18+ messages in thread
From: Richard Stallman @ 2006-03-06 18:35 UTC (permalink / raw)
  Cc: rudalics, cyd, emacs-devel

[I sent this message a week ago but did not get a response.]

    That's a bug in `mouse-drag-vertical-line'.  It can be reproduced by
    removing fringes and customizing window-min-width to 2.  If you now
    split a window horizontally and drag the vertical divider such that the
    right window shrinks to its minimum width you can't enlarge it anymore.

    The bug occurs because `mouse-drag-vertical-line' compares coordinates
    returned by `window-edges' with `frame-width'.  I believe that
    `window-inside-edges' should be used here, see the attached patch.

Has this been fixed?

Does anyone see a problem in Martin's patch?


That's a bug in `mouse-drag-vertical-line'.  It can be reproduced by
removing fringes and customizing window-min-width to 2.  If you now
split a window horizontally and drag the vertical divider such that the
right window shrinks to its minimum width you can't enlarge it anymore.

The bug occurs because `mouse-drag-vertical-line' compares coordinates
returned by `window-edges' with `frame-width'.  I believe that
`window-inside-edges' should be used here, see the attached patch.



--------------090804020609060500080901
Content-Type: text/plain;
 name="mouse-patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="mouse-patch"

	* mouse.el (mouse-drag-vertical-line): Use window-inside-edges instead
	of window-edges.  Remove start-nwindows since it's not needed.


*** mouse.el	Thu Jan  5 07:44:38 2006
--- mouse.el	Mon Feb 20 10:47:32 2006
***************
*** 551,569 ****
  	 (echo-keystrokes 0)
  	 (start-event-frame (window-frame (car (car (cdr start-event)))))
  	 (start-event-window (car (car (cdr start-event))))
- 	 (start-nwindows (count-windows t))
  	 event mouse x left right edges wconfig growth
  	 (which-side
  	  (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
  	      'right)))
!     (if (one-window-p t)
! 	(error "Attempt to resize sole ordinary window"))
!     (if (eq which-side 'right)
! 	(if (= (nth 2 (window-edges start-event-window))
! 	       (frame-width start-event-frame))
! 	    (error "Attempt to drag rightmost scrollbar"))
!       (if (= (nth 0 (window-edges start-event-window)) 0)
! 	  (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
  	;; enlarge-window only works on the selected window, so
--- 551,570 ----
  	 (echo-keystrokes 0)
  	 (start-event-frame (window-frame (car (car (cdr start-event)))))
  	 (start-event-window (car (car (cdr start-event))))
  	 event mouse x left right edges wconfig growth
  	 (which-side
  	  (or (cdr (assq 'vertical-scroll-bars (frame-parameters start-event-frame)))
  	      'right)))
!     (cond
!      ((one-window-p t)
!       (error "Attempt to resize sole ordinary window"))
!      ((and (eq which-side 'right)
! 	   (= (nth 2 (window-inside-edges start-event-window))
! 	      (frame-width start-event-frame)))
!       (error "Attempt to drag rightmost scrollbar"))
!      ((and (eq which-side 'left)
! 	   (= (nth 0 (window-inside-edges start-event-window)) 0))
!       (error "Attempt to drag leftmost scrollbar")))
      (track-mouse
        (progn
  	;; enlarge-window only works on the selected window, so
***************
*** 609,615 ****
  			  (previous-window))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
! 			 edges (window-edges window)
  			 left (nth 0 edges)
  			 right (nth 2 edges))
  		   ;; scale back a move that would make the
--- 610,616 ----
  			  (previous-window))))
  		   (setq x (- (car (cdr mouse))
  			      (if (eq which-side 'right) 0 2))
! 			 edges (window-inside-edges window)
  			 left (nth 0 edges)
  			 right (nth 2 edges))
  		   ;; scale back a move that would make the

--------------090804020609060500080901--

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

* Re: [rudalics@gmx.at: check_min_window_sizes]
  2006-03-06 18:35             ` Richard Stallman
@ 2006-03-06 18:45               ` Chong Yidong
  0 siblings, 0 replies; 18+ messages in thread
From: Chong Yidong @ 2006-03-06 18:45 UTC (permalink / raw)
  Cc: martin rudalics, emacs-devel

Richard Stallman <rms@gnu.org> writes:

> [I sent this message a week ago but did not get a response.]
>
>     That's a bug in `mouse-drag-vertical-line'.  It can be reproduced by
>     removing fringes and customizing window-min-width to 2.  If you now
>     split a window horizontally and drag the vertical divider such that the
>     right window shrinks to its minimum width you can't enlarge it anymore.
>
>     The bug occurs because `mouse-drag-vertical-line' compares coordinates
>     returned by `window-edges' with `frame-width'.  I believe that
>     `window-inside-edges' should be used here, see the attached patch.
>
> Does anyone see a problem in Martin's patch?

Apparently not.

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

end of thread, other threads:[~2006-03-06 18:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-13  4:40 [rudalics@gmx.at: check_min_window_sizes] Richard M. Stallman
2006-02-18  3:58 ` Chong Yidong
2006-02-18 11:10   ` martin rudalics
2006-02-18 13:06   ` martin rudalics
2006-02-19 22:48     ` Richard M. Stallman
2006-02-20 10:16       ` martin rudalics
2006-02-18 15:28   ` Chong Yidong
2006-02-18 18:21     ` martin rudalics
2006-02-18 22:14       ` Chong Yidong
2006-02-19  9:44         ` martin rudalics
2006-02-20 10:11           ` martin rudalics
2006-02-27  8:59             ` Richard Stallman
2006-03-06 18:35             ` Richard Stallman
2006-03-06 18:45               ` Chong Yidong
2006-02-19 13:31         ` Kim F. Storm
2006-02-19 22:47         ` Richard M. Stallman
2006-02-19 17:45     ` Richard M. Stallman
2006-02-19 17:45   ` Richard M. Stallman

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