From 9c8b859cffdb7dda5ed4ffcb94d7e3b66587ad35 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Wed, 24 Jun 2026 09:41:35 -0400 Subject: chore(elisp): clear byte-compile warnings (elfeed, markdown, prog-general) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The use-package :bind autoload stubs for own same-file commands collided with their defuns ("defined multiple times"). Move those bindings out of :bind to keymap-global-set / with-eval-after-load after the defun — same key, command, and map, verified live in the daemon. prog-general's case was instead a redundant same-file declare-function (removed). Plus declare-function/defvar for lazy package symbols, and mark-whole-buffer swapped for goto-char+push-mark in the elfeed tag helpers. No behavior change. Claude-Session: https://claude.ai/code/session_01BqrdWUo9GcznYX2pZr76gZ --- modules/markdown-config.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'modules/markdown-config.el') diff --git a/modules/markdown-config.el b/modules/markdown-config.el index 16935425d..424c09cc8 100644 --- a/modules/markdown-config.el +++ b/modules/markdown-config.el @@ -20,14 +20,13 @@ :mode (("README\\.md\\'" . gfm-mode) ("\\.md\\'" . markdown-mode) ("\\.markdown\\'" . markdown-mode)) - :bind (:map markdown-mode-map - ("" . cj/markdown-preview)) ;; use same key as compile for consistency :init (setq markdown-command "multimarkdown")) ;; Register markdown as a known org-src-block language so `org-lint' ;; stops warning on `#+begin_src markdown ... #+end_src' and `C-c '' ;; inside such a block opens it in `markdown-mode' instead of falling ;; back to fundamental-mode. +(defvar org-src-lang-modes) (with-eval-after-load 'org (add-to-list 'org-src-lang-modes '("markdown" . markdown))) @@ -40,6 +39,8 @@ ;;;; --------------------- WIP: Markdown-Preview --------------------- +(declare-function imp--notify-clients "impatient-mode") + (defun cj/markdown-preview-server-start () "Start the simple-httpd listener that serves the live markdown preview. Idempotent: re-running while the server is already up is a no-op." @@ -75,5 +76,12 @@ lives in a separate command." (buffer-substring-no-properties (point-min) (point-max)))) (current-buffer))) +;; Bind the preview key after the defun so use-package's `:bind' autoload +;; stub doesn't collide with this file's own definition of the command +;; (that collision is the "defined multiple times" byte-compile warning). +;; Same key as compile, for consistency. +(with-eval-after-load 'markdown-mode + (keymap-set markdown-mode-map "" #'cj/markdown-preview)) + (provide 'markdown-config) ;;; markdown-config.el ends here -- cgit v1.2.3