From: Wes Hardaker <wjhardaker@ucdavis.edu>
Subject: [Alastair Burt <alastair.burt@dfki.de>] Smiley.el
Date: 05 Nov 1997 15:29:11 -0800 [thread overview]
Message-ID: <x74t5qudh4.fsf@mail.calwest.net> (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."
next reply other threads:[~1997-11-05 23:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1997-11-05 23:29 Wes Hardaker [this message]
1997-11-07 21:34 ` David Hedbor
1997-11-13 21:03 ` Lars Magne Ingebrigtsen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=x74t5qudh4.fsf@mail.calwest.net \
--to=wjhardaker@ucdavis.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).