emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: James TD Smith <ahktenzero@mohorovi.cc>
To: emacs-orgmode@gnu.org
Subject: [PATCH] Fix a bug in the remember properties escape
Date: Mon, 17 Nov 2008 20:56:26 +0000	[thread overview]
Message-ID: <1226955386-17206-1-git-send-email-ahktenzero@mohorovi.cc> (raw)

Calling org-property-get-allowed-values with the point not on an item
resulted in an error.

This patch is available from my git repository, in the branch
remember-properties-fix.

 ---
 lisp/ChangeLog       |    6 ++++++
 lisp/org-remember.el |    5 ++++-
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 53a21fd..3690659 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2008-11-17  James TD Smith  <ahktenzero@mohorovi.cc>
+
+	* org-remember.el (org-remember-apply-template): The call to
+	`org-property-get-allowed-values' failed if the point in the
+	target file was not on a headline.
+
 2008-11-17  Carsten Dominik  <carsten.dominik@gmail.com>
 
 	* org-colview.el (org-columns-display-here): New argument
diff --git a/lisp/org-remember.el b/lisp/org-remember.el
index 5d99ba3..9026489 100644
--- a/lisp/org-remember.el
+++ b/lisp/org-remember.el
@@ -504,7 +504,10 @@ to be run from that hook to function properly."
 		((prop (substring-no-properties prompt))
 		 (allowed (with-current-buffer
 			      (get-buffer (file-name-nondirectory file))
-			    (org-property-get-allowed-values nil prop 'table)))
+			    (save-excursion
+			      (if (not (org-at-heading-p))
+				  (re-search-forward org-complex-heading-regexp))
+			      (org-property-get-allowed-values nil prop 'table))))
 		 (existing (with-current-buffer
 			       (get-buffer (file-name-nondirectory file))
 			     (mapcar 'list (org-property-values prop))))
-- 
1.5.6.5

             reply	other threads:[~2008-11-17 20:56 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17 20:56 James TD Smith [this message]
2008-11-18  7:28 ` [PATCH] Fix a bug in the remember properties escape Carsten Dominik

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=1226955386-17206-1-git-send-email-ahktenzero@mohorovi.cc \
    --to=ahktenzero@mohorovi.cc \
    --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).