From d226fd63f72aa0a2226d98fd0e39d122f99dd924 Mon Sep 17 00:00:00 2001 From: toctan Date: Wed, 25 Jun 2014 09:36:23 +0800 Subject: [PATCH] Clean up `prelude-cleanup-buffer` code - Create a macro `with-region-or-buffer` to replace the prelude wrapper around `untabify` and `indent-region` - Remove the function operated on buffers, cause we only need the dwim one --- core/prelude-core.el | 53 ++---------------------------------------- core/prelude-editor.el | 11 +++++++++ core/prelude-mode.el | 6 ----- 3 files changed, 13 insertions(+), 57 deletions(-) diff --git a/core/prelude-core.el b/core/prelude-core.el index 7a9a144..f1a0cec 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -158,23 +158,6 @@ point reaches the beginning or end of the buffer, stop there." (global-set-key [remap move-beginning-of-line] 'prelude-move-beginning-of-line) -(defun prelude-indent-buffer () - "Indent the currently visited buffer." - (interactive) - (indent-region (point-min) (point-max))) - -(defun prelude-indent-buffer-or-region () - "Indent a region if selected, otherwise the whole buffer." - (interactive) - (save-excursion - (if (region-active-p) - (progn - (indent-region (region-beginning) (region-end)) - (message "Indented selected region.")) - (progn - (prelude-indent-buffer) - (message "Indented buffer."))))) - (defun prelude-indent-defun () "Indent the current defun." (interactive) @@ -286,43 +269,11 @@ there's a region, all lines that region covers will be duplicated." (cond ((search-forward "