[Top][All Lists]

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

Re: [Orgmode] Tables and Latex "Wrong-number-of-arguments" error

From: andrew dasys
Subject: Re: [Orgmode] Tables and Latex "Wrong-number-of-arguments" error
Date: Tue, 10 Mar 2009 09:12:20 -0400

thank you for figuring this out.
Will upgrade as suggested.

Again thank you both for the great application.


On Tue, Mar 10, 2009 at 1:36 AM, Carsten Dominik <address@hidden> wrote:
Fix, thanks, in particular to Nick for sorting this out.

Andrew, I strongly suggest you upgrade to Emacs 22.

- Carsten

On Mar 10, 2009, at 3:12 AM, Nick Dokos wrote:

[I mangled the previous response, so let me try again.]

andrew dasys <address@hidden> wrote:

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)


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.

I think that explains it: split-string takes one mandatory and two
optional arguments (separator regexp and an omit-nulls boolean) in
emacs-22/23; but only *one* optional argument in emacs-21 (the separator
arg). The org latex-exporting code calls it with two optional arguments
and that makes the emacs-21 implementation of split-string blow up.

I just did an experiment: in my emacs-23, I called split-string
with one mandatory and *three* more arguments:

(split-string "foo
baz" "\n" t t)

and I got output which looks very similar to what you are getting.

So I think it's an incompatibility with emacs-21. Try the following
patch for now and let us know whether it resolves your problem:

diff --git a/lisp/org-export-latex.el b/lisp/org-export-latex.el
index 0c0c87f..e8ef6d5 100644
--- a/lisp/org-export-latex.el
+++ b/lisp/org-export-latex.el
@@ -1111,7 +1111,10 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
                          (string-match "\\<align=\\([^ \t\n\r,]+\\)" attr)
                          (match-string 1 attr))
               floatp (or caption label))
-         (setq lines (split-string raw-table "\n" t))
+         (setq lines
+                (if (< emacs-major-version 22)
+                    (split-string raw-table "\n")
+                  (split-string raw-table "\n" t)))
         (apply 'delete-region (list beg end))
         (when org-export-table-remove-special-lines
           (setq lines (org-table-clean-before-export lines 'maybe-quoted)))


Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.

reply via email to

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