help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Elisp to open a line-wrapped URL


From: Emanuel Berg
Subject: Re: Elisp to open a line-wrapped URL
Date: Sun, 25 Feb 2018 23:40:38 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

> Probably searching can be done more
> efficiently tho, e.g. a regexp search for the
> next URL...

(require 'cl-lib)
(require 'thingatpt)
(require 'w3m)

(defun goto-next-url ()
  (interactive)
  (let ((max (point-max)))
    (cl-dolist (url-type thing-at-point-uri-schemes)
      (when (re-search-forward url-type max t)
        (goto-char (match-beginning 0))
        (let ((url (thing-at-point 'url)))
          (when url
            (w3m-goto-url url)
            (cl-return) ))))))

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

[Prev in Thread] Current Thread [Next in Thread]