emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
@ 2020-12-17 21:12 Nick Dokos
  2020-12-20 17:15 ` Bastien
  2020-12-22 11:45 ` Nicolas Goaziou
  0 siblings, 2 replies; 9+ messages in thread
From: Nick Dokos @ 2020-12-17 21:12 UTC (permalink / raw)
  To: emacs-orgmode


Consider an Org mode file with a table.el table (which I made by
first constructing an Org mode table and then usind `C-c ~' to convert it):


--8<---------------cut here---------------start------------->8---
* table.el table


  +----+----+----+
  |  a |  b |  c |
  +----+----+----+
  |  1 |  2 |  3 |
  +----+----+----+
  |  4 |  5 |  6 |
  +----+----+----+
  |  7 |  8 |  9 |
  +----+----+----+
  | 10 | 11 | 12 |
  +----+----+----+
--8<---------------cut here---------------end--------------->8---

Trying to export to LaTeX produces pretty mangled output.

It turns out that when in
 `org-latex-table', (org-element-property :type table) returns `org', so
 it thinks it's an Org mode table and calls `org-latex--org-table' to
 process it, producing output like this:

--8<---------------cut here---------------start------------->8---
\sout{----}----\sout{----}
\begin{center}
\begin{tabular}{lll}
a & b & c\\
\end{tabular}
\end{center}
\sout{----}----\sout{----}
\begin{center}
\begin{tabular}{rrr}
1 & 2 & 3\\
\end{tabular}
\end{center}
\sout{----}----\sout{----}

...

\begin{center}
\begin{tabular}{rrr}
10 & 11 & 12\\
\end{tabular}
\end{center}
\sout{----}----\sout{----}
--8<---------------cut here---------------end--------------->8---


Evaluating `(org-element-at-point)' returns `(paragraph ...)' all along
the top line and `(table (.... :type org ....))' when the cursor is at
the beginning of the `a b c' line.


Emacs  : GNU Emacs 28.0.50 (build 3, x86_64-pc-linux-gnu, GTK+ Version 3.24.13, cairo version 1.16.0)
 of 2020-10-30
Package: Org mode version 9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)

-- 
Nick




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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-17 21:12 Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)] Nick Dokos
@ 2020-12-20 17:15 ` Bastien
  2020-12-21  7:49   ` Jean Louis
                     ` (2 more replies)
  2020-12-22 11:45 ` Nicolas Goaziou
  1 sibling, 3 replies; 9+ messages in thread
From: Bastien @ 2020-12-20 17:15 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hi Nick,

Nick Dokos <ndokos@gmail.com> writes:

> Consider an Org mode file with a table.el table (which I made by
> first constructing an Org mode table and then usind `C-c ~' to
> convert it):

Would it be so bad if org-mode decides to stop supporting table.el tables? 

I don't see the benefit of supporting both Org tables and tables.el tables,
and it calls for confusion.

What do you and everyone else think?

-- 
 Bastien


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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-20 17:15 ` Bastien
@ 2020-12-21  7:49   ` Jean Louis
  2020-12-21  9:12     ` Bastien
  2020-12-21 21:10   ` Nick Dokos
  2020-12-22 14:55   ` Nick Dokos
  2 siblings, 1 reply; 9+ messages in thread
From: Jean Louis @ 2020-12-21  7:49 UTC (permalink / raw)
  To: Bastien; +Cc: Nick Dokos, emacs-orgmode

* Bastien <bzg@gnu.org> [2020-12-20 20:16]:
> Hi Nick,
> 
> Nick Dokos <ndokos@gmail.com> writes:
> 
> > Consider an Org mode file with a table.el table (which I made by
> > first constructing an Org mode table and then usind `C-c ~' to
> > convert it):
> 
> Would it be so bad if org-mode decides to stop supporting table.el tables? 
> 
> I don't see the benefit of supporting both Org tables and tables.el tables,
> and it calls for confusion.
> 
> What do you and everyone else think?

Clarify confusions in the manual and don't break habits and
established features of Org.


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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-21  7:49   ` Jean Louis
@ 2020-12-21  9:12     ` Bastien
  0 siblings, 0 replies; 9+ messages in thread
From: Bastien @ 2020-12-21  9:12 UTC (permalink / raw)
  To: Jean Louis; +Cc: Nick Dokos, emacs-orgmode

Hi Jean,

Jean Louis <bugs@gnu.support> writes:

> Clarify confusions in the manual and don't break habits and
> established features of Org.

This is not really helpful because it is too general.

Can you make specific suggestions or provide patches for what
needs to be addressed?

Also, your message sounded harsh.  If it is intentional, it is
harmful.  If it isn't, please make an effort of sending nicer
messages.

Thanks,

-- 
 Bastien


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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-20 17:15 ` Bastien
  2020-12-21  7:49   ` Jean Louis
@ 2020-12-21 21:10   ` Nick Dokos
  2020-12-22  5:04     ` Tom Gillespie
  2020-12-22 14:55   ` Nick Dokos
  2 siblings, 1 reply; 9+ messages in thread
From: Nick Dokos @ 2020-12-21 21:10 UTC (permalink / raw)
  To: emacs-orgmode

Hi Bastien,

Bastien <bzg@gnu.org> writes:

> Would it be so bad if org-mode decides to stop supporting table.el tables? 
>

I don't use table.el tables so it's easy for me to say "Get rid of them" - but
there may be objections :-)

> I don't see the benefit of supporting both Org tables and tables.el tables,
> and it calls for confusion.
>
> What do you and everyone else think?

They do exist in a sort of twilight zone: not many people use them
AFAICT, but there is ostensible support and the manual says "Org mode
recognizes such tables and exports them properly", but the bug I sent
shows that that's not correct.

So: fix this bug now that it's been pointed out? Close it as "Will not
fix" with some guidance on what the user is supposed to do ("don't use
table.el tables" is probably the best advice)? Or decide to jettison
table.el support altogether? The first and the last involve real work,
the middle one not, but it's not particularly tasty.

Somebody else will have to make the decision: I'm fine with either of
the exreme ways, not so much with the middle option, but since I'm not
going to do the work, I am in no position to insist.

BTW, I ran into this while looking into this Emacs SE question:

https://emacs.stackexchange.com/questions/62335/org-mode-export-table-to-latex-with-word-wrap

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-21 21:10   ` Nick Dokos
@ 2020-12-22  5:04     ` Tom Gillespie
  0 siblings, 0 replies; 9+ messages in thread
From: Tom Gillespie @ 2020-12-22  5:04 UTC (permalink / raw)
  To: emacs-orgmode

A few years ago I was trying to format tables in a certain specific
way and it was essentially impossible with org tables for reasons that
now escape me. However, it was possible to accomplish it using
tabels.el tables. I don't think I ended up actually using the
tables.el solution, but at the time it would have been the only
option. If memory serves I think it had to do with multiline cells or
something of that nature. While it would be nice to be able to
converge on a single implementation for tables, I suspect that there
are still users of tabels.el that would be left out in the cold if
that functionality was removed. It would be great if we could find
some examples of org files or users that use the tabels.el
functionality so we can understand what org tables are missing. Best,
Tom


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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-17 21:12 Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)] Nick Dokos
  2020-12-20 17:15 ` Bastien
@ 2020-12-22 11:45 ` Nicolas Goaziou
  2021-01-04 21:26   ` Nick Dokos
  1 sibling, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2020-12-22 11:45 UTC (permalink / raw)
  To: Nick Dokos; +Cc: emacs-orgmode

Hello,

Nick Dokos <ndokos@gmail.com> writes:

> Consider an Org mode file with a table.el table (which I made by
> first constructing an Org mode table and then usind `C-c ~' to convert it):
>
> --8<---------------cut here---------------start------------->8---
> * table.el table
>
>
>   +----+----+----+
>   |  a |  b |  c |
>   +----+----+----+
>   |  1 |  2 |  3 |
>   +----+----+----+
>   |  4 |  5 |  6 |
>   +----+----+----+
>   |  7 |  8 |  9 |
>   +----+----+----+
>   | 10 | 11 | 12 |
>   +----+----+----+
> --8<---------------cut here---------------end--------------->8---

[...]

> Evaluating `(org-element-at-point)' returns `(paragraph ...)' all along
> the top line and `(table (.... :type org ....))' when the cursor is at
> the beginning of the `a b c' line.

Fixed. Thank you.

Regards,
-- 
Nicolas Goaziou


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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-20 17:15 ` Bastien
  2020-12-21  7:49   ` Jean Louis
  2020-12-21 21:10   ` Nick Dokos
@ 2020-12-22 14:55   ` Nick Dokos
  2 siblings, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2020-12-22 14:55 UTC (permalink / raw)
  To: emacs-orgmode

Bastien <bzg@gnu.org> writes:

> Hi Nick,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
>> Consider an Org mode file with a table.el table (which I made by
>> first constructing an Org mode table and then usind `C-c ~' to
>> convert it):
>
> Would it be so bad if org-mode decides to stop supporting table.el tables? 
>
> I don't see the benefit of supporting both Org tables and tables.el tables,
> and it calls for confusion.
>
> What do you and everyone else think?

I don't use table.el tables. The only reason I submitted the bug
report was because I was trying to investigate this Emacs SE question:

   https://emacs.stackexchange.com/questions/62335/org-mode-export-table-to-latex-with-word-wrap

In the process, I discovered that the LaTeX file was broken and traced
it back to org-element. Note that the manual says:

"Org mode recognizes such tables and exports them properly."

See

   (info "(org) Cooperation") 

So there are three roads ahead as I see it:

- Fix the bug in org-element and make sure that table.el tables are
  exported properly.

- Do not fix the bug. Instead, tear out table.el support from Org mode
  code and fix the manual to say so.

- Do not fix the bug (and do nothing else).

I presume the third choice is distasteful to everybody, but that's
going to be the default choice unless somebody volunteers to do either
of the other two.

Either of the first two choices requires work. From my POV, it does
not matter which of the two is done: if somebody volunteers to do
either, I am not going to object (and I suspect, almost nobody else
will either: if the second course is chosen, there may be some table.el
users who would object to losing it, but if so, they should volunteer
to fix the bug).

My 0.02 kopek.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



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

* Re: Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)]
  2020-12-22 11:45 ` Nicolas Goaziou
@ 2021-01-04 21:26   ` Nick Dokos
  0 siblings, 0 replies; 9+ messages in thread
From: Nick Dokos @ 2021-01-04 21:26 UTC (permalink / raw)
  To: emacs-orgmode

Nicolas Goaziou <mail@nicolasgoaziou.fr> writes:

> Hello,
>
> Nick Dokos <ndokos@gmail.com> writes:
>
> [...]
>
>> Evaluating `(org-element-at-point)' returns `(paragraph ...)' all along
>> the top line and `(table (.... :type org ....))' when the cursor is at
>> the beginning of the `a b c' line.
>
> Fixed. Thank you.
>

Thank you!

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler



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

end of thread, other threads:[~2021-01-04 21:27 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-17 21:12 Bug: org-element does not recognize table.el tables [9.4 (release_9.4-53-g23f941 @ /home/nick/elisp/org-mode/lisp/)] Nick Dokos
2020-12-20 17:15 ` Bastien
2020-12-21  7:49   ` Jean Louis
2020-12-21  9:12     ` Bastien
2020-12-21 21:10   ` Nick Dokos
2020-12-22  5:04     ` Tom Gillespie
2020-12-22 14:55   ` Nick Dokos
2020-12-22 11:45 ` Nicolas Goaziou
2021-01-04 21:26   ` Nick Dokos

Code repositories for project(s) associated with this public 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).