当我调用py-execute-region (绑定到C-c |)时,我从flymake-get- file -name-mode-and-mask“无效的文件名”中得到了一个错误。还会出现名为/tmp/python-3434.py的void buffer。
我的flymake设置:
(when (load "flymake" t)
(defun flymake-pylint-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "epylint" (list local-file))))(add-to-list 'flymake-allowed-file-name-masks '(".py\'“flymake-pylint-init) (add-hook 'python-mode-hook 'flymake-mode)
发布于 2010-05-19 17:20:31
我遇到了同样的问题,并通过让emacs不加载flymake来将临时缓冲区传递给解释器来解决它。我
Python的flymake设置的相关部分:
(when (load "flymake" t)
(defun flymake-python-init ()
(let* ((temp-file (flymake-init-create-temp-buffer-copy
'flymake-create-temp-inplace))
(local-file (file-relative-name
temp-file
(file-name-directory buffer-file-name))))
(list "pyflymake" (list local-file)))) ; substitute epylint for this
(push '(".+\\.py$" flymake-python-init) flymake-allowed-file-name-masks))
(add-hook 'python-mode-hook
(lambda ()
; Activate flymake unless buffer is a tmp buffer for the interpreter
(unless (eq buffer-file-name nil) (flymake-mode t)) ; this should fix your problem
;; Bind a few keys for navigating errors
(local-set-key (kbd "C-c w") 'show-fly-err-at-point) ; remove these if you want
(local-set-key (kbd "M-n") 'flymake-goto-next-error)
(local-set-key (kbd "M-p") 'flymake-goto-prev-error)))https://stackoverflow.com/questions/2681203
复制相似问题