diff options
| author | Miles Bader | 2004-07-11 22:08:06 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-07-11 22:08:06 +0000 |
| commit | 89f3c0c9fda25756ee311a6d0467a97bac203eb5 (patch) | |
| tree | be9d2244f2ba1e7ecd4d680e92e5fdffca58ab03 /lispref | |
| parent | 094194de121c8b93c7b183182cb0853ec54fe1aa (diff) | |
| parent | da38045d0a9949d46814683391e094a3612b6b41 (diff) | |
| download | emacs-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/ChangeLog | 21 | ||||
| -rw-r--r-- | lispref/frames.texi | 21 | ||||
| -rw-r--r-- | lispref/os.texi | 213 |
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 @@ | |||
| 1 | 2004-07-09 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * frames.texi (Input Focus): Minor fix. | ||
| 4 | |||
| 5 | 2004-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 | |||
| 10 | 2004-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 | |||
| 1 | 2004-07-06 Thien-Thi Nguyen <ttn@gnu.org> | 22 | 2004-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 | |||
| 997 | window object that the mouse is in; others require explicit clicks or | 997 | window object that the mouse is in; others require explicit clicks or |
| 998 | commands to @dfn{shift the focus} to various window objects. Either | 998 | commands to @dfn{shift the focus} to various window objects. Either |
| 999 | way, Emacs automatically keeps track of which frame has the focus. To | 999 | way, Emacs automatically keeps track of which frame has the focus. To |
| 1000 | switch to a different frame from a lisp function, call | 1000 | switch 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 | ||
| 1003 | Lisp programs can also switch frames ``temporarily'' by calling the | 1003 | Lisp 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 | |||
| 1006 | until that control is somehow reasserted. | 1006 | until that control is somehow reasserted. |
| 1007 | 1007 | ||
| 1008 | When using a text-only terminal, only one frame can be displayed at a | 1008 | When using a text-only terminal, only one frame can be displayed at a |
| 1009 | time on the terminal, so @code{select-frame} actually displays the | 1009 | time on the terminal, so after a call to @code{select-frame}, the next |
| 1010 | newly selected frame. This frame remains displayed until a subsequent | 1010 | redisplay actually displays the newly selected frame. This frame |
| 1011 | call to @code{select-frame} or @code{select-frame-set-input-focus}. | 1011 | remains selected until a subsequent call to @code{select-frame} or |
| 1012 | Each 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 |
| 1013 | the buffer name (@pxref{Mode Line Variables}). | 1013 | which appears in the mode line before the buffer name (@pxref{Mode |
| 1014 | Line Variables}). | ||
| 1014 | 1015 | ||
| 1015 | @defun select-frame-set-input-focus frame | 1016 | @defun select-frame-set-input-focus frame |
| 1016 | This function makes @var{frame} the selected frame, raises it (should | 1017 | This function makes @var{frame} the selected frame, raises it (should |
| 1017 | it happen to be obscured by other frames) and tries to give it the X | 1018 | it happen to be obscured by other frames) and tries to give it the X |
| 1018 | server's focus. On a text-only terminal, the new frame gets displayed | 1019 | server's focus. On a text-only terminal, the next redisplay displays |
| 1019 | on the entire terminal screen. | 1020 | the new frame on the entire terminal screen. The return value of this |
| 1021 | function 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 | |||
| 1026 | the next time the user does something to select a different frame, or | 1028 | the next time the user does something to select a different frame, or |
| 1027 | until the next time this function is called. The specified @var{frame} | 1029 | until the next time this function is called. The specified @var{frame} |
| 1028 | becomes the selected frame, as explained above, and the terminal that | 1030 | becomes 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 |
| 1032 | returns @var{frame}, or @code{nil} if @var{frame} has been deleted. | ||
| 1030 | 1033 | ||
| 1031 | In general, you should never use @code{select-frame} in a way that could | 1034 | In general, you should never use @code{select-frame} in a way that could |
| 1032 | switch to a different terminal without switching back when you're done. | 1035 | switch 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 | |||
| 237 | This normal hook is run, once, just after loading all the init files | 237 | 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}), | 238 | (the user's init file, @file{default.el}, and/or @file{site-start.el}), |
| 239 | before loading the terminal-specific library and processing the | 239 | before loading the terminal-specific library and processing the |
| 240 | command-line arguments. | 240 | command-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 |
| 251 | This variable holds the file name of the user's init file. If the | 251 | 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}, | 252 | actual init file loaded is a compiled file, such as @file{.emacs.elc}, |
| 253 | the value refers to the corresponding source file. | 253 | the 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 | |||
| 471 | Emacs inadvertently can lose a lot of work, Emacs queries for | 471 | Emacs inadvertently can lose a lot of work, Emacs queries for |
| 472 | confirmation before actually terminating if you have buffers that need | 472 | confirmation before actually terminating if you have buffers that need |
| 473 | saving or subprocesses that are running. This is done in the function | 473 | saving 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 |
| 477 | After asking the standard questions, @code{save-buffers-kill-emacs} | 478 | After asking the standard questions, @code{save-buffers-kill-emacs} |
| 478 | calls the functions in the list @code{kill-emacs-query-functions}, in | 479 | calls the functions in the list @code{kill-emacs-query-functions}, in |
| 479 | order of appearance, with no arguments. These functions can ask for | 480 | order of appearance, with no arguments. These functions can ask for |
| 480 | additional confirmation from the user. If any of them returns | 481 | additional 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 |
| 483 | does 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 |
| 485 | This variable is a normal hook; once @code{save-buffers-kill-emacs} is | 488 | This variable is a normal hook; once @code{save-buffers-kill-emacs} is |
| 486 | finished with all file saving and confirmation, it runs the functions in | 489 | finished with all file saving and confirmation, it calls |
| 487 | this 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 | ||
| 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}. | ||
| 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 | |||
| 508 | different window. Therefore, suspending is not allowed when Emacs is using | 519 | different window. Therefore, suspending is not allowed when Emacs is using |
| 509 | a window system (X or MS Windows). | 520 | a window system (X or MS Windows). |
| 510 | 521 | ||
| 511 | @defun suspend-emacs string | 522 | @defun suspend-emacs &optional string |
| 512 | This function stops Emacs and returns control to the superior process. | 523 | This function stops Emacs and returns control to the superior process. |
| 513 | If and when the superior process resumes Emacs, @code{suspend-emacs} | 524 | If and when the superior process resumes Emacs, @code{suspend-emacs} |
| 514 | returns @code{nil} to its caller in Lisp. | 525 | returns @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 |
| 696 | This function returns the value of the environment variable @var{var}, | 707 | This function returns the value of the environment variable @var{var}, |
| 697 | as a string. Within Emacs, the environment variable values are kept in | 708 | as a string. @var{var} should be a string. If @var{var} is undefined |
| 698 | the Lisp variable @code{process-environment}. | 709 | 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}. | ||
| 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 |
| 721 | This command sets the value of the environment variable named | 734 | This 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. |
| 723 | function works by modifying @code{process-environment}; binding that | 736 | Internally, Emacs Lisp can handle any string. However, normally |
| 724 | variable with @code{let} is also reasonable practice. | 737 | @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. | ||
| 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 | |||
| 801 | installing Emacs as setuid or setgid so that it can read kernel | 825 | installing Emacs as setuid or setgid so that it can read kernel |
| 802 | information, and that usually isn't advisable. | 826 | information, and that usually isn't advisable. |
| 803 | 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 | |||
| 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 |
| 823 | This function returns the process @acronym{ID} of the Emacs process. | 851 | This function returns the process @acronym{ID} of the Emacs process, |
| 852 | as an integer. | ||
| 824 | @end defun | 853 | @end defun |
| 825 | 854 | ||
| 826 | @defvar tty-erase-char | 855 | @defvar tty-erase-char |
| 827 | This variable holds the erase character that was selected | 856 | This variable holds the erase character that was selected |
| 828 | in the system's terminal driver, before Emacs was started. | 857 | in the system's terminal driver, before Emacs was started. |
| 858 | The 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} |
| 837 | otherwise. | 867 | otherwise. |
| 838 | 868 | ||
| 839 | If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv} | 869 | If the third argument, @var{getprv}, is non-@code{nil}, @code{setprv} |
| 840 | does not change the privilege, but returns @code{t} or @code{nil} | 870 | does not change the privilege, but returns @code{t} or @code{nil} |
| 841 | indicating whether the privilege is currently enabled. | 871 | indicating 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 |
| 848 | This variable says which user's init files should be used by Emacs---or | 878 | This variable says which user's init files should be used by |
| 849 | @code{nil} if none. The value reflects command-line options such as | 879 | Emacs---or @code{nil} if none. @code{""} stands for the user who |
| 880 | originally 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 | ||
| 852 | Lisp packages that load files of customizations, or any other sort of | 883 | Lisp 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 | |||
| 873 | on the effective @acronym{UID}, not the real @acronym{UID}. | 904 | on the effective @acronym{UID}, not the real @acronym{UID}. |
| 874 | 905 | ||
| 875 | If you specify @var{uid}, the value is the user name that corresponds | 906 | If you specify @var{uid}, the value is the user name that corresponds |
| 876 | to @var{uid} (which should be an integer). | 907 | to @var{uid} (which should be an integer), or @code{nil} if there is |
| 908 | no 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. | |||
| 904 | If the Emacs job's user-id does not correspond to any known user (and | 936 | If the Emacs job's user-id does not correspond to any known user (and |
| 905 | provided @code{NAME} is not set), the value is @code{"unknown"}. | 937 | provided @code{NAME} is not set), the value is @code{"unknown"}. |
| 906 | 938 | ||
| 907 | If @var{uid} is non-@code{nil}, then it should be an integer (a user-id) | 939 | If @var{uid} is non-@code{nil}, then it should be a number (a user-id) |
| 908 | or a string (a login name). Then @code{user-full-name} returns the full | 940 | or a string (a login name). Then @code{user-full-name} returns the full |
| 909 | name corresponding to that user-id or login name. If you specify a | 941 | name corresponding to that user-id or login name. If you specify a |
| 910 | user-id or login name that isn't defined, it returns @code{nil}. | 942 | user-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 | |||
| 956 | instead of the current time. The argument should be a list whose first | 988 | instead of the current time. The argument should be a list whose first |
| 957 | two elements are integers. Thus, you can use times obtained from | 989 | two 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 |
| 992 | a 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 | |||
| 971 | This function returns the system's time value as a list of three | 1004 | This function returns the system's time value as a list of three |
| 972 | integers: @code{(@var{high} @var{low} @var{microsec})}. The integers | 1005 | integers: @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 |
| 974 | 0:00 January 1, 1970 (local time), which is | 1007 | 0: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 | |||
| 984 | the resolution of only one second). | 1017 | the resolution of only one second). |
| 985 | 1018 | ||
| 986 | The first two elements can be compared with file time values such as you | 1019 | The first two elements can be compared with file time values such as you |
| 987 | get with the function @code{file-attributes}. @xref{File Attributes}. | 1020 | get 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 | |||
| 1001 | adjustment, then the value is constant through time. | 1035 | adjustment, then the value is constant through time. |
| 1002 | 1036 | ||
| 1003 | If the operating system doesn't supply all the information necessary to | 1037 | If the operating system doesn't supply all the information necessary to |
| 1004 | compute the value, both elements of the list are @code{nil}. | 1038 | compute the value, the unknown elements of the list are @code{nil}. |
| 1005 | 1039 | ||
| 1006 | The argument @var{time-value}, if given, specifies a time to analyze | 1040 | The argument @var{time-value}, if given, specifies a time to analyze |
| 1007 | instead of the current time. The argument should be a cons cell | 1041 | instead of the current time. The argument should have the same form |
| 1008 | containing two integers, or a list whose first two elements are | 1042 | as for @code{current-time-string} (see above). Thus, you can use |
| 1009 | integers. Thus, you can use times obtained from @code{current-time} | 1043 | times 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 |
| 1014 | This function specifies the local time zone according to @var{tz}. If | 1048 | This 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 |
| 1016 | default time zone. If @var{tz} is @code{t}, that means to use | 1050 | default time zone. If @var{tz} is @code{t}, that means to use |
| 1017 | Universal Time. | 1051 | Universal Time. Otherwise, @var{tz} should be a string specifying a |
| 1052 | time 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 | |||
| 1022 | seconds since the epoch. The argument @var{time-value}, if given, | 1057 | seconds since the epoch. The argument @var{time-value}, if given, |
| 1023 | specifies a time to convert instead of the current time. The argument | 1058 | specifies a time to convert instead of the current time. The argument |
| 1024 | should have the same form as for @code{current-time-string} (see | 1059 | should have the same form as for @code{current-time-string} (see |
| 1025 | above), and it also accepts the output of @code{current-time} and | 1060 | above). 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. | |||
| 1036 | to strings or to calendrical information. There is also a function to | 1071 | to strings or to calendrical information. There is also a function to |
| 1037 | convert calendrical information to a time value. You can get time | 1072 | convert calendrical information to a time value. You can get time |
| 1038 | values from the functions @code{current-time} (@pxref{Time of Day}) and | 1073 | values 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 | ||
| 1041 | Many operating systems are limited to time values that contain 32 bits | 1076 | Many operating systems are limited to time values that contain 32 bits |
| 1042 | of information; these systems typically handle only the times from | 1077 | of 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 |
| 1191 | The number of seconds past the minute, as an integer between 0 and 59. | 1226 | 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. | ||
| 1192 | @item minutes | 1228 | @item minutes |
| 1193 | The number of minutes past the hour, as an integer between 0 and 59. | 1229 | The 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}. | |||
| 1225 | The optional argument @var{zone} defaults to the current time zone and | 1261 | The optional argument @var{zone} defaults to the current time zone and |
| 1226 | its daylight savings time rules. If specified, it can be either a list | 1262 | its 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 | 1265 | integer (as you would get from @code{decode-time}). The specified |
| 1230 | alteration for daylight savings time. | 1266 | zone is used without any further alteration for daylight savings time. |
| 1231 | 1267 | ||
| 1232 | If you pass more than seven arguments to @code{encode-time}, the first | 1268 | If you pass more than seven arguments to @code{encode-time}, the first |
| 1233 | six are used as @var{seconds} through @var{year}, the last argument is | 1269 | six 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 | |||
| 1309 | timer to call a function that takes substantial time to run is likely | 1345 | timer to call a function that takes substantial time to run is likely |
| 1310 | to be annoying. | 1346 | to 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 |
| 1313 | This function arranges to call @var{function} with arguments @var{args} | 1349 | This sets up a timer that calls the function @var{function} with |
| 1314 | at time @var{time}. The argument @var{function} is a function to call | 1350 | arguments @var{args} at time @var{time}. If @var{repeat} is a number |
| 1315 | later, 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} |
| 1316 | The time @var{time} is specified as a string. | 1352 | 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. | ||
| 1317 | 1356 | ||
| 1318 | Absolute times may be specified in a wide variety of formats; this | 1357 | Absolute times may be specified in a wide variety of formats; this |
| 1319 | function tries to accept all the commonly used date formats. Valid | 1358 | function tries to accept all the commonly used date formats. The most |
| 1320 | formats include these two, | 1359 | convenient 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 |
| 1331 | as well. | 1370 | as well. |
| 1332 | 1371 | ||
| 1333 | To specify a relative time, use numbers followed by units. | 1372 | To specify a relative time as a string, use numbers followed by units. |
| 1334 | For example: | 1373 | For example: |
| 1335 | 1374 | ||
| 1336 | @table @samp | 1375 | @table @samp |
| @@ -1345,13 +1384,9 @@ denotes exactly 103 months, 123 days, and 10862 seconds from now. | |||
| 1345 | For relative time values, Emacs considers a month to be exactly thirty | 1384 | For relative time values, Emacs considers a month to be exactly thirty |
| 1346 | days, and a year to be exactly 365.25 days. | 1385 | days, and a year to be exactly 365.25 days. |
| 1347 | 1386 | ||
| 1348 | If @var{time} is a number (integer or floating point), that specifies a | 1387 | Not all convenient formats are strings. If @var{time} is a number |
| 1349 | relative time measured in seconds. | 1388 | (integer or floating point), that specifies a relative time measured |
| 1350 | 1389 | in seconds. | |
| 1351 | The argument @var{repeat} specifies how often to repeat the call. If | ||
| 1352 | @var{repeat} is @code{nil}, there are no repetitions; @var{function} is | ||
| 1353 | called just once, at @var{time}. If @var{repeat} is a number, it | ||
| 1354 | specifies a repetition period measured in seconds. | ||
| 1355 | 1390 | ||
| 1356 | In most cases, @var{repeat} has no effect on when @emph{first} call | 1391 | In most cases, @var{repeat} has no effect on when @emph{first} call |
| 1357 | takes place---@var{time} alone specifies that. There is one exception: | 1392 | takes place---@var{time} alone specifies that. There is one exception: |
| @@ -1362,7 +1397,7 @@ functions like @code{display-time}. | |||
| 1362 | The function @code{run-at-time} returns a timer value that identifies | 1397 | The function @code{run-at-time} returns a timer value that identifies |
| 1363 | the particular scheduled future action. You can use this value to call | 1398 | the 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{} |
| 1368 | Execute @var{body}, but give up after @var{seconds} seconds. If | 1403 | Execute @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 | |||
| 1388 | a timer to avoid waiting too long for an answer. @xref{Yes-or-No | 1423 | a timer to avoid waiting too long for an answer. @xref{Yes-or-No |
| 1389 | Queries}. | 1424 | Queries}. |
| 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 |
| 1392 | Set up a timer which runs when Emacs has been idle for @var{secs} | 1427 | Set up a timer which runs when Emacs has been idle for @var{secs} |
| 1393 | seconds. The value of @var{secs} may be an integer or a floating point | 1428 | seconds. The value of @var{secs} may be an integer or a floating point |
| 1394 | number. | 1429 | number. |
| @@ -1400,7 +1435,7 @@ remains idle for @var{secs} seconds. | |||
| 1400 | 1435 | ||
| 1401 | The function @code{run-with-idle-timer} returns a timer value which you | 1436 | The function @code{run-with-idle-timer} returns a timer value which you |
| 1402 | can use in calling @code{cancel-timer} (see below). | 1437 | can 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 |
| 1427 | Cancel the requested action for @var{timer}, which should be a value | 1462 | Cancel the requested action for @var{timer}, which should be a value |
| 1428 | previously returned by @code{run-at-time} or @code{run-with-idle-timer}. | 1463 | previously returned by @code{run-at-time} or @code{run-with-idle-timer}. |
| 1429 | This cancels the effect of that call to @code{run-at-time}; the arrival | 1464 | This cancels the effect of that call to one of these functions; the |
| 1430 | of the specified time will not cause anything special to happen. | 1465 | arrival 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 |
| 1454 | This function sets the mode for reading keyboard input. If | 1489 | This 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 |
| 1525 | This variable lets Lisp programs ``press'' the modifier keys on the | 1560 | This variable lets Lisp programs ``press'' the modifier keys on the |
| 1526 | keyboard. The value is a bit mask: | 1561 | keyboard. The value is a character. Only the modifiers of the |
| 1527 | 1562 | character matter. Each time the user types a keyboard key, it is | |
| 1528 | @table @asis | 1563 | altered as if those modifier keys were held down. For instance, if |
| 1529 | @item 1 | 1564 | you bind @code{extra-keyboard-modifiers} to @code{?\C-\M-a}, then all |
| 1530 | The @key{SHIFT} key. | 1565 | keyboard input characters typed during the scope of the binding will |
| 1531 | @item 2 | 1566 | have the control and meta modifiers applied to them. The character |
| 1532 | The @key{LOCK} key. | 1567 | @code{?\C-@@}, equivalent to the integer 0, does not count as a control |
| 1533 | @item 4 | 1568 | character for this purpose, but as a character with no modifiers. |
| 1534 | The @key{CTL} key. | 1569 | Thus, setting @code{extra-keyboard-modifiers} to zero cancels any |
| 1535 | @item 8 | 1570 | modification. |
| 1536 | The @key{META} key. | ||
| 1537 | @end table | ||
| 1538 | |||
| 1539 | Each time the user types a keyboard key, it is altered as if the | ||
| 1540 | modifier keys specified in the bit mask were held down. | ||
| 1541 | 1571 | ||
| 1542 | When using a window system, the program can ``press'' any of the | 1572 | When using a window system, the program can ``press'' any of the |
| 1543 | modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} | 1573 | modifier keys in this way. Otherwise, only the @key{CTL} and @key{META} |
| 1544 | keys can be virtually pressed. | 1574 | 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. | ||
| 1545 | @end defvar | 1578 | @end defvar |
| 1546 | 1579 | ||
| 1547 | @defvar keyboard-translate-table | 1580 | @defvar keyboard-translate-table |
| 1548 | This variable is the translate table for keyboard characters. It lets | 1581 | This variable is the translate table for keyboard characters. It lets |
| 1549 | you reshuffle the keys on the keyboard without changing any command | 1582 | you reshuffle the keys on the keyboard without changing any command |
| 1550 | bindings. Its value is normally a char-table, or else @code{nil}. | 1583 | 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.) | ||
| 1551 | 1585 | ||
| 1552 | If @code{keyboard-translate-table} is a char-table | 1586 | If @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 | |||
| 1587 | character after it is read from the terminal. Record-keeping features | 1621 | character after it is read from the terminal. Record-keeping features |
| 1588 | such as @code{recent-keys} and dribble files record the characters after | 1622 | such as @code{recent-keys} and dribble files record the characters after |
| 1589 | translation. | 1623 | 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. | ||
| 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 | ||
| 1700 | Finally, if you have enabled keyboard character set decoding using | 1739 | Finally, 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 |
| 1702 | translations listed above. @xref{Specifying Coding Systems}. In future | 1741 | translations listed above. @xref{Terminal I/O Encoding}. In future |
| 1703 | Emacs versions, character set decoding may be done before the other | 1742 | Emacs versions, character set decoding may be done before the other |
| 1704 | translations. | 1743 | translations. |
| 1705 | 1744 | ||
| @@ -1804,7 +1843,10 @@ often than to actual Emacs bugs. Once you are certain which characters | |||
| 1804 | were actually output, you can determine reliably whether they correspond | 1843 | were actually output, you can determine reliably whether they correspond |
| 1805 | to the Termcap specifications in use. | 1844 | to the Termcap specifications in use. |
| 1806 | 1845 | ||
| 1807 | See also @code{open-dribble-file} in @ref{Terminal Input}. | 1846 | 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}. | ||
| 1808 | 1850 | ||
| 1809 | @example | 1851 | @example |
| 1810 | @group | 1852 | @group |
| @@ -1969,10 +2011,16 @@ terminals, the flow control problem is gradually disappearing. For the | |||
| 1969 | mean time, Emacs provides a convenient way of enabling flow control if | 2011 | mean time, Emacs provides a convenient way of enabling flow control if |
| 1970 | you want it: call the function @code{enable-flow-control}. | 2012 | you 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 |
| 1973 | This function enables use of @kbd{C-s} and @kbd{C-q} for output flow | 2015 | When @var{arg} is a positive integer, this function enables use of |
| 1974 | control, 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 |
| 1975 | for them using @code{keyboard-translate-table} (@pxref{Translating Input}). | 2017 | 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. | ||
| 1976 | @end deffn | 2024 | @end deffn |
| 1977 | 2025 | ||
| 1978 | You can use the function @code{enable-flow-control-on} in your | 2026 | You 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} |
| 1996 | It sets @sc{cbreak} mode for terminal input, and tells the operating | 2044 | It sets @sc{cbreak} mode for terminal input, and tells the operating |
| 1997 | system to handle flow control, with @code{(set-input-mode nil t)}. | 2045 | system to handle flow control. This is done using @code{set-input-mode}. |
| 1998 | 2046 | ||
| 1999 | @item | 2047 | @item |
| 2000 | It sets up @code{keyboard-translate-table} to translate @kbd{C-\} and | 2048 | It 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 | |||
| 2061 | Emacs supports saving state by using a hook called | 2109 | Emacs 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 |
| 2063 | called when the session manager tells Emacs that the window system is | 2111 | called when the session manager tells Emacs that the window system is |
| 2064 | shutting down. The functions are called with the current buffer set | 2112 | shutting down. The functions are called with no arguments and with the |
| 2065 | to a temporary buffer. Each function can use @code{insert} to add | 2113 | current buffer set to a temporary buffer. Each function can use |
| 2066 | Lisp 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 |
| 2067 | file that another Emacs will later load in order to restart the saved session. | 2115 | saves the buffer in a file that a subsequent Emacs invocation will |
| 2116 | load in order to restart the saved session. | ||
| 2068 | 2117 | ||
| 2069 | If a function in @code{emacs-save-session-functions} returns | 2118 | If a function in @code{emacs-save-session-functions} returns |
| 2070 | non-@code{nil}, Emacs tells the session manager to cancel the | 2119 | non-@code{nil}, Emacs tells the session manager to cancel the |