Gnus development mailing list
 help / color / mirror / Atom feed
* Getting Gnus and TM to respect browse-url-new-window-p
@ 1996-11-07 22:15 David S. Goldberg
  0 siblings, 0 replies; only message in thread
From: David S. Goldberg @ 1996-11-07 22:15 UTC (permalink / raw)


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

I use fvwm and keep a netscape in it's own page.  I was finding it
annoying to have to jump to that page whenever I clicked on a URL,
especially since I typically don't follow many, if any, links from it.
I check out the page and go back to reading news.  I looked through
the browse-url source and found the variable browse-url-new-window-p,
which causes the page to be opened in a new netscape window.  This is
nice because the netscape window opens on my page and I can just close
it when I'm done with it.  Unfortunately, browse-url-browser-netscape
(and the other browse-url-browser functions) only respect it if
they're called interactively, which is not the case when you click on
a URL.  Attached are two patches that solve this for me, one for TM
7.93 and one for Red Gnus 0.55.  If you use both TM and Gnus, and have
gnus-strict-mime set to nil the you'll only need the TM patch since
the TM overrides the Gnus functions.

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


[-- Attachment #2: tm-def.patch --]
[-- Type: application/octet-stream, Size: 1239 bytes --]

*** tm-def.el~	Thu Nov  7 15:32:31 1996
--- tm-def.el	Thu Nov  7 15:32:31 1996
***************
*** 151,161 ****
    "\\(http\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]")
  
  (defvar browse-url-browser-function nil)
  
  (defun tm:browse-url (&optional url)
    (if (fboundp browse-url-browser-function)
        (if url 
!         (funcall browse-url-browser-function url)
        (call-interactively browse-url-browser-function))
      (if (fboundp tm:mother-button-dispatcher)
  	(call-interactively tm:mother-button-dispatcher)
--- 151,162 ----
    "\\(http\\|ftp\\|file\\|gopher\\|news\\|telnet\\|wais\\|mailto\\):\\(//[-a-zA-Z0-9_.]+:[0-9]*\\)?[-a-zA-Z0-9_=?#$@~`%&*+|\\/.,]*[-a-zA-Z0-9_=#$@~`%&*+|\\/]")
  
  (defvar browse-url-browser-function nil)
+ (defvar browse-url-new-window-p nil)
  
  (defun tm:browse-url (&optional url)
    (if (fboundp browse-url-browser-function)
        (if url 
!         (funcall browse-url-browser-function url browse-url-new-window-p)
        (call-interactively browse-url-browser-function))
      (if (fboundp tm:mother-button-dispatcher)
  	(call-interactively tm:mother-button-dispatcher)


[-- Attachment #3: gnus-art.patch --]
[-- Type: application/octet-stream, Size: 1113 bytes --]

*** gnus-art.el~	Thu Nov  7 16:07:10 1996
--- gnus-art.el	Thu Nov  7 16:07:11 1996
***************
*** 1945,1951 ****
  
  (defun gnus-button-url (address)
    "Browse ADDRESS."
!   (funcall browse-url-browser-function address))
  
  ;;; Next/prev buttons in the article buffer.
  
--- 1945,1951 ----
  
  (defun gnus-button-url (address)
    "Browse ADDRESS."
!   (funcall browse-url-browser-function address browse-url-new-window-p))
  
  ;;; Next/prev buttons in the article buffer.
*** widget-edit.el~	Thu Nov  7 16:06:39 1996
--- widget-edit.el	Thu Nov  7 16:06:39 1996
***************
*** 829,835 ****
  (defun widget-url-link-action (widget &optional event)
    "Open the url specified by WIDGET."
    (require 'browse-url)
!   (funcall browse-url-browser-function (widget-value widget)))
  
  ;;; The `editable-field' Widget.
  
--- 829,836 ----
  (defun widget-url-link-action (widget &optional event)
    "Open the url specified by WIDGET."
    (require 'browse-url)
!   (funcall browse-url-browser-function (widget-value widget)
! 	   browse-url-new-window-p))
  
  ;;; The `editable-field' Widget.
  

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1996-11-07 22:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-11-07 22:15 Getting Gnus and TM to respect browse-url-new-window-p David S. Goldberg

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).