add delete-trailing-whitespace before-save-hook (init.el)