From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id uK+dBEcFul6gPAAA0tVLHw (envelope-from ) for ; Tue, 12 May 2020 02:09: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 mp1 with LMTPS id EJzXDVUFul5gSQAAbx9fmQ (envelope-from ) for ; Tue, 12 May 2020 02:09:25 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8D9FE9400AB for ; Tue, 12 May 2020 02:09:22 +0000 (UTC) Received: from localhost ([::1]:48362 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYKME-00055e-Kj for larch@yhetil.org; Mon, 11 May 2020 22:09:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46590) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYKLm-00055K-Gy for emacs-orgmode@gnu.org; Mon, 11 May 2020 22:08:54 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:64784) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYKLk-0007k7-Pl for emacs-orgmode@gnu.org; Mon, 11 May 2020 22:08:53 -0400 Received: from pb-smtp2.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 5557E4310C; Mon, 11 May 2020 22:08:49 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version :content-type; s=sasl; bh=FBB52NkccW9pT5xNe40nX9A08O8=; b=hAQaXz wsa3lVs3lrhnf22ULIOIpZg3oYUZ4WwyV9xXqKscbgMtPXJtKP9DAYRImc99TFUW Q4FFGDppJJGM9RTnvQxGnjzH4witE8sweUrXxU5A6mqpID+dRHysTvIqz2//BVl4 wT6FQ6u/eZW1nELWUMefegJn87BCI5pToJ1q0= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 4CB974310B; Mon, 11 May 2020 22:08:49 -0400 (EDT) (envelope-from kyle@kyleam.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=kyleam.com; h=from:to:cc:subject:in-reply-to:references:date:message-id:mime-version:content-type; s=mesmtp; bh=ilG4EJzEb9QcVT0XN7wYlkY5CajXw6NLcHdRGrNW2uc=; b=B/OWh8As/3Zs0ZC1rs2I7IsVzeiQ4al+HvuvLWTgf5p8Mvt9xE7jE7je9ifGupzo2CDg/dgzb/qskYYZ7u+JOZWw/eex9aRanCzI6Slm9wq8kUK33zAkkbBMblyGW+HL7788vcbpsmEpqAFgtL6fsXvA8n3hzq6zvfWiC2SqaEg= Received: from localhost (unknown [45.33.91.115]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id B2A974310A; Mon, 11 May 2020 22:08:48 -0400 (EDT) (envelope-from kyle@kyleam.com) From: Kyle Meyer To: emacs-orgmode@gnu.org Subject: [PATCH] colview: Display active time stamps as inactive In-Reply-To: <87k11i61v2.fsf@kyleam.com> References: <87d07bd2nj.fsf@kyleam.com> <87pnbb5z3x.fsf@kyleam.com> <87mu6f5x2i.fsf@kyleam.com> <877dxjx8h2.fsf@nicolasgoaziou.fr> <87k11i61v2.fsf@kyleam.com> Date: Tue, 12 May 2020 02:08:47 +0000 Message-ID: <87zhadewgg.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: 847FC278-93F5-11EA-824F-D1361DBA3BAF-24757444!pb-smtp2.pobox.com Received-SPF: pass client-ip=64.147.108.71; envelope-from=kyle@kyleam.com; helo=pb-smtp2.pobox.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 22:08:49 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: orgmode@pm.me Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: scn0 X-Spam-Score: -1.21 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=pobox.com header.s=sasl header.b=hAQaXz w; dkim=pass header.d=kyleam.com header.s=mesmtp header.b=B/OWh8As; dmarc=none; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Scan-Result: default: False [-1.21 / 13.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; GENERIC_REPUTATION(0.00)[-0.53990237392994]; DWL_DNSWL_FAIL(0.00)[kyleam.com:server fail,209.51.188.17:server fail]; R_SPF_ALLOW(-0.20)[+ip4:209.51.188.0/24:c]; IP_REPUTATION_HAM(0.00)[asn: 22989(0.07), country: US(-0.00), ip: 209.51.188.17(-0.54)]; TO_DN_NONE(0.00)[]; MX_GOOD(-0.50)[cached: eggs.gnu.org]; RCPT_COUNT_TWO(0.00)[2]; DKIM_TRACE(0.00)[pobox.com:+,kyleam.com:+]; MAILLIST(-0.20)[mailman]; FORGED_RECIPIENTS_MAILLIST(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:22989, ipnet:209.51.188.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; TAGGED_FROM(0.00)[larch=yhetil.org]; FROM_NEQ_ENVFROM(0.00)[kyle@kyleam.com,emacs-orgmode-bounces@gnu.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[pobox.com:s=sasl,kyleam.com:s=mesmtp]; URIBL_BLOCKED(0.00)[kyleam.com:dkim,pobox.com:dkim]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[kyleam.com]; HAS_LIST_UNSUB(-0.01)[]; DNSWL_BLOCKED(0.00)[209.51.188.17:from]; RWL_MAILSPIKE_POSSIBLE(0.00)[209.51.188.17:from]; RCVD_COUNT_SEVEN(0.00)[7]; FORGED_SENDER_MAILLIST(0.00)[] X-TUID: Wq6Oet/4l2Iw Kyle Meyer writes: > Nicolas Goaziou writes: > >> IIRC, date computations in the spreadsheet return inactive timestamps. >> So, if we don't want to conform to the documentation, we could insert an >> inactive time-stamp instead, to be on the safe side. >> >> WDYT? > > Sounds good to me. I should be able to find time in the next day or two > to look into it. Okay, here's a patch for that to go along with the documentation patch. -- >8 -- Subject: [PATCH] colview: Display active time stamps as inactive * lisp/org-colview.el (org-columns--displayed-value): Convert active time stamp values to inactive time stamps to avoid duplicate entries in the agenda. * testing/lisp/test-org-colview.el (test-org-colview/dblock): Add tests. --- lisp/org-colview.el | 2 ++ testing/lisp/test-org-colview.el | 19 ++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lisp/org-colview.el b/lisp/org-colview.el index 3569b231b..3e5920ccd 100644 --- a/lisp/org-colview.el +++ b/lisp/org-colview.el @@ -257,6 +257,8 @@ (defun org-columns--displayed-value (spec value &optional no-star) (if org-hide-leading-stars ?\s ?*)) "* ")))) (concat stars (org-link-display-format value)))) + (`(,(or "DEADLINE" "SCHEDULED" "TIMESTAMP") . ,_) + (replace-regexp-in-string org-ts-regexp "[\\1]" value)) (`(,_ ,_ ,_ ,_ nil) value) ;; If PRINTF is set, assume we are displaying a number and ;; obey to the format string. diff --git a/testing/lisp/test-org-colview.el b/testing/lisp/test-org-colview.el index ed75090df..7612074b5 100644 --- a/testing/lisp/test-org-colview.el +++ b/testing/lisp/test-org-colview.el @@ -1519,7 +1519,24 @@ (ert-deftest test-org-colview/dblock () (org-test-with-temp-text "* H src_emacs-lisp{(+ 1 1)} 1\n#+BEGIN: columnview\n#+END:" (let ((org-columns-default-format "%ITEM")) (org-update-dblock)) - (buffer-substring-no-properties (point) (point-max)))))) + (buffer-substring-no-properties (point) (point-max))))) + ;; Active time stamps are displayed as inactive. + (should + (equal + "#+BEGIN: columnview +| ITEM | d | s | t | +|------+------------------+------------------+------------------| +| H | [2020-05-14 Thu] | [2020-05-11 Mon] | [2020-06-10 Wed] | +#+END:" + (org-test-with-temp-text + "* H +SCHEDULED: <2020-05-11 Mon> DEADLINE: <2020-05-14 Thu> +<2020-06-10 Wed> +#+BEGIN: columnview\n#+END:" + (let ((org-columns-default-format + "%ITEM %DEADLINE(d) %SCHEDULED(s) %TIMESTAMP(t)")) + (org-update-dblock)) + (buffer-substring-no-properties (point) (point-max)))))) (provide 'test-org-colview) ;;; test-org-colview.el ends here base-commit: 3bbaca166052c4761a1bc8227496b23dc157bf96 -- 2.26.2