Gnus development mailing list
 help / color / mirror / Atom feed
From: Wes Hardaker <hardaker@ece.ucdavis.edu>
Cc: wmperry@spry.com, ding@ifi.uio.no
Subject: Re: What will they think of next: [fwd]
Date: 13 Jun 1996 11:21:43 -0700	[thread overview]
Message-ID: <sdhgsfsgy0.fsf@lena.ece.ucdavis.edu> (raw)
In-Reply-To: Kevin Cheek's message of 11 Jun 1996 19:25:44 -0400

Kevin Cheek <kcheek@cerebus.im.med.umich.edu> 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
> <http/mmg2.im.med.umich.edu/~kcheek/smileys/>.

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! \   \_____/


  parent reply	other threads:[~1996-06-13 18:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-06-11 20:33 Eric Hendrickson
1996-06-11 20:49 ` William Perry
1996-06-11 21:58   ` Colin Rafferty
1996-06-12  2:37     ` Lars Magne Ingebrigtsen
1996-06-11 23:25   ` Kevin Cheek
1996-06-12  2:39     ` Lars Magne Ingebrigtsen
1996-06-13 18:21     ` Wes Hardaker [this message]
1996-06-13 20:41       ` Wes Hardaker
1996-06-13 18:23     ` Wes Hardaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sdhgsfsgy0.fsf@lena.ece.ucdavis.edu \
    --to=hardaker@ece.ucdavis.edu \
    --cc=ding@ifi.uio.no \
    --cc=wmperry@spry.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).