• Emacs: 27.1
  • Doom: 2.0.9
  • Yasnippet: 0.14.0

I have the following snippet that I have been using for a while to record "mood" notes in my journal:

# -*- mode: snippet -*-
# name: New Mood Note
# key: nmn
# --
`(get-current-time)` ${1:$$(yas-choose-value '("😰" "πŸ˜•" "😐" "πŸ™‚" "πŸ˜„"))}
:MOOD:      ${2:Mood index}
:LOCATION:  ${3:Location}


First, it prompts me to choose an emoji (I know, it's kindof corny but it works well for me). After selecting that I just tab to the mood and location sections in that order.

I've been using this snippet successfully for a while in "vanilla" Emacs, but I recently switched everything over to Doom emacs. Now when I try to load this snippet by pressing nmn and hitting the tab key (thus executing yas-expand) I see the follwoing:

21:41:46 Args out of range: "😰", 1
:MOOD:      Mood index
:LOCATION:  Location

I'm not ever prompted for an emoji, it just prints that.

The strange part is that when I expand the snippet using yas-expand-from-trigger-key (or test it using yas-tryout-snippet) it works perfectly. It only breaks when I try to use it in an Org doc with plain-old yas-expand, i.e. typing nmn and hitting tab.

I tried using yas snippets instead of doom snippets like to to see if it makes a difference:

(package! doom-snippets :ignore t)
(package! yasnippet-snippets)

But that didn't make a difference. Also I don't have any additional yas-related configuration.

Has anyone else ever seen anything like this?

Your Answer

By clicking β€œPost Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.