clmode_lex.zip
結局シロさんの指摘していた不具合をなんとかするために、補完リストを作成するタイミングでのフック(lex_hook_on_listup_abbrev)を追加した。OnAbbrevの存在意義がますますわからなくなっていく。clbubun,cltitleはこんな感じで。

# 部分一致を使用
def bubun_hook(event):
    import clbubun
    res = clbubun.ListupAbbrevCandidate(event.str)
    event.candlist.extend(res)
clmode_lex.AddHook(clmode_lex.lex_hook_on_listup_abbrev, bubun_hook)

# ウインドウタイトル検索を使用
def title_abbrev_hook(event):
    import cltitle
    res = cltitle.ListupAbbrevCandidate(event.str)
    event.candlist.extend(res)
clmode_lex.AddHook(clmode_lex.lex_hook_on_listup_abbrev, title_abbrev_hook)

def title_exec_hook(event):
    import clcore
    hwnd = FindWindow(None, event.str)
    if hwnd:
        clcore.SetForegroundWindow( hwnd )
        clcore.Edit_SetValue('')
        clcore.List_Show(False)
        clcore.Edit_SetStatusIndicator('--')
        event.Skip()
clmode_lex.AddHook(clmode_lex.lex_hook_on_before_command, title_exec_hook)

ちょっと心配になったこと。OnAddrevってキャンセルしたらEditの描画のロックは解除されるのだろうか。今のところ弊害は無いみたいなんだけど。