From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id AB63A6DE0005 for ; Wed, 28 Dec 2016 04:18:30 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.546 X-Spam-Level: X-Spam-Status: No, score=0.546 tagged_above=-999 required=5 tests=[AWL=-0.087, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652, UNPARSEABLE_RELAY=0.001] 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 mk5S5nYx2mrx for ; Wed, 28 Dec 2016 04:18:30 -0800 (PST) Received: from mail-wj0-f196.google.com (mail-wj0-f196.google.com [209.85.210.196]) by arlo.cworth.org (Postfix) with ESMTPS id D158F6DE00E8 for ; Wed, 28 Dec 2016 04:18:29 -0800 (PST) Received: by mail-wj0-f196.google.com with SMTP id j10so54348086wjb.3 for ; Wed, 28 Dec 2016 04:18:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dme-org.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=Xz31tFOs31i0jtpt5gdqo4Wcgxpk09PghBwH2EiXo1E=; b=N+U0yRjFacj8u62aIZhKz6tx4kXxWVZUOyejtuUe1YjfjNqWuM7Z+UGzWR03H8N1kS QHF+5QX6IoU96nO5zT9mvOt/czSTTqGPCYVt04Oo0c/rv2rGfzwI3bZj+3rcyOtEEXaC X6myu/aHzeaJh7t6ry+bim4YztEetmBdxHpw6jTQD7h5rwQKpuPZcrN+cVib7mDshJ/n 7ZZPC+KrbC2wGOxxVDXjb09jXx4jVEWxhR/S5TfU9TynNS372nF0somR1pvt1GPc4bUC TUnqHkR4MEq4xOsfDNjoBvXEkBLl4YObCS14RYJl+LFIApYPHVeLSZyM0/BvPrGHnnCR r3dA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=Xz31tFOs31i0jtpt5gdqo4Wcgxpk09PghBwH2EiXo1E=; b=PfgXefHwGGlyJOsDjUBiWAz6Ix1b4isZkhCtqIpxYBG4oAvBbBOT5HDYoOnjdIfeKj ri19Rxdmm7PJ/+H4O7T3ZlUdQkGO9ZB0LL0ZQIxghNkq0IwgET2QtKQzTNQLnVNpZVob e/dfGQQeOawhDEj/essXnUWb79u1w8f6+TUhAWvZqy2go+r+dCaMgi9iHaEFOFLEBhyy oDE4tCpRJLC0R1XtLuOs2+s9VH+MJo3ueS1PIm+mdVjSPhTwmdc23t9iFyu41YDuGlVh vA9ehLSqfAjGC4M91D9fe24mpwmHIbegGKSmU9dC9vtvTERM5SKXxoqY30BvQw3i1rm9 unJw== X-Gm-Message-State: AIkVDXLLx45rJb/vZjCFGfbuxmIrY2oD6n4Z5CRTwNEL850WL51x8WIDvqkyePhBHW/hNA== X-Received: by 10.194.161.65 with SMTP id xq1mr32494263wjb.104.1482927508173; Wed, 28 Dec 2016 04:18:28 -0800 (PST) Received: from disaster-area.hh.sledj.net (disaster-area.hh.sledj.net. [81.149.164.25]) by smtp.gmail.com with ESMTPSA id kq6sm30422751wjc.7.2016.12.28.04.18.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Dec 2016 04:18:27 -0800 (PST) Received: from localhost (disaster-area.hh.sledj.net [local]) by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id 26ca4035 for ; Wed, 28 Dec 2016 12:18:25 +0000 (UTC) From: David Edmondson To: notmuch@notmuchmail.org Subject: [PATCH v1 1/2] emacs: show: Align the colon in header display Date: Wed, 28 Dec 2016 12:18:24 +0000 Message-Id: <20161228121825.11265-2-dme@dme.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20161228121825.11265-1-dme@dme.org> References: <20161228121825.11265-1-dme@dme.org> 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: Wed, 28 Dec 2016 12:18:30 -0000 When displaying headers, insert leading space so that the `:' in all of the headers shown is aligned. --- emacs/notmuch-show.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 364004b8..677405ba 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -345,11 +345,11 @@ operation on the contents of the current buffer." (defun notmuch-show-fontify-header () (let ((face (cond - ((looking-at "[Tt]o:") + ((looking-at " *[Tt]o:") 'message-header-to) - ((looking-at "[Bb]?[Cc][Cc]:") + ((looking-at " *[Bb]?[Cc][Cc]:") 'message-header-cc) - ((looking-at "[Ss]ubject:") + ((looking-at " *[Ss]ubject:") 'message-header-subject) (t 'message-header-other)))) @@ -362,7 +362,7 @@ operation on the contents of the current buffer." (defun notmuch-show-colour-headers () "Apply some colouring to the current headers." (goto-char (point-min)) - (while (looking-at "^[A-Za-z][-A-Za-z0-9]*:") + (while (looking-at "^ *[A-Za-z][-A-Za-z0-9]*:") (notmuch-show-fontify-header) (forward-line))) @@ -462,7 +462,8 @@ message at DEPTH in the current thread." (defun notmuch-show-insert-header (header header-value) "Insert a single header." - (insert header ": " (notmuch-sanitize header-value) "\n")) + ;; `7' because `Subject' is the longest header. + (insert (format "%7s: %s\n" header (notmuch-sanitize header-value)))) (defun notmuch-show-insert-headers (headers) "Insert the headers of the current message." -- 2.11.0