[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/drepl e36f22d76e 1/9: Don't pop to REPL buffer when res
From: |
ELPA Syncer |
Subject: |
[elpa] externals/drepl e36f22d76e 1/9: Don't pop to REPL buffer when restarting it |
Date: |
Thu, 4 Apr 2024 15:57:57 -0400 (EDT) |
branch: externals/drepl
commit e36f22d76e1063c603a645a8674c5501ade1d5c0
Author: Augusto Stoffel <arstoffel@gmail.com>
Commit: Augusto Stoffel <arstoffel@gmail.com>
Don't pop to REPL buffer when restarting it
---
drepl.el | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/drepl.el b/drepl.el
index fa07e3fd32..3101616bee 100644
--- a/drepl.el
+++ b/drepl.el
@@ -113,7 +113,8 @@ addition to those of `drepl-base'."
,(or docstring
(format "Start the %s interpreter." display-name))
(interactive)
- (drepl--run ',name t))
+ (pop-to-buffer (drepl--get-repl-create ',name t)
+ display-comint-buffer-action))
(cl-defstruct (,name
(:include drepl-base)
(:copier nil)
@@ -309,7 +310,8 @@ interactively."
(pop-to-buffer
(if ask
(drepl--read-buffer "Pop to REPL: ")
- (drepl--buffer (drepl--get-repl nil t)))))
+ (drepl--buffer (drepl--get-repl nil t)))
+ display-comint-buffer-action))
;;; Complete operation
@@ -466,7 +468,7 @@ in the default implementation."
(with-current-buffer (drepl--buffer repl)
(kill-process (drepl--process repl))
(while (accept-process-output (drepl--process repl)))
- (drepl--run (type-of repl) nil)))
+ (drepl--get-repl-create (type-of repl) nil)))
(defun drepl-restart (&optional hard)
"Restart the current REPL.
@@ -495,7 +497,7 @@ project; otherwise fall back to `default-directory'."
(or (get type 'drepl--display-name) type)))
(defun drepl--get-buffer-create (type may-prompt)
- "Get or create a dREPL buffer of the given TYPE.
+ "Get a buffer suitable for a REPL of the given TYPE, creating one if needed.
The directory of the buffer is determined by `drepl-directory'.
If MAY-PROMPT is non-nil, allow an interactive query if needed."
(if (eq type (type-of drepl--current))
@@ -542,13 +544,10 @@ appropriate mode using `auto-mode-alist'."
(when (syntax-table-p syntbl-val)
(set-syntax-table syntbl-val)))))
-(defun drepl--run (type may-prompt)
- "Pop to a REPL of the given TYPE or start a new one.
+(defun drepl--get-repl-create (type may-prompt)
+ "Return a buffer running a REPL of the given TYPE, creating one if needed.
-This function is intended to be wrapped in an interactive command
-for each new REPL type.
-
-If MAY-PROMPT is non-nil, prompt for a project in which to run
+If MAY-PROMPT is non-nil, prompt for a project directory in which to run
it, if necessary."
(let ((buffer (drepl--get-buffer-create type may-prompt)))
(unless (comint-check-proc buffer)
@@ -564,7 +563,7 @@ it, if necessary."
(car command) nil (cdr command))
(drepl--init repl)
(setq drepl--current repl))))
- (pop-to-buffer buffer display-comint-buffer-action)))
+ buffer))
;;; Base major mode
- [elpa] externals/drepl updated (033ada13c0 -> fc0b28b8b2), ELPA Syncer, 2024/04/04
- [elpa] externals/drepl 9795880fb5 3/9: Enable completion with an empty prefix, ELPA Syncer, 2024/04/04
- [elpa] externals/drepl 3b8c4697dd 8/9: Refine header and commentary section, ELPA Syncer, 2024/04/04
- [elpa] externals/drepl 3be39d056f 2/9: Guard against return value t from while-no-input, ELPA Syncer, 2024/04/04
- [elpa] externals/drepl e36f22d76e 1/9: Don't pop to REPL buffer when restarting it,
ELPA Syncer <=
- [elpa] externals/drepl a9702701ee 4/9: Add a new REPL state 'rawio' to avoid race conditions, ELPA Syncer, 2024/04/04
- [elpa] externals/drepl 2339e68a98 5/9: Guard against some nil values, ELPA Syncer, 2024/04/04
- [elpa] externals/drepl cc980b0d52 7/9: Improve REPL initialization process, ELPA Syncer, 2024/04/04
- [elpa] externals/drepl 30713ad02e 6/9: Separate message transport from protocol logic, ELPA Syncer, 2024/04/04
- [elpa] externals/drepl fc0b28b8b2 9/9: Version 0.2, ELPA Syncer, 2024/04/04