소스 검색

`org-export-as-org' now exports a string when to-buffer equals 'string

Eric Schulte 15 년 전
부모
커밋
ee5a81102d
1개의 변경된 파일7개의 추가작업 그리고 2개의 파일을 삭제
  1. 7 2
      lisp/org-exp.el

+ 7 - 2
lisp/org-exp.el

@@ -2490,7 +2490,8 @@ directory."
 			  filename)))
 	 (backup-inhibited t)
 	 (buffer (find-file-noselect filename))
-	 (region (buffer-string)))
+	 (region (buffer-string))
+         str-ret)
     (save-excursion
       (switch-to-buffer buffer)
       (erase-buffer)
@@ -2536,7 +2537,11 @@ directory."
 	    (write-file (concat filename ".html")))
 	  (kill-buffer newbuf)))
       (set-buffer-modified-p nil)
-      (kill-buffer (current-buffer)))))
+      (if (equal to-buffer 'string)
+          (progn (setq str-ret (buffer-string))
+                 (kill-buffer (current-buffer))
+                 str-ret)
+        (kill-buffer (current-buffer))))))
 
 (defvar org-archive-location)  ;; gets loaded with the org-archive require.
 (defun org-get-current-options ()