* [Alastair Burt <alastair.burt@dfki.de>] Smiley.el
@ 1997-11-05 23:29 Wes Hardaker
1997-11-07 21:34 ` David Hedbor
1997-11-13 21:03 ` Lars Magne Ingebrigtsen
0 siblings, 2 replies; 3+ messages in thread
From: Wes Hardaker @ 1997-11-05 23:29 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 168 bytes --]
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
[-- Attachment #2: Type: message/rfc822, Size: 3380 bytes --]
From: Alastair Burt <alastair.burt@dfki.de>
To: Wes Hardaker <hardaker@clover.ece.ucdavis.edu>
Subject: Smiley.el
Date: Tue, 23 Sep 1997 17:51:38 +0200 (MET DST)
Message-ID: <199709231551.RAA07870@serv-101.ags.uni-sb.de>
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."
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Alastair Burt <alastair.burt@dfki.de>] Smiley.el
1997-11-05 23:29 [Alastair Burt <alastair.burt@dfki.de>] Smiley.el Wes Hardaker
@ 1997-11-07 21:34 ` David Hedbor
1997-11-13 21:03 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 3+ messages in thread
From: David Hedbor @ 1997-11-07 21:34 UTC (permalink / raw)
This is a very good patch. I have when I read some code in an email
and it's filled with smilies. Being able to toggle them is great.
--
[ Below is a random fortune, which is unrelated to the above message. ]
Save gas, don't use the shell.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Alastair Burt <alastair.burt@dfki.de>] Smiley.el
1997-11-05 23:29 [Alastair Burt <alastair.burt@dfki.de>] Smiley.el Wes Hardaker
1997-11-07 21:34 ` David Hedbor
@ 1997-11-13 21:03 ` Lars Magne Ingebrigtsen
1 sibling, 0 replies; 3+ messages in thread
From: Lars Magne Ingebrigtsen @ 1997-11-13 21:03 UTC (permalink / raw)
Wes Hardaker <wjhardaker@ucdavis.edu> writes:
> 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.
I haven't handled bug reports for a while now. *sigh* One of these
days I'll find the time...
--
(domestic pets only, the antidote for overdose, milk.)
larsi@gnus.org * Lars Magne Ingebrigtsen
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1997-11-13 21:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-11-05 23:29 [Alastair Burt <alastair.burt@dfki.de>] Smiley.el Wes Hardaker
1997-11-07 21:34 ` David Hedbor
1997-11-13 21:03 ` Lars Magne Ingebrigtsen
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).