about summary refs log tree commit diff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/emacs-pkgs/term-switcher/term-switcher.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/emacs-pkgs/term-switcher/term-switcher.el b/tools/emacs-pkgs/term-switcher/term-switcher.el
index 67595474fa86..0055f87fd67f 100644
--- a/tools/emacs-pkgs/term-switcher/term-switcher.el
+++ b/tools/emacs-pkgs/term-switcher/term-switcher.el
@@ -29,10 +29,11 @@
 (defun ts/open-or-create-vterm (buffer-name)
   "Switch to the buffer with BUFFER-NAME or create a new vterm
   buffer."
-  (let ((buffer (get-buffer buffer-name)))
-    (if (not buffer)
-        (vterm)
-      (switch-to-buffer buffer))))
+  (if (equal "New vterm" buffer-name)
+      (vterm)
+    (if-let ((buffer (get-buffer buffer-name)))
+        (switch-to-buffer buffer)
+      (error "Could not find vterm buffer: %s" buffer-name))))
 
 (defun ts/is-vterm-buffer (buffer)
   "Determine whether BUFFER runs a vterm."