From: morioka Date: Sat, 21 Jun 1997 04:08:04 +0000 (+0000) Subject: (mime-insert-button): New inline function. X-Git-Tag: semi-0_96~41 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=9fe82b9d6afa6a94018faf4eef78375b9aeb5dda;p=elisp%2Fsemi.git (mime-insert-button): New inline function. --- diff --git a/mime-def.el b/mime-def.el index f86e8b9..3181194 100644 --- a/mime-def.el +++ b/mime-def.el @@ -3,7 +3,7 @@ ;; Copyright (C) 1995,1996,1997 Free Software Foundation, Inc. ;; Author: MORIOKA Tomohiko -;; 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). @@ -89,6 +89,21 @@ ;;(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)