Ticket #2637: mc-4.8.0-fasterStartup.diff

File mc-4.8.0-fasterStartup.diff, 22.0 KB (added by 0xe2.0x9a.0x9b, 13 years ago)
  • lib/keybind.c

    diff -Naur mc-4.8.0/lib/keybind.c mc-4.8.0-fasterStartup/lib/keybind.c
    old new  
    4747 
    4848static name_keymap_t command_names[] = { 
    4949    /* common */ 
    50     {"Enter", CK_Enter}, 
    51     {"Up", CK_Up}, 
    52     {"Down", CK_Down}, 
    53     {"Left", CK_Left}, 
    54     {"Right", CK_Right}, 
    55     {"LeftQuick", CK_LeftQuick}, 
    56     {"RightQuick", CK_RightQuick}, 
    57     {"Home", CK_Home}, 
    58     {"End", CK_End}, 
    59     {"PageUp", CK_PageUp}, 
    60     {"PageDown", CK_PageDown}, 
    61     {"HalfPageUp", CK_HalfPageUp}, 
    62     {"HalfPageDown", CK_HalfPageDown}, 
    63     {"Top", CK_Top}, 
    64     {"Bottom", CK_Bottom}, 
    65     {"TopOnScreen", CK_TopOnScreen}, 
    66     {"MiddleOnScreen", CK_MiddleOnScreen}, 
    67     {"BottomOnScreen", CK_BottomOnScreen}, 
    68     {"WordLeft", CK_WordLeft}, 
    69     {"WordRight", CK_WordRight}, 
    70     {"Copy", CK_Copy}, 
    71     {"Move", CK_Move}, 
    72     {"Delete", CK_Delete}, 
    73     {"MakeDir", CK_MakeDir}, 
    74     {"ChangeMode", CK_ChangeMode}, 
    75     {"ChangeOwn", CK_ChangeOwn}, 
    76     {"ChangeOwnAdvanced", CK_ChangeOwnAdvanced}, 
    77     {"Remove", CK_Remove}, 
    78     {"BackSpace", CK_BackSpace}, 
    79     {"Undo", CK_Undo}, 
    80     {"Redo", CK_Redo}, 
    81     {"Clear", CK_Clear}, 
    82     {"Menu", CK_Menu}, 
    83     {"MenuLastSelected", CK_MenuLastSelected}, 
    84     {"UserMenu", CK_UserMenu}, 
    85     {"EditUserMenu", CK_EditUserMenu}, 
    86     {"Search", CK_Search}, 
    87     {"SearchContinue", CK_SearchContinue}, 
    88     {"Replace", CK_Replace}, 
    89     {"ReplaceContinue", CK_ReplaceContinue}, 
    90     {"Help", CK_Help}, 
    91     {"Shell", CK_Shell}, 
    92     {"Edit", CK_Edit}, 
    93     {"EditNew", CK_EditNew}, 
     50    {"Enter", NULL, CK_Enter}, 
     51    {"Up", NULL, CK_Up}, 
     52    {"Down", NULL, CK_Down}, 
     53    {"Left", NULL, CK_Left}, 
     54    {"Right", NULL, CK_Right}, 
     55    {"LeftQuick", NULL, CK_LeftQuick}, 
     56    {"RightQuick", NULL, CK_RightQuick}, 
     57    {"Home", NULL, CK_Home}, 
     58    {"End", NULL, CK_End}, 
     59    {"PageUp", NULL, CK_PageUp}, 
     60    {"PageDown", NULL, CK_PageDown}, 
     61    {"HalfPageUp", NULL, CK_HalfPageUp}, 
     62    {"HalfPageDown", NULL, CK_HalfPageDown}, 
     63    {"Top", NULL, CK_Top}, 
     64    {"Bottom", NULL, CK_Bottom}, 
     65    {"TopOnScreen", NULL, CK_TopOnScreen}, 
     66    {"MiddleOnScreen", NULL, CK_MiddleOnScreen}, 
     67    {"BottomOnScreen", NULL, CK_BottomOnScreen}, 
     68    {"WordLeft", NULL, CK_WordLeft}, 
     69    {"WordRight", NULL, CK_WordRight}, 
     70    {"Copy", NULL, CK_Copy}, 
     71    {"Move", NULL, CK_Move}, 
     72    {"Delete", NULL, CK_Delete}, 
     73    {"MakeDir", NULL, CK_MakeDir}, 
     74    {"ChangeMode", NULL, CK_ChangeMode}, 
     75    {"ChangeOwn", NULL, CK_ChangeOwn}, 
     76    {"ChangeOwnAdvanced", NULL, CK_ChangeOwnAdvanced}, 
     77    {"Remove", NULL, CK_Remove}, 
     78    {"BackSpace", NULL, CK_BackSpace}, 
     79    {"Undo", NULL, CK_Undo}, 
     80    {"Redo", NULL, CK_Redo}, 
     81    {"Clear", NULL, CK_Clear}, 
     82    {"Menu", NULL, CK_Menu}, 
     83    {"MenuLastSelected", NULL, CK_MenuLastSelected}, 
     84    {"UserMenu", NULL, CK_UserMenu}, 
     85    {"EditUserMenu", NULL, CK_EditUserMenu}, 
     86    {"Search", NULL, CK_Search}, 
     87    {"SearchContinue", NULL, CK_SearchContinue}, 
     88    {"Replace", NULL, CK_Replace}, 
     89    {"ReplaceContinue", NULL, CK_ReplaceContinue}, 
     90    {"Help", NULL, CK_Help}, 
     91    {"Shell", NULL, CK_Shell}, 
     92    {"Edit", NULL, CK_Edit}, 
     93    {"EditNew", NULL, CK_EditNew}, 
    9494#ifdef HAVE_CHARSET 
    95     {"SelectCodepage", CK_SelectCodepage}, 
     95    {"SelectCodepage", NULL, CK_SelectCodepage}, 
    9696#endif 
    97     {"History", CK_History}, 
    98     {"HistoryNext", CK_HistoryNext}, 
    99     {"HistoryPrev", CK_HistoryPrev}, 
    100     {"Complete", CK_Complete}, 
    101     {"Save", CK_Save}, 
    102     {"SaveAs", CK_SaveAs}, 
    103     {"Goto", CK_Goto}, 
    104     {"Reread", CK_Reread}, 
    105     {"Refresh", CK_Refresh}, 
    106     {"Suspend", CK_Suspend}, 
    107     {"Swap", CK_Swap}, 
    108     {"HotList", CK_HotList}, 
    109     {"SelectInvert", CK_SelectInvert}, 
    110     {"ScreenList", CK_ScreenList}, 
    111     {"ScreenNext", CK_ScreenNext}, 
    112     {"ScreenPrev", CK_ScreenPrev}, 
    113     {"FileNext", CK_FileNext}, 
    114     {"FilePrev", CK_FilePrev}, 
    115     {"DeleteToWordBegin", CK_DeleteToWordBegin}, 
    116     {"DeleteToWordEnd", CK_DeleteToWordEnd}, 
    117     {"Cut", CK_Cut}, 
    118     {"Store", CK_Store}, 
    119     {"Paste", CK_Paste}, 
    120     {"Mark", CK_Mark}, 
    121     {"MarkLeft", CK_MarkLeft}, 
    122     {"MarkRight", CK_MarkRight}, 
    123     {"MarkUp", CK_MarkUp}, 
    124     {"MarkDown", CK_MarkDown}, 
    125     {"MarkToWordBegin", CK_MarkToWordBegin}, 
    126     {"MarkToWordEnd", CK_MarkToWordEnd}, 
    127     {"MarkToHome", CK_MarkToHome}, 
    128     {"MarkToEnd", CK_MarkToEnd}, 
    129     {"ToggleNavigation", CK_ToggleNavigation}, 
    130     {"Sort", CK_Sort}, 
    131     {"Options", CK_Options}, 
    132     {"LearnKeys", CK_LearnKeys}, 
    133     {"Bookmark", CK_Bookmark}, 
    134     {"Quit", CK_Quit}, 
    135     {"QuitQuiet", CK_QuitQuiet}, 
    136     {"ExtendedKeyMap", CK_ExtendedKeyMap}, 
     97    {"History", NULL, CK_History}, 
     98    {"HistoryNext", NULL, CK_HistoryNext}, 
     99    {"HistoryPrev", NULL, CK_HistoryPrev}, 
     100    {"Complete", NULL, CK_Complete}, 
     101    {"Save", NULL, CK_Save}, 
     102    {"SaveAs", NULL, CK_SaveAs}, 
     103    {"Goto", NULL, CK_Goto}, 
     104    {"Reread", NULL, CK_Reread}, 
     105    {"Refresh", NULL, CK_Refresh}, 
     106    {"Suspend", NULL, CK_Suspend}, 
     107    {"Swap", NULL, CK_Swap}, 
     108    {"HotList", NULL, CK_HotList}, 
     109    {"SelectInvert", NULL, CK_SelectInvert}, 
     110    {"ScreenList", NULL, CK_ScreenList}, 
     111    {"ScreenNext", NULL, CK_ScreenNext}, 
     112    {"ScreenPrev", NULL, CK_ScreenPrev}, 
     113    {"FileNext", NULL, CK_FileNext}, 
     114    {"FilePrev", NULL, CK_FilePrev}, 
     115    {"DeleteToWordBegin", NULL, CK_DeleteToWordBegin}, 
     116    {"DeleteToWordEnd", NULL, CK_DeleteToWordEnd}, 
     117    {"Cut", NULL, CK_Cut}, 
     118    {"Store", NULL, CK_Store}, 
     119    {"Paste", NULL, CK_Paste}, 
     120    {"Mark", NULL, CK_Mark}, 
     121    {"MarkLeft", NULL, CK_MarkLeft}, 
     122    {"MarkRight", NULL, CK_MarkRight}, 
     123    {"MarkUp", NULL, CK_MarkUp}, 
     124    {"MarkDown", NULL, CK_MarkDown}, 
     125    {"MarkToWordBegin", NULL, CK_MarkToWordBegin}, 
     126    {"MarkToWordEnd", NULL, CK_MarkToWordEnd}, 
     127    {"MarkToHome", NULL, CK_MarkToHome}, 
     128    {"MarkToEnd", NULL, CK_MarkToEnd}, 
     129    {"ToggleNavigation", NULL, CK_ToggleNavigation}, 
     130    {"Sort", NULL, CK_Sort}, 
     131    {"Options", NULL, CK_Options}, 
     132    {"LearnKeys", NULL, CK_LearnKeys}, 
     133    {"Bookmark", NULL, CK_Bookmark}, 
     134    {"Quit", NULL, CK_Quit}, 
     135    {"QuitQuiet", NULL, CK_QuitQuiet}, 
     136    {"ExtendedKeyMap", NULL, CK_ExtendedKeyMap}, 
    137137 
    138138    /* main commands */ 
    139139#ifdef USE_INTERNAL_EDIT 
    140     {"EditForceInternal", CK_EditForceInternal}, 
     140    {"EditForceInternal", NULL, CK_EditForceInternal}, 
    141141#endif 
    142     {"View", CK_View}, 
    143     {"ViewRaw", CK_ViewRaw}, 
    144     {"ViewFile", CK_ViewFile}, 
    145     {"ViewFiltered", CK_ViewFiltered}, 
    146     {"Find", CK_Find}, 
    147     {"DirSize", CK_DirSize}, 
    148     {"PanelListingSwitch", CK_PanelListingSwitch}, 
    149     {"CompareDirs", CK_CompareDirs}, 
     142    {"View", NULL, CK_View}, 
     143    {"ViewRaw", NULL, CK_ViewRaw}, 
     144    {"ViewFile", NULL, CK_ViewFile}, 
     145    {"ViewFiltered", NULL, CK_ViewFiltered}, 
     146    {"Find", NULL, CK_Find}, 
     147    {"DirSize", NULL, CK_DirSize}, 
     148    {"PanelListingSwitch", NULL, CK_PanelListingSwitch}, 
     149    {"CompareDirs", NULL, CK_CompareDirs}, 
    150150#ifdef USE_DIFF_VIEW 
    151     {"CompareFiles", CK_CompareFiles}, 
     151    {"CompareFiles", NULL, CK_CompareFiles}, 
    152152#endif 
    153     {"OptionsVfs", CK_OptionsVfs}, 
    154     {"OptionsConfirm", CK_OptionsConfirm}, 
    155     {"OptionsDisplayBits", CK_OptionsDisplayBits}, 
    156     {"EditExtensionsFile", CK_EditExtensionsFile}, 
    157     {"EditFileHighlightFile", CK_EditFileHighlightFile}, 
    158     {"LinkSymbolicEdit", CK_LinkSymbolicEdit}, 
    159     {"ExternalPanelize", CK_ExternalPanelize}, 
    160     {"Filter", CK_Filter}, 
     153    {"OptionsVfs", NULL, CK_OptionsVfs}, 
     154    {"OptionsConfirm", NULL, CK_OptionsConfirm}, 
     155    {"OptionsDisplayBits", NULL, CK_OptionsDisplayBits}, 
     156    {"EditExtensionsFile", NULL, CK_EditExtensionsFile}, 
     157    {"EditFileHighlightFile", NULL, CK_EditFileHighlightFile}, 
     158    {"LinkSymbolicEdit", NULL, CK_LinkSymbolicEdit}, 
     159    {"ExternalPanelize", NULL, CK_ExternalPanelize}, 
     160    {"Filter", NULL, CK_Filter}, 
    161161#ifdef ENABLE_VFS_FISH 
    162     {"ConnectFish", CK_ConnectFish}, 
     162    {"ConnectFish", NULL, CK_ConnectFish}, 
    163163#endif 
    164164#ifdef ENABLE_VFS_FTP 
    165     {"ConnectFtp", CK_ConnectFtp}, 
     165    {"ConnectFtp", NULL, CK_ConnectFtp}, 
    166166#endif 
    167167#ifdef ENABLE_VFS_SMB 
    168     {"ConnectSmb", CK_ConnectSmb}, 
     168    {"ConnectSmb", NULL, CK_ConnectSmb}, 
    169169#endif 
    170     {"PanelInfo", CK_PanelInfo}, 
     170    {"PanelInfo", NULL, CK_PanelInfo}, 
    171171#ifdef WITH_BACKGROUND 
    172     {"Jobs", CK_Jobs}, 
     172    {"Jobs", NULL, CK_Jobs}, 
    173173#endif 
    174     {"OptionsLayout", CK_OptionsLayout}, 
    175     {"Link", CK_Link}, 
    176     {"PanelListingChange", CK_PanelListingChange}, 
    177     {"PanelListing", CK_PanelListing}, 
     174    {"OptionsLayout", NULL, CK_OptionsLayout}, 
     175    {"Link", NULL, CK_Link}, 
     176    {"PanelListingChange", NULL, CK_PanelListingChange}, 
     177    {"PanelListing", NULL, CK_PanelListing}, 
    178178#ifdef LISTMODE_EDITOR 
    179     {"ListMode", CK_ListMode}. 
     179    {"ListMode", NULL, CK_ListMode}. 
    180180#endif 
    181     {"OptionsPanel", CK_OptionsPanel}, 
    182     {"CdQuick", CK_CdQuick}, 
    183     {"PanelQuickView", CK_PanelQuickView}, 
    184     {"LinkSymbolicRelative", CK_LinkSymbolicRelative}, 
    185     {"VfsList", CK_VfsList}, 
    186     {"SaveSetup", CK_SaveSetup}, 
    187     {"LinkSymbolic", CK_LinkSymbolic}, 
    188     {"PanelTree", CK_PanelTree}, 
    189     {"Tree", CK_Tree}, 
     181    {"OptionsPanel", NULL, CK_OptionsPanel}, 
     182    {"CdQuick", NULL, CK_CdQuick}, 
     183    {"PanelQuickView", NULL, CK_PanelQuickView}, 
     184    {"LinkSymbolicRelative", NULL, CK_LinkSymbolicRelative}, 
     185    {"VfsList", NULL, CK_VfsList}, 
     186    {"SaveSetup", NULL, CK_SaveSetup}, 
     187    {"LinkSymbolic", NULL, CK_LinkSymbolic}, 
     188    {"PanelTree", NULL, CK_PanelTree}, 
     189    {"Tree", NULL, CK_Tree}, 
    190190#ifdef ENABLE_VFS_UNDELFS 
    191     {"Undelete", CK_Undelete}, 
     191    {"Undelete", NULL, CK_Undelete}, 
    192192#endif 
    193     {"PutCurrentLink", CK_PutCurrentLink}, 
    194     {"PutOtherLink", CK_PutOtherLink}, 
    195     {"HotListAdd", CK_HotListAdd}, 
    196     {"ShowHidden", CK_ShowHidden}, 
    197     {"SplitVertHoriz", CK_SplitVertHoriz}, 
    198     {"PutCurrentPath", CK_PutCurrentPath}, 
    199     {"PutOtherPath", CK_PutOtherPath}, 
    200     {"PutCurrentTagged", CK_PutCurrentTagged}, 
    201     {"PutOtherTagged", CK_PutOtherTagged}, 
    202     {"Select", CK_Select}, 
    203     {"Unselect", CK_Unselect}, 
     193    {"PutCurrentLink", NULL, CK_PutCurrentLink}, 
     194    {"PutOtherLink", NULL, CK_PutOtherLink}, 
     195    {"HotListAdd", NULL, CK_HotListAdd}, 
     196    {"ShowHidden", NULL, CK_ShowHidden}, 
     197    {"SplitVertHoriz", NULL, CK_SplitVertHoriz}, 
     198    {"PutCurrentPath", NULL, CK_PutCurrentPath}, 
     199    {"PutOtherPath", NULL, CK_PutOtherPath}, 
     200    {"PutCurrentTagged", NULL, CK_PutCurrentTagged}, 
     201    {"PutOtherTagged", NULL, CK_PutOtherTagged}, 
     202    {"Select", NULL, CK_Select}, 
     203    {"Unselect", NULL, CK_Unselect}, 
    204204 
    205205    /* panel */ 
    206     {"PanelOtherCd", CK_PanelOtherCd}, 
    207     {"PanelOtherCdLink", CK_PanelOtherCdLink}, 
    208     {"CopySingle", CK_CopySingle}, 
    209     {"MoveSingle", CK_MoveSingle}, 
    210     {"DeleteSingle", CK_DeleteSingle}, 
    211     {"CdParent", CK_CdParent}, 
    212     {"CdChild", CK_CdChild}, 
    213     {"PanelOtherSync", CK_PanelOtherSync}, 
    214     {"SortNext", CK_SortNext}, 
    215     {"SortPrev", CK_SortPrev}, 
    216     {"SortReverse", CK_SortReverse}, 
    217     {"SortByName", CK_SortByName}, 
    218     {"SortByExt", CK_SortByExt}, 
    219     {"SortBySize", CK_SortBySize}, 
    220     {"SortByMTime", CK_SortByMTime}, 
    221     {"CdParentSmart", CK_CdParentSmart}, 
     206    {"PanelOtherCd", NULL, CK_PanelOtherCd}, 
     207    {"PanelOtherCdLink", NULL, CK_PanelOtherCdLink}, 
     208    {"CopySingle", NULL, CK_CopySingle}, 
     209    {"MoveSingle", NULL, CK_MoveSingle}, 
     210    {"DeleteSingle", NULL, CK_DeleteSingle}, 
     211    {"CdParent", NULL, CK_CdParent}, 
     212    {"CdChild", NULL, CK_CdChild}, 
     213    {"PanelOtherSync", NULL, CK_PanelOtherSync}, 
     214    {"SortNext", NULL, CK_SortNext}, 
     215    {"SortPrev", NULL, CK_SortPrev}, 
     216    {"SortReverse", NULL, CK_SortReverse}, 
     217    {"SortByName", NULL, CK_SortByName}, 
     218    {"SortByExt", NULL, CK_SortByExt}, 
     219    {"SortBySize", NULL, CK_SortBySize}, 
     220    {"SortByMTime", NULL, CK_SortByMTime}, 
     221    {"CdParentSmart", NULL, CK_CdParentSmart}, 
    222222 
    223223    /* dialog */ 
    224     {"Ok", CK_Ok}, 
    225     {"Cancel", CK_Cancel}, 
     224    {"Ok", NULL, CK_Ok}, 
     225    {"Cancel", NULL, CK_Cancel}, 
    226226 
    227227    /* input line */ 
    228     {"Yank", CK_Yank}, 
     228    {"Yank", NULL, CK_Yank}, 
    229229 
    230230    /* help */ 
    231     {"Index", CK_Index}, 
    232     {"Back", CK_Back}, 
    233     {"LinkNext", CK_LinkNext}, 
    234     {"LinkPrev", CK_LinkPrev}, 
    235     {"NodeNext", CK_NodeNext}, 
    236     {"NodePrev", CK_NodePrev}, 
     231    {"Index", NULL, CK_Index}, 
     232    {"Back", NULL, CK_Back}, 
     233    {"LinkNext", NULL, CK_LinkNext}, 
     234    {"LinkPrev", NULL, CK_LinkPrev}, 
     235    {"NodeNext", NULL, CK_NodeNext}, 
     236    {"NodePrev", NULL, CK_NodePrev}, 
    237237 
    238238    /* tree */ 
    239     {"Forget", CK_Forget}, 
     239    {"Forget", NULL, CK_Forget}, 
    240240 
    241241#if defined (USE_INTERNAL_EDIT) || defined (USE_DIFF_VIEW) 
    242     {"ShowNumbers", CK_ShowNumbers}, 
     242    {"ShowNumbers", NULL, CK_ShowNumbers}, 
    243243#endif 
    244244 
    245245#ifdef USE_INTERNAL_EDIT 
    246     {"Tab", CK_Tab}, 
    247     {"ScrollUp", CK_ScrollUp}, 
    248     {"ScrollDown", CK_ScrollDown}, 
    249     {"Return", CK_Return}, 
    250     {"ParagraphUp", CK_ParagraphUp}, 
    251     {"ParagraphDown", CK_ParagraphDown}, 
    252     {"EditFile", CK_EditFile}, 
    253     {"MarkWord", CK_MarkWord}, 
    254     {"MarkLine", CK_MarkLine}, 
    255     {"MarkAll", CK_MarkAll}, 
    256     {"Unmark", CK_Unmark}, 
    257     {"MarkColumn", CK_MarkColumn}, 
    258     {"BlockSave", CK_BlockSave}, 
    259     {"InsertFile", CK_InsertFile}, 
    260     {"InsertOverwrite", CK_InsertOverwrite}, 
    261     {"Date", CK_Date}, 
    262     {"DeleteLine", CK_DeleteLine}, 
    263     {"DeleteToHome", CK_DeleteToHome}, 
    264     {"DeleteToEnd", CK_DeleteToEnd}, 
    265     {"EditMail", CK_Mail}, 
    266     {"ParagraphFormat", CK_ParagraphFormat}, 
    267     {"MatchBracket", CK_MatchBracket}, 
    268     {"ExternalCommand", CK_ExternalCommand}, 
    269     {"MacroStartRecord", CK_MacroStartRecord}, 
    270     {"MacroStopRecord", CK_MacroStopRecord}, 
    271     {"MacroStartStopRecord", CK_MacroStartStopRecord}, 
    272     {"MacroDelete", CK_MacroDelete}, 
    273     {"RepeatStartStopRecord", CK_RepeatStartStopRecord}, 
    274     {"BookmarkFlush", CK_BookmarkFlush}, 
    275     {"BookmarkNext", CK_BookmarkNext}, 
    276     {"BookmarkPrev", CK_BookmarkPrev}, 
    277     {"MarkPageUp", CK_MarkPageUp}, 
    278     {"MarkPageDown", CK_MarkPageDown}, 
    279     {"MarkToFileBegin", CK_MarkToFileBegin}, 
    280     {"MarkToFileEnd", CK_MarkToFileEnd}, 
    281     {"MarkToPageBegin", CK_MarkToPageBegin}, 
    282     {"MarkToPageEnd", CK_MarkToPageEnd}, 
    283     {"MarkScrollUp", CK_MarkScrollUp}, 
    284     {"MarkScrollDown", CK_MarkScrollDown}, 
    285     {"MarkParagraphUp", CK_MarkParagraphUp}, 
    286     {"MarkParagraphDown", CK_MarkParagraphDown}, 
    287     {"MarkColumnPageUp", CK_MarkColumnPageUp}, 
    288     {"MarkColumnPageDown", CK_MarkColumnPageDown}, 
    289     {"MarkColumnLeft", CK_MarkColumnLeft}, 
    290     {"MarkColumnRight", CK_MarkColumnRight}, 
    291     {"MarkColumnUp", CK_MarkColumnUp}, 
    292     {"MarkColumnDown", CK_MarkColumnDown}, 
    293     {"MarkColumnScrollUp", CK_MarkColumnScrollUp}, 
    294     {"MarkColumnScrollDown", CK_MarkColumnScrollDown}, 
    295     {"MarkColumnParagraphUp", CK_MarkColumnParagraphUp}, 
    296     {"MarkColumnParagraphDown", CK_MarkColumnParagraphDown}, 
    297     {"BlockShiftLeft", CK_BlockShiftLeft}, 
    298     {"BlockShiftRight", CK_BlockShiftRight}, 
    299     {"InsertLiteral", CK_InsertLiteral}, 
    300     {"ShowTabTws", CK_ShowTabTws}, 
    301     {"SyntaxOnOff", CK_SyntaxOnOff}, 
    302     {"SyntaxChoose", CK_SyntaxChoose}, 
    303     {"ShowMargin", CK_ShowMargin}, 
    304     {"OptionsSaveMode", CK_OptionsSaveMode}, 
    305     {"About", CK_About}, 
     246    {"Tab", NULL, CK_Tab}, 
     247    {"ScrollUp", NULL, CK_ScrollUp}, 
     248    {"ScrollDown", NULL, CK_ScrollDown}, 
     249    {"Return", NULL, CK_Return}, 
     250    {"ParagraphUp", NULL, CK_ParagraphUp}, 
     251    {"ParagraphDown", NULL, CK_ParagraphDown}, 
     252    {"EditFile", NULL, CK_EditFile}, 
     253    {"MarkWord", NULL, CK_MarkWord}, 
     254    {"MarkLine", NULL, CK_MarkLine}, 
     255    {"MarkAll", NULL, CK_MarkAll}, 
     256    {"Unmark", NULL, CK_Unmark}, 
     257    {"MarkColumn", NULL, CK_MarkColumn}, 
     258    {"BlockSave", NULL, CK_BlockSave}, 
     259    {"InsertFile", NULL, CK_InsertFile}, 
     260    {"InsertOverwrite", NULL, CK_InsertOverwrite}, 
     261    {"Date", NULL, CK_Date}, 
     262    {"DeleteLine", NULL, CK_DeleteLine}, 
     263    {"DeleteToHome", NULL, CK_DeleteToHome}, 
     264    {"DeleteToEnd", NULL, CK_DeleteToEnd}, 
     265    {"EditMail", NULL, CK_Mail}, 
     266    {"ParagraphFormat", NULL, CK_ParagraphFormat}, 
     267    {"MatchBracket", NULL, CK_MatchBracket}, 
     268    {"ExternalCommand", NULL, CK_ExternalCommand}, 
     269    {"MacroStartRecord", NULL, CK_MacroStartRecord}, 
     270    {"MacroStopRecord", NULL, CK_MacroStopRecord}, 
     271    {"MacroStartStopRecord", NULL, CK_MacroStartStopRecord}, 
     272    {"MacroDelete", NULL, CK_MacroDelete}, 
     273    {"RepeatStartStopRecord", NULL, CK_RepeatStartStopRecord}, 
     274    {"BookmarkFlush", NULL, CK_BookmarkFlush}, 
     275    {"BookmarkNext", NULL, CK_BookmarkNext}, 
     276    {"BookmarkPrev", NULL, CK_BookmarkPrev}, 
     277    {"MarkPageUp", NULL, CK_MarkPageUp}, 
     278    {"MarkPageDown", NULL, CK_MarkPageDown}, 
     279    {"MarkToFileBegin", NULL, CK_MarkToFileBegin}, 
     280    {"MarkToFileEnd", NULL, CK_MarkToFileEnd}, 
     281    {"MarkToPageBegin", NULL, CK_MarkToPageBegin}, 
     282    {"MarkToPageEnd", NULL, CK_MarkToPageEnd}, 
     283    {"MarkScrollUp", NULL, CK_MarkScrollUp}, 
     284    {"MarkScrollDown", NULL, CK_MarkScrollDown}, 
     285    {"MarkParagraphUp", NULL, CK_MarkParagraphUp}, 
     286    {"MarkParagraphDown", NULL, CK_MarkParagraphDown}, 
     287    {"MarkColumnPageUp", NULL, CK_MarkColumnPageUp}, 
     288    {"MarkColumnPageDown", NULL, CK_MarkColumnPageDown}, 
     289    {"MarkColumnLeft", NULL, CK_MarkColumnLeft}, 
     290    {"MarkColumnRight", NULL, CK_MarkColumnRight}, 
     291    {"MarkColumnUp", NULL, CK_MarkColumnUp}, 
     292    {"MarkColumnDown", NULL, CK_MarkColumnDown}, 
     293    {"MarkColumnScrollUp", NULL, CK_MarkColumnScrollUp}, 
     294    {"MarkColumnScrollDown", NULL, CK_MarkColumnScrollDown}, 
     295    {"MarkColumnParagraphUp", NULL, CK_MarkColumnParagraphUp}, 
     296    {"MarkColumnParagraphDown", NULL, CK_MarkColumnParagraphDown}, 
     297    {"BlockShiftLeft", NULL, CK_BlockShiftLeft}, 
     298    {"BlockShiftRight", NULL, CK_BlockShiftRight}, 
     299    {"InsertLiteral", NULL, CK_InsertLiteral}, 
     300    {"ShowTabTws", NULL, CK_ShowTabTws}, 
     301    {"SyntaxOnOff", NULL, CK_SyntaxOnOff}, 
     302    {"SyntaxChoose", NULL, CK_SyntaxChoose}, 
     303    {"ShowMargin", NULL, CK_ShowMargin}, 
     304    {"OptionsSaveMode", NULL, CK_OptionsSaveMode}, 
     305    {"About", NULL, CK_About}, 
    306306    /* An action to run external script from macro */ 
    307     {"ExecuteScript", CK_PipeBlock (0)}, 
     307    {"ExecuteScript", NULL, CK_PipeBlock (0)}, 
    308308#endif /* USE_INTERNAL_EDIT */ 
    309309 
    310310    /* viewer */ 
    311     {"WrapMode", CK_WrapMode}, 
    312     {"HexEditMode", CK_HexEditMode}, 
    313     {"HexMode", CK_HexMode}, 
    314     {"MagicMode", CK_MagicMode}, 
    315     {"NroffMode", CK_NroffMode}, 
    316     {"BookmarkGoto", CK_BookmarkGoto}, 
    317     {"Ruler", CK_Ruler}, 
     311    {"WrapMode", NULL, CK_WrapMode}, 
     312    {"HexEditMode", NULL, CK_HexEditMode}, 
     313    {"HexMode", NULL, CK_HexMode}, 
     314    {"MagicMode", NULL, CK_MagicMode}, 
     315    {"NroffMode", NULL, CK_NroffMode}, 
     316    {"BookmarkGoto", NULL, CK_BookmarkGoto}, 
     317    {"Ruler", NULL, CK_Ruler}, 
    318318 
    319319#ifdef USE_DIFF_VIEW 
    320320    /* diff viewer */ 
    321     {"ShowSymbols", CK_ShowSymbols}, 
    322     {"SplitFull", CK_SplitFull}, 
    323     {"SplitEqual", CK_SplitEqual}, 
    324     {"SplitMore", CK_SplitMore}, 
    325     {"SplitLess", CK_SplitLess}, 
    326     {"Tab2", CK_Tab2}, 
    327     {"Tab3", CK_Tab3}, 
    328     {"Tab4", CK_Tab4}, 
    329     {"Tab8", CK_Tab8}, 
    330     {"HunkNext", CK_HunkNext}, 
    331     {"HunkPrev", CK_HunkPrev}, 
    332     {"EditOther", CK_EditOther}, 
    333     {"Merge", CK_Merge}, 
     321    {"ShowSymbols", NULL, CK_ShowSymbols}, 
     322    {"SplitFull", NULL, CK_SplitFull}, 
     323    {"SplitEqual", NULL, CK_SplitEqual}, 
     324    {"SplitMore", NULL, CK_SplitMore}, 
     325    {"SplitLess", NULL, CK_SplitLess}, 
     326    {"Tab2", NULL, CK_Tab2}, 
     327    {"Tab3", NULL, CK_Tab3}, 
     328    {"Tab4", NULL, CK_Tab4}, 
     329    {"Tab8", NULL, CK_Tab8}, 
     330    {"HunkNext", NULL, CK_HunkNext}, 
     331    {"HunkPrev", NULL, CK_HunkPrev}, 
     332    {"EditOther", NULL, CK_EditOther}, 
     333    {"Merge", NULL, CK_Merge}, 
    334334#endif /* USE_DIFF_VIEW */ 
    335335 
    336     {NULL, CK_IgnoreKey} 
     336    {NULL, NULL, CK_IgnoreKey} 
    337337}; 
    338338 
    339339/* *INDENT-OFF* */ 
     
    346346static int 
    347347name_keymap_comparator (const void *p1, const void *p2) 
    348348{ 
    349     const name_keymap_t *m1 = (const name_keymap_t *) p1; 
    350     const name_keymap_t *m2 = (const name_keymap_t *) p2; 
     349    name_keymap_t *m1 = (name_keymap_t *) p1; 
     350    name_keymap_t *m2 = (name_keymap_t *) p2; 
    351351 
    352     return str_casecmp (m1->name, m2->name); 
     352    if (m1->casefolded_normalized_name == NULL) 
     353        m1->casefolded_normalized_name = str_create_search_needle (m1->name, FALSE); 
     354    if (m2->casefolded_normalized_name == NULL) 
     355        m2->casefolded_normalized_name = str_create_search_needle (m2->name, FALSE); 
     356 
     357    return strcmp (m1->casefolded_normalized_name, m2->casefolded_normalized_name); 
    353358} 
    354359 
    355360/* --------------------------------------------------------------------------------------------- */ 
     
    403408unsigned long 
    404409keybind_lookup_action (const char *name) 
    405410{ 
    406     const name_keymap_t key = { name, 0 }; 
     411    const name_keymap_t key = { name, NULL, 0 }; 
    407412    name_keymap_t *res; 
    408413 
    409414    sort_command_names (); 
     
    411416    res = bsearch (&key, command_names, num_command_names, 
    412417                   sizeof (command_names[0]), name_keymap_comparator); 
    413418 
     419    if (key.casefolded_normalized_name != NULL) 
     420        str_release_search_needle (key.casefolded_normalized_name, FALSE); 
     421 
    414422    return (res != NULL) ? res->val : CK_IgnoreKey; 
    415423} 
    416424 
  • lib/keybind.h

    diff -Naur mc-4.8.0/lib/keybind.h mc-4.8.0-fasterStartup/lib/keybind.h
    old new  
    317317typedef struct name_keymap_t 
    318318{ 
    319319    const char *name; 
     320    char *casefolded_normalized_name;   /* initially NULL */ 
    320321    unsigned long val; 
    321322} name_keymap_t; 
    322323 
  • lib/strutil/strutilutf8.c

    diff -Naur mc-4.8.0/lib/strutil/strutilutf8.c mc-4.8.0-fasterStartup/lib/strutil/strutilutf8.c
    old new  
    10251025static char * 
    10261026str_utf8_casefold_normalize (const char *text) 
    10271027{ 
    1028     GString *fixed = g_string_new (""); 
     1028    GString *fixed = NULL; 
    10291029    char *tmp, *fold; 
    10301030    char *result; 
    10311031    const char *start; 
     
    10341034    start = text; 
    10351035    while (!g_utf8_validate (start, -1, &end) && start[0] != '\0') 
    10361036    { 
     1037        if (fixed == NULL) 
     1038            fixed = g_string_new (""); 
    10371039        if (start != end) 
    10381040        { 
    10391041            fold = g_utf8_casefold (start, end - start); 
     
    10641066        } 
    10651067        result = g_strdup (fixed->str); 
    10661068    } 
    1067     g_string_free (fixed, TRUE); 
     1069    if (fixed != NULL) 
     1070        g_string_free (fixed, TRUE); 
    10681071 
    10691072    return result; 
    10701073}