emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Aaron Ecay <aaronecay@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [RFC] [PATCH] org.el: fix ‘org-buffer-property-keys’
Date: Tue, 26 Aug 2014 21:35:41 -0400	[thread overview]
Message-ID: <1409103341-17457-1-git-send-email-aaronecay@gmail.com> (raw)

* 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

             reply	other threads:[~2014-08-27  1:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-27  1:35 Aaron Ecay [this message]
2014-08-28  9:48 ` [RFC] [PATCH] org.el: fix ‘org-buffer-property-keys’ Nicolas Goaziou
2014-08-30 18:51   ` Aaron Ecay

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1409103341-17457-1-git-send-email-aaronecay@gmail.com \
    --to=aaronecay@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).