• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /macosx-10.9.5/emacs-92/emacs/lisp/gnus/

Lines Matching defs:charset

49       . (lambda (charset int)
51 (read-charset
53 "Return a charset."
58 mm-mime-mule-charset-alist)
145 ;; Fixme: This seems always to be used to read a MIME charset, so it
147 ;; proper charset names (base coding systems which have a
148 ;; mime-charset defined). XEmacs doesn't believe in mime-charset;
150 ;; `(or (coding-system-get 'iso-8859-1 'mime-charset)
151 ;; (coding-system-get 'iso-8859-1 :mime-charset))'
152 ;; Actually, there should be an `mm-coding-system-mime-charset'.
166 mm-mime-mule-charset-alist)))))))
191 `mm-charset-synonym-alist'. If ALIAS is a string, it's used as
208 (add-to-list 'mm-charset-synonym-alist (cons alias cp)))))
210 (defvar mm-charset-synonym-alist
212 ;; Not in XEmacs, but it's not a proper MIME charset anyhow.
236 "A mapping from unknown or invalid charset names to the real charset names.
249 "A list of Windows codepage numbers and iso-8859 charset numbers.
252 codepage, appropriate entries to `mm-charset-synonym-alist' are
255 corresponding number of an iso-8859 charset."
266 (integer :tag "iso-8859 charset number")))))
293 codepage, appropriate entries to `mm-charset-synonym-alist' are
317 "Add appropriate entries to `mm-charset-synonym-alist'.
331 (add-to-list 'mm-charset-synonym-alist (cons windows cp))
332 (add-to-list 'mm-charset-synonym-alist (cons windows iso)))))))
335 "Add appropriate entries to `mm-charset-synonym-alist'.
344 (add-to-list 'mm-charset-synonym-alist (cons ibm cp))))))
350 (defcustom mm-charset-override-alist
352 "A mapping from undesired charset names to their replacement.
362 (cons (symbol :tag "From charset")
363 (symbol :tag "To charset"))))
367 (defcustom mm-charset-eval-alist
390 (cons (symbol :tag "charset")
432 (defvar mm-mime-mule-charset-alist
439 ;; Non-mule (X)Emacs uses the last mule-charset for 8bit characters.
440 ;; The fake mule-charset, gnus-koi8-r, tells Gnus that the default
441 ;; charset is koi8-r, not iso-8859-5.
480 (cons 'utf-8 (delq 'ascii (mapcar 'charset-name
490 "Alist of MIME-charset/MULE-charsets.")
493 "Make the `utf-8' MIME charset usable by the Mule-UCS package.
495 XEmacs, and fill the `utf-8' entry in `mm-mime-mule-charset-alist'
497 (when (boundp 'unicode-basic-translation-charset-order-list)
503 'unicode-basic-translation-charset-order-list))))
504 (elem (assq 'utf-8 mm-mime-mule-charset-alist)))
507 (setq mm-mime-mule-charset-alist
508 (nconc mm-mime-mule-charset-alist
521 mime (or (coding-system-get cs :mime-charset) ; Emacs 23 (unicode)
522 (coding-system-get cs 'mime-charset)))
528 (setq mm-mime-mule-charset-alist (nreverse alist)))))
550 (cons (char-charset c)
556 '(gnus-charset 0)))
590 (defun mm-mule-charset-to-mime-charset (charset)
591 "Return the MIME charset corresponding to the given Mule CHARSET."
595 (find-coding-systems-for-charsets (list charset)))
601 (setq mime (or (coding-system-get cs :mime-charset)
602 (coding-system-get cs 'mime-charset)))))
605 (assq cs mm-mime-mule-charset-alist))
606 (sort (mapcar 'car mm-mime-mule-charset-alist)
610 (when (memq charset (cdar alist))
616 (defun mm-charset-to-coding-system (charset &optional lbt
619 CHARSET is a symbol naming a MIME charset.
623 If ALLOW-OVERRIDE is given, use `mm-charset-override-alist' to
624 map undesired charset names to their replacement. This should
627 (when (stringp charset)
628 (setq charset (intern (downcase charset))))
630 (setq charset (intern (format "%s-%s" charset lbt))))
632 ((null charset)
633 charset)
637 charset)
641 (let ((cs (cdr (assq charset mm-charset-override-alist))))
644 ((eq charset 'us-ascii)
646 ;; Check to see whether we can handle this charset. (This depends
647 ;; on there being some coding system matching each `mime-charset'
649 ((and (mm-coding-system-p charset)
651 ;;; charset
652 ;;; (eq charset (coding-system-get charset 'mime-charset))
654 charset)
655 ;; Eval expressions from `mm-charset-eval-alist'
656 ((let* ((el (assq charset mm-charset-eval-alist))
666 (message "Added charset `%s' via `mm-charset-eval-alist'" cs))
669 ((let ((cs (cdr (assq charset mm-charset-synonym-alist))))
673 ;; "Using synonym `%s' from `mm-charset-synonym-alist' for `%s'"
674 ;; cs charset)
677 ;; have the right mime-charset in case the canonical name isn't
684 (eq charset (or (coding-system-get c :mime-charset)
685 (coding-system-get c 'mime-charset))))
688 ;; Warn the user about unknown charset:
690 (gnus-message 7 "Unknown charset: %s" charset)
691 (message "Unknown charset: %s" charset)))
719 (defun mm-preferred-coding-system (charset)
721 (or (get-charset-property charset 'preferred-coding-system)
722 (get-charset-property charset 'prefered-coding-system)))
725 (defsubst mm-guess-charset ()
726 "Guess Mule charset from the language environment."
728 mail-parse-mule-charset ;; cached mule-charset
730 (setq mail-parse-mule-charset
733 (assq 'charset
736 (if (or (not mail-parse-mule-charset)
737 (eq mail-parse-mule-charset 'ascii))
738 (setq mail-parse-mule-charset
739 (or (car (last (assq mail-parse-charset
740 mm-mime-mule-charset-alist)))
743 mail-parse-mule-charset)))
745 (defun mm-charset-after (&optional pos)
746 "Return charset of a character in current buffer at position POS.
749 If the charset is `composition', return the actual one."
750 (let ((char (char-after pos)) charset)
752 (setq charset 'ascii)
753 ;; charset-after is fake in some Emacsen.
754 (setq charset (and (fboundp 'char-charset) (char-charset char)))
755 (if (eq charset 'composition) ; Mule 4
757 (cadr (find-charset-region p (1+ p))))
758 (if (and charset (not (memq charset '(ascii eight-bit-control
760 charset
761 (mm-guess-charset))))))
763 (defun mm-mime-charset (charset)
764 "Return the MIME charset corresponding to the given Mule CHARSET."
765 (if (eq charset 'unknown)
767 (if (and (fboundp 'coding-system-get) (fboundp 'get-charset-property))
770 (and (mm-preferred-coding-system charset)
772 (mm-preferred-coding-system charset) :mime-charset)
774 (mm-preferred-coding-system charset) 'mime-charset)))
775 (and (eq charset 'ascii)
777 (mm-preferred-coding-system charset)
778 (mm-mule-charset-to-mime-charset charset))
780 (mm-mule-charset-to-mime-charset charset)))
817 (if (fboundp 'char-charset)
818 (let (charset item c inconvertible)
825 ((not (setq item (assq (char-charset (setq c (char-after)))
858 (defun mm-xemacs-find-mime-charset-1 (begin end)
859 "Determine which MIME charset to use to send region as message.
903 ;; in `mm-find-mime-charset-region' function, whence we
916 ;; Leave `mm-find-mime-charset' to do most of the work.
919 ;; Right, latin unity isn't available; let `mm-find-charset-region'
923 (defmacro mm-xemacs-find-mime-charset (begin end)
925 `(and (featurep 'mule) (mm-xemacs-find-mime-charset-1 ,begin ,end))))
927 (defun mm-find-mime-charset-region (b e &optional hack-charsets)
930 charset, and a longer list means no appropriate charset."
935 ;; Find the mime-charset of the most preferred coding
945 (cs (or (coding-system-get head :mime-charset)
946 (coding-system-get head 'mime-charset))))
947 ;; The mime-charset (`x-ctext') of
950 ;; mime-charset having an `x-' prefix.
955 ;; mime-charset, though it's not valid).
960 ;; mime-charset defined both in Mule-UCS
969 ;; mm-xemacs-find-mime-charset will return an appropriate list.
971 (setq charsets (mm-xemacs-find-mime-charset b e))
976 (mapcar 'mm-mime-charset
978 (mm-find-charset-region b e))))))
996 (mapcar 'mm-mime-charset
998 (mm-find-charset-region b e)))))))
1058 (defun mm-find-charset-region (b e)
1062 (fboundp 'find-charset-region))
1065 (let ((css (find-charset-region b e)))
1079 (let (charset)
1080 (setq charset
1082 (car (last (assq 'charset
1085 (if (eq charset 'ascii) (setq charset nil))
1086 (or charset
1087 (setq charset
1088 (car (last (assq mail-parse-charset
1089 mm-mime-mule-charset-alist)))))
1090 (list 'ascii (or charset 'latin-iso8859-1)))))))))
1281 (if (eq (point) end) 'ascii (mm-guess-charset))
1285 (defun mm-detect-mime-charset-region (start end)
1286 "Detect MIME charset of the text in the region between START and END."
1288 (or (coding-system-get cs :mime-charset)
1289 (coding-system-get cs 'mime-charset))))
1290 (defun mm-detect-mime-charset-region (start end)
1291 "Detect MIME charset of the text in the region between START and END."