Index: Lib/idlelib/Bindings.py =================================================================== --- Lib/idlelib/Bindings.py (revision 46642) +++ Lib/idlelib/Bindings.py (working copy) @@ -80,6 +80,32 @@ ]), ] +import sys +if sys.platform == 'darwin' and '.app' in sys.executable: + # Running as a proper MacOS application bundle. This block restructures + # the menus a little to make them conform better to the HIG. + + quitItem = menudefs[0][1][-1] + closeItem = menudefs[0][1][-2] + + # Remove the last 3 items of the file menu: a separator, close window and + # quit. Close window will be reinserted just above the save item, where + # it should be according to the HIG. Quit is in the application menu. + del menudefs[0][1][-3:] + menudefs[0][1].insert(6, closeItem) + + # Remove the 'About' entry from the help menu, it is in the application + # menu + del menudefs[-1][1][0:2] + + menudefs.insert(0, + ('application', [ + ('About IDLE', '<>'), + None, + ('_Preferences....', '<>'), + ])) + + default_keydefs = idleConf.GetCurrentKeySet() del sys Index: Lib/idlelib/configHandler.py =================================================================== --- Lib/idlelib/configHandler.py (revision 46642) +++ Lib/idlelib/configHandler.py (working copy) @@ -495,8 +495,19 @@ return binding def GetCurrentKeySet(self): - return self.GetKeySet(self.CurrentKeys()) + result = self.GetKeySet(self.CurrentKeys()) + if sys.platform == 'darwin' and 'IDLE.app' in sys.argv[0]: + # We're using AquaTk, replace all keybingings that use the + # Alt key by ones that use the Option key because the former + # don't work reliably. + for k, v in result.items(): + v2 = [ x.replace('