chiark / gitweb /
el/dot-emacs.el: Apply `extend' setting to all(?) the applicable fonts.
[profile] / bin / fix-local-words
1 #! /bin/sh -e
2
3 comment="%%" bad=nil
4 while getopts "c:" o; do
5   case $o in
6     c) comment=$OPTARG ;;
7     *) bad=t ;;
8   esac
9 done
10 shift $(( $OPTIND - 1 ))
11 case $bad in t) echo >&2 "usage: $0 [-c COMMENT] [FILE ...]"; exit 2 ;; esac
12
13 sed 's/^.*LocalWords: *//' "$@" |
14   tr ' ' '\n' | sort -fu | tr '\n' ' ' |
15   fold -s -w60 |
16   sed "s/^/$comment LocalWords: /; s/[[:space:]]*\$//"
17 echo