savehist complains:
Debugger entered--Lisp error: (error "No such coding system" iso-2022-8)
coding-system-property(iso-2022-8 pre-write-conversion)
write-region(1 9592 "~/.emacs-history" nil quiet)
savehist-save(t)
So I have to turn it off to be able to exit XEmacs.