Re: [O] Exporter question

2013-02-27 Thread Eric S Fraga
Aaron Ecay  writes:

> 2013ko otsailak 26an, Bastien-ek idatzi zuen:
>> (Er.. org-toc.el should be trashed, it's 99% obsolete.)
>
> It is?  I like its functionality and don’t know of any replacement...

You could try speedbar instead which might give you most (some?
definitely no column views in speedbar) of the functionality?  Depends
on what you used, of course.  Speedbar understands org structure
(headline based trees).

There's always org-goto (C-c C-j, which I think means the command should
have been org-jump but there you are...) as well.

-- 
: Eric S Fraga, GnuPG: 0xC89193D8FFFCF67D
: in Emacs 24.3.50.1 and Org release_7.9.3f-1285-g6cc600




Re: [O] Exporter question

2013-02-27 Thread Bastien
Nicolas Goaziou  writes:

> Done.
>
> Node property is ALT_TITLE and function is
> `org-export-get-alt-title'.

Thanks!

-- 
 Bastien



Re: [O] Exporter question

2013-02-26 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> Hi Nicolas,
>
> Nicolas Goaziou  writes:
>
>> Has it to be an export only property? I mean, it could be used in
>> a library like org-toc.el.
>
> (Er.. org-toc.el should be trashed, it's 99% obsolete.)
>
>> Also EXPORT_KEYWORD prefix is mostly used when there is a global
>> #+KEYWORD: available. There is no #+ALT_TITLE: (yet?).
>>
>> So, what about ALT_TITLE instead?
>
> I like it better, yes.

Done.

Node property is ALT_TITLE and function is `org-export-get-alt-title'.


Regards,

-- 
Nicolas Goaziou



Re: [O] Exporter question

2013-02-26 Thread Aaron Ecay
2013ko otsailak 26an, Bastien-ek idatzi zuen:
> (Er.. org-toc.el should be trashed, it's 99% obsolete.)

It is?  I like its functionality and don’t know of any replacement...

-- 
Aaron Ecay



Re: [O] Exporter question

2013-02-26 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> Has it to be an export only property? I mean, it could be used in
> a library like org-toc.el.

(Er.. org-toc.el should be trashed, it's 99% obsolete.)

> Also EXPORT_KEYWORD prefix is mostly used when there is a global
> #+KEYWORD: available. There is no #+ALT_TITLE: (yet?).
>
> So, what about ALT_TITLE instead?

I like it better, yes.

-- 
 Bastien



Re: [O] Exporter question

2013-02-25 Thread Nicolas Goaziou
Hello,

Bastien  writes:

> Carsten Dominik  writes:
>
>> I am curious why you chose the name "optional_title" for the
>> property?  Why not, for example "TOC_TITLE" or something like this?
>
> I suggest EXPORT_ALT_TITLE instead.
>
> The EXPORT_ prefix seems more consistent with EXPORT_TITLE,
> and ALT sounds clearer (and short enough) to me.

Has it to be an export only property? I mean, it could be used in
a library like org-toc.el.

Also EXPORT_KEYWORD prefix is mostly used when there is a global
#+KEYWORD: available. There is no #+ALT_TITLE: (yet?).

So, what about ALT_TITLE instead?


Regards,

-- 
Nicolas Goaziou



Re: [O] Exporter question

2013-02-24 Thread Bastien
Carsten Dominik  writes:

> I am curious why you chose the name "optional_title" for the
> property?  Why not, for example "TOC_TITLE" or something like this?

I suggest EXPORT_ALT_TITLE instead.

The EXPORT_ prefix seems more consistent with EXPORT_TITLE,
and ALT sounds clearer (and short enough) to me.

(I first thought TITLE was a bit confusing: IIRC, EXPORT_TITLE
was first introduced for replacing the real title of the doc when
exporting only one subtree... but "the title of a headline" is
okay, so let's stick to TITLE.)

-- 
 Bastien



Re: [O] Exporter question

2013-02-24 Thread Carsten Dominik

On 24.2.2013, at 15:00, Nicolas Goaziou  wrote:

> Carsten Dominik  writes:
> 
>> I am curious why you chose the name "optional_title" for the property?
>> Why not, for example "TOC_TITLE" or something like this?
> 
> See http://permalink.gmane.org/gmane.emacs.orgmode/62694

Ah, I see.  Indeed, there are more uses for such a title than just the toc, so 
I think I agree with Tom.

- Carsten

> 
> I don't mind changing the name of the property, if needed.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou




Re: [O] Exporter question

2013-02-24 Thread Nicolas Goaziou
Carsten Dominik  writes:

> I am curious why you chose the name "optional_title" for the property?
> Why not, for example "TOC_TITLE" or something like this?

See http://permalink.gmane.org/gmane.emacs.orgmode/62694

I don't mind changing the name of the property, if needed.


Regards,

-- 
Nicolas Goaziou



Re: [O] Exporter question

2013-02-24 Thread Carsten Dominik
Hi Nicolas,

I am curious why you chose the name "optional_title" for the property?  Why 
not, for example "TOC_TITLE" or something like this?

- Carsten

On 24.2.2013, at 09:55, Nicolas Goaziou  wrote:

> Hello,
> 
> Carsten Dominik  writes:
> 
>> On 12.2.2013, at 20:46, Nicolas Goaziou  wrote:
>> 
>>> Hello,
>>> 
>>> "Dominik, Carsten"  writes:
>>> 
 In a file with some time stamps in headlines, is it still possible to
 get rid of them only for the Table of Contents, but to leave them in
 the headlines themselves?
>>> 
>>> Good question. You can probably use filters, but it isn't a trivial
>>> task, depending on the back-end.
>> 
>> I have now succeeded using CSS, but this is for HTML only, of course.
>> 
>> 
>>> 
>>> How did you do it in the previous exporter?
>> 
>> 
>> There used to be a variable org-export-remove-timestamps-from-toc, and
>> a function org-export-cleanup-toc-line which provided this
>> functionality. It is actually somewhat useful functionality. It there
>> a filter that is applied only to toc lines?
> 
> Now, almost all back-ends providing a TOC functionality allow to
> add :OPTIONAL_TITLE: property in an headline to set its corresponding
> entry in the table of contents.
> 
> Do you think it's still necessary to provide an equivalent for
> `org-export-remove-timestamps-from-toc'? It's only a matter of copying
> the headline title in the property, without timestamp.
> 
> 
> Regards,
> 
> -- 
> Nicolas Goaziou




Re: [O] Exporter question

2013-02-24 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> If it has to be implemented, it's far easier to remove objects from
> parsed data (e.g. in `org-export-get-optional-title').

Got it, thanks.

>> `org-export-with-timestamps-in-toc', if nil, would use this arg;
>> but users could remove anything from the headlines (and the TOC), 
>> not just from the TOC.
>>
>> And `org-export-with-timestamps' could be set to 'from-toc or
>> 'from-headline.  And we could extend `org-export-with-tags'
>> similarily.
>>
>> (I think `org-export-with-timestamps-in-toc' is better than
>> `org-export-remove-timestamps-from-toc' because `org-export-with'
>> is more widely used for the same purposes.)
>>
>> Just a suggestion for combining backward compatibility and adding
>> some flexibility thanks for the new engine.
>
> I have a patch ready with `org-export-with-timestamps-in-toc' variable,
> but as I was writing it, I realized it might not be necessary to apply
> it. I'd like to avoid over-engineering as much as possible, hence the
> question.

My concern is this: it would be nice to provide a simple way to get
rid of _anything_ (user defined) in headlines and TOC titles.

Actually, the org-export-with-* family contains two categories of
variables: those who are relevant for anything in the buffer, those
who are relevant for the headlines only.  Like these ones:

org-export-with-priority
org-export-with-statistics-cookies
org-export-with-todo-keywords
org-export-with-tags
org-export-with-section-numbers

I set aside the last one, which does not impact the text of the
headline itself, but the way it looks in the target format.

My suggestion is to get rid of these four headlines-only
org-export-with-* variable, and to replace them with

org-export-headline-format
org-export-headline-in-toc-format

with formatters to tell whether to include the TODO keyword, the tags,
the priority cookie, the statistics cookie, the headline text, etc.

And two generic options

org-export-headline-trim-regexp
org-export-headline-in-toc-trim-regexp

which the user can set to whatever he wants.

I think a formatting string for the headline is good as it is quite
intuitive for a vast majority of users.  And the -trim-regexp options
would be flexible enough to remove anything from the headlines.

Please *don't* implement this :)  I just need your gut feeling 
about org-export-headline-format as a formatting string, and if you
think it might be a good idea, I'm willing to help implementing it
(as I know it will change quite a lot of things in the machinery.)

Thanks,

-- 
 Bastien



Re: [O] Exporter question

2013-02-24 Thread Nicolas Goaziou
Bastien  writes:

>> Do you think it's still necessary to provide an equivalent for
>> `org-export-remove-timestamps-from-toc'? It's only a matter of copying
>> the headline title in the property, without timestamp.
>
> org-html|latex-format-headline-function allow these arguments:
>
> TODO  the todo keyword (string or nil).
> TODO-TYPE the type of todo (symbol: `todo', `done', nil)
> PRIORITY  the priority of the headline (integer or nil)
> TEXT  the main headline text (string).
> TAGS  the tags as a list of strings (list of strings or nil).
>
> Why not having another TRIM-REGEXP argument to selectively trim
> the content matched by a regexp against TEXT?

Because it would have to mach TEXT against destination code, so it would
be fragile (i.e. if you modify how timestamps are transcoded, you have
to modify this regexp accordingly).

If it has to be implemented, it's far easier to remove objects from
parsed data (e.g. in `org-export-get-optional-title').

> `org-export-with-timestamps-in-toc', if nil, would use this arg;
> but users could remove anything from the headlines (and the TOC), 
> not just from the TOC.
>
> And `org-export-with-timestamps' could be set to 'from-toc or
> 'from-headline.  And we could extend `org-export-with-tags'
> similarily.
>
> (I think `org-export-with-timestamps-in-toc' is better than
> `org-export-remove-timestamps-from-toc' because `org-export-with'
> is more widely used for the same purposes.)
>
> Just a suggestion for combining backward compatibility and adding
> some flexibility thanks for the new engine.

I have a patch ready with `org-export-with-timestamps-in-toc' variable,
but as I was writing it, I realized it might not be necessary to apply
it. I'd like to avoid over-engineering as much as possible, hence the
question.


Regards,

-- 
Nicolas Goaziou



Re: [O] Exporter question

2013-02-24 Thread Bastien
Hi Nicolas,

Nicolas Goaziou  writes:

> Now, almost all back-ends providing a TOC functionality allow to
> add :OPTIONAL_TITLE: property in an headline to set its corresponding
> entry in the table of contents.

Thanks for implementing this!

> Do you think it's still necessary to provide an equivalent for
> `org-export-remove-timestamps-from-toc'? It's only a matter of copying
> the headline title in the property, without timestamp.

org-html|latex-format-headline-function allow these arguments:

TODO  the todo keyword (string or nil).
TODO-TYPE the type of todo (symbol: `todo', `done', nil)
PRIORITY  the priority of the headline (integer or nil)
TEXT  the main headline text (string).
TAGS  the tags as a list of strings (list of strings or nil).

Why not having another TRIM-REGEXP argument to selectively trim
the content matched by a regexp against TEXT?

`org-export-with-timestamps-in-toc', if nil, would use this arg;
but users could remove anything from the headlines (and the TOC), 
not just from the TOC.

And `org-export-with-timestamps' could be set to 'from-toc or
'from-headline.  And we could extend `org-export-with-tags'
similarily.

(I think `org-export-with-timestamps-in-toc' is better than
`org-export-remove-timestamps-from-toc' because `org-export-with'
is more widely used for the same purposes.)

Just a suggestion for combining backward compatibility and adding
some flexibility thanks for the new engine.

Let me know what you think,

-- 
 Bastien



Re: [O] Exporter question

2013-02-24 Thread Nicolas Goaziou
Hello,

Carsten Dominik  writes:

> On 12.2.2013, at 20:46, Nicolas Goaziou  wrote:
>
>> Hello,
>> 
>> "Dominik, Carsten"  writes:
>> 
>>> In a file with some time stamps in headlines, is it still possible to
>>> get rid of them only for the Table of Contents, but to leave them in
>>> the headlines themselves?
>> 
>> Good question. You can probably use filters, but it isn't a trivial
>> task, depending on the back-end.
>
> I have now succeeded using CSS, but this is for HTML only, of course.
>
>
>> 
>> How did you do it in the previous exporter?
>
>
> There used to be a variable org-export-remove-timestamps-from-toc, and
> a function org-export-cleanup-toc-line which provided this
> functionality. It is actually somewhat useful functionality. It there
> a filter that is applied only to toc lines?

Now, almost all back-ends providing a TOC functionality allow to
add :OPTIONAL_TITLE: property in an headline to set its corresponding
entry in the table of contents.

Do you think it's still necessary to provide an equivalent for
`org-export-remove-timestamps-from-toc'? It's only a matter of copying
the headline title in the property, without timestamp.


Regards,

-- 
Nicolas Goaziou



Re: [O] Exporter question

2013-02-12 Thread Nicolas Goaziou
Carsten Dominik  writes:

> There used to be a variable org-export-remove-timestamps-from-toc, and
> a function org-export-cleanup-toc-line which provided this
> functionality. It is actually somewhat useful functionality. It there
> a filter that is applied only to toc lines?

Not a dedicated filter. But you can use `final-filter', which is applied
to the whole output.

Anyway, I add this feature on my TODO list.


Regards,

-- 
Nicolas Goaziou



Re: [O] Exporter question

2013-02-12 Thread Carsten Dominik

On 12.2.2013, at 20:46, Nicolas Goaziou  wrote:

> Hello,
> 
> "Dominik, Carsten"  writes:
> 
>> In a file with some time stamps in headlines, is it still possible to
>> get rid of them only for the Table of Contents, but to leave them in
>> the headlines themselves?
> 
> Good question. You can probably use filters, but it isn't a trivial
> task, depending on the back-end.

I have now succeeded using CSS, but this is for HTML only, of course.


> 
> How did you do it in the previous exporter?


There used to be a variable org-export-remove-timestamps-from-toc, and a 
function org-export-cleanup-toc-line which provided this functionality.  It is 
actually somewhat useful functionality.  It there a filter that is applied only 
to toc lines?

Regards

- Carsten




Re: [O] Exporter question

2013-02-12 Thread Nicolas Goaziou
Hello,

"Dominik, Carsten"  writes:

> In a file with some time stamps in headlines, is it still possible to
> get rid of them only for the Table of Contents, but to leave them in
> the headlines themselves?

Good question. You can probably use filters, but it isn't a trivial
task, depending on the back-end.

How did you do it in the previous exporter?


Regards,

-- 
Nicolas Goaziou