From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/43038 Path: main.gmane.org!not-for-mail From: Dave Love Newsgroups: gmane.emacs.gnus.general Subject: Re: recent smiley.el changes Date: 11 Feb 2002 18:43:19 +0000 Sender: owner-ding@hpc.uh.edu Message-ID: References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="enforcers-JUWTF-assassination-president-BLU-97-A/B" X-Trace: main.gmane.org 1035178194 15417 80.91.224.250 (21 Oct 2002 05:29:54 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 05:29:54 +0000 (UTC) Cc: ding@gnus.org Return-Path: Original-Received: (qmail 4979 invoked from network); 11 Feb 2002 18:44:32 -0000 Original-Received: from malifon.math.uh.edu (mail@129.7.128.13) by mastaler.com with SMTP; 11 Feb 2002 18:44:32 -0000 Original-Received: from sina.hpc.uh.edu ([129.7.128.10] ident=lists) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 16aLQe-0001od-00; Mon, 11 Feb 2002 12:43:52 -0600 Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Mon, 11 Feb 2002 12:43:50 -0600 (CST) Original-Received: from sclp3.sclp.com (qmailr@sclp3.sclp.com [209.196.61.66]) by sina.hpc.uh.edu (8.9.3/8.9.3) with SMTP id MAA29643 for ; Mon, 11 Feb 2002 12:43:38 -0600 (CST) Original-Received: (qmail 4958 invoked by alias); 11 Feb 2002 18:43:34 -0000 Original-Received: (qmail 4953 invoked from network); 11 Feb 2002 18:43:33 -0000 Original-Received: from djlvig.dl.ac.uk (148.79.112.146) by gnus.org with SMTP; 11 Feb 2002 18:43:33 -0000 Original-Received: from fx by djlvig.dl.ac.uk with local (Exim 3.12 #1 (Debian)) id 16aLQ8-00017f-00; Mon, 11 Feb 2002 18:43:20 +0000 X-Face: "_!nmR@11ZNuumt0oqG"Y3Hfy|;FGz)`"ul[G?ah6k-oNyDW?3/Nq3Qab$kUnUQ_d4};kPl R=}-Vqfo|S5mThi-kaBR=>%g5a3-OvnEhdHu{^APIaP:b}0m!$bDC>SX zz'r)e?`at?tpD*+~b+pf Original-To: Wes Hardaker Original-Lines: 154 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1.90 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:43038 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:43038 --enforcers-JUWTF-assassination-president-BLU-97-A/B Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Wes Hardaker writes: > So, recent changes to the gnus cvs directory replaced the smiley.el > file I originally wrote (and billions of people hacked afterwords) > with a new one that is a "re-written, simplified version" of the > original. That sounds like commentary from my smiley-ems.el (for Emacs 21). > All fine and dandy except that the simplification means > loss of functionality (the ability to toggle the smileys via a menu, > pop-up help text, etc). I provided toggling and help-echo support. > (I won't get into why someone thought a rewrite was easier than > sending me a form and asking "hey, we finally need this filled out to > get it distributed with the main emacs base". The commentary mentions assignment problems about which I sent mail, though I don't remember the response(s). At least, as above, it was hacked on by others and the image provenance was unclear. Apart from assignment issues, the code in smiley.el basically wasn't useful for Emacs. Writing smiley-ems as a simple demo/test for Emacs 21 was clearly more efficient than doing essentially the same amount of programming plus chasing paperwork. Note in this connexion that writing common image code is messy since XEmacs maintainers didn't cooperate on a common API and the XEmacs API is poorly documented. Also the change recording in XEmacs and Gnus has often made it difficult or impossible to figure out the copyright status of code. [I hope code isn't still being installed in Gnus without assignments.] Ob-useful =E2=98=BA: --enforcers-JUWTF-assassination-president-BLU-97-A/B Content-Type: text/x-patch Content-Disposition: inline Content-Transfer-Encoding: 8bit 2002-01-11 Dave Love * smiley-ems.el (smiley-regexp-alist): Add Unicode strings. (smiley-update-cache): Allow strings as well as images. (smiley-region, gnus-smiley-display): Doc fix. (smiley-region): Update to allow string display. Index: smiley-ems.el =================================================================== RCS file: /cvs/emacs/lisp/gnus/smiley-ems.el,v retrieving revision 1.9 diff -u -p -r1.9 smiley-ems.el --- smiley-ems.el 13 Dec 2000 02:07:43 -0000 1.9 +++ smiley-ems.el 11 Jan 2002 18:05:25 -0000 @@ -1,6 +1,6 @@ -;;; smiley-ems.el --- displaying smiley faces +;;; smiley-ems.el --- displaying smiley faces -*- coding: iso-2022-7bit -*- -;; Copyright (C) 2000 Free Software Foundation, Inc. +;; Copyright (C) 2000, 2001 Free Software Foundation, Inc. ;; Author: Dave Love ;; Keywords: news mail multimedia @@ -51,17 +51,28 @@ This is in addition to the normal image ;; The XEmacs version has a baroque, if not rococo, set of these. (defcustom smiley-regexp-alist - ;; Perhaps :-) should be distinct -- it does appear in the Jargon File. - '(("\\([:;]-?)\\)\\(\\W\\|\\'\\)" 1 "smile.pbm") - ("\\(:-[/\\]\\)\\(\\W\\|\\'\\)" 1 "wry.pbm") - ("\\(:-[({]\\)\\(\\W\\|\\'\\)" 1 "frown.pbm")) +;; Perhaps :-) should be distinct -- it does appear in the Jargon File. + (if (latin1-char-displayable-p ?\$,2#:(B) + '(("\\([:;]-?)\\)\\(\\W\\|\\'\\)" 1 ((margin nil) "$,2#:(B")) + ("\\(:-[/\\]\\)\\(\\W\\|\\'\\)" 1 ((margin nil) "$,2#;(B")) + ("\\(:-[({]\\)\\(\\W\\|\\'\\)" 1 ((margin nil) "$,2#9(B"))) + '(("\\([:;]-?)\\)\\(\\W\\|\\'\\)" 1 "smile.pbm") + ("\\(:-[/\\]\\)\\(\\W\\|\\'\\)" 1 "wry.pbm") + ("\\(:-[({]\\)\\(\\W\\|\\'\\)" 1 "frown.pbm"))) "*A list of regexps to map smilies to images. The elements are (REGEXP MATCH FILE), where MATCH is the submatch in rgexp to replace with IMAGE. IMAGE is the name of a PBM file in `smiley-data-directory' or the normal image search path." :type '(repeat (list regexp (integer :tag "Regexp match number") - (string :tag "Image name"))) + (choice (string :tag "Image name") + (const :tag "Smiling face character" + ((margin nil) "$,2#:(B")) + (const :tag "Frowning face character" + ((margin nil) "$,2#9(B")) + (const :tag "Black smiling face character" + ((margin nil) "$,2#;(B")) + (sexp :tag "General display property")))) :set (lambda (symbol value) (set-default symbol value) (smiley-update-cache)) @@ -73,11 +84,13 @@ rgexp to replace with IMAGE. IMAGE is t (defun smiley-update-cache () (dolist (elt smiley-regexp-alist) (let* ((data-directory smiley-data-directory) - (image (find-image (list (list :type 'pbm - :file (nth 2 elt) - :ascent 'center))))) - (if image - (push (list (car elt) (cadr elt) image) + (display (if (stringp (nth 2 elt)) + (find-image (list (list :type 'pbm + :file (nth 2 elt) + :ascent 'center))) + (nth 2 elt)))) + (if display + (push (list (car elt) (cadr elt) display) smiley-cached-regexp-alist))))) (defvar smiley-active nil @@ -93,7 +106,7 @@ rgexp to replace with IMAGE. IMAGE is t ;;;###autoload (defun smiley-region (start end) - "Display textual smileys as images. + "Display textual smileys as images or special characters. START and END specify the region; interactively, use the values of point and mark. The value of `smiley-regexp-alist' determines which smileys to operate on and which images to use for them." @@ -109,17 +122,17 @@ which smileys to operate on and which im (save-excursion (let ((beg (or start (point-min))) (inhibit-point-motion-hooks t) - group overlay image) + group overlay display) (dolist (entry smiley-cached-regexp-alist) (setq group (nth 1 entry) - image (nth 2 entry)) + display (nth 2 entry)) (goto-char beg) (while (re-search-forward (car entry) end t) - (when image + (when display (setq overlay (make-overlay (match-beginning group) (match-end group))) (overlay-put overlay - 'display `(when smiley-active ,@image)) + 'display `(when smiley-active . ,display)) (overlay-put overlay 'mouse-face 'highlight) (overlay-put overlay 'smiley t) (overlay-put overlay @@ -148,7 +161,8 @@ With arg, turn displaying on if and only (eval-when-compile (defvar gnus-article-buffer)) (defun gnus-smiley-display (&optional arg) - "Display textual emoticaons (\"smilies\") as small graphical icons. + "Display textual emoticons (\"smilies\") as small graphical icons. +May also use strings to display them. See `smiley-regexp-alist'. With arg, turn displaying on if and only if arg is positive." (interactive "P") (save-excursion --enforcers-JUWTF-assassination-president-BLU-97-A/B--