A fix for my whitespace deletion

I didn’t find this problem with my whitespace deletion hack, but if the file you’re editing is less than 25 lines, it bombs out. The (next-line 25) fails and kills the execution of the function.

Here’s the fixed code.

(defun delete-trailing-whitespacep ()
  "Should we delete trailing whitespace when saving this file?"
  (save-excursion
    (goto-char (point-min))
    (narrow-to-page)
    (goto-char (point-max))
    (let ((pos (point)))
      (goto-char (point-min))
      (re-search-forward (concat "@author +" user-full-name) pos t))
    (widen)))
2008/09/11
Previously On Atomized:

Participate