From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Florian Beck <fb@miszellen.de>, Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: [RFC] About `org-export-with-\(fixed-width\|tables\)'
Date: Sun, 05 Jan 2014 01:18:33 +0100 [thread overview]
Message-ID: <87mwjbmgbq.fsf@gmail.com> (raw)
In-Reply-To: <87bnztcdkf.fsf@bzg.ath.cx> (Bastien's message of "Fri, 03 Jan 2014 16:03:44 +0100")
[-- Attachment #1: Type: text/plain, Size: 346 bytes --]
Hello,
Bastien <bzg@gnu.org> writes:
> Florian Beck <fb@miszellen.de> writes:
>
>>> I don't think option 2 is really useful, but I don't mind either way.
>>
>> Actually, I would find it useful (because I sometimes export my notes as
>> an ebook and tables get garbled on the way).
>
> +1.
Patch attached. WDYT?
Regards,
--
Nicolas Goaziou
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-ox-Change-meaning-of-org-export-with-table-fixed-wid.patch --]
[-- Type: text/x-diff, Size: 5133 bytes --]
From ddc02dddeff02b9e339a1a78e66ab706697032c2 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
Date: Sun, 5 Jan 2014 01:13:54 +0100
Subject: [PATCH] ox: Change meaning of `org-export-with-\(table\|fixed-width\)
* lisp/ox.el (org-export-with-fixed-width, org-export-with-tables):
Change docstring to reflect new meaning.
(org-export--skip-p): Completely ignore tables and fixed-width areas
if appropriate option is nil.
* testing/lisp/test-ox.el (test-org-export/handle-options): Add tests.
---
lisp/ox.el | 30 ++++++++++--------------------
testing/lisp/test-ox.el | 24 +++++++++++++++++++++++-
2 files changed, 33 insertions(+), 21 deletions(-)
diff --git a/lisp/ox.el b/lisp/ox.el
index d26d0c1..c2ff063 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -457,19 +457,12 @@ This option can also be set with the EXCLUDE_TAGS keyword."
:type '(repeat (string :tag "Tag")))
(defcustom org-export-with-fixed-width t
- "Non-nil means lines starting with \":\" will be in fixed width font.
-
-This can be used to have pre-formatted text, fragments of code
-etc. For example:
- : ;; Some Lisp examples
- : (while (defc cnt)
- : (ding))
-will be looking just like this in also HTML. See also the QUOTE
-keyword. Not all export backends support this.
-
+ "Non-nil means export lines starting with \":\".
This option can also be set with the OPTIONS keyword,
e.g. \"::nil\"."
:group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type 'boolean)
(defcustom org-export-with-footnotes t
@@ -703,16 +696,12 @@ e.g. \"toc:nil\" or \"toc:3\"."
(integer :tag "TOC to level")))
(defcustom org-export-with-tables t
- "If non-nil, lines starting with \"|\" define a table.
-For example:
-
- | Name | Address | Birthday |
- |-------------+----------+-----------|
- | Arthur Dent | England | 29.2.2100 |
-
+ "Non-nil means export tables.
This option can also be set with the OPTIONS keyword,
e.g. \"|:nil\"."
:group 'org-export-general
+ :version "24.4"
+ :package-version '(Org . "8.0")
:type 'boolean)
(defcustom org-export-with-tags t
@@ -1440,7 +1429,7 @@ The back-end could then be called with, for example:
;; - category :: option
;; - type :: symbol (nil, t)
;;
-;; + `:with-fixed-width' :: Non-nil if transcoder should interpret
+;; + `:with-fixed-width' :: Non-nil if transcoder should export
;; strings starting with a colon as a fixed-with (verbatim) area.
;; - category :: option
;; - type :: symbol (nil, t)
@@ -1482,8 +1471,7 @@ The back-end could then be called with, for example:
;; - category :: option
;; - type :: symbol (nil, {}, t)
;;
-;; + `:with-tables' :: Non-nil means transcoding should interpret
-;; tables.
+;; + `:with-tables' :: Non-nil means transcoding should export tables.
;; - category :: option
;; - type :: symbol (nil, t)
;;
@@ -2091,6 +2079,7 @@ a tree with a select tag."
(if (eq (car with-drawers-p) 'not)
(member-ignore-case name (cdr with-drawers-p))
(not (member-ignore-case name with-drawers-p))))))))
+ (fixed-width (not (plist-get options :with-fixed-width)))
((footnote-definition footnote-reference)
(not (plist-get options :with-footnotes)))
((headline inlinetask)
@@ -2128,6 +2117,7 @@ a tree with a select tag."
(planning (not (plist-get options :with-planning)))
(property-drawer (not (plist-get options :with-properties)))
(statistics-cookie (not (plist-get options :with-statistics-cookies)))
+ (table (not (plist-get options :with-tables)))
(table-cell
(and (org-export-table-has-special-column-p
(org-export-get-parent-table blob))
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index 0b148e0..78347af 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -430,6 +430,17 @@ Paragraph"
(org-test-with-temp-text ":FOO:\nkeep\n:END:\n:BAR:\nremove\n:END:"
(org-export-as (org-test-default-backend)
nil nil nil '(:with-drawers (not "BAR"))))))
+ ;; Fixed-width.
+ (should
+ (equal ": A\n"
+ (org-test-with-temp-text ": A"
+ (org-export-as (org-test-default-backend) nil nil nil
+ '(:with-fixed-width t)))))
+ (should
+ (equal ""
+ (org-test-with-temp-text ": A"
+ (org-export-as (org-test-default-backend) nil nil nil
+ '(:with-fixed-width nil)))))
;; Footnotes.
(should
(equal "Footnote?"
@@ -498,7 +509,18 @@ Paragraph"
(equal ""
(org-test-with-temp-text "[0/0]"
(org-export-as (org-test-default-backend)
- nil nil nil '(:with-statistics-cookies nil))))))
+ nil nil nil '(:with-statistics-cookies nil)))))
+ ;; Tables.
+ (should
+ (equal "| A |\n"
+ (org-test-with-temp-text "| A |"
+ (org-export-as (org-test-default-backend) nil nil nil
+ '(:with-tables t)))))
+ (should
+ (equal ""
+ (org-test-with-temp-text "| A |"
+ (org-export-as (org-test-default-backend) nil nil nil
+ '(:with-tables nil))))))
(ert-deftest test-org-export/with-timestamps ()
"Test `org-export-with-timestamps' specifications."
--
1.8.5.2
next prev parent reply other threads:[~2014-01-05 0:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-12-18 20:36 [RFC] About `org-export-with-\(fixed-width\|tables\)' Nicolas Goaziou
2013-12-18 20:44 ` Nick Dokos
2013-12-18 21:19 ` Rasmus
2013-12-18 21:49 ` Thomas S. Dye
2013-12-18 21:58 ` Nicolas Goaziou
2013-12-18 22:24 ` Thomas S. Dye
2013-12-19 22:08 ` Florian Beck
2014-01-03 15:03 ` Bastien
2014-01-05 0:18 ` Nicolas Goaziou [this message]
2014-01-05 6:36 ` Bastien
2014-01-05 17:00 ` Florian Beck
2014-01-05 22:14 ` Nicolas Goaziou
2014-01-04 15:11 ` Eric Abrahamsen
2014-01-07 18:17 ` Eric S Fraga
2014-01-08 7:23 ` Florian Beck
2014-01-08 8:17 ` Eric Abrahamsen
2014-01-08 12:00 ` Eric S Fraga
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mwjbmgbq.fsf@gmail.com \
--to=n.goaziou@gmail.com \
--cc=bzg@gnu.org \
--cc=emacs-orgmode@gnu.org \
--cc=fb@miszellen.de \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.