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

Radu Butoi rbutoi at gmail.com
Thu May 21 22:03:05 PDT 2020


Daniel Kahn Gillmor <dkg at fifthhorseman.net> writes:

> I like this proposal, and the simplification that it gives to the
> notmuch-emacs codebase.  However, this thread is the first place i've
> learned about split-window-sensibly, so i'm probably not eligible to
> really judge the merits here.

For some historical context, split-window-sensibly was introduced in 2009 [1] and the (split-window-vertically (/ (window-height) 4)) code in 2012 [2]. The two functions seem pretty interchangeable.

> As far as testing goes, a test would be nice -- is this something you
> could add to test/T460-emacs-tree.sh ?  Testing UI/UX issues is always
> pretty tough though, and it's not clear to me that we're actually
> already testing the existing "(/ (window-height) 4)" business anyway.

I did look at that file, and there is no tests for the current split functionality. All of the tests use the test-output function which outputs the contents of a buffer -- we need the whole frame. This might need to be done at a layer above Emacs and may complicate the test. I took a "screenshot" by copying my terminal contents with tmux, but I'm not sure how that would look like in a test.

If I manually do the split on the test case [3], the fourth line does cut off some of the text since it goes beyond 160 columns, the default threshold. It is still viewable by pressing C-e, like anything too long.

So I agree that testing would be nice but it seems to be an existing problem here. I'm not sure how, or if, other Emacs packages do character-perfect tests like these.

-Radu

[1]: git.savannah.gnu.org/cgit/emacs.git/commit/?id=8b10a2d19895041340296a703ba956c77541ec88

[2]: git.notmuchmail.org/git?p=notmuch;a=commit;h=3d92a257c8adbb36615bc61be9e668c8188006dc

[3]: https://gist.githubusercontent.com/rbutoi/78c5b30fc5e64585bda18abbc5bf1fbf/raw/cba7df184f3cd534c92a6fb9bf39aa121c19ecd7/gistfile1.txt


More information about the notmuch mailing list