I have been having the following issue for a whilst now. I try to add a deadline to a headline and I receive the following error:
Wrong number of arguments: (1 . 2), 0
.
Here is the corresponding backtrace:
Debugger entered--Lisp error: (wrong-number-of-arguments (1 . 2) 0)
#f(compiled-function (arg &optional time) "Insert the \"DEADLINE:\" string with a timestamp to make a deadline.\nWith one universal prefix argument, remove any deadline from the item.\nWith two universal prefix arguments, prompt for a warning delay.\nWith argument TIME, set the deadline at the corresponding date. TIME\ncan either be an Org date like \"2011-07-24\" or a delta like \"+2d\"." (interactive "P") #<bytecode 0x1e5d005>)()
apply(#f(compiled-function (arg &optional time) "Insert the \"DEADLINE:\" string with a timestamp to make a deadline.\nWith one universal prefix argument, remove any deadline from the item.\nWith two universal prefix arguments, prompt for a warning delay.\nWith argument TIME, set the deadline at the corresponding date. TIME\ncan either be an Org date like \"2011-07-24\" or a delta like \"+2d\"." (interactive "P") #<bytecode 0x1e5d005>) nil)
org-deadline()
funcall-interactively(org-deadline)
call-interactively(org-deadline record nil)
command-execute(org-deadline record)
helm-M-x(nil #("org-deadline" 0 12 (match-part "org-deadline")))
funcall-interactively(helm-M-x nil #("org-deadline" 0 12 (match-part "org-deadline")))
call-interactively(helm-M-x nil nil)
command-execute(helm-M-x)
I receive this error before I am given the option to select a date from the calendar for the deadline.
I also receive a similar error (Wrong number of arguments (0 . 0), 2
) when trying to set a deadline in the agenda view, however I am able to select a date from the calendar and weirdly the deadline actually gets created. toggle-debug-on-error
doesn't present a backtrace upon doing this, yet the error message above is displayed nonetheless. I provide this agenda issue in case it contains useful information, but the issue at hand is that I cannot add deadlines to headlines.
I have tried updating org-mode and the problem persists.
I am using Emacs 26.2, Spacemacs v.0.200.13 and Org Mode 9.2.6.
Please let me know if I am missing any other key information and thank you for your help.
Additional information:
Result of calling C-h f org-deadline
:
org-deadline is an interactive compiled Lisp function in ‘org.el’.
It is bound to M-RET d, M-m m d, C-c C-d, and many ordinary text characters.
(org-deadline ARG &optional TIME)
:after advice: ‘org-save-all-org-buffers’
Insert the "DEADLINE:" string with a timestamp to make a deadline.
With one universal prefix argument, remove any deadline from the item.
With two universal prefix arguments, prompt for a warning delay.
With argument TIME, set the deadline at the corresponding date. TIME
can either be an Org date like "2011-07-24" or a delta like "+2d".
[back]
M-x
(execute-extended-command
) instead ofhelm-M-x
? Just a thought. Otherwise, maybe try removing any byte-compiled Org libraries. It looks likecall-interactively
is not picking up a value (should benil
) for the required arg (prefix arg).spacemacs/recompile-elpa
to avoid problems caused by packages byte-compiled under different emacs versions. (That can take a while depending on the number of packages you have installed.)call-interactively
callsorg-deadline
without args.(interactive nil)
is a wronginteractive-form
fororg-deadline
. You see that if you scan the line beginning withapply(#f(compiled-function
up to(interactive "P")
which givesorg-deadline
the prefix argument as single argument. Our task is now to determine whyinteractive-form
returns the wrong interactive form fororg-deadline
. CallC-h f org-deadline
and copy the full help buffer and paste it to the question. Alternatively, you can also scan that help buffer yourself for oddities.