Skip to content

Instantly share code, notes, and snippets.

@johnw42
Last active August 29, 2015 14:19
Show Gist options
  • Save johnw42/4101abdf4b62d0ce1dd1 to your computer and use it in GitHub Desktop.
Save johnw42/4101abdf4b62d0ce1dd1 to your computer and use it in GitHub Desktop.
;;;###autoload
(defun before-compile-hook (&rest _)
"Saves the current buffer if it is associated with a file."
(interactive)
(when buffer-file-name
(save-buffer)))
(provide 'before-compile-hook)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment