emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <mail@nicolasgoaziou.fr>
To: Nicolas Richard <theonewiththeevillook@yahoo.fr>
Cc: emacs-orgmode@gnu.org
Subject: Re: invalid property drawer and C-c C-x p
Date: Mon, 25 Aug 2014 15:38:32 +0200	[thread overview]
Message-ID: <87wq9wit9j.fsf@nicolasgoaziou.fr> (raw)
In-Reply-To: <874mx0lmq7.fsf@geodiff-mac3.ulb.ac.be> (Nicolas Richard's message of "Mon, 25 Aug 2014 15:31:28 +0200")

Hello,

Nicolas Richard <theonewiththeevillook@yahoo.fr> writes:

> 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)

AFAICT, a similar mechanism is already implemented in master.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2014-08-25 13:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-25 13:31 invalid property drawer and C-c C-x p Nicolas Richard
2014-08-25 13:38 ` Nicolas Goaziou [this message]
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=87wq9wit9j.fsf@nicolasgoaziou.fr \
    --to=mail@nicolasgoaziou.fr \
    --cc=emacs-orgmode@gnu.org \
    --cc=theonewiththeevillook@yahoo.fr \
    /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).