about summary refs log tree commit diff
path: root/init/functions.el
diff options
context:
space:
mode:
Diffstat (limited to 'init/functions.el')
-rw-r--r--init/functions.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/init/functions.el b/init/functions.el
index e26e1f1bea62..a0bf51a9e031 100644
--- a/init/functions.el
+++ b/init/functions.el
@@ -99,4 +99,11 @@ Including indent-buffer, which should not be called automatically on save."
       (find-file (concat "/sudo:root@localhost:" (ido-read-file-name "File: ")))
     (find-alternate-file (concat "/sudo:root@localhost:" buffer-file-name))))
 
+;; Evaluate sexp and replace it with result
+(defun replace-last-sexp ()
+    (interactive)
+    (let ((value (eval (preceding-sexp))))
+      (kill-sexp -1)
+      (insert (format "%S" value))))
+
 (provide 'functions)