/utilities/emacspeak/lisp/emacspeak-sql.el

https://github.com/jamesnvc/emacs.d · Lisp · 125 lines · 51 code · 18 blank · 56 comment · 0 complexity · 856ce473f6f08939403499215201eeb6 MD5 · raw file

  1. ;;; emacspeak-sql.el --- Speech enable sql-mode
  2. ;;; $Id: emacspeak-sql.el 5798 2008-08-22 17:35:01Z tv.raman.tv $
  3. ;;; $Author: tv.raman.tv $
  4. ;;; Description: Emacspeak extension to speech enable sql-mode
  5. ;;; Keywords: Emacspeak, database interaction
  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: 2007-08-25 18:28:19 -0700 (Sat, 25 Aug 2007) $ |
  11. ;;; $Revision: 4532 $ |
  12. ;;; Location undetermined
  13. ;;;
  14. ;;}}}
  15. ;;{{{ Copyright:
  16. ;;;Copyright (C) 1995 -- 2007, 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. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  37. ;;{{{ required modules
  38. (require 'emacspeak-preamble)
  39. ;;}}}
  40. ;;{{{ Introduction:
  41. ;;; Commentary:
  42. ;;; This module speech enables sql-mode--
  43. ;;; available from
  44. ;;; http://paddington.ic.uva.nl/public/sql-modes.zip
  45. ;;; sql-mode.el implemented by the above package
  46. ;;;sets up an Emacs to SQL interface where you can
  47. ;;;interactively evaluate SQL expressions.
  48. ;;; Code:
  49. ;;}}}
  50. ;;{{{ advice
  51. (defadvice sqlplus-execute-command (after emacspeak pre act comp)
  52. "Provide auditory feedback and place point at the start of the output."
  53. (when (interactive-p)
  54. (emacspeak-auditory-icon 'scroll)
  55. (sqlplus-back-command 2)
  56. (forward-line 1)
  57. (emacspeak-speak-line)))
  58. (defadvice sqlplus-back-command (after emacspeak pre act
  59. comp)"Move prompt appropriately, and speak the line."
  60. (when (interactive-p)
  61. (emacspeak-auditory-icon 'large-movement)
  62. (forward-line 1)
  63. (emacspeak-speak-line)))
  64. (defadvice sqlplus-forward-command (after emacspeak pre act
  65. comp)
  66. "Move prompt appropriately, and speak the line."
  67. (when (interactive-p)
  68. (emacspeak-auditory-icon 'large-movement)
  69. (forward-line 1)
  70. (emacspeak-speak-line)))
  71. (defadvice sqlplus-next-command (after emacspeak pre act comp)
  72. "Speak the line."
  73. (when (interactive-p)
  74. (emacspeak-auditory-icon 'select-object)
  75. (emacspeak-speak-line)))
  76. (defadvice sqlplus-previous-command (after emacspeak pre act comp)
  77. "Speak the line."
  78. (when (interactive-p)
  79. (emacspeak-auditory-icon 'select-object)
  80. (emacspeak-speak-line)))
  81. (defadvice sql-send-region (around emacspeak pre act comp)
  82. "Provide auditory feedback."
  83. (cond
  84. ((interactive-p)
  85. (emacspeak-auditory-icon 'select-object)
  86. ad-do-it
  87. (emacspeak-auditory-icon 'mark-object))
  88. (t ad-do-it))
  89. ad-return-value)
  90. (defadvice sql-send-buffer (around emacspeak pre act comp)
  91. "Provide auditory feedback."
  92. (cond
  93. ((interactive-p)
  94. (emacspeak-auditory-icon 'select-object)
  95. ad-do-it
  96. (emacspeak-auditory-icon 'mark-object))
  97. (t ad-do-it))
  98. ad-return-value)
  99. ;;}}}
  100. (provide 'emacspeak-sql)
  101. ;;{{{ end of file
  102. ;;; local variables:
  103. ;;; folded-file: t
  104. ;;; byte-compile-dynamic: t
  105. ;;; end:
  106. ;;}}}