Generic FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version

console-close

Arguments: console-check

Methods on this generic function are called when the close box on the Console window in Allegro CL on Windows is clicked and that action causes Lisp or the Lisp application to exit. Pressing the Alt-F4 keys when the console window is selected and choosing Exit Lisp from the tray icon menu are equivalent actions and trigger the methods whenever clicking the close button would.

See the function console-control, which allows you to specify what action clicking the close box should have (exit the application, minimize the console, hide the console, or nothing).

console-close methods are primarily intended to affect the action when the close box is clicked for the purpose of exiting Lisp, particularly when using the Integrated Development Environment or an application developed for Windows where the console is used. (You might want to ensure files are saved, or you might want to display a confirmation window, etc.)

On Unix, there is no Console window and the default method simply calls exit.

On Windows, the default action of console-close is to call (excl::mp-safe-exit 0).This causes Lisp to exit, unless errors occur during the stack unwinding process preceding the exit. If the exiting process gets hung up due to errors, then the user can try to close the Console again and this time the whole Lisp process will exit without trying to clean up the Lisp threads.

For example, the following code will cause the close of the Console to be ignored:

(defmethod excl:console-close :around (x)
 (setf (sys::memref-int x 0 0 :unsigned-natural) 1))

An application can put an :around or :before method on console-close to change the default behavior. The argument passed in is the address of the flag which determines whether to call console-close the next time the Close button is clicked.

The default value is zero, meaning don't call console-close again. Set the flag to a non-zero value to cause console-close to be called again.


Copyright (c) 1998-2019, Franz Inc. Oakland, CA., USA. All rights reserved.
This page was not revised from the 8.2 page.
Created 2012.5.30.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 9.0
Unrevised from 8.2 to 9.0.
8.2 version