[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Search]

Re: org-drill and emacspeak



in your around advice, let-bind emacspeak-speak-messages to nil,
study the various advice bits in emacspeak-w3.el to see how this
is done.

>>>>> "Bart" == Bart Bunting <bart@xxxxxxxxxxx> writes:
    Bart> Raman, I am a little bit stuck when trying to get
    Bart> org-drill working.
    Bart> 
    Bart> I have found that the first issue I am having is that
    Bart> when you start a drill session a timer line is shown in
    Bart> the message area. As it ticks every second emacspeak
    Bart> continually reads it out.
    Bart> 
    Bart> I am not sure how to go about advising such a
    Bart> function. I am trying initially to turn off
    Bart> emacspeak-speak-messages but can't quite get the advice
    Bart> correct.
    Bart> 
    Bart> I paste below the function I am trying to advise and my
    Bart> advise, hopefully if you have a minute you can see what
    Bart> my error is and possibly offer some advice on a
    Bart> stratagy.
    Bart> 
    Bart> 
    Bart> (defadvice org-drill-presentation-prompt(around
    Bart> emacspeak pre act comp) "Inhibit speaking of timer"
    Bart> (when (interactive-p) (emacspeak-auditory-icon
    Bart> 'ask-question) (let ((current-messages-state
    Bart> emacspeak-speak-messages)) ad-do-it (setq
    Bart> emacspeak-speak-messages current-messages-state))
    Bart> (emacspeak-auditory-icon 'delete-object)))
    Bart> 
    Bart> (emacspeak-toggle-speak-messages nil)
    Bart> 
    Bart> (defun org-drill-presentation-prompt (&rest
    Bart> fmt-and-args) (let* ((item-start-time (current-time))
    Bart> (input nil) (ch nil) (last-second 0)
    Bart> (mature-entry-count (+ (length
    Bart> *org-drill-young-mature-entries*) (length
    Bart> *org-drill-old-mature-entries*) (length
    Bart> *org-drill-overdue-entries*))) (status (first
    Bart> (org-drill-entry-status))) (prompt (if fmt-and-args
    Bart> (apply 'format (first fmt-and-args) (rest
    Bart> fmt-and-args)) (concat "Press key for answer, "
    Bart> "e=edit, t=tags, s=skip, q=quit.")))) (setq prompt
    Bart> (format "%s %s %s %s %s %s" (propertize (char-to-string
    Bart> (case status (:new ?N) (:young ?Y) (:old ?o) (:overdue
    Bart> ?!) (:failed ?F) (t ??))) 'face `(:foreground ,(case
    Bart> status (:new org-drill-new-count-color) ((:young :old)
    Bart> org-drill-mature-count-color) ((:overdue :failed)
    Bart> org-drill-failed-count-color) (t
    Bart> org-drill-done-count-color)))) (propertize
    Bart> (number-to-string (length *org-drill-done-entries*))
    Bart> 'face `(:foreground ,org-drill-done-count-color)
    Bart> 'help-echo "The number of items you have reviewed this
    Bart> session.") (propertize (number-to-string (+ (length
    Bart> *org-drill-again-entries*) (length
    Bart> *org-drill-failed-entries*))) 'face `(:foreground
    Bart> ,org-drill-failed-count-color) 'help-echo (concat "The
    Bart> number of items that you failed, " "and need to review
    Bart> again.")) (propertize (number-to-string
    Bart> mature-entry-count) 'face `(:foreground
    Bart> ,org-drill-mature-count-color) 'help-echo "The number
    Bart> of old items due for review.") (propertize
    Bart> (number-to-string (length *org-drill-new-entries*))
    Bart> 'face `(:foreground ,org-drill-new-count-color)
    Bart> 'help-echo (concat "The number of new items that you "
    Bart> "have never reviewed.")) prompt)) (if (and (eql 'warn
    Bart> org-drill-leech-method) (org-drill-entry-leech-p))
    Bart> (setq prompt (concat (propertize "!!! LEECH ITEM !!!
    Bart> You seem to be having a lot of trouble memorising this
    Bart> item. Consider reformulating the item to make it easier
    Bart> to remember.\n" 'face '(:foreground "red")) prompt)))
    Bart> (while (memq ch '(nil ?t)) (setq ch nil) (while (not
    Bart> (input-pending-p)) (let ((elapsed (time-subtract
    Bart> (current-time) item-start-time))) (message (concat (if
    Bart> (>= (time-to-seconds elapsed) (* 60 60)) "++:++ "
    Bart> (format-time-string "%M:%S " elapsed)) prompt))
    Bart> (sit-for 1))) (setq input (read-key-sequence nil)) (if
    Bart> (stringp input) (setq ch (elt input 0))) (if (eql ch
    Bart> ?t) (org-set-tags-command))) (case ch (?q nil) (?e
    Bart> 'edit) (?s 'skip) (otherwise t))))
    Bart> 
    Bart> 
    Bart> TIA
    Bart> 
    Bart> Bart

-- 
Best Regards,
--raman

-----------------------------------------------------------------------------
To unsubscribe from the emacspeak list or change your address on the
emacspeak list send mail to "emacspeak-request@xxxxxxxxxxx" with a
subject of "unsubscribe" or "help".



If you have questions about this archive or had problems using it, please send mail to:

priestdo@xxxxxxxxxxx No Soliciting!

Emacspeak List Archive | 2010 | 2009 | 2008 | 2007 | 2006 | 2005 | 2004 | 2003 | 2002 | 2001 | 2000 | 1999 | 1998 | Pre 1998

Emacspeak Files | Emacspeak Blog