emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [babel] Tiny "problems"
Date: Fri, 18 Dec 2009 10:12:44 +0100	[thread overview]
Message-ID: <87pr6cabn7.fsf@mundaneum.com> (raw)
In-Reply-To: m2k4wlcve1.fsf@gmail.com

Hi Eric,

"Eric Schulte" wrote:
>> Sébastien Vauban <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org> writes:
>>>
>>> In fact, a better specification is: copy whatever (any character) is in
>>> front of `<<<code here>>>' in front of every line of the referenced block
>>> (same amount of characters, be it spaces or something else).
>>>
>>> That way, a commented SQL source block like the following would be
>>> correctly outputted:
>>>
>>>     -- -- set flag
>>>     -- UPDATE dossier
>>>     -- SET DossierSentToSector = @now
>>>     -- WHERE ID
>>>     --     IN (SELECT actID_fk
>>>     --         FROM actions
>>>     --         WHERE (actID = 338 AND actEtat = 3))
>>>     --     AND F1SignDate < @firstDayOfThisMonth
>>>     --     AND DossierSentToSector IS NULL
>>>     --     AND
>>>     --     <<ConditionForSector>>
>>>
>>> Currently, the first line of the "condition" block is commented, the
>>> others not, resulting in incorrect code being tangled.
>>>
>>> With the above "spec", I guess all cases are covered. What do you think?
>>
>> I like it a lot, I'll add this to the TODO.  Thanks -- Eric
>
> I just pushed up a commit which should implement your idea mentioned below.
>
> Please try it out and let me know if it doesn't work as expected.

Simply perfect!

The only impact is that we cannot expect a multi-line block to be correctly
exported in the following case:

--8<---------------cut here---------------start------------->8---
-- set flag
UPDATE dossier
SET DossierSentToSector = @now
WHERE ID
    IN (SELECT actID_fk
        FROM actions
        WHERE (actID = 338 AND actEtat = 3))
    AND F1SignDate < @firstDayOfThisMonth
    AND DossierSentToSector IS NULL
    AND <<ConditionForSector>>
--8<---------------cut here---------------end--------------->8---

Because `AND' would be copied in front of every line, which may not be OK.
But, for me, that's both perfectly comprehensible and perfectly acceptable.

Would the source block be mono-line, the above must perfectly work.

Do we agree on this?

Thank you very much, anyway, for this very nice fix, which fixes the above
problem of commented block, and the indentation one... 2 flies with 1 stone.

Best regards,
  Seb

-- 
Sébastien Vauban



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2009-12-18  9:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-02 13:17 [babel] Tiny "problems" Sébastien Vauban
2009-12-05  5:24 ` Eric Schulte
2009-12-05 17:57   ` Dan Davison
2009-12-07 10:10     ` Sébastien Vauban
2009-12-07 10:07   ` Sébastien Vauban
2009-12-16 21:17     ` Eric Schulte
2009-12-17  9:05       ` Sébastien Vauban
2009-12-17 14:24         ` Sébastien Vauban
2009-12-17 16:58           ` Eric Schulte
2009-12-17 18:23             ` Eric Schulte
2009-12-18  9:12               ` Sébastien Vauban [this message]
2009-12-18 18:48                 ` Eric Schulte

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87pr6cabn7.fsf@mundaneum.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).