Function: ibtypes::www-url

ibtypes::www-url is a byte-compiled function defined in hsys-www.el.

Signature

(ibtypes::www-url)

Documentation

Follow any non-ftp url (link) at point.

The variable, browse-url-browser-function, customizes the url browser that is used. Valid values of this variable include browse-url-default-browser and browse-url-generic.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hsys-www.el
(defact www-url (url)
  "Follow a link given by URL.
The variable, `browse-url-browser-function', customizes the url browser that
is used.  Valid values of this variable include `browse-url-default-browser' and
`browse-url-generic'."
  (interactive "sURL to follow: ")
  (unless (stringp url)
    (error "(www-url): URL = `%s' but must be a string" url))
  (unless (seq-position url ?:)
    (setq url (concat "https://" url)))
  (if (or (functionp browse-url-browser-function)
	  ;; May be a predicate alist of functions from which to select
	  (consp browse-url-browser-function))
      (let ((browse-url-browser-function
	     (if (eq browse-url-browser-function #'eww-browse-url)
		 ;; Hyperbole-specific version
		 #'www-eww-browse-url
	       browse-url-browser-function))
	    browse-function-name
	    browser)
	(if (symbolp browse-url-browser-function)
	    (setq browse-function-name (symbol-name browse-url-browser-function)
		  browser (and (string-match
				"-\\([^-]+\\)\\'"
				browse-function-name)
			       (capitalize (substring browse-function-name
						      (match-beginning 1)
						      (match-end 1)))))
	  (setq browser "default browser"))
	(message "Sending %s to %s..." url browser)
	(browse-url url)
	(message "Sending %s to %s...done" url browser))
    (error "(www-url): `browse-url-browser-function' must be set to a web browser invoking function")))