]> git.neil.brown.name Git - edlib.git/log
edlib.git
8 years agoAdd my LCA2016 presentation. devel lca2016
NeilBrown [Thu, 4 Feb 2016 20:32:20 +0000 (07:32 +1100)]
Add my LCA2016 presentation.
- run edlib as "./edlib -g"
- open lca2016/edlib.md (C-x C-f)
- go to the buffer list (C-x b)
- nagivate to the edlib.md entry
- type 'p' to view in presentation mode

Alternate to last step:

- type C-x 5 2 to get new window (will be blank)
- type C-x b in that window to get buffer list
- move it to other monitor
- type M-f to go full screen
- in original window us C-v or page-down to page down both displays
- use C-l anywhere to re-centre the other display

Signed-off-by: NeilBrown <neil@brown.name>
8 years agodevel
NeilBrown [Wed, 3 Feb 2016 19:54:33 +0000 (06:54 +1100)]
devel

8 years agodevel
NeilBrown [Tue, 2 Feb 2016 02:47:49 +0000 (13:47 +1100)]
devel

8 years agodevel
NeilBrown [Sat, 30 Jan 2016 21:25:47 +0000 (08:25 +1100)]
devel

8 years agoPython: add interface to access attributes of mark via subscripts
NeilBrown [Mon, 25 Jan 2016 05:58:44 +0000 (16:58 +1100)]
Python: add interface to access attributes of mark via subscripts

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: add mark.dup()
NeilBrown [Mon, 25 Jan 2016 05:41:24 +0000 (16:41 +1100)]
python: add mark.dup()

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: add next/prev/next_any methods for marks
NeilBrown [Mon, 25 Jan 2016 05:35:06 +0000 (16:35 +1100)]
python: add next/prev/next_any methods for marks

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: discard iterator stuff for Marks
NeilBrown [Mon, 25 Jan 2016 05:27:41 +0000 (16:27 +1100)]
python: discard iterator stuff for Marks

It is clumsy and I'm not sure I really want it.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: add mark_to_mark interface
NeilBrown [Mon, 25 Jan 2016 03:30:23 +0000 (14:30 +1100)]
python: add mark_to_mark interface

Signed-off-by: NeilBrown <neil@brown.name>
8 years agorender-lines: remove 'type'
NeilBrown [Mon, 25 Jan 2016 03:04:53 +0000 (14:04 +1100)]
render-lines: remove 'type'

No longer needed.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agodoc: remove dependence on view notifier.
NeilBrown [Mon, 25 Jan 2016 02:49:54 +0000 (13:49 +1100)]
doc: remove dependence on view notifier.

A view can now have no notifier, and everything should work as expected.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agodoc: make it possible to delete a view by number
NeilBrown [Mon, 25 Jan 2016 02:42:13 +0000 (13:42 +1100)]
doc: make it possible to delete a view by number

As we are deprecating the 'notifier', don't depend on it for deletion.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoemacs-search: remove 'watch' command.
NeilBrown [Mon, 25 Jan 2016 02:36:26 +0000 (13:36 +1100)]
emacs-search: remove 'watch' command.

It is never used!

Signed-off-by: NeilBrown <neil@brown.name>
8 years agodoc: track whether view is active
NeilBrown [Mon, 25 Jan 2016 02:32:27 +0000 (13:32 +1100)]
doc: track whether view is active

Previously we use the presense of 'notify' to see if a view
is active.  I am deprecating 'notify', no record that information
in 'state' (shared with 'marked').

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: bind python Pane more tightly to edlib pane
NeilBrown [Mon, 25 Jan 2016 01:58:11 +0000 (12:58 +1100)]
python: bind python Pane more tightly to edlib pane

When python allocates a pane, the matching Pane is buond to it and
always used in python code (previously we would allocate various separate Panes).
This makes is possible to subclass Pane and when we get a pane back from
edlib, we get the whole subclassed Pane.

I should do a similar think with Marks....

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: provide access to a mark's mdata
NeilBrown [Mon, 25 Jan 2016 00:43:25 +0000 (11:43 +1100)]
python: provide access to a mark's mdata

But make sure it is something python can handle.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove 'space' option of mark allocation
NeilBrown [Mon, 25 Jan 2016 00:30:49 +0000 (11:30 +1100)]
Remove 'space' option of mark allocation

all marks are now the same size,  we just have a pointer for extension.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agolines: some improvements to page up/down
NeilBrown [Sun, 24 Jan 2016 22:14:28 +0000 (09:14 +1100)]
lines: some improvements to page up/down

move-view-large assumed lines were '1' high.
Now it knows a bit about line height, but there are still some issues.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoFix two issues with viewing TAGS file
NeilBrown [Wed, 13 Jan 2016 05:19:25 +0000 (16:19 +1100)]
Fix two issues with viewing TAGS file

1/ DEL char wasn't handled well
2/ </> didn't stripe old attribute properly

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoFix border for "search" popup.
NeilBrown [Wed, 13 Jan 2016 04:56:56 +0000 (15:56 +1100)]
Fix border for "search" popup.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agomake popups work better in gtk display.
NeilBrown [Wed, 13 Jan 2016 04:45:39 +0000 (15:45 +1100)]
make popups work better in gtk display.

Now at least they aren't 3 pixels high.

'search' has problems though.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoFix drawing of cursor.
NeilBrown [Tue, 12 Jan 2016 04:25:15 +0000 (15:25 +1100)]
Fix drawing of cursor.

Draw block background in gtk display.
Also fix handling around '<'.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: pane_cmp should return -1, 0, or 1
NeilBrown [Tue, 12 Jan 2016 03:06:35 +0000 (14:06 +1100)]
python: pane_cmp should return -1, 0, or 1

else python complains.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoChange DAMAGED_CURSOR to propagate down instead of up.
NeilBrown [Tue, 12 Jan 2016 03:05:22 +0000 (14:05 +1100)]
Change DAMAGED_CURSOR to propagate down instead of up.

Now that the render draws the cursor, rather than the display knowing where it is,
we want DAMAGED_CURSOR to propagate down.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove pane_with_cursor.
NeilBrown [Tue, 12 Jan 2016 03:00:03 +0000 (14:00 +1100)]
Remove pane_with_cursor.

No longer needed.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agodiscard move_cursor()
NeilBrown [Tue, 12 Jan 2016 02:57:04 +0000 (13:57 +1100)]
discard move_cursor()

no longer needed - we have a new way of positioning the cursor.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove old pane-text interface
NeilBrown [Tue, 12 Jan 2016 02:34:39 +0000 (13:34 +1100)]
Remove old pane-text interface

No longer used.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agorender-lines: add support for new text rendering.
NeilBrown [Tue, 12 Jan 2016 02:30:17 +0000 (13:30 +1100)]
render-lines: add support for new text rendering.

This required lots of bug-fixes too.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agolib-view: use text-display for borders of a view.
NeilBrown [Tue, 5 Jan 2016 02:57:38 +0000 (13:57 +1100)]
lib-view: use text-display for borders of a view.

and hacks and bugfixes..

Signed-off-by: NeilBrown <neil@brown.name>
8 years agolib-messageline: use new text-display interface
NeilBrown [Tue, 5 Jan 2016 01:54:05 +0000 (12:54 +1100)]
lib-messageline: use new text-display interface

Also some fixes and hacks...

Signed-off-by: NeilBrown <neil@brown.name>
8 years agodisplay-pygtk: switch to pixel-sizing for pane.
NeilBrown [Mon, 4 Jan 2016 23:19:14 +0000 (10:19 +1100)]
display-pygtk: switch to pixel-sizing for pane.

This makes the display completely wrong of course.
So next few patches while change different panes to understand
text-size issues properly.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agodisplay-pygtk: add text-size and text-display interfaces
NeilBrown [Mon, 4 Jan 2016 20:53:56 +0000 (07:53 +1100)]
display-pygtk: add text-size and text-display interfaces

8 years agodisplay-ncurses: add text-size and text-display interfaces
NeilBrown [Mon, 28 Dec 2015 21:50:54 +0000 (08:50 +1100)]
display-ncurses: add text-size and text-display interfaces

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoAdd pygtk display.
NeilBrown [Sat, 26 Dec 2015 01:18:51 +0000 (12:18 +1100)]
Add pygtk display.

This is an alternate display, using pygtk.

It also provides an alternate event loop, and the alternate loop
must be used.  This is wart which will be resolved eventually.

Only a constant-width font is used.  Obviously that must change.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoFix text.py for new calling convention.
NeilBrown [Fri, 25 Dec 2015 22:43:47 +0000 (09:43 +1100)]
Fix text.py for new calling convention.

Pane commands must be called against a pane...

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoPython: provide Pane.add_notify interface for pane_add_notify.
NeilBrown [Fri, 25 Dec 2015 22:42:19 +0000 (09:42 +1100)]
Python: provide Pane.add_notify interface for pane_add_notify.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython: use consistent capitalisation for type names.
NeilBrown [Fri, 25 Dec 2015 22:38:41 +0000 (09:38 +1100)]
python: use consistent capitalisation for type names.

I've been inconsistent with type names.
Spell all edlib types (Pane Mark Comm) with leading capital letter.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoPython: add the new "comm" type to the python namespace
NeilBrown [Fri, 25 Dec 2015 22:38:06 +0000 (09:38 +1100)]
Python: add the new "comm" type to the python namespace

also initialise it properly.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopane: improve usefulness of abs_z
NeilBrown [Fri, 25 Dec 2015 22:35:37 +0000 (09:35 +1100)]
pane: improve usefulness of abs_z

In abs_z calculation, the child should be higher than the parent,
incase both are drawn to.  This ensures children pane will cover
relevant parts of parent.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agokeymap: make a local copy of any key put in a keymap.
NeilBrown [Fri, 25 Dec 2015 22:34:07 +0000 (09:34 +1100)]
keymap: make a local copy of any key put in a keymap.

When called from C, these are always static.  But there is no
such guarantee when called from elsewhere.

We really should refcount the 'comm' too or something like that.
For now, they are never freed.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoMove 'exit' functionality out of 'display-ncurses'.
NeilBrown [Sun, 13 Dec 2015 04:25:58 +0000 (15:25 +1100)]
Move 'exit' functionality out of 'display-ncurses'.

Put it in 'mode-emacs' for now.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoAdd global 'z' level.
NeilBrown [Sun, 13 Dec 2015 04:13:19 +0000 (15:13 +1100)]
Add global 'z' level.

'abs_z' can be compared between pane to determine global z order.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRefresh child panes in 'z' order
NeilBrown [Sun, 13 Dec 2015 03:36:00 +0000 (14:36 +1100)]
Refresh child panes in 'z' order

This will make future patches which create a global z-order
possible.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoPython: remove old debuging PrintObject
NeilBrown [Sat, 12 Dec 2015 00:03:37 +0000 (11:03 +1100)]
Python: remove old debuging PrintObject

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoPython: add co-ordinate conversion methods to panes.
NeilBrown [Sat, 12 Dec 2015 00:01:54 +0000 (11:01 +1100)]
Python: add co-ordinate conversion methods to panes.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoAdd new key_handle_* interfaces to Python.
NeilBrown [Fri, 11 Dec 2015 23:53:19 +0000 (10:53 +1100)]
Add new key_handle_* interfaces to Python.

Discard 'edlib.call' and make the various "call" functions methods
of the (focus) pane object.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoClarify key_handle*
NeilBrown [Fri, 11 Dec 2015 23:47:21 +0000 (10:47 +1100)]
Clarify key_handle*

key_handle should be used most often.
  It uses the focus given, but moves 'home' out to a leaf and
    searches in from there.
key_handle_filter should be used only when calling a function with
    the same name as self.  It uses focus and home as given and
    only searches home towards root
key_handle_focus should be used when simulting keyboard input.  It
    moves focus out to a leaf, and then sets home from there.
key_handle_xy should be used when simulatiing mouse input.  it follows
    focus out to a root tracking x,y and starts home from there.

key_handle_focus and key_handle_xy also pick-up ->point if it is set on
any pane on the way out.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoDiscard hx,hy in favour explicit conversion functions.
NeilBrown [Fri, 11 Dec 2015 23:21:59 +0000 (10:21 +1100)]
Discard hx,hy in favour explicit conversion functions.

Less room for conversion, and best to do the work when it is needed.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoDitto for emacs_str
NeilBrown [Fri, 11 Dec 2015 23:01:57 +0000 (10:01 +1100)]
Ditto for emacs_str

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopopup_quote remove assignment of whole cmd_info
NeilBrown [Fri, 11 Dec 2015 22:59:22 +0000 (09:59 +1100)]
popup_quote remove assignment of whole cmd_info

That makes me nervous...

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRevisions to pane_refresh
NeilBrown [Fri, 11 Dec 2015 22:55:58 +0000 (09:55 +1100)]
Revisions to pane_refresh

Instead of passing a pointer to a struct which is then copied and
otherwise (largely) unused, just pass the struct by-value.

Also change the setting of some fields that isn't needed as they
cannot have been changed.

And never use a ci again after it has been passed to a command.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoremove call_str and call_extra
NeilBrown [Fri, 11 Dec 2015 22:34:44 +0000 (09:34 +1100)]
remove call_str and call_extra

no longer used.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoMake sure python compares/hashes panes properly.
NeilBrown [Fri, 11 Dec 2015 21:55:15 +0000 (08:55 +1100)]
Make sure python compares/hashes panes properly.

Two python objects for the same pane must compare and hash the same.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoAdd 'Comm' type to python interface.
NeilBrown [Fri, 11 Dec 2015 21:43:35 +0000 (08:43 +1100)]
Add 'Comm' type to python interface.

This is a command - it can be called from python to run non-python
code.

There are issues with argument passing that I haven't fully resolved...

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoMake it possible to replace current event handler.
NeilBrown [Fri, 11 Dec 2015 06:31:41 +0000 (17:31 +1100)]
Make it possible to replace current event handler.

Setting DAMAGED_EVENTS on the root and then refreshing
should do it.  Untested though.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoFirst step to plugable event loops.
NeilBrown [Fri, 11 Dec 2015 06:15:32 +0000 (17:15 +1100)]
First step to plugable event loops.

attach libevent via an plugin command.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse new notifiers for lib-view
NeilBrown [Fri, 11 Dec 2015 04:30:41 +0000 (15:30 +1100)]
Use new notifiers for lib-view

Signed-off-by: NeilBrown <neil@brown.name>
8 years agouse new notifiers to notify changes to render-lines.
NeilBrown [Fri, 11 Dec 2015 04:21:30 +0000 (15:21 +1100)]
use new notifiers to notify changes to render-lines.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse new notifiers for render-hex.
NeilBrown [Fri, 11 Dec 2015 03:25:55 +0000 (14:25 +1100)]
Use new notifiers for render-hex.

This makes the he_data redundant.  I'll leave it there as I'll
probably find a need for it later.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse DEF_LOOKUP_CMD in render-hex.
NeilBrown [Fri, 11 Dec 2015 03:15:15 +0000 (14:15 +1100)]
Use DEF_LOOKUP_CMD in render-hex.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoMore fixed for closing popup windows.
NeilBrown [Fri, 11 Dec 2015 03:13:57 +0000 (14:13 +1100)]
More fixed for closing popup windows.

I think I need refcounting on panes :-(

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopopup: Close doc more directly.
NeilBrown [Fri, 11 Dec 2015 02:44:32 +0000 (13:44 +1100)]
popup: Close doc more directly.

I want this to all go eventually with auto-close documents.
But destroying a doc via some pane is problematic as the
pane might have disappeared already.  So do it more directly.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoDisconnect pane where possible before closing children.
NeilBrown [Fri, 11 Dec 2015 02:43:14 +0000 (13:43 +1100)]
Disconnect pane where possible before closing children.

This limits multiple closes due to recursion to some extent.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoIntroduce DAMAGED_CLOSED
NeilBrown [Fri, 11 Dec 2015 02:41:07 +0000 (13:41 +1100)]
Introduce DAMAGED_CLOSED

This gets set when a pane is being closed, and prevents repeated
close when a child tried to close a parent.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse new notifiers to close a popup when target disappears.
NeilBrown [Fri, 11 Dec 2015 00:43:43 +0000 (11:43 +1100)]
Use new notifiers to close a popup when target disappears.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse new notifications to support search_again
NeilBrown [Fri, 11 Dec 2015 00:39:06 +0000 (11:39 +1100)]
Use new notifications to support search_again

That than the old doc notifer.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoStart changing rules about ->focus and ->home
NeilBrown [Fri, 11 Dec 2015 00:21:52 +0000 (11:21 +1100)]
Start changing rules about ->focus and ->home

I'm still thinking this through....

'home' must always be the pane where the command was found.
'focus' should be where the action happens.

Previously 'home' would always end up being a parent of 'focus' but
sometimes, particularly calls from popup to target, we want something else.

So allow the caller to set 'focus' to themselves and 'home' to where
to start looking for the command.
If either is home is not set, focuses it moved out to a leaf first.

This still seems a bit clumsy...

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse new notifiers to send notification when document changes.
NeilBrown [Thu, 10 Dec 2015 07:11:49 +0000 (18:11 +1100)]
Use new notifiers to send notification when document changes.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUnify doc_notify_change and point_notify_change more.
NeilBrown [Thu, 10 Dec 2015 07:03:30 +0000 (18:03 +1100)]
Unify doc_notify_change and point_notify_change more.

In particular: export only one interface.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse new notifier to close all views on a document when destroyed.
NeilBrown [Thu, 10 Dec 2015 06:48:13 +0000 (17:48 +1100)]
Use new notifier to close all views on a document when destroyed.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoAdd infrastructure to allow panes to get notifications from other panes.
NeilBrown [Thu, 10 Dec 2015 06:00:28 +0000 (17:00 +1100)]
Add infrastructure to allow panes to get notifications from other panes.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoMake struct cmd_info mostly read-only
NeilBrown [Wed, 9 Dec 2015 22:45:15 +0000 (09:45 +1100)]
Make struct cmd_info mostly read-only

I want this to be treated readonly except for a few
places where explicit write access is requested.
Partly because it used to be changed a lot and I want to stop that.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove doc_from_pane
NeilBrown [Thu, 10 Dec 2015 04:17:55 +0000 (15:17 +1100)]
Remove doc_from_pane

No more callers.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoChange line-count to use a pane rather than a doc.
NeilBrown [Thu, 10 Dec 2015 04:15:56 +0000 (15:15 +1100)]
Change line-count to use a pane rather than a doc.

Now all those pane-based functions are available...

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoIntroduce vmark_new to avoid direct acess to doc_new_mark
NeilBrown [Thu, 10 Dec 2015 04:11:14 +0000 (15:11 +1100)]
Introduce vmark_new to avoid direct acess to doc_new_mark

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoDefine doc:set-attr and use in line-count.
NeilBrown [Thu, 10 Dec 2015 03:21:58 +0000 (14:21 +1100)]
Define doc:set-attr and use in line-count.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoIntroduce pane_mark_attr.
NeilBrown [Thu, 10 Dec 2015 03:00:18 +0000 (14:00 +1100)]
Introduce pane_mark_attr.

This searches panes for an attribute at a mark.
This removes another doc_from_pane call.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agosearch: used Move-File rather than mark_reset to go to start.
NeilBrown [Thu, 10 Dec 2015 02:55:17 +0000 (13:55 +1100)]
search: used Move-File rather than mark_reset to go to start.

this removes another doc_from_pane call.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse attributes to get name of document instead of direct access.
NeilBrown [Thu, 10 Dec 2015 02:42:16 +0000 (13:42 +1100)]
Use attributes to get name of document instead of direct access.

This removes another doc_from_pane() call.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse pane_attr_get to get linecount attributes for 'view'.
NeilBrown [Thu, 10 Dec 2015 02:33:30 +0000 (13:33 +1100)]
Use pane_attr_get to get linecount attributes for 'view'.

This reduced need for 'doc'.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoIntroduce doc_following_pane and change many mark_next/mark_prev to _pane
NeilBrown [Thu, 10 Dec 2015 02:20:35 +0000 (13:20 +1100)]
Introduce doc_following_pane and change many mark_next/mark_prev to _pane

still tring to get 'doc' references out of non-core/doc code.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoAll ed->commands to be accessed by key_handle
NeilBrown [Thu, 10 Dec 2015 02:15:44 +0000 (13:15 +1100)]
All ed->commands to be accessed by key_handle

This makes sense and means we don't need to find the 'ed'.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoIntroduce mark_next_pane and mark_prev_pane
NeilBrown [Thu, 10 Dec 2015 01:49:42 +0000 (12:49 +1100)]
Introduce mark_next_pane and mark_prev_pane

Use these to remove the need for 'doc_from_pane' from search_add.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRationalise prev/next mark function.
NeilBrown [Thu, 10 Dec 2015 01:29:34 +0000 (12:29 +1100)]
Rationalise prev/next mark function.

- don't need the 'safe' version any more
- don't need to pass 'doc'.
- consistent names: doc_{prev,next}_mark_{all,view}

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoChange hlist to make the head directlry recognisable.
NeilBrown [Thu, 10 Dec 2015 01:21:18 +0000 (12:21 +1100)]
Change hlist to make the head directlry recognisable.

Store a least-significant-bit in the pointer in the 'head'
so that we can recognise the start of the list without carrying
around the pointer to the head.

This allows free movement around marks without holding the doc.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove 'doc' arg from next_mark.
NeilBrown [Thu, 10 Dec 2015 00:54:05 +0000 (11:54 +1100)]
Remove 'doc' arg from next_mark.

It doesn't need it.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove mark_same calls from non-core/doc code.
NeilBrown [Thu, 10 Dec 2015 00:52:00 +0000 (11:52 +1100)]
Remove mark_same calls from non-core/doc code.

These should use mark_same_pane.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove 'd' from render_complete_line
NeilBrown [Thu, 10 Dec 2015 00:47:20 +0000 (11:47 +1100)]
Remove 'd' from render_complete_line

It isn't used.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoChange doc_destroy to take a pane.
NeilBrown [Thu, 10 Dec 2015 00:45:35 +0000 (11:45 +1100)]
Change doc_destroy to take a pane.

This starts to reduce the number of doc_from_pane() callers.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoPython: return number from 'call'.
NeilBrown [Thu, 10 Dec 2015 00:06:17 +0000 (11:06 +1100)]
Python: return number from 'call'.

Return value is now more meaningful, so need to pass it back.

Probably should do something better with negative values.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agopython_call: don't accept return values for storage in 'ci'.
NeilBrown [Thu, 10 Dec 2015 00:03:17 +0000 (11:03 +1100)]
python_call: don't accept return values for storage in 'ci'.

That approach is no longer supported.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse callback to return marks from doc:vmark-get
NeilBrown [Thu, 10 Dec 2015 00:00:36 +0000 (11:00 +1100)]
Use callback to return marks from doc:vmark-get

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse callback to return pane for call_pane()
NeilBrown [Wed, 9 Dec 2015 23:54:56 +0000 (10:54 +1100)]
Use callback to return pane for call_pane()

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse a call-back to return pane from "display-ncurses".
NeilBrown [Wed, 9 Dec 2015 23:45:17 +0000 (10:45 +1100)]
Use a call-back to return pane from "display-ncurses".

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse callbacks to return pane from "doc-*"
NeilBrown [Wed, 9 Dec 2015 23:41:39 +0000 (10:41 +1100)]
Use callbacks to return pane from "doc-*"

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoUse callbacks to return string from Complete:prefix.
NeilBrown [Wed, 9 Dec 2015 23:35:44 +0000 (10:35 +1100)]
Use callbacks to return string from Complete:prefix.

Also fix up freeing of strings.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoMark the '42' hack in render-complete as such.
NeilBrown [Wed, 9 Dec 2015 09:48:05 +0000 (20:48 +1100)]
Mark the '42' hack in render-complete as such.

And hide it from future attempts to make 'ci' read-only.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoReturn value from doc:add-view directly
NeilBrown [Wed, 9 Dec 2015 09:34:57 +0000 (20:34 +1100)]
Return value from doc:add-view directly

Just like doc:find-view

Signed-off-by: NeilBrown <neil@brown.name>
8 years agoRemove assignment to ci->mark in doc_file.
NeilBrown [Wed, 9 Dec 2015 09:25:57 +0000 (20:25 +1100)]
Remove assignment to ci->mark in doc_file.

It isn't needed, and I want to make ci read-only.

Signed-off-by: NeilBrown <neil@brown.name>
8 years agocomplete: remove the finding of the render-lines pane.
NeilBrown [Wed, 9 Dec 2015 09:00:02 +0000 (20:00 +1100)]
complete: remove the finding of the render-lines pane.

If we just make render-lines use "key_handle_focus", it is OK
for render-complete to be placed on top of the stack.
This makes things a lot cleaner.

We now need to let move-line through too.

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