Install elpa-ws-butler by entering the following commands in the terminal:
sudo apt update sudo apt install elpa-ws-butler
Description:
unobtrusively remove trailing whitespace in Emacs
This package provides ws-butler-mode and ws-butler-global-mode. Upon saving a file in Emacs, these modes delete trailing whitespace on lines of the buffer that have been edited. . As compared with simply calling delete-trailing-whitespace in your before-save-hook, ws-butler has the advantage of not cluttering up version control commits with whitespace cleanup outside of the part of the file you have edited.
Homepage: https://github.com/lewang/ws-butler
Version: 0.6-1
Section: universe/lisp