refactor(emacs-pkgs/term-switcher): un-dash term-switcher.el

The builtin `seq' has everything I need, and this way bpalmer will be
less annoyed.

Change-Id: Ic8e5ac07d5214f36d77e9b577a3f805cdf89f220
Reviewed-on: https://cl.tvl.fyi/c/depot/+/9146
Reviewed-by: tazjin <tazjin@tvl.su>
Tested-by: BuildkiteCI
This commit is contained in:
Vincent Ambo 2023-08-23 22:31:07 +03:00 committed by tazjin
parent 4b4ec86114
commit 561a9fa45b

View file

@ -5,16 +5,16 @@
;;
;; Author: Vincent Ambo <tazjin@tvl.su>
;; Version: 1.1
;; Package-Requires: (dash ivy s vterm)
;; Package-Requires: (ivy s vterm)
;;
;;; Commentary:
;;
;; This package adds a function that lets users quickly switch between
;; different open vterms via ivy.
(require 'dash)
(require 'ivy)
(require 's)
(require 'seq)
(require 'vterm)
(defgroup term-switcher nil
@ -45,11 +45,11 @@
"Switch to an existing vterm buffer or create a new one."
(interactive)
(let ((terms (-map (lambda (b) (cons (buffer-name b) b))
(-filter #'ts/is-vterm-buffer (buffer-list)))))
(let ((terms (seq-map (lambda (b) (cons (buffer-name b) b))
(seq-filter #'ts/is-vterm-buffer (buffer-list)))))
(if terms
(ivy-read "Switch to vterm: "
(cons "New vterm" (-map #'car terms))
(cons "New vterm" (seq-map #'car terms))
:caller 'ts/switch-to-terminal
:preselect (s-concat "^" term-switcher-buffer-prefix)
:require-match t