From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?ISO-8859-1?Q?Andr=E1s_Major?= Subject: Re: automatic tangle Date: Tue, 17 Jan 2012 09:06:48 +0100 Message-ID: References: <871ur26v2q.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 ([140.186.70.92]:59393) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn44E-0005cl-To for emacs-orgmode@gnu.org; Tue, 17 Jan 2012 03:07:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rn449-0004KG-Ua for emacs-orgmode@gnu.org; Tue, 17 Jan 2012 03:06:54 -0500 Received: from mail-ww0-f49.google.com ([74.125.82.49]:37591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rn449-0004K9-QA for emacs-orgmode@gnu.org; Tue, 17 Jan 2012 03:06:49 -0500 Received: by wgbdq13 with SMTP id dq13so1181941wgb.30 for ; Tue, 17 Jan 2012 00:06:48 -0800 (PST) In-Reply-To: <871ur26v2q.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: emacs-orgmode Thanks Eric, Thanks a lot for the quick reply. Any chances of this being incorporated into Org-Mode in the near future? Andr=E1s On 1/14/12, Eric Schulte wrote: > Andr=E1s Major writes: > >> Hi Sebastien, >> >>> I have the impression it's already there: if you edit your code directl= y >>> 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/ >