From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabrice Popineau Subject: Re: Problem with org-indent-block Date: Fri, 12 Sep 2014 14:39:24 +0200 Message-ID: References: <877g19qnq5.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b4187736da4150502dd9468 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSQ8h-0006Jb-QZ for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 08:39:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XSQ8f-0006nf-GH for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 08:39:47 -0400 Received: from mail-oa0-x230.google.com ([2607:f8b0:4003:c02::230]:45971) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XSQ8f-0006nZ-Ax for emacs-orgmode@gnu.org; Fri, 12 Sep 2014 08:39:45 -0400 Received: by mail-oa0-f48.google.com with SMTP id g18so437242oah.7 for ; Fri, 12 Sep 2014 05:39:44 -0700 (PDT) In-Reply-To: <877g19qnq5.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Fabrice Popineau , "emacs-orgmode@gnu.org" --047d7b4187736da4150502dd9468 Content-Type: text/plain; charset=UTF-8 Thanks for your hint. The problem was not in in org.el:org-indent-block but in org.el:org-hide-block-toggle. This function should toggle special-block blocks too, else it barfs on them. In my setup, when an org file is restored by desktop.el, global visibility is set, which triggers calls to org-hide-block-all. Fabrice 2014-09-12 9:53 GMT+02:00 Nicolas Goaziou : > Hello, > > Fabrice Popineau writes: > > > Recently, I started to get problems with org-indent-block returning > errors > > "Not at a block". > > Unfortunately, this is happening while restarting emacs, and I have no > idea > > about how to debug it. > > AFAICT, nothing in the code base calls `org-indent-block' automatically. > Out of curiosity, is there something in your setup doing this? > > > It would be nice if somehow this function could give the file and the > point > > in the file where the error is happening. > > Any idea on how to achieve this? > > It is an interactive function, so the user is expected to know where he > called it. Anyway, you could modify function in "org.el" to use: > > (user-error "Not at a block in %s, line %s" (buffer-name) > (org-current-line)) > > It will probably help understanding the issue. > > > Regards, > > -- > Nicolas Goaziou > --047d7b4187736da4150502dd9468 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for your hint.
The problem was not in in org.el= :org-indent-block but in org.el:org-hide-block-toggle.
This funct= ion should toggle special-block blocks too, else it barfs on them.
In m= y setup, when an org file is restored by desktop.el, global visibility is s= et, which triggers
calls to org-hide-block-all.
<= br>
Fabrice

2014-09-12 9:53 GMT+02:00 Nicolas Goaziou <mail@nico= lasgoaziou.fr>:
Hello,

Fabrice Popineau <fabrice.= popineau@gmail.com> writes:

> Recently, I started to get problems with org-indent-block returning er= rors
> "Not at a block".
> Unfortunately, this is happening while restarting emacs, and I have no= idea
> about how to debug it.

AFAICT, nothing in the code base calls `org-indent-block' automa= tically.
Out of curiosity, is there something in your setup doing this?

> It would be nice if somehow this function could give the file and the = point
> in the file where the error is happening.
> Any idea on how to achieve this?

It is an interactive function, so the user is expected to know where= he
called it. Anyway, you could modify function in "org.el" to use:<= br>
=C2=A0 (user-error "Not at a block in %s, line %s" (buffer-name) = (org-current-line))

It will probably help understanding the issue.


Regards,

--
Nicolas Goaziou

--047d7b4187736da4150502dd9468--