fix(snippets): yas-expand error on yas-choose-value (#5429)

`+snippets-prompt-private` was overzealous intercepting the candidates fed to
`yas-choose-value`. For example, expanding the `jupyter` snippet in org mode
results in:

\#+begin_src jupyter-Wrong type argument: yas--template, "python" :session :async yes
...
\#+end_src
This commit is contained in:
HyunggyuJang 2021-09-16 01:59:43 +09:00 committed by GitHub
parent 25c7f347cb
commit 33e922645b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -20,7 +20,9 @@ If there are conflicting keys across the two camps, the built-in ones are
ignored. This makes it easy to override built-in snippets with private ones."
(when (eq this-command 'yas-expand)
(let* ((gc-cons-threshold most-positive-fixnum)
(choices (cl-remove-duplicates choices :test #'+snippets--remove-p)))
(choices (condition-case _
(cl-remove-duplicates choices :test #'+snippets--remove-p)
(wrong-type-argument choices))))
(if (cdr choices)
(cl-loop for fn in (cdr (memq '+snippets-prompt-private yas-prompt-functions))
if (funcall fn prompt choices display-fn)