From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: How to include comments on export? org-exp-blocks.el? Date: Tue, 25 Oct 2011 10:02:18 +0530 Message-ID: <811uu16699.fsf@gmail.com> References: <14553.1319496752@alphaville.americas.hpqcorp.net> <8162jd6bab.fsf@gmail.com> <5935.1319513592@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:52991) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIYgo-0008IT-Nb for emacs-orgmode@gnu.org; Tue, 25 Oct 2011 00:32:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RIYgn-00046d-Hg for emacs-orgmode@gnu.org; Tue, 25 Oct 2011 00:32:38 -0400 Received: from mail-pz0-f47.google.com ([209.85.210.47]:43047) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RIYgn-00046Y-As for emacs-orgmode@gnu.org; Tue, 25 Oct 2011 00:32:37 -0400 Received: by pzd13 with SMTP id 13so335200pzd.6 for ; Mon, 24 Oct 2011 21:32:36 -0700 (PDT) In-Reply-To: <5935.1319513592@alphaville.dokosmarshall.org> (Nick Dokos's message of "Mon, 24 Oct 2011 23:33:12 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org, Herbert Sitz >> I think the comment blocks are better handled as special blocks instead >> of org-exp-blocks. > That may very well be true. If only - ,---- From org-export-preprocess-string | ;; Call the hook | (run-hooks 'org-export-preprocess-hook) | | ;; Remove comment environment and comment subtrees | (org-export-remove-comment-blocks-and-subtrees) | | ;; Blockquotes, verse, and center | (org-export-mark-blockquote-verse-center) | (run-hooks 'org-export-preprocess-after-blockquote-hook) `---- Before it hits the blockquote hook the comment block gets removed. Now there is a reason why the hook is hooking up to org-export-preprocess-hook. While complaining of plethora of hooks, I was mainly complaining from this standpoint. This example also illustrates my frustration as an implementer well. Apart from other things, there is this - Oh! yet another hook that I need to take care of and cater to in org-odt.el. Also software behaviour is counter-intuitive. This prevents one from asserting a mental model with any confidence without diving in to the code. >> ps: I think number of blocks and hooks in Org reflect number of people >> that worked on it :-) >> -- >> > > Well, I don't mind a plethora of hooks: they enable things that wouldn't > be possible otherwise (and they are even documented and easily findable > because of uniform naming: either the M-x org--hook trick which works > because of the uniform naming [fn:1] or the Worg (?) page that Carsten > pointed to some time ago[fn:2]). org-exp.el is a sequential assembly line. If one rearranges logic in it even a bit - with no regard to the hook boundaries for example - the whole export process goes for a toss. And when you name a hook afterblockquote hook you can't move it before the blockquote can you? > As for org-exp-blocks, two out of the three areas of its application, as > discussed in the commentary, are deprecated: only comment remains. But > contrary to your (tongue-in-cheek) remark, Eric Schulte seems to be > single-handedly responsible for all of the block stuff :-) I do see some aspects of current day babel in the deprecated blocks. May be Carsten and various users from the distant past had a hand in various "standard but useful" hooks like verse, quote, center, comments etc. > Nick > > Footnotes: > > [fn:1] Note to future maintainers: don't ever name a hook anything other than > org-foo-bar-hook or else :-) > > [fn:2] I prefer the first to the second because I can do it right in emacs: no > need to go look up URLs and use inferior tools. > > --