Skip to content

Commit 261eb47

Browse files
committed
Fix compatibility with Emacs 31+
Emacs 31 removed the deprecated variable `display-comint-buffer-action` [^1]. [^1]: emacs-mirror/emacs@d706be4b345
1 parent d84f23f commit 261eb47

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Diff for: drepl.el

+7-2
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ buffers, this is a dREPL buffer or nil.")
7676
(defvar drepl--log-buffer nil
7777
"Name of the event log buffer, or nil to disable logging.")
7878

79+
(defvar drepl--display-buffer-action
80+
(if (boundp 'display-comint-buffer-action) ; Emacs >= 29, <= 30
81+
display-comint-buffer-action
82+
(append display-buffer--same-window-action '((category . comint)))))
83+
7984
;;; Basic definitions
8085

8186
(cl-defstruct (drepl-base
@@ -122,7 +127,7 @@ addition to those of `drepl-base'."
122127
(format "Start the %s interpreter." display-name))
123128
(interactive)
124129
(pop-to-buffer (drepl--get-buffer-create ',name t)
125-
display-comint-buffer-action))
130+
drepl--display-buffer-action))
126131
(cl-defstruct (,name
127132
(:include drepl-base (history-variable ',hist-var))
128133
(:copier nil)
@@ -324,7 +329,7 @@ interactively."
324329
(if ask
325330
(drepl--read-buffer "Pop to REPL: ")
326331
(drepl--buffer (drepl--get-repl nil t)))
327-
display-comint-buffer-action))
332+
drepl--display-buffer-action))
328333

329334
;;; Complete operation
330335

0 commit comments

Comments
 (0)