aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-03-25 18:35:47 -0700
committerGlenn Morris2012-03-25 18:35:47 -0700
commit02243d9dc1b91f929ea0052e5079ca5c41fd99c0 (patch)
tree6d44b7d0595a0e88c1a704e14b10cdaae6553e84
parent33da7b164bf352bdef4a8b0cf91a353f99a1c9ff (diff)
downloademacs-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/ChangeLog3
-rw-r--r--doc/lispref/os.texi93
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/files.el6
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
72012-03-25 Chong Yidong <cyd@gnu.org> 102012-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,
603which exits permanently, or you can suspend it, which permits you to 603which exits permanently, or you can suspend it, which permits you to
604reenter the Emacs process later. 604reenter the Emacs process later. (In a graphical environment, you can
605of course simply switch to another application without doing anything
606special 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.
617parent process normally resumes control. The low-level primitive for 619If you started Emacs from a terminal, the parent process normally
618killing Emacs is @code{kill-emacs}. 620resumes 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
621This command calls the hook @code{kill-emacs-hook}, then exits the 624This 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
687session was started. We call that device the @dfn{controlling 690session was started. We call that device the @dfn{controlling
688terminal} of the session. Suspending is not allowed if the 691terminal} of the session. Suspending is not allowed if the
689controlling terminal is a graphical terminal. 692controlling terminal is a graphical terminal. Suspending is usually
690 693not relevant in graphical environments, since you can simply switch to
691 Some operating systems do not support suspension of jobs; on these 694another application without doing anything special to Emacs.
692systems, ``suspension'' actually creates a new shell temporarily as a 695
693subprocess 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
700not support suspension of jobs; on these systems, ``suspension''
701actually creates a new shell temporarily as a subprocess of Emacs.
702Then 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
696This function stops Emacs and returns control to the superior process. 705This 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
707If @var{string} is non-@code{nil}, its characters are sent to Emacs's 716If @var{string} is non-@code{nil}, its characters are sent to Emacs's
708superior shell, to be read as terminal input. The characters in 717superior 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.
710appear. 719The characters in @var{string} are not echoed by the superior shell;
720only the results appear.
711 721
712Before suspending, @code{suspend-emacs} runs the normal hook 722Before 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,
718unless the variable @code{no-redraw-on-reenter} is non-@code{nil}. 728unless the variable @code{no-redraw-on-reenter} is non-@code{nil}.
719@xref{Refresh Screen}. 729@xref{Refresh Screen}.
720 730
721In the following example, note that @samp{pwd} is not echoed after 731Here is an example of how you could use these hooks:
722Emacs 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
745Here is what you would see upon evaluating @code{(suspend-emacs "pwd")}:
746
747@smallexample
749@group 748@group
750---------- Buffer: Minibuffer ---------- 749---------- Buffer: Minibuffer ----------
751Really suspend? @kbd{y} 750Really suspend? @kbd{y}
@@ -754,8 +753,8 @@ Really suspend? @kbd{y}
754 753
755@group 754@group
756---------- Parent Shell ---------- 755---------- Parent Shell ----------
757lewis@@slug[23] % /user/lewis/manual 756bash$ /home/username
758lewis@@slug[24] % fg 757bash$ fg
759@end group 758@end group
760 759
761@group 760@group
@@ -763,6 +762,10 @@ lewis@@slug[24] % fg
763Resumed! 762Resumed!
764@end group 763@end group
765@end smallexample 764@end smallexample
765
766@c FIXME? AFAICS, it is echoed.
767Note that @samp{pwd} is not echoed after Emacs is suspended. But it
768is 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
793This function resumes the previously suspended terminal device 796This 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
795terminal for that frame), or @code{nil} (meaning the terminal for the 798for @code{suspend-tty}.
796selected frame).
797 799
798@vindex resume-tty-functions 800@vindex resume-tty-functions
799This function reopens the terminal device, re-initializes it, and 801This function reopens the terminal device, re-initializes it, and
800redraws its with that terminal's selected frame. It then runs the 802redraws it with that terminal's selected frame. It then runs the
801hook @code{resume-tty-functions}, passing the terminal object as an 803hook @code{resume-tty-functions}, passing the terminal object as an
802argument to each function. 804argument to each function.
803 805
804If the same device is already used by another Emacs terminal, this 806If the same device is already used by another Emacs terminal, this
805function signals an error. 807function signals an error. If @var{tty} is not suspended, this
808function does nothing.
806@end defun 809@end defun
807 810
808@defun controlling-tty-p &optional terminal 811@defun controlling-tty-p &optional tty
809This function returns non-@code{nil} if @var{terminal} is the 812This function returns non-@code{nil} if @var{tty} is the
810controlling terminal of the Emacs session; @code{terminal} can be a 813controlling terminal of the Emacs session; @var{tty} can be a
811terminal object, a frame (meaning the terminal for that frame), or 814terminal 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 @@
12012-03-26 Glenn Morris <rgm@gnu.org> 12012-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.
6293With prefix ARG, silently save all file-visiting buffers, then kill." 6293With prefix ARG, silently save all file-visiting buffers without asking.
6294If there are active processes where `process-query-on-exit-flag'
6295returns non-nil, asks whether processes should be killed.
6296Runs the members of `kill-emacs-query-functions' in turn and stops
6297if 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