-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
function-triple.txt
46 lines (32 loc) · 1.53 KB
/
function-triple.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
enum of OPCODEs
Mapping of "function-name", "help description"
alpha order -> binary search
simplifies doc generation too
separate duplicate/overlapping names
separate OP_DELETE for each object worked on
------------------------------------------------------------
function:opcode:description -- De-duping functions
The simplest way to describe the problem here, is to look at the "delete"
function (there's duplication elsewhere, too). "delete" appears on most menus.
The name may vary a little, but they're mostly mapped to `OP_DELETE`. This
opcode has a description attached: "delete something". It's a bit generic.
If we gave each function a unique opcode, then the descriptions could be more
specific to the menu in use.
Index: "delete-email", OP_DELETE_EMAIL, "Delete the selected email"
PGP key list: "delete-pgp-key", OP_DELETE_PGP_KEY, "Delete the selected pgp key"
...
This would allow us to give context-sensitive help for all the functions,
e.g. tell the user:
- what's being deleted
- whether the action can be undone
- etc
---
The functions are defined in `functions.h` and linked to an opcode.
They're grouped by menu, e.g. Index, Pager, Compose.
The opcodes are defined in `opcodes.h` and linked to a description.
---
Once they're separated, there are a couple of optional extra challenges:
- Suggest better, more consistent, names for the user-facing functions
e.g. "delete-entry" -\> "delete-email"
- Investigate whether the opcodes could be split into object and action,
e.g. "delete-email" == OP_DELETE | OP_EMAIL