mhayashi1120 / Emacs-langtool

LanguageTool for Emacs
GNU General Public License v3.0
377 stars 31 forks source link

Anyone know how to make 2 spaces after a period/stop legal? #39

Open christoofar opened 5 years ago

christoofar commented 5 years ago

For now I have to do a global search and replace to make my documents single-spaced after the period before running langtool, then change them back to 2 spaces after the period. :-)

gwern commented 4 years ago

You could use the --disable feature. This lets you disable langtool rules which are inappropriate. For example, I customize langtool as follows for my Markdown documents:

(setq langtool-user-arguments '("-b" "--line-by-line" "--disable" "EN_QUOTES,MULTIPLICATION_SIGN,WORD_CONTAINS_UNDERSCORE,ET_AL,SENTENCE_WHITESPACE,DASH_RULE,MORFOLOGIK_RULE_EN_US,EN_UNPAIRED_BRACKETS,WHITESPACE_RULE"))

To get a rule name, you can run the CLI version which will helpfully print out the relevant rule. (The Emacs interface seems to omit it.) You can also check https://community.languagetool.org/rule/list In your case, I think it's covered by WHITESPACE_RULE, so it might work to try just

(setq langtool-user-arguments '("--disable" "WHITESPACE_RULE"))

?

(Note that each string must be separate, it's space-delimited. If you try "disable WHITESPACE_RULE", the Emacs code will throw an error even though it's fine on the CLI.)