(widget-mime-url-link-action): New function.
authoryamaoka <yamaoka>
Sun, 27 Jun 1999 23:36:51 +0000 (23:36 +0000)
committeryamaoka <yamaoka>
Sun, 27 Jun 1999 23:36:51 +0000 (23:36 +0000)
(mime-url-link): New widget.
(mime-add-url-buttons): Use `widget-convert-button' instead of
`widget-convert-text'.
(TopLevel): Autoload "wid-edit" for `widget-convert-button' instead of
`widget-convert-text'.

semi-def.el

index afcc189..8073f8f 100644 (file)
@@ -36,7 +36,7 @@
 (autoload 'mule-caesar-region "mule-caesar"
   "Caesar rotation of current region." t)
 
-(autoload 'widget-convert-text "wid-edit")
+(autoload 'widget-convert-button "wid-edit")
 
 
 ;;; @ constants
   (while (re-search-forward mime-browse-url-regexp nil t)
     (let ((beg (match-beginning 0))
          (end (match-end 0)))
-      (widget-convert-text 'url-link beg end)
+      (widget-convert-button 'mime-url-link beg end
+                            (buffer-substring beg end))
       )))
 
+(define-widget 'mime-url-link 'link
+  "A link to an www page."
+  :help-echo 'widget-url-link-help-echo
+  :action 'widget-mime-url-link-action)
+
+(defun widget-mime-url-link-action (widget &optional event)
+  "Open the url specified by WIDGET."
+  (funcall mime-browse-url-function (widget-value widget)))
+
 
 ;;; @ menu
 ;;;