From c5b77aa6d281214ba5fcedaca77230ca393e8b92 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 19 Mar 2018 03:09:53 +0100 Subject: 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. --- elisp/geiser-compile.el | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'elisp/geiser-compile.el') 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) -- cgit v1.2.3