From mboxrd@z Thu Jan 1 00:00:00 1970 From: Leo Alekseyev Subject: Re: Is it possible to run shell script src blocks as root or to export individual blocks? Date: Mon, 19 Mar 2012 04:42:14 -0400 Message-ID: References: <87pqctkahb.fsf@gmx.com> <87ty25hbz6.fsf@med.uni-goettingen.de> <87wr6zax0z.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:45398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9YAa-0002ZH-Lg for emacs-orgmode@gnu.org; Mon, 19 Mar 2012 04:42:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9YAU-0002IM-CE for emacs-orgmode@gnu.org; Mon, 19 Mar 2012 04:42:24 -0400 Received: from mail-pb0-f41.google.com ([209.85.160.41]:41198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9YAU-0002Hi-3H for emacs-orgmode@gnu.org; Mon, 19 Mar 2012 04:42:18 -0400 Received: by pbcup15 with SMTP id up15so1024365pbc.0 for ; Mon, 19 Mar 2012 01:42:15 -0700 (PDT) In-Reply-To: <87wr6zax0z.fsf@gmx.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: Eric Schulte Cc: Andreas Leha , emacs-orgmode@gnu.org On Mon, Mar 5, 2012 at 10:24 AM, Eric Schulte wrote: > Andreas Leha writes: > >> Eric Schulte writes: >> >>> Leo Alekseyev writes: >>> >>>> I was wondering if there was an easy way to execute some shell >>>> commands contained in a src block as root. =A0Alternatively, is there = a >>>> quick way to export _just_ that one source block to a temp file so >>>> that I could run it as root manually? >>>> >>> >>> Just call org-babel-tangle with a prefix argument and it only tangles >>> the current block Hi all, I just pulled a fresh version of org, and this tangling an individual block only works if there's a :tangle header argument present. I don't think this is the intended behavior! The problem, it seems, is that when :tangle is not present, the (or ...) in the code below always evaluates to true. #+begin_src emacs-lisp (unless (or (cdr (assoc :tangle (nth 2 (org-babel-get-src-block-info)= ))) target-file) (setq target-file (read-from-minibuffer "Tangle to: " (buffer-file-name))))) #+end_src