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 250336DE0EF2 for ; Sat, 9 Nov 2019 11:19:55 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.147 X-Spam-Level: X-Spam-Status: No, score=-0.147 tagged_above=-999 required=5 tests=[AWL=-0.146, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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 iNSPMxnj-UFe for ; Sat, 9 Nov 2019 11:19:54 -0800 (PST) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) by arlo.cworth.org (Postfix) with ESMTPS id 0A0ED6DE0ED6 for ; Sat, 9 Nov 2019 11:19:54 -0800 (PST) Received: by mail-lj1-f193.google.com with SMTP id q2so9651209ljg.7 for ; Sat, 09 Nov 2019 11:19:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nikula-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=o7kPkibhcJMm9CJXDuNUpkGBB5alp0Pm7Wj4rEaVSsU=; b=bWv8Dzb81tXcVH8FarPqkvtBNMK6w4oJVYxjGTrWDjGR4dE3Hn7LC4ULEzE9G8NyaA l+lRsJDXkWW+0CTvbeKCdjkoJXQNcAck3FKLvTz5T4S9tKQL6iwRj2j9MQzcOzqk9xt3 3+y4P7p8YW/99F5XMDRGof6FxaTY1Nq1lK87Rx5808z3Z9Abh41EGKanPAsFg5DN/p1b 08XXJVqCQNI/8tVLHsGdlpsrv4idAlQ2xAtorCYI2EgvRbhIvZAM+RTszuVqF+pLSjKq fue43Q3wBCfGUrxLxJE+ZlAq5PLQ22CaauaP1HwkB8Sx2nSzLovc47iDYH7GV9IbHxuv Gwbw== 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:in-reply-to:references:date :message-id:mime-version; bh=o7kPkibhcJMm9CJXDuNUpkGBB5alp0Pm7Wj4rEaVSsU=; b=T4uiOLYcjPSa5Tcv269YVvPDOhs6IWWtxfXLggzz8z/7E3LZFhyo9b0/C0LCyn0+Rv 6sA2L9XLEOUcwZMkKxlvvtNyIj40CM27LlUIxCQ9KNB1R3Yf0HeEU3owct+eRq3LSyg8 ot6SUePgYkakZFO3JAEmytgGwKyNp2Ck1fJmprYS/1rPQZaAQUZsZvOSEGXu60BzRS/8 t8ytFPlYgOxW2DSg4Z4nVhJttcjdqyfEvqR+K4QCpU43wtiWNX0hjnmZGZChxs94iJqv R/esAqN2aX8FBNBxbEm4X/V0Z7QuepY88HTep/xA0DDqUcFz3EeJU0qsfe0nl1gAC4I4 C1Jg== X-Gm-Message-State: APjAAAVl+lcVu1gnMsw0vY1p0u7fVD1x0oC8yqH5k95WYKAmnhsIEtxg VYZvC7pQUB+qyVkXb59CWTXiRw== X-Google-Smtp-Source: APXvYqwKmqOnS6FFfU+fyXy6F7i/XaiWLWtwxi3334zuHwiN9Y8qndnDHKikoEG/LyWv9xUJhs4JZQ== X-Received: by 2002:a2e:a175:: with SMTP id u21mr10789357ljl.198.1573327191872; Sat, 09 Nov 2019 11:19:51 -0800 (PST) Received: from localhost (213-216-249-106.bb.dnainternet.fi. [213.216.249.106]) by smtp.gmail.com with ESMTPSA id 4sm4507458ljv.87.2019.11.09.11.19.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Nov 2019 11:19:51 -0800 (PST) From: Jani Nikula To: Johan Parin , notmuch@notmuchmail.org Cc: Johan Parin Subject: Re: [PATCH] Fix format_headers_sprinter to return all headers In-Reply-To: <20191109174413.97663-1-johan.parin@gmail.com> References: <20191109174413.97663-1-johan.parin@gmail.com> Date: Sat, 09 Nov 2019 21:19:47 +0200 Message-ID: <87k188c0x8.fsf@nikula.org> MIME-Version: 1.0 Content-Type: text/plain 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: Sat, 09 Nov 2019 19:19:55 -0000 On Sat, 09 Nov 2019, Johan Parin wrote: > Modify format_headers_sprinter so that it returns all headers in the > sexp, instead of a fixed set of headers. I have to deal with plenty of long threads that already take a very long time to open in notmuch-emacs. How's this going to impact the emacs interface performance? For example the patch mail I'm replying to has more header content than body content. There are tons of headers that I can't imagine being useful to anyone. I'm wondering if the right thing to do would be to make it possible to specify which additional headers to include in notmuch-show output. This would be based on notmuch-message-headers. We already have options to include/exclude body content and html parts for much the same reasons. (Though the command-line arguments for those are incoherent at best.) It is, of course, much more work than the patch at hand. BR, Jani. > > 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 | 27 +++++++++++++++++++++++++++ > 1 file changed, 27 insertions(+) > > diff --git a/notmuch-show.c b/notmuch-show.c > index 21792a57..9652ed09 100644 > --- a/notmuch-show.c > +++ b/notmuch-show.c > @@ -205,6 +205,15 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message, > char *recipients_string; > const char *reply_to_string; > void *local = talloc_new (sp); > + 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"}; > + const int special_header_count = sizeof(special_headers) / sizeof(char *); > + bool special; > > sp->begin_map (sp); > > @@ -255,6 +264,24 @@ format_headers_sprinter (sprinter_t *sp, GMimeMessage *message, > sp->string (sp, g_mime_message_get_date_string (sp, message)); > } > > + 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 < special_header_count; 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) > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > https://notmuchmail.org/mailman/listinfo/notmuch