From mboxrd@z Thu Jan 1 00:00:00 1970 From: Frederick Giasson Subject: Re: org-detangle seems broken Date: Wed, 6 Jun 2018 08:31:50 -0400 Message-ID: References: <87wovhmr0v.fsf@nicolasgoaziou.fr> <87o9gp7dwb.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000e9dd90056df8590d" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQXbV-0003eP-MO for emacs-orgmode@gnu.org; Wed, 06 Jun 2018 08:31:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQXbU-0000Vi-BV for emacs-orgmode@gnu.org; Wed, 06 Jun 2018 08:31:53 -0400 Received: from mail-qt0-x22e.google.com ([2607:f8b0:400d:c0d::22e]:40605) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQXbU-0000VC-4k for emacs-orgmode@gnu.org; Wed, 06 Jun 2018 08:31:52 -0400 Received: by mail-qt0-x22e.google.com with SMTP id q6-v6so6087867qtn.7 for ; Wed, 06 Jun 2018 05:31:51 -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" To: Grant Rettke Cc: Org-mode , Nicolas Goaziou --000000000000e9dd90056df8590d Content-Type: text/plain; charset="UTF-8" Hi Grant, I think it is expected. The code looks like this: > > (when (setq new-body (org-babel-tangle-jump-to-org)) > (org-babel-update-block-body new-body)) > Yeah not sure I fully understand that code. Basically it does this for each code block that needs to be detangled right? I am just not sure why the focus doesn't return back to the source at the end of the process. > The first time I detangled I was surprised, too. > > But then it hit me: if you are detangling then you probably might want to > 1. See the updated code > 2. Commit the updated code > Yes, I agree with you. However on a team that work on a LP project, different people have different preferences and workflows. Personally I only code in the Org-file, and toggle a code block to its major mode if I need something provided by the major mode (coding in Clojure). However, some people prefer see the full namespace (one namespace per Org file) directly in Cider (the major mode) and detangle from there (this is why I got interested in detangling). In their case, having the buffer switching back to the Org file is a bit irritating, particularly since there is no (yet) any function that let you switch to the tangle source file of a code block. If this is really the behavior, then I think that a new option should be added to it such that we can choose one behavior or the other. If a function that jump from a code block to its tangled source is created, then we could use it with that option in `org-babel-detangle` to switch back to the source if it is the wish of the user. Thoughts? Thanks, Fred --000000000000e9dd90056df8590d Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Grant,


I think it is expected. The code looks like this:

(when (setq new-body (org-babel-tangle-jump-to-org))
=C2=A0 =C2=A0 =C2=A0 (org-babel-update-block-body new-body))

Yeah not sure I fully understand that code. Basically it does this for each=20 code block that needs to be detangled right? I am just not sure why the=20 focus doesn't return back to the source at the end of the process.
<= /div>
=C2=A0
The first time I detangled I was surprised, too.

But then it hit me: if you are detangling then you probably might want to 1. See the updated code
2. Commit the updated code

Yes, I agree with you. However on a team that work on a LP project,=20 different people have different preferences and workflows. Personally I=20 only code in the Org-file, and toggle a code block to its major mode if I need something provided by the major mode (coding in Clojure). However, some people prefer see the full namespace (one namespace per Org file)=20 directly in Cider (the major mode) and detangle from there (this is why I got interested in detangling).

In their case,=20 having the buffer switching back to the Org file is a bit irritating,=20 particularly since there is no (yet) any function that let you switch to the tangle source file of a code block.

If=20 this is really the behavior, then I think that a new option should be=20 added to it such that we can choose one behavior or the other. If a=20 function that jump from a code block to its tangled source is created,=20 then we could use it with that option in `org-babel-detangle` to switch=20 back to the source if it is the wish of the user.

= Thoughts?


Thanks,

Fred

--000000000000e9dd90056df8590d--