emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Josh Berry <des@condordes.net>
To: Carsten Dominik <carsten.dominik@gmail.com>
Cc: David Maus <dmaus@ictsoc.de>, emacs-orgmode@gnu.org
Subject: Re: Version 7.5: C-c C-t <anything> fails with "args out of range"
Date: Tue, 8 Mar 2011 23:16:28 -0800	[thread overview]
Message-ID: <AANLkTingLw9vhtiW=c1kOqRZuDuh_oi0C9f+c0Y-BLou@mail.gmail.com> (raw)
In-Reply-To: <DE7FAA0F-91BB-4E46-82F6-44E3C2993B4C@gmail.com>

On Tue, Mar 8, 2011 at 22:55, Carsten Dominik <carsten.dominik@gmail.com> wrote:
>
> 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.  I'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.  Debugger 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.  Just 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)
>>  "Execute body while temporarily widening the buffer."
>>  `(let ((beg (point-min)) (end (point-max)) (pos (point)))
>>     (prog2
>>        (widen)
>>        ,@body
>>       (narrow-to-region beg end)
>>       (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)
>  "Execute body while temporarily widening the buffer."
>  `(save-excursion
>    (save-restriction
>       (widen)
>       ,@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

  reply	other threads:[~2011-03-09  7:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-08 23:08 Version 7.5: C-c C-t <anything> fails with "args out of range" Josh Berry
2011-03-08 23:25 ` Nick Dokos
2011-03-09  0:35   ` Josh Berry
2011-03-09  2:14     ` Nick Dokos
2011-03-09  3:11       ` Josh Berry
2011-03-09  5:49 ` David Maus
2011-03-09  6:55   ` Carsten Dominik
2011-03-09  7:16     ` Josh Berry [this message]
2011-03-09  9:57     ` Bastien
2011-03-09  9:59   ` Bastien

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='AANLkTingLw9vhtiW=c1kOqRZuDuh_oi0C9f+c0Y-BLou@mail.gmail.com' \
    --to=des@condordes.net \
    --cc=carsten.dominik@gmail.com \
    --cc=dmaus@ictsoc.de \
    --cc=emacs-orgmode@gnu.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).