aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-13 13:02:46 -0500
committerCraig Jennings <c@cjennings.net>2026-06-13 13:02:46 -0500
commit09d3b551fba1c8c3afc60d0c47fbac51e81a41ad (patch)
tree2af4c0c375abf9dc1c0b2634d71b6149c5292082 /tests
parentdac477839dcac84b7217230e6a94a007cea966ab (diff)
downloaddotemacs-09d3b551fba1c8c3afc60d0c47fbac51e81a41ad.tar.gz
dotemacs-09d3b551fba1c8c3afc60d0c47fbac51e81a41ad.zip
fix(markdown): restore the live preview (rename, guard, dead setq)
F2 ran markdown-mode's own markdown-preview instead of the custom one, so the impatient-mode strapdown preview was dead. I renamed the custom command to cj/markdown-preview and rebound F2 so markdown-mode no longer shadows it. The server guard now uses httpd-running-p (httpd-process isn't a variable), and a dead (setq imp-set-user-filter 'markdown-html) that named neither a real variable nor a real filter is gone.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-markdown-config.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test-markdown-config.el b/tests/test-markdown-config.el
index 45e1a6018..edb20d357 100644
--- a/tests/test-markdown-config.el
+++ b/tests/test-markdown-config.el
@@ -9,6 +9,7 @@
;;; Code:
(require 'ert)
+(require 'cl-lib)
(add-to-list 'load-path (expand-file-name "modules" user-emacs-directory))
@@ -50,5 +51,14 @@
(should (string-match-p "<xmp" (buffer-string))))
(kill-buffer src))))
+;;; cj/markdown-preview (guard: refuse when the httpd listener is down)
+
+(ert-deftest test-markdown-preview-errors-when-server-down ()
+ "Error: `cj/markdown-preview' signals a user-error when the simple-httpd
+listener is not running, rather than opening a preview against a dead server.
+Also pins the rename off the bare `markdown-preview' that markdown-mode shadows."
+ (cl-letf (((symbol-function 'httpd-running-p) (lambda () nil)))
+ (should-error (cj/markdown-preview) :type 'user-error)))
+
(provide 'test-markdown-config)
;;; test-markdown-config.el ends here