From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Berry Subject: Re: Version 7.5: C-c C-t fails with "args out of range" Date: Tue, 8 Mar 2011 23:16:28 -0800 Message-ID: References: <87sjuw973f.wl%dmaus@ictsoc.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=44978 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PxDdG-00026M-Gz for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 02:16:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PxDdF-0006ss-4e for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 02:16:30 -0500 Received: from mail-qw0-f41.google.com ([209.85.216.41]:56496) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PxDdF-0006sk-1N for emacs-orgmode@gnu.org; Wed, 09 Mar 2011 02:16:29 -0500 Received: by qwd7 with SMTP id 7so209781qwd.0 for ; Tue, 08 Mar 2011 23:16:28 -0800 (PST) In-Reply-To: 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: Carsten Dominik Cc: David Maus , emacs-orgmode@gnu.org On Tue, Mar 8, 2011 at 22:55, Carsten Dominik w= rote: > > On 9.3.2011, at 06:49, David Maus wrote: > >> At Tue, 8 Mar 2011 15:08:57 -0800, >> Josh Berry wrote: >>> >>> Hi list, >>> >>> I just upgraded from org-mode 7.4 to 7.5, and I can't set or change >>> TODO states at all with C-c C-t now; an args-out-of-range error gets >>> raised. =C2=A0I've tried doing a "make clean" in my org-mode checkout, = to >>> no avail. >>> >>> I'm running GNU emacs 23.2.1 on Mac OSX (in Aqua), installed via >>> Homebrew. =C2=A0Debugger backtrace is pasted below. >>> >>> [[BTW, please forgive me if this isn't a well-formed bug report; I'm >>> relatively new to Emacs and don't know Elisp. =C2=A0Just let me know if= you >>> need anything else.]] >> >> Just a fast comment: Couldn't this be a problem with the macro >> `org-with-wide-buffer'? >> >> #+begin_src emacs-lisp >> (defmacro org-with-wide-buffer (&rest body) >> =C2=A0"Execute body while temporarily widening the buffer." >> =C2=A0`(let ((beg (point-min)) (end (point-max)) (pos (point))) >> =C2=A0 =C2=A0 (prog2 >> =C2=A0 =C2=A0 =C2=A0 =C2=A0(widen) >> =C2=A0 =C2=A0 =C2=A0 =C2=A0,@body >> =C2=A0 =C2=A0 =C2=A0 (narrow-to-region beg end) >> =C2=A0 =C2=A0 =C2=A0 (goto-char pos)))) >> #+end_src > > This macro is indeed not written in a stable way and will > fail of the buffer gets modified with @body. > But Emacs already has save-restriction, so there is no > need to re-invent the wheel: > > (defmacro org-with-wide-buffer (&rest body) > =C2=A0"Execute body while temporarily widening the buffer." > =C2=A0`(save-excursion > =C2=A0 =C2=A0(save-restriction > =C2=A0 =C2=A0 =C2=A0 (widen) > =C2=A0 =C2=A0 =C2=A0 ,@body))) I just hacked your version of org-with-wide-buffer into my org-macs.el file, and it appears to fix the problem. Thanks! -- Josh