summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2016-05-19 19:15:55 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-05-19 19:15:55 +0200
commit8eb582b9513c3fc6dfc0711ffee31b8bcece26db (patch)
tree8f0991f4ca9bdc8ff39fd0a5bb06377aa4d74511
parentebb4ba41fd53183c0bcfc042e532ee60d421b7e7 (diff)
downloadorg-mode-8eb582b9513c3fc6dfc0711ffee31b8bcece26db.tar.gz
ox-texinfo: Allow :options attribute on special blocks
* lisp/ox-texinfo.el (org-texinfo-special-block): Handle :options attribute. * doc/org.texi (Texinfo specific attributes): Add special block section.
-rw-r--r--doc/org.texi22
-rw-r--r--etc/ORG-NEWS40
-rw-r--r--lisp/ox-texinfo.el9
3 files changed, 52 insertions, 19 deletions
diff --git a/doc/org.texi b/doc/org.texi
index 025baaa..6980319 100644
--- a/doc/org.texi
+++ b/doc/org.texi
@@ -13756,6 +13756,28 @@ Texinfo code.
[[ridt.pdf]]
@end example
+@subsubheading Special blocks
+
+In Texinfo output, special blocks become commands of the same name. Value of
+@code{:options} attribute is added right after the beginning of the command.
+For example:
+
+@example
+#+attr_texinfo: :options org-org-export-to-org ...
+#+begin_defun
+A somewhat obsessive function.
+#+end_defun
+@end example
+
+@noindent
+becomes
+
+@example
+@@defun org-org-export-to-org ...
+A somewhat obsessive function.
+@@end defun
+@end example
+
@node An example
@subsection An example
diff --git a/etc/ORG-NEWS b/etc/ORG-NEWS
index e46a08b..6096d9f 100644
--- a/etc/ORG-NEWS
+++ b/etc/ORG-NEWS
@@ -133,13 +133,33 @@ property lists.
*** New option ~date-tree-last~ for ~org-agenda-insert-diary-strategy~
When ~org-agenda-insert-diary-strategy~ is set to ~date-tree-last~, diary
entries are added to last in the date tree.
-*** New option ~org-export-with-broken-links~
-This option tells the export process how to behave when encountering
-a broken internal link. See its docstring for more information.
*** New ~vbar~ entity
~\vbar~ or ~\vbar{}~ will be exported unconditionnally as a =|=,
unlike to existing ~\vert~, which is expanded as ~&vert;~ when using
a HTML derived export back-end.
+*** Export
+**** New =#+latex_compiler= keyword to set LaTeX compiler.
+PDFLaTeX, XeLaTeX, and LuaLaTeX are supported. See the manual for
+details.
+**** New option ~org-export-with-broken-links~
+This option tells the export process how to behave when encountering
+a broken internal link. See its docstring for more information.
+
+**** Attributes support in custom language environments for LaTeX export
+Custom language environments for LaTeX export can now define the
+string to be inserted during export, using attributes to indicate the
+position of the elements. See variable ~org-latex-custom-lang-environments~
+for more details.
+
+**** New Texinfo ~options~ attribute on special blocks
+Using ~:options~ as a Texinfo attribute, it is possible to add
+information to custom environments. See manual for details.
+**** New HTML ~id~ attributes on special, example and quote blocks
+If the block has a =#+NAME:= attribute assigned, then the HTML element
+will have an ~id~ attribute with that name in the HTML export. This
+enables one to create links to these elements in other places, e.g.,
+~<a href="#name">text</a>~.
+
*** Babel
**** Support for SLY in Lisp blocks
See ~org-babel-lisp-eval-fn~ to activate it.
@@ -210,9 +230,6 @@ Alice <-- Bob: another authentication Response
Please note that *pdf* *does not work out of the box* and needss
additional setup in addition to plantuml. See
[[http://plantuml.com/pdf.html]] for details and setup information.
-*** New =#+latex_compiler= keyword to set LaTeX compiler.
-PDFLaTeX, XeLaTeX, and LuaLaTeX are supported. See the manual for
-details.
*** Rewrite of radio lists
Radio lists, i.e, Org plain lists in foreign buffers, have been
rewritten to be on par with Radio tables. You can use a large set of
@@ -239,11 +256,6 @@ For example:
They are supported in org-capture via ~file+weektree~ and
~file+weektree+prompt~ target specifications.
-*** Attributes support in custom language environments for LaTeX export
-Custom language environments for LaTeX export can now define the
-string to be inserted during export, using attributes to indicate the
-position of the elements. See variable ~org-latex-custom-lang-environments~
-for more details.
*** Accept ~:indent~ parameter when capturing column view
When defining a "columnview" dynamic block, it is now possible to add
an :indent parameter, much like the one in the clock table.
@@ -265,12 +277,6 @@ types.
*** New option ~org-attach-commit~
When non-nil, commit attachments with git, assuming the document is in
a git repository.
-*** New HTML ~id~ attributes on special, example and quote blocks
-If the block has a =#+NAME:= attribute assigned, then the HTML element
-will have an ~id~ attribute with that name in the HTML export. This
-enables one to create links to these elements in other places, e.g.,
-~<a href="#name">text</a>~.
-
** New functions
*** ~org-next-line-empty-p~
It replaces the deprecated ~next~ argument to ~org-previous-line-empty-p~.
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 99ba392..4cae991 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -1291,8 +1291,13 @@ holding contextual information."
"Transcode a SPECIAL-BLOCK element from Org to Texinfo.
CONTENTS holds the contents of the block. INFO is a plist used
as a communication channel."
- (let ((type (org-element-property :type special-block)))
- (format "@%s\n%s@end %s" type contents type)))
+ (let ((opt (org-export-read-attribute :attr_texinfo special-block :options))
+ (type (org-element-property :type special-block)))
+ (format "@%s%s\n%s@end %s"
+ type
+ (if opt (concat " " opt) opt)
+ (or contents "")
+ type)))
;;;; Src Block