aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/python.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes/python.el')
-rw-r--r--lisp/progmodes/python.el8
1 files changed, 4 insertions, 4 deletions
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index 0d80110f7b7..c16b26100a1 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -2531,7 +2531,7 @@ the python shell:
2531 (concat 2531 (concat
2532 (format "# -*- coding: %s -*-\n" encoding) 2532 (format "# -*- coding: %s -*-\n" encoding)
2533 (make-string 2533 (make-string
2534 ;; Substract 2 because of the coding cookie. 2534 ;; Subtract 2 because of the coding cookie.
2535 (- (line-number-at-pos start) 2) ?\n)))) 2535 (- (line-number-at-pos start) 2) ?\n))))
2536 (toplevel-block-p (save-excursion 2536 (toplevel-block-p (save-excursion
2537 (goto-char start) 2537 (goto-char start)
@@ -3951,7 +3951,7 @@ operator."
3951 3951
3952(defun python-info-encoding-from-cookie () 3952(defun python-info-encoding-from-cookie ()
3953 "Detect current buffer's encoding from its coding cookie. 3953 "Detect current buffer's encoding from its coding cookie.
3954Returns the enconding as a symbol." 3954Returns the encoding as a symbol."
3955 (let ((first-two-lines 3955 (let ((first-two-lines
3956 (save-excursion 3956 (save-excursion
3957 (save-restriction 3957 (save-restriction
@@ -3968,9 +3968,9 @@ Returns the enconding as a symbol."
3968 "Return encoding for file. 3968 "Return encoding for file.
3969Try `python-info-encoding-from-cookie', if none is found then 3969Try `python-info-encoding-from-cookie', if none is found then
3970default to utf-8." 3970default to utf-8."
3971 ;; If no enconding is defined, then it's safe to use UTF-8: Python 2 3971 ;; If no encoding is defined, then it's safe to use UTF-8: Python 2
3972 ;; uses ASCII as default while Python 3 uses UTF-8. This means that 3972 ;; uses ASCII as default while Python 3 uses UTF-8. This means that
3973 ;; in the worst case escenario python.el will make things work for 3973 ;; in the worst case scenario python.el will make things work for
3974 ;; Python 2 files with unicode data and no encoding defined. 3974 ;; Python 2 files with unicode data and no encoding defined.
3975 (or (python-info-encoding-from-cookie) 3975 (or (python-info-encoding-from-cookie)
3976 'utf-8)) 3976 'utf-8))