From 6c74d495ba6a5c32632e733dc33290f6e0323d91 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 10 Nov 1998 11:59:14 +0000 Subject: [PATCH] (mime-insert-button): Insert entity info as a invisible string under XEmacs. --- ChangeLog | 5 +++++ semi-def.el | 50 ++++++++++++++++++++++++++++---------------------- 2 files changed, 33 insertions(+), 22 deletions(-) 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) -- 1.7.10.4