Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 344181

Summary: [Compatibility] Not all emacs keybindings override default keybindings
Product: [Eclipse Project] Platform Reporter: Paul Webster <pwebster>
Component: UIAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: daniel_megert, jessev, ob1.eclipse, pwebster, remy.suen, steffen.pingel, vainolo
Version: 4.1Flags: ob1.eclipse: review+
Target Milestone: 4.2 M7   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Work in progress: key overrides when switching schemes
none
Work out scheme overrides v02 none

Description Paul Webster CLA 2011-04-28 14:55:02 EDT
Some emacs keybindings, like CTRL+Y, currently don't do anything (they are treated like a conflict, when really they should override the default scheme version).

See org.eclipse.e4.ui.keybinding.tests.BindingPersistenceTest.testPasteBindingEmacs()

PW
Comment 1 Jesse CLA 2011-04-29 17:07:30 EDT
Created attachment 194412 [details]
Work in progress: key overrides when switching schemes

WORK IN PROGRESS:

This will do a check to make sure that if there's a conflict between two bindings of difference schemes, then the binding with the "youngest" scheme will override the other. 

There's still that issue with BindingService.getPerfectMatch(Binding) where it won't find bindings with certain contexts, so only 1/4 conflicts get overridden when switching to emacs (CTRL+Y).

Also, when switching back to the default scheme, the previously overridden bindings won't become re-enabled for some reason. I'm not too sure why this is right now, but if you got re-open the prefs page again, you can restore it or reset defaults and it will become active again.

Anyway, hopefully this is a good starting point. 

- Jesse
Comment 2 Dani Megert CLA 2011-05-03 02:40:25 EDT
This also means that the key binding hints in the menus are wrong sometimes: e.g. Ctrl+F is indicated for Edit > Find/Replace... but it doesn't work.
Comment 3 Paul Webster CLA 2011-05-13 14:03:07 EDT
Created attachment 195613 [details]
Work out scheme overrides v02

When saving pref page changes, pick the most correct binding based on scheme and type (system vs user) so there's no conflict.

PW
Comment 4 Paul Webster CLA 2011-05-13 14:04:05 EDT
Released
PW
Comment 5 Dani Megert CLA 2011-05-16 10:02:55 EDT
Tried on 4.1 build: I20110515-0800: it still shows 'Ctrl+F' for Edit > Find/Replace after switching to 'Emacs' scheme.
Comment 6 Eric Moffatt CLA 2011-09-15 12:52:52 EDT
M2 is done...
Comment 7 Eric Moffatt CLA 2011-12-09 13:10:12 EST
Aggregate move to M5. Retarget to a different milestone if you wish...
Comment 8 Steffen Pingel CLA 2012-03-19 13:08:02 EDT
I'm still having trouble with the binding Alt+W to Copy. On e4 (I20120315-1300) this activates the Windows menu item from the global menu bar instead of pasting text. On 3.x the mnemonic for the Window menu item is automatically unbound.
Comment 9 Paul Webster CLA 2012-04-13 16:29:27 EDT
Start with org.eclipse.e4.ui.keybinding.tests.BindingPersistenceTest.testPasteAndRedoBindingEmacs() to figure out why we get no CTRL+Y binding in the emacs config.

PW
Comment 10 Paul Webster CLA 2012-04-17 15:08:16 EDT
(In reply to comment #9)
> Start with
> org.eclipse.e4.ui.keybinding.tests.BindingPersistenceTest.testPasteAndRedoBindingEmacs()
> to figure out why we get no CTRL+Y binding in the emacs config.

OK, figured that out.  It works correctly on windows, linux has a delete marker for CTRL+Y

PW
Comment 11 Paul Webster CLA 2012-05-04 10:31:49 EDT
(In reply to comment #8)
> I'm still having trouble with the binding Alt+W to Copy. On e4 (I20120315-1300)
> this activates the Windows menu item from the global menu bar instead of
> pasting text. On 3.x the mnemonic for the Window menu item is automatically
> unbound.

pwebster/bug344181 contains a fix for this usecase.

PW
Comment 12 Paul Webster CLA 2012-05-07 06:30:50 EDT
Oleg, I need a +1 for this bug.

(In reply to comment #1)
> Also, when switching back to the default scheme, the previously overridden
> bindings won't become re-enabled for some reason. I'm not too sure why this is
> right now, but if you got re-open the prefs page again, you can restore it or
> reset defaults and it will become active again.

I'm working on this in bug 375762

PW
Comment 13 Oleg Besedin CLA 2012-05-07 11:26:16 EDT
(In reply to comment #12)
> Oleg, I need a +1 for this bug.

Sure.
Comment 14 Dani Megert CLA 2012-05-08 10:43:44 EDT
It still shows 'Ctrl+F' for Edit > Find/Replace after switching to 'Emacs' scheme, using 4.2 M7, and nothing happens when pressing Ctrl+F.
Comment 15 Paul Webster CLA 2012-05-08 10:52:15 EDT
I'm continuing my work on those bindings in bug 375762


PW