From b865e71384d368c4a4db32d95e99e6519a56d3e4 Mon Sep 17 00:00:00 2001 From: Marcus Kammer Date: Mon, 24 Jun 2024 08:28:15 +0200 Subject: [PATCH] Add babel.lisp --- babel.lisp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/babel.lisp b/babel.lisp index 2aded71f..541d2f85 100644 --- a/babel.lisp +++ b/babel.lisp @@ -2,5 +2,32 @@ ;;;; Author: Marcus Kammer ;;;; MIT License +;; Put the following lines into your .sbclrc: +;; +;; (let ((babel (merge-pathnames ".emacs.d/babel.lisp" (user-homedir-pathname)))) +;; (when (probe-file babel) +;; (load babel))) + +;;; --- snip --- +(defun print-condition-hook (condition hook) + "This function is designed to be used as a custom debugger hook. +It prints the condition (error message), clears any remaining input, +and aborts the current operation." + ;; Ignore the hook argument since it's not used in this function. + (declare (ignore hook)) + ;; Print the error message associated with the condition. + (princ condition) + ;; Clear any pending input from the stream. + (clear-input) + ;; Abort the current operation and return to the top-level. + (abort)) +;; Get the value of the global variable *debugger-hook*. +*debugger-hook* +;; Set the global variable *debugger-hook* to the custom debugger hook +;; function 'print-condition-hook'. This function will now be called +;; whenever an unhandled error occurs. +(setf *debugger-hook* #'print-condition-hook) +(sb-ext:set-sbcl-source-location #P"~/sbcl/") + (when (probe-file "~/quicklisp/local-projects/dev.metalisp.sbt") (ql:quickload :dev.metalisp.sbt))