Nick,
thank you for looking at this.
I am running Emacs 21.4.1 Nothing bleeding edge here.
The help for split-string looks reasonable (compiled Lisp comes from "subr"
....) (complete output attached)
A bit of debugging gets me to the point where split-string works fine if you
only include the text that is in the table so from
"|id ..... Hoolihan |\n"
if you add any of the other text starting at:
0 2 nil 2 4 (org-label nil org....
then I get the error.
On Mon, Mar 9, 2009 at 6:22 PM, Nick Dokos <nicholas.do...@hp.com> wrote:
> andrew dasys <ada...@objectivity.ca> wrote:
>
> >
> > * MASH
> > | id | Actor | Character |
> > |----+---------------+---------------------------|
> > | 1 | Allan Alda | "Hawkeye" Benjamin Pierce |
> > | 2 | Gary Burghoff | "Radar" Walter O'Reilly |
> > | 3 | Loretta Switt | "Hotlips" Margaret Hoolihan |
> >
> > ....[export to latex gets error]....
>
> I cannot reproduce this - the export succeeds (but see below). Version
> info:
>
> GNU Emacs 23.0.91.1 (i686-pc-linux-gnu, GTK+ Version 2.12.9) of 2009-03-06
> on alphaville.usa.hp.com
> Org-mode version 6.24
>
> >
> > Debugger entered--Lisp error: (wrong-number-of-arguments #[(string
> &optional separators) " † ÆÇȉ É
> > ƒ& ǔUƒ&
> GWƒ& T‚' #ƒY ǔ
> GWƒY Ê Ç”Ç=„S ǔǕ=ƒK ǔ =„S
> ǔO B Ǖ ‚
> G=„g
> ÈO B Ÿ,‡" [separators list notfirst start rexp string "[
> >
> ]+" 0 nil string-match t] 5 1390318] 3)
> > split-string(#("| id | Actor | Character
> |\n|----+---------------+-------------------------------|\n| 1 | Allan Alda
> | ``Hawkeye'' Benjamin Pierce |\n| 2 | Gary Burghoff | ``Radar''
> Walter O'Reilly |\n| 3 | Loretta Switt | ``Hotlips'' Margaret Hoolihan
> |\n" 0 2 nil 2 4 (org-label nil org-attributes nil org-caption nil fontified
> nil) 4 7 nil 7 12 (org-label nil org-attributes nil org-caption nil
> fontified nil) 12 23 nil 23 32 (org-label nil org-attributes nil org-caption
> nil fontified nil) 32 113 nil 113 114 (org-label nil org-attributes nil
> org-caption nil fontified nil) 114 117 nil 117 127 (org-label nil
> org-attributes nil org-caption nil fontified nil) 127 133 nil 133 135
> (org-protected t) 135 141 (org-label nil org-attributes nil org-caption nil
> fontified nil) 141 142 (org-protected t fontified nil org-caption nil
> org-attributes nil org-label nil) 142 144 (org-protected t) 144 160
> (org-label nil org-attributes nil org-caption nil fontified nil) 160 168 nil
> 168 169 (org-label nil org-attributes nil org-caption nil fontified nil) 169
> 172 nil 172 185 (org-label nil org-attributes nil org-caption nil fontified
> nil) 185 188 nil 188 190 (org-protected t) 190 194 (org-label nil
> org-attributes nil org-caption nil fontified nil) 194 195 (org-protected t
> fontified nil org-caption nil org-attributes nil org-label nil) 195 197
> (org-protected t) 197 213 (org-label nil org-attributes nil org-caption nil
> fontified nil) 213 223 nil 223 224 (org-label nil org-attributes nil
> org-caption nil fontified nil) 224 227 nil 227 240 (org-label nil
> org-attributes nil org-caption nil fontified nil) 240 243 nil 243 245
> (org-protected t) 245 251 (org-label nil org-attributes nil org-caption nil
> fontified nil) 251 252 (org-protected t fontified nil org-caption nil
> org-attributes nil org-label nil) 252 254 (org-protected t) 254 272
> (org-label nil org-attributes nil org-caption nil fontified nil) 272 275
> nil) "\n" t)
> > (setq lines (split-string raw-table "\n" t))
>
> ... and this looks very strange to me: split-string is similar to AWK's or
> Python's
> split() function, which is supposed to split a string using the given
> separator,
> and return a list of substrings. The argument to split-string is correct
> (the raw table
> as a string), as is the separator ("\n"). So where does split-string get
> the ungodly
> mess shown above? Is it possible that you have redefined split-string
> somehow? Or perhaps
> some matching function that split-string uses?
> What happens if you evaluate the following (just press C-x C-e after the
> closing paren or cut-and-paste the expression into the *scratch* buffer
> and press C-j)? What happens if you restart your emacs with -Q and
> evaluate the same expression? In my setup, I can evaluate the following
> with no errors:
>
> (split-string #("| id | Actor | Character
> |\n|----+---------------+-------------------------------|\n| 1 | Allan Alda
> | ``Hawkeye'' Benjamin Pierce |\n| 2 | Gary Burghoff | ``Radar''
> Walter O'Reilly |\n| 3 | Loretta Switt | ``Hotlips'' Margaret Hoolihan
> |\n" 0 2 nil 2 4 (org-label nil org-attributes nil org-caption nil fontified
> nil) 4 7 nil 7 12 (org-label nil org-attributes nil org-caption nil
> fontified nil) 12 23 nil 23 32 (org-label nil org-attributes nil org-caption
> nil fontified nil) 32 113 nil 113 114 (org-label nil org-attributes nil
> org-caption nil fontified nil) 114 117 nil 117 127 (org-label nil
> org-attributes nil org-caption nil fontified nil) 127 133 nil 133 135
> (org-protected t) 135 141 (org-label nil org-attributes nil org-caption nil
> fontified nil) 141 142 (org-protected t fontified nil org-caption nil
> org-attributes nil org-label nil) 142 144 (org-protected t) 144 160
> (org-label nil org-attributes nil org-caption nil fontified nil) 160 168 nil
> 168 169 (org-label nil org-attributes nil org-caption nil fontified nil) 169
> 172 nil 172 185 (org-label nil org-attributes nil org-caption nil fontified
> nil) 185 188 nil 188 190 (org-protected t) 190 194 (org-label nil
> org-attributes nil org-caption nil fontified nil) 194 195 (org-protected t
> fontified nil org-caption nil org-attributes nil org-label nil) 195 197
> (org-protected t) 197 213 (org-label nil org-attributes nil org-caption nil
> fontified nil) 213 223 nil 223 224 (org-label nil org-attributes nil
> org-caption nil fontified nil) 224 227 nil 227 240 (org-label nil
> org-attributes nil org-caption nil fontified nil) 240 243 nil 243 245
> (org-protected t) 245 251 (org-label nil org-attributes nil org-caption nil
> fontified nil) 251 252 (org-protected t fontified nil org-caption nil
> org-attributes nil org-label nil) 252 254 (org-protected t) 254 272
> (org-label nil org-attributes nil org-caption nil fontified nil) 272 275
> nil) "\n" t)
>
> What version of emacs are you running? Also, can you do C-h f split-string
> RET
> and tell us what that says?
>
>
>
> ---------------------------------------------------------------------------
>
> I said above that the export succeeds and it does, in the sense that I
> get no errors. However, the exported latex looks strange - the table
> comes *before* the "MASH" section. Is this a bug or is it a peculiarity
> of my configuration? Can somebody please try it and let me know?
>
> Thanks,
> Nick
>
>
> ,----
> | % Created 2009-03-09 Mon 17:34
> | \documentclass[11pt]{article}
> | \usepackage[utf8]{inputenc}
> | \usepackage[T1]{fontenc}
> | \usepackage{graphicx}
> | \usepackage{longtable}
> | \usepackage{hyperref}
> |
> |
> | \title{andrew-dasys}
> | \author{Nick Dokos}
> | \date{09 March 2009}
> |
> | \begin{document}
> |
> | \maketitle
> |
> | \setcounter{tocdepth}{3}
> | \tableofcontents
> | \vspace*{1cm}
> |
> | \begin{center}
> | \begin{tabular}{rll}
> | id & Actor & Character \\
> | \hline
> | 1 & Allan Alda & ``Hawkeye'' Benjamin Pierce \\
> | 2 & Gary Burghoff & ``Radar'' Walter O'Reilly \\
> | 3 & Loretta Switt & ``Hotlips'' Margaret Hoolihan \\
> | \end{tabular}
> | \end{center}
> |
> |
> | \section{MASH}
> | \label{sec-1}
> |
> |
> |
> | \end{document}
> `----
>
split-string is a compiled Lisp function in `subr'.
(split-string STRING &optional SEPARATORS)
Splits STRING into substrings where there are matches for SEPARATORS.
Each match for SEPARATORS is a splitting point.
The substrings between the splitting points are made into a list
which is returned.
If SEPARATORS is absent, it defaults to "[ \f\t\n\r\v]+".
If there is match for SEPARATORS at the beginning of STRING, we do not
include a null substring for that. Likewise, if there is a match
at the end of STRING, we don't include a null substring for that.
Modifies the match data; use `save-match-data' if necessary.
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode