Closed brabalan closed 4 years ago
On 05/25/20 12:02 PM, Alan Schmitt wrote:
I'm trying to send an email, and I keep getting this error:
Debugger entered--Lisp error: (wrong-number-of-arguments #<subr encode-time> 1) encode-time((0 0 0 4 7 2001 nil nil nil)) #f(compiled-function (ann) #<bytecode 0x2e01ff1>)(#<ebdb-field-anniversary ebdb-field-anniversary>)
Whoa, that's weird. What version of Emacs are you using? As far as I
know, encode-time
takes a single argument and always has done.
In the meantime you can get a working system with:
(setq ebdb-mua-auto-update-p nil)
I'm using GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29.
Calling help on encode-time
return this:
encode-time is a function defined in C source code.
(encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE)
So it seems to take multiple arguments. (I also tried it on emacs -Q
to make sure.)
Thanks a lot for the workaround.
On 05/26/20 00:20 AM, Alan Schmitt wrote:
I'm using GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10) of 2019-08-29.
Calling help on
encode-time
return this:encode-time is a function defined in C source code. (encode-time SECOND MINUTE HOUR DAY MONTH YEAR &optional ZONE)
So it seems to take multiple arguments. (I also tried it on
emacs -Q
to make sure.)
Ah! They changed the calling convention in Emacs 27. A fix should be very simple, I'll try to get that released today.
Thanks for the report.
If you have a moment would you evaluate this and make sure it works okay?
(cl-defmethod ebdb-string ((ann ebdb-field-anniversary))
(let* ((date (slot-value ann 'date))
encoded)
(setq encoded
(condition-case nil
(encode-time
;; Why did I reverse the day month order?!
`(0 0 0
,(nth 1 date)
,(car date)
,(or (nth 2 date) 0)
nil nil nil))
(wrong-number-of-arguments
;; Emacs <=26
(apply #'encode-time
`(0 0 0
,(nth 1 date)
,(car date)
,(or (nth 2 date) 0))))))
(format-time-string
(if (nth 2 date)
ebdb-anniversary-ymd-format
ebdb-anniversary-md-format)
encoded)))
Thanks!
It works great, thanks!
I'm trying to send an email, and I keep getting this error:
The root of the call is:
Is there a way to deactivate populating the ebdb window in this case? To get around the issue, I have to deactivate ebdb altogether and restart emacs.