We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http://liu233w.github.io/blog/2016/09/29/org-python-windows/
;; 设置编码 (cond ((eq system-type 'windows-nt) ; 或者 (spacemacs/system-is-mswindows) ;; (set-language-environment "chinese-gbk") (prefer-coding-system 'utf-8) (set-terminal-coding-system 'gbk) ;; (modify-coding-system-alist 'process "*" 'gbk) (defun liu233w/windows-shell-mode-coding () (set-buffer-file-coding-system 'gbk) (set-buffer-process-coding-system 'gbk 'gbk)) (add-hook 'shell-mode-hook #'liu233w/windows-shell-mode-coding) (add-hook 'inferior-python-mode-hook #'liu233w/windows-shell-mode-coding) ;; (defun liu233w//python-encode-in-org-babel-execute (func body params) "org-babel 执行代码时不会自动编码文件,这里通过动态作用域覆 盖默认选项来编码文件。" ;; 此问题的详细信息请参考:Liu233w/.spacemacs.d#6 (let ((coding-system-for-write 'utf-8)) (funcall func body params))) (advice-add #'org-babel-execute:python :around #'liu233w//python-encode-in-org-babel-execute)) ;; -- (t (set-language-environment "UTF-8") (prefer-coding-system 'utf-8)))
The text was updated successfully, but these errors were encountered:
No branches or pull requests
http://liu233w.github.io/blog/2016/09/29/org-python-windows/
;; 设置编码
(cond
((eq system-type 'windows-nt) ; 或者 (spacemacs/system-is-mswindows)
;;
(set-language-environment "chinese-gbk")
(prefer-coding-system 'utf-8)
(set-terminal-coding-system 'gbk)
;;
(modify-coding-system-alist 'process "*" 'gbk)
(defun liu233w/windows-shell-mode-coding ()
(set-buffer-file-coding-system 'gbk)
(set-buffer-process-coding-system 'gbk 'gbk))
(add-hook 'shell-mode-hook #'liu233w/windows-shell-mode-coding)
(add-hook 'inferior-python-mode-hook #'liu233w/windows-shell-mode-coding)
;;
(defun liu233w//python-encode-in-org-babel-execute (func body params)
"org-babel 执行代码时不会自动编码文件,这里通过动态作用域覆
盖默认选项来编码文件。"
;; 此问题的详细信息请参考:Liu233w/.spacemacs.d#6
(let ((coding-system-for-write 'utf-8))
(funcall func body params)))
(advice-add #'org-babel-execute:python :around
#'liu233w//python-encode-in-org-babel-execute))
;; --
(t
(set-language-environment "UTF-8")
(prefer-coding-system 'utf-8)))
The text was updated successfully, but these errors were encountered: