Skip to content

Instantly share code, notes, and snippets.

@ngn999
Forked from clvrobj/gist:3795035
Created February 2, 2013 06:30
Show Gist options
  • Save ngn999/4696309 to your computer and use it in GitHub Desktop.
Save ngn999/4696309 to your computer and use it in GitHub Desktop.
(defun add-py-header ()
"check and add # -*- coding: utf-8 -*-"
(interactive)
(let ((pyheader "# -*- coding: utf-8 -*-"))
(if (not (equal pyheader (buffer-substring-no-properties 1 (1+ (length pyheader)))))
(progn (goto-char 1)
(insert (concat pyheader "\n\n"))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment