[Top][All Lists]

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

Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107890: Adapt browse-url.el to i

From: Ken Brown
Subject: Re: [Emacs-diffs] /srv/bzr/emacs/trunk r107890: Adapt browse-url.el to improvements in Cygwin's cygstart utility.
Date: Mon, 16 Apr 2012 07:11:15 -0400
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0.1) Gecko/20120208 Thunderbird/10.0.1

On 4/16/2012 3:28 AM, Katsumi Yamaoka wrote:
Ken Brown wrote:
revno: 107890
committer: Ken Brown<address@hidden>
branch nick: trunk
timestamp: Fri 2012-04-13 11:15:42 -0400
   Adapt browse-url.el to improvements in Cygwin's cygstart utility.

   * lisp/net/browse-url.el (browse-url-file-url): Remove Cygwin hack;
   this is no longer needed now that cygstart understands file://
   (browse-url-filename-alist): For the same reason, don't modify
   file:// URLs on Cygwin.


This is neither a bug report nor a complaint.  I may be worrying
unduly, but...

By the change, a way for Cygwin users to view file:// urls by
using a non-default browser was lost, since cygstart only runs
the default Windows browser.  I like firefox but some web pages
support only IE, so mainly for the office work I don't set firefox
as the default browser (similarly I use Gnus for personal mails
but use Outlook for the office work).  My Emacs configuration:

(setq browse-url-browser-function 'browse-url-generic
       "/cygdrive/c/Program Files/Mozilla Firefox/firefox.exe")

Ok, the following advice helps:

(defadvice browse-url-file-url (after convert-filename-for-cygwin activate)
   "Convert filename to the one that Cygwin understands."
   (when (string-match "\\`file:///" ad-return-value)
     (setq ad-return-value
          (concat (substring ad-return-value 0 (match-end 0))
                  (substring (with-output-to-string
                               (call-process "cygpath" nil
                                             nil "-m"
                                             (substring ad-return-value
                                                        (1- (match-end 0)))))
                             0 -1)))))

FYI, Gnus still uses cygpath for converting link file names in
a html file that `gnus-article-browse-html-parts' generates.

Thanks for the report. I hadn't thought about the possibility that someone would want to use a Windows browser that's not the default Windows browser.

Would the following work? Write a script "browser" that accepts a URL and then calls firefox, after first translating file:// URLs to a form that firefox understands. Then set browse-url-generic-program to "browser". This strikes me as more in the spirit of Cygwin, which tries to emulate GNU/Linux. So a browser for Cygwin users ought to be able to handle file:// URLs. That's why I asked for cygstart to be changed so that it would understand such URLs. (It also understands mailto: URLs now.)


reply via email to

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