Commit 0873511b authored by Iban Hatchondo's avatar Iban Hatchondo
Browse files

clean up.

turned in eclipse-internal-loop the handler-bind for a handler-case.
some error handlers had been modified.
parent b4c432b8
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: eclipse.lisp,v 1.12 2003/12/02 19:07:06 ihatchondo Exp $
;;; $Id: eclipse.lisp,v 1.13 2003/12/03 14:34:34 ihatchondo Exp $
;;;
;;; ECLIPSE. The Common Lisp Window Manager.
;;; Copyright (C) 2002 Iban HATCHONDO
......@@ -72,7 +72,7 @@
'(:substructure-redirect :button-press :button-release
:focus-change :key-release :substructure-notify
:owner-grab-button :key-press :enter-window :leave-window))
(xlib:display-finish-output display)))
(xlib:display-finish-output display)))
;; Notify all the other X clients of the new manager.
(xlib:send-event root-window
......
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: misc.lisp,v 1.14 2003/11/19 10:29:08 ihatchondo Exp $
;;; $Id: misc.lisp,v 1.15 2003/11/28 10:13:47 ihatchondo Exp $
;;;
;;; This file is part of Eclipse.
;;; Copyright (C) 2002 Iban HATCHONDO
......@@ -64,12 +64,8 @@
(finish-output *stderr*)))
,(unless return `(throw ',(or throw type) ,@(or body '(nil))))))
(make-error-handler (already-handled-xerror :verbose nil :throw general-error))
(make-error-handler (general-error))
(make-error-handler (invalid-wm-property))
(make-error-handler (error :return t))
(make-error-handler (end-of-file :throw end))
(make-error-handler (wrong-name :verbose nil)
(timed-message-box *root-window* "Wrong application name"))
;;;; Property readers.
;; They are not defined in the clx-ext package, because we customize them
......@@ -256,9 +252,10 @@
run the program named `program' with arguments `arguments'. If the
invocation failed a pop-up window will appear reporting the error."
(lambda ()
(catch 'wrong-name
(handler-bind ((error #'handle-wrong-name-condition))
(%run-program% program arguments)))))
(handler-case (%run-program% program arguments)
(error (c)
(declare (ignore c))
(timed-message-box *root-window* "Wrong application name")))))
(defun make-viewport-property (n)
(make-list (* 2 n) :initial-element 0))
......
;;; -*- Mode: Lisp; Package: ECLIPSE-INTERNALS -*-
;;; $Id: wm.lisp,v 1.26 2003/12/02 14:30:41 ihatchondo Exp $
;;; $Id: wm.lisp,v 1.27 2003/12/02 21:59:29 ihatchondo Exp $
;;;
;;; ECLIPSE. The Common Lisp Window Manager.
;;; Copyright (C) 2000, 2001, 2002 Iban HATCHONDO
......@@ -709,9 +709,11 @@
;;;; The main loop.
(define-condition exit-eclipse (error) ())
(defun eclipse-internal-loop ()
(let ((exit 0)
(time))
(let* ((exit 0)
(time))
;; Sets the root window pop-up menu
(when *menu-1-exit-p*
......@@ -749,19 +751,20 @@
;; Main loop
(loop
(catch 'general-error
(handler-bind ((end-of-file #'handle-end-of-file-condition)
(already-handled-xerror
#'handle-already-handled-xerror-condition)
(error #'handle-general-error-condition))
(let ((event (get-next-event *display* :discard-p t :timeout 2)))
(when event
(with-slots (event-window) event
(event-process event (lookup-widget event-window)))))
(when pt:preprogrammed-tasks (pt:execute-preprogrammed-tasks))
(case exit
(1 (when *close-display-p*
(loop for val being each hash-value in *widget-table*
do (close-widget val)))
(setf time 10 exit 2))
(2 (return))))))
(format t "Main loop exited~%")))
(handler-case
(let ((event (get-next-event *display* :discard-p t :timeout 2)))
(when event
(with-slots (event-window) event
(event-process event (lookup-widget event-window))))
(when pt:preprogrammed-tasks (pt:execute-preprogrammed-tasks))
(case exit
(1 (when *close-display-p*
(loop for val being each hash-value in *widget-table*
do (close-widget val)))
(setf time 10 exit 2))
(2 (return))))
(exit-eclipse () (setf exit 1))
(end-of-file (c) (handle-end-of-file-condition c))
(already-handled-xerror () nil)
(error (c) (handle-error-condition c)))))
(format t "~%Main loop exited~%")))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment