-
in informal documents, i often stick to lower case. can i somehow make jinx ignore the case of letters? |
Beta Was this translation helpful? Give feedback.
Answered by
minad
Nov 22, 2023
Replies: 2 comments 3 replies
-
Hi! You could replace |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
mekeor
-
On 11/28/23 13:32, mekeor wrote:
Here's what I came up with:
(defun /jinx--lower-case-word-valid-p (start)
"Return non-nil if word, that is assumed to be in lower case, at
START is valid, or would be valid if capitalized or upcased."
(let ((word (buffer-substring-no-properties start (point))))
(or (member word jinx--session-words)
(cl-loop for dict in jinx--dicts thereis
(or
(jinx--mod-check dict (upcase word))
(jinx--mod-check dict (capitalize word))
(jinx--mod-check dict word))))))
(defun /jinx-lower-case-only () (interactive)
"Make `jinx-mode' assume that everything in the current buffer is
written in lower case and it ignore casing while spell-checking."
(jinx-mode 0)
(set (make-local-variable 'jinx--predicates)
(cl-substitute
#'/jinx--lower-case-word-valid-p
#'jinx--word-valid-p
jinx--predicates))
(jinx-mode 1))
Feel free to add this code to the wiki if you like. It may be helpful
for others. Thanks!
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
You could replace
jinx--word-valid-p
injinx--predicates
with a custom function which checks both the lower case and the capitalized form of the word.