Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 6335B431FD0 for ; Mon, 11 Jul 2011 01:53:14 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.799 X-Spam-Level: X-Spam-Status: No, score=-0.799 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] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 62vTEYGwPbzy for ; Mon, 11 Jul 2011 01:53:13 -0700 (PDT) Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 47B39431FB6 for ; Mon, 11 Jul 2011 01:53:12 -0700 (PDT) Received: by bwg12 with SMTP id 12so3511863bwg.26 for ; Mon, 11 Jul 2011 01:53:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:subject:in-reply-to:references:user-agent:date:message-id :mime-version:content-type; bh=S0gTsvT7nYEVuMvfxXqV1aPRyOdMQmYmMnig0qCaFHA=; b=d2OUqL+GuI5d/A74ZqUV5QXi5Id+41pFyeNTU/gLtI/NkUlL5IniZ25Y9mJStYCIh7 POvDEetwjgpbUnKRTLlKlAgxtBeur2+0EJnOUrgu9cBr6jx92WhxwxjRMCs8w7K1pIjg tCbbWEX8sVj9EhHNIpLZIFjD8YoUH+7jq2uNM= Received: by 10.205.65.198 with SMTP id xn6mr1524707bkb.359.1310374390155; Mon, 11 Jul 2011 01:53:10 -0700 (PDT) Received: from localhost ([91.144.186.21]) by mx.google.com with ESMTPS id v6sm956079bkd.22.2011.07.11.01.53.08 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 11 Jul 2011 01:53:09 -0700 (PDT) From: Dmitry Kurochkin To: Felix Geller , notmuch@notmuchmail.org Subject: Re: [PATCH] Emacs: Add variable to toggle message indentation in a thread In-Reply-To: References: User-Agent: Notmuch/0.5-321-g41686e2 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Mon, 11 Jul 2011 12:53:04 +0400 Message-ID: <87mxgl19n3.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Mon, 11 Jul 2011 08:53:14 -0000 Hi Felix. On Mon, 11 Jul 2011 10:42:04 +0200, Felix Geller wrote: > Hi, > > I added a variable to toggle message indentation in Emacs. > > Please let me know what you think. > I like the change. Though I do not think I would use it without chronological sorting. Comments on the code below. Regards, Dmitry > > Cheers, > Felix > > > diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el > index a433dec..8101c27 100644 > --- a/emacs/notmuch-show.el > +++ b/emacs/notmuch-show.el > @@ -90,6 +90,11 @@ any given message." > :group 'notmuch > :type 'boolean) > > +(defcustom notmuch-show-indent-messages-in-thread nil > + "Should the messages in a thread be indented according to their respective depth in the thread?" This line is too long and should be split. > + :group 'notmuch > + :type 'boolean) > + > (defcustom notmuch-show-indent-multipart nil > "Should the sub-parts of a multipart/* part be indented?" > ;; dme: Not sure which is a good default. > @@ -237,7 +242,9 @@ unchanged ADDRESS if parsing fails." > "Insert a notmuch style headerline based on HEADERS for a > message at DEPTH in the current thread." > (let ((start (point))) > - (insert (notmuch-show-spaces-n depth) > + (insert (if notmuch-show-indent-messages-in-thread > + (notmuch-show-spaces-n depth) > + "") (if notmuch-show-indent-messages-in-thread (insert (notmuch-show-spaces-n depth))) Is cleaner and avoids useless empty string insert. > (notmuch-show-clean-address (plist-get headers :From)) > " (" > date > @@ -733,7 +740,8 @@ current buffer, if possible." > (setq content-end (point-marker)) > > ;; Indent according to the depth in the thread. > - (indent-rigidly content-start content-end depth) > + (when notmuch-show-indent-messages-in-thread > + (indent-rigidly content-start content-end depth)) Not a big deal, but I would prefer `if' instead of `when' here. Regards, Dmitry > > (setq message-end (point-max-marker)) > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch