mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
feat(emacs-lisp): default ielm working buffer to selected
When invoking `+emacs-lisp/open-repl`, if no working buffer is set in the resulting ielm buffer, it will default to the selected buffer prior to opening the repl.
This commit is contained in:
@ -149,14 +149,20 @@ if it's callable, `apropos' otherwise."
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/open-repl ()
|
||||
"Open the Emacs Lisp REPL (`ielm')."
|
||||
"Open the Emacs Lisp REPL (`ielm').
|
||||
|
||||
If the repl isn't already open, sets ielm's working buffer to the buffer
|
||||
selected before this command was invoked."
|
||||
(interactive)
|
||||
(pop-to-buffer
|
||||
(or (get-buffer "*ielm*")
|
||||
(progn (ielm)
|
||||
(let ((buf (get-buffer "*ielm*")))
|
||||
(bury-buffer buf)
|
||||
buf)))))
|
||||
(let ((original-buffer (current-buffer)))
|
||||
(ielm)
|
||||
(when (buffer-live-p original-buffer)
|
||||
(ielm-change-working-buffer original-buffer))
|
||||
(let ((buf (get-buffer "*ielm*")))
|
||||
(bury-buffer buf)
|
||||
buf)))))
|
||||
|
||||
;;;###autoload
|
||||
(defun +emacs-lisp/buttercup-run-file ()
|
||||
|
Reference in New Issue
Block a user