info-gnus-english
[Top][All Lists]
Advanced

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

Re: Open urls in a browser


From: Richard Riley
Subject: Re: Open urls in a browser
Date: Tue, 02 Jun 2009 17:24:27 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux)

notbob@bb.nothome.com writes:


> Memnon Anon <gegendosenfleisch@gmail.com> writes:
>
>
>> | `M-x browse-url <RET> URL <RET>'
>> |      Load a URL into a Web browser.
>
> Works great! ...even brings up my preferred browser instead of any of
> the other 3 I have.  How it did that, I have no clue, but works
> perfectly.  I did discover having the cursor "close" to a URL gives
> only a close approximation of the link.  Gotta have cursor right on
> link to get accurate location.
>
> Thank you
> nb

Possibly better - I use :


(defun rgr/browse (url)
  "If prefix is specified use the system default browser else use the 
configured emacs one"
  (if current-prefix-arg
      (when url (browse-url-default-browser url))
    (if  url (browse-url url) (call-interactively 'browse-url))
    ))

(defun rgr/browse-url (&optional url)
  "browse the url passed in"
  (interactive)
  (setq url (or url (w3m-url-valid (w3m-anchor)) (browse-url-url-at-point) 
(region-or-word-at-point)))
  (setq url (read-string (format "Url \"%s\" :" url) url nil url))
  (rgr/browse url))

(global-set-key (kbd "<f4>") 'rgr/browse-url)



Cursor on url. Hit f4 to open using your emacs browser (whatever that is
configured to) or C-u f4 to open in your desktop browser (firefox here).



reply via email to

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