Skip to content

Instantly share code, notes, and snippets.

@ziz
Created December 23, 2011 01:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ziz/1512615 to your computer and use it in GitHub Desktop.
Save ziz/1512615 to your computer and use it in GitHub Desktop.
;;; spelling checker
;;; This lets you type ESC-s to check the spelling of the current line.
;;; If any misspellings are found, you will be told.
;;; This requires the "spell" utility on your local system.
/loaded __TFLIB__/spell.tf
/def -i spell_line = \
/setenv ARGS=$(/recall -i 1)%; \
/let _errs=$(/quote -S -decho !echo $$ARGS | aspell list)%; \
/if ( _errs !~ "" ) \
/echo MISSPELLINGS: %_errs%; \
/setenv ARGS=$(/echo %_errs)%; \
/quote -S -decho !echo $$ARGS | aspell list | aspell pipe | grep '^&' | cut -d',' -f-4%; \
/else \
/echo No misspellings found.%; \
/endif%; \
/@test _errs =~ ""
/def -ib^[s = /spell_line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment