unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Reuben Thomas <rrt@sc3d.org>
Cc: Emacs Bugs <bug-gnu-emacs@gnu.org>,
	Richard Stallman <rms@gnu.org>,
	d.love@dl.ac.uk
Subject: Re: [Reuben Thomas] browse-url.el Opera support
Date: Mon, 19 Jan 2004 19:38:42 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.58.0401191937190.4049@mnemosyne> (raw)
In-Reply-To: <ilud69hwyuz.fsf@latte.josefsson.org>

[-- Attachment #1: Type: TEXT/PLAIN, Size: 287 bytes --]

> Regarding your modified browse-url.el:

With many abasements, I offer yet another diff, this time reverting a
little debugging code in the previous diff to what I actually intended.

-- 
http://www.mupsych.org/~rrt/
My dark path darkens; rise over the mountain, distant moon (Murasaki)

[-- Attachment #2: Type: TEXT/PLAIN, Size: 3662 bytes --]

--- /usr/share/emacs/21.3/lisp/net/browse-url.el	2003-10-27 14:35:16.000000000 +0100
+++ /home/rrt/elisp/browse-url.el	2004-01-19 19:36:27.000000000 +0100
@@ -215,7 +215,7 @@
 
 ;; To invoke different browsers for different URLs:
 ;;      (setq browse-url-browser-function '(("^mailto:" . browse-url-mail)
-;;      				    ("." . browse-url-netscape)))
+;;				    ("." . browse-url-netscape)))
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Code:
@@ -226,6 +226,7 @@
 (eval-when-compile (require 'thingatpt)
                    (require 'term)
 		   (require 'dired)
+                   (require 'cl)
 		   (require 'w3-auto nil t))
 
 (defgroup browse-url nil
@@ -788,7 +789,7 @@
 
 When called non-interactively, optional second argument NEW-WINDOW is
 used instead of `browse-url-new-window-flag'."
-  (interactive (browse-url-interactive-arg "URL: "))  
+  (interactive (browse-url-interactive-arg "URL: "))
   (apply 'start-process (concat "gnome-moz-remote " url)
 	 nil
 	 "gnome-moz-remote"
@@ -1079,16 +1080,42 @@
 (defun browse-url-generic (url &optional new-window)
   ;; new-window ignored
   "Ask the WWW browser defined by `browse-url-generic-program' to load URL.
-Default to the URL around or before point.  A fresh copy of the
-browser is started up in a new process with possible additional arguments
-`browse-url-generic-args'.  This is appropriate for browsers which
-don't offer a form of remote control."
+Default to the URL around or before point.  A fresh copy of the browser
+is started up in a new process with possible additional arguments
+`browse-url-generic-args', in which the URL is substituted for
+`__URL__' if it exists, or added as a final argument if not."
   (interactive (browse-url-interactive-arg "URL: "))
-  (if (not browse-url-generic-program)
+  (unless browse-url-generic-program
     (error "No browser defined (`browse-url-generic-program')"))
-  (apply 'start-process (concat browse-url-generic-program url) nil
-	 browse-url-generic-program
-	 (append browse-url-generic-args (list url))))
+  (let (found-tok)
+    (let ((args
+           (mapcar
+            (lambda (s)
+              (if (string-match "__URL__" s)
+                  (progn
+                    (setq found-tok t)
+                    (replace-match url t t s))
+                s))
+            browse-url-generic-args)))
+      (unless found-tok
+        (setq args (append args (list url))))
+      (apply 'start-process (concat browse-url-generic-program " " url) nil
+             browse-url-generic-program
+             args))))
+
+; Values for browse-url-generic-args
+;
+; These could be put in a list indexed by browser name to allow common
+; browsers to be chosen from a list and the method of starting the URL
+; (same window, new window, new tab) to be an option.
+;
+; Browser            Same window                   New window                               New tab
+;
+; Opera              ""                            -remote openURL(__URL__,new-window)      -remote openURL(__URL__,new-page)
+; Konqueror          ??                            ""                                       ??
+; Mozilla            -remote openURL(__URL__)      -remote openURL(__URL__,new-window)      -remote openURL(__URL__,new-tab)
+; gnome-moz-remote   --raise __URL__               --raise --newwin __URL__                 --raise --remote=openURL(__URL__,new-tab)
+; lynx-xterm         n/a                            xterm -e lynx __URL__                    n/a
 
 ;;;###autoload
 (defun browse-url-kde (url &optional new-window)

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

  parent reply	other threads:[~2004-01-19 18:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.693.1074172442.928.bug-gnu-emacs@gnu.org>
2004-01-15 13:48 ` [Reuben Thomas] browse-url.el Opera support Simon Josefsson
2004-01-15 14:12   ` Reuben Thomas
2004-01-15 14:28     ` Simon Josefsson
2004-01-16 19:54     ` Richard Stallman
2004-01-17 15:15       ` Reuben Thomas
2004-01-18  6:32         ` Simon Josefsson
2004-01-18  7:15           ` Reuben Thomas
2004-01-18 22:27           ` Reuben Thomas
2004-01-19 20:12             ` Richard Stallman
2004-01-19 18:35           ` Reuben Thomas
2004-01-19 18:38           ` Reuben Thomas [this message]
2004-02-05 15:44           ` Dave Love
2004-02-05 16:09             ` Reuben Thomas
2004-01-18 19:14         ` Richard Stallman
     [not found]       ` <mailman.829.1074355733.928.bug-gnu-emacs@gnu.org>
2004-01-17 20:43         ` David Kastrup
     [not found]     ` <mailman.789.1074285000.928.bug-gnu-emacs@gnu.org>
2004-01-16 21:43       ` David Kastrup
2004-01-17 12:53         ` Richard Stallman
2004-01-17  0:16     ` Dave Love
2004-01-17 15:27       ` Reuben Thomas
     [not found]   ` <mailman.716.1074194876.928.bug-gnu-emacs@gnu.org>
2004-01-15 22:32     ` Kevin Rodgers
2004-01-15 12:12 Dave Love

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0401191937190.4049@mnemosyne \
    --to=rrt@sc3d.org \
    --cc=bug-gnu-emacs@gnu.org \
    --cc=d.love@dl.ac.uk \
    --cc=rms@gnu.org \
    --cc=rrt@mupsych.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).