diff --git a/doc/org.texi b/doc/org.texi index bcdb489f6..cb82fe348 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 252dc3bf9..877761dd1 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 d5517bcfc..5711b5313 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 065636255..7c42c74b4 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 6cec8a1ca..44435f4e7 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 edbd9b810..e32ca2613 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 "%s\n" (if (plist-get info :with-creator) - (plist-get info :creator) "")) + (plist-get info :creator) + "")) (format "%s\n" keywords) (format "%s\n" description) (format "%s\n" title) diff --git a/lisp/ox-org.el b/lisp/ox-org.el index 734b8d221..b0eb279e9 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 aaad96d34..bdf0c83cf 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 0c7728f44..cab372cf9 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 1b70a7845..7b862862e 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."