From dce94416ac2aa7c82cabb4f8dcde9fd578b3da6b Mon Sep 17 00:00:00 2001 From: moculus Date: Tue, 10 Jun 2008 18:29:19 +0000 Subject: [PATCH] updated cancel --HG-- branch : pmacs2 --- mode/__init__.py | 5 +++-- mode/consolemini.py | 2 +- mode/hex.py | 2 +- mode/insertmini.py | 2 +- mode/iperlmini.py | 2 +- mode/ipythonmini.py | 2 +- mode/replace.py | 2 +- mode/search.py | 2 +- 8 files changed, 10 insertions(+), 9 deletions(-) diff --git a/mode/__init__.py b/mode/__init__.py index 067ac80..0c56993 100644 --- a/mode/__init__.py +++ b/mode/__init__.py @@ -198,7 +198,7 @@ class Fundamental(Handler): self.add_bindings('which-command', ('M-h',)) self.add_bindings('cmd-help-buffer', ('M-?',)) self.add_bindings('set-mode', ('C-x m',)) - self.add_bindings('cancel', ('C-]',)) + self.add_bindings('cancel', ('C-]', 'C-g',)) self.add_bindings('exec', ('C-c e', 'C-c !')) self.add_bindings('grep', ('C-c g',)) self.add_bindings('pipe', ('C-c p', 'C-c |')) @@ -311,7 +311,8 @@ class Fundamental(Handler): act.execute(self.window) self.window.application.last_action = act.name except ActionError, e: - if t != 'C-]': + #XYZ: HACK--should fix + if t not in ('C-]', 'C-g'): self.window.set_error(str(e)) else: self.window.set_error('Cancelled') diff --git a/mode/consolemini.py b/mode/consolemini.py index 1226601..ad289a8 100644 --- a/mode/consolemini.py +++ b/mode/consolemini.py @@ -233,7 +233,7 @@ class ConsoleMini(mode.Fundamental): self.hindex = 0 self.add_bindings('console-exec', ('RETURN',)) self.add_bindings('console-clear', ('C-l',)) - self.add_bindings('console-cancel', ('C-]',)) + self.add_bindings('console-cancel', ('C-]', 'C-g')) self.add_bindings('console-history-prev', ('C-p', 'UP')) self.add_bindings('console-history-next', ('C-n', 'DOWN')) self.add_bindings('console-tab', ('TAB',)) diff --git a/mode/hex.py b/mode/hex.py index 35b7dda..293f7f8 100644 --- a/mode/hex.py +++ b/mode/hex.py @@ -260,7 +260,7 @@ class Hex(mode.Fundamental): self.add_bindings('which-command', ('M-h',)) self.add_bindings('cmd-help-buffer', ('M-?',)) self.add_bindings('set-mode', ('C-x m',)) - self.add_bindings('cancel', ('C-]',)) + self.add_bindings('cancel', ('C-]', 'C-g')) self.add_bindings('exec', ('C-c e', 'C-c !')) self.add_bindings('grep', ('C-c g',)) self.add_bindings('pipe', ('C-c p', 'C-c |')) diff --git a/mode/insertmini.py b/mode/insertmini.py index c89a275..783aa67 100644 --- a/mode/insertmini.py +++ b/mode/insertmini.py @@ -65,7 +65,7 @@ class InsertMini(mode.Fundamental): self.add_bindings('insert-tab', ('TAB',)) self.add_bindings('mini-insert-line', ('RETURN',)) self.add_bindings('mini-insert-complete', ('M-RETURN',)) - self.add_bindings('mini-insert-cancel', ('C-]',)) + self.add_bindings('mini-insert-cancel', ('C-]', 'C-g')) self.add_bindings('mini-insert-tab', ('TAB',)) for c in string.letters + string.digits + string.punctuation: self.add_binding('insert-string-%s' % c, c) diff --git a/mode/iperlmini.py b/mode/iperlmini.py index ed8d432..2425fbc 100644 --- a/mode/iperlmini.py +++ b/mode/iperlmini.py @@ -131,7 +131,7 @@ class IperlMini(mode.Fundamental): w.application.set_mini_buffer_prompt(b.prompt) self.add_bindings('iperl-exec', ('RETURN',)) self.add_bindings('console-clear', ('C-l',)) - self.add_bindings('console-cancel', ('C-]',)) + self.add_bindings('console-cancel', ('C-]', 'C-g')) self.add_bindings('console-history-prev', ('C-p', 'UP')) self.add_bindings('console-history-next', ('C-n', 'DOWN')) self.add_bindings('iperl-tab', ('TAB',)) diff --git a/mode/ipythonmini.py b/mode/ipythonmini.py index 512da97..fcb97b5 100644 --- a/mode/ipythonmini.py +++ b/mode/ipythonmini.py @@ -106,7 +106,7 @@ class IpythonMini(mode.Fundamental): self.window.application.set_mini_buffer_prompt(b.prompt) self.add_bindings('ipython-exec', ('RETURN',)) self.add_bindings('console-clear', ('C-l',)) - self.add_bindings('console-cancel', ('C-]',)) + self.add_bindings('console-cancel', ('C-]', 'C-g')) self.add_bindings('console-history-prev', ('C-p', 'UP')) self.add_bindings('console-history-next', ('C-n', 'DOWN')) self.add_bindings('ipython-tab', ('TAB',)) diff --git a/mode/replace.py b/mode/replace.py index 424e10d..4c6318b 100644 --- a/mode/replace.py +++ b/mode/replace.py @@ -134,7 +134,7 @@ class Replace(mode.Fundamental): self.add_bindings('replace-done', ('d',)) self.add_bindings('replace-one', ('y', 'SPACE',)) self.add_bindings('skip-replace', ('n', 'DELETE',)) - self.add_bindings('cancel-replace', ('q', 'RETURN', 'C-]', 'C-n', 'C-p', 'C-a', 'C-e', 'C-f', 'C-b')) + self.add_bindings('cancel-replace', ('q', 'RETURN', 'C-]', 'C-n', 'C-p', 'C-a', 'C-e', 'C-f', 'C-b', 'C-g')) m = w.buffer.method found = _find_next(m, False) diff --git a/mode/search.py b/mode/search.py index 7731328..670c792 100644 --- a/mode/search.py +++ b/mode/search.py @@ -128,7 +128,7 @@ class Search(mode.Fundamental): self.add_bindings('search-next', ('C-s',)) self.add_bindings('search-previous', ('C-r',)) self.add_bindings('end-search', ('RETURN', 'C-n', 'C-p', 'C-a', 'C-e', 'C-f', 'C-b',)) - self.add_bindings('cancel-search', ('C-]',)) + self.add_bindings('cancel-search', ('C-]', 'C-g',)) self.add_bindings('search-delete-left', ('DELETE', 'BACKSPACE',)) self.add_bindings('search-delete-left-word', ('M-DELETE', 'M-BACKSPACE',))