emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [RFC] The "c" Org macro


From: Carsten Dominik
Subject: Re: [O] [RFC] The "c" Org macro
Date: Tue, 9 May 2017 09:35:01 +0200

Hi,

I like the idea of these counters, and I have use-cases for them.

Here is a proposal for the manual entry

This macro implements custom counters by returning the number of times
the macro has been expanded so far while exporting the buffer.
You can create more than one counter using different @var{NAME} values.  If
@var{RESET} is non-empty, the specified counter is reset to the value
specified if it is a number, or 1 otherwise. You may leave @var{NAME}
empty to reset the default counter will be reset.

A question regarding the last sentence of this proposed manual entry:

is {{{c(,2)}}} allowed to reset the default counter?  I think is should be, but I have
not tested this.

Carsten

On Mon, May 8, 2017 at 6:52 PM, Nicolas Goaziou <address@hidden> wrote:
Hello,

Eric S Fraga <address@hidden> writes:

> On Monday,  8 May 2017 at 15:32, Dushyant Juneja wrote:
>> A very useful macro indeed!
>>
>> One suggestion: can this also be made to support nested headings. For instance:
>> * Part {{{c}}}
>> ** Part {{{c}}}.{{{c}}}
>> * Part {{{c}}}
>
> I think this is what separate counters will enable but also motivates
> need to be able to reset a counter (e.g. the sub-heading one in above
> example if it were to be used in the second part).

Good idea.

Here is an updated patch, in which one can write

  {{{c(sub,reset)}}}
  {{{c(sub, 5)}}}

or even, for the default macro

 {{{c(,reset)}}}
 {{{c(, 99)}}}

I find the manual entry a bit awkward. Suggestions welcome.

Regards,

--
Nicolas Goaziou


reply via email to

[Prev in Thread] Current Thread [Next in Thread]