From: morioka Date: Mon, 17 Mar 1997 13:25:53 +0000 (+0000) Subject: (mime-add-button): New implementation. X-Git-Tag: Hokutetsu-Ishikawa-new~90 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=55fb89f1c0870216d1fe68ec50a67702c92b163e;p=elisp%2Fsemi.git (mime-add-button): New implementation. --- diff --git a/mime-def.el b/mime-def.el index 2e4a702..bcb3be2 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.43 1997-03-10 15:16:26 morioka Exp $ +;; Version: $Id: mime-def.el,v 0.44 1997-03-17 13:25:53 morioka Exp $ ;; Keywords: definition, MIME, multimedia, mail, news ;; This file is part of SEMI (SEMI is Emacs MIME Interfaces). @@ -78,18 +78,20 @@ (defvar mime-button-mouse-face 'highlight "Face used for MIME-preview buffer mouse highlighting.") -(defun mime-add-button (from to func &optional data) +(defsubst mime-add-button (from to func &optional data) "Create a button between FROM and TO with callback FUNC and data DATA." (and mime-button-face (overlay-put (make-overlay from to) 'face mime-button-face)) - (add-text-properties from to - (nconc - (and mime-button-mouse-face - (list 'mouse-face mime-button-mouse-face)) - (list 'mime-button-callback func) - (and data (list 'mime-button-data data)) - )) - ) + (let ((props (cons 'mime-button-callback + (cons func + (if data + (list 'mime-button-data data) + ))))) + (if mime-button-mouse-face + (setq props (cons 'mouse-face (cons mime-button-mouse-face props))) + ) + (add-text-properties from to props) + )) (defvar mime-button-mother-dispatcher nil)