Tuesday, January 8, 2008

XEmacs on Cygwin freezes when WinXP screen-saver comes on

I've seen this happen one time too many now, and it becomes really tiresome.

1. start xwin (xwinstart.bat)
2. edit file you want to work on in emacs
3. work on file for a while and then leave computer unattended
4. resume after screen saver
5. notice unresponsive emacs (window doesn't paint, but will minimize and maximize without redrawing)

workaround:
1. kill emacs and start over

NOTE: this has started happening often enough that i've actually created a script to kill apps

#!/usr/bin/bash
# author: hypothetical-twenty-five
# created: 2007-12-24

usage()
{
cat<<EOF
Usage:

killapp <prog>

e.g. killapp emacs

NOTE: every instance of the program, if found, will be terminated
EOF

}

if [ $# -ne 1 ]; then
# echo exiting
usage;
exit;
fi

PID=$(ps -ef | grep $1 | awk '{ print $2 }')
if [ "x$PID" == "x" ]; then
echo "application [ $1 ] not found "
else
echo "killing pids [ $PID ]";
kill -s 9 $PID
fi

No comments: