From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Denis Howe Newsgroups: gmane.emacs.bugs Subject: bug in browse-url.el - browse-url-mozilla Date: Sun, 21 Sep 2003 00:03:59 +0100 Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1064099147 6745 80.91.224.253 (20 Sep 2003 23:05:47 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 20 Sep 2003 23:05:47 +0000 (UTC) Cc: "Henry S. Thompson" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Sep 21 01:05:45 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1A0qnR-00037m-00 for ; Sun, 21 Sep 2003 01:05:45 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A0qnJ-0000qe-4j for geb-bug-gnu-emacs@m.gmane.org; Sat, 20 Sep 2003 19:05:37 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.22) id 1A0qlv-0006VB-R3 for bug-gnu-emacs@gnu.org; Sat, 20 Sep 2003 19:04:11 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.22) id 1A0qlo-0006MA-Ev for bug-gnu-emacs@gnu.org; Sat, 20 Sep 2003 19:04:07 -0400 Original-Received: from [146.169.1.47] (helo=diver.doc.ic.ac.uk) by monty-python.gnu.org with esmtp (Exim 4.22) id 1A0qlm-0006Gn-AB for bug-gnu-emacs@gnu.org; Sat, 20 Sep 2003 19:04:02 -0400 Original-Received: from kiwi.doc.ic.ac.uk ([146.169.2.59] ident=exim) by diver.doc.ic.ac.uk with esmtp (Exim 3.16 #7) id 1A0qlk-0000Wk-00; Sun, 21 Sep 2003 00:04:00 +0100 Original-Received: from dbh by kiwi.doc.ic.ac.uk with local (Exim 3.32 #1) id 1A0qlj-0004lH-00; Sun, 21 Sep 2003 00:03:59 +0100 Original-To: browse-url maintainer X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Bug reports for GNU Emacs, the Swiss army knife of text editors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.bugs:5822 X-Report-Spam: http://spam.gmane.org/gmane.emacs.bugs:5822 Subject: bug in browse-url-mozilla From: ht@cogsci.ed.ac.uk (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)) (process (apply 'start-process (concat "mozilla " url) nil browse-url-mozilla-program (append browse-url-mozilla-arguments (list "-remote" (concat "openURL(" url (if (browse-url-maybe-new-window new-window) (if browse-url-mozilla-new-window-is-tab ",new-tab" ",new-window")) ")")))))) (set-process-sentinel process `(lambda (process change) (browse-url-mozilla-sentinel process ,url))))) -- Denis Howe Free On-Line Dictionary of Computing http://www.foldoc.org/