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)))
_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode