diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-13 13:02:46 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-13 13:02:46 -0500 |
| commit | 8e70b8e07126bd5e6c4ad470f38b83e29cdc8108 (patch) | |
| tree | b59b65d4a50655f5bc38853b18d060f759435837 /tests/test-markdown-config.el | |
| parent | a2df36e8c6676353309d68f66d17c46130163e77 (diff) | |
| download | dotemacs-8e70b8e07126bd5e6c4ad470f38b83e29cdc8108.tar.gz dotemacs-8e70b8e07126bd5e6c4ad470f38b83e29cdc8108.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/test-markdown-config.el')
| -rw-r--r-- | tests/test-markdown-config.el | 10 |
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 |
