emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] Specified colnames


From: Sebastien Vauban
Subject: Re: [O] [babel] Specified colnames
Date: Mon, 08 Apr 2013 22:49:37 +0200
User-agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.2.91 (windows-nt)

Eric,

Eric Schulte wrote:
>> Extra question: tested with a sh block, both of the above do work, that is
>> with strings or symbols. Which one is supposed to be better (that is, will be
>> more portable with time), if there is one?
>
> Both will be maintained.  The contribution of a test exercising both
> options could provide an extra guarantee of perseverance.  This is also
> a good first step towards editing the code. :)

Here's my trial to do so.

--8<---------------cut here---------------start------------->8---
(ert-deftest test-ob/specific-column-names-symbols ()
  "Test passing specific column names as a list of symbols."
  (should
   (equal "#+name: input-table
| id | var1 |
|----+------|
|  1 | bar  |
|  2 | baz  |

#+begin_src sh :var data=input-table :exports results :colnames '(Rev Author)
echo \"$data\"
#+end_src

#+results:
| Rev | Author |
|-----+--------|
|   1 | bar    |
|   2 | baz    |

"
          (org-test-with-temp-text "#+name: input-table
| id | var1 |
|----+------|
|  1 | bar  |
|  2 | baz  |

#+begin_src sh :var data=input-table :exports results :colnames '(Rev Author)
echo \"$data\"
#+end_src
"
                                   (org-babel-execute-src-block)
                                   (buffer-string)))))
--8<---------------cut here---------------end--------------->8---

Does this correspond to what you're asking for?

However, running it did not succeed. I must do something wrong, or NOT do
something good...

  ╭────
  │ Selector: t
  │ Passed: 0
  │ Failed: 0
  │ Total:  0/1
  │ 
  │ Started at:   2013-04-08 22:45:19+0200
  │ Aborted.
  │ Aborted at:   2013-04-08 22:45:19+0200
  │ 
  │ A
  │ 
  │ A test-ob/specific-column-names-symbols
  │     Test passing specific column names as a list of symbols.
  │     aborted
  ╰────

The worse is that I don't get a backtrace, even after:

- setting debug-on-error to t, or
- M-x'ing toggle-debug-on-error.

Weird, but not the first time -- seems related to Emacs 24.2 or so (+ my
config?).

Best regards,
  Seb

-- 
Sebastien Vauban




reply via email to

[Prev in Thread] Current Thread [Next in Thread]