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 312A26DE0F16 for ; Fri, 22 Nov 2019 15:08:16 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.393 X-Spam-Level: X-Spam-Status: No, score=-0.393 tagged_above=-999 required=5 tests=[AWL=-0.192, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-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 eWWWP0ixnFV2 for ; Fri, 22 Nov 2019 15:08:14 -0800 (PST) Received: from mail-lf1-f65.google.com (mail-lf1-f65.google.com [209.85.167.65]) by arlo.cworth.org (Postfix) with ESMTPS id 36DFE6DE0F07 for ; Fri, 22 Nov 2019 15:08:14 -0800 (PST) Received: by mail-lf1-f65.google.com with SMTP id 203so6702144lfa.12 for ; Fri, 22 Nov 2019 15:08:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zPpaRh+rbwowhdgqT+LIU5FBUQlxtvyKD1SFfrizEr4=; b=un8lVvGaenM0tRXzAb4fDaXEak5m/7HvbKuGuYxw96IXAzIU2qe6KjYKafpBpqUi5v 8qN7qpjcdQKor1U68yblOAKq8fLFzhuNHl7YLgGiD9b7u9LzvLJfZh0Iui//8AKv4UIP wjRZtI9q9dmpJQOGe6ccN2CrYzknB+eoi4kTpWXXjPYGSInROKrBcvWaZlw2HbKXI5y9 fE3e/ZSGiNFkcW2mPcJd+8h3qesKC0FFfY7TaNFQsMb7kM4xChwtTiap2wm5Yn5ICfk9 o5l9AjG0lqIV0axxsVzLRab3NAT1xJTmxQj2ekJMnx7xJUc3BS6cQnAuLn278HZLgkPi Hi/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zPpaRh+rbwowhdgqT+LIU5FBUQlxtvyKD1SFfrizEr4=; b=Eeu7I/54xQmnWYjpKGotWx60TmbDz+EXwQSgqiwEPVZyZaD7hGiKpb4SjPBN+XbAM3 eOAYBVxLmrjf3OyOl6i+aQq32830LULiqNZnl39ExTbyo/efkXnvo+owyPP7+qQQtgZR t/RM8CB7q10q5IBLU07RkljDjx9ilXW6TxGFJ9F9p7hRu0E8DDvyvVbrkthxYB6cknVg kjYAj7iZVpWyx1nZF1b+z2IyCy7sIW9vmR+J67ug4gtp5pSgHqap0DPr5UAJNmdUxyIm ytSegGqeNa8pcmOluemKKGXa4RM7BEQwj8D/+Txjzkfy9SpQ4N7YKUyhNdHMIoyjAi5Z 0hAw== X-Gm-Message-State: APjAAAVACdZwOF/FjUkyT1JjFibgBHb8BAl2nhvdQWIYQVujav0swBjw a1ZMvdiivGBocLqkqqt1RnZPTtjq4Gw= X-Google-Smtp-Source: APXvYqyZy5spiIuGffsagTjI7N8r/nvXaG2DFMCKpezZ6Qnoj8OBa6ILQHgdWxvvUvEcVsDqSm0yVA== X-Received: by 2002:ac2:4643:: with SMTP id s3mr8521373lfo.23.1574464092223; Fri, 22 Nov 2019 15:08:12 -0800 (PST) Received: from localhost.localdomain (h88-129-82-160.cust.a3fiber.se. [88.129.82.160]) by smtp.gmail.com with ESMTPSA id n11sm365611ljg.15.2019.11.22.15.08.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 22 Nov 2019 15:08:11 -0800 (PST) From: Johan Parin X-Google-Original-From: Johan Parin To: notmuch@notmuchmail.org Cc: Johan Parin Subject: [PATCH] Display extra headers for emacs-mua - return all headers Date: Sat, 23 Nov 2019 00:07:30 +0100 Message-Id: <20191122230730.35712-3-johan.parin@gmail.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20191122230730.35712-1-johan.parin@gmail.com> References: <20191122230730.35712-1-johan.parin@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Fri, 22 Nov 2019 23:08:16 -0000 Modify format_headers_sprinter so that it returns all headers in the sexp, instead of a fixed set of headers. This is required in order for the elisp variable `notmuch-message-headers' to work. See this bug report: https://notmuchmail.org/pipermail/notmuch/2017/026069.html --- notmuch-show.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/notmuch-show.c b/notmuch-show.c index 21792a57..6bd1cf73 100644 --- a/notmuch-show.c +++ b/notmuch-show.c @@ -255,6 +255,37 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message, sp->string (sp, g_mime_message_get_date_string (sp, message)); } + if (!reply) { + GMimeHeaderList *header_list; + GMimeHeader *header; + int header_count; + /* Headers requiring some special treatment in formatting */ + const char* special_headers[] = { + "Subject", "From", "To", "Cc", "Bcc", "Reply-To", "In-reply-to", + "References", "Date"}; + bool special; + + header_list = g_mime_object_get_header_list (GMIME_OBJECT(message)); + header_count = g_mime_header_list_get_count(header_list); + + for (int i = 0; i < header_count; i++) { + header = g_mime_header_list_get_header_at(header_list, i); + + special = false; + for (int k = 0; k < (int)ARRAY_SIZE(special_headers); k++) + if (!STRNCMP_LITERAL(g_mime_header_get_name(header), + special_headers[k])) { + special = true; + break; + } + if (special) + continue; + + sp->map_key (sp, g_mime_header_get_name(header)); + sp->string (sp, g_mime_header_get_value(header)); + } + } + sp->end (sp); talloc_free (local); } -- 2.21.0 (Apple Git-122)