From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/7679 Path: main.gmane.org!not-for-mail From: Wesley.Hardaker@sphys.unil.ch Newsgroups: gmane.emacs.gnus.general Subject: Smiley update Date: 20 Aug 1996 17:36:37 +0200 Sender: whardake@iptsun2.unil.ch Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no X-Trace: main.gmane.org 1035147960 8159 80.91.224.250 (20 Oct 2002 21:06:00 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 21:06:00 +0000 (UTC) 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 JAA00040 for ; Tue, 20 Aug 1996 09:37:36 -0700 Original-Received: from uldns1.unil.ch (uldns1.unil.ch [130.223.8.20]) by ifi.uio.no with SMTP (8.6.11/ifi2.4) id for ; Tue, 20 Aug 1996 17:38:55 +0200 Original-Received: from iptsun2.unil.ch (actually iptsun2) by uldns1 with SMTP (PP); Tue, 20 Aug 1996 17:37:40 +0200 Original-Received: by iptsun2.unil.ch (5.x/Unil-3.1/) id AA01770; Tue, 20 Aug 1996 17:36:39 +0200 Original-To: ding@ifi.uio.no In-Reply-To: Lars Magne Ingebrigtsen's message of 19 Aug 1996 20:03:21 +0200 Original-Lines: 90 Xref: main.gmane.org gmane.emacs.gnus.general:7679 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:7679 Well, here's pass one at a new smiley feature (what else): smiley's are now buttons that unhide the original smiley text. The current implementation has a few problems: It doesn't hide the graphic smiley (it should, it just doesn't work). It'll currently hide any extent it touches, which is bad (press a smiley face on a included text line, it'll hide the whole line). However, its fun, and thats what matters right??? Wes Index: rgnus/ChangeLog diff -c rgnus/ChangeLog:1.1.1.2 rgnus/ChangeLog:1.2 *** rgnus/ChangeLog:1.1.1.2 Tue Aug 20 07:25:51 1996 --- rgnus/ChangeLog Tue Aug 20 15:33:01 1996 *************** *** 1,3 **** --- 1,9 ---- + Tue Aug 20 17:30:00 1996 + + * smiley.el (smiley-map): New keymap for smiley's. + (smiley-toggle-extent): New function to toggle smiley invisiblity. + (smiley-buffer): Use them. + Sun Aug 18 12:46:12 1996 Lars Magne Ingebrigtsen * nnoo.el (nnoo-define-skeleton-1): Defined too many functions. Index: rgnus/smiley.el diff -c rgnus/smiley.el:1.1.1.1 rgnus/smiley.el:1.2 *** rgnus/smiley.el:1.1.1.1 Tue Aug 20 07:06:57 1996 --- rgnus/smiley.el Tue Aug 20 15:13:03 1996 *************** *** 103,108 **** --- 103,113 ---- (defvar smiley-glyph-cache nil) (defvar smiley-running-xemacs (string-match "XEmacs" emacs-version)) + (defvar smiley-map (make-sparse-keymap "smiley-keys") + "keymap to toggle smiley states") + + (define-key smiley-map [(button2)] 'smiley-toggle-extent) + (defun smiley-create-glyph (smiley pixmap) (and smiley-running-xemacs *************** *** 128,133 **** --- 133,148 ---- (interactive "r") (smiley-buffer (current-buffer) beg end)) + (defun smiley-toggle-extent (event) + "Toggle smiley at given point" + (interactive "e") + (let* ((pt (event-closest-point event)) + ext) + (if pt + (while (setq ext (extent-at pt (event-buffer event) nil ext 'at)) + (set-extent-property ext 'invisible + (not (extent-property ext 'invisible))))))) + ;;;###autoload (defun smiley-buffer (&optional buffer st nd) (interactive) *************** *** 158,165 **** (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) (when (smiley-end-paren-p start end) (make-annotation ")" end 'text)) (goto-char end))))))))) --- 173,184 ---- (let ((ext (make-extent start end))) (set-extent-property ext 'invisible t) (set-extent-property ext 'end-open t) + (set-extent-property ext 'keymap smiley-map) + (set-extent-property ext 'mouse-face gnus-article-mouse-face) (set-extent-property ext 'intangible t)) ! (let ((ext (make-annotation glyph end 'text))) ! (set-extent-property ext 'mouse-face gnus-article-mouse-face) ! (set-extent-property ext 'keymap smiley-map)) (when (smiley-end-paren-p start end) (make-annotation ")" end 'text)) (goto-char end)))))))))