all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [PATCH] org-test: Fix wrong-numbre-of-arguments error on master+native-comp
@ 2021-05-02  8:43 Ihor Radchenko
  2021-05-02  9:07 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Ihor Radchenko @ 2021-05-02  8:43 UTC (permalink / raw)
  To: emacs-orgmode

[-- 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.

Best,
Ihor


[-- 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
 master+native-comp

* 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
error.

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)))
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] org-test: Fix wrong-numbre-of-arguments error on master+native-comp
  2021-05-02  8:43 [PATCH] org-test: Fix wrong-numbre-of-arguments error on master+native-comp Ihor Radchenko
@ 2021-05-02  9:07 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2021-05-02  9:07 UTC (permalink / raw)
  To: Ihor Radchenko; +Cc: emacs-orgmode

Hi Ihor,

applied in maint as commit 0e7153e63, thank you very much!

-- 
 Bastien


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-05-02  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-02  8:43 [PATCH] org-test: Fix wrong-numbre-of-arguments error on master+native-comp Ihor Radchenko
2021-05-02  9:07 ` Bastien

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.