unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* window-resizable confusion
@ 2011-11-08 15:10 Chong Yidong
  2011-11-08 18:12 ` martin rudalics
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2011-11-08 15:10 UTC (permalink / raw)
  To: emacs-devel

  (window-resizable WINDOW DELTA &optional HORIZONTAL IGNORE TRAIL NOUP
  NODOWN)

  Return DELTA if WINDOW can be resized vertically by DELTA lines.
  ...
  Optional argument NODOWN non-nil means don't check whether WINDOW
  and its child windows can be resized.

I don't understand the NODOWN argument.  When NODOWN is non-nil, the
docstring says the function doesn't check whether WINDOW can be resized.
So what else is it doing instead?



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

* Re: window-resizable confusion
  2011-11-08 15:10 window-resizable confusion Chong Yidong
@ 2011-11-08 18:12 ` martin rudalics
  2011-11-09  6:47   ` Chong Yidong
  0 siblings, 1 reply; 4+ messages in thread
From: martin rudalics @ 2011-11-08 18:12 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

 >   (window-resizable WINDOW DELTA &optional HORIZONTAL IGNORE TRAIL NOUP
 >   NODOWN)
 >
 >   Return DELTA if WINDOW can be resized vertically by DELTA lines.
 >   ...
 >   Optional argument NODOWN non-nil means don't check whether WINDOW
 >   and its child windows can be resized.
 >
 > I don't understand the NODOWN argument.  When NODOWN is non-nil, the
 > docstring says the function doesn't check whether WINDOW can be resized.
 > So what else is it doing instead?

The answer to the question whether a window W can be resized consists of
two parts - a "down" part and an "up" part.  In the down part I check
whether resizing would violate the min-/fixed-size restrictions of W or,
if W is internal, the leaf windows of W's subtree.  In the up part I
check whether resizing W would violate the min-/fixed-size restrictions
of W's siblings, its parent's siblings, ...

NODOWN non-nil means do not perform the down part because it's not
needed, for example, when W is deleted or I already know that W or its
subwindows can be given the requested size.

The doc-string is obviously silly in this respect.  If you can do any
better, please try.  Otherwise, I'll fix it somehow.

martin



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

* Re: window-resizable confusion
  2011-11-08 18:12 ` martin rudalics
@ 2011-11-09  6:47   ` Chong Yidong
  2011-11-09  9:45     ` martin rudalics
  0 siblings, 1 reply; 4+ messages in thread
From: Chong Yidong @ 2011-11-09  6:47 UTC (permalink / raw)
  To: martin rudalics; +Cc: emacs-devel

martin rudalics <rudalics@gmx.at> writes:

> The answer to the question whether a window W can be resized consists of
> two parts - a "down" part and an "up" part.  In the down part I check
> whether resizing would violate the min-/fixed-size restrictions of W or,
> if W is internal, the leaf windows of W's subtree.  In the up part I
> check whether resizing W would violate the min-/fixed-size restrictions
> of W's siblings, its parent's siblings, ...
>
> NODOWN non-nil means do not perform the down part because it's not
> needed, for example, when W is deleted or I already know that W or its
> subwindows can be given the requested size.
>
> The doc-string is obviously silly in this respect.  If you can do any
> better, please try.  Otherwise, I'll fix it somehow.

I think the NOUP and NODOWN arguments should be replaced with a single
argument, SUBTREE.  If the value is `upper-tree', that would be
equivalent to NODOWN non-nil; if the value is `lower-tree', that would
be equivalent to NOUP non-nil.



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

* Re: window-resizable confusion
  2011-11-09  6:47   ` Chong Yidong
@ 2011-11-09  9:45     ` martin rudalics
  0 siblings, 0 replies; 4+ messages in thread
From: martin rudalics @ 2011-11-09  9:45 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel

 > I think the NOUP and NODOWN arguments should be replaced with a single
 > argument, SUBTREE.  If the value is `upper-tree', that would be
 > equivalent to NODOWN non-nil; if the value is `lower-tree', that would
 > be equivalent to NOUP non-nil.

I'm not sure whether there are cases where I call this with both NOUP
and NODOWN non-nil, meaning don't check the argument window's sizes and
stay within the argument window's siblings.  So this would be a rather
hazardous change.

Instead I wrote a new function `window--resizable' which is a copy of
the old `window-resizable' and rewrote `window-resizable' such that it
doesn't have the NOUP and NODOWN arguments (which are only useful for
the internal workings of window resizing anyway).  It now doesn't have
the TRAIL/SIDE argument either which is only needed for implementing
`adjust-window-trailing-edge'.  Please have a look.

I still have to rename a number of window.el internal functions to use
the "window--" prefix.

martin



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

end of thread, other threads:[~2011-11-09  9:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-08 15:10 window-resizable confusion Chong Yidong
2011-11-08 18:12 ` martin rudalics
2011-11-09  6:47   ` Chong Yidong
2011-11-09  9:45     ` 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).