Pregunta

I configured my Emacs 24.3 under Windows for python using the python.el that comes with Emacs 24.3, following is my snippet for python IDE configuration in init.el

;;; python IDE
;;; setup jedi and autocomplete for python
(require 'jedi)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:setup-keys 1)
(setq jedi:tooltip-method nil)
(add-hook 'python-mode-hook 'auto-complete-mode)
;; (add-hook 'after-init-hook #'global-flycheck-mode) ; flycheck for python
;;; setup ipython for default interpreter
(require 'python)
(require 'ein)
;;; setup ein for ipython notebook support
(setq ein:use-auto-complete-superpack t)
(add-hook 'ein:connect-mode-hook 'ein:jedi-setup)
(setq python-shell-interpreter "C:/Python27/python")
(setq python-shell-interpreter-args "-i C:/Python27/Scripts/ipython-script.py --pylab")
(setq python-shell-prompt-regexp "In \\[[0-9]+\\]: ")
(setq python-shell-prompt-output-regexp "Out\\[[0-9]+\\]: ")
(setq python-shell-completion-setup-code 
      "from IPython.core.completerlib import module_completion")
(setq python-shell-completion-module-string-code 
      "';'.join(module_completion('''%s'''))\n")
(setq python-shell-completion-string-code 
    "';'.join(get_ipython().Completer.all_completions('''%s'''))\n")

it works fine, but I got strange problem for the syntax highlighting as shown in the picture. some of the variables on the left are highlighted as red, and some are not highlighted... what's wrong there?

Emacs Python mode screenshot

¿Fue útil?

Solución

python.el highlihghts left hand side of assignment in a different color. It is known that it does not work with complex ones [1]. But it looks like the example you showed is simple enough (e.g. xfast_image at line 537). If you have Python code snippet to reproduce the issue, sending bug report would help Emacs devs [2].

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top