1 # -*- mode: org; coding: utf-8-unix -*-
2 #+TITLE: org-drill.el -- flashcards and spaced repetition for org-mode
3 #+OPTIONS: num:nil ^:{} author:nil
10 Org-Drill is an extension for [[https://orgmode.org/][Org mode]]. Org-Drill uses a [[https://en.wikipedia.org/wiki/Spaced_repetition][spaced repetition]]
11 algorithm to conduct interactive "drill sessions", using org files as sources
12 of facts to be memorised. Each topic is treated as a "flash card". The material
13 to be remembered is presented to the student in random order. The student rates
14 his or her recall of each item, and this information is used to schedule the
15 item for later revision.
17 Each drill session can be restricted to topics in the current buffer
18 (default), one or several files, all agenda files, or a subtree. A single
19 topic can also be drilled.
21 Different "topic types" can be defined, which present their information to the
22 student in different ways.
24 For more on the spaced repetition algorithm, and examples of other programs
26 - [[http://supermemo.com/index.htm][SuperMemo]] (see descriptions of the SM2, SM5 and SM8 algorithms)
27 - [[http://ichi2.net/anki/][Anki]]
28 - [[http://mnemosyne-proj.org/index.php][Mnemosyne]]
30 Org-Drill has its own repository, which is updated more regularly than
31 the bundled version. The repository is at:
33 http://bitbucket.org/eeeickythump/org-drill
37 The easiest way is to customise the variable 'org-modules' (=M-x
38 customize-variables RET org-modules=) and make sure 'drill' is
39 ticked. Org-drill will then be loaded when you restart Emacs or restart
42 For manual installation, put the following in your =.emacs=. You will also need
43 to make sure that Org's "contrib/lisp" directory is in the emacs load-path.
53 Open the file [[https://bitbucket.org/eeeickythump/org-drill/src/bc740455003b/spanish.org][spanish.org]]. Press =M-x= and run the function =org-drill=. Follow
54 the prompts at the bottom of the screen.
56 When the drill finishes, you can look at =spanish.org= to get some idea of how
57 drill topics are written.
60 * Writing the questions
63 Org-Drill uses org mode topics as 'drill items'. To be used as a drill item,
64 the topic must have a tag that matches the value of
65 =org-drill-question-tag=. This is =:drill:= by default. Any other org topics
68 Drill items can have other drill items as children. When a drill item is being
69 tested, the contents of any child drill items will be hidden.
71 You don't need to schedule the topics initially. Unscheduled items are
72 considered to be 'new' and ready for memorisation.
74 How should 'drill topics' be structured? Any org topic is a legal drill topic
75 -- it will simply be shown with all subheadings collapsed, so that only the
76 material beneath the main item heading is visible. After pressing a key, any
77 hidden subheadings will be revealed, and you will be asked to rate your
80 This will be adequate for some items, but usually you will want to write items
81 where you have more control over what information is hidden from the user for
82 recall purposes. For this reason, some other card types are defined, including:
84 - [[Multi-sided cards]]
85 - [[Multi-cloze cards]]
86 - [[User-defined card types]]
88 *A note about comments:* In org mode, comment lines start with '#'. The rest of
89 the line is ignored by Org (apart from some special cases). You may sometimes
90 want to put material in comments which you do not want to see when you are
91 being tested on the item. For this reason, comments are always rendered
92 invisible while items are being tested.
98 The simplest drill topic has no special structure. When such a topic is
99 presented during a drill session, any subheadings are "collapsed" with their
100 contents hidden. So, you could include the question as text beneath the main
101 heading, and the answer within a subheading. For example:
105 What is the capital city of Estonia?
111 When this item is presented for review, the text beneath the main heading will
112 be visible, but the contents of the subheading ("The Answer") will be hidden.
118 Cloze deletion can be used in any drill topic regardless of whether it is
119 otherwise 'simple', or is one of the specialised topic types discussed
120 below. To use cloze deletion, one or more parts of the body of the topic is
121 marked as /cloze text/ by surrounding it with single square brackets, [like
122 so]. When the topic is presented for review, the text within square brackets
123 will be obscured. The text is then revealed after the user presses a key. For
129 The capital city of Estonia is [Tallinn].
132 During review, the user will see:
135 The capital city of Estonia is @@html:<font style="background-color: blue;" color="cyan">
136 <tt>@@[...]@@html:</tt></font>@@.
139 When the user presses a key, the text "Tallinn" will become visible.
145 Clozed text can contain a "hint" about the answer. If the text surrounded
146 by single square brackets contains `||' (two vertical bars), all text
147 after that character is treated as a hint. During testing, the hint text will
148 be visible when the rest of the text is hidden, and invisible when the rest of
154 Type 1 hypersensitivity reactions are mediated by [immunoglobulin E||molecule]
155 and [mast cells||cell type].
159 Type 1 hypersensitivity reactions are mediated by
160 @@html:<font style="background-color: blue;" color="cyan">
161 <tt>@@[molecule...]@@html:</tt></font>@@
162 and @@html:<font style="background-color: blue;" color="cyan">
163 <tt>@@[cell type...]@@html:</tt></font>@@.
170 The remaining topic types all use the topic property, =DRILL_CARD_TYPE=. This
171 property tells =org-drill= which function to use to present the topic during
172 review. If this property has the value =twosided= then the topic is treated as
173 a "two sided card". When a two sided card is reviewed, /one of the first two/
174 subheadings within the topic will be visible -- all other
175 subheadings will be hidden.
177 Two-sided cards are meant to emulate the type of flipcard where either side is
178 useful as test material (for example, a card with a word in a foreign language
179 on one side, and its translation on the other).
181 A two sided card can have more than 2 subheadings, but all subheadings after
182 the first two are considered as "notes" and will always be hidden during topic
188 :DRILL_CARD_TYPE: twosided
200 ¿Quién fue esa mujer?
204 In this example, the user will be shown the main text -- "Translate this word"
205 -- and either 'la mujer', /or/ 'the woman', at random. The section 'Example
206 sentence' will never be shown until after the user presses a key, because it is
207 not one of the first two 'sides' of the topic.
211 <<Multi-sided cards>>
214 The =multisided= card type is similar to =twosided=, except that any
215 subheading has a chance of being presented during the topic review. One
216 subheading is always shown and all others are always hidden.
221 :DRILL_CARD_TYPE: multisided
233 [[file:table.jpg][PICTURE]]
236 The user will be shown the main text and either 'la mesa', /or/ 'the table',
237 /or/ a picture of a table.
241 <<Multi-cloze cards>>
244 Often, you will wish to create cards out of sentences that express several
245 facts, such as the following:
248 The capital city of New Zealand is Wellington, which is located in the
249 North Island and has a population of about 400,000.
252 There is more than one fact in this statement -- you could create a single
253 'simple' card with all the facts marked as cloze text, like so:
256 The capital city of [New Zealand] is [Wellington], which is located in
257 the [North||North/South] Island and has a population of about [400,000].
260 But this card will be difficult to remember. If you get just one of the 4
261 hidden facts wrong, you will fail the card. A card like this is likely to
262 become a [[leeches][leech]].
264 A better way to express all these facts using 'simple' cards is to create
265 several cards, with one fact per card. You might end up with something
270 The capital city of [New Zealand] is Wellington, which has a population of
274 The capital city of New Zealand is [Wellington], which has a population of
278 The capital city of New Zealand is Wellington, which has a population of
282 The capital city of [New Zealand] is Wellington, which is located in the
286 The capital city of New Zealand is [Wellington], which is located in
290 The capital city of New Zealand is Wellington, which is located in
291 the [North||North/South] Island.
294 However, this is really cumbersome. Multicloze card types exist for this
295 situation. Multicloze cards behave like 'simple' cards, except that when there
296 is more than one area marked as cloze text, some but not all of the areas
297 can be hidden. There are several types of predefined multicloze card:
299 1. =hide1cloze= -- one of the marked areas is hidden during review; the others
300 all remain visible. The hidden text area is chosen randomly at each review.
301 (Note: this type used to be called 'multicloze', and that card type is
302 retained as a synonym for 'hide1cloze'.)
303 2. =show1cloze= -- only one of the marked areas is visible during review; all
304 the others are hidden. The hidden text area is chosen randomly at each
306 3. =hide2cloze= -- like hide1cloze, but 2 marked pieces of text will be hidden,
307 and the rest will be visible.
308 4. =show2cloze= -- like show1cloze, but 2 marked pieces of text will be visible,
311 There are also some types of multicloze card where some pieces have an
312 increased or decreased chance of being hidden. These are intended for use when
313 studying languages: generally it is easy to translate a foreign-language
314 sentence into your own language if you have met it before, but it is much
315 harder to translate in the other direction. Therefore, you will want to test
316 the harder direction more often.
317 5. =hide1_firstmore= -- only one of the marked pieces of text will be
318 hidden. 75% of the time (guaranteed), the /first/ piece is hidden; the rest
319 of the time, one of the other pieces is randomly hidden.
320 6. =show1_firstless= -- only one of the marked pieces of text will be
321 visible. Only 25% of the time (guaranteed) will the /first/ piece will be
322 visible; the rest of the time, one of the other pieces is randomly visible.
323 7. =show1_lastmore= -- only one of the marked pieces of text will be
324 visible. 75% of the time (guaranteed), the /last/ piece will be visible;
325 the rest of the time, one of the other pieces is randomly visible.
327 So, for the above example, we can actually use the original 'bad' simple card,
328 but change its card type to 'hide1cloze'. Each time the card is presented for
329 review, one of 'New Zealand', 'Wellington', 'the South Island' or '400,000'
335 :DRILL_CARD_TYPE: hide1cloze
338 The capital city of [New Zealand] is [Wellington], which is located in
339 the [North||North/South] Island and has a population of about [400,000].
343 ** User-defined card types
344 <<User-defined card types>>
347 Finally, you can write your own emacs lisp functions to define new kinds of
348 topics. Any new topic type will need to be added to
349 =org-drill-card-type-alist=, and cards using that topic type will need to have
350 it as the value of their =DRILL_CARD_TYPE= property. For examples, see the
351 functions at the end of org-drill.el -- these include:
352 - =org-drill-present-verb-conjugation=, which implements the 'conjugate'
353 card type. This asks the user to conjugate a verb in a particular tense. It
354 demonstrates how the appearance of an entry can be completely altered during
355 a drill session, both during testing and during the display of the answer.
356 - =org-drill-present-translate-number=, which uses a third-party emacs lisp
357 library ([[http://www.emacswiki.org/emacs/spell-number.el][spell-number.el]]) to prompt the user to translate random numbers
358 to and from any language recognised by that library.
359 - =org-drill-present-spanish-verb=, which defines the new topic type
360 =spanish_verb=. This illustrates how a function can control which of an
361 item's subheadings are visible during the drill session.
363 See the file [[https://bitbucket.org/eeeickythump/org-drill/src/bc740455003b/spanish.org][spanish.org]] for a full set of example material, including
364 examples of all the card types discussed above.
370 If the body of a drill item is completely empty (ignoring properties and child
371 items), then the item will be skipped during drill sessions. The purpose of
372 this behaviour is to allow you to paste in 'skeletons' of complex items, then
373 fill in missing information later. For example, you may wish to include an
374 empty drill item for each tense of a newly learned verb, then paste in the
375 actual conjugation later as you learn each tense.
377 Note that if an item is empty, any child drill items will *not* be ignored,
378 unless they are empty as well.
380 If you have an item with an empty body, but still want it to be included in a
381 drill session, put a brief comment ('# ...') in the item body.
384 * Running the drill session
387 Start a drill session with =M-x org-drill=. By default, this includes all
388 non-hidden topics in the current buffer. =org-drill= takes an optional
389 argument, SCOPE, which allows it to take drill items from other
390 sources. See [[scope][below]] for details.
392 During a drill session, you will be presented with each item, then asked to
393 rate your recall of it by pressing a key between 0 and 5. The meaning of these
394 numbers is (taken from =org-learn=):
396 | Quality | SuperMemo label | Fail? | Meaning |
397 |---------+-----------------+-------+------------------------------------------------------|
398 | 0 | NULL | Yes | Wrong, and the answer is unfamiliar when you see it. |
399 | 1 | BAD | Yes | Wrong answer. |
400 | 2 | FAIL | Yes | Almost, but not quite correct. |
401 | 3 | PASS | No | Correct answer, but with much effort. |
402 | 4 | GOOD | No | Correct answer, with a little thought. |
403 | 5 | BRIGHT | No | Correct answer, effortless. |
405 You can press '?' at the prompt if you have trouble remembering what the
406 numbers 0--5 signify.
408 At any time you can press 'q' to finish the drill early (your progress up to
409 that point will be saved), 's' to skip the current item without viewing the
410 answer, or 'e' to escape from the drill and jump to the current topic for
411 editing (again, your progress up to that point will be saved).
413 After exiting the drill session with 'e' or 'q', you can resume where you left
414 off, using the command =org-drill-resume=. This will return you to the item
415 that you were viewing when you left the session. For example, if you are shown
416 an item and realise that it is poorly formulated, or contains an error, you can
417 press 'e' to leave the drill, then correct the item, then press
418 =M-x org-drill-resume= and continue where you left off.
420 Note that 'drastic' edits, such as deleting or moving items, can sometimes
421 cause Org-Drill to "lose its place" in the file, preventing it from
422 successfully resuming the session. In that case you will need to start a new
426 * Multiple sequential drill sessions
429 Org-Drill has to scan your entire item database each time you start a new drill
430 session. This can be slow if you have a large item collection. If you have a
431 large number of 'due' items and want to run a second drill session after
432 finishing one session, you can use the command =org-drill-again= to run a new
433 drill session that draws from the pool of remaining due items that were not
434 tested during the previous session, without re-scanning the item collection.
436 Also note that if you run =org-drill-resume= and you have actually finished the
437 drill session, you will be asked whether you want to start another drill
438 session without re-scanning (as if you had run =org-drill-again=).
444 There are some situations, such as before an exam, where you will want to
445 revise all of your cards regardless of when they are next due for review.
447 To do this, run a /cram session/ with the =org-drill-cram= command (=M-x
448 org-drill-cram RET=). This works the same as a normal drill session, except
449 that all items are considered due for review unless you reviewed them within
450 the last 12 hours (you can change the number of hours by customising the
451 variable =org-drill-cram-hours=).
457 From the Anki website, http://ichi2.net/anki/wiki/Leeches:
460 Leeches are cards that you keep on forgetting. Because they require so many
461 reviews, they take up a lot more of your time than other cards.
464 Like Anki, Org-Drill defines leeches as cards that you have "failed" many
465 times. The number of times an item must be failed before it is considered a
466 leech is set by the variable =org-drill-leech-failure-threshold= (15 by
467 default). When you fail to remember an item more than this many times, the item
468 will be given the =:leech:= tag.
470 Leech items can be handled in one of three ways. You can choose how Org-Drill
471 handles leeches by setting the variable =org-drill-leech-method= to one of the
473 - nil :: Leech items are tagged with the =leech= tag, but otherwise treated the
474 same as normal items.
475 - skip :: Leech items are not included in drill sessions.
476 - warn :: Leech items are still included in drill sessions, but a warning
477 message is printed when each leech item is presented.
479 The best way to deal with a leech is either to delete it, or reformulate it so
480 that it is easier to remember, for example by splitting it into more than one
483 See [[http://www.supermemo.com/help/leech.htm][the SuperMemo website]] for more on leeches.
489 Org-Drill has several settings which you change using
490 =M-x customize-group org-drill <RET>=. Alternatively you can change these
491 settings by adding elisp code to your configuration file (=.emacs=).
494 ** Visual appearance of items during drill sessions
497 If you want cloze-deleted text to show up in a special font within Org mode
498 buffers, add this to your .emacs:
501 (setq org-drill-use-visible-cloze-face-p t)
504 Item headings may contain information that "gives away" the answer to the item,
505 either in the heading text or in tags. If you want item headings to be made
506 invisible while each item is being tested, add:
509 (setq org-drill-hide-item-headings-p t)
513 ** Duration of drill sessions
516 By default, a drill session will end when either 30 items have been
517 successfully reviewed, or 20 minutes have passed. To change this behaviour, use
518 the following settings.
521 (setq org-drill-maximum-items-per-session 40)
522 (setq org-drill-maximum-duration 30) ; 30 minutes
525 If either of these variables is set to nil, then item count or elapsed time
526 will not count as reasons to end the session. If both variables are nil, the
527 session will not end until /all/ outstanding items have been reviewed.
530 ** Saving buffers after drill sessions
533 By default, you will be prompted to save all unsaved buffers at the end of a
534 drill session. If you don't like this behaviour, use the following setting:
537 (setq org-drill-save-buffers-after-drill-sessions-p nil)
541 ** Sources of items for drill sessions (scope)
544 By default, Org-Drill gathers drill items from the current buffer only,
545 ignoring any non-visible items. There may be times when you want Org-Drill to
546 gather drill items from other sources. You can do this by changing the value of
547 the variable =org-drill-scope=. Possible values are:
549 - file :: The current buffer, ignoring hidden items. This is the default.
550 - tree :: The subtree starting with the entry at the cursor. (Alternatively you
551 can use =M-x org-drill-tree= to run the drill session -- this will
552 behave the same as =org-drill= if 'tree' was used as the value of
554 - file-no-restriction :: The current buffer, including both hidden and
556 - file-with-archives :: The current buffer, and any archives associated with it.
557 - agenda :: All agenda files.
558 - agenda-with-archives :: All agenda files with any archive files associated
560 - directory :: All files with the extension '.org' in the same directory as the
561 current file. (The current file will also be included if its
563 - (file1 file2 ...) :: A list of filenames. All files in the list will be
568 ** Definition of old and overdue items
571 Org-Drill prioritises /overdue/ items in each drill session, presenting them
572 before other items are seen. Overdue items are defined in terms of how far in
573 the past the item is scheduled for review. The threshold is defined in terms
574 of a proportion rather than an absolute number of days. If days overdue is
577 : last-interval * (factor - 1)
579 and is at least one day overdue, then the item is considered 'overdue'. The
580 default factor is 1.2, meaning that the due date can overrun by 20% before the
581 item is considered overdue.
583 To change the factor that determines when items become overdue, use something
584 like the following in your .emacs. Note that the value should never be less
588 (setq org-drill-overdue-interval-factor 1.1)
591 After prioritising overdue items, Org-Drill next prioritises /young/
592 items. These are items which were recently learned (or relearned in the case of
593 a failure), and which therefore have short inter-repetition intervals.
594 "Recent" is defined as an inter-repetition interval less than a fixed number of
595 days, rather than a number of repetitions. This ensures that more difficult
596 items are reviewed more often than easier items before they stop being 'young'.
598 The default definition of a young item is one with an inter-repetition interval
599 of 10 days or less. To change this, use the following:
602 (setq org-drill-days-before-old 7)
606 ** Spaced repetition algorithm
609 *** Choice of algorithm
612 Org-Drill supports three different spaced repetition algorithms, all based on
613 SuperMemo algorithms. These are:
614 - [[http://www.supermemo.com/english/ol/sm2.htm][SM2]] :: an early algorithm, used in SuperMemo 2.0 (1988), which remains very
615 popular -- Anki and Mnemosyne, two of the most popular spaced repetition
616 programs, use SM2. This algorithm stores an 'ease factor' for each item,
617 which is modified each time you rate your recall of the item.
618 - [[http://www.supermemo.com/english/ol/sm5.htm][SM5]] (default) :: used in SuperMemo 5.0 (1989). This algorithm uses 'ease
619 factors' but also uses a persistent, per-user 'matrix of optimal factors'
620 which is also modified after each item repetition.
621 - Simple8 :: an experimental algorithm based on the [[http://www.supermemo.com/english/algsm8.htm][SM8]] algorithm. SM8 is used
622 in SuperMemo 8.0 (1998) and is almost identical to SM11 which is
623 used in SuperMemo 2002. Like SM5, it uses a matrix of optimal
624 factors. Simple8 differs from SM8 in that it does not adapt the
625 matrix to the individual user, though it does adapt each item's
629 If you want Org-Drill to use the =SM2= algorithm, put the following in your
633 (setq org-drill-spaced-repetition-algorithm 'sm2)
637 *** Random variation of repetition intervals
640 The intervals generated by the SM2 and SM5 algorithms are pretty
641 deterministic. If you tend to add items in large, infrequent batches, the lack
642 of variation in interval scheduling can lead to the problem of "lumpiness" --
643 one day a large batch of items are due for review, the next there is almost
644 nothing, a few days later another big pile of items is due.
646 This problem can be ameliorated by adding some random "noise" to the interval
647 scheduling algorithm. The author of SuperMemo actually recommends this approach
648 for the SM5 algorithm, and Org-Drill's implementation uses [[http://www.supermemo.com/english/ol/sm5.htm][his code]].
650 To enable random "noise" for item intervals, set the variable
651 =org-drill-add-random-noise-to-intervals-p= to true by putting the following in
655 (setq org-drill-add-random-noise-to-intervals-p t)
659 *** Adjustment for early or late review of items
662 Reviewing items earlier or later than their scheduled review date may affect
663 how soon the next review date should be scheduled. Code to make this adjustment
664 is also presented on the SuperMemo website. It can be enabled with:
667 (setq org-drill-adjust-intervals-for-early-and-late-repetitions-p t)
670 This will affect both early and late repetitions if the Simple8 algorithm is
671 used. For the SM5 algorithm it will affect early repetitions only. It has no
672 effect on the SM2 algorithm.
675 *** Adjusting item difficulty globally
678 The =learn fraction= is a global value which affects how quickly the intervals
679 (times between each retest of an item) increase with successive repetitions,
680 for /all/ items. The default value is 0.5, and this is the value used in
681 SuperMemo. For some collections of information, you may find that you are
682 reviewing items too often (they are too easy and the workload is too high), or
683 too seldom (you are failing them too often). In these situations, it is
684 possible to alter the learn fraction from its default in order to increase or
685 decrease the frequency of repetition of items over time. Increasing the value
686 will make the time intervals grow faster, and lowering it will make them grow
687 more slowly. The table below shows the growth in intervals (in days) with some
688 different values of the learn fraction (F). The table assumes that the item is
689 successfully recalled each time, with an average quality of just under 4.
692 | Repetition | F=0.3 | F=0.4 | *F=0.5* | F=0.6 | F=0.7 |
693 |------------+-------+-------+---------+-------+-------|
694 | 1st | 2 | 2 | 2 | 2 | 2 |
695 | 2nd | 7 | 7 | 7 | 7 | 7 |
696 | 5th | 26 | 34 | 46 | 63 | 85 |
697 | 10th | 85 | 152 | 316 | 743 | 1942 |
698 | 15th | 233 | 501 | 1426 | 5471 | 27868 |
700 To alter the learn fraction, put the following in your .emacs:
703 (setq org-drill-learn-fraction 0.45) ; change the value as desired
707 ** Per-file customisation settings
708 <<per-file settings>>
710 Most of Org-Drill's customisation settings are safe as file-local
711 variables. This means you can include a commented section like this at the end
712 of your .org file to apply special settings when running a Drill session using
717 # org-drill-maximum-items-per-session: 50
718 # org-drill-spaced-repetition-algorithm: simple8
722 You can achieve the same effect by including the settings in the 'mode line'
723 (this must be the *first line* in the file), like so:
726 # -*- org-drill-maximum-items-per-session: 50; org-drill-spaced-repetition-algorithm: simple8 -*-
729 In either case you will need to save, close and re-open the file for the
730 changes to take effect.
733 * Coping with large collections
736 If you keep all your items in a single file, it may eventually get very
737 large. The file will be slow to load, and Emacs may have trouble
738 syntax-highlighting the file contents correctly.
740 The easiest steps to solve this problem are:
741 1. Move your file into its own dedicated directory.
742 2. Divide the file into two or more smaller files.
743 3. Within each file, set =org-drill-scope= to 'directory'. See
744 [[per-file settings]] above for instructions about how to do this.
747 * Sharing, merging and synchronising item collections
750 Every drill item is automatically given a persistent unique "ID" the first time
751 it is seen by Org-Drill. This means that if two different people subsequently
752 edit or reschedule that item, Org-Drill can still tell that it is the same
753 item. This in turn means that collections of items can be shared and edited in
754 a collaborative manner.
756 There are two commands that are useful in this regard:
757 1. =org-drill-strip-all-data= - this command deletes all user-specific
758 scheduling data from every item in the current collection. (It takes the
759 same optional 'scope' argument as =org-drill= to define which items will
760 be processed by the command). User-specific data includes scheduling dates,
761 ease factors, number of failures and repetitions, and so on. All items are
762 reset to 'new' status. This command is useful if you want to share your
763 item collection with someone else.
764 2. =org-drill-merge-buffers= - When called from buffer A, it prompts you for
765 another buffer (B), which must also be loaded into Emacs. This command
766 imports all the user-specific scheduling data from buffer B into buffer A,
767 and deletes any such information in A. Matching items are identified by
768 their ID. Any items in B that do not exist in A are copied to A, in
769 the same hierarchical location if all the parent headings exist, otherwise
770 at the end of the buffer.
774 Tim decides to learn Swedish using an item collection (=.org= file) made
775 publically available by Jane. (Before publishing it Jane used
776 'org-drill-strip-all-data' to remove her personal scheduling data from the
777 collection.) A few weeks later, Jane updates her collection, adding new items
778 and revising some old ones. Tim downloads the new collection and imports his
779 progress from his copy of the old collection, using 'org-drill-merge-buffers',
780 using the new collection as buffer A and the old one as buffer B. He can then
781 discard the old copy. Any items HE added to HIS copy of the old collection
782 (buffer B) will not be lost -- they will be appended to his copy of the new
785 Of course the sharing does not need to be 'public'. You and a friend might be
786 learning a language or some other topic together. You each maintain a card
787 collection. Periodically your friend sends you a copy of their collection --
788 you run =org-drill-merge-buffers= on it, always using your own collection as
789 buffer B so that your own scheduling progress is carried over. Other times you
790 send your friend a copy of your collection, and he or she follows the same
794 * Incremental reading
797 An innovative feature of the program SuperMemo is so-called "incremental
798 reading". This refers to the ability to quickly and easily make drill items
799 from selected portions of text as you read an article (a web page for
800 example). See [[http://www.supermemo.com/help/read.htm][the SuperMemo website]] for more on incremental reading.
802 Much of the infrastructure for incremental reading is already provided by Org
803 Mode, with the help of some other emacs packages. You can provide yourself with
804 an incremental reading facility by using 'org-capture' alongside a package that
805 allows you to browse web pages either in emacs (w3 or [[http://www.emacswiki.org/emacs/emacs-w3m][emacs-w3m]]) or in the
806 external browser of your choice ([[https://orgmode.org/worg/org-contrib/org-protocol.php][org-protocol]]).
808 Another important component of incremental reading is the ability to save your
809 exact place in a document, so you can read it /incrementally/ rather than all
810 at once. There is a large variety of bookmarking packages for emacs which
811 provide advanced bookmarking functionality: see the [[http://www.emacswiki.org/emacs/BookMarks][Emacs Wiki]] for details.
812 Bookmarking exact webpage locations in an external browser seems to be a bit
813 more difficult. For Firefox, the [[http://www.wired-marker.org/][Wired Marker]] addon works well.
815 An example of using Org-Drill for incremental reading is given below. First,
816 and most importantly, we need to define a couple of =org-capture= templates for
820 (setq org-capture-templates
822 "Task: Read this URL"
824 (file+headline "tasks.org" "Articles To Read")
825 ,(concat "* TODO Read article: '%:description'\nURL: %c\n\n")
830 "Capture web snippet"
832 (file+headline "my-facts.org" "Inbox")
833 ,(concat "* Fact: '%:description' :"
834 (format "%s" org-drill-question-tag)
835 ":\n:PROPERTIES:\n:DATE_ADDED: %u\n:SOURCE_URL: %c\n:END:\n\n%i\n%?\n")
838 ;; ...other capture templates...
842 Using these templates and =org-protocol=, you can set up buttons in your web
844 - Create a task telling you to read the URL of the currently viewed webpage
845 - Turn a region of selected text on a webpage, into a new fact which is saved
846 to whichever file and heading you nominate in the template. The fact will
847 contain a timestamp, and a hyperlink back to the webpage where you created
850 For example, suppose you are reading the Wikipedia entry on tuberculosis [[https://en.wikipedia.org/wiki/Tuberculosis][here]].
852 You read the following:
855 The classic symptoms of tuberculosis are a chronic cough with blood-tinged
856 sputum, fever, night sweats, and weight loss. Infection of other organs causes
857 a wide range of symptoms. Treatment is difficult and requires long courses of
858 multiple antibiotics. Antibiotic resistance is a growing problem in
859 (extensively) multi-drug-resistant tuberculosis. Prevention relies on screening
860 programs and vaccination, usually with Bacillus Calmette-Guérin vaccine.
863 You decide you want to remember that "Bacillus Calmette-Guérin vaccine" is the
864 name of the vaccine against tuberculosis. First, you select the `interesting'
865 portion of the text with the mouse:
868 The classic symptoms of tuberculosis are a chronic cough with blood-tinged
869 sputum, fever, night sweats, and weight loss. Infection of other organs causes
870 a wide range of symptoms. Treatment is difficult and requires long courses of
871 multiple antibiotics. Antibiotic resistance is a growing problem in
872 (extensively) multi-drug-resistant tuberculosis.
873 @@html:<font style="background-color: yellow;">@@Prevention relies
874 on screening programs and vaccination, usually with Bacillus Calmette-Guérin
875 vaccine.@@html:</font>@@
878 Then you press the button you created when setting up =org-protocol=, which is
879 configured to activate the capture template "w: Capture web snippet". The
880 selected text will be sent to Emacs, turned into a new fact using the template,
881 and filed away for your later attention.
883 (Note that it might be more efficient to turn the entire paragraph into a drill
884 item -- since it contains several important facts -- then split it up into
885 multiple items when you edit it later in Emacs.)
887 Once you have had enough of reading the article, save your place, then go to
888 your "fact" file in Emacs. You should see that each piece of text you selected
889 has been turned into a drill item. Continuing the above example, you would see
893 ,** Fact: 'Tuberculosis - Wikipedia, the Free Encyclopedia' :drill:
895 Prevention relies on screening programs and vaccination, usually with Bacillus
896 Calmette-Guérin vaccine.
899 You need to edit this fact so it makes sense independent of its context, as
900 that is how it will be presented to you in future. The easiest way to turn the
901 text into a 'question' is by cloze deletion. All you need to do is surround the
902 'hidden' parts of the text with square brackets.
904 : Prevention of tuberculosis relies on screening programs and vaccination,
905 : usually with [Bacillus Calmette-Guérin vaccine].
908 You can of course define browser buttons that use several different "fact"
909 templates, each of which might send its fact to a different file or subheading,
910 or give it different tags or properties, for example.
915 Org-Drill is written by Paul Sexton.