annotate lisp/w3/w3-xem20.el @ 7:c153ca296910

Added tag r19-15b4 for changeset 27bc7f280385
author cvs
date Mon, 13 Aug 2007 08:47:16 +0200
parents ac2d302a0011
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
1 ;;; w3-xem20.el,v --- XEmacs 20.0 with Mule specific functions
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
2 ;; Author: MORIOKA Tomohiko
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
3 ;; Created: 1996/06/14 16:44:59
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
4 ;; Version: 1.1
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
5 ;; Keywords: faces, help, i18n, mouse, hypermedia
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
6
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
8 ;;; Copyright (c) 1996 by MORIOKA Tomohiko
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
9 ;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
10 ;;; This file is part of GNU Emacs.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
11 ;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
13 ;;; it under the terms of the GNU General Public License as published by
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
14 ;;; the Free Software Foundation; either version 2, or (at your option)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
15 ;;; any later version.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
16 ;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
17 ;;; GNU Emacs is distributed in the hope that it will be useful,
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
20 ;;; GNU General Public License for more details.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
21 ;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
22 ;;; You should have received a copy of the GNU General Public License
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
23 ;;; along with GNU Emacs; see the file COPYING. If not, write to
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
24 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
26
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
28 ;;; Printing a mule buffer as postscript. Requires m2ps
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
30 (defun w3-m2ps-buffer (&optional buffer)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
31 "Print a buffer by passing it through m2ps and lpr."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
32 (or buffer (setq buffer (current-buffer)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
33 (let ((x (save-excursion (set-buffer buffer) tab-width)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
34 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
35 (set-buffer (get-buffer-create " *mule-print*"))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
36 (erase-buffer)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
37 (insert-buffer buffer)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
38 (if (/= x tab-width)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
39 (progn
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
40 (setq tab-width x)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
41 (message "Converting tabs")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
42 (untabify (point-min) (point-max))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
43 (setq file-coding-system *internal*)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
44 (shell-command-on-region (point-min) (point-max)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
45 "m2ps | lpr" t))))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
46
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
47 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
48 ;;; Multi-Lingual Emacs (MULE) Specific Functions
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
49 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
50 (defvar attributed-region nil
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
51 "Bogus definition to get rid of compile-time warnings.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
52
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
53 (defun w3-inhibit-code-conversion (proc buf)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
54 "Inhibit Mule's subprocess PROC from code converting in BUF."
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
55 (save-excursion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
56 (set-buffer buf)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
57 (setq mc-flag nil))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
58 (set-process-input-coding-system proc url-mule-no-coding-system)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
59 (set-process-output-coding-system proc url-mule-no-coding-system))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
60
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
61 (defvar w3-mime-list-for-code-conversion
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
62 '("text/plain" "text/html")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
63 "List of MIME types that require Mules' code conversion.")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
64 (make-variable-buffer-local 'w3-mime-list-for-code-conversion)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
65
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
66 (defun w3-convert-code-for-mule (mmtype)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
67 "Convert current data into the appropriate coding system"
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
68 (and (or (not mmtype) (member mmtype w3-mime-list-for-code-conversion))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
69 (let* ((c (detect-coding-region (point-min) (point-max)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
70 (code (or (and (listp c) (car c)) c)))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
71 (setq mc-flag t)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
72 (decode-coding-region (point-min) (point-max) code)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
73 (set-file-coding-system code)
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
74 )))
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
75
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents:
diff changeset
76 (provide 'w3-xem20)