view lisp/gnus/compface.el @ 97043:9592c50233ab remove-carbon

Remove support for Mac Carbon. * mactoolbox.c: * macterm.h: * macterm.c: * macselect.c: * macmenu.c: * macgui.h: * macfns.c: * mac.c: Remove file. * s/darwin.h: * m/intel386.h: * xfaces.c: * xdisp.c: * window.c: * tparam.c: * termhooks.h: * termcap.c: * term.c: * syssignal.h: * sysselect.h: * sysdep.c: * process.c: * lread.c: * lisp.h: * keyboard.c: * image.c: * fringe.c: * frame.h: * frame.c: * fontset.c: * font.h: * font.c: * fns.c: * fileio.c: * emacs.c: * dispnew.c: * dispextern.h: * config.in: * atimer.c: * Makefile.in: Remove code for Carbon * erc.el: Remove code for Carbon. Remove support for Mac Carbon. * term/mac-win.el: Remove file * international/mule-cmds.el: * version.el: * startup.el: * simple.el: * mwheel.el: * mouse.el: * loadup.el: * isearch.el: * info.el: * frame.el: * faces.el: * disp-table.el: * cus-start.el: * cus-face.el: * cus-edit.el: * Makefile.in: Remove code for Carbon. Remove support for Mac Carbon. * makefile.w32-in: * emacsclient.c: Remove code for Carbon. * PROBLEMS: * MACHINES: Remove mentions of Mac Carbon. * ns-emacs.texi: * faq.texi: Remove mentions of Mac Carbon. * os.texi: * frames.texi: * display.texi: Remove mentions of Mac Carbon. * xresources.texi: Remove mentions of Mac Carbon. * make-tarball.txt: * admin.el: * FOR-RELEASE: * CPP-DEFINES: Remove mentions of Mac Carbon. Remove support for Mac Carbon. * mac: Remove directory. * make-dist: * configure.in: * README: * Makefile.in: * INSTALL: Remove code for Carbon. * configure: Regenerate.
author Dan Nicolaescu <dann@ics.uci.edu>
date Sun, 27 Jul 2008 18:24:48 +0000
parents f42ef85caf91
children a9dc0e7c3f2b
line wrap: on
line source

;;; compface.el --- functions for converting X-Face headers

;; Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.

;; Author: Lars Magne Ingebrigtsen <larsi@gnus.org>
;; Keywords: news

;; This file is part of GNU Emacs.

;; GNU Emacs is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.

;; GNU Emacs is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;; GNU General Public License for more details.

;; You should have received a copy of the GNU General Public License
;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;;; Code:

;;;###
(defun uncompface (face)
  "Convert FACE to pbm.
Requires the external programs `uncompface', and `icontopbm'.  On a
GNU/Linux system these might be in packages with names like `compface'
or `faces-xface' and `netpbm' or `libgr-progs', for instance."
  (with-temp-buffer
    (unless (featurep 'xemacs) (set-buffer-multibyte nil))
    (insert face)
    (let ((coding-system-for-read 'raw-text)
	  ;; At least "icontopbm" doesn't work with Windows because
	  ;; the line-break code is converted into CRLF by default.
	  (coding-system-for-write 'binary))
      (and (eq 0 (apply 'call-process-region (point-min) (point-max)
			"uncompface"
			'delete '(t nil) nil))
	   (progn
	     (goto-char (point-min))
	     (insert "/* Width=48, Height=48 */\n")
	     ;; I just can't get "icontopbm" to work correctly on its
	     ;; own in XEmacs.  And Emacs doesn't understand un-raw pbm
	     ;; files.
	     (if (not (featurep 'xemacs))
		 (eq 0 (call-process-region (point-min) (point-max)
					    "icontopbm"
					    'delete '(t nil)))
	       (shell-command-on-region (point-min) (point-max)
					"icontopbm | pnmnoraw"
					(current-buffer) t)
	       t))
	   (buffer-string)))))

(provide 'compface)

;; arch-tag: f9c78e84-98c0-4142-9682-8ba4cf4c3441
;;; compface.el ends here