nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nano-devel] Implement macro recording and playback


From: Marco Diego Aurélio Mesquita
Subject: [Nano-devel] Implement macro recording and playback
Date: Sat, 7 Oct 2017 22:10:21 -0300

Hi Devs!

Since there is interest in macro recording and playback, I tried to
see how complicated it would be to implement it.

The attached patch implements it for keys <Down>, <End>, <Left> and
<Backspace> only.

The current implementation is intended only to start a discussion
about what is the right way to implement it although it already works
the way it is now.

For now, there are some things that I think should be changed:
  - The function handle_macro_in should take one more argument: data.
That what would serve the purpose of actions that have data associated
with them. For now I can only think of character insertion.
  - The list of recorded actions should be stored in a linked list
instead of an array. That way it is easier to make it grow.
  - The actions should not be stored as int's. A struct should be
defined with two fields: and int (the action) and the data (with type
to be defined).
  - We should create a C-pre-processor macro so that macro-record-able
functions should not need to be carefully modified to include
handle_macro_in and handle_macro_out calls. Instead, a macro
record-able function should be defined like this:
MACRO(function)(void){ [...]
  - A new source file macro.c containing functions related to macros
should be created.

Once we decided what is the minimum acceptable implementation, I think
that all that would be needed then is a list of functions that should
be macro-record-able.

Benno, do you agree with my changes and variable/constant names?

Attachment: macro.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]