From 3d24efbb65c3554d8e4666764210a17ba8034995 Mon Sep 17 00:00:00 2001
From: Bozhidar Batsov <bozhidar@tradeo.com>
Date: Wed, 27 Mar 2013 12:13:24 +0200
Subject: [PATCH] Minor refactoring

---
 core/prelude-core.el | 6 ++----
 core/prelude-mode.el | 2 +-
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/core/prelude-core.el b/core/prelude-core.el
index c215cbc..2545f67 100644
--- a/core/prelude-core.el
+++ b/core/prelude-core.el
@@ -79,14 +79,12 @@
       (indent-rigidly (point-min) (point-max) arg)
       (clipboard-kill-ring-save (point-min) (point-max)))))
 
-(defun prelude-insert-empty-line ()
+(defun prelude-smart-open-line ()
   "Insert an empty line after the current line.
 Position the cursor at its beginning, according to the current mode."
   (interactive)
   (move-end-of-line nil)
-  (open-line 1)
-  (forward-line 1)
-  (indent-according-to-mode))
+  (newline-and-indent))
 
 (defun prelude-move-line-up ()
   "Move up the current line."
diff --git a/core/prelude-mode.el b/core/prelude-mode.el
index 6dd94bf..8267bfb 100644
--- a/core/prelude-mode.el
+++ b/core/prelude-mode.el
@@ -38,7 +38,7 @@
     (define-key map (kbd "C-c o") 'prelude-open-with)
     (define-key map (kbd "C-c g") 'prelude-google)
     ;; mimic popular IDEs binding, note that it doesn't work in a terminal session
-    (define-key map [(shift return)] 'prelude-insert-empty-line)
+    (define-key map [(shift return)] 'prelude-smart-open-line)
     (define-key map [(control shift up)]  'prelude-move-line-up)
     (define-key map [(control shift down)]  'prelude-move-line-down)
     (define-key map (kbd "C-c n") 'prelude-cleanup-buffer)