all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Eric Schulte" <schulte.eric@gmail.com>
To: Seth Burleigh <wburle4@gmail.com>
Cc: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>, emacs-orgmode@gnu.org
Subject: Re: Re: [babel] Painless integration of source blocks with language
Date: Wed, 19 Jan 2011 00:28:10 -0700	[thread overview]
Message-ID: <87oc7dic8k.fsf@gmail.com> (raw)
In-Reply-To: <AANLkTimDaNc8hZUQUe-aEG3v-CvFJk6WKK8hV-Os0UcC@mail.gmail.com> (Seth Burleigh's message of "Tue, 18 Jan 2011 12:38:38 -0600")

Hi Seth,

You are correct, while the tangling works, the detangling still needs to
be updated to take into account the fact that there may now be nested
sections of tangled code -- which it doesn't currently.  Hopefully this
wont be too large of a code change...

Seth Burleigh <wburle4@gmail.com> writes:

> ok, so im not sure how you got it working, but heres the problem in
> the code (i think).
>
> We start with the tangled output
> --------------------------------------
> ;; [[file:~/Desktop/test.org][/home/seth/Desktop/test\.org:2]]
>
> (let ((x 1))
>   (message "x=%s" x)
>   ;; [[file:~/Desktop/test.org][wrappable]]
>   (setq x (+ 4 x))
>   ;; wrappable ends here
>   (message "x=%s" x))
> ;;>> before org-babel-detangle calls org-babel-tangle-jump-to-org, it
> is at this point
> ;; /home/seth/Desktop/test\.org:2 ends here
> --------------------------------------
>
> The code jumps to the point marked above (notice any comment with ;;>>
> is just my markup)
> So, lets go to the relevant portion of org-babel-tangle-jump-to-org.
>
> --------------------------------------
> (defun org-babel-tangle-jump-to-org ()
>   "Jump from a tangled code file to the related Org-mode file."
>   (interactive)
>   (let ((mid (point))
> 	start end done
>         target-buffer target-char link path block-name body)
>     (save-window-excursion
>       (save-excursion
> 	(while (and (re-search-backward org-bracket-link-analytic-regexp nil t)
> 		    (not ; ever wider searches until matching block comments
> 		     (and (setq start (point-at-eol))
> 			  (setq link (match-string 0))
> 			  (setq path (match-string 3))
> 			  (setq block-name (match-string 5))
> 			  (save-excursion
> 			    (save-match-data
> 			      (re-search-forward
> 			       (concat " " (regexp-quote block-name)
> 				       " ends here") nil t)
> 			      (setq end (point-at-bol))))))))
> 	;;(message "start %s mid %s end %s" start mid end)
> 	(unless (and start (< start mid) (< mid end))
> 	  (error (format "not in tangled code %s %s %s " start mid end)))
> ---------------------------------------
>
>
> notice that mid is set to the point commented previously. Then it
> searches backward for org-bracket-link-analytic-regexp , and it finds
> ;; [[file:~/Desktop/test.org][wrappable]]. Then it searches forward
> and matches ;; wrappable ends here. So, start and end encompass the
> inner block, but the mid point is in the outside block. Therefore, it
> fails with the error message
>
> (unless (and start (< start mid) (< mid end))
> 	  (error (format "not in tangled code %s %s %s " start mid end)))
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2011-01-19  7:28 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-08 22:29 [babel] Painless integration of source blocks with language Seth Burleigh
2011-01-09  1:54 ` Eric Schulte
2011-01-09  9:40   ` Štěpán Němec
2011-01-09 17:59     ` Eric Schulte
2011-01-10  0:59       ` Seth Burleigh
2011-01-10  2:13         ` Eric Schulte
2011-01-10  3:49           ` Seth Burleigh
2011-01-10  4:01             ` Seth Burleigh
2011-01-11 17:00             ` Eric Schulte
2011-01-10 18:46   ` Eric S Fraga
2011-01-11 17:12     ` Eric Schulte
     [not found]       ` <AANLkTi=dNTn6HBeR4wV7039FDDyPGtmWbmL0biFwT-ta@mail.gmail.com>
2011-01-11 23:09         ` Seth Burleigh
2011-01-13  9:11       ` Eric S Fraga
2011-01-13 15:23         ` Seth Burleigh
2011-01-13 21:23           ` Eric Schulte
2011-01-13 23:44             ` Seth Burleigh
2011-01-16 15:31               ` Eric Schulte
2011-01-17  9:29                 ` Sébastien Vauban
2011-01-17 16:18                   ` Eric Schulte
2011-01-17 19:32                     ` Sébastien Vauban
2011-01-17 22:15                 ` Seth Burleigh
2011-01-17 22:44                   ` Sébastien Vauban
2011-01-18 18:11                     ` Seth Burleigh
2011-01-18 18:14                     ` Seth Burleigh
2011-01-18 18:38                       ` Seth Burleigh
2011-01-19  7:28                         ` Eric Schulte [this message]
2011-01-24 14:49                           ` Seth Burleigh
2011-01-18 19:53                       ` Bastien
2011-01-24 11:56         ` Dan Davison
2011-01-24 18:56           ` Eric S Fraga
2011-01-26 10:43           ` Sébastien Vauban

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87oc7dic8k.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wburle4@gmail.com \
    --cc=wxhgmqzgwmuf@spammotel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.