emacscontactsorg-mode

Error when running org-contacts: org-contacts--candidate: Wrong type argument: integer-or-marker-p


I'm trying to use org-contacts with Emacs and org-mode but are getting an error using the basic search command, org-contacts. After installing org-contacts from melpa, and with this Emacs config:

(use-package org-contacts  
   :ensure t  
   :custom  
   (org-contacts-files '("~/org/contacts.org")))  

and this first test entry in the contacts.org file:

* Joe Blog  
  :PROPERTIES:  
  :TEL: +1 650 123 4567  
  :EMAIL:    joeblog@gmail.com  
  :URL:  
  :NOTES: Nice Guy  
  :END:  

calling M-x org-contacts, gives this error (debugger Backtrace)

Debugger entered--Lisp error: (wrong-type-argument integer-or-marker-p (headline (:raw-value "Joe Blog" :begin 46 :end 212 :pre-blank 0 :contents-begin 57 :contents-end 212 :robust-begin nil :robust-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 46 :TEL "+1 650 123 4567" :EMAIL "joeblog@gmail.com" :URL "" :NOTES "Nice Guy" :ID "e74e91ec-9d87-4624-8ef0-71d48dccf341" :title "Joe Blog" :mode first-section ...)))
org-entry-properties((headline (:raw-value "Joe Blog" :begin 46 :end 212 :pre-blank 0 :contents-begin 57 :contents-end 212 :robust-begin nil :robust-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 46 :TEL "+1 650 123 4567" :EMAIL "joeblog@gmail.com" :URL "" :NOTES "Nice Guy" :ID "e74e91ec-9d87-4624-8ef0-71d48dccf341" :title "Joe Blog" :mode first-section ...)) standard)
org-contacts--candidate((headline (:raw-value "Joe Blog" :begin 46 :end 212 :pre-blank 0 :contents-begin 57 :contents-end 212 :robust-begin nil :robust-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 46 :TEL "+1 650 123 4567" :EMAIL "joeblog@gmail.com" :URL "" :NOTES "Nice Guy" :ID "e74e91ec-9d87-4624-8ef0-71d48dccf341" :title "Joe Blog" :mode first-section ...)))
#f(compiled-function (headline) #<bytecode -0x16cf8aeb8c5a3451>)((headline (:raw-value "Joe Blog" :begin 46 :end 212 :pre-blank 0 :contents-begin 57 :contents-end 212 :robust-begin nil :robust-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 46 :TEL "+1 650 123 4567" :EMAIL "joeblog@gmail.com" :URL "" :NOTES "Nice Guy" :ID "e74e91ec-9d87-4624-8ef0-71d48dccf341" :title "Joe Blog" :mode first-section ...)))
#f(compiled-function (--data) #<bytecode -0x1d67545669d4fcbf>)((headline (:raw-value "Joe Blog" :begin 46 :end 212 :pre-blank 0 :contents-begin 57 :contents-end 212 :robust-begin nil :robust-end nil :level 1 :priority nil :tags nil :todo-keyword nil :todo-type nil :post-blank 0 :footnote-section-p nil :archivedp nil :commentedp nil :post-affiliated 46 :TEL "+1 650 123 4567" :EMAIL "joeblog@gmail.com" :URL "" :NOTES "Nice Guy" :ID "e74e91ec-9d87-4624-8ef0-71d48dccf341" :title "Joe Blog" :mode first-section ...)))
mapc(#f(compiled-function (--data) #<bytecode -0x1d67545669d4fcbf>) ((headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) ...))
#f(compiled-function (--data) #<bytecode -0x1d67545669d4fcbf>)((org-data (:begin 1 :contents-begin 1 :contents-end 79758 :end 79760 :robust-begin 3 :robust-end 79756 :post-blank 2 :post-affiliated 1 :path nil :mode org-data ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) ...))
org-element-map((org-data (:begin 1 :contents-begin 1 :contents-end 79758 :end 79760 :robust-begin 3 :robust-end 79756 :post-blank 2 :post-affiliated 1 :path nil :mode org-data ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) (headline ...) ...) headline #f(compiled-function (headline) #<bytecode -0x16cf8aeb8c5a3451>))
org-contacts--candidates(("~/org/contacts.org"))
org-contacts--return-candidates(("~/org/contacts.org"))
org-contacts()
funcall-interactively(org-contacts)
command-execute(org-contacts record)
execute-extended-command(nil "org-contacts" "org")
funcall-interactively(execute-extended-command nil "org-contacts" "org")
command-execute(execute-extended-command)

Solution

  • Problem resolved with the release of Org mode 9.7. For details see comment from NickD.