1ORPIERC(5) configuration file for the Orpie calculator ORPIERC(5)
2
3
4
6 orpierc is the configuration textfile for the orpie(1) console calcula‐
7 tor.
8
10 CAUTION: while this manpage should be suitable as a quick reference, it
11 may be subject to miscellaneous shortcomings in typesetting. The defin‐
12 itive documentation is the user manual provided with Orpie in PDF for‐
13 mat.
14
15 Orpie reads a run-configuration textfile (generally /etc/orpierc or
16 /usr/local/etc/orpierc) to determine key and command bindings. You can
17 create a personalized configuration file in $HOME/.orpierc, and select
18 bindings that match your usage patterns. The recommended procedure is
19 to ``include'' the orpierc file provided with Orpie (see INCLUDING
20 OTHER RCFILES), and add or remove settings as desired.
21
23 You may notice that the orpierc syntax is similar to the syntax used in
24 the configuration file for the Mutt email client (muttrc).
25
26 Within the orpierc file, strings should be enclosed in double quotes
27 ("). A double quote character inside a string may be represented by \"
28 . The backslash character must be represented by doubling it (\\).
29
30 INCLUDING OTHER RCFILES
31 Syntax: include filename_string
32 This syntax can be used to include one run-configuration file within
33 another. This command could be used to load the default orpierc file
34 (probably found in /etc/orpierc) within your personalized rcfile,
35 {/.orpierc}. The filename string should be enclosed in quotes.
36
37 SETTING CONFIGURATION VARIABLES
38 Syntax: set variable=value_string
39 Several configuration variables can be set using this syntax; check the
40 CONFIGURATION VARIABLES description to see a list. The variables are
41 unquoted, but the values should be quoted strings.
42
43 CREATING KEY BINDINGS
44 Syntax: bind key_identifier operation
45 This command will bind a keypress to execute a calculator operation.
46 The various operations, which should not be enclosed in quotes, may be
47 found in the section on CALCULATOR OPERATIONS. Key identifiers may be
48 specified by strings that represent a single keypress, for example "m"
49 (quotes included). The key may be prefixed with "\\C" or "\\M" to rep‐
50 resent Control or Meta (Alt) modifiers, respectively; note that the
51 backslash must be doubled. A number of special keys lack single-charac‐
52 ter representations, so the following strings may be used to represent
53 them:
54
55 * "<esc>"
56
57 * "<tab>"
58
59 * "<enter>"
60
61 * "<return>"
62
63 * "<insert>"
64
65 * "<home>"
66
67 * "<end>"
68
69 * "<pageup>"
70
71 * "<pagedown>"
72
73 * "<space>"
74
75 * "<left>"
76
77 * "<right>"
78
79 * "<up>"
80
81 * "<down>"
82
83 * "<f1>" to "<f12>"
84
85 Due to differences between various terminal emulators, this key identi‐
86 fier syntax may not be adequate to describe every keypress. As a work‐
87 around, Orpie will also accept key identifiers in octal notation. As an
88 example, you could use \024 (do not enclose it in quotes) to represent
89 Ctrl-T.
90
91 Orpie includes a secondary executable, orpie-curses-keys, that prints
92 out the key identifiers associated with keypresses. You may find it
93 useful when customizing orpierc.
94
95 Multiple keys may be bound to the same operation, if desired.
96
97 REMOVING KEY BINDINGS
98 Syntax:
99 unbind_function key_identifier
100 unbind_command key_identifier
101 unbind_edit key_identifier
102 unbind_browse key_identifier
103 unbind_abbrev key_identifier
104 unbind_variable key_identifier
105 unbind_integer key_identifier
106 These commands will remove key bindings associated with the various
107 entry modes (functions, commands, editing operations, etc.). The key
108 identifiers should be defined using the syntax described in the previ‐
109 ous section.
110
111 CREATING KEY AUTO-BINDINGS
112 Syntax: autobind key_identifier
113 In order to make repetitive calculations more pleasant, Orpie offers an
114 automatic key binding feature. When a function or command is executed
115 using its abbreviation, one of the keys selected by the autobind syntax
116 will be automatically bound to that operation (unless the operation has
117 already been bound to a key). The current set of autobindings can be
118 viewed in the help panel by executing command_cycle_help (bound to 'h'
119 by default).
120
121 The syntax for the key identifiers is provided in the previous section.
122
123 CREATING OPERATION ABBREVIATIONS
124 Syntax: abbrev operation_abbreviation operation
125 You can use this syntax to set the abbreviations used within Orpie to
126 represent the various functions and commands. A list of available oper‐
127 ations may be found in the CALCULATOR OPERATIONS section. The opera‐
128 tion abbreviations should be quoted strings, for example "sin" or
129 "log".
130
131 Orpie performs autocompletion on these abbreviations, allowing you to
132 type usually just a few letters in order to select the desired command.
133 The order of the autocompletion matches will be the same as the order
134 in which the abbreviations are registered by the rcfile--so you may
135 wish to place the more commonly used operation abbreviations earlier in
136 the list.
137
138 Multiple abbreviations may be bound to the same operation, if desired.
139
140 REMOVING OPERATION ABBREVIATIONS
141 Syntax: unabbrev operation_abbreviation
142 This syntax can be used to remove an operation abbreviation. The opera‐
143 tion abbreviations should be quoted strings, as described in the previ‐
144 ous section.
145
146 CREATING MACROS
147 Syntax: macro key_identifier macro_string
148 You can use this syntax to cause a single keypress (the key_identifier)
149 to be interpreted as the series of keypresses listed in macro_string.
150 The syntax for defining a keypress is the same as that defined in the
151 section on CREATING KEY BINDINGS. The macro string should be a list of
152 whitespace-separated keypresses, e.g. "2 <return> 2 +" (including
153 quotes).
154
155 This macro syntax provides a way to create small programs; by way of
156 example, the default orpierc file includes macros for the base 2 loga‐
157 rithm and the binary entropy function (bound to L and H, respectively),
158 as well as ``register'' variable shortcuts (<f1> to <f12>).
159
160 Macros may call other macros recursively. However, take care that a
161 macro does not call itself recursively; Orpie will not trap the infi‐
162 nite loop.
163
164 Note that operation abbreviations may be accessed within macros. For
165 example, macro "A" "' a b o u t <return>" would bind A to display the
166 ``about Orpie'' screen.
167
168 CREATING UNITS
169 Syntax:
170 base_unit unit_symbol preferred_prefix
171 unit unit_symbol unit_definition
172 Units are defined in a two-step process:
173
174 1. Define a set of orthogonal ``base units.'' All other units must
175 be expressible in terms of these base units. The base units can
176 be given a preferred SI prefix, which will be used whenever the
177 units are standardized (e.g. via ustand). The unit symbols and
178 preferred prefixes should all be quoted strings; to prefer no
179 prefix, use the empty string ("").
180
181 It is expected that most users will use the fundamental SI units for
182 base units.
183
184 2. Define all other units in terms of either base units or previ‐
185 ously-defined units. Again, the unit symbol and unit definition
186 should be quoted strings. The definition should take the form of
187 a numeric value followed by a units string, e.g. "2.5_kN*m/s".
188 See the UNITS FORMATTING section for more details on the unit
189 string format.
190
191 CREATING CONSTANTS
192 Syntax: constant constant_symbol constant_definition
193 This syntax can be used to define a physical constant. Both the con‐
194 stant symbol and definition must be quoted strings. The constant defi‐
195 nition should be a numeric constant followed by a units string e.g.
196 "1.60217733e-19_C". All units used in the constant definition must
197 already have been defined.
198
200 The following configuration variables may be set as described in the
201 SETTING CONFIGURATION VARIABLES section.
202
203 * datadir
204 This variable should be set to the full path of the Orpie data
205 directory, which will contain the calculator state save file,
206 temporary buffers, etc. The default directory is "\~/.orpie/".
207
208 * editor
209 This variable may be set to the fullscreen editor of your
210 choice. The default value is "vi". It is recommended that you
211 choose an editor that offers horizontal scrolling in place of
212 word wrapping, so that the columns of large matrices can be
213 properly aligned. (The Vim editor could be used in this fashion
214 by setting editor to "vim -c 'set nowrap'".)
215
216 * hide_help
217 Set this variable to "true" to hide the left help/status panel,
218 or leave it on the default of "false" to display the help panel.
219
220 * conserve_memory
221 Set this variable to "true" to minimize memory usage, or leave
222 it on the default of "false" to improve rendering performance.
223 (By default, Orpie caches multiple string representations of all
224 stack elements. Very large integers in particular require sig‐
225 nificant computation for string representation, so caching these
226 strings can make display updates much faster.)
227
229 Every calculator operation can be made available to the interface using
230 the syntax described in the sections on CREATING KEY BINDINGS and CRE‐
231 ATING OPERATION ABBREVIATIONS. The following is a list of every avail‐
232 able operation.
233
234 FUNCTIONS
235 The following operations are functions--that is, they will consume at
236 least one argument from the stack. Orpie will generally abort the com‐
237 putation and provide an informative error message if a function cannot
238 be successfully applied (for example, if you try to compute the trans‐
239 pose of something that is not a matrix).
240
241 For the exact integer data type, basic arithmetic operations will yield
242 an exact integer result. Division of two exact integers will yield the
243 quotient of the division. The more complicated functions will generally
244 promote the integer to a real number, and as such the arithmetic will
245 no longer be exact.
246
247 * function_10_x
248 Raise 10 to the power of the last stack element (inverse of
249 function_log10).
250
251 * function_abs
252 Compute the absolute value of the last stack element.
253
254 * function_acos
255 Compute the inverse cosine of the last stack element. For real
256 numbers, The result will be provided either in degrees or radi‐
257 ans, depending on the angle mode of the calculator.
258
259 * function_acosh
260 Compute the inverse hyperbolic cosine of the last stack element.
261
262 * function_add
263 Add last two stack elements.
264
265 * function_arg
266 Compute the argument (phase angle of complex number) of the last
267 stack element. The value will be provided in either degrees or
268 radians, depending on the current angle mode of the calculator.
269
270 * function_asin
271 Compute the inverse sine of the last stack element. For real
272 numbers, The result will be provided either in degrees or radi‐
273 ans, depending on the angle mode of the calculator.
274
275 * function_asinh
276 Compute the inverse hyperbolic sine of the last stack element.
277
278 * function_atan
279 Compute the inverse tangent of the last stack element. For real
280 numbers, The result will be provided either in degrees or radi‐
281 ans, depending on the angle mode of the calculator.
282
283 * function_atanh
284 Compute the inverse hyperbolic tangent of the last stack ele‐
285 ment.
286
287 * function_binomial_coeff
288 Compute the binomial coefficient (``n choose k'') formed by the
289 last two stack elements. If these arguments are real, the coef‐
290 ficient is computed using a fast approximation to the log of the
291 gamma function, and therefore the result is subject to rounding
292 errors. For exact integer arguments, the coefficient is computed
293 using exact arithmetic; this has the potential to be a slow
294 operation.
295
296 * function_ceiling
297 Compute the ceiling of the last stack element.
298
299 * function_convert_units
300 Convert stack element 2 to an equivalent expression in the units
301 of element 1. Element 1 should be real-valued, and its magnitude
302 will be ignored when computing the conversion.
303
304 * function_cos
305 Compute the cosine of the last stack element. If the argument is
306 real, it will be assumed to be either degrees or radians,
307 depending on the angle mode of the calculator.
308
309 * function_cosh
310 Compute the hyperbolic cosine of the last stack element.
311
312 * function_conj
313 Compute the complex conjugate of the last stack element.
314
315 * function_div
316 Divide element 2 by element 1.
317
318 * function_erf
319 Compute the error function of the last stack element.
320
321 * function_erfc
322 Compute the complementary error function of the last stack ele‐
323 ment.
324
325 * function_eval
326 Obtain the contents of the variable in the last stack position.
327
328 * function_exp
329 Evaluate the exponential function of the last stack element.
330
331 * function_factorial
332 Compute the factorial of the last stack element. For a real
333 argument, this is computed using a fast approximation to the
334 gamma function, and therefore the result may be subject to
335 rounding errors (or overflow). For an exact integer argument,
336 the factorial is computed using exact arithmetic; this has the
337 potential to be a slow operation.
338
339 * function_floor
340 Compute the floor of the last stack element.
341
342 * function_gamma
343 Compute the Euler gamma function of the last stack element.
344
345 * function_gcd
346 Compute the greatest common divisor of the last two stack ele‐
347 ments. This operation may be applied only to integer type data.
348
349 * function_im
350 Compute the imaginary part of the last stack element.
351
352 * function_inv
353 Compute the multiplicative inverse of the last stack element.
354
355 * function_lcm
356 Compute the least common multiple of the last two stack ele‐
357 ments. This operation may be applied only to integer type data.
358
359 * function_ln
360 Compute the natural logarithm of the last stack element.
361
362 * function_lngamma
363 Compute the natural logarithm of the Euler gamma function of the
364 last stack element.
365
366 * function_log10
367 Compute the base-10 logarithm of the last stack element.
368
369 * function_maximum
370 Find the maximum values of each of the columns of a real NxM
371 matrix, returning a 1xM matrix as a result.
372
373 * function_minimum
374 Find the minimum values of each of the columns of a real NxM
375 matrix, returning a 1xM matrix as a result.
376
377 * function_mean
378 Compute the sample means of each of the columns of a real NxM
379 matrix, returning a 1xM matrix as a result.
380
381 * function_mod
382 Compute element 2 mod element 1. This operation can be applied
383 only to integer type data.
384
385 * function_mult
386 Multiply last two stack elements.
387
388 * function_neg
389 Negate last stack element.
390
391 * function_permutation
392 Compute the permutation coefficient determined by the last two
393 stack elements 'n' and 'k': the number of ways of obtaining an
394 ordered subset of k elements from a set of n elements. If these
395 arguments are real, the coefficient is computed using a fast
396 approximation to the log of the gamma function, and therefore
397 the result is subject to rounding errors. For exact integer
398 arguments, the coefficient is computed using exact arithmetic;
399 this has the potential to be a slow operation.
400
401 * function_pow
402 Raise element 2 to the power of element 1.
403
404 * function_purge
405 Delete the variable in the last stack position.
406
407 * function_re
408 Compute the real part of the last stack element.
409
410 * function_sin
411 Compute the sine of the last stack element. If the argument is
412 real, it will be assumed to be either degrees or radians,
413 depending on the angle mode of the calculator.
414
415 * function_sinh
416 Compute the hyperbolic sine of the last stack element.
417
418 * function_solve_linear
419 Solve a linear system of the form Ax = b, where A and b are the
420 last two elements on the stack. A must be a square matrix and b
421 must be a matrix with one column. This function does not compute
422 inv(A), but obtains the solution by a more efficient LU decompo‐
423 sition method. This function is recommended over explicitly
424 computing the inverse, especially when solving linear systems
425 with relatively large dimension or with poorly conditioned
426 matrices.
427
428 * function_sq
429 Square the last stack element.
430
431 * function_sqrt
432 Compute the square root of the last stack element.
433
434 * function_standardize_units
435 Convert the last stack element to an equivalent expression using
436 the SI standard base units (kg, m, s, etc.).
437
438 * function_stdev_unbiased
439 Compute the unbiased sample standard deviation of each of the
440 columns of a real NxM matrix, returning a 1xM matrix as a
441 result. (Compare to HP48's sdev function.)
442
443 * function_stdev_biased
444 Compute the biased (population) sample standard deviation of
445 each of the columns of a real NxM matrix, returning a 1xM matrix
446 as a result. (Compare to HP48's psdev function.)
447
448 * function_store
449 Store element 2 in (variable) element 1.
450
451 * function_sub
452 Subtract element 1 from element 2.
453
454 * function_sumsq
455 Sum the squares of each of the columns of a real NxM matrix,
456 returning a 1xM matrix as a result.
457
458 * function_tan
459 Compute the tangent of the last stack element. If the argument
460 is real, it will be assumed to be either degrees or radians,
461 depending on the angle mode of the calculator.
462
463 * function_tanh
464 Compute the hyperbolic tangent of the last stack element.
465
466 * function_to_int
467 Convert a real number to an integer type.
468
469 * function_to_real
470 Convert an integer type to a real number.
471
472 * function_total
473 Sum each of the columns of a real NxM matrix, returning a 1xM
474 matrix as a result.
475
476 * function_trace
477 Compute the trace of a square matrix.
478
479 * function_transpose
480 Compute the matrix transpose of the last stack element.
481
482 * function_unit_value
483 Drop the units of the last stack element.
484
485 * function_utpn
486 Compute the upper tail probability of a normal distribution.
487 UTPN(m, v, x) = Integrate[ 1/Sqrt[2 Pi v] Exp[-(m-y)^2/(2 v)],
488 {y, x, Infinity}]
489
490 * function_var_unbiased
491 Compute the unbiased sample variance of each of the columns of a
492 real NxM matrix, returning a 1xM matrix as a result. (Compare to
493 HP48's var function.)
494
495 * function_var_biased
496 Compute the biased (population) sample variance of each of the
497 columns of a real NxM matrix, returning a 1xM matrix as a
498 result. (Compare to HP48's pvar function.)
499
500 COMMANDS
501 The following operations are referred to as commands; they differ from
502 functions because they do not take an argument. Many calculator inter‐
503 face settings are implemented as commands.
504
505 * command_about
506 Display a nifty ``about Orpie'' credits screen.
507
508 * command_begin_abbrev
509 Begin entry of an operation abbreviation.
510
511 * command_begin_browsing
512 Enter stack browsing mode.
513
514 * command_begin_constant
515 Begin entry of a physical constant.
516
517 * command_begin_variable
518 Begin entry of a variable name.
519
520 * command_bin
521 Set the base of exact integer representation to 2 (binary).
522
523 * command_clear
524 Clear all elements from the stack.
525
526 * command_cycle_base
527 Cycle the base of exact integer representation between 2, 8, 10,
528 and 16 (bin, oct, dec, and hex).
529
530 * command_cycle_help
531 Cycle through multiple help pages. The first page displays com‐
532 monly used bindings, and the second page displays the current
533 autobindings.
534
535 * command_dec
536 Set the base of exact integer representation to 10 (decimal).
537
538 * command_deg
539 Set the angle mode to degrees.
540
541 * command_drop
542 Drop the last element off the stack.
543
544 * command_dup
545 Duplicate the last stack element.
546
547 * command_enter_pi
548 Enter 3.1415... on the stack.
549
550 * command_hex
551 Set the base of exact integer representation to 16 (hexadeci‐
552 mal).
553
554 * command_oct
555 Set the base of exact integer representation to 8 (octal).
556
557 * command_polar
558 Set the complex display mode to polar.
559
560 * command_rad
561 Set the angle mode to radians.
562
563 * command_rand
564 Generate a random real-valued number between 0 (inclusive) and 1
565 (exclusive). The deviates are uniformly distributed.
566
567 * command_rect
568 Set the complex display mode to rectangular (cartesian).
569
570 * command_refresh
571 Refresh the display.
572
573 * command_swap
574 Swap stack elements 1 and 2.
575
576 * command_quit
577 Quit Orpie.
578
579 * command_toggle_angle_mode
580 Toggle the angle mode between degrees and radians.
581
582 * command_toggle_complex_mode
583 Toggle the complex display mode between rectangular and polar.
584
585 * command_undo
586 Undo the last calculator operation.
587
588 * command_view
589 View the last stack element in an external fullscreen editor.
590
591 * command_edit_input
592 Create a new stack element using an external editor.
593
594 EDIT OPERATIONS
595 The following operations are related to editing during data entry.
596 These commands cannot be made available as operation abbreviations,
597 since abbreviations are not accessible while entering data. These oper‐
598 ations should be made available as single keypresses using the bind
599 keyword.
600
601 * edit_angle
602 Begin entering the phase angle of a complex number. (Orpie will
603 assume the angle is in either degrees or radians, depending on
604 the current angle mode.)
605
606 * edit_backspace
607 Delete the last character entered.
608
609 * edit_begin_integer
610 Begin entering an exact integer.
611
612 * edit_begin_units
613 Begin appending units to a numeric expression.
614
615 * edit_complex
616 Begin entering a complex number.
617
618 * edit_enter
619 Enter the data that is currently being edited.
620
621 * edit_matrix
622 Begin entering a matrix, or begin entering the next row of a
623 matrix.
624
625 * edit_minus
626 Enter a minus sign in input.
627
628 * edit_scientific_notation_base
629 Begin entering the scientific notation exponent of a real num‐
630 ber, or the base of an exact integer.
631
632 * edit_separator
633 Begin editing the next element of a complex number or matrix.
634 (This will insert a comma between elements.)
635
636 BROWSING OPERATIONS
637 The following list of operations is available only in stack browsing
638 mode. As abbreviations are unavailable while browsing the stack, these
639 operations should be bound to single keypresses using the bind keyword.
640
641 * browse_echo
642 Echo the currently selected element to stack level 1.
643
644 * browse_end
645 Exit stack browsing mode.
646
647 * browse_drop
648 Drop the currently selected stack element.
649
650 * browse_dropn
651 Drop all stack elements below the current selection (inclusive).
652
653 * browse_keep
654 Drop all stack elements except the current selection. (This is
655 complementary to browse_drop.
656
657 * browse_keepn
658 Drop all stack elements above the current selection (non-inclu‐
659 sive). (This is complementary to browse_dropn.
660
661 * browse_next_line
662 Move the selection cursor down one line.
663
664 * browse_prev_line
665 Move the selection cursor up one line.
666
667 * browse_rolldown
668 Cyclically ``roll'' stack elements downward, below the selected
669 element (inclusive).
670
671 * browse_rollup
672 Cyclically ``roll'' stack elements upward, below the selected
673 element (inclusive) .
674
675 * browse_scroll_left
676 Scroll the selected element to the left (for viewing very large
677 entries such as matrices).
678
679 * browse_scroll_right
680 Scroll the selected element to the right.
681
682 * browse_view
683 View the currently selected stack element in a fullscreen edi‐
684 tor.
685
686 * browse_edit
687 Edit the currently selected stack element using an external edi‐
688 tor.
689
690 ABBREVIATION ENTRY OPERATIONS
691 The following list of operations is available only while entering a
692 function or command abbreviation, or while entering a physical con‐
693 stant. These operations must be bound to single keypresses using the
694 bind keyword.
695
696 * abbrev_backspace
697 Delete a character from the abbreviation string.
698
699 * abbrev_enter
700 Execute the operation associated with the selected abbreviation.
701
702 * abbrev_exit
703 Cancel abbreviation entry.
704
705 VARIABLE ENTRY OPERATIONS
706 The following list of operations is available only while entering a
707 variable name. As abbreviations are unavailable while entering vari‐
708 ables, these operations should be bound to single keypresses using the
709 bind keyword.
710
711 * variable_backspace
712 Delete a character from the variable name.
713
714 * variable_cancel
715 Cancel entry of the variable name.
716
717 * variable_complete
718 Autocomplete the variable name.
719
720 * variable_enter
721 Enter the variable name on the stack.
722
723 INTEGER ENTRY OPERATIONS
724 The following operation is available only while entering an integer; it
725 can be made accessible by binding it to a single keypress using the
726 bind keyword.
727
728 * integer_cancel
729 Cancel entry of an integer.
730
732 orpie(1), orpie-curses-keys(1)
733
735 This manpage is written by Paul J. Pelzl <pelzlpj@gmail.com>.
736
737
738
739configuration file for the Orpie c1a1lcAuplraitlor2014 ORPIERC(5)