]>
git.neil.brown.name Git - edlib.git/log
NeilBrown [Sun, 27 Aug 2023 00:16:42 +0000 (10:16 +1000)]
emacs-search: be careful to avoid infinite loop.
Assuming that 'm' moved if length > 1 isn't entirely safe.
It *should* be the case, but protecting against infinite loops
deserves belt *and* braces.
So add some extra checks, and test for a case that currently causes an
infinite loop
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 26 Aug 2023 22:49:58 +0000 (08:49 +1000)]
textfill: get prefix from regexp when appropriate.
Revise code for finding start of para so that if the regexp identifies a
prefix - rather than a whole line - we use that prefix to decide where
para starts, rather than skipping punctuation.
Also include trailing spaces of a prefix in the prefix for .md files.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 26 Aug 2023 00:30:02 +0000 (10:30 +1000)]
edlib.ini: discard stray \ quotes
The content found in .ini files does not support \ quoting, so the \\
results in to '\' which we don't want.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 26 Aug 2023 00:28:54 +0000 (10:28 +1000)]
rexel: support -B for backtrack testing.
Add -B option and improve usage() message.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 05:55:56 +0000 (15:55 +1000)]
Review Welcome text
*Welcome* text was getting old and irrelevant.
Also clean out all remaining triage, as they are all done.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 05:47:05 +0000 (15:47 +1000)]
diff: use correct file name in 'pre' mode.
When in 'pre' mode we need to go to the 'pre' file, not the post one.
So get the filename after '---'.
Also re-arrange some from the triage in the TODO file.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 05:32:27 +0000 (15:32 +1000)]
Change window-scaling to display-scaling
The emacs scaling commands now affect the whole display (window), not
just a single pane. This is more consistent.
It is done just by changing an attribute on the display pane.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 05:04:28 +0000 (15:04 +1000)]
Introduce generic Display:set:
Display:set: can be used to set any attribute on the display pane.
The attr name can be in str2, or following Display:set: in the key.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 04:56:48 +0000 (14:56 +1000)]
Change Display:set-noclose to Display:set:no-close and store in attribute.
Using an attribute to store the no-close string simplifies code, and
using "Display:set:" is similar to "doc:set:" and will soon be used to
set any attribute at the display level.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 03:48:07 +0000 (13:48 +1000)]
Get rid of attributes shift_left and shift-left
Add more meaning to render:wrap and discard shift-left and shift_left.
It was confusing having two ... or three ... attributes for almost the
same thing.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 01:38:28 +0000 (11:38 +1000)]
lib-renderline: fix problems with finding position of 'click' location.
This broken menus and links etc. So add a test for menus in the
spelling test.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 01:10:37 +0000 (11:10 +1000)]
Allow command name to be used to choose some data files.
The icon file, Welcome text, and initial config file are now chosen
based on the base name of the command being run.
So if "edlib" is copied to "elma", then "elma.ini" is used for config,
and "elma-icon.png" for an icon.
If the expected file isn't found, a file named for "edlib" is tried
instead.
This should make it easy to have have various commands providing
different interfaces.
elma - EMACS mode
elvi - VI mode
elnm - notmuch email reader
elpnt - presentation mode
eled - editor with A binding.
maybe.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 00:44:02 +0000 (10:44 +1000)]
Move welcome text into a separate file.
This makes it easier to edit the welcome text, and to have different
welcome text for different editors.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 00:31:30 +0000 (10:31 +1000)]
display-x11: load icon if available.
If edlib-icon.png can be found, load it as the icon for the X11 window.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 25 Aug 2023 00:30:15 +0000 (10:30 +1000)]
Move config file into new 'data' directory.
Also make lib/edlib point to data, not just to '..'.
This will allow the image files to be found with xdg-find-edlib-file/data.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 23 Aug 2023 03:43:10 +0000 (13:43 +1000)]
Add a logo
Currently it is just a few image files. Will do more one day.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Mon, 21 Aug 2023 11:41:18 +0000 (21:41 +1000)]
Introduce "Cancel" commands - K:ESC in emacs
"Cancel" is like "Abort", but softer.
Currently it cancels any active selection.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 21:48:46 +0000 (07:48 +1000)]
mode-emacs: improve path completion in shell commands
1/ Allow a ':' or '=' to identify where the path starts as long as it
starts '/'.
2/ Give message when directory cannot be opened or no completions can be
found.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 10:11:32 +0000 (20:11 +1000)]
lib-renderline: use foreach_attr() to parse image attrs.
This isn't a big win, but it is a bit nicer.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 10:00:33 +0000 (20:00 +1000)]
lib-renderline: discard cached-size attribute
We don't need an attribute for this, just store it in rline_data.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 09:45:16 +0000 (19:45 +1000)]
Fix "edlib -g"
Obviously this was never tested last time I made a change.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 06:45:54 +0000 (16:45 +1000)]
tests: add markup test
This test uses the new test-markup pane.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 06:35:02 +0000 (16:35 +1000)]
lib-renderline: create a new render-item whenever tab: is set.
I sometimes want tab: with no text - particularly to set wrap-margin.
So allow that.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 06:32:37 +0000 (16:32 +1000)]
lib-renderline: enhance cvt() to allow > in text attributes.
This is not particularly useful, but I wanted a '>' in a wrap-head for
testing, and I couldn't. So I made it possible.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 05:06:35 +0000 (15:06 +1000)]
lib-renderline: change right: margin to measure +ve from left.
now right-margin works like left and tabs. +ve is from left edge, -ve
is for right edge.
0 is different. It is right-edge for right margin, and left-edge for others.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 04:40:45 +0000 (14:40 +1000)]
lib-renderline: allow word-wrap setting via attributes.
Word-wrap is normally enabled for the whole pane. But making it
possible for individual lines might be useful, and certainly eases
testing.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 01:21:24 +0000 (11:21 +1000)]
tests: Allow extra data files to be used in tests.
Only files in tests.d that start with a digit are now considered to be
tests.
Other files are copied into DOC/extra in the test area for tests to
examine.
I put it DOC so that most tests don't see the extra entry in a directory
and so don't need to be changed. Only 02-presenter looks in DOC
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 01:18:44 +0000 (11:18 +1000)]
lib-renderline; fix double-cursors in display-x11
When a line wraps, display-x11 is showing cursor at end of one line and
start of next. Fix that.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 20 Aug 2023 01:10:53 +0000 (11:10 +1000)]
lib-renderline: fix up scaling of margin, vspace, tabs
left and right margins, and above/below space, and tab stops must be
scaled based on the font size - which we measure early. That already
includes the ->scale factor, so we mustn't include it again.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 19 Aug 2023 22:39:41 +0000 (08:39 +1000)]
lib-renderline: handle garbage better in cvt()
cvt() shouldn't assume a well-formatted string, and must always quite
when it sees EOL.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 19 Aug 2023 22:34:13 +0000 (08:34 +1000)]
display-ncurses: ignore focus changes better.
If we got a focus change message, 'buf' would be uninitialised and used.
So initialise it - and don't use it.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 19 Aug 2023 22:32:30 +0000 (08:32 +1000)]
display-ncurses: Improve attr parsing
Move the attr parsing code from lib-renderline into core-misc.c and
use it in display-ncurses to avoid using a fixed-size char array that we
never test for overflow.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 19 Aug 2023 22:14:06 +0000 (08:14 +1000)]
add lib-test-markup
lib-test-markup allows arbitrary markup to be provided to lib-renderline
for testing.
When enabled with "test-markup", each line of the document is treated as
verbatim markup
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 23:00:51 +0000 (09:00 +1000)]
render-lines: always give cursor offset when measuring cursor line
As presence of cursor can change size of appearance, we need to always
report where the cursor is when measuring the line.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 22:56:44 +0000 (08:56 +1000)]
lib-renderline: another wrapping fix.
If the wrap item is the part that won't it, need need to be caseful that
'x' hasn't been adjusted for xdiff yet.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 21:55:25 +0000 (07:55 +1000)]
tests: fix up "extend" and extend 00-basic
We now have a test in 00-basic which moves the cursor in and out of a
wrap field so that it appears and disappears. When it appears it
changes the number of displayed lines. This doesn't work properly.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 21:03:10 +0000 (07:03 +1000)]
history: add support for "favourites".
favourites can be configured for different history files.
A-n moves to favourites if not in history.
config file can now have "doc:FOO" sections for docs that don't have
file names.
A bug in doc:EOL is fixed
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 19:35:26 +0000 (05:35 +1000)]
lib-render: move tab/non-tab distinction out of find_xy()
The special handling of tabs is best kept in common code.
So move more into do_measure().
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 07:09:20 +0000 (17:09 +1000)]
render-line:measure now reports if the line ended properly
If the last line in a document doesn't end with a newline character, we
need to handle that interesting case.
Make it easier to do so.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 04:45:01 +0000 (14:45 +1000)]
merge-view: allow 9:A-m to both cut and paste.
If there is an active merge 9:A-m cuts it.
If there isn't but is a selection, 9:A-m will paste it.
Now if there is an active merge and a selection, 9:A-m will cut and
paste.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 04:30:25 +0000 (14:30 +1000)]
mergeview: adding merge to region needs full-lines in region
If the region isn't whole lines, make it so.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 04:19:48 +0000 (14:19 +1000)]
render-lines: avoid putting extra space at EOF for small pane
We normally add a bit of extra space at end-of-file.
I already had code to avoid this in small panes. But it wasn't working
as line_height_post hadn't been initialised usefully.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 04:04:42 +0000 (14:04 +1000)]
emacs-search: don't try to replace same string twice
:A:Enter replaces but stays in same place. Repeating the command causes
the replacement to be attempted again, which is bad if orig and new are
different length.
So detect and prevent this.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 03:45:07 +0000 (13:45 +1000)]
README: delete all "Done" items.
It was all getting too noisy.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 18 Aug 2023 03:43:22 +0000 (13:43 +1000)]
lib-renderline - lots of cleanup
Review all non-image code and clean things up in various ways.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 16 Aug 2023 21:59:35 +0000 (07:59 +1000)]
lib-renderline: only measure line when needed
Before performing measure_line work, check if any of the inputs have
changed.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 16 Aug 2023 09:20:09 +0000 (19:20 +1000)]
lib-renderlines: clean up left_margin handling.
In particular the wrap_margin must initially be based on the left margin.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 15 Aug 2023 12:18:18 +0000 (22:18 +1000)]
rexel: fix bug with capturing groups.
The post-parse editing of group matches to put all the right branches
in place was messing up capture requests.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 15 Aug 2023 12:07:09 +0000 (22:07 +1000)]
messageline: full right-align date/time
Now that I can fully right-align without wrapping, do it for the time in
the message line.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 15 Aug 2023 12:02:37 +0000 (22:02 +1000)]
tests: add a faster version of refresh.
Doing it "fast" often works, so allow that as an option.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 15 Aug 2023 11:47:22 +0000 (21:47 +1000)]
lib-renderline allow rtab to avoid line wraps.
If rtab is used, don't wrap if last char is at right edge.
If no rtab, continue to wrap so there is somewhere for cursor to be.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 15 Aug 2023 10:06:39 +0000 (20:06 +1000)]
lib-renderline: various wrapping fixed.
In particular, the subject line in notmuch summary lines wraps properly
now.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Mon, 14 Aug 2023 02:27:40 +0000 (12:27 +1000)]
lib-renderline: Fix length of split section in do_draw()
Need to subtract start from the end to get the length.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Mon, 14 Aug 2023 00:03:36 +0000 (10:03 +1000)]
lib-renderlines: erase before drawing an image
I lost the Draw:clear for images, so they get drawn on the wrong pane
and end up as background.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 23:13:55 +0000 (09:13 +1000)]
TODO updates.
What still needs to be done for lib-renderline...
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 09:54:00 +0000 (19:54 +1000)]
lib-renderline: move tab handling into do_measure()
This makes do_measure() more like do_draw()
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 09:37:04 +0000 (19:37 +1000)]
lib-renderline: pass ri to do_measure()
Pass in the ri, and don't bother passing the attr which is always
ri->attr.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 09:32:18 +0000 (19:32 +1000)]
lib-renderline: introduce measure_str() for simple string measurement.
This makes a clean separation leaving do_measure() only for text in
->line.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 09:25:05 +0000 (19:25 +1000)]
lib-renderline: don't pass scale to do_measure()
instead of passing scale, extra rd from p and use that to find scale.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 09:21:44 +0000 (19:21 +1000)]
lib-renderlines: pass split to do_draw() instead of str/len/tab_cols.
I think this removes most of the ugliness.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 06:30:55 +0000 (16:30 +1000)]
lib-renderline; pass ri to do_draw instead of ri->attr
I'll use more from ri soon, for now just pass it in and use the ->attr.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 06:25:55 +0000 (16:25 +1000)]
lib-renderline: factor out draw_wrap()
Drawing the line-wrap markers doesn't need all the complexity of
do_draw(), so factor it out into a separate function.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 06:21:15 +0000 (16:21 +1000)]
lib-renderline: add ->ascent inside do_draw()
Instead of all callers of do_draw() needing to add ->ascent,
add it inside do_draw().
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 03:41:39 +0000 (13:41 +1000)]
lib-renderline: drop scale arg to do_draw()
We can find the scale from rline_data which we can find from the pane.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 13 Aug 2023 03:35:42 +0000 (13:35 +1000)]
lib-renderline change rl vars to ri
rl vars which used to be for render-line are now for render-item,
so rename to ri.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 11 Aug 2023 07:20:26 +0000 (17:20 +1000)]
massive lib-renderline rewrite
This now passes my tests - after adjusting some tests.
lib-renderline is totally different. Parsing and processing are now
distinct steps. Hopefully this will make it easier to work with in
future, though it is still very rough in places, particularly with
handling for \t tabs.
I need to go through it several times and clean stuff up, but at least I
now have a credible base to work on.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 11 Aug 2023 05:51:03 +0000 (15:51 +1000)]
renderline - fix margin for tab.
For some strange reason, tabs were wrapping before other chars.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 11 Aug 2023 04:52:36 +0000 (14:52 +1000)]
Don't show default wrap tail for requested wrap point.
Requested wrap points suggest wrap is expected, so don't show the
wrap tail. I think it is ugly.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 11 Aug 2023 01:47:54 +0000 (11:47 +1000)]
tile: silence use-before-set warning.
"remain" is only used if "remaining" is not zero, so it will be set
before used. But compiler cannot see that. Help it out.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 9 Aug 2023 01:05:46 +0000 (11:05 +1000)]
messageline: don't ask for cursor on render-line
To avoid asking of a cursor, we need to pass -1.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 9 Aug 2023 01:04:35 +0000 (11:04 +1000)]
render-lines: pass focus to vmark_set()
Good practice is to always send the focus.
We will need this to get the prefix at 'set' time.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 9 Aug 2023 01:01:03 +0000 (11:01 +1000)]
history: use A-r rather than C-R for search
Using C-R and particularly C-S break search-replace because I can no
longer search-again from the replace box (which has history).
So switch to A-r A-s.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 9 Aug 2023 00:56:23 +0000 (10:56 +1000)]
lib-input - don't assume Efallthrough is 0
One day I might change Efallthrough..
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 9 Aug 2023 00:52:17 +0000 (10:52 +1000)]
ncurses: catch and ignore focus-in/out
focus-in/out comes in as unknown key at awkward times causing problems
for C-l and the refresh causes a focus-out.
So catch and ignore for now.
Also log any unrecognised keys so I can try to handle them.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Aug 2023 22:49:22 +0000 (08:49 +1000)]
Change pane_resize() to return Bool
pane_resize() now reports if any change happened.
One caller wants this.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Aug 2023 23:52:41 +0000 (09:52 +1000)]
render-lines: factor out code in revalidate_start()
revalidate start considers 3 cases when the point is on the line. Each
of these checks if the point is on the line.
Factor out that test and other code so that 3 (or 4) cases can focus on
their particular issue.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Aug 2023 22:44:02 +0000 (08:44 +1000)]
render-lines: call_render_line_to_point never returns error
Don't test for call_render_line_to_point returning < 0, as it doesn't.
Don't even test for == 0. That is a valid answer and we no longer call
call_render_line_to_point() in a situation where that causes problems.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Aug 2023 23:17:13 +0000 (09:17 +1000)]
render-lines: don't look for point in line where it isn't.
call_render_line_to_point() doesn't return an error, so calling
it when point isn't on the line isn't well defined.
So don't do it.
This changes the number of blank lines after end-of-file, which I think
I am happy with, so self-tests change.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Aug 2023 22:27:38 +0000 (08:27 +1000)]
lib-server: fix a couple of typos
I mustn't be using this code enough because these should be obvious.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Tue, 8 Aug 2023 22:25:32 +0000 (08:25 +1000)]
minor unalloc improvements.
unalloc can now free 'const' pointers, and strings.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 5 Aug 2023 09:00:52 +0000 (19:00 +1000)]
renderline: change render-line:measure to return the cursor attributes.
Rather than saving the attributes at the cursor to be returned later,
return them directly from render-line:measure.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 4 Aug 2023 23:56:59 +0000 (09:56 +1000)]
renderline: change render-line:findxy to return the attributes
Rather then remembers the attributes to be collected later with a
get:attr, return the attributes in a comm2 callback for immediate use.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 4 Aug 2023 23:21:04 +0000 (09:21 +1000)]
lib-renderline: change to use embedded pane data
The rline_data is now embedded in the pane.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Wed, 2 Aug 2023 21:10:31 +0000 (07:10 +1000)]
minor change to xcb drawing and scaling
1/ ask for "monospace", not "mono"
2/ default to 12 point
3/ scale up and down by same ratio. use 1.2 like others
4/ fix font_description size calc, which was weird.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 28 Jul 2023 06:09:11 +0000 (16:09 +1000)]
compose-email: check for needed headers:
Don't sent the messages unless there is at least
- From:
- Subject:
- To: or Cc:
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 28 Jul 2023 05:59:24 +0000 (15:59 +1000)]
discard commcache.
The idea here was to accelerate repeated calls to the one request, so we
didn't need to repeat the search up the pane tree, or for the comm in
the keymap.
However I since decided that it is generally best to avoid repeated
calls like this, and mostly we do.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 27 Jul 2023 11:32:07 +0000 (21:32 +1000)]
Avoid null pointer deref when ccache used.
This can make ->home NULL which times_up() no trips over.
I should probably discard this ccache stuff.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 27 Jul 2023 10:32:59 +0000 (20:32 +1000)]
emacs: support shows shell output in a popup.
With a prefix arg of 0 or 1, shellcmd still interpolates the output into
the current buffer.
With a prefix arg of 4, it now shows the output in a popup window, like
visiting a file with
Cx 4 4 f
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 27 Jul 2023 06:33:29 +0000 (16:33 +1000)]
Factor out list sorting into list.h
No point having two copies of the same code.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Thu, 27 Jul 2023 06:23:00 +0000 (16:23 +1000)]
renderline: calculate curs_width even when only a prefix is displayed.
Also make sure that the size we shift is always at least 1 - else it
loops forever.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Mon, 24 Jul 2023 11:31:02 +0000 (21:31 +1000)]
mode-emacs: allow cx-} and cx-{ to be repeated with single char.
Just like cx-< etc
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Mon, 24 Jul 2023 11:21:23 +0000 (21:21 +1000)]
lib-renderline: fix handling of truncation.
When looking for a bug in wrap-mode I found this bug in non-wrap mode.
But I cannot reproduce the first bug any more.
Weird.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Mon, 24 Jul 2023 11:17:51 +0000 (21:17 +1000)]
Don't initialise ->data in pane_init()
There may not be a ->data any more, and the caller initialises this if needed.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 23 Jul 2023 23:04:16 +0000 (09:04 +1000)]
Rename _CALL _VFUNC _VFUNC_
All names that start underscore followed by capital letter are reserved
by C library. So stop using them.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sun, 23 Jul 2023 22:59:39 +0000 (08:59 +1000)]
Avoid using names with "__" prefix.
Names prefixed with "__" are reserved for use by the C library.
For global names, use "do_" instead.
For local name, use a single "_".
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 22 Jul 2023 02:45:51 +0000 (12:45 +1000)]
Add doc:list-sort and sort command name for completion.
doc:list-sort can sort entries in a doc-list based on an attribute of
choice.
emacs command listing uses this.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 22 Jul 2023 02:42:54 +0000 (12:42 +1000)]
emacs: use doc-list for command name completion.
doc-list is good for this sort of thing.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 22 Jul 2023 02:06:44 +0000 (12:06 +1000)]
Change times_up() to use pane_too_long() on root.
Also check for debugger in all pane_too_long() calls.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Sat, 22 Jul 2023 01:37:38 +0000 (11:37 +1000)]
Don't impose time limits when run under a debugger
Single-stepping in the debug can make things take much longer. We
shouldn't let that change behaviour or debugging becomes harder.
So detect debugger and skip the timing.
Signed-off-by: NeilBrown <neil@brown.name>
NeilBrown [Fri, 21 Jul 2023 10:34:50 +0000 (20:34 +1000)]
compose-email: use menu for address completion
Rather than having 'tab' cycle through addresses, drop down a menu to
choose from.
Signed-off-by: NeilBrown <neil@brown.name>