From: Tomi Ollila Date: Sat, 20 Aug 2016 20:08:09 +0000 (+0300) Subject: Re: [PATCH] emacs: wash: make word-wrap bound message width X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=notmuch-archives.git Re: [PATCH] emacs: wash: make word-wrap bound message width --- diff --git a/64/cfcd47535168a2d4e2f105cf4a61dab8fe9411 b/64/cfcd47535168a2d4e2f105cf4a61dab8fe9411 new file mode 100644 index 000000000..ac14cb034 --- /dev/null +++ b/64/cfcd47535168a2d4e2f105cf4a61dab8fe9411 @@ -0,0 +1,114 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id A04726DE0BAC + for ; Sat, 20 Aug 2016 13:08:29 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.557 +X-Spam-Level: +X-Spam-Status: No, score=0.557 tagged_above=-999 required=5 tests=[AWL=-0.095, + SPF_NEUTRAL=0.652] 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 vfwggdjR023N for ; + Sat, 20 Aug 2016 13:08:29 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by arlo.cworth.org (Postfix) with ESMTP id EEAF36DE0B7C + for ; Sat, 20 Aug 2016 13:08:28 -0700 (PDT) +Received: from guru.guru-group.fi (localhost [IPv6:::1]) + by guru.guru-group.fi (Postfix) with ESMTP id 5B434100090; + Sat, 20 Aug 2016 23:08:09 +0300 (EEST) +From: Tomi Ollila +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH] emacs: wash: make word-wrap bound message width +In-Reply-To: <1467791251-6823-1-git-send-email-markwalters1009@gmail.com> +References: <1467791251-6823-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.22+61~geeecb9e (https://notmuchmail.org) Emacs/24.5.1 + (x86_64-unknown-linux-gnu) +X-Face: HhBM'cA~ +MIME-Version: 1.0 +Content-Type: text/plain +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.22 +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: Sat, 20 Aug 2016 20:08:29 -0000 + +On Wed, Jul 06 2016, Mark Walters wrote: + +> Previously if notmuch-wash-wrap-lines-length was set then all messages +> would be wrapped at this value (or window-width if that is +> smaller). This was done regardless of the message's depth in a thread: +> for example, if the n.w.w.l.l is 80 and the messages depth is 20 +> (so indented 20 by default) the messages text only got 60 characters +> of space. +> +> This commit changes that so a message always gets the full n.w.w.l.l +> of width regardless of its indentation (unless that goes over +> window-width of course). +> --- +> +> This is what I would like -- I don't know if anyone would like to keep +> the previous behaviour as an option. The code-part for that is easy, but getting +> the docstrings and and defcustoms right is not clear. + +The change looks good to me -- but I just don't understand why someone +would set notmuch-wash-wrap-lines-length to something else than nil +-- and if it is set to some number what the behaviour should be ? + +Tomi + + +> +> Best wishes +> +> Mark +> +> emacs/notmuch-wash.el | 6 +++--- +> 1 file changed, 3 insertions(+), 3 deletions(-) +> +> diff --git a/emacs/notmuch-wash.el b/emacs/notmuch-wash.el +> index 57e6dfa..e16b8cc 100644 +> --- a/emacs/notmuch-wash.el +> +++ b/emacs/notmuch-wash.el +> @@ -121,8 +121,8 @@ collapse the remaining lines into a button." +> +> If this is nil, lines in messages will be wrapped to fit in the +> current window. If this is a number, lines will be wrapped after +> -this many characters or at the window width (whichever one is +> -lower)." +> +this many characters (ignoring indentation due to thread depth) +> +or at the window width (whichever one is lower)." +> :type '(choice (const :tag "window width" nil) +> (integer :tag "number of characters")) +> :group 'notmuch-wash) +> @@ -336,7 +336,7 @@ the wrapped text are maintained." +> +> (let* ((coolj-wrap-follows-window-size nil) +> (limit (if (numberp notmuch-wash-wrap-lines-length) +> - (min notmuch-wash-wrap-lines-length +> + (min (+ notmuch-wash-wrap-lines-length depth) +> (window-width)) +> (window-width))) +> (fill-column (- limit +> -- +> 2.1.4 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> https://notmuchmail.org/mailman/listinfo/notmuch