-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathee.texi
executable file
·455 lines (382 loc) · 12.3 KB
/
ee.texi
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
\input texinfo @c -*-texinfo-*-
@c %**start of header
@setfilename ee.info
@settitle Ee - Emacs information manager
@c %**end of header
@ifhtml
@settitle ee.info
@end ifhtml
@dircategory Emacs
@direntry
* Ee: (ee). Emacs information manager.
@end direntry
@set VERSION 0.1.0
@set EDITION $Revision$
@set UPDATED $Date$
@ifnottex
This document describes the Ee, Emacs information manager.
This is edition @value{EDITION} @value{UPDATED}
of the @cite{Ee User Manual}
for @code{ee} Version @value{VERSION}.
Copyright @copyright{} 2002, 2003, 2004, 2010 Juri Linkov @email{juri@@jurta.org}
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@end ifnottex
@c next is right?
@ifhtml
@settitle Ee Reference Manual
@end ifhtml
@titlepage
@title Ee User Manual
@sp 1
@subtitle Emacs Information Manager
@subtitle @value{EDITION} @value{UPDATED}
@subtitle for ee v@value{VERSION}
@author by Juri Linkov @email{juri@@jurta.org}
@page
@vskip 0pt plus 1filll
Copyright @copyright{} 2002, 2003 Juri Linkov @email{juri@@jurta.org}
@sp 2
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@end titlepage
@c Output the table of the contents at the beginning.
@contents
@ifnottex
@node Top, Introduction, (dir), (dir)
This document describes the @code{ee} version @value{VERSION},
Emacs information manager.
PLEASE NOTE THAT THIS MANUAL IS NOT FINISHED,
BECAUSE THIS PACKAGE IS UNDER DEVELOPMENT,
AND ALL DETAILS DESCRIBED HERE CAN BE CHANGED.
@end ifnottex
@menu
* Introduction:: Introduction.
* Data-Flow Diagram:: Data-Flow Diagram.
* Data Structures:: Explanations of data structures.
* View Description:: Explanations of view data.
* View Generation:: Process of view buffer generation.
* View Buffer:: Explanations of view buffer parts.
* Visibility:: Commands to control what is visible.
* Navigation:: Special motion commands.
* Marking and Deletion:: Marking and deleting displayed items.
* Writing Extensions:: How to write new extensions.
Appendices:
* Installation:: Installation.
* Reporting Bugs:: How to report a bug in ee.
* Terminology:: Terminology.
* Concept Index:: Concept Index.
* Command Index:: Command Index.
* Key Index:: Key Index.
* Variable Index:: Variable Index.
@end menu
@node Introduction, Data-Flow Diagram, Top, Top
@chapter Introduction
@cindex Introduction
@verbatim
Ee is the categorizing information manager for Emacs.
It works by collecting information from different
sources and converting information to a relational or
associative database. It uses the fields of database
table records to build the category trees, which are
displayed in the Emacs view buffer. The rules for
creating the views are also specified by similar data
structures and include the rules for building category
paths, sorting records and categories, calculating
the totals of category fields, filtering records, and
printing category tree and record lines.
@end verbatim
@node Data-Flow Diagram, Data Structures, Introduction, Top
@chapter Data-Flow Diagram
@c For explanation of used terms see @xref{Terminology}.
@example
+----------------+ +----------------+
| data |<---| data |
| file buffer | | file |
+----------------+ +----------------+
|
v
+----------------+ +----------------+
| data |<---| alternative |
| ee view buffer | | data source |
+----------------+ +----------------+
^
|
+----------------+ +----------------+
| view data |<---| view data |
| file buffer | | file |
+----------------+ +----------------+
|
v
+----------------+
| view data |
| ee view buffer |
+----------------+
^
|
+----------------+ +----------------+
| view view data |<---| view view data |
| file buffer | | file |
+----------------+ +----------------+
| |
v v
+----------------+
| view view data |
| ee view buffer |
+----------------+
@end example
@node Data Structures, View Description, Data-Flow Diagram, Top
@chapter Data Structures
@table @code
@item data-file
Name of the file that contains data.
@item view-data-file
Name of the data file that contains the view descriptions.
@item collector
Function that collects data from source other than data file,
and sets the variable `ee-data'.
@end table
Example of data structure:
@example
[(meta
(format-version . "0.0.1")
(database-version . "0.0.1")
(data-version . "0.0.1")
(data-file . "example.ee")
(view-data-file . "view/example.ee")
(collector . ee-example-data-collect)
(fields
(field (name name))
(field (name category-1))
(field (name category-2))
(field (name category-3))
(field (name (parent children)))
(field (name ())))
(key-fields name)
(mark-field mark))
["ri-101" "c-1" nil "c-4" () ((price . 3.15) (amount . 9))]
["ri-102" "c-1/s-1" "c-2/s-2" "c-4" () ((price . 3) (amount . 5))]
["ri-103" "c-1" "c-3" "c-4" ((children "ri-104" "ri-105")) ()]
["ri-104" nil nil nil ((parent . "ri-103")) ()]
["ri-105" nil nil nil ((parent . "ri-104")) ()]]
@end example
@node View Description, View Generation, Data Structures, Top
@chapter View Description
Views are described by data structures.
Currently some fields are functions,
where record fields are accessed by function `ee-field',
e.g. (ee-field 'field-name record).
Current fields of view description data structure (functions that begin with
'c-' prefix operate on categories, functions that begin with
'r-' prefix operate on records):
@cindex file flags
@table @code
@item name
Unique view name.
@item r-filter
Function that selects the displayed records.
@item c-path-finder
Function that converts every record to a list of category paths,
which is used to build a category tree.
@item c-sorter
Function that sorts the categories. Arguments are
a-level (all levels), c-level (category-level),
s-level (subcategory level), attr-alist (attributes list).
@item r-sorter
Function that sorts the records. Arguments are
a-level (all levels), r-level (record-level),
attr-alist (attributes list).
@item c-calculator
Function that calculates the category totals.
@item r-calculator
Function that calculates the record totals.
@item c-printer
Function that prints the category lines.
@item r-printer
Function that prints the record lines.
@item r-select
Function called after typing RET on a record line.
@end table
Example of view description data structure:
@example
[(meta
(format-version . "0.0.1")
(view-data-file . "view/views.ee")
(fields ()))
[((type . view)
(name . "by Category")
(default . t)
(r-filter . (lambda (r)
(not (ee-field 'parent r))))
(c-path-finder . (lambda (r)
(list
(append
(ee-split-string (ee-field 'category-1 r) "/")
(ee-split-string (ee-field 'category-2 r) "/"))
(list (ee-field 'category-3 r)))))
(r-child-parent-key-fields name parent)
(c-sorter . (lambda (a-level c-level s-level attr-alist)
(lambda (c1 c2) (string< (car c1) (car c2)))))
(r-calculator . (lambda (r a-level r-level children-p result)
(- (if (vectorp r)
(* (or (ee-field 'price r) 0) (or (ee-field 'amount r) 0))
result) result)))
(c-counter . (lambda (a-level c-level s-level header attr-alist) 0))
(r-counter . (lambda (r a-level r-level children-p result) 1))
(c-title-printer)
(r-title-printer . (lambda () ))
(c-printer . (lambda (a-level c-level s-level header attr-alist)
(let ((b (point)))
(insert (format
(concat "%s- %s (%s, %.2f)")
(make-string (1- a-level) ?\040)
header
(or (cadr (assq 'counter attr-alist)) "0")
(or (cadr (assq 'result attr-alist)) "0"))))))
(r-printer . (lambda (r a-level r-level children-p attr-alist)
(insert (format "%s%s%s%s %s %.2f * %s = %.2f"
(or (car (ee-field 'mark r)) " ")
(make-string r-level ?\040)
(if children-p "- " " ")
(ee-field 'name r)
(make-string (- 9 r-level) ?\040)
(or (ee-field 'price r) 0)
(or (ee-field 'amount r) 0)
(* (ee-field 'price r) (ee-field 'amount r))))))
(r-select . ee-example-select)
(r-execute . ee-example-execute))]]
@end example
@node View Generation, View Buffer, View Description, Top
@chapter View Generation
Data:
@example
[c-1 field-1 field-2 field-3]
[c-2 field-1 field-2 field-3]
@end example
View category paths (returned by c-path-finder):
@example
'((c-1 c-1.1 | sc-1.1 | sc-1.2 ) 101)
'((c-1 c-1.2 ) 102)
'((c-2) 101)
'((c-2) 104)
@end example
Internal structure `view-atree':
@example
(root
(~
(_r 101))
(c-1
(_s
(sc-1.1
(_s
(sc-1.2
(_r 102)
(_a (hide t) (result 1 0))))))))
@end example
Generated view buffer:
@example
- c-1
- c-1.1
r-101
- c-1.2
r-102
- sc-1
r-103
- c-2
r-101
- r-107
- r-108
- r-109
@end example
@node View Buffer, Visibility, View Generation, Top
@chapter View Buffer
Expansion division:
ee-expansion
category, c-line:
text-properties: ee-path, ee-level, ee-expansion
record, r-line:
text-properties: ee-ri
text-properties: ee-ri, ee-level, ee-expansion
Record division:
ee-path
ee-ri
c-number means category name
sc-number means subcategory name
ri-number means record index
@example
- c-1 ee-path=(c-1) ee-level=1 ee-expansion=o(77,555)
- c-1.1 ee-path=(c-1.1) ee-level=2 ee-expansion=o(77,555)
ri-101 ee-ri=101
- sc-1 ee-path=(c-1 c-1.1 | sc-1) ee-level=3 ee-expansion=o(77,555)
ri-103 ee-ri=103
- c-1.1.1 ee-path=(c-1 c-1.1 c-1.1.1) ee-level=3 ee-expansion=o(77,555)
ri-104 ee-ri=104
- c-1.2 ee-path=(c-1.2) ee-level=2 ee-expansion=o(77,555)
ri-102 ee-ri=102
- c-2 ee-path=(c-2) ee-level=1 ee-expansion=o(77,555)
ri-101 ee-ri=101
- ri-107 ee-ri=107 ee-level=2 ee-expansion=o(77,555)
- ri-108 ee-ri=108 ee-level=3 ee-expansion=o(77,555)
ri-109 ee-ri=109
@end example
@node Visibility, Navigation, View Buffer, Top
@chapter Visibility
show/hide = expand/collase
One-click mouse gesture expansion tree navigation
@node Navigation, Marking and Deletion, Visibility, Top
@chapter Navigation
@node Marking and Deletion, Writing Extensions, Navigation, Top
@chapter Marking and Deletion
Marking and deleting viewed items.
If some record appears under different categories,
then it is marked in all categories.
If marking key is typed, when point is on category line,
then the whole category is marked, i.e. every record
under this category is marked.
@node Writing Extensions, Installation, Marking and Deletion, Top
@chapter Writing Extensions
@cindex Extensions
You can write new ee extensions.
To do it, follow the next steps:
@enumerate
@item
Create new file.@*
Give it the name beginning with prefix @code{ee-}.
@item
Add default data description.
@item
Add default view data description.
@end enumerate
For list of currently available extensions see
@uref{http://www.jurta.org/emacs/ee/}.
@node Installation, Reporting Bugs, Writing Extensions, Top
@chapter Installation
See the file README or
@uref{http://www.jurta.org/emacs/ee/}
@node Reporting Bugs, Terminology, Installation, Top
@chapter Reporting Bugs
Please report bugs, make suggestions and contributions
to @email{juri@@jurta.org} or on the Web pages
at @uref{http://www.jurta.org/emacs/ee/}.
@node Terminology, Concept Index, Reporting Bugs, Top
@chapter Terminology
@table @code
@item category
@item expansion
@item path-finder
@end table
@node Concept Index, Command Index, Terminology, Top
@unnumbered Concept Index
@printindex cp
@node Command Index, Key Index, Concept Index, Top
@unnumbered Command Index
@printindex fn
@node Key Index, Variable Index, Command Index, Top
@unnumbered Key Index
@printindex ky
@node Variable Index, , Key Index, Top
@unnumbered Variable Index
@printindex vr
@bye