From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id MNvVLV/xl16VcgAA0tVLHw (envelope-from ) for ; Thu, 16 Apr 2020 05:47:11 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 2PMzD2Pxl16CNgAA1q6Kng (envelope-from ) for ; Thu, 16 Apr 2020 05:47:15 +0000 Received: from arlo.cworth.org (arlo.cworth.org [50.126.95.6]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C762D941DD7 for ; Thu, 16 Apr 2020 05:47:11 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 8BA1B6DE0A81; Wed, 15 Apr 2020 22:47:06 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 nF_AwL0c93WD; Wed, 15 Apr 2020 22:47:06 -0700 (PDT) Received: from arlo.cworth.org (localhost [IPv6:::1]) by arlo.cworth.org (Postfix) with ESMTP id E5CD86DE09ED; Wed, 15 Apr 2020 22:47:03 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id E50296DE09ED for ; Wed, 15 Apr 2020 22:47:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org 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 gTdyMSdeQOXA for ; Wed, 15 Apr 2020 22:47:01 -0700 (PDT) X-Greylist: delayed 567 seconds by postgrey-1.36 at arlo; Wed, 15 Apr 2020 22:46:59 PDT Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [212.16.98.55]) by arlo.cworth.org (Postfix) with ESMTPS id D55196DE0937 for ; Wed, 15 Apr 2020 22:46:59 -0700 (PDT) Received: from mithlond (mobile-access-6df039-64.dhcp.inet.fi [109.240.57.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: tlikonen) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 165241B00424; Thu, 16 Apr 2020 08:37:25 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1587015445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eUWT7js5LDMnlWlyZuxYX7tNT2bK5k6dz0OpmaUfrjQ=; b=darmOp3Ua2NrcPvX+a3XDYjGQrYlwoplTVtJknMiRAk2NV1y4B2hPz80wrAj2h8lMTTx/E z2T6OCJCwIoc1CttGWfL5hXH68L7GPcdAfTQcJUVobAmePHt47z38rSZoeSkWwe454wDi/ uAgjPxrF6ejXHzNBf4f/mWmWb4LsvGvcrTZARFutjmPgICx20asWbd+mI1lpCq8B8za8cx 2p6P8/qGVryuqnv7PgleQe4UACWNyrpmczaEiqGsrIF5+AV78HPTcReyIVEbULXVvOY6uF CJL2WkImZtvwQLDnoGAcu5kbDiJ4IhhZ/iCd5hPm9OQzUSrHOpVhIpDP0p8Lkw== From: Teemu Likonen To: Tomi Ollila , divan@santanas.co.za, notmuch@notmuchmail.org Subject: Re: timezone in notmuch In-Reply-To: References: <87imi2gop7.fsf@swift.i-did-not-set--mail-host-address--so-tickle-me> Date: Thu, 16 Apr 2020 08:37:12 +0300 Message-ID: <873694f0tz.fsf@iki.fi> MIME-Version: 1.0 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1587015445; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=eUWT7js5LDMnlWlyZuxYX7tNT2bK5k6dz0OpmaUfrjQ=; b=Xeuywt/8LVxzgAuZcArmOdNqYLfyXevEjncUzaQShPyyGFYNt9qiMvfNipa+EaRAsvBZBK 1HfUORxG+kcfEdojQNLfWXv+ePo9CHdoHl1P3EzAMjcaWaquWnhJazOd01fE6mM9M6kU0g sNhk2DBWertfN0KiQfpbw8wqwZGh4R0vT/0X2oAuaXysJdU2U54CJeM4G2YmB1xt+gBj0B 7jHli1IgyFN7GfOlTNmXKl7euimTUKUec5FXCZCMBXbU2tNtujsfTVQeI2FtVbrqGZNWax 1IjfrDOVR0G+YGagCo15BjhyFN7PnLTWcvmO3AwfJSDDXPn1RD6OTPybks/Xmw== ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1587015445; a=rsa-sha256; cv=none; b=AQgXRh0fw5tpQwJccgXpIqv2cdJVh/drPQsMajrRkNrQcwZRTu0gqFcp7hCpdVvlz105SQ 6pk0JFMQWw5fGnP4Q45cmrTn0iEPLTk9Bzp6PTX8gxbKAe9bVDGHZjq75TmxZSBO8yd6Lr oP+J2HDt6qxB8JsTGpLTlYVfXl0Ls2vQjDGz0bA5IQfFmhlaHOlyaw+xt0Rp6SJOLfJhOR m9oVuOR0Jv4O1O77bsHo3wvDlor17PQL+zlGVQkUxh3Rhonj33H9io8XxBVWZLGbSRohQK 3rJkWKrK3OBreZHi5mv/suslwwXi2r+jeHQDCpM+YU1UcV6T8z1WH3+Th3fXHg== ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=tlikonen smtp.mailfrom=tlikonen@iki.fi 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: , Content-Type: multipart/mixed; boundary="===============5925948663324194164==" Errors-To: notmuch-bounces@notmuchmail.org Sender: "notmuch" X-Scanner: scn0 X-Spam-Score: -0.11 Authentication-Results: aspmx1.migadu.com; dkim=fail (body hash did not verify) header.d=iki.fi header.s=lahtoruutu header.b=darmOp3U; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 50.126.95.6 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Scan-Result: default: False [-0.11 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.45209552386002]; TO_DN_SOME(0.00)[]; IP_REPUTATION_HAM(0.00)[asn: 27017(-0.18), country: US(-0.01), ip: 50.126.95.6(-0.45)]; R_DKIM_REJECT(1.00)[iki.fi:s=lahtoruutu]; R_SPF_ALLOW(-0.20)[+a]; ARC_REJECT(2.00)[signature check failed: fail, {[1] = sig:iki.fi:reject}]; MX_GOOD(-0.50)[cached: notmuchmail.org]; DKIM_TRACE(0.00)[iki.fi:-]; MAILLIST(-0.20)[mailman]; SIGNED_PGP(-2.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:+,3:~,4:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:27017, ipnet:50.126.64.0/18, country:US]; MID_RHS_MATCH_FROM(0.00)[]; FROM_NEQ_ENVFROM(0.00)[tlikonen@iki.fi,notmuch-bounces@notmuchmail.org]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; SPF_REPUTATION_HAM(0.00)[-0.45032914309177]; MIME_GOOD(-0.20)[multipart/mixed,multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[notmuch@notmuchmail.org]; DMARC_NA(0.00)[iki.fi]; HAS_LIST_UNSUB(-0.01)[]; RCVD_COUNT_SEVEN(0.00)[8]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: 1xxf20Hd9vdU Content-Transfer-Encoding: 7bit --===============5925948663324194164== Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Tomi Ollila [2020-04-15T23:17:32+03] wrote: > I use this: > > https://github.com/domo141/nottoomuch/blob/master/build/01-date-local.pat= ch > > I've been thinking if some hook could be added to notmuch-emacs so > that such a custom date mangling can be done outside of the > notmuch-emacs source... Formerly I used Emacs Gnus and its hook to change the date. For this discussion I adapted the idea to Notmuch. The code below is based on idea that after article display there is a hook which can do anything user wants. I wanted ISO 8601 date. ;; Add a hook for changing article's date string. (add-hook 'some-article-display-hook 'tl-notmuch-custom-article-date) (defmacro notmuch-narrow-to-article-headers (&rest body) ;; Implement macro which uses NARROW function to narrow current buffer ;; to article's headers only. `(progn ,@body)) (defun tl-notmuch-custom-article-date () (save-excursion (save-match-data (notmuch-narrow-to-article-headers (goto-char (point-min)) (when (re-search-forward "^Date: \\(.+\\)$" nil t) (let ((inhibit-read-only t)) (replace-match (tl-message-date-string-iso (match-string-no-properties 1)) nil t nil 1))))))) (defun tl-message-date-string-iso (string) ;; Parse message date STRING and return ISO 8601 time string. (require 'parse-time) (condition-case nil (let* ((date-list (parse-time-string string)) (year (nth 5 date-list)) (month (nth 4 date-list)) (day (nth 3 date-list)) (hour (nth 2 date-list)) (min (nth 1 date-list)) (sec (nth 0 date-list)) (tz-total-sec (nth 8 date-list))) (format "%04d-%02d-%02dT%02d:%02d:%02d%s" year month day hour min sec (if (not tz-total-sec) "" (let* ((tz-sign (if (>=3D tz-total-sec 0) "+" "-")) (tz-hour (truncate (abs tz-total-sec) 3600)) (tz-min (truncate (- (abs tz-total-sec) (* tz-hour 3600)) 60))) (cond ((=3D tz-hour tz-min 0) "Z") ((=3D tz-min 0) (format "%s%02d" tz-sign tz-hour)) (t (format "%s%02d:%02d" tz-sign tz-hour tz-min))))))) (error string))) =2D-=20 /// Teemu Likonen - .-.. http://www.iki.fi/tlikonen/ // OpenPGP: 4E1055DC84E9DFF613D78557719D69D324539450 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIYEARYIAC4WIQTJW2wqtelxC1gHdbitnXWr7pTCcwUCXpfvCRAcdGxpa29uZW5A aWtpLmZpAAoJEK2ddavulMJz77MBANr2BSa4G9pbHNb0MgR3I+CXgTbNmitiE+wf y1cfm+zCAQCL+idl5jW4GEu+/V6ED9d9qDt3KFhPruB/M5J7iNS5Bg== =OB5U -----END PGP SIGNATURE----- --=-=-=-- --===============5925948663324194164== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============5925948663324194164==--