Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;; C-c C-e
- (defun sparkling-eval-replace-expr (start end)
- "Evaluate the contents of the selected region (or the region between START and END) as an expression and replace it with the result."
- (interactive "r")
- (call-process "spn" nil t nil "-e" (delete-and-extract-region start end))
- )
- ;; C-c C-r
- (defun sparkling-eval-replace-stmt (start end)
- "Evaluate the contents of the selected region (or the region between START and END) as statements and replace it with the result."
- (interactive "r")
- (call-process "spn" nil t nil "-t" "-r" (delete-and-extract-region start end))
- )
- (defvar sparkling-eval-buffer-name "*sparkling-eval*")
- ;; C-M-e
- (defun sparkling-eval-expr (start end)
- "Evaluate the contents of the selected region (or the region between START and END) as an expression."
- (interactive "r")
- (call-process "spn" nil sparkling-eval-buffer-name nil "-e" (buffer-substring start end))
- (switch-to-buffer-other-window sparkling-eval-buffer-name)
- )
- ;; C-M-r
- (defun sparkling-eval-stmt (start end)
- "Evaluate the contents of the selected region (or the region between START and END) as statements."
- (interactive "r")
- (call-process "spn" nil sparkling-eval-buffer-name nil "-t" "-r" (buffer-substring start end))
- (switch-to-buffer-other-window sparkling-eval-buffer-name)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement