Permalink
Browse files

Extracted cleanup buffer function.

  • Loading branch information...
1 parent 76d7bbf commit 1f6f58b414e1dbae7f5668b9024a2400729e6ef6 @technomancy committed Dec 17, 2008
Showing with 12 additions and 7 deletions.
  1. +1 −4 starter-kit-bindings.el
  2. +7 −0 starter-kit-defuns.el
  3. +3 −3 starter-kit-lisp.el
  4. +1 −0 starter-kit-ruby.el
View
@@ -14,10 +14,7 @@
(global-set-key (kbd "M-/") 'hippie-expand)
;; Perform general cleanup.
-(global-set-key (kbd "C-c n") (lambda () (interactive)
- (indent-buffer)
- (delete-trailing-whitespace)
- (untabify-buffer)))
+(global-set-key (kbd "C-c n") 'cleanup-buffer)
;; Turn on the menu bar for exploring new modes
(global-set-key [f1] 'menu-bar-mode)
View
@@ -71,6 +71,13 @@
(interactive)
(indent-region (point-min) (point-max)))
+(defun cleanup-buffer ()
+ "Perform a bunch of operations on the whitespace content of a buffer."
+ (interactive)
+ (indent-buffer)
+ (untabify-buffer)
+ (delete-trailing-whitespace))
+
(defun recentf-ido-find-file ()
"Find a recent file using ido."
(interactive)
View
@@ -8,9 +8,9 @@
(add-hook 'emacs-lisp-mode-hook 'emacs-lisp-remove-elc-on-save)
-(when (boundp 'paredit-mode)
- (add-hook emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
- (add-hook lisp-mode-hook (lambda () (paredit-mode +1))))
+(when (functionp 'paredit-mode)
+ (add-hook 'emacs-lisp-mode-hook (lambda () (paredit-mode +1)))
+ (add-hook 'lisp-mode-hook (lambda () (paredit-mode +1))))
(defun emacs-lisp-remove-elc-on-save ()
"If you're saving an elisp file, likely the .elc is no longer valid."
View
@@ -7,6 +7,7 @@
(require 'ruby-compilation)
(add-hook 'ruby-mode-hook 'inf-ruby-keys)
(define-key ruby-mode-map (kbd "RET") 'reindent-then-newline-and-indent)
+ (define-key ruby-mode-map (kbd "C-M-h") 'backward-kill-word)
(define-key ruby-mode-map (kbd "C-c l") "lambda")))
(global-set-key (kbd "C-h r") 'ri)

0 comments on commit 1f6f58b

Please sign in to comment.