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 | 0c024848f91a9ca1aad8e4a0bd651091feb3608a (patch) | |
| tree | a8da3545bd8f08b699d25176c484e3d9c64863d0 /tests | |
| parent | 2427916c7fb1b65b89b9a3200d067413c85f94e8 (diff) | |
| download | dotemacs-0c024848f91a9ca1aad8e4a0bd651091feb3608a.tar.gz dotemacs-0c024848f91a9ca1aad8e4a0bd651091feb3608a.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.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 |
