Skip to content

Instantly share code, notes, and snippets.

@danlamanna
Created October 4, 2012 19:35
Show Gist options
  • Save danlamanna/3835885 to your computer and use it in GitHub Desktop.
Save danlamanna/3835885 to your computer and use it in GitHub Desktop.
(defun php-closing-paren()
"Adds a closing paren to the end of the current line, but before any semicolons, if present."
(interactive)
(save-excursion
(setq now-until-eol (substring (buffer-string) (point) (line-end-position)))
(whitespace-cleanup)
(move-end-of-line nil)
(while (eq (char-before (point)) 59)
(backward-char 1))
(insert ")")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment