From mboxrd@z Thu Jan 1 00:00:00 1970 From: andrew dasys Subject: Re: Tables and Latex "Wrong-number-of-arguments" error Date: Tue, 10 Mar 2009 09:12:20 -0400 Message-ID: <8aca08a00903100612t36fc20f7s4c1288bdfdaeadab@mail.gmail.com> References: <8aca08a00903041048g7318ec54v904b984a50daf4c7@mail.gmail.com> <30B609E1-98D5-4A78-9A20-FCB803263DC7@uva.nl> <8aca08a00903091315r12623c88r3c50f2ef6c7aa8bf@mail.gmail.com> <11073.1236637352@alphaville.usa.hp.com> <8aca08a00903091623o63eb296cjb9ff20338f6054d5@mail.gmail.com> <8613.1236651162@gamaville.dokosmarshall.org> <431894A1-EE74-4F12-BDB0-965C8DC6E4A2@uva.nl> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1339983548==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lh1kv-0008Vu-93 for emacs-orgmode@gnu.org; Tue, 10 Mar 2009 09:12:25 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lh1ks-0008Sn-5z for emacs-orgmode@gnu.org; Tue, 10 Mar 2009 09:12:24 -0400 Received: from [199.232.76.173] (port=59295 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lh1ks-0008Sb-1b for emacs-orgmode@gnu.org; Tue, 10 Mar 2009 09:12:22 -0400 Received: from mail-gx0-f160.google.com ([209.85.217.160]:65058) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lh1kr-0004MQ-Hn for emacs-orgmode@gnu.org; Tue, 10 Mar 2009 09:12:21 -0400 Received: by gxk4 with SMTP id 4so3300012gxk.18 for ; Tue, 10 Mar 2009 06:12:21 -0700 (PDT) In-Reply-To: <431894A1-EE74-4F12-BDB0-965C8DC6E4A2@uva.nl> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode@gnu.org --===============1339983548== Content-Type: multipart/alternative; boundary=00504502c8e648cc180464c380f3 --00504502c8e648cc180464c380f3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Nick, thank you for figuring this out. Will upgrade as suggested. Again thank you both for the great application. Andrew On Tue, Mar 10, 2009 at 1:36 AM, Carsten Dominik 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 wrote: >> >> 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) >>> >>> .... >> >>> >>> 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 >> bar >> 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 "\\> 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))) >> >> Nick >> >> >> _______________________________________________ >> 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 >> > > --00504502c8e648cc180464c380f3 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Nick,
thank you for figuring this out.
Will upgrade as suggested. <= br>
Again thank you both for the great application.

Andrew
On Tue, Mar 10, 2009 at 1:36 AM, Carsten Domini= k <dominik@s= cience.uva.nl> wrote:
Fix, thanks, in p= articular 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 <adasys@objectivity.ca> wrote:

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 =A0(compiled Lisp comes from &qu= ot;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. =A0Likewise, 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
bar
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 an= d STRING-AFTER."
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (string-match "\\= <align=3D\\([^ \t\n\r,]+\\)" attr)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (match-string 1 attr))=
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0floatp (or caption label))
- =A0 =A0 =A0 =A0 (setq lines (split-string raw-table "\n" t)) + =A0 =A0 =A0 =A0 (setq lines
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(if (< emacs-major-version 22)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(split-string raw-table "\n&q= uot;)
+ =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(split-string raw-table "\n"= t)))
=A0 =A0 =A0 =A0 =A0(apply 'delete-region (list beg end))
=A0 =A0 =A0 =A0 =A0(when org-export-table-remove-special-lines
=A0 =A0 =A0 =A0 =A0 =A0(setq lines (org-table-clean-before-export lines &#= 39;maybe-quoted)))

Nick


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gn= u.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


--00504502c8e648cc180464c380f3-- --===============1339983548== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ 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 --===============1339983548==--