From: yamaoka Date: Sun, 27 Jun 1999 23:36:51 +0000 (+0000) Subject: (widget-mime-url-link-action): New function. X-Git-Tag: wemi-1_13_5~4 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad5b1f58771418d0872f4a9b9450c85046743944;p=elisp%2Fsemi.git (widget-mime-url-link-action): New function. (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'. --- diff --git a/semi-def.el b/semi-def.el index afcc189..8073f8f 100644 --- a/semi-def.el +++ b/semi-def.el @@ -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 @@ -140,9 +140,19 @@ (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 ;;;