Generic FunctionPackage: exclToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2. Moderate update since 8.2 release.
8.1 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-2012, Franz Inc. Oakland, CA., USA. All rights reserved.
Documentation for Allegro CL version 8.2. This page was not revised from the 8.1 page.
Created 2010.1.21.

ToCDocOverviewCGDocRelNotesFAQIndexPermutedIndex
Allegro CL version 8.2
Unrevised from 8.1 to 8.2. Moderate update since 8.2 release.
8.1 version