From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: describe-{function,variable} shrinks frame (GTK+/KDE) Date: Sun, 18 Nov 2007 00:42:27 +0100 Message-ID: <87abpc782k.fsf@escher.local.home> References: <876401dbee.fsf@escher.local.home> <473EB161.2020003@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1195342986 16639 80.91.229.12 (17 Nov 2007 23:43:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 17 Nov 2007 23:43:06 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 18 00:43:11 2007 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1ItXJd-0003EU-Mm for ged-emacs-devel@m.gmane.org; Sun, 18 Nov 2007 00:43:09 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItXJQ-00048q-JS for ged-emacs-devel@m.gmane.org; Sat, 17 Nov 2007 18:42:56 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ItXJM-00047Q-S6 for emacs-devel@gnu.org; Sat, 17 Nov 2007 18:42:52 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ItXJM-00046b-5G for emacs-devel@gnu.org; Sat, 17 Nov 2007 18:42:52 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ItXJM-00046Q-1P for emacs-devel@gnu.org; Sat, 17 Nov 2007 18:42:52 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ItXJL-0002ri-Ck for emacs-devel@gnu.org; Sat, 17 Nov 2007 18:42:51 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ItXJB-0003jj-VU for emacs-devel@gnu.org; Sat, 17 Nov 2007 23:42:41 +0000 Original-Received: from i577bf982.versanet.de ([87.123.249.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 17 Nov 2007 23:42:41 +0000 Original-Received: from Stephen.Berman by i577bf982.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 17 Nov 2007 23:42:41 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 105 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: i577bf982.versanet.de User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:83493 Archived-At: On Sat, 17 Nov 2007 10:16:17 +0100 martin rudalics wrote: >> This recipe isn't completely reliable: what seems to be constant are the >> prior invocation of Info and unsplitting the windows between the >> describe-* calls; otherwise, sometimes the shrinkage happens after the >> first call to describe-{function,variable}, sometimes it takes several >> iterations of steps 2.-5. The function/variable names are examples, >> probably any will do. Once the shrinkage begins, it progresses with >> subsequent describe-* calls. > > Leaving an Emacs frame for some time unattended with > > (defun foo () > (interactive) > (while t > (split-window) > (when (zerop (logand (random) 1)) > (other-window 1)) > (sit-for 0.5) > (if (zerop (logand (random) 1)) > (delete-window) > (delete-other-windows)) > (sit-for 0.5))) > > doesn't show the behavior (just to rule out more trivial causes like > window splitting / deleting)? No, this does not change frame-height. In fact, I had already manually tried repeatedly splitting and unspitting and did not see any problem. But your test gave me an idea to try and reproduce the behavior I observed programmatically. I started Emacs with -Q and evalled the following functions: (defun srb-randsym () "Return a random Emacs lisp symbol." (random t) (let* ((rnum (random (length obarray))) (elt (aref obarray rnum))) elt)) (defun srb-shrink-test-0 () "Call Info, then repeatedly call describe-function or describe-variable on a random elisp function or variable, deleting the Help buffer in between. If the frame height changes, stop." (interactive) (info) (let ((ht (frame-height)) elt) (message "frame height: %d" ht) (sit-for 0.5) (setq elt (srb-randsym)) (while (not (or (functionp elt) (boundp elt))) (setq elt (srb-randsym))) (cond ((functionp elt) (describe-function elt)) ((boundp elt) (describe-variable elt)) (t 'ignore)) (sit-for 0.5) (delete-other-windows) (sit-for 0.5) (if (= ht (frame-height)) (srb-shrink-test-0) (message "frame height: %d" (frame-height))))) I invoked srb-shrink-test-0 and let it run though many iterations, but frame-height remained unchanged. Then I evalled the following function, which differs from the above only in calling describe-{function,variable} interactively: (defun srb-shrink-test-1 () "Call Info, then repeatedly call describe-function or describe-variable interactively, deleting the Help buffer in between. If the frame height changes, stop." (interactive) (info) (let ((ht (frame-height)) elt) (message "frame height: %d" ht) (sit-for 0.5) (setq elt (srb-randsym)) (while (not (or (functionp elt) (boundp elt))) (setq elt (srb-randsym))) (cond ((functionp elt) (call-interactively 'describe-function)) ((boundp elt) (call-interactively 'describe-variable)) (t 'ignore)) (sit-for 0.5) (delete-other-windows) (sit-for 0.5) (if (= ht (frame-height)) (srb-shrink-test-1) (message "frame height: %d" (frame-height))))) I invoked this and frame-height diminished by one line after the first interactive call. I have repeated this many times and every time frame-height has shrunk, whereas with srb-shrink-test-0 it has never shrunk. It seems that call-interactively is somehow involved in shrinking frame-height. I looked at the source code but found nothing suggestive; but it is a very long and complex function, and I don't know what to look for. It doesn't help that this problem seems to be restricted to GTK+ builds running under gtk-qt. Steve Berman