From f76aab7491b98ac91766249df555fb0532d25716 Mon Sep 17 00:00:00 2001 From: Bozhidar Batsov Date: Sat, 29 Jun 2013 09:26:23 +0300 Subject: [PATCH] Add prefix arg to prelude-smart-open-line With a prefix arg the command will invoke prelude-smart-open-line-above --- core/prelude-core.el | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/core/prelude-core.el b/core/prelude-core.el index e509892..a6c9efe 100644 --- a/core/prelude-core.el +++ b/core/prelude-core.el @@ -90,12 +90,17 @@ Position the cursor at it's beginning, according to the current mode." (forward-line -1) (indent-according-to-mode)) -(defun prelude-smart-open-line () +(defun prelude-smart-open-line (arg) "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) - (newline-and-indent)) +Position the cursor at its beginning, according to the current mode. + +With a prefix ARG open line above the current line." + (interactive "P") + (if arg + (prelude-smart-open-line-above) + (progn + (move-end-of-line nil) + (newline-and-indent)))) (defun prelude-top-join-line () "Join the current line with the line beneath it."