aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
committerCraig Jennings <c@cjennings.net>2026-07-20 23:31:58 -0500
commit2f2d8b1c4f4eae6707c472b2287c72c3bb796309 (patch)
tree76cb5fea404ee2ae4a71b7d67761b024a6b9fc42 /tests
parentcdafac63b1202e515817b86b1f38a9727d36650d (diff)
downloaddotemacs-2f2d8b1c4f4eae6707c472b2287c72c3bb796309.tar.gz
dotemacs-2f2d8b1c4f4eae6707c472b2287c72c3bb796309.zip
fix(flyspell): escape the + so org src blocks are actually skipped
The skip entry used "#+" (one-or-more #), which matches no real begin_src line, so ispell spell-checked inside every org code block.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-flyspell-and-abbrev.el18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/test-flyspell-and-abbrev.el b/tests/test-flyspell-and-abbrev.el
index 3b494d5e..b4be6ab3 100644
--- a/tests/test-flyspell-and-abbrev.el
+++ b/tests/test-flyspell-and-abbrev.el
@@ -17,6 +17,7 @@
(require 'ert)
(require 'cl-lib)
+(require 'user-constants) ;; org-dir, read by the ispell :config below
(require 'flyspell)
(require 'flyspell-and-abbrev)
@@ -27,6 +28,23 @@
(overlay-put o 'face 'flyspell-incorrect)
o))
+;; ------------------------- org src-block skip entry ---------------------------
+
+(ert-deftest test-flyspell-ispell-skip-entry-matches-src-block-lines ()
+ "Normal: the ispell skip entry matches real org src-block delimiters.
+The old entry used \"#+\" (one-or-more #), which matches no real
+begin_src line, so ispell spell-checked inside every org code block."
+ (require 'ispell)
+ (let ((entry (seq-find (lambda (e)
+ (and (consp e) (stringp (car e))
+ (string-match-p "BEGIN_SRC" (car e))))
+ ispell-skip-region-alist)))
+ (should entry)
+ (let ((case-fold-search t))
+ (should (string-match-p (car entry) "#+BEGIN_SRC emacs-lisp"))
+ (should (string-match-p (car entry) "#+begin_src python"))
+ (should (string-match-p (cdr entry) "#+end_src")))))
+
;; ------------------------ cj/--require-spell-checker -------------------------
(ert-deftest test-flyspell-require-spell-checker-present ()