changeset 90066:fb79180b618d

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
author Miles Bader <miles@gnu.org>
date Tue, 14 Dec 2004 07:34:55 +0000
parents c26eb15cd14a (current diff) ec047d4f2cfc (diff)
children b481c5870e10
files ChangeLog Makefile.in etc/ChangeLog etc/NEWS etc/TODO etc/fr-refcard.tex lisp/ChangeLog lisp/bindings.el lisp/buff-menu.el lisp/calc/calc-aent.el lisp/calc/calc-ext.el lisp/calc/calc-keypd.el lisp/calc/calc.el lisp/cus-edit.el lisp/emacs-lisp/checkdoc.el lisp/emacs-lisp/elint.el lisp/emacs-lisp/lisp.el lisp/faces.el lisp/ffap.el lisp/filecache.el lisp/files.el lisp/gnus/ChangeLog lisp/gnus/gnus-art.el lisp/gnus/gnus-group.el lisp/gnus/gnus-start.el lisp/info.el lisp/international/isearch-x.el lisp/isearch.el lisp/mail/supercite.el lisp/net/browse-url.el lisp/play/zone.el lisp/progmodes/idlw-shell.el lisp/replace.el lisp/simple.el lisp/subr.el lisp/term.el lisp/textmodes/paragraphs.el lisp/textmodes/tex-mode.el lisp/vc-svn.el lisp/xml.el lisp/xt-mouse.el lispref/ChangeLog lispref/display.texi lispref/locals.texi lispref/text.texi man/ChangeLog man/calc.texi man/custom.texi man/dired.texi man/gnus-faq.texi man/gnus.texi man/makefile.w32-in man/mark.texi man/misc.texi man/reftex.texi src/ChangeLog src/emacs.c src/eval.c src/image.c src/indent.c src/keyboard.c src/lisp.h src/minibuf.c src/syntax.c src/w32term.c src/xdisp.c src/xterm.c
diffstat 72 files changed, 2224 insertions(+), 1243 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,3 +1,13 @@
+2004-12-11  Kim F. Storm  <storm@cua.dk>
+
+	* Makefile.in (info): Undo 2004-12-05 change.
+
+2004-12-08  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* info/dir (File): Add URL and Org Mode manuals.
+	* Makefile.in (install-arch-indep, uninstall): Add url and org
+	manuals.
+
 2004-12-07  Stefan  <monnier@iro.umontreal.ca>
 
 	* configure.in (INLINE, RE_TRANSLATE_P): Move patches mistakenly
--- a/Makefile.in	Sat Dec 11 02:29:07 2004 +0000
+++ b/Makefile.in	Tue Dec 14 07:34:55 2004 +0000
@@ -484,7 +484,7 @@
 	      chmod a+r ${infodir}/dir); \
 	   fi; \
 	   cd ${srcdir}/info ; \
-	   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 \
+	   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 \
 	     (cd $${thisdir}; \
 	      ${INSTALL_DATA} ${srcdir}/info/$$f ${infodir}/$$f; \
 	      chmod a+r ${infodir}/$$f); \
@@ -494,7 +494,7 @@
 	thisdir=`/bin/pwd`; \
 	if [ `(cd ${srcdir}/info && /bin/pwd)` != `(cd ${infodir} && /bin/pwd)` ]; \
 	then \
-	  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 \
+	  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 \
 	    (cd $${thisdir}; \
 	     ${INSTALL_INFO} --info-dir=${infodir} ${infodir}/$$f); \
 	  done; \
@@ -560,7 +560,7 @@
 	done
 	(cd ${archlibdir} && rm -f fns-*)
 	-rm -rf ${libexecdir}/emacs/${version}
-	(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*)
+	(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*)
 	(cd ${man1dir}  && rm -f emacs${manext} emacsclient${manext} etags${manext} ctags${manext})
 	(cd ${bindir}  && rm -f $(EMACSFULL) $(EMACS))
 
@@ -719,9 +719,9 @@
 # put the info files in $(srcdir),
 # so we can do ok running make in the build dir.
 info: force-info
-	-(cd man; $(MAKE) $(MFLAGS) info)
-	-(cd lispref; $(MAKE) $(MFLAGS) info)
-	-(cd lispintro; $(MAKE) $(MFLAGS) info)
+	(cd man; $(MAKE) $(MFLAGS) info)
+	(cd lispref; $(MAKE) $(MFLAGS) info)
+	(cd lispintro; $(MAKE) $(MFLAGS) info)
 dvi:
 	(cd man; $(MAKE) $(MFLAGS) dvi)
 	(cd lispref; $(MAKE) $(MFLAGS) elisp.dvi)
--- a/etc/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/etc/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,3 +1,12 @@
+2004-12-11  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* e/eterm.ti: Add rs1.
+	* e/eterm: Regenerate.
+
+2004-12-08  Alexandre VEYRENC  <veyrenc@wanadoo.fr>  (tiny change)
+
+	* fr-refcard.tex: Fix typos.
+
 2004-12-07  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* PROBLEMS: Update information about klipper on KDE.
--- a/etc/NEWS	Sat Dec 11 02:29:07 2004 +0000
+++ b/etc/NEWS	Tue Dec 14 07:34:55 2004 +0000
@@ -671,6 +671,27 @@
 marks omitted files. The variable dired-omit-files-p is obsoleted, use the
 mode toggling function instead.
 
++++
+** find-file-read-only visits multiple files in read-only mode,
+when the file name contains wildcard characters.
+
++++
+** find-alternate-file replaces the current file with multiple files,
+when the file name contains wildcard characters.
+
+** FFAP
+
++++
+*** New ffap commands and keybindings: C-x C-r (`ffap-read-only'),
+C-x C-v (`ffap-alternate-file'), C-x C-d (`ffap-list-directory'),
+C-x 4 r (`ffap-read-only-other-window'), C-x 4 d (`ffap-dired-other-window'),
+C-x 5 r (`ffap-read-only-other-frame'), C-x 5 d (`ffap-dired-other-frame').
+
+---
+*** FFAP accepts wildcards in a file name by default.  C-x C-f passes
+it to `find-file' with non-nil WILDCARDS argument, which visits
+multiple files, and C-x d passes it to `dired'.
+
 ** Info mode:
 
 *** A numeric prefix argument of `info' selects an Info buffer
@@ -1139,6 +1160,10 @@
 replacement string to specify a position where the replacement string
 can be edited for each replacement.
 
+** query-replace uses isearch highlighting with lazy highlighting
+when the user option `query-replace-highlight' is set to `isearch'.
+If it is t, it uses old query-replace highlighting method.
+
 +++
 ** Emacs normally highlights mouse sensitive text whenever the mouse
 is over the text.  By setting the new variable `mouse-highlight', you
@@ -1443,7 +1468,10 @@
 C-M-h (mark-defun) repeatedly, the marked region extends each time, so
 you can mark the next two sexps with M-C-SPC M-C-SPC, for example.
 This feature also works for mark-end-of-sentence, if you bind that to
-a key.
+a key.  It also extends the region when the mark is active in Transient
+Mark mode, regardless of the last command.  To start a new region with
+one of marking commands in Transient Mark mode, you can deactivate the
+active region with C-g, or set the new mark with C-SPC.
 
 +++
 ** Some commands do something special in Transient Mark mode when the
@@ -1468,6 +1496,11 @@
 previous mark, i.e. C-u C-SPC C-SPC C-SPC ... cycles through the
 mark ring.  Use C-u C-u C-SPC to set the mark immediately after a jump.
 
+** Movement commands `beginning-of-buffer', `end-of-buffer',
+`beginning-of-defun', `end-of-defun' do not set the mark if the new
+option `inhibit-mark-movement' is non-nil, or if the mark is already
+active in Transient Mark mode.
+
 +++
 ** In the *Occur* buffer, `o' switches to it in another window, and
 C-o displays the current line's occurrence in another window without
@@ -2413,6 +2446,17 @@
 
 * Lisp Changes in Emacs 21.4
 
+** (while-no-input BODY...) runs BODY, but only so long as no input
+arrives.  If the user types or clicks anything, BODY stops as if a
+quit had occurred.  while-no-input returns the value of BODY, if BODY
+finishes.  It returns nil if BODY was aborted.
+
+---
+** To manipulate the File menu using easy-menu, you must specify the
+proper name "file".  In previous Emacs versions, you had to specify
+"files", even though the menu item itself was changed to say "File"
+several versions ago.
+
 +++
 ** read-from-minibuffer now accepts an additional argument KEEP-ALL
 saying to put all inputs in the history list, even empty ones.
@@ -2656,8 +2700,10 @@
 around potentially blocking or long-running code in timers
 and post-command-hooks.
 
-** An unconditional face specification in defface (one where the DISPLAY part
-is just t) applies to all cases and does not override subsequent entries.
+** The first face specification element in a defface can specify
+`default' instead of frame classification.  Then its attributes act as
+defaults that apply to all the subsequent cases (and may be overridden
+by them).
 
 +++
 ** New face attribute `min-colors' can be used to tailor the face color
@@ -6523,9 +6569,8 @@
 ** Function `plist-member' is renamed from `widget-plist-member' (which is
 retained as an alias).
 
-** Easy-menu's :filter now works as in XEmacs.
-It takes the unconverted (i.e. XEmacs) form of the menu and the result
-is automatically converted to Emacs' form.
+** Easy-menu's :filter now takes the unconverted form of the menu and
+the result is automatically converted to Emacs' form.
 
 ** The new function `window-list' has been defined
 
--- a/etc/TODO	Sat Dec 11 02:29:07 2004 +0000
+++ b/etc/TODO	Tue Dec 14 07:34:55 2004 +0000
@@ -15,6 +15,9 @@
   ought to be possible to omit text which is invisible (due to a
   text-property, overlay, or selective display) from the kill-ring.
 
+** Redefine define-generic-mode as a macro, so the compiler
+  sees the definitions it generates.
+
 * Important features:
 
 ** Provide user-friendly ways to list all available font families,
--- a/etc/e/eterm.ti	Sat Dec 11 02:29:07 2004 +0000
+++ b/etc/e/eterm.ti	Tue Dec 14 07:34:55 2004 +0000
@@ -50,6 +50,7 @@
 	rmir=\E[4l,
 	rmso=\E[27m,
 	rmul=\E[24m,
+	rs1=\Ec,
 	sc=\E7,
 	setab=\E[%p1%{40}%+%dm,
 	setaf=\E[%p1%{30}%+%dm,
@@ -59,3 +60,4 @@
  	smso=\E[7m,
 #	smcup=\E[?47h,
 #	rmcup=\E[?47l,
+#       rs2 may need to be added
--- a/etc/fr-refcard.tex	Sat Dec 11 02:29:07 2004 +0000
+++ b/etc/fr-refcard.tex	Tue Dec 14 07:34:55 2004 +0000
@@ -64,13 +64,13 @@
 \centerline{Copyright \copyright\ \year\ Free Software Foundation, Inc.}
 \centerline{v\versionnumber{} pour GNU Emacs version 21, Juin \year}
 \centerline{conception de Stephen Gildea}
-\centerline{traduction francaise d'\'Eric Jacoboni}
+\centerline{traduction fran\c{c}aise d'\'Eric Jacoboni}
 
 Vous pouvez faire et distribuer des copies de cette carte, pourvu que
 la note de copyright et cette note de permission soient conserv\'ees sur
 toutes les copies.
 
-Pour les copies du manuel GNU Emacs, \'ecrivez  la Free Software
+Pour les copies du manuel GNU Emacs, \'ecrivez \`a la Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 \endgroup}
@@ -260,9 +260,9 @@
 
 \section{Lancement d'Emacs}
 
-Pour lancer GNU Emacs 20, il suffit de taper son nom : \kbd{emacs}
+Pour lancer GNU Emacs 21, il suffit de taper son nom : \kbd{emacs}
 
-Pour charger un fichier  \'editer, voir Fichiers, ci-dessous.
+Pour charger un fichier \`a \'editer, voir Fichiers, ci-dessous.
 
 \section{Quitter Emacs}
 
@@ -277,7 +277,7 @@
 \key{{\bf ins\'erer} le contenu d'un autre fichier dans ce tampon}{C-x i}
 \key{remplacer ce fichier par le fichier voulu}{C-x C-v}
 \key{\'ecrire le tampon dans un fichier donn\'e}{C-x C-w}
-\key{contrle de version}{C-x C-q}
+\key{contr\^ole de version}{C-x C-q}
 
 \section{Obtenir de l'aide}
 
@@ -324,21 +324,21 @@
 \section{D\'eplacements}
 
 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
-\threecol{{\bf entity to move over}}{{\bf backward}}{{\bf forward}}
+\threecol{{\bf entit\'e sur laquelle se d\'eplacer}}{{\bf en arri\`ere}}{{\bf en avant}}
 \threecol{caract\`ere}{C-b}{C-f}
 \threecol{mot}{M-b}{M-f}
 \threecol{ligne}{C-p}{C-n}
-\threecol{aller au d\'ebut (ou  la fin) de la ligne}{C-a}{C-e}
+\threecol{aller au d\'ebut (ou \`a la fin) de la ligne}{C-a}{C-e}
 \threecol{phrase}{M-a}{M-e}
 \threecol{paragraphe}{M-\{}{M-\}}
 \threecol{page}{C-x [}{C-x ]}
 \threecol{s-expression}{C-M-b}{C-M-f}
 \threecol{fonction}{C-M-a}{C-M-e}
-\threecol{aller au d\'ebut (ou  la fin) du tampon}{M-<}{M->}
+\threecol{aller au d\'ebut (ou \`a la fin) du tampon}{M-<}{M->}
 }
 
-\key{passer  l'\'ecran suivant}{C-v}
-\key{passer  l'\'ecran pr\'ec\'edent}{M-v}
+\key{passer \`a l'\'ecran suivant}{C-v}
+\key{passer \`a l'\'ecran pr\'ec\'edent}{M-v}
 \key{d\'efiler l'\'ecran vers la droite}{C-x <}
 \key{d\'efiler l'\'ecran vers la gauche}{C-x >}
 \key{placer la ligne courante au centre de l'\'ecran}{C-u C-l}
@@ -346,17 +346,17 @@
 \section{D\'etruire et supprimer}
 
 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
-\threecol{{\bf entity to kill}}{{\bf backward}}{{\bf forward}}
+\threecol{{\bf entit\'e \`a supprimer}}{{\bf en arri\`ere}}{{\bf en avant}}
 \threecol{caract\`ere (suppression, pas destruction)}{DEL}{C-d}
 \threecol{mot}{M-DEL}{M-d}
-\threecol{ligne (jusqu' la fin)}{M-0 C-k}{C-k}
+\threecol{ligne (jusqu'\`a la fin)}{M-0 C-k}{C-k}
 \threecol{phrase}{C-x DEL}{M-k}
 \threecol{s-expression}{M-- C-M-k}{C-M-k}
 }
 
 \key{d\'etruire une {\bf r\'egion}}{C-w}
 \key{copier une r\'egion dans le kill ring}{M-w}
-\key{d\'etruire jusqu' l'occurrence suivante de {\it car}}{M-z {\it car}}
+\key{d\'etruire jusqu'\`a l'occurrence suivante de {\it car}}{M-z {\it car}}
 
 \key{r\'ecup\'erer la derni\`ere chose d\'etruite}{C-y}
 \key{remplacer la derni\`ere r\'ecup\'eration par ce qui a \'et\'e d\'etruit avant}{M-y}
@@ -380,11 +380,11 @@
 
 Les r\'eponses admises dans le mode de remplacement interactif sont :
 
-\key{{\bf remplacer} celle-l, passer  la suivante}{SPC}
-\key{remplacer celle-l, rester l}{,}
-\key{{\bf passer}  la suivante sans remplacer}{DEL}
+\key{{\bf remplacer} celle-l\`a, passer \`a la suivante}{SPC}
+\key{remplacer celle-l\`a, rester l\`a}{,}
+\key{{\bf passer} \`a la suivante sans remplacer}{DEL}
 \key{remplacer toutes les correspondances suivantes}{!}
-\key{{\bf revenir}  la correspondance pr\'ec\'edente}{^}
+\key{{\bf revenir} \`a la correspondance pr\'ec\'edente}{^}
 \key{{\bf sortir} du remplacement interactif}{RET}
 \key{entrer dans l'\'edition r\'ecursive (\kbd{C-M-c} pour sortir)}{C-r}
 
@@ -405,7 +405,7 @@
 
 {\setbox0=\hbox{\kbd{0}}\advance\hsize by 2\wd0
 \paralign to \hsize{#\tabskip=10pt plus 1 fil&#\tabskip=0pt&#\cr
-\threecol{switch cursor to another window}{C-x o}{C-x 5 o}
+\threecol{placer le curseur dans une autre fen\^etre}{C-x o}{C-x 5 o}
 
 \threecol{s\'electionner le tampon dans l'autre fen\^etre}{C-x 4 b}{C-x 5 b}
 \threecol{afficher le tampon dans l'autre fen\^etre}{C-x 4 C-o}{C-x 5 C-o}
@@ -429,9 +429,9 @@
 \key{ins\'erer un newline apr\`es le point}{C-o}
 \key{d\'eplacer le reste de la ligne vers le bas}{C-M-o}
 \key{supprimer les lignes blanches autour du point}{C-x C-o}
-\key{joindre la ligne  la pr\'ec\'edente ( la suivant avec arg)}{M-^}
+\key{joindre la ligne \`a la pr\'ec\'edente (\`a la suivante avec arg)}{M-^}
 \key{supprimer tous les espaces autour du point}{M-\\}
-\key{mettre exactement un espace  l'emplacement du point}{M-SPC}
+\key{mettre exactement un espace \`a l'emplacement du point}{M-SPC}
 
 \key{remplir le paragraphe}{M-q}
 \key{placer la marge droite}{C-x f}
@@ -454,11 +454,11 @@
 
 \key{compl\'eter autant que possible}{TAB}
 \key{compl\'eter un mot}{SPC}
-\key{completer et ex\'ecuter}{RET}
+\key{compl\'eter et ex\'ecuter}{RET}
 \key{montrer les compl\'etions possibles}{?}
 \key{rechercher l'entr\'ee pr\'ec\'edente du mini-tampon}{M-p}
 \key{rechercher l'entr\'ee suivante du mini-tampon ou le d\'efaut}{M-n}
-\key{rechercher  rebours par expr. rationnelle dans l'historique}{M-r}
+\key{rechercher \`a rebours par expr. rationnelle dans l'historique}{M-r}
 \key{rechercher vers l'avant par expr. rationnelle dans l'historique}{M-s}
 \key{annuler la commande}{C-g}
 
@@ -511,7 +511,7 @@
 \key{copier le rectangle dans le registre}{C-x r r}
 \key{d\'etruire le rectangle}{C-x r k}
 \key{r\'ecup\'erer le rectangle}{C-x r y}
-\key{ouvrir le rectangle, en d\'ecalant le texte  droite}{C-x r o}
+\key{ouvrir le rectangle, en d\'ecalant le texte \`a droite}{C-x r o}
 \key{vider le rectangle}{C-x r c}
 \key{pr\'efixer chaque ligne avec une cha\^\i{}ne}{C-x r t}
 
@@ -545,7 +545,7 @@
 \threecol{tampon}{\\`}{\\'}
 
 \threecol{{\bf classe de caract\`ere}}{{\bf correspond}}{{\bf correspond
-     d'autres}}
+    \`a d'autres}}
 \threecol{ensemble explicite}{[ {\rm$\ldots$} ]}{[^ {\rm$\ldots$} ]}
 \threecol{caract\`ere de mot}{\\w}{\\W}
 \threecol{caract\`ere avec la syntaxe {\it c}}{\\s{\it c}}{\\S{\it c}}
@@ -605,8 +605,8 @@
 \key{{\bf lancer} la d\'efinition d'une macro clavier}{C-x (}
 \key{{\bf terminer} la d\'efinition d'une macro clavier}{C-x )}
 \key{{\bf ex\'ecuter} la derni\`ere macro clavier d\'efinie}{C-x e}
-\key{ajouter  la derni\`ere macro clavier}{C-u C-x (}
-\metax{donner un nom  la derni\`ere macro clavier}{M-x name-last-kbd-macro}
+\key{ajouter \`a la derni\`ere macro clavier}{C-u C-x (}
+\metax{donner un nom \`a la derni\`ere macro clavier}{M-x name-last-kbd-macro}
 \metax{ins\'erer une d\'efinition Lisp dans le tampon}{M-x insert-kbd-macro}
 
 \section{Commandes de gestion d'Emacs Lisp}
@@ -615,7 +615,7 @@
 \key{\'evaluer la {\bf defun} courante}{C-M-x}
 \metax{\'evaluer la {\bf r\'egion}}{M-x eval-region}
 \key{lire et \'evaluer le mini-tampon}{M-:}
-\metax{charger  partir du r\'epertoire syst\`eme standard}{M-x load-library}
+\metax{charger \`a partir du r\'epertoire syst\`eme standard}{M-x load-library}
 
 \section{Personnalisation simple}
 
--- a/lisp/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,3 +1,207 @@
+2004-12-14  Juri Linkov  <juri@jurta.org>
+
+	* buff-menu.el (list-buffers-noselect): Collect internal info
+	for every buffer in BUFFER-LIST arg too.
+	(Buffer-menu-switch-other-window): Bind pop-up-windows to t.
+	(Buffer-menu-switch-other-window, Buffer-menu-2-window):
+	Bind same-window-buffer-names and same-window-regexps to nil.
+
+2004-12-13  Juri Linkov  <juri@jurta.org>
+
+	* simple.el (next-error-buffer-p, next-error-find-buffer):
+	Doc fix.
+
+	* mail/supercite.el (sc-cite-frame-alist): Doc fix.
+	(sc-cite-region, sc-uncite-region, sc-recite-region):
+	Fix previous change to handle not alist as a symbol, but
+	a citation frame as a symbol that represents a variable name.
+
+2004-12-13  Richard M. Stallman  <rms@gnu.org>
+
+	* filecache.el (file-cache-add-directory-using-find):
+	Only set up file-cache-find-command-posix-flag if we will use it.
+
+	* bindings.el (mode-line-buffer-identification-keymap):
+	Don't cancel the mode-line's usual down-mouse-1 binding.
+
+	* cus-edit.el (custom-face-selected): Handle `default' specs.
+	(custom-face-edit): Increase extra-offset.
+	(custom-display): Handle `default' specs.
+
+	* xml.el (xml-name-re, xml-entity-value-re): Add defvars.
+
+	* emacs-lisp/elint.el (elint-standard-variables)
+	(elint-unknown-builtin-args): Move definitions up.
+
+	* net/browse-url.el (browse-url-url-at-point): Add autoload.
+
+	* info.el (info-xref-visited): Use `default' instead of t.
+	(Info-try-follow-nearest-node): Don't explicitly load browse-url.
+
+	* faces.el (header-line, mode-line-inactive, tool-bar):
+	Use `default' instead of t for setting the defaults.
+	(face-spec-choose): Separate `t' from `default'.
+
+	* subr.el (while-no-input): New macro.
+
+2004-12-13  Frederik Fouvry  <fouvry@CoLi.Uni-SB.DE>  (tiny change)
+
+	* filecache.el (file-cache-add-directory-using-find):
+	Only test file-cache-find-command-posix-flag on some systems.
+
+2004-12-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* vc-svn.el (vc-svn-repository-hostname): Adjust to new format.
+	Reported by Ville Skytt,Ad(B <scop@xemacs.org>.
+	(vc-svn-annotate-current-time, vc-svn-annotate-time-of-rev)
+	(vc-svn-annotate-time, vc-svn-annotate-extract-revision-at-line)
+	(vc-svn-annotate-command, vc-svn-annotate-re): Support for svn annotate.
+
+2004-12-12  Juri Linkov  <juri@jurta.org>
+
+	* files.el (find-file-other-window, find-file-other-frame):
+	Add the first buffer to the returned value to return the complete
+	list of all visited buffers.
+	(find-file-read-only, find-file-read-only-other-window)
+	(find-file-read-only-other-frame): Use nil for `mustmatch' arg of
+	`find-file-read-args'.  Signal an error about non-existent file
+	only if file name doesn't contain wildcards.  Toggle read-only in
+	all visited buffers.
+	(find-alternate-file, find-alternate-file-other-window):
+	Add optional arg `wildcards'.  Doc fix.  Set `wildcards' to t when
+	called interactively.  Pass arg `wildcards' to other functions.
+	(find-file-noselect): Doc fix.
+
+	* ffap.el (ffap-dired-wildcards): Set default to "[*?][^/]*\\'".
+	Doc fix.
+	(ffap-directory-finder): New variable.
+	(ffap-string-at-point-mode-alist): Add * and ? to `file'.
+	(ffap-file-at-point): Add /* to immediately rejected names.
+	Return absolute file names matching ffap-dired-wildcards.
+	(ffap-read-file-or-url): Set default value for `completing-read'
+	to `buffer-file-name'.
+	(find-file-at-point): When filename matches ffap-dired-wildcards,
+	call ffap-file-finder with t arg `wildcards', instead of dired.
+	(ffap-other-window, ffap-other-frame): Return visited buffers.
+	(ffap-read-only, ffap-read-only-other-window)
+	(ffap-read-only-other-frame, ffap-alternate-file): New commands.
+	(dired-at-point): Call ffap-directory-finder instead of dired.
+	(ffap-dired-other-window, ffap-dired-other-frame)
+	(ffap-list-directory): New commands.
+	(ffap-bindings): New keybindings for new commands.
+
+2004-12-12  Juri Linkov  <juri@jurta.org>
+
+	* simple.el (beginning-of-buffer, end-of-buffer):
+	* emacs-lisp/lisp.el (beginning-of-defun, end-of-defun):
+	Do not push mark when mark is active in transient-mark-mode.
+
+	* simple.el (mark-word):
+	* emacs-lisp/lisp.el (mark-sexp, mark-defun):
+	* textmodes/paragraphs.el (mark-paragraph):
+	Extend the region when mark is active in transient-mark-mode,
+	regardless of the last command.  Doc fix.
+
+	* simple.el (mark-word): Preserve direction when repeating.
+	Make arg optional.  Interactive "p" -> "P".
+	(transient-mark-mode, inhibit-mark-movement): Doc fix.
+
+	* emacs-lisp/lisp.el (mark-sexp): Reverse the condition for
+	preserving direction, to mark forward instead of backward when mark
+	is equal to point (e.g. when C-SPC C-M-SPC is typed in t-m-m).
+
+2004-12-12  Juri Linkov  <juri@jurta.org>
+
+	* isearch.el (isearch-edit-string): Set 7th arg of
+	`read-from-minibuffer' to `t' to inherit the current input
+	method (whose name is indicated by [IM] in the minibuffer prompt)
+	from the current buffer to the minibuffer.
+	(isearch-lazy-highlight-update): Put body to `with-local-quit'
+	to allow C-g quitting for lazy highlighting looping inside the
+	search with nested repetition operators.  Add overlay to the list
+	before setting its face and other properties to avoid the case of
+	code quitting after placing the new overlay but before it's
+	recorded on the list.  Select the window where isearch was
+	activated, to highlight matches in the right window when isearch
+	switches the current window to the minibuffer.
+
+	* international/isearch-x.el
+	(isearch-process-search-multibyte-characters):
+	Use `isearch-message' as initial input for `read-string' instead
+	of adding it to the minibuffer prompt.  After reading a string
+	remove the initial value of `isearch-message' from the string.
+
+	* replace.el (replace-match-maybe-edit): Doc fix.
+	(perform-replace): Don't call `replace-highlight' when automatic
+	replacement is requested in literal mode, since it is intended
+	only to highlight words during entering a new replacement string
+	for \? in non-literal mode.
+
+	* replace.el (query-replace-highlight): Add new value `isearch'
+	that allows query replacement to use isearch highlighting.
+	Change type from `boolean' to `choice'.  Doc fix.
+	(replace-highlight, replace-dehighlight, perform-replace):
+	Use isearch highlighting if query-replace-highlight eq `isearch'.
+
+2004-12-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* emacs-lisp/checkdoc.el (checkdoc-continue, checkdoc-comments)
+	(checkdoc-message-text, checkdoc-defun): Fix format messages for `error'.
+
+	* textmodes/tex-mode.el (latex-backward-sexp-1): Handle the special
+	case of \end{verbatim}.
+
+2004-12-11  Dan Nicolaescu  <dann@ics.uci.edu>
+
+	* term.el (term-termcap-format): Synchronyze with terminfo.
+	(term-emulate-terminal): Handle reset.
+	(term-reset-terminal): New function.
+
+2004-12-11  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* play/zone.el (zone-programs): Add `zone-pgm-random-life'.
+	(zone-fill-out-screen): New func.
+	(zone-pgm-drip): Use `zone-fill-out-screen'.
+	Also, no longer go to point-min on every cycle.
+	(zone-pgm-paragraph-spaz): Allow spazzing for texinfo-mode.
+	(zone-pgm-random-life-wait): New user var.
+	(zone-pgm-random-life): New func.
+
+2004-12-10  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* files.el (auto-mode-alist): Map .com to DCL mode.
+
+2004-12-09  Richard M. Stallman  <rms@gnu.org>
+
+	* isearch.el (isearch-mode-map): Treat S-SPC like SPC.
+
+2004-12-09  Nick Roberts  <nickrob@snap.net.nz>
+
+	* xt-mouse.el (xterm-mouse-event): Correct cursor position in a
+	buffer with a display margin.
+
+2004-12-08  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc-keypd.el (calc-keypad-mode): Unbind unused mouse events.
+	(calc-keypad-left-click): Set buffer to calc-keymap-buffer.
+
+2004-12-08  Richard M. Stallman  <rms@gnu.org>
+
+	* faces.el: Delete code to set display table.
+	(escape-glyph): Redefine to be less loud.  (Copy minibuffer-prompt.)
+
+2004-12-08  Jay Belanger  <belanger@truman.edu>
+
+	* calc/calc.el: Add math-read-preprocess-string to autoloads.
+
+	* calc/calc-ext.el (math-read-replacement-list)
+	(math-read-superscripts, math-read-preprocess-string): Move to
+	calc-aent.el.
+
+	* calc/calc-aent.el (math-read-replacement-list)
+	(math-read-superscripts, math-read-preprocess-string): Move from
+	calc-ext.el.
+
 2004-12-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* isearch.el (isearch-quote-char): Fix up typo in last change.
@@ -10,10 +214,9 @@
 	* edmacro.el: `edit-kbd-macro' is now bound to `C-x C-k e'.
 	(edmacro-finish-edit): Further update for keyboard macros that are
 	lambda forms.
-	(edmacro-sanitize-for-string): Correctly remove Meta modifier
-	(as suggested by Kim Storm).
-
-2004-12-06  Stefan Monnier  <monnier@iro.umontreal.ca>
+	(edmacro-sanitize-for-string): Correctly remove Meta modifier.
+
+2004-12-07  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* font-lock.el (font-lock-unfontify-region): Save buffer state.
 	(font-lock-default-unfontify-region): Don't save buffer state any more.
@@ -7853,7 +8056,115 @@
 	(compilation-forget-errors): Don't localize already local
 	compilation-locs and remove FIXME about refontifying.
 
-2004-04-14
+2004-04-14  Kim F. Storm  <storm@cua.dk>
+
+	* startup.el (emacs-quick-startup): New defvar (set by -Q).
+	(command-line): New option -Q.  Like -q --no-site-file, but
+	in addition it also disables menu-bar, tool-bar, scroll-bars,
+	tool-tips, and the blinking cursor.
+	(command-line-1): Skip startup screen if -Q.
+	(fancy-splash-head): Use ":align-to center" prop to center splash image.
+
+	* emulation/cua-base.el (cua-read-only-cursor-color)
+	(cua-overwrite-cursor-color, cua-global-mark-cursor-color): Doc fix.
+
+2004-04-13  Dave Love  <fx@gnu.org>
+
+	* progmodes/python.el: Doc fixes.  Changes for compiler warnings.
+	(syntax): Don't require.
+	(python) <defgroup>: Add :version.
+	(python-quote-syntax): Re-written.
+	(inferior-python-mode): Move stuff here from run-python and add
+	some more.
+	(python-preoutput-continuation, python-preoutput-result)
+	(python-dotty-syntax-table): New.
+	(python-describe-symbol): Use them.
+	(run-python): Move stuff to inferior-python-mode.  Modify code
+	loaded into Python.
+	(python-send-region): Use python-proc, python-send-string.
+	(python-send-string): Send newlines too.  Callers changed.
+	(python-load-file): Re-written.
+	(python-eldoc-function): New.
+	(info-look): Don't require.
+	(python-after-info-look): New.  A modified version of former
+	top-level code for use with eval-after-load.
+	(python-maybe-jython, python-guess-indent): Use widened buffer.
+	(python-fill-paragraph): Re-written.
+	(python-mode): Fix outline-regexp.  Set outline-heading-end-regexp,
+	eldoc-print-current-symbol-info-function.  Add to eldoc-mode-hook.
+
+2004-04-13  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/python.el (run-python): Use compilation-shell-minor-mode.
+	Set compilation-error-regexp-alist earlier.
+
+	* progmodes/compile.el (compilation-minor-mode-map)
+	(compilation-shell-minor-mode-map, compile-mouse-goto-error)
+	(compile-goto-error): Re-merge the mouse and non-mouse commands.
+
+2004-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/compile.el (compile-goto-error): Select the buffer/window
+	corresponding to the event.
+
+2004-04-12  Joe Buehler  <jbuehler@hekiman.com>
+
+	* loadup.el: Add cygwin to system-type list, for unexec() support.
+
+2004-04-12  John Paul Wallington  <jpw@gnu.org>
+
+	* ibuffer.el (ibuffer-delete-window-on-quit): Remove.
+	(ibuffer-restore-window-config-on-quit): New variable to replace
+	`ibuffer-delete-window-on-quit'.  Update all references.
+	(ibuffer-prev-window-config): New variable.
+	(ibuffer-quit): Restore previous window configuration instead of
+	deleting window.
+	(ibuffer): Save window configuration before showing Ibuffer buffer.
+
+	* help.el (describe-mode): Doc fix.
+
+2004-04-12  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* progmodes/compile.el (compilation-mode-font-lock-keywords): Fix test
+	not to treat nil as a function.
+
+	* vc-arch.el (vc-arch-root): Be a bit more careful.
+	(vc-arch-register): Save the buffer if we modified it.
+	(vc-arch-delete-rej-if-obsolete): Save excursion.
+	(vc-arch-find-file-hook): Use the simpler after-save-hook.
+	(vc-arch-responsible-p, vc-arch-init-version): New functions.
+
+	* net/ldap.el (ldap-search): Use list*.
+
+2004-04-12  Juri Linkov  <juri@jurta.org>
+
+	* info.el (Info-follow-reference): Allow multiline reference name.
+
+2004-04-11  Dave Love  <fx@gnu.org>
+
+	* emacs-lisp/bytecomp.el (byte-compile-cond): Fix last change.
+
+	* progmodes/python.el: New file.
+
+2004-04-11  Andre Spiegel  <spiegel@gnu.org>
+
+	* vc-hooks.el (vc-arg-list): Function removed.
+	(vc-default-workfile-unchanged-p): Use condition-case to check for
+	backward compatibility.
+
+	* vc.el (vc-print-log): Use condition-case to check for backward
+	compatibility.
+
+2004-04-11  Juri Linkov  <juri@jurta.org>
+
+	* dired.el (dired-faces): New defgroup.
+	(dired-header, dired-mark, dired-marked, dired-flagged)
+	(dired-warning, dired-directory, dired-symlink, dired-ignored):
+	New faces.
+	(dired-header-face, dired-mark-face, dired-marked-face)
+	(dired-flagged-face, dired-warning-face, dired-directory-face)
+	(dired-symlink-face, dired-ignored-face): New face variables.
+	(dired-font-lock-keywords): Use them instead of font-lock faces.
 	Split the rule for dired marks into 3 separate rules: for marks,
 	marked file names and flagged file names.
 
--- a/lisp/bindings.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/bindings.el	Tue Dec 14 07:34:55 2004 +0000
@@ -448,7 +448,6 @@
 (let ((map (make-sparse-keymap)))
   ;; Bind down- events so that the global keymap won't ``shine
   ;; through''.
-  (define-key map [mode-line down-mouse-1] 'ignore)
   (define-key map [mode-line mouse-1] 'mode-line-unbury-buffer)
   (define-key map [header-line down-mouse-1] 'ignore)
   (define-key map [header-line mouse-1] 'mode-line-unbury-buffer)
--- a/lisp/buff-menu.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/buff-menu.el	Tue Dec 14 07:34:55 2004 +0000
@@ -484,14 +484,19 @@
   "Make the other window select this line's buffer.
 The current window remains selected."
   (interactive)
-  (display-buffer (Buffer-menu-buffer t)))
+  (let ((pop-up-windows t)
+	same-window-buffer-names
+	same-window-regexps)
+    (display-buffer (Buffer-menu-buffer t))))
 
 (defun Buffer-menu-2-window ()
   "Select this line's buffer, with previous buffer in second window."
   (interactive)
   (let ((buff (Buffer-menu-buffer t))
 	(menu (current-buffer))
-	(pop-up-windows t))
+	(pop-up-windows t)
+	same-window-buffer-names
+	same-window-regexps)
     (delete-other-windows)
     (switch-to-buffer (other-buffer))
     (pop-to-buffer buff)
@@ -671,8 +676,7 @@
       ;; line with the beginning of the text (rather than with the left
       ;; scrollbar or the left fringe).  –-Stef
       (setq header (concat (propertize " " 'display '(space :align-to 0))
-			   header))
-      )
+			   header)))
     (with-current-buffer (get-buffer-create "*Buffer List*")
       (setq buffer-read-only nil)
       (erase-buffer)
@@ -684,47 +688,45 @@
 			 (mapcar (lambda (c)
 				   (if (memq c '(?\n ?\ )) c underline))
 				 header)))))
-      (if buffer-list
-	  (setq list buffer-list)
-	;; Collect info for every buffer we're interested in.
-	(dolist (buffer (buffer-list))
-	  (with-current-buffer buffer
-	    (let ((name (buffer-name))
-		  (file buffer-file-name))
-	      (cond
-	       ;; Don't mention internal buffers.
-	       ((and (string= (substring name 0 1) " ") (null file)))
-	       ;; Maybe don't mention buffers without files.
-	       ((and files-only (not file)))
-	       ((string= name "*Buffer List*"))
-	       ;; Otherwise output info.
-	       (t
-		(let ((mode (concat (format-mode-line mode-name nil nil buffer)
-				    (if mode-line-process
-					(format-mode-line mode-line-process
-							  nil nil buffer))))
-		      (bits (string
-			     (if (eq buffer old-buffer) ?. ?\ )
-			     ;; Handle readonly status.  The output buffer
-			     ;; is special cased to appear readonly; it is
-			     ;; actually made so at a later date.
-			     (if (or (eq buffer standard-output)
-				     buffer-read-only)
-				 ?% ?\ )
-			     ;; Identify modified buffers.
-			     (if (buffer-modified-p) ?* ?\ )
-			     ;; Space separator.
-			     ?\ )))
-		  (unless file
-		    ;; No visited file.  Check local value of
-		    ;; list-buffers-directory.
-		    (when (and (boundp 'list-buffers-directory)
-			       list-buffers-directory)
-		      (setq file list-buffers-directory)))
-		  (push (list buffer bits name (buffer-size) mode file)
-			list)))))))
-	;; Preserve the original buffer-list ordering, just in case.
-	(setq list (nreverse list)))
+      ;; Collect info for every buffer we're interested in.
+      (dolist (buffer (or buffer-list (buffer-list)))
+	(with-current-buffer buffer
+	  (let ((name (buffer-name))
+		(file buffer-file-name))
+	    (unless (and (not buffer-list)
+			 (or
+			  ;; Don't mention internal buffers.
+			  (and (string= (substring name 0 1) " ") (null file))
+			  ;; Maybe don't mention buffers without files.
+			  (and files-only (not file))
+			  (string= name "*Buffer List*")))
+	      ;; Otherwise output info.
+	      (let ((mode (concat (format-mode-line mode-name nil nil buffer)
+				  (if mode-line-process
+				      (format-mode-line mode-line-process
+							nil nil buffer))))
+		    (bits (string
+			   (if (eq buffer old-buffer) ?. ?\ )
+			   ;; Handle readonly status.  The output buffer
+			   ;; is special cased to appear readonly; it is
+			   ;; actually made so at a later date.
+			   (if (or (eq buffer standard-output)
+				   buffer-read-only)
+			       ?% ?\ )
+			   ;; Identify modified buffers.
+			   (if (buffer-modified-p) ?* ?\ )
+			   ;; Space separator.
+			   ?\ )))
+		(unless file
+		  ;; No visited file.  Check local value of
+		  ;; list-buffers-directory.
+		  (when (and (boundp 'list-buffers-directory)
+			     list-buffers-directory)
+		    (setq file list-buffers-directory)))
+		(push (list buffer bits name (buffer-size) mode file)
+		      list))))))
+      ;; Preserve the original buffer-list ordering, just in case.
+      (setq list (nreverse list))
       ;; Place the buffers's info in the output buffer, sorted if necessary.
       (dolist (buffer
 	       (if Buffer-menu-sort-column
--- a/lisp/calc/calc-aent.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/calc/calc-aent.el	Tue Dec 14 07:34:55 2004 +0000
@@ -465,6 +465,73 @@
 
 ;;; Algebraic expression parsing.   [Public]
 
+(defvar math-read-replacement-list
+  '(;; Misc symbols
+    ("±" "+/-")  ; plus or minus
+    ("×" "*")    ; multiplication sign
+    ("÷" ":")    ; division sign
+    ("−" "-")    ; subtraction sign
+    ("∕" "/")    ; division sign
+    ("∗" "*")    ; asterisk multiplication
+    ("∞" "inf")  ; infinity symbol
+    ("≤" "<=")
+    ("≥" ">=")
+    ("≦" "<=")
+    ("≧" ">=")
+    ;; fractions
+    ("¼" "(1:4)") ; 1/4
+    ("½" "(1:2)") ; 1/2
+    ("¾" "(3:4)") ; 3/4
+    ("⅓" "(1:3)") ; 1/3
+    ("⅔" "(2:3)") ; 2/3
+    ("⅕" "(1:5)") ; 1/5
+    ("⅖" "(2:5)") ; 2/5
+    ("⅗" "(3:5)") ; 3/5
+    ("⅘" "(4:5)") ; 4/5
+    ("⅙" "(1:6)") ; 1/6
+    ("⅚" "(5:6)") ; 5/6
+    ("⅛" "(1:8)") ; 1/8
+    ("⅜" "(3:8)") ; 3/8
+    ("⅝" "(5:8)") ; 5/8
+    ("⅞" "(7:8)") ; 7/8
+    ("⅟" "1:")    ; 1/...
+    ;; superscripts
+    ("⁰" "0")  ; 0
+    ("¹" "1")  ; 1
+    ("²" "2")  ; 2
+    ("³" "3")  ; 3
+    ("⁴" "4")  ; 4
+    ("⁵" "5")  ; 5
+    ("⁶" "6")  ; 6
+    ("⁷" "7")  ; 7
+    ("⁸" "8")  ; 8
+    ("⁹" "9")  ; 9
+    ("⁺" "+")  ; +
+    ("⁻" "-")  ; -
+    ("⁽" "(")  ; (
+    ("⁾" ")")  ; )
+    ("ⁿ" "n")  ; n
+    ("ⁱ" "i")) ; i
+  "A list whose elements (old new) indicate replacements to make
+in Calc algebraic input.")
+
+(defvar math-read-superscripts
+  "⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ" ; 0123456789+-()ni
+  "A string consisting of the superscripts allowed by Calc.")
+
+(defun math-read-preprocess-string (str)
+  "Replace some substrings of STR by Calc equivalents."
+  (setq str
+        (replace-regexp-in-string (concat "[" math-read-superscripts "]+")
+                                  "^(\\&)" str))
+  (let ((rep-list math-read-replacement-list))
+    (while rep-list
+      (setq str
+            (replace-regexp-in-string (nth 0 (car rep-list))
+                                      (nth 1 (car rep-list)) str))
+      (setq rep-list (cdr rep-list))))
+  str)
+
 ;; The next few variables are local to math-read-exprs (and math-read-expr
 ;; in calc-ext.el), but are set in functions they call.
 
--- a/lisp/calc/calc-ext.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/calc/calc-ext.el	Tue Dec 14 07:34:55 2004 +0000
@@ -2874,73 +2874,6 @@
 
 (defvar math-expr-data)
 
-(defvar math-read-replacement-list
-  '(;; Misc symbols
-    ("±" "+/-")  ; plus or minus
-    ("×" "*")    ; multiplication sign
-    ("÷" ":")    ; division sign
-    ("−" "-")    ; subtraction sign
-    ("∕" "/")    ; division sign
-    ("∗" "*")    ; asterisk multiplication
-    ("∞" "inf")  ; infinity symbol
-    ("≤" "<=")
-    ("≥" ">=")
-    ("≦" "<=")
-    ("≧" ">=")
-    ;; fractions
-    ("¼" "(1:4)") ; 1/4
-    ("½" "(1:2)") ; 1/2
-    ("¾" "(3:4)") ; 3/4
-    ("⅓" "(1:3)") ; 1/3
-    ("⅔" "(2:3)") ; 2/3
-    ("⅕" "(1:5)") ; 1/5
-    ("⅖" "(2:5)") ; 2/5
-    ("⅗" "(3:5)") ; 3/5
-    ("⅘" "(4:5)") ; 4/5
-    ("⅙" "(1:6)") ; 1/6
-    ("⅚" "(5:6)") ; 5/6
-    ("⅛" "(1:8)") ; 1/8
-    ("⅜" "(3:8)") ; 3/8
-    ("⅝" "(5:8)") ; 5/8
-    ("⅞" "(7:8)") ; 7/8
-    ("⅟" "1:")    ; 1/...
-    ;; superscripts
-    ("⁰" "0")  ; 0
-    ("¹" "1")  ; 1
-    ("²" "2")  ; 2
-    ("³" "3")  ; 3
-    ("⁴" "4")  ; 4
-    ("⁵" "5")  ; 5
-    ("⁶" "6")  ; 6
-    ("⁷" "7")  ; 7
-    ("⁸" "8")  ; 8
-    ("⁹" "9")  ; 9
-    ("⁺" "+")  ; +
-    ("⁻" "-")  ; -
-    ("⁽" "(")  ; (
-    ("⁾" ")")  ; )
-    ("ⁿ" "n")  ; n
-    ("ⁱ" "i")) ; i
-  "A list whose elements (old new) indicate replacements to make
-in Calc algebraic input.")
-
-(defvar math-read-superscripts
-  "⁰¹²³⁴⁵⁶⁷⁸⁹⁺⁻⁽⁾ⁿⁱ" ; 0123456789+-()ni
-  "A string consisting of the superscripts allowed by Calc.")
-
-(defun math-read-preprocess-string (str)
-  "Replace some substrings of STR by Calc equivalents."
-  (setq str
-        (replace-regexp-in-string (concat "[" math-read-superscripts "]+")
-                                  "^(\\&)" str))
-  (let ((rep-list math-read-replacement-list))
-    (while rep-list
-      (setq str
-            (replace-regexp-in-string (nth 0 (car rep-list))
-                                      (nth 1 (car rep-list)) str))
-      (setq rep-list (cdr rep-list))))
-  str)
-
 (defun math-read-expr (math-exp-str)
   (let ((math-exp-pos 0)
 	(math-exp-old-pos 0)
--- a/lisp/calc/calc-keypd.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/calc/calc-keypd.el	Tue Dec 14 07:34:55 2004 +0000
@@ -236,9 +236,21 @@
   (define-key calc-keypad-mode-map (kbd "RET") 'calc-keypad-press)
   (define-key calc-keypad-mode-map (kbd "TAB") 'calc-keypad-menu)
   (define-key calc-keypad-mode-map "q" 'calc-keypad-off)
-  (define-key calc-keypad-mode-map [(mouse-3)] 'calc-keypad-right-click)
-  (define-key calc-keypad-mode-map [(mouse-2)] 'calc-keypad-middle-click)
-  (define-key calc-keypad-mode-map [(mouse-1)] 'calc-keypad-left-click)
+  (define-key calc-keypad-mode-map [down-mouse-1] 'ignore)
+  (define-key calc-keypad-mode-map [drag-mouse-1] 'ignore)
+  (define-key calc-keypad-mode-map [double-mouse-1] 'ignore)
+  (define-key calc-keypad-mode-map [triple-mouse-1] 'ignore)
+  (define-key calc-keypad-mode-map [down-mouse-2] 'ignore)
+  (define-key calc-keypad-mode-map [drag-mouse-2] 'ignore)
+  (define-key calc-keypad-mode-map [double-mouse-2] 'ignore)
+  (define-key calc-keypad-mode-map [triple-mouse-2] 'ignore)
+  (define-key calc-keypad-mode-map [down-mouse-3] 'ignore)
+  (define-key calc-keypad-mode-map [drag-mouse-3] 'ignore)
+  (define-key calc-keypad-mode-map [double-mouse-3] 'ignore)
+  (define-key calc-keypad-mode-map [triple-mouse-3] 'ignore)
+  (define-key calc-keypad-mode-map [mouse-3] 'calc-keypad-right-click)
+  (define-key calc-keypad-mode-map [mouse-2] 'calc-keypad-middle-click)
+  (define-key calc-keypad-mode-map [mouse-1] 'calc-keypad-left-click)
   (put 'calc-keypad-mode 'mode-class 'special)
   (make-local-variable 'calc-main-buffer))
 
@@ -529,8 +541,9 @@
 (defun calc-keypad-left-click (event)
   "Handle a left-button mouse click in Calc Keypad window."
   (interactive "e")
-  (goto-char (posn-point (event-start event)))
-  (calc-keypad-press))
+  (with-current-buffer calc-keypad-buffer
+    (goto-char (posn-point (event-start event)))
+    (calc-keypad-press)))
 
 (defun calc-keypad-right-click (event)
   "Handle a right-button mouse click in Calc Keypad window."
--- a/lisp/calc/calc.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/calc/calc.el	Tue Dec 14 07:34:55 2004 +0000
@@ -890,7 +890,7 @@
     calc-check-user-syntax calc-do-alg-entry calc-do-calc-eval
     calc-do-quick-calc calc-match-user-syntax math-build-parse-table
     math-find-user-tokens math-read-expr-list math-read-exprs math-read-if
-    math-read-token math-remove-dashes)
+    math-read-token math-remove-dashes math-read-preprocess-string)
 
  ("calc-embed" calc-do-embedded-activate)
 
--- a/lisp/cus-edit.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/cus-edit.el	Tue Dec 14 07:34:55 2004 +0000
@@ -1561,9 +1561,9 @@
   :group 'custom-magic-faces)
 
 (defface custom-set-face '((((class color))
-				(:foreground "blue" :background "white"))
-			       (t
-				(:slant italic)))
+			    (:foreground "blue" :background "white"))
+			   (t
+			    (:slant italic)))
   "Face used when the customize item has been set."
   :group 'custom-magic-faces)
 
@@ -1578,31 +1578,32 @@
   "Face used when the customize item has been saved."
   :group 'custom-magic-faces)
 
-(defconst custom-magic-alist '((nil "#" underline "\
+(defconst custom-magic-alist
+  '((nil "#" underline "\
 uninitialized, you should not see this.")
-			       (unknown "?" italic "\
+    (unknown "?" italic "\
 unknown, you should not see this.")
-			       (hidden "-" default "\
+    (hidden "-" default "\
 hidden, invoke \"Show\" in the previous line to show." "\
 group now hidden, invoke \"Show\", above, to show contents.")
-			       (invalid "x" custom-invalid-face "\
+    (invalid "x" custom-invalid-face "\
 the value displayed for this %c is invalid and cannot be set.")
-			       (modified "*" custom-modified-face "\
+    (modified "*" custom-modified-face "\
 you have edited the value as text, but you have not set the %c." "\
 you have edited something in this group, but not set it.")
-			       (set "+" custom-set-face "\
+    (set "+" custom-set-face "\
 you have set this %c, but not saved it for future sessions." "\
 something in this group has been set, but not saved.")
-			       (changed ":" custom-changed-face "\
+    (changed ":" custom-changed-face "\
 this %c has been changed outside the customize buffer." "\
 something in this group has been changed outside customize.")
-			       (saved "!" custom-saved-face "\
+    (saved "!" custom-saved-face "\
 this %c has been set and saved." "\
 something in this group has been set and saved.")
-			       (rogue "@" custom-rogue-face "\
+    (rogue "@" custom-rogue-face "\
 this %c has not been changed with customize." "\
 something in this group is not prepared for customization.")
-			       (standard " " nil "\
+    (standard " " nil "\
 this %c is unchanged from its standard setting." "\
 visible group members are all at standard settings."))
   "Alist of customize option states.
@@ -2576,7 +2577,7 @@
   "Edit face attributes."
   :format "%t: %v"
   :tag "Attributes"
-  :extra-offset 12
+  :extra-offset 13
   :button-args '(:help-echo "Control whether this attribute has any effect.")
   :value-to-internal 'custom-face-edit-fix-value
   :match (lambda (widget value)
@@ -2689,6 +2690,7 @@
   :value t
   :help-echo "Specify frames where the face attributes should be used."
   :args '((const :tag "all" t)
+	  (const :tag "defaults" default)
 	  (checklist
 	   :offset 0
 	   :extra-offset 9
@@ -2817,13 +2819,29 @@
 
 (define-widget 'custom-face-selected 'group
   "Edit the attributes of the selected display in a face specification."
-  :args '((repeat :format ""
-		  :inline t
-		  (group custom-display-unselected sexp))
-	  (group (sexp :format "") custom-face-edit)
-	  (repeat :format ""
-		  :inline t
-		  sexp)))
+  :args '((choice :inline t
+		  (group :tag "With Defaults" :inline t
+		   (group (const :tag "" default)
+			  (custom-face-edit :tag " Default\n Attributes"))
+		   (repeat :format ""
+			   :inline t
+			   (group custom-display-unselected sexp))
+		   (group (sexp :format "")
+			  (custom-face-edit :tag " Overriding\n Attributes"))
+		   (repeat :format ""
+			   :inline t
+			   sexp))
+		  (group :tag "No Defaults" :inline t
+			 (repeat :format ""
+				 :inline t
+				 (group custom-display-unselected sexp))
+			 (group (sexp :format "")
+				(custom-face-edit :tag "\n Attributes"))
+			 (repeat :format ""
+				 :inline t
+				 sexp)))))
+
+
 
 (defconst custom-face-selected (widget-convert 'custom-face-selected)
   "Converted version of the `custom-face-selected' widget.")
--- a/lisp/emacs-lisp/checkdoc.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/emacs-lisp/checkdoc.el	Tue Dec 14 07:34:55 2004 +0000
@@ -919,7 +919,7 @@
 	(progn
 	  (goto-char wrong)
 	  (if (not take-notes)
-	      (error (checkdoc-error-text msg)))))
+	      (error "%s" (checkdoc-error-text msg)))))
     (checkdoc-show-diagnostics)
     (if (interactive-p)
 	(message "No style warnings."))))
@@ -952,7 +952,7 @@
 	 (e (checkdoc-file-comments-engine))
 	(checkdoc-generate-compile-warnings-flag
 	 (or take-notes checkdoc-generate-compile-warnings-flag)))
-    (if e (error (checkdoc-error-text e)))
+    (if e (error "%s" (checkdoc-error-text e)))
     (checkdoc-show-diagnostics)
     e))
 
@@ -990,7 +990,7 @@
     (if (not (interactive-p))
 	e
       (if e
-	  (error (checkdoc-error-text e))
+	  (error "%s" (checkdoc-error-text e))
 	(checkdoc-show-diagnostics)))
     (goto-char p))
   (if (interactive-p) (message "Checking interactive message text...done.")))
@@ -1033,15 +1033,15 @@
 	     (msg (checkdoc-this-string-valid)))
 	(if msg (if no-error
 		    (message (checkdoc-error-text msg))
-		  (error (checkdoc-error-text msg)))
+		  (error "%s" (checkdoc-error-text msg)))
 	  (setq msg (checkdoc-message-text-search beg end))
 	  (if msg (if no-error
 		      (message (checkdoc-error-text msg))
-		    (error (checkdoc-error-text msg)))
+		    (error "%s" (checkdoc-error-text msg)))
 	    (setq msg (checkdoc-rogue-space-check-engine beg end))
 	    (if msg (if no-error
 			(message (checkdoc-error-text msg))
-		      (error (checkdoc-error-text msg))))))
+		      (error "%s" (checkdoc-error-text msg))))))
 	(if (interactive-p) (message "Checkdoc: done."))))))
 
 ;;; Ispell interface for forcing a spell check
--- a/lisp/emacs-lisp/elint.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/emacs-lisp/elint.el	Tue Dec 14 07:34:55 2004 +0000
@@ -50,6 +50,85 @@
   "*The buffer to insert lint messages in.")
 
 ;;;
+;;; Data
+;;;
+
+(defconst elint-standard-variables
+  '(abbrev-mode auto-fill-function buffer-auto-save-file-name
+     buffer-backed-up buffer-display-count buffer-display-table buffer-display-time buffer-file-coding-system buffer-file-format
+     buffer-file-name buffer-file-number buffer-file-truename
+     buffer-file-type buffer-invisibility-spec buffer-offer-save
+     buffer-read-only buffer-saved-size buffer-undo-list
+     cache-long-line-scans case-fold-search ctl-arrow cursor-type comment-column
+     default-directory defun-prompt-regexp desktop-save-buffer enable-multibyte-characters fill-column fringes-outside-margins goal-column
+     header-line-format indicate-buffer-boundaries indicate-empty-lines
+     left-fringe-width
+     left-margin left-margin-width line-spacing local-abbrev-table local-write-file-hooks major-mode
+     mark-active mark-ring mode-line-buffer-identification
+     mode-line-format mode-line-modified mode-line-process mode-name
+     overwrite-mode 
+     point-before-scroll right-fringe-width right-margin-width
+     scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display
+     selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar)
+  "Standard buffer local vars.")
+
+(defconst elint-unknown-builtin-args
+  '((while test &rest forms)
+    (insert-before-markers-and-inherit &rest text)
+    (catch tag &rest body)
+    (and &rest args)
+    (funcall func &rest args)
+    (insert &rest args)
+    (vconcat &rest args)
+    (run-hook-with-args hook &rest args)
+    (message-or-box string &rest args)
+    (save-window-excursion &rest body)
+    (append &rest args)
+    (logior &rest args)
+    (progn &rest body)
+    (insert-and-inherit &rest args)
+    (message-box string &rest args)
+    (prog2 x y &rest body)
+    (prog1 first &rest body)
+    (insert-before-markers &rest args)
+    (call-process-region start end program &optional delete
+			 destination display &rest args)
+    (concat &rest args)
+    (vector &rest args)
+    (run-hook-with-args-until-success hook &rest args)
+    (track-mouse &rest body)
+    (unwind-protect bodyform &rest unwindforms)
+    (save-restriction &rest body)
+    (quote arg)
+    (make-byte-code &rest args)
+    (or &rest args)
+    (cond &rest clauses)
+    (start-process name buffer program &rest args)
+    (run-hook-with-args-until-failure hook &rest args)
+    (if cond then &rest else)
+    (apply function &rest args)
+    (format string &rest args)
+    (encode-time second minute hour day month year zone &rest args)
+    (min &rest args)
+    (logand &rest args)
+    (logxor &rest args)
+    (max &rest args)
+    (list &rest args)
+    (message string &rest args)
+    (defvar symbol init doc)
+    (call-process program &optional infile destination display &rest args)
+    (with-output-to-temp-buffer bufname &rest body)
+    (nconc &rest args)
+    (save-excursion &rest body)
+    (run-hooks &rest hooks)
+    (/ x y &rest zs)
+    (- x &rest y)
+    (+ &rest args)
+    (* &rest args)
+    (interactive &optional args))
+  "Those built-ins for which we can't find arguments.")
+
+;;;
 ;;; ADT: top-form
 ;;;
 
@@ -724,85 +803,6 @@
 	    (if list list
 	      (elint-find-builtins))))
 
-;;;
-;;; Data
-;;;
-
-(defconst elint-standard-variables
-  '(abbrev-mode auto-fill-function buffer-auto-save-file-name
-     buffer-backed-up buffer-display-count buffer-display-table buffer-display-time buffer-file-coding-system buffer-file-format
-     buffer-file-name buffer-file-number buffer-file-truename
-     buffer-file-type buffer-invisibility-spec buffer-offer-save
-     buffer-read-only buffer-saved-size buffer-undo-list
-     cache-long-line-scans case-fold-search ctl-arrow cursor-type comment-column
-     default-directory defun-prompt-regexp desktop-save-buffer enable-multibyte-characters fill-column fringes-outside-margins goal-column
-     header-line-format indicate-buffer-boundaries indicate-empty-lines
-     left-fringe-width
-     left-margin left-margin-width line-spacing local-abbrev-table local-write-file-hooks major-mode
-     mark-active mark-ring mode-line-buffer-identification
-     mode-line-format mode-line-modified mode-line-process mode-name
-     overwrite-mode 
-     point-before-scroll right-fringe-width right-margin-width
-     scroll-bar-width scroll-down-aggressively scroll-up-aggressively selective-display
-     selective-display-ellipses tab-width truncate-lines vc-mode vertical-scroll-bar)
-  "Standard buffer local vars.")
-
-(defconst elint-unknown-builtin-args
-  '((while test &rest forms)
-    (insert-before-markers-and-inherit &rest text)
-    (catch tag &rest body)
-    (and &rest args)
-    (funcall func &rest args)
-    (insert &rest args)
-    (vconcat &rest args)
-    (run-hook-with-args hook &rest args)
-    (message-or-box string &rest args)
-    (save-window-excursion &rest body)
-    (append &rest args)
-    (logior &rest args)
-    (progn &rest body)
-    (insert-and-inherit &rest args)
-    (message-box string &rest args)
-    (prog2 x y &rest body)
-    (prog1 first &rest body)
-    (insert-before-markers &rest args)
-    (call-process-region start end program &optional delete
-			 destination display &rest args)
-    (concat &rest args)
-    (vector &rest args)
-    (run-hook-with-args-until-success hook &rest args)
-    (track-mouse &rest body)
-    (unwind-protect bodyform &rest unwindforms)
-    (save-restriction &rest body)
-    (quote arg)
-    (make-byte-code &rest args)
-    (or &rest args)
-    (cond &rest clauses)
-    (start-process name buffer program &rest args)
-    (run-hook-with-args-until-failure hook &rest args)
-    (if cond then &rest else)
-    (apply function &rest args)
-    (format string &rest args)
-    (encode-time second minute hour day month year zone &rest args)
-    (min &rest args)
-    (logand &rest args)
-    (logxor &rest args)
-    (max &rest args)
-    (list &rest args)
-    (message string &rest args)
-    (defvar symbol init doc)
-    (call-process program &optional infile destination display &rest args)
-    (with-output-to-temp-buffer bufname &rest body)
-    (nconc &rest args)
-    (save-excursion &rest body)
-    (run-hooks &rest hooks)
-    (/ x y &rest zs)
-    (- x &rest y)
-    (+ &rest args)
-    (* &rest args)
-    (interactive &optional args))
-  "Those built-ins for which we can't find arguments.")
-
 (provide 'elint)
 
 ;;; arch-tag: b2f061e2-af84-4ddc-8e39-f5e969ac228f
--- a/lisp/emacs-lisp/lisp.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/emacs-lisp/lisp.el	Tue Dec 14 07:34:55 2004 +0000
@@ -73,17 +73,18 @@
   "Set mark ARG sexps from point.
 The place mark goes is the same place \\[forward-sexp] would
 move to with the same argument.
-If this command is repeated, it marks the next ARG sexps after the ones
-already marked."
+If this command is repeated or mark is active in Transient Mark mode,
+it marks the next ARG sexps after the ones already marked."
   (interactive "P")
-  (cond ((and (eq last-command this-command) (mark t))
+  (cond ((or (and (eq last-command this-command) (mark t))
+	     (and transient-mark-mode mark-active))
 	 (setq arg (if arg (prefix-numeric-value arg)
-		     (if (> (mark) (point)) 1 -1)))
+		     (if (< (mark) (point)) -1 1)))
 	 (set-mark
 	  (save-excursion
-	   (goto-char (mark))
-	   (forward-sexp arg)
-	   (point))))
+	    (goto-char (mark))
+	    (forward-sexp arg)
+	    (point))))
 	(t
 	 (push-mark
 	  (save-excursion
@@ -191,9 +192,11 @@
 If variable `beginning-of-defun-function' is non-nil, its value
 is called as a function to find the defun's beginning."
   (interactive "p")
-  (and (eq this-command 'beginning-of-defun)
-       (or inhibit-mark-movement (eq last-command 'beginning-of-defun)
-           (push-mark)))
+  (or inhibit-mark-movement
+      (not (eq this-command 'beginning-of-defun))
+      (eq last-command 'beginning-of-defun)
+      (and transient-mark-mode mark-active)
+      (push-mark))
   (and (beginning-of-defun-raw arg)
        (progn (beginning-of-line) t)))
 
@@ -242,9 +245,11 @@
 If variable `end-of-defun-function' is non-nil, its value
 is called as a function to find the defun's end."
   (interactive "p")
-  (and (eq this-command 'end-of-defun)
-       (or inhibit-mark-movement (eq last-command 'end-of-defun)
-           (push-mark)))
+  (or inhibit-mark-movement
+      (not (eq this-command 'end-of-defun))
+      (eq last-command 'end-of-defun)
+      (and transient-mark-mode mark-active)
+      (push-mark))
   (if (or (null arg) (= arg 0)) (setq arg 1))
   (if end-of-defun-function
       (if (> arg 0)
@@ -289,10 +294,11 @@
 (defun mark-defun ()
   "Put mark at end of this defun, point at beginning.
 The defun marked is the one that contains point or follows point.
-If this command is repeated, marks more defuns after the ones
-already marked."
+If this command is repeated or mark is active in Transient Mark mode,
+it marks more defuns after the ones already marked."
   (interactive)
-  (cond ((and (eq last-command this-command) (mark t))
+  (cond ((or (and (eq last-command this-command) (mark t))
+	     (and transient-mark-mode mark-active))
 	 (set-mark
 	  (save-excursion
 	    (goto-char (mark))
--- a/lisp/faces.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/faces.el	Tue Dec 14 07:34:55 2004 +0000
@@ -1335,21 +1335,29 @@
   (unless frame
     (setq frame (selected-frame)))
   (let ((tail spec)
-	result all)
+	result defaults)
     (while tail
       (let* ((entry (pop tail))
 	     (display (car entry))
-	     (attrs (cdr entry)))
-	(when (face-spec-set-match-display display frame)
-	  (setq result (if (null (cdr attrs)) ;; was (listp (car attrs))
-			   ;; Old-style entry, the attribute list is the
-			   ;; first element.
-			   (car attrs)
-			 attrs))
-	  (if (eq display t)
-	      (setq all result result nil)
+	     (attrs (cdr entry))
+	     thisval)
+	;; Get the attributes as actually specified by this alternative.
+	(setq thisval
+	      (if (null (cdr attrs)) ;; was (listp (car attrs))
+		  ;; Old-style entry, the attribute list is the
+		  ;; first element.
+		  (car attrs)
+		attrs))
+
+	;; If the condition is `default', that sets the default
+	;; for following conditions.
+	(if (eq display 'default)
+	    (setq defaults thisval)
+	  ;; Otherwise, if it matches, use it.
+	  (when (face-spec-set-match-display display frame)
+	    (setq result thisval)
 	    (setq tail nil)))))
-    (if all (append result all) result)))
+    (if defaults (append result defaults) result)))
 
 
 (defun face-spec-reset-face (face &optional frame)
@@ -1787,7 +1795,7 @@
   :group 'basic-faces)
 
 (defface mode-line-inactive
-  '((t
+  '((default
      :inherit mode-line)
     (((type x w32 mac) (background light) (class color))
      :weight light
@@ -1807,7 +1815,7 @@
 (put 'modeline-inactive 'face-alias 'mode-line-inactive)
 
 (defface header-line
-  '((t
+  '((default
      :inherit mode-line)
     (((type tty))
      ;; This used to be `:inverse-video t', but that doesn't look very
@@ -1843,7 +1851,7 @@
 
 
 (defface tool-bar
-  '((t
+  '((default
      :box (:line-width 1 :style released-button)
      :foreground "black")
     (((type x w32 mac) (class color))
@@ -2022,32 +2030,11 @@
   :group 'font-lock			; like `show-trailing-whitespace'
   :group 'basic-faces)
 
-
-;; Make escape characters stand out in display
-
-(defface escape-glyph
-  '((t :inherit secondary-selection))
-  "Basic face for displaying \\ and ^ in multichar glyphs.
-It is also used for ... in ellipses."
+(defface escape-glyph '((((background dark)) :foreground "cyan")
+			(((type pc)) :foreground "magenta")
+			(t :foreground "dark blue"))
+  "Face for displaying \\ and ^ in multichar glyphs."
   :group 'basic-faces)
-
-(put 'display-table 'char-table-extra-slots 6)
-
-(or standard-display-table
-    ;; avoid using autoloaded make-display-table here
-    (setq standard-display-table (make-char-table 'display-table nil)))
-
-(let* ((face (lsh (face-id 'escape-glyph) 19))
-       (backslash (+ face ?\\))
-       (dot (+ face ?.)))
-  (set-char-table-extra-slot standard-display-table 2 backslash)
-  (aset standard-display-table 2208 (vector backslash ?\s))
-  (aset standard-display-table 2221 (vector backslash ?-))
-  (set-char-table-extra-slot standard-display-table 3 (+ face ?^))
-  (set-char-table-extra-slot standard-display-table 4 (vector dot dot dot)))
-
-
-
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; Manipulating font names.
--- a/lisp/ffap.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/ffap.el	Tue Dec 14 07:34:55 2004 +0000
@@ -42,10 +42,21 @@
 ;;
 ;; ffap-bindings makes the following global key bindings:
 ;;
-;; C-x C-f       find-file-at-point (abbreviated as ffap)
-;; C-x d         dired-at-point
-;; C-x 4 f       ffap-other-window
-;; C-x 5 f       ffap-other-frame
+;; C-x C-f		find-file-at-point (abbreviated as ffap)
+;; C-x C-r		ffap-read-only
+;; C-x C-v		ffap-alternate-file
+;;
+;; C-x d		dired-at-point
+;; C-x C-d		ffap-list-directory
+;;
+;; C-x 4 f		ffap-other-window
+;; C-x 4 r		ffap-read-only-other-window
+;; C-x 4 d		ffap-dired-other-window
+;;
+;; C-x 5 f		ffap-other-frame
+;; C-x 5 r		ffap-read-only-other-frame
+;; C-x 5 d		ffap-dired-other-frame
+;;
 ;; S-mouse-3     ffap-at-mouse
 ;; C-S-mouse-3   ffap-menu
 ;;
@@ -202,13 +213,17 @@
 ;; through this section for features that you like, put an appropriate
 ;; enabler in your .emacs file.
 
-(defcustom ffap-dired-wildcards nil
-  ;; Suggestion from RHOGEE, 07 Jul 1994.  Disabled, dired is still
-  ;; available by "C-x C-d <pattern>", and valid filenames may
-  ;; sometimes contain wildcard characters.
+(defcustom ffap-dired-wildcards "[*?][^/]*\\'"
   "*A regexp matching filename wildcard characters, or nil.
+
 If `find-file-at-point' gets a filename matching this pattern,
-it passes it on to `dired' instead of `find-file'."
+it passes it on to `find-file' with non-nil WILDCARDS argument,
+which expands wildcards and visits multiple files.  To visit
+a file whose name contains wildcard characters you can suppress
+wildcard expansion by setting `find-file-wildcards'.
+
+If `dired-at-point' gets a filename matching this pattern,
+it passes it on to `dired'."
   :type '(choice (const :tag "Disable" nil)
 		 (const :tag "Enable" "[*?][^/]*\\'")
 		 ;; regexp -- probably not useful
@@ -236,6 +251,12 @@
   :group 'ffap)
 (put 'ffap-file-finder 'risky-local-variable t)
 
+(defcustom ffap-directory-finder 'dired
+  "*The command called by `dired-at-point' to find a directory."
+  :type 'function
+  :group 'ffap)
+(put 'ffap-directory-finder 'risky-local-variable t)
+
 (defcustom ffap-url-fetcher
   (if (fboundp 'browse-url)
       'browse-url			; rely on browse-url-browser-function
@@ -939,7 +960,7 @@
     ;; Slightly controversial decisions:
     ;; * strip trailing "@" and ":"
     ;; * no commas (good for latex)
-    (file "--:$+<>@-Z_a-z~" "<@" "@>;.,!?:")
+    (file "--:$+<>@-Z_a-z~*?" "<@" "@>;.,!:")
     ;; An url, or maybe a email/news message-id:
     (url "--:=&?$+@-Z_a-z~#,%;" "^A-Za-z0-9" ":;.,!?")
     ;; Find a string that does *not* contain a colon:
@@ -1120,8 +1141,8 @@
 	 (default-directory default-directory))
     (unwind-protect
 	(cond
-	 ;; Immediate rejects (/ and // are too common in C++):
-         ((member name '("" "/" "//" ".")) nil)
+	 ;; Immediate rejects (/ and // and /* are too common in C/C++):
+         ((member name '("" "/" "//" "/*" ".")) nil)
          ;; Immediately test local filenames.  If default-directory is
          ;; remote, you probably already have a connection.
          ((and (not abs) (ffap-file-exists-string name)))
@@ -1187,6 +1208,12 @@
 			 remote-dir (substring name (match-end 1)))))
 		  (ffap-file-exists-string
 		   (ffap-replace-file-component remote-dir name))))))
+	 ((and ffap-dired-wildcards
+	       (string-match ffap-dired-wildcards name)
+	       abs
+	       (ffap-file-exists-string (file-name-directory
+					 (directory-file-name name)))
+	       name))
          ;; Try all parent directories by deleting the trailing directory
          ;; name until existing directory is found or name stops changing
          ((let ((dir name))
@@ -1227,7 +1254,9 @@
 	     dir
 	     nil
 	     (if dir (cons guess (length dir)) guess)
-	     (list 'file-name-history))))
+	     (list 'file-name-history)
+	     (and buffer-file-name
+		  (abbreviate-file-name buffer-file-name)))))
     ;; Do file substitution like (interactive "F"), suggested by MCOOK.
     (or (ffap-url-p guess) (setq guess (substitute-in-file-name guess)))
     ;; Should not do it on url's, where $ is a common (VMS?) character.
@@ -1357,10 +1386,12 @@
      ((ffap-url-p filename)
       (let (current-prefix-arg)		; w3 2.3.25 bug, reported by KPC
 	(funcall ffap-url-fetcher filename)))
-     ;; This junk more properly belongs in a modified ffap-file-finder:
      ((and ffap-dired-wildcards
-	   (string-match ffap-dired-wildcards filename))
-      (dired filename))
+	   (string-match ffap-dired-wildcards filename)
+	   find-file-wildcards
+	   ;; Check if it's find-file that supports wildcards arg
+	   (memq ffap-file-finder '(find-file find-alternate-file)))
+      (funcall ffap-file-finder (expand-file-name filename) t))
      ((or (not ffap-newfile-prompt)
 	  (file-exists-p filename)
 	  (y-or-n-p "File does not exist, create buffer? "))
@@ -1556,9 +1587,7 @@
      )))
 
 
-;;; ffap-other-* commands:
-;;
-;; Requested by KPC.
+;;; ffap-other-*, ffap-read-only-*, ffap-alternate-* commands:
 
 ;; There could be a real `ffap-noselect' function, but we would need
 ;; at least two new user variables, and there is no w3-fetch-noselect.
@@ -1568,23 +1597,70 @@
   "Like `ffap', but put buffer in another window.
 Only intended for interactive use."
   (interactive)
-  (switch-to-buffer-other-window
-   (save-window-excursion (call-interactively 'ffap) (current-buffer))))
+  (let (value)
+    (switch-to-buffer-other-window
+     (save-window-excursion
+       (setq value (call-interactively 'ffap))
+       (unless (or (bufferp value) (bufferp (car-safe value)))
+	 (setq value (current-buffer)))
+       (current-buffer)))
+    value))
 
 (defun ffap-other-frame nil
   "Like `ffap', but put buffer in another frame.
 Only intended for interactive use."
   (interactive)
   ;; Extra code works around dedicated windows (noted by JENS, 7/96):
-  (let* ((win (selected-window)) (wdp (window-dedicated-p win)))
+  (let* ((win (selected-window))
+	 (wdp (window-dedicated-p win))
+	 value)
     (unwind-protect
 	(progn
 	  (set-window-dedicated-p win nil)
 	  (switch-to-buffer-other-frame
 	   (save-window-excursion
-	     (call-interactively 'ffap)
+	     (setq value (call-interactively 'ffap))
+	     (unless (or (bufferp value) (bufferp (car-safe value)))
+	       (setq value (current-buffer)))
 	     (current-buffer))))
-      (set-window-dedicated-p win wdp))))
+      (set-window-dedicated-p win wdp))
+    value))
+
+(defun ffap-read-only ()
+  "Like `ffap', but mark buffer as read-only.
+Only intended for interactive use."
+  (interactive)
+  (let ((value (call-interactively 'ffap)))
+    (unless (or (bufferp value) (bufferp (car-safe value)))
+      (setq value (current-buffer)))
+    (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
+	  (if (listp value) value (list value)))
+    value))
+
+(defun ffap-read-only-other-window ()
+  "Like `ffap', but put buffer in another window and mark as read-only.
+Only intended for interactive use."
+  (interactive)
+  (let ((value (ffap-other-window)))
+    (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
+	  (if (listp value) value (list value)))
+    value))
+
+(defun ffap-read-only-other-frame ()
+  "Like `ffap', but put buffer in another frame and mark as read-only.
+Only intended for interactive use."
+  (interactive)
+  (let ((value (ffap-other-frame)))
+    (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
+	  (if (listp value) value (list value)))
+    value))
+
+(defun ffap-alternate-file ()
+  "Like `ffap' and `find-alternate-file'.
+Only intended for interactive use."
+  (interactive)
+  (let ((ffap-file-finder 'find-alternate-file))
+    (call-interactively 'ffap)))
 
 
 ;;; Bug Reporter:
@@ -1665,24 +1741,26 @@
 	       (not current-prefix-arg)
 	     current-prefix-arg))
       (let (current-prefix-arg)		; already interpreted
-	(call-interactively 'dired))
+	(call-interactively ffap-directory-finder))
     (or filename (setq filename (dired-at-point-prompter)))
     (cond
      ((ffap-url-p filename)
       (funcall ffap-url-fetcher filename))
      ((and ffap-dired-wildcards
 	   (string-match ffap-dired-wildcards filename))
-      (dired filename))
+      (funcall ffap-directory-finder filename))
      ((file-exists-p filename)
       (if (file-directory-p filename)
-	  (dired (expand-file-name filename))
-	(dired (concat (expand-file-name filename) "*"))))
+	  (funcall ffap-directory-finder
+		   (expand-file-name filename))
+	(funcall ffap-directory-finder
+		 (concat (expand-file-name filename) "*"))))
      ((and (file-writable-p
             (or (file-name-directory (directory-file-name filename))
                 filename))
            (y-or-n-p "Directory does not exist, create it? "))
       (make-directory filename)
-      (dired filename))
+      (funcall ffap-directory-finder filename))
      ((error "No such file or directory `%s'" filename)))))
 
 (defun dired-at-point-prompter (&optional guess)
@@ -1712,16 +1790,66 @@
 	 (and guess (ffap-highlight))))
     (ffap-highlight t)))
 
+;;; ffap-dired-other-*, ffap-list-directory commands:
+
+(defun ffap-dired-other-window ()
+  "Like `dired-at-point', but put buffer in another window.
+Only intended for interactive use."
+  (interactive)
+  (let (value)
+    (switch-to-buffer-other-window
+     (save-window-excursion
+       (setq value (call-interactively 'dired-at-point))
+       (current-buffer)))
+    value))
+
+(defun ffap-dired-other-frame ()
+  "Like `dired-at-point', but put buffer in another frame.
+Only intended for interactive use."
+  (interactive)
+  ;; Extra code works around dedicated windows (noted by JENS, 7/96):
+  (let* ((win (selected-window))
+	 (wdp (window-dedicated-p win))
+	 value)
+    (unwind-protect
+	(progn
+	  (set-window-dedicated-p win nil)
+	  (switch-to-buffer-other-frame
+	   (save-window-excursion
+	     (setq value (call-interactively 'dired-at-point))
+	     (current-buffer))))
+      (set-window-dedicated-p win wdp))
+    value))
+
+(defun ffap-list-directory ()
+  "Like `dired-at-point' and `list-directory'.
+Only intended for interactive use."
+  (interactive)
+  (let ((ffap-directory-finder 'list-directory))
+    (call-interactively 'dired-at-point)))
+
+
 ;;; Offer default global bindings (`ffap-bindings'):
 
 (defvar ffap-bindings
    '(
      (global-set-key [S-mouse-3] 'ffap-at-mouse)
      (global-set-key [C-S-mouse-3] 'ffap-menu)
+
      (global-set-key "\C-x\C-f" 'find-file-at-point)
+     (global-set-key "\C-x\C-r" 'ffap-read-only)
+     (global-set-key "\C-x\C-v" 'ffap-alternate-file)
+
      (global-set-key "\C-x4f"   'ffap-other-window)
      (global-set-key "\C-x5f"   'ffap-other-frame)
+     (global-set-key "\C-x4r"   'ffap-read-only-other-window)
+     (global-set-key "\C-x5r"   'ffap-read-only-other-frame)
+
      (global-set-key "\C-xd"    'dired-at-point)
+     (global-set-key "\C-x4d"   'ffap-dired-other-window)
+     (global-set-key "\C-x5d"   'ffap-dired-other-frame)
+     (global-set-key "\C-x\C-d" 'ffap-list-directory)
+
      (add-hook 'gnus-summary-mode-hook 'ffap-gnus-hook)
      (add-hook 'gnus-article-mode-hook 'ffap-gnus-hook)
      (add-hook 'vm-mode-hook 'ffap-ro-mode-hook)
--- a/lisp/filecache.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/filecache.el	Tue Dec 14 07:34:55 2004 +0000
@@ -337,21 +337,20 @@
 Find is run in DIRECTORY."
   (interactive "DAdd files under directory: ")
   (let ((dir (expand-file-name directory)))
-    (if (eq file-cache-find-command-posix-flag 'not-defined)
-        (setq file-cache-find-command-posix-flag
-	      (executable-command-find-posix-p file-cache-find-command)))
+    (when (memq system-type '(windows-nt cygwin))
+      (if (eq file-cache-find-command-posix-flag 'not-defined)
+	  (setq file-cache-find-command-posix-flag
+		(executable-command-find-posix-p file-cache-find-command))))
     (set-buffer (get-buffer-create file-cache-buffer))
     (erase-buffer)
     (call-process file-cache-find-command nil
 		  (get-buffer file-cache-buffer) nil
 		  dir "-name"
-                  (cond
-                   (file-cache-find-command-posix-flag
-                    "\\*")
-                   ((eq system-type 'windows-nt)
-                    "'*'")
-                   (t
-                    "*"))
+		  (if (memq system-type '(windows-nt cygwin))
+		      (if file-cache-find-command-posix-flag
+			  "\\*"
+			"'*'")
+		    "*")
 		  "-print")
     (file-cache-add-from-file-cache-buffer)))
 
--- a/lisp/files.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/files.el	Tue Dec 14 07:34:55 2004 +0000
@@ -932,8 +932,7 @@
 
 To visit a file without any kind of conversion and without
 automatically choosing a major mode, use \\[find-file-literally]."
-  (interactive
-   (find-file-read-args "Find file: " nil))
+  (interactive (find-file-read-args "Find file: " nil))
   (let ((value (find-file-noselect filename nil nil wildcards)))
     (if (listp value)
 	(mapcar 'switch-to-buffer (nreverse value))
@@ -955,8 +954,8 @@
     (if (listp value)
 	(progn
 	  (setq value (nreverse value))
-	  (switch-to-buffer-other-window (car value))
-	  (mapcar 'switch-to-buffer (cdr value)))
+	  (cons (switch-to-buffer-other-window (car value))
+		(mapcar 'switch-to-buffer (cdr value))))
       (switch-to-buffer-other-window value))))
 
 (defun find-file-other-frame (filename &optional wildcards)
@@ -975,8 +974,8 @@
     (if (listp value)
 	(progn
 	  (setq value (nreverse value))
-	  (switch-to-buffer-other-frame (car value))
-	  (mapcar 'switch-to-buffer (cdr value)))
+	  (cons (switch-to-buffer-other-frame (car value))
+		(mapcar 'switch-to-buffer (cdr value))))
       (switch-to-buffer-other-frame value))))
 
 (defun find-file-existing (filename &optional wildcards)
@@ -991,35 +990,53 @@
   "Edit file FILENAME but don't allow changes.
 Like \\[find-file] but marks buffer as read-only.
 Use \\[toggle-read-only] to permit editing."
-  (interactive (find-file-read-args "Find file read-only: " t))
-  (unless (file-exists-p filename) (error "%s does not exist" filename))
-  (find-file filename wildcards)
-  (toggle-read-only 1)
-  (current-buffer))
+  (interactive (find-file-read-args "Find file read-only: " nil))
+  (unless (or (and wildcards find-file-wildcards
+		   (not (string-match "\\`/:" filename))
+		   (string-match "[[*?]" filename))
+	      (file-exists-p filename))
+    (error "%s does not exist" filename))
+  (let ((value (find-file filename wildcards)))
+    (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
+	  (if (listp value) value (list value)))
+    value))
 
 (defun find-file-read-only-other-window (filename &optional wildcards)
   "Edit file FILENAME in another window but don't allow changes.
 Like \\[find-file-other-window] but marks buffer as read-only.
 Use \\[toggle-read-only] to permit editing."
-  (interactive (find-file-read-args "Find file read-only other window: " t))
-  (unless (file-exists-p filename) (error "%s does not exist" filename))
-  (find-file-other-window filename wildcards)
-  (toggle-read-only 1)
-  (current-buffer))
+  (interactive (find-file-read-args "Find file read-only other window: " nil))
+  (unless (or (and wildcards find-file-wildcards
+		   (not (string-match "\\`/:" filename))
+		   (string-match "[[*?]" filename))
+	      (file-exists-p filename))
+    (error "%s does not exist" filename))
+  (let ((value (find-file-other-window filename wildcards)))
+    (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
+	  (if (listp value) value (list value)))
+    value))
 
 (defun find-file-read-only-other-frame (filename &optional wildcards)
   "Edit file FILENAME in another frame but don't allow changes.
 Like \\[find-file-other-frame] but marks buffer as read-only.
 Use \\[toggle-read-only] to permit editing."
-  (interactive (find-file-read-args "Find file read-only other frame: " t))
-  (unless (file-exists-p filename) (error "%s does not exist" filename))
-  (find-file-other-frame filename wildcards)
-  (toggle-read-only 1)
-  (current-buffer))
-
-(defun find-alternate-file-other-window (filename)
+  (interactive (find-file-read-args "Find file read-only other frame: " nil))
+  (unless (or (and wildcards find-file-wildcards
+		   (not (string-match "\\`/:" filename))
+		   (string-match "[[*?]" filename))
+	      (file-exists-p filename))
+    (error "%s does not exist" filename))
+  (let ((value (find-file-other-frame filename wildcards)))
+    (mapc (lambda (b) (with-current-buffer b (toggle-read-only 1)))
+	  (if (listp value) value (list value)))
+    value))
+
+(defun find-alternate-file-other-window (filename &optional wildcards)
   "Find file FILENAME as a replacement for the file in the next window.
-This command does not select that window."
+This command does not select that window.
+
+Interactively, or if WILDCARDS is non-nil in a call from Lisp,
+expand wildcards (if any) and replace the file with multiple files."
   (interactive
    (save-selected-window
      (other-window 1)
@@ -1030,17 +1047,21 @@
 	    (setq file-name (file-name-nondirectory file)
 		  file-dir (file-name-directory file)))
        (list (read-file-name
-	      "Find alternate file: " file-dir nil nil file-name)))))
+	      "Find alternate file: " file-dir nil nil file-name)
+	     t))))
   (if (one-window-p)
-      (find-file-other-window filename)
+      (find-file-other-window filename wildcards)
     (save-selected-window
       (other-window 1)
-      (find-alternate-file filename))))
-
-(defun find-alternate-file (filename)
+      (find-alternate-file filename wildcards))))
+
+(defun find-alternate-file (filename &optional wildcards)
   "Find file FILENAME, select its buffer, kill previous buffer.
 If the current buffer now contains an empty file that you just visited
-\(presumably by mistake), use this command to visit the file you really want."
+\(presumably by mistake), use this command to visit the file you really want.
+
+Interactively, or if WILDCARDS is non-nil in a call from Lisp,
+expand wildcards (if any) and replace the file with multiple files."
   (interactive
    (let ((file buffer-file-name)
 	 (file-name nil)
@@ -1049,7 +1070,8 @@
 	  (setq file-name (file-name-nondirectory file)
 		file-dir (file-name-directory file)))
      (list (read-file-name
-	    "Find alternate file: " file-dir nil nil file-name))))
+	    "Find alternate file: " file-dir nil nil file-name)
+	   t)))
   (unless (run-hook-with-args-until-failure 'kill-buffer-query-functions)
     (error "Aborted"))
   (when (and (buffer-modified-p) (buffer-file-name))
@@ -1077,7 +1099,7 @@
 	  (setq buffer-file-truename nil)
 	  ;; Likewise for dired buffers.
 	  (setq dired-directory nil)
-	  (find-file filename))
+	  (find-file filename wildcards))
       (when (eq obuf (current-buffer))
 	;; This executes if find-file gets an error
 	;; and does not really find anything.
@@ -1247,8 +1269,8 @@
 Optional second arg RAWFILE non-nil means the file is read literally.
 Optional third arg WILDCARDS non-nil means do wildcard processing
 and visit all the matching files.  When wildcards are actually
-used and expanded, the value is a list of buffers
-that are visiting the various files."
+used and expanded, return a list of buffers that are visiting
+the various files."
   (setq filename
 	(abbreviate-file-name
 	 (expand-file-name filename)))
@@ -1757,6 +1779,7 @@
      ("\\.ses\\'" . ses-mode)
      ("\\.\\(soa\\|zone\\)\\'" . dns-mode)
      ("\\.docbook\\'" . sgml-mode)
+     ("\\.com\\'" . dcl-mode)
      ("/config\\.\\(?:bat\\|log\\)\\'" . fundamental-mode)
      ;; Windows candidates may be opened case sensitively on Unix
      ("\\.\\(?:[iI][nN][iI]\\|[lL][sS][tT]\\|[rR][eE][gG]\\|[sS][yY][sS]\\)\\'" . conf-mode)
--- a/lisp/gnus/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/gnus/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,8 +1,20 @@
+2004-12-08  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* gnus-art.el (gnus-narrow-to-page): Don't hardcode point-min.
+
+2004-12-13  Katsumi Yamaoka  <yamaoka@jpl.org>
+
+	* gnus-group.el (gnus-group-make-rss-group): Use
+	gnus-group-make-group instead of gnus-group-unsubscribe-group.
+
+	* gnus-start.el (gnus-setup-news): Honor user's setting to
+	gnus-message-archive-method.  Suggested by Lute Kamstra
+	<Lute.Kamstra@xs4all.nl>.
+
 2004-12-02  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* message.el (message-forward-make-body-mml): Remove headers
-	according to message-forward-ignored-headers if a message is
-	decoded.
+	according to message-forward-ignored-headers if a message is decoded.
 
 2004-12-02  Romain Francoise  <romain@orebokech.com>
 
@@ -60,17 +72,16 @@
 
 2004-11-25  Reiner Steib  <Reiner.Steib@gmx.de>
 
-	* message.el (message-forbidden-properties): Fixed typo in doc
-	string.
+	* message.el (message-forbidden-properties): Fix typo in doc string.
 
 2004-11-25  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
-	* message.el (message-strip-forbidden-properties): Bind
-	buffer-read-only (etc) to nil.
+	* message.el (message-strip-forbidden-properties):
+	Bind buffer-read-only (etc) to nil.
 
 2004-11-25  Reiner Steib  <Reiner.Steib@gmx.de>
 
-	* gnus-util.el (gnus-replace-in-string): Added doc string.
+	* gnus-util.el (gnus-replace-in-string): Add doc string.
 
 	* nnmail.el (nnmail-split-header-length-limit): Increase to 2048
 	to avoid problems when splitting mails with many recipients.
@@ -97,8 +108,8 @@
 
 2004-11-14  Reiner Steib  <Reiner.Steib@gmx.de>
 
-	* gnus-start.el (gnus-convert-old-newsrc): Assign
-	legacy-gnus-agent to 5.10.7.
+	* gnus-start.el (gnus-convert-old-newsrc):
+	Assign legacy-gnus-agent to 5.10.7.
 
 2004-11-10  Katsumi Yamaoka  <yamaoka@jpl.org>
 
--- a/lisp/gnus/gnus-art.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/gnus/gnus-art.el	Tue Dec 14 07:34:55 2004 +0000
@@ -5066,7 +5066,7 @@
 	  (goto-char (point-min))
 	  (gnus-insert-prev-page-button)))
       (when (and (gnus-visual-p 'page-marker)
-		 (< (+ (point-max) 2) (buffer-size)))
+		 (< (point-max) (save-restriction (widen) (point-max))))
 	(save-excursion
 	  (goto-char (point-max))
 	  (gnus-insert-next-page-button))))))
--- a/lisp/gnus/gnus-group.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/gnus/gnus-group.el	Tue Dec 14 07:34:55 2004 +0000
@@ -2592,8 +2592,7 @@
 	      (href (cdr (assoc 'href feedinfo))))
 	  (push (list title href desc)
 		nnrss-group-alist)
-	  (gnus-group-unsubscribe-group
-	   (concat "nnrss:" title))
+	  (gnus-group-make-group title '(nnrss ""))
 	  (nnrss-save-server-data nil))
       (error "No feeds found for %s" url))))
 
--- a/lisp/gnus/gnus-start.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/gnus/gnus-start.el	Tue Dec 14 07:34:55 2004 +0000
@@ -954,16 +954,28 @@
     ;; Make sure the archive server is available to all and sundry.
     (when gnus-message-archive-method
       (unless (assoc "archive" gnus-server-alist)
-	(push `("archive"
-		nnfolder
-		"archive"
-		(nnfolder-directory
-		 ,(nnheader-concat message-directory "archive"))
-		(nnfolder-active-file
-		 ,(nnheader-concat message-directory "archive/active"))
-		(nnfolder-get-new-mail nil)
-		(nnfolder-inhibit-expiry t))
-	      gnus-server-alist)))
+	(let ((method (or (and (stringp gnus-message-archive-method)
+			       (gnus-server-to-method
+				gnus-message-archive-method))
+			  gnus-message-archive-method)))
+	  ;; Check whether the archive method is writable.
+	  (unless (or (stringp method)
+		      (memq 'respool (assoc (format "%s" (car method))
+					    gnus-valid-select-methods)))
+	    (setq method "archive")) ;; The default.
+	  (push (if (stringp method)
+		    `("archive"
+		      nnfolder
+		      ,method
+		      (nnfolder-directory
+		       ,(nnheader-concat message-directory method))
+		      (nnfolder-active-file
+		       ,(nnheader-concat message-directory
+					 (concat method "/active")))
+		      (nnfolder-get-new-mail nil)
+		      (nnfolder-inhibit-expiry t))
+		  (cons "archive" method))
+		gnus-server-alist))))
 
     ;; If we don't read the complete active file, we fill in the
     ;; hashtb here.
--- a/lisp/info.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/info.el	Tue Dec 14 07:34:55 2004 +0000
@@ -86,7 +86,7 @@
   :group 'info)
 
 (defface info-xref-visited
-  '((t :inherit info-xref)
+  '((default :inherit info-xref)
     (((class color) (background light)) :foreground "magenta4")
     (((class color) (background dark)) :foreground "magenta3")) ;"violet"?
   "Face for visited Info cross-references."
@@ -2834,8 +2834,7 @@
   "Follow a node reference near point.  Return non-nil if successful."
   (let (node)
     (cond
-     ((and (Info-get-token (point) "[hf]t?tp://" "[hf]t?tp://\\([^ \t\n\"`({<>})']+\\)")
-           (or (featurep 'browse-url) (require 'browse-url nil t)))
+     ((Info-get-token (point) "[hf]t?tp://" "[hf]t?tp://\\([^ \t\n\"`({<>})']+\\)")
       (setq node t)
       (browse-url (browse-url-url-at-point)))
      ((setq node (Info-get-token (point) "\\*note[ \n\t]+"
--- a/lisp/international/isearch-x.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/international/isearch-x.el	Tue Dec 14 07:34:55 2004 +0000
@@ -97,7 +97,7 @@
 (defun isearch-process-search-multibyte-characters (last-char)
   (if (eq this-command 'isearch-printing-char)
       (let ((overriding-terminal-local-map nil)
-	    (prompt (concat (isearch-message-prefix) isearch-message))
+	    (prompt (concat (isearch-message-prefix)))
 	    (minibuffer-local-map isearch-minibuffer-local-map)
 	    str)
 	(if isearch-input-method-function
@@ -107,11 +107,12 @@
 		    (cons 'with-input-method
 			  (cons last-char unread-command-events))
 		    ;; Inherit current-input-method in a minibuffer.
-		    str (read-string prompt nil nil nil t))
+		    str (read-string prompt isearch-message nil nil t))
 	      (if (not str)
 		  ;; All inputs were deleted while the input method
 		  ;; was working.
 		  (setq str "")
+		(setq str (substring str (length isearch-message)))
 		(if (and (= (length str) 1)
 			 (= (aref str 0) last-char)
 			 (>= last-char 128))
--- a/lisp/isearch.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/isearch.el	Tue Dec 14 07:34:55 2004 +0000
@@ -258,6 +258,7 @@
     (define-key map "\r" 'isearch-exit)
     (define-key map "\C-j" 'isearch-printing-char)
     (define-key map "\t" 'isearch-printing-char)
+    (define-key map [?\S-\ ] 'isearch-printing-char)
 
     (define-key map    "\C-w" 'isearch-yank-word-or-char)
     (define-key map "\M-\C-w" 'isearch-del-char)
@@ -938,7 +939,7 @@
 			 (isearch-message-prefix nil nil isearch-nonincremental)
 			 isearch-string
 			 minibuffer-local-isearch-map nil
-			 'junk-ring))
+			 'junk-ring nil t))
 		      isearch-new-message
 		      (mapconcat 'isearch-text-char-description
 				 isearch-new-string "")))
@@ -2381,59 +2382,64 @@
   (let ((max isearch-lazy-highlight-max-at-a-time)
         (looping t)
         nomore)
-    (save-excursion
-      (save-match-data
-        (goto-char (if isearch-forward
-                       isearch-lazy-highlight-end
-                     isearch-lazy-highlight-start))
-        (while looping
-          (let ((found (isearch-lazy-highlight-search)))
-            (when max
-              (setq max (1- max))
-              (if (<= max 0)
-                  (setq looping nil)))
-            (if found
-                (let ((mb (match-beginning 0))
-                      (me (match-end 0)))
-                  (if (= mb me)      ;zero-length match
-		      (if isearch-forward
-			  (if (= mb (if isearch-lazy-highlight-wrapped
-					isearch-lazy-highlight-start
-				      (window-end)))
-			      (setq found nil)
-			    (forward-char 1))
-			(if (= mb (if isearch-lazy-highlight-wrapped
-				      isearch-lazy-highlight-end
-				    (window-start)))
-			    (setq found nil)
-			  (forward-char -1)))
+    (with-local-quit
+      (save-selected-window
+	(if (and (window-live-p isearch-lazy-highlight-window)
+		 (not (eq (selected-window) isearch-lazy-highlight-window)))
+	    (select-window isearch-lazy-highlight-window))
+	(save-excursion
+	  (save-match-data
+	    (goto-char (if isearch-forward
+			   isearch-lazy-highlight-end
+			 isearch-lazy-highlight-start))
+	    (while looping
+	      (let ((found (isearch-lazy-highlight-search)))
+		(when max
+		  (setq max (1- max))
+		  (if (<= max 0)
+		      (setq looping nil)))
+		(if found
+		    (let ((mb (match-beginning 0))
+			  (me (match-end 0)))
+		      (if (= mb me)	;zero-length match
+			  (if isearch-forward
+			      (if (= mb (if isearch-lazy-highlight-wrapped
+					    isearch-lazy-highlight-start
+					  (window-end)))
+				  (setq found nil)
+				(forward-char 1))
+			    (if (= mb (if isearch-lazy-highlight-wrapped
+					  isearch-lazy-highlight-end
+					(window-start)))
+				(setq found nil)
+			      (forward-char -1)))
 
-                    ;; non-zero-length match
-                    (let ((ov (make-overlay mb me)))
-                      (overlay-put ov 'face isearch-lazy-highlight-face)
-                      (overlay-put ov 'priority 0) ;lower than main overlay
-                      (overlay-put ov 'window (selected-window))
-                      (push ov isearch-lazy-highlight-overlays)))
-                  (if isearch-forward
-                      (setq isearch-lazy-highlight-end (point))
-                    (setq isearch-lazy-highlight-start (point)))))
+			;; non-zero-length match
+			(let ((ov (make-overlay mb me)))
+			  (push ov isearch-lazy-highlight-overlays)
+			  (overlay-put ov 'face isearch-lazy-highlight-face)
+			  (overlay-put ov 'priority 0) ;lower than main overlay
+			  (overlay-put ov 'window (selected-window))))
+		      (if isearch-forward
+			  (setq isearch-lazy-highlight-end (point))
+			(setq isearch-lazy-highlight-start (point)))))
 
-	    ;; not found or zero-length match at the search bound
-	    (if (not found)
-		(if isearch-lazy-highlight-wrapped
-		    (setq looping nil
-			  nomore  t)
-		  (setq isearch-lazy-highlight-wrapped t)
-		  (if isearch-forward
-		      (progn
-			(setq isearch-lazy-highlight-end (window-start))
-			(goto-char (window-start)))
-		    (setq isearch-lazy-highlight-start (window-end))
-		    (goto-char (window-end)))))))
-        (unless nomore
-          (setq isearch-lazy-highlight-timer
-                (run-at-time isearch-lazy-highlight-interval nil
-                             'isearch-lazy-highlight-update)))))))
+		;; not found or zero-length match at the search bound
+		(if (not found)
+		    (if isearch-lazy-highlight-wrapped
+			(setq looping nil
+			      nomore  t)
+		      (setq isearch-lazy-highlight-wrapped t)
+		      (if isearch-forward
+			  (progn
+			    (setq isearch-lazy-highlight-end (window-start))
+			    (goto-char (window-start)))
+			(setq isearch-lazy-highlight-start (window-end))
+			(goto-char (window-end)))))))
+	    (unless nomore
+	      (setq isearch-lazy-highlight-timer
+		    (run-at-time isearch-lazy-highlight-interval nil
+				 'isearch-lazy-highlight-update)))))))))
 
 (defun isearch-resume (search regexp word forward message case-fold)
   "Resume an incremental search.
--- a/lisp/mail/supercite.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/mail/supercite.el	Tue Dec 14 07:34:55 2004 +0000
@@ -146,8 +146,9 @@
              (...)))
 
 Where INFOKEY is a key for `sc-mail-field', REGEXP is a regular
-expression to match against the INFOKEY's value.  FRAME is a citation
-frame, or a variable containing a citation frame."
+expression to match against the INFOKEY's value.  FRAME is
+a citation frame, or a symbol that represents the name of
+a variable whose value is a citation frame."
   :type '(repeat (list symbol (repeat (cons regexp
 					    (choice (repeat (repeat sexp))
 						    symbol)))))
@@ -1434,12 +1435,11 @@
 and that means call `sc-select-attribution' too."
   (interactive "r\nP\np")
   (undo-boundary)
-  (let ((frame (or (sc-scan-info-alist
-		    (if (symbolp sc-cite-frame-alist)
-			(symbol-value sc-cite-frame-alist)
-		      sc-cite-frame-alist))
-		   sc-default-cite-frame))
+  (let ((frame (sc-scan-info-alist sc-cite-frame-alist))
 	(sc-confirm-always-p (if confirm-p t sc-confirm-always-p)))
+    (if (and frame (symbolp frame))
+	(setq frame (symbol-value frame)))
+    (or frame (setq frame sc-default-cite-frame))
     (run-hooks 'sc-pre-cite-hook)
     (if interactive
 	(sc-select-attribution))
@@ -1450,11 +1450,10 @@
 First runs `sc-pre-uncite-hook'."
   (interactive "r")
   (undo-boundary)
-  (let ((frame (or (sc-scan-info-alist
-		    (if (symbolp sc-uncite-frame-alist)
-			(symbol-value sc-uncite-frame-alist)
-		      sc-uncite-frame-alist))
-		   sc-default-uncite-frame)))
+  (let ((frame (sc-scan-info-alist sc-uncite-frame-alist)))
+    (if (and frame (symbolp frame))
+	(setq frame (symbol-value frame)))
+    (or frame (setq frame sc-default-uncite-frame))
     (run-hooks 'sc-pre-uncite-hook)
     (regi-interpret frame start end)))
 
@@ -1465,11 +1464,10 @@
   (let ((sc-confirm-always-p t))
     (sc-select-attribution))
   (undo-boundary)
-  (let ((frame (or (sc-scan-info-alist
-		    (if (symbolp sc-recite-frame-alist)
-			(symbol-value sc-recite-frame-alist)
-		      sc-recite-frame-alist))
-		   sc-default-recite-frame)))
+  (let ((frame (sc-scan-info-alist sc-recite-frame-alist)))
+    (if (and frame (symbolp frame))
+	(setq frame (symbol-value frame)))
+    (or frame (setq frame sc-default-recite-frame))
     (run-hooks 'sc-pre-recite-hook)
     (regi-interpret frame start end)))
 
--- a/lisp/net/browse-url.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/net/browse-url.el	Tue Dec 14 07:34:55 2004 +0000
@@ -575,6 +575,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; URL input
 
+;;;###autoload
 (defun browse-url-url-at-point ()
   (let ((url (thing-at-point 'url)))
     (set-text-properties 0 (length url) nil url)
--- a/lisp/play/zone.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/play/zone.el	Tue Dec 14 07:34:55 2004 +0000
@@ -75,6 +75,7 @@
                        zone-pgm-paragraph-spaz
                        zone-pgm-stress
                        zone-pgm-stress-destress
+                       zone-pgm-random-life
                        ])
 
 (defmacro zone-orig (&rest body)
@@ -459,6 +460,26 @@
       (sit-for wait))
     (delete-char -1) (insert c-string)))
 
+(defun zone-fill-out-screen (width height)
+  (save-excursion
+    (goto-char (point-min))
+    ;; fill out rectangular ws block
+    (while (not (eobp))
+      (end-of-line)
+      (let ((cc (current-column)))
+        (if (< cc width)
+            (insert (make-string (- width cc) 32))
+          (delete-char (- width cc))))
+      (unless (eobp)
+        (forward-char 1)))
+    ;; pad ws past bottom of screen
+    (let ((nl (- height (count-lines (point-min) (point)))))
+      (when (> nl 0)
+        (let ((line (concat (make-string (1- width) ? ) "\n")))
+          (do ((i 0 (1+ i)))
+              ((= i nl))
+            (insert line)))))))
+
 (defun zone-fall-through-ws (c col wend)
   (let ((fall-p nil)                    ; todo: move outward
         (wait 0.15)
@@ -486,27 +507,9 @@
          (mc 0)                         ; miss count
          (total (* ww wh))
          (fall-p nil))
-    (goto-char (point-min))
-    ;; fill out rectangular ws block
-    (while (not (eobp))
-      (end-of-line)
-      (let ((cc (current-column)))
-        (if (< cc ww)
-            (insert (make-string (- ww cc) ? ))
-          (delete-char (- ww cc))))
-      (unless (eobp)
-        (forward-char 1)))
-    ;; pad ws past bottom of screen
-    (let ((nl (- wh (count-lines (point-min) (point)))))
-      (when (> nl 0)
-        (let ((line (concat (make-string (1- ww) ? ) "\n")))
-          (do ((i 0 (1+ i)))
-              ((= i nl))
-            (insert line)))))
+    (zone-fill-out-screen ww wh)
     (catch 'done
       (while (not (input-pending-p))
-        (goto-char (point-min))
-        (sit-for 0)
         (let ((wbeg (window-start))
               (wend (window-end)))
           (setq mc 0)
@@ -552,7 +555,9 @@
 ;;;; zone-pgm-paragraph-spaz
 
 (defun zone-pgm-paragraph-spaz ()
-  (if (memq (zone-orig major-mode) '(text-mode fundamental-mode))
+  (if (memq (zone-orig major-mode)
+            ;; there should be a better way to distinguish textish modes
+            '(text-mode texinfo-mode fundamental-mode))
       (let ((fill-column fill-column)
             (fc-min fill-column)
             (fc-max fill-column)
@@ -570,7 +575,7 @@
     (zone-pgm-rotate)))
 
 
-;;;; zone-pgm-stress
+;;;; stressing and destressing
 
 (defun zone-pgm-stress ()
   (goto-char (point-min))
@@ -596,9 +601,6 @@
        (message (concat (make-string (random (- (frame-width) 5)) ? ) "grrr"))
        (sit-for 0.1)))))
 
-
-;;;; zone-pgm-stress-destress
-
 (defun zone-pgm-stress-destress ()
   (zone-call 'zone-pgm-stress 25)
   (zone-hiding-modeline
@@ -617,6 +619,59 @@
                 zone-pgm-drip))))
 
 
+;;;; the lyfe so short the craft so long to lerne --chaucer
+
+(defvar zone-pgm-random-life-wait nil
+  "*Seconds to wait between successive `life' generations.
+If nil, `zone-pgm-random-life' chooses a value from 0-3 (inclusive).")
+
+(defun zone-pgm-random-life ()
+  (require 'life)
+  (zone-fill-out-screen (1- (window-width)) (1- (window-height)))
+  (let ((top (progn (goto-char (window-start)) (forward-line 7) (point)))
+        (bot (progn (goto-char (window-end)) (forward-line -7) (point)))
+        (rtc (- (frame-width) 11))
+        (min (window-start))
+        (max (1- (window-end)))
+        c col)
+    (delete-region max (point-max))
+    (while (progn (goto-char (+ min (random max)))
+                  (and (sit-for 0.005)
+                       (or (progn (skip-chars-forward " @\n" max)
+                                  (not (= max (point))))
+                           (unless (or (= 0 (skip-chars-backward " @\n" min))
+                                       (= min (point)))
+                             (forward-char -1)
+                             t))))
+      (setq c (char-after))
+      (unless (or (not c) (= ?\n c))
+        (forward-char 1)
+        (insert-and-inherit             ; keep colors
+         (cond ((or (> top (point))
+                    (< bot (point))
+                    (or (> 11 (setq col (current-column)))
+                        (< rtc col)))
+                32)
+               ((and (<= ?a c) (>= ?z c)) (+ c (- ?A ?a)))
+               ((and (<= ?A c) (>= ?Z c)) ?*)
+               (t ?@)))
+        (forward-char -1)
+        (delete-char -1)))
+    (sit-for 3)
+    (setq col nil)
+    (goto-char bot)
+    (while (< top (point))
+      (setq c (point))
+      (move-to-column 9)
+      (setq col (cons (buffer-substring (point) c) col))
+      (end-of-line 0)
+      (forward-char -10))
+    (let ((life-patterns (vector (cons (make-string (length (car col)) 32)
+                                       col))))
+      (life (or zone-pgm-random-life-wait (random 4)))
+      (kill-buffer nil))))
+
+
 ;;;;;;;;;;;;;;;
 (provide 'zone)
 
--- a/lisp/progmodes/idlw-shell.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/progmodes/idlw-shell.el	Tue Dec 14 07:34:55 2004 +0000
@@ -841,6 +841,8 @@
 (defvar idlwave-shell-sources-query)
 (defvar idlwave-shell-mode-map)
 (defvar idlwave-shell-calling-stack-index)
+(defvar idlwave-shell-only-prompt-pattern nil)
+(defvar tool-bar-map)
 
 (defun idlwave-shell-mode ()
   "Major mode for interacting with an inferior IDL process.
@@ -994,7 +996,7 @@
   (setq idlwave-shell-hide-output nil)
 
   ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-  (make-local-hook 'kill-buffer-hook)
+  ;;(make-local-hook 'kill-buffer-hook)
   (add-hook 'kill-buffer-hook 'idlwave-shell-kill-shell-buffer-confirm
 	    nil 'local)
   (add-hook 'kill-buffer-hook 'idlwave-shell-delete-temp-files nil 'local)
@@ -1038,7 +1040,7 @@
   (setq abbrev-mode t)
 
   ;; NB: `make-local-hook' needed for older/alternative Emacs compatibility
-  (make-local-hook 'post-command-hook)
+  ;;(make-local-hook 'post-command-hook)
   (add-hook 'post-command-hook 'idlwave-command-hook nil t)
 
   ;; Read the command history?
@@ -1458,7 +1460,6 @@
   "Return t if the shell process is running."
   (eq (process-status idlwave-shell-process-name) 'run))
 
-(defvar idlwave-shell-only-prompt-pattern nil)
 (defun idlwave-shell-filter-hidden-output (output)
   "Filter hidden output, leaving the good stuff.
 
@@ -1475,6 +1476,7 @@
 
 (defvar idlwave-shell-hidden-output-buffer " *idlwave-shell-hidden-output*"
   "Buffer containing hidden output from IDL commands.")
+(defvar idlwave-shell-current-state nil)
   
 (defun idlwave-shell-filter (proc string)
   "Watch for IDL prompt and filter incoming text.
@@ -1627,7 +1629,55 @@
 	  (run-hooks 'idlwave-shell-sentinel-hook))
       (run-hooks 'idlwave-shell-sentinel-hook))))
 
-(defvar idlwave-shell-current-state nil)
+(defvar idlwave-shell-error-buffer " *idlwave-shell-errors*"
+  "Buffer containing syntax errors from IDL compilations.")
+
+;; FIXME: the following two variables do not currently allow line breaks
+;; in module and file names.  I am not sure if it will be necessary to
+;; change this.  Currently it seems to work the way it is.
+(defvar idlwave-shell-syntax-error
+  "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" 
+  "A regular expression to match an IDL syntax error.  
+The 1st pair matches the file name, the second pair matches the line
+number.")
+
+(defvar idlwave-shell-other-error
+  "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)"
+  "A regular expression to match any IDL error.")
+
+(defvar idlwave-shell-halting-error 
+  "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n"
+  "A regular expression to match errors which halt execution.")
+
+(defvar idlwave-shell-cant-continue-error 
+  "^% Can't continue from this point.\n"
+  "A regular expression to match errors stepping errors.")
+
+(defvar idlwave-shell-file-line-message
+  (concat 
+   "\\("                                 ; program name group (1)
+   "\\$MAIN\\$\\|"                   	 ; main level routine
+   "\\<[a-zA-Z][a-zA-Z0-9_$:]*"          ; start with a letter followed by [..]
+   "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2)
+   "\\)"                                 ; end program name group (1)
+   "[ \t\n]+"                            ; white space
+   "\\("                                 ; line number group (3)
+   "[0-9]+"                              ; the line number (the fix point)
+   "\\([ \t]*\n[ \t]*[0-9]+\\)*"         ; continuation lines number (4)
+   "\\)"                                 ; end line number group (3)
+   "[ \t\n]+"                            ; white space
+   "\\("                                 ; file name group (5)
+   "[^ \t\n]+"                           ; file names can contain any non-white
+   "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*"      ; continuation lines file name (6)
+   "\\)"                                 ; end line number group (5)
+   )
+  "*A regular expression to parse out the file name and line number.
+The 1st group should match the subroutine name.  
+The 3rd group is the line number.
+The 5th group is the file name.
+All parts may contain linebreaks surrounded by spaces.  This is important
+in IDL5 which inserts random linebreaks in long module and file names.")
+
 (defun idlwave-shell-scan-for-state ()
   "Scan for state info.  Looks for messages in output from last IDL
 command indicating where IDL has stopped. The types of messages we are
@@ -1721,55 +1771,6 @@
      ;; Otherwise, no particular state
      (t (setq idlwave-shell-current-state nil)))))
 
-(defvar idlwave-shell-error-buffer " *idlwave-shell-errors*"
-  "Buffer containing syntax errors from IDL compilations.")
-
-;; FIXME: the following two variables do not currently allow line breaks
-;; in module and file names.  I am not sure if it will be necessary to
-;; change this.  Currently it seems to work the way it is.
-(defvar idlwave-shell-syntax-error
-  "^% Syntax error.\\s-*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)" 
-  "A regular expression to match an IDL syntax error.  
-The 1st pair matches the file name, the second pair matches the line
-number.")
-
-(defvar idlwave-shell-other-error
-  "^% .*\n\\s-*At:\\s-*\\(.*\\),\\s-*Line\\s-*\\(.*\\)"
-  "A regular expression to match any IDL error.")
-
-(defvar idlwave-shell-halting-error 
-  "^% .*\n\\([^%].*\n\\)*% Execution halted at:\\(\\s-*\\S-+\\s-*[0-9]+\\s-*.*\\)\n"
-  "A regular expression to match errors which halt execution.")
-
-(defvar idlwave-shell-cant-continue-error 
-  "^% Can't continue from this point.\n"
-  "A regular expression to match errors stepping errors.")
-
-(defvar idlwave-shell-file-line-message
-  (concat 
-   "\\("                                 ; program name group (1)
-   "\\$MAIN\\$\\|"                   	 ; main level routine
-   "\\<[a-zA-Z][a-zA-Z0-9_$:]*"          ; start with a letter followed by [..]
-   "\\([ \t]*\n[ \t]*[a-zA-Z0-9_$:]+\\)*"; continuation lines program name (2)
-   "\\)"                                 ; end program name group (1)
-   "[ \t\n]+"                            ; white space
-   "\\("                                 ; line number group (3)
-   "[0-9]+"                              ; the line number (the fix point)
-   "\\([ \t]*\n[ \t]*[0-9]+\\)*"         ; continuation lines number (4)
-   "\\)"                                 ; end line number group (3)
-   "[ \t\n]+"                            ; white space
-   "\\("                                 ; file name group (5)
-   "[^ \t\n]+"                           ; file names can contain any non-white
-   "\\([ \t]*\n[ \t]*[^ \t\n]+\\)*"      ; continuation lines file name (6)
-   "\\)"                                 ; end line number group (5)
-   )
-  "*A regular expression to parse out the file name and line number.
-The 1st group should match the subroutine name.  
-The 3rd group is the line number.
-The 5th group is the file name.
-All parts may contain linebreaks surrounded by spaces.  This is important
-in IDL5 which inserts random linebreaks in long module and file names.")
-
 (defun idlwave-shell-parse-line (string &optional skip-main)
   "Parse IDL message for the subroutine, file name and line number.
 We need to work hard here to remove the stupid line breaks inserted by
@@ -2102,8 +2103,8 @@
        'hide 'wait)
       ;; If we don't know anything about the class, update shell routines
       (if (and idlwave-shell-get-object-class
-	       (not (assoc-ignore-case idlwave-shell-get-object-class
-				       (idlwave-class-alist))))
+	       (not (assoc-string idlwave-shell-get-object-class
+				  (idlwave-class-alist) t)))
 	  (idlwave-shell-maybe-update-routine-info))
       idlwave-shell-get-object-class)))
 
@@ -2165,9 +2166,10 @@
       (idlwave-complete arg)))))
 
 ;; Get rid of opaque dynamic variable passing of link?
+(defvar link) ;dynamic variable
 (defun idlwave-shell-complete-execcomm-help (mode word)
   (let ((word (or (nth 1 idlwave-completion-help-info) word))
-	(entry (assoc-ignore-case word idlwave-executive-commands-alist)))
+	(entry (assoc-string word idlwave-executive-commands-alist t)))
     (cond
      ((eq mode 'test)
       (and (stringp word) entry (cdr entry)))
@@ -2217,6 +2219,7 @@
     (looking-at "\\$")))
 
 ;; Debugging Commands ------------------------------------------------------
+(defvar idlwave-shell-electric-debug-mode) ; defined by easy-mmode
 
 (defun idlwave-shell-redisplay (&optional hide)
   "Tries to resync the display with where execution has stopped.
@@ -3517,6 +3520,7 @@
 
 (defvar idlwave-shell-bp-overlays nil
   "Alist of overlays marking breakpoints")
+(defvar idlwave-shell-bp-glyph)
 
 (defun idlwave-shell-update-bp-overlays ()
   "Update the overlays which mark breakpoints in the source code.
@@ -3605,7 +3609,6 @@
 		  (set-window-buffer win buf))))))))
 
 
-(defvar idlwave-shell-bp-glyph)
 (defun idlwave-shell-make-new-bp-overlay (&optional type disabled help)
   "Make a new overlay for highlighting breakpoints.  
 
@@ -4026,7 +4029,7 @@
 		   '(alt))))
        (shift (memq 'shift mod))
        (mod-noshift (delete 'shift (copy-sequence mod)))
-       s k1 c2 k2 cmd cannotshift)
+       s k1 c2 k2 cmd electric only-buffer cannotshift)
   (while (setq s (pop specs))
     (setq k1  (nth 0 s)
 	  c2  (nth 1 s)
@@ -4089,6 +4092,9 @@
     (setq idlwave-shell-suppress-electric-debug nil))
   (idlwave-shell-electric-debug-mode))
 
+(defvar idlwave-shell-electric-debug-read-only) 
+(defvar idlwave-shell-electric-debug-buffers nil)
+
 (easy-mmode-define-minor-mode idlwave-shell-electric-debug-mode
   "Toggle Electric Debug mode.
 With no argument, this command toggles the mode. 
@@ -4138,7 +4144,6 @@
   (force-mode-line-update))
 
 ;; Turn it off in all relevant buffers
-(defvar idlwave-shell-electric-debug-buffers nil)
 (defun idlwave-shell-electric-debug-all-off ()
   (setq idlwave-shell-suppress-electric-debug nil)
   (let ((buffers idlwave-shell-electric-debug-buffers)
--- a/lisp/replace.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/replace.el	Tue Dec 14 07:34:55 2004 +0000
@@ -1214,7 +1214,7 @@
 
 (defun replace-match-maybe-edit (newtext fixedcase literal noedit match-data)
   "Make a replacement with `replace-match', editing `\\?'.
-NEXTEXT, FIXEDCASE, LITERAL are just passed on.  If NOEDIT is true, no
+NEWTEXT, FIXEDCASE, LITERAL are just passed on.  If NOEDIT is true, no
 check for `\\?' is made to save time.  MATCH-DATA is used for the
 replacement.  In case editing is done, it is changed to use markers.
 
@@ -1281,6 +1281,8 @@
 	;; (match-data); otherwise it is t if a match is possible at point.
 	(match-again t)
 
+	(isearch-string isearch-string)
+	(isearch-regexp isearch-regexp)
 	(message
 	 (if query-flag
 	     (substitute-command-keys
@@ -1313,6 +1315,10 @@
 				    (if regexp-flag from-string
 				      (regexp-quote from-string))
 				    "\\b")))
+    (if (eq query-replace-highlight 'isearch)
+	(setq isearch-string search-string
+	      isearch-regexp regexp-flag))
+
     (push-mark)
     (undo-boundary)
     (unwind-protect
@@ -1380,7 +1386,7 @@
 	    (if (not query-flag)
 		(let ((inhibit-read-only
 		       query-replace-skip-read-only))
-		  (unless noedit
+		  (unless (or literal noedit)
 		    (replace-highlight (nth 0 real-match-data)
 				       (nth 1 real-match-data)))
 		  (setq noedit
@@ -1528,7 +1534,14 @@
 			 (setq unread-command-events
 			       (append (listify-key-sequence key)
 				       unread-command-events))
-			 (setq done t))))
+			 (setq done t)))
+		  (when (eq query-replace-highlight 'isearch)
+		    ;; Force isearch rehighlighting
+		    (if (not (memq def '(skip backup)))
+			(setq isearch-lazy-highlight-last-string nil))
+		    ;; Restore isearch data in case of isearching during edit
+		    (setq isearch-string search-string
+			  isearch-regexp regexp-flag)))
 		;; Record previous position for ^ when we move on.
 		;; Change markers to numbers in the match data
 		;; since lots of markers slow down editing.
@@ -1563,27 +1576,38 @@
 		 (if (= replace-count 1) "" "s")))
     (and keep-going stack)))
 
-(defcustom query-replace-highlight t
-  "*Non-nil means to highlight words during query replacement."
-  :type 'boolean
+(defcustom query-replace-highlight
+  (if (and search-highlight isearch-lazy-highlight) 'isearch t)
+  "*Non-nil means to highlight words during query replacement.
+If `isearch', use isearch highlighting for query replacement."
+  :type '(choice (const :tag "Highlight" t)
+                 (const :tag "No highlighting" nil)
+                 (const :tag "Isearch highlighting" 'isearch))
   :group 'matching)
 
 (defvar replace-overlay nil)
 
 (defun replace-dehighlight ()
-  (and replace-overlay
-       (progn
-	 (delete-overlay replace-overlay)
-	 (setq replace-overlay nil))))
+  (cond ((eq query-replace-highlight 'isearch)
+	 (isearch-dehighlight t)
+	 (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup)
+	 (setq isearch-lazy-highlight-last-string nil))
+	(query-replace-highlight
+	 (when replace-overlay
+	   (delete-overlay replace-overlay)
+	   (setq replace-overlay nil)))))
 
 (defun replace-highlight (start end)
-  (and query-replace-highlight
-       (if replace-overlay
-	   (move-overlay replace-overlay start end (current-buffer))
-	 (setq replace-overlay (make-overlay start end))
-	 (overlay-put replace-overlay 'face
-		      (if (facep 'query-replace)
-			  'query-replace 'region)))))
+  (cond ((eq query-replace-highlight 'isearch)
+	 (isearch-highlight start end)
+	 (isearch-lazy-highlight-new-loop))
+	(query-replace-highlight
+	 (if replace-overlay
+	     (move-overlay replace-overlay start end (current-buffer))
+	   (setq replace-overlay (make-overlay start end))
+	   (overlay-put replace-overlay 'face
+			(if (facep 'query-replace)
+			    'query-replace 'region))))))
 
 ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4
 ;;; replace.el ends here
--- a/lisp/simple.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/simple.el	Tue Dec 14 07:34:55 2004 +0000
@@ -123,33 +123,33 @@
 
 (make-variable-buffer-local 'next-error-function)
 
-(defsubst next-error-buffer-p (buffer 
-			       &optional 
-			       extra-test-inclusive 
+(defsubst next-error-buffer-p (buffer
+			       &optional
+			       extra-test-inclusive
 			       extra-test-exclusive)
   "Test if BUFFER is a next-error capable buffer.
 EXTRA-TEST-INCLUSIVE is called to allow extra buffers.
-EXTRA-TEST-INCLUSIVE is called to disallow buffers."
+EXTRA-TEST-EXCLUSIVE is called to disallow buffers."
   (with-current-buffer buffer
     (or (and extra-test-inclusive (funcall extra-test-inclusive))
 	(and (if extra-test-exclusive (funcall extra-test-exclusive) t)
 	 next-error-function))))
 
-(defun next-error-find-buffer (&optional other-buffer 
-					 extra-test-inclusive 
+(defun next-error-find-buffer (&optional other-buffer
+					 extra-test-inclusive
 					 extra-test-exclusive)
   "Return a next-error capable buffer.
 OTHER-BUFFER will disallow the current buffer.
 EXTRA-TEST-INCLUSIVE is called to allow extra buffers.
-EXTRA-TEST-INCLUSIVE is called to disallow buffers."
+EXTRA-TEST-EXCLUSIVE is called to disallow buffers."
   (or
    ;; 1. If one window on the selected frame displays such buffer, return it.
    (let ((window-buffers
           (delete-dups
            (delq nil (mapcar (lambda (w)
                                (if (next-error-buffer-p
-                                    (window-buffer w) 
-				    extra-test-inclusive extra-test-exclusive)
+                                    (window-buffer w)
+                                    extra-test-inclusive extra-test-exclusive)
                                    (window-buffer w)))
                              (window-list))))))
      (if other-buffer
@@ -159,29 +159,29 @@
    ;; 2. If next-error-last-buffer is set to a live buffer, use that.
    (if (and next-error-last-buffer
             (buffer-name next-error-last-buffer)
-            (next-error-buffer-p next-error-last-buffer 
-				 extra-test-inclusive extra-test-exclusive)
+            (next-error-buffer-p next-error-last-buffer
+                                 extra-test-inclusive extra-test-exclusive)
             (or (not other-buffer)
                 (not (eq next-error-last-buffer (current-buffer)))))
        next-error-last-buffer)
    ;; 3. If the current buffer is a next-error capable buffer, return it.
    (if (and (not other-buffer)
-            (next-error-buffer-p (current-buffer) 
-				 extra-test-inclusive extra-test-exclusive))
+            (next-error-buffer-p (current-buffer)
+                                 extra-test-inclusive extra-test-exclusive))
        (current-buffer))
    ;; 4. Look for a next-error capable buffer in a buffer list.
    (let ((buffers (buffer-list)))
      (while (and buffers
-                 (or (not (next-error-buffer-p 
-			   (car buffers) 
-			   extra-test-inclusive extra-test-exclusive))
+                 (or (not (next-error-buffer-p
+                           (car buffers)
+                           extra-test-inclusive extra-test-exclusive))
                      (and other-buffer (eq (car buffers) (current-buffer)))))
        (setq buffers (cdr buffers)))
      (if buffers
          (car buffers)
        (or (and other-buffer
-                (next-error-buffer-p (current-buffer) 
-				     extra-test-inclusive extra-test-exclusive)
+                (next-error-buffer-p (current-buffer)
+                                     extra-test-inclusive extra-test-exclusive)
                 ;; The current buffer is a next-error capable buffer.
                 (progn
                   (if other-buffer
@@ -646,7 +646,8 @@
        (constrain-to-field nil orig-pos t)))))
 
 (defvar inhibit-mark-movement nil
-  "If non-nil, \\[beginning-of-buffer] and \\[end-of-buffer] does not set the mark.")
+  "If non-nil, movement commands, such as \\[beginning-of-buffer], \
+do not set the mark.")
 
 (defun beginning-of-buffer (&optional arg)
   "Move point to the beginning of the buffer; leave mark at previous position.
@@ -659,8 +660,10 @@
 Don't use this command in Lisp programs!
 \(goto-char (point-min)) is faster and avoids clobbering the mark."
   (interactive "P")
-  (unless (or inhibit-mark-movement (consp arg))
-    (push-mark))
+  (or inhibit-mark-movement
+      (consp arg)
+      (and transient-mark-mode mark-active)
+      (push-mark))
   (let ((size (- (point-max) (point-min))))
     (goto-char (if (and arg (not (consp arg)))
 		   (+ (point-min)
@@ -683,8 +686,10 @@
 Don't use this command in Lisp programs!
 \(goto-char (point-max)) is faster and avoids clobbering the mark."
   (interactive "P")
-  (unless (or inhibit-mark-movement (consp arg))
-    (push-mark))
+  (or inhibit-mark-movement
+      (consp arg)
+      (and transient-mark-mode mark-active)
+      (push-mark))
   (let ((size (- (point-max) (point-min))))
     (goto-char (if (and arg (not (consp arg)))
 		   (- (point-max)
@@ -2987,11 +2992,11 @@
 Many commands change their behavior when Transient Mark mode is in effect
 and the mark is active, by acting on the region instead of their usual
 default part of the buffer's text.  Examples of such commands include
-\\[comment-dwim], \\[flush-lines], \\[ispell], \\[keep-lines],
-\\[query-replace], \\[query-replace-regexp], and \\[undo].  Invoke
-\\[apropos-documentation] and type \"transient\" or \"mark.*active\" at
-the prompt, to see the documentation of commands which are sensitive to
-the Transient Mark mode."
+\\[comment-dwim], \\[flush-lines], \\[keep-lines], \
+\\[query-replace], \\[query-replace-regexp], \\[ispell], and \\[undo].
+Invoke \\[apropos-documentation] and type \"transient\" or
+\"mark.*active\" at the prompt, to see the documentation of
+commands which are sensitive to the Transient Mark mode."
   :global t :group 'editing-basics :require nil)
 
 (defun pop-global-mark ()
@@ -3242,7 +3247,7 @@
 	    (if (if forward
 		    ;; If going forward, don't accept the previous
 		    ;; allowable position if it is before the target line.
-		    (< line-beg (point)) 
+		    (< line-beg (point))
 		  ;; If going backward, don't accept the previous
 		  ;; allowable position if it is still after the target line.
 		  (<= (point) line-end))
@@ -3523,12 +3528,17 @@
   (interactive "p")
   (forward-word (- (or arg 1))))
 
-(defun mark-word (arg)
-  "Set mark arg words away from point.
-If this command is repeated, it marks the next ARG words after the ones
-already marked."
-  (interactive "p")
-  (cond ((and (eq last-command this-command) (mark t))
+(defun mark-word (&optional arg)
+  "Set mark ARG words away from point.
+The place mark goes is the same place \\[forward-word] would
+move to with the same argument.
+If this command is repeated or mark is active in Transient Mark mode,
+it marks the next ARG words after the ones already marked."
+  (interactive "P")
+  (cond ((or (and (eq last-command this-command) (mark t))
+	     (and transient-mark-mode mark-active))
+	 (setq arg (if arg (prefix-numeric-value arg)
+		     (if (< (mark) (point)) -1 1)))
 	 (set-mark
 	  (save-excursion
 	    (goto-char (mark))
@@ -3537,7 +3547,7 @@
 	(t
 	 (push-mark
 	  (save-excursion
-	    (forward-word arg)
+	    (forward-word (prefix-numeric-value arg))
 	    (point))
 	  nil t))))
 
@@ -4021,8 +4031,7 @@
 	 (abort-recursive-edit))
 	(current-prefix-arg
 	 nil)
-	((and transient-mark-mode
-	      mark-active)
+	((and transient-mark-mode mark-active)
 	 (deactivate-mark))
 	((> (recursion-depth) 0)
 	 (exit-recursive-edit))
--- a/lisp/subr.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/subr.el	Tue Dec 14 07:34:55 2004 +0000
@@ -1862,6 +1862,19 @@
 	 ,@body)
      (quit (setq quit-flag t) nil)))
 
+(defmacro while-no-input (&rest body)
+  "Execute BODY only as long as there's no pending input.
+If input arrives, that ends the execution of BODY,
+and `while-no-input' returns nil.  If BODY finishes,
+`while-no-input' returns whatever value BODY produced."
+  (declare (debug t) (indent 0))
+  (let ((catch-sym (make-symbol "input")))
+    `(with-local-quit
+       (catch ',catch-sym
+	 (let ((throw-on-input ',catch-sym))
+	   (when (sit-for 0 0 t)
+	     ,@body))))))
+
 (defmacro combine-after-change-calls (&rest body)
   "Execute BODY, but don't call the after-change functions till the end.
 If BODY makes changes in the buffer, they are recorded
--- a/lisp/term.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/term.el	Tue Dec 14 07:34:55 2004 +0000
@@ -1400,7 +1400,7 @@
 :kl=\\EOD:kd=\\EOB:kr=\\EOC:ku=\\EOA:kN=\\E[6~:kP=\\E[5~:@7=\\E[4~:kh=\\E[1~\
 :mk=\\E[8m:cb=\\E[1K:op=\\E[39;49m:Co#8:pa#64:AB=\\E[4%%dm:AF=\\E[3%%dm:cr=^M\
 :bl=^G:do=^J:le=^H:ta=^I:se=\E[27m:ue=\E24m\
-:kb=^?:kD=^[[3~:sc=\E7:rc=\E8:"
+:kb=^?:kD=^[[3~:sc=\E7:rc=\E8:r1=\Ec:"
 ;;; : -undefine ic
 ;;; don't define :te=\\E[2J\\E[?47l\\E8:ti=\\E7\\E[?47h\
   "termcap capabilities supported")
@@ -2891,6 +2891,10 @@
 			      (term-goto (car term-saved-cursor)
 					 (cdr term-saved-cursor)))
 			  (setq term-terminal-state 0))
+			 ((eq char ?c) ;; \Ec - Reset (terminfo: rs1) 
+			  ;; This is used by the "clear" program.
+			  (setq term-terminal-state 0)
+			  (term-reset-terminal))
 			 ;; The \E#8 reset sequence for xterm. We
 			 ;; probably don't need to handle it, but this
 			 ;; is the code to parse it.
@@ -3018,13 +3022,29 @@
 	  (set-marker term-home-marker (point))
 	  (setq term-current-row (1- term-height))))))
 
+;;; Reset the terminal, delete all the content and set the face to the
+;;; default one. 
+(defun term-reset-terminal ()
+  (erase-buffer)
+  (setq term-current-row 1)
+  (setq term-current-column 1)
+  (setq term-insert-mode nil)
+  (setq term-current-face nil)
+  (setq term-ansi-current-underline 0)
+  (setq term-ansi-current-bold 0)
+  (setq term-ansi-current-reverse 0)
+  (setq term-ansi-current-color 0)
+  (setq term-ansi-current-invisible 0)
+  (setq term-ansi-face-already-done 1)
+  (setq term-ansi-current-bg-color 0))
+
 ;;; New function to deal with ansi colorized output, as you can see you can
 ;;; have any bold/underline/fg/bg/reverse combination. -mm
 
 (defun term-handle-colors-array (parameter)
   (cond
 
-;;; Bold
+;;; Bold  (terminfo: bold)
    ((eq parameter 1)
     (setq term-ansi-current-bold 1))
 
--- a/lisp/textmodes/paragraphs.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/textmodes/paragraphs.el	Tue Dec 14 07:34:55 2004 +0000
@@ -357,13 +357,15 @@
 If ARG is negative, point is put at end of this paragraph, mark is put
 at beginning of this or a previous paragraph.
 
-If this command is repeated, it marks the next ARG paragraphs after (or
-before, if arg is negative) the ones already marked."
+If this command is repeated or mark is active in Transient Mark mode,
+it marks the next ARG paragraphs after (or before, if arg is negative)
+the ones already marked."
   (interactive "p")
   (unless arg (setq arg 1))
   (when (zerop arg)
     (error "Cannot mark zero paragraphs"))
-  (cond ((and (eq last-command this-command) (mark t))
+  (cond ((or (and (eq last-command this-command) (mark t))
+	     (and transient-mark-mode mark-active))
 	 (set-mark
 	  (save-excursion
 	    (goto-char (mark))
--- a/lisp/textmodes/tex-mode.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/textmodes/tex-mode.el	Tue Dec 14 07:34:55 2004 +0000
@@ -1351,7 +1351,9 @@
       (when (eq (char-after) ?{)
 	(let ((newpos (point)))
 	  (when (ignore-errors (backward-sexp 1) t)
-	    (if (looking-at "\\\\end\\>")
+	    (if (or (looking-at "\\\\end\\>")
+		    ;; In case the \\ ends a verbatim section.
+		    (and (looking-at "end\\>") (eq (char-before) ?\\)))
 		(tex-last-unended-begin)
 	      (goto-char newpos))))))))
 
--- a/lisp/url/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/url/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,3 +1,7 @@
+2004-12-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* url-handlers.el: Don't `require' everything eagerly.
+
 2004-11-30  Paul Pogonyshev  <pogonyshev@gmx.net>
 
 	* url-http.el (url-http-handle-cookies): Bind `url-current-object'
@@ -18,8 +22,7 @@
 
 2004-11-12  Masatake YAMATO  <jet@gyve.org>
 
-	* url-mailto.el (url-mailto): Fix a typo in the 
-	comment.
+	* url-mailto.el (url-mailto): Fix a typo in the comment.
 
 2004-11-02  Masatake YAMATO  <jet@gyve.org>
 
@@ -76,12 +79,12 @@
 
 	* url-vars.el (url-passwd-entry-func): Var deleted.
 	(mm-mime-mule-charset-alist): Remove compatibility code for old Gnus.
-	(url-weekday-alist): Renamed from weekday-alist.
-	(url-monthabbrev-alist): Renamed from monthabbrev-alist.
+	(url-weekday-alist): Rename from weekday-alist.
+	(url-monthabbrev-alist): Rename from monthabbrev-alist.
 	(url-vars-unload-hook): Initialize hook var to hold the function.
 
-	* url-util.el (url-get-normalized-date): Use
-	url-weekday-alist and url-monthabbrev-alist.
+	* url-util.el (url-get-normalized-date): Use url-weekday-alist and
+	url-monthabbrev-alist.
 
 	* url-misc.el: Load cl at compile time.
 
@@ -99,8 +102,8 @@
 	* url-news.el (url-snews): Use nntp-open-tls-stream if
 	url-gateway-method is tls.
 
-	* url-ldap.el (url-ldap-certificate-formatter): Use
-	tls-certificate-information if ssl.el is not available.
+	* url-ldap.el (url-ldap-certificate-formatter):
+	Use tls-certificate-information if ssl.el is not available.
 
 	* url-https.el (url-https-create-secure-wrapper): Use tls if ssl
 	is not available.
--- a/lisp/url/url-handlers.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/url/url-handlers.el	Tue Dec 14 07:34:55 2004 +0000
@@ -25,11 +25,21 @@
 
 ;;; Code:
 
-(require 'url)
-(require 'url-parse)
-(require 'url-util)
-(require 'mm-decode)
-(require 'mailcap)
+;; (require 'url)
+(eval-when-compile (require 'url-parse))
+;; (require 'url-util)
+(eval-when-compile (require 'mm-decode))
+;; (require 'mailcap)
+;; The following functions in the byte compiler's warnings are known not
+;; to cause any real problem for the following reasons:
+;; - mm-save-part-to-file, mm-destroy-parts: always used
+;;   after mm-dissect-buffer and defined in the same file.
+;; The following are autoloaded instead of `require'd to avoid eagerly
+;; loading all of URL when turning on url-handler-mode in the .emacs.
+(autoload 'url-retrieve-synchronously "url" "Retrieve url synchronously.")
+(autoload 'url-expand-file-name "url-expand" "Convert url to a fully specified url, and canonicalize it.")
+(autoload 'mm-dissect-buffer "mm-decode" "Dissect the current buffer and return a list of MIME handles.")
+(autoload 'url-scheme-get-property "url-methods" "Get property of a URL SCHEME.")
 
 (eval-when-compile
   (require 'cl))
--- a/lisp/vc-svn.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/vc-svn.el	Tue Dec 14 07:34:55 2004 +0000
@@ -447,10 +447,14 @@
       (vc-insert-file (expand-file-name ".svn/entries" dirname)))
     (goto-char (point-min))
     (when (re-search-forward
-	   (concat "name=\"svn:this_dir\"[\n\t ]*"
-		   "\\([-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
+	   ;; Old `svn' used name="svn:dir", newer use just name="".
+	   (concat "name=\"\\(?:svn:this_dir\\)?\"[\n\t ]*"
+		   "\\(?:[-a-z]+=\"[^\"]*\"[\n\t ]*\\)*?"
 		   "url=\"\\([^\"]+\\)\"") nil t)
-      (match-string 2))))
+      ;; This is not a hostname but a URL.  This may actually be considered
+      ;; as a feature since it allows vc-svn-stay-local to specify different
+      ;; behavior for different modules on the same server.
+      (match-string 1))))
 
 (defun vc-svn-parse-status (localp)
   "Parse output of \"svn status\" command in the current buffer.
@@ -505,6 +509,30 @@
   (and (string-match "^[0-9]" tag)
        (not (string-match "[^0-9]" tag))))
 
+;; Support for `svn annotate'
+
+(defun vc-svn-annotate-command (file buf &optional rev)
+  (vc-svn-command buf 0 file "annotate" (if rev (concat "-r" rev))))
+
+(defun vc-svn-annotate-time-of-rev (rev)
+  ;; Arbitrarily assume 10 commmits per day.
+  (/ (string-to-number rev) 10.0))
+
+(defun vc-svn-annotate-current-time ()
+  (vc-svn-annotate-time-of-rev vc-annotate-parent-rev))
+
+(defconst vc-svn-annotate-re "[ \t]*\\([0-9]+\\)[ \t]+[^\t ]+ ")
+
+(defun vc-svn-annotate-time ()
+  (when (looking-at vc-svn-annotate-re)
+    (goto-char (match-end 0))
+    (vc-svn-annotate-time-of-rev (match-string 1))))
+
+(defun vc-svn-annotate-extract-revision-at-line ()
+  (save-excursion
+    (beginning-of-line)
+    (if (looking-at vc-svn-annotate-re) (match-string 1))))
+
 (provide 'vc-svn)
 
 ;; arch-tag: 02f10c68-2b4d-453a-90fc-1eee6cfb268d
--- a/lisp/xml.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/xml.el	Tue Dec 14 07:34:55 2004 +0000
@@ -179,6 +179,8 @@
       xml)))
 
 
+(defvar xml-name-re)
+(defvar xml-entity-value-re)
 (let* ((start-chars (concat "[:alpha:]:_"))
        (name-chars  (concat "-[:digit:]." start-chars))
 ;;[3]   	S	   ::=   	(#x20 | #x9 | #xD | #xA)+
--- a/lisp/xt-mouse.el	Sat Dec 11 02:29:07 2004 +0000
+++ b/lisp/xt-mouse.el	Tue Dec 14 07:34:55 2004 +0000
@@ -139,12 +139,13 @@
 						  default-header-line-format)
 					      1
 					    0)))
-		    (move-to-column (+ (car where) (current-column)
+		    (move-to-column (- (+ (car where) (current-column)
 				       (if (string-match "\\` \\*Minibuf"
 							 (buffer-name))
 					   (- (minibuffer-prompt-width))
 					 0)
-				       (max 0 (1- (window-hscroll)))))
+				       (max 0 (1- (window-hscroll))))
+				       left-margin-width))
 		    (point))
 		where))
 	 (mouse (intern
--- a/lispref/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/lispref/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,3 +1,29 @@
+2004-12-11  Richard M. Stallman  <rms@gnu.org>
+
+	* display.texi (Line Height): Rewrite text for clarity.
+
+2004-12-11  Kim F. Storm  <storm@cua.dk>
+
+	* display.texi (Display): Add node "Line Height" to menu.
+	(Line Height): New node.  Move full description of line-spacing
+	and line-height text properties here from text.texi.
+	(Scroll Bars): Add vertical-scroll-bar variable.
+
+	* frames.texi (Window Frame Parameters): Remove line-height defvar.
+
+	* locals.texi (Standard Buffer-Local Variables): Fix xref for
+	line-spacing and vertical-scroll-bar.
+
+	* text.texi (Special Properties): Just mention line-spacing and
+	line-height here, add xref to new "Line Height" node.
+
+2004-12-09  Thien-Thi Nguyen  <ttn@gnu.org>
+
+	* frames.texi (Window Frame Parameters): New @defvar for `line-spacing'.
+
+	* locals.texi (Standard Buffer-Local Variables):
+	Add @xref for `line-spacing'.
+
 2004-12-05  Richard M. Stallman  <rms@gnu.org>
 
 	* Makefile.in (maintainer-clean): Remove the info files
--- a/lispref/display.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/lispref/display.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -23,6 +23,7 @@
 * Temporary Displays::  Displays that go away automatically.
 * Overlays::            Use overlays to highlight parts of the buffer.
 * Width::               How wide a character or string is on the screen.
+* Line Height::         Controlling the height of lines.
 * Faces::               A face defines a graphics style for text characters:
                           font, colors, etc.
 * Fringes::             Controlling window fringes.
@@ -1510,6 +1511,98 @@
 @end example
 @end defun
 
+@node Line Height
+@section Line Height
+@cindex line height
+
+  The total height of each display line consists of the height of the
+contents of the line, and additional vertical line spacing below the
+display row.
+
+  The height of the line contents is normally determined from the
+maximum height of any character or image on that display line,
+including the final newline if there is one.  (A line that is
+continued doesn't include a final newline.)  In the most common case,
+the line height equals the height of the default frame font.
+
+  There are several ways to explicitly control or change the line
+height, either by specifying an absolute height for the display line,
+or by adding additional vertical space below one or all lines.
+
+@kindex line-height @r{(text property)}
+  A newline can have a @code{line-height} text or overlay property
+that controls the total height of the display line ending in that
+newline.  If the property value is zero, the displayed height of the
+line is exactly what its contents need; no line-spacing is added.
+This case is useful for tiling small images or image slices without
+adding blank areas between the images.
+
+  If the property value is not zero, it specifies a desired height,
+@var{line-height}.  There are several ways it can do this:
+
+@table @code
+@item @var{integer}
+If the property is a positive integer, @var{line-height} is that integer.
+@item @var{float}
+If the property is a float, @var{float}, @var{line-height} is @var{float}
+times the frame's default line height.
+@item (@var{ratio} . @var{face})
+If the property is a cons of the format shown, @var{line-height} is
+@var{ratio} times the height of face @var{face}.  @var{ratio} can be
+any type of number.  If @var{face} is @code{t}, it refers to the
+current face.
+@end table
+
+  Thus, any valid nonzero property value specifies a height in pixels,
+@var{line-height}, one way or another.  If the line contents' height
+is less than @var{line-height}, Emacs adds extra vertical space above
+the line to achieve the total height @var{line-height}.  Otherwise,
+@var{line-height} has no effect.
+
+  If you don't specify the @code{line-height} propery, the line's
+height consists of the contents' height plus the line spacing.
+
+@vindex default-line-spacing
+  You can specify the line spacing for all lines in a frame with the
+@code{line-spacing} frame parameter, @xref{Window Frame Parameters}.
+However, if the variable @code{default-line-spacing} is
+non-@code{nil}, it overrides the frame's @code{line-spacing}
+parameter.  An integer value specifies the number of pixels put below
+lines on window systems.  A floating point number specifies the
+spacing relative to the frame's default line height.
+
+@vindex line-spacing
+  You can specify the line spacing for all lines in a buffer via the
+buffer-local @code{line-spacing} variable.  An integer value specifies
+the number of pixels put below lines on window systems.  A floating
+point number specifies the spacing relative to the default frame line
+height.  This overrides line spacings specified for the frame.
+
+@kindex line-spacing @r{(text property)}
+  Finally, a newline can have a @code{line-spacing} text or overlay
+property that controls the height of the display line ending with that
+newline.  The property value overrides the default frame line spacing
+and the buffer local @code{line-spacing} variable.
+
+  One way or another, these mechanisms specify a line spacing for each
+line.  Let's call the value @var{line-spacing}.
+
+  If the @var{line-spacing} value is a positive integer, it specifies
+the number of pixels of additional vertical space.  This space appears
+below the display line contents.
+
+  If the @var{line-spacing} value is a floating point number or cons,
+the additional vertical space is @var{line-spacing} times the frame
+default line height.
+
+@ignore  @c I think we may want to delete this, so don't document it -- rms.
+  If the @var{line-spacing} value is a cons @code{(total . @var{spacing})}
+where @var{spacing} is any of the forms described above, the value of
+@var{spacing} specifies the total displayed height of the line,
+regardless of the height of the characters in it.  This is equivalent
+to using the @code{line-height} property.
+@end ignore
+
 @node Faces
 @section Faces
 @cindex faces
@@ -2826,7 +2919,14 @@
 @code{scroll-bar-width} specifies how wide they are (@code{nil}
 meaning the default).  @xref{Window Frame Parameters}.
 
-You can also control this for individual windows.  Call the function
+@vindex vertical-scroll-bar
+  You can enable or disable scroll bars for a particular buffer,
+by setting the variable @code{vertical-scroll-bar}.  This variable
+automatically becomes buffer-local when set.  The possible values are
+@code{left}, @code{right}, @code{t}, which means to use the
+frame's default, and @code{nil} for no scroll bar.
+
+  You can also control this for individual windows.  Call the function
 @code{set-window-scroll-bars} to specify what to do for a specific window:
 
 @defun set-window-scroll-bars window width &optional vertical-type horizontal-type
--- a/lispref/locals.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/lispref/locals.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -132,8 +132,7 @@
 @xref{Display Margins}.
 
 @item line-spacing
-@c Cause an error so we will fix this.
-@xref{Yet to be written}.
+@xref{Line Height}.
 
 @item local-abbrev-table
 @xref{Abbrevs}.
@@ -199,7 +198,7 @@
 @xref{Mode Line Variables}.
 
 @item vertical-scroll-bar
-@xref{Yet to be written}.
+@xref{Scroll Bars}.
 @end table
 
 @ignore
--- a/lispref/text.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/lispref/text.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -3002,45 +3002,13 @@
 A newline can have a @code{line-spacing} text or overlay property that
 controls the height of the display line ending with that newline.  The
 property value overrides the default frame line spacing and the buffer
-local @code{line-spacing} variable.  We will call the property value
-@var{line-spacing}.
-
-If @var{line-spacing} is a positive integer, the value specifies
-additional vertical space, below the display line, in pixels.
-
-If @var{line-spacing} is a floating point number or cons, the
-additional vertical space is the product of @var{line-spacing} and the
-default frame line height.
-
-If the @var{line-spacing} value is a cons @code{(total .
-@var{spacing})} where @var{spacing} is any of the forms described
-above, the value of @var{spacing} specifies the total displayed height
-of the line, regardless of the height of the characters in it.  This
-is equivalent to using the @code{line-height} property.
+local @code{line-spacing} variable.  @xref{Line Height}.
 
 @item line-height
 @kindex line-height @r{(text property)}
 A newline can have a @code{line-height} text or overlay property that
 controls the total height of the display line ending in that newline.
-We will call the property value @var{line-height}.
-
-If @var{line-height} is 0, the height of the line is determined solely
-from its contents; nothing is added.  Any @code{line-spacing} property
-on this newline is ignored.  This case is useful for tiling small
-images or image slices without adding blank areas between the images.
-
-If @var{line-height} is a positive integer, the value specifies the
-minimum line height in pixels.  The line's ascent height is
-increased as necessary to achieve the specified height.
-
-If @var{line-height} is a floating point number, the minimum line
-height is the product of @var{line-height} and the default frame line
-height.
-
-If @var{line-height} is a cons @code{(@var{ratio} . @var{face})}, the
-minimum line height is calculated as @var{ratio} times the height of
-face @var{face}.  The @var{ratio} is an integer or a floating point
-number.  If @var{face} is @code{t}, it refers to the current face.
+@xref{Line Height}.
 
 @item modification-hooks
 @cindex change hooks for a character
--- a/man/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,3 +1,46 @@
+2004-12-13  Jay Belanger  <belanger@truman.edu>
+
+	* calc.texi: Fix some TeX definitions.
+
+2004-12-12  Juri Linkov  <juri@jurta.org>
+
+	* misc.texi (FFAP): Add C-x C-r, C-x C-v, C-x C-d,
+	C-x 4 r, C-x 4 d, C-x 5 r, C-x 5 d.
+
+	* dired.texi (Dired Navigation): Add @r{(Dired)} to M-g.
+	(Misc Dired Commands): Add @r{(Dired)} to w.
+
+2004-12-12  Juri Linkov  <juri@jurta.org>
+
+	* mark.texi (Marking Objects): Marking commands also extend the
+	region when mark is active in Transient Mark mode.
+
+2004-12-09  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* reftex.texi (Imprint): Remove erroneous @value's.
+
+2004-12-08  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* custom.texi (Saving Customizations): Emacs only loads the custom
+	file automatically after the init file in version 21.4 or later.
+	Adapt text and examples to this fact.
+
+	* makefile.w32-in (INFO_TARGETS, DVI_TARGETS, $(infodir)/org)
+	(org.dvi, $(infodir)/url, url.dvi, clean): Add org and url manuals.
+
+2004-12-08  Jay Belanger  <belanger@truman.edu>
+
+	* calc.texi (Starting Calc): Remove comment about installation.
+	(Keypad Mode Overview): Remove comment about Emacs 19 support.
+
+2004-12-08  Luc Teirlinck  <teirllm@auburn.edu>
+
+	* url.texi: Update @setfilename.
+	(Getting Started): No need to worry about Gnus versions.
+	(Dealing with HTTP documents): Use @inforef.
+
+	* org.texi: Fix @direntry file name.
+
 2004-12-07  Luc Teirlinck  <teirllm@auburn.edu>
 
 	* frames.texi (Scroll Bars): The option `scroll-bar-mode' has to
@@ -107,6 +150,13 @@
 	to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for
 	suggestions.
 
+2004-12-08  Reiner Steib  <Reiner.Steib@gmx.de>
+
+	* gnus-faq.texi ([5.1]): Added missing bracket.
+
+	* gnus.texi (Filtering Spam Using The Spam ELisp Package): Index
+	`spam-initialize'.
+
 2004-11-22  Reiner Steib  <Reiner.Steib@gmx.de>
 
 	* message.texi (Various Message Variables): Mention that all mail
@@ -114,10 +164,6 @@
 
 	* gnus.texi (Splitting Mail): Clarify bogus group.
 
-2004-11-16  Reiner Steib  <Reiner.Steib@gmx.de>
-
-	* gnus.texi (Filtering Spam Using The Spam ELisp Package): 
-
 2004-11-02  Katsumi Yamaoka  <yamaoka@jpl.org>
 
 	* emacs-mime.texi (Encoding Customization): Fix
--- a/man/calc.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/calc.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -13,28 +13,20 @@
 @c @infoline foo
 @c    `foo' will appear only in non-TeX output
 
-@c In TeX output, @tmath{expr} will typeset expr in  math mode.
-@c In any output, @expr{expr} will typeset an expression;
+@c @expr{expr} will typeset an expression;
 @c $x$ in TeX, @samp{x} otherwise.
 
 @iftex
 @macro texline{stuff}
 \stuff\
 @end macro
-@macro tmath{stuff}
-@tex
-$\stuff\$
-@end tex
-@end macro
 @alias infoline=comment
-@c @alias expr=math
-@tex
-\gdef\expr#1{\tex 
-             \let\t\ttfont 
-             \turnoffactive 
-             $#1$
-             \endgroup}
-@end tex
+@tex
+\gdef\exprsetup{\tex \let\t\ttfont \turnoffactive}
+\gdef\expr{\exprsetup$\exprfinish}
+\gdef\exprfinish#1{#1$\endgroup}
+@end tex
+@alias mathit=expr
 @macro cpi{}
 @math{@pi{}}
 @end macro
@@ -49,6 +41,7 @@
 \stuff\
 @end macro
 @alias expr=samp
+@alias mathit=i
 @macro cpi{}
 @expr{pi}
 @end macro
@@ -624,12 +617,12 @@
 
 @noindent
 Type @kbd{2 @key{RET} 3 + Q} to compute 
-@texline @tmath{\sqrt{2+3} = 2.2360679775}.
+@texline @math{\sqrt{2+3} = 2.2360679775}.
 @infoline the square root of 2+3, which is 2.2360679775.
 
 @noindent
 Type @kbd{P 2 ^} to compute 
-@texline @tmath{\pi^2 = 9.86960440109}.
+@texline @math{\pi^2 = 9.86960440109}.
 @infoline the value of `pi' squared, 9.86960440109.
 
 @noindent
@@ -648,12 +641,12 @@
 
 @noindent
 Type @kbd{' sqrt(2+3) @key{RET}} to compute 
-@texline @tmath{\sqrt{2+3}}.
+@texline @math{\sqrt{2+3}}.
 @infoline the square root of 2+3.
 
 @noindent
 Type @kbd{' pi^2 @key{RET}} to enter 
-@texline @tmath{\pi^2}.
+@texline @math{\pi^2}.
 @infoline `pi' squared.  
 To evaluate this symbolic formula as a number, type @kbd{=}.
 
@@ -713,10 +706,10 @@
 
 @noindent
 Type @kbd{v t} to transpose this 
-@texline @tmath{3\times2}
+@texline @math{3\times2}
 @infoline 3x2 
 matrix into a 
-@texline @tmath{2\times3}
+@texline @math{2\times3}
 @infoline 2x3
 matrix.  Type @w{@kbd{v u}} to unpack the rows into two separate
 vectors.  Now type @w{@kbd{V R + @key{TAB} V R +}} to compute the sums
@@ -825,10 +818,6 @@
 (that's Meta with the letter @kbd{x}), then, at the prompt,
 type the full command (like @kbd{calc-keypad}) and press Return.
 
-If you type @kbd{M-x calc} and Emacs still doesn't recognize the
-command (it will say @samp{[No match]} when you try to press
-@key{RET}), then Calc has not been properly installed.
-
 The same commands (like @kbd{M-# c} or @kbd{M-# M-#}) that start
 the Calculator also turn it off if it is already on.
 
@@ -871,9 +860,9 @@
 
 In this case, the trail shows that four numbers (17.3, 3, 2, and 4)
 were first entered into the Calculator, then the 2 and 4 were
-multiplied to get 8, then the 3 and 8 were subtracted to get @i{-5}.
+multiplied to get 8, then the 3 and 8 were subtracted to get @mathit{-5}.
 (The @samp{>} symbol shows that this was the most recent calculation.)
-The net result is the two numbers 17.3 and @i{-5} sitting on the stack.
+The net result is the two numbers 17.3 and @mathit{-5} sitting on the stack.
 
 Most Calculator commands deal explicitly with the stack only, but
 there is a set of commands that allow you to search back through
@@ -934,7 +923,7 @@
 
 Quick Mode is very simple:  It prompts you to type any formula in
 standard algebraic notation (like @samp{4 - 2/3}) and then displays
-the result at the bottom of the Emacs screen (@i{3.33333333333}
+the result at the bottom of the Emacs screen (@mathit{3.33333333333}
 in this case).  You are then back in the same editing buffer you
 were in before, ready to continue editing or to type @kbd{M-# q}
 again to do another quick calculation.  The result of the calculation
@@ -954,8 +943,7 @@
 @dfn{Keypad Mode} is a mouse-based interface to the Calculator.
 It is designed for use with terminals that support a mouse.  If you
 don't have a mouse, you will have to operate keypad mode with your
-arrow keys (which is probably more trouble than it's worth).  Keypad
-mode is currently not supported under Emacs 19.
+arrow keys (which is probably more trouble than it's worth).
 
 Type @kbd{M-# k} to turn Keypad Mode on or off.  Once again you
 get two new windows, this time on the righthand side of the screen
@@ -1348,7 +1336,7 @@
 Calc was originally started as a two-week project to occupy a lull
 in the author's schedule.  Basically, a friend asked if I remembered
 the value of 
-@texline @tmath{2^{32}}.
+@texline @math{2^{32}}.
 @infoline @expr{2^32}.  
 I didn't offhand, but I said, ``that's easy, just call up an
 @code{xcalc}.''  @code{Xcalc} duly reported that the answer to our
@@ -1670,7 +1658,7 @@
 if you're right.  @xref{RPN Answer 1, 1}. (@bullet{})
 
 (@bullet{}) @strong{Exercise 2.}  Compute 
-@texline @tmath{(2\times4) + (7\times9.4) + {5\over4}}
+@texline @math{(2\times4) + (7\times9.4) + {5\over4}}
 @infoline @expr{2*4 + 7*9.5 + 5/4} 
 using the stack.  @xref{RPN Answer 2, 2}. (@bullet{})
 
@@ -2005,7 +1993,7 @@
 @end tex
 
 @noindent
-The result of this expression will be the number @i{-6.99999826533}.
+The result of this expression will be the number @mathit{-6.99999826533}.
 
 Calc's order of evaluation is the same as for most computer languages,
 except that @samp{*} binds more strongly than @samp{/}, as the above
@@ -2014,7 +2002,7 @@
 
 Operators at the same level are evaluated from left to right, except
 that @samp{^} is evaluated from right to left.  Thus, @samp{2-3-4} is
-equivalent to @samp{(2-3)-4} or @i{-5}, whereas @samp{2^3^4} is equivalent
+equivalent to @samp{(2-3)-4} or @mathit{-5}, whereas @samp{2^3^4} is equivalent
 to @samp{2^(3^4)} (a very large integer; try it!).
 
 If you tire of typing the apostrophe all the time, there is an
@@ -2084,7 +2072,7 @@
 of algebraic entries, using the @kbd{$} sign to tie them together.
 In an algebraic formula, @kbd{$} represents the number on the top
 of the stack.  Here, we perform the calculation 
-@texline @tmath{\sqrt{2\times4+1}},
+@texline @math{\sqrt{2\times4+1}},
 @infoline @expr{sqrt(2*4+1)},
 which on a traditional calculator would be done by pressing
 @kbd{2 * 4 + 1 =} and then the square-root key.
@@ -2746,11 +2734,11 @@
 @noindent
 The shift-@kbd{S} command computes the sine of an angle.  The sine
 of 45 degrees is 
-@texline @tmath{\sqrt{2}/2};
+@texline @math{\sqrt{2}/2};
 @infoline @expr{sqrt(2)/2}; 
 squaring this yields @expr{2/4 = 0.5}.  However, there has been a slight
 roundoff error because the representation of 
-@texline @tmath{\sqrt{2}/2}
+@texline @math{\sqrt{2}/2}
 @infoline @expr{sqrt(2)/2} 
 wasn't exact.  The @kbd{c 1} command is a handy way to clean up numbers
 in this case; it temporarily reduces the precision by one digit while it
@@ -2791,7 +2779,7 @@
 
 @noindent
 Here we compute the Inverse Sine of 
-@texline @tmath{\sqrt{0.5}},
+@texline @math{\sqrt{0.5}},
 @infoline @expr{sqrt(0.5)}, 
 first in radians, then in degrees.
 
@@ -2979,9 +2967,9 @@
 
 Let's compute the sine and cosine of an angle, and verify the
 identity 
-@texline @tmath{\sin^2x + \cos^2x = 1}.
+@texline @math{\sin^2x + \cos^2x = 1}.
 @infoline @expr{sin(x)^2 + cos(x)^2 = 1}.  
-We'll arbitrarily pick @i{-64} degrees as a good value for @expr{x}.
+We'll arbitrarily pick @mathit{-64} degrees as a good value for @expr{x}.
 With the angular mode set to degrees (type @w{@kbd{m d}}), do:
 
 @smallexample
@@ -3002,7 +2990,7 @@
 of squares, command.
 
 Another identity is 
-@texline @tmath{\displaystyle\tan x = {\sin x \over \cos x}}.
+@texline @math{\displaystyle\tan x = {\sin x \over \cos x}}.
 @infoline @expr{tan(x) = sin(x) / cos(x)}.
 @smallexample
 @group
@@ -3017,7 +3005,7 @@
 
 A physical interpretation of this calculation is that if you move
 @expr{0.89879} units downward and @expr{0.43837} units to the right,
-your direction of motion is @i{-64} degrees from horizontal.  Suppose
+your direction of motion is @mathit{-64} degrees from horizontal.  Suppose
 we move in the opposite direction, up and to the left:
 
 @smallexample
@@ -3065,7 +3053,7 @@
 
 A similar identity is supposed to hold for hyperbolic sines and cosines,
 except that it is the @emph{difference}
-@texline @tmath{\cosh^2x - \sinh^2x}
+@texline @math{\cosh^2x - \sinh^2x}
 @infoline @expr{cosh(x)^2 - sinh(x)^2} 
 that always equals one.  Let's try to verify this identity.
 
@@ -3172,7 +3160,7 @@
 
 If you take the factorial of a non-integer, Calc uses a generalized
 factorial function defined in terms of Euler's Gamma function
-@texline @tmath{\Gamma(n)}
+@texline @math{\Gamma(n)}
 @infoline @expr{gamma(n)}
 (which is itself available as the @kbd{f g} command).
 
@@ -3189,13 +3177,13 @@
 
 @noindent
 Here we verify the identity 
-@texline @tmath{n! = \Gamma(n+1)}.
+@texline @math{n! = \Gamma(n+1)}.
 @infoline @expr{@var{n}!@: = gamma(@var{n}+1)}.
 
 The binomial coefficient @var{n}-choose-@var{m}
-@texline or @tmath{\displaystyle {n \choose m}}
+@texline or @math{\displaystyle {n \choose m}}
 is defined by
-@texline @tmath{\displaystyle {n! \over m! \, (n-m)!}}
+@texline @math{\displaystyle {n! \over m! \, (n-m)!}}
 @infoline @expr{n!@: / m!@: (n-m)!}
 for all reals @expr{n} and @expr{m}.  The intermediate results in this
 formula can become quite large even if the final result is small; the
@@ -3480,7 +3468,7 @@
 
 (@bullet{}) @strong{Exercise 1.}  Use @samp{*} to sum along the rows
 of the above 
-@texline @tmath{2\times3}
+@texline @math{2\times3}
 @infoline 2x3 
 matrix to get @expr{[6, 15]}.  Now use @samp{*} to sum along the columns
 to get @expr{[5, 7, 9]}. 
@@ -3631,10 +3619,10 @@
 come out right, and the answer would be incorrect.  If you
 don't feel safe letting Calc take either interpretation of your
 vectors, use explicit 
-@texline @tmath{N\times1}
+@texline @math{N\times1}
 @infoline Nx1
 or
-@texline @tmath{1\times N}
+@texline @math{1\times N}
 @infoline 1xN
 matrices instead.  In this case, you would enter the original column
 vector as @samp{[[6], [2], [3]]} or @samp{[6; 2; 3]}.
@@ -3683,7 +3671,7 @@
 $A^T A \, X = A^T B$, where $A^T$ is the transpose \samp{trn(A)}.
 @end tex
 Now 
-@texline @tmath{A^T A}
+@texline @math{A^T A}
 @infoline @expr{trn(A)*A} 
 is a square matrix so a solution is possible.  It turns out that the
 @expr{X} vector you compute in this way will be a ``least-squares''
@@ -3779,7 +3767,7 @@
 
 (@bullet{}) @strong{Exercise 1.}  Compute a vector of powers of two
 from 
-@texline @tmath{2^{-4}}
+@texline @math{2^{-4}}
 @infoline @expr{2^-4} 
 to @expr{2^4}.  @xref{List Answer 1, 1}. (@bullet{})
 
@@ -3983,7 +3971,7 @@
 
 @noindent
 where 
-@texline @tmath{\sum x}
+@texline @math{\sum x}
 @infoline @expr{sum(x)} 
 represents the sum of all the values of @expr{x}.  While there is an
 actual @code{sum} function in Calc, it's easier to sum a vector using a
@@ -4088,7 +4076,7 @@
 @end smallexample
 
 Let's ``plot'' this straight line approximation, 
-@texline @tmath{y \approx m x + b},
+@texline @math{y \approx m x + b},
 @infoline @expr{m x + b}, 
 and compare it with the original data.
 
@@ -4341,7 +4329,7 @@
 @cindex Maximizing a function over a list of values
 @c [fix-ref Numerical Solutions]
 (@bullet{}) @strong{Exercise 8.}  Compute a list of values of Bessel's
-@texline @tmath{J_1(x)}
+@texline @math{J_1(x)}
 @infoline @expr{J1} 
 function @samp{besJ(1,x)} for @expr{x} from 0 to 5 in steps of 0.25.
 Find the value of @expr{x} (from among the above set of values) for
@@ -4353,7 +4341,7 @@
 
 @cindex Digits, vectors of
 (@bullet{}) @strong{Exercise 9.}  You are given an integer in the range
-@texline @tmath{0 \le N < 10^m}
+@texline @math{0 \le N < 10^m}
 @infoline @expr{0 <= N < 10^m} 
 for @expr{m=12} (i.e., an integer of less than
 twelve digits).  Convert this integer into a vector of @expr{m}
@@ -4369,14 +4357,14 @@
 
 (@bullet{}) @strong{Exercise 11.}  The area of a circle of radius one
 is @cpi{}.  The area of the 
-@texline @tmath{2\times2}
+@texline @math{2\times2}
 @infoline 2x2
 square that encloses that circle is 4.  So if we throw @var{n} darts at
 random points in the square, about @cpiover{4} of them will land inside
 the circle.  This gives us an entertaining way to estimate the value of 
 @cpi{}.  The @w{@kbd{k r}}
 command picks a random number between zero and the value on the stack.
-We could get a random floating-point number between @i{-1} and 1 by typing
+We could get a random floating-point number between @mathit{-1} and 1 by typing
 @w{@kbd{2.0 k r 1 -}}.  Build a vector of 100 random @expr{(x,y)} points in
 this square, then use vector mapping and reduction to count how many
 points lie inside the unit circle.  Hint:  Use the @kbd{v b} command.
@@ -4388,12 +4376,12 @@
 of vertical lines with a spacing of one inch.  Toss a one-inch matchstick
 onto the field.  The probability that the matchstick will land crossing
 a line turns out to be 
-@texline @tmath{2/\pi}.
+@texline @math{2/\pi}.
 @infoline @expr{2/pi}.  
 Toss 100 matchsticks to estimate @cpi{}.  (If you want still more fun,
 the probability that the GCD (@w{@kbd{k g}}) of two large integers is
 one turns out to be 
-@texline @tmath{6/\pi^2}.
+@texline @math{6/\pi^2}.
 @infoline @expr{6/pi^2}.
 That provides yet another way to estimate @cpi{}.)
 @xref{List Answer 12, 12}. (@bullet{})
@@ -4423,7 +4411,7 @@
 function you give to the starting value 0, 1, 2, up to @var{n} times
 and returns a vector of the results.  Use this command to create a
 ``random walk'' of 50 steps.  Start with the two-dimensional point
-@expr{(0,0)}; then take one step a random distance between @i{-1} and 1
+@expr{(0,0)}; then take one step a random distance between @mathit{-1} and 1
 in both @expr{x} and @expr{y}; then take another step, and so on.  Use the
 @kbd{g f} command to display this random walk.  Now modify your random
 walk to walk a unit distance, but in a random direction, at each step.
@@ -4502,7 +4490,7 @@
 @end smallexample
 
 @noindent
-The square root of @i{-9} is by default rendered in rectangular form
+The square root of @mathit{-9} is by default rendered in rectangular form
 (@w{@expr{0 + 3i}}), but we can convert it to polar form (3 with a
 phase angle of 90 degrees).  All the usual arithmetic and scientific
 operations are defined on both types of complex numbers.
@@ -4527,14 +4515,14 @@
 
 @noindent
 Since infinity is infinitely large, multiplying it by any finite
-number (like @i{-17}) has no effect, except that since @i{-17}
+number (like @mathit{-17}) has no effect, except that since @mathit{-17}
 is negative, it changes a plus infinity to a minus infinity.
-(``A huge positive number, multiplied by @i{-17}, yields a huge
+(``A huge positive number, multiplied by @mathit{-17}, yields a huge
 negative number.'')  Adding any finite number to infinity also
 leaves it unchanged.  Taking an absolute value gives us plus
 infinity again.  Finally, we add this plus infinity to the minus
 infinity we had earlier.  If you work it out, you might expect
-the answer to be @i{-72} for this.  But the 72 has been completely
+the answer to be @mathit{-72} for this.  But the 72 has been completely
 lost next to the infinities; by the time we compute @w{@samp{inf - inf}}
 the finite difference between them, if any, is undetectable.
 So we say the result is @dfn{indeterminate}, which Calc writes
@@ -4691,7 +4679,7 @@
 
 @cindex Torus, volume of
 (@bullet{}) @strong{Exercise 7.}  The volume of a torus (a donut shape) is
-@texline @tmath{2 \pi^2 R r^2}
+@texline @math{2 \pi^2 R r^2}
 @infoline @w{@expr{2 pi^2 R r^2}} 
 where @expr{R} is the radius of the circle that
 defines the center of the tube and @expr{r} is the radius of the tube
@@ -4791,7 +4779,7 @@
 @cindex Fermat, primality test of
 (@bullet{}) @strong{Exercise 10.}  A theorem of Pierre de Fermat
 says that 
-@texline @w{@tmath{x^{n-1} \bmod n = 1}}
+@texline @w{@math{x^{n-1} \bmod n = 1}}
 @infoline @expr{x^(n-1) mod n = 1}
 if @expr{n} is a prime number and @expr{x} is an integer less than
 @expr{n}.  If @expr{n} is @emph{not} a prime number, this will
@@ -4819,7 +4807,7 @@
 
 (@bullet{}) @strong{Exercise 11.}  A rule of thumb is that one year
 is about 
-@texline @tmath{\pi \times 10^7}
+@texline @math{\pi \times 10^7}
 @infoline @w{@expr{pi * 10^7}} 
 seconds.  What time will it be that many seconds from right now?
 @xref{Types Answer 11, 11}. (@bullet{})
@@ -5126,7 +5114,7 @@
 
 @noindent
 Calc has invented the variable @samp{s1} to represent an unknown sign;
-it is supposed to be either @i{+1} or @i{-1}.  Here we have used
+it is supposed to be either @mathit{+1} or @mathit{-1}.  Here we have used
 the ``let'' command to evaluate the expression when the sign is negative.
 If we plugged this into our second derivative we would get the same,
 negative, answer, so @expr{x = -1.19023} is also a maximum.
@@ -5296,7 +5284,7 @@
 
 (@bullet{}) @strong{Exercise 3.}  Find the integral from 1 to @expr{y}
 of 
-@texline @tmath{x \sin \pi x}
+@texline @math{x \sin \pi x}
 @infoline @w{@expr{x sin(pi x)}} 
 (where the sine is calculated in radians).  Find the values of the
 integral for integers @expr{y} from 1 to 5.  @xref{Algebra Answer 3,
@@ -5305,7 +5293,7 @@
 Calc's integrator can do many simple integrals symbolically, but many
 others are beyond its capabilities.  Suppose we wish to find the area
 under the curve 
-@texline @tmath{\sin x \ln x}
+@texline @math{\sin x \ln x}
 @infoline @expr{sin(x) ln(x)} 
 over the same range of @expr{x}.  If you entered this formula and typed
 @kbd{a i x @key{RET}} (don't bother to try this), Calc would work for a
@@ -5447,7 +5435,7 @@
 @end tex
 
 Compute the integral from 1 to 2 of 
-@texline @tmath{\sin x \ln x}
+@texline @math{\sin x \ln x}
 @infoline @expr{sin(x) ln(x)} 
 using Simpson's rule with 10 slices.  
 @xref{Algebra Answer 4, 4}. (@bullet{})
@@ -5993,7 +5981,7 @@
 @end ignore
 @tindex Si
 (@bullet{}) @strong{Exercise 1.}  The ``sine integral'' function
-@texline @tmath{{\rm Si}(x)}
+@texline @math{{\rm Si}(x)}
 @infoline @expr{Si(x)} 
 is defined as the integral of @samp{sin(t)/t} for
 @expr{t = 0} to @expr{x} in radians.  (It was invented because this
@@ -6071,7 +6059,7 @@
 @enumerate
 @item
 Compute 
-@texline @tmath{\displaystyle{\sin x \over x}},
+@texline @math{\displaystyle{\sin x \over x}},
 @infoline @expr{sin(x) / x}, 
 where @expr{x} is the number on the top of the stack.
 
@@ -6137,13 +6125,13 @@
 @cindex Phi, golden ratio
 A fascinating property of the Fibonacci numbers is that the @expr{n}th
 Fibonacci number can be found directly by computing 
-@texline @tmath{\phi^n / \sqrt{5}}
+@texline @math{\phi^n / \sqrt{5}}
 @infoline @expr{phi^n / sqrt(5)}
 and then rounding to the nearest integer, where 
-@texline @tmath{\phi} (``phi''),
+@texline @math{\phi} (``phi''),
 @infoline @expr{phi}, 
 the ``golden ratio,'' is 
-@texline @tmath{(1 + \sqrt{5}) / 2}.
+@texline @math{(1 + \sqrt{5}) / 2}.
 @infoline @expr{(1 + sqrt(5)) / 2}. 
 (For convenience, this constant is available from the @code{phi}
 variable, or the @kbd{I H P} command.)
@@ -6160,17 +6148,17 @@
 @cindex Continued fractions
 (@bullet{}) @strong{Exercise 5.}  The @dfn{continued fraction}
 representation of 
-@texline @tmath{\phi}
+@texline @math{\phi}
 @infoline @expr{phi} 
 is 
-@texline @tmath{1 + 1/(1 + 1/(1 + 1/( \ldots )))}.
+@texline @math{1 + 1/(1 + 1/(1 + 1/( \ldots )))}.
 @infoline @expr{1 + 1/(1 + 1/(1 + 1/( ...@: )))}.
 We can compute an approximate value by carrying this however far
 and then replacing the innermost 
-@texline @tmath{1/( \ldots )}
+@texline @math{1/( \ldots )}
 @infoline @expr{1/( ...@: )} 
 by 1.  Approximate
-@texline @tmath{\phi}
+@texline @math{\phi}
 @infoline @expr{phi} 
 using a twenty-term continued fraction.
 @xref{Programming Answer 5, 5}. (@bullet{})
@@ -6270,7 +6258,7 @@
 property that all of the odd Bernoulli numbers are zero, and the
 even ones, while difficult to compute, can be roughly approximated
 by the formula 
-@texline @tmath{\displaystyle{2 n! \over (2 \pi)^n}}.
+@texline @math{\displaystyle{2 n! \over (2 \pi)^n}}.
 @infoline @expr{2 n!@: / (2 pi)^n}.  
 Let's write a keyboard macro to compute (approximate) Bernoulli numbers.
 (Calc has a command, @kbd{k b}, to compute exact Bernoulli numbers, but
@@ -6444,14 +6432,14 @@
 @noindent
 where @expr{f'(x)} is the derivative of @expr{f}.  The @expr{x}
 values will quickly converge to a solution, i.e., eventually
-@texline @tmath{x_{\rm new}}
+@texline @math{x_{\rm new}}
 @infoline @expr{new_x} 
 and @expr{x} will be equal to within the limits
 of the current precision.  Write a program which takes a formula
 involving the variable @expr{x}, and an initial guess @expr{x_0},
 on the stack, and produces a value of @expr{x} for which the formula
 is zero.  Use it to find a solution of 
-@texline @tmath{\sin(\cos x) = 0.5}
+@texline @math{\sin(\cos x) = 0.5}
 @infoline @expr{sin(cos(x)) = 0.5}
 near @expr{x = 4.5}.  (Use angles measured in radians.)  Note that
 the built-in @w{@kbd{a R}} (@code{calc-find-root}) command uses Newton's
@@ -6461,10 +6449,10 @@
 @cindex Gamma constant, Euler's
 @cindex Euler's gamma constant
 (@bullet{}) @strong{Exercise 9.}  The @dfn{digamma} function 
-@texline @tmath{\psi(z) (``psi'')}
+@texline @math{\psi(z) (``psi'')}
 @infoline @expr{psi(z)}
 is defined as the derivative of 
-@texline @tmath{\ln \Gamma(z)}.
+@texline @math{\ln \Gamma(z)}.
 @infoline @expr{ln(gamma(z))}.  
 For large values of @expr{z}, it can be approximated by the infinite sum
 
@@ -6483,7 +6471,7 @@
 
 @noindent
 where 
-@texline @tmath{\sum}
+@texline @math{\sum}
 @infoline @expr{sum} 
 represents the sum over @expr{n} from 1 to infinity
 (or to some limit high enough to give the desired accuracy), and
@@ -6491,27 +6479,27 @@
 While this sum is not guaranteed to converge, in practice it is safe.
 An interesting mathematical constant is Euler's gamma, which is equal
 to about 0.5772.  One way to compute it is by the formula,
-@texline @tmath{\gamma = -\psi(1)}.
+@texline @math{\gamma = -\psi(1)}.
 @infoline @expr{gamma = -psi(1)}.  
 Unfortunately, 1 isn't a large enough argument
 for the above formula to work (5 is a much safer value for @expr{z}).
 Fortunately, we can compute 
-@texline @tmath{\psi(1)}
+@texline @math{\psi(1)}
 @infoline @expr{psi(1)} 
 from 
-@texline @tmath{\psi(5)}
+@texline @math{\psi(5)}
 @infoline @expr{psi(5)} 
 using the recurrence 
-@texline @tmath{\psi(z+1) = \psi(z) + {1 \over z}}.
+@texline @math{\psi(z+1) = \psi(z) + {1 \over z}}.
 @infoline @expr{psi(z+1) = psi(z) + 1/z}.  
 Your task:  Develop a program to compute 
-@texline @tmath{\psi(z)};
+@texline @math{\psi(z)};
 @infoline @expr{psi(z)}; 
 it should ``pump up'' @expr{z}
 if necessary to be greater than 5, then use the above summation
 formula.  Use looping commands to compute the sum.  Use your function
 to compute 
-@texline @tmath{\gamma}
+@texline @math{\gamma}
 @infoline @expr{gamma} 
 to twelve decimal places.  (Calc has a built-in command
 for Euler's constant, @kbd{I P}, which you can use to check your answer.)
@@ -6688,18 +6676,18 @@
 @kbd{1 @key{RET} 2 @key{RET} 3 @key{RET} 4 + * -}
 
 The result is 
-@texline @tmath{1 - (2 \times (3 + 4)) = -13}.
+@texline @math{1 - (2 \times (3 + 4)) = -13}.
 @infoline @expr{1 - (2 * (3 + 4)) = -13}.
 
 @node RPN Answer 2, RPN Answer 3, RPN Answer 1, Answers to Exercises
 @subsection RPN Tutorial Exercise 2
 
 @noindent
-@texline @tmath{2\times4 + 7\times9.5 + {5\over4} = 75.75}
+@texline @math{2\times4 + 7\times9.5 + {5\over4} = 75.75}
 @infoline @expr{2*4 + 7*9.5 + 5/4 = 75.75}
 
 After computing the intermediate term 
-@texline @tmath{2\times4 = 8},
+@texline @math{2\times4 = 8},
 @infoline @expr{2*4 = 8}, 
 you can leave that result on the stack while you compute the second
 term.  With both of these results waiting on the stack you can then
@@ -7008,7 +6996,7 @@
 down to an integer.  Consider @expr{123456789 / 2} when the current
 precision is 6 digits.  The true answer is @expr{61728394.5}, but
 with a precision of 6 this will be rounded to 
-@texline @tmath{12345700.0/2.0 = 61728500.0}.
+@texline @math{12345700.0/2.0 = 61728500.0}.
 @infoline @expr{12345700.@: / 2.@: = 61728500.}.
 The result, when converted to an integer, will be off by 106.
 
@@ -7119,16 +7107,16 @@
 
 @noindent
 To solve 
-@texline @tmath{A^T A \, X = A^T B},
+@texline @math{A^T A \, X = A^T B},
 @infoline @expr{trn(A) * A * X = trn(A) * B}, 
 first we compute
-@texline @tmath{A' = A^T A}
+@texline @math{A' = A^T A}
 @infoline @expr{A2 = trn(A) * A} 
 and 
-@texline @tmath{B' = A^T B};
+@texline @math{B' = A^T B};
 @infoline @expr{B2 = trn(A) * B}; 
 now, we have a system 
-@texline @tmath{A' X = B'}
+@texline @math{A' X = B'}
 @infoline @expr{A2 * X = B2} 
 which we can solve using Calc's @samp{/} command.
 
@@ -7160,7 +7148,7 @@
 
 The first step is to enter the coefficient matrix.  We'll store it in
 quick variable number 7 for later reference.  Next, we compute the
-@texline @tmath{B'}
+@texline @math{B'}
 @infoline @expr{B2} 
 vector.
 
@@ -7178,7 +7166,7 @@
 
 @noindent
 Now we compute the matrix 
-@texline @tmath{A'}
+@texline @math{A'}
 @infoline @expr{A2} 
 and divide.
 
@@ -7199,16 +7187,16 @@
 round-off error.)
 
 Notice that the answers are similar to those for the 
-@texline @tmath{3\times3}
+@texline @math{3\times3}
 @infoline 3x3
 system solved in the text.  That's because the fourth equation that was 
 added to the system is almost identical to the first one multiplied
 by two.  (If it were identical, we would have gotten the exact same
 answer since the 
-@texline @tmath{4\times3}
+@texline @math{4\times3}
 @infoline 4x3
 system would be equivalent to the original 
-@texline @tmath{3\times3}
+@texline @math{3\times3}
 @infoline 3x3
 system.)
 
@@ -7285,7 +7273,7 @@
 @end tex
 
 Thus we want a 
-@texline @tmath{19\times2}
+@texline @math{19\times2}
 @infoline 19x2
 matrix with our @expr{x} vector as one column and
 ones as the other column.  So, first we build the column of ones, then
@@ -7304,10 +7292,10 @@
 
 @noindent
 Now we compute 
-@texline @tmath{A^T y}
+@texline @math{A^T y}
 @infoline @expr{trn(A) * y} 
 and 
-@texline @tmath{A^T A}
+@texline @math{A^T A}
 @infoline @expr{trn(A) * A} 
 and divide.
 
@@ -7335,7 +7323,7 @@
 @end smallexample
 
 Since we were solving equations of the form 
-@texline @tmath{m \times x + b \times 1 = y},
+@texline @math{m \times x + b \times 1 = y},
 @infoline @expr{m*x + b*1 = y}, 
 these numbers should be @expr{m} and @expr{b}, respectively.  Sure
 enough, they agree exactly with the result computed using @kbd{V M} and
@@ -7398,7 +7386,7 @@
 
 @noindent
 A number @expr{j} is a divisor of @expr{n} if 
-@texline @tmath{n \mathbin{\hbox{\code{\%}}} j = 0}.
+@texline @math{n \mathbin{\hbox{\code{\%}}} j = 0}.
 @infoline @samp{n % j = 0}.  
 The first step is to get a vector that identifies the divisors.
 
@@ -7469,7 +7457,7 @@
 the job is pretty straightforward.
 
 Incidentally, Calc provides the 
-@texline @dfn{M@"obius} @tmath{\mu}
+@texline @dfn{M@"obius} @math{\mu}
 @infoline @dfn{Moebius mu} 
 function which is zero if and only if its argument is square-free.  It
 would be a much more convenient way to do the above test in practice.
@@ -7503,7 +7491,7 @@
 the ``triangular numbers'' (now you know why!).  The @expr{n}th
 triangular number is the sum of the integers from 1 to @expr{n}, and
 can be computed directly by the formula 
-@texline @tmath{n (n+1) \over 2}.
+@texline @math{n (n+1) \over 2}.
 @infoline @expr{n * (n+1) / 2}.
 
 @smallexample
@@ -7599,7 +7587,7 @@
 @noindent
 It's a good idea to verify, as in the last step above, that only
 one value is equal to the maximum.  (After all, a plot of 
-@texline @tmath{\sin x}
+@texline @math{\sin x}
 @infoline @expr{sin(x)}
 might have many points all equal to the maximum value, 1.)
 
@@ -7871,10 +7859,10 @@
 symmetries.  First of all, after some thought it's clear that the
 @expr{y} axis can be ignored altogether.  Just pick a random @expr{x}
 component for one end of the match, pick a random direction 
-@texline @tmath{\theta},
+@texline @math{\theta},
 @infoline @expr{theta},
 and see if @expr{x} and 
-@texline @tmath{x + \cos \theta}
+@texline @math{x + \cos \theta}
 @infoline @expr{x + cos(theta)} 
 (which is the @expr{x} coordinate of the other endpoint) cross a line.
 The lines are at integer coordinates, so this happens when the two
@@ -7891,10 +7879,10 @@
 endpoint.  The rightmost endpoint will be between 0 and 1 if the
 match does not cross a line, or between 1 and 2 if it does.  So:
 Pick random @expr{x} and 
-@texline @tmath{\theta},
+@texline @math{\theta},
 @infoline @expr{theta}, 
 compute
-@texline @tmath{x + \cos \theta},
+@texline @math{x + \cos \theta},
 @infoline @expr{x + cos(theta)},
 and count how many of the results are greater than one.  Simple!
 
@@ -8219,7 +8207,7 @@
 @noindent
 Aha!  It's unlikely that an irrational number would equal a fraction
 this simple to within ten digits, so our original number was probably
-@texline @tmath{\sqrt{27 \pi / 53}}.
+@texline @math{\sqrt{27 \pi / 53}}.
 @infoline @expr{sqrt(27 pi / 53)}.
 
 Notice that we didn't need to re-round the number when we reduced the
@@ -8480,9 +8468,9 @@
 The fourth calculation, @samp{1 / (-10 .. 10)}, has the same problem.
 Zero is buried inside the interval, but it's still a possible value.
 It's not hard to see that the actual result of @samp{1 / (-10 .. 10)}
-will be either greater than @i{0.1}, or less than @i{-0.1}.  Thus
+will be either greater than @mathit{0.1}, or less than @mathit{-0.1}.  Thus
 the interval goes from minus infinity to plus infinity, with a ``hole''
-in it from @i{-0.1} to @i{0.1}.  Calc doesn't have any way to
+in it from @mathit{-0.1} to @mathit{0.1}.  Calc doesn't have any way to
 represent this, so it just reports @samp{[-inf .. inf]} as the answer.
 It may be disappointing to hear ``the answer lies somewhere between
 minus infinity and plus infinity, inclusive,'' but that's the best
@@ -8502,9 +8490,9 @@
 @end smallexample
 
 @noindent
-In the first case the result says, ``if a number is between @i{-3} and
+In the first case the result says, ``if a number is between @mathit{-3} and
 3, its square is between 0 and 9.''  The second case says, ``the product
-of two numbers each between @i{-3} and 3 is between @i{-9} and 9.''
+of two numbers each between @mathit{-3} and 3 is between @mathit{-9} and 9.''
 
 An interval form is not a number; it is a symbol that can stand for
 many different numbers.  Two identical-looking interval forms can stand
@@ -9260,7 +9248,7 @@
 
 @noindent
 Computing 
-@texline @tmath{\displaystyle{\sin x \over x}}:
+@texline @math{\displaystyle{\sin x \over x}}:
 @infoline @expr{sin(x) / x}:
 
 Using the stack:  @kbd{C-x (  @key{RET} S @key{TAB} /  C-x )}.
@@ -9331,7 +9319,7 @@
 @noindent
 This program is quite efficient because Calc knows how to raise a
 matrix (or other value) to the power @expr{n} in only 
-@texline @tmath{\log_2 n}
+@texline @math{\log_2 n}
 @infoline @expr{log(n,2)}
 steps.  For example, this program can compute the 1000th Fibonacci
 number (a 209-digit integer!) in about 10 steps; even though the
@@ -9385,7 +9373,7 @@
 @noindent
 The first step is to compute the derivative @expr{f'(x)} and thus
 the formula 
-@texline @tmath{\displaystyle{x - {f(x) \over f'(x)}}}.
+@texline @math{\displaystyle{x - {f(x) \over f'(x)}}}.
 @infoline @expr{x - f(x)/f'(x)}.
 
 (Because this definition is long, it will be repeated in concise form
@@ -9502,10 +9490,10 @@
 The first step is to adjust @expr{z} to be greater than 5.  A simple
 ``for'' loop will do the job here.  If @expr{z} is less than 5, we
 reduce the problem using 
-@texline @tmath{\psi(z) = \psi(z+1) - 1/z}.
+@texline @math{\psi(z) = \psi(z+1) - 1/z}.
 @infoline @expr{psi(z) = psi(z+1) - 1/z}.  We go
 on to compute 
-@texline @tmath{\psi(z+1)},
+@texline @math{\psi(z+1)},
 @infoline @expr{psi(z+1)}, 
 and remember to add back a factor of @expr{-1/z} when we're done.  This
 step is repeated until @expr{z > 5}.
@@ -9546,7 +9534,7 @@
 @end smallexample
 
 Now we compute the initial part of the sum:  
-@texline @tmath{\ln z - {1 \over 2z}}
+@texline @math{\ln z - {1 \over 2z}}
 @infoline @expr{ln(z) - 1/2z}
 minus the adjustment factor.
 
@@ -9589,7 +9577,7 @@
 @end smallexample
 
 This is the value of 
-@texline @tmath{-\gamma},
+@texline @math{-\gamma},
 @infoline @expr{- gamma}, 
 with a slight bit of roundoff error.  To get a full 12 digits, let's use
 a higher precision:
@@ -9624,7 +9612,7 @@
 @noindent
 Taking the derivative of a term of the form @expr{x^n} will produce
 a term like 
-@texline @tmath{n x^{n-1}}.
+@texline @math{n x^{n-1}}.
 @infoline @expr{n x^(n-1)}.  
 Taking the derivative of a constant
 produces zero.  From this it is easy to see that the @expr{n}th
@@ -10198,7 +10186,7 @@
 @kbd{+} key always ``pops'' the top two numbers from the stack, adds them,
 and pushes the result (3) back onto the stack.  This number is ready for
 further calculations:  @kbd{5 -} pushes 5 onto the stack, then pops the
-3 and 5, subtracts them, and pushes the result (@i{-2}).
+3 and 5, subtracts them, and pushes the result (@mathit{-2}).
 
 Note that the ``top'' of the stack actually appears at the @emph{bottom}
 of the buffer.  A line containing a single @samp{.} character signifies
@@ -10261,7 +10249,7 @@
 of the number on the top of the stack or the number currently being entered.
 The @kbd{_} key begins entry of a negative number or changes the sign of
 the number currently being entered.  The following sequences all enter the
-number @i{-5} onto the stack:  @kbd{0 @key{RET} 5 -}, @kbd{5 n @key{RET}},
+number @mathit{-5} onto the stack:  @kbd{0 @key{RET} 5 -}, @kbd{5 n @key{RET}},
 @kbd{5 @key{RET} n}, @kbd{_ 5 @key{RET}}, @kbd{5 _ @key{RET}}.
 
 Some other keys are active during numeric entry, such as @kbd{#} for
@@ -10282,7 +10270,7 @@
 Calculations can also be entered in algebraic form.  This is accomplished
 by typing the apostrophe key, @kbd{'}, followed by the expression in
 standard format:  @kbd{@key{'} 2+3*4 @key{RET}} computes
-@texline @tmath{2+(3\times4) = 14}
+@texline @math{2+(3\times4) = 14}
 @infoline @expr{2+(3*4) = 14} 
 and pushes that on the stack.  If you wish you can
 ignore the RPN aspect of Calc altogether and simply enter algebraic
@@ -10692,7 +10680,7 @@
 unless you raise the precision still further.  Many operations such as
 logarithms and sines make use of similarly cached values such as
 @cpiover{4} and 
-@texline @tmath{\ln 2}.
+@texline @math{\ln 2}.
 @infoline @expr{ln(2)}.  
 The visible effect of caching is that
 high-precision computations may seem to do extra work the first time.
@@ -10851,10 +10839,10 @@
 notation.  The number of significant digits in the fractional part is
 governed by the current floating precision (@pxref{Precision}).  The
 range of acceptable values is from 
-@texline @tmath{10^{-3999999}}
+@texline @math{10^{-3999999}}
 @infoline @expr{10^-3999999} 
 (inclusive) to 
-@texline @tmath{10^{4000000}}
+@texline @math{10^{4000000}}
 @infoline @expr{10^4000000}
 (exclusive), plus the corresponding negative values and zero.
 
@@ -10926,16 +10914,16 @@
 notation; @pxref{Complex Formats}.
 
 Polar complex numbers are displayed in the form 
-@texline `@t{(}@var{r}@t{;}@tmath{\theta}@t{)}'
+@texline `@t{(}@var{r}@t{;}@math{\theta}@t{)}'
 @infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}'
 where @var{r} is the nonnegative magnitude and 
-@texline @tmath{\theta}
+@texline @math{\theta}
 @infoline @var{theta} 
 is the argument or phase angle.  The range of 
-@texline @tmath{\theta}
+@texline @math{\theta}
 @infoline @var{theta} 
 depends on the current angular mode (@pxref{Angular Modes}); it is
-generally between @i{-180} and @i{+180} degrees or the equivalent range
+generally between @mathit{-180} and @mathit{+180} degrees or the equivalent range
 in radians. 
 
 Complex numbers are entered in stages using incomplete objects.
@@ -10978,7 +10966,7 @@
 that if @expr{x} got ``all the way to infinity,'' then @expr{1 / x}
 would go all the way to zero.  Similarly, when they say that
 @samp{exp(inf) = inf}, they mean that 
-@texline @tmath{e^x}
+@texline @math{e^x}
 @infoline @expr{exp(x)} 
 grows without bound as @expr{x} grows.  The symbol @samp{-inf} likewise
 stands for an infinitely negative real value; for example, we say that
@@ -11075,7 +11063,7 @@
 @tindex vec
 Algebraic functions for building vectors include @samp{vec(a, b, c)}
 to build @samp{[a, b, c]}, @samp{cvec(a, n, m)} to build an 
-@texline @tmath{n\times m}
+@texline @math{n\times m}
 @infoline @var{n}x@var{m}
 matrix of @samp{a}s, and @samp{index(n)} to build a vector of integers
 from 1 to @samp{n}.
@@ -11206,7 +11194,7 @@
 The @var{secs} value is a real number between 0 (inclusive) and 60
 (exclusive).  A positive HMS form is interpreted as @var{hours} +
 @var{mins}/60 + @var{secs}/3600.  A negative HMS form is interpreted
-as @i{- @var{hours}} @i{-} @var{mins}/60 @i{-} @var{secs}/3600.
+as @mathit{- @var{hours}} @mathit{-} @var{mins}/60 @mathit{-} @var{secs}/3600.
 Display format for HMS forms is quite flexible.  @xref{HMS Formats}.
 
 HMS forms can be added and subtracted.  When they are added to numbers,
@@ -11300,12 +11288,12 @@
 
 Calc uses the Julian calendar for all dates before the year 1752,
 including dates BC when the Julian calendar technically had not
-yet been invented.  Thus the claim that day number @i{-10000} is
+yet been invented.  Thus the claim that day number @mathit{-10000} is
 called ``August 16, 28 BC'' should be taken with a grain of salt.
 
 Please note that there is no ``year 0''; the day before
 @samp{<Sat Jan 1, +1>} is @samp{<Fri Dec 31, -1>}.  These are
-days 0 and @i{-1} respectively in Calc's internal numbering scheme.
+days 0 and @mathit{-1} respectively in Calc's internal numbering scheme.
 
 @cindex Julian day counting
 Another day counting system in common use is, confusingly, also
@@ -11313,7 +11301,7 @@
 Scaliger, who named it in honor of his father Julius Caesar
 Scaliger.  For obscure reasons he chose to start his day
 numbering on Jan 1, 4713 BC at noon, which in Calc's scheme
-is @i{-1721423.5} (recall that Calc starts at midnight instead
+is @mathit{-1721423.5} (recall that Calc starts at midnight instead
 of noon).  Thus to convert a Calc date code obtained by
 unpacking a date form into a Julian day number, simply add
 1721423.5.  The Julian code for @samp{6:00am Jan 9, 1991}
@@ -11346,7 +11334,7 @@
 often arises in number theory.  Modulo forms are written
 `@var{a} @t{mod} @var{M}',
 where @var{a} and @var{M} are real numbers or HMS forms, and
-@texline @tmath{0 \le a < M}.
+@texline @math{0 \le a < M}.
 @infoline @expr{0 <= a < @var{M}}.
 In many applications @expr{a} and @expr{M} will be
 integers but this is not required.
@@ -11378,7 +11366,7 @@
 roots, are not yet supported for modulo forms.  (Note that, although
 @w{`@t{(}@var{a} @t{mod} @var{M}@t{)^.5}'} will compute a ``modulo square root''
 in the sense of reducing 
-@texline @tmath{\sqrt a}
+@texline @math{\sqrt a}
 @infoline @expr{sqrt(a)} 
 modulo @expr{M}, this is not a useful definition from the
 number-theoretical point of view.)
@@ -11428,12 +11416,12 @@
 @cindex Standard deviations
 An @dfn{error form} is a number with an associated standard
 deviation, as in @samp{2.3 +/- 0.12}.  The notation
-@texline `@var{x} @t{+/-} @tmath{\sigma}' 
+@texline `@var{x} @t{+/-} @math{\sigma}' 
 @infoline `@var{x} @t{+/-} sigma' 
 stands for an uncertain value which follows
 a normal or Gaussian distribution of mean @expr{x} and standard
 deviation or ``error'' 
-@texline @tmath{\sigma}.
+@texline @math{\sigma}.
 @infoline @expr{sigma}.
 Both the mean and the error can be either numbers or
 formulas.  Generally these are real numbers but the mean may also be
@@ -11444,7 +11432,7 @@
 All arithmetic and transcendental functions accept error forms as input.
 Operations on the mean-value part work just like operations on regular
 numbers.  The error part for any function @expr{f(x)} (such as 
-@texline @tmath{\sin x}
+@texline @math{\sin x}
 @infoline @expr{sin(x)})
 is defined by the error of @expr{x} times the derivative of @expr{f}
 evaluated at the mean value of @expr{x}.  For a two-argument function
@@ -11475,34 +11463,34 @@
 of standard deviations.  Actual errors often are neither Gaussian-distributed
 nor uncorrelated, and the above formulas are valid only when errors
 are small.  As an example, the error arising from
-@texline `@t{sin(}@var{x} @t{+/-} @tmath{\sigma}@t{)}' 
+@texline `@t{sin(}@var{x} @t{+/-} @math{\sigma}@t{)}' 
 @infoline `@t{sin(}@var{x} @t{+/-} @var{sigma}@t{)}' 
 is 
-@texline `@tmath{\sigma} @t{abs(cos(}@var{x}@t{))}'.  
+@texline `@math{\sigma} @t{abs(cos(}@var{x}@t{))}'.  
 @infoline `@var{sigma} @t{abs(cos(}@var{x}@t{))}'.  
 When @expr{x} is close to zero,
-@texline @tmath{\cos x}
+@texline @math{\cos x}
 @infoline @expr{cos(x)} 
 is close to one so the error in the sine is close to 
-@texline @tmath{\sigma};
+@texline @math{\sigma};
 @infoline @expr{sigma};
 this makes sense, since 
-@texline @tmath{\sin x}
+@texline @math{\sin x}
 @infoline @expr{sin(x)} 
 is approximately @expr{x} near zero, so a given error in @expr{x} will
 produce about the same error in the sine.  Likewise, near 90 degrees
-@texline @tmath{\cos x}
+@texline @math{\cos x}
 @infoline @expr{cos(x)} 
 is nearly zero and so the computed error is
 small:  The sine curve is nearly flat in that region, so an error in @expr{x}
 has relatively little effect on the value of 
-@texline @tmath{\sin x}.
+@texline @math{\sin x}.
 @infoline @expr{sin(x)}.  
 However, consider @samp{sin(90 +/- 1000)}.  The cosine of 90 is zero, so
 Calc will report zero error!  We get an obviously wrong result because
 we have violated the small-error approximation underlying the error
 analysis.  If the error in @expr{x} had been small, the error in
-@texline @tmath{\sin x}
+@texline @math{\sin x}
 @infoline @expr{sin(x)} 
 would indeed have been negligible.
 
@@ -11611,11 +11599,11 @@
 While it may seem that intervals and error forms are similar, they are
 based on entirely different concepts of inexact quantities.  An error
 form 
-@texline `@var{x} @t{+/-} @tmath{\sigma}' 
+@texline `@var{x} @t{+/-} @math{\sigma}' 
 @infoline `@var{x} @t{+/-} @var{sigma}' 
 means a variable is random, and its value could
 be anything but is ``probably'' within one 
-@texline @tmath{\sigma} 
+@texline @math{\sigma} 
 @infoline @var{sigma} 
 of the mean value @expr{x}. An interval 
 `@t{[}@var{a} @t{..@:} @var{b}@t{]}' means a
@@ -11849,7 +11837,7 @@
 
 Note that, unlike in usual computer notation, multiplication binds more
 strongly than division:  @samp{a*b/c*d} is equivalent to 
-@texline @tmath{a b \over c d}.
+@texline @math{a b \over c d}.
 @infoline @expr{(a*b)/(c*d)}.
 
 @cindex Multiplication, implicit
@@ -12047,11 +12035,11 @@
 element at level @var{n} up to the top.  (Compare with @key{LFD},
 which copies instead of moving the element in level @var{n}.)
 
-With a negative argument @i{-@var{n}}, @key{TAB} rotates the stack
+With a negative argument @mathit{-@var{n}}, @key{TAB} rotates the stack
 to move the object in level @var{n} to the deepest place in the
-stack, and the object in level @i{@var{n}+1} to the top.  @kbd{M-@key{TAB}}
-rotates the deepest stack element to be in level @i{n}, also
-putting the top stack element in level @i{@var{n}+1}.
+stack, and the object in level @mathit{@var{n}+1} to the top.  @kbd{M-@key{TAB}}
+rotates the deepest stack element to be in level @mathit{n}, also
+putting the top stack element in level @mathit{@var{n}+1}.
 
 @xref{Selecting Subformulas}, for a way to apply these commands to
 any portion of a vector or formula on the stack.
@@ -12346,8 +12334,8 @@
 is because you are presumably switching to your @file{~/.emacs} file,
 which may contain other things you don't want to reread.  You can give
 a numeric prefix argument of 1 to @kbd{m F} to force it to read the
-file no matter what its name.  Conversely, an argument of @i{-1} tells
-@kbd{m F} @emph{not} to read the new file.  An argument of 2 or @i{-2}
+file no matter what its name.  Conversely, an argument of @mathit{-1} tells
+@kbd{m F} @emph{not} to read the new file.  An argument of 2 or @mathit{-2}
 tells @kbd{m F} not to reset the modes to their defaults beforehand,
 which is useful if you intend your new file to have a variant of the
 modes present in the file you were using before.
@@ -12452,7 +12440,7 @@
 If both of these flags are set at once, the effect will be
 @code{calc-arcsinh}.  (The Hyperbolic flag is also used by some
 non-trigonometric commands; for example @kbd{H L} computes a base-10,
-instead of base-@i{e}, logarithm.)
+instead of base-@mathit{e}, logarithm.)
 
 Command names like @code{calc-arcsin} are provided for completeness, and
 may be executed with @kbd{x} or @kbd{M-x}.  Their effect is simply to
@@ -12596,7 +12584,7 @@
 which zero is treated as positive instead of being directionless.
 Thus, @samp{1 / 0 = inf} and @samp{-1 / 0 = -inf} in this mode.
 Note that zero never actually has a sign in Calc; there are no
-separate representations for @i{+0} and @i{-0}.  Positive
+separate representations for @mathit{+0} and @mathit{-0}.  Positive
 infinite mode merely changes the interpretation given to the
 single symbol, @samp{0}.  One consequence of this is that, while
 you might expect @samp{1 / -0 = -inf}, actually @samp{1 / -0}
@@ -12987,7 +12975,7 @@
 Calc uses this information to determine when certain simplifications
 of formulas are safe.  For example, @samp{(x^y)^z} cannot be
 simplified to @samp{x^(y z)} in general; for example,
-@samp{((-3)^2)^1:2} is 3, but @samp{(-3)^(2*1:2) = (-3)^1} is @i{-3}.
+@samp{((-3)^2)^1:2} is 3, but @samp{(-3)^(2*1:2) = (-3)^1} is @mathit{-3}.
 However, this simplification @emph{is} safe if @code{z} is known
 to be an integer, or if @code{x} is known to be a nonnegative
 real number.  If you have given declarations that allow Calc to
@@ -13100,7 +13088,7 @@
 @end table
 
 Calc does not check the declarations for a variable when you store
-a value in it.  However, storing @i{-3.5} in a variable that has
+a value in it.  However, storing @mathit{-3.5} in a variable that has
 been declared @code{pos}, @code{int}, or @code{matrix} may have
 unexpected effects; Calc may evaluate @samp{sqrt(x^2)} to @expr{3.5}
 if it substitutes the value first, or to @expr{-3.5} if @code{x}
@@ -13335,7 +13323,7 @@
 current binary word size.  (@xref{Binary Functions}, for a discussion of
 word size.)  If the absolute value of the word size is @expr{w}, all integers
 are displayed with at least enough digits to represent 
-@texline @tmath{2^w-1}
+@texline @math{2^w-1}
 @infoline @expr{(2^w)-1} 
 in the current radix.  (Larger integers will still be displayed in their
 entirety.) 
@@ -14236,10 +14224,10 @@
 parentheses for very simple arguments.  During input, curly braces and
 parentheses work equally well for grouping, but when the document is
 formatted the curly braces will be invisible.  Thus the printed result is
-@texline @tmath{\sin{2 x}}
+@texline @math{\sin{2 x}}
 @infoline @expr{sin 2x} 
 but 
-@texline @tmath{\sin(2 + x)}.
+@texline @math{\sin(2 + x)}.
 @infoline @expr{sin(2 + x)}.
 
 Function and variable names not treated specially by @TeX{} are simply
@@ -15733,19 +15721,19 @@
 Command is @kbd{m p}.
 
 @item
-Matrix/scalar mode.  Default value is @i{-1}.  Value is 0 for scalar
-mode, @i{-2} for matrix mode, or @var{N} for 
-@texline @tmath{N\times N}
+Matrix/scalar mode.  Default value is @mathit{-1}.  Value is 0 for scalar
+mode, @mathit{-2} for matrix mode, or @var{N} for 
+@texline @math{N\times N}
 @infoline @var{N}x@var{N} 
 matrix mode.  Command is @kbd{m v}.
 
 @item
-Simplification mode.  Default is 1.  Value is @i{-1} for off (@kbd{m O}),
+Simplification mode.  Default is 1.  Value is @mathit{-1} for off (@kbd{m O}),
 0 for @kbd{m N}, 2 for @kbd{m B}, 3 for @kbd{m A}, 4 for @kbd{m E},
 or 5 for @w{@kbd{m U}}.  The @kbd{m D} command accepts these prefixes.
 
 @item
-Infinite mode.  Default is @i{-1} (off).  Value is 1 if the mode is on,
+Infinite mode.  Default is @mathit{-1} (off).  Value is 1 if the mode is on,
 or 0 if the mode is on with positive zeros.  Command is @kbd{m i}.
 @end enumerate
 
@@ -16086,7 +16074,7 @@
 @tindex -
 The @kbd{-} (@code{calc-minus}) command subtracts two values.  The top
 number on the stack is subtracted from the one behind it, so that the
-computation @kbd{5 @key{RET} 2 -} produces 3, not @i{-3}.  All options
+computation @kbd{5 @key{RET} 2 -} produces 3, not @mathit{-3}.  All options
 available for @kbd{+} are available for @kbd{-} as well.
 
 @kindex *
@@ -16230,7 +16218,7 @@
 @pindex calc-sign
 @tindex sign
 The @kbd{f s} (@code{calc-sign}) [@code{sign}] command returns 1 if its
-argument is positive, @i{-1} if its argument is negative, or 0 if its
+argument is positive, @mathit{-1} if its argument is negative, or 0 if its
 argument is zero.  In algebraic form, you can also write @samp{sign(a,x)}
 which evaluates to @samp{x * sign(a)}, i.e., either @samp{x}, @samp{-x}, or
 zero depending on the sign of @samp{a}.
@@ -16293,7 +16281,7 @@
 the ``mantissa'' part @expr{m} of its floating-point argument; @kbd{f X}
 (@code{calc-xpon-part}) [@code{xpon}] extracts the ``exponent'' part
 @expr{e}.  The original number is equal to 
-@texline @tmath{m \times 10^e},
+@texline @math{m \times 10^e},
 @infoline @expr{m * 10^e},
 where @expr{m} is in the interval @samp{[1.0 ..@: 10.0)} except that
 @expr{m=e=0} if the original number is zero.  For integers
@@ -16326,7 +16314,7 @@
 is 6 digits yields @samp{12.3457}.  If the current precision had been
 8 digits, the result would have been @samp{12.345601}.  Incrementing
 @samp{0.0} produces 
-@texline @tmath{10^{-p}},
+@texline @math{10^{-p}},
 @infoline @expr{10^-p}, 
 where @expr{p} is the current
 precision.  These operations are defined only on integers and floats.
@@ -16367,7 +16355,7 @@
 The @kbd{F} (@code{calc-floor}) [@code{floor} or @code{ffloor}] command
 truncates a real number to the next lower integer, i.e., toward minus
 infinity.  Thus @kbd{3.6 F} produces 3, but @kbd{_3.6 F} produces
-@i{-4}.
+@mathit{-4}.
 
 @kindex I F
 @pindex calc-ceiling
@@ -16379,7 +16367,7 @@
 @kindex H I F
 The @kbd{I F} (@code{calc-ceiling}) [@code{ceil} or @code{fceil}]
 command truncates toward positive infinity.  Thus @kbd{3.6 I F} produces
-4, and @kbd{_3.6 I F} produces @i{-3}.
+4, and @kbd{_3.6 I F} produces @mathit{-3}.
 
 @kindex R
 @pindex calc-round
@@ -16393,7 +16381,7 @@
 rounds to the nearest integer.  When the fractional part is .5 exactly,
 this command rounds away from zero.  (All other rounding in the
 Calculator uses this convention as well.)  Thus @kbd{3.5 R} produces 4
-but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @i{-4}.
+but @kbd{3.4 R} produces 3; @kbd{_3.5 R} produces @mathit{-4}.
 
 @kindex I R
 @pindex calc-trunc
@@ -16406,7 +16394,7 @@
 The @kbd{I R} (@code{calc-trunc}) [@code{trunc} or @code{ftrunc}]
 command truncates toward zero.  In other words, it ``chops off''
 everything after the decimal point.  Thus @kbd{3.6 I R} produces 3 and
-@kbd{_3.6 I R} produces @i{-3}.
+@kbd{_3.6 I R} produces @mathit{-3}.
 
 These functions may not be applied meaningfully to error forms, but they
 do work for intervals.  As a convenience, applying @code{floor} to a
@@ -16484,10 +16472,10 @@
 The @kbd{G} (@code{calc-argument}) [@code{arg}] command computes the
 ``argument'' or polar angle of a complex number.  For a number in polar
 notation, this is simply the second component of the pair
-@texline `@t{(}@var{r}@t{;}@tmath{\theta}@t{)}'.
+@texline `@t{(}@var{r}@t{;}@math{\theta}@t{)}'.
 @infoline `@t{(}@var{r}@t{;}@var{theta}@t{)}'.
 The result is expressed according to the current angular mode and will
-be in the range @i{-180} degrees (exclusive) to @i{+180} degrees
+be in the range @mathit{-180} degrees (exclusive) to @mathit{+180} degrees
 (inclusive), or the equivalent range in radians.
 
 @pindex calc-imaginary
@@ -16518,8 +16506,8 @@
 @pindex calc-pack
 The @kbd{v p} (@code{calc-pack}) command can pack the top two numbers on
 the stack into a composite object such as a complex number.  With
-a prefix argument of @i{-1}, it produces a rectangular complex number;
-with an argument of @i{-2}, it produces a polar complex number.
+a prefix argument of @mathit{-1}, it produces a rectangular complex number;
+with an argument of @mathit{-2}, it produces a polar complex number.
 (Also, @pxref{Building Vectors}.)
 
 @ignore
@@ -16643,7 +16631,7 @@
 The @kbd{c c} (@code{calc-clean}) [@code{pclean}] command ``cleans'' the
 number on the top of the stack.  Floating point numbers are re-rounded
 according to the current precision.  Polar numbers whose angular
-components have strayed from the @i{-180} to @i{+180} degree range
+components have strayed from the @mathit{-180} to @mathit{+180} degree range
 are normalized.  (Note that results will be undesirable if the current
 angular mode is different from the one under which the number was
 produced!)  Integers and fractions are generally unaffected by this
@@ -16899,8 +16887,8 @@
 @var{n} in the range from 1 to 366, @kbd{t Y} computes the
 @var{n}th day of the year (366 is treated as 365 in non-leap
 years).  A prefix argument of 0 computes the last day of the
-year (December 31).  A negative prefix argument from @i{-1} to
-@i{-12} computes the first day of the @var{n}th month of the year.
+year (December 31).  A negative prefix argument from @mathit{-1} to
+@mathit{-12} computes the first day of the @var{n}th month of the year.
 
 @kindex t W
 @pindex calc-new-week
@@ -17269,7 +17257,7 @@
 name of a function that is used to compute the daylight savings
 adjustment for a given date.  The default is
 @code{math-std-daylight-savings}, which computes an adjustment
-(either 0 or @i{-1}) using the North American rules given above.
+(either 0 or @mathit{-1}) using the North American rules given above.
 
 The daylight savings hook function is called with four arguments:
 The date, as a floating-point number in standard Calc format;
@@ -17317,7 +17305,7 @@
 @noindent
 The @code{bump} parameter is equal to zero when Calc is converting
 from a date form in a generalized time zone into a GMT date value.
-It is @i{-1} when Calc is converting in the other direction.  The
+It is @mathit{-1} when Calc is converting in the other direction.  The
 adjustments shown above ensure that the conversion behaves correctly
 and reasonably around the 2 a.m.@: transition in each direction.
 
@@ -17944,10 +17932,10 @@
 
 If the word size is negative, binary operations produce 2's complement
 integers from 
-@texline @tmath{-2^{-w-1}}
+@texline @math{-2^{-w-1}}
 @infoline @expr{-(2^(-w-1))} 
 to 
-@texline @tmath{2^{-w-1}-1}
+@texline @math{2^{-w-1}-1}
 @infoline @expr{2^(-w-1)-1} 
 inclusive.  Either mode accepts inputs in any range; the sign of
 @expr{w} affects only the results produced.
@@ -17963,7 +17951,7 @@
 generally is not ``binary.''  (However, @pxref{Simplification Modes},
 @code{calc-bin-simplify-mode}.)  For example, with a word size of 8
 bits @kbd{b c} converts a number to the range 0 to 255; with a word
-size of @i{-8} @kbd{b c} converts to the range @i{-128} to 127.
+size of @mathit{-8} @kbd{b c} converts to the range @mathit{-128} to 127.
 
 @kindex b w
 @pindex calc-word-size
@@ -17979,7 +17967,7 @@
 optional second (or third) word-size parameter.  When a formula like
 @samp{and(a,b)} is finally evaluated, the word size current at that time
 will be used, but when @samp{and(a,b,-8)} is evaluated, a word size of
-@i{-8} will always be used.  A symbolic binary function will be left
+@mathit{-8} will always be used.  A symbolic binary function will be left
 in symbolic form unless the all of its argument(s) are integers or
 integer-valued floats.
 
@@ -18131,11 +18119,11 @@
 the value of @cpi{} (at the current precision) onto the stack.  With the
 Hyperbolic flag, it pushes the value @expr{e}, the base of natural logarithms.
 With the Inverse flag, it pushes Euler's constant 
-@texline @tmath{\gamma}
+@texline @math{\gamma}
 @infoline @expr{gamma} 
 (about 0.5772).  With both Inverse and Hyperbolic, it
 pushes the ``golden ratio'' 
-@texline @tmath{\phi}
+@texline @math{\phi}
 @infoline @expr{phi} 
 (about 1.618).  (At present, Euler's constant is not available
 to unlimited precision; Calc knows only the first 100 digits.)
@@ -18215,7 +18203,7 @@
 it raises ten to a given power.)  Note that the common logarithm of a
 complex number is computed by taking the natural logarithm and dividing
 by 
-@texline @tmath{\ln10}.
+@texline @math{\ln10}.
 @infoline @expr{ln(10)}.
 
 @kindex B
@@ -18225,7 +18213,7 @@
 @tindex alog
 The @kbd{B} (@code{calc-log}) [@code{log}] command computes a logarithm
 to any base.  For example, @kbd{1024 @key{RET} 2 B} produces 10, since
-@texline @tmath{2^{10} = 1024}.
+@texline @math{2^{10} = 1024}.
 @infoline @expr{2^10 = 1024}.  
 In certain cases like @samp{log(3,9)}, the result
 will be either @expr{1:2} or @expr{0.5} depending on the current Fraction
@@ -18247,11 +18235,11 @@
 @pindex calc-expm1
 @tindex expm1
 The @kbd{f E} (@code{calc-expm1}) [@code{expm1}] command computes
-@texline @tmath{e^x - 1},
+@texline @math{e^x - 1},
 @infoline @expr{exp(x)-1}, 
 but using an algorithm that produces a more accurate
 answer when the result is close to zero, i.e., when 
-@texline @tmath{e^x}
+@texline @math{e^x}
 @infoline @expr{exp(x)} 
 is close to one.
 
@@ -18259,7 +18247,7 @@
 @pindex calc-lnp1
 @tindex lnp1
 The @kbd{f L} (@code{calc-lnp1}) [@code{lnp1}] command computes
-@texline @tmath{\ln(x+1)},
+@texline @math{\ln(x+1)},
 @infoline @expr{ln(x+1)}, 
 producing a more accurate answer when @expr{x} is close to zero.
 
@@ -18393,10 +18381,10 @@
 @tindex arctan2
 The @kbd{f T} (@code{calc-arctan2}) [@code{arctan2}] command takes two
 numbers from the stack and computes the arc tangent of their ratio.  The
-result is in the full range from @i{-180} (exclusive) to @i{+180}
+result is in the full range from @mathit{-180} (exclusive) to @mathit{+180}
 (inclusive) degrees, or the analogous range in radians.  A similar
 result would be obtained with @kbd{/} followed by @kbd{I T}, but the
-value would only be in the range from @i{-90} to @i{+90} degrees
+value would only be in the range from @mathit{-90} to @mathit{+90} degrees
 since the division loses information about the signs of the two
 components, and an error might result from an explicit division by zero
 which @code{arctan2} would avoid.  By (arbitrary) definition,
@@ -18445,7 +18433,7 @@
 factorial function:  @samp{gamma(n+1) = fact(n)}.  For general complex
 arguments the gamma function can be defined by the following definite
 integral:  
-@texline @tmath{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}.
+@texline @math{\Gamma(a) = \int_0^\infty t^{a-1} e^t dt}.
 @infoline @expr{gamma(a) = integ(t^(a-1) exp(t), t, 0, inf)}.  
 (The actual implementation uses far more efficient computational methods.)
 
@@ -18479,7 +18467,7 @@
 The @kbd{f G} (@code{calc-inc-gamma}) [@code{gammaP}] command computes
 the incomplete gamma function, denoted @samp{P(a,x)}.  This is defined by
 the integral, 
-@texline @tmath{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}.
+@texline @math{P(a,x) = \left( \int_0^x t^{a-1} e^t dt \right) / \Gamma(a)}.
 @infoline @expr{gammaP(a,x) = integ(t^(a-1) exp(t), t, 0, x) / gamma(a)}.
 This implies that @samp{gammaP(a,inf) = 1} for any @expr{a} (see the
 definition of the normal gamma function).
@@ -18512,10 +18500,10 @@
 @tindex beta
 The @kbd{f b} (@code{calc-beta}) [@code{beta}] command computes the
 Euler beta function, which is defined in terms of the gamma function as
-@texline @tmath{B(a,b) = \Gamma(a) \Gamma(b) / \Gamma(a+b)},
+@texline @math{B(a,b) = \Gamma(a) \Gamma(b) / \Gamma(a+b)},
 @infoline @expr{beta(a,b) = gamma(a) gamma(b) / gamma(a+b)}, 
 or by
-@texline @tmath{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}.
+@texline @math{B(a,b) = \int_0^1 t^{a-1} (1-t)^{b-1} dt}.
 @infoline @expr{beta(a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, 1)}.
 
 @kindex f B
@@ -18525,7 +18513,7 @@
 @tindex betaB
 The @kbd{f B} (@code{calc-inc-beta}) [@code{betaI}] command computes
 the incomplete beta function @expr{I(x,a,b)}.  It is defined by
-@texline @tmath{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}.
+@texline @math{I(x,a,b) = \left( \int_0^x t^{a-1} (1-t)^{b-1} dt \right) / B(a,b)}.
 @infoline @expr{betaI(x,a,b) = integ(t^(a-1) (1-t)^(b-1), t, 0, x) / beta(a,b)}.
 Once again, the @kbd{H} (hyperbolic) prefix gives the corresponding
 un-normalized version [@code{betaB}].
@@ -18537,11 +18525,11 @@
 @tindex erfc
 The @kbd{f e} (@code{calc-erf}) [@code{erf}] command computes the
 error function 
-@texline @tmath{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}.
+@texline @math{\hbox{erf}(x) = {2 \over \sqrt{\pi}} \int_0^x e^{-t^2} dt}.
 @infoline @expr{erf(x) = 2 integ(exp(-(t^2)), t, 0, x) / sqrt(pi)}.
 The complementary error function @kbd{I f e} (@code{calc-erfc}) [@code{erfc}]
 is the corresponding integral from @samp{x} to infinity; the sum
-@texline @tmath{\hbox{erf}(x) + \hbox{erfc}(x) = 1}.
+@texline @math{\hbox{erf}(x) + \hbox{erfc}(x) = 1}.
 @infoline @expr{erf(x) + erfc(x) = 1}.
 
 @kindex f j
@@ -18617,17 +18605,17 @@
 
 For @samp{z1^z2}:  This is defined by @samp{exp(ln(z1)*z2)}.
 One interesting consequence of this is that @samp{(-8)^1:3} does
-not evaluate to @i{-2} as you might expect, but to the complex
+not evaluate to @mathit{-2} as you might expect, but to the complex
 number @expr{(1., 1.732)}.  Both of these are valid cube roots
-of @i{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps
+of @mathit{-8} (as is @expr{(1., -1.732)}); Calc chooses a perhaps
 less-obvious root for the sake of mathematical consistency.
 
 For @samp{arcsin(z)}:  This is defined by @samp{-i*ln(i*z + sqrt(1-z^2))}.
-The branch cuts are on the real axis, less than @i{-1} and greater than 1.
+The branch cuts are on the real axis, less than @mathit{-1} and greater than 1.
 
 For @samp{arccos(z)}:  This is defined by @samp{-i*ln(z + i*sqrt(1-z^2))},
 or equivalently by @samp{pi/2 - arcsin(z)}.  The branch cuts are on
-the real axis, less than @i{-1} and greater than 1.
+the real axis, less than @mathit{-1} and greater than 1.
 
 For @samp{arctan(z)}:  This is defined by
 @samp{(ln(1+i*z) - ln(1-i*z)) / (2*i)}.  The branch cuts are on the
@@ -18642,7 +18630,7 @@
 real axis less than 1.
 
 For @samp{arctanh(z)}:  This is defined by @samp{(ln(1+z) - ln(1-z)) / 2}.
-The branch cuts are on the real axis, less than @i{-1} and greater than 1.
+The branch cuts are on the real axis, less than @mathit{-1} and greater than 1.
 
 The following tables for @code{arcsin}, @code{arccos}, and
 @code{arctan} assume the current angular mode is radians.  The
@@ -18715,7 +18703,7 @@
 
 Given a positive numeric prefix argument @expr{M}, it produces a random
 integer @expr{N} in the range 
-@texline @tmath{0 \le N < M}.
+@texline @math{0 \le N < M}.
 @infoline @expr{0 <= N < M}.  
 Each of the @expr{M} values appears with equal probability.
 
@@ -18725,15 +18713,15 @@
 while numeric prefix arguments are limited to six digits or so, an @expr{M}
 taken from the stack can be arbitrarily large.  If @expr{M} is negative,
 the result is a random integer in the range 
-@texline @tmath{M < N \le 0}.
+@texline @math{M < N \le 0}.
 @infoline @expr{M < N <= 0}.
 
 If the value on the stack is a floating-point number @expr{M}, the result
 is a random floating-point number @expr{N} in the range 
-@texline @tmath{0 \le N < M}
+@texline @math{0 \le N < M}
 @infoline @expr{0 <= N < M}
 or 
-@texline @tmath{M < N \le 0},
+@texline @math{M < N \le 0},
 @infoline @expr{M < N <= 0}, 
 according to the sign of @expr{M}.
 
@@ -18743,14 +18731,14 @@
 every other call to this function will be especially fast.
 
 If @expr{M} is an error form 
-@texline @tmath{m} @code{+/-} @tmath{\sigma}
+@texline @math{m} @code{+/-} @math{\sigma}
 @infoline @samp{m +/- s} 
 where @var{m} and 
-@texline @tmath{\sigma}
+@texline @math{\sigma}
 @infoline @var{s} 
 are both real numbers, the result uses a Gaussian distribution with mean
 @var{m} and standard deviation 
-@texline @tmath{\sigma}.
+@texline @math{\sigma}.
 @var{s}.
 
 If @expr{M} is an interval form, the lower and upper bounds specify the
@@ -18863,7 +18851,7 @@
 If @code{RandSeed} contains an integer, Calc uses this integer to
 seed an ``additive congruential'' method (Knuth's algorithm 3.2.2A,
 computing 
-@texline @tmath{X_{n-55} - X_{n-24}}.
+@texline @math{X_{n-55} - X_{n-24}}.
 @infoline @expr{X_n-55 - X_n-24}).  
 This method expands the seed
 value into a large table which is maintained internally; the variable
@@ -18899,20 +18887,20 @@
 
 To create a random floating-point number with precision @var{p}, Calc
 simply creates a random @var{p}-digit integer and multiplies by
-@texline @tmath{10^{-p}}.
+@texline @math{10^{-p}}.
 @infoline @expr{10^-p}.  
 The resulting random numbers should be very clean, but note
 that relatively small numbers will have few significant random digits.
 In other words, with a precision of 12, you will occasionally get
 numbers on the order of 
-@texline @tmath{10^{-9}}
+@texline @math{10^{-9}}
 @infoline @expr{10^-9} 
 or 
-@texline @tmath{10^{-10}},
+@texline @math{10^{-10}},
 @infoline @expr{10^-10}, 
 but those numbers will only have two or three random digits since they
 correspond to small integers times 
-@texline @tmath{10^{-12}}.
+@texline @math{10^{-12}}.
 @infoline @expr{10^-12}.
 
 To create a random integer in the interval @samp{[0 .. @var{m})}, Calc
@@ -18963,7 +18951,7 @@
 The @kbd{k E} (@code{calc-extended-gcd}) [@code{egcd}] command computes
 the GCD of two integers @expr{x} and @expr{y} and returns a vector
 @expr{[g, a, b]} where 
-@texline @tmath{g = \gcd(x,y) = a x + b y}.
+@texline @math{g = \gcd(x,y) = a x + b y}.
 @infoline @expr{g = gcd(x,y) = a x + b y}.
 
 @kindex !
@@ -19007,7 +18995,7 @@
 are integers, the result is an exact integer.  Otherwise, the result is a
 floating-point approximation.  The binomial coefficient is defined for all
 real numbers by
-@texline @tmath{N! \over M! (N-M)!\,}.
+@texline @math{N! \over M! (N-M)!\,}.
 @infoline @expr{N! / M! (N-M)!}.
 
 @kindex H k c
@@ -19050,11 +19038,11 @@
 @tindex stir2
 The @kbd{k s} (@code{calc-stirling-number}) [@code{stir1}] command
 computes a Stirling number of the first 
-@texline kind@tie{}@tmath{n \brack m},
+@texline kind@tie{}@math{n \brack m},
 @infoline kind,
 given two integers @expr{n} and @expr{m} on the stack.  The @kbd{H k s}
 [@code{stir2}] command computes a Stirling number of the second 
-@texline kind@tie{}@tmath{n \brace m}.
+@texline kind@tie{}@math{n \brace m}.
 @infoline kind.
 These are the number of @expr{m}-cycle permutations of @expr{n} objects,
 and the number of ways to partition @expr{n} objects into @expr{m}
@@ -19098,8 +19086,8 @@
 inputs, prime factors above 5000 may not be found, in which case the
 last number in the vector will be an unfactored integer greater than 25
 million (with a warning message).  For negative integers, the first
-element of the list will be @i{-1}.  For inputs @i{-1}, @i{0}, and
-@i{1}, the result is a list of the same number.
+element of the list will be @mathit{-1}.  For inputs @mathit{-1}, @mathit{0}, and
+@mathit{1}, the result is a list of the same number.
 
 @kindex k n
 @pindex calc-next-prime
@@ -19133,7 +19121,7 @@
 @tindex totient
 The @kbd{k t} (@code{calc-totient}) [@code{totient}] command computes the
 Euler ``totient'' 
-@texline function@tie{}@tmath{\phi(n)},
+@texline function@tie{}@math{\phi(n)},
 @infoline function,
 the number of integers less than @expr{n} which
 are relatively prime to @expr{n}.
@@ -19142,7 +19130,7 @@
 @pindex calc-moebius
 @tindex moebius
 The @kbd{k m} (@code{calc-moebius}) [@code{moebius}] command computes the
-@texline M@"obius @tmath{\mu}
+@texline M@"obius @math{\mu}
 @infoline Moebius ``mu''
 function.  If the input number is a product of @expr{k}
 distinct factors, this is @expr{(-1)^k}.  If the input number has any
@@ -19206,7 +19194,7 @@
 @end ignore
 @tindex ltpc
 The @samp{utpc(x,v)} function uses the chi-square distribution with
-@texline @tmath{\nu}
+@texline @math{\nu}
 @infoline @expr{v} 
 degrees of freedom.  It is the probability that a model is
 correct if its chi-square statistic is @expr{x}.
@@ -19224,10 +19212,10 @@
 @tindex ltpf
 The @samp{utpf(F,v1,v2)} function uses the F distribution, used in
 various statistical tests.  The parameters 
-@texline @tmath{\nu_1}
+@texline @math{\nu_1}
 @infoline @expr{v1} 
 and 
-@texline @tmath{\nu_2}
+@texline @math{\nu_2}
 @infoline @expr{v2}
 are the degrees of freedom in the numerator and denominator,
 respectively, used in computing the statistic @expr{F}.
@@ -19245,7 +19233,7 @@
 @tindex ltpn
 The @samp{utpn(x,m,s)} function uses a normal (Gaussian) distribution
 with mean @expr{m} and standard deviation 
-@texline @tmath{\sigma}.
+@texline @math{\sigma}.
 @infoline @expr{s}.  
 It is the probability that such a normal-distributed random variable
 would exceed @expr{x}.
@@ -19278,18 +19266,18 @@
 @tindex ltpt
 The @samp{utpt(t,v)} function uses the Student's ``t'' distribution
 with 
-@texline @tmath{\nu}
+@texline @math{\nu}
 @infoline @expr{v} 
 degrees of freedom.  It is the probability that a
 t-distributed random variable will be greater than @expr{t}.
 (Note:  This computes the distribution function 
-@texline @tmath{A(t|\nu)}
+@texline @math{A(t|\nu)}
 @infoline @expr{A(t|v)}
 where 
-@texline @tmath{A(0|\nu) = 1}
+@texline @math{A(0|\nu) = 1}
 @infoline @expr{A(0|v) = 1} 
 and 
-@texline @tmath{A(\infty|\nu) \to 0}.
+@texline @math{A(\infty|\nu) \to 0}.
 @infoline @expr{A(inf|v) -> 0}.  
 The @code{UTPT} operation on the HP-48 uses a different definition which
 returns half of Calc's value:  @samp{UTPT(t,v) = .5*utpt(t,v)}.)
@@ -19409,8 +19397,8 @@
 times ten to the power of the exponent.
 
 @item -12
-This is treated the same as @i{-11} by the @kbd{v p} command.
-When unpacking, @i{-12} specifies that a floating-point mantissa
+This is treated the same as @mathit{-11} by the @kbd{v p} command.
+When unpacking, @mathit{-12} specifies that a floating-point mantissa
 is desired.
 
 @item -13
@@ -19449,7 +19437,7 @@
 If any elements of the vector are negative, other kinds of
 packing are done at that level as described above.  For
 example, @samp{[2, 3, -4]} takes 12 objects and creates a
-@texline @tmath{2\times3}
+@texline @math{2\times3}
 @infoline 2x3
 matrix of error forms: @samp{[[a +/- b, c +/- d ... ]]}.
 Also, @samp{[-4, -10]} will convert four integers into an
@@ -19487,18 +19475,18 @@
 @samp{[a, c^2, d]} and @w{@samp{[b, 0, 7]}}.
 
 Note that the prefix argument can have an effect even when the input is
-not a vector.  For example, if the input is the number @i{-5}, then
-@kbd{c-u -1 v u} yields @i{-5} and 0 (the components of @i{-5}
+not a vector.  For example, if the input is the number @mathit{-5}, then
+@kbd{c-u -1 v u} yields @mathit{-5} and 0 (the components of @mathit{-5}
 when viewed as a rectangular complex number); @kbd{C-u -2 v u} yields 5
-and 180 (assuming degrees mode); and @kbd{C-u -10 v u} yields @i{-5}
-and 1 (the numerator and denominator of @i{-5}, viewed as a rational
+and 180 (assuming degrees mode); and @kbd{C-u -10 v u} yields @mathit{-5}
+and 1 (the numerator and denominator of @mathit{-5}, viewed as a rational
 number).  Plain @kbd{v u} with this input would complain that the input
 is not a composite object.
 
-Unpacking mode @i{-11} converts a float into an integer mantissa and
+Unpacking mode @mathit{-11} converts a float into an integer mantissa and
 an integer exponent, where the mantissa is not divisible by 10
 (except that 0.0 is represented by a mantissa and exponent of 0).
-Unpacking mode @i{-12} converts a float into a floating-point mantissa
+Unpacking mode @mathit{-12} converts a float into a floating-point mantissa
 and integer exponent, where the mantissa (for non-zero numbers)
 is guaranteed to lie in the range [1 .. 10).  In both cases,
 the mantissa is shifted left or right (and the exponent adjusted
@@ -19598,7 +19586,7 @@
 the prefix argument is required.
 
 To build a constant square matrix, e.g., a 
-@texline @tmath{3\times3}
+@texline @math{3\times3}
 @infoline 3x3
 matrix filled with ones, use @kbd{0 M-3 v d 1 +}, i.e., build a zero
 matrix first and then add a constant value to that matrix.  (Another
@@ -19631,7 +19619,7 @@
 of consecutive integers from 1 to @var{n}, where @var{n} is the numeric
 prefix argument.  If you do not provide a prefix argument, you will be
 prompted to enter a suitable number.  If @var{n} is negative, the result
-is a vector of negative integers from @var{n} to @i{-1}.
+is a vector of negative integers from @var{n} to @mathit{-1}.
 
 With a prefix argument of just @kbd{C-u}, the @kbd{v x} command takes
 three values from the stack: @var{n}, @var{start}, and @var{incr} (with
@@ -19824,7 +19812,7 @@
 of the dimensions of a vector, matrix, or higher-order object.  For
 example, @samp{mdims([[a,b,c],[d,e,f]])} returns @samp{[2, 3]} since
 its argument is a 
-@texline @tmath{2\times3}
+@texline @math{2\times3}
 @infoline 2x3
 matrix.
 
@@ -19856,13 +19844,13 @@
 suitable for use as a matrix.  For example, with the matrix
 @samp{[[1, 2], @w{[3, 4]}]} on the stack, @kbd{v a 4} produces
 @samp{[[1, 2, 3, 4]]} (a 
-@texline @tmath{1\times4}
+@texline @math{1\times4}
 @infoline 1x4
 matrix), @kbd{v a 1} produces @samp{[[1], [2], [3], [4]]} (a 
-@texline @tmath{4\times1}
+@texline @math{4\times1}
 @infoline 4x1
 matrix), @kbd{v a 2} produces @samp{[[1, 2], [3, 4]]} (the original 
-@texline @tmath{2\times2}
+@texline @math{2\times2}
 @infoline 2x2
 matrix), @w{@kbd{v a 3}} produces @samp{[[1, 2, 3], [4]]} (not a
 matrix), and @kbd{v a 0} produces the flattened list 
@@ -20182,10 +20170,10 @@
 will be the empty vector @samp{[]}.  Note that the characters @kbd{V}
 and @kbd{^} were chosen to be close to the conventional mathematical
 notation for set 
-@texline union@tie{}(@tmath{A \cup B})
+@texline union@tie{}(@math{A \cup B})
 @infoline union
 and 
-@texline intersection@tie{}(@tmath{A \cap B}).
+@texline intersection@tie{}(@math{A \cap B}).
 @infoline intersection.
 
 @kindex V -
@@ -20294,7 +20282,7 @@
 set of integers in the sense of @kbd{V F} (@code{vfloor}).  Beware
 that a simple input like @samp{[100]} can result in a huge integer
 representation 
-@texline (@tmath{2^{100}}, a 31-digit integer, in this case).
+@texline (@math{2^{100}}, a 31-digit integer, in this case).
 @infoline (@expr{2^100}, a 31-digit integer, in this case).
 
 @node Statistical Operations, Reducing and Mapping, Set Operations, Matrix Functions
@@ -20406,10 +20394,10 @@
 The @kbd{u M} (@code{calc-vector-mean}) [@code{vmean}] command
 computes the average (arithmetic mean) of the data values.
 If the inputs are error forms 
-@texline @tmath{x \pm \sigma},
+@texline @math{x \pm \sigma},
 @infoline @samp{x +/- s}, 
 this is the weighted mean of the @expr{x} values with weights 
-@texline @tmath{1 /\sigma^2}.
+@texline @math{1 /\sigma^2}.
 @infoline @expr{1 / s^2}.
 @tex
 \turnoffactive
@@ -20421,7 +20409,7 @@
 
 Note that a plain number can be considered an error form with
 error 
-@texline @tmath{\sigma = 0}.
+@texline @math{\sigma = 0}.
 @infoline @expr{s = 0}.  
 If the input to @kbd{u M} is a mixture of
 plain numbers and error forms, the result is the mean of the
@@ -20530,7 +20518,7 @@
 @cindex Sample statistics
 The @kbd{u S} (@code{calc-vector-sdev}) [@code{vsdev}] command
 computes the standard 
-@texline deviation@tie{}@tmath{\sigma}
+@texline deviation@tie{}@math{\sigma}
 @infoline deviation
 of the data values.  If the values are error forms, the errors are used
 as weights just as for @kbd{u M}.  This is the @emph{sample} standard
@@ -20546,7 +20534,7 @@
 of a single error form is simply the error part.  The standard deviation
 of a continuous interval happens to equal the difference between the
 limits, divided by 
-@texline @tmath{\sqrt{12}}.
+@texline @math{\sqrt{12}}.
 @infoline @expr{sqrt(12)}.  
 The standard deviation of an integer interval is the same as the
 standard deviation of a vector of those integers.
@@ -20584,7 +20572,7 @@
 @kbd{H I u S} (@code{calc-vector-pop-variance}) [@code{vpvar}]
 commands compute the variance of the data values.  The variance
 is the 
-@texline square@tie{}@tmath{\sigma^2}
+@texline square@tie{}@math{\sigma^2}
 @infoline square
 of the standard deviation, i.e., the sum of the
 squares of the deviations of the data values from the mean.
@@ -20608,7 +20596,7 @@
 way as by the single-variable statistical functions.  Given a numeric
 prefix argument of 1, these functions instead take one object from
 the stack, which must be an 
-@texline @tmath{N\times2}
+@texline @math{N\times2}
 @infoline Nx2
 matrix of data values.  Once again, variable names can be used in place
 of actual vectors and matrices.
@@ -20866,7 +20854,7 @@
 across all elements of the matrix.  For example, given the matrix
 @expr{[[1, -2, 3], [-4, 5, -6]]}, @kbd{V M A} takes six absolute values to
 produce another 
-@texline @tmath{3\times2}
+@texline @math{3\times2}
 @infoline 3x2
 matrix, @expr{[[1, 2, 3], [4, 5, 6]]}.
 
@@ -22019,7 +22007,7 @@
 @kbd{a s}; @pxref{Simplifying Formulas}.  If you give a numeric prefix
 of 3 or more, it uses extended simplification mode (@kbd{a e}).
 
-If you give a negative prefix argument @i{-1}, @i{-2}, or @i{-3},
+If you give a negative prefix argument @mathit{-1}, @mathit{-2}, or @mathit{-3},
 it simplifies in the corresponding mode but only works on the top-level
 function call of the formula.  For example, @samp{(2 + 3) * (2 + 3)} will
 simplify to @samp{(2 + 3)^2}, without simplifying the sub-formulas
@@ -22291,7 +22279,7 @@
 
 The distributive law is used to simplify sums in some cases:
 @expr{a x + b x} to @expr{(a + b) x}, where @expr{a} represents
-a number or an implicit 1 or @i{-1} (as in @expr{x} or @expr{-x})
+a number or an implicit 1 or @mathit{-1} (as in @expr{x} or @expr{-x})
 and similarly for @expr{b}.  Use the @kbd{a c}, @w{@kbd{a f}}, or
 @kbd{j M} commands to merge sums with non-numeric coefficients
 using the distributive law.
@@ -22335,7 +22323,7 @@
 
 The distributive law of products and powers is used for adjacent
 terms of the product: @expr{x^a x^b} goes to 
-@texline @tmath{x^{a+b}}
+@texline @math{x^{a+b}}
 @infoline @expr{x^(a+b)}
 where @expr{a} is a number, or an implicit 1 (as in @expr{x}),
 or the implicit one-half of @expr{@t{sqrt}(x)}, and similarly for
@@ -22346,7 +22334,7 @@
 
 The product of a negative power times anything but another negative
 power is changed to use division:  
-@texline @tmath{x^{-2} y}
+@texline @math{x^{-2} y}
 @infoline @expr{x^(-2) y} 
 goes to @expr{y / x^2} unless matrix mode is
 in effect and neither @expr{x} nor @expr{y} are scalar (in which
@@ -22370,11 +22358,11 @@
 @xref{Infinite Mode}.
 
 The expression 
-@texline @tmath{a / b^{-c}}
+@texline @math{a / b^{-c}}
 @infoline @expr{a / b^(-c)} 
 is changed to @expr{a b^c}, where @expr{-c} is any negative-looking
 power.  Also, @expr{1 / b^c} is changed to 
-@texline @tmath{b^{-c}}
+@texline @math{b^{-c}}
 @infoline @expr{b^(-c)} 
 for any power @expr{c}.
 
@@ -22415,22 +22403,22 @@
 are distributed to @expr{a^c b^c}, @expr{a^c / b^c} only if @expr{c}
 is an integer, or if either @expr{a} or @expr{b} are nonnegative
 real numbers.  Powers of powers @expr{(a^b)^c} are simplified to
-@texline @tmath{a^{b c}}
+@texline @math{a^{b c}}
 @infoline @expr{a^(b c)} 
 only when @expr{c} is an integer and @expr{b c} also
 evaluates to an integer.  Without these restrictions these simplifications
 would not be safe because of problems with principal values.
 (In other words, 
-@texline @tmath{((-3)^{1/2})^2}
+@texline @math{((-3)^{1/2})^2}
 @infoline @expr{((-3)^1:2)^2} 
 is safe to simplify, but
-@texline @tmath{((-3)^2)^{1/2}}
+@texline @math{((-3)^2)^{1/2}}
 @infoline @expr{((-3)^2)^1:2} 
 is not.)  @xref{Declarations}, for ways to inform Calc that your
 variables satisfy these requirements.
 
 As a special case of this rule, @expr{@t{sqrt}(x)^n} is simplified to
-@texline @tmath{x^{n/2}}
+@texline @math{x^{n/2}}
 @infoline @expr{x^(n/2)} 
 only for even integers @expr{n}.
 
@@ -22443,15 +22431,15 @@
 for any negative-looking expression @expr{-a}.
 
 Square roots @expr{@t{sqrt}(x)} generally act like one-half powers
-@texline @tmath{x^{1:2}}
+@texline @math{x^{1:2}}
 @infoline @expr{x^1:2} 
 for the purposes of the above-listed simplifications.
 
 Also, note that 
-@texline @tmath{1 / x^{1:2}}
+@texline @math{1 / x^{1:2}}
 @infoline @expr{1 / x^1:2} 
 is changed to 
-@texline @tmath{x^{-1:2}},
+@texline @math{x^{-1:2}},
 @infoline @expr{x^(-1:2)},
 but @expr{1 / @t{sqrt}(x)} is left alone.
 
@@ -22594,7 +22582,7 @@
 A subtle point is that @expr{(x - y) (y - x)} will @emph{not}
 be simplified to @expr{-(x - y)^2}; Calc does not notice that
 one term can be written as a constant times the other, even if
-that constant is @i{-1}.
+that constant is @mathit{-1}.
 
 A fraction times any expression, @expr{(a:b) x}, is changed to
 a quotient involving integers:  @expr{a x / b}.  This is not
@@ -22637,7 +22625,7 @@
 several ways.  (Note that these will be left unevaluated only in
 Symbolic mode.)  First, square integer or rational factors are
 pulled out so that @expr{@t{sqrt}(8)} is rewritten as
-@texline @tmath{$2\,\t{sqrt}(2)$}.
+@texline @math{2\,\t{sqrt}(2)}.
 @infoline @expr{2 sqrt(2)}.  
 Conceptually speaking this implies factoring the argument into primes
 and moving pairs of primes out of the square root, but for reasons of
@@ -22699,23 +22687,23 @@
 @code{arctan}, @code{arcsinh}, and @code{arctanh}.  Note that
 @expr{@t{arcsin}(@t{sin}(x))} can @emph{not} safely change to
 @expr{x}, since this only correct within an integer multiple of 
-@texline @tmath{2 \pi}
+@texline @math{2 \pi}
 @infoline @expr{2 pi} 
 radians or 360 degrees.  However, @expr{@t{arcsinh}(@t{sinh}(x))} is
 simplified to @expr{x} if @expr{x} is known to be real.
 
 Several simplifications that apply to logarithms and exponentials
 are that @expr{@t{exp}(@t{ln}(x))}, 
-@texline @t{e}@tmath{^{\ln(x)}},
+@texline @t{e}@math{^{\ln(x)}},
 @infoline @expr{e^@t{ln}(x)}, 
 and
-@texline @tmath{10^{{\rm log10}(x)}}
+@texline @math{10^{{\rm log10}(x)}}
 @infoline @expr{10^@t{log10}(x)} 
 all reduce to @expr{x}.  Also, @expr{@t{ln}(@t{exp}(x))}, etc., can
 reduce to @expr{x} if @expr{x} is provably real.  The form
 @expr{@t{exp}(x)^y} is simplified to @expr{@t{exp}(x y)}.  If @expr{x}
 is a suitable multiple of 
-@texline @tmath{\pi i} 
+@texline @math{\pi i} 
 @infoline @expr{pi i}
 (as described above for the trigonometric functions), then
 @expr{@t{exp}(x)} or @expr{e^x} will be expanded.  Finally,
@@ -22800,18 +22788,18 @@
 functions always produce.
 
 Powers of powers @expr{(x^a)^b} are simplified to 
-@texline @tmath{x^{a b}}
+@texline @math{x^{a b}}
 @infoline @expr{x^(a b)}
 for all @expr{a} and @expr{b}.  These results will be valid only
 in a restricted range of @expr{x}; for example, in 
-@texline @tmath{(x^2)^{1:2}}
+@texline @math{(x^2)^{1:2}}
 @infoline @expr{(x^2)^1:2}
 the powers cancel to get @expr{x}, which is valid for positive values
 of @expr{x} but not for negative or complex values.
 
 Similarly, @expr{@t{sqrt}(x^a)} and @expr{@t{sqrt}(x)^a} are both
 simplified (possibly unsafely) to 
-@texline @tmath{x^{a/2}}.
+@texline @math{x^{a/2}}.
 @infoline @expr{x^(a/2)}.
 
 Forms like @expr{@t{sqrt}(1 - sin(x)^2)} are simplified to, e.g.,
@@ -22887,7 +22875,7 @@
 For powers and square roots, the ``unsafe'' simplifications
 @expr{(a b)^c} to @expr{a^c b^c}, @expr{(a/b)^c} to @expr{a^c / b^c},
 and @expr{(a^b)^c} to 
-@texline @tmath{a^{b c}}
+@texline @math{a^{b c}}
 @infoline @expr{a^(b c)} 
 are done if the powers are real numbers.  (These are safe in the context
 of units because all numbers involved can reasonably be assumed to be
@@ -22902,10 +22890,10 @@
 is defined in terms of @samp{m^2}, and that the 2 in the power of
 @code{m} is a multiple of 2 in @expr{3:2}.  Thus, @code{acre^1.5} is
 replaced by approximately 
-@texline @tmath{(4046 m^2)^{1.5}}
+@texline @math{(4046 m^2)^{1.5}}
 @infoline @expr{(4046 m^2)^1.5}, 
 which is then changed to 
-@texline @tmath{4046^{1.5} \, (m^2)^{1.5}},
+@texline @math{4046^{1.5} \, (m^2)^{1.5}},
 @infoline @expr{4046^1.5 (m^2)^1.5}, 
 then to @expr{257440 m^3}.
 
@@ -23195,7 +23183,7 @@
 If you use the @code{deriv} function directly in an algebraic formula,
 you can write @samp{deriv(f,x,x0)} which represents the derivative
 of @expr{f} with respect to @expr{x}, evaluated at the point 
-@texline @tmath{x=x_0}.
+@texline @math{x=x_0}.
 @infoline @expr{x=x0}.
 
 If the formula being differentiated contains functions which Calc does
@@ -23235,7 +23223,7 @@
 classes of formulas.  In particular, any polynomial or rational function
 (a polynomial divided by a polynomial) is acceptable.  (Rational functions
 don't have to be in explicit quotient form, however; 
-@texline @tmath{x/(1+x^{-2})}
+@texline @math{x/(1+x^{-2})}
 @infoline @expr{x/(1+x^-2)}
 is not strictly a quotient of polynomials, but it is equivalent to
 @expr{x^3/(x^2+1)}, which is.)  Also, square roots of terms involving
@@ -23261,7 +23249,7 @@
 Please note that the current implementation of Calc's integrator sometimes
 produces results that are significantly more complex than they need to
 be.  For example, the integral Calc finds for 
-@texline @tmath{1/(x+\sqrt{x^2+1})}
+@texline @math{1/(x+\sqrt{x^2+1})}
 @infoline @expr{1/(x+sqrt(x^2+1))}
 is several times more complicated than the answer Mathematica
 returns for the same input, although the two forms are numerically
@@ -23269,11 +23257,11 @@
 an arbitrary constant of integration added to it, although Calc does not
 write an explicit constant of integration in its result.  For example,
 Calc's solution for 
-@texline @tmath{1/(1+\tan x)}
+@texline @math{1/(1+\tan x)}
 @infoline @expr{1/(1+tan(x))} 
 differs from the solution given in the @emph{CRC Math Tables} by a
 constant factor of  
-@texline @tmath{\pi i / 2}
+@texline @math{\pi i / 2}
 @infoline @expr{pi i / 2},
 due to a different choice of constant of integration.
 
@@ -23333,7 +23321,7 @@
 As a more serious example, the expression @samp{exp(x)/x} cannot be
 integrated in terms of the standard functions, so the ``exponential
 integral'' function 
-@texline @tmath{{\rm Ei}(x)}
+@texline @math{{\rm Ei}(x)}
 @infoline @expr{Ei(x)} 
 was invented to describe it.
 We can get Calc to do this integral in terms of a made-up @code{Ei}
@@ -23506,16 +23494,16 @@
 This command also works for inequalities, as in @expr{y < 3x + 6}.
 Some inequalities cannot be solved where the analogous equation could
 be; for example, solving 
-@texline @tmath{a < b \, c}
+@texline @math{a < b \, c}
 @infoline @expr{a < b c} 
 for @expr{b} is impossible
 without knowing the sign of @expr{c}.  In this case, @kbd{a S} will
 produce the result 
-@texline @tmath{b \mathbin{\hbox{\code{!=}}} a/c}
+@texline @math{b \mathbin{\hbox{\code{!=}}} a/c}
 @infoline @expr{b != a/c} 
 (using the not-equal-to operator) to signify that the direction of the
 inequality is now unknown.  The inequality 
-@texline @tmath{a \le b \, c}
+@texline @math{a \le b \, c}
 @infoline @expr{a <= b c} 
 is not even partially solved.  @xref{Declarations}, for a way to tell
 Calc that the signs of the variables in a formula are in fact known.
@@ -23542,7 +23530,7 @@
 general family of solutions.  It will invent variables @code{n1},
 @code{n2}, @dots{}, which represent independent arbitrary integers, and
 @code{s1}, @code{s2}, @dots{}, which represent independent arbitrary
-signs (either @i{+1} or @i{-1}).  If you don't use the Hyperbolic
+signs (either @mathit{+1} or @mathit{-1}).  If you don't use the Hyperbolic
 flag, Calc will use zero in place of all arbitrary integers, and plus
 one in place of all arbitrary signs.  Note that variables like @code{n1}
 and @code{s1} are not given any special interpretation in Calc except by
@@ -23975,11 +23963,11 @@
 
 Note that this command looks for a @emph{local} minimum.  Many functions
 have more than one minimum; some, like 
-@texline @tmath{x \sin x},
+@texline @math{x \sin x},
 @infoline @expr{x sin(x)}, 
 have infinitely many.  In fact, there is no easy way to define the
 ``global'' minimum of 
-@texline @tmath{x \sin x}
+@texline @math{x \sin x}
 @infoline @expr{x sin(x)} 
 but Calc can still locate any particular local minimum
 for you.  Calc basically goes downhill from the initial guess until it
@@ -24102,7 +24090,7 @@
 The @kbd{a F} command takes the data set to be fitted from the stack.
 By default, it expects the data in the form of a matrix.  For example,
 for a linear or polynomial fit, this would be a 
-@texline @tmath{2\times N}
+@texline @math{2\times N}
 @infoline 2xN
 matrix where the first row is a list of @expr{x} values and the second
 row has the corresponding @expr{y} values.  For the multilinear fit
@@ -24110,10 +24098,10 @@
 @expr{x_3}, and @expr{y}, respectively).
 
 If you happen to have an 
-@texline @tmath{N\times2}
+@texline @math{N\times2}
 @infoline Nx2
 matrix instead of a 
-@texline @tmath{2\times N}
+@texline @math{2\times N}
 @infoline 2xN
 matrix, just press @kbd{v t} first to transpose the matrix.
 
@@ -24211,11 +24199,11 @@
 and increases as various @expr{a + b x_i} values fail to match the
 corresponding @expr{y_i} values.  There are several reasons why the
 summand is squared, one of them being to ensure that 
-@texline @tmath{\chi^2 \ge 0}.
+@texline @math{\chi^2 \ge 0}.
 @infoline @expr{chi^2 >= 0}.
 Least-squares fitting simply chooses the values of @expr{a} and @expr{b}
 for which the error 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2} 
 is as small as possible.
 
@@ -24271,7 +24259,7 @@
 
 An important result from the theory of polynomial fitting is that it
 is always possible to fit @var{n} data points exactly using a polynomial
-of degree @i{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}.
+of degree @mathit{@var{n}-1}, sometimes called an @dfn{interpolating polynomial}.
 Using the modified (14) data matrix, a model number of 4 gives
 a polynomial that exactly matches all five data points:
 
@@ -24376,10 +24364,10 @@
 or all be plain numbers.  Error forms can go anywhere but generally
 go on the numbers in the last row of the data matrix.  If the last
 row contains error forms
-@texline `@var{y_i}@w{ @t{+/-} }@tmath{\sigma_i}', 
+@texline `@var{y_i}@w{ @t{+/-} }@math{\sigma_i}', 
 @infoline `@var{y_i}@w{ @t{+/-} }@var{sigma_i}', 
 then the 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2}
 statistic is now,
 
@@ -24402,7 +24390,7 @@
 If there are error forms on other rows of the data matrix, all the
 errors for a given data point are combined; the square root of the
 sum of the squares of the errors forms the 
-@texline @tmath{\sigma_i}
+@texline @math{\sigma_i}
 @infoline @expr{sigma_i} 
 used for the data point.
 
@@ -24412,14 +24400,14 @@
 estimates.
 
 If the input contains error forms but all the 
-@texline @tmath{\sigma_i}
+@texline @math{\sigma_i}
 @infoline @expr{sigma_i} 
 values are the same, it is easy to see that the resulting fitted model
 will be the same as if the input did not have error forms at all 
-@texline (@tmath{\chi^2}
+@texline (@math{\chi^2}
 @infoline (@expr{chi^2}
 is simply scaled uniformly by 
-@texline @tmath{1 / \sigma^2},
+@texline @math{1 / \sigma^2},
 @infoline @expr{1 / sigma^2}, 
 which doesn't affect where it has a minimum).  But there @emph{will} be
 a difference in the estimated errors of the coefficients reported by
@@ -24454,20 +24442,20 @@
 @item
 The covariance matrix @expr{C} computed from the fit.  This is
 an @var{m}x@var{m} symmetric matrix; the diagonal elements
-@texline @tmath{C_{jj}}
+@texline @math{C_{jj}}
 @infoline @expr{C_j_j} 
 are the variances 
-@texline @tmath{\sigma_j^2}
+@texline @math{\sigma_j^2}
 @infoline @expr{sigma_j^2} 
 of the parameters.  The other elements are covariances
-@texline @tmath{\sigma_{ij}^2} 
+@texline @math{\sigma_{ij}^2} 
 @infoline @expr{sigma_i_j^2} 
 that describe the correlation between pairs of parameters.  (A related
 set of numbers, the @dfn{linear correlation coefficients} 
-@texline @tmath{r_{ij}},
+@texline @math{r_{ij}},
 @infoline @expr{r_i_j},
 are defined as 
-@texline @tmath{\sigma_{ij}^2 / \sigma_i \, \sigma_j}.)
+@texline @math{\sigma_{ij}^2 / \sigma_i \, \sigma_j}.)
 @infoline @expr{sigma_i_j^2 / sigma_i sigma_j}.)
 
 @item
@@ -24478,11 +24466,11 @@
 
 @item
 The value of 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2} 
 for the fit, calculated by the formulas shown above.  This gives a
 measure of the quality of the fit; statisticians consider
-@texline @tmath{\chi^2 \approx N - M}
+@texline @math{\chi^2 \approx N - M}
 @infoline @expr{chi^2 = N - M} 
 to indicate a moderately good fit (where again @expr{N} is the number of
 data points and @expr{M} is the number of parameters).
@@ -24491,13 +24479,13 @@
 A measure of goodness of fit expressed as a probability @expr{Q}.
 This is computed from the @code{utpc} probability distribution
 function using 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2} 
 with @expr{N - M} degrees of freedom.  A
 value of 0.5 implies a good fit; some texts recommend that often
 @expr{Q = 0.1} or even 0.001 can signify an acceptable fit.  In
 particular, 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2} 
 statistics assume the errors in your inputs
 follow a normal (Gaussian) distribution; if they don't, you may
@@ -24506,7 +24494,7 @@
 The @expr{Q} value is computed only if the input included error
 estimates.  Otherwise, Calc will report the symbol @code{nan}
 for @expr{Q}.  The reason is that in this case the 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2}
 value has effectively been used to estimate the original errors
 in the input, and thus there is no redundant information left
@@ -24525,31 +24513,31 @@
 
 @table @kbd
 @item 1
-Linear or multilinear.  @i{a + b x + c y + d z}.
+Linear or multilinear.  @mathit{a + b x + c y + d z}.
 @item 2-9
-Polynomials.  @i{a + b x + c x^2 + d x^3}.
+Polynomials.  @mathit{a + b x + c x^2 + d x^3}.
 @item e
-Exponential.  @i{a} @t{exp}@i{(b x)} @t{exp}@i{(c y)}.
+Exponential.  @mathit{a} @t{exp}@mathit{(b x)} @t{exp}@mathit{(c y)}.
 @item E
-Base-10 exponential.  @i{a} @t{10^}@i{(b x)} @t{10^}@i{(c y)}.
+Base-10 exponential.  @mathit{a} @t{10^}@mathit{(b x)} @t{10^}@mathit{(c y)}.
 @item x
-Exponential (alternate notation).  @t{exp}@i{(a + b x + c y)}.
+Exponential (alternate notation).  @t{exp}@mathit{(a + b x + c y)}.
 @item X
-Base-10 exponential (alternate).  @t{10^}@i{(a + b x + c y)}.
+Base-10 exponential (alternate).  @t{10^}@mathit{(a + b x + c y)}.
 @item l
-Logarithmic.  @i{a + b} @t{ln}@i{(x) + c} @t{ln}@i{(y)}.
+Logarithmic.  @mathit{a + b} @t{ln}@mathit{(x) + c} @t{ln}@mathit{(y)}.
 @item L
-Base-10 logarithmic.  @i{a + b} @t{log10}@i{(x) + c} @t{log10}@i{(y)}.
+Base-10 logarithmic.  @mathit{a + b} @t{log10}@mathit{(x) + c} @t{log10}@mathit{(y)}.
 @item ^
-General exponential.  @i{a b^x c^y}.
+General exponential.  @mathit{a b^x c^y}.
 @item p
-Power law.  @i{a x^b y^c}.
+Power law.  @mathit{a x^b y^c}.
 @item q
-Quadratic.  @i{a + b (x-c)^2 + d (x-e)^2}.
+Quadratic.  @mathit{a + b (x-c)^2 + d (x-e)^2}.
 @item g
 Gaussian.  
-@texline @tmath{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}.
-@infoline @i{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}.
+@texline @math{{a \over b \sqrt{2 \pi}} \exp\left( -{1 \over 2} \left( x - c \over b \right)^2 \right)}.
+@infoline @mathit{(a / b sqrt(2 pi)) exp(-0.5*((x-c)/b)^2)}.
 @end table
 
 All of these models are used in the usual way; just press the appropriate
@@ -24661,18 +24649,18 @@
 and @code{arcsin} when doing fits.  For example, when you enter
 the model @samp{y = sin(a t + b)} Calc actually uses the easier
 form @samp{arcsin(y) = a t + b}.  The @code{arcsin} function always
-returns results in the range from @i{-90} to 90 degrees (or the
+returns results in the range from @mathit{-90} to 90 degrees (or the
 equivalent range in radians).  Suppose you had data that you
 believed to represent roughly three oscillations of a sine wave,
 so that the argument of the sine might go from zero to 
-@texline @tmath{3\times360}
-@infoline @i{3*360} 
+@texline @math{3\times360}
+@infoline @mathit{3*360} 
 degrees.
 The above model would appear to be a good way to determine the
 true frequency and phase of the sine wave, but in practice it
 would fail utterly.  The righthand side of the actual model
 @samp{arcsin(y) = a t + b} will grow smoothly with @expr{t}, but
-the lefthand side will bounce back and forth between @i{-90} and 90.
+the lefthand side will bounce back and forth between @mathit{-90} and 90.
 No values of @expr{a} and @expr{b} can make the two sides match,
 even approximately.
 
@@ -24727,16 +24715,16 @@
 
 @noindent
 which matches the desired form with 
-@texline @tmath{Y = \ln(y)},
+@texline @math{Y = \ln(y)},
 @infoline @expr{Y = ln(y)}, 
-@texline @tmath{A = \ln(a)},
+@texline @math{A = \ln(a)},
 @infoline @expr{A = ln(a)},
 @expr{F = 1}, @expr{B = b}, and 
-@texline @tmath{G = \ln(x)}.
+@texline @math{G = \ln(x)}.
 @infoline @expr{G = ln(x)}.  
 Calc thus computes the logarithms of your @expr{y} and @expr{x} values,
 does a linear fit for @expr{A} and @expr{B}, then solves to get 
-@texline @tmath{a = \exp(A)} 
+@texline @math{a = \exp(A)} 
 @infoline @expr{a = exp(A)} 
 and @expr{b = B}.
 
@@ -24750,7 +24738,7 @@
 
 @noindent
 which matches with @expr{Y = y}, @expr{A = a + b c^2}, @expr{F = 1},
-@expr{B = -2 b c}, @expr{G = x} (the @i{-2} factor could just as easily
+@expr{B = -2 b c}, @expr{G = x} (the @mathit{-2} factor could just as easily
 have been put into @expr{G} instead of @expr{B}), @expr{C = b}, and
 @expr{H = x^2}.
 
@@ -24782,7 +24770,7 @@
 A last desperate step would be to use the general-purpose
 @code{minimize} function rather than @code{fit}.  After all, both
 functions solve the problem of minimizing an expression (the 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2}
 sum) by adjusting certain parameters in the expression.  The @kbd{a F}
 command is able to use a vastly more efficient algorithm due to its
@@ -24793,7 +24781,7 @@
 fit is linearizable, and use @code{minimize} on a call to @code{fit}
 which efficiently takes care of the rest of the parameters.  The thing
 to be minimized would be the value of 
-@texline @tmath{\chi^2}
+@texline @math{\chi^2}
 @infoline @expr{chi^2} 
 returned as the fifth result of the @code{xfit} function:
 
@@ -24853,11 +24841,11 @@
 form with this combined error.  The @expr{Y(x,y,z)} part of the
 linearized model is evaluated, and the result should be an error
 form.  The error part of that result is used for 
-@texline @tmath{\sigma_i}
+@texline @math{\sigma_i}
 @infoline @expr{sigma_i} 
 for the data point.  If for some reason @expr{Y(x,y,z)} does not return 
 an error form, the combined error from @expr{z} is used directly for 
-@texline @tmath{\sigma_i}.
+@texline @math{\sigma_i}.
 @infoline @expr{sigma_i}.  
 Finally, @expr{z} is also stripped of its error
 for use in computing @expr{F(x,y,z)}, @expr{G(x,y,z)} and so on;
@@ -24869,7 +24857,7 @@
 depends only on the dependent variable @expr{z}, and in fact is
 often simply equal to @expr{z}.  For common cases like polynomials
 and multilinear models, the combined error is simply used as the
-@texline @tmath{\sigma}
+@texline @math{\sigma}
 @infoline @expr{sigma} 
 for the data point with no further ado.)
 
@@ -25223,7 +25211,7 @@
 positive step size), the result is generally zero.  However,
 Calc only guarantees a zero result when the upper limit is
 exactly one step less than the lower limit, i.e., if the number
-of iterations is @i{-1}.  Thus @samp{sum(f(k), k, n, n-1)} is zero
+of iterations is @mathit{-1}.  Thus @samp{sum(f(k), k, n, n-1)} is zero
 but the sum from @samp{n} to @samp{n-2} may report a nonzero value
 if Calc used a closed form solution.
 
@@ -25249,7 +25237,7 @@
 Calc will not assume is zero.  Better would be to use
 @samp{(k != k_0) ? 1/(k-k_0) : 0}; the @samp{? :} operator does
 an ``if-then-else'' test:  This expression says, ``if 
-@texline @tmath{k \ne k_0},
+@texline @math{k \ne k_0},
 @infoline @expr{k != k_0},
 then @expr{1/(k-k_0)}, else zero.''  Now the formula @expr{1/(k-k_0)}
 will not even be evaluated by Calc when @expr{k = k_0}.
@@ -26264,16 +26252,16 @@
 all three rules.  It is possible to modify the imported rules
 slightly:  @samp{import(x, v1, x1, v2, x2, @dots{})} imports
 the rule set @expr{x} with all occurrences of 
-@texline @tmath{v_1},
+@texline @math{v_1},
 @infoline @expr{v1}, 
 as either a variable name or a function name, replaced with 
-@texline @tmath{x_1}
+@texline @math{x_1}
 @infoline @expr{x1} 
 and so on.  (If 
-@texline @tmath{v_1}
+@texline @math{v_1}
 @infoline @expr{v1} 
 is used as a function name, then 
-@texline @tmath{x_1}
+@texline @math{x_1}
 @infoline @expr{x1}
 must be either a function name itself or a @w{@samp{< >}} nameless
 function; @pxref{Specifying Operators}.)  For example, @samp{[g(0) := 0,
@@ -27739,7 +27727,7 @@
 units.
 
 Two units, @code{pi} and @code{fsc} (the fine structure constant,
-approximately @i{1/137}) are dimensionless.  The units simplification
+approximately @mathit{1/137}) are dimensionless.  The units simplification
 commands simply treat these names as equivalent to their corresponding
 values.  However you can, for example, use @kbd{u c} to convert a pure
 number into multiples of the fine structure constant, or @kbd{u b} to
@@ -27956,10 +27944,10 @@
 order of the operands.  If @expr{v} represents the contents of the
 variable, and @expr{a} is the value drawn from the stack, then regular
 @w{@kbd{s -}} assigns 
-@texline @tmath{v \coloneq v - a},
+@texline @math{v \coloneq v - a},
 @infoline @expr{v := v - a}, 
 but @kbd{I s -} assigns
-@texline @tmath{v \coloneq a - v}.
+@texline @math{v \coloneq a - v}.
 @infoline @expr{v := a - v}.  
 While @kbd{I s *} might seem pointless, it is
 useful if matrix multiplication is involved.  Actually, all the
@@ -28546,7 +28534,7 @@
 ``z'' value must be a matrix with the same number of rows as elements
 in ``x'', and the same number of columns as elements in ``y''.  The
 result is a surface plot where 
-@texline @tmath{z_{ij}}
+@texline @math{z_{ij}}
 @infoline @expr{z_ij} 
 is the height of the point
 at coordinate @expr{(x_i, y_j)} on the surface.  The 3D graph will
@@ -28657,7 +28645,7 @@
 they are to look nice on the same graph.)
 
 For example, to plot 
-@texline @tmath{\sin n x}
+@texline @math{\sin n x}
 @infoline @expr{sin(n x)} 
 for integers @expr{n}
 from 1 to 5, you could use @kbd{v x} to create a vector of integers
@@ -28908,7 +28896,7 @@
 the @kbd{g a} and @kbd{g f} commands will use those style numbers
 instead of the defaults for new curves that are added to the graph.
 An entry should be a positive integer for a specific style, or 0 to let
-the style be chosen automatically, or @i{-1} to turn off lines or points
+the style be chosen automatically, or @mathit{-1} to turn off lines or points
 altogether.  If there are more curves than elements in the vector, the
 last few curves will continue to have the default styles.  Of course,
 you can later use @kbd{g s} and @kbd{g S} to change any of these styles.
@@ -28947,7 +28935,7 @@
 to a buffer called @samp{*Gnuplot Trail*}, which Calc then displays.
 The graph is made the same size as the Emacs screen, which on most
 dumb terminals will be 
-@texline @tmath{80\times24}
+@texline @math{80\times24}
 @infoline 80x24
 characters.  The graph is displayed in
 an Emacs ``recursive edit''; type @kbd{q} or @kbd{M-# M-#} to exit
@@ -29257,7 +29245,7 @@
 
 @xref{Matrix Functions}, to see how to pull the matrix apart into its
 constituent rows and columns.  (If it is a 
-@texline @tmath{1\times1}
+@texline @math{1\times1}
 @infoline 1x1
 matrix, just hit @kbd{v u} (@code{calc-unpack}) twice.)
 
@@ -29595,7 +29583,7 @@
 @key{INV GCD} computes the LCM (least common multiple) function.
 
 @key{INV FACT} is the gamma function.  
-@texline @tmath{\Gamma(x) = (x-1)!}.
+@texline @math{\Gamma(x) = (x-1)!}.
 @infoline @expr{gamma(x) = (x-1)!}.
 
 @key{PERM} is the number-of-permutations function, which is on the
@@ -31023,7 +31011,7 @@
 is greater than @var{final} the body will not be executed at all.
 Note that @var{step} may still be negative in this loop; the prefix
 argument merely constrains the loop-finished test.  Likewise, a prefix
-argument of @i{-1} forces downward-counting conventions.
+argument of @mathit{-1} forces downward-counting conventions.
 
 @kindex Z @{
 @kindex Z @}
@@ -31994,7 +31982,7 @@
 @tindex mysin
 A somewhat limited sine function could be defined as follows, using the
 well-known Taylor series expansion for 
-@texline @tmath{\sin x}:
+@texline @math{\sin x}:
 @infoline @samp{sin(x)}:
 
 @smallexample
@@ -32517,10 +32505,10 @@
 Large integers are stored as lists of the form @samp{(bigpos @var{d0}
 @var{d1} @var{d2} @dots{})} for positive integers 1000000 or more, or
 @samp{(bigneg @var{d0} @var{d1} @var{d2} @dots{})} for negative integers
-@i{-1000000} or less.  Each @var{d} is a base-1000 ``digit,'' a Lisp integer
+@mathit{-1000000} or less.  Each @var{d} is a base-1000 ``digit,'' a Lisp integer
 from 0 to 999.  The least significant digit is @var{d0}; the last digit,
 @var{dn}, which is always nonzero, is the most significant digit.  For
-example, the integer @i{-12345678} is stored as @samp{(bigneg 678 345 12)}.
+example, the integer @mathit{-12345678} is stored as @samp{(bigneg 678 345 12)}.
 
 The distinction between small and large integers is entirely hidden from
 the user.  In @code{defmath} definitions, the Lisp predicate @code{integerp}
@@ -32541,7 +32529,7 @@
 @samp{10^@var{p}} in absolute value (@var{p} represents the current
 precision), and @var{exp} (the ``exponent'') is a fixnum.  The value of
 the float is @samp{@var{mant} * 10^@var{exp}}.  For example, the number
-@i{-3.14} is stored as @samp{(float -314 -2) = -314*10^-2}.  Other constraints
+@mathit{-3.14} is stored as @samp{(float -314 -2) = -314*10^-2}.  Other constraints
 are that the number 0.0 is always stored as @samp{(float 0 0)}, and,
 except for the 0.0 case, the rightmost base-10 digit of @var{mant} is
 always nonzero.  (If the rightmost digit is zero, the number is
@@ -32853,7 +32841,7 @@
 specified, nothing happens.  When the argument is two or more,
 the binary function @var{func} is reduced across the top @var{arg}
 stack elements; when the argument is negative, the function is
-mapped between the next-to-top @i{-@var{arg}} stack elements and the
+mapped between the next-to-top @mathit{-@var{arg}} stack elements and the
 top element.
 @end defun
 
@@ -33272,7 +33260,7 @@
 @end defun
 
 @defun compare x y
-Compare the numbers @var{x} and @var{y}, and return @i{-1} if
+Compare the numbers @var{x} and @var{y}, and return @mathit{-1} if
 @samp{(lessp @var{x} @var{y})}, 1 if @samp{(lessp @var{y} @var{x})},
 0 if @samp{(math-equal @var{x} @var{y})}, or 2 if the order is
 undefined or cannot be determined.
@@ -33285,7 +33273,7 @@
 @end defun
 
 @defun scale-int x n
-Shift integer @var{x} left @var{n} decimal digits, or right @i{-@var{n}}
+Shift integer @var{x} left @var{n} decimal digits, or right @mathit{-@var{n}}
 digits with truncation toward zero.
 @end defun
 
@@ -33493,7 +33481,7 @@
 @defun quarter-integer n
 If @var{n} is an integer or integer-valued float, this function
 returns zero.  If @var{n} is a half-integer (i.e., an integer plus
-@i{1:2} or 0.5), it returns 2.  If @var{n} is a quarter-integer,
+@mathit{1:2} or 0.5), it returns 2.  If @var{n} is a quarter-integer,
 it returns 1 or 3.  If @var{n} is anything else, this function
 returns @code{nil}.
 @end defun
@@ -35636,8 +35624,8 @@
 @c 20
 @item
 With a prefix argument of 1, take a single 
-@texline @tmath{@var{n}\times2}
-@infoline @i{@var{N}x2} 
+@texline @var{n}@math{\times2}
+@infoline @mathit{@var{N}x2} 
 matrix from the stack instead of two separate data vectors.
 
 @c 21
@@ -35839,7 +35827,7 @@
 The variable is replaced by the formula shown on the right.  The
 Inverse flag reverses the order of the operands, e.g., @kbd{I s - x}
 assigns 
-@texline @tmath{x \coloneq a-x}.
+@texline @math{x \coloneq a-x}.
 @infoline @expr{x := a-x}.
 
 @c 48
@@ -35847,7 +35835,7 @@
 Press @kbd{?} repeatedly to see how to choose a model.  Answer the
 variables prompt with @expr{iv} or @expr{iv;pv} to specify
 independent and parameter variables.  A positive prefix argument
-takes @i{@var{n}+1} vectors from the stack; a zero prefix takes a matrix
+takes @mathit{@var{n}+1} vectors from the stack; a zero prefix takes a matrix
 and a vector from the stack.
 
 @c 49
--- a/man/custom.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/custom.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -1,5 +1,5 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002
+@c Copyright (C) 1985,86,87,93,94,95,97,2000,2001,2002,2004
 @c  Free Software Foundation, Inc.
 @c See file emacs.texi for copying conditions.
 @node Customization, Quitting, Amusements, Top
@@ -487,23 +487,38 @@
   The customization buffer normally saves customizations in
 @file{~/.emacs}.  If you wish, you can save customizations in another
 file instead.  To make this work, your @file{~/.emacs} should set
-@code{custom-file} to the name of that file.  Emacs loads the file
-right after your @file{.emacs} if you did not load it already.  For
-example:
+@code{custom-file} to the name of that file.  If you are using Emacs
+version 21.4 or later, Emacs loads the file right after your
+@file{.emacs} if you did not load it already.  In earlier versions,
+you have to load the file in your @file{~/emacs}.  If you customize
+@code{custom-file} through the @samp{Customize} interface, you still
+need to load it in your @file{.emacs}, but there is no need to set
+it.  For example:
 
 @example
+;; @r{if not set through the @samp{Customize} interface:}
 (setq custom-file "~/.emacs-custom")
+
+;; @r{in Emacs versions before 21.4 or if set through}
+;; @r{the @samp{Customize} interface.}
+(load "~/.emacs-custom")
 @end example
 
-  The variable @code{custom-file} is useful if you want to have
-different customizations for different Emacs versions:
+  You can also use @code{custom-file} to specify different
+customization files for different Emacs versions, like this:
 
 @example
-(if (< emacs-major-version 21)
-    ;; @r{Emacs 20 customization.}
-    (setq custom-file "~/.custom-20.el")
-  ;; @r{Emacs 21 customization.}
-  (setq custom-file "~/.custom-21.el"))
+(cond ((< emacs-major-version 21)
+       ;; @r{Emacs 20 customization.}
+       (setq custom-file "~/.custom-20.el"))
+      ((and (= emacs-major-version 21) (< emacs-minor-version 4))
+       ;; @r{Emacs 21 customization, before version 21.4.}
+       (setq custom-file "~/.custom-21.el"))
+      (t
+       ;; @r{Emacs version 21.4 or later.}
+       (setq custom-file "~/.custom-21.4.el")))
+
+(load custom-file)
 @end example
 
   If Emacs was invoked with the @option{-q} or @option{--no-init-file}
--- a/man/dired.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/dired.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -89,7 +89,7 @@
 (move up and unflag) is often useful simply for moving up.
 
 @findex dired-goto-file
-@kindex M-g
+@kindex M-g @r{(Dired)}
   @kbd{M-g} (@code{dired-goto-file}) moves point to the line that
 describes a specified file or directory.
 
@@ -1113,7 +1113,7 @@
 @table @kbd
 @item w
 @cindex Adding to the kill ring in Dired.
-@kindex w
+@kindex w @r{(Dired)}
 @findex dired-copy-filename-as-kill
 The @kbd{w} command (@code{dired-copy-filename-as-kill}) puts the
 names of the marked (or next @var{n}) files into the kill ring, as if
--- a/man/gnus-faq.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/gnus-faq.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -1414,7 +1414,7 @@
  message. For a follow up to a newsgroup, it's
  @samp{f} and @samp{F}
  (analog to @samp{r} and
- @samp{R}.
+ @samp{R}).
  
 
  Enter new headers above the line saying "--text follows
--- a/man/gnus.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/gnus.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -22603,6 +22603,7 @@
 @dfn{Ham} is the name used throughout @file{spam.el} to indicate
 non-spam messages.
 
+@cindex spam-initialize
 First of all, you @strong{must} run the function
 @code{spam-initialize} to autoload @code{spam.el} and to install the
 @code{spam.el} hooks.  There is one exception: if you use the
--- a/man/makefile.w32-in	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/makefile.w32-in	Tue Dec 14 07:34:55 2004 +0000
@@ -47,14 +47,15 @@
 		$(infodir)/speedbar $(infodir)/tramp \
 		$(infodir)/ses $(infodir)/smtpmail \
 		$(infodir)/flymake $(infodir)/emacs-xtra \
+		$(infodir)/org $(infodir)/url \
 		$(infodir)/pgg $(infodir)/sieve
 DVI_TARGETS = 	emacs.dvi calc.dvi cc-mode.dvi cl.dvi dired-x.dvi \
 		 ediff.dvi forms.dvi gnus.dvi message.dvi mh-e.dvi \
 		 reftex.dvi sc.dvi vip.dvi viper.dvi widget.dvi faq.dvi \
 		 ada-mode.dvi autotype.dvi idlwave.dvi eudc.dvi ebrowse.dvi \
-		 pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \
+		 org.dvi pcl-cvs.dvi woman.dvi emacs-mime.dvi eshell.dvi \
 		 speedbar.dvi tramp.dvi ses.dvi smtpmail.dvi flymake.dvi \
-		 emacs-xtra.dvi pgg.dvi sieve.dvi
+		 emacs-xtra.dvi pgg.dvi sieve.dvi url.dvi
 INFOSOURCES = info.texi
 
 # The following rule does not work with all versions of `make'.
@@ -318,6 +319,18 @@
 emacs-xtra.dvi: emacs-xtra.texi
 	$(ENVADD) $(TEXI2DVI) $(srcdir)/emacs-xtra.texi
 
+$(infodir)/org: org.texi
+	$(MAKEINFO) org.texi
+
+org.dvi: org.texi
+	$(ENVADD) $(TEXI2DVI) $(srcdir)/org.texi
+
+$(infodir)/url: url.texi
+	$(MAKEINFO) url.texi
+
+url.dvi: url.texi
+	$(ENVADD) $(TEXI2DVI) $(srcdir)/url.texi
+
 mostlyclean:
 	- $(DEL) *.log *.cp *.fn *.ky *.pg *.vr core *.tp *.core gnustmp.*
 
@@ -337,6 +350,7 @@
 		 $(infodir)/woman* $(infodir)/eshell* \
 		 $(infodir)/speedbar* $(infodir)/tramp* \
 		 $(infodir)/ses* $(infodir)/smtpmail* \
+		 $(infodir)/url* $(infodir)/org* \
 		 $(infodir)/flymake*
 
 distclean: clean
--- a/man/mark.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/mark.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -320,6 +320,8 @@
 arguments just like @kbd{M-f} and @kbd{C-M-f}.  If you repeat these
 commands, the region is extended.  For example, you can type either
 @kbd{C-u 2 M-@@} or @kbd{M-@@ M-@@} to mark the next two words.
+The region is also extended when the mark is active in Transient Mark
+mode, regardless of the last command.
 
 @kindex C-x h
 @findex mark-whole-buffer
--- a/man/misc.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/misc.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -2219,7 +2219,7 @@
 @subsection Finding Files and URLs at Point
 @findex find-file-at-point
 @findex ffap
-@findex ffap-dired-at-point
+@findex dired-at-point
 @findex ffap-next
 @findex ffap-menu
 @cindex finding file at point
@@ -2248,18 +2248,36 @@
 @kindex C-x C-f @r{(FFAP)}
 Find @var{filename}, guessing a default from text around point
 (@code{find-file-at-point}).
+@item C-x C-r
+@kindex C-x C-r @r{(FFAP)}
+@code{ffap-read-only}, analogous to @code{find-file-read-only}.
+@item C-x C-v
+@kindex C-x C-v @r{(FFAP)}
+@code{ffap-alternate-file}, analogous to @code{find-alternate-file}.
+@item C-x d @var{directory} @key{RET}
+@kindex C-x d @r{(FFAP)}
+Start Dired on @var{directory}, defaulting to the directory name at
+point (@code{dired-at-point}).
+@item C-x C-d
+@code{ffap-list-directory}, analogous to @code{list-directory}.
 @item C-x 4 f
 @kindex C-x 4 f @r{(FFAP)}
 @code{ffap-other-window}, analogous to @code{find-file-other-window}.
+@item C-x 4 r
+@code{ffap-read-only-other-window}, analogous to
+@code{find-file-read-only-other-window}.
+@item C-x 4 d
+@code{ffap-dired-other-window}, analogous to @code{dired-other-window}.
 @item C-x 5 f
 @kindex C-x 5 f @r{(FFAP)}
 @code{ffap-other-frame}, analogous to @code{find-file-other-frame}.
+@item C-x 5 r
+@code{ffap-read-only-other-frame}, analogous to
+@code{find-file-read-only-other-frame}.
+@item C-x 5 d
+@code{ffap-dired-other-frame}, analogous to @code{dired-other-frame}.
 @item M-x ffap-next
 Search buffer for next file name or URL, then find that file or URL.
-@item C-x d @var{directory} @key{RET}
-@kindex C-x d @r{(FFAP)}
-Start Dired on @var{directory}, defaulting to the directory name at
-point (@code{ffap-dired-at-point}).
 @item S-Mouse-3
 @kindex S-Mouse-3 @r{(FFAP)}
 @code{ffap-at-mouse} finds the file guessed from text around the position
--- a/man/org.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/org.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -8,7 +8,7 @@
 
 @dircategory Emacs
 @direntry
-* Org Mode: (org.info).	Outline-based notes management and organizer 
+* Org Mode: (org).	Outline-based notes management and organizer 
 @end direntry
 
 @c Version and Contact Info
--- a/man/reftex.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/reftex.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -3371,12 +3371,12 @@
 @cindex @code{http}, @b{Ref@TeX{}} home page
 @cindex @code{ftp}, @b{Ref@TeX{}} site
 
-@b{Ref@TeX{}} was written by @i{@value{Carsten Dominik}}
+@b{Ref@TeX{}} was written by @i{Carsten Dominik}
 @email{dominik@@science.uva.nl}, with contributions by @i{Stephen
 Eglen}.  @b{Ref@TeX{}} is currently maintained by @refill
 
 @noindent
-@value{Carsten Dominik} @email{dominik@@science.uva.nl}
+Carsten Dominik @email{dominik@@science.uva.nl}
 
 If you have questions about @b{Ref@TeX{}}, there are several Usenet
 groups which have competent readers: @code{comp.emacs},
--- a/man/url.texi	Sat Dec 11 02:29:07 2004 +0000
+++ b/man/url.texi	Tue Dec 14 07:34:55 2004 +0000
@@ -1,5 +1,5 @@
 \input texinfo
-@setfilename url.info
+@setfilename ../info/url
 @settitle URL Programmer's Manual
 
 @iftex
@@ -114,10 +114,6 @@
 The meaning of
 the @var{path} component depends on the service.
 
-The library depends on MIME support provided by the @samp{mm-}
-packages from Gnus 5.8 or later.  @xref{(emacs-mime)Top, The MIME
-library}.
-
 @menu
 * Configuration::               
 * Parsed URLs::                 URLs are parsed into vector structures.
@@ -388,9 +384,9 @@
 
 HTTP URLs are retrieved into a buffer containing the HTTP headers
 followed by the body.  Since the headers are quasi-MIME, they may be
-processed using the MIME library.  @xref{(emacs-mime)Top, The MIME
-library}.  The MIME library doesn't provide a clean function to do
-that, so the URL library does.
+processed using the MIME library.  @inforef{Top, The MIME library,
+emacs-mime}.  The URL package provides a function to do this in
+general:
 
 @defun url-decode-text-part handle &optional coding
 This function decodes charset-encoded text in the current buffer.  In
--- a/src/ChangeLog	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/ChangeLog	Tue Dec 14 07:34:55 2004 +0000
@@ -1,10 +1,76 @@
+2004-12-13  Richard M. Stallman  <rms@gnu.org>
+
+	* eval.c (syms_of_eval) <quit-flag>: Doc fix.
+
+	* keyboard.c (Vthrow_on_input): New variable.
+	(syms_of_keyboard): Defvar and initialize it.
+	(kbd_buffer_store_event_hold): Handle Vthrow_on_input.
+
+	* lisp.h (QUIT): Check for Vthrow_on_input.
+	(Vthrow_on_input): Declare it.
+
+2004-12-13  Kim F. Storm  <storm@cua.dk>
+
+	* xdisp.c (set_iterator_to_next): Reset stop_charpos after display
+	vector.
+
+2004-12-12  Richard M. Stallman  <rms@gnu.org>
+
+	* indent.c (Fvertical_motion): Call move_it_by_lines even if LINES = 0.
+
+	* minibuf.c (Fall_completions): Add var `zero' and use it in loop.
+	(Ftry_completion): Really use outer `zero'; eliminate inner one.
+
+2004-12-12  Kenichi Handa  <handa@m17n.org>
+
+	* term.c (encode_terminal_code): Fix previous change.
+
+2004-12-11  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* keyboard.c (handle_async_input): Remove pthread mutex handling.
+	(input_available_signal): Move pthread thingy to !SYNC_INPUT branch.
+
+	* syntax.c (Fforward_word): Avoid non-idempotent side-effects
+	in macro arguments.
+
+	* minibuf.c (Ftry_completion, Fall_completions): Don't use
+	XFASTINT blindly.
+
+	* emacs.c (main, Fdump_emacs): Don't touch malloc hooks if SYNC_INPUT.
+
+2004-12-11  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
+
+	* w32term.c (x_calc_absolute_position): Remove calculation of
+	difference between inner and outer window.  Don't subtract difference
+	for left and top calculations.
+
+	* xterm.c (x_calc_absolute_position): Don't subtract outer_pixel_diff
+	for left and top calculations.  Remove call to x_real_positions.
+	[Bug report by Drew Adams in November]
+	(x_check_expected_move): Do not set change_gravity to 1 when calling
+	x_set_offset.
+
+2004-12-08  Richard M. Stallman  <rms@gnu.org>
+
+	* xdisp.c (get_next_display_element): Use `escape-glyph' for
+	control chars and escaped octal codes.
+	(Qescape_glyph): New variable.
+	(syms_of_xdisp): Initialize it.
+	(escape_glyph_face): New variable.
+	(redisplay_window): Initialize it.
+
+2004-12-07  Paul Eggert  <eggert@cs.ucla.edu>
+
+	* image.c (our_fill_input_buffer, jpeg_load, CHECK_LIB_AVAILABLE)
+	(init_image): Use 1 rather than TRUE.  TRUE's not always defined.
+
 2004-12-07  Jan Dj,Ad(Brv  <jan.h.d@swipnet.se>
 
 	* emacs.c (Fdump_emacs): Add ! defined (SYSTEM_MALLOC) around
 	reset_malloc_hooks.
 
-	* keyboard.c (handle_async_input, input_available_signal): Add
-	! defined (SYSTEM_MALLOC) around thread code.
+	* keyboard.c (handle_async_input, input_available_signal):
+	Add ! defined (SYSTEM_MALLOC) around thread code.
 
 	* alloc.c: Add comment about the reason for (UN)BLOCK_INPUT_ALLOC.
 
@@ -42,12 +108,11 @@
 	* emacs.c (Fdump_emacs): Call reset_malloc_hooks.
 
 	* keyboard.c: Conditionally include pthread.h
-	(handle_async_inpu, input_available_signalt): If not in the main
+	(handle_async_input, input_available_signalt): If not in the main
 	thread, block signal, send signal to main thread and return.
 
 	* gtkutil.c (xg_get_file_with_chooser): Handle local files only.
-	Set current folder in file chooser if default_filename is a
-	directory.
+	Set current folder in file chooser if default_filename is a directory.
 
 2004-12-05  Stefan Monnier  <monnier@iro.umontreal.ca>
 
--- a/src/emacs.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/emacs.c	Tue Dec 14 07:34:55 2004 +0000
@@ -1023,8 +1023,10 @@
      Also call realloc and free for consistency.  */
   free (realloc (malloc (4), 4));
 
+# ifndef SYNC_INPUT
   /* Arrange to disable interrupt input inside malloc etc.  */
   uninterrupt_malloc ();
+# endif /* not SYNC_INPUT */
 #endif	/* not SYSTEM_MALLOC */
 
 #if defined (MSDOS) || defined (WINDOWSNT)
@@ -2246,7 +2248,7 @@
   memory_warnings (my_edata, malloc_warning);
 #endif /* not WINDOWSNT */
 #endif
-#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
+#if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD) && !defined SYNC_INPUT
   /* Pthread may call malloc before main, and then we will get an endless
      loop, because pthread_self (see alloc.c) calls malloc the first time
      it is called on some systems.  */
--- a/src/eval.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/eval.c	Tue Dec 14 07:34:55 2004 +0000
@@ -3331,7 +3331,11 @@
 
   DEFVAR_LISP ("quit-flag", &Vquit_flag,
 	       doc: /* Non-nil causes `eval' to abort, unless `inhibit-quit' is non-nil.
-Typing C-g sets `quit-flag' non-nil, regardless of `inhibit-quit'.  */);
+If the value is t, that means do an ordinary quit.
+If the value equals `throw-on-input', that means quit by throwing
+to the tag specified in `throw-on-input'; it's for handling `while-no-input'.
+Typing C-g sets `quit-flag' to t, regardless of `inhibit-quit',
+but `inhibit-quit' non-nil prevents anything from taking notice of that.  */);
   Vquit_flag = Qnil;
 
   DEFVAR_LISP ("inhibit-quit", &Vinhibit_quit,
--- a/src/image.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/image.c	Tue Dec 14 07:34:55 2004 +0000
@@ -6378,7 +6378,7 @@
 
   src->next_input_byte = buffer;
   src->bytes_in_buffer = 2;
-  return TRUE;
+  return 1;
 }
 
 
@@ -6533,11 +6533,11 @@
     jpeg_memory_src (&cinfo, SDATA (specified_data),
 		     SBYTES (specified_data));
 
-  fn_jpeg_read_header (&cinfo, TRUE);
+  fn_jpeg_read_header (&cinfo, 1);
 
   /* Customize decompression so that color quantization will be used.
 	 Start decompression.  */
-  cinfo.quantize_colors = TRUE;
+  cinfo.quantize_colors = 1;
   fn_jpeg_start_decompress (&cinfo);
   width = img->width = cinfo.output_width;
   height = img->height = cinfo.output_height;
@@ -7552,7 +7552,7 @@
   bg_color.blue = color.blue;
   RGBBackColor (&bg_color);
   SetGWorld (old_port, old_gdh);
-  SetMovieActive (movie, TRUE);
+  SetMovieActive (movie, 1);
   SetMovieGWorld (movie, ximg, NULL);
   SampleNumToMediaTime (media, ino + 1, &time, NULL);
   SetMovieTimeValue (movie, time);
@@ -7930,7 +7930,7 @@
   define_image_type (image_type, init_lib_fn (libraries))
 #else
 #define CHECK_LIB_AVAILABLE(image_type, init_lib_fn, libraries) \
-  define_image_type (image_type, TRUE)
+  define_image_type (image_type, 1)
 #endif /* HAVE_NTGUI */
 
 DEFUN ("init-image-library", Finit_image_library, Sinit_image_library, 2, 2, 0,
@@ -8114,8 +8114,8 @@
 {
   image_types = NULL;
 
-  define_image_type (&xbm_type, TRUE);
-  define_image_type (&pbm_type, TRUE);
+  define_image_type (&xbm_type, 1);
+  define_image_type (&pbm_type, 1);
 
 #ifdef MAC_OS
   /* Animated gifs use QuickTime Movie Toolbox.  So initialize it here. */
--- a/src/indent.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/indent.c	Tue Dec 14 07:34:55 2004 +0000
@@ -2092,8 +2092,9 @@
 	move_it_by_lines (&it, -1, 0);
 
       it.vpos = 0;
-      if (XINT (lines) != 0)
-	move_it_by_lines (&it, XINT (lines), 0);
+      /* Do this even if LINES is 0, so that we move back
+	 to the beginning of the current line as we ought.  */
+      move_it_by_lines (&it, XINT (lines), 0);
 
       SET_PT_BOTH (IT_CHARPOS (it), IT_BYTEPOS (it));
     }
--- a/src/keyboard.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/keyboard.c	Tue Dec 14 07:34:55 2004 +0000
@@ -6779,24 +6779,6 @@
 #ifdef BSD4_1
   extern int select_alarmed;
 #endif
-#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
-  extern pthread_t main_thread;
-  if (pthread_self () != main_thread)
-    {
-      /* POSIX says any thread can receive the signal.  On GNU/Linux that is
-         not true, but for other systems (FreeBSD at least) it is.  So direct
-         the signal to the correct thread and block it from this thread.  */
-#ifdef SIGIO
-      sigset_t new_mask;
-
-      sigemptyset (&new_mask);
-      sigaddset (&new_mask, SIGIO);
-      pthread_sigmask (SIG_BLOCK, &new_mask, 0);
-      pthread_kill (main_thread, SIGIO);
-#endif
-      return;
-    }
-#endif
 
   interrupt_input_pending = 0;
 
@@ -6825,22 +6807,6 @@
 {
   /* Must preserve main program's value of errno.  */
   int old_errno = errno;
-#if ! defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
-  extern pthread_t main_thread;
-  if (pthread_self () != main_thread)
-    {
-      /* POSIX says any thread can receive the signal.  On GNU/Linux that is
-         not true, but for other systems (FreeBSD at least) it is.  So direct
-         the signal to the correct thread and block it from this thread.  */
-      sigset_t new_mask;
-
-      sigemptyset (&new_mask);
-      sigaddset (&new_mask, SIGIO);
-      pthread_sigmask (SIG_BLOCK, &new_mask, 0);
-      pthread_kill (main_thread, SIGIO);
-      return;
-    }
-#endif /* HAVE_GTK_AND_PTHREAD */
 #if defined (USG) && !defined (POSIX_SIGNALS)
   /* USG systems forget handlers when they are used;
      must reestablish each time */
@@ -6857,6 +6823,24 @@
 #ifdef SYNC_INPUT
   interrupt_input_pending = 1;
 #else
+
+# if !defined (SYSTEM_MALLOC) && defined (HAVE_GTK_AND_PTHREAD)
+  extern pthread_t main_thread;
+  if (pthread_self () != main_thread)
+    {
+      /* POSIX says any thread can receive the signal.  On GNU/Linux that is
+         not true, but for other systems (FreeBSD at least) it is.  So direct
+         the signal to the correct thread and block it from this thread.  */
+      sigset_t new_mask;
+
+      sigemptyset (&new_mask);
+      sigaddset (&new_mask, SIGIO);
+      pthread_sigmask (SIG_BLOCK, &new_mask, 0);
+      pthread_kill (main_thread, SIGIO);
+      return;
+    }
+# endif /* HAVE_GTK_AND_PTHREAD */
+
   handle_async_input ();
 #endif
 
--- a/src/lisp.h	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/lisp.h	Tue Dec 14 07:34:55 2004 +0000
@@ -1786,11 +1786,15 @@
 #ifdef SYNC_INPUT
 extern void handle_async_input P_ ((void));
 extern int interrupt_input_pending;
+
 #define QUIT						\
   do {							\
     if (!NILP (Vquit_flag) && NILP (Vinhibit_quit))	\
       {							\
+        Lisp_Object flag = Vquit_flag;			\
 	Vquit_flag = Qnil;				\
+	if (EQ (Vthrow_on_input, flag))			\
+	  Fthrow (Vthrow_on_input, Qnil);		\
 	Fsignal (Qquit, Qnil);				\
       }							\
     else if (interrupt_input_pending)			\
@@ -1803,7 +1807,10 @@
   do {							\
     if (!NILP (Vquit_flag) && NILP (Vinhibit_quit))	\
       {							\
+        Lisp_Object flag = Vquit_flag;			\
 	Vquit_flag = Qnil;				\
+	if (EQ (Vthrow_on_input, flag))			\
+	  Fthrow (Vthrow_on_input, Qnil);		\
 	Fsignal (Qquit, Qnil);				\
       }							\
   } while (0)
@@ -2917,6 +2924,7 @@
 extern void cancel_echoing P_ ((void));
 extern Lisp_Object Qdisabled, QCfilter;
 extern Lisp_Object Vtty_erase_char, Vhelp_form, Vtop_level;
+extern Lisp_Object Vthrow_on_input;
 extern int input_pending;
 EXFUN (Fdiscard_input, 0);
 EXFUN (Frecursive_edit, 0);
--- a/src/minibuf.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/minibuf.c	Tue Dec 14 07:34:55 2004 +0000
@@ -1227,6 +1227,7 @@
     return call3 (alist, string, predicate, Qnil);
 
   bestmatch = bucket = Qnil;
+  zero = make_number (0);
 
   /* If ALIST is not a list, set TAIL just for gc pro.  */
   tail = alist;
@@ -1253,7 +1254,7 @@
 	}
       else if (type == 2)
 	{
-	  if (XFASTINT (bucket) != 0)
+	  if (!EQ (bucket, zero))
 	    {
 	      elt = bucket;
 	      eltstring = Fsymbol_name (elt);
@@ -1285,16 +1286,14 @@
 
       if (STRINGP (eltstring)
 	  && SCHARS (string) <= SCHARS (eltstring)
-	  && (tem = Fcompare_strings (eltstring, make_number (0),
+	  && (tem = Fcompare_strings (eltstring, zero,
 				      make_number (SCHARS (string)),
-				      string, make_number (0), Qnil,
+				      string, zero, Qnil,
 				      completion_ignore_case ? Qt : Qnil),
 	      EQ (Qt, tem)))
 	{
 	  /* Yes. */
 	  Lisp_Object regexps;
-	  Lisp_Object zero;
-	  XSETFASTINT (zero, 0);
 
 	  /* Ignore this element if it fails to match all the regexps.  */
 	  {
@@ -1348,9 +1347,9 @@
 	  else
 	    {
 	      compare = min (bestmatchsize, SCHARS (eltstring));
-	      tem = Fcompare_strings (bestmatch, make_number (0),
+	      tem = Fcompare_strings (bestmatch, zero,
 				      make_number (compare),
-				      eltstring, make_number (0),
+				      eltstring, zero,
 				      make_number (compare),
 				      completion_ignore_case ? Qt : Qnil);
 	      if (EQ (tem, Qt))
@@ -1381,15 +1380,15 @@
 		      ((matchsize == SCHARS (eltstring))
 		       ==
 		       (matchsize == SCHARS (bestmatch))
-		       && (tem = Fcompare_strings (eltstring, make_number (0),
+		       && (tem = Fcompare_strings (eltstring, zero,
 						   make_number (SCHARS (string)),
-						   string, make_number (0),
+						   string, zero,
 						   Qnil,
 						   Qnil),
 			   EQ (Qt, tem))
-		       && (tem = Fcompare_strings (bestmatch, make_number (0),
+		       && (tem = Fcompare_strings (bestmatch, zero,
 						   make_number (SCHARS (string)),
-						   string, make_number (0),
+						   string, zero,
 						   Qnil,
 						   Qnil),
 			   ! EQ (Qt, tem))))
@@ -1476,13 +1475,14 @@
 			   || NILP (XCAR (alist))));
   int index = 0, obsize = 0;
   int bindcount = -1;
-  Lisp_Object bucket, tem;
+  Lisp_Object bucket, tem, zero;
   struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
 
   CHECK_STRING (string);
   if (type == 0)
     return call3 (alist, string, predicate, Qt);
   allmatches = bucket = Qnil;
+  zero = make_number (0);
 
   /* If ALIST is not a list, set TAIL just for gc pro.  */
   tail = alist;
@@ -1509,7 +1509,7 @@
 	}
       else if (type == 2)
 	{
-	  if (XFASTINT (bucket) != 0)
+	  if (!EQ (bucket, zero))
 	    {
 	      elt = bucket;
 	      eltstring = Fsymbol_name (elt);
@@ -1547,9 +1547,9 @@
 	       && SREF (string, 0) == ' ')
 	      || SREF (eltstring, 0) != ' '
 	      || NILP (hide_spaces))
-	  && (tem = Fcompare_strings (eltstring, make_number (0),
+	  && (tem = Fcompare_strings (eltstring, zero,
 				      make_number (SCHARS (string)),
-				      string, make_number (0),
+				      string, zero,
 				      make_number (SCHARS (string)),
 				      completion_ignore_case ? Qt : Qnil),
 	      EQ (Qt, tem)))
--- a/src/syntax.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/syntax.c	Tue Dec 14 07:34:55 2004 +0000
@@ -1320,6 +1320,7 @@
      (arg)
      Lisp_Object arg;
 {
+  Lisp_Object tmp;
   int orig_val, val;
 
   if (NILP (arg))
@@ -1332,8 +1333,9 @@
     val = XINT (arg) > 0 ? ZV : BEGV;
 
   /* Avoid jumping out of an input field.  */
-  val = XFASTINT (Fconstrain_to_field (make_number (val), make_number (PT),
-				       Qt, Qnil, Qnil));
+  tmp = Fconstrain_to_field (make_number (val), make_number (PT),
+			     Qt, Qnil, Qnil);
+  val = XFASTINT (tmp);
 
   SET_PT (val);
   return val == orig_val ? Qt : Qnil;
--- a/src/w32term.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/w32term.c	Tue Dec 14 07:34:55 2004 +0000
@@ -5542,47 +5542,17 @@
 x_calc_absolute_position (f)
      struct frame *f;
 {
-  POINT pt;
   int flags = f->size_hint_flags;
 
-  pt.x = pt.y = 0;
-
-  /* Find the position of the outside upper-left corner of
-     the inner window, with respect to the outer window.
-     But do this only if we will need the results.  */
-  if (f->output_data.w32->parent_desc != FRAME_W32_DISPLAY_INFO (f)->root_window)
-    {
-      BLOCK_INPUT;
-      MapWindowPoints (FRAME_W32_WINDOW (f),
-		       f->output_data.w32->parent_desc,
-		       &pt, 1);
-      UNBLOCK_INPUT;
-    }
-
-  {
-      RECT rt;
-      rt.left = rt.right = rt.top = rt.bottom = 0;
-
-      BLOCK_INPUT;
-      AdjustWindowRect(&rt, f->output_data.w32->dwStyle,
-		       FRAME_EXTERNAL_MENU_BAR (f));
-      UNBLOCK_INPUT;
-
-      pt.x += (rt.right - rt.left);
-      pt.y += (rt.bottom - rt.top);
-  }
-
   /* Treat negative positions as relative to the leftmost bottommost
      position that fits on the screen.  */
   if (flags & XNegative)
     f->left_pos = (FRAME_W32_DISPLAY_INFO (f)->width
-		   - 2 * f->border_width - pt.x
 		   - FRAME_PIXEL_WIDTH (f)
 		   + f->left_pos);
 
   if (flags & YNegative)
     f->top_pos = (FRAME_W32_DISPLAY_INFO (f)->height
-		  - 2 * f->border_width - pt.y
 		  - FRAME_PIXEL_HEIGHT (f)
 		  + f->top_pos);
   /* The left_pos and top_pos
--- a/src/xdisp.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/xdisp.c	Tue Dec 14 07:34:55 2004 +0000
@@ -343,6 +343,11 @@
 
 Lisp_Object Qtrailing_whitespace;
 
+/* Name and number of the face used to highlight escape glyphs.  */
+
+Lisp_Object Qescape_glyph;
+int escape_glyph_face;
+
 /* The symbol `image' which is the car of the lists used to represent
    images in Lisp.  */
 
@@ -5014,6 +5019,21 @@
 		 display.  Then, set IT->dpvec to these glyphs.  */
 	      GLYPH g;
 	      int ctl_len;
+	      int face_id = escape_glyph_face;
+
+	      /* Find the face id if `escape-glyph' unless we recently did.  */
+	      if (face_id < 0)
+		{
+		  Lisp_Object tem = Fget (Qescape_glyph, Qface);
+		  if (INTEGERP (tem))
+		    face_id = XINT (tem);
+		  else
+		    face_id = 0;
+		  /* If there's overflow, use 0 instead.  */
+		  if (FAST_GLYPH_FACE (FAST_MAKE_GLYPH (0, face_id)) != face_id)
+		    face_id = 0;
+		  escape_glyph_face = face_id;
+		}
 
 	      if (it->c < 128 && it->ctl_arrow_p)
 		{
@@ -5023,10 +5043,10 @@
 		      && GLYPH_CHAR_VALID_P (XINT (DISP_CTRL_GLYPH (it->dp))))
 		    g = XINT (DISP_CTRL_GLYPH (it->dp));
 		  else
-		    g = FAST_MAKE_GLYPH ('^', 0);
+		    g = FAST_MAKE_GLYPH ('^', face_id);
 		  XSETINT (it->ctl_chars[0], g);
 
-		  g = FAST_MAKE_GLYPH (it->c ^ 0100, 0);
+		  g = FAST_MAKE_GLYPH (it->c ^ 0100, face_id);
 		  XSETINT (it->ctl_chars[1], g);
 		  ctl_len = 2;
 		}
@@ -5043,7 +5063,7 @@
 		      && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp))))
 		    escape_glyph = XFASTINT (DISP_ESCAPE_GLYPH (it->dp));
 		  else
-		    escape_glyph = FAST_MAKE_GLYPH ('\\', 0);
+		    escape_glyph = FAST_MAKE_GLYPH ('\\', face_id);
 
 		  if (CHAR_BYTE8_P (it->c))
 		    {
@@ -5074,11 +5094,14 @@
 		      XSETINT (it->ctl_chars[i * 4], escape_glyph);
 		      /* Insert three more glyphs into IT->ctl_chars for
 			 the octal display of the character.  */
-		      g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0', 0);
+		      g = FAST_MAKE_GLYPH (((str[i] >> 6) & 7) + '0',
+					   face_id);
 		      XSETINT (it->ctl_chars[i * 4 + 1], g);
-		      g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0', 0);
+		      g = FAST_MAKE_GLYPH (((str[i] >> 3) & 7) + '0',
+					   face_id);
 		      XSETINT (it->ctl_chars[i * 4 + 2], g);
-		      g = FAST_MAKE_GLYPH ((str[i] & 7) + '0', 0);
+		      g = FAST_MAKE_GLYPH ((str[i] & 7) + '0',
+					   face_id);
 		      XSETINT (it->ctl_chars[i * 4 + 3], g);
 		    }
 		  ctl_len = len * 4;
@@ -5217,6 +5240,9 @@
 	  it->dpvec = NULL;
 	  it->current.dpvec_index = -1;
 
+	  /* Recheck faces after display vector */
+	  it->stop_charpos = 0;
+
 	  /* Skip over characters which were displayed via IT->dpvec.  */
 	  if (it->dpvec_char_len < 0)
 	    reseat_at_next_visible_line_start (it, 1);
@@ -11679,6 +11705,9 @@
   *w->desired_matrix->method = 0;
 #endif
 
+  /* Force this to be looked up again for each redisp of each window.  */
+  escape_glyph_face = -1;
+
   specbind (Qinhibit_point_motion_hooks, Qt);
 
   reconsider_clip_changes (w, buffer);
@@ -22292,6 +22321,8 @@
   staticpro (&Qfontification_functions);
   Qtrailing_whitespace = intern ("trailing-whitespace");
   staticpro (&Qtrailing_whitespace);
+  Qescape_glyph = intern ("escape-glyph");
+  staticpro (&Qescape_glyph);
   Qimage = intern ("image");
   staticpro (&Qimage);
   QCmap = intern (":map");
--- a/src/xterm.c	Sat Dec 11 02:29:07 2004 +0000
+++ b/src/xterm.c	Tue Dec 14 07:34:55 2004 +0000
@@ -8171,20 +8171,11 @@
   if (! ((flags & XNegative) || (flags & YNegative)))
     return;
 
-  /* Find the offsets of the outside upper-left corner of
-     the inner window, with respect to the outer window.
-     But do this only if we will need the results.  */
-  if (f->output_data.x->parent_desc != FRAME_X_DISPLAY_INFO (f)->root_window)
-    /* This is to get *_pixels_outer_diff.  */
-    x_real_positions (f, &win_x, &win_y);
-
   /* Treat negative positions as relative to the leftmost bottommost
      position that fits on the screen.  */
   if (flags & XNegative)
     f->left_pos = (FRAME_X_DISPLAY_INFO (f)->width
-                   - 2 * FRAME_X_OUTPUT (f)->x_pixels_outer_diff
-		   - FRAME_PIXEL_WIDTH (f)
-		   + f->left_pos);
+                   - FRAME_PIXEL_WIDTH (f) + f->left_pos);
 
   {
     int height = FRAME_PIXEL_HEIGHT (f);
@@ -8206,15 +8197,7 @@
 #endif
 
   if (flags & YNegative)
-    f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height
-                  - FRAME_X_OUTPUT (f)->y_pixels_outer_diff
-
-                  /* Assume the window manager decorations are the same size on
-                     three sides, i.e. left, right and bottom.  This is to
-                     compensate for the bottom part.  */
-                  - FRAME_X_OUTPUT (f)->x_pixels_outer_diff
-		  - height
-		  + f->top_pos);
+    f->top_pos = (FRAME_X_DISPLAY_INFO (f)->height - height + f->top_pos);
   }
 
   /* The left_pos and top_pos
@@ -8330,7 +8313,9 @@
         FRAME_X_OUTPUT (f)->move_offset_left = expect_left - f->left_pos;
         FRAME_X_OUTPUT (f)->move_offset_top = expect_top - f->top_pos;
 
-        x_set_offset (f, expect_left, expect_top, 1);
+        f->left_pos = expect_left;
+        f->top_pos = expect_top;
+        x_set_offset (f, expect_left, expect_top, 0);
       }
     else if (FRAME_X_DISPLAY_INFO (f)->wm_type == X_WMTYPE_UNKNOWN)
       FRAME_X_DISPLAY_INFO (f)->wm_type = X_WMTYPE_B;