wrong-type-argument characterp when trying to use completing read with list of lists

35 views
Skip to first unread message

Lee Hinman

unread,
Apr 25, 2017, 1:31:52 PM4/25/17
to emacs-helm
I'm trying to diagnose an issue with my helm setup (meaning I was not able to reproduce the problem with emacs-helm.sh), and I was wondering if anyone had any ideas:

When I execute the following:

(completing-read "Buffers:" '(("todo.org") ("foo.org")) nil t)


Instead of a helm buffer with the candidates (which is what I get with emacs-helm.sh), I get the following error:

Debugger entered--Lisp error: (wrong-type-argument characterp "todo.org")
  mapconcat(#[257 "...bytecode..." [symbol-name number-to-string] 3 "\n\n(fn I)"] (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) "\n")
  helm-init-candidates-in-buffer(global (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")))
  #[0 "...bytecode..." [#[0 "...bytecode..." [(("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil "" nil t helm-comp-read-get-candidates helm-cr-default] 5] helm-init-candidates-in-buffer global functionp] 4]()
  apply(#[0 "...bytecode..." [#[0 "...bytecode..." [(("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil "" nil t helm-comp-read-get-candidates helm-cr-default] 5] helm-init-candidates-in-buffer global functionp] 4] nil)
  helm-funcall-with-source(((name . "org-iswitchb") (init #[0 "\301\211\207" [helm-cr--unknown-pattern-flag nil] 2] #[0 "...bytecode..." [#[0 "...bytecode..." [(("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil "" nil t helm-comp-read-get-candidates helm-cr-default] 5] helm-init-candidates-in-buffer global functionp] 4]) (candidates . helm-candidates-in-buffer) (keymap keymap ... etc
  helm-funcall-foreach(init)
  helm-initial-setup("")
  helm-initialize(noresume nil "" (((name . "org-iswitchb") (init #[0 "...bytecode..." [helm-cr--unknown-pattern-flag nil] 2])))) ... etc
  helm-internal((((name . "org-iswitchb") (init #[0 "...bytecode..." ])))) ... etc
  apply(helm-internal ((((name . "org-iswitchb") (init #[0 "...bytecode..." ])))) ... etc)
  helm((((name . "org-iswitchb") (init #[0 "...bytecode..." [helm-cr--unknown-pattern-flag nil] 2]))))
  apply(helm ((((name . "org-iswitchb") (init #[0 "...bytecode..." [helm-cr--unknown-pattern-flag nil] 2] #[0 "...bytecode..."])))))
  helm(:sources (((name . "org-iswitchb") (init #[0 "...bytecode..." [helm-cr--unknown-pattern-flag nil] 2] #[0 "...bytecode..."]))))
  helm-comp-read("Org buffer: " (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) :test nil :history nil :reverse-history t :input-history nil :must-match t :alistp t :name "org-iswitchb" :requires-pattern 0 :candidates-in-buffer t :exec-when-only-one nil :fuzzy nil :buffer "*helm-mode-org-iswitchb*" :default "" :initial-input nil)
  helm-completing-read-default-1("Org buffer: " (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil t nil nil nil nil "org-iswitchb" "*helm-mode-org-iswitchb*" t)
  helm-completing-read-default-handler("Org buffer: " (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil t nil nil nil nil "org-iswitchb" "*helm-mode-org-iswitchb*")
  helm--completing-read-default("Org buffer: " (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil t nil nil nil nil)
  apply(helm--completing-read-default ("Org buffer: " (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil t nil nil nil nil))
  #[128 "\300\301\"\207" [apply helm--completing-read-default completing-read-default nil] 4 nil]("Org buffer: " (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil t nil nil nil nil)
  completing-read("Org buffer: " (("todo.org") ("refile.org") ("bibliography.org") ("notes.org") ("es-team.org") ("journal.org")) nil t)
  org-iswitchb(nil)
  funcall-interactively(org-iswitchb nil)
  call-interactively(org-iswitchb nil nil)
  command-execute(org-iswitchb)

(That is the backtrace from `org-iswitchb`, which is how I noticed this problem when I updated Helm this morning

I have also noticed that I can "fix" this by changing the definition of helm-init-candidates-in-buffer from:

...
   (insert (mapconcat (lambda (i)
                        (cond ((symbolp i) (symbol-name i))
                              ((numberp i) (number-to-string i))
                              (t i)))
                       data "\n")))
...


To:

...
   (insert (mapconcat (lambda (i)
                        (cond ((symbolp i) (symbol-name i))
                              ((numberp i) (number-to-string i))
                              ((listp i)   (car i)
                              (t i)))
                       data "\n")))
...


Anyone have any idea what could be causing this? Is this because I am using a newer version of org-mode instead of the built-in version? Or perhaps related to Emacs 25.2?

Thierry Volpiatto

unread,
Apr 25, 2017, 2:47:24 PM4/25/17
to emacs...@googlegroups.com

Lee Hinman <matthew...@gmail.com> writes:

> When I execute the following:
>
> (completing-read "Buffers:" '(("todo.org") ("foo.org")) nil t)

> Anyone have any idea what could be causing this?

Yes, it's a bug I have introduced just recently (today or yesterday).
Should be fixed in few minutes.

Thanks to report.

--
Thierry
Gpg Key fingerprint = 6CEC 7081 AB33 E251 4AB8 5FC2 28D1 7F53 59F2 9997
Reply all
Reply to author
Forward
0 new messages