unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* emacs: Split wide window vertically for tree mode message pane
@ 2018-01-03  9:27 Prof Jayanth R Varma
  2018-05-09 20:52 ` David Bremner
  0 siblings, 1 reply; 5+ messages in thread
From: Prof Jayanth R Varma @ 2018-01-03  9:27 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 311 bytes --]

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).

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Split-wide-window-vertically-for-tree-mode-message-p.patch --]
[-- Type: text/x-patch, Size: 1807 bytes --]

From e4829e484ffe3aab564f112d677fb72e9a400144 Mon Sep 17 00:00:00 2001
From: Jayanth Varma <jrvarma@gmail.com>
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


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-05-11 16:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-03  9:27 emacs: Split wide window vertically for tree mode message pane Prof Jayanth R Varma
2018-05-09 20:52 ` David Bremner
2018-05-10 20:46   ` Tomi Ollila
2018-05-10 20:57     ` David Bremner
2018-05-11 16:17     ` Prof Jayanth R Varma

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).