Posted By

bigfaceworm on 08/21/09


Tagged

whitespace emacs LISP


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

melling
darkhawk


strip-trailing-whitespace


 / Published in: Emacs Lisp
 

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

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

  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 ""))))

Report this snippet  

You need to login to post a comment.