all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
Cc: Chong Yidong <cyd@stupidchicken.com>, rms@gnu.org, emacs-devel@gnu.org
Subject: Re: [rudalics@gmx.at: check_min_window_sizes]
Date: Mon, 20 Feb 2006 11:11:53 +0100	[thread overview]
Message-ID: <43F995E9.4020209@gmx.at> (raw)
In-Reply-To: <43F83E04.7020000@gmx.at>

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

  reply	other threads:[~2006-02-20 10:11 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 [this message]
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

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=43F995E9.4020209@gmx.at \
    --to=rudalics@gmx.at \
    --cc=cyd@stupidchicken.com \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.