home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / share / guile / 1.6 / ice-9 / slib.scm < prev    next >
Encoding:
Text File  |  2006-06-19  |  3.6 KB  |  79 lines

  1. ;;;; slib.scm --- SLIB interface shim
  2. ;;;;
  3. ;;;;    Copyright (C) 1997, 1998, 2000, 2001, 2002, 2003, 2004, 2006 Free Software Foundation, Inc.
  4. ;;;;
  5. ;;;; This file is part of GUILE.
  6. ;;;; 
  7. ;;;; GUILE is free software; you can redistribute it and/or modify it
  8. ;;;; under the terms of the GNU General Public License as published by
  9. ;;;; the Free Software Foundation; either version 2, or (at your
  10. ;;;; option) any later version.
  11. ;;;; 
  12. ;;;; GUILE is distributed in the hope that it will be useful, but
  13. ;;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  15. ;;;; General Public License for more details.
  16. ;;;; 
  17. ;;;; You should have received a copy of the GNU General Public License
  18. ;;;; along with GUILE; see the file COPYING.  If not, write to the
  19. ;;;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  20. ;;;; Boston, MA 02110-1301 USA
  21. ;;;;
  22. ;;;; As a special exception, the Free Software Foundation gives permission
  23. ;;;; for additional uses of the text contained in its release of GUILE.
  24. ;;;;
  25. ;;;; The exception is that, if you link the GUILE library with other files
  26. ;;;; to produce an executable, this does not by itself cause the
  27. ;;;; resulting executable to be covered by the GNU General Public License.
  28. ;;;; Your use of that executable is in no way restricted on account of
  29. ;;;; linking the GUILE library code into it.
  30. ;;;;
  31. ;;;; This exception does not however invalidate any other reasons why
  32. ;;;; the executable file might be covered by the GNU General Public License.
  33. ;;;;
  34. ;;;; This exception applies only to the code released by the
  35. ;;;; Free Software Foundation under the name GUILE.  If you copy
  36. ;;;; code from other Free Software Foundation releases into a copy of
  37. ;;;; GUILE, as the General Public License permits, the exception does
  38. ;;;; not apply to the code that you add in this way.  To avoid misleading
  39. ;;;; anyone as to the status of such modified files, you must delete
  40. ;;;; this exception notice from them.
  41. ;;;;
  42. ;;;; If you write modifications of your own for GUILE, it is your choice
  43. ;;;; whether to permit this exception to apply to your modifications.
  44. ;;;; If you do not wish that, delete this exception notice.
  45. ;;;;
  46.  
  47. (if (and (defined? '*guile-use-old-ice-9-slib*) *guile-use-old-ice-9-slib*)
  48.     (load-from-path "ice-9/slib-old.scm")
  49.     (begin
  50.       
  51.       ;; The goal here is to eventually *only* rely on guile.init and
  52.       ;; communicate any needed fixes upstream, but for now, we still
  53.       ;; need to do a bit of the work here.
  54.       ;;
  55.       ;; At some point, we will probably just want to require a "new
  56.       ;; enough" version of slib (perhaps with Guile 1.8).  In that
  57.       ;; case, we'll probably just load guile.init, and then test the
  58.       ;; version.
  59.  
  60.       ;; These can be removed if/when we require a "new enough"
  61.       ;; version of SLIB.
  62.       (define-module (ice-9 slib))
  63.       (provide 'hash)
  64.  
  65.       (load-from-path "slib/init/guile.init")
  66.  
  67.       ;; This can be removed if/when we require a "new enough" version of SLIB.
  68.       (if (not (defined? 'browse-url))
  69.           ;; Nothing special to do for this, so straight from
  70.           ;; Template.scm.  Maybe "sensible-browser" for a debian
  71.           ;; system would be worth trying too (and would be good on a
  72.           ;; tty).
  73.           (define-public (browse-url url)
  74.             (define (try cmd end) (zero? (system (string-append cmd url end))))
  75.             (or (try "netscape-remote -remote 'openURL(" ")'")
  76.                 (try "netscape -remote 'openURL(" ")'")
  77.                 (try "netscape '" "'&")
  78.                 (try "netscape '" "'"))))))
  79.