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 | db80a2219d6294dc8b5548cfb59890939ae83cd7 (patch) | |
tree | eb12bbaa04e1657bc1258d64a04b8d1b6add4da0 /elisp | |
parent | e357eae8fa8c7d6a59f22a1c97cb90a386762089 (diff) | |
download | geiser-guile-db80a2219d6294dc8b5548cfb59890939ae83cd7.tar.gz geiser-guile-db80a2219d6294dc8b5548cfb59890939ae83cd7.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) |