From 6e667d18d7295b5fddaced070dece798212ce2fd Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 24 Jun 2026 09:51:38 -0400 Subject: chore(elisp): clear byte-compile warnings (calibredb, config-utilities, tramp, diff, chrono, auth) Add declare-function/defvar declarations for lazily-loaded package functions and variables so each module compiles cleanly standalone; config-utilities wraps two lazy EmacSQL oref slot reads in with-no-warnings. No behavior change. Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ --- modules/config-utilities.el | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'modules/config-utilities.el') diff --git a/modules/config-utilities.el b/modules/config-utilities.el index b3eec5d3d..f448327c1 100644 --- a/modules/config-utilities.el +++ b/modules/config-utilities.el @@ -21,6 +21,19 @@ (require 'find-lisp) (require 'profiler) +;; External variables referenced at runtime only (org and the native +;; compiler are loaded lazily; declare to quiet the byte-compiler). +(defvar comp-async-report-warnings-errors) +(defvar org-ts-regexp) +(defvar org-agenda-files) + +;; External functions referenced at runtime only. +(declare-function org-element-parse-buffer "org-element") +(declare-function org-element-map "org-element") +(declare-function org-element-property "org-element-ast") +(declare-function org-time-string-to-absolute "org") +(declare-function org-alert-check "org-alert") + ;;; -------------------------------- Debug Keymap ------------------------------- (defvar-keymap cj/debug-config-keymap @@ -65,13 +78,15 @@ (with-eval-after-load 'emacsql-sqlite-builtin (cl-defmethod emacsql-close :around ((connection emacsql-sqlite-builtin-connection)) - (when (oref connection handle) + ;; The class is loaded lazily, so the slot is unknown at compile time. + (when (with-no-warnings (oref connection handle)) (cl-call-next-method)))) (with-eval-after-load 'emacsql-sqlite-module (cl-defmethod emacsql-close :around ((connection emacsql-sqlite-module-connection)) - (when (oref connection handle) + ;; The class is loaded lazily, so the slot is unknown at compile time. + (when (with-no-warnings (oref connection handle)) (cl-call-next-method)))) ;;; -------------------------------- Benchmarking ------------------------------- -- cgit v1.2.3