diff options
| author | Glenn Morris | 2012-03-25 18:35:47 -0700 |
|---|---|---|
| committer | Glenn Morris | 2012-03-25 18:35:47 -0700 |
| commit | 02243d9dc1b91f929ea0052e5079ca5c41fd99c0 (patch) | |
| tree | 6d44b7d0595a0e88c1a704e14b10cdaae6553e84 | |
| parent | 33da7b164bf352bdef4a8b0cf91a353f99a1c9ff (diff) | |
| download | emacs-02243d9dc1b91f929ea0052e5079ca5c41fd99c0.tar.gz emacs-02243d9dc1b91f929ea0052e5079ca5c41fd99c0.zip | |
More small edits for lispref/os.texi
* doc/lispref/os.texi (Killing Emacs): Copyedits.
(Suspending Emacs): Copyedits. Mention not very relevant with GUIs.
Shorten the example, use more standard shell prompts.
* lisp/files.el (save-buffers-kill-emacs): Doc fix.
| -rw-r--r-- | doc/lispref/ChangeLog | 3 | ||||
| -rw-r--r-- | doc/lispref/os.texi | 93 | ||||
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/files.el | 6 |
4 files changed, 58 insertions, 46 deletions
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog index ce532c27f4d..d80732833e8 100644 --- a/doc/lispref/ChangeLog +++ b/doc/lispref/ChangeLog | |||
| @@ -3,6 +3,9 @@ | |||
| 3 | * os.texi (Startup Summary): Copyedits. Fix startup screen logic. | 3 | * os.texi (Startup Summary): Copyedits. Fix startup screen logic. |
| 4 | (Init File): Copyedits. | 4 | (Init File): Copyedits. |
| 5 | (Command-Line Arguments): Copyedits. Do not mention argv alias. | 5 | (Command-Line Arguments): Copyedits. Do not mention argv alias. |
| 6 | (Killing Emacs): Copyedits. | ||
| 7 | (Suspending Emacs): Copyedits. Mention not very relevant with GUIs. | ||
| 8 | Shorten the example, use more standard shell prompts. | ||
| 6 | 9 | ||
| 7 | 2012-03-25 Chong Yidong <cyd@gnu.org> | 10 | 2012-03-25 Chong Yidong <cyd@gnu.org> |
| 8 | 11 | ||
diff --git a/doc/lispref/os.texi b/doc/lispref/os.texi index 2571c7b2539..7e4cfc0e31f 100644 --- a/doc/lispref/os.texi +++ b/doc/lispref/os.texi | |||
| @@ -601,7 +601,9 @@ as a file name to visit. | |||
| 601 | 601 | ||
| 602 | There are two ways to get out of Emacs: you can kill the Emacs job, | 602 | There are two ways to get out of Emacs: you can kill the Emacs job, |
| 603 | which exits permanently, or you can suspend it, which permits you to | 603 | which exits permanently, or you can suspend it, which permits you to |
| 604 | reenter the Emacs process later. | 604 | reenter the Emacs process later. (In a graphical environment, you can |
| 605 | of course simply switch to another application without doing anything | ||
| 606 | special to Emacs, then switch back to Emacs when you want.) | ||
| 605 | 607 | ||
| 606 | @menu | 608 | @menu |
| 607 | * Killing Emacs:: Exiting Emacs irreversibly. | 609 | * Killing Emacs:: Exiting Emacs irreversibly. |
| @@ -613,9 +615,10 @@ reenter the Emacs process later. | |||
| 613 | @subsection Killing Emacs | 615 | @subsection Killing Emacs |
| 614 | @cindex killing Emacs | 616 | @cindex killing Emacs |
| 615 | 617 | ||
| 616 | Killing Emacs means ending the execution of the Emacs process. The | 618 | Killing Emacs means ending the execution of the Emacs process. |
| 617 | parent process normally resumes control. The low-level primitive for | 619 | If you started Emacs from a terminal, the parent process normally |
| 618 | killing Emacs is @code{kill-emacs}. | 620 | resumes control. The low-level primitive for killing Emacs is |
| 621 | @code{kill-emacs}. | ||
| 619 | 622 | ||
| 620 | @deffn Command kill-emacs &optional exit-data | 623 | @deffn Command kill-emacs &optional exit-data |
| 621 | This command calls the hook @code{kill-emacs-hook}, then exits the | 624 | This command calls the hook @code{kill-emacs-hook}, then exits the |
| @@ -686,11 +689,17 @@ use the appropriate command in the parent shell---most likely | |||
| 686 | Suspending works only on a terminal device from which the Emacs | 689 | Suspending works only on a terminal device from which the Emacs |
| 687 | session was started. We call that device the @dfn{controlling | 690 | session was started. We call that device the @dfn{controlling |
| 688 | terminal} of the session. Suspending is not allowed if the | 691 | terminal} of the session. Suspending is not allowed if the |
| 689 | controlling terminal is a graphical terminal. | 692 | controlling terminal is a graphical terminal. Suspending is usually |
| 690 | 693 | not relevant in graphical environments, since you can simply switch to | |
| 691 | Some operating systems do not support suspension of jobs; on these | 694 | another application without doing anything special to Emacs. |
| 692 | systems, ``suspension'' actually creates a new shell temporarily as a | 695 | |
| 693 | subprocess of Emacs. Then you would exit the shell to return to Emacs. | 696 | @c FIXME? Are there any systems Emacs still supports that do not |
| 697 | @c have SIGTSTP? | ||
| 698 | @cindex SIGTSTP | ||
| 699 | Some operating systems (those without @code{SIGTSTP}, or MS-DOS) do | ||
| 700 | not support suspension of jobs; on these systems, ``suspension'' | ||
| 701 | actually creates a new shell temporarily as a subprocess of Emacs. | ||
| 702 | Then you would exit the shell to return to Emacs. | ||
| 694 | 703 | ||
| 695 | @deffn Command suspend-emacs &optional string | 704 | @deffn Command suspend-emacs &optional string |
| 696 | This function stops Emacs and returns control to the superior process. | 705 | This function stops Emacs and returns control to the superior process. |
| @@ -705,9 +714,10 @@ before suspending Emacs, or this function signals an error. | |||
| 705 | @xref{Multiple Terminals}. | 714 | @xref{Multiple Terminals}. |
| 706 | 715 | ||
| 707 | If @var{string} is non-@code{nil}, its characters are sent to Emacs's | 716 | If @var{string} is non-@code{nil}, its characters are sent to Emacs's |
| 708 | superior shell, to be read as terminal input. The characters in | 717 | superior shell, to be read as terminal input. |
| 709 | @var{string} are not echoed by the superior shell; only the results | 718 | @c FIXME? It seems to me that shell does echo STRING. |
| 710 | appear. | 719 | The characters in @var{string} are not echoed by the superior shell; |
| 720 | only the results appear. | ||
| 711 | 721 | ||
| 712 | Before suspending, @code{suspend-emacs} runs the normal hook | 722 | Before suspending, @code{suspend-emacs} runs the normal hook |
| 713 | @code{suspend-hook}. After the user resumes Emacs, | 723 | @code{suspend-hook}. After the user resumes Emacs, |
| @@ -718,34 +728,23 @@ The next redisplay after resumption will redraw the entire screen, | |||
| 718 | unless the variable @code{no-redraw-on-reenter} is non-@code{nil}. | 728 | unless the variable @code{no-redraw-on-reenter} is non-@code{nil}. |
| 719 | @xref{Refresh Screen}. | 729 | @xref{Refresh Screen}. |
| 720 | 730 | ||
| 721 | In the following example, note that @samp{pwd} is not echoed after | 731 | Here is an example of how you could use these hooks: |
| 722 | Emacs is suspended. But it is read and executed by the shell. | ||
| 723 | 732 | ||
| 724 | @smallexample | 733 | @smallexample |
| 725 | @group | 734 | @group |
| 726 | (suspend-emacs) | ||
| 727 | @result{} nil | ||
| 728 | @end group | ||
| 729 | |||
| 730 | @group | ||
| 731 | (add-hook 'suspend-hook | 735 | (add-hook 'suspend-hook |
| 732 | (function (lambda () | 736 | (lambda () (or (y-or-n-p "Really suspend? ") |
| 733 | (or (y-or-n-p | 737 | (error "Suspend canceled")))) |
| 734 | "Really suspend? ") | ||
| 735 | (error "Suspend canceled"))))) | ||
| 736 | @result{} (lambda nil | ||
| 737 | (or (y-or-n-p "Really suspend? ") | ||
| 738 | (error "Suspend canceled"))) | ||
| 739 | @end group | ||
| 740 | @group | ||
| 741 | (add-hook 'suspend-resume-hook | ||
| 742 | (function (lambda () (message "Resumed!")))) | ||
| 743 | @result{} (lambda nil (message "Resumed!")) | ||
| 744 | @end group | ||
| 745 | @group | ||
| 746 | (suspend-emacs "pwd") | ||
| 747 | @result{} nil | ||
| 748 | @end group | 738 | @end group |
| 739 | (add-hook 'suspend-resume-hook (lambda () (message "Resumed!") | ||
| 740 | (sit-for 2))) | ||
| 741 | @end smallexample | ||
| 742 | @c The sit-for prevents the ``nil'' that suspend-emacs returns | ||
| 743 | @c hiding the message. | ||
| 744 | |||
| 745 | Here is what you would see upon evaluating @code{(suspend-emacs "pwd")}: | ||
| 746 | |||
| 747 | @smallexample | ||
| 749 | @group | 748 | @group |
| 750 | ---------- Buffer: Minibuffer ---------- | 749 | ---------- Buffer: Minibuffer ---------- |
| 751 | Really suspend? @kbd{y} | 750 | Really suspend? @kbd{y} |
| @@ -754,8 +753,8 @@ Really suspend? @kbd{y} | |||
| 754 | 753 | ||
| 755 | @group | 754 | @group |
| 756 | ---------- Parent Shell ---------- | 755 | ---------- Parent Shell ---------- |
| 757 | lewis@@slug[23] % /user/lewis/manual | 756 | bash$ /home/username |
| 758 | lewis@@slug[24] % fg | 757 | bash$ fg |
| 759 | @end group | 758 | @end group |
| 760 | 759 | ||
| 761 | @group | 760 | @group |
| @@ -763,6 +762,10 @@ lewis@@slug[24] % fg | |||
| 763 | Resumed! | 762 | Resumed! |
| 764 | @end group | 763 | @end group |
| 765 | @end smallexample | 764 | @end smallexample |
| 765 | |||
| 766 | @c FIXME? AFAICS, it is echoed. | ||
| 767 | Note that @samp{pwd} is not echoed after Emacs is suspended. But it | ||
| 768 | is read and executed by the shell. | ||
| 766 | @end deffn | 769 | @end deffn |
| 767 | 770 | ||
| 768 | @defvar suspend-hook | 771 | @defvar suspend-hook |
| @@ -791,23 +794,23 @@ terminal object as an argument to each function. | |||
| 791 | 794 | ||
| 792 | @defun resume-tty &optional tty | 795 | @defun resume-tty &optional tty |
| 793 | This function resumes the previously suspended terminal device | 796 | This function resumes the previously suspended terminal device |
| 794 | @var{tty}; @var{tty} can be a terminal object, a frame (meaning the | 797 | @var{tty}; where @var{tty} has the same possible values as it does |
| 795 | terminal for that frame), or @code{nil} (meaning the terminal for the | 798 | for @code{suspend-tty}. |
| 796 | selected frame). | ||
| 797 | 799 | ||
| 798 | @vindex resume-tty-functions | 800 | @vindex resume-tty-functions |
| 799 | This function reopens the terminal device, re-initializes it, and | 801 | This function reopens the terminal device, re-initializes it, and |
| 800 | redraws its with that terminal's selected frame. It then runs the | 802 | redraws it with that terminal's selected frame. It then runs the |
| 801 | hook @code{resume-tty-functions}, passing the terminal object as an | 803 | hook @code{resume-tty-functions}, passing the terminal object as an |
| 802 | argument to each function. | 804 | argument to each function. |
| 803 | 805 | ||
| 804 | If the same device is already used by another Emacs terminal, this | 806 | If the same device is already used by another Emacs terminal, this |
| 805 | function signals an error. | 807 | function signals an error. If @var{tty} is not suspended, this |
| 808 | function does nothing. | ||
| 806 | @end defun | 809 | @end defun |
| 807 | 810 | ||
| 808 | @defun controlling-tty-p &optional terminal | 811 | @defun controlling-tty-p &optional tty |
| 809 | This function returns non-@code{nil} if @var{terminal} is the | 812 | This function returns non-@code{nil} if @var{tty} is the |
| 810 | controlling terminal of the Emacs session; @code{terminal} can be a | 813 | controlling terminal of the Emacs session; @var{tty} can be a |
| 811 | terminal object, a frame (meaning the terminal for that frame), or | 814 | terminal object, a frame (meaning the terminal for that frame), or |
| 812 | @code{nil} (meaning the terminal for the selected frame). | 815 | @code{nil} (meaning the terminal for the selected frame). |
| 813 | @end defun | 816 | @end defun |
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0903c2c2fd5..799024ae422 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2012-03-26 Glenn Morris <rgm@gnu.org> | 1 | 2012-03-26 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * files.el (save-buffers-kill-emacs): Doc fix. | ||
| 4 | |||
| 3 | * startup.el (normal-top-level, command-line, command-line-1): | 5 | * startup.el (normal-top-level, command-line, command-line-1): |
| 4 | Give them doc strings. | 6 | Give them doc strings. |
| 5 | 7 | ||
diff --git a/lisp/files.el b/lisp/files.el index 8c61c288be9..b3fc0766ac5 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -6290,7 +6290,11 @@ be a predicate function such as `yes-or-no-p'." | |||
| 6290 | 6290 | ||
| 6291 | (defun save-buffers-kill-emacs (&optional arg) | 6291 | (defun save-buffers-kill-emacs (&optional arg) |
| 6292 | "Offer to save each buffer, then kill this Emacs process. | 6292 | "Offer to save each buffer, then kill this Emacs process. |
| 6293 | With prefix ARG, silently save all file-visiting buffers, then kill." | 6293 | With prefix ARG, silently save all file-visiting buffers without asking. |
| 6294 | If there are active processes where `process-query-on-exit-flag' | ||
| 6295 | returns non-nil, asks whether processes should be killed. | ||
| 6296 | Runs the members of `kill-emacs-query-functions' in turn and stops | ||
| 6297 | if any returns nil. If `confirm-kill-emacs' is non-nil, calls it." | ||
| 6294 | (interactive "P") | 6298 | (interactive "P") |
| 6295 | (save-some-buffers arg t) | 6299 | (save-some-buffers arg t) |
| 6296 | (and (or (not (memq t (mapcar (function | 6300 | (and (or (not (memq t (mapcar (function |