Gnus development mailing list
 help / color / mirror / Atom feed
* URL buttons and new browser windows...
@ 1999-11-17  0:19 Daniel Pittman
  1999-11-17  0:32 ` William M. Perry
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Pittman @ 1999-11-17  0:19 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 765 bytes --]

Given that I am often on a relatively slow connection, I tend to use my
web browser as a background process--create a new window for an URL, do
something for a while and then go and read it.

This is fairly trivial to do and works well with the XEmacs 'browse-url'
library and 'browse-url-new-window-p' set to 't'. This should cause the
package to open a new window when a URL is visited.

pGnus in the article buttonization code does not use the top level
entry-point for 'browse-url' but rather directly calls the selected
function (browse.*netscape) in my case :)

The problem is that gnus did not respect the setting of
'browse-url-new-window-p' which was annoying to me.

The attached patch corrects this and is, I believe, trivially correct.

        Daniel


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: browse-url patch --]
[-- Type: text/x-patch, Size: 691 bytes --]

Index: lisp/gnus-art.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/gnus-art.el,v
retrieving revision 5.89
diff -u -r5.89 gnus-art.el
--- lisp/gnus-art.el	1999/11/07 03:26:48	5.89
+++ lisp/gnus-art.el	1999/11/17 00:16:13
@@ -4388,7 +4388,9 @@
   ;; In Emacs 20, `browse-url-browser-function' may be an alist.
   (if (listp browse-url-browser-function)
       (browse-url address)
-    (funcall browse-url-browser-function address)))
+    (funcall browse-url-browser-function address 
+	     (and (boundp browse-url-new-window-p)
+		  browse-url-new-window-p))))
 
 (defun gnus-button-embedded-url (address)
   "Browse ADDRESS."

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


-- 
Any form of power without responsibility, without direct and formal checks and
balances, is frightening to people -- and reasonably so. It should be frankly
admitted that hackers are frightening, and that the basis of this fear is not
irrational.
        -- Bruce Sterling

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: URL buttons and new browser windows...
  1999-11-17  0:19 URL buttons and new browser windows Daniel Pittman
@ 1999-11-17  0:32 ` William M. Perry
  1999-11-17  0:43   ` Daniel Pittman
  1999-11-17 11:51   ` Toby Speight
  0 siblings, 2 replies; 8+ messages in thread
From: William M. Perry @ 1999-11-17  0:32 UTC (permalink / raw)


Daniel Pittman <daniel@danann.net> writes:

> Given that I am often on a relatively slow connection, I tend to use my
> web browser as a background process--create a new window for an URL, do
> something for a while and then go and read it.
> 
> This is fairly trivial to do and works well with the XEmacs 'browse-url'
> library and 'browse-url-new-window-p' set to 't'. This should cause the
> package to open a new window when a URL is visited.
> 
> pGnus in the article buttonization code does not use the top level
> entry-point for 'browse-url' but rather directly calls the selected
> function (browse.*netscape) in my case :)
> 
> The problem is that gnus did not respect the setting of
> 'browse-url-new-window-p' which was annoying to me.
> 
> The attached patch corrects this and is, I believe, trivially correct.

I'd vote for Gnus to just use browse-url... why on earth is it trying to
call the browse-url-browser-function directly?  That seems kind of... uh,
silly?

-Bill P.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: URL buttons and new browser windows...
  1999-11-17  0:32 ` William M. Perry
@ 1999-11-17  0:43   ` Daniel Pittman
  1999-11-17 11:51   ` Toby Speight
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Pittman @ 1999-11-17  0:43 UTC (permalink / raw)


On 16 Nov 1999, William M. Perry <wmperry@aventail.com> wrote:

> Daniel Pittman <daniel@danann.net> writes:

[...]

>> The problem is that gnus did not respect the setting of
>> 'browse-url-new-window-p' which was annoying to me.
>> 
>> The attached patch corrects this and is, I believe, trivially
>> correct.
> 
> I'd vote for Gnus to just use browse-url... why on earth is it trying
> to call the browse-url-browser-function directly? That seems kind
> of... uh, silly?

Well, so would I, but I presumed that there was actually a good[1]
reason that Larsi and company had done it this way. Or something.

        Daniel


Footnotes: 
[1]  I typo-ed this as 'god' the first time. Maybe not inappropriate ;)

-- 
We had the experience but missed the meaning.
        --  T.S. Eliot, _The Dry Salvages_


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: URL buttons and new browser windows...
  1999-11-17  0:32 ` William M. Perry
  1999-11-17  0:43   ` Daniel Pittman
@ 1999-11-17 11:51   ` Toby Speight
  1999-11-17 12:27     ` William M. Perry
  1 sibling, 1 reply; 8+ messages in thread
From: Toby Speight @ 1999-11-17 11:51 UTC (permalink / raw)


Bill> William M. Perry <URL:mailto:wmperry@aventail.com>

0> In article <86g0y6yn3a.fsf@megalith.bp.aventail.com>, Bill wrote:

Bill> I'd vote for Gnus to just use browse-url... why on earth is it
Bill> trying to call the browse-url-browser-function directly?  That
Bill> seems kind of... uh, silly?

Especially since it doesn't check for (listp browse-url-browser-function).

#> browse-url-browser-function's value is
#> (("\\.\\(gif\\jpe?g\\)" . browse-url-netscape)
#>  ("." . browse-url-w3))
#>
#>
#> Documentation:
#> *Function to display the current buffer in a WWW browser.
#> This is used by the `browse-url-at-point', `browse-url-at-mouse', and
#> `browse-url-of-file' commands.
#>
#> If the value is not a function it should be a list of pairs
#> (REGEXP . FUNCTION).  In this case the function called will be the one
#> associated with the first REGEXP which matches the current URL.  The
#> function is passed the URL and any other args of `browse-url'.  The last
#> regexp should probably be "." to specify a default browser.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: URL buttons and new browser windows...
  1999-11-17 11:51   ` Toby Speight
@ 1999-11-17 12:27     ` William M. Perry
  1999-11-17 14:03       ` David S. Goldberg
  1999-12-01 15:47       ` Lars Magne Ingebrigtsen
  0 siblings, 2 replies; 8+ messages in thread
From: William M. Perry @ 1999-11-17 12:27 UTC (permalink / raw)
  Cc: The Gnus Mailing List

Toby Speight <Toby.Speight@streapadair.freeserve.co.uk> writes:

> Bill> William M. Perry <URL:mailto:wmperry@aventail.com>
> 
> 0> In article <86g0y6yn3a.fsf@megalith.bp.aventail.com>, Bill wrote:
> 
> Bill> I'd vote for Gnus to just use browse-url... why on earth is it
> Bill> trying to call the browse-url-browser-function directly?  That
> Bill> seems kind of... uh, silly?
> 
> Especially since it doesn't check for (listp browse-url-browser-function).

Well, it does do that, which is the really weird part:

(defun gnus-button-url (address)
  "Browse ADDRESS."
  ;; In Emacs 20, `browse-url-browser-function' may be an alist.
  (if (listp browse-url-browser-function)
      (browse-url address)
    (funcall browse-url-browser-function address)))

It does the 'right' thing if it is a list, but not if it is just a
function.  Deeply weird.

-bp


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: URL buttons and new browser windows...
  1999-11-17 12:27     ` William M. Perry
@ 1999-11-17 14:03       ` David S. Goldberg
  1999-11-17 14:42         ` Jan Vroonhof
  1999-12-01 15:47       ` Lars Magne Ingebrigtsen
  1 sibling, 1 reply; 8+ messages in thread
From: David S. Goldberg @ 1999-11-17 14:03 UTC (permalink / raw)


Somewhat off topic (for the list) but is it possible to have
browse-url-browser-function be a list in XEmacs 21.1.7?  That's one of
the few features I miss from Emacs.  It looks like the browse-url
included with the sumo tarball is old, but when I tried to use the one
from Emacs 20.3 XEmacs choked on it.  Is there an updated one that
works with XEmacs?

Thanks,
-- 
Dave Goldberg
Post: The Mitre Corporation\MS B325\202 Burlington Rd.\Bedford, MA 01730
Phone: 781-271-3887
Email: dsg@mitre.org


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: URL buttons and new browser windows...
  1999-11-17 14:03       ` David S. Goldberg
@ 1999-11-17 14:42         ` Jan Vroonhof
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Vroonhof @ 1999-11-17 14:42 UTC (permalink / raw)


dsg@mitre.org (David S. Goldberg) writes:

> included with the sumo tarball is old, but when I tried to use the one
> from Emacs 20.3 XEmacs choked on it.  Is there an updated one that
> works with XEmacs?

There will be a new one soon:

http://www.xemacs.org/list-archives/xemacs-patches/9911/msg00039.html

Jan


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: URL buttons and new browser windows...
  1999-11-17 12:27     ` William M. Perry
  1999-11-17 14:03       ` David S. Goldberg
@ 1999-12-01 15:47       ` Lars Magne Ingebrigtsen
  1 sibling, 0 replies; 8+ messages in thread
From: Lars Magne Ingebrigtsen @ 1999-12-01 15:47 UTC (permalink / raw)


wmperry@aventail.com (William M. Perry) writes:

> (defun gnus-button-url (address)
>   "Browse ADDRESS."
>   ;; In Emacs 20, `browse-url-browser-function' may be an alist.
>   (if (listp browse-url-browser-function)
>       (browse-url address)
>     (funcall browse-url-browser-function address)))
> 
> It does the 'right' thing if it is a list, but not if it is just a
> function.  Deeply weird.

I think it's a legacy thing from back when there was no `browse-url'
function.  I've now fixed this.

-- 
(domestic pets only, the antidote for overdose, milk.)
   larsi@gnus.org * Lars Magne Ingebrigtsen


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~1999-12-01 15:47 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-11-17  0:19 URL buttons and new browser windows Daniel Pittman
1999-11-17  0:32 ` William M. Perry
1999-11-17  0:43   ` Daniel Pittman
1999-11-17 11:51   ` Toby Speight
1999-11-17 12:27     ` William M. Perry
1999-11-17 14:03       ` David S. Goldberg
1999-11-17 14:42         ` Jan Vroonhof
1999-12-01 15:47       ` Lars Magne Ingebrigtsen

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 NNTP newsgroup(s).