mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-11 13:07:28 -05:00
tools/eval: minor refactors
This commit is contained in:
@ -6,14 +6,14 @@
|
|||||||
(interactive)
|
(interactive)
|
||||||
(cond ((assq major-mode +eval-runners)
|
(cond ((assq major-mode +eval-runners)
|
||||||
(+eval/region (point-min) (point-max)))
|
(+eval/region (point-min) (point-max)))
|
||||||
(t (quickrun))))
|
((quickrun))))
|
||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +eval/region (beg end)
|
(defun +eval/region (beg end)
|
||||||
"Evaluate a region between BEG and END and display the output."
|
"Evaluate a region between BEG and END and display the output."
|
||||||
(interactive "r")
|
(interactive "r")
|
||||||
(let ((load-file-name buffer-file-name))
|
(let ((load-file-name buffer-file-name))
|
||||||
(if-let* ((runner (cdr (assq major-mode +eval-runners))))
|
(if-let (runner (cdr (assq major-mode +eval-runners)))
|
||||||
(funcall runner beg end)
|
(funcall runner beg end)
|
||||||
(quickrun-region beg end))))
|
(quickrun-region beg end))))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user