summaryrefslogtreecommitdiff
path: root/piem-lei.el
AgeCommit message (Collapse)Author
2021-06-07piem-lei-query-thread: Add bug#NNN special case when eliding subjectKyle Meyer
In debbugs threads, it's not uncommon for a leading "[bug#NNN]" in the subject to be converted to "bug#NNN:" [*]. I'm not sure what the source of this is, but it prevents the suppression of an otherwise identical subject. It's probably not worth normalizing before the comparison to get full suppression, but it'd be nice to at least elide the main part of the subject so it's more obvious that it didn't change. Add a special case so that "bug#NNN:" prefix is treated the same as a bracketed prefix. [*] example: https://yhetil.org/guix-patches/20201128051435.30580-1-kyle@kyleam.com Message-Id: <20210605211402.20304-13-kyle@kyleam.com>
2021-06-07piem-lei-query-thread: Omit main part of subject if sharedKyle Meyer
In addition to suppressing identical subjects (after stripping "re:"), public-inbox's web interface will compare the current line's subject with the previous line's, and cut off the shared tail: [PATCH] Add basic integration for Rmail ` <suppressed completely> ` [PATCH v2] " <-- here ` <suppressed completely> I think the above is helpful. However, in some cases, I find the presentation more confusing than helpful: [PATCH 0/3] notmuch: Improve handling of attached patches ` [PATCH 1/3] piem-notmuch--with-current-message: Declare debug and indent specs ` [PATCH 2/3] piem-notmuch-am-ready-mbox: Improve handling of attachments ` <suppressed completely> ` [PATCH v2 0/3] notmuch: Improve handling of attached patches ` [PATCH v2 1/3] piem-notmuch--with-current-message: Declare debug and indent specs ` [PATCH v2 2/3] piem-notmuch-am-ready-mbox: Improve handling of attachments ` [PATCH v2 3/3] gnus, notmuch: Absorb now-shared bits into patch attachment helper ` [PATCH " It takes me a second to figure out what the omitted bits in the last line's subject are. I'm not sure, but I think the subject truncation that I find clear is where the omitted text is the main subject after a bracketed tag (i.e. "[tag] main"), not more or less. Teach piem-lei-query-thread to split the subject into a "prefix" (some number of "[tag]" items) and a "main" part (everything else), and elide a line's main part if it matches the previous line's. In the above example, the last line would be ` [PATCH 3/3] … Message-Id: <20210605211402.20304-12-kyle@kyleam.com>
2021-06-07piem-lei-query-thread: Deal with multiple "re:"sKyle Meyer
piem-lei-query-thread strips a message's subject of "re: " before checking matches the previous line's subject and should be dropped. "re: re: <subjects>" unfortunately don't seem uncommon, so strip multiple "re:"s. Message-Id: <20210605211402.20304-11-kyle@kyleam.com>
2021-06-07piem-lei-query-thread: Drop repeated subjectsKyle Meyer
public-inbox's web interface suppresses a message's subject when it matches the previous lines [*]. Teach piem-lei-query-thread to do the same to make it easier to spot subject shifts and identify subthreads. [*] notmuch-tree-mode does similar, displaying "..." instead. Message-Id: <20210605211402.20304-10-kyle@kyleam.com>
2021-06-07piem-lei-query-thread: Position point on seed messageKyle Meyer
It seems likely that the caller wants to start digesting the thread in the context of the seed message, and that message may be part of a large thread. Move point to help orient the caller. Notmuch nicely distinguishes search hits from other messages when displaying a thread. Something along those lines is worth considering eventually. Message-Id: <20210605211402.20304-9-kyle@kyleam.com>
2021-06-07lei query: Fontify resultsKyle Meyer
Message-Id: <20210605211402.20304-8-kyle@kyleam.com>
2021-06-07lei: Add command for viewing a threadKyle Meyer
piem-lei-query presents a message-based overview. In many cases the caller will want to use that search result as a seed for finding the associated thread. Add a command that construct thread for a given message. The threading algorithm is based on public-inbox's. Some details may have been lost in translation, but I haven't spotted any differences yet when doing side-by-side comparisons of output from piem-lei-query-thread and public-inbox's web interface. And testing with a few ~100-message threads, the performance seems to be okay. The appearance also follows public-inbox's, which I like. Message-Id: <20210605211402.20304-7-kyle@kyleam.com>
2021-06-07lei query: Add piem-lei-show wrapper for displaying line's messageKyle Meyer
Message-Id: <20210605211402.20304-6-kyle@kyleam.com>
2021-06-07lei: Add command and mode for displaying overview of search resultsKyle Meyer
The output is intended to resemble search in public-inbox's web interface: an entry for each matching message. This is different from notmuch-search's output in that results are not grouped in their thread. I like notmuch's interface, although I'm not sure that trying to reshape lei-q's JSON output into something like that is worth the code complication or computation cost. The plan is to eventually wire this up to a transient to allow the caller to specify arguments (e.g., --only to restrict the search results to a particular inbox). Message-Id: <20210605211402.20304-5-kyle@kyleam.com>
2021-06-07piem-lei-show: Highlight headers and quoted textKyle Meyer
Piggyback off of message-* faces to hopefully fit in nicely with themes and expectations. Leave other highlighting (e.g., of diffs), until later. Message-Id: <20210605211402.20304-4-kyle@kyleam.com>
2021-06-07piem-lei-show: Let caller suppress displaying bufferKyle Meyer
piem-lei-show switches to the message buffer with pop-to-buffer, but that behavior won't work well in the context of a mode that gives an overview of lei-q search results. In that case, a wrapper command will want to control the display of the buffer so that it can keep a split window layout and avoid switching to the piem-lei-show-mode buffer. And more generally, Lisp callers are likely to want to handle the display themselves. Add an optional 'display' parameter that defaults to nil for non-interactive calls. Message-Id: <20210605211402.20304-3-kyle@kyleam.com>
2021-06-07lei: Add command and mode for displaying a messageKyle Meyer
This command is a simple wrapper around `lei q --format=text m:MID', letting lei handle the details. Things will eventually need to get more complicated (e.g., attachment handling, signatures, replies), but this should do for now. Message-Id: <20210605211402.20304-2-kyle@kyleam.com>