annotate lisp/gnus/compface.el @ 109429:98c38f2ddca3

Merge from mainline.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Fri, 09 Jul 2010 01:02:18 +0000
parents 1d1d5d9bd884
children 8d09094063d0 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
1 ;;; compface.el --- functions for converting X-Face headers
64754
fafd692d1e40 Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents: 64085
diff changeset
2
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 100908
diff changeset
3 ;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
4
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
5 ;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
6 ;; Keywords: news
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
7
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
8 ;; This file is part of GNU Emacs.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
9
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
10 ;; GNU Emacs is free software: you can redistribute it and/or modify
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
11 ;; it under the terms of the GNU General Public License as published by
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
12 ;; the Free Software Foundation, either version 3 of the License, or
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
13 ;; (at your option) any later version.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
14
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
15 ;; GNU Emacs is distributed in the hope that it will be useful,
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
18 ;; GNU General Public License for more details.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
19
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
20 ;; You should have received a copy of the GNU General Public License
94662
f42ef85caf91 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 93975
diff changeset
21 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
22
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
23 ;;; Commentary:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
24
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
25 ;;; Code:
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
26
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
27 ;;;###
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
28 (defun uncompface (face)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
29 "Convert FACE to pbm.
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
30 Requires the external programs `uncompface', and `icontopbm'. On a
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
31 GNU/Linux system these might be in packages with names like `compface'
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
32 or `faces-xface' and `netpbm' or `libgr-progs', for instance."
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
33 (with-temp-buffer
93836
f4db18a43b84 (uncompface): Make buffer unibyte.
Katsumi Yamaoka <yamaoka@jpl.org>
parents: 79708
diff changeset
34 (unless (featurep 'xemacs) (set-buffer-multibyte nil))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
35 (insert face)
72425
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
36 (let ((coding-system-for-read 'raw-text)
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
37 ;; At least "icontopbm" doesn't work with Windows because
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
38 ;; the line-break code is converted into CRLF by default.
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
39 (coding-system-for-write 'binary))
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
40 (and (eq 0 (apply 'call-process-region (point-min) (point-max)
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
41 "uncompface"
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
42 'delete '(t nil) nil))
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
43 (progn
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
44 (goto-char (point-min))
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
45 (insert "/* Width=48, Height=48 */\n")
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
46 ;; I just can't get "icontopbm" to work correctly on its
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
47 ;; own in XEmacs. And Emacs doesn't understand un-raw pbm
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
48 ;; files.
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
49 (if (not (featurep 'xemacs))
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
50 (eq 0 (call-process-region (point-min) (point-max)
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
51 "icontopbm"
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
52 'delete '(t nil)))
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
53 (shell-command-on-region (point-min) (point-max)
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
54 "icontopbm | pnmnoraw"
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
55 (current-buffer) t)
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
56 t))
4fa1b5c6a34c Merge from gnus--rel--5.10
Miles Bader <miles@gnu.org>
parents: 68633
diff changeset
57 (buffer-string)))))
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
58
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
59 (provide 'compface)
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
60
93975
1e3a407766b9 Fix up comment convention on the arch-tag lines.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93836
diff changeset
61 ;; arch-tag: f9c78e84-98c0-4142-9682-8ba4cf4c3441
56927
55fd4f77387a Revision: miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523
Miles Bader <miles@gnu.org>
parents:
diff changeset
62 ;;; compface.el ends here