Mercurial > hg > xemacs-beta
annotate lisp/disp-table.el @ 5284:d27c1ee1943b
Make the order of preloaded-file-list more sane.
lisp/ChangeLog addition:
2010-10-12 Aidan Kehoe <kehoea@parhasard.net>
* abbrev.el (fundamental-mode-abbrev-table, global-abbrev-table):
Create both these abbrev tables using the usual
#'define-abbrev-table calls, rather than attempting to
special-case them.
* cl-extra.el: Force cl-macs to be loaded here, if cl-extra.el is
being loaded interpreted. Previously other, later files would
redundantly call (load "cl-macs") when interpreted, it's more
reasonable to do it here, once.
* cmdloop.el (read-quoted-char-radix): Use defcustom here, we
don't have any dump-order dependencies that would prevent that.
* custom.el (eval-when-compile): Don't load cl-macs when
interpreted or when byte-compiling, rely on cl-extra.el in the
former case and the appropriate entry in bytecomp-load-hook in the
latter. Get rid of custom-declare-variable-list, we have no
dump-time dependencies that would require it.
* faces.el (eval-when-compile): Don't load cl-macs when
interpreted or when byte-compiling.
* packages.el: Remove some inaccurate comments.
* post-gc.el (cleanup-simple-finalizers): Use #'delete-if-not
here, now the order of preloaded-file-list has been changed to
make it available.
* subr.el (custom-declare-variable-list): Remove. No need for it.
Also remove a stub define-abbrev-table from this file, given the
current order of preloaded-file-list there's no need for it.
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Tue, 12 Oct 2010 21:11:46 +0100 |
| parents | e84ee15ca495 |
| children | 308d34e9f07d |
| rev | line source |
|---|---|
| 219 | 1 ;;; disp-table.el --- functions for dealing with char tables. |
| 2 | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
3 ;; Copyright (C) 1987, 1994, 1997, 2007 Free Software Foundation, Inc. |
| 219 | 4 ;; Copyright (C) 1995 Sun Microsystems. |
|
5113
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
5 ;; Copyright (C) 2005 Ben Wing. |
| 219 | 6 |
| 7 ;; Maintainer: XEmacs Development Team | |
| 8 ;; Keywords: i18n, internal | |
| 9 | |
| 10 ;; This file is part of XEmacs. | |
| 11 | |
| 12 ;; XEmacs is free software; you can redistribute it and/or modify it | |
| 13 ;; under the terms of the GNU General Public License as published by | |
| 14 ;; the Free Software Foundation; either version 2, or (at your option) | |
| 15 ;; any later version. | |
| 16 | |
| 17 ;; XEmacs is distributed in the hope that it will be useful, but | |
| 18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 20 ;; General Public License for more details. | |
| 21 | |
| 22 ;; You should have received a copy of the GNU General Public License | |
| 23 ;; along with XEmacs; see the file COPYING. If not, write to the | |
| 24 ;; Free Software Foundation, 59 Temple Place - Suite 330, | |
| 25 ;; Boston, MA 02111-1307, USA. | |
| 26 | |
| 27 ;;; Synched up with: Not synched with FSF. | |
| 28 | |
| 29 ;;; Commentary: | |
| 30 | |
| 31 ;; Rewritten for XEmacs July 1995, Ben Wing. | |
|
5113
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
32 ;; November 1998?, display tables generalized to char/range tables, Hrvoje |
|
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
33 ;; Niksic. |
|
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
34 ;; July 2007, rewrite this file to handle generalized display tables, |
|
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
35 ;; Aidan Kehoe. |
| 219 | 36 |
| 37 ;;; Code: | |
| 38 | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
39 ;;;###autoload |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
40 (defun make-display-table () |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
41 "Return a new, empty display table. |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
42 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
43 This returns a generic character table; previously it returned a vector, but |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
44 that was not helpful when dealing with internationalized characters above |
|
4454
1f0aa40cafe0
Small improvements in disp-table.el, mule/cyril-util.el.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4452
diff
changeset
|
45 ?\xFF. See `make-char-table' for details of character tables in general. To |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
46 write code that works with both vectors and character tables, add something |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
47 like the following to the beginning of your file, and use |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
48 `put-display-table' to set what a given character is displayed as, and |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
49 `get-display-table' to examine what that character is currently displayed |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
50 as: |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
51 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
52 \(defun-when-void put-display-table (range value display-table) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
53 \"Set the value for char RANGE to VALUE in DISPLAY-TABLE. \" |
|
4452
82f8351e71c8
Improve portable sample implementations for #'{put,get}-display-table
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
54 (if (sequencep display-table) |
|
82f8351e71c8
Improve portable sample implementations for #'{put,get}-display-table
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
55 (aset display-table range value) |
|
82f8351e71c8
Improve portable sample implementations for #'{put,get}-display-table
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
56 (put-char-table range value display-table))) |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
57 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
58 \(defun-when-void get-display-table (character display-table) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
59 \"Find value for CHARACTER in DISPLAY-TABLE. \" |
|
4452
82f8351e71c8
Improve portable sample implementations for #'{put,get}-display-table
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
60 (if (sequencep display-table) |
|
82f8351e71c8
Improve portable sample implementations for #'{put,get}-display-table
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
61 (aref display-table character) |
|
82f8351e71c8
Improve portable sample implementations for #'{put,get}-display-table
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
62 (get-char-table character display-table))) |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
63 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
64 In this implementation, `put-display-table' and `get-display-table' are |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
65 aliases of `put-char-table' and `get-char-table' respectively, and are |
|
4452
82f8351e71c8
Improve portable sample implementations for #'{put,get}-display-table
Aidan Kehoe <kehoea@parhasard.net>
parents:
4451
diff
changeset
|
66 always available." |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
67 (make-char-table 'generic)) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
68 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
69 ;;;###autoload |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
70 (defalias 'put-display-table #'put-char-table) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
71 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
72 ;;;###autoload |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
73 (defalias 'get-display-table #'get-char-table) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
74 |
| 219 | 75 (defun describe-display-table (dt) |
| 76 "Describe the display table DT in a help buffer." | |
| 77 (with-displaying-help-buffer | |
| 78 (lambda () | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
79 (map-char-table |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
80 (lambda (range value) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
81 (cond |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
82 ((eq range t) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
83 (princ "\nAll characters: \n") |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
84 (princ (format " %S" value))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
85 ((eq 'charset (and (symbolp range) (type-of (find-charset range)))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
86 (princ (format "\n\nCharset %S: \n" (charset-name range))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
87 (princ (format " %S" value))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
88 ((vectorp range) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
89 (princ (format "\n\nCharset %S, row %d \n" |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
90 (charset-name (aref value 0)) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
91 (aref value 1))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
92 (princ (format " %S\n\n" value))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
93 ((characterp range) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
94 (princ (format "\nCharacter U+%04X, %S: " |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
95 range (if (fboundp 'split-char) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
96 (split-char range) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
97 (list 'ascii (char-to-int range))))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
98 (princ (format " %S" value)))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
99 nil) dt) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
100 (princ |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
101 "\n\nFor some of the various other glyphs that GNU Emacs uses the display |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
102 table for, see the XEmacs specifiers `truncation-glyph' , |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
103 `continuation-glyph', `control-arrow-glyph', `octal-escape-glyph' and the |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
104 others described in the docstring of `make-glyph'. \n\n")))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
105 |
| 219 | 106 |
| 107 ;;;###autoload | |
| 108 (defun describe-current-display-table (&optional domain) | |
| 109 "Describe the display table in use in the selected window and buffer." | |
| 110 (interactive) | |
| 111 (or domain (setq domain (selected-window))) | |
| 112 (let ((disptab (specifier-instance current-display-table domain))) | |
| 113 (if disptab | |
| 114 (describe-display-table disptab) | |
| 115 (message "No display table")))) | |
| 116 | |
| 117 ;; #### we need a generic frob-specifier function. | |
| 118 ;; #### this also needs to be redone like frob-face-property. | |
| 119 | |
| 120 ;; Let me say one more time how much dynamic scoping sucks. | |
| 121 | |
|
5113
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
122 ;; #### Need more thinking about basic primitives for modifying a specifier. |
|
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
123 ;; cf `modify-specifier-instances'. |
|
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
124 |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
125 ;;;###autoload |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
126 (defun frob-display-table (fdt-function fdt-locale &optional tag-set) |
| 219 | 127 (or fdt-locale (setq fdt-locale 'global)) |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
128 (or (specifier-spec-list current-display-table fdt-locale tag-set) |
| 219 | 129 (add-spec-to-specifier current-display-table (make-display-table) |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
130 fdt-locale tag-set)) |
| 219 | 131 (add-spec-list-to-specifier |
| 132 current-display-table | |
| 133 (list (cons fdt-locale | |
| 134 (mapcar | |
| 135 (lambda (fdt-x) | |
| 136 (funcall fdt-function (cdr fdt-x)) | |
| 137 fdt-x) | |
| 138 (cdar (specifier-spec-list current-display-table | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
139 fdt-locale tag-set))))))) |
| 219 | 140 |
| 141 (defun standard-display-8bit-1 (dt l h) | |
| 142 (while (<= l h) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
143 (remove-char-table (int-to-char l) dt) |
| 219 | 144 (setq l (1+ l)))) |
| 145 | |
| 146 ;;;###autoload | |
| 147 (defun standard-display-8bit (l h &optional locale) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
148 "Display characters in the range L to H literally [sic]. |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
149 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
150 GNU Emacs includes this function. There, `literally' has no good meaning. |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
151 Under XEmacs, this function makes characters with numeric values in the |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
152 range L to H display as themselves; that is, as ASCII, latin-iso8859-1, |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
153 latin-iso8859-2 or whatever. See `standard-display-default' for the inverse |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
154 function. " |
| 219 | 155 (frob-display-table |
| 156 (lambda (x) | |
| 157 (standard-display-8bit-1 x l h)) | |
| 158 locale)) | |
| 159 | |
| 160 (defun standard-display-default-1 (dt l h) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
161 "Misnamed function under XEmacs. See `standard-display-default'." |
| 219 | 162 (while (<= l h) |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
163 (put-char-table (int-to-char l) (format "\\%o" l) dt) |
| 219 | 164 (setq l (1+ l)))) |
| 165 | |
| 166 ;;;###autoload | |
| 167 (defun standard-display-default (l h &optional locale) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
168 "Display characters in the range L to H using octal escape notation. |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
169 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
170 In the XEmacs context this function is misnamed. Under GNU Emacs, |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
171 characters in the range #xA0 to #xFF display as octal escapes unless |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
172 `standard-display-european' has been called; this function neutralizes the |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
173 effects of `standard-display-european'. Under XEmacs, those characters |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
174 normally do not display as octal escapes (this ignores hackery like |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
175 specifying the X11 font character set on non-Mule builds) and this function |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
176 sets them to display as octal escapes. " |
| 219 | 177 (frob-display-table |
| 178 (lambda (x) | |
| 179 (standard-display-default-1 x l h)) | |
| 180 locale)) | |
| 181 | |
| 182 ;;;###autoload | |
| 183 (defun standard-display-ascii (c s &optional locale) | |
| 184 "Display character C using printable string S." | |
| 185 (frob-display-table | |
| 186 (lambda (x) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
187 (put-char-table c s x)) |
| 219 | 188 locale)) |
| 189 | |
| 190 ;;;###autoload | |
| 191 (defun standard-display-g1 (c sc &optional locale) | |
| 192 "Display character C as character SC in the g1 character set. | |
|
5113
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
193 This only has an effect on TTY devices and assumes that your terminal uses |
|
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
194 the SO/SI characters." |
| 219 | 195 (frob-display-table |
| 196 (lambda (x) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
197 (put-char-table c (concat "\016" (char-to-string sc) "\017") x)) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
198 locale '(tty))) |
| 219 | 199 |
| 200 ;;;###autoload | |
| 201 (defun standard-display-graphic (c gc &optional locale) | |
| 202 "Display character C as character GC in graphics character set. | |
|
5113
b2dcf6a6d8ab
some changes to doc strings/comments in disp-table.el
Ben Wing <ben@xemacs.org>
parents:
4454
diff
changeset
|
203 This only has an effect on TTY devices and assumes VT100-compatible escapes." |
| 219 | 204 (frob-display-table |
| 205 (lambda (x) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
206 (put-char-table c (concat "\e(0" (char-to-string gc) "\e(B") x)) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
207 locale '(tty))) |
| 219 | 208 |
| 209 ;;;###autoload | |
| 210 (defun standard-display-underline (c uc &optional locale) | |
| 211 "Display character C as character UC plus underlining." | |
| 212 (frob-display-table | |
| 213 (lambda (x) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
214 (let (glyph) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
215 (setq glyph (make-glyph (vector 'string :data (char-to-string uc)))) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
216 (set-glyph-face glyph 'underline) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
217 (put-char-table c glyph x))) |
| 219 | 218 locale)) |
| 219 | |
| 220 ;;;###autoload | |
| 221 (defun standard-display-european (arg &optional locale) | |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
222 "Toggle display of European characters encoded with ISO 8859-1. |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
223 When enabled (the default), characters in the range of 160 to 255 display |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
224 as accented characters. With negative prefix argument, display characters in |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
225 that range as octal escapes. |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
226 |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
227 If you want to work in a Western European language under XEmacs, it |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
228 shouldn't be necessary to call this function--things should just work. But |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
229 it's in a sufficient number of init files that we're not in a hurry to |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
230 remove it. " |
| 219 | 231 (interactive "P") |
|
4451
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
232 (if (<= (prefix-numeric-value arg) 0) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
233 (frob-display-table |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
234 (lambda (x) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
235 (standard-display-default-1 x 160 255)) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
236 locale) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
237 (frob-display-table |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
238 (lambda (x) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
239 (standard-display-8bit-1 x 160 255)) |
|
e214ff9f9507
Use char-tables, not vectors, to instantiate the display table specifiers.
Aidan Kehoe <kehoea@parhasard.net>
parents:
219
diff
changeset
|
240 locale))) |
| 219 | 241 |
| 242 (provide 'disp-table) | |
| 243 | |
| 244 ;;; disp-table.el ends here |
