368 |
(boundp 'default-enable-multibyte-characters) |
(boundp 'default-enable-multibyte-characters) |
369 |
default-enable-multibyte-characters |
default-enable-multibyte-characters |
370 |
(fboundp 'set-buffer-multibyte)) |
(fboundp 'set-buffer-multibyte)) |
371 |
"Emacs mule.") |
"True in Emacs with Mule.") |
|
|
|
|
(defvar mm-mule4-p (and mm-emacs-mule |
|
|
(fboundp 'charsetp) |
|
|
(not (charsetp 'eight-bit-control))) |
|
|
"Mule version 4.") |
|
372 |
|
|
373 |
(if mm-emacs-mule |
(if mm-emacs-mule |
374 |
(defun mm-enable-multibyte () |
(defun mm-enable-multibyte () |
383 |
"Unset the multibyte flag of in the current buffer. |
"Unset the multibyte flag of in the current buffer. |
384 |
This is a no-op in XEmacs." |
This is a no-op in XEmacs." |
385 |
(set-buffer-multibyte nil)) |
(set-buffer-multibyte nil)) |
386 |
(defalias 'mm-disable-multibyte 'ignore)) |
(defalias 'mm-disable-multibyte 'ignore))) |
|
|
|
|
(if mm-mule4-p |
|
|
(defun mm-enable-multibyte-mule4 () |
|
|
"Enable multibyte in the current buffer. |
|
|
Only used in Emacs Mule 4." |
|
|
(set-buffer-multibyte t)) |
|
|
(defalias 'mm-enable-multibyte-mule4 'ignore)) |
|
|
|
|
|
(if mm-mule4-p |
|
|
(defun mm-disable-multibyte-mule4 () |
|
|
"Disable multibyte in the current buffer. |
|
|
Only used in Emacs Mule 4." |
|
|
(set-buffer-multibyte nil)) |
|
|
(defalias 'mm-disable-multibyte-mule4 'ignore))) |
|
387 |
|
|
388 |
(defun mm-preferred-coding-system (charset) |
(defun mm-preferred-coding-system (charset) |
389 |
;; A typo in some Emacs versions. |
;; A typo in some Emacs versions. |
400 |
(setq charset 'ascii) |
(setq charset 'ascii) |
401 |
;; charset-after is fake in some Emacsen. |
;; charset-after is fake in some Emacsen. |
402 |
(setq charset (and (fboundp 'char-charset) (char-charset char))) |
(setq charset (and (fboundp 'char-charset) (char-charset char))) |
403 |
(if (eq charset 'composition) |
(if (eq charset 'composition) ; Mule 4 |
404 |
(let ((p (or pos (point)))) |
(let ((p (or pos (point)))) |
405 |
(cadr (find-charset-region p (1+ p)))) |
(cadr (find-charset-region p (1+ p)))) |
406 |
(if (and charset (not (memq charset '(ascii eight-bit-control |
(if (and charset (not (memq charset '(ascii eight-bit-control |
556 |
(put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0) |
(put 'mm-with-unibyte-current-buffer 'lisp-indent-function 0) |
557 |
(put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body)) |
(put 'mm-with-unibyte-current-buffer 'edebug-form-spec '(body)) |
558 |
|
|
|
(defmacro mm-with-unibyte-current-buffer-mule4 (&rest forms) |
|
|
"Evaluate FORMS there like `progn' in current buffer. |
|
|
Mule4 only." |
|
|
(let ((multibyte (make-symbol "multibyte")) |
|
|
(buffer (make-symbol "buffer"))) |
|
|
`(if mm-mule4-p |
|
|
(let ((,multibyte enable-multibyte-characters) |
|
|
(,buffer (current-buffer))) |
|
|
(unwind-protect |
|
|
(let (default-enable-multibyte-characters) |
|
|
(set-buffer-multibyte nil) |
|
|
,@forms) |
|
|
(set-buffer ,buffer) |
|
|
(set-buffer-multibyte ,multibyte))) |
|
|
(let (default-enable-multibyte-characters) |
|
|
,@forms)))) |
|
|
(put 'mm-with-unibyte-current-buffer-mule4 'lisp-indent-function 0) |
|
|
(put 'mm-with-unibyte-current-buffer-mule4 'edebug-form-spec '(body)) |
|
|
|
|
559 |
(defmacro mm-with-unibyte (&rest forms) |
(defmacro mm-with-unibyte (&rest forms) |
560 |
"Eval the FORMS with the default value of `enable-multibyte-characters' nil, ." |
"Eval the FORMS with the default value of `enable-multibyte-characters' nil, ." |
561 |
`(let (default-enable-multibyte-characters) |
`(let (default-enable-multibyte-characters) |