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 | 0a868aee4af7e30730ad937308323f65defd42ed (patch) | |
| tree | 7be63a7458812dd9e2742efcf73a5d1f706d7c5b /tests/test-markdown-config.el | |
| parent | 52f55d015122b7285dde674e7d9587a2c5276360 (diff) | |
| download | dotemacs-0a868aee4af7e30730ad937308323f65defd42ed.tar.gz dotemacs-0a868aee4af7e30730ad937308323f65defd42ed.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 45e1a601..edb20d35 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 |
