[Top][All Lists]

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

bug#4951: 23.1.50; browse-url-default-windows-browser bug + patch

From: Lennart Borgman
Subject: bug#4951: 23.1.50; browse-url-default-windows-browser bug + patch
Date: Mon, 23 Nov 2009 02:34:29 +0100

I have tried to find the cause of the problem. Some people on
address@hidden mailing list helped me, but I could not
find anything specific.

However I wrote this function and will include it in my patched
version of Emacs+EmacsW32 for those who needs it. (I am not the only
one having this trouble.)

;; (customize-option-other-window 'browse-url-browser-function)
(defun browse-url-no-open-windows-browser (url &optional new-window)
  "Same as `browse-url-default-windows-browser' nearly.
You may want to customize `browse-url-browser-function' to this
function if files do not open in your web browser. It is known
that some pc:s have this problem, reason is so far unknown.

The cure seem to be to call `w32-shell-execute' with a nil
argument here instead of \"open\" which the default function
function `browse-url-default-windows-browser' does.

This should be safe unless your computer is strangely configured,
since you are normaly opening .html files with this function."
  (interactive (browse-url-interactive-arg "URL: "))
  (if (eq system-type 'ms-dos)
      (if dos-windows-version
          (shell-command (concat "start " (shell-quote-argument url)))
        (error "Browsing URLs is not supported on this system"))
    (w32-shell-execute nil url)))

reply via email to

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