1
;; help.jl -- commands for the help menu
2
;; $Id: help.jl,v 1.5 2000/09/11 07:44:42 john Exp $
4
;; Copyright (C) 2000 John Harper <john@dcs.warwick.ac.uk>
6
;; This file is part of sawmill.
8
;; sawmill is free software; you can redistribute it and/or modify it
9
;; under the terms of the GNU General Public License as published by
10
;; the Free Software Foundation; either version 2, or (at your option)
13
;; sawmill is distributed in the hope that it will be useful, but
14
;; WITHOUT ANY WARRANTY; without even the implied warranty of
15
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
;; GNU General Public License for more details.
18
;; You should have received a copy of the GNU General Public License
19
;; along with sawmill; see the file COPYING. If not, write to
20
;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
22
(define-structure sawfish.wm.commands.help
36
(define (help-call-info document node)
37
(system (format nil "xterm -e info '%s' '%s' >/dev/null 2>&1 </dev/null &"
40
(define (help-call-info-gnome document node)
41
(while (string-match " " node)
42
(setq node (concat (substring node 0 (match-start)) ?_
43
(substring node (match-end)))))
44
(system (format nil "gnome-help-browser 'info:%s#%s' >/dev/null 2>&1 </dev/null &"
47
(defvar help-display-info-function help-call-info)
51
(defvar display-url-command
52
"( netscape -remote 'openUrl(%s)' || netscape '%s' ) &"
53
"Shell command used to direct a web browser to load a url. Any `%s'
54
substrings will be replaced by the name of the url.")
56
(define (display-url url)
57
(let ((args (list url)))
59
(system (apply format nil display-url-command args))))
63
(define (show-faq) (help-display-info-function "sawfish" "FAQ"))
65
(define (show-news) (help-display-info-function "sawfish" "News"))
67
(define (show-programmer-manual)
68
(help-display-info-function "sawfish" "Top"))
70
(define (show-homepage) (display-url "http://sawmill.sourceforge.net/"))
73
(system (format nil "%s >/dev/null 2>&1 </dev/null &"
74
(expand-file-name "sawfish-about"
75
sawfish-exec-directory))))
78
(define-command 'help:show-faq show-faq)
79
(define-command 'help:show-news show-news)
80
(define-command 'help:show-programmer-manual show-programmer-manual)
81
(define-command 'help:show-homepage show-homepage)
82
(define-command 'help:about show-about))