From 86e8b035922f4a33816ead9bf6379c9ff7d8791c Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 18 Dec 2015 01:03:41 +0100 Subject: Move python-mode-func to Python library --- emacs/.emacs.d/init.el | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'emacs/.emacs.d/init.el') diff --git a/emacs/.emacs.d/init.el b/emacs/.emacs.d/init.el index d519b91..d4b73bd 100644 --- a/emacs/.emacs.d/init.el +++ b/emacs/.emacs.d/init.el @@ -141,15 +141,6 @@ MODE1 is enabled and vice-versa." "Set the `disabled' property for each item in FUNCTIONS to nil." (mapc #'(lambda (f) (put f 'disabled nil)) functions)) -(defun oni:python-mode-func () - "Function for `python-mode-hook'." - (local-set-key (kbd "C->") 'python-indent-shift-right) - (local-set-key (kbd "C-<") 'python-indent-shift-left) - (set (make-local-variable 'electric-indent-chars) nil) - (setq-local fci-rule-column 79) - (setq-local fill-column 72) - (setq-local whitespace-style '(tab-mark))) - (defun oni:raise-ansi-term (arg) "Create or show an `ansi-term' buffer." (interactive "P") @@ -873,6 +864,16 @@ If no direction is given, don't split." ;; Only autofill comments in programming buffers. (add-hook 'prog-mode-hook 'oni:auto-fill-only-comments) +;; Set Python mode-specific keybindings. +(add-hook 'python-mode-hook 'oni:set-keys-for-python) + +;; Set PEP 8 margin settings for Python +(add-hook 'python-mode-hook 'oni:set-pep8-margin) +(add-hook 'python-mode-hook 'oni:set-pep8-fill-column) + +;; Make `whitespace-mode' show tabs +(add-hook 'python-mode-hook 'oni:set-whitespace-tab-display) + (oni:add-function-to-hooks 'oni:make-readable 'Info-mode-hook 'gnus-article-mode-hook 'gnus-group-mode-hook 'org-agenda-mode-hook) @@ -934,8 +935,7 @@ If no direction is given, don't split." (oni:add-hooks 'python-mode-hook (lambda () (setq ac-sources '(ac-source-jedi-direct))) #'oni:set-python-symbols #'whitespace-mode - #'oni:python-mode-func #'oni:set-python-imenu-function - #'jedi:setup #'subword-mode) + #'oni:set-python-imenu-function #'jedi:setup #'subword-mode) (oni:add-hooks 'slime-repl-mode-hook #'paredit-mode #'set-up-slime-ac) -- cgit v1.2.3-54-g00ecf