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,11 +149,17 @@ if it's callable, `apropos' otherwise."
|
|||||||
|
|
||||||
;;;###autoload
|
;;;###autoload
|
||||||
(defun +emacs-lisp/open-repl ()
|
(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)
|
(interactive)
|
||||||
(pop-to-buffer
|
(pop-to-buffer
|
||||||
(or (get-buffer "*ielm*")
|
(or (get-buffer "*ielm*")
|
||||||
(progn (ielm)
|
(let ((original-buffer (current-buffer)))
|
||||||
|
(ielm)
|
||||||
|
(when (buffer-live-p original-buffer)
|
||||||
|
(ielm-change-working-buffer original-buffer))
|
||||||
(let ((buf (get-buffer "*ielm*")))
|
(let ((buf (get-buffer "*ielm*")))
|
||||||
(bury-buffer buf)
|
(bury-buffer buf)
|
||||||
buf)))))
|
buf)))))
|
||||||
|
Reference in New Issue
Block a user