Skip to content

Commit f1d5880

Browse files
committed
nix-command-eshell: Support Emacs 29
1 parent e370e7d commit f1d5880

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

nix-command-eshell.el

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,27 @@ simulates an actual subshell better, but can be also annoying for some people."
107107
:name "nix"
108108
:buffer (current-buffer)
109109
:command command
110-
:filter 'eshell-interactive-process-filter
110+
:filter 'nix-command-eshell--filter
111111
:sentinel 'nix-command-eshell--sentinel)))
112112
(process-put proc 'temp-file temp-file)
113113
(eshell-record-process-object proc)
114114
(eshell-record-process-properties proc)
115115
(throw 'eshell-external proc)))
116116

117+
(defun nix-command-eshell--filter (proc output)
118+
(if (fboundp 'eshell-interactive-process-filter)
119+
;; For Emacs >= 30
120+
(eshell-interactive-process-filter proc output))
121+
;; For Emacs < 30
122+
(eshell-insertion-filter proc output))
123+
117124
(defun nix-command-eshell--sentinel (proc status)
118-
(let ((cmd (car (eshell-commands-for-process proc)))
125+
(let ((cmd
126+
(if (fboundp 'eshell-commands-for-process)
127+
;; For Emacs >= 30
128+
(car (eshell-commands-for-process proc))
129+
;; For Emacs < 30
130+
t))
119131
(buffer (process-buffer proc))
120132
(temp-file (process-get proc 'temp-file)))
121133
(when (and cmd

0 commit comments

Comments
 (0)