help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Configuring Anaconda-Mode and Company-Mode with IPython


From: Dmitry Gutov
Subject: Re: Configuring Anaconda-Mode and Company-Mode with IPython
Date: Fri, 17 Apr 2015 23:41:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:36.0) Gecko/20100101 Thunderbird/36.0

On 04/17/2015 05:48 AM, Daniel Galtieri wrote:

C-M-i provides all the correct completion options. The issue seems to be with 
whatever mechanism is behind generating the autocomplete tooltips. I'm not 
entirely sure what I changed, or if this never worked to begin with and I was 
mistaken in the first place, but if I do the following, for example:

Thanks for checking. Looking into this, seems like it never worked in the Python REPL buffers (or at least hasn't for a long while).

The `company-capf' backend wasn't used, you were simply getting completions from `company-dabbrev'.

sys.p M-x company-complete to manually start completion I get "No completion 
found". But if I type C-M-i I get a completions buffer with the appropriate methods.

I've pushed a fix below to the master repo. It should work now.

Oddly, if I type sys.p and then change my focus to another application (e.g. I click 
inside of firefox) and then switch my focus back to Emacs, typing "a" (for 
example) results in the autocompletion tooltip to pop up.

Sounds odd, but you probably weren't getting the right completions in this scenario, too.

There seems to be something funky going on, but I'm not entirely sure where to 
direct my questions.

The company-mode issue tracker is an okay venue for this kind of questions, too.


diff --git a/company-capf.el b/company-capf.el
index 4962a26..17b739b 100644
--- a/company-capf.el
+++ b/company-capf.el
@@ -1,6 +1,6 @@
;;; company-capf.el --- company-mode completion-at-point-functions back-end -*- lexical-binding: t -*-

-;; Copyright (C) 2013-2014  Free Software Foundation, Inc.
+;; Copyright (C) 2013-2015  Free Software Foundation, Inc.

 ;; Author: Stefan Monnier <address@hidden>

@@ -51,7 +51,7 @@
              (data (run-hook-wrapped 'completion-at-point-functions
                                      ;; Ignore misbehaving functions.
#'completion--capf-wrapper 'optimist)))
-    (when (and (consp (cdr data)) (numberp (nth 1 data))) data)))
+ (when (and (consp (cdr data)) (integer-or-marker-p (nth 1 data))) data)))

 (defun company-capf (command &optional arg &rest _args)
   "`company-mode' back-end using `completion-at-point-functions'."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]