Warn users of malformed property drawers

* org.el (org-buffer-property-keys): When scanning the buffer for
valid property keys, give users a chance to repair any malformed
property drawers.
This commit is contained in:
Eric Abrahamsen 2014-05-23 16:52:58 +08:00 committed by Bastien Guerry
parent 2ce78ef45b
commit c23d9ee8c5
1 changed files with 11 additions and 6 deletions

View File

@ -15712,12 +15712,17 @@ formats in the current buffer."
(widen)
(goto-char (point-min))
(while (re-search-forward org-property-start-re nil t)
(setq range (org-get-property-block))
(goto-char (car range))
(while (re-search-forward org-property-re
(cdr range) t)
(add-to-list 'rtn (org-match-string-no-properties 2)))
(outline-next-heading))))
(catch 'cont
(setq range (or (org-get-property-block)
(if (y-or-n-p
(format "Malformed drawer at %d, repair?" (point)))
(org-get-property-block nil nil t)
(throw 'cont nil))))
(goto-char (car range))
(while (re-search-forward org-property-re
(cdr range) t)
(add-to-list 'rtn (org-match-string-no-properties 2)))
(outline-next-heading)))))
(when include-specials
(setq rtn (append org-special-properties rtn)))