Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement 'writegood-region' #30

Open
rudolf-adamkovic opened this issue May 23, 2021 · 0 comments
Open

Implement 'writegood-region' #30

rudolf-adamkovic opened this issue May 23, 2021 · 0 comments

Comments

@rudolf-adamkovic
Copy link

rudolf-adamkovic commented May 23, 2021

I would like to combine flyspell-region with writegood-mode, but writegood-mode does not provide a function to check a region of text.

This is what I came up with to work around the limitation:

(defun writegood-region (beginning end)
  "Check style between BEGINNING and END."
  (interactive "r")
  (narrow-to-region beginning end)
  (writegood-mode)
  (widen))

(defun prose-check-region (beginning end)
  "Check spelling and style between BEGINNING and END."
  (interactive "r")
  (when (use-region-p)
    (writegood-region beginning end)
    (flyspell-region beginning end)
    (setq deactivate-mark t)))

The problem is that writegood-mode remains enabled after the function writegood-region returns.

Any ideas?

Cross-posted: https://emacs.stackexchange.com/questions/64981/combine-flyspell-region-withwritegood-mode

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant