diff options
author | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-03-13 12:15:33 +0100 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2019-03-13 12:15:33 +0100 |
commit | 48cafd3d3f246719cf96f042c21e9be64ecdf87c (patch) | |
tree | a769ec33d34a78ff8103d80a80579c1eae39f34f | |
parent | cd13b0241d459fae3917ee3327e8e045bef4f4d8 (diff) | |
download | org-mode-48cafd3d3f246719cf96f042c21e9be64ecdf87c.tar.gz |
ox-texinfo: Add missing support for item counters
* lisp/ox-texinfo.el (org-texinfo-plain-list): Support counter in the
first item of the list.
Mid-list counters are not supported, per Texinfo limitation.
-rw-r--r-- | lisp/ox-texinfo.el | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el index 13ec237..9ea624a 100644 --- a/lisp/ox-texinfo.el +++ b/lisp/ox-texinfo.el @@ -1253,13 +1253,21 @@ contextual information." (if (string-prefix-p "@" i) i (concat "@" i)))) (table-type (plist-get attr :table-type)) (type (org-element-property :type plain-list)) + (initial-counter + (and (eq type 'ordered) + ;; Texinfo only supports initial counters, i.e., it + ;; cannot change the numbering mid-list. + (let ((first-item (car (org-element-contents plain-list)))) + (org-element-property :counter first-item)))) (list-type (cond ((eq type 'ordered) "enumerate") ((eq type 'unordered) "itemize") ((member table-type '("ftable" "vtable")) table-type) (t "table")))) (format "@%s\n%s@end %s" - (if (eq type 'descriptive) (concat list-type " " indic) list-type) + (cond ((eq type 'descriptive) (concat list-type " " indic)) + (initial-counter (format "%s %d" list-type initial-counter)) + (t list-type)) contents list-type))) |