-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathspeechd-common.el
82 lines (60 loc) · 2.59 KB
/
speechd-common.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
;;; speechd-common.el --- Code common to all parts of speechd-el -*- lexical-binding: t -*-
;; Copyright (C) 2004, 2005, 2008 Brailcom, o.p.s.
;; Author: Milan Zamazal <[email protected]>
;; COPYRIGHT NOTICE
;;
;; This program 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 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS 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 this program. If not, see <http://www.gnu.org/licenses/>.
;;; Code:
(defgroup speechd-el ()
"Speechd-el alternative output system."
:group 'environment)
(defcustom speechd-default-text-priority 'text
"Default Speech Dispatcher priority of sent texts."
:type 'speechd-priority-tag
:group 'speechd-el)
(defcustom speechd-default-sound-priority 'message
"Default Speech Dispatcher priority of sent sound icons."
:type 'speechd-priority-tag
:group 'speechd-el)
(defcustom speechd-default-char-priority 'notification
"Default Speech Dispatcher priority of sent single letters."
:type 'speechd-priority-tag
:group 'speechd-el)
(defcustom speechd-default-key-priority 'notification
"Default Speech Dispatcher priority of sent symbols of keys."
:type 'speechd-priority-tag
:group 'speechd-el)
(defvar speechd-client-name "default"
"String defining current client name.
This variable's value defines which connection is used when communicating with
Speech Dispatcher, each connection has its own client name. Usually, you
select the proper client (connection) by assigning a value to this variable
locally through `let'.")
(defvar speechd-language nil
"If non-nil, it is an RFC 1766 language code, as a string.
If text is read and this variable is non-nil, the text is read in the given
language.")
(defun speechd-language (string language)
"Put language property LANGUAGE on whole STRING.
Language should be a string recognizable by Speech Dispatcher as a language
code."
(put-text-property 0 (length string) 'language language string)
string)
(defmacro with-speechd-coding-protection (&rest body)
"Ensure BODY doesn't mess with Emacs dirty coding hacks."
`(let ((last-coding-system-used last-coding-system-used))
,@body))
;;; Announce
(provide 'speechd-common)
;;; speechd-common.el ends here