It seems that disabling the EOF character does not have an effect on
readline. For example:
$ stty sane
$ stty eof undef
$ ^D
Use "logout" to leave the shell.
$ read -e; echo $?
^D
1
But the setting did take effect, as can be verified by running, e.g.
`read' w/o readline:
$ read -n1; echo ${REPLY@Q}
^D$'\004'
Setting the EOF character to anything else works as expected but, when
followed by an `stty eof undef', readline keeps using whatever the value
that had previously been set.
My goal was to bind a custom function to ^D and, as a workaround, setting
EOF to some nearly-impossible to type character works fine but I'm not
sure if the inability to disable EOF is expected.