# HG changeset patch # User Karoly Lorentey # Date 1103820231 0 # Node ID 4ee39d9428b0c29e72075bd0e5e5e8ea9851fa0c # Parent 6b379caca6fada88face57a0f2b48cf768506679# Parent 95abfb4108336c24f1edaefecd014601f490ad21 Merged in changes from CVS trunk. Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-726 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-727 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-728 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-729 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-730 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-731 Update from CVS * 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/emacs--cvs-trunk--0--patch-735 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-736 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-737 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-738 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-739 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-740 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-741 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-742 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-743 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-744 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-745 Update from CVS * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-746 Update from CVS * 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 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-77 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-277 diff -r 6b379caca6fa -r 4ee39d9428b0 ChangeLog --- a/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,3 +1,7 @@ +2004-12-11 Kim F. Storm + + * Makefile.in (info): Undo 2004-12-05 change. + 2004-12-08 Luc Teirlinck * info/dir (File): Add URL and Org Mode manuals. diff -r 6b379caca6fa -r 4ee39d9428b0 Makefile.in --- a/Makefile.in Fri Dec 10 15:24:54 2004 +0000 +++ b/Makefile.in Thu Dec 23 16:43:51 2004 +0000 @@ -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) diff -r 6b379caca6fa -r 4ee39d9428b0 admin/FOR-RELEASE --- a/admin/FOR-RELEASE Fri Dec 10 15:24:54 2004 +0000 +++ b/admin/FOR-RELEASE Thu Dec 23 16:43:51 2004 +0000 @@ -57,7 +57,7 @@ Connected to ftp.nluug.nl. Ange-ftp chokes on the `No route to host' message and doesn't look any -further. +further. I think in the near future we will see more of this problem, so it might be time to make anfe-ftp more intelligent. @@ -112,6 +112,28 @@ * REDISPLAY RELATED BUGS +** Strange text scrolling with Emacs + GTK + +> I could reproduce the problem with the latest CVS. +> +> % emacs -Q +> M-x info RET +> M-> +> C-l +> C-x ( C-u - 1 C-v C-x ) +> C-x e e e e ... +> +> I see the problem around "CC mode" and "Forms". + +It is not specific for the first line of a buffer. + +Rather it happens for lines which are indented but the +indentation is controlled by a display property and +the newline is part of that display property -- in +that case, the indentation is not recognized for the +first display line. + + ** Avoid unbreakable loops in redisplay. Redisplay may loop if there is an error in some display property, e.g. diff -r 6b379caca6fa -r 4ee39d9428b0 configure --- a/configure Fri Dec 10 15:24:54 2004 +0000 +++ b/configure Thu Dec 23 16:43:51 2004 +0000 @@ -984,7 +984,7 @@ else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi - cd $ac_popdir + cd "$ac_popdir" done fi @@ -3250,8 +3250,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3309,8 +3308,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3426,8 +3424,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3481,8 +3478,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3527,8 +3523,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -3572,8 +3567,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4206,8 +4200,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4483,8 +4476,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4513,8 +4505,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4584,8 +4575,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4637,8 +4627,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4709,8 +4698,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4762,8 +4750,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -4833,8 +4820,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5004,8 +4990,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5074,8 +5059,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5229,8 +5213,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5323,8 +5306,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5466,8 +5448,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5586,8 +5567,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5752,8 +5732,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5816,8 +5795,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5890,8 +5868,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -5977,8 +5954,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6051,8 +6027,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6122,8 +6097,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6182,8 +6156,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6252,8 +6225,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6314,8 +6286,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6381,8 +6352,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6528,8 +6498,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6593,8 +6562,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6659,8 +6627,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6706,8 +6673,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6781,8 +6747,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6847,8 +6812,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6892,8 +6856,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -6964,8 +6927,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7015,8 +6977,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7087,8 +7048,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7138,8 +7098,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7210,8 +7169,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7261,8 +7219,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7333,8 +7290,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7384,8 +7340,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7456,8 +7411,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7507,8 +7461,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7595,8 +7548,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7702,8 +7654,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7763,8 +7714,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7888,6 +7838,7 @@ echo "$as_me:$LINENO: checking for X" >&5 echo $ECHO_N "checking for X... $ECHO_C" >&6 +ac_path_x_has_been_run=yes # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -7980,7 +7931,7 @@ /usr/openwin/share/include' if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. + # Guess where to find include files, by looking for a specified header file. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -8054,8 +8005,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8115,8 +8065,12 @@ # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes \ ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 -echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 + # It might be that x_includes is empty (headers are found in the + # standard search path. Then output the corresponding message + ac_out_x_includes=$x_includes + test "x$x_includes" = x && ac_out_x_includes="in standard search path" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $ac_out_x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $ac_out_x_includes" >&6 fi if test "$no_x" = yes; then @@ -8280,8 +8234,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8376,8 +8329,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8436,8 +8388,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8521,8 +8472,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8706,8 +8656,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -8959,8 +8908,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9027,8 +8975,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9097,8 +9044,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9183,8 +9129,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9261,8 +9206,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9316,8 +9260,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9386,8 +9329,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9491,8 +9433,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9559,8 +9500,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9630,8 +9570,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -9871,8 +9810,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10394,8 +10332,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10467,8 +10404,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10550,8 +10486,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10630,8 +10565,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10705,8 +10639,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10774,8 +10707,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10844,8 +10776,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -10969,8 +10900,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11066,8 +10996,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11147,8 +11076,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11216,8 +11144,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11362,8 +11289,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11472,8 +11398,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11618,8 +11543,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11726,8 +11650,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11881,8 +11804,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -11957,8 +11879,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12106,8 +12027,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12184,8 +12104,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12332,8 +12251,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12409,8 +12327,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12553,8 +12470,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12722,8 +12638,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12868,8 +12783,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -12945,8 +12859,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13009,8 +12922,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13091,8 +13003,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13233,8 +13144,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13379,8 +13289,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13456,8 +13365,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13530,8 +13438,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13686,8 +13593,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -13753,8 +13659,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -14013,8 +13918,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -14081,8 +13985,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -14234,8 +14137,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -14419,8 +14321,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -14747,8 +14648,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -14849,8 +14749,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -14923,8 +14822,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15003,8 +14901,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15073,8 +14970,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15142,8 +15038,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15217,8 +15112,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15322,8 +15216,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15398,8 +15291,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15551,8 +15443,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15620,8 +15511,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15798,8 +15688,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -15875,8 +15764,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16030,8 +15918,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16182,8 +16069,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16334,8 +16220,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16477,8 +16362,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16522,8 +16406,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16669,8 +16552,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16714,8 +16596,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16780,8 +16661,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16844,8 +16724,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -16947,8 +16826,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17017,8 +16895,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17125,8 +17002,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17229,8 +17105,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17306,8 +17181,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17411,8 +17285,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17504,8 +17377,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17570,8 +17442,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17637,8 +17508,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17748,8 +17618,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17814,8 +17683,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17895,8 +17763,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -17969,8 +17836,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18043,8 +17909,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18117,8 +17982,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18192,8 +18056,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18265,8 +18128,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18341,8 +18203,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18414,8 +18275,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18488,8 +18348,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18639,8 +18498,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18786,8 +18644,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -18933,8 +18790,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -19091,8 +18947,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -19238,8 +19093,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -19385,8 +19239,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -19544,8 +19397,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -19703,8 +19555,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -19893,8 +19744,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -19967,8 +19817,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20036,8 +19885,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20083,8 +19931,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20158,8 +20005,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20223,8 +20069,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20362,8 +20207,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20424,8 +20268,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20570,8 +20413,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20727,8 +20569,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20899,8 +20740,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -20968,8 +20808,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -21154,8 +20993,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -21448,8 +21286,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -21514,8 +21351,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -21578,8 +21414,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -21645,8 +21480,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -21687,8 +21521,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -21755,8 +21588,7 @@ cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -22885,11 +22717,6 @@ *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ @@ -22928,6 +22755,12 @@ fi;; esac done` || { (exit 1); exit 1; } + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub diff -r 6b379caca6fa -r 4ee39d9428b0 etc/ChangeLog --- a/etc/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/etc/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,3 +1,16 @@ +2004-12-21 Richard M. Stallman + + * DISTRIB: Don't say "freeware". + +2004-12-15 Nick Roberts + + * DEBUG: Change printing example to break on a procedure name. + +2004-12-11 Dan Nicolaescu + + * e/eterm.ti: Add rs1. + * e/eterm: Regenerate. + 2004-12-08 Alexandre VEYRENC (tiny change) * fr-refcard.tex: Fix typos. diff -r 6b379caca6fa -r 4ee39d9428b0 etc/DEBUG --- a/etc/DEBUG Fri Dec 10 15:24:54 2004 +0000 +++ b/etc/DEBUG Thu Dec 23 16:43:51 2004 +0000 @@ -107,36 +107,32 @@ Even with a live process, these x... commands are useful for examining the fields in a buffer, window, process, frame or marker. Here's an example using concepts explained in the node "Value History" -of the GDB manual to print the variable frame from this line in -xmenu.c: - - buf.frame_or_window = frame; - -First, use these commands: +of the GDB manual to print values associated with the variable +called frame. First, use these commands: cd src gdb emacs - b xmenu.c:1296 + b set_frame_buffer_list r -q -Then type C-x 5 2 to create a new frame, and it hits the breakpoint: +Then when Emacs it hits the breakpoint: (gdb) p frame - $1 = 1077872640 + $1 = 139854428 (gdb) xtype Lisp_Vectorlike PVEC_FRAME (gdb) xframe - $2 = (struct frame *) 0x3f0800 + $2 = (struct frame *) 0x8560258 (gdb) p *$ $3 = { - size = 536871989, - next = 0x366240, - name = 809661752, + size = 1073742931, + next = 0x85dfe58, + name = 140615219, [...] } (gdb) p $3->name - $4 = 809661752 + $4 = 140615219 Now we can use `pr' to print the name of the frame: diff -r 6b379caca6fa -r 4ee39d9428b0 etc/DISTRIB --- a/etc/DISTRIB Fri Dec 10 15:24:54 2004 +0000 +++ b/etc/DISTRIB Thu Dec 23 16:43:51 2004 +0000 @@ -83,7 +83,7 @@ If you like GNU Emacs, please express your satisfaction with a donation: send me or the Foundation what you feel Emacs has been worth to you. If you are glad that I developed GNU Emacs and distribute it -as freeware, rather than following the obstructive and antisocial +as free software, rather than following the obstructive and antisocial practices typical of software developers, reward me. If you would like the Foundation to develop more free software, contribute. diff -r 6b379caca6fa -r 4ee39d9428b0 etc/NEWS --- a/etc/NEWS Fri Dec 10 15:24:54 2004 +0000 +++ b/etc/NEWS Thu Dec 23 16:43:51 2004 +0000 @@ -98,28 +98,46 @@ * Changes in Emacs 21.4 +** You can now follow links by clicking Mouse-1 on the link. + +Traditionally, Emacs uses a Mouse-1 click to set point and a Mouse-2 +click to follow a link, whereas most other applications use a Mouse-1 +click for both purposes, depending on whether you click outside or +inside a link. With release 21.4, the behaviour of a Mouse-1 click +has been changed to match this context-sentitive dual behaviour. + +Depending on the current mode, a Mouse-2 click in Emacs may do much +more than just follow a link, so the new Mouse-1 behaviour is only +activated for modes which explicitly mark a clickable text as a "link" +(see the new function `mouse-on-link-p' for details). The lisp +packages that are included in release 21.4 have been adapted to do +this, but external packages may not yet support this. However, there +is no risk in using such packages, as the worst thing that could +happen is that you get the original Mouse-1 behaviour when you click +on a link, which typically means that you set point where you click. + +If you want to get the original Mouse-1 action also inside a link, you +just need to press the Mouse-1 button a little longer than a normal +click (i.e. press and hold the Mouse-1 button for half a second before +you release it). + +Dragging the Mouse-1 inside a link still performs the original +drag-mouse-1 action, typically copy the text. + +You can customize the new Mouse-1 behaviour via the new user option +`mouse-1-click-follows-link'. + ++++ +** When the undo information of the current command gets really large +(beyond the value of `undo-outer-limit'), Emacs asks you whether to +discard it or keep it. + ** line-move-ignore-invisible now defaults to t. ** In Outline mode, hide-body no longer hides lines at the top of the file that precede the first header line. +++ -** `set-auto-mode' now gives the interpreter magic line (if present) -precedence over the file name. Likewise an + + * etags.c (main): Fix typo in conversion of LONG_OPTIONS from + preprocessing to compile time constant. + 2004-11-17 Kim F. Storm * etags.c: Undo last change. diff -r 6b379caca6fa -r 4ee39d9428b0 lib-src/etags.c --- a/lib-src/etags.c Fri Dec 10 15:24:54 2004 +0000 +++ b/lib-src/etags.c Thu Dec 23 16:43:51 2004 +0000 @@ -1,5 +1,5 @@ /* Tags file maker to go with GNU Emacs -*- coding: latin-1 -*- - Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2001, 2002 + Copyright (C) 1984, 1987-1989, 1993-1995, 1998-2001, 2002, 2004 Free Software Foundation, Inc. and Ken Arnold This file is not considered part of GNU Emacs. @@ -1183,7 +1183,7 @@ #ifdef ETAGS_REGEXPS optstring = "-r:Rc:"; #endif /* ETAGS_REGEXPS */ - if (LONG_OPTIONS) + if (!LONG_OPTIONS) optstring += 1; optstring = concat (optstring, "Cf:Il:o:SVhH", diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/ChangeLog --- a/lisp/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,8 +1,441 @@ +2004-12-22 Kenichi Handa + + * international/quail.el (quail-start-translation): Fix prompt + string for the case if input-method-use-echo-area being non-nil. + (quail-start-conversion): Likewise. + (quail-show-guidance): Don't show guidance if + input-method-use-echo-area is non-nil. + +2004-12-21 Richard M. Stallman + + * textmodes/ispell.el (ispell-help): Bind resize-mini-windows. + +2004-12-21 Markus Rost + + * calendar/diary-lib.el (mark-diary-entries): Set + mark-diary-entries-in-calendar only after checking for diary-file. + +2004-12-21 Richard M. Stallman + + * faces.el (escape-glyph): Use blue against light foreground. + + * simple.el (undo-outer-limit-truncate): New function. + (undo-outer-limit-function): Use undo-outer-limit-truncate. + +2004-12-21 Eli Barzilay + + * calculator.el: (calculator-radix-grouping-mode) + (calculator-radix-grouping-digits) + (calculator-radix-grouping-separator): + New defcustoms for the new radix grouping mode functionality. + (calculator-mode-hook): Now used in electric mode too. + (calculator-mode-map): Some new keys. + (calculator-message): New function. Some new calls. + (calculator-string-to-number): New function, + (calculator-curnum-value): Use it. + (calculator-rotate-displayer, calculator-rotate-displayer-back) + (calculator-displayer-prev, calculator-displayer-next): + Change digit group size when in radix mode. + (calculator-number-to-string): Renamed from calculator-num-to-string. + Now deals with digit grouping in radix mode. + +2004-12-20 Glenn Morris + + * calendar/calendar.el (view-other-diary-entries): Add autoload. + * calendar/diary-lib.el (view-other-diary-entries): Use + current-prefix-arg in interactive spec. + +2004-12-19 Jay Belanger + + * calc/calc-aent.el (calcAlg-blank-matching-open): + Temporarily adjust the syntax of both delimiters of half-open + intervals. + +2004-12-19 Kim F. Storm + + * mouse.el (mouse-1-click-follows-link): Doc fix. + +2004-12-18 YAMAMOTO Mitsuharu + + * term/mac-win.el (encoding-vector, mac-font-encoder-list) + (ccl-encode-mac-centraleurroman-font): Use centraleurroman + instead of centraleuropean as the name + +2004-12-17 Michael Albinus + + Sync with Tramp 2.0.46. + + * net/tramp.el (tramp-maybe-send-perl-script): Change order of + parameters wrt Tramp convention. + (tramp-handle-file-attributes-with-perl) + (tramp-handle-directory-files-and-attributes): Apply it. + (tramp-do-copy-or-rename-file-out-of-band): Check for existence of + `copy-program'. Reported by Zack Weinberg + . + (top): Set `edebug-form-spec' property directly rather than + calling `def-edebug-spec'. + + * net/tramp-smb.el (tramp-smb-advice-PC-do-completion): Make the + advice less fragile. Surround temporary redefinition of + `substitute-in-file-name' with `unwind-protect'. Suggested by + Matt Hodges . + +2004-12-17 Juri Linkov + + * replace.el (occur-accumulate-lines, occur-engine): + Make forcing deferred font-lock fontification jit-specific. + +2004-12-17 Kim F. Storm + + * mouse.el (mouse-1-click-follows-link): New defcustom. + (mouse-on-link-p): New function. + (mouse-drag-region-1): Implement mouse-1-click-follows-link + functionality. Map a mouse-1 click event into a mouse-2 (or + other) event when position is inside a link. + + * tooltip.el (tooltip-show-help-function): Replace "mouse-2" + prefix in tooltip text with "mouse-1" when this is a link + recognized by mouse-1-click-follows-link functionality. + + * help.el (describe-key): Report effective and original binding + for mouse-1 when clicked on a link. + (describe-mode): Add follow-link property to "minor-mode" button. + + * help-fns.el (describe-variable): Add follow-link property to + "below" button. + + * help-mode.el (help-xref): Add follow-link property. + + * apropos.el (apropos-symbol, apropos-function, apropos-macro) + (apropos-command, apropos-variable, apropos-face, apropos-group) + (apropos-widget, apropos-plist): Add follow-link property. + + * pcvs-defs.el (cvs-mode-map): Map follow-link to a function which + checks if position is in a filename, rather than some other + clickable item. Function looks for cvs-filename-face at position. + + * wid-edit.el (widget-specify-field, widget-specify-button): + Map a :follow-link keyword into a follow-link property. + (link): Add :follow-link keyword, map to RET binding. + + * dired.el (dired-mode-map): Map follow-link to mouse-face. + + * progmodes/compile.el (compilation-minor-mode-map) + (compilation-button-map, compilation-mode-map): Likewise. + +2004-12-17 Thien-Thi Nguyen + + * play/zone.el (zone): Init `line-spacing' from orig buffer. + (zone-replace-char): Take `count' and `del-count' + instead of `direction'. Update callers. When `del-count' is + non-nil, delete that many characters, otherwise `count' characters + backwards. Insert the newly-replaced string `count' times. + (zone-fret): Handle chars w/ width greater than one. + (zone-fall-through-ws): No longer take window width `ww'. + Update callers. Add handling for `char-width' greater than one. + (zone-pgm-drip): Update var holding window-end position every cycle. + +2004-12-17 Andre Spiegel + + * vc.el (vc-default-update-changelog): Use insert-file-contents, + rather than insert-file. + +2004-12-16 Jay Belanger + + * calc/calc-comb.el (var-RandSeed): Don't initially bind it. + (math-init-random-base, math-random-digit): Check to see if + var-RandSeed is bound. + (math-random-last): Declare it. + (math-random-digit): Don't make math-random-last local. + +2004-12-16 Thien-Thi Nguyen + + * play/zone.el (zone): Fix omission bug: Use a self-disabling + one-shot thunk for uniform (error, quit, normal) recovery. + Reported by John Paul Wallington. + (zone-pgm-random-life): Fix bug: + Recognize empty initial field by lack of "@" chars. + +2004-12-16 Juri Linkov + + * help.el (function-called-at-point): + * help-fns.el (variable-at-point): As a last resort try striping + non-word prefixes and suffixes. + + * descr-text.el (describe-property-list): Don't treat syntax-table + specially. Use describe-text-sexp which inserts [show] button + for large objects and handles printing errors. Sort properties + by names in alphabetical order instead of by value sizes. + Add `mouse-face' to list of properties for `describe-face' widget. + (describe-char): Mask out face-id from 19 bits of character. + Print face-id separately. + + * replace.el (occur-accumulate-lines, occur-engine): + Fontify unfontified matching lines in the source buffer + before copying them. + (occur-engine): Don't put mouse-face on context lines. + (occur-next-error): Set point to line beginning/end + before searching for prev/next property to skip multiple + matches on a line (not supported by occur engine). + Remove redundant prefix-numeric-value. + +2004-12-15 Juri Linkov + + * replace.el (match): New face. + (list-matching-lines-face): Change default from `bold' to `match'. + + * progmodes/grep.el (grep-match-face): New defvar. + (grep-mode-font-lock-keywords): Use grep-match-face instead of + compilation-column-face to highlight grep matches. + + * apropos.el (apropos-match-face): Change default from + `secondary-selection' to `match'. + + * info-look.el (info-lookup-highlight-face): Change default from + `highlight' to `match'. + +2004-12-15 Daniel Pfeiffer + + * progmodes/executable.el (executable-interpret): Eliminate + obsolete compile-internal, and switch to comint for interaction. + +2004-12-15 J.D. Smith + + * progmodes/idlwave.el (idlwave-skip-multi-commands): Don't match + `&&' when skipping multiple statements on a line. + +2004-12-15 Thien-Thi Nguyen + + * play/zone.el (zone): Set `truncate-lines'. + Also, init `tab-width' with value from original buffer. + (zone-shift-up): Rewrite for speed. + (zone-shift-down, zone-shift-left, zone-shift-right): Likewise. + (zone-pgm-jitter): Remove redundant entries from ops vector. + (zone-exploding-remove): Reduce iteration count. + (zone-cpos): Convert to defsubst. + (zone-replace-char): New defsubst. + (zone-park/sit-for): Likewise. + (zone-fret): Take window-start arg. + Update callers. Use `zone-park/sit-for'. + (zone-fill-out-screen): Rewrite. + (zone-fall-through-ws): Likewise. Update callers. + (zone-pgm-drip): Use `zone-replace-char'. + Move var inits before while-loop. Use `zone-park/sit-for'. + (zone-pgm-random-life): Handle empty initial field. + Use `zone-replace-char' and `zone-park/sit-for'. + +2004-12-15 Juri Linkov + + * isearch.el (isearch-update): Test isearch-lazy-highlight + before calling isearch-lazy-highlight-new-loop. + (isearch-lazy-highlight-new-loop): + Don't test isearch-lazy-highlight. + + * replace.el (perform-replace): Add isearch-case-fold-search. + Use delimited-flag for isearch-regexp. + Reset isearch-lazy-highlight-last-string to force lazy + highlighting when called from isearch mode. + (query-replace-highlight): Revert defcustom type to boolean. + (query-replace-lazy-highlight): New defcustom. + (query-replace): New face. + (perform-replace, replace-highlight, replace-dehighlight): + Test query-replace-lazy-highlight instead of special value + `isearch' of query-replace-highlight. + (replace-dehighlight): Don't call isearch-dehighlight. + (replace-highlight): Don't call isearch-highlight. + Use face `query-replace' unconditionally. + +2004-12-14 Kim F. Storm + + * simple.el (inhibit-mark-movement): Remove defvar. + (beginning-of-buffer, end-of-buffer): Don't use it. + + * emacs-lisp/lisp.el (beginning-of-defun, end-of-defun): Don't + use inhibit-mark-movement. + + * emulation/cua-base.el (cua--preserve-mark-commands): Remove. + (cua--undo-push-mark): Remove. + (cua--pre-command-handler, cua--post-command-handler): Don't + fiddle with inhibit-mark-movement. + +2004-12-14 Juri Linkov + + * 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 + + * 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 + + * 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 (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 + + * vc-svn.el (vc-svn-repository-hostname): Adjust to new format. + Reported by Ville Skytt,Ad(B . + (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 + + * 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 + + * 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 + + * 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 + + * 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 + + * term.el (term-termcap-format): Synchronyze with terminfo. + (term-emulate-terminal): Handle reset. + (term-reset-terminal): New function. + +2004-12-11 Thien-Thi Nguyen + + * 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 + + * files.el (auto-mode-alist): Map .com to DCL mode. + 2004-12-09 Richard M. Stallman * isearch.el (isearch-mode-map): Treat S-SPC like SPC. -2004-12-10 Nick Roberts +2004-12-09 Nick Roberts * xt-mouse.el (xterm-mouse-event): Correct cursor position in a buffer with a display margin. @@ -41,10 +474,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 + (edmacro-sanitize-for-string): Correctly remove Meta modifier. + +2004-12-07 Stefan Monnier * font-lock.el (font-lock-unfontify-region): Save buffer state. (font-lock-default-unfontify-region): Don't save buffer state any more. @@ -7889,7 +8321,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 + + * 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 + + * progmodes/python.el: Doc fixes. Changes for compiler warnings. + (syntax): Don't require. + (python) : 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 + + * 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 + + * progmodes/compile.el (compile-goto-error): Select the buffer/window + corresponding to the event. + +2004-04-12 Joe Buehler + + * loadup.el: Add cygwin to system-type list, for unexec() support. + +2004-04-12 John Paul Wallington + + * 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 + + * 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 + + * info.el (Info-follow-reference): Allow multiline reference name. + +2004-04-11 Dave Love + + * emacs-lisp/bytecomp.el (byte-compile-cond): Fix last change. + + * progmodes/python.el: New file. + +2004-04-11 Andre Spiegel + + * 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 + + * 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. diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/apropos.el --- a/lisp/apropos.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/apropos.el Thu Dec 23 16:43:51 2004 +0000 @@ -96,7 +96,7 @@ :group 'apropos :type 'face) -(defcustom apropos-match-face 'secondary-selection +(defcustom apropos-match-face 'match "*Face for matching text in Apropos documentation/value, or nil for none. This applies when you look for matches in the documentation or variable value for the regexp; the part that matches gets displayed in this font." @@ -163,6 +163,7 @@ (define-button-type 'apropos-symbol 'face apropos-symbol-face 'help-echo "mouse-2, RET: Display more help on this symbol" + 'follow-link t 'action #'apropos-symbol-button-display-help 'skip t) @@ -174,19 +175,24 @@ (define-button-type 'apropos-function 'apropos-label "Function" + 'help-echo "mouse-2, RET: Display more help on this function" + 'follow-link t 'action (lambda (button) - (describe-function (button-get button 'apropos-symbol))) - 'help-echo "mouse-2, RET: Display more help on this function") + (describe-function (button-get button 'apropos-symbol)))) + (define-button-type 'apropos-macro 'apropos-label "Macro" + 'help-echo "mouse-2, RET: Display more help on this macro" + 'follow-link t 'action (lambda (button) - (describe-function (button-get button 'apropos-symbol))) - 'help-echo "mouse-2, RET: Display more help on this macro") + (describe-function (button-get button 'apropos-symbol)))) + (define-button-type 'apropos-command 'apropos-label "Command" + 'help-echo "mouse-2, RET: Display more help on this command" + 'follow-link t 'action (lambda (button) - (describe-function (button-get button 'apropos-symbol))) - 'help-echo "mouse-2, RET: Display more help on this command") + (describe-function (button-get button 'apropos-symbol)))) ;; We used to use `customize-variable-other-window' instead for a ;; customizable variable, but that is slow. It is better to show an @@ -196,18 +202,21 @@ (define-button-type 'apropos-variable 'apropos-label "Variable" 'help-echo "mouse-2, RET: Display more help on this variable" + 'follow-link t 'action (lambda (button) (describe-variable (button-get button 'apropos-symbol)))) (define-button-type 'apropos-face 'apropos-label "Face" 'help-echo "mouse-2, RET: Display more help on this face" + 'follow-link t 'action (lambda (button) (describe-face (button-get button 'apropos-symbol)))) (define-button-type 'apropos-group 'apropos-label "Group" 'help-echo "mouse-2, RET: Display more help on this group" + 'follow-link t 'action (lambda (button) (customize-group-other-window (button-get button 'apropos-symbol)))) @@ -215,12 +224,14 @@ (define-button-type 'apropos-widget 'apropos-label "Widget" 'help-echo "mouse-2, RET: Display more help on this widget" + 'follow-link t 'action (lambda (button) (widget-browse-other-window (button-get button 'apropos-symbol)))) (define-button-type 'apropos-plist 'apropos-label "Plist" 'help-echo "mouse-2, RET: Display more help on this plist" + 'follow-link t 'action (lambda (button) (apropos-describe-plist (button-get button 'apropos-symbol)))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/bindings.el --- a/lisp/bindings.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/bindings.el Thu Dec 23 16:43:51 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) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/buff-menu.el --- a/lisp/buff-menu.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/buff-menu.el Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/calc/calc-aent.el --- a/lisp/calc/calc-aent.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/calc/calc-aent.el Thu Dec 23 16:43:51 2004 +0000 @@ -410,32 +410,40 @@ (exit-minibuffer)))) (defun calcAlg-blink-matching-open () - (let ((oldpos (point)) - (blinkpos nil)) + (let ((rightpt (point)) + (leftpt nil) + (rightchar (preceding-char)) + leftchar + rightsyntax + leftsyntax) (save-excursion (condition-case () - (setq blinkpos (scan-sexps oldpos -1)) - (error nil))) - (if (and blinkpos - (> oldpos (1+ (point-min))) - (or (and (= (char-after (1- oldpos)) ?\)) - (= (char-after blinkpos) ?\[)) - (and (= (char-after (1- oldpos)) ?\]) - (= (char-after blinkpos) ?\())) - (save-excursion - (goto-char blinkpos) - (looking-at ".+\\(\\.\\.\\|\\\\dots\\|\\\\ldots\\)"))) - (let ((saved (aref (syntax-table) (char-after blinkpos)))) - (unwind-protect - (progn - (aset (syntax-table) (char-after blinkpos) - (+ (logand saved 255) - (lsh (char-after (1- oldpos)) 8))) - (blink-matching-open)) - (aset (syntax-table) (char-after blinkpos) saved))) + (setq leftpt (scan-sexps rightpt -1) + leftchar (char-after leftpt)) + (error nil))) + (if (and leftpt + (or (and (= rightchar ?\)) + (= leftchar ?\[)) + (and (= rightchar ?\]) + (= leftchar ?\())) + (save-excursion + (goto-char leftpt) + (looking-at ".+\\(\\.\\.\\|\\\\dots\\|\\\\ldots\\)"))) + (let ((leftsaved (aref (syntax-table) leftchar)) + (rightsaved (aref (syntax-table) rightchar))) + (unwind-protect + (progn + (cond ((= leftchar ?\[) + (aset (syntax-table) leftchar (cons 4 ?\))) + (aset (syntax-table) rightchar (cons 5 ?\[))) + (t + (aset (syntax-table) leftchar (cons 4 ?\])) + (aset (syntax-table) rightchar (cons 5 ?\()))) + (blink-matching-open)) + (aset (syntax-table) leftchar leftsaved) + (aset (syntax-table) rightchar rightsaved))) (blink-matching-open)))) - (defun calc-alg-digit-entry () (calc-alg-entry (cond ((eq last-command-char ?e) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/calc/calc-comb.el --- a/lisp/calc/calc-comb.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/calc/calc-comb.el Thu Dec 23 16:43:51 2004 +0000 @@ -540,12 +540,12 @@ ;;; Produce a random 10-bit integer, with (random) if no seed provided, ;;; or else with Numerical Recipes algorithm ran3 / Knuth 3.2.2-A. -(defvar var-RandSeed nil) +(defvar var-RandSeed) (defvar math-random-cache nil) (defvar math-gaussian-cache nil) (defun math-init-random-base () - (if var-RandSeed + (if (and (boundp 'var-RandSeed) var-RandSeed) (if (eq (car-safe var-RandSeed) 'vec) nil (if (Math-integerp var-RandSeed) @@ -599,9 +599,10 @@ ;;; Produce a random digit in the range 0..999. ;;; Avoid various pitfalls that may lurk in the built-in (random) function! ;;; Shuffling algorithm from Numerical Recipes, section 7.1. +(defvar math-random-last) (defun math-random-digit () - (let (i math-random-last) - (or (eq var-RandSeed math-last-RandSeed) + (let (i) + (or (and (boundp 'var-RandSeed) (eq var-RandSeed math-last-RandSeed)) (math-init-random-base)) (or math-random-cache (progn diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/calculator.el --- a/lisp/calculator.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/calculator.el Thu Dec 23 16:43:51 2004 +0000 @@ -4,6 +4,7 @@ ;; Author: Eli Barzilay ;; Keywords: tools, convenience +;; Time-stamp: <2002-07-13 01:14:35 eli> ;; This file is part of GNU Emacs. @@ -100,6 +101,20 @@ :type 'integer :group 'calculator) +(defcustom calculator-radix-grouping-mode t + "*Use digit grouping in radix output mode. +If this is set, chunks of `calculator-radix-grouping-digits' characters +will be separated by `calculator-radix-grouping-separator' when in radix +output mode is active (determined by `calculator-output-radix').") + +(defcustom calculator-radix-grouping-digits 4 + "*The number of digits used for grouping display in radix modes. +See `calculator-radix-grouping-mode'.") + +(defcustom calculator-radix-grouping-separator "'" + "*The separator used in radix grouping display. +See `calculator-radix-grouping-mode'.") + (defcustom calculator-remove-zeros t "*Non-nil value means delete all redundant zero decimal digits. If this value is not t, and not nil, redundant zeros are removed except @@ -163,7 +178,11 @@ :group 'calculator) (defcustom calculator-mode-hook nil - "*List of hook functions for `calculator-mode' to run." + "*List of hook functions for `calculator-mode' to run. +Note: if `calculator-electric-mode' is on, then this hook will get +activated in the minibuffer - in that case it should not do much more +than local key settings and other effects that will change things +outside the scope of calculator related code." :type 'hook :group 'calculator) @@ -387,7 +406,7 @@ "oD" "oH" "oX" "oO" "oB") (calculator-rotate-displayer "'") (calculator-rotate-displayer-back "\"") - (calculator-displayer-pref "{") + (calculator-displayer-prev "{") (calculator-displayer-next "}") (calculator-saved-up [up] [?\C-p]) (calculator-saved-down [down] [?\C-n]) @@ -399,10 +418,10 @@ (calculator-save-and-quit [(control return)] [(control kp-enter)]) (calculator-paste [insert] [(shift insert)] - [mouse-2]) + [paste] [mouse-2] [?\C-y]) (calculator-clear [delete] [?\C-?] [?\C-d]) (calculator-help [?h] [??] [f1] [help]) - (calculator-copy [(control insert)]) + (calculator-copy [(control insert)] [copy]) (calculator-backspace [backspace]) ))) (while p @@ -536,7 +555,7 @@ ,@(mapcar (lambda (x) (nth 1 x)) radix-selectors) "---" ,@(mapcar (lambda (x) (nth 2 x)) radix-selectors))) - ("Decimal Dislpay" + ("Decimal Display" ,@(mapcar (lambda (d) (vector (cadr d) ;; Note: inserts actual object here @@ -611,10 +630,11 @@ * \"=?\": (? is B/O/H) the display radix (when input is decimal); * \"??\": (? is D/B/O/H) 1st char for input radix, 2nd for display. -Also, the quote character can be used to switch display modes for -decimal numbers (double-quote rotates back), and the two brace -characters (\"{\" and \"}\" change display parameters that these -displayers use (if they handle such). +Also, the quote key can be used to switch display modes for decimal +numbers (double-quote rotates back), and the two brace characters +\(\"{\" and \"}\" change display parameters that these displayers use (if +they handle such). If output is using any radix mode, then these keys +toggle digit grouping mode and the chunk size. Values can be saved for future reference in either a list of saved values, or in registers. @@ -683,6 +703,7 @@ (setq calculator-saved-global-map (current-global-map)) (use-local-map nil) (use-global-map calculator-mode-map) + (run-hooks 'calculator-mode-hook) (unwind-protect (catch 'calculator-done (Electric-command-loop @@ -717,6 +738,12 @@ (if (and calculator-restart-other-mode calculator-electric-mode) (calculator))) +(defun calculator-message (string &rest arguments) + "Same as `message', but special handle of electric mode." + (apply 'message string arguments) + (if calculator-electric-mode + (progn (sit-for 1) (message nil)))) + ;;;--------------------------------------------------------------------- ;;; Operators @@ -818,82 +845,116 @@ (concat calculator-prompt (substring prompt (+ trim (length calculator-prompt))))))) -(defun calculator-curnum-value () - "Get the numeric value of the displayed number string as a float." +(defun calculator-string-to-number (str) + "Convert the given STR to a number, according to the value of +`calculator-input-radix'." (if calculator-input-radix (let ((radix (cdr (assq calculator-input-radix '((bin . 2) (oct . 8) (hex . 16))))) - (i -1) (value 0)) - ;; assume valid input (upcased & characters in range) - (while (< (setq i (1+ i)) (length calculator-curnum)) - (setq value - (+ (let ((ch (aref calculator-curnum i))) - (- ch (if (<= ch ?9) ?0 (- ?A 10)))) - (* radix value)))) + (i -1) (value 0) (new-value 0)) + ;; assume mostly valid input (e.g., characters in range) + (while (< (setq i (1+ i)) (length str)) + (setq new-value + (let* ((ch (upcase (aref str i))) + (n (cond ((< ch ?0) nil) + ((<= ch ?9) (- ch ?0)) + ((< ch ?A) nil) + ((<= ch ?Z) (- ch (- ?A 10))) + (t nil)))) + (if (and n (<= 0 n) (< n radix)) + (+ n (* radix value)) + (progn + (calculator-message + "Warning: Ignoring bad input character `%c'." ch) + (sit-for 1) + value)))) + (if (if (< new-value 0) (> value 0) (< value 0)) + (calculator-message "Warning: Overflow in input.")) + (setq value new-value)) value) - (car - (read-from-string - (cond - ((equal "." calculator-curnum) - "0.0") - ((string-match "[eE][+-]?$" calculator-curnum) - (concat calculator-curnum "0")) - ((string-match "\\.[0-9]\\|[eE]" calculator-curnum) - calculator-curnum) - ((string-match "\\." calculator-curnum) - ;; do this because Emacs reads "23." as an integer - (concat calculator-curnum "0")) - ((stringp calculator-curnum) - (concat calculator-curnum ".0")) - (t "0.0")))))) + (car (read-from-string + (cond ((equal "." str) "0.0") + ((string-match "[eE][+-]?$" str) (concat str "0")) + ((string-match "\\.[0-9]\\|[eE]" str) str) + ((string-match "\\." str) + ;; do this because Emacs reads "23." as an integer + (concat str "0")) + ((stringp str) (concat str ".0")) + (t "0.0")))))) + +(defun calculator-curnum-value () + "Get the numeric value of the displayed number string as a float." + (calculator-string-to-number calculator-curnum)) (defun calculator-rotate-displayer (&optional new-disp) "Switch to the next displayer on the `calculator-displayers' list. Can be called with an optional argument NEW-DISP to force rotation to -that argument." +that argument. +If radix output mode is active, toggle digit grouping." (interactive) - (setq calculator-displayers - (if (and new-disp (memq new-disp calculator-displayers)) - (let ((tmp nil)) - (while (not (eq (car calculator-displayers) new-disp)) - (setq tmp (cons (car calculator-displayers) tmp)) - (setq calculator-displayers (cdr calculator-displayers))) - (setq calculator-displayers - (nconc calculator-displayers (nreverse tmp)))) - (nconc (cdr calculator-displayers) - (list (car calculator-displayers))))) - (message "Using %s." (cadr (car calculator-displayers))) - (if calculator-electric-mode - (progn (sit-for 1) (message nil))) + (cond + (calculator-output-radix + (setq calculator-radix-grouping-mode + (not calculator-radix-grouping-mode)) + (calculator-message + "Digit grouping mode %s." + (if calculator-radix-grouping-mode "ON" "OFF"))) + (t + (setq calculator-displayers + (if (and new-disp (memq new-disp calculator-displayers)) + (let ((tmp nil)) + (while (not (eq (car calculator-displayers) new-disp)) + (setq tmp (cons (car calculator-displayers) tmp)) + (setq calculator-displayers + (cdr calculator-displayers))) + (setq calculator-displayers + (nconc calculator-displayers (nreverse tmp)))) + (nconc (cdr calculator-displayers) + (list (car calculator-displayers))))) + (calculator-message + "Using %s." (cadr (car calculator-displayers))))) (calculator-enter)) (defun calculator-rotate-displayer-back () - "Like `calculator-rotate-displayer', but rotates modes back." + "Like `calculator-rotate-displayer', but rotates modes back. +If radix output mode is active, toggle digit grouping." (interactive) (calculator-rotate-displayer (car (last calculator-displayers)))) (defun calculator-displayer-prev () "Send the current displayer function a 'left argument. This is used to modify display arguments (if the current displayer -function supports this)." +function supports this). +If radix output mode is active, increase the grouping size." (interactive) - (and (car calculator-displayers) - (let ((disp (caar calculator-displayers))) - (cond ((symbolp disp) (funcall disp 'left)) - ((and (consp disp) (eq 'std (car disp))) - (calculator-standard-displayer 'left (cadr disp))))))) + (if calculator-output-radix + (progn (setq calculator-radix-grouping-digits + (1+ calculator-radix-grouping-digits)) + (calculator-enter)) + (and (car calculator-displayers) + (let ((disp (caar calculator-displayers))) + (cond + ((symbolp disp) (funcall disp 'left)) + ((and (consp disp) (eq 'std (car disp))) + (calculator-standard-displayer 'left (cadr disp)))))))) (defun calculator-displayer-next () "Send the current displayer function a 'right argument. This is used to modify display arguments (if the current displayer -function supports this)." +function supports this). +If radix output mode is active, decrease the grouping size." (interactive) - (and (car calculator-displayers) - (let ((disp (caar calculator-displayers))) - (cond ((symbolp disp) (funcall disp 'right)) - ((and (consp disp) (eq 'std (car disp))) - (calculator-standard-displayer 'right (cadr disp))))))) + (if calculator-output-radix + (progn (setq calculator-radix-grouping-digits + (max 2 (1- calculator-radix-grouping-digits))) + (calculator-enter)) + (and (car calculator-displayers) + (let ((disp (caar calculator-displayers))) + (cond + ((symbolp disp) (funcall disp 'right)) + ((and (consp disp) (eq 'std (car disp))) + (calculator-standard-displayer 'right (cadr disp)))))))) (defun calculator-remove-zeros (numstr) "Get a number string NUMSTR and remove unnecessary zeroes. @@ -995,7 +1056,7 @@ (calculator-remove-zeros str)) "e" (number-to-string exp)))))) -(defun calculator-num-to-string (num) +(defun calculator-number-to-string (num) "Convert NUM to a displayable string." (cond ((and (numberp num) calculator-output-radix) @@ -1015,6 +1076,14 @@ (?6 . "110") (?7 . "111"))))))) (string-match "^0*\\(.+\\)" s) (setq str (match-string 1 s)))) + (if calculator-radix-grouping-mode + (let ((d (/ (length str) calculator-radix-grouping-digits)) + (r (% (length str) calculator-radix-grouping-digits))) + (while (>= (setq d (1- d)) (if (zerop r) 1 0)) + (let ((i (+ r (* d calculator-radix-grouping-digits)))) + (setq str (concat (substring str 0 i) + calculator-radix-grouping-separator + (substring str i))))))) (upcase (if (and (not calculator-2s-complement) (< num 0)) (concat "-" str) @@ -1051,7 +1120,7 @@ ;; customizable display for a single value (caar calculator-displayers) calculator-displayer))) - (mapconcat 'calculator-num-to-string + (mapconcat 'calculator-number-to-string (reverse calculator-stack) " ")) " " @@ -1319,9 +1388,8 @@ (if (not (and op (= -1 (calculator-op-arity op)))) ;;(error "Binary operator without a first operand") (progn - (message "Binary operator without a first operand") - (if calculator-electric-mode - (progn (sit-for 1) (message nil))) + (calculator-message + "Binary operator without a first operand") (throw 'op-error nil))))) (calculator-reduce-stack (cond ((eq (nth 1 op) '\() 10) @@ -1334,9 +1402,7 @@ (not (numberp (car calculator-stack))))) ;;(error "Unterminated expression") (progn - (message "Unterminated expression") - (if calculator-electric-mode - (progn (sit-for 1) (message nil))) + (calculator-message "Unterminated expression") (throw 'op-error nil))) (setq calculator-stack (cons op calculator-stack)) (calculator-reduce-stack (calculator-op-prec op)) @@ -1540,7 +1606,7 @@ (setcdr as val) (setq calculator-registers (cons (cons reg val) calculator-registers))) - (message (format "[%c] := %S" reg val)))) + (calculator-message "[%c] := %S" reg val))) (defun calculator-put-value (val) "Paste VAL as if entered. @@ -1552,24 +1618,26 @@ (progn (calculator-clear-fragile) (setq calculator-curnum (let ((calculator-displayer "%S")) - (calculator-num-to-string val))) + (calculator-number-to-string val))) (calculator-update-display)))) (defun calculator-paste () "Paste a value from the `kill-ring'." (interactive) (calculator-put-value - (let ((str (current-kill 0))) - (and calculator-paste-decimals + (let ((str (replace-regexp-in-string + "^ *\\(.+[^ ]\\) *$" "\\1" (current-kill 0)))) + (and (not calculator-input-radix) + calculator-paste-decimals (string-match "\\([0-9]+\\)\\(\\.[0-9]+\\)?\\(e[0-9]+\\)?" str) (or (match-string 1 str) (match-string 2 str) (match-string 3 str)) - (setq str (concat (match-string 1 str) + (setq str (concat (or (match-string 1 str) "0") (or (match-string 2 str) ".0") - (match-string 3 str)))) - (condition-case nil (car (read-from-string str)) + (or (match-string 3 str) "")))) + (condition-case nil (calculator-string-to-number str) (error nil))))) (defun calculator-get-register (reg) @@ -1678,7 +1746,7 @@ (while (> x 0) (setq r (* r (truncate x))) (setq x (1- x))) - r)) + (+ 0.0 r))) (defun calculator-truncate (n) "Truncate N, return 0 in case of overflow." diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/calendar/calendar.el --- a/lisp/calendar/calendar.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/calendar/calendar.el Thu Dec 23 16:43:51 2004 +0000 @@ -1660,6 +1660,13 @@ calendar." t) +(autoload 'view-other-diary-entries "diary-lib" + "Prepare and display buffer of diary entries from an alternative diary file. +Searches for entries that match ARG days, starting with the date indicated +by the cursor position in the displayed three-month calendar. +D-FILE specifies the file to use as the diary file." + t) + (autoload 'calendar-sunrise-sunset "solar" "Local time of sunrise and sunset for date under cursor." t) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/calendar/diary-lib.el --- a/lisp/calendar/diary-lib.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/calendar/diary-lib.el Thu Dec 23 16:43:51 2004 +0000 @@ -80,7 +80,7 @@ by the cursor position in the displayed three-month calendar. D-FILE specifies the file to use as the diary file." (interactive - (list (if arg (prefix-numeric-value arg) 1) + (list (prefix-numeric-value current-prefix-arg) (read-file-name "Enter diary file name: " default-directory nil t))) (let ((diary-file d-file)) (view-diary-entries arg))) @@ -841,11 +841,11 @@ After the entries are marked, the hooks `nongregorian-diary-marking-hook' and `mark-diary-entries-hook' are run." (interactive) - (setq mark-diary-entries-in-calendar t) (let ((marking-diary-entries t) file-glob-attrs marks) (save-excursion (set-buffer (find-file-noselect (diary-check-diary-file) t)) + (setq mark-diary-entries-in-calendar t) (message "Marking diary entries...") (setq file-glob-attrs (nth 1 (diary-pull-attrs nil '()))) (let ((d diary-date-forms) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/cus-edit.el --- a/lisp/cus-edit.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/cus-edit.el Thu Dec 23 16:43:51 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.") diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/descr-text.el --- a/lisp/descr-text.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/descr-text.el Thu Dec 23 16:43:51 2004 +0000 @@ -104,24 +104,11 @@ into widget buttons that call `describe-text-category' or `describe-face' when pushed." ;; Sort the properties by the size of their value. - (dolist (elt (sort (let ((ret nil) - (key nil) - (val nil) - (len nil)) + (dolist (elt (sort (let (ret) (while properties - (setq key (pop properties) - val (pop properties) - len 0) - (unless (or (memq key '(category face font-lock-face - syntax-table)) - (widgetp val)) - (setq val (pp-to-string val) - len (length val))) - (push (list key val len) ret)) + (push (list (pop properties) (pop properties)) ret)) ret) - (lambda (a b) - (< (nth 2 a) - (nth 2 b))))) + (lambda (a b) (string< (nth 0 a) (nth 0 b))))) (let ((key (nth 0 elt)) (value (nth 1 elt))) (widget-insert (propertize (format " %-20s " key) @@ -131,23 +118,15 @@ :notify `(lambda (&rest ignore) (describe-text-category ',value)) (format "%S" value))) - ((memq key '(face font-lock-face)) + ((memq key '(face font-lock-face mouse-face)) (widget-create 'link :notify `(lambda (&rest ignore) (describe-face ',value)) (format "%S" value))) - ((eq key 'syntax-table) - (widget-create 'push-button - :tag "show" - :action (lambda (widget &optional event) - (with-output-to-temp-buffer - "*Pp Eval Output*" - (pp (widget-get widget :value)))) - value)) ((widgetp value) (describe-text-widget value)) (t - (widget-insert value)))) + (describe-text-sexp value)))) (widget-insert "\n"))) ;;; Describe-Text Commands. @@ -552,10 +531,17 @@ (dotimes (i (length disp-vector)) (setq char (aref disp-vector i)) (aset disp-vector i - (cons char (describe-char-display pos char)))) + (cons char (describe-char-display + pos (logand char #x7ffff))))) (format "by display table entry [%s] (see below)" - (mapconcat #'(lambda (x) (format "?%c" (car x))) - disp-vector " "))) + (mapconcat + #'(lambda (x) + (if (> (car x) #x7ffff) + (format "?%c" + (logand (car x) #x7ffff) + (lsh (car x) -19)) + (format "?%c" (car x)))) + disp-vector " "))) (composition (let ((from (car composition)) (to (nth 1 composition)) @@ -627,7 +613,7 @@ (progn (insert "these fonts (glyph codes):\n") (dotimes (i (length disp-vector)) - (insert (car (aref disp-vector i)) ?: + (insert (logand (car (aref disp-vector i)) #x7ffff) ?: (propertize " " 'display '(space :align-to 5)) (if (cdr (aref disp-vector i)) (format "%s (0x%02X)" (cadr (aref disp-vector i)) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/dired.el --- a/lisp/dired.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/dired.el Thu Dec 23 16:43:51 2004 +0000 @@ -1104,6 +1104,7 @@ (let ((map (make-keymap))) (suppress-keymap map) (define-key map [mouse-2] 'dired-mouse-find-file-other-window) + (define-key map [follow-link] 'mouse-face) ;; Commands to mark or flag certain categories of files (define-key map "#" 'dired-flag-auto-save-files) (define-key map "." 'dired-clean-directory) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/emacs-lisp/bytecomp.el --- a/lisp/emacs-lisp/bytecomp.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/emacs-lisp/bytecomp.el Thu Dec 23 16:43:51 2004 +0000 @@ -2178,7 +2178,7 @@ (let ((old-load-list current-load-list) (args (mapcar 'eval (cdr form)))) (apply 'require args) - ;; Detech (require 'cl) in a way that works even if cl is already loaded. + ;; Detect (require 'cl) in a way that works even if cl is already loaded. (if (member (car args) '("cl" cl)) (setq byte-compile-warnings (remq 'cl-functions byte-compile-warnings)))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/emacs-lisp/checkdoc.el --- a/lisp/emacs-lisp/checkdoc.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/emacs-lisp/checkdoc.el Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/emacs-lisp/elint.el --- a/lisp/emacs-lisp/elint.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/emacs-lisp/elint.el Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/emacs-lisp/lisp.el --- a/lisp/emacs-lisp/lisp.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/emacs-lisp/lisp.el Thu Dec 23 16:43:51 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,10 @@ 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 (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 +244,10 @@ 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 (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 +292,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)) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/emulation/cua-base.el --- a/lisp/emulation/cua-base.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/emulation/cua-base.el Thu Dec 23 16:43:51 2004 +0000 @@ -1003,14 +1003,6 @@ (defvar cua-movement-commands nil "User may add additional movement commands to this list.") -(defvar cua--preserve-mark-commands - '(end-of-buffer beginning-of-buffer) - "List of movement commands that move the mark. -CUA will preserve the previous mark position if a mark is already -active before one of these commands is executed.") - -(defvar cua--undo-push-mark nil) - ;;; Scrolling commands which does not signal errors at top/bottom ;;; of buffer at first key-press (instead moves to top/bottom ;;; of buffer). @@ -1100,11 +1092,7 @@ (aref (if window-system (this-single-command-raw-keys) (this-single-command-keys)) 0))) - (if mark-active - (if (and (memq this-command cua--preserve-mark-commands) - (not inhibit-mark-movement)) - (setq cua--undo-push-mark t - inhibit-mark-movement t)) + (unless mark-active (push-mark-command nil t)) (setq cua--last-region-shifted t) (setq cua--explicit-region-start nil)) @@ -1151,9 +1139,6 @@ (defun cua--post-command-handler () (condition-case nil (progn - (when cua--undo-push-mark - (setq cua--undo-push-mark nil - inhibit-mark-movement nil)) (when cua--global-mark-active (cua--global-mark-post-command)) (when (fboundp 'cua--rectangle-post-command) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/faces.el --- a/lisp/faces.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/faces.el Thu Dec 23 16:43:51 2004 +0000 @@ -1334,21 +1334,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) @@ -1816,7 +1824,7 @@ :group 'basic-faces) (defface mode-line-inactive - '((t + '((default :inherit mode-line) (((type x w32 mac) (background light) (class color)) :weight light @@ -1836,7 +1844,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 @@ -1872,7 +1880,7 @@ (defface tool-bar - '((t + '((default :box (:line-width 1 :style released-button) :foreground "black") (((type x w32 mac) (class color)) @@ -2053,8 +2061,8 @@ (defface escape-glyph '((((background dark)) :foreground "cyan") (((type pc)) :foreground "magenta") - (t :foreground "dark blue")) - "Face for displaying \\ and ^ in multichar glyphs." + (t :foreground "blue")) + "Face for characters displayed as ^-sequences or \-sequences." :group 'basic-faces) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/ffap.el --- a/lisp/ffap.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/ffap.el Thu Dec 23 16:43:51 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 ", 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) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/filecache.el --- a/lisp/filecache.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/filecache.el Thu Dec 23 16:43:51 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))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/files.el --- a/lisp/files.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/files.el Thu Dec 23 16:43:51 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) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/gnus/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,7 +1,22 @@ +2004-12-17 Kim F. Storm + + * gnus-group.el (gnus-group-mode-map): Map follow-link to mouse-face. + + * gnus-sum.el (gnus-summary-mode-map): Likewise. + 2004-12-08 Stefan Monnier * gnus-art.el (gnus-narrow-to-page): Don't hardcode point-min. +2004-12-13 Katsumi Yamaoka + + * 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 + . + 2004-12-02 Katsumi Yamaoka * message.el (message-forward-make-body-mml): Remove headers @@ -896,7 +911,7 @@ * gnus-delay.el (gnus-delay-default-hour): Add :version. * gnus-cite.el (gnus-cite-blank-line-after-header) - (gnus-article-boring-faces): + (gnus-article-boring-faces): * gnus-art.el (gnus-buttonized-mime-types) (gnus-inhibit-mime-unbuttonizing) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/gnus/gnus-group.el --- a/lisp/gnus/gnus-group.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/gnus/gnus-group.el Thu Dec 23 16:43:51 2004 +0000 @@ -591,6 +591,7 @@ "\M-e" gnus-group-edit-group-method "^" gnus-group-enter-server-mode gnus-mouse-2 gnus-mouse-pick-group + [follow-link] mouse-face "<" beginning-of-buffer ">" end-of-buffer "\C-c\C-b" gnus-bug @@ -2592,8 +2593,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)))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/gnus/gnus-start.el --- a/lisp/gnus/gnus-start.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/gnus/gnus-start.el Thu Dec 23 16:43:51 2004 +0000 @@ -952,16 +952,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. diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/gnus/gnus-sum.el --- a/lisp/gnus/gnus-sum.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/gnus/gnus-sum.el Thu Dec 23 16:43:51 2004 +0000 @@ -1703,6 +1703,7 @@ "Q" gnus-summary-exit-no-update "\C-c\C-i" gnus-info-find-node gnus-mouse-2 gnus-mouse-pick-article + [follow-link] mouse-face "m" gnus-summary-mail-other-window "a" gnus-summary-post-news "i" gnus-summary-news-other-window @@ -5096,7 +5097,7 @@ (when gnus-agent (gnus-agent-possibly-alter-active group (gnus-active group) info) - + (setq gnus-summary-use-undownloaded-faces (gnus-agent-find-parameter group @@ -7044,7 +7045,7 @@ (gnus-summary-goto-subject article t))) (gnus-summary-limit (append articles gnus-newsgroup-limit)) (gnus-summary-position-point)) - + (defun gnus-summary-goto-subject (article &optional force silent) "Go the subject line of ARTICLE. If FORCE, also allow jumping to articles not currently shown." @@ -9140,7 +9141,7 @@ ;;;!!!Why is this necessary? (set-buffer gnus-summary-buffer) - + (gnus-summary-goto-subject article) (when (eq action 'move) (gnus-summary-mark-article article gnus-canceled-mark)))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/help-fns.el --- a/lisp/help-fns.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/help-fns.el Thu Dec 23 16:43:51 2004 +0000 @@ -478,8 +478,13 @@ (and (symbolp obj) (boundp obj) obj)))) (error nil)) (let* ((str (find-tag-default)) - (obj (if str (intern str)))) - (and (symbolp obj) (boundp obj) obj)) + (sym (if str (intern-soft str)))) + (if (and sym (boundp sym)) + sym + (save-match-data + (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) + (setq sym (intern-soft (match-string 1 str))) + (and (boundp sym) sym))))) 0)) ;;;###autoload @@ -564,6 +569,7 @@ (insert " value is shown ") (insert-button "below" 'action help-button-cache + 'follow-link t 'help-echo "mouse-2, RET: show value") (insert ".\n\n"))) ;; Add a note for variables that have been make-var-buffer-local. diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/help-mode.el --- a/lisp/help-mode.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/help-mode.el Thu Dec 23 16:43:51 2004 +0000 @@ -68,6 +68,7 @@ ;; Button types used by help (define-button-type 'help-xref + 'follow-link t 'action #'help-button-action) (defun help-button-action (button) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/help.el --- a/lisp/help.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/help.el Thu Dec 23 16:43:51 2004 +0000 @@ -267,8 +267,13 @@ (and (symbolp obj) (fboundp obj) obj)))) (error nil)))) (let* ((str (find-tag-default)) - (obj (if str (intern str)))) - (and (symbolp obj) (fboundp obj) obj)))) + (sym (if str (intern-soft str)))) + (if (and sym (fboundp sym)) + sym + (save-match-data + (when (and str (string-match "\\`\\W*\\(.*?\\)\\W*\\'" str)) + (setq sym (intern-soft (match-string 1 str))) + (and (fboundp sym) sym))))))) ;;; `User' help functions @@ -609,17 +614,58 @@ (princ "\n which is ") (describe-function-1 defn) (when up-event - (let ((defn (or (string-key-binding up-event) (key-binding up-event)))) + (let ((ev (aref up-event 0)) + (descr (key-description up-event)) + (hdr "\n\n-------------- up event ---------------\n\n") + defn + mouse-1-tricky mouse-1-remapped) + (when (and (consp ev) + (eq (car ev) 'mouse-1) + (windowp window) + mouse-1-click-follows-link + (not (eq mouse-1-click-follows-link 'double)) + (with-current-buffer (window-buffer window) + (mouse-on-link-p (posn-point (event-start ev))))) + (setq mouse-1-tricky (integerp mouse-1-click-follows-link) + mouse-1-remapped (or (not mouse-1-tricky) + (> mouse-1-click-follows-link 0))) + (if mouse-1-remapped + (setcar ev 'mouse-2))) + (setq defn (or (string-key-binding up-event) (key-binding up-event))) (unless (or (null defn) (integerp defn) (equal defn 'undefined)) - (princ "\n\n-------------- up event ---------------\n\n") - (princ (key-description up-event)) + (princ (if mouse-1-tricky + "\n\n----------------- up-event (short click) ----------------\n\n" + hdr)) + (setq hdr nil) + (princ descr) (if (windowp window) (princ " at that spot")) + (if mouse-1-remapped + (princ " is remapped to \n which" )) (princ " runs the command ") (prin1 defn) (princ "\n which is ") - (describe-function-1 defn)))) - (print-help-return-message))))))) + (describe-function-1 defn)) + (when mouse-1-tricky + (setcar ev + (if (> mouse-1-click-follows-link 0) 'mouse-1 'mouse-2)) + (setq defn (or (string-key-binding up-event) (key-binding up-event))) + (unless (or (null defn) (integerp defn) (equal defn 'undefined)) + (princ (or hdr + "\n\n----------------- up-event (long click) ----------------\n\n")) + (princ "Pressing ") + (princ descr) + (if (windowp window) + (princ " at that spot")) + (princ (format " for longer than %d milli-seconds\n" + (abs mouse-1-click-follows-link))) + (if (not mouse-1-remapped) + (princ " remaps it to which" )) + (princ " runs the command ") + (prin1 defn) + (princ "\n which is ") + (describe-function-1 defn)))) + (print-help-return-message)))))))) (defun describe-mode (&optional buffer) @@ -692,6 +738,7 @@ (princ " ") (insert-button pretty-minor-mode 'action (car help-button-cache) + 'follow-link t 'help-echo "mouse-2, RET: show full information") (princ (format " minor mode (%s):\n" (if indicator diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/info-look.el --- a/lisp/info-look.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/info-look.el Thu Dec 23 16:43:51 2004 +0000 @@ -47,7 +47,7 @@ "Non-nil means pop up the Info buffer in another window." :group 'info-lookup :type 'boolean) -(defcustom info-lookup-highlight-face 'highlight +(defcustom info-lookup-highlight-face 'match "Face for highlighting looked up help items. Setting this variable to nil disables highlighting." :group 'info-lookup :type 'face) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/info.el --- a/lisp/info.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/info.el Thu Dec 23 16:43:51 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]+" diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/international/isearch-x.el --- a/lisp/international/isearch-x.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/international/isearch-x.el Thu Dec 23 16:43:51 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)) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/international/quail.el --- a/lisp/international/quail.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/international/quail.el Thu Dec 23 16:43:51 2004 +0000 @@ -1371,11 +1371,12 @@ (while quail-translating (set-buffer-modified-p modified-p) (quail-show-guidance) - (let* ((keyseq (read-key-sequence - (and input-method-use-echo-area - (concat input-method-previous-message - quail-current-str)) - nil nil t)) + (let* ((prompt (if input-method-use-echo-area + (format "%s%s %s" + (or input-method-previous-message "") + quail-current-str + quail-guidance-str))) + (keyseq (read-key-sequence prompt nil nil t)) (cmd (lookup-key (quail-translation-keymap) keyseq))) (if (if key (and (commandp cmd) (not (eq cmd 'quail-other-command))) @@ -1436,12 +1437,13 @@ quail-translating t) (quail-setup-overlays nil))) (quail-show-guidance) - (let* ((keyseq (read-key-sequence - (and input-method-use-echo-area - (concat input-method-previous-message - quail-conversion-str - quail-current-str)) - nil nil t)) + (let* ((prompt (if input-method-use-echo-area + (format "%s%s%s %s" + (or input-method-previous-message "") + quail-conversion-str + quail-current-str + quail-guidance-str))) + (keyseq (read-key-sequence prompt nil nil t)) (cmd (lookup-key (quail-conversion-keymap) keyseq))) (if (if key (commandp cmd) (eq cmd 'quail-self-insert-command)) (progn @@ -1950,10 +1952,10 @@ ;; Then, show the guidance. (when (and (quail-require-guidance-buf) + (not input-method-use-echo-area) (null unread-command-events) (null unread-post-input-method-events)) - (if (or (eq (selected-window) (minibuffer-window)) - input-method-use-echo-area) + (if (eq (selected-window) (minibuffer-window)) (if (eq (minibuffer-window) (frame-root-window)) ;; Use another frame. It is sure that we are using some ;; window system. diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/isearch.el --- a/lisp/isearch.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/isearch.el Thu Dec 23 16:43:51 2004 +0000 @@ -229,7 +229,6 @@ (while (< i 256) (define-key map (vector i) 'isearch-printing-char) (setq i (1+ i))) - (define-key map (vector i) 'isearch-printing-char) ;; To handle local bindings with meta char prefix keys, define ;; another full keymap. This must be done for any other prefix @@ -654,7 +653,7 @@ (setq ;; quit-flag nil not for isearch-mode isearch-adjusted nil isearch-yank-flag nil) - (isearch-lazy-highlight-new-loop) + (if isearch-lazy-highlight (isearch-lazy-highlight-new-loop)) ;; We must prevent the point moving to the end of composition when a ;; part of the composition has just been searched. (setq disable-point-adjustment t)) @@ -944,7 +943,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 ""))) @@ -2334,8 +2333,7 @@ "Cleanup any previous `isearch-lazy-highlight' loop and begin a new one. This happens when `isearch-update' is invoked (which can cause the search string to change or the window to scroll)." - (when (and isearch-lazy-highlight - (null executing-kbd-macro) + (when (and (null executing-kbd-macro) (sit-for 0) ;make sure (window-start) is credible (or (not (equal isearch-string isearch-lazy-highlight-last-string)) @@ -2387,59 +2385,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. diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/mail/supercite.el --- a/lisp/mail/supercite.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/mail/supercite.el Thu Dec 23 16:43:51 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))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/mouse.el --- a/lisp/mouse.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/mouse.el Thu Dec 23 16:43:51 2004 +0000 @@ -49,6 +49,39 @@ :version "21.4" :group 'mouse) +(defcustom mouse-1-click-follows-link 350 + "Non-nil means that clicking Mouse-1 on a link follows the link. + +With the default setting, an ordinary Mouse-1 click on a link +performs the same action as Mouse-2 on that link, while a longer +Mouse-1 click \(hold down the Mouse-1 button for more than 350 +milliseconds) performs the original Mouse-1 binding \(which +typically sets point where you click the mouse). + +If value is an integer, the time elapsed between pressing and +releasing the mouse button determines whether to follow the link +or perform the normal Mouse-1 action (typically set point). +The absolute numeric value specifices the maximum duration of a +\"short click\" in milliseconds. A positive value means that a +short click follows the link, and a longer click performs the +normal action. A negative value gives the opposite behaviour. + +If value is `double', a double click follows the link. + +Otherwise, a single Mouse-1 click unconditionally follows the link. + +Note that dragging the mouse never follows the link. + +This feature only works in modes that specifically identify +clickable text as links, so it may not work with some external +packages. See `mouse-on-link-p' for details." + :version "21.4" + :type '(choice (const :tag "Disabled" nil) + (const :tag "Double click" double) + (number :tag "Single click time limit" :value 350) + (other :tag "Single click" t)) + :group 'mouse) + ;; Provide a mode-specific menu on a mouse button. @@ -733,6 +766,51 @@ (run-hooks 'mouse-leave-buffer-hook) (mouse-drag-region-1 start-event)))) + +(defun mouse-on-link-p (pos) + "Return non-nil if POS is on a link in the current buffer. + +A clickable link is identified by one of the following methods: + +1) If the character at POS has a non-nil `follow-link' text or +overlay property, the value of that property is returned. + +2) If there is a local key-binding or a keybinding at position +POS for the `follow-link' event, the binding of that event +determines whether POS is inside a link: + +- If the binding is `mouse-face', POS is inside a link if there +is a non-nil `mouse-face' property at POS. Return t in this case. + +- If the binding is a function, FUNC, POS is inside a link if +the call \(FUNC POS) returns non-nil. Return the return value +from that call. + +- Otherwise, return the binding of the `follow-link' binding. + +The return value is interpreted as follows: + +- If it is a string, the mouse-1 event is translated into the +first character of the string, i.e. the action of the mouse-1 +click is the local or global binding of that character. + +- If it is a vector, the mouse-1 event is translated into the +first element of that vector, i.e. the action of the mouse-1 +click is the local or global binding of that event. + +- Otherwise, the mouse-1 event is translated into a mouse-2 event +at the same position." + (or (get-char-property pos 'follow-link) + (save-excursion + (goto-char pos) + (let ((b (key-binding [follow-link] nil t))) + (cond + ((eq b 'mouse-face) + (and (get-char-property pos 'mouse-face) t)) + ((functionp b) + (funcall b pos)) + (t b)))))) + (defun mouse-drag-region-1 (start-event) (mouse-minibuffer-check start-event) (let* ((echo-keystrokes 0) @@ -749,6 +827,7 @@ (nth 3 bounds) ;; Don't count the mode line. (1- (nth 3 bounds)))) + on-link remap-double-click (click-count (1- (event-click-count start-event)))) (setq mouse-selection-click-count click-count) (setq mouse-selection-click-count-buffer (current-buffer)) @@ -758,6 +837,13 @@ (if (< (point) start-point) (goto-char start-point)) (setq start-point (point)) + (setq on-link (and mouse-1-click-follows-link + (mouse-on-link-p start-point))) + (setq remap-double-click (and on-link + (eq mouse-1-click-follows-link 'double) + (= click-count 1))) + (if remap-double-click ;; Don't expand mouse overlay in links + (setq click-count 0)) (let ((range (mouse-start-end start-point start-point click-count))) (move-overlay mouse-drag-overlay (car range) (nth 1 range) (window-buffer start-window)) @@ -880,6 +966,28 @@ (or end-point (= (window-start start-window) start-window-start))) + (if (and on-link + (not end-point) + (consp event) + (or remap-double-click + (and + (not (eq mouse-1-click-follows-link 'double)) + (= click-count 0) + (= (event-click-count event) 1) + (not (input-pending-p)) + (or (not (integerp mouse-1-click-follows-link)) + (let ((t0 (posn-timestamp (event-start start-event))) + (t1 (posn-timestamp (event-end event)))) + (and (integerp t0) (integerp t1) + (if (> mouse-1-click-follows-link 0) + (<= (- t1 t0) mouse-1-click-follows-link) + (< (- t0 t1) mouse-1-click-follows-link))))) + (or (not double-click-time) + (sit-for 0 (if (integerp double-click-time) + double-click-time 500) t))))) + (if (or (vectorp on-link) (stringp on-link)) + (setq event (aref on-link 0)) + (setcar event 'mouse-2))) (setq unread-command-events (cons event unread-command-events))))) (delete-overlay mouse-drag-overlay))))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/net/browse-url.el --- a/lisp/net/browse-url.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/net/browse-url.el Thu Dec 23 16:43:51 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) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/net/tramp-smb.el --- a/lisp/net/tramp-smb.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/net/tramp-smb.el Thu Dec 23 16:43:51 2004 +0000 @@ -1105,9 +1105,11 @@ ;; Do `PC-do-completion' without substitution (let* (save) (fset 'save (symbol-function 'substitute-in-file-name)) - (fset 'substitute-in-file-name (symbol-function 'identity)) - ad-do-it - (fset 'substitute-in-file-name (symbol-function 'save))) + (unwind-protect + (progn + (fset 'substitute-in-file-name (symbol-function 'identity)) + ad-do-it) + (fset 'substitute-in-file-name (symbol-function 'save)))) ;; Expand "$" (let* ((beg (or (and (functionp 'minibuffer-prompt-end) ; Emacs 21 diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/net/tramp.el --- a/lisp/net/tramp.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/net/tramp.el Thu Dec 23 16:43:51 2004 +0000 @@ -34,7 +34,7 @@ ;; ;; Notes: ;; ----- -;; +;; ;; This package only works for Emacs 20 and higher, and for XEmacs 21 ;; and higher. (XEmacs 20 is missing the `with-timeout' macro. Emacs ;; 19 is reported to have other problems. For XEmacs 21, you need the @@ -205,7 +205,7 @@ gives the same backup policy for Tramp files on their hosts like the policy for local files." - :type '(repeat + :type '(repeat (list (regexp :tag "File regexp") (string :tag "Backup Dir") (set :inline t @@ -506,7 +506,7 @@ (tramp-copy-args nil) (tramp-copy-keep-date-arg "-p") (tramp-password-end-of-line "xy")) ;see docstring for "xy" - ("fcp" + ("fcp" (tramp-connection-function tramp-open-connection-rsh) (tramp-login-program "fsh") (tramp-copy-program "fcp") @@ -633,7 +633,7 @@ ("rsh" tramp-multi-connect-rlogin "rsh %h -l %u%n") ("remsh" tramp-multi-connect-rlogin "remsh %h -l %u%n") ("ssh" tramp-multi-connect-rlogin "ssh %h -l %u%n") - ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n") + ("ssht" tramp-multi-connect-rlogin "ssh %h -e none -t -t -l %u%n") ("su" tramp-multi-connect-su "su - %u%n") ("sudo" tramp-multi-connect-su "sudo -u %u -s -p Password:%n")) "*List of connection functions for multi-hop methods. @@ -777,7 +777,7 @@ "sudo" tramp-completion-function-alist-su) (tramp-set-completion-function "multi" nil) - (tramp-set-completion-function + (tramp-set-completion-function "scpx" tramp-completion-function-alist-ssh) (tramp-set-completion-function "sshx" tramp-completion-function-alist-ssh) @@ -1536,9 +1536,9 @@ rm -f /tmp/tramp.$$ }" "Shell function to implement `uudecode' to standard output. -Many systems support `uudecode -o /dev/stdout' for this or -`uudecode -o -' or `uudecode -p', but some systems don't, and for -them we have this shell function.") +Many systems support `uudecode -o /dev/stdout' or `uudecode -o -' +for this or `uudecode -p', but some systems don't, and for them +we have this shell function.") ;; Perl script to implement `file-attributes' in a Lisp `read'able ;; output. If you are hacking on this, note that you get *no* output @@ -1960,10 +1960,9 @@ (put 'with-parsed-tramp-file-name 'lisp-indent-function 2) ;; To be activated for debugging containing this macro ;; It works only when VAR is nil. Otherwise, it can be deactivated by -;; (def-edebug-spec with-parsed-tramp-file-name 0) +;; (put 'with-parsed-tramp-file-name 'edebug-form-spec 0) ;; I'm too stupid to write a precise SPEC for it. -(if (functionp 'def-edebug-spec) - (def-edebug-spec with-parsed-tramp-file-name t)) +(put 'with-parsed-tramp-file-name 'edebug-form-spec t) (defmacro tramp-let-maybe (variable value &rest body) "Let-bind VARIABLE to VALUE in BODY, but only if VARIABLE is not obsolete. @@ -2056,7 +2055,7 @@ (setq filename (tramp-file-name-localname (tramp-dissect-file-name (expand-file-name filename))))) - + ;; Right, they are on the same host, regardless of user, method, etc. ;; We now make the link on the remote machine. This will occur as the user ;; that FILENAME belongs to. @@ -2065,7 +2064,7 @@ l-multi-method l-method l-user l-host (format "cd %s && %s -sf %s %s" cwd ln - filename + filename l-localname) t))))) @@ -2347,9 +2346,9 @@ "file attributes with perl: %s" (tramp-make-tramp-file-name multi-method method user host localname)) - (tramp-maybe-send-perl-script tramp-perl-file-attributes - "tramp_file_attributes" - multi-method method user host) + (tramp-maybe-send-perl-script multi-method method user host + tramp-perl-file-attributes + "tramp_file_attributes") (tramp-send-command multi-method method user host (format "tramp_file_attributes %s %s" (tramp-shell-quote-argument localname) id-format)) @@ -2394,7 +2393,12 @@ ;; This function makes the same assumption as ;; `tramp-handle-set-visited-file-modtime'. (defun tramp-handle-verify-visited-file-modtime (buf) - "Like `verify-visited-file-modtime' for tramp files." + "Like `verify-visited-file-modtime' for tramp files. +At the time `verify-visited-file-modtime' calls this function, we +already know that the buffer is visiting a file and that +`visited-file-modtime' does not return 0. Do not call this +function directly, unless those two cases are already taken care +of." (with-current-buffer buf ;; There is no file visiting the buffer, or the buffer has no ;; recorded last modification time. @@ -2406,7 +2410,7 @@ (let* ((attr (file-attributes f)) (modtime (nth 5 attr)) (mt (visited-file-modtime))) - + (cond ;; file exists, and has a known modtime. ((and attr (not (equal modtime '(0 0)))) @@ -2689,9 +2693,9 @@ (save-excursion (setq directory (tramp-handle-expand-file-name directory)) (with-parsed-tramp-file-name directory nil - (tramp-maybe-send-perl-script tramp-perl-directory-files-and-attributes - "tramp_directory_files_and_attributes" - multi-method method user host) + (tramp-maybe-send-perl-script multi-method method user host + tramp-perl-directory-files-and-attributes + "tramp_directory_files_and_attributes") (tramp-send-command multi-method method user host (format "tramp_directory_files_and_attributes %s %s" (tramp-shell-quote-argument localname) @@ -2753,7 +2757,7 @@ (push (buffer-substring (point) (tramp-line-end-position)) result)) - + (tramp-send-command multi-method method user host "cd") (tramp-wait-for-output) @@ -3096,6 +3100,12 @@ ;; Use an asynchronous process. By this, password can be handled. (save-excursion + + ;; Check for program. + (when (and (fboundp 'executable-find) + (not (executable-find copy-program))) + (error "Cannot find copy program: %s" copy-program)) + (set-buffer trampbuf) (setq tramp-current-multi-method multi-method tramp-current-method method @@ -3170,15 +3180,15 @@ 'file-error (list "Removing old file name" "no such directory" filename))) ;; Which is better, -r or -R? (-r works for me ) - (tramp-send-command multi-method method user host + (tramp-send-command multi-method method user host (format "rm -r %s" (tramp-shell-quote-argument localname))) ;; Wait for the remote system to return to us... ;; This might take a while, allow it plenty of time. (tramp-wait-for-output 120) ;; Make sure that it worked... (and (file-exists-p filename) - (error "Failed to recusively delete %s" filename)))) - + (error "Failed to recursively delete %s" filename)))) + (defun tramp-handle-dired-call-process (program discard &rest arguments) "Like `dired-call-process' for tramp files." (with-parsed-tramp-file-name default-directory nil @@ -3200,7 +3210,7 @@ (tramp-send-command-and-check multi-method method user host nil) (tramp-send-command multi-method method user host "cd") (tramp-wait-for-output))))) - + (defun tramp-handle-dired-compress-file (file &rest ok-flag) "Like `dired-compress-file' for tramp files." ;; OK-FLAG is valid for XEmacs only, but not implemented. @@ -3568,7 +3578,7 @@ (when (and (numberp buffer) (zerop buffer)) (error "Implementation does not handle immediate return")) (when (consp buffer) (error "Implementation does not handle error files")) - (shell-command + (shell-command (mapconcat 'tramp-shell-quote-argument (cons program args) " ") @@ -4250,7 +4260,7 @@ ;; `tramp-completion-file-name-regexp-unified' aren't different. ;; If nil, `tramp-completion-run-real-handler' is called (i.e. forwarding to ;; `tramp-file-name-handler'). Otherwise, it takes `tramp-run-real-handler'. -;; Using `last-input-event' is a little bit risky, because completing a file +;; Using `last-input-event' is a little bit risky, because completing a file ;; might require loading other files, like "~/.netrc", and for them it ;; shouldn't be decided based on that variable. On the other hand, those files ;; shouldn't have partial tramp file name syntax. Maybe another variable should @@ -4354,7 +4364,7 @@ (funcall (nth 0 x) (nth 1 x))))) (tramp-get-completion-function m)) - (setq result (append result + (setq result (append result (mapcar (lambda (x) (tramp-get-completion-user-host @@ -4395,7 +4405,7 @@ ;; [nil nil "x" nil nil] ;; [nil "x" nil nil nil] -;; "/x:" "/x:y" "/x:y:" +;; "/x:" "/x:y" "/x:y:" ;; [nil nil nil "x" ""] [nil nil nil "x" "y"] [nil "x" nil "y" ""] ;; "/[x/" "/[x/y" ;; [nil "x" nil "" nil] [nil "x" nil "y" nil] @@ -4769,7 +4779,7 @@ ;;; Internal Functions: -(defun tramp-maybe-send-perl-script (script name multi-method method user host) +(defun tramp-maybe-send-perl-script (multi-method method user host script name) "Define in remote shell function NAME implemented as perl SCRIPT. Only send the definition if it has not already been done. Function may have 0-3 parameters." @@ -4864,7 +4874,7 @@ "touch" nil (current-buffer) nil "-t" touch-time file)) (pop-to-buffer (current-buffer)) (error "tramp-touch: touch failed")))))) - + (defun tramp-buffer-name (multi-method method user host) "A name for the connection buffer for USER at HOST using METHOD." (if multi-method @@ -5022,7 +5032,7 @@ (file-exists-p existing) (not (file-exists-p nonexisting)))) (error "Couldn't find command to check if file exists.")))) - + ;; CCC test ksh or bash found for tilde expansion? (defun tramp-find-shell (multi-method method user host) @@ -5121,9 +5131,9 @@ (tramp-check-ls-commands multi-method method user host "gnuls" tramp-remote-path) (tramp-check-ls-commands multi-method method user host "gls" tramp-remote-path))) -;; ------------------------------------------------------------ -;; -- Functions for establishing connection -- -;; ------------------------------------------------------------ +;; ------------------------------------------------------------ +;; -- Functions for establishing connection -- +;; ------------------------------------------------------------ ;; The following functions are actions to be taken when seeing certain ;; prompts from the remote host. See the variable @@ -5364,7 +5374,7 @@ (when multi-method (error "Cannot multi-connect using telnet connection method")) (tramp-pre-connection multi-method method user host) - (tramp-message 7 "Opening connection for %s@%s using %s..." + (tramp-message 7 "Opening connection for %s@%s using %s..." (or user (user-login-name)) host method) (let ((process-environment (copy-sequence process-environment))) (setenv "TERM" tramp-terminal-type) @@ -5398,7 +5408,7 @@ p multi-method method user host) (tramp-post-connection multi-method method user host))))) - + (defun tramp-open-connection-rsh (multi-method method user host) "Open a connection using an rsh METHOD. This starts the command `rsh HOST -l USER'[*], then waits for a remote @@ -5423,7 +5433,7 @@ (error "Cannot multi-connect using rsh connection method")) (tramp-pre-connection multi-method method user host) (if (and user (not (string= user ""))) - (tramp-message 7 "Opening connection for %s@%s using %s..." + (tramp-message 7 "Opening connection for %s@%s using %s..." user host method) (tramp-message 7 "Opening connection at %s using %s..." host method)) (let ((process-environment (copy-sequence process-environment)) @@ -5452,9 +5462,9 @@ (> emacs-major-version 20)) tramp-dos-coding-system)) (p (if (and user (not (string= user ""))) - (apply #'start-process bufnam buf login-program + (apply #'start-process bufnam buf login-program real-host "-l" user login-args) - (apply #'start-process bufnam buf login-program + (apply #'start-process bufnam buf login-program real-host login-args))) (found nil)) (tramp-set-process-query-on-exit-flag p nil) @@ -5524,10 +5534,10 @@ tramp-actions-before-shell) (tramp-open-connection-setup-interactive-shell p multi-method method user host) - (tramp-post-connection multi-method method + (tramp-post-connection multi-method method user host))))) -;; HHH: Not Changed. Multi method. It is not clear to me how this can +;; HHH: Not Changed. Multi method. It is not clear to me how this can ;; handle not giving a user name in the "file name". ;; ;; This is more difficult than for the single-hop method. In the @@ -5597,7 +5607,7 @@ (tramp-post-connection multi-method method user host))))) ;; HHH: Changed. Multi method. Don't know how to handle this in the case -;; of no user name provided. Hack to make it work as it did before: +;; of no user name provided. Hack to make it work as it did before: ;; changed `user' to `(or user (user-login-name))' in the places where ;; the value is actually used. (defun tramp-multi-connect-telnet (p method user host command) @@ -5619,8 +5629,8 @@ (tramp-process-multi-actions p method user host tramp-multi-actions))) -;; HHH: Changed. Multi method. Don't know how to handle this in the case -;; of no user name provided. Hack to make it work as it did before: +;; HHH: Changed. Multi method. Don't know how to handle this in the case +;; of no user name provided. Hack to make it work as it did before: ;; changed `user' to `(or user (user-login-name))' in the places where ;; the value is actually used. (defun tramp-multi-connect-rlogin (p method user host command) @@ -5645,8 +5655,8 @@ (tramp-process-multi-actions p method user host tramp-multi-actions))) -;; HHH: Changed. Multi method. Don't know how to handle this in the case -;; of no user name provided. Hack to make it work as it did before: +;; HHH: Changed. Multi method. Don't know how to handle this in the case +;; of no user name provided. Hack to make it work as it did before: ;; changed `user' to `(or user (user-login-name))' in the places where ;; the value is actually used. (defun tramp-multi-connect-su (p method user host command) @@ -6276,7 +6286,7 @@ (tramp-barf-if-no-shell-prompt nil 30 "Couldn't `%s', see buffer `%s'" command (buffer-name))) - + (defun tramp-wait-for-output (&optional timeout) "Wait for output from remote rsh command." (let ((proc (get-buffer-process (current-buffer))) @@ -6609,9 +6619,9 @@ "")) -;; ------------------------------------------------------------ -;; -- TRAMP file names -- -;; ------------------------------------------------------------ +;; ------------------------------------------------------------ +;; -- TRAMP file names -- +;; ------------------------------------------------------------ ;; Conversion functions between external representation and ;; internal data structure. Convenience functions for internal ;; data structure. @@ -6622,7 +6632,7 @@ "Return t iff NAME is a tramp file." (save-match-data (string-match tramp-file-name-regexp name))) - + ;; HHH: Changed. Used to assign the return value of (user-login-name) ;; to the `user' part of the structure if a user name was not ;; provided, now it assigns nil. @@ -6675,7 +6685,7 @@ If both MULTI-METHOD and METHOD are nil, do a lookup in `tramp-default-method-alist'." (or multi-method method (tramp-find-default-method user host))) - + ;; HHH: Not Changed. Multi method. Will probably not handle the case where ;; a user name is not provided in the "file name" very well. (defun tramp-dissect-multi-file-name (name) @@ -6847,7 +6857,7 @@ (if entry (second entry) (symbol-value param)))) - + ;; Auto saving to a special directory. @@ -7039,9 +7049,9 @@ process flag))) -;; ------------------------------------------------------------ -;; -- Kludges section -- -;; ------------------------------------------------------------ +;; ------------------------------------------------------------ +;; -- Kludges section -- +;; ------------------------------------------------------------ ;; Currently (as of Emacs 20.5), the function `shell-quote-argument' ;; does not deal well with newline characters. Newline is replaced by @@ -7304,7 +7314,7 @@ ;; strange when doing zerop, we should kill the process and start ;; again. (Greg Stark) ;; * Add caching for filename completion. (Greg Stark) -;; Of course, this has issues with usability (stale cache bites) +;; Of course, this has issues with usability (stale cache bites) ;; -- ;; * Provide a local cache of old versions of remote files for the rsync ;; transfer method to use. (Greg Stark) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/net/trampver.el --- a/lisp/net/trampver.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/net/trampver.el Thu Dec 23 16:43:51 2004 +0000 @@ -30,7 +30,7 @@ ;; are auto-frobbed from configure.ac, so you should edit that file and run ;; "autoconf && ./configure" to change them. -(defconst tramp-version "2.0.45" +(defconst tramp-version "2.0.46" "This version of Tramp.") (defconst tramp-bug-report-address "tramp-devel@mail.freesoftware.fsf.org" diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/pcvs-defs.el --- a/lisp/pcvs-defs.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/pcvs-defs.el Thu Dec 23 16:43:51 2004 +0000 @@ -380,6 +380,8 @@ ("+" . cvs-mode-tree) ;; mouse bindings ([mouse-2] . cvs-mode-find-file) + ([follow-link] . (lambda (pos) + (if (eq (get-char-property pos 'face) 'cvs-filename-face) t))) ([(down-mouse-3)] . cvs-menu) ;; dired-like bindings ("\C-o" . cvs-mode-display-file) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/play/zone.el --- a/lisp/play/zone.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/play/zone.el Thu Dec 23 16:43:51 2004 +0000 @@ -33,10 +33,11 @@ ;; `zone-programs'. See `zone-call' for higher-ordered zoning. ;; WARNING: Not appropriate for Emacs sessions over modems or -;; computers as slow as mine. +;; computers as slow as mine. -;; THANKS: Christopher Mayer, Scott Flinchbaugh, Rachel Kalmar, -;; Max Froumentin. +;; THANKS: Christopher Mayer, Scott Flinchbaugh, +;; Rachel Kalmar, Max Froumentin, Juri Linkov, +;; Luigi Panzeri, John Paul Wallington. ;;; Code: @@ -75,6 +76,7 @@ zone-pgm-paragraph-spaz zone-pgm-stress zone-pgm-stress-destress + zone-pgm-random-life ]) (defmacro zone-orig (&rest body) @@ -139,19 +141,28 @@ (window-start))))) (put 'zone 'orig-buffer (current-buffer)) (put 'zone 'modeline-hidden-level 0) - (set-buffer outbuf) + (switch-to-buffer outbuf) (setq mode-name "Zone") (erase-buffer) + (setq buffer-undo-list t + truncate-lines t + tab-width (zone-orig tab-width) + line-spacing (zone-orig line-spacing)) (insert text) - (switch-to-buffer outbuf) - (setq buffer-undo-list t) (untabify (point-min) (point-max)) (set-window-start (selected-window) (point-min)) (set-window-point (selected-window) wp) (sit-for 0 500) (let ((pgm (elt zone-programs (random (length zone-programs)))) - (ct (and f (frame-parameter f 'cursor-type)))) - (when ct (modify-frame-parameters f '((cursor-type . (bar . 0))))) + (ct (and f (frame-parameter f 'cursor-type))) + (restore (list '(kill-buffer outbuf)))) + (when ct + (modify-frame-parameters f '((cursor-type . (bar . 0)))) + (setq restore (cons '(modify-frame-parameters + f (list (cons 'cursor-type ct))) + restore))) + ;; Make `restore' a self-disabling one-shot thunk. + (setq restore `(lambda () ,@restore (setq restore nil))) (condition-case nil (progn (message "Zoning... (%s)" pgm) @@ -165,14 +176,17 @@ (zone-call pgm) (message "Zoning...sorry")) (error + (funcall restore) (while (not (input-pending-p)) (message (format "We were zoning when we wrote %s..." pgm)) (sit-for 3) (message "...here's hoping we didn't hose your buffer!") (sit-for 3))) - (quit (ding) (message "Zoning...sorry"))) - (when ct (modify-frame-parameters f (list (cons 'cursor-type ct))))) - (kill-buffer outbuf))) + (quit + (funcall restore) + (ding) + (message "Zoning...sorry"))) + (when restore (funcall restore))))) ;;;; Zone when idle, or not. @@ -194,13 +208,11 @@ (message "I won't zone out any more")) -;;;; zone-pgm-jitter +;;;; jittering (defun zone-shift-up () (let* ((b (point)) - (e (progn - (end-of-line) - (if (looking-at "\n") (1+ (point)) (point)))) + (e (progn (forward-line 1) (point))) (s (buffer-substring b e))) (delete-region b e) (goto-char (point-max)) @@ -208,48 +220,40 @@ (defun zone-shift-down () (goto-char (point-max)) - (forward-line -1) - (beginning-of-line) (let* ((b (point)) - (e (progn - (end-of-line) - (if (looking-at "\n") (1+ (point)) (point)))) + (e (progn (forward-line -1) (point))) (s (buffer-substring b e))) (delete-region b e) (goto-char (point-min)) (insert s))) (defun zone-shift-left () - (while (not (eobp)) - (or (eolp) - (let ((c (following-char))) - (delete-char 1) - (end-of-line) - (insert c))) - (forward-line 1))) + (let (s) + (while (not (eobp)) + (unless (eolp) + (setq s (buffer-substring (point) (1+ (point)))) + (delete-char 1) + (end-of-line) + (insert s)) + (forward-char 1)))) (defun zone-shift-right () - (while (not (eobp)) - (end-of-line) - (or (bolp) - (let ((c (preceding-char))) - (delete-backward-char 1) - (beginning-of-line) - (insert c))) - (forward-line 1))) + (goto-char (point-max)) + (end-of-line) + (let (s) + (while (not (bobp)) + (unless (bolp) + (setq s (buffer-substring (1- (point)) (point))) + (delete-char -1) + (beginning-of-line) + (insert s)) + (end-of-line 0)))) (defun zone-pgm-jitter () (let ((ops [ zone-shift-left - zone-shift-left - zone-shift-left - zone-shift-left zone-shift-right zone-shift-down - zone-shift-down - zone-shift-down - zone-shift-down - zone-shift-down zone-shift-up ])) (goto-char (point-min)) @@ -259,7 +263,7 @@ (sit-for 0 10)))) -;;;; zone-pgm-whack-chars +;;;; whacking chars (defun zone-pgm-whack-chars () (let ((tbl (copy-sequence (get 'zone-pgm-whack-chars 'wc-tbl)))) @@ -279,7 +283,7 @@ (setq i (1+ i))) tbl)) -;;;; zone-pgm-dissolve +;;;; dissolving (defun zone-remove-text () (let ((working t)) @@ -304,11 +308,11 @@ (zone-pgm-jitter)) -;;;; zone-pgm-explode +;;;; exploding (defun zone-exploding-remove () (let ((i 0)) - (while (< i 20) + (while (< i 5) (save-excursion (goto-char (point-min)) (while (not (eobp)) @@ -327,7 +331,7 @@ (zone-pgm-jitter)) -;;;; zone-pgm-putz-with-case +;;;; putzing w/ case ;; Faster than `zone-pgm-putz-with-case', but not as good: all ;; instances of the same letter have the same case, which produces a @@ -376,7 +380,7 @@ (sit-for 0 2))) -;;;; zone-pgm-rotate +;;;; rotating (defun zone-line-specs () (let (ret) @@ -438,46 +442,84 @@ (zone-pgm-rotate (lambda () (1- (- (random 3)))))) -;;;; zone-pgm-drip +;;;; dripping -(defun zone-cpos (pos) +(defsubst zone-cpos (pos) (buffer-substring pos (1+ pos))) -(defun zone-fret (pos) +(defsubst zone-replace-char (count del-count char-as-string new-value) + (delete-char (or del-count (- count))) + (aset char-as-string 0 new-value) + (dotimes (i count) (insert char-as-string))) + +(defsubst zone-park/sit-for (pos seconds) + (let ((p (point))) + (goto-char pos) + (prog1 (sit-for seconds) + (goto-char p)))) + +(defun zone-fret (wbeg pos) (let* ((case-fold-search nil) (c-string (zone-cpos pos)) + (cw-ceil (ceiling (char-width (aref c-string 0)))) (hmm (cond ((string-match "[a-z]" c-string) (upcase c-string)) ((string-match "[A-Z]" c-string) (downcase c-string)) - (t " ")))) + (t (propertize " " 'display `(space :width ,cw-ceil)))))) (do ((i 0 (1+ i)) (wait 0.5 (* wait 0.8))) ((= i 20)) (goto-char pos) (delete-char 1) (insert (if (= 0 (% i 2)) hmm c-string)) - (sit-for wait)) + (zone-park/sit-for wbeg wait)) (delete-char -1) (insert c-string))) -(defun zone-fall-through-ws (c col wend) - (let ((fall-p nil) ; todo: move outward - (wait 0.15) - (o (point)) ; for terminals w/o cursor hiding - (p (point))) - (while (progn - (forward-line 1) - (move-to-column col) - (looking-at " ")) - (setq fall-p t) - (delete-char 1) - (insert (if (< (point) wend) c " ")) - (save-excursion - (goto-char p) - (delete-char 1) - (insert " ") - (goto-char o) - (sit-for (setq wait (* wait 0.8)))) - (setq p (1- (point)))) +(defun zone-fill-out-screen (width height) + (let ((start (window-start)) + (line (make-string width 32))) + (goto-char start) + ;; fill out rectangular ws block + (while (progn (end-of-line) + (let ((cc (current-column))) + (if (< cc width) + (insert (substring line cc)) + (delete-char (- width cc))) + (cond ((eobp) (insert "\n") nil) + (t (forward-char 1) t))))) + ;; pad ws past bottom of screen + (let ((nl (- height (count-lines (point-min) (point))))) + (when (> nl 0) + (setq line (concat line "\n")) + (do ((i 0 (1+ i))) + ((= i nl)) + (insert line)))) + (goto-char start) + (recenter 0) + (sit-for 0))) + +(defun zone-fall-through-ws (c wbeg wend) + (let* ((cw-ceil (ceiling (char-width (aref c 0)))) + (spaces (make-string cw-ceil 32)) + (col (current-column)) + (wait 0.15) + newpos fall-p) + (while (when (save-excursion + (next-line 1) + (and (= col (current-column)) + (setq newpos (point)) + (string= spaces (buffer-substring-no-properties + newpos (+ newpos cw-ceil))) + (setq newpos (+ newpos (1- cw-ceil))))) + (setq fall-p t) + (delete-char 1) + (insert spaces) + (goto-char newpos) + (when (< (point) wend) + (delete-char cw-ceil) + (insert c) + (forward-char -1) + (zone-park/sit-for wbeg (setq wait (* wait 0.8)))))) fall-p)) (defun zone-pgm-drip (&optional fret-p pancake-p) @@ -485,59 +527,35 @@ (wh (window-height)) (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))))) + (fall-p nil) + wbeg wend c) + (zone-fill-out-screen ww wh) + (setq wbeg (window-start) + wend (window-end)) (catch 'done (while (not (input-pending-p)) - (goto-char (point-min)) - (sit-for 0) - (let ((wbeg (window-start)) - (wend (window-end))) - (setq mc 0) - ;; select non-ws character, but don't miss too much - (goto-char (+ wbeg (random (- wend wbeg)))) - (while (looking-at "[ \n\f]") - (if (= total (setq mc (1+ mc))) - (throw 'done 'sel) - (goto-char (+ wbeg (random (- wend wbeg)))))) - ;; character animation sequence - (let ((p (point))) - (when fret-p (zone-fret p)) - (goto-char p) - (setq fall-p (zone-fall-through-ws - (zone-cpos p) (current-column) wend)))) + (setq mc 0 wend (window-end)) + ;; select non-ws character, but don't miss too much + (goto-char (+ wbeg (random (- wend wbeg)))) + (while (looking-at "[ \n\f]") + (if (= total (setq mc (1+ mc))) + (throw 'done 'sel) + (goto-char (+ wbeg (random (- wend wbeg)))))) + ;; character animation sequence + (let ((p (point))) + (when fret-p (zone-fret wbeg p)) + (goto-char p) + (setq c (zone-cpos p) + fall-p (zone-fall-through-ws c wbeg wend))) ;; assuming current-column has not changed... (when (and pancake-p fall-p (< (count-lines (point-min) (point)) wh)) - (previous-line 1) - (forward-char 1) - (sit-for 0.137) - (delete-char -1) - (insert "@") - (sit-for 0.137) - (delete-char -1) - (insert "*") - (sit-for 0.137) - (delete-char -1) - (insert "_")))))) + (let ((cw (ceiling (char-width (aref c 0))))) + (zone-replace-char cw 1 c ?@) (zone-park/sit-for wbeg 0.137) + (zone-replace-char cw nil c ?*) (zone-park/sit-for wbeg 0.137) + (zone-replace-char cw nil c ?_))))))) (defun zone-pgm-drip-fretfully () (zone-pgm-drip t)) @@ -549,10 +567,12 @@ (zone-pgm-drip t t)) -;;;; zone-pgm-paragraph-spaz +;;;; paragraph spazzing (for textish modes) (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 +590,7 @@ (zone-pgm-rotate))) -;;;; zone-pgm-stress +;;;; stressing and destressing (defun zone-pgm-stress () (goto-char (point-min)) @@ -596,9 +616,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 +634,63 @@ 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))) + s c col) + (delete-region max (point-max)) + (while (and (progn (goto-char min) (sit-for 0.05)) + (progn (goto-char (+ min (random max))) + (or (progn (skip-chars-forward " @\n" max) + (not (= max (point)))) + (unless (or (= 0 (skip-chars-backward " @\n" min)) + (= min (point))) + (forward-char -1) + t)))) + (unless (or (eolp) (eobp)) + (setq s (zone-cpos (point)) + c (aref s 0)) + (zone-replace-char + (char-width c) + 1 s (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 ?@))))) + (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 + (if (and col (search-forward "@" max t)) + (cons (make-string (length (car col)) 32) col) + (list (mapconcat 'identity + (make-list (/ (- rtc 11) 15) + (make-string 5 ?@)) + (make-string 10 32))))))) + (life (or zone-pgm-random-life-wait (random 4))) + (kill-buffer nil)))) + + ;;;;;;;;;;;;;;; (provide 'zone) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/progmodes/compile.el --- a/lisp/progmodes/compile.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/progmodes/compile.el Thu Dec 23 16:43:51 2004 +0000 @@ -1044,6 +1044,7 @@ (defvar compilation-minor-mode-map (let ((map (make-sparse-keymap))) (define-key map [mouse-2] 'compile-goto-error) + (define-key map [follow-link] 'mouse-face) (define-key map "\C-c\C-c" 'compile-goto-error) (define-key map "\C-m" 'compile-goto-error) (define-key map "\C-c\C-k" 'kill-compilation) @@ -1073,6 +1074,7 @@ (defvar compilation-button-map (let ((map (make-sparse-keymap))) (define-key map [mouse-2] 'compile-goto-error) + (define-key map [follow-link] 'mouse-face) (define-key map "\C-m" 'compile-goto-error) map) "Keymap for compilation-message buttons.") @@ -1084,6 +1086,7 @@ ;; because that introduces a menu bar item we don't want. ;; That confuses C-down-mouse-3. (define-key map [mouse-2] 'compile-goto-error) + (define-key map [follow-link] 'mouse-face) (define-key map "\C-c\C-c" 'compile-goto-error) (define-key map "\C-m" 'compile-goto-error) (define-key map "\C-c\C-k" 'kill-compilation) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/progmodes/executable.el --- a/lisp/progmodes/executable.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/progmodes/executable.el Thu Dec 23 16:43:51 2004 +0000 @@ -199,20 +199,20 @@ (file-modes buffer-file-name))))))) +;;;###autoload (defun executable-interpret (command) "Run script with user-specified args, and collect output in a buffer. -While script runs asynchronously, you can use the \\[next-error] command -to find the next error." +While script runs asynchronously, you can use the \\[next-error] +command to find the next error. The buffer is also in `comint-mode' and +`compilation-shell-minor-mode', so that you can answer any prompts." (interactive (list (read-string "Run script: " (or executable-command buffer-file-name)))) (require 'compile) (save-some-buffers (not compilation-ask-about-save)) - (make-local-variable 'executable-command) - (compile-internal (setq executable-command command) - "No more errors." "Interpretation" - ;; Give it a simpler regexp to match. - nil executable-error-regexp-alist)) + (set (make-local-variable 'executable-command) command) + (let ((compilation-error-regexp-alist executable-error-regexp-alist)) + (compilation-start command t (lambda (x) "*interpretation*")))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/progmodes/grep.el --- a/lisp/progmodes/grep.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/progmodes/grep.el Thu Dec 23 16:43:51 2004 +0000 @@ -275,6 +275,9 @@ (defvar grep-error-face compilation-error-face "Face name to use for grep error messages.") +(defvar grep-match-face 'match + "Face name to use for grep matches.") + (defvar grep-mode-font-lock-keywords '(;; Command output lines. ("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face) @@ -291,7 +294,7 @@ (2 compilation-line-face)) ;; Highlight grep matches and delete markers ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" - (2 compilation-column-face) + (2 grep-match-face) ((lambda (p)) (progn ;; Delete markers with `replace-match' because it updates diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/progmodes/idlw-shell.el --- a/lisp/progmodes/idlw-shell.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/progmodes/idlw-shell.el Thu Dec 23 16:43:51 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) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/progmodes/idlwave.el --- a/lisp/progmodes/idlwave.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/progmodes/idlwave.el Thu Dec 23 16:43:51 2004 +0000 @@ -2571,7 +2571,9 @@ (let ((save-point (point))) (when (re-search-forward ".*&" lim t) (goto-char (match-end 0)) - (if (idlwave-quoted) (goto-char save-point))) + (if (idlwave-quoted) + (goto-char save-point) + (if (eq (char-after (- (point) 2)) ?&) (goto-char save-point)))) (point))) (defun idlwave-skip-label-or-case () diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/replace.el --- a/lisp/replace.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/replace.el Thu Dec 23 16:43:51 2004 +0000 @@ -735,16 +735,17 @@ Compatibility function for \\[next-error] invocations." (interactive "p") ;; we need to run occur-find-match from within the Occur buffer - (with-current-buffer + (with-current-buffer (if (next-error-buffer-p (current-buffer)) (current-buffer) (next-error-find-buffer nil nil (lambda() (eq major-mode 'occur-mode)))) - - (when reset - (goto-char (point-min))) + + (goto-char (cond (reset (point-min)) + ((< argp 0) (line-beginning-position)) + ((line-end-position)))) (occur-find-match - (abs (prefix-numeric-value argp)) - (if (> 0 (prefix-numeric-value argp)) + (abs argp) + (if (> 0 argp) #'previous-single-property-change #'next-single-property-change) "No more matches") @@ -752,6 +753,20 @@ (set-window-point (get-buffer-window (current-buffer)) (point)) (occur-mode-goto-occurrence))) +(defface match + '((((class color) (min-colors 88) (background light)) + :background "Tan") + (((class color) (min-colors 88) (background dark)) + :background "RoyalBlue4") + (((class color) (min-colors 8)) + :background "blue" :foreground "white") + (((type tty) (class mono)) + :inverse-video t) + (t :background "gray")) + "Face used to highlight matches permanently." + :group 'matching + :version "21.4") + (defcustom list-matching-lines-default-context-lines 0 "*Default number of context lines included around `list-matching-lines' matches. A negative number means to include that many lines before the match. @@ -761,7 +776,7 @@ (defalias 'list-matching-lines 'occur) -(defcustom list-matching-lines-face 'bold +(defcustom list-matching-lines-face 'match "*Face used by \\[list-matching-lines] to show the text that matches. If the value is nil, don't highlight the matching portions specially." :type 'face @@ -776,18 +791,22 @@ (defun occur-accumulate-lines (count &optional keep-props) (save-excursion (let ((forwardp (> count 0)) - (result nil)) + result beg end) (while (not (or (zerop count) (if forwardp (eobp) (bobp)))) (setq count (+ count (if forwardp -1 1))) + (setq beg (line-beginning-position) + end (line-end-position)) + (if (and keep-props (boundp 'jit-lock-mode) jit-lock-mode + (text-property-not-all beg end 'fontified t)) + (jit-lock-fontify-now beg end)) (push (funcall (if keep-props #'buffer-substring #'buffer-substring-no-properties) - (line-beginning-position) - (line-end-position)) + beg end) result) (forward-line (if forwardp 1 -1))) (nreverse result)))) @@ -982,14 +1001,17 @@ (when (setq endpt (re-search-forward regexp nil t)) (setq matches (1+ matches)) ;; increment match count (setq matchbeg (match-beginning 0)) - (setq begpt (save-excursion - (goto-char matchbeg) - (line-beginning-position))) (setq lines (+ lines (1- (count-lines origpt endpt)))) + (save-excursion + (goto-char matchbeg) + (setq begpt (line-beginning-position) + endpt (line-end-position))) (setq marker (make-marker)) (set-marker marker matchbeg) - (setq curstring (buffer-substring begpt - (line-end-position))) + (if (and keep-props (boundp 'jit-lock-mode) jit-lock-mode + (text-property-not-all begpt endpt 'fontified t)) + (jit-lock-fontify-now begpt endpt)) + (setq curstring (buffer-substring begpt endpt)) ;; Depropertize the string, and maybe ;; highlight the matches (let ((len (length curstring)) @@ -998,17 +1020,15 @@ (set-text-properties 0 len nil curstring)) (while (and (< start len) (string-match regexp curstring start)) - (add-text-properties (match-beginning 0) - (match-end 0) - (append - `(occur-match t) - (when match-face - ;; Use `face' rather than - ;; `font-lock-face' here - ;; so as to override faces - ;; copied from the buffer. - `(face ,match-face))) - curstring) + (add-text-properties + (match-beginning 0) (match-end 0) + (append + `(occur-match t) + (when match-face + ;; Use `face' rather than `font-lock-face' here + ;; so as to override faces copied from the buffer. + `(face ,match-face))) + curstring) (setq start (match-end 0)))) ;; Generate the string to insert for this match (let* ((out-line @@ -1019,7 +1039,10 @@ (when prefix-face `(font-lock-face prefix-face)) '(occur-prefix t))) - curstring + ;; We don't put `mouse-face' on the newline, + ;; because that loses. And don't put it + ;; on context lines to reduce flicker. + (propertize curstring 'mouse-face 'highlight) "\n")) (data (if (= nlines 0) @@ -1043,10 +1066,7 @@ (insert "-------\n")) (add-text-properties beg end - `(occur-target ,marker help-echo "mouse-2: go to this occurrence")) - ;; We don't put `mouse-face' on the newline, - ;; because that loses. - (add-text-properties beg (1- end) '(mouse-face highlight))))) + `(occur-target ,marker help-echo "mouse-2: go to this occurrence"))))) (goto-char endpt)) (if endpt (progn @@ -1214,7 +1234,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 +1301,9 @@ ;; (match-data); otherwise it is t if a match is possible at point. (match-again t) + (isearch-string isearch-string) + (isearch-regexp isearch-regexp) + (isearch-case-fold-search isearch-case-fold-search) (message (if query-flag (substitute-command-keys @@ -1313,6 +1336,12 @@ (if regexp-flag from-string (regexp-quote from-string)) "\\b"))) + (when query-replace-lazy-highlight + (setq isearch-string search-string + isearch-regexp (or delimited-flag regexp-flag) + isearch-case-fold-search case-fold-search + isearch-lazy-highlight-last-string nil)) + (push-mark) (undo-boundary) (unwind-protect @@ -1380,7 +1409,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 +1557,16 @@ (setq unread-command-events (append (listify-key-sequence key) unread-command-events)) - (setq done t)))) + (setq done t))) + (when query-replace-lazy-highlight + ;; Restore isearch data for lazy highlighting + ;; in case of isearching during recursive edit + (setq isearch-string search-string + isearch-regexp (or delimited-flag regexp-flag) + isearch-case-fold-search case-fold-search) + ;; Force lazy rehighlighting only after replacements + (if (not (memq def '(skip backup))) + (setq isearch-lazy-highlight-last-string nil)))) ;; Record previous position for ^ when we move on. ;; Change markers to numbers in the match data ;; since lots of markers slow down editing. @@ -1564,26 +1602,44 @@ (and keep-going stack))) (defcustom query-replace-highlight t - "*Non-nil means to highlight words during query replacement." + "*Non-nil means to highlight matches during query replacement." :type 'boolean :group 'matching) +(defcustom query-replace-lazy-highlight t + "*Controls the lazy-highlighting during query replacements. +When non-nil, all text in the buffer matching the current match +is highlighted lazily using isearch lazy highlighting (see +`isearch-lazy-highlight-initial-delay' and +`isearch-lazy-highlight-interval')." + :type 'boolean + :group 'matching + :version "21.4") + +(defface query-replace + '((t (:inherit isearch))) + "Face for highlighting query replacement matches." + :group 'matching + :version "21.4") + (defvar replace-overlay nil) -(defun replace-dehighlight () - (and replace-overlay - (progn - (delete-overlay replace-overlay) - (setq replace-overlay nil)))) +(defun replace-highlight (beg end) + (if query-replace-highlight + (if replace-overlay + (move-overlay replace-overlay beg end (current-buffer)) + (setq replace-overlay (make-overlay beg end)) + (overlay-put replace-overlay 'priority 1) ;higher than lazy overlays + (overlay-put replace-overlay 'face 'query-replace))) + (if query-replace-lazy-highlight + (isearch-lazy-highlight-new-loop))) -(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))))) +(defun replace-dehighlight () + (when replace-overlay + (delete-overlay replace-overlay)) + (when query-replace-lazy-highlight + (isearch-lazy-highlight-cleanup isearch-lazy-highlight-cleanup) + (setq isearch-lazy-highlight-last-string nil))) ;; arch-tag: 16b4cd61-fd40-497b-b86f-b667c4cf88e4 ;;; replace.el ends here diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/simple.el --- a/lisp/simple.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/simple.el Thu Dec 23 16:43:51 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 @@ -645,9 +645,6 @@ (skip-chars-forward " \t") (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.") - (defun beginning-of-buffer (&optional arg) "Move point to the beginning of the buffer; leave mark at previous position. With \\[universal-argument] prefix, do not set mark at previous position. @@ -659,8 +656,9 @@ 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 (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 +681,9 @@ 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 (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) @@ -1485,6 +1484,17 @@ (t '(0 . 0))) '(0 . 0))) + +;; When the first undo batch in an undo list is longer than undo-outer-limit, +;; this function gets called to ask the user what to do. +;; Garbage collection is inhibited around the call, +;; so it had better not do a lot of consing. +(setq undo-outer-limit-function 'undo-outer-limit-truncate) +(defun undo-outer-limit-truncate (size) + (if (yes-or-no-p (format "Buffer %s undo info is %d bytes long; discard it? " + (buffer-name) size)) + (progn (setq buffer-undo-list nil) t) + nil)) (defvar shell-command-history nil "History list for some commands that read shell commands.") @@ -2991,11 +3001,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 () @@ -3246,7 +3256,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)) @@ -3527,12 +3537,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)) @@ -3541,7 +3556,7 @@ (t (push-mark (save-excursion - (forward-word arg) + (forward-word (prefix-numeric-value arg)) (point)) nil t)))) @@ -4025,8 +4040,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)) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/subr.el --- a/lisp/subr.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/subr.el Thu Dec 23 16:43:51 2004 +0000 @@ -1874,6 +1874,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 diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/term.el --- a/lisp/term.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/term.el Thu Dec 23 16:43:51 2004 +0000 @@ -1402,7 +1402,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") @@ -2893,6 +2893,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. @@ -3020,13 +3024,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)) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/term/mac-win.el --- a/lisp/term/mac-win.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/term/mac-win.el Thu Dec 23 16:43:51 2004 +0000 @@ -199,7 +199,7 @@ (let ((encoding-vector (make-vector 256 nil)) (i 0) - (vec ;; mac-centraleuropean (128..255) -> UCS mapping + (vec ;; mac-centraleurroman (128..255) -> UCS mapping [ #x00C4 ;; 128:LATIN CAPITAL LETTER A WITH DIAERESIS #x0100 ;; 129:LATIN CAPITAL LETTER A WITH MACRON #x0101 ;; 130:LATIN SMALL LETTER A WITH MACRON @@ -339,8 +339,8 @@ (setq i (1+ i))) (setq translation-table (make-translation-table-from-vector encoding-vector)) -;; (define-translation-table 'mac-centraleuropean-decoder translation-table) - (define-translation-table 'mac-centraleuropean-encoder +;; (define-translation-table 'mac-centraleurroman-decoder translation-table) + (define-translation-table 'mac-centraleurroman-encoder (char-table-extra-slot translation-table 0))) (let @@ -493,8 +493,8 @@ (defvar mac-font-encoder-list '(("mac-roman" mac-roman-encoder ccl-encode-mac-roman-font "%s") - ("mac-centraleuropean" mac-centraleuropean-encoder - ccl-encode-mac-centraleuropean-font "%s ce") + ("mac-centraleurroman" mac-centraleurroman-encoder + ccl-encode-mac-centraleurroman-font "%s ce") ("mac-cyrillic" mac-cyrillic-encoder ccl-encode-mac-cyrillic-font "%s cy"))) @@ -515,15 +515,15 @@ (if mac-encoded (aset table c mac-encoded)))))))) -(define-ccl-program ccl-encode-mac-centraleuropean-font +(define-ccl-program ccl-encode-mac-centraleurroman-font `(0 (if (r0 != ,(charset-id 'ascii)) (if (r0 <= ?\x8f) - (translate-character mac-centraleuropean-encoder r0 r1) + (translate-character mac-centraleurroman-encoder r0 r1) ((r1 <<= 7) (r1 |= r2) - (translate-character mac-centraleuropean-encoder r0 r1))))) - "CCL program for Mac Central European font") + (translate-character mac-centraleurroman-encoder r0 r1))))) + "CCL program for Mac Central European Roman font") (define-ccl-program ccl-encode-mac-cyrillic-font `(0 diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/textmodes/ispell.el --- a/lisp/textmodes/ispell.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/textmodes/ispell.el Thu Dec 23 16:43:51 2004 +0000 @@ -1975,7 +1975,7 @@ (sit-for 5) (kill-buffer "*Ispell Help*")) (unwind-protect - (progn + (let ((resize-mini-windows 'grow-only)) (select-window (minibuffer-window)) (erase-buffer) (message nil) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/textmodes/paragraphs.el --- a/lisp/textmodes/paragraphs.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/textmodes/paragraphs.el Thu Dec 23 16:43:51 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)) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/textmodes/tex-mode.el --- a/lisp/textmodes/tex-mode.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/textmodes/tex-mode.el Thu Dec 23 16:43:51 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)))))))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/tooltip.el --- a/lisp/tooltip.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/tooltip.el Thu Dec 23 16:43:51 2004 +0000 @@ -1,6 +1,7 @@ ;;; tooltip.el --- show tooltip windows -;; Copyright (C) 1997, 1999, 2000, 2001, 2004 Free Software Foundation, Inc. +;; Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004 +;; Free Software Foundation, Inc. ;; Author: Gerd Moellmann ;; Keywords: help c mouse tools @@ -476,7 +477,25 @@ (defun tooltip-show-help-function (msg) "Function installed as `show-help-function'. MSG is either a help string to display, or nil to cancel the display." - (let ((previous-help tooltip-help-message)) + (let ((previous-help tooltip-help-message) + mp pos) + (if (and mouse-1-click-follows-link + (stringp msg) + (save-match-data + (string-match "^mouse-2" msg)) + (setq mp (mouse-pixel-position)) + (consp (setq pos (cdr mp))) + (setq pos (posn-at-x-y (car pos) (cdr pos) (car mp))) + (windowp (posn-window pos))) + (with-current-buffer (window-buffer (posn-window pos)) + (if (mouse-on-link-p (posn-point pos)) + (setq msg (concat + (cond + ((eq mouse-1-click-follows-link 'double) "double-") + ((and (integerp mouse-1-click-follows-link) + (< mouse-1-click-follows-link 0)) "Long ") + (t "")) + "mouse-1" (substring msg 7)))))) (setq tooltip-help-message msg) (cond ((null msg) ;; Cancel display. This also cancels a delayed tip, if diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/url/ChangeLog --- a/lisp/url/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/url/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,3 +1,7 @@ +2004-12-11 Stefan Monnier + + * url-handlers.el: Don't `require' everything eagerly. + 2004-11-30 Paul Pogonyshev * url-http.el (url-http-handle-cookies): Bind `url-current-object' @@ -18,8 +22,7 @@ 2004-11-12 Masatake YAMATO - * 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 @@ -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. diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/url/url-handlers.el --- a/lisp/url/url-handlers.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/url/url-handlers.el Thu Dec 23 16:43:51 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)) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/vc-svn.el --- a/lisp/vc-svn.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/vc-svn.el Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/vc.el --- a/lisp/vc.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/vc.el Thu Dec 23 16:43:51 2004 +0000 @@ -2836,7 +2836,7 @@ (pop-to-buffer (set-buffer (get-buffer-create "*vc*"))) (erase-buffer) - (insert-file tempfile) + (insert-file-contents tempfile) "failed")) (setq default-directory (file-name-directory changelog)) (delete-file tempfile))))) diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/wid-edit.el --- a/lisp/wid-edit.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/wid-edit.el Thu Dec 23 16:43:51 2004 +0000 @@ -327,6 +327,7 @@ (let ((keymap (widget-get widget :keymap)) (face (or (widget-get widget :value-face) 'widget-field-face)) (help-echo (widget-get widget :help-echo)) + (follow-link (widget-get widget :follow-link)) (rear-sticky (or (not widget-field-add-space) (widget-get widget :size)))) (if (functionp help-echo) @@ -345,6 +346,7 @@ ;; works in the field when, say, Custom uses `suppress-keymap'. (overlay-put overlay 'local-map keymap) (overlay-put overlay 'face face) + (overlay-put overlay 'follow-link follow-link) (overlay-put overlay 'help-echo help-echo)) (setq to (1- to)) (setq rear-sticky t)) @@ -354,6 +356,7 @@ (overlay-put overlay 'field widget) (overlay-put overlay 'local-map keymap) (overlay-put overlay 'face face) + (overlay-put overlay 'follow-link follow-link) (overlay-put overlay 'help-echo help-echo))) (widget-specify-secret widget)) @@ -378,6 +381,7 @@ (defun widget-specify-button (widget from to) "Specify button for WIDGET between FROM and TO." (let ((overlay (make-overlay from to nil t nil)) + (follow-link (widget-get widget :follow-link)) (help-echo (widget-get widget :help-echo))) (widget-put widget :button-overlay overlay) (if (functionp help-echo) @@ -389,6 +393,7 @@ (unless (widget-get widget :suppress-face) (overlay-put overlay 'face (widget-apply widget :button-face-get))) (overlay-put overlay 'pointer 'hand) + (overlay-put overlay 'follow-link follow-link) (overlay-put overlay 'help-echo help-echo))) (defun widget-mouse-help (window overlay point) @@ -1705,6 +1710,7 @@ "An embedded link." :button-prefix 'widget-link-prefix :button-suffix 'widget-link-suffix + :follow-link "\C-m" :help-echo "Follow the link." :format "%[%t%]") diff -r 6b379caca6fa -r 4ee39d9428b0 lisp/xml.el --- a/lisp/xml.el Fri Dec 10 15:24:54 2004 +0000 +++ b/lisp/xml.el Thu Dec 23 16:43:51 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)+ diff -r 6b379caca6fa -r 4ee39d9428b0 lispref/ChangeLog --- a/lispref/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/lispref/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,3 +1,26 @@ +2004-12-21 Richard M. Stallman + + * commands.texi (Event Input Misc): Add while-no-input. + +2004-12-11 Richard M. Stallman + + * display.texi (Line Height): Rewrite text for clarity. + +2004-12-11 Kim F. Storm + + * 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 * frames.texi (Window Frame Parameters): New @defvar for `line-spacing'. diff -r 6b379caca6fa -r 4ee39d9428b0 lispref/commands.texi --- a/lispref/commands.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/lispref/commands.texi Thu Dec 23 16:43:51 2004 +0000 @@ -2388,6 +2388,18 @@ Emacs version 18. @end defvar +@defmac while-no-input body... +This construct runs the @var{body} forms and returns the value +of the last one---but only if no input arrives. If any input +arrives during the execution of the @var{body} forms, it aborts +them (working much like a quit), and the @code{while-no-input} +form returns @code{nil}. + +If a part of @var{body} binds @code{inhibit-quit} to non-@code{nil}, +arrival of input during those parts won't cause an abort until +the end of that part. +@end defmac + @defun discard-input @cindex flush input @cindex discard input diff -r 6b379caca6fa -r 4ee39d9428b0 lispref/display.texi --- a/lispref/display.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/lispref/display.texi Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 lispref/frames.texi --- a/lispref/frames.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/lispref/frames.texi Thu Dec 23 16:43:51 2004 +0000 @@ -605,25 +605,6 @@ @end ignore @end table -@defvar line-spacing -When this permanently buffer-local variable is non-nil, if its value is -an integer, that many pixels of extra space are put below each line. If -the value is a floating point number, compute the spacing by multiplying -the value by the default frame line height. - -Note that this variable and the frame parameter @code{line-spacing} -(described above) control different things. The frame parameter is -involved in setting the frame line height (@pxref{Creating Frames}), -while the buffer-local variable is for already-created frames. - -For example, if the frame parameter is nil, a variable value of 1.0 -``double-spaces'' the display because for every line of text, there is -an additional full line of space put below it. Likewise, a value of 2.0 -``triple-spaces'' the display, and so forth. If, on the other hand, the -frame parameter is 10, a variable value of 10 would effectively put 20 -pixels of space under the text. -@end defvar - @defvar blink-cursor-alist This variable specifies how to blink the cursor. Each element has the form @code{(@var{on-state} . @var{off-state})}. Whenever the cursor diff -r 6b379caca6fa -r 4ee39d9428b0 lispref/locals.texi --- a/lispref/locals.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/lispref/locals.texi Thu Dec 23 16:43:51 2004 +0000 @@ -132,7 +132,7 @@ @xref{Display Margins}. @item line-spacing -@xref{Window Frame Parameters}. +@xref{Line Height}. @item local-abbrev-table @xref{Abbrevs}. @@ -198,7 +198,7 @@ @xref{Mode Line Variables}. @item vertical-scroll-bar -@xref{Yet to be written}. +@xref{Scroll Bars}. @end table @ignore diff -r 6b379caca6fa -r 4ee39d9428b0 lispref/text.texi --- a/lispref/text.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/lispref/text.texi Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 man/ChangeLog --- a/man/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/man/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,3 +1,57 @@ +2004-12-20 Jay Belanger + + * calc.texi (Types Tutorial): Emphasized that you can't divide by + zero. + +2004-12-17 Luc Teirlinck + + * cc-mode.texi (Text Filling and Line Breaking): Put period after + @xref. + (Font Locking): Avoid @strong{Note:}. + +2004-12-17 Michael Albinus + + Sync with Tramp 2.0.46. + + * tramp.texi (bottom): Add arch-tag. It was lost, somehow. + +2004-12-16 Luc Teirlinck + + * url.texi: Correct typos. + (Retrieving URLs): @var{nil}->@code{nil}. + (HTTP language/coding, mailto): Replace "GNU Emacs Manual" with + the standard "The GNU Emacs Manual" in fifth argument of @xref's. + (Dealing with HTTP documents): @inforef->@xref. + +2004-12-15 Juri Linkov + + * mark.texi (Transient Mark, Mark Ring): M-< and other + movement commands don't set mark in Transient Mark mode + if mark is active. + +2004-12-15 Jay Belanger + + * calc.texi: Consistently capitalized all mode names. + (Answers to Exercises): Mention that an answer can be a fraction + when in Fraction mode. + +2004-12-13 Jay Belanger + + * calc.texi: Fix some TeX definitions. + +2004-12-12 Juri Linkov + + * 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 + + * mark.texi (Marking Objects): Marking commands also extend the + region when mark is active in Transient Mark mode. + 2004-12-09 Luc Teirlinck * reftex.texi (Imprint): Remove erroneous @value's. @@ -133,6 +187,13 @@ to Alex Ott, Karl Fogel, Stefan Monnier, and David Kastrup for suggestions. +2004-12-08 Reiner Steib + + * 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 * message.texi (Various Message Variables): Mention that all mail @@ -140,11 +201,6 @@ * gnus.texi (Splitting Mail): Clarify bogus group. -2004-11-16 Reiner Steib - - * gnus.texi (Filtering Spam Using The Spam ELisp Package): Index - `spam-initialize'. - 2004-11-02 Katsumi Yamaoka * emacs-mime.texi (Encoding Customization): Fix diff -r 6b379caca6fa -r 4ee39d9428b0 man/calc.texi --- a/man/calc.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/calc.texi Thu Dec 23 16:43:51 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 @@ -470,7 +463,7 @@ Moving data to and from regular editing buffers. @item -``Embedded mode'' for manipulating Calc formulas and data directly +Embedded mode for manipulating Calc formulas and data directly inside any editing buffer. @item @@ -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 @@ -773,7 +766,7 @@ @noindent Calc has several user interfaces that are specialized for different kinds of tasks. As well as Calc's standard interface, -there are Quick Mode, Keypad Mode, and Embedded Mode. +there are Quick mode, Keypad mode, and Embedded mode. @menu * Starting Calc:: @@ -808,7 +801,7 @@ want to use. To get Calc's standard interface, type @kbd{M-# c}. To get -Keypad Mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief +Keypad mode, type @kbd{M-# k}. Type @kbd{M-# ?} to get a brief list of the available options, and type a second @kbd{?} to get a complete list. @@ -821,7 +814,7 @@ If @kbd{M-#} doesn't work for you, you can always type explicit commands like @kbd{M-x calc} (for the standard user interface) or -@w{@kbd{M-x calc-keypad}} (for Keypad Mode). First type @kbd{M-x} +@w{@kbd{M-x calc-keypad}} (for Keypad mode). First type @kbd{M-x} (that's Meta with the letter @kbd{x}), then, at the prompt, type the full command (like @kbd{calc-keypad}) and press Return. @@ -867,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 @@ -924,20 +917,20 @@ @subsection Quick Mode (Overview) @noindent -@dfn{Quick Mode} is a quick way to use Calc when you don't need the +@dfn{Quick mode} is a quick way to use Calc when you don't need the full complexity of the stack and trail. To use it, type @kbd{M-# q} (@code{quick-calc}) in any regular editing buffer. -Quick Mode is very simple: It prompts you to type any formula in +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 will also be in the Emacs ``kill ring'' so that a @kbd{C-y} command at this point will yank the result into your editing buffer. -Calc mode settings affect Quick Mode, too, though you will have to +Calc mode settings affect Quick mode, too, though you will have to go into regular Calc (with @kbd{M-# c}) to change the mode settings. @c [fix-ref Quick Calculator mode] @@ -947,12 +940,12 @@ @subsection Keypad Mode (Overview) @noindent -@dfn{Keypad Mode} is a mouse-based interface to the Calculator. +@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 +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). -Type @kbd{M-# k} to turn Keypad Mode on or off. Once again you +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 instead of at the bottom. The upper window is the familiar Calc Stack; the lower window is a picture of a typical calculator keypad. @@ -988,12 +981,12 @@ |-----+-----+-----+-----+-----+ @end smallexample -Keypad Mode is much easier for beginners to learn, because there +Keypad mode is much easier for beginners to learn, because there is no need to memorize lots of obscure key sequences. But not all commands in regular Calc are available on the Keypad. You can always switch the cursor into the Calc stack window to use standard Calc commands if you need. Serious Calc users, though, -often find they prefer the standard interface over Keypad Mode. +often find they prefer the standard interface over Keypad mode. To operate the Calculator, just click on the ``buttons'' of the keypad using your left mouse button. To enter the two numbers @@ -1006,13 +999,13 @@ math functions, vector operations, and operations on binary numbers. -Because Keypad Mode doesn't use the regular keyboard, Calc leaves +Because Keypad mode doesn't use the regular keyboard, Calc leaves the cursor in your original editing buffer. You can type in this buffer in the usual way while also clicking on the Calculator -keypad. One advantage of Keypad Mode is that you don't need an +keypad. One advantage of Keypad mode is that you don't need an explicit command to switch between editing and calculating. -If you press @kbd{M-# b} first, you get a full-screen Keypad Mode +If you press @kbd{M-# b} first, you get a full-screen Keypad mode (@code{full-calc-keypad}) with three windows: The keypad in the lower left, the stack in the lower right, and the trail on top. @@ -1050,7 +1043,7 @@ @subsection Embedded Mode (Overview) @noindent -@dfn{Embedded Mode} is a way to use Calc directly from inside an +@dfn{Embedded mode} is a way to use Calc directly from inside an editing buffer. Suppose you have a formula written as part of a document like this: @@ -1067,7 +1060,7 @@ @noindent and you wish to have Calc compute and format the derivative for you and store this derivative in the buffer automatically. To -do this with Embedded Mode, first copy the formula down to where +do this with Embedded mode, first copy the formula down to where you want the result to be: @smallexample @@ -1106,7 +1099,7 @@ @end smallexample To make this look nicer, you might want to press @kbd{d =} to center -the formula, and even @kbd{d B} to use ``big'' display mode. +the formula, and even @kbd{d B} to use Big display mode. @smallexample @group @@ -1146,7 +1139,7 @@ @end group @end smallexample -To leave Embedded Mode, type @kbd{M-# e} again. The mode line +To leave Embedded mode, type @kbd{M-# e} again. The mode line and keyboard will revert to the way they were before. (If you have actually been trying this as you read along, you'll want to press @kbd{M-# 0} [with the digit zero] now to reset the modes you changed.) @@ -1161,7 +1154,7 @@ @end smallexample Place the cursor on the @samp{1}, then type @kbd{M-# w} to enable -Embedded Mode on that number. Now type @kbd{3 /} (to get one-third), +Embedded mode on that number. Now type @kbd{3 /} (to get one-third), and @kbd{I T} (the Inverse Tangent converts a slope into an angle), then @w{@kbd{M-# w}} again to exit Embedded mode. @@ -1228,7 +1221,7 @@ Control whether @kbd{M-# c} and @kbd{M-# k} use the full screen. @item Q -Use Quick Mode for a single short calculation. +Use Quick mode for a single short calculation. @item K Turn Calc Keypad mode on or off. @@ -1277,7 +1270,7 @@ @end iftex @noindent -Commands for use with Embedded Mode: +Commands for use with Embedded mode: @table @kbd @item A @@ -1343,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 @@ -1485,9 +1478,9 @@ @c [fix-ref Embedded Mode] This tutorial describes the standard user interface of Calc only. -The ``Quick Mode'' and ``Keypad Mode'' interfaces are fairly +The Quick mode and Keypad mode interfaces are fairly self-explanatory. @xref{Embedded Mode}, for a description of -the ``Embedded Mode'' interface. +the Embedded mode interface. @ifinfo The easiest way to read this tutorial on-line is to have two windows on @@ -1665,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{}) @@ -1947,8 +1940,8 @@ @noindent If you are not used to RPN notation, you may prefer to operate the -Calculator in ``algebraic mode,'' which is closer to the way -non-RPN calculators work. In algebraic mode, you enter formulas +Calculator in Algebraic mode, which is closer to the way +non-RPN calculators work. In Algebraic mode, you enter formulas in traditional @expr{2+3} notation. You don't really need any special ``mode'' to enter algebraic formulas. @@ -2000,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 @@ -2009,18 +2002,18 @@ 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 -``algebraic mode'' you can select in which Calc automatically senses +If you tire of typing the apostrophe all the time, there is +Algebraic mode, where Calc automatically senses when you are about to type an algebraic expression. To enter this mode, press the two letters @w{@kbd{m a}}. (An @samp{Alg} indicator should appear in the Calc window's mode line.) Press @kbd{m a}, then @kbd{2+3+4} with no apostrophe, then @key{RET}. -In algebraic mode, when you press any key that would normally begin +In Algebraic mode, when you press any key that would normally begin entering a number (such as a digit, a decimal point, or the @kbd{_} key), or if you press @kbd{(} or @kbd{[}, Calc automatically begins an algebraic entry. @@ -2035,7 +2028,7 @@ be @expr{0.16227766017}. Note that if the formula begins with a function name, you need to use -the apostrophe even if you are in algebraic mode. If you type @kbd{arcsin} +the apostrophe even if you are in Algebraic mode. If you type @kbd{arcsin} out of the blue, the @kbd{a r} will be taken as an Algebraic Rewrite command, and the @kbd{csin} will be taken as the name of the rewrite rule to use! @@ -2044,7 +2037,7 @@ form because they find RPN entry with incomplete objects to be too distracting, even though they otherwise use Calc as an RPN calculator. -Still in algebraic mode, type: +Still in Algebraic mode, type: @smallexample @group @@ -2060,15 +2053,15 @@ an apostrophe first, but it also means we need to press @key{RET} after every entry, even for a simple number like @expr{1}. -(You can type @kbd{C-u m a} to enable a special ``incomplete algebraic -mode'' in which the @kbd{(} and @kbd{[} keys use algebraic entry even +(You can type @kbd{C-u m a} to enable a special Incomplete Algebraic +mode in which the @kbd{(} and @kbd{[} keys use algebraic entry even though regular numeric keys still use RPN numeric entry. There is also -a ``total algebraic mode,'' started by typing @kbd{m t}, in which all +Total Algebraic mode, started by typing @kbd{m t}, in which all normal keys begin algebraic entry. You must then use the @key{META} key -to type Calc commands: @kbd{M-m t} to get back out of total algebraic +to type Calc commands: @kbd{M-m t} to get back out of Total Algebraic mode, @kbd{M-q} to quit, etc.) -If you're still in algebraic mode, press @kbd{m a} again to turn it off. +If you're still in Algebraic mode, press @kbd{m a} again to turn it off. Actual non-RPN calculators use a mixture of algebraic and RPN styles. In general, operators of two numbers (like @kbd{+} and @kbd{*}) @@ -2079,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. @@ -2383,7 +2376,7 @@ @noindent Calc has many types of @dfn{modes} that affect the way it interprets your commands or the way it displays data. We have already seen one -mode, namely algebraic mode. There are many others, too; we'll +mode, namely Algebraic mode. There are many others, too; we'll try some of the most common ones here. Perhaps the most fundamental mode in Calc is the current @dfn{precision}. @@ -2741,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 @@ -2786,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. @@ -2802,7 +2795,7 @@ @end group @end smallexample -Another interesting mode is @dfn{fraction mode}. Normally, +Another interesting mode is @dfn{Fraction mode}. Normally, dividing two integers produces a floating-point result if the quotient can't be expressed as an exact integer. Fraction mode causes integer division to produce a fraction, i.e., a rational @@ -2826,7 +2819,7 @@ (Calc uses @kbd{:} instead of @kbd{/} as the fraction separator because @kbd{/} is already used to divide the top two stack elements.) Calculations involving fractions will always -produce exact fractional results; fraction mode only says +produce exact fractional results; Fraction mode only says what to do when dividing two integers. @cindex Fractions vs. floats @@ -2837,7 +2830,7 @@ Typing @kbd{m f} doesn't change any existing values in the stack. In the above example, we had to Undo the division and do it over -again when we changed to fraction mode. But if you use the +again when we changed to Fraction mode. But if you use the evaluates-to operator you can get commands like @kbd{m f} to recompute for you. @@ -2853,7 +2846,7 @@ @noindent In this example, the righthand side of the @samp{=>} operator on the stack is recomputed when we change the precision, then -again when we change to fraction mode. All @samp{=>} expressions +again when we change to Fraction mode. All @samp{=>} expressions on the stack are recomputed every time you change any mode that might affect their values. @@ -2974,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 @@ -2997,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 @@ -3012,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 @@ -3060,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. @@ -3167,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). @@ -3184,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 @@ -3475,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]}. @@ -3626,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]}. @@ -3678,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'' @@ -3774,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{}) @@ -3978,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 @@ -4083,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. @@ -4336,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 @@ -4348,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} @@ -4364,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. @@ -4383,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{}) @@ -4418,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. @@ -4497,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. @@ -4522,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 @@ -4537,7 +4530,7 @@ Dividing by zero is normally treated as an error, but you can get Calc to write an answer in terms of infinity by pressing @kbd{m i} -to turn on ``infinite mode.'' +to turn on Infinite mode. @smallexample @group @@ -4686,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 @@ -4764,10 +4757,11 @@ @end smallexample @noindent -In this last step, Calc has found a new number which, when multiplied -by 5 modulo 24, produces the original number, 21. If @var{m} is prime -it is always possible to find such a number. For non-prime @var{m} -like 24, it is only sometimes possible. +In this last step, Calc has divided by 5 modulo 24; i.e., it has found a +new number which, when multiplied by 5 modulo 24, produces the original +number, 21. If @var{m} is prime and the divisor is not a multiple of +@var{m}, it is always possible to find such a number. For non-prime +@var{m} like 24, it is only sometimes possible. @smallexample @group @@ -4786,7 +4780,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 @@ -4814,7 +4808,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{}) @@ -4967,7 +4961,7 @@ @subsection Basic Algebra @noindent -If you enter a formula in algebraic mode that refers to variables, +If you enter a formula in Algebraic mode that refers to variables, the formula itself is pushed onto the stack. You can manipulate formulas as regular data objects. @@ -5121,7 +5115,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. @@ -5188,7 +5182,7 @@ multiple; choose the solution where the leading coefficient is one.) @xref{Algebra Answer 2, 2}. (@bullet{}) -The @kbd{m s} command enables ``symbolic mode,'' in which formulas +The @kbd{m s} command enables Symbolic mode, in which formulas like @samp{sqrt(5)} that can't be evaluated exactly are left in symbolic form rather than giving a floating-point approximate answer. Fraction mode (@kbd{m f}) is also useful when doing algebra. @@ -5203,7 +5197,7 @@ @end group @end smallexample -One more mode that makes reading formulas easier is ``Big mode.'' +One more mode that makes reading formulas easier is Big mode. @smallexample @group @@ -5291,7 +5285,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, @@ -5300,7 +5294,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 @@ -5351,7 +5345,7 @@ @noindent (If you got wildly different results, did you remember to switch -to radians mode?) +to Radians mode?) Here we have divided the curve into ten segments of equal width; approximating these segments as rectangular boxes (i.e., assuming @@ -5442,7 +5436,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{}) @@ -5607,7 +5601,7 @@ another good reason to store your rules in variables rather than entering them on the fly. -(@bullet{}) @strong{Exercise 1.} Type @kbd{m s} to get symbolic +(@bullet{}) @strong{Exercise 1.} Type @kbd{m s} to get Symbolic mode, then enter the formula @samp{@w{(2 + sqrt(2))} / @w{(1 + sqrt(2))}}. Using a rewrite rule, simplify this formula by multiplying both sides by the conjugate @w{@samp{1 - sqrt(2)}}. The result will have @@ -5866,11 +5860,11 @@ @xref{Rewrites Answer 5, 5}. (@bullet{}) (@bullet{}) @strong{Exercise 6.} Calc considers the form @expr{0^0} -to be ``indeterminate,'' and leaves it unevaluated (assuming infinite +to be ``indeterminate,'' and leaves it unevaluated (assuming Infinite mode is not enabled). Some people prefer to define @expr{0^0 = 1}, so that the identity @expr{x^0 = 1} can safely be used for all @expr{x}. Find a way to make Calc follow this convention. What happens if you -now type @kbd{m i} to turn on infinite mode? +now type @kbd{m i} to turn on Infinite mode? @xref{Rewrites Answer 6, 6}. (@bullet{}) (@bullet{}) @strong{Exercise 7.} A Taylor series for a function is an @@ -5988,7 +5982,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 @@ -6066,7 +6060,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. @@ -6132,13 +6126,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.) @@ -6155,17 +6149,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{}) @@ -6265,7 +6259,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 @@ -6439,14 +6433,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 @@ -6456,10 +6450,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 @@ -6478,7 +6472,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 @@ -6486,27 +6480,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.) @@ -6683,18 +6677,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 @@ -6845,7 +6839,7 @@ times anything is zero.'' @c [fix-ref Infinities] -The @kbd{m i} command enables an @dfn{infinite mode} in which @expr{1 / 0} +The @kbd{m i} command enables an @dfn{Infinite mode} in which @expr{1 / 0} results in a special symbol that represents ``infinity.'' If you multiply infinity by zero, Calc uses another special new symbol to show that the answer is ``indeterminate.'' @xref{Infinities}, for @@ -7003,13 +6997,13 @@ 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. Here are two solutions: Raise the precision enough that the floating-point round-off error is strictly to the right of the -decimal point. Or, convert to fraction mode so that @expr{123456789 / 2} +decimal point. Or, convert to Fraction mode so that @expr{123456789 / 2} produces the exact fraction @expr{123456789:2}, which can be rounded down by the @kbd{F} command without ever switching to floating-point format. @@ -7022,9 +7016,9 @@ does a floating-point calculation instead and produces @expr{1.5}. Calc will find an exact result for a logarithm if the result is an integer -or the reciprocal of an integer. But there is no efficient way to search -the space of all possible rational numbers for an exact answer, so Calc -doesn't try. +or (when in Fraction mode) the reciprocal of an integer. But there is +no efficient way to search the space of all possible rational numbers +for an exact answer, so Calc doesn't try. @node Vector Answer 1, Vector Answer 2, Arithmetic Answer 2, Answers to Exercises @subsection Vector Tutorial Exercise 1 @@ -7096,7 +7090,7 @@ @end group @end smallexample -This can be made more readable using @kbd{d B} to enable ``big'' display +This can be made more readable using @kbd{d B} to enable Big display mode: @smallexample @@ -7107,23 +7101,23 @@ @end group @end smallexample -Type @kbd{d N} to return to ``normal'' display mode afterwards. +Type @kbd{d N} to return to Normal display mode afterwards. @node Matrix Answer 3, List Answer 1, Matrix Answer 2, Answers to Exercises @subsection Matrix Tutorial Exercise 3 @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. @@ -7155,7 +7149,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. @@ -7173,7 +7167,7 @@ @noindent Now we compute the matrix -@texline @tmath{A'} +@texline @math{A'} @infoline @expr{A2} and divide. @@ -7194,16 +7188,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.) @@ -7280,7 +7274,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 @@ -7299,10 +7293,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. @@ -7330,7 +7324,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 @@ -7393,7 +7387,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. @@ -7464,7 +7458,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. @@ -7498,7 +7492,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 @@ -7594,7 +7588,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.) @@ -7866,10 +7860,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 @@ -7886,10 +7880,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! @@ -8214,7 +8208,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 @@ -8254,7 +8248,7 @@ @samp{ln(0) = -inf}. Here we have an infinite answer to a finite input. As in the @expr{1 / 0} case, Calc will only use infinities -here if you have turned on ``infinite'' mode. Otherwise, it will +here if you have turned on Infinite mode. Otherwise, it will treat @samp{ln(0)} as an error. @node Types Answer 3, Types Answer 4, Types Answer 2, Answers to Exercises @@ -8468,16 +8462,16 @@ @w{@samp{1 / [0 .. 10]}}, also (potentially) divides by zero because zero is now a member of the interval. So Calc leaves this one unevaluated, too. -If you turn on ``infinite'' mode by pressing @kbd{m i}, you will +If you turn on Infinite mode by pressing @kbd{m i}, you will instead get the answer @samp{[0.1 .. inf]}, which includes infinity as a possible value. 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 @@ -8497,9 +8491,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 @@ -9131,7 +9125,7 @@ @end group @end smallexample -Perhaps more surprisingly, this rule still works with infinite mode +Perhaps more surprisingly, this rule still works with Infinite mode turned on. Calc tries @code{EvalRules} before any built-in rules for a function. This allows you to override the default behavior of any Calc feature: Even though Calc now wants to evaluate @expr{0^0} to @@ -9255,7 +9249,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 )}. @@ -9326,7 +9320,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 @@ -9380,7 +9374,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 @@ -9497,10 +9491,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}. @@ -9541,7 +9535,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. @@ -9584,7 +9578,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: @@ -9619,7 +9613,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 @@ -9896,10 +9890,10 @@ and @samp{*Calc Trail*}. The former displays the contents of the Calculator stack and is manipulated exclusively through Calc commands. It is possible (though not usually necessary) to create several Calc -Mode buffers each of which has an independent stack, undo list, and +mode buffers each of which has an independent stack, undo list, and mode settings. There is exactly one Calc Trail buffer; it records a list of the results of all calculations that have been done. The -Calc Trail buffer uses a variant of Calc Mode, so Calculator commands +Calc Trail buffer uses a variant of Calc mode, so Calculator commands still work when the trail buffer's window is selected. It is possible to turn the trail window off, but the @samp{*Calc Trail*} buffer itself still exists and is updated silently. @xref{Trail Commands}. @@ -9913,7 +9907,7 @@ In most installations, the @kbd{M-# c} key sequence is a more convenient way to start the Calculator. Also, @kbd{M-# M-#} and @kbd{M-# #} are synonyms for @kbd{M-# c} unless you last used Calc -in its ``keypad'' mode. +in its Keypad mode. @kindex x @kindex M-x @@ -9985,7 +9979,7 @@ @pindex calc-quit @cindex Quitting the Calculator @cindex Exiting the Calculator -The @kbd{q} key (@code{calc-quit}) exits Calc Mode and closes the +The @kbd{q} key (@code{calc-quit}) exits Calc mode and closes the Calculator's window(s). It does not delete the Calculator buffers. If you type @kbd{M-x calc} again, the Calculator will reappear with the contents of the stack intact. Typing @kbd{M-# c} or @kbd{M-# M-#} @@ -10193,7 +10187,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 @@ -10256,7 +10250,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 @@ -10277,7 +10271,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 @@ -10285,7 +10279,7 @@ clear previous results off the stack. You can press the apostrophe key during normal numeric entry to switch -the half-entered number into algebraic entry mode. One reason to do this +the half-entered number into Algebraic entry mode. One reason to do this would be to use the full Emacs cursor motion and editing keys, which are available during algebraic entry but not during numeric entry. @@ -10296,7 +10290,7 @@ @kindex m a @pindex calc-algebraic-mode -@cindex Algebraic mode +@cindex Algebraic Mode If you prefer algebraic entry, you can use the command @kbd{m a} (@code{calc-algebraic-mode}) to set Algebraic mode. In this mode, digits and other keys that would normally start numeric entry instead @@ -10307,7 +10301,7 @@ @kbd{2 @key{RET} 3 @key{RET} * 4 @key{RET} +} would accomplish the same thing as @kbd{2*3+4 @key{RET}}. -@cindex Incomplete algebraic mode +@cindex Incomplete Algebraic Mode If you give a numeric prefix argument like @kbd{C-u} to the @kbd{m a} command, it enables Incomplete Algebraic mode; this is like regular Algebraic mode except that it applies to the @kbd{(} and @kbd{[} keys @@ -10315,15 +10309,15 @@ @kindex m t @pindex calc-total-algebraic-mode -@cindex Total algebraic mode +@cindex Total Algebraic Mode The @kbd{m t} (@code{calc-total-algebraic-mode}) gives you an even stronger algebraic-entry mode, in which @emph{all} regular letter and punctuation keys begin algebraic entry. Use this if you prefer typing @w{@kbd{sqrt( )}} instead of @kbd{Q}, @w{@kbd{factor( )}} instead of @kbd{a f}, and so on. To type regular Calc commands when you are in -``total'' algebraic mode, hold down the @key{META} key. Thus @kbd{M-q} +Total Algebraic mode, hold down the @key{META} key. Thus @kbd{M-q} is the command to quit Calc, @kbd{M-p} sets the precision, and -@kbd{M-m t} (or @kbd{M-m M-t}, if you prefer) turns total algebraic +@kbd{M-m t} (or @kbd{M-m M-t}, if you prefer) turns Total Algebraic mode back off again. Meta keys also terminate algebraic entry, so that @kbd{2+3 M-S} is equivalent to @kbd{2+3 @key{RET} M-S}. The symbol @samp{Alg*} will appear in the mode line whenever you are in this mode. @@ -10584,7 +10578,7 @@ @noindent @pindex another-calc -It is possible to have any number of Calc Mode buffers at once. +It is possible to have any number of Calc mode buffers at once. Usually this is done by executing @kbd{M-x another-calc}, which is similar to @kbd{M-# c} except that if a @samp{*Calculator*} buffer already exists, a new, independent one with a name of the @@ -10687,7 +10681,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. @@ -10799,7 +10793,7 @@ subtraction, and multiplication of integers always yields an exact integer result. (If the result of a division or exponentiation of integers is not an integer, it is expressed in fractional or -floating-point form according to the current Fraction Mode. +floating-point form according to the current Fraction mode. @xref{Fraction Mode}.) A decimal integer is represented as an optional sign followed by a @@ -10825,7 +10819,7 @@ written ``2/3'' but Calc uses the notation @samp{2:3}. (The @kbd{/} key performs RPN division; the following two sequences push the number @samp{2:3} on the stack: @kbd{2 :@: 3 @key{RET}}, or @kbd{2 @key{RET} 3 /} -assuming Fraction Mode has been enabled.) +assuming Fraction mode has been enabled.) When the Calculator produces a fractional result it always reduces it to simplest form, which may in fact be an integer. @@ -10846,10 +10840,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. @@ -10921,16 +10915,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. @@ -10939,7 +10933,7 @@ Operations on rectangular complex numbers yield rectangular complex results, and similarly for polar complex numbers. Where the two types are mixed, or where new complex numbers arise (as for the square root of -a negative real), the current @dfn{Polar Mode} is used to determine the +a negative real), the current @dfn{Polar mode} is used to determine the type. @xref{Polar Mode}. A complex result in which the imaginary part is zero (or the phase angle @@ -10973,7 +10967,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 @@ -11027,7 +11021,7 @@ cannot be determined.) In Calc's notation, @samp{0 * inf = nan} and @samp{inf / inf = nan}. A few other common indeterminate expressions are @samp{inf - inf} and @samp{inf ^ 0}. Also, -@samp{0 / 0 = nan} if you have turned on ``infinite mode'' +@samp{0 / 0 = nan} if you have turned on Infinite mode (as described above). Infinities are especially useful as parts of @dfn{intervals}. @@ -11070,7 +11064,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}. @@ -11201,7 +11195,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, @@ -11295,12 +11289,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{} is @samp{}. 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 @@ -11308,7 +11302,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} @@ -11341,7 +11335,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. @@ -11373,7 +11367,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.) @@ -11423,12 +11417,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 @@ -11439,7 +11433,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 @@ -11470,34 +11464,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. @@ -11593,10 +11587,10 @@ get the other interpretation. If you omit the lower or upper limit, a default of @samp{-inf} or @samp{inf} (respectively) is furnished. -``Infinite mode'' also affects operations on intervals +Infinite mode also affects operations on intervals (@pxref{Infinities}). Calc will always introduce an open infinity, as in @samp{1 / (0 .. 2] = [0.5 .. inf)}. But closed infinities, -@w{@samp{1 / [0 .. 2] = [0.5 .. inf]}}, arise only in infinite mode; +@w{@samp{1 / [0 .. 2] = [0.5 .. inf]}}, arise only in Infinite mode; otherwise they are left unevaluated. Note that the ``direction'' of a zero is not an issue in this case since the zero is always assumed to be continuous with the rest of the interval. For intervals that @@ -11606,11 +11600,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 @@ -11844,7 +11838,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 @@ -11911,7 +11905,7 @@ algebraic entry (@kbd{'}), editing commands like @kbd{`} which parse the contents of the editing buffer when you finish, the @kbd{M-# g} and @w{@kbd{M-# r}} commands, the @kbd{C-y} command, the X window system -``paste'' mouse operation, and Embedded Mode. All of these operations +``paste'' mouse operation, and Embedded mode. All of these operations use the same rules for parsing formulas; in particular, language modes (@pxref{Language Modes}) affect them all in the same way. @@ -12042,11 +12036,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. @@ -12320,7 +12314,7 @@ @pindex calc-mode-record-mode The @kbd{m R} (@code{calc-mode-record-mode}) command tells Calc to record the new mode settings (as if by pressing @kbd{m m}) every -time a mode setting changes. If Embedded Mode is enabled, other +time a mode setting changes. If Embedded mode is enabled, other options are available; @pxref{Mode Settings in Embedded Mode}. @kindex m F @@ -12341,8 +12335,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. @@ -12447,7 +12441,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 @@ -12501,7 +12495,7 @@ degrees, or an HMS form depending on the current angular mode. If the result is a complex number and the current mode is HMS, the number is instead expressed in degrees. (Complex-number calculations would -normally be done in radians mode, though. Complex numbers are converted +normally be done in Radians mode, though. Complex numbers are converted to degrees by calculating the complex result in radians and then multiplying by 180 over @cpi{}.) @@ -12514,7 +12508,7 @@ The @kbd{m r} (@code{calc-radians-mode}), @kbd{m d} (@code{calc-degrees-mode}), and @kbd{m h} (@code{calc-hms-mode}) commands control the angular mode. The current angular mode is displayed on the Emacs mode line. -The default angular mode is degrees. +The default angular mode is Degrees. @node Polar Mode, Fraction Mode, Angular Modes, Calculation Modes @subsection Polar Mode @@ -12530,7 +12524,7 @@ @kindex m p @pindex calc-polar-mode The @kbd{m p} (@code{calc-polar-mode}) command toggles complex-number -preference between rectangular and polar forms. In polar mode, all +preference between rectangular and polar forms. In Polar mode, all of the above example situations would produce polar complex numbers. @node Fraction Mode, Infinite Mode, Polar Mode, Calculation Modes @@ -12550,8 +12544,8 @@ To set the Calculator to produce fractional results for normal integer divisions, use the @kbd{m f} (@code{calc-frac-mode}) command. For example, @expr{8/4} produces @expr{2} in either mode, -but @expr{6/4} produces @expr{3:2} in Fraction Mode, @expr{1.5} in -Float Mode. +but @expr{6/4} produces @expr{3:2} in Fraction mode, @expr{1.5} in +Float mode. At any time you can use @kbd{c f} (@code{calc-float}) to convert a fraction to a float, or @kbd{c F} (@code{calc-fraction}) to convert a @@ -12574,25 +12568,25 @@ in calculations that already had infinities as inputs. (One exception is that infinite open intervals like @samp{[0 .. inf)} can be generated; however, intervals closed at infinity (@samp{[0 .. inf]}) -will not be generated when infinite mode is off.) - -With infinite mode turned on, @samp{1 / 0} will generate @code{uinf}, +will not be generated when Infinite mode is off.) + +With Infinite mode turned on, @samp{1 / 0} will generate @code{uinf}, an undirected infinity. @xref{Infinities}, for a discussion of the difference between @code{inf} and @code{uinf}. Also, @expr{0 / 0} evaluates to @code{nan}, the ``indeterminate'' symbol. Various other functions can also return infinities in this mode; for example, @samp{ln(0) = -inf}, and @samp{gamma(-7) = uinf}. Once again, -note that @samp{exp(inf) = inf} regardless of infinite mode because +note that @samp{exp(inf) = inf} regardless of Infinite mode because this calculation has infinity as an input. -@cindex Positive infinite mode +@cindex Positive Infinite mode The @kbd{m i} command with a numeric prefix argument of zero, -i.e., @kbd{C-u 0 m i}, turns on a ``positive infinite mode'' in +i.e., @kbd{C-u 0 m i}, turns on a Positive Infinite mode in 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 -infinite mode merely changes the interpretation given to the +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} is equivalent to @samp{1 / 0}, which is equal to positive @code{inf}. @@ -12611,7 +12605,7 @@ @kindex m s @pindex calc-symbolic-mode -In @dfn{symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode}) +In @dfn{Symbolic mode}, controlled by the @kbd{m s} (@code{calc-symbolic-mode}) command, functions which would produce inexact, irrational results are left in symbolic form. Thus @kbd{16 Q} pushes 4, but @kbd{2 Q} pushes @samp{sqrt(2)}. @@ -12638,12 +12632,12 @@ @cindex Scalar mode Calc sometimes makes assumptions during algebraic manipulation that are awkward or incorrect when vectors and matrices are involved. -Calc has two modes, @dfn{matrix mode} and @dfn{scalar mode}, which +Calc has two modes, @dfn{Matrix mode} and @dfn{Scalar mode}, which modify its behavior around vectors in useful ways. @kindex m v @pindex calc-matrix-mode -Press @kbd{m v} (@code{calc-matrix-mode}) once to enter matrix mode. +Press @kbd{m v} (@code{calc-matrix-mode}) once to enter Matrix mode. In this mode, all objects are assumed to be matrices unless provably otherwise. One major effect is that Calc will no longer consider multiplication to be commutative. (Recall that in matrix arithmetic, @@ -12662,18 +12656,18 @@ if it is combined with a scalar (as in @samp{idn(1) + 2}), Calc will assume it really was a scalar after all and produce, e.g., 3. -Press @kbd{m v} a second time to get scalar mode. Here, objects are +Press @kbd{m v} a second time to get Scalar mode. Here, objects are assumed @emph{not} to be vectors or matrices unless provably so. For example, normally adding a variable to a vector, as in @samp{[x, y, z] + a}, will leave the sum in symbolic form because as far as Calc knows, @samp{a} could represent either a number or -another 3-vector. In scalar mode, @samp{a} is assumed to be a +another 3-vector. In Scalar mode, @samp{a} is assumed to be a non-vector, and the addition is evaluated to @samp{[x+a, y+a, z+a]}. Press @kbd{m v} a third time to return to the normal mode of operation. If you press @kbd{m v} with a numeric prefix argument @var{n}, you -get a special ``dimensioned matrix mode'' in which matrices of +get a special ``dimensioned'' Matrix mode in which matrices of unknown size are assumed to be @var{n}x@var{n} square matrices. Then, the function call @samp{idn(1)} will expand into an actual matrix rather than representing a ``generic'' matrix. @@ -12694,11 +12688,11 @@ your earlier promise to Calc that @samp{a} would be scalar. Another way to mix scalars and matrices is to use selections -(@pxref{Selecting Subformulas}). Use matrix mode when operating on -your formula normally; then, to apply scalar mode to a certain part +(@pxref{Selecting Subformulas}). Use Matrix mode when operating on +your formula normally; then, to apply Scalar mode to a certain part of the formula without affecting the rest just select that part, -change into scalar mode and press @kbd{=} to resimplify the part -under this mode, then change back to matrix mode before deselecting. +change into Scalar mode and press @kbd{=} to resimplify the part +under this mode, then change back to Matrix mode before deselecting. @node Automatic Recomputation, Working Message, Matrix Mode, Calculation Modes @subsection Automatic Recomputation @@ -12714,7 +12708,7 @@ The @kbd{m C} (@code{calc-auto-recompute}) command turns this automatic recomputation on and off. If you turn it off, Calc will not update @samp{=>} operators on the stack (nor those in the -attached Embedded Mode buffer, if there is one). They will not +attached Embedded mode buffer, if there is one). They will not be updated unless you explicitly do so by pressing @kbd{=} or until you press @kbd{m C} to turn recomputation back on. (While automatic recomputation is off, you can think of @kbd{m C m C} as a command @@ -12835,7 +12829,7 @@ amount of simplification you will allow to be applied automatically, then use manual commands like @kbd{a s} and @kbd{c c} (@code{calc-clean}) to perform higher types of simplifications on demand. @xref{Algebraic -Definitions}, for another sample use of no-simplification mode. +Definitions}, for another sample use of No-Simplification mode. @node Declarations, Display Modes, Simplification Modes, Mode Settings @section Declarations @@ -12982,7 +12976,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 @@ -13082,8 +13076,8 @@ never distinguishes between @code{vector} and @code{matrix} declarations.) -@xref{Matrix Mode}, for a discussion of ``matrix mode'' and -``scalar mode,'' which are similar to declaring @samp{[All, matrix]} +@xref{Matrix Mode}, for a discussion of Matrix mode and +Scalar mode, which are similar to declaring @samp{[All, matrix]} or @samp{[All, scalar]} but much more convenient. One more type symbol that is recognized is used with the @kbd{H a d} @@ -13095,7 +13089,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} @@ -13235,8 +13229,8 @@ @tindex dscalar The @code{dscalar} function returns 1 if its argument is provably scalar, or 0 if its argument is provably non-scalar. It is left -unevaluated if this cannot be determined. (If matrix mode or scalar -mode are in effect, this function returns 1 or 0, respectively, +unevaluated if this cannot be determined. (If Matrix mode or Scalar +mode is in effect, this function returns 1 or 0, respectively, if it has no other information.) When Calc interprets a condition (say, in a rewrite rule) it considers an unevaluated formula to be ``false.'' Thus, @samp{dscalar(a)} is ``true'' only if @code{a} is @@ -13330,7 +13324,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.) @@ -13345,7 +13339,7 @@ @cindex Digit grouping Long numbers can be hard to read if they have too many digits. For example, the factorial of 30 is 33 digits long! Press @kbd{d g} -(@code{calc-group-digits}) to enable @dfn{grouping} mode, in which digits +(@code{calc-group-digits}) to enable @dfn{Grouping} mode, in which digits are displayed in clumps of 3 or 4 (depending on the current radix) separated by commas. @@ -13891,7 +13885,7 @@ Values on the stack are normally left-justified in the window. You can control this arrangement by typing @kbd{d <} (@code{calc-left-justify}), @kbd{d >} (@code{calc-right-justify}), or @kbd{d =} -(@code{calc-center-justify}). For example, in right-justification mode, +(@code{calc-center-justify}). For example, in Right-Justification mode, stack entries are displayed flush-right against the right edge of the window. @@ -13912,20 +13906,20 @@ origin and line width is slightly different in each justification mode. -In left-justified mode, the line is indented by a number of spaces +In Left-Justified mode, the line is indented by a number of spaces given by the origin (default zero). If the result is longer than the maximum line width, if given, or too wide to fit in the Calc window otherwise, then it is broken into lines which will fit; each broken line is indented to the origin. -In right-justified mode, lines are shifted right so that the rightmost +In Right-Justified mode, lines are shifted right so that the rightmost character is just before the origin, or just before the current window width if no origin was specified. If the line is too long for this, then it is broken; the current line width is used, if specified, or else the origin is used as a width if that is specified, or else the line is broken to fit in the window. -In centering mode, the origin is the column number of the center of +In Centering mode, the origin is the column number of the center of each stack entry. If a line width is specified, lines will not be allowed to go past that width; Calc will either indent less or break the lines if necessary. If no origin is specified, half the @@ -13960,13 +13954,13 @@ The @kbd{d @}} (@code{calc-right-label}) command similarly adds a label on the righthand side. It does not affect positioning of the stack entries unless they are right-justified. Also, if both -a line width and an origin are given in right-justified mode, the +a line width and an origin are given in Right-Justified mode, the stack entry is justified to the origin and the righthand label is justified to the line width. One application of labels would be to add equation numbers to formulas you are manipulating in Calc and then copying into a -document (possibly using Embedded Mode). The equations would +document (possibly using Embedded mode). The equations would typically be centered, and the equation numbers would be on the left or right as you prefer. @@ -14068,7 +14062,7 @@ @noindent in place of @samp{sqrt((a+1)/b + c^2)}. -Subscripts like @samp{a_i} are displayed as actual subscripts in ``big'' +Subscripts like @samp{a_i} are displayed as actual subscripts in Big mode. Double subscripts, @samp{a_i_j} (@samp{subscr(subscr(a, i), j)}) are displayed as @samp{a} with subscripts separated by commas: @samp{i, j}. They must still be entered in the usual underscore @@ -14141,12 +14135,12 @@ Octal and hexadecimal values are written with leading @samp{0} or @samp{0x} rather than using the @samp{#} symbol. Array subscripting is translated into @code{subscr} calls, so that @samp{a[i]} in C -mode is the same as @samp{a_i} in normal mode. Assignments +mode is the same as @samp{a_i} in Normal mode. Assignments turn into the @code{assign} function, which Calc normally displays using the @samp{:=} symbol. The variables @code{var-pi} and @code{var-e} would be displayed @samp{pi} -and @samp{e} in normal mode, but in C mode they are displayed as +and @samp{e} in Normal mode, but in C mode they are displayed as @samp{M_PI} and @samp{M_E}, corresponding to the names of constants typically provided in the @file{} header. Functions whose names are different in C are translated automatically for entry and @@ -14188,7 +14182,7 @@ Underscores are allowed in variable and function names in all of these language modes. The underscore here is equivalent to the @samp{#} in -normal mode, or to hyphens in the underlying Emacs Lisp variable names. +Normal mode, or to hyphens in the underlying Emacs Lisp variable names. FORTRAN and Pascal modes normally do not adjust the case of letters in formulas. Most built-in Calc names use lower-case letters. If you use a @@ -14231,10 +14225,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 @@ -14830,7 +14824,7 @@ @tindex choriz The @code{choriz} function takes a vector of objects and composes them horizontally. For example, @samp{choriz([17, a b/c, d])} formats -as @w{@samp{17a b / cd}} in normal language mode, or as +as @w{@samp{17a b / cd}} in Normal language mode, or as @example @group @@ -15093,7 +15087,7 @@ @tindex cwidth The @code{cwidth} function measures the width, in characters, of a composition. For example, @samp{cwidth(a + b)} is 5, and -@samp{cwidth(a / b)} is 5 in normal mode, 1 in Big mode, and 11 in +@samp{cwidth(a / b)} is 5 in Normal mode, 1 in Big mode, and 11 in @TeX{} mode (for @samp{@{a \over b@}}). The argument may involve the composition functions described in this section. @@ -15269,7 +15263,7 @@ @pindex calc-edit-user-syntax The @kbd{Z S} (@code{calc-edit-user-syntax}) command edits the syntax table for the current language mode. If you want your -syntax to work in any language, define it in the normal language +syntax to work in any language, define it in the Normal language mode. Type @kbd{M-# M-#} to finish editing the syntax table, or @kbd{M-# x} to cancel the edit. The @kbd{m m} command saves all the syntax tables along with the other mode settings; @@ -15300,7 +15294,7 @@ A @dfn{syntax table} is a list of user-defined @dfn{syntax rules}, which allow you to specify new patterns to define your own favorite input notations. Calc's parser always checks the syntax -table for the current language mode, then the table for the normal +table for the current language mode, then the table for the Normal language mode, before it uses its built-in rules to parse an algebraic formula you have entered. Each syntax rule should go on its own line; it consists of a @dfn{pattern}, a @samp{:=} symbol, @@ -15655,7 +15649,7 @@ @samp{i=1..10}. Then, we use @code{matches} to break it apart into its components. If the expression turns out not to match the pattern, the syntax rule will fail. Note that @kbd{Z S} always uses Calc's -normal language mode for editing expressions in syntax rules, so we +Normal language mode for editing expressions in syntax rules, so we must use regular Calc notation for the interval @samp{[b..c]} that will correspond to the Maple mode interval @samp{1..10}. @@ -15728,19 +15722,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}), +Matrix mode. Command is @kbd{m v}. + +@item +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 @@ -15767,7 +15761,7 @@ @cindex Mode line indicators This section is a summary of all symbols that can appear on the Calc mode line, the highlighted bar that appears under the Calc -stack window (or under an editing window in Embedded Mode). +stack window (or under an editing window in Embedded mode). The basic mode line format is: @@ -15779,7 +15773,7 @@ regular Emacs commands are not allowed to edit the stack buffer as if it were text. -The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded Mode +The word @samp{Calc:} changes to @samp{CalcEmbed:} if Embedded mode is enabled. The words after this describe the various Calc modes that are in effect. @@ -15807,7 +15801,7 @@ Matrix mode (@kbd{m v}; @pxref{Matrix Mode}). @item Matrix@var{n} -Dimensioned matrix mode (@kbd{C-u @var{n} m v}). +Dimensioned Matrix mode (@kbd{C-u @var{n} m v}). @item Scalar Scalar mode (@kbd{m v}; @pxref{Matrix Mode}). @@ -15822,7 +15816,7 @@ Infinite mode (@kbd{m i}; @pxref{Infinite Mode}). @item +Inf -Positive infinite mode (@kbd{C-u 0 m i}). +Positive Infinite mode (@kbd{C-u 0 m i}). @item NoSimp Default simplifications off (@kbd{m O}; @pxref{Simplification Modes}). @@ -16030,14 +16024,14 @@ If either argument of @kbd{+} is a complex number, the result will in general be complex. If one argument is in rectangular form and the other polar, -the current Polar Mode determines the form of the result. If Symbolic -Mode is enabled, the sum may be left as a formula if the necessary +the current Polar mode determines the form of the result. If Symbolic +mode is enabled, the sum may be left as a formula if the necessary conversions for polar addition are non-trivial. If both arguments of @kbd{+} are HMS forms, the forms are added according to the usual conventions of hours-minutes-seconds notation. If one argument is an HMS form and the other is a number, that number is converted from -degrees or radians (depending on the current Angular Mode) to HMS format +degrees or radians (depending on the current Angular mode) to HMS format and then the two HMS forms are added. If one argument of @kbd{+} is a date form, the other can be either a @@ -16081,7 +16075,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 * @@ -16189,7 +16183,7 @@ @tindex fdiv The @kbd{:} (@code{calc-fdiv}) command [@code{fdiv} function in a formula] divides the two integers on the top of the stack to produce a fractional -result. This is a convenient shorthand for enabling Fraction Mode (with +result. This is a convenient shorthand for enabling Fraction mode (with @kbd{m f}) temporarily and using @samp{/}. Note that during numeric entry the @kbd{:} key is interpreted as a fraction separator, so to divide 8 by 6 you would have to type @kbd{8 @key{RET} 6 @key{RET} :}. (Of course, in @@ -16225,7 +16219,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}. @@ -16243,7 +16237,7 @@ @tindex sqrt The @kbd{Q} (@code{calc-sqrt}) [@code{sqrt}] command computes the square root of a number. For a negative real argument, the result will be a -complex number whose form is determined by the current Polar Mode. +complex number whose form is determined by the current Polar mode. @kindex f h @pindex calc-hypot @@ -16288,7 +16282,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 @@ -16305,7 +16299,7 @@ by a given power of ten. Thus, @samp{scf(mant(x), xpon(x)) = x} for any real @samp{x}. The second argument must be an integer, but the first may actually be any numeric value. For example, @samp{scf(5,-2) = 0.05} -or @samp{1:20} depending on the current Fraction Mode. +or @samp{1:20} depending on the current Fraction mode. @kindex f [ @kindex f ] @@ -16321,7 +16315,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. @@ -16362,7 +16356,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 @@ -16374,7 +16368,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 @@ -16388,7 +16382,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 @@ -16401,7 +16395,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 @@ -16479,17 +16473,17 @@ 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 The @code{calc-imaginary} command multiplies the number on the top of the stack by the imaginary number @expr{i = (0,1)}. This command is not normally bound to a key in Calc, but it is available -on the @key{IMAG} button in Keypad Mode. +on the @key{IMAG} button in Keypad mode. @kindex f r @pindex calc-re @@ -16513,8 +16507,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 @@ -16638,7 +16632,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 @@ -16894,8 +16888,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 @@ -17264,7 +17258,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; @@ -17312,7 +17306,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. @@ -17768,7 +17762,7 @@ integrals or solving equations involving the functions. @ifinfo -These formulas are shown using the conventions of ``Big'' display +These formulas are shown using the conventions of Big display mode (@kbd{d B}); for example, the formula for @code{fv} written linearly is @samp{pmt * ((1 + rate)^n) - 1) / rate}. @@ -17939,10 +17933,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. @@ -17958,7 +17952,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 @@ -17974,7 +17968,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. @@ -18126,11 +18120,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.) @@ -18210,7 +18204,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 @@ -18220,11 +18214,11 @@ @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 -Mode setting. With the Inverse flag [@code{alog}], this command is +mode setting. With the Inverse flag [@code{alog}], this command is similar to @kbd{^} except that the order of the arguments is reversed. @kindex f I @@ -18242,11 +18236,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. @@ -18254,7 +18248,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. @@ -18280,7 +18274,7 @@ Also, the symbolic variable @code{pi} is not ordinarily recognized in arguments to trigonometric functions, as in @samp{sin(3 pi / 4)}, but the @kbd{a s} (@code{calc-simplify}) command recognizes many such -formulas when the current angular mode is radians @emph{and} symbolic +formulas when the current angular mode is Radians @emph{and} Symbolic mode is enabled; this example would be replaced by @samp{sqrt(2) / 2}. @xref{Symbolic Mode}. Beware, this simplification occurs even if you have stored a different value in the variable @samp{pi}; this is one @@ -18289,7 +18283,7 @@ Calc includes similar formulas for @code{cos} and @code{tan}. The @kbd{a s} command knows all angles which are integer multiples of -@cpiover{12}, @cpiover{10}, or @cpiover{8} radians. In degrees mode, +@cpiover{12}, @cpiover{10}, or @cpiover{8} radians. In Degrees mode, analogous simplifications occur for integer multiples of 15 or 18 degrees, and for arguments plus multiples of 90 degrees. @@ -18388,10 +18382,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, @@ -18440,7 +18434,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.) @@ -18474,7 +18468,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). @@ -18507,10 +18501,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 @@ -18520,7 +18514,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}]. @@ -18532,11 +18526,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 @@ -18612,17 +18606,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 @@ -18637,10 +18631,10 @@ 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 +@code{arctan} assume the current angular mode is Radians. The hyperbolic functions operate independently of the angular mode. @smallexample @@ -18710,7 +18704,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. @@ -18720,15 +18714,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}. @@ -18738,14 +18732,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 @@ -18858,7 +18852,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 @@ -18894,20 +18888,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 @@ -18958,7 +18952,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 ! @@ -19002,7 +18996,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 @@ -19045,11 +19039,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} @@ -19093,8 +19087,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 @@ -19128,7 +19122,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}. @@ -19137,7 +19131,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 @@ -19201,7 +19195,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}. @@ -19219,10 +19213,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}. @@ -19240,7 +19234,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}. @@ -19273,18 +19267,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)}.) @@ -19404,8 +19398,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 @@ -19444,7 +19438,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 @@ -19482,18 +19476,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 @@ -19593,7 +19587,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 @@ -19615,7 +19609,7 @@ whose size is known, it is converted automatically to an identity matrix of a suitable matching size. The @kbd{v i} command with an argument of zero creates a generic identity matrix, @samp{idn(1)}. -Note that in dimensioned matrix mode (@pxref{Matrix Mode}), generic +Note that in dimensioned Matrix mode (@pxref{Matrix Mode}), generic identity matrices are immediately expanded to the current default dimensions. @@ -19626,7 +19620,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 @@ -19819,7 +19813,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. @@ -19851,13 +19845,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 @@ -20177,10 +20171,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 - @@ -20289,7 +20283,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 @@ -20401,10 +20395,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 @@ -20416,7 +20410,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 @@ -20525,7 +20519,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 @@ -20541,7 +20535,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. @@ -20579,7 +20573,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. @@ -20603,7 +20597,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. @@ -20861,7 +20855,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]]}. @@ -21272,11 +21266,11 @@ using regular Emacs editing commands. When doing algebraic work, you may find several of the Calculator's -modes to be helpful, including algebraic-simplification mode (@kbd{m A}) -or no-simplification mode (@kbd{m O}), -algebraic-entry mode (@kbd{m a}), fraction mode (@kbd{m f}), and -symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions -of these modes. You may also wish to select ``big'' display mode (@kbd{d B}). +modes to be helpful, including Algebraic Simplification mode (@kbd{m A}) +or No-Simplification mode (@kbd{m O}), +Algebraic entry mode (@kbd{m a}), Fraction mode (@kbd{m f}), and +Symbolic mode (@kbd{m s}). @xref{Mode Settings}, for discussions +of these modes. You may also wish to select Big display mode (@kbd{d B}). @xref{Normal Language Modes}. @menu @@ -21330,7 +21324,7 @@ highlight the smallest portion of the formula that contains that character. By default the sub-formula is highlighted by blanking out all of the rest of the formula with dots. Selection works in any -display mode but is perhaps easiest in ``big'' (@kbd{d B}) mode. +display mode but is perhaps easiest in Big mode (@kbd{d B}). Suppose you enter the following formula: @smallexample @@ -21360,7 +21354,7 @@ Every character not part of the sub-formula @samp{b} has been changed to a dot. The @samp{*} next to the line number is to remind you that the formula has a portion of it selected. (In this case, it's very -obvious, but it might not always be. If Embedded Mode is enabled, +obvious, but it might not always be. If Embedded mode is enabled, the word @samp{Sel} also appears in the mode line because the stack may not be visible. @pxref{Embedded Mode}.) @@ -22010,17 +22004,17 @@ Use @kbd{a v} if you want the variables to ignore their stored values. If you give a numeric prefix argument of 2 to @kbd{a v}, it simplifies -as if in algebraic simplification mode. This is equivalent to typing +as if in Algebraic Simplification mode. This is equivalent to typing @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}, +of 3 or more, it uses Extended Simplification mode (@kbd{a e}). + +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 @samp{2 + 3}. As another example, typing @kbd{V R +} to sum the vector @samp{[1, 2, 3, 4]} produces the formula @samp{reduce(add, [1, 2, 3, 4])} -in no-simplify mode. Using @kbd{a v} will evaluate this all the way to +in No-Simplify mode. Using @kbd{a v} will evaluate this all the way to 10; using @kbd{C-u - a v} will evaluate it only to @samp{1 + 2 + 3 + 4}. (@xref{Reducing and Mapping}.) @@ -22028,7 +22022,7 @@ @tindex evalvn The @kbd{=} command corresponds to the @code{evalv} function, and the related @kbd{N} command, which is like @kbd{=} but temporarily -disables symbolic (@kbd{m s}) mode during the evaluation, corresponds +disables Symbolic mode (@kbd{m s}) during the evaluation, corresponds to the @code{evalvn} function. (These commands interpret their prefix arguments differently than @kbd{a v}; @kbd{=} treats the prefix as the number of stack elements to evaluate at once, and @kbd{N} treats @@ -22203,7 +22197,7 @@ to a function are somehow of the wrong type @expr{@t{tan}([2,3,4])}), range (@expr{@t{tan}(90)}), or number (@expr{@t{tan}(3,5)}), or if the function name is not recognized (@expr{@t{f}(5)}), or if -``symbolic'' mode (@pxref{Symbolic Mode}) prevents evaluation +Symbolic mode (@pxref{Symbolic Mode}) prevents evaluation (@expr{@t{sqrt}(2)}). Calc simplifies (evaluates) the arguments to a function before it @@ -22286,7 +22280,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. @@ -22311,7 +22305,7 @@ The products @expr{1 a} and @expr{a 1} are simplified to @expr{a}; @expr{(-1) a} and @expr{a (-1)} are simplified to @expr{-a}; @expr{0 a} and @expr{a 0} are simplified to @expr{0}, except that -in matrix mode where @expr{a} is not provably scalar the result +in Matrix mode where @expr{a} is not provably scalar the result is the generic zero matrix @samp{idn(0)}, and that if @expr{a} is infinite the result is @samp{nan}. @@ -22330,25 +22324,25 @@ 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 @expr{b}. The result is written using @samp{sqrt} or @samp{1/sqrt} if the sum of the powers is @expr{1/2} or @expr{-1/2}, respectively. If the sum of the powers is zero, the product is simplified to -@expr{1} or to @samp{idn(1)} if matrix mode is enabled. +@expr{1} or to @samp{idn(1)} if Matrix mode is enabled. 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 +goes to @expr{y / x^2} unless Matrix mode is in effect and neither @expr{x} nor @expr{y} are scalar (in which case it is considered unsafe to rearrange the order of the terms). Finally, @expr{a (b/c)} is rewritten to @expr{(a b)/c}, and also -@expr{(a/b) c} is changed to @expr{(a c)/b} unless in matrix mode. +@expr{(a/b) c} is changed to @expr{(a c)/b} unless in Matrix mode. @tex \bigskip @@ -22365,17 +22359,17 @@ @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}. Also, @expr{(-a) / b} and @expr{a / (-b)} go to @expr{-(a/b)}; @expr{(a/b) / c} goes to @expr{a / (b c)}; and @expr{a / (b/c)} -goes to @expr{(a c) / b} unless matrix mode prevents this +goes to @expr{(a c) / b} unless Matrix mode prevents this rearrangement. Similarly, @expr{a / (b:c)} is simplified to @expr{(c:b) a} for any fraction @expr{b:c}. @@ -22399,7 +22393,7 @@ @end tex The formula @expr{x^0} is simplified to @expr{1}, or to @samp{idn(1)} -in matrix mode. The formula @expr{0^x} is simplified to @expr{0} +in Matrix mode. The formula @expr{0^x} is simplified to @expr{0} unless @expr{x} is a negative number or complex number, in which case the result is an infinity or an unsimplified formula according to the current infinite mode. Note that @expr{0^0} is an @@ -22410,22 +22404,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}. @@ -22438,15 +22432,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. @@ -22575,7 +22569,7 @@ come first, and are sorted into increasing order. The @kbd{V S} command uses the same ordering when sorting a vector. -Sorting of terms of products is inhibited when matrix mode is +Sorting of terms of products is inhibited when Matrix mode is turned on; in this case, Calc will never exchange the order of two terms unless it knows at least one of the terms is a scalar. @@ -22589,7 +22583,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 @@ -22632,7 +22626,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 @@ -22694,23 +22688,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, @@ -22795,18 +22789,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., @@ -22882,7 +22876,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 @@ -22897,10 +22891,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}. @@ -23183,14 +23177,14 @@ @var{n}th derivative. When working with trigonometric functions, it is best to switch to -radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)} +Radians mode first (with @w{@kbd{m r}}). The derivative of @samp{sin(x)} in degrees is @samp{(pi/180) cos(x)}, probably not the expected answer! 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 @@ -23230,7 +23224,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 @@ -23256,7 +23250,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 @@ -23264,17 +23258,17 @@ 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. The Calculator remembers all the integrals it has done. If conditions change in a way that would invalidate the old integrals, say, a switch -from degrees to radians mode, then they will be thrown out. If you +from Degrees to Radians mode, then they will be thrown out. If you suspect this is not happening when it should, use the @code{calc-flush-caches} command; @pxref{Caches}. @@ -23328,7 +23322,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} @@ -23501,16 +23495,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. @@ -23537,7 +23531,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 @@ -23633,10 +23627,10 @@ for @expr{x} by taking cube roots. But in many cases, like @expr{x^6 + x + 1}, Calc does not know how to rewrite the polynomial into a form it can solve. The @kbd{a P} command can still deliver a -list of numerical roots, however, provided that symbolic mode (@kbd{m s}) -is not turned on. (If you work with symbolic mode on, recall that the +list of numerical roots, however, provided that Symbolic mode (@kbd{m s}) +is not turned on. (If you work with Symbolic mode on, recall that the @kbd{N} (@code{calc-eval-num}) key is a handy way to reevaluate the -formula on the stack with symbolic mode temporarily off.) Naturally, +formula on the stack with Symbolic mode temporarily off.) Naturally, @kbd{a P} can only provide numerical roots if the polynomial coefficients are all numbers (real or complex). @@ -23970,11 +23964,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 @@ -24097,7 +24091,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 @@ -24105,10 +24099,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. @@ -24206,11 +24200,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. @@ -24251,9 +24245,9 @@ data exactly, it's no surprise that Calc chose a tiny contribution for @expr{x^2}. (The fact that it's not exactly zero is due only to roundoff error. Since our data are exact integers, we could get -an exact answer by typing @kbd{m f} first to get fraction mode. +an exact answer by typing @kbd{m f} first to get Fraction mode. Then the @expr{x^2} term would vanish altogether. Usually, though, -the data being fitted will be approximate floats so fraction mode +the data being fitted will be approximate floats so Fraction mode won't help.) Doing the @kbd{a F 2} fit on the data set with 14 instead of 13 @@ -24266,7 +24260,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: @@ -24278,7 +24272,7 @@ @expr{0.0416666663588}, clearly suffer from loss of precision. It is a good idea to increase the working precision to several digits beyond what you need when you do a fitting operation. -Or, if your data are exact, use fraction mode to get exact +Or, if your data are exact, use Fraction mode to get exact results. You can type @kbd{i} instead of a digit at the model prompt to fit @@ -24371,10 +24365,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, @@ -24397,7 +24391,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. @@ -24407,14 +24401,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 @@ -24449,20 +24443,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 @@ -24473,11 +24467,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). @@ -24486,13 +24480,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 @@ -24501,7 +24495,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 @@ -24520,31 +24514,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 @@ -24656,18 +24650,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. @@ -24722,16 +24716,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}. @@ -24745,7 +24739,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}. @@ -24777,7 +24771,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 @@ -24788,7 +24782,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: @@ -24848,11 +24842,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; @@ -24864,7 +24858,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.) @@ -25218,7 +25212,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. @@ -25244,7 +25238,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}. @@ -25949,12 +25943,12 @@ Note that @samp{*} is not commutative when applied to matrices, but rewrite rules pretend that it is. If you type @kbd{m v} to enable -matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*} +Matrix mode (@pxref{Matrix Mode}), rewrite rules will match @samp{*} literally, ignoring its usual commutativity property. (In the current implementation, the associativity also vanishes---it is as if the pattern had been enclosed in a @code{plain} marker; see below.) If you are applying rewrites to formulas with matrices, it's best to -enable matrix mode first to prevent algebraically incorrect rewrites +enable Matrix mode first to prevent algebraically incorrect rewrites from occurring. The pattern @samp{-x} will actually match any expression. For example, @@ -26259,16 +26253,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, @@ -26431,8 +26425,8 @@ on both sides of a rewrite rule: @samp{apply(f, [x]) := f(x+1)} is @emph{not} correct, because it rewrites @samp{spam(6)} into @samp{f(7)}. The righthand side should be @samp{apply(f, [x+1])}. -Also note that you will have to use no-simplify (@kbd{m O}) -mode when entering this rule so that the @code{apply} isn't +Also note that you will have to use No-Simplify mode (@kbd{m O}) +when entering this rule so that the @code{apply} isn't evaluated immediately to get the new rule @samp{f(x) := f(x+1)}. Or, use @kbd{s e} to enter the rule without going through the stack, or enter the rule as @samp{apply(f, [x]) := apply(f, [x+1]) @w{:: 1}}. @@ -27167,7 +27161,7 @@ to expand trig functions. But if instead you store them in the variable @code{EvalRules}, they will automatically be applied to all sines and cosines of sums. Then, with @samp{2 x} and @samp{45} on -the stack, typing @kbd{+ S} will (assuming degrees mode) result in +the stack, typing @kbd{+ S} will (assuming Degrees mode) result in @samp{0.7071 sin(2 x) + 0.7071 cos(2 x)} automatically. As each level of a formula is evaluated, the rules from @@ -27243,11 +27237,11 @@ the multiplication, addition, and square root functions directly rather than applying the default simplifications to this formula. So an @code{EvalRules} rule that (perversely) rewrites @samp{sqrt(13) := 6} -would not apply. (However, if you put Calc into symbolic mode so that +would not apply. (However, if you put Calc into Symbolic mode so that @samp{sqrt(13)} will be left in symbolic form by the built-in square root function, your rule will be able to apply. But if the complex number were @expr{(3,4)}, so that @samp{sqrt(25)} must be calculated, -then symbolic mode will not help because @samp{sqrt(25)} can be +then Symbolic mode will not help because @samp{sqrt(25)} can be evaluated exactly to 5.) One subtle restriction that normally only manifests itself with @@ -27354,7 +27348,7 @@ This will simplify the formula whenever @expr{b} and/or @expr{c} can be made simpler by squaring. For example, applying this rule to @samp{2 / (sqrt(2) + 3)} yields @samp{6:7 - 2:7 sqrt(2)} (assuming -Symbolic Mode has been enabled to keep the square root from being +Symbolic mode has been enabled to keep the square root from being evaluated to a floating-point approximation). This rule is also useful when working with symbolic complex numbers, e.g., @samp{(a + b i) / (c + d i)}. @@ -27464,7 +27458,7 @@ display anomaly, however; @samp{mm} will work just fine as a representation of one millimeter. -You may find that Algebraic Mode (@pxref{Algebraic Entry}) makes working +You may find that Algebraic mode (@pxref{Algebraic Entry}) makes working with units expressions easier. Otherwise, you will have to remember to hit the apostrophe key every time you wish to enter units. @@ -27734,7 +27728,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 @@ -27951,10 +27945,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 @@ -28353,11 +28347,11 @@ formula @samp{x + y + x} is not handled by Calc's default simplifications, but the @kbd{a s} command will reduce it to the simpler form @samp{y + 2 x}. You can also type @kbd{m A} -to enable an algebraic-simplification mode in which the +to enable an Algebraic Simplification mode in which the equivalent of @kbd{a s} is used on all of Calc's results. If you enter @samp{x + y + x =>} normally, the result will be @samp{x + y + x => x + y + x}. If you change to -algebraic-simplification mode, the result will be +Algebraic Simplification mode, the result will be @samp{x + y + x => y + 2 x}. However, just pressing @kbd{a s} once will have no effect on @samp{x + y + x => x + y + x}, because the righthand side depends only on the lefthand side @@ -28396,13 +28390,13 @@ @pindex calc-assign @tindex assign @tindex := -Embedded Mode also uses @samp{=>} operators. In embedded mode, +Embedded mode also uses @samp{=>} operators. In Embedded mode, the lefthand side of an @samp{=>} operator can refer to variables assigned elsewhere in the file by @samp{:=} operators. The assignment operator @samp{a := 17} does not actually do anything -by itself. But Embedded Mode recognizes it and marks it as a sort +by itself. But Embedded mode recognizes it and marks it as a sort of file-local definition of the variable. You can enter @samp{:=} -operators in algebraic mode, or by using the @kbd{s :} +operators in Algebraic mode, or by using the @kbd{s :} (@code{calc-assign}) [@code{assign}] command which takes a variable and value from the stack and replaces them with an assignment. @@ -28541,7 +28535,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 @@ -28652,7 +28646,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 @@ -28903,7 +28897,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. @@ -28942,7 +28936,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 @@ -29103,7 +29097,7 @@ The commands in this chapter move information between the Calculator and other Emacs editing buffers. -In many cases Embedded Mode is an easier and more natural way to +In many cases Embedded mode is an easier and more natural way to work with Calc from a regular editing buffer. @xref{Embedded Mode}. @menu @@ -29252,7 +29246,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.) @@ -29374,7 +29368,7 @@ in the Calc window. @node Keypad Mode, Embedded Mode, Kill and Yank, Introduction -@chapter ``Keypad'' Mode +@chapter Keypad Mode @noindent @kindex M-# k @@ -29383,7 +29377,7 @@ and displays a picture of a calculator-style keypad. If you are using the X window system, you can click on any of the ``keys'' in the keypad using the left mouse button to operate the calculator. -The original window remains the selected window; in keypad mode +The original window remains the selected window; in Keypad mode you can type in your file while simultaneously performing calculations with the mouse. @@ -29399,11 +29393,11 @@ ``key,'' and type @key{SPC} or @key{RET}. If you think this is easier than using Calc normally, go right ahead. -Calc commands are more or less the same in keypad mode. Certain +Calc commands are more or less the same in Keypad mode. Certain keypad keys differ slightly from the corresponding normal Calc keystrokes; all such deviations are described below. -Keypad Mode includes many more commands than will fit on the keypad +Keypad mode includes many more commands than will fit on the keypad at once. Click the right mouse button [@code{calc-keypad-menu}] to switch to the next menu. The bottom five rows of the keypad stay the same; the top three rows change to a new set of commands. @@ -29451,7 +29445,7 @@ @end smallexample @noindent -This is the menu that appears the first time you start Keypad Mode. +This is the menu that appears the first time you start Keypad mode. It will show up in a vertical window on the right side of your screen. Above this menu is the traditional Calc stack display. On a 24-line screen you will be able to see the top three stack entries. @@ -29468,7 +29462,7 @@ stack. The @key{INV} and @key{HYP} keys modify other keys. As well as -having the effects described elsewhere in this manual, Keypad Mode +having the effects described elsewhere in this manual, Keypad mode defines several other ``inverse'' operations. These are described below and in the following sections. @@ -29488,7 +29482,7 @@ that would normally work in Calc mode. This can include a numeric prefix if you wish. It is also possible simply to switch into the Calc window and type commands in it; there is -nothing ``magic'' about this window when Keypad Mode is active. +nothing ``magic'' about this window when Keypad mode is active. The other keys in this display perform their obvious calculator functions. @key{CLN2} rounds the top-of-stack by temporarily @@ -29590,7 +29584,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 @@ -29767,16 +29761,16 @@ The @key{STO} and @key{RCL} keys are analogous to @kbd{s t} and @kbd{s r} in regular Calc. @xref{Store and Recall}. Click the @key{STO} or @key{RCL} key, then one of the ten digits. (Named -variables are not available in Keypad Mode.) You can also use, +variables are not available in Keypad mode.) You can also use, for example, @kbd{STO + 3} to add to register 3. @node Embedded Mode, Programming, Keypad Mode, Top @chapter Embedded Mode @noindent -Embedded Mode in Calc provides an alternative to copying numbers +Embedded mode in Calc provides an alternative to copying numbers and formulas back and forth between editing buffers and the Calc -stack. In Embedded Mode, your editing buffer becomes temporarily +stack. In Embedded mode, your editing buffer becomes temporarily linked to the stack and this copying is taken care of automatically. @menu @@ -29801,7 +29795,7 @@ Calc normally scans backward and forward in the buffer for the nearest opening and closing @dfn{formula delimiters}. The simplest -delimiters are blank lines. Other delimiters that Embedded Mode +delimiters are blank lines. Other delimiters that Embedded mode understands are: @enumerate @@ -30359,15 +30353,15 @@ @section Mode Settings in Embedded Mode @noindent -Embedded Mode has a rather complicated mechanism for handling mode +Embedded mode has a rather complicated mechanism for handling mode settings in Embedded formulas. It is possible to put annotations in the file that specify mode settings either global to the entire file or local to a particular formula or formulas. In the latter case, different modes can be specified for use when a formula -is the enabled Embedded Mode formula. - -When you give any mode-setting command, like @kbd{m f} (for fraction -mode) or @kbd{d s} (for scientific notation), Embedded Mode adds +is the enabled Embedded mode formula. + +When you give any mode-setting command, like @kbd{m f} (for Fraction +mode) or @kbd{d s} (for scientific notation), Embedded mode adds a line like the following one to the file just before the opening delimiter of the formula. @@ -30420,7 +30414,7 @@ annotation by hand, be sure to give a proper value or results will be unpredictable. Mode-setting annotations are case-sensitive. -While Embedded Mode is enabled, the word @code{Local} appears in +While Embedded mode is enabled, the word @code{Local} appears in the mode line. This is to show that mode setting commands generate annotations that are ``local'' to the current formula or set of formulas. The @kbd{m R} (@code{calc-mode-record-mode}) command @@ -30436,7 +30430,7 @@ @end example The first kind of annotation will be used only while a formula -is enabled in Embedded Mode. The second kind will be used only +is enabled in Embedded mode. The second kind will be used only when the formula is @emph{not} enabled. (Whether the formula is ``active'' or not, i.e., whether Calc has seen this formula yet, is not relevant here.) @@ -30478,21 +30472,21 @@ on it in order to get it to notice the new annotation. Two more mode-recording modes selectable by @kbd{m R} are @code{Save} -(which works even outside of Embedded Mode), in which mode settings +(which works even outside of Embedded mode), in which mode settings are recorded permanently in your Emacs startup file @file{~/.emacs} rather than by annotating the current document, and no-recording mode (where there is no symbol like @code{Save} or @code{Local} in the mode line), in which mode-changing commands do not leave any annotations at all. -When Embedded Mode is not enabled, mode-recording modes except +When Embedded mode is not enabled, mode-recording modes except for @code{Save} have no effect. @node Customizing Embedded Mode, , Mode Settings in Embedded Mode, Embedded Mode @section Customizing Embedded Mode @noindent -You can modify Embedded Mode's behavior by setting various Lisp +You can modify Embedded mode's behavior by setting various Lisp variables described here. Use @kbd{M-x set-variable} or @kbd{M-x edit-options} to adjust a variable on the fly, or put a suitable @code{setq} statement in your @file{~/.emacs} @@ -30502,7 +30496,7 @@ Emacs manual}.) While none of these variables will be buffer-local by default, you -can make any of them local to any embedded-mode buffer. (Their +can make any of them local to any Embedded mode buffer. (Their values in the @samp{*Calculator*} buffer are never used.) @vindex calc-embedded-open-formula @@ -30591,7 +30585,7 @@ @vindex calc-embedded-close-plain The @code{calc-embedded-close-plain} variable is a string which ends a ``plain'' formula. The default is @code{" %%%\n"}. Without -the trailing newline here, the first line of a ``big'' mode formula +the trailing newline here, the first line of a Big mode formula that followed might be shifted over with respect to the other lines. @vindex calc-embedded-open-new-formula @@ -31018,7 +31012,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 @} @@ -31052,7 +31046,7 @@ @cindex Restoring saved modes Keyboard macros sometimes want to operate under known conditions without affecting surrounding conditions. For example, a keyboard -macro may wish to turn on Fraction Mode, or set a particular +macro may wish to turn on Fraction mode, or set a particular precision, independent of the user's normal setting for those modes. @@ -31101,7 +31095,7 @@ In fact, @kbd{C-u Z `} is like @kbd{Z `} except that it sets the modes listed above to their default values. As usual, the matching @kbd{Z '} will restore the modes to their settings from before the @kbd{C-u Z `}. -Also, @w{@kbd{Z `}} with a negative prefix argument resets algebraic mode +Also, @w{@kbd{Z `}} with a negative prefix argument resets the algebraic mode to its default (off) but leaves the other modes the same as they were outside the construct. @@ -31989,7 +31983,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 @@ -32173,7 +32167,7 @@ element is a formula string, then @code{calc-eval} sets all the various Calc modes to their default values while the formula is evaluated and formatted. For example, the precision is set to 12 -digits, digit grouping is turned off, and the normal language +digits, digit grouping is turned off, and the Normal language mode is used. This same principle applies to the other options discussed below. @@ -32196,7 +32190,7 @@ program actually considers the interaction with Calc's mode settings to be a feature. This will avoid all sorts of potential ``gotchas''; consider what happens with @samp{(calc-eval "sqrt(2)" 'num)} -when the user has left Calc in symbolic mode or no-simplify mode. +when the user has left Calc in Symbolic mode or No-Simplify mode. As another example, @samp{(equal (calc-eval '("$<$$") nil a b) "1")} checks if the number in string @expr{a} is less than the one in @@ -32512,10 +32506,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} @@ -32536,7 +32530,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 @@ -32772,7 +32766,7 @@ This function takes a Calc object and ``normalizes'' it. At the very least this involves re-rounding floating-point values according to the current precision and other similar jobs. Also, unless the user has -selected no-simplify mode (@pxref{Simplification Modes}), this involves +selected No-Simplify mode (@pxref{Simplification Modes}), this involves actually evaluating a formula object by executing the function calls it contains, and possibly also doing algebraic simplification, etc. @end defun @@ -32848,7 +32842,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 @@ -33134,13 +33128,13 @@ @end defun @defun inexact-value -If Symbolic Mode is enabled, this will signal an error that causes +If Symbolic mode is enabled, this will signal an error that causes @code{normalize} to leave the formula in symbolic form, with the message -``Inexact result.'' (This function has no effect when not in Symbolic Mode.) -Note that if your function calls @samp{(sin 5)} in Symbolic Mode, the +``Inexact result.'' (This function has no effect when not in Symbolic mode.) +Note that if your function calls @samp{(sin 5)} in Symbolic mode, the @code{sin} function will call @code{inexact-value}, which will cause your function to be left unsimplified. You may instead wish to call -@samp{(normalize (list 'calcFunc-sin 5))}, which in Symbolic Mode will +@samp{(normalize (list 'calcFunc-sin 5))}, which in Symbolic mode will return the formula @samp{sin(5)} to your function. @end defun @@ -33186,9 +33180,9 @@ @code{reject-arg} or @code{inexact-result}, @code{normalize} returns the formula still in symbolic form. -If the current Simplification Mode is ``none'' or ``numeric arguments +If the current simplification mode is ``none'' or ``numeric arguments only,'' @code{normalize} will act appropriately. However, the more -powerful simplification modes (like algebraic simplification) are +powerful simplification modes (like Algebraic Simplification) are not handled by @code{normalize}. They are handled by @code{calc-normalize}, which calls @code{normalize} and possibly some other routines, such as @code{simplify} or @code{simplify-units}. Programs generally will @@ -33267,7 +33261,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. @@ -33280,7 +33274,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 @@ -33376,7 +33370,7 @@ If the current angular mode is Degrees or HMS, this function returns the integer 360. In Radians mode, this function returns either the corresponding value in radians to the current precision, or the formula -@samp{2*pi}, depending on the Symbolic Mode. There are also similar +@samp{2*pi}, depending on the Symbolic mode. There are also similar function @code{half-circle} and @code{quarter-circle}. @end defun @@ -33434,12 +33428,12 @@ @end defun @defun to-radians-2 a -Like @code{to-radians}, except that in Symbolic Mode a degrees to +Like @code{to-radians}, except that in Symbolic mode a degrees to radians conversion yields a formula like @samp{@var{a}*pi/180}. @end defun @defun from-radians-2 a -Like @code{from-radians}, except that in Symbolic Mode a radians to +Like @code{from-radians}, except that in Symbolic mode a radians to degrees conversion yields a formula like @samp{@var{a}*180/pi}. @end defun @@ -33488,7 +33482,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 @@ -35631,8 +35625,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 @@ -35834,7 +35828,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 @@ -35842,7 +35836,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 diff -r 6b379caca6fa -r 4ee39d9428b0 man/cc-mode.texi --- a/man/cc-mode.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/cc-mode.texi Thu Dec 23 16:43:51 2004 +0000 @@ -1420,7 +1420,7 @@ @code{c-block-comment-prefix} typically gets overriden by the default style @code{gnu}, which sets it to blank. You can see the line splitting effect described here by setting a different style, -e.g. @code{k&r} @xref{Choosing a Style}}, which makes a comment +e.g. @code{k&r} @xref{Choosing a Style}.}, which makes a comment @example /* Got O(n^2) here, which is a Bad Thing. */ @@ -1643,7 +1643,7 @@ @cindex font locking @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -@strong{Note:} The font locking in AWK mode is currently not integrated +@strong{Please note:} The font locking in AWK mode is currently not integrated with the rest of @ccmode{}, so this section does not apply there. @xref{AWK Mode Font Locking}, instead. diff -r 6b379caca6fa -r 4ee39d9428b0 man/dired.texi --- a/man/dired.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/dired.texi Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 man/gnus-faq.texi --- a/man/gnus-faq.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/gnus-faq.texi Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 man/mark.texi --- a/man/mark.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/mark.texi Thu Dec 23 16:43:51 2004 +0000 @@ -191,7 +191,9 @@ (@code{exchange-point-and-mark}). @item -@kbd{C-s} when the mark is active does not alter the mark. +Commands that normally set the mark before moving long distances (like +@kbd{M-<} and @kbd{C-s}) do not alter the mark in Transient Mark mode +when the mark is active. @item Some commands operate on the region if a region is active. For @@ -320,6 +322,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 @@ -382,9 +386,10 @@ Many commands that can move long distances, such as @kbd{M-<} (@code{beginning-of-buffer}), start by setting the mark and saving the old mark on the mark ring. This is to make it easier for you to move -back later. Searches set the mark if they move point. You can tell -when a command sets the mark because it displays @samp{Mark set} in the -echo area. +back later. Searches set the mark if they move point. However, in +Transient Mark mode, these commands do not set the mark when the mark +is already active. You can tell when a command sets the mark because +it displays @samp{Mark set} in the echo area. If you want to move back to the same place over and over, the mark ring may not be convenient enough. If so, you can record the position diff -r 6b379caca6fa -r 4ee39d9428b0 man/misc.texi --- a/man/misc.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/misc.texi Thu Dec 23 16:43:51 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 diff -r 6b379caca6fa -r 4ee39d9428b0 man/trampver.texi --- a/man/trampver.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/trampver.texi Thu Dec 23 16:43:51 2004 +0000 @@ -4,7 +4,7 @@ @c In the Tramp CVS, the version number is auto-frobbed from @c configure.ac, so you should edit that file and run @c "autoconf && ./configure" to change the version number. -@set trampver 2.0.45 +@set trampver 2.0.46 @c Other flags from configuration @set prefix /usr/local diff -r 6b379caca6fa -r 4ee39d9428b0 man/url.texi --- a/man/url.texi Fri Dec 10 15:24:54 2004 +0000 +++ b/man/url.texi Thu Dec 23 16:43:51 2004 +0000 @@ -27,7 +27,7 @@ Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with the -Invariant Sections being +Invariant Sections being ``GNU GENERAL PUBLIC LICENSE''. A copy of the license is included in the section entitled ``GNU Free Documentation License.'' @@ -74,9 +74,9 @@ * General Facilities:: URLs can be cached, accessed via a gateway and tracked in a history list. * Customization:: Variables you can alter. -* Function Index:: -* Variable Index:: -* Concept Index:: +* Function Index:: +* Variable Index:: +* Concept Index:: @end menu @node Getting Started @@ -115,7 +115,7 @@ the @var{path} component depends on the service. @menu -* Configuration:: +* Configuration:: * Parsed URLs:: URLs are parsed into vector structures. @end menu @@ -204,7 +204,7 @@ @defun url-retrieve-synchronously url Retrieve @var{url} synchronously and return a buffer containing the data. @var{url} is either a string or a parsed URL structure. Return -@var{nil} if there are no data associated with it (the case for dired, +@code{nil} if there are no data associated with it (the case for dired, info, or mailto URLs that need no further processing). @end defun @@ -214,7 +214,7 @@ has been completely retrieved, with the current buffer containing the object and any MIME headers associated with it. @var{url} is either a string or a parsed URL structure. Returns the buffer @var{url} will -load into, or @var{nil} if the process has already completed. +load into, or @code{nil} if the process has already completed. @end defun @node Supported URL Types @@ -222,7 +222,7 @@ @menu * http/https:: Hypertext Transfer Protocol. -* file/ftp:: Local files and FTP archives. +* file/ftp:: Local files and FTP archives. * info:: Emacs `Info' pages. * mailto:: Sending email. * news/nntp/snews:: Usenet news. @@ -235,7 +235,7 @@ @c * netrek:: @c * prospero:: * cid:: Content-ID. -* about:: +* about:: * ldap:: Lightweight Directory Access Protocol * imap:: IMAP mailboxes. * man:: Unix man pages. @@ -273,10 +273,10 @@ @menu -* Cookies:: -* HTTP language/coding:: -* HTTP URL Options:: -* Dealing with HTTP documents:: +* Cookies:: +* HTTP language/coding:: +* HTTP URL Options:: +* Dealing with HTTP documents:: @end menu @node Cookies @@ -330,7 +330,7 @@ can be weighted. In Emacs 21 this list is generated automatically from the list of defined coding systems which have associated MIME types. These are sorted by coding priority. @xref{Recognize Coding, -, Recognizing Coding Systems, emacs, GNU Emacs Manual}. +, Recognizing Coding Systems, emacs, The GNU Emacs Manual}. @end defopt @defopt url-mime-language-string @@ -384,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. @inforef{Top, The MIME library, -emacs-mime}. The URL package provides a function to do this in -general: +processed using the MIME library. @xref{Top,, Emacs MIME, +emacs-mime, The Emacs MIME Manual}. 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 @@ -414,8 +414,8 @@ @end example These schemes are defined in RFC 1808. -@samp{ftp:} and @samp{file:} are synonomous in this library. They -allow reading arbitary files from hosts. Either @samp{ange-ftp} +@samp{ftp:} and @samp{file:} are synonymous in this library. They +allow reading arbitrary files from hosts. Either @samp{ange-ftp} (Emacs) or @samp{efs} (XEmacs) is used to retrieve them from remote hosts. Local files are accessed directly. @@ -451,13 +451,13 @@ @cindex email A mailto URL will send an email message to the address in the URL, for example @samp{mailto:foo@@bar.com} would compose a -message to @samp{foo@@bar.com}. +message to @samp{foo@@bar.com}. @defopt url-mail-command @vindex mail-user-agent The function called whenever url needs to send mail. This should normally be left to default from @var{mail-user-agent}. @xref{Mail -Methods, , Mail-Composition Methods, emacs, GNU Emacs Manual}. +Methods, , Mail-Composition Methods, emacs, The GNU Emacs Manual}. @end defopt An @samp{X-Url-From} header field containing the URL of the document @@ -468,7 +468,7 @@ @example @samp{mailto:@var{mailbox}[?@var{header}=@var{contents}[&@var{header}=@var{contents}]]} @end example -@noindent where an arbitary number of @var{header}s can be added. If the +@noindent where an arbitrary number of @var{header}s can be added. If the @var{header} is @samp{body}, then @var{contents} is put in the body otherwise a @var{header} header field is created with @var{contents} as its contents. Note that the URL library does not consider any @@ -493,11 +493,11 @@ allowed for nntp an snews. @table @samp -@item news:@var{newsgroup} +@item news:@var{newsgroup} Retrieves a list of messages in @var{newsgroup}; @item news:@var{message-id} Retrieves the message with the given @var{message-id}; -@item news:* +@item news:* Retrieves a list of all available newsgroups; @item nntp://@var{host}:@var{port}/@var{newsgroup} @itemx nntp://@var{host}:@var{port}/@var{message-id} @@ -510,7 +510,7 @@ @samp{snews} is the same as @samp{nntp} except that the default port is :563. @cindex SSL -(It is tunnelled through SSL.) +(It is tunneled through SSL.) An @samp{nntp} URL is the same as a news URL, except that the URL may specify an article by its number. @@ -550,9 +550,9 @@ @cindex IRC @cindex Internet Relay Chat @cindex ZEN IRC -@c Fixme: reference (was http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt) +@c Fixme: reference (was http://www.w3.org/Addressing/draft-mirashi-url-irc-01.txt) @dfn{Internet Relay Chat} (IRC) is handled by handing off the @sc{irc} -session to a function named in @code{url-irc-function}. +session to a function named in @code{url-irc-function}. @defopt url-irc-function A function to actually open an IRC connection. @@ -582,7 +582,7 @@ @samp{text/plain;charset=US-ASCII}. The @samp{text/plain} can be omitted but the charset parameter supplied. If @samp{;base64} is present, the @var{data} are base64-encoded. - + @node nfs @section nfs @cindex NFS @@ -658,11 +658,11 @@ @chapter Defining New URLs @menu -* Naming conventions:: -* Required functions:: -* Optional functions:: -* Asynchronous fetching:: -* Supporting file-name-handlers:: +* Naming conventions:: +* Required functions:: +* Optional functions:: +* Asynchronous fetching:: +* Supporting file-name-handlers:: @end menu @node Naming conventions @@ -684,10 +684,10 @@ @chapter General Facilities @menu -* Disk Caching:: -* Proxies:: -* Gateways in general:: -* History:: +* Disk Caching:: +* Proxies:: +* Gateways in general:: +* History:: @end menu @node Disk Caching @@ -761,7 +761,7 @@ @end smallexample @end defun -@c Fixme: never actually used currently? +@c Fixme: never actually used currently? @c @defopt url-standalone-mode @c @cindex Relying on cache @c @cindex Cache only mode @@ -783,7 +783,7 @@ @node Proxies @section Proxies and Gatewaying -@c fixme: check/document url-ns stuff +@c fixme: check/document url-ns stuff @cindex proxy servers @cindex proxies @cindex environment variables @@ -815,7 +815,7 @@ @noindent says to contact all machines in the @samp{aventail.com} and @samp{seanet.com} domains directly, as well as the machine named @samp{home.com}. If @code{NO_PROXY} isn't defined, @code{no_PROXY} -and @code{no_proxy} are also tried, in that order. +and @code{no_proxy} are also tried, in that order. Proxies may also be specified directly in Lisp. @@ -940,7 +940,7 @@ where @var{version} can be either 4 or 5. @end defopt @defvar socks-password -If this is @code{nil} then you will be asked for the passward, +If this is @code{nil} then you will be asked for the password, otherwise it will be used as the password for authenticating you to the @sc{socks} server. @end defvar @@ -980,9 +980,9 @@ @end defopt @menu -* Suppressing network connexions:: +* Suppressing network connexions:: @end menu -@c * Broken hostname resolution:: +@c * Broken hostname resolution:: @node Suppressing network connexions @subsection Suppressing Network Connexions @@ -1010,7 +1010,7 @@ @c @cindex resolver, hostname @c Some C libraries do not include the hostname resolver routines in @c their static libraries. If Emacs was linked statically, and was not -@c linked with the resolver libraries, it wil not be able to get to any +@c linked with the resolver libraries, it will not be able to get to any @c machines off the local network. This is characterized by being able @c to reach someplace with a raw ip number, but not its hostname @c (@url{http://129.79.254.191/} works, but @@ -1052,8 +1052,8 @@ strings. The times are in the format returned by @code{current-time}. @defun url-history-update-url url time -This function updates the hsitory table with an entry for @var{url} -accessed at the gievn @var{time}. +This function updates the history table with an entry for @var{url} +accessed at the given @var{time}. @end defun @defopt url-history-track @@ -1144,7 +1144,7 @@ only if an affirmative answer is given. @end defopt @defopt url-gateway-method -@c fixme: describe gatewaying +@c fixme: describe gatewaying A symbol specifying the type of gateway support to use fro connexions from the local machine. The supported methods are: diff -r 6b379caca6fa -r 4ee39d9428b0 src/ChangeLog --- a/src/ChangeLog Fri Dec 10 15:24:54 2004 +0000 +++ b/src/ChangeLog Thu Dec 23 16:43:51 2004 +0000 @@ -1,3 +1,159 @@ +2004-12-22 Richard M. Stallman + + * emacs.c (main): If batch mode, set Vundo_outer_limit to nil. + + * lisp.h (Vundo_outer_limit): Fix decl. + + * undo.c (Vundo_outer_limit): Replaces undo_outer_limit. + Uses changed. + (syms_of_undo): Initialize appropriately. + (truncate_undo_list): If it's nil, there's no limit. + +2004-12-22 Kenichi Handa + + * xselect.c (Fx_get_cut_buffer_internal): Return a unibyte string. + +2004-12-21 Richard M. Stallman + + * eval.c (unwind_to_catch): Clear immediate_quit. + + * xdisp.c (get_next_display_element): Display codes 8a0 and 8ad + specially as `\ ' and `\-'. + + * keyboard.c (kbd_buffer_store_event_hold): + In the code for while-no-input, handle immediate_quit. + + * alloc.c (Fgarbage_collect): Update call to truncate_undo_list. + Call that at the very start. + (undo_limit, undo_strong_limit, undo_outer_limit): Moved to undo.c. + (syms_of_alloc): Don't define undo-limit, + undo-strong-limit and undo-outer-limit here. + + * undo.c (truncate_undo_list): Return void. + Take just one argument, the buffer. + Make it current, and inhibit recursive GC. + Access and update the undo list directly; return void. + Refer to the undo...limit variables directly. + Test undo_outer_limit only after counting the whole current command. + When it's exceeded, call the function in undo-outer-limit-function. + (undo_limit, undo_strong_limit, undo_outer_limit): From alloc.c. + (Vundo_outer_limit_function): New variable. + (syms_of_undo): Define undo-limit, undo-strong-limit + and undo-outer-limit here, and undo-outer-limit-function. + Doc fixes. + + * lisp.h (truncate_undo_list): Update decl. + +2004-12-21 Piet van Oostrum + + * fileio.c (Fread_file_name): Delete duplicates in + file-name-history when history_delete_duplicates is true. + +2004-12-20 YAMAMOTO Mitsuharu + + * macterm.c (mac_do_list_fonts): Fix memory leak + +2004-12-20 Richard M. Stallman + + * regex.c (re_match_2_internal) : + Fix calls to UPDATE_SYNTAX_TABLE_FORWARD. + +2004-12-18 YAMAMOTO Mitsuharu + + * macterm.c (endif, x_font_name_to_mac_font_name): Use + maccentraleurroman instead of maccentraleuropean + (mac_c_string_match, mac_do_list_fonts): Speed up font search by + quickly finding a specific font without needing regexps. + +2004-12-15 Jan Dj,Ad(Brv + + * syssignal.h: Declare main_thread. + (SIGNAL_THREAD_CHECK): New macro. + + * keyboard.c (input_available_signal): Move thread checking code + to macro SIGNAL_THREAD_CHECK and call that macro. + (interrupt_signal): Call SIGNAL_THREAD_CHECK. + + * alloc.c (uninterrupt_malloc): Move main_thread to emacs.c. + + * emacs.c: Define main_thread. + (main): Initialize main_thread. + (handle_USR1_signal, handle_USR2_signal, fatal_error_signal) + (memory_warning_signal): Call SIGNAL_THREAD_CHECK. + + * floatfns.c (float_error): Call SIGNAL_THREAD_CHECK. + + * dispnew.c (window_change_signal): Call SIGNAL_THREAD_CHECK. + + * sysdep.c (select_alarm): Call SIGNAL_THREAD_CHECK. + + * process.c (send_process_trap, sigchld_handler): Call + SIGNAL_THREAD_CHECK. + + * data.c (arith_error): Call SIGNAL_THREAD_CHECK. + + * atimer.c (alarm_signal_handler): Call SIGNAL_THREAD_CHECK. + + * xterm.c (xg_scroll_callback): Update XG_LAST_SB_DATA before + returning when xg_ignore_gtk_scrollbar is true. + +2004-12-14 Kim F. Storm + + * keyboard.c (read_char): Save and restore echo_string when + handling input method. + +2004-12-13 Richard M. Stallman + + * eval.c (syms_of_eval) : 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 + + * xdisp.c (set_iterator_to_next): Reset stop_charpos after display + vector. + +2004-12-12 Richard M. Stallman + + * 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 + + * term.c (encode_terminal_code): Fix previous change. + +2004-12-11 Stefan Monnier + + * 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 + + * 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 * xdisp.c (get_next_display_element): Use `escape-glyph' for @@ -17,8 +173,8 @@ * 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. @@ -56,12 +212,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 @@ -92,6 +247,7 @@ * eval.c (Fcalled_interactively_p): Don't check INTERACTIVE. (interactive_p): Skip Scalled_interactively_p frames like Sinteractive_p frames. + (unwind_to_catch): Clear handling_signal. * data.c (Fmake_variable_buffer_local): Doc fix. (Fmake_local_variable): Doc fix. diff -r 6b379caca6fa -r 4ee39d9428b0 src/alloc.c --- a/src/alloc.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/alloc.c Thu Dec 23 16:43:51 2004 +0000 @@ -99,7 +99,7 @@ If Emacs sets malloc hooks (! SYSTEM_MALLOC) and the emacs_blocked_* functions below are called from malloc, there is a chance that one of these threads preempts the Emacs main thread and the hook variables - end up in a inconsistent state. So we have a mutex to prevent that (note + end up in an inconsistent state. So we have a mutex to prevent that (note that the backend handles concurrent access to malloc within its own threads but Emacs code running in the main thread is not included in that control). @@ -109,7 +109,6 @@ To prevent that, we only call BLOCK/UNBLOCK from the main thread. */ static pthread_mutex_t alloc_mutex; -pthread_t main_thread; #define BLOCK_INPUT_ALLOC \ do \ @@ -201,12 +200,6 @@ #endif /* VIRT_ADDR_VARIES */ int malloc_sbrk_unused; -/* Two limits controlling how much undo information to keep. */ - -EMACS_INT undo_limit; -EMACS_INT undo_strong_limit; -EMACS_INT undo_outer_limit; - /* Number of live and free conses etc. */ static int total_conses, total_markers, total_symbols, total_vector_size; @@ -1311,8 +1304,6 @@ pthread_mutexattr_init (&attr); pthread_mutexattr_settype (&attr, PTHREAD_MUTEX_RECURSIVE); pthread_mutex_init (&alloc_mutex, &attr); - - main_thread = pthread_self (); #endif /* HAVE_GTK_AND_PTHREAD */ if (__free_hook != emacs_blocked_free) @@ -4648,13 +4639,48 @@ if (abort_on_gc) abort (); - EMACS_GET_TIME (t1); - /* Can't GC if pure storage overflowed because we can't determine if something is a pure object or not. */ if (pure_bytes_used_before_overflow) return Qnil; + /* Don't keep undo information around forever. + Do this early on, so it is no problem if the user quits. */ + { + register struct buffer *nextb = all_buffers; + + while (nextb) + { + /* If a buffer's undo list is Qt, that means that undo is + turned off in that buffer. Calling truncate_undo_list on + Qt tends to return NULL, which effectively turns undo back on. + So don't call truncate_undo_list if undo_list is Qt. */ + if (! EQ (nextb->undo_list, Qt)) + truncate_undo_list (nextb); + + /* Shrink buffer gaps, but skip indirect and dead buffers. */ + if (nextb->base_buffer == 0 && !NILP (nextb->name)) + { + /* If a buffer's gap size is more than 10% of the buffer + size, or larger than 2000 bytes, then shrink it + accordingly. Keep a minimum size of 20 bytes. */ + int size = min (2000, max (20, (nextb->text->z_byte / 10))); + + if (nextb->text->gap_size > size) + { + struct buffer *save_current = current_buffer; + current_buffer = nextb; + make_gap (-(nextb->text->gap_size - size)); + current_buffer = save_current; + } + } + + nextb = nextb->next; + } + } + + EMACS_GET_TIME (t1); + /* In case user calls debug_print during GC, don't let that cause a recursive GC. */ consing_since_gc = 0; @@ -4693,42 +4719,6 @@ shrink_regexp_cache (); - /* Don't keep undo information around forever. */ - { - register struct buffer *nextb = all_buffers; - - while (nextb) - { - /* If a buffer's undo list is Qt, that means that undo is - turned off in that buffer. Calling truncate_undo_list on - Qt tends to return NULL, which effectively turns undo back on. - So don't call truncate_undo_list if undo_list is Qt. */ - if (! EQ (nextb->undo_list, Qt)) - nextb->undo_list - = truncate_undo_list (nextb->undo_list, undo_limit, - undo_strong_limit, undo_outer_limit); - - /* Shrink buffer gaps, but skip indirect and dead buffers. */ - if (nextb->base_buffer == 0 && !NILP (nextb->name)) - { - /* If a buffer's gap size is more than 10% of the buffer - size, or larger than 2000 bytes, then shrink it - accordingly. Keep a minimum size of 20 bytes. */ - int size = min (2000, max (20, (nextb->text->z_byte / 10))); - - if (nextb->text->gap_size > size) - { - struct buffer *save_current = current_buffer; - current_buffer = nextb; - make_gap (-(nextb->text->gap_size - size)); - current_buffer = save_current; - } - } - - nextb = nextb->next; - } - } - gc_in_progress = 1; /* clear_marks (); */ @@ -6004,29 +5994,6 @@ doc: /* Non-nil means loading Lisp code in order to dump an executable. This means that certain objects should be allocated in shared (pure) space. */); - DEFVAR_INT ("undo-limit", &undo_limit, - doc: /* Keep no more undo information once it exceeds this size. -This limit is applied when garbage collection happens. -The size is counted as the number of bytes occupied, -which includes both saved text and other data. */); - undo_limit = 20000; - - DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, - doc: /* Don't keep more than this much size of undo information. -A previous command which pushes the undo list past this size -is entirely forgotten when GC happens. -The size is counted as the number of bytes occupied, -which includes both saved text and other data. */); - undo_strong_limit = 30000; - - DEFVAR_INT ("undo-outer-limit", &undo_outer_limit, - doc: /* Don't keep more than this much size of undo information. -If the current command has produced more than this much undo information, -GC discards it. This is a last-ditch limit to prevent memory overflow. -The size is counted as the number of bytes occupied, -which includes both saved text and other data. */); - undo_outer_limit = 300000; - DEFVAR_BOOL ("garbage-collection-messages", &garbage_collection_messages, doc: /* Non-nil means display messages at start and end of garbage collection. */); garbage_collection_messages = 0; diff -r 6b379caca6fa -r 4ee39d9428b0 src/atimer.c --- a/src/atimer.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/atimer.c Thu Dec 23 16:43:51 2004 +0000 @@ -364,6 +364,8 @@ { EMACS_TIME now; + SIGNAL_THREAD_CHECK (signo); + EMACS_GET_TIME (now); pending_atimers = 0; diff -r 6b379caca6fa -r 4ee39d9428b0 src/data.c --- a/src/data.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/data.c Thu Dec 23 16:43:51 2004 +0000 @@ -3366,6 +3366,7 @@ sigsetmask (SIGEMPTYMASK); #endif /* not BSD4_1 */ + SIGNAL_THREAD_CHECK (signo); Fsignal (Qarith_error, Qnil); } diff -r 6b379caca6fa -r 4ee39d9428b0 src/dispnew.c --- a/src/dispnew.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/dispnew.c Thu Dec 23 16:43:51 2004 +0000 @@ -6005,6 +6005,9 @@ struct tty_display_info *tty; + signal (SIGWINCH, window_change_signal); + SIGNAL_THREAD_CHECK (signalnum); + /* The frame size change obviously applies to a single termcap-controlled terminal, but we can't decide which. Therefore, we resize the frames corresponding to each tty. @@ -6028,7 +6031,6 @@ } } - signal (SIGWINCH, window_change_signal); errno = old_errno; } #endif /* SIGWINCH */ diff -r 6b379caca6fa -r 4ee39d9428b0 src/emacs.c --- a/src/emacs.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/emacs.c Thu Dec 23 16:43:51 2004 +0000 @@ -343,6 +343,14 @@ void (*fatal_error_signal_hook) P_ ((void)); +#ifdef HAVE_GTK_AND_PTHREAD +/* When compiled with GTK and running under Gnome, multiple threads meay be + created. Keep track of our main thread to make sure signals are delivered + to it (see syssignal.h). */ + +pthread_t main_thread; +#endif + #ifdef SIGUSR1 SIGTYPE @@ -351,6 +359,7 @@ { struct input_event buf; + SIGNAL_THREAD_CHECK (sig); bzero (&buf, sizeof buf); buf.kind = USER_SIGNAL_EVENT; buf.frame_or_window = selected_frame; @@ -366,6 +375,7 @@ { struct input_event buf; + SIGNAL_THREAD_CHECK (sig); bzero (&buf, sizeof buf); buf.kind = USER_SIGNAL_EVENT; buf.code = 1; @@ -380,6 +390,7 @@ fatal_error_signal (sig) int sig; { + SIGNAL_THREAD_CHECK (sig); fatal_error_code = sig; signal (sig, SIG_DFL); @@ -419,6 +430,7 @@ int sig; { signal (sig, memory_warning_signal); + SIGNAL_THREAD_CHECK (sig); malloc_warning ("Operating system warns that virtual memory is running low.\n"); @@ -1024,10 +1036,16 @@ 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 */ +#ifdef HAVE_GTK_AND_PTHREAD + main_thread = pthread_self (); +#endif /* HAVE_GTK_AND_PTHREAD */ + #if defined (MSDOS) || defined (WINDOWSNT) /* We do all file input/output as binary files. When we need to translate newlines, we do that manually. */ @@ -1116,7 +1134,10 @@ /* Handle the -batch switch, which means don't do interactive display. */ noninteractive = 0; if (argmatch (argv, argc, "-batch", "--batch", 5, NULL, &skip_args)) - noninteractive = 1; + { + noninteractive = 1; + Vundo_outer_limit = Qnil; + } if (argmatch (argv, argc, "-script", "--script", 3, &junk, &skip_args)) { noninteractive = 1; /* Set batch mode. */ @@ -2237,7 +2258,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. */ diff -r 6b379caca6fa -r 4ee39d9428b0 src/eval.c --- a/src/eval.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/eval.c Thu Dec 23 16:43:51 2004 +0000 @@ -1178,6 +1178,7 @@ set_poll_suppress_count (catch->poll_suppress_count); interrupt_input_blocked = catch->interrupt_input_blocked; handling_signal = 0; + immediate_quit = 0; do { @@ -3331,7 +3332,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, diff -r 6b379caca6fa -r 4ee39d9428b0 src/fileio.c --- a/src/fileio.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/fileio.c Thu Dec 23 16:43:51 2004 +0000 @@ -230,6 +230,8 @@ extern int minibuffer_auto_raise; +extern int history_delete_duplicates; + /* These variables describe handlers that have "already" had a chance to handle the current operation. @@ -6385,7 +6387,13 @@ if (replace_in_history) /* Replace what Fcompleting_read added to the history with what we will actually return. */ - XSETCAR (Fsymbol_value (Qfile_name_history), double_dollars (val)); + { + Lisp_Object val1 = double_dollars (val); + tem = Fsymbol_value (Qfile_name_history); + if (history_delete_duplicates) + XSETCDR (tem, Fdelete (val1, XCDR(tem))); + XSETCAR (tem, val1); + } else if (add_to_history) { /* Add the value to the history--but not if it matches @@ -6393,8 +6401,10 @@ Lisp_Object val1 = double_dollars (val); tem = Fsymbol_value (Qfile_name_history); if (! CONSP (tem) || NILP (Fequal (XCAR (tem), val1))) - Fset (Qfile_name_history, - Fcons (val1, tem)); + { + if (history_delete_duplicates) tem = Fdelete (val1, tem); + Fset (Qfile_name_history, Fcons (val1, tem)); + } } return val; diff -r 6b379caca6fa -r 4ee39d9428b0 src/floatfns.c --- a/src/floatfns.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/floatfns.c Thu Dec 23 16:43:51 2004 +0000 @@ -981,6 +981,7 @@ signal (SIGILL, float_error); #endif /* BSD_SYSTEM */ + SIGNAL_THREAD_CHECK (signo); in_float = 0; Fsignal (Qarith_error, Fcons (float_error_arg, Qnil)); diff -r 6b379caca6fa -r 4ee39d9428b0 src/indent.c --- a/src/indent.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/indent.c Thu Dec 23 16:43:51 2004 +0000 @@ -2094,8 +2094,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)); } diff -r 6b379caca6fa -r 4ee39d9428b0 src/keyboard.c --- a/src/keyboard.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/keyboard.c Thu Dec 23 16:43:51 2004 +0000 @@ -3038,6 +3038,7 @@ /* Save the echo status. */ int saved_immediate_echo = current_kboard->immediate_echo; struct kboard *saved_ok_to_echo = ok_to_echo_at_next_pause; + Lisp_Object saved_echo_string = current_kboard->echo_string; int saved_echo_after_prompt = current_kboard->echo_after_prompt; #if 0 @@ -3092,6 +3093,7 @@ cancel_echoing (); ok_to_echo_at_next_pause = saved_ok_to_echo; + current_kboard->echo_string = saved_echo_string; current_kboard->echo_after_prompt = saved_echo_after_prompt; if (saved_immediate_echo) echo_now (); @@ -3574,6 +3576,9 @@ } #endif + +Lisp_Object Vthrow_on_input; + /* Store an event obtained at interrupt level into kbd_buffer, fifo */ void @@ -3699,6 +3704,24 @@ *kbd_store_ptr = *event; ++kbd_store_ptr; } + + /* If we're inside while-no-input, and this event qualifies + as input, set quit-flag to cause an interrupt. */ + if (!NILP (Vthrow_on_input) + && event->kind != FOCUS_IN_EVENT + && event->kind != HELP_EVENT + && event->kind != DEICONIFY_EVENT) + { + Vquit_flag = Vthrow_on_input; + /* If we're inside a function that wants immediate quits, + do it now. */ + if (immediate_quit && NILP (Vinhibit_quit)) + { + immediate_quit = 0; + sigfree (); + QUIT; + } + } } @@ -6849,24 +6872,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; @@ -6895,22 +6900,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 */ @@ -6927,6 +6916,8 @@ #ifdef SYNC_INPUT interrupt_input_pending = 1; #else + + SIGNAL_THREAD_CHECK (signo); handle_async_input (); #endif @@ -10379,6 +10370,7 @@ char c; struct frame *sf = SELECTED_FRAME (); + SIGNAL_THREAD_CHECK (signalnum); cancel_echoing (); /* XXX This code needs to be revised for multi-tty support. */ @@ -11525,6 +11517,12 @@ doc: /* *How long to display an echo-area message when the minibuffer is active. If the value is not a number, such messages don't time out. */); Vminibuffer_message_timeout = make_number (2); + + DEFVAR_LISP ("throw-on-input", &Vthrow_on_input, + doc: /* If non-nil, any keyboard input throws to this symbol. +The value of that variable is passed to `quit-flag' and later causes a +peculiar kind of quitting. */); + Vthrow_on_input = Qnil; } void diff -r 6b379caca6fa -r 4ee39d9428b0 src/lisp.h --- a/src/lisp.h Fri Dec 10 15:24:54 2004 +0000 +++ b/src/lisp.h Thu Dec 23 16:43:51 2004 +0000 @@ -1768,11 +1768,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) \ @@ -1785,7 +1789,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) @@ -2876,6 +2883,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); @@ -3041,7 +3049,7 @@ /* defined in undo.c */ extern Lisp_Object Qinhibit_read_only; EXFUN (Fundo_boundary, 0); -extern Lisp_Object truncate_undo_list P_ ((Lisp_Object, int, int, int)); +extern void truncate_undo_list P_ ((struct buffer *)); extern void record_marker_adjustment P_ ((Lisp_Object, int)); extern void record_insert P_ ((int, int)); extern void record_delete P_ ((int, Lisp_Object)); @@ -3050,6 +3058,7 @@ extern void record_property_change P_ ((int, int, Lisp_Object, Lisp_Object, Lisp_Object)); extern void syms_of_undo P_ ((void)); +extern Lisp_Object Vundo_outer_limit; /* defined in textprop.c */ extern Lisp_Object Qfont, Qmouse_face; diff -r 6b379caca6fa -r 4ee39d9428b0 src/macterm.c --- a/src/macterm.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/macterm.c Thu Dec 23 16:43:51 2004 +0000 @@ -5976,7 +5976,7 @@ strcpy(cs, "mac-cyrillic"); break; case kTextEncodingMacCentralEurRoman: - strcpy(cs, "mac-centraleuropean"); + strcpy(cs, "mac-centraleurroman"); break; case kTextEncodingMacSymbol: case kTextEncodingMacDingbats: @@ -6034,7 +6034,7 @@ coding_system = Qeuc_kr; else if (strcmp (cs, "mac-roman") == 0 || strcmp (cs, "mac-cyrillic") == 0 - || strcmp (cs, "mac-centraleuropean") == 0 + || strcmp (cs, "mac-centraleurroman") == 0 || strcmp (cs, "adobe-fontspecific") == 0) strcpy (mf, family); else @@ -6276,6 +6276,28 @@ }; static Lisp_Object +mac_c_string_match (regexp, string, nonspecial, exact) + Lisp_Object regexp; + const char *string, *nonspecial; + int exact; +{ + if (exact) + { + if (strcmp (string, nonspecial) == 0) + return build_string (string); + } + else if (strstr (string, nonspecial)) + { + Lisp_Object str = build_string (string); + + if (fast_string_match (regexp, str) >= 0) + return str; + } + + return Qnil; +} + +static Lisp_Object mac_do_list_fonts (pattern, maxnames) char *pattern; int maxnames; @@ -6286,6 +6308,8 @@ char scaled[256]; char *ptr; int scl_val[XLFD_SCL_LAST], *field, *val; + char *longest_start, *cur_start, *nonspecial; + int longest_len, cur_len, exact; for (i = 0; i < XLFD_SCL_LAST; i++) scl_val[i] = -1; @@ -6343,34 +6367,66 @@ ptr = regex; *ptr++ = '^'; - /* Turn pattern into a regexp and do a regexp match. */ + longest_start = cur_start = ptr; + longest_len = cur_len = 0; + exact = 1; + + /* Turn pattern into a regexp and do a regexp match. Also find the + longest substring containing no special characters. */ for (; *pattern; pattern++) { - if (*pattern == '?') - *ptr++ = '.'; - else if (*pattern == '*') - { - *ptr++ = '.'; - *ptr++ = '*'; - } + if (*pattern == '?' || *pattern == '*') + { + if (cur_len > longest_len) + { + longest_start = cur_start; + longest_len = cur_len; + } + cur_len = 0; + exact = 0; + + if (*pattern == '?') + *ptr++ = '.'; + else /* if (*pattern == '*') */ + { + *ptr++ = '.'; + *ptr++ = '*'; + } + } else - *ptr++ = tolower (*pattern); - } + { + if (cur_len == 0) + cur_start = ptr; + cur_len++; + + *ptr++ = tolower (*pattern); + } + } + + if (cur_len > longest_len) + { + longest_start = cur_start; + longest_len = cur_len; + } + *ptr = '$'; *(ptr + 1) = '\0'; + nonspecial = xmalloc (longest_len + 1); + strncpy (nonspecial, longest_start, longest_len); + nonspecial[longest_len] = '\0'; + pattern_regex = build_string (regex); for (i = 0; i < font_name_count; i++) { - fontname = build_string (font_name_table[i]); - if (fast_string_match (pattern_regex, fontname) >= 0) + fontname = mac_c_string_match (pattern_regex, font_name_table[i], + nonspecial, exact); + if (!NILP (fontname)) { font_list = Fcons (fontname, font_list); - - n_fonts++; - if (maxnames > 0 && n_fonts >= maxnames) - break; + if (exact || maxnames > 0 && ++n_fonts >= maxnames) + break; } else if (scl_val[XLFD_SCL_PIXEL_SIZE] > 0 && (ptr = strstr (font_name_table[i], "-0-0-75-75-m-0-"))) @@ -6384,17 +6440,19 @@ scl_val[XLFD_SCL_POINT_SIZE], scl_val[XLFD_SCL_AVGWIDTH], ptr + sizeof ("-0-0-75-75-m-0-") - 1); - fontname = build_string (scaled); - if (fast_string_match (pattern_regex, fontname) >= 0) + fontname = mac_c_string_match (pattern_regex, scaled, + nonspecial, exact); + if (!NILP (fontname)) { font_list = Fcons (fontname, font_list); - - n_fonts++; - if (maxnames > 0 && n_fonts >= maxnames) + if (exact || maxnames > 0 && ++n_fonts >= maxnames) break; } } } + + xfree (nonspecial); + return font_list; } diff -r 6b379caca6fa -r 4ee39d9428b0 src/minibuf.c --- a/src/minibuf.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/minibuf.c Thu Dec 23 16:43:51 2004 +0000 @@ -1232,6 +1232,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; @@ -1258,7 +1259,7 @@ } else if (type == 2) { - if (XFASTINT (bucket) != 0) + if (!EQ (bucket, zero)) { elt = bucket; eltstring = Fsymbol_name (elt); @@ -1290,16 +1291,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. */ { @@ -1353,9 +1352,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)) @@ -1386,15 +1385,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)))) @@ -1481,13 +1480,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; @@ -1514,7 +1514,7 @@ } else if (type == 2) { - if (XFASTINT (bucket) != 0) + if (!EQ (bucket, zero)) { elt = bucket; eltstring = Fsymbol_name (elt); @@ -1552,9 +1552,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))) diff -r 6b379caca6fa -r 4ee39d9428b0 src/process.c --- a/src/process.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/process.c Thu Dec 23 16:43:51 2004 +0000 @@ -5104,6 +5104,7 @@ SIGTYPE send_process_trap () { + SIGNAL_THREAD_CHECK (SIGPIPE); #ifdef BSD4_1 sigrelse (SIGPIPE); sigrelse (SIGALRM); @@ -6146,6 +6147,8 @@ register struct Lisp_Process *p; extern EMACS_TIME *input_available_clear_time; + SIGNAL_THREAD_CHECK (signo); + #ifdef BSD4_1 extern int sigheld; sigheld |= sigbit (SIGCHLD); diff -r 6b379caca6fa -r 4ee39d9428b0 src/regex.c --- a/src/regex.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/regex.c Thu Dec 23 16:43:51 2004 +0000 @@ -5860,7 +5860,7 @@ PREFETCH_NOLIMIT (); c2 = RE_STRING_CHAR (d, dend - d); #ifdef emacs - UPDATE_SYNTAX_TABLE_FORWARD (charpos); + UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1); #endif s2 = SYNTAX (c2); @@ -5947,7 +5947,7 @@ PREFETCH_NOLIMIT (); c2 = RE_STRING_CHAR (d, dend - d); #ifdef emacs - UPDATE_SYNTAX_TABLE_FORWARD (charpos); + UPDATE_SYNTAX_TABLE_FORWARD (charpos + 1); #endif s2 = SYNTAX (c2); diff -r 6b379caca6fa -r 4ee39d9428b0 src/syntax.c --- a/src/syntax.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/syntax.c Thu Dec 23 16:43:51 2004 +0000 @@ -1295,6 +1295,7 @@ (arg) Lisp_Object arg; { + Lisp_Object tmp; int orig_val, val; if (NILP (arg)) @@ -1307,8 +1308,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; diff -r 6b379caca6fa -r 4ee39d9428b0 src/sysdep.c --- a/src/sysdep.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/sysdep.c Thu Dec 23 16:43:51 2004 +0000 @@ -2567,6 +2567,7 @@ #else /* not BSD4_1 */ signal (SIGALRM, SIG_IGN); #endif /* not BSD4_1 */ + SIGNAL_THREAD_CHECK (SIGALRM); if (read_alarm_should_throw) longjmp (read_alarm_throw, 1); } diff -r 6b379caca6fa -r 4ee39d9428b0 src/syssignal.h --- a/src/syssignal.h Fri Dec 10 15:24:54 2004 +0000 +++ b/src/syssignal.h Thu Dec 23 16:43:51 2004 +0000 @@ -20,6 +20,11 @@ extern void init_signals P_ ((void)); +#ifdef HAVE_GTK_AND_PTHREAD +#include +extern pthread_t main_thread; +#endif + #ifdef POSIX_SIGNALS /* Don't #include . That header should always be #included @@ -199,5 +204,27 @@ char *strsignal (); #endif +#ifdef HAVE_GTK_AND_PTHREAD +#define SIGNAL_THREAD_CHECK(signo) \ + do { \ + 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, signo); \ + pthread_sigmask (SIG_BLOCK, &new_mask, 0); \ + pthread_kill (main_thread, signo); \ + return; \ + } \ + } while (0) + +#else /* not HAVE_GTK_AND_PTHREAD */ +#define SIGNAL_THREAD_CHECK(signo) +#endif /* not HAVE_GTK_AND_PTHREAD */ /* arch-tag: 4580e86a-340d-4574-9e11-a742b6e1a152 (do not change this comment) */ diff -r 6b379caca6fa -r 4ee39d9428b0 src/term.c --- a/src/term.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/term.c Thu Dec 23 16:43:51 2004 +0000 @@ -640,11 +640,11 @@ required = MAX_MULTIBYTE_LENGTH * src_len; if (encode_terminal_bufsize < required) { - encode_terminal_bufsize = required; if (encode_terminal_bufsize == 0) encode_terminal_buf = xmalloc (required); else encode_terminal_buf = xrealloc (encode_terminal_buf, required); + encode_terminal_bufsize = required; } buf = encode_terminal_buf; diff -r 6b379caca6fa -r 4ee39d9428b0 src/undo.c --- a/src/undo.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/undo.c Thu Dec 23 16:43:51 2004 +0000 @@ -24,6 +24,17 @@ #include "buffer.h" #include "commands.h" +/* Limits controlling how much undo information to keep. */ + +EMACS_INT undo_limit; +EMACS_INT undo_strong_limit; + +Lisp_Object Vundo_outer_limit; + +/* Function to call when undo_outer_limit is exceeded. */ + +Lisp_Object Vundo_outer_limit_function; + /* Last buffer for which undo information was recorded. */ Lisp_Object last_undo_buffer; @@ -291,31 +302,35 @@ } /* At garbage collection time, make an undo list shorter at the end, - returning the truncated list. - MINSIZE, MAXSIZE and LIMITSIZE are the limits on size allowed, - as described below. - In practice, these are the values of undo-limit, - undo-strong-limit, and undo-outer-limit. */ + returning the truncated list. How this is done depends on the + variables undo-limit, undo-strong-limit and undo-outer-limit. + In some cases this works by calling undo-outer-limit-function. */ -Lisp_Object -truncate_undo_list (list, minsize, maxsize, limitsize) - Lisp_Object list; - int minsize, maxsize, limitsize; +void +truncate_undo_list (b) + struct buffer *b; { + Lisp_Object list; Lisp_Object prev, next, last_boundary; int size_so_far = 0; + /* Make sure that calling undo-outer-limit-function + won't cause another GC. */ + int count = inhibit_garbage_collection (); + + /* Make the buffer current to get its local values of variables such + as undo_limit. Also so that Vundo_outer_limit_function can + tell which buffer to operate on. */ + record_unwind_protect (set_buffer_if_live, Fcurrent_buffer ()); + set_buffer_internal (b); + + list = b->undo_list; + prev = Qnil; next = list; last_boundary = Qnil; - /* Always preserve at least the most recent undo record - unless it is really horribly big. - If the first element is an undo boundary, skip past it. - - Skip, skip, skip the undo, skip, skip, skip the undo, - Skip, skip, skip the undo, skip to the undo bound'ry. - (Get it? "Skip to my Loo?") */ + /* If the first element is an undo boundary, skip past it. */ if (CONSP (next) && NILP (XCAR (next))) { /* Add in the space occupied by this element and its chain link. */ @@ -326,6 +341,12 @@ next = XCDR (next); } + /* Always preserve at least the most recent undo record + unless it is really horribly big. + + Skip, skip, skip the undo, skip, skip, skip the undo, + Skip, skip, skip the undo, skip to the undo bound'ry. */ + while (CONSP (next) && ! NILP (XCAR (next))) { Lisp_Object elt; @@ -341,35 +362,53 @@ + SCHARS (XCAR (elt))); } - /* If we reach LIMITSIZE before the first boundary, - we're heading for memory full, so truncate the list to nothing. */ - if (size_so_far > limitsize) - return Qnil; - /* Advance to next element. */ prev = next; next = XCDR (next); } + /* If by the first boundary we have already passed undo_outer_limit, + we're heading for memory full, so offer to clear out the list. */ + if (INTEGERP (Vundo_outer_limit) + && size_so_far > XINT (Vundo_outer_limit) + && !NILP (Vundo_outer_limit_function)) + { + Lisp_Object temp = last_undo_buffer; + + /* Normally the function this calls is undo-outer-limit-truncate. */ + if (! NILP (call1 (Vundo_outer_limit_function, + make_number (size_so_far)))) + { + /* The function is responsible for making + any desired changes in buffer-undo-list. */ + unbind_to (count, Qnil); + return; + } + /* That function probably used the minibuffer, and if so, that + changed last_undo_buffer. Change it back so that we don't + force next change to make an undo boundary here. */ + last_undo_buffer = temp; + } + if (CONSP (next)) last_boundary = prev; - /* Keep more if it fits. */ + /* Keep additional undo data, if it fits in the limits. */ while (CONSP (next)) { Lisp_Object elt; elt = XCAR (next); /* When we get to a boundary, decide whether to truncate - either before or after it. The lower threshold, MINSIZE, + either before or after it. The lower threshold, undo_limit, tells us to truncate after it. If its size pushes past - the higher threshold MAXSIZE as well, we truncate before it. */ + the higher threshold undo_strong_limit, we truncate before it. */ if (NILP (elt)) { - if (size_so_far > maxsize) + if (size_so_far > undo_strong_limit) break; last_boundary = prev; - if (size_so_far > minsize) + if (size_so_far > undo_limit) break; } @@ -390,16 +429,15 @@ /* If we scanned the whole list, it is short enough; don't change it. */ if (NILP (next)) - return list; - + ; /* Truncate at the boundary where we decided to truncate. */ - if (!NILP (last_boundary)) - { - XSETCDR (last_boundary, Qnil); - return list; - } + else if (!NILP (last_boundary)) + XSETCDR (last_boundary, Qnil); + /* There's nothing we decided to keep, so clear it out. */ else - return Qnil; + b->undo_list = Qnil; + + unbind_to (count, Qnil); } DEFUN ("primitive-undo", Fprimitive_undo, Sprimitive_undo, 2, 2, 0, @@ -563,6 +601,54 @@ defsubr (&Sprimitive_undo); defsubr (&Sundo_boundary); + + DEFVAR_INT ("undo-limit", &undo_limit, + doc: /* Keep no more undo information once it exceeds this size. +This limit is applied when garbage collection happens. +When a previous command increases the total undo list size past this +value, the earlier commands that came before it are forgotten. + +The size is counted as the number of bytes occupied, +which includes both saved text and other data. */); + undo_limit = 20000; + + DEFVAR_INT ("undo-strong-limit", &undo_strong_limit, + doc: /* Don't keep more than this much size of undo information. +This limit is applied when garbage collection happens. +When a previous command increases the total undo list size past this +value, that command and the earlier commands that came before it are forgotten. +However, the most recent buffer-modifying command's undo info +is never discarded for this reason. + +The size is counted as the number of bytes occupied, +which includes both saved text and other data. */); + undo_strong_limit = 30000; + + DEFVAR_LISP ("undo-outer-limit", &Vundo_outer_limit, + doc: /* Outer limit on size of undo information for one command. +At garbage collection time, if the current command has produced +more than this much undo information, it asks you whether to delete +the information. This is a last-ditch limit to prevent memory overflow. + +The size is counted as the number of bytes occupied, +which includes both saved text and other data. + +In fact, this calls the function which is the value of +`undo-outer-limit-function' with one argument, the size. +The text above describes the behavior of the function +that variable usually specifies. */); + Vundo_outer_limit = make_number (300000); + + DEFVAR_LISP ("undo-outer-limit-function", &Vundo_outer_limit_function, + doc: /* Function to call when an undo list exceeds `undo-outer-limit'. +This function is called with one argument, the current undo list size +for the most recent command (since the last undo boundary). +If the function returns t, that means truncation has been fully handled. +If it returns nil, the other forms of truncation are done. + +Garbage collection is inhibited around the call to this function, +so it must make sure not to do a lot of consing. */); + Vundo_outer_limit_function = Qnil; } /* arch-tag: d546ee01-4aed-4ffb-bb8b-eefaae50d38a diff -r 6b379caca6fa -r 4ee39d9428b0 src/w32term.c --- a/src/w32term.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/w32term.c Thu Dec 23 16:43:51 2004 +0000 @@ -5374,47 +5374,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 diff -r 6b379caca6fa -r 4ee39d9428b0 src/xdisp.c --- a/src/xdisp.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/xdisp.c Thu Dec 23 16:43:51 2004 +0000 @@ -4914,7 +4914,9 @@ || (it->multibyte_p ? ((it->c >= 127 && it->len == 1) - || !CHAR_PRINTABLE_P (it->c)) + || !CHAR_PRINTABLE_P (it->c) + || it->c == 0x8ad + || it->c == 0x8a0) : (it->c >= 127 && (!unibyte_display_via_language_environment || it->c == unibyte_char_to_multibyte (it->c))))) @@ -4957,6 +4959,21 @@ XSETINT (it->ctl_chars[1], g); ctl_len = 2; } + else if (it->c == 0x8a0 || it->c == 0x8ad) + { + /* Set IT->ctl_chars[0] to the glyph for `\\'. */ + if (it->dp + && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) + && GLYPH_CHAR_VALID_P (XINT (DISP_ESCAPE_GLYPH (it->dp)))) + g = XINT (DISP_ESCAPE_GLYPH (it->dp)); + else + g = FAST_MAKE_GLYPH ('\\', face_id); + XSETINT (it->ctl_chars[0], g); + + g = FAST_MAKE_GLYPH (it->c == 0x8ad ? '-' : ' ', face_id); + XSETINT (it->ctl_chars[1], g); + ctl_len = 2; + } else { unsigned char str[MAX_MULTIBYTE_LENGTH]; @@ -5139,6 +5156,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); diff -r 6b379caca6fa -r 4ee39d9428b0 src/xselect.c --- a/src/xselect.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/xselect.c Thu Dec 23 16:43:51 2004 +0000 @@ -2348,7 +2348,7 @@ Fcons (x_atom_to_symbol (display, type), Fcons (make_number (format), Qnil)))); - ret = (bytes ? make_string ((char *) data, bytes) : Qnil); + ret = (bytes ? make_unibyte_string ((char *) data, bytes) : Qnil); /* Use xfree, not XFree, because x_get_window_property calls xmalloc itself. */ xfree (data); diff -r 6b379caca6fa -r 4ee39d9428b0 src/xterm.c --- a/src/xterm.c Fri Dec 10 15:24:54 2004 +0000 +++ b/src/xterm.c Thu Dec 23 16:43:51 2004 +0000 @@ -4286,8 +4286,6 @@ int part = -1, whole = 0, portion = 0; GtkAdjustment *adj = GTK_ADJUSTMENT (gtk_range_get_adjustment (widget)); - if (xg_ignore_gtk_scrollbar) return; - position = gtk_adjustment_get_value (adj); p = g_object_get_data (G_OBJECT (widget), XG_LAST_SB_DATA); @@ -4301,6 +4299,8 @@ previous = *p; *p = position; + if (xg_ignore_gtk_scrollbar) return; + diff = (int) (position - previous); if (diff == (int) adj->step_increment) @@ -4332,7 +4332,7 @@ } if (part >= 0) - { + { window_being_scrolled = bar->window; last_scroll_bar_part = part; x_send_scroll_bar_event (bar->window, part, portion, whole); @@ -8155,20 +8155,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); @@ -8190,15 +8181,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 @@ -8314,7 +8297,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;