[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] Parser - which values are possible for `archivedp'?
From: |
Thorsten Jolitz |
Subject: |
Re: [O] Parser - which values are possible for `archivedp'? |
Date: |
Tue, 04 Mar 2014 15:58:31 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) |
Jonathan Leech-Pepin <address@hidden> writes:
> Hello,
>
> On 4 March 2014 09:47, Thorsten Jolitz <address@hidden> wrote:
>
>
> Nick Dokos <address@hidden> writes:
>
> > Thorsten Jolitz <address@hidden> writes:
> >
> >> Hi List,
> >>
> >> the name of headline attribute `archivedp' suggests its just a
> boolean
> >> nil/t variable, but in parse trees I see e.g. a list as value
> >>
> >> ,-----------------------
> >> | :archivedp ("ARCHIVE")
> >> `-----------------------
> >>
> >> and I vaguely remember that I have seen different symbols as
> values of
> >> this attribute too.
> >>
> >> So what do I have to expect as values here? A list of strings
> or nil? Or
> >> something else too? Whatever is defined in
> >>
> >> ,---------------------------------------------------
> >> | org-archive-tag is a variable defined in `org.el'.
> >> | Its value is "ARCHIVE"
> >> `---------------------------------------------------
> >>
> >> ?
> >>
> >> PS
> >>
> >> If the tag is just a string like in this case, why is it shown
> as
> >> list in the parse tree?
> >
> > It is set like this
> > (let
> > ...
> > (archivedp (member org-archive-tag tags))
> > ...)
> >
> > in org-element.el. It is effectively a boolean, but there is no
> > need to reduce the return value of ``member'' to t if it is
> non-nil:
> >
> > ,----
> > | member is a built-in function in `C source code'.
> > |
> > | (member ELT LIST)
> > |
> > | Return non-nil if ELT is an element of LIST. Comparison done
> with
> > | equal'.
> > `----
> >
> > So if non-nil, it will be a list of tags, starting with the
> value of
> > org-archive-tag. AFAICT, the rest of the tags can be arbitrary.
>
>
>
> ** Second Level 2 :tag:my:ARCHIVE:
>
>
> ,------------------------------------------------
> | :tags ("tag" "my") [...] :archivedp ("ARCHIVE")
> `------------------------------------------------
>
> Change the order of the tags so that Archive comes before the others
> and you get:
>
> ** Second level 2 :ARCHIVE:tag:my:
> :tags ("tag" "my") :archivedp ("ARCHIVE" "tag" "my")
A very useful feature of the `member' function in lisp programming, but
not that great in this case I would say ... why not use (car (member ...))?
Then its just a string, and the single value of interest.
--
cheers,
Thorsten