summaryrefslogtreecommitdiff
path: root/elisp/geiser-guile.el
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-09-07 05:58:22 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-09-07 05:58:22 +0200
commit9e072c67041be2a9968d153ab6a6de3c047bc0f0 (patch)
treec89f32f6f160f726d2fd3e01637d880cb4cb9c1f /elisp/geiser-guile.el
parent9ecfebdfd5d3361c643c2b16b9fb7771122b0e82 (diff)
downloadgeiser-guile-9e072c67041be2a9968d153ab6a6de3c047bc0f0.tar.gz
geiser-guile-9e072c67041be2a9968d153ab6a6de3c047bc0f0.tar.bz2
Guile: configurable warning level
Diffstat (limited to 'elisp/geiser-guile.el')
-rw-r--r--elisp/geiser-guile.el34
1 files changed, 33 insertions, 1 deletions
diff --git a/elisp/geiser-guile.el b/elisp/geiser-guile.el
index 15c40cc..55116d3 100644
--- a/elisp/geiser-guile.el
+++ b/elisp/geiser-guile.el
@@ -63,6 +63,29 @@ If `t', Geiser will use `next-error' to jump to the error's location."
:type 'boolean
:group 'geiser-guile)
+(geiser-custom--defcustom geiser-guile-warning-level 'medium
+ "Verbosity of the warnings reported by Guile.
+
+You can choose either one of the predefined warning sets, or
+provide a list of symbols identifying the ones you want. Possible
+choices are arity-mismatch, unbound-variable, unused-variable and
+unused-toplevel. Unrecognised symbols are ignored.
+
+The predefined levels are:
+
+ - Medium: arity-mismatch, unbound-variable
+ - High: arity-mismatch, unbound-variable, unused-variable
+ - None: no warnings
+
+Changes to the value of this variable will automatically take
+effect on new REPLs. For existing ones, use the command
+\\[geiser-guile-update-warning-level]."
+ :type '(choice (const :tag "Medium (arity and unbound vars)" medium)
+ (const :tag "High (also unused vars)" high)
+ (const :tag "No warnings" none)
+ (repeat :tag "Custom" symbol))
+ :group 'geiser-guile)
+
;;; REPL support:
@@ -189,6 +212,14 @@ This function uses `geiser-guile-init-file' if it exists."
;;; REPL startup
+(defun geiser-guile-update-warning-level ()
+ "Update the warning level used by the REPL.
+The new level is set using the value of `geiser-guile-warning-level'."
+ (interactive)
+ (let ((code `(:eval (ge:set-warnings ',geiser-guile-warning-level)
+ (geiser evaluation))))
+ (geiser-eval--send/result code)))
+
(defun geiser-guile--startup ()
(set (make-local-variable 'compilation-error-regexp-alist)
`((,geiser-guile--path-rx geiser-guile--resolve-file-x)
@@ -197,7 +228,8 @@ This function uses `geiser-guile-init-file' if it exists."
(compilation-setup t)
(font-lock-add-keywords nil
`((,geiser-guile--path-rx 1
- compilation-error-face))))
+ compilation-error-face)))
+ (geiser-guile-update-warning-level))
;;; Implementation definition: