Created
July 12, 2011 20:17
-
-
Save bradclawsie/1078880 to your computer and use it in GitHub Desktop.
remove all newlines after text in elisp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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