Commit | Line | Data |
---|---|---|
c8472948 | 1 | ;;; case-table.el --- code to extend the character set and support case tables. |
e5167999 | 2 | |
3a801d0c ER |
3 | ;; Copyright (C) 1988 Free Software Foundation, Inc. |
4 | ||
e5167999 ER |
5 | ;; Author: Howard Gayle |
6 | ;; Maintainer: FSF | |
a1d15b3e | 7 | ;; Keywords: i18n |
a2535589 JA |
8 | |
9 | ;; This file is part of GNU Emacs. | |
10 | ||
11 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 | ;; it under the terms of the GNU General Public License as published by | |
e5167999 | 13 | ;; the Free Software Foundation; either version 2, or (at your option) |
a2535589 JA |
14 | ;; any later version. |
15 | ||
16 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 | ;; GNU General Public License for more details. | |
20 | ||
21 | ;; You should have received a copy of the GNU General Public License | |
22 | ;; along with GNU Emacs; see the file COPYING. If not, write to | |
23 | ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
24 | ||
e5167999 | 25 | ;;; Commentary: |
a2535589 JA |
26 | |
27 | ;; Written by: | |
28 | ;; TN/ETX/TX/UMG Howard Gayle UUCP : seismo!enea!erix!howard | |
29 | ;; Telefonaktiebolaget L M Ericsson Phone: +46 8 719 55 65 | |
30 | ;; Ericsson Telecom Telex: 14910 ERIC S | |
31 | ;; S-126 25 Stockholm FAX : +46 8 719 64 82 | |
32 | ;; Sweden | |
33 | ||
e5167999 ER |
34 | ;;; Code: |
35 | ||
3f5ed7e4 | 36 | ;;;###autoload |
a2535589 JA |
37 | (defun describe-buffer-case-table () |
38 | "Describe the case table of the current buffer." | |
39 | (interactive) | |
40 | (let ((vector (make-vector 256 nil)) | |
41 | (case-table (current-case-table)) | |
4536d484 RS |
42 | (ch 0)) |
43 | (while (< ch 256) | |
44 | (aset vector ch | |
a2535589 JA |
45 | (cond ((/= ch (downcase ch)) |
46 | (concat "uppercase, matches " | |
47 | (text-char-description (downcase ch)))) | |
48 | ((/= ch (upcase ch)) | |
49 | (concat "lowercase, matches " | |
50 | (text-char-description (upcase ch)))) | |
51 | (t "case-invariant"))) | |
4536d484 RS |
52 | (setq ch (1+ ch))) |
53 | (save-excursion | |
54 | (with-output-to-temp-buffer "*Help*" | |
55 | (set-buffer standard-output) | |
56 | (describe-vector vector))))) | |
a2535589 | 57 | |
3f5ed7e4 | 58 | ;;;###autoload |
8db3f421 | 59 | (defun set-case-syntax-delims (l r table) |
a2535589 | 60 | "Make characters L and R a matching pair of non-case-converting delimiters. |
8db3f421 RS |
61 | This sets the entries for L and R in TABLE, which is a string |
62 | that will be used as the downcase part of a case table. | |
3f5ed7e4 | 63 | It also modifies `standard-syntax-table', and `text-mode-syntax-table' to |
03131799 | 64 | indicate left and right delimiters." |
8db3f421 RS |
65 | (aset table l l) |
66 | (aset table r r) | |
a2535589 JA |
67 | (modify-syntax-entry l (concat "(" (char-to-string r) " ") |
68 | (standard-syntax-table)) | |
69 | (modify-syntax-entry l (concat "(" (char-to-string r) " ") | |
70 | text-mode-syntax-table) | |
71 | (modify-syntax-entry r (concat ")" (char-to-string l) " ") | |
72 | (standard-syntax-table)) | |
73 | (modify-syntax-entry r (concat ")" (char-to-string l) " ") | |
74 | text-mode-syntax-table)) | |
75 | ||
3f5ed7e4 | 76 | ;;;###autoload |
8db3f421 | 77 | (defun set-case-syntax-pair (uc lc table) |
a2535589 | 78 | "Make characters UC and LC a pair of inter-case-converting letters. |
8db3f421 RS |
79 | This sets the entries for characters UC and LC in TABLE, which is a string |
80 | that will be used as the downcase part of a case table. | |
3f5ed7e4 RS |
81 | It also modifies `standard-syntax-table' and `text-mode-syntax-table' |
82 | to indicate an (uppercase, lowercase) pair of letters." | |
8db3f421 RS |
83 | (aset table uc lc) |
84 | (aset table lc lc) | |
a2535589 JA |
85 | (modify-syntax-entry lc "w " (standard-syntax-table)) |
86 | (modify-syntax-entry lc "w " text-mode-syntax-table) | |
87 | (modify-syntax-entry uc "w " (standard-syntax-table)) | |
88 | (modify-syntax-entry uc "w " text-mode-syntax-table)) | |
89 | ||
3f5ed7e4 | 90 | ;;;###autoload |
8db3f421 | 91 | (defun set-case-syntax (c syntax table) |
a2535589 | 92 | "Make characters C case-invariant with syntax SYNTAX. |
8db3f421 RS |
93 | This sets the entries for character C in TABLE, which is a string |
94 | that will be used as the downcase part of a case table. | |
3f5ed7e4 | 95 | It also modifies `standard-syntax-table' and `text-mode-syntax-table'. |
a2535589 | 96 | SYNTAX should be \" \", \"w\", \".\" or \"_\"." |
8db3f421 | 97 | (aset table c c) |
a2535589 JA |
98 | (modify-syntax-entry c syntax (standard-syntax-table)) |
99 | (modify-syntax-entry c syntax text-mode-syntax-table)) | |
100 | ||
101 | (provide 'case-table) | |
c0274f38 ER |
102 | |
103 | ;;; case-table.el ends here |