NeilBrown [Mon, 22 May 2023 10:53:47 +0000 (20:53 +1000)]
handle text-fill in .md files better.
Enhance text-fill so that various style attributes can be on the pane
rather than on the character, and set pane attributes for markdown to
notice the starts of various paragraph types, particularly the various
list entries.
NeilBrown [Sun, 14 May 2023 23:42:25 +0000 (09:42 +1000)]
search: speed up backwards search.
Rather stepping back one char at a time and attempting a match, step
back larger and larger numbers of chars, and search in that range.
Once we find, search forward for the last match.
NeilBrown [Sun, 14 May 2023 09:12:44 +0000 (19:12 +1000)]
rexel: add an 'advance' flag to turn on anchored search.
If we want to find a match that *starts* before a given point but may
continue after that point, we cannot just stop when we reach the point,
but we must enable anchored-match when we do.
Introduce matching "anchor_at_end" flag in lib-search which used this
flag.
With anchor_at_end, the match must start by the end mark.
Without, it must be complete by the end mark.
NeilBrown [Sun, 21 May 2023 11:11:46 +0000 (21:11 +1000)]
lib-search: fix bug with matching a pattern that ends at point
Calling rxl_advance() is problematic as merging the two return code is
not trivial.
We really want all the flags that go before a given character to be
handled together.
So set a flag when we see the point, then set the RXL_POINT flag the
next time around.
NeilBrown [Fri, 19 May 2023 06:36:50 +0000 (16:36 +1000)]
rexel: store wctype values directly in rxl array
Rather than having a static mapping from a 2-byte value stored in the
rxl array to an 8-byte wctype_t, store the wctype_t directly in the rxl
array, using as many entries as needed.
NeilBrown [Tue, 16 May 2023 09:37:14 +0000 (19:37 +1000)]
rexel: support unicode beyond 0x7ffff
The comment said we have to create a set for unicode beyond 15 bits, but
the code doesn't.
Instead reserve 17 code value to identify a unicode plane, and the next
'short' is combined to create a full unicode codepoint.
NeilBrown [Sat, 13 May 2023 01:53:41 +0000 (11:53 +1000)]
emacs: if shell command produces no output - say so.
If a shell command exits quickly with no output, emacs mode currently
writes and empty string (the output) to the message line, which isn't a
lot of help.
Instead, write a message that the command did complete - and report any
exit code.
NeilBrown [Sat, 13 May 2023 01:39:43 +0000 (11:39 +1000)]
notmuch: simplify how 'new' tag is cleared
When the search view is explicitly closed with 'q', all new
threads/messages that have been listed get the 'new' tag cleared.
Any implicit close no longer does that.
NeilBrown [Fri, 12 May 2023 09:10:19 +0000 (19:10 +1000)]
notmuch: handle display of alternatives that are multipart.
An alternative can be multipart, e.g. multipart/related.
In that case it won't be the last segment of the path which
says "alternative". We have to look earlier.
NeilBrown [Thu, 11 May 2023 23:39:00 +0000 (09:39 +1000)]
email: ensure text parts always provide characters.
If a base64 part does not declare a charset, we don't provide one, so no
chars are available, only bytes.
This is fine for PDF which wants bytes, but bad for html.
So check for text and require some charset.
NeilBrown [Mon, 8 May 2023 09:48:49 +0000 (19:48 +1000)]
notmuch: avoid inconsistent value of thread_end
thread_end points to the start of the next thread after thread_start.
Changes to the document can insert another thread in between which
causes strange display.
So always recalc thread_next when the doc changes.
NeilBrown [Sat, 6 May 2023 23:45:33 +0000 (09:45 +1000)]
notmuch message-view: improve url attributes.
Rather than storing the URL as an attribute of the first char of the
URL, store it as an attribute of the pane, indexed by a tag. This tag
is stored in the render:url attribute instead of a length.
This avoid the need to search backwards for the char with the url
attribute, we can access it directly instead.
lib-renderline: allow <image> to have map: attribute.
A "map" helps place the cursor within an image. The map provides both a
number of rows and columns, and a collection of the characters in the
rendering which can be used to communicate where the cursor is.
When rendering, lib-markup can be told to use some other function for
line via the markup:func attribute. This can easily included eol chars
in the range being rendered.
However when moving backwards with doc:render-line-prev there is not
currently a way to skip over some eol chars.
So introduce a mark:not_eol text attributes which can be applied to eol
characters to cause lib-markup to ignore them.
Py_SetProgramName and PySys_SetArgv are deprecated, so use
PyConfig to avoid warnings.
Also enable "isolated" initialisation to see if it is a bad idea or not.
After 15 seconds in one command we want to abort to avoid
infinite loops. However doc:content calls don't get
caught currently because the call to the handler
doesn't go through key_handle().
So add a light-weight test in the call.
We usually store a new value in ref.m after freeing this one, but it
possible for that to fail.
So for safety, set to NULL rather than leaving an invalid mark pointer.
We currently make the default arg 'replacable' so that typing any text
replaces it. This is sometimes useful, but sometime awkward.
1/ It is clumsy to edit the arg - you need to abort the 'replaceable'
state first
2/ it doesn't help with added option e.g. to grep.
So don't make it 'replaceable' but instead place the cursor before the
text. Then it is easy to insert options or edit the text, and replacing
it is as simple as ctrl-K.
NeilBrown [Sun, 19 Feb 2023 21:41:34 +0000 (08:41 +1100)]
notmuch/email: allow extra headers to be shown.
When viewing an email, it can be useful to be some extra headers without
having to look through the complete raw headers.
There is also information that notmuch knows which doesn't exist in the
headers.
So add an "extras" button which causes both doc-email and notmuch to add
extra headers that might be interesting.
Message-ID
In-Reply-To
References
Filename
Thread-ID
NeilBrown [Sun, 5 Feb 2023 20:43:25 +0000 (07:43 +1100)]
emacs: don't create empty selection when clicking.
When not selection words or line, and when the pointer didn't move,
there cannot be a selection, so don't leave the selection enabled.
Otherwise it can suddenly appear sometimes.
NeilBrown [Sun, 5 Feb 2023 00:18:49 +0000 (11:18 +1100)]
notmuch: messages in visible thread should not disappear.
While a thread is visible, background refresh should not cause messages
to disappear - e.g. if I archive one and then a refresh happens.
They should only disappear when I re-visit the thread, or when I
explicitly request a refresh with '='.
So keep track of that explicit request, and when not present but the
query is open, preserve all 'True' matched values.
NeilBrown [Tue, 31 Jan 2023 01:07:12 +0000 (12:07 +1100)]
Allow a line boundary to be reported by the document.
Rendering renders up to a line boundary. Usually a newline, but the doc
can say where it is. This allows multi-part to put a boundary between
parts, in case a part contains garbage.
This removes some blank lines in email messages - nice.
NeilBrown [Mon, 30 Jan 2023 23:37:19 +0000 (10:37 +1100)]
email-view: be more selective of alternates.
Rather and selecting the first among alternates, select the last that we
understand, but avoid html unless there is no alternative.
This is more standards-compliant, and allows text/calendar to be easily
seen.