0
votes

I am trying to use org-mode agenda view again. When I run M-x org-todo-list, I get an empty *Org Agenda* and the minibuffer displays

    Wrong number of arguments: (0 . 0), 2

I am running org-version 9.1.9 on

System Info :computer:
  • OS: gnu/linux
  • Emacs: 26.2
  • Spacemacs: 0.200.13
  • Spacemacs branch: master (rev. 8c0b8c344)
  • Graphic display: t
  • Distribution: spacemacs
  • Editing style: vim
  • Completion: ivy
  • Layers:
(javascript rust html csv c-c++ git shell spell-checking ivy emacs-lisp markdown org)

These lines are in my .spacemacs file:

(setq org-todo-keywords '((sequence "TODO" "NEXT" "PROG" "HOLD" "WAIT" "|" "DONE" "CNCL")))

 '(org-agenda-files
   (quote
    ("~/Documents/developer/editors/emacs/demo/tasks.org" "~/Documents/tasks/tasks.org")))

Both tasks.org files contain nodes with statuses that are not DONE.

Same error from interactive with debug mode on:

(custom-set-variables
 '(org-agenda-files (quote ("~/Documents/developer/editors/emacs/demo/tasks.org")))
)

Backtrace is:

Debugger entered--Lisp error: (wrong-number-of-arguments (0 . 0) 2)
  org-get-tags(nil nil)
  org-agenda-get-todos()
  org-agenda-get-day-entries("~/Documents/developer/editors/emacs/demo/tasks.org" (10 4 2019) :todo)
  org-todo-list(nil)
  funcall-interactively(org-todo-list nil)
  call-interactively(org-todo-list record nil)
  command-execute(org-todo-list record)
  #f(compiled-function (cmd) #<bytecode 0x2601e49>)("org-todo-list")
  ivy-call()
  ivy-read("M-x " ("eval-last-sexp" "toggle-debug-on-error" "org-version" "org-agenda-file-to-front" "org-publish-current-file" "org-publish" "eval-buffer" "recentf-cleanup" "elisp-index-search" "org-display-inline-images" "diff" "org-lint" "clean-buffer-list" "org-publish-project" "spacemacs/search-ack" "cd" "5x5" "arp" "dbx" "dig" "erc" "ert" "eww" "ftp" "gdb" "irc" "jdb" "man" "mpc" "pdb" "pwd" "s" "rsh" "sdb" "xdb" "calc" "dirs" "ffap" "gnus" "grep" "help" "ielm" "info" "life" "mail" "mpuz" "ping" "smex" "talk" "term" ...) :predicate nil :require-match t :history counsel-M-x-history :action #f(compiled-function (cmd) #<bytecode 0x2601e49>) :sort nil :keymap (keymap (67108908 . counsel--info-lookup-symbol) (67108910 . counsel-find-symbol)) :initial-input nil :caller counsel-M-x)
  counsel-M-x()
  funcall-interactively(counsel-M-x)
  call-interactively(counsel-M-x nil nil)
  command-execute(counsel-M-x)

A similar error was reported on Org agenda "wrong number of arguments" error running org-version 9.2.1 (I am running org-version 9.1.9).

Any help is appreciated.

UPDATE 1:

C-u M-x org-reload loaded org-version 9.2.4 and then org-todo-list worked as intended.

When I restarted emacs, org-version 9.1.9 loaded, and agenda view got the same error again.

I was not able to install the latest org-version 9.2.6 as described on https://emacs.stackexchange.com/questions/53107/how-to-update-org-mode-via-package-manager

1
(org-get-tags nil nil) does not produce an error message here: it just returns nil. So it's not clear why you get the error. You might get a more detailed backtrace by loading uncompiled Org mode and retrying.NickD
@NickD, C-u M-x org-reload got an interesting result, described in the question's UPDATE 1.wolfv

1 Answers

0
votes

UPDATE 1:

C-u M-x org-reload loaded org-version 9.2.4 and then org-todo-list worked as intended.

Thanks! This C-u M-x org-reload worked for me as well after I encountered this error on emacs 26.3. Originally I was using built-in org 9.1.9 and hit this issue. I used melpa to get 9.4.5 20210405 but wasn't able to actually get it to run until I found your answer. So thank you :)

later edit: So I realized this didn't persist across restarts of emacs. The reason why was because my ~/.emacs file contained (require 'org), which was causing emacs to load the built-in org package, rather than the newer one downloaded from melpa. Simply removing (require 'org) from my .emacs resolved the problem, now it loads the newer version of org automatically.