summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Maus <dmaus@ictsoc.de>2010-11-07 20:06:54 +0100
committerDavid Maus <dmaus@ictsoc.de>2010-11-07 20:06:54 +0100
commit6c95170ca0eda739d699f207bcb09528297d8ca1 (patch)
treefec0cf72dc024d43364b878f65e5aec7652b5584
parent49a00abf3d2b149b8fb72eca531569e6f4d56b5e (diff)
downloadorg-mode-6c95170ca0eda739d699f207bcb09528297d8ca1.tar.gz
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.
-rw-r--r--lisp/org-exp.el7
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org-exp.el b/lisp/org-exp.el
index fb867c0..9004dd5 100644
--- a/lisp/org-exp.el
+++ b/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))