Disable column-number-mode
[spray] / Readme.org
1 * spray.el
2
3 A speed reading mode for Emacs.
4
5 The algorithm is inspired from [[https://github.com/Miserlou/OpenSpritz][OpenSpritz]].
6
7
8 ** Screencast
9
10 [[screencast.gif]]
11
12 The story continues at [[https://www.gnu.org/philosophy/right-to-read.html][gnu.org]]
13
14 ** Installation
15
16 Put spray.el into a "load-path"ed directory, and load it in your init
17 file.
18
19 : (require 'spray)
20
21 Then you can start spraying from the cursor position with =M-x
22 spray-mode=. Binding some keys may also be useful.
23
24 : (global-set-key (kbd "<f6>") 'spray-mode)
25
26 ** Commands
27
28 In spray-mode buffers, following commands are available.
29
30 - =spray-start/stop= (SPC) ::
31 pause or resume spraying
32
33 - =spray-backward-word= (h, <left>) ::
34 pause and back to the last word
35
36 - =spray-forward-word= (l, <right>) ::
37 inverse of =spray-backward-word=
38
39 - =spray-faster= (f) ::
40 increases speed
41
42 - =spray-slower= (s) ::
43 decreases speed
44
45 - =spray-quit= (q, <return>) ::
46 quit =spray-mode=
47
48
49 ** Customization
50
51 You may customize spray by modifying following items:
52
53 - [Variable] spray-wpm
54 - [Variable] spray-height
55 - [Variable] spray-margin-top
56 - [Variable] spray-margin-left
57 - [Variable] spray-ramp
58 - [Keymap] spray-mode-map
59 - [Face] spray-base-face
60 - [Face] spray-accent-face
61
62
63 ** Similar emacs package: speedread
64
65 Available in marmalade or
66 [[https://github.com/vapniks/speedread/blob/master/speedread.el][github]]
67 It has several nice features and does not align on an accent character. Eventually I'd like to merge the two packages.
68
69 ** Deficiencies in similar projects which spray.el solves:
70
71 Mostly as of June 28, 2014.
72
73 For all other projects:
74 - It is very difficult to save your place and come back later. Emacs has lots of built in features like bookmarks or just making a note which make this easy.
75 - No keybinds. This is especially useful for common, quickly used functionality like pause and back up.
76
77 Specific projects:
78 - [[https://github.com/jbmartinez/speed-readerff][speed-readerff]] firefox extension.
79 - [[https://github.com/cameron/squirt][squirt]] javascript bookmarklet.
80 - [[https://github.com/Miserlou/OpenSpritz][OpenSpritz]] javascript bookmarklet.
81 - Very difficult selecting where to start / what exactly to read.
82 - Very difficult to figure out where you are within a document.
83
84 - [[https://github.com/chaimpeck/spray][spray]] website you paste text into.
85 - Very difficult to figure out where you are within a document.
86
87 - [[https://github.com/xypiie/spread0r][spread0r]] Perl program.
88 - No apparent way to resize text.
89 - Very difficult to figure out where you are within a document.
90
91 - [[https://github.com/the-happy-hippo/sprits-it][sprits-it]] website or bookmarklet. Looks most promising of the web based projects.
92 - Very difficult selecting where to start / what exactly to read.
93 - Somewhat difficult to figure out where you are in a document.
94
95 Programs that I, Ian Kelling, didn't try, and why. They also probably have a lot of the problems listed above.
96 - https://github.com/pasky/speedread No simple way to resize text from default of too small.
97 - https://github.com/ds300/jetzt Chrome plugin: Chrome is proprietary, and its open source version is unfriendly to linux distros so they don't package it, and it's readme does not list any benefit to this program over others.
98 - https://github.com/Fr4ncis/openspritz-ios ios program. I don't have an ios device, and this does not appear to have any compelling features.
99 - https://github.com/OnlyInAmerica/OpenSpritz-Android android program. If I knew how to quickly move reading material to my phone, I would try this out. But, it's readme shows that the program is pretty sparse and would have some of the same problems as listed above, so not worth it.
100
101
102 Downsides compared to similar projects:
103 - The emacs learning curve.
104 - Would be hard to get running on a phone.
105
106
107 ** Algorithm details
108
109 *** Main algorithm code location
110 In =./spray.el=, the functions =spray--word-at-point=, =spray--update= and =spray-start= contain the main algorithm of choosing a word, an accent character and an interval to display it. Word splitting is also duplicated the same way as in those functions throughout ./spray.el.
111
112 *** Algorithm translated from code to english
113
114 Words are split at space, tab, newline, and emdash characters. If any of the characters =.!?;= appear at the end of the word, a blank word is appended to the current word.
115
116 Each word is displayed for (60 / the choosen wpm) seconds, except if the word ends with ,:— or is greater than 9 characters long, in which case it is displayed for twice as long.
117
118 When started, an added delay is optionally added, based on the spray-ramp variable. See it's documentation for details.
119
120 The accent location is chosen as the nth character in a word, depending on its length, based on the following table
121 | length | accent position |
122 | 1 | 1 |
123 | 2-5 | 2 |
124 | 6-9 | 3 |
125 | 10-13 | 4 |
126 | 14+ | 5 |
127
128 *** Why?
129 Based on a quick count, similar programs are implemented in 6 languages, 9 platforms and 11+ projects. Every one has a similar algorithm to choose a word, an accent character and an interval to display it. How to do that best is quite important. However, how each project does it is generally buried in unrelated code, and mostly undocumented. It is prohibitively time consuming to figure out the algorithm and differences between them for each project. This sucks. Users would like to know so they can pick one. Developers would like to know so they can get ideas and spread improvements among different projects.
130
131 So, I am opening a bug on every project I find, asking them to document what file and function(s) their algorithm is implemented in, and preferably to document it in english as well. This section is an example.
132
133
134 ** Contributions are welcome!
135
136 There's lots of features and enhancements to do. The algorithm and interface could certainly be improved in various ways.