emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jambunathan K <kjambunathan@gmail.com>
To: Nicolas Goaziou <n.goaziou@gmail.com>
Cc: Achim Gratz <Stromeko@nexgo.de>, emacs-orgmode@gnu.org
Subject: Re: new exporter
Date: Sat, 14 Jul 2012 23:17:52 +0530	[thread overview]
Message-ID: <811ukejktz.fsf@gmail.com> (raw)
In-Reply-To: <81bojijnkk.fsf@gmail.com> (Jambunathan K.'s message of "Sat, 14 Jul 2012 22:18:43 +0530")

Jambunathan K <kjambunathan@gmail.com> writes:

> Nicolas Goaziou <n.goaziou@gmail.com> writes:
>
>> Hello,
>>
>> Achim Gratz <Stromeko@nexgo.de> writes:
>>
>>> Yes, that has been my impression as well.  Again, I can make them go
>>> away by removing one of the byte-compiled files, so I rather suspect
>>> another case of a macro expansion that's not quite what was intented.
>>> Only this time I really don't see from the backtrace what that would
>>> be.
>>
>> It looks like table-cells have a wrong `:parent' property when
>> org-element.el is byte-compiled.  In `org-element-table-cell-parser',
>> replacing backquote with `list' solves the problem.
>
>
>> This is related to modifications by side-effect of list elements, but
>> I don't know why it only happens when the file is byte-compiled and why
>> it only focus table cells.
>
> There is an interesting  "pitfall" mentioned wrt `nconc' under:
>    (info "(elisp) Rearrangement").
>
> I try to make sense of the pitfall by conjuring up this argument.  This
> seems right to me.
> - `list' will dynamically allocate the list at runtime.  It comes from
>   C's heap.
>
> - A quote list is allocated at compile time (atleast the constant
>   bits). It comes from memory that is allocated for global variables -
>   externs or static externs.  Think value of list is the pointer to an
>   extern C variable.
>
> I am not sure what backquote does.
>
> Wrt above problem, you may want to verify the following:
> 1. It works right the first time.  But subsequent invocations create
>    side-effect.
> 2. Focus on what happens to the `head' of the list.

Do table-cell gets "composed" in a special way wrt other elements.

> I am more or less facing similar problems wrt element translation.  I am
> holding off any checkin mainly because I see some undesirable
> side-effects.

I dont't have handle on it yet.  May be it is just a coincidence that
the translation involves lists and tables.

ps: If only there way to see the C pointers underlying the objects one
could actually sensibly see what is happening underneath.

The closest I have come to doing so is to use a combination of
`pp-display-expression' with (setq print-circle t).  This latter part
was added to my .emacs only in the last 2 days in an effort to bring out
the differnce between `eq' and `equal'.

For example a table like this

| 1 | 2 |
| a | b |

gets rendered as below.  Track the :parent properties, the Ns and #es
and you have no ambiguity on what objects they point to.

#1=(org-data nil #2=(section
		     (:begin 2 :end 22 :contents-begin 2 :contents-end 22 :post-blank 0 :parent #1#)
		     #3=(table
			 (:begin 2 :end 22 :type org :tblfm nil :contents-begin 2 :contents-end 22 :value nil :post-blank 0 :parent #2#)
			 #4=(table-row
			     (:type standard :begin 2 :end 12 :contents-begin 3 :contents-end 11 :post-blank 0 :parent #3#)
			     (table-cell
			      (:begin 3 :end 7 :contents-begin 4 :contents-end 5 :post-blank 0 :parent #4#)
			      "1")
			     (table-cell
			      (:begin 7 :end 11 :contents-begin 8 :contents-end 9 :post-blank 0 :parent #4#)
			      "2"))
			 #5=(table-row
			     (:type standard :begin 12 :end 22 :contents-begin 13 :contents-end 21 :post-blank 0 :parent #3#)
			     (table-cell
			      (:begin 13 :end 17 :contents-begin 14 :contents-end 15 :post-blank 0 :parent #5#)
			      "a")
			     (table-cell
			      (:begin 17 :end 21 :contents-begin 18 :contents-end 19 :post-blank 0 :parent #5#)
			      "b")))))

  reply	other threads:[~2012-07-14 17:48 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-02 10:46 Bug: Images in Latex [7.8.11 (release_7.8.11-33-g2d71a5 @ /Users/petr/Dropbox/emacs/elisp/org-mode/lisp/)] Petr Samarin
2012-06-02 13:23 ` Jambunathan K
2012-06-02 17:16   ` new exporter (was: Bug: Images in Latex..) Achim Gratz
2012-06-03 13:21     ` new exporter Jambunathan K
2012-06-04 20:23     ` Achim Gratz
2012-06-07 19:44     ` Nicolas Goaziou
2012-06-07 19:59       ` Achim Gratz
2012-06-07 20:24         ` Nicolas Goaziou
2012-06-09 18:48           ` Achim Gratz
2012-06-09 18:56             ` Nicolas Goaziou
2012-06-09 19:06               ` Achim Gratz
2012-06-09 19:45                 ` Nicolas Goaziou
2012-06-09 21:19                   ` Achim Gratz
2012-06-07 20:14       ` Achim Gratz
2012-06-26  5:39         ` Achim Gratz
2012-06-26  6:18           ` Achim Gratz
2012-06-26 14:53             ` Nicolas Goaziou
2012-06-26 16:14               ` Achim Gratz
2012-06-26 18:43               ` Achim Gratz
2012-06-27 20:05                 ` Achim Gratz
2012-06-28  7:03                   ` Nicolas Goaziou
2012-06-29 18:17                     ` Achim Gratz
2012-06-30  6:48                       ` Nicolas Goaziou
2012-06-30  7:12                         ` Achim Gratz
2012-07-01 16:33                         ` Achim Gratz
2012-07-02 10:19                           ` Nicolas Goaziou
2012-07-02 19:06                             ` Achim Gratz
2012-07-12 18:37                         ` Achim Gratz
2012-07-13 14:46                           ` Nicolas Goaziou
2012-07-13 18:32                             ` Achim Gratz
2012-07-14 16:20                               ` Nicolas Goaziou
2012-07-14 16:31                                 ` Achim Gratz
2012-07-14 16:48                                 ` Jambunathan K
2012-07-14 17:47                                   ` Jambunathan K [this message]
2012-07-15 12:02                                 ` Achim Gratz
2012-07-15 19:50                                   ` Nicolas Goaziou
2012-07-15 20:08                                     ` Bastien
2012-07-15 20:18                                     ` Achim Gratz
2012-07-16  8:46                                       ` Nicolas Goaziou
2012-07-16 18:11                                         ` Achim Gratz
2012-07-16 21:11                                           ` Nicolas Goaziou
2012-07-17 17:35                                             ` Achim Gratz
2012-07-17 20:59                                               ` Nicolas Goaziou
2012-07-18  9:38                                                 ` Nicolas Goaziou
2012-07-18 18:57                                                   ` Achim Gratz
2012-07-18 18:09                                                 ` Achim Gratz
2012-07-16 18:35                                         ` local.mk vs. default.mk (was: new exporter) Achim Gratz
  -- strict thread matches above, loose matches on Subject: below --
2012-09-30 11:41 new exporter itmejl
2012-09-30 12:36 ` Nicolas Goaziou
2012-10-11 12:34 New exporter Sebastien Vauban
2012-10-11 14:07 ` Yagnesh Raghava Yakkala
2012-10-12  7:33   ` Sebastien Vauban
2012-10-11 19:37 ` Nicolas Goaziou
2012-10-12  7:34   ` Sebastien Vauban
2012-10-12 11:09     ` Sebastien Vauban
2012-10-12 11:27       ` Sebastien Vauban

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=811ukejktz.fsf@gmail.com \
    --to=kjambunathan@gmail.com \
    --cc=Stromeko@nexgo.de \
    --cc=emacs-orgmode@gnu.org \
    --cc=n.goaziou@gmail.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 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).