From mboxrd@z Thu Jan 1 00:00:00 1970 From: Paul Dumais Subject: Re: Detangle - How to get it to work Date: Mon, 5 Aug 2013 17:10:33 -0600 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54115) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6TvD-0007Qu-7y for emacs-orgmode@gnu.org; Mon, 05 Aug 2013 19:10:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V6Tv8-00070O-NZ for emacs-orgmode@gnu.org; Mon, 05 Aug 2013 19:10:38 -0400 Received: from mail-la0-x235.google.com ([2a00:1450:4010:c03::235]:40348) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V6Tv8-000703-3k for emacs-orgmode@gnu.org; Mon, 05 Aug 2013 19:10:34 -0400 Received: by mail-la0-f53.google.com with SMTP id el20so2491569lab.26 for ; Mon, 05 Aug 2013 16:10:33 -0700 (PDT) In-Reply-To: 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: emacs-orgmode@gnu.org Ok, I have a work-around which involves handling an error in ob-tangle.el. The bug is in the org-babel-tangle-jump-to-org function where 'forward-char' is spitting out an unhandled error as it tries to move beyond the end of the buffer. Here's the diff for my simple (half) fix: 1 file changed, 4 insertions(+), 1 deletion(-) lisp/ob-tangle.el | 5 ++++- Modified lisp/ob-tangle.el diff --git a/lisp/ob-tangle.el b/lisp/ob-tangle.el index 8141943..5cf50d4 100644 --- a/lisp/ob-tangle.el +++ b/lisp/ob-tangle.el @@ -542,7 +542,10 @@ which enable the original code blocks to be found." (org-edit-special) ;; Then move forward the correct number of characters in the ;; code buffer. - (forward-char (- mid body-start)) + (condition-case err + (forward-char (- mid body-start)) + (error (message "mid %d body-start %d\nerror message: %s" + mid body-start (error-message-string err)))) ;; And return to the Org-mode buffer with the point in the right ;; place. (org-edit-src-exit) The real fix would involve finding out why the (- mid body-start) value is not calculated correctly and puts point beyond the end of the buffer. On Mon, Aug 5, 2013 at 1:36 PM, Paul Dumais wrote: > Hi, I think detangle is a must for collaborative work. > > I think I have read the instructions correctly, yet I can't seem to > get it to work. Here is a minimal test: > > Org file named test.org: > #+PROPERTY: comments link > * Some source > #+begin_src clojure :tangle yes > (defn hello [] (println "hello")) > #+end_src > > This produces the following file named test.clj upon tangling: > > ;; [[file:~/test.org::*Some%20source][Some\ source:1]] > > (defn hello [] (println "hello")) > > ;; Some\ source:1 ends here > > When I add a line to the file: > (def x 1) > > and save, then do M-x org-babel-detangle, it says: > Detangled 0 code blocks > > Is there something I'm missing? > > Thanks!