237 |
This normal hook is run, once, just after loading all the init files |
This normal hook is run, once, just after loading all the init files |
238 |
(the user's init file, @file{default.el}, and/or @file{site-start.el}), |
(the user's init file, @file{default.el}, and/or @file{site-start.el}), |
239 |
before loading the terminal-specific library and processing the |
before loading the terminal-specific library and processing the |
240 |
command-line arguments. |
command-line action arguments. |
241 |
@end defvar |
@end defvar |
242 |
|
|
243 |
@defvar emacs-startup-hook |
@defvar emacs-startup-hook |
248 |
|
|
249 |
@defvar user-init-file |
@defvar user-init-file |
250 |
@tindex user-init-file |
@tindex user-init-file |
251 |
This variable holds the file name of the user's init file. If the |
This variable holds the absolute file name of the user's init file. If the |
252 |
actual init file loaded is a compiled file, such as @file{.emacs.elc}, |
actual init file loaded is a compiled file, such as @file{.emacs.elc}, |
253 |
the value refers to the corresponding source file. |
the value refers to the corresponding source file. |
254 |
@end defvar |
@end defvar |
471 |
Emacs inadvertently can lose a lot of work, Emacs queries for |
Emacs inadvertently can lose a lot of work, Emacs queries for |
472 |
confirmation before actually terminating if you have buffers that need |
confirmation before actually terminating if you have buffers that need |
473 |
saving or subprocesses that are running. This is done in the function |
saving or subprocesses that are running. This is done in the function |
474 |
@code{save-buffers-kill-emacs}. |
@code{save-buffers-kill-emacs}, the higher level function from which |
475 |
|
@code{kill-emacs} is usually called. |
476 |
|
|
477 |
@defvar kill-emacs-query-functions |
@defvar kill-emacs-query-functions |
478 |
After asking the standard questions, @code{save-buffers-kill-emacs} |
After asking the standard questions, @code{save-buffers-kill-emacs} |
479 |
calls the functions in the list @code{kill-emacs-query-functions}, in |
calls the functions in the list @code{kill-emacs-query-functions}, in |
480 |
order of appearance, with no arguments. These functions can ask for |
order of appearance, with no arguments. These functions can ask for |
481 |
additional confirmation from the user. If any of them returns |
additional confirmation from the user. If any of them returns |
482 |
@code{nil}, Emacs is not killed. |
@code{nil}, @code{save-buffers-kill-emacs} does not kill Emacs, and |
483 |
|
does not run the remaining functions in this hook. Calling |
484 |
|
@code{kill-emacs} directly does not run this hook. |
485 |
@end defvar |
@end defvar |
486 |
|
|
487 |
@defvar kill-emacs-hook |
@defvar kill-emacs-hook |
488 |
This variable is a normal hook; once @code{save-buffers-kill-emacs} is |
This variable is a normal hook; once @code{save-buffers-kill-emacs} is |
489 |
finished with all file saving and confirmation, it runs the functions in |
finished with all file saving and confirmation, it calls |
490 |
this hook. This hook is not run in batch mode. |
@code{kill-emacs} which runs the functions in this hook. |
491 |
|
@code{kill-emacs} does not run this hook in batch mode. |
492 |
|
|
493 |
|
@code{kill-emacs} may be invoked directly (that is not via |
494 |
|
@code{save-buffers-kill-emacs}) if the terminal is disconnected, or in |
495 |
|
similar situations where interaction with the user is not possible. |
496 |
|
Thus, if your hook needs to interact with the user, put it on |
497 |
|
@code{kill-emacs-query-functions}; if it needs to run regardless of |
498 |
|
how Emacs is killed, put it on @code{kill-emacs-hook}. |
499 |
@end defvar |
@end defvar |
500 |
|
|
501 |
@node Suspending Emacs |
@node Suspending Emacs |
519 |
different window. Therefore, suspending is not allowed when Emacs is using |
different window. Therefore, suspending is not allowed when Emacs is using |
520 |
a window system (X or MS Windows). |
a window system (X or MS Windows). |
521 |
|
|
522 |
@defun suspend-emacs string |
@defun suspend-emacs &optional string |
523 |
This function stops Emacs and returns control to the superior process. |
This function stops Emacs and returns control to the superior process. |
524 |
If and when the superior process resumes Emacs, @code{suspend-emacs} |
If and when the superior process resumes Emacs, @code{suspend-emacs} |
525 |
returns @code{nil} to its caller in Lisp. |
returns @code{nil} to its caller in Lisp. |
553 |
(function (lambda () |
(function (lambda () |
554 |
(or (y-or-n-p |
(or (y-or-n-p |
555 |
"Really suspend? ") |
"Really suspend? ") |
556 |
(error "Suspend cancelled"))))) |
(error "Suspend canceled"))))) |
557 |
@result{} (lambda nil |
@result{} (lambda nil |
558 |
(or (y-or-n-p "Really suspend? ") |
(or (y-or-n-p "Really suspend? ") |
559 |
(error "Suspend cancelled"))) |
(error "Suspend canceled"))) |
560 |
@end group |
@end group |
561 |
@group |
@group |
562 |
(add-hook 'suspend-resume-hook |
(add-hook 'suspend-resume-hook |
705 |
@deffn Command getenv var |
@deffn Command getenv var |
706 |
@cindex environment variable access |
@cindex environment variable access |
707 |
This function returns the value of the environment variable @var{var}, |
This function returns the value of the environment variable @var{var}, |
708 |
as a string. Within Emacs, the environment variable values are kept in |
as a string. @var{var} should be a string. If @var{var} is undefined |
709 |
the Lisp variable @code{process-environment}. |
in the environment, @code{getenv} returns @code{nil}. If returns |
710 |
|
@samp{""} if @var{var} is set but null. Within Emacs, the environment |
711 |
|
variable values are kept in the Lisp variable @code{process-environment}. |
712 |
|
|
713 |
@example |
@example |
714 |
@group |
@group |
730 |
@end deffn |
@end deffn |
731 |
|
|
732 |
@c Emacs 19 feature |
@c Emacs 19 feature |
733 |
@deffn Command setenv variable value |
@deffn Command setenv variable &optional value |
734 |
This command sets the value of the environment variable named |
This command sets the value of the environment variable named |
735 |
@var{variable} to @var{value}. Both arguments should be strings. This |
@var{variable} to @var{value}. @var{variable} should be a string. |
736 |
function works by modifying @code{process-environment}; binding that |
Internally, Emacs Lisp can handle any string. However, normally |
737 |
variable with @code{let} is also reasonable practice. |
@var{variable} should be a valid shell identifier, that is, a sequence |
738 |
|
of letters, digits and underscores, starting with a letter or |
739 |
|
underscore. Otherwise, errors may occur if subprocesses of Emacs try |
740 |
|
to access the value of @var{variable}. If @var{value} is omitted or |
741 |
|
@code{nil}, @code{setenv} removes @var{variable} from the environment. |
742 |
|
Otherwise, @var{value} should be a string. |
743 |
|
|
744 |
|
@code{setenv} works by modifying @code{process-environment}; binding |
745 |
|
that variable with @code{let} is also reasonable practice. |
746 |
|
|
747 |
|
@code{setenv} returns the new value of @var{variable}, or @code{nil} |
748 |
|
if it removed @var{variable} from the environment. |
749 |
@end deffn |
@end deffn |
750 |
|
|
751 |
@defvar process-environment |
@defvar process-environment |
825 |
installing Emacs as setuid or setgid so that it can read kernel |
installing Emacs as setuid or setgid so that it can read kernel |
826 |
information, and that usually isn't advisable. |
information, and that usually isn't advisable. |
827 |
|
|
828 |
|
If the 1-minute load average is available, but the 5- or 15-minute |
829 |
|
averages are not, this function returns a shortened list containing |
830 |
|
the available averages. |
831 |
|
|
832 |
@example |
@example |
833 |
@group |
@group |
834 |
(load-average) |
(load-average) |
848 |
@end defun |
@end defun |
849 |
|
|
850 |
@defun emacs-pid |
@defun emacs-pid |
851 |
This function returns the process @acronym{ID} of the Emacs process. |
This function returns the process @acronym{ID} of the Emacs process, |
852 |
|
as an integer. |
853 |
@end defun |
@end defun |
854 |
|
|
855 |
@defvar tty-erase-char |
@defvar tty-erase-char |
856 |
This variable holds the erase character that was selected |
This variable holds the erase character that was selected |
857 |
in the system's terminal driver, before Emacs was started. |
in the system's terminal driver, before Emacs was started. |
858 |
|
The value is @code{nil} if Emacs is running under a window system. |
859 |
@end defvar |
@end defvar |
860 |
|
|
861 |
@defun setprv privilege-name &optional setp getprv |
@defun setprv privilege-name &optional setp getprv |
866 |
@code{nil}. The function returns @code{t} if successful, @code{nil} |
@code{nil}. The function returns @code{t} if successful, @code{nil} |
867 |
otherwise. |
otherwise. |
868 |
|
|
869 |
If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv} |
If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv} |
870 |
does not change the privilege, but returns @code{t} or @code{nil} |
does not change the privilege, but returns @code{t} or @code{nil} |
871 |
indicating whether the privilege is currently enabled. |
indicating whether the privilege is currently enabled. |
872 |
@end defun |
@end defun |
875 |
@section User Identification |
@section User Identification |
876 |
|
|
877 |
@defvar init-file-user |
@defvar init-file-user |
878 |
This variable says which user's init files should be used by Emacs---or |
This variable says which user's init files should be used by |
879 |
@code{nil} if none. The value reflects command-line options such as |
Emacs---or @code{nil} if none. @code{""} stands for the user who |
880 |
|
originally logged in. The value reflects command-line options such as |
881 |
@samp{-q} or @samp{-u @var{user}}. |
@samp{-q} or @samp{-u @var{user}}. |
882 |
|
|
883 |
Lisp packages that load files of customizations, or any other sort of |
Lisp packages that load files of customizations, or any other sort of |
904 |
on the effective @acronym{UID}, not the real @acronym{UID}. |
on the effective @acronym{UID}, not the real @acronym{UID}. |
905 |
|
|
906 |
If you specify @var{uid}, the value is the user name that corresponds |
If you specify @var{uid}, the value is the user name that corresponds |
907 |
to @var{uid} (which should be an integer). |
to @var{uid} (which should be an integer), or @code{nil} if there is |
908 |
|
no such user. |
909 |
|
|
910 |
@example |
@example |
911 |
@group |
@group |
936 |
If the Emacs job's user-id does not correspond to any known user (and |
If the Emacs job's user-id does not correspond to any known user (and |
937 |
provided @code{NAME} is not set), the value is @code{"unknown"}. |
provided @code{NAME} is not set), the value is @code{"unknown"}. |
938 |
|
|
939 |
If @var{uid} is non-@code{nil}, then it should be an integer (a user-id) |
If @var{uid} is non-@code{nil}, then it should be a number (a user-id) |
940 |
or a string (a login name). Then @code{user-full-name} returns the full |
or a string (a login name). Then @code{user-full-name} returns the full |
941 |
name corresponding to that user-id or login name. If you specify a |
name corresponding to that user-id or login name. If you specify a |
942 |
user-id or login name that isn't defined, it returns @code{nil}. |
user-id or login name that isn't defined, it returns @code{nil}. |
988 |
instead of the current time. The argument should be a list whose first |
instead of the current time. The argument should be a list whose first |
989 |
two elements are integers. Thus, you can use times obtained from |
two elements are integers. Thus, you can use times obtained from |
990 |
@code{current-time} (see below) and from @code{file-attributes} |
@code{current-time} (see below) and from @code{file-attributes} |
991 |
(@pxref{File Attributes}). |
(@pxref{Definition of file-attributes}). @var{time-value} can also be |
992 |
|
a cons of two integers, but this is considered obsolete. |
993 |
|
|
994 |
@example |
@example |
995 |
@group |
@group |
1004 |
This function returns the system's time value as a list of three |
This function returns the system's time value as a list of three |
1005 |
integers: @code{(@var{high} @var{low} @var{microsec})}. The integers |
integers: @code{(@var{high} @var{low} @var{microsec})}. The integers |
1006 |
@var{high} and @var{low} combine to give the number of seconds since |
@var{high} and @var{low} combine to give the number of seconds since |
1007 |
0:00 January 1, 1970 (local time), which is |
0:00 January 1, 1970 UTC (Coordinated Universal Time), which is |
1008 |
@ifnottex |
@ifnottex |
1009 |
@var{high} * 2**16 + @var{low}. |
@var{high} * 2**16 + @var{low}. |
1010 |
@end ifnottex |
@end ifnottex |
1017 |
the resolution of only one second). |
the resolution of only one second). |
1018 |
|
|
1019 |
The first two elements can be compared with file time values such as you |
The first two elements can be compared with file time values such as you |
1020 |
get with the function @code{file-attributes}. @xref{File Attributes}. |
get with the function @code{file-attributes}. |
1021 |
|
@xref{Definition of file-attributes}. |
1022 |
@end defun |
@end defun |
1023 |
|
|
1024 |
@c Emacs 19 feature |
@c Emacs 19 feature |
1035 |
adjustment, then the value is constant through time. |
adjustment, then the value is constant through time. |
1036 |
|
|
1037 |
If the operating system doesn't supply all the information necessary to |
If the operating system doesn't supply all the information necessary to |
1038 |
compute the value, both elements of the list are @code{nil}. |
compute the value, the unknown elements of the list are @code{nil}. |
1039 |
|
|
1040 |
The argument @var{time-value}, if given, specifies a time to analyze |
The argument @var{time-value}, if given, specifies a time to analyze |
1041 |
instead of the current time. The argument should be a cons cell |
instead of the current time. The argument should have the same form |
1042 |
containing two integers, or a list whose first two elements are |
as for @code{current-time-string} (see above). Thus, you can use |
1043 |
integers. Thus, you can use times obtained from @code{current-time} |
times obtained from @code{current-time} (see above) and from |
1044 |
(see above) and from @code{file-attributes} (@pxref{File Attributes}). |
@code{file-attributes}. @xref{Definition of file-attributes}. |
1045 |
@end defun |
@end defun |
1046 |
|
|
1047 |
@defun set-time-zone-rule tz |
@defun set-time-zone-rule tz |
1048 |
This function specifies the local time zone according to @var{tz}. If |
This function specifies the local time zone according to @var{tz}. If |
1049 |
@var{tz} is @code{nil}, that means to use an implementation-defined |
@var{tz} is @code{nil}, that means to use an implementation-defined |
1050 |
default time zone. If @var{tz} is @code{t}, that means to use |
default time zone. If @var{tz} is @code{t}, that means to use |
1051 |
Universal Time. |
Universal Time. Otherwise, @var{tz} should be a string specifying a |
1052 |
|
time zone rule. |
1053 |
@end defun |
@end defun |
1054 |
|
|
1055 |
@defun float-time &optional time-value |
@defun float-time &optional time-value |
1057 |
seconds since the epoch. The argument @var{time-value}, if given, |
seconds since the epoch. The argument @var{time-value}, if given, |
1058 |
specifies a time to convert instead of the current time. The argument |
specifies a time to convert instead of the current time. The argument |
1059 |
should have the same form as for @code{current-time-string} (see |
should have the same form as for @code{current-time-string} (see |
1060 |
above), and it also accepts the output of @code{current-time} and |
above). Thus, it accepts the output of @code{current-time} and |
1061 |
@code{file-attributes}. |
@code{file-attributes}. |
1062 |
|
|
1063 |
@emph{Warning}: Since the result is floating point, it may not be |
@emph{Warning}: Since the result is floating point, it may not be |
1071 |
to strings or to calendrical information. There is also a function to |
to strings or to calendrical information. There is also a function to |
1072 |
convert calendrical information to a time value. You can get time |
convert calendrical information to a time value. You can get time |
1073 |
values from the functions @code{current-time} (@pxref{Time of Day}) and |
values from the functions @code{current-time} (@pxref{Time of Day}) and |
1074 |
@code{file-attributes} (@pxref{File Attributes}). |
@code{file-attributes} (@pxref{Definition of file-attributes}). |
1075 |
|
|
1076 |
Many operating systems are limited to time values that contain 32 bits |
Many operating systems are limited to time values that contain 32 bits |
1077 |
of information; these systems typically handle only the times from |
of information; these systems typically handle only the times from |
1224 |
@table @var |
@table @var |
1225 |
@item seconds |
@item seconds |
1226 |
The number of seconds past the minute, as an integer between 0 and 59. |
The number of seconds past the minute, as an integer between 0 and 59. |
1227 |
|
On some operating systems, this is 60 for leap seconds. |
1228 |
@item minutes |
@item minutes |
1229 |
The number of minutes past the hour, as an integer between 0 and 59. |
The number of minutes past the hour, as an integer between 0 and 59. |
1230 |
@item hour |
@item hour |
1261 |
The optional argument @var{zone} defaults to the current time zone and |
The optional argument @var{zone} defaults to the current time zone and |
1262 |
its daylight savings time rules. If specified, it can be either a list |
its daylight savings time rules. If specified, it can be either a list |
1263 |
(as you would get from @code{current-time-zone}), a string as in the |
(as you would get from @code{current-time-zone}), a string as in the |
1264 |
@code{TZ} environment variable, or an integer (as you would get from |
@code{TZ} environment variable, @code{t} for Universal Time, or an |
1265 |
@code{decode-time}). The specified zone is used without any further |
integer (as you would get from @code{decode-time}). The specified |
1266 |
alteration for daylight savings time. |
zone is used without any further alteration for daylight savings time. |
1267 |
|
|
1268 |
If you pass more than seven arguments to @code{encode-time}, the first |
If you pass more than seven arguments to @code{encode-time}, the first |
1269 |
six are used as @var{seconds} through @var{year}, the last argument is |
six are used as @var{seconds} through @var{year}, the last argument is |
1345 |
timer to call a function that takes substantial time to run is likely |
timer to call a function that takes substantial time to run is likely |
1346 |
to be annoying. |
to be annoying. |
1347 |
|
|
1348 |
@defun run-at-time time repeat function &rest args |
@deffn Command run-at-time time repeat function &rest args |
1349 |
This function arranges to call @var{function} with arguments @var{args} |
This sets up a timer that calls the function @var{function} with |
1350 |
at time @var{time}. The argument @var{function} is a function to call |
arguments @var{args} at time @var{time}. If @var{repeat} is a number |
1351 |
later, and @var{args} are the arguments to give it when it is called. |
(integer or floating point), the timer also runs every @var{repeat} |
1352 |
The time @var{time} is specified as a string. |
seconds after that. If @var{repeat} is @code{nil}, the timer runs |
1353 |
|
only once. |
1354 |
|
|
1355 |
|
@var{time} may specify an absolute or a relative time. |
1356 |
|
|
1357 |
Absolute times may be specified in a wide variety of formats; this |
Absolute times may be specified in a wide variety of formats; this |
1358 |
function tries to accept all the commonly used date formats. Valid |
function tries to accept all the commonly used date formats. The most |
1359 |
formats include these two, |
convenient formats are strings. Valid such formats include these two, |
1360 |
|
|
1361 |
@example |
@example |
1362 |
@var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone} |
@var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone} |
1369 |
@code{current-time-string} returns is also allowed, and many others |
@code{current-time-string} returns is also allowed, and many others |
1370 |
as well. |
as well. |
1371 |
|
|
1372 |
To specify a relative time, use numbers followed by units. |
To specify a relative time as a string, use numbers followed by units. |
1373 |
For example: |
For example: |
1374 |
|
|
1375 |
@table @samp |
@table @samp |
1384 |
For relative time values, Emacs considers a month to be exactly thirty |
For relative time values, Emacs considers a month to be exactly thirty |
1385 |
days, and a year to be exactly 365.25 days. |
days, and a year to be exactly 365.25 days. |
1386 |
|
|
1387 |
If @var{time} is a number (integer or floating point), that specifies a |
Not all convenient formats are strings. If @var{time} is a number |
1388 |
relative time measured in seconds. |
(integer or floating point), that specifies a relative time measured |
1389 |
|
in seconds. |
|
The argument @var{repeat} specifies how often to repeat the call. If |
|
|
@var{repeat} is @code{nil}, there are no repetitions; @var{function} is |
|
|
called just once, at @var{time}. If @var{repeat} is a number, it |
|
|
specifies a repetition period measured in seconds. |
|
1390 |
|
|
1391 |
In most cases, @var{repeat} has no effect on when @emph{first} call |
In most cases, @var{repeat} has no effect on when @emph{first} call |
1392 |
takes place---@var{time} alone specifies that. There is one exception: |
takes place---@var{time} alone specifies that. There is one exception: |
1397 |
The function @code{run-at-time} returns a timer value that identifies |
The function @code{run-at-time} returns a timer value that identifies |
1398 |
the particular scheduled future action. You can use this value to call |
the particular scheduled future action. You can use this value to call |
1399 |
@code{cancel-timer} (see below). |
@code{cancel-timer} (see below). |
1400 |
@end defun |
@end deffn |
1401 |
|
|
1402 |
@defmac with-timeout (seconds timeout-forms@dots{}) body@dots{} |
@defmac with-timeout (seconds timeout-forms@dots{}) body@dots{} |
1403 |
Execute @var{body}, but give up after @var{seconds} seconds. If |
Execute @var{body}, but give up after @var{seconds} seconds. If |
1423 |
a timer to avoid waiting too long for an answer. @xref{Yes-or-No |
a timer to avoid waiting too long for an answer. @xref{Yes-or-No |
1424 |
Queries}. |
Queries}. |
1425 |
|
|
1426 |
@defun run-with-idle-timer secs repeat function &rest args |
@deffn Command run-with-idle-timer secs repeat function &rest args |
1427 |
Set up a timer which runs when Emacs has been idle for @var{secs} |
Set up a timer which runs when Emacs has been idle for @var{secs} |
1428 |
seconds. The value of @var{secs} may be an integer or a floating point |
seconds. The value of @var{secs} may be an integer or a floating point |
1429 |
number. |
number. |
1435 |
|
|
1436 |
The function @code{run-with-idle-timer} returns a timer value which you |
The function @code{run-with-idle-timer} returns a timer value which you |
1437 |
can use in calling @code{cancel-timer} (see below). |
can use in calling @code{cancel-timer} (see below). |
1438 |
@end defun |
@end deffn |
1439 |
|
|
1440 |
@cindex idleness |
@cindex idleness |
1441 |
Emacs becomes ``idle'' when it starts waiting for user input, and it |
Emacs becomes ``idle'' when it starts waiting for user input, and it |
1461 |
@defun cancel-timer timer |
@defun cancel-timer timer |
1462 |
Cancel the requested action for @var{timer}, which should be a value |
Cancel the requested action for @var{timer}, which should be a value |
1463 |
previously returned by @code{run-at-time} or @code{run-with-idle-timer}. |
previously returned by @code{run-at-time} or @code{run-with-idle-timer}. |
1464 |
This cancels the effect of that call to @code{run-at-time}; the arrival |
This cancels the effect of that call to one of these functions; the |
1465 |
of the specified time will not cause anything special to happen. |
arrival of the specified time will not cause anything special to happen. |
1466 |
@end defun |
@end defun |
1467 |
|
|
1468 |
@node Terminal Input |
@node Terminal Input |
1485 |
@cindex input modes |
@cindex input modes |
1486 |
@cindex terminal input modes |
@cindex terminal input modes |
1487 |
|
|
1488 |
@defun set-input-mode interrupt flow meta quit-char |
@defun set-input-mode interrupt flow meta &optional quit-char |
1489 |
This function sets the mode for reading keyboard input. If |
This function sets the mode for reading keyboard input. If |
1490 |
@var{interrupt} is non-null, then Emacs uses input interrupts. If it is |
@var{interrupt} is non-null, then Emacs uses input interrupts. If it is |
1491 |
@code{nil}, then it uses @sc{cbreak} mode. The default setting is |
@code{nil}, then it uses @sc{cbreak} mode. The default setting is |
1558 |
@c Emacs 19 feature |
@c Emacs 19 feature |
1559 |
@defvar extra-keyboard-modifiers |
@defvar extra-keyboard-modifiers |
1560 |
This variable lets Lisp programs ``press'' the modifier keys on the |
This variable lets Lisp programs ``press'' the modifier keys on the |
1561 |
keyboard. The value is a bit mask: |
keyboard. The value is a character. Only the modifiers of the |
1562 |
|
character matter. Each time the user types a keyboard key, it is |
1563 |
@table @asis |
altered as if those modifier keys were held down. For instance, if |
1564 |
@item 1 |
you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all |
1565 |
The @key{SHIFT} key. |
keyboard input characters typed during the scope of the binding will |
1566 |
@item 2 |
have the control and meta modifiers applied to them. The character |
1567 |
The @key{LOCK} key. |
@code{?\C-@@}, equivalent to the integer 0, does not count as a control |
1568 |
@item 4 |
character for this purpose, but as a character with no modifiers. |
1569 |
The @key{CTL} key. |
Thus, setting @code{extra-keyboard-modifiers} to zero cancels any |
1570 |
@item 8 |
modification. |
|
The @key{META} key. |
|
|
@end table |
|
|
|
|
|
Each time the user types a keyboard key, it is altered as if the |
|
|
modifier keys specified in the bit mask were held down. |
|
1571 |
|
|
1572 |
When using a window system, the program can ``press'' any of the |
When using a window system, the program can ``press'' any of the |
1573 |
modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} |
modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} |
1574 |
keys can be virtually pressed. |
keys can be virtually pressed. |
1575 |
|
|
1576 |
|
Note that this variable applies only to events that really come from |
1577 |
|
the keyboard, and has no effect on mouse events or any other events. |
1578 |
@end defvar |
@end defvar |
1579 |
|
|
1580 |
@defvar keyboard-translate-table |
@defvar keyboard-translate-table |
1581 |
This variable is the translate table for keyboard characters. It lets |
This variable is the translate table for keyboard characters. It lets |
1582 |
you reshuffle the keys on the keyboard without changing any command |
you reshuffle the keys on the keyboard without changing any command |
1583 |
bindings. Its value is normally a char-table, or else @code{nil}. |
bindings. Its value is normally a char-table, or else @code{nil}. |
1584 |
|
(It can also be a string or vector, but this is considered obsolete.) |
1585 |
|
|
1586 |
If @code{keyboard-translate-table} is a char-table |
If @code{keyboard-translate-table} is a char-table |
1587 |
(@pxref{Char-Tables}), then each character read from the keyboard is |
(@pxref{Char-Tables}), then each character read from the keyboard is |
1621 |
character after it is read from the terminal. Record-keeping features |
character after it is read from the terminal. Record-keeping features |
1622 |
such as @code{recent-keys} and dribble files record the characters after |
such as @code{recent-keys} and dribble files record the characters after |
1623 |
translation. |
translation. |
1624 |
|
|
1625 |
|
Note also that this translation is done before the characters are |
1626 |
|
supplied to input methods (@pxref{Input Methods}). Use |
1627 |
|
@code{translation-table-for-input} (@pxref{Translation of Characters}), |
1628 |
|
if you want to translate characters after input methods operate. |
1629 |
@end defvar |
@end defvar |
1630 |
|
|
1631 |
@defun keyboard-translate from to |
@defun keyboard-translate from to |
1738 |
|
|
1739 |
Finally, if you have enabled keyboard character set decoding using |
Finally, if you have enabled keyboard character set decoding using |
1740 |
@code{set-keyboard-coding-system}, decoding is done after the |
@code{set-keyboard-coding-system}, decoding is done after the |
1741 |
translations listed above. @xref{Specifying Coding Systems}. In future |
translations listed above. @xref{Terminal I/O Encoding}. In future |
1742 |
Emacs versions, character set decoding may be done before the other |
Emacs versions, character set decoding may be done before the other |
1743 |
translations. |
translations. |
1744 |
|
|
1843 |
were actually output, you can determine reliably whether they correspond |
were actually output, you can determine reliably whether they correspond |
1844 |
to the Termcap specifications in use. |
to the Termcap specifications in use. |
1845 |
|
|
1846 |
See also @code{open-dribble-file} in @ref{Terminal Input}. |
You close the termscript file by calling this function with an |
1847 |
|
argument of @code{nil}. |
1848 |
|
|
1849 |
|
See also @code{open-dribble-file} in @ref{Recording Input}. |
1850 |
|
|
1851 |
@example |
@example |
1852 |
@group |
@group |
2011 |
mean time, Emacs provides a convenient way of enabling flow control if |
mean time, Emacs provides a convenient way of enabling flow control if |
2012 |
you want it: call the function @code{enable-flow-control}. |
you want it: call the function @code{enable-flow-control}. |
2013 |
|
|
2014 |
@deffn Command enable-flow-control |
@deffn Command enable-flow-control &optional arg |
2015 |
This function enables use of @kbd{C-s} and @kbd{C-q} for output flow |
When @var{arg} is a positive integer, this function enables use of |
2016 |
control, and provides the characters @kbd{C-\} and @kbd{C-^} as aliases |
@kbd{C-s} and @kbd{C-q} for output flow control, and provides the |
2017 |
for them using @code{keyboard-translate-table} (@pxref{Translating Input}). |
characters @kbd{C-\} and @kbd{C-^} as aliases for them using |
2018 |
|
@code{keyboard-translate-table} (@pxref{Translating Input}). |
2019 |
|
|
2020 |
|
When @var{arg} is a negative integer or zero, it disables these |
2021 |
|
features. When @var{arg} is @code{nil} or omitted, it toggles. |
2022 |
|
Interactively, @var{arg} is the prefix argument. If non-@code{nil}, |
2023 |
|
its numeric value is used. |
2024 |
@end deffn |
@end deffn |
2025 |
|
|
2026 |
You can use the function @code{enable-flow-control-on} in your |
You can use the function @code{enable-flow-control-on} in your |
2042 |
@item |
@item |
2043 |
@cindex @sc{cbreak} |
@cindex @sc{cbreak} |
2044 |
It sets @sc{cbreak} mode for terminal input, and tells the operating |
It sets @sc{cbreak} mode for terminal input, and tells the operating |
2045 |
system to handle flow control, with @code{(set-input-mode nil t)}. |
system to handle flow control. This is done using @code{set-input-mode}. |
2046 |
|
|
2047 |
@item |
@item |
2048 |
It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and |
It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and |
2109 |
Emacs supports saving state by using a hook called |
Emacs supports saving state by using a hook called |
2110 |
@code{emacs-save-session-functions}. Each function in this hook is |
@code{emacs-save-session-functions}. Each function in this hook is |
2111 |
called when the session manager tells Emacs that the window system is |
called when the session manager tells Emacs that the window system is |
2112 |
shutting down. The functions are called with the current buffer set |
shutting down. The functions are called with no arguments and with the |
2113 |
to a temporary buffer. Each function can use @code{insert} to add |
current buffer set to a temporary buffer. Each function can use |
2114 |
Lisp code to this buffer. At the end, Emacs saves the buffer in a |
@code{insert} to add Lisp code to this buffer. At the end, Emacs |
2115 |
file that another Emacs will later load in order to restart the saved session. |
saves the buffer in a file that a subsequent Emacs invocation will |
2116 |
|
load in order to restart the saved session. |
2117 |
|
|
2118 |
If a function in @code{emacs-save-session-functions} returns |
If a function in @code{emacs-save-session-functions} returns |
2119 |
non-@code{nil}, Emacs tells the session manager to cancel the |
non-@code{nil}, Emacs tells the session manager to cancel the |