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.
NeilBrown [Mon, 30 Jan 2023 04:30:11 +0000 (15:30 +1100)]
doc-email: clear charset when not used.
If the charset variable is not being used, its value becomes stale, and
copying it to a pane attr causes corruption. This results in non-utf8
being passed to pango_layout_set_text()
NeilBrown [Mon, 30 Jan 2023 02:36:02 +0000 (13:36 +1100)]
Track XAUTHORITY with DISPLAY
XAUTHORITY is collected when edlib starts, and is passed in by the
server/client. It is recorded on the display pane and used for starting
new displays and for running external viewers
NeilBrown [Sun, 13 Nov 2022 07:43:56 +0000 (18:43 +1100)]
popup: allow direct placement
A new mode flag 'x' allows the location of the popup to be explicitly
requested, and means that the location and size can later be changed by
the owner.
NeilBrown [Sun, 13 Nov 2022 07:31:30 +0000 (18:31 +1100)]
Add ref-counting for panes
New pane_get() and pane_put() make it possible to ensure a pane is not
freed while a reference is held. This is used by python to stop bad
code from crashing when holding an old ref to a pane.
The pane can be closed and the ->data can be freed, but the pane object
itself will remain so that it can be safely tested to see if it is valid.
notmuch: keep point nearby when returning from whole-thread
If, while viewing a whole thread, point is moved to EOF, then when we
switch back we don't want it to stay at EOF, we want it to be at
thread_end, or similar.
So we need to clip anything after thread_end upwards.
Clip doesn't move marks *at* the end point, so we need to make our eof
look just a little bit different temporarily.
render-format when used with shared-ref requires that EOF is marked by a
NULL pos. So when we step to the end of the thread, we need to move the
mark all the way to true EOF to get that NULL pos.
Python: allow bool to be passed to .clip and .to_end
These really take bools: for clip a true value means move to start, not
end.
For .to_end, a true value means move to end, not start.
Yes, that is confusing.
This still allows integers to be passed, but also allows any truth value.
present: allow switching to presentation from markdown
:Commit (:C-c :C-c) will now switch markdown view to presenter view.
This is a bit clumsy as we have to ensure now markup (like spell errors)
can mess things up for us.
Various bugs in pos tracking.
Particularly, for the content callback the mark is moved lower in the
stack so the pos isn't automatically updated - we have to update it in
the callback.
If a key/mouse event takes longer than 15 seconds, all calls start
failing.
This may well cause some code to misbehave... I should find and clean up
such code.
base64: improve how current position is determined.
Now that we can track mark movements including to_mark, use that to
maintain a 'b64-pos' attr on any mark so that we know where in a QUAD it
is. This makes finding current location much more efficient.
mark: allow extra tracking of mark_to_mark movements.
If a mark is being tracked, and mark_ack() was called last time it
moved, then when any mark is moved to that mark, track it as well.
This way marks move into a range can start being tracked.
The "point:moving" event is now called "mark:moving" and the "moved"
flag is now stored in every mark. This is a first step towards
supporting movement events on all marks.
NeilBrown [Sat, 28 May 2022 23:37:49 +0000 (09:37 +1000)]
Add Draw:image-size and don't upscale images in emails.
New display function Draw:image-size reports the size of an image in
(x,y).
This is used when drawing an image with new attr noupscale to
ensure the size of the image is never scaled up, only down.