Fix vterm module after upgrade to emacs 28
This commit is contained in:
parent
cdf40a6f9b
commit
742ace250d
@ -37,13 +37,15 @@ Returns the vterm buffer"
|
|||||||
(unless (fboundp 'module-load)
|
(unless (fboundp 'module-load)
|
||||||
(user-error
|
(user-error
|
||||||
"Your build of Emacs lacks dynamic modules support and cannot load vterm"))
|
"Your build of Emacs lacks dynamic modules support and cannot load vterm"))
|
||||||
|
(require 'vterm)
|
||||||
(let ((vterm-buffer-name (+vterm--buffer-name)))
|
(let ((vterm-buffer-name (+vterm--buffer-name)))
|
||||||
(if (string= major-mode "vterm-mode")
|
(if (string= major-mode "vterm-mode")
|
||||||
(funcall spawn-fn vterm-buffer-name)
|
(funcall spawn-fn vterm-buffer-name)
|
||||||
(let ((existing-vterm (+vterm--get-existing-buffer)))
|
(let ((existing-vterm (+vterm--get-existing-buffer)))
|
||||||
(if existing-vterm
|
(if existing-vterm
|
||||||
(funcall switch-fn existing-vterm)
|
(funcall switch-fn existing-vterm)
|
||||||
(funcall spawn-fn vterm-buffer-name))))))
|
(funcall spawn-fn vterm-buffer-name)))))
|
||||||
|
)
|
||||||
|
|
||||||
(defun +vterm--spawn-or-switch-with-project (spawn-fn switch-fn)
|
(defun +vterm--spawn-or-switch-with-project (spawn-fn switch-fn)
|
||||||
"Open with `spawn-fn' or switch to active vterm with `switch-fn' in a project.
|
"Open with `spawn-fn' or switch to active vterm with `switch-fn' in a project.
|
||||||
@ -54,7 +56,7 @@ Returns the vterm buffer"
|
|||||||
(user-error
|
(user-error
|
||||||
"vterm/project cannot find a project, because you are not in a project"))
|
"vterm/project cannot find a project, because you are not in a project"))
|
||||||
(let ((default-directory project-root))
|
(let ((default-directory project-root))
|
||||||
(+vterm--spawn-or-switch spawn-fn switch-fn))))
|
(+vterm--spawn-or-switch spawn-fn switch-fn))))
|
||||||
|
|
||||||
(defun +vterm--other-window (other-window-fn current-window-fn)
|
(defun +vterm--other-window (other-window-fn current-window-fn)
|
||||||
"Open or switch with `other-window-fn'.
|
"Open or switch with `other-window-fn'.
|
||||||
|
Loading…
Reference in New Issue
Block a user