From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: emacs-orgmode@gnu.org
Subject: invalid property drawer and C-c C-x p
Date: Mon, 25 Aug 2014 15:31:28 +0200 [thread overview]
Message-ID: <874mx0lmq7.fsf@geodiff-mac3.ulb.ac.be> (raw)
Hi,
Sometimes I apparently manage to corrupt my org files by having an
unfinished drawers in them. Of course this is wrong and I should
investigate, but if it happens, hitting C-c C-x p leads to a useless
error (Wrong type argument: integer-or-marker-p, nil). I suggest to
following patch for a better error:
diff --git a/lisp/org.el b/lisp/org.el
index adfbeaa..4489287 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -15612,6 +15612,8 @@ formats in the current buffer."
(goto-char (point-min))
(while (re-search-forward org-property-start-re nil t)
(setq range (org-get-property-block))
+ (when (not range)
+ (error "Invalid property block in buffer %s at position %d" (current-buffer) (point)))
(goto-char (car range))
(while (re-search-forward org-property-re
(cdr range) t)
To test it :
(with-temp-buffer
(org-mode)
(insert "* foo\n:PROPERTIES:\n:BAR: \n\n bal")
(org-set-property nil nil))
--
Nicolas Richard
next reply other threads:[~2014-08-25 13:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-25 13:31 Nicolas Richard [this message]
2014-08-25 13:38 ` invalid property drawer and C-c C-x p Nicolas Goaziou
2014-08-25 13:49 ` [Bulk] " Nicolas Richard
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=874mx0lmq7.fsf@geodiff-mac3.ulb.ac.be \
--to=theonewiththeevillook@yahoo.fr \
--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).