-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathslime-star-commands.el
77 lines (61 loc) · 2.58 KB
/
slime-star-commands.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
;;; slime-star --- SLIME with augmented features. -*- lexical-binding: t -*-
;; Copyright (C) 2022 Mariano Montone
;; This program is free software; you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
;; GNU General Public License for more details.
;; You should have received a copy of the GNU General Public License
;; along with this program. If not, see <http://www.gnu.org/licenses/>.
;;; Commentary:
;; Extra commands for SLIME
;;; Code:
(require 'slime)
(defun slime-room ()
"Show Common Lisp ROOM information in an Emacs buffer."
(interactive)
(let ((room-str
(slime-eval `(cl:with-output-to-string (cl:*standard-output*)
(cl:room)))))
(let ((buffer (get-buffer-create "*slime-room*")))
(with-current-buffer buffer
(insert room-str)
(display-buffer buffer)))))
(defun slime-scratch ()
"Open the equivalent of an Emacs *scratch* buffer, for Common Lisp/SLIME."
(interactive)
(let ((buffer (get-buffer-create "*slime-scratch*")))
(with-current-buffer buffer
(lisp-mode)
(switch-to-buffer buffer))))
(defun sldb-kill-all-buffers ()
"Kill all SLDB buffers."
(interactive)
(dolist (buf (sldb-buffers))
(kill-buffer buf)))
(defun sldb-show-all-frames-details ()
"Show details of all frames in debugger."
(interactive)
(let ((inhibit-read-only t)
(inhibit-point-motion-hooks t))
(sldb-beginning-of-backtrace)
;;(while (get-text-property (point) 'frame)
;; (sldb-show-frame-details)
;; (sldb-forward-frame))
(dotimes (i 5)
(when (get-text-property (point) 'frame)
(sldb-show-frame-details)
(sldb-forward-frame)))))
(defun slime-system-dependency-graph (system)
"Visualize a dependencies graph for ASDF SYSTEM.
Requires asdf-dependency-graph library installed."
(interactive (list (slime-read-system-name "Generate graph for system")))
(let ((output-file (make-temp-file "asdf-dependency-graph-" nil ".png")))
(slime-eval `(cl:progn (cl:require :asdf-dependency-graph)
(uiop:symbol-call 'asdf-dependency-graph 'generate ,output-file ',system)))
(find-file output-file)))
(provide 'slime-star-commands)
;;; slime-star-commands.el ends here