浏览代码

Limit search for in-buffer options beginning of first headline

* org-exp.el (org-export-visible): Limit search for in-buffer options
beginning of first headline.
David Maus 14 年之前
父节点
当前提交
6c95170ca0
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      lisp/org-exp.el

+ 4 - 3
lisp/org-exp.el

@@ -2608,9 +2608,10 @@ command."
 	;; does do the trick.
 	(if (looking-at "#[^\r\n]*")
 	    (append-to-buffer buffer (match-beginning 0) (1+ (match-end 0))))
-	(while (re-search-forward "[\n\r]#[^\n\r]*" nil t)
-	  (append-to-buffer buffer (1+ (match-beginning 0))
-			    (min (point-max) (1+ (match-end 0))))))
+	(when (re-search-forward "^\\*+[ \t]+" nil t)
+	  (while (re-search-backward "[\n\r]#[^\n\r]*" nil t)
+	    (append-to-buffer buffer (1+ (match-beginning 0))
+			      (min (point-max) (1+ (match-end 0)))))))
       (set-buffer buffer)
       (let ((buffer-file-name file)
 	    (org-inhibit-startup t))