]> git.neil.brown.name Git - edlib.git/log
edlib.git
10 years agotlist_for_each{,_entry}_continue* no longer need head of list.
NeilBrown [Thu, 26 Nov 2015 23:40:39 +0000 (10:40 +1100)]
tlist_for_each{,_entry}_continue* no longer need head of list.

We can use the type information to stop at the right place.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove unused function point_reset
NeilBrown [Thu, 26 Nov 2015 23:31:44 +0000 (10:31 +1100)]
Remove unused function point_reset

Signed-off-by: NeilBrown <neil@brown.name>
10 years agosimplify/improve mark-at-point functions.
NeilBrown [Thu, 26 Nov 2015 23:26:56 +0000 (10:26 +1100)]
simplify/improve mark-at-point functions.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoPass pane to doc_set_attr instead of using pt->doc;
NeilBrown [Thu, 26 Nov 2015 22:35:18 +0000 (09:35 +1100)]
Pass pane to doc_set_attr instead of using pt->doc;

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove ->owner field from point.
NeilBrown [Thu, 26 Nov 2015 22:18:49 +0000 (09:18 +1100)]
Remove ->owner field from point.

No longer needed.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoPoints: allocate list of links separately.
NeilBrown [Thu, 26 Nov 2015 22:10:16 +0000 (09:10 +1100)]
Points: allocate list of links separately.

It was just too much hassle having a single allocation and managing
a single pointer to a point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove ci->pointp
NeilBrown [Thu, 26 Nov 2015 07:11:36 +0000 (18:11 +1100)]
Remove ci->pointp

Now completely gone.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointless doc and pointp from emacs_file_complete and emac_doc_complete
NeilBrown [Thu, 26 Nov 2015 07:07:12 +0000 (18:07 +1100)]
Remove pointless doc and pointp from emacs_file_complete and emac_doc_complete

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoemacs_findfile: use pane_attr_get instead of doc_attr.
NeilBrown [Thu, 26 Nov 2015 07:04:32 +0000 (18:04 +1100)]
emacs_findfile: use pane_attr_get instead of doc_attr.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoemacs_kill_doc - no pointp
NeilBrown [Thu, 26 Nov 2015 07:00:06 +0000 (18:00 +1100)]
emacs_kill_doc - no pointp

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove last pointp from render-lines
NeilBrown [Thu, 26 Nov 2015 06:57:59 +0000 (17:57 +1100)]
Remove last pointp from render-lines

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoStop using pointp for Move-View-Pos
NeilBrown [Thu, 26 Nov 2015 06:56:09 +0000 (17:56 +1100)]
Stop using pointp for Move-View-Pos

Signed-off-by: NeilBrown <neil@brown.name>
10 years agocomplete_return doesn't need pointp either.
NeilBrown [Thu, 26 Nov 2015 06:44:11 +0000 (17:44 +1100)]
complete_return doesn't need pointp either.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange complete_set_prefix to no need direct access to point/doc
NeilBrown [Thu, 26 Nov 2015 06:42:30 +0000 (17:42 +1100)]
Change complete_set_prefix to no need direct access to point/doc

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp usage from emacs insert/delete commands.
NeilBrown [Thu, 26 Nov 2015 06:21:06 +0000 (17:21 +1100)]
Remove pointp usage from emacs insert/delete commands.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp usage from a lot of Move-* calls.
NeilBrown [Thu, 26 Nov 2015 06:14:08 +0000 (17:14 +1100)]
Remove pointp usage from a lot of Move-* calls.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove doc arg from mark_to_mark.
NeilBrown [Thu, 26 Nov 2015 06:10:50 +0000 (17:10 +1100)]
Remove doc arg from mark_to_mark.

It isn't really neded.
We can easily remove doc from doc_next_mark_all() as it isn't used.
We can also have a version of doc_prev_mark_all() that only gets
called when we *know* there is a previos mark, as we do ni mark_to_mark.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoSend point as ci->mark for events from keyboard or mouse.
NeilBrown [Thu, 26 Nov 2015 05:52:43 +0000 (16:52 +1100)]
Send point as ci->mark for events from keyboard or mouse.

I am deprecating ->pointp, but sometimes I need that mark.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoDon't set pointp for "Replace"
NeilBrown [Thu, 26 Nov 2015 05:38:17 +0000 (16:38 +1100)]
Don't set pointp for "Replace"

no replace function uses it anymore.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange "Refresh" function to pass 'point' via ci->mark.
NeilBrown [Thu, 26 Nov 2015 05:10:15 +0000 (16:10 +1100)]
Change "Refresh" function to pass 'point' via ci->mark.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange render-line command to accept point in 'mark2' instead of 'ptp'.
NeilBrown [Thu, 26 Nov 2015 04:36:02 +0000 (15:36 +1100)]
Change render-line command to accept point in 'mark2' instead of 'ptp'.

And get rid of point pointp stuff.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp arg for render-line-prev
NeilBrown [Thu, 26 Nov 2015 04:22:10 +0000 (15:22 +1100)]
Remove pointp arg for render-line-prev

We only needed the doc, and we can get that from the pane.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoStop using pointp in text_reundo and text_replace.
NeilBrown [Thu, 26 Nov 2015 04:12:45 +0000 (15:12 +1100)]
Stop using pointp in text_reundo and text_replace.

use home->data and home->point instead.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext_reundo: rename 'm' to 'm2'.
NeilBrown [Thu, 26 Nov 2015 04:11:53 +0000 (15:11 +1100)]
text_reundo: rename 'm' to 'm2'.

I want to introduce a more global 'm'.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMove final doc default actions from 'view' to 'doc'.
NeilBrown [Thu, 26 Nov 2015 03:58:06 +0000 (14:58 +1100)]
Move final doc default actions from 'view' to 'doc'.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoImprove default move-file
NeilBrown [Thu, 26 Nov 2015 03:50:46 +0000 (14:50 +1100)]
Improve default move-file

Instead of moving one char at a time, just jump to the right end.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoNow that move_X is in core-doc, remove the pointp references.
NeilBrown [Thu, 26 Nov 2015 03:39:01 +0000 (14:39 +1100)]
Now that move_X is in core-doc, remove the pointp references.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agomove simple word/char/eol/file movement from 'view' to 'doc'.
NeilBrown [Thu, 26 Nov 2015 03:34:01 +0000 (14:34 +1100)]
move simple word/char/eol/file movement from 'view' to 'doc'.

I think it makes more sense here.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoremove two pointp users from emacs-search.
NeilBrown [Thu, 26 Nov 2015 03:18:16 +0000 (14:18 +1100)]
remove two pointp users from emacs-search.

Just use doc_replace to trigger a refresh.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove render-dir and render-text
NeilBrown [Thu, 26 Nov 2015 02:16:28 +0000 (13:16 +1100)]
Remove render-dir and render-text

Increasingly dead-weight.  Now that we have render-lines and
render-format, these can go.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agouse doc_get_pane to get document for render-format movement.
NeilBrown [Thu, 26 Nov 2015 02:12:30 +0000 (13:12 +1100)]
use doc_get_pane to get document for render-format movement.

Removes another pointp user

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp from render_hex_eol.
NeilBrown [Thu, 26 Nov 2015 02:07:48 +0000 (13:07 +1100)]
Remove pointp from render_hex_eol.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse panes and marks to communicate with CountLines
NeilBrown [Thu, 26 Nov 2015 01:57:04 +0000 (12:57 +1100)]
Use panes and marks to communicate with CountLines

so no more pointp;

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoDo for dir_close what we did for docs_bury.
NeilBrown [Thu, 26 Nov 2015 01:46:23 +0000 (12:46 +1100)]
Do for dir_close what we did for docs_bury.

It really is the same thing.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp setting from mark_same_pane
NeilBrown [Thu, 26 Nov 2015 01:45:10 +0000 (12:45 +1100)]
Remove pointp setting from mark_same_pane

completely pointless

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp usage from text_save_file and text_get_str
NeilBrown [Thu, 26 Nov 2015 01:41:20 +0000 (12:41 +1100)]
Remove pointp usage from text_save_file and text_get_str

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoNotfiy:Replace doesn't need pointp any more.
NeilBrown [Thu, 26 Nov 2015 01:35:42 +0000 (12:35 +1100)]
Notfiy:Replace doesn't need pointp any more.

So discard it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse "Notify:Replace" for notifications.
NeilBrown [Thu, 26 Nov 2015 01:32:19 +0000 (12:32 +1100)]
Use "Notify:Replace" for notifications.

We currently use "Notify" both to make changes and to notify
of changes.
This can be confusion - they are different tasks needing different names.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agodocs_destroy - avoid pointp.
NeilBrown [Thu, 26 Nov 2015 01:25:26 +0000 (12:25 +1100)]
docs_destroy - avoid pointp.

Use doc_get_pane instead.

Maybe I should be sending a message....

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:destroy to work with pane rather than point.
NeilBrown [Thu, 26 Nov 2015 01:09:15 +0000 (12:09 +1100)]
Change doc:destroy to work with pane rather than point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pane_point.
NeilBrown [Thu, 26 Nov 2015 01:06:40 +0000 (12:06 +1100)]
Remove pane_point.

Only one called remains, so open-code it there.

That caller should eventually go too.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove dependence of search on pane_point.
NeilBrown [Thu, 26 Nov 2015 01:02:56 +0000 (12:02 +1100)]
Remove dependence of search on pane_point.

This requires PointDup being able to provide a simple mark,
and a new function to find the document pane.

Signed-off-by: NeilBrown <neil@brown.name>
10 years ago"Close" no longer needs pane_point.
NeilBrown [Thu, 26 Nov 2015 00:46:07 +0000 (11:46 +1100)]
"Close" no longer needs pane_point.

render_lines was the last users, and it now uses panes for vmarks.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange vmark functions to take a pane instead of a document.
NeilBrown [Thu, 26 Nov 2015 00:34:47 +0000 (11:34 +1100)]
Change vmark functions to take a pane instead of a document.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange vmark_matching to take a pane rather than a doc.
NeilBrown [Thu, 26 Nov 2015 00:08:51 +0000 (11:08 +1100)]
Change vmark_matching to take a pane rather than a doc.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRender-attach functions no-longer need the pane_point.
NeilBrown [Wed, 25 Nov 2015 23:21:11 +0000 (10:21 +1100)]
Render-attach functions no-longer need the pane_point.

So discard it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc_{add,del,find}_view into commands.
NeilBrown [Wed, 25 Nov 2015 23:14:24 +0000 (10:14 +1100)]
Change doc_{add,del,find}_view into commands.

they get send to the document instead of having to find it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRegister keymaps early rather than late.
NeilBrown [Wed, 25 Nov 2015 23:11:04 +0000 (10:11 +1100)]
Register keymaps early rather than late.

The more we use them, the more careful we must be.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange mark_same to key off tile rather than point.
NeilBrown [Wed, 25 Nov 2015 22:48:48 +0000 (09:48 +1100)]
Change mark_same to key off tile rather than point.

Thus remove pointp reference from render-lines-notify

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoHave all "render-line" function fail cleanly if point/mark are NULL.
NeilBrown [Wed, 25 Nov 2015 22:36:49 +0000 (09:36 +1100)]
Have all "render-line" function fail cleanly if point/mark are NULL.

This makes it a bit cleaner to find the render-line pane with a void call.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoProvide a "Move-to" command to use e.g. when completing a search.
NeilBrown [Wed, 25 Nov 2015 22:27:37 +0000 (09:27 +1100)]
Provide a "Move-to" command to use e.g. when completing a search.

Better than direct access to point_to_mark().

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange default_render from a struct field to an attribute.
NeilBrown [Wed, 25 Nov 2015 22:15:51 +0000 (09:15 +1100)]
Change default_render from a struct field to an attribute.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse Move-File to move to start of a newly created document.
NeilBrown [Wed, 25 Nov 2015 22:10:16 +0000 (09:10 +1100)]
Use Move-File to move to start of a newly created document.

This is cleaner than moving the point directly

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext: fit bug with text deletion.
NeilBrown [Wed, 25 Nov 2015 21:47:07 +0000 (08:47 +1100)]
text: fit bug with text deletion.

I wasn't quite leaving things is a good state.
I think this is better - as this ref no longer over-takes
a follow ref that won't be relocated.
But I really need to review this code.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoemacs: use pane_final_child rather than pane_point.
NeilBrown [Wed, 25 Nov 2015 09:46:37 +0000 (20:46 +1100)]
emacs: use pane_final_child rather than pane_point.

This is (now) a suitable place to attach attributes.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoIntroduce doc:set-name
NeilBrown [Wed, 25 Nov 2015 09:38:37 +0000 (20:38 +1100)]
Introduce doc:set-name

Use this variously in mode-emacs to avoid pane_point calls.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove pointp from render_format_attach
NeilBrown [Wed, 25 Nov 2015 09:23:47 +0000 (20:23 +1100)]
Remove pointp from render_format_attach

Not used.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse the new "ThisPane" to find pane to load new doc/file.
NeilBrown [Wed, 25 Nov 2015 09:15:13 +0000 (20:15 +1100)]
Use the new "ThisPane" to find pane to load new doc/file.

Makes the code nicer too.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoIntroduce ThisPane
NeilBrown [Wed, 25 Nov 2015 08:52:38 +0000 (19:52 +1100)]
Introduce ThisPane

This is similar to "OtherPane" but find the current tile.

popup uses this if it want to make a popup that is over a doc instead of
over the display.

This removes another use of ->point

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoIntroduce PointDup command
NeilBrown [Wed, 25 Nov 2015 07:58:05 +0000 (18:58 +1100)]
Introduce PointDup command

This make it possible to get a dup of point without
explicitly finding the point. Makes it more indirect.

You this in 'search' to avoid hunting up the tree.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoDon't make new point directly in doc_attach
NeilBrown [Wed, 25 Nov 2015 07:48:19 +0000 (18:48 +1100)]
Don't make new point directly in doc_attach

sometimes we want point_new sometimes point_dup

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoSplit a 'doc' pane aways from the 'view' panes.
NeilBrown [Wed, 25 Nov 2015 07:21:27 +0000 (18:21 +1100)]
Split a 'doc' pane aways from the 'view' panes.

They really are different things.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agouse new doc_attach_view for attaching "view"
NeilBrown [Wed, 25 Nov 2015 05:35:52 +0000 (16:35 +1100)]
use new doc_attach_view for attaching "view"

This is a common task and it is good to centralize it.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoSplit doc_attach_view from doc_open.
NeilBrown [Wed, 25 Nov 2015 05:31:31 +0000 (16:31 +1100)]
Split doc_attach_view from doc_open.

It is silly combining these two functions with very different results.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agouse pane and mark to pass document to doc:set-attr
NeilBrown [Wed, 25 Nov 2015 04:59:09 +0000 (15:59 +1100)]
use pane and mark to pass document to doc:set-attr

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:get-attr to use a pane rather than a point.
NeilBrown [Wed, 25 Nov 2015 04:55:39 +0000 (15:55 +1100)]
Change doc:get-attr to use a pane rather than a point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse doc_notify_change rather than point_notify_change were possible.
NeilBrown [Wed, 25 Nov 2015 04:54:06 +0000 (15:54 +1100)]
Use doc_notify_change rather than point_notify_change were possible.

This gives more flexibility going forward.

Make sure doc_notify_change is just as fast when a point is provided.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse pane rather then point to pass doc to doc:step
NeilBrown [Wed, 25 Nov 2015 04:41:51 +0000 (15:41 +1100)]
Use pane rather then point to pass doc to doc:step

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse pane instead of point to pass doc to "Release"
NeilBrown [Wed, 25 Nov 2015 04:37:32 +0000 (15:37 +1100)]
Use pane instead of point to pass doc to "Release"

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:set-ref to take a pane rather than a point.
NeilBrown [Wed, 25 Nov 2015 04:32:37 +0000 (15:32 +1100)]
Change doc:set-ref to take a pane rather than a point.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc_find to return a pane.
NeilBrown [Wed, 25 Nov 2015 03:38:15 +0000 (14:38 +1100)]
Change doc_find to return a pane.

That fits the pattern better.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove the document list and use a list of panes instead.
NeilBrown [Wed, 25 Nov 2015 03:19:10 +0000 (14:19 +1100)]
Remove the document list and use a list of panes instead.

The 'null display' (ed->root.focus) is now the parent of multiple
panes, each of which owns a document (->data) with a backlink
(doc->home->data == doc).

Now in many places we pass around this pane instead of a point when we
just want to identify a document and not a location in the document.
This means we don't need to allocate points so much, or fake up
temporary ones.

doc_attach() must be used at document creation to attach a document to
the tree.

So
 - "*Documents*" watches this list of siblings rather than the original list.
 - commands can be sent to these panes using key_handle_focus.  Some
   doc commands can be sent to any pane.
 - doc creation returns the pane of the document in ci->focus
   rather than a fake point
     e.g. same_file, load_file

 - pane_attach() takes a pane, not a point.
 - doc_open no-longer needs a gross hack
 - editor_choose_doc returns a pane, and so doesn't need a point.
 - popup holds the doc pane, not a point.

etc.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange 'editor' to be the root of the pane tree.
NeilBrown [Tue, 24 Nov 2015 22:36:50 +0000 (09:36 +1100)]
Change 'editor' to be the root of the pane tree.

Displays are all children of that root.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc:reundo and doc:get-str to use the pane-path.
NeilBrown [Tue, 24 Nov 2015 21:59:45 +0000 (08:59 +1100)]
Change doc:reundo and doc:get-str to use the pane-path.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agosend "doc:replace" up the pane path
NeilBrown [Tue, 24 Nov 2015 21:45:10 +0000 (08:45 +1100)]
send "doc:replace" up the pane path

Reduces need for passing points and documents around.
There will be more of this.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext: fix bug with refresh when text added to start of first line.
NeilBrown [Tue, 24 Nov 2015 21:23:25 +0000 (08:23 +1100)]
text: fix bug with refresh when text added to start of first line.

The return value didn't match the comment...

Signed-off-by: NeilBrown <neil@brown.name>
10 years agotext: fix undo/redo bug.
NeilBrown [Tue, 24 Nov 2015 21:12:29 +0000 (08:12 +1100)]
text: fix undo/redo bug.

we move the point ref forward, and them move along the mark list
to match.
But we need to go *beyond* any mark at the same position
else when we step the ref forward we won't know to keep going....
It is confusing, but this doesn't crash.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove the doc_operations structure complete.
NeilBrown [Tue, 24 Nov 2015 08:51:38 +0000 (19:51 +1100)]
Remove the doc_operations structure complete.

After all, it is empty now.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMake 'step' a command.
NeilBrown [Tue, 24 Nov 2015 08:48:47 +0000 (19:48 +1100)]
Make 'step' a command.

This is the most-used command, I really have to optimise this one day.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMake mark_same into a command.
NeilBrown [Tue, 24 Nov 2015 08:33:21 +0000 (19:33 +1100)]
Make mark_same into a command.

Having two marks and a point in cmd_info isn't good.
Maybe I can get rid of one later.

This is probably quite inefficient.  Using the '2' version
might help.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoIntroduce mark_order_not_same
NeilBrown [Tue, 24 Nov 2015 06:14:22 +0000 (17:14 +1100)]
Introduce mark_order_not_same

it seems to have lots of potential users.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoUse mark_ordered_or_same once more.
NeilBrown [Tue, 24 Nov 2015 06:05:50 +0000 (17:05 +1100)]
Use mark_ordered_or_same once more.

Signed-off-by: NeilBrown <neil@brown.name>
10 years ago->replace is now doc:replace
NeilBrown [Tue, 24 Nov 2015 05:57:35 +0000 (16:57 +1100)]
->replace is now doc:replace

I wonder if it should boe "Replace" ??

Signed-off-by: NeilBrown <neil@brown.name>
10 years agomake get_attr a command.
NeilBrown [Tue, 24 Nov 2015 05:51:28 +0000 (16:51 +1100)]
make get_attr a command.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange set_attr into a command.
NeilBrown [Tue, 24 Nov 2015 05:38:31 +0000 (16:38 +1100)]
Change set_attr into a command.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange ->reundo from doc_operation to command
NeilBrown [Tue, 24 Nov 2015 05:32:33 +0000 (16:32 +1100)]
Change ->reundo from doc_operation to command

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoInitial save-file support.
NeilBrown [Tue, 24 Nov 2015 04:29:05 +0000 (15:29 +1100)]
Initial save-file support.

C-x C-s now saves the file if there is a file name.
No errors are reported if anything goes wrong.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoAdd DEF_LOOKUP_CMD
NeilBrown [Tue, 24 Nov 2015 04:09:24 +0000 (15:09 +1100)]
Add DEF_LOOKUP_CMD

This makes it easy to handle the common case of a dispatcher command.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agorename mainloop.c to edlib.c
NeilBrown [Tue, 24 Nov 2015 03:45:23 +0000 (14:45 +1100)]
rename mainloop.c to edlib.c

There is nothing loopy about this file..

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange set_ref to be a command instead of directory_op
NeilBrown [Tue, 24 Nov 2015 03:27:17 +0000 (14:27 +1100)]
Change set_ref to be a command instead of directory_op

More messyness with passing documents - time to fix that.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoMove some common mark list initialisation to a single function.
NeilBrown [Tue, 24 Nov 2015 03:15:58 +0000 (14:15 +1100)]
Move some common mark list initialisation to a single function.

This results in only one place that calls ->set_ref

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange ->destroy from doc_operation to command.
NeilBrown [Tue, 24 Nov 2015 02:54:12 +0000 (13:54 +1100)]
Change ->destroy from doc_operation to command.

It is a bit messy passing a bare doc to a command at the moment,
but I have plans...

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoAllow doc_destroy to destroy any left-over points
NeilBrown [Tue, 24 Nov 2015 02:50:55 +0000 (13:50 +1100)]
Allow doc_destroy to destroy any left-over points

 ... like it does with marks.

Seemed like a good idea...

Signed-off-by: NeilBrown <neil@brown.name>
10 years agochange get_str from a doc_operations to a command.
NeilBrown [Tue, 24 Nov 2015 01:48:10 +0000 (12:48 +1100)]
change get_str from a doc_operations to a command.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoChange doc_load_file and doc_same_file from doc_operations to commands.
NeilBrown [Tue, 24 Nov 2015 01:18:12 +0000 (12:18 +1100)]
Change doc_load_file and doc_same_file from doc_operations to commands.

Eventually I hope for all doc_operations to disappear.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove point_ref
NeilBrown [Tue, 24 Nov 2015 00:29:21 +0000 (11:29 +1100)]
Remove point_ref

it is unused and not needed.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoRemove mark_of_point
NeilBrown [Tue, 24 Nov 2015 00:22:45 +0000 (11:22 +1100)]
Remove mark_of_point

it is a hang over from when I though 'point' might be a private
data structure.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agoAdd lib/ to .gitignore
NeilBrown [Tue, 24 Nov 2015 00:09:29 +0000 (11:09 +1100)]
Add lib/ to .gitignore

Signed-off-by: NeilBrown <neil@brown.name>
10 years agorender-lines: draw cursor on inactive panes.
NeilBrown [Tue, 24 Nov 2015 00:07:43 +0000 (11:07 +1100)]
render-lines: draw cursor on inactive panes.

This feels a big hacking, but it is nice to know where the cursor is.

Signed-off-by: NeilBrown <neil@brown.name>
10 years agorender-lines: make sure cursor appears in empty file.
NeilBrown [Mon, 23 Nov 2015 09:00:05 +0000 (20:00 +1100)]
render-lines: make sure cursor appears in empty file.

when point is at the end of a line it is also at the start of the next
line, and this can cause confusion.

Resolve by preferring the start of the next line (even if it is the
non-existent line at end of file) unless the end of the previous line
in not in the first column (e.g. no newline at end-of-file).

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