diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-11-11 21:21:18 -0500 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-11-11 21:21:18 -0500 |
commit | 4f6ac41777b4807b2ff0ed9cfa5d2e0ac9161b20 (patch) | |
tree | 28e244446e2763bee5fb0a06ece6f7f5701fc042 /lisp | |
parent | 7ce94c076df0e8fe13d381125da4baca1b7b49c0 (diff) | |
download | emacs.d-4f6ac41777b4807b2ff0ed9cfa5d2e0ac9161b20.tar.gz |
Delete duplicate cleanup-buffer code
Accidentally made two copies of code in
ad80f4b4896b13d23b488146af4e4df6354191a7.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-editing.el | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/lisp/init-editing.el b/lisp/init-editing.el index bd85d50..9e03333 100644 --- a/lisp/init-editing.el +++ b/lisp/init-editing.el @@ -36,29 +36,6 @@ (let ((fill-column (point-max))) (fill-paragraph nil))) -;; Buffer-specific prevention modified from -;; http://stackoverflow.com/questions/14913398/ -;; in-emacs-how-do-i-save-without-running-save-hooks. -(defvar km/prevent-cleanup nil - "If set, `km/cleanup-buffer' does not perform clean up on save.") - -(defun km/toggle-prevent-cleanup () - "Toggle state of `km/prevent-cleanup'" - (interactive) - (if km/prevent-cleanup - (message "Allowing cleanup on save ") - (message "Preventing cleanup on save")) - (set (make-local-variable 'km/prevent-cleanup) (not km/prevent-cleanup))) - -(defun km/cleanup-buffer () - (interactive) - (unless km/prevent-cleanup - (unless (equal major-mode 'makefile-gmake-mode) - (untabify (point-min) (point-max))) - (delete-trailing-whitespace) - (set-buffer-file-coding-system 'utf-8))) -(add-hook 'before-save-hook 'km/cleanup-buffer) - (define-key search-map "s" 'query-replace) (define-key search-map "S" 'replace-string) (define-key search-map "r" 'query-replace-regexp) |