(mime-insert-button): Regard line breaks.
authormorioka <morioka>
Sat, 2 May 1998 19:47:54 +0000 (19:47 +0000)
committermorioka <morioka>
Sat, 2 May 1998 19:47:54 +0000 (19:47 +0000)
semi-def.el

index ca97a82..bb14d37 100644 (file)
   "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)
     ))