From: yamaoka Date: Tue, 10 Nov 1998 11:59:14 +0000 (+0000) Subject: (mime-insert-button): Insert entity info as a invisible string under XEmacs. X-Git-Tag: wemi-1_11_0~5 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6c74d495ba6a5c32632e733dc33290f6e0323d91;p=elisp%2Fsemi.git (mime-insert-button): Insert entity info as a invisible string under XEmacs. --- diff --git a/ChangeLog b/ChangeLog index 3f48067..9d84ec3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +1998-11-10 Katsumi Yamaoka + + * semi-def.el (mime-insert-button): Insert entity info as a + invisible string under XEmacs. + 1998-11-08 MORIOKA Tomohiko * mime-bbdb.el (mime-bbdb/update-record): Use diff --git a/semi-def.el b/semi-def.el index 923739a..fc14d79 100644 --- a/semi-def.el +++ b/semi-def.el @@ -66,28 +66,34 @@ (save-restriction (narrow-to-region (point)(point)) (mapcar #'(lambda (line) - (widget-create - 'push-button - :action `(lambda (widget &optional event) - (,function) - ) - :mouse-down-action `(lambda (widget event) - (let (buf point) - (save-window-excursion - (mouse-set-point event) - (setq buf (current-buffer) - point (point))) - (save-excursion - (set-buffer buf) - (goto-char point) - (,function) - ))) - line) - (insert "\n") - ) - (split-string string "\n")) - ;;(mime-add-button (point-min)(point-max) function data) - )) + (let ((start (point)) + end extent) + (widget-create + 'push-button + :action `(lambda (widget &optional event) + (,function) + ) + :mouse-down-action `(lambda (widget event) + (let (buf point) + (save-window-excursion + (mouse-set-point event) + (setq buf (current-buffer) + point (point))) + (save-excursion + (set-buffer buf) + (goto-char point) + (,function) + ))) + line) + (if (featurep 'xemacs) + (progn + (setq end (point)) + (insert (concat "[" line "]")) + (while (setq extent (extent-at start nil nil extent)) + (set-extent-endpoints extent end (point))) + (delete-region start end))) + (insert "\n"))) + (split-string string "\n")))) (defvar mime-button-mother-dispatcher nil)