[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: What does all-completions with COLLECTION == obarray return?
From: |
Michael Heerdegen |
Subject: |
Re: What does all-completions with COLLECTION == obarray return? |
Date: |
Wed, 15 Apr 2015 15:56:25 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
Michael Heerdegen <address@hidden> writes:
> I'll try to step through the code and find out where something gets
> actually added to obarray.
I was lucky and could condense a recipe for emacs -Q out of the Helm
code we use:
--8<---------------cut here---------------start------------->8---
(progn
(intern "Bahá'í Date") ;this happens when requiring org
(let* ((collection (all-completions "" obarray))
(test #'facep)
(predicate `(lambda (elm)
(condition-case err
(if (eq (quote ,test) 'commandp)
(funcall (quote ,test) (intern elm))
(funcall (quote ,test) elm))
(wrong-type-argument
(funcall (quote ,test) (intern elm)))))))
(ignore (all-completions "" collection predicate))
;; Test if "Bahá'í Date" is the name of more than one interned symbol
(when (let ((i 0))
(catch 'done
(mapatoms (lambda (s) (when (string= (symbol-name s) "Bahá'í
Date")
(if (< i 1) (setq i 1) (throw 'done t)))))
nil))
(message "Gotcha!"))))
--8<---------------cut here---------------end--------------->8---
Copy this into scratch in emacs -Q and hit C-x C-e. I get "Gotcha!",
meaning that after evaluation, there is more than one interned symbol
named "Bahá'í Date".
I guess this should not happen, so it is a bug in Emacs in think.
Thanks,
Michael.