PageRenderTime 45ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 1ms

/el/audio/emacsspeak/lisp/emacspeak-ruby.el

https://github.com/joelagnel/lisp
Emacs Lisp | 136 lines | 62 code | 20 blank | 54 comment | 2 complexity | f753b734df5307f387fcf0b9c5c49dc1 MD5 | raw file
Possible License(s): GPL-2.0, MIT, BSD-3-Clause, MPL-2.0, AGPL-1.0, GPL-3.0
  1. ;;; emacspeak-ruby.el --- Speech enable Ruby Mode
  2. ;;; $Id: emacspeak-ruby.el 4151 2006-08-30 00:44:57Z tv.raman.tv $
  3. ;;; $Author: tv.raman.tv $
  4. ;;; DescriptionEmacspeak extensions for Ruby mode
  5. ;;; Keywords:emacspeak, audio interface to emacs Ruby
  6. ;;{{{ LCD Archive entry:
  7. ;;; LCD Archive Entry:
  8. ;;; emacspeak| T. V. Raman |raman@cs.cornell.edu
  9. ;;; A speech interface to Emacs |
  10. ;;; $Date: 2006-08-29 17:44:57 -0700 (Tue, 29 Aug 2006) $ |
  11. ;;; $Revision: 4151 $ |
  12. ;;; Location undetermined
  13. ;;;
  14. ;;}}}
  15. ;;{{{ Copyright:
  16. ;;;Copyright (C) 1995 -- 2006, T. V. Raman
  17. ;;; Copyright (c) 1994, 1995 by Digital Equipment Corporation.
  18. ;;; All Rights Reserved.
  19. ;;;
  20. ;;; This file is not part of GNU Emacs, but the same permissions apply.
  21. ;;;
  22. ;;; GNU Emacs is free software; you can redistribute it and/or modify
  23. ;;; it under the terms of the GNU General Public License as published by
  24. ;;; the Free Software Foundation; either version 2, or (at your option)
  25. ;;; any later version.
  26. ;;;
  27. ;;; GNU Emacs is distributed in the hope that it will be useful,
  28. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  29. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  30. ;;; GNU General Public License for more details.
  31. ;;;
  32. ;;; You should have received a copy of the GNU General Public License
  33. ;;; along with GNU Emacs; see the file COPYING. If not, write to
  34. ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  35. ;;}}}
  36. ;;{{{ Introduction:
  37. ;;; Commentary:
  38. ;;; Provide additional advice to Ruby mode
  39. ;;; Code:
  40. ;;}}}
  41. ;;{{{ required modules
  42. (require 'emacspeak-preamble)
  43. ;;}}}
  44. ;;{{{ Advice navigation:
  45. (loop for command in
  46. '(
  47. ruby-mark-defun
  48. ruby-beginning-of-defun
  49. ruby-end-of-defun
  50. ruby-beginning-of-block
  51. ruby-end-of-block
  52. ruby-forward-sexp
  53. ruby-backward-sexp
  54. )
  55. do
  56. (eval
  57. `(defadvice ,command (after emacspeak pre act comp)
  58. "Provide auditory feedback."
  59. (when (interactive-p)
  60. (emacspeak-speak-line)
  61. (emacspeak-auditory-icon 'large-movement)))))
  62. ;;}}}
  63. ;;{{{ Advice insertion and electric:
  64. (defadvice ruby-insert-end (after emacspeak pre act comp)
  65. "Provide auditory feedback."
  66. (when (interactive-p)
  67. (emacspeak-auditory-icon 'close-object)
  68. (save-excursion
  69. (ruby-beginning-of-block)
  70. (emacspeak-speak-line))))
  71. (defadvice ruby-reindent-then-newline-and-indent (after emacspeak pre act comp)
  72. "Provide auditory feedback."
  73. (when (interactive-p)
  74. (emacspeak-speak-line)))
  75. (defadvice ruby-indent-line (after emacspeak pre act comp)
  76. "Provide auditory feedback."
  77. (when (interactive-p)
  78. (emacspeak-speak-line)))
  79. (defadvice ruby-indent-exp (after emacspeak pre act comp)
  80. "Provide auditory feedback."
  81. (when (interactive-p)
  82. (emacspeak-speak-line)
  83. (emacspeak-auditory-icon 'fill-object)))
  84. (defadvice ruby-electric-brace (after emacspeak pre act comp)
  85. "Speak what you inserted.
  86. Cue electric insertion with a tone."
  87. (when (interactive-p)
  88. (let ((emacspeak-speak-messages nil))
  89. (emacspeak-speak-this-char last-input-char)
  90. (dtk-tone 800 50 t))))
  91. ;;}}}
  92. ;;{{{ Advice inferior ruby:
  93. (loop for command in
  94. '(
  95. ruby-run
  96. switch-to-ruby
  97. ruby-send-region-and-go
  98. ruby-send-block-and-go
  99. ruby-send-definition-and-go
  100. )
  101. do
  102. (eval
  103. `(defadvice ,command (after emacspeak pre act comp)
  104. "Provide auditory feedback."
  105. (when (interactive-p)
  106. (emacspeak-auditory-icon 'select-object)
  107. (emacspeak-speak-line)))))
  108. ;;}}}
  109. (provide 'emacspeak-ruby)
  110. ;;{{{ emacs local variables
  111. ;;; local variables:
  112. ;;; folded-file: t
  113. ;;; byte-compile-dynamic: t
  114. ;;; end:
  115. ;;}}}