On 2025-09-12 12:48, Hans Hagen via ntg-context wrote:
On 9/12/2025 5:33 PM, Rik Kabel wrote:

On 2025-09-07 20:40, Rik Kabel wrote:

Hello list,

Since the August 17 update, and continuing to the current August 21 release, my indexes show

    [entry not flushed],

on many entries where the page number should be suppressed and an endnote number, provided with the register command, displayed. This was not an issue with the July  21 release and earlier.

The indexing code for this document is a bit complex, and I have not yet been able to isolate the issue further.

Has anybody else seen similar problems?

Is there something in particular I should look for?

I am trying to put together an MWE, but have not got it yet.

Okay, I have created an MWE. The issues appears to be tagging when interaction is active -- disabling either or both of the first two lines below resolves the error, but that should not be necessary.

    \setupinteraction[state=start]
    \setuptagging[state=start]

    \starttexdefinition IndexPageCommand #1
       \doifsomethingelse{\currentregisterpageuserdata{note}}
         {n\currentregisterpageuserdata{note}}
         #1
       \doifsomething{\currentregisterpageuserdata{id}}
         {\in[\currentregisterpageuserdata{id}]}
    \stoptexdefinition

    \defineregister[Pindex]
    \setupregister [Pindex][pagecommand=\IndexPageCommand]

    \starttexdefinition tolerant protected unexpanded PIndex
    [#1]#:#2#*#=#*#=
       \doifelse{#3}{}
         {\setregisterentry[Pindex][keys={#1},entries={#2}]}
         {\setregisterentry[Pindex][keys={#1},entries={#2}][#3]}
    \stoptexdefinition

    \starttext
         \PIndex{OK, Entry}
       Here is some text.
    \startendnote[en:lentz]
         \PIndex{Bad, Entry1}
         \PIndex{Bad, Entry2}[note={\in[en:lentz]}]%
       Here is an endnote.
    \stopendnote
    \page
       \placenotes[endnote]
    \page
       \placeregister[Pindex]
    \stoptext

Please let me know if this is user error or a bug.

more a side effect of the fact that we preroll that one in order to get some alt text or so

This ine is kind of general (add it to cont-new.mlxl):

\appendtoks
    \let\doflushatpar\gobbleoneargument
\to \everypreroll

and that one more specific (protected == unexpanded)

\starttexdefinition tolerant protected PIndex [#1]#:#2#*#=#*#=
    \ifprerolling \else
        \doifelsesomething {#3} {
            \setregisterentry[Pindex][keys={#1},entries={#2}][#3]
        } {
            \setregisterentry[Pindex][keys={#1},entries={#2}]
        }
    \fi
\stoptexdefinition

or a bit more texnic:

\starttexdefinition tolerant protected unexpanded PIndex [#1]#:#2#*#=#*#=
    \ifprerolling
        % not this time
    \orelse\ifparameter#3\or
        \setregisterentry[Pindex][keys={#1},entries={#2}][#3]
    \else
        \setregisterentry[Pindex][keys={#1},entries={#2}]
    \fi
\stoptexdefinition

but then you don't get that 'n' (not sure why)

Hans


Well, the 'n', followed by the note number, is pretty important, so losing it is not an option. (The design of the index calls for citing the endnote number instead of the page number for items in the endnotes.)

The suggested change does eliminate the '[entry not flushed],' problem but also introduces another problem: the endnote is now preceded 'note=1', as in:

--
Rik

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / 
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage  : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive  : https://github.com/contextgarden/context
wiki     : https://wiki.contextgarden.net
___________________________________________________________________________________

Reply via email to