ソースを参照

org-element: Fix parsing orphaned affiliated keywords

* lisp/org-element.el (org-element-keyword-parser): Fix parsing
  orphaned affiliated keywords.
Nicolas Goaziou 11 年 前
コミット
594b7808a1
1 ファイル変更4 行追加1 行削除
  1. 4 1
      lisp/org-element.el

+ 4 - 1
lisp/org-element.el

@@ -2029,7 +2029,10 @@ Return a list whose CAR is `keyword' and CDR is a plist
 containing `:key', `:value', `:begin', `:end', `:post-blank' and
 `:post-affiliated' keywords."
   (save-excursion
-    (let ((begin (car affiliated))
+    ;; An orphaned affiliated keyword is considered as a regular
+    ;; keyword.  In this case AFFILIATED is nil, so we take care of
+    ;; this corner case.
+    (let ((begin (or (car affiliated) (point)))
 	  (post-affiliated (point))
 	  (key (progn (looking-at "[ \t]*#\\+\\(\\S-+*\\):")
 		      (upcase (org-match-string-no-properties 1))))