From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ishikawa Takaaki Subject: Re: org-tree-slide annoyance Date: Tue, 16 Jul 2013 12:09:34 +0900 Message-ID: References: <87a9lo6x3f.fsf@bye.fritz.box> <5E0B3901-A902-4F12-B636-2A4C2AA8D6BB@gmail.com> <87r4f0dk1n.fsf@bye.fritz.box> <8738rgey5q.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=047d7b86e39a75f06804e1984ead Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:39714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyvdy-0007lg-Sn for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 23:09:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uyvdw-00051Q-4Y for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 23:09:38 -0400 Received: from mail-pb0-x233.google.com ([2607:f8b0:400e:c01::233]:42533) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uyvdv-00051A-Pn for emacs-orgmode@gnu.org; Mon, 15 Jul 2013 23:09:36 -0400 Received: by mail-pb0-f51.google.com with SMTP id um15so182626pbc.38 for ; Mon, 15 Jul 2013 20:09:34 -0700 (PDT) In-Reply-To: <8738rgey5q.fsf@gmail.com> 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: Nick Dokos Cc: emacs-orgmode@gnu.org --047d7b86e39a75f06804e1984ead Content-Type: text/plain; charset=ISO-8859-1 Hi Henry, Thank you for using org-tree-slide and reporting the issue. Please use the following patch to avoid the error. PATCH: Replace the original code with ---- (defun ots-display-tree-with-narrow () "Show a tree with narrowing and also set a header at the head of slide." (goto-char (point-at-bol)) (when (ots-last-heading-position) (hide-subtree) ; support CONTENT (subtrees are shown) (org-show-entry) (show-children) (org-cycle-hide-drawers 'all) (org-narrow-to-subtree)) (setq display-tree-slide-string (if (equal org-tree-slide-modeline-display 'outside) (ots-count-slide (point)) "")) (when org-tree-slide-slide-in-effect (ots-slide-in org-tree-slide-slide-in-brank-lines)) (when org-tree-slide-header (ots-show-slide-header))) ---- This patch is a tentative code for checking behavior in your environments, but I think you will be able to open org files without heading. I'll update it again within a few days. Best, Takaaki 2013/7/15 Nick Dokos > henry atts writes: > > > Carsten Dominik writes: > > > >> On 15.7.2013, at 10:33, henry atts wrote: > >> > >>> I use org-tree-slide-mode by default with > >>> > >>> (add-hook 'org-mode-hook 'org-tree-slide-mode) > >>> > >>> This works kind of acceptable minus some minor annoyances. But one > thing > >>> makes it nearly unusuable. tree-slide rigidly expects at least one > >>> header. So if I open an org file without heading, or if I create a new > >>> one, I get an error message: > >>> > >>> File mode specification error: (error "before first heading") > >>> > >>> If I include a setup file with `#+SETUPFILE:', which of course has no > >>> headings in it, org-tree-slide stops working at all. > >> > >> > >> Hi Henry, > >> > >> you could wrap turning on of the mode into a function > >> that checks if there is a node, and if not, just add one. > >> > >> - Carsten > > > > Okay, but on the one hand this doesn't solve the problem with > > `SETUPFILE'. On the other hand what if I want an org file without any > > heading on purpose? Or otherwise asked is a file a `real' org file only > > if it has headings in it? > > > > No, I don't think so, but there are bugs (there was a bug in the latex > exporter once that required a heading at the beginning). I presume > Carsten's suggestion was as a workaround to a bug (although I might > have misinterpreted his comment). > > > You might say if you want some features of orgmode _and_ an org file > > without heading you can always use, say, text-mode and load orgstruct as > > a minor mode. Which does not solve the problem as well because with the > > org-tree-mode hook for orgmode it shows some strange behaviour equally. > > > > I like org-tree-mode but I think it does not play well with orgmode in > > some cases. And as far as I see it even is not in contrib. > > > > Yes, I went looking for it there and did not find it :-) So maybe you > can ping the author about the bug - s/he might even fix it, particularly > now that the package is being used by at least one other person! Or > contribute the fix yourself - if you like the package, then others might > too, so it might even end up in contrib at some point. > > -- > Nick > > > --047d7b86e39a75f06804e1984ead Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Hi Henry,

Thank you for using org-tree-= slide and reporting the issue.
Please use the following patch to = avoid the error.

PATCH:=A0
Replace the o= riginal code with
----
(defun ots-display-tree-with-narrow ()
= =A0 "Show a tree with narrowing and also set a header at the head of s= lide."
=A0 (goto-char (point-at-bol))
=A0 (when (o= ts-last-heading-position)
=A0 =A0 (hide-subtree) ; support CONTENT (subtrees are shown)
=A0 =A0 (org-show-ent= ry)
=A0 =A0 (show-children)
=A0 =A0 (org-cycle-hide-dra= wers 'all)
=A0 =A0 (org-narrow-to-subtree))
=A0 (setq display-tree-slid= e-string
(if (= equal org-tree-slide-modeline-display 'outside)
=A0 =A0(ots-count-slide (point))
=A0""))<= /div>
=A0 (when org-tree-slide-slide-in-effect
=A0 =A0 (ots-s= lide-in org-tree-slide-slide-in-brank-lines))
=A0 (when org-tree-= slide-header
=A0 =A0 (ots-show-slide-header)))
----

<= /div>
This patch is a tentative code for checking behavior in your envi= ronments,
but I think you will be able to open org files without = heading.
I'll update it again within a few days.

<= br>
Best,
Takaaki



2013/7/15 Nick Dokos <n= dokos@gmail.com>
henry atts <snd@online.de> writes:

> Carsten Dominik <carst= en.dominik@gmail.com> writes:
>
>> On 15.7.2013, at 10:33, henry atts <snd@online.de> wrote:
>>
>>> I use org-tree-slide-mode by default with
>>>
>>> =A0(add-hook 'org-mode-hook 'org-tree-slide-mode)
>>>
>>> This works kind of acceptable minus some minor annoyances. But= one thing
>>> makes it nearly unusuable. tree-slide rigidly expects at least= one
>>> header. So if I open an org file without heading, or if I crea= te a new
>>> one, I get an error message:
>>>
>>> File mode specification error: (error "before first headi= ng")
>>>
>>> If I include a setup file with `#+SETUPFILE:', which of co= urse has no
>>> headings in it, =A0org-tree-slide stops working at all.
>>
>>
>> Hi Henry,
>>
>> you could wrap turning on of the mode into a function
>> that checks if there is a node, and if not, just add one.
>>
>> - Carsten
>
> Okay, but on the one hand this doesn't solve the problem with
> `SETUPFILE'. On the other hand what if I want an org file without = any
> heading on purpose? Or otherwise asked is a file a `real' org file= only
> if it has headings in it?
>

No, I don't think so, but there are bugs (there was a bug in the = latex
exporter once that required a heading at the beginning). I presume
Carsten's suggestion was as a workaround to a bug (although I might
have misinterpreted his comment).

> You might say if you want some features of orgmode _and_ an org file > without heading you can always use, say, text-mode and load orgstruct = as
> a minor mode. Which does not solve the problem as well because with th= e
> org-tree-mode hook for orgmode it shows some strange behaviour equally= .
>
> I like org-tree-mode but I think it does not play well with orgmode in=
> some cases. And as far as I see it even is not in contrib.
>

Yes, I went looking for it there and did not find it :-) So maybe you=
can ping the author about the bug - s/he might even fix it, particularly now that the package is being used by at least one other person! Or
contribute the fix yourself - if you like the package, then others might too, so it might even end up in contrib at some point.

--
Nick



--047d7b86e39a75f06804e1984ead--