From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "N. Jackson" Newsgroups: gmane.emacs.devel Subject: Suggesting `frame-split-biggest-window' Re: customize location and shape of a new window in a frame Date: Wed, 12 Sep 2018 19:21:25 -0400 Message-ID: <875zzawbd6.fsf_-_@moondust.localdomain> References: <9755.9843.306611.23448@gargle.gargle.HOWL> <87y3c7pw4w.fsf@ericabrahamsen.net> <87h8iuik3g.fsf@moondust.localdomain> <87o9d2eaql.fsf@ericabrahamsen.net> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1536794378 22237 195.159.176.226 (12 Sep 2018 23:19:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 12 Sep 2018 23:19:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Roland Winkler , Stefan Monnier , emacs-devel@gnu.org To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 13 01:19:34 2018 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1g0EPy-0005cJ-Tx for ged-emacs-devel@m.gmane.org; Thu, 13 Sep 2018 01:19:31 +0200 Original-Received: from localhost ([::1]:38905 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0ES5-0008RK-CX for ged-emacs-devel@m.gmane.org; Wed, 12 Sep 2018 19:21:41 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g0ERv-0008RF-VO for emacs-devel@gnu.org; Wed, 12 Sep 2018 19:21:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g0ERv-0001CH-4A for emacs-devel@gnu.org; Wed, 12 Sep 2018 19:21:31 -0400 Original-Received: from mail-io1-xd31.google.com ([2607:f8b0:4864:20::d31]:40101) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g0ERr-00019X-JJ; Wed, 12 Sep 2018 19:21:27 -0400 Original-Received: by mail-io1-xd31.google.com with SMTP id l14-v6so1661854iob.7; Wed, 12 Sep 2018 16:21:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=XyqvZEIxT+ma8TZ0HoAOTF7jYLVKSo7lht0xZxGDGMc=; b=Bid/Ab+kKSlzgzzpDITKBOoRIcGZ3xf3xUgPbXxTCecMuOs+551BxQ7ODx60IP8XAd 4F6FPyb5C4N6cjANAlOI9EGswzOKF0rMgtLkfTHtsXUFGqKdguolWlV4/RyyS9B1buS2 CTeLDHBny52ltAEMSPgQ3zv1uidTIEztC7nLHC5szJngSK7I2r8/2F1SvV0zrW/ZZHZx +yGmzKZJiZ0QlqfJtjke/4yfQpTeGFMaOjh4xeThWIhJBAKQ7J47gbauBUl4bNjAtuKv jmhnbLYsTgJi1nz+xWZfQPu2GXPoQ2atPWVvdtzzf9hpT+NjYDFZWImA43myzH5LpMSV uqmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=XyqvZEIxT+ma8TZ0HoAOTF7jYLVKSo7lht0xZxGDGMc=; b=pOo+Dup/mvFt2ECKqb1+zgBB7n51KsctyfP0Jui9IG1n+utDKQ5x4aRBL8aei7sa/J fj7MnH3MAg6jOKMT0s4U2bgf3k6OaWKKWuXRTPi3J/6Q3j19zGzpPSR0BFGW+k3Gnw8D NhqE+TdpxdNMy1A+3aTE1SEmfR0qaL+7lwsiagj/IWav3amf3DRahUBRDkhkLDF/Zu9G IOZs8y/Dm3JE4rCL4sZGIuBqAPJJItHocB78a+Yzzf0OUqpeD83c8pGufuqhgR1LF0Yg Z/5fD5LnSqctw7xEqOqjhv44O7Jhp06eCZlSmuJoBb1MvhbaOCJOe8CuACGHzwAwfLRt HM3Q== X-Gm-Message-State: APzg51CF3K0BC2rGvudPW2512sVWeb3DyD4EI4FpqWnbSjxiFhsFRpFX rSL+DcQi8ys0T+JcrypdLFB3BlaV X-Google-Smtp-Source: ANB0VdblxehFkmIioH6ittn2lnL/6gSVxj2IA0VTo5HXU5+Ig1ERUqH9e4FXOhfxQVFwzSoBVw7fNg== X-Received: by 2002:a6b:6a19:: with SMTP id x25-v6mr3894093iog.177.1536794486756; Wed, 12 Sep 2018 16:21:26 -0700 (PDT) Original-Received: from moondust.localdomain.nodomain.none (toroon474qw-lp130-08-70-26-73-61.dsl.bell.ca. [70.26.73.61]) by smtp.gmail.com with ESMTPSA id v5-v6sm781606ioe.61.2018.09.12.16.21.25 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 12 Sep 2018 16:21:26 -0700 (PDT) In-Reply-To: <87o9d2eaql.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 12 Sep 2018 13:12:18 -0700") X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::d31 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:229727 Archived-At: Thanks Eric, At 13:12 -0700 on Wednesday 2018-09-12, Eric Abrahamsen wrote: > > On 09/12/18 15:36 PM, N. Jackson wrote: >> At 14:22 -0700 on Tuesday 2018-09-11, Eric Abrahamsen wrote: >>> >>> (add-to-list 'gnus-window-to-buffer >>> `(bbdb-gnus . "*BBDB*")) >>> >>> (gnus-add-configuration >>> (article >>> ,(cond >>> (gnus-use-trees >>> '(vertical 1.0 >>> (summary 0.25 point) >>> (tree 0.25) >>> (horizontal 1.0 >>> (article 1.0) >>> (bbdb-gnus 0.4)))) >>> (t >>> '(vertical 1.0 >>> (summary 0.25 point) >>> (horizontal 1.0 >>> (article 1.0) >>> (bbdb-gnus 0.4)))))) >> >> Evaluating the second form gives: >> >> Debugger entered--Lisp error: (void-function article) > > Yup, that was a cut-and-paste problem from my larger config. Just stick > a ` before the "(article" part. After quoting with a ' (not a `) and removing the comma before the `cond', this does exactly what I was looking for. I now have the following in my .gnus file: ;;; 2018-09-12 Arrange for Gnus to place BBDB window sensibly. (add-to-list 'gnus-window-to-buffer `(bbdb-gnus . "*BBDB*")) (gnus-add-configuration '(article (cond (gnus-use-trees '(vertical 1.0 (summary 0.25 point) (tree 0.25) (horizontal 1.0 (article 1.0) (bbdb-gnus 0.4)))) (t '(vertical 1.0 (summary 0.25 point) (horizontal 1.0 (article 1.0) (bbdb-gnus 0.4))))))) However, it seems odd to be able to get this: +-------------------------------+ | | | Summary | | | +-------------------------------+ | | | | | Article | | | | | |-------------------------------| | BBDB | +-------------------------------+ and this: +-------------------------------+ | | | | Summary | BBDB | | | | +-------------------------------+ | | | | | | | Article | | | | | | | +-------------------------------+ simply by customizing the variable `bbdb-mua-pop-up', but in order to get +-------------------------------+ | | | Summary | | | +-------------------------------+ | | | | | | | | | | Article | BBDB | | | | | | | | | | +-------------------------------+ the user has to do some fairly heavy-duty configuration in Gnus. I'm impressed by the power of this feature in Gnus, but it feels like overkill for a case like this. It seems to me that what is really needed is a new function or three. Currently `bbdb-pop-up-window' uses `split-window' to display its window. The problem here is that `split-window' takes a WINDOW argument so BBDB first has to figure out which window to split. If there was a function (frame-split-biggest-window FRAME SIZE SIDE PIXELWISE) to split the "biggest" [*] window in the frame, then neither BBDB nor any other Elisp code would need to keep reinventing this wheel. (The other two functions, more for interactive use, would be `frame-split-biggest-window-below' and `frame-split-biggest-window-right'.) [*] To find the "biggest" window when splitting below, find the tallest window or windows and split the widest of them; when splitting right, find the widest window or windows and split the tallest of them.