On 01.09.2014 21:24, Urs Fleisch wrote:
Hi Andreas, Barry,
Hi Emacs-Pythonistas,

being inclined to drop that feature

https://bugs.launchpad.net/python-mode/+bug/1001328

Emacs provides dabbrev-expand, which is Python-agnostic but fairly
effectiv. Otherwise the buffers content needs to be evaluated - with
means, it must be correct already.

I'm probably not qualified to say whether the feature should be kept
or not, since I use dabbrev exclusively.

Since I have contributed quite some code for Python code completion in
Emacs, I feel a bit concerned by this question, so let me say a few
things about the current state of completion.

It's been two years ago when I contributed my completion code, but
still, it is quite hard to get a working Emacs-Python-Environment
having code completion. I think that a novice (or non-expert) user will
have problems getting it working. Theoretically it could be quite easy,
just create a ~/.emacs.d/init.el file with the following contents:

(require 'pymacs)
(setq py-load-pymacs-p t)
(require 'auto-complete-config)
(ac-config-default)

This is for code completing with an auto-complete pop-up-menu. If you
prefer a less obtrusive completion using only the TAB key (as I do),
then use these lines:

(require 'pymacs)
(setq py-load-pymacs-p t)
(setq py-complete-function 'py-complete-completion-at-point)
(setq py-complete-set-keymap-p t)

So far so good. However, the problem is, that you must have at least
pymacs 0.25, which is unfortunately not part of Ubuntu 14.04 (to name a
popular distribution). In this case, you'll have to get pymacs 0.25 (and
emacsen-common) from the upcoming Ubuntu 14.10. So with a standard
Ubuntu 14.04 LTS installation, it will not work. Let's hope that things
improve with Ubuntu 14.10, then users will at least have all
preconditions for a working code completion.

However, I think that it will be still too hard for the normal user to
make it work. Why not have a simple configuration option, which will
allow users to enable code completion by a simple mouse click? Such a
function should set up all variables and check if the required packages
are available and warn the user if not. I must admit that I do not use
the Emacs package management (ELPA), I would rather rely on the
packages of my Linux distribution, but maybe ELPA could be helpful to
get all those prerequisites.

Regards,
Urs


Hi Urs,

yes, works great for me.

Just a remark: `py-load-pymacs-p' addresses Pymacs-files inlined by 
python-mode, not a Pymacs installed by running `make'.

Loading both, might result in an version-conflict. So in case of running an 
make'd Pymacs, `py-load-pymacs-p' should be nil, the default.

Instead user must follow the install hints delivered with Pymacs-package.

Best,

Andreas


_______________________________________________
Python-mode mailing list
Python-mode@python.org
https://mail.python.org/mailman/listinfo/python-mode

Reply via email to