浏览代码

ASCII export: Fix issues with new link export

Carsten Dominik 16 年之前
父节点
当前提交
2b4788ae9d
共有 2 个文件被更改,包括 11 次插入3 次删除
  1. 7 0
      lisp/ChangeLog
  2. 4 3
      lisp/org-exp.el

+ 7 - 0
lisp/ChangeLog

@@ -1,3 +1,10 @@
+2009-02-28  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org-exp.el (org-export-as-ascii): Reverse link buffer before
+	outputting it.
+	(org-export-ascii-push-links): Fix bug with pussing links into the
+	export buffer.
+
 2009-02-27  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-archive.el (org-archive-subtree): Do not add 1 to level if

+ 4 - 3
lisp/org-exp.el

@@ -2781,7 +2781,7 @@ underlined headlines.  The default is 3."
     (org-init-section-numbers)
     (while (setq line (pop lines))
       (when (and link-buffer (string-match "^\\*+ " line))
-	(org-export-ascii-push-links link-buffer)
+	(org-export-ascii-push-links (nreverse link-buffer))
 	(setq link-buffer nil))
       (setq wrap nil)
       ;; Remove the quoted HTML tags.
@@ -2848,7 +2848,7 @@ underlined headlines.  The default is 3."
 	  (if wrap (setq line (org-export-ascii-wrap line wrap))))
 	(insert line "\n"))))
 
-    (org-export-ascii-push-links link-buffer)
+    (org-export-ascii-push-links (nreverse link-buffer))
 
     (normal-mode)
 
@@ -2957,7 +2957,8 @@ underlined headlines.  The default is 3."
 	       "^\\(\\([ \t]*\\)\\|\\(\\*+ \\)\\)[^ \t\n]" nil t))
 	    (setq ind (or (match-string 2)
 			  (make-string (length (match-string 3)) ?\ )))))
-      (mapc (lambda (x) (insert ind "[" (car x) "]: " link)) link-buffer))
+      (mapc (lambda (x) (insert ind "[" (car x) "]: " (cdr x) "\n"))
+	    link-buffer))
     (insert "\n")))
 
 (defun org-insert-centered (s &optional underline)