From: andrew dasys <adasys@objectivity.ca>
To: nicholas.dokos@hp.com
Cc: emacs-orgmode@gnu.org
Subject: Re: Tables and Latex "Wrong-number-of-arguments" error
Date: Mon, 9 Mar 2009 19:23:35 -0400 [thread overview]
Message-ID: <8aca08a00903091623o63eb296cjb9ff20338f6054d5@mail.gmail.com> (raw)
In-Reply-To: <11073.1236637352@alphaville.usa.hp.com>
[-- Attachment #1.1: Type: text/plain, Size: 7901 bytes --]
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.dokos@hp.com> wrote:
> andrew dasys <adasys@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}
> `----
>
[-- Attachment #1.2: Type: text/html, Size: 8744 bytes --]
[-- Attachment #2: split-string.txt --]
[-- Type: text/plain, Size: 621 bytes --]
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.
[-- Attachment #3: Type: text/plain, Size: 204 bytes --]
_______________________________________________
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
next prev parent reply other threads:[~2009-03-09 23:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 18:48 Tables and Latex "Wrong-number-of-arguments" error andrew dasys
2009-03-05 14:28 ` Carsten Dominik
2009-03-09 20:15 ` andrew dasys
2009-03-09 22:22 ` Nick Dokos
2009-03-09 22:42 ` latex exporting strangeness [was: Re: Tables and Latex "Wrong-number-of-arguments" error] Nick Dokos
2009-03-09 23:38 ` andrew dasys
2009-03-10 2:01 ` Nick Dokos
2009-03-09 23:23 ` andrew dasys [this message]
2009-03-10 1:58 ` Tables and Latex "Wrong-number-of-arguments" error Nick Dokos
2009-03-10 2:12 ` Nick Dokos
2009-03-10 5:36 ` Carsten Dominik
2009-03-10 13:12 ` andrew dasys
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=8aca08a00903091623o63eb296cjb9ff20338f6054d5@mail.gmail.com \
--to=adasys@objectivity.ca \
--cc=emacs-orgmode@gnu.org \
--cc=nicholas.dokos@hp.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.