From 82638b9e176833b6f1ec8a5e0657e77118bb5303 Mon Sep 17 00:00:00 2001 From: David Nikel-Shepherd Date: Sun, 6 Jul 2025 11:59:43 +0000 Subject: [PATCH 1/2] Remove dependencies on dash and s --- Makefile | 4 ++-- frames-only-mode.el | 29 +++++++++++++---------------- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index 46c4d36..84581ab 100644 --- a/Makefile +++ b/Makefile @@ -10,9 +10,9 @@ build : clean : @rm -f *.elc -test: build test-unit +test: test-unit -test-unit: +test-unit: build cask ${EMACS} --batch -L . -L test -l frames-only-mode-test.el -l revertable-set-test.el -f ert-run-tests-batch-and-exit test-load: diff --git a/frames-only-mode.el b/frames-only-mode.el index 4c2eabc..ad98d19 100644 --- a/frames-only-mode.el +++ b/frames-only-mode.el @@ -4,7 +4,7 @@ ;; Author: David Shepherd ;; Version: 1.0.0 -;; Package-Requires: ((emacs "26.3") (dash "2.13.0") (s "1.11.0")) +;; Package-Requires: ((emacs "27.1")) ;; Keywords: frames, windows ;; URL: https://github.com/davidshepherd7/frames-only-mode @@ -13,9 +13,6 @@ ;;; Code: -(require 'dash) -(require 's) - ;;; Options: @@ -132,11 +129,11 @@ we even set variables that are not currently bound, but we unbind them again on revert." ;; Transform to list of (var value initial-value) and call helper function. I ;; wish we had a back-portable thread-last macro... - (let ((var-val-initials (-map (lambda (s) (append s - (list (when (boundp (car s)) - (symbol-value (car s))) - (boundp (car s))))) - var-vals))) + (let ((var-val-initials (seq-map (lambda (s) (append s + (list (when (boundp (car s)) + (symbol-value (car s))) + (boundp (car s))))) + var-vals))) (frames-only-mode--revertable-set-helper var-val-initials))) (defun frames-only-mode--revertable-set-helper (var-value-initials) @@ -151,13 +148,13 @@ them again on revert." (makunbound (car s))))))) ;; Set each var - (-map (lambda (s) (set (car s) (cadr s))) var-value-initials) + (seq-map (lambda (s) (set (car s) (cadr s))) var-value-initials) ;; Return a function to revert the changes (lambda () "Revert the variable values set by revertable-set" (when (not revert-done) - (-map revert-var-fn var-value-initials) + (seq-map revert-var-fn var-value-initials) (setq revert-done t))))) (defvar frames-only-mode--revert-fn #'ignore @@ -187,11 +184,11 @@ This is useful for closing temporary windows created by some commands." (defun frames-only-should-kill-frame-for-buffer (b-name) - (--any? - (cond - ((stringp it) (equal b-name it)) - ((and (consp it) (eq (car it) 'regexp)) (s-matches-p (cdr it) b-name)) - (t nil)) + (seq-some + (lambda (it) (cond + ((stringp it) (equal b-name it)) + ((and (consp it) (eq (car it) 'regexp)) (string-match-p (cdr it) b-name)) + (t nil))) frames-only-mode-kill-frame-when-buffer-killed-buffer-list)) From 601ae2d7c00671a42c34cbaa85fcc4006ce4e8d6 Mon Sep 17 00:00:00 2001 From: David Nikel-Shepherd Date: Sun, 6 Jul 2025 12:00:11 +0000 Subject: [PATCH 2/2] Run test for not loading other libraries in CI --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 84581ab..967411f 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ build : clean : @rm -f *.elc -test: test-unit +test: test-unit test-load test-unit: build cask ${EMACS} --batch -L . -L test -l frames-only-mode-test.el -l revertable-set-test.el -f ert-run-tests-batch-and-exit