Gnus development mailing list
 help / color / mirror / Atom feed
* gnus-smiley.el -- new version
@ 1996-06-14 17:23 Wes Hardaker
  1996-06-14 18:42 ` smiley.el (was Re: gnus-smiley.el -- new version) William Perry
  0 siblings, 1 reply; 25+ messages in thread
From: Wes Hardaker @ 1996-06-14 17:23 UTC (permalink / raw)



Did things slightly more correctly this time:

  -- cached last glyph for faster loading (of frequent smilies :-)
  -- Used "invisible extents" rather than deleting the original region
  -- more reg-exp -> smily matching

Additionally, I made the smily faces yellow with a trasparent edge, so
they look like they really should now!  Get a new copy at
ftp.ece.ucdavis.edu:/pub/hardaker/smilies.tar.gz

:-)

Wes Hardaker
Professional Time Waster

;;
;; comments go here.
;;

;; To use:
;; (load "gnus-smiley.el")
;; (add-hook 'gnus-article-display-hook 'gnus-smiley-display t)

(defvar gnus-smiley-db-dir "/home/hardaker/lib/smilies"
  "Location of the smiley xpm faces files.")

(defvar gnus-smiley-regexp-alist '((":-*\\]" "FaceGrinning.xpm")
				 (":-*[oO]" "FaceStartled.xpm")
				 (":-*[)>]" "FaceHappy.xpm")
				 (";-*[>)]" "FaceWinking.xpm")
				 (":-[/\\]" "FaceIronic.xpm")
				 (":-*|" "FaceStraight.xpm")
				 (":-*<" "FaceAngry.xpm")
				 (":-*d" "FaceTasty.xpm")
				 (":-*[pP]" "FaceYukky.xpm")
				 ("8-*|" "FaceKOed.xpm")
				 (":-*(" "FaceAngry.xpm"))
"A list of regexps to map smilies to real images.")

(defvar gnus-smiley-glyph nil)

(defvar gnus-smiley-last-file nil)

(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))
		    (file (concat (file-name-as-directory gnus-smiley-db-dir) 
				 (nth 1 entry))))
		(if (not (equal file gnus-smiley-last-file))
		    (setq gnus-smiley-glyph (make-glyph file)))
		(if gnus-smiley-glyph
		    (progn 
		      (set-glyph-face gnus-smiley-glyph 'default)
		      (let ((ext (make-extent start end)))
			(set-extent-property ext 'invisible t)
			(set-extent-property ext 'end-open t))
		      (make-annotation gnus-smiley-glyph end 'text)
		      (goto-char end))
		  ))))))))


^ permalink raw reply	[flat|nested] 25+ messages in thread

* smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 17:23 gnus-smiley.el -- new version Wes Hardaker
@ 1996-06-14 18:42 ` William Perry
  1996-06-14 21:11   ` Colin Rafferty
                     ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: William Perry @ 1996-06-14 18:42 UTC (permalink / raw)
  Cc: ding

Here is a slightly modified version that uses a tty-specifier in the glyph
so that you do not have to check if you are in X or not.  Also, its been
generalized a bit, so that you can (smiley-buffer your-fav-buffer start end)
gnus-smiley-buffer becomes a trivial wrapper.  This way it can be used in
VM or Emacs-W3, etc.

The finding of the pixmap directory needs to be automatic though.

-Bill P.

;;
;; comments go here.
;;

;; To use:
;; (require 'smiley)
;; (add-hook 'gnus-article-display-hook 'gnus-smiley-display t)

(defvar smiley-data-directory "/tmp/smilies/"
  "Location of the smiley faces files.")

(defvar smiley-regexp-alist '((":-*\\]" "FaceGrinning.xpm")
			      (":-*[oO]" "FaceStartled.xpm")
			      (":-*[)>]" "FaceHappy.xpm")
			      (";-*[>)]" "FaceWinking.xpm")
			      (":-[/\\]" "FaceIronic.xpm")
			      (":-*|" "FaceStraight.xpm")
			      (":-*<" "FaceAngry.xpm")
			      (":-*d" "FaceTasty.xpm")
			      (":-*[pP]" "FaceYukky.xpm")
			      ("8-*|" "FaceKOed.xpm")
			      (":-*(" "FaceAngry.xpm"))
  "A list of regexps to map smilies to real images.")

(defvar smiley-glyph-cache nil)
(defvar smiley-running-xemacs (string-match "XEmacs" emacs-version))

(defun smiley-create-glyph (smiley pixmap)
  (and
   smiley-running-xemacs
   (or
    (cdr-safe (assoc pixmap smiley-glyph-cache))
    (let ((glyph (make-glyph
		  (list
		   (cons 'x (expand-file-name pixmap smiley-data-directory))
		   (cons 'tty smiley)))))
      (setq smiley-glyph-cache (cons (cons pixmap glyph) smiley-glyph-cache))
      (set-glyph-face glyph 'default)
      glyph))))

(defun smiley-buffer (&optional buffer st nd)
  (save-excursion
    (and buffer (set-buffer buffer))
    (let ((buffer-read-only nil)
	  (alist smiley-regexp-alist)
	  bug entry regexp)
      (goto-char (or st (point-min)))
      (setq beg (point))
      ;; loop through alist
      (while (setq entry (pop alist))
	(setq regexp (car entry))
	(goto-char beg)
	(while (re-search-forward regexp nd t)
	  (let* ((start (match-beginning 0))
		 (end (match-end 0))
		 (file (nth 1 entry))
		 (glyph (smiley-create-glyph (buffer-substring start end)
					     file)))
	    (if glyph
		(progn 
		  (let ((ext (make-extent start end)))
		    (set-extent-property ext 'invisible t)
		    (set-extent-property ext 'end-open t))
		  (make-annotation glyph end 'text)
		  (goto-char end)))))))))
    
(defun gnus-smiley-display ()
  (interactive)
  (save-excursion
    (set-buffer gnus-article-buffer)
    (goto-char (point-min))
    ;; We skip the headers.
    (unless (search-forward "\n\n" nil t)
      (goto-char (point-max)))
    (smiley-buffer (current-buffer) (point))))

(provide 'smiley)


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 18:42 ` smiley.el (was Re: gnus-smiley.el -- new version) William Perry
@ 1996-06-14 21:11   ` Colin Rafferty
  1996-06-14 21:55     ` William Perry
  1996-06-14 21:57   ` Wes Hardaker
  1996-06-14 22:07   ` Steven L Baur
  2 siblings, 1 reply; 25+ messages in thread
From: Colin Rafferty @ 1996-06-14 21:11 UTC (permalink / raw)


William Perry writes:

> Here is a slightly modified version...

I have my own minor modification.  I think that the logic here is great,
but I would love to just get rid of them altogether.  You can change the
variable name if you like.

(defvar smiley-is-the-spawn-of-satan 'nil
  "If non-nil, `smiley-buffer' just dump all smileys.")

> (defun smiley-buffer (&optional buffer st nd)
> ...
> 	  (let* ((start (match-beginning 0))
> 		 (end (match-end 0))
> 		 (file (nth 1 entry))
> 		 (glyph (smiley-create-glyph (buffer-substring start end)
> 					     file)))
> ...

	  (let* ((start (match-beginning 0))
		 (end (match-end 0))
		 (file (nth 1 entry))
		 (glyph (if smiley-is-the-spawn-of-satan ""
			   (smiley-create-glyph (buffer-substring start end)
					        file))))

-- 
Colin


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 21:11   ` Colin Rafferty
@ 1996-06-14 21:55     ` William Perry
  0 siblings, 0 replies; 25+ messages in thread
From: William Perry @ 1996-06-14 21:55 UTC (permalink / raw)
  Cc: GNUS Mailing List

Colin Rafferty writes:
>William Perry writes:
>
>> Here is a slightly modified version...
>
>I have my own minor modification.  I think that the logic here is great,
>but I would love to just get rid of them altogether.  You can change the
>variable name if you like.
>
>(defvar smiley-is-the-spawn-of-satan 'nil
>  "If non-nil, `smiley-buffer' just dump all smileys.")

  Do you want to actually remove them from the buffer?  You'll need more
patching for that.

-bp


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 18:42 ` smiley.el (was Re: gnus-smiley.el -- new version) William Perry
  1996-06-14 21:11   ` Colin Rafferty
@ 1996-06-14 21:57   ` Wes Hardaker
  1996-06-14 22:52     ` William Perry
  1996-06-14 22:07   ` Steven L Baur
  2 siblings, 1 reply; 25+ messages in thread
From: Wes Hardaker @ 1996-06-14 21:57 UTC (permalink / raw)
  Cc: ding


William Perry <wmperry@monolith.spry.com> writes:

|> Here is a slightly modified version that uses a tty-specifier in the glyph
|> so that you do not have to check if you are in X or not.  

But why bother going through the trouble of creating a glyph
containing text?  It would use less time on a tty display if you
simply exited earlier than that...  Of course, you could always change
the face of the smilies if you like instead on a text display...

|> Also, its been generalized a bit, so that you can (smiley-buffer
|> your-fav-buffer start end) gnus-smiley-buffer becomes a trivial
|> wrapper.  This way it can be used in VM or Emacs-W3, etc.

You know, I thought about doing this then forgot about doing it...  Thanks!

|> The finding of the pixmap directory needs to be automatic though.

I figured when it finally rolled into red-gnus, it would come with the
etc.tar.gz package or something...  Or at least found in a similar
manner.

Again, thanks for the help,
I'm hardly a elisp expert!
Wes


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 18:42 ` smiley.el (was Re: gnus-smiley.el -- new version) William Perry
  1996-06-14 21:11   ` Colin Rafferty
  1996-06-14 21:57   ` Wes Hardaker
@ 1996-06-14 22:07   ` Steven L Baur
  1996-06-14 22:53     ` William Perry
  1996-06-15  7:59     ` Lars Magne Ingebrigtsen
  2 siblings, 2 replies; 25+ messages in thread
From: Steven L Baur @ 1996-06-14 22:07 UTC (permalink / raw)
  Cc: hardaker, ding

>>>>> "William" == William Perry <wmperry@monolith.spry.com> writes:

William> ;;
William> ;; comments go here.
William> ;;

We must have this function in Gnus 5.2.  :-) I'm not sure I care for
the yellow though, I'd prefer a slightly darker color going up against
my gray background.  Can you adjust the color a la the Gnus logo
palette?  Also, shouldn't smiley-buffer be interactive so that you can
preview in the message-mode buffer?  ;-)

:-)
-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be proofread for $250/hour.
Andrea Seastrand: For your vote on the Telecom bill, I will vote for anyone
except you in November.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 21:57   ` Wes Hardaker
@ 1996-06-14 22:52     ` William Perry
  0 siblings, 0 replies; 25+ messages in thread
From: William Perry @ 1996-06-14 22:52 UTC (permalink / raw)
  Cc: wmperry, ding

Wes Hardaker writes:
>
>William Perry <wmperry@monolith.spry.com> writes:
>
>|> Here is a slightly modified version that uses a tty-specifier in the glyph
>|> so that you do not have to check if you are in X or not.  
>
>But why bother going through the trouble of creating a glyph
>containing text?  It would use less time on a tty display if you
>simply exited earlier than that...  Of course, you could always change
>the face of the smilies if you like instead on a text display...

  I routinely run XEmacs simultaneously on both a TTY and an X display, and
they share buffers, etc.  Since the smiley-buffer makes the smileys
invisible, you lose the information when showing it on a TTY.

>|> The finding of the pixmap directory needs to be automatic though.
>
>I figured when it finally rolled into red-gnus, it would come with the
>etc.tar.gz package or something...  Or at least found in a similar manner.

  Ah, the joys of auxiliary files. :)

-Bill P.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 22:07   ` Steven L Baur
@ 1996-06-14 22:53     ` William Perry
  1996-06-14 23:14       ` Steven L Baur
  1996-06-15  7:59     ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 25+ messages in thread
From: William Perry @ 1996-06-14 22:53 UTC (permalink / raw)
  Cc: wmperry, hardaker, ding

Steven L. Baur writes:
>>>>>> "William" == William Perry <wmperry@monolith.spry.com> writes:
>
>William> ;;
>William> ;; comments go here.
>William> ;;
>
>We must have this function in Gnus 5.2.  :-) I'm not sure I care for
>the yellow though, I'd prefer a slightly darker color going up against
>my gray background.  Can you adjust the color a la the Gnus logo
>palette?  Also, shouldn't smiley-buffer be interactive so that you can
>preview in the message-mode buffer?  ;-)
>
>:-)

  Definitely!  Also, there should be an after-change-function that will
smilify a buffer as you type, ala MS Word.

-Bill P.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 22:53     ` William Perry
@ 1996-06-14 23:14       ` Steven L Baur
  1996-06-15  1:22         ` Wes Hardaker
  0 siblings, 1 reply; 25+ messages in thread
From: Steven L Baur @ 1996-06-14 23:14 UTC (permalink / raw)
  Cc: hardaker, ding

>>>>> "William" == William Perry <wmperry@monolith.spry.com> writes:

> Steven L. Baur writes:
William> ;; comments go here.
>> We must have this function in Gnus 5.2.
 ...
William>   Definitely!  Also, there should be an after-change-function
William> that will smilify a buffer as you type, ala MS Word.

Smilifying a buffer twice should not produce doubled copies of the
images.

There should also be an unsmilify-buffer since the smiley regular
expressions seem prone to match XEmacs lisp backtraces and uuencoded
files.

-- 
steve@miranova.com baur
Unsolicited commercial e-mail will be proofread for $250/hour.
Andrea Seastrand: For your vote on the Telecom bill, I will vote for anyone
except you in November.


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 23:14       ` Steven L Baur
@ 1996-06-15  1:22         ` Wes Hardaker
  1996-06-15  7:54           ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 25+ messages in thread
From: Wes Hardaker @ 1996-06-15  1:22 UTC (permalink / raw)
  Cc: wmperry, ding


Steven L Baur <steve@miranova.com> writes:

|> Smilifying a buffer twice should not produce doubled copies of the
|> images.

Definately true...

|> There should also be an unsmilify-buffer since the smiley regular
|> expressions seem prone to match XEmacs lisp backtraces and uuencoded
|> files.

Yes, I actually wrote a note to Lars giving a list of things that
should be done to it.  This was one of them.

I also said it should be able to do something like:

  "[^p]\\(:/\\)" and pick the \1 out of there, or use the entire
  expression results if \1 DNE (ie, no sub-regions specified).  This
  way you could more carefully watch out for things like http://,
  which (used to) gets caught.  I also thought about requiring a white
  space char before the smiley.  This would fix the problem as well,
  and I doubt anyone is writing them without a space in the first place.

What I'm really suprised at is that no one has mucked with the reg-exp
list to include more smilies!

Wes


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-15  1:22         ` Wes Hardaker
@ 1996-06-15  7:54           ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-06-15  7:54 UTC (permalink / raw)


Wes Hardaker <hardaker@ece.ucdavis.edu> writes:

>   "[^p]\\(:/\\)" and pick the \1 out of there, or use the entire
>   expression results if \1 DNE (ie, no sub-regions specified).  This
>   way you could more carefully watch out for things like http://,
>   which (used to) gets caught.  I also thought about requiring a white
>   space char before the smiley.  This would fix the problem as well,
>   and I doubt anyone is writing them without a space in the first place.

I've fiddled with it slightly and have added a new second element to
the alist elements -- the regexp grouping number.  (I haven't changed
the regexps themselves, so all use grouping 0.)

But you could say things like:

("[^/]\\(:-*[/\\]\\)" 1"FaceIronic.xpm")

to avoid matching "/:/" and stuff like that.  Embellish as needed.

(Oh, and and I've added a `delete-annotation' to delete any old
smileys.)

;;
;; comments go here.
;;

;;; Test smileys:  :-] :-o :-) ;-) :-< :-d :-P 8-| :-(

;; To use:
;; (require 'smiley)
;; (add-hook 'gnus-article-display-hook 'gnus-smiley-display t)

(require 'cl)

(defvar smiley-data-directory "~/sgnus/etc/smilies/"
  "Location of the smiley faces files.")

(defvar smiley-regexp-alist '((":-*\\]" 0 "FaceGrinning.xpm")
			      (":-*[oO]" 0 "FaceStartled.xpm")
			      (":-*[)>]" 0 "FaceHappy.xpm")
			      (";-*[>)]" 0 "FaceWinking.xpm")
			      (":-[/\\]" 0 "FaceIronic.xpm")
			      (":-*|" 0 "FaceStraight.xpm")
			      (":-*<" 0 "FaceAngry.xpm")
			      (":-*d" 0 "FaceTasty.xpm")
			      (":-*[pP]" 0 "FaceYukky.xpm")
			      ("8-*|" 0 "FaceKOed.xpm")
			      (":-*(" 0 "FaceAngry.xpm"))
  "A list of regexps to map smilies to real images.")

(defvar smiley-glyph-cache nil)
(defvar smiley-running-xemacs (string-match "XEmacs" emacs-version))

(defun smiley-create-glyph (smiley pixmap)
  (and
   smiley-running-xemacs
   (or
    (cdr-safe (assoc pixmap smiley-glyph-cache))
    (let ((glyph (make-glyph
		  (list
		   (cons 'x (expand-file-name pixmap smiley-data-directory))
		   (cons 'tty smiley)))))
      (setq smiley-glyph-cache (cons (cons pixmap glyph) smiley-glyph-cache))
      (set-glyph-face glyph 'default)
      glyph))))

(defun smiley-region (beg end)
  "Smilify the region between point and mark."
  (interactive "r")
  (smiley-buffer (current-buffer) beg end))

(defun smiley-buffer (&optional buffer st nd)
  (interactive)
  (save-excursion
    (and buffer (set-buffer buffer))
    (let ((buffer-read-only nil)
	  (alist smiley-regexp-alist)
	  bug entry regexp)
      (goto-char (or st (point-min)))
      (setq beg (point))
      ;; loop through alist
      (while (setq entry (pop alist))
	(setq regexp (car entry)
	      group (cadr entry)
	      file (caddr entry))
	(goto-char beg)
	(while (re-search-forward regexp nd t)
	  (let* ((start (match-beginning group))
		 (end (match-end group))
		 (glyph (smiley-create-glyph (buffer-substring start end)
					     file)))
	    (if glyph
		(progn 
		  (mapcar 'delete-annotation (annotations-at end))
		  (let ((ext (make-extent start end)))
		    (set-extent-property ext 'invisible t)
		    (set-extent-property ext 'end-open t)
		    (set-extent-property ext 'intangible t))
		  (make-annotation glyph end 'text)
		  (goto-char end)))))))))
    
(defun gnus-smiley-display ()
  (interactive)
  (save-excursion
    (set-buffer gnus-article-buffer)
    (goto-char (point-min))
    ;; We skip the headers.
    (unless (search-forward "\n\n" nil t)
      (goto-char (point-max)))
    (smiley-buffer (current-buffer) (point))))

(provide 'smiley)




^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-14 22:07   ` Steven L Baur
  1996-06-14 22:53     ` William Perry
@ 1996-06-15  7:59     ` Lars Magne Ingebrigtsen
  1996-06-15  8:53       ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-06-15  7:59 UTC (permalink / raw)


Steven L Baur <steve@miranova.com> writes:

> We must have this function in Gnus 5.2.  :-) I'm not sure I care for
> the yellow though, I'd prefer a slightly darker color going up against
> my gray background.  Can you adjust the color a la the Gnus logo
> palette?

Yes, that would be nice.  This is kinda what I did with the Gnus logo:
        
       (let 
	((xpm-color-symbols 
	 (and (featurep 'xpm)
	      (append `(("features" feature-color)
			("flesh" flesh-color)
		      xpm-color-symbols)))))
        (make-glyph ...))

This requires that the Smilies xpm files be edited to something like:

" 	c none",
".	c #FFFF00 s flesh",
"X	c #000000000000 s features",

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-15  7:59     ` Lars Magne Ingebrigtsen
@ 1996-06-15  8:53       ` Lars Magne Ingebrigtsen
  1996-06-17 13:49         ` Jan Vroonhof
                           ` (2 more replies)
  0 siblings, 3 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-06-15  8:53 UTC (permalink / raw)


Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Yes, that would be nice.  This is kinda what I did with the Gnus logo:
>         
>        (let 
> 	((xpm-color-symbols 
> 	 (and (featurep 'xpm)
> 	      (append `(("features" feature-color)
> 			("flesh" flesh-color)
> 		      xpm-color-symbols)))))
>         (make-glyph ...))
> 
> This requires that the Smilies xpm files be edited to something like:
> 
> " 	c none",
> ".	c #FFFF00 s flesh",
> "X	c #000000000000 s features",

You don't say.

Uhm, I've now done this.  (*Bad* Lars.  Doesn't give anybody else the
chance to do fun stuff.)  I've also included smiley.el in the Gnus
distribution, and the smilies in the etc package.

-- 
(domestic pets only, the antidote for overdose, milk.)
  larsi@ifi.uio.no * Lars Ingebrigtsen


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-15  8:53       ` Lars Magne Ingebrigtsen
@ 1996-06-17 13:49         ` Jan Vroonhof
  1996-06-17 16:16           ` Lars Magne Ingebrigtsen
  1996-06-17 16:27         ` Jan Vroonhof
  1996-06-17 17:43         ` Wes Hardaker
  2 siblings, 1 reply; 25+ messages in thread
From: Jan Vroonhof @ 1996-06-17 13:49 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Uhm, I've now done this.  (*Bad* Lars.  Doesn't give anybody else the
> chance to do fun stuff.)  I've also included smiley.el in the Gnus
> distribution, and the smilies in the etc package.

And it works great (although it needs documentation). However since I
enabled it I have noticed how many people use the ")" in a smiley as a
closing parenthesis (Like this :-). Is it possible to detect this
efficiently and put a closing ")" in after the smiley if possible?

Jan

-- 
Jan Vroonhof                    http://www.math.ethz.ch/~vroonhof/
Mathematik,                                  vroonhof@math.ethz.ch
HG E16, ETH-Zentrum,                      Tel: +41-1-6325456/25154
Raemistrasse 101, CH-8092 Zuerich.              Fax: +41-1-6321085


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-17 13:49         ` Jan Vroonhof
@ 1996-06-17 16:16           ` Lars Magne Ingebrigtsen
  1996-06-18 16:32             ` Wes Hardaker
  0 siblings, 1 reply; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-06-17 16:16 UTC (permalink / raw)


Jan Vroonhof <vroonhof@math.ethz.ch> writes:

> And it works great (although it needs documentation). However since I
> enabled it I have noticed how many people use the ")" in a smiley as a
> closing parenthesis (Like this :-). Is it possible to detect this
> efficiently and put a closing ")" in after the smiley if possible?

Shouldn't be that much work.  Would it suffice to first go backward
and see whether there is a "(", and then go forward and see whether
there is an ")"?  If the former is true and the latter is not, then we
probably have a closing-paren smiley.

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-15  8:53       ` Lars Magne Ingebrigtsen
  1996-06-17 13:49         ` Jan Vroonhof
@ 1996-06-17 16:27         ` Jan Vroonhof
  1996-06-17 17:43         ` Wes Hardaker
  2 siblings, 0 replies; 25+ messages in thread
From: Jan Vroonhof @ 1996-06-17 16:27 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Uhm, I've now done this.  (*Bad* Lars.  Doesn't give anybody else the
> chance to do fun stuff.)  I've also included smiley.el in the Gnus
> distribution, and the smilies in the etc package.

smiley.el should have an (require 'annotations)

Jan

-- 
Jan Vroonhof                    http://www.math.ethz.ch/~vroonhof/
Mathematik,                                  vroonhof@math.ethz.ch
HG E16, ETH-Zentrum,                      Tel: +41-1-6325456/25154
Raemistrasse 101, CH-8092 Zuerich.              Fax: +41-1-6321085


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-15  8:53       ` Lars Magne Ingebrigtsen
  1996-06-17 13:49         ` Jan Vroonhof
  1996-06-17 16:27         ` Jan Vroonhof
@ 1996-06-17 17:43         ` Wes Hardaker
  2 siblings, 0 replies; 25+ messages in thread
From: Wes Hardaker @ 1996-06-17 17:43 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Uhm, I've now done this.  (*Bad* Lars.  Doesn't give anybody else the
> chance to do fun stuff.)  I've also included smiley.el in the Gnus
> distribution, and the smilies in the etc package.

*good* Lars.  You deserve a treat.  I consider anyone who makes
modifications in a way to greatly enhance the viewing pleasure of gnus
to be an excellent person.  If you actually believe thats how I
feel...  Why am I not using a mac?

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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-17 16:16           ` Lars Magne Ingebrigtsen
@ 1996-06-18 16:32             ` Wes Hardaker
  1996-06-18 16:54               ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 25+ messages in thread
From: Wes Hardaker @ 1996-06-18 16:32 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Shouldn't be that much work.  Would it suffice to first go backward
> and see whether there is a "(", and then go forward and see whether
> there is an ")"?  If the former is true and the latter is not, then we
> probably have a closing-paren smiley.

Isn't there an elisp function (he says, knowing that there is but just
too lazy to go read the elisp manual) that checks for a matching
paren?  You don't want to reinvent the wheel for things like:

(blah blah blah) :-)

It already exists, so...  Just use it.  (it may only exist in xemacs,
which does paren highlighting (something I can't live without now),
but thats ok since xemacs is the only place that will benifit from the
code).

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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-18 16:32             ` Wes Hardaker
@ 1996-06-18 16:54               ` Lars Magne Ingebrigtsen
  1996-06-18 17:49                 ` Wes Hardaker
  1996-06-18 19:23                 ` Sten Drescher
  0 siblings, 2 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-06-18 16:54 UTC (permalink / raw)


Wes Hardaker <hardaker@ece.ucdavis.edu> writes:

> Isn't there an elisp function (he says, knowing that there is but just
> too lazy to go read the elisp manual) that checks for a matching
> paren?  You don't want to reinvent the wheel for things like:
> 
> (blah blah blah) :-)
> 
> It already exists, so...  Just use it.

I don't think so.  (Not that I have tested or anything. :-) )
For instance, that smiley there will actually be the closing paren.
The paren after that (the "real" closing paren) won't be recognized as
such.  (Unless somebody has done work in this area already.  Although
I don't really think so.)

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-18 16:54               ` Lars Magne Ingebrigtsen
@ 1996-06-18 17:49                 ` Wes Hardaker
  1996-06-19  6:07                   ` Lars Magne Ingebrigtsen
  1996-06-18 19:23                 ` Sten Drescher
  1 sibling, 1 reply; 25+ messages in thread
From: Wes Hardaker @ 1996-06-18 17:49 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> I don't think so.  (Not that I have tested or anything. :-) )
> For instance, that smiley there will actually be the closing paren.
> The paren after that (the "real" closing paren) won't be recognized as
> such.  (Unless somebody has done work in this area already.  Although
> I don't really think so.)

I'm tellin ya.....

Do this:

Go into *scratch*
Turn on "Options/Paren Highlighting/Expression"
Type blah ( hello [ world ] ) :-)

You'll notice as you type the various end parens that the area between
the paren and its opening paren is highlighted!  (I really can't live
without this now).  Note that the paren on the smiley is not
highlighted at all. Also, try this:

( hello :-] ) 

Which will display the ] in an error color actually...

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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-18 16:54               ` Lars Magne Ingebrigtsen
  1996-06-18 17:49                 ` Wes Hardaker
@ 1996-06-18 19:23                 ` Sten Drescher
  1996-06-18 20:12                   ` Wes Hardaker
  1 sibling, 1 reply; 25+ messages in thread
From: Sten Drescher @ 1996-06-18 19:23 UTC (permalink / raw)


>>>>> Lars Magne Ingebrigtsen writes:

LMI> I don't think so.  (Not that I have tested or anything. :-) ) For
LMI> instance, that smiley there will actually be the closing paren.
LMI> The paren after that (the "real" closing paren) won't be
LMI> recognized as such.  (Unless somebody has done work in this area
LMI> already.  Although I don't really think so.)

	I haven't used a smiley-enhanced Gnus yet, but does it deal
with correct-handed smilies? (;  d-:

-- 
+----------------------  Tivoli Customer Support  ----------------------+
|   Sten Drescher                     Tivoli Systems, Inc               |
|   email: sten.drescher@tivoli.com   9442 Capital of Texas Hwy North   |
|   phone: (512) 794-9070             Arboretum Plaza One, Suite 500    |
|   fax  : (512) 345-2784             Austin, Texas 78759               |
+-----------------------------------------------------------------------+


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-18 19:23                 ` Sten Drescher
@ 1996-06-18 20:12                   ` Wes Hardaker
  1996-06-19  6:10                     ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 25+ messages in thread
From: Wes Hardaker @ 1996-06-18 20:12 UTC (permalink / raw)
  Cc: Gnus Development

Sten Drescher <sten.drescher@tivoli.com> writes:

> 	I haven't used a smiley-enhanced Gnus yet, but does it deal
> with correct-handed smilies? (;  d-:

Nope...  I was actually just about to mention this as well....  

We need an auto 'reverse-regular-expression' function (ha ha ha).

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


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-18 17:49                 ` Wes Hardaker
@ 1996-06-19  6:07                   ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-06-19  6:07 UTC (permalink / raw)


Wes Hardaker <hardaker@ece.ucdavis.edu> writes:

> Go into *scratch*
> Turn on "Options/Paren Highlighting/Expression"
> Type blah ( hello [ world ] ) :-)

But that case isn't interesting at all.

Type:

(hello :-) )

Which one of the closing parens match the open paren?  The smiley one
or the un-smiley one?  For us puny humans, the last closing paren is
the "right" one; for Emacs it's the smiley one.

Now, then:

This is text.  (hello :-)  This is more text.

Is this smiley a closing paren smiley?  Yes, it would seem so.
(Unless a further closing paren comes later.  So we need a function to
guess whether a ":-)" is a closing paren smiley or just a normal
smiley.  Viz. `smiley-closing-paren-p'.

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-18 20:12                   ` Wes Hardaker
@ 1996-06-19  6:10                     ` Lars Magne Ingebrigtsen
  1996-06-19 16:36                       ` Wes Hardaker
  0 siblings, 1 reply; 25+ messages in thread
From: Lars Magne Ingebrigtsen @ 1996-06-19  6:10 UTC (permalink / raw)


Wes Hardaker <hardaker@ece.ucdavis.edu> writes:

> We need an auto 'reverse-regular-expression' function (ha ha ha).

;---)

Well, somebody just has to add more regular expressions to match the
upside-down smileys.  (-:  Perhaps the smiley icons should be
upside-down as well?  :-)

-- 
  "Yes.  The journey through the human heart 
     would have to wait until some other time."


^ permalink raw reply	[flat|nested] 25+ messages in thread

* Re: smiley.el (was Re: gnus-smiley.el -- new version)
  1996-06-19  6:10                     ` Lars Magne Ingebrigtsen
@ 1996-06-19 16:36                       ` Wes Hardaker
  0 siblings, 0 replies; 25+ messages in thread
From: Wes Hardaker @ 1996-06-19 16:36 UTC (permalink / raw)
  Cc: ding

Lars Magne Ingebrigtsen <larsi@ifi.uio.no> writes:

> Well, somebody just has to add more regular expressions to match the
> upside-down smileys.  (-:  Perhaps the smiley icons should be
> upside-down as well?  :-)

Good idea.

You know, I'm suprised there isn't (ie, there probably is) a elisp
function which does search for a regular expression from a backwards
point of view (very different from the typical backward searches).  If
DNE, it should be written.  Then all you would have to do would be to
pass the same reg-ex to the new function and either load an upside
down version of the image, or hack xemacs to rotate 180 if it isn't
able to do this already (it should be able to if it can't :-).

Wes


^ permalink raw reply	[flat|nested] 25+ messages in thread

end of thread, other threads:[~1996-06-19 16:36 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-06-14 17:23 gnus-smiley.el -- new version Wes Hardaker
1996-06-14 18:42 ` smiley.el (was Re: gnus-smiley.el -- new version) William Perry
1996-06-14 21:11   ` Colin Rafferty
1996-06-14 21:55     ` William Perry
1996-06-14 21:57   ` Wes Hardaker
1996-06-14 22:52     ` William Perry
1996-06-14 22:07   ` Steven L Baur
1996-06-14 22:53     ` William Perry
1996-06-14 23:14       ` Steven L Baur
1996-06-15  1:22         ` Wes Hardaker
1996-06-15  7:54           ` Lars Magne Ingebrigtsen
1996-06-15  7:59     ` Lars Magne Ingebrigtsen
1996-06-15  8:53       ` Lars Magne Ingebrigtsen
1996-06-17 13:49         ` Jan Vroonhof
1996-06-17 16:16           ` Lars Magne Ingebrigtsen
1996-06-18 16:32             ` Wes Hardaker
1996-06-18 16:54               ` Lars Magne Ingebrigtsen
1996-06-18 17:49                 ` Wes Hardaker
1996-06-19  6:07                   ` Lars Magne Ingebrigtsen
1996-06-18 19:23                 ` Sten Drescher
1996-06-18 20:12                   ` Wes Hardaker
1996-06-19  6:10                     ` Lars Magne Ingebrigtsen
1996-06-19 16:36                       ` Wes Hardaker
1996-06-17 16:27         ` Jan Vroonhof
1996-06-17 17:43         ` Wes Hardaker

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).