home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 8 / FreshFishVol8-CD1.bin / gnu / info / calc.info-10 (.txt) < prev    next >
GNU Info File  |  1994-12-22  |  49KB  |  816 lines

  1. This is Info file calc.info, produced by Makeinfo-1.55 from the input
  2. file calc.texinfo.
  3.    This file documents Calc, the GNU Emacs calculator.
  4.    Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  5.    Permission is granted to make and distribute verbatim copies of this
  6. manual provided the copyright notice and this permission notice are
  7. preserved on all copies.
  8.    Permission is granted to copy and distribute modified versions of
  9. this manual under the conditions for verbatim copying, provided also
  10. that the section entitled "GNU General Public License" is included
  11. exactly as in the original, and provided that the entire resulting
  12. derived work is distributed under the terms of a permission notice
  13. identical to this one.
  14.    Permission is granted to copy and distribute translations of this
  15. manual into another language, under the above conditions for modified
  16. versions, except that the section entitled "GNU General Public License"
  17. may be included in a translation approved by the author instead of in
  18. the original English.
  19. File: calc.info,  Node: Stack and Trail,  Next: Mode Settings,  Prev: Data Types,  Up: Top
  20. Stack and Trail Commands
  21. ************************
  22. This chapter describes the Calc commands for manipulating objects on the
  23. stack and in the trail buffer.  (These commands operate on objects of
  24. any type, such as numbers, vectors, formulas, and incomplete objects.)
  25. * Menu:
  26. * Stack Manipulation::
  27. * Editing Stack Entries::
  28. * Trail Commands::
  29. * Keep Arguments::
  30. File: calc.info,  Node: Stack Manipulation,  Next: Editing Stack Entries,  Prev: Stack and Trail,  Up: Stack and Trail
  31. Stack Manipulation Commands
  32. ===========================
  33. To duplicate the top object on the stack, press RET or SPC (two
  34. equivalent keys for the `calc-enter' command).  Given a positive
  35. numeric prefix argument, these commands duplicate several elements at
  36. the top of the stack.  Given a negative argument, these commands
  37. duplicate the specified element of the stack.  Given an argument of
  38. zero, they duplicate the entire stack.  For example, with `10 20 30' on
  39. the stack, RET creates `10 20 30 30', `C-u 2 RET' creates `10 20 30 20
  40. 30', `C-u - 2 RET' creates `10 20 30 20', and `C-u 0 RET' creates `10
  41. 20 30 10 20 30'.
  42.    The LFD (`calc-over') command (on a key marked Line-Feed if you have
  43. it, else on `C-j') is like `calc-enter' except that the sign of the
  44. numeric prefix argument is interpreted oppositely.  Also, with no
  45. prefix argument the default argument is 2.  Thus with `10 20 30' on the
  46. stack, LFD and `C-u 2 LFD' are both equivalent to `C-u - 2 RET',
  47. producing `10 20 30 20'.
  48.    To remove the top element from the stack, press DEL (`calc-pop').
  49. The `C-d' key is a synonym for DEL.  (If the top element is an
  50. incomplete object with at least one element, the last element is
  51. removed from it.)  Given a positive numeric prefix argument, several
  52. elements are removed.  Given a negative argument, the specified element
  53. of the stack is deleted.  Given an argument of zero, the entire stack
  54. is emptied.  For example, with `10 20 30' on the stack, DEL leaves `10
  55. 20', `C-u 2 DEL' leaves `10', `C-u - 2 DEL' leaves `10 30', and `C-u 0
  56. DEL' leaves an empty stack.
  57.    The M-DEL (`calc-pop-above') command is to DEL what LFD is to RET:
  58. It interprets the sign of the numeric prefix argument in the opposite
  59. way, and the default argument is 2.  Thus M-DEL by itself removes the
  60. second-from-top stack element, leaving the first, third, fourth, and so
  61. on; `M-3 M-DEL' deletes the third stack element.
  62.    To exchange the top two elements of the stack, press TAB
  63. (`calc-roll-down').  Given a positive numeric prefix argument, the
  64. specified number of elements at the top of the stack are rotated
  65. downward.  Given a negative argument, the entire stack is rotated
  66. downward the specified number of times.  Given an argument of zero, the
  67. entire stack is reversed top-for-bottom.  For example, with `10 20 30
  68. 40 50' on the stack, TAB creates `10 20 30 50 40', `C-u 3 TAB' creates
  69. `10 20 50 30 40', `C-u - 2 TAB' creates `40 50 10 20 30', and `C-u 0
  70. TAB' creates `50 40 30 20 10'.
  71.    The command M-TAB (`calc-roll-up') is analogous to TAB except that
  72. it rotates upward instead of downward.  Also, the default with no
  73. prefix argument is to rotate the top 3 elements.  For example, with `10
  74. 20 30 40 50' on the stack, M-TAB creates `10 20 40 50 30', `C-u 4
  75. M-TAB' creates `10 30 40 50 20', `C-u - 2 M-TAB' creates `30 40 50 10
  76. 20', and `C-u 0 M-TAB' creates `50 40 30 20 10'.
  77.    A good way to view the operation of TAB and M-TAB is in terms of
  78. moving a particular element to a new position in the stack.  With a
  79. positive argument n, TAB moves the top stack element down to level n,
  80. making room for it by pulling all the intervening stack elements toward
  81. the top.  M-TAB moves the element at level n up to the top.  (Compare
  82. with LFD, which copies instead of moving the element in level n.)
  83.    With a negative argument -n, TAB rotates the stack to move the
  84. object in level n to the deepest place in the stack, and the object in
  85. level n+1 to the top.  M-TAB rotates the deepest stack element to be in
  86. level n, also putting the top stack element in level n+1.
  87.    *Note Selecting Subformulas::, for a way to apply these commands to
  88. any portion of a vector or formula on the stack.
  89. File: calc.info,  Node: Editing Stack Entries,  Next: Trail Commands,  Prev: Stack Manipulation,  Up: Stack and Trail
  90. Editing Stack Entries
  91. =====================
  92. The backquote, ``' (`calc-edit') command creates a temporary buffer
  93. (`*Calc Edit*') for editing the top-of-stack value using regular Emacs
  94. commands.  With a numeric prefix argument, it edits the specified
  95. number of stack entries at once.  (An argument of zero edits the entire
  96. stack; a negative argument edits one specific stack entry.)
  97.    When you are done editing, press `M-# M-#' to finish and return to
  98. Calc.  The RET and LFD keys also work to finish most sorts of editing,
  99. though in some cases Calc leaves RET with its usual meaning ("insert a
  100. newline") if it's a situation where you might want to insert new lines
  101. into the editing buffer.  The traditional Emacs "finish" key sequence,
  102. `C-c C-c', also works to finish editing and may be easier to type,
  103. depending on your keyboard.
  104.    When you finish editing, the Calculator parses the lines of text in
  105. the `*Calc Edit*' buffer as numbers or formulas, replaces the original
  106. stack elements in the original buffer with these new values, then kills
  107. the `*Calc Edit*' buffer.  The original Calculator buffer continues to
  108. exist during editing, but for best results you should be careful not to
  109. change it until you have finished the edit.  You can also cancel the
  110. edit by pressing `M-# x'.
  111.    The formula is normally reevaluated as it is put onto the stack.
  112. For example, editing `a + 2' to `3 + 2' and pressing `M-# M-#' will
  113. push 5 on the stack.  If you use LFD to finish, Calc will put the
  114. result on the stack without evaluating it.
  115.    If you give a prefix argument to `M-# M-#' (or `C-c C-c'), Calc will
  116. not kill the `*Calc Edit*' buffer.  You can switch back to that buffer
  117. and continue editing if you wish.  However, you should understand that
  118. if you initiated the edit with ``', the `M-# M-#' operation will be
  119. programmed to replace the top of the stack with the new edited value,
  120. and it will do this even if you have rearranged the stack in the
  121. meanwhile.  This is not so much of a problem with other editing
  122. commands, though, such as `s e' (`calc-edit-variable'; *note Operations
  123. on Variables::.).
  124.    If the `calc-edit' command involves more than one stack entry, each
  125. line of the `*Calc Edit*' buffer is interpreted as a separate formula.
  126. Otherwise, the entire buffer is interpreted as one formula, with line
  127. breaks ignored.  (You can use `C-o' or `C-q C-j' to insert a newline in
  128. the buffer without pressing RET.)
  129.    The ``' key also works during numeric or algebraic entry.  The text
  130. entered so far is moved to the `*Calc Edit*' buffer for more extensive
  131. editing than is convenient in the minibuffer.
  132. File: calc.info,  Node: Trail Commands,  Next: Keep Arguments,  Prev: Editing Stack Entries,  Up: Stack and Trail
  133. Trail Commands
  134. ==============
  135. The commands for manipulating the Calc Trail buffer are two-key
  136.