2

I'm new in Emacs, and i was trying to set up environment for python development. I'm using python_mode 6.1.3 and jedi. This is my whole .emacs file:

(package-initialize)

(defun toggle-fullscreen ()
  (interactive)
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
             '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0))
  (x-send-client-message nil 0 nil "_NET_WM_STATE" 32
             '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0))
)
(toggle-fullscreen)

(setq py-install-directory "~/.emacs.d/python-mode.el-6.1.3")
(add-to-list 'load-path py-install-directory)
(require 'python-mode)

(setq py-load-pymacs-p t)
; python-mode

(require 'auto-complete-config)
(ac-config-default)

(add-hook 'python-mode-hook 'auto-complete-mode)
(add-hook 'python-mode-hook 'jedi:setup)
(setq jedi:complete-on-dot t)                 ; optional

(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(custom-enabled-themes (quote (solarized-dark)))
 '(custom-safe-themes(quote("8aebf25556399b58091e533e455dd50a6a9cba958cc4ebb0aab175863c25b9a4" default)))
 '(ido-mode (quote both) nil (ido))
 '(initial-buffer-choice "~/Projekt/Python/CNC/")
 '(menu-bar-mode nil)
 '(package-archives (quote (("gnu" . "http://elpa.gnu.org/packages/") ("melpa" . "http://melpa.milkbox.net/packages/"))))
 '(py-complete-function (quote py-complete-completion-at-point))
 '(scroll-bar-mode nil)
 '(tool-bar-mode nil))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
)

It works fine but not perfect for console. When i'm editing a buffer and want to execute i hit C-c C-c, which open a python shell (python or ipython i tried with both) and execute buffer. The problem is that classes and defs i made in executed file are not visible for the jedi auto completion in the shell mode. What's more auto completion doesn't toggle on automatically when the shell-mode starts, i need to toggle it by jedi:setup function. I want to solve 2 problems: 1. Make jedi works just after shell-mode starts without invoking jedi:setup 2.(more important) to make auto completion work for symbols in file i had executed I was checking different options, using python/ipython, manually executing execfile() or %run after turning on jedi ac. They all failed. I am not able to get decent ac for the file i executed in the python shell

Maciej
  • 193
  • 2
  • 11

0 Answers0