← Back to team overview

libbls-dev-list team mailing list archive

Re: Proposed API change for bless_buffer_can_undo

 

When the date was Saturday 16 May 2009, Alexandros Frantzis wrote:

> In the current (0.2.0) API we have the 'bless_buffer_can_undo' and
> 'bless_buffer_can_redo' functions to get whether there are any actions
> to undo/redo.
>
> I think it would be better to change this API to replace the
> aforementioned functions with something like
> 'bless_buffer_get_{undo,redo}_count' which will return the number of
> actions that can currently be
> undone/redone. It has the same functions signature as before but with
> more capabilities.

It is so, indeed. 

On the other hand, providing such capability may lead to misuse. For 
example, undo bookkeeping from user (which is implied by the new API) on a 
multithreaded environment is error prone. 

Since the current API implementation is cheap in performance overhead, I 
don't see the potential gain of such a change. Do you have a specific use 
case in mind?

> It may be useful to later add a bless_buffer_get_undo_info() api
> which will return information about the actions

This is an independent addition, so I am much less reluctant; but still a 
use case would help.

-- 
 Michael Iatrou




Follow ups

References