Merge branch 'maint'
authorNicolas Goaziou <mail@nicolasgoaziou.fr>
Sun, 31 Aug 2014 09:43:27 +0000 (11:43 +0200)
committerNicolas Goaziou <mail@nicolasgoaziou.fr>
Sun, 31 Aug 2014 09:43:27 +0000 (11:43 +0200)
Conflicts:
lisp/org-element.el

1  2 
lisp/org-element.el
lisp/org.el
testing/lisp/test-org-element.el

@@@ -1392,38 -1308,40 +1392,38 @@@ keyword and CDR is a plist of affiliate
  their value.
  
  Return a list whose CAR is `property-drawer' and CDR is a plist
 -containing `:begin', `:end', `:hiddenp', `:contents-begin',
 -`:contents-end', `:post-blank' and `:post-affiliated' keywords.
 +containing `:begin', `:end', `:contents-begin', `:contents-end',
 +`:post-blank' and `:post-affiliated' keywords.
  
  Assume point is at the beginning of the property drawer."
-   (save-excursion
-     (let ((case-fold-search t))
-       (if (not (save-excursion
-                (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)))
-         ;; Incomplete drawer: parse it as a paragraph.
-         (org-element-paragraph-parser limit affiliated)
-       (save-excursion
-         (let* ((drawer-end-line (match-beginning 0))
-                (begin (car affiliated))
-                (post-affiliated (point))
-                (contents-begin (progn (forward-line)
-                                       (and (< (point) drawer-end-line)
-                                            (point))))
-                (contents-end (and contents-begin drawer-end-line))
-                (pos-before-blank (progn (goto-char drawer-end-line)
-                                         (forward-line)
-                                         (point)))
-                (end (progn (skip-chars-forward " \r\t\n" limit)
-                            (if (eobp) (point) (line-beginning-position)))))
-           (list 'property-drawer
-                 (nconc
-                  (list :begin begin
-                        :end end
-                        :contents-begin contents-begin
-                        :contents-end contents-end
-                        :post-blank (count-lines pos-before-blank end)
-                        :post-affiliated post-affiliated)
-                  (cdr affiliated)))))))))
+   (let ((case-fold-search t))
+     (if (not (save-excursion (re-search-forward "^[ \t]*:END:[ \t]*$" limit t)))
+       ;; Incomplete drawer: parse it as a paragraph.
+       (org-element-paragraph-parser limit affiliated)
+       (save-excursion
+       (let* ((drawer-end-line (match-beginning 0))
+              (begin (car affiliated))
+              (post-affiliated (point))
+              (contents-begin
+               (progn
+                 (forward-line)
+                 (and (re-search-forward org-property-re drawer-end-line t)
+                      (line-beginning-position))))
+              (contents-end (and contents-begin drawer-end-line))
 -             (hidden (org-invisible-p2))
+              (pos-before-blank (progn (goto-char drawer-end-line)
+                                       (forward-line)
+                                       (point)))
+              (end (progn (skip-chars-forward " \r\t\n" limit)
+                          (if (eobp) (point) (line-beginning-position)))))
+         (list 'property-drawer
+               (nconc
+                (list :begin begin
+                      :end end
 -                     :hiddenp hidden
+                      :contents-begin contents-begin
+                      :contents-end contents-end
+                      :post-blank (count-lines pos-before-blank end)
+                      :post-affiliated post-affiliated)
+                (cdr affiliated))))))))
  
  (defun org-element-property-drawer-interpreter (property-drawer contents)
    "Interpret PROPERTY-DRAWER element as Org syntax.
@@@ -2103,24 -2094,23 +2103,25 @@@ CONTENTS is nil.
  LIMIT bounds the search.
  
  Return a list whose CAR is `node-property' and CDR is a plist
 -containing `:key', `:value', `:begin', `:end' and `:post-blank'
 -keywords."
 +containing `:key', `:value', `:begin', `:end', `:post-blank' and
 +`:post-affiliated' keywords."
-   (save-excursion
-     (looking-at org-property-re)
-     (let ((case-fold-search t)
-         (begin (point))
-         (key   (org-match-string-no-properties 2))
-         (value (org-match-string-no-properties 3))
-         (pos-before-blank (progn (forward-line) (point)))
-         (end (progn (skip-chars-forward " \r\t\n" limit)
-                     (if (eobp) (point) (point-at-bol)))))
-       (list 'node-property
-           (list :key key
-                 :value value
-                 :begin begin
-                 :end end
-                 :post-blank (count-lines pos-before-blank end)
-                 :post-affiliated begin)))))
+   (looking-at org-property-re)
 -  (let ((begin (point))
++  (let ((case-fold-search t)
++      (begin (point))
+       (key   (org-match-string-no-properties 2))
+       (value (org-match-string-no-properties 3))
+       (end (save-excursion
+              (end-of-line)
+              (if (re-search-forward org-property-re limit t)
+                  (line-beginning-position)
+                limit))))
+     (list 'node-property
+         (list :key key
+               :value value
+               :begin begin
+               :end end
 -              :post-blank 0))))
++              :post-blank 0
++              :post-affiliated begin))))
  
  (defun org-element-node-property-interpreter (node-property contents)
    "Interpret NODE-PROPERTY element as Org syntax.
diff --cc lisp/org.el
index e05a416,af450cc..72a306b
mode 100755,100644..100755
@@@ -6257,13 -6152,13 +6257,13 @@@ Use `org-reduced-level' to remove the e
  (defvar org-font-lock-keywords nil)
  
  (defsubst org-re-property (property &optional literal allow-null)
 -   "Return a regexp matching a PROPERTY line.
 +  "Return a regexp matching a PROPERTY line.
   Match group 3 will be set to the value if it exists."
 -   (concat "^\\(?4:[ \t]*\\)\\(?1::\\(?2:"
 +  (concat "^\\(?4:[ \t]*\\)\\(?1::\\(?2:"
          (if literal property (regexp-quote property))
-         "\\):\\)[ \t]+\\(?3:[^ \t\r\n]"
-         (if allow-null "*")
-         ".*?\\)\\(?5:[ \t]*\\)$"))
+         "\\):\\)\\(?:[ \t]+\\(?3:[^ \t\r\n].*?\\)\\)"
+         (and allow-null "?")
+         "\\(?5:[ \t]*\\)$"))
  
  (defconst org-property-re
    (org-re-property ".*?" 'literal t)
Simple merge