summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyle Meyer <kyle@kyleam.com>2014-01-18 19:38:44 -0500
committerKyle Meyer <kyle@kyleam.com>2014-01-18 19:43:50 -0500
commit809285f90adefd169128112264896641709f1cc2 (patch)
tree37b563ff306c1ab8aedc6409bed693d87d3ef814
parent4f4de88698d2baaeccfd00a9429ce8b442f2e33e (diff)
downloademacs.d-809285f90adefd169128112264896641709f1cc2.tar.gz
Advise hippie expand to work with paredit
-rw-r--r--init/00-km-general.el5
1 files changed, 5 insertions, 0 deletions
diff --git a/init/00-km-general.el b/init/00-km-general.el
index 1b21c2b..bf4ce0e 100644
--- a/init/00-km-general.el
+++ b/init/00-km-general.el
@@ -70,6 +70,11 @@
(setq ispell-program-name "aspell")
(global-set-key (kbd "M-/") 'hippie-expand)
+;; http://www.emacswiki.org/emacs/HippieExpand#toc9
+(defadvice he-substitute-string (after he-paredit-fix activate)
+ "Remove extra paren when expanding line in paredit."
+ (if (and paredit-mode (equal (substring str -1) ")"))
+ (progn (backward-delete-char 1) (forward-char))))
(setq sentence-end-double-space nil)