diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-24 09:59:25 -0400 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-24 09:59:25 -0400 |
| commit | 2f4f73f4a9cd6729e73ec2bea9dde0f066ce24f7 (patch) | |
| tree | 76462917bf9b2cde001d66727773f3ea12912fbb /modules | |
| parent | 6e667d18d7295b5fddaced070dece798212ce2fd (diff) | |
| download | dotemacs-2f4f73f4a9cd6729e73ec2bea9dde0f066ce24f7.tar.gz dotemacs-2f4f73f4a9cd6729e73ec2bea9dde0f066ce24f7.zip | |
chore(elisp): clear byte-compile warnings (18 more modules)
Add declare-function/defvar declarations for lazily-loaded package symbols, reflow over-long docstrings, swap pdf-view-*-command interactive-only calls for their non-interactive twins, fix a malformed with-demoted-errors in ledger-config (the clean-buffer body was being read as the format string), and rename the unprefixed global wwwdir to cj/httpd-wwwdir (no external refs). No behavior change.
Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/browser-config.el | 3 | ||||
| -rw-r--r-- | modules/custom-ordering.el | 8 | ||||
| -rw-r--r-- | modules/dwim-shell-config.el | 10 | ||||
| -rw-r--r-- | modules/eww-config.el | 2 | ||||
| -rw-r--r-- | modules/flycheck-config.el | 8 | ||||
| -rw-r--r-- | modules/font-config.el | 3 | ||||
| -rw-r--r-- | modules/games-config.el | 2 | ||||
| -rw-r--r-- | modules/help-utils.el | 4 | ||||
| -rw-r--r-- | modules/httpd-config.el | 12 | ||||
| -rw-r--r-- | modules/ledger-config.el | 11 | ||||
| -rw-r--r-- | modules/mousetrap-mode.el | 10 | ||||
| -rw-r--r-- | modules/mu4e-org-contacts-setup.el | 4 | ||||
| -rw-r--r-- | modules/org-agenda-config-debug.el | 3 | ||||
| -rw-r--r-- | modules/org-capture-config.el | 3 | ||||
| -rw-r--r-- | modules/pdf-config.el | 20 | ||||
| -rw-r--r-- | modules/selection-framework.el | 6 | ||||
| -rw-r--r-- | modules/user-constants.el | 9 | ||||
| -rw-r--r-- | modules/video-audio-recording.el | 7 |
18 files changed, 102 insertions, 23 deletions
diff --git a/modules/browser-config.el b/modules/browser-config.el index 0312cdd18..d596b9e9d 100644 --- a/modules/browser-config.el +++ b/modules/browser-config.el @@ -145,7 +145,8 @@ Persists the choice for future sessions." (defun cj/--do-initialize-browser () "Initialize browser configuration. Returns: (cons \\='loaded browser-plist) if saved choice was loaded, - (cons \\='first-available browser-plist) if using first discovered browser, + (cons \\='first-available browser-plist) if using first + discovered browser, (cons \\='no-browsers nil) if no browsers found." (let ((saved-choice (cj/load-browser-choice))) (if saved-choice diff --git a/modules/custom-ordering.el b/modules/custom-ordering.el index a2423742d..0a499a35a 100644 --- a/modules/custom-ordering.el +++ b/modules/custom-ordering.el @@ -49,10 +49,10 @@ buffer region and must reject an inverted one before reading it." (defun cj/--ordering-replace-region (start end insertion) "Replace the buffer text between START and END with INSERTION. -Point is left after the inserted text. Shared tail for the interactive ordering commands, -which all compute a transformed string from the original region then swap it -in. INSERTION is evaluated by the caller before this runs, so the transform -reads the pre-deletion text." +Point is left after the inserted text. Shared tail for the interactive +ordering commands, which all compute a transformed string from the +original region then swap it in. INSERTION is evaluated by the caller +before this runs, so the transform reads the pre-deletion text." (delete-region start end) (goto-char start) (insert insertion)) diff --git a/modules/dwim-shell-config.el b/modules/dwim-shell-config.el index 230a8532c..014194c7b 100644 --- a/modules/dwim-shell-config.el +++ b/modules/dwim-shell-config.el @@ -100,6 +100,16 @@ (require 'cl-lib) (require 'system-lib) ;; cj/confirm-strong (permanent file destruction confirm) +;; Function declarations (lazily-loaded packages and sibling modules). +(declare-function dwim-shell-command-on-marked-files "dwim-shell-command") +(declare-function dwim-shell-command-read-file-name "dwim-shell-command") +(declare-function dwim-shell-command--files "dwim-shell-command") +(declare-function cj/xdg-open "external-open") +(declare-function dwim-shell-commands-menu "dwim-shell-config") + +;; Forward declaration: external variable provided by the dirvish package. +(defvar dirvish-mode-map) + ;; --------------------------- Password-file helpers --------------------------- (defun cj/dwim-shell--password-cleanup-callback (temp-file) diff --git a/modules/eww-config.el b/modules/eww-config.el index a41a9a76e..a5271f6bc 100644 --- a/modules/eww-config.el +++ b/modules/eww-config.el @@ -32,6 +32,8 @@ (require 'cl-lib) +(declare-function eww-add-bookmark "eww") + (defgroup my-eww-user-agent nil "EWW-only User-Agent management." :group 'eww) diff --git a/modules/flycheck-config.el b/modules/flycheck-config.el index 5626095c5..1afd3ae6c 100644 --- a/modules/flycheck-config.el +++ b/modules/flycheck-config.el @@ -45,6 +45,14 @@ (require 'keybindings) ;; provides cj/custom-keymap (use-package :map below) +;; ------------------------------- Declarations -------------------------------- + +(declare-function flycheck-mode "flycheck") +(declare-function flycheck-list-errors "flycheck") +(declare-function flycheck-add-mode "flycheck") +(declare-function flycheck-buffer "flycheck") +(declare-function cj/flycheck-prose-on-demand "flycheck-config") + (defun cj/prose-helpers-on () "Ensure that `abbrev-mode' and `flycheck-mode' are on in the current buffer." (interactive) diff --git a/modules/font-config.el b/modules/font-config.el index 1c431c864..3272a946e 100644 --- a/modules/font-config.el +++ b/modules/font-config.el @@ -56,6 +56,9 @@ (require 'host-environment) (require 'keybindings) ;; establishes the C-z prefix used for "C-z F" below +(defvar text-scale-mode-step) +(declare-function cj/disable-emojify-mode "font-config") + ;; ---------------------- HarfBuzz Font Cache Crash Fix ----------------------- ;; Prevents Emacs from compacting font caches during GC. Without this, GC can ;; free font cache entries that HarfBuzz still references, causing SIGSEGV diff --git a/modules/games-config.el b/modules/games-config.el index aa26d31ee..0ff01c809 100644 --- a/modules/games-config.el +++ b/modules/games-config.el @@ -25,6 +25,8 @@ (require 'user-constants) ;; org-dir +(defvar malyon-stories-directory) + (with-eval-after-load 'malyon (setq malyon-stories-directory (concat org-dir "text.games/"))) diff --git a/modules/help-utils.el b/modules/help-utils.el index f9f5d1427..3e31efffe 100644 --- a/modules/help-utils.el +++ b/modules/help-utils.el @@ -32,6 +32,10 @@ ;; ;;; Code: +;; Lazily-loaded functions referenced below. +(declare-function devdocs-go-back "devdocs") +(declare-function devdocs-go-forward "devdocs") + ;; ---------------------------------- Devdocs ---------------------------------- (use-package devdocs diff --git a/modules/httpd-config.el b/modules/httpd-config.el index c90399425..60baf7e82 100644 --- a/modules/httpd-config.el +++ b/modules/httpd-config.el @@ -19,13 +19,13 @@ (use-package simple-httpd :defer 1 :preface - (defconst wwwdir (concat user-emacs-directory "www")) - (defun check-or-create-wwwdir () - (unless (file-exists-p wwwdir) - (make-directory wwwdir))) - :init (check-or-create-wwwdir) + (defconst cj/httpd-wwwdir (concat user-emacs-directory "www")) + (defun cj/httpd-check-or-create-wwwdir () + (unless (file-exists-p cj/httpd-wwwdir) + (make-directory cj/httpd-wwwdir))) + :init (cj/httpd-check-or-create-wwwdir) :config - (setq httpd-root wwwdir) + (setq httpd-root cj/httpd-wwwdir) (setq httpd-show-backtrace-when-error t) (setq httpd-serve-files t)) diff --git a/modules/ledger-config.el b/modules/ledger-config.el index c268fa368..5b2712b57 100644 --- a/modules/ledger-config.el +++ b/modules/ledger-config.el @@ -3,6 +3,14 @@ ;;; Commentary: +;;; Code: + +;; ------------------------------- Declarations -------------------------------- + +(declare-function ledger-mode-clean-buffer "ledger-mode") +(defvar ledger-mode-map) +(defvar company-backends) + ;; -------------------------------- Ledger Mode -------------------------------- ;; edit files in ledger format @@ -16,7 +24,8 @@ (interactive) (save-excursion (when (buffer-modified-p) - (with-demoted-errors (ledger-mode-clean-buffer)) + (with-demoted-errors "Error cleaning ledger buffer: %S" + (ledger-mode-clean-buffer)) (save-buffer)))) :bind (:map ledger-mode-map diff --git a/modules/mousetrap-mode.el b/modules/mousetrap-mode.el index 99475fcde..3817e0081 100644 --- a/modules/mousetrap-mode.el +++ b/modules/mousetrap-mode.el @@ -67,7 +67,8 @@ Categories can be combined in profiles to allow specific interaction patterns.") "Mouse interaction profiles for different use cases. Each profile specifies which event categories are allowed. -Available categories: primary-click, secondary-click, drags, multi-clicks, scroll. +Available categories: primary-click, secondary-click, drags, +multi-clicks, scroll. Profiles: - disabled: Block all mouse events @@ -88,7 +89,7 @@ Modes not listed here will use `mouse-trap-default-profile'. When checking, the mode hierarchy is respected via `derived-mode-p'.") (defvar mouse-trap-default-profile 'disabled - "Default profile to use when current major mode is not in `mouse-trap-mode-profiles'.") + "Default profile when the major mode is not in `mouse-trap-mode-profiles'.") ;;; Keymap Builder @@ -187,6 +188,11 @@ Used via `emulation-mode-map-alists' so each buffer gets its own keymap.") ;;; Minor Mode Definition +;; Forward declaration: the minor-mode variable is defined by the +;; `define-minor-mode' form below, but referenced earlier in the lighter +;; keymap and lighter-string helpers. +(defvar mouse-trap-mode) + (defvar mouse-trap--lighter-keymap (let ((map (make-sparse-keymap))) (define-key map [mode-line mouse-1] diff --git a/modules/mu4e-org-contacts-setup.el b/modules/mu4e-org-contacts-setup.el index 034e74574..64e9a611f 100644 --- a/modules/mu4e-org-contacts-setup.el +++ b/modules/mu4e-org-contacts-setup.el @@ -7,6 +7,10 @@ ;;; Code: +(defvar mu4e-compose-complete-only-personal) +(defvar mu4e-compose-complete-only-after) +(declare-function cj/activate-mu4e-org-contacts-integration "mu4e-org-contacts-integration") + ;; Load the integration module. Activation only runs when the module loaded ;; cleanly AND mu4e is present; otherwise this file is a no-op so the rest ;; of the config can load without mu4e installed. diff --git a/modules/org-agenda-config-debug.el b/modules/org-agenda-config-debug.el index a9c713a13..4c1b1dd84 100644 --- a/modules/org-agenda-config-debug.el +++ b/modules/org-agenda-config-debug.el @@ -18,6 +18,9 @@ (require 'user-constants) (require 'system-lib) +(defvar org-agenda-files) +(declare-function cj/build-org-agenda-list "org-agenda-config") + ;; ---------------------------- Debug Functions -------------------------------- ;;;###autoload diff --git a/modules/org-capture-config.el b/modules/org-capture-config.el index 2f245185f..9f5bfbe7f 100644 --- a/modules/org-capture-config.el +++ b/modules/org-capture-config.el @@ -30,6 +30,7 @@ (defvar org-complex-heading-regexp-format) (declare-function cj/--drill-pick-file "org-drill-config") +(declare-function cj/org-capture--date-prefix "org-capture-config") (declare-function org-at-encrypted-entry-p "org-crypt") (declare-function org-at-heading-p "org") (declare-function org-back-to-heading "org") @@ -170,7 +171,7 @@ letter upcased: \"~/.emacs.d/\" -> \"Emacs.d\", \"~/code/duet/\" -> \"Duet\"." ROOT is the projectile project root (or nil); INBOX is the global inbox file path. Return a plist (:file F :open-work BOOL :project NAME :warn MSG): - ROOT with a todo.org -> F is that todo.org, :open-work t. -- ROOT without a todo.org -> F is INBOX, :open-work nil, :warn names the project. +- ROOT without a todo.org -> F is INBOX, :open-work nil, :warn names project. - ROOT nil -> F is INBOX, :open-work nil, :warn nil." (if (and (stringp root) (not (string-empty-p root))) (let ((todo (expand-file-name "todo.org" root)) diff --git a/modules/pdf-config.el b/modules/pdf-config.el index ca2312307..233a610d5 100644 --- a/modules/pdf-config.el +++ b/modules/pdf-config.el @@ -14,6 +14,22 @@ ;; ;;; Code: +;; ------------------------------- Declarations -------------------------------- + +(declare-function pdf-tools-install "pdf-tools") +(declare-function pdf-view-midnight-minor-mode "pdf-view") +(declare-function pdf-view-enlarge "pdf-view") +(declare-function pdf-view-shrink "pdf-view") +(declare-function pdf-view-next-page "pdf-view") +(declare-function pdf-view-previous-page "pdf-view") +(declare-function image-next-line "image-mode") +(declare-function image-previous-line "image-mode") +(declare-function image-bob "image-mode") +(declare-function image-eob "image-mode") +(declare-function org-store-link "ol") +(declare-function cj/open-file-with-command "system-utils") +(declare-function cj/org-noter-insert-note-dwim "org-noter-config") + ;; --------------------------------- PDF Tools --------------------------------- (use-package pdf-tools @@ -61,9 +77,9 @@ (define-key pdf-view-mode-map "i" #'cj/org-noter-insert-note-dwim) ;; Page change: C-up/C-down go to top of prev/next page (define-key pdf-view-mode-map (kbd "C-<down>") - (lambda () (interactive) (pdf-view-next-page-command) (image-bob))) + (lambda () (interactive) (pdf-view-next-page) (image-bob))) (define-key pdf-view-mode-map (kbd "C-<up>") - (lambda () (interactive) (pdf-view-previous-page-command) (image-eob)))) + (lambda () (interactive) (pdf-view-previous-page) (image-eob)))) ;; ------------------------------ PDF View Restore ----------------------------- diff --git a/modules/selection-framework.el b/modules/selection-framework.el index a567e8003..464654a20 100644 --- a/modules/selection-framework.el +++ b/modules/selection-framework.el @@ -26,6 +26,12 @@ ;; ;;; Code: +;; External variables and lazily-loaded functions referenced below. +(defvar xref-show-xrefs-function) +(defvar xref-show-definitions-function) +(declare-function consult-dir-projectile-dirs "consult-dir") +(declare-function prescient-persist-mode "prescient") + ;; ---------------------------------- Vertico ---------------------------------- ;; Vertical completion UI diff --git a/modules/user-constants.el b/modules/user-constants.el index dab12dcbe..b392212ed 100644 --- a/modules/user-constants.el +++ b/modules/user-constants.el @@ -154,15 +154,18 @@ Syncthing-synced `org-dir' — see the 2026-06-10 transport migration.") (defvar gcal-file (expand-file-name "data/gcal.org" user-emacs-directory) "The location of the org file containing Google Calendar information. -Stored in .emacs.d/data/ so each machine syncs independently from Google Calendar.") +Stored in .emacs.d/data/ so each machine syncs independently from +Google Calendar.") (defvar pcal-file (expand-file-name "data/pcal.org" user-emacs-directory) "The location of the org file containing Proton Calendar information. -Stored in .emacs.d/data/ so each machine syncs independently from Proton Calendar.") +Stored in .emacs.d/data/ so each machine syncs independently from +Proton Calendar.") (defvar dcal-file (expand-file-name "data/dcal.org" user-emacs-directory) "The location of the org file containing DeepSat Calendar information. -Stored in .emacs.d/data/ so each machine syncs independently from Google Calendar.") +Stored in .emacs.d/data/ so each machine syncs independently from +Google Calendar.") (defvar reference-file (expand-file-name "reference.org" org-dir) "The location of the org file containing reference information.") diff --git a/modules/video-audio-recording.el b/modules/video-audio-recording.el index 4c934ef17..1672529f7 100644 --- a/modules/video-audio-recording.el +++ b/modules/video-audio-recording.el @@ -174,9 +174,10 @@ Checks if process is actually alive, not just if variable is set." (defun cj/recording-process-sentinel (process event) "Sentinel for recording processes — handles unexpected exits. PROCESS is the ffmpeg shell process, EVENT describes what happened. -This is called by Emacs when the process changes state (exits, is killed, etc.). -It clears the process variable and updates the modeline so the recording indicator -disappears even if the recording crashes or is killed externally." +This is called by Emacs when the process changes state (exits, is +killed, etc.). It clears the process variable and updates the modeline +so the recording indicator disappears even if the recording crashes or +is killed externally." (when (memq (process-status process) '(exit signal)) (cond ((eq process cj/audio-recording-ffmpeg-process) |
