I can reproduce an error when saving files here, below is the
backtrace:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  min(nil)
  apply(min nil)
  select-safe-coding-system-interactively(1 144132 (raw-text no-conversion) (chinese-gbk-unix) nil raw-text)
  select-safe-coding-system(1 144132 chinese-gbk-unix nil "/home/xgp/misc")
  write-region(nil nil "/home/xgp/misc" nil t "~/misc")
  basic-save-buffer-2()
  basic-save-buffer-1()
  basic-save-buffer()
  save-buffer(1)
  call-interactively(save-buffer nil nil)

This error does not happen every time.  The second time the file is
saved, no error is signaled and the saving is done successfully.

Any other information needed to locate the problem?

Regards,
Guanpeng Xu

See all the ways you can stay connected to friends and family