From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#48133: 28.0.50; [native-comp] time-to-days throws wrong-number-of-arguments error Date: Sat, 01 May 2021 16:22:32 +0800 Message-ID: <87pmyayibb.fsf@localhost> References: <875z03mdhk.fsf@localhost> <83lf8z9d5m.fsf@gnu.org> <87y2czx713.fsf@localhost> <83k0oiany7.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16205"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 48133@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat May 01 10:19:15 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lckqJ-00045Y-46 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 May 2021 10:19:15 +0200 Original-Received: from localhost ([::1]:33328 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lckqI-0002Fo-3G for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 May 2021 04:19:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:38052) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lckq6-0002Fa-R2 for bug-gnu-emacs@gnu.org; Sat, 01 May 2021 04:19:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48687) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lckq6-0003Ul-K9 for bug-gnu-emacs@gnu.org; Sat, 01 May 2021 04:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lckq6-0004HN-F8 for bug-gnu-emacs@gnu.org; Sat, 01 May 2021 04:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 May 2021 08:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48133 X-GNU-PR-Package: emacs Original-Received: via spool by 48133-submit@debbugs.gnu.org id=B48133.161985709516394 (code B ref 48133); Sat, 01 May 2021 08:19:02 +0000 Original-Received: (at 48133) by debbugs.gnu.org; 1 May 2021 08:18:15 +0000 Original-Received: from localhost ([127.0.0.1]:60233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lckpL-0004GM-5m for submit@debbugs.gnu.org; Sat, 01 May 2021 04:18:15 -0400 Original-Received: from mail-ed1-f47.google.com ([209.85.208.47]:36684) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lckpK-0004G9-4p for 48133@debbugs.gnu.org; Sat, 01 May 2021 04:18:14 -0400 Original-Received: by mail-ed1-f47.google.com with SMTP id q6so720477edr.3 for <48133@debbugs.gnu.org>; Sat, 01 May 2021 01:18:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:cc:date:message-id :mime-version; bh=98b8RBtOMwuy81bc7sHDJReSVYGY6bx3efo95QSdP6M=; b=ZD3YRWtrERmdFKkuDCqoUzSEnH661llz5JCXvbuOT+WuU382oAy0hQrTeFNyt1Z5b5 6DQMBldKBIuZSkFxxslByOEIJfZMe1NfwPLuJUekpKCfo5FTM7PqRERQt3fq1tzyIIdo lt8dl2f9PGxQvPOYTbo4EjIUOI2oFPgd+S1o62Wi70CQFyA2TjNwLBE0OW1fZCPuX9Nu Ceu4cSmyQ1lxinrZBMKtkp7h6i1CgtAPFfMLnCppajbai5DZj7no44fs04QwkeRn9RLq 0xXGQhrB8MazwLrPfWyklvizZw3DkTPIptGa8EtWmsPLXNDER6N4jq+9Sp5QKxlD2aIp XAMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:cc:date :message-id:mime-version; bh=98b8RBtOMwuy81bc7sHDJReSVYGY6bx3efo95QSdP6M=; b=rB9E6uFZ9qn2WczmVAKG6uRvoZAY9bfR18KhIBsd3JuR4UKBbpAszShu0xv9wiMjQj u7/8iHMZC/jTAAydJF16bFfw9PUQbC9+d4uhziF2hSCseC1lgQwjQ8QX1oUgNCDmgfhU a9W9Atn6teGFv2bL22eAB0L8w1dOUfvbEf4LjqaNGVNWU2kTFZyoKLG6qQawCBdRKTbS 5TsXxhGwy610fQQabv+BojodgiIei+jPNoP2BrOPJ/4QrNchJHZMI4vZVcuAJKTT+gGI nGojFyH8lBLOKcwcDZoUp7Cax5jD/7m7IIv2huU4P8htcTJZhMvNqWx7Zemzu8Blp+yS 1t6A== X-Gm-Message-State: AOAM530AObtTncHQA1BWFH7qlpQv2t2wqOLmgbMiYcoZc4h2CnjyLelh rcBkhlfv/67bDqrIxr0666s= X-Google-Smtp-Source: ABdhPJzjhdodH87QjcXVNoKV5dfVsBvbpLUa+xucgM4G4bGKiPeDAfqX/ZI7nGvx7GTwM0D45Qb72g== X-Received: by 2002:a05:6402:4a:: with SMTP id f10mr10191787edu.85.1619857088473; Sat, 01 May 2021 01:18:08 -0700 (PDT) Original-Received: from localhost ([141.105.67.194]) by smtp.gmail.com with ESMTPSA id r15sm270537edp.62.2021.05.01.01.18.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 May 2021 01:18:07 -0700 (PDT) In-Reply-To: <83k0oiany7.fsf@gnu.org> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:205322 Archived-At: Eli Zaretskii writes: > So maybe the problem is not in time-date.el, maybe it's elsewhere? > Can you show the exact code of the test that fails and how to run it? I run it by cloning Org mode repo from https://code.orgmode.org/bzg/org-mode.git and running =make test= The failing test is test-org/deadline-close-p failing at the first should assertion: (ert-deftest test-org/deadline-close-p () "Test `org-deadline-close-p' specifications." (org-test-at-time "2016-06-03 Fri 01:43" ;; Timestamps are close if they are within `ndays' of lead time. (org-test-with-temp-text "* Heading" (should (org-deadline-close-p "2016-06-03 Fri" 0)) (should (org-deadline-close-p "2016-06-02 Thu" 0)) (should-not (org-deadline-close-p "2016-06-04 Sat" 0)) (should (org-deadline-close-p "2016-06-04 Sat" 1)) (should (org-deadline-close-p "2016-06-03 Fri 12:00" 0))) ;; Read `ndays' from timestamp if argument not given. (org-test-with-temp-text "* H" (should (org-deadline-close-p "2016-06-04 Sat -1d")) (should-not (org-deadline-close-p "2016-06-04 Sat -0d")) (should (org-deadline-close-p "2016-06-10 Fri -1w")) (should-not (org-deadline-close-p "2016-06-11 Sat -1w"))) ;; Prefer `ndays' argument over lead time in timestamp. (org-test-with-temp-text "* H" (should (org-deadline-close-p "2016-06-04 Sat -0d" 1)) (should-not (org-deadline-close-p "2016-06-04 Sat -0d" 0))) ;; Completed tasks are never close. (let ((org-todo-keywords '(("TODO" "|" "DONE")))) (org-test-with-temp-text "* TODO Heading" (should (org-deadline-close-p "2016-06-03"))) (org-test-with-temp-text "* DONE Heading" (should-not (org-deadline-close-p "2016-06-03")))))) org-deadline-close-p code: (defun org-deadline-close-p (timestamp-string &optional ndays) "Is the time in TIMESTAMP-STRING close to the current date?" (setq ndays (or ndays (org-get-wdays timestamp-string))) (and (<= (org-time-stamp-to-now timestamp-string) ndays) (not (org-entry-is-done-p)))) org-time-stamp-to-now: (defun org-time-stamp-to-now (timestamp-string &optional seconds) "Difference between TIMESTAMP-STRING and now in days. If SECONDS is non-nil, return the difference in seconds." (let ((fdiff (if seconds #'float-time #'time-to-days))) (- (funcall fdiff (org-time-string-to-time timestamp-string)) (funcall fdiff nil))))