From fc562db128dabc0fa2daf7507882215b9c889017 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 26 Mar 2013 10:15:38 -0700 Subject: [PATCH 1/5] Stop loading pymacs everytime a python file is loaded. --- init.el | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/init.el b/init.el index 839e4fca..5bc44740 100644 --- a/init.el +++ b/init.el @@ -86,17 +86,15 @@ ;; Multi-lining for python. (require 'multi-line-it) -;; Pymacs -(add-hook 'python-mode-hook - (lambda () - (require 'pymacs) - (autoload 'pymacs-apply "pymacs") - (autoload 'pymacs-call "pymacs") - (autoload 'pymacs-eval "pymacs" nil t) - (autoload 'pymacs-exec "pymacs" nil t) - (autoload 'pymacs-load "pymacs" nil t) - (autoload 'pymacs-autoload "pymacs") - (pymacs-load "ropemacs" "rope-"))) + +(require 'pymacs) +(autoload 'pymacs-apply "pymacs") +(autoload 'pymacs-call "pymacs") +(autoload 'pymacs-eval "pymacs" nil t) +(autoload 'pymacs-exec "pymacs" nil t) +(autoload 'pymacs-load "pymacs" nil t) +(autoload 'pymacs-autoload "pymacs") +(pymacs-load "ropemacs" "rope-") (defun python-tabs () (setq tab-width 4 From efc1953b17bdcb19d1e0e7cc01c33b864dc23f38 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 26 Mar 2013 11:54:04 -0700 Subject: [PATCH 2/5] Added ignore, turn subword mode on for python mode. --- .gitignore | 3 ++- init.el | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b36739c1..2fe01e92 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ auto-save-list eproject.lst *.elc .smex-items -places \ No newline at end of file +places +backups \ No newline at end of file diff --git a/init.el b/init.el index 5bc44740..4d1d180e 100644 --- a/init.el +++ b/init.el @@ -100,7 +100,10 @@ (setq tab-width 4 indent-tabs-mode t python-indent-offset 4)) -(python-tabs) + +;; Yelp always uses tabs. +(add-hook 'python-mode-hook 'python-tabs) +(add-hook 'python-mode-hook 'subword-mode) ;; ============================================================================= ;; Custom Key Bindings From b75eb68e021fc7030e251344722af1e959a21a51 Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Tue, 26 Mar 2013 12:00:17 -0700 Subject: [PATCH 3/5] Got rid of tabs by default for python. --- init.el | 2 -- 1 file changed, 2 deletions(-) diff --git a/init.el b/init.el index 4d1d180e..1b959227 100644 --- a/init.el +++ b/init.el @@ -101,8 +101,6 @@ indent-tabs-mode t python-indent-offset 4)) -;; Yelp always uses tabs. -(add-hook 'python-mode-hook 'python-tabs) (add-hook 'python-mode-hook 'subword-mode) ;; ============================================================================= From af25444cf837d43a512c2c03b3f25efae80fa6ea Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 27 Mar 2013 18:25:41 -0700 Subject: [PATCH 4/5] Updates from work. --- .gitignore | 3 +-- init.el | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 2fe01e92..b36739c1 100644 --- a/.gitignore +++ b/.gitignore @@ -3,5 +3,4 @@ auto-save-list eproject.lst *.elc .smex-items -places -backups \ No newline at end of file +places \ No newline at end of file diff --git a/init.el b/init.el index 1b959227..9d092eed 100644 --- a/init.el +++ b/init.el @@ -59,9 +59,17 @@ (menu-bar-mode -1) ;; ============================================================================= -;; Flymake +;; tmux ;; ============================================================================= +(defun tmux-copy (&optional b e) + (interactive "r") + (shell-command-on-region b e "cat | tmux loadb -")) + +;; ;; ============================================================================= +;; ;; Flymake +;; ;; ============================================================================= + (require 'flymake) (require 'flymake-cursor) @@ -99,9 +107,11 @@ (defun python-tabs () (setq tab-width 4 indent-tabs-mode t - python-indent-offset 4)) + python-indent-offset 4 + (subword-mode t))) -(add-hook 'python-mode-hook 'subword-mode) +;; Yelp always uses tabs. +(add-hook 'python-mode-hook 'python-tabs) ;; ============================================================================= ;; Custom Key Bindings @@ -123,6 +133,10 @@ (global-set-key "\C-x\C-i" 'increase-left-margin) (global-set-key "\C-x\C-d" 'decrease-left-margin) (global-set-key "\C-c\C-c" 'comment-region) +(global-set-key (kbd "C-c w") 'tmux-copy) + +;; Something will occasionally override this binding. +(global-set-key "\C-cg" 'rope-goto-definition) ;; ============================================================================= ;; ELPA From 476d0bdd8cc5f9bb1c6aa7e05490ccd21e7198cc Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Wed, 27 Mar 2013 21:23:22 -0700 Subject: [PATCH 5/5] Tweaks. --- init.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/init.el b/init.el index 9d092eed..7ddafe15 100644 --- a/init.el +++ b/init.el @@ -83,7 +83,7 @@ (add-to-list 'flymake-allowed-file-name-masks '("\\.py\\'" flymake-pylint-init)) -; Load flymake on non-temp buffers +;; Load flymake on non-temp buffers (add-hook 'python-mode-hook (lambda () (unless (eq buffer-file-name nil) (flymake-mode 1)))) @@ -130,8 +130,6 @@ (global-set-key "\C-x\C-b" 'buffer-menu) (global-set-key "\C-xw" 'whitespace-mode) (global-set-key "\C-x\C-r" (lambda () (interactive) (revert-buffer t t))) -(global-set-key "\C-x\C-i" 'increase-left-margin) -(global-set-key "\C-x\C-d" 'decrease-left-margin) (global-set-key "\C-c\C-c" 'comment-region) (global-set-key (kbd "C-c w") 'tmux-copy) @@ -158,7 +156,7 @@ ;; (package-refresh-contents)) ;; ;; Add in your own as you wish: -;; (defvar my-packages '(starter-kit starter-kit-lisp starter-kit-bindings) +;; (defvar my-packages '(starter-kit starter-starter-kit-bindings) ;; "A list of packages to ensure are installed at launch.") ;; (dolist (p my-packages) @@ -221,11 +219,12 @@ (load-file "~/.emacs.d/emacs-for-python/epy-init.el") -(setq skeleton-pair nil) ;; This stuff sucks. +(setq skeleton-pair nil) ;; This breaks pasting from os clipboard ;; ============================================================================= ;; Customize ;; ============================================================================= + (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful.