aboutsummaryrefslogtreecommitdiff
path: root/modules/markdown-config.el
diff options
context:
space:
mode:
Diffstat (limited to 'modules/markdown-config.el')
-rw-r--r--modules/markdown-config.el12
1 files changed, 10 insertions, 2 deletions
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
- ("<f2>" . 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 "<f2>" #'cj/markdown-preview))
+
(provide 'markdown-config)
;;; markdown-config.el ends here