From 4007c1cdcead1a2ef52ed7e57d5615203a05204c Mon Sep 17 00:00:00 2001 From: Carsten Dominik Date: Wed, 19 Jan 2011 10:57:25 +0100 Subject: [PATCH] Fix bug in ASCII export * lisp/org-ascii.el (org-ascii-level-start): Catch the case of levels which do not have an equivalent in the list of underline characters. For more information see http://thread.gmane.org/gmane.emacs.orgmode/36097 --- lisp/org-ascii.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/org-ascii.el b/lisp/org-ascii.el index 99facb1e4..01106c385 100644 --- a/lisp/org-ascii.el +++ b/lisp/org-ascii.el @@ -652,7 +652,9 @@ publishing directory." (if (or (not (equal (char-before) ?\n)) (not (equal (char-before (1- (point))) ?\n))) (insert "\n")) - (setq char (nth (- umax level) (reverse org-export-ascii-underline))) + (setq char (or (nth (max (- umax level) 0) + (reverse org-export-ascii-underline)) + (last org-export-ascii-underline))) (unless org-export-with-tags (if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title) (setq title (replace-match "" t t title))))