close last buffer bug

--HG--
branch : pmacs2
This commit is contained in:
moculus 2009-03-26 01:21:13 +00:00
parent 35f9a6601b
commit 9adcf939e9
2 changed files with 6 additions and 4 deletions

View File

@ -57,8 +57,11 @@ class KillBuffer(Method):
dv=default.current_buffer, h="name of the buffer to kill")]
def _execute(self, w, **vargs):
name = vargs['buffername']
a = w.application
assert name in a.bufferlist.buffer_names, "Buffer %r does not exist" % name
a = w.application
if name not in a.bufferlist.buffer_names:
raise Exception("Buffer %r does not exist" % name)
elif len(a.bufferlist.buffers) == 1:
raise Exception("Can't close only open buffer")
self._to_kill = a.bufferlist.buffer_names[name]
self._old_window = w
if self.force or not self._to_kill.changed():

View File

@ -461,8 +461,7 @@ class Fundamental(Handler):
if DEBUG:
raise
else:
err = "%s in mode '%s'" % (e, self.name)
self.window.set_error(err)
self.window.set_error(str(e))
def region_added(self, p, newlines):
mname = self.name