aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/obsolete
diff options
context:
space:
mode:
authorPaul Eggert2017-01-01 20:23:38 -0800
committerPaul Eggert2017-01-01 20:24:00 -0800
commit367dadf5541f3cc10ba992efb885bd259246ca66 (patch)
treeaae2fca8829bb10046948c1c4b7ea71248f2c4e4 /lisp/obsolete
parent214a67b00b7b47445bcff284168da56b4934ffdb (diff)
downloademacs-367dadf5541f3cc10ba992efb885bd259246ca66.tar.gz
emacs-367dadf5541f3cc10ba992efb885bd259246ca66.zip
Remove mistakenly-added files
Problem reported by Glenn Morris in: http://lists.gnu.org/archive/html/emacs-devel/2017-01/msg00008.html * lisp/gnus/gnus-ems.el, lisp/gnus/gnus-sync.el: * lisp/gnus/messcompat.el, lisp/nxml/nxml-glyph.el: * lisp/nxml/nxml-uchnm.el, lisp/obsolete/awk-mode.el: * lisp/obsolete/iso-acc.el, lisp/obsolete/iso-insert.el: * lisp/obsolete/iso-swed.el, lisp/obsolete/resume.el: * lisp/obsolete/scribe.el, lisp/obsolete/spell.el: * lisp/obsolete/swedish.el, lisp/obsolete/sym-comp.el: Remove files that were added by mistake during a merge.
Diffstat (limited to 'lisp/obsolete')
-rw-r--r--lisp/obsolete/awk-mode.el124
-rw-r--r--lisp/obsolete/iso-acc.el489
-rw-r--r--lisp/obsolete/iso-insert.el630
-rw-r--r--lisp/obsolete/iso-swed.el150
-rw-r--r--lisp/obsolete/resume.el125
-rw-r--r--lisp/obsolete/scribe.el329
-rw-r--r--lisp/obsolete/spell.el171
-rw-r--r--lisp/obsolete/swedish.el160
-rw-r--r--lisp/obsolete/sym-comp.el237
9 files changed, 0 insertions, 2415 deletions
diff --git a/lisp/obsolete/awk-mode.el b/lisp/obsolete/awk-mode.el
deleted file mode 100644
index f42043b8fb2..00000000000
--- a/lisp/obsolete/awk-mode.el
+++ /dev/null
@@ -1,124 +0,0 @@
1;;; awk-mode.el --- AWK code editing commands for Emacs
2
3;; Copyright (C) 1988, 1994, 1996, 2000-2017 Free Software Foundation,
4;; Inc.
5
6;; Maintainer: emacs-devel@gnu.org
7;; Keywords: unix, languages
8;; Obsolete-since: 22.1
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; Sets up C-mode with support for awk-style #-comments and a lightly
28;; hacked syntax table.
29
30;;; Code:
31
32(defvar awk-mode-syntax-table
33 (let ((st (make-syntax-table)))
34 (modify-syntax-entry ?\\ "\\" st)
35 (modify-syntax-entry ?\n "> " st)
36 (modify-syntax-entry ?\f "> " st)
37 (modify-syntax-entry ?\# "< " st)
38 ;; / can delimit regexes or be a division operator. We assume that it is
39 ;; more commonly used for regexes and fix the remaining cases with
40 ;; `font-lock-syntactic-keywords'.
41 (modify-syntax-entry ?/ "\"" st)
42 (modify-syntax-entry ?* "." st)
43 (modify-syntax-entry ?+ "." st)
44 (modify-syntax-entry ?- "." st)
45 (modify-syntax-entry ?= "." st)
46 (modify-syntax-entry ?% "." st)
47 (modify-syntax-entry ?< "." st)
48 (modify-syntax-entry ?> "." st)
49 (modify-syntax-entry ?& "." st)
50 (modify-syntax-entry ?| "." st)
51 (modify-syntax-entry ?_ "_" st)
52 (modify-syntax-entry ?\' "\"" st)
53 st)
54 "Syntax table in use in `awk-mode' buffers.")
55
56;; Regexps written with help from Peter Galbraith <galbraith@mixing.qc.dfo.ca>.
57(defconst awk-font-lock-keywords
58 (eval-when-compile
59 (list
60 ;;
61 ;; Function names.
62 '("^[ \t]*\\(function\\)\\>[ \t]*\\(\\sw+\\)?"
63 (1 font-lock-keyword-face) (2 font-lock-function-name-face nil t))
64 ;;
65 ;; Variable names.
66 (cons (regexp-opt
67 '("ARGC" "ARGIND" "ARGV" "CONVFMT" "ENVIRON" "ERRNO"
68 "FIELDWIDTHS" "FILENAME" "FNR" "FS" "IGNORECASE" "NF" "NR"
69 "OFMT" "OFS" "ORS" "RLENGTH" "RS" "RSTART" "SUBSEP") 'words)
70 'font-lock-variable-name-face)
71 ;;
72 ;; Keywords.
73 (regexp-opt
74 '("BEGIN" "END" "break" "continue" "delete" "do" "exit" "else" "for"
75 "getline" "if" "next" "print" "printf" "return" "while") 'words)
76 ;;
77 ;; Builtins.
78 (list (regexp-opt
79 '("atan2" "close" "cos" "ctime" "exp" "gsub" "index" "int"
80 "length" "log" "match" "rand" "sin" "split" "sprintf"
81 "sqrt" "srand" "sub" "substr" "system" "time"
82 "tolower" "toupper") 'words)
83 1 'font-lock-builtin-face)
84 ;;
85 ;; Operators. Is this too much?
86 (cons (regexp-opt '("&&" "||" "<=" "<" ">=" ">" "==" "!=" "!~" "~"))
87 'font-lock-constant-face)
88 ))
89 "Default expressions to highlight in AWK mode.")
90
91(require 'syntax)
92
93(defconst awk-font-lock-syntactic-keywords
94 ;; `/' is mostly used for /.../ regular expressions, but is also
95 ;; used as a division operator. Distinguishing between the two is
96 ;; a pain in the youknowwhat.
97 ;; '(("\\(^\\|[<=>-+*%/!^,~(?:|&]\\)\\s-*\\(/\\)\\([^/\n\\]\\|\\\\.\\)*\\(/\\)"
98 ;; (2 "\"") (4 "\"")))
99 '(("[^<=>-+*%/!^,~(?:|& \t\n\f]\\s-*\\(/\\)"
100 (1 (unless (nth 3 (syntax-ppss (match-beginning 1))) "."))))
101 "Syntactic keywords for `awk-mode'.")
102
103;; No longer autoloaded since it might clobber the autoload directive in CC Mode.
104(define-derived-mode awk-mode c-mode "AWK"
105 "Major mode for editing AWK code.
106This is much like C mode except for the syntax of comments. Its keymap
107inherits from C mode's and it has the same variables for customizing
108indentation. It has its own abbrev table and its own syntax table.
109
110Turning on AWK mode runs `awk-mode-hook'."
111 (set (make-local-variable 'paragraph-start) (concat "$\\|" page-delimiter))
112 (set (make-local-variable 'paragraph-separate) paragraph-start)
113 (set (make-local-variable 'comment-start) "# ")
114 (set (make-local-variable 'comment-end) "")
115 (set (make-local-variable 'comment-start-skip) "#+ *")
116 (setq font-lock-defaults '(awk-font-lock-keywords
117 nil nil ((?_ . "w")) nil
118 (parse-sexp-lookup-properties . t)
119 (font-lock-syntactic-keywords
120 . awk-font-lock-syntactic-keywords))))
121
122(provide 'awk-mode)
123
124;;; awk-mode.el ends here
diff --git a/lisp/obsolete/iso-acc.el b/lisp/obsolete/iso-acc.el
deleted file mode 100644
index a18d4e543f6..00000000000
--- a/lisp/obsolete/iso-acc.el
+++ /dev/null
@@ -1,489 +0,0 @@
1;;; iso-acc.el --- minor mode providing electric accent keys
2
3;; Copyright (C) 1993-1994, 1996, 2001-2017 Free Software Foundation,
4;; Inc.
5
6;; Author: Johan Vromans
7;; Maintainer: emacs-devel@gnu.org
8;; Keywords: i18n
9;; Obsolete-since: 22.1
10
11;; This file is part of GNU Emacs.
12
13;; GNU Emacs is free software: you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation, either version 3 of the License, or
16;; (at your option) any later version.
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25
26;;; Commentary:
27
28;; Function `iso-accents-mode' activates a minor mode in which
29;; typewriter "dead keys" are emulated. The purpose of this emulation
30;; is to provide a simple means for inserting accented characters
31;; according to the ISO-8859-1...3 character sets.
32;;
33;; In `iso-accents-mode', pseudo accent characters are used to
34;; introduce accented keys. The pseudo-accent characters are:
35;;
36;; ' (minute) -> acute accent
37;; ` (backtick) -> grave accent
38;; " (second) -> diaeresis
39;; ^ (caret) -> circumflex
40;; ~ (tilde) -> tilde over the character
41;; / (slash) -> slash through the character.
42;; Also: /A is A-with-ring and /E is AE ligature.
43;; These two are enabled only if you set iso-accents-enable
44;; to include them:
45;; . (period) -> dot over the character (some languages only)
46;; , (cedilla) -> cedilla under the character (some languages only)
47;;
48;; The action taken depends on the key that follows the pseudo accent.
49;; In general:
50;;
51;; pseudo-accent + appropriate letter -> accented letter
52;; pseudo-accent + space -> pseudo-accent (except comma and period)
53;; pseudo-accent + pseudo-accent -> accent (if available)
54;; pseudo-accent + other -> pseudo-accent + other
55;;
56;; If the pseudo-accent is followed by anything else than a
57;; self-insert-command, the dead-key code is terminated, the
58;; pseudo-accent inserted ‘as is’ and the bell is rung to signal this.
59;;
60;; Function `iso-accents-mode' can be used to enable the iso accents
61;; minor mode, or disable it.
62
63;; If you want only some of these characters to serve as accents,
64;; add a language to `iso-languages' which specifies the accent characters
65;; that you want, then select the language with `iso-accents-customize'.
66
67;;; Code:
68
69(provide 'iso-acc)
70
71(defgroup iso-acc nil
72 "Minor mode providing electric accent keys."
73 :prefix "iso-accents-"
74 :group 'i18n)
75
76(defcustom iso-accents-insert-offset nonascii-insert-offset
77 "Offset added by ISO Accents mode to character codes 0200 and above."
78 :type 'integer
79 :group 'iso-acc)
80
81(defvar iso-languages
82 '(("catalan"
83 ;; Note this includes some extra characters used in Spanish,
84 ;; on the idea that someone who uses Catalan is likely to use Spanish
85 ;; as well.
86 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
87 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
88 (?\ . ?'))
89 (?` (?A . ?\300) (?E . ?\310) (?O . ?\322)
90 (?a . ?\340) (?e . ?\350) (?o . ?\362)
91 (?\ . ?`))
92 (?\" (?I . ?\317) (?U . ?\334) (?i . ?\357) (?u . ?\374)
93 (?\ . ?\"))
94 (?~ (?C . ?\307) (?N . ?\321) (?c . ?\347) (?n . ?\361)
95 (?> . ?\273) (?< . ?\253) (?! . ?\241) (?? . ?\277)
96 (?\ . ?\~)))
97
98 ("esperanto"
99 (?^ (?H . ?\246) (?J . ?\254) (?h . ?\266) (?j . ?\274) (?C . ?\306)
100 (?G . ?\330) (?S . ?\336) (?c . ?\346) (?g . ?\370) (?s . ?\376)
101 (?^ . ?^) (?\ . ?^))
102 (?~ (?U . ?\335) (?u . ?\375) (?\ . ?~)))
103
104 ("french"
105 (?' (?E . ?\311) (?C . ?\307) (?e . ?\351) (?c . ?\347)
106 (?\ . ?'))
107 (?` (?A . ?\300) (?E . ?\310) (?U . ?\331)
108 (?a . ?\340) (?e . ?\350) (?u . ?\371)
109 (?\ . ?`))
110 (?^ (?A . ?\302) (?E . ?\312) (?I . ?\316) (?O . ?\324) (?U . ?\333)
111 (?a . ?\342) (?e . ?\352) (?i . ?\356) (?o . ?\364) (?u . ?\373)
112 (?\ . ?^))
113 (?\" (?E . ?\313) (?I . ?\317)
114 (?e . ?\353) (?i . ?\357)
115 (?\ . ?\"))
116 (?~ (?< . ?\253) (?> . ?\273) (?C . ?\307) (?c . ?\347)
117 (?\ . ?~))
118 (?, (?C . ?\307) (?c . ?\347) (?\ . ?\,)))
119
120 ("german"
121 (?\" (?A . ?\304) (?O . ?\326) (?U . ?\334)
122 (?a . ?\344) (?o . ?\366) (?u . ?\374) (?s . ?\337) (?\ . ?\")))
123
124 ("irish"
125 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
126 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
127 (?\ . ?')))
128
129 ("portuguese"
130 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
131 (?C . ?\307) (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363)
132 (?u . ?\372) (?c . ?\347)
133 (?\ . ?'))
134 (?` (?A . ?\300) (?a . ?\340)
135 (?\ . ?`))
136 (?^ (?A . ?\302) (?E . ?\312) (?O . ?\324)
137 (?a . ?\342) (?e . ?\352) (?o . ?\364)
138 (?\ . ?^))
139 (?\" (?U . ?\334) (?u . ?\374)
140 (?\ . ?\"))
141 (?~ (?A . ?\303) (?O . ?\325) (?a . ?\343) (?o . ?\365)
142 (?C . ?\307) (?N . ?\321) (?c . ?\347) (?n . ?\361)
143 (?\ . ?~))
144 (?, (?c . ?\347) (?C . ?\307) (?, . ?,)))
145
146 ("spanish"
147 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
148 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
149 (?\ . ?'))
150 (?\" (?U . ?\334) (?u . ?\374) (?\ . ?\"))
151 (?\~ (?N . ?\321) (?n . ?\361) (?> . ?\273) (?< . ?\253) (?! . ?\241)
152 (?? . ?\277) (?\ . ?\~)))
153
154 ("latin-1"
155 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
156 (?Y . ?\335) (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363)
157 (?u . ?\372) (?y . ?\375) (?' . ?\264)
158 (?\ . ?'))
159 (?` (?A . ?\300) (?E . ?\310) (?I . ?\314) (?O . ?\322) (?U . ?\331)
160 (?a . ?\340) (?e . ?\350) (?i . ?\354) (?o . ?\362) (?u . ?\371)
161 (?` . ?`) (?\ . ?`))
162 (?^ (?A . ?\302) (?E . ?\312) (?I . ?\316) (?O . ?\324) (?U . ?\333)
163 (?a . ?\342) (?e . ?\352) (?i . ?\356) (?o . ?\364) (?u . ?\373)
164 (?^ . ?^) (?\ . ?^))
165 (?\" (?A . ?\304) (?E . ?\313) (?I . ?\317) (?O . ?\326) (?U . ?\334)
166 (?a . ?\344) (?e . ?\353) (?i . ?\357) (?o . ?\366) (?s . ?\337)
167 (?u . ?\374) (?y . ?\377)
168 (?\" . ?\250) (?\ . ?\"))
169 (?~ (?A . ?\303) (?C . ?\307) (?D . ?\320) (?N . ?\321) (?O . ?\325)
170 (?T . ?\336) (?a . ?\343) (?c . ?\347) (?d . ?\360) (?n . ?\361)
171 (?o . ?\365) (?t . ?\376)
172 (?> . ?\273) (?< . ?\253) (?! . ?\241) (?? . ?\277)
173 (?\~ . ?\270) (?\ . ?~))
174 (?/ (?A . ?\305) (?E . ?\306) (?O . ?\330) (?a . ?\345) (?e . ?\346)
175 (?o . ?\370)
176 (?/ . ?\260) (?\ . ?/)))
177
178 ("latin-2" latin-iso8859-2
179 (?' (?A . ?\301) (?C . ?\306) (?D . ?\320) (?E . ?\311) (?I . ?\315)
180 (?L . ?\305) (?N . ?\321) (?O . ?\323) (?R . ?\300) (?S . ?\246)
181 (?U . ?\332) (?Y . ?\335) (?Z . ?\254)
182 (?a . ?\341) (?c . ?\346) (?d . ?\360) (?e . ?\351) (?i . ?\355)
183 (?l . ?\345) (?n . ?\361) (?o . ?\363) (?r . ?\340) (?s . ?\266)
184 (?u . ?\372) (?y . ?\375) (?z . ?\274)
185 (?' . ?\264) (?\ . ?'))
186 (?` (?A . ?\241) (?C . ?\307) (?E . ?\312) (?L . ?\243) (?S . ?\252)
187 (?T . ?\336) (?Z . ?\257)
188 (?a . ?\261) (?l . ?\263) (?c . ?\347) (?e . ?\352) (?s . ?\272)
189 (?t . ?\376) (?z . ?\277)
190 (?` . ?\252)
191 (?. . ?\377) (?\ . ?`))
192 (?^ (?A . ?\302) (?I . ?\316) (?O . ?\324)
193 (?a . ?\342) (?i . ?\356) (?o . ?\364)
194 (?^ . ?^) ; no special code?
195 (?\ . ?^))
196 (?\" (?A . ?\304) (?E . ?\313) (?O . ?\326) (?U . ?\334)
197 (?a . ?\344) (?e . ?\353) (?o . ?\366) (?s . ?\337) (?u . ?\374)
198 (?\" . ?\250)
199 (?\ . ?\"))
200 (?~ (?A . ?\303) (?C . ?\310) (?D . ?\317) (?L . ?\245) (?N . ?\322)
201 (?O . ?\325) (?R . ?\330) (?S . ?\251) (?T . ?\253) (?U . ?\333)
202 (?Z . ?\256)
203 (?a . ?\343) (?c . ?\350) (?d . ?\357) (?l . ?\265) (?n . ?\362)
204 (?o . ?\365) (?r . ?\370) (?s . ?\271) (?t . ?\273) (?u . ?\373)
205 (?z . ?\276)
206 (?v . ?\242) ; v accent
207 (?\~ . ?\242) ; v accent
208 (?\. . ?\270) ; cedilla accent
209 (?\ . ?~)))
210
211 ("latin-3" latin-iso8859-3
212 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
213 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
214 (?' . ?\264) (?\ . ?'))
215 (?` (?A . ?\300) (?E . ?\310) (?I . ?\314) (?O . ?\322) (?U . ?\331)
216 (?a . ?\340) (?e . ?\350) (?i . ?\354) (?o . ?\362) (?u . ?\371)
217 (?` . ?`) (?\ . ?`))
218 (?^ (?A . ?\302) (?C . ?\306) (?E . ?\312) (?G . ?\330) (?H . ?\246)
219 (?I . ?\316) (?J . ?\254) (?O . ?\324) (?S . ?\336) (?U . ?\333)
220 (?a . ?\342) (?c . ?\346) (?e . ?\352) (?g . ?\370) (?h . ?\266)
221 (?i . ?\356) (?j . ?\274) (?o . ?\364) (?s . ?\376) (?u . ?\373)
222 (?^ . ?^) (?\ . ?^))
223 (?\" (?A . ?\304) (?E . ?\313) (?I . ?\317) (?O . ?\326) (?U . ?\334)
224 (?a . ?\344) (?e . ?\353) (?i . ?\357) (?o . ?\366) (?u . ?\374)
225 (?s . ?\337)
226 (?\" . ?\250) (?\ . ?\"))
227 (?~ (?A . ?\303) (?C . ?\307) (?D . ?\320) (?N . ?\321) (?O . ?\325)
228 (?a . ?\343) (?c . ?\347) (?d . ?\360) (?n . ?\361) (?o . ?\365)
229 (?$ . ?\245) (?S . ?\252) (?s . ?\272) (?G . ?\253) (?g . ?\273)
230 (?U . ?\335) (?u . ?\375) (?` . ?\242)
231 (?~ . ?\270) (?\ . ?~))
232 (?/ (?C . ?\305) (?G . ?\325) (?H . ?\241) (?I . ?\251) (?Z . ?\257)
233 (?c . ?\345) (?g . ?\365) (?h . ?\261) (?i . ?\271) (?z . ?\277)
234 (?r . ?\256)
235 (?. . ?\377) (?# . ?\243) (?$ . ?\244)
236 (?/ . ?\260) (?\ . ?/))
237 (?. (?C . ?\305) (?G . ?\325) (?I . ?\251) (?Z . ?\257)
238 (?c . ?\345) (?g . ?\365) (?z . ?\277))))
239 "List of language-specific customizations for the ISO Accents mode.
240
241Each element of the list is of the form
242
243 (LANGUAGE [CHARSET]
244 (PSEUDO-ACCENT MAPPINGS)
245 (PSEUDO-ACCENT MAPPINGS)
246 ...)
247
248LANGUAGE is a string naming the language.
249CHARSET (which may be omitted) is the symbol name
250 of the character set used in this language.
251 If CHARSET is omitted, latin-iso8859-1 is the default.
252PSEUDO-ACCENT is a char specifying an accent key.
253MAPPINGS are cons cells of the form (CHAR . ISO-CHAR).
254
255The net effect is that the key sequence PSEUDO-ACCENT CHAR is mapped
256to ISO-CHAR on input.")
257
258(defvar iso-language nil
259 "Language for which ISO Accents mode is currently customized.
260Change it with the `iso-accents-customize' function.")
261
262(defvar iso-accents-list nil
263 "Association list for ISO accent combinations, for the chosen language.")
264
265(defcustom iso-accents-mode nil
266 "Non-nil enables ISO Accents mode.
267Setting this variable makes it local to the current buffer.
268See the function `iso-accents-mode'."
269 :type 'boolean
270 :group 'iso-acc)
271(make-variable-buffer-local 'iso-accents-mode)
272
273(defcustom iso-accents-enable '(?' ?` ?^ ?\" ?~ ?/)
274 "List of accent keys that become prefixes in ISO Accents mode.
275The default is (?\\=' ?\\=` ?^ ?\" ?~ ?/), which contains all the supported
276accent keys. If you set this variable to a list in which some of those
277characters are missing, the missing ones do not act as accents.
278
279Note that if you specify a language with `iso-accents-customize',
280that can also turn off certain prefixes (whichever ones are not needed in
281the language you choose)."
282 :type '(repeat character)
283 :group 'iso-acc)
284
285(defun iso-accents-accent-key (prompt)
286 "Modify the following character by adding an accent to it."
287 ;; Pick up the accent character.
288 (if (and iso-accents-mode
289 (memq last-input-event iso-accents-enable))
290 (iso-accents-compose prompt)
291 (vector last-input-event)))
292
293
294;; The iso-accents-compose function is called deep inside Emacs' read
295;; key sequence machinery, so the call to read-event below actually
296;; recurses into that machinery. Doing that does not cause any
297;; problem on its own, but read-event will have marked the window's
298;; display matrix to be accurate -- which is broken by the subsequent
299;; call to delete-region. Therefore, we must call force-window-update
300;; after delete-region to explicitly clear the accurate state of the
301;; window's display matrix.
302
303(defun iso-accents-compose (prompt)
304 (let* ((first-char last-input-event)
305 (list (assq first-char iso-accents-list))
306 ;; Wait for the second key and look up the combination.
307 (second-char (if (or prompt
308 (not (eq (key-binding "a")
309 'self-insert-command))
310 ;; Not at start of a key sequence.
311 (> (length (this-single-command-keys)) 1)
312 ;; Called from anything but the command loop.
313 this-command)
314 (progn
315 (message "%s%c"
316 (or prompt "Compose with ")
317 first-char)
318 (read-event))
319 (insert first-char)
320 (prog1 (read-event)
321 (delete-region (1- (point)) (point))
322 ;; Display is no longer up-to-date.
323 (force-window-update (selected-window)))))
324 (entry (cdr (assq second-char list))))
325 (if entry
326 ;; Found it: return the mapped char
327 (vector
328 (if (and enable-multibyte-characters
329 (>= entry ?\200))
330 (+ iso-accents-insert-offset entry)
331 entry))
332 ;; Otherwise, advance and schedule the second key for execution.
333 (push second-char unread-command-events)
334 (vector first-char))))
335
336;; It is a matter of taste if you want the minor mode indicated
337;; in the mode line...
338;; If so, uncomment the next four lines.
339;; (or (assq 'iso-accents-mode minor-mode-alist)
340;; (setq minor-mode-alist
341;; (append minor-mode-alist
342;; '((iso-accents-mode " ISO-Acc")))))
343
344;;;###autoload
345(defun iso-accents-mode (&optional arg)
346 "Toggle ISO Accents mode, in which accents modify the following letter.
347This permits easy insertion of accented characters according to ISO-8859-1.
348When Iso-accents mode is enabled, accent character keys
349\(\\=`, \\=', \", ^, / and ~) do not self-insert; instead, they modify the following
350letter key so that it inserts an ISO accented letter.
351
352You can customize ISO Accents mode to a particular language
353with the command `iso-accents-customize'.
354
355Special combinations: ~c gives a c with cedilla,
356~d gives an Icelandic eth (d with dash).
357~t gives an Icelandic thorn.
358\"s gives German sharp s.
359/a gives a with ring.
360/e gives an a-e ligature.
361~< and ~> give guillemots.
362~! gives an inverted exclamation mark.
363~? gives an inverted question mark.
364
365With an argument, a positive argument enables ISO Accents mode,
366and a negative argument disables it."
367
368 (interactive "P")
369
370 (if (if arg
371 ;; Negative arg means switch it off.
372 (<= (prefix-numeric-value arg) 0)
373 ;; No arg means toggle.
374 iso-accents-mode)
375 (setq iso-accents-mode nil)
376
377 ;; Enable electric accents.
378 (setq iso-accents-mode t)))
379
380(defun iso-accents-customize (language)
381 "Customize the ISO accents machinery for a particular language.
382It selects the customization based on the specifications in the
383`iso-languages' variable."
384 (interactive (list (completing-read "Language: " iso-languages nil t)))
385 (let ((table (cdr (assoc language iso-languages)))
386 all-accents tail)
387 (if (not table)
388 (error "Unknown language `%s'" language)
389 (setq iso-accents-insert-offset (- (make-char (if (symbolp (car table))
390 (car table)
391 'latin-iso8859-1))
392 128))
393 (if (symbolp (car table))
394 (setq table (cdr table)))
395 (setq iso-language language
396 iso-accents-list table)
397 (if key-translation-map
398 (substitute-key-definition
399 'iso-accents-accent-key nil key-translation-map)
400 (setq key-translation-map (make-sparse-keymap)))
401 ;; Set up translations for all the characters that are used as
402 ;; accent prefixes in this language.
403 (setq tail iso-accents-list)
404 (while tail
405 (define-key key-translation-map (vector (car (car tail)))
406 'iso-accents-accent-key)
407 (setq tail (cdr tail))))))
408
409(defun iso-accentuate (start end)
410 "Convert two-character sequences in region into accented characters.
411Noninteractively, this operates on text from START to END.
412This uses the same conversion that ISO Accents mode uses for type-in."
413 (interactive "r")
414 (save-excursion
415 (save-restriction
416 (narrow-to-region start end)
417 (goto-char start)
418 (forward-char 1)
419 (let (entry)
420 (while (< (point) end)
421 (if (and (memq (preceding-char) iso-accents-enable)
422 (setq entry (cdr (assq (following-char) (assq (preceding-char) iso-accents-list)))))
423 (progn
424 (forward-char -1)
425 (delete-char 2)
426 (insert entry)
427 (setq end (1- end)))
428 (forward-char 1)))))))
429
430(defun iso-accent-rassoc-unit (value alist)
431 (let (elt acc)
432 (while (and alist (not elt))
433 (setq acc (car (car alist))
434 elt (car (rassq value (cdr (car alist))))
435 alist (cdr alist)))
436 (if elt
437 (cons acc elt))))
438
439(defun iso-unaccentuate (start end)
440 "Convert accented characters in the region into two-character sequences.
441Noninteractively, this operates on text from START to END.
442This uses the opposite of the conversion done by ISO Accents mode for type-in."
443 (interactive "r")
444 (save-excursion
445 (save-restriction
446 (narrow-to-region start end)
447 (goto-char start)
448 (let (entry)
449 (while (< (point) end)
450 (if (and (> (following-char) 127)
451 (setq entry (iso-accent-rassoc-unit (following-char)
452 iso-accents-list)))
453 (progn
454 (delete-char 1)
455 (insert (car entry) (cdr entry))
456 (setq end (1+ end)))
457 (forward-char 1)))))))
458
459(defun iso-deaccentuate (start end)
460 "Convert accented characters in the region into unaccented characters.
461Noninteractively, this operates on text from START to END."
462 (interactive "r")
463 (save-excursion
464 (save-restriction
465 (narrow-to-region start end)
466 (goto-char start)
467 (let (entry)
468 (while (< (point) end)
469 (if (and (> (following-char) 127)
470 (setq entry (iso-accent-rassoc-unit (following-char)
471 iso-accents-list)))
472 (progn
473 (delete-char 1)
474 (insert (cdr entry)))
475 (forward-char 1)))))))
476
477;; Set up the default settings.
478(iso-accents-customize "latin-1")
479
480;; Use Iso-Accents mode in the minibuffer
481;; if it was in use in the previous buffer.
482(defun iso-acc-minibuf-setup ()
483 (setq iso-accents-mode
484 (with-current-buffer (window-buffer minibuffer-scroll-window)
485 iso-accents-mode)))
486
487(add-hook 'minibuffer-setup-hook 'iso-acc-minibuf-setup)
488
489;;; iso-acc.el ends here
diff --git a/lisp/obsolete/iso-insert.el b/lisp/obsolete/iso-insert.el
deleted file mode 100644
index 1075ae03e0c..00000000000
--- a/lisp/obsolete/iso-insert.el
+++ /dev/null
@@ -1,630 +0,0 @@
1;;; iso-insert.el --- insert functions for ISO 8859/1
2
3;; Copyright (C) 1987, 1994, 2001-2017 Free Software Foundation, Inc.
4
5;; Author: Howard Gayle
6;; Maintainer: emacs-devel@gnu.org
7;; Keywords: i18n
8;; Obsolete-since: 22.1
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; Provides keys for inserting ISO Latin-1 characters. They use the
28;; prefix key C-x 8. Type C-x 8 C-h for a list.
29
30;;; Code:
31
32(defun insert-no-break-space ()
33 (interactive "*")
34 (insert ?\ )
35)
36
37(defun insert-inverted-exclamation-mark ()
38 (interactive "*")
39 (insert ?\¡)
40)
41
42(defun insert-cent-sign ()
43 (interactive "*")
44 (insert ?\¢)
45)
46
47(defun insert-pound-sign ()
48 (interactive "*")
49 (insert ?\£)
50)
51
52(defun insert-general-currency-sign ()
53 (interactive "*")
54 (insert ?\¤)
55)
56
57(defun insert-yen-sign ()
58 (interactive "*")
59 (insert ?\¥)
60)
61
62(defun insert-broken-vertical-line ()
63 (interactive "*")
64 (insert ?\¦)
65)
66
67(defun insert-section-sign ()
68 (interactive "*")
69 (insert ?\§)
70)
71
72(defun insert-diaeresis ()
73 (interactive "*")
74 (insert ?\¨)
75)
76
77(defun insert-copyright-sign ()
78 (interactive "*")
79 (insert ?\©)
80)
81
82(defun insert-ordinal-indicator-feminine ()
83 (interactive "*")
84 (insert ?\ª)
85)
86
87(defun insert-angle-quotation-mark-left ()
88 (interactive "*")
89 (insert ?\«)
90)
91
92(defun insert-not-sign ()
93 (interactive "*")
94 (insert ?\¬)
95)
96
97(defun insert-soft-hyphen ()
98 (interactive "*")
99 (insert ?\­)
100)
101
102(defun insert-registered-sign ()
103 (interactive "*")
104 (insert ?\®)
105)
106
107(defun insert-macron ()
108 (interactive "*")
109 (insert ?\¯)
110)
111
112(defun insert-degree-sign ()
113 (interactive "*")
114 (insert ?\°)
115)
116
117(defun insert-plus-or-minus-sign ()
118 (interactive "*")
119 (insert ?\±)
120)
121
122(defun insert-superscript-two ()
123 (interactive "*")
124 (insert ?\²)
125)
126
127(defun insert-superscript-three ()
128 (interactive "*")
129 (insert ?\³)
130)
131
132(defun insert-acute-accent ()
133 (interactive "*")
134 (insert ?\´)
135)
136
137(defun insert-micro-sign ()
138 (interactive "*")
139 (insert ?\µ)
140)
141
142(defun insert-pilcrow ()
143 (interactive "*")
144 (insert ?\¶)
145)
146
147(defun insert-middle-dot ()
148 (interactive "*")
149 (insert ?\·)
150)
151
152(defun insert-cedilla ()
153 (interactive "*")
154 (insert ?\¸)
155)
156
157(defun insert-superscript-one ()
158 (interactive "*")
159 (insert ?\¹)
160)
161
162(defun insert-ordinal-indicator-masculine ()
163 (interactive "*")
164 (insert ?\º)
165)
166
167(defun insert-angle-quotation-mark-right ()
168 (interactive "*")
169 (insert ?\»)
170)
171
172(defun insert-fraction-one-quarter ()
173 (interactive "*")
174 (insert ?\¼)
175)
176
177(defun insert-fraction-one-half ()
178 (interactive "*")
179 (insert ?\½)
180)
181
182(defun insert-fraction-three-quarters ()
183 (interactive "*")
184 (insert ?\¾)
185)
186
187(defun insert-inverted-question-mark ()
188 (interactive "*")
189 (insert ?\¿)
190)
191
192(defun insert-A-grave ()
193 (interactive "*")
194 (insert ?\À)
195)
196
197(defun insert-A-acute ()
198 (interactive "*")
199 (insert ?\Á)
200)
201
202(defun insert-A-circumflex ()
203 (interactive "*")
204 (insert ?\Â)
205)
206
207(defun insert-A-tilde ()
208 (interactive "*")
209 (insert ?\Ã)
210)
211
212(defun insert-A-umlaut ()
213 (interactive "*")
214 (insert ?\Ä)
215)
216
217(defun insert-A-ring ()
218 (interactive "*")
219 (insert ?\Å)
220)
221
222(defun insert-AE ()
223 (interactive "*")
224 (insert ?\Æ)
225)
226
227(defun insert-C-cedilla ()
228 (interactive "*")
229 (insert ?\Ç)
230)
231
232(defun insert-E-grave ()
233 (interactive "*")
234 (insert ?\È)
235)
236
237(defun insert-E-acute ()
238 (interactive "*")
239 (insert ?\É)
240)
241
242(defun insert-E-circumflex ()
243 (interactive "*")
244 (insert ?\Ê)
245)
246
247(defun insert-E-umlaut ()
248 (interactive "*")
249 (insert ?\Ë)
250)
251
252(defun insert-I-grave ()
253 (interactive "*")
254 (insert ?\Ì)
255)
256
257(defun insert-I-acute ()
258 (interactive "*")
259 (insert ?\Í)
260)
261
262(defun insert-I-circumflex ()
263 (interactive "*")
264 (insert ?\Î)
265)
266
267(defun insert-I-umlaut ()
268 (interactive "*")
269 (insert ?\Ï)
270)
271
272(defun insert-D-stroke ()
273 (interactive "*")
274 (insert ?\Ð)
275)
276
277(defun insert-N-tilde ()
278 (interactive "*")
279 (insert ?\Ñ)
280)
281
282(defun insert-O-grave ()
283 (interactive "*")
284 (insert ?\Ò)
285)
286
287(defun insert-O-acute ()
288 (interactive "*")
289 (insert ?\Ó)
290)
291
292(defun insert-O-circumflex ()
293 (interactive "*")
294 (insert ?\Ô)
295)
296
297(defun insert-O-tilde ()
298 (interactive "*")
299 (insert ?\Õ)
300)
301
302(defun insert-O-umlaut ()
303 (interactive "*")
304 (insert ?\Ö)
305)
306
307(defun insert-multiplication-sign ()
308 (interactive "*")
309 (insert ?\×)
310)
311
312(defun insert-O-slash ()
313 (interactive "*")
314 (insert ?\Ø)
315)
316
317(defun insert-U-grave ()
318 (interactive "*")
319 (insert ?\Ù)
320)
321
322(defun insert-U-acute ()
323 (interactive "*")
324 (insert ?\Ú)
325)
326
327(defun insert-U-circumflex ()
328 (interactive "*")
329 (insert ?\Û)
330)
331
332(defun insert-U-umlaut ()
333 (interactive "*")
334 (insert ?\Ü)
335)
336
337(defun insert-Y-acute ()
338 (interactive "*")
339 (insert ?\Ý)
340)
341
342(defun insert-THORN ()
343 (interactive "*")
344 (insert ?\Þ)
345)
346
347(defun insert-ss ()
348 (interactive "*")
349 (insert ?\ß)
350)
351
352(defun insert-a-grave ()
353 (interactive "*")
354 (insert ?\à)
355)
356
357(defun insert-a-acute ()
358 (interactive "*")
359 (insert ?\á)
360)
361
362(defun insert-a-circumflex ()
363 (interactive "*")
364 (insert ?\â)
365)
366
367(defun insert-a-tilde ()
368 (interactive "*")
369 (insert ?\ã)
370)
371
372(defun insert-a-umlaut ()
373 (interactive "*")
374 (insert ?\ä)
375)
376
377(defun insert-a-ring ()
378 (interactive "*")
379 (insert ?\å)
380)
381
382(defun insert-ae ()
383 (interactive "*")
384 (insert ?\æ)
385)
386
387(defun insert-c-cedilla ()
388 (interactive "*")
389 (insert ?\ç)
390)
391
392(defun insert-e-grave ()
393 (interactive "*")
394 (insert ?\è)
395)
396
397(defun insert-e-acute ()
398 (interactive "*")
399 (insert ?\é)
400)
401
402(defun insert-e-circumflex ()
403 (interactive "*")
404 (insert ?\ê)
405)
406
407(defun insert-e-umlaut ()
408 (interactive "*")
409 (insert ?\ë)
410)
411
412(defun insert-i-grave ()
413 (interactive "*")
414 (insert ?\ì)
415)
416
417(defun insert-i-acute ()
418 (interactive "*")
419 (insert ?\í)
420)
421
422(defun insert-i-circumflex ()
423 (interactive "*")
424 (insert ?\î)
425)
426
427(defun insert-i-umlaut ()
428 (interactive "*")
429 (insert ?\ï)
430)
431
432(defun insert-d-stroke ()
433 (interactive "*")
434 (insert ?\ð)
435)
436
437(defun insert-n-tilde ()
438 (interactive "*")
439 (insert ?\ñ)
440)
441
442(defun insert-o-grave ()
443 (interactive "*")
444 (insert ?\ò)
445)
446
447(defun insert-o-acute ()
448 (interactive "*")
449 (insert ?\ó)
450)
451
452(defun insert-o-circumflex ()
453 (interactive "*")
454 (insert ?\ô)
455)
456
457(defun insert-o-tilde ()
458 (interactive "*")
459 (insert ?\õ)
460)
461
462(defun insert-o-umlaut ()
463 (interactive "*")
464 (insert ?\ö)
465)
466
467(defun insert-division-sign ()
468 (interactive "*")
469 (insert ?\÷)
470)
471
472(defun insert-o-slash ()
473 (interactive "*")
474 (insert ?\ø)
475)
476
477(defun insert-u-grave ()
478 (interactive "*")
479 (insert ?\ù)
480)
481
482(defun insert-u-acute ()
483 (interactive "*")
484 (insert ?\ú)
485)
486
487(defun insert-u-circumflex ()
488 (interactive "*")
489 (insert ?\û)
490)
491
492(defun insert-u-umlaut ()
493 (interactive "*")
494 (insert ?\ü)
495)
496
497(defun insert-y-acute ()
498 (interactive "*")
499 (insert ?\ý)
500)
501
502(defun insert-thorn ()
503 (interactive "*")
504 (insert ?\þ)
505)
506
507(defun insert-y-umlaut ()
508 (interactive "*")
509 (insert ?\ÿ)
510)
511
512(defvar 8859-1-map nil "Keymap for ISO 8859/1 character insertion.")
513(if 8859-1-map nil
514 (setq 8859-1-map (make-keymap))
515 (define-key 8859-1-map " " 'insert-no-break-space)
516 (define-key 8859-1-map "!" 'insert-inverted-exclamation-mark)
517 (define-key 8859-1-map "\"" (make-sparse-keymap))
518 (define-key 8859-1-map "\"\"" 'insert-diaeresis)
519 (define-key 8859-1-map "\"A" 'insert-A-umlaut)
520 (define-key 8859-1-map "\"E" 'insert-E-umlaut)
521 (define-key 8859-1-map "\"I" 'insert-I-umlaut)
522 (define-key 8859-1-map "\"O" 'insert-O-umlaut)
523 (define-key 8859-1-map "\"U" 'insert-U-umlaut)
524 (define-key 8859-1-map "\"a" 'insert-a-umlaut)
525 (define-key 8859-1-map "\"e" 'insert-e-umlaut)
526 (define-key 8859-1-map "\"i" 'insert-i-umlaut)
527 (define-key 8859-1-map "\"o" 'insert-o-umlaut)
528 (define-key 8859-1-map "\"u" 'insert-u-umlaut)
529 (define-key 8859-1-map "\"y" 'insert-y-umlaut)
530 (define-key 8859-1-map "'" (make-sparse-keymap))
531 (define-key 8859-1-map "''" 'insert-acute-accent)
532 (define-key 8859-1-map "'A" 'insert-A-acute)
533 (define-key 8859-1-map "'E" 'insert-E-acute)
534 (define-key 8859-1-map "'I" 'insert-I-acute)
535 (define-key 8859-1-map "'O" 'insert-O-acute)
536 (define-key 8859-1-map "'U" 'insert-U-acute)
537 (define-key 8859-1-map "'Y" 'insert-Y-acute)
538 (define-key 8859-1-map "'a" 'insert-a-acute)
539 (define-key 8859-1-map "'e" 'insert-e-acute)
540 (define-key 8859-1-map "'i" 'insert-i-acute)
541 (define-key 8859-1-map "'o" 'insert-o-acute)
542 (define-key 8859-1-map "'u" 'insert-u-acute)
543 (define-key 8859-1-map "'y" 'insert-y-acute)
544 (define-key 8859-1-map "$" 'insert-general-currency-sign)
545 (define-key 8859-1-map "+" 'insert-plus-or-minus-sign)
546 (define-key 8859-1-map "," (make-sparse-keymap))
547 (define-key 8859-1-map ",," 'insert-cedilla)
548 (define-key 8859-1-map ",C" 'insert-C-cedilla)
549 (define-key 8859-1-map ",c" 'insert-c-cedilla)
550 (define-key 8859-1-map "-" 'insert-soft-hyphen)
551 (define-key 8859-1-map "." 'insert-middle-dot)
552 (define-key 8859-1-map "/" (make-sparse-keymap))
553 (define-key 8859-1-map "//" 'insert-division-sign)
554 (define-key 8859-1-map "/O" 'insert-O-slash)
555 (define-key 8859-1-map "/o" 'insert-o-slash)
556 (define-key 8859-1-map "1" (make-sparse-keymap))
557 (define-key 8859-1-map "1/" (make-sparse-keymap))
558 (define-key 8859-1-map "1/2" 'insert-fraction-one-half)
559 (define-key 8859-1-map "1/4" 'insert-fraction-one-quarter)
560 (define-key 8859-1-map "3" (make-sparse-keymap))
561 (define-key 8859-1-map "3/" (make-sparse-keymap))
562 (define-key 8859-1-map "3/4" 'insert-fraction-three-quarters)
563 (define-key 8859-1-map "<" 'insert-angle-quotation-mark-left)
564 (define-key 8859-1-map "=" 'insert-macron)
565 (define-key 8859-1-map ">" 'insert-angle-quotation-mark-right)
566 (define-key 8859-1-map "?" 'insert-inverted-question-mark)
567 (define-key 8859-1-map "A" 'insert-A-ring)
568 (define-key 8859-1-map "E" 'insert-AE)
569 (define-key 8859-1-map "C" 'insert-copyright-sign)
570 (define-key 8859-1-map "D" 'insert-D-stroke)
571 (define-key 8859-1-map "L" 'insert-pound-sign)
572 (define-key 8859-1-map "P" 'insert-pilcrow)
573 (define-key 8859-1-map "R" 'insert-registered-sign)
574 (define-key 8859-1-map "S" 'insert-section-sign)
575 (define-key 8859-1-map "T" 'insert-THORN)
576 (define-key 8859-1-map "Y" 'insert-yen-sign)
577 (define-key 8859-1-map "^" (make-sparse-keymap))
578 (define-key 8859-1-map "^1" 'insert-superscript-one)
579 (define-key 8859-1-map "^2" 'insert-superscript-two)
580 (define-key 8859-1-map "^3" 'insert-superscript-three)
581 (define-key 8859-1-map "^A" 'insert-A-circumflex)
582 (define-key 8859-1-map "^E" 'insert-E-circumflex)
583 (define-key 8859-1-map "^I" 'insert-I-circumflex)
584 (define-key 8859-1-map "^O" 'insert-O-circumflex)
585 (define-key 8859-1-map "^U" 'insert-U-circumflex)
586 (define-key 8859-1-map "^a" 'insert-a-circumflex)
587 (define-key 8859-1-map "^e" 'insert-e-circumflex)
588 (define-key 8859-1-map "^i" 'insert-i-circumflex)
589 (define-key 8859-1-map "^o" 'insert-o-circumflex)
590 (define-key 8859-1-map "^u" 'insert-u-circumflex)
591 (define-key 8859-1-map "_" (make-sparse-keymap))
592 (define-key 8859-1-map "_a" 'insert-ordinal-indicator-feminine)
593 (define-key 8859-1-map "_o" 'insert-ordinal-indicator-masculine)
594 (define-key 8859-1-map "`" (make-sparse-keymap))
595 (define-key 8859-1-map "`A" 'insert-A-grave)
596 (define-key 8859-1-map "`E" 'insert-E-grave)
597 (define-key 8859-1-map "`I" 'insert-I-grave)
598 (define-key 8859-1-map "`O" 'insert-O-grave)
599 (define-key 8859-1-map "`U" 'insert-U-grave)
600 (define-key 8859-1-map "`a" 'insert-a-grave)
601 (define-key 8859-1-map "`e" 'insert-e-grave)
602 (define-key 8859-1-map "`i" 'insert-i-grave)
603 (define-key 8859-1-map "`o" 'insert-o-grave)
604 (define-key 8859-1-map "`u" 'insert-u-grave)
605 (define-key 8859-1-map "a" 'insert-a-ring)
606 (define-key 8859-1-map "e" 'insert-ae)
607 (define-key 8859-1-map "c" 'insert-cent-sign)
608 (define-key 8859-1-map "d" 'insert-d-stroke)
609 (define-key 8859-1-map "o" 'insert-degree-sign)
610 (define-key 8859-1-map "s" 'insert-ss)
611 (define-key 8859-1-map "t" 'insert-thorn)
612 (define-key 8859-1-map "u" 'insert-micro-sign)
613 (define-key 8859-1-map "x" 'insert-multiplication-sign)
614 (define-key 8859-1-map "|" 'insert-broken-vertical-line)
615 (define-key 8859-1-map "~" (make-sparse-keymap))
616 (define-key 8859-1-map "~A" 'insert-A-tilde)
617 (define-key 8859-1-map "~N" 'insert-N-tilde)
618 (define-key 8859-1-map "~O" 'insert-O-tilde)
619 (define-key 8859-1-map "~a" 'insert-a-tilde)
620 (define-key 8859-1-map "~n" 'insert-n-tilde)
621 (define-key 8859-1-map "~o" 'insert-o-tilde)
622 (define-key 8859-1-map "~~" 'insert-not-sign)
623 (if (not (lookup-key global-map "\C-x8"))
624 (define-key global-map "\C-x8" 8859-1-map))
625)
626(defalias '8859-1-map 8859-1-map)
627
628(provide 'iso-insert)
629
630;;; iso-insert.el ends here
diff --git a/lisp/obsolete/iso-swed.el b/lisp/obsolete/iso-swed.el
deleted file mode 100644
index e3231be20e9..00000000000
--- a/lisp/obsolete/iso-swed.el
+++ /dev/null
@@ -1,150 +0,0 @@
1;;; iso-swed.el --- set up char tables for ISO 8859/1 for Swedish/Finnish ttys
2
3;; Copyright (C) 1987, 2001-2017 Free Software Foundation, Inc.
4
5;; Author: Howard Gayle
6;; Maintainer: emacs-devel@gnu.org
7;; Keywords: i18n
8;; Obsolete-since: 22.1
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; Written by Howard Gayle. See case-table.el for details.
28
29;;; Code:
30
31;; This code sets up to display ISO 8859/1 characters on
32;; terminals that have ASCII in the G0 set and a Swedish/Finnish
33;; version of ISO 646 in the G1 set. The G1 set differs from
34;; ASCII as follows:
35;;
36;; ASCII G1
37;; $ general currency sign
38;; @ capital E with acute accent
39;; [ capital A with diaeresis or umlaut mark
40;; \ capital O with diaeresis or umlaut mark
41;; ] capital A with ring
42;; ^ capital U with diaeresis or umlaut mark
43;; ` small e with acute accent
44;; { small a with diaeresis or umlaut mark
45;; | small o with diaeresis or umlaut mark
46;; } small a with ring
47;; ~ small u with diaeresis or umlaut mark
48
49(require 'disp-table)
50
51(standard-display-ascii 160 "{_}") ; NBSP (no-break space)
52(standard-display-ascii 161 "{!}") ; inverted exclamation mark
53(standard-display-ascii 162 "{c}") ; cent sign
54(standard-display-ascii 163 "{GBP}") ; pound sign
55(standard-display-g1 164 ?$) ; general currency sign
56(standard-display-ascii 165 "{JPY}") ; yen sign
57(standard-display-ascii 166 "{|}") ; broken vertical line
58(standard-display-ascii 167 "{S}") ; section sign
59(standard-display-ascii 168 "{\"}") ; diaeresis
60(standard-display-ascii 169 "{C}") ; copyright sign
61(standard-display-ascii 170 "{_a}") ; ordinal indicator, feminine
62(standard-display-ascii 171 "{<<}") ; left angle quotation mark
63(standard-display-ascii 172 "{~}") ; not sign
64(standard-display-ascii 173 "{-}") ; soft hyphen
65(standard-display-ascii 174 "{R}") ; registered sign
66(standard-display-ascii 175 "{=}") ; macron
67(standard-display-ascii 176 "{o}") ; degree sign
68(standard-display-ascii 177 "{+-}") ; plus or minus sign
69(standard-display-ascii 178 "{2}") ; superscript two
70(standard-display-ascii 179 "{3}") ; superscript three
71(standard-display-ascii 180 "{'}") ; acute accent
72(standard-display-ascii 181 "{u}") ; micro sign
73(standard-display-ascii 182 "{P}") ; pilcrow
74(standard-display-ascii 183 "{.}") ; middle dot
75(standard-display-ascii 184 "{,}") ; cedilla
76(standard-display-ascii 185 "{1}") ; superscript one
77(standard-display-ascii 186 "{_o}") ; ordinal indicator, masculine
78(standard-display-ascii 187 "{>>}") ; right angle quotation mark
79(standard-display-ascii 188 "{1/4}") ; fraction one-quarter
80(standard-display-ascii 189 "{1/2}") ; fraction one-half
81(standard-display-ascii 190 "{3/4}") ; fraction three-quarters
82(standard-display-ascii 191 "{?}") ; inverted question mark
83(standard-display-ascii 192 "{`A}") ; A with grave accent
84(standard-display-ascii 193 "{'A}") ; A with acute accent
85(standard-display-ascii 194 "{^A}") ; A with circumflex accent
86(standard-display-ascii 195 "{~A}") ; A with tilde
87(standard-display-g1 196 ?[) ; A with diaeresis or umlaut mark
88(standard-display-g1 197 ?]) ; A with ring
89(standard-display-ascii 198 "{AE}") ; AE diphthong
90(standard-display-ascii 199 "{,C}") ; C with cedilla
91(standard-display-ascii 200 "{`E}") ; E with grave accent
92(standard-display-g1 201 ?@) ; E with acute accent
93(standard-display-ascii 202 "{^E}") ; E with circumflex accent
94(standard-display-ascii 203 "{\"E}") ; E with diaeresis or umlaut mark
95(standard-display-ascii 204 "{`I}") ; I with grave accent
96(standard-display-ascii 205 "{'I}") ; I with acute accent
97(standard-display-ascii 206 "{^I}") ; I with circumflex accent
98(standard-display-ascii 207 "{\"I}") ; I with diaeresis or umlaut mark
99(standard-display-ascii 208 "{-D}") ; D with stroke, Icelandic eth
100(standard-display-ascii 209 "{~N}") ; N with tilde
101(standard-display-ascii 210 "{`O}") ; O with grave accent
102(standard-display-ascii 211 "{'O}") ; O with acute accent
103(standard-display-ascii 212 "{^O}") ; O with circumflex accent
104(standard-display-ascii 213 "{~O}") ; O with tilde
105(standard-display-g1 214 ?\\) ; O with diaeresis or umlaut mark
106(standard-display-ascii 215 "{x}") ; multiplication sign
107(standard-display-ascii 216 "{/O}") ; O with slash
108(standard-display-ascii 217 "{`U}") ; U with grave accent
109(standard-display-ascii 218 "{'U}") ; U with acute accent
110(standard-display-ascii 219 "{^U}") ; U with circumflex accent
111(standard-display-g1 220 ?^) ; U with diaeresis or umlaut mark
112(standard-display-ascii 221 "{'Y}") ; Y with acute accent
113(standard-display-ascii 222 "{TH}") ; capital thorn, Icelandic
114(standard-display-ascii 223 "{ss}") ; small sharp s, German
115(standard-display-ascii 224 "{`a}") ; a with grave accent
116(standard-display-ascii 225 "{'a}") ; a with acute accent
117(standard-display-ascii 226 "{^a}") ; a with circumflex accent
118(standard-display-ascii 227 "{~a}") ; a with tilde
119(standard-display-g1 228 ?{) ; a with diaeresis or umlaut mark
120(standard-display-g1 229 ?}) ; a with ring
121(standard-display-ascii 230 "{ae}") ; ae diphthong
122(standard-display-ascii 231 "{,c}") ; c with cedilla
123(standard-display-ascii 232 "{`e}") ; e with grave accent
124(standard-display-g1 233 ?`) ; e with acute accent
125(standard-display-ascii 234 "{^e}") ; e with circumflex accent
126(standard-display-ascii 235 "{\"e}") ; e with diaeresis or umlaut mark
127(standard-display-ascii 236 "{`i}") ; i with grave accent
128(standard-display-ascii 237 "{'i}") ; i with acute accent
129(standard-display-ascii 238 "{^i}") ; i with circumflex accent
130(standard-display-ascii 239 "{\"i}") ; i with diaeresis or umlaut mark
131(standard-display-ascii 240 "{-d}") ; d with stroke, Icelandic eth
132(standard-display-ascii 241 "{~n}") ; n with tilde
133(standard-display-ascii 242 "{`o}") ; o with grave accent
134(standard-display-ascii 243 "{'o}") ; o with acute accent
135(standard-display-ascii 244 "{^o}") ; o with circumflex accent
136(standard-display-ascii 245 "{~o}") ; o with tilde
137(standard-display-g1 246 ?|) ; o with diaeresis or umlaut mark
138(standard-display-ascii 247 "{/}") ; division sign
139(standard-display-ascii 248 "{/o}") ; o with slash
140(standard-display-ascii 249 "{`u}") ; u with grave accent
141(standard-display-ascii 250 "{'u}") ; u with acute accent
142(standard-display-ascii 251 "{^u}") ; u with circumflex accent
143(standard-display-g1 252 ?~) ; u with diaeresis or umlaut mark
144(standard-display-ascii 253 "{'y}") ; y with acute accent
145(standard-display-ascii 254 "{th}") ; small thorn, Icelandic
146(standard-display-ascii 255 "{\"y}") ; small y with diaeresis or umlaut mark
147
148(provide 'iso-swed)
149
150;;; iso-swed.el ends here
diff --git a/lisp/obsolete/resume.el b/lisp/obsolete/resume.el
deleted file mode 100644
index b4dfab29479..00000000000
--- a/lisp/obsolete/resume.el
+++ /dev/null
@@ -1,125 +0,0 @@
1;;; resume.el --- process command line args from within a suspended Emacs job
2
3;; Copyright (C) 1992, 2001-2017 Free Software Foundation, Inc.
4
5;; Author: Joe Wells <jbw@bucsf.bu.edu>
6;; Adapted-By: ESR
7;; Keywords: processes
8;; Obsolete-since: 23.1
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; The purpose of this library is to handle command line arguments
28;; when you resume an existing Emacs job.
29
30;; In order to use it, you must put this code in your .emacs file.
31
32;; (add-hook 'suspend-hook 'resume-suspend-hook)
33;; (add-hook 'suspend-resume-hook 'resume-process-args)
34
35;; You can't get the benefit of this library by using the `emacs' command,
36;; since that always starts a new Emacs job. Instead you must use a
37;; command called `edit' which knows how to resume an existing Emacs job
38;; if you have one, or start a new Emacs job if you don't have one.
39
40;; To define the `edit' command, run the script etc/emacs.csh (if you use CSH),
41;; or etc/emacs.bash if you use BASH. You would normally do this in your
42;; login script.
43
44;; Stephan Gildea suggested bug fix (gildea@bbn.com).
45;; Ideas from Michael DeCorte and other people.
46
47;;; Code:
48
49(defvar resume-emacs-args-file (expand-file-name "~/.emacs_args")
50 "This file is where arguments are placed for a suspended Emacs job.")
51
52(defvar resume-emacs-args-buffer " *Command Line Args*"
53 "Buffer that is used by `resume-process-args'.")
54
55(defun resume-process-args ()
56 "Handler for command line args given when Emacs is resumed."
57 (let ((start-buffer (current-buffer))
58 (args-buffer (get-buffer-create resume-emacs-args-buffer))
59 length args
60 (command-line-default-directory default-directory))
61 (unwind-protect
62 (progn
63 (set-buffer args-buffer)
64 (erase-buffer)
65 ;; get the contents of resume-emacs-args-file
66 (condition-case ()
67 (let ((result (insert-file-contents resume-emacs-args-file)))
68 (setq length (car (cdr result))))
69 ;; the file doesn't exist, ergo no arguments
70 (file-error
71 (erase-buffer)
72 (setq length 0)))
73 (if (<= length 0)
74 (setq args nil)
75 ;; get the arguments from the buffer
76 (goto-char (point-min))
77 (while (not (eobp))
78 (skip-chars-forward " \t\n")
79 (let ((begin (point)))
80 (skip-chars-forward "^ \t\n")
81 (setq args (cons (buffer-substring begin (point)) args)))
82 (skip-chars-forward " \t\n"))
83 ;; arguments are now in reverse order
84 (setq args (nreverse args))
85 ;; make sure they're not read again
86 (erase-buffer))
87 (resume-write-buffer-to-file (current-buffer) resume-emacs-args-file)
88 ;; if nothing was in buffer, args will be null
89 (or (null args)
90 (setq command-line-default-directory
91 (file-name-as-directory (car args))
92 args (cdr args)))
93 ;; actually process the arguments
94 (command-line-1 args))
95 ;; If the command line args don't result in a find-file, the
96 ;; buffer will be left in args-buffer. So we change back to the
97 ;; original buffer. The reason I don't just use
98 ;; (let ((default-directory foo))
99 ;; (command-line-1 args))
100 ;; in the context of the original buffer is because let does not
101 ;; work properly with buffer-local variables.
102 (if (eq (current-buffer) args-buffer)
103 (set-buffer start-buffer)))))
104
105;;;###autoload
106(defun resume-suspend-hook ()
107 "Clear out the file used for transmitting args when Emacs resumes."
108 (with-current-buffer (get-buffer-create resume-emacs-args-buffer)
109 (erase-buffer)
110 (resume-write-buffer-to-file (current-buffer) resume-emacs-args-file)))
111
112(defun resume-write-buffer-to-file (buffer file)
113 "Writes the contents of BUFFER into FILE, if permissions allow."
114 (if (not (file-writable-p file))
115 (error "No permission to write file %s" file))
116 (with-current-buffer buffer
117 (clear-visited-file-modtime)
118 (save-restriction
119 (widen)
120 (write-region (point-min) (point-max) file nil 'quiet))
121 (set-buffer-modified-p nil)))
122
123(provide 'resume)
124
125;;; resume.el ends here
diff --git a/lisp/obsolete/scribe.el b/lisp/obsolete/scribe.el
deleted file mode 100644
index f9ec9c953c0..00000000000
--- a/lisp/obsolete/scribe.el
+++ /dev/null
@@ -1,329 +0,0 @@
1;;; scribe.el --- scribe mode, and its idiosyncratic commands
2
3;; Copyright (C) 1985, 2001-2017 Free Software Foundation, Inc.
4
5;; Author: William Sommerfeld
6;; (according to ack.texi)
7;; Maintainer: emacs-devel@gnu.org
8;; Keywords: wp
9;; Obsolete-since: 22.1
10
11;; This file is part of GNU Emacs.
12
13;; GNU Emacs is free software: you can redistribute it and/or modify
14;; it under the terms of the GNU General Public License as published by
15;; the Free Software Foundation, either version 3 of the License, or
16;; (at your option) any later version.
17
18;; GNU Emacs is distributed in the hope that it will be useful,
19;; but WITHOUT ANY WARRANTY; without even the implied warranty of
20;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21;; GNU General Public License for more details.
22
23;; You should have received a copy of the GNU General Public License
24;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
25
26;;; Commentary:
27
28;; A major mode for editing source in written for the Scribe text formatter.
29;; Knows about Scribe syntax and standard layout rules. The command to
30;; run Scribe on a buffer is bogus; someone interested should fix it.
31
32;;; Code:
33
34(defvar compile-command)
35
36(defgroup scribe nil
37 "Scribe mode."
38 :prefix "scribe-"
39 :group 'wp)
40
41(defvar scribe-mode-syntax-table nil
42 "Syntax table used while in scribe mode.")
43
44(defvar scribe-mode-abbrev-table nil
45 "Abbrev table used while in scribe mode.")
46
47(defcustom scribe-fancy-paragraphs nil
48 "Non-nil makes Scribe mode use a different style of paragraph separation."
49 :type 'boolean
50 :group 'scribe)
51
52(defcustom scribe-electric-quote nil
53 "Non-nil makes insert of double quote use \\=`\\=` or \\='\\=' depending on context."
54 :type 'boolean
55 :group 'scribe)
56
57(defcustom scribe-electric-parenthesis nil
58 "Non-nil makes parenthesis char ( (]}> ) automatically insert its close
59if typed after an @Command form."
60 :type 'boolean
61 :group 'scribe)
62
63(defconst scribe-open-parentheses "[({<"
64 "Open parenthesis characters for Scribe.")
65
66(defconst scribe-close-parentheses "])}>"
67 "Close parenthesis characters for Scribe.
68These should match up with `scribe-open-parenthesis'.")
69
70(if (null scribe-mode-syntax-table)
71 (let ((st (syntax-table)))
72 (unwind-protect
73 (progn
74 (setq scribe-mode-syntax-table (copy-syntax-table
75 text-mode-syntax-table))
76 (set-syntax-table scribe-mode-syntax-table)
77 (modify-syntax-entry ?\" " ")
78 (modify-syntax-entry ?\\ " ")
79 (modify-syntax-entry ?@ "w ")
80 (modify-syntax-entry ?< "(> ")
81 (modify-syntax-entry ?> ")< ")
82 (modify-syntax-entry ?[ "(] ")
83 (modify-syntax-entry ?] ")[ ")
84 (modify-syntax-entry ?{ "(} ")
85 (modify-syntax-entry ?} "){ ")
86 (modify-syntax-entry ?' "w "))
87 (set-syntax-table st))))
88
89(defvar scribe-mode-map nil)
90
91(if scribe-mode-map
92 nil
93 (setq scribe-mode-map (make-sparse-keymap))
94 (define-key scribe-mode-map "\t" 'scribe-tab)
95 (define-key scribe-mode-map "\e\t" 'tab-to-tab-stop)
96 (define-key scribe-mode-map "\es" 'center-line)
97 (define-key scribe-mode-map "\e}" 'up-list)
98 (define-key scribe-mode-map "\eS" 'center-paragraph)
99 (define-key scribe-mode-map "\"" 'scribe-insert-quote)
100 (define-key scribe-mode-map "(" 'scribe-parenthesis)
101 (define-key scribe-mode-map "[" 'scribe-parenthesis)
102 (define-key scribe-mode-map "{" 'scribe-parenthesis)
103 (define-key scribe-mode-map "<" 'scribe-parenthesis)
104 (define-key scribe-mode-map "\C-c\C-c" 'scribe-chapter)
105 (define-key scribe-mode-map "\C-c\C-t" 'scribe-section)
106 (define-key scribe-mode-map "\C-c\C-s" 'scribe-subsection)
107 (define-key scribe-mode-map "\C-c\C-v" 'scribe-insert-environment)
108 (define-key scribe-mode-map "\C-c\C-e" 'scribe-bracket-region-be)
109 (define-key scribe-mode-map "\C-c[" 'scribe-begin)
110 (define-key scribe-mode-map "\C-c]" 'scribe-end)
111 (define-key scribe-mode-map "\C-c\C-i" 'scribe-italicize-word)
112 (define-key scribe-mode-map "\C-c\C-b" 'scribe-bold-word)
113 (define-key scribe-mode-map "\C-c\C-u" 'scribe-underline-word))
114
115;;;###autoload
116(define-derived-mode scribe-mode text-mode "Scribe"
117 "Major mode for editing files of Scribe (a text formatter) source.
118Scribe-mode is similar to text-mode, with a few extra commands added.
119\\{scribe-mode-map}
120
121Interesting variables:
122
123`scribe-fancy-paragraphs'
124 Non-nil makes Scribe mode use a different style of paragraph separation.
125
126`scribe-electric-quote'
127 Non-nil makes insert of double quote use \\=`\\=` or \\='\\=' depending on context.
128
129`scribe-electric-parenthesis'
130 Non-nil makes an open-parenthesis char (one of `([<{')
131 automatically insert its close if typed after an @Command form."
132 (set (make-local-variable 'comment-start) "@Comment[")
133 (set (make-local-variable 'comment-start-skip) (concat "@Comment[" scribe-open-parentheses "]"))
134 (set (make-local-variable 'comment-column) 0)
135 (set (make-local-variable 'comment-end) "]")
136 (set (make-local-variable 'paragraph-start)
137 (concat "\\([\n\f]\\)\\|\\(@\\w+["
138 scribe-open-parentheses
139 "].*["
140 scribe-close-parentheses
141 "]$\\)"))
142 (set (make-local-variable 'paragraph-separate)
143 (if scribe-fancy-paragraphs paragraph-start "$"))
144 (set (make-local-variable 'sentence-end)
145 "\\([.?!]\\|@:\\)[]\"')}]*\\($\\| $\\|\t\\| \\)[ \t\n]*")
146 (set (make-local-variable 'compile-command)
147 (concat "scribe "
148 (if buffer-file-name
149 (shell-quote-argument (buffer-file-name))))))
150
151(defun scribe-tab ()
152 (interactive)
153 (insert "@\\"))
154
155;; This algorithm could probably be improved somewhat.
156;; Right now, it loses seriously...
157
158(defun scribe ()
159 "Run Scribe on the current buffer."
160 (interactive)
161 (call-interactively 'compile))
162
163(defun scribe-envelop-word (string count)
164 "Surround current word with Scribe construct @STRING[...].
165COUNT specifies how many words to surround. A negative count means
166to skip backward."
167 (let ((spos (point)) (epos (point)) (ccoun 0) noparens)
168 (if (not (zerop count))
169 (progn (if (= (char-syntax (preceding-char)) ?w)
170 (forward-sexp (min -1 count)))
171 (setq spos (point))
172 (if (looking-at (concat "@\\w[" scribe-open-parentheses "]"))
173 (forward-char 2)
174 (goto-char epos)
175 (skip-chars-backward "\\W")
176 (forward-char -1))
177 (forward-sexp (max count 1))
178 (setq epos (point))))
179 (goto-char spos)
180 (while (and (< ccoun (length scribe-open-parentheses))
181 (save-excursion
182 (or (search-forward (char-to-string
183 (aref scribe-open-parentheses ccoun))
184 epos t)
185 (search-forward (char-to-string
186 (aref scribe-close-parentheses ccoun))
187 epos t)))
188 (setq ccoun (1+ ccoun))))
189 (if (>= ccoun (length scribe-open-parentheses))
190 (progn (goto-char epos)
191 (insert "@end(" string ")")
192 (goto-char spos)
193 (insert "@begin(" string ")"))
194 (goto-char epos)
195 (insert (aref scribe-close-parentheses ccoun))
196 (goto-char spos)
197 (insert "@" string (aref scribe-open-parentheses ccoun))
198 (goto-char epos)
199 (forward-char 3)
200 (skip-chars-forward scribe-close-parentheses))))
201
202(defun scribe-underline-word (count)
203 "Underline COUNT words around point by means of Scribe constructs."
204 (interactive "p")
205 (scribe-envelop-word "u" count))
206
207(defun scribe-bold-word (count)
208 "Boldface COUNT words around point by means of Scribe constructs."
209 (interactive "p")
210 (scribe-envelop-word "b" count))
211
212(defun scribe-italicize-word (count)
213 "Italicize COUNT words around point by means of Scribe constructs."
214 (interactive "p")
215 (scribe-envelop-word "i" count))
216
217(defun scribe-begin ()
218 (interactive)
219 (insert "\n")
220 (forward-char -1)
221 (scribe-envelop-word "Begin" 0)
222 (re-search-forward (concat "[" scribe-open-parentheses "]")))
223
224(defun scribe-end ()
225 (interactive)
226 (insert "\n")
227 (forward-char -1)
228 (scribe-envelop-word "End" 0)
229 (re-search-forward (concat "[" scribe-open-parentheses "]")))
230
231(defun scribe-chapter ()
232 (interactive)
233 (insert "\n")
234 (forward-char -1)
235 (scribe-envelop-word "Chapter" 0)
236 (re-search-forward (concat "[" scribe-open-parentheses "]")))
237
238(defun scribe-section ()
239 (interactive)
240 (insert "\n")
241 (forward-char -1)
242 (scribe-envelop-word "Section" 0)
243 (re-search-forward (concat "[" scribe-open-parentheses "]")))
244
245(defun scribe-subsection ()
246 (interactive)
247 (insert "\n")
248 (forward-char -1)
249 (scribe-envelop-word "SubSection" 0)
250 (re-search-forward (concat "[" scribe-open-parentheses "]")))
251
252(defun scribe-bracket-region-be (env min max)
253 (interactive "sEnvironment: \nr")
254 (save-excursion
255 (goto-char max)
256 (insert "@end(" env ")\n")
257 (goto-char min)
258 (insert "@begin(" env ")\n")))
259
260(defun scribe-insert-environment (env)
261 (interactive "sEnvironment: ")
262 (scribe-bracket-region-be env (point) (point))
263 (forward-line 1)
264 (insert ?\n)
265 (forward-char -1))
266
267(defun scribe-insert-quote (count)
268 "Insert \\=`\\=`, \\='\\=' or \" according to preceding character.
269If `scribe-electric-quote' is non-nil, insert \\=`\\=`, \\='\\=' or \" according
270to preceding character. With numeric arg N, always insert N \" characters.
271Else just insert \"."
272 (interactive "P")
273 (if (or count (not scribe-electric-quote))
274 (self-insert-command (prefix-numeric-value count))
275 (let (lastfore lastback lastquote)
276 (insert
277 (cond
278 ((= (preceding-char) ?\\) ?\")
279 ((bobp) "``")
280 (t
281 (setq lastfore (save-excursion (and (search-backward
282 "``" (- (point) 1000) t)
283 (point)))
284 lastback (save-excursion (and (search-backward
285 "''" (- (point) 1000) t)
286 (point)))
287 lastquote (save-excursion (and (search-backward
288 "\"" (- (point) 100) t)
289 (point))))
290 (if (not lastquote)
291 (cond ((not lastfore) "``")
292 ((not lastback) "''")
293 ((> lastfore lastback) "''")
294 (t "``"))
295 (cond ((and (not lastback) (not lastfore)) "\"")
296 ((and lastback (not lastfore) (> lastquote lastback)) "\"")
297 ((and lastback (not lastfore) (> lastback lastquote)) "``")
298 ((and lastfore (not lastback) (> lastquote lastfore)) "\"")
299 ((and lastfore (not lastback) (> lastfore lastquote)) "''")
300 ((and (> lastquote lastfore) (> lastquote lastback)) "\"")
301 ((> lastfore lastback) "''")
302 (t "``")))))))))
303
304(defun scribe-parenthesis (count)
305 "If scribe-electric-parenthesis is non-nil, insertion of an open-parenthesis
306character inserts the following close parenthesis character if the
307preceding text is of the form @Command."
308 (interactive "P")
309 (self-insert-command (prefix-numeric-value count))
310 (let (at-command paren-char point-save)
311 (if (or count (not scribe-electric-parenthesis))
312 nil
313 (save-excursion
314 (forward-char -1)
315 (setq point-save (point))
316 (skip-chars-backward (concat "^ \n\t\f" scribe-open-parentheses))
317 (setq at-command (and (equal (following-char) ?@)
318 (/= (point) (1- point-save)))))
319 (if (and at-command
320 (setq paren-char
321 (string-match (regexp-quote
322 (char-to-string (preceding-char)))
323 scribe-open-parentheses)))
324 (save-excursion
325 (insert (aref scribe-close-parentheses paren-char)))))))
326
327(provide 'scribe)
328
329;;; scribe.el ends here
diff --git a/lisp/obsolete/spell.el b/lisp/obsolete/spell.el
deleted file mode 100644
index 5f8ad13b515..00000000000
--- a/lisp/obsolete/spell.el
+++ /dev/null
@@ -1,171 +0,0 @@
1;;; spell.el --- spelling correction interface for Emacs
2
3;; Copyright (C) 1985, 2001-2017 Free Software Foundation, Inc.
4
5;; Maintainer: emacs-devel@gnu.org
6;; Keywords: wp, unix
7;; Obsolete-since: 23.1
8;; (not in obsolete/ directory then, but all functions marked obsolete)
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; This mode provides an Emacs interface to the UNIX spell(1) program.
28;; Entry points are `spell-buffer', `spell-word', `spell-region' and
29;; `spell-string'.
30
31;; See also ispell.el for an interface to the ispell program.
32
33;;; Code:
34
35(defgroup spell nil
36 "Interface to the UNIX spell(1) program."
37 :prefix "spell-"
38 :group 'applications)
39
40(defcustom spell-command "spell"
41 "Command to run the spell program."
42 :type 'string
43 :group 'spell)
44
45(defcustom spell-filter nil
46 "Filter function to process text before passing it to spell program.
47This function might remove text-processor commands.
48nil means don't alter the text before checking it."
49 :type '(choice (const nil) function)
50 :group 'spell)
51
52;;;###autoload
53(put 'spell-filter 'risky-local-variable t)
54
55;;;###autoload
56(defun spell-buffer ()
57 "Check spelling of every word in the buffer.
58For each incorrect word, you are asked for the correct spelling
59and then put into a query-replace to fix some or all occurrences.
60If you do not want to change a word, just give the same word
61as its \"correct\" spelling; then the query replace is skipped."
62 (interactive)
63 ;; Don't warn about spell-region being obsolete.
64 (with-no-warnings
65 (spell-region (point-min) (point-max) "buffer")))
66;;;###autoload
67(make-obsolete 'spell-buffer 'ispell-buffer "23.1")
68
69;;;###autoload
70(defun spell-word ()
71 "Check spelling of word at or before point.
72If it is not correct, ask user for the correct spelling
73and `query-replace' the entire buffer to substitute it."
74 (interactive)
75 (let (beg end spell-filter)
76 (save-excursion
77 (if (not (looking-at "\\<"))
78 (forward-word -1))
79 (setq beg (point))
80 (forward-word 1)
81 (setq end (point)))
82 ;; Don't warn about spell-region being obsolete.
83 (with-no-warnings
84 (spell-region beg end (buffer-substring beg end)))))
85;;;###autoload
86(make-obsolete 'spell-word 'ispell-word "23.1")
87
88;;;###autoload
89(defun spell-region (start end &optional description)
90 "Like `spell-buffer' but applies only to region.
91Used in a program, applies from START to END.
92DESCRIPTION is an optional string naming the unit being checked:
93for example, \"word\"."
94 (interactive "r")
95 (let ((filter spell-filter)
96 (buf (get-buffer-create " *temp*")))
97 (with-current-buffer buf
98 (widen)
99 (erase-buffer))
100 (message "Checking spelling of %s..." (or description "region"))
101 (if (and (null filter) (= ?\n (char-after (1- end))))
102 (if (string= "spell" spell-command)
103 (call-process-region start end "spell" nil buf)
104 (call-process-region start end shell-file-name
105 nil buf nil "-c" spell-command))
106 (let ((oldbuf (current-buffer)))
107 (with-current-buffer buf
108 (insert-buffer-substring oldbuf start end)
109 (or (bolp) (insert ?\n))
110 (if filter (funcall filter))
111 (if (string= "spell" spell-command)
112 (call-process-region (point-min) (point-max) "spell" t buf)
113 (call-process-region (point-min) (point-max) shell-file-name
114 t buf nil "-c" spell-command)))))
115 (message "Checking spelling of %s...%s"
116 (or description "region")
117 (if (with-current-buffer buf
118 (> (buffer-size) 0))
119 "not correct"
120 "correct"))
121 (let (word newword
122 (case-fold-search t)
123 (case-replace t))
124 (while (with-current-buffer buf
125 (> (buffer-size) 0))
126 (with-current-buffer buf
127 (goto-char (point-min))
128 (setq word (downcase
129 (buffer-substring (point)
130 (progn (end-of-line) (point)))))
131 (forward-char 1)
132 (delete-region (point-min) (point))
133 (setq newword
134 (read-string (concat "`" word
135 "' not recognized; edit a replacement: ")
136 word))
137 (flush-lines (concat "^" (regexp-quote word) "$")))
138 (if (not (equal word newword))
139 (progn
140 (goto-char (point-min))
141 (query-replace-regexp (concat "\\b" (regexp-quote word) "\\b")
142 newword)))))))
143;;;###autoload
144(make-obsolete 'spell-region 'ispell-region "23.1")
145
146;;;###autoload
147(defun spell-string (string)
148 "Check spelling of string supplied as argument."
149 (interactive "sSpell string: ")
150 (with-temp-buffer
151 (widen)
152 (erase-buffer)
153 (insert string "\n")
154 (if (string= "spell" spell-command)
155 (call-process-region (point-min) (point-max) "spell"
156 t t)
157 (call-process-region (point-min) (point-max) shell-file-name
158 t t nil "-c" spell-command))
159 (if (= 0 (buffer-size))
160 (message "%s is correct" string)
161 (goto-char (point-min))
162 (while (search-forward "\n" nil t)
163 (replace-match " "))
164 (message "%sincorrect" (buffer-substring 1 (point-max))))))
165;;;###autoload
166(make-obsolete 'spell-string "The `spell' package is obsolete - use `ispell'."
167 "23.1")
168
169(provide 'spell)
170
171;;; spell.el ends here
diff --git a/lisp/obsolete/swedish.el b/lisp/obsolete/swedish.el
deleted file mode 100644
index 2254441071c..00000000000
--- a/lisp/obsolete/swedish.el
+++ /dev/null
@@ -1,160 +0,0 @@
1;;; swedish.el --- miscellaneous functions for dealing with Swedish
2
3;; Copyright (C) 1988, 2001-2017 Free Software Foundation, Inc.
4
5;; Author: Howard Gayle
6;; Maintainer: emacs-devel@gnu.org
7;; Keywords: i18n
8;; Obsolete-since: 22.1
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; Fixme: Is this actually used? if so, it should be in language,
28;; possibly as a feature property of Swedish, probably defining a
29;; `swascii' coding system.
30
31;;; Code:
32
33;; Written by Howard Gayle. See case-table.el for details.
34
35;; See iso-swed.el for a description of the character set.
36
37(defvar mail-send-hook)
38(defvar news-group-hook-alist)
39(defvar news-inews-hook)
40
41(defvar swedish-re
42 "[ \t\n]\\(och\\|att\\|en\\|{r\\|\\[R\\|p}\\|P\\]\\|som\\|det\\|av\\|den\\|f|r\\|F\\\\R\\)[ \t\n.,?!:;'\")}]"
43 "Regular expression for common Swedish words.")
44
45(defvar swascii-to-8859-trans
46 (let ((string (make-string 256 ? ))
47 (i 0))
48 (while (< i 256)
49 (aset string i i)
50 (setq i (1+ i)))
51 (aset string ?\[ 196)
52 (aset string ?\] 197)
53 (aset string ?\\ 214)
54 (aset string ?^ 220)
55 (aset string ?\{ 228)
56 (aset string ?\} 229)
57 (aset string ?\` 233)
58 (aset string ?\| 246)
59 (aset string ?~ 252)
60 string)
61 "Trans table from SWASCII to 8859.")
62
63; $ is not converted because it almost always means US
64; dollars, not general currency sign. @ is not converted
65; because it is more likely to be an at sign in a mail address
66; than an E with acute accent.
67
68(defun swascii-to-8859-buffer ()
69 "Convert characters in buffer from Swedish/Finnish-ascii to ISO 8859/1.
70Works even on read-only buffers. `$' and `@' are not converted."
71 (interactive)
72 (let ((buffer-read-only nil))
73 (translate-region (point-min) (point-max) swascii-to-8859-trans)))
74
75(defun swascii-to-8859-buffer-maybe ()
76 "Call swascii-to-8859-buffer if the buffer looks like Swedish-ascii.
77Leaves point just after the word that looks Swedish."
78 (interactive)
79 (let ((case-fold-search t))
80 (if (re-search-forward swedish-re nil t)
81 (swascii-to-8859-buffer))))
82
83(setq rmail-show-message-hook 'swascii-to-8859-buffer-maybe)
84
85(setq news-group-hook-alist
86 (append '(("^swnet." . swascii-to-8859-buffer-maybe))
87 (bound-and-true-p news-group-hook-alist)))
88
89(defvar 8859-to-swascii-trans
90 (let ((string (make-string 256 ? ))
91 (i 0))
92 (while (< i 256)
93 (aset string i i)
94 (setq i (1+ i)))
95 (aset string 164 ?$)
96 (aset string 196 ?\[)
97 (aset string 197 ?\])
98 (aset string 201 ?@)
99 (aset string 214 ?\\)
100 (aset string 220 ?^)
101 (aset string 228 ?\{)
102 (aset string 229 ?\})
103 (aset string 233 ?\`)
104 (aset string 246 ?\|)
105 (aset string 252 ?~)
106 string)
107 "8859 to SWASCII trans table.")
108
109(defun 8859-to-swascii-buffer ()
110 "Convert characters in buffer from ISO 8859/1 to Swedish/Finnish-ascii."
111 (interactive "*")
112 (translate-region (point-min) (point-max) 8859-to-swascii-trans))
113
114(setq mail-send-hook '8859-to-swascii-buffer)
115(setq news-inews-hook '8859-to-swascii-buffer)
116
117;; It's not clear what purpose is served by a separate
118;; Swedish mode that differs from Text mode only in having
119;; a separate abbrev table. Nothing says that the abbrevs you
120;; define in Text mode have to be English!
121
122;(defvar swedish-mode-abbrev-table nil
123; "Abbrev table used while in swedish mode.")
124;(define-abbrev-table 'swedish-mode-abbrev-table ())
125
126;(defun swedish-mode ()
127; "Major mode for editing Swedish text intended for humans to
128;read. Special commands:\\{text-mode-map}
129;Turning on swedish-mode calls the value of the variable
130;text-mode-hook, if that value is non-nil."
131; (interactive)
132; (kill-all-local-variables)
133; (use-local-map text-mode-map)
134; (setq mode-name "Swedish")
135; (setq major-mode 'swedish-mode)
136; (setq local-abbrev-table swedish-mode-abbrev-table)
137; (set-syntax-table text-mode-syntax-table)
138; (run-mode-hooks 'text-mode-hook))
139
140;(defun indented-swedish-mode ()
141; "Major mode for editing indented Swedish text intended for
142;humans to read.\\{indented-text-mode-map}
143;Turning on indented-swedish-mode calls the value of the
144;variable text-mode-hook, if that value is non-nil."
145; (interactive)
146; (kill-all-local-variables)
147; (use-local-map text-mode-map)
148; (define-abbrev-table 'swedish-mode-abbrev-table ())
149; (setq local-abbrev-table swedish-mode-abbrev-table)
150; (set-syntax-table text-mode-syntax-table)
151; (make-local-variable 'indent-line-function)
152; (setq indent-line-function 'indent-relative-maybe)
153; (use-local-map indented-text-mode-map)
154; (setq mode-name "Indented Swedish")
155; (setq major-mode 'indented-swedish-mode)
156; (run-mode-hooks 'text-mode-hook))
157
158(provide 'swedish)
159
160;;; swedish.el ends here
diff --git a/lisp/obsolete/sym-comp.el b/lisp/obsolete/sym-comp.el
deleted file mode 100644
index 4418450fe4a..00000000000
--- a/lisp/obsolete/sym-comp.el
+++ /dev/null
@@ -1,237 +0,0 @@
1;;; sym-comp.el --- mode-dependent symbol completion
2
3;; Copyright (C) 2004, 2008-2017 Free Software Foundation, Inc.
4
5;; Author: Dave Love <fx@gnu.org>
6;; Keywords: extensions
7;; URL: http://www.loveshack.ukfsn.org/emacs
8;; Obsolete-since: 23.2
9
10;; This file is part of GNU Emacs.
11
12;; GNU Emacs is free software: you can redistribute it and/or modify
13;; it under the terms of the GNU General Public License as published by
14;; the Free Software Foundation, either version 3 of the License, or
15;; (at your option) any later version.
16
17;; GNU Emacs is distributed in the hope that it will be useful,
18;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20;; GNU General Public License for more details.
21
22;; You should have received a copy of the GNU General Public License
23;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
24
25;;; Commentary:
26
27;; This defines `symbol-complete', which is a generalization of the
28;; old `lisp-complete-symbol'. It provides the following hooks to
29;; allow major modes to set up completion appropriate for the mode:
30;; `symbol-completion-symbol-function',
31;; `symbol-completion-completions-function',
32;; `symbol-completion-predicate-function',
33;; `symbol-completion-transform-function'. Typically it is only
34;; necessary for a mode to set
35;; `symbol-completion-completions-function' locally and to bind
36;; `symbol-complete' appropriately.
37
38;; It's unfortunate that there doesn't seem to be a good way of
39;; combining this with `complete-symbol'.
40
41;; There is also `symbol-completion-try-complete', for use with
42;; Hippie-exp.
43
44;;; Code:
45
46;;;; Mode-dependent symbol completion.
47
48(defun symbol-completion-symbol ()
49 "Default `symbol-completion-symbol-function'.
50Uses `current-word' with the buffer narrowed to the part before
51point."
52 (save-restriction
53 ;; Narrow in case point is in the middle of a symbol -- we want
54 ;; just the preceding part.
55 (narrow-to-region (point-min) (point))
56 (current-word)))
57
58(defvar symbol-completion-symbol-function 'symbol-completion-symbol
59 "Function to return a partial symbol before point for completion.
60The value it returns should be a string (or nil).
61Major modes may set this locally if the default isn't appropriate.
62
63Beware: the length of the string STR returned need to be equal to the length
64of text before point that's subject to completion. Typically, this amounts
65to saying that STR is equal to
66\(buffer-substring (- (point) (length STR)) (point)).")
67
68(defvar symbol-completion-completions-function nil
69 "Function to return possible symbol completions.
70It takes an argument which is the string to be completed and
71returns a value suitable for the second argument of
72`try-completion'. This value need not use the argument, i.e. it
73may be all possible completions, such as `obarray' in the case of
74Emacs Lisp.
75
76Major modes may set this locally to allow them to support
77`symbol-complete'. See also `symbol-completion-symbol-function',
78`symbol-completion-predicate-function' and
79`symbol-completion-transform-function'.")
80
81(defvar symbol-completion-predicate-function nil
82 "If non-nil, function to return a predicate for selecting symbol completions.
83The function gets two args, the positions of the beginning and
84end of the symbol to be completed.
85
86Major modes may set this locally if the default isn't
87appropriate. This is a function returning a predicate so that
88the predicate can be context-dependent, e.g. to select only
89function names if point is at a function call position. The
90function's args may be useful for determining the context.")
91
92(defvar symbol-completion-transform-function nil
93 "If non-nil, function to transform symbols in the symbol-completion buffer.
94E.g., for Lisp, it may annotate the symbol as being a function,
95not a variable.
96
97The function takes the symbol name as argument. If it needs to
98annotate this, it should return a value suitable as an element of
99the list passed to `display-completion-list'.
100
101The predicate being used for selecting completions (from
102`symbol-completion-predicate-function') is available
103dynamically-bound as `symbol-completion-predicate' in case the
104transform needs it.")
105
106(defvar symbol-completion-predicate)
107
108;;;###autoload
109(defun symbol-complete (&optional predicate)
110 "Perform completion of the symbol preceding point.
111This is done in a way appropriate to the current major mode,
112perhaps by interrogating an inferior interpreter. Compare
113`complete-symbol'.
114If no characters can be completed, display a list of possible completions.
115Repeating the command at that point scrolls the list.
116
117When called from a program, optional arg PREDICATE is a predicate
118determining which symbols are considered.
119
120This function requires `symbol-completion-completions-function'
121to be set buffer-locally. Variables `symbol-completion-symbol-function',
122`symbol-completion-predicate-function' and
123`symbol-completion-transform-function' are also consulted."
124 (interactive)
125 ;; Fixme: Punt to `complete-symbol' in this case?
126 (unless (functionp symbol-completion-completions-function)
127 (error "symbol-completion-completions-function not defined"))
128 (let* ((pattern (or (funcall symbol-completion-symbol-function)
129 (error "No preceding symbol to complete")))
130 ;; FIXME: We assume below that `pattern' holds the text just
131 ;; before point. This is a problem in the way
132 ;; symbol-completion-symbol-function was defined.
133 (predicate (or predicate
134 (if symbol-completion-predicate-function
135 (funcall symbol-completion-predicate-function
136 (- (point) (length pattern))
137 (point)))))
138 (completions (funcall symbol-completion-completions-function
139 pattern))
140 ;; In case the transform needs to access it.
141 (symbol-completion-predicate predicate)
142 (completion-extra-properties
143 (if (functionp symbol-completion-transform-function)
144 '(:annotation-function
145 (lambda (str)
146 (car-safe (cdr-safe
147 (funcall symbol-completion-transform-function
148 str))))))))
149 (completion-in-region (- (point) (length pattern)) (point)
150 completions predicate)))
151
152(defvar he-search-string)
153(defvar he-tried-table)
154(defvar he-expand-list)
155(declare-function he-init-string "hippie-exp" (beg end))
156(declare-function he-string-member "hippie-exp" (str lst &optional trans-case))
157(declare-function he-substitute-string "hippie-exp" (str &optional trans-case))
158(declare-function he-reset-string "hippie-exp" ())
159
160;;;###autoload
161(defun symbol-completion-try-complete (old)
162 "Completion function for use with `hippie-expand'.
163Uses `symbol-completion-symbol-function' and
164`symbol-completion-completions-function'. It is intended to be
165used something like this in a major mode which provides symbol
166completion:
167
168 (if (featurep \\='hippie-exp)
169 (set (make-local-variable \\='hippie-expand-try-functions-list)
170 (cons \\='symbol-completion-try-complete
171 hippie-expand-try-functions-list)))"
172 (when (and symbol-completion-symbol-function
173 symbol-completion-completions-function)
174 (unless old
175 (let ((symbol (funcall symbol-completion-symbol-function)))
176 (he-init-string (- (point) (length symbol)) (point))
177 (if (not (he-string-member he-search-string he-tried-table))
178 (push he-search-string he-tried-table))
179 (setq he-expand-list
180 (and symbol
181 (funcall symbol-completion-completions-function symbol)))))
182 (while (and he-expand-list
183 (he-string-member (car he-expand-list) he-tried-table))
184 (pop he-expand-list))
185 (if he-expand-list
186 (progn
187 (he-substitute-string (pop he-expand-list))
188 t)
189 (if old (he-reset-string))
190 nil)))
191
192;;; Emacs Lisp symbol completion.
193
194(defun lisp-completion-symbol ()
195 "`symbol-completion-symbol-function' for Lisp."
196 (let ((end (point))
197 (beg (with-syntax-table emacs-lisp-mode-syntax-table
198 (save-excursion
199 (backward-sexp 1)
200 (while (= (char-syntax (following-char)) ?\')
201 (forward-char 1))
202 (point)))))
203 (buffer-substring-no-properties beg end)))
204
205(defun lisp-completion-predicate (beg end)
206 "`symbol-completion-predicate-function' for Lisp."
207 (save-excursion
208 (goto-char beg)
209 (if (not (eq (char-before) ?\())
210 (lambda (sym) ;why not just nil ? -sm
211 ;To avoid interned symbols with
212 ;no slots. -- fx
213 (or (boundp sym) (fboundp sym)
214 (symbol-plist sym)))
215 ;; Looks like a funcall position. Let's double check.
216 (if (condition-case nil
217 (progn (up-list -2) (forward-char 1)
218 (eq (char-after) ?\())
219 (error nil))
220 ;; If the first element of the parent list is an open
221 ;; parenthesis we are probably not in a funcall position.
222 ;; Maybe a `let' varlist or something.
223 nil
224 ;; Else, we assume that a function name is expected.
225 'fboundp))))
226
227(defun lisp-symbol-completion-transform ()
228 "`symbol-completion-transform-function' for Lisp."
229 (lambda (elt)
230 (if (and (not (eq 'fboundp symbol-completion-predicate))
231 (fboundp (intern elt)))
232 (list elt " <f>")
233 elt)))
234
235(provide 'sym-comp)
236
237;;; sym-comp.el ends here