emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Ihor Radchenko <yantar92@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-test: Fix wrong-numbre-of-arguments error on master+native-comp
Date: Sun, 02 May 2021 16:43:08 +0800	[thread overview]
Message-ID: <87pmy9bk6b.fsf@localhost> (raw)

[-- Attachment #1: Type: text/plain, Size: 446 bytes --]

Running make test on master using Emacs master compiled with native-comp
support throws error:

decode-time((22352 22528) nil nil)
  time-to-days((22352 22528))
  org-time-stamp-to-now("2016-06-03 Fri")
  org-deadline-close-p("2016-06-03 Fri" 0)
  apply(org-deadline-close-p ("2016-06-03 Fri" 0))

As discussed in Emacs bug#48133, this is because of outdated cl-letf
statement in org-test. The attached patch is fixing the problem.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-test-Fix-wrong-numbre-of-arguments-error-on-mast.patch --]
[-- Type: text/x-diff, Size: 1790 bytes --]

From f973eb6cf635ccce86b865001d0bca5fba29c898 Mon Sep 17 00:00:00 2001
Message-Id: <f973eb6cf635ccce86b865001d0bca5fba29c898.1619944483.git.yantar92@gmail.com>
From: Ihor Radchenko <yantar92@gmail.com>
Date: Sun, 2 May 2021 16:29:02 +0800
Subject: [PATCH] org-test: Fix wrong-numbre-of-arguments error on

* testing/org-test.el (org-test-at-time): Use correct number of
arguments in 'decode-time cl-letf binding. `decode-time' accepts up to
3 arguments on master.

The wrong-numbre-of-arguments error is raised on Emacs master
configured with native-comp support when running make test on Org mode
master.  Native-comp modifies function calls with optional arguments
in the way that omitted arguments are still provided as `nil'.  For
example, `decode-time' called as (decode-time time) in lisp source may
be compiled into (decode-time time nil nil) call by native-compiler.
If redefined `decode-time' does not accept 3 arguments, it result in

See Emacs bug#48133.
 testing/org-test.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/testing/org-test.el b/testing/org-test.el
index ade212440..30adb977e 100644
--- a/testing/org-test.el
+++ b/testing/org-test.el
@@ -466,8 +466,8 @@ (defmacro org-test-at-time (time &rest body)
 	       (apply ,(symbol-function 'current-time-zone)
 		      (or time ,at) args)))
 	    ((symbol-function 'decode-time)
-	     (lambda (&optional time) (funcall ,(symbol-function 'decode-time)
-					       (or time ,at))))
+	     (lambda (&optional time zone form) (funcall ,(symbol-function 'decode-time)
+					            (or time ,at) zone form)))
 	    ((symbol-function 'encode-time)
 	     (lambda (time &rest args)
 	       (apply ,(symbol-function 'encode-time) (or time ,at) args)))

             reply	other threads:[~2021-05-02  8:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-02  8:43 Ihor Radchenko [this message]
2021-05-02  9:07 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pmy9bk6b.fsf@localhost \
    --to=yantar92@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: [PATCH] org-test: Fix wrong-numbre-of-arguments error on master+native-comp' \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).