aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/image/compface.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen2016-02-24 13:04:03 +1100
committerLars Ingebrigtsen2016-02-24 13:04:03 +1100
commit21fe2ebec8b63d5fd0a570ed0c907802ab83f991 (patch)
treef7fe7b6b4b2a21667cb66a1fdf7d470c7ec292a0 /lisp/image/compface.el
parente1d749bd7e0d68ab063eae3927caede6039a33cf (diff)
downloademacs-21fe2ebec8b63d5fd0a570ed0c907802ab83f991.tar.gz
emacs-21fe2ebec8b63d5fd0a570ed0c907802ab83f991.zip
Move low-level library files from the lisp/gnus directory
The files moved from lisp/gnus are: auth-source.el -> / compface.el -> /image ecomplete.el -> / flow-fill.el -> /mail gravatar.el -> /image gssapi.el -> /net html2text.el -> /net ietf-drums.el -> /mail mail-parse.el -> /mail mail-prsvr.el -> /mail mailcap.el -> /net plstore.el -> / pop3.el -> /net qp.el -> /mail registry.el -> / rfc1843.el -> /international rfc2045.el -> /mail rfc2047.el -> /mail rfc2231.el -> /mail rtree.el -> / sieve-manage.el -> /net sieve-mode.el -> /net sieve.el -> /net starttls.el -> /net utf7.el -> /international yenc.el -> /mail
Diffstat (limited to 'lisp/image/compface.el')
-rw-r--r--lisp/image/compface.el55
1 files changed, 55 insertions, 0 deletions
diff --git a/lisp/image/compface.el b/lisp/image/compface.el
new file mode 100644
index 00000000000..e2f607b1be3
--- /dev/null
+++ b/lisp/image/compface.el
@@ -0,0 +1,55 @@
1;;; compface.el --- functions for converting X-Face headers
2
3;; Copyright (C) 2002-2016 Free Software Foundation, Inc.
4
5;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
6;; Keywords: news
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software: you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation, either version 3 of the License, or
13;; (at your option) any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
22
23;;; Commentary:
24
25;;; Code:
26
27;;;###
28(defun uncompface (face)
29 "Convert FACE to pbm.
30Requires the external programs `uncompface', and `icontopbm'. On a
31GNU/Linux system these might be in packages with names like `compface'
32or `faces-xface' and `netpbm' or `libgr-progs', for instance."
33 (with-temp-buffer
34 (set-buffer-multibyte nil)
35 (insert face)
36 (let ((coding-system-for-read 'raw-text)
37 ;; At least "icontopbm" doesn't work with Windows because
38 ;; the line-break code is converted into CRLF by default.
39 (coding-system-for-write 'binary))
40 (and (eq 0 (apply 'call-process-region (point-min) (point-max)
41 "uncompface"
42 'delete '(t nil) nil))
43 (progn
44 (goto-char (point-min))
45 (insert "/* Format_version=1, Width=48, Height=48, Depth=1,\
46 Valid_bits_per_item=16 */\n")
47 ;; Emacs doesn't understand un-raw pbm files.
48 (eq 0 (call-process-region (point-min) (point-max)
49 "icontopbm"
50 'delete '(t nil))))
51 (buffer-string)))))
52
53(provide 'compface)
54
55;;; compface.el ends here