From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: automatic tangle Date: Fri, 20 Jan 2012 10:54:52 -0700 Message-ID: <87pqeenqpk.fsf@gmx.com> References: <871ur26v2q.fsf@gmx.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([140.186.70.92]:33373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RoJiT-000290-II for emacs-orgmode@gnu.org; Fri, 20 Jan 2012 14:01:43 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RoJiR-0001uR-Vc for emacs-orgmode@gnu.org; Fri, 20 Jan 2012 14:01:37 -0500 Received: from mailout-us.gmx.com ([74.208.5.67]:46911 helo=mailout-us.mail.com) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1RoJiR-0001uK-ON for emacs-orgmode@gnu.org; Fri, 20 Jan 2012 14:01:35 -0500 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: =?utf-8?Q?Andr=C3=A1s?= Major Cc: emacs-orgmode , Eric Schulte I've just added the two functions below to org-src.el. Cheers, Andr=C3=A1s Major writes: > Thanks Eric, > > Thanks a lot for the quick reply. Any chances of this being > incorporated into Org-Mode in the near future? > > Andr=C3=A1s > > > On 1/14/12, Eric Schulte wrote: >> Andr=C3=A1s Major writes: >> >>> Hi Sebastien, >>> >>>> I have the impression it's already there: if you edit your code direct= ly >>>> in >>>> the Org buffer, without opening an indirect buffer, the only thing you >>>> have to >>>> do is: >>> >>> That's precisely what I want to avoid. I'd like to use the >>> language-specific indentation and highlighting using the indirect >>> buffer. Basically, what I'm after is a quick keyboard command that >>> tangles the entire file while I'm in the indirect buffer. >>> >> >> The following functions provide for (1) easily executing code in the >> org-mode buffer related to the current edit buffer and (2) tangling the >> org-mode buffer related to the current edit buffer. Binding (2) to a >> key in `org-src-mode' should provide the functionality you describe. >> >> #+BEGIN_SRC emacs-lisp >> (defmacro org-src-in-org-buffer (&rest body) >> `(save-window-excursion >> (org-edit-src-exit 'save) >> ,@body >> (setq msg (current-message)) >> (if (eq org-src-window-setup 'other-frame) >> (let ((org-src-window-setup 'current-window)) >> (org-edit-src-code 'save)) >> (org-edit-src-code 'save)) >> (message (or msg "")))) >> >> (defun org-src-tangle (arg) >> (interactive "P") >> (org-src-in-org-buffer (org-babel-tangle arg))) >> #+END_SRC >> >> I think that the above should be folded into org-src.el, but I'm not >> entirely sure how. (1) could be used to perform a number of functions >> in the org buffer from an edit buffer, although off the top of my head >> I'm not sure if there exists a need for this aside from tangling. >> >> Best, >> >> -- >> Eric Schulte >> http://cs.unm.edu/~eschulte/ >> > --=20 Eric Schulte http://cs.unm.edu/~eschulte/