X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fbb9d,eb5587e3737d9bbb,start X-Google-Attributes: gidfbb9d,public X-Google-ArrivalTime: 1994-09-09 05:19:59 PST Path: nntp.gmd.de!Germany.EU.net!EU.net!uunet!news.sprintlink.net!sashimi.wwa.com!not-for-mail From: boba@wwa.com (Bob Allison) Newsgroups: rec.arts.ascii Subject: Info: Code to use Figlet within Emacs Date: 9 Sep 1994 07:19:59 -0500 Organization: WorldWide Access - Chicago Area Internet Services 312-282-8605 Lines: 99 Approved: boba@wwa.com Message-ID: <34pjtf$k4n@gagme.wwa.com> NNTP-Posting-Host: gagme.wwa.com X-FTP: You can ftp ASCII art from: ftp.wwa.com in pub/Scarecrow X-FAQ: You can get the ASCII ART FAQ by fingering: asciifaq@wwa.com X-WWW: Scarecrow WWW Link & The Spider's Web: http://gagme.wwa.com/~boba From Mark Warren 415-506-4639 off the Figlet list: ; This is a little ditty I put together to use figlet inside of emacs. ; I'm using version 2.0 and the -F and -p options (have these changed in ; 2.1?). ; ; Brief usage instructions: Save this message in the file figlet.el ; somewhere (preferrably somewhere on your emacs' load-path), then use ; "M-x load-file /somewhere/figlet.el" to load the elisp. Once that's ; done, mark a region then use the command "M-x figify-region" to figify ; that region. ; ; Cheers, ; ; Mark ; ; P.S. Maybe it'll windup in the util directory someday. :-) ;___________________________________________________________________________ ;Luck is when preparation meets opportunity Fax: 415-506-1113 ;-------------------->8 Cut Here 8<-------------------- ;;; filename: figlet.el ;;; author: Mark Warren ;;; creation: 08-Sep-94 ;;; version: 0.1 ;;; Copyright (C) 1994, Mark Warren ;;; ;;; figlet.el 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 2, or (at your option) ;;; any later version. ;;; ;;; This program 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. ;;; ;;; A copy of the GNU General Public License can be obtained from ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA ;;; 02139, USA. ;; Commentary: ;; Run the figlet program on a region of text within emacs. This ;; requires that you have the figlet package. Check archie for ;; other sites, then check ftp.isu.edu. (defvar figlet-default-font "bulbhead" "Initial default font for the figify-region function") (defvar figlet-options "-p" "Arguments to pass to figlet in addition to the -f argument.") (defun figlet-alist-fonts () "Return figlet-font-alist if it is set, otherwise invoke figlet -F to construct figlet-font-alist" (if (boundp 'figlet-font-alist) figlet-font-alist (let ((b (get-buffer-create "*figlet-temp*")) figlet-font-list) (call-process "figlet" nil b nil "-F") ;; do some editting so that the names look like a lisp list (save-excursion (set-buffer b) (goto-char (point-min)) (kill-line 3) (insert "\(\n") (end-of-line) (while (not (eobp)) (insert "\"") (beginning-of-line) (insert "\"") (forward-line 1) (end-of-line)) (goto-char (point-max)) (insert "\)") (goto-char (point-min)) ;; ok, done editting, actually read the names into a list (setq figlet-font-list (read b))) (kill-buffer b) (setq figlet-font-alist (mapcar (lambda (e) (list e e)) figlet-font-list)) figlet-font-alist))) (defun figify-region (font) (interactive (list (completing-read "Font: " (figlet-alist-fonts) nil 't figlet-default-font))) (call-process-region (point) (mark) "figlet" 't 't nil "-f" font figlet-options) (setq figlet-default-font font))