From a029c8486d94c0bb46eec4a1495da2a34d15ed3b Mon Sep 17 00:00:00 2001 From: morioka Date: Sat, 2 May 1998 19:47:54 +0000 Subject: [PATCH] (mime-insert-button): Regard line breaks. --- semi-def.el | 38 +++++++++++++++++++++----------------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/semi-def.el b/semi-def.el index ca97a82..bb14d37 100644 --- a/semi-def.el +++ b/semi-def.el @@ -75,23 +75,27 @@ "Insert STRING as button with callback FUNCTION and DATA." (save-restriction (narrow-to-region (point)(point)) - (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) - ))) - string) - (insert "\n") + (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) )) -- 1.7.10.4