From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nathan Neff Subject: Re: Re: [Babel] Macro for begin_src? Date: Fri, 16 Apr 2010 22:43:33 -0500 Message-ID: References: <87fx2ug61h.fsf@stats.ox.ac.uk> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1843807903==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O2ywU-000682-79 for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 23:43:38 -0400 Received: from [140.186.70.92] (port=41952 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O2ywT-00067j-0I for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 23:43:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O2ywR-0001mt-8j for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 23:43:36 -0400 Received: from mail-pw0-f41.google.com ([209.85.160.41]:36906) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O2ywR-0001mn-17 for emacs-orgmode@gnu.org; Fri, 16 Apr 2010 23:43:35 -0400 Received: by pwi2 with SMTP id 2so3195497pwi.0 for ; Fri, 16 Apr 2010 20:43:34 -0700 (PDT) In-Reply-To: <87fx2ug61h.fsf@stats.ox.ac.uk> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Dan Davison Cc: emacs-orgmode@gnu.org --===============1843807903== Content-Type: multipart/alternative; boundary=000e0cd244ba3b1fa80484668844 --000e0cd244ba3b1fa80484668844 Content-Type: text/plain; charset=ISO-8859-1 On Fri, Apr 16, 2010 at 9:35 PM, Dan Davison wrote: > Nathan Neff writes: > > > On Fri, Apr 16, 2010 at 8:18 PM, Nathan Neff > wrote: > > > > I've been converting my init.el file to org-babel, and am getting > tired of > > copying/pasting or typing the begin_src and end_src blocks. > > > > Example: > > #+begin_src emacs-lisp :results silent > > #+end_src > > Hi Nate, > > By the way, if you are using :results silent for all your blocks, then > you can just enter it once as a buffer property: > > #+property: results silent > > (and if you want it for a whole subtree but not a whole buffer, then set > a property called :results: with value silent in the root of the > subtree). > > I agree with the others about using yasnippets for blocks. I have src > and elisp snippets (although to be honest I still haven't learned the > syntax for defining them and I have trouble stopping them leaving > annoying trailing spaces...ok thanks you made me fix that, although I > still don't know the syntax, something like this then > > src: > > #+begin_src...#+end_src > # -- > #+begin_src ${2:language} > $0 > #+end_src > > elisp: > > #name : #+begin_src...#+end_src > # -- > #+begin_src emacs-lisp > $0 > #+end_src > > > Thanks! I'm having trouble triggering the yasnippets using the TAB key, so I'm just using the GUI menu. Do you literally type "src" (no quotes), then press Tab? --Nate --000e0cd244ba3b1fa80484668844 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Fri, Apr 16, 2010 at 9:35 PM, Dan Dav= ison <daviso= n@stats.ox.ac.uk> wrote:
Nathan Neff <= nathan.neff@gmail.com> writes:

> On Fri, Apr 16, 2010 at 8:18 PM, Nathan Neff <nathan.neff@gmail.com> wrote:
>
> =A0 =A0 I've been converting my init.el file to org-babel, and am = getting tired of
> =A0 =A0 copying/pasting or typing the begin_src and end_src blocks. >
> =A0 =A0 Example:
> =A0 =A0 #+begin_src emacs-lisp :results silent
> =A0 =A0 #+end_src

Hi Nate,

By the way, if you are using :results silent for all your blocks, then
you can just enter it once as a buffer property:

#+property: results silent

(and if you want it for a whole subtree but not a whole buffer, then set a property called :results: with value silent in the root of the
subtree).

I agree with the others about using yasnippets for blocks. I have src
and elisp snippets (although to be honest I still haven't learned the syntax for defining them and I have trouble stopping them leaving
annoying trailing spaces...ok thanks you made me fix that, although I
still don't know the syntax, something like this then

src:

#+begin_src...#+end_src
# --
#+begin_src ${2:language}
$0
#+end_src

elisp:

#name : #+begin_src...#+end_src
# --
#+begin_src emacs-lisp
$0
#+end_src



Thanks!=A0 I'm having trouble triggering = the yasnippets using the TAB key, so I'm just using the GUI menu.
Do you literally type "src" (no quotes), then press Tab?

--Nate

--000e0cd244ba3b1fa80484668844-- --===============1843807903== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============1843807903==--