]> code.delx.au - gnu-emacs-elpa/blob - packages/tiny/README.md
Merge commit '0cda39255827f283e7578cd469ae42daad9556a2' from js2-mode
[gnu-emacs-elpa] / packages / tiny / README.md
1 [![Build Status](https://travis-ci.org/abo-abo/tiny.svg?branch=master)](https://travis-ci.org/abo-abo/tiny)
2 [![Coverage Status](https://coveralls.io/repos/abo-abo/tiny/badge.svg?branch=master)](https://coveralls.io/r/abo-abo/tiny?branch=master)
3
4 ### Main idea:
5
6 This is an alternative to inserting numeric ranges with macros (i.e. `F3 F3`).
7 The advantages are:
8
9 1. Brevity: consider `F3 F3 SPC M-1 M-0 F4` vs. `m10 C-;`.
10 2. Much better undo context: a single `C-_` will undo the whole thing
11 and allow you to edit the code. With macros you'd have to undo multiple
12 times and restart from scratch, instead of tweaking what you just invoked.
13 3. The ability to insert the same number several times in a single iteration,
14 and transform it with `format`-style expressions
15 e.g. `m6\n15%s=0%o=0x%x` will expand to
16
17 6=06=0x6
18 7=07=0x7
19 8=010=0x8
20 9=011=0x9
21 10=012=0xa
22 11=013=0xb
23 12=014=0xc
24 13=015=0xd
25 14=016=0xe
26 15=017=0xf
27 4. Last but not least, the ability to transform the number with lisp expressions.
28 For instance:
29 1. `m5 10*xx` -> `25 36 49 64 81 100`
30 2. `m5 10*xx|0x%x` -> `0x19 0x24 0x31 0x40 0x51 0x64`
31 3. `m10+x?a%c` -> `a b c d e f g h i j k`
32 4. `m10+x?A%c` -> `A B C D E F G H I J K`
33 5. `m97,105stringx` -> `a,b,c,d,e,f,g,h,i`
34 6. `m97,102stringxupcasex` -> `aA,bB,cC,dD,eE,fF`
35 7. `m,3|%(+ x x) and %(* x x) and %s` -> `0 and 0 and 0,2 and 1 and 1,4 and 4 and 2,6 and 9 and 3,8 and 16 and 4,10 and 25 and 5`
36
37 ### Use in conjunction with `org-mode`:
38
39 m1\n14|*** TODO http://emacsrocks.com/e%02d.html
40
41 *** TODO http://emacsrocks.com/e01.html
42 *** TODO http://emacsrocks.com/e02.html
43 *** TODO http://emacsrocks.com/e03.html
44 *** TODO http://emacsrocks.com/e04.html
45 *** TODO http://emacsrocks.com/e05.html
46 *** TODO http://emacsrocks.com/e06.html
47 *** TODO http://emacsrocks.com/e07.html
48 *** TODO http://emacsrocks.com/e08.html
49 *** TODO http://emacsrocks.com/e09.html
50 *** TODO http://emacsrocks.com/e10.html
51 *** TODO http://emacsrocks.com/e11.html
52 *** TODO http://emacsrocks.com/e12.html
53 *** TODO http://emacsrocks.com/e13.html
54 *** TODO http://emacsrocks.com/e14.html
55
56 You can even schedule and deadline:
57
58 m\n8|**** TODO Learning from Data Week %(+ x 2) \nSCHEDULED: <%(date "Oct 7" (* x 7))> DEADLINE: <%(date "Oct 14" (* x 7))>
59
60 **** TODO Learning from Data Week 2
61 SCHEDULED: <2013-10-07 Mon> DEADLINE: <2013-10-14 Mon>
62 **** TODO Learning from Data Week 3
63 SCHEDULED: <2013-10-14 Mon> DEADLINE: <2013-10-21 Mon>
64 **** TODO Learning from Data Week 4
65 SCHEDULED: <2013-10-21 Mon> DEADLINE: <2013-10-28 Mon>
66 **** TODO Learning from Data Week 5
67 SCHEDULED: <2013-10-28 Mon> DEADLINE: <2013-11-04 Mon>
68 **** TODO Learning from Data Week 6
69 SCHEDULED: <2013-11-04 Mon> DEADLINE: <2013-11-11 Mon>
70 **** TODO Learning from Data Week 7
71 SCHEDULED: <2013-11-11 Mon> DEADLINE: <2013-11-18 Mon>
72 **** TODO Learning from Data Week 8
73 SCHEDULED: <2013-11-18 Mon> DEADLINE: <2013-11-25 Mon>
74 **** TODO Learning from Data Week 9
75 SCHEDULED: <2013-11-25 Mon> DEADLINE: <2013-12-02 Mon>
76 **** TODO Learning from Data Week 10
77 SCHEDULED: <2013-12-02 Mon> DEADLINE: <2013-12-09 Mon>
78
79 Here's how to schedule a task that repeats Monday through Friday at 10:00, every week:
80
81 m0\n4|** TODO Something work-related\nSCHEDULED: <%(date "mon" x) 10:00 +1w>
82
83 ** TODO Something work-related
84 SCHEDULED: <2013-11-04 Mon 10:00 +1w>
85 ** TODO Something work-related
86 SCHEDULED: <2013-11-05 Tue 10:00 +1w>
87 ** TODO Something work-related
88 SCHEDULED: <2013-11-06 Wed 10:00 +1w>
89 ** TODO Something work-related
90 SCHEDULED: <2013-11-07 Thu 10:00 +1w>
91 ** TODO Something work-related
92 SCHEDULED: <2013-11-08 Fri 10:00 +1w>
93
94 ### Setup
95 In `~/.emacs`:
96
97 (require 'tiny)
98 (tiny-setup-default)