aboutsummaryrefslogtreecommitdiffstats
path: root/lispref
diff options
context:
space:
mode:
authorMiles Bader2004-07-11 22:08:06 +0000
committerMiles Bader2004-07-11 22:08:06 +0000
commit89f3c0c9fda25756ee311a6d0467a97bac203eb5 (patch)
treebe9d2244f2ba1e7ecd4d680e92e5fdffca58ab03 /lispref
parent094194de121c8b93c7b183182cb0853ec54fe1aa (diff)
parentda38045d0a9949d46814683391e094a3612b6b41 (diff)
downloademacs-89f3c0c9fda25756ee311a6d0467a97bac203eb5.tar.gz
emacs-89f3c0c9fda25756ee311a6d0467a97bac203eb5.zip
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-23
Merge from emacs--cvs-trunk--0 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-442 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-444 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-445 Tweak permissions * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-446 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-450 Update from CVS
Diffstat (limited to 'lispref')
-rw-r--r--lispref/ChangeLog21
-rw-r--r--lispref/frames.texi21
-rw-r--r--lispref/os.texi213
3 files changed, 164 insertions, 91 deletions
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index a27d59b72fa..cdf120e7a41 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,24 @@
12004-07-09 Richard M. Stallman <rms@gnu.org>
2
3 * frames.texi (Input Focus): Minor fix.
4
52004-07-07 Luc Teirlinck <teirllm@auburn.edu>
6
7 * frames.texi (Input Focus): Clarify descriptions of
8 `select-frame-set-input-focus' and `select-frame'.
9
102004-07-06 Luc Teirlinck <teirllm@auburn.edu>
11
12 * os.texi: Various small changes in addition to:
13 (Killing Emacs): Expand and clarify description of
14 `kill-emacs-query-functions' and `kill-emacs-hook'.
15 (System Environment): Expand and clarify description of `getenv'
16 and `setenv'.
17 (Timers): Clarify description of `run-at-time'.
18 (Translating Input): Correct description of
19 `extra-keyboard-modifiers'.
20 (Flow Control): Correct description of `enable-flow-control'.
21
12004-07-06 Thien-Thi Nguyen <ttn@gnu.org> 222004-07-06 Thien-Thi Nguyen <ttn@gnu.org>
2 23
3 * os.texi: Update copyright. 24 * os.texi: Update copyright.
diff --git a/lispref/frames.texi b/lispref/frames.texi
index 24540f471f8..61522e3598c 100644
--- a/lispref/frames.texi
+++ b/lispref/frames.texi
@@ -997,7 +997,7 @@ Some window systems and window managers direct keyboard input to the
997window object that the mouse is in; others require explicit clicks or 997window object that the mouse is in; others require explicit clicks or
998commands to @dfn{shift the focus} to various window objects. Either 998commands to @dfn{shift the focus} to various window objects. Either
999way, Emacs automatically keeps track of which frame has the focus. To 999way, Emacs automatically keeps track of which frame has the focus. To
1000switch to a different frame from a lisp function, call 1000switch to a different frame from a Lisp function, call
1001@code{select-frame-set-input-focus}. 1001@code{select-frame-set-input-focus}.
1002 1002
1003Lisp programs can also switch frames ``temporarily'' by calling the 1003Lisp programs can also switch frames ``temporarily'' by calling the
@@ -1006,17 +1006,19 @@ concept of focus; rather, it escapes from the window manager's control
1006until that control is somehow reasserted. 1006until that control is somehow reasserted.
1007 1007
1008When using a text-only terminal, only one frame can be displayed at a 1008When using a text-only terminal, only one frame can be displayed at a
1009time on the terminal, so @code{select-frame} actually displays the 1009time on the terminal, so after a call to @code{select-frame}, the next
1010newly selected frame. This frame remains displayed until a subsequent 1010redisplay actually displays the newly selected frame. This frame
1011call to @code{select-frame} or @code{select-frame-set-input-focus}. 1011remains selected until a subsequent call to @code{select-frame} or
1012Each terminal frame has a number which appears in the mode line before 1012@code{select-frame-set-input-focus}. Each terminal frame has a number
1013the buffer name (@pxref{Mode Line Variables}). 1013which appears in the mode line before the buffer name (@pxref{Mode
1014Line Variables}).
1014 1015
1015@defun select-frame-set-input-focus frame 1016@defun select-frame-set-input-focus frame
1016This function makes @var{frame} the selected frame, raises it (should 1017This function makes @var{frame} the selected frame, raises it (should
1017it happen to be obscured by other frames) and tries to give it the X 1018it happen to be obscured by other frames) and tries to give it the X
1018server's focus. On a text-only terminal, the new frame gets displayed 1019server's focus. On a text-only terminal, the next redisplay displays
1019on the entire terminal screen. 1020the new frame on the entire terminal screen. The return value of this
1021function is not significant.
1020@end defun 1022@end defun
1021 1023
1022@c ??? This is not yet implemented properly. 1024@c ??? This is not yet implemented properly.
@@ -1026,7 +1028,8 @@ focus of the X server if any. The selection of @var{frame} lasts until
1026the next time the user does something to select a different frame, or 1028the next time the user does something to select a different frame, or
1027until the next time this function is called. The specified @var{frame} 1029until the next time this function is called. The specified @var{frame}
1028becomes the selected frame, as explained above, and the terminal that 1030becomes the selected frame, as explained above, and the terminal that
1029@var{frame} is on becomes the selected terminal. 1031@var{frame} is on becomes the selected terminal. This function
1032returns @var{frame}, or @code{nil} if @var{frame} has been deleted.
1030 1033
1031In general, you should never use @code{select-frame} in a way that could 1034In general, you should never use @code{select-frame} in a way that could
1032switch to a different terminal without switching back when you're done. 1035switch to a different terminal without switching back when you're done.
diff --git a/lispref/os.texi b/lispref/os.texi
index d52464e7409..3e1b93339ad 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -237,7 +237,7 @@ This normal hook is run, once, just before loading all the init files
237This normal hook is run, once, just after loading all the init files 237This 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}), 238(the user's init file, @file{default.el}, and/or @file{site-start.el}),
239before loading the terminal-specific library and processing the 239before loading the terminal-specific library and processing the
240command-line arguments. 240command-line action arguments.
241@end defvar 241@end defvar
242 242
243@defvar emacs-startup-hook 243@defvar emacs-startup-hook
@@ -248,7 +248,7 @@ arguments, just before @code{term-setup-hook}.
248 248
249@defvar user-init-file 249@defvar user-init-file
250@tindex user-init-file 250@tindex user-init-file
251This variable holds the file name of the user's init file. If the 251This variable holds the absolute file name of the user's init file. If the
252actual init file loaded is a compiled file, such as @file{.emacs.elc}, 252actual init file loaded is a compiled file, such as @file{.emacs.elc},
253the value refers to the corresponding source file. 253the value refers to the corresponding source file.
254@end defvar 254@end defvar
@@ -471,20 +471,31 @@ been saved, is lost when the Emacs process is killed. Because killing
471Emacs inadvertently can lose a lot of work, Emacs queries for 471Emacs inadvertently can lose a lot of work, Emacs queries for
472confirmation before actually terminating if you have buffers that need 472confirmation before actually terminating if you have buffers that need
473saving or subprocesses that are running. This is done in the function 473saving or subprocesses that are running. This is done in the function
474@code{save-buffers-kill-emacs}. 474@code{save-buffers-kill-emacs}, the higher level function from which
475@code{kill-emacs} is usually called.
475 476
476@defvar kill-emacs-query-functions 477@defvar kill-emacs-query-functions
477After asking the standard questions, @code{save-buffers-kill-emacs} 478After asking the standard questions, @code{save-buffers-kill-emacs}
478calls the functions in the list @code{kill-emacs-query-functions}, in 479calls the functions in the list @code{kill-emacs-query-functions}, in
479order of appearance, with no arguments. These functions can ask for 480order of appearance, with no arguments. These functions can ask for
480additional confirmation from the user. If any of them returns 481additional confirmation from the user. If any of them returns
481@code{nil}, Emacs is not killed. 482@code{nil}, @code{save-buffers-kill-emacs} does not kill Emacs, and
483does not run the remaining functions in this hook. Calling
484@code{kill-emacs} directly does not run this hook.
482@end defvar 485@end defvar
483 486
484@defvar kill-emacs-hook 487@defvar kill-emacs-hook
485This variable is a normal hook; once @code{save-buffers-kill-emacs} is 488This variable is a normal hook; once @code{save-buffers-kill-emacs} is
486finished with all file saving and confirmation, it runs the functions in 489finished with all file saving and confirmation, it calls
487this hook. This hook is not run in batch mode. 490@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
495similar situations where interaction with the user is not possible.
496Thus, 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
498how Emacs is killed, put it on @code{kill-emacs-hook}.
488@end defvar 499@end defvar
489 500
490@node Suspending Emacs 501@node Suspending Emacs
@@ -508,7 +519,7 @@ give input to some other job such as a shell merely by moving to a
508different window. Therefore, suspending is not allowed when Emacs is using 519different window. Therefore, suspending is not allowed when Emacs is using
509a window system (X or MS Windows). 520a window system (X or MS Windows).
510 521
511@defun suspend-emacs string 522@defun suspend-emacs &optional string
512This function stops Emacs and returns control to the superior process. 523This function stops Emacs and returns control to the superior process.
513If and when the superior process resumes Emacs, @code{suspend-emacs} 524If and when the superior process resumes Emacs, @code{suspend-emacs}
514returns @code{nil} to its caller in Lisp. 525returns @code{nil} to its caller in Lisp.
@@ -542,10 +553,10 @@ Emacs is suspended. But it is read and executed by the shell.
542 (function (lambda () 553 (function (lambda ()
543 (or (y-or-n-p 554 (or (y-or-n-p
544 "Really suspend? ") 555 "Really suspend? ")
545 (error "Suspend cancelled"))))) 556 (error "Suspend canceled")))))
546 @result{} (lambda nil 557 @result{} (lambda nil
547 (or (y-or-n-p "Really suspend? ") 558 (or (y-or-n-p "Really suspend? ")
548 (error "Suspend cancelled"))) 559 (error "Suspend canceled")))
549@end group 560@end group
550@group 561@group
551(add-hook 'suspend-resume-hook 562(add-hook 'suspend-resume-hook
@@ -694,8 +705,10 @@ Emacs was dumped. @xref{Building Emacs}.)
694@deffn Command getenv var 705@deffn Command getenv var
695@cindex environment variable access 706@cindex environment variable access
696This function returns the value of the environment variable @var{var}, 707This function returns the value of the environment variable @var{var},
697as a string. Within Emacs, the environment variable values are kept in 708as a string. @var{var} should be a string. If @var{var} is undefined
698the Lisp variable @code{process-environment}. 709in the environment, @code{getenv} returns @code{nil}. If returns
710@samp{""} if @var{var} is set but null. Within Emacs, the environment
711variable values are kept in the Lisp variable @code{process-environment}.
699 712
700@example 713@example
701@group 714@group
@@ -717,11 +730,22 @@ HOME=/user/lewis
717@end deffn 730@end deffn
718 731
719@c Emacs 19 feature 732@c Emacs 19 feature
720@deffn Command setenv variable value 733@deffn Command setenv variable &optional value
721This command sets the value of the environment variable named 734This command sets the value of the environment variable named
722@var{variable} to @var{value}. Both arguments should be strings. This 735@var{variable} to @var{value}. @var{variable} should be a string.
723function works by modifying @code{process-environment}; binding that 736Internally, Emacs Lisp can handle any string. However, normally
724variable with @code{let} is also reasonable practice. 737@var{variable} should be a valid shell identifier, that is, a sequence
738of letters, digits and underscores, starting with a letter or
739underscore. Otherwise, errors may occur if subprocesses of Emacs try
740to access the value of @var{variable}. If @var{value} is omitted or
741@code{nil}, @code{setenv} removes @var{variable} from the environment.
742Otherwise, @var{value} should be a string.
743
744@code{setenv} works by modifying @code{process-environment}; binding
745that variable with @code{let} is also reasonable practice.
746
747@code{setenv} returns the new value of @var{variable}, or @code{nil}
748if it removed @var{variable} from the environment.
725@end deffn 749@end deffn
726 750
727@defvar process-environment 751@defvar process-environment
@@ -801,6 +825,10 @@ an error. On some platforms, access to load averages requires
801installing Emacs as setuid or setgid so that it can read kernel 825installing Emacs as setuid or setgid so that it can read kernel
802information, and that usually isn't advisable. 826information, and that usually isn't advisable.
803 827
828If the 1-minute load average is available, but the 5- or 15-minute
829averages are not, this function returns a shortened list containing
830the available averages.
831
804@example 832@example
805@group 833@group
806(load-average) 834(load-average)
@@ -820,12 +848,14 @@ lewis@@rocky[5] % uptime
820@end defun 848@end defun
821 849
822@defun emacs-pid 850@defun emacs-pid
823This function returns the process @acronym{ID} of the Emacs process. 851This function returns the process @acronym{ID} of the Emacs process,
852as an integer.
824@end defun 853@end defun
825 854
826@defvar tty-erase-char 855@defvar tty-erase-char
827This variable holds the erase character that was selected 856This variable holds the erase character that was selected
828in the system's terminal driver, before Emacs was started. 857in the system's terminal driver, before Emacs was started.
858The value is @code{nil} if Emacs is running under a window system.
829@end defvar 859@end defvar
830 860
831@defun setprv privilege-name &optional setp getprv 861@defun setprv privilege-name &optional setp getprv
@@ -836,7 +866,7 @@ whether the privilege is to be turned on or off. Its default is
836@code{nil}. The function returns @code{t} if successful, @code{nil} 866@code{nil}. The function returns @code{t} if successful, @code{nil}
837otherwise. 867otherwise.
838 868
839 If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv} 869If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv}
840does not change the privilege, but returns @code{t} or @code{nil} 870does not change the privilege, but returns @code{t} or @code{nil}
841indicating whether the privilege is currently enabled. 871indicating whether the privilege is currently enabled.
842@end defun 872@end defun
@@ -845,8 +875,9 @@ indicating whether the privilege is currently enabled.
845@section User Identification 875@section User Identification
846 876
847@defvar init-file-user 877@defvar init-file-user
848This variable says which user's init files should be used by Emacs---or 878This variable says which user's init files should be used by
849@code{nil} if none. The value reflects command-line options such as 879Emacs---or @code{nil} if none. @code{""} stands for the user who
880originally logged in. The value reflects command-line options such as
850@samp{-q} or @samp{-u @var{user}}. 881@samp{-q} or @samp{-u @var{user}}.
851 882
852Lisp packages that load files of customizations, or any other sort of 883Lisp packages that load files of customizations, or any other sort of
@@ -873,7 +904,8 @@ is set, that value is used. Otherwise, if the environment variable
873on the effective @acronym{UID}, not the real @acronym{UID}. 904on the effective @acronym{UID}, not the real @acronym{UID}.
874 905
875If you specify @var{uid}, the value is the user name that corresponds 906If you specify @var{uid}, the value is the user name that corresponds
876to @var{uid} (which should be an integer). 907to @var{uid} (which should be an integer), or @code{nil} if there is
908no such user.
877 909
878@example 910@example
879@group 911@group
@@ -904,7 +936,7 @@ of the environment variable @code{NAME}, if that is set.
904If the Emacs job's user-id does not correspond to any known user (and 936If the Emacs job's user-id does not correspond to any known user (and
905provided @code{NAME} is not set), the value is @code{"unknown"}. 937provided @code{NAME} is not set), the value is @code{"unknown"}.
906 938
907If @var{uid} is non-@code{nil}, then it should be an integer (a user-id) 939If @var{uid} is non-@code{nil}, then it should be a number (a user-id)
908or a string (a login name). Then @code{user-full-name} returns the full 940or a string (a login name). Then @code{user-full-name} returns the full
909name corresponding to that user-id or login name. If you specify a 941name corresponding to that user-id or login name. If you specify a
910user-id or login name that isn't defined, it returns @code{nil}. 942user-id or login name that isn't defined, it returns @code{nil}.
@@ -956,7 +988,8 @@ The argument @var{time-value}, if given, specifies a time to format
956instead of the current time. The argument should be a list whose first 988instead of the current time. The argument should be a list whose first
957two elements are integers. Thus, you can use times obtained from 989two elements are integers. Thus, you can use times obtained from
958@code{current-time} (see below) and from @code{file-attributes} 990@code{current-time} (see below) and from @code{file-attributes}
959(@pxref{File Attributes}). 991(@pxref{Definition of file-attributes}). @var{time-value} can also be
992a cons of two integers, but this is considered obsolete.
960 993
961@example 994@example
962@group 995@group
@@ -971,7 +1004,7 @@ two elements are integers. Thus, you can use times obtained from
971This function returns the system's time value as a list of three 1004This function returns the system's time value as a list of three
972integers: @code{(@var{high} @var{low} @var{microsec})}. The integers 1005integers: @code{(@var{high} @var{low} @var{microsec})}. The integers
973@var{high} and @var{low} combine to give the number of seconds since 1006@var{high} and @var{low} combine to give the number of seconds since
9740:00 January 1, 1970 (local time), which is 10070:00 January 1, 1970 UTC (Coordinated Universal Time), which is
975@ifnottex 1008@ifnottex
976@var{high} * 2**16 + @var{low}. 1009@var{high} * 2**16 + @var{low}.
977@end ifnottex 1010@end ifnottex
@@ -984,7 +1017,8 @@ start of the current second (or 0 for systems that return time with
984the resolution of only one second). 1017the resolution of only one second).
985 1018
986The first two elements can be compared with file time values such as you 1019The first two elements can be compared with file time values such as you
987get with the function @code{file-attributes}. @xref{File Attributes}. 1020get with the function @code{file-attributes}.
1021@xref{Definition of file-attributes}.
988@end defun 1022@end defun
989 1023
990@c Emacs 19 feature 1024@c Emacs 19 feature
@@ -1001,20 +1035,21 @@ if the user has specified a time zone that does not use a seasonal time
1001adjustment, then the value is constant through time. 1035adjustment, then the value is constant through time.
1002 1036
1003If the operating system doesn't supply all the information necessary to 1037If the operating system doesn't supply all the information necessary to
1004compute the value, both elements of the list are @code{nil}. 1038compute the value, the unknown elements of the list are @code{nil}.
1005 1039
1006The argument @var{time-value}, if given, specifies a time to analyze 1040The argument @var{time-value}, if given, specifies a time to analyze
1007instead of the current time. The argument should be a cons cell 1041instead of the current time. The argument should have the same form
1008containing two integers, or a list whose first two elements are 1042as for @code{current-time-string} (see above). Thus, you can use
1009integers. Thus, you can use times obtained from @code{current-time} 1043times obtained from @code{current-time} (see above) and from
1010(see above) and from @code{file-attributes} (@pxref{File Attributes}). 1044@code{file-attributes}. @xref{Definition of file-attributes}.
1011@end defun 1045@end defun
1012 1046
1013@defun set-time-zone-rule tz 1047@defun set-time-zone-rule tz
1014This function specifies the local time zone according to @var{tz}. If 1048This function specifies the local time zone according to @var{tz}. If
1015@var{tz} is @code{nil}, that means to use an implementation-defined 1049@var{tz} is @code{nil}, that means to use an implementation-defined
1016default time zone. If @var{tz} is @code{t}, that means to use 1050default time zone. If @var{tz} is @code{t}, that means to use
1017Universal Time. 1051Universal Time. Otherwise, @var{tz} should be a string specifying a
1052time zone rule.
1018@end defun 1053@end defun
1019 1054
1020@defun float-time &optional time-value 1055@defun float-time &optional time-value
@@ -1022,7 +1057,7 @@ This function returns the current time as a floating-point number of
1022seconds since the epoch. The argument @var{time-value}, if given, 1057seconds since the epoch. The argument @var{time-value}, if given,
1023specifies a time to convert instead of the current time. The argument 1058specifies a time to convert instead of the current time. The argument
1024should have the same form as for @code{current-time-string} (see 1059should have the same form as for @code{current-time-string} (see
1025above), and it also accepts the output of @code{current-time} and 1060above). Thus, it accepts the output of @code{current-time} and
1026@code{file-attributes}. 1061@code{file-attributes}.
1027 1062
1028@emph{Warning}: Since the result is floating point, it may not be 1063@emph{Warning}: Since the result is floating point, it may not be
@@ -1036,7 +1071,7 @@ exact. Do not use this function if precise time stamps are required.
1036to strings or to calendrical information. There is also a function to 1071to strings or to calendrical information. There is also a function to
1037convert calendrical information to a time value. You can get time 1072convert calendrical information to a time value. You can get time
1038values from the functions @code{current-time} (@pxref{Time of Day}) and 1073values from the functions @code{current-time} (@pxref{Time of Day}) and
1039@code{file-attributes} (@pxref{File Attributes}). 1074@code{file-attributes} (@pxref{Definition of file-attributes}).
1040 1075
1041Many operating systems are limited to time values that contain 32 bits 1076Many operating systems are limited to time values that contain 32 bits
1042of information; these systems typically handle only the times from 1077of information; these systems typically handle only the times from
@@ -1189,6 +1224,7 @@ Here is what the elements mean:
1189@table @var 1224@table @var
1190@item seconds 1225@item seconds
1191The number of seconds past the minute, as an integer between 0 and 59. 1226The number of seconds past the minute, as an integer between 0 and 59.
1227On some operating systems, this is 60 for leap seconds.
1192@item minutes 1228@item minutes
1193The number of minutes past the hour, as an integer between 0 and 59. 1229The number of minutes past the hour, as an integer between 0 and 59.
1194@item hour 1230@item hour
@@ -1225,9 +1261,9 @@ yourself before you call @code{encode-time}.
1225The optional argument @var{zone} defaults to the current time zone and 1261The optional argument @var{zone} defaults to the current time zone and
1226its daylight savings time rules. If specified, it can be either a list 1262its daylight savings time rules. If specified, it can be either a list
1227(as you would get from @code{current-time-zone}), a string as in the 1263(as you would get from @code{current-time-zone}), a string as in the
1228@code{TZ} environment variable, or an integer (as you would get from 1264@code{TZ} environment variable, @code{t} for Universal Time, or an
1229@code{decode-time}). The specified zone is used without any further 1265integer (as you would get from @code{decode-time}). The specified
1230alteration for daylight savings time. 1266zone is used without any further alteration for daylight savings time.
1231 1267
1232If you pass more than seven arguments to @code{encode-time}, the first 1268If you pass more than seven arguments to @code{encode-time}, the first
1233six are used as @var{seconds} through @var{year}, the last argument is 1269six are used as @var{seconds} through @var{year}, the last argument is
@@ -1309,15 +1345,18 @@ because most timer functions don't do a lot of work. Indeed, for a
1309timer to call a function that takes substantial time to run is likely 1345timer to call a function that takes substantial time to run is likely
1310to be annoying. 1346to be annoying.
1311 1347
1312@defun run-at-time time repeat function &rest args 1348@deffn Command run-at-time time repeat function &rest args
1313This function arranges to call @var{function} with arguments @var{args} 1349This sets up a timer that calls the function @var{function} with
1314at time @var{time}. The argument @var{function} is a function to call 1350arguments @var{args} at time @var{time}. If @var{repeat} is a number
1315later, and @var{args} are the arguments to give it when it is called. 1351(integer or floating point), the timer also runs every @var{repeat}
1316The time @var{time} is specified as a string. 1352seconds after that. If @var{repeat} is @code{nil}, the timer runs
1353only once.
1354
1355@var{time} may specify an absolute or a relative time.
1317 1356
1318Absolute times may be specified in a wide variety of formats; this 1357Absolute times may be specified in a wide variety of formats; this
1319function tries to accept all the commonly used date formats. Valid 1358function tries to accept all the commonly used date formats. The most
1320formats include these two, 1359convenient formats are strings. Valid such formats include these two,
1321 1360
1322@example 1361@example
1323@var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone} 1362@var{year}-@var{month}-@var{day} @var{hour}:@var{min}:@var{sec} @var{timezone}
@@ -1330,7 +1369,7 @@ where in both examples all fields are numbers; the format that
1330@code{current-time-string} returns is also allowed, and many others 1369@code{current-time-string} returns is also allowed, and many others
1331as well. 1370as well.
1332 1371
1333To specify a relative time, use numbers followed by units. 1372To specify a relative time as a string, use numbers followed by units.
1334For example: 1373For example:
1335 1374
1336@table @samp 1375@table @samp
@@ -1345,13 +1384,9 @@ denotes exactly 103 months, 123 days, and 10862 seconds from now.
1345For relative time values, Emacs considers a month to be exactly thirty 1384For relative time values, Emacs considers a month to be exactly thirty
1346days, and a year to be exactly 365.25 days. 1385days, and a year to be exactly 365.25 days.
1347 1386
1348If @var{time} is a number (integer or floating point), that specifies a 1387Not all convenient formats are strings. If @var{time} is a number
1349relative time measured in seconds. 1388(integer or floating point), that specifies a relative time measured
1350 1389in seconds.
1351The argument @var{repeat} specifies how often to repeat the call. If
1352@var{repeat} is @code{nil}, there are no repetitions; @var{function} is
1353called just once, at @var{time}. If @var{repeat} is a number, it
1354specifies a repetition period measured in seconds.
1355 1390
1356In most cases, @var{repeat} has no effect on when @emph{first} call 1391In most cases, @var{repeat} has no effect on when @emph{first} call
1357takes place---@var{time} alone specifies that. There is one exception: 1392takes place---@var{time} alone specifies that. There is one exception:
@@ -1362,7 +1397,7 @@ functions like @code{display-time}.
1362The function @code{run-at-time} returns a timer value that identifies 1397The function @code{run-at-time} returns a timer value that identifies
1363the particular scheduled future action. You can use this value to call 1398the particular scheduled future action. You can use this value to call
1364@code{cancel-timer} (see below). 1399@code{cancel-timer} (see below).
1365@end defun 1400@end deffn
1366 1401
1367@defmac with-timeout (seconds timeout-forms@dots{}) body@dots{} 1402@defmac with-timeout (seconds timeout-forms@dots{}) body@dots{}
1368Execute @var{body}, but give up after @var{seconds} seconds. If 1403Execute @var{body}, but give up after @var{seconds} seconds. If
@@ -1388,7 +1423,7 @@ calls one of those primitives. So use @code{with-timeout} only with a
1388a timer to avoid waiting too long for an answer. @xref{Yes-or-No 1423a timer to avoid waiting too long for an answer. @xref{Yes-or-No
1389Queries}. 1424Queries}.
1390 1425
1391@defun run-with-idle-timer secs repeat function &rest args 1426@deffn Command run-with-idle-timer secs repeat function &rest args
1392Set up a timer which runs when Emacs has been idle for @var{secs} 1427Set up a timer which runs when Emacs has been idle for @var{secs}
1393seconds. The value of @var{secs} may be an integer or a floating point 1428seconds. The value of @var{secs} may be an integer or a floating point
1394number. 1429number.
@@ -1400,7 +1435,7 @@ remains idle for @var{secs} seconds.
1400 1435
1401The function @code{run-with-idle-timer} returns a timer value which you 1436The function @code{run-with-idle-timer} returns a timer value which you
1402can use in calling @code{cancel-timer} (see below). 1437can use in calling @code{cancel-timer} (see below).
1403@end defun 1438@end deffn
1404 1439
1405@cindex idleness 1440@cindex idleness
1406 Emacs becomes ``idle'' when it starts waiting for user input, and it 1441 Emacs becomes ``idle'' when it starts waiting for user input, and it
@@ -1426,8 +1461,8 @@ set up to repeat will subsequently run another time, one by one.
1426@defun cancel-timer timer 1461@defun cancel-timer timer
1427Cancel the requested action for @var{timer}, which should be a value 1462Cancel the requested action for @var{timer}, which should be a value
1428previously returned by @code{run-at-time} or @code{run-with-idle-timer}. 1463previously returned by @code{run-at-time} or @code{run-with-idle-timer}.
1429This cancels the effect of that call to @code{run-at-time}; the arrival 1464This cancels the effect of that call to one of these functions; the
1430of the specified time will not cause anything special to happen. 1465arrival of the specified time will not cause anything special to happen.
1431@end defun 1466@end defun
1432 1467
1433@node Terminal Input 1468@node Terminal Input
@@ -1450,7 +1485,7 @@ functions.
1450@cindex input modes 1485@cindex input modes
1451@cindex terminal input modes 1486@cindex terminal input modes
1452 1487
1453@defun set-input-mode interrupt flow meta quit-char 1488@defun set-input-mode interrupt flow meta &optional quit-char
1454This function sets the mode for reading keyboard input. If 1489This function sets the mode for reading keyboard input. If
1455@var{interrupt} is non-null, then Emacs uses input interrupts. If it is 1490@var{interrupt} is non-null, then Emacs uses input interrupts. If it is
1456@code{nil}, then it uses @sc{cbreak} mode. The default setting is 1491@code{nil}, then it uses @sc{cbreak} mode. The default setting is
@@ -1523,31 +1558,30 @@ being read; then subsequences containing it are checked first with
1523@c Emacs 19 feature 1558@c Emacs 19 feature
1524@defvar extra-keyboard-modifiers 1559@defvar extra-keyboard-modifiers
1525This variable lets Lisp programs ``press'' the modifier keys on the 1560This variable lets Lisp programs ``press'' the modifier keys on the
1526keyboard. The value is a bit mask: 1561keyboard. The value is a character. Only the modifiers of the
1527 1562character matter. Each time the user types a keyboard key, it is
1528@table @asis 1563altered as if those modifier keys were held down. For instance, if
1529@item 1 1564you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all
1530The @key{SHIFT} key. 1565keyboard input characters typed during the scope of the binding will
1531@item 2 1566have the control and meta modifiers applied to them. The character
1532The @key{LOCK} key. 1567@code{?\C-@@}, equivalent to the integer 0, does not count as a control
1533@item 4 1568character for this purpose, but as a character with no modifiers.
1534The @key{CTL} key. 1569Thus, setting @code{extra-keyboard-modifiers} to zero cancels any
1535@item 8 1570modification.
1536The @key{META} key.
1537@end table
1538
1539Each time the user types a keyboard key, it is altered as if the
1540modifier keys specified in the bit mask were held down.
1541 1571
1542When using a window system, the program can ``press'' any of the 1572When using a window system, the program can ``press'' any of the
1543modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} 1573modifier keys in this way. Otherwise, only the @key{CTL} and @key{META}
1544keys can be virtually pressed. 1574keys can be virtually pressed.
1575
1576Note that this variable applies only to events that really come from
1577the keyboard, and has no effect on mouse events or any other events.
1545@end defvar 1578@end defvar
1546 1579
1547@defvar keyboard-translate-table 1580@defvar keyboard-translate-table
1548This variable is the translate table for keyboard characters. It lets 1581This variable is the translate table for keyboard characters. It lets
1549you reshuffle the keys on the keyboard without changing any command 1582you reshuffle the keys on the keyboard without changing any command
1550bindings. Its value is normally a char-table, or else @code{nil}. 1583bindings. 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.)
1551 1585
1552If @code{keyboard-translate-table} is a char-table 1586If @code{keyboard-translate-table} is a char-table
1553(@pxref{Char-Tables}), then each character read from the keyboard is 1587(@pxref{Char-Tables}), then each character read from the keyboard is
@@ -1587,6 +1621,11 @@ Note that this translation is the first thing that happens to a
1587character after it is read from the terminal. Record-keeping features 1621character after it is read from the terminal. Record-keeping features
1588such as @code{recent-keys} and dribble files record the characters after 1622such as @code{recent-keys} and dribble files record the characters after
1589translation. 1623translation.
1624
1625Note also that this translation is done before the characters are
1626supplied to input methods (@pxref{Input Methods}). Use
1627@code{translation-table-for-input} (@pxref{Translation of Characters}),
1628if you want to translate characters after input methods operate.
1590@end defvar 1629@end defvar
1591 1630
1592@defun keyboard-translate from to 1631@defun keyboard-translate from to
@@ -1699,7 +1738,7 @@ to turn the character that follows into a Hyper character:
1699 1738
1700Finally, if you have enabled keyboard character set decoding using 1739Finally, if you have enabled keyboard character set decoding using
1701@code{set-keyboard-coding-system}, decoding is done after the 1740@code{set-keyboard-coding-system}, decoding is done after the
1702translations listed above. @xref{Specifying Coding Systems}. In future 1741translations listed above. @xref{Terminal I/O Encoding}. In future
1703Emacs versions, character set decoding may be done before the other 1742Emacs versions, character set decoding may be done before the other
1704translations. 1743translations.
1705 1744
@@ -1804,7 +1843,10 @@ often than to actual Emacs bugs. Once you are certain which characters
1804were actually output, you can determine reliably whether they correspond 1843were actually output, you can determine reliably whether they correspond
1805to the Termcap specifications in use. 1844to the Termcap specifications in use.
1806 1845
1807See also @code{open-dribble-file} in @ref{Terminal Input}. 1846You close the termscript file by calling this function with an
1847argument of @code{nil}.
1848
1849See also @code{open-dribble-file} in @ref{Recording Input}.
1808 1850
1809@example 1851@example
1810@group 1852@group
@@ -1969,10 +2011,16 @@ terminals, the flow control problem is gradually disappearing. For the
1969mean time, Emacs provides a convenient way of enabling flow control if 2011mean time, Emacs provides a convenient way of enabling flow control if
1970you want it: call the function @code{enable-flow-control}. 2012you want it: call the function @code{enable-flow-control}.
1971 2013
1972@deffn Command enable-flow-control 2014@deffn Command enable-flow-control &optional arg
1973This function enables use of @kbd{C-s} and @kbd{C-q} for output flow 2015When @var{arg} is a positive integer, this function enables use of
1974control, and provides the characters @kbd{C-\} and @kbd{C-^} as aliases 2016@kbd{C-s} and @kbd{C-q} for output flow control, and provides the
1975for them using @code{keyboard-translate-table} (@pxref{Translating Input}). 2017characters @kbd{C-\} and @kbd{C-^} as aliases for them using
2018@code{keyboard-translate-table} (@pxref{Translating Input}).
2019
2020When @var{arg} is a negative integer or zero, it disables these
2021features. When @var{arg} is @code{nil} or omitted, it toggles.
2022Interactively, @var{arg} is the prefix argument. If non-@code{nil},
2023its numeric value is used.
1976@end deffn 2024@end deffn
1977 2025
1978You can use the function @code{enable-flow-control-on} in your 2026You can use the function @code{enable-flow-control-on} in your
@@ -1994,7 +2042,7 @@ if the terminal type is one of @var{termtypes}. For example:
1994@item 2042@item
1995@cindex @sc{cbreak} 2043@cindex @sc{cbreak}
1996It sets @sc{cbreak} mode for terminal input, and tells the operating 2044It sets @sc{cbreak} mode for terminal input, and tells the operating
1997system to handle flow control, with @code{(set-input-mode nil t)}. 2045system to handle flow control. This is done using @code{set-input-mode}.
1998 2046
1999@item 2047@item
2000It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and 2048It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and
@@ -2061,10 +2109,11 @@ saved session to restore. For Emacs, this argument is @samp{--smid
2061Emacs supports saving state by using a hook called 2109Emacs supports saving state by using a hook called
2062@code{emacs-save-session-functions}. Each function in this hook is 2110@code{emacs-save-session-functions}. Each function in this hook is
2063called when the session manager tells Emacs that the window system is 2111called when the session manager tells Emacs that the window system is
2064shutting down. The functions are called with the current buffer set 2112shutting down. The functions are called with no arguments and with the
2065to a temporary buffer. Each function can use @code{insert} to add 2113current buffer set to a temporary buffer. Each function can use
2066Lisp code to this buffer. At the end, Emacs saves the buffer in a 2114@code{insert} to add Lisp code to this buffer. At the end, Emacs
2067file that another Emacs will later load in order to restart the saved session. 2115saves the buffer in a file that a subsequent Emacs invocation will
2116load in order to restart the saved session.
2068 2117
2069If a function in @code{emacs-save-session-functions} returns 2118If a function in @code{emacs-save-session-functions} returns
2070non-@code{nil}, Emacs tells the session manager to cancel the 2119non-@code{nil}, Emacs tells the session manager to cancel the