* lisp/org.el (org-buffer-property-keys): Only match real property drawers.
This patch adds an org-element based check. Otherwise the following triggers a bogus prompt to fix a malformed drawer on typing M-: (org-buffer-property-keys) * foo (add-to-list 'org-capture-templates '("c" "Contact" entry (file "~/org/contacts.org") "* %(org-contacts-template-name)%? :PROPERTIES: :EMAIL: %(org-contacts-template-email) :END:")) --- lisp/org.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lisp/org.el b/lisp/org.el index d529a31..2e3003a 100755 --- a/lisp/org.el +++ b/lisp/org.el @@ -15825,6 +15825,8 @@ formats in the current buffer." (goto-char (point-min)) (while (re-search-forward org-property-start-re nil t) (catch 'cont + (unless (eq (org-element-type (org-element-at-point)) 'property-drawer) + (throw 'cont nil)) (setq range (or (org-get-property-block) (if (y-or-n-p (format "Malformed drawer at %d, repair?" (point))) -- 2.1.0