[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: describe-{function,variable} shrinks frame (GTK+/KDE)

From: Stephen Berman
Subject: Re: describe-{function,variable} shrinks frame (GTK+/KDE)
Date: Mon, 19 Nov 2007 14:53:27 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux)

On Sun, 18 Nov 2007 23:21:27 +0100 martin rudalics <address@hidden> wrote:

>> By stepping through srb-shrink-test-1 with edebug, I have seen the
>> reduction in frame-height occur in two places (on two different
>> invocations of srb-shrink-test-1 after emacs -Q): as above, after the
>> (sit-for 0.5) that immediately precedes (delete-other-windows), but also
>> after the (sit-for 0.5) that follows (delete-other-windows).
> I still don't understand.  Does it shrink after describe-... _and_ after
> `delete-other-windows'?

Sorry, my explanation was rather convoluted.  Here is srb-shrink-test-1:

     1  (defun srb-shrink-test-1 ()
     2    "Call Info, then repeatedly call describe-function or
     3  describe-variable interactively, deleting the Help buffer in
     4  between.  If the frame height changes, stop."
     5    (interactive)
     6    (info)
     7    (let ((ht (frame-height))
     8          elt)
     9      (message "frame height: %d" ht)
    10      (sit-for 0.5)
    11      (setq elt (srb-randsym))
    12      (while (not (or (functionp elt) (boundp elt)))
    13        (setq elt (srb-randsym)))
    14      (cond ((functionp elt) 
    15             (call-interactively 'describe-function))
    16            ((boundp elt) 
    17             (call-interactively 'describe-variable))
    18            (t 'ignore))
    19      (sit-for 0.5)
    20      (delete-other-windows)
    21      (sit-for 0.5)
    22      (if (= ht (frame-height))
    23          (srb-shrink-test-1)
    24        (message "frame height: %d" (frame-height)))))

What I meant is that, on distinct invocations of srb-shrink-test-1 after
emacs -Q, the point at which frame-height shrank was different: on one
invocation between lines 19 and 20, on another invocation between lines
21 and 22.  

Since my last post I have tested further, and have also seen the
shrinkage occur between lines 10 and 11, i.e. before calling describe-*.
In this case there was, within the same invocation of srb-shrink-test-1,
a further shrinkage between line 21 and 22, and a third shrinkage at the
end of srb-shrink-test-1, after the last message.  In other words,
before invoking srb-shrink-test-1, frame-height was 40, afterwards it
was 37.  (In the same test, I continued calling srb-shrink-test-1: after
the next call, frame height was 35, then (another invocation) 34, then
(another invocation) 34 again, then (same invocation with recursive
call) 33, then (another invocation) 33, then (same invocation with
recursive call) 32, then I stopped.)

I have also tried several other variants.  In view of the observations
in the preceding paragraph, I tried just calling info and sit-for but no
describe-*.  With this I got no frame-height reduction just by calling
the function, but when stepping through it with edebung, frame-height
shrank right after sit-for.  I also tried a version with no calls to
sit-for (but with calls to describe-*), sometimes getting a reduction in
frame-height, sometimes not.  I haven't been able to get a fix on the
behavior here.

I also found another conditioning element besides Info: namely,
emacs-w3m.  That, replacing in srb-shrink-test-1 (info) by (require
'w3m) and (w3m), I also observed shrinkage in frame-height.  Like Info,
emacs-w3m also has a customizable variable w3m-use-header-line; but
after toggling it off, setting for the current session, and then
starting w3m, the header line was still present.

>>>Unfortunately, it seems impossible to turn that line off by setting
>>>`Info-use-header-line', so I don't know how to test this.
>> I loaded the info library, did `M-x customize-variable RET
>> Info-use-header-line RET', clicked it to off with toggle button and set
>> it for the current session.  Then I invoked srb-shrink-test-1 and the
>> Info buffer came up without a header line (C-h v header-line-format in
>> that buffer said its value is nil).  Did you do the same thing and get a
>> different result, or did you do something else?
> I did the same thing and apparently got the same result but
> misinterpreted it.
>> It seems that
>> the header line is not relevant, but invoking info is.
> It's nonetheless interesting that it always shrinks by one line.  Could
> you try with a very high frame (one that doesn't fit on your screen)?

I could not get the height (or the width) to exceed the accessible
screen dimenions (either by modifying frame-parameters or by using the
-g command line option).  I don't know if this is dues to KDE or GTK+.
However, with (modify-frame-parameters frame '((fullscreen . fullboth)))
I did get a borderless Emacs frame filling the screen, and calling
srb-shrink-test-1 with this frame, I could not get a reduction in

> Also, can you repeat it with info and `split-window' alone, that is,
> without calling describe-... ?

This behaved like the variant I mentioned above with just info and
sit-for: there was no frame-height reduction when just calling the
function, but there was a reduction when stepping through with edebug;
again, after sit-for, i.e. before split-window.  Note, however, that
when debugging with edebug, the frame is in fact split vertically, so
maybe that provides the necessary condition (but that doesn't explain
why I did not get the reduction here outside of edebug...).

So far, the more I've tested, the muddier the water has become, and I
think I've failed to achieve real insight into what's going on.

Steve Berman 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]