summaryrefslogtreecommitdiff
path: root/elisp
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2018-03-19 03:09:53 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2018-03-19 03:14:07 +0100
commitc5b77aa6d281214ba5fcedaca77230ca393e8b92 (patch)
treeea3ecc249d7a376f755f9f1213dbe5c0a479330a /elisp
parent377f99cd4adb101aed7c3c15651b0da3cde1b380 (diff)
downloadgeiser-c5b77aa6d281214ba5fcedaca77230ca393e8b92.tar.gz
geiser-c5b77aa6d281214ba5fcedaca77230ca393e8b92.tar.bz2
A prefix for geiser-compile-current-buffer to restart it all
Okay, i must confess it's sometimes handy to restart the REPL before compiling a file (the proverbial clean slate and all). And we already have geiser-restart-repl, so combining the two things when C-u happens was not really difficult.
Diffstat (limited to 'elisp')
-rw-r--r--elisp/geiser-compile.el20
1 files changed, 13 insertions, 7 deletions
diff --git a/elisp/geiser-compile.el b/elisp/geiser-compile.el
index e22907f..be136b4 100644
--- a/elisp/geiser-compile.el
+++ b/elisp/geiser-compile.el
@@ -1,6 +1,6 @@
;; geiser-compile.el -- compile/load scheme files
-;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2016 Jose Antonio Ortega Ruiz
+;; Copyright (C) 2009, 2010, 2011, 2012, 2013, 2016, 2018 Jose Antonio Ortega Ruiz
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the Modified BSD License. You should
@@ -51,9 +51,12 @@
(interactive "FScheme file: ")
(geiser-compile--file-op path t "Compiling"))
-(defun geiser-compile-current-buffer ()
- "Compile and load current Scheme file."
- (interactive)
+(defun geiser-compile-current-buffer (&optional restart-p)
+ "Compile and load current Scheme file.
+
+With prefix, restart REPL before compiling the file."
+ (interactive "P")
+ (when restart-p (geiser-restart-repl))
(geiser-compile-file (buffer-file-name (current-buffer))))
(defun geiser-load-file (path)
@@ -61,9 +64,12 @@
(interactive "FScheme file: ")
(geiser-compile--file-op (expand-file-name path) nil "Loading"))
-(defun geiser-load-current-buffer ()
- "Load current Scheme file."
- (interactive)
+(defun geiser-load-current-buffer (&optional restart-p)
+ "Load current Scheme file.
+
+With prefix, restart REPL before loading the file."
+ (interactive "P")
+ (when restart-p (geiser-restart-repl))
(geiser-load-file (buffer-file-name (current-buffer))))
(defun geiser-add-to-load-path (path)