1

I have a yasnippet snippet for adding the boilerplate to my "daily review" org document. Here's what it looks like:

# key: ndr
# name: newdailyreview
# --
* Accomplishments
  :PROPERTIES:
 :CUSTOM_ID: accomplishments
  :END

  - $1

* Goals For Tomorrow
  :PROPERTIES:
 :CUSTOM_ID: goals
  :END

  - $2

* Observations
  :PROPERTIES:
 :CUSTOM_ID: observations
  :END

  $0

The problem is that when the property drawer is malformed when printed. I tried preserving white space by adding this at the top:

# expand-env: ((yas-indent-line 'fixed) (yas-wrap-around-region 'nil))

But that didn't make a difference. I then tried setting the property like this:

`(org-set-property "CUSTOM_ID" "report")`

Unfortunately, this actually changes the buffer, which I believe is a deprecated feature of yasnippet.

Is there another way to solve this problem?

  • 1
    I can't reproduce what you describe. I have yas-indent-line set to 'auto which seems to do the right thing. You are missing a : after END in the first block, and seem to be missing a space in front of the CUSTOM_ID, but even these are all corrected with 'auto for me. – John Kitchin Feb 5 at 23:10
  • Yes John, you are correct. The issue was with typos in my snippet. Thank you for the help! – Tom Purl Feb 6 at 15:33
0

Above John pointed out that the issue was with typos. Here's what ended up working:

# key: ndr
# name: newdailyreview
# expand-env: ((yas-indent-line 'auto) (yas-wrap-around-region 'nil))
# --
* Accomplishments
  :PROPERTIES:
  :CUSTOM_ID: accomplishments
  :END:

  - $1

* Goals For Tomorrow
  :PROPERTIES:
  :CUSTOM_ID: goals
  :END:

  - $2

* Observations
  :PROPERTIES:
  :CUSTOM_ID: observations
  :END:

  $0

Thanks again John!

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.