0

I've configure emacs to write python code and I love it!:). It works very well but after some situations that I cannot understand the autocomplete stops working on all buffers. If I restart emacs it works again. Sorry for the vague question but maybe some emacs expert can figure it out by looking at my init.el file. Thanks in advance! :)

;; Added by Package.el.  This must come before configurations of
;; installed packages.  Don't delete this line.  If you don't want it,
;; just comment it out by adding a semicolon to the start of the line.
;; You may delete these explanatory comments.
(package-initialize)

(require 'doom-themes)

;; Global settings (defaults)
(setq doom-themes-enable-bold t    ; if nil, bold is universally disabled
      doom-themes-enable-italic t) ; if nil, italics is universally disabled

;; Load the theme (doom-one, doom-molokai, etc); keep in mind that each theme
;; may have their own settings.
(load-theme 'doom-one t)

;; Enable flashing mode-line on errors
(doom-themes-visual-bell-config)

;; Enable custom neotree theme (all-the-icons must be installed!)
;;(doom-themes-neotree-config)



(setq ring-bell-function 'ignore)
(fset 'yes-or-no-p 'y-or-n-p)
(electric-pair-mode 1)


;;(set-background-color "#635050")
;;(set-foreground-color "cornsilk1")
(set-face-attribute 'default nil :height 150)
(tool-bar-mode -1)
(global-linum-mode t)


(setq backup-directory-alist
      `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

(setq mac-right-option-modifier nil)
(setq mac-command-modifier 'control)

(show-paren-mode 1)


(setq electric-pair-pairs
      '(
        (?\' . ?\')
        (?\{ . ?\})

    )
)


(desktop-save-mode 1)



(add-hook 'python-mode-hook 'highlight-indent-guides-mode)


(require 'neotree)
(global-set-key [f8] 'neotree-toggle)




(setq default-directory "~/")

(setq elpy-rpc-python-command "/Users/marco/emacspython/bin/python2.7")
(elpy-enable)
;;(add-hook 'after-init-hook 'global-company-mode)

(require 'pyvenv)
(pyvenv-activate "/Users/marco/emacspython")

(when (>= emacs-major-version 24)
  (require 'package)
  (add-to-list
   'package-archives
   '("melpa" . "http://melpa.org/packages/") ; many packages won't show if using stable
  ;; '("melpa" . "http://melpa.milkbox.net/packages/")
   t))



(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.
 '(exec-path
   (quote
    ("/Users/marco/emacspython/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin" "/Applications/Emacs.app/Contents/MacOS/bin-x86_64-10_9" "/Applications/Emacs.app/Contents/MacOS/libexec-x86_64-10_9" "/Applications/Emacs.app/Contents/MacOS/libexec" "/Applications/Emacs.app/Contents/MacOS/bin" "/usr/local/bin/")))
 '(package-selected-packages
   (quote
    (doom-themes magit pyenv-mode neotree elpy highlight-indent-guides))))
(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.
 )
  • Welcome to Stack Exchange! You're more likely to get an answer to your question if you follow this guide about asking questions: stackoverflow.com/help/how-to-ask For example, to format your code snippets, highlight the code and press "Ctrl+k". – Lorem Ipsum Jan 14 at 13:23
  • That being said, I sometimes have difficulty with autocomplete in company-mode. Emacs hangs while it looks for possible completions. In such a scenario, you can interrupt the search process with repeated cancel commands, C-g. – Lorem Ipsum Jan 14 at 13:24
  • 1
    Ok thanks for the posting suggestions! C-g didn't work but I found out that it was an rpc issue that many have experienced. For now I do elpy-rpc-restart and suggestions start to appear again. I will still investigate and if I find a proper solution I will post it there – Marco Gabaglio Jan 14 at 15:21
  • There is the (elpy-config) command which shows the current elpy configuration. Check that. I notice that you're enabling elpy before activating the virtual environment. It might be that elpy is pulling from the system install rather than the virtual environment. You might try doing those in reverse order; do the pyenv-activate before the elpy-enable. – Lorem Ipsum Jan 14 at 15:28
  • Also, here's a pdf version of the elpy documentation. I find that easier to search through than the website: media.readthedocs.org/pdf/elpy/latest/elpy.pdf – Lorem Ipsum Jan 14 at 15:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.