branch: elpa/org-drill
commit 61807adc7f11ce6ea3465257ff671b9c30000c1d
Author: Phillip Lord <[email protected]>
Commit: Phillip Lord <[email protected]>
Remove spell-number.el dependency
spell-number is only available on Emacs wiki. This disables the
"translate number" functionality.
---
org-drill.el | 76 ------------------------------------------------------------
spanish.org | 25 --------------------
2 files changed, 101 deletions(-)
diff --git a/org-drill.el b/org-drill.el
index fc881e47e9..1b67067de4 100644
--- a/org-drill.el
+++ b/org-drill.el
@@ -3369,11 +3369,6 @@ copy them across."
;;; Card types for learning languages =========================================
-;;; Get spell-number.el from:
-;;; http://www.emacswiki.org/emacs/spell-number.el
-(autoload 'spelln-integer-in-words "spell-number")
-
-
;;; `conjugate' card type =====================================================
;;; See spanish.org for usage
@@ -3582,77 +3577,6 @@ returns its return value."
(funcall reschedule-fn session))))
-;;; `translate_number' card type ==============================================
-;;; See spanish.org for usage
-
-
-(defun org-drill-spelln-integer-in-language (n lang)
- (let ((spelln-language lang))
- (spelln-integer-in-words n)))
-
-(defun org-drill-present-translate-number (_session)
- (let ((num-min (read (org-entry-get (point) "DRILL_NUMBER_MIN")))
- (num-max (read (org-entry-get (point) "DRILL_NUMBER_MAX")))
- (language (read (org-entry-get (point) "DRILL_LANGUAGE" t)))
- (drilled-number 0)
- (drilled-number-direction 'to-english)
- (highlight-face 'font-lock-warning-face))
- (cond
- ((not (fboundp 'spelln-integer-in-words))
- (message "`spell-number.el' not loaded, skipping 'translate_number'
card...")
- (sit-for 0.5)
- 'skip)
- ((not (and (numberp num-min) (numberp num-max) language))
- (error "Missing language or minimum or maximum numbers for number card"))
- (t
- (if (> num-min num-max)
- (psetf num-min num-max
- num-max num-min))
- (setq drilled-number
- (+ num-min (cl-random (abs (1+ (- num-max num-min))))))
- (setq drilled-number-direction
- (if (zerop (cl-random 2)) 'from-english 'to-english))
- (cond
- ((eql 'to-english drilled-number-direction)
- (org-drill-present-card-using-text
- (format "\nTranslate into English:\n\n%s\n"
- (propertize
- (org-drill-spelln-integer-in-language drilled-number
language)
- 'face highlight-face))
- (org-drill-spelln-integer-in-language drilled-number 'english-gb)))
- (t
- (org-drill-present-card-using-text
- (format "\nTranslate into %s:\n\n%s\n"
- (capitalize (format "%s" language))
- (propertize
- (org-drill-spelln-integer-in-language drilled-number
'english-gb)
- 'face highlight-face))
- (org-drill-spelln-integer-in-language drilled-number language))))))))
-
-
-;; (defun org-drill-show-answer-translate-number (reschedule-fn)
-;; (let* ((language (read (org-entry-get (point) "DRILL_LANGUAGE" t)))
-;; (highlight-face 'font-lock-warning-face)
-;; (non-english
-;; (let ((spelln-language language))
-;; (propertize (spelln-integer-in-words *drilled-number*)
-;; 'face highlight-face)))
-;; (english
-;; (let ((spelln-language 'english-gb))
-;; (propertize (spelln-integer-in-words *drilled-number*)
-;; 'face 'highlight-face))))
-;; (with-replaced-entry-text
-;; (cond
-;; ((eql 'to-english *drilled-number-direction*)
-;; (format "\nThe English translation of %s is:\n\n%s\n"
-;; non-english english))
-;; (t
-;; (format "\nThe %s translation of %s is:\n\n%s\n"
-;; (capitalize (format "%s" language))
-;; english non-english)))
-;; (funcall reschedule-fn))))
-
-
;;; `spanish_verb' card type ==================================================
;;; Not very interesting, but included to demonstrate how a presentation
;;; function can manipulate which subheading are hidden versus shown.
diff --git a/spanish.org b/spanish.org
index b80d02a6ec..790ca5e877 100644
--- a/spanish.org
+++ b/spanish.org
@@ -333,28 +333,3 @@ Sp: [entre]
En: [between] or [among]
-** Random Numbers
-
-Below is an example of a card that tests the user's ability to translate random
-whole numbers to and from a non-English language. For it to work correctly, you
-must have the third party library
[[http://www.emacswiki.org/emacs/spell-number.el][spell-number.el]] installed
and loaded.
-
-The meaning of the item's properties is as follows:
-- =DRILL_LANGUAGE=: any language recognised by spell-number.el. At the time of
- writing these include: catalan, danish, dutch, english-eur, english-gb,
- english-us, esperanto, finnish, french-fr, french-ch, german, italian,
- japanese, norwegian, portuguese-br, portuguese-pt, spanish and swedish.
-- =DRILL_NUMBER_MIN= and =DRILL_NUMBER_MAX=: the range between which the random
- number will fall.
-
-
-*** Random Number 20-99
:drill:
- :PROPERTIES:
- :DRILL_NUMBER_MIN: 20
- :DRILL_NUMBER_MAX: 99
- :DRILL_LANGUAGE: spanish
- :DRILL_CARD_TYPE: translate_number
- :END:
-
-# This comment is included so that the item body is non-empty. Items with
-# empty bodies are skipped during drill sessions.