From 0be39bc9fa41f14f9d6d1a449f8f2b77a502c619 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sat, 15 Nov 2025 14:08:47 -0600 Subject: fix(tests): Move cj/log-silently to system-lib.el, fix all test failures MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Consolidated cj/log-silently function to system-lib.el as the canonical location for low-level utility functions. This fixes 4 failing tests in video-audio-recording that couldn't find the function. Changes: - Move cj/log-silently to system-lib.el (from system-utils.el) - Remove duplicate definition from org-agenda-config-debug.el - Remove duplicate definition from system-utils.el - Add (require 'system-lib) to all modules using cj/log-silently: - video-audio-recording.el - org-agenda-config-debug.el - media-utils.el (also removed declare-function) - elfeed-config.el (replaced system-utils with system-lib) - wrap-up.el Test Results: - Before: 112/113 passing (4 video-audio-recording tests failing) - After: 113/113 passing ✓ All tests now pass with zero failures. Fixes TODO #809-895 (move cj/log-silently to system-lib.el) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- modules/elfeed-config.el | 2 +- modules/media-utils.el | 5 +++-- modules/org-agenda-config-debug.el | 14 +------------- modules/system-lib.el | 11 +++++++++++ modules/system-utils.el | 12 ------------ modules/video-audio-recording.el | 2 ++ modules/wrap-up.el | 2 ++ 7 files changed, 20 insertions(+), 28 deletions(-) (limited to 'modules') diff --git a/modules/elfeed-config.el b/modules/elfeed-config.el index 46520be2..52c5b8f1 100644 --- a/modules/elfeed-config.el +++ b/modules/elfeed-config.el @@ -15,7 +15,7 @@ ;;; Code: (require 'user-constants) -(require 'system-utils) +(require 'system-lib) (require 'media-utils) ;; ------------------------------- Elfeed Config ------------------------------- diff --git a/modules/media-utils.el b/modules/media-utils.el index e4eccb5e..db66a71f 100644 --- a/modules/media-utils.el +++ b/modules/media-utils.el @@ -25,8 +25,9 @@ ;; ;;; Code: -;; Declare functions and variables from other modules -(declare-function cj/log-silently "system-utils" (format-string &rest args)) +(require 'system-lib) + +;; Declare variables from other modules (defvar videos-dir) ;; from user-constants.el ;; ------------------------ Default Media Configurations ----------------------- diff --git a/modules/org-agenda-config-debug.el b/modules/org-agenda-config-debug.el index aded3b6a..a9c713a1 100644 --- a/modules/org-agenda-config-debug.el +++ b/modules/org-agenda-config-debug.el @@ -16,19 +16,7 @@ ;;; Code: (require 'user-constants) - -;; ---------------------------- Helper Functions ------------------------------- - -(defun cj/log-silently (format-string &rest args) - "Append formatted message to *Messages* buffer without echoing. -FORMAT-STRING and ARGS are passed to `format'. -This is a local copy of the pattern from system-utils.el." - (let ((inhibit-read-only t)) - (with-current-buffer (get-buffer-create "*Messages*") - (goto-char (point-max)) - (unless (bolp) (insert "\n")) - (insert (apply #'format format-string args)) - (unless (bolp) (insert "\n"))))) +(require 'system-lib) ;; ---------------------------- Debug Functions -------------------------------- diff --git a/modules/system-lib.el b/modules/system-lib.el index 8bbf8474..4c2f17ef 100644 --- a/modules/system-lib.el +++ b/modules/system-lib.el @@ -6,6 +6,7 @@ ;; ;; Functions include: ;; - Checking if external programs are available in PATH +;; - Silent logging to *Messages* buffer ;; ;;; Code: @@ -16,5 +17,15 @@ PROGRAM should be a string naming an executable program." (not (string-empty-p program)) (executable-find program))) +(defun cj/log-silently (format-string &rest args) + "Append formatted message (FORMAT-STRING with ARGS) to *Messages* buffer. +This does so without echoing in the minibuffer." + (let ((inhibit-read-only t)) + (with-current-buffer (get-buffer-create "*Messages*") + (goto-char (point-max)) + (unless (bolp) (insert "\n")) + (insert (apply #'format format-string args)) + (unless (bolp) (insert "\n"))))) + (provide 'system-lib) ;;; system-lib.el ends here diff --git a/modules/system-utils.el b/modules/system-utils.el index d20dd349..2ee7200c 100644 --- a/modules/system-utils.el +++ b/modules/system-utils.el @@ -211,18 +211,6 @@ Logs output and exit code to buffer *external-open.log*." (quick-sdcv-dictionary-prefix-symbol "►") (quick-sdcv-ellipsis " ▼")) -;;; -------------------------------- Log Silently ------------------------------- - -(defun cj/log-silently (format-string &rest args) - "Append formatted message (FORMAT-STRING with ARGS) to *Messages* buffer. -This does so without echoing in the minibuffer." - (let ((inhibit-read-only t)) - (with-current-buffer (get-buffer-create "*Messages*") - (goto-char (point-max)) - (unless (bolp) (insert "\n")) - (insert (apply #'format format-string args)) - (unless (bolp) (insert "\n"))))) - ;;; ------------------------------ Process Monitor ------------------------------ (use-package proced diff --git a/modules/video-audio-recording.el b/modules/video-audio-recording.el index 62a5f13e..b3151dba 100644 --- a/modules/video-audio-recording.el +++ b/modules/video-audio-recording.el @@ -64,6 +64,8 @@ ;; ;;; Code: +(require 'system-lib) + ;; Forward declarations (eval-when-compile (defvar video-recordings-dir)) (eval-when-compile (defvar audio-recordings-dir)) diff --git a/modules/wrap-up.el b/modules/wrap-up.el index b00d56a8..523d55b2 100644 --- a/modules/wrap-up.el +++ b/modules/wrap-up.el @@ -5,6 +5,8 @@ ;;; Code: +(require 'system-lib) + ;; -------------------------------- Bury Buffers ------------------------------- ;; wait a few seconds then bury compile-related buffers. -- cgit v1.2.3