[sawfish] improved `browser' -- replace display-url by `browser'



commit 96f49efef99b3e820f308091e60f7573b3a5f501
Author: chrisb <zanghar freenet de>
Date:   Wed Sep 2 21:54:00 2009 +0200

    improved `browser' -- replace display-url by `browser'

 lisp/sawfish/wm/commands/help.jl |   12 ++----------
 lisp/sawfish/wm/commands/user.jl |   11 +++++++----
 2 files changed, 9 insertions(+), 14 deletions(-)
---
diff --git a/lisp/sawfish/wm/commands/help.jl b/lisp/sawfish/wm/commands/help.jl
index d87a3d6..871d1c0 100644
--- a/lisp/sawfish/wm/commands/help.jl
+++ b/lisp/sawfish/wm/commands/help.jl
@@ -21,8 +21,7 @@
 
 (define-structure sawfish.wm.commands.help
 
-    (export display-url
-	    help-call-info)
+    (export help-call-info)
 
     (open rep
 	  rep.system
@@ -39,13 +38,6 @@
 
   (defvar help-display-info-function help-call-info)
 
-  ;; WWW
-
-  (define (display-url url)
-    (let ((args (list url)))
-      (rplacd args args)
-      (system (apply format nil browser-program args))))
-
   ;; Commands
 
   (define (show-faq) (help-display-info-function "sawfish" "FAQ"))
@@ -55,7 +47,7 @@
   (define (show-programmer-manual)
     (help-display-info-function "sawfish" "Top"))
 
-  (define (show-homepage) (display-url "http://sawfish.sourceforge.net/";))
+  (define (show-homepage) (browser "http://sawfish.sourceforge.net/";))
 
   (define (show-about)
     (system (format nil "%s >/dev/null 2>&1 </dev/null &"
diff --git a/lisp/sawfish/wm/commands/user.jl b/lisp/sawfish/wm/commands/user.jl
index dfc1c1e..a0966f3 100644
--- a/lisp/sawfish/wm/commands/user.jl
+++ b/lisp/sawfish/wm/commands/user.jl
@@ -57,13 +57,16 @@
     (if (not command)
 	(system (format nil "%s >/dev/null 2>&1 </dev/null &"
 			xterm-program))
-      (system (format nil "%s -e %s >/dev/null 2>&1 </dev/null&"
+      (system (format nil "%s -e %s >/dev/null 2>&1 </dev/null &"
 		      xterm-program command))))
 
-  (define (browser)
+  (define (browser #!optional website)
     "Start a new browser instance"
-    (system (format nil "%s >/dev/null 2>&1 </dev/null &"
-			browser-program)))
+    (if (not website)
+        (system (format nil "%s >/dev/null 2>&1 </dev/null &"
+			browser-program))
+      (system (format nil "%s %s >/dev/null 2>&1 </dev/null &"
+                      browser-program website))))
 
   (defvar clipboard-preview-clip-length 60)
   (defvar clipboard-preview-timeout 5)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]