From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Rettke Subject: Re: org-detangle seems broken Date: Tue, 5 Jun 2018 18:19:35 -0500 Message-ID: References: <87wovhmr0v.fsf@nicolasgoaziou.fr> <87o9gp7dwb.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60954) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fQLEp-00047x-FJ for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 19:19:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fQLEo-0003b5-Kk for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 19:19:39 -0400 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:43415) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fQLEo-0003aC-Bu for emacs-orgmode@gnu.org; Tue, 05 Jun 2018 19:19:38 -0400 Received: by mail-lf0-x234.google.com with SMTP id n15-v6so6166507lfn.10 for ; Tue, 05 Jun 2018 16:19:38 -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: Frederick Giasson Cc: Org-mode , Nicolas Goaziou On Tue, Jun 5, 2018 at 7:18 AM, Frederick Giasson wrote: > There is one last thing related to =org-babel-detangle= that seems "broken" > is that as far as I can see, the top =save-excursion= should save the > position of the cursor of the source file and keep the buffer at that > position when we perform a detangling on it, no? > > Right now, the behavior is that when we do a detangle from a source file, > the org file get opened in the buffer of the source file. > > However, I think that the right behavior is that when we detangle that the > remain at the same position in the source file otherwise this gets confusing > in my opinion. > > Is that a bug or the expected behavior? 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)) 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 So now I like it.