afaik (ex) hyphenpenalty is only applied with automatic discretionaries (the ones inserted by the hyphenation pass)
This doesn't seem the be the case with the attached example, it clearly shows that \hyphenpenalty is applied to explicit \discretionaries too...
Let's put it another way: how can I make LuaTeX behave the same way as pdfTeX on the last line of the attached example? I really need it for a software, and I don't believe it's possible by patchin nodes, isn't it?
Thank you, -- Elie
%\directlua{callback.register("hyphenate", false)}
%\hyphenpenalty=-10000
\hsize=2cm
% this cuts after the discretionary
aaaaab\discretionary{1}{2}{3}\penalty-10000cd
% this doesn't cut
aaaaab\discretionary{1}{2}{3}cd
% this cuts on the discretionary (both pdfTeX and LuaTeX)
\hyphenpenalty=-10000
aaaaab\discretionary{1}{2}{3}cd
% with pdfTeX: it cuts on the discretionary
% with LuaTeX: it doesn't cut
\hsize=10cm
aaaaab\discretionary{1}{2}{3}cd
\bye
hyphenpenalty-luatex.pdf
Description: Adobe PDF document
hyphenpenalty-pdftex.pdf
Description: Adobe PDF document
