[Top][All Lists]

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

bug in browse-url.el - browse-url-mozilla

From: Denis Howe
Subject: bug in browse-url.el - browse-url-mozilla
Date: Sun, 21 Sep 2003 00:03:59 +0100

Subject: bug in browse-url-mozilla
From: address@hidden (Henry S. Thompson)
Date: Mon, 25 Aug 2003 11:30:56 +0100

Thanks for adding this, but in adding new-tab support to the existing
code the nesting got broken.  I think it should read as follows:

(defun browse-url-mozilla (url &optional new-window)
  "Ask the Mozilla WWW browser to load URL.
Default to the URL around or before point.  The strings in variable
`browse-url-mozilla-arguments' are also passed to Mozilla.

When called interactively, if variable `browse-url-new-window-flag' is
non-nil, load the document in a new Mozilla window, otherwise use a
random existing one.  A non-nil interactive prefix argument reverses
the effect of `browse-url-new-window-flag'.

If `browse-url-mozilla-new-window-is-tab' is non-nil, then whenever a
document would otherwise be loaded in a new window, it is loaded in a
new tab in an existing window instead.

When called non-interactively, optional second argument NEW-WINDOW is
used instead of `browse-url-new-window-flag'."
  (interactive (browse-url-interactive-arg "URL: "))
  ;; URL encode any `confusing' characters in the URL.  This needs to
  ;; include at least commas; presumably also close parens.
  (while (string-match "[,)]" url)
    (setq url (replace-match
               (format "%%%x" (string-to-char (match-string 0 url))) t t url)))
  (let* ((process-environment (browse-url-process-environment))
          (apply 'start-process
                 (concat "mozilla " url) nil
                  (list "-remote"
                        (concat "openURL("
                                (if (browse-url-maybe-new-window
                                    (if browse-url-mozilla-new-window-is-tab
    (set-process-sentinel process
                          `(lambda (process change)
                             (browse-url-mozilla-sentinel process ,url)))))

Denis Howe <address@hidden>
Free On-Line Dictionary of Computing

reply via email to

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