diff --git a/.emacs.d/mode-python.el b/.emacs.d/mode-python.el index 884ac3bf..c0b9f216 100644 --- a/.emacs.d/mode-python.el +++ b/.emacs.d/mode-python.el @@ -10,7 +10,9 @@ checked, and if no shabang is present, `python' will be used." (defun python-version () "Returns whether we're running Python 2 or 3 according to the shebang. System `python' is assumed by default." - (let ((firstline (car (split-string (buffer-string) "\n" t)))) + (let ((firstline + (car + (split-string (buffer-substring-no-properties 1 (point-max)) "\n")))) (if (not (string-match "^#!" firstline)) "python" (cond diff --git a/.emacs.d/mode-shell.el b/.emacs.d/mode-shell.el index f11bdaaa..e5179f47 100644 --- a/.emacs.d/mode-shell.el +++ b/.emacs.d/mode-shell.el @@ -13,7 +13,9 @@ otherwise use 'sh-shell-file'." "Use compile to run python programs." (interactive) (hack-local-variables) - (let ((firstline (car (split-string (buffer-string) "\n" t)))) + (let ((firstline + (car + (split-string (buffer-substring-no-properties 1 (point-max)) "\n")))) (let ((sh-interpreter (if (not (string-match "^#!" firstline)) sh-shell-file