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

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

Gnu Emacs: browse-url launches Firefox with 2 tabs with same link


From: qkbeyond
Subject: Gnu Emacs: browse-url launches Firefox with 2 tabs with same link
Date: Wed, 28 Mar 2012 18:36:29 -0000
User-agent: G2/1.0

i meet the same problem as
http://groups.google.com/group/gnu.emacs.bug/browse_thread/thread/60f417ceccbd5f76/c2ed5a0bdd3f6d74?tvc=2#c2ed5a0bdd3f6d74

emacs 23.3 with firefox 3.5.19 in debian linux and emacs 24.0.50 with
firefox 4.0.1 in w32 also have this problem.
i find the solve in emacswiki.org and the following code solved the
problem instead.

;; http://www.emacswiki.org/emacs/BrowseUrl#toc7
;;  firefox -a firefox -remote 'openURL(http://emacswiki.org/, new-
tab)'
(setq browse-url-firefox-program "C:/Program Files/Mozilla Firefox/
firefox.exe")

(setq browse-url-browser-function 'my-browse-url-firefox-new-tab)

(defun my-browse-url-firefox-new-tab (url &optional new-window)
  "Open URL in a new tab in Firefox."
  (interactive (browse-url-interactive-arg "URL: "))
  (let ((cmd (shell-command-to-string
              (concat browse-url-firefox-program " -a firefox 'openURL("
                      url ",new-tab)'"))))
    (unless (string= "" cmd)
      (message "Starting Firefox...")
      (start-process (concat "firefox " url) nil browse-url-firefox-
program url)
      (message "Starting Firefox...done"))))


reply via email to

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