I think the problem is:
(setq backup-directory-alist `((".*" . savedir)))
Should be
(setq backup-directory-alist `((".*" . ,savedir)))
Explanation: When Emacs exits, Ido is trying ta save its history; the standard backup procedure of Emacs kicks in and try to backup that file. However you forget to unquote savedir
in the configuration for backup-directory-alist
, so the cons cell is a pair of string and symbol instead of a pair of strings as expected.