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 E15A8431FC9 for ; Wed, 21 Jan 2015 23:20:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 2.438 X-Spam-Level: ** X-Spam-Status: No, score=2.438 tagged_above=-999 required=5 tests=[DNS_FROM_AHBL_RHSBL=2.438] 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 FYa2LuTjawkW for ; Wed, 21 Jan 2015 23:20:13 -0800 (PST) Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net [87.98.215.224]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 95DED431FBC for ; Wed, 21 Jan 2015 23:20:13 -0800 (PST) Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim 4.80) (envelope-from ) id 1YEC27-00065U-Ly; Thu, 22 Jan 2015 07:18:27 +0000 Received: (nullmailer pid 31610 invoked by uid 1000); Thu, 22 Jan 2015 07:18:14 -0000 From: David Bremner To: Jinwoo Lee , notmuch@notmuchmail.org Subject: [PATCH] emacs: escape % in header line format Date: Thu, 22 Jan 2015 08:18:09 +0100 Message-Id: <1421911089-31509-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: 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: Thu, 22 Jan 2015 07:20:17 -0000 We set header-line-format to the message subject, but if the subject contains percents, the next character is interpreted as a formatting control, which is not desired. --- Ironically you have to apply this patch to read it's subject properly ;). There is whitespace change here because the original line was way too long. emacs/notmuch-show.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 9f6fe07..4258d43 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -1198,7 +1198,11 @@ function is used." (notmuch-show-mapc (lambda () (notmuch-show-set-prop :orig-tags (notmuch-show-get-tags)))) ;; Set the header line to the subject of the first message. - (setq header-line-format (notmuch-sanitize (notmuch-show-strip-re (notmuch-show-get-subject)))) + (setq header-line-format + (replace-string "%" "%%" + (notmuch-sanitize + (notmuch-show-strip-re + (notmuch-show-get-subject))))) (run-hooks 'notmuch-show-hook)))) -- 2.1.4