Re: COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter

2024-04-06 Thread Stacey Marshall
> There is nothing to obsolete.
> ox-ascii did not process alphabetical lists in any way, which was a bug.

OK, thanks for verification.

Stace

On Sat, 6 Apr 2024 at 13:02, Ihor Radchenko  wrote:

> Stacey Marshall  writes:
>
> > Was the intention with this change to remove alphabetical lists from
> > text (ascii) exporter?
>
> The intention was to make ascii exporter aware about alphabetical lists
> instead of behaving in undefined way.
>
> > ...
> > a. Point A
> > b. Point B
> > c. Point C
> > d. [@z] Point Z
> > #+end_src
> >
> > Latest 9.7 alpha results in the alphabetical labels being replaced
> > with numbers::
> > ..
>
> Yes.
>
> > I must admit that I had not noticed that other exporters converted
> > the letter to a number.  Going forward I shall stop using them.
> >
> > If it is obsoleted or deprecated then a mention to etc/ORG-NEWS
> > would be appreciated.
>
> There is nothing to obsolete.
> ox-ascii did not process alphabetical lists in any way, which was a bug.
> All other exporters convert alphabetical lists into numbered lists.
> The bug has been fixed, and the behaviour is now consistent with the rest
> of exporters.
>
> If you wish alphabetical lists to be exported specially, feel free to
> post a feature request.
>
> --
> Ihor Radchenko // yantar92,
> Org mode contributor,
> Learn more about Org mode at .
> Support Org development at ,
> or support my work at 
>


Re: COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter

2024-04-06 Thread Ihor Radchenko
Stacey Marshall  writes:

> Was the intention with this change to remove alphabetical lists from
> text (ascii) exporter?

The intention was to make ascii exporter aware about alphabetical lists
instead of behaving in undefined way.

> ...
> a. Point A
> b. Point B
> c. Point C
> d. [@z] Point Z
> #+end_src
>
> Latest 9.7 alpha results in the alphabetical labels being replaced
> with numbers::
> ..

Yes.

> I must admit that I had not noticed that other exporters converted
> the letter to a number.  Going forward I shall stop using them.
>
> If it is obsoleted or deprecated then a mention to etc/ORG-NEWS
> would be appreciated.

There is nothing to obsolete.
ox-ascii did not process alphabetical lists in any way, which was a bug.
All other exporters convert alphabetical lists into numbered lists.
The bug has been fixed, and the behaviour is now consistent with the rest
of exporters.

If you wish alphabetical lists to be exported specially, feel free to
post a feature request.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter

2024-04-05 Thread Stacey Marshall
Regarding 
https://list.orgmode.org/orgmode/36a62fbf-6484-456f-9537-a7aa40530...@app.fastmail.com/

Was the intention with this change to remove alphabetical lists from
text (ascii) exporter?


#+begin_src 
,#+title: Test document

,#+options: toc:nil author:nil
,* test of alphabetical export

,#+begin_src emacs-lisp :exports both :eval yes
(format "%S\n%S\norg-list-allow-alphabetical: %S\n"
(emacs-version) (org-version) org-list-allow-alphabetical)
,#+end_src

a. Point A
b. Point B
c. Point C
d. [@z] Point Z
#+end_src

Latest 9.7 alpha results in the alphabetical labels being replaced
with numbers::
#+begin_example
1 test of alphabetical export
=

  ,
  | (format "%S\n%S\norg-list-allow-alphabetical: %S\n"
  | (emacs-version) (org-version) org-list-allow-alphabetical)
  `

  ,
  | "GNU Emacs 29.1 (build 1, aarch64-apple-darwin23.3.0, Carbon Version 170 
AppKit 2487.4)
  |  of 2024-02-26"
  | "9.7-pre"
  | org-list-allow-alphabetical: t
  `


  1. Point A
  2. Point B
  3. Point C
  26. Point Z
#+end_example

Removing the change to ox-ascii.el restores it, but leaves the original issue:

#+begin_src diff :eval no :exports code
$ git diff lisp/ox-ascii.el
diff --git a/lisp/ox-ascii.el b/lisp/ox-ascii.el
index db4356ec6..78641f1db 100644
--- a/lisp/ox-ascii.el
+++ b/lisp/ox-ascii.el
@@ -1485,7 +1485,7 @@ contextual information."
  struct
  (org-list-prevs-alist struct)
  (org-list-parents-alist struct)))
-  (replace-regexp-in-string "[0-9A-Za-z]+" num bul)))
+  (replace-regexp-in-string "[0-9]+" num bul)))
(_ (let ((bul (org-list-bullet-string
   (org-element-property :bullet item
 ;; Change bullets into more visible form if UTF-8 is active.
#+end_src

#+begin_example
1 test of alphabetical export
=

  ,
  | (format "%S\n%S\norg-list-allow-alphabetical: %S\n"
  | (emacs-version) (org-version) org-list-allow-alphabetical)
  `

  ,
  | "GNU Emacs 29.1 (build 1, aarch64-apple-darwin23.3.0, Carbon Version 170 
AppKit 2487.4)
  |  of 2024-02-26"
  | "9.7-pre"
  | org-list-allow-alphabetical: t
  `


  a. Point A
  b. Point B
  c. Point C
  d. Point Z
#+end_example

I must admit that I had not noticed that other exporters converted
the letter to a number.  Going forward I shall stop using them.

If it is obsoleted or deprecated then a mention to etc/ORG-NEWS
would be appreciated.

yours faithfully,

Stacey Marshall







Re: COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter

2023-10-20 Thread Ihor Radchenko
"Tom Alexander"  writes:

> Idk if its been discussed, but personally if I were given dictatorship over 
> org-mode I would take all of these emacs variables that are defined outside 
> of the document, and instead of having them influence org-mode directly, I 
> would *only* use them to pre-populate values for in-buffer settings templates.

> For example, if a user had set `org-odd-levels-only` then I wouldn't have 
> that impact ANY existing document they open, but if they open a new document 
> then I would have it auto-insert `#+STARTUP: odd` at the top of the fresh 
> document.

That would be very annoying for many users.
What might be better is providing a way to "unload" the parser-affecting
non-standard settings into Org file header, so that the file can be
shared properly with other people.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at 



Re: COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter

2023-10-11 Thread Tom Alexander
Thanks!

> We aim to reduce config-dependent Org syntax in the long term.

Thats wonderful news! Sometimes this stuff can really surprise you. For 
example, the structure of the document created by running `echo "1. foo\n 
1.bar\n1.baz\n\t1.lorem"` changes based on the user's **tab-width**!!

If tab-width is less than 8 then this is:
```text
1. foo
  1. bar
1. baz
  2. lorem
```

If tab-width is 8 then this is:
```text
1. foo
  1. bar
1. baz
2. lorem
```

and if tab-width is greater than 8 this is:
```text
1. foo
  1. bar
1. baz
  1. lorem
```

Absolute madness! I always considered tab-width to be a personal aesthetic 
choice and not something that would functionally change how documents other 
people wrote will be parsed.

Idk if its been discussed, but personally if I were given dictatorship over 
org-mode I would take all of these emacs variables that are defined outside of 
the document, and instead of having them influence org-mode directly, I would 
*only* use them to pre-populate values for in-buffer settings templates.

For example, if a user had set `org-odd-levels-only` then I wouldn't have that 
impact ANY existing document they open, but if they open a new document then I 
would have it auto-insert `#+STARTUP: odd` at the top of the fresh document.

Otherwise it seems like org-mode is unsuitable for multi-person collaboration 
without dictating the contents of everyone's `.emacs` file.

--
Tom Alexander
pgp: https://fizz.buzz/pgp.asc



Re: COUNTER-SET for alphabetical ordered lists ignored for utf-8 exporter

2023-10-07 Thread Ihor Radchenko
"Tom Alexander"  writes:

> It seems that COUNTER-SET[1] is not being honored when exporting to utf-8 for 
> alphabetical lists even though it is honored for numeric lists. When 
> exporting to html, COUNTER-SET is honored for both.
>
> Test document:
> ```
> # An ordered list starting at 3
> 1. [@3] foo
>
>
> # An ordered list starting at 1
> m. bar
>
>
> # An ordered list starting at 11
> m. [@k] baz
> ```
> ...
> But when exporting to utf-8 you get: (whitespace removed again)
> ```
> 3. foo
> m. bar
> m. baz
> ```
>
> Whereas I would expect:  (whitespace removed again)
> ```
> 3. foo
> m. bar
> k. baz
> ```

Fixed, on main.
https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=26f1cb77a

However, what we do for alphabetical bullets on export is slightly
different:

3. foo
1. bar
11. baz

Other export backends do not preserve alphabetical bullets. Numbers are
always used.

> On a slightly related note: it seems the COUNTER-SET[1] allows single-letter 
> values even when org-list-allow-alphabetical is nil. I don't think that is 
> going to hurt anyone but I figured I should mention it in case its a bug 
> (test doc: `1. [@k] foo` is a plain list starting at 11 even when 
> org-list-allow-alphabetical is nil).
>
> [1] https://orgmode.org/worg/org-syntax.html#Items

org-syntax.html#Items describes what the parser does 
(`org-element-item-parser').
`org-list-allow-alphabetical' should be changed to t in future and
obsoleted. We aim to reduce config-dependent Org syntax in the long
term.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at .
Support Org development at ,
or support my work at