emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* 6.29c export latex bug?
@ 2009-08-10 21:26 zwz
  2009-08-10 21:53 ` zwz
  2009-08-11  0:21 ` Nick Dokos
  0 siblings, 2 replies; 6+ messages in thread
From: zwz @ 2009-08-10 21:26 UTC (permalink / raw)
  To: emacs-orgmode

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=us-ascii, Size: 4679 bytes --]

Here is the content of my org file:
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> * Test                                >
>   |     | A | B |                     >
>   |-----+---+---|                     >
>   | com | 1 | 2 |                     >
>   | org | 3 | 4 |                     >
>                                       >
>   Some math formulae:                 >
>                                       >
>   y = x_1^2 + x_2^2                   >
>                                       >
>   y^2 = 2x^2 + 1                      >
>                                       >
>   z_2 = x_1 + x_2 + 2 (y_1 + y_2 + r) >
> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >

Then I press C-c C-e l, I get the debug back-trace:

Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
  replace-regexp-in-string("||" "|" nil)
  org-export-latex-tables(t)
  org-export-latex-content(#("\n  |     | A | B |\n  |-----+---+---|\n  | com | 1 | 2 |\n  | org | 3 | 4 |\n\n  Some math formulae:\n\n  y = x_1^2 + x_2^2\n\n  y^2 = 2x^2 + 1\n\n  z_2 = x_1 + x_2 + 2 (y_1 + y_2 + r)\n\n\n" 0 1 (fontified nil) 1 3 (fontified nil org-caption nil org-attributes nil org-label nil) 3 5 (fontified nil org-caption nil org-attributes nil org-label nil) 5 6 (fontified nil hilit-chg hilit-chg org-caption nil org-attributes nil org-label nil) 6 7 (fontified nil hilit-chg hilit-chg org-caption nil org-attributes nil org-label nil) 7 8 (fontified nil hilit-chg hilit-chg org-caption nil org-attributes nil org-label nil) 8 9 (fontified nil hilit-chg hilit-chg org-caption nil org-attributes nil org-label nil) 9 10 (fontified nil hilit-chg hilit-chg org-caption nil org-attributes nil org-label nil) 10 18 (fontified nil org-caption nil org-attributes nil org-label nil) 18 19 (fontified nil) 19 21 (fontified nil) 21 36 (fontified nil) 36 37 (fontified nil) 37 39 (fontified nil org-caption nil org-attributes nil org-label nil) 39 54 (fontified nil org-caption nil org-attributes nil org-label nil) 54 55 (fontified nil) 55 57 (fontified nil org-caption nil org-attributes nil org-label nil) 57 72 (fontified nil org-caption nil org-attributes nil org-label nil) 72 117 (fontified nil) 117 174 (fontified nil) 174 175 (fontified nil) 175 176 (fontified nil)))
  org-export-latex-subcontent(((pos . 2) (level . 1) (occur . 1) (heading . #(" Test " 1 2 ... 2 5 ...)) (content . #("\n  |     | A | B |\n  |-----+---+---|\n  | com | 1 | 2 |\n  | org | 3 | 4 |\n\n  Some math formulae:\n\n  y = x_1^2 + x_2^2\n\n  y^2 = 2x^2 + 1\n\n  z_2 = x_1 + x_2 + 2 (y_1 + y_2 + r)\n\n\n" 0 1 ... 1 3 ... 3 5 ... 5 6 ... 6 7 ... 7 8 ... 8 9 ... 9 10 ... 10 18 ... 18 19 ... 19 21 ... 21 36 ... 36 37 ... 37 39 ... 39 54 ... 54 55 ... 55 57 ... 57 72 ... 72 117 ... 117 174 ... 174 175 ... 175 176 ...)) (subcontent)) t)
  #[(x) "Â\b	\"‡" [x num org-export-latex-subcontent] 3](((pos . 2) (level . 1) (occur . 1) (heading . #(" Test " 1 2 ... 2 5 ...)) (content . #("\n  |     | A | B |\n  |-----+---+---|\n  | com | 1 | 2 |\n  | org | 3 | 4 |\n\n  Some math formulae:\n\n  y = x_1^2 + x_2^2\n\n  y^2 = 2x^2 + 1\n\n  z_2 = x_1 + x_2 + 2 (y_1 + y_2 + r)\n\n\n" 0 1 ... 1 3 ... 3 5 ... 5 6 ... 6 7 ... 7 8 ... 8 9 ... 9 10 ... 10 18 ... 18 19 ... 19 21 ... 21 36 ... 36 37 ... 37 39 ... 39 54 ... 54 55 ... 55 57 ... 57 72 ... 72 117 ... 117 174 ... 174 175 ... 175 176 ...)) (subcontent)))
  mapc(#[(x) "Â\b	\"‡" [x num org-export-latex-subcontent] 3] (((pos . 2) (level . 1) (occur . 1) (heading . #(" Test " 1 2 ... 2 5 ...)) (content . #("\n  |     | A | B |\n  |-----+---+---|\n  | com | 1 | 2 |\n  | org | 3 | 4 |\n\n  Some math formulae:\n\n  y = x_1^2 + x_2^2\n\n  y^2 = 2x^2 + 1\n\n  z_2 = x_1 + x_2 + 2 (y_1 + y_2 + r)\n\n\n" 0 1 ... 1 3 ... 3 5 ... 5 6 ... 6 7 ... 7 8 ... 8 9 ... 9 10 ... 10 18 ... 18 19 ... 19 21 ... 21 36 ... 36 37 ... 37 39 ... 39 54 ... 54 55 ... 55 57 ... 57 72 ... 72 117 ... 117 174 ... 174 175 ... 175 176 ...)) (subcontent))))
  org-export-latex-sub((((pos . 2) (level . 1) (occur . 1) (heading . #(" Test " 1 2 ... 2 5 ...)) (content . #("\n  |     | A | B |\n  |-----+---+---|\n  | com | 1 | 2 |\n  | org | 3 | 4 |\n\n  Some math formulae:\n\n  y = x_1^2 + x_2^2\n\n  y^2 = 2x^2 + 1\n\n  z_2 = x_1 + x_2 + 2 (y_1 + y_2 + r)\n\n\n" 0 1 ... 1 3 ... 3 5 ... 5 6 ... 6 7 ... 7 8 ... 8 9 ... 9 10 ... 10 18 ... 18 19 ... 19 21 ... 21 36 ... 36 37 ... 37 39 ... 39 54 ... 54 55 ... 55 57 ... 57 72 ... 72 117 ... 117 174 ... 174 175 ... 175 176 ...)) (subcontent))))
  org-export-latex-global((((... ... ... ... ... ...))))
  org-export-as-latex(nil)
  call-interactively(org-export-as-latex)
  org-export(nil)
  call-interactively(org-export nil nil)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 6.29c export latex bug?
  2009-08-10 21:26 6.29c export latex bug? zwz
@ 2009-08-10 21:53 ` zwz
  2009-08-11  0:21 ` Nick Dokos
  1 sibling, 0 replies; 6+ messages in thread
From: zwz @ 2009-08-10 21:53 UTC (permalink / raw)
  To: emacs-orgmode

And as far as I have tested, I found that when there's a bland line or a
headline right before the table, this error pops.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 6.29c export latex bug?
  2009-08-10 21:26 6.29c export latex bug? zwz
  2009-08-10 21:53 ` zwz
@ 2009-08-11  0:21 ` Nick Dokos
  2009-08-11  3:26   ` Nick Dokos
  1 sibling, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2009-08-11  0:21 UTC (permalink / raw)
  To: zwz; +Cc: emacs-orgmode

zwz <zhangweize@gmail.com> wrote:

> Here is the content of my org file:
> > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> > * Test                                >
> >   |     | A | B |                     >
> >   |-----+---+---|                     >
> >   | com | 1 | 2 |                     >
> >   | org | 3 | 4 |                     >
> >                                       >
> >   Some math formulae:                 >
> >                                       >
> >   y =3D x_1^2 + x_2^2                   >
> >                                       >
> >   y^2 =3D 2x^2 + 1                      >
> >                                       >
> >   z_2 =3D x_1 + x_2 + 2 (y_1 + y_2 + r) >
> > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >
> 
> Then I press C-c C-e l, I get the debug back-trace:
> 
> Debugger entered--Lisp error: (wrong-type-argument arrayp nil)
>   replace-regexp-in-string("||" "|" nil)
>   org-export-latex-tables(t)
> 

I can reproduce this. I also tried with a different table and I can
verify zwz's subsequent finding that a non-empty, non-headline line
above the table fixes it. I looked at the org-export-latex-tables
code, but since I couldn't come up with something obvious, I did
a git bisect and got this:

31ceed47ffd3070418dd34316fef8869d2434c26 is first bad commit
commit 31ceed47ffd3070418dd34316fef8869d2434c26
Author: Carsten Dominik <carsten.dominik@gmail.com>
Date:   Tue Jun 30 07:24:57 2009 +0200

    New minor mode org-indent-mode
    
    This mode implements outline indentation similar to clean view, but in
    a dynamic and virtual way, at display time.

HTH,
Nick

PS. Note that org-indent-mode is *not* enabled. I get an error when I try
to enable it, but that's another story.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 6.29c export latex bug?
  2009-08-11  0:21 ` Nick Dokos
@ 2009-08-11  3:26   ` Nick Dokos
  2009-08-11  7:47     ` Carsten Dominik
  0 siblings, 1 reply; 6+ messages in thread
From: Nick Dokos @ 2009-08-11  3:26 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, zwz

Nick Dokos <nicholas.dokos@hp.com> wrote:


> 31ceed47ffd3070418dd34316fef8869d2434c26 is first bad commit
> commit 31ceed47ffd3070418dd34316fef8869d2434c26
> Author: Carsten Dominik <carsten.dominik@gmail.com>
> Date:   Tue Jun 30 07:24:57 2009 +0200
> 
>     New minor mode org-indent-mode
>     
>     This mode implements outline indentation similar to clean view, but in
>     a dynamic and virtual way, at display time.
> 

I looked over the commit and saw this change to org-table.el:

    ...
    (if (equal (char-before) ?\n)
        ;; This hack is for org-indent, to force redisplay of the
        ;; line prefix of the first line. Apparently the redisplay
        ;; is tied to the newline, which is, I think, a bug.
        ;; To force this redisplay, we remove and re-insert the
        ;; newline, so that the redisplay engine thinks it belongs
        ;; to the changed text.
        (progn
          (backward-delete-char 1)
          (insert "\n")))
    ...

I commented it out and the export of the table worked - but I have no
idea why.

Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 6.29c export latex bug?
  2009-08-11  3:26   ` Nick Dokos
@ 2009-08-11  7:47     ` Carsten Dominik
  2009-08-11 12:54       ` Nick Dokos
  0 siblings, 1 reply; 6+ messages in thread
From: Carsten Dominik @ 2009-08-11  7:47 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode, zwz



On Aug 11, 2009, at 5:26 AM, Nick Dokos wrote:

> Nick Dokos <nicholas.dokos@hp.com> wrote:
>
>
>> 31ceed47ffd3070418dd34316fef8869d2434c26 is first bad commit
>> commit 31ceed47ffd3070418dd34316fef8869d2434c26
>> Author: Carsten Dominik <carsten.dominik@gmail.com>
>> Date:   Tue Jun 30 07:24:57 2009 +0200
>>
>>    New minor mode org-indent-mode
>>
>>    This mode implements outline indentation similar to clean view,  
>> but in
>>    a dynamic and virtual way, at display time.
>>
>
> I looked over the commit and saw this change to org-table.el:
>
>    ...
>    (if (equal (char-before) ?\n)
>        ;; This hack is for org-indent, to force redisplay of the
>        ;; line prefix of the first line. Apparently the redisplay
>        ;; is tied to the newline, which is, I think, a bug.
>        ;; To force this redisplay, we remove and re-insert the
>        ;; newline, so that the redisplay engine thinks it belongs
>        ;; to the changed text.
>        (progn
>          (backward-delete-char 1)
>          (insert "\n")))
>    ...
>
> I commented it out and the export of the table worked - but I have no
> idea why.

Hi zwz, thanks for the report.
Hi Nick, thanks for nailing it.

This bug is fixed now.

Nick, if you are interested, please see the commit log entry for an
explanation why this bug was happening.

- Carsten


>
> 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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 6.29c export latex bug?
  2009-08-11  7:47     ` Carsten Dominik
@ 2009-08-11 12:54       ` Nick Dokos
  0 siblings, 0 replies; 6+ messages in thread
From: Nick Dokos @ 2009-08-11 12:54 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: emacs-orgmode, zwz

Carsten Dominik <carsten.dominik@gmail.com> wrote:

> Hi zwz, thanks for the report.
> Hi Nick, thanks for nailing it.
> 
> This bug is fixed now.
> 

Indeed - my test succeeded.

> Nick, if you are interested, please see the commit log entry for an
> explanation why this bug was happening.
> 

I feel like a ping-pong ball :-), smacked from one place in the code
to another and back again. Thanks for the explanation!

Nick

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-08-11 12:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-10 21:26 6.29c export latex bug? zwz
2009-08-10 21:53 ` zwz
2009-08-11  0:21 ` Nick Dokos
2009-08-11  3:26   ` Nick Dokos
2009-08-11  7:47     ` Carsten Dominik
2009-08-11 12:54       ` Nick Dokos

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).