home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 8
/
FreshFishVol8-CD1.bin
/
gnu
/
info
/
calc.info-10
(
.txt
)
< prev
next >
Wrap
GNU Info File
|
1994-12-22
|
49KB
|
816 lines
This is Info file calc.info, produced by Makeinfo-1.55 from the input
file calc.texinfo.
This file documents Calc, the GNU Emacs calculator.
Copyright (C) 1990, 1991 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.
Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided also
that the section entitled "GNU General Public License" is included
exactly as in the original, and provided that the entire resulting
derived work is distributed under the terms of a permission notice
identical to this one.
Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that the section entitled "GNU General Public License"
may be included in a translation approved by the author instead of in
the original English.
File: calc.info, Node: Stack and Trail, Next: Mode Settings, Prev: Data Types, Up: Top
Stack and Trail Commands
************************
This chapter describes the Calc commands for manipulating objects on the
stack and in the trail buffer. (These commands operate on objects of
any type, such as numbers, vectors, formulas, and incomplete objects.)
* Menu:
* Stack Manipulation::
* Editing Stack Entries::
* Trail Commands::
* Keep Arguments::
File: calc.info, Node: Stack Manipulation, Next: Editing Stack Entries, Prev: Stack and Trail, Up: Stack and Trail
Stack Manipulation Commands
===========================
To duplicate the top object on the stack, press RET or SPC (two
equivalent keys for the `calc-enter' command). Given a positive
numeric prefix argument, these commands duplicate several elements at
the top of the stack. Given a negative argument, these commands
duplicate the specified element of the stack. Given an argument of
zero, they duplicate the entire stack. For example, with `10 20 30' on
the stack, RET creates `10 20 30 30', `C-u 2 RET' creates `10 20 30 20
30', `C-u - 2 RET' creates `10 20 30 20', and `C-u 0 RET' creates `10
20 30 10 20 30'.
The LFD (`calc-over') command (on a key marked Line-Feed if you have
it, else on `C-j') is like `calc-enter' except that the sign of the
numeric prefix argument is interpreted oppositely. Also, with no
prefix argument the default argument is 2. Thus with `10 20 30' on the
stack, LFD and `C-u 2 LFD' are both equivalent to `C-u - 2 RET',
producing `10 20 30 20'.
To remove the top element from the stack, press DEL (`calc-pop').
The `C-d' key is a synonym for DEL. (If the top element is an
incomplete object with at least one element, the last element is
removed from it.) Given a positive numeric prefix argument, several
elements are removed. Given a negative argument, the specified element
of the stack is deleted. Given an argument of zero, the entire stack
is emptied. For example, with `10 20 30' on the stack, DEL leaves `10
20', `C-u 2 DEL' leaves `10', `C-u - 2 DEL' leaves `10 30', and `C-u 0
DEL' leaves an empty stack.
The M-DEL (`calc-pop-above') command is to DEL what LFD is to RET:
It interprets the sign of the numeric prefix argument in the opposite
way, and the default argument is 2. Thus M-DEL by itself removes the
second-from-top stack element, leaving the first, third, fourth, and so
on; `M-3 M-DEL' deletes the third stack element.
To exchange the top two elements of the stack, press TAB
(`calc-roll-down'). Given a positive numeric prefix argument, the
specified number of elements at the top of the stack are rotated
downward. Given a negative argument, the entire stack is rotated
downward the specified number of times. Given an argument of zero, the
entire stack is reversed top-for-bottom. For example, with `10 20 30
40 50' on the stack, TAB creates `10 20 30 50 40', `C-u 3 TAB' creates
`10 20 50 30 40', `C-u - 2 TAB' creates `40 50 10 20 30', and `C-u 0
TAB' creates `50 40 30 20 10'.
The command M-TAB (`calc-roll-up') is analogous to TAB except that
it rotates upward instead of downward. Also, the default with no
prefix argument is to rotate the top 3 elements. For example, with `10
20 30 40 50' on the stack, M-TAB creates `10 20 40 50 30', `C-u 4
M-TAB' creates `10 30 40 50 20', `C-u - 2 M-TAB' creates `30 40 50 10
20', and `C-u 0 M-TAB' creates `50 40 30 20 10'.
A good way to view the operation of TAB and M-TAB is in terms of
moving a particular element to a new position in the stack. With a
positive argument n, TAB moves the top stack element down to level n,
making room for it by pulling all the intervening stack elements toward
the top. M-TAB moves the element at level n up to the top. (Compare
with LFD, which copies instead of moving the element in level n.)
With a negative argument -n, TAB rotates the stack to move the
object in level n to the deepest place in the stack, and the object in
level n+1 to the top. M-TAB rotates the deepest stack element to be in
level n, also putting the top stack element in level n+1.
*Note Selecting Subformulas::, for a way to apply these commands to
any portion of a vector or formula on the stack.
File: calc.info, Node: Editing Stack Entries, Next: Trail Commands, Prev: Stack Manipulation, Up: Stack and Trail
Editing Stack Entries
=====================
The backquote, ``' (`calc-edit') command creates a temporary buffer
(`*Calc Edit*') for editing the top-of-stack value using regular Emacs
commands. With a numeric prefix argument, it edits the specified
number of stack entries at once. (An argument of zero edits the entire
stack; a negative argument edits one specific stack entry.)
When you are done editing, press `M-# M-#' to finish and return to
Calc. The RET and LFD keys also work to finish most sorts of editing,
though in some cases Calc leaves RET with its usual meaning ("insert a
newline") if it's a situation where you might want to insert new lines
into the editing buffer. The traditional Emacs "finish" key sequence,
`C-c C-c', also works to finish editing and may be easier to type,
depending on your keyboard.
When you finish editing, the Calculator parses the lines of text in
the `*Calc Edit*' buffer as numbers or formulas, replaces the original
stack elements in the original buffer with these new values, then kills
the `*Calc Edit*' buffer. The original Calculator buffer continues to
exist during editing, but for best results you should be careful not to
change it until you have finished the edit. You can also cancel the
edit by pressing `M-# x'.
The formula is normally reevaluated as it is put onto the stack.
For example, editing `a + 2' to `3 + 2' and pressing `M-# M-#' will
push 5 on the stack. If you use LFD to finish, Calc will put the
result on the stack without evaluating it.
If you give a prefix argument to `M-# M-#' (or `C-c C-c'), Calc will
not kill the `*Calc Edit*' buffer. You can switch back to that buffer
and continue editing if you wish. However, you should understand that
if you initiated the edit with ``', the `M-# M-#' operation will be
programmed to replace the top of the stack with the new edited value,
and it will do this even if you have rearranged the stack in the
meanwhile. This is not so much of a problem with other editing
commands, though, such as `s e' (`calc-edit-variable'; *note Operations
on Variables::.).
If the `calc-edit' command involves more than one stack entry, each
line of the `*Calc Edit*' buffer is interpreted as a separate formula.
Otherwise, the entire buffer is interpreted as one formula, with line
breaks ignored. (You can use `C-o' or `C-q C-j' to insert a newline in
the buffer without pressing RET.)
The ``' key also works during numeric or algebraic entry. The text
entered so far is moved to the `*Calc Edit*' buffer for more extensive
editing than is convenient in the minibuffer.
File: calc.info, Node: Trail Commands, Next: Keep Arguments, Prev: Editing Stack Entries, Up: Stack and Trail
Trail Commands
==============
The commands for manipulating the Calc Trail buffer are two-key