(mime-insert-button): New inline function.
authormorioka <morioka>
Sat, 21 Jun 1997 04:08:04 +0000 (04:08 +0000)
committermorioka <morioka>
Sat, 21 Jun 1997 04:08:04 +0000 (04:08 +0000)
mime-def.el

index f86e8b9..3181194 100644 (file)
@@ -3,7 +3,7 @@
 ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc.
 
 ;; Author: MORIOKA Tomohiko <morioka@jaist.ac.jp>
-;; Version: $Id: mime-def.el,v 0.51 1997-06-21 04:06:17 morioka Exp $
+;; Version: $Id: mime-def.el,v 0.52 1997-06-21 04:08:04 morioka Exp $
 ;; Keywords: definition, MIME, multimedia, mail, news
 
 ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces).
     ;;(add-text-properties from to (list 'keymap widget-keymap))
     ))
 
+(defsubst mime-insert-button (string function &optional data)
+  "Insert STRING as button with callback FUNCTION and DATA."
+  (save-restriction
+    (narrow-to-region (point)(point))
+    (insert (concat "[" string "]"))
+    ;; (widget-push-button-value-create
+    ;;  (widget-convert 'push-button
+    ;;                  :notify (lambda (&rest ignore)
+    ;;                            (mime-view-play-current-entity)
+    ;;                            )
+    ;;                  string))
+    (insert "\n")
+    (mime-add-button (point-min)(point-max) function data)
+    ))
+
 (defvar mime-button-mother-dispatcher nil)
 
 (defun mime-button-dispatcher (event)