Mercurial > emacs
annotate lisp/international/mule-util.el @ 82159:2d2d51d01a8c
Switch license to GPLv3 or later.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Fri, 27 Jul 2007 07:17:03 +0000 |
parents | 2daf9c28b3a4 |
children | b6fdfff4ae81 f55f9811f5d7 |
rev | line source |
---|---|
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
29354
diff
changeset
|
1 ;;; mule-util.el --- utility functions for mulitilingual environment (mule) |
17052 | 2 |
74544 | 3 ;; Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, |
75347 | 4 ;; 2005, 2006, 2007 Free Software Foundation, Inc. |
74605
6ee41fdd69ff
Update AIST copyright years.
Kenichi Handa <handa@m17n.org>
parents:
74544
diff
changeset
|
5 ;; Copyright (C) 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, |
75347 | 6 ;; 2005, 2006, 2007 |
62274 | 7 ;; National Institute of Advanced Industrial Science and Technology (AIST) |
8 ;; Registration Number H14PRO021 | |
17052 | 9 |
10 ;; Keywords: mule, multilingual | |
11 | |
12 ;; This file is part of GNU Emacs. | |
13 | |
14 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
15 ;; it under the terms of the GNU General Public License as published by | |
78310
2daf9c28b3a4
Restore comma mistakenly removed in last change.
Glenn Morris <rgm@gnu.org>
parents:
78301
diff
changeset
|
16 ;; the Free Software Foundation; either version 3, or (at your option) |
17052 | 17 ;; any later version. |
18 | |
19 ;; GNU Emacs is distributed in the hope that it will be useful, | |
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 ;; GNU General Public License for more details. | |
23 | |
24 ;; You should have received a copy of the GNU General Public License | |
17071 | 25 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
27 ;; Boston, MA 02110-1301, USA. | |
17052 | 28 |
38414
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
29354
diff
changeset
|
29 ;;; Commentary: |
67b464da13ec
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
29354
diff
changeset
|
30 |
17052 | 31 ;;; Code: |
32 | |
33 ;;; String manipulations while paying attention to multibyte | |
34 ;;; characters. | |
35 | |
36 ;;;###autoload | |
37 (defun string-to-sequence (string type) | |
38 "Convert STRING to a sequence of TYPE which contains characters in STRING. | |
18200
c913160e34a7
(set-coding-system-alist): Deleted.
Kenichi Handa <handa@m17n.org>
parents:
17092
diff
changeset
|
39 TYPE should be `list' or `vector'." |
28458 | 40 ;;; (let ((len (length string)) |
41 ;;; (i 0) | |
42 ;;; val) | |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
43 (cond ((eq type 'list) |
28458 | 44 ;; Applicable post-Emacs 20.2 and asymptotically ~10 times |
45 ;; faster than the code below: | |
46 (append string nil)) | |
47 ;;; (setq val (make-list len 0)) | |
48 ;;; (let ((l val)) | |
49 ;;; (while (< i len) | |
50 ;;; (setcar l (aref string i)) | |
51 ;;; (setq l (cdr l) i (1+ i)))))) | |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
52 ((eq type 'vector) |
28458 | 53 ;; As above. |
54 (vconcat string)) | |
55 ;;; (setq val (make-vector len 0)) | |
56 ;;; (while (< i len) | |
57 ;;; (aset val i (aref string i)) | |
58 ;;; (setq i (1+ i)))) | |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
59 (t |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
60 (error "Invalid type: %s" type))) |
28458 | 61 ;;; val) |
62 ) | |
46511
f44beb42c7c1
(string-to-sequence, truncate-string): Add autoload cookie.
Juanma Barranquero <lekktu@gmail.com>
parents:
46051
diff
changeset
|
63 |
f44beb42c7c1
(string-to-sequence, truncate-string): Add autoload cookie.
Juanma Barranquero <lekktu@gmail.com>
parents:
46051
diff
changeset
|
64 ;;;###autoload |
41232
43e756c38f4f
(string-to-sequence): Make it obsolete.
Richard M. Stallman <rms@gnu.org>
parents:
38414
diff
changeset
|
65 (make-obsolete 'string-to-sequence |
46051
990c78360ef5
(string-to-sequence): Fix obsolescence declaration.
Juanma Barranquero <lekktu@gmail.com>
parents:
45908
diff
changeset
|
66 "use `string-to-list' or `string-to-vector'." |
59996
aac0a33f5772
Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents:
58804
diff
changeset
|
67 "22.1") |
17052 | 68 |
69 ;;;###autoload | |
70 (defsubst string-to-list (string) | |
71 "Return a list of characters in STRING." | |
41232
43e756c38f4f
(string-to-sequence): Make it obsolete.
Richard M. Stallman <rms@gnu.org>
parents:
38414
diff
changeset
|
72 (append string nil)) |
17052 | 73 |
74 ;;;###autoload | |
75 (defsubst string-to-vector (string) | |
76 "Return a vector of characters in STRING." | |
41232
43e756c38f4f
(string-to-sequence): Make it obsolete.
Richard M. Stallman <rms@gnu.org>
parents:
38414
diff
changeset
|
77 (vconcat string)) |
17052 | 78 |
79 ;;;###autoload | |
80 (defun store-substring (string idx obj) | |
81 "Embed OBJ (string or character) at index IDX of STRING." | |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
82 (if (integerp obj) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
83 (aset string idx obj) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
84 (let ((len1 (length obj)) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
85 (len2 (length string)) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
86 (i 0)) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
87 (while (< i len1) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
88 (aset string (+ idx i) (aref obj i)) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
89 (setq i (1+ i))))) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
90 string) |
17052 | 91 |
92 ;;;###autoload | |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
93 (defun truncate-string-to-width (str end-column |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
94 &optional start-column padding ellipsis) |
19916
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
95 "Truncate string STR to end at column END-COLUMN. |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
96 The optional 3rd arg START-COLUMN, if non-nil, specifies the starting |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
97 column; that means to return the characters occupying columns |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
98 START-COLUMN ... END-COLUMN of STR. Both END-COLUMN and START-COLUMN |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
99 are specified in terms of character display width in the current |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
100 buffer; see also `char-width'. |
19916
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
101 |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
102 The optional 4th arg PADDING, if non-nil, specifies a padding |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
103 character (which should have a display width of 1) to add at the end |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
104 of the result if STR doesn't reach column END-COLUMN, or if END-COLUMN |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
105 comes in the middle of a character in STR. PADDING is also added at |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
106 the beginning of the result if column START-COLUMN appears in the |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
107 middle of a character in STR. |
19916
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
108 |
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
109 If PADDING is nil, no padding is added in these cases, so |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
110 the resulting string may be narrower than END-COLUMN. |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
111 |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
112 If ELLIPSIS is non-nil, it should be a string which will replace the |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
113 end of STR (including any padding) if it extends beyond END-COLUMN, |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
114 unless the display width of STR is equal to or less than the display |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
115 width of ELLIPSIS. If it is non-nil and not a string, then ELLIPSIS |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
116 defaults to \"...\"." |
17052 | 117 (or start-column |
118 (setq start-column 0)) | |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
119 (when (and ellipsis (not (stringp ellipsis))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
120 (setq ellipsis "...")) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
121 (let ((str-len (length str)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
122 (str-width (string-width str)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
123 (ellipsis-len (if ellipsis (length ellipsis) 0)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
124 (ellipsis-width (if ellipsis (string-width ellipsis) 0)) |
17052 | 125 (idx 0) |
126 (column 0) | |
127 (head-padding "") (tail-padding "") | |
128 ch last-column last-idx from-idx) | |
129 (condition-case nil | |
130 (while (< column start-column) | |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
131 (setq ch (aref str idx) |
17052 | 132 column (+ column (char-width ch)) |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
133 idx (1+ idx))) |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
134 (args-out-of-range (setq idx str-len))) |
17052 | 135 (if (< column start-column) |
19916
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
136 (if padding (make-string end-column padding) "") |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
137 (when (and padding (> column start-column)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
138 (setq head-padding (make-string (- column start-column) padding))) |
17052 | 139 (setq from-idx idx) |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
140 (when (>= end-column column) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
141 (if (and (< end-column str-width) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
142 (> str-width ellipsis-width)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
143 (setq end-column (- end-column ellipsis-width)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
144 (setq ellipsis "")) |
19916
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
145 (condition-case nil |
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
146 (while (< column end-column) |
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
147 (setq last-column column |
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
148 last-idx idx |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
149 ch (aref str idx) |
19916
f43513081277
(truncate-string-to-width):
Richard M. Stallman <rms@gnu.org>
parents:
19745
diff
changeset
|
150 column (+ column (char-width ch)) |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
151 idx (1+ idx))) |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
152 (args-out-of-range (setq idx str-len))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
153 (when (> column end-column) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
154 (setq column last-column |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
155 idx last-idx)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
156 (when (and padding (< column end-column)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
157 (setq tail-padding (make-string (- end-column column) padding)))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
158 (concat head-padding (substring str from-idx idx) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
159 tail-padding ellipsis)))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
160 |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
161 ;;; Test suite for truncate-string-to-width |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
162 ;; (dolist (test '((("" 0) . "") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
163 ;; (("x" 1) . "x") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
164 ;; (("xy" 1) . "x") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
165 ;; (("xy" 2 1) . "y") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
166 ;; (("xy" 0) . "") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
167 ;; (("xy" 3) . "xy") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
168 ;; (("$AVP(B" 0) . "") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
169 ;; (("$AVP(B" 1) . "") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
170 ;; (("$AVP(B" 2) . "$AVP(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
171 ;; (("$AVP(B" 1 nil ? ) . " ") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
172 ;; (("$AVPND(B" 3 1 ? ) . " ") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
173 ;; (("x$AVP(Bx" 2) . "x") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
174 ;; (("x$AVP(Bx" 3) . "x$AVP(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
175 ;; (("x$AVP(Bx" 3) . "x$AVP(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
176 ;; (("x$AVP(Bx" 4 1) . "$AVP(Bx") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
177 ;; (("kor$(CGQ(Be$(C1[(Ban" 8 1 ? ) . "or$(CGQ(Be$(C1[(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
178 ;; (("kor$(CGQ(Be$(C1[(Ban" 7 2 ? ) . "r$(CGQ(Be ") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
179 ;; (("" 0 nil nil "...") . "") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
180 ;; (("x" 3 nil nil "...") . "x") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
181 ;; (("$AVP(B" 3 nil nil "...") . "$AVP(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
182 ;; (("foo" 3 nil nil "...") . "foo") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
183 ;; (("foo" 2 nil nil "...") . "fo") ;; XEmacs failure? |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
184 ;; (("foobar" 6 0 nil "...") . "foobar") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
185 ;; (("foobarbaz" 6 nil nil "...") . "foo...") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
186 ;; (("foobarbaz" 7 2 nil "...") . "ob...") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
187 ;; (("foobarbaz" 9 3 nil "...") . "barbaz") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
188 ;; (("$B$3(Bh$B$s(Be$B$K(Bl$B$A(Bl$B$O(Bo" 15 1 ? t) . " h$B$s(Be$B$K(Bl$B$A(Bl$B$O(Bo") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
189 ;; (("$B$3(Bh$B$s(Be$B$K(Bl$B$A(Bl$B$O(Bo" 14 1 ? t) . " h$B$s(Be$B$K(Bl$B$A(B...") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
190 ;; (("x" 3 nil nil "$(0GnM$(B") . "x") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
191 ;; (("$AVP(B" 2 nil nil "$(0GnM$(B") . "$AVP(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
192 ;; (("$AVP(B" 1 nil ?x "$(0GnM$(B") . "x") ;; XEmacs error |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
193 ;; (("$AVPND(B" 3 nil ? "$(0GnM$(B") . "$AVP(B ") ;; XEmacs error |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
194 ;; (("foobarbaz" 4 nil nil "$(0GnM$(B") . "$(0GnM$(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
195 ;; (("foobarbaz" 5 nil nil "$(0GnM$(B") . "f$(0GnM$(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
196 ;; (("foobarbaz" 6 nil nil "$(0GnM$(B") . "fo$(0GnM$(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
197 ;; (("foobarbaz" 8 3 nil "$(0GnM$(B") . "b$(0GnM$(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
198 ;; (("$B$3(Bh$B$s(Be$B$K(Bl$B$A(Bl$B$O(Bo" 14 4 ?x "$BF|K\8l(B") . "xe$B$KF|K\8l(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
199 ;; (("$B$3(Bh$B$s(Be$B$K(Bl$B$A(Bl$B$O(Bo" 13 4 ?x "$BF|K\8l(B") . "xex$BF|K\8l(B") |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
200 ;; )) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
201 ;; (let (ret) |
48156
5701c670b676
(coding-system-eol-type-mnemonic): Move to mule.el.
Juanma Barranquero <lekktu@gmail.com>
parents:
46511
diff
changeset
|
202 ;; (condition-case e |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
203 ;; (setq ret (apply #'truncate-string-to-width (car test))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
204 ;; (error (setq ret e))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
205 ;; (unless (equal ret (cdr test)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
206 ;; (error "%s: expected %s, got %s" |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
207 ;; (prin1-to-string (cons 'truncate-string-to-width (car test))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
208 ;; (prin1-to-string (cdr test)) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
209 ;; (if (consp ret) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
210 ;; (format "error: %s: %s" (car ret) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
211 ;; (prin1-to-string (cdr ret))) |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
212 ;; (prin1-to-string ret)))))) |
17052 | 213 |
214 | |
215 ;;; Nested alist handler. Nested alist is alist whose elements are | |
216 ;;; also nested alist. | |
217 | |
218 ;;;###autoload | |
219 (defsubst nested-alist-p (obj) | |
23196 | 220 "Return t if OBJ is a nested alist. |
17052 | 221 |
222 Nested alist is a list of the form (ENTRY . BRANCHES), where ENTRY is | |
223 any Lisp object, and BRANCHES is a list of cons cells of the form | |
45908
bb8152219329
open-paren-in-column-0 in dosctring.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
45453
diff
changeset
|
224 \(KEY-ELEMENT . NESTED-ALIST). |
17052 | 225 |
226 You can use a nested alist to store any Lisp object (ENTRY) for a key | |
227 sequence KEYSEQ, where KEYSEQ is a sequence of KEY-ELEMENT. KEYSEQ | |
228 can be a string, a vector, or a list." | |
229 (and obj (listp obj) (listp (cdr obj)))) | |
230 | |
231 ;;;###autoload | |
232 (defun set-nested-alist (keyseq entry alist &optional len branches) | |
233 "Set ENTRY for KEYSEQ in a nested alist ALIST. | |
23196 | 234 Optional 4th arg LEN non-nil means the first LEN elements in KEYSEQ |
17052 | 235 is considered. |
236 Optional argument BRANCHES if non-nil is branches for a keyseq | |
237 longer than KEYSEQ. | |
238 See the documentation of `nested-alist-p' for more detail." | |
239 (or (nested-alist-p alist) | |
23196 | 240 (error "Invalid argument %s" alist)) |
17052 | 241 (let ((islist (listp keyseq)) |
242 (len (or len (length keyseq))) | |
243 (i 0) | |
244 key-elt slot) | |
245 (while (< i len) | |
246 (if (null (nested-alist-p alist)) | |
247 (error "Keyseq %s is too long for this nested alist" keyseq)) | |
248 (setq key-elt (if islist (nth i keyseq) (aref keyseq i))) | |
249 (setq slot (assoc key-elt (cdr alist))) | |
250 (if (null slot) | |
251 (progn | |
252 (setq slot (cons key-elt (list t))) | |
253 (setcdr alist (cons slot (cdr alist))))) | |
254 (setq alist (cdr slot)) | |
255 (setq i (1+ i))) | |
256 (setcar alist entry) | |
257 (if branches | |
26890
4cd9407a4683
(set-nested-alist): Set BRANCHES (if
Kenichi Handa <handa@m17n.org>
parents:
26691
diff
changeset
|
258 (setcdr (last alist) branches)))) |
17052 | 259 |
260 ;;;###autoload | |
261 (defun lookup-nested-alist (keyseq alist &optional len start nil-for-too-long) | |
262 "Look up key sequence KEYSEQ in nested alist ALIST. Return the definition. | |
263 Optional 1st argument LEN specifies the length of KEYSEQ. | |
264 Optional 2nd argument START specifies index of the starting key. | |
265 The returned value is normally a nested alist of which | |
266 car part is the entry for KEYSEQ. | |
267 If ALIST is not deep enough for KEYSEQ, return number which is | |
268 how many key elements at the front of KEYSEQ it takes | |
269 to reach a leaf in ALIST. | |
270 Optional 3rd argument NIL-FOR-TOO-LONG non-nil means return nil | |
271 even if ALIST is not deep enough." | |
272 (or (nested-alist-p alist) | |
28458 | 273 (error "Invalid argument %s" alist)) |
17052 | 274 (or len |
275 (setq len (length keyseq))) | |
276 (let ((i (or start 0))) | |
277 (if (catch 'lookup-nested-alist-tag | |
278 (if (listp keyseq) | |
279 (while (< i len) | |
280 (if (setq alist (cdr (assoc (nth i keyseq) (cdr alist)))) | |
281 (setq i (1+ i)) | |
282 (throw 'lookup-nested-alist-tag t)))) | |
283 (while (< i len) | |
284 (if (setq alist (cdr (assoc (aref keyseq i) (cdr alist)))) | |
285 (setq i (1+ i)) | |
286 (throw 'lookup-nested-alist-tag t)))) | |
287 ;; KEYSEQ is too long. | |
288 (if nil-for-too-long nil i) | |
289 alist))) | |
290 | |
18299
c6f35cac24b4
(coding-system-parent): New function.
Kenichi Handa <handa@m17n.org>
parents:
18200
diff
changeset
|
291 |
17052 | 292 ;; Coding system related functions. |
293 | |
294 ;;;###autoload | |
18200
c913160e34a7
(set-coding-system-alist): Deleted.
Kenichi Handa <handa@m17n.org>
parents:
17092
diff
changeset
|
295 (defun coding-system-post-read-conversion (coding-system) |
42049 | 296 "Return the value of CODING-SYSTEM's `post-read-conversion' property." |
20113
00ca5f419c16
(coding-system-base): Moved to
Kenichi Handa <handa@m17n.org>
parents:
19932
diff
changeset
|
297 (coding-system-get coding-system 'post-read-conversion)) |
18200
c913160e34a7
(set-coding-system-alist): Deleted.
Kenichi Handa <handa@m17n.org>
parents:
17092
diff
changeset
|
298 |
c913160e34a7
(set-coding-system-alist): Deleted.
Kenichi Handa <handa@m17n.org>
parents:
17092
diff
changeset
|
299 ;;;###autoload |
c913160e34a7
(set-coding-system-alist): Deleted.
Kenichi Handa <handa@m17n.org>
parents:
17092
diff
changeset
|
300 (defun coding-system-pre-write-conversion (coding-system) |
42049 | 301 "Return the value of CODING-SYSTEM's `pre-write-conversion' property." |
20113
00ca5f419c16
(coding-system-base): Moved to
Kenichi Handa <handa@m17n.org>
parents:
19932
diff
changeset
|
302 (coding-system-get coding-system 'pre-write-conversion)) |
18200
c913160e34a7
(set-coding-system-alist): Deleted.
Kenichi Handa <handa@m17n.org>
parents:
17092
diff
changeset
|
303 |
c913160e34a7
(set-coding-system-alist): Deleted.
Kenichi Handa <handa@m17n.org>
parents:
17092
diff
changeset
|
304 ;;;###autoload |
22126
97cf1cae1971
Change term unification to
Kenichi Handa <handa@m17n.org>
parents:
21554
diff
changeset
|
305 (defun coding-system-translation-table-for-decode (coding-system) |
42049 | 306 "Return the value of CODING-SYSTEM's `translation-table-for-decode' property." |
22186
fc4aaf1b1772
Change term "character translation table" to "translation table".
Kenichi Handa <handa@m17n.org>
parents:
22126
diff
changeset
|
307 (coding-system-get coding-system 'translation-table-for-decode)) |
19455
7cf3d42a6fd7
(coding-system-unification-table):
Kenichi Handa <handa@m17n.org>
parents:
19264
diff
changeset
|
308 |
7cf3d42a6fd7
(coding-system-unification-table):
Kenichi Handa <handa@m17n.org>
parents:
19264
diff
changeset
|
309 ;;;###autoload |
22126
97cf1cae1971
Change term unification to
Kenichi Handa <handa@m17n.org>
parents:
21554
diff
changeset
|
310 (defun coding-system-translation-table-for-encode (coding-system) |
42049 | 311 "Return the value of CODING-SYSTEM's `translation-table-for-encode' property." |
22186
fc4aaf1b1772
Change term "character translation table" to "translation table".
Kenichi Handa <handa@m17n.org>
parents:
22126
diff
changeset
|
312 (coding-system-get coding-system 'translation-table-for-encode)) |
17052 | 313 |
18299
c6f35cac24b4
(coding-system-parent): New function.
Kenichi Handa <handa@m17n.org>
parents:
18200
diff
changeset
|
314 ;;;###autoload |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
315 (defmacro detect-coding-with-priority (from to priority-list) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
316 "Detect a coding system of the text between FROM and TO with PRIORITY-LIST. |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
317 PRIORITY-LIST is an alist of coding categories vs the corresponding |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
318 coding systems ordered by priority." |
24485
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
319 `(unwind-protect |
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
320 (let* ((prio-list ,priority-list) |
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
321 (coding-category-list coding-category-list) |
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
322 ,@(mapcar (function (lambda (x) (list x x))) |
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
323 coding-category-list)) |
29058
39b69af53e85
(detect-coding-with-priority): Use mapc. Remove redundant lambda.
Dave Love <fx@gnu.org>
parents:
28458
diff
changeset
|
324 (mapc (function (lambda (x) (set (car x) (cdr x)))) |
39b69af53e85
(detect-coding-with-priority): Use mapc. Remove redundant lambda.
Dave Love <fx@gnu.org>
parents:
28458
diff
changeset
|
325 prio-list) |
39b69af53e85
(detect-coding-with-priority): Use mapc. Remove redundant lambda.
Dave Love <fx@gnu.org>
parents:
28458
diff
changeset
|
326 (set-coding-priority (mapcar #'car prio-list)) |
61065
c40f1d439bcc
(detect-coding-with-priority): Add comment before the call of
Kenichi Handa <handa@m17n.org>
parents:
60962
diff
changeset
|
327 ;; Changing the binding of a coding category requires this call. |
60962
a3bf037cdd99
(detect-coding-with-priority): Call
Kenichi Handa <handa@m17n.org>
parents:
59996
diff
changeset
|
328 (update-coding-systems-internal) |
24485
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
329 (detect-coding-region ,from ,to)) |
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
330 ;; We must restore the internal database. |
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
331 (set-coding-priority coding-category-list) |
ab39ea2168e7
(detect-coding-with-priority): Restore the internal database.
Kenichi Handa <handa@m17n.org>
parents:
24346
diff
changeset
|
332 (update-coding-systems-internal))) |
20162
dc6f12ef4d47
(find-safe-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
20113
diff
changeset
|
333 |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
334 ;;;###autoload |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
335 (defun detect-coding-with-language-environment (from to lang-env) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
336 "Detect a coding system of the text between FROM and TO with LANG-ENV. |
23196 | 337 The detection takes into account the coding system priorities for the |
20730
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
338 language environment LANG-ENV." |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
339 (let ((coding-priority (get-language-info lang-env 'coding-priority))) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
340 (if coding-priority |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
341 (detect-coding-with-priority |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
342 from to |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
343 (mapcar (function (lambda (x) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
344 (cons (coding-system-get x 'coding-category) x))) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
345 coding-priority)) |
42d729244a85
(find-safe-coding-system): Moved to
Kenichi Handa <handa@m17n.org>
parents:
20162
diff
changeset
|
346 (detect-coding-region from to)))) |
20162
dc6f12ef4d47
(find-safe-coding-system): New function.
Kenichi Handa <handa@m17n.org>
parents:
20113
diff
changeset
|
347 |
52403 | 348 ;;;###autoload |
349 (defun char-displayable-p (char) | |
350 "Return non-nil if we should be able to display CHAR. | |
351 On a multi-font display, the test is only whether there is an | |
352 appropriate font from the selected frame's fontset to display CHAR's | |
353 charset in general. Since fonts may be specified on a per-character | |
354 basis, this may not be accurate." | |
355 (cond ((< char 256) | |
356 ;; Single byte characters are always displayable. | |
357 t) | |
58804
9b0a547610a4
(char-displayable-p): Return nil for unibyte mode.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57443
diff
changeset
|
358 ((not enable-multibyte-characters) |
9b0a547610a4
(char-displayable-p): Return nil for unibyte mode.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57443
diff
changeset
|
359 ;; Maybe there's a font for it, but we can't put it in the buffer. |
9b0a547610a4
(char-displayable-p): Return nil for unibyte mode.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57443
diff
changeset
|
360 nil) |
52403 | 361 ((display-multi-font-p) |
362 ;; On a window system, a character is displayable if we have | |
363 ;; a font for that character in the default face of the | |
364 ;; currently selected frame. | |
55095
4d5ade635f7a
(char-displayable-p): Simplified by using internal-char-font.
Kenichi Handa <handa@m17n.org>
parents:
54638
diff
changeset
|
365 (car (internal-char-font nil char))) |
52403 | 366 (t |
367 (let ((coding (terminal-coding-system))) | |
368 (if coding | |
369 (let ((safe-chars (coding-system-get coding 'safe-chars)) | |
370 (safe-charsets (coding-system-get coding 'safe-charsets))) | |
371 (or (and safe-chars | |
372 (aref safe-chars char)) | |
373 (and safe-charsets | |
374 (memq (char-charset char) safe-charsets))))))))) | |
17052 | 375 |
28458 | 376 (provide 'mule-util) |
377 | |
45453
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
378 ;; Local Variables: |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
379 ;; coding: iso-2022-7bit |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
380 ;; End: |
05d77f58ead5
(truncate-string-to-width): New optional argument `ellipsis'. Add
Colin Walters <walters@gnu.org>
parents:
42049
diff
changeset
|
381 |
58804
9b0a547610a4
(char-displayable-p): Return nil for unibyte mode.
Stefan Monnier <monnier@iro.umontreal.ca>
parents:
57443
diff
changeset
|
382 ;; arch-tag: 5bdb52b6-a3a5-4529-b7a0-37d01b0e570b |
26890
4cd9407a4683
(set-nested-alist): Set BRANCHES (if
Kenichi Handa <handa@m17n.org>
parents:
26691
diff
changeset
|
383 ;;; mule-util.el ends here |