From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: New exporter and dates in tables Date: Wed, 10 Apr 2013 15:12:24 +0200 Message-ID: References: <87fvz1opiz.fsf@norang.ca> <8761zxwlvn.fsf@gmail.com> <87bo9pntym.fsf@norang.ca> <0604BF00-1FE8-4EAA-A346-C125A5127CAD@gmail.com> <877gkcvm3n.fsf@gmail.com> <173ADFE7-A1FB-4ECB-A78A-C99662A8030F@gmail.com> <87fvyysghk.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([208.118.235.92]:52363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPupA-0000f8-Ax for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 09:12:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPup8-0000r4-Kj for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 09:12:28 -0400 Received: from ezel.ic.uva.nl ([146.50.108.158]:33284) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPup8-0000qp-C9 for emacs-orgmode@gnu.org; Wed, 10 Apr 2013 09:12:26 -0400 In-Reply-To: <87fvyysghk.fsf@gmail.com> 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: Nicolas Goaziou Cc: Bernt Hansen , emacs-orgmode@gnu.org This looks good to me - with my limited understanding of the exporter = lingo. Thanks! - Carsten On 10 apr. 2013, at 14:43, Nicolas Goaziou wrote: > Hello, >=20 > Carsten Dominik writes: >=20 >> Some people throw in time stamps often while they work, just >> as a little label, indicating that they were working on this >> at a specific date, or that the entry was created on a specific >> date. Many people I know have a hook that throws in such a >> time stamp in each new entry created. This creates a lot of >> clutter when you print it, which is why you can turn off >> export of timestamps. >>=20 >> That option was not meant for a contextual line like your >> first example. If you use the time stamps in this way, you >> probably will not turn off timestamp export at all, you >> will just leave it on. If you mix both ways of using >> time stamps - well, too bad. >>=20 >> Tabular data is different because you certainly wanted >> that data in the table, so removing it will be confusing. >>=20 >>> Anyway, there's still another thing to ponder. Since everything in >>> a table is data, what happens with "tex:nil" (LaTeX snippets)? = Should >>> this option also be ignored within a table? If not, how can we = explain >>> the difference with "<:nil"? >>=20 >> Tex macros are different. This is an internal way of >> inserting special characters, and that syntax may get into >> your way in some specific projects. Just like the fact >> that _ creates a subscript. If you have to write text >> with lots of _ but you never mean a subscript, this can >> be really annoying. So you can turn off subscripts as you >> can turn off interpretation of tex macros, as a convenience >> if the syntax gets in your way. Then it should be turned >> off anywhere, table or not. >=20 > Fair enough. The following patch should do as decided in this thread. >=20 > WDYT? >=20 >=20 > Regards, >=20 > --=20 > Nicolas Goaziou > =46rom a2b4ef1ad24cbd816491122d0e969fecc6739377 Mon Sep 17 00:00:00 = 2001 > From: Nicolas Goaziou > Date: Wed, 10 Apr 2013 14:38:13 +0200 > Subject: [PATCH] ox: Don't skip timestamps within tables >=20 > * lisp/ox.el (org-export--skip-p): Never skip a timestamp within > a table. > (org-export-with-timestamps): Update docstring accordingly. > * testing/lisp/test-ox.el: Add test. > --- > lisp/ox.el | 32 +++++++++++++++++++------------- > testing/lisp/test-ox.el | 7 ++++++- > 2 files changed, 25 insertions(+), 14 deletions(-) >=20 > diff --git a/lisp/ox.el b/lisp/ox.el > index 7f33755..a9667d9 100644 > --- a/lisp/ox.el > +++ b/lisp/ox.el > @@ -721,6 +721,9 @@ It can be set to `active', `inactive', t or nil, = in order to > export, respectively, only active timestamps, only inactive ones, > all of them or none. >=20 > +This variable has no effect on timestamps within tables, which > +will always be exported. > + > This option can also be set with the OPTIONS keyword, e.g. > \"<:nil\"." > :group 'org-export-general > @@ -2013,19 +2016,22 @@ a tree with a select tag." > (not (org-export-get-previous-element blob options)))) > (table-row (org-export-table-row-is-special-p blob options)) > (timestamp > - (case (plist-get options :with-timestamps) > - ;; No timestamp allowed. > - ('nil t) > - ;; Only active timestamps allowed and the current one isn't > - ;; active. > - (active > - (not (memq (org-element-property :type blob) > - '(active active-range)))) > - ;; Only inactive timestamps allowed and the current one isn't > - ;; inactive. > - (inactive > - (not (memq (org-element-property :type blob) > - '(inactive inactive-range)))))))) > + ;; Timestamps in tables are not affected by `:with-timestamps'. > + (unless (eq (org-element-type (org-export-get-parent-element = blob)) > + 'table-row) > + (case (plist-get options :with-timestamps) > + ;; No timestamp allowed. > + ('nil t) > + ;; Only active timestamps allowed and the current one isn't > + ;; active. > + (active > + (not (memq (org-element-property :type blob) > + '(active active-range)))) > + ;; Only inactive timestamps allowed and the current one isn't > + ;; inactive. > + (inactive > + (not (memq (org-element-property :type blob) > + '(inactive inactive-range))))))))) >=20 >=20 > ;;; The Transcoder > diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el > index 6203f8b..0900037 100644 > --- a/testing/lisp/test-ox.el > +++ b/testing/lisp/test-ox.el > @@ -408,7 +408,12 @@ Paragraph" > "<2012-04-29 sun. 10:45>\n")) > (should > (equal (org-export-as 'test nil nil nil '(:with-timestamps = inactive)) > - "[2012-04-29 sun. 10:45]\n"))))) > + "[2012-04-29 sun. 10:45]\n")))) > + (should > + (equal "| [2012-03-29 Thu] |\n" > + (org-test-with-temp-text "| [2012-03-29 Thu] |" > + (org-test-with-backend test > + (org-export-as 'test nil nil nil '(:with-timestamps = nil))))))) >=20 > (ert-deftest test-org-export/comment-tree () > "Test if export process ignores commented trees." > --=20 > 1.8.2.1 >=20