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

Very preliminary Emacspeak advice for identica-mode



First the caveats: this is very rough, not adequately tested and not ready for
inclusion in Emacspeak. There is functionality which remains to be
implemented.

Nevertheless, it is already useful to me, and hence may be helpful to others
even in its current form.

I spent the last several hours writing it and doing basic debugging - my first
attempt to advise a new Emacs mode.

I shall post an update after several more weeks of experience and refinement,
or whenever I think it's sufficiently improved to be worth posting again.

Code and techniques have been taken liberally from the Emacspeak source.

As an example of what's missing: when the user types a status message, there's
a running counter which shows the number of characters typed. Obviously, it
shouldn't be spoken while typing is underway, but there ought to be an
Emacspeak command to read it, bound to a suitable key.

Feedback is welcome.

;;{{{ copyright
;;;Copyright (c) 2010 Jason White
;;; Portions Copyright (C) 1995 -- 2009, T. V. Raman
;;;All rights reserved.
;;; This file is not part of GNU Emacs, but the same permissions apply.
;;;
;;; GNU Emacs is free software; you can redistribute it and/or modify
;;; it under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 2, or (at your option)
;;; any later version.
;;;
;;; GNU Emacs is distributed in the hope that it will be useful,
;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNTWIT FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Emacs; see the file COPYING.  If not, write to
;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

;;}}}

(require 'emacspeak-preamble)
;;{{{ Introduction
;;This module speech-enables identica-mode: http://www.nongnu.org/identica-mode/
;;The code is influenced in particular by emacspeak-twit.el.
;;}}}
;;{{{ voice map
(voice-setup-add-map
 '(
   (identica-username-face voice-bolden)
   (identica-reply-face voice-brighten)
   (identica-uri-face voice-lighten)))
;;}}}

;;{{{ supporting functions
(defun emacspeak-identica-speak-status ()
  "Speaks text between point and the end of the current status"
  (interactive)
  (let*
      ((start (point))
       (end (identica-get-next-username-face-pos start)))
    (and start end
	 (emacspeak-speak-region start end))))

;;}}}

;;{{{ advice
(loop for f in
     '(identica-goto-next-status
       identica-goto-previous-status
       identica-goto-next-status-of-user
       identica-goto-previous-status-of-user)
     do
     (eval
      `(defadvice ,f (around emacspeak pre act comp)
	 "Provide auditory feedback"
	 (when (interactive-p)
	   (let
	       ((prior (point)))
	     ad-do-it
	     (unless (eql prior (point))
	       (emacspeak-auditory-icon 'select-object)
	       (emacspeak-identica-speak-status)))))))

(loop for f in
      '(identica-next-link
	identica-previous-link)
	do
	(eval
	 `(defadvice ,f (after emacspeak pre act comp)
	    "Provide auditory feedback"
	    (when (and
		   (interactive-p)
		   (get-text-property (point) 'uri))
	      (emacspeak-auditory-icon 'select-object)
	      (emacspeak-speak-region (point) (next-property-change (point)))))))

(defadvice identica-render-timeline (after emacspeak pre act comp)
  (voice-lock-mode 1))

;;}}}

(provide 'emacspeak-identica)
;;{{{ end of file

;;; local variables:
;;; folded-file: t
;;; byte-compile-dynamic: t
;;; end:

;;}}}


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

priestdo@cs.vassar.edu No Soliciting!

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

Emacspeak Files | Emacspeak Blog | Search the archive