From 0258e9aa5a66948f9a69507a2ad56fbe15ae93f0 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 18 Dec 2015 20:45:28 +0100 Subject: Move some functions to the Python library --- emacs/.emacs.d/site-lisp/oni-python.el | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'emacs/.emacs.d/site-lisp/oni-python.el') diff --git a/emacs/.emacs.d/site-lisp/oni-python.el b/emacs/.emacs.d/site-lisp/oni-python.el index 7dc6f21..e2cc7d6 100644 --- a/emacs/.emacs.d/site-lisp/oni-python.el +++ b/emacs/.emacs.d/site-lisp/oni-python.el @@ -25,6 +25,7 @@ ;;; Code: +(require 'auto-complete) (require 'fill-column-indicator) (require 'python) (require 'whitespace) @@ -93,6 +94,28 @@ "Set the `fci-rule-column' the the PEP 8 recommendation." (setq-local fci-rule-column 79)) +;;;###autoload +(defun oni:set-python-completion-sources () + "Set `ac-sources' to python-specific sources." + (setq ac-sources '(ac-source-jedi-direct))) + +;;;###autoload +(defun oni:set-python-imenu-function () + "Set the `imenu-create-index-function' variable. + +For `python-mode' I prefer `python-imenu-create-flat-index'." + (setq imenu-create-index-function #'python-imenu-create-flat-index)) + +;;;###autoload +(defun oni:set-python-symbols () + "Set a few extra UTF-8 symbols for use in python." + (when (boundp 'prettify-symbols-alist) + (setq prettify-symbols-alist + '(("lambda" . ?λ) + ("<=" . ?≤) + (">=" . ?≥) + ("!=" . ?≠))))) + ;;;###autoload (defun oni:set-whitespace-tab-display () "Set the `whitespace-style' to show only tabs." -- cgit v1.2.3-54-g00ecf