]> git.neil.brown.name Git - edlib.git/log
edlib.git
2 years agodoc-email: be more subtle with default visibility.
NeilBrown [Sat, 3 Jun 2023 00:55:59 +0000 (10:55 +1000)]
doc-email: be more subtle with default visibility.

We don't want large (base64) attachments to be visible by default, nor
do we want transformations to appear too early.
So mark all spacers, the orig-headers, and the orig first part as
visible, and everything else invisible.

This will, for example, stop LineCount from counting too much of it if
it happens to start before final visibility is configured

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolinecount: ensure we start a visible beginning of document
NeilBrown [Sat, 3 Jun 2023 00:49:37 +0000 (10:49 +1000)]
linecount: ensure we start a visible beginning of document

The document we are counting might be a 'view' and the early lines might
be clipped off.  So use doc:set-ref to move to the beginning as visible
from the focus.
Also simplify the code as two conditions each have exactly the same result.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoAlways call CountLines on the focus
NeilBrown [Sat, 3 Jun 2023 00:34:08 +0000 (10:34 +1000)]
Always call CountLines on the focus

A view might hide some lines, and might intercept CountLines so exclude
those lines from the count.
As a line count is a particular view on the file, it should be
consistent with other views.
So always use the current focus when calling CountLines.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolinecount: improve notify:replaced handling
NeilBrown [Fri, 2 Jun 2023 22:25:37 +0000 (08:25 +1000)]
linecount: improve notify:replaced handling

If the region being replaced is large, me might need to discard marks
that are in it.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolinecount: simplify count_calculate()
NeilBrown [Fri, 2 Jun 2023 22:04:59 +0000 (08:04 +1000)]
linecount: simplify count_calculate()

There is no need to make a special case of m being after end, because m
is always at the start of the file.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolinecount: remove 'start' arg from count_calculate()
NeilBrown [Fri, 2 Jun 2023 09:32:10 +0000 (19:32 +1000)]
linecount: remove 'start' arg from count_calculate()

We always pass NULL for the 'srart' to count_calculate().  So remove all
code that only runs if start != NULL, and remove 'start'.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolinecount: don't pass mark to doc:CountLines at startup
NeilBrown [Fri, 2 Jun 2023 09:27:58 +0000 (19:27 +1000)]
linecount: don't pass mark to doc:CountLines at startup

When we create line CountLines pane, we jut want to initialise the line
count.  So don't pass in ->mark.  It is meaningless and is ignored.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolinecount: ignore Notify:Clip
NeilBrown [Fri, 2 Jun 2023 09:14:03 +0000 (19:14 +1000)]
linecount: ignore Notify:Clip

We cannot possible get a Notify:Clip message, so don't try to handle it.

Notify:Clip comes from a child, and we don't have any.
The only commands we can get are ones we have explicitly requested from
the doc.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolinecount: use a more natural means of registering Notify:Close
NeilBrown [Fri, 2 Jun 2023 09:10:12 +0000 (19:10 +1000)]
linecount: use a more natural means of registering Notify:Close

Rather than overloading doc:Countlines, use the normal doc:request:
to register for Notify:Close.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoline-count: limit ranges based on words and chars as well as lines.
NeilBrown [Fri, 2 Jun 2023 08:40:34 +0000 (18:40 +1000)]
line-count: limit ranges based on words and chars as well as lines.

Increase the gap between markers from 50 to 100 - just because.
Also limit to 1000 words or 10,000 chars, just in case there are
some very big lines.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agopython: change how modules are loaded into the interpreter
NeilBrown [Fri, 2 Jun 2023 07:24:00 +0000 (17:24 +1000)]
python: change how modules are loaded into the interpreter

Each edlib module is now a separate python module.
They must all "import edlib" and can find the editor pane in
"edlib.editor"
They must also import any modules they use.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agopython: discard python-load
NeilBrown [Fri, 2 Jun 2023 06:24:25 +0000 (16:24 +1000)]
python: discard python-load

The "python-load" command has never been used, and might not work.
Discard it until I have a reason to resurrect it.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoncurses: don't block in nc_external_viewer
NeilBrown [Fri, 2 Jun 2023 03:07:28 +0000 (13:07 +1000)]
ncurses: don't block in nc_external_viewer

Rather than blocking the whole editor while waiting for use to
copy/paste for plain-text screen, set a flag to say that the display is
suspended, and resume on next key stroke collected in the normal way.

Also timeout after 30 seconds.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: reply to first VISIBLE text part
NeilBrown [Thu, 1 Jun 2023 05:40:58 +0000 (15:40 +1000)]
notmuch: reply to first VISIBLE text part

Instead of choosing first text part, choose first visible text part for
interpolating into reply.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoinput: remove unnecessary 'safe' annotations.
NeilBrown [Thu, 1 Jun 2023 05:20:12 +0000 (15:20 +1000)]
input: remove unnecessary 'safe' annotations.

Marking local vars as 'safe' makes no sense.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoemacs-search: guard against ->target closing too.
NeilBrown [Thu, 1 Jun 2023 05:10:59 +0000 (15:10 +1000)]
emacs-search: guard against ->target closing too.

If ->target closes, we should get closed first.  But we shouldn't really
depend on that, so explicitly catch the close notification and handle it.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoemacs-search: get notification when panes close.
NeilBrown [Thu, 1 Jun 2023 04:53:11 +0000 (14:53 +1000)]
emacs-search: get notification when panes close.

If we hold a reference to a pane, we must get Notify:Close notifications
from it, and clear the pointer if that happens.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: improve handling of "%d quoted lines" marker
NeilBrown [Wed, 31 May 2023 21:26:10 +0000 (07:26 +1000)]
notmuch: improve handling of "%d quoted lines" marker

Clicking on the marker now stays on the line.  As few other bits aren't
quite perfect yet.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: don't accidentally make back-refs with impossible capnum.
NeilBrown [Wed, 31 May 2023 11:12:32 +0000 (21:12 +1000)]
rexel: don't accidentally make back-refs with impossible capnum.

If we try to make a backref with an impossible CAPture NUMber, it will
look like an invalid opcode, and rexel will abort() (which it
shouldn't...).  So make sure it doesn't happen.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: wait for thread_p
NeilBrown [Wed, 31 May 2023 08:12:43 +0000 (18:12 +1000)]
notmuch: wait for thread_p

I wasn't waiting for this subprocess to exit.  It would sometimes hang
around as a zombie.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m: convert html entities in URL.
NeilBrown [Wed, 31 May 2023 08:08:21 +0000 (18:08 +1000)]
w3m: convert html entities in URL.

I didn't realise that w3m put html entities in the URL - e.g. &amp;

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO: small updates to v1.0 goal.
NeilBrown [Wed, 31 May 2023 00:38:22 +0000 (10:38 +1000)]
TODO: small updates to v1.0 goal.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO: revise priorities.
NeilBrown [Wed, 31 May 2023 00:36:03 +0000 (10:36 +1000)]
TODO: revise priorities.

Discard priorities that aren't that important, and sort others into
small, medium, and large.

'Trivial' can be things that aren't mentioned elsewhere, should be
trivial, and should done first.  If not done first, copy to proper home.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO: merge bugs into priorities.
NeilBrown [Tue, 30 May 2023 10:53:43 +0000 (20:53 +1000)]
TODO: merge bugs into priorities.

All "Bugs" are now just "priorities", and exist both in that list, and
in the list for the relevant module.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO: all current-priorities must be in correct section too
NeilBrown [Tue, 30 May 2023 10:29:55 +0000 (20:29 +1000)]
TODO: all current-priorities must be in correct section too

"current priorities" are now copied from where-ever.  Nothing should be
there that isn't somewhere else.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO: move the [1] stuff.
NeilBrown [Tue, 30 May 2023 09:54:57 +0000 (19:54 +1000)]
TODO: move the [1] stuff.

Instead of using [1] for high-priority suggestions, just copy them into
the 'Current priorities' section.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO: remove anything marked [X]
NeilBrown [Tue, 30 May 2023 09:53:29 +0000 (19:53 +1000)]
TODO: remove anything marked [X]

That which is done, is done.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoWait for processes we fork.
NeilBrown [Mon, 29 May 2023 11:37:26 +0000 (21:37 +1000)]
Wait for processes we fork.

Keep track of the xdg-open processes we fork, and wait for them as
appropriate.

Also make sure we catch the correct TimeoutExpired except when a notmuch
search takes too long, so we can kill and wait for the process.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agopdf,doc: mark urls.
NeilBrown [Sun, 28 May 2023 07:58:03 +0000 (17:58 +1000)]
pdf,doc: mark urls.

Copy the url-marking code from notmuch as use it to mark urls in
converted pdf and doc.
I don't know that this is a good idea.. Let's see if I find it useful.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agomultipart: don't assume sub-panes never disappear.
NeilBrown [Sun, 28 May 2023 07:25:27 +0000 (17:25 +1000)]
multipart: don't assume sub-panes never disappear.

If a part-pane sends a Notify:Close we REALLY mustn't touch it again.
So we must set the pointer to NULL.  Even though we start closing down,
something bad could happen.

I had a crash where the attempt to send "doc:closed" to all panes
crashed on one that had already been closed.

So remove the 'safe' marking, handle the fall-out, and set .pane to NULL
when told to.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agotests: filter out duplicate "Display" lines.
NeilBrown [Sun, 28 May 2023 06:59:54 +0000 (16:59 +1000)]
tests: filter out duplicate "Display" lines.

The 02-grep often duplicates some Display lines, apparently at random.
I don't know why and it doesn't show a display bug.
So filter them out to avoid unnecessary test failure.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolib-renderline: Introduce word-wrap.
NeilBrown [Sun, 28 May 2023 06:42:29 +0000 (16:42 +1000)]
lib-renderline: Introduce word-wrap.

If word-wrap is set, make all spaces wrap-points, except at the start of
the line.
Enable this in email reading, and in mark-down.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoChange rules for doc:render-line with mark2
NeilBrown [Sun, 28 May 2023 02:34:01 +0000 (12:34 +1000)]
Change rules for doc:render-line with mark2

When doc:render-line is called with mark2, this doesn't interrupt the
rendering, but simply reports (via ->num in the callback) the offset
where mark2 was found.

Now ->num is either negative, or the number of chars to process.
NO_NUMERIC is no longer relevant and is not tested for.

I think this is simpler as ->num and ->mark2 are not independent.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorenderline: fix cursor pos after early wrap.
NeilBrown [Sun, 28 May 2023 02:16:21 +0000 (12:16 +1000)]
renderline: fix cursor pos after early wrap.

If a line wraps before he end, due to an early wrap marker, the cursor
will appear where it would have been if the line had been truncated
rather then wrapped.

We need to detect when a "flush" stopped because if found a wrap marker,
and to adjust the cursor pos in that case.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorenderline: ensure attr lists always start/end with ','
NeilBrown [Sun, 28 May 2023 00:22:46 +0000 (10:22 +1000)]
renderline: ensure attr lists always start/end with ','

Also make sure they *only* contains ",," at a location to pop back too.

Some of the code already put ',' at start, and most put ',' at end, and
some code depended on this more than others.
Make it more uniform.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agomark: separate mark:moving from mark:arrived
NeilBrown [Sat, 27 May 2023 07:46:18 +0000 (17:46 +1000)]
mark: separate mark:moving from mark:arrived

The mark:moving notification was originally for when a specific mark
moved at all.
For b64 I extended it to also notify when *any* mark moved to a specific
mark.
This can cause illegal nested notification if a mark:moving handler
tries to move a (non-specific) mark.  That is bad.

So separate the two: Add mark:arrived for when a mark is moved to a
flagged marks.

Also make sure all new marks aren't flagged.  I invert the sense of the
flag and call it "MARK_FLAG_WATCHED".  This will be clear by default,
and only set once the (renamed) mark_watch() is called.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m: filter out markup when extracting text
NeilBrown [Sat, 27 May 2023 00:39:59 +0000 (10:39 +1000)]
w3m: filter out markup when extracting text

Add a doc:content overlay on w3m docs which strip out markup and convert
html &entities;

Signed-off-by: NeilBrown <neil@brown.name>
2 years agopython: handle unterminated strings from doc-text
NeilBrown [Sat, 27 May 2023 00:37:51 +0000 (10:37 +1000)]
python: handle unterminated strings from doc-text

doc-text sends an unterminated string to the callback for doc:content.
Python doesn't handle this well.

So create a kludge:  If the key ends " unterminated", then use ->num2 as
a max length of ->str

Signed-off-by: NeilBrown <neil@brown.name>
2 years agocompose-email: don't intercept doc:char
NeilBrown [Fri, 26 May 2023 23:22:43 +0000 (09:22 +1000)]
compose-email: don't intercept doc:char

We only intercept doc:char to make the headers intangible.
Instead, catch mark:moving and keep point away from these.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agomarkup: quote '<' when they are interpolated from attr
NeilBrown [Fri, 26 May 2023 22:28:39 +0000 (08:28 +1000)]
markup: quote '<' when they are interpolated from attr

when map-attr provides a string to be interpolated, quote any '<' char
correctly.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: use mark:moving to avoid getting stuck in quoted lines
NeilBrown [Fri, 26 May 2023 22:14:13 +0000 (08:14 +1000)]
notmuch: use mark:moving to avoid getting stuck in quoted lines

Currently the 'point' can get stuck in hidden quoted-line and 'up'
movements get lost.
Use mark:moving (which is always sent on 'point') to see when this
happens, and to escape.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agodisplay-xcb - silence "may be uninitialised warning"
NeilBrown [Fri, 26 May 2023 10:10:48 +0000 (20:10 +1000)]
display-xcb - silence "may be uninitialised warning"

gcc cannot tell that x and y are only used if 'src', and they are
initialised if 'src' is set.  So help it out.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agopdf-to-text convert to delayed/async conversion
NeilBrown [Fri, 26 May 2023 09:57:24 +0000 (19:57 +1000)]
pdf-to-text convert to delayed/async conversion

pdf-to-text now happens asynchronously on demand

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m-to-text: convert to delayed/async processing.
NeilBrown [Fri, 26 May 2023 09:47:23 +0000 (19:47 +1000)]
w3m-to-text: convert to delayed/async processing.

If allowed, don't convert to text until requested.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agodoc-to-text: don't wait for conversion to complete.
NeilBrown [Fri, 26 May 2023 05:36:55 +0000 (15:36 +1000)]
doc-to-text: don't wait for conversion to complete.

If permitted by called, don't start the conversion to text until a
notification arrives.

This requires getting multipart to forward doc:replaced notifications.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agodoc-email: send a notification when a 'transformed' pane is made visible.
NeilBrown [Fri, 26 May 2023 09:07:14 +0000 (19:07 +1000)]
doc-email: send a notification when a 'transformed' pane is made visible.

We don't really want to process attachments until asked.  So allow the
transform tool to be notified when it is time.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: ensure reply and similar clear unread and new
NeilBrown [Fri, 26 May 2023 04:11:33 +0000 (14:11 +1000)]
notmuch: ensure reply and similar clear unread and new

Now that "new" is being cleared less aggressively, make sure we clear it
when we reply to a message.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoMove my personal configuration out of the git tree.
NeilBrown [Fri, 26 May 2023 03:48:50 +0000 (13:48 +1000)]
Move my personal configuration out of the git tree.

Have config.py load $HOME/.config/edlib/config.py, and move the config
that is specific to me into there.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agointroduce doc:append:...
NeilBrown [Fri, 26 May 2023 03:38:12 +0000 (13:38 +1000)]
introduce doc:append:...

doc:append: is similar to doc:set:, but the given value is appended to
the attr if it exists.
The value should start with a separator character, and this is removed
if it is the first item to be appended.

Use this to simplify setting of "view-default"

Signed-off-by: NeilBrown <neil@brown.name>
2 years agotextfill: default fill:end-re to fill:start-re
NeilBrown [Fri, 26 May 2023 03:22:26 +0000 (13:22 +1000)]
textfill: default fill:end-re to fill:start-re

The regexp for start and end of para are usually the same, so if end-re
isn't given, use the same as start-re.

Use this to simplify md config, and enhance it a bit.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agotext-fill: revert recent change when getting attributes.
NeilBrown [Thu, 25 May 2023 23:53:30 +0000 (09:53 +1000)]
text-fill: revert recent change when getting attributes.

Now the doc-attributes default to getting a pane-attribute, we don't
need the fall-back code in text-fill

Signed-off-by: NeilBrown <neil@brown.name>
2 years agodoc: add default doc:get-attr which returns pane attribute.
NeilBrown [Thu, 25 May 2023 23:47:35 +0000 (09:47 +1000)]
doc: add default doc:get-attr which returns pane attribute.

Sometimes we want an attribute which can vary with location in the document,
but offen i satisfied with a document-wide value.
fill:start-re is a good example.

Provide a default doc:get-attr, which will be called if no attr can be
found at the specific location.  This returns a pane attribute is
possible.

Also ensure all current doc:get-attr function fall through if they
cannot find a value.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: add K-X to show the extra headers
NeilBrown [Thu, 25 May 2023 21:07:29 +0000 (07:07 +1000)]
notmuch: add K-X to show the extra headers

Rather than requiring a mouse-click, use K-X to show the extra headers.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoUpdate some copyright dates.
NeilBrown [Mon, 22 May 2023 11:19:14 +0000 (21:19 +1000)]
Update some copyright dates.

.. because ... why not?

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoC code - remove stray LOG() calls.
NeilBrown [Mon, 22 May 2023 11:18:06 +0000 (21:18 +1000)]
C code - remove stray LOG() calls.

I don't think I want any of these.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agopython: remove stray edlib.LOG calls.
NeilBrown [Mon, 22 May 2023 11:14:40 +0000 (21:14 +1000)]
python: remove stray edlib.LOG calls.

There debugging calls got left in..

Signed-off-by: NeilBrown <neil@brown.name>
2 years agohandle text-fill in .md files better.
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agotextfile: copy prefix from most recent line.
NeilBrown [Mon, 22 May 2023 10:08:33 +0000 (20:08 +1000)]
textfile: copy prefix from most recent line.

When wrapping just the last line of a para, copy the prefix from that
line to the next.  This improves stability for ad-hoc formatting.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: include local-time as an extra header
NeilBrown [Mon, 22 May 2023 09:42:59 +0000 (19:42 +1000)]
notmuch: include local-time as an extra header

Determine timestamp in local time and add that as an extra header.
Also move thread-id to the end, so that all file names are together.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoncurses: fix transparent images in default color-space
NeilBrown [Mon, 22 May 2023 09:09:14 +0000 (19:09 +1000)]
ncurses: fix transparent images in default color-space

When fg/bg are the defaults, pair_content() doesn't provide us with
useful information, so we have to assume "white"-ish.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agosearch: avoid infinite look with inconsistent doc:step function.
NeilBrown [Mon, 22 May 2023 08:51:43 +0000 (18:51 +1000)]
search: avoid infinite look with inconsistent doc:step function.

If doc:step moves back further than we expect, search_backwards can loop
forever. So check for that possibility and abort.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoFix missed conversions from -2 to Efail.
NeilBrown [Mon, 22 May 2023 08:50:39 +0000 (18:50 +1000)]
Fix missed conversions from -2 to Efail.

When I changed from magic numbers to words, I missed this one.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoemail: support text display of some office docs.
NeilBrown [Sun, 21 May 2023 23:44:22 +0000 (09:44 +1000)]
email: support text display of some office docs.

 .doc  .docx  .odt

now get passed to lowriter for conversion to text.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agosearch: speed up backwards search.
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: add an 'advance' flag to turn on anchored search.
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agolib-search: fix bug with matching a pattern that ends at point
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel/c-mode/TODO: minor comment updates.
NeilBrown [Sun, 21 May 2023 11:06:38 +0000 (21:06 +1000)]
rexel/c-mode/TODO: minor comment updates.

Various minor non-code updates

Signed-off-by: NeilBrown <neil@brown.name>
2 years agocore: make it easy to disable timing when running under gdb.
NeilBrown [Sun, 21 May 2023 11:00:17 +0000 (21:00 +1000)]
core: make it easy to disable timing when running under gdb.

Under gdb, things don't happen fast, so we need to be able to disable
the "pane_too_long()" test.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: store wctype values directly in rxl array
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO.md: clean up
NeilBrown [Wed, 17 May 2023 09:15:10 +0000 (19:15 +1000)]
TODO.md: clean up

Remove a bunch of 'done' things - including some that weren't even
marked as done.
And fix typos etc.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: fix handling of sets for planes > 0
NeilBrown [Tue, 16 May 2023 21:15:19 +0000 (07:15 +1000)]
rexel: fix handling of sets for planes > 0

I wasn't including the plane number in the set size, or extracting and
using it.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: support unicode beyond 0x7ffff
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: properly initialise ->link array
NeilBrown [Tue, 16 May 2023 21:08:12 +0000 (07:08 +1000)]
rexel: properly initialise ->link array

->link[x][0] wasn't being initialised.  I wonder how this ever works.
valgrind wonders why I never asked it before.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO: move in a separate 'priorities' file.
NeilBrown [Mon, 15 May 2023 00:51:55 +0000 (10:51 +1000)]
TODO: move in a separate 'priorities' file.

For some reason I made a separate list of priorites a while ago.  Here
are the remaining one.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: rename RXL_ANCHORED and RXL_BACKTRACK to RXLF_*
NeilBrown [Sun, 14 May 2023 09:02:11 +0000 (19:02 +1000)]
rexel: rename RXL_ANCHORED and RXL_BACKTRACK to RXLF_*

The RXL_ prefix is used for flags to both rxl_prepare() and
rxl_advance(), which might be confusing.
So change the prepare flags to RXLF_ - RXL flag.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agotext: normalize marks before passing to content callback
NeilBrown [Fri, 19 May 2023 01:29:50 +0000 (11:29 +1000)]
text: normalize marks before passing to content callback

The mark that we pass to the content call-back must be normalised - or
bad things happen.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agodoc-text: text_check_consistent fixes
NeilBrown [Fri, 19 May 2023 01:28:39 +0000 (11:28 +1000)]
doc-text: text_check_consistent fixes

1/ Don't alter the document while checking - the "normalize" call must
  be on a local variable
2/ check for non-normalized marks when checking marks.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agotests: always specify EDLIB_RECORD with EDLIB_REPLAY
NeilBrown [Sat, 20 May 2023 00:47:12 +0000 (10:47 +1000)]
tests: always specify EDLIB_RECORD with EDLIB_REPLAY

'tests view' was behaving differently to other tests.  It seems to be
because EDLIB_RECORD was missing.  So let's add it.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoAvoid showing shell output when it requested an edit window
NeilBrown [Sat, 13 May 2023 02:13:07 +0000 (12:13 +1000)]
Avoid showing shell output when it requested an edit window

If a shell command is run which creates an edit window using lib-server,
we don't really want to show the output until the command completes.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoemacs: if shell command produces no output - say so.
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: simplify how 'new' tag is cleared
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorexel: add lax-searching for quotes.
NeilBrown [Sat, 13 May 2023 01:15:36 +0000 (11:15 +1000)]
rexel: add lax-searching for quotes.

In lax mode, all three ASCII quotes now much the same.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: handle display of alternatives that are multipart.
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m: Hide all of multiline tag
NeilBrown [Thu, 11 May 2023 23:49:39 +0000 (09:49 +1000)]
w3m: Hide all of multiline tag

Previously we were not hiding the newline in a multiline tag, so it
would appear as blank lines.

Extend markup:not_eol to ignore eol when rendering forward as well as
when moving backward, and use it in w3m to completely hide things.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoemail: ensure text parts always provide characters.
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m: reassert attrs at start of line properly
NeilBrown [Thu, 11 May 2023 04:42:48 +0000 (14:42 +1000)]
w3m: reassert attrs at start of line properly

The current code might reassert attrs inside the next tag.  We need to
find tags with no reference to line breaks, then look at newlines
between tags.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m: hide all of a multi-line tag
NeilBrown [Thu, 11 May 2023 04:37:30 +0000 (14:37 +1000)]
w3m: hide all of a multi-line tag

If a tag contains line breaks, we need to reassert the "hide" attribute
on each line.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agomarkup: fix normalisation of priorities.
NeilBrown [Thu, 11 May 2023 04:35:00 +0000 (14:35 +1000)]
markup: fix normalisation of priorities.

When I clipped priority to 0:65535, I didn't do it at all for
as_clear(), and not completely for as_add().

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m: only mark up html entities between tag.
NeilBrown [Thu, 11 May 2023 01:02:08 +0000 (11:02 +1000)]
w3m: only mark up html entities between tag.

html entities inside tags need to be invisible, so we don't want to mark
them at all.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agow3m: support ALL html entities
NeilBrown [Tue, 9 May 2023 21:44:04 +0000 (07:44 +1000)]
w3m: support ALL html entities

WE now have a list of all HTML entities.
Also fix handling of &#NNN; where NNN is decimal.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch/w3m: add more html entities
NeilBrown [Mon, 8 May 2023 11:43:15 +0000 (21:43 +1000)]
notmuch/w3m: add more html entities

Also ensure they get displayed...

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: avoid inconsistent value of thread_end
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.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoTODO - remove everything that is marked as done.
NeilBrown [Sun, 7 May 2023 06:36:10 +0000 (16:36 +1000)]
TODO - remove everything that is marked as done.

ta-done

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoncurses: display low-res images
NeilBrown [Sun, 7 May 2023 06:11:19 +0000 (16:11 +1000)]
ncurses: display low-res images

Each character cell can be 2 pixel.  This allows low-res image display.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agorender: disable background images for text displays
NeilBrown [Sun, 7 May 2023 05:40:35 +0000 (15:40 +1000)]
render: disable background images for text displays

If scale:M isn't set, then we cannot usefully do background images, so
don't even try.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoncurses: manage color pair separately from attributes.
NeilBrown [Sun, 7 May 2023 05:15:05 +0000 (15:15 +1000)]
ncurses: manage color pair separately from attributes.

When we combine the color pair in to the attributes we are limited to
255 pairs.  However we can pass it in separately and get many
more.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agomake: restore "replaceable" status for default search term
NeilBrown [Sun, 7 May 2023 02:00:00 +0000 (12:00 +1000)]
make: restore "replaceable" status for default search term

I find that I like the "replaceable" status... maybe it isn't so bad now
that the cursor is at the front.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agonotmuch: allow html even when we have plain text.
NeilBrown [Sun, 7 May 2023 01:49:48 +0000 (11:49 +1000)]
notmuch: allow html even when we have plain text.

Now that I have w3m doing a decent job of html display, use it in
preference to text/plain and see what I think.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoUse w3m to decode HTML in email messages
NeilBrown [Sun, 7 May 2023 01:45:16 +0000 (11:45 +1000)]
Use w3m to decode HTML in email messages

Use "w3m -halfdump" and parse out the remaining markup
to give bold and links etc.

Signed-off-by: NeilBrown <neil@brown.name>
2 years agoensure html decoding works over base64
NeilBrown [Sun, 7 May 2023 01:43:26 +0000 (11:43 +1000)]
ensure html decoding works over base64

b64 doesn't provide chars, just bytes.... Maybe it should get
a utf-8 overlay!!

Signed-off-by: NeilBrown <neil@brown.name>