Function: ffap-url-at-point

ffap-url-at-point is a byte-compiled function defined in ffap.el.gz.

Signature

(ffap-url-at-point)

Documentation

Return URL from around point if it exists, or nil.

Sets the variable ffap-string-at-point-region to the bounds of URL, if any.

Source Code

;; Defined in /usr/src/emacs/lisp/ffap.el.gz
(defun ffap-url-at-point ()
  "Return URL from around point if it exists, or nil.

Sets the variable `ffap-string-at-point-region' to the bounds of URL, if any."
  (when ffap-url-regexp
    (or (and (eq major-mode 'w3-mode) ; In a w3 buffer button?
	     (w3-view-this-url t))
	(let ((thing-at-point-beginning-of-url-regexp ffap-url-regexp)
	      (thing-at-point-default-mail-uri-scheme ffap-foo-at-bar-prefix)
              val)
	  (setq val (thing-at-point-url-at-point ffap-lax-url
                                                 (if (use-region-p)
                                                     (cons (region-beginning)
                                                           (region-end)))))
          (if val
              (let ((bounds (thing-at-point-bounds-of-url-at-point
                             ffap-lax-url)))
                (setq ffap-string-at-point-region
                      (list (car bounds) (cdr bounds)))))
          val))))