ivy-yasnippet
ivy-yasnippet copied to clipboard
`ivy-yasnippet` executes custom lisp on Org snippet before I exit the minibufer, giving me an `ivy-read` error
Runtime Environment
- MX Linux 18
- GNU Emacs 27.0.50
- ~/.emacs.d
- my yasnippets packages configurations
Issue
- This is the snippet in question:
# key: bk
# name: Add books to my catalogue
# expand-env ((yas-indent-line 'fixed))
# --
** T ${1:Title}
:PROPERTIES:
:TITLE: $1
:TYPE: ${2:$$(yas-choose-value '(" Book" " Article" " Other"))}
:GENRE: ${3:Genre}
:AUTHOR: ${4:Author}
:LINK: ${6:Wikipedia}$0
:CREATED: `(insert (format-time-string "[%a, %y-%m-%d]"))`
:START: `(let ((x(org-time-stamp-inactive))))`
:END: Unknown
:COMPLETE: $5%
:END:
When I cycle through this particular Org Mode snippet with ivy-yasnippet
, I get the following error:
ivy-read: Command attempted to use minibuffer while in minibuffer
I'm, therefore, unable to execute the snippet via ivy-yasnippet
.
Thanks for reporting that.
When I cycle through this particular Org Mode snippet with
ivy-yasnippet
, I get the following error:ivy-read: Command attempted to use minibuffer while in minibuffer
It makes sense, because the command org-time-stamp-inactive
attempts to read user input from the minibuffer, while ivy
has control of it. There is a conflict, because two commands want to use the minibuffer. I suggest that you use something like (org-time-stamp-inactive '(16))
to prevent the org command from using the minibuffer.
You can also do a check, like:
(if ivy--yasnippet-buffer (org-time-stamp-inactive '(16)) (org-time-stamp-inactive))
which will make the command use the minibuffer normally, and prevent from using it in preview mode.