From 642d25c31a476948a165845a1cb30794b8a766ca Mon Sep 17 00:00:00 2001 From: David Bremner Date: Thu, 22 Jan 2015 08:18:09 +0100 Subject: [PATCH] [PATCH] emacs: escape % in header line format --- f6/0ad81a7197b8a9b8ac5c91dca8347ea3f735a6 | 81 +++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 f6/0ad81a7197b8a9b8ac5c91dca8347ea3f735a6 diff --git a/f6/0ad81a7197b8a9b8ac5c91dca8347ea3f735a6 b/f6/0ad81a7197b8a9b8ac5c91dca8347ea3f735a6 new file mode 100644 index 000000000..e49433ecd --- /dev/null +++ b/f6/0ad81a7197b8a9b8ac5c91dca8347ea3f735a6 @@ -0,0 +1,81 @@ +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 + -- 2.26.2