On a freshly installed debian 9.1, apt-get fails to install xemacs due to some compilation related to erlang, here is the interesting part of log:
Compiling /usr/share/xemacs21/site-lisp/erlang/erldoc.el...
While compiling toplevel forms in file /usr/share/xemacs21/site-lisp/erlang/erldoc.el:
!! File error (("Cannot open load file" "cl-lib"))
>>Error occurred processing erldoc.el: Cannot open load file: cl-lib
Compiling /usr/share/xemacs21/site-lisp/erlang/path.el...
Wrote /usr/share/xemacs21/site-lisp/erlang/path.elc
Done
ERROR: install script from erlang-mode package failed
dpkg: error processing package xemacs21-mule (--configure):
subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of xemacs21:
xemacs21 depends on xemacs21-mule (>= 21.4.24-4) | xemacs21-mule-canna-wnn (>= 21.4.24-4) | xemacs21-nomule (>= 21.4.24-4); however:
Package xemacs21-mule is not configured yet.
Package xemacs21-mule-canna-wnn is not installed.
Package xemacs21-nomule is not installed.
dpkg: error processing package xemacs21 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
xemacs21-mule
xemacs21
E: Sub-process /usr/bin/dpkg returned an error code (1)
Cheers