Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2011-01-12 Thread Nathaniel Flath
Updated patch attached.

Thanks,
Nathaniel Flath

On Mon, Dec 20, 2010 at 10:25 AM, Nicolas Goaziou  wrote:
> Hello,
>
>> Nathaniel Flath writes:
>
>> Sory for the long delay - I got caught up in other work. A
>> patchaddressing the sisues brought up is attached.
>
> I've had a look at your patch.
>
> I think the modifications to HTML and DocBook exporters are nice. It
> could be possible to do the same thing in LaTeX, but it would require
> yet another package (enumitem) by default. Anyway, here are the code
> comments :
>
> - in your patch, you should try to list modifications to the
>  functions, and which functions were created. For example :
>
>  * org-list.el (org-alphabetical-lists): new variable
>  (org-cycle-list-bullet): added "A)" "a)" "A." and "a." to the list
>  of bullets in cycle. None of them is allowed in a description list.
>
> - The "yes" at the beginning of org-docbook.el should be removed
>
> - I advise against using (org-next-item) programmatically. It means
>  you compute the structure associated to the list for each item in
>  the list. I left a note about this circa line 847 in org-list.el
>
> - There's a bug with the following situation :
>
>  A) test
>  B) tersi
>  C) teirsu
>  D) tersiu
>  E) tesiu
>  F) teisru
>  G) etisu
>     - sub-item 1
>     - sub-item 2
>     - sub-item 3
>     - sub-item 4
>  H) tesinu
>  I) tesinru
>  J) etnrsiu
>  K) tesriun
>  L) etnsiu
>  M) estinu
>  N) etsniu
>  O) etsinu
>  P) tesnu
>  Q) etsinu
>  R) etsiun
>  S) etsnriu
>  T) etsnriu
>  U) etsinu
>  V) etsiu
>  W) etinrsu
>  X) last item
>
>  If you outdent sub-items 2 to 4 at the same time (with a region),
>  bullet of the last item will become "AA)" and will not be recognized
>  as a list item anymore.
>
> - There's also a bug with counters:
>
>  * [0/0] Counter
>
>    A. [X] first box
>    B. [X] second box
>
>  These boxes are not counted when bullets are literals (try C-c #).
>
>
> HTH,
>
> Regards,
>
> -- Nicolas
>


0001-Added-support-for-alphabetical-patches-to-org-list.patch
Description: Binary data
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-12-20 Thread Nicolas Goaziou
Hello,

> Nathaniel Flath writes:

> Sory for the long delay - I got caught up in other work. A
> patchaddressing the sisues brought up is attached.

I've had a look at your patch.

I think the modifications to HTML and DocBook exporters are nice. It
could be possible to do the same thing in LaTeX, but it would require
yet another package (enumitem) by default. Anyway, here are the code
comments :

- in your patch, you should try to list modifications to the
  functions, and which functions were created. For example :

  * org-list.el (org-alphabetical-lists): new variable
  (org-cycle-list-bullet): added "A)" "a)" "A." and "a." to the list
  of bullets in cycle. None of them is allowed in a description list.

- The "yes" at the beginning of org-docbook.el should be removed

- I advise against using (org-next-item) programmatically. It means
  you compute the structure associated to the list for each item in
  the list. I left a note about this circa line 847 in org-list.el

- There's a bug with the following situation :

  A) test
  B) tersi
  C) teirsu
  D) tersiu
  E) tesiu
  F) teisru
  G) etisu
 - sub-item 1
 - sub-item 2
 - sub-item 3
 - sub-item 4
  H) tesinu
  I) tesinru
  J) etnrsiu
  K) tesriun
  L) etnsiu
  M) estinu
  N) etsniu
  O) etsinu
  P) tesnu
  Q) etsinu
  R) etsiun
  S) etsnriu
  T) etsnriu
  U) etsinu
  V) etsiu
  W) etinrsu
  X) last item

  If you outdent sub-items 2 to 4 at the same time (with a region),
  bullet of the last item will become "AA)" and will not be recognized
  as a list item anymore.

- There's also a bug with counters:

  * [0/0] Counter

A. [X] first box
B. [X] second box

  These boxes are not counted when bullets are literals (try C-c #).


HTH,

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-12-10 Thread Nathaniel Flath
Sory for the long delay - I got caught up in other work.

A patchaddressing the sisues brought up is attached.

Let me know of anything else.

Thanks,
Nathaniel Flath

On Fri, Nov 26, 2010 at 8:39 PM, Nathaniel Flath  wrote:
> I'm working on your comments, should have another patch in the next day or so.
>
> The only thing I had issue with was the comment about
> org-item-beginning-re:  I prefer it as a function for the reasons you
> mention, but I'm not particularly attached to this.  Does anyone else
> have an opinion?
>
> Thanks,
> Nathaniel Flath
>
> On Mon, Nov 22, 2010 at 10:37 AM, Nicolas Goaziou  wrote:
>> Hello,
>>
>>> Nathaniel Flath writes:
>>
>>> although I'm not an expert in the exporting. Let me know if there's
>>> anything else, or if I screwed up anything when trying to figure out
>>> how to make a git patch(looks like it worked, though.)
>>
>> I looked at your patch and here is what I've noticed so far:
>>
>>
>> - There's a bug in `org-cycle-list-bullet' where
>>  org-list-can-be-alphabetical is called with argument missing.
>>
>> - In `org-cycle-list-bullet', variable `top' stores list top point,
>>  make use of it instead of recomputing it.
>>
>> - There's a typo in `org-list-parse-list' (ogr-looking-at-p instead of
>>  org-looking-at-p)
>>
>> - Some parts of the patch are only white-space changes (for example a
>>  change in `org-list-automatic-rules' but there are others). You
>>  shouldn't include them, as it is not the purpose of the patch.
>>
>>  It doesn't help understanding your patch either.
>>
>> - Why did you remove all code comments about lists in org-docbook.el?
>>
>> - This is not a bug but are you sure you want to make
>>  org-item-beginning-re a function? I understand that it permits an
>>  user changing the value of `org-alphabetical-lists' to avoid
>>  reloading Org, but it looks like syntax overweight to me.
>>
>>  I mean, anyone wanting to look for a list item will have to remember
>>  that it must do a re-search on a function and not a string.
>>
>>
>> Hoping that helps,
>>
>> Regards,
>>
>> -- Nicolas
>>
>


0001-Added-support-for-alphabetical-patches-to-org-list.patch
Description: Binary data
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-11-26 Thread Nathaniel Flath
I'm working on your comments, should have another patch in the next day or so.

The only thing I had issue with was the comment about
org-item-beginning-re:  I prefer it as a function for the reasons you
mention, but I'm not particularly attached to this.  Does anyone else
have an opinion?

Thanks,
Nathaniel Flath

On Mon, Nov 22, 2010 at 10:37 AM, Nicolas Goaziou  wrote:
> Hello,
>
>> Nathaniel Flath writes:
>
>> although I'm not an expert in the exporting. Let me know if there's
>> anything else, or if I screwed up anything when trying to figure out
>> how to make a git patch(looks like it worked, though.)
>
> I looked at your patch and here is what I've noticed so far:
>
>
> - There's a bug in `org-cycle-list-bullet' where
>  org-list-can-be-alphabetical is called with argument missing.
>
> - In `org-cycle-list-bullet', variable `top' stores list top point,
>  make use of it instead of recomputing it.
>
> - There's a typo in `org-list-parse-list' (ogr-looking-at-p instead of
>  org-looking-at-p)
>
> - Some parts of the patch are only white-space changes (for example a
>  change in `org-list-automatic-rules' but there are others). You
>  shouldn't include them, as it is not the purpose of the patch.
>
>  It doesn't help understanding your patch either.
>
> - Why did you remove all code comments about lists in org-docbook.el?
>
> - This is not a bug but are you sure you want to make
>  org-item-beginning-re a function? I understand that it permits an
>  user changing the value of `org-alphabetical-lists' to avoid
>  reloading Org, but it looks like syntax overweight to me.
>
>  I mean, anyone wanting to look for a list item will have to remember
>  that it must do a re-search on a function and not a string.
>
>
> Hoping that helps,
>
> Regards,
>
> -- Nicolas
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-11-22 Thread Nicolas Goaziou
Hello,

> Nathaniel Flath writes:

> although I'm not an expert in the exporting. Let me know if there's
> anything else, or if I screwed up anything when trying to figure out
> how to make a git patch(looks like it worked, though.)

I looked at your patch and here is what I've noticed so far:


- There's a bug in `org-cycle-list-bullet' where
  org-list-can-be-alphabetical is called with argument missing.

- In `org-cycle-list-bullet', variable `top' stores list top point,
  make use of it instead of recomputing it.

- There's a typo in `org-list-parse-list' (ogr-looking-at-p instead of
  org-looking-at-p)

- Some parts of the patch are only white-space changes (for example a
  change in `org-list-automatic-rules' but there are others). You
  shouldn't include them, as it is not the purpose of the patch.

  It doesn't help understanding your patch either.

- Why did you remove all code comments about lists in org-docbook.el?

- This is not a bug but are you sure you want to make
  org-item-beginning-re a function? I understand that it permits an
  user changing the value of `org-alphabetical-lists' to avoid
  reloading Org, but it looks like syntax overweight to me.

  I mean, anyone wanting to look for a list item will have to remember
  that it must do a re-search on a function and not a string.

  
Hoping that helps,

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-11-22 Thread Bernt Hansen
Nathaniel Flath  writes:

>  Let me know if there's anything else, or if I screwed up anything
> when trying to figure out how to make a git patch(looks like it
> worked, though.)
>
> From 3b46feec08ec4c93f098dbdc6a4590f95afc0e68 Mon Sep 17 00:00:00 2001
> From: unknown 
> Date: Sun, 21 Nov 2010 20:40:02 -0800
> Subject: [PATCH] Squashed commit of the following:
>
> commit 7e9c81b27591c010cc0b6b016ee0e669ef5a304c
> Author: unknown 
> Date:   Sun Nov 21 20:01:42 2010 -0800
>
> New version of alpha lists
>
> commit b3fd5cc57b7f1bd62ee1f5e0d8a1cf57ca14cfc2
> Author: unknown 
> Date:   Thu Oct 21 22:28:44 2010 -0700
>
> foo2
>
> commit 00279a9b53b75baf1e3e13fc0bf092642125
> Author: unknown 
> Date:   Thu Oct 21 22:27:01 2010 -0700
>
> foo
>
> Fixup alphabetical lists patch
> ---
>  lisp/org-capture.el |4 +-

Hi Nathaniel.  There are a few issues with the commit message in this
patch.

  1. Invalid email address
  2. A list of commits with useless information in it (foo, foo2)
  3. Summary line (Squashed commot of the following:) really isn't
 useful on it's own


The subject line (line 1 of the commit message) should be standalone and
concisely state what the commit is for -- so you don't have to read the
rest unless that interests you.

The body of the commit message is for detailed descriptions of the
change.  You should delete the other squashed commit info since it is
not useful.  Describing what exactly you fixed up in the description
would be preferable to 'fixed alphabetical lists patch'.  6 months from
now nobody (including you) will know what you fixed without actually
reading the patch details.

Regards,
Bernt

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-11-21 Thread Nathaniel Flath
I think I've fixed these, although I'm not an expert in the exporting.
 Let me know if there's anything else, or if I screwed up anything
when trying to figure out how to make a git patch(looks like it
worked, though.)

Thanks,
Nathaniel Flath

On Sat, Nov 13, 2010 at 7:16 AM, Nicolas Goaziou  wrote:
> Hello,
>
>> Nathaniel Flath writes:
>
>> Are there any further issues?
>
> Also, as you changed `org-item-beginning-re' into a function, there
> are a few places outside org-list.el that need to be modified
> accordingly.
>
> And exporters (mainly HTML and DocBook) should be aware of
> alphabetical bullets.
>
> Regards,
>
> -- Nicolas
>


0001-Squashed-commit-of-the-following.patch
Description: Binary data
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-11-13 Thread Nicolas Goaziou
Hello,

> Nathaniel Flath writes:

> Are there any further issues?

Also, as you changed `org-item-beginning-re' into a function, there
are a few places outside org-list.el that need to be modified
accordingly.

And exporters (mainly HTML and DocBook) should be aware of
alphabetical bullets.

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-11-11 Thread Nicolas Goaziou
Hello,

> Nathaniel Flath writes:

> Are there any further issues? Thanks, Nathaniel Flath

I've quick checked your patch and it looks like it is doing its job.

Two things to note, though:

1. I strongly recommend that `org-list-can-be-alphabetical' should
   make use of non-interactive forms instead of interactive ones. In
   other words, you should use `org-get-beginning-of-list' and
   `org-get-next-item' instead of `org-beginning-of-item-list' and
   `org-next-item'. You can see my note about it in org-list.el at
   line 856.

   If you have the structure of the list, `caadr' on it (or an
   equivalent if you don't like cl.el) will give you a valid top item
   needed by non-interactive forms.

2. Your patch doesn't apply to current git head, you should correct
   the conflict.


Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-11-10 Thread Nathaniel Flath
Are there any further issues?

Thanks,
Nathaniel Flath

On Thu, Oct 28, 2010 at 12:17 AM, Nathaniel Flath  wrote:
> New patch fixing these issues is attached.
>
> Let me know of any other problems.
>
> On Tue, Oct 26, 2010 at 1:23 AM, Carsten Dominik
>  wrote:
>>
>> On Oct 26, 2010, at 10:21 AM, Nicolas Goaziou wrote:
>>
>>> Hello,
>>>
 Nathaniel Flath writes:
>>>
 I think I've fixed the issues brought up with this new patch. Please
 let me know what you think.
>>>
>>> I've noticed a couple of glitches.
>>>
>>> First, you are using
>>>
>>>  (> 28 (length struct))
>>>
>>> to know when to replace letters by numbers. But (length struct)
>>> doesn't always match list length, so it will lead to errors when
>>> outdenting items.
>>>
>>> For example, try outdenting, with its subtree, the item marked with
>>> "<<<" in the list below:
>>>
>>>  a) etsiun
>>>  b) etsiun
>>>  c) etsiun
>>>  d) etisun
>>>  e) etsiun
>>>  f) etsiun
>>>  g) etsiun
>>>  h) etsiun
>>>  i) etisun
>>>  j) etsiun
>>>  k) etsiun
>>>  l) etsiun
>>>  m) etsiun
>>>  n) etsiun
>>>    a) Outdent me and my children ! <<<
>>>       a) tersiu
>>>       b) etsiru
>>>       c) estiur
>>>       d) etsnriu
>>>       e) etsiun
>>>       f) etiune
>>>       g) etuirsnet
>>>    b) etsiun
>>>  o) etsiun
>>>  p) etsiun
>>>  q) etsiun
>>>  r) etsiun
>>>  s) etsiun
>>>
>>> All the lists will be numbered although they could keep alphabetical
>>> bullets.
>>>
>>> Another (lesser) problem is coming from the regexp chosen for bullets,
>>> that is "[0-9A-Za-z]+". I would suggest something alike
>>> "\\(\\(?:[0-9]\\)+\\|[A-Za-z]\\)". At the moment, you can set counter
>>> to [...@a4] and break you list when applying it.
>>
>>
>> Also, even when the alpha lists are turned off, typing
>>
>>   a)
>>
>> and pressing M-RET will show that a) is seen as a list bullet.
>>
>> Thanks for your work, we are getting closer to an acceptable patch.
>>
>> - Carsten
>>
>>>
>>> Regards,
>>>
>>> -- Nicolas
>>
>> - Carsten
>>
>>
>>
>>
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-28 Thread Nathaniel Flath
New patch fixing these issues is attached.

Let me know of any other problems.

On Tue, Oct 26, 2010 at 1:23 AM, Carsten Dominik
 wrote:
>
> On Oct 26, 2010, at 10:21 AM, Nicolas Goaziou wrote:
>
>> Hello,
>>
>>> Nathaniel Flath writes:
>>
>>> I think I've fixed the issues brought up with this new patch. Please
>>> let me know what you think.
>>
>> I've noticed a couple of glitches.
>>
>> First, you are using
>>
>>  (> 28 (length struct))
>>
>> to know when to replace letters by numbers. But (length struct)
>> doesn't always match list length, so it will lead to errors when
>> outdenting items.
>>
>> For example, try outdenting, with its subtree, the item marked with
>> "<<<" in the list below:
>>
>>  a) etsiun
>>  b) etsiun
>>  c) etsiun
>>  d) etisun
>>  e) etsiun
>>  f) etsiun
>>  g) etsiun
>>  h) etsiun
>>  i) etisun
>>  j) etsiun
>>  k) etsiun
>>  l) etsiun
>>  m) etsiun
>>  n) etsiun
>>    a) Outdent me and my children ! <<<
>>       a) tersiu
>>       b) etsiru
>>       c) estiur
>>       d) etsnriu
>>       e) etsiun
>>       f) etiune
>>       g) etuirsnet
>>    b) etsiun
>>  o) etsiun
>>  p) etsiun
>>  q) etsiun
>>  r) etsiun
>>  s) etsiun
>>
>> All the lists will be numbered although they could keep alphabetical
>> bullets.
>>
>> Another (lesser) problem is coming from the regexp chosen for bullets,
>> that is "[0-9A-Za-z]+". I would suggest something alike
>> "\\(\\(?:[0-9]\\)+\\|[A-Za-z]\\)". At the moment, you can set counter
>> to [...@a4] and break you list when applying it.
>
>
> Also, even when the alpha lists are turned off, typing
>
>   a)
>
> and pressing M-RET will show that a) is seen as a list bullet.
>
> Thanks for your work, we are getting closer to an acceptable patch.
>
> - Carsten
>
>>
>> Regards,
>>
>> -- Nicolas
>
> - Carsten
>
>
>
>


ordered-list.patch
Description: Binary data
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-26 Thread Nicolas Goaziou
Hello,

> Nathaniel Flath writes:

> I think I've fixed the issues brought up with this new patch. Please
> let me know what you think.

I've noticed a couple of glitches.

First, you are using

  (> 28 (length struct))

to know when to replace letters by numbers. But (length struct)
doesn't always match list length, so it will lead to errors when
outdenting items.

For example, try outdenting, with its subtree, the item marked with
"<<<" in the list below:

  a) etsiun
  b) etsiun
  c) etsiun
  d) etisun
  e) etsiun
  f) etsiun
  g) etsiun
  h) etsiun
  i) etisun
  j) etsiun
  k) etsiun
  l) etsiun
  m) etsiun
  n) etsiun
 a) Outdent me and my children ! <<<
a) tersiu
b) etsiru
c) estiur
d) etsnriu
e) etsiun
f) etiune
g) etuirsnet
 b) etsiun
  o) etsiun
  p) etsiun
  q) etsiun
  r) etsiun
  s) etsiun

All the lists will be numbered although they could keep alphabetical
bullets.

Another (lesser) problem is coming from the regexp chosen for bullets,
that is "[0-9A-Za-z]+". I would suggest something alike
"\\(\\(?:[0-9]\\)+\\|[A-Za-z]\\)". At the moment, you can set counter
to [...@a4] and break you list when applying it.

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-26 Thread Carsten Dominik


On Oct 26, 2010, at 10:21 AM, Nicolas Goaziou wrote:


Hello,


Nathaniel Flath writes:



I think I've fixed the issues brought up with this new patch. Please
let me know what you think.


I've noticed a couple of glitches.

First, you are using

 (> 28 (length struct))

to know when to replace letters by numbers. But (length struct)
doesn't always match list length, so it will lead to errors when
outdenting items.

For example, try outdenting, with its subtree, the item marked with
"<<<" in the list below:

 a) etsiun
 b) etsiun
 c) etsiun
 d) etisun
 e) etsiun
 f) etsiun
 g) etsiun
 h) etsiun
 i) etisun
 j) etsiun
 k) etsiun
 l) etsiun
 m) etsiun
 n) etsiun
a) Outdent me and my children ! <<<
   a) tersiu
   b) etsiru
   c) estiur
   d) etsnriu
   e) etsiun
   f) etiune
   g) etuirsnet
b) etsiun
 o) etsiun
 p) etsiun
 q) etsiun
 r) etsiun
 s) etsiun

All the lists will be numbered although they could keep alphabetical
bullets.

Another (lesser) problem is coming from the regexp chosen for bullets,
that is "[0-9A-Za-z]+". I would suggest something alike
"\\(\\(?:[0-9]\\)+\\|[A-Za-z]\\)". At the moment, you can set counter
to [...@a4] and break you list when applying it.



Also, even when the alpha lists are turned off, typing

   a)

and pressing M-RET will show that a) is seen as a list bullet.

Thanks for your work, we are getting closer to an acceptable patch.

- Carsten



Regards,

-- Nicolas


- Carsten




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-22 Thread Nathaniel Flath
Sorry about that - patch attached.

Thanks,
Nathaniel Flath

On Fri, Oct 22, 2010 at 1:13 AM, Carsten Dominik
 wrote:
> Hi Nathaniel,
>
> I get "patch does not apply".  Can you please update the patch to the
> current git master?
>
> Thanks
>
> - Carsten
>
>
> On Oct 22, 2010, at 7:30 AM, Nathaniel Flath wrote:
>
>> I think I've fixed the issues brought up with this new patch.  Please
>> let me know what you think.
>>
>> On Wed, Oct 20, 2010 at 9:44 PM, Nathaniel Flath 
>> wrote:

>
> But I can't help thinking this could lead to unexpected results in
> some cases (admittedly less than when alpha bullets could be any size
> long).

 It definitely will.

 Here is an alternative idea.  Nathaniel, what do you
 think about this: We could keep the numbering as we
 have it in the Org file, but introduce something like [...@a]
 in the first item that will convert the numbering
 into a,b,... upon export to ASCII, HTML, maybe even LaTeX
 (even though I think LaTeX demands some consistency here
 and prefers to have the global setup decide how lists work).
 Hell, we could even use [...@a] for capitals and [...@i] and [...@i]
 for roman numbering :)

 - Carsten

>>>
>>> Sorry for the late response - got swamped with work for a bit.
>>>
>>> I'd much prefer the approach I've been going with, mostly since I
>>> don't usually export my notes and mostly view them in org-mode.  I'll
>>> work on the patch tonight - should send a patch either later tonight
>>> or tomorow.
>>>
>>> Thanks,
>>> Nathaniel Flath
>>>
>> 
>
> - Carsten
>
>
>
>


org-list.patch
Description: Binary data
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-22 Thread Carsten Dominik

Hi Nathaniel,

I get "patch does not apply".  Can you please update the patch to the  
current git master?


Thanks

- Carsten


On Oct 22, 2010, at 7:30 AM, Nathaniel Flath wrote:


I think I've fixed the issues brought up with this new patch.  Please
let me know what you think.

On Wed, Oct 20, 2010 at 9:44 PM, Nathaniel Flath  
 wrote:




But I can't help thinking this could lead to unexpected results in
some cases (admittedly less than when alpha bullets could be any  
size

long).


It definitely will.

Here is an alternative idea.  Nathaniel, what do you
think about this: We could keep the numbering as we
have it in the Org file, but introduce something like [...@a]
in the first item that will convert the numbering
into a,b,... upon export to ASCII, HTML, maybe even LaTeX
(even though I think LaTeX demands some consistency here
and prefers to have the global setup decide how lists work).
Hell, we could even use [...@a] for capitals and [...@i] and [...@i]
for roman numbering :)

- Carsten



Sorry for the late response - got swamped with work for a bit.

I'd much prefer the approach I've been going with, mostly since I
don't usually export my notes and mostly view them in org-mode.  I'll
work on the patch tonight - should send a patch either later tonight
or tomorow.

Thanks,
Nathaniel Flath





- Carsten




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-21 Thread Nathaniel Flath
I think I've fixed the issues brought up with this new patch.  Please
let me know what you think.

On Wed, Oct 20, 2010 at 9:44 PM, Nathaniel Flath  wrote:
>>
>>>
>>> But I can't help thinking this could lead to unexpected results in
>>> some cases (admittedly less than when alpha bullets could be any size
>>> long).
>>
>> It definitely will.
>>
>> Here is an alternative idea.  Nathaniel, what do you
>> think about this: We could keep the numbering as we
>> have it in the Org file, but introduce something like [...@a]
>> in the first item that will convert the numbering
>> into a,b,... upon export to ASCII, HTML, maybe even LaTeX
>> (even though I think LaTeX demands some consistency here
>> and prefers to have the global setup decide how lists work).
>> Hell, we could even use [...@a] for capitals and [...@i] and [...@i]
>> for roman numbering :)
>>
>> - Carsten
>>
>
> Sorry for the late response - got swamped with work for a bit.
>
> I'd much prefer the approach I've been going with, mostly since I
> don't usually export my notes and mostly view them in org-mode.  I'll
> work on the patch tonight - should send a patch either later tonight
> or tomorow.
>
> Thanks,
> Nathaniel Flath
>


ordered-list.patch
Description: Binary data
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-20 Thread Nathaniel Flath
>
>>
>> But I can't help thinking this could lead to unexpected results in
>> some cases (admittedly less than when alpha bullets could be any size
>> long).
>
> It definitely will.
>
> Here is an alternative idea.  Nathaniel, what do you
> think about this: We could keep the numbering as we
> have it in the Org file, but introduce something like [...@a]
> in the first item that will convert the numbering
> into a,b,... upon export to ASCII, HTML, maybe even LaTeX
> (even though I think LaTeX demands some consistency here
> and prefers to have the global setup decide how lists work).
> Hell, we could even use [...@a] for capitals and [...@i] and [...@i]
> for roman numbering :)
>
> - Carsten
>

Sorry for the late response - got swamped with work for a bit.

I'd much prefer the approach I've been going with, mostly since I
don't usually export my notes and mostly view them in org-mode.  I'll
work on the patch tonight - should send a patch either later tonight
or tomorow.

Thanks,
Nathaniel Flath

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-05 Thread Carsten Dominik


On Oct 4, 2010, at 7:18 PM, Nicolas Goaziou wrote:


Carsten Dominik writes:



I think it would be appropriate in this case to simply throw an
error and let the user clean up with undo.


Certainly, but this still means that any 27+ items list will never be
able to complete a full bullet cycle as the user will have to undo
each time alphabetical bullets are reached. It could perhaps start
again at letter 'a'...


Ok, we could force the list to become numbered when someone tries to  
cycle it into
a,b,...  THis does not mean that you'd have to count in advance, you  
could simply
try the renumbering and when stepping over z throw an exception that  
will force the

list to move to the next state which would be numbers.




Nicolas, would you *object* against a patch by Nathaniel that
implements this? You are Mr lists now, so your green light will be
needed.


I wouldn't object against it as some people are finding it useful and
as it won't be turned on by default (if I remember correctly).


Yes, we sould not turn it on by default because it might bahave strange
under some circumstances.



But I can't help thinking this could lead to unexpected results in
some cases (admittedly less than when alpha bullets could be any size
long).


It definitely will.

Here is an alternative idea.  Nathaniel, what do you
think about this: We could keep the numbering as we
have it in the Org file, but introduce something like [...@a]
in the first item that will convert the numbering
into a,b,... upon export to ASCII, HTML, maybe even LaTeX
(even though I think LaTeX demands some consistency here
and prefers to have the global setup decide how lists work).
Hell, we could even use [...@a] for capitals and [...@i] and [...@i]
for roman numbering :)

- Carsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-04 Thread Nathaniel Flath
I don't think this is what I had in mind.  What you suggest seems to
apply for bulleted lists, and sorting the titles of those
alphabetically.  I'm trying to implement lists of the form:

  a.  Item 1
  b.  Item 2
  c.  Item 3

That work the same as lists like:

  1.  Item 1
  2.  Item 2
  3.  Item 3

Correct me if I'm misinterpreting you.

Thanks,
Nathaniel Flath
On Mon, Oct 4, 2010 at 5:07 PM, Sebastian Rose  wrote:
>
> Sorry for not following this thread closely.
>
> But from what I read, I thought it might be better to have a _command_
> to sort existing lists alphabetically?
>
> That way, there is nothing that has to be "turned on" globally, that
> could intefere with Org mode's syntax.
>
>
> Excuse me, if that's of topic or already discussed.
>
>
>   Sebastian
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-04 Thread Sebastian Rose

Sorry for not following this thread closely.

But from what I read, I thought it might be better to have a _command_
to sort existing lists alphabetically?

That way, there is nothing that has to be "turned on" globally, that
could intefere with Org mode's syntax.


Excuse me, if that's of topic or already discussed.


   Sebastian

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-04 Thread Nicolas Goaziou
> Carsten Dominik writes:

> I think it would be appropriate in this case to simply throw an
> error and let the user clean up with undo.

Certainly, but this still means that any 27+ items list will never be
able to complete a full bullet cycle as the user will have to undo
each time alphabetical bullets are reached. It could perhaps start
again at letter 'a'...

> Nicolas, would you *object* against a patch by Nathaniel that
> implements this? You are Mr lists now, so your green light will be
> needed.

I wouldn't object against it as some people are finding it useful and
as it won't be turned on by default (if I remember correctly).

But I can't help thinking this could lead to unexpected results in
some cases (admittedly less than when alpha bullets could be any size
long).

Regards,

-- Ni^W Mr lists

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-10-04 Thread Carsten Dominik


On Oct 1, 2010, at 3:13 AM, Nathaniel Flath wrote:


Carsten,
If you think this is acceptable I'll start working on it.

Thanks,
Nathaniel Flath

On Wed, Sep 29, 2010 at 10:46 AM, Nicolas Goaziou  
 wrote:

Hello,


Carsten Dominik writes:



Or, alternatively, put it in with an option to turn it on (default
off, I think). And maybe we should after all limit it to a single
character to avoid confusion. Yes, I do realise that I asked for
several characters - but I am learning...


What will then happen if the user is cycling bullets in a 100+ items
list and hits alphabetic bullets? Besides undoing that move, there's
nothing much that could be done then. Further cycling would become
impossible.


I think it would be appropriate in this case to simply
throw an error and let the user clean up with undo.



One idea would be to count items before cycling, and skipping
alphabetic bullets for lists above 26 items. It has to be carefully
implemented, as it could get very heavy on computations with large
lists.


We do not want that I agree.



Also, inserting new items in an alphabetical list should check if the
27th item has been reached and change bullets back to numbers if
needed.


Again we could simply throw an error here and
let the user handle the cleanup.



I'm sure there are others subtleties that I can't think of right now.


Nicolas, would you *object* against a patch by Nathaniel that implements
this?  You are Mr lists now, so your green light will be needed.

Kind regards

- Carsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-30 Thread Nathaniel Flath
Carsten,
If you think this is acceptable I'll start working on it.

Thanks,
Nathaniel Flath

On Wed, Sep 29, 2010 at 10:46 AM, Nicolas Goaziou  wrote:
> Hello,
>
>> Carsten Dominik writes:
>
>> Or, alternatively, put it in with an option to turn it on (default
>> off, I think). And maybe we should after all limit it to a single
>> character to avoid confusion. Yes, I do realise that I asked for
>> several characters - but I am learning...
>
> What will then happen if the user is cycling bullets in a 100+ items
> list and hits alphabetic bullets? Besides undoing that move, there's
> nothing much that could be done then. Further cycling would become
> impossible.
>
> One idea would be to count items before cycling, and skipping
> alphabetic bullets for lists above 26 items. It has to be carefully
> implemented, as it could get very heavy on computations with large
> lists.
>
> Also, inserting new items in an alphabetical list should check if the
> 27th item has been reached and change bullets back to numbers if
> needed.
>
> I'm sure there are others subtleties that I can't think of right now.
>
> Regards,
>
> -- Nicolas
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-29 Thread Nicolas Goaziou
Hello,

> Carsten Dominik writes:

> Or, alternatively, put it in with an option to turn it on (default
> off, I think). And maybe we should after all limit it to a single
> character to avoid confusion. Yes, I do realise that I asked for
> several characters - but I am learning...

What will then happen if the user is cycling bullets in a 100+ items
list and hits alphabetic bullets? Besides undoing that move, there's
nothing much that could be done then. Further cycling would become
impossible.

One idea would be to count items before cycling, and skipping
alphabetic bullets for lists above 26 items. It has to be carefully
implemented, as it could get very heavy on computations with large
lists.

Also, inserting new items in an alphabetical list should check if the
27th item has been reached and change bullets back to numbers if
needed.

I'm sure there are others subtleties that I can't think of right now.

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-29 Thread Nathaniel Flath
I'd be fine with either (or both) of these, and can code it up once we
decide.  I find it unlikely that I'd use an alphabetical list of size
more than 26, which is why I only had one character to begin with.

Thanks,
Nathaniel Flath
On Wed, Sep 29, 2010 at 8:49 AM, Carsten Dominik
 wrote:
>
> Or, alternatively, put it in with an option to turn it on (default off, I
> think).
> And maybe we should after all limit it to a single character to avoid
> confusion.
> Yes, I do realise that I asked for several characters - but I am learning...
>
> - Carsten
>
>
>>
>> - Carsten
>>
>
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-29 Thread Carsten Dominik


On Sep 28, 2010, at 6:12 PM, Carsten Dominik wrote:



On Sep 27, 2010, at 8:55 AM, Nicolas Goaziou wrote:


Nathaniel Flath writes:



But, there is apparently one major drawback, as I said in a
previous post. If the line starts with a word followed by a dot or
a parenthesis, Org will see a bullet there. This is bad news
because the following line will be indented, or a M-RET will delete
the word, replacing it with a) or a.



Yes, this happens - it's not something that comes up during my
normal usage, so I didn't notice. Can you think of a way to
determine if this is the case vs. a list is actually wanted?


Unfortunately, I can't see anything clean. This is tricky because
lists are the closest construct to raw text.


My feeling is that we should not apply this patch.  I see how it  
might be

nice to have such lists - but confusion is rather likely in
this case.


Or, alternatively, put it in with an option to turn it on (default  
off, I think).
And maybe we should after all limit it to a single character to avoid  
confusion.
Yes, I do realise that I asked for several characters - but I am  
learning...


- Carsten




- Carsten




___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-28 Thread Carsten Dominik


On Sep 27, 2010, at 8:55 AM, Nicolas Goaziou wrote:


Nathaniel Flath writes:



But, there is apparently one major drawback, as I said in a
previous post. If the line starts with a word followed by a dot or
a parenthesis, Org will see a bullet there. This is bad news
because the following line will be indented, or a M-RET will delete
the word, replacing it with a) or a.



Yes, this happens - it's not something that comes up during my
normal usage, so I didn't notice. Can you think of a way to
determine if this is the case vs. a list is actually wanted?


Unfortunately, I can't see anything clean. This is tricky because
lists are the closest construct to raw text.


My feeling is that we should not apply this patch.  I see how it might  
be

nice to have such lists - but confusion is rather likely in
this case.

- Carsten


___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-26 Thread Nicolas Goaziou
> Nathaniel Flath writes:

>> But, there is apparently one major drawback, as I said in a
>> previous post. If the line starts with a word followed by a dot or
>> a parenthesis, Org will see a bullet there. This is bad news
>> because the following line will be indented, or a M-RET will delete
>> the word, replacing it with a) or a.

> Yes, this happens - it's not something that comes up during my
> normal usage, so I didn't notice. Can you think of a way to
> determine if this is the case vs. a list is actually wanted?

Unfortunately, I can't see anything clean. This is tricky because
lists are the closest construct to raw text.

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-26 Thread Nathaniel Flath
> But, there is apparently one major drawback, as I said in a previous
> post. If the line starts with a word followed by a dot or a
> parenthesis, Org will see a bullet there. This is bad news because the
> following line will be indented, or a M-RET will delete the word,
> replacing it with a) or a.
>
> Regards,
>
> -- Nicolas
>

Yes, this happens - it's not something that comes up during my normal
usage, so I didn't notice.  Can you think of a way to determine if
this is the case vs. a list is actually wanted?

Thanks,
Nathaniel Flath

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-26 Thread Nicolas Goaziou
Hello,

I've tried the patch today. There are still some easily-fixed glitches
(like letters not included in org-cycle-list-bullet, or bullets
allowing mixed text and numbers).

But, there is apparently one major drawback, as I said in a previous
post. If the line starts with a word followed by a dot or a
parenthesis, Org will see a bullet there. This is bad news because the
following line will be indented, or a M-RET will delete the word,
replacing it with a) or a.

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-21 Thread Nicolas Goaziou
Hello,

> Carsten Dominik writes:

> Nicolas, can you in particular please take a look at this - I
> believe you earlier said that you saw problems with it.

Sure, I will have a look at it on Sunday. But before testing it, there
is, by design, one thing that seems dangerous to me. Let's consider
the following text:

This is a sentence in a not so short paragraph, ending where it should
not. What is this line supposed to mean for Org? If this is a
recognized as a list, wouldn't this line get wrongly indented?

Regards,

-- Nicolas

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-21 Thread Carsten Dominik

Hi everyone,

I would like to know if there are more people interested in this, and  
if there are people who are willing to test this patch, to make sure  
nothing breaks.


Nicolas, can you in particular please take a look at this - I believe  
you earlier said that you saw problems with it.


Thanks!

- Carsten

On Sep 18, 2010, at 9:43 AM, Nathaniel Flath wrote:


Hey,
I gave another shot at this, now that my computer is no longer dead.
I believe it fixes the issues described earlier - let me know of any
feedback.
(Also - I don't know how to get GMail to attach this as anything other
than application/octet-stream, so the text is in the message as well.
Nathaniel Flath


Attachment:

diff --git a/lisp/org-list.el b/lisp/org-list.el
index d9fc24e..88d5a9b 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -287,14 +287,14 @@ It depends on `org-empty-line-terminates-plain- 
lists'."

  "Return the correct regular expression for plain lists.
If GENERAL is non-nil, return the general regexp independent of the  
value

of `org-plain-list-ordered-item-terminator'."
-  (cond
-   ((or general (eq org-plain-list-ordered-item-terminator t))
-"\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\ 
\|$\\)")

-   ((= org-plain-list-ordered-item-terminator ?.)
-"\\([ \t]*\\([-+]\\|\\([0-9]+\\.\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\ 
\|$\\)")

+(cond
+ ((or general (eq org-plain-list-ordered-item-terminator t))
+  "\\([ \t]*\\([-+]\\|\\([0-9A-Za-z]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( \ 
\|$\\)")

+  ((= org-plain-list-ordered-item-terminator ?.)
+   "\\([ \t]*\\([-+]\\|\\([0-9A-Za-z]+\\.\\)\\)\\|[ \t]+\\*\\)\\( \ 
\|$\\)")

   ((= org-plain-list-ordered-item-terminator ?\))
-"\\([ \t]*\\([-+]\\|\\([0-9]+)\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$ 
\\)")
-   (t (error "Invalid value of `org-plain-list-ordered-item- 
terminator'"
+"\\([ \t]*\\([-+]\\|\\([0-9A-Za-z]+)\\)\\)\\|[ \t]+\\*\\)\\( \\| 
$\\)")
+(t (error "Invalid value of `org-plain-list-ordered-item- 
terminator'"


(defconst org-item-beginning-re (concat "^" (org-item-re))
  "Regexp matching the beginning of a plain list item.")
@@ -530,7 +530,7 @@ List ending is determined by the indentation of  
text. See

   (save-excursion
 (goto-char (match-end 0))
 ;; Ignore counter if any
- (when (looking-at "\\(?:\...@\\(?:start:\\)?[0-9]+\\][ \t]*\ 
\)?")
+ (when (looking-at "\\(?:\...@\\(?:start:\\)?[0-9A-Za-z]+\\] 
[ \t]*\\)?")

   (goto-char (match-end 0)))
 (looking-at regexp

@@ -1135,11 +1135,11 @@ bullet string and bullet counter, if any."
(list (point-at-bol)
  (org-get-indentation)
  (progn
-(looking-at "^[ \t]*\\([-+*0-9.)]+[ \t]+\\)")
+(looking-at "^[ \t]*\\([-+*0-9A-Za-z.)]+[ \t]+\\)")
(match-string 1))
  (progn
(goto-char (match-end 0))
-(and (looking-at "\...@\\(?:start:\\)?\\([0-9]+\\)\\]")
+(and (looking-at "\...@\\(?:start:\\)?\\([0-9A-Za-z]+\\)\ 
\]")

 (match-string 1))

(defun org-list-struct (begin end top bottom &optional outdent)
@@ -1259,8 +1259,10 @@ This function modifies STRUCT."
 (let ((counter (nth 3 item))
   (bullet (org-list-bullet-string (nth 2 item
   (cond
-   ((and (string-match "[0-9]+" bullet) counter)
+   ((and (string-match "[0-9A-Za-z]+" bullet) counter)
 (replace-match counter nil nil bullet))
+   ((string-match "[A-Za-z]+" bullet)
+(replace-match "a" nil nil bullet))
((string-match "[0-9]+" bullet)
 (replace-match "1" nil nil bullet))
(t bullet)
@@ -1268,7 +1270,7 @@ This function modifies STRUCT."
(setcdr item (list (nth 1 item) bullet (nth 3 item)
 (get-bul (lambda (item bullet)
(let* ((counter (nth 3 item)))
- (if (and counter (string-match "[0-9]+" bullet))
+ (if (and counter (string-match "[0-9A-Za-z]+" bullet))
  (replace-match counter nil nil bullet)
bullet
 (fix-bul
@@ -1582,13 +1584,50 @@ It determines the number of whitespaces to
append by looking at
  " ")))
 nil nil bullet 1)))

+(defun org-increment-string (str cap)
+  "Increments str (a->a, b->b, z->aa, aa->ab etc).  If cap is non- 
nil, then

+   the letters are capitalized."
+  (let ((res (org-convert-num-to-alpha-str
+	  (1+ (org-convert-alpha-str-to-num str 1 (length str) cap))  
cap))

+   (z (if cap ?Z ?z))
+   (b (if cap ?B ?b))
+   (a (if cap ?A ?a)))
+(if (and(= (string-to-char str) z)
+(= (string-to-char res) b))
+(concat (if cap "A" "a")  (substring res 1))
+  (concat (make-string (- (length str) (length re

Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-09-18 Thread Nathaniel Flath
Hey,
I gave another shot at this, now that my computer is no longer dead.
I believe it fixes the issues described earlier - let me know of any
feedback.
(Also - I don't know how to get GMail to attach this as anything other
than application/octet-stream, so the text is in the message as well.
Nathaniel Flath


Attachment:

diff --git a/lisp/org-list.el b/lisp/org-list.el
index d9fc24e..88d5a9b 100644
--- a/lisp/org-list.el
+++ b/lisp/org-list.el
@@ -287,14 +287,14 @@ It depends on `org-empty-line-terminates-plain-lists'."
   "Return the correct regular expression for plain lists.
 If GENERAL is non-nil, return the general regexp independent of the value
 of `org-plain-list-ordered-item-terminator'."
-  (cond
-   ((or general (eq org-plain-list-ordered-item-terminator t))
-"\\([ \t]*\\([-+]\\|\\([0-9]+[.)]\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")
-   ((= org-plain-list-ordered-item-terminator ?.)
-"\\([ \t]*\\([-+]\\|\\([0-9]+\\.\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")
+(cond
+ ((or general (eq org-plain-list-ordered-item-terminator t))
+  "\\([ \t]*\\([-+]\\|\\([0-9A-Za-z]+[.)]\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
+  ((= org-plain-list-ordered-item-terminator ?.)
+   "\\([ \t]*\\([-+]\\|\\([0-9A-Za-z]+\\.\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
((= org-plain-list-ordered-item-terminator ?\))
-"\\([ \t]*\\([-+]\\|\\([0-9]+)\\)\\)\\|[ \t]+\\*\\)\\([ \t]+\\|$\\)")
-   (t (error "Invalid value of `org-plain-list-ordered-item-terminator'"
+"\\([ \t]*\\([-+]\\|\\([0-9A-Za-z]+)\\)\\)\\|[ \t]+\\*\\)\\( \\|$\\)")
+(t (error "Invalid value of `org-plain-list-ordered-item-terminator'"

 (defconst org-item-beginning-re (concat "^" (org-item-re))
   "Regexp matching the beginning of a plain list item.")
@@ -530,7 +530,7 @@ List ending is determined by the indentation of text. See
(save-excursion
 (goto-char (match-end 0))
  ;; Ignore counter if any
- (when (looking-at "\\(?:\...@\\(?:start:\\)?[0-9]+\\][ \t]*\\)?")
+ (when (looking-at "\\(?:\...@\\(?:start:\\)?[0-9A-Za-z]+\\][ 
\t]*\\)?")
(goto-char (match-end 0)))
 (looking-at regexp

@@ -1135,11 +1135,11 @@ bullet string and bullet counter, if any."
 (list (point-at-bol)
   (org-get-indentation)
   (progn
-(looking-at "^[ \t]*\\([-+*0-9.)]+[ \t]+\\)")
+(looking-at "^[ \t]*\\([-+*0-9A-Za-z.)]+[ \t]+\\)")
 (match-string 1))
   (progn
 (goto-char (match-end 0))
-(and (looking-at "\...@\\(?:start:\\)?\\([0-9]+\\)\\]")
+(and (looking-at "\...@\\(?:start:\\)?\\([0-9A-Za-z]+\\)\\]")
  (match-string 1))

 (defun org-list-struct (begin end top bottom &optional outdent)
@@ -1259,8 +1259,10 @@ This function modifies STRUCT."
 (let ((counter (nth 3 item))
   (bullet (org-list-bullet-string (nth 2 item
   (cond
-   ((and (string-match "[0-9]+" bullet) counter)
+   ((and (string-match "[0-9A-Za-z]+" bullet) counter)
 (replace-match counter nil nil bullet))
+   ((string-match "[A-Za-z]+" bullet)
+(replace-match "a" nil nil bullet))
((string-match "[0-9]+" bullet)
 (replace-match "1" nil nil bullet))
(t bullet)
@@ -1268,7 +1270,7 @@ This function modifies STRUCT."
(setcdr item (list (nth 1 item) bullet (nth 3 item)
 (get-bul (lambda (item bullet)
(let* ((counter (nth 3 item)))
- (if (and counter (string-match "[0-9]+" bullet))
+ (if (and counter (string-match "[0-9A-Za-z]+" bullet))
  (replace-match counter nil nil bullet)
bullet
 (fix-bul
@@ -1582,13 +1584,50 @@ It determines the number of whitespaces to
append by looking at
   " ")))
  nil nil bullet 1)))

+(defun org-increment-string (str cap)
+  "Increments str (a->a, b->b, z->aa, aa->ab etc).  If cap is non-nil, then
+   the letters are capitalized."
+  (let ((res (org-convert-num-to-alpha-str
+ (1+ (org-convert-alpha-str-to-num str 1 (length str) cap)) cap))
+   (z (if cap ?Z ?z))
+   (b (if cap ?B ?b))
+   (a (if cap ?A ?a)))
+(if (and(= (string-to-char str) z)
+(= (string-to-char res) b))
+(concat (if cap "A" "a")  (substring res 1))
+  (concat (make-string (- (length str) (length res)) a)  res
+
+(defun org-convert-alpha-str-to-num (str n pos cap)
+  "Converts the substring consisting of locations pos to pos-n to a
+   numeric representation."
+  (let ((a (if cap ?A ?a)))
+(if (= pos 1) (* (- (string-to-char str) a) n)
+  (+ (* (- (nth (1- pos) (string-to-list str)) a) n)
+(org-convert-alpha-str-to-num str (* 26 n) (1- pos) cap)
+
+(defun or

Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-08-27 Thread Nathaniel Flath
I was going to fix the issues described in the first reply - not
enough items in particular - and resubmit soon.  I got a bit
distracted by finals.  I'll see if I can figure out the export
problem, as well.

Thanks,
Nathaniel Flath

On Fri, Aug 27, 2010 at 5:44 AM, Jacob Mitchell
 wrote:
>
>
> On Fri, Aug 27, 2010 at 6:53 AM, Bernt Hansen  wrote:
>>
>> Carsten Dominik  writes:
>>
>> > On Jul 29, 2010, at 10:27 PM, Nathaniel Flath wrote:
>> >
>> >> Hello all,
>> >>
>> >> One thing that had been bugging me was the inability to have an
>> >> ordered list of the form:
>> >>
>> >> a.  Item 1
>> >> b.  Item 2
>> >> c.  Item 3
>> >>
>> >> The following patch enables this, with lists going from a-z and A-Z.
>> >> Let me know if there are any issues with it.
>> >
>> > Hi,
>> >
>> > I am not really sure we need these.  They cause problems when lists get
>> > really long - also you patch does not further than "z", after that I
>> > get "{".
>> >
>> > Furthermore the export backends implement their own numbering
>> > rules anyway.  So it seems to me that we do not need this addition.
>> >
>> > Any other votes here?
>>
>> I'm not currently missing this feature.  I think it definitely would
>> have to handle more entries if this was to be included in org-mode.
>
> I agree, that would be nice.
>
>>
>> Maybe going something like
>>
>>  a.
>>  b.
>>  ...
>>  z.
>>  aa.
>>  ab.
>>  ...
>>  az.
>>  ba.
>>  bb.
>>  ...
>>  zz.
>>  ... and if you really need more entries than that (unlikely) you can
>>  do
>>  aaa.
>>  aab.
>>  ...
>>  and just keep going indefinitely.
>
> As a practical matter we should consider whether it's worth making a
> non-terminating sequence that can be handled by the exporters.  LaTeX's
> enumerate package doesn't like going beyond (z):
>
> \documentclass[letterpaper]{article}
> \usepackage{enumerate}
>
> \begin{document}
> \begin{enumerate}[(z)]
> \item
> ...
> \end{document}
>
> The items beyond the 26th are mapped to "()".
>
> Of course there are going to be ways around these issues, but the question
> is whether it's desirable enough to implement and maintain that.  Either way
> is fine with me--I'm new on the mailing list and haven't done any
> development for org-mode yet.
>
> -Jake
>>
>> -Bernt
>>
>> ___
>> Emacs-orgmode mailing list
>> Please use `Reply All' to send replies to the list.
>> Emacs-orgmode@gnu.org
>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


Re: [Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-08-27 Thread Jacob Mitchell
On Fri, Aug 27, 2010 at 6:53 AM, Bernt Hansen  wrote:

> Carsten Dominik  writes:
>
> > On Jul 29, 2010, at 10:27 PM, Nathaniel Flath wrote:
> >
> >> Hello all,
> >>
> >> One thing that had been bugging me was the inability to have an
> >> ordered list of the form:
> >>
> >> a.  Item 1
> >> b.  Item 2
> >> c.  Item 3
> >>
> >> The following patch enables this, with lists going from a-z and A-Z.
> >> Let me know if there are any issues with it.
> >
> > Hi,
> >
> > I am not really sure we need these.  They cause problems when lists get
> > really long - also you patch does not further than "z", after that I
> > get "{".
> >
> > Furthermore the export backends implement their own numbering
> > rules anyway.  So it seems to me that we do not need this addition.
> >
> > Any other votes here?
>
> I'm not currently missing this feature.  I think it definitely would
> have to handle more entries if this was to be included in org-mode.
>

I agree, that would be nice.


>
> Maybe going something like
>
>  a.
>  b.
>  ...
>  z.
>  aa.
>  ab.
>  ...
>  az.
>  ba.
>  bb.
>  ...
>  zz.
>  ... and if you really need more entries than that (unlikely) you can
>  do
>  aaa.
>  aab.
>  ...
>  and just keep going indefinitely.
>

As a practical matter we should consider whether it's worth making a
non-terminating sequence that can be handled by the exporters.  LaTeX's
enumerate package doesn't like going beyond (z):

\documentclass[letterpaper]{article}
\usepackage{enumerate}

\begin{document}
\begin{enumerate}[(z)]
\item
...
\end{document}

The items beyond the 26th are mapped to "()".

Of course there are going to be ways around these issues, but the question
is whether it's desirable enough to implement and maintain that.  Either way
is fine with me--I'm new on the mailing list and haven't done any
development for org-mode yet.

-Jake

>
> -Bernt
>
> ___
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode


[Orgmode] Re: [PATCH] Alphabetical ordered lists

2010-08-27 Thread Bernt Hansen
Carsten Dominik  writes:

> On Jul 29, 2010, at 10:27 PM, Nathaniel Flath wrote:
>
>> Hello all,
>>
>> One thing that had been bugging me was the inability to have an
>> ordered list of the form:
>>
>> a.  Item 1
>> b.  Item 2
>> c.  Item 3
>>
>> The following patch enables this, with lists going from a-z and A-Z.
>> Let me know if there are any issues with it.
>
> Hi,
>
> I am not really sure we need these.  They cause problems when lists get
> really long - also you patch does not further than "z", after that I
> get "{".
>
> Furthermore the export backends implement their own numbering
> rules anyway.  So it seems to me that we do not need this addition.
>
> Any other votes here?

I'm not currently missing this feature.  I think it definitely would
have to handle more entries if this was to be included in org-mode.

Maybe going something like

  a.
  b.
  ...
  z.
  aa.
  ab.
  ...
  az.
  ba.
  bb.
  ...
  zz.
  ... and if you really need more entries than that (unlikely) you can
  do
  aaa.
  aab.
  ...
  and just keep going indefinitely.

-Bernt

___
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode