Browse Source

`org-export-ascii-underline' is now order from level 1 to n.

* org-ascii.el (org-export-ascii-underline): Put the level's
characters in the right order, as documented by the docstring.
(org-ascii-level-start): select the right char for underlining
headlines.
Bastien Guerry 14 years ago
parent
commit
8ee7408edb
1 changed files with 3 additions and 4 deletions
  1. 3 4
      lisp/org-ascii.el

+ 3 - 4
lisp/org-ascii.el

@@ -38,7 +38,7 @@
   :tag "Org Export ASCII"
   :tag "Org Export ASCII"
   :group 'org-export)
   :group 'org-export)
 
 
-(defcustom org-export-ascii-underline '(?\$ ?\# ?^ ?\~ ?\= ?\-)
+(defcustom org-export-ascii-underline '(?\- ?\= ?\~ ?^ ?\# ?\$)
   "Characters for underlining headings in ASCII export.
   "Characters for underlining headings in ASCII export.
 In the given sequence, these characters will be used for level 1, 2, ..."
 In the given sequence, these characters will be used for level 1, 2, ..."
   :group 'org-export-ascii
   :group 'org-export-ascii
@@ -652,9 +652,8 @@ publishing directory."
       (if (or (not (equal (char-before) ?\n))
       (if (or (not (equal (char-before) ?\n))
 	      (not (equal (char-before (1- (point))) ?\n)))
 	      (not (equal (char-before (1- (point))) ?\n)))
 	  (insert "\n"))
 	  (insert "\n"))
-      (setq char (or (nth (max (- umax level) 0)
-      			  (reverse org-export-ascii-underline))
-      		     (car (last org-export-ascii-underline))))
+      (setq char (or (nth (1- level) org-export-ascii-underline)
+      		     (last org-export-ascii-underline)))
       (unless org-export-with-tags
       (unless org-export-with-tags
 	(if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
 	(if (string-match (org-re "[ \t]+\\(:[[:alnum:]_@#%:]+:\\)[ \t]*$") title)
 	    (setq title (replace-match "" t t title))))
 	    (setq title (replace-match "" t t title))))