/[emacs]/emacs/lisp/gnus/mm-util.el
ViewVC logotype

Diff of /emacs/lisp/gnus/mm-util.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24.2.2 by fx, Mon May 27 14:53:41 2002 UTC revision 1.24.2.3 by fx, Mon Jun 24 19:06:43 2002 UTC
# Line 368  used as the line break code type of the Line 368  used as the line break code type of the
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 ()
# Line 388  non-nil.  This is a no-op in XEmacs." Line 383  non-nil.  This is a no-op in XEmacs."
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.
# Line 419  If the charset is `composition', return Line 400  If the charset is `composition', return
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
# Line 575  Equivalent to `progn' in XEmacs" Line 556  Equivalent to `progn' in XEmacs"
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)

Legend:
Removed from v.1.24.2.2  
changed lines
  Added in v.1.24.2.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26