emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: Tassilo Horn <tassilo@member.fsf.org>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: Args out of range when creating TODOs
Date: Thu, 25 Oct 2007 12:57:51 +0200	[thread overview]
Message-ID: <CAC08170-BBA7-4585-962D-95FE65CC5590@science.uva.nl> (raw)
In-Reply-To: <87ejfjwkwa.fsf@baldur.tsdh.de>

There is a lot of code happening between the moment of the match, and  
the
replacement.  So far none of this code seems to have had the effect of
changing the match data, I have been careful to avoid this.  However,
in your case it seems that some internal code does change it.

I believe the following patch should fix this, can you please try it?

- Carsten


--- org.el.orig	2007-10-25 12:45:25.000000000 +0200
+++ org.el	2007-10-25 12:45:38.000000000 +0200
@@ -13412,7 +13412,8 @@
        (if (looking-at outline-regexp) (goto-char (1- (match-end 0))))
        (or (looking-at (concat " +" org-todo-regexp " *"))
	  (looking-at " *"))
-      (let* ((startpos (line-beginning-position))
+      (let* ((match-data (match-data))
+	     (startpos (line-beginning-position))
	     (logging (save-match-data (org-entry-get nil "LOGGING" t)))
	     (org-log-done (org-parse-local-options logging 'org-log-done))
	     (org-log-repeat (org-parse-local-options logging 'org-log-repeat))
@@ -13496,6 +13497,7 @@
	      ;; fail silently
	      (message "TODO state change from %s to %s blocked" this state)
	      (throw 'exit nil))))
+	(store-match-data match-data)
	(replace-match next t t)
	(unless (pos-visible-in-window-p hl-pos)
	  (message "TODO state changed to %s" (org-trim next)))

  reply	other threads:[~2007-10-25 10:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-25  9:05 Args out of range when creating TODOs Tassilo Horn
2007-10-25  9:21 ` Carsten Dominik
2007-10-25  9:45   ` Tassilo Horn
2007-10-25 10:40 ` Bastien
2007-10-25  9:50   ` Tassilo Horn
2007-10-25 11:10     ` Bastien
2007-10-25 10:25       ` Tassilo Horn
2007-10-25 10:57         ` Carsten Dominik [this message]
2007-10-25 11:16           ` Tassilo Horn

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=CAC08170-BBA7-4585-962D-95FE65CC5590@science.uva.nl \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tassilo@member.fsf.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).