From ad5b1f58771418d0872f4a9b9450c85046743944 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Sun, 27 Jun 1999 23:36:51 +0000 Subject: [PATCH] (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'. --- semi-def.el | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 ;;; -- 1.7.10.4