diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2018-03-19 03:09:53 +0100 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2018-03-19 03:14:07 +0100 |
commit | c5b77aa6d281214ba5fcedaca77230ca393e8b92 (patch) | |
tree | ea3ecc249d7a376f755f9f1213dbe5c0a479330a /elisp | |
parent | 377f99cd4adb101aed7c3c15651b0da3cde1b380 (diff) | |
download | geiser-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.el | 20 |
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) |