From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrea Giugliano Subject: Fwd: Re: Bug: Org-babel-detangle does not work for subtrees [8.3.5 (8.3.5-elpaplus @ /home/andrea/.emacs.d/elpa/org-plus-contrib-20160808/)] Date: Wed, 31 Aug 2016 14:01:13 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf64w-0003wN-2X for emacs-orgmode@gnu.org; Wed, 31 Aug 2016 10:01:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bf64q-00028r-IA for emacs-orgmode@gnu.org; Wed, 31 Aug 2016 10:01:21 -0400 Received: from snt004-omc4s32.hotmail.com ([65.55.90.235]:53316) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bf64q-00028b-Ae for emacs-orgmode@gnu.org; Wed, 31 Aug 2016 10:01:16 -0400 Content-Language: en-US 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: "emacs-orgmode@gnu.org" I am not sure my previous mail reached everyone interested. Best, Andrea Andrea Giugliano writes: > Hello, > > I found a solution, or better I have understood how detangling is > supposed to work after reading ob-tangle.el. > > Basically, I found necessary two things to detangle properly (not > counting the =3D:comments yes=3D that is described in the info): > > 1) the cursor needs to be _on_ the code body, and *not* on the comments > generated by org-babel-tangle. > > 2) the setting =3D(setq org-babel-tangle-use-relative-file-links 'nil)=3D= is essential: > indeed, using relative path makes my org-babel-jump-to-org try to > find something like home/andrea/home/andrea... that typically does > not exists. > > I am not sure if this is a src bug (in the wrong default of > =3Dorg-babel-tangle-use-relative-file-links=3D), or a documentation (http= ://orgmode.org/worg/doc.html) bug. > > It would be nice that =3Dorg-babel-detangle=3D and > =3Dorg-babel-tangle-jump-to-org=3D could support IDs link navigation as w= ell > sometimes in the future (since it is possible to base links > definitions on IDs with =3D(setq org-id-link-to-org-use-id t)=3D). > Thanks, > > Andrea > > P.S: thanks Grant, your answer gave me the right ques to solve my > problem. (Also, I am not sure I fully understood the capabilities of your > framework "help" from the repository description, but I liked the > guidelines for literate programming you gave in one of the readmes.) > > Grant Rettke writes: > >> Good evening Andrea, >> >> Does it use the contents of the headline instead of the ID? >> >> If yes, I know what you mean, but I don't remember why it does that >> because long ago I changed it so that it uses the NAME of the ID >> instead. I can tell you how my configuration looks though: >> >> All of my Org-Mode LP configuration is in here: >> >> https://github.com/grettke/help/blob/master/Org-Mode_Fundamentals.org >> >> Here are some values that come to mind though: >> >> - Global header-args sets comments to "noweb" >> - This whole section >> https://github.com/grettke/help/blob/master/Org-Mode_Fundamentals.org#id= entity >> - (require 'org-id) >> - (setq org-id-link-to-org-use-id 'nil) >> >> That makes it so that the comment links to the file, not to the id or >> custom_id. Yes, I find it confusing and I only figured this out a >> couple nights ago. However, this makes detangle work. >> >> Let me know how it goes and check out my config. >> >> Sincerely, >> >> Grant Rettke >> >> >> On Tue, Aug 30, 2016 at 5:38 PM, Andrea Giugliano w= rote: >>> Hello, >>> >>> yup, that would be the ideal solution, but at the moment my >>> org-babel-tangle does not use the ID in the comments! It uses a (not >>> working) string. >>> Do you mean that I can force to reference in the comment to be an ID?? >>> Thanks, >>> >>> Andrea >>> >>> Grant Rettke writes: >>> >>>> On Tue, Aug 30, 2016 at 12:25 PM, Andrea Giugliano wrote: >>>>> I think that the ideal solution is to allow an user to make >>>>> org-babel-detangle rely on header IDs, since this not only assures >>>>> detangle to find the correct header every time, but also push the use= r >>>>> to use IDs through org-id (that seems good practice). >>>>> What do you think? >>>> >>>> Yes you should set a ID on every Headline and source-block >>>> automatically using org-id so that detangling always works. >>>> >>>> When you want a custom ID it is easily changed. >>>