Xref: utzoo gnu.emacs:3435 comp.emacs:8816 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!jarthur!nntp-server.caltech.edu!laguna.ccsf.caltech.edu!daveg From: daveg@near.cs.caltech.edu (Dave Gillespie) Newsgroups: gnu.emacs,comp.emacs Subject: Patch for Emacs Calc, 1.03 -> 1.04, part 1/2 Message-ID: Date: 7 Aug 90 00:24:14 GMT Sender: news@laguna.ccsf.caltech.edu Organization: California Institute of Technology Lines: 1424 The following patches convert Calc version 1.03 into Calc version 1.04. To apply them automatically with Patch v2.0, first cd into your Calc distribution directory, then execute "patch -p0 n 0) ! (* (myfact (1- n))) (if (= n 0) 1 nil))) ; this could be simplified as: (and (= n 0) 1) --- 8818,8824 ---- @example (defmath myfact (n) (if (> n 0) ! (* n (myfact (1- n))) (if (= n 0) 1 nil))) ; this could be simplified as: (and (= n 0) 1) *************** *** 9023,9029 **** "Compute the factorial of the integer at the top of the stack." (interactive 1 "fact") (if (> n 0) ! (* (myfact (1- n))) (and (= n 0) 1))) @end example --- 9070,9076 ---- "Compute the factorial of the integer at the top of the stack." (interactive 1 "fact") (if (> n 0) ! (* n (myfact (1- n))) (and (= n 0) 1))) @end example *************** *** 10900,10906 **** @node Installation, Reporting Bugs, Programming, Top @chapter Installation ! Calc comes as a pair of Emacs Lisp files, generally called @file{calc.el} and @file{calc-ext.el}. The first contains the basic foundations of the Calculator, and is as small as possible to promote quick loading. The second contains all the more advanced commands and --- 10947,10953 ---- @node Installation, Reporting Bugs, Programming, Top @chapter Installation ! Calc 1.04 comes as a pair of Emacs Lisp files, generally called @file{calc.el} and @file{calc-ext.el}. The first contains the basic foundations of the Calculator, and is as small as possible to promote quick loading. The second contains all the more advanced commands and *************** *** 10908,10913 **** --- 10955,10962 ---- @kbd{M-#} command auto-loads only the first part, and the second part is auto-loaded whenever the first advanced feature is used.@refill + @section Compilation + Calc is written in a way that maximizes performance when its code has been byte-compiled; a side effect is that performance is seriously degraded if it @emph{isn't} compiled. Thus, it is essential to compile the Calculator *************** *** 10918,10926 **** calc.elc} before compiling @file{calc-ext.el} will work. For your convenience, the FTP distribution of Calc, obtainable from ! anonymous FTP on @samp{csvax.caltech.edu}, includes already-compiled versions of both of these files. To teach Emacs how to load in Calc when you type @kbd{M-x calc} for the first time, include these lines in your @file{.emacs} file (if you are installing Calc just for your own use), or the system's @file{lisp/default} --- 10967,10977 ---- calc.elc} before compiling @file{calc-ext.el} will work. For your convenience, the FTP distribution of Calc, obtainable from ! anonymous FTP on @samp{csvax.cs.caltech.edu}, includes already-compiled versions of both of these files. + @section Auto-loading + To teach Emacs how to load in Calc when you type @kbd{M-x calc} for the first time, include these lines in your @file{.emacs} file (if you are installing Calc just for your own use), or the system's @file{lisp/default} *************** *** 10950,10962 **** reasonably be used before the user has typed @kbd{M-x calc} for the first time. If you don't want to bother with a split Calculator, you can simply concatenate @code{calc-ext.elc} onto the end of @code{calc.elc}, rewrite the above @code{autoload} commands all to point to the combined file, and treat Calc as one big program. You may need to do this if ! @code{autoload} is giving you problems. ! You may also wish to bind the @code{calc} command to a key. The recommended keystroke is @kbd{M-#} (i.e., Meta-Shift-3). To set up this key binding, include this command in your @file{.emacs} or @file{lisp/default} file: --- 11001,11058 ---- reasonably be used before the user has typed @kbd{M-x calc} for the first time. + @section Merging @file{calc} and @file{calc-ext} + If you don't want to bother with a split Calculator, you can simply concatenate @code{calc-ext.elc} onto the end of @code{calc.elc}, rewrite the above @code{autoload} commands all to point to the combined file, and treat Calc as one big program. You may need to do this if ! the @code{autoload} mechanism is giving you problems. ! ! @section Splitting @file{calc-ext} ! ! On the other hand, you may find that @file{calc-ext.el} is too big to load ! quickly. You can split the Calculator into still more parts using the ! @code{calc-split} command. This command splits the file ! @file{calc-ext.el} into about 20 small files with names like ! @file{calc-cplx.el} and @file{calc-mode.el} in the same directory ! as @file{calc-ext.el}. First, load the file @file{calc-ext.el} with ! @kbd{C-x C-f}. Move to the end of the buffer and type @kbd{C-x C-e} ! at the indicated position. Now type @kbd{M-x calc-split}. ! This moves most of the text out of @file{calc-ext.el} and into ! other files. All necessary @code{autoload} commands are inserted ! into @file{calc-ext.el}.@refill ! ! The @code{calc-split} command prompts for a directory name; the new ! files are placed in this directory, and the @code{autoload} commands are ! written to refer to the directory explicitly. If you wish you can ! backspace over the default directory name and enter a blank name, in ! which case the @code{autoload} commands will be written without ! directory names on the assumption that Emacs can find the Calc files in ! one of the default places. Some people prefer to put the Calc files in ! a subdirectory by themselves.@refill ! ! The @code{calc-split} command also offers to byte-compile all Calc files ! automatically. Note that @file{calc.el} must have been byte-compiled ! and loaded already, just as if you were compiling @file{calc-ext} whole. ! If you choose to compile by hand, you will need to compile @file{calc.el} ! first, load it, compile the new @file{calc-ext.el} and load it, then ! compile each of the new component files. Also, note that the ! @code{autoload} commands shown above are still correct for use in ! your startup file.@refill ! ! If you do decide to use @code{calc-split}, note that when patches ! are made available for new versions of Calc, they will refer to ! the old, unsplit version of the file @file{calc-ext.el}. The ! @code{calc-split} command makes a copy of this under the name ! @file{calc-old.el}; be sure to keep it around so you can rename ! it back to @file{calc-ext.el} before installing new patches. ! You can then use @code{calc-split} again to re-split your updated ! version of Calc.@refill ! ! @section Key Bindings ! You may wish to bind the @code{calc} command to a key. The recommended keystroke is @kbd{M-#} (i.e., Meta-Shift-3). To set up this key binding, include this command in your @file{.emacs} or @file{lisp/default} file: *************** *** 10968,10973 **** --- 11064,11071 ---- There are no standard key assignments for @code{quick-calc} and @code{calc-grab-region}, but you may wish to define some. + @section The @file{macedit} Package + The file @file{macedit.el} contains another useful Emacs extension called @code{edit-kbd-macro}. It allows you to edit a keyboard macro in human-readable form. The @kbd{Z E} command in Calc knows how to *************** *** 10979,10984 **** --- 11077,11084 ---- (autoload 'edit-last-kbd-macro ".../macedit.elc" "Edit Keyboard Macro" t nil) @end example + @section Documentation + The documentation for Calc (i.e., this manual) comes in a file @file{calc.texinfo}. To format this for use as an on-line manual, open this file for editing in Emacs and give the command *************** *** 11002,11007 **** --- 11102,11109 ---- in your @file{.emacs} or @file{lisp/default} file, where again @file{...} represents the directory containing the Info files. + @section Settings File + @vindex calc-settings-file Another variable you might want to set is @code{calc-settings-file}, which holds the file name in which commands like @kbd{m m} and @kbd{Z P} *************** *** 11012,11017 **** --- 11114,11121 ---- automatically load your settings file (if it exists) the first time Calc is invoked.@refill + @section Testing the Installation + To test your installation of Calc, start a fresh Emacs and type @kbd{M-#} to make sure the autoload commands and key bindings work. Now, type @kbd{i} to make sure Calc can find its Info documentation. Press @kbd{q} *************** *** 11027,11033 **** @chapter Reporting Bugs If you find a bug in Calc, send e-mail to Dave Gillespie, ! @samp{daveg@@csvax.caltech.edu}. While I cannot guarantee that I will have time to work on your bug, I do try to fix bugs quickly whenever I can. --- 11131,11137 ---- @chapter Reporting Bugs If you find a bug in Calc, send e-mail to Dave Gillespie, ! @samp{daveg@@csvax.cs.caltech.edu}. While I cannot guarantee that I will have time to work on your bug, I do try to fix bugs quickly whenever I can. -- Dave Gillespie 256-80 Caltech Pasadena CA USA 91125 daveg@csvax.cs.caltech.edu, ...!cit-vax!daveg