unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Stallman <rms@gnu.org>
Cc: rudalics@gmx.at, cyd@stupidchicken.com, emacs-devel@gnu.org
Subject: Re: [rudalics@gmx.at: check_min_window_sizes]
Date: Mon, 06 Mar 2006 13:35:59 -0500	[thread overview]
Message-ID: <E1FGKYp-0001Dv-LN@fencepost.gnu.org> (raw)
In-Reply-To: <43F995E9.4020209@gmx.at> (message from martin rudalics on Mon, 20 Feb 2006 11:11:53 +0100)

[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--

  parent reply	other threads:[~2006-03-06 18:35 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

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=E1FGKYp-0001Dv-LN@fencepost.gnu.org \
    --to=rms@gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /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.
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).