On 11/16/07, Valery V. Vorotyntsev <[EMAIL PROTECTED]> wrote: > Add the following lines to your ~/.emacs:
Adding buffer name to confirmation message: ------- BEGIN ------- (defun delete-trailing-whitespace-if-confirmed () "Delete all the trailing whitespace across the current buffer, asking user for confirmation." (if (and (save-excursion (goto-char (point-min)) (re-search-forward "[[:space:]]$" nil t)) (y-or-n-p (format "Delete trailing whitespace from %s? " (buffer-name)))) (delete-trailing-whitespace))) ------- END ------- > (add-hook 'before-save-hook 'delete-trailing-whitespace-if-confirmed) -- vvv _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe