[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] shell scripts in yasnippet?
From: |
John Kitchin |
Subject: |
Re: [O] shell scripts in yasnippet? |
Date: |
Fri, 04 Sep 2015 09:20:20 -0400 |
This is kind of close:
#+BEGIN_SRC emacs-lisp
(yas-global-mode)
(with-temp-buffer
(insert "# name : my-fortune
# key: myf
# expand-env: ((yas-indent-line nil)
# --
#+BEGIN_QUOTE:
${1:`(shell-command-to-string \"fortune\")`}
#END_QUOTE
$0
")
(yas-load-snippet-buffer-and-close 'org-mode))
#+END_SRC
For some reason it is inserting some extra spaces before # for me, and I
cannot figure out why.
Tobias Frischholz writes:
> Hi there,
>
> right now I’m tinkering around with yasnippet.
> I was wondering if there’s a possibility to run a shell script and write its
> results in the text file.
>
> Specifically, I’m want to run “fortune” and put the results in a
> #+BEGIN_QUOTE…#+END_QUOTE block.
> Would that be possible?
> Best regards,
> Tobias Frischholz
>
> PGP PUBLIC KEY: http://pgp.mit.edu/pks/lookup?search=0xCD463AC1&op=index
--
Professor John Kitchin
Doherty Hall A207F
Department of Chemical Engineering
Carnegie Mellon University
Pittsburgh, PA 15213
412-268-7803
@johnkitchin
http://kitchingroup.cheme.cmu.edu