emacs-orgmode
[Top][All Lists]
Advanced

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

Re: [Orgmode] default browser - SOLVED


From: Daniel Martins
Subject: Re: [Orgmode] default browser - SOLVED
Date: Fri, 26 Feb 2010 14:06:59 -0300

Thanks Nick,


> Most (?) browsers have a remote URL capability: you can send a URL to an
> already running instance and it will just open it, without going through
> the overhead of creating another instance.

For me it seems strange this behaviour.

When I have firefox already open, it creates another tab for the URL and does not open a new firefox instance.

Daniel

2010/2/26 Nick Dokos <address@hidden>
[I had sent a similar answer to Henri-Paul, but for some reason, my reply
never hit the list - I've had problem posting to the list in the past
couple of days. I have an outstanding query to the list administrators,
but I haven't heard anything back. If you do receive this personally,
you might want to check the list and if it does not make it within the
next day or so, you might want to just post it there for posterity.]

Daniel Martins <address@hidden> wrote:


> You solved for me a quite annoying issue related to org that I could not solve!
>
> For those who use firefox these two lines become:
>
> (setq browse-url-browser-function (quote browse-url-generic))
> (setq browse-url-generic-program "firefox")
>
> Simply copy and paste it!!
>

Daniel,

The problem with this solution is that it creates a new instance
of the browser every time you click a link:


,----
| browse-url-generic is an interactive compiled Lisp function in
| `browse-url.el'.
|
| (browse-url-generic URL &optional NEW-WINDOW)
|
| Ask the WWW browser defined by `browse-url-generic-program' to load URL.
| Default to the URL around or before point.  A fresh copy of the
| browser is started up in a new process with possible additional arguments
| `browse-url-generic-args'.  This is appropriate for browsers which
| don't offer a form of remote control.
`----

Most (?) browsers have a remote URL capability: you can send a URL to an
already running instance and it will just open it, without going through
the overhead of creating another instance.

For firefox, I do the following:

,----
| (defun browse-url-firefox (url &optional new-window)
|   (shell-command (concat "firefox-xremote-client" " " "\"" url "\"")))
|
| (setq browse-url-browser-function 'browse-url-firefox)
`----

with the following firefox-xremote-client script somewhere in my path:

,----
| #! /bin/bash
|
| firefox --remote "openURL($1)"
`----

HTH,
Nick




reply via email to

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