From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id wFoVByUMrl4mRgAA0tVLHw (envelope-from ) for ; Sun, 03 May 2020 00:11:17 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 4JbzIS4Mrl5ZCwAAB5/wlQ (envelope-from ) for ; Sun, 03 May 2020 00:11:26 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3684B944251 for ; Sun, 3 May 2020 00:11:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 520996DE0F07; Sat, 2 May 2020 17:11:19 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tD6qEVyb7kFg; Sat, 2 May 2020 17:11:18 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id B7F4C6DE0EB5; Sat, 2 May 2020 17:11:17 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id B8A396DE0EB5 for ; Sat, 2 May 2020 17:11:16 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IfsaxwPD8ycH for ; Sat, 2 May 2020 17:11:13 -0700 (PDT) Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) by arlo.cworth.org (Postfix) with ESMTPS id 415D86DE091E for ; Sat, 2 May 2020 17:11:13 -0700 (PDT) Received: by mail-qt1-f178.google.com with SMTP id h26so11019243qtu.8 for ; Sat, 02 May 2020 17:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=goLQN43t5nPs7cWO8GEFZ+VQ/6kssRA2XCUe7XyLxro=; b=SOwCfHjkoI249oOrTRJbd4jNct94RHUK1kLVwLyFxFYj7V8niMhQmJAS0xwk9lmvM2 jMbEGzXhGlu3/KGG5jaPxPLaH8qadH5lX4h9QWxvPFuTGgRBsvDFSBokJ16Tf9rrKzry PyXdnVa4hd7cZx40LmWCBmX1ZZ+QCLXR1NuCeOHBseWv53dtNCCWrWfncy/Fh+4suGkn wvdYPlbOGhbLhsWAKNUrbTwFbSpurrJ5VhwYDfZZwqwLtVPtkCEiTwigfLRJmlmYypYr F0bMA21DFBvOuHJiextNPWkRMVBBaej55pChcnt+68ajlo74YilUsaotwh8Rhmv90o8v d86g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=goLQN43t5nPs7cWO8GEFZ+VQ/6kssRA2XCUe7XyLxro=; b=DTcW6WWNJDZ/G5J8Uu21xiV9sgEPEND2c128kztLRWk8Q3r213c9haiq7itafu7Dj7 y22vwukSZsz6GQik19HPDz1eEJrOpYXW90TJZ8ekHlumG+enDe7TMZw+83ROzgpxQUXJ Sp9l3mUe4ETVZWFWeAxsI9vm1K82gzWDCvQ5MdpdCWCrv6vW1Lbczehlme1qi97FjGUJ eU4Cl1YtuZIlrPvrz98zWpvnKN3XTjwlTrRoAV8u9WDE2DWLHQei9sB1fhn8EaAv+VXM XjfHb6J/ppTAv9doRQf0wSN5TyW9JA3fi/v49T3KH/CE/z8rzGxCTKSfrVXhP/b7n1eL rEiQ== X-Gm-Message-State: AGi0PuYc394F96x5ESpI55vwfuhGsdjlvRnGzZaeiAznpDmWzP9v9RV6 TA5tVuV7acN7cL9CmTx795XQUcxL X-Google-Smtp-Source: APiQypJQenceI8+7ndq/igt/pbuPasgqotA6njd8ZJf5ZNed2KH0gh7jlBnCoypwJZe9RVcg2oi8Uw== X-Received: by 2002:ac8:19dd:: with SMTP id s29mr10727431qtk.164.1588464671426; Sat, 02 May 2020 17:11:11 -0700 (PDT) Received: from localhost ([2620:0:1003:321:28f5:a8b5:88d8:505b]) by smtp.gmail.com with ESMTPSA id m7sm6302744qti.6.2020.05.02.17.11.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 02 May 2020 17:11:10 -0700 (PDT) From: Radu Butoi To: notmuch@notmuchmail.org Subject: [PATCH] emacs: split-window-sensibly in tree mode with open message Date: Sat, 02 May 2020 20:11:09 -0400 Message-ID: MIME-Version: 1.0 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: 0.09 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=gmail.com header.s=20161025 header.b=SOwCfHjk; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [0.09 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.46391527591704]; DWL_DNSWL_BLOCKED(0.00)[50.126.95.6:from]; R_SPF_ALLOW(-0.20)[+a:c]; R_DKIM_REJECT(1.00)[gmail.com:s=20161025]; FREEMAIL_FROM(0.00)[gmail.com]; TO_DN_NONE(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.00), ip: 50.126.95.6(-0.46)]; DKIM_TRACE(0.00)[gmail.com:-]; MX_GOOD(-0.50)[cached: notmuchmail.org]; MAILLIST(-0.20)[mailman]; RCVD_IN_DNSWL_FAIL(0.00)[50.126.95.6:server fail]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; FROM_NEQ_ENVFROM(0.00)[rbutoi@gmail.com,notmuch-bounces@notmuchmail.org]; ARC_NA(0.00)[]; URIBL_BLOCKED(0.00)[nabble.com:url,notmuchmail.org:email]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_COUNT_SEVEN(0.00)[9]; FORGED_SENDER_MAILLIST(0.00)[]; DMARC_POLICY_SOFTFAIL(0.10)[gmail.com : SPF not aligned (relaxed),none] X-TUID: reeYhdDoFPVd Hello, This uses the standard Emacs function `split-window-sensibly` to split a window horizontally or vertically depending on space when opening a message in tree view. By default, split-width-threshold is 160 columns (and -height- is nil), so screens wider than 160 will be split horizontally. This is based on an older proposal [1] which manually did the calculation of width. The main issues there were (1) lack of configurability and (2) lack of testing. I don't have an answer for testing, but this allows users to configure two thresholds using built-in variables, an improvement. Also, should I update the NEWS file? I see its latest changes are in November and there's been user-visible changes since. Thanks, Radu [1]: http://notmuch.198994.n3.nabble.com/emacs-Split-wide-window-vertically-for-tree-mode-message-pane-td4039070.html The original patch email follows: >From 1ce4789b11007b46619faed7bf14f54686ca3538 Mon Sep 17 00:00:00 2001 From: Radu Butoi Subject: [PATCH] emacs: split-window-sensibly in tree mode with open message When showing messages in tree-mode, this will split the window horizontally or vertically depending on the split-{width,height}-threshold. --- emacs/notmuch-tree.el | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index 254664c4..353700a1 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -524,8 +524,7 @@ NOT change the database." ;; We close and reopen the window to kill off un-needed buffers ;; this might cause flickering but seems ok. (notmuch-tree-close-message-window) - (setq notmuch-tree-message-window - (split-window-vertically (/ (window-height) 4))) + (setq notmuch-tree-message-window (split-window-sensibly)) (with-selected-window notmuch-tree-message-window ;; Since we are only displaying one message do not indent. (let ((notmuch-show-indent-messages-width 0) -- 2.26.2