(set! hook/process-command-line
(lambda (line)
(processor
- (list->vector
- (start-gtk program-name (vector->list line)))))))))
-
-(define (start-gtk name args)
- (if (let ((s (get-environment-variable "DISPLAY")))
- (and (string? s) (not (string-null? s))))
- (let ((path (system-library-pathname "gtk-shim.so" #f)))
- (if path
- (if (file-loadable? path)
- (start-gtk* name args)
- (begin
- (warn "Gtk shim not loadable")
- args))
- (begin
- (warn "No Gtk shim")
- args)))
- (begin
- (warn "DISPLAY not set")
- args)))
+ (let ((val (ignore-errors
+ (lambda ()
+ (start-gtk program-name (vector->list line))))))
+ (if (condition? val)
+ (begin
+ (warn val)
+ line)
+ (list->vector val)))))))))
+
+ (define (start-gtk name args)
+ (if (let ((s (get-environment-variable "DISPLAY")))
+ (and (string? s) (not (string-null? s))))
+ (let ((path (system-library-pathname "gtk-shim.so" #f)))
+ (if path
+ (if (file-loadable? path)
+ (start-gtk* name args)
+ (error "Gtk shim not loadable."))
+ (error "No Gtk shim")))
+ (error "DISPLAY not set")))
(define (start-gtk* name args)
;; Call start_gtk. Signals an error if gtk_init_check returns 0.