From: Wesley.Hardaker@sphys.unil.ch
Subject: Smiley update
Date: 20 Aug 1996 17:36:37 +0200 [thread overview]
Message-ID: <qk27mqunk3e.fsf_-_@iptsun2.unil.ch> (raw)
In-Reply-To: Lars Magne Ingebrigtsen's message of 19 Aug 1996 20:03:21 +0200
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)))))))))
reply other threads:[~1996-08-20 15:36 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=qk27mqunk3e.fsf_-_@iptsun2.unil.ch \
--to=wesley.hardaker@sphys.unil.ch \
/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).