strip-trailing-whitespace


/ Published in: Emacs Lisp
Save to your folder(s)

A solution to the 'strip-trailing-whitespace example found: http://stackoverflow.com/questions/41522/tips-for-learning-elisp/59589#59589


Copy this code and paste it in your HTML
  1. (defun strip-trailing-whitespace ()
  2. "remove all whitespace from the end of lines in the entire buffer"
  3. (interactive)
  4. (save-excursion
  5. (goto-char (point-min))
  6. (while (re-search-forward "\\s-+$" nil t)
  7. (replace-match ""))))

URL: http://stackoverflow.com/questions/41522/tips-for-learning-elisp/59589#59589

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.