emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* why not auto-renumbering list ?
@ 2010-08-07 12:41 Nicolas Goaziou
  2010-08-09  6:56 ` Carsten Dominik
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2010-08-07 12:41 UTC (permalink / raw)
  To: Org Mode List

Hello,

I'm still into lists, and I'm wondering about the global usefulness of
`org-auto-renumber-ordered-lists', provided that:

- it isn't noticeably slower to renumber and fix a list than to simply
  fix its indentation;
- you can use [@start:num] to enforce a special numbering;
- some actions on a list will renumber it whatever the value of this
  variable is.

So, I'd like to hear about other users. Do you set this variable to
nil? If so, what is your use case?

If there's a need for decreasing numbers or numbers increasing by more
than one, I could add [@step:num] and [@start:num,@step:num] as
possibilities, but it looks a bit overkill to me.

Anyway, the idea behind this would be to:

- remove `org-maybe-renumber-ordered-list',
- remove `org-maybe-renumber-ordered-list-safe',
- remove this variable,
- rename `org-fix-bullet-type' to `org-fix-bullet',
- call `org-fix-bullet' unconditionally when acting on a list instead
  of having to decide if the function should renumber or simply fix
  indentation.

What do you think about it?
  
Regards,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-07 12:41 why not auto-renumbering list ? Nicolas Goaziou
@ 2010-08-09  6:56 ` Carsten Dominik
  2010-08-09 11:35   ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Carsten Dominik @ 2010-08-09  6:56 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

Hi Nicolas,


On Aug 7, 2010, at 2:41 PM, Nicolas Goaziou wrote:

> Hello,
>
> I'm still into lists,


First, my apologies that I have so far not found the time to test your
improved list implementation.  I think this is a far-reaching change,
which is why it needs careful testing before we apply it.
I really hope to get to this soon.

Have you had any testing feedback from anyone else so far?
Have you tested it in all the export backends?

> and I'm wondering about the global usefulness of
> `org-auto-renumber-ordered-lists', provided that:
>
> - it isn't noticeably slower to renumber and fix a list than to simply
>  fix its indentation;
> - you can use [@start:num] to enforce a special numbering;
> - some actions on a list will renumber it whatever the value of this
>  variable is.
>
> So, I'd like to hear about other users. Do you set this variable to
> nil? If so, what is your use case?

I don't think anyone sets this to nil.  But there is a use case for
this, if someone wants some strange specific numbering,
then it might be useful to allow turning it off.  There is no harm
in having this possibility.

> If there's a need for decreasing numbers or numbers increasing by more
> than one, I could add [@step:num] and [@start:num,@step:num] as
> possibilities, but it looks a bit overkill to me.

To me as well.

>
> Anyway, the idea behind this would be to:
>
> - remove `org-maybe-renumber-ordered-list',
> - remove `org-maybe-renumber-ordered-list-safe',
> - remove this variable,
> - rename `org-fix-bullet-type' to `org-fix-bullet',
> - call `org-fix-bullet' unconditionally when acting on a list instead
>  of having to decide if the function should renumber or simply fix
>  indentation.

While this sounds reasonable - it also unnecessary to me.
Why fix something that works?

- Carsten

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-09  6:56 ` Carsten Dominik
@ 2010-08-09 11:35   ` Nicolas Goaziou
  2010-08-09 12:35     ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2010-08-09 11:35 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode List

Hello,
>>>>> Carsten Dominik writes:

> First, my apologies that I have so far not found the time to test
> your improved list implementation.

No worries, I needed that time anyways, as some internals have
undergone big changes since then. I particularly think about the now
(hopefully) working indent/outdent code, that was quite hairy to
implement.

> Have you had any testing feedback from anyone else so far?

Not yet, unfortunately.

> Have you tested it in all the export backends?

Yes, on all major backends: HTML, LaTeX, ASCII and DocBook.

Well, to be honest, in the case of DocBook, I only looked at the xml
produced, and it seems valid to me. For this exporter, changes were
very similar to those applied to the HTML one anyways.

> I don't think anyone sets this to nil.  But there is a use case for
> this, if someone wants some strange specific numbering,
> then it might be useful to allow turning it off.  There is no harm
> in having this possibility.

There's always (in my branch):

2. [@start:2] I like
3. prime numbered
5. [@start:5] lists


It sure is heavy on syntax, but benefit is that every exporter will
reflect that unusual numbering.
   
> While this sounds reasonable - it also unnecessary to me.
> Why fix something that works?

Because it is not consistent in the current implementation. Please
have this test:

Type the following list in an Org buffer, with
`org-auto-renumber-ordered-lists' set to nil.

10. this is
    1. first sub-item
    2. second sub-item
11. a test
12. list


Now, outdent first sub-item: top-level list gets renumbered, no matter
what. Why? Worse: indentation of second sub-item is now wrong. Undo
the indentation. Now cycle bullets of top level list once, to have
parenthesis instead of dot after the number. There goes the numbering.

And, again, exporters, except ASCII, will not take into consideration
hand-numbered lists. This is not consistent either.

As an intermediate solution, I can make
`org-auto-renumber-ordered-lists' really block all renumbering attempt
while still keeping indentation correct. It won't solve the exporter
problem, though.

I honestly don't think hand-numbering lists is a solution. I know Org
is about simplicity, but [@start:xx] enforced numbers definitely fare
better here. And use cases are, in my opinion, so infrequent that it
will not cripple Org simplicity either.

Regards,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-09 11:35   ` Nicolas Goaziou
@ 2010-08-09 12:35     ` Nicolas Goaziou
  2010-08-10  8:47       ` Andrew Swann
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2010-08-09 12:35 UTC (permalink / raw)
  To: Carsten Dominik; +Cc: Org Mode List

> 2. [@start:2] I like
> 3. prime numbered
> 5. [@start:5] lists

> It sure is heavy on syntax, but benefit is that every exporter will
> reflect that unusual numbering.

Thinking about it, we could even lighten [@start:xx] syntax by making
it [@num]. It would also make more sense since it can be used
repeatedly in a list. Thus:

6. [@6] I like
28. [@28] perfect numbered
496. [@496] lists


Regards,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-09 12:35     ` Nicolas Goaziou
@ 2010-08-10  8:47       ` Andrew Swann
  2010-08-10  9:46         ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Swann @ 2010-08-10  8:47 UTC (permalink / raw)
  To: Org Mode List

On 9/8/10 14:35 , "Nicolas Goaziou" <n.goaziou@gmail.com> wrote:

[...]
> Thinking about it, we could even lighten [@start:xx] syntax by making
> it [@num]. It would also make more sense since it can be used
> repeatedly in a list. Thus:
> 
> 6. [@6] I like
> 28. [@28] perfect numbered
> 496. [@496] lists

This is the nicest syntax so far.

I have a related but slightly off topic question that arose when setting up
org versions of Danish course homepages.  How do I get something like

2. kvartal

(meaning 2nd quarter) on a line on its own that is *not* treated as a list
(and thus renumbered on publication) ?

Thanks for any help

Andrew

-- 
Andrew Swann     swann@imada.sdu.dk     http://www.imada.sdu.dk/~swann
Department of Mathematics and Computer Science,      Tel +45 6550 2354
and CP3-Origins, University of Southern Denmark,    Dept +45 6550 2387
Campusvej 55, DK-5230 Odense M, Denmark              Fax +45 6550 2325

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-10  8:47       ` Andrew Swann
@ 2010-08-10  9:46         ` Nicolas Goaziou
  2010-08-10 11:18           ` Andrew Swann
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2010-08-10  9:46 UTC (permalink / raw)
  To: Andrew Swann; +Cc: Org Mode List

Hello,

>>>>> Andrew Swann writes:

> I have a related but slightly off topic question that arose when setting up
> org versions of Danish course homepages.  How do I get something like

> 2. kvartal

> (meaning 2nd quarter) on a line on its own that is *not* treated as a list
> (and thus renumbered on publication) ?

You can set `org-plain-list-ordered-item-terminator' to ?). Thus, only
ordered lists with a parenthesis are allowed, and your line will not
be treated as a list item anymore.

Regards,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-10  9:46         ` Nicolas Goaziou
@ 2010-08-10 11:18           ` Andrew Swann
  2010-08-10 12:32             ` Nicolas Goaziou
  0 siblings, 1 reply; 9+ messages in thread
From: Andrew Swann @ 2010-08-10 11:18 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List


On 10/8/10 11:46 , "Nicolas Goaziou" <n.goaziou@gmail.com> wrote:

> Hello,
> 
>>>>>> Andrew Swann writes:
> 
>> I have a related but slightly off topic question that arose when setting up
>> org versions of Danish course homepages.  How do I get something like
> 
>> 2. kvartal
> 
>> (meaning 2nd quarter) on a line on its own that is *not* treated as a list
>> (and thus renumbered on publication) ?
> 
> You can set `org-plain-list-ordered-item-terminator' to ?). Thus, only
> ordered lists with a parenthesis are allowed, and your line will not
> be treated as a list item anymore.

Many thanks for this suggestion.  It is certainly useful.  Is there a local
solution that could be used just around this line?  It would be nice if one
could escape the period.

Andrew

-- 
Andrew Swann     swann@imada.sdu.dk     http://www.imada.sdu.dk/~swann
Department of Mathematics and Computer Science,      Tel +45 6550 2354
and CP3-Origins, University of Southern Denmark,    Dept +45 6550 2387
Campusvej 55, DK-5230 Odense M, Denmark              Fax +45 6550 2325

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-10 11:18           ` Andrew Swann
@ 2010-08-10 12:32             ` Nicolas Goaziou
  2010-08-11  7:43               ` Andrew Swann
  0 siblings, 1 reply; 9+ messages in thread
From: Nicolas Goaziou @ 2010-08-10 12:32 UTC (permalink / raw)
  To: Andrew Swann; +Cc: Org Mode List

>>>>> Andrew Swann writes:

> Many thanks for this suggestion.  It is certainly useful.  Is there a local
> solution that could be used just around this line?  It would be nice if one
> could escape the period.

Enforce numbering to 2 with [@start:2]. It will still be treated as a
list, but it won't be renumbered.

Otherwise, if this isn't at column 0, you can insert a non-breaking
space (C-q 240) somewhere in front of your item. Org will not
recognize a list, and it will be invisible when exporting.

HTH,

-- Nicolas

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: why not auto-renumbering list ?
  2010-08-10 12:32             ` Nicolas Goaziou
@ 2010-08-11  7:43               ` Andrew Swann
  0 siblings, 0 replies; 9+ messages in thread
From: Andrew Swann @ 2010-08-11  7:43 UTC (permalink / raw)
  To: Nicolas Goaziou; +Cc: Org Mode List

On 10/8/10 14:32 , "Nicolas Goaziou" <n.goaziou@gmail.com> wrote:

>>>>>> Andrew Swann writes:
> 
>> Many thanks for this suggestion.  It is certainly useful.  Is there a local
>> solution that could be used just around this line?  It would be nice if one
>> could escape the period.
> 
> Enforce numbering to 2 with [@start:2]. It will still be treated as a
> list, but it won't be renumbered.
> 
> Otherwise, if this isn't at column 0, you can insert a non-breaking
> space (C-q 240) somewhere in front of your item. Org will not
> recognize a list, and it will be invisible when exporting.

Aha! The C-q 240 non-breaking space is the key.  With the 2. at column 0, I
can put this immediately after the period and the text is treated as text
rather than list item.  Excellent.

Many thanks

Andrew

-- 
Andrew Swann     swann@imada.sdu.dk     http://www.imada.sdu.dk/~swann
Department of Mathematics and Computer Science,      Tel +45 6550 2354
and CP3-Origins, University of Southern Denmark,    Dept +45 6550 2387
Campusvej 55, DK-5230 Odense M, Denmark              Fax +45 6550 2325

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2010-08-11  7:44 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-07 12:41 why not auto-renumbering list ? Nicolas Goaziou
2010-08-09  6:56 ` Carsten Dominik
2010-08-09 11:35   ` Nicolas Goaziou
2010-08-09 12:35     ` Nicolas Goaziou
2010-08-10  8:47       ` Andrew Swann
2010-08-10  9:46         ` Nicolas Goaziou
2010-08-10 11:18           ` Andrew Swann
2010-08-10 12:32             ` Nicolas Goaziou
2010-08-11  7:43               ` Andrew Swann

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).