summaryrefslogtreecommitdiff
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
commitdb80a2219d6294dc8b5548cfb59890939ae83cd7 (patch)
treeeb12bbaa04e1657bc1258d64a04b8d1b6add4da0
parente357eae8fa8c7d6a59f22a1c97cb90a386762089 (diff)
downloadgeiser-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.
-rw-r--r--README83
-rw-r--r--doc/cheat.texi2
-rw-r--r--doc/parens.texi7
-rw-r--r--elisp/geiser-compile.el20
4 files changed, 62 insertions, 50 deletions
diff --git a/README b/README
index 61913cd..5118a0e 100644
--- a/README
+++ b/README
@@ -94,47 +94,48 @@
** In Scheme buffers:
- |-------------+-------------------------------------------------|
- | C-c C-z | Switch to REPL |
- | C-c C-a | Switch to REPL and current module |
- | C-c C-s | Specify Scheme implementation for buffer |
- |-------------+-------------------------------------------------|
- | M-. | Go to definition of identifier at point |
- | M-, | Go back to where M-. was last invoked |
- | C-c C-e m | Ask for a module and open its file |
- | C-c C-e C-l | Add a given directory to Scheme's load path |
- | C-c C-e [ | Toggle between () and [] for current form |
- |-------------+-------------------------------------------------|
- | C-M-x | Eval definition around point |
- | C-c C-c | Eval definition around point |
- | C-c M-e | Eval definition around point and switch to REPL |
- | C-x C-e | Eval sexp before point |
- | C-c C-r | Eval region |
- | C-c M-r | Eval region and switch to REPL |
- | C-c C-b | Eval buffer |
- | C-c M-b | Eval buffer and switch to REPL |
- |-------------+-------------------------------------------------|
- | C-c C-m x | Macro-expand definition around point |
- | C-c C-m e | Macro-expand sexp before point |
- | C-c C-m r | Macro-expand region |
- |-------------+-------------------------------------------------|
- | C-c C-k | Compile and load current file |
- | C-c C-l | Load scheme file |
- |-------------+-------------------------------------------------|
- | C-c C-d d | See documentation for identifier at point |
- | C-c C-d s | See short documentation for identifier at point |
- | C-c C-d i | Look up manual for identifier at point |
- | C-c C-d m | See a list of a module's exported identifiers |
- | C-c C-d a | Toggle autodoc mode |
- |-------------+-------------------------------------------------|
- | C-c < | Show callers of procedure at point |
- | C-c > | Show callees of procedure at point |
- |-------------+-------------------------------------------------|
- | M-TAB | Complete identifier at point |
- | M-`, C-. | Complete module name at point |
- | TAB | Complete identifier at point or indent |
- | | (If `geiser-mode-smart-tab-p' is t) |
- |-------------+-------------------------------------------------|
+ |-------------+--------------------------------------------------|
+ | C-c C-z | Switch to REPL |
+ | C-c C-a | Switch to REPL and current module |
+ | C-c C-s | Specify Scheme implementation for buffer |
+ |-------------+--------------------------------------------------|
+ | M-. | Go to definition of identifier at point |
+ | M-, | Go back to where M-. was last invoked |
+ | C-c C-e m | Ask for a module and open its file |
+ | C-c C-e C-l | Add a given directory to Scheme's load path |
+ | C-c C-e [ | Toggle between () and [] for current form |
+ |-------------+--------------------------------------------------|
+ | C-M-x | Eval definition around point |
+ | C-c C-c | Eval definition around point |
+ | C-c M-e | Eval definition around point and switch to REPL |
+ | C-x C-e | Eval sexp before point |
+ | C-c C-r | Eval region |
+ | C-c M-r | Eval region and switch to REPL |
+ | C-c C-b | Eval buffer |
+ | C-c M-b | Eval buffer and switch to REPL |
+ |-------------+--------------------------------------------------|
+ | C-c C-m x | Macro-expand definition around point |
+ | C-c C-m e | Macro-expand sexp before point |
+ | C-c C-m r | Macro-expand region |
+ |-------------+--------------------------------------------------|
+ | C-c C-k | Compile and load current buffer |
+ | C-c C-l | Load scheme file |
+ | C-u C-c C-k | Compile and load current buffer, restarting REPL |
+ |-------------+--------------------------------------------------|
+ | C-c C-d d | See documentation for identifier at point |
+ | C-c C-d s | See short documentation for identifier at point |
+ | C-c C-d i | Look up manual for identifier at point |
+ | C-c C-d m | See a list of a module's exported identifiers |
+ | C-c C-d a | Toggle autodoc mode |
+ |-------------+--------------------------------------------------|
+ | C-c < | Show callers of procedure at point |
+ | C-c > | Show callees of procedure at point |
+ |-------------+--------------------------------------------------|
+ | M-TAB | Complete identifier at point |
+ | M-`, C-. | Complete module name at point |
+ | TAB | Complete identifier at point or indent |
+ | | (If `geiser-mode-smart-tab-p' is t) |
+ |-------------+--------------------------------------------------|
** In the REPL
diff --git a/doc/cheat.texi b/doc/cheat.texi
index 793d20f..cbfe08d 100644
--- a/doc/cheat.texi
+++ b/doc/cheat.texi
@@ -86,7 +86,7 @@ third key not modified by @key{Control}; e.g.,
@item @tab @tab
@item C-c C-k
@tab @code{geiser-compile-current-buffer}
-@tab Compile and load current file
+@tab Compile and load current file; with prefix, restart REPL before
@item C-c C-l
@tab @code{geiser-load-file}
@tab Load scheme file
diff --git a/doc/parens.texi b/doc/parens.texi
index 71bdc95..55a23f7 100644
--- a/doc/parens.texi
+++ b/doc/parens.texi
@@ -436,7 +436,12 @@ incremental evaluation. Some people disagree; if you happen to find
@uref{http://blog.racket-lang.org/2009/03/drscheme-repl-isnt-lisp-the-one-in-emacs.html,
their arguments} convincing, you don't have to throw away Geiser
together with the baby: @kbd{M-x geiser-restart-repl} will let you
-restart the REPL as many times as you see fit.
+restart the REPL as many times as you see fit. Moreover, you can invoke
+@kbd{geiser-compile-current-buffer} and @kbd{geiser-load-current-buffer}
+with a prefix argument (that'd be something like @kbd{C-u C-c C-k} for
+compilation, for instance), to tell Geiser to restart the REPL
+associated with a buffer before compiling or loading its current
+contents.
@cindex evaluation
@cindex incremental development, not evil
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)