why care about trailing whitespace?<br><br><div class="gmail_quote">On Nov 16, 2007 8:14 AM, Valery V. Vorotyntsev &lt;<a href="mailto:valery.vv@gmail.com">valery.vv@gmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Add the following lines to your ~/.emacs:<br><br>------- BEGIN OF ELISP CODE -------<br>;(global-set-key (kbd &quot;&lt;f9&gt; s&quot;) &#39;delete-trailing-whitespace)<br><br>(defun delete-trailing-whitespace-if-confirmed ()
<br> &nbsp;&quot;Delete all the trailing whitespace across the current buffer,<br>asking user for confirmation.&quot;<br> &nbsp;(if (and (save-excursion (goto-char (point-min))<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (re-search-forward &quot;[[:space:]]$&quot; nil t))
<br> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (y-or-n-p &quot;Delete trailing whitespace? &quot;))<br> &nbsp; &nbsp; &nbsp;(delete-trailing-whitespace)))<br><br>(add-hook &#39;before-save-hook &#39;delete-trailing-whitespace-if-confirmed)<br>------- END OF ELISP CODE -------
<br><br>Have fun!<br><font color="#888888"><br>--<br>vvv<br>_______________________________________________<br>Haskell-Cafe mailing list<br><a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br><a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">
http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br></font></blockquote></div><br>