Merge branch 'master' into back-to-eieio

This commit is contained in:
John Miller 2017-07-16 19:38:31 -05:00
commit 96ae9f8316
7 changed files with 82 additions and 42 deletions

View file

@ -0,0 +1,13 @@
.. _changelog_0_13_0:
v0.13.0
-------
* Added commands ``ein:jupyter-server-start``, ``ein:jupyter-server-stop``, and
``ein:jupyter-server-login-and-open``.
* New interface for configuring code completion. See the new customizable
variable `ein:completion-backend`.
* Because of this `ein:use-auto-complete` is now deprecated, but EIN will still
try to do the right thing if it sees this variable is still defined.

BIN
doc/source/ein_logo.jpg Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -1,5 +1,6 @@
The Emacs IPython Notebook
==========================
=====================================
.. image:: ein_logo.jpg
.. el:package:: ein
@ -10,8 +11,7 @@ evaluation, object inspection and code completion. These features can be
accessed anywhere in Emacs and improve Python code editing and reading in
general in Emacs.
.. _`Emacs IPython Notebook (EIN)`:
https://github.com/millejoh/emacs-ipython-notebook
.. _`Emacs IPython Notebook (EIN)`: https://github.com/millejoh/emacs-ipython-notebook
.. _SLIME: http://common-lisp.net/project/slime/
@ -61,7 +61,6 @@ Links:
.. [#] Use the command :el:symbol:`ein:connect-to-notebook-command`.
Quick try
---------
@ -437,7 +436,7 @@ configurable variables are listed below.
Subpackages
^^^^^^^^^^^
.. el:variable:: ein:use-auto-complete
.. el:variable:: ein:completion-backend
.. el:variable:: ein:use-auto-complete-superpack
.. el:variable:: ein:ac-max-cache
.. el:variable:: ein:use-smartrep
@ -651,21 +650,11 @@ Change Log
==========
v0.13.0
-------
.. include:: Changelog/v0_13_0.txt
* Added commands ``ein:jupyter-server-start``, ``ein:jupyter-server-stop``, and
``ein:jupyter-server-login-and-open``.
.. include:: Changelog/v0_12_3.txt
v0.12.3
-------
.. include:: changelog/v0_12_3.txt
v0.12.2
-------
.. include:: changelog/v0_12_2.txt
.. include:: Changelog/v0_12_2.txt
v0.12.1

View file

@ -38,8 +38,8 @@
(when (require 'auto-complete nil t)
(require 'ein-ac))
(cond
((and (or ein:use-auto-complete
ein:use-auto-complete-superpack)
((and (or (eql ein:completion-backend 'ein:use-ac-backend)
(eql ein:completion-backend 'ein:use-ac-jedi-backend))
(ein:eval-if-bound 'auto-complete-mode)
(fboundp 'ein:completer-finish-completing-ac))
#'ein:completer-finish-completing-ac)
@ -115,13 +115,13 @@
must be `t' to enable this option. This variable has effect on
notebook buffers and connected buffers."
:type 'boolean
:group 'ein)
:group 'ein-completion)
(defun ein:complete-on-dot-install (map &optional func)
(if (and ein:complete-on-dot
(featurep 'auto-complete)
(or ein:use-auto-complete
ein:use-auto-complete-superpack))
(or (eql ein:completion-backend 'ein:use-ac-backend)
(eql ein:completion-backend 'ein:use-ac-jedi-backend)))
(define-key map "." (or func #'ein:completer-dot-complete))
(define-key map "." nil)))

View file

@ -86,9 +86,9 @@
"Setup auto-completion using EIN and Jedi.el_ together.
Jedi.el_ is a Python auto-completion library for Emacs.
To use EIN and Jedi together, add the following in your Emacs setup.::
To use EIN and Jedi together, add the following in your Emacs setup before loading EIN.::
(add-hook 'ein:connect-mode-hook 'ein:jedi-setup)
(setq ein:completion-backend 'ein:use-ac-jedi-backend)
.. _Jedi.el: https://github.com/tkf/emacs-jedi"
(let ((map ein:connect-mode-map))

View file

@ -577,9 +577,11 @@ notebook buffer then the user will be prompted to select an opened notebook."
(defun ein:notebook-complete-dot ()
"Insert dot and request completion."
(interactive)
(unless (or (eql ein:completion-backend 'ein:use-company-backend)
(eql ein:completion-backend 'ein:use-company-jedi-backend))
(if (and ein:%notebook% (ein:codecell-p (ein:get-cell-at-point)))
(ein:completer-dot-complete)
(insert ".")))
(insert "."))))
(defun ein:notebook-kernel-interrupt-command ()
"Interrupt the kernel.
@ -1558,8 +1560,20 @@ This hook is run regardless the actual major mode used."
(defun ein:notebook-mode ()
(funcall (ein:notebook-choose-mode))
(ein:complete-on-dot-install
ein:notebook-mode-map 'ein:notebook-complete-dot)
(case ein:completion-backend
(ein:use-ac-backend (ein:complete-on-dot-install ein:notebook-mode-map 'ein:notebook-complete-dot)
(auto-complete-mode +1))
(ein:use-ac-jedi-backend (jedi:setup)
(add-to-list 'ein:connect-mode-hook 'ein:jedi-setup)
(auto-complete-mode +1))
(ein:use-company-backend (require 'ein-company)
(add-to-list 'company-backends 'ein:company-backend)
(company-mode +1))
(ein:use-company-jedi-backend (warn "Support for jedi+company currently not implemented. Defaulting to just company-mode")
(require 'ein-company)
(add-to-list 'company-backends 'ein:company-backend)
(company-mode +1))
(t (warn "No autocompletion backend has been selected - see `ein:completion-backend'.")))
(ein:aif ein:helm-kernel-history-search-key
(define-key ein:notebook-mode-map it 'helm-ein-kernel-history))
(ein:aif ein:anything-kernel-history-search-key

View file

@ -31,19 +31,36 @@
(declare-function ein:ac-config-once "ein-ac")
(declare-function ein:smartrep-config-once "ein-smartrep")
(defcustom ein:completion-backend 'ein:use-ac-backend
"Determines which completion backend to use in opened EIN notebooks.
(defcustom ein:use-auto-complete nil
"Set to `t' to use preset auto-complete configuration.
Use `ein:use-auto-complete-superpack' when you need more powerful
auto completion."
:type 'boolean
:group 'ein)
After changing the value of this variable it is recommended that
you restart Emacs. The available completion backends are::
* ein:use-ac-backend : Use auto-complete with IPython's builtin completion engine.
* ein:use-ac-jedi-backend : Use auto-complete with the Jedi backend.
* ein:use-company-backend : Use company-mode with IPython's builtin completiong engine.
* ein:use-company-jedi-backends : Use company-mode with the Jedi backend (currently not implemented).
"
:type '(radio
(const :tag "Auto-Complete" 'ein:use-ac-backend)
(const :tag "Auto-Complete + Jedi" 'ein:use-ac-jedi-backend)
(const :tag "Company Mode" 'ein:use-company-backend)
(const :tag "Company Mode + Jedi" 'ein:use-company-jedi-backend))
:group 'ein-completion)
;; (defcustom ein:use-auto-complete nil
;; "Set to `t' to use preset auto-complete configuration.
;; Use `ein:use-auto-complete-superpack' when you need more powerful
;; auto completion."
;; :type 'boolean
;; :group 'ein-completion)
(defcustom ein:use-auto-complete-superpack nil
"Set to `t' to use preset a little bit hacky auto-complete configuration.
When this option is enabled, cached omni completion is available."
:type 'boolean
:group 'ein)
:group 'ein-completion)
(defcustom ein:use-smartrep nil
"Set to `t' to use preset smartrep configuration.
@ -68,16 +85,23 @@ When this option is enabled, cached omni completion is available."
(defun ein:subpackages-load ()
"Load sub-packages depending on configurations."
(when (or ein:use-auto-complete
ein:use-auto-complete-superpack)
(case ein:completion-backend
((ein:use-ac-backend ein:use-ac-jedi-backend)
(require 'ein-ac)
(ein:ac-config-once ein:use-auto-complete-superpack))
(t (if (boundp 'ein:use-auto-complete)
(progn
(warn "ein:use-auto-complete has been deprecated. Please see `ein:completion-backend' for configuring autocompletion in ein.")
(setq ein:completion-backend 'ein:use-ac-backend)
(require 'ein-ac)
(ein:ac-config-once ein:use-auto-complete-superpack)))))
(when ein:use-smartrep
(require 'ein-smartrep)
(ein:smartrep-config-once))
(when ein:load-dev
(require 'ein-dev)))
(defun ein:subpackages-reload ()
"Reload sub-packages."
(interactive)