From dd283cb452a9b8f8b71f2beef2f624dfa9decd11 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 13 Jul 2023 07:13:41 +1000 Subject: [PATCH] notmuch: support mouse-click to select search and thread mouse-click on search name will select that search. mouse-click on thread subject will select that thread, or message within a thread (I think... that last one is a bit weird). Signed-off-by: NeilBrown --- DOC/TODO.md | 24 ++++++++++++++++++++++++ python/module-notmuch.py | 10 ++++++++-- 2 files changed, 32 insertions(+), 2 deletions(-) diff --git a/DOC/TODO.md b/DOC/TODO.md index 7c0e070d..7cc12f31 100644 --- a/DOC/TODO.md +++ b/DOC/TODO.md @@ -875,6 +875,30 @@ Module features New Modules ----------- +- [ ] emacs-pinentry. pinentry-curses can talk to emacs using a + protocol that edlib can copy. + export INSIDE_EMACS=yes + Listen on a SOCK_STREAM at ${TMPDIR-/tmp}/emacs$(id -u)/pinentry. + On connect, end "OK". In general responses are lines terminated + by '\n' with OK or ERR ending a response + D with %XX esacpe for % \n \r + OK + ERR + #comment + + Respond to GETPIN with D data + Respond to CONFIRM with OK if user sends OK. + Accept some settings: + SETTITLE Context for PIN + SETDESC Enter PIN for Fred Bloggs + SETERROR Error message + SETPROMPT PIN: + SETREPEAT IF PIN needs to be entered twice for confirmation + SETREPEATERROR message to show if they don't match + SETOK Text for label of OK button + SETCANCEL Text for label of "NO" or "Cancel" button + SETNOTOK NOT OK button??? + - [ ] separate out CUA-base from mode-emacs: - selection management diff --git a/python/module-notmuch.py b/python/module-notmuch.py index d9e9f05a..5180658d 100644 --- a/python/module-notmuch.py +++ b/python/module-notmuch.py @@ -843,7 +843,7 @@ class notmuch_query(edlib.Doc): "%TM-size%TM-threadinfo<%TM-hilite>" + "%TM-flag" + " " + - "%TM-subject") + "%TM-subject") self.add_notify(self.maindoc, "Notify:Tag") self.add_notify(self.maindoc, "Notify:Close") self['doc-status'] = "" @@ -1918,6 +1918,12 @@ class notmuch_master_view(edlib.Pane): focus.call("notmuch:select", mark, 1) return 1 + def handle_select_1(self, key, focus, mark, **a): + "handle:notmuch:select-1" + # select thing under point, and enter it + focus.call("notmuch:select", mark, 1) + return 1 + def handle_search(self, key, focus, **a): "handle:doc:char-s" pup = focus.call("PopupTile", "3", "", ret='pane') @@ -2534,7 +2540,7 @@ class notmuch_list_view(edlib.Pane): edlib.Pane.__init__(self, focus) self['notmuch:pane'] = 'main' self['background'] = 'color:#A0FFFF' - self['line-format'] = '<%fmt>%count%space%name' + self['line-format'] = '<%fmt>%count%space%name' self.call("notmuch:set_list_pane") self.call("doc:request:doc:replaced") self.selected = None -- 2.39.5