From: morioka Date: Sat, 2 May 1998 19:47:54 +0000 (+0000) Subject: (mime-insert-button): Regard line breaks. X-Git-Tag: wemi-1_4_0~6 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a029c8486d94c0bb46eec4a1495da2a34d15ed3b;p=elisp%2Fsemi.git (mime-insert-button): Regard line breaks. --- 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) ))