diff options
| author | Miles Bader | 2004-12-14 07:34:55 +0000 |
|---|---|---|
| committer | Miles Bader | 2004-12-14 07:34:55 +0000 |
| commit | dce59e79ab8a6ecc869ceda44d579b8b1e8e10d5 (patch) | |
| tree | c3da6c32ac0401833eb29b6a4be9cf93febf248e | |
| parent | 56cc8ca9b68886dc4aae4c8ef44ad5e62b59db49 (diff) | |
| parent | 734c576596678065b39591128d88609bc6fc5aad (diff) | |
| download | emacs-dce59e79ab8a6ecc869ceda44d579b8b1e8e10d5.tar.gz emacs-dce59e79ab8a6ecc869ceda44d579b8b1e8e10d5.zip | |
Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-78
Merge from emacs--cvs-trunk--0
Patches applied:
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-719
- miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-732
Update from CVS
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-733
Update from CVS: man/calc.texi: Fix some TeX definitions.
* miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-734
Merge from gnus--rel--5.10
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-75
Merge from emacs--cvs-trunk--0
* miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-76
- miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-77
Update from CVS
72 files changed, 2221 insertions, 1240 deletions
| @@ -1,3 +1,13 @@ | |||
| 1 | 2004-12-11 Kim F. Storm <storm@cua.dk> | ||
| 2 | |||
| 3 | * Makefile.in (info): Undo 2004-12-05 change. | ||
| 4 | |||
| 5 | 2004-12-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 6 | |||
| 7 | * info/dir (File): Add URL and Org Mode manuals. | ||
| 8 | * Makefile.in (install-arch-indep, uninstall): Add url and org | ||
| 9 | manuals. | ||
| 10 | |||
| 1 | 2004-12-07 Stefan <monnier@iro.umontreal.ca> | 11 | 2004-12-07 Stefan <monnier@iro.umontreal.ca> |
| 2 | 12 | ||
| 3 | * configure.in (INLINE, RE_TRANSLATE_P): Move patches mistakenly | 13 | * configure.in (INLINE, RE_TRANSLATE_P): Move patches mistakenly |
diff --git a/Makefile.in b/Makefile.in index 1a115cd3fd5..9753017d72d 100644 --- a/Makefile.in +++ b/Makefile.in | |||
| @@ -484,7 +484,7 @@ install-arch-indep: mkdir info | |||
| 484 | chmod a+r ${infodir}/dir); \ | 484 | chmod a+r ${infodir}/dir); \ |
| 485 | fi; \ | 485 | fi; \ |
| 486 | cd ${srcdir}/info ; \ | 486 | cd ${srcdir}/info ; \ |
| 487 | for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-mime* emacs-xtra* eshell* eudc* flymake* forms* gnus* idlwave* info* message* mh-e* pcl-cvs* pgg* reftex* sc* ses* sieve* speedbar* tramp* vip* widget* woman* smtpmail*; do \ | 487 | for f in ada-mode* autotype* calc* ccmode* cl* dired-x* ebrowse* ediff* efaq* eintr* elisp* emacs* emacs-mime* emacs-xtra* eshell* eudc* flymake* forms* gnus* idlwave* info* message* mh-e* org* pcl-cvs* pgg* reftex* sc* ses* sieve* speedbar* tramp* vip* widget* woman* smtpmail* url*; do \ |
| 488 | (cd $${thisdir}; \ | 488 | (cd $${thisdir}; \ |
| 489 | ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \ | 489 | ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \ |
| 490 | chmod a+r ${infodir}/$$f); \ | 490 | chmod a+r ${infodir}/$$f); \ |
| @@ -494,7 +494,7 @@ install-arch-indep: mkdir info | |||
| 494 | thisdir=`/bin/pwd`; \ | 494 | thisdir=`/bin/pwd`; \ |
| 495 | if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ | 495 | if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \ |
| 496 | then \ | 496 | then \ |
| 497 | for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake forms gnus idlwave info message mh-e pcl-cvs pgg reftex sc ses sieve speedbar tramp vip viper widget woman smtpmail; do \ | 497 | for f in ada-mode autotype calc ccmode cl dired-x ebrowse ediff efaq elisp eintr emacs emacs-mime emacs-xtra eshell eudc flymake forms gnus idlwave info message mh-e org pcl-cvs pgg reftex sc ses sieve speedbar tramp vip viper widget woman smtpmail url; do \ |
| 498 | (cd $${thisdir}; \ | 498 | (cd $${thisdir}; \ |
| 499 | ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \ | 499 | ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \ |
| 500 | done; \ | 500 | done; \ |
| @@ -560,7 +560,7 @@ uninstall: | |||
| 560 | done | 560 | done |
| 561 | (cd ${archlibdir} && rm -f fns-*) | 561 | (cd ${archlibdir} && rm -f fns-*) |
| 562 | -rm -rf ${libexecdir}/emacs/${version} | 562 | -rm -rf ${libexecdir}/emacs/${version} |
| 563 | (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* flymake* forms* gnus* info* mh-e* sc* ses* vip* smtpmail*) | 563 | (cd ${infodir} && rm -f cl* ada-mode* autotype* calc* ccmode* ebrowse* efaq* eintr elisp* eshell* eudc* idlwave* message* pcl-cvs* reftex* speedbar* tramp* widget* woman* dired-x* ediff* emacs* emacs-xtra* flymake* forms* gnus* info* mh-e* org* sc* ses* vip* smtpmail* url*) |
| 564 | (cd ${man1dir} && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext}) | 564 | (cd ${man1dir} && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext}) |
| 565 | (cd ${bindir} && rm -f $(EMACSFULL) $(EMACS)) | 565 | (cd ${bindir} && rm -f $(EMACSFULL) $(EMACS)) |
| 566 | 566 | ||
| @@ -719,9 +719,9 @@ force-info: | |||
| 719 | # put the info files in $(srcdir), | 719 | # put the info files in $(srcdir), |
| 720 | # so we can do ok running make in the build dir. | 720 | # so we can do ok running make in the build dir. |
| 721 | info: force-info | 721 | info: force-info |
| 722 | -(cd man; $(MAKE) $(MFLAGS) info) | 722 | (cd man; $(MAKE) $(MFLAGS) info) |
| 723 | -(cd lispref; $(MAKE) $(MFLAGS) info) | 723 | (cd lispref; $(MAKE) $(MFLAGS) info) |
| 724 | -(cd lispintro; $(MAKE) $(MFLAGS) info) | 724 | (cd lispintro; $(MAKE) $(MFLAGS) info) |
| 725 | dvi: | 725 | dvi: |
| 726 | (cd man; $(MAKE) $(MFLAGS) dvi) | 726 | (cd man; $(MAKE) $(MFLAGS) dvi) |
| 727 | (cd lispref; $(MAKE) $(MFLAGS) elisp.dvi) | 727 | (cd lispref; $(MAKE) $(MFLAGS) elisp.dvi) |
diff --git a/etc/ChangeLog b/etc/ChangeLog index e39979fcad5..23401937003 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2004-12-11 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * e/eterm.ti: Add rs1. | ||
| 4 | * e/eterm: Regenerate. | ||
| 5 | |||
| 6 | 2004-12-08 Alexandre VEYRENC <veyrenc@wanadoo.fr> (tiny change) | ||
| 7 | |||
| 8 | * fr-refcard.tex: Fix typos. | ||
| 9 | |||
| 1 | 2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 10 | 2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 11 | ||
| 3 | * PROBLEMS: Update information about klipper on KDE. | 12 | * PROBLEMS: Update information about klipper on KDE. |
| @@ -671,6 +671,27 @@ command is bound to M-o. A new command dired-mark-omitted, bound to M-O, | |||
| 671 | marks omitted files. The variable dired-omit-files-p is obsoleted, use the | 671 | marks omitted files. The variable dired-omit-files-p is obsoleted, use the |
| 672 | mode toggling function instead. | 672 | mode toggling function instead. |
| 673 | 673 | ||
| 674 | +++ | ||
| 675 | ** find-file-read-only visits multiple files in read-only mode, | ||
| 676 | when the file name contains wildcard characters. | ||
| 677 | |||
| 678 | +++ | ||
| 679 | ** find-alternate-file replaces the current file with multiple files, | ||
| 680 | when the file name contains wildcard characters. | ||
| 681 | |||
| 682 | ** FFAP | ||
| 683 | |||
| 684 | +++ | ||
| 685 | *** New ffap commands and keybindings: C-x C-r (`ffap-read-only'), | ||
| 686 | C-x C-v (`ffap-alternate-file'), C-x C-d (`ffap-list-directory'), | ||
| 687 | C-x 4 r (`ffap-read-only-other-window'), C-x 4 d (`ffap-dired-other-window'), | ||
| 688 | C-x 5 r (`ffap-read-only-other-frame'), C-x 5 d (`ffap-dired-other-frame'). | ||
| 689 | |||
| 690 | --- | ||
| 691 | *** FFAP accepts wildcards in a file name by default. C-x C-f passes | ||
| 692 | it to `find-file' with non-nil WILDCARDS argument, which visits | ||
| 693 | multiple files, and C-x d passes it to `dired'. | ||
| 694 | |||
| 674 | ** Info mode: | 695 | ** Info mode: |
| 675 | 696 | ||
| 676 | *** A numeric prefix argument of `info' selects an Info buffer | 697 | *** A numeric prefix argument of `info' selects an Info buffer |
| @@ -1139,6 +1160,10 @@ All regular expression replacement commands now allow `\?' in the | |||
| 1139 | replacement string to specify a position where the replacement string | 1160 | replacement string to specify a position where the replacement string |
| 1140 | can be edited for each replacement. | 1161 | can be edited for each replacement. |
| 1141 | 1162 | ||
| 1163 | ** query-replace uses isearch highlighting with lazy highlighting | ||
| 1164 | when the user option `query-replace-highlight' is set to `isearch'. | ||
| 1165 | If it is t, it uses old query-replace highlighting method. | ||
| 1166 | |||
| 1142 | +++ | 1167 | +++ |
| 1143 | ** Emacs normally highlights mouse sensitive text whenever the mouse | 1168 | ** Emacs normally highlights mouse sensitive text whenever the mouse |
| 1144 | is over the text. By setting the new variable `mouse-highlight', you | 1169 | is over the text. By setting the new variable `mouse-highlight', you |
| @@ -1443,7 +1468,10 @@ you hit M-C-SPC (mark-sexp), M-@ (mark-word), M-h (mark-paragraph), or | |||
| 1443 | C-M-h (mark-defun) repeatedly, the marked region extends each time, so | 1468 | C-M-h (mark-defun) repeatedly, the marked region extends each time, so |
| 1444 | you can mark the next two sexps with M-C-SPC M-C-SPC, for example. | 1469 | you can mark the next two sexps with M-C-SPC M-C-SPC, for example. |
| 1445 | This feature also works for mark-end-of-sentence, if you bind that to | 1470 | This feature also works for mark-end-of-sentence, if you bind that to |
| 1446 | a key. | 1471 | a key. It also extends the region when the mark is active in Transient |
| 1472 | Mark mode, regardless of the last command. To start a new region with | ||
| 1473 | one of marking commands in Transient Mark mode, you can deactivate the | ||
| 1474 | active region with C-g, or set the new mark with C-SPC. | ||
| 1447 | 1475 | ||
| 1448 | +++ | 1476 | +++ |
| 1449 | ** Some commands do something special in Transient Mark mode when the | 1477 | ** Some commands do something special in Transient Mark mode when the |
| @@ -1468,6 +1496,11 @@ C-g. | |||
| 1468 | previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the | 1496 | previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the |
| 1469 | mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump. | 1497 | mark ring. Use C-u C-u C-SPC to set the mark immediately after a jump. |
| 1470 | 1498 | ||
| 1499 | ** Movement commands `beginning-of-buffer', `end-of-buffer', | ||
| 1500 | `beginning-of-defun', `end-of-defun' do not set the mark if the new | ||
| 1501 | option `inhibit-mark-movement' is non-nil, or if the mark is already | ||
| 1502 | active in Transient Mark mode. | ||
| 1503 | |||
| 1471 | +++ | 1504 | +++ |
| 1472 | ** In the *Occur* buffer, `o' switches to it in another window, and | 1505 | ** In the *Occur* buffer, `o' switches to it in another window, and |
| 1473 | C-o displays the current line's occurrence in another window without | 1506 | C-o displays the current line's occurrence in another window without |
| @@ -2413,6 +2446,17 @@ configuration files. | |||
| 2413 | 2446 | ||
| 2414 | * Lisp Changes in Emacs 21.4 | 2447 | * Lisp Changes in Emacs 21.4 |
| 2415 | 2448 | ||
| 2449 | ** (while-no-input BODY...) runs BODY, but only so long as no input | ||
| 2450 | arrives. If the user types or clicks anything, BODY stops as if a | ||
| 2451 | quit had occurred. while-no-input returns the value of BODY, if BODY | ||
| 2452 | finishes. It returns nil if BODY was aborted. | ||
| 2453 | |||
| 2454 | --- | ||
| 2455 | ** To manipulate the File menu using easy-menu, you must specify the | ||
| 2456 | proper name "file". In previous Emacs versions, you had to specify | ||
| 2457 | "files", even though the menu item itself was changed to say "File" | ||
| 2458 | several versions ago. | ||
| 2459 | |||
| 2416 | +++ | 2460 | +++ |
| 2417 | ** read-from-minibuffer now accepts an additional argument KEEP-ALL | 2461 | ** read-from-minibuffer now accepts an additional argument KEEP-ALL |
| 2418 | saying to put all inputs in the history list, even empty ones. | 2462 | saying to put all inputs in the history list, even empty ones. |
| @@ -2656,8 +2700,10 @@ strings by giving that character a non-nil `cursor' text property. | |||
| 2656 | around potentially blocking or long-running code in timers | 2700 | around potentially blocking or long-running code in timers |
| 2657 | and post-command-hooks. | 2701 | and post-command-hooks. |
| 2658 | 2702 | ||
| 2659 | ** An unconditional face specification in defface (one where the DISPLAY part | 2703 | ** The first face specification element in a defface can specify |
| 2660 | is just t) applies to all cases and does not override subsequent entries. | 2704 | `default' instead of frame classification. Then its attributes act as |
| 2705 | defaults that apply to all the subsequent cases (and may be overridden | ||
| 2706 | by them). | ||
| 2661 | 2707 | ||
| 2662 | +++ | 2708 | +++ |
| 2663 | ** New face attribute `min-colors' can be used to tailor the face color | 2709 | ** New face attribute `min-colors' can be used to tailor the face color |
| @@ -6523,9 +6569,8 @@ function was declared obsolete. | |||
| 6523 | ** Function `plist-member' is renamed from `widget-plist-member' (which is | 6569 | ** Function `plist-member' is renamed from `widget-plist-member' (which is |
| 6524 | retained as an alias). | 6570 | retained as an alias). |
| 6525 | 6571 | ||
| 6526 | ** Easy-menu's :filter now works as in XEmacs. | 6572 | ** Easy-menu's :filter now takes the unconverted form of the menu and |
| 6527 | It takes the unconverted (i.e. XEmacs) form of the menu and the result | 6573 | the result is automatically converted to Emacs' form. |
| 6528 | is automatically converted to Emacs' form. | ||
| 6529 | 6574 | ||
| 6530 | ** The new function `window-list' has been defined | 6575 | ** The new function `window-list' has been defined |
| 6531 | 6576 | ||
| @@ -15,6 +15,9 @@ to the FSF. | |||
| 15 | ought to be possible to omit text which is invisible (due to a | 15 | ought to be possible to omit text which is invisible (due to a |
| 16 | text-property, overlay, or selective display) from the kill-ring. | 16 | text-property, overlay, or selective display) from the kill-ring. |
| 17 | 17 | ||
| 18 | ** Redefine define-generic-mode as a macro, so the compiler | ||
| 19 | sees the definitions it generates. | ||
| 20 | |||
| 18 | * Important features: | 21 | * Important features: |
| 19 | 22 | ||
| 20 | ** Provide user-friendly ways to list all available font families, | 23 | ** Provide user-friendly ways to list all available font families, |
diff --git a/etc/e/eterm.ti b/etc/e/eterm.ti index 36576b4db6a..2b600df0a12 100644 --- a/etc/e/eterm.ti +++ b/etc/e/eterm.ti | |||
| @@ -50,6 +50,7 @@ eterm, | |||
| 50 | rmir=\E[4l, | 50 | rmir=\E[4l, |
| 51 | rmso=\E[27m, | 51 | rmso=\E[27m, |
| 52 | rmul=\E[24m, | 52 | rmul=\E[24m, |
| 53 | rs1=\Ec, | ||
| 53 | sc=\E7, | 54 | sc=\E7, |
| 54 | setab=\E[%p1%{40}%+%dm, | 55 | setab=\E[%p1%{40}%+%dm, |
| 55 | setaf=\E[%p1%{30}%+%dm, | 56 | setaf=\E[%p1%{30}%+%dm, |
| @@ -59,3 +60,4 @@ eterm, | |||
| 59 | smso=\E[7m, | 60 | smso=\E[7m, |
| 60 | # smcup=\E[?47h, | 61 | # smcup=\E[?47h, |
| 61 | # rmcup=\E[?47l, | 62 | # rmcup=\E[?47l, |
| 63 | # rs2 may need to be added | ||
diff --git a/etc/fr-refcard.tex b/etc/fr-refcard.tex index 8290620cf28..a479c57f544 100644 --- a/etc/fr-refcard.tex +++ b/etc/fr-refcard.tex | |||
| @@ -64,13 +64,13 @@ | |||
| 64 | \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.} | 64 | \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.} |
| 65 | \centerline{v\versionnumber{} pour GNU Emacs version 21, Juin \year} | 65 | \centerline{v\versionnumber{} pour GNU Emacs version 21, Juin \year} |
| 66 | \centerline{conception de Stephen Gildea} | 66 | \centerline{conception de Stephen Gildea} |
| 67 | \centerline{traduction francaise d'\'Eric Jacoboni} | 67 | \centerline{traduction fran\c{c}aise d'\'Eric Jacoboni} |
| 68 | 68 | ||
| 69 | Vous pouvez faire et distribuer des copies de cette carte, pourvu que | 69 | Vous pouvez faire et distribuer des copies de cette carte, pourvu que |
| 70 | la note de copyright et cette note de permission soient conserv\'ees sur | 70 | la note de copyright et cette note de permission soient conserv\'ees sur |
| 71 | toutes les copies. | 71 | toutes les copies. |
| 72 | 72 | ||
| 73 | Pour les copies du manuel GNU Emacs, \'ecrivez À la Free Software | 73 | Pour les copies du manuel GNU Emacs, \'ecrivez \`a la Free Software |
| 74 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 74 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 75 | 75 | ||
| 76 | \endgroup} | 76 | \endgroup} |
| @@ -260,9 +260,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |||
| 260 | 260 | ||
| 261 | \section{Lancement d'Emacs} | 261 | \section{Lancement d'Emacs} |
| 262 | 262 | ||
| 263 | Pour lancer GNU Emacs 20, il suffit de taper son nom : \kbd{emacs} | 263 | Pour lancer GNU Emacs 21, il suffit de taper son nom : \kbd{emacs} |
| 264 | 264 | ||
| 265 | Pour charger un fichier À \'editer, voir Fichiers, ci-dessous. | 265 | Pour charger un fichier \`a \'editer, voir Fichiers, ci-dessous. |
| 266 | 266 | ||
| 267 | \section{Quitter Emacs} | 267 | \section{Quitter Emacs} |
| 268 | 268 | ||
| @@ -277,7 +277,7 @@ Pour charger un fichier À \'editer, voir Fichiers, ci-dessous. | |||
| 277 | \key{{\bf ins\'erer} le contenu d'un autre fichier dans ce tampon}{C-x i} | 277 | \key{{\bf ins\'erer} le contenu d'un autre fichier dans ce tampon}{C-x i} |
| 278 | \key{remplacer ce fichier par le fichier voulu}{C-x C-v} | 278 | \key{remplacer ce fichier par le fichier voulu}{C-x C-v} |
| 279 | \key{\'ecrire le tampon dans un fichier donn\'e}{C-x C-w} | 279 | \key{\'ecrire le tampon dans un fichier donn\'e}{C-x C-w} |
| 280 | \key{contrÔle de version}{C-x C-q} | 280 | \key{contr\^ole de version}{C-x C-q} |
| 281 | 281 | ||
| 282 | \section{Obtenir de l'aide} | 282 | \section{Obtenir de l'aide} |
| 283 | 283 | ||
| @@ -324,21 +324,21 @@ qui n'a pas \'et\'e fait. | |||
| 324 | \section{D\'eplacements} | 324 | \section{D\'eplacements} |
| 325 | 325 | ||
| 326 | \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr | 326 | \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr |
| 327 | \threecol{{\bf entity to move over}}{{\bf backward}}{{\bf forward}} | 327 | \threecol{{\bf entit\'e sur laquelle se d\'eplacer}}{{\bf en arri\`ere}}{{\bf en avant}} |
| 328 | \threecol{caract\`ere}{C-b}{C-f} | 328 | \threecol{caract\`ere}{C-b}{C-f} |
| 329 | \threecol{mot}{M-b}{M-f} | 329 | \threecol{mot}{M-b}{M-f} |
| 330 | \threecol{ligne}{C-p}{C-n} | 330 | \threecol{ligne}{C-p}{C-n} |
| 331 | \threecol{aller au d\'ebut (ou À la fin) de la ligne}{C-a}{C-e} | 331 | \threecol{aller au d\'ebut (ou \`a la fin) de la ligne}{C-a}{C-e} |
| 332 | \threecol{phrase}{M-a}{M-e} | 332 | \threecol{phrase}{M-a}{M-e} |
| 333 | \threecol{paragraphe}{M-\{}{M-\}} | 333 | \threecol{paragraphe}{M-\{}{M-\}} |
| 334 | \threecol{page}{C-x [}{C-x ]} | 334 | \threecol{page}{C-x [}{C-x ]} |
| 335 | \threecol{s-expression}{C-M-b}{C-M-f} | 335 | \threecol{s-expression}{C-M-b}{C-M-f} |
| 336 | \threecol{fonction}{C-M-a}{C-M-e} | 336 | \threecol{fonction}{C-M-a}{C-M-e} |
| 337 | \threecol{aller au d\'ebut (ou À la fin) du tampon}{M-<}{M->} | 337 | \threecol{aller au d\'ebut (ou \`a la fin) du tampon}{M-<}{M->} |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | \key{passer À l'\'ecran suivant}{C-v} | 340 | \key{passer \`a l'\'ecran suivant}{C-v} |
| 341 | \key{passer À l'\'ecran pr\'ec\'edent}{M-v} | 341 | \key{passer \`a l'\'ecran pr\'ec\'edent}{M-v} |
| 342 | \key{d\'efiler l'\'ecran vers la droite}{C-x <} | 342 | \key{d\'efiler l'\'ecran vers la droite}{C-x <} |
| 343 | \key{d\'efiler l'\'ecran vers la gauche}{C-x >} | 343 | \key{d\'efiler l'\'ecran vers la gauche}{C-x >} |
| 344 | \key{placer la ligne courante au centre de l'\'ecran}{C-u C-l} | 344 | \key{placer la ligne courante au centre de l'\'ecran}{C-u C-l} |
| @@ -346,17 +346,17 @@ qui n'a pas \'et\'e fait. | |||
| 346 | \section{D\'etruire et supprimer} | 346 | \section{D\'etruire et supprimer} |
| 347 | 347 | ||
| 348 | \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr | 348 | \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr |
| 349 | \threecol{{\bf entity to kill}}{{\bf backward}}{{\bf forward}} | 349 | \threecol{{\bf entit\'e \`a supprimer}}{{\bf en arri\`ere}}{{\bf en avant}} |
| 350 | \threecol{caract\`ere (suppression, pas destruction)}{DEL}{C-d} | 350 | \threecol{caract\`ere (suppression, pas destruction)}{DEL}{C-d} |
| 351 | \threecol{mot}{M-DEL}{M-d} | 351 | \threecol{mot}{M-DEL}{M-d} |
| 352 | \threecol{ligne (jusqu'À la fin)}{M-0 C-k}{C-k} | 352 | \threecol{ligne (jusqu'\`a la fin)}{M-0 C-k}{C-k} |
| 353 | \threecol{phrase}{C-x DEL}{M-k} | 353 | \threecol{phrase}{C-x DEL}{M-k} |
| 354 | \threecol{s-expression}{M-- C-M-k}{C-M-k} | 354 | \threecol{s-expression}{M-- C-M-k}{C-M-k} |
| 355 | } | 355 | } |
| 356 | 356 | ||
| 357 | \key{d\'etruire une {\bf r\'egion}}{C-w} | 357 | \key{d\'etruire une {\bf r\'egion}}{C-w} |
| 358 | \key{copier une r\'egion dans le kill ring}{M-w} | 358 | \key{copier une r\'egion dans le kill ring}{M-w} |
| 359 | \key{d\'etruire jusqu'À l'occurrence suivante de {\it car}}{M-z {\it car}} | 359 | \key{d\'etruire jusqu'\`a l'occurrence suivante de {\it car}}{M-z {\it car}} |
| 360 | 360 | ||
| 361 | \key{r\'ecup\'erer la derni\`ere chose d\'etruite}{C-y} | 361 | \key{r\'ecup\'erer la derni\`ere chose d\'etruite}{C-y} |
| 362 | \key{remplacer la derni\`ere r\'ecup\'eration par ce qui a \'et\'e d\'etruit avant}{M-y} | 362 | \key{remplacer la derni\`ere r\'ecup\'eration par ce qui a \'et\'e d\'etruit avant}{M-y} |
| @@ -380,11 +380,11 @@ qui n'a pas \'et\'e fait. | |||
| 380 | 380 | ||
| 381 | Les r\'eponses admises dans le mode de remplacement interactif sont : | 381 | Les r\'eponses admises dans le mode de remplacement interactif sont : |
| 382 | 382 | ||
| 383 | \key{{\bf remplacer} celle-lÀ, passer À la suivante}{SPC} | 383 | \key{{\bf remplacer} celle-l\`a, passer \`a la suivante}{SPC} |
| 384 | \key{remplacer celle-lÀ, rester lÀ}{,} | 384 | \key{remplacer celle-l\`a, rester l\`a}{,} |
| 385 | \key{{\bf passer} À la suivante sans remplacer}{DEL} | 385 | \key{{\bf passer} \`a la suivante sans remplacer}{DEL} |
| 386 | \key{remplacer toutes les correspondances suivantes}{!} | 386 | \key{remplacer toutes les correspondances suivantes}{!} |
| 387 | \key{{\bf revenir} À la correspondance pr\'ec\'edente}{^} | 387 | \key{{\bf revenir} \`a la correspondance pr\'ec\'edente}{^} |
| 388 | \key{{\bf sortir} du remplacement interactif}{RET} | 388 | \key{{\bf sortir} du remplacement interactif}{RET} |
| 389 | \key{entrer dans l'\'edition r\'ecursive (\kbd{C-M-c} pour sortir)}{C-r} | 389 | \key{entrer dans l'\'edition r\'ecursive (\kbd{C-M-c} pour sortir)}{C-r} |
| 390 | 390 | ||
| @@ -405,7 +405,7 @@ Lorsqu'il y a deux commandes, la seconde est pour l'"autre cadre". | |||
| 405 | 405 | ||
| 406 | {\setbox0=\hbox{\kbd{0}}\advance\hsize by 2\wd0 | 406 | {\setbox0=\hbox{\kbd{0}}\advance\hsize by 2\wd0 |
| 407 | \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr | 407 | \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr |
| 408 | \threecol{switch cursor to another window}{C-x o}{C-x 5 o} | 408 | \threecol{placer le curseur dans une autre fen\^etre}{C-x o}{C-x 5 o} |
| 409 | 409 | ||
| 410 | \threecol{s\'electionner le tampon dans l'autre fen\^etre}{C-x 4 b}{C-x 5 b} | 410 | \threecol{s\'electionner le tampon dans l'autre fen\^etre}{C-x 4 b}{C-x 5 b} |
| 411 | \threecol{afficher le tampon dans l'autre fen\^etre}{C-x 4 C-o}{C-x 5 C-o} | 411 | \threecol{afficher le tampon dans l'autre fen\^etre}{C-x 4 C-o}{C-x 5 C-o} |
| @@ -429,9 +429,9 @@ Lorsqu'il y a deux commandes, la seconde est pour l'"autre cadre". | |||
| 429 | \key{ins\'erer un newline apr\`es le point}{C-o} | 429 | \key{ins\'erer un newline apr\`es le point}{C-o} |
| 430 | \key{d\'eplacer le reste de la ligne vers le bas}{C-M-o} | 430 | \key{d\'eplacer le reste de la ligne vers le bas}{C-M-o} |
| 431 | \key{supprimer les lignes blanches autour du point}{C-x C-o} | 431 | \key{supprimer les lignes blanches autour du point}{C-x C-o} |
| 432 | \key{joindre la ligne À la pr\'ec\'edente (À la suivant avec arg)}{M-^} | 432 | \key{joindre la ligne \`a la pr\'ec\'edente (\`a la suivante avec arg)}{M-^} |
| 433 | \key{supprimer tous les espaces autour du point}{M-\\} | 433 | \key{supprimer tous les espaces autour du point}{M-\\} |
| 434 | \key{mettre exactement un espace À l'emplacement du point}{M-SPC} | 434 | \key{mettre exactement un espace \`a l'emplacement du point}{M-SPC} |
| 435 | 435 | ||
| 436 | \key{remplir le paragraphe}{M-q} | 436 | \key{remplir le paragraphe}{M-q} |
| 437 | \key{placer la marge droite}{C-x f} | 437 | \key{placer la marge droite}{C-x f} |
| @@ -454,11 +454,11 @@ Les touches suivantes sont utilisables dans le mini-tampon : | |||
| 454 | 454 | ||
| 455 | \key{compl\'eter autant que possible}{TAB} | 455 | \key{compl\'eter autant que possible}{TAB} |
| 456 | \key{compl\'eter un mot}{SPC} | 456 | \key{compl\'eter un mot}{SPC} |
| 457 | \key{completer et ex\'ecuter}{RET} | 457 | \key{compl\'eter et ex\'ecuter}{RET} |
| 458 | \key{montrer les compl\'etions possibles}{?} | 458 | \key{montrer les compl\'etions possibles}{?} |
| 459 | \key{rechercher l'entr\'ee pr\'ec\'edente du mini-tampon}{M-p} | 459 | \key{rechercher l'entr\'ee pr\'ec\'edente du mini-tampon}{M-p} |
| 460 | \key{rechercher l'entr\'ee suivante du mini-tampon ou le d\'efaut}{M-n} | 460 | \key{rechercher l'entr\'ee suivante du mini-tampon ou le d\'efaut}{M-n} |
| 461 | \key{rechercher À rebours par expr. rationnelle dans l'historique}{M-r} | 461 | \key{rechercher \`a rebours par expr. rationnelle dans l'historique}{M-r} |
| 462 | \key{rechercher vers l'avant par expr. rationnelle dans l'historique}{M-s} | 462 | \key{rechercher vers l'avant par expr. rationnelle dans l'historique}{M-s} |
| 463 | \key{annuler la commande}{C-g} | 463 | \key{annuler la commande}{C-g} |
| 464 | 464 | ||
| @@ -511,7 +511,7 @@ menu utilisant le minitampon. | |||
| 511 | \key{copier le rectangle dans le registre}{C-x r r} | 511 | \key{copier le rectangle dans le registre}{C-x r r} |
| 512 | \key{d\'etruire le rectangle}{C-x r k} | 512 | \key{d\'etruire le rectangle}{C-x r k} |
| 513 | \key{r\'ecup\'erer le rectangle}{C-x r y} | 513 | \key{r\'ecup\'erer le rectangle}{C-x r y} |
| 514 | \key{ouvrir le rectangle, en d\'ecalant le texte À droite}{C-x r o} | 514 | \key{ouvrir le rectangle, en d\'ecalant le texte \`a droite}{C-x r o} |
| 515 | \key{vider le rectangle}{C-x r c} | 515 | \key{vider le rectangle}{C-x r c} |
| 516 | \key{pr\'efixer chaque ligne avec une cha\^\i{}ne}{C-x r t} | 516 | \key{pr\'efixer chaque ligne avec une cha\^\i{}ne}{C-x r t} |
| 517 | 517 | ||
| @@ -545,7 +545,7 @@ menu utilisant le minitampon. | |||
| 545 | \threecol{tampon}{\\`}{\\'} | 545 | \threecol{tampon}{\\`}{\\'} |
| 546 | 546 | ||
| 547 | \threecol{{\bf classe de caract\`ere}}{{\bf correspond}}{{\bf correspond | 547 | \threecol{{\bf classe de caract\`ere}}{{\bf correspond}}{{\bf correspond |
| 548 | À d'autres}} | 548 | \`a d'autres}} |
| 549 | \threecol{ensemble explicite}{[ {\rm$\ldots$} ]}{[^ {\rm$\ldots$} ]} | 549 | \threecol{ensemble explicite}{[ {\rm$\ldots$} ]}{[^ {\rm$\ldots$} ]} |
| 550 | \threecol{caract\`ere de mot}{\\w}{\\W} | 550 | \threecol{caract\`ere de mot}{\\w}{\\W} |
| 551 | \threecol{caract\`ere avec la syntaxe {\it c}}{\\s{\it c}}{\\S{\it c}} | 551 | \threecol{caract\`ere avec la syntaxe {\it c}}{\\s{\it c}}{\\S{\it c}} |
| @@ -605,8 +605,8 @@ Autres : | |||
| 605 | \key{{\bf lancer} la d\'efinition d'une macro clavier}{C-x (} | 605 | \key{{\bf lancer} la d\'efinition d'une macro clavier}{C-x (} |
| 606 | \key{{\bf terminer} la d\'efinition d'une macro clavier}{C-x )} | 606 | \key{{\bf terminer} la d\'efinition d'une macro clavier}{C-x )} |
| 607 | \key{{\bf ex\'ecuter} la derni\`ere macro clavier d\'efinie}{C-x e} | 607 | \key{{\bf ex\'ecuter} la derni\`ere macro clavier d\'efinie}{C-x e} |
| 608 | \key{ajouter À la derni\`ere macro clavier}{C-u C-x (} | 608 | \key{ajouter \`a la derni\`ere macro clavier}{C-u C-x (} |
| 609 | \metax{donner un nom À la derni\`ere macro clavier}{M-x name-last-kbd-macro} | 609 | \metax{donner un nom \`a la derni\`ere macro clavier}{M-x name-last-kbd-macro} |
| 610 | \metax{ins\'erer une d\'efinition Lisp dans le tampon}{M-x insert-kbd-macro} | 610 | \metax{ins\'erer une d\'efinition Lisp dans le tampon}{M-x insert-kbd-macro} |
| 611 | 611 | ||
| 612 | \section{Commandes de gestion d'Emacs Lisp} | 612 | \section{Commandes de gestion d'Emacs Lisp} |
| @@ -615,7 +615,7 @@ Autres : | |||
| 615 | \key{\'evaluer la {\bf defun} courante}{C-M-x} | 615 | \key{\'evaluer la {\bf defun} courante}{C-M-x} |
| 616 | \metax{\'evaluer la {\bf r\'egion}}{M-x eval-region} | 616 | \metax{\'evaluer la {\bf r\'egion}}{M-x eval-region} |
| 617 | \key{lire et \'evaluer le mini-tampon}{M-:} | 617 | \key{lire et \'evaluer le mini-tampon}{M-:} |
| 618 | \metax{charger À partir du r\'epertoire syst\`eme standard}{M-x load-library} | 618 | \metax{charger \`a partir du r\'epertoire syst\`eme standard}{M-x load-library} |
| 619 | 619 | ||
| 620 | \section{Personnalisation simple} | 620 | \section{Personnalisation simple} |
| 621 | 621 | ||
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index db884f5af3b..6912fb5d861 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,207 @@ | |||
| 1 | 2004-12-14 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * buff-menu.el (list-buffers-noselect): Collect internal info | ||
| 4 | for every buffer in BUFFER-LIST arg too. | ||
| 5 | (Buffer-menu-switch-other-window): Bind pop-up-windows to t. | ||
| 6 | (Buffer-menu-switch-other-window, Buffer-menu-2-window): | ||
| 7 | Bind same-window-buffer-names and same-window-regexps to nil. | ||
| 8 | |||
| 9 | 2004-12-13 Juri Linkov <juri@jurta.org> | ||
| 10 | |||
| 11 | * simple.el (next-error-buffer-p, next-error-find-buffer): | ||
| 12 | Doc fix. | ||
| 13 | |||
| 14 | * mail/supercite.el (sc-cite-frame-alist): Doc fix. | ||
| 15 | (sc-cite-region, sc-uncite-region, sc-recite-region): | ||
| 16 | Fix previous change to handle not alist as a symbol, but | ||
| 17 | a citation frame as a symbol that represents a variable name. | ||
| 18 | |||
| 19 | 2004-12-13 Richard M. Stallman <rms@gnu.org> | ||
| 20 | |||
| 21 | * filecache.el (file-cache-add-directory-using-find): | ||
| 22 | Only set up file-cache-find-command-posix-flag if we will use it. | ||
| 23 | |||
| 24 | * bindings.el (mode-line-buffer-identification-keymap): | ||
| 25 | Don't cancel the mode-line's usual down-mouse-1 binding. | ||
| 26 | |||
| 27 | * cus-edit.el (custom-face-selected): Handle `default' specs. | ||
| 28 | (custom-face-edit): Increase extra-offset. | ||
| 29 | (custom-display): Handle `default' specs. | ||
| 30 | |||
| 31 | * xml.el (xml-name-re, xml-entity-value-re): Add defvars. | ||
| 32 | |||
| 33 | * emacs-lisp/elint.el (elint-standard-variables) | ||
| 34 | (elint-unknown-builtin-args): Move definitions up. | ||
| 35 | |||
| 36 | * net/browse-url.el (browse-url-url-at-point): Add autoload. | ||
| 37 | |||
| 38 | * info.el (info-xref-visited): Use `default' instead of t. | ||
| 39 | (Info-try-follow-nearest-node): Don't explicitly load browse-url. | ||
| 40 | |||
| 41 | * faces.el (header-line, mode-line-inactive, tool-bar): | ||
| 42 | Use `default' instead of t for setting the defaults. | ||
| 43 | (face-spec-choose): Separate `t' from `default'. | ||
| 44 | |||
| 45 | * subr.el (while-no-input): New macro. | ||
| 46 | |||
| 47 | 2004-12-13 Frederik Fouvry <fouvry@CoLi.Uni-SB.DE> (tiny change) | ||
| 48 | |||
| 49 | * filecache.el (file-cache-add-directory-using-find): | ||
| 50 | Only test file-cache-find-command-posix-flag on some systems. | ||
| 51 | |||
| 52 | 2004-12-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 53 | |||
| 54 | * vc-svn.el (vc-svn-repository-hostname): Adjust to new format. | ||
| 55 | Reported by Ville Skytt,Ad(B <scop@xemacs.org>. | ||
| 56 | (vc-svn-annotate-current-time, vc-svn-annotate-time-of-rev) | ||
| 57 | (vc-svn-annotate-time, vc-svn-annotate-extract-revision-at-line) | ||
| 58 | (vc-svn-annotate-command, vc-svn-annotate-re): Support for svn annotate. | ||
| 59 | |||
| 60 | 2004-12-12 Juri Linkov <juri@jurta.org> | ||
| 61 | |||
| 62 | * files.el (find-file-other-window, find-file-other-frame): | ||
| 63 | Add the first buffer to the returned value to return the complete | ||
| 64 | list of all visited buffers. | ||
| 65 | (find-file-read-only, find-file-read-only-other-window) | ||
| 66 | (find-file-read-only-other-frame): Use nil for `mustmatch' arg of | ||
| 67 | `find-file-read-args'. Signal an error about non-existent file | ||
| 68 | only if file name doesn't contain wildcards. Toggle read-only in | ||
| 69 | all visited buffers. | ||
| 70 | (find-alternate-file, find-alternate-file-other-window): | ||
| 71 | Add optional arg `wildcards'. Doc fix. Set `wildcards' to t when | ||
| 72 | called interactively. Pass arg `wildcards' to other functions. | ||
| 73 | (find-file-noselect): Doc fix. | ||
| 74 | |||
| 75 | * ffap.el (ffap-dired-wildcards): Set default to "[*?][^/]*\\'". | ||
| 76 | Doc fix. | ||
| 77 | (ffap-directory-finder): New variable. | ||
| 78 | (ffap-string-at-point-mode-alist): Add * and ? to `file'. | ||
| 79 | (ffap-file-at-point): Add /* to immediately rejected names. | ||
| 80 | Return absolute file names matching ffap-dired-wildcards. | ||
| 81 | (ffap-read-file-or-url): Set default value for `completing-read' | ||
| 82 | to `buffer-file-name'. | ||
| 83 | (find-file-at-point): When filename matches ffap-dired-wildcards, | ||
| 84 | call ffap-file-finder with t arg `wildcards', instead of dired. | ||
| 85 | (ffap-other-window, ffap-other-frame): Return visited buffers. | ||
| 86 | (ffap-read-only, ffap-read-only-other-window) | ||
| 87 | (ffap-read-only-other-frame, ffap-alternate-file): New commands. | ||
| 88 | (dired-at-point): Call ffap-directory-finder instead of dired. | ||
| 89 | (ffap-dired-other-window, ffap-dired-other-frame) | ||
| 90 | (ffap-list-directory): New commands. | ||
| 91 | (ffap-bindings): New keybindings for new commands. | ||
| 92 | |||
| 93 | 2004-12-12 Juri Linkov <juri@jurta.org> | ||
| 94 | |||
| 95 | * simple.el (beginning-of-buffer, end-of-buffer): | ||
| 96 | * emacs-lisp/lisp.el (beginning-of-defun, end-of-defun): | ||
| 97 | Do not push mark when mark is active in transient-mark-mode. | ||
| 98 | |||
| 99 | * simple.el (mark-word): | ||
| 100 | * emacs-lisp/lisp.el (mark-sexp, mark-defun): | ||
| 101 | * textmodes/paragraphs.el (mark-paragraph): | ||
| 102 | Extend the region when mark is active in transient-mark-mode, | ||
| 103 | regardless of the last command. Doc fix. | ||
| 104 | |||
| 105 | * simple.el (mark-word): Preserve direction when repeating. | ||
| 106 | Make arg optional. Interactive "p" -> "P". | ||
| 107 | (transient-mark-mode, inhibit-mark-movement): Doc fix. | ||
| 108 | |||
| 109 | * emacs-lisp/lisp.el (mark-sexp): Reverse the condition for | ||
| 110 | preserving direction, to mark forward instead of backward when mark | ||
| 111 | is equal to point (e.g. when C-SPC C-M-SPC is typed in t-m-m). | ||
| 112 | |||
| 113 | 2004-12-12 Juri Linkov <juri@jurta.org> | ||
| 114 | |||
| 115 | * isearch.el (isearch-edit-string): Set 7th arg of | ||
| 116 | `read-from-minibuffer' to `t' to inherit the current input | ||
| 117 | method (whose name is indicated by [IM] in the minibuffer prompt) | ||
| 118 | from the current buffer to the minibuffer. | ||
| 119 | (isearch-lazy-highlight-update): Put body to `with-local-quit' | ||
| 120 | to allow C-g quitting for lazy highlighting looping inside the | ||
| 121 | search with nested repetition operators. Add overlay to the list | ||
| 122 | before setting its face and other properties to avoid the case of | ||
| 123 | code quitting after placing the new overlay but before it's | ||
| 124 | recorded on the list. Select the window where isearch was | ||
| 125 | activated, to highlight matches in the right window when isearch | ||
| 126 | switches the current window to the minibuffer. | ||
| 127 | |||
| 128 | * international/isearch-x.el | ||
| 129 | (isearch-process-search-multibyte-characters): | ||
| 130 | Use `isearch-message' as initial input for `read-string' instead | ||
| 131 | of adding it to the minibuffer prompt. After reading a string | ||
| 132 | remove the initial value of `isearch-message' from the string. | ||
| 133 | |||
| 134 | * replace.el (replace-match-maybe-edit): Doc fix. | ||
| 135 | (perform-replace): Don't call `replace-highlight' when automatic | ||
| 136 | replacement is requested in literal mode, since it is intended | ||
| 137 | only to highlight words during entering a new replacement string | ||
| 138 | for \? in non-literal mode. | ||
| 139 | |||
| 140 | * replace.el (query-replace-highlight): Add new value `isearch' | ||
| 141 | that allows query replacement to use isearch highlighting. | ||
| 142 | Change type from `boolean' to `choice'. Doc fix. | ||
| 143 | (replace-highlight, replace-dehighlight, perform-replace): | ||
| 144 | Use isearch highlighting if query-replace-highlight eq `isearch'. | ||
| 145 | |||
| 146 | 2004-12-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 147 | |||
| 148 | * emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments) | ||
| 149 | (checkdoc-message-text, checkdoc-defun): Fix format messages for `error'. | ||
| 150 | |||
| 151 | * textmodes/tex-mode.el (latex-backward-sexp-1): Handle the special | ||
| 152 | case of \end{verbatim}. | ||
| 153 | |||
| 154 | 2004-12-11 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 155 | |||
| 156 | * term.el (term-termcap-format): Synchronyze with terminfo. | ||
| 157 | (term-emulate-terminal): Handle reset. | ||
| 158 | (term-reset-terminal): New function. | ||
| 159 | |||
| 160 | 2004-12-11 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 161 | |||
| 162 | * play/zone.el (zone-programs): Add `zone-pgm-random-life'. | ||
| 163 | (zone-fill-out-screen): New func. | ||
| 164 | (zone-pgm-drip): Use `zone-fill-out-screen'. | ||
| 165 | Also, no longer go to point-min on every cycle. | ||
| 166 | (zone-pgm-paragraph-spaz): Allow spazzing for texinfo-mode. | ||
| 167 | (zone-pgm-random-life-wait): New user var. | ||
| 168 | (zone-pgm-random-life): New func. | ||
| 169 | |||
| 170 | 2004-12-10 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 171 | |||
| 172 | * files.el (auto-mode-alist): Map .com to DCL mode. | ||
| 173 | |||
| 174 | 2004-12-09 Richard M. Stallman <rms@gnu.org> | ||
| 175 | |||
| 176 | * isearch.el (isearch-mode-map): Treat S-SPC like SPC. | ||
| 177 | |||
| 178 | 2004-12-09 Nick Roberts <nickrob@snap.net.nz> | ||
| 179 | |||
| 180 | * xt-mouse.el (xterm-mouse-event): Correct cursor position in a | ||
| 181 | buffer with a display margin. | ||
| 182 | |||
| 183 | 2004-12-08 Jay Belanger <belanger@truman.edu> | ||
| 184 | |||
| 185 | * calc/calc-keypd.el (calc-keypad-mode): Unbind unused mouse events. | ||
| 186 | (calc-keypad-left-click): Set buffer to calc-keymap-buffer. | ||
| 187 | |||
| 188 | 2004-12-08 Richard M. Stallman <rms@gnu.org> | ||
| 189 | |||
| 190 | * faces.el: Delete code to set display table. | ||
| 191 | (escape-glyph): Redefine to be less loud. (Copy minibuffer-prompt.) | ||
| 192 | |||
| 193 | 2004-12-08 Jay Belanger <belanger@truman.edu> | ||
| 194 | |||
| 195 | * calc/calc.el: Add math-read-preprocess-string to autoloads. | ||
| 196 | |||
| 197 | * calc/calc-ext.el (math-read-replacement-list) | ||
| 198 | (math-read-superscripts, math-read-preprocess-string): Move to | ||
| 199 | calc-aent.el. | ||
| 200 | |||
| 201 | * calc/calc-aent.el (math-read-replacement-list) | ||
| 202 | (math-read-superscripts, math-read-preprocess-string): Move from | ||
| 203 | calc-ext.el. | ||
| 204 | |||
| 1 | 2004-12-07 Stefan Monnier <monnier@iro.umontreal.ca> | 205 | 2004-12-07 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 206 | ||
| 3 | * isearch.el (isearch-quote-char): Fix up typo in last change. | 207 | * isearch.el (isearch-quote-char): Fix up typo in last change. |
| @@ -10,10 +214,9 @@ | |||
| 10 | * edmacro.el: `edit-kbd-macro' is now bound to `C-x C-k e'. | 214 | * edmacro.el: `edit-kbd-macro' is now bound to `C-x C-k e'. |
| 11 | (edmacro-finish-edit): Further update for keyboard macros that are | 215 | (edmacro-finish-edit): Further update for keyboard macros that are |
| 12 | lambda forms. | 216 | lambda forms. |
| 13 | (edmacro-sanitize-for-string): Correctly remove Meta modifier | 217 | (edmacro-sanitize-for-string): Correctly remove Meta modifier. |
| 14 | (as suggested by Kim Storm). | ||
| 15 | 218 | ||
| 16 | 2004-12-06 Stefan Monnier <monnier@iro.umontreal.ca> | 219 | 2004-12-07 Stefan Monnier <monnier@iro.umontreal.ca> |
| 17 | 220 | ||
| 18 | * font-lock.el (font-lock-unfontify-region): Save buffer state. | 221 | * font-lock.el (font-lock-unfontify-region): Save buffer state. |
| 19 | (font-lock-default-unfontify-region): Don't save buffer state any more. | 222 | (font-lock-default-unfontify-region): Don't save buffer state any more. |
| @@ -7853,7 +8056,115 @@ | |||
| 7853 | (compilation-forget-errors): Don't localize already local | 8056 | (compilation-forget-errors): Don't localize already local |
| 7854 | compilation-locs and remove FIXME about refontifying. | 8057 | compilation-locs and remove FIXME about refontifying. |
| 7855 | 8058 | ||
| 7856 | 2004-04-14 | 8059 | 2004-04-14 Kim F. Storm <storm@cua.dk> |
| 8060 | |||
| 8061 | * startup.el (emacs-quick-startup): New defvar (set by -Q). | ||
| 8062 | (command-line): New option -Q. Like -q --no-site-file, but | ||
| 8063 | in addition it also disables menu-bar, tool-bar, scroll-bars, | ||
| 8064 | tool-tips, and the blinking cursor. | ||
| 8065 | (command-line-1): Skip startup screen if -Q. | ||
| 8066 | (fancy-splash-head): Use ":align-to center" prop to center splash image. | ||
| 8067 | |||
| 8068 | * emulation/cua-base.el (cua-read-only-cursor-color) | ||
| 8069 | (cua-overwrite-cursor-color, cua-global-mark-cursor-color): Doc fix. | ||
| 8070 | |||
| 8071 | 2004-04-13 Dave Love <fx@gnu.org> | ||
| 8072 | |||
| 8073 | * progmodes/python.el: Doc fixes. Changes for compiler warnings. | ||
| 8074 | (syntax): Don't require. | ||
| 8075 | (python) <defgroup>: Add :version. | ||
| 8076 | (python-quote-syntax): Re-written. | ||
| 8077 | (inferior-python-mode): Move stuff here from run-python and add | ||
| 8078 | some more. | ||
| 8079 | (python-preoutput-continuation, python-preoutput-result) | ||
| 8080 | (python-dotty-syntax-table): New. | ||
| 8081 | (python-describe-symbol): Use them. | ||
| 8082 | (run-python): Move stuff to inferior-python-mode. Modify code | ||
| 8083 | loaded into Python. | ||
| 8084 | (python-send-region): Use python-proc, python-send-string. | ||
| 8085 | (python-send-string): Send newlines too. Callers changed. | ||
| 8086 | (python-load-file): Re-written. | ||
| 8087 | (python-eldoc-function): New. | ||
| 8088 | (info-look): Don't require. | ||
| 8089 | (python-after-info-look): New. A modified version of former | ||
| 8090 | top-level code for use with eval-after-load. | ||
| 8091 | (python-maybe-jython, python-guess-indent): Use widened buffer. | ||
| 8092 | (python-fill-paragraph): Re-written. | ||
| 8093 | (python-mode): Fix outline-regexp. Set outline-heading-end-regexp, | ||
| 8094 | eldoc-print-current-symbol-info-function. Add to eldoc-mode-hook. | ||
| 8095 | |||
| 8096 | 2004-04-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 8097 | |||
| 8098 | * progmodes/python.el (run-python): Use compilation-shell-minor-mode. | ||
| 8099 | Set compilation-error-regexp-alist earlier. | ||
| 8100 | |||
| 8101 | * progmodes/compile.el (compilation-minor-mode-map) | ||
| 8102 | (compilation-shell-minor-mode-map, compile-mouse-goto-error) | ||
| 8103 | (compile-goto-error): Re-merge the mouse and non-mouse commands. | ||
| 8104 | |||
| 8105 | 2004-04-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 8106 | |||
| 8107 | * progmodes/compile.el (compile-goto-error): Select the buffer/window | ||
| 8108 | corresponding to the event. | ||
| 8109 | |||
| 8110 | 2004-04-12 Joe Buehler <jbuehler@hekiman.com> | ||
| 8111 | |||
| 8112 | * loadup.el: Add cygwin to system-type list, for unexec() support. | ||
| 8113 | |||
| 8114 | 2004-04-12 John Paul Wallington <jpw@gnu.org> | ||
| 8115 | |||
| 8116 | * ibuffer.el (ibuffer-delete-window-on-quit): Remove. | ||
| 8117 | (ibuffer-restore-window-config-on-quit): New variable to replace | ||
| 8118 | `ibuffer-delete-window-on-quit'. Update all references. | ||
| 8119 | (ibuffer-prev-window-config): New variable. | ||
| 8120 | (ibuffer-quit): Restore previous window configuration instead of | ||
| 8121 | deleting window. | ||
| 8122 | (ibuffer): Save window configuration before showing Ibuffer buffer. | ||
| 8123 | |||
| 8124 | * help.el (describe-mode): Doc fix. | ||
| 8125 | |||
| 8126 | 2004-04-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 8127 | |||
| 8128 | * progmodes/compile.el (compilation-mode-font-lock-keywords): Fix test | ||
| 8129 | not to treat nil as a function. | ||
| 8130 | |||
| 8131 | * vc-arch.el (vc-arch-root): Be a bit more careful. | ||
| 8132 | (vc-arch-register): Save the buffer if we modified it. | ||
| 8133 | (vc-arch-delete-rej-if-obsolete): Save excursion. | ||
| 8134 | (vc-arch-find-file-hook): Use the simpler after-save-hook. | ||
| 8135 | (vc-arch-responsible-p, vc-arch-init-version): New functions. | ||
| 8136 | |||
| 8137 | * net/ldap.el (ldap-search): Use list*. | ||
| 8138 | |||
| 8139 | 2004-04-12 Juri Linkov <juri@jurta.org> | ||
| 8140 | |||
| 8141 | * info.el (Info-follow-reference): Allow multiline reference name. | ||
| 8142 | |||
| 8143 | 2004-04-11 Dave Love <fx@gnu.org> | ||
| 8144 | |||
| 8145 | * emacs-lisp/bytecomp.el (byte-compile-cond): Fix last change. | ||
| 8146 | |||
| 8147 | * progmodes/python.el: New file. | ||
| 8148 | |||
| 8149 | 2004-04-11 Andre Spiegel <spiegel@gnu.org> | ||
| 8150 | |||
| 8151 | * vc-hooks.el (vc-arg-list): Function removed. | ||
| 8152 | (vc-default-workfile-unchanged-p): Use condition-case to check for | ||
| 8153 | backward compatibility. | ||
| 8154 | |||
| 8155 | * vc.el (vc-print-log): Use condition-case to check for backward | ||
| 8156 | compatibility. | ||
| 8157 | |||
| 8158 | 2004-04-11 Juri Linkov <juri@jurta.org> | ||
| 8159 | |||
| 8160 | * dired.el (dired-faces): New defgroup. | ||
| 8161 | (dired-header, dired-mark, dired-marked, dired-flagged) | ||
| 8162 | (dired-warning, dired-directory, dired-symlink, dired-ignored): | ||
| 8163 | New faces. | ||
| 8164 | (dired-header-face, dired-mark-face, dired-marked-face) | ||
| 8165 | (dired-flagged-face, dired-warning-face, dired-directory-face) | ||
| 8166 | (dired-symlink-face, dired-ignored-face): New face variables. | ||
| 8167 | (dired-font-lock-keywords): Use them instead of font-lock faces. | ||
| 7857 | Split the rule for dired marks into 3 separate rules: for marks, | 8168 | Split the rule for dired marks into 3 separate rules: for marks, |
| 7858 | marked file names and flagged file names. | 8169 | marked file names and flagged file names. |
| 7859 | 8170 | ||
diff --git a/lisp/bindings.el b/lisp/bindings.el index b3459b62ac8..93921c6f982 100644 --- a/lisp/bindings.el +++ b/lisp/bindings.el | |||
| @@ -448,7 +448,6 @@ Menu of mode operations in the mode line.") | |||
| 448 | (let ((map (make-sparse-keymap))) | 448 | (let ((map (make-sparse-keymap))) |
| 449 | ;; Bind down- events so that the global keymap won't ``shine | 449 | ;; Bind down- events so that the global keymap won't ``shine |
| 450 | ;; through''. | 450 | ;; through''. |
| 451 | (define-key map [mode-line down-mouse-1] 'ignore) | ||
| 452 | (define-key map [mode-line mouse-1] 'mode-line-unbury-buffer) | 451 | (define-key map [mode-line mouse-1] 'mode-line-unbury-buffer) |
| 453 | (define-key map [header-line down-mouse-1] 'ignore) | 452 | (define-key map [header-line down-mouse-1] 'ignore) |
| 454 | (define-key map [header-line mouse-1] 'mode-line-unbury-buffer) | 453 | (define-key map [header-line mouse-1] 'mode-line-unbury-buffer) |
diff --git a/lisp/buff-menu.el b/lisp/buff-menu.el index 990ab32c9a4..1c3fa704041 100644 --- a/lisp/buff-menu.el +++ b/lisp/buff-menu.el | |||
| @@ -484,14 +484,19 @@ in the selected frame." | |||
| 484 | "Make the other window select this line's buffer. | 484 | "Make the other window select this line's buffer. |
| 485 | The current window remains selected." | 485 | The current window remains selected." |
| 486 | (interactive) | 486 | (interactive) |
| 487 | (display-buffer (Buffer-menu-buffer t))) | 487 | (let ((pop-up-windows t) |
| 488 | same-window-buffer-names | ||
| 489 | same-window-regexps) | ||
| 490 | (display-buffer (Buffer-menu-buffer t)))) | ||
| 488 | 491 | ||
| 489 | (defun Buffer-menu-2-window () | 492 | (defun Buffer-menu-2-window () |
| 490 | "Select this line's buffer, with previous buffer in second window." | 493 | "Select this line's buffer, with previous buffer in second window." |
| 491 | (interactive) | 494 | (interactive) |
| 492 | (let ((buff (Buffer-menu-buffer t)) | 495 | (let ((buff (Buffer-menu-buffer t)) |
| 493 | (menu (current-buffer)) | 496 | (menu (current-buffer)) |
| 494 | (pop-up-windows t)) | 497 | (pop-up-windows t) |
| 498 | same-window-buffer-names | ||
| 499 | same-window-regexps) | ||
| 495 | (delete-other-windows) | 500 | (delete-other-windows) |
| 496 | (switch-to-buffer (other-buffer)) | 501 | (switch-to-buffer (other-buffer)) |
| 497 | (pop-to-buffer buff) | 502 | (pop-to-buffer buff) |
| @@ -671,8 +676,7 @@ For more information, see the function `buffer-menu'." | |||
| 671 | ;; line with the beginning of the text (rather than with the left | 676 | ;; line with the beginning of the text (rather than with the left |
| 672 | ;; scrollbar or the left fringe). –-Stef | 677 | ;; scrollbar or the left fringe). –-Stef |
| 673 | (setq header (concat (propertize " " 'display '(space :align-to 0)) | 678 | (setq header (concat (propertize " " 'display '(space :align-to 0)) |
| 674 | header)) | 679 | header))) |
| 675 | ) | ||
| 676 | (with-current-buffer (get-buffer-create "*Buffer List*") | 680 | (with-current-buffer (get-buffer-create "*Buffer List*") |
| 677 | (setq buffer-read-only nil) | 681 | (setq buffer-read-only nil) |
| 678 | (erase-buffer) | 682 | (erase-buffer) |
| @@ -684,47 +688,45 @@ For more information, see the function `buffer-menu'." | |||
| 684 | (mapcar (lambda (c) | 688 | (mapcar (lambda (c) |
| 685 | (if (memq c '(?\n ?\ )) c underline)) | 689 | (if (memq c '(?\n ?\ )) c underline)) |
| 686 | header))))) | 690 | header))))) |
| 687 | (if buffer-list | 691 | ;; Collect info for every buffer we're interested in. |
| 688 | (setq list buffer-list) | 692 | (dolist (buffer (or buffer-list (buffer-list))) |
| 689 | ;; Collect info for every buffer we're interested in. | 693 | (with-current-buffer buffer |
| 690 | (dolist (buffer (buffer-list)) | 694 | (let ((name (buffer-name)) |
| 691 | (with-current-buffer buffer | 695 | (file buffer-file-name)) |
| 692 | (let ((name (buffer-name)) | 696 | (unless (and (not buffer-list) |
| 693 | (file buffer-file-name)) | 697 | (or |
| 694 | (cond | 698 | ;; Don't mention internal buffers. |
| 695 | ;; Don't mention internal buffers. | 699 | (and (string= (substring name 0 1) " ") (null file)) |
| 696 | ((and (string= (substring name 0 1) " ") (null file))) | 700 | ;; Maybe don't mention buffers without files. |
| 697 | ;; Maybe don't mention buffers without files. | 701 | (and files-only (not file)) |
| 698 | ((and files-only (not file))) | 702 | (string= name "*Buffer List*"))) |
| 699 | ((string= name "*Buffer List*")) | 703 | ;; Otherwise output info. |
| 700 | ;; Otherwise output info. | 704 | (let ((mode (concat (format-mode-line mode-name nil nil buffer) |
| 701 | (t | 705 | (if mode-line-process |
| 702 | (let ((mode (concat (format-mode-line mode-name nil nil buffer) | 706 | (format-mode-line mode-line-process |
| 703 | (if mode-line-process | 707 | nil nil buffer)))) |
| 704 | (format-mode-line mode-line-process | 708 | (bits (string |
| 705 | nil nil buffer)))) | 709 | (if (eq buffer old-buffer) ?. ?\ ) |
| 706 | (bits (string | 710 | ;; Handle readonly status. The output buffer |
| 707 | (if (eq buffer old-buffer) ?. ?\ ) | 711 | ;; is special cased to appear readonly; it is |
| 708 | ;; Handle readonly status. The output buffer | 712 | ;; actually made so at a later date. |
| 709 | ;; is special cased to appear readonly; it is | 713 | (if (or (eq buffer standard-output) |
| 710 | ;; actually made so at a later date. | 714 | buffer-read-only) |
| 711 | (if (or (eq buffer standard-output) | 715 | ?% ?\ ) |
| 712 | buffer-read-only) | 716 | ;; Identify modified buffers. |
| 713 | ?% ?\ ) | 717 | (if (buffer-modified-p) ?* ?\ ) |
| 714 | ;; Identify modified buffers. | 718 | ;; Space separator. |
| 715 | (if (buffer-modified-p) ?* ?\ ) | 719 | ?\ ))) |
| 716 | ;; Space separator. | 720 | (unless file |
| 717 | ?\ ))) | 721 | ;; No visited file. Check local value of |
| 718 | (unless file | 722 | ;; list-buffers-directory. |
| 719 | ;; No visited file. Check local value of | 723 | (when (and (boundp 'list-buffers-directory) |
| 720 | ;; list-buffers-directory. | 724 | list-buffers-directory) |
| 721 | (when (and (boundp 'list-buffers-directory) | 725 | (setq file list-buffers-directory))) |
| 722 | list-buffers-directory) | 726 | (push (list buffer bits name (buffer-size) mode file) |
| 723 | (setq file list-buffers-directory))) | 727 | list)))))) |
| 724 | (push (list buffer bits name (buffer-size) mode file) | 728 | ;; Preserve the original buffer-list ordering, just in case. |
| 725 | list))))))) | 729 | (setq list (nreverse list)) |
| 726 | ;; Preserve the original buffer-list ordering, just in case. | ||
| 727 | (setq list (nreverse list))) | ||
| 728 | ;; Place the buffers's info in the output buffer, sorted if necessary. | 730 | ;; Place the buffers's info in the output buffer, sorted if necessary. |
| 729 | (dolist (buffer | 731 | (dolist (buffer |
| 730 | (if Buffer-menu-sort-column | 732 | (if Buffer-menu-sort-column |
diff --git a/lisp/calc/calc-aent.el b/lisp/calc/calc-aent.el index 4c62e570349..c062a822e89 100644 --- a/lisp/calc/calc-aent.el +++ b/lisp/calc/calc-aent.el | |||
| @@ -465,6 +465,73 @@ T means abort and give an error message.") | |||
| 465 | 465 | ||
| 466 | ;;; Algebraic expression parsing. [Public] | 466 | ;;; Algebraic expression parsing. [Public] |
| 467 | 467 | ||
| 468 | (defvar math-read-replacement-list | ||
| 469 | '(;; Misc symbols | ||
| 470 | ("±" "+/-") ; plus or minus | ||
| 471 | ("×" "*") ; multiplication sign | ||
| 472 | ("÷" ":") ; division sign | ||
| 473 | ("−" "-") ; subtraction sign | ||
| 474 | ("∕" "/") ; division sign | ||
| 475 | ("∗" "*") ; asterisk multiplication | ||
| 476 | ("∞" "inf") ; infinity symbol | ||
| 477 | ("≤" "<=") | ||
| 478 | ("≥" ">=") | ||
| 479 | ("≦" "<=") | ||
| 480 | ("≧" ">=") | ||
| 481 | ;; fractions | ||
| 482 | ("¼" "(1:4)") ; 1/4 | ||
| 483 | ("½" "(1:2)") ; 1/2 | ||
| 484 | ("¾" "(3:4)") ; 3/4 | ||
| 485 | ("â…“" "(1:3)") ; 1/3 | ||
| 486 | ("â…”" "(2:3)") ; 2/3 | ||
| 487 | ("â…•" "(1:5)") ; 1/5 | ||
| 488 | ("â…–" "(2:5)") ; 2/5 | ||
| 489 | ("â…—" "(3:5)") ; 3/5 | ||
| 490 | ("â…˜" "(4:5)") ; 4/5 | ||
| 491 | ("â…™" "(1:6)") ; 1/6 | ||
| 492 | ("â…š" "(5:6)") ; 5/6 | ||
| 493 | ("â…›" "(1:8)") ; 1/8 | ||
| 494 | ("⅜" "(3:8)") ; 3/8 | ||
| 495 | ("â…" "(5:8)") ; 5/8 | ||
| 496 | ("â…ž" "(7:8)") ; 7/8 | ||
| 497 | ("â…Ÿ" "1:") ; 1/... | ||
| 498 | ;; superscripts | ||
| 499 | ("â°" "0") ; 0 | ||
| 500 | ("¹" "1") ; 1 | ||
| 501 | ("²" "2") ; 2 | ||
| 502 | ("³" "3") ; 3 | ||
| 503 | ("â´" "4") ; 4 | ||
| 504 | ("âµ" "5") ; 5 | ||
| 505 | ("â¶" "6") ; 6 | ||
| 506 | ("â·" "7") ; 7 | ||
| 507 | ("â¸" "8") ; 8 | ||
| 508 | ("â¹" "9") ; 9 | ||
| 509 | ("âº" "+") ; + | ||
| 510 | ("â»" "-") ; - | ||
| 511 | ("â½" "(") ; ( | ||
| 512 | ("â¾" ")") ; ) | ||
| 513 | ("â¿" "n") ; n | ||
| 514 | ("â±" "i")) ; i | ||
| 515 | "A list whose elements (old new) indicate replacements to make | ||
| 516 | in Calc algebraic input.") | ||
| 517 | |||
| 518 | (defvar math-read-superscripts | ||
| 519 | "â°Â¹Â²Â³â´âµâ¶â·â¸â¹âºâ»â½â¾â¿â±" ; 0123456789+-()ni | ||
| 520 | "A string consisting of the superscripts allowed by Calc.") | ||
| 521 | |||
| 522 | (defun math-read-preprocess-string (str) | ||
| 523 | "Replace some substrings of STR by Calc equivalents." | ||
| 524 | (setq str | ||
| 525 | (replace-regexp-in-string (concat "[" math-read-superscripts "]+") | ||
| 526 | "^(\\&)" str)) | ||
| 527 | (let ((rep-list math-read-replacement-list)) | ||
| 528 | (while rep-list | ||
| 529 | (setq str | ||
| 530 | (replace-regexp-in-string (nth 0 (car rep-list)) | ||
| 531 | (nth 1 (car rep-list)) str)) | ||
| 532 | (setq rep-list (cdr rep-list)))) | ||
| 533 | str) | ||
| 534 | |||
| 468 | ;; The next few variables are local to math-read-exprs (and math-read-expr | 535 | ;; The next few variables are local to math-read-exprs (and math-read-expr |
| 469 | ;; in calc-ext.el), but are set in functions they call. | 536 | ;; in calc-ext.el), but are set in functions they call. |
| 470 | 537 | ||
diff --git a/lisp/calc/calc-ext.el b/lisp/calc/calc-ext.el index d308a391a05..89588b4ea74 100644 --- a/lisp/calc/calc-ext.el +++ b/lisp/calc/calc-ext.el | |||
| @@ -2874,73 +2874,6 @@ calc-kill calc-kill-region calc-yank)))) | |||
| 2874 | 2874 | ||
| 2875 | (defvar math-expr-data) | 2875 | (defvar math-expr-data) |
| 2876 | 2876 | ||
| 2877 | (defvar math-read-replacement-list | ||
| 2878 | '(;; Misc symbols | ||
| 2879 | ("±" "+/-") ; plus or minus | ||
| 2880 | ("×" "*") ; multiplication sign | ||
| 2881 | ("÷" ":") ; division sign | ||
| 2882 | ("−" "-") ; subtraction sign | ||
| 2883 | ("∕" "/") ; division sign | ||
| 2884 | ("∗" "*") ; asterisk multiplication | ||
| 2885 | ("∞" "inf") ; infinity symbol | ||
| 2886 | ("≤" "<=") | ||
| 2887 | ("≥" ">=") | ||
| 2888 | ("≦" "<=") | ||
| 2889 | ("≧" ">=") | ||
| 2890 | ;; fractions | ||
| 2891 | ("¼" "(1:4)") ; 1/4 | ||
| 2892 | ("½" "(1:2)") ; 1/2 | ||
| 2893 | ("¾" "(3:4)") ; 3/4 | ||
| 2894 | ("â…“" "(1:3)") ; 1/3 | ||
| 2895 | ("â…”" "(2:3)") ; 2/3 | ||
| 2896 | ("â…•" "(1:5)") ; 1/5 | ||
| 2897 | ("â…–" "(2:5)") ; 2/5 | ||
| 2898 | ("â…—" "(3:5)") ; 3/5 | ||
| 2899 | ("â…˜" "(4:5)") ; 4/5 | ||
| 2900 | ("â…™" "(1:6)") ; 1/6 | ||
| 2901 | ("â…š" "(5:6)") ; 5/6 | ||
| 2902 | ("â…›" "(1:8)") ; 1/8 | ||
| 2903 | ("⅜" "(3:8)") ; 3/8 | ||
| 2904 | ("â…" "(5:8)") ; 5/8 | ||
| 2905 | ("â…ž" "(7:8)") ; 7/8 | ||
| 2906 | ("â…Ÿ" "1:") ; 1/... | ||
| 2907 | ;; superscripts | ||
| 2908 | ("â°" "0") ; 0 | ||
| 2909 | ("¹" "1") ; 1 | ||
| 2910 | ("²" "2") ; 2 | ||
| 2911 | ("³" "3") ; 3 | ||
| 2912 | ("â´" "4") ; 4 | ||
| 2913 | ("âµ" "5") ; 5 | ||
| 2914 | ("â¶" "6") ; 6 | ||
| 2915 | ("â·" "7") ; 7 | ||
| 2916 | ("â¸" "8") ; 8 | ||
| 2917 | ("â¹" "9") ; 9 | ||
| 2918 | ("âº" "+") ; + | ||
| 2919 | ("â»" "-") ; - | ||
| 2920 | ("â½" "(") ; ( | ||
| 2921 | ("â¾" ")") ; ) | ||
| 2922 | ("â¿" "n") ; n | ||
| 2923 | ("â±" "i")) ; i | ||
| 2924 | "A list whose elements (old new) indicate replacements to make | ||
| 2925 | in Calc algebraic input.") | ||
| 2926 | |||
| 2927 | (defvar math-read-superscripts | ||
| 2928 | "â°Â¹Â²Â³â´âµâ¶â·â¸â¹âºâ»â½â¾â¿â±" ; 0123456789+-()ni | ||
| 2929 | "A string consisting of the superscripts allowed by Calc.") | ||
| 2930 | |||
| 2931 | (defun math-read-preprocess-string (str) | ||
| 2932 | "Replace some substrings of STR by Calc equivalents." | ||
| 2933 | (setq str | ||
| 2934 | (replace-regexp-in-string (concat "[" math-read-superscripts "]+") | ||
| 2935 | "^(\\&)" str)) | ||
| 2936 | (let ((rep-list math-read-replacement-list)) | ||
| 2937 | (while rep-list | ||
| 2938 | (setq str | ||
| 2939 | (replace-regexp-in-string (nth 0 (car rep-list)) | ||
| 2940 | (nth 1 (car rep-list)) str)) | ||
| 2941 | (setq rep-list (cdr rep-list)))) | ||
| 2942 | str) | ||
| 2943 | |||
| 2944 | (defun math-read-expr (math-exp-str) | 2877 | (defun math-read-expr (math-exp-str) |
| 2945 | (let ((math-exp-pos 0) | 2878 | (let ((math-exp-pos 0) |
| 2946 | (math-exp-old-pos 0) | 2879 | (math-exp-old-pos 0) |
diff --git a/lisp/calc/calc-keypd.el b/lisp/calc/calc-keypd.el index e517ac1942b..2c2a0f0f4aa 100644 --- a/lisp/calc/calc-keypd.el +++ b/lisp/calc/calc-keypd.el | |||
| @@ -236,9 +236,21 @@ | |||
| 236 | (define-key calc-keypad-mode-map (kbd "RET") 'calc-keypad-press) | 236 | (define-key calc-keypad-mode-map (kbd "RET") 'calc-keypad-press) |
| 237 | (define-key calc-keypad-mode-map (kbd "TAB") 'calc-keypad-menu) | 237 | (define-key calc-keypad-mode-map (kbd "TAB") 'calc-keypad-menu) |
| 238 | (define-key calc-keypad-mode-map "q" 'calc-keypad-off) | 238 | (define-key calc-keypad-mode-map "q" 'calc-keypad-off) |
| 239 | (define-key calc-keypad-mode-map [(mouse-3)] 'calc-keypad-right-click) | 239 | (define-key calc-keypad-mode-map [down-mouse-1] 'ignore) |
| 240 | (define-key calc-keypad-mode-map [(mouse-2)] 'calc-keypad-middle-click) | 240 | (define-key calc-keypad-mode-map [drag-mouse-1] 'ignore) |
| 241 | (define-key calc-keypad-mode-map [(mouse-1)] 'calc-keypad-left-click) | 241 | (define-key calc-keypad-mode-map [double-mouse-1] 'ignore) |
| 242 | (define-key calc-keypad-mode-map [triple-mouse-1] 'ignore) | ||
| 243 | (define-key calc-keypad-mode-map [down-mouse-2] 'ignore) | ||
| 244 | (define-key calc-keypad-mode-map [drag-mouse-2] 'ignore) | ||
| 245 | (define-key calc-keypad-mode-map [double-mouse-2] 'ignore) | ||
| 246 | (define-key calc-keypad-mode-map [triple-mouse-2] 'ignore) | ||
| 247 | (define-key calc-keypad-mode-map [down-mouse-3] 'ignore) | ||
| 248 | (define-key calc-keypad-mode-map [drag-mouse-3] 'ignore) | ||
| 249 | (define-key calc-keypad-mode-map [double-mouse-3] 'ignore) | ||
| 250 | (define-key calc-keypad-mode-map [triple-mouse-3] 'ignore) | ||
| 251 | (define-key calc-keypad-mode-map [mouse-3] 'calc-keypad-right-click) | ||
| 252 | (define-key calc-keypad-mode-map [mouse-2] 'calc-keypad-middle-click) | ||
| 253 | (define-key calc-keypad-mode-map [mouse-1] 'calc-keypad-left-click) | ||
| 242 | (put 'calc-keypad-mode 'mode-class 'special) | 254 | (put 'calc-keypad-mode 'mode-class 'special) |
| 243 | (make-local-variable 'calc-main-buffer)) | 255 | (make-local-variable 'calc-main-buffer)) |
| 244 | 256 | ||
| @@ -529,8 +541,9 @@ | |||
| 529 | (defun calc-keypad-left-click (event) | 541 | (defun calc-keypad-left-click (event) |
| 530 | "Handle a left-button mouse click in Calc Keypad window." | 542 | "Handle a left-button mouse click in Calc Keypad window." |
| 531 | (interactive "e") | 543 | (interactive "e") |
| 532 | (goto-char (posn-point (event-start event))) | 544 | (with-current-buffer calc-keypad-buffer |
| 533 | (calc-keypad-press)) | 545 | (goto-char (posn-point (event-start event))) |
| 546 | (calc-keypad-press))) | ||
| 534 | 547 | ||
| 535 | (defun calc-keypad-right-click (event) | 548 | (defun calc-keypad-right-click (event) |
| 536 | "Handle a right-button mouse click in Calc Keypad window." | 549 | "Handle a right-button mouse click in Calc Keypad window." |
diff --git a/lisp/calc/calc.el b/lisp/calc/calc.el index a7e840594ec..d8e6eb3017c 100644 --- a/lisp/calc/calc.el +++ b/lisp/calc/calc.el | |||
| @@ -890,7 +890,7 @@ If nil, selections displayed but ignored.") | |||
| 890 | calc-check-user-syntax calc-do-alg-entry calc-do-calc-eval | 890 | calc-check-user-syntax calc-do-alg-entry calc-do-calc-eval |
| 891 | calc-do-quick-calc calc-match-user-syntax math-build-parse-table | 891 | calc-do-quick-calc calc-match-user-syntax math-build-parse-table |
| 892 | math-find-user-tokens math-read-expr-list math-read-exprs math-read-if | 892 | math-find-user-tokens math-read-expr-list math-read-exprs math-read-if |
| 893 | math-read-token math-remove-dashes) | 893 | math-read-token math-remove-dashes math-read-preprocess-string) |
| 894 | 894 | ||
| 895 | ("calc-embed" calc-do-embedded-activate) | 895 | ("calc-embed" calc-do-embedded-activate) |
| 896 | 896 | ||
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el index 046c1bebcf7..5f3ffc6f8bf 100644 --- a/lisp/cus-edit.el +++ b/lisp/cus-edit.el | |||
| @@ -1561,9 +1561,9 @@ item in another window.\n\n")) | |||
| 1561 | :group 'custom-magic-faces) | 1561 | :group 'custom-magic-faces) |
| 1562 | 1562 | ||
| 1563 | (defface custom-set-face '((((class color)) | 1563 | (defface custom-set-face '((((class color)) |
| 1564 | (:foreground "blue" :background "white")) | 1564 | (:foreground "blue" :background "white")) |
| 1565 | (t | 1565 | (t |
| 1566 | (:slant italic))) | 1566 | (:slant italic))) |
| 1567 | "Face used when the customize item has been set." | 1567 | "Face used when the customize item has been set." |
| 1568 | :group 'custom-magic-faces) | 1568 | :group 'custom-magic-faces) |
| 1569 | 1569 | ||
| @@ -1578,31 +1578,32 @@ item in another window.\n\n")) | |||
| 1578 | "Face used when the customize item has been saved." | 1578 | "Face used when the customize item has been saved." |
| 1579 | :group 'custom-magic-faces) | 1579 | :group 'custom-magic-faces) |
| 1580 | 1580 | ||
| 1581 | (defconst custom-magic-alist '((nil "#" underline "\ | 1581 | (defconst custom-magic-alist |
| 1582 | '((nil "#" underline "\ | ||
| 1582 | uninitialized, you should not see this.") | 1583 | uninitialized, you should not see this.") |
| 1583 | (unknown "?" italic "\ | 1584 | (unknown "?" italic "\ |
| 1584 | unknown, you should not see this.") | 1585 | unknown, you should not see this.") |
| 1585 | (hidden "-" default "\ | 1586 | (hidden "-" default "\ |
| 1586 | hidden, invoke \"Show\" in the previous line to show." "\ | 1587 | hidden, invoke \"Show\" in the previous line to show." "\ |
| 1587 | group now hidden, invoke \"Show\", above, to show contents.") | 1588 | group now hidden, invoke \"Show\", above, to show contents.") |
| 1588 | (invalid "x" custom-invalid-face "\ | 1589 | (invalid "x" custom-invalid-face "\ |
| 1589 | the value displayed for this %c is invalid and cannot be set.") | 1590 | the value displayed for this %c is invalid and cannot be set.") |
| 1590 | (modified "*" custom-modified-face "\ | 1591 | (modified "*" custom-modified-face "\ |
| 1591 | you have edited the value as text, but you have not set the %c." "\ | 1592 | you have edited the value as text, but you have not set the %c." "\ |
| 1592 | you have edited something in this group, but not set it.") | 1593 | you have edited something in this group, but not set it.") |
| 1593 | (set "+" custom-set-face "\ | 1594 | (set "+" custom-set-face "\ |
| 1594 | you have set this %c, but not saved it for future sessions." "\ | 1595 | you have set this %c, but not saved it for future sessions." "\ |
| 1595 | something in this group has been set, but not saved.") | 1596 | something in this group has been set, but not saved.") |
| 1596 | (changed ":" custom-changed-face "\ | 1597 | (changed ":" custom-changed-face "\ |
| 1597 | this %c has been changed outside the customize buffer." "\ | 1598 | this %c has been changed outside the customize buffer." "\ |
| 1598 | something in this group has been changed outside customize.") | 1599 | something in this group has been changed outside customize.") |
| 1599 | (saved "!" custom-saved-face "\ | 1600 | (saved "!" custom-saved-face "\ |
| 1600 | this %c has been set and saved." "\ | 1601 | this %c has been set and saved." "\ |
| 1601 | something in this group has been set and saved.") | 1602 | something in this group has been set and saved.") |
| 1602 | (rogue "@" custom-rogue-face "\ | 1603 | (rogue "@" custom-rogue-face "\ |
| 1603 | this %c has not been changed with customize." "\ | 1604 | this %c has not been changed with customize." "\ |
| 1604 | something in this group is not prepared for customization.") | 1605 | something in this group is not prepared for customization.") |
| 1605 | (standard " " nil "\ | 1606 | (standard " " nil "\ |
| 1606 | this %c is unchanged from its standard setting." "\ | 1607 | this %c is unchanged from its standard setting." "\ |
| 1607 | visible group members are all at standard settings.")) | 1608 | visible group members are all at standard settings.")) |
| 1608 | "Alist of customize option states. | 1609 | "Alist of customize option states. |
| @@ -2576,7 +2577,7 @@ to switch between two values." | |||
| 2576 | "Edit face attributes." | 2577 | "Edit face attributes." |
| 2577 | :format "%t: %v" | 2578 | :format "%t: %v" |
| 2578 | :tag "Attributes" | 2579 | :tag "Attributes" |
| 2579 | :extra-offset 12 | 2580 | :extra-offset 13 |
| 2580 | :button-args '(:help-echo "Control whether this attribute has any effect.") | 2581 | :button-args '(:help-echo "Control whether this attribute has any effect.") |
| 2581 | :value-to-internal 'custom-face-edit-fix-value | 2582 | :value-to-internal 'custom-face-edit-fix-value |
| 2582 | :match (lambda (widget value) | 2583 | :match (lambda (widget value) |
| @@ -2689,6 +2690,7 @@ Also change :reverse-video to :inverse-video." | |||
| 2689 | :value t | 2690 | :value t |
| 2690 | :help-echo "Specify frames where the face attributes should be used." | 2691 | :help-echo "Specify frames where the face attributes should be used." |
| 2691 | :args '((const :tag "all" t) | 2692 | :args '((const :tag "all" t) |
| 2693 | (const :tag "defaults" default) | ||
| 2692 | (checklist | 2694 | (checklist |
| 2693 | :offset 0 | 2695 | :offset 0 |
| 2694 | :extra-offset 9 | 2696 | :extra-offset 9 |
| @@ -2817,13 +2819,29 @@ Only match frames that support the specified face attributes.") | |||
| 2817 | 2819 | ||
| 2818 | (define-widget 'custom-face-selected 'group | 2820 | (define-widget 'custom-face-selected 'group |
| 2819 | "Edit the attributes of the selected display in a face specification." | 2821 | "Edit the attributes of the selected display in a face specification." |
| 2820 | :args '((repeat :format "" | 2822 | :args '((choice :inline t |
| 2821 | :inline t | 2823 | (group :tag "With Defaults" :inline t |
| 2822 | (group custom-display-unselected sexp)) | 2824 | (group (const :tag "" default) |
| 2823 | (group (sexp :format "") custom-face-edit) | 2825 | (custom-face-edit :tag " Default\n Attributes")) |
| 2824 | (repeat :format "" | 2826 | (repeat :format "" |
| 2825 | :inline t | 2827 | :inline t |
| 2826 | sexp))) | 2828 | (group custom-display-unselected sexp)) |
| 2829 | (group (sexp :format "") | ||
| 2830 | (custom-face-edit :tag " Overriding\n Attributes")) | ||
| 2831 | (repeat :format "" | ||
| 2832 | :inline t | ||
| 2833 | sexp)) | ||
| 2834 | (group :tag "No Defaults" :inline t | ||
| 2835 | (repeat :format "" | ||
| 2836 | :inline t | ||
| 2837 | (group custom-display-unselected sexp)) | ||
| 2838 | (group (sexp :format "") | ||
| 2839 | (custom-face-edit :tag "\n Attributes")) | ||
| 2840 | (repeat :format "" | ||
| 2841 | :inline t | ||
| 2842 | sexp))))) | ||
| 2843 | |||
| 2844 | |||
| 2827 | 2845 | ||
| 2828 | (defconst custom-face-selected (widget-convert 'custom-face-selected) | 2846 | (defconst custom-face-selected (widget-convert 'custom-face-selected) |
| 2829 | "Converted version of the `custom-face-selected' widget.") | 2847 | "Converted version of the `custom-face-selected' widget.") |
diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el index cc2be890657..7b022e9f118 100644 --- a/lisp/emacs-lisp/checkdoc.el +++ b/lisp/emacs-lisp/checkdoc.el | |||
| @@ -919,7 +919,7 @@ is the starting location. If this is nil, `point-min' is used instead." | |||
| 919 | (progn | 919 | (progn |
| 920 | (goto-char wrong) | 920 | (goto-char wrong) |
| 921 | (if (not take-notes) | 921 | (if (not take-notes) |
| 922 | (error (checkdoc-error-text msg))))) | 922 | (error "%s" (checkdoc-error-text msg))))) |
| 923 | (checkdoc-show-diagnostics) | 923 | (checkdoc-show-diagnostics) |
| 924 | (if (interactive-p) | 924 | (if (interactive-p) |
| 925 | (message "No style warnings.")))) | 925 | (message "No style warnings.")))) |
| @@ -952,7 +952,7 @@ if there is one." | |||
| 952 | (e (checkdoc-file-comments-engine)) | 952 | (e (checkdoc-file-comments-engine)) |
| 953 | (checkdoc-generate-compile-warnings-flag | 953 | (checkdoc-generate-compile-warnings-flag |
| 954 | (or take-notes checkdoc-generate-compile-warnings-flag))) | 954 | (or take-notes checkdoc-generate-compile-warnings-flag))) |
| 955 | (if e (error (checkdoc-error-text e))) | 955 | (if e (error "%s" (checkdoc-error-text e))) |
| 956 | (checkdoc-show-diagnostics) | 956 | (checkdoc-show-diagnostics) |
| 957 | e)) | 957 | e)) |
| 958 | 958 | ||
| @@ -990,7 +990,7 @@ Optional argument TAKE-NOTES causes all errors to be logged." | |||
| 990 | (if (not (interactive-p)) | 990 | (if (not (interactive-p)) |
| 991 | e | 991 | e |
| 992 | (if e | 992 | (if e |
| 993 | (error (checkdoc-error-text e)) | 993 | (error "%s" (checkdoc-error-text e)) |
| 994 | (checkdoc-show-diagnostics))) | 994 | (checkdoc-show-diagnostics))) |
| 995 | (goto-char p)) | 995 | (goto-char p)) |
| 996 | (if (interactive-p) (message "Checking interactive message text...done."))) | 996 | (if (interactive-p) (message "Checking interactive message text...done."))) |
| @@ -1033,15 +1033,15 @@ space at the end of each line." | |||
| 1033 | (msg (checkdoc-this-string-valid))) | 1033 | (msg (checkdoc-this-string-valid))) |
| 1034 | (if msg (if no-error | 1034 | (if msg (if no-error |
| 1035 | (message (checkdoc-error-text msg)) | 1035 | (message (checkdoc-error-text msg)) |
| 1036 | (error (checkdoc-error-text msg))) | 1036 | (error "%s" (checkdoc-error-text msg))) |
| 1037 | (setq msg (checkdoc-message-text-search beg end)) | 1037 | (setq msg (checkdoc-message-text-search beg end)) |
| 1038 | (if msg (if no-error | 1038 | (if msg (if no-error |
| 1039 | (message (checkdoc-error-text msg)) | 1039 | (message (checkdoc-error-text msg)) |
| 1040 | (error (checkdoc-error-text msg))) | 1040 | (error "%s" (checkdoc-error-text msg))) |
| 1041 | (setq msg (checkdoc-rogue-space-check-engine beg end)) | 1041 | (setq msg (checkdoc-rogue-space-check-engine beg end)) |
| 1042 | (if msg (if no-error | 1042 | (if msg (if no-error |
| 1043 | (message (checkdoc-error-text msg)) | 1043 | (message (checkdoc-error-text msg)) |
| 1044 | (error (checkdoc-error-text msg)))))) | 1044 | (error "%s" (checkdoc-error-text msg)))))) |
| 1045 | (if (interactive-p) (message "Checkdoc: done.")))))) | 1045 | (if (interactive-p) (message "Checkdoc: done.")))))) |
| 1046 | 1046 | ||
| 1047 | ;;; Ispell interface for forcing a spell check | 1047 | ;;; Ispell interface for forcing a spell check |
diff --git a/lisp/emacs-lisp/elint.el b/lisp/emacs-lisp/elint.el index bf9c1d39f95..9454bfc9da3 100644 --- a/lisp/emacs-lisp/elint.el +++ b/lisp/emacs-lisp/elint.el | |||
| @@ -50,6 +50,85 @@ | |||
| 50 | "*The buffer to insert lint messages in.") | 50 | "*The buffer to insert lint messages in.") |
| 51 | 51 | ||
| 52 | ;;; | 52 | ;;; |
| 53 | ;;; Data | ||
| 54 | ;;; | ||
| 55 | |||
| 56 | (defconst elint-standard-variables | ||
| 57 | '(abbrev-mode auto-fill-function buffer-auto-save-file-name | ||
| 58 | buffer-backed-up buffer-display-count buffer-display-table buffer-display-time buffer-file-coding-system buffer-file-format | ||
| 59 | buffer-file-name buffer-file-number buffer-file-truename | ||
| 60 | buffer-file-type buffer-invisibility-spec buffer-offer-save | ||
| 61 | buffer-read-only buffer-saved-size buffer-undo-list | ||
| 62 | cache-long-line-scans case-fold-search ctl-arrow cursor-type comment-column | ||
| 63 | default-directory defun-prompt-regexp desktop-save-buffer enable-multibyte-characters fill-column fringes-outside-margins goal-column | ||
| 64 | header-line-format indicate-buffer-boundaries indicate-empty-lines | ||
| 65 | left-fringe-width | ||
| 66 | left-margin left-margin-width line-spacing local-abbrev-table local-write-file-hooks major-mode | ||
| 67 | mark-active mark-ring mode-line-buffer-identification | ||
| 68 | mode-line-format mode-line-modified mode-line-process mode-name | ||
| 69 | overwrite-mode | ||
| 70 | point-before-scroll right-fringe-width right-margin-width | ||
| 71 | scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display | ||
| 72 | selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar) | ||
| 73 | "Standard buffer local vars.") | ||
| 74 | |||
| 75 | (defconst elint-unknown-builtin-args | ||
| 76 | '((while test &rest forms) | ||
| 77 | (insert-before-markers-and-inherit &rest text) | ||
| 78 | (catch tag &rest body) | ||
| 79 | (and &rest args) | ||
| 80 | (funcall func &rest args) | ||
| 81 | (insert &rest args) | ||
| 82 | (vconcat &rest args) | ||
| 83 | (run-hook-with-args hook &rest args) | ||
| 84 | (message-or-box string &rest args) | ||
| 85 | (save-window-excursion &rest body) | ||
| 86 | (append &rest args) | ||
| 87 | (logior &rest args) | ||
| 88 | (progn &rest body) | ||
| 89 | (insert-and-inherit &rest args) | ||
| 90 | (message-box string &rest args) | ||
| 91 | (prog2 x y &rest body) | ||
| 92 | (prog1 first &rest body) | ||
| 93 | (insert-before-markers &rest args) | ||
| 94 | (call-process-region start end program &optional delete | ||
| 95 | destination display &rest args) | ||
| 96 | (concat &rest args) | ||
| 97 | (vector &rest args) | ||
| 98 | (run-hook-with-args-until-success hook &rest args) | ||
| 99 | (track-mouse &rest body) | ||
| 100 | (unwind-protect bodyform &rest unwindforms) | ||
| 101 | (save-restriction &rest body) | ||
| 102 | (quote arg) | ||
| 103 | (make-byte-code &rest args) | ||
| 104 | (or &rest args) | ||
| 105 | (cond &rest clauses) | ||
| 106 | (start-process name buffer program &rest args) | ||
| 107 | (run-hook-with-args-until-failure hook &rest args) | ||
| 108 | (if cond then &rest else) | ||
| 109 | (apply function &rest args) | ||
| 110 | (format string &rest args) | ||
| 111 | (encode-time second minute hour day month year zone &rest args) | ||
| 112 | (min &rest args) | ||
| 113 | (logand &rest args) | ||
| 114 | (logxor &rest args) | ||
| 115 | (max &rest args) | ||
| 116 | (list &rest args) | ||
| 117 | (message string &rest args) | ||
| 118 | (defvar symbol init doc) | ||
| 119 | (call-process program &optional infile destination display &rest args) | ||
| 120 | (with-output-to-temp-buffer bufname &rest body) | ||
| 121 | (nconc &rest args) | ||
| 122 | (save-excursion &rest body) | ||
| 123 | (run-hooks &rest hooks) | ||
| 124 | (/ x y &rest zs) | ||
| 125 | (- x &rest y) | ||
| 126 | (+ &rest args) | ||
| 127 | (* &rest args) | ||
| 128 | (interactive &optional args)) | ||
| 129 | "Those built-ins for which we can't find arguments.") | ||
| 130 | |||
| 131 | ;;; | ||
| 53 | ;;; ADT: top-form | 132 | ;;; ADT: top-form |
| 54 | ;;; | 133 | ;;; |
| 55 | 134 | ||
| @@ -724,85 +803,6 @@ If no documentation could be found args will be `unknown'." | |||
| 724 | (if list list | 803 | (if list list |
| 725 | (elint-find-builtins)))) | 804 | (elint-find-builtins)))) |
| 726 | 805 | ||
| 727 | ;;; | ||
| 728 | ;;; Data | ||
| 729 | ;;; | ||
| 730 | |||
| 731 | (defconst elint-standard-variables | ||
| 732 | '(abbrev-mode auto-fill-function buffer-auto-save-file-name | ||
| 733 | buffer-backed-up buffer-display-count buffer-display-table buffer-display-time buffer-file-coding-system buffer-file-format | ||
| 734 | buffer-file-name buffer-file-number buffer-file-truename | ||
| 735 | buffer-file-type buffer-invisibility-spec buffer-offer-save | ||
| 736 | buffer-read-only buffer-saved-size buffer-undo-list | ||
| 737 | cache-long-line-scans case-fold-search ctl-arrow cursor-type comment-column | ||
| 738 | default-directory defun-prompt-regexp desktop-save-buffer enable-multibyte-characters fill-column fringes-outside-margins goal-column | ||
| 739 | header-line-format indicate-buffer-boundaries indicate-empty-lines | ||
| 740 | left-fringe-width | ||
| 741 | left-margin left-margin-width line-spacing local-abbrev-table local-write-file-hooks major-mode | ||
| 742 | mark-active mark-ring mode-line-buffer-identification | ||
| 743 | mode-line-format mode-line-modified mode-line-process mode-name | ||
| 744 | overwrite-mode | ||
| 745 | point-before-scroll right-fringe-width right-margin-width | ||
| 746 | scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display | ||
| 747 | selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar) | ||
| 748 | "Standard buffer local vars.") | ||
| 749 | |||
| 750 | (defconst elint-unknown-builtin-args | ||
| 751 | '((while test &rest forms) | ||
| 752 | (insert-before-markers-and-inherit &rest text) | ||
| 753 | (catch tag &rest body) | ||
| 754 | (and &rest args) | ||
| 755 | (funcall func &rest args) | ||
| 756 | (insert &rest args) | ||
| 757 | (vconcat &rest args) | ||
| 758 | (run-hook-with-args hook &rest args) | ||
| 759 | (message-or-box string &rest args) | ||
| 760 | (save-window-excursion &rest body) | ||
| 761 | (append &rest args) | ||
| 762 | (logior &rest args) | ||
| 763 | (progn &rest body) | ||
| 764 | (insert-and-inherit &rest args) | ||
| 765 | (message-box string &rest args) | ||
| 766 | (prog2 x y &rest body) | ||
| 767 | (prog1 first &rest body) | ||
| 768 | (insert-before-markers &rest args) | ||
| 769 | (call-process-region start end program &optional delete | ||
| 770 | destination display &rest args) | ||
| 771 | (concat &rest args) | ||
| 772 | (vector &rest args) | ||
| 773 | (run-hook-with-args-until-success hook &rest args) | ||
| 774 | (track-mouse &rest body) | ||
| 775 | (unwind-protect bodyform &rest unwindforms) | ||
| 776 | (save-restriction &rest body) | ||
| 777 | (quote arg) | ||
| 778 | (make-byte-code &rest args) | ||
| 779 | (or &rest args) | ||
| 780 | (cond &rest clauses) | ||
| 781 | (start-process name buffer program &rest args) | ||
| 782 | (run-hook-with-args-until-failure hook &rest args) | ||
| 783 | (if cond then &rest else) | ||
| 784 | (apply function &rest args) | ||
| 785 | (format string &rest args) | ||
| 786 | (encode-time second minute hour day month year zone &rest args) | ||
| 787 | (min &rest args) | ||
| 788 | (logand &rest args) | ||
| 789 | (logxor &rest args) | ||
| 790 | (max &rest args) | ||
| 791 | (list &rest args) | ||
| 792 | (message string &rest args) | ||
| 793 | (defvar symbol init doc) | ||
| 794 | (call-process program &optional infile destination display &rest args) | ||
| 795 | (with-output-to-temp-buffer bufname &rest body) | ||
| 796 | (nconc &rest args) | ||
| 797 | (save-excursion &rest body) | ||
| 798 | (run-hooks &rest hooks) | ||
| 799 | (/ x y &rest zs) | ||
| 800 | (- x &rest y) | ||
| 801 | (+ &rest args) | ||
| 802 | (* &rest args) | ||
| 803 | (interactive &optional args)) | ||
| 804 | "Those built-ins for which we can't find arguments.") | ||
| 805 | |||
| 806 | (provide 'elint) | 806 | (provide 'elint) |
| 807 | 807 | ||
| 808 | ;;; arch-tag: b2f061e2-af84-4ddc-8e39-f5e969ac228f | 808 | ;;; arch-tag: b2f061e2-af84-4ddc-8e39-f5e969ac228f |
diff --git a/lisp/emacs-lisp/lisp.el b/lisp/emacs-lisp/lisp.el index 87b3fcff96c..090f793c700 100644 --- a/lisp/emacs-lisp/lisp.el +++ b/lisp/emacs-lisp/lisp.el | |||
| @@ -73,17 +73,18 @@ move forward across N balanced expressions." | |||
| 73 | "Set mark ARG sexps from point. | 73 | "Set mark ARG sexps from point. |
| 74 | The place mark goes is the same place \\[forward-sexp] would | 74 | The place mark goes is the same place \\[forward-sexp] would |
| 75 | move to with the same argument. | 75 | move to with the same argument. |
| 76 | If this command is repeated, it marks the next ARG sexps after the ones | 76 | If this command is repeated or mark is active in Transient Mark mode, |
| 77 | already marked." | 77 | it marks the next ARG sexps after the ones already marked." |
| 78 | (interactive "P") | 78 | (interactive "P") |
| 79 | (cond ((and (eq last-command this-command) (mark t)) | 79 | (cond ((or (and (eq last-command this-command) (mark t)) |
| 80 | (and transient-mark-mode mark-active)) | ||
| 80 | (setq arg (if arg (prefix-numeric-value arg) | 81 | (setq arg (if arg (prefix-numeric-value arg) |
| 81 | (if (> (mark) (point)) 1 -1))) | 82 | (if (< (mark) (point)) -1 1))) |
| 82 | (set-mark | 83 | (set-mark |
| 83 | (save-excursion | 84 | (save-excursion |
| 84 | (goto-char (mark)) | 85 | (goto-char (mark)) |
| 85 | (forward-sexp arg) | 86 | (forward-sexp arg) |
| 86 | (point)))) | 87 | (point)))) |
| 87 | (t | 88 | (t |
| 88 | (push-mark | 89 | (push-mark |
| 89 | (save-excursion | 90 | (save-excursion |
| @@ -191,9 +192,11 @@ open-parenthesis, and point ends up at the beginning of the line. | |||
| 191 | If variable `beginning-of-defun-function' is non-nil, its value | 192 | If variable `beginning-of-defun-function' is non-nil, its value |
| 192 | is called as a function to find the defun's beginning." | 193 | is called as a function to find the defun's beginning." |
| 193 | (interactive "p") | 194 | (interactive "p") |
| 194 | (and (eq this-command 'beginning-of-defun) | 195 | (or inhibit-mark-movement |
| 195 | (or inhibit-mark-movement (eq last-command 'beginning-of-defun) | 196 | (not (eq this-command 'beginning-of-defun)) |
| 196 | (push-mark))) | 197 | (eq last-command 'beginning-of-defun) |
| 198 | (and transient-mark-mode mark-active) | ||
| 199 | (push-mark)) | ||
| 197 | (and (beginning-of-defun-raw arg) | 200 | (and (beginning-of-defun-raw arg) |
| 198 | (progn (beginning-of-line) t))) | 201 | (progn (beginning-of-line) t))) |
| 199 | 202 | ||
| @@ -242,9 +245,11 @@ matches the open-parenthesis that starts a defun; see function | |||
| 242 | If variable `end-of-defun-function' is non-nil, its value | 245 | If variable `end-of-defun-function' is non-nil, its value |
| 243 | is called as a function to find the defun's end." | 246 | is called as a function to find the defun's end." |
| 244 | (interactive "p") | 247 | (interactive "p") |
| 245 | (and (eq this-command 'end-of-defun) | 248 | (or inhibit-mark-movement |
| 246 | (or inhibit-mark-movement (eq last-command 'end-of-defun) | 249 | (not (eq this-command 'end-of-defun)) |
| 247 | (push-mark))) | 250 | (eq last-command 'end-of-defun) |
| 251 | (and transient-mark-mode mark-active) | ||
| 252 | (push-mark)) | ||
| 248 | (if (or (null arg) (= arg 0)) (setq arg 1)) | 253 | (if (or (null arg) (= arg 0)) (setq arg 1)) |
| 249 | (if end-of-defun-function | 254 | (if end-of-defun-function |
| 250 | (if (> arg 0) | 255 | (if (> arg 0) |
| @@ -289,10 +294,11 @@ is called as a function to find the defun's end." | |||
| 289 | (defun mark-defun () | 294 | (defun mark-defun () |
| 290 | "Put mark at end of this defun, point at beginning. | 295 | "Put mark at end of this defun, point at beginning. |
| 291 | The defun marked is the one that contains point or follows point. | 296 | The defun marked is the one that contains point or follows point. |
| 292 | If this command is repeated, marks more defuns after the ones | 297 | If this command is repeated or mark is active in Transient Mark mode, |
| 293 | already marked." | 298 | it marks more defuns after the ones already marked." |
| 294 | (interactive) | 299 | (interactive) |
| 295 | (cond ((and (eq last-command this-command) (mark t)) | 300 | (cond ((or (and (eq last-command this-command) (mark t)) |
| 301 | (and transient-mark-mode mark-active)) | ||
| 296 | (set-mark | 302 | (set-mark |
| 297 | (save-excursion | 303 | (save-excursion |
| 298 | (goto-char (mark)) | 304 | (goto-char (mark)) |
diff --git a/lisp/faces.el b/lisp/faces.el index 35a2bd71399..5a7c119899d 100644 --- a/lisp/faces.el +++ b/lisp/faces.el | |||
| @@ -1335,21 +1335,29 @@ If SPEC is nil, return nil." | |||
| 1335 | (unless frame | 1335 | (unless frame |
| 1336 | (setq frame (selected-frame))) | 1336 | (setq frame (selected-frame))) |
| 1337 | (let ((tail spec) | 1337 | (let ((tail spec) |
| 1338 | result all) | 1338 | result defaults) |
| 1339 | (while tail | 1339 | (while tail |
| 1340 | (let* ((entry (pop tail)) | 1340 | (let* ((entry (pop tail)) |
| 1341 | (display (car entry)) | 1341 | (display (car entry)) |
| 1342 | (attrs (cdr entry))) | 1342 | (attrs (cdr entry)) |
| 1343 | (when (face-spec-set-match-display display frame) | 1343 | thisval) |
| 1344 | (setq result (if (null (cdr attrs)) ;; was (listp (car attrs)) | 1344 | ;; Get the attributes as actually specified by this alternative. |
| 1345 | ;; Old-style entry, the attribute list is the | 1345 | (setq thisval |
| 1346 | ;; first element. | 1346 | (if (null (cdr attrs)) ;; was (listp (car attrs)) |
| 1347 | (car attrs) | 1347 | ;; Old-style entry, the attribute list is the |
| 1348 | attrs)) | 1348 | ;; first element. |
| 1349 | (if (eq display t) | 1349 | (car attrs) |
| 1350 | (setq all result result nil) | 1350 | attrs)) |
| 1351 | |||
| 1352 | ;; If the condition is `default', that sets the default | ||
| 1353 | ;; for following conditions. | ||
| 1354 | (if (eq display 'default) | ||
| 1355 | (setq defaults thisval) | ||
| 1356 | ;; Otherwise, if it matches, use it. | ||
| 1357 | (when (face-spec-set-match-display display frame) | ||
| 1358 | (setq result thisval) | ||
| 1351 | (setq tail nil))))) | 1359 | (setq tail nil))))) |
| 1352 | (if all (append result all) result))) | 1360 | (if defaults (append result defaults) result))) |
| 1353 | 1361 | ||
| 1354 | 1362 | ||
| 1355 | (defun face-spec-reset-face (face &optional frame) | 1363 | (defun face-spec-reset-face (face &optional frame) |
| @@ -1787,7 +1795,7 @@ created." | |||
| 1787 | :group 'basic-faces) | 1795 | :group 'basic-faces) |
| 1788 | 1796 | ||
| 1789 | (defface mode-line-inactive | 1797 | (defface mode-line-inactive |
| 1790 | '((t | 1798 | '((default |
| 1791 | :inherit mode-line) | 1799 | :inherit mode-line) |
| 1792 | (((type x w32 mac) (background light) (class color)) | 1800 | (((type x w32 mac) (background light) (class color)) |
| 1793 | :weight light | 1801 | :weight light |
| @@ -1807,7 +1815,7 @@ created." | |||
| 1807 | (put 'modeline-inactive 'face-alias 'mode-line-inactive) | 1815 | (put 'modeline-inactive 'face-alias 'mode-line-inactive) |
| 1808 | 1816 | ||
| 1809 | (defface header-line | 1817 | (defface header-line |
| 1810 | '((t | 1818 | '((default |
| 1811 | :inherit mode-line) | 1819 | :inherit mode-line) |
| 1812 | (((type tty)) | 1820 | (((type tty)) |
| 1813 | ;; This used to be `:inverse-video t', but that doesn't look very | 1821 | ;; This used to be `:inverse-video t', but that doesn't look very |
| @@ -1843,7 +1851,7 @@ created." | |||
| 1843 | 1851 | ||
| 1844 | 1852 | ||
| 1845 | (defface tool-bar | 1853 | (defface tool-bar |
| 1846 | '((t | 1854 | '((default |
| 1847 | :box (:line-width 1 :style released-button) | 1855 | :box (:line-width 1 :style released-button) |
| 1848 | :foreground "black") | 1856 | :foreground "black") |
| 1849 | (((type x w32 mac) (class color)) | 1857 | (((type x w32 mac) (class color)) |
| @@ -2022,32 +2030,11 @@ Note: Other faces cannot inherit from the cursor face." | |||
| 2022 | :group 'font-lock ; like `show-trailing-whitespace' | 2030 | :group 'font-lock ; like `show-trailing-whitespace' |
| 2023 | :group 'basic-faces) | 2031 | :group 'basic-faces) |
| 2024 | 2032 | ||
| 2025 | 2033 | (defface escape-glyph '((((background dark)) :foreground "cyan") | |
| 2026 | ;; Make escape characters stand out in display | 2034 | (((type pc)) :foreground "magenta") |
| 2027 | 2035 | (t :foreground "dark blue")) | |
| 2028 | (defface escape-glyph | 2036 | "Face for displaying \\ and ^ in multichar glyphs." |
| 2029 | '((t :inherit secondary-selection)) | ||
| 2030 | "Basic face for displaying \\ and ^ in multichar glyphs. | ||
| 2031 | It is also used for ... in ellipses." | ||
| 2032 | :group 'basic-faces) | 2037 | :group 'basic-faces) |
| 2033 | |||
| 2034 | (put 'display-table 'char-table-extra-slots 6) | ||
| 2035 | |||
| 2036 | (or standard-display-table | ||
| 2037 | ;; avoid using autoloaded make-display-table here | ||
| 2038 | (setq standard-display-table (make-char-table 'display-table nil))) | ||
| 2039 | |||
| 2040 | (let* ((face (lsh (face-id 'escape-glyph) 19)) | ||
| 2041 | (backslash (+ face ?\\)) | ||
| 2042 | (dot (+ face ?.))) | ||
| 2043 | (set-char-table-extra-slot standard-display-table 2 backslash) | ||
| 2044 | (aset standard-display-table 2208 (vector backslash ?\s)) | ||
| 2045 | (aset standard-display-table 2221 (vector backslash ?-)) | ||
| 2046 | (set-char-table-extra-slot standard-display-table 3 (+ face ?^)) | ||
| 2047 | (set-char-table-extra-slot standard-display-table 4 (vector dot dot dot))) | ||
| 2048 | |||
| 2049 | |||
| 2050 | |||
| 2051 | 2038 | ||
| 2052 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 2039 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 2053 | ;;; Manipulating font names. | 2040 | ;;; Manipulating font names. |
diff --git a/lisp/ffap.el b/lisp/ffap.el index dc78bd355be..ab9d223256f 100644 --- a/lisp/ffap.el +++ b/lisp/ffap.el | |||
| @@ -42,10 +42,21 @@ | |||
| 42 | ;; | 42 | ;; |
| 43 | ;; ffap-bindings makes the following global key bindings: | 43 | ;; ffap-bindings makes the following global key bindings: |
| 44 | ;; | 44 | ;; |
| 45 | ;; C-x C-f find-file-at-point (abbreviated as ffap) | 45 | ;; C-x C-f find-file-at-point (abbreviated as ffap) |
| 46 | ;; C-x d dired-at-point | 46 | ;; C-x C-r ffap-read-only |
| 47 | ;; C-x 4 f ffap-other-window | 47 | ;; C-x C-v ffap-alternate-file |
| 48 | ;; C-x 5 f ffap-other-frame | 48 | ;; |
| 49 | ;; C-x d dired-at-point | ||
| 50 | ;; C-x C-d ffap-list-directory | ||
| 51 | ;; | ||
| 52 | ;; C-x 4 f ffap-other-window | ||
| 53 | ;; C-x 4 r ffap-read-only-other-window | ||
| 54 | ;; C-x 4 d ffap-dired-other-window | ||
| 55 | ;; | ||
| 56 | ;; C-x 5 f ffap-other-frame | ||
| 57 | ;; C-x 5 r ffap-read-only-other-frame | ||
| 58 | ;; C-x 5 d ffap-dired-other-frame | ||
| 59 | ;; | ||
| 49 | ;; S-mouse-3 ffap-at-mouse | 60 | ;; S-mouse-3 ffap-at-mouse |
| 50 | ;; C-S-mouse-3 ffap-menu | 61 | ;; C-S-mouse-3 ffap-menu |
| 51 | ;; | 62 | ;; |
| @@ -202,13 +213,17 @@ Sensible values are nil, \"news\", or \"mailto\"." | |||
| 202 | ;; through this section for features that you like, put an appropriate | 213 | ;; through this section for features that you like, put an appropriate |
| 203 | ;; enabler in your .emacs file. | 214 | ;; enabler in your .emacs file. |
| 204 | 215 | ||
| 205 | (defcustom ffap-dired-wildcards nil | 216 | (defcustom ffap-dired-wildcards "[*?][^/]*\\'" |
| 206 | ;; Suggestion from RHOGEE, 07 Jul 1994. Disabled, dired is still | ||
| 207 | ;; available by "C-x C-d <pattern>", and valid filenames may | ||
| 208 | ;; sometimes contain wildcard characters. | ||
| 209 | "*A regexp matching filename wildcard characters, or nil. | 217 | "*A regexp matching filename wildcard characters, or nil. |
| 218 | |||
| 210 | If `find-file-at-point' gets a filename matching this pattern, | 219 | If `find-file-at-point' gets a filename matching this pattern, |
| 211 | it passes it on to `dired' instead of `find-file'." | 220 | it passes it on to `find-file' with non-nil WILDCARDS argument, |
| 221 | which expands wildcards and visits multiple files. To visit | ||
| 222 | a file whose name contains wildcard characters you can suppress | ||
| 223 | wildcard expansion by setting `find-file-wildcards'. | ||
| 224 | |||
| 225 | If `dired-at-point' gets a filename matching this pattern, | ||
| 226 | it passes it on to `dired'." | ||
| 212 | :type '(choice (const :tag "Disable" nil) | 227 | :type '(choice (const :tag "Disable" nil) |
| 213 | (const :tag "Enable" "[*?][^/]*\\'") | 228 | (const :tag "Enable" "[*?][^/]*\\'") |
| 214 | ;; regexp -- probably not useful | 229 | ;; regexp -- probably not useful |
| @@ -236,6 +251,12 @@ ffap most of the time." | |||
| 236 | :group 'ffap) | 251 | :group 'ffap) |
| 237 | (put 'ffap-file-finder 'risky-local-variable t) | 252 | (put 'ffap-file-finder 'risky-local-variable t) |
| 238 | 253 | ||
| 254 | (defcustom ffap-directory-finder 'dired | ||
| 255 | "*The command called by `dired-at-point' to find a directory." | ||
| 256 | :type 'function | ||
| 257 | :group 'ffap) | ||
| 258 | (put 'ffap-directory-finder 'risky-local-variable t) | ||
| 259 | |||
| 239 | (defcustom ffap-url-fetcher | 260 | (defcustom ffap-url-fetcher |
| 240 | (if (fboundp 'browse-url) | 261 | (if (fboundp 'browse-url) |
| 241 | 'browse-url ; rely on browse-url-browser-function | 262 | 'browse-url ; rely on browse-url-browser-function |
| @@ -939,7 +960,7 @@ If t, `ffap-tex-init' will initialize this when needed.") | |||
| 939 | ;; Slightly controversial decisions: | 960 | ;; Slightly controversial decisions: |
| 940 | ;; * strip trailing "@" and ":" | 961 | ;; * strip trailing "@" and ":" |
| 941 | ;; * no commas (good for latex) | 962 | ;; * no commas (good for latex) |
| 942 | (file "--:$+<>@-Z_a-z~" "<@" "@>;.,!?:") | 963 | (file "--:$+<>@-Z_a-z~*?" "<@" "@>;.,!:") |
| 943 | ;; An url, or maybe a email/news message-id: | 964 | ;; An url, or maybe a email/news message-id: |
| 944 | (url "--:=&?$+@-Z_a-z~#,%;" "^A-Za-z0-9" ":;.,!?") | 965 | (url "--:=&?$+@-Z_a-z~#,%;" "^A-Za-z0-9" ":;.,!?") |
| 945 | ;; Find a string that does *not* contain a colon: | 966 | ;; Find a string that does *not* contain a colon: |
| @@ -1120,8 +1141,8 @@ which may actually result in an url rather than a filename." | |||
| 1120 | (default-directory default-directory)) | 1141 | (default-directory default-directory)) |
| 1121 | (unwind-protect | 1142 | (unwind-protect |
| 1122 | (cond | 1143 | (cond |
| 1123 | ;; Immediate rejects (/ and // are too common in C++): | 1144 | ;; Immediate rejects (/ and // and /* are too common in C/C++): |
| 1124 | ((member name '("" "/" "//" ".")) nil) | 1145 | ((member name '("" "/" "//" "/*" ".")) nil) |
| 1125 | ;; Immediately test local filenames. If default-directory is | 1146 | ;; Immediately test local filenames. If default-directory is |
| 1126 | ;; remote, you probably already have a connection. | 1147 | ;; remote, you probably already have a connection. |
| 1127 | ((and (not abs) (ffap-file-exists-string name))) | 1148 | ((and (not abs) (ffap-file-exists-string name))) |
| @@ -1187,6 +1208,12 @@ which may actually result in an url rather than a filename." | |||
| 1187 | remote-dir (substring name (match-end 1))))) | 1208 | remote-dir (substring name (match-end 1))))) |
| 1188 | (ffap-file-exists-string | 1209 | (ffap-file-exists-string |
| 1189 | (ffap-replace-file-component remote-dir name)))))) | 1210 | (ffap-replace-file-component remote-dir name)))))) |
| 1211 | ((and ffap-dired-wildcards | ||
| 1212 | (string-match ffap-dired-wildcards name) | ||
| 1213 | abs | ||
| 1214 | (ffap-file-exists-string (file-name-directory | ||
| 1215 | (directory-file-name name))) | ||
| 1216 | name)) | ||
| 1190 | ;; Try all parent directories by deleting the trailing directory | 1217 | ;; Try all parent directories by deleting the trailing directory |
| 1191 | ;; name until existing directory is found or name stops changing | 1218 | ;; name until existing directory is found or name stops changing |
| 1192 | ((let ((dir name)) | 1219 | ((let ((dir name)) |
| @@ -1227,7 +1254,9 @@ which may actually result in an url rather than a filename." | |||
| 1227 | dir | 1254 | dir |
| 1228 | nil | 1255 | nil |
| 1229 | (if dir (cons guess (length dir)) guess) | 1256 | (if dir (cons guess (length dir)) guess) |
| 1230 | (list 'file-name-history)))) | 1257 | (list 'file-name-history) |
| 1258 | (and buffer-file-name | ||
| 1259 | (abbreviate-file-name buffer-file-name))))) | ||
| 1231 | ;; Do file substitution like (interactive "F"), suggested by MCOOK. | 1260 | ;; Do file substitution like (interactive "F"), suggested by MCOOK. |
| 1232 | (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess))) | 1261 | (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess))) |
| 1233 | ;; Should not do it on url's, where $ is a common (VMS?) character. | 1262 | ;; Should not do it on url's, where $ is a common (VMS?) character. |
| @@ -1357,10 +1386,12 @@ See <ftp://ftp.mathcs.emory.edu/pub/mic/emacs/> for latest version." | |||
| 1357 | ((ffap-url-p filename) | 1386 | ((ffap-url-p filename) |
| 1358 | (let (current-prefix-arg) ; w3 2.3.25 bug, reported by KPC | 1387 | (let (current-prefix-arg) ; w3 2.3.25 bug, reported by KPC |
| 1359 | (funcall ffap-url-fetcher filename))) | 1388 | (funcall ffap-url-fetcher filename))) |
| 1360 | ;; This junk more properly belongs in a modified ffap-file-finder: | ||
| 1361 | ((and ffap-dired-wildcards | 1389 | ((and ffap-dired-wildcards |
| 1362 | (string-match ffap-dired-wildcards filename)) | 1390 | (string-match ffap-dired-wildcards filename) |
| 1363 | (dired filename)) | 1391 | find-file-wildcards |
| 1392 | ;; Check if it's find-file that supports wildcards arg | ||
| 1393 | (memq ffap-file-finder '(find-file find-alternate-file))) | ||
| 1394 | (funcall ffap-file-finder (expand-file-name filename) t)) | ||
| 1364 | ((or (not ffap-newfile-prompt) | 1395 | ((or (not ffap-newfile-prompt) |
| 1365 | (file-exists-p filename) | 1396 | (file-exists-p filename) |
| 1366 | (y-or-n-p "File does not exist, create buffer? ")) | 1397 | (y-or-n-p "File does not exist, create buffer? ")) |
| @@ -1556,9 +1587,7 @@ Return value: | |||
| 1556 | ))) | 1587 | ))) |
| 1557 | 1588 | ||
| 1558 | 1589 | ||
| 1559 | ;;; ffap-other-* commands: | 1590 | ;;; ffap-other-*, ffap-read-only-*, ffap-alternate-* commands: |
| 1560 | ;; | ||
| 1561 | ;; Requested by KPC. | ||
| 1562 | 1591 | ||
| 1563 | ;; There could be a real `ffap-noselect' function, but we would need | 1592 | ;; There could be a real `ffap-noselect' function, but we would need |
| 1564 | ;; at least two new user variables, and there is no w3-fetch-noselect. | 1593 | ;; at least two new user variables, and there is no w3-fetch-noselect. |
| @@ -1568,23 +1597,70 @@ Return value: | |||
| 1568 | "Like `ffap', but put buffer in another window. | 1597 | "Like `ffap', but put buffer in another window. |
| 1569 | Only intended for interactive use." | 1598 | Only intended for interactive use." |
| 1570 | (interactive) | 1599 | (interactive) |
| 1571 | (switch-to-buffer-other-window | 1600 | (let (value) |
| 1572 | (save-window-excursion (call-interactively 'ffap) (current-buffer)))) | 1601 | (switch-to-buffer-other-window |
| 1602 | (save-window-excursion | ||
| 1603 | (setq value (call-interactively 'ffap)) | ||
| 1604 | (unless (or (bufferp value) (bufferp (car-safe value))) | ||
| 1605 | (setq value (current-buffer))) | ||
| 1606 | (current-buffer))) | ||
| 1607 | value)) | ||
| 1573 | 1608 | ||
| 1574 | (defun ffap-other-frame nil | 1609 | (defun ffap-other-frame nil |
| 1575 | "Like `ffap', but put buffer in another frame. | 1610 | "Like `ffap', but put buffer in another frame. |
| 1576 | Only intended for interactive use." | 1611 | Only intended for interactive use." |
| 1577 | (interactive) | 1612 | (interactive) |
| 1578 | ;; Extra code works around dedicated windows (noted by JENS, 7/96): | 1613 | ;; Extra code works around dedicated windows (noted by JENS, 7/96): |
| 1579 | (let* ((win (selected-window)) (wdp (window-dedicated-p win))) | 1614 | (let* ((win (selected-window)) |
| 1615 | (wdp (window-dedicated-p win)) | ||
| 1616 | value) | ||
| 1580 | (unwind-protect | 1617 | (unwind-protect |
| 1581 | (progn | 1618 | (progn |
| 1582 | (set-window-dedicated-p win nil) | 1619 | (set-window-dedicated-p win nil) |
| 1583 | (switch-to-buffer-other-frame | 1620 | (switch-to-buffer-other-frame |
| 1584 | (save-window-excursion | 1621 | (save-window-excursion |
| 1585 | (call-interactively 'ffap) | 1622 | (setq value (call-interactively 'ffap)) |
| 1623 | (unless (or (bufferp value) (bufferp (car-safe value))) | ||
| 1624 | (setq value (current-buffer))) | ||
| 1586 | (current-buffer)))) | 1625 | (current-buffer)))) |
| 1587 | (set-window-dedicated-p win wdp)))) | 1626 | (set-window-dedicated-p win wdp)) |
| 1627 | value)) | ||
| 1628 | |||
| 1629 | (defun ffap-read-only () | ||
| 1630 | "Like `ffap', but mark buffer as read-only. | ||
| 1631 | Only intended for interactive use." | ||
| 1632 | (interactive) | ||
| 1633 | (let ((value (call-interactively 'ffap))) | ||
| 1634 | (unless (or (bufferp value) (bufferp (car-safe value))) | ||
| 1635 | (setq value (current-buffer))) | ||
| 1636 | (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1))) | ||
| 1637 | (if (listp value) value (list value))) | ||
| 1638 | value)) | ||
| 1639 | |||
| 1640 | (defun ffap-read-only-other-window () | ||
| 1641 | "Like `ffap', but put buffer in another window and mark as read-only. | ||
| 1642 | Only intended for interactive use." | ||
| 1643 | (interactive) | ||
| 1644 | (let ((value (ffap-other-window))) | ||
| 1645 | (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1))) | ||
| 1646 | (if (listp value) value (list value))) | ||
| 1647 | value)) | ||
| 1648 | |||
| 1649 | (defun ffap-read-only-other-frame () | ||
| 1650 | "Like `ffap', but put buffer in another frame and mark as read-only. | ||
| 1651 | Only intended for interactive use." | ||
| 1652 | (interactive) | ||
| 1653 | (let ((value (ffap-other-frame))) | ||
| 1654 | (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1))) | ||
| 1655 | (if (listp value) value (list value))) | ||
| 1656 | value)) | ||
| 1657 | |||
| 1658 | (defun ffap-alternate-file () | ||
| 1659 | "Like `ffap' and `find-alternate-file'. | ||
| 1660 | Only intended for interactive use." | ||
| 1661 | (interactive) | ||
| 1662 | (let ((ffap-file-finder 'find-alternate-file)) | ||
| 1663 | (call-interactively 'ffap))) | ||
| 1588 | 1664 | ||
| 1589 | 1665 | ||
| 1590 | ;;; Bug Reporter: | 1666 | ;;; Bug Reporter: |
| @@ -1665,24 +1741,26 @@ ffap most of the time." | |||
| 1665 | (not current-prefix-arg) | 1741 | (not current-prefix-arg) |
| 1666 | current-prefix-arg)) | 1742 | current-prefix-arg)) |
| 1667 | (let (current-prefix-arg) ; already interpreted | 1743 | (let (current-prefix-arg) ; already interpreted |
| 1668 | (call-interactively 'dired)) | 1744 | (call-interactively ffap-directory-finder)) |
| 1669 | (or filename (setq filename (dired-at-point-prompter))) | 1745 | (or filename (setq filename (dired-at-point-prompter))) |
| 1670 | (cond | 1746 | (cond |
| 1671 | ((ffap-url-p filename) | 1747 | ((ffap-url-p filename) |
| 1672 | (funcall ffap-url-fetcher filename)) | 1748 | (funcall ffap-url-fetcher filename)) |
| 1673 | ((and ffap-dired-wildcards | 1749 | ((and ffap-dired-wildcards |
| 1674 | (string-match ffap-dired-wildcards filename)) | 1750 | (string-match ffap-dired-wildcards filename)) |
| 1675 | (dired filename)) | 1751 | (funcall ffap-directory-finder filename)) |
| 1676 | ((file-exists-p filename) | 1752 | ((file-exists-p filename) |
| 1677 | (if (file-directory-p filename) | 1753 | (if (file-directory-p filename) |
| 1678 | (dired (expand-file-name filename)) | 1754 | (funcall ffap-directory-finder |
| 1679 | (dired (concat (expand-file-name filename) "*")))) | 1755 | (expand-file-name filename)) |
| 1756 | (funcall ffap-directory-finder | ||
| 1757 | (concat (expand-file-name filename) "*")))) | ||
| 1680 | ((and (file-writable-p | 1758 | ((and (file-writable-p |
| 1681 | (or (file-name-directory (directory-file-name filename)) | 1759 | (or (file-name-directory (directory-file-name filename)) |
| 1682 | filename)) | 1760 | filename)) |
| 1683 | (y-or-n-p "Directory does not exist, create it? ")) | 1761 | (y-or-n-p "Directory does not exist, create it? ")) |
| 1684 | (make-directory filename) | 1762 | (make-directory filename) |
| 1685 | (dired filename)) | 1763 | (funcall ffap-directory-finder filename)) |
| 1686 | ((error "No such file or directory `%s'" filename))))) | 1764 | ((error "No such file or directory `%s'" filename))))) |
| 1687 | 1765 | ||
| 1688 | (defun dired-at-point-prompter (&optional guess) | 1766 | (defun dired-at-point-prompter (&optional guess) |
| @@ -1712,16 +1790,66 @@ ffap most of the time." | |||
| 1712 | (and guess (ffap-highlight)))) | 1790 | (and guess (ffap-highlight)))) |
| 1713 | (ffap-highlight t))) | 1791 | (ffap-highlight t))) |
| 1714 | 1792 | ||
| 1793 | ;;; ffap-dired-other-*, ffap-list-directory commands: | ||
| 1794 | |||
| 1795 | (defun ffap-dired-other-window () | ||
| 1796 | "Like `dired-at-point', but put buffer in another window. | ||
| 1797 | Only intended for interactive use." | ||
| 1798 | (interactive) | ||
| 1799 | (let (value) | ||
| 1800 | (switch-to-buffer-other-window | ||
| 1801 | (save-window-excursion | ||
| 1802 | (setq value (call-interactively 'dired-at-point)) | ||
| 1803 | (current-buffer))) | ||
| 1804 | value)) | ||
| 1805 | |||
| 1806 | (defun ffap-dired-other-frame () | ||
| 1807 | "Like `dired-at-point', but put buffer in another frame. | ||
| 1808 | Only intended for interactive use." | ||
| 1809 | (interactive) | ||
| 1810 | ;; Extra code works around dedicated windows (noted by JENS, 7/96): | ||
| 1811 | (let* ((win (selected-window)) | ||
| 1812 | (wdp (window-dedicated-p win)) | ||
| 1813 | value) | ||
| 1814 | (unwind-protect | ||
| 1815 | (progn | ||
| 1816 | (set-window-dedicated-p win nil) | ||
| 1817 | (switch-to-buffer-other-frame | ||
| 1818 | (save-window-excursion | ||
| 1819 | (setq value (call-interactively 'dired-at-point)) | ||
| 1820 | (current-buffer)))) | ||
| 1821 | (set-window-dedicated-p win wdp)) | ||
| 1822 | value)) | ||
| 1823 | |||
| 1824 | (defun ffap-list-directory () | ||
| 1825 | "Like `dired-at-point' and `list-directory'. | ||
| 1826 | Only intended for interactive use." | ||
| 1827 | (interactive) | ||
| 1828 | (let ((ffap-directory-finder 'list-directory)) | ||
| 1829 | (call-interactively 'dired-at-point))) | ||
| 1830 | |||
| 1831 | |||
| 1715 | ;;; Offer default global bindings (`ffap-bindings'): | 1832 | ;;; Offer default global bindings (`ffap-bindings'): |
| 1716 | 1833 | ||
| 1717 | (defvar ffap-bindings | 1834 | (defvar ffap-bindings |
| 1718 | '( | 1835 | '( |
| 1719 | (global-set-key [S-mouse-3] 'ffap-at-mouse) | 1836 | (global-set-key [S-mouse-3] 'ffap-at-mouse) |
| 1720 | (global-set-key [C-S-mouse-3] 'ffap-menu) | 1837 | (global-set-key [C-S-mouse-3] 'ffap-menu) |
| 1838 | |||
| 1721 | (global-set-key "\C-x\C-f" 'find-file-at-point) | 1839 | (global-set-key "\C-x\C-f" 'find-file-at-point) |
| 1840 | (global-set-key "\C-x\C-r" 'ffap-read-only) | ||
| 1841 | (global-set-key "\C-x\C-v" 'ffap-alternate-file) | ||
| 1842 | |||
| 1722 | (global-set-key "\C-x4f" 'ffap-other-window) | 1843 | (global-set-key "\C-x4f" 'ffap-other-window) |
| 1723 | (global-set-key "\C-x5f" 'ffap-other-frame) | 1844 | (global-set-key "\C-x5f" 'ffap-other-frame) |
| 1845 | (global-set-key "\C-x4r" 'ffap-read-only-other-window) | ||
| 1846 | (global-set-key "\C-x5r" 'ffap-read-only-other-frame) | ||
| 1847 | |||
| 1724 | (global-set-key "\C-xd" 'dired-at-point) | 1848 | (global-set-key "\C-xd" 'dired-at-point) |
| 1849 | (global-set-key "\C-x4d" 'ffap-dired-other-window) | ||
| 1850 | (global-set-key "\C-x5d" 'ffap-dired-other-frame) | ||
| 1851 | (global-set-key "\C-x\C-d" 'ffap-list-directory) | ||
| 1852 | |||
| 1725 | (add-hook 'gnus-summary-mode-hook 'ffap-gnus-hook) | 1853 | (add-hook 'gnus-summary-mode-hook 'ffap-gnus-hook) |
| 1726 | (add-hook 'gnus-article-mode-hook 'ffap-gnus-hook) | 1854 | (add-hook 'gnus-article-mode-hook 'ffap-gnus-hook) |
| 1727 | (add-hook 'vm-mode-hook 'ffap-ro-mode-hook) | 1855 | (add-hook 'vm-mode-hook 'ffap-ro-mode-hook) |
diff --git a/lisp/filecache.el b/lisp/filecache.el index bd0b0f77781..90287ba5eef 100644 --- a/lisp/filecache.el +++ b/lisp/filecache.el | |||
| @@ -337,21 +337,20 @@ in each directory, not to the directory list itself." | |||
| 337 | Find is run in DIRECTORY." | 337 | Find is run in DIRECTORY." |
| 338 | (interactive "DAdd files under directory: ") | 338 | (interactive "DAdd files under directory: ") |
| 339 | (let ((dir (expand-file-name directory))) | 339 | (let ((dir (expand-file-name directory))) |
| 340 | (if (eq file-cache-find-command-posix-flag 'not-defined) | 340 | (when (memq system-type '(windows-nt cygwin)) |
| 341 | (setq file-cache-find-command-posix-flag | 341 | (if (eq file-cache-find-command-posix-flag 'not-defined) |
| 342 | (executable-command-find-posix-p file-cache-find-command))) | 342 | (setq file-cache-find-command-posix-flag |
| 343 | (executable-command-find-posix-p file-cache-find-command)))) | ||
| 343 | (set-buffer (get-buffer-create file-cache-buffer)) | 344 | (set-buffer (get-buffer-create file-cache-buffer)) |
| 344 | (erase-buffer) | 345 | (erase-buffer) |
| 345 | (call-process file-cache-find-command nil | 346 | (call-process file-cache-find-command nil |
| 346 | (get-buffer file-cache-buffer) nil | 347 | (get-buffer file-cache-buffer) nil |
| 347 | dir "-name" | 348 | dir "-name" |
| 348 | (cond | 349 | (if (memq system-type '(windows-nt cygwin)) |
| 349 | (file-cache-find-command-posix-flag | 350 | (if file-cache-find-command-posix-flag |
| 350 | "\\*") | 351 | "\\*" |
| 351 | ((eq system-type 'windows-nt) | 352 | "'*'") |
| 352 | "'*'") | 353 | "*") |
| 353 | (t | ||
| 354 | "*")) | ||
| 355 | "-print") | 354 | "-print") |
| 356 | (file-cache-add-from-file-cache-buffer))) | 355 | (file-cache-add-from-file-cache-buffer))) |
| 357 | 356 | ||
diff --git a/lisp/files.el b/lisp/files.el index b1cd0fbf8d0..48c7c9a7489 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -932,8 +932,7 @@ suppress wildcard expansion by setting `find-file-wildcards'. | |||
| 932 | 932 | ||
| 933 | To visit a file without any kind of conversion and without | 933 | To visit a file without any kind of conversion and without |
| 934 | automatically choosing a major mode, use \\[find-file-literally]." | 934 | automatically choosing a major mode, use \\[find-file-literally]." |
| 935 | (interactive | 935 | (interactive (find-file-read-args "Find file: " nil)) |
| 936 | (find-file-read-args "Find file: " nil)) | ||
| 937 | (let ((value (find-file-noselect filename nil nil wildcards))) | 936 | (let ((value (find-file-noselect filename nil nil wildcards))) |
| 938 | (if (listp value) | 937 | (if (listp value) |
| 939 | (mapcar 'switch-to-buffer (nreverse value)) | 938 | (mapcar 'switch-to-buffer (nreverse value)) |
| @@ -955,8 +954,8 @@ expand wildcards (if any) and visit multiple files." | |||
| 955 | (if (listp value) | 954 | (if (listp value) |
| 956 | (progn | 955 | (progn |
| 957 | (setq value (nreverse value)) | 956 | (setq value (nreverse value)) |
| 958 | (switch-to-buffer-other-window (car value)) | 957 | (cons (switch-to-buffer-other-window (car value)) |
| 959 | (mapcar 'switch-to-buffer (cdr value))) | 958 | (mapcar 'switch-to-buffer (cdr value)))) |
| 960 | (switch-to-buffer-other-window value)))) | 959 | (switch-to-buffer-other-window value)))) |
| 961 | 960 | ||
| 962 | (defun find-file-other-frame (filename &optional wildcards) | 961 | (defun find-file-other-frame (filename &optional wildcards) |
| @@ -975,8 +974,8 @@ expand wildcards (if any) and visit multiple files." | |||
| 975 | (if (listp value) | 974 | (if (listp value) |
| 976 | (progn | 975 | (progn |
| 977 | (setq value (nreverse value)) | 976 | (setq value (nreverse value)) |
| 978 | (switch-to-buffer-other-frame (car value)) | 977 | (cons (switch-to-buffer-other-frame (car value)) |
| 979 | (mapcar 'switch-to-buffer (cdr value))) | 978 | (mapcar 'switch-to-buffer (cdr value)))) |
| 980 | (switch-to-buffer-other-frame value)))) | 979 | (switch-to-buffer-other-frame value)))) |
| 981 | 980 | ||
| 982 | (defun find-file-existing (filename &optional wildcards) | 981 | (defun find-file-existing (filename &optional wildcards) |
| @@ -991,35 +990,53 @@ Like \\[find-file] but only allow files that exists." | |||
| 991 | "Edit file FILENAME but don't allow changes. | 990 | "Edit file FILENAME but don't allow changes. |
| 992 | Like \\[find-file] but marks buffer as read-only. | 991 | Like \\[find-file] but marks buffer as read-only. |
| 993 | Use \\[toggle-read-only] to permit editing." | 992 | Use \\[toggle-read-only] to permit editing." |
| 994 | (interactive (find-file-read-args "Find file read-only: " t)) | 993 | (interactive (find-file-read-args "Find file read-only: " nil)) |
| 995 | (unless (file-exists-p filename) (error "%s does not exist" filename)) | 994 | (unless (or (and wildcards find-file-wildcards |
| 996 | (find-file filename wildcards) | 995 | (not (string-match "\\`/:" filename)) |
| 997 | (toggle-read-only 1) | 996 | (string-match "[[*?]" filename)) |
| 998 | (current-buffer)) | 997 | (file-exists-p filename)) |
| 998 | (error "%s does not exist" filename)) | ||
| 999 | (let ((value (find-file filename wildcards))) | ||
| 1000 | (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1))) | ||
| 1001 | (if (listp value) value (list value))) | ||
| 1002 | value)) | ||
| 999 | 1003 | ||
| 1000 | (defun find-file-read-only-other-window (filename &optional wildcards) | 1004 | (defun find-file-read-only-other-window (filename &optional wildcards) |
| 1001 | "Edit file FILENAME in another window but don't allow changes. | 1005 | "Edit file FILENAME in another window but don't allow changes. |
| 1002 | Like \\[find-file-other-window] but marks buffer as read-only. | 1006 | Like \\[find-file-other-window] but marks buffer as read-only. |
| 1003 | Use \\[toggle-read-only] to permit editing." | 1007 | Use \\[toggle-read-only] to permit editing." |
| 1004 | (interactive (find-file-read-args "Find file read-only other window: " t)) | 1008 | (interactive (find-file-read-args "Find file read-only other window: " nil)) |
| 1005 | (unless (file-exists-p filename) (error "%s does not exist" filename)) | 1009 | (unless (or (and wildcards find-file-wildcards |
| 1006 | (find-file-other-window filename wildcards) | 1010 | (not (string-match "\\`/:" filename)) |
| 1007 | (toggle-read-only 1) | 1011 | (string-match "[[*?]" filename)) |
| 1008 | (current-buffer)) | 1012 | (file-exists-p filename)) |
| 1013 | (error "%s does not exist" filename)) | ||
| 1014 | (let ((value (find-file-other-window filename wildcards))) | ||
| 1015 | (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1))) | ||
| 1016 | (if (listp value) value (list value))) | ||
| 1017 | value)) | ||
| 1009 | 1018 | ||
| 1010 | (defun find-file-read-only-other-frame (filename &optional wildcards) | 1019 | (defun find-file-read-only-other-frame (filename &optional wildcards) |
| 1011 | "Edit file FILENAME in another frame but don't allow changes. | 1020 | "Edit file FILENAME in another frame but don't allow changes. |
| 1012 | Like \\[find-file-other-frame] but marks buffer as read-only. | 1021 | Like \\[find-file-other-frame] but marks buffer as read-only. |
| 1013 | Use \\[toggle-read-only] to permit editing." | 1022 | Use \\[toggle-read-only] to permit editing." |
| 1014 | (interactive (find-file-read-args "Find file read-only other frame: " t)) | 1023 | (interactive (find-file-read-args "Find file read-only other frame: " nil)) |
| 1015 | (unless (file-exists-p filename) (error "%s does not exist" filename)) | 1024 | (unless (or (and wildcards find-file-wildcards |
| 1016 | (find-file-other-frame filename wildcards) | 1025 | (not (string-match "\\`/:" filename)) |
| 1017 | (toggle-read-only 1) | 1026 | (string-match "[[*?]" filename)) |
| 1018 | (current-buffer)) | 1027 | (file-exists-p filename)) |
| 1019 | 1028 | (error "%s does not exist" filename)) | |
| 1020 | (defun find-alternate-file-other-window (filename) | 1029 | (let ((value (find-file-other-frame filename wildcards))) |
| 1030 | (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1))) | ||
| 1031 | (if (listp value) value (list value))) | ||
| 1032 | value)) | ||
| 1033 | |||
| 1034 | (defun find-alternate-file-other-window (filename &optional wildcards) | ||
| 1021 | "Find file FILENAME as a replacement for the file in the next window. | 1035 | "Find file FILENAME as a replacement for the file in the next window. |
| 1022 | This command does not select that window." | 1036 | This command does not select that window. |
| 1037 | |||
| 1038 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, | ||
| 1039 | expand wildcards (if any) and replace the file with multiple files." | ||
| 1023 | (interactive | 1040 | (interactive |
| 1024 | (save-selected-window | 1041 | (save-selected-window |
| 1025 | (other-window 1) | 1042 | (other-window 1) |
| @@ -1030,17 +1047,21 @@ This command does not select that window." | |||
| 1030 | (setq file-name (file-name-nondirectory file) | 1047 | (setq file-name (file-name-nondirectory file) |
| 1031 | file-dir (file-name-directory file))) | 1048 | file-dir (file-name-directory file))) |
| 1032 | (list (read-file-name | 1049 | (list (read-file-name |
| 1033 | "Find alternate file: " file-dir nil nil file-name))))) | 1050 | "Find alternate file: " file-dir nil nil file-name) |
| 1051 | t)))) | ||
| 1034 | (if (one-window-p) | 1052 | (if (one-window-p) |
| 1035 | (find-file-other-window filename) | 1053 | (find-file-other-window filename wildcards) |
| 1036 | (save-selected-window | 1054 | (save-selected-window |
| 1037 | (other-window 1) | 1055 | (other-window 1) |
| 1038 | (find-alternate-file filename)))) | 1056 | (find-alternate-file filename wildcards)))) |
| 1039 | 1057 | ||
| 1040 | (defun find-alternate-file (filename) | 1058 | (defun find-alternate-file (filename &optional wildcards) |
| 1041 | "Find file FILENAME, select its buffer, kill previous buffer. | 1059 | "Find file FILENAME, select its buffer, kill previous buffer. |
| 1042 | If the current buffer now contains an empty file that you just visited | 1060 | If the current buffer now contains an empty file that you just visited |
| 1043 | \(presumably by mistake), use this command to visit the file you really want." | 1061 | \(presumably by mistake), use this command to visit the file you really want. |
| 1062 | |||
| 1063 | Interactively, or if WILDCARDS is non-nil in a call from Lisp, | ||
| 1064 | expand wildcards (if any) and replace the file with multiple files." | ||
| 1044 | (interactive | 1065 | (interactive |
| 1045 | (let ((file buffer-file-name) | 1066 | (let ((file buffer-file-name) |
| 1046 | (file-name nil) | 1067 | (file-name nil) |
| @@ -1049,7 +1070,8 @@ If the current buffer now contains an empty file that you just visited | |||
| 1049 | (setq file-name (file-name-nondirectory file) | 1070 | (setq file-name (file-name-nondirectory file) |
| 1050 | file-dir (file-name-directory file))) | 1071 | file-dir (file-name-directory file))) |
| 1051 | (list (read-file-name | 1072 | (list (read-file-name |
| 1052 | "Find alternate file: " file-dir nil nil file-name)))) | 1073 | "Find alternate file: " file-dir nil nil file-name) |
| 1074 | t))) | ||
| 1053 | (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) | 1075 | (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions) |
| 1054 | (error "Aborted")) | 1076 | (error "Aborted")) |
| 1055 | (when (and (buffer-modified-p) (buffer-file-name)) | 1077 | (when (and (buffer-modified-p) (buffer-file-name)) |
| @@ -1077,7 +1099,7 @@ If the current buffer now contains an empty file that you just visited | |||
| 1077 | (setq buffer-file-truename nil) | 1099 | (setq buffer-file-truename nil) |
| 1078 | ;; Likewise for dired buffers. | 1100 | ;; Likewise for dired buffers. |
| 1079 | (setq dired-directory nil) | 1101 | (setq dired-directory nil) |
| 1080 | (find-file filename)) | 1102 | (find-file filename wildcards)) |
| 1081 | (when (eq obuf (current-buffer)) | 1103 | (when (eq obuf (current-buffer)) |
| 1082 | ;; This executes if find-file gets an error | 1104 | ;; This executes if find-file gets an error |
| 1083 | ;; and does not really find anything. | 1105 | ;; and does not really find anything. |
| @@ -1247,8 +1269,8 @@ Optional first arg NOWARN non-nil means suppress any warning messages. | |||
| 1247 | Optional second arg RAWFILE non-nil means the file is read literally. | 1269 | Optional second arg RAWFILE non-nil means the file is read literally. |
| 1248 | Optional third arg WILDCARDS non-nil means do wildcard processing | 1270 | Optional third arg WILDCARDS non-nil means do wildcard processing |
| 1249 | and visit all the matching files. When wildcards are actually | 1271 | and visit all the matching files. When wildcards are actually |
| 1250 | used and expanded, the value is a list of buffers | 1272 | used and expanded, return a list of buffers that are visiting |
| 1251 | that are visiting the various files." | 1273 | the various files." |
| 1252 | (setq filename | 1274 | (setq filename |
| 1253 | (abbreviate-file-name | 1275 | (abbreviate-file-name |
| 1254 | (expand-file-name filename))) | 1276 | (expand-file-name filename))) |
| @@ -1757,6 +1779,7 @@ in that case, this function acts as if `enable-local-variables' were t." | |||
| 1757 | ("\\.ses\\'" . ses-mode) | 1779 | ("\\.ses\\'" . ses-mode) |
| 1758 | ("\\.\\(soa\\|zone\\)\\'" . dns-mode) | 1780 | ("\\.\\(soa\\|zone\\)\\'" . dns-mode) |
| 1759 | ("\\.docbook\\'" . sgml-mode) | 1781 | ("\\.docbook\\'" . sgml-mode) |
| 1782 | ("\\.com\\'" . dcl-mode) | ||
| 1760 | ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode) | 1783 | ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode) |
| 1761 | ;; Windows candidates may be opened case sensitively on Unix | 1784 | ;; Windows candidates may be opened case sensitively on Unix |
| 1762 | ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode) | 1785 | ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode) |
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 2b83229010d..518a9903085 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,8 +1,20 @@ | |||
| 1 | 2004-12-08 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * gnus-art.el (gnus-narrow-to-page): Don't hardcode point-min. | ||
| 4 | |||
| 5 | 2004-12-13 Katsumi Yamaoka <yamaoka@jpl.org> | ||
| 6 | |||
| 7 | * gnus-group.el (gnus-group-make-rss-group): Use | ||
| 8 | gnus-group-make-group instead of gnus-group-unsubscribe-group. | ||
| 9 | |||
| 10 | * gnus-start.el (gnus-setup-news): Honor user's setting to | ||
| 11 | gnus-message-archive-method. Suggested by Lute Kamstra | ||
| 12 | <Lute.Kamstra@xs4all.nl>. | ||
| 13 | |||
| 1 | 2004-12-02 Katsumi Yamaoka <yamaoka@jpl.org> | 14 | 2004-12-02 Katsumi Yamaoka <yamaoka@jpl.org> |
| 2 | 15 | ||
| 3 | * message.el (message-forward-make-body-mml): Remove headers | 16 | * message.el (message-forward-make-body-mml): Remove headers |
| 4 | according to message-forward-ignored-headers if a message is | 17 | according to message-forward-ignored-headers if a message is decoded. |
| 5 | decoded. | ||
| 6 | 18 | ||
| 7 | 2004-12-02 Romain Francoise <romain@orebokech.com> | 19 | 2004-12-02 Romain Francoise <romain@orebokech.com> |
| 8 | 20 | ||
| @@ -60,17 +72,16 @@ | |||
| 60 | 72 | ||
| 61 | 2004-11-25 Reiner Steib <Reiner.Steib@gmx.de> | 73 | 2004-11-25 Reiner Steib <Reiner.Steib@gmx.de> |
| 62 | 74 | ||
| 63 | * message.el (message-forbidden-properties): Fixed typo in doc | 75 | * message.el (message-forbidden-properties): Fix typo in doc string. |
| 64 | string. | ||
| 65 | 76 | ||
| 66 | 2004-11-25 Lars Magne Ingebrigtsen <larsi@gnus.org> | 77 | 2004-11-25 Lars Magne Ingebrigtsen <larsi@gnus.org> |
| 67 | 78 | ||
| 68 | * message.el (message-strip-forbidden-properties): Bind | 79 | * message.el (message-strip-forbidden-properties): |
| 69 | buffer-read-only (etc) to nil. | 80 | Bind buffer-read-only (etc) to nil. |
| 70 | 81 | ||
| 71 | 2004-11-25 Reiner Steib <Reiner.Steib@gmx.de> | 82 | 2004-11-25 Reiner Steib <Reiner.Steib@gmx.de> |
| 72 | 83 | ||
| 73 | * gnus-util.el (gnus-replace-in-string): Added doc string. | 84 | * gnus-util.el (gnus-replace-in-string): Add doc string. |
| 74 | 85 | ||
| 75 | * nnmail.el (nnmail-split-header-length-limit): Increase to 2048 | 86 | * nnmail.el (nnmail-split-header-length-limit): Increase to 2048 |
| 76 | to avoid problems when splitting mails with many recipients. | 87 | to avoid problems when splitting mails with many recipients. |
| @@ -97,8 +108,8 @@ | |||
| 97 | 108 | ||
| 98 | 2004-11-14 Reiner Steib <Reiner.Steib@gmx.de> | 109 | 2004-11-14 Reiner Steib <Reiner.Steib@gmx.de> |
| 99 | 110 | ||
| 100 | * gnus-start.el (gnus-convert-old-newsrc): Assign | 111 | * gnus-start.el (gnus-convert-old-newsrc): |
| 101 | legacy-gnus-agent to 5.10.7. | 112 | Assign legacy-gnus-agent to 5.10.7. |
| 102 | 113 | ||
| 103 | 2004-11-10 Katsumi Yamaoka <yamaoka@jpl.org> | 114 | 2004-11-10 Katsumi Yamaoka <yamaoka@jpl.org> |
| 104 | 115 | ||
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index f6286c7de87..7450fee69ee 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el | |||
| @@ -5066,7 +5066,7 @@ If given a numerical ARG, move forward ARG pages." | |||
| 5066 | (goto-char (point-min)) | 5066 | (goto-char (point-min)) |
| 5067 | (gnus-insert-prev-page-button))) | 5067 | (gnus-insert-prev-page-button))) |
| 5068 | (when (and (gnus-visual-p 'page-marker) | 5068 | (when (and (gnus-visual-p 'page-marker) |
| 5069 | (< (+ (point-max) 2) (buffer-size))) | 5069 | (< (point-max) (save-restriction (widen) (point-max)))) |
| 5070 | (save-excursion | 5070 | (save-excursion |
| 5071 | (goto-char (point-max)) | 5071 | (goto-char (point-max)) |
| 5072 | (gnus-insert-next-page-button)))))) | 5072 | (gnus-insert-next-page-button)))))) |
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index c55264b22de..b7d0cf9eef4 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el | |||
| @@ -2592,8 +2592,7 @@ If there is, use Gnus to create an nnrss group" | |||
| 2592 | (href (cdr (assoc 'href feedinfo)))) | 2592 | (href (cdr (assoc 'href feedinfo)))) |
| 2593 | (push (list title href desc) | 2593 | (push (list title href desc) |
| 2594 | nnrss-group-alist) | 2594 | nnrss-group-alist) |
| 2595 | (gnus-group-unsubscribe-group | 2595 | (gnus-group-make-group title '(nnrss "")) |
| 2596 | (concat "nnrss:" title)) | ||
| 2597 | (nnrss-save-server-data nil)) | 2596 | (nnrss-save-server-data nil)) |
| 2598 | (error "No feeds found for %s" url)))) | 2597 | (error "No feeds found for %s" url)))) |
| 2599 | 2598 | ||
diff --git a/lisp/gnus/gnus-start.el b/lisp/gnus/gnus-start.el index ddf00a37ee1..c1c79033267 100644 --- a/lisp/gnus/gnus-start.el +++ b/lisp/gnus/gnus-start.el | |||
| @@ -954,16 +954,28 @@ If LEVEL is non-nil, the news will be set up at level LEVEL." | |||
| 954 | ;; Make sure the archive server is available to all and sundry. | 954 | ;; Make sure the archive server is available to all and sundry. |
| 955 | (when gnus-message-archive-method | 955 | (when gnus-message-archive-method |
| 956 | (unless (assoc "archive" gnus-server-alist) | 956 | (unless (assoc "archive" gnus-server-alist) |
| 957 | (push `("archive" | 957 | (let ((method (or (and (stringp gnus-message-archive-method) |
| 958 | nnfolder | 958 | (gnus-server-to-method |
| 959 | "archive" | 959 | gnus-message-archive-method)) |
| 960 | (nnfolder-directory | 960 | gnus-message-archive-method))) |
| 961 | ,(nnheader-concat message-directory "archive")) | 961 | ;; Check whether the archive method is writable. |
| 962 | (nnfolder-active-file | 962 | (unless (or (stringp method) |
| 963 | ,(nnheader-concat message-directory "archive/active")) | 963 | (memq 'respool (assoc (format "%s" (car method)) |
| 964 | (nnfolder-get-new-mail nil) | 964 | gnus-valid-select-methods))) |
| 965 | (nnfolder-inhibit-expiry t)) | 965 | (setq method "archive")) ;; The default. |
| 966 | gnus-server-alist))) | 966 | (push (if (stringp method) |
| 967 | `("archive" | ||
| 968 | nnfolder | ||
| 969 | ,method | ||
| 970 | (nnfolder-directory | ||
| 971 | ,(nnheader-concat message-directory method)) | ||
| 972 | (nnfolder-active-file | ||
| 973 | ,(nnheader-concat message-directory | ||
| 974 | (concat method "/active"))) | ||
| 975 | (nnfolder-get-new-mail nil) | ||
| 976 | (nnfolder-inhibit-expiry t)) | ||
| 977 | (cons "archive" method)) | ||
| 978 | gnus-server-alist)))) | ||
| 967 | 979 | ||
| 968 | ;; If we don't read the complete active file, we fill in the | 980 | ;; If we don't read the complete active file, we fill in the |
| 969 | ;; hashtb here. | 981 | ;; hashtb here. |
diff --git a/lisp/info.el b/lisp/info.el index ef4225e5a3e..750f302d422 100644 --- a/lisp/info.el +++ b/lisp/info.el | |||
| @@ -86,7 +86,7 @@ The Lisp code is executed when the node is selected.") | |||
| 86 | :group 'info) | 86 | :group 'info) |
| 87 | 87 | ||
| 88 | (defface info-xref-visited | 88 | (defface info-xref-visited |
| 89 | '((t :inherit info-xref) | 89 | '((default :inherit info-xref) |
| 90 | (((class color) (background light)) :foreground "magenta4") | 90 | (((class color) (background light)) :foreground "magenta4") |
| 91 | (((class color) (background dark)) :foreground "magenta3")) ;"violet"? | 91 | (((class color) (background dark)) :foreground "magenta3")) ;"violet"? |
| 92 | "Face for visited Info cross-references." | 92 | "Face for visited Info cross-references." |
| @@ -2834,8 +2834,7 @@ if point is in a menu item description, follow that menu item." | |||
| 2834 | "Follow a node reference near point. Return non-nil if successful." | 2834 | "Follow a node reference near point. Return non-nil if successful." |
| 2835 | (let (node) | 2835 | (let (node) |
| 2836 | (cond | 2836 | (cond |
| 2837 | ((and (Info-get-token (point) "[hf]t?tp://" "[hf]t?tp://\\([^ \t\n\"`({<>})']+\\)") | 2837 | ((Info-get-token (point) "[hf]t?tp://" "[hf]t?tp://\\([^ \t\n\"`({<>})']+\\)") |
| 2838 | (or (featurep 'browse-url) (require 'browse-url nil t))) | ||
| 2839 | (setq node t) | 2838 | (setq node t) |
| 2840 | (browse-url (browse-url-url-at-point))) | 2839 | (browse-url (browse-url-url-at-point))) |
| 2841 | ((setq node (Info-get-token (point) "\\*note[ \n\t]+" | 2840 | ((setq node (Info-get-token (point) "\\*note[ \n\t]+" |
diff --git a/lisp/international/isearch-x.el b/lisp/international/isearch-x.el index 60736277b97..aad6b6e745e 100644 --- a/lisp/international/isearch-x.el +++ b/lisp/international/isearch-x.el | |||
| @@ -97,7 +97,7 @@ | |||
| 97 | (defun isearch-process-search-multibyte-characters (last-char) | 97 | (defun isearch-process-search-multibyte-characters (last-char) |
| 98 | (if (eq this-command 'isearch-printing-char) | 98 | (if (eq this-command 'isearch-printing-char) |
| 99 | (let ((overriding-terminal-local-map nil) | 99 | (let ((overriding-terminal-local-map nil) |
| 100 | (prompt (concat (isearch-message-prefix) isearch-message)) | 100 | (prompt (concat (isearch-message-prefix))) |
| 101 | (minibuffer-local-map isearch-minibuffer-local-map) | 101 | (minibuffer-local-map isearch-minibuffer-local-map) |
| 102 | str) | 102 | str) |
| 103 | (if isearch-input-method-function | 103 | (if isearch-input-method-function |
| @@ -107,11 +107,12 @@ | |||
| 107 | (cons 'with-input-method | 107 | (cons 'with-input-method |
| 108 | (cons last-char unread-command-events)) | 108 | (cons last-char unread-command-events)) |
| 109 | ;; Inherit current-input-method in a minibuffer. | 109 | ;; Inherit current-input-method in a minibuffer. |
| 110 | str (read-string prompt nil nil nil t)) | 110 | str (read-string prompt isearch-message nil nil t)) |
| 111 | (if (not str) | 111 | (if (not str) |
| 112 | ;; All inputs were deleted while the input method | 112 | ;; All inputs were deleted while the input method |
| 113 | ;; was working. | 113 | ;; was working. |
| 114 | (setq str "") | 114 | (setq str "") |
| 115 | (setq str (substring str (length isearch-message))) | ||
| 115 | (if (and (= (length str) 1) | 116 | (if (and (= (length str) 1) |
| 116 | (= (aref str 0) last-char) | 117 | (= (aref str 0) last-char) |
| 117 | (>= last-char 128)) | 118 | (>= last-char 128)) |
diff --git a/lisp/isearch.el b/lisp/isearch.el index e8bb47509be..b15a8f5affe 100644 --- a/lisp/isearch.el +++ b/lisp/isearch.el | |||
| @@ -258,6 +258,7 @@ Default value, nil, means edit the string instead." | |||
| 258 | (define-key map "\r" 'isearch-exit) | 258 | (define-key map "\r" 'isearch-exit) |
| 259 | (define-key map "\C-j" 'isearch-printing-char) | 259 | (define-key map "\C-j" 'isearch-printing-char) |
| 260 | (define-key map "\t" 'isearch-printing-char) | 260 | (define-key map "\t" 'isearch-printing-char) |
| 261 | (define-key map [?\S-\ ] 'isearch-printing-char) | ||
| 261 | 262 | ||
| 262 | (define-key map "\C-w" 'isearch-yank-word-or-char) | 263 | (define-key map "\C-w" 'isearch-yank-word-or-char) |
| 263 | (define-key map "\M-\C-w" 'isearch-del-char) | 264 | (define-key map "\M-\C-w" 'isearch-del-char) |
| @@ -938,7 +939,7 @@ If first char entered is \\[isearch-yank-word-or-char], then do word search inst | |||
| 938 | (isearch-message-prefix nil nil isearch-nonincremental) | 939 | (isearch-message-prefix nil nil isearch-nonincremental) |
| 939 | isearch-string | 940 | isearch-string |
| 940 | minibuffer-local-isearch-map nil | 941 | minibuffer-local-isearch-map nil |
| 941 | 'junk-ring)) | 942 | 'junk-ring nil t)) |
| 942 | isearch-new-message | 943 | isearch-new-message |
| 943 | (mapconcat 'isearch-text-char-description | 944 | (mapconcat 'isearch-text-char-description |
| 944 | isearch-new-string ""))) | 945 | isearch-new-string ""))) |
| @@ -2381,59 +2382,64 @@ Attempt to do the search exactly the way the pending isearch would." | |||
| 2381 | (let ((max isearch-lazy-highlight-max-at-a-time) | 2382 | (let ((max isearch-lazy-highlight-max-at-a-time) |
| 2382 | (looping t) | 2383 | (looping t) |
| 2383 | nomore) | 2384 | nomore) |
| 2384 | (save-excursion | 2385 | (with-local-quit |
| 2385 | (save-match-data | 2386 | (save-selected-window |
| 2386 | (goto-char (if isearch-forward | 2387 | (if (and (window-live-p isearch-lazy-highlight-window) |
| 2387 | isearch-lazy-highlight-end | 2388 | (not (eq (selected-window) isearch-lazy-highlight-window))) |
| 2388 | isearch-lazy-highlight-start)) | 2389 | (select-window isearch-lazy-highlight-window)) |
| 2389 | (while looping | 2390 | (save-excursion |
| 2390 | (let ((found (isearch-lazy-highlight-search))) | 2391 | (save-match-data |
| 2391 | (when max | 2392 | (goto-char (if isearch-forward |
| 2392 | (setq max (1- max)) | 2393 | isearch-lazy-highlight-end |
| 2393 | (if (<= max 0) | 2394 | isearch-lazy-highlight-start)) |
| 2394 | (setq looping nil))) | 2395 | (while looping |
| 2395 | (if found | 2396 | (let ((found (isearch-lazy-highlight-search))) |
| 2396 | (let ((mb (match-beginning 0)) | 2397 | (when max |
| 2397 | (me (match-end 0))) | 2398 | (setq max (1- max)) |
| 2398 | (if (= mb me) ;zero-length match | 2399 | (if (<= max 0) |
| 2400 | (setq looping nil))) | ||
| 2401 | (if found | ||
| 2402 | (let ((mb (match-beginning 0)) | ||
| 2403 | (me (match-end 0))) | ||
| 2404 | (if (= mb me) ;zero-length match | ||
| 2405 | (if isearch-forward | ||
| 2406 | (if (= mb (if isearch-lazy-highlight-wrapped | ||
| 2407 | isearch-lazy-highlight-start | ||
| 2408 | (window-end))) | ||
| 2409 | (setq found nil) | ||
| 2410 | (forward-char 1)) | ||
| 2411 | (if (= mb (if isearch-lazy-highlight-wrapped | ||
| 2412 | isearch-lazy-highlight-end | ||
| 2413 | (window-start))) | ||
| 2414 | (setq found nil) | ||
| 2415 | (forward-char -1))) | ||
| 2416 | |||
| 2417 | ;; non-zero-length match | ||
| 2418 | (let ((ov (make-overlay mb me))) | ||
| 2419 | (push ov isearch-lazy-highlight-overlays) | ||
| 2420 | (overlay-put ov 'face isearch-lazy-highlight-face) | ||
| 2421 | (overlay-put ov 'priority 0) ;lower than main overlay | ||
| 2422 | (overlay-put ov 'window (selected-window)))) | ||
| 2423 | (if isearch-forward | ||
| 2424 | (setq isearch-lazy-highlight-end (point)) | ||
| 2425 | (setq isearch-lazy-highlight-start (point))))) | ||
| 2426 | |||
| 2427 | ;; not found or zero-length match at the search bound | ||
| 2428 | (if (not found) | ||
| 2429 | (if isearch-lazy-highlight-wrapped | ||
| 2430 | (setq looping nil | ||
| 2431 | nomore t) | ||
| 2432 | (setq isearch-lazy-highlight-wrapped t) | ||
| 2399 | (if isearch-forward | 2433 | (if isearch-forward |
| 2400 | (if (= mb (if isearch-lazy-highlight-wrapped | 2434 | (progn |
| 2401 | isearch-lazy-highlight-start | 2435 | (setq isearch-lazy-highlight-end (window-start)) |
| 2402 | (window-end))) | 2436 | (goto-char (window-start))) |
| 2403 | (setq found nil) | 2437 | (setq isearch-lazy-highlight-start (window-end)) |
| 2404 | (forward-char 1)) | 2438 | (goto-char (window-end))))))) |
| 2405 | (if (= mb (if isearch-lazy-highlight-wrapped | 2439 | (unless nomore |
| 2406 | isearch-lazy-highlight-end | 2440 | (setq isearch-lazy-highlight-timer |
| 2407 | (window-start))) | 2441 | (run-at-time isearch-lazy-highlight-interval nil |
| 2408 | (setq found nil) | 2442 | 'isearch-lazy-highlight-update))))))))) |
| 2409 | (forward-char -1))) | ||
| 2410 | |||
| 2411 | ;; non-zero-length match | ||
| 2412 | (let ((ov (make-overlay mb me))) | ||
| 2413 | (overlay-put ov 'face isearch-lazy-highlight-face) | ||
| 2414 | (overlay-put ov 'priority 0) ;lower than main overlay | ||
| 2415 | (overlay-put ov 'window (selected-window)) | ||
| 2416 | (push ov isearch-lazy-highlight-overlays))) | ||
| 2417 | (if isearch-forward | ||
| 2418 | (setq isearch-lazy-highlight-end (point)) | ||
| 2419 | (setq isearch-lazy-highlight-start (point))))) | ||
| 2420 | |||
| 2421 | ;; not found or zero-length match at the search bound | ||
| 2422 | (if (not found) | ||
| 2423 | (if isearch-lazy-highlight-wrapped | ||
| 2424 | (setq looping nil | ||
| 2425 | nomore t) | ||
| 2426 | (setq isearch-lazy-highlight-wrapped t) | ||
| 2427 | (if isearch-forward | ||
| 2428 | (progn | ||
| 2429 | (setq isearch-lazy-highlight-end (window-start)) | ||
| 2430 | (goto-char (window-start))) | ||
| 2431 | (setq isearch-lazy-highlight-start (window-end)) | ||
| 2432 | (goto-char (window-end))))))) | ||
| 2433 | (unless nomore | ||
| 2434 | (setq isearch-lazy-highlight-timer | ||
| 2435 | (run-at-time isearch-lazy-highlight-interval nil | ||
| 2436 | 'isearch-lazy-highlight-update))))))) | ||
| 2437 | 2443 | ||
| 2438 | (defun isearch-resume (search regexp word forward message case-fold) | 2444 | (defun isearch-resume (search regexp word forward message case-fold) |
| 2439 | "Resume an incremental search. | 2445 | "Resume an incremental search. |
diff --git a/lisp/mail/supercite.el b/lisp/mail/supercite.el index c1f4b6f0170..06282c430f0 100644 --- a/lisp/mail/supercite.el +++ b/lisp/mail/supercite.el | |||
| @@ -146,8 +146,9 @@ Each element of this list has the following form: | |||
| 146 | (...))) | 146 | (...))) |
| 147 | 147 | ||
| 148 | Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular | 148 | Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular |
| 149 | expression to match against the INFOKEY's value. FRAME is a citation | 149 | expression to match against the INFOKEY's value. FRAME is |
| 150 | frame, or a variable containing a citation frame." | 150 | a citation frame, or a symbol that represents the name of |
| 151 | a variable whose value is a citation frame." | ||
| 151 | :type '(repeat (list symbol (repeat (cons regexp | 152 | :type '(repeat (list symbol (repeat (cons regexp |
| 152 | (choice (repeat (repeat sexp)) | 153 | (choice (repeat (repeat sexp)) |
| 153 | symbol))))) | 154 | symbol))))) |
| @@ -1434,12 +1435,11 @@ When called interactively, the optional arg INTERACTIVE is non-nil, | |||
| 1434 | and that means call `sc-select-attribution' too." | 1435 | and that means call `sc-select-attribution' too." |
| 1435 | (interactive "r\nP\np") | 1436 | (interactive "r\nP\np") |
| 1436 | (undo-boundary) | 1437 | (undo-boundary) |
| 1437 | (let ((frame (or (sc-scan-info-alist | 1438 | (let ((frame (sc-scan-info-alist sc-cite-frame-alist)) |
| 1438 | (if (symbolp sc-cite-frame-alist) | ||
| 1439 | (symbol-value sc-cite-frame-alist) | ||
| 1440 | sc-cite-frame-alist)) | ||
| 1441 | sc-default-cite-frame)) | ||
| 1442 | (sc-confirm-always-p (if confirm-p t sc-confirm-always-p))) | 1439 | (sc-confirm-always-p (if confirm-p t sc-confirm-always-p))) |
| 1440 | (if (and frame (symbolp frame)) | ||
| 1441 | (setq frame (symbol-value frame))) | ||
| 1442 | (or frame (setq frame sc-default-cite-frame)) | ||
| 1443 | (run-hooks 'sc-pre-cite-hook) | 1443 | (run-hooks 'sc-pre-cite-hook) |
| 1444 | (if interactive | 1444 | (if interactive |
| 1445 | (sc-select-attribution)) | 1445 | (sc-select-attribution)) |
| @@ -1450,11 +1450,10 @@ and that means call `sc-select-attribution' too." | |||
| 1450 | First runs `sc-pre-uncite-hook'." | 1450 | First runs `sc-pre-uncite-hook'." |
| 1451 | (interactive "r") | 1451 | (interactive "r") |
| 1452 | (undo-boundary) | 1452 | (undo-boundary) |
| 1453 | (let ((frame (or (sc-scan-info-alist | 1453 | (let ((frame (sc-scan-info-alist sc-uncite-frame-alist))) |
| 1454 | (if (symbolp sc-uncite-frame-alist) | 1454 | (if (and frame (symbolp frame)) |
| 1455 | (symbol-value sc-uncite-frame-alist) | 1455 | (setq frame (symbol-value frame))) |
| 1456 | sc-uncite-frame-alist)) | 1456 | (or frame (setq frame sc-default-uncite-frame)) |
| 1457 | sc-default-uncite-frame))) | ||
| 1458 | (run-hooks 'sc-pre-uncite-hook) | 1457 | (run-hooks 'sc-pre-uncite-hook) |
| 1459 | (regi-interpret frame start end))) | 1458 | (regi-interpret frame start end))) |
| 1460 | 1459 | ||
| @@ -1465,11 +1464,10 @@ First runs `sc-pre-recite-hook'." | |||
| 1465 | (let ((sc-confirm-always-p t)) | 1464 | (let ((sc-confirm-always-p t)) |
| 1466 | (sc-select-attribution)) | 1465 | (sc-select-attribution)) |
| 1467 | (undo-boundary) | 1466 | (undo-boundary) |
| 1468 | (let ((frame (or (sc-scan-info-alist | 1467 | (let ((frame (sc-scan-info-alist sc-recite-frame-alist))) |
| 1469 | (if (symbolp sc-recite-frame-alist) | 1468 | (if (and frame (symbolp frame)) |
| 1470 | (symbol-value sc-recite-frame-alist) | 1469 | (setq frame (symbol-value frame))) |
| 1471 | sc-recite-frame-alist)) | 1470 | (or frame (setq frame sc-default-recite-frame)) |
| 1472 | sc-default-recite-frame))) | ||
| 1473 | (run-hooks 'sc-pre-recite-hook) | 1471 | (run-hooks 'sc-pre-recite-hook) |
| 1474 | (regi-interpret frame start end))) | 1472 | (regi-interpret frame start end))) |
| 1475 | 1473 | ||
diff --git a/lisp/net/browse-url.el b/lisp/net/browse-url.el index 098f2988f1b..6e679876eef 100644 --- a/lisp/net/browse-url.el +++ b/lisp/net/browse-url.el | |||
| @@ -575,6 +575,7 @@ down (this *won't* always work)." | |||
| 575 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 575 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 576 | ;; URL input | 576 | ;; URL input |
| 577 | 577 | ||
| 578 | ;;;###autoload | ||
| 578 | (defun browse-url-url-at-point () | 579 | (defun browse-url-url-at-point () |
| 579 | (let ((url (thing-at-point 'url))) | 580 | (let ((url (thing-at-point 'url))) |
| 580 | (set-text-properties 0 (length url) nil url) | 581 | (set-text-properties 0 (length url) nil url) |
diff --git a/lisp/play/zone.el b/lisp/play/zone.el index abe9657a9d8..e073e343f02 100644 --- a/lisp/play/zone.el +++ b/lisp/play/zone.el | |||
| @@ -75,6 +75,7 @@ If nil, don't interrupt for about 1^26 seconds.") | |||
| 75 | zone-pgm-paragraph-spaz | 75 | zone-pgm-paragraph-spaz |
| 76 | zone-pgm-stress | 76 | zone-pgm-stress |
| 77 | zone-pgm-stress-destress | 77 | zone-pgm-stress-destress |
| 78 | zone-pgm-random-life | ||
| 78 | ]) | 79 | ]) |
| 79 | 80 | ||
| 80 | (defmacro zone-orig (&rest body) | 81 | (defmacro zone-orig (&rest body) |
| @@ -459,6 +460,26 @@ If the element is a function or a list of a function and a number, | |||
| 459 | (sit-for wait)) | 460 | (sit-for wait)) |
| 460 | (delete-char -1) (insert c-string))) | 461 | (delete-char -1) (insert c-string))) |
| 461 | 462 | ||
| 463 | (defun zone-fill-out-screen (width height) | ||
| 464 | (save-excursion | ||
| 465 | (goto-char (point-min)) | ||
| 466 | ;; fill out rectangular ws block | ||
| 467 | (while (not (eobp)) | ||
| 468 | (end-of-line) | ||
| 469 | (let ((cc (current-column))) | ||
| 470 | (if (< cc width) | ||
| 471 | (insert (make-string (- width cc) 32)) | ||
| 472 | (delete-char (- width cc)))) | ||
| 473 | (unless (eobp) | ||
| 474 | (forward-char 1))) | ||
| 475 | ;; pad ws past bottom of screen | ||
| 476 | (let ((nl (- height (count-lines (point-min) (point))))) | ||
| 477 | (when (> nl 0) | ||
| 478 | (let ((line (concat (make-string (1- width) ? ) "\n"))) | ||
| 479 | (do ((i 0 (1+ i))) | ||
| 480 | ((= i nl)) | ||
| 481 | (insert line))))))) | ||
| 482 | |||
| 462 | (defun zone-fall-through-ws (c col wend) | 483 | (defun zone-fall-through-ws (c col wend) |
| 463 | (let ((fall-p nil) ; todo: move outward | 484 | (let ((fall-p nil) ; todo: move outward |
| 464 | (wait 0.15) | 485 | (wait 0.15) |
| @@ -486,27 +507,9 @@ If the element is a function or a list of a function and a number, | |||
| 486 | (mc 0) ; miss count | 507 | (mc 0) ; miss count |
| 487 | (total (* ww wh)) | 508 | (total (* ww wh)) |
| 488 | (fall-p nil)) | 509 | (fall-p nil)) |
| 489 | (goto-char (point-min)) | 510 | (zone-fill-out-screen ww wh) |
| 490 | ;; fill out rectangular ws block | ||
| 491 | (while (not (eobp)) | ||
| 492 | (end-of-line) | ||
| 493 | (let ((cc (current-column))) | ||
| 494 | (if (< cc ww) | ||
| 495 | (insert (make-string (- ww cc) ? )) | ||
| 496 | (delete-char (- ww cc)))) | ||
| 497 | (unless (eobp) | ||
| 498 | (forward-char 1))) | ||
| 499 | ;; pad ws past bottom of screen | ||
| 500 | (let ((nl (- wh (count-lines (point-min) (point))))) | ||
| 501 | (when (> nl 0) | ||
| 502 | (let ((line (concat (make-string (1- ww) ? ) "\n"))) | ||
| 503 | (do ((i 0 (1+ i))) | ||
| 504 | ((= i nl)) | ||
| 505 | (insert line))))) | ||
| 506 | (catch 'done | 511 | (catch 'done |
| 507 | (while (not (input-pending-p)) | 512 | (while (not (input-pending-p)) |
| 508 | (goto-char (point-min)) | ||
| 509 | (sit-for 0) | ||
| 510 | (let ((wbeg (window-start)) | 513 | (let ((wbeg (window-start)) |
| 511 | (wend (window-end))) | 514 | (wend (window-end))) |
| 512 | (setq mc 0) | 515 | (setq mc 0) |
| @@ -552,7 +555,9 @@ If the element is a function or a list of a function and a number, | |||
| 552 | ;;;; zone-pgm-paragraph-spaz | 555 | ;;;; zone-pgm-paragraph-spaz |
| 553 | 556 | ||
| 554 | (defun zone-pgm-paragraph-spaz () | 557 | (defun zone-pgm-paragraph-spaz () |
| 555 | (if (memq (zone-orig major-mode) '(text-mode fundamental-mode)) | 558 | (if (memq (zone-orig major-mode) |
| 559 | ;; there should be a better way to distinguish textish modes | ||
| 560 | '(text-mode texinfo-mode fundamental-mode)) | ||
| 556 | (let ((fill-column fill-column) | 561 | (let ((fill-column fill-column) |
| 557 | (fc-min fill-column) | 562 | (fc-min fill-column) |
| 558 | (fc-max fill-column) | 563 | (fc-max fill-column) |
| @@ -570,7 +575,7 @@ If the element is a function or a list of a function and a number, | |||
| 570 | (zone-pgm-rotate))) | 575 | (zone-pgm-rotate))) |
| 571 | 576 | ||
| 572 | 577 | ||
| 573 | ;;;; zone-pgm-stress | 578 | ;;;; stressing and destressing |
| 574 | 579 | ||
| 575 | (defun zone-pgm-stress () | 580 | (defun zone-pgm-stress () |
| 576 | (goto-char (point-min)) | 581 | (goto-char (point-min)) |
| @@ -596,9 +601,6 @@ If the element is a function or a list of a function and a number, | |||
| 596 | (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr")) | 601 | (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr")) |
| 597 | (sit-for 0.1))))) | 602 | (sit-for 0.1))))) |
| 598 | 603 | ||
| 599 | |||
| 600 | ;;;; zone-pgm-stress-destress | ||
| 601 | |||
| 602 | (defun zone-pgm-stress-destress () | 604 | (defun zone-pgm-stress-destress () |
| 603 | (zone-call 'zone-pgm-stress 25) | 605 | (zone-call 'zone-pgm-stress 25) |
| 604 | (zone-hiding-modeline | 606 | (zone-hiding-modeline |
| @@ -617,6 +619,59 @@ If the element is a function or a list of a function and a number, | |||
| 617 | zone-pgm-drip)))) | 619 | zone-pgm-drip)))) |
| 618 | 620 | ||
| 619 | 621 | ||
| 622 | ;;;; the lyfe so short the craft so long to lerne --chaucer | ||
| 623 | |||
| 624 | (defvar zone-pgm-random-life-wait nil | ||
| 625 | "*Seconds to wait between successive `life' generations. | ||
| 626 | If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).") | ||
| 627 | |||
| 628 | (defun zone-pgm-random-life () | ||
| 629 | (require 'life) | ||
| 630 | (zone-fill-out-screen (1- (window-width)) (1- (window-height))) | ||
| 631 | (let ((top (progn (goto-char (window-start)) (forward-line 7) (point))) | ||
| 632 | (bot (progn (goto-char (window-end)) (forward-line -7) (point))) | ||
| 633 | (rtc (- (frame-width) 11)) | ||
| 634 | (min (window-start)) | ||
| 635 | (max (1- (window-end))) | ||
| 636 | c col) | ||
| 637 | (delete-region max (point-max)) | ||
| 638 | (while (progn (goto-char (+ min (random max))) | ||
| 639 | (and (sit-for 0.005) | ||
| 640 | (or (progn (skip-chars-forward " @\n" max) | ||
| 641 | (not (= max (point)))) | ||
| 642 | (unless (or (= 0 (skip-chars-backward " @\n" min)) | ||
| 643 | (= min (point))) | ||
| 644 | (forward-char -1) | ||
| 645 | t)))) | ||
| 646 | (setq c (char-after)) | ||
| 647 | (unless (or (not c) (= ?\n c)) | ||
| 648 | (forward-char 1) | ||
| 649 | (insert-and-inherit ; keep colors | ||
| 650 | (cond ((or (> top (point)) | ||
| 651 | (< bot (point)) | ||
| 652 | (or (> 11 (setq col (current-column))) | ||
| 653 | (< rtc col))) | ||
| 654 | 32) | ||
| 655 | ((and (<= ?a c) (>= ?z c)) (+ c (- ?A ?a))) | ||
| 656 | ((and (<= ?A c) (>= ?Z c)) ?*) | ||
| 657 | (t ?@))) | ||
| 658 | (forward-char -1) | ||
| 659 | (delete-char -1))) | ||
| 660 | (sit-for 3) | ||
| 661 | (setq col nil) | ||
| 662 | (goto-char bot) | ||
| 663 | (while (< top (point)) | ||
| 664 | (setq c (point)) | ||
| 665 | (move-to-column 9) | ||
| 666 | (setq col (cons (buffer-substring (point) c) col)) | ||
| 667 | (end-of-line 0) | ||
| 668 | (forward-char -10)) | ||
| 669 | (let ((life-patterns (vector (cons (make-string (length (car col)) 32) | ||
| 670 | col)))) | ||
| 671 | (life (or zone-pgm-random-life-wait (random 4))) | ||
| 672 | (kill-buffer nil)))) | ||
| 673 | |||
| 674 | |||
| 620 | ;;;;;;;;;;;;;;; | 675 | ;;;;;;;;;;;;;;; |
| 621 | (provide 'zone) | 676 | (provide 'zone) |
| 622 | 677 | ||
diff --git a/lisp/progmodes/idlw-shell.el b/lisp/progmodes/idlw-shell.el index eaa6f3be4ea..44675470b67 100644 --- a/lisp/progmodes/idlw-shell.el +++ b/lisp/progmodes/idlw-shell.el | |||
| @@ -841,6 +841,8 @@ IDL has currently stepped.") | |||
| 841 | (defvar idlwave-shell-sources-query) | 841 | (defvar idlwave-shell-sources-query) |
| 842 | (defvar idlwave-shell-mode-map) | 842 | (defvar idlwave-shell-mode-map) |
| 843 | (defvar idlwave-shell-calling-stack-index) | 843 | (defvar idlwave-shell-calling-stack-index) |
| 844 | (defvar idlwave-shell-only-prompt-pattern nil) | ||
| 845 | (defvar tool-bar-map) | ||
| 844 | 846 | ||
| 845 | (defun idlwave-shell-mode () | 847 | (defun idlwave-shell-mode () |
| 846 | "Major mode for interacting with an inferior IDL process. | 848 | "Major mode for interacting with an inferior IDL process. |
| @@ -994,7 +996,7 @@ IDL has currently stepped.") | |||
| 994 | (setq idlwave-shell-hide-output nil) | 996 | (setq idlwave-shell-hide-output nil) |
| 995 | 997 | ||
| 996 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility | 998 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility |
| 997 | (make-local-hook 'kill-buffer-hook) | 999 | ;;(make-local-hook 'kill-buffer-hook) |
| 998 | (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm | 1000 | (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm |
| 999 | nil 'local) | 1001 | nil 'local) |
| 1000 | (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local) | 1002 | (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local) |
| @@ -1038,7 +1040,7 @@ IDL has currently stepped.") | |||
| 1038 | (setq abbrev-mode t) | 1040 | (setq abbrev-mode t) |
| 1039 | 1041 | ||
| 1040 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility | 1042 | ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility |
| 1041 | (make-local-hook 'post-command-hook) | 1043 | ;;(make-local-hook 'post-command-hook) |
| 1042 | (add-hook 'post-command-hook 'idlwave-command-hook nil t) | 1044 | (add-hook 'post-command-hook 'idlwave-command-hook nil t) |
| 1043 | 1045 | ||
| 1044 | ;; Read the command history? | 1046 | ;; Read the command history? |
| @@ -1458,7 +1460,6 @@ Otherwise just move the line. Move down unless UP is non-nil." | |||
| 1458 | "Return t if the shell process is running." | 1460 | "Return t if the shell process is running." |
| 1459 | (eq (process-status idlwave-shell-process-name) 'run)) | 1461 | (eq (process-status idlwave-shell-process-name) 'run)) |
| 1460 | 1462 | ||
| 1461 | (defvar idlwave-shell-only-prompt-pattern nil) | ||
| 1462 | (defun idlwave-shell-filter-hidden-output (output) | 1463 | (defun idlwave-shell-filter-hidden-output (output) |
| 1463 | "Filter hidden output, leaving the good stuff. | 1464 | "Filter hidden output, leaving the good stuff. |
| 1464 | 1465 | ||
| @@ -1475,6 +1476,7 @@ error messages, etc." | |||
| 1475 | 1476 | ||
| 1476 | (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*" | 1477 | (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*" |
| 1477 | "Buffer containing hidden output from IDL commands.") | 1478 | "Buffer containing hidden output from IDL commands.") |
| 1479 | (defvar idlwave-shell-current-state nil) | ||
| 1478 | 1480 | ||
| 1479 | (defun idlwave-shell-filter (proc string) | 1481 | (defun idlwave-shell-filter (proc string) |
| 1480 | "Watch for IDL prompt and filter incoming text. | 1482 | "Watch for IDL prompt and filter incoming text. |
| @@ -1627,7 +1629,55 @@ and then calls `idlwave-shell-send-command' for any pending commands." | |||
| 1627 | (run-hooks 'idlwave-shell-sentinel-hook)) | 1629 | (run-hooks 'idlwave-shell-sentinel-hook)) |
| 1628 | (run-hooks 'idlwave-shell-sentinel-hook)))) | 1630 | (run-hooks 'idlwave-shell-sentinel-hook)))) |
| 1629 | 1631 | ||
| 1630 | (defvar idlwave-shell-current-state nil) | 1632 | (defvar idlwave-shell-error-buffer " *idlwave-shell-errors*" |
| 1633 | "Buffer containing syntax errors from IDL compilations.") | ||
| 1634 | |||
| 1635 | ;; FIXME: the following two variables do not currently allow line breaks | ||
| 1636 | ;; in module and file names. I am not sure if it will be necessary to | ||
| 1637 | ;; change this. Currently it seems to work the way it is. | ||
| 1638 | (defvar idlwave-shell-syntax-error | ||
| 1639 | "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1640 | "A regular expression to match an IDL syntax error. | ||
| 1641 | The 1st pair matches the file name, the second pair matches the line | ||
| 1642 | number.") | ||
| 1643 | |||
| 1644 | (defvar idlwave-shell-other-error | ||
| 1645 | "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1646 | "A regular expression to match any IDL error.") | ||
| 1647 | |||
| 1648 | (defvar idlwave-shell-halting-error | ||
| 1649 | "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n" | ||
| 1650 | "A regular expression to match errors which halt execution.") | ||
| 1651 | |||
| 1652 | (defvar idlwave-shell-cant-continue-error | ||
| 1653 | "^% Can't continue from this point.\n" | ||
| 1654 | "A regular expression to match errors stepping errors.") | ||
| 1655 | |||
| 1656 | (defvar idlwave-shell-file-line-message | ||
| 1657 | (concat | ||
| 1658 | "\\(" ; program name group (1) | ||
| 1659 | "\\$MAIN\\$\\|" ; main level routine | ||
| 1660 | "\\<[a-zA-Z][a-zA-Z0-9_$:]*" ; start with a letter followed by [..] | ||
| 1661 | "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2) | ||
| 1662 | "\\)" ; end program name group (1) | ||
| 1663 | "[ \t\n]+" ; white space | ||
| 1664 | "\\(" ; line number group (3) | ||
| 1665 | "[0-9]+" ; the line number (the fix point) | ||
| 1666 | "\\([ \t]*\n[ \t]*[0-9]+\\)*" ; continuation lines number (4) | ||
| 1667 | "\\)" ; end line number group (3) | ||
| 1668 | "[ \t\n]+" ; white space | ||
| 1669 | "\\(" ; file name group (5) | ||
| 1670 | "[^ \t\n]+" ; file names can contain any non-white | ||
| 1671 | "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*" ; continuation lines file name (6) | ||
| 1672 | "\\)" ; end line number group (5) | ||
| 1673 | ) | ||
| 1674 | "*A regular expression to parse out the file name and line number. | ||
| 1675 | The 1st group should match the subroutine name. | ||
| 1676 | The 3rd group is the line number. | ||
| 1677 | The 5th group is the file name. | ||
| 1678 | All parts may contain linebreaks surrounded by spaces. This is important | ||
| 1679 | in IDL5 which inserts random linebreaks in long module and file names.") | ||
| 1680 | |||
| 1631 | (defun idlwave-shell-scan-for-state () | 1681 | (defun idlwave-shell-scan-for-state () |
| 1632 | "Scan for state info. Looks for messages in output from last IDL | 1682 | "Scan for state info. Looks for messages in output from last IDL |
| 1633 | command indicating where IDL has stopped. The types of messages we are | 1683 | command indicating where IDL has stopped. The types of messages we are |
| @@ -1721,55 +1771,6 @@ the above." | |||
| 1721 | ;; Otherwise, no particular state | 1771 | ;; Otherwise, no particular state |
| 1722 | (t (setq idlwave-shell-current-state nil))))) | 1772 | (t (setq idlwave-shell-current-state nil))))) |
| 1723 | 1773 | ||
| 1724 | (defvar idlwave-shell-error-buffer " *idlwave-shell-errors*" | ||
| 1725 | "Buffer containing syntax errors from IDL compilations.") | ||
| 1726 | |||
| 1727 | ;; FIXME: the following two variables do not currently allow line breaks | ||
| 1728 | ;; in module and file names. I am not sure if it will be necessary to | ||
| 1729 | ;; change this. Currently it seems to work the way it is. | ||
| 1730 | (defvar idlwave-shell-syntax-error | ||
| 1731 | "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1732 | "A regular expression to match an IDL syntax error. | ||
| 1733 | The 1st pair matches the file name, the second pair matches the line | ||
| 1734 | number.") | ||
| 1735 | |||
| 1736 | (defvar idlwave-shell-other-error | ||
| 1737 | "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" | ||
| 1738 | "A regular expression to match any IDL error.") | ||
| 1739 | |||
| 1740 | (defvar idlwave-shell-halting-error | ||
| 1741 | "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n" | ||
| 1742 | "A regular expression to match errors which halt execution.") | ||
| 1743 | |||
| 1744 | (defvar idlwave-shell-cant-continue-error | ||
| 1745 | "^% Can't continue from this point.\n" | ||
| 1746 | "A regular expression to match errors stepping errors.") | ||
| 1747 | |||
| 1748 | (defvar idlwave-shell-file-line-message | ||
| 1749 | (concat | ||
| 1750 | "\\(" ; program name group (1) | ||
| 1751 | "\\$MAIN\\$\\|" ; main level routine | ||
| 1752 | "\\<[a-zA-Z][a-zA-Z0-9_$:]*" ; start with a letter followed by [..] | ||
| 1753 | "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2) | ||
| 1754 | "\\)" ; end program name group (1) | ||
| 1755 | "[ \t\n]+" ; white space | ||
| 1756 | "\\(" ; line number group (3) | ||
| 1757 | "[0-9]+" ; the line number (the fix point) | ||
| 1758 | "\\([ \t]*\n[ \t]*[0-9]+\\)*" ; continuation lines number (4) | ||
| 1759 | "\\)" ; end line number group (3) | ||
| 1760 | "[ \t\n]+" ; white space | ||
| 1761 | "\\(" ; file name group (5) | ||
| 1762 | "[^ \t\n]+" ; file names can contain any non-white | ||
| 1763 | "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*" ; continuation lines file name (6) | ||
| 1764 | "\\)" ; end line number group (5) | ||
| 1765 | ) | ||
| 1766 | "*A regular expression to parse out the file name and line number. | ||
| 1767 | The 1st group should match the subroutine name. | ||
| 1768 | The 3rd group is the line number. | ||
| 1769 | The 5th group is the file name. | ||
| 1770 | All parts may contain linebreaks surrounded by spaces. This is important | ||
| 1771 | in IDL5 which inserts random linebreaks in long module and file names.") | ||
| 1772 | |||
| 1773 | (defun idlwave-shell-parse-line (string &optional skip-main) | 1774 | (defun idlwave-shell-parse-line (string &optional skip-main) |
| 1774 | "Parse IDL message for the subroutine, file name and line number. | 1775 | "Parse IDL message for the subroutine, file name and line number. |
| 1775 | We need to work hard here to remove the stupid line breaks inserted by | 1776 | We need to work hard here to remove the stupid line breaks inserted by |
| @@ -2102,8 +2103,8 @@ Change the default directory for the process buffer to concur." | |||
| 2102 | 'hide 'wait) | 2103 | 'hide 'wait) |
| 2103 | ;; If we don't know anything about the class, update shell routines | 2104 | ;; If we don't know anything about the class, update shell routines |
| 2104 | (if (and idlwave-shell-get-object-class | 2105 | (if (and idlwave-shell-get-object-class |
| 2105 | (not (assoc-ignore-case idlwave-shell-get-object-class | 2106 | (not (assoc-string idlwave-shell-get-object-class |
| 2106 | (idlwave-class-alist)))) | 2107 | (idlwave-class-alist) t))) |
| 2107 | (idlwave-shell-maybe-update-routine-info)) | 2108 | (idlwave-shell-maybe-update-routine-info)) |
| 2108 | idlwave-shell-get-object-class))) | 2109 | idlwave-shell-get-object-class))) |
| 2109 | 2110 | ||
| @@ -2165,9 +2166,10 @@ keywords." | |||
| 2165 | (idlwave-complete arg))))) | 2166 | (idlwave-complete arg))))) |
| 2166 | 2167 | ||
| 2167 | ;; Get rid of opaque dynamic variable passing of link? | 2168 | ;; Get rid of opaque dynamic variable passing of link? |
| 2169 | (defvar link) ;dynamic variable | ||
| 2168 | (defun idlwave-shell-complete-execcomm-help (mode word) | 2170 | (defun idlwave-shell-complete-execcomm-help (mode word) |
| 2169 | (let ((word (or (nth 1 idlwave-completion-help-info) word)) | 2171 | (let ((word (or (nth 1 idlwave-completion-help-info) word)) |
| 2170 | (entry (assoc-ignore-case word idlwave-executive-commands-alist))) | 2172 | (entry (assoc-string word idlwave-executive-commands-alist t))) |
| 2171 | (cond | 2173 | (cond |
| 2172 | ((eq mode 'test) | 2174 | ((eq mode 'test) |
| 2173 | (and (stringp word) entry (cdr entry))) | 2175 | (and (stringp word) entry (cdr entry))) |
| @@ -2217,6 +2219,7 @@ args of an executive .run, .rnew or .compile." | |||
| 2217 | (looking-at "\\$"))) | 2219 | (looking-at "\\$"))) |
| 2218 | 2220 | ||
| 2219 | ;; Debugging Commands ------------------------------------------------------ | 2221 | ;; Debugging Commands ------------------------------------------------------ |
| 2222 | (defvar idlwave-shell-electric-debug-mode) ; defined by easy-mmode | ||
| 2220 | 2223 | ||
| 2221 | (defun idlwave-shell-redisplay (&optional hide) | 2224 | (defun idlwave-shell-redisplay (&optional hide) |
| 2222 | "Tries to resync the display with where execution has stopped. | 2225 | "Tries to resync the display with where execution has stopped. |
| @@ -3517,6 +3520,7 @@ considered the new breakpoint if the file name of frame matches." | |||
| 3517 | 3520 | ||
| 3518 | (defvar idlwave-shell-bp-overlays nil | 3521 | (defvar idlwave-shell-bp-overlays nil |
| 3519 | "Alist of overlays marking breakpoints") | 3522 | "Alist of overlays marking breakpoints") |
| 3523 | (defvar idlwave-shell-bp-glyph) | ||
| 3520 | 3524 | ||
| 3521 | (defun idlwave-shell-update-bp-overlays () | 3525 | (defun idlwave-shell-update-bp-overlays () |
| 3522 | "Update the overlays which mark breakpoints in the source code. | 3526 | "Update the overlays which mark breakpoints in the source code. |
| @@ -3605,7 +3609,6 @@ Existing overlays are recycled, in order to minimize consumption." | |||
| 3605 | (set-window-buffer win buf)))))))) | 3609 | (set-window-buffer win buf)))))))) |
| 3606 | 3610 | ||
| 3607 | 3611 | ||
| 3608 | (defvar idlwave-shell-bp-glyph) | ||
| 3609 | (defun idlwave-shell-make-new-bp-overlay (&optional type disabled help) | 3612 | (defun idlwave-shell-make-new-bp-overlay (&optional type disabled help) |
| 3610 | "Make a new overlay for highlighting breakpoints. | 3613 | "Make a new overlay for highlighting breakpoints. |
| 3611 | 3614 | ||
| @@ -4026,7 +4029,7 @@ Otherwise, just expand the file name." | |||
| 4026 | '(alt)))) | 4029 | '(alt)))) |
| 4027 | (shift (memq 'shift mod)) | 4030 | (shift (memq 'shift mod)) |
| 4028 | (mod-noshift (delete 'shift (copy-sequence mod))) | 4031 | (mod-noshift (delete 'shift (copy-sequence mod))) |
| 4029 | s k1 c2 k2 cmd cannotshift) | 4032 | s k1 c2 k2 cmd electric only-buffer cannotshift) |
| 4030 | (while (setq s (pop specs)) | 4033 | (while (setq s (pop specs)) |
| 4031 | (setq k1 (nth 0 s) | 4034 | (setq k1 (nth 0 s) |
| 4032 | c2 (nth 1 s) | 4035 | c2 (nth 1 s) |
| @@ -4089,6 +4092,9 @@ Otherwise, just expand the file name." | |||
| 4089 | (setq idlwave-shell-suppress-electric-debug nil)) | 4092 | (setq idlwave-shell-suppress-electric-debug nil)) |
| 4090 | (idlwave-shell-electric-debug-mode)) | 4093 | (idlwave-shell-electric-debug-mode)) |
| 4091 | 4094 | ||
| 4095 | (defvar idlwave-shell-electric-debug-read-only) | ||
| 4096 | (defvar idlwave-shell-electric-debug-buffers nil) | ||
| 4097 | |||
| 4092 | (easy-mmode-define-minor-mode idlwave-shell-electric-debug-mode | 4098 | (easy-mmode-define-minor-mode idlwave-shell-electric-debug-mode |
| 4093 | "Toggle Electric Debug mode. | 4099 | "Toggle Electric Debug mode. |
| 4094 | With no argument, this command toggles the mode. | 4100 | With no argument, this command toggles the mode. |
| @@ -4138,7 +4144,6 @@ idlwave-shell-electric-debug-mode-map) | |||
| 4138 | (force-mode-line-update)) | 4144 | (force-mode-line-update)) |
| 4139 | 4145 | ||
| 4140 | ;; Turn it off in all relevant buffers | 4146 | ;; Turn it off in all relevant buffers |
| 4141 | (defvar idlwave-shell-electric-debug-buffers nil) | ||
| 4142 | (defun idlwave-shell-electric-debug-all-off () | 4147 | (defun idlwave-shell-electric-debug-all-off () |
| 4143 | (setq idlwave-shell-suppress-electric-debug nil) | 4148 | (setq idlwave-shell-suppress-electric-debug nil) |
| 4144 | (let ((buffers idlwave-shell-electric-debug-buffers) | 4149 | (let ((buffers idlwave-shell-electric-debug-buffers) |
diff --git a/lisp/replace.el b/lisp/replace.el index 8a5c0a9680c..646f693cd7f 100644 --- a/lisp/replace.el +++ b/lisp/replace.el | |||
| @@ -1214,7 +1214,7 @@ but coerced to the correct value of INTEGERS." | |||
| 1214 | 1214 | ||
| 1215 | (defun replace-match-maybe-edit (newtext fixedcase literal noedit match-data) | 1215 | (defun replace-match-maybe-edit (newtext fixedcase literal noedit match-data) |
| 1216 | "Make a replacement with `replace-match', editing `\\?'. | 1216 | "Make a replacement with `replace-match', editing `\\?'. |
| 1217 | NEXTEXT, FIXEDCASE, LITERAL are just passed on. If NOEDIT is true, no | 1217 | NEWTEXT, FIXEDCASE, LITERAL are just passed on. If NOEDIT is true, no |
| 1218 | check for `\\?' is made to save time. MATCH-DATA is used for the | 1218 | check for `\\?' is made to save time. MATCH-DATA is used for the |
| 1219 | replacement. In case editing is done, it is changed to use markers. | 1219 | replacement. In case editing is done, it is changed to use markers. |
| 1220 | 1220 | ||
| @@ -1281,6 +1281,8 @@ make, or the user didn't cancel the call." | |||
| 1281 | ;; (match-data); otherwise it is t if a match is possible at point. | 1281 | ;; (match-data); otherwise it is t if a match is possible at point. |
| 1282 | (match-again t) | 1282 | (match-again t) |
| 1283 | 1283 | ||
| 1284 | (isearch-string isearch-string) | ||
| 1285 | (isearch-regexp isearch-regexp) | ||
| 1284 | (message | 1286 | (message |
| 1285 | (if query-flag | 1287 | (if query-flag |
| 1286 | (substitute-command-keys | 1288 | (substitute-command-keys |
| @@ -1313,6 +1315,10 @@ make, or the user didn't cancel the call." | |||
| 1313 | (if regexp-flag from-string | 1315 | (if regexp-flag from-string |
| 1314 | (regexp-quote from-string)) | 1316 | (regexp-quote from-string)) |
| 1315 | "\\b"))) | 1317 | "\\b"))) |
| 1318 | (if (eq query-replace-highlight 'isearch) | ||
| 1319 | (setq isearch-string search-string | ||
| 1320 | isearch-regexp regexp-flag)) | ||
| 1321 | |||
| 1316 | (push-mark) | 1322 | (push-mark) |
| 1317 | (undo-boundary) | 1323 | (undo-boundary) |
| 1318 | (unwind-protect | 1324 | (unwind-protect |
| @@ -1380,7 +1386,7 @@ make, or the user didn't cancel the call." | |||
| 1380 | (if (not query-flag) | 1386 | (if (not query-flag) |
| 1381 | (let ((inhibit-read-only | 1387 | (let ((inhibit-read-only |
| 1382 | query-replace-skip-read-only)) | 1388 | query-replace-skip-read-only)) |
| 1383 | (unless noedit | 1389 | (unless (or literal noedit) |
| 1384 | (replace-highlight (nth 0 real-match-data) | 1390 | (replace-highlight (nth 0 real-match-data) |
| 1385 | (nth 1 real-match-data))) | 1391 | (nth 1 real-match-data))) |
| 1386 | (setq noedit | 1392 | (setq noedit |
| @@ -1528,7 +1534,14 @@ make, or the user didn't cancel the call." | |||
| 1528 | (setq unread-command-events | 1534 | (setq unread-command-events |
| 1529 | (append (listify-key-sequence key) | 1535 | (append (listify-key-sequence key) |
| 1530 | unread-command-events)) | 1536 | unread-command-events)) |
| 1531 | (setq done t)))) | 1537 | (setq done t))) |
| 1538 | (when (eq query-replace-highlight 'isearch) | ||
| 1539 | ;; Force isearch rehighlighting | ||
| 1540 | (if (not (memq def '(skip backup))) | ||
| 1541 | (setq isearch-lazy-highlight-last-string nil)) | ||
| 1542 | ;; Restore isearch data in case of isearching during edit | ||
| 1543 | (setq isearch-string search-string | ||
| 1544 | isearch-regexp regexp-flag))) | ||
| 1532 | ;; Record previous position for ^ when we move on. | 1545 | ;; Record previous position for ^ when we move on. |
| 1533 | ;; Change markers to numbers in the match data | 1546 | ;; Change markers to numbers in the match data |
| 1534 | ;; since lots of markers slow down editing. | 1547 | ;; since lots of markers slow down editing. |
| @@ -1563,27 +1576,38 @@ make, or the user didn't cancel the call." | |||
| 1563 | (if (= replace-count 1) "" "s"))) | 1576 | (if (= replace-count 1) "" "s"))) |
| 1564 | (and keep-going stack))) | 1577 | (and keep-going stack))) |
| 1565 | 1578 | ||
| 1566 | (defcustom query-replace-highlight t | 1579 | (defcustom query-replace-highlight |
| 1567 | "*Non-nil means to highlight words during query replacement." | 1580 | (if (and search-highlight isearch-lazy-highlight) 'isearch t) |
| 1568 | :type 'boolean | 1581 | "*Non-nil means to highlight words during query replacement. |
| 1582 | If `isearch', use isearch highlighting for query replacement." | ||
| 1583 | :type '(choice (const :tag "Highlight" t) | ||
| 1584 | (const :tag "No highlighting" nil) | ||
| 1585 | (const :tag "Isearch highlighting" 'isearch)) | ||
| 1569 | :group 'matching) | 1586 | :group 'matching) |
| 1570 | 1587 | ||
| 1571 | (defvar replace-overlay nil) | 1588 | (defvar replace-overlay nil) |
| 1572 | 1589 | ||
| 1573 | (defun replace-dehighlight () | 1590 | (defun replace-dehighlight () |
| 1574 | (and replace-overlay | 1591 | (cond ((eq query-replace-highlight 'isearch) |
| 1575 | (progn | 1592 | (isearch-dehighlight t) |
| 1576 | (delete-overlay replace-overlay) | 1593 | (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup) |
| 1577 | (setq replace-overlay nil)))) | 1594 | (setq isearch-lazy-highlight-last-string nil)) |
| 1595 | (query-replace-highlight | ||
| 1596 | (when replace-overlay | ||
| 1597 | (delete-overlay replace-overlay) | ||
| 1598 | (setq replace-overlay nil))))) | ||
| 1578 | 1599 | ||
| 1579 | (defun replace-highlight (start end) | 1600 | (defun replace-highlight (start end) |
| 1580 | (and query-replace-highlight | 1601 | (cond ((eq query-replace-highlight 'isearch) |
| 1581 | (if replace-overlay | 1602 | (isearch-highlight start end) |
| 1582 | (move-overlay replace-overlay start end (current-buffer)) | 1603 | (isearch-lazy-highlight-new-loop)) |
| 1583 | (setq replace-overlay (make-overlay start end)) | 1604 | (query-replace-highlight |
| 1584 | (overlay-put replace-overlay 'face | 1605 | (if replace-overlay |
| 1585 | (if (facep 'query-replace) | 1606 | (move-overlay replace-overlay start end (current-buffer)) |
| 1586 | 'query-replace 'region))))) | 1607 | (setq replace-overlay (make-overlay start end)) |
| 1608 | (overlay-put replace-overlay 'face | ||
| 1609 | (if (facep 'query-replace) | ||
| 1610 | 'query-replace 'region)))))) | ||
| 1587 | 1611 | ||
| 1588 | ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 | 1612 | ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 |
| 1589 | ;;; replace.el ends here | 1613 | ;;; replace.el ends here |
diff --git a/lisp/simple.el b/lisp/simple.el index 979f3835c57..4a95b18bcb9 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -123,33 +123,33 @@ to navigate in it.") | |||
| 123 | 123 | ||
| 124 | (make-variable-buffer-local 'next-error-function) | 124 | (make-variable-buffer-local 'next-error-function) |
| 125 | 125 | ||
| 126 | (defsubst next-error-buffer-p (buffer | 126 | (defsubst next-error-buffer-p (buffer |
| 127 | &optional | 127 | &optional |
| 128 | extra-test-inclusive | 128 | extra-test-inclusive |
| 129 | extra-test-exclusive) | 129 | extra-test-exclusive) |
| 130 | "Test if BUFFER is a next-error capable buffer. | 130 | "Test if BUFFER is a next-error capable buffer. |
| 131 | EXTRA-TEST-INCLUSIVE is called to allow extra buffers. | 131 | EXTRA-TEST-INCLUSIVE is called to allow extra buffers. |
| 132 | EXTRA-TEST-INCLUSIVE is called to disallow buffers." | 132 | EXTRA-TEST-EXCLUSIVE is called to disallow buffers." |
| 133 | (with-current-buffer buffer | 133 | (with-current-buffer buffer |
| 134 | (or (and extra-test-inclusive (funcall extra-test-inclusive)) | 134 | (or (and extra-test-inclusive (funcall extra-test-inclusive)) |
| 135 | (and (if extra-test-exclusive (funcall extra-test-exclusive) t) | 135 | (and (if extra-test-exclusive (funcall extra-test-exclusive) t) |
| 136 | next-error-function)))) | 136 | next-error-function)))) |
| 137 | 137 | ||
| 138 | (defun next-error-find-buffer (&optional other-buffer | 138 | (defun next-error-find-buffer (&optional other-buffer |
| 139 | extra-test-inclusive | 139 | extra-test-inclusive |
| 140 | extra-test-exclusive) | 140 | extra-test-exclusive) |
| 141 | "Return a next-error capable buffer. | 141 | "Return a next-error capable buffer. |
| 142 | OTHER-BUFFER will disallow the current buffer. | 142 | OTHER-BUFFER will disallow the current buffer. |
| 143 | EXTRA-TEST-INCLUSIVE is called to allow extra buffers. | 143 | EXTRA-TEST-INCLUSIVE is called to allow extra buffers. |
| 144 | EXTRA-TEST-INCLUSIVE is called to disallow buffers." | 144 | EXTRA-TEST-EXCLUSIVE is called to disallow buffers." |
| 145 | (or | 145 | (or |
| 146 | ;; 1. If one window on the selected frame displays such buffer, return it. | 146 | ;; 1. If one window on the selected frame displays such buffer, return it. |
| 147 | (let ((window-buffers | 147 | (let ((window-buffers |
| 148 | (delete-dups | 148 | (delete-dups |
| 149 | (delq nil (mapcar (lambda (w) | 149 | (delq nil (mapcar (lambda (w) |
| 150 | (if (next-error-buffer-p | 150 | (if (next-error-buffer-p |
| 151 | (window-buffer w) | 151 | (window-buffer w) |
| 152 | extra-test-inclusive extra-test-exclusive) | 152 | extra-test-inclusive extra-test-exclusive) |
| 153 | (window-buffer w))) | 153 | (window-buffer w))) |
| 154 | (window-list)))))) | 154 | (window-list)))))) |
| 155 | (if other-buffer | 155 | (if other-buffer |
| @@ -159,29 +159,29 @@ EXTRA-TEST-INCLUSIVE is called to disallow buffers." | |||
| 159 | ;; 2. If next-error-last-buffer is set to a live buffer, use that. | 159 | ;; 2. If next-error-last-buffer is set to a live buffer, use that. |
| 160 | (if (and next-error-last-buffer | 160 | (if (and next-error-last-buffer |
| 161 | (buffer-name next-error-last-buffer) | 161 | (buffer-name next-error-last-buffer) |
| 162 | (next-error-buffer-p next-error-last-buffer | 162 | (next-error-buffer-p next-error-last-buffer |
| 163 | extra-test-inclusive extra-test-exclusive) | 163 | extra-test-inclusive extra-test-exclusive) |
| 164 | (or (not other-buffer) | 164 | (or (not other-buffer) |
| 165 | (not (eq next-error-last-buffer (current-buffer))))) | 165 | (not (eq next-error-last-buffer (current-buffer))))) |
| 166 | next-error-last-buffer) | 166 | next-error-last-buffer) |
| 167 | ;; 3. If the current buffer is a next-error capable buffer, return it. | 167 | ;; 3. If the current buffer is a next-error capable buffer, return it. |
| 168 | (if (and (not other-buffer) | 168 | (if (and (not other-buffer) |
| 169 | (next-error-buffer-p (current-buffer) | 169 | (next-error-buffer-p (current-buffer) |
| 170 | extra-test-inclusive extra-test-exclusive)) | 170 | extra-test-inclusive extra-test-exclusive)) |
| 171 | (current-buffer)) | 171 | (current-buffer)) |
| 172 | ;; 4. Look for a next-error capable buffer in a buffer list. | 172 | ;; 4. Look for a next-error capable buffer in a buffer list. |
| 173 | (let ((buffers (buffer-list))) | 173 | (let ((buffers (buffer-list))) |
| 174 | (while (and buffers | 174 | (while (and buffers |
| 175 | (or (not (next-error-buffer-p | 175 | (or (not (next-error-buffer-p |
| 176 | (car buffers) | 176 | (car buffers) |
| 177 | extra-test-inclusive extra-test-exclusive)) | 177 | extra-test-inclusive extra-test-exclusive)) |
| 178 | (and other-buffer (eq (car buffers) (current-buffer))))) | 178 | (and other-buffer (eq (car buffers) (current-buffer))))) |
| 179 | (setq buffers (cdr buffers))) | 179 | (setq buffers (cdr buffers))) |
| 180 | (if buffers | 180 | (if buffers |
| 181 | (car buffers) | 181 | (car buffers) |
| 182 | (or (and other-buffer | 182 | (or (and other-buffer |
| 183 | (next-error-buffer-p (current-buffer) | 183 | (next-error-buffer-p (current-buffer) |
| 184 | extra-test-inclusive extra-test-exclusive) | 184 | extra-test-inclusive extra-test-exclusive) |
| 185 | ;; The current buffer is a next-error capable buffer. | 185 | ;; The current buffer is a next-error capable buffer. |
| 186 | (progn | 186 | (progn |
| 187 | (if other-buffer | 187 | (if other-buffer |
| @@ -646,7 +646,8 @@ If BACKWARD-ONLY is non-nil, only delete spaces before point." | |||
| 646 | (constrain-to-field nil orig-pos t))))) | 646 | (constrain-to-field nil orig-pos t))))) |
| 647 | 647 | ||
| 648 | (defvar inhibit-mark-movement nil | 648 | (defvar inhibit-mark-movement nil |
| 649 | "If non-nil, \\[beginning-of-buffer] and \\[end-of-buffer] does not set the mark.") | 649 | "If non-nil, movement commands, such as \\[beginning-of-buffer], \ |
| 650 | do not set the mark.") | ||
| 650 | 651 | ||
| 651 | (defun beginning-of-buffer (&optional arg) | 652 | (defun beginning-of-buffer (&optional arg) |
| 652 | "Move point to the beginning of the buffer; leave mark at previous position. | 653 | "Move point to the beginning of the buffer; leave mark at previous position. |
| @@ -659,8 +660,10 @@ of the accessible part of the buffer. | |||
| 659 | Don't use this command in Lisp programs! | 660 | Don't use this command in Lisp programs! |
| 660 | \(goto-char (point-min)) is faster and avoids clobbering the mark." | 661 | \(goto-char (point-min)) is faster and avoids clobbering the mark." |
| 661 | (interactive "P") | 662 | (interactive "P") |
| 662 | (unless (or inhibit-mark-movement (consp arg)) | 663 | (or inhibit-mark-movement |
| 663 | (push-mark)) | 664 | (consp arg) |
| 665 | (and transient-mark-mode mark-active) | ||
| 666 | (push-mark)) | ||
| 664 | (let ((size (- (point-max) (point-min)))) | 667 | (let ((size (- (point-max) (point-min)))) |
| 665 | (goto-char (if (and arg (not (consp arg))) | 668 | (goto-char (if (and arg (not (consp arg))) |
| 666 | (+ (point-min) | 669 | (+ (point-min) |
| @@ -683,8 +686,10 @@ of the accessible part of the buffer. | |||
| 683 | Don't use this command in Lisp programs! | 686 | Don't use this command in Lisp programs! |
| 684 | \(goto-char (point-max)) is faster and avoids clobbering the mark." | 687 | \(goto-char (point-max)) is faster and avoids clobbering the mark." |
| 685 | (interactive "P") | 688 | (interactive "P") |
| 686 | (unless (or inhibit-mark-movement (consp arg)) | 689 | (or inhibit-mark-movement |
| 687 | (push-mark)) | 690 | (consp arg) |
| 691 | (and transient-mark-mode mark-active) | ||
| 692 | (push-mark)) | ||
| 688 | (let ((size (- (point-max) (point-min)))) | 693 | (let ((size (- (point-max) (point-min)))) |
| 689 | (goto-char (if (and arg (not (consp arg))) | 694 | (goto-char (if (and arg (not (consp arg))) |
| 690 | (- (point-max) | 695 | (- (point-max) |
| @@ -2987,11 +2992,11 @@ You can also deactivate the mark by typing \\[keyboard-quit] or | |||
| 2987 | Many commands change their behavior when Transient Mark mode is in effect | 2992 | Many commands change their behavior when Transient Mark mode is in effect |
| 2988 | and the mark is active, by acting on the region instead of their usual | 2993 | and the mark is active, by acting on the region instead of their usual |
| 2989 | default part of the buffer's text. Examples of such commands include | 2994 | default part of the buffer's text. Examples of such commands include |
| 2990 | \\[comment-dwim], \\[flush-lines], \\[ispell], \\[keep-lines], | 2995 | \\[comment-dwim], \\[flush-lines], \\[keep-lines], \ |
| 2991 | \\[query-replace], \\[query-replace-regexp], and \\[undo]. Invoke | 2996 | \\[query-replace], \\[query-replace-regexp], \\[ispell], and \\[undo]. |
| 2992 | \\[apropos-documentation] and type \"transient\" or \"mark.*active\" at | 2997 | Invoke \\[apropos-documentation] and type \"transient\" or |
| 2993 | the prompt, to see the documentation of commands which are sensitive to | 2998 | \"mark.*active\" at the prompt, to see the documentation of |
| 2994 | the Transient Mark mode." | 2999 | commands which are sensitive to the Transient Mark mode." |
| 2995 | :global t :group 'editing-basics :require nil) | 3000 | :global t :group 'editing-basics :require nil) |
| 2996 | 3001 | ||
| 2997 | (defun pop-global-mark () | 3002 | (defun pop-global-mark () |
| @@ -3242,7 +3247,7 @@ Outline mode sets this." | |||
| 3242 | (if (if forward | 3247 | (if (if forward |
| 3243 | ;; If going forward, don't accept the previous | 3248 | ;; If going forward, don't accept the previous |
| 3244 | ;; allowable position if it is before the target line. | 3249 | ;; allowable position if it is before the target line. |
| 3245 | (< line-beg (point)) | 3250 | (< line-beg (point)) |
| 3246 | ;; If going backward, don't accept the previous | 3251 | ;; If going backward, don't accept the previous |
| 3247 | ;; allowable position if it is still after the target line. | 3252 | ;; allowable position if it is still after the target line. |
| 3248 | (<= (point) line-end)) | 3253 | (<= (point) line-end)) |
| @@ -3523,12 +3528,17 @@ With argument, do this that many times." | |||
| 3523 | (interactive "p") | 3528 | (interactive "p") |
| 3524 | (forward-word (- (or arg 1)))) | 3529 | (forward-word (- (or arg 1)))) |
| 3525 | 3530 | ||
| 3526 | (defun mark-word (arg) | 3531 | (defun mark-word (&optional arg) |
| 3527 | "Set mark arg words away from point. | 3532 | "Set mark ARG words away from point. |
| 3528 | If this command is repeated, it marks the next ARG words after the ones | 3533 | The place mark goes is the same place \\[forward-word] would |
| 3529 | already marked." | 3534 | move to with the same argument. |
| 3530 | (interactive "p") | 3535 | If this command is repeated or mark is active in Transient Mark mode, |
| 3531 | (cond ((and (eq last-command this-command) (mark t)) | 3536 | it marks the next ARG words after the ones already marked." |
| 3537 | (interactive "P") | ||
| 3538 | (cond ((or (and (eq last-command this-command) (mark t)) | ||
| 3539 | (and transient-mark-mode mark-active)) | ||
| 3540 | (setq arg (if arg (prefix-numeric-value arg) | ||
| 3541 | (if (< (mark) (point)) -1 1))) | ||
| 3532 | (set-mark | 3542 | (set-mark |
| 3533 | (save-excursion | 3543 | (save-excursion |
| 3534 | (goto-char (mark)) | 3544 | (goto-char (mark)) |
| @@ -3537,7 +3547,7 @@ already marked." | |||
| 3537 | (t | 3547 | (t |
| 3538 | (push-mark | 3548 | (push-mark |
| 3539 | (save-excursion | 3549 | (save-excursion |
| 3540 | (forward-word arg) | 3550 | (forward-word (prefix-numeric-value arg)) |
| 3541 | (point)) | 3551 | (point)) |
| 3542 | nil t)))) | 3552 | nil t)))) |
| 3543 | 3553 | ||
| @@ -4021,8 +4031,7 @@ or go back to just one window (by deleting all but the selected window)." | |||
| 4021 | (abort-recursive-edit)) | 4031 | (abort-recursive-edit)) |
| 4022 | (current-prefix-arg | 4032 | (current-prefix-arg |
| 4023 | nil) | 4033 | nil) |
| 4024 | ((and transient-mark-mode | 4034 | ((and transient-mark-mode mark-active) |
| 4025 | mark-active) | ||
| 4026 | (deactivate-mark)) | 4035 | (deactivate-mark)) |
| 4027 | ((> (recursion-depth) 0) | 4036 | ((> (recursion-depth) 0) |
| 4028 | (exit-recursive-edit)) | 4037 | (exit-recursive-edit)) |
diff --git a/lisp/subr.el b/lisp/subr.el index 4c695ea167d..c20eaad9c56 100644 --- a/lisp/subr.el +++ b/lisp/subr.el | |||
| @@ -1862,6 +1862,19 @@ is allowed once again." | |||
| 1862 | ,@body) | 1862 | ,@body) |
| 1863 | (quit (setq quit-flag t) nil))) | 1863 | (quit (setq quit-flag t) nil))) |
| 1864 | 1864 | ||
| 1865 | (defmacro while-no-input (&rest body) | ||
| 1866 | "Execute BODY only as long as there's no pending input. | ||
| 1867 | If input arrives, that ends the execution of BODY, | ||
| 1868 | and `while-no-input' returns nil. If BODY finishes, | ||
| 1869 | `while-no-input' returns whatever value BODY produced." | ||
| 1870 | (declare (debug t) (indent 0)) | ||
| 1871 | (let ((catch-sym (make-symbol "input"))) | ||
| 1872 | `(with-local-quit | ||
| 1873 | (catch ',catch-sym | ||
| 1874 | (let ((throw-on-input ',catch-sym)) | ||
| 1875 | (when (sit-for 0 0 t) | ||
| 1876 | ,@body)))))) | ||
| 1877 | |||
| 1865 | (defmacro combine-after-change-calls (&rest body) | 1878 | (defmacro combine-after-change-calls (&rest body) |
| 1866 | "Execute BODY, but don't call the after-change functions till the end. | 1879 | "Execute BODY, but don't call the after-change functions till the end. |
| 1867 | If BODY makes changes in the buffer, they are recorded | 1880 | If BODY makes changes in the buffer, they are recorded |
diff --git a/lisp/term.el b/lisp/term.el index 8f3ba77daf5..32e249024d9 100644 --- a/lisp/term.el +++ b/lisp/term.el | |||
| @@ -1400,7 +1400,7 @@ The main purpose is to get rid of the local keymap." | |||
| 1400 | :kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E[5~:@7=\\E[4~:kh=\\E[1~\ | 1400 | :kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E[5~:@7=\\E[4~:kh=\\E[1~\ |
| 1401 | :mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#8:pa#64:AB=\\E[4%%dm:AF=\\E[3%%dm:cr=^M\ | 1401 | :mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#8:pa#64:AB=\\E[4%%dm:AF=\\E[3%%dm:cr=^M\ |
| 1402 | :bl=^G:do=^J:le=^H:ta=^I:se=\E[27m:ue=\E24m\ | 1402 | :bl=^G:do=^J:le=^H:ta=^I:se=\E[27m:ue=\E24m\ |
| 1403 | :kb=^?:kD=^[[3~:sc=\E7:rc=\E8:" | 1403 | :kb=^?:kD=^[[3~:sc=\E7:rc=\E8:r1=\Ec:" |
| 1404 | ;;; : -undefine ic | 1404 | ;;; : -undefine ic |
| 1405 | ;;; don't define :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\ | 1405 | ;;; don't define :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\ |
| 1406 | "termcap capabilities supported") | 1406 | "termcap capabilities supported") |
| @@ -2891,6 +2891,10 @@ See `term-prompt-regexp'." | |||
| 2891 | (term-goto (car term-saved-cursor) | 2891 | (term-goto (car term-saved-cursor) |
| 2892 | (cdr term-saved-cursor))) | 2892 | (cdr term-saved-cursor))) |
| 2893 | (setq term-terminal-state 0)) | 2893 | (setq term-terminal-state 0)) |
| 2894 | ((eq char ?c) ;; \Ec - Reset (terminfo: rs1) | ||
| 2895 | ;; This is used by the "clear" program. | ||
| 2896 | (setq term-terminal-state 0) | ||
| 2897 | (term-reset-terminal)) | ||
| 2894 | ;; The \E#8 reset sequence for xterm. We | 2898 | ;; The \E#8 reset sequence for xterm. We |
| 2895 | ;; probably don't need to handle it, but this | 2899 | ;; probably don't need to handle it, but this |
| 2896 | ;; is the code to parse it. | 2900 | ;; is the code to parse it. |
| @@ -3018,13 +3022,29 @@ See `term-prompt-regexp'." | |||
| 3018 | (set-marker term-home-marker (point)) | 3022 | (set-marker term-home-marker (point)) |
| 3019 | (setq term-current-row (1- term-height)))))) | 3023 | (setq term-current-row (1- term-height)))))) |
| 3020 | 3024 | ||
| 3025 | ;;; Reset the terminal, delete all the content and set the face to the | ||
| 3026 | ;;; default one. | ||
| 3027 | (defun term-reset-terminal () | ||
| 3028 | (erase-buffer) | ||
| 3029 | (setq term-current-row 1) | ||
| 3030 | (setq term-current-column 1) | ||
| 3031 | (setq term-insert-mode nil) | ||
| 3032 | (setq term-current-face nil) | ||
| 3033 | (setq term-ansi-current-underline 0) | ||
| 3034 | (setq term-ansi-current-bold 0) | ||
| 3035 | (setq term-ansi-current-reverse 0) | ||
| 3036 | (setq term-ansi-current-color 0) | ||
| 3037 | (setq term-ansi-current-invisible 0) | ||
| 3038 | (setq term-ansi-face-already-done 1) | ||
| 3039 | (setq term-ansi-current-bg-color 0)) | ||
| 3040 | |||
| 3021 | ;;; New function to deal with ansi colorized output, as you can see you can | 3041 | ;;; New function to deal with ansi colorized output, as you can see you can |
| 3022 | ;;; have any bold/underline/fg/bg/reverse combination. -mm | 3042 | ;;; have any bold/underline/fg/bg/reverse combination. -mm |
| 3023 | 3043 | ||
| 3024 | (defun term-handle-colors-array (parameter) | 3044 | (defun term-handle-colors-array (parameter) |
| 3025 | (cond | 3045 | (cond |
| 3026 | 3046 | ||
| 3027 | ;;; Bold | 3047 | ;;; Bold (terminfo: bold) |
| 3028 | ((eq parameter 1) | 3048 | ((eq parameter 1) |
| 3029 | (setq term-ansi-current-bold 1)) | 3049 | (setq term-ansi-current-bold 1)) |
| 3030 | 3050 | ||
diff --git a/lisp/textmodes/paragraphs.el b/lisp/textmodes/paragraphs.el index 206f7a42f78..353aa0ee8a2 100644 --- a/lisp/textmodes/paragraphs.el +++ b/lisp/textmodes/paragraphs.el | |||
| @@ -357,13 +357,15 @@ the number of paragraphs marked equals ARG. | |||
| 357 | If ARG is negative, point is put at end of this paragraph, mark is put | 357 | If ARG is negative, point is put at end of this paragraph, mark is put |
| 358 | at beginning of this or a previous paragraph. | 358 | at beginning of this or a previous paragraph. |
| 359 | 359 | ||
| 360 | If this command is repeated, it marks the next ARG paragraphs after (or | 360 | If this command is repeated or mark is active in Transient Mark mode, |
| 361 | before, if arg is negative) the ones already marked." | 361 | it marks the next ARG paragraphs after (or before, if arg is negative) |
| 362 | the ones already marked." | ||
| 362 | (interactive "p") | 363 | (interactive "p") |
| 363 | (unless arg (setq arg 1)) | 364 | (unless arg (setq arg 1)) |
| 364 | (when (zerop arg) | 365 | (when (zerop arg) |
| 365 | (error "Cannot mark zero paragraphs")) | 366 | (error "Cannot mark zero paragraphs")) |
| 366 | (cond ((and (eq last-command this-command) (mark t)) | 367 | (cond ((or (and (eq last-command this-command) (mark t)) |
| 368 | (and transient-mark-mode mark-active)) | ||
| 367 | (set-mark | 369 | (set-mark |
| 368 | (save-excursion | 370 | (save-excursion |
| 369 | (goto-char (mark)) | 371 | (goto-char (mark)) |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 48b5edb3a69..1f9336fef50 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1351,7 +1351,9 @@ Mark is left at original location." | |||
| 1351 | (when (eq (char-after) ?{) | 1351 | (when (eq (char-after) ?{) |
| 1352 | (let ((newpos (point))) | 1352 | (let ((newpos (point))) |
| 1353 | (when (ignore-errors (backward-sexp 1) t) | 1353 | (when (ignore-errors (backward-sexp 1) t) |
| 1354 | (if (looking-at "\\\\end\\>") | 1354 | (if (or (looking-at "\\\\end\\>") |
| 1355 | ;; In case the \\ ends a verbatim section. | ||
| 1356 | (and (looking-at "end\\>") (eq (char-before) ?\\))) | ||
| 1355 | (tex-last-unended-begin) | 1357 | (tex-last-unended-begin) |
| 1356 | (goto-char newpos)))))))) | 1358 | (goto-char newpos)))))))) |
| 1357 | 1359 | ||
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog index c9663baff8f..9bb5ef1c3e5 100644 --- a/lisp/url/ChangeLog +++ b/lisp/url/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2004-12-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * url-handlers.el: Don't `require' everything eagerly. | ||
| 4 | |||
| 1 | 2004-11-30 Paul Pogonyshev <pogonyshev@gmx.net> | 5 | 2004-11-30 Paul Pogonyshev <pogonyshev@gmx.net> |
| 2 | 6 | ||
| 3 | * url-http.el (url-http-handle-cookies): Bind `url-current-object' | 7 | * url-http.el (url-http-handle-cookies): Bind `url-current-object' |
| @@ -18,8 +22,7 @@ | |||
| 18 | 22 | ||
| 19 | 2004-11-12 Masatake YAMATO <jet@gyve.org> | 23 | 2004-11-12 Masatake YAMATO <jet@gyve.org> |
| 20 | 24 | ||
| 21 | * url-mailto.el (url-mailto): Fix a typo in the | 25 | * url-mailto.el (url-mailto): Fix a typo in the comment. |
| 22 | comment. | ||
| 23 | 26 | ||
| 24 | 2004-11-02 Masatake YAMATO <jet@gyve.org> | 27 | 2004-11-02 Masatake YAMATO <jet@gyve.org> |
| 25 | 28 | ||
| @@ -76,12 +79,12 @@ | |||
| 76 | 79 | ||
| 77 | * url-vars.el (url-passwd-entry-func): Var deleted. | 80 | * url-vars.el (url-passwd-entry-func): Var deleted. |
| 78 | (mm-mime-mule-charset-alist): Remove compatibility code for old Gnus. | 81 | (mm-mime-mule-charset-alist): Remove compatibility code for old Gnus. |
| 79 | (url-weekday-alist): Renamed from weekday-alist. | 82 | (url-weekday-alist): Rename from weekday-alist. |
| 80 | (url-monthabbrev-alist): Renamed from monthabbrev-alist. | 83 | (url-monthabbrev-alist): Rename from monthabbrev-alist. |
| 81 | (url-vars-unload-hook): Initialize hook var to hold the function. | 84 | (url-vars-unload-hook): Initialize hook var to hold the function. |
| 82 | 85 | ||
| 83 | * url-util.el (url-get-normalized-date): Use | 86 | * url-util.el (url-get-normalized-date): Use url-weekday-alist and |
| 84 | url-weekday-alist and url-monthabbrev-alist. | 87 | url-monthabbrev-alist. |
| 85 | 88 | ||
| 86 | * url-misc.el: Load cl at compile time. | 89 | * url-misc.el: Load cl at compile time. |
| 87 | 90 | ||
| @@ -99,8 +102,8 @@ | |||
| 99 | * url-news.el (url-snews): Use nntp-open-tls-stream if | 102 | * url-news.el (url-snews): Use nntp-open-tls-stream if |
| 100 | url-gateway-method is tls. | 103 | url-gateway-method is tls. |
| 101 | 104 | ||
| 102 | * url-ldap.el (url-ldap-certificate-formatter): Use | 105 | * url-ldap.el (url-ldap-certificate-formatter): |
| 103 | tls-certificate-information if ssl.el is not available. | 106 | Use tls-certificate-information if ssl.el is not available. |
| 104 | 107 | ||
| 105 | * url-https.el (url-https-create-secure-wrapper): Use tls if ssl | 108 | * url-https.el (url-https-create-secure-wrapper): Use tls if ssl |
| 106 | is not available. | 109 | is not available. |
diff --git a/lisp/url/url-handlers.el b/lisp/url/url-handlers.el index db961b9c27e..f90f21a3dbe 100644 --- a/lisp/url/url-handlers.el +++ b/lisp/url/url-handlers.el | |||
| @@ -25,11 +25,21 @@ | |||
| 25 | 25 | ||
| 26 | ;;; Code: | 26 | ;;; Code: |
| 27 | 27 | ||
| 28 | (require 'url) | 28 | ;; (require 'url) |
| 29 | (require 'url-parse) | 29 | (eval-when-compile (require 'url-parse)) |
| 30 | (require 'url-util) | 30 | ;; (require 'url-util) |
| 31 | (require 'mm-decode) | 31 | (eval-when-compile (require 'mm-decode)) |
| 32 | (require 'mailcap) | 32 | ;; (require 'mailcap) |
| 33 | ;; The following functions in the byte compiler's warnings are known not | ||
| 34 | ;; to cause any real problem for the following reasons: | ||
| 35 | ;; - mm-save-part-to-file, mm-destroy-parts: always used | ||
| 36 | ;; after mm-dissect-buffer and defined in the same file. | ||
| 37 | ;; The following are autoloaded instead of `require'd to avoid eagerly | ||
| 38 | ;; loading all of URL when turning on url-handler-mode in the .emacs. | ||
| 39 | (autoload 'url-retrieve-synchronously "url" "Retrieve url synchronously.") | ||
| 40 | (autoload 'url-expand-file-name "url-expand" "Convert url to a fully specified url, and canonicalize it.") | ||
| 41 | (autoload 'mm-dissect-buffer "mm-decode" "Dissect the current buffer and return a list of MIME handles.") | ||
| 42 | (autoload 'url-scheme-get-property "url-methods" "Get property of a URL SCHEME.") | ||
| 33 | 43 | ||
| 34 | (eval-when-compile | 44 | (eval-when-compile |
| 35 | (require 'cl)) | 45 | (require 'cl)) |
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el index fafb5eff7cd..cbb951d60b7 100644 --- a/lisp/vc-svn.el +++ b/lisp/vc-svn.el | |||
| @@ -447,10 +447,14 @@ and that it passes `vc-svn-global-switches' to it before FLAGS." | |||
| 447 | (vc-insert-file (expand-file-name ".svn/entries" dirname))) | 447 | (vc-insert-file (expand-file-name ".svn/entries" dirname))) |
| 448 | (goto-char (point-min)) | 448 | (goto-char (point-min)) |
| 449 | (when (re-search-forward | 449 | (when (re-search-forward |
| 450 | (concat "name=\"svn:this_dir\"[\n\t ]*" | 450 | ;; Old `svn' used name="svn:dir", newer use just name="". |
| 451 | "\\([-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?" | 451 | (concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*" |
| 452 | "\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?" | ||
| 452 | "url=\"\\([^\"]+\\)\"") nil t) | 453 | "url=\"\\([^\"]+\\)\"") nil t) |
| 453 | (match-string 2)))) | 454 | ;; This is not a hostname but a URL. This may actually be considered |
| 455 | ;; as a feature since it allows vc-svn-stay-local to specify different | ||
| 456 | ;; behavior for different modules on the same server. | ||
| 457 | (match-string 1)))) | ||
| 454 | 458 | ||
| 455 | (defun vc-svn-parse-status (localp) | 459 | (defun vc-svn-parse-status (localp) |
| 456 | "Parse output of \"svn status\" command in the current buffer. | 460 | "Parse output of \"svn status\" command in the current buffer. |
| @@ -505,6 +509,30 @@ essential information." | |||
| 505 | (and (string-match "^[0-9]" tag) | 509 | (and (string-match "^[0-9]" tag) |
| 506 | (not (string-match "[^0-9]" tag)))) | 510 | (not (string-match "[^0-9]" tag)))) |
| 507 | 511 | ||
| 512 | ;; Support for `svn annotate' | ||
| 513 | |||
| 514 | (defun vc-svn-annotate-command (file buf &optional rev) | ||
| 515 | (vc-svn-command buf 0 file "annotate" (if rev (concat "-r" rev)))) | ||
| 516 | |||
| 517 | (defun vc-svn-annotate-time-of-rev (rev) | ||
| 518 | ;; Arbitrarily assume 10 commmits per day. | ||
| 519 | (/ (string-to-number rev) 10.0)) | ||
| 520 | |||
| 521 | (defun vc-svn-annotate-current-time () | ||
| 522 | (vc-svn-annotate-time-of-rev vc-annotate-parent-rev)) | ||
| 523 | |||
| 524 | (defconst vc-svn-annotate-re "[ \t]*\\([0-9]+\\)[ \t]+[^\t ]+ ") | ||
| 525 | |||
| 526 | (defun vc-svn-annotate-time () | ||
| 527 | (when (looking-at vc-svn-annotate-re) | ||
| 528 | (goto-char (match-end 0)) | ||
| 529 | (vc-svn-annotate-time-of-rev (match-string 1)))) | ||
| 530 | |||
| 531 | (defun vc-svn-annotate-extract-revision-at-line () | ||
| 532 | (save-excursion | ||
| 533 | (beginning-of-line) | ||
| 534 | (if (looking-at vc-svn-annotate-re) (match-string 1)))) | ||
| 535 | |||
| 508 | (provide 'vc-svn) | 536 | (provide 'vc-svn) |
| 509 | 537 | ||
| 510 | ;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d | 538 | ;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d |
diff --git a/lisp/xml.el b/lisp/xml.el index aba84d33230..daf5689c18b 100644 --- a/lisp/xml.el +++ b/lisp/xml.el | |||
| @@ -179,6 +179,8 @@ If PARSE-NS is non-nil, then QNAMES are expanded." | |||
| 179 | xml))) | 179 | xml))) |
| 180 | 180 | ||
| 181 | 181 | ||
| 182 | (defvar xml-name-re) | ||
| 183 | (defvar xml-entity-value-re) | ||
| 182 | (let* ((start-chars (concat "[:alpha:]:_")) | 184 | (let* ((start-chars (concat "[:alpha:]:_")) |
| 183 | (name-chars (concat "-[:digit:]." start-chars)) | 185 | (name-chars (concat "-[:digit:]." start-chars)) |
| 184 | ;;[3] S ::= (#x20 | #x9 | #xD | #xA)+ | 186 | ;;[3] S ::= (#x20 | #x9 | #xD | #xA)+ |
diff --git a/lisp/xt-mouse.el b/lisp/xt-mouse.el index a261d3d36c8..19b58475a93 100644 --- a/lisp/xt-mouse.el +++ b/lisp/xt-mouse.el | |||
| @@ -139,12 +139,13 @@ | |||
| 139 | default-header-line-format) | 139 | default-header-line-format) |
| 140 | 1 | 140 | 1 |
| 141 | 0))) | 141 | 0))) |
| 142 | (move-to-column (+ (car where) (current-column) | 142 | (move-to-column (- (+ (car where) (current-column) |
| 143 | (if (string-match "\\` \\*Minibuf" | 143 | (if (string-match "\\` \\*Minibuf" |
| 144 | (buffer-name)) | 144 | (buffer-name)) |
| 145 | (- (minibuffer-prompt-width)) | 145 | (- (minibuffer-prompt-width)) |
| 146 | 0) | 146 | 0) |
| 147 | (max 0 (1- (window-hscroll))))) | 147 | (max 0 (1- (window-hscroll)))) |
| 148 | left-margin-width)) | ||
| 148 | (point)) | 149 | (point)) |
| 149 | where)) | 150 | where)) |
| 150 | (mouse (intern | 151 | (mouse (intern |
diff --git a/lispref/ChangeLog b/lispref/ChangeLog index fa882bf0f82..6944d2af6c5 100644 --- a/lispref/ChangeLog +++ b/lispref/ChangeLog | |||
| @@ -1,3 +1,29 @@ | |||
| 1 | 2004-12-11 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * display.texi (Line Height): Rewrite text for clarity. | ||
| 4 | |||
| 5 | 2004-12-11 Kim F. Storm <storm@cua.dk> | ||
| 6 | |||
| 7 | * display.texi (Display): Add node "Line Height" to menu. | ||
| 8 | (Line Height): New node. Move full description of line-spacing | ||
| 9 | and line-height text properties here from text.texi. | ||
| 10 | (Scroll Bars): Add vertical-scroll-bar variable. | ||
| 11 | |||
| 12 | * frames.texi (Window Frame Parameters): Remove line-height defvar. | ||
| 13 | |||
| 14 | * locals.texi (Standard Buffer-Local Variables): Fix xref for | ||
| 15 | line-spacing and vertical-scroll-bar. | ||
| 16 | |||
| 17 | * text.texi (Special Properties): Just mention line-spacing and | ||
| 18 | line-height here, add xref to new "Line Height" node. | ||
| 19 | |||
| 20 | 2004-12-09 Thien-Thi Nguyen <ttn@gnu.org> | ||
| 21 | |||
| 22 | * frames.texi (Window Frame Parameters): New @defvar for `line-spacing'. | ||
| 23 | |||
| 24 | * locals.texi (Standard Buffer-Local Variables): | ||
| 25 | Add @xref for `line-spacing'. | ||
| 26 | |||
| 1 | 2004-12-05 Richard M. Stallman <rms@gnu.org> | 27 | 2004-12-05 Richard M. Stallman <rms@gnu.org> |
| 2 | 28 | ||
| 3 | * Makefile.in (maintainer-clean): Remove the info files | 29 | * Makefile.in (maintainer-clean): Remove the info files |
diff --git a/lispref/display.texi b/lispref/display.texi index cd836023aac..04d478b9b2a 100644 --- a/lispref/display.texi +++ b/lispref/display.texi | |||
| @@ -23,6 +23,7 @@ that Emacs presents to the user. | |||
| 23 | * Temporary Displays:: Displays that go away automatically. | 23 | * Temporary Displays:: Displays that go away automatically. |
| 24 | * Overlays:: Use overlays to highlight parts of the buffer. | 24 | * Overlays:: Use overlays to highlight parts of the buffer. |
| 25 | * Width:: How wide a character or string is on the screen. | 25 | * Width:: How wide a character or string is on the screen. |
| 26 | * Line Height:: Controlling the height of lines. | ||
| 26 | * Faces:: A face defines a graphics style for text characters: | 27 | * Faces:: A face defines a graphics style for text characters: |
| 27 | font, colors, etc. | 28 | font, colors, etc. |
| 28 | * Fringes:: Controlling window fringes. | 29 | * Fringes:: Controlling window fringes. |
| @@ -1510,6 +1511,98 @@ the beginning of the result if one multi-column character in | |||
| 1510 | @end example | 1511 | @end example |
| 1511 | @end defun | 1512 | @end defun |
| 1512 | 1513 | ||
| 1514 | @node Line Height | ||
| 1515 | @section Line Height | ||
| 1516 | @cindex line height | ||
| 1517 | |||
| 1518 | The total height of each display line consists of the height of the | ||
| 1519 | contents of the line, and additional vertical line spacing below the | ||
| 1520 | display row. | ||
| 1521 | |||
| 1522 | The height of the line contents is normally determined from the | ||
| 1523 | maximum height of any character or image on that display line, | ||
| 1524 | including the final newline if there is one. (A line that is | ||
| 1525 | continued doesn't include a final newline.) In the most common case, | ||
| 1526 | the line height equals the height of the default frame font. | ||
| 1527 | |||
| 1528 | There are several ways to explicitly control or change the line | ||
| 1529 | height, either by specifying an absolute height for the display line, | ||
| 1530 | or by adding additional vertical space below one or all lines. | ||
| 1531 | |||
| 1532 | @kindex line-height @r{(text property)} | ||
| 1533 | A newline can have a @code{line-height} text or overlay property | ||
| 1534 | that controls the total height of the display line ending in that | ||
| 1535 | newline. If the property value is zero, the displayed height of the | ||
| 1536 | line is exactly what its contents need; no line-spacing is added. | ||
| 1537 | This case is useful for tiling small images or image slices without | ||
| 1538 | adding blank areas between the images. | ||
| 1539 | |||
| 1540 | If the property value is not zero, it specifies a desired height, | ||
| 1541 | @var{line-height}. There are several ways it can do this: | ||
| 1542 | |||
| 1543 | @table @code | ||
| 1544 | @item @var{integer} | ||
| 1545 | If the property is a positive integer, @var{line-height} is that integer. | ||
| 1546 | @item @var{float} | ||
| 1547 | If the property is a float, @var{float}, @var{line-height} is @var{float} | ||
| 1548 | times the frame's default line height. | ||
| 1549 | @item (@var{ratio} . @var{face}) | ||
| 1550 | If the property is a cons of the format shown, @var{line-height} is | ||
| 1551 | @var{ratio} times the height of face @var{face}. @var{ratio} can be | ||
| 1552 | any type of number. If @var{face} is @code{t}, it refers to the | ||
| 1553 | current face. | ||
| 1554 | @end table | ||
| 1555 | |||
| 1556 | Thus, any valid nonzero property value specifies a height in pixels, | ||
| 1557 | @var{line-height}, one way or another. If the line contents' height | ||
| 1558 | is less than @var{line-height}, Emacs adds extra vertical space above | ||
| 1559 | the line to achieve the total height @var{line-height}. Otherwise, | ||
| 1560 | @var{line-height} has no effect. | ||
| 1561 | |||
| 1562 | If you don't specify the @code{line-height} propery, the line's | ||
| 1563 | height consists of the contents' height plus the line spacing. | ||
| 1564 | |||
| 1565 | @vindex default-line-spacing | ||
| 1566 | You can specify the line spacing for all lines in a frame with the | ||
| 1567 | @code{line-spacing} frame parameter, @xref{Window Frame Parameters}. | ||
| 1568 | However, if the variable @code{default-line-spacing} is | ||
| 1569 | non-@code{nil}, it overrides the frame's @code{line-spacing} | ||
| 1570 | parameter. An integer value specifies the number of pixels put below | ||
| 1571 | lines on window systems. A floating point number specifies the | ||
| 1572 | spacing relative to the frame's default line height. | ||
| 1573 | |||
| 1574 | @vindex line-spacing | ||
| 1575 | You can specify the line spacing for all lines in a buffer via the | ||
| 1576 | buffer-local @code{line-spacing} variable. An integer value specifies | ||
| 1577 | the number of pixels put below lines on window systems. A floating | ||
| 1578 | point number specifies the spacing relative to the default frame line | ||
| 1579 | height. This overrides line spacings specified for the frame. | ||
| 1580 | |||
| 1581 | @kindex line-spacing @r{(text property)} | ||
| 1582 | Finally, a newline can have a @code{line-spacing} text or overlay | ||
| 1583 | property that controls the height of the display line ending with that | ||
| 1584 | newline. The property value overrides the default frame line spacing | ||
| 1585 | and the buffer local @code{line-spacing} variable. | ||
| 1586 | |||
| 1587 | One way or another, these mechanisms specify a line spacing for each | ||
| 1588 | line. Let's call the value @var{line-spacing}. | ||
| 1589 | |||
| 1590 | If the @var{line-spacing} value is a positive integer, it specifies | ||
| 1591 | the number of pixels of additional vertical space. This space appears | ||
| 1592 | below the display line contents. | ||
| 1593 | |||
| 1594 | If the @var{line-spacing} value is a floating point number or cons, | ||
| 1595 | the additional vertical space is @var{line-spacing} times the frame | ||
| 1596 | default line height. | ||
| 1597 | |||
| 1598 | @ignore @c I think we may want to delete this, so don't document it -- rms. | ||
| 1599 | If the @var{line-spacing} value is a cons @code{(total . @var{spacing})} | ||
| 1600 | where @var{spacing} is any of the forms described above, the value of | ||
| 1601 | @var{spacing} specifies the total displayed height of the line, | ||
| 1602 | regardless of the height of the characters in it. This is equivalent | ||
| 1603 | to using the @code{line-height} property. | ||
| 1604 | @end ignore | ||
| 1605 | |||
| 1513 | @node Faces | 1606 | @node Faces |
| 1514 | @section Faces | 1607 | @section Faces |
| 1515 | @cindex faces | 1608 | @cindex faces |
| @@ -2826,7 +2919,14 @@ non-@code{nil} parameter value means they do. The frame parameter | |||
| 2826 | @code{scroll-bar-width} specifies how wide they are (@code{nil} | 2919 | @code{scroll-bar-width} specifies how wide they are (@code{nil} |
| 2827 | meaning the default). @xref{Window Frame Parameters}. | 2920 | meaning the default). @xref{Window Frame Parameters}. |
| 2828 | 2921 | ||
| 2829 | You can also control this for individual windows. Call the function | 2922 | @vindex vertical-scroll-bar |
| 2923 | You can enable or disable scroll bars for a particular buffer, | ||
| 2924 | by setting the variable @code{vertical-scroll-bar}. This variable | ||
| 2925 | automatically becomes buffer-local when set. The possible values are | ||
| 2926 | @code{left}, @code{right}, @code{t}, which means to use the | ||
| 2927 | frame's default, and @code{nil} for no scroll bar. | ||
| 2928 | |||
| 2929 | You can also control this for individual windows. Call the function | ||
| 2830 | @code{set-window-scroll-bars} to specify what to do for a specific window: | 2930 | @code{set-window-scroll-bars} to specify what to do for a specific window: |
| 2831 | 2931 | ||
| 2832 | @defun set-window-scroll-bars window width &optional vertical-type horizontal-type | 2932 | @defun set-window-scroll-bars window width &optional vertical-type horizontal-type |
diff --git a/lispref/locals.texi b/lispref/locals.texi index b545078ce7d..942baa9dd1b 100644 --- a/lispref/locals.texi +++ b/lispref/locals.texi | |||
| @@ -132,8 +132,7 @@ Does not work yet. | |||
| 132 | @xref{Display Margins}. | 132 | @xref{Display Margins}. |
| 133 | 133 | ||
| 134 | @item line-spacing | 134 | @item line-spacing |
| 135 | @c Cause an error so we will fix this. | 135 | @xref{Line Height}. |
| 136 | @xref{Yet to be written}. | ||
| 137 | 136 | ||
| 138 | @item local-abbrev-table | 137 | @item local-abbrev-table |
| 139 | @xref{Abbrevs}. | 138 | @xref{Abbrevs}. |
| @@ -199,7 +198,7 @@ Used for communication between mouse commands and scroll-bar commands. | |||
| 199 | @xref{Mode Line Variables}. | 198 | @xref{Mode Line Variables}. |
| 200 | 199 | ||
| 201 | @item vertical-scroll-bar | 200 | @item vertical-scroll-bar |
| 202 | @xref{Yet to be written}. | 201 | @xref{Scroll Bars}. |
| 203 | @end table | 202 | @end table |
| 204 | 203 | ||
| 205 | @ignore | 204 | @ignore |
diff --git a/lispref/text.texi b/lispref/text.texi index 55d931699bf..1daad58ee7f 100644 --- a/lispref/text.texi +++ b/lispref/text.texi | |||
| @@ -3002,45 +3002,13 @@ for possible pointer shapes. | |||
| 3002 | A newline can have a @code{line-spacing} text or overlay property that | 3002 | A newline can have a @code{line-spacing} text or overlay property that |
| 3003 | controls the height of the display line ending with that newline. The | 3003 | controls the height of the display line ending with that newline. The |
| 3004 | property value overrides the default frame line spacing and the buffer | 3004 | property value overrides the default frame line spacing and the buffer |
| 3005 | local @code{line-spacing} variable. We will call the property value | 3005 | local @code{line-spacing} variable. @xref{Line Height}. |
| 3006 | @var{line-spacing}. | ||
| 3007 | |||
| 3008 | If @var{line-spacing} is a positive integer, the value specifies | ||
| 3009 | additional vertical space, below the display line, in pixels. | ||
| 3010 | |||
| 3011 | If @var{line-spacing} is a floating point number or cons, the | ||
| 3012 | additional vertical space is the product of @var{line-spacing} and the | ||
| 3013 | default frame line height. | ||
| 3014 | |||
| 3015 | If the @var{line-spacing} value is a cons @code{(total . | ||
| 3016 | @var{spacing})} where @var{spacing} is any of the forms described | ||
| 3017 | above, the value of @var{spacing} specifies the total displayed height | ||
| 3018 | of the line, regardless of the height of the characters in it. This | ||
| 3019 | is equivalent to using the @code{line-height} property. | ||
| 3020 | 3006 | ||
| 3021 | @item line-height | 3007 | @item line-height |
| 3022 | @kindex line-height @r{(text property)} | 3008 | @kindex line-height @r{(text property)} |
| 3023 | A newline can have a @code{line-height} text or overlay property that | 3009 | A newline can have a @code{line-height} text or overlay property that |
| 3024 | controls the total height of the display line ending in that newline. | 3010 | controls the total height of the display line ending in that newline. |
| 3025 | We will call the property value @var{line-height}. | 3011 | @xref{Line Height}. |
| 3026 | |||
| 3027 | If @var{line-height} is 0, the height of the line is determined solely | ||
| 3028 | from its contents; nothing is added. Any @code{line-spacing} property | ||
| 3029 | on this newline is ignored. This case is useful for tiling small | ||
| 3030 | images or image slices without adding blank areas between the images. | ||
| 3031 | |||
| 3032 | If @var{line-height} is a positive integer, the value specifies the | ||
| 3033 | minimum line height in pixels. The line's ascent height is | ||
| 3034 | increased as necessary to achieve the specified height. | ||
| 3035 | |||
| 3036 | If @var{line-height} is a floating point number, the minimum line | ||
| 3037 | height is the product of @var{line-height} and the default frame line | ||
| 3038 | height. | ||
| 3039 | |||
| 3040 | If @var{line-height} is a cons @code{(@var{ratio} . @var{face})}, the | ||
| 3041 | minimum line height is calculated as @var{ratio} times the height of | ||
| 3042 | face @var{face}. The @var{ratio} is an integer or a floating point | ||
| 3043 | number. If @var{face} is @code{t}, it refers to the current face. | ||
| 3044 | 3012 | ||
| 3045 | @item modification-hooks | 3013 | @item modification-hooks |
| 3046 | @cindex change hooks for a character | 3014 | @cindex change hooks for a character |
diff --git a/man/ChangeLog b/man/ChangeLog index b601faef550..b251dc8e912 100644 --- a/man/ChangeLog +++ b/man/ChangeLog | |||
| @@ -1,3 +1,46 @@ | |||
| 1 | 2004-12-13 Jay Belanger <belanger@truman.edu> | ||
| 2 | |||
| 3 | * calc.texi: Fix some TeX definitions. | ||
| 4 | |||
| 5 | 2004-12-12 Juri Linkov <juri@jurta.org> | ||
| 6 | |||
| 7 | * misc.texi (FFAP): Add C-x C-r, C-x C-v, C-x C-d, | ||
| 8 | C-x 4 r, C-x 4 d, C-x 5 r, C-x 5 d. | ||
| 9 | |||
| 10 | * dired.texi (Dired Navigation): Add @r{(Dired)} to M-g. | ||
| 11 | (Misc Dired Commands): Add @r{(Dired)} to w. | ||
| 12 | |||
| 13 | 2004-12-12 Juri Linkov <juri@jurta.org> | ||
| 14 | |||
| 15 | * mark.texi (Marking Objects): Marking commands also extend the | ||
| 16 | region when mark is active in Transient Mark mode. | ||
| 17 | |||
| 18 | 2004-12-09 Luc Teirlinck <teirllm@auburn.edu> | ||
| 19 | |||
| 20 | * reftex.texi (Imprint): Remove erroneous @value's. | ||
| 21 | |||
| 22 | 2004-12-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 23 | |||
| 24 | * custom.texi (Saving Customizations): Emacs only loads the custom | ||
| 25 | file automatically after the init file in version 21.4 or later. | ||
| 26 | Adapt text and examples to this fact. | ||
| 27 | |||
| 28 | * makefile.w32-in (INFO_TARGETS, DVI_TARGETS, $(infodir)/org) | ||
| 29 | (org.dvi, $(infodir)/url, url.dvi, clean): Add org and url manuals. | ||
| 30 | |||
| 31 | 2004-12-08 Jay Belanger <belanger@truman.edu> | ||
| 32 | |||
| 33 | * calc.texi (Starting Calc): Remove comment about installation. | ||
| 34 | (Keypad Mode Overview): Remove comment about Emacs 19 support. | ||
| 35 | |||
| 36 | 2004-12-08 Luc Teirlinck <teirllm@auburn.edu> | ||
| 37 | |||
| 38 | * url.texi: Update @setfilename. | ||
| 39 | (Getting Started): No need to worry about Gnus versions. | ||
| 40 | (Dealing with HTTP documents): Use @inforef. | ||
| 41 | |||
| 42 | * org.texi: Fix @direntry file name. | ||
| 43 | |||
| 1 | 2004-12-07 Luc Teirlinck <teirllm@auburn.edu> | 44 | 2004-12-07 Luc Teirlinck <teirllm@auburn.edu> |
| 2 | 45 | ||
| 3 | * frames.texi (Scroll Bars): The option `scroll-bar-mode' has to | 46 | * frames.texi (Scroll Bars): The option `scroll-bar-mode' has to |
| @@ -107,6 +150,13 @@ | |||
| 107 | to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for | 150 | to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for |
| 108 | suggestions. | 151 | suggestions. |
| 109 | 152 | ||
| 153 | 2004-12-08 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 154 | |||
| 155 | * gnus-faq.texi ([5.1]): Added missing bracket. | ||
| 156 | |||
| 157 | * gnus.texi (Filtering Spam Using The Spam ELisp Package): Index | ||
| 158 | `spam-initialize'. | ||
| 159 | |||
| 110 | 2004-11-22 Reiner Steib <Reiner.Steib@gmx.de> | 160 | 2004-11-22 Reiner Steib <Reiner.Steib@gmx.de> |
| 111 | 161 | ||
| 112 | * message.texi (Various Message Variables): Mention that all mail | 162 | * message.texi (Various Message Variables): Mention that all mail |
| @@ -114,10 +164,6 @@ | |||
| 114 | 164 | ||
| 115 | * gnus.texi (Splitting Mail): Clarify bogus group. | 165 | * gnus.texi (Splitting Mail): Clarify bogus group. |
| 116 | 166 | ||
| 117 | 2004-11-16 Reiner Steib <Reiner.Steib@gmx.de> | ||
| 118 | |||
| 119 | * gnus.texi (Filtering Spam Using The Spam ELisp Package): | ||
| 120 | |||
| 121 | 2004-11-02 Katsumi Yamaoka <yamaoka@jpl.org> | 167 | 2004-11-02 Katsumi Yamaoka <yamaoka@jpl.org> |
| 122 | 168 | ||
| 123 | * emacs-mime.texi (Encoding Customization): Fix | 169 | * emacs-mime.texi (Encoding Customization): Fix |
diff --git a/man/calc.texi b/man/calc.texi index b432e7406ae..16447e4e953 100644 --- a/man/calc.texi +++ b/man/calc.texi | |||
| @@ -13,28 +13,20 @@ | |||
| 13 | @c @infoline foo | 13 | @c @infoline foo |
| 14 | @c `foo' will appear only in non-TeX output | 14 | @c `foo' will appear only in non-TeX output |
| 15 | 15 | ||
| 16 | @c In TeX output, @tmath{expr} will typeset expr in math mode. | 16 | @c @expr{expr} will typeset an expression; |
| 17 | @c In any output, @expr{expr} will typeset an expression; | ||
| 18 | @c $x$ in TeX, @samp{x} otherwise. | 17 | @c $x$ in TeX, @samp{x} otherwise. |
| 19 | 18 | ||
| 20 | @iftex | 19 | @iftex |
| 21 | @macro texline{stuff} | 20 | @macro texline{stuff} |
| 22 | \stuff\ | 21 | \stuff\ |
| 23 | @end macro | 22 | @end macro |
| 24 | @macro tmath{stuff} | ||
| 25 | @tex | ||
| 26 | $\stuff\$ | ||
| 27 | @end tex | ||
| 28 | @end macro | ||
| 29 | @alias infoline=comment | 23 | @alias infoline=comment |
| 30 | @c @alias expr=math | ||
| 31 | @tex | 24 | @tex |
| 32 | \gdef\expr#1{\tex | 25 | \gdef\exprsetup{\tex \let\t\ttfont \turnoffactive} |
| 33 | \let\t\ttfont | 26 | \gdef\expr{\exprsetup$\exprfinish} |
| 34 | \turnoffactive | 27 | \gdef\exprfinish#1{#1$\endgroup} |
| 35 | $#1$ | ||
| 36 | \endgroup} | ||
| 37 | @end tex | 28 | @end tex |
| 29 | @alias mathit=expr | ||
| 38 | @macro cpi{} | 30 | @macro cpi{} |
| 39 | @math{@pi{}} | 31 | @math{@pi{}} |
| 40 | @end macro | 32 | @end macro |
| @@ -49,6 +41,7 @@ $\stuff\$ | |||
| 49 | \stuff\ | 41 | \stuff\ |
| 50 | @end macro | 42 | @end macro |
| 51 | @alias expr=samp | 43 | @alias expr=samp |
| 44 | @alias mathit=i | ||
| 52 | @macro cpi{} | 45 | @macro cpi{} |
| 53 | @expr{pi} | 46 | @expr{pi} |
| 54 | @end macro | 47 | @end macro |
| @@ -624,12 +617,12 @@ then the command to operate on the numbers. | |||
| 624 | 617 | ||
| 625 | @noindent | 618 | @noindent |
| 626 | Type @kbd{2 @key{RET} 3 + Q} to compute | 619 | Type @kbd{2 @key{RET} 3 + Q} to compute |
| 627 | @texline @tmath{\sqrt{2+3} = 2.2360679775}. | 620 | @texline @math{\sqrt{2+3} = 2.2360679775}. |
| 628 | @infoline the square root of 2+3, which is 2.2360679775. | 621 | @infoline the square root of 2+3, which is 2.2360679775. |
| 629 | 622 | ||
| 630 | @noindent | 623 | @noindent |
| 631 | Type @kbd{P 2 ^} to compute | 624 | Type @kbd{P 2 ^} to compute |
| 632 | @texline @tmath{\pi^2 = 9.86960440109}. | 625 | @texline @math{\pi^2 = 9.86960440109}. |
| 633 | @infoline the value of `pi' squared, 9.86960440109. | 626 | @infoline the value of `pi' squared, 9.86960440109. |
| 634 | 627 | ||
| 635 | @noindent | 628 | @noindent |
| @@ -648,12 +641,12 @@ use the apostrophe key. | |||
| 648 | 641 | ||
| 649 | @noindent | 642 | @noindent |
| 650 | Type @kbd{' sqrt(2+3) @key{RET}} to compute | 643 | Type @kbd{' sqrt(2+3) @key{RET}} to compute |
| 651 | @texline @tmath{\sqrt{2+3}}. | 644 | @texline @math{\sqrt{2+3}}. |
| 652 | @infoline the square root of 2+3. | 645 | @infoline the square root of 2+3. |
| 653 | 646 | ||
| 654 | @noindent | 647 | @noindent |
| 655 | Type @kbd{' pi^2 @key{RET}} to enter | 648 | Type @kbd{' pi^2 @key{RET}} to enter |
| 656 | @texline @tmath{\pi^2}. | 649 | @texline @math{\pi^2}. |
| 657 | @infoline `pi' squared. | 650 | @infoline `pi' squared. |
| 658 | To evaluate this symbolic formula as a number, type @kbd{=}. | 651 | To evaluate this symbolic formula as a number, type @kbd{=}. |
| 659 | 652 | ||
| @@ -713,10 +706,10 @@ the lower-right @samp{8} and press @kbd{M-# r}. | |||
| 713 | 706 | ||
| 714 | @noindent | 707 | @noindent |
| 715 | Type @kbd{v t} to transpose this | 708 | Type @kbd{v t} to transpose this |
| 716 | @texline @tmath{3\times2} | 709 | @texline @math{3\times2} |
| 717 | @infoline 3x2 | 710 | @infoline 3x2 |
| 718 | matrix into a | 711 | matrix into a |
| 719 | @texline @tmath{2\times3} | 712 | @texline @math{2\times3} |
| 720 | @infoline 2x3 | 713 | @infoline 2x3 |
| 721 | matrix. Type @w{@kbd{v u}} to unpack the rows into two separate | 714 | matrix. Type @w{@kbd{v u}} to unpack the rows into two separate |
| 722 | vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums | 715 | vectors. Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums |
| @@ -825,10 +818,6 @@ commands like @kbd{M-x calc} (for the standard user interface) or | |||
| 825 | (that's Meta with the letter @kbd{x}), then, at the prompt, | 818 | (that's Meta with the letter @kbd{x}), then, at the prompt, |
| 826 | type the full command (like @kbd{calc-keypad}) and press Return. | 819 | type the full command (like @kbd{calc-keypad}) and press Return. |
| 827 | 820 | ||
| 828 | If you type @kbd{M-x calc} and Emacs still doesn't recognize the | ||
| 829 | command (it will say @samp{[No match]} when you try to press | ||
| 830 | @key{RET}), then Calc has not been properly installed. | ||
| 831 | |||
| 832 | The same commands (like @kbd{M-# c} or @kbd{M-# M-#}) that start | 821 | The same commands (like @kbd{M-# c} or @kbd{M-# M-#}) that start |
| 833 | the Calculator also turn it off if it is already on. | 822 | the Calculator also turn it off if it is already on. |
| 834 | 823 | ||
| @@ -871,9 +860,9 @@ you do. | |||
| 871 | 860 | ||
| 872 | In this case, the trail shows that four numbers (17.3, 3, 2, and 4) | 861 | In this case, the trail shows that four numbers (17.3, 3, 2, and 4) |
| 873 | were first entered into the Calculator, then the 2 and 4 were | 862 | were first entered into the Calculator, then the 2 and 4 were |
| 874 | multiplied to get 8, then the 3 and 8 were subtracted to get @i{-5}. | 863 | multiplied to get 8, then the 3 and 8 were subtracted to get @mathit{-5}. |
| 875 | (The @samp{>} symbol shows that this was the most recent calculation.) | 864 | (The @samp{>} symbol shows that this was the most recent calculation.) |
| 876 | The net result is the two numbers 17.3 and @i{-5} sitting on the stack. | 865 | The net result is the two numbers 17.3 and @mathit{-5} sitting on the stack. |
| 877 | 866 | ||
| 878 | Most Calculator commands deal explicitly with the stack only, but | 867 | Most Calculator commands deal explicitly with the stack only, but |
| 879 | there is a set of commands that allow you to search back through | 868 | there is a set of commands that allow you to search back through |
| @@ -934,7 +923,7 @@ full complexity of the stack and trail. To use it, type @kbd{M-# q} | |||
| 934 | 923 | ||
| 935 | Quick Mode is very simple: It prompts you to type any formula in | 924 | Quick Mode is very simple: It prompts you to type any formula in |
| 936 | standard algebraic notation (like @samp{4 - 2/3}) and then displays | 925 | standard algebraic notation (like @samp{4 - 2/3}) and then displays |
| 937 | the result at the bottom of the Emacs screen (@i{3.33333333333} | 926 | the result at the bottom of the Emacs screen (@mathit{3.33333333333} |
| 938 | in this case). You are then back in the same editing buffer you | 927 | in this case). You are then back in the same editing buffer you |
| 939 | were in before, ready to continue editing or to type @kbd{M-# q} | 928 | were in before, ready to continue editing or to type @kbd{M-# q} |
| 940 | again to do another quick calculation. The result of the calculation | 929 | again to do another quick calculation. The result of the calculation |
| @@ -954,8 +943,7 @@ go into regular Calc (with @kbd{M-# c}) to change the mode settings. | |||
| 954 | @dfn{Keypad Mode} is a mouse-based interface to the Calculator. | 943 | @dfn{Keypad Mode} is a mouse-based interface to the Calculator. |
| 955 | It is designed for use with terminals that support a mouse. If you | 944 | It is designed for use with terminals that support a mouse. If you |
| 956 | don't have a mouse, you will have to operate keypad mode with your | 945 | don't have a mouse, you will have to operate keypad mode with your |
| 957 | arrow keys (which is probably more trouble than it's worth). Keypad | 946 | arrow keys (which is probably more trouble than it's worth). |
| 958 | mode is currently not supported under Emacs 19. | ||
| 959 | 947 | ||
| 960 | Type @kbd{M-# k} to turn Keypad Mode on or off. Once again you | 948 | Type @kbd{M-# k} to turn Keypad Mode on or off. Once again you |
| 961 | get two new windows, this time on the righthand side of the screen | 949 | get two new windows, this time on the righthand side of the screen |
| @@ -1348,7 +1336,7 @@ With any prefix argument, reset everything but the stack. | |||
| 1348 | Calc was originally started as a two-week project to occupy a lull | 1336 | Calc was originally started as a two-week project to occupy a lull |
| 1349 | in the author's schedule. Basically, a friend asked if I remembered | 1337 | in the author's schedule. Basically, a friend asked if I remembered |
| 1350 | the value of | 1338 | the value of |
| 1351 | @texline @tmath{2^{32}}. | 1339 | @texline @math{2^{32}}. |
| 1352 | @infoline @expr{2^32}. | 1340 | @infoline @expr{2^32}. |
| 1353 | I didn't offhand, but I said, ``that's easy, just call up an | 1341 | I didn't offhand, but I said, ``that's easy, just call up an |
| 1354 | @code{xcalc}.'' @code{Xcalc} duly reported that the answer to our | 1342 | @code{xcalc}.'' @code{Xcalc} duly reported that the answer to our |
| @@ -1670,7 +1658,7 @@ multiplication.) Figure it out by hand, then try it with Calc to see | |||
| 1670 | if you're right. @xref{RPN Answer 1, 1}. (@bullet{}) | 1658 | if you're right. @xref{RPN Answer 1, 1}. (@bullet{}) |
| 1671 | 1659 | ||
| 1672 | (@bullet{}) @strong{Exercise 2.} Compute | 1660 | (@bullet{}) @strong{Exercise 2.} Compute |
| 1673 | @texline @tmath{(2\times4) + (7\times9.4) + {5\over4}} | 1661 | @texline @math{(2\times4) + (7\times9.4) + {5\over4}} |
| 1674 | @infoline @expr{2*4 + 7*9.5 + 5/4} | 1662 | @infoline @expr{2*4 + 7*9.5 + 5/4} |
| 1675 | using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) | 1663 | using the stack. @xref{RPN Answer 2, 2}. (@bullet{}) |
| 1676 | 1664 | ||
| @@ -2005,7 +1993,7 @@ $$ 2 + { 3 \times 4 \times 5 \over 6 \times 7^8 } - 9 $$ | |||
| 2005 | @end tex | 1993 | @end tex |
| 2006 | 1994 | ||
| 2007 | @noindent | 1995 | @noindent |
| 2008 | The result of this expression will be the number @i{-6.99999826533}. | 1996 | The result of this expression will be the number @mathit{-6.99999826533}. |
| 2009 | 1997 | ||
| 2010 | Calc's order of evaluation is the same as for most computer languages, | 1998 | Calc's order of evaluation is the same as for most computer languages, |
| 2011 | except that @samp{*} binds more strongly than @samp{/}, as the above | 1999 | except that @samp{*} binds more strongly than @samp{/}, as the above |
| @@ -2014,7 +2002,7 @@ can often be omitted: @samp{2 a} is the same as @samp{2*a}. | |||
| 2014 | 2002 | ||
| 2015 | Operators at the same level are evaluated from left to right, except | 2003 | Operators at the same level are evaluated from left to right, except |
| 2016 | that @samp{^} is evaluated from right to left. Thus, @samp{2-3-4} is | 2004 | that @samp{^} is evaluated from right to left. Thus, @samp{2-3-4} is |
| 2017 | equivalent to @samp{(2-3)-4} or @i{-5}, whereas @samp{2^3^4} is equivalent | 2005 | equivalent to @samp{(2-3)-4} or @mathit{-5}, whereas @samp{2^3^4} is equivalent |
| 2018 | to @samp{2^(3^4)} (a very large integer; try it!). | 2006 | to @samp{2^(3^4)} (a very large integer; try it!). |
| 2019 | 2007 | ||
| 2020 | If you tire of typing the apostrophe all the time, there is an | 2008 | If you tire of typing the apostrophe all the time, there is an |
| @@ -2084,7 +2072,7 @@ accomplish this in Calc by performing your calculation as a series | |||
| 2084 | of algebraic entries, using the @kbd{$} sign to tie them together. | 2072 | of algebraic entries, using the @kbd{$} sign to tie them together. |
| 2085 | In an algebraic formula, @kbd{$} represents the number on the top | 2073 | In an algebraic formula, @kbd{$} represents the number on the top |
| 2086 | of the stack. Here, we perform the calculation | 2074 | of the stack. Here, we perform the calculation |
| 2087 | @texline @tmath{\sqrt{2\times4+1}}, | 2075 | @texline @math{\sqrt{2\times4+1}}, |
| 2088 | @infoline @expr{sqrt(2*4+1)}, | 2076 | @infoline @expr{sqrt(2*4+1)}, |
| 2089 | which on a traditional calculator would be done by pressing | 2077 | which on a traditional calculator would be done by pressing |
| 2090 | @kbd{2 * 4 + 1 =} and then the square-root key. | 2078 | @kbd{2 * 4 + 1 =} and then the square-root key. |
| @@ -2746,11 +2734,11 @@ angle is measured in degrees. For example, | |||
| 2746 | @noindent | 2734 | @noindent |
| 2747 | The shift-@kbd{S} command computes the sine of an angle. The sine | 2735 | The shift-@kbd{S} command computes the sine of an angle. The sine |
| 2748 | of 45 degrees is | 2736 | of 45 degrees is |
| 2749 | @texline @tmath{\sqrt{2}/2}; | 2737 | @texline @math{\sqrt{2}/2}; |
| 2750 | @infoline @expr{sqrt(2)/2}; | 2738 | @infoline @expr{sqrt(2)/2}; |
| 2751 | squaring this yields @expr{2/4 = 0.5}. However, there has been a slight | 2739 | squaring this yields @expr{2/4 = 0.5}. However, there has been a slight |
| 2752 | roundoff error because the representation of | 2740 | roundoff error because the representation of |
| 2753 | @texline @tmath{\sqrt{2}/2} | 2741 | @texline @math{\sqrt{2}/2} |
| 2754 | @infoline @expr{sqrt(2)/2} | 2742 | @infoline @expr{sqrt(2)/2} |
| 2755 | wasn't exact. The @kbd{c 1} command is a handy way to clean up numbers | 2743 | wasn't exact. The @kbd{c 1} command is a handy way to clean up numbers |
| 2756 | in this case; it temporarily reduces the precision by one digit while it | 2744 | in this case; it temporarily reduces the precision by one digit while it |
| @@ -2791,7 +2779,7 @@ either radians or degrees, depending on the current angular mode. | |||
| 2791 | 2779 | ||
| 2792 | @noindent | 2780 | @noindent |
| 2793 | Here we compute the Inverse Sine of | 2781 | Here we compute the Inverse Sine of |
| 2794 | @texline @tmath{\sqrt{0.5}}, | 2782 | @texline @math{\sqrt{0.5}}, |
| 2795 | @infoline @expr{sqrt(0.5)}, | 2783 | @infoline @expr{sqrt(0.5)}, |
| 2796 | first in radians, then in degrees. | 2784 | first in radians, then in degrees. |
| 2797 | 2785 | ||
| @@ -2979,9 +2967,9 @@ logarithm). These can be modified by the @kbd{I} (inverse) and | |||
| 2979 | 2967 | ||
| 2980 | Let's compute the sine and cosine of an angle, and verify the | 2968 | Let's compute the sine and cosine of an angle, and verify the |
| 2981 | identity | 2969 | identity |
| 2982 | @texline @tmath{\sin^2x + \cos^2x = 1}. | 2970 | @texline @math{\sin^2x + \cos^2x = 1}. |
| 2983 | @infoline @expr{sin(x)^2 + cos(x)^2 = 1}. | 2971 | @infoline @expr{sin(x)^2 + cos(x)^2 = 1}. |
| 2984 | We'll arbitrarily pick @i{-64} degrees as a good value for @expr{x}. | 2972 | We'll arbitrarily pick @mathit{-64} degrees as a good value for @expr{x}. |
| 2985 | With the angular mode set to degrees (type @w{@kbd{m d}}), do: | 2973 | With the angular mode set to degrees (type @w{@kbd{m d}}), do: |
| 2986 | 2974 | ||
| 2987 | @smallexample | 2975 | @smallexample |
| @@ -3002,7 +2990,7 @@ Remember, @kbd{f h} is the @code{calc-hypot}, or square-root of sum | |||
| 3002 | of squares, command. | 2990 | of squares, command. |
| 3003 | 2991 | ||
| 3004 | Another identity is | 2992 | Another identity is |
| 3005 | @texline @tmath{\displaystyle\tan x = {\sin x \over \cos x}}. | 2993 | @texline @math{\displaystyle\tan x = {\sin x \over \cos x}}. |
| 3006 | @infoline @expr{tan(x) = sin(x) / cos(x)}. | 2994 | @infoline @expr{tan(x) = sin(x) / cos(x)}. |
| 3007 | @smallexample | 2995 | @smallexample |
| 3008 | @group | 2996 | @group |
| @@ -3017,7 +3005,7 @@ Another identity is | |||
| 3017 | 3005 | ||
| 3018 | A physical interpretation of this calculation is that if you move | 3006 | A physical interpretation of this calculation is that if you move |
| 3019 | @expr{0.89879} units downward and @expr{0.43837} units to the right, | 3007 | @expr{0.89879} units downward and @expr{0.43837} units to the right, |
| 3020 | your direction of motion is @i{-64} degrees from horizontal. Suppose | 3008 | your direction of motion is @mathit{-64} degrees from horizontal. Suppose |
| 3021 | we move in the opposite direction, up and to the left: | 3009 | we move in the opposite direction, up and to the left: |
| 3022 | 3010 | ||
| 3023 | @smallexample | 3011 | @smallexample |
| @@ -3065,7 +3053,7 @@ the top two stack elements right after the @kbd{U U}, then a pair of | |||
| 3065 | 3053 | ||
| 3066 | A similar identity is supposed to hold for hyperbolic sines and cosines, | 3054 | A similar identity is supposed to hold for hyperbolic sines and cosines, |
| 3067 | except that it is the @emph{difference} | 3055 | except that it is the @emph{difference} |
| 3068 | @texline @tmath{\cosh^2x - \sinh^2x} | 3056 | @texline @math{\cosh^2x - \sinh^2x} |
| 3069 | @infoline @expr{cosh(x)^2 - sinh(x)^2} | 3057 | @infoline @expr{cosh(x)^2 - sinh(x)^2} |
| 3070 | that always equals one. Let's try to verify this identity. | 3058 | that always equals one. Let's try to verify this identity. |
| 3071 | 3059 | ||
| @@ -3172,7 +3160,7 @@ in this case). | |||
| 3172 | 3160 | ||
| 3173 | If you take the factorial of a non-integer, Calc uses a generalized | 3161 | If you take the factorial of a non-integer, Calc uses a generalized |
| 3174 | factorial function defined in terms of Euler's Gamma function | 3162 | factorial function defined in terms of Euler's Gamma function |
| 3175 | @texline @tmath{\Gamma(n)} | 3163 | @texline @math{\Gamma(n)} |
| 3176 | @infoline @expr{gamma(n)} | 3164 | @infoline @expr{gamma(n)} |
| 3177 | (which is itself available as the @kbd{f g} command). | 3165 | (which is itself available as the @kbd{f g} command). |
| 3178 | 3166 | ||
| @@ -3189,13 +3177,13 @@ factorial function defined in terms of Euler's Gamma function | |||
| 3189 | 3177 | ||
| 3190 | @noindent | 3178 | @noindent |
| 3191 | Here we verify the identity | 3179 | Here we verify the identity |
| 3192 | @texline @tmath{n! = \Gamma(n+1)}. | 3180 | @texline @math{n! = \Gamma(n+1)}. |
| 3193 | @infoline @expr{@var{n}!@: = gamma(@var{n}+1)}. | 3181 | @infoline @expr{@var{n}!@: = gamma(@var{n}+1)}. |
| 3194 | 3182 | ||
| 3195 | The binomial coefficient @var{n}-choose-@var{m} | 3183 | The binomial coefficient @var{n}-choose-@var{m} |
| 3196 | @texline or @tmath{\displaystyle {n \choose m}} | 3184 | @texline or @math{\displaystyle {n \choose m}} |
| 3197 | is defined by | 3185 | is defined by |
| 3198 | @texline @tmath{\displaystyle {n! \over m! \, (n-m)!}} | 3186 | @texline @math{\displaystyle {n! \over m! \, (n-m)!}} |
| 3199 | @infoline @expr{n!@: / m!@: (n-m)!} | 3187 | @infoline @expr{n!@: / m!@: (n-m)!} |
| 3200 | for all reals @expr{n} and @expr{m}. The intermediate results in this | 3188 | for all reals @expr{n} and @expr{m}. The intermediate results in this |
| 3201 | formula can become quite large even if the final result is small; the | 3189 | formula can become quite large even if the final result is small; the |
| @@ -3480,7 +3468,7 @@ vector. | |||
| 3480 | 3468 | ||
| 3481 | (@bullet{}) @strong{Exercise 1.} Use @samp{*} to sum along the rows | 3469 | (@bullet{}) @strong{Exercise 1.} Use @samp{*} to sum along the rows |
| 3482 | of the above | 3470 | of the above |
| 3483 | @texline @tmath{2\times3} | 3471 | @texline @math{2\times3} |
| 3484 | @infoline 2x3 | 3472 | @infoline 2x3 |
| 3485 | matrix to get @expr{[6, 15]}. Now use @samp{*} to sum along the columns | 3473 | matrix to get @expr{[6, 15]}. Now use @samp{*} to sum along the columns |
| 3486 | to get @expr{[5, 7, 9]}. | 3474 | to get @expr{[5, 7, 9]}. |
| @@ -3631,10 +3619,10 @@ assume the vector was a row vector in order to make the dimensions | |||
| 3631 | come out right, and the answer would be incorrect. If you | 3619 | come out right, and the answer would be incorrect. If you |
| 3632 | don't feel safe letting Calc take either interpretation of your | 3620 | don't feel safe letting Calc take either interpretation of your |
| 3633 | vectors, use explicit | 3621 | vectors, use explicit |
| 3634 | @texline @tmath{N\times1} | 3622 | @texline @math{N\times1} |
| 3635 | @infoline Nx1 | 3623 | @infoline Nx1 |
| 3636 | or | 3624 | or |
| 3637 | @texline @tmath{1\times N} | 3625 | @texline @math{1\times N} |
| 3638 | @infoline 1xN | 3626 | @infoline 1xN |
| 3639 | matrices instead. In this case, you would enter the original column | 3627 | matrices instead. In this case, you would enter the original column |
| 3640 | vector as @samp{[[6], [2], [3]]} or @samp{[6; 2; 3]}. | 3628 | vector as @samp{[[6], [2], [3]]} or @samp{[6; 2; 3]}. |
| @@ -3683,7 +3671,7 @@ on the left by the transpose of @expr{A}: | |||
| 3683 | $A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}. | 3671 | $A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}. |
| 3684 | @end tex | 3672 | @end tex |
| 3685 | Now | 3673 | Now |
| 3686 | @texline @tmath{A^T A} | 3674 | @texline @math{A^T A} |
| 3687 | @infoline @expr{trn(A)*A} | 3675 | @infoline @expr{trn(A)*A} |
| 3688 | is a square matrix so a solution is possible. It turns out that the | 3676 | is a square matrix so a solution is possible. It turns out that the |
| 3689 | @expr{X} vector you compute in this way will be a ``least-squares'' | 3677 | @expr{X} vector you compute in this way will be a ``least-squares'' |
| @@ -3779,7 +3767,7 @@ of each element. | |||
| 3779 | 3767 | ||
| 3780 | (@bullet{}) @strong{Exercise 1.} Compute a vector of powers of two | 3768 | (@bullet{}) @strong{Exercise 1.} Compute a vector of powers of two |
| 3781 | from | 3769 | from |
| 3782 | @texline @tmath{2^{-4}} | 3770 | @texline @math{2^{-4}} |
| 3783 | @infoline @expr{2^-4} | 3771 | @infoline @expr{2^-4} |
| 3784 | to @expr{2^4}. @xref{List Answer 1, 1}. (@bullet{}) | 3772 | to @expr{2^4}. @xref{List Answer 1, 1}. (@bullet{}) |
| 3785 | 3773 | ||
| @@ -3983,7 +3971,7 @@ $$ m = {N \sum x y - \sum x \sum y \over | |||
| 3983 | 3971 | ||
| 3984 | @noindent | 3972 | @noindent |
| 3985 | where | 3973 | where |
| 3986 | @texline @tmath{\sum x} | 3974 | @texline @math{\sum x} |
| 3987 | @infoline @expr{sum(x)} | 3975 | @infoline @expr{sum(x)} |
| 3988 | represents the sum of all the values of @expr{x}. While there is an | 3976 | represents the sum of all the values of @expr{x}. While there is an |
| 3989 | actual @code{sum} function in Calc, it's easier to sum a vector using a | 3977 | actual @code{sum} function in Calc, it's easier to sum a vector using a |
| @@ -4088,7 +4076,7 @@ $$ b = {\sum y - m \sum x \over N} $$ | |||
| 4088 | @end smallexample | 4076 | @end smallexample |
| 4089 | 4077 | ||
| 4090 | Let's ``plot'' this straight line approximation, | 4078 | Let's ``plot'' this straight line approximation, |
| 4091 | @texline @tmath{y \approx m x + b}, | 4079 | @texline @math{y \approx m x + b}, |
| 4092 | @infoline @expr{m x + b}, | 4080 | @infoline @expr{m x + b}, |
| 4093 | and compare it with the original data. | 4081 | and compare it with the original data. |
| 4094 | 4082 | ||
| @@ -4341,7 +4329,7 @@ command to enable multi-line display of vectors.) | |||
| 4341 | @cindex Maximizing a function over a list of values | 4329 | @cindex Maximizing a function over a list of values |
| 4342 | @c [fix-ref Numerical Solutions] | 4330 | @c [fix-ref Numerical Solutions] |
| 4343 | (@bullet{}) @strong{Exercise 8.} Compute a list of values of Bessel's | 4331 | (@bullet{}) @strong{Exercise 8.} Compute a list of values of Bessel's |
| 4344 | @texline @tmath{J_1(x)} | 4332 | @texline @math{J_1(x)} |
| 4345 | @infoline @expr{J1} | 4333 | @infoline @expr{J1} |
| 4346 | function @samp{besJ(1,x)} for @expr{x} from 0 to 5 in steps of 0.25. | 4334 | function @samp{besJ(1,x)} for @expr{x} from 0 to 5 in steps of 0.25. |
| 4347 | Find the value of @expr{x} (from among the above set of values) for | 4335 | Find the value of @expr{x} (from among the above set of values) for |
| @@ -4353,7 +4341,7 @@ of thing automatically; @pxref{Numerical Solutions}.) | |||
| 4353 | 4341 | ||
| 4354 | @cindex Digits, vectors of | 4342 | @cindex Digits, vectors of |
| 4355 | (@bullet{}) @strong{Exercise 9.} You are given an integer in the range | 4343 | (@bullet{}) @strong{Exercise 9.} You are given an integer in the range |
| 4356 | @texline @tmath{0 \le N < 10^m} | 4344 | @texline @math{0 \le N < 10^m} |
| 4357 | @infoline @expr{0 <= N < 10^m} | 4345 | @infoline @expr{0 <= N < 10^m} |
| 4358 | for @expr{m=12} (i.e., an integer of less than | 4346 | for @expr{m=12} (i.e., an integer of less than |
| 4359 | twelve digits). Convert this integer into a vector of @expr{m} | 4347 | twelve digits). Convert this integer into a vector of @expr{m} |
| @@ -4369,14 +4357,14 @@ happened? How would you do this test? @xref{List Answer 10, 10}. (@bullet{}) | |||
| 4369 | 4357 | ||
| 4370 | (@bullet{}) @strong{Exercise 11.} The area of a circle of radius one | 4358 | (@bullet{}) @strong{Exercise 11.} The area of a circle of radius one |
| 4371 | is @cpi{}. The area of the | 4359 | is @cpi{}. The area of the |
| 4372 | @texline @tmath{2\times2} | 4360 | @texline @math{2\times2} |
| 4373 | @infoline 2x2 | 4361 | @infoline 2x2 |
| 4374 | square that encloses that circle is 4. So if we throw @var{n} darts at | 4362 | square that encloses that circle is 4. So if we throw @var{n} darts at |
| 4375 | random points in the square, about @cpiover{4} of them will land inside | 4363 | random points in the square, about @cpiover{4} of them will land inside |
| 4376 | the circle. This gives us an entertaining way to estimate the value of | 4364 | the circle. This gives us an entertaining way to estimate the value of |
| 4377 | @cpi{}. The @w{@kbd{k r}} | 4365 | @cpi{}. The @w{@kbd{k r}} |
| 4378 | command picks a random number between zero and the value on the stack. | 4366 | command picks a random number between zero and the value on the stack. |
| 4379 | We could get a random floating-point number between @i{-1} and 1 by typing | 4367 | We could get a random floating-point number between @mathit{-1} and 1 by typing |
| 4380 | @w{@kbd{2.0 k r 1 -}}. Build a vector of 100 random @expr{(x,y)} points in | 4368 | @w{@kbd{2.0 k r 1 -}}. Build a vector of 100 random @expr{(x,y)} points in |
| 4381 | this square, then use vector mapping and reduction to count how many | 4369 | this square, then use vector mapping and reduction to count how many |
| 4382 | points lie inside the unit circle. Hint: Use the @kbd{v b} command. | 4370 | points lie inside the unit circle. Hint: Use the @kbd{v b} command. |
| @@ -4388,12 +4376,12 @@ another way to calculate @cpi{}. Say you have an infinite field | |||
| 4388 | of vertical lines with a spacing of one inch. Toss a one-inch matchstick | 4376 | of vertical lines with a spacing of one inch. Toss a one-inch matchstick |
| 4389 | onto the field. The probability that the matchstick will land crossing | 4377 | onto the field. The probability that the matchstick will land crossing |
| 4390 | a line turns out to be | 4378 | a line turns out to be |
| 4391 | @texline @tmath{2/\pi}. | 4379 | @texline @math{2/\pi}. |
| 4392 | @infoline @expr{2/pi}. | 4380 | @infoline @expr{2/pi}. |
| 4393 | Toss 100 matchsticks to estimate @cpi{}. (If you want still more fun, | 4381 | Toss 100 matchsticks to estimate @cpi{}. (If you want still more fun, |
| 4394 | the probability that the GCD (@w{@kbd{k g}}) of two large integers is | 4382 | the probability that the GCD (@w{@kbd{k g}}) of two large integers is |
| 4395 | one turns out to be | 4383 | one turns out to be |
| 4396 | @texline @tmath{6/\pi^2}. | 4384 | @texline @math{6/\pi^2}. |
| 4397 | @infoline @expr{6/pi^2}. | 4385 | @infoline @expr{6/pi^2}. |
| 4398 | That provides yet another way to estimate @cpi{}.) | 4386 | That provides yet another way to estimate @cpi{}.) |
| 4399 | @xref{List Answer 12, 12}. (@bullet{}) | 4387 | @xref{List Answer 12, 12}. (@bullet{}) |
| @@ -4423,7 +4411,7 @@ value and a number of steps @var{n} from the stack; it then applies the | |||
| 4423 | function you give to the starting value 0, 1, 2, up to @var{n} times | 4411 | function you give to the starting value 0, 1, 2, up to @var{n} times |
| 4424 | and returns a vector of the results. Use this command to create a | 4412 | and returns a vector of the results. Use this command to create a |
| 4425 | ``random walk'' of 50 steps. Start with the two-dimensional point | 4413 | ``random walk'' of 50 steps. Start with the two-dimensional point |
| 4426 | @expr{(0,0)}; then take one step a random distance between @i{-1} and 1 | 4414 | @expr{(0,0)}; then take one step a random distance between @mathit{-1} and 1 |
| 4427 | in both @expr{x} and @expr{y}; then take another step, and so on. Use the | 4415 | in both @expr{x} and @expr{y}; then take another step, and so on. Use the |
| 4428 | @kbd{g f} command to display this random walk. Now modify your random | 4416 | @kbd{g f} command to display this random walk. Now modify your random |
| 4429 | walk to walk a unit distance, but in a random direction, at each step. | 4417 | walk to walk a unit distance, but in a random direction, at each step. |
| @@ -4502,7 +4490,7 @@ to allow for roundoff error!) @xref{Types Answer 1, 1}. (@bullet{}) | |||
| 4502 | @end smallexample | 4490 | @end smallexample |
| 4503 | 4491 | ||
| 4504 | @noindent | 4492 | @noindent |
| 4505 | The square root of @i{-9} is by default rendered in rectangular form | 4493 | The square root of @mathit{-9} is by default rendered in rectangular form |
| 4506 | (@w{@expr{0 + 3i}}), but we can convert it to polar form (3 with a | 4494 | (@w{@expr{0 + 3i}}), but we can convert it to polar form (3 with a |
| 4507 | phase angle of 90 degrees). All the usual arithmetic and scientific | 4495 | phase angle of 90 degrees). All the usual arithmetic and scientific |
| 4508 | operations are defined on both types of complex numbers. | 4496 | operations are defined on both types of complex numbers. |
| @@ -4527,14 +4515,14 @@ algebraic entry. | |||
| 4527 | 4515 | ||
| 4528 | @noindent | 4516 | @noindent |
| 4529 | Since infinity is infinitely large, multiplying it by any finite | 4517 | Since infinity is infinitely large, multiplying it by any finite |
| 4530 | number (like @i{-17}) has no effect, except that since @i{-17} | 4518 | number (like @mathit{-17}) has no effect, except that since @mathit{-17} |
| 4531 | is negative, it changes a plus infinity to a minus infinity. | 4519 | is negative, it changes a plus infinity to a minus infinity. |
| 4532 | (``A huge positive number, multiplied by @i{-17}, yields a huge | 4520 | (``A huge positive number, multiplied by @mathit{-17}, yields a huge |
| 4533 | negative number.'') Adding any finite number to infinity also | 4521 | negative number.'') Adding any finite number to infinity also |
| 4534 | leaves it unchanged. Taking an absolute value gives us plus | 4522 | leaves it unchanged. Taking an absolute value gives us plus |
| 4535 | infinity again. Finally, we add this plus infinity to the minus | 4523 | infinity again. Finally, we add this plus infinity to the minus |
| 4536 | infinity we had earlier. If you work it out, you might expect | 4524 | infinity we had earlier. If you work it out, you might expect |
| 4537 | the answer to be @i{-72} for this. But the 72 has been completely | 4525 | the answer to be @mathit{-72} for this. But the 72 has been completely |
| 4538 | lost next to the infinities; by the time we compute @w{@samp{inf - inf}} | 4526 | lost next to the infinities; by the time we compute @w{@samp{inf - inf}} |
| 4539 | the finite difference between them, if any, is undetectable. | 4527 | the finite difference between them, if any, is undetectable. |
| 4540 | So we say the result is @dfn{indeterminate}, which Calc writes | 4528 | So we say the result is @dfn{indeterminate}, which Calc writes |
| @@ -4691,7 +4679,7 @@ a 60% chance that the result is correct within 0.59 degrees. | |||
| 4691 | 4679 | ||
| 4692 | @cindex Torus, volume of | 4680 | @cindex Torus, volume of |
| 4693 | (@bullet{}) @strong{Exercise 7.} The volume of a torus (a donut shape) is | 4681 | (@bullet{}) @strong{Exercise 7.} The volume of a torus (a donut shape) is |
| 4694 | @texline @tmath{2 \pi^2 R r^2} | 4682 | @texline @math{2 \pi^2 R r^2} |
| 4695 | @infoline @w{@expr{2 pi^2 R r^2}} | 4683 | @infoline @w{@expr{2 pi^2 R r^2}} |
| 4696 | where @expr{R} is the radius of the circle that | 4684 | where @expr{R} is the radius of the circle that |
| 4697 | defines the center of the tube and @expr{r} is the radius of the tube | 4685 | defines the center of the tube and @expr{r} is the radius of the tube |
| @@ -4791,7 +4779,7 @@ that arises in the second one. | |||
| 4791 | @cindex Fermat, primality test of | 4779 | @cindex Fermat, primality test of |
| 4792 | (@bullet{}) @strong{Exercise 10.} A theorem of Pierre de Fermat | 4780 | (@bullet{}) @strong{Exercise 10.} A theorem of Pierre de Fermat |
| 4793 | says that | 4781 | says that |
| 4794 | @texline @w{@tmath{x^{n-1} \bmod n = 1}} | 4782 | @texline @w{@math{x^{n-1} \bmod n = 1}} |
| 4795 | @infoline @expr{x^(n-1) mod n = 1} | 4783 | @infoline @expr{x^(n-1) mod n = 1} |
| 4796 | if @expr{n} is a prime number and @expr{x} is an integer less than | 4784 | if @expr{n} is a prime number and @expr{x} is an integer less than |
| 4797 | @expr{n}. If @expr{n} is @emph{not} a prime number, this will | 4785 | @expr{n}. If @expr{n} is @emph{not} a prime number, this will |
| @@ -4819,7 +4807,7 @@ This calculation tells me it is six hours and 22 minutes until midnight. | |||
| 4819 | 4807 | ||
| 4820 | (@bullet{}) @strong{Exercise 11.} A rule of thumb is that one year | 4808 | (@bullet{}) @strong{Exercise 11.} A rule of thumb is that one year |
| 4821 | is about | 4809 | is about |
| 4822 | @texline @tmath{\pi \times 10^7} | 4810 | @texline @math{\pi \times 10^7} |
| 4823 | @infoline @w{@expr{pi * 10^7}} | 4811 | @infoline @w{@expr{pi * 10^7}} |
| 4824 | seconds. What time will it be that many seconds from right now? | 4812 | seconds. What time will it be that many seconds from right now? |
| 4825 | @xref{Types Answer 11, 11}. (@bullet{}) | 4813 | @xref{Types Answer 11, 11}. (@bullet{}) |
| @@ -5126,7 +5114,7 @@ solution by pressing @kbd{H} (the Hyperbolic flag) before @kbd{a S}. | |||
| 5126 | 5114 | ||
| 5127 | @noindent | 5115 | @noindent |
| 5128 | Calc has invented the variable @samp{s1} to represent an unknown sign; | 5116 | Calc has invented the variable @samp{s1} to represent an unknown sign; |
| 5129 | it is supposed to be either @i{+1} or @i{-1}. Here we have used | 5117 | it is supposed to be either @mathit{+1} or @mathit{-1}. Here we have used |
| 5130 | the ``let'' command to evaluate the expression when the sign is negative. | 5118 | the ``let'' command to evaluate the expression when the sign is negative. |
| 5131 | If we plugged this into our second derivative we would get the same, | 5119 | If we plugged this into our second derivative we would get the same, |
| 5132 | negative, answer, so @expr{x = -1.19023} is also a maximum. | 5120 | negative, answer, so @expr{x = -1.19023} is also a maximum. |
| @@ -5296,7 +5284,7 @@ One way to do it is again with vector mapping and reduction: | |||
| 5296 | 5284 | ||
| 5297 | (@bullet{}) @strong{Exercise 3.} Find the integral from 1 to @expr{y} | 5285 | (@bullet{}) @strong{Exercise 3.} Find the integral from 1 to @expr{y} |
| 5298 | of | 5286 | of |
| 5299 | @texline @tmath{x \sin \pi x} | 5287 | @texline @math{x \sin \pi x} |
| 5300 | @infoline @w{@expr{x sin(pi x)}} | 5288 | @infoline @w{@expr{x sin(pi x)}} |
| 5301 | (where the sine is calculated in radians). Find the values of the | 5289 | (where the sine is calculated in radians). Find the values of the |
| 5302 | integral for integers @expr{y} from 1 to 5. @xref{Algebra Answer 3, | 5290 | integral for integers @expr{y} from 1 to 5. @xref{Algebra Answer 3, |
| @@ -5305,7 +5293,7 @@ integral for integers @expr{y} from 1 to 5. @xref{Algebra Answer 3, | |||
| 5305 | Calc's integrator can do many simple integrals symbolically, but many | 5293 | Calc's integrator can do many simple integrals symbolically, but many |
| 5306 | others are beyond its capabilities. Suppose we wish to find the area | 5294 | others are beyond its capabilities. Suppose we wish to find the area |
| 5307 | under the curve | 5295 | under the curve |
| 5308 | @texline @tmath{\sin x \ln x} | 5296 | @texline @math{\sin x \ln x} |
| 5309 | @infoline @expr{sin(x) ln(x)} | 5297 | @infoline @expr{sin(x) ln(x)} |
| 5310 | over the same range of @expr{x}. If you entered this formula and typed | 5298 | over the same range of @expr{x}. If you entered this formula and typed |
| 5311 | @kbd{a i x @key{RET}} (don't bother to try this), Calc would work for a | 5299 | @kbd{a i x @key{RET}} (don't bother to try this), Calc would work for a |
| @@ -5447,7 +5435,7 @@ $$ h (f(a) + f(a+h) + f(a+2h) + f(a+3h) + \cdots | |||
| 5447 | @end tex | 5435 | @end tex |
| 5448 | 5436 | ||
| 5449 | Compute the integral from 1 to 2 of | 5437 | Compute the integral from 1 to 2 of |
| 5450 | @texline @tmath{\sin x \ln x} | 5438 | @texline @math{\sin x \ln x} |
| 5451 | @infoline @expr{sin(x) ln(x)} | 5439 | @infoline @expr{sin(x) ln(x)} |
| 5452 | using Simpson's rule with 10 slices. | 5440 | using Simpson's rule with 10 slices. |
| 5453 | @xref{Algebra Answer 4, 4}. (@bullet{}) | 5441 | @xref{Algebra Answer 4, 4}. (@bullet{}) |
| @@ -5993,7 +5981,7 @@ in @samp{a + 1} for @samp{x} in the defining formula. | |||
| 5993 | @end ignore | 5981 | @end ignore |
| 5994 | @tindex Si | 5982 | @tindex Si |
| 5995 | (@bullet{}) @strong{Exercise 1.} The ``sine integral'' function | 5983 | (@bullet{}) @strong{Exercise 1.} The ``sine integral'' function |
| 5996 | @texline @tmath{{\rm Si}(x)} | 5984 | @texline @math{{\rm Si}(x)} |
| 5997 | @infoline @expr{Si(x)} | 5985 | @infoline @expr{Si(x)} |
| 5998 | is defined as the integral of @samp{sin(t)/t} for | 5986 | is defined as the integral of @samp{sin(t)/t} for |
| 5999 | @expr{t = 0} to @expr{x} in radians. (It was invented because this | 5987 | @expr{t = 0} to @expr{x} in radians. (It was invented because this |
| @@ -6071,7 +6059,7 @@ the following functions: | |||
| 6071 | @enumerate | 6059 | @enumerate |
| 6072 | @item | 6060 | @item |
| 6073 | Compute | 6061 | Compute |
| 6074 | @texline @tmath{\displaystyle{\sin x \over x}}, | 6062 | @texline @math{\displaystyle{\sin x \over x}}, |
| 6075 | @infoline @expr{sin(x) / x}, | 6063 | @infoline @expr{sin(x) / x}, |
| 6076 | where @expr{x} is the number on the top of the stack. | 6064 | where @expr{x} is the number on the top of the stack. |
| 6077 | 6065 | ||
| @@ -6137,13 +6125,13 @@ key if you have one, makes a copy of the number in level 2.) | |||
| 6137 | @cindex Phi, golden ratio | 6125 | @cindex Phi, golden ratio |
| 6138 | A fascinating property of the Fibonacci numbers is that the @expr{n}th | 6126 | A fascinating property of the Fibonacci numbers is that the @expr{n}th |
| 6139 | Fibonacci number can be found directly by computing | 6127 | Fibonacci number can be found directly by computing |
| 6140 | @texline @tmath{\phi^n / \sqrt{5}} | 6128 | @texline @math{\phi^n / \sqrt{5}} |
| 6141 | @infoline @expr{phi^n / sqrt(5)} | 6129 | @infoline @expr{phi^n / sqrt(5)} |
| 6142 | and then rounding to the nearest integer, where | 6130 | and then rounding to the nearest integer, where |
| 6143 | @texline @tmath{\phi} (``phi''), | 6131 | @texline @math{\phi} (``phi''), |
| 6144 | @infoline @expr{phi}, | 6132 | @infoline @expr{phi}, |
| 6145 | the ``golden ratio,'' is | 6133 | the ``golden ratio,'' is |
| 6146 | @texline @tmath{(1 + \sqrt{5}) / 2}. | 6134 | @texline @math{(1 + \sqrt{5}) / 2}. |
| 6147 | @infoline @expr{(1 + sqrt(5)) / 2}. | 6135 | @infoline @expr{(1 + sqrt(5)) / 2}. |
| 6148 | (For convenience, this constant is available from the @code{phi} | 6136 | (For convenience, this constant is available from the @code{phi} |
| 6149 | variable, or the @kbd{I H P} command.) | 6137 | variable, or the @kbd{I H P} command.) |
| @@ -6160,17 +6148,17 @@ variable, or the @kbd{I H P} command.) | |||
| 6160 | @cindex Continued fractions | 6148 | @cindex Continued fractions |
| 6161 | (@bullet{}) @strong{Exercise 5.} The @dfn{continued fraction} | 6149 | (@bullet{}) @strong{Exercise 5.} The @dfn{continued fraction} |
| 6162 | representation of | 6150 | representation of |
| 6163 | @texline @tmath{\phi} | 6151 | @texline @math{\phi} |
| 6164 | @infoline @expr{phi} | 6152 | @infoline @expr{phi} |
| 6165 | is | 6153 | is |
| 6166 | @texline @tmath{1 + 1/(1 + 1/(1 + 1/( \ldots )))}. | 6154 | @texline @math{1 + 1/(1 + 1/(1 + 1/( \ldots )))}. |
| 6167 | @infoline @expr{1 + 1/(1 + 1/(1 + 1/( ...@: )))}. | 6155 | @infoline @expr{1 + 1/(1 + 1/(1 + 1/( ...@: )))}. |
| 6168 | We can compute an approximate value by carrying this however far | 6156 | We can compute an approximate value by carrying this however far |
| 6169 | and then replacing the innermost | 6157 | and then replacing the innermost |
| 6170 | @texline @tmath{1/( \ldots )} | 6158 | @texline @math{1/( \ldots )} |
| 6171 | @infoline @expr{1/( ...@: )} | 6159 | @infoline @expr{1/( ...@: )} |
| 6172 | by 1. Approximate | 6160 | by 1. Approximate |
| 6173 | @texline @tmath{\phi} | 6161 | @texline @math{\phi} |
| 6174 | @infoline @expr{phi} | 6162 | @infoline @expr{phi} |
| 6175 | using a twenty-term continued fraction. | 6163 | using a twenty-term continued fraction. |
| 6176 | @xref{Programming Answer 5, 5}. (@bullet{}) | 6164 | @xref{Programming Answer 5, 5}. (@bullet{}) |
| @@ -6270,7 +6258,7 @@ The @dfn{Bernoulli numbers} are a sequence with the interesting | |||
| 6270 | property that all of the odd Bernoulli numbers are zero, and the | 6258 | property that all of the odd Bernoulli numbers are zero, and the |
| 6271 | even ones, while difficult to compute, can be roughly approximated | 6259 | even ones, while difficult to compute, can be roughly approximated |
| 6272 | by the formula | 6260 | by the formula |
| 6273 | @texline @tmath{\displaystyle{2 n! \over (2 \pi)^n}}. | 6261 | @texline @math{\displaystyle{2 n! \over (2 \pi)^n}}. |
| 6274 | @infoline @expr{2 n!@: / (2 pi)^n}. | 6262 | @infoline @expr{2 n!@: / (2 pi)^n}. |
| 6275 | Let's write a keyboard macro to compute (approximate) Bernoulli numbers. | 6263 | Let's write a keyboard macro to compute (approximate) Bernoulli numbers. |
| 6276 | (Calc has a command, @kbd{k b}, to compute exact Bernoulli numbers, but | 6264 | (Calc has a command, @kbd{k b}, to compute exact Bernoulli numbers, but |
| @@ -6444,14 +6432,14 @@ $$ x_{\rm new} = x - {f(x) \over f'(x)} $$ | |||
| 6444 | @noindent | 6432 | @noindent |
| 6445 | where @expr{f'(x)} is the derivative of @expr{f}. The @expr{x} | 6433 | where @expr{f'(x)} is the derivative of @expr{f}. The @expr{x} |
| 6446 | values will quickly converge to a solution, i.e., eventually | 6434 | values will quickly converge to a solution, i.e., eventually |
| 6447 | @texline @tmath{x_{\rm new}} | 6435 | @texline @math{x_{\rm new}} |
| 6448 | @infoline @expr{new_x} | 6436 | @infoline @expr{new_x} |
| 6449 | and @expr{x} will be equal to within the limits | 6437 | and @expr{x} will be equal to within the limits |
| 6450 | of the current precision. Write a program which takes a formula | 6438 | of the current precision. Write a program which takes a formula |
| 6451 | involving the variable @expr{x}, and an initial guess @expr{x_0}, | 6439 | involving the variable @expr{x}, and an initial guess @expr{x_0}, |
| 6452 | on the stack, and produces a value of @expr{x} for which the formula | 6440 | on the stack, and produces a value of @expr{x} for which the formula |
| 6453 | is zero. Use it to find a solution of | 6441 | is zero. Use it to find a solution of |
| 6454 | @texline @tmath{\sin(\cos x) = 0.5} | 6442 | @texline @math{\sin(\cos x) = 0.5} |
| 6455 | @infoline @expr{sin(cos(x)) = 0.5} | 6443 | @infoline @expr{sin(cos(x)) = 0.5} |
| 6456 | near @expr{x = 4.5}. (Use angles measured in radians.) Note that | 6444 | near @expr{x = 4.5}. (Use angles measured in radians.) Note that |
| 6457 | the built-in @w{@kbd{a R}} (@code{calc-find-root}) command uses Newton's | 6445 | the built-in @w{@kbd{a R}} (@code{calc-find-root}) command uses Newton's |
| @@ -6461,10 +6449,10 @@ method when it is able. @xref{Programming Answer 8, 8}. (@bullet{}) | |||
| 6461 | @cindex Gamma constant, Euler's | 6449 | @cindex Gamma constant, Euler's |
| 6462 | @cindex Euler's gamma constant | 6450 | @cindex Euler's gamma constant |
| 6463 | (@bullet{}) @strong{Exercise 9.} The @dfn{digamma} function | 6451 | (@bullet{}) @strong{Exercise 9.} The @dfn{digamma} function |
| 6464 | @texline @tmath{\psi(z) (``psi'')} | 6452 | @texline @math{\psi(z) (``psi'')} |
| 6465 | @infoline @expr{psi(z)} | 6453 | @infoline @expr{psi(z)} |
| 6466 | is defined as the derivative of | 6454 | is defined as the derivative of |
| 6467 | @texline @tmath{\ln \Gamma(z)}. | 6455 | @texline @math{\ln \Gamma(z)}. |
| 6468 | @infoline @expr{ln(gamma(z))}. | 6456 | @infoline @expr{ln(gamma(z))}. |
| 6469 | For large values of @expr{z}, it can be approximated by the infinite sum | 6457 | For large values of @expr{z}, it can be approximated by the infinite sum |
| 6470 | 6458 | ||
| @@ -6483,7 +6471,7 @@ $$ | |||
| 6483 | 6471 | ||
| 6484 | @noindent | 6472 | @noindent |
| 6485 | where | 6473 | where |
| 6486 | @texline @tmath{\sum} | 6474 | @texline @math{\sum} |
| 6487 | @infoline @expr{sum} | 6475 | @infoline @expr{sum} |
| 6488 | represents the sum over @expr{n} from 1 to infinity | 6476 | represents the sum over @expr{n} from 1 to infinity |
| 6489 | (or to some limit high enough to give the desired accuracy), and | 6477 | (or to some limit high enough to give the desired accuracy), and |
| @@ -6491,27 +6479,27 @@ the @code{bern} function produces (exact) Bernoulli numbers. | |||
| 6491 | While this sum is not guaranteed to converge, in practice it is safe. | 6479 | While this sum is not guaranteed to converge, in practice it is safe. |
| 6492 | An interesting mathematical constant is Euler's gamma, which is equal | 6480 | An interesting mathematical constant is Euler's gamma, which is equal |
| 6493 | to about 0.5772. One way to compute it is by the formula, | 6481 | to about 0.5772. One way to compute it is by the formula, |
| 6494 | @texline @tmath{\gamma = -\psi(1)}. | 6482 | @texline @math{\gamma = -\psi(1)}. |
| 6495 | @infoline @expr{gamma = -psi(1)}. | 6483 | @infoline @expr{gamma = -psi(1)}. |
| 6496 | Unfortunately, 1 isn't a large enough argument | 6484 | Unfortunately, 1 isn't a large enough argument |
| 6497 | for the above formula to work (5 is a much safer value for @expr{z}). | 6485 | for the above formula to work (5 is a much safer value for @expr{z}). |
| 6498 | Fortunately, we can compute | 6486 | Fortunately, we can compute |
| 6499 | @texline @tmath{\psi(1)} | 6487 | @texline @math{\psi(1)} |
| 6500 | @infoline @expr{psi(1)} | 6488 | @infoline @expr{psi(1)} |
| 6501 | from | 6489 | from |
| 6502 | @texline @tmath{\psi(5)} | 6490 | @texline @math{\psi(5)} |
| 6503 | @infoline @expr{psi(5)} | 6491 | @infoline @expr{psi(5)} |
| 6504 | using the recurrence | 6492 | using the recurrence |
| 6505 | @texline @tmath{\psi(z+1) = \psi(z) + {1 \over z}}. | 6493 | @texline @math{\psi(z+1) = \psi(z) + {1 \over z}}. |
| 6506 | @infoline @expr{psi(z+1) = psi(z) + 1/z}. | 6494 | @infoline @expr{psi(z+1) = psi(z) + 1/z}. |
| 6507 | Your task: Develop a program to compute | 6495 | Your task: Develop a program to compute |
| 6508 | @texline @tmath{\psi(z)}; | 6496 | @texline @math{\psi(z)}; |
| 6509 | @infoline @expr{psi(z)}; | 6497 | @infoline @expr{psi(z)}; |
| 6510 | it should ``pump up'' @expr{z} | 6498 | it should ``pump up'' @expr{z} |
| 6511 | if necessary to be greater than 5, then use the above summation | 6499 | if necessary to be greater than 5, then use the above summation |
| 6512 | formula. Use looping commands to compute the sum. Use your function | 6500 | formula. Use looping commands to compute the sum. Use your function |
| 6513 | to compute | 6501 | to compute |
| 6514 | @texline @tmath{\gamma} | 6502 | @texline @math{\gamma} |
| 6515 | @infoline @expr{gamma} | 6503 | @infoline @expr{gamma} |
| 6516 | to twelve decimal places. (Calc has a built-in command | 6504 | to twelve decimal places. (Calc has a built-in command |
| 6517 | for Euler's constant, @kbd{I P}, which you can use to check your answer.) | 6505 | for Euler's constant, @kbd{I P}, which you can use to check your answer.) |
| @@ -6688,18 +6676,18 @@ This section includes answers to all the exercises in the Calc tutorial. | |||
| 6688 | @kbd{1 @key{RET} 2 @key{RET} 3 @key{RET} 4 + * -} | 6676 | @kbd{1 @key{RET} 2 @key{RET} 3 @key{RET} 4 + * -} |
| 6689 | 6677 | ||
| 6690 | The result is | 6678 | The result is |
| 6691 | @texline @tmath{1 - (2 \times (3 + 4)) = -13}. | 6679 | @texline @math{1 - (2 \times (3 + 4)) = -13}. |
| 6692 | @infoline @expr{1 - (2 * (3 + 4)) = -13}. | 6680 | @infoline @expr{1 - (2 * (3 + 4)) = -13}. |
| 6693 | 6681 | ||
| 6694 | @node RPN Answer 2, RPN Answer 3, RPN Answer 1, Answers to Exercises | 6682 | @node RPN Answer 2, RPN Answer 3, RPN Answer 1, Answers to Exercises |
| 6695 | @subsection RPN Tutorial Exercise 2 | 6683 | @subsection RPN Tutorial Exercise 2 |
| 6696 | 6684 | ||
| 6697 | @noindent | 6685 | @noindent |
| 6698 | @texline @tmath{2\times4 + 7\times9.5 + {5\over4} = 75.75} | 6686 | @texline @math{2\times4 + 7\times9.5 + {5\over4} = 75.75} |
| 6699 | @infoline @expr{2*4 + 7*9.5 + 5/4 = 75.75} | 6687 | @infoline @expr{2*4 + 7*9.5 + 5/4 = 75.75} |
| 6700 | 6688 | ||
| 6701 | After computing the intermediate term | 6689 | After computing the intermediate term |
| 6702 | @texline @tmath{2\times4 = 8}, | 6690 | @texline @math{2\times4 = 8}, |
| 6703 | @infoline @expr{2*4 = 8}, | 6691 | @infoline @expr{2*4 = 8}, |
| 6704 | you can leave that result on the stack while you compute the second | 6692 | you can leave that result on the stack while you compute the second |
| 6705 | term. With both of these results waiting on the stack you can then | 6693 | term. With both of these results waiting on the stack you can then |
| @@ -7008,7 +6996,7 @@ give a floating-point result that is inaccurate even when rounded | |||
| 7008 | down to an integer. Consider @expr{123456789 / 2} when the current | 6996 | down to an integer. Consider @expr{123456789 / 2} when the current |
| 7009 | precision is 6 digits. The true answer is @expr{61728394.5}, but | 6997 | precision is 6 digits. The true answer is @expr{61728394.5}, but |
| 7010 | with a precision of 6 this will be rounded to | 6998 | with a precision of 6 this will be rounded to |
| 7011 | @texline @tmath{12345700.0/2.0 = 61728500.0}. | 6999 | @texline @math{12345700.0/2.0 = 61728500.0}. |
| 7012 | @infoline @expr{12345700.@: / 2.@: = 61728500.}. | 7000 | @infoline @expr{12345700.@: / 2.@: = 61728500.}. |
| 7013 | The result, when converted to an integer, will be off by 106. | 7001 | The result, when converted to an integer, will be off by 106. |
| 7014 | 7002 | ||
| @@ -7119,16 +7107,16 @@ Type @kbd{d N} to return to ``normal'' display mode afterwards. | |||
| 7119 | 7107 | ||
| 7120 | @noindent | 7108 | @noindent |
| 7121 | To solve | 7109 | To solve |
| 7122 | @texline @tmath{A^T A \, X = A^T B}, | 7110 | @texline @math{A^T A \, X = A^T B}, |
| 7123 | @infoline @expr{trn(A) * A * X = trn(A) * B}, | 7111 | @infoline @expr{trn(A) * A * X = trn(A) * B}, |
| 7124 | first we compute | 7112 | first we compute |
| 7125 | @texline @tmath{A' = A^T A} | 7113 | @texline @math{A' = A^T A} |
| 7126 | @infoline @expr{A2 = trn(A) * A} | 7114 | @infoline @expr{A2 = trn(A) * A} |
| 7127 | and | 7115 | and |
| 7128 | @texline @tmath{B' = A^T B}; | 7116 | @texline @math{B' = A^T B}; |
| 7129 | @infoline @expr{B2 = trn(A) * B}; | 7117 | @infoline @expr{B2 = trn(A) * B}; |
| 7130 | now, we have a system | 7118 | now, we have a system |
| 7131 | @texline @tmath{A' X = B'} | 7119 | @texline @math{A' X = B'} |
| 7132 | @infoline @expr{A2 * X = B2} | 7120 | @infoline @expr{A2 * X = B2} |
| 7133 | which we can solve using Calc's @samp{/} command. | 7121 | which we can solve using Calc's @samp{/} command. |
| 7134 | 7122 | ||
| @@ -7160,7 +7148,7 @@ $$ | |||
| 7160 | 7148 | ||
| 7161 | The first step is to enter the coefficient matrix. We'll store it in | 7149 | The first step is to enter the coefficient matrix. We'll store it in |
| 7162 | quick variable number 7 for later reference. Next, we compute the | 7150 | quick variable number 7 for later reference. Next, we compute the |
| 7163 | @texline @tmath{B'} | 7151 | @texline @math{B'} |
| 7164 | @infoline @expr{B2} | 7152 | @infoline @expr{B2} |
| 7165 | vector. | 7153 | vector. |
| 7166 | 7154 | ||
| @@ -7178,7 +7166,7 @@ vector. | |||
| 7178 | 7166 | ||
| 7179 | @noindent | 7167 | @noindent |
| 7180 | Now we compute the matrix | 7168 | Now we compute the matrix |
| 7181 | @texline @tmath{A'} | 7169 | @texline @math{A'} |
| 7182 | @infoline @expr{A2} | 7170 | @infoline @expr{A2} |
| 7183 | and divide. | 7171 | and divide. |
| 7184 | 7172 | ||
| @@ -7199,16 +7187,16 @@ and divide. | |||
| 7199 | round-off error.) | 7187 | round-off error.) |
| 7200 | 7188 | ||
| 7201 | Notice that the answers are similar to those for the | 7189 | Notice that the answers are similar to those for the |
| 7202 | @texline @tmath{3\times3} | 7190 | @texline @math{3\times3} |
| 7203 | @infoline 3x3 | 7191 | @infoline 3x3 |
| 7204 | system solved in the text. That's because the fourth equation that was | 7192 | system solved in the text. That's because the fourth equation that was |
| 7205 | added to the system is almost identical to the first one multiplied | 7193 | added to the system is almost identical to the first one multiplied |
| 7206 | by two. (If it were identical, we would have gotten the exact same | 7194 | by two. (If it were identical, we would have gotten the exact same |
| 7207 | answer since the | 7195 | answer since the |
| 7208 | @texline @tmath{4\times3} | 7196 | @texline @math{4\times3} |
| 7209 | @infoline 4x3 | 7197 | @infoline 4x3 |
| 7210 | system would be equivalent to the original | 7198 | system would be equivalent to the original |
| 7211 | @texline @tmath{3\times3} | 7199 | @texline @math{3\times3} |
| 7212 | @infoline 3x3 | 7200 | @infoline 3x3 |
| 7213 | system.) | 7201 | system.) |
| 7214 | 7202 | ||
| @@ -7285,7 +7273,7 @@ $$ m \times x + b \times 1 = y $$ | |||
| 7285 | @end tex | 7273 | @end tex |
| 7286 | 7274 | ||
| 7287 | Thus we want a | 7275 | Thus we want a |
| 7288 | @texline @tmath{19\times2} | 7276 | @texline @math{19\times2} |
| 7289 | @infoline 19x2 | 7277 | @infoline 19x2 |
| 7290 | matrix with our @expr{x} vector as one column and | 7278 | matrix with our @expr{x} vector as one column and |
| 7291 | ones as the other column. So, first we build the column of ones, then | 7279 | ones as the other column. So, first we build the column of ones, then |
| @@ -7304,10 +7292,10 @@ we combine the two columns to form our @expr{A} matrix. | |||
| 7304 | 7292 | ||
| 7305 | @noindent | 7293 | @noindent |
| 7306 | Now we compute | 7294 | Now we compute |
| 7307 | @texline @tmath{A^T y} | 7295 | @texline @math{A^T y} |
| 7308 | @infoline @expr{trn(A) * y} | 7296 | @infoline @expr{trn(A) * y} |
| 7309 | and | 7297 | and |
| 7310 | @texline @tmath{A^T A} | 7298 | @texline @math{A^T A} |
| 7311 | @infoline @expr{trn(A) * A} | 7299 | @infoline @expr{trn(A) * A} |
| 7312 | and divide. | 7300 | and divide. |
| 7313 | 7301 | ||
| @@ -7335,7 +7323,7 @@ and divide. | |||
| 7335 | @end smallexample | 7323 | @end smallexample |
| 7336 | 7324 | ||
| 7337 | Since we were solving equations of the form | 7325 | Since we were solving equations of the form |
| 7338 | @texline @tmath{m \times x + b \times 1 = y}, | 7326 | @texline @math{m \times x + b \times 1 = y}, |
| 7339 | @infoline @expr{m*x + b*1 = y}, | 7327 | @infoline @expr{m*x + b*1 = y}, |
| 7340 | these numbers should be @expr{m} and @expr{b}, respectively. Sure | 7328 | these numbers should be @expr{m} and @expr{b}, respectively. Sure |
| 7341 | enough, they agree exactly with the result computed using @kbd{V M} and | 7329 | enough, they agree exactly with the result computed using @kbd{V M} and |
| @@ -7398,7 +7386,7 @@ then raise the number to that power.) | |||
| 7398 | 7386 | ||
| 7399 | @noindent | 7387 | @noindent |
| 7400 | A number @expr{j} is a divisor of @expr{n} if | 7388 | A number @expr{j} is a divisor of @expr{n} if |
| 7401 | @texline @tmath{n \mathbin{\hbox{\code{\%}}} j = 0}. | 7389 | @texline @math{n \mathbin{\hbox{\code{\%}}} j = 0}. |
| 7402 | @infoline @samp{n % j = 0}. | 7390 | @infoline @samp{n % j = 0}. |
| 7403 | The first step is to get a vector that identifies the divisors. | 7391 | The first step is to get a vector that identifies the divisors. |
| 7404 | 7392 | ||
| @@ -7469,7 +7457,7 @@ zero, so adding zeros on the left and right is safe. From then on | |||
| 7469 | the job is pretty straightforward. | 7457 | the job is pretty straightforward. |
| 7470 | 7458 | ||
| 7471 | Incidentally, Calc provides the | 7459 | Incidentally, Calc provides the |
| 7472 | @texline @dfn{M@"obius} @tmath{\mu} | 7460 | @texline @dfn{M@"obius} @math{\mu} |
| 7473 | @infoline @dfn{Moebius mu} | 7461 | @infoline @dfn{Moebius mu} |
| 7474 | function which is zero if and only if its argument is square-free. It | 7462 | function which is zero if and only if its argument is square-free. It |
| 7475 | would be a much more convenient way to do the above test in practice. | 7463 | would be a much more convenient way to do the above test in practice. |
| @@ -7503,7 +7491,7 @@ The numbers down the lefthand edge of the list we desire are called | |||
| 7503 | the ``triangular numbers'' (now you know why!). The @expr{n}th | 7491 | the ``triangular numbers'' (now you know why!). The @expr{n}th |
| 7504 | triangular number is the sum of the integers from 1 to @expr{n}, and | 7492 | triangular number is the sum of the integers from 1 to @expr{n}, and |
| 7505 | can be computed directly by the formula | 7493 | can be computed directly by the formula |
| 7506 | @texline @tmath{n (n+1) \over 2}. | 7494 | @texline @math{n (n+1) \over 2}. |
| 7507 | @infoline @expr{n * (n+1) / 2}. | 7495 | @infoline @expr{n * (n+1) / 2}. |
| 7508 | 7496 | ||
| 7509 | @smallexample | 7497 | @smallexample |
| @@ -7599,7 +7587,7 @@ A way to isolate the maximum value is to compute the maximum using | |||
| 7599 | @noindent | 7587 | @noindent |
| 7600 | It's a good idea to verify, as in the last step above, that only | 7588 | It's a good idea to verify, as in the last step above, that only |
| 7601 | one value is equal to the maximum. (After all, a plot of | 7589 | one value is equal to the maximum. (After all, a plot of |
| 7602 | @texline @tmath{\sin x} | 7590 | @texline @math{\sin x} |
| 7603 | @infoline @expr{sin(x)} | 7591 | @infoline @expr{sin(x)} |
| 7604 | might have many points all equal to the maximum value, 1.) | 7592 | might have many points all equal to the maximum value, 1.) |
| 7605 | 7593 | ||
| @@ -7871,10 +7859,10 @@ This problem can be made a lot easier by taking advantage of some | |||
| 7871 | symmetries. First of all, after some thought it's clear that the | 7859 | symmetries. First of all, after some thought it's clear that the |
| 7872 | @expr{y} axis can be ignored altogether. Just pick a random @expr{x} | 7860 | @expr{y} axis can be ignored altogether. Just pick a random @expr{x} |
| 7873 | component for one end of the match, pick a random direction | 7861 | component for one end of the match, pick a random direction |
| 7874 | @texline @tmath{\theta}, | 7862 | @texline @math{\theta}, |
| 7875 | @infoline @expr{theta}, | 7863 | @infoline @expr{theta}, |
| 7876 | and see if @expr{x} and | 7864 | and see if @expr{x} and |
| 7877 | @texline @tmath{x + \cos \theta} | 7865 | @texline @math{x + \cos \theta} |
| 7878 | @infoline @expr{x + cos(theta)} | 7866 | @infoline @expr{x + cos(theta)} |
| 7879 | (which is the @expr{x} coordinate of the other endpoint) cross a line. | 7867 | (which is the @expr{x} coordinate of the other endpoint) cross a line. |
| 7880 | The lines are at integer coordinates, so this happens when the two | 7868 | The lines are at integer coordinates, so this happens when the two |
| @@ -7891,10 +7879,10 @@ coordinates 0 and 1 for the lines on either side of the leftmost | |||
| 7891 | endpoint. The rightmost endpoint will be between 0 and 1 if the | 7879 | endpoint. The rightmost endpoint will be between 0 and 1 if the |
| 7892 | match does not cross a line, or between 1 and 2 if it does. So: | 7880 | match does not cross a line, or between 1 and 2 if it does. So: |
| 7893 | Pick random @expr{x} and | 7881 | Pick random @expr{x} and |
| 7894 | @texline @tmath{\theta}, | 7882 | @texline @math{\theta}, |
| 7895 | @infoline @expr{theta}, | 7883 | @infoline @expr{theta}, |
| 7896 | compute | 7884 | compute |
| 7897 | @texline @tmath{x + \cos \theta}, | 7885 | @texline @math{x + \cos \theta}, |
| 7898 | @infoline @expr{x + cos(theta)}, | 7886 | @infoline @expr{x + cos(theta)}, |
| 7899 | and count how many of the results are greater than one. Simple! | 7887 | and count how many of the results are greater than one. Simple! |
| 7900 | 7888 | ||
| @@ -8219,7 +8207,7 @@ precision slightly and try again: | |||
| 8219 | @noindent | 8207 | @noindent |
| 8220 | Aha! It's unlikely that an irrational number would equal a fraction | 8208 | Aha! It's unlikely that an irrational number would equal a fraction |
| 8221 | this simple to within ten digits, so our original number was probably | 8209 | this simple to within ten digits, so our original number was probably |
| 8222 | @texline @tmath{\sqrt{27 \pi / 53}}. | 8210 | @texline @math{\sqrt{27 \pi / 53}}. |
| 8223 | @infoline @expr{sqrt(27 pi / 53)}. | 8211 | @infoline @expr{sqrt(27 pi / 53)}. |
| 8224 | 8212 | ||
| 8225 | Notice that we didn't need to re-round the number when we reduced the | 8213 | Notice that we didn't need to re-round the number when we reduced the |
| @@ -8480,9 +8468,9 @@ as a possible value. | |||
| 8480 | The fourth calculation, @samp{1 / (-10 .. 10)}, has the same problem. | 8468 | The fourth calculation, @samp{1 / (-10 .. 10)}, has the same problem. |
| 8481 | Zero is buried inside the interval, but it's still a possible value. | 8469 | Zero is buried inside the interval, but it's still a possible value. |
| 8482 | It's not hard to see that the actual result of @samp{1 / (-10 .. 10)} | 8470 | It's not hard to see that the actual result of @samp{1 / (-10 .. 10)} |
| 8483 | will be either greater than @i{0.1}, or less than @i{-0.1}. Thus | 8471 | will be either greater than @mathit{0.1}, or less than @mathit{-0.1}. Thus |
| 8484 | the interval goes from minus infinity to plus infinity, with a ``hole'' | 8472 | the interval goes from minus infinity to plus infinity, with a ``hole'' |
| 8485 | in it from @i{-0.1} to @i{0.1}. Calc doesn't have any way to | 8473 | in it from @mathit{-0.1} to @mathit{0.1}. Calc doesn't have any way to |
| 8486 | represent this, so it just reports @samp{[-inf .. inf]} as the answer. | 8474 | represent this, so it just reports @samp{[-inf .. inf]} as the answer. |
| 8487 | It may be disappointing to hear ``the answer lies somewhere between | 8475 | It may be disappointing to hear ``the answer lies somewhere between |
| 8488 | minus infinity and plus infinity, inclusive,'' but that's the best | 8476 | minus infinity and plus infinity, inclusive,'' but that's the best |
| @@ -8502,9 +8490,9 @@ that interval arithmetic can do in this case. | |||
| 8502 | @end smallexample | 8490 | @end smallexample |
| 8503 | 8491 | ||
| 8504 | @noindent | 8492 | @noindent |
| 8505 | In the first case the result says, ``if a number is between @i{-3} and | 8493 | In the first case the result says, ``if a number is between @mathit{-3} and |
| 8506 | 3, its square is between 0 and 9.'' The second case says, ``the product | 8494 | 3, its square is between 0 and 9.'' The second case says, ``the product |
| 8507 | of two numbers each between @i{-3} and 3 is between @i{-9} and 9.'' | 8495 | of two numbers each between @mathit{-3} and 3 is between @mathit{-9} and 9.'' |
| 8508 | 8496 | ||
| 8509 | An interval form is not a number; it is a symbol that can stand for | 8497 | An interval form is not a number; it is a symbol that can stand for |
| 8510 | many different numbers. Two identical-looking interval forms can stand | 8498 | many different numbers. Two identical-looking interval forms can stand |
| @@ -9260,7 +9248,7 @@ algebraic entry, whichever way you prefer: | |||
| 9260 | 9248 | ||
| 9261 | @noindent | 9249 | @noindent |
| 9262 | Computing | 9250 | Computing |
| 9263 | @texline @tmath{\displaystyle{\sin x \over x}}: | 9251 | @texline @math{\displaystyle{\sin x \over x}}: |
| 9264 | @infoline @expr{sin(x) / x}: | 9252 | @infoline @expr{sin(x) / x}: |
| 9265 | 9253 | ||
| 9266 | Using the stack: @kbd{C-x ( @key{RET} S @key{TAB} / C-x )}. | 9254 | Using the stack: @kbd{C-x ( @key{RET} S @key{TAB} / C-x )}. |
| @@ -9331,7 +9319,7 @@ C-x ( ' [0, 1; 1, 1] ^ ($-1) * [1, 1] @key{RET} v u @key{DEL} C-x ) | |||
| 9331 | @noindent | 9319 | @noindent |
| 9332 | This program is quite efficient because Calc knows how to raise a | 9320 | This program is quite efficient because Calc knows how to raise a |
| 9333 | matrix (or other value) to the power @expr{n} in only | 9321 | matrix (or other value) to the power @expr{n} in only |
| 9334 | @texline @tmath{\log_2 n} | 9322 | @texline @math{\log_2 n} |
| 9335 | @infoline @expr{log(n,2)} | 9323 | @infoline @expr{log(n,2)} |
| 9336 | steps. For example, this program can compute the 1000th Fibonacci | 9324 | steps. For example, this program can compute the 1000th Fibonacci |
| 9337 | number (a 209-digit integer!) in about 10 steps; even though the | 9325 | number (a 209-digit integer!) in about 10 steps; even though the |
| @@ -9385,7 +9373,7 @@ harmonic number is 4.02. | |||
| 9385 | @noindent | 9373 | @noindent |
| 9386 | The first step is to compute the derivative @expr{f'(x)} and thus | 9374 | The first step is to compute the derivative @expr{f'(x)} and thus |
| 9387 | the formula | 9375 | the formula |
| 9388 | @texline @tmath{\displaystyle{x - {f(x) \over f'(x)}}}. | 9376 | @texline @math{\displaystyle{x - {f(x) \over f'(x)}}}. |
| 9389 | @infoline @expr{x - f(x)/f'(x)}. | 9377 | @infoline @expr{x - f(x)/f'(x)}. |
| 9390 | 9378 | ||
| 9391 | (Because this definition is long, it will be repeated in concise form | 9379 | (Because this definition is long, it will be repeated in concise form |
| @@ -9502,10 +9490,10 @@ method (among others) to look for numerical solutions to any equation. | |||
| 9502 | The first step is to adjust @expr{z} to be greater than 5. A simple | 9490 | The first step is to adjust @expr{z} to be greater than 5. A simple |
| 9503 | ``for'' loop will do the job here. If @expr{z} is less than 5, we | 9491 | ``for'' loop will do the job here. If @expr{z} is less than 5, we |
| 9504 | reduce the problem using | 9492 | reduce the problem using |
| 9505 | @texline @tmath{\psi(z) = \psi(z+1) - 1/z}. | 9493 | @texline @math{\psi(z) = \psi(z+1) - 1/z}. |
| 9506 | @infoline @expr{psi(z) = psi(z+1) - 1/z}. We go | 9494 | @infoline @expr{psi(z) = psi(z+1) - 1/z}. We go |
| 9507 | on to compute | 9495 | on to compute |
| 9508 | @texline @tmath{\psi(z+1)}, | 9496 | @texline @math{\psi(z+1)}, |
| 9509 | @infoline @expr{psi(z+1)}, | 9497 | @infoline @expr{psi(z+1)}, |
| 9510 | and remember to add back a factor of @expr{-1/z} when we're done. This | 9498 | and remember to add back a factor of @expr{-1/z} when we're done. This |
| 9511 | step is repeated until @expr{z > 5}. | 9499 | step is repeated until @expr{z > 5}. |
| @@ -9546,7 +9534,7 @@ are exactly equal, not just equal to within the current precision.) | |||
| 9546 | @end smallexample | 9534 | @end smallexample |
| 9547 | 9535 | ||
| 9548 | Now we compute the initial part of the sum: | 9536 | Now we compute the initial part of the sum: |
| 9549 | @texline @tmath{\ln z - {1 \over 2z}} | 9537 | @texline @math{\ln z - {1 \over 2z}} |
| 9550 | @infoline @expr{ln(z) - 1/2z} | 9538 | @infoline @expr{ln(z) - 1/2z} |
| 9551 | minus the adjustment factor. | 9539 | minus the adjustment factor. |
| 9552 | 9540 | ||
| @@ -9589,7 +9577,7 @@ up the value of @expr{2 n}. (Calc does have a summation command, | |||
| 9589 | @end smallexample | 9577 | @end smallexample |
| 9590 | 9578 | ||
| 9591 | This is the value of | 9579 | This is the value of |
| 9592 | @texline @tmath{-\gamma}, | 9580 | @texline @math{-\gamma}, |
| 9593 | @infoline @expr{- gamma}, | 9581 | @infoline @expr{- gamma}, |
| 9594 | with a slight bit of roundoff error. To get a full 12 digits, let's use | 9582 | with a slight bit of roundoff error. To get a full 12 digits, let's use |
| 9595 | a higher precision: | 9583 | a higher precision: |
| @@ -9624,7 +9612,7 @@ C-x ) | |||
| 9624 | @noindent | 9612 | @noindent |
| 9625 | Taking the derivative of a term of the form @expr{x^n} will produce | 9613 | Taking the derivative of a term of the form @expr{x^n} will produce |
| 9626 | a term like | 9614 | a term like |
| 9627 | @texline @tmath{n x^{n-1}}. | 9615 | @texline @math{n x^{n-1}}. |
| 9628 | @infoline @expr{n x^(n-1)}. | 9616 | @infoline @expr{n x^(n-1)}. |
| 9629 | Taking the derivative of a constant | 9617 | Taking the derivative of a constant |
| 9630 | produces zero. From this it is easy to see that the @expr{n}th | 9618 | produces zero. From this it is easy to see that the @expr{n}th |
| @@ -10198,7 +10186,7 @@ The first three keystrokes ``push'' the numbers 1 and 2 onto the stack. The | |||
| 10198 | @kbd{+} key always ``pops'' the top two numbers from the stack, adds them, | 10186 | @kbd{+} key always ``pops'' the top two numbers from the stack, adds them, |
| 10199 | and pushes the result (3) back onto the stack. This number is ready for | 10187 | and pushes the result (3) back onto the stack. This number is ready for |
| 10200 | further calculations: @kbd{5 -} pushes 5 onto the stack, then pops the | 10188 | further calculations: @kbd{5 -} pushes 5 onto the stack, then pops the |
| 10201 | 3 and 5, subtracts them, and pushes the result (@i{-2}). | 10189 | 3 and 5, subtracts them, and pushes the result (@mathit{-2}). |
| 10202 | 10190 | ||
| 10203 | Note that the ``top'' of the stack actually appears at the @emph{bottom} | 10191 | Note that the ``top'' of the stack actually appears at the @emph{bottom} |
| 10204 | of the buffer. A line containing a single @samp{.} character signifies | 10192 | of the buffer. A line containing a single @samp{.} character signifies |
| @@ -10261,7 +10249,7 @@ the two numbers on the top of the stack. The @kbd{n} key changes the sign | |||
| 10261 | of the number on the top of the stack or the number currently being entered. | 10249 | of the number on the top of the stack or the number currently being entered. |
| 10262 | The @kbd{_} key begins entry of a negative number or changes the sign of | 10250 | The @kbd{_} key begins entry of a negative number or changes the sign of |
| 10263 | the number currently being entered. The following sequences all enter the | 10251 | the number currently being entered. The following sequences all enter the |
| 10264 | number @i{-5} onto the stack: @kbd{0 @key{RET} 5 -}, @kbd{5 n @key{RET}}, | 10252 | number @mathit{-5} onto the stack: @kbd{0 @key{RET} 5 -}, @kbd{5 n @key{RET}}, |
| 10265 | @kbd{5 @key{RET} n}, @kbd{_ 5 @key{RET}}, @kbd{5 _ @key{RET}}. | 10253 | @kbd{5 @key{RET} n}, @kbd{_ 5 @key{RET}}, @kbd{5 _ @key{RET}}. |
| 10266 | 10254 | ||
| 10267 | Some other keys are active during numeric entry, such as @kbd{#} for | 10255 | Some other keys are active during numeric entry, such as @kbd{#} for |
| @@ -10282,7 +10270,7 @@ During numeric entry, the only editing key available is @key{DEL}. | |||
| 10282 | Calculations can also be entered in algebraic form. This is accomplished | 10270 | Calculations can also be entered in algebraic form. This is accomplished |
| 10283 | by typing the apostrophe key, @kbd{'}, followed by the expression in | 10271 | by typing the apostrophe key, @kbd{'}, followed by the expression in |
| 10284 | standard format: @kbd{@key{'} 2+3*4 @key{RET}} computes | 10272 | standard format: @kbd{@key{'} 2+3*4 @key{RET}} computes |
| 10285 | @texline @tmath{2+(3\times4) = 14} | 10273 | @texline @math{2+(3\times4) = 14} |
| 10286 | @infoline @expr{2+(3*4) = 14} | 10274 | @infoline @expr{2+(3*4) = 14} |
| 10287 | and pushes that on the stack. If you wish you can | 10275 | and pushes that on the stack. If you wish you can |
| 10288 | ignore the RPN aspect of Calc altogether and simply enter algebraic | 10276 | ignore the RPN aspect of Calc altogether and simply enter algebraic |
| @@ -10692,7 +10680,7 @@ approximation. This value will not need to be recomputed ever again | |||
| 10692 | unless you raise the precision still further. Many operations such as | 10680 | unless you raise the precision still further. Many operations such as |
| 10693 | logarithms and sines make use of similarly cached values such as | 10681 | logarithms and sines make use of similarly cached values such as |
| 10694 | @cpiover{4} and | 10682 | @cpiover{4} and |
| 10695 | @texline @tmath{\ln 2}. | 10683 | @texline @math{\ln 2}. |
| 10696 | @infoline @expr{ln(2)}. | 10684 | @infoline @expr{ln(2)}. |
| 10697 | The visible effect of caching is that | 10685 | The visible effect of caching is that |
| 10698 | high-precision computations may seem to do extra work the first time. | 10686 | high-precision computations may seem to do extra work the first time. |
| @@ -10851,10 +10839,10 @@ A floating-point number or @dfn{float} is a number stored in scientific | |||
| 10851 | notation. The number of significant digits in the fractional part is | 10839 | notation. The number of significant digits in the fractional part is |
| 10852 | governed by the current floating precision (@pxref{Precision}). The | 10840 | governed by the current floating precision (@pxref{Precision}). The |
| 10853 | range of acceptable values is from | 10841 | range of acceptable values is from |
| 10854 | @texline @tmath{10^{-3999999}} | 10842 | @texline @math{10^{-3999999}} |
| 10855 | @infoline @expr{10^-3999999} | 10843 | @infoline @expr{10^-3999999} |
| 10856 | (inclusive) to | 10844 | (inclusive) to |
| 10857 | @texline @tmath{10^{4000000}} | 10845 | @texline @math{10^{4000000}} |
| 10858 | @infoline @expr{10^4000000} | 10846 | @infoline @expr{10^4000000} |
| 10859 | (exclusive), plus the corresponding negative values and zero. | 10847 | (exclusive), plus the corresponding negative values and zero. |
| 10860 | 10848 | ||
| @@ -10926,16 +10914,16 @@ Rectangular complex numbers can also be displayed in @samp{@var{a}+@var{b}i} | |||
| 10926 | notation; @pxref{Complex Formats}. | 10914 | notation; @pxref{Complex Formats}. |
| 10927 | 10915 | ||
| 10928 | Polar complex numbers are displayed in the form | 10916 | Polar complex numbers are displayed in the form |
| 10929 | @texline `@t{(}@var{r}@t{;}@tmath{\theta}@t{)}' | 10917 | @texline `@t{(}@var{r}@t{;}@math{\theta}@t{)}' |
| 10930 | @infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}' | 10918 | @infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}' |
| 10931 | where @var{r} is the nonnegative magnitude and | 10919 | where @var{r} is the nonnegative magnitude and |
| 10932 | @texline @tmath{\theta} | 10920 | @texline @math{\theta} |
| 10933 | @infoline @var{theta} | 10921 | @infoline @var{theta} |
| 10934 | is the argument or phase angle. The range of | 10922 | is the argument or phase angle. The range of |
| 10935 | @texline @tmath{\theta} | 10923 | @texline @math{\theta} |
| 10936 | @infoline @var{theta} | 10924 | @infoline @var{theta} |
| 10937 | depends on the current angular mode (@pxref{Angular Modes}); it is | 10925 | depends on the current angular mode (@pxref{Angular Modes}); it is |
| 10938 | generally between @i{-180} and @i{+180} degrees or the equivalent range | 10926 | generally between @mathit{-180} and @mathit{+180} degrees or the equivalent range |
| 10939 | in radians. | 10927 | in radians. |
| 10940 | 10928 | ||
| 10941 | Complex numbers are entered in stages using incomplete objects. | 10929 | Complex numbers are entered in stages using incomplete objects. |
| @@ -10978,7 +10966,7 @@ larger, becomes arbitrarily close to zero. So you can imagine | |||
| 10978 | that if @expr{x} got ``all the way to infinity,'' then @expr{1 / x} | 10966 | that if @expr{x} got ``all the way to infinity,'' then @expr{1 / x} |
| 10979 | would go all the way to zero. Similarly, when they say that | 10967 | would go all the way to zero. Similarly, when they say that |
| 10980 | @samp{exp(inf) = inf}, they mean that | 10968 | @samp{exp(inf) = inf}, they mean that |
| 10981 | @texline @tmath{e^x} | 10969 | @texline @math{e^x} |
| 10982 | @infoline @expr{exp(x)} | 10970 | @infoline @expr{exp(x)} |
| 10983 | grows without bound as @expr{x} grows. The symbol @samp{-inf} likewise | 10971 | grows without bound as @expr{x} grows. The symbol @samp{-inf} likewise |
| 10984 | stands for an infinitely negative real value; for example, we say that | 10972 | stands for an infinitely negative real value; for example, we say that |
| @@ -11075,7 +11063,7 @@ of its elements. | |||
| 11075 | @tindex vec | 11063 | @tindex vec |
| 11076 | Algebraic functions for building vectors include @samp{vec(a, b, c)} | 11064 | Algebraic functions for building vectors include @samp{vec(a, b, c)} |
| 11077 | to build @samp{[a, b, c]}, @samp{cvec(a, n, m)} to build an | 11065 | to build @samp{[a, b, c]}, @samp{cvec(a, n, m)} to build an |
| 11078 | @texline @tmath{n\times m} | 11066 | @texline @math{n\times m} |
| 11079 | @infoline @var{n}x@var{m} | 11067 | @infoline @var{n}x@var{m} |
| 11080 | matrix of @samp{a}s, and @samp{index(n)} to build a vector of integers | 11068 | matrix of @samp{a}s, and @samp{index(n)} to build a vector of integers |
| 11081 | from 1 to @samp{n}. | 11069 | from 1 to @samp{n}. |
| @@ -11206,7 +11194,7 @@ The @var{mins} value is an integer or integer-valued float between 0 and 59. | |||
| 11206 | The @var{secs} value is a real number between 0 (inclusive) and 60 | 11194 | The @var{secs} value is a real number between 0 (inclusive) and 60 |
| 11207 | (exclusive). A positive HMS form is interpreted as @var{hours} + | 11195 | (exclusive). A positive HMS form is interpreted as @var{hours} + |
| 11208 | @var{mins}/60 + @var{secs}/3600. A negative HMS form is interpreted | 11196 | @var{mins}/60 + @var{secs}/3600. A negative HMS form is interpreted |
| 11209 | as @i{- @var{hours}} @i{-} @var{mins}/60 @i{-} @var{secs}/3600. | 11197 | as @mathit{- @var{hours}} @mathit{-} @var{mins}/60 @mathit{-} @var{secs}/3600. |
| 11210 | Display format for HMS forms is quite flexible. @xref{HMS Formats}. | 11198 | Display format for HMS forms is quite flexible. @xref{HMS Formats}. |
| 11211 | 11199 | ||
| 11212 | HMS forms can be added and subtracted. When they are added to numbers, | 11200 | HMS forms can be added and subtracted. When they are added to numbers, |
| @@ -11300,12 +11288,12 @@ between, say, @samp{<12:00am Mon Jan 1, 1900>} and | |||
| 11300 | 11288 | ||
| 11301 | Calc uses the Julian calendar for all dates before the year 1752, | 11289 | Calc uses the Julian calendar for all dates before the year 1752, |
| 11302 | including dates BC when the Julian calendar technically had not | 11290 | including dates BC when the Julian calendar technically had not |
| 11303 | yet been invented. Thus the claim that day number @i{-10000} is | 11291 | yet been invented. Thus the claim that day number @mathit{-10000} is |
| 11304 | called ``August 16, 28 BC'' should be taken with a grain of salt. | 11292 | called ``August 16, 28 BC'' should be taken with a grain of salt. |
| 11305 | 11293 | ||
| 11306 | Please note that there is no ``year 0''; the day before | 11294 | Please note that there is no ``year 0''; the day before |
| 11307 | @samp{<Sat Jan 1, +1>} is @samp{<Fri Dec 31, -1>}. These are | 11295 | @samp{<Sat Jan 1, +1>} is @samp{<Fri Dec 31, -1>}. These are |
| 11308 | days 0 and @i{-1} respectively in Calc's internal numbering scheme. | 11296 | days 0 and @mathit{-1} respectively in Calc's internal numbering scheme. |
| 11309 | 11297 | ||
| 11310 | @cindex Julian day counting | 11298 | @cindex Julian day counting |
| 11311 | Another day counting system in common use is, confusingly, also | 11299 | Another day counting system in common use is, confusingly, also |
| @@ -11313,7 +11301,7 @@ called ``Julian.'' It was invented in 1583 by Joseph Justus | |||
| 11313 | Scaliger, who named it in honor of his father Julius Caesar | 11301 | Scaliger, who named it in honor of his father Julius Caesar |
| 11314 | Scaliger. For obscure reasons he chose to start his day | 11302 | Scaliger. For obscure reasons he chose to start his day |
| 11315 | numbering on Jan 1, 4713 BC at noon, which in Calc's scheme | 11303 | numbering on Jan 1, 4713 BC at noon, which in Calc's scheme |
| 11316 | is @i{-1721423.5} (recall that Calc starts at midnight instead | 11304 | is @mathit{-1721423.5} (recall that Calc starts at midnight instead |
| 11317 | of noon). Thus to convert a Calc date code obtained by | 11305 | of noon). Thus to convert a Calc date code obtained by |
| 11318 | unpacking a date form into a Julian day number, simply add | 11306 | unpacking a date form into a Julian day number, simply add |
| 11319 | 1721423.5. The Julian code for @samp{6:00am Jan 9, 1991} | 11307 | 1721423.5. The Julian code for @samp{6:00am Jan 9, 1991} |
| @@ -11346,7 +11334,7 @@ an integer multiple of) some value @var{M}. Arithmetic modulo @var{M} | |||
| 11346 | often arises in number theory. Modulo forms are written | 11334 | often arises in number theory. Modulo forms are written |
| 11347 | `@var{a} @t{mod} @var{M}', | 11335 | `@var{a} @t{mod} @var{M}', |
| 11348 | where @var{a} and @var{M} are real numbers or HMS forms, and | 11336 | where @var{a} and @var{M} are real numbers or HMS forms, and |
| 11349 | @texline @tmath{0 \le a < M}. | 11337 | @texline @math{0 \le a < M}. |
| 11350 | @infoline @expr{0 <= a < @var{M}}. | 11338 | @infoline @expr{0 <= a < @var{M}}. |
| 11351 | In many applications @expr{a} and @expr{M} will be | 11339 | In many applications @expr{a} and @expr{M} will be |
| 11352 | integers but this is not required. | 11340 | integers but this is not required. |
| @@ -11378,7 +11366,7 @@ division is left in symbolic form. Other operations, such as square | |||
| 11378 | roots, are not yet supported for modulo forms. (Note that, although | 11366 | roots, are not yet supported for modulo forms. (Note that, although |
| 11379 | @w{`@t{(}@var{a} @t{mod} @var{M}@t{)^.5}'} will compute a ``modulo square root'' | 11367 | @w{`@t{(}@var{a} @t{mod} @var{M}@t{)^.5}'} will compute a ``modulo square root'' |
| 11380 | in the sense of reducing | 11368 | in the sense of reducing |
| 11381 | @texline @tmath{\sqrt a} | 11369 | @texline @math{\sqrt a} |
| 11382 | @infoline @expr{sqrt(a)} | 11370 | @infoline @expr{sqrt(a)} |
| 11383 | modulo @expr{M}, this is not a useful definition from the | 11371 | modulo @expr{M}, this is not a useful definition from the |
| 11384 | number-theoretical point of view.) | 11372 | number-theoretical point of view.) |
| @@ -11428,12 +11416,12 @@ The algebraic function @samp{makemod(a, m)} builds the modulo form | |||
| 11428 | @cindex Standard deviations | 11416 | @cindex Standard deviations |
| 11429 | An @dfn{error form} is a number with an associated standard | 11417 | An @dfn{error form} is a number with an associated standard |
| 11430 | deviation, as in @samp{2.3 +/- 0.12}. The notation | 11418 | deviation, as in @samp{2.3 +/- 0.12}. The notation |
| 11431 | @texline `@var{x} @t{+/-} @tmath{\sigma}' | 11419 | @texline `@var{x} @t{+/-} @math{\sigma}' |
| 11432 | @infoline `@var{x} @t{+/-} sigma' | 11420 | @infoline `@var{x} @t{+/-} sigma' |
| 11433 | stands for an uncertain value which follows | 11421 | stands for an uncertain value which follows |
| 11434 | a normal or Gaussian distribution of mean @expr{x} and standard | 11422 | a normal or Gaussian distribution of mean @expr{x} and standard |
| 11435 | deviation or ``error'' | 11423 | deviation or ``error'' |
| 11436 | @texline @tmath{\sigma}. | 11424 | @texline @math{\sigma}. |
| 11437 | @infoline @expr{sigma}. | 11425 | @infoline @expr{sigma}. |
| 11438 | Both the mean and the error can be either numbers or | 11426 | Both the mean and the error can be either numbers or |
| 11439 | formulas. Generally these are real numbers but the mean may also be | 11427 | formulas. Generally these are real numbers but the mean may also be |
| @@ -11444,7 +11432,7 @@ regular number by the Calculator. | |||
| 11444 | All arithmetic and transcendental functions accept error forms as input. | 11432 | All arithmetic and transcendental functions accept error forms as input. |
| 11445 | Operations on the mean-value part work just like operations on regular | 11433 | Operations on the mean-value part work just like operations on regular |
| 11446 | numbers. The error part for any function @expr{f(x)} (such as | 11434 | numbers. The error part for any function @expr{f(x)} (such as |
| 11447 | @texline @tmath{\sin x} | 11435 | @texline @math{\sin x} |
| 11448 | @infoline @expr{sin(x)}) | 11436 | @infoline @expr{sin(x)}) |
| 11449 | is defined by the error of @expr{x} times the derivative of @expr{f} | 11437 | is defined by the error of @expr{x} times the derivative of @expr{f} |
| 11450 | evaluated at the mean value of @expr{x}. For a two-argument function | 11438 | evaluated at the mean value of @expr{x}. For a two-argument function |
| @@ -11475,34 +11463,34 @@ Consult a good text on error analysis for a discussion of the proper use | |||
| 11475 | of standard deviations. Actual errors often are neither Gaussian-distributed | 11463 | of standard deviations. Actual errors often are neither Gaussian-distributed |
| 11476 | nor uncorrelated, and the above formulas are valid only when errors | 11464 | nor uncorrelated, and the above formulas are valid only when errors |
| 11477 | are small. As an example, the error arising from | 11465 | are small. As an example, the error arising from |
| 11478 | @texline `@t{sin(}@var{x} @t{+/-} @tmath{\sigma}@t{)}' | 11466 | @texline `@t{sin(}@var{x} @t{+/-} @math{\sigma}@t{)}' |
| 11479 | @infoline `@t{sin(}@var{x} @t{+/-} @var{sigma}@t{)}' | 11467 | @infoline `@t{sin(}@var{x} @t{+/-} @var{sigma}@t{)}' |
| 11480 | is | 11468 | is |
| 11481 | @texline `@tmath{\sigma} @t{abs(cos(}@var{x}@t{))}'. | 11469 | @texline `@math{\sigma} @t{abs(cos(}@var{x}@t{))}'. |
| 11482 | @infoline `@var{sigma} @t{abs(cos(}@var{x}@t{))}'. | 11470 | @infoline `@var{sigma} @t{abs(cos(}@var{x}@t{))}'. |
| 11483 | When @expr{x} is close to zero, | 11471 | When @expr{x} is close to zero, |
| 11484 | @texline @tmath{\cos x} | 11472 | @texline @math{\cos x} |
| 11485 | @infoline @expr{cos(x)} | 11473 | @infoline @expr{cos(x)} |
| 11486 | is close to one so the error in the sine is close to | 11474 | is close to one so the error in the sine is close to |
| 11487 | @texline @tmath{\sigma}; | 11475 | @texline @math{\sigma}; |
| 11488 | @infoline @expr{sigma}; | 11476 | @infoline @expr{sigma}; |
| 11489 | this makes sense, since | 11477 | this makes sense, since |
| 11490 | @texline @tmath{\sin x} | 11478 | @texline @math{\sin x} |
| 11491 | @infoline @expr{sin(x)} | 11479 | @infoline @expr{sin(x)} |
| 11492 | is approximately @expr{x} near zero, so a given error in @expr{x} will | 11480 | is approximately @expr{x} near zero, so a given error in @expr{x} will |
| 11493 | produce about the same error in the sine. Likewise, near 90 degrees | 11481 | produce about the same error in the sine. Likewise, near 90 degrees |
| 11494 | @texline @tmath{\cos x} | 11482 | @texline @math{\cos x} |
| 11495 | @infoline @expr{cos(x)} | 11483 | @infoline @expr{cos(x)} |
| 11496 | is nearly zero and so the computed error is | 11484 | is nearly zero and so the computed error is |
| 11497 | small: The sine curve is nearly flat in that region, so an error in @expr{x} | 11485 | small: The sine curve is nearly flat in that region, so an error in @expr{x} |
| 11498 | has relatively little effect on the value of | 11486 | has relatively little effect on the value of |
| 11499 | @texline @tmath{\sin x}. | 11487 | @texline @math{\sin x}. |
| 11500 | @infoline @expr{sin(x)}. | 11488 | @infoline @expr{sin(x)}. |
| 11501 | However, consider @samp{sin(90 +/- 1000)}. The cosine of 90 is zero, so | 11489 | However, consider @samp{sin(90 +/- 1000)}. The cosine of 90 is zero, so |
| 11502 | Calc will report zero error! We get an obviously wrong result because | 11490 | Calc will report zero error! We get an obviously wrong result because |
| 11503 | we have violated the small-error approximation underlying the error | 11491 | we have violated the small-error approximation underlying the error |
| 11504 | analysis. If the error in @expr{x} had been small, the error in | 11492 | analysis. If the error in @expr{x} had been small, the error in |
| 11505 | @texline @tmath{\sin x} | 11493 | @texline @math{\sin x} |
| 11506 | @infoline @expr{sin(x)} | 11494 | @infoline @expr{sin(x)} |
| 11507 | would indeed have been negligible. | 11495 | would indeed have been negligible. |
| 11508 | 11496 | ||
| @@ -11611,11 +11599,11 @@ contain zero inside them Calc is forced to give the result, | |||
| 11611 | While it may seem that intervals and error forms are similar, they are | 11599 | While it may seem that intervals and error forms are similar, they are |
| 11612 | based on entirely different concepts of inexact quantities. An error | 11600 | based on entirely different concepts of inexact quantities. An error |
| 11613 | form | 11601 | form |
| 11614 | @texline `@var{x} @t{+/-} @tmath{\sigma}' | 11602 | @texline `@var{x} @t{+/-} @math{\sigma}' |
| 11615 | @infoline `@var{x} @t{+/-} @var{sigma}' | 11603 | @infoline `@var{x} @t{+/-} @var{sigma}' |
| 11616 | means a variable is random, and its value could | 11604 | means a variable is random, and its value could |
| 11617 | be anything but is ``probably'' within one | 11605 | be anything but is ``probably'' within one |
| 11618 | @texline @tmath{\sigma} | 11606 | @texline @math{\sigma} |
| 11619 | @infoline @var{sigma} | 11607 | @infoline @var{sigma} |
| 11620 | of the mean value @expr{x}. An interval | 11608 | of the mean value @expr{x}. An interval |
| 11621 | `@t{[}@var{a} @t{..@:} @var{b}@t{]}' means a | 11609 | `@t{[}@var{a} @t{..@:} @var{b}@t{]}' means a |
| @@ -11849,7 +11837,7 @@ the C-style ``if'' operator @samp{a?b:c} [@code{if}]; | |||
| 11849 | 11837 | ||
| 11850 | Note that, unlike in usual computer notation, multiplication binds more | 11838 | Note that, unlike in usual computer notation, multiplication binds more |
| 11851 | strongly than division: @samp{a*b/c*d} is equivalent to | 11839 | strongly than division: @samp{a*b/c*d} is equivalent to |
| 11852 | @texline @tmath{a b \over c d}. | 11840 | @texline @math{a b \over c d}. |
| 11853 | @infoline @expr{(a*b)/(c*d)}. | 11841 | @infoline @expr{(a*b)/(c*d)}. |
| 11854 | 11842 | ||
| 11855 | @cindex Multiplication, implicit | 11843 | @cindex Multiplication, implicit |
| @@ -12047,11 +12035,11 @@ intervening stack elements toward the top. @kbd{M-@key{TAB}} moves the | |||
| 12047 | element at level @var{n} up to the top. (Compare with @key{LFD}, | 12035 | element at level @var{n} up to the top. (Compare with @key{LFD}, |
| 12048 | which copies instead of moving the element in level @var{n}.) | 12036 | which copies instead of moving the element in level @var{n}.) |
| 12049 | 12037 | ||
| 12050 | With a negative argument @i{-@var{n}}, @key{TAB} rotates the stack | 12038 | With a negative argument @mathit{-@var{n}}, @key{TAB} rotates the stack |
| 12051 | to move the object in level @var{n} to the deepest place in the | 12039 | to move the object in level @var{n} to the deepest place in the |
| 12052 | stack, and the object in level @i{@var{n}+1} to the top. @kbd{M-@key{TAB}} | 12040 | stack, and the object in level @mathit{@var{n}+1} to the top. @kbd{M-@key{TAB}} |
| 12053 | rotates the deepest stack element to be in level @i{n}, also | 12041 | rotates the deepest stack element to be in level @mathit{n}, also |
| 12054 | putting the top stack element in level @i{@var{n}+1}. | 12042 | putting the top stack element in level @mathit{@var{n}+1}. |
| 12055 | 12043 | ||
| 12056 | @xref{Selecting Subformulas}, for a way to apply these commands to | 12044 | @xref{Selecting Subformulas}, for a way to apply these commands to |
| 12057 | any portion of a vector or formula on the stack. | 12045 | any portion of a vector or formula on the stack. |
| @@ -12346,8 +12334,8 @@ inside it, @kbd{m F} will not automatically load the new file. This | |||
| 12346 | is because you are presumably switching to your @file{~/.emacs} file, | 12334 | is because you are presumably switching to your @file{~/.emacs} file, |
| 12347 | which may contain other things you don't want to reread. You can give | 12335 | which may contain other things you don't want to reread. You can give |
| 12348 | a numeric prefix argument of 1 to @kbd{m F} to force it to read the | 12336 | a numeric prefix argument of 1 to @kbd{m F} to force it to read the |
| 12349 | file no matter what its name. Conversely, an argument of @i{-1} tells | 12337 | file no matter what its name. Conversely, an argument of @mathit{-1} tells |
| 12350 | @kbd{m F} @emph{not} to read the new file. An argument of 2 or @i{-2} | 12338 | @kbd{m F} @emph{not} to read the new file. An argument of 2 or @mathit{-2} |
| 12351 | tells @kbd{m F} not to reset the modes to their defaults beforehand, | 12339 | tells @kbd{m F} not to reset the modes to their defaults beforehand, |
| 12352 | which is useful if you intend your new file to have a variant of the | 12340 | which is useful if you intend your new file to have a variant of the |
| 12353 | modes present in the file you were using before. | 12341 | modes present in the file you were using before. |
| @@ -12452,7 +12440,7 @@ Hyperbolic Flag, which transforms @code{calc-sin} into @code{calc-sinh}. | |||
| 12452 | If both of these flags are set at once, the effect will be | 12440 | If both of these flags are set at once, the effect will be |
| 12453 | @code{calc-arcsinh}. (The Hyperbolic flag is also used by some | 12441 | @code{calc-arcsinh}. (The Hyperbolic flag is also used by some |
| 12454 | non-trigonometric commands; for example @kbd{H L} computes a base-10, | 12442 | non-trigonometric commands; for example @kbd{H L} computes a base-10, |
| 12455 | instead of base-@i{e}, logarithm.) | 12443 | instead of base-@mathit{e}, logarithm.) |
| 12456 | 12444 | ||
| 12457 | Command names like @code{calc-arcsin} are provided for completeness, and | 12445 | Command names like @code{calc-arcsin} are provided for completeness, and |
| 12458 | may be executed with @kbd{x} or @kbd{M-x}. Their effect is simply to | 12446 | may be executed with @kbd{x} or @kbd{M-x}. Their effect is simply to |
| @@ -12596,7 +12584,7 @@ i.e., @kbd{C-u 0 m i}, turns on a ``positive infinite mode'' in | |||
| 12596 | which zero is treated as positive instead of being directionless. | 12584 | which zero is treated as positive instead of being directionless. |
| 12597 | Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode. | 12585 | Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode. |
| 12598 | Note that zero never actually has a sign in Calc; there are no | 12586 | Note that zero never actually has a sign in Calc; there are no |
| 12599 | separate representations for @i{+0} and @i{-0}. Positive | 12587 | separate representations for @mathit{+0} and @mathit{-0}. Positive |
| 12600 | infinite mode merely changes the interpretation given to the | 12588 | infinite mode merely changes the interpretation given to the |
| 12601 | single symbol, @samp{0}. One consequence of this is that, while | 12589 | single symbol, @samp{0}. One consequence of this is that, while |
| 12602 | you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0} | 12590 | you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0} |
| @@ -12987,7 +12975,7 @@ Numbers. (Real or complex.) | |||
| 12987 | Calc uses this information to determine when certain simplifications | 12975 | Calc uses this information to determine when certain simplifications |
| 12988 | of formulas are safe. For example, @samp{(x^y)^z} cannot be | 12976 | of formulas are safe. For example, @samp{(x^y)^z} cannot be |
| 12989 | simplified to @samp{x^(y z)} in general; for example, | 12977 | simplified to @samp{x^(y z)} in general; for example, |
| 12990 | @samp{((-3)^2)^1:2} is 3, but @samp{(-3)^(2*1:2) = (-3)^1} is @i{-3}. | 12978 | @samp{((-3)^2)^1:2} is 3, but @samp{(-3)^(2*1:2) = (-3)^1} is @mathit{-3}. |
| 12991 | However, this simplification @emph{is} safe if @code{z} is known | 12979 | However, this simplification @emph{is} safe if @code{z} is known |
| 12992 | to be an integer, or if @code{x} is known to be a nonnegative | 12980 | to be an integer, or if @code{x} is known to be a nonnegative |
| 12993 | real number. If you have given declarations that allow Calc to | 12981 | real number. If you have given declarations that allow Calc to |
| @@ -13100,7 +13088,7 @@ The value is a constant with respect to other variables. | |||
| 13100 | @end table | 13088 | @end table |
| 13101 | 13089 | ||
| 13102 | Calc does not check the declarations for a variable when you store | 13090 | Calc does not check the declarations for a variable when you store |
| 13103 | a value in it. However, storing @i{-3.5} in a variable that has | 13091 | a value in it. However, storing @mathit{-3.5} in a variable that has |
| 13104 | been declared @code{pos}, @code{int}, or @code{matrix} may have | 13092 | been declared @code{pos}, @code{int}, or @code{matrix} may have |
| 13105 | unexpected effects; Calc may evaluate @samp{sqrt(x^2)} to @expr{3.5} | 13093 | unexpected effects; Calc may evaluate @samp{sqrt(x^2)} to @expr{3.5} |
| 13106 | if it substitutes the value first, or to @expr{-3.5} if @code{x} | 13094 | if it substitutes the value first, or to @expr{-3.5} if @code{x} |
| @@ -13335,7 +13323,7 @@ command causes integers to be padded out with leading zeros according to the | |||
| 13335 | current binary word size. (@xref{Binary Functions}, for a discussion of | 13323 | current binary word size. (@xref{Binary Functions}, for a discussion of |
| 13336 | word size.) If the absolute value of the word size is @expr{w}, all integers | 13324 | word size.) If the absolute value of the word size is @expr{w}, all integers |
| 13337 | are displayed with at least enough digits to represent | 13325 | are displayed with at least enough digits to represent |
| 13338 | @texline @tmath{2^w-1} | 13326 | @texline @math{2^w-1} |
| 13339 | @infoline @expr{(2^w)-1} | 13327 | @infoline @expr{(2^w)-1} |
| 13340 | in the current radix. (Larger integers will still be displayed in their | 13328 | in the current radix. (Larger integers will still be displayed in their |
| 13341 | entirety.) | 13329 | entirety.) |
| @@ -14236,10 +14224,10 @@ special names (like @code{\sin}) will use curly braces instead of | |||
| 14236 | parentheses for very simple arguments. During input, curly braces and | 14224 | parentheses for very simple arguments. During input, curly braces and |
| 14237 | parentheses work equally well for grouping, but when the document is | 14225 | parentheses work equally well for grouping, but when the document is |
| 14238 | formatted the curly braces will be invisible. Thus the printed result is | 14226 | formatted the curly braces will be invisible. Thus the printed result is |
| 14239 | @texline @tmath{\sin{2 x}} | 14227 | @texline @math{\sin{2 x}} |
| 14240 | @infoline @expr{sin 2x} | 14228 | @infoline @expr{sin 2x} |
| 14241 | but | 14229 | but |
| 14242 | @texline @tmath{\sin(2 + x)}. | 14230 | @texline @math{\sin(2 + x)}. |
| 14243 | @infoline @expr{sin(2 + x)}. | 14231 | @infoline @expr{sin(2 + x)}. |
| 14244 | 14232 | ||
| 14245 | Function and variable names not treated specially by @TeX{} are simply | 14233 | Function and variable names not treated specially by @TeX{} are simply |
| @@ -15733,19 +15721,19 @@ Polar mode. Value is 0 (rectangular) or 1 (polar); default is 0. | |||
| 15733 | Command is @kbd{m p}. | 15721 | Command is @kbd{m p}. |
| 15734 | 15722 | ||
| 15735 | @item | 15723 | @item |
| 15736 | Matrix/scalar mode. Default value is @i{-1}. Value is 0 for scalar | 15724 | Matrix/scalar mode. Default value is @mathit{-1}. Value is 0 for scalar |
| 15737 | mode, @i{-2} for matrix mode, or @var{N} for | 15725 | mode, @mathit{-2} for matrix mode, or @var{N} for |
| 15738 | @texline @tmath{N\times N} | 15726 | @texline @math{N\times N} |
| 15739 | @infoline @var{N}x@var{N} | 15727 | @infoline @var{N}x@var{N} |
| 15740 | matrix mode. Command is @kbd{m v}. | 15728 | matrix mode. Command is @kbd{m v}. |
| 15741 | 15729 | ||
| 15742 | @item | 15730 | @item |
| 15743 | Simplification mode. Default is 1. Value is @i{-1} for off (@kbd{m O}), | 15731 | Simplification mode. Default is 1. Value is @mathit{-1} for off (@kbd{m O}), |
| 15744 | 0 for @kbd{m N}, 2 for @kbd{m B}, 3 for @kbd{m A}, 4 for @kbd{m E}, | 15732 | 0 for @kbd{m N}, 2 for @kbd{m B}, 3 for @kbd{m A}, 4 for @kbd{m E}, |
| 15745 | or 5 for @w{@kbd{m U}}. The @kbd{m D} command accepts these prefixes. | 15733 | or 5 for @w{@kbd{m U}}. The @kbd{m D} command accepts these prefixes. |
| 15746 | 15734 | ||
| 15747 | @item | 15735 | @item |
| 15748 | Infinite mode. Default is @i{-1} (off). Value is 1 if the mode is on, | 15736 | Infinite mode. Default is @mathit{-1} (off). Value is 1 if the mode is on, |
| 15749 | or 0 if the mode is on with positive zeros. Command is @kbd{m i}. | 15737 | or 0 if the mode is on with positive zeros. Command is @kbd{m i}. |
| 15750 | @end enumerate | 15738 | @end enumerate |
| 15751 | 15739 | ||
| @@ -16086,7 +16074,7 @@ infinite in different directions the result is @code{nan}. | |||
| 16086 | @tindex - | 16074 | @tindex - |
| 16087 | The @kbd{-} (@code{calc-minus}) command subtracts two values. The top | 16075 | The @kbd{-} (@code{calc-minus}) command subtracts two values. The top |
| 16088 | number on the stack is subtracted from the one behind it, so that the | 16076 | number on the stack is subtracted from the one behind it, so that the |
| 16089 | computation @kbd{5 @key{RET} 2 -} produces 3, not @i{-3}. All options | 16077 | computation @kbd{5 @key{RET} 2 -} produces 3, not @mathit{-3}. All options |
| 16090 | available for @kbd{+} are available for @kbd{-} as well. | 16078 | available for @kbd{+} are available for @kbd{-} as well. |
| 16091 | 16079 | ||
| 16092 | @kindex * | 16080 | @kindex * |
| @@ -16230,7 +16218,7 @@ absolute value squared of a number, vector or matrix, or error form. | |||
| 16230 | @pindex calc-sign | 16218 | @pindex calc-sign |
| 16231 | @tindex sign | 16219 | @tindex sign |
| 16232 | The @kbd{f s} (@code{calc-sign}) [@code{sign}] command returns 1 if its | 16220 | The @kbd{f s} (@code{calc-sign}) [@code{sign}] command returns 1 if its |
| 16233 | argument is positive, @i{-1} if its argument is negative, or 0 if its | 16221 | argument is positive, @mathit{-1} if its argument is negative, or 0 if its |
| 16234 | argument is zero. In algebraic form, you can also write @samp{sign(a,x)} | 16222 | argument is zero. In algebraic form, you can also write @samp{sign(a,x)} |
| 16235 | which evaluates to @samp{x * sign(a)}, i.e., either @samp{x}, @samp{-x}, or | 16223 | which evaluates to @samp{x * sign(a)}, i.e., either @samp{x}, @samp{-x}, or |
| 16236 | zero depending on the sign of @samp{a}. | 16224 | zero depending on the sign of @samp{a}. |
| @@ -16293,7 +16281,7 @@ The @kbd{f M} (@code{calc-mant-part}) [@code{mant}] function extracts | |||
| 16293 | the ``mantissa'' part @expr{m} of its floating-point argument; @kbd{f X} | 16281 | the ``mantissa'' part @expr{m} of its floating-point argument; @kbd{f X} |
| 16294 | (@code{calc-xpon-part}) [@code{xpon}] extracts the ``exponent'' part | 16282 | (@code{calc-xpon-part}) [@code{xpon}] extracts the ``exponent'' part |
| 16295 | @expr{e}. The original number is equal to | 16283 | @expr{e}. The original number is equal to |
| 16296 | @texline @tmath{m \times 10^e}, | 16284 | @texline @math{m \times 10^e}, |
| 16297 | @infoline @expr{m * 10^e}, | 16285 | @infoline @expr{m * 10^e}, |
| 16298 | where @expr{m} is in the interval @samp{[1.0 ..@: 10.0)} except that | 16286 | where @expr{m} is in the interval @samp{[1.0 ..@: 10.0)} except that |
| 16299 | @expr{m=e=0} if the original number is zero. For integers | 16287 | @expr{m=e=0} if the original number is zero. For integers |
| @@ -16326,7 +16314,7 @@ For example, incrementing @samp{12.3456} when the current precision | |||
| 16326 | is 6 digits yields @samp{12.3457}. If the current precision had been | 16314 | is 6 digits yields @samp{12.3457}. If the current precision had been |
| 16327 | 8 digits, the result would have been @samp{12.345601}. Incrementing | 16315 | 8 digits, the result would have been @samp{12.345601}. Incrementing |
| 16328 | @samp{0.0} produces | 16316 | @samp{0.0} produces |
| 16329 | @texline @tmath{10^{-p}}, | 16317 | @texline @math{10^{-p}}, |
| 16330 | @infoline @expr{10^-p}, | 16318 | @infoline @expr{10^-p}, |
| 16331 | where @expr{p} is the current | 16319 | where @expr{p} is the current |
| 16332 | precision. These operations are defined only on integers and floats. | 16320 | precision. These operations are defined only on integers and floats. |
| @@ -16367,7 +16355,7 @@ expressed as an integer-valued floating-point number. | |||
| 16367 | The @kbd{F} (@code{calc-floor}) [@code{floor} or @code{ffloor}] command | 16355 | The @kbd{F} (@code{calc-floor}) [@code{floor} or @code{ffloor}] command |
| 16368 | truncates a real number to the next lower integer, i.e., toward minus | 16356 | truncates a real number to the next lower integer, i.e., toward minus |
| 16369 | infinity. Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces | 16357 | infinity. Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces |
| 16370 | @i{-4}. | 16358 | @mathit{-4}. |
| 16371 | 16359 | ||
| 16372 | @kindex I F | 16360 | @kindex I F |
| 16373 | @pindex calc-ceiling | 16361 | @pindex calc-ceiling |
| @@ -16379,7 +16367,7 @@ infinity. Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces | |||
| 16379 | @kindex H I F | 16367 | @kindex H I F |
| 16380 | The @kbd{I F} (@code{calc-ceiling}) [@code{ceil} or @code{fceil}] | 16368 | The @kbd{I F} (@code{calc-ceiling}) [@code{ceil} or @code{fceil}] |
| 16381 | command truncates toward positive infinity. Thus @kbd{3.6 I F} produces | 16369 | command truncates toward positive infinity. Thus @kbd{3.6 I F} produces |
| 16382 | 4, and @kbd{_3.6 I F} produces @i{-3}. | 16370 | 4, and @kbd{_3.6 I F} produces @mathit{-3}. |
| 16383 | 16371 | ||
| 16384 | @kindex R | 16372 | @kindex R |
| 16385 | @pindex calc-round | 16373 | @pindex calc-round |
| @@ -16393,7 +16381,7 @@ The @kbd{R} (@code{calc-round}) [@code{round} or @code{fround}] command | |||
| 16393 | rounds to the nearest integer. When the fractional part is .5 exactly, | 16381 | rounds to the nearest integer. When the fractional part is .5 exactly, |
| 16394 | this command rounds away from zero. (All other rounding in the | 16382 | this command rounds away from zero. (All other rounding in the |
| 16395 | Calculator uses this convention as well.) Thus @kbd{3.5 R} produces 4 | 16383 | Calculator uses this convention as well.) Thus @kbd{3.5 R} produces 4 |
| 16396 | but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @i{-4}. | 16384 | but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @mathit{-4}. |
| 16397 | 16385 | ||
| 16398 | @kindex I R | 16386 | @kindex I R |
| 16399 | @pindex calc-trunc | 16387 | @pindex calc-trunc |
| @@ -16406,7 +16394,7 @@ but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @i{-4}. | |||
| 16406 | The @kbd{I R} (@code{calc-trunc}) [@code{trunc} or @code{ftrunc}] | 16394 | The @kbd{I R} (@code{calc-trunc}) [@code{trunc} or @code{ftrunc}] |
| 16407 | command truncates toward zero. In other words, it ``chops off'' | 16395 | command truncates toward zero. In other words, it ``chops off'' |
| 16408 | everything after the decimal point. Thus @kbd{3.6 I R} produces 3 and | 16396 | everything after the decimal point. Thus @kbd{3.6 I R} produces 3 and |
| 16409 | @kbd{_3.6 I R} produces @i{-3}. | 16397 | @kbd{_3.6 I R} produces @mathit{-3}. |
| 16410 | 16398 | ||
| 16411 | These functions may not be applied meaningfully to error forms, but they | 16399 | These functions may not be applied meaningfully to error forms, but they |
| 16412 | do work for intervals. As a convenience, applying @code{floor} to a | 16400 | do work for intervals. As a convenience, applying @code{floor} to a |
| @@ -16484,10 +16472,10 @@ this command replaces each element by its complex conjugate. | |||
| 16484 | The @kbd{G} (@code{calc-argument}) [@code{arg}] command computes the | 16472 | The @kbd{G} (@code{calc-argument}) [@code{arg}] command computes the |
| 16485 | ``argument'' or polar angle of a complex number. For a number in polar | 16473 | ``argument'' or polar angle of a complex number. For a number in polar |
| 16486 | notation, this is simply the second component of the pair | 16474 | notation, this is simply the second component of the pair |
| 16487 | @texline `@t{(}@var{r}@t{;}@tmath{\theta}@t{)}'. | 16475 | @texline `@t{(}@var{r}@t{;}@math{\theta}@t{)}'. |
| 16488 | @infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}'. | 16476 | @infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}'. |
| 16489 | The result is expressed according to the current angular mode and will | 16477 | The result is expressed according to the current angular mode and will |
| 16490 | be in the range @i{-180} degrees (exclusive) to @i{+180} degrees | 16478 | be in the range @mathit{-180} degrees (exclusive) to @mathit{+180} degrees |
| 16491 | (inclusive), or the equivalent range in radians. | 16479 | (inclusive), or the equivalent range in radians. |
| 16492 | 16480 | ||
| 16493 | @pindex calc-imaginary | 16481 | @pindex calc-imaginary |
| @@ -16518,8 +16506,8 @@ or matrix argument, these functions operate element-wise. | |||
| 16518 | @pindex calc-pack | 16506 | @pindex calc-pack |
| 16519 | The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on | 16507 | The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on |
| 16520 | the stack into a composite object such as a complex number. With | 16508 | the stack into a composite object such as a complex number. With |
| 16521 | a prefix argument of @i{-1}, it produces a rectangular complex number; | 16509 | a prefix argument of @mathit{-1}, it produces a rectangular complex number; |
| 16522 | with an argument of @i{-2}, it produces a polar complex number. | 16510 | with an argument of @mathit{-2}, it produces a polar complex number. |
| 16523 | (Also, @pxref{Building Vectors}.) | 16511 | (Also, @pxref{Building Vectors}.) |
| 16524 | 16512 | ||
| 16525 | @ignore | 16513 | @ignore |
| @@ -16643,7 +16631,7 @@ already a polar complex number, it uses @code{rect} instead. The | |||
| 16643 | The @kbd{c c} (@code{calc-clean}) [@code{pclean}] command ``cleans'' the | 16631 | The @kbd{c c} (@code{calc-clean}) [@code{pclean}] command ``cleans'' the |
| 16644 | number on the top of the stack. Floating point numbers are re-rounded | 16632 | number on the top of the stack. Floating point numbers are re-rounded |
| 16645 | according to the current precision. Polar numbers whose angular | 16633 | according to the current precision. Polar numbers whose angular |
| 16646 | components have strayed from the @i{-180} to @i{+180} degree range | 16634 | components have strayed from the @mathit{-180} to @mathit{+180} degree range |
| 16647 | are normalized. (Note that results will be undesirable if the current | 16635 | are normalized. (Note that results will be undesirable if the current |
| 16648 | angular mode is different from the one under which the number was | 16636 | angular mode is different from the one under which the number was |
| 16649 | produced!) Integers and fractions are generally unaffected by this | 16637 | produced!) Integers and fractions are generally unaffected by this |
| @@ -16899,8 +16887,8 @@ of the input date form are lost. With a numeric prefix argument | |||
| 16899 | @var{n} in the range from 1 to 366, @kbd{t Y} computes the | 16887 | @var{n} in the range from 1 to 366, @kbd{t Y} computes the |
| 16900 | @var{n}th day of the year (366 is treated as 365 in non-leap | 16888 | @var{n}th day of the year (366 is treated as 365 in non-leap |
| 16901 | years). A prefix argument of 0 computes the last day of the | 16889 | years). A prefix argument of 0 computes the last day of the |
| 16902 | year (December 31). A negative prefix argument from @i{-1} to | 16890 | year (December 31). A negative prefix argument from @mathit{-1} to |
| 16903 | @i{-12} computes the first day of the @var{n}th month of the year. | 16891 | @mathit{-12} computes the first day of the @var{n}th month of the year. |
| 16904 | 16892 | ||
| 16905 | @kindex t W | 16893 | @kindex t W |
| 16906 | @pindex calc-new-week | 16894 | @pindex calc-new-week |
| @@ -17269,7 +17257,7 @@ The Lisp variable @code{math-daylight-savings-hook} holds the | |||
| 17269 | name of a function that is used to compute the daylight savings | 17257 | name of a function that is used to compute the daylight savings |
| 17270 | adjustment for a given date. The default is | 17258 | adjustment for a given date. The default is |
| 17271 | @code{math-std-daylight-savings}, which computes an adjustment | 17259 | @code{math-std-daylight-savings}, which computes an adjustment |
| 17272 | (either 0 or @i{-1}) using the North American rules given above. | 17260 | (either 0 or @mathit{-1}) using the North American rules given above. |
| 17273 | 17261 | ||
| 17274 | The daylight savings hook function is called with four arguments: | 17262 | The daylight savings hook function is called with four arguments: |
| 17275 | The date, as a floating-point number in standard Calc format; | 17263 | The date, as a floating-point number in standard Calc format; |
| @@ -17317,7 +17305,7 @@ daylight savings hook: | |||
| 17317 | @noindent | 17305 | @noindent |
| 17318 | The @code{bump} parameter is equal to zero when Calc is converting | 17306 | The @code{bump} parameter is equal to zero when Calc is converting |
| 17319 | from a date form in a generalized time zone into a GMT date value. | 17307 | from a date form in a generalized time zone into a GMT date value. |
| 17320 | It is @i{-1} when Calc is converting in the other direction. The | 17308 | It is @mathit{-1} when Calc is converting in the other direction. The |
| 17321 | adjustments shown above ensure that the conversion behaves correctly | 17309 | adjustments shown above ensure that the conversion behaves correctly |
| 17322 | and reasonably around the 2 a.m.@: transition in each direction. | 17310 | and reasonably around the 2 a.m.@: transition in each direction. |
| 17323 | 17311 | ||
| @@ -17944,10 +17932,10 @@ particular, negative arguments are converted to positive integers modulo | |||
| 17944 | 17932 | ||
| 17945 | If the word size is negative, binary operations produce 2's complement | 17933 | If the word size is negative, binary operations produce 2's complement |
| 17946 | integers from | 17934 | integers from |
| 17947 | @texline @tmath{-2^{-w-1}} | 17935 | @texline @math{-2^{-w-1}} |
| 17948 | @infoline @expr{-(2^(-w-1))} | 17936 | @infoline @expr{-(2^(-w-1))} |
| 17949 | to | 17937 | to |
| 17950 | @texline @tmath{2^{-w-1}-1} | 17938 | @texline @math{2^{-w-1}-1} |
| 17951 | @infoline @expr{2^(-w-1)-1} | 17939 | @infoline @expr{2^(-w-1)-1} |
| 17952 | inclusive. Either mode accepts inputs in any range; the sign of | 17940 | inclusive. Either mode accepts inputs in any range; the sign of |
| 17953 | @expr{w} affects only the results produced. | 17941 | @expr{w} affects only the results produced. |
| @@ -17963,7 +17951,7 @@ addition do not use the current word size, since integer addition | |||
| 17963 | generally is not ``binary.'' (However, @pxref{Simplification Modes}, | 17951 | generally is not ``binary.'' (However, @pxref{Simplification Modes}, |
| 17964 | @code{calc-bin-simplify-mode}.) For example, with a word size of 8 | 17952 | @code{calc-bin-simplify-mode}.) For example, with a word size of 8 |
| 17965 | bits @kbd{b c} converts a number to the range 0 to 255; with a word | 17953 | bits @kbd{b c} converts a number to the range 0 to 255; with a word |
| 17966 | size of @i{-8} @kbd{b c} converts to the range @i{-128} to 127. | 17954 | size of @mathit{-8} @kbd{b c} converts to the range @mathit{-128} to 127. |
| 17967 | 17955 | ||
| 17968 | @kindex b w | 17956 | @kindex b w |
| 17969 | @pindex calc-word-size | 17957 | @pindex calc-word-size |
| @@ -17979,7 +17967,7 @@ When the binary operations are written in symbolic form, they take an | |||
| 17979 | optional second (or third) word-size parameter. When a formula like | 17967 | optional second (or third) word-size parameter. When a formula like |
| 17980 | @samp{and(a,b)} is finally evaluated, the word size current at that time | 17968 | @samp{and(a,b)} is finally evaluated, the word size current at that time |
| 17981 | will be used, but when @samp{and(a,b,-8)} is evaluated, a word size of | 17969 | will be used, but when @samp{and(a,b,-8)} is evaluated, a word size of |
| 17982 | @i{-8} will always be used. A symbolic binary function will be left | 17970 | @mathit{-8} will always be used. A symbolic binary function will be left |
| 17983 | in symbolic form unless the all of its argument(s) are integers or | 17971 | in symbolic form unless the all of its argument(s) are integers or |
| 17984 | integer-valued floats. | 17972 | integer-valued floats. |
| 17985 | 17973 | ||
| @@ -18131,11 +18119,11 @@ One miscellaneous command is shift-@kbd{P} (@code{calc-pi}), which pushes | |||
| 18131 | the value of @cpi{} (at the current precision) onto the stack. With the | 18119 | the value of @cpi{} (at the current precision) onto the stack. With the |
| 18132 | Hyperbolic flag, it pushes the value @expr{e}, the base of natural logarithms. | 18120 | Hyperbolic flag, it pushes the value @expr{e}, the base of natural logarithms. |
| 18133 | With the Inverse flag, it pushes Euler's constant | 18121 | With the Inverse flag, it pushes Euler's constant |
| 18134 | @texline @tmath{\gamma} | 18122 | @texline @math{\gamma} |
| 18135 | @infoline @expr{gamma} | 18123 | @infoline @expr{gamma} |
| 18136 | (about 0.5772). With both Inverse and Hyperbolic, it | 18124 | (about 0.5772). With both Inverse and Hyperbolic, it |
| 18137 | pushes the ``golden ratio'' | 18125 | pushes the ``golden ratio'' |
| 18138 | @texline @tmath{\phi} | 18126 | @texline @math{\phi} |
| 18139 | @infoline @expr{phi} | 18127 | @infoline @expr{phi} |
| 18140 | (about 1.618). (At present, Euler's constant is not available | 18128 | (about 1.618). (At present, Euler's constant is not available |
| 18141 | to unlimited precision; Calc knows only the first 100 digits.) | 18129 | to unlimited precision; Calc knows only the first 100 digits.) |
| @@ -18215,7 +18203,7 @@ The @kbd{H L} (@code{calc-log10}) [@code{log10}] command computes the common | |||
| 18215 | it raises ten to a given power.) Note that the common logarithm of a | 18203 | it raises ten to a given power.) Note that the common logarithm of a |
| 18216 | complex number is computed by taking the natural logarithm and dividing | 18204 | complex number is computed by taking the natural logarithm and dividing |
| 18217 | by | 18205 | by |
| 18218 | @texline @tmath{\ln10}. | 18206 | @texline @math{\ln10}. |
| 18219 | @infoline @expr{ln(10)}. | 18207 | @infoline @expr{ln(10)}. |
| 18220 | 18208 | ||
| 18221 | @kindex B | 18209 | @kindex B |
| @@ -18225,7 +18213,7 @@ by | |||
| 18225 | @tindex alog | 18213 | @tindex alog |
| 18226 | The @kbd{B} (@code{calc-log}) [@code{log}] command computes a logarithm | 18214 | The @kbd{B} (@code{calc-log}) [@code{log}] command computes a logarithm |
| 18227 | to any base. For example, @kbd{1024 @key{RET} 2 B} produces 10, since | 18215 | to any base. For example, @kbd{1024 @key{RET} 2 B} produces 10, since |
| 18228 | @texline @tmath{2^{10} = 1024}. | 18216 | @texline @math{2^{10} = 1024}. |
| 18229 | @infoline @expr{2^10 = 1024}. | 18217 | @infoline @expr{2^10 = 1024}. |
| 18230 | In certain cases like @samp{log(3,9)}, the result | 18218 | In certain cases like @samp{log(3,9)}, the result |
| 18231 | will be either @expr{1:2} or @expr{0.5} depending on the current Fraction | 18219 | will be either @expr{1:2} or @expr{0.5} depending on the current Fraction |
| @@ -18247,11 +18235,11 @@ integer arithmetic is used; otherwise, this is equivalent to | |||
| 18247 | @pindex calc-expm1 | 18235 | @pindex calc-expm1 |
| 18248 | @tindex expm1 | 18236 | @tindex expm1 |
| 18249 | The @kbd{f E} (@code{calc-expm1}) [@code{expm1}] command computes | 18237 | The @kbd{f E} (@code{calc-expm1}) [@code{expm1}] command computes |
| 18250 | @texline @tmath{e^x - 1}, | 18238 | @texline @math{e^x - 1}, |
| 18251 | @infoline @expr{exp(x)-1}, | 18239 | @infoline @expr{exp(x)-1}, |
| 18252 | but using an algorithm that produces a more accurate | 18240 | but using an algorithm that produces a more accurate |
| 18253 | answer when the result is close to zero, i.e., when | 18241 | answer when the result is close to zero, i.e., when |
| 18254 | @texline @tmath{e^x} | 18242 | @texline @math{e^x} |
| 18255 | @infoline @expr{exp(x)} | 18243 | @infoline @expr{exp(x)} |
| 18256 | is close to one. | 18244 | is close to one. |
| 18257 | 18245 | ||
| @@ -18259,7 +18247,7 @@ is close to one. | |||
| 18259 | @pindex calc-lnp1 | 18247 | @pindex calc-lnp1 |
| 18260 | @tindex lnp1 | 18248 | @tindex lnp1 |
| 18261 | The @kbd{f L} (@code{calc-lnp1}) [@code{lnp1}] command computes | 18249 | The @kbd{f L} (@code{calc-lnp1}) [@code{lnp1}] command computes |
| 18262 | @texline @tmath{\ln(x+1)}, | 18250 | @texline @math{\ln(x+1)}, |
| 18263 | @infoline @expr{ln(x+1)}, | 18251 | @infoline @expr{ln(x+1)}, |
| 18264 | producing a more accurate answer when @expr{x} is close to zero. | 18252 | producing a more accurate answer when @expr{x} is close to zero. |
| 18265 | 18253 | ||
| @@ -18393,10 +18381,10 @@ variants of these functions. | |||
| 18393 | @tindex arctan2 | 18381 | @tindex arctan2 |
| 18394 | The @kbd{f T} (@code{calc-arctan2}) [@code{arctan2}] command takes two | 18382 | The @kbd{f T} (@code{calc-arctan2}) [@code{arctan2}] command takes two |
| 18395 | numbers from the stack and computes the arc tangent of their ratio. The | 18383 | numbers from the stack and computes the arc tangent of their ratio. The |
| 18396 | result is in the full range from @i{-180} (exclusive) to @i{+180} | 18384 | result is in the full range from @mathit{-180} (exclusive) to @mathit{+180} |
| 18397 | (inclusive) degrees, or the analogous range in radians. A similar | 18385 | (inclusive) degrees, or the analogous range in radians. A similar |
| 18398 | result would be obtained with @kbd{/} followed by @kbd{I T}, but the | 18386 | result would be obtained with @kbd{/} followed by @kbd{I T}, but the |
| 18399 | value would only be in the range from @i{-90} to @i{+90} degrees | 18387 | value would only be in the range from @mathit{-90} to @mathit{+90} degrees |
| 18400 | since the division loses information about the signs of the two | 18388 | since the division loses information about the signs of the two |
| 18401 | components, and an error might result from an explicit division by zero | 18389 | components, and an error might result from an explicit division by zero |
| 18402 | which @code{arctan2} would avoid. By (arbitrary) definition, | 18390 | which @code{arctan2} would avoid. By (arbitrary) definition, |
| @@ -18445,7 +18433,7 @@ gamma function. For positive integer arguments, this is related to the | |||
| 18445 | factorial function: @samp{gamma(n+1) = fact(n)}. For general complex | 18433 | factorial function: @samp{gamma(n+1) = fact(n)}. For general complex |
| 18446 | arguments the gamma function can be defined by the following definite | 18434 | arguments the gamma function can be defined by the following definite |
| 18447 | integral: | 18435 | integral: |
| 18448 | @texline @tmath{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}. | 18436 | @texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}. |
| 18449 | @infoline @expr{gamma(a) = integ(t^(a-1) exp(t), t, 0, inf)}. | 18437 | @infoline @expr{gamma(a) = integ(t^(a-1) exp(t), t, 0, inf)}. |
| 18450 | (The actual implementation uses far more efficient computational methods.) | 18438 | (The actual implementation uses far more efficient computational methods.) |
| 18451 | 18439 | ||
| @@ -18479,7 +18467,7 @@ integral: | |||
| 18479 | The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes | 18467 | The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes |
| 18480 | the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by | 18468 | the incomplete gamma function, denoted @samp{P(a,x)}. This is defined by |
| 18481 | the integral, | 18469 | the integral, |
| 18482 | @texline @tmath{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}. | 18470 | @texline @math{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}. |
| 18483 | @infoline @expr{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}. | 18471 | @infoline @expr{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}. |
| 18484 | This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the | 18472 | This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the |
| 18485 | definition of the normal gamma function). | 18473 | definition of the normal gamma function). |
| @@ -18512,10 +18500,10 @@ You can obtain these using the \kbd{H f G} [\code{gammag}] and | |||
| 18512 | @tindex beta | 18500 | @tindex beta |
| 18513 | The @kbd{f b} (@code{calc-beta}) [@code{beta}] command computes the | 18501 | The @kbd{f b} (@code{calc-beta}) [@code{beta}] command computes the |
| 18514 | Euler beta function, which is defined in terms of the gamma function as | 18502 | Euler beta function, which is defined in terms of the gamma function as |
| 18515 | @texline @tmath{B(a,b) = \Gamma(a) \Gamma(b) / \Gamma(a+b)}, | 18503 | @texline @math{B(a,b) = \Gamma(a) \Gamma(b) / \Gamma(a+b)}, |
| 18516 | @infoline @expr{beta(a,b) = gamma(a) gamma(b) / gamma(a+b)}, | 18504 | @infoline @expr{beta(a,b) = gamma(a) gamma(b) / gamma(a+b)}, |
| 18517 | or by | 18505 | or by |
| 18518 | @texline @tmath{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}. | 18506 | @texline @math{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}. |
| 18519 | @infoline @expr{beta(a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, 1)}. | 18507 | @infoline @expr{beta(a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, 1)}. |
| 18520 | 18508 | ||
| 18521 | @kindex f B | 18509 | @kindex f B |
| @@ -18525,7 +18513,7 @@ or by | |||
| 18525 | @tindex betaB | 18513 | @tindex betaB |
| 18526 | The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes | 18514 | The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes |
| 18527 | the incomplete beta function @expr{I(x,a,b)}. It is defined by | 18515 | the incomplete beta function @expr{I(x,a,b)}. It is defined by |
| 18528 | @texline @tmath{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}. | 18516 | @texline @math{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}. |
| 18529 | @infoline @expr{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}. | 18517 | @infoline @expr{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}. |
| 18530 | Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding | 18518 | Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding |
| 18531 | un-normalized version [@code{betaB}]. | 18519 | un-normalized version [@code{betaB}]. |
| @@ -18537,11 +18525,11 @@ un-normalized version [@code{betaB}]. | |||
| 18537 | @tindex erfc | 18525 | @tindex erfc |
| 18538 | The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the | 18526 | The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the |
| 18539 | error function | 18527 | error function |
| 18540 | @texline @tmath{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}. | 18528 | @texline @math{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}. |
| 18541 | @infoline @expr{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}. | 18529 | @infoline @expr{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}. |
| 18542 | The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}] | 18530 | The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}] |
| 18543 | is the corresponding integral from @samp{x} to infinity; the sum | 18531 | is the corresponding integral from @samp{x} to infinity; the sum |
| 18544 | @texline @tmath{\hbox{erf}(x) + \hbox{erfc}(x) = 1}. | 18532 | @texline @math{\hbox{erf}(x) + \hbox{erfc}(x) = 1}. |
| 18545 | @infoline @expr{erf(x) + erfc(x) = 1}. | 18533 | @infoline @expr{erf(x) + erfc(x) = 1}. |
| 18546 | 18534 | ||
| 18547 | @kindex f j | 18535 | @kindex f j |
| @@ -18617,17 +18605,17 @@ occurrence of @code{eps} may stand for a different small value. | |||
| 18617 | 18605 | ||
| 18618 | For @samp{z1^z2}: This is defined by @samp{exp(ln(z1)*z2)}. | 18606 | For @samp{z1^z2}: This is defined by @samp{exp(ln(z1)*z2)}. |
| 18619 | One interesting consequence of this is that @samp{(-8)^1:3} does | 18607 | One interesting consequence of this is that @samp{(-8)^1:3} does |
| 18620 | not evaluate to @i{-2} as you might expect, but to the complex | 18608 | not evaluate to @mathit{-2} as you might expect, but to the complex |
| 18621 | number @expr{(1., 1.732)}. Both of these are valid cube roots | 18609 | number @expr{(1., 1.732)}. Both of these are valid cube roots |
| 18622 | of @i{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps | 18610 | of @mathit{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps |
| 18623 | less-obvious root for the sake of mathematical consistency. | 18611 | less-obvious root for the sake of mathematical consistency. |
| 18624 | 18612 | ||
| 18625 | For @samp{arcsin(z)}: This is defined by @samp{-i*ln(i*z + sqrt(1-z^2))}. | 18613 | For @samp{arcsin(z)}: This is defined by @samp{-i*ln(i*z + sqrt(1-z^2))}. |
| 18626 | The branch cuts are on the real axis, less than @i{-1} and greater than 1. | 18614 | The branch cuts are on the real axis, less than @mathit{-1} and greater than 1. |
| 18627 | 18615 | ||
| 18628 | For @samp{arccos(z)}: This is defined by @samp{-i*ln(z + i*sqrt(1-z^2))}, | 18616 | For @samp{arccos(z)}: This is defined by @samp{-i*ln(z + i*sqrt(1-z^2))}, |
| 18629 | or equivalently by @samp{pi/2 - arcsin(z)}. The branch cuts are on | 18617 | or equivalently by @samp{pi/2 - arcsin(z)}. The branch cuts are on |
| 18630 | the real axis, less than @i{-1} and greater than 1. | 18618 | the real axis, less than @mathit{-1} and greater than 1. |
| 18631 | 18619 | ||
| 18632 | For @samp{arctan(z)}: This is defined by | 18620 | For @samp{arctan(z)}: This is defined by |
| 18633 | @samp{(ln(1+i*z) - ln(1-i*z)) / (2*i)}. The branch cuts are on the | 18621 | @samp{(ln(1+i*z) - ln(1-i*z)) / (2*i)}. The branch cuts are on the |
| @@ -18642,7 +18630,7 @@ For @samp{arccosh(z)}: This is defined by | |||
| 18642 | real axis less than 1. | 18630 | real axis less than 1. |
| 18643 | 18631 | ||
| 18644 | For @samp{arctanh(z)}: This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}. | 18632 | For @samp{arctanh(z)}: This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}. |
| 18645 | The branch cuts are on the real axis, less than @i{-1} and greater than 1. | 18633 | The branch cuts are on the real axis, less than @mathit{-1} and greater than 1. |
| 18646 | 18634 | ||
| 18647 | The following tables for @code{arcsin}, @code{arccos}, and | 18635 | The following tables for @code{arcsin}, @code{arccos}, and |
| 18648 | @code{arctan} assume the current angular mode is radians. The | 18636 | @code{arctan} assume the current angular mode is radians. The |
| @@ -18715,7 +18703,7 @@ random numbers of various sorts. | |||
| 18715 | 18703 | ||
| 18716 | Given a positive numeric prefix argument @expr{M}, it produces a random | 18704 | Given a positive numeric prefix argument @expr{M}, it produces a random |
| 18717 | integer @expr{N} in the range | 18705 | integer @expr{N} in the range |
| 18718 | @texline @tmath{0 \le N < M}. | 18706 | @texline @math{0 \le N < M}. |
| 18719 | @infoline @expr{0 <= N < M}. | 18707 | @infoline @expr{0 <= N < M}. |
| 18720 | Each of the @expr{M} values appears with equal probability. | 18708 | Each of the @expr{M} values appears with equal probability. |
| 18721 | 18709 | ||
| @@ -18725,15 +18713,15 @@ the result is a random integer less than @expr{M}. However, note that | |||
| 18725 | while numeric prefix arguments are limited to six digits or so, an @expr{M} | 18713 | while numeric prefix arguments are limited to six digits or so, an @expr{M} |
| 18726 | taken from the stack can be arbitrarily large. If @expr{M} is negative, | 18714 | taken from the stack can be arbitrarily large. If @expr{M} is negative, |
| 18727 | the result is a random integer in the range | 18715 | the result is a random integer in the range |
| 18728 | @texline @tmath{M < N \le 0}. | 18716 | @texline @math{M < N \le 0}. |
| 18729 | @infoline @expr{M < N <= 0}. | 18717 | @infoline @expr{M < N <= 0}. |
| 18730 | 18718 | ||
| 18731 | If the value on the stack is a floating-point number @expr{M}, the result | 18719 | If the value on the stack is a floating-point number @expr{M}, the result |
| 18732 | is a random floating-point number @expr{N} in the range | 18720 | is a random floating-point number @expr{N} in the range |
| 18733 | @texline @tmath{0 \le N < M} | 18721 | @texline @math{0 \le N < M} |
| 18734 | @infoline @expr{0 <= N < M} | 18722 | @infoline @expr{0 <= N < M} |
| 18735 | or | 18723 | or |
| 18736 | @texline @tmath{M < N \le 0}, | 18724 | @texline @math{M < N \le 0}, |
| 18737 | @infoline @expr{M < N <= 0}, | 18725 | @infoline @expr{M < N <= 0}, |
| 18738 | according to the sign of @expr{M}. | 18726 | according to the sign of @expr{M}. |
| 18739 | 18727 | ||
| @@ -18743,14 +18731,14 @@ of one. The algorithm used generates random numbers in pairs; thus, | |||
| 18743 | every other call to this function will be especially fast. | 18731 | every other call to this function will be especially fast. |
| 18744 | 18732 | ||
| 18745 | If @expr{M} is an error form | 18733 | If @expr{M} is an error form |
| 18746 | @texline @tmath{m} @code{+/-} @tmath{\sigma} | 18734 | @texline @math{m} @code{+/-} @math{\sigma} |
| 18747 | @infoline @samp{m +/- s} | 18735 | @infoline @samp{m +/- s} |
| 18748 | where @var{m} and | 18736 | where @var{m} and |
| 18749 | @texline @tmath{\sigma} | 18737 | @texline @math{\sigma} |
| 18750 | @infoline @var{s} | 18738 | @infoline @var{s} |
| 18751 | are both real numbers, the result uses a Gaussian distribution with mean | 18739 | are both real numbers, the result uses a Gaussian distribution with mean |
| 18752 | @var{m} and standard deviation | 18740 | @var{m} and standard deviation |
| 18753 | @texline @tmath{\sigma}. | 18741 | @texline @math{\sigma}. |
| 18754 | @var{s}. | 18742 | @var{s}. |
| 18755 | 18743 | ||
| 18756 | If @expr{M} is an interval form, the lower and upper bounds specify the | 18744 | If @expr{M} is an interval form, the lower and upper bounds specify the |
| @@ -18863,7 +18851,7 @@ generators that are typically used to implement @code{random}. | |||
| 18863 | If @code{RandSeed} contains an integer, Calc uses this integer to | 18851 | If @code{RandSeed} contains an integer, Calc uses this integer to |
| 18864 | seed an ``additive congruential'' method (Knuth's algorithm 3.2.2A, | 18852 | seed an ``additive congruential'' method (Knuth's algorithm 3.2.2A, |
| 18865 | computing | 18853 | computing |
| 18866 | @texline @tmath{X_{n-55} - X_{n-24}}. | 18854 | @texline @math{X_{n-55} - X_{n-24}}. |
| 18867 | @infoline @expr{X_n-55 - X_n-24}). | 18855 | @infoline @expr{X_n-55 - X_n-24}). |
| 18868 | This method expands the seed | 18856 | This method expands the seed |
| 18869 | value into a large table which is maintained internally; the variable | 18857 | value into a large table which is maintained internally; the variable |
| @@ -18899,20 +18887,20 @@ value. | |||
| 18899 | 18887 | ||
| 18900 | To create a random floating-point number with precision @var{p}, Calc | 18888 | To create a random floating-point number with precision @var{p}, Calc |
| 18901 | simply creates a random @var{p}-digit integer and multiplies by | 18889 | simply creates a random @var{p}-digit integer and multiplies by |
| 18902 | @texline @tmath{10^{-p}}. | 18890 | @texline @math{10^{-p}}. |
| 18903 | @infoline @expr{10^-p}. | 18891 | @infoline @expr{10^-p}. |
| 18904 | The resulting random numbers should be very clean, but note | 18892 | The resulting random numbers should be very clean, but note |
| 18905 | that relatively small numbers will have few significant random digits. | 18893 | that relatively small numbers will have few significant random digits. |
| 18906 | In other words, with a precision of 12, you will occasionally get | 18894 | In other words, with a precision of 12, you will occasionally get |
| 18907 | numbers on the order of | 18895 | numbers on the order of |
| 18908 | @texline @tmath{10^{-9}} | 18896 | @texline @math{10^{-9}} |
| 18909 | @infoline @expr{10^-9} | 18897 | @infoline @expr{10^-9} |
| 18910 | or | 18898 | or |
| 18911 | @texline @tmath{10^{-10}}, | 18899 | @texline @math{10^{-10}}, |
| 18912 | @infoline @expr{10^-10}, | 18900 | @infoline @expr{10^-10}, |
| 18913 | but those numbers will only have two or three random digits since they | 18901 | but those numbers will only have two or three random digits since they |
| 18914 | correspond to small integers times | 18902 | correspond to small integers times |
| 18915 | @texline @tmath{10^{-12}}. | 18903 | @texline @math{10^{-12}}. |
| 18916 | @infoline @expr{10^-12}. | 18904 | @infoline @expr{10^-12}. |
| 18917 | 18905 | ||
| 18918 | To create a random integer in the interval @samp{[0 .. @var{m})}, Calc | 18906 | To create a random integer in the interval @samp{[0 .. @var{m})}, Calc |
| @@ -18963,7 +18951,7 @@ numbers. | |||
| 18963 | The @kbd{k E} (@code{calc-extended-gcd}) [@code{egcd}] command computes | 18951 | The @kbd{k E} (@code{calc-extended-gcd}) [@code{egcd}] command computes |
| 18964 | the GCD of two integers @expr{x} and @expr{y} and returns a vector | 18952 | the GCD of two integers @expr{x} and @expr{y} and returns a vector |
| 18965 | @expr{[g, a, b]} where | 18953 | @expr{[g, a, b]} where |
| 18966 | @texline @tmath{g = \gcd(x,y) = a x + b y}. | 18954 | @texline @math{g = \gcd(x,y) = a x + b y}. |
| 18967 | @infoline @expr{g = gcd(x,y) = a x + b y}. | 18955 | @infoline @expr{g = gcd(x,y) = a x + b y}. |
| 18968 | 18956 | ||
| 18969 | @kindex ! | 18957 | @kindex ! |
| @@ -19007,7 +18995,7 @@ on the top of the stack and @expr{N} is second-to-top. If both arguments | |||
| 19007 | are integers, the result is an exact integer. Otherwise, the result is a | 18995 | are integers, the result is an exact integer. Otherwise, the result is a |
| 19008 | floating-point approximation. The binomial coefficient is defined for all | 18996 | floating-point approximation. The binomial coefficient is defined for all |
| 19009 | real numbers by | 18997 | real numbers by |
| 19010 | @texline @tmath{N! \over M! (N-M)!\,}. | 18998 | @texline @math{N! \over M! (N-M)!\,}. |
| 19011 | @infoline @expr{N! / M! (N-M)!}. | 18999 | @infoline @expr{N! / M! (N-M)!}. |
| 19012 | 19000 | ||
| 19013 | @kindex H k c | 19001 | @kindex H k c |
| @@ -19050,11 +19038,11 @@ functions. | |||
| 19050 | @tindex stir2 | 19038 | @tindex stir2 |
| 19051 | The @kbd{k s} (@code{calc-stirling-number}) [@code{stir1}] command | 19039 | The @kbd{k s} (@code{calc-stirling-number}) [@code{stir1}] command |
| 19052 | computes a Stirling number of the first | 19040 | computes a Stirling number of the first |
| 19053 | @texline kind@tie{}@tmath{n \brack m}, | 19041 | @texline kind@tie{}@math{n \brack m}, |
| 19054 | @infoline kind, | 19042 | @infoline kind, |
| 19055 | given two integers @expr{n} and @expr{m} on the stack. The @kbd{H k s} | 19043 | given two integers @expr{n} and @expr{m} on the stack. The @kbd{H k s} |
| 19056 | [@code{stir2}] command computes a Stirling number of the second | 19044 | [@code{stir2}] command computes a Stirling number of the second |
| 19057 | @texline kind@tie{}@tmath{n \brace m}. | 19045 | @texline kind@tie{}@math{n \brace m}. |
| 19058 | @infoline kind. | 19046 | @infoline kind. |
| 19059 | These are the number of @expr{m}-cycle permutations of @expr{n} objects, | 19047 | These are the number of @expr{m}-cycle permutations of @expr{n} objects, |
| 19060 | and the number of ways to partition @expr{n} objects into @expr{m} | 19048 | and the number of ways to partition @expr{n} objects into @expr{m} |
| @@ -19098,8 +19086,8 @@ result is a vector of the prime factors in increasing order. For larger | |||
| 19098 | inputs, prime factors above 5000 may not be found, in which case the | 19086 | inputs, prime factors above 5000 may not be found, in which case the |
| 19099 | last number in the vector will be an unfactored integer greater than 25 | 19087 | last number in the vector will be an unfactored integer greater than 25 |
| 19100 | million (with a warning message). For negative integers, the first | 19088 | million (with a warning message). For negative integers, the first |
| 19101 | element of the list will be @i{-1}. For inputs @i{-1}, @i{0}, and | 19089 | element of the list will be @mathit{-1}. For inputs @mathit{-1}, @mathit{0}, and |
| 19102 | @i{1}, the result is a list of the same number. | 19090 | @mathit{1}, the result is a list of the same number. |
| 19103 | 19091 | ||
| 19104 | @kindex k n | 19092 | @kindex k n |
| 19105 | @pindex calc-next-prime | 19093 | @pindex calc-next-prime |
| @@ -19133,7 +19121,7 @@ analogously finds the next prime less than a given number. | |||
| 19133 | @tindex totient | 19121 | @tindex totient |
| 19134 | The @kbd{k t} (@code{calc-totient}) [@code{totient}] command computes the | 19122 | The @kbd{k t} (@code{calc-totient}) [@code{totient}] command computes the |
| 19135 | Euler ``totient'' | 19123 | Euler ``totient'' |
| 19136 | @texline function@tie{}@tmath{\phi(n)}, | 19124 | @texline function@tie{}@math{\phi(n)}, |
| 19137 | @infoline function, | 19125 | @infoline function, |
| 19138 | the number of integers less than @expr{n} which | 19126 | the number of integers less than @expr{n} which |
| 19139 | are relatively prime to @expr{n}. | 19127 | are relatively prime to @expr{n}. |
| @@ -19142,7 +19130,7 @@ are relatively prime to @expr{n}. | |||
| 19142 | @pindex calc-moebius | 19130 | @pindex calc-moebius |
| 19143 | @tindex moebius | 19131 | @tindex moebius |
| 19144 | The @kbd{k m} (@code{calc-moebius}) [@code{moebius}] command computes the | 19132 | The @kbd{k m} (@code{calc-moebius}) [@code{moebius}] command computes the |
| 19145 | @texline M@"obius @tmath{\mu} | 19133 | @texline M@"obius @math{\mu} |
| 19146 | @infoline Moebius ``mu'' | 19134 | @infoline Moebius ``mu'' |
| 19147 | function. If the input number is a product of @expr{k} | 19135 | function. If the input number is a product of @expr{k} |
| 19148 | distinct factors, this is @expr{(-1)^k}. If the input number has any | 19136 | distinct factors, this is @expr{(-1)^k}. If the input number has any |
| @@ -19206,7 +19194,7 @@ recover the original arguments but substitute a new value for @expr{x}.) | |||
| 19206 | @end ignore | 19194 | @end ignore |
| 19207 | @tindex ltpc | 19195 | @tindex ltpc |
| 19208 | The @samp{utpc(x,v)} function uses the chi-square distribution with | 19196 | The @samp{utpc(x,v)} function uses the chi-square distribution with |
| 19209 | @texline @tmath{\nu} | 19197 | @texline @math{\nu} |
| 19210 | @infoline @expr{v} | 19198 | @infoline @expr{v} |
| 19211 | degrees of freedom. It is the probability that a model is | 19199 | degrees of freedom. It is the probability that a model is |
| 19212 | correct if its chi-square statistic is @expr{x}. | 19200 | correct if its chi-square statistic is @expr{x}. |
| @@ -19224,10 +19212,10 @@ correct if its chi-square statistic is @expr{x}. | |||
| 19224 | @tindex ltpf | 19212 | @tindex ltpf |
| 19225 | The @samp{utpf(F,v1,v2)} function uses the F distribution, used in | 19213 | The @samp{utpf(F,v1,v2)} function uses the F distribution, used in |
| 19226 | various statistical tests. The parameters | 19214 | various statistical tests. The parameters |
| 19227 | @texline @tmath{\nu_1} | 19215 | @texline @math{\nu_1} |
| 19228 | @infoline @expr{v1} | 19216 | @infoline @expr{v1} |
| 19229 | and | 19217 | and |
| 19230 | @texline @tmath{\nu_2} | 19218 | @texline @math{\nu_2} |
| 19231 | @infoline @expr{v2} | 19219 | @infoline @expr{v2} |
| 19232 | are the degrees of freedom in the numerator and denominator, | 19220 | are the degrees of freedom in the numerator and denominator, |
| 19233 | respectively, used in computing the statistic @expr{F}. | 19221 | respectively, used in computing the statistic @expr{F}. |
| @@ -19245,7 +19233,7 @@ respectively, used in computing the statistic @expr{F}. | |||
| 19245 | @tindex ltpn | 19233 | @tindex ltpn |
| 19246 | The @samp{utpn(x,m,s)} function uses a normal (Gaussian) distribution | 19234 | The @samp{utpn(x,m,s)} function uses a normal (Gaussian) distribution |
| 19247 | with mean @expr{m} and standard deviation | 19235 | with mean @expr{m} and standard deviation |
| 19248 | @texline @tmath{\sigma}. | 19236 | @texline @math{\sigma}. |
| 19249 | @infoline @expr{s}. | 19237 | @infoline @expr{s}. |
| 19250 | It is the probability that such a normal-distributed random variable | 19238 | It is the probability that such a normal-distributed random variable |
| 19251 | would exceed @expr{x}. | 19239 | would exceed @expr{x}. |
| @@ -19278,18 +19266,18 @@ Poisson random events will occur. | |||
| 19278 | @tindex ltpt | 19266 | @tindex ltpt |
| 19279 | The @samp{utpt(t,v)} function uses the Student's ``t'' distribution | 19267 | The @samp{utpt(t,v)} function uses the Student's ``t'' distribution |
| 19280 | with | 19268 | with |
| 19281 | @texline @tmath{\nu} | 19269 | @texline @math{\nu} |
| 19282 | @infoline @expr{v} | 19270 | @infoline @expr{v} |
| 19283 | degrees of freedom. It is the probability that a | 19271 | degrees of freedom. It is the probability that a |
| 19284 | t-distributed random variable will be greater than @expr{t}. | 19272 | t-distributed random variable will be greater than @expr{t}. |
| 19285 | (Note: This computes the distribution function | 19273 | (Note: This computes the distribution function |
| 19286 | @texline @tmath{A(t|\nu)} | 19274 | @texline @math{A(t|\nu)} |
| 19287 | @infoline @expr{A(t|v)} | 19275 | @infoline @expr{A(t|v)} |
| 19288 | where | 19276 | where |
| 19289 | @texline @tmath{A(0|\nu) = 1} | 19277 | @texline @math{A(0|\nu) = 1} |
| 19290 | @infoline @expr{A(0|v) = 1} | 19278 | @infoline @expr{A(0|v) = 1} |
| 19291 | and | 19279 | and |
| 19292 | @texline @tmath{A(\infty|\nu) \to 0}. | 19280 | @texline @math{A(\infty|\nu) \to 0}. |
| 19293 | @infoline @expr{A(inf|v) -> 0}. | 19281 | @infoline @expr{A(inf|v) -> 0}. |
| 19294 | The @code{UTPT} operation on the HP-48 uses a different definition which | 19282 | The @code{UTPT} operation on the HP-48 uses a different definition which |
| 19295 | returns half of Calc's value: @samp{UTPT(t,v) = .5*utpt(t,v)}.) | 19283 | returns half of Calc's value: @samp{UTPT(t,v) = .5*utpt(t,v)}.) |
| @@ -19409,8 +19397,8 @@ integer, is the exponent. The result is the mantissa | |||
| 19409 | times ten to the power of the exponent. | 19397 | times ten to the power of the exponent. |
| 19410 | 19398 | ||
| 19411 | @item -12 | 19399 | @item -12 |
| 19412 | This is treated the same as @i{-11} by the @kbd{v p} command. | 19400 | This is treated the same as @mathit{-11} by the @kbd{v p} command. |
| 19413 | When unpacking, @i{-12} specifies that a floating-point mantissa | 19401 | When unpacking, @mathit{-12} specifies that a floating-point mantissa |
| 19414 | is desired. | 19402 | is desired. |
| 19415 | 19403 | ||
| 19416 | @item -13 | 19404 | @item -13 |
| @@ -19449,7 +19437,7 @@ returned in the form @samp{[@w{[a, b, c]}, [d, e, f]]}. | |||
| 19449 | If any elements of the vector are negative, other kinds of | 19437 | If any elements of the vector are negative, other kinds of |
| 19450 | packing are done at that level as described above. For | 19438 | packing are done at that level as described above. For |
| 19451 | example, @samp{[2, 3, -4]} takes 12 objects and creates a | 19439 | example, @samp{[2, 3, -4]} takes 12 objects and creates a |
| 19452 | @texline @tmath{2\times3} | 19440 | @texline @math{2\times3} |
| 19453 | @infoline 2x3 | 19441 | @infoline 2x3 |
| 19454 | matrix of error forms: @samp{[[a +/- b, c +/- d ... ]]}. | 19442 | matrix of error forms: @samp{[[a +/- b, c +/- d ... ]]}. |
| 19455 | Also, @samp{[-4, -10]} will convert four integers into an | 19443 | Also, @samp{[-4, -10]} will convert four integers into an |
| @@ -19487,18 +19475,18 @@ the result of @kbd{C-u -4 v u} will be the two vectors | |||
| 19487 | @samp{[a, c^2, d]} and @w{@samp{[b, 0, 7]}}. | 19475 | @samp{[a, c^2, d]} and @w{@samp{[b, 0, 7]}}. |
| 19488 | 19476 | ||
| 19489 | Note that the prefix argument can have an effect even when the input is | 19477 | Note that the prefix argument can have an effect even when the input is |
| 19490 | not a vector. For example, if the input is the number @i{-5}, then | 19478 | not a vector. For example, if the input is the number @mathit{-5}, then |
| 19491 | @kbd{c-u -1 v u} yields @i{-5} and 0 (the components of @i{-5} | 19479 | @kbd{c-u -1 v u} yields @mathit{-5} and 0 (the components of @mathit{-5} |
| 19492 | when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5 | 19480 | when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5 |
| 19493 | and 180 (assuming degrees mode); and @kbd{C-u -10 v u} yields @i{-5} | 19481 | and 180 (assuming degrees mode); and @kbd{C-u -10 v u} yields @mathit{-5} |
| 19494 | and 1 (the numerator and denominator of @i{-5}, viewed as a rational | 19482 | and 1 (the numerator and denominator of @mathit{-5}, viewed as a rational |
| 19495 | number). Plain @kbd{v u} with this input would complain that the input | 19483 | number). Plain @kbd{v u} with this input would complain that the input |
| 19496 | is not a composite object. | 19484 | is not a composite object. |
| 19497 | 19485 | ||
| 19498 | Unpacking mode @i{-11} converts a float into an integer mantissa and | 19486 | Unpacking mode @mathit{-11} converts a float into an integer mantissa and |
| 19499 | an integer exponent, where the mantissa is not divisible by 10 | 19487 | an integer exponent, where the mantissa is not divisible by 10 |
| 19500 | (except that 0.0 is represented by a mantissa and exponent of 0). | 19488 | (except that 0.0 is represented by a mantissa and exponent of 0). |
| 19501 | Unpacking mode @i{-12} converts a float into a floating-point mantissa | 19489 | Unpacking mode @mathit{-12} converts a float into a floating-point mantissa |
| 19502 | and integer exponent, where the mantissa (for non-zero numbers) | 19490 | and integer exponent, where the mantissa (for non-zero numbers) |
| 19503 | is guaranteed to lie in the range [1 .. 10). In both cases, | 19491 | is guaranteed to lie in the range [1 .. 10). In both cases, |
| 19504 | the mantissa is shifted left or right (and the exponent adjusted | 19492 | the mantissa is shifted left or right (and the exponent adjusted |
| @@ -19598,7 +19586,7 @@ the stack is a scalar, it is used for each element on the diagonal, and | |||
| 19598 | the prefix argument is required. | 19586 | the prefix argument is required. |
| 19599 | 19587 | ||
| 19600 | To build a constant square matrix, e.g., a | 19588 | To build a constant square matrix, e.g., a |
| 19601 | @texline @tmath{3\times3} | 19589 | @texline @math{3\times3} |
| 19602 | @infoline 3x3 | 19590 | @infoline 3x3 |
| 19603 | matrix filled with ones, use @kbd{0 M-3 v d 1 +}, i.e., build a zero | 19591 | matrix filled with ones, use @kbd{0 M-3 v d 1 +}, i.e., build a zero |
| 19604 | matrix first and then add a constant value to that matrix. (Another | 19592 | matrix first and then add a constant value to that matrix. (Another |
| @@ -19631,7 +19619,7 @@ The @kbd{v x} (@code{calc-index}) [@code{index}] function builds a vector | |||
| 19631 | of consecutive integers from 1 to @var{n}, where @var{n} is the numeric | 19619 | of consecutive integers from 1 to @var{n}, where @var{n} is the numeric |
| 19632 | prefix argument. If you do not provide a prefix argument, you will be | 19620 | prefix argument. If you do not provide a prefix argument, you will be |
| 19633 | prompted to enter a suitable number. If @var{n} is negative, the result | 19621 | prompted to enter a suitable number. If @var{n} is negative, the result |
| 19634 | is a vector of negative integers from @var{n} to @i{-1}. | 19622 | is a vector of negative integers from @var{n} to @mathit{-1}. |
| 19635 | 19623 | ||
| 19636 | With a prefix argument of just @kbd{C-u}, the @kbd{v x} command takes | 19624 | With a prefix argument of just @kbd{C-u}, the @kbd{v x} command takes |
| 19637 | three values from the stack: @var{n}, @var{start}, and @var{incr} (with | 19625 | three values from the stack: @var{n}, @var{start}, and @var{incr} (with |
| @@ -19824,7 +19812,7 @@ With the Hyperbolic flag, @kbd{H v l} [@code{mdims}] computes a vector | |||
| 19824 | of the dimensions of a vector, matrix, or higher-order object. For | 19812 | of the dimensions of a vector, matrix, or higher-order object. For |
| 19825 | example, @samp{mdims([[a,b,c],[d,e,f]])} returns @samp{[2, 3]} since | 19813 | example, @samp{mdims([[a,b,c],[d,e,f]])} returns @samp{[2, 3]} since |
| 19826 | its argument is a | 19814 | its argument is a |
| 19827 | @texline @tmath{2\times3} | 19815 | @texline @math{2\times3} |
| 19828 | @infoline 2x3 | 19816 | @infoline 2x3 |
| 19829 | matrix. | 19817 | matrix. |
| 19830 | 19818 | ||
| @@ -19856,13 +19844,13 @@ in the vector, the last row will be short and the result will not be | |||
| 19856 | suitable for use as a matrix. For example, with the matrix | 19844 | suitable for use as a matrix. For example, with the matrix |
| 19857 | @samp{[[1, 2], @w{[3, 4]}]} on the stack, @kbd{v a 4} produces | 19845 | @samp{[[1, 2], @w{[3, 4]}]} on the stack, @kbd{v a 4} produces |
| 19858 | @samp{[[1, 2, 3, 4]]} (a | 19846 | @samp{[[1, 2, 3, 4]]} (a |
| 19859 | @texline @tmath{1\times4} | 19847 | @texline @math{1\times4} |
| 19860 | @infoline 1x4 | 19848 | @infoline 1x4 |
| 19861 | matrix), @kbd{v a 1} produces @samp{[[1], [2], [3], [4]]} (a | 19849 | matrix), @kbd{v a 1} produces @samp{[[1], [2], [3], [4]]} (a |
| 19862 | @texline @tmath{4\times1} | 19850 | @texline @math{4\times1} |
| 19863 | @infoline 4x1 | 19851 | @infoline 4x1 |
| 19864 | matrix), @kbd{v a 2} produces @samp{[[1, 2], [3, 4]]} (the original | 19852 | matrix), @kbd{v a 2} produces @samp{[[1, 2], [3, 4]]} (the original |
| 19865 | @texline @tmath{2\times2} | 19853 | @texline @math{2\times2} |
| 19866 | @infoline 2x2 | 19854 | @infoline 2x2 |
| 19867 | matrix), @w{@kbd{v a 3}} produces @samp{[[1, 2, 3], [4]]} (not a | 19855 | matrix), @w{@kbd{v a 3}} produces @samp{[[1, 2, 3], [4]]} (not a |
| 19868 | matrix), and @kbd{v a 0} produces the flattened list | 19856 | matrix), and @kbd{v a 0} produces the flattened list |
| @@ -20182,10 +20170,10 @@ sets are disjoint, i.e., if they share no common elements, the result | |||
| 20182 | will be the empty vector @samp{[]}. Note that the characters @kbd{V} | 20170 | will be the empty vector @samp{[]}. Note that the characters @kbd{V} |
| 20183 | and @kbd{^} were chosen to be close to the conventional mathematical | 20171 | and @kbd{^} were chosen to be close to the conventional mathematical |
| 20184 | notation for set | 20172 | notation for set |
| 20185 | @texline union@tie{}(@tmath{A \cup B}) | 20173 | @texline union@tie{}(@math{A \cup B}) |
| 20186 | @infoline union | 20174 | @infoline union |
| 20187 | and | 20175 | and |
| 20188 | @texline intersection@tie{}(@tmath{A \cap B}). | 20176 | @texline intersection@tie{}(@math{A \cap B}). |
| 20189 | @infoline intersection. | 20177 | @infoline intersection. |
| 20190 | 20178 | ||
| 20191 | @kindex V - | 20179 | @kindex V - |
| @@ -20294,7 +20282,7 @@ not include any negative numbers. The input is interpreted as a | |||
| 20294 | set of integers in the sense of @kbd{V F} (@code{vfloor}). Beware | 20282 | set of integers in the sense of @kbd{V F} (@code{vfloor}). Beware |
| 20295 | that a simple input like @samp{[100]} can result in a huge integer | 20283 | that a simple input like @samp{[100]} can result in a huge integer |
| 20296 | representation | 20284 | representation |
| 20297 | @texline (@tmath{2^{100}}, a 31-digit integer, in this case). | 20285 | @texline (@math{2^{100}}, a 31-digit integer, in this case). |
| 20298 | @infoline (@expr{2^100}, a 31-digit integer, in this case). | 20286 | @infoline (@expr{2^100}, a 31-digit integer, in this case). |
| 20299 | 20287 | ||
| 20300 | @node Statistical Operations, Reducing and Mapping, Set Operations, Matrix Functions | 20288 | @node Statistical Operations, Reducing and Mapping, Set Operations, Matrix Functions |
| @@ -20406,10 +20394,10 @@ plus or minus infinity. | |||
| 20406 | The @kbd{u M} (@code{calc-vector-mean}) [@code{vmean}] command | 20394 | The @kbd{u M} (@code{calc-vector-mean}) [@code{vmean}] command |
| 20407 | computes the average (arithmetic mean) of the data values. | 20395 | computes the average (arithmetic mean) of the data values. |
| 20408 | If the inputs are error forms | 20396 | If the inputs are error forms |
| 20409 | @texline @tmath{x \pm \sigma}, | 20397 | @texline @math{x \pm \sigma}, |
| 20410 | @infoline @samp{x +/- s}, | 20398 | @infoline @samp{x +/- s}, |
| 20411 | this is the weighted mean of the @expr{x} values with weights | 20399 | this is the weighted mean of the @expr{x} values with weights |
| 20412 | @texline @tmath{1 /\sigma^2}. | 20400 | @texline @math{1 /\sigma^2}. |
| 20413 | @infoline @expr{1 / s^2}. | 20401 | @infoline @expr{1 / s^2}. |
| 20414 | @tex | 20402 | @tex |
| 20415 | \turnoffactive | 20403 | \turnoffactive |
| @@ -20421,7 +20409,7 @@ values divided by the count of the values. | |||
| 20421 | 20409 | ||
| 20422 | Note that a plain number can be considered an error form with | 20410 | Note that a plain number can be considered an error form with |
| 20423 | error | 20411 | error |
| 20424 | @texline @tmath{\sigma = 0}. | 20412 | @texline @math{\sigma = 0}. |
| 20425 | @infoline @expr{s = 0}. | 20413 | @infoline @expr{s = 0}. |
| 20426 | If the input to @kbd{u M} is a mixture of | 20414 | If the input to @kbd{u M} is a mixture of |
| 20427 | plain numbers and error forms, the result is the mean of the | 20415 | plain numbers and error forms, the result is the mean of the |
| @@ -20530,7 +20518,7 @@ for a vector of numbers simply by using the @kbd{A} command. | |||
| 20530 | @cindex Sample statistics | 20518 | @cindex Sample statistics |
| 20531 | The @kbd{u S} (@code{calc-vector-sdev}) [@code{vsdev}] command | 20519 | The @kbd{u S} (@code{calc-vector-sdev}) [@code{vsdev}] command |
| 20532 | computes the standard | 20520 | computes the standard |
| 20533 | @texline deviation@tie{}@tmath{\sigma} | 20521 | @texline deviation@tie{}@math{\sigma} |
| 20534 | @infoline deviation | 20522 | @infoline deviation |
| 20535 | of the data values. If the values are error forms, the errors are used | 20523 | of the data values. If the values are error forms, the errors are used |
| 20536 | as weights just as for @kbd{u M}. This is the @emph{sample} standard | 20524 | as weights just as for @kbd{u M}. This is the @emph{sample} standard |
| @@ -20546,7 +20534,7 @@ This function also applies to distributions. The standard deviation | |||
| 20546 | of a single error form is simply the error part. The standard deviation | 20534 | of a single error form is simply the error part. The standard deviation |
| 20547 | of a continuous interval happens to equal the difference between the | 20535 | of a continuous interval happens to equal the difference between the |
| 20548 | limits, divided by | 20536 | limits, divided by |
| 20549 | @texline @tmath{\sqrt{12}}. | 20537 | @texline @math{\sqrt{12}}. |
| 20550 | @infoline @expr{sqrt(12)}. | 20538 | @infoline @expr{sqrt(12)}. |
| 20551 | The standard deviation of an integer interval is the same as the | 20539 | The standard deviation of an integer interval is the same as the |
| 20552 | standard deviation of a vector of those integers. | 20540 | standard deviation of a vector of those integers. |
| @@ -20584,7 +20572,7 @@ The @kbd{H u S} (@code{calc-vector-variance}) [@code{vvar}] and | |||
| 20584 | @kbd{H I u S} (@code{calc-vector-pop-variance}) [@code{vpvar}] | 20572 | @kbd{H I u S} (@code{calc-vector-pop-variance}) [@code{vpvar}] |
| 20585 | commands compute the variance of the data values. The variance | 20573 | commands compute the variance of the data values. The variance |
| 20586 | is the | 20574 | is the |
| 20587 | @texline square@tie{}@tmath{\sigma^2} | 20575 | @texline square@tie{}@math{\sigma^2} |
| 20588 | @infoline square | 20576 | @infoline square |
| 20589 | of the standard deviation, i.e., the sum of the | 20577 | of the standard deviation, i.e., the sum of the |
| 20590 | squares of the deviations of the data values from the mean. | 20578 | squares of the deviations of the data values from the mean. |
| @@ -20608,7 +20596,7 @@ vectors of equal size. The vectors are each flattened in the same | |||
| 20608 | way as by the single-variable statistical functions. Given a numeric | 20596 | way as by the single-variable statistical functions. Given a numeric |
| 20609 | prefix argument of 1, these functions instead take one object from | 20597 | prefix argument of 1, these functions instead take one object from |
| 20610 | the stack, which must be an | 20598 | the stack, which must be an |
| 20611 | @texline @tmath{N\times2} | 20599 | @texline @math{N\times2} |
| 20612 | @infoline Nx2 | 20600 | @infoline Nx2 |
| 20613 | matrix of data values. Once again, variable names can be used in place | 20601 | matrix of data values. Once again, variable names can be used in place |
| 20614 | of actual vectors and matrices. | 20602 | of actual vectors and matrices. |
| @@ -20866,7 +20854,7 @@ If any argument to @kbd{V M} is a matrix, the operator is normally mapped | |||
| 20866 | across all elements of the matrix. For example, given the matrix | 20854 | across all elements of the matrix. For example, given the matrix |
| 20867 | @expr{[[1, -2, 3], [-4, 5, -6]]}, @kbd{V M A} takes six absolute values to | 20855 | @expr{[[1, -2, 3], [-4, 5, -6]]}, @kbd{V M A} takes six absolute values to |
| 20868 | produce another | 20856 | produce another |
| 20869 | @texline @tmath{3\times2} | 20857 | @texline @math{3\times2} |
| 20870 | @infoline 3x2 | 20858 | @infoline 3x2 |
| 20871 | matrix, @expr{[[1, 2, 3], [4, 5, 6]]}. | 20859 | matrix, @expr{[[1, 2, 3], [4, 5, 6]]}. |
| 20872 | 20860 | ||
| @@ -22019,7 +22007,7 @@ as if in algebraic simplification mode. This is equivalent to typing | |||
| 22019 | @kbd{a s}; @pxref{Simplifying Formulas}. If you give a numeric prefix | 22007 | @kbd{a s}; @pxref{Simplifying Formulas}. If you give a numeric prefix |
| 22020 | of 3 or more, it uses extended simplification mode (@kbd{a e}). | 22008 | of 3 or more, it uses extended simplification mode (@kbd{a e}). |
| 22021 | 22009 | ||
| 22022 | If you give a negative prefix argument @i{-1}, @i{-2}, or @i{-3}, | 22010 | If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3}, |
| 22023 | it simplifies in the corresponding mode but only works on the top-level | 22011 | it simplifies in the corresponding mode but only works on the top-level |
| 22024 | function call of the formula. For example, @samp{(2 + 3) * (2 + 3)} will | 22012 | function call of the formula. For example, @samp{(2 + 3) * (2 + 3)} will |
| 22025 | simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas | 22013 | simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas |
| @@ -22291,7 +22279,7 @@ simplifications.) | |||
| 22291 | 22279 | ||
| 22292 | The distributive law is used to simplify sums in some cases: | 22280 | The distributive law is used to simplify sums in some cases: |
| 22293 | @expr{a x + b x} to @expr{(a + b) x}, where @expr{a} represents | 22281 | @expr{a x + b x} to @expr{(a + b) x}, where @expr{a} represents |
| 22294 | a number or an implicit 1 or @i{-1} (as in @expr{x} or @expr{-x}) | 22282 | a number or an implicit 1 or @mathit{-1} (as in @expr{x} or @expr{-x}) |
| 22295 | and similarly for @expr{b}. Use the @kbd{a c}, @w{@kbd{a f}}, or | 22283 | and similarly for @expr{b}. Use the @kbd{a c}, @w{@kbd{a f}}, or |
| 22296 | @kbd{j M} commands to merge sums with non-numeric coefficients | 22284 | @kbd{j M} commands to merge sums with non-numeric coefficients |
| 22297 | using the distributive law. | 22285 | using the distributive law. |
| @@ -22335,7 +22323,7 @@ rewritten to @expr{a (c - b)}. | |||
| 22335 | 22323 | ||
| 22336 | The distributive law of products and powers is used for adjacent | 22324 | The distributive law of products and powers is used for adjacent |
| 22337 | terms of the product: @expr{x^a x^b} goes to | 22325 | terms of the product: @expr{x^a x^b} goes to |
| 22338 | @texline @tmath{x^{a+b}} | 22326 | @texline @math{x^{a+b}} |
| 22339 | @infoline @expr{x^(a+b)} | 22327 | @infoline @expr{x^(a+b)} |
| 22340 | where @expr{a} is a number, or an implicit 1 (as in @expr{x}), | 22328 | where @expr{a} is a number, or an implicit 1 (as in @expr{x}), |
| 22341 | or the implicit one-half of @expr{@t{sqrt}(x)}, and similarly for | 22329 | or the implicit one-half of @expr{@t{sqrt}(x)}, and similarly for |
| @@ -22346,7 +22334,7 @@ If the sum of the powers is zero, the product is simplified to | |||
| 22346 | 22334 | ||
| 22347 | The product of a negative power times anything but another negative | 22335 | The product of a negative power times anything but another negative |
| 22348 | power is changed to use division: | 22336 | power is changed to use division: |
| 22349 | @texline @tmath{x^{-2} y} | 22337 | @texline @math{x^{-2} y} |
| 22350 | @infoline @expr{x^(-2) y} | 22338 | @infoline @expr{x^(-2) y} |
| 22351 | goes to @expr{y / x^2} unless matrix mode is | 22339 | goes to @expr{y / x^2} unless matrix mode is |
| 22352 | in effect and neither @expr{x} nor @expr{y} are scalar (in which | 22340 | in effect and neither @expr{x} nor @expr{y} are scalar (in which |
| @@ -22370,11 +22358,11 @@ infinite quantity, as directed by the current infinite mode. | |||
| 22370 | @xref{Infinite Mode}. | 22358 | @xref{Infinite Mode}. |
| 22371 | 22359 | ||
| 22372 | The expression | 22360 | The expression |
| 22373 | @texline @tmath{a / b^{-c}} | 22361 | @texline @math{a / b^{-c}} |
| 22374 | @infoline @expr{a / b^(-c)} | 22362 | @infoline @expr{a / b^(-c)} |
| 22375 | is changed to @expr{a b^c}, where @expr{-c} is any negative-looking | 22363 | is changed to @expr{a b^c}, where @expr{-c} is any negative-looking |
| 22376 | power. Also, @expr{1 / b^c} is changed to | 22364 | power. Also, @expr{1 / b^c} is changed to |
| 22377 | @texline @tmath{b^{-c}} | 22365 | @texline @math{b^{-c}} |
| 22378 | @infoline @expr{b^(-c)} | 22366 | @infoline @expr{b^(-c)} |
| 22379 | for any power @expr{c}. | 22367 | for any power @expr{c}. |
| 22380 | 22368 | ||
| @@ -22415,22 +22403,22 @@ Powers of products or quotients @expr{(a b)^c}, @expr{(a/b)^c} | |||
| 22415 | are distributed to @expr{a^c b^c}, @expr{a^c / b^c} only if @expr{c} | 22403 | are distributed to @expr{a^c b^c}, @expr{a^c / b^c} only if @expr{c} |
| 22416 | is an integer, or if either @expr{a} or @expr{b} are nonnegative | 22404 | is an integer, or if either @expr{a} or @expr{b} are nonnegative |
| 22417 | real numbers. Powers of powers @expr{(a^b)^c} are simplified to | 22405 | real numbers. Powers of powers @expr{(a^b)^c} are simplified to |
| 22418 | @texline @tmath{a^{b c}} | 22406 | @texline @math{a^{b c}} |
| 22419 | @infoline @expr{a^(b c)} | 22407 | @infoline @expr{a^(b c)} |
| 22420 | only when @expr{c} is an integer and @expr{b c} also | 22408 | only when @expr{c} is an integer and @expr{b c} also |
| 22421 | evaluates to an integer. Without these restrictions these simplifications | 22409 | evaluates to an integer. Without these restrictions these simplifications |
| 22422 | would not be safe because of problems with principal values. | 22410 | would not be safe because of problems with principal values. |
| 22423 | (In other words, | 22411 | (In other words, |
| 22424 | @texline @tmath{((-3)^{1/2})^2} | 22412 | @texline @math{((-3)^{1/2})^2} |
| 22425 | @infoline @expr{((-3)^1:2)^2} | 22413 | @infoline @expr{((-3)^1:2)^2} |
| 22426 | is safe to simplify, but | 22414 | is safe to simplify, but |
| 22427 | @texline @tmath{((-3)^2)^{1/2}} | 22415 | @texline @math{((-3)^2)^{1/2}} |
| 22428 | @infoline @expr{((-3)^2)^1:2} | 22416 | @infoline @expr{((-3)^2)^1:2} |
| 22429 | is not.) @xref{Declarations}, for ways to inform Calc that your | 22417 | is not.) @xref{Declarations}, for ways to inform Calc that your |
| 22430 | variables satisfy these requirements. | 22418 | variables satisfy these requirements. |
| 22431 | 22419 | ||
| 22432 | As a special case of this rule, @expr{@t{sqrt}(x)^n} is simplified to | 22420 | As a special case of this rule, @expr{@t{sqrt}(x)^n} is simplified to |
| 22433 | @texline @tmath{x^{n/2}} | 22421 | @texline @math{x^{n/2}} |
| 22434 | @infoline @expr{x^(n/2)} | 22422 | @infoline @expr{x^(n/2)} |
| 22435 | only for even integers @expr{n}. | 22423 | only for even integers @expr{n}. |
| 22436 | 22424 | ||
| @@ -22443,15 +22431,15 @@ even integer, or to @expr{-(a^b)} if @expr{b} is an odd integer, | |||
| 22443 | for any negative-looking expression @expr{-a}. | 22431 | for any negative-looking expression @expr{-a}. |
| 22444 | 22432 | ||
| 22445 | Square roots @expr{@t{sqrt}(x)} generally act like one-half powers | 22433 | Square roots @expr{@t{sqrt}(x)} generally act like one-half powers |
| 22446 | @texline @tmath{x^{1:2}} | 22434 | @texline @math{x^{1:2}} |
| 22447 | @infoline @expr{x^1:2} | 22435 | @infoline @expr{x^1:2} |
| 22448 | for the purposes of the above-listed simplifications. | 22436 | for the purposes of the above-listed simplifications. |
| 22449 | 22437 | ||
| 22450 | Also, note that | 22438 | Also, note that |
| 22451 | @texline @tmath{1 / x^{1:2}} | 22439 | @texline @math{1 / x^{1:2}} |
| 22452 | @infoline @expr{1 / x^1:2} | 22440 | @infoline @expr{1 / x^1:2} |
| 22453 | is changed to | 22441 | is changed to |
| 22454 | @texline @tmath{x^{-1:2}}, | 22442 | @texline @math{x^{-1:2}}, |
| 22455 | @infoline @expr{x^(-1:2)}, | 22443 | @infoline @expr{x^(-1:2)}, |
| 22456 | but @expr{1 / @t{sqrt}(x)} is left alone. | 22444 | but @expr{1 / @t{sqrt}(x)} is left alone. |
| 22457 | 22445 | ||
| @@ -22594,7 +22582,7 @@ Thus @expr{(x + y) (y + x)} will be simplified to @expr{(x + y)^2}. | |||
| 22594 | A subtle point is that @expr{(x - y) (y - x)} will @emph{not} | 22582 | A subtle point is that @expr{(x - y) (y - x)} will @emph{not} |
| 22595 | be simplified to @expr{-(x - y)^2}; Calc does not notice that | 22583 | be simplified to @expr{-(x - y)^2}; Calc does not notice that |
| 22596 | one term can be written as a constant times the other, even if | 22584 | one term can be written as a constant times the other, even if |
| 22597 | that constant is @i{-1}. | 22585 | that constant is @mathit{-1}. |
| 22598 | 22586 | ||
| 22599 | A fraction times any expression, @expr{(a:b) x}, is changed to | 22587 | A fraction times any expression, @expr{(a:b) x}, is changed to |
| 22600 | a quotient involving integers: @expr{a x / b}. This is not | 22588 | a quotient involving integers: @expr{a x / b}. This is not |
| @@ -22637,7 +22625,7 @@ Square roots of integer or rational arguments are simplified in | |||
| 22637 | several ways. (Note that these will be left unevaluated only in | 22625 | several ways. (Note that these will be left unevaluated only in |
| 22638 | Symbolic mode.) First, square integer or rational factors are | 22626 | Symbolic mode.) First, square integer or rational factors are |
| 22639 | pulled out so that @expr{@t{sqrt}(8)} is rewritten as | 22627 | pulled out so that @expr{@t{sqrt}(8)} is rewritten as |
| 22640 | @texline @tmath{$2\,\t{sqrt}(2)$}. | 22628 | @texline @math{2\,\t{sqrt}(2)}. |
| 22641 | @infoline @expr{2 sqrt(2)}. | 22629 | @infoline @expr{2 sqrt(2)}. |
| 22642 | Conceptually speaking this implies factoring the argument into primes | 22630 | Conceptually speaking this implies factoring the argument into primes |
| 22643 | and moving pairs of primes out of the square root, but for reasons of | 22631 | and moving pairs of primes out of the square root, but for reasons of |
| @@ -22699,23 +22687,23 @@ functions are known, except for negative arguments of @code{arcsin}, | |||
| 22699 | @code{arctan}, @code{arcsinh}, and @code{arctanh}. Note that | 22687 | @code{arctan}, @code{arcsinh}, and @code{arctanh}. Note that |
| 22700 | @expr{@t{arcsin}(@t{sin}(x))} can @emph{not} safely change to | 22688 | @expr{@t{arcsin}(@t{sin}(x))} can @emph{not} safely change to |
| 22701 | @expr{x}, since this only correct within an integer multiple of | 22689 | @expr{x}, since this only correct within an integer multiple of |
| 22702 | @texline @tmath{2 \pi} | 22690 | @texline @math{2 \pi} |
| 22703 | @infoline @expr{2 pi} | 22691 | @infoline @expr{2 pi} |
| 22704 | radians or 360 degrees. However, @expr{@t{arcsinh}(@t{sinh}(x))} is | 22692 | radians or 360 degrees. However, @expr{@t{arcsinh}(@t{sinh}(x))} is |
| 22705 | simplified to @expr{x} if @expr{x} is known to be real. | 22693 | simplified to @expr{x} if @expr{x} is known to be real. |
| 22706 | 22694 | ||
| 22707 | Several simplifications that apply to logarithms and exponentials | 22695 | Several simplifications that apply to logarithms and exponentials |
| 22708 | are that @expr{@t{exp}(@t{ln}(x))}, | 22696 | are that @expr{@t{exp}(@t{ln}(x))}, |
| 22709 | @texline @t{e}@tmath{^{\ln(x)}}, | 22697 | @texline @t{e}@math{^{\ln(x)}}, |
| 22710 | @infoline @expr{e^@t{ln}(x)}, | 22698 | @infoline @expr{e^@t{ln}(x)}, |
| 22711 | and | 22699 | and |
| 22712 | @texline @tmath{10^{{\rm log10}(x)}} | 22700 | @texline @math{10^{{\rm log10}(x)}} |
| 22713 | @infoline @expr{10^@t{log10}(x)} | 22701 | @infoline @expr{10^@t{log10}(x)} |
| 22714 | all reduce to @expr{x}. Also, @expr{@t{ln}(@t{exp}(x))}, etc., can | 22702 | all reduce to @expr{x}. Also, @expr{@t{ln}(@t{exp}(x))}, etc., can |
| 22715 | reduce to @expr{x} if @expr{x} is provably real. The form | 22703 | reduce to @expr{x} if @expr{x} is provably real. The form |
| 22716 | @expr{@t{exp}(x)^y} is simplified to @expr{@t{exp}(x y)}. If @expr{x} | 22704 | @expr{@t{exp}(x)^y} is simplified to @expr{@t{exp}(x y)}. If @expr{x} |
| 22717 | is a suitable multiple of | 22705 | is a suitable multiple of |
| 22718 | @texline @tmath{\pi i} | 22706 | @texline @math{\pi i} |
| 22719 | @infoline @expr{pi i} | 22707 | @infoline @expr{pi i} |
| 22720 | (as described above for the trigonometric functions), then | 22708 | (as described above for the trigonometric functions), then |
| 22721 | @expr{@t{exp}(x)} or @expr{e^x} will be expanded. Finally, | 22709 | @expr{@t{exp}(x)} or @expr{e^x} will be expanded. Finally, |
| @@ -22800,18 +22788,18 @@ are folded down to the 360-degree range that the inverse trigonometric | |||
| 22800 | functions always produce. | 22788 | functions always produce. |
| 22801 | 22789 | ||
| 22802 | Powers of powers @expr{(x^a)^b} are simplified to | 22790 | Powers of powers @expr{(x^a)^b} are simplified to |
| 22803 | @texline @tmath{x^{a b}} | 22791 | @texline @math{x^{a b}} |
| 22804 | @infoline @expr{x^(a b)} | 22792 | @infoline @expr{x^(a b)} |
| 22805 | for all @expr{a} and @expr{b}. These results will be valid only | 22793 | for all @expr{a} and @expr{b}. These results will be valid only |
| 22806 | in a restricted range of @expr{x}; for example, in | 22794 | in a restricted range of @expr{x}; for example, in |
| 22807 | @texline @tmath{(x^2)^{1:2}} | 22795 | @texline @math{(x^2)^{1:2}} |
| 22808 | @infoline @expr{(x^2)^1:2} | 22796 | @infoline @expr{(x^2)^1:2} |
| 22809 | the powers cancel to get @expr{x}, which is valid for positive values | 22797 | the powers cancel to get @expr{x}, which is valid for positive values |
| 22810 | of @expr{x} but not for negative or complex values. | 22798 | of @expr{x} but not for negative or complex values. |
| 22811 | 22799 | ||
| 22812 | Similarly, @expr{@t{sqrt}(x^a)} and @expr{@t{sqrt}(x)^a} are both | 22800 | Similarly, @expr{@t{sqrt}(x^a)} and @expr{@t{sqrt}(x)^a} are both |
| 22813 | simplified (possibly unsafely) to | 22801 | simplified (possibly unsafely) to |
| 22814 | @texline @tmath{x^{a/2}}. | 22802 | @texline @math{x^{a/2}}. |
| 22815 | @infoline @expr{x^(a/2)}. | 22803 | @infoline @expr{x^(a/2)}. |
| 22816 | 22804 | ||
| 22817 | Forms like @expr{@t{sqrt}(1 - sin(x)^2)} are simplified to, e.g., | 22805 | Forms like @expr{@t{sqrt}(1 - sin(x)^2)} are simplified to, e.g., |
| @@ -22887,7 +22875,7 @@ number for an answer, then the quotient simplifies to that number. | |||
| 22887 | For powers and square roots, the ``unsafe'' simplifications | 22875 | For powers and square roots, the ``unsafe'' simplifications |
| 22888 | @expr{(a b)^c} to @expr{a^c b^c}, @expr{(a/b)^c} to @expr{a^c / b^c}, | 22876 | @expr{(a b)^c} to @expr{a^c b^c}, @expr{(a/b)^c} to @expr{a^c / b^c}, |
| 22889 | and @expr{(a^b)^c} to | 22877 | and @expr{(a^b)^c} to |
| 22890 | @texline @tmath{a^{b c}} | 22878 | @texline @math{a^{b c}} |
| 22891 | @infoline @expr{a^(b c)} | 22879 | @infoline @expr{a^(b c)} |
| 22892 | are done if the powers are real numbers. (These are safe in the context | 22880 | are done if the powers are real numbers. (These are safe in the context |
| 22893 | of units because all numbers involved can reasonably be assumed to be | 22881 | of units because all numbers involved can reasonably be assumed to be |
| @@ -22902,10 +22890,10 @@ is simplified by noting that @expr{1.5 = 3:2}, that @samp{acre} | |||
| 22902 | is defined in terms of @samp{m^2}, and that the 2 in the power of | 22890 | is defined in terms of @samp{m^2}, and that the 2 in the power of |
| 22903 | @code{m} is a multiple of 2 in @expr{3:2}. Thus, @code{acre^1.5} is | 22891 | @code{m} is a multiple of 2 in @expr{3:2}. Thus, @code{acre^1.5} is |
| 22904 | replaced by approximately | 22892 | replaced by approximately |
| 22905 | @texline @tmath{(4046 m^2)^{1.5}} | 22893 | @texline @math{(4046 m^2)^{1.5}} |
| 22906 | @infoline @expr{(4046 m^2)^1.5}, | 22894 | @infoline @expr{(4046 m^2)^1.5}, |
| 22907 | which is then changed to | 22895 | which is then changed to |
| 22908 | @texline @tmath{4046^{1.5} \, (m^2)^{1.5}}, | 22896 | @texline @math{4046^{1.5} \, (m^2)^{1.5}}, |
| 22909 | @infoline @expr{4046^1.5 (m^2)^1.5}, | 22897 | @infoline @expr{4046^1.5 (m^2)^1.5}, |
| 22910 | then to @expr{257440 m^3}. | 22898 | then to @expr{257440 m^3}. |
| 22911 | 22899 | ||
| @@ -23195,7 +23183,7 @@ answer! | |||
| 23195 | If you use the @code{deriv} function directly in an algebraic formula, | 23183 | If you use the @code{deriv} function directly in an algebraic formula, |
| 23196 | you can write @samp{deriv(f,x,x0)} which represents the derivative | 23184 | you can write @samp{deriv(f,x,x0)} which represents the derivative |
| 23197 | of @expr{f} with respect to @expr{x}, evaluated at the point | 23185 | of @expr{f} with respect to @expr{x}, evaluated at the point |
| 23198 | @texline @tmath{x=x_0}. | 23186 | @texline @math{x=x_0}. |
| 23199 | @infoline @expr{x=x0}. | 23187 | @infoline @expr{x=x0}. |
| 23200 | 23188 | ||
| 23201 | If the formula being differentiated contains functions which Calc does | 23189 | If the formula being differentiated contains functions which Calc does |
| @@ -23235,7 +23223,7 @@ all integrable functions, but it is able to integrate several large | |||
| 23235 | classes of formulas. In particular, any polynomial or rational function | 23223 | classes of formulas. In particular, any polynomial or rational function |
| 23236 | (a polynomial divided by a polynomial) is acceptable. (Rational functions | 23224 | (a polynomial divided by a polynomial) is acceptable. (Rational functions |
| 23237 | don't have to be in explicit quotient form, however; | 23225 | don't have to be in explicit quotient form, however; |
| 23238 | @texline @tmath{x/(1+x^{-2})} | 23226 | @texline @math{x/(1+x^{-2})} |
| 23239 | @infoline @expr{x/(1+x^-2)} | 23227 | @infoline @expr{x/(1+x^-2)} |
| 23240 | is not strictly a quotient of polynomials, but it is equivalent to | 23228 | is not strictly a quotient of polynomials, but it is equivalent to |
| 23241 | @expr{x^3/(x^2+1)}, which is.) Also, square roots of terms involving | 23229 | @expr{x^3/(x^2+1)}, which is.) Also, square roots of terms involving |
| @@ -23261,7 +23249,7 @@ integral $\int_a^b f(x) \, dx$. | |||
| 23261 | Please note that the current implementation of Calc's integrator sometimes | 23249 | Please note that the current implementation of Calc's integrator sometimes |
| 23262 | produces results that are significantly more complex than they need to | 23250 | produces results that are significantly more complex than they need to |
| 23263 | be. For example, the integral Calc finds for | 23251 | be. For example, the integral Calc finds for |
| 23264 | @texline @tmath{1/(x+\sqrt{x^2+1})} | 23252 | @texline @math{1/(x+\sqrt{x^2+1})} |
| 23265 | @infoline @expr{1/(x+sqrt(x^2+1))} | 23253 | @infoline @expr{1/(x+sqrt(x^2+1))} |
| 23266 | is several times more complicated than the answer Mathematica | 23254 | is several times more complicated than the answer Mathematica |
| 23267 | returns for the same input, although the two forms are numerically | 23255 | returns for the same input, although the two forms are numerically |
| @@ -23269,11 +23257,11 @@ equivalent. Also, any indefinite integral should be considered to have | |||
| 23269 | an arbitrary constant of integration added to it, although Calc does not | 23257 | an arbitrary constant of integration added to it, although Calc does not |
| 23270 | write an explicit constant of integration in its result. For example, | 23258 | write an explicit constant of integration in its result. For example, |
| 23271 | Calc's solution for | 23259 | Calc's solution for |
| 23272 | @texline @tmath{1/(1+\tan x)} | 23260 | @texline @math{1/(1+\tan x)} |
| 23273 | @infoline @expr{1/(1+tan(x))} | 23261 | @infoline @expr{1/(1+tan(x))} |
| 23274 | differs from the solution given in the @emph{CRC Math Tables} by a | 23262 | differs from the solution given in the @emph{CRC Math Tables} by a |
| 23275 | constant factor of | 23263 | constant factor of |
| 23276 | @texline @tmath{\pi i / 2} | 23264 | @texline @math{\pi i / 2} |
| 23277 | @infoline @expr{pi i / 2}, | 23265 | @infoline @expr{pi i / 2}, |
| 23278 | due to a different choice of constant of integration. | 23266 | due to a different choice of constant of integration. |
| 23279 | 23267 | ||
| @@ -23333,7 +23321,7 @@ in your @code{IntegRules}. | |||
| 23333 | As a more serious example, the expression @samp{exp(x)/x} cannot be | 23321 | As a more serious example, the expression @samp{exp(x)/x} cannot be |
| 23334 | integrated in terms of the standard functions, so the ``exponential | 23322 | integrated in terms of the standard functions, so the ``exponential |
| 23335 | integral'' function | 23323 | integral'' function |
| 23336 | @texline @tmath{{\rm Ei}(x)} | 23324 | @texline @math{{\rm Ei}(x)} |
| 23337 | @infoline @expr{Ei(x)} | 23325 | @infoline @expr{Ei(x)} |
| 23338 | was invented to describe it. | 23326 | was invented to describe it. |
| 23339 | We can get Calc to do this integral in terms of a made-up @code{Ei} | 23327 | We can get Calc to do this integral in terms of a made-up @code{Ei} |
| @@ -23506,16 +23494,16 @@ form @expr{X = 0}. | |||
| 23506 | This command also works for inequalities, as in @expr{y < 3x + 6}. | 23494 | This command also works for inequalities, as in @expr{y < 3x + 6}. |
| 23507 | Some inequalities cannot be solved where the analogous equation could | 23495 | Some inequalities cannot be solved where the analogous equation could |
| 23508 | be; for example, solving | 23496 | be; for example, solving |
| 23509 | @texline @tmath{a < b \, c} | 23497 | @texline @math{a < b \, c} |
| 23510 | @infoline @expr{a < b c} | 23498 | @infoline @expr{a < b c} |
| 23511 | for @expr{b} is impossible | 23499 | for @expr{b} is impossible |
| 23512 | without knowing the sign of @expr{c}. In this case, @kbd{a S} will | 23500 | without knowing the sign of @expr{c}. In this case, @kbd{a S} will |
| 23513 | produce the result | 23501 | produce the result |
| 23514 | @texline @tmath{b \mathbin{\hbox{\code{!=}}} a/c} | 23502 | @texline @math{b \mathbin{\hbox{\code{!=}}} a/c} |
| 23515 | @infoline @expr{b != a/c} | 23503 | @infoline @expr{b != a/c} |
| 23516 | (using the not-equal-to operator) to signify that the direction of the | 23504 | (using the not-equal-to operator) to signify that the direction of the |
| 23517 | inequality is now unknown. The inequality | 23505 | inequality is now unknown. The inequality |
| 23518 | @texline @tmath{a \le b \, c} | 23506 | @texline @math{a \le b \, c} |
| 23519 | @infoline @expr{a <= b c} | 23507 | @infoline @expr{a <= b c} |
| 23520 | is not even partially solved. @xref{Declarations}, for a way to tell | 23508 | is not even partially solved. @xref{Declarations}, for a way to tell |
| 23521 | Calc that the signs of the variables in a formula are in fact known. | 23509 | Calc that the signs of the variables in a formula are in fact known. |
| @@ -23542,7 +23530,7 @@ Some equations have more than one solution. The Hyperbolic flag | |||
| 23542 | general family of solutions. It will invent variables @code{n1}, | 23530 | general family of solutions. It will invent variables @code{n1}, |
| 23543 | @code{n2}, @dots{}, which represent independent arbitrary integers, and | 23531 | @code{n2}, @dots{}, which represent independent arbitrary integers, and |
| 23544 | @code{s1}, @code{s2}, @dots{}, which represent independent arbitrary | 23532 | @code{s1}, @code{s2}, @dots{}, which represent independent arbitrary |
| 23545 | signs (either @i{+1} or @i{-1}). If you don't use the Hyperbolic | 23533 | signs (either @mathit{+1} or @mathit{-1}). If you don't use the Hyperbolic |
| 23546 | flag, Calc will use zero in place of all arbitrary integers, and plus | 23534 | flag, Calc will use zero in place of all arbitrary integers, and plus |
| 23547 | one in place of all arbitrary signs. Note that variables like @code{n1} | 23535 | one in place of all arbitrary signs. Note that variables like @code{n1} |
| 23548 | and @code{s1} are not given any special interpretation in Calc except by | 23536 | and @code{s1} are not given any special interpretation in Calc except by |
| @@ -23975,11 +23963,11 @@ with the minimum value itself. | |||
| 23975 | 23963 | ||
| 23976 | Note that this command looks for a @emph{local} minimum. Many functions | 23964 | Note that this command looks for a @emph{local} minimum. Many functions |
| 23977 | have more than one minimum; some, like | 23965 | have more than one minimum; some, like |
| 23978 | @texline @tmath{x \sin x}, | 23966 | @texline @math{x \sin x}, |
| 23979 | @infoline @expr{x sin(x)}, | 23967 | @infoline @expr{x sin(x)}, |
| 23980 | have infinitely many. In fact, there is no easy way to define the | 23968 | have infinitely many. In fact, there is no easy way to define the |
| 23981 | ``global'' minimum of | 23969 | ``global'' minimum of |
| 23982 | @texline @tmath{x \sin x} | 23970 | @texline @math{x \sin x} |
| 23983 | @infoline @expr{x sin(x)} | 23971 | @infoline @expr{x sin(x)} |
| 23984 | but Calc can still locate any particular local minimum | 23972 | but Calc can still locate any particular local minimum |
| 23985 | for you. Calc basically goes downhill from the initial guess until it | 23973 | for you. Calc basically goes downhill from the initial guess until it |
| @@ -24102,7 +24090,7 @@ the @dfn{parameters} of the model. | |||
| 24102 | The @kbd{a F} command takes the data set to be fitted from the stack. | 24090 | The @kbd{a F} command takes the data set to be fitted from the stack. |
| 24103 | By default, it expects the data in the form of a matrix. For example, | 24091 | By default, it expects the data in the form of a matrix. For example, |
| 24104 | for a linear or polynomial fit, this would be a | 24092 | for a linear or polynomial fit, this would be a |
| 24105 | @texline @tmath{2\times N} | 24093 | @texline @math{2\times N} |
| 24106 | @infoline 2xN | 24094 | @infoline 2xN |
| 24107 | matrix where the first row is a list of @expr{x} values and the second | 24095 | matrix where the first row is a list of @expr{x} values and the second |
| 24108 | row has the corresponding @expr{y} values. For the multilinear fit | 24096 | row has the corresponding @expr{y} values. For the multilinear fit |
| @@ -24110,10 +24098,10 @@ shown above, the matrix would have four rows (@expr{x_1}, @expr{x_2}, | |||
| 24110 | @expr{x_3}, and @expr{y}, respectively). | 24098 | @expr{x_3}, and @expr{y}, respectively). |
| 24111 | 24099 | ||
| 24112 | If you happen to have an | 24100 | If you happen to have an |
| 24113 | @texline @tmath{N\times2} | 24101 | @texline @math{N\times2} |
| 24114 | @infoline Nx2 | 24102 | @infoline Nx2 |
| 24115 | matrix instead of a | 24103 | matrix instead of a |
| 24116 | @texline @tmath{2\times N} | 24104 | @texline @math{2\times N} |
| 24117 | @infoline 2xN | 24105 | @infoline 2xN |
| 24118 | matrix, just press @kbd{v t} first to transpose the matrix. | 24106 | matrix, just press @kbd{v t} first to transpose the matrix. |
| 24119 | 24107 | ||
| @@ -24211,11 +24199,11 @@ which is clearly zero if @expr{a + b x} exactly fits all data points, | |||
| 24211 | and increases as various @expr{a + b x_i} values fail to match the | 24199 | and increases as various @expr{a + b x_i} values fail to match the |
| 24212 | corresponding @expr{y_i} values. There are several reasons why the | 24200 | corresponding @expr{y_i} values. There are several reasons why the |
| 24213 | summand is squared, one of them being to ensure that | 24201 | summand is squared, one of them being to ensure that |
| 24214 | @texline @tmath{\chi^2 \ge 0}. | 24202 | @texline @math{\chi^2 \ge 0}. |
| 24215 | @infoline @expr{chi^2 >= 0}. | 24203 | @infoline @expr{chi^2 >= 0}. |
| 24216 | Least-squares fitting simply chooses the values of @expr{a} and @expr{b} | 24204 | Least-squares fitting simply chooses the values of @expr{a} and @expr{b} |
| 24217 | for which the error | 24205 | for which the error |
| 24218 | @texline @tmath{\chi^2} | 24206 | @texline @math{\chi^2} |
| 24219 | @infoline @expr{chi^2} | 24207 | @infoline @expr{chi^2} |
| 24220 | is as small as possible. | 24208 | is as small as possible. |
| 24221 | 24209 | ||
| @@ -24271,7 +24259,7 @@ line slightly to improve the fit. | |||
| 24271 | 24259 | ||
| 24272 | An important result from the theory of polynomial fitting is that it | 24260 | An important result from the theory of polynomial fitting is that it |
| 24273 | is always possible to fit @var{n} data points exactly using a polynomial | 24261 | is always possible to fit @var{n} data points exactly using a polynomial |
| 24274 | of degree @i{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}. | 24262 | of degree @mathit{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}. |
| 24275 | Using the modified (14) data matrix, a model number of 4 gives | 24263 | Using the modified (14) data matrix, a model number of 4 gives |
| 24276 | a polynomial that exactly matches all five data points: | 24264 | a polynomial that exactly matches all five data points: |
| 24277 | 24265 | ||
| @@ -24376,10 +24364,10 @@ contain error forms. The data values must either all include errors | |||
| 24376 | or all be plain numbers. Error forms can go anywhere but generally | 24364 | or all be plain numbers. Error forms can go anywhere but generally |
| 24377 | go on the numbers in the last row of the data matrix. If the last | 24365 | go on the numbers in the last row of the data matrix. If the last |
| 24378 | row contains error forms | 24366 | row contains error forms |
| 24379 | @texline `@var{y_i}@w{ @t{+/-} }@tmath{\sigma_i}', | 24367 | @texline `@var{y_i}@w{ @t{+/-} }@math{\sigma_i}', |
| 24380 | @infoline `@var{y_i}@w{ @t{+/-} }@var{sigma_i}', | 24368 | @infoline `@var{y_i}@w{ @t{+/-} }@var{sigma_i}', |
| 24381 | then the | 24369 | then the |
| 24382 | @texline @tmath{\chi^2} | 24370 | @texline @math{\chi^2} |
| 24383 | @infoline @expr{chi^2} | 24371 | @infoline @expr{chi^2} |
| 24384 | statistic is now, | 24372 | statistic is now, |
| 24385 | 24373 | ||
| @@ -24402,7 +24390,7 @@ the fitting operation. | |||
| 24402 | If there are error forms on other rows of the data matrix, all the | 24390 | If there are error forms on other rows of the data matrix, all the |
| 24403 | errors for a given data point are combined; the square root of the | 24391 | errors for a given data point are combined; the square root of the |
| 24404 | sum of the squares of the errors forms the | 24392 | sum of the squares of the errors forms the |
| 24405 | @texline @tmath{\sigma_i} | 24393 | @texline @math{\sigma_i} |
| 24406 | @infoline @expr{sigma_i} | 24394 | @infoline @expr{sigma_i} |
| 24407 | used for the data point. | 24395 | used for the data point. |
| 24408 | 24396 | ||
| @@ -24412,14 +24400,14 @@ probably use @kbd{H a F} so that the output also contains error | |||
| 24412 | estimates. | 24400 | estimates. |
| 24413 | 24401 | ||
| 24414 | If the input contains error forms but all the | 24402 | If the input contains error forms but all the |
| 24415 | @texline @tmath{\sigma_i} | 24403 | @texline @math{\sigma_i} |
| 24416 | @infoline @expr{sigma_i} | 24404 | @infoline @expr{sigma_i} |
| 24417 | values are the same, it is easy to see that the resulting fitted model | 24405 | values are the same, it is easy to see that the resulting fitted model |
| 24418 | will be the same as if the input did not have error forms at all | 24406 | will be the same as if the input did not have error forms at all |
| 24419 | @texline (@tmath{\chi^2} | 24407 | @texline (@math{\chi^2} |
| 24420 | @infoline (@expr{chi^2} | 24408 | @infoline (@expr{chi^2} |
| 24421 | is simply scaled uniformly by | 24409 | is simply scaled uniformly by |
| 24422 | @texline @tmath{1 / \sigma^2}, | 24410 | @texline @math{1 / \sigma^2}, |
| 24423 | @infoline @expr{1 / sigma^2}, | 24411 | @infoline @expr{1 / sigma^2}, |
| 24424 | which doesn't affect where it has a minimum). But there @emph{will} be | 24412 | which doesn't affect where it has a minimum). But there @emph{will} be |
| 24425 | a difference in the estimated errors of the coefficients reported by | 24413 | a difference in the estimated errors of the coefficients reported by |
| @@ -24454,20 +24442,20 @@ will have length @expr{M = d+1} with the constant term first. | |||
| 24454 | @item | 24442 | @item |
| 24455 | The covariance matrix @expr{C} computed from the fit. This is | 24443 | The covariance matrix @expr{C} computed from the fit. This is |
| 24456 | an @var{m}x@var{m} symmetric matrix; the diagonal elements | 24444 | an @var{m}x@var{m} symmetric matrix; the diagonal elements |
| 24457 | @texline @tmath{C_{jj}} | 24445 | @texline @math{C_{jj}} |
| 24458 | @infoline @expr{C_j_j} | 24446 | @infoline @expr{C_j_j} |
| 24459 | are the variances | 24447 | are the variances |
| 24460 | @texline @tmath{\sigma_j^2} | 24448 | @texline @math{\sigma_j^2} |
| 24461 | @infoline @expr{sigma_j^2} | 24449 | @infoline @expr{sigma_j^2} |
| 24462 | of the parameters. The other elements are covariances | 24450 | of the parameters. The other elements are covariances |
| 24463 | @texline @tmath{\sigma_{ij}^2} | 24451 | @texline @math{\sigma_{ij}^2} |
| 24464 | @infoline @expr{sigma_i_j^2} | 24452 | @infoline @expr{sigma_i_j^2} |
| 24465 | that describe the correlation between pairs of parameters. (A related | 24453 | that describe the correlation between pairs of parameters. (A related |
| 24466 | set of numbers, the @dfn{linear correlation coefficients} | 24454 | set of numbers, the @dfn{linear correlation coefficients} |
| 24467 | @texline @tmath{r_{ij}}, | 24455 | @texline @math{r_{ij}}, |
| 24468 | @infoline @expr{r_i_j}, | 24456 | @infoline @expr{r_i_j}, |
| 24469 | are defined as | 24457 | are defined as |
| 24470 | @texline @tmath{\sigma_{ij}^2 / \sigma_i \, \sigma_j}.) | 24458 | @texline @math{\sigma_{ij}^2 / \sigma_i \, \sigma_j}.) |
| 24471 | @infoline @expr{sigma_i_j^2 / sigma_i sigma_j}.) | 24459 | @infoline @expr{sigma_i_j^2 / sigma_i sigma_j}.) |
| 24472 | 24460 | ||
| 24473 | @item | 24461 | @item |
| @@ -24478,11 +24466,11 @@ polynomial and multilinear fits described so far. | |||
| 24478 | 24466 | ||
| 24479 | @item | 24467 | @item |
| 24480 | The value of | 24468 | The value of |
| 24481 | @texline @tmath{\chi^2} | 24469 | @texline @math{\chi^2} |
| 24482 | @infoline @expr{chi^2} | 24470 | @infoline @expr{chi^2} |
| 24483 | for the fit, calculated by the formulas shown above. This gives a | 24471 | for the fit, calculated by the formulas shown above. This gives a |
| 24484 | measure of the quality of the fit; statisticians consider | 24472 | measure of the quality of the fit; statisticians consider |
| 24485 | @texline @tmath{\chi^2 \approx N - M} | 24473 | @texline @math{\chi^2 \approx N - M} |
| 24486 | @infoline @expr{chi^2 = N - M} | 24474 | @infoline @expr{chi^2 = N - M} |
| 24487 | to indicate a moderately good fit (where again @expr{N} is the number of | 24475 | to indicate a moderately good fit (where again @expr{N} is the number of |
| 24488 | data points and @expr{M} is the number of parameters). | 24476 | data points and @expr{M} is the number of parameters). |
| @@ -24491,13 +24479,13 @@ data points and @expr{M} is the number of parameters). | |||
| 24491 | A measure of goodness of fit expressed as a probability @expr{Q}. | 24479 | A measure of goodness of fit expressed as a probability @expr{Q}. |
| 24492 | This is computed from the @code{utpc} probability distribution | 24480 | This is computed from the @code{utpc} probability distribution |
| 24493 | function using | 24481 | function using |
| 24494 | @texline @tmath{\chi^2} | 24482 | @texline @math{\chi^2} |
| 24495 | @infoline @expr{chi^2} | 24483 | @infoline @expr{chi^2} |
| 24496 | with @expr{N - M} degrees of freedom. A | 24484 | with @expr{N - M} degrees of freedom. A |
| 24497 | value of 0.5 implies a good fit; some texts recommend that often | 24485 | value of 0.5 implies a good fit; some texts recommend that often |
| 24498 | @expr{Q = 0.1} or even 0.001 can signify an acceptable fit. In | 24486 | @expr{Q = 0.1} or even 0.001 can signify an acceptable fit. In |
| 24499 | particular, | 24487 | particular, |
| 24500 | @texline @tmath{\chi^2} | 24488 | @texline @math{\chi^2} |
| 24501 | @infoline @expr{chi^2} | 24489 | @infoline @expr{chi^2} |
| 24502 | statistics assume the errors in your inputs | 24490 | statistics assume the errors in your inputs |
| 24503 | follow a normal (Gaussian) distribution; if they don't, you may | 24491 | follow a normal (Gaussian) distribution; if they don't, you may |
| @@ -24506,7 +24494,7 @@ have to accept smaller values of @expr{Q}. | |||
| 24506 | The @expr{Q} value is computed only if the input included error | 24494 | The @expr{Q} value is computed only if the input included error |
| 24507 | estimates. Otherwise, Calc will report the symbol @code{nan} | 24495 | estimates. Otherwise, Calc will report the symbol @code{nan} |
| 24508 | for @expr{Q}. The reason is that in this case the | 24496 | for @expr{Q}. The reason is that in this case the |
| 24509 | @texline @tmath{\chi^2} | 24497 | @texline @math{\chi^2} |
| 24510 | @infoline @expr{chi^2} | 24498 | @infoline @expr{chi^2} |
| 24511 | value has effectively been used to estimate the original errors | 24499 | value has effectively been used to estimate the original errors |
| 24512 | in the input, and thus there is no redundant information left | 24500 | in the input, and thus there is no redundant information left |
| @@ -24525,31 +24513,31 @@ Here is a complete list of the standard models recognized by @kbd{a F}: | |||
| 24525 | 24513 | ||
| 24526 | @table @kbd | 24514 | @table @kbd |
| 24527 | @item 1 | 24515 | @item 1 |
| 24528 | Linear or multilinear. @i{a + b x + c y + d z}. | 24516 | Linear or multilinear. @mathit{a + b x + c y + d z}. |
| 24529 | @item 2-9 | 24517 | @item 2-9 |
| 24530 | Polynomials. @i{a + b x + c x^2 + d x^3}. | 24518 | Polynomials. @mathit{a + b x + c x^2 + d x^3}. |
| 24531 | @item e | 24519 | @item e |
| 24532 | Exponential. @i{a} @t{exp}@i{(b x)} @t{exp}@i{(c y)}. | 24520 | Exponential. @mathit{a} @t{exp}@mathit{(b x)} @t{exp}@mathit{(c y)}. |
| 24533 | @item E | 24521 | @item E |
| 24534 | Base-10 exponential. @i{a} @t{10^}@i{(b x)} @t{10^}@i{(c y)}. | 24522 | Base-10 exponential. @mathit{a} @t{10^}@mathit{(b x)} @t{10^}@mathit{(c y)}. |
| 24535 | @item x | 24523 | @item x |
| 24536 | Exponential (alternate notation). @t{exp}@i{(a + b x + c y)}. | 24524 | Exponential (alternate notation). @t{exp}@mathit{(a + b x + c y)}. |
| 24537 | @item X | 24525 | @item X |
| 24538 | Base-10 exponential (alternate). @t{10^}@i{(a + b x + c y)}. | 24526 | Base-10 exponential (alternate). @t{10^}@mathit{(a + b x + c y)}. |
| 24539 | @item l | 24527 | @item l |
| 24540 | Logarithmic. @i{a + b} @t{ln}@i{(x) + c} @t{ln}@i{(y)}. | 24528 | Logarithmic. @mathit{a + b} @t{ln}@mathit{(x) + c} @t{ln}@mathit{(y)}. |
| 24541 | @item L | 24529 | @item L |
| 24542 | Base-10 logarithmic. @i{a + b} @t{log10}@i{(x) + c} @t{log10}@i{(y)}. | 24530 | Base-10 logarithmic. @mathit{a + b} @t{log10}@mathit{(x) + c} @t{log10}@mathit{(y)}. |
| 24543 | @item ^ | 24531 | @item ^ |
| 24544 | General exponential. @i{a b^x c^y}. | 24532 | General exponential. @mathit{a b^x c^y}. |
| 24545 | @item p | 24533 | @item p |
| 24546 | Power law. @i{a x^b y^c}. | 24534 | Power law. @mathit{a x^b y^c}. |
| 24547 | @item q | 24535 | @item q |
| 24548 | Quadratic. @i{a + b (x-c)^2 + d (x-e)^2}. | 24536 | Quadratic. @mathit{a + b (x-c)^2 + d (x-e)^2}. |
| 24549 | @item g | 24537 | @item g |
| 24550 | Gaussian. | 24538 | Gaussian. |
| 24551 | @texline @tmath{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}. | 24539 | @texline @math{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}. |
| 24552 | @infoline @i{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}. | 24540 | @infoline @mathit{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}. |
| 24553 | @end table | 24541 | @end table |
| 24554 | 24542 | ||
| 24555 | All of these models are used in the usual way; just press the appropriate | 24543 | All of these models are used in the usual way; just press the appropriate |
| @@ -24661,18 +24649,18 @@ Calc uses the principal values of inverse functions like @code{ln} | |||
| 24661 | and @code{arcsin} when doing fits. For example, when you enter | 24649 | and @code{arcsin} when doing fits. For example, when you enter |
| 24662 | the model @samp{y = sin(a t + b)} Calc actually uses the easier | 24650 | the model @samp{y = sin(a t + b)} Calc actually uses the easier |
| 24663 | form @samp{arcsin(y) = a t + b}. The @code{arcsin} function always | 24651 | form @samp{arcsin(y) = a t + b}. The @code{arcsin} function always |
| 24664 | returns results in the range from @i{-90} to 90 degrees (or the | 24652 | returns results in the range from @mathit{-90} to 90 degrees (or the |
| 24665 | equivalent range in radians). Suppose you had data that you | 24653 | equivalent range in radians). Suppose you had data that you |
| 24666 | believed to represent roughly three oscillations of a sine wave, | 24654 | believed to represent roughly three oscillations of a sine wave, |
| 24667 | so that the argument of the sine might go from zero to | 24655 | so that the argument of the sine might go from zero to |
| 24668 | @texline @tmath{3\times360} | 24656 | @texline @math{3\times360} |
| 24669 | @infoline @i{3*360} | 24657 | @infoline @mathit{3*360} |
| 24670 | degrees. | 24658 | degrees. |
| 24671 | The above model would appear to be a good way to determine the | 24659 | The above model would appear to be a good way to determine the |
| 24672 | true frequency and phase of the sine wave, but in practice it | 24660 | true frequency and phase of the sine wave, but in practice it |
| 24673 | would fail utterly. The righthand side of the actual model | 24661 | would fail utterly. The righthand side of the actual model |
| 24674 | @samp{arcsin(y) = a t + b} will grow smoothly with @expr{t}, but | 24662 | @samp{arcsin(y) = a t + b} will grow smoothly with @expr{t}, but |
| 24675 | the lefthand side will bounce back and forth between @i{-90} and 90. | 24663 | the lefthand side will bounce back and forth between @mathit{-90} and 90. |
| 24676 | No values of @expr{a} and @expr{b} can make the two sides match, | 24664 | No values of @expr{a} and @expr{b} can make the two sides match, |
| 24677 | even approximately. | 24665 | even approximately. |
| 24678 | 24666 | ||
| @@ -24727,16 +24715,16 @@ ln(y) = ln(a) + b ln(x) | |||
| 24727 | 24715 | ||
| 24728 | @noindent | 24716 | @noindent |
| 24729 | which matches the desired form with | 24717 | which matches the desired form with |
| 24730 | @texline @tmath{Y = \ln(y)}, | 24718 | @texline @math{Y = \ln(y)}, |
| 24731 | @infoline @expr{Y = ln(y)}, | 24719 | @infoline @expr{Y = ln(y)}, |
| 24732 | @texline @tmath{A = \ln(a)}, | 24720 | @texline @math{A = \ln(a)}, |
| 24733 | @infoline @expr{A = ln(a)}, | 24721 | @infoline @expr{A = ln(a)}, |
| 24734 | @expr{F = 1}, @expr{B = b}, and | 24722 | @expr{F = 1}, @expr{B = b}, and |
| 24735 | @texline @tmath{G = \ln(x)}. | 24723 | @texline @math{G = \ln(x)}. |
| 24736 | @infoline @expr{G = ln(x)}. | 24724 | @infoline @expr{G = ln(x)}. |
| 24737 | Calc thus computes the logarithms of your @expr{y} and @expr{x} values, | 24725 | Calc thus computes the logarithms of your @expr{y} and @expr{x} values, |
| 24738 | does a linear fit for @expr{A} and @expr{B}, then solves to get | 24726 | does a linear fit for @expr{A} and @expr{B}, then solves to get |
| 24739 | @texline @tmath{a = \exp(A)} | 24727 | @texline @math{a = \exp(A)} |
| 24740 | @infoline @expr{a = exp(A)} | 24728 | @infoline @expr{a = exp(A)} |
| 24741 | and @expr{b = B}. | 24729 | and @expr{b = B}. |
| 24742 | 24730 | ||
| @@ -24750,7 +24738,7 @@ y = a + b c^2 - 2 b c x + b x^2 | |||
| 24750 | 24738 | ||
| 24751 | @noindent | 24739 | @noindent |
| 24752 | which matches with @expr{Y = y}, @expr{A = a + b c^2}, @expr{F = 1}, | 24740 | which matches with @expr{Y = y}, @expr{A = a + b c^2}, @expr{F = 1}, |
| 24753 | @expr{B = -2 b c}, @expr{G = x} (the @i{-2} factor could just as easily | 24741 | @expr{B = -2 b c}, @expr{G = x} (the @mathit{-2} factor could just as easily |
| 24754 | have been put into @expr{G} instead of @expr{B}), @expr{C = b}, and | 24742 | have been put into @expr{G} instead of @expr{B}), @expr{C = b}, and |
| 24755 | @expr{H = x^2}. | 24743 | @expr{H = x^2}. |
| 24756 | 24744 | ||
| @@ -24782,7 +24770,7 @@ from the list of parameters when you answer the variables prompt. | |||
| 24782 | A last desperate step would be to use the general-purpose | 24770 | A last desperate step would be to use the general-purpose |
| 24783 | @code{minimize} function rather than @code{fit}. After all, both | 24771 | @code{minimize} function rather than @code{fit}. After all, both |
| 24784 | functions solve the problem of minimizing an expression (the | 24772 | functions solve the problem of minimizing an expression (the |
| 24785 | @texline @tmath{\chi^2} | 24773 | @texline @math{\chi^2} |
| 24786 | @infoline @expr{chi^2} | 24774 | @infoline @expr{chi^2} |
| 24787 | sum) by adjusting certain parameters in the expression. The @kbd{a F} | 24775 | sum) by adjusting certain parameters in the expression. The @kbd{a F} |
| 24788 | command is able to use a vastly more efficient algorithm due to its | 24776 | command is able to use a vastly more efficient algorithm due to its |
| @@ -24793,7 +24781,7 @@ A compromise would be to pick out a few parameters without which the | |||
| 24793 | fit is linearizable, and use @code{minimize} on a call to @code{fit} | 24781 | fit is linearizable, and use @code{minimize} on a call to @code{fit} |
| 24794 | which efficiently takes care of the rest of the parameters. The thing | 24782 | which efficiently takes care of the rest of the parameters. The thing |
| 24795 | to be minimized would be the value of | 24783 | to be minimized would be the value of |
| 24796 | @texline @tmath{\chi^2} | 24784 | @texline @math{\chi^2} |
| 24797 | @infoline @expr{chi^2} | 24785 | @infoline @expr{chi^2} |
| 24798 | returned as the fifth result of the @code{xfit} function: | 24786 | returned as the fifth result of the @code{xfit} function: |
| 24799 | 24787 | ||
| @@ -24853,11 +24841,11 @@ and @expr{y} to be plain numbers, and makes @expr{z} into an error | |||
| 24853 | form with this combined error. The @expr{Y(x,y,z)} part of the | 24841 | form with this combined error. The @expr{Y(x,y,z)} part of the |
| 24854 | linearized model is evaluated, and the result should be an error | 24842 | linearized model is evaluated, and the result should be an error |
| 24855 | form. The error part of that result is used for | 24843 | form. The error part of that result is used for |
| 24856 | @texline @tmath{\sigma_i} | 24844 | @texline @math{\sigma_i} |
| 24857 | @infoline @expr{sigma_i} | 24845 | @infoline @expr{sigma_i} |
| 24858 | for the data point. If for some reason @expr{Y(x,y,z)} does not return | 24846 | for the data point. If for some reason @expr{Y(x,y,z)} does not return |
| 24859 | an error form, the combined error from @expr{z} is used directly for | 24847 | an error form, the combined error from @expr{z} is used directly for |
| 24860 | @texline @tmath{\sigma_i}. | 24848 | @texline @math{\sigma_i}. |
| 24861 | @infoline @expr{sigma_i}. | 24849 | @infoline @expr{sigma_i}. |
| 24862 | Finally, @expr{z} is also stripped of its error | 24850 | Finally, @expr{z} is also stripped of its error |
| 24863 | for use in computing @expr{F(x,y,z)}, @expr{G(x,y,z)} and so on; | 24851 | for use in computing @expr{F(x,y,z)}, @expr{G(x,y,z)} and so on; |
| @@ -24869,7 +24857,7 @@ the most reasonable thing in the typical case that @expr{Y(x,y,z)} | |||
| 24869 | depends only on the dependent variable @expr{z}, and in fact is | 24857 | depends only on the dependent variable @expr{z}, and in fact is |
| 24870 | often simply equal to @expr{z}. For common cases like polynomials | 24858 | often simply equal to @expr{z}. For common cases like polynomials |
| 24871 | and multilinear models, the combined error is simply used as the | 24859 | and multilinear models, the combined error is simply used as the |
| 24872 | @texline @tmath{\sigma} | 24860 | @texline @math{\sigma} |
| 24873 | @infoline @expr{sigma} | 24861 | @infoline @expr{sigma} |
| 24874 | for the data point with no further ado.) | 24862 | for the data point with no further ado.) |
| 24875 | 24863 | ||
| @@ -25223,7 +25211,7 @@ If the lower limit is greater than the upper limit (assuming a | |||
| 25223 | positive step size), the result is generally zero. However, | 25211 | positive step size), the result is generally zero. However, |
| 25224 | Calc only guarantees a zero result when the upper limit is | 25212 | Calc only guarantees a zero result when the upper limit is |
| 25225 | exactly one step less than the lower limit, i.e., if the number | 25213 | exactly one step less than the lower limit, i.e., if the number |
| 25226 | of iterations is @i{-1}. Thus @samp{sum(f(k), k, n, n-1)} is zero | 25214 | of iterations is @mathit{-1}. Thus @samp{sum(f(k), k, n, n-1)} is zero |
| 25227 | but the sum from @samp{n} to @samp{n-2} may report a nonzero value | 25215 | but the sum from @samp{n} to @samp{n-2} may report a nonzero value |
| 25228 | if Calc used a closed form solution. | 25216 | if Calc used a closed form solution. |
| 25229 | 25217 | ||
| @@ -25249,7 +25237,7 @@ formula works out to the indeterminate form @expr{0 / 0}, which | |||
| 25249 | Calc will not assume is zero. Better would be to use | 25237 | Calc will not assume is zero. Better would be to use |
| 25250 | @samp{(k != k_0) ? 1/(k-k_0) : 0}; the @samp{? :} operator does | 25238 | @samp{(k != k_0) ? 1/(k-k_0) : 0}; the @samp{? :} operator does |
| 25251 | an ``if-then-else'' test: This expression says, ``if | 25239 | an ``if-then-else'' test: This expression says, ``if |
| 25252 | @texline @tmath{k \ne k_0}, | 25240 | @texline @math{k \ne k_0}, |
| 25253 | @infoline @expr{k != k_0}, | 25241 | @infoline @expr{k != k_0}, |
| 25254 | then @expr{1/(k-k_0)}, else zero.'' Now the formula @expr{1/(k-k_0)} | 25242 | then @expr{1/(k-k_0)}, else zero.'' Now the formula @expr{1/(k-k_0)} |
| 25255 | will not even be evaluated by Calc when @expr{k = k_0}. | 25243 | will not even be evaluated by Calc when @expr{k = k_0}. |
| @@ -26264,16 +26252,16 @@ then the rule set @samp{[f(0) := 0, import(linearF)]} will apply | |||
| 26264 | all three rules. It is possible to modify the imported rules | 26252 | all three rules. It is possible to modify the imported rules |
| 26265 | slightly: @samp{import(x, v1, x1, v2, x2, @dots{})} imports | 26253 | slightly: @samp{import(x, v1, x1, v2, x2, @dots{})} imports |
| 26266 | the rule set @expr{x} with all occurrences of | 26254 | the rule set @expr{x} with all occurrences of |
| 26267 | @texline @tmath{v_1}, | 26255 | @texline @math{v_1}, |
| 26268 | @infoline @expr{v1}, | 26256 | @infoline @expr{v1}, |
| 26269 | as either a variable name or a function name, replaced with | 26257 | as either a variable name or a function name, replaced with |
| 26270 | @texline @tmath{x_1} | 26258 | @texline @math{x_1} |
| 26271 | @infoline @expr{x1} | 26259 | @infoline @expr{x1} |
| 26272 | and so on. (If | 26260 | and so on. (If |
| 26273 | @texline @tmath{v_1} | 26261 | @texline @math{v_1} |
| 26274 | @infoline @expr{v1} | 26262 | @infoline @expr{v1} |
| 26275 | is used as a function name, then | 26263 | is used as a function name, then |
| 26276 | @texline @tmath{x_1} | 26264 | @texline @math{x_1} |
| 26277 | @infoline @expr{x1} | 26265 | @infoline @expr{x1} |
| 26278 | must be either a function name itself or a @w{@samp{< >}} nameless | 26266 | must be either a function name itself or a @w{@samp{< >}} nameless |
| 26279 | function; @pxref{Specifying Operators}.) For example, @samp{[g(0) := 0, | 26267 | function; @pxref{Specifying Operators}.) For example, @samp{[g(0) := 0, |
| @@ -27739,7 +27727,7 @@ in its normal terms, and @kbd{u b} expresses the definition in base | |||
| 27739 | units. | 27727 | units. |
| 27740 | 27728 | ||
| 27741 | Two units, @code{pi} and @code{fsc} (the fine structure constant, | 27729 | Two units, @code{pi} and @code{fsc} (the fine structure constant, |
| 27742 | approximately @i{1/137}) are dimensionless. The units simplification | 27730 | approximately @mathit{1/137}) are dimensionless. The units simplification |
| 27743 | commands simply treat these names as equivalent to their corresponding | 27731 | commands simply treat these names as equivalent to their corresponding |
| 27744 | values. However you can, for example, use @kbd{u c} to convert a pure | 27732 | values. However you can, for example, use @kbd{u c} to convert a pure |
| 27745 | number into multiples of the fine structure constant, or @kbd{u b} to | 27733 | number into multiples of the fine structure constant, or @kbd{u b} to |
| @@ -27956,10 +27944,10 @@ All the arithmetic stores accept the Inverse prefix to reverse the | |||
| 27956 | order of the operands. If @expr{v} represents the contents of the | 27944 | order of the operands. If @expr{v} represents the contents of the |
| 27957 | variable, and @expr{a} is the value drawn from the stack, then regular | 27945 | variable, and @expr{a} is the value drawn from the stack, then regular |
| 27958 | @w{@kbd{s -}} assigns | 27946 | @w{@kbd{s -}} assigns |
| 27959 | @texline @tmath{v \coloneq v - a}, | 27947 | @texline @math{v \coloneq v - a}, |
| 27960 | @infoline @expr{v := v - a}, | 27948 | @infoline @expr{v := v - a}, |
| 27961 | but @kbd{I s -} assigns | 27949 | but @kbd{I s -} assigns |
| 27962 | @texline @tmath{v \coloneq a - v}. | 27950 | @texline @math{v \coloneq a - v}. |
| 27963 | @infoline @expr{v := a - v}. | 27951 | @infoline @expr{v := a - v}. |
| 27964 | While @kbd{I s *} might seem pointless, it is | 27952 | While @kbd{I s *} might seem pointless, it is |
| 27965 | useful if matrix multiplication is involved. Actually, all the | 27953 | useful if matrix multiplication is involved. Actually, all the |
| @@ -28546,7 +28534,7 @@ the same length); either or both may instead be interval forms. The | |||
| 28546 | ``z'' value must be a matrix with the same number of rows as elements | 28534 | ``z'' value must be a matrix with the same number of rows as elements |
| 28547 | in ``x'', and the same number of columns as elements in ``y''. The | 28535 | in ``x'', and the same number of columns as elements in ``y''. The |
| 28548 | result is a surface plot where | 28536 | result is a surface plot where |
| 28549 | @texline @tmath{z_{ij}} | 28537 | @texline @math{z_{ij}} |
| 28550 | @infoline @expr{z_ij} | 28538 | @infoline @expr{z_ij} |
| 28551 | is the height of the point | 28539 | is the height of the point |
| 28552 | at coordinate @expr{(x_i, y_j)} on the surface. The 3D graph will | 28540 | at coordinate @expr{(x_i, y_j)} on the surface. The 3D graph will |
| @@ -28657,7 +28645,7 @@ values covered by all the curves ought to be roughly the same if | |||
| 28657 | they are to look nice on the same graph.) | 28645 | they are to look nice on the same graph.) |
| 28658 | 28646 | ||
| 28659 | For example, to plot | 28647 | For example, to plot |
| 28660 | @texline @tmath{\sin n x} | 28648 | @texline @math{\sin n x} |
| 28661 | @infoline @expr{sin(n x)} | 28649 | @infoline @expr{sin(n x)} |
| 28662 | for integers @expr{n} | 28650 | for integers @expr{n} |
| 28663 | from 1 to 5, you could use @kbd{v x} to create a vector of integers | 28651 | from 1 to 5, you could use @kbd{v x} to create a vector of integers |
| @@ -28908,7 +28896,7 @@ values, but if you store a vector of integers in one of these variables, | |||
| 28908 | the @kbd{g a} and @kbd{g f} commands will use those style numbers | 28896 | the @kbd{g a} and @kbd{g f} commands will use those style numbers |
| 28909 | instead of the defaults for new curves that are added to the graph. | 28897 | instead of the defaults for new curves that are added to the graph. |
| 28910 | An entry should be a positive integer for a specific style, or 0 to let | 28898 | An entry should be a positive integer for a specific style, or 0 to let |
| 28911 | the style be chosen automatically, or @i{-1} to turn off lines or points | 28899 | the style be chosen automatically, or @mathit{-1} to turn off lines or points |
| 28912 | altogether. If there are more curves than elements in the vector, the | 28900 | altogether. If there are more curves than elements in the vector, the |
| 28913 | last few curves will continue to have the default styles. Of course, | 28901 | last few curves will continue to have the default styles. Of course, |
| 28914 | you can later use @kbd{g s} and @kbd{g S} to change any of these styles. | 28902 | you can later use @kbd{g s} and @kbd{g S} to change any of these styles. |
| @@ -28947,7 +28935,7 @@ picture of the graph composed of characters like @code{-} and @code{|} | |||
| 28947 | to a buffer called @samp{*Gnuplot Trail*}, which Calc then displays. | 28935 | to a buffer called @samp{*Gnuplot Trail*}, which Calc then displays. |
| 28948 | The graph is made the same size as the Emacs screen, which on most | 28936 | The graph is made the same size as the Emacs screen, which on most |
| 28949 | dumb terminals will be | 28937 | dumb terminals will be |
| 28950 | @texline @tmath{80\times24} | 28938 | @texline @math{80\times24} |
| 28951 | @infoline 80x24 | 28939 | @infoline 80x24 |
| 28952 | characters. The graph is displayed in | 28940 | characters. The graph is displayed in |
| 28953 | an Emacs ``recursive edit''; type @kbd{q} or @kbd{M-# M-#} to exit | 28941 | an Emacs ``recursive edit''; type @kbd{q} or @kbd{M-# M-#} to exit |
| @@ -29257,7 +29245,7 @@ would correctly split the line into two error forms. | |||
| 29257 | 29245 | ||
| 29258 | @xref{Matrix Functions}, to see how to pull the matrix apart into its | 29246 | @xref{Matrix Functions}, to see how to pull the matrix apart into its |
| 29259 | constituent rows and columns. (If it is a | 29247 | constituent rows and columns. (If it is a |
| 29260 | @texline @tmath{1\times1} | 29248 | @texline @math{1\times1} |
| 29261 | @infoline 1x1 | 29249 | @infoline 1x1 |
| 29262 | matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.) | 29250 | matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.) |
| 29263 | 29251 | ||
| @@ -29595,7 +29583,7 @@ same limit as last time. | |||
| 29595 | @key{INV GCD} computes the LCM (least common multiple) function. | 29583 | @key{INV GCD} computes the LCM (least common multiple) function. |
| 29596 | 29584 | ||
| 29597 | @key{INV FACT} is the gamma function. | 29585 | @key{INV FACT} is the gamma function. |
| 29598 | @texline @tmath{\Gamma(x) = (x-1)!}. | 29586 | @texline @math{\Gamma(x) = (x-1)!}. |
| 29599 | @infoline @expr{gamma(x) = (x-1)!}. | 29587 | @infoline @expr{gamma(x) = (x-1)!}. |
| 29600 | 29588 | ||
| 29601 | @key{PERM} is the number-of-permutations function, which is on the | 29589 | @key{PERM} is the number-of-permutations function, which is on the |
| @@ -31023,7 +31011,7 @@ forced to use upward-counting conventions. In this case, if @var{initial} | |||
| 31023 | is greater than @var{final} the body will not be executed at all. | 31011 | is greater than @var{final} the body will not be executed at all. |
| 31024 | Note that @var{step} may still be negative in this loop; the prefix | 31012 | Note that @var{step} may still be negative in this loop; the prefix |
| 31025 | argument merely constrains the loop-finished test. Likewise, a prefix | 31013 | argument merely constrains the loop-finished test. Likewise, a prefix |
| 31026 | argument of @i{-1} forces downward-counting conventions. | 31014 | argument of @mathit{-1} forces downward-counting conventions. |
| 31027 | 31015 | ||
| 31028 | @kindex Z @{ | 31016 | @kindex Z @{ |
| 31029 | @kindex Z @} | 31017 | @kindex Z @} |
| @@ -31994,7 +31982,7 @@ same thing with a single division by 512. | |||
| 31994 | @tindex mysin | 31982 | @tindex mysin |
| 31995 | A somewhat limited sine function could be defined as follows, using the | 31983 | A somewhat limited sine function could be defined as follows, using the |
| 31996 | well-known Taylor series expansion for | 31984 | well-known Taylor series expansion for |
| 31997 | @texline @tmath{\sin x}: | 31985 | @texline @math{\sin x}: |
| 31998 | @infoline @samp{sin(x)}: | 31986 | @infoline @samp{sin(x)}: |
| 31999 | 31987 | ||
| 32000 | @smallexample | 31988 | @smallexample |
| @@ -32517,10 +32505,10 @@ which is not a Lisp list. | |||
| 32517 | Large integers are stored as lists of the form @samp{(bigpos @var{d0} | 32505 | Large integers are stored as lists of the form @samp{(bigpos @var{d0} |
| 32518 | @var{d1} @var{d2} @dots{})} for positive integers 1000000 or more, or | 32506 | @var{d1} @var{d2} @dots{})} for positive integers 1000000 or more, or |
| 32519 | @samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers | 32507 | @samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers |
| 32520 | @i{-1000000} or less. Each @var{d} is a base-1000 ``digit,'' a Lisp integer | 32508 | @mathit{-1000000} or less. Each @var{d} is a base-1000 ``digit,'' a Lisp integer |
| 32521 | from 0 to 999. The least significant digit is @var{d0}; the last digit, | 32509 | from 0 to 999. The least significant digit is @var{d0}; the last digit, |
| 32522 | @var{dn}, which is always nonzero, is the most significant digit. For | 32510 | @var{dn}, which is always nonzero, is the most significant digit. For |
| 32523 | example, the integer @i{-12345678} is stored as @samp{(bigneg 678 345 12)}. | 32511 | example, the integer @mathit{-12345678} is stored as @samp{(bigneg 678 345 12)}. |
| 32524 | 32512 | ||
| 32525 | The distinction between small and large integers is entirely hidden from | 32513 | The distinction between small and large integers is entirely hidden from |
| 32526 | the user. In @code{defmath} definitions, the Lisp predicate @code{integerp} | 32514 | the user. In @code{defmath} definitions, the Lisp predicate @code{integerp} |
| @@ -32541,7 +32529,7 @@ Floating-point numbers are stored in the form, @samp{(float @var{mant} | |||
| 32541 | @samp{10^@var{p}} in absolute value (@var{p} represents the current | 32529 | @samp{10^@var{p}} in absolute value (@var{p} represents the current |
| 32542 | precision), and @var{exp} (the ``exponent'') is a fixnum. The value of | 32530 | precision), and @var{exp} (the ``exponent'') is a fixnum. The value of |
| 32543 | the float is @samp{@var{mant} * 10^@var{exp}}. For example, the number | 32531 | the float is @samp{@var{mant} * 10^@var{exp}}. For example, the number |
| 32544 | @i{-3.14} is stored as @samp{(float -314 -2) = -314*10^-2}. Other constraints | 32532 | @mathit{-3.14} is stored as @samp{(float -314 -2) = -314*10^-2}. Other constraints |
| 32545 | are that the number 0.0 is always stored as @samp{(float 0 0)}, and, | 32533 | are that the number 0.0 is always stored as @samp{(float 0 0)}, and, |
| 32546 | except for the 0.0 case, the rightmost base-10 digit of @var{mant} is | 32534 | except for the 0.0 case, the rightmost base-10 digit of @var{mant} is |
| 32547 | always nonzero. (If the rightmost digit is zero, the number is | 32535 | always nonzero. (If the rightmost digit is zero, the number is |
| @@ -32853,7 +32841,7 @@ is applied to the top stack element, or, if @var{unary} is not | |||
| 32853 | specified, nothing happens. When the argument is two or more, | 32841 | specified, nothing happens. When the argument is two or more, |
| 32854 | the binary function @var{func} is reduced across the top @var{arg} | 32842 | the binary function @var{func} is reduced across the top @var{arg} |
| 32855 | stack elements; when the argument is negative, the function is | 32843 | stack elements; when the argument is negative, the function is |
| 32856 | mapped between the next-to-top @i{-@var{arg}} stack elements and the | 32844 | mapped between the next-to-top @mathit{-@var{arg}} stack elements and the |
| 32857 | top element. | 32845 | top element. |
| 32858 | @end defun | 32846 | @end defun |
| 32859 | 32847 | ||
| @@ -33272,7 +33260,7 @@ or formula, this calls @code{reject-arg}. | |||
| 33272 | @end defun | 33260 | @end defun |
| 33273 | 33261 | ||
| 33274 | @defun compare x y | 33262 | @defun compare x y |
| 33275 | Compare the numbers @var{x} and @var{y}, and return @i{-1} if | 33263 | Compare the numbers @var{x} and @var{y}, and return @mathit{-1} if |
| 33276 | @samp{(lessp @var{x} @var{y})}, 1 if @samp{(lessp @var{y} @var{x})}, | 33264 | @samp{(lessp @var{x} @var{y})}, 1 if @samp{(lessp @var{y} @var{x})}, |
| 33277 | 0 if @samp{(math-equal @var{x} @var{y})}, or 2 if the order is | 33265 | 0 if @samp{(math-equal @var{x} @var{y})}, or 2 if the order is |
| 33278 | undefined or cannot be determined. | 33266 | undefined or cannot be determined. |
| @@ -33285,7 +33273,7 @@ considered to have zero digits. | |||
| 33285 | @end defun | 33273 | @end defun |
| 33286 | 33274 | ||
| 33287 | @defun scale-int x n | 33275 | @defun scale-int x n |
| 33288 | Shift integer @var{x} left @var{n} decimal digits, or right @i{-@var{n}} | 33276 | Shift integer @var{x} left @var{n} decimal digits, or right @mathit{-@var{n}} |
| 33289 | digits with truncation toward zero. | 33277 | digits with truncation toward zero. |
| 33290 | @end defun | 33278 | @end defun |
| 33291 | 33279 | ||
| @@ -33493,7 +33481,7 @@ function @code{frac}, and can be rather slow. | |||
| 33493 | @defun quarter-integer n | 33481 | @defun quarter-integer n |
| 33494 | If @var{n} is an integer or integer-valued float, this function | 33482 | If @var{n} is an integer or integer-valued float, this function |
| 33495 | returns zero. If @var{n} is a half-integer (i.e., an integer plus | 33483 | returns zero. If @var{n} is a half-integer (i.e., an integer plus |
| 33496 | @i{1:2} or 0.5), it returns 2. If @var{n} is a quarter-integer, | 33484 | @mathit{1:2} or 0.5), it returns 2. If @var{n} is a quarter-integer, |
| 33497 | it returns 1 or 3. If @var{n} is anything else, this function | 33485 | it returns 1 or 3. If @var{n} is anything else, this function |
| 33498 | returns @code{nil}. | 33486 | returns @code{nil}. |
| 33499 | @end defun | 33487 | @end defun |
| @@ -35636,8 +35624,8 @@ input data set. Each entry may be a single value or a vector of values. | |||
| 35636 | @c 20 | 35624 | @c 20 |
| 35637 | @item | 35625 | @item |
| 35638 | With a prefix argument of 1, take a single | 35626 | With a prefix argument of 1, take a single |
| 35639 | @texline @tmath{@var{n}\times2} | 35627 | @texline @var{n}@math{\times2} |
| 35640 | @infoline @i{@var{N}x2} | 35628 | @infoline @mathit{@var{N}x2} |
| 35641 | matrix from the stack instead of two separate data vectors. | 35629 | matrix from the stack instead of two separate data vectors. |
| 35642 | 35630 | ||
| 35643 | @c 21 | 35631 | @c 21 |
| @@ -35839,7 +35827,7 @@ to evaluate variables. | |||
| 35839 | The variable is replaced by the formula shown on the right. The | 35827 | The variable is replaced by the formula shown on the right. The |
| 35840 | Inverse flag reverses the order of the operands, e.g., @kbd{I s - x} | 35828 | Inverse flag reverses the order of the operands, e.g., @kbd{I s - x} |
| 35841 | assigns | 35829 | assigns |
| 35842 | @texline @tmath{x \coloneq a-x}. | 35830 | @texline @math{x \coloneq a-x}. |
| 35843 | @infoline @expr{x := a-x}. | 35831 | @infoline @expr{x := a-x}. |
| 35844 | 35832 | ||
| 35845 | @c 48 | 35833 | @c 48 |
| @@ -35847,7 +35835,7 @@ assigns | |||
| 35847 | Press @kbd{?} repeatedly to see how to choose a model. Answer the | 35835 | Press @kbd{?} repeatedly to see how to choose a model. Answer the |
| 35848 | variables prompt with @expr{iv} or @expr{iv;pv} to specify | 35836 | variables prompt with @expr{iv} or @expr{iv;pv} to specify |
| 35849 | independent and parameter variables. A positive prefix argument | 35837 | independent and parameter variables. A positive prefix argument |
| 35850 | takes @i{@var{n}+1} vectors from the stack; a zero prefix takes a matrix | 35838 | takes @mathit{@var{n}+1} vectors from the stack; a zero prefix takes a matrix |
| 35851 | and a vector from the stack. | 35839 | and a vector from the stack. |
| 35852 | 35840 | ||
| 35853 | @c 49 | 35841 | @c 49 |
diff --git a/man/custom.texi b/man/custom.texi index 1315886c529..cfea5e5eefd 100644 --- a/man/custom.texi +++ b/man/custom.texi | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | @c This is part of the Emacs manual. | 1 | @c This is part of the Emacs manual. |
| 2 | @c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002 | 2 | @c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002,2004 |
| 3 | @c Free Software Foundation, Inc. | 3 | @c Free Software Foundation, Inc. |
| 4 | @c See file emacs.texi for copying conditions. | 4 | @c See file emacs.texi for copying conditions. |
| 5 | @node Customization, Quitting, Amusements, Top | 5 | @node Customization, Quitting, Amusements, Top |
| @@ -487,23 +487,38 @@ set, saved or reset. | |||
| 487 | The customization buffer normally saves customizations in | 487 | The customization buffer normally saves customizations in |
| 488 | @file{~/.emacs}. If you wish, you can save customizations in another | 488 | @file{~/.emacs}. If you wish, you can save customizations in another |
| 489 | file instead. To make this work, your @file{~/.emacs} should set | 489 | file instead. To make this work, your @file{~/.emacs} should set |
| 490 | @code{custom-file} to the name of that file. Emacs loads the file | 490 | @code{custom-file} to the name of that file. If you are using Emacs |
| 491 | right after your @file{.emacs} if you did not load it already. For | 491 | version 21.4 or later, Emacs loads the file right after your |
| 492 | example: | 492 | @file{.emacs} if you did not load it already. In earlier versions, |
| 493 | you have to load the file in your @file{~/emacs}. If you customize | ||
| 494 | @code{custom-file} through the @samp{Customize} interface, you still | ||
| 495 | need to load it in your @file{.emacs}, but there is no need to set | ||
| 496 | it. For example: | ||
| 493 | 497 | ||
| 494 | @example | 498 | @example |
| 499 | ;; @r{if not set through the @samp{Customize} interface:} | ||
| 495 | (setq custom-file "~/.emacs-custom") | 500 | (setq custom-file "~/.emacs-custom") |
| 501 | |||
| 502 | ;; @r{in Emacs versions before 21.4 or if set through} | ||
| 503 | ;; @r{the @samp{Customize} interface.} | ||
| 504 | (load "~/.emacs-custom") | ||
| 496 | @end example | 505 | @end example |
| 497 | 506 | ||
| 498 | The variable @code{custom-file} is useful if you want to have | 507 | You can also use @code{custom-file} to specify different |
| 499 | different customizations for different Emacs versions: | 508 | customization files for different Emacs versions, like this: |
| 500 | 509 | ||
| 501 | @example | 510 | @example |
| 502 | (if (< emacs-major-version 21) | 511 | (cond ((< emacs-major-version 21) |
| 503 | ;; @r{Emacs 20 customization.} | 512 | ;; @r{Emacs 20 customization.} |
| 504 | (setq custom-file "~/.custom-20.el") | 513 | (setq custom-file "~/.custom-20.el")) |
| 505 | ;; @r{Emacs 21 customization.} | 514 | ((and (= emacs-major-version 21) (< emacs-minor-version 4)) |
| 506 | (setq custom-file "~/.custom-21.el")) | 515 | ;; @r{Emacs 21 customization, before version 21.4.} |
| 516 | (setq custom-file "~/.custom-21.el")) | ||
| 517 | (t | ||
| 518 | ;; @r{Emacs version 21.4 or later.} | ||
| 519 | (setq custom-file "~/.custom-21.4.el"))) | ||
| 520 | |||
| 521 | (load custom-file) | ||
| 507 | @end example | 522 | @end example |
| 508 | 523 | ||
| 509 | If Emacs was invoked with the @option{-q} or @option{--no-init-file} | 524 | If Emacs was invoked with the @option{-q} or @option{--no-init-file} |
diff --git a/man/dired.texi b/man/dired.texi index f19ce7e1ab0..1c5e29fe696 100644 --- a/man/dired.texi +++ b/man/dired.texi | |||
| @@ -89,7 +89,7 @@ so common in Dired that it deserves to be easy to type.) @key{DEL} | |||
| 89 | (move up and unflag) is often useful simply for moving up. | 89 | (move up and unflag) is often useful simply for moving up. |
| 90 | 90 | ||
| 91 | @findex dired-goto-file | 91 | @findex dired-goto-file |
| 92 | @kindex M-g | 92 | @kindex M-g @r{(Dired)} |
| 93 | @kbd{M-g} (@code{dired-goto-file}) moves point to the line that | 93 | @kbd{M-g} (@code{dired-goto-file}) moves point to the line that |
| 94 | describes a specified file or directory. | 94 | describes a specified file or directory. |
| 95 | 95 | ||
| @@ -1113,7 +1113,7 @@ and erases all flags and marks. | |||
| 1113 | @table @kbd | 1113 | @table @kbd |
| 1114 | @item w | 1114 | @item w |
| 1115 | @cindex Adding to the kill ring in Dired. | 1115 | @cindex Adding to the kill ring in Dired. |
| 1116 | @kindex w | 1116 | @kindex w @r{(Dired)} |
| 1117 | @findex dired-copy-filename-as-kill | 1117 | @findex dired-copy-filename-as-kill |
| 1118 | The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the | 1118 | The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the |
| 1119 | names of the marked (or next @var{n}) files into the kill ring, as if | 1119 | names of the marked (or next @var{n}) files into the kill ring, as if |
diff --git a/man/gnus-faq.texi b/man/gnus-faq.texi index 5d243f8a02e..280280a401e 100644 --- a/man/gnus-faq.texi +++ b/man/gnus-faq.texi | |||
| @@ -1414,7 +1414,7 @@ Answer: | |||
| 1414 | message. For a follow up to a newsgroup, it's | 1414 | message. For a follow up to a newsgroup, it's |
| 1415 | @samp{f} and @samp{F} | 1415 | @samp{f} and @samp{F} |
| 1416 | (analog to @samp{r} and | 1416 | (analog to @samp{r} and |
| 1417 | @samp{R}. | 1417 | @samp{R}). |
| 1418 | 1418 | ||
| 1419 | 1419 | ||
| 1420 | Enter new headers above the line saying "--text follows | 1420 | Enter new headers above the line saying "--text follows |
diff --git a/man/gnus.texi b/man/gnus.texi index 50d7bd16de8..b0feef1bf25 100644 --- a/man/gnus.texi +++ b/man/gnus.texi | |||
| @@ -22603,6 +22603,7 @@ filters new mail, and it analyzes mail known to be spam or ham. | |||
| 22603 | @dfn{Ham} is the name used throughout @file{spam.el} to indicate | 22603 | @dfn{Ham} is the name used throughout @file{spam.el} to indicate |
| 22604 | non-spam messages. | 22604 | non-spam messages. |
| 22605 | 22605 | ||
| 22606 | @cindex spam-initialize | ||
| 22606 | First of all, you @strong{must} run the function | 22607 | First of all, you @strong{must} run the function |
| 22607 | @code{spam-initialize} to autoload @code{spam.el} and to install the | 22608 | @code{spam-initialize} to autoload @code{spam.el} and to install the |
| 22608 | @code{spam.el} hooks. There is one exception: if you use the | 22609 | @code{spam.el} hooks. There is one exception: if you use the |
diff --git a/man/makefile.w32-in b/man/makefile.w32-in index 241d50be956..d89c77ab5d9 100644 --- a/man/makefile.w32-in +++ b/man/makefile.w32-in | |||
| @@ -47,14 +47,15 @@ INFO_TARGETS = $(infodir)/emacs $(infodir)/ccmode \ | |||
| 47 | $(infodir)/speedbar $(infodir)/tramp \ | 47 | $(infodir)/speedbar $(infodir)/tramp \ |
| 48 | $(infodir)/ses $(infodir)/smtpmail \ | 48 | $(infodir)/ses $(infodir)/smtpmail \ |
| 49 | $(infodir)/flymake $(infodir)/emacs-xtra \ | 49 | $(infodir)/flymake $(infodir)/emacs-xtra \ |
| 50 | $(infodir)/org $(infodir)/url \ | ||
| 50 | $(infodir)/pgg $(infodir)/sieve | 51 | $(infodir)/pgg $(infodir)/sieve |
| 51 | DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ | 52 | DVI_TARGETS = emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \ |
| 52 | ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \ | 53 | ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \ |
| 53 | reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ | 54 | reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \ |
| 54 | ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ | 55 | ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \ |
| 55 | pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ | 56 | org.dvi pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \ |
| 56 | speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \ | 57 | speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \ |
| 57 | emacs-xtra.dvi pgg.dvi sieve.dvi | 58 | emacs-xtra.dvi pgg.dvi sieve.dvi url.dvi |
| 58 | INFOSOURCES = info.texi | 59 | INFOSOURCES = info.texi |
| 59 | 60 | ||
| 60 | # The following rule does not work with all versions of `make'. | 61 | # The following rule does not work with all versions of `make'. |
| @@ -318,6 +319,18 @@ $(infodir)/emacs-xtra: emacs-xtra.texi | |||
| 318 | emacs-xtra.dvi: emacs-xtra.texi | 319 | emacs-xtra.dvi: emacs-xtra.texi |
| 319 | $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi | 320 | $(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi |
| 320 | 321 | ||
| 322 | $(infodir)/org: org.texi | ||
| 323 | $(MAKEINFO) org.texi | ||
| 324 | |||
| 325 | org.dvi: org.texi | ||
| 326 | $(ENVADD) $(TEXI2DVI) $(srcdir)/org.texi | ||
| 327 | |||
| 328 | $(infodir)/url: url.texi | ||
| 329 | $(MAKEINFO) url.texi | ||
| 330 | |||
| 331 | url.dvi: url.texi | ||
| 332 | $(ENVADD) $(TEXI2DVI) $(srcdir)/url.texi | ||
| 333 | |||
| 321 | mostlyclean: | 334 | mostlyclean: |
| 322 | - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.* | 335 | - $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.* |
| 323 | 336 | ||
| @@ -337,6 +350,7 @@ clean: mostlyclean | |||
| 337 | $(infodir)/woman* $(infodir)/eshell* \ | 350 | $(infodir)/woman* $(infodir)/eshell* \ |
| 338 | $(infodir)/speedbar* $(infodir)/tramp* \ | 351 | $(infodir)/speedbar* $(infodir)/tramp* \ |
| 339 | $(infodir)/ses* $(infodir)/smtpmail* \ | 352 | $(infodir)/ses* $(infodir)/smtpmail* \ |
| 353 | $(infodir)/url* $(infodir)/org* \ | ||
| 340 | $(infodir)/flymake* | 354 | $(infodir)/flymake* |
| 341 | 355 | ||
| 342 | distclean: clean | 356 | distclean: clean |
diff --git a/man/mark.texi b/man/mark.texi index b4154f9c3ae..4f1c8a6d4d9 100644 --- a/man/mark.texi +++ b/man/mark.texi | |||
| @@ -320,6 +320,8 @@ next balanced expression (@pxref{Expressions}). These commands handle | |||
| 320 | arguments just like @kbd{M-f} and @kbd{C-M-f}. If you repeat these | 320 | arguments just like @kbd{M-f} and @kbd{C-M-f}. If you repeat these |
| 321 | commands, the region is extended. For example, you can type either | 321 | commands, the region is extended. For example, you can type either |
| 322 | @kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words. | 322 | @kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words. |
| 323 | The region is also extended when the mark is active in Transient Mark | ||
| 324 | mode, regardless of the last command. | ||
| 323 | 325 | ||
| 324 | @kindex C-x h | 326 | @kindex C-x h |
| 325 | @findex mark-whole-buffer | 327 | @findex mark-whole-buffer |
diff --git a/man/misc.texi b/man/misc.texi index 2adef51b8ce..e4b2806c673 100644 --- a/man/misc.texi +++ b/man/misc.texi | |||
| @@ -2219,7 +2219,7 @@ which has a similar feature of its own. | |||
| 2219 | @subsection Finding Files and URLs at Point | 2219 | @subsection Finding Files and URLs at Point |
| 2220 | @findex find-file-at-point | 2220 | @findex find-file-at-point |
| 2221 | @findex ffap | 2221 | @findex ffap |
| 2222 | @findex ffap-dired-at-point | 2222 | @findex dired-at-point |
| 2223 | @findex ffap-next | 2223 | @findex ffap-next |
| 2224 | @findex ffap-menu | 2224 | @findex ffap-menu |
| 2225 | @cindex finding file at point | 2225 | @cindex finding file at point |
| @@ -2248,18 +2248,36 @@ make the following key bindings and to install hooks for using | |||
| 2248 | @kindex C-x C-f @r{(FFAP)} | 2248 | @kindex C-x C-f @r{(FFAP)} |
| 2249 | Find @var{filename}, guessing a default from text around point | 2249 | Find @var{filename}, guessing a default from text around point |
| 2250 | (@code{find-file-at-point}). | 2250 | (@code{find-file-at-point}). |
| 2251 | @item C-x C-r | ||
| 2252 | @kindex C-x C-r @r{(FFAP)} | ||
| 2253 | @code{ffap-read-only}, analogous to @code{find-file-read-only}. | ||
| 2254 | @item C-x C-v | ||
| 2255 | @kindex C-x C-v @r{(FFAP)} | ||
| 2256 | @code{ffap-alternate-file}, analogous to @code{find-alternate-file}. | ||
| 2257 | @item C-x d @var{directory} @key{RET} | ||
| 2258 | @kindex C-x d @r{(FFAP)} | ||
| 2259 | Start Dired on @var{directory}, defaulting to the directory name at | ||
| 2260 | point (@code{dired-at-point}). | ||
| 2261 | @item C-x C-d | ||
| 2262 | @code{ffap-list-directory}, analogous to @code{list-directory}. | ||
| 2251 | @item C-x 4 f | 2263 | @item C-x 4 f |
| 2252 | @kindex C-x 4 f @r{(FFAP)} | 2264 | @kindex C-x 4 f @r{(FFAP)} |
| 2253 | @code{ffap-other-window}, analogous to @code{find-file-other-window}. | 2265 | @code{ffap-other-window}, analogous to @code{find-file-other-window}. |
| 2266 | @item C-x 4 r | ||
| 2267 | @code{ffap-read-only-other-window}, analogous to | ||
| 2268 | @code{find-file-read-only-other-window}. | ||
| 2269 | @item C-x 4 d | ||
| 2270 | @code{ffap-dired-other-window}, analogous to @code{dired-other-window}. | ||
| 2254 | @item C-x 5 f | 2271 | @item C-x 5 f |
| 2255 | @kindex C-x 5 f @r{(FFAP)} | 2272 | @kindex C-x 5 f @r{(FFAP)} |
| 2256 | @code{ffap-other-frame}, analogous to @code{find-file-other-frame}. | 2273 | @code{ffap-other-frame}, analogous to @code{find-file-other-frame}. |
| 2274 | @item C-x 5 r | ||
| 2275 | @code{ffap-read-only-other-frame}, analogous to | ||
| 2276 | @code{find-file-read-only-other-frame}. | ||
| 2277 | @item C-x 5 d | ||
| 2278 | @code{ffap-dired-other-frame}, analogous to @code{dired-other-frame}. | ||
| 2257 | @item M-x ffap-next | 2279 | @item M-x ffap-next |
| 2258 | Search buffer for next file name or URL, then find that file or URL. | 2280 | Search buffer for next file name or URL, then find that file or URL. |
| 2259 | @item C-x d @var{directory} @key{RET} | ||
| 2260 | @kindex C-x d @r{(FFAP)} | ||
| 2261 | Start Dired on @var{directory}, defaulting to the directory name at | ||
| 2262 | point (@code{ffap-dired-at-point}). | ||
| 2263 | @item S-Mouse-3 | 2281 | @item S-Mouse-3 |
| 2264 | @kindex S-Mouse-3 @r{(FFAP)} | 2282 | @kindex S-Mouse-3 @r{(FFAP)} |
| 2265 | @code{ffap-at-mouse} finds the file guessed from text around the position | 2283 | @code{ffap-at-mouse} finds the file guessed from text around the position |
diff --git a/man/org.texi b/man/org.texi index 319c3bd8f44..c35784e2580 100644 --- a/man/org.texi +++ b/man/org.texi | |||
| @@ -8,7 +8,7 @@ | |||
| 8 | 8 | ||
| 9 | @dircategory Emacs | 9 | @dircategory Emacs |
| 10 | @direntry | 10 | @direntry |
| 11 | * Org Mode: (org.info). Outline-based notes management and organizer | 11 | * Org Mode: (org). Outline-based notes management and organizer |
| 12 | @end direntry | 12 | @end direntry |
| 13 | 13 | ||
| 14 | @c Version and Contact Info | 14 | @c Version and Contact Info |
diff --git a/man/reftex.texi b/man/reftex.texi index c40dda36a2f..9ce77b35dc2 100644 --- a/man/reftex.texi +++ b/man/reftex.texi | |||
| @@ -3371,12 +3371,12 @@ With @i{Viper} mode prior to Vipers version 3.01, you need to protect | |||
| 3371 | @cindex @code{http}, @b{Ref@TeX{}} home page | 3371 | @cindex @code{http}, @b{Ref@TeX{}} home page |
| 3372 | @cindex @code{ftp}, @b{Ref@TeX{}} site | 3372 | @cindex @code{ftp}, @b{Ref@TeX{}} site |
| 3373 | 3373 | ||
| 3374 | @b{Ref@TeX{}} was written by @i{@value{Carsten Dominik}} | 3374 | @b{Ref@TeX{}} was written by @i{Carsten Dominik} |
| 3375 | @email{dominik@@science.uva.nl}, with contributions by @i{Stephen | 3375 | @email{dominik@@science.uva.nl}, with contributions by @i{Stephen |
| 3376 | Eglen}. @b{Ref@TeX{}} is currently maintained by @refill | 3376 | Eglen}. @b{Ref@TeX{}} is currently maintained by @refill |
| 3377 | 3377 | ||
| 3378 | @noindent | 3378 | @noindent |
| 3379 | @value{Carsten Dominik} @email{dominik@@science.uva.nl} | 3379 | Carsten Dominik @email{dominik@@science.uva.nl} |
| 3380 | 3380 | ||
| 3381 | If you have questions about @b{Ref@TeX{}}, there are several Usenet | 3381 | If you have questions about @b{Ref@TeX{}}, there are several Usenet |
| 3382 | groups which have competent readers: @code{comp.emacs}, | 3382 | groups which have competent readers: @code{comp.emacs}, |
diff --git a/man/url.texi b/man/url.texi index ec9c973b33d..5f36826d926 100644 --- a/man/url.texi +++ b/man/url.texi | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | \input texinfo | 1 | \input texinfo |
| 2 | @setfilename url.info | 2 | @setfilename ../info/url |
| 3 | @settitle URL Programmer's Manual | 3 | @settitle URL Programmer's Manual |
| 4 | 4 | ||
| 5 | @iftex | 5 | @iftex |
| @@ -114,10 +114,6 @@ sent).@c , but @xref{Other Variables, url-bad-port-list}. | |||
| 114 | The meaning of | 114 | The meaning of |
| 115 | the @var{path} component depends on the service. | 115 | the @var{path} component depends on the service. |
| 116 | 116 | ||
| 117 | The library depends on MIME support provided by the @samp{mm-} | ||
| 118 | packages from Gnus 5.8 or later. @xref{(emacs-mime)Top, The MIME | ||
| 119 | library}. | ||
| 120 | |||
| 121 | @menu | 117 | @menu |
| 122 | * Configuration:: | 118 | * Configuration:: |
| 123 | * Parsed URLs:: URLs are parsed into vector structures. | 119 | * Parsed URLs:: URLs are parsed into vector structures. |
| @@ -388,9 +384,9 @@ Currently this is just the raw header contents. | |||
| 388 | 384 | ||
| 389 | HTTP URLs are retrieved into a buffer containing the HTTP headers | 385 | HTTP URLs are retrieved into a buffer containing the HTTP headers |
| 390 | followed by the body. Since the headers are quasi-MIME, they may be | 386 | followed by the body. Since the headers are quasi-MIME, they may be |
| 391 | processed using the MIME library. @xref{(emacs-mime)Top, The MIME | 387 | processed using the MIME library. @inforef{Top, The MIME library, |
| 392 | library}. The MIME library doesn't provide a clean function to do | 388 | emacs-mime}. The URL package provides a function to do this in |
| 393 | that, so the URL library does. | 389 | general: |
| 394 | 390 | ||
| 395 | @defun url-decode-text-part handle &optional coding | 391 | @defun url-decode-text-part handle &optional coding |
| 396 | This function decodes charset-encoded text in the current buffer. In | 392 | This function decodes charset-encoded text in the current buffer. In |
diff --git a/src/ChangeLog b/src/ChangeLog index 45a69442444..a2706547e77 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,10 +1,76 @@ | |||
| 1 | 2004-12-13 Richard M. Stallman <rms@gnu.org> | ||
| 2 | |||
| 3 | * eval.c (syms_of_eval) <quit-flag>: Doc fix. | ||
| 4 | |||
| 5 | * keyboard.c (Vthrow_on_input): New variable. | ||
| 6 | (syms_of_keyboard): Defvar and initialize it. | ||
| 7 | (kbd_buffer_store_event_hold): Handle Vthrow_on_input. | ||
| 8 | |||
| 9 | * lisp.h (QUIT): Check for Vthrow_on_input. | ||
| 10 | (Vthrow_on_input): Declare it. | ||
| 11 | |||
| 12 | 2004-12-13 Kim F. Storm <storm@cua.dk> | ||
| 13 | |||
| 14 | * xdisp.c (set_iterator_to_next): Reset stop_charpos after display | ||
| 15 | vector. | ||
| 16 | |||
| 17 | 2004-12-12 Richard M. Stallman <rms@gnu.org> | ||
| 18 | |||
| 19 | * indent.c (Fvertical_motion): Call move_it_by_lines even if LINES = 0. | ||
| 20 | |||
| 21 | * minibuf.c (Fall_completions): Add var `zero' and use it in loop. | ||
| 22 | (Ftry_completion): Really use outer `zero'; eliminate inner one. | ||
| 23 | |||
| 24 | 2004-12-12 Kenichi Handa <handa@m17n.org> | ||
| 25 | |||
| 26 | * term.c (encode_terminal_code): Fix previous change. | ||
| 27 | |||
| 28 | 2004-12-11 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 29 | |||
| 30 | * keyboard.c (handle_async_input): Remove pthread mutex handling. | ||
| 31 | (input_available_signal): Move pthread thingy to !SYNC_INPUT branch. | ||
| 32 | |||
| 33 | * syntax.c (Fforward_word): Avoid non-idempotent side-effects | ||
| 34 | in macro arguments. | ||
| 35 | |||
| 36 | * minibuf.c (Ftry_completion, Fall_completions): Don't use | ||
| 37 | XFASTINT blindly. | ||
| 38 | |||
| 39 | * emacs.c (main, Fdump_emacs): Don't touch malloc hooks if SYNC_INPUT. | ||
| 40 | |||
| 41 | 2004-12-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 42 | |||
| 43 | * w32term.c (x_calc_absolute_position): Remove calculation of | ||
| 44 | difference between inner and outer window. Don't subtract difference | ||
| 45 | for left and top calculations. | ||
| 46 | |||
| 47 | * xterm.c (x_calc_absolute_position): Don't subtract outer_pixel_diff | ||
| 48 | for left and top calculations. Remove call to x_real_positions. | ||
| 49 | [Bug report by Drew Adams in November] | ||
| 50 | (x_check_expected_move): Do not set change_gravity to 1 when calling | ||
| 51 | x_set_offset. | ||
| 52 | |||
| 53 | 2004-12-08 Richard M. Stallman <rms@gnu.org> | ||
| 54 | |||
| 55 | * xdisp.c (get_next_display_element): Use `escape-glyph' for | ||
| 56 | control chars and escaped octal codes. | ||
| 57 | (Qescape_glyph): New variable. | ||
| 58 | (syms_of_xdisp): Initialize it. | ||
| 59 | (escape_glyph_face): New variable. | ||
| 60 | (redisplay_window): Initialize it. | ||
| 61 | |||
| 62 | 2004-12-07 Paul Eggert <eggert@cs.ucla.edu> | ||
| 63 | |||
| 64 | * image.c (our_fill_input_buffer, jpeg_load, CHECK_LIB_AVAILABLE) | ||
| 65 | (init_image): Use 1 rather than TRUE. TRUE's not always defined. | ||
| 66 | |||
| 1 | 2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 67 | 2004-12-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 68 | ||
| 3 | * emacs.c (Fdump_emacs): Add ! defined (SYSTEM_MALLOC) around | 69 | * emacs.c (Fdump_emacs): Add ! defined (SYSTEM_MALLOC) around |
| 4 | reset_malloc_hooks. | 70 | reset_malloc_hooks. |
| 5 | 71 | ||
| 6 | * keyboard.c (handle_async_input, input_available_signal): Add | 72 | * keyboard.c (handle_async_input, input_available_signal): |
| 7 | ! defined (SYSTEM_MALLOC) around thread code. | 73 | Add ! defined (SYSTEM_MALLOC) around thread code. |
| 8 | 74 | ||
| 9 | * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC. | 75 | * alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC. |
| 10 | 76 | ||
| @@ -42,12 +108,11 @@ | |||
| 42 | * emacs.c (Fdump_emacs): Call reset_malloc_hooks. | 108 | * emacs.c (Fdump_emacs): Call reset_malloc_hooks. |
| 43 | 109 | ||
| 44 | * keyboard.c: Conditionally include pthread.h | 110 | * keyboard.c: Conditionally include pthread.h |
| 45 | (handle_async_inpu, input_available_signalt): If not in the main | 111 | (handle_async_input, input_available_signalt): If not in the main |
| 46 | thread, block signal, send signal to main thread and return. | 112 | thread, block signal, send signal to main thread and return. |
| 47 | 113 | ||
| 48 | * gtkutil.c (xg_get_file_with_chooser): Handle local files only. | 114 | * gtkutil.c (xg_get_file_with_chooser): Handle local files only. |
| 49 | Set current folder in file chooser if default_filename is a | 115 | Set current folder in file chooser if default_filename is a directory. |
| 50 | directory. | ||
| 51 | 116 | ||
| 52 | 2004-12-05 Stefan Monnier <monnier@iro.umontreal.ca> | 117 | 2004-12-05 Stefan Monnier <monnier@iro.umontreal.ca> |
| 53 | 118 | ||
diff --git a/src/emacs.c b/src/emacs.c index 03f20b9e97b..02031fe9072 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1023,8 +1023,10 @@ main (argc, argv | |||
| 1023 | Also call realloc and free for consistency. */ | 1023 | Also call realloc and free for consistency. */ |
| 1024 | free (realloc (malloc (4), 4)); | 1024 | free (realloc (malloc (4), 4)); |
| 1025 | 1025 | ||
| 1026 | # ifndef SYNC_INPUT | ||
| 1026 | /* Arrange to disable interrupt input inside malloc etc. */ | 1027 | /* Arrange to disable interrupt input inside malloc etc. */ |
| 1027 | uninterrupt_malloc (); | 1028 | uninterrupt_malloc (); |
| 1029 | # endif /* not SYNC_INPUT */ | ||
| 1028 | #endif /* not SYSTEM_MALLOC */ | 1030 | #endif /* not SYSTEM_MALLOC */ |
| 1029 | 1031 | ||
| 1030 | #if defined (MSDOS) || defined (WINDOWSNT) | 1032 | #if defined (MSDOS) || defined (WINDOWSNT) |
| @@ -2246,7 +2248,7 @@ You must run Emacs in batch mode in order to dump it. */) | |||
| 2246 | memory_warnings (my_edata, malloc_warning); | 2248 | memory_warnings (my_edata, malloc_warning); |
| 2247 | #endif /* not WINDOWSNT */ | 2249 | #endif /* not WINDOWSNT */ |
| 2248 | #endif | 2250 | #endif |
| 2249 | #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | 2251 | #if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) && !defined SYNC_INPUT |
| 2250 | /* Pthread may call malloc before main, and then we will get an endless | 2252 | /* Pthread may call malloc before main, and then we will get an endless |
| 2251 | loop, because pthread_self (see alloc.c) calls malloc the first time | 2253 | loop, because pthread_self (see alloc.c) calls malloc the first time |
| 2252 | it is called on some systems. */ | 2254 | it is called on some systems. */ |
diff --git a/src/eval.c b/src/eval.c index 0eb519fbfca..879f916aa46 100644 --- a/src/eval.c +++ b/src/eval.c | |||
| @@ -3331,7 +3331,11 @@ Emacs could overflow the real C stack, and crash. */); | |||
| 3331 | 3331 | ||
| 3332 | DEFVAR_LISP ("quit-flag", &Vquit_flag, | 3332 | DEFVAR_LISP ("quit-flag", &Vquit_flag, |
| 3333 | doc: /* Non-nil causes `eval' to abort, unless `inhibit-quit' is non-nil. | 3333 | doc: /* Non-nil causes `eval' to abort, unless `inhibit-quit' is non-nil. |
| 3334 | Typing C-g sets `quit-flag' non-nil, regardless of `inhibit-quit'. */); | 3334 | If the value is t, that means do an ordinary quit. |
| 3335 | If the value equals `throw-on-input', that means quit by throwing | ||
| 3336 | to the tag specified in `throw-on-input'; it's for handling `while-no-input'. | ||
| 3337 | Typing C-g sets `quit-flag' to t, regardless of `inhibit-quit', | ||
| 3338 | but `inhibit-quit' non-nil prevents anything from taking notice of that. */); | ||
| 3335 | Vquit_flag = Qnil; | 3339 | Vquit_flag = Qnil; |
| 3336 | 3340 | ||
| 3337 | DEFVAR_LISP ("inhibit-quit", &Vinhibit_quit, | 3341 | DEFVAR_LISP ("inhibit-quit", &Vinhibit_quit, |
diff --git a/src/image.c b/src/image.c index d1925cf36e4..18ffc2db3a4 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -6378,7 +6378,7 @@ our_fill_input_buffer (cinfo) | |||
| 6378 | 6378 | ||
| 6379 | src->next_input_byte = buffer; | 6379 | src->next_input_byte = buffer; |
| 6380 | src->bytes_in_buffer = 2; | 6380 | src->bytes_in_buffer = 2; |
| 6381 | return TRUE; | 6381 | return 1; |
| 6382 | } | 6382 | } |
| 6383 | 6383 | ||
| 6384 | 6384 | ||
| @@ -6533,11 +6533,11 @@ jpeg_load (f, img) | |||
| 6533 | jpeg_memory_src (&cinfo, SDATA (specified_data), | 6533 | jpeg_memory_src (&cinfo, SDATA (specified_data), |
| 6534 | SBYTES (specified_data)); | 6534 | SBYTES (specified_data)); |
| 6535 | 6535 | ||
| 6536 | fn_jpeg_read_header (&cinfo, TRUE); | 6536 | fn_jpeg_read_header (&cinfo, 1); |
| 6537 | 6537 | ||
| 6538 | /* Customize decompression so that color quantization will be used. | 6538 | /* Customize decompression so that color quantization will be used. |
| 6539 | Start decompression. */ | 6539 | Start decompression. */ |
| 6540 | cinfo.quantize_colors = TRUE; | 6540 | cinfo.quantize_colors = 1; |
| 6541 | fn_jpeg_start_decompress (&cinfo); | 6541 | fn_jpeg_start_decompress (&cinfo); |
| 6542 | width = img->width = cinfo.output_width; | 6542 | width = img->width = cinfo.output_width; |
| 6543 | height = img->height = cinfo.output_height; | 6543 | height = img->height = cinfo.output_height; |
| @@ -7552,7 +7552,7 @@ gif_load (f, img) | |||
| 7552 | bg_color.blue = color.blue; | 7552 | bg_color.blue = color.blue; |
| 7553 | RGBBackColor (&bg_color); | 7553 | RGBBackColor (&bg_color); |
| 7554 | SetGWorld (old_port, old_gdh); | 7554 | SetGWorld (old_port, old_gdh); |
| 7555 | SetMovieActive (movie, TRUE); | 7555 | SetMovieActive (movie, 1); |
| 7556 | SetMovieGWorld (movie, ximg, NULL); | 7556 | SetMovieGWorld (movie, ximg, NULL); |
| 7557 | SampleNumToMediaTime (media, ino + 1, &time, NULL); | 7557 | SampleNumToMediaTime (media, ino + 1, &time, NULL); |
| 7558 | SetMovieTimeValue (movie, time); | 7558 | SetMovieTimeValue (movie, time); |
| @@ -7930,7 +7930,7 @@ DEFUN ("lookup-image", Flookup_image, Slookup_image, 1, 1, 0, "") | |||
| 7930 | define_image_type (image_type, init_lib_fn (libraries)) | 7930 | define_image_type (image_type, init_lib_fn (libraries)) |
| 7931 | #else | 7931 | #else |
| 7932 | #define CHECK_LIB_AVAILABLE(image_type, init_lib_fn, libraries) \ | 7932 | #define CHECK_LIB_AVAILABLE(image_type, init_lib_fn, libraries) \ |
| 7933 | define_image_type (image_type, TRUE) | 7933 | define_image_type (image_type, 1) |
| 7934 | #endif /* HAVE_NTGUI */ | 7934 | #endif /* HAVE_NTGUI */ |
| 7935 | 7935 | ||
| 7936 | DEFUN ("init-image-library", Finit_image_library, Sinit_image_library, 2, 2, 0, | 7936 | DEFUN ("init-image-library", Finit_image_library, Sinit_image_library, 2, 2, 0, |
| @@ -8114,8 +8114,8 @@ init_image () | |||
| 8114 | { | 8114 | { |
| 8115 | image_types = NULL; | 8115 | image_types = NULL; |
| 8116 | 8116 | ||
| 8117 | define_image_type (&xbm_type, TRUE); | 8117 | define_image_type (&xbm_type, 1); |
| 8118 | define_image_type (&pbm_type, TRUE); | 8118 | define_image_type (&pbm_type, 1); |
| 8119 | 8119 | ||
| 8120 | #ifdef MAC_OS | 8120 | #ifdef MAC_OS |
| 8121 | /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */ | 8121 | /* Animated gifs use QuickTime Movie Toolbox. So initialize it here. */ |
diff --git a/src/indent.c b/src/indent.c index b573c53e666..24645b104cf 100644 --- a/src/indent.c +++ b/src/indent.c | |||
| @@ -2092,8 +2092,9 @@ whether or not it is currently displayed in some window. */) | |||
| 2092 | move_it_by_lines (&it, -1, 0); | 2092 | move_it_by_lines (&it, -1, 0); |
| 2093 | 2093 | ||
| 2094 | it.vpos = 0; | 2094 | it.vpos = 0; |
| 2095 | if (XINT (lines) != 0) | 2095 | /* Do this even if LINES is 0, so that we move back |
| 2096 | move_it_by_lines (&it, XINT (lines), 0); | 2096 | to the beginning of the current line as we ought. */ |
| 2097 | move_it_by_lines (&it, XINT (lines), 0); | ||
| 2097 | 2098 | ||
| 2098 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); | 2099 | SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it)); |
| 2099 | } | 2100 | } |
diff --git a/src/keyboard.c b/src/keyboard.c index c77c53790b1..6ed15f232d1 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -6779,24 +6779,6 @@ handle_async_input () | |||
| 6779 | #ifdef BSD4_1 | 6779 | #ifdef BSD4_1 |
| 6780 | extern int select_alarmed; | 6780 | extern int select_alarmed; |
| 6781 | #endif | 6781 | #endif |
| 6782 | #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | ||
| 6783 | extern pthread_t main_thread; | ||
| 6784 | if (pthread_self () != main_thread) | ||
| 6785 | { | ||
| 6786 | /* POSIX says any thread can receive the signal. On GNU/Linux that is | ||
| 6787 | not true, but for other systems (FreeBSD at least) it is. So direct | ||
| 6788 | the signal to the correct thread and block it from this thread. */ | ||
| 6789 | #ifdef SIGIO | ||
| 6790 | sigset_t new_mask; | ||
| 6791 | |||
| 6792 | sigemptyset (&new_mask); | ||
| 6793 | sigaddset (&new_mask, SIGIO); | ||
| 6794 | pthread_sigmask (SIG_BLOCK, &new_mask, 0); | ||
| 6795 | pthread_kill (main_thread, SIGIO); | ||
| 6796 | #endif | ||
| 6797 | return; | ||
| 6798 | } | ||
| 6799 | #endif | ||
| 6800 | 6782 | ||
| 6801 | interrupt_input_pending = 0; | 6783 | interrupt_input_pending = 0; |
| 6802 | 6784 | ||
| @@ -6825,22 +6807,6 @@ input_available_signal (signo) | |||
| 6825 | { | 6807 | { |
| 6826 | /* Must preserve main program's value of errno. */ | 6808 | /* Must preserve main program's value of errno. */ |
| 6827 | int old_errno = errno; | 6809 | int old_errno = errno; |
| 6828 | #if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | ||
| 6829 | extern pthread_t main_thread; | ||
| 6830 | if (pthread_self () != main_thread) | ||
| 6831 | { | ||
| 6832 | /* POSIX says any thread can receive the signal. On GNU/Linux that is | ||
| 6833 | not true, but for other systems (FreeBSD at least) it is. So direct | ||
| 6834 | the signal to the correct thread and block it from this thread. */ | ||
| 6835 | sigset_t new_mask; | ||
| 6836 | |||
| 6837 | sigemptyset (&new_mask); | ||
| 6838 | sigaddset (&new_mask, SIGIO); | ||
| 6839 | pthread_sigmask (SIG_BLOCK, &new_mask, 0); | ||
| 6840 | pthread_kill (main_thread, SIGIO); | ||
| 6841 | return; | ||
| 6842 | } | ||
| 6843 | #endif /* HAVE_GTK_AND_PTHREAD */ | ||
| 6844 | #if defined (USG) && !defined (POSIX_SIGNALS) | 6810 | #if defined (USG) && !defined (POSIX_SIGNALS) |
| 6845 | /* USG systems forget handlers when they are used; | 6811 | /* USG systems forget handlers when they are used; |
| 6846 | must reestablish each time */ | 6812 | must reestablish each time */ |
| @@ -6857,6 +6823,24 @@ input_available_signal (signo) | |||
| 6857 | #ifdef SYNC_INPUT | 6823 | #ifdef SYNC_INPUT |
| 6858 | interrupt_input_pending = 1; | 6824 | interrupt_input_pending = 1; |
| 6859 | #else | 6825 | #else |
| 6826 | |||
| 6827 | # if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) | ||
| 6828 | extern pthread_t main_thread; | ||
| 6829 | if (pthread_self () != main_thread) | ||
| 6830 | { | ||
| 6831 | /* POSIX says any thread can receive the signal. On GNU/Linux that is | ||
| 6832 | not true, but for other systems (FreeBSD at least) it is. So direct | ||
| 6833 | the signal to the correct thread and block it from this thread. */ | ||
| 6834 | sigset_t new_mask; | ||
| 6835 | |||
| 6836 | sigemptyset (&new_mask); | ||
| 6837 | sigaddset (&new_mask, SIGIO); | ||
| 6838 | pthread_sigmask (SIG_BLOCK, &new_mask, 0); | ||
| 6839 | pthread_kill (main_thread, SIGIO); | ||
| 6840 | return; | ||
| 6841 | } | ||
| 6842 | # endif /* HAVE_GTK_AND_PTHREAD */ | ||
| 6843 | |||
| 6860 | handle_async_input (); | 6844 | handle_async_input (); |
| 6861 | #endif | 6845 | #endif |
| 6862 | 6846 | ||
diff --git a/src/lisp.h b/src/lisp.h index 47eb7604b41..3f49ac546cc 100644 --- a/src/lisp.h +++ b/src/lisp.h | |||
| @@ -1786,11 +1786,15 @@ extern char *stack_bottom; | |||
| 1786 | #ifdef SYNC_INPUT | 1786 | #ifdef SYNC_INPUT |
| 1787 | extern void handle_async_input P_ ((void)); | 1787 | extern void handle_async_input P_ ((void)); |
| 1788 | extern int interrupt_input_pending; | 1788 | extern int interrupt_input_pending; |
| 1789 | |||
| 1789 | #define QUIT \ | 1790 | #define QUIT \ |
| 1790 | do { \ | 1791 | do { \ |
| 1791 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ | 1792 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ |
| 1792 | { \ | 1793 | { \ |
| 1794 | Lisp_Object flag = Vquit_flag; \ | ||
| 1793 | Vquit_flag = Qnil; \ | 1795 | Vquit_flag = Qnil; \ |
| 1796 | if (EQ (Vthrow_on_input, flag)) \ | ||
| 1797 | Fthrow (Vthrow_on_input, Qnil); \ | ||
| 1794 | Fsignal (Qquit, Qnil); \ | 1798 | Fsignal (Qquit, Qnil); \ |
| 1795 | } \ | 1799 | } \ |
| 1796 | else if (interrupt_input_pending) \ | 1800 | else if (interrupt_input_pending) \ |
| @@ -1803,7 +1807,10 @@ extern int interrupt_input_pending; | |||
| 1803 | do { \ | 1807 | do { \ |
| 1804 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ | 1808 | if (!NILP (Vquit_flag) && NILP (Vinhibit_quit)) \ |
| 1805 | { \ | 1809 | { \ |
| 1810 | Lisp_Object flag = Vquit_flag; \ | ||
| 1806 | Vquit_flag = Qnil; \ | 1811 | Vquit_flag = Qnil; \ |
| 1812 | if (EQ (Vthrow_on_input, flag)) \ | ||
| 1813 | Fthrow (Vthrow_on_input, Qnil); \ | ||
| 1807 | Fsignal (Qquit, Qnil); \ | 1814 | Fsignal (Qquit, Qnil); \ |
| 1808 | } \ | 1815 | } \ |
| 1809 | } while (0) | 1816 | } while (0) |
| @@ -2917,6 +2924,7 @@ extern struct kboard *echo_kboard; | |||
| 2917 | extern void cancel_echoing P_ ((void)); | 2924 | extern void cancel_echoing P_ ((void)); |
| 2918 | extern Lisp_Object Qdisabled, QCfilter; | 2925 | extern Lisp_Object Qdisabled, QCfilter; |
| 2919 | extern Lisp_Object Vtty_erase_char, Vhelp_form, Vtop_level; | 2926 | extern Lisp_Object Vtty_erase_char, Vhelp_form, Vtop_level; |
| 2927 | extern Lisp_Object Vthrow_on_input; | ||
| 2920 | extern int input_pending; | 2928 | extern int input_pending; |
| 2921 | EXFUN (Fdiscard_input, 0); | 2929 | EXFUN (Fdiscard_input, 0); |
| 2922 | EXFUN (Frecursive_edit, 0); | 2930 | EXFUN (Frecursive_edit, 0); |
diff --git a/src/minibuf.c b/src/minibuf.c index 109b1fc1df0..e1939339ce8 100644 --- a/src/minibuf.c +++ b/src/minibuf.c | |||
| @@ -1227,6 +1227,7 @@ is used to further constrain the set of candidates. */) | |||
| 1227 | return call3 (alist, string, predicate, Qnil); | 1227 | return call3 (alist, string, predicate, Qnil); |
| 1228 | 1228 | ||
| 1229 | bestmatch = bucket = Qnil; | 1229 | bestmatch = bucket = Qnil; |
| 1230 | zero = make_number (0); | ||
| 1230 | 1231 | ||
| 1231 | /* If ALIST is not a list, set TAIL just for gc pro. */ | 1232 | /* If ALIST is not a list, set TAIL just for gc pro. */ |
| 1232 | tail = alist; | 1233 | tail = alist; |
| @@ -1253,7 +1254,7 @@ is used to further constrain the set of candidates. */) | |||
| 1253 | } | 1254 | } |
| 1254 | else if (type == 2) | 1255 | else if (type == 2) |
| 1255 | { | 1256 | { |
| 1256 | if (XFASTINT (bucket) != 0) | 1257 | if (!EQ (bucket, zero)) |
| 1257 | { | 1258 | { |
| 1258 | elt = bucket; | 1259 | elt = bucket; |
| 1259 | eltstring = Fsymbol_name (elt); | 1260 | eltstring = Fsymbol_name (elt); |
| @@ -1285,16 +1286,14 @@ is used to further constrain the set of candidates. */) | |||
| 1285 | 1286 | ||
| 1286 | if (STRINGP (eltstring) | 1287 | if (STRINGP (eltstring) |
| 1287 | && SCHARS (string) <= SCHARS (eltstring) | 1288 | && SCHARS (string) <= SCHARS (eltstring) |
| 1288 | && (tem = Fcompare_strings (eltstring, make_number (0), | 1289 | && (tem = Fcompare_strings (eltstring, zero, |
| 1289 | make_number (SCHARS (string)), | 1290 | make_number (SCHARS (string)), |
| 1290 | string, make_number (0), Qnil, | 1291 | string, zero, Qnil, |
| 1291 | completion_ignore_case ? Qt : Qnil), | 1292 | completion_ignore_case ? Qt : Qnil), |
| 1292 | EQ (Qt, tem))) | 1293 | EQ (Qt, tem))) |
| 1293 | { | 1294 | { |
| 1294 | /* Yes. */ | 1295 | /* Yes. */ |
| 1295 | Lisp_Object regexps; | 1296 | Lisp_Object regexps; |
| 1296 | Lisp_Object zero; | ||
| 1297 | XSETFASTINT (zero, 0); | ||
| 1298 | 1297 | ||
| 1299 | /* Ignore this element if it fails to match all the regexps. */ | 1298 | /* Ignore this element if it fails to match all the regexps. */ |
| 1300 | { | 1299 | { |
| @@ -1348,9 +1347,9 @@ is used to further constrain the set of candidates. */) | |||
| 1348 | else | 1347 | else |
| 1349 | { | 1348 | { |
| 1350 | compare = min (bestmatchsize, SCHARS (eltstring)); | 1349 | compare = min (bestmatchsize, SCHARS (eltstring)); |
| 1351 | tem = Fcompare_strings (bestmatch, make_number (0), | 1350 | tem = Fcompare_strings (bestmatch, zero, |
| 1352 | make_number (compare), | 1351 | make_number (compare), |
| 1353 | eltstring, make_number (0), | 1352 | eltstring, zero, |
| 1354 | make_number (compare), | 1353 | make_number (compare), |
| 1355 | completion_ignore_case ? Qt : Qnil); | 1354 | completion_ignore_case ? Qt : Qnil); |
| 1356 | if (EQ (tem, Qt)) | 1355 | if (EQ (tem, Qt)) |
| @@ -1381,15 +1380,15 @@ is used to further constrain the set of candidates. */) | |||
| 1381 | ((matchsize == SCHARS (eltstring)) | 1380 | ((matchsize == SCHARS (eltstring)) |
| 1382 | == | 1381 | == |
| 1383 | (matchsize == SCHARS (bestmatch)) | 1382 | (matchsize == SCHARS (bestmatch)) |
| 1384 | && (tem = Fcompare_strings (eltstring, make_number (0), | 1383 | && (tem = Fcompare_strings (eltstring, zero, |
| 1385 | make_number (SCHARS (string)), | 1384 | make_number (SCHARS (string)), |
| 1386 | string, make_number (0), | 1385 | string, zero, |
| 1387 | Qnil, | 1386 | Qnil, |
| 1388 | Qnil), | 1387 | Qnil), |
| 1389 | EQ (Qt, tem)) | 1388 | EQ (Qt, tem)) |
| 1390 | && (tem = Fcompare_strings (bestmatch, make_number (0), | 1389 | && (tem = Fcompare_strings (bestmatch, zero, |
| 1391 | make_number (SCHARS (string)), | 1390 | make_number (SCHARS (string)), |
| 1392 | string, make_number (0), | 1391 | string, zero, |
| 1393 | Qnil, | 1392 | Qnil, |
| 1394 | Qnil), | 1393 | Qnil), |
| 1395 | ! EQ (Qt, tem)))) | 1394 | ! EQ (Qt, tem)))) |
| @@ -1476,13 +1475,14 @@ are ignored unless STRING itself starts with a space. */) | |||
| 1476 | || NILP (XCAR (alist)))); | 1475 | || NILP (XCAR (alist)))); |
| 1477 | int index = 0, obsize = 0; | 1476 | int index = 0, obsize = 0; |
| 1478 | int bindcount = -1; | 1477 | int bindcount = -1; |
| 1479 | Lisp_Object bucket, tem; | 1478 | Lisp_Object bucket, tem, zero; |
| 1480 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | 1479 | struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; |
| 1481 | 1480 | ||
| 1482 | CHECK_STRING (string); | 1481 | CHECK_STRING (string); |
| 1483 | if (type == 0) | 1482 | if (type == 0) |
| 1484 | return call3 (alist, string, predicate, Qt); | 1483 | return call3 (alist, string, predicate, Qt); |
| 1485 | allmatches = bucket = Qnil; | 1484 | allmatches = bucket = Qnil; |
| 1485 | zero = make_number (0); | ||
| 1486 | 1486 | ||
| 1487 | /* If ALIST is not a list, set TAIL just for gc pro. */ | 1487 | /* If ALIST is not a list, set TAIL just for gc pro. */ |
| 1488 | tail = alist; | 1488 | tail = alist; |
| @@ -1509,7 +1509,7 @@ are ignored unless STRING itself starts with a space. */) | |||
| 1509 | } | 1509 | } |
| 1510 | else if (type == 2) | 1510 | else if (type == 2) |
| 1511 | { | 1511 | { |
| 1512 | if (XFASTINT (bucket) != 0) | 1512 | if (!EQ (bucket, zero)) |
| 1513 | { | 1513 | { |
| 1514 | elt = bucket; | 1514 | elt = bucket; |
| 1515 | eltstring = Fsymbol_name (elt); | 1515 | eltstring = Fsymbol_name (elt); |
| @@ -1547,9 +1547,9 @@ are ignored unless STRING itself starts with a space. */) | |||
| 1547 | && SREF (string, 0) == ' ') | 1547 | && SREF (string, 0) == ' ') |
| 1548 | || SREF (eltstring, 0) != ' ' | 1548 | || SREF (eltstring, 0) != ' ' |
| 1549 | || NILP (hide_spaces)) | 1549 | || NILP (hide_spaces)) |
| 1550 | && (tem = Fcompare_strings (eltstring, make_number (0), | 1550 | && (tem = Fcompare_strings (eltstring, zero, |
| 1551 | make_number (SCHARS (string)), | 1551 | make_number (SCHARS (string)), |
| 1552 | string, make_number (0), | 1552 | string, zero, |
| 1553 | make_number (SCHARS (string)), | 1553 | make_number (SCHARS (string)), |
| 1554 | completion_ignore_case ? Qt : Qnil), | 1554 | completion_ignore_case ? Qt : Qnil), |
| 1555 | EQ (Qt, tem))) | 1555 | EQ (Qt, tem))) |
diff --git a/src/syntax.c b/src/syntax.c index b062264ac24..3f35027bb36 100644 --- a/src/syntax.c +++ b/src/syntax.c | |||
| @@ -1320,6 +1320,7 @@ and the function returns nil. Field boundaries are not noticed if | |||
| 1320 | (arg) | 1320 | (arg) |
| 1321 | Lisp_Object arg; | 1321 | Lisp_Object arg; |
| 1322 | { | 1322 | { |
| 1323 | Lisp_Object tmp; | ||
| 1323 | int orig_val, val; | 1324 | int orig_val, val; |
| 1324 | 1325 | ||
| 1325 | if (NILP (arg)) | 1326 | if (NILP (arg)) |
| @@ -1332,8 +1333,9 @@ and the function returns nil. Field boundaries are not noticed if | |||
| 1332 | val = XINT (arg) > 0 ? ZV : BEGV; | 1333 | val = XINT (arg) > 0 ? ZV : BEGV; |
| 1333 | 1334 | ||
| 1334 | /* Avoid jumping out of an input field. */ | 1335 | /* Avoid jumping out of an input field. */ |
| 1335 | val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT), | 1336 | tmp = Fconstrain_to_field (make_number (val), make_number (PT), |
| 1336 | Qt, Qnil, Qnil)); | 1337 | Qt, Qnil, Qnil); |
| 1338 | val = XFASTINT (tmp); | ||
| 1337 | 1339 | ||
| 1338 | SET_PT (val); | 1340 | SET_PT (val); |
| 1339 | return val == orig_val ? Qt : Qnil; | 1341 | return val == orig_val ? Qt : Qnil; |
diff --git a/src/w32term.c b/src/w32term.c index da24d2051ea..7208a8acf7e 100644 --- a/src/w32term.c +++ b/src/w32term.c | |||
| @@ -5542,47 +5542,17 @@ void | |||
| 5542 | x_calc_absolute_position (f) | 5542 | x_calc_absolute_position (f) |
| 5543 | struct frame *f; | 5543 | struct frame *f; |
| 5544 | { | 5544 | { |
| 5545 | POINT pt; | ||
| 5546 | int flags = f->size_hint_flags; | 5545 | int flags = f->size_hint_flags; |
| 5547 | 5546 | ||
| 5548 | pt.x = pt.y = 0; | ||
| 5549 | |||
| 5550 | /* Find the position of the outside upper-left corner of | ||
| 5551 | the inner window, with respect to the outer window. | ||
| 5552 | But do this only if we will need the results. */ | ||
| 5553 | if (f->output_data.w32->parent_desc != FRAME_W32_DISPLAY_INFO (f)->root_window) | ||
| 5554 | { | ||
| 5555 | BLOCK_INPUT; | ||
| 5556 | MapWindowPoints (FRAME_W32_WINDOW (f), | ||
| 5557 | f->output_data.w32->parent_desc, | ||
| 5558 | &pt, 1); | ||
| 5559 | UNBLOCK_INPUT; | ||
| 5560 | } | ||
| 5561 | |||
| 5562 | { | ||
| 5563 | RECT rt; | ||
| 5564 | rt.left = rt.right = rt.top = rt.bottom = 0; | ||
| 5565 | |||
| 5566 | BLOCK_INPUT; | ||
| 5567 | AdjustWindowRect(&rt, f->output_data.w32->dwStyle, | ||
| 5568 | FRAME_EXTERNAL_MENU_BAR (f)); | ||
| 5569 | UNBLOCK_INPUT; | ||
| 5570 | |||
| 5571 | pt.x += (rt.right - rt.left); | ||
| 5572 | pt.y += (rt.bottom - rt.top); | ||
| 5573 | } | ||
| 5574 | |||
| 5575 | /* Treat negative positions as relative to the leftmost bottommost | 5547 | /* Treat negative positions as relative to the leftmost bottommost |
| 5576 | position that fits on the screen. */ | 5548 | position that fits on the screen. */ |
| 5577 | if (flags & XNegative) | 5549 | if (flags & XNegative) |
| 5578 | f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width | 5550 | f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width |
| 5579 | - 2 * f->border_width - pt.x | ||
| 5580 | - FRAME_PIXEL_WIDTH (f) | 5551 | - FRAME_PIXEL_WIDTH (f) |
| 5581 | + f->left_pos); | 5552 | + f->left_pos); |
| 5582 | 5553 | ||
| 5583 | if (flags & YNegative) | 5554 | if (flags & YNegative) |
| 5584 | f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height | 5555 | f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height |
| 5585 | - 2 * f->border_width - pt.y | ||
| 5586 | - FRAME_PIXEL_HEIGHT (f) | 5556 | - FRAME_PIXEL_HEIGHT (f) |
| 5587 | + f->top_pos); | 5557 | + f->top_pos); |
| 5588 | /* The left_pos and top_pos | 5558 | /* The left_pos and top_pos |
diff --git a/src/xdisp.c b/src/xdisp.c index c50edb98561..ba6ee253d79 100644 --- a/src/xdisp.c +++ b/src/xdisp.c | |||
| @@ -343,6 +343,11 @@ Lisp_Object Vvoid_text_area_pointer; | |||
| 343 | 343 | ||
| 344 | Lisp_Object Qtrailing_whitespace; | 344 | Lisp_Object Qtrailing_whitespace; |
| 345 | 345 | ||
| 346 | /* Name and number of the face used to highlight escape glyphs. */ | ||
| 347 | |||
| 348 | Lisp_Object Qescape_glyph; | ||
| 349 | int escape_glyph_face; | ||
| 350 | |||
| 346 | /* The symbol `image' which is the car of the lists used to represent | 351 | /* The symbol `image' which is the car of the lists used to represent |
| 347 | images in Lisp. */ | 352 | images in Lisp. */ |
| 348 | 353 | ||
| @@ -5014,6 +5019,21 @@ get_next_display_element (it) | |||
| 5014 | display. Then, set IT->dpvec to these glyphs. */ | 5019 | display. Then, set IT->dpvec to these glyphs. */ |
| 5015 | GLYPH g; | 5020 | GLYPH g; |
| 5016 | int ctl_len; | 5021 | int ctl_len; |
| 5022 | int face_id = escape_glyph_face; | ||
| 5023 | |||
| 5024 | /* Find the face id if `escape-glyph' unless we recently did. */ | ||
| 5025 | if (face_id < 0) | ||
| 5026 | { | ||
| 5027 | Lisp_Object tem = Fget (Qescape_glyph, Qface); | ||
| 5028 | if (INTEGERP (tem)) | ||
| 5029 | face_id = XINT (tem); | ||
| 5030 | else | ||
| 5031 | face_id = 0; | ||
| 5032 | /* If there's overflow, use 0 instead. */ | ||
| 5033 | if (FAST_GLYPH_FACE (FAST_MAKE_GLYPH (0, face_id)) != face_id) | ||
| 5034 | face_id = 0; | ||
| 5035 | escape_glyph_face = face_id; | ||
| 5036 | } | ||
| 5017 | 5037 | ||
| 5018 | if (it->c < 128 && it->ctl_arrow_p) | 5038 | if (it->c < 128 && it->ctl_arrow_p) |
| 5019 | { | 5039 | { |
| @@ -5023,10 +5043,10 @@ get_next_display_element (it) | |||
| 5023 | && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp)))) | 5043 | && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp)))) |
| 5024 | g = XINT (DISP_CTRL_GLYPH (it->dp)); | 5044 | g = XINT (DISP_CTRL_GLYPH (it->dp)); |
| 5025 | else | 5045 | else |
| 5026 | g = FAST_MAKE_GLYPH ('^', 0); | 5046 | g = FAST_MAKE_GLYPH ('^', face_id); |
| 5027 | XSETINT (it->ctl_chars[0], g); | 5047 | XSETINT (it->ctl_chars[0], g); |
| 5028 | 5048 | ||
| 5029 | g = FAST_MAKE_GLYPH (it->c ^ 0100, 0); | 5049 | g = FAST_MAKE_GLYPH (it->c ^ 0100, face_id); |
| 5030 | XSETINT (it->ctl_chars[1], g); | 5050 | XSETINT (it->ctl_chars[1], g); |
| 5031 | ctl_len = 2; | 5051 | ctl_len = 2; |
| 5032 | } | 5052 | } |
| @@ -5043,7 +5063,7 @@ get_next_display_element (it) | |||
| 5043 | && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) | 5063 | && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) |
| 5044 | escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp)); | 5064 | escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp)); |
| 5045 | else | 5065 | else |
| 5046 | escape_glyph = FAST_MAKE_GLYPH ('\\', 0); | 5066 | escape_glyph = FAST_MAKE_GLYPH ('\\', face_id); |
| 5047 | 5067 | ||
| 5048 | if (CHAR_BYTE8_P (it->c)) | 5068 | if (CHAR_BYTE8_P (it->c)) |
| 5049 | { | 5069 | { |
| @@ -5074,11 +5094,14 @@ get_next_display_element (it) | |||
| 5074 | XSETINT (it->ctl_chars[i * 4], escape_glyph); | 5094 | XSETINT (it->ctl_chars[i * 4], escape_glyph); |
| 5075 | /* Insert three more glyphs into IT->ctl_chars for | 5095 | /* Insert three more glyphs into IT->ctl_chars for |
| 5076 | the octal display of the character. */ | 5096 | the octal display of the character. */ |
| 5077 | g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0', 0); | 5097 | g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0', |
| 5098 | face_id); | ||
| 5078 | XSETINT (it->ctl_chars[i * 4 + 1], g); | 5099 | XSETINT (it->ctl_chars[i * 4 + 1], g); |
| 5079 | g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0', 0); | 5100 | g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0', |
| 5101 | face_id); | ||
| 5080 | XSETINT (it->ctl_chars[i * 4 + 2], g); | 5102 | XSETINT (it->ctl_chars[i * 4 + 2], g); |
| 5081 | g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 0); | 5103 | g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', |
| 5104 | face_id); | ||
| 5082 | XSETINT (it->ctl_chars[i * 4 + 3], g); | 5105 | XSETINT (it->ctl_chars[i * 4 + 3], g); |
| 5083 | } | 5106 | } |
| 5084 | ctl_len = len * 4; | 5107 | ctl_len = len * 4; |
| @@ -5217,6 +5240,9 @@ set_iterator_to_next (it, reseat_p) | |||
| 5217 | it->dpvec = NULL; | 5240 | it->dpvec = NULL; |
| 5218 | it->current.dpvec_index = -1; | 5241 | it->current.dpvec_index = -1; |
| 5219 | 5242 | ||
| 5243 | /* Recheck faces after display vector */ | ||
| 5244 | it->stop_charpos = 0; | ||
| 5245 | |||
| 5220 | /* Skip over characters which were displayed via IT->dpvec. */ | 5246 | /* Skip over characters which were displayed via IT->dpvec. */ |
| 5221 | if (it->dpvec_char_len < 0) | 5247 | if (it->dpvec_char_len < 0) |
| 5222 | reseat_at_next_visible_line_start (it, 1); | 5248 | reseat_at_next_visible_line_start (it, 1); |
| @@ -11679,6 +11705,9 @@ redisplay_window (window, just_this_one_p) | |||
| 11679 | *w->desired_matrix->method = 0; | 11705 | *w->desired_matrix->method = 0; |
| 11680 | #endif | 11706 | #endif |
| 11681 | 11707 | ||
| 11708 | /* Force this to be looked up again for each redisp of each window. */ | ||
| 11709 | escape_glyph_face = -1; | ||
| 11710 | |||
| 11682 | specbind (Qinhibit_point_motion_hooks, Qt); | 11711 | specbind (Qinhibit_point_motion_hooks, Qt); |
| 11683 | 11712 | ||
| 11684 | reconsider_clip_changes (w, buffer); | 11713 | reconsider_clip_changes (w, buffer); |
| @@ -22292,6 +22321,8 @@ syms_of_xdisp () | |||
| 22292 | staticpro (&Qfontification_functions); | 22321 | staticpro (&Qfontification_functions); |
| 22293 | Qtrailing_whitespace = intern ("trailing-whitespace"); | 22322 | Qtrailing_whitespace = intern ("trailing-whitespace"); |
| 22294 | staticpro (&Qtrailing_whitespace); | 22323 | staticpro (&Qtrailing_whitespace); |
| 22324 | Qescape_glyph = intern ("escape-glyph"); | ||
| 22325 | staticpro (&Qescape_glyph); | ||
| 22295 | Qimage = intern ("image"); | 22326 | Qimage = intern ("image"); |
| 22296 | staticpro (&Qimage); | 22327 | staticpro (&Qimage); |
| 22297 | QCmap = intern (":map"); | 22328 | QCmap = intern (":map"); |
diff --git a/src/xterm.c b/src/xterm.c index 1f2b54272cc..2ffe7668516 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -8171,20 +8171,11 @@ x_calc_absolute_position (f) | |||
| 8171 | if (! ((flags & XNegative) || (flags & YNegative))) | 8171 | if (! ((flags & XNegative) || (flags & YNegative))) |
| 8172 | return; | 8172 | return; |
| 8173 | 8173 | ||
| 8174 | /* Find the offsets of the outside upper-left corner of | ||
| 8175 | the inner window, with respect to the outer window. | ||
| 8176 | But do this only if we will need the results. */ | ||
| 8177 | if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window) | ||
| 8178 | /* This is to get *_pixels_outer_diff. */ | ||
| 8179 | x_real_positions (f, &win_x, &win_y); | ||
| 8180 | |||
| 8181 | /* Treat negative positions as relative to the leftmost bottommost | 8174 | /* Treat negative positions as relative to the leftmost bottommost |
| 8182 | position that fits on the screen. */ | 8175 | position that fits on the screen. */ |
| 8183 | if (flags & XNegative) | 8176 | if (flags & XNegative) |
| 8184 | f->left_pos = (FRAME_X_DISPLAY_INFO (f)->width | 8177 | f->left_pos = (FRAME_X_DISPLAY_INFO (f)->width |
| 8185 | - 2 * FRAME_X_OUTPUT (f)->x_pixels_outer_diff | 8178 | - FRAME_PIXEL_WIDTH (f) + f->left_pos); |
| 8186 | - FRAME_PIXEL_WIDTH (f) | ||
| 8187 | + f->left_pos); | ||
| 8188 | 8179 | ||
| 8189 | { | 8180 | { |
| 8190 | int height = FRAME_PIXEL_HEIGHT (f); | 8181 | int height = FRAME_PIXEL_HEIGHT (f); |
| @@ -8206,15 +8197,7 @@ x_calc_absolute_position (f) | |||
| 8206 | #endif | 8197 | #endif |
| 8207 | 8198 | ||
| 8208 | if (flags & YNegative) | 8199 | if (flags & YNegative) |
| 8209 | f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height | 8200 | f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height - height + f->top_pos); |
| 8210 | - FRAME_X_OUTPUT (f)->y_pixels_outer_diff | ||
| 8211 | |||
| 8212 | /* Assume the window manager decorations are the same size on | ||
| 8213 | three sides, i.e. left, right and bottom. This is to | ||
| 8214 | compensate for the bottom part. */ | ||
| 8215 | - FRAME_X_OUTPUT (f)->x_pixels_outer_diff | ||
| 8216 | - height | ||
| 8217 | + f->top_pos); | ||
| 8218 | } | 8201 | } |
| 8219 | 8202 | ||
| 8220 | /* The left_pos and top_pos | 8203 | /* The left_pos and top_pos |
| @@ -8330,7 +8313,9 @@ x_check_expected_move (f) | |||
| 8330 | FRAME_X_OUTPUT (f)->move_offset_left = expect_left - f->left_pos; | 8313 | FRAME_X_OUTPUT (f)->move_offset_left = expect_left - f->left_pos; |
| 8331 | FRAME_X_OUTPUT (f)->move_offset_top = expect_top - f->top_pos; | 8314 | FRAME_X_OUTPUT (f)->move_offset_top = expect_top - f->top_pos; |
| 8332 | 8315 | ||
| 8333 | x_set_offset (f, expect_left, expect_top, 1); | 8316 | f->left_pos = expect_left; |
| 8317 | f->top_pos = expect_top; | ||
| 8318 | x_set_offset (f, expect_left, expect_top, 0); | ||
| 8334 | } | 8319 | } |
| 8335 | else if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN) | 8320 | else if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN) |
| 8336 | FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B; | 8321 | FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B; |