emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Eric Schulte <schulte.eric@gmail.com>
To: Sebastien Vauban <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [babel] Some variables with no default value don't provoke an error
Date: Thu, 15 Sep 2011 09:26:39 -0600	[thread overview]
Message-ID: <87r53hhkff.fsf@gmail.com> (raw)
In-Reply-To: 80r53jlciw.fsf@somewhere.org

"Sebastien Vauban" <wxhgmqzgwmuf@spammotel.com> writes:

> Hi Eric,
>
> As said previously, I've been forced to add a default value to many code
> blocks I had in my local LOB, which I ingest in my `.emacs' file:
>
> #+begin_src emacs-lisp
>  (when (try-require 'ob-lob)
>    (org-babel-lob-ingest "~/emacs/site-lisp/my-local-lob.org"))
> #+end_src
>
> Weirdly enough, in the following code block, I must add a default value for
> vars `table', `column' and `type' but not for the var `nullability'.
>
> I've even been able to add fake vars `something' and `else' with no error
> being reported (at ingestion time):
>
> #+srcname: add-column-in-table(table="", column="", something, type="", else, nullability)
> #+begin_src sql
> -- add column `$column' (if column does not exist yet)
> IF NOT EXISTS (SELECT *
>                FROM INFORMATION_SCHEMA.COLUMNS
>                WHERE TABLE_NAME = '$table'
>                AND COLUMN_NAME = '$column')
> BEGIN
>     ALTER TABLE $table
>     ADD $column $type $nullability
> END
> #+end_src
>
> Note that, in the above state, the code block is ingested with no error, but,
> if I remove the default value of var `table', it then generates back an
> error...
>

I've just pushed up a check for these functional-syntax variables which
will ensure that each is given a default value.  Since this check takes
place at the location of the code block it /does/ include the name of
the code block in the error message.

Cheers -- Eric

>
> Best regards,
>   Seb

-- 
Eric Schulte
http://cs.unm.edu/~eschulte/

  reply	other threads:[~2011-09-15 15:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-14  9:05 [babel] Some variables with no default value don't provoke an error Sebastien Vauban
2011-09-15 15:26 ` Eric Schulte [this message]
2011-09-16  9:42   ` Sebastien Vauban
2011-09-16 14:07     ` Eric Schulte
2011-09-16 19:54       ` Sebastien 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

  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=87r53hhkff.fsf@gmail.com \
    --to=schulte.eric@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --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 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).