aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-26 10:31:25 -0400
committerCraig Jennings <c@cjennings.net>2026-06-26 10:31:25 -0400
commit696cf6e5df35a1964976ad44a10cf2d6c75cc65a (patch)
tree6c56bc82414f8e4677179cf1488308f10a2db464
parentfb491a642e2fd6137dbde327a8682e0e53332031 (diff)
downloaddotemacs-696cf6e5df35a1964976ad44a10cf2d6c75cc65a.tar.gz
dotemacs-696cf6e5df35a1964976ad44a10cf2d6c75cc65a.zip
chore(elisp): clear byte-compile warnings via declarations and a loop rewrite
Add the missing declare-function and defvar declarations that silence the not-known-to-be-defined and free-variable warnings in local-repository, org-webclipper, and weather-config. Rewrite jumper--location-exists-p from dotimes to cl-loop thereis, which fixes a spurious unused-variable warning and short-circuits on the first match. The remaining obsolete-generalized-variable warnings (point in pearl-config, buffer-substring in org-webclipper) come from upstream package macros (pearl, org-web-tools) and are not fixable in our code.
-rw-r--r--modules/jumper.el10
-rw-r--r--modules/local-repository.el2
-rw-r--r--modules/org-webclipper.el9
-rw-r--r--modules/weather-config.el2
4 files changed, 17 insertions, 6 deletions
diff --git a/modules/jumper.el b/modules/jumper.el
index 3dc00aa1..61b6464a 100644
--- a/modules/jumper.el
+++ b/modules/jumper.el
@@ -124,12 +124,10 @@ marker."
(defun jumper--location-exists-p ()
"Check if current location is already stored."
- (let ((key (jumper--location-key))
- (found nil))
- (dotimes (i jumper--next-index found)
- (when (jumper--with-marker-at
- i (lambda () (string= key (jumper--location-key))))
- (setq found t)))))
+ (let ((key (jumper--location-key)))
+ (cl-loop for i from 0 below jumper--next-index
+ thereis (jumper--with-marker-at
+ i (lambda () (string= key (jumper--location-key)))))))
(defun jumper--register-available-p ()
"Check if there are registers available."
diff --git a/modules/local-repository.el b/modules/local-repository.el
index 6376d9f7..9ce7a1af 100644
--- a/modules/local-repository.el
+++ b/modules/local-repository.el
@@ -16,6 +16,8 @@
(require 'elpa-mirror nil t) ;; optional; cj/update-localrepo-repository fails at call-time if absent
+(declare-function elpamr-create-mirror-for-installed "elpa-mirror")
+
;; ------------------------------ Utility Function -----------------------------
diff --git a/modules/org-webclipper.el b/modules/org-webclipper.el
index 99e837e6..f32cad3f 100644
--- a/modules/org-webclipper.el
+++ b/modules/org-webclipper.el
@@ -52,6 +52,15 @@
;;; Code:
+(declare-function org-web-tools--url-as-readable-org "org-web-tools")
+(declare-function org-w3m-copy-for-org-mode "org-w3m")
+(declare-function org-eww-copy-for-org-mode "org-eww")
+(declare-function org-capture-get "org-capture")
+;; Special vars from org-capture / org-protocol / user-constants, loaded at
+;; runtime; declared here so standalone byte-compilation does not warn.
+(defvar org-capture-templates)
+(defvar org-protocol-protocol-alist)
+(defvar webclipped-file)
;; Variables for storing org-protocol data
(defvar cj/--webclip-url nil
diff --git a/modules/weather-config.el b/modules/weather-config.el
index 04531350..416db032 100644
--- a/modules/weather-config.el
+++ b/modules/weather-config.el
@@ -17,6 +17,8 @@
;;
;;; Code:
+(defvar wttrin-geolocation-command)
+
;; ----------------------------------- Wttrin ----------------------------------
(use-package wttrin