2

Question:

Is it possible to run ispell on a region (or the whole diff and nothing else) directly from the magit-status buffer?

Motivation:

I am writing varying amounts of text and often keep it under version control. I also use magit as a front-end for git. After adding chunks of text here and there and then checking the magit-status I catch myself wanting to spell check newly edited regions without the hassle of diving in to the text and find it or spell-check the whole document.

  • Well, you can check, but you cannot fix (as the text won't be editable there). You probably know that already: M-$ is to spellcheck a word and M-x ispell-region to spellcheck a region. – wvxvw Oct 20 '15 at 9:21
  • "the hassle of diving in to the text" - Pressing RET on the text in the diff will jump to the corresponding location in the file. – npostavs Oct 21 '15 at 1:16
  • 1
    ispell would be harder because it is interactive, but I have implemented tooling myself to be able to perform actions on specify unstaged hunks from the status buffer. You can see this here in my config: github.com/jordonbiondo/.emacs.d/blob/master/jordon/… . my specific use case is to run delete-trailing-whitespace on an unstaged hunk and save the changes from the status buffer. You may be able to use this tooling to implement what you want. See the docs for define-magit-unstaged-hunk-action for information on how it works. – Jordon Biondo Nov 19 '15 at 16:03
  • 1
    I just updated the file I linked to in my config implementing the ability to ispell a unstaged magit hunk. when you run the function from a magit status buffer it will actually switch to the buffer for the hunk and ispell the hunk's region, but when ispell finishes it switches back to the refreshed magit status buffer. It may be of use to you. – Jordon Biondo Dec 1 '15 at 21:28
  • 2
    @JordonBiondo you should probably post that as an answer. – tarsius Dec 11 '15 at 10:51
1

Magit does not support this and I am not aware of any third-party support. Edit: in the comments on the question there is some talk about third-party support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.