Skip to content

Instantly share code, notes, and snippets.

@bradclawsie
Created July 12, 2011 20:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bradclawsie/1078880 to your computer and use it in GitHub Desktop.
Save bradclawsie/1078880 to your computer and use it in GitHub Desktop.
remove all newlines after text in elisp
(defun php-delete-trailing-blank-lines ()
"Deletes all blank lines at the end of the file."
(interactive)
(save-excursion
(save-restriction
(widen)
(goto-char (point-max))
(delete-blank-lines)
(let ((trailnewlines (abs (skip-chars-backward "\n\t"))))
(if (> trailnewlines 0)
(progn
(delete-char trailnewlines)))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment