summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Leech-Pepin <jonathan.leechpepin@gmail.com>2013-02-25 10:44:18 -0500
committerJonathan Leech-Pepin <jonathan.leechpepin@gmail.com>2013-02-25 10:44:18 -0500
commitc94cae1ee6cfa0280fa49f77536b6fa9eae77e67 (patch)
tree8682d6fce0c019197f94d585dbb793b8027487f6
parent2a752e4ce1b2476c490957f6e289045c78606236 (diff)
downloadorg-mode-c94cae1ee6cfa0280fa49f77536b6fa9eae77e67.tar.gz
ox-texinfo.el: Fix issue with long headlines and node listings
* lisp/ox-texinfo.el (org-texinfo-node-description-column): New custom variable. (org-texinfo--format-menu): Use new variable to set column for description in node listings. If the headline extends past this column, add the description after the headline. The default column is 32 as suggested by Thomas S. Dye, http://article.gmane.org/gmane.emacs.orgmode/66664
-rw-r--r--lisp/ox-texinfo.el29
1 files changed, 20 insertions, 9 deletions
diff --git a/lisp/ox-texinfo.el b/lisp/ox-texinfo.el
index bc24694..28d9ca6 100644
--- a/lisp/ox-texinfo.el
+++ b/lisp/ox-texinfo.el
@@ -222,6 +222,16 @@ order to reproduce the default set-up:
:group 'org-export-texinfo
:type 'function)
+;;; Node listing (menu)
+
+(defcustom org-texinfo-node-description-column 32
+ "Column at which to start the description in the node
+ listings.
+
+If a node title is greater than this length, the description will
+be placed after the end of the title."
+ :group 'org-export-texinfo
+ :type 'integer)
;;; Footnotes
;;
@@ -609,19 +619,20 @@ Other menu items are output as:
With the spacing between :: and description based on the length
of the longest menu entry."
- (let* ((lengths (mapcar 'car text-menu))
- (max-length (apply 'max lengths))
- output)
+ (let (output)
(setq output
(mapcar (lambda (name)
- (let* ((title (nth 1 name))
- (desc (nth 2 name))
- (length (nth 0 name)))
+ (let* ((title (nth 1 name))
+ (desc (nth 2 name))
+ (length (nth 0 name))
+ (column (max
+ length
+ org-texinfo-node-description-column))
+ (spacing (- column length)
+ ))
(if (> length -1)
(concat "* " title ":: "
- (make-string
- (- (+ 3 max-length) length)
- ?\s)
+ (make-string spacing ?\s)
(if desc
(concat desc)))
(concat "\n" title "\n"))))