From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: paste from clip to code block Date: Sat, 5 Sep 2015 15:15:26 -0500 Message-ID: References: <87383ypzbd.fsf@yale.edu> <86k2wkbyyb.fsf@example.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYJs0-00082M-K0 for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 16:15:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYJrz-00063A-DR for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 16:15:28 -0400 Received: from mail-io0-x22c.google.com ([2607:f8b0:4001:c06::22c]:35617) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYJrz-000636-2q for emacs-orgmode@gnu.org; Sat, 05 Sep 2015 16:15:27 -0400 Received: by ioiz6 with SMTP id z6so55677970ioi.2 for ; Sat, 05 Sep 2015 13:15:26 -0700 (PDT) In-Reply-To: <86k2wkbyyb.fsf@example.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: Sebastien Vauban Cc: "emacs-orgmode@gnu.org" On Thu, May 7, 2015 at 2:59 AM, Sebastien Vauban wrote: > John Kitchin wrote: >> I have these templates defined in my setup: I used my duplicated Org macros as an excuse to learn YASnippet and came up with this. It is work in progress, but it works. I got tired of entering a name so many times along with an output file during exploratory programming in the .emacs.el: https://github.com/grettke/help/blob/master/yasnippet/org-mode/sc. It does require learning YAS at some point, and it is worth it. # -*- mode: snippet -*- # key: sc # name: Source Block # group: HELP # contributor: gcr@wisdomandwonder.com # -- #+NAME: ${1:`(org-id-new)`} #+BEGIN_SRC ${2:$$(yas-choose-value '("emacs-lisp" "org" "sass" "R" "ditaa" "dot" "plantuml"))}${2:$(when (-contains? '("ditaa" "dot" "plantuml") yas-text) (concat " :file \\"./image/" (yas-field-value 1) ".png\\""))} $3 $0 #+END_SRC