emacs.d/babel.lisp

39 lines
1.4 KiB
Common Lisp
Raw Normal View History

2024-06-20 11:49:27 +02:00
;;;; babel.lisp - Personal function library loaded at sbcl startup
;;;; Author: Marcus Kammer <marcus.kammer@metalisp.dev>
;;;; MIT License
2024-06-24 08:28:15 +02:00
;; 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/")
2024-06-30 14:05:39 +02:00
(defun get-external-symbols (package-name)
(let ((package (find-package package-name)))
(when package
(let ((result '()))
(do-external-symbols (symbol package)
(push symbol result))
result))))