From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/12778 Path: main.gmane.org!not-for-mail From: Wes Hardaker Newsgroups: gmane.emacs.gnus.general Subject: [Alastair Burt ] Smiley.el Date: 05 Nov 1997 15:29:11 -0800 Organization: U.C. Davis, Information Technology Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 (generated by tm-edit 7.106) Content-Type: multipart/mixed; boundary="Multipart_Wed_Nov__5_15:29:11_1997-1" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1035152255 5647 80.91.224.250 (20 Oct 2002 22:17:35 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 22:17:35 +0000 (UTC) Return-Path: Original-Received: from xemacs.org (xemacs.cs.uiuc.edu [128.174.252.16]) by altair.xemacs.org (8.8.8/8.8.8) with ESMTP id QAA00596 for ; Wed, 5 Nov 1997 16:54:23 -0800 Original-Received: from ifi.uio.no (ifi.uio.no [129.240.64.2]) by xemacs.org (8.8.5/8.8.5) with ESMTP id SAA21599 for ; Wed, 5 Nov 1997 18:55:05 -0600 (CST) Original-Received: from claymore.vcinet.com (claymore.vcinet.com [208.205.12.23]) by ifi.uio.no (8.8.7/8.8.7/ifi0.2) with SMTP id AAA26939 for ; Thu, 6 Nov 1997 00:32:10 +0100 (MET) Original-Received: (qmail 11888 invoked by uid 504); 5 Nov 1997 23:32:09 -0000 Original-Received: (qmail 11885 invoked from network); 5 Nov 1997 23:32:05 -0000 Original-Received: from n4-102-246.thegrid.net (hardaker@209.60.102.246) by claymore.vcinet.com with SMTP; 5 Nov 1997 23:32:04 -0000 Original-Received: (from hardaker@localhost) by n4-102-246.thegrid.net (8.8.6/8.8.6) id PAA01797; Wed, 5 Nov 1997 15:29:11 -0800 Original-To: ding@gnus.org X-Face: #qW^}a%m*T^{A:Cp}$R\"38+d}41-Z}uU8,r%F#c#s:~Nzp0G9](s?,K49KJ]s"*7gvRgA SrAvQc4@/}L7Qc=w{)]ACO\R{LF@S{pXfojjjGg6c;q6{~C}CxC^^&~(F]`1W)%9j/iS/ IM",B1M.?{w8ckLTYD'`|kTr\i\cgY)P4 X-url: http://www-sphys.unil.ch/~whardake Original-Lines: 136 X-Mailer: Quassia Gnus v0.12/XEmacs 19.15 Xref: main.gmane.org gmane.emacs.gnus.general:12778 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:12778 --Multipart_Wed_Nov__5_15:29:11_1997-1 Content-Type: text/plain; charset=US-ASCII This was passed to me a while back, and I submitted it through the bug reporting a while back (before 0.12), and I noticed it's not in 0.12 so here it is again. Wes --Multipart_Wed_Nov__5_15:29:11_1997-1 Content-Type: message/rfc822 Organization: DFKI Saarbruecken GmbH, D 66123 Saarbruecken Date: Tue, 23 Sep 1997 17:51:38 +0200 (MET DST) Message-Id: <199709231551.RAA07870@serv-101.ags.uni-sb.de> From: Alastair Burt Mime-Version: 1.0 Content-Transfer-Encoding: 7bit To: Wes Hardaker Subject: Smiley.el Content-Type: text/plain; charset=us-ascii Great package. I have some minor extensions to suggest: * ability to toggle all smilies in a buffer, and to support this: + popup menu + balloon-help --- Alastair *** smiley.el 1997/09/23 12:25:40 1.1 --- smiley.el 1997/09/23 15:46:21 *************** *** 140,146 **** :type 'face :group 'smiley) - (defvar smiley-glyph-cache nil) (defvar smiley-running-xemacs (string-match "XEmacs" emacs-version)) --- 140,145 ---- *************** *** 148,153 **** --- 147,160 ---- "Keymap to toggle smiley states.") (define-key smiley-map [(button2)] 'smiley-toggle-extent) + (define-key smiley-map [(button3)] 'smiley-popup-menu) + + (defun smiley-popup-menu (e) + (interactive "e") + (popup-menu + `("Smilies" + ["Toggle This Smiley" (smiley-toggle-extent ,e) t] + ["Toggle All Smilies" (smiley-toggle-extents ,e) t]))) (defun smiley-create-glyph (smiley pixmap) (and *************** *** 191,196 **** --- 198,220 ---- (reveal-annotation ant) (set-extent-property ext 'invisible t))))))) + (defun smiley-toggle-extents (e) + (interactive "e") + (map-extents + '(lambda (e void) + (let (ant) + (if (annotationp (setq ant (extent-property e 'smiley-annotation))) + (progn + (if (eq (extent-property e 'invisible) nil) + (progn + (reveal-annotation ant) + (set-extent-property e 'invisible t) + ) + (hide-annotation ant) + (set-extent-property e 'invisible nil)))) + nil)) + (event-buffer e))) + ;;;###autoload (defun smiley-buffer (&optional buffer st nd) (interactive) *************** *** 203,208 **** --- 227,238 ---- (symbol-value smiley-regexp-alist) smiley-regexp-alist)) entry regexp beg group file) + (map-extents + '(lambda (e void) + (when (or (extent-property e 'smiley-extent) + (extent-property e 'smiley-annotation)) + (delete-extent e))) + buffer st nd) (goto-char (or st (point-min))) (setq beg (point)) ;; loop through alist *************** *** 232,238 **** (set-extent-property ant 'keymap smiley-map) ;; remember each other (set-extent-property ant 'smiley-extent ext) ! (set-extent-property ext 'smiley-annotation ant)) (when (smiley-end-paren-p start end) (make-annotation ")" end 'text)) (goto-char end))))))))) --- 262,275 ---- (set-extent-property ant 'keymap smiley-map) ;; remember each other (set-extent-property ant 'smiley-extent ext) ! (set-extent-property ext 'smiley-annotation ant) ! ;; Help ! (set-extent-property ext 'balloon-help ! "Mouse button2 - toggle smiley ! Mouse button3 - menu") ! (set-extent-property ant 'balloon-help ! "Mouse button2 - toggle smiley ! Mouse button3 - menu")) (when (smiley-end-paren-p start end) (make-annotation ")" end 'text)) (goto-char end))))))))) -- "Ninjas aren't dangerous. They're more afraid of you than you are of them." --Multipart_Wed_Nov__5_15:29:11_1997-1--