table colors and delimiter inconsistencies
Hello all,
First of all, thanks @bbatsov for maintaining adoc-mode. I am using latest version of adoc-mode (20220919.659 from melpa). The colouring scheme for table delimiter seems to be not capturing more than 4 delimiters. Update (added screenshot):

Are there any guidelines to not have more than 4 delimiter per row? I guess the issue comes from regex string starting at line 1765 in adoc-mode.el that seems to concat a fixed number of patterns. I was not able to really figure out that pattern, but I tried changing the original:
(list (concat "^" "\\(" (adoc-re-cell-specifier) "\\)" "\\(|\\)"
"\\(?:[^|\n]*?[ \t]" "\\(" (adoc-re-cell-specifier) "\\)" "\\(|\\)"
"\\(?:[^|\n]*?[ \t]" "\\(" (adoc-re-cell-specifier) "\\)" "\\(|\\)"
"\\(?:[^|\n]*?[ \t]" "\\(" (adoc-re-cell-specifier) "\\)" "\\(|\\)" "\\)?\\)?\\)?")
to:
(list (concat "\\(^|\\)\\(?:[^\n\|]*\\)"
"\\(|\\)?\\(?:[^\|\n]*\\)"
"\\(|\\)?\\(?:[^\|\n]*\\)"
"\\(|\\)?\\(?:[^\|\n]*\\)"
"\\(|\\)?\\(?:[^\|\n]*\\)"
"\\(|\\)?\\(?:[^\|\n]*\\)")
which at least shows that I was now able to capture 6 delimiters (which is ok for most of my tables).
Also the colouring of those delimiters (tested with zenburn-scheme) sticks out compared to otherwise appealing colours. So I changed the relevant markup-table-face in markup-faces.el to drop the background colors of those delimiters and use a pale green tone for dark schemes.
(defface markup-table-face
'((default (:inherit markup-meta-face))
(((background light)) (:foreground "royal blue"))
(((background dark)) (:foreground "pale green")))
Are there any guidelines to not have more than 4 delimiter per row?
No, that's some bug with the regexp as you've guessed. We'll have to make it more flexible.
So I changed the relevant markup-table-face in markup-faces.el to drop the background colors of those delimiters and use a pale green tone for dark schemes.
It's still on my todo to kill the dependency to markup-face and just inline all those faces in adoc-mode. I'm guessing they are also missing in zenburn, if you've seeing some weird colours. Some screenshots would be useful.
@bbatsov , do I think this table is from a ReStructured Text, not AsciiDoc. In the AsciiDoc table must be defined like:
[cols="1,1"]
|===
|Cell in column 1, header row |Cell in column 2, header row
|Cell in column 1, row 2
|Cell in column 2, row 2
|Cell in column 1, row 3
|Cell in column 2, row 3
|===
I'm guessing there are a few different syntaxes for tables and the one you mentioned might be the newer one - we'll have to check the AsciiDoc specification for more details.
The example that I referenced is from the adoc-mode table generation function. It uses adoc prefix delimited tables as in https://asciidoc-py.github.io/chunked/ch23.html which should be fine. @dunmaksim I think the only difference to your example is, that you split cell definitions into multiple lines. It is all about the | for defining a cell.