Home | History | Annotate | Download | only in misc

Lines Matching defs:po

0 ;;; po-compat.el --- basic support of PO translation files -*- coding: latin-1; -*-
29 ;; Emacs 21.2 and newer already contain this file, under the name po.el,
32 ;; This package makes sure visiting PO files decodes them correctly,
33 ;; according to the Charset= header in the PO file. For more support
34 ;; for editing PO files, see po-mode.el.
43 ;; - XEmacs (version 19 and above) -> po-XEMACS = t,
44 ;; - GNU Emacs (version 20 and above) -> po-EMACS20 = t,
48 (setq po-EMACS20 nil po-XEMACS t))
50 (setq po-EMACS20 t po-XEMACS nil))
51 (t (setq po-EMACS20 nil po-XEMACS nil))))
56 (fset 'po-with-temp-buffer (symbol-function 'with-temp-buffer))
58 (defmacro po-with-temp-buffer (&rest forms)
64 (generate-new-buffer-name " *po-temp*"))))
73 (defconst po-content-type-charset-alist
154 (defun po-find-charset (filename)
155 "Return PO file charset value."
161 ;; within the first 4096 bytes (the PO file might start with a long
185 (if po-EMACS20
186 (defun po-find-file-coding-system-guts (operation filename)
188 Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
192 (po-with-temp-buffer
194 (charset (or (po-find-charset filename) "ascii"))
198 (cdr (assoc charset-upper po-content-type-charset-alist)))
204 ((and po-EMACS20
214 (if po-XEMACS
215 (defun po-find-file-coding-system-guts (operation filename)
217 Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
221 (po-with-temp-buffer
223 (let* ((charset (or (po-find-charset filename)
228 po-content-type-charset-alist))
233 (if po-EMACS20
234 (defun po-find-file-coding-system (arg-list)
236 Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
238 (po-find-file-coding-system-guts (car arg-list) (car (cdr arg-list)))))
240 (if po-XEMACS
241 (defun po-find-file-coding-system (operation filename)
243 Return a Mule (DECODING . ENCODING) pair, according to PO file charset.
245 (po-find-file-coding-system-guts operation filename)))
249 (provide 'po-compat)
255 ;; cs.po ; gettext/po/cs.el, charset=ISO-8859-2
256 ;; cs-modified.po ; gettext/po/cs.el, charset=ISO_8859-2
257 ;; de.po ; gettext/po/de.el, charset=UTF-8, if $emacsimpl = emacs
260 ;; M-x load-file po-compat.el RET
264 ;;; po-compat.el ends here