- Browse output of
f
in one window (word list). - Have a Terminal ready for commits (edit stream).
- Have a window for getting spelling corrections (Browser URL bar)
- Start with the word list.
- Copy a token (
acecss
). - Switch to edit stream terminal.
g
(paste)acecss
↵rs acecss
(including a trailing space).- Switch to web browser (focussing URL Bar or a text editor).
- (paste)
acecss
- Get suggested corrected spelling (e.g. down arrow).
- Copy
- Switch back to edit stream terminal.
- Paste:
rs acecss access
↵ - Switch back to tokenlist window and repeat process.
I tend to do:
hg clone [email protected]:jsoref/spelling.git
# get a repository to work on
cd spelling
hg bookmark ignore
# exclude content that shouldn't be spellchecked
hg rm vendor ...
# upstream content
hgrmjunk
# various file types including pictures
hgfilesample
hg rm `hg locate '*.dmg'` ...
# binary content
hg commit -m ignore
hg bookmark spelling
# mark our work
f > ../spelling.txt
# build token list
less ../spelling.txt &
# start looking at the list
ge absolut # because `g absolut` would find `absolute`
# look for a whole misspelled word
rs 'absolut ' 'absolute ' absolute
# correct it
g Actualy
# look for substring
rs Actualy Actually
# correct it
g addess
# look for substring
rs addess address
rs Addess Address
rs ADDESS ADDRESS
# correct each variant
EDITOR=hesort hg histedit ignore
# collapse the fixes
...
# JavaScirpt
g Scirpt
rs Scirpt Script
# JaveScript
g Jave
rs Jave Java
g Javascript
r s/Javascript/JavaScript/g $(g Javascript -l)
b JavaScript
# tag branding fix differently (it will sort elsewhere)
...
ge thi
r 's/thi s/this /g' $(ge thi|gl)
d
# verify the change didn't mess something else up
s this
# commit
...
hg rebase -r 'spelling % ignore' -d master
# exclude the ignore commit(s) and return to master
If you're reviewing patches:
fchurn repository
patch -d repository -p1 < proposed-commit
fchurn repository
If you're trying to catch typos before you commit:
fchurn repository
pushd repository
# make changes
...
popd
fchurn repository