Skip to content

Commit

Permalink
feat(lisp-mode): Add command to eval buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
jcs090218 committed Jun 3, 2023
1 parent 91973a6 commit e33682f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modes/lisp-mode/lisp-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@
(self-interactive-eval string)))))

(define-command lisp-eval-defun () ()
"Evaluate top-level form around point and instrument."
(check-connection)
(with-point ((point (current-point)))
(lem-lisp-syntax:top-of-defun point)
Expand All @@ -424,16 +425,22 @@
(interactive-eval string))))))

(define-command lisp-eval-region (start end) ("r")
"Execute the region as Lisp code."
(check-connection)
(eval-with-transcript
`(swank:interactive-eval-region
,(points-to-string start end))))

(define-command lisp-eval-buffer () ()
"Execute the accessible portion of current buffer as Lisp code."
(lisp-eval-region (buffer-start-point (current-buffer)) (buffer-end-point (current-buffer))))

(define-command lisp-load-file (filename)
((prompt-for-file "Load File: "
:directory (or (buffer-filename) (buffer-directory))
:default nil
:existing t))
"Load the Lisp file named FILENAME."
(check-connection)
(when (uiop:file-exists-p filename)
(let ((filename (convert-local-to-remote-file filename)))
Expand Down

0 comments on commit e33682f

Please sign in to comment.