Reformatted excerpts from Steve Goldman's message of 2008-11-19:
> This isn't as dumb of a question as it sounds.  Sometimes I'm in a sup
> buffer but mistakenly think I'm in emacs.

The illusion is complete!

> Then I type Ctrl-X/Ctrl-C and sup crashes.  This is not cool.

Ctrl-C is the traditional unix forced-exit mechanism, but perhaps we
could emulate mutt and have it prompt you before quitting. (And in
contrast to regular quit, it shouldn't save state back to the index.)

> /apps/home/sgoldman/sup-src/mainline/lib/sup/buffer.rb:31:in `select'
> /apps/home/sgoldman/sup-src/mainline/lib/sup/buffer.rb:31:in 
> `nonblocking_getch'
> bin/sup:184
> 
> I tested just typing Ctrl-C and got the same log output.  Any idea on how to
> make sup not crash on Ctrl-C?

bin/sup already wraps everything in a rescue Exception, so you just need
to check within the rescue block whether it's a ctrl-c exception or not.
Something like:

  rescue Exception => e
    exit 1 if e.is_a?(Interrupt) && BufferManager.ask_yes_or_no("Die now?")
  end
-- 
William <[EMAIL PROTECTED]>
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to