From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: Re: Args out of range when creating TODOs Date: Thu, 25 Oct 2007 12:57:51 +0200 Message-ID: References: <87bqany365.fsf@baldur.tsdh.de> <87r6jjlbp1.fsf@bzg.ath.cx> <87myu7wmk2.fsf@baldur.tsdh.de> <87ejfjfo0i.fsf@bzg.ath.cx> <87ejfjwkwa.fsf@baldur.tsdh.de> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Il0Pa-00036s-Sa for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 06:58:02 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Il0PZ-000351-L9 for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 06:58:02 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Il0PZ-00034K-6T for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 06:58:01 -0400 Received: from ug-out-1314.google.com ([66.249.92.175]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Il0PY-0006Qp-RR for emacs-orgmode@gnu.org; Thu, 25 Oct 2007 06:58:01 -0400 Received: by ug-out-1314.google.com with SMTP id a2so538228ugf for ; Thu, 25 Oct 2007 03:57:59 -0700 (PDT) In-Reply-To: <87ejfjwkwa.fsf@baldur.tsdh.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Tassilo Horn Cc: emacs-orgmode@gnu.org 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)))