From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/6665 Path: main.gmane.org!not-for-mail From: Wes Hardaker Newsgroups: gmane.emacs.gnus.general Subject: Re: What will they think of next: [fwd] Date: 13 Jun 1996 11:21:43 -0700 Message-ID: References: <9606112033.AA02247@shadow> <199606112049.NAA12362@monolith.spry.com> <55afy9exdz.fsf@cerebus.im.med.umich.edu> NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035147088 4373 80.91.224.250 (20 Oct 2002 20:51:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 20:51:28 +0000 (UTC) Cc: wmperry@spry.com, ding@ifi.uio.no Return-Path: ding-request@ifi.uio.no Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by deanna.miranova.com (8.7.5/8.6.9) with SMTP id LAA00182 for ; Thu, 13 Jun 1996 11:48:38 -0700 Original-Received: from lena.ece.ucdavis.edu (hardaker@lena.cipic.ucdavis.edu [128.120.67.29]) by ifi.uio.no with ESMTP (8.6.11/ifi2.4) id for ; Thu, 13 Jun 1996 20:21:51 +0200 Original-Received: by lena.ece.ucdavis.edu (1.37.109.16/Ultrix3.0-C/eecs 1.1) id AA164940106; Thu, 13 Jun 1996 11:21:46 -0700 Original-To: Kevin Cheek In-Reply-To: Kevin Cheek's message of 11 Jun 1996 19:25:44 -0400 Original-Lines: 83 X-Mailer: Gnus v5.2.4/XEmacs 19.13 Xref: main.gmane.org gmane.emacs.gnus.general:6665 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:6665 Kevin Cheek writes: > > we simply _HAVE_ to implement this. Anyone know of a good smiley icon > > repository? > > In case anyone actually wants some smiley icons, I got 15 small tiffs > from the next-icon mail list. They're available via HTTP at > . Well, so like I had my wisdom teeth pulled on Monday... That didn't leave much motivation for me to do anything productive today. Therefore, I submit the very beginnings of the above mentioned project (something, I've been wanting to see for a long time too). You'll need ftp://ftp.ece.ucdavis.edu/pub/hardaker/smilies.tar.gz, as well as the following lisp code. Note that the default regular expressions I threw together in roughly 5 minutes and haven't even included all the faces in the face database (from Kevin) yet. I'll leave it to someone else (ie, a reg-exp and smiley expert) to clean this up. The good news is that it works (XEmacs required of course). :-) :-\ :-] :-> :-/ :-| :-< :-( Install the above lisp and smiley faces and re-read this message! The faces should be colored in yellow, and the background should be set to transparent (outside the circle), but again, I defer... ;; ;; comments go here. ;; ;; (add-hook 'gnus-article-display-hook 'gnus-smiley-display t) (defvar gnus-smiley-db-dir "/home/hardaker/tmp/smilies/smilies") (defvar gnus-smiley-regexp-alist '((":-*\\]" "FaceGrinning.xpm") (":-*)" "FaceHappy.xpm") (";-*[>)]" "FaceWinking.xpm") (":-*[/\\]" "FaceIronic.xpm") (":-*|" "FaceGoofy.xpm") (":-*<" "FaceAngry.xpm") (":-*(" "FaceAngry.xpm"))) (defun gnus-smiley-display () (interactive) (if (and (featurep 'xpm) (or (not (fboundp 'device-type)) (equal (device-type) 'x))) (save-excursion (set-buffer gnus-article-buffer) ;; search and replace (let ((buffer-read-only nil) (alist gnus-smiley-regexp-alist) bug entry regexp) (goto-char (point-min)) ;; We skip the headers. (unless (search-forward "\n\n" nil t) (goto-char (point-max))) (setq beg (point)) ;; loop through alist (while (setq entry (pop alist)) (setq regexp (car entry)) (goto-char beg) (while (re-search-forward regexp nil t) (let ((start (match-beginning 0)) (end (match-end 0)) (gl (make-glyph (concat (file-name-as-directory gnus-smiley-db-dir) (nth 1 entry))))) (if gl (progn (set-glyph-face gl 'default) (delete-region start end) (make-annotation gl start 'text)) (message "face doesn't exist"))))))))) -- _____ Wes Hardaker / ___ \ Department of Electrical and Computer Engineering / / \//\ University of California at Davis __________________ \--/ /--\ Davis CA 95616 / Recycle! \ \//\___/ / (hardaker@ece.ucdavis.edu) / It's not too late! \ \_____/