Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C-x C-e to eval that range during region selection #961

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions extensions/lisp-mode/eval.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,14 @@
(let ((string (points-to-string start end)))
(eval-print string)
(move-point (current-point) end))))

(define-command lisp-eval-region (start end) ("r")
"Execute the region as Lisp code."
(check-connection)
(eval-with-transcript
`(micros: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))))
1 change: 0 additions & 1 deletion extensions/lisp-mode/internal-package.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
:lisp-eval-string
:lisp-eval-last-expression
:lisp-eval-defun
:lisp-eval-region
:lisp-load-file
:lisp-remove-notes
:lisp-compile-and-load-file
Expand Down
12 changes: 0 additions & 12 deletions extensions/lisp-mode/lisp-mode.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
(define-key *global-keymap* "M-:" 'lisp-eval-string)
(define-key *lisp-mode-keymap* "C-c M-:" 'lisp-eval-string)
(define-key *lisp-mode-keymap* "C-M-x" 'lisp-eval-defun)
(define-key *lisp-mode-keymap* "C-c C-r" 'lisp-eval-region)
(define-key *lisp-mode-keymap* "C-c C-n" 'lisp-next-compilation-notes)
(define-key *lisp-mode-keymap* "C-c C-p" 'lisp-previous-compilation-notes)
(define-key *lisp-mode-keymap* "C-c C-l" 'lisp-load-file)
Expand Down Expand Up @@ -523,17 +522,6 @@
(re-eval-defvar string)
(interactive-eval string))))))

(define-command lisp-eval-region (start end) ("r")
"Execute the region as Lisp code."
(check-connection)
(eval-with-transcript
`(micros: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))
Expand Down