add command move-end-of-line
[lice.git] / src / emacs.lisp
blob620185586f2398f0728156e33e57ce107cb8ab93
1 (in-package "LICE")
3 ;; FIXME: figure out the system type
4 (defvar system-type :undefined
5 "Value is symbol indicating type of operating system you are using.
6 Special values:
7 `:gnu/linux' compiled for a GNU/Linux system.
8 `:darwin' compiled for Darwin (GNU-Darwin, Mac OS X, ...).
9 `:macos' compiled for Mac OS 9.
10 `:ms-dos' compiled as an MS-DOS application.
11 `:windows-nt' compiled as a native W32 application.
12 `:cygwin' compiled using the Cygwin library.
13 `:vax-vms' or
14 `:axp-vms' compiled for a (Open)VMS system.
15 Anything else indicates some sort of Unix system. */);
16 Vsystem_type = intern (SYSTEM_TYPE")
18 (defvar kill-emacs-hook nil
19 "Hook to be run when kill-emacs is called.
20 Since `kill-emacs' may be invoked when the terminal is disconnected (or
21 in other similar situations), functions placed on this hook should not
22 expect to be able to interact with the user. To ask for confirmation,
23 see `kill-emacs-query-functions' instead.
25 The hook is not run in batch mode, i.e., if `noninteractive' is non-nil.")
27 (defun kill-emacs (&optional arg)
28 "Exit the Emacs job and kill it.
29 If ARG is an integer, return ARG as the exit program code.
30 If ARG is a string, stuff it as keyboard input.
32 The value of `kill-emacs-hook', if not void,
33 is a list of functions (of no args),
34 all of which are called before Emacs is actually killed."
35 (run-hooks 'kill-emacs-hook)
36 (throw 'lice-quit arg))