Skip to content

Commit

Permalink
Make error output useful in emacs compiler mode
Browse files Browse the repository at this point in the history
Format misspelled words so emacs can use the lines to jump directly to
the bad content. Other editors with similar modes for reading compiler
output should be able to use this, too.
  • Loading branch information
dhellmann committed Feb 16, 2014
1 parent 9dcdb28 commit c815182
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions sphinxcontrib/spelling/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@ def write_doc(self, docname, doctree):

# Check the text of the node.
for word, suggestions in self.checker.check(node.astext()):
msg_parts = [docname]
msg_parts = [docname + '.rst']
if lineno:
msg_parts.append(darkgreen('(line %3d)' % lineno))
msg_parts.append(darkgreen(str(lineno)))
msg_parts.append(red(word))
msg_parts.append(self.format_suggestions(suggestions))
msg = ' '.join(msg_parts)
msg = ':'.join(msg_parts)
self.info(msg)
self.output.write(u"%s:%s: (%s) %s\n" % (
self.env.doc2path(docname, None),
Expand Down

0 comments on commit c815182

Please sign in to comment.