Fix byte-compile warnings

- use `with-current-buffer` instead `save-excursion` + `set-buffer`
- use `called-interactively-p` instead of `interactive-p`
- fix position of global variable declaration
Merge pull request #2 from syohex/fix-byte-compile-warnings

Fix byte-compile warnings