From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8C1AD6DE098B for ; Wed, 3 Jan 2018 01:28:03 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.82 X-Spam-Level: X-Spam-Status: No, score=-0.82 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled 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 TGzrpw4mRsFK for ; Wed, 3 Jan 2018 01:28:03 -0800 (PST) Received: from mail-it0-f50.google.com (mail-it0-f50.google.com [209.85.214.50]) by arlo.cworth.org (Postfix) with ESMTPS id BEC016DE0243 for ; Wed, 3 Jan 2018 01:28:02 -0800 (PST) Received: by mail-it0-f50.google.com with SMTP id u62so1095736ita.2 for ; Wed, 03 Jan 2018 01:28:02 -0800 (PST) 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=F/3g/r5BXx8QSX6Sc5Go/oOQfTAZOP1GUIK7fqtRkrI=; b=k6L2BUYxlrq1kZ6WRTv7PNd9eyTdCNbtwkJ/YkmQ9CE+TSxFMeMZxaiA2p+qVMEfVe V44myEGqK8/XMAFf/LaXVuSBDYuryevRCpu5hPuj9gkXvrj9xgI6TpdygVDNE49o3O2u 5ekToBk2+g/K4WAmdpYti5ybEHl/Peg6Q1EA6XJxAh26J/bIrqOUBEMMEvt2fvOynhDC LFClhnBE5qfNJXir62vQrcRk1TX5JTkUQZLzKRKLB8ydo78Xwz8sJmQAWb8Vvnm+WUME LvvoWOFL6U7WE8cUhvT2r1HvM48SlIMpTpN5KXaZcp97i2Cke0WiFC1Jp/W04CHrbmJk VRtA== 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=F/3g/r5BXx8QSX6Sc5Go/oOQfTAZOP1GUIK7fqtRkrI=; b=fvdxueVpqgAJqHnby9A/+Rk0FuKtnIRHR/fVL1PbhMsg5ChDnCZsL9TOw8so6gC5Ig UASVWsmFZ1C5r1Raehl97o/JxFsuUAGp5iF8vycRnZIrNqb4Bmw1tAWZk9yzXe8kI7AI Ol4D1OVfCg1NKGJ1eW2MYA9ELUA4Kop7Ib1u/NOkZoK8T/QQMCz5XY4fdSVcOKi4zR5t xAPZXUc4zvwDx4P7XBz+nsElOJ3P5BT4jyPSo/UfBt+MlkP9vuQrvOVB/kFL0RgOFCuY 3Nq/QxCbV56wtgWQea3TwyOSKgojRrZinjmSx89/yUFFf27aPY9kyhCNpkpJ33+6Liav vNJA== X-Gm-Message-State: AKGB3mLg3mQkX5PIpCN9EBum2rj7ykLnj3dg+aIfz0YHFDxN+OmhzHwC FL4W34Nsivy7vHnc+9+hZrEOvOd6 X-Google-Smtp-Source: ACJfBotCKir9k0EVk9YPTBLifdwBdRtVUWp08LsIToYEh9upnvXs6T7aR6QooyzEhY/NwY55lJA8kg== X-Received: by 10.36.84.69 with SMTP id t66mr1174164ita.102.1514971681798; Wed, 03 Jan 2018 01:28:01 -0800 (PST) Received: from [127.0.1.1] ([103.76.141.32]) by smtp.gmail.com with ESMTPSA id 1sm448333ioe.27.2018.01.03.01.28.00 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Jan 2018 01:28:01 -0800 (PST) From: Prof Jayanth R Varma To: notmuch@notmuchmail.org Subject: emacs: Split wide window vertically for tree mode message pane Date: Wed, 03 Jan 2018 14:57:55 +0530 Message-ID: <877eszb8bo.fsf@JRVARMAPC.i-did-not-set--mail-host-address--so-tickle-me> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Mailman-Approved-At: Thu, 04 Jan 2018 13:48:40 -0800 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Jan 2018 09:28:03 -0000 --=-=-= Content-Type: text/plain; format=flowed This patch modifies the function notmuch-tree-show-message-in in notmuch-tree.el to split the window vertically while creating a message pane in tree-mode if the window is wider than 160 (so that after splitting, the message pane can show the standard 76 character plain text email lines without wrapping). --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Split-wide-window-vertically-for-tree-mode-message-p.patch >From e4829e484ffe3aab564f112d677fb72e9a400144 Mon Sep 17 00:00:00 2001 From: Jayanth Varma Date: Wed, 3 Jan 2018 14:44:31 +0530 Subject: [PATCH] Split wide window vertically for tree-mode message pane in emacs --- NEWS | 4 ++++ emacs/notmuch-tree.el | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 47b62d73..d2808df1 100644 --- a/NEWS +++ b/NEWS @@ -151,6 +151,10 @@ Extend mitigation (disabling handling x-display in text/enriched) for Emacs bug #28350 to Emacs versions before 24.4 (i.e. without `advice-add`). +When opening message pane in tree-mode, split window vertically if +window is wider than 160 (message pane after splitting is wider than +80). + Command Line Interface ---------------------- diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el index c00315e8..082bcfa5 100644 --- a/emacs/notmuch-tree.el +++ b/emacs/notmuch-tree.el @@ -469,7 +469,14 @@ NOT change the database." ;; this might cause flickering but seems ok. (notmuch-tree-close-message-window) (setq notmuch-tree-message-window - (split-window-vertically (/ (window-height) 4))) + ;; Split message pane vertically in wide windows (width > 160) + ;; Under RFC 2045 line length is 76 characters so plain text emails + ;; will be displayed properly in 80 character wide pane + ;; HTML mail will anyway reformat to pane width + ;; In narrow windows, split pane horizontally 1:3 + (if (> (window-total-width) 160) + (split-window-horizontally) + (split-window-vertically (/ (window-height) 4)))) (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.15.1 --=-=-=--