(PERDISPLAY, the_only_perdisplay, get_perdisplay):
[emacs.git] / lisp / case-table.el
blob46f1d8b0f427d4a2b6159be70b55f42db3986270
1 ;;; case-table.el --- code to extend the character set and support case tables.
3 ;; Copyright (C) 1988, 1994 Free Software Foundation, Inc.
5 ;; Author: Howard Gayle
6 ;; Maintainer: FSF
7 ;; Keywords: i18n
9 ;; This file is part of GNU Emacs.
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
13 ;; the Free Software Foundation; either version 2, or (at your option)
14 ;; any later version.
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.
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.
25 ;;; Commentary:
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
34 ;;; Code:
36 ;;;###autoload
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 (ch 0))
42 (while (< ch 256)
43 (aset vector ch
44 (cond ((/= ch (downcase ch))
45 (concat "uppercase, matches "
46 (char-to-string (downcase ch))))
47 ((/= ch (upcase ch))
48 (concat "lowercase, matches "
49 (char-to-string (upcase ch))))
50 (t "case-invariant")))
51 (setq ch (1+ ch)))
52 (save-excursion
53 (with-output-to-temp-buffer "*Help*"
54 (set-buffer standard-output)
55 (describe-vector vector)
56 (help-mode)))))
58 ;;;###autoload
59 (defun set-case-syntax-delims (l r table)
60 "Make characters L and R a matching pair of non-case-converting delimiters.
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.
63 It also modifies `standard-syntax-table' to
64 indicate left and right delimiters."
65 (aset table l l)
66 (aset table r r)
67 (modify-syntax-entry l (concat "(" (char-to-string r) " ")
68 (standard-syntax-table))
69 (modify-syntax-entry r (concat ")" (char-to-string l) " ")
70 (standard-syntax-table)))
72 ;;;###autoload
73 (defun set-case-syntax-pair (uc lc table)
74 "Make characters UC and LC a pair of inter-case-converting letters.
75 This sets the entries for characters UC and LC in TABLE, which is a string
76 that will be used as the downcase part of a case table.
77 It also modifies `standard-syntax-table' to give them the syntax of
78 word constituents."
79 (aset table uc lc)
80 (aset table lc lc)
81 (modify-syntax-entry lc "w " (standard-syntax-table))
82 (modify-syntax-entry uc "w " (standard-syntax-table)))
84 ;;;###autoload
85 (defun set-case-syntax (c syntax table)
86 "Make characters C case-invariant with syntax SYNTAX.
87 This sets the entries for character C in TABLE, which is a string
88 that will be used as the downcase part of a case table.
89 It also modifies `standard-syntax-table'.
90 SYNTAX should be \" \", \"w\", \".\" or \"_\"."
91 (aset table c c)
92 (modify-syntax-entry c syntax (standard-syntax-table)))
94 (provide 'case-table)
96 ;;; case-table.el ends here