# HG changeset patch # User Oleksandr Gavenko # Date 1319410067 -10800 # Node ID f7ce19afa6667b633544f8c67dfaa2510130b89e # Parent 81e7f065031cd1124798bdcc1db0b0e1e33787fd Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin. 'gnutls-cli' run with '-s' opt and process wait for SIGALRM. But build-in native Emacs 'kill' command can not send such Cygwin specific sygnal. So 'starttls-negotiate-gnutls' function infinitely wait for 'gnutls-cli' output. diff -r 81e7f065031c -r f7ce19afa666 .emacs-my --- a/.emacs-my Sun Oct 23 22:48:06 2011 +0300 +++ b/.emacs-my Mon Oct 24 01:47:47 2011 +0300 @@ -312,6 +312,23 @@ (modify-coding-system-alist 'process "bash" '(cp1251-unix . cp1251-unix)) ) +(when (eq window-system 'w32) + ;; Fix 'starttls.el' on native Windows Emacs with gnutls-cli from Cygwin. + ;; 'gnutls-cli' run with '-s' opt and process wait for SIGALRM. + ;; But build-in native Emacs 'kill' command can not send such Cygwin + ;; specific sygnal. So 'starttls-negotiate-gnutls' function infinitely + ;; wait for 'gnutls-cli' output. + (defadvice signal-process (around cygwin (process sigcode)) + "Use 'kill.exe' instead build-in Emacs 'kill'." + (if (eq sigcode 'SIGALRM) + (shell-command + (format "kill.exe -s SIGALRM %d" + (if (processp process) (process-id process) process))) + ad-do-it + )) + (ad-activate 'signal-process) + ) + (ansi-color-for-comint-mode-on) (setq explicit-bash-args '("-i"))