simple.el (delete-trailing-whitespace-mode): New minor mode (bug#78264)
Partly motivated by bug#78097.
* lisp/simple.el (delete-trailing-whitespace-if-possible): New function.
(delete-trailing-whitespace-mode): New minor mode.
* lisp/editorconfig.el (editorconfig-trim-whitespaces-mode):
Change default to `delete-trailing-whitespace-mode`.
(editorconfig--get-trailing-ws): Simplify accordingly.
(editorconfig--add-hook-safe-p): Delete function. Don't touch
`safe-local-eval-function` any more.
(cherry picked from commit
8a19c249f813e9f3830308e40f0205d7665f78a3)