From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: daniel.galtieri@gmail.com Newsgroups: gmane.emacs.help Subject: Configuring Anaconda-Mode and Company-Mode with IPython Date: Wed, 15 Apr 2015 06:42:36 -0700 (PDT) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1429111710 7077 80.91.229.3 (15 Apr 2015 15:28:30 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 15 Apr 2015 15:28:30 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 15 17:28:29 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YiPEp-00088C-Fy for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Apr 2015 17:28:27 +0200 Original-Received: from localhost ([::1]:60950 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YiPEo-00073R-FZ for geh-help-gnu-emacs@m.gmane.org; Wed, 15 Apr 2015 11:28:26 -0400 X-Received: by 10.66.153.173 with SMTP id vh13mr35016776pab.37.1429105356771; Wed, 15 Apr 2015 06:42:36 -0700 (PDT) X-Received: by 10.182.78.65 with SMTP id z1mr178182obw.10.1429105356710; Wed, 15 Apr 2015 06:42:36 -0700 (PDT) Original-Path: usenet.stanford.edu!j5no1716433qga.1!news-out.google.com!a41ni339qgf.1!nntp.google.com!z60no1717639qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=71.57.89.63; posting-account=f7-ZvAoAAAB4-kU4KuXEoQsBjFpDC4Z5 Original-NNTP-Posting-Host: 71.57.89.63 User-Agent: G2/1.0 Injection-Date: Wed, 15 Apr 2015 13:42:36 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:211457 X-Mailman-Approved-At: Wed, 15 Apr 2015 11:28:14 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103741 Archived-At: I am new to using Emacs, and am currently trying to configure it to be a mo= re robust environment for coding in Python. To do this I'm using Company-Mode with Anaconda-Mode for autocompletion, al= ong with the defaul Python.el mode I would like to use IPython as my repl, but I'm experiencing some odd behav= ior with autocompletion in the IPython buffer (autocompletion works fine in= the normal python buffer(s)). Basically what happens is as follows: If I start typing something, such as "import sys" the appropriate hints for= import and sys pop up (so that's working fine). When I go to use sys, though, if I symply type "sy" and then hit tab/enter = to complete sys and then go to use one of the methods in sys (e.g. sys.path= ), again the appropriate hints are shown (so again, working fine) However, if instead I type out sys and try to then continue by typing sys.p= , no hints are shown. I can force company to complete manually with M-x com= pany-complete, but obviously this is not the desired behavior. I think this may have something to do with Anaconda-mode and IPython. Looki= ng at my Python buffers, Anaconda-mode is listed as one of the minor modes,= but it is not listed in my IPython buffer. Disabling Anaconda-mode in my P= ython buffers also produces the behavior described above. If I manually sta= rt Anaconda-mode in the IPython buffer (Inferior Python), the tooltips now = activate properly but the contents are incorrect (i.e. the class methods sh= own to be available are not correct).=20 Also, I'm using company-quickhelp for docstring tooltips. In none of the ab= ove scenarios do the docstring tooltips popup.=20 I'm assuming there is an issue with how I have IPython / Anacanda-mode (and= associated company-anaconda backed) / company-mode, but I'm not sure how t= o resolve it.=20 Also, I'm not sure if it's related to this or not, but looking at the *Mess= ages* buffer, whenever I go to type in the IPython buffer I see the followi= ng message popping up: Invalid face reference: nil [nnn times] where the value for nnn increases every time I type in the IPython buffer I have my configuration split up into different files: init.el: ;;; add path to settings files (add-to-list 'load-path "~/.emacs.d/settings") ;;; setup package management (require 'package) (package-initialize) (add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t) ;;; configure general settings (require 'general-settings) ;;; configure general settings for all coding buffers (require 'general-code-settings) ;;; (require 'python-settings) ;;; init.el ends here python-settings.el: ;;enable anaconda-mode and eldoc-mode in all python buffers (add-hook 'python-mode-hook 'anaconda-mode) (add-hook 'python-mode-hook 'eldoc-mode) ;;use IPython (setq python-shell-interpreter "ipython") (provide 'python-settings) ;;; python-settings.el ends here general-code-settings.el: ;;enable company mode globally and add company-anaconda backend (add-hook 'after-init-hook 'global-company-mode) ;;(add-hook 'prog-mode-hook 'company-mode) (with-eval-after-load 'company (add-to-list 'company-backends 'company-anaconda)) ;;makes completion start automatically rather than waiting for 3 chars / 0.= 5sec (setq company-minimum-prefix-length 1) (setq company-idle-delay 0) ;;company quickhelp gives docstring info (company-quickhelp-mode 1) ;;enable flycheck (add-hook 'after-init-hook #'global-flycheck-mode) ;;enable fill-column-indicator for 80char line indication (require 'fill-column-indicator) (add-hook 'prog-mode-hook 'fci-mode) (setq fci-rule-column 80) ;;workaround for bug between company mode and fill-column-indicator (defvar-local company-fci-mode-on-p nil) (defun company-turn-off-fci (&rest ignore) (when (boundp 'fci-mode) (setq company-fci-mode-on-p fci-mode) (when fci-mode (fci-mode -1)))) (defun company-maybe-turn-on-fci (&rest ignore) (when company-fci-mode-on-p (fci-mode 1))) (add-hook 'company-completion-started-hook 'company-turn-off-fci) (add-hook 'company-completion-finished-hook 'company-maybe-turn-on-fci) (add-hook 'company-completion-cancelled-hook 'company-maybe-turn-on-fci) (provide 'general-code-settings) ;;; general-code-settings.el ends here