summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Leech-Pepin <jonathan.leechpepin@gmail.com>2013-02-14 16:59:03 (GMT)
committer Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>2013-02-14 16:59:48 (GMT)
commit0f6cb7f8501a47f41e72d12b2d30f3d1dfbd4ebe (patch)
tree5bb43293eff4402d824e3bc1cbdd2a8f4364e2c3
parent3f421f309f6bdd5536d8b0d2f63a23ac4cb66e2c (diff)
downloadorg-mode-0f6cb7f8501a47f41e72d12b2d30f3d1dfbd4ebe.zip
org-mode-0f6cb7f8501a47f41e72d12b2d30f3d1dfbd4ebe.tar.gz
ox-texinfo: Ensure detailed menu generation does not exceed maximum
recognized depth * lisp/ox-texinfo.el (org-texinfo-max-toc-depth): Maximum depth recognized by texinfo for nodes and sectioning. Left as a constant to be updated if ever necessary. (org-texinfo--generate-detailed): Use the smaller between org-texinfo-max-toc-depth and headline levels (H: )
-rw-r--r--lisp/ox-texinfo.el9
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index 8bc3520..20fa41d 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -369,6 +369,12 @@ file name, %b by the file base name \(i.e without extension) and
:type '(repeat :tag "Shell command sequence"
(string :tag "Shell command")))
+;;; Constants
+(defconst org-texinfo-max-toc-depth 4
+ "Maximum depth for creation of detailed menu listings. Beyond
+ this depth texinfo will not recognize the nodes and will cause
+ errors. Left as a constant in case this value ever changes.")
+
;;; Internal Functions
@@ -501,7 +507,8 @@ MENU is the parse-tree to work with. LEVEL is the starting level
for the menu headlines and from which recursion occurs. INFO is
a plist containing contextual information."
(when level
- (let ((max-depth (plist-get info :headline-levels)))
+ (let ((max-depth (min org-texinfo-max-toc-depth
+ (plist-get info :headline-levels))))
(when (> max-depth level)
(loop for headline in menu append
(let* ((title (org-texinfo--menu-headlines headline info))