comparison lisp/international/mule-cmds.el @ 20830:237a0f70c61d

(toggle-enable-multibyte-characters): Use set-buffer-multibyte. (find-safe-coding-system-list-subset-p): Renamed from list-subset-p. The call changed also.
author Richard M. Stallman <rms@gnu.org>
date Tue, 03 Feb 1998 06:29:24 +0000
parents 079907c59fb2
children 428831a6f4d1
comparison
equal deleted inserted replaced
20829:f9ac469887a8 20830:237a0f70c61d
155 155
156 We suggest you avoid using use this command unless you know what you 156 We suggest you avoid using use this command unless you know what you
157 are doing. If you use it by mistake, and the buffer is now displayed 157 are doing. If you use it by mistake, and the buffer is now displayed
158 wrong, use this command again to toggle back to the right mode." 158 wrong, use this command again to toggle back to the right mode."
159 (interactive "P") 159 (interactive "P")
160 (setq enable-multibyte-characters 160 (let ((new-flag
161 (if (null arg) (null enable-multibyte-characters) 161 (if (null arg) (null enable-multibyte-characters)
162 (> (prefix-numeric-value arg) 0))) 162 (> (prefix-numeric-value arg) 0))))
163 (set-buffer-multibyte new-flag))
163 (force-mode-line-update)) 164 (force-mode-line-update))
164 165
165 (defun view-hello-file () 166 (defun view-hello-file ()
166 "Display the HELLO file which list up many languages and characters." 167 "Display the HELLO file which list up many languages and characters."
167 (interactive) 168 (interactive)
222 (if (and base (interactive-p)) 223 (if (and base (interactive-p))
223 (message "Highest priority is set to %s (base of %s)" 224 (message "Highest priority is set to %s (base of %s)"
224 base coding-system)) 225 base coding-system))
225 (set-default-coding-systems (or base coding-system)))) 226 (set-default-coding-systems (or base coding-system))))
226 227
227 (defun list-subset-p (list1 list2) 228 (defun find-safe-coding-system-list-subset-p (list1 list2)
228 "Return non-nil if all elements in LIST1 are included in LIST2. 229 "Return non-nil if all elements in LIST1 are included in LIST2.
229 Comparison done with EQ." 230 Comparison done with EQ."
230 (catch 'tag 231 (catch 'tag
231 (while list1 232 (while list1
232 (or (memq (car list1) list2) 233 (or (memq (car list1) list2)
259 (while l 260 (while l
260 (setq coding (car l) l (cdr l)) 261 (setq coding (car l) l (cdr l))
261 (if (and (eq coding (coding-system-base coding)) 262 (if (and (eq coding (coding-system-base coding))
262 (setq safe (coding-system-get coding 'safe-charsets)) 263 (setq safe (coding-system-get coding 'safe-charsets))
263 (or (eq safe t) 264 (or (eq safe t)
264 (list-subset-p charset-list safe))) 265 (find-safe-coding-system-list-subset-p
266 charset-list safe)))
265 ;; We put the higher priority to coding systems included 267 ;; We put the higher priority to coding systems included
266 ;; in PREFERED-CODINGS, and within them, put the higher 268 ;; in PREFERED-CODINGS, and within them, put the higher
267 ;; priority to coding systems which support smaller 269 ;; priority to coding systems which support smaller
268 ;; number of charsets. 270 ;; number of charsets.
269 (let ((priority 271 (let ((priority