Gnus development mailing list
 help / color / mirror / Atom feed
* Smiley update
@ 1996-08-20 15:36 Wesley.Hardaker
  0 siblings, 0 replies; only message in thread
From: Wesley.Hardaker @ 1996-08-20 15:36 UTC (permalink / raw)



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    <Wesley.Hardaker@sphys.unil.ch>
+ 
+ 	* 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  <larsi@ifi.uio.no>
  
  	* 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)))))))))


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-08-20 15:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-08-20 15:36 Smiley update Wesley.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).