[PATCH] emacs: split-window-sensibly in tree mode with open message

2020-05-02 Thread Radu Butoi
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
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch and mailing lists

2020-05-02 Thread Eric Wong
Sean Whitton  wrote:
> Hello,
> 
> I was wondering whether anyone who previously read mailing lists via
> NNTP has stopped doing this after starting to use notmuch.

Fwiw, I have some slrn spool to Maildir translators here which should
work with notmuch:

Perl: https://yhbt.net/public-inbox.git/tree/scripts/slrnspool2maildir
(It still uses the Email::* namespace, which I'm slowly getting
 rid of in public-inbox due to performance and inactive upstream...)

Ruby: https://lore.kernel.org/lkml/20190104013522.stng6gwauwnr6wbi@starla/
(doesn't do any header rewriting)

> I've not yet used NNTP to read mailing lists myself, but I think there
> are limitations to the way I currently read lists, and was wondering
> whether it is worth exploring the NNTP approach, or trying to come up
> with notmuch-based workflow improvements.

Not directly related to notmuch:

I'm planning on expanding public-inbox to include a local client
tool which can index, search, and optionally cache NNTP and HTTP
messages from any NNTP and public-inbox HTTP instances.  Maybe
IMAP, too...
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch


Re: notmuch and mailing lists

2020-05-02 Thread Reto
On Fri, May 01, 2020 at 12:30:28PM -0700, Sean Whitton wrote:
> I've not yet used NNTP to read mailing lists myself, but I think there
> are limitations to the way I currently read lists

What are you missing exactly?
If we know what your actual problems are there might be better solutions 
forthcoming.
___
notmuch mailing list
notmuch@notmuchmail.org
https://notmuchmail.org/mailman/listinfo/notmuch