summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2015-03-17 15:40:52 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2015-03-17 15:51:22 +0100
commit16cea3d7b74e34945355cf434a684890f4c52cb2 (patch)
tree736a88c104dc68d7cf7a001e56d831efe85969b8
parentfd8c843692e4c487bd03ed0d71b0bac69112b335 (diff)
downloadorg-mode-16cea3d7b74e34945355cf434a684890f4c52cb2.tar.gz
ox: Remove `comment' special value for `org-export-with-creator'
* lisp/ox.el (org-export-with-creator): Change default value. * lisp/ox-ascii.el (org-ascii-template): * lisp/ox-beamer.el (org-beamer-template): * lisp/ox-latex.el (org-latex-template): * lisp/ox-odt.el (org-odt-template): * lisp/ox-org.el (org-org-template): * lisp/ox-texinfo.el (org-texinfo-template): Treat `org-export-with-creator' as a boolean. * testing/lisp/test-ox.el (test-org-export/parse-option-keyword): Update test. * doc/org.texi (Export settings): Update allowed values in `org-export-with-creator'. * etc/ORG-NEWS: Signal change. Special `comment' value isn't meaningful for all back-ends and is not implemented in every back-end where it makes sense anyway. It is possible to add a comment including creator at the end of the document using a body filter instead.
-rw-r--r--doc/org.texi4
-rw-r--r--etc/ORG-NEWS4
-rw-r--r--lisp/ox-ascii.el25
-rw-r--r--lisp/ox-beamer.el9
-rw-r--r--lisp/ox-latex.el8
-rw-r--r--lisp/ox-odt.el3
-rw-r--r--lisp/ox-org.el7
-rw-r--r--lisp/ox-texinfo.el6
-rw-r--r--lisp/ox.el16
-rw-r--r--testing/lisp/test-ox.el9
10 files changed, 41 insertions, 50 deletions
diff --git a/doc/org.texi b/doc/org.texi
index bcdb489..cb82fe3 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -10775,8 +10775,8 @@ Toggle inclusion of CLOCK keywords (@code{org-export-with-clocks}).
@item creator:
@vindex org-export-with-creator
-Configure inclusion of creator info into exported file. It may be set to
-@code{comment} (@code{org-export-with-creator}).
+Toggle inclusion of creator info into exported file
+(@code{org-export-with-creator}).
@item d:
@vindex org-export-with-drawers
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index 252dc3b..877761d 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -96,6 +96,10 @@ compatibility.
If you need to separate consecutive lists with blank lines, always use
two of them, as if this option was nil (default value).
+*** ~org-export-with-creator~ is a boolean
+Special ~comment~ value is no longer allowed. It is possible to use
+a body filter to add comments about the creator at the end of the
+document instead.
*** Removed option =org-babel-sh-command=
This undocumented option defaulted to the value of =shell-file-name=
at the time of loading =ob-shell=. The new behaviour is to use the
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index d5517bc..5711b53 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -1097,7 +1097,7 @@ CONTENTS is the transcoded contents string. INFO is a plist
holding export options."
(let ((global-margin (plist-get info :ascii-global-margin)))
(concat
- ;; 1. Build title block.
+ ;; Build title block.
(org-ascii--indent-string
(concat (org-ascii-template--document-title info)
;; 2. Table of contents.
@@ -1107,19 +1107,18 @@ holding export options."
(org-ascii--build-toc info (and (wholenump depth) depth))
"\n\n\n"))))
global-margin)
- ;; 3. Document's body.
+ ;; Document's body.
contents
- ;; 4. Creator. Ignore `comment' value as there are no comments in
- ;; ASCII. Justify it to the bottom right.
- (org-ascii--indent-string
- (let ((creator-info (plist-get info :with-creator))
- (text-width (- (plist-get info :ascii-text-width) global-margin)))
- (unless (or (not creator-info) (eq creator-info 'comment))
- (concat
- "\n\n\n"
- (org-ascii--fill-string
- (plist-get info :creator) text-width info 'right))))
- global-margin))))
+ ;; Creator. Justify it to the bottom right.
+ (and (plist-get info :with-creator)
+ (org-ascii--indent-string
+ (let ((text-width
+ (- (plist-get info :ascii-text-width) global-margin)))
+ (concat
+ "\n\n\n"
+ (org-ascii--fill-string
+ (plist-get info :creator) text-width info 'right)))
+ global-margin)))))
(defun org-ascii--translate (s info)
"Translate string S according to specified language and charset.
diff --git a/lisp/ox-beamer.el b/lisp/ox-beamer.el
index 0656362..7c42c74 100644
--- a/lisp/ox-beamer.el
+++ b/lisp/ox-beamer.el
@@ -899,12 +899,9 @@ holding export options."
;; 13. Document's body.
contents
;; 14. Creator.
- (let ((creator-info (plist-get info :with-creator)))
- (cond
- ((not creator-info) "")
- ((eq creator-info 'comment)
- (format "%% %s\n" (plist-get info :creator)))
- (t (concat (plist-get info :creator) "\n"))))
+ (if (plist-get info :with-creator)
+ (concat (plist-get info :creator) "\n")
+ "")
;; 15. Document end.
"\\end{document}")))
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 6cec8a1..44435f4 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -1325,12 +1325,8 @@ holding export options."
;; Document's body.
contents
;; Creator.
- (let ((creator-info (plist-get info :with-creator)))
- (cond
- ((not creator-info) "")
- ((eq creator-info 'comment)
- (format "%% %s\n" (plist-get info :creator)))
- (t (concat (plist-get info :creator) "\n"))))
+ (and (plist-get info :with-creator)
+ (concat (plist-get info :creator) "\n"))
;; Document end.
"\\end{document}")))
diff --git a/lisp/ox-odt.el b/lisp/ox-odt.el
index edbd9b8..e32ca26 100644
--- a/lisp/ox-odt.el
+++ b/lisp/ox-odt.el
@@ -1360,7 +1360,8 @@ original parsed data. INFO is a plist holding export options."
iso-date)))))
(format "<meta:generator>%s</meta:generator>\n"
(if (plist-get info :with-creator)
- (plist-get info :creator) ""))
+ (plist-get info :creator)
+ ""))
(format "<meta:keyword>%s</meta:keyword>\n" keywords)
(format "<dc:subject>%s</dc:subject>\n" description)
(format "<dc:title>%s</dc:title>\n" title)
diff --git a/lisp/ox-org.el b/lisp/ox-org.el
index 734b8d2..b0eb279 100644
--- a/lisp/ox-org.el
+++ b/lisp/ox-org.el
@@ -178,17 +178,14 @@ as a communication channel."
(let ((email (org-export-data (plist-get info :email) info)))
(and (org-string-nw-p email)
(format "#+EMAIL: %s\n" email))))
- (and (eq (plist-get info :with-creator) t)
+ (and (plist-get info :with-creator)
(org-string-nw-p (plist-get info :creator))
(format "#+CREATOR: %s\n" (plist-get info :creator)))
(and (org-string-nw-p (plist-get info :keywords))
(format "#+KEYWORDS: %s\n" (plist-get info :keywords)))
(and (org-string-nw-p (plist-get info :description))
(format "#+DESCRIPTION: %s\n" (plist-get info :description)))
- contents
- (and (eq (plist-get info :with-creator) 'comment)
- (org-string-nw-p (plist-get info :creator))
- (format "\n# %s\n" (plist-get info :creator)))))
+ contents))
(defun org-org-section (section contents info)
"Transcode SECTION element back into Org syntax.
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index aaad96d..bdf0c83 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -608,10 +608,8 @@ holding export options."
;; Document's body.
contents "\n"
;; Creator.
- (case (plist-get info :with-creator)
- ((nil) nil)
- (comment (format "@c %s\n" (plist-get info :creator)))
- (otherwise (concat (plist-get info :creator) "\n")))
+ (and (plist-get info :with-creator)
+ (concat (plist-get info :creator) "\n"))
;; Document end.
"@bye")))
diff --git a/lisp/ox.el b/lisp/ox.el
index 0c7728f..cab372c 100644
--- a/lisp/ox.el
+++ b/lisp/ox.el
@@ -370,18 +370,18 @@ e.g. \"c:t\"."
:group 'org-export-general
:type 'boolean)
-(defcustom org-export-with-creator 'comment
+(defcustom org-export-with-creator nil
"Non-nil means the postamble should contain a creator sentence.
-The sentence can be set in `org-export-creator-string' and
-defaults to \"Generated by Org mode XX in Emacs XXX.\".
+The sentence can be set in `org-export-creator-string', which
+see.
-If the value is `comment' insert it as a comment."
+This option can also be set with the OPTIONS keyword, e.g.,
+\"creator:t\"."
:group 'org-export-general
- :type '(choice
- (const :tag "No creator sentence" nil)
- (const :tag "Sentence as a comment" comment)
- (const :tag "Insert the sentence" t)))
+ :version "25.1"
+ :package-version '(Org . "8.3")
+ :type 'boolean)
(defcustom org-export-with-date t
"Non-nil means insert date in the exported document.
diff --git a/testing/lisp/test-ox.el b/testing/lisp/test-ox.el
index 1b70a78..7b86286 100644
--- a/testing/lisp/test-ox.el
+++ b/testing/lisp/test-ox.el
@@ -124,13 +124,12 @@ variable, and communication channel under `info'."
(should
(equal
(org-export--parse-option-keyword
- "arch:headline creator:comment d:(\"TEST\")
- ^:{} toc:1 tags:not-in-toc tasks:todo num:2 <:active")
+ "arch:headline d:(\"TEST\") ^:{} toc:1 tags:not-in-toc tasks:todo num:2 <:active")
'( :section-numbers
2
- :with-archived-trees headline :with-creator comment
- :with-drawers ("TEST") :with-sub-superscript {} :with-toc 1
- :with-tags not-in-toc :with-tasks todo :with-timestamps active))))
+ :with-archived-trees headline :with-drawers ("TEST")
+ :with-sub-superscript {} :with-toc 1 :with-tags not-in-toc
+ :with-tasks todo :with-timestamps active))))
(ert-deftest test-org-export/get-inbuffer-options ()
"Test reading all standard export keywords."