emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [RFC] [PATCH] org.el: fix ‘org-buffer-property-keys’
@ 2014-08-27  1:35 Aaron Ecay
  2014-08-28  9:48 ` Nicolas Goaziou
  0 siblings, 1 reply; 3+ messages in thread
From: Aaron Ecay @ 2014-08-27  1:35 UTC (permalink / raw)
  To: emacs-orgmode

* 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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-08-30 18:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-27  1:35 [RFC] [PATCH] org.el: fix ‘org-buffer-property-keys’ Aaron Ecay
2014-08-28  9:48 ` Nicolas Goaziou
2014-08-30 18:51   ` Aaron Ecay

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).