PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/emacspeak-29.0/lisp/emacspeak-compile.el

#
Emacs Lisp | 128 lines | 54 code | 17 blank | 57 comment | 2 complexity | 5fcf533a0954be2f25e917c134a57319 MD5 | raw file
Possible License(s): MIT
  1. ;;; emacspeak-compile.el --- Speech enable navigation of compile errors, grep matches
  2. ;;; $Author: tv.raman.tv $
  3. ;;; Description: Emacspeak extensions to the compile package
  4. ;;; Keywords: Emacspeak compile
  5. ;;{{{ LCD Archive entry:
  6. ;;; LCD Archive Entry:
  7. ;;; emacspeak| T. V. Raman |raman@cs.cornell.edu
  8. ;;; A speech interface to Emacs |
  9. ;;; $Date: 2007-09-01 15:30:13 -0700 (Sat, 01 Sep 2007) $ |
  10. ;;; $Revision: 4532 $ |
  11. ;;; Location undetermined
  12. ;;;
  13. ;;}}}
  14. ;;{{{ Copyright:
  15. ;;;Copyright (C) 1995 -- 2007, T. V. Raman
  16. ;;; Copyright (c) 1994, 1995 by Digital Equipment Corporation.
  17. ;;; All Rights Reserved.
  18. ;;;
  19. ;;; This file is not part of GNU Emacs, but the same permissions apply.
  20. ;;;
  21. ;;; GNU Emacs is free software; you can redistribute it and/or modify
  22. ;;; it under the terms of the GNU General Public License as published by
  23. ;;; the Free Software Foundation; either version 2, or (at your option)
  24. ;;; any later version.
  25. ;;;
  26. ;;; GNU Emacs is distributed in the hope that it will be useful,
  27. ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  28. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  29. ;;; GNU General Public License for more details.
  30. ;;;
  31. ;;; You should have received a copy of the GNU General Public License
  32. ;;; along with GNU Emacs; see the file COPYING. If not, write to
  33. ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  34. ;;}}}
  35. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  36. ;;{{{ Introduction:
  37. ;;; Commentary:
  38. ;;; This module makes compiling code from inside Emacs speech friendly.
  39. ;;; It is an example of how a little amount of code can make Emacspeak even better.
  40. ;;; Code:
  41. ;;}}}
  42. ;;{{{ Required modules
  43. (require 'emacspeak-preamble)
  44. ;;}}}
  45. ;;{{{ Personalities
  46. (voice-setup-add-map
  47. '(
  48. (compilation-line-number voice-smoothen)
  49. (compilation-column-number voice-smoothen)
  50. (compilation-info voice-lighten)
  51. (compilation-error voice-animate-extra)
  52. (compilation-warning voice-animate)
  53. ))
  54. ;;}}}
  55. ;;{{{ functions
  56. (defun emacspeak-compilation-speak-error ()
  57. "Speech feedback about the compilation error. "
  58. (interactive)
  59. (let ((dtk-stop-immediately nil)
  60. (emacspeak-show-point t))
  61. (emacspeak-speak-line)))
  62. ;;}}}
  63. ;;{{{ advice interactive commands
  64. (loop for f in
  65. '(
  66. next-error previous-error
  67. compilation-next-file compilation-previous-file
  68. compile-goto-error compile-mouse-goto-error
  69. )
  70. do
  71. (eval
  72. `(defadvice ,f (after emacspeak pre act )
  73. "Speak the line containing the error. "
  74. (when (interactive-p)
  75. (dtk-stop)
  76. (emacspeak-compilation-speak-error)))))
  77. (loop for f in
  78. '(
  79. compilation-next-error
  80. compilation-previous-error
  81. next-error-no-select
  82. previous-error-no-select)
  83. do
  84. (eval
  85. `(defadvice ,f (after emacspeak pre act comp)
  86. "Provide spoken feedback."
  87. (when (interactive-p)
  88. (emacspeak-speak-line)
  89. (emacspeak-auditory-icon 'select-object)))))
  90. ;;}}}
  91. ;;{{{ advise process filter and sentinels
  92. (defadvice compile (after emacspeak pre act )
  93. "provide auditory confirmation"
  94. (when (interactive-p)
  95. (message "Launched compilation")
  96. (emacspeak-auditory-icon 'select-object)))
  97. (defadvice compilation-sentinel (after emacspeak pre act )
  98. "Provide auditory feedback"
  99. (emacspeak-auditory-icon 'task-done)
  100. (message "process %s %s"
  101. (process-name (ad-get-arg 0))
  102. (ad-get-arg 1 )))
  103. ;;}}}
  104. (provide 'emacspeak-compile)
  105. ;;{{{ emacs local variables
  106. ;;; local variables:
  107. ;;; folded-file: t
  108. ;;; byte-compile-dynamic: t
  109. ;;; end:
  110. ;;}}}