From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: shell scripts in yasnippet? Date: Fri, 04 Sep 2015 09:20:20 -0400 Message-ID: References: <16A16A59-258B-4A8F-9E8F-F2D82B9735CB@friolz.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56610) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqus-0007ae-Vc for emacs-orgmode@gnu.org; Fri, 04 Sep 2015 09:20:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXquo-0001zr-Pr for emacs-orgmode@gnu.org; Fri, 04 Sep 2015 09:20:30 -0400 Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:36346) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXquo-0001zU-Ic for emacs-orgmode@gnu.org; Fri, 04 Sep 2015 09:20:26 -0400 Received: by qkcf65 with SMTP id f65so8206579qkc.3 for ; Fri, 04 Sep 2015 06:20:25 -0700 (PDT) In-reply-to: <16A16A59-258B-4A8F-9E8F-F2D82B9735CB@friolz.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tobias Frischholz Cc: Org Mode Mailing List 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