aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-24 16:23:34 -0500
committerCraig Jennings <c@cjennings.net>2026-07-24 16:23:34 -0500
commitcb08bf8754b09222081a571dc4134d5568d61012 (patch)
treead068dc2062d2d17773309c932c38afaa63e7fa3 /modules
parentc24dbe25d25bee514393b54bc3cbd5e7d638fd9b (diff)
downloaddotemacs-cb08bf8754b09222081a571dc4134d5568d61012.tar.gz
dotemacs-cb08bf8754b09222081a571dc4134d5568d61012.zip
refactor: clear six byte-compile warnings across four modules
- org-agenda-frame declared two of its own functions with declare-function. - Same-file forward refs resolve at end of compile, so those were redundant. - Worse, the declared empty arglist overrode safe-redo's real (&optional frame). - That silently disabled arg-count checking on it; removed both declarations. - music-config and video-audio-recording referenced three vars before their defvars. - Added forward declarations so each compiles as a dynamic binding. - dashboard declared el special, which made the section macro's own binding shadow it. - Removed that declaration; el is the macro's lexical binding and resolves cleanly. - Declared wttrin, the last undefined-function reference in the launcher table.
Diffstat (limited to 'modules')
-rw-r--r--modules/dashboard-config.el15
-rw-r--r--modules/music-config.el9
-rw-r--r--modules/org-agenda-frame.el10
-rw-r--r--modules/video-audio-recording-capture.el4
4 files changed, 27 insertions, 11 deletions
diff --git a/modules/dashboard-config.el b/modules/dashboard-config.el
index 8507344d..c7ff39dc 100644
--- a/modules/dashboard-config.el
+++ b/modules/dashboard-config.el
@@ -73,6 +73,7 @@
;; External package commands invoked by launchers.
(declare-function mu4e "mu4e")
(declare-function pearl-list-issues "pearl")
+(declare-function wttrin "wttrin")
;; ------------------------ Dashboard Bookmarks Override -----------------------
;; overrides the bookmark insertion from the dashboard package to provide an
@@ -84,13 +85,13 @@
(defvar dashboard-bookmarks-item-format "%s"
"Format to use when showing the base of the file name.")
-;; `el' is bound dynamically by dashboard's section-insertion machinery, which the
-;; override below plugs into. Declare it so the byte-compiler reads the
-;; references as that special variable rather than a free variable. The name is
-;; dashboard's, not ours, so the missing-prefix lint is suppressed rather than
-;; renamed (renaming would break the dynamic binding dashboard supplies).
-(with-suppressed-warnings ((lexical el))
- (defvar el))
+;; No `(defvar el)' here on purpose. `el' is the per-item variable that
+;; dashboard's `dashboard-insert-section' macro binds inside its own expansion;
+;; the override's forms below reference it within that binding. Declaring `el'
+;; special (as an earlier attempt did) is what CREATED a byte-compile warning --
+;; it turned the macro's ordinary lexical binding into one that "shadows the
+;; dynamic variable el". Left lexical, the references resolve inside the
+;; expansion and the compile is clean.
;; The override body uses the `dashboard-insert-section' MACRO, so it must be
;; known when this module byte-compiles or the call compiles as a plain
diff --git a/modules/music-config.el b/modules/music-config.el
index a7ec62c8..233bae72 100644
--- a/modules/music-config.el
+++ b/modules/music-config.el
@@ -374,6 +374,11 @@ point until it ends; the snap lands when the search exits."
(defvar-local cj/music--renumber-timer nil
"Pending idle timer for the playlist row renumber, or nil.")
+;; Forward declaration: the real `defvar-local' is a few defuns below, next to
+;; the highlight helper that owns it. Declared special here so the setq in this
+;; function compiles as a dynamic binding, not a free-variable warning.
+(defvar cj/music--current-number-overlay)
+
(defun cj/music--renumber-rows (&optional buffer)
"Number every playlist row in BUFFER (default: current buffer) via overlays.
Each non-blank line gets an \"NNN \" before-string so the cursor stays
@@ -789,6 +794,10 @@ ENTRIES. Nil when neither applies (the caller falls back to a timestamp)."
(plist-get (cdr (assoc (emms-track-name tr) entries))
:name)))))
+;; Forward declaration: the real `defvar' lives with the radio config block far
+;; below. Declared special here so this reference compiles clean.
+(defvar cj/music-radio-save-dir)
+
(defun cj/music--save-directory (tracks)
"Directory a saved playlist targets.
An all-stream queue is a radio playlist and saves into
diff --git a/modules/org-agenda-frame.el b/modules/org-agenda-frame.el
index b783e358..8fbcb390 100644
--- a/modules/org-agenda-frame.el
+++ b/modules/org-agenda-frame.el
@@ -45,10 +45,12 @@
(declare-function org-get-at-bol "org" (property))
(declare-function org-fold-show-context "org-fold" (&optional key))
(declare-function org-agenda "org-agenda" (&optional arg org-keys restriction))
-;; Forward references: defined later in this file (Phase 2 for -safe-redo,
-;; the lifecycle block for -delete).
-(declare-function cj/--agenda-frame-safe-redo "org-agenda-frame" ())
-(declare-function cj/--agenda-frame-delete "org-agenda-frame" ())
+;; No declare-function for -safe-redo / -delete: they are defined later in THIS
+;; file, and the byte-compiler resolves same-file forward references at end of
+;; compilation. A declare-function for a same-file function instead counts as a
+;; second definition ("defined multiple times") and, worse, its declared arglist
+;; overrides the real one for arg-count checking -- the empty () shadowed
+;; -safe-redo's actual (&optional frame), disabling that check.
(defconst cj/--agenda-frame-parameter 'cj/agenda-frame
"Frame parameter marking the dedicated agenda frame.
diff --git a/modules/video-audio-recording-capture.el b/modules/video-audio-recording-capture.el
index 7b71d54f..a56a5906 100644
--- a/modules/video-audio-recording-capture.el
+++ b/modules/video-audio-recording-capture.el
@@ -56,6 +56,10 @@ Checks if process is actually alive, not just if variable is set."
;;; Process Lifecycle (Sentinel and Graceful Shutdown)
+;; Forward declaration: the real `defvar' is defined below with the other
+;; recording thresholds. Declared special here so this reference compiles clean.
+(defvar cj/recording-start-fail-threshold)
+
(defun cj/recording-process-sentinel (process event)
"Sentinel for recording processes — handles unexpected exits.
PROCESS is the ffmpeg shell process, EVENT describes what happened.