aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiles Bader2007-06-16 22:32:13 +0000
committerMiles Bader2007-06-16 22:32:13 +0000
commitb36153926049c95ef192786f4ef6151dc6506de4 (patch)
tree51890fa5961aa1dc989178cbbfabb03d2e443687
parent650e2d284dcf9786a78abc3fef12599cf60d95da (diff)
parent1562d1e9a73e608dbfe76bbedbeb2350d39e224f (diff)
downloademacs-b36153926049c95ef192786f4ef6151dc6506de4.tar.gz
emacs-b36153926049c95ef192786f4ef6151dc6506de4.zip
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 793-802) - Update from CVS - Remove RCS keywords - Merge from emacs--rel--22 * emacs--rel--22 (patch 42-50) - Update from CVS - Merge from gnus--rel--5.10 - Gnus ChangeLog tweaks * gnus--rel--5.10 (patch 229-232) - Merge from emacs--devo--0, emacs--rel--22 - ChangeLog tweak - Update from CVS Revision: emacs@sv.gnu.org/emacs--unicode--0--patch-223
-rw-r--r--ChangeLog27
-rwxr-xr-xconfigure355
-rw-r--r--configure.in119
-rw-r--r--etc/ChangeLog15
-rw-r--r--etc/NEWS40
-rw-r--r--etc/PROBLEMS3
-rw-r--r--etc/TODO8
-rw-r--r--etc/emacs.1605
-rw-r--r--lisp/ChangeLog315
-rw-r--r--lisp/cmuscheme.el2
-rw-r--r--lisp/complete.el9
-rw-r--r--lisp/completion.el4
-rw-r--r--lisp/cus-edit.el72
-rw-r--r--lisp/custom.el5
-rw-r--r--lisp/desktop.el567
-rw-r--r--lisp/diff-mode.el2
-rw-r--r--lisp/ediff-init.el4
-rw-r--r--lisp/ediff-mult.el62
-rw-r--r--lisp/ediff-ptch.el21
-rw-r--r--lisp/ediff.el4
-rw-r--r--lisp/emacs-lisp/bytecomp.el47
-rw-r--r--lisp/emacs-lisp/edebug.el4
-rw-r--r--lisp/emulation/tpu-edt.el321
-rw-r--r--lisp/emulation/tpu-mapper.el6
-rw-r--r--lisp/emulation/viper-cmd.el10
-rw-r--r--lisp/emulation/viper-init.el15
-rw-r--r--lisp/emulation/viper-keym.el4
-rw-r--r--lisp/emulation/viper-util.el6
-rw-r--r--lisp/emulation/viper.el104
-rw-r--r--lisp/erc/ChangeLog4
-rw-r--r--lisp/erc/erc-goodies.el2
-rw-r--r--lisp/filesets.el2
-rw-r--r--lisp/follow.el4
-rw-r--r--lisp/font-lock.el8
-rw-r--r--lisp/gnus/ChangeLog11
-rw-r--r--lisp/gnus/ChangeLog.226
-rw-r--r--lisp/gnus/gnus-agent.el2
-rw-r--r--lisp/gnus/gnus-ems.el1
-rw-r--r--lisp/gnus/nntp.el3
-rw-r--r--lisp/image-dired.el13
-rw-r--r--lisp/indent.el4
-rw-r--r--lisp/log-view.el23
-rw-r--r--lisp/mb-depth.el72
-rw-r--r--lisp/net/rcirc.el797
-rw-r--r--lisp/pcomplete.el2
-rw-r--r--lisp/play/gamegrid.el3
-rw-r--r--lisp/progmodes/python.el2
-rw-r--r--lisp/progmodes/sh-script.el217
-rw-r--r--lisp/savehist.el4
-rw-r--r--lisp/scroll-lock.el2
-rw-r--r--lisp/server.el5
-rw-r--r--lisp/shell.el2
-rw-r--r--lisp/startup.el4
-rw-r--r--lisp/subr.el9
-rw-r--r--lisp/term/mac-win.el2
-rw-r--r--lisp/term/x-win.el2
-rw-r--r--lisp/term/xterm.el12
-rw-r--r--lisp/textmodes/bibtex-style.el155
-rw-r--r--lisp/textmodes/org-publish.el2
-rw-r--r--lisp/thingatpt.el31
-rw-r--r--lisp/thumbs.el2
-rw-r--r--lisp/tutorial.el3
-rw-r--r--lisp/url/ChangeLog15
-rw-r--r--lisp/url/url-cookie.el63
-rw-r--r--lisp/url/url.el3
-rw-r--r--lisp/vc-arch.el2
-rw-r--r--lisp/vc-bzr.el8
-rw-r--r--lisp/vc-svn.el7
-rw-r--r--lisp/vc.el8
-rw-r--r--lisp/wid-edit.el98
-rw-r--r--lisp/x-dnd.el8
-rw-r--r--lispref/.gitignore4
-rw-r--r--lispref/ChangeLog50
-rw-r--r--lispref/anti.texi2
-rw-r--r--lispref/display.texi50
-rw-r--r--lispref/os.texi5
-rw-r--r--lispref/searching.texi10
-rw-r--r--lispref/two-volume-cross-refs.txt76
-rw-r--r--lispref/two-volume.make227
-rw-r--r--lispref/vol1.texi1077
-rw-r--r--lispref/vol2.texi1078
-rw-r--r--lwlib/ChangeLog4
-rw-r--r--lwlib/lwlib-Xaw.c9
-rw-r--r--lwlib/lwlib.c4
-rw-r--r--nt/ChangeLog6
-rw-r--r--nt/emacs.manifest11
-rw-r--r--nt/emacs.rc1
-rw-r--r--src/ChangeLog103
-rw-r--r--src/composite.c13
-rw-r--r--src/config.in6
-rw-r--r--src/dispextern.h4
-rw-r--r--src/editfns.c13
-rw-r--r--src/frame.h4
-rw-r--r--src/image.c22
-rw-r--r--src/macfns.c29
-rw-r--r--src/macgui.h7
-rw-r--r--src/macmenu.c4
-rw-r--r--src/macterm.c662
-rw-r--r--src/macterm.h20
-rw-r--r--src/regex.c71
-rw-r--r--src/term.c1
-rw-r--r--src/w32.c82
-rw-r--r--src/w32menu.c31
-rw-r--r--src/xdisp.c6
-rw-r--r--src/xfns.c5
-rw-r--r--src/xmenu.c4
106 files changed, 5764 insertions, 2336 deletions
diff --git a/ChangeLog b/ChangeLog
index 73ff53b8a78..f8bcf45ac3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,30 @@
12007-06-14 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
2
3 * configure.in: Check for all image libraries before exiting.
4
52007-06-13 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
6
7 * configure.in: Exit with error if image libraries aren't found.
8
92007-06-13 Michael Kifer <kifer@cs.stonybrook.edu>
10
11 * ediff-ptch.el (ediff-context-diff-label-regexp): partially undid
12 previous patch
13
142007-06-13 Chong Yidong <cyd@stupidchicken.com>
15
16 * configure.in: Merge xaw3d and libXaw checks. Check xaw3d even
17 when compiling without scrollbars.
18
192007-06-12 Glenn Morris <rgm@gnu.org>
20
21 * configure.in (HAVE_GIF): If -lungif fails, try -lgif.
22
232007-06-11 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
24
25 * configure.in: Change wording about yes/gtk and lucid/athena being
26 synonyms.
27
12007-06-08 Glenn Morris <rgm@gnu.org> 282007-06-08 Glenn Morris <rgm@gnu.org>
2 29
3 * configure.in: Make gtk the default toolkit. 30 * configure.in: Make gtk the default toolkit.
diff --git a/configure b/configure
index e6b13b98bff..b348c5704ab 100755
--- a/configure
+++ b/configure
@@ -1345,7 +1345,7 @@ Optional Packages:
1345 --with-xpm use -lXpm for displaying XPM images 1345 --with-xpm use -lXpm for displaying XPM images
1346 --with-jpeg use -ljpeg for displaying JPEG images 1346 --with-jpeg use -ljpeg for displaying JPEG images
1347 --with-tiff use -ltiff for displaying TIFF images 1347 --with-tiff use -ltiff for displaying TIFF images
1348 --with-gif use -lungif for displaying GIF images 1348 --with-gif use -lungif (or -lgif) for displaying GIF images
1349 --with-png use -lpng for displaying PNG images 1349 --with-png use -lpng for displaying PNG images
1350 --with-freetype use -lfreetype for local fonts support 1350 --with-freetype use -lfreetype for local fonts support
1351 --with-xft use -lXft for anti aliased fonts 1351 --with-xft use -lXft for anti aliased fonts
@@ -1908,12 +1908,12 @@ if test "${with_x_toolkit+set}" = set; then
1908 m | mo | mot | moti | motif ) val=motif ;; 1908 m | mo | mot | moti | motif ) val=motif ;;
1909 g | gt | gtk ) val=gtk ;; 1909 g | gt | gtk ) val=gtk ;;
1910 * ) 1910 * )
1911{ { echo "$as_me:$LINENO: error: \`--with-x-toolkit=$withval' is invalid\; 1911{ { echo "$as_me:$LINENO: error: \`--with-x-toolkit=$withval' is invalid;
1912this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'. 1912this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'.
1913Currently, \`yes' and \`gtk', and \`athena' and \`lucid' are synonyms." >&5 1913\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." >&5
1914echo "$as_me: error: \`--with-x-toolkit=$withval' is invalid\; 1914echo "$as_me: error: \`--with-x-toolkit=$withval' is invalid;
1915this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'. 1915this option's value should be \`yes', \`no', \`lucid', \`athena', \`motif' or \`gtk'.
1916Currently, \`yes' and \`gtk', and \`athena' and \`lucid' are synonyms." >&2;} 1916\`yes' and \`gtk' are synonyms. \`athena' and \`lucid' are synonyms." >&2;}
1917 { (exit 1); exit 1; }; } 1917 { (exit 1); exit 1; }; }
1918 ;; 1918 ;;
1919 esac 1919 esac
@@ -11807,11 +11807,14 @@ _ACEOF
11807 fi 11807 fi
11808fi 11808fi
11809 11809
11810HAVE_XAW3D=no
11810if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then 11811if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
11811 if test x"${HAVE_X11R5}" = xyes; then 11812 if test x"${HAVE_X11R5}" != xyes; then
11812 { echo "$as_me:$LINENO: checking X11 version 5 with Xaw" >&5 11813 USE_X_TOOLKIT=none
11813echo $ECHO_N "checking X11 version 5 with Xaw... $ECHO_C" >&6; } 11814 else
11814 if test "${emacs_cv_x11_version_5_with_xaw+set}" = set; then 11815 { echo "$as_me:$LINENO: checking for xaw3d" >&5
11816echo $ECHO_N "checking for xaw3d... $ECHO_C" >&6; }
11817 if test "${emacs_cv_xaw3d+set}" = set; then
11815 echo $ECHO_N "(cached) $ECHO_C" >&6 11818 echo $ECHO_N "(cached) $ECHO_C" >&6
11816else 11819else
11817 cat >conftest.$ac_ext <<_ACEOF 11820 cat >conftest.$ac_ext <<_ACEOF
@@ -11822,7 +11825,7 @@ cat >>conftest.$ac_ext <<_ACEOF
11822/* end confdefs.h. */ 11825/* end confdefs.h. */
11823 11826
11824#include <X11/Intrinsic.h> 11827#include <X11/Intrinsic.h>
11825#include <X11/Xaw/Simple.h> 11828#include <X11/Xaw3d/Simple.h>
11826int 11829int
11827main () 11830main ()
11828{ 11831{
@@ -11849,35 +11852,97 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11849 test ! -s conftest.err 11852 test ! -s conftest.err
11850 } && test -s conftest$ac_exeext && 11853 } && test -s conftest$ac_exeext &&
11851 $as_test_x conftest$ac_exeext; then 11854 $as_test_x conftest$ac_exeext; then
11852 emacs_cv_x11_version_5_with_xaw=yes 11855 emacs_cv_xaw3d=yes
11853else 11856else
11854 echo "$as_me: failed program was:" >&5 11857 echo "$as_me: failed program was:" >&5
11855sed 's/^/| /' conftest.$ac_ext >&5 11858sed 's/^/| /' conftest.$ac_ext >&5
11856 11859
11857 emacs_cv_x11_version_5_with_xaw=no 11860 emacs_cv_xaw3d=no
11858fi 11861fi
11859 11862
11860rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ 11863rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11861 conftest$ac_exeext conftest.$ac_ext 11864 conftest$ac_exeext conftest.$ac_ext
11862fi 11865fi
11863 11866
11864 if test $emacs_cv_x11_version_5_with_xaw = yes; then 11867 if test $emacs_cv_xaw3d = yes; then
11865 { echo "$as_me:$LINENO: result: 5 or newer, with Xaw; use toolkit by default" >&5 11868 { echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
11866echo "${ECHO_T}5 or newer, with Xaw; use toolkit by default" >&6; } 11869echo "${ECHO_T}yes; using Lucid toolkit" >&6; }
11867 USE_X_TOOLKIT=LUCID 11870 USE_X_TOOLKIT=LUCID
11871 HAVE_XAW3D=yes
11872
11873cat >>confdefs.h <<\_ACEOF
11874#define HAVE_XAW3D 1
11875_ACEOF
11876
11868 else 11877 else
11869 if test x"${USE_X_TOOLKIT}" = xLUCID; then 11878 { echo "$as_me:$LINENO: result: no" >&5
11879echo "${ECHO_T}no" >&6; }
11880 { echo "$as_me:$LINENO: checking for libXaw" >&5
11881echo $ECHO_N "checking for libXaw... $ECHO_C" >&6; }
11882 if test "${emacs_cv_xaw+set}" = set; then
11883 echo $ECHO_N "(cached) $ECHO_C" >&6
11884else
11885 cat >conftest.$ac_ext <<_ACEOF
11886/* confdefs.h. */
11887_ACEOF
11888cat confdefs.h >>conftest.$ac_ext
11889cat >>conftest.$ac_ext <<_ACEOF
11890/* end confdefs.h. */
11891
11892#include <X11/Intrinsic.h>
11893#include <X11/Xaw/Simple.h>
11894int
11895main ()
11896{
11897
11898 ;
11899 return 0;
11900}
11901_ACEOF
11902rm -f conftest.$ac_objext conftest$ac_exeext
11903if { (ac_try="$ac_link"
11904case "(($ac_try" in
11905 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
11906 *) ac_try_echo=$ac_try;;
11907esac
11908eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
11909 (eval "$ac_link") 2>conftest.er1
11910 ac_status=$?
11911 grep -v '^ *+' conftest.er1 >conftest.err
11912 rm -f conftest.er1
11913 cat conftest.err >&5
11914 echo "$as_me:$LINENO: \$? = $ac_status" >&5
11915 (exit $ac_status); } && {
11916 test -z "$ac_c_werror_flag" ||
11917 test ! -s conftest.err
11918 } && test -s conftest$ac_exeext &&
11919 $as_test_x conftest$ac_exeext; then
11920 emacs_cv_xaw=yes
11921else
11922 echo "$as_me: failed program was:" >&5
11923sed 's/^/| /' conftest.$ac_ext >&5
11924
11925 emacs_cv_xaw=no
11926fi
11927
11928rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
11929 conftest$ac_exeext conftest.$ac_ext
11930fi
11931
11932 if test $emacs_cv_xaw = yes; then
11933 { echo "$as_me:$LINENO: result: yes; using Lucid toolkit" >&5
11934echo "${ECHO_T}yes; using Lucid toolkit" >&6; }
11935 USE_X_TOOLKIT=LUCID
11936 elif test x"${USE_X_TOOLKIT}" = xLUCID; then
11870 { { echo "$as_me:$LINENO: error: Lucid toolkit requires X11/Xaw include files" >&5 11937 { { echo "$as_me:$LINENO: error: Lucid toolkit requires X11/Xaw include files" >&5
11871echo "$as_me: error: Lucid toolkit requires X11/Xaw include files" >&2;} 11938echo "$as_me: error: Lucid toolkit requires X11/Xaw include files" >&2;}
11872 { (exit 1); exit 1; }; } 11939 { (exit 1); exit 1; }; }
11873 else 11940 else
11874 { echo "$as_me:$LINENO: result: before 5 or no Xaw; do not use toolkit by default" >&5 11941 { echo "$as_me:$LINENO: result: no; do not use toolkit by default" >&5
11875echo "${ECHO_T}before 5 or no Xaw; do not use toolkit by default" >&6; } 11942echo "${ECHO_T}no; do not use toolkit by default" >&6; }
11876 USE_X_TOOLKIT=none 11943 USE_X_TOOLKIT=none
11877 fi 11944 fi
11878 fi 11945 fi
11879 else
11880 USE_X_TOOLKIT=none
11881 fi 11946 fi
11882fi 11947fi
11883 11948
@@ -12314,130 +12379,6 @@ echo "${ECHO_T}$emacs_cv_lesstif" >&6; }
12314 fi 12379 fi
12315fi 12380fi
12316 12381
12317### Is -lXaw3d available?
12318HAVE_XAW3D=no
12319if test "${HAVE_X11}" = "yes"; then
12320 if test "${USE_X_TOOLKIT}" != "none" && test "${with_toolkit_scroll_bars}" != "no"; then
12321 { echo "$as_me:$LINENO: checking for X11/Xaw3d/Scrollbar.h" >&5
12322echo $ECHO_N "checking for X11/Xaw3d/Scrollbar.h... $ECHO_C" >&6; }
12323if test "${ac_cv_header_X11_Xaw3d_Scrollbar_h+set}" = set; then
12324 echo $ECHO_N "(cached) $ECHO_C" >&6
12325else
12326 cat >conftest.$ac_ext <<_ACEOF
12327/* confdefs.h. */
12328_ACEOF
12329cat confdefs.h >>conftest.$ac_ext
12330cat >>conftest.$ac_ext <<_ACEOF
12331/* end confdefs.h. */
12332#include <X11/Xaw3d/Scrollbar.h>
12333_ACEOF
12334if { (ac_try="$ac_cpp conftest.$ac_ext"
12335case "(($ac_try" in
12336 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12337 *) ac_try_echo=$ac_try;;
12338esac
12339eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
12340 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
12341 ac_status=$?
12342 grep -v '^ *+' conftest.er1 >conftest.err
12343 rm -f conftest.er1
12344 cat conftest.err >&5
12345 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12346 (exit $ac_status); } >/dev/null && {
12347 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
12348 test ! -s conftest.err
12349 }; then
12350 ac_cv_header_X11_Xaw3d_Scrollbar_h=yes
12351else
12352 echo "$as_me: failed program was:" >&5
12353sed 's/^/| /' conftest.$ac_ext >&5
12354
12355 ac_cv_header_X11_Xaw3d_Scrollbar_h=no
12356fi
12357
12358rm -f conftest.err conftest.$ac_ext
12359fi
12360{ echo "$as_me:$LINENO: result: $ac_cv_header_X11_Xaw3d_Scrollbar_h" >&5
12361echo "${ECHO_T}$ac_cv_header_X11_Xaw3d_Scrollbar_h" >&6; }
12362if test $ac_cv_header_X11_Xaw3d_Scrollbar_h = yes; then
12363 { echo "$as_me:$LINENO: checking for XawScrollbarSetThumb in -lXaw3d" >&5
12364echo $ECHO_N "checking for XawScrollbarSetThumb in -lXaw3d... $ECHO_C" >&6; }
12365if test "${ac_cv_lib_Xaw3d_XawScrollbarSetThumb+set}" = set; then
12366 echo $ECHO_N "(cached) $ECHO_C" >&6
12367else
12368 ac_check_lib_save_LIBS=$LIBS
12369LIBS="-lXaw3d $LIBS"
12370cat >conftest.$ac_ext <<_ACEOF
12371/* confdefs.h. */
12372_ACEOF
12373cat confdefs.h >>conftest.$ac_ext
12374cat >>conftest.$ac_ext <<_ACEOF
12375/* end confdefs.h. */
12376
12377/* Override any GCC internal prototype to avoid an error.
12378 Use char because int might match the return type of a GCC
12379 builtin and then its argument prototype would still apply. */
12380#ifdef __cplusplus
12381extern "C"
12382#endif
12383char XawScrollbarSetThumb ();
12384int
12385main ()
12386{
12387return XawScrollbarSetThumb ();
12388 ;
12389 return 0;
12390}
12391_ACEOF
12392rm -f conftest.$ac_objext conftest$ac_exeext
12393if { (ac_try="$ac_link"
12394case "(($ac_try" in
12395 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
12396 *) ac_try_echo=$ac_try;;
12397esac
12398eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
12399 (eval "$ac_link") 2>conftest.er1
12400 ac_status=$?
12401 grep -v '^ *+' conftest.er1 >conftest.err
12402 rm -f conftest.er1
12403 cat conftest.err >&5
12404 echo "$as_me:$LINENO: \$? = $ac_status" >&5
12405 (exit $ac_status); } && {
12406 test -z "$ac_c_werror_flag" ||
12407 test ! -s conftest.err
12408 } && test -s conftest$ac_exeext &&
12409 $as_test_x conftest$ac_exeext; then
12410 ac_cv_lib_Xaw3d_XawScrollbarSetThumb=yes
12411else
12412 echo "$as_me: failed program was:" >&5
12413sed 's/^/| /' conftest.$ac_ext >&5
12414
12415 ac_cv_lib_Xaw3d_XawScrollbarSetThumb=no
12416fi
12417
12418rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
12419 conftest$ac_exeext conftest.$ac_ext
12420LIBS=$ac_check_lib_save_LIBS
12421fi
12422{ echo "$as_me:$LINENO: result: $ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&5
12423echo "${ECHO_T}$ac_cv_lib_Xaw3d_XawScrollbarSetThumb" >&6; }
12424if test $ac_cv_lib_Xaw3d_XawScrollbarSetThumb = yes; then
12425 HAVE_XAW3D=yes
12426fi
12427
12428fi
12429
12430
12431 if test "${HAVE_XAW3D}" = "yes"; then
12432
12433cat >>confdefs.h <<\_ACEOF
12434#define HAVE_XAW3D 1
12435_ACEOF
12436
12437 fi
12438 fi
12439fi
12440
12441 12382
12442 12383
12443USE_TOOLKIT_SCROLL_BARS=no 12384USE_TOOLKIT_SCROLL_BARS=no
@@ -14198,11 +14139,10 @@ _ACEOF
14198 fi 14139 fi
14199fi 14140fi
14200 14141
14201### Use -lgif if available, unless `--with-gif=no'. 14142### Use -lgif or -lungif if available, unless `--with-gif=no'.
14202HAVE_GIF=no 14143HAVE_GIF=no
14203if test "${HAVE_X11}" = "yes"; then 14144if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
14204 if test "${with_gif}" != "no"; then 14145 if test "${ac_cv_header_gif_lib_h+set}" = set; then
14205 if test "${ac_cv_header_gif_lib_h+set}" = set; then
14206 { echo "$as_me:$LINENO: checking for gif_lib.h" >&5 14146 { echo "$as_me:$LINENO: checking for gif_lib.h" >&5
14207echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6; } 14147echo $ECHO_N "checking for gif_lib.h... $ECHO_C" >&6; }
14208if test "${ac_cv_header_gif_lib_h+set}" = set; then 14148if test "${ac_cv_header_gif_lib_h+set}" = set; then
@@ -14330,7 +14270,7 @@ fi
14330if test $ac_cv_header_gif_lib_h = yes; then 14270if test $ac_cv_header_gif_lib_h = yes; then
14331 # EGifPutExtensionLast only exists from version libungif-4.1.0b1. 14271 # EGifPutExtensionLast only exists from version libungif-4.1.0b1.
14332# Earlier versions can crash Emacs. 14272# Earlier versions can crash Emacs.
14333 { echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5 14273 { echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lungif" >&5
14334echo $ECHO_N "checking for EGifPutExtensionLast in -lungif... $ECHO_C" >&6; } 14274echo $ECHO_N "checking for EGifPutExtensionLast in -lungif... $ECHO_C" >&6; }
14335if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then 14275if test "${ac_cv_lib_ungif_EGifPutExtensionLast+set}" = set; then
14336 echo $ECHO_N "(cached) $ECHO_C" >&6 14276 echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -14393,11 +14333,94 @@ fi
14393echo "${ECHO_T}$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; } 14333echo "${ECHO_T}$ac_cv_lib_ungif_EGifPutExtensionLast" >&6; }
14394if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then 14334if test $ac_cv_lib_ungif_EGifPutExtensionLast = yes; then
14395 HAVE_GIF=yes 14335 HAVE_GIF=yes
14336else
14337 try_libgif=yes
14338fi
14339
14340fi
14341
14342
14343
14344 if test "$HAVE_GIF" = yes; then
14345 ac_gif_lib_name="-lungif"
14346 fi
14347
14348# If gif_lib.h but no libungif, try libgif.
14349 if test x"$try_libgif" = xyes; then
14350 { echo "$as_me:$LINENO: checking for EGifPutExtensionLast in -lgif" >&5
14351echo $ECHO_N "checking for EGifPutExtensionLast in -lgif... $ECHO_C" >&6; }
14352if test "${ac_cv_lib_gif_EGifPutExtensionLast+set}" = set; then
14353 echo $ECHO_N "(cached) $ECHO_C" >&6
14354else
14355 ac_check_lib_save_LIBS=$LIBS
14356LIBS="-lgif $LIBS"
14357cat >conftest.$ac_ext <<_ACEOF
14358/* confdefs.h. */
14359_ACEOF
14360cat confdefs.h >>conftest.$ac_ext
14361cat >>conftest.$ac_ext <<_ACEOF
14362/* end confdefs.h. */
14363
14364/* Override any GCC internal prototype to avoid an error.
14365 Use char because int might match the return type of a GCC
14366 builtin and then its argument prototype would still apply. */
14367#ifdef __cplusplus
14368extern "C"
14369#endif
14370char EGifPutExtensionLast ();
14371int
14372main ()
14373{
14374return EGifPutExtensionLast ();
14375 ;
14376 return 0;
14377}
14378_ACEOF
14379rm -f conftest.$ac_objext conftest$ac_exeext
14380if { (ac_try="$ac_link"
14381case "(($ac_try" in
14382 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
14383 *) ac_try_echo=$ac_try;;
14384esac
14385eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
14386 (eval "$ac_link") 2>conftest.er1
14387 ac_status=$?
14388 grep -v '^ *+' conftest.er1 >conftest.err
14389 rm -f conftest.er1
14390 cat conftest.err >&5
14391 echo "$as_me:$LINENO: \$? = $ac_status" >&5
14392 (exit $ac_status); } && {
14393 test -z "$ac_c_werror_flag" ||
14394 test ! -s conftest.err
14395 } && test -s conftest$ac_exeext &&
14396 $as_test_x conftest$ac_exeext; then
14397 ac_cv_lib_gif_EGifPutExtensionLast=yes
14398else
14399 echo "$as_me: failed program was:" >&5
14400sed 's/^/| /' conftest.$ac_ext >&5
14401
14402 ac_cv_lib_gif_EGifPutExtensionLast=no
14396fi 14403fi
14397 14404
14405rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
14406 conftest$ac_exeext conftest.$ac_ext
14407LIBS=$ac_check_lib_save_LIBS
14408fi
14409{ echo "$as_me:$LINENO: result: $ac_cv_lib_gif_EGifPutExtensionLast" >&5
14410echo "${ECHO_T}$ac_cv_lib_gif_EGifPutExtensionLast" >&6; }
14411if test $ac_cv_lib_gif_EGifPutExtensionLast = yes; then
14412 HAVE_GIF=yes
14398fi 14413fi
14399 14414
14400 14415
14416 if test "$HAVE_GIF" = yes; then
14417
14418cat >>confdefs.h <<\_ACEOF
14419#define LIBGIF -lgif
14420_ACEOF
14421
14422 ac_gif_lib_name="-lgif"
14423 fi
14401 fi 14424 fi
14402 14425
14403 if test "${HAVE_GIF}" = "yes"; then 14426 if test "${HAVE_GIF}" = "yes"; then
@@ -14409,6 +14432,37 @@ _ACEOF
14409 fi 14432 fi
14410fi 14433fi
14411 14434
14435if test "${HAVE_X11}" = "yes"; then
14436 MISSING=""
14437 WITH_NO=""
14438 test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" &&
14439 MISSING="libXpm" && WITH_NO="--with-xpm=no"
14440 test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" &&
14441 MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no"
14442 test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" &&
14443 MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no"
14444 test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" &&
14445 MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no"
14446 test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
14447 MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
14448
14449 if test "X${MISSING}" != X; then
14450 { { echo "$as_me:$LINENO: error: The following required libraries was not found:
14451 $MISSING
14452Maybe some development libraries/packages are missing?
14453If you don't want to link with them give
14454 $WITH_NO
14455as options to configure" >&5
14456echo "$as_me: error: The following required libraries was not found:
14457 $MISSING
14458Maybe some development libraries/packages are missing?
14459If you don't want to link with them give
14460 $WITH_NO
14461as options to configure" >&2;}
14462 { (exit 1); exit 1; }; }
14463 fi
14464fi
14465
14412### Use -lgpm if available, unless `--with-gpm=no'. 14466### Use -lgpm if available, unless `--with-gpm=no'.
14413HAVE_GPM=no 14467HAVE_GPM=no
14414if test "${with_gpm}" != "no"; then 14468if test "${with_gpm}" != "no"; then
@@ -23752,6 +23806,7 @@ fi
23752 23806
23753 23807
23754 23808
23809
23755#### Report on what we decided to do. 23810#### Report on what we decided to do.
23756#### Report GTK as a toolkit, even if it doesn't use Xt. 23811#### Report GTK as a toolkit, even if it doesn't use Xt.
23757#### It makes printing result more understandable as using GTK sets 23812#### It makes printing result more understandable as using GTK sets
@@ -23788,7 +23843,7 @@ echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
23788echo " Does Emacs use -lXpm? ${HAVE_XPM}" 23843echo " Does Emacs use -lXpm? ${HAVE_XPM}"
23789echo " Does Emacs use -ljpeg? ${HAVE_JPEG}" 23844echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
23790echo " Does Emacs use -ltiff? ${HAVE_TIFF}" 23845echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
23791echo " Does Emacs use -lungif? ${HAVE_GIF}" 23846echo " Does Emacs use a gif library? ${HAVE_GIF} $ac_gif_lib_name"
23792echo " Does Emacs use -lpng? ${HAVE_PNG}" 23847echo " Does Emacs use -lpng? ${HAVE_PNG}"
23793echo " Does Emacs use -lgpm? ${HAVE_GPM}" 23848echo " Does Emacs use -lgpm? ${HAVE_GPM}"
23794echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}" 23849echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
diff --git a/configure.in b/configure.in
index db1a7904b21..1b8bcc8880e 100644
--- a/configure.in
+++ b/configure.in
@@ -90,15 +90,10 @@ AC_ARG_WITH(x-toolkit,
90 a | at | ath | athe | athen | athena ) val=athena ;; 90 a | at | ath | athe | athen | athena ) val=athena ;;
91 m | mo | mot | moti | motif ) val=motif ;; 91 m | mo | mot | moti | motif ) val=motif ;;
92 g | gt | gtk ) val=gtk ;; 92 g | gt | gtk ) val=gtk ;;
93dnl These don't currently work.
94dnl o | op | ope | open | open- | open-l | open-lo \
95dnl | open-loo | open-look ) val=open-look ;;
96 * ) 93 * )
97dnl AC_MSG_ERROR([the `--with-x-toolkit' option is supposed to have a value 94AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid;
98dnl which is `yes', `no', `lucid', `athena', `motif' or `open-look'.])
99AC_MSG_ERROR([`--with-x-toolkit=$withval' is invalid\;
100this option's value should be `yes', `no', `lucid', `athena', `motif' or `gtk'. 95this option's value should be `yes', `no', `lucid', `athena', `motif' or `gtk'.
101Currently, `yes' and `gtk', and `athena' and `lucid' are synonyms.]) 96`yes' and `gtk' are synonyms. `athena' and `lucid' are synonyms.])
102 ;; 97 ;;
103 esac 98 esac
104 with_x_toolkit=$val 99 with_x_toolkit=$val
@@ -110,7 +105,7 @@ AC_ARG_WITH(jpeg,
110AC_ARG_WITH(tiff, 105AC_ARG_WITH(tiff,
111[ --with-tiff use -ltiff for displaying TIFF images]) 106[ --with-tiff use -ltiff for displaying TIFF images])
112AC_ARG_WITH(gif, 107AC_ARG_WITH(gif,
113[ --with-gif use -lungif for displaying GIF images]) 108[ --with-gif use -lungif (or -lgif) for displaying GIF images])
114AC_ARG_WITH(png, 109AC_ARG_WITH(png,
115[ --with-png use -lpng for displaying PNG images]) 110[ --with-png use -lpng for displaying PNG images])
116AC_ARG_WITH(freetype, 111AC_ARG_WITH(freetype,
@@ -1883,7 +1878,6 @@ case "${window_system}" in
1883 case "${with_x_toolkit}" in 1878 case "${with_x_toolkit}" in
1884 athena | lucid ) USE_X_TOOLKIT=LUCID ;; 1879 athena | lucid ) USE_X_TOOLKIT=LUCID ;;
1885 motif ) USE_X_TOOLKIT=MOTIF ;; 1880 motif ) USE_X_TOOLKIT=MOTIF ;;
1886dnl open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;
1887 gtk ) with_gtk=yes 1881 gtk ) with_gtk=yes
1888dnl Dont set this for GTK. A lot of tests below assumes Xt when 1882dnl Dont set this for GTK. A lot of tests below assumes Xt when
1889dnl USE_X_TOOLKIT is set. 1883dnl USE_X_TOOLKIT is set.
@@ -2219,29 +2213,45 @@ fi
2219 2213
2220dnl Do not put whitespace before the #include statements below. 2214dnl Do not put whitespace before the #include statements below.
2221dnl Older compilers (eg sunos4 cc) choke on it. 2215dnl Older compilers (eg sunos4 cc) choke on it.
2216HAVE_XAW3D=no
2222if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then 2217if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
2223 if test x"${HAVE_X11R5}" = xyes; then 2218 if test x"${HAVE_X11R5}" != xyes; then
2224 AC_MSG_CHECKING(X11 version 5 with Xaw) 2219 USE_X_TOOLKIT=none
2225 AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw, 2220 else
2221 AC_MSG_CHECKING(for xaw3d)
2222 AC_CACHE_VAL(emacs_cv_xaw3d,
2226 [AC_TRY_LINK([ 2223 [AC_TRY_LINK([
2227#include <X11/Intrinsic.h> 2224#include <X11/Intrinsic.h>
2228#include <X11/Xaw/Simple.h>], 2225#include <X11/Xaw3d/Simple.h>],
2229 [], 2226 [],
2230 emacs_cv_x11_version_5_with_xaw=yes, 2227 emacs_cv_xaw3d=yes,
2231 emacs_cv_x11_version_5_with_xaw=no)]) 2228 emacs_cv_xaw3d=no)])
2232 if test $emacs_cv_x11_version_5_with_xaw = yes; then 2229 if test $emacs_cv_xaw3d = yes; then
2233 AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default]) 2230 AC_MSG_RESULT([yes; using Lucid toolkit])
2234 USE_X_TOOLKIT=LUCID 2231 USE_X_TOOLKIT=LUCID
2232 HAVE_XAW3D=yes
2233 AC_DEFINE(HAVE_XAW3D, 1,
2234 [Define to 1 if you have the Xaw3d library (-lXaw3d).])
2235 else 2235 else
2236 if test x"${USE_X_TOOLKIT}" = xLUCID; then 2236 AC_MSG_RESULT(no)
2237 AC_MSG_CHECKING(for libXaw)
2238 AC_CACHE_VAL(emacs_cv_xaw,
2239 [AC_TRY_LINK([
2240#include <X11/Intrinsic.h>
2241#include <X11/Xaw/Simple.h>],
2242 [],
2243 emacs_cv_xaw=yes,
2244 emacs_cv_xaw=no)])
2245 if test $emacs_cv_xaw = yes; then
2246 AC_MSG_RESULT([yes; using Lucid toolkit])
2247 USE_X_TOOLKIT=LUCID
2248 elif test x"${USE_X_TOOLKIT}" = xLUCID; then
2237 AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files]) 2249 AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
2238 else 2250 else
2239 AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default) 2251 AC_MSG_RESULT([no; do not use toolkit by default])
2240 USE_X_TOOLKIT=none 2252 USE_X_TOOLKIT=none
2241 fi 2253 fi
2242 fi 2254 fi
2243 else
2244 USE_X_TOOLKIT=none
2245 fi 2255 fi
2246fi 2256fi
2247 2257
@@ -2329,21 +2339,6 @@ Motif version prior to 2.1.
2329 fi 2339 fi
2330fi 2340fi
2331 2341
2332### Is -lXaw3d available?
2333HAVE_XAW3D=no
2334if test "${HAVE_X11}" = "yes"; then
2335 if test "${USE_X_TOOLKIT}" != "none" && test "${with_toolkit_scroll_bars}" != "no"; then
2336 dnl Fixme: determine what Scrollbar.h needs to avoid compilation
2337 dnl errors from the test without the `-'.
2338 AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
2339 [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes)], , -)
2340 if test "${HAVE_XAW3D}" = "yes"; then
2341 AC_DEFINE(HAVE_XAW3D, 1,
2342 [Define to 1 if you have the Xaw3d library (-lXaw3d).])
2343 fi
2344 fi
2345fi
2346
2347dnl Use toolkit scroll bars if configured for GTK or X toolkit and either 2342dnl Use toolkit scroll bars if configured for GTK or X toolkit and either
2348dnl using Motif or Xaw3d is available, and unless 2343dnl using Motif or Xaw3d is available, and unless
2349dnl --with-toolkit-scroll-bars=no was specified. 2344dnl --with-toolkit-scroll-bars=no was specified.
@@ -2592,18 +2587,55 @@ if test "${HAVE_X11}" = "yes"; then
2592 fi 2587 fi
2593fi 2588fi
2594 2589
2595### Use -lgif if available, unless `--with-gif=no'. 2590### Use -lgif or -lungif if available, unless `--with-gif=no'.
2596HAVE_GIF=no 2591HAVE_GIF=no
2597if test "${HAVE_X11}" = "yes"; then 2592if test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no"; then
2598 if test "${with_gif}" != "no"; then 2593 AC_CHECK_HEADER(gif_lib.h,
2599 AC_CHECK_HEADER(gif_lib.h,
2600# EGifPutExtensionLast only exists from version libungif-4.1.0b1. 2594# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
2601# Earlier versions can crash Emacs. 2595# Earlier versions can crash Emacs.
2602 AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes)) 2596 AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes, try_libgif=yes))
2597
2598 if test "$HAVE_GIF" = yes; then
2599 ac_gif_lib_name="-lungif"
2600 fi
2601
2602# If gif_lib.h but no libungif, try libgif.
2603 if test x"$try_libgif" = xyes; then
2604 AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes)
2605
2606 if test "$HAVE_GIF" = yes; then
2607 AC_DEFINE(LIBGIF, -lgif, [Compiler option to link with the gif library (if not -lungif).])
2608 ac_gif_lib_name="-lgif"
2609 fi
2603 fi 2610 fi
2604 2611
2605 if test "${HAVE_GIF}" = "yes"; then 2612 if test "${HAVE_GIF}" = "yes"; then
2606 AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have the ungif library (-lungif).]) 2613 AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif library (default -lungif; otherwise specify with LIBGIF).])
2614 fi
2615fi
2616
2617dnl Check for required libraries.
2618if test "${HAVE_X11}" = "yes"; then
2619 MISSING=""
2620 WITH_NO=""
2621 test "${with_xpm}" != "no" && test "${HAVE_XPM}" != "yes" &&
2622 MISSING="libXpm" && WITH_NO="--with-xpm=no"
2623 test "${with_jpeg}" != "no" && test "${HAVE_JPEG}" != "yes" &&
2624 MISSING="$MISSING libjpeg" && WITH_NO="$WITH_NO --with-jpeg=no"
2625 test "${with_png}" != "no" && test "${HAVE_PNG}" != "yes" &&
2626 MISSING="$MISSING libpng" && WITH_NO="$WITH_NO --with-png=no"
2627 test "${with_gif}" != "no" && test "${HAVE_GIF}" != "yes" &&
2628 MISSING="$MISSING libgif/libungif" && WITH_NO="$WITH_NO --with-gif=no"
2629 test "${with_tiff}" != "no" && test "${HAVE_TIFF}" != "yes" &&
2630 MISSING="$MISSING libtiff" && WITH_NO="$WITH_NO --with-tiff=no"
2631
2632 if test "X${MISSING}" != X; then
2633 AC_MSG_ERROR([The following required libraries was not found:
2634 $MISSING
2635Maybe some development libraries/packages are missing?
2636If you don't want to link with them give
2637 $WITH_NO
2638as options to configure])
2607 fi 2639 fi
2608fi 2640fi
2609 2641
@@ -3049,6 +3081,7 @@ if test "${REL_ALLOC}" = "yes" ; then
3049 buffer space.]) 3081 buffer space.])
3050fi 3082fi
3051 3083
3084
3052AH_TOP([/* GNU Emacs site configuration template file. 3085AH_TOP([/* GNU Emacs site configuration template file.
3053 Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007 3086 Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007
3054 Free Software Foundation, Inc. 3087 Free Software Foundation, Inc.
@@ -3376,7 +3409,7 @@ echo " Does Emacs use -lXaw3d? ${HAVE_XAW3D}"
3376echo " Does Emacs use -lXpm? ${HAVE_XPM}" 3409echo " Does Emacs use -lXpm? ${HAVE_XPM}"
3377echo " Does Emacs use -ljpeg? ${HAVE_JPEG}" 3410echo " Does Emacs use -ljpeg? ${HAVE_JPEG}"
3378echo " Does Emacs use -ltiff? ${HAVE_TIFF}" 3411echo " Does Emacs use -ltiff? ${HAVE_TIFF}"
3379echo " Does Emacs use -lungif? ${HAVE_GIF}" 3412echo " Does Emacs use a gif library? ${HAVE_GIF} $ac_gif_lib_name"
3380echo " Does Emacs use -lpng? ${HAVE_PNG}" 3413echo " Does Emacs use -lpng? ${HAVE_PNG}"
3381echo " Does Emacs use -lgpm? ${HAVE_GPM}" 3414echo " Does Emacs use -lgpm? ${HAVE_GPM}"
3382echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}" 3415echo " Does Emacs use X toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}"
diff --git a/etc/ChangeLog b/etc/ChangeLog
index 5c9dfb6a197..49028bdf691 100644
--- a/etc/ChangeLog
+++ b/etc/ChangeLog
@@ -1,3 +1,18 @@
12007-06-14 Nick Roberts <nickrob@snap.net.nz>
2
3 * NEWS: Mention mouse highlighting in a GNU/Linux console.
4
52007-06-14 Werner Lemberg <wl@gnu.org>
6
7 * emacs.1: Completely revised.
8 Fix many typographical glitches.
9 Updated to handle current state of options and resources.
10
112007-06-12 Glenn Morris <rgm@gnu.org>
12
13 * NEWS: Change bug address. Add back +++/--- note.
14 Use present tense for X-toolkit entry. Mention libgif.
15
12007-06-07 Mark H. Weaver <mhw@netris.org> (tiny change) 162007-06-07 Mark H. Weaver <mhw@netris.org> (tiny change)
2 17
3 * NEWS (set-mark-command-repeat-pop): Fix duplicate entry. 18 * NEWS (set-mark-command-repeat-pop): Fix duplicate entry.
diff --git a/etc/NEWS b/etc/NEWS
index a7d750b694f..e5b078114d5 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -3,7 +3,7 @@ GNU Emacs NEWS -- history of user-visible changes.
3Copyright (C) 2007 Free Software Foundation, Inc. 3Copyright (C) 2007 Free Software Foundation, Inc.
4See the end of the file for license conditions. 4See the end of the file for license conditions.
5 5
6Please send Emacs bug reports to bug-gnu-emacs@gnu.org. 6Please send Emacs bug reports to emacs-pretest-bug@gnu.org.
7If possible, use M-x report-emacs-bug. 7If possible, use M-x report-emacs-bug.
8 8
9This file is about changes in Emacs version 23. 9This file is about changes in Emacs version 23.
@@ -13,13 +13,31 @@ for changes in older Emacs versions.
13 13
14You can narrow news to a specific version by calling `view-emacs-news' 14You can narrow news to a specific version by calling `view-emacs-news'
15with a prefix argument or by typing C-u C-h C-n. 15with a prefix argument or by typing C-u C-h C-n.
16
17Temporary note:
18 +++ indicates that the appropriate manual has already been updated.
19 --- means no change in the manuals is called for.
20When you add a new item, please add it without either +++ or ---
21so we will look at it and add it to the manual.
22
16 23
17* About external Lisp packages 24* About external Lisp packages
18 25
19 26
20* Installation Changes in Emacs 23.1 27* Installation Changes in Emacs 23.1
21 28
22** The default X toolkit has changed from Lucid to Gtk+. 29** The default X toolkit is now Gtk+, rather than Lucid.
30
31** configure now checks for libgif (as well as libungif) when
32searching for a GIF library.
33
34
35* Changes in Emacs 23.1
36
37** If the gpm mouse server is running and t-mouse-mode enabled, Emacs uses a
38Unix socket in a GNU/Linux console to talk to server, rather than faking events
39using the client program mev. This C level approach provides mouse
40highlighting, and help echoing in the minibuffer.
23 41
24 42
25* Startup Changes in Emacs 23.1 43* Startup Changes in Emacs 23.1
@@ -37,8 +55,12 @@ with a prefix argument or by typing C-u C-h C-n.
37 55
38** css-mode to edit Cascading Style Sheets. 56** css-mode to edit Cascading Style Sheets.
39 57
58** bibtex-style-mode helps you write BibTeX's *.bst files.
59
40** socks.el (which had been part of W3) is now part of Emacs. 60** socks.el (which had been part of W3) is now part of Emacs.
41 61
62** minibuffer-indicate-depth-mode shows the minibuffer depth in the prompt.
63
42 64
43* Changes in Specialized Modes and Packages in Emacs 23.1 65* Changes in Specialized Modes and Packages in Emacs 23.1
44 66
@@ -46,6 +68,9 @@ with a prefix argument or by typing C-u C-h C-n.
46Only copyright lines with holders matching copyright-names-regexp will be 68Only copyright lines with holders matching copyright-names-regexp will be
47considered for update. 69considered for update.
48 70
71
72** VC has some support for Bazaar (bzr).
73
49 74
50* Changes in Emacs 23.1 on non-free operating systems 75* Changes in Emacs 23.1 on non-free operating systems
51 76
@@ -55,6 +80,17 @@ considered for update.
55 80
56* Lisp Changes in Emacs 23.1 81* Lisp Changes in Emacs 23.1
57 82
83+++
84** The regexp form \(?<num>:<regexp>\) specifies the group number explicitly.
85
86+++
87** New variable `user-emacs-directory'.
88Use this instead of "~/.emacs.d".
89
90+++
91** The new function `image-refresh' refreshes all images associated
92with a given image specification.
93
58 94
59* New Packages for Lisp Programming in Emacs 23.1 95* New Packages for Lisp Programming in Emacs 23.1
60 96
diff --git a/etc/PROBLEMS b/etc/PROBLEMS
index f35f3fdc659..0d66c375e2b 100644
--- a/etc/PROBLEMS
+++ b/etc/PROBLEMS
@@ -2184,6 +2184,9 @@ Files larger than 4GB cause overflow in the size (represented as a
2184well, since the Windows port uses a Lisp emulation of `ls' that relies 2184well, since the Windows port uses a Lisp emulation of `ls' that relies
2185on `file-attributes'. 2185on `file-attributes'.
2186 2186
2187Sound playing is not supported with the `:data DATA' key-value pair.
2188You _must_ use the `:file FILE' method.
2189
2187** Typing Alt-Shift has strange effects on MS-Windows. 2190** Typing Alt-Shift has strange effects on MS-Windows.
2188 2191
2189This combination of keys is a command to change keyboard layout. If 2192This combination of keys is a command to change keyboard layout. If
diff --git a/etc/TODO b/etc/TODO
index cb7133c7312..6cc223bd286 100644
--- a/etc/TODO
+++ b/etc/TODO
@@ -14,14 +14,6 @@ to the FSF.
14 14
15* Small but important fixes needed in existing features: 15* Small but important fixes needed in existing features:
16 16
17** Fix compilation when Xaw3d libraries are present but libxaw is not.
18In new X11 versions, xaw3dg-dev does not depend on libxaw-dev, so the
19latter need not be installed. As a result, all the source files that
20look for include files in X11/Xaw should look in X11/Xaw3d if we are
21using Xaw3d.
22http://lists.gnu.org/archive/html/emacs-pretest-bug/2007-04/msg00396.html
23http://lists.gnu.org/archive/html/emacs-devel/2006-03/msg01150.html ?
24
25** Compute the list of active keymaps *after* reading the first event. 17** Compute the list of active keymaps *after* reading the first event.
26 18
27** Avoid using "iff" in doc strings. 19** Avoid using "iff" in doc strings.
diff --git a/etc/emacs.1 b/etc/emacs.1
index ef945420de2..daee15b2388 100644
--- a/etc/emacs.1
+++ b/etc/emacs.1
@@ -1,3 +1,4 @@
1'\" t
1.\" Copyright (C) 1995, 1999, 2000, 2001, 2002, 2003, 2004, 2.\" Copyright (C) 1995, 1999, 2000, 2001, 2002, 2003, 2004,
2.\" 2005, 2006, 2007 Free Software Foundation, Inc. 3.\" 2005, 2006, 2007 Free Software Foundation, Inc.
3.\" 4.\"
@@ -20,27 +21,33 @@
20.\" 21.\"
21'\" t 22'\" t
22.TH EMACS 1 "2007 April 13" "GNU Emacs 22.1" 23.TH EMACS 1 "2007 April 13" "GNU Emacs 22.1"
24.
25.
23.SH NAME 26.SH NAME
24emacs \- GNU project Emacs 27emacs \- GNU project Emacs
28.
29.
25.SH SYNOPSIS 30.SH SYNOPSIS
26.B emacs 31.B emacs
27[ 32[
28.I command-line switches 33.I command-line switches
29] [ 34] [
30.I files ... 35.I files ...\&
31] 36]
32.br 37.
38.
33.SH DESCRIPTION 39.SH DESCRIPTION
34.I GNU Emacs 40.I GNU Emacs
35is a version of 41is a version of
36.I Emacs, 42.IR Emacs ,
37written by the author of the original (PDP-10) 43written by the author of the original (PDP-10)
38.I Emacs, 44.IR Emacs ,
39Richard Stallman. 45Richard Stallman.
40.br 46.br
41The primary documentation of GNU Emacs is in the GNU Emacs Manual, 47The primary documentation of GNU Emacs is in the GNU Emacs Manual,
42which you can read using Info, either from Emacs or as a standalone 48which you can read using Info, either from Emacs or as a standalone
43program. Please look there for complete and up-to-date documentation. 49program.
50Please look there for complete and up-to-date documentation.
44This man page is updated only when someone volunteers to do so; the 51This man page is updated only when someone volunteers to do so; the
45Emacs maintainers' priority goal is to minimize the amount of time 52Emacs maintainers' priority goal is to minimize the amount of time
46this man page takes away from other more useful projects. 53this man page takes away from other more useful projects.
@@ -56,9 +63,9 @@ has an extensive interactive help facility,
56but the facility assumes that you know how to manipulate 63but the facility assumes that you know how to manipulate
57.I Emacs 64.I Emacs
58windows and buffers. 65windows and buffers.
59CTRL-h or F1 enters the Help facility. Help Tutorial (CTRL-h t) 66CTRL-h or F1 enters the Help facility.
60starts an interactive tutorial which can teach beginners the fundamentals 67Help Tutorial (CTRL-h t) starts an interactive tutorial which can
61of 68teach beginners the fundamentals of
62.I Emacs 69.I Emacs
63in a few minutes. 70in a few minutes.
64Help Apropos (CTRL-h a) helps you 71Help Apropos (CTRL-h a) helps you
@@ -66,11 +73,11 @@ find a command given its functionality, Help Character (CTRL-h c)
66describes a given character's effect, and Help Function (CTRL-h f) 73describes a given character's effect, and Help Function (CTRL-h f)
67describes a given Lisp function specified by name. 74describes a given Lisp function specified by name.
68.PP 75.PP
69.I Emacs's 76.IR Emacs 's
70Undo can undo several steps of modification to your buffers, so it is 77Undo can undo several steps of modification to your buffers, so it is
71easy to recover from editing mistakes. 78easy to recover from editing mistakes.
72.PP 79.PP
73.I GNU Emacs's 80.IR "GNU Emacs" 's
74many special packages handle mail reading (RMail) and sending (Mail), 81many special packages handle mail reading (RMail) and sending (Mail),
75outline editing (Outline), compiling (Compile), running subshells 82outline editing (Outline), compiling (Compile), running subshells
76within 83within
@@ -81,130 +88,176 @@ windows (Shell), running a Lisp read-eval-print loop
81There is an extensive reference manual, but 88There is an extensive reference manual, but
82users of other Emacses 89users of other Emacses
83should have little trouble adapting even 90should have little trouble adapting even
84without a copy. Users new to 91without a copy.
92Users new to
85.I Emacs 93.I Emacs
86will be able 94will be able
87to use basic features fairly rapidly by studying the tutorial and 95to use basic features fairly rapidly by studying the tutorial and
88using the self-documentation features. 96using the self-documentation features.
89.PP 97.
90.SM Emacs Options 98.SS Emacs Options
91.PP
92The following options are of general interest: 99The following options are of general interest:
100.RS
93.TP 8 101.TP 8
94.I file 102.I file
95Edit 103Edit
96.I file. 104.IR file .
97.TP 105.TP
98.BI \+ number 106.BI \-\-file " file\fR,\fP " \-\-find-file " file\fR,\fP " \-\-visit " file"
107The same as specifying
108.I file
109directly as an argument.
110.TP
111.BI + number
99Go to the line specified by 112Go to the line specified by
100.I number 113.I number
101(do not insert a space between the "+" sign and 114(do not insert a space between the "+" sign and
102the number). This applies only to the next file specified. 115the number).
116This applies only to the next file specified.
103.TP 117.TP
104.BI \+ line:column 118.BI + line:column
105Go to the specified 119Go to the specified
106.I line 120.I line
107and 121and
108.I column 122.IR column .
109.TP 123.TP
110.B \-q 124.BR \-q ", " \-\-no\-init\-file
111Do not load an init file. 125Do not load an init file.
112.TP 126.TP
113.B \-no-site-file 127.B \-\-no\-site\-file
114Do not load the site-wide startup file. 128Do not load the site-wide startup file.
115.TP 129.TP
116.BI \-debug-init 130.B \-\-no\-desktop
131Do not load a saved desktop.
132.TP
133.BR \-nl ", " \-\-no\-shared\-memory
134Do not use shared memory.
135.TP
136.BR \-Q ", " \-\-quick
137Equivalent to "\-q \-\-no\-site\-file \-\-no\-splash".
138.TP
139.B \-\-no\-splash
140Do not display a splash screen during start-up.
141.TP
142.B \-\-debug\-init
117Enable 143Enable
118.I Emacs 144.I Emacs
119Lisp debugger during the processing of the user init file 145Lisp debugger during the processing of the user init file
120.BI ~/.emacs. 146.BR ~/.emacs .
121This is useful for debugging problems in the init file. 147This is useful for debugging problems in the init file.
122.TP 148.TP
123.BI \-u " user" 149.BI \-u " user\fR,\fP " \-\-user " user"
124Load 150Load
125.I user's 151.IR user 's
126init file. 152init file.
127.TP 153.TP
128.BI \-t " file" 154.BI \-t " file\fR,\fP " \-\-terminal " file"
129Use specified 155Use specified
130.I file 156.I file
131as the terminal instead of using stdin/stdout. 157as the terminal instead of using stdin/stdout.
132This must be the first argument specified in the command line. 158This must be the first argument specified in the command line.
133.TP 159.TP
134.B \-version 160.BR \-\-multibyte ", " \-\-no-unibyte
161Enable multibyte mode (enabled by default).
162.TP
163.BR \-\-unibyte ", " \-\-no-multibyte
164Enable unibyte mode.
165.TP
166.B \-\-version
135Display 167Display
136.I Emacs 168.I Emacs
137version information and exit. 169version information and exit.
170.TP
171.B \-\-help
172Display this help and exit.
173.RE
138.PP 174.PP
139The following options are lisp-oriented 175The following options are lisp-oriented
140(these options are processed in the order encountered): 176(these options are processed in the order encountered):
177.RS
141.TP 8 178.TP 8
142.BI \-f " function" 179.BI \-f " function\fR,\fP " \-\-funcall " function"
143Execute the lisp function 180Execute the lisp function
144.I function. 181.IR function .
145.TP 182.TP
146.BI \-l " file" 183.BI \-l " file\fR,\fP " \-\-load " file"
147Load the lisp code in the file 184Load the lisp code in the file
148.I file. 185.IR file .
149.TP 186.TP
150.BI \-eval " expr" 187.BI \-\-eval " expr\fR,\fP " \-\-execute " expr"
151Evaluate the Lisp expression 188Evaluate the Lisp expression
152.I expr. 189.IR expr .
190.RE
153.PP 191.PP
154The following options are useful when running 192The following options are useful when running
155.I Emacs 193.I Emacs
156as a batch editor: 194as a batch editor:
195.RS
157.TP 8 196.TP 8
158.BI \-batch 197.B \-\-batch
159Edit in batch mode. The editor will send messages to stderr. This 198Edit in batch mode.
160option must be the first in the argument list. You must use \-l and \-f 199The editor will send messages to stderr.
161options to specify files to execute and functions to call. 200This option must be the first in the argument list.
201You must use \-l and \-f options to specify files to execute
202and functions to call.
203.TP
204.BI \-\-script " file"
205Run
206.I file
207as an Emacs Lisp script.
162.TP 208.TP
163.B \-kill 209.BI \-\-insert " file"
210Insert contents of
211.I file
212into the current buffer.
213.TP
214.B \-\-kill
164Exit 215Exit
165.I Emacs 216.I Emacs
166while in batch mode. 217while in batch mode.
167.TP 218.TP
168.BI \-L " directory" 219.BI \-L " dir\fR,\fP " \-\-directory " dir"
169Add 220Add
170.I directory 221.I dir
171to the list of directories 222to the list of directories
172.I Emacs 223.I Emacs
173searches for Lisp files. 224searches for Lisp files.
225.RE
226.
174.\" START DELETING HERE IF YOU'RE NOT USING X 227.\" START DELETING HERE IF YOU'RE NOT USING X
175.PP 228.SS Using Emacs with X
176.SM Using Emacs with X
177.PP
178.I Emacs 229.I Emacs
179has been tailored to work well with the X window system. 230has been tailored to work well with the X window system.
180If you run 231If you run
181.I Emacs 232.I Emacs
182from under X windows, it will create its own X window to 233from under X windows, it will create its own X window to
183display in. You will probably want to start the editor 234display in.
184as a background process 235You will probably want to start the editor as a background
185so that you can continue using your original window. 236process so that you can continue using your original window.
186.PP 237.PP
187.I Emacs 238.I Emacs
188can be started with the following X switches: 239can be started with the following X switches:
240.RS
189.TP 8 241.TP 8
190.BI \-name " name" 242.BI \-\-name " name"
191Specifies the name which should be assigned to the initial 243Specify the name which should be assigned to the initial
192.I Emacs 244.I Emacs
193window. This controls looking up X resources as well as the window title. 245window.
194.TP 8 246This controls looking up X resources as well as the window title.
195.BI \-title " name" 247.TP
196Specifies the title for the initial X window. 248.BI \-T " name\fR,\fP " \-\-title " name"
197.TP 8 249Specify the title for the initial X window.
198.B \-r 250.TP
251.BR \-r ", " \-rv ", " \-\-reverse\-video
199Display the 252Display the
200.I Emacs 253.I Emacs
201window in reverse video. 254window in reverse video.
202.TP 255.TP
203.BI \-font " font, " \-fn " font" 256.BI \-fn " font\fR,\fP " \-\-font " font"
204Set the 257Set the
205.I Emacs 258.I Emacs
206window's font to that specified by 259window's font to that specified by
207.I font. 260.IR font .
208You will find the various 261You will find the various
209.I X 262.I X
210fonts in the 263fonts in the
@@ -215,84 +268,119 @@ Note that
215will only accept fixed width fonts. 268will only accept fixed width fonts.
216Under the X11 Release 4 font-naming conventions, any font with the 269Under the X11 Release 4 font-naming conventions, any font with the
217value "m" or "c" in the eleventh field of the font name is a fixed 270value "m" or "c" in the eleventh field of the font name is a fixed
218width font. Furthermore, fonts whose name are of the form 271width font.
272Furthermore, fonts whose name are of the form
219.IR width x height 273.IR width x height
220are generally fixed width, as is the font 274are generally fixed width, as is the font
221.IR fixed . 275.IR fixed .
222See 276See
223.IR xlsfonts (1) 277.BR xlsfonts (1)
224for more information. 278for more information.
225 279
226When you specify a font, be sure to put a space between the 280When you specify a font, be sure to put a space between the
227switch and the font name. 281switch and the font name.
228.TP 282.TP
229.BI \-bw " pixels" 283.BI \-\-xrm " resources"
284Set additional X resources.
285.TP
286.BI "\-\-color\fR,\fP \-\-color=" mode
287Override color mode for character terminals;
288.I mode
289defaults to `auto', and can also be `never', `auto', `always',
290or a mode name like `ansi8'.
291.TP
292.BI \-bw " pixels\fR,\fP " \-\-border\-width " pixels"
230Set the 293Set the
231.I Emacs 294.I Emacs
232window's border width to the number of pixels specified by 295window's border width to the number of pixels specified by
233.I pixels. 296.IR pixels .
234Defaults to one pixel on each side of the window. 297Defaults to one pixel on each side of the window.
235.TP 298.TP
236.BI \-ib " pixels" 299.BI \-ib " pixels\fR,\fP " \-\-internal\-border " pixels"
237Set the window's internal border width to the number of pixels specified 300Set the window's internal border width to the number of pixels specified
238by 301by
239.I pixels. 302.IR pixels .
240Defaults to one pixel of padding on each side of the window. 303Defaults to one pixel of padding on each side of the window.
241.PP 304.TP
242.TP 8 305.BI \-g " geometry\fR,\fP " \-\-geometry " geometry"
243.BI \-\-geometry " geometry"
244Set the 306Set the
245.I Emacs 307.I Emacs
246window's width, height, and position as specified. The geometry 308window's width, height, and position as specified.
247specification is in the standard X format; see 309The geometry specification is in the standard X format; see
248.IR X (1) 310.BR X (7)
249for more information. 311for more information.
250The width and height are specified in characters; the default is 80 by 312The width and height are specified in characters; the default is
25124. See the Emacs manual, section "Options for Window Size and Position", 31380 by 24.
314See the Emacs manual, section "Options for Window Size and Position",
252for information on how window sizes interact 315for information on how window sizes interact
253with selecting or deselecting the tool bar and menu bar. 316with selecting or deselecting the tool bar and menu bar.
254.PP 317.TP
255.TP 8 318.BI \-lsp " pixels\fR,\fP " \-\-line\-spacing " pixels"
256.BI \-fg " color" 319Additional space to put between lines.
257On color displays, sets the color of the text. 320.TP
321.BR \-vb ", " \-\-vertical\-scroll\-bars
322Enable vertical scrollbars.
323.TP
324.BR \-fh ", " \-\-fullheight
325Make the first frame as high as the screen.
326.TP
327.BR \-fs ", " \-\-fullscreen
328Make the first frame fullscreen.
329.TP
330.BR \-fw ", " \-\-fullwidth
331Make the first frame as wide as the screen.
332.TP
333.BI \-fg " color\fR,\fP " \-\-foreground\-color " color"
334On color displays, set the color of the text.
258 335
259Use the command 336Use the command
260.I M-x list-colors-display 337.I M\-x list\-colors\-display
261for a list of valid 338for a list of valid color names.
262color names.
263.TP 339.TP
264.BI \-bg " color" 340.BI \-bg " color\fR,\fP " \-\-background\-color " color"
265On color displays, 341On color displays, set the color of the window's background.
266sets the color of the window's background.
267.TP 342.TP
268.BI \-bd " color" 343.BI \-bd " color\fR,\fP " \-\-border\-color " color"
269On color displays, 344On color displays, set the color of the window's border.
270sets the color of the window's border.
271.TP 345.TP
272.BI \-cr " color" 346.BI \-cr " color\fR,\fP " \-\-cursor\-color " color"
273On color displays, 347On color displays, set the color of the window's text cursor.
274sets the color of the window's text cursor.
275.TP 348.TP
276.BI \-ms " color" 349.BI \-ms " color\fR,\fP " \-\-mouse\-color " color"
277On color displays, 350On color displays, set the color of the window's mouse cursor.
278sets the color of the window's mouse cursor.
279.TP 351.TP
280.BI \-d " displayname, " \-display " displayname" 352.BI \-d " displayname\fR,\fP " \-\-display " displayname"
281Create the 353Create the
282.I Emacs 354.I Emacs
283window on the display specified by 355window on the display specified by
284.IR displayname . 356.IR displayname .
285Must be the first option specified in the command line. 357Must be the first option specified in the command line.
286.TP 358.TP
287.B \-nw 359.BR \-nbi ", " \-\-no\-bitmap\-icon
288Tells 360Do not use picture of gnu for Emacs icon.
361.TP
362.B \-\-iconic
363Start
289.I Emacs 364.I Emacs
290not to use its special interface to X. If you use this 365in iconified state.
291switch when invoking 366.TP
367.BR \-nbc ", " \-\-no\-blinking\-cursor
368Disable blinking cursor.
369.TP
370.BR \-nw ", " \-\-no\-window\-system
371Tell
372.I Emacs
373not to use its special interface to X.
374If you use this switch when invoking
292.I Emacs 375.I Emacs
293from an 376from an
294.IR xterm (1) 377.BR xterm (1)
295window, display is done in that window. 378window, display is done in that window.
379.TP
380.BR \-D ", " \-\-basic\-display
381This option disables many display features; use it for
382debugging Emacs.
383.RE
296.PP 384.PP
297You can set 385You can set
298.I X 386.I X
@@ -301,75 +389,185 @@ default values for your
301windows in your 389windows in your
302.I \.Xresources 390.I \.Xresources
303file (see 391file (see
304.IR xrdb (1)). 392.BR xrdb (1)).
305Use the following format: 393Use the following format:
306.IP 394.IP
307emacs.keyword:value 395.RI emacs. keyword : value
308.PP 396.PP
309where 397where
310.I value 398.I value
311specifies the default value of 399specifies the default value of
312.I keyword. 400.IR keyword .
313.I Emacs 401.I Emacs
314lets you set default values for the following keywords: 402lets you set default values for the following keywords:
403.RS
315.TP 8 404.TP 8
316.B font (\fPclass\fB Font) 405.BR background " (class " Background )
317Sets the window's text font. 406For color displays,
318.TP 407sets the window's background color.
319.B reverseVideo (\fPclass\fB ReverseVideo)
320If
321.I reverseVideo's
322value is set to
323.I on,
324the window will be displayed in reverse video.
325.TP 408.TP
326.B bitmapIcon (\fPclass\fB BitmapIcon) 409.BR bitmapIcon " (class " BitmapIcon )
327If 410If
328.I bitmapIcon's 411.BR bitmapIcon 's
329value is set to 412value is set to
330.I on, 413.IR on ,
331the window will iconify into the "kitchen sink." 414the window will iconify into the "kitchen sink."
332.TP 415.TP
333.B borderWidth (\fPclass\fB BorderWidth) 416.BR borderColor " (class " BorderColor )
417For color displays,
418sets the color of the window's border.
419.TP
420.BR borderWidth " (class " BorderWidth )
334Sets the window's border width in pixels. 421Sets the window's border width in pixels.
335.TP 422.TP
336.B internalBorder (\fPclass\fB BorderWidth) 423.BR cursorColor " (class " Foreground )
337Sets the window's internal border width in pixels. 424For color displays,
425sets the color of the window's text cursor.
338.TP 426.TP
339.B foreground (\fPclass\fB Foreground) 427.BR cursorBlink " (class " CursorBlink )
428Specifies whether to make the cursor blink.
429The default is
430.IR on .
431Use
432.I off
433or
434.I false
435to turn cursor blinking off.
436.TP
437.BR font " (class " Font )
438Sets the window's text font.
439.TP
440.BR foreground " (class " Foreground )
340For color displays, 441For color displays,
341sets the window's text color. 442sets the window's text color.
342.TP 443.TP
343.B background (\fPclass\fB Background) 444.BR fullscreen " (class " Fullscreen )
344For color displays, 445The desired fullscreen size.
345sets the window's background color. 446The value can be one of
447.IR fullboth ,
448.IR fullwidth ,
449or
450.IR fullheight ,
451which correspond to the command-line options `\-fs', `\-fw', and
452`\-fh', respectively.
453Note that this applies to the initial frame only.
454.TP
455.BR geometry " (class " Geometry )
456Sets the geometry of the
457.I Emacs
458window (as described above).
346.TP 459.TP
347.B borderColor (\fPclass\fB BorderColor) 460.BR iconName " (class " Title )
348For color displays, 461Sets the icon name for the
349sets the color of the window's border. 462.I Emacs
463window icon.
350.TP 464.TP
351.B cursorColor (\fPclass\fB Foreground) 465.BR internalBorder " (class " BorderWidth )
352For color displays, 466Sets the window's internal border width in pixels.
353sets the color of the window's text cursor.
354.TP 467.TP
355.B pointerColor (\fPclass\fB Foreground) 468.BR lineSpacing " (class " LineSpacing )
469Additional space ("leading") between lines, in pixels.
470.TP
471.BR menuBar " (class " MenuBar )
472Gives frames menu bars if
473.IR on ;
474don't have menu bars if
475.IR off .
476See the Emacs manual, sections "Lucid Resources" and "LessTif
477Resources", for how to control the appearance of the menu bar
478if you have one.
479.TP
480.BR minibuffer " (class " Minibuffer )
481If
482.IR none ,
483don't make a minibuffer in this frame.
484It will use a separate minibuffer frame instead.
485.TP
486.BR paneFont " (class " Font )
487Font name for menu pane titles, in non-toolkit versions of
488.IR Emacs .
489.TP
490.BR pointerColor " (class " Foreground )
356For color displays, 491For color displays,
357sets the color of the window's mouse cursor. 492sets the color of the window's mouse cursor.
358.TP 493.TP
359.B geometry (\fPclass\fB Geometry) 494.BR privateColormap " (class " PrivateColormap )
360Sets the geometry of the 495If
361.I Emacs 496.IR on ,
362window (as described above). 497use a private color map, in the case where the "default
498visual" of class
499.B PseudoColor
500and
501.B Emacs
502is using it.
503.TP
504.BR reverseVideo " (class " ReverseVideo )
505If
506.BR reverseVideo 's
507value is set to
508.IR on ,
509the window will be displayed in reverse video.
510.TP
511.BR screenGamma " (class "ScreenGamma )
512Gamma correction for colors, equivalent to the frame parameter
513`screen\-gamma'.
514.TP
515.BR scrollBarWidth " (class "ScrollBarWidth )
516The scroll bar width in pixels, equivalent to the frame parameter
517`scroll\-bar\-width'.
363.TP 518.TP
364.B title (\fPclass\fB Title) 519.BR selectionFont " (class " SelectionFont )
520Font name for pop-up menu items, in non-toolkit versions of
521.IR Emacs .
522(For toolkit versions, see the Emacs manual, sections
523"Lucid Resources" and "LessTif Resources".)
524.TP
525.BR selectionTimeout " (class " SelectionTimeout )
526Number of milliseconds to wait for a selection reply.
527A value of 0 means wait as long as necessary.
528.TP
529.BR synchronous " (class " Synchronous )
530Run Emacs in synchronous mode if
531.IR on .
532Synchronous mode is useful for debugging X problems.
533.TP
534.BR title " (class " Title )
365Sets the title of the 535Sets the title of the
366.I Emacs 536.I Emacs
367window. 537window.
368.TP 538.TP
369.B iconName (\fPclass\fB Title) 539.BR toolBar " (class " ToolBar )
370Sets the icon name for the 540Number of lines to reserve for the tool bar.
371.I Emacs 541.TP
372window icon. 542.BR useXIM " (class " UseXIM )
543Turns off use of X input methods (XIM) if
544.I false
545or
546.IR off .
547.TP
548.BR verticalScrollBars " (class " ScrollBars )
549Gives frames scroll bars if
550.IR on ;
551suppresses scroll bars if
552.IR off .
553.TP
554.BR visualClass " (class " VisualClass )
555Specify the "visual" that X should use.
556This tells X how to handle colors.
557The value should start with one of
558.IR TrueColor ,
559.IR PseudoColor ,
560.IR DirectColor ,
561.IR StaticColor ,
562.IR GrayScale ,
563and
564.IR StaticGray ,
565followed by
566.BI \- depth\fR,\fP
567where
568.I depth
569is the number of color planes.
570.RE
373.PP 571.PP
374If you try to set color values while using a black and white display, 572If you try to set color values while using a black and white display,
375the window's characteristics will default as follows: 573the window's characteristics will default as follows:
@@ -377,14 +575,17 @@ the foreground color will be set to black,
377the background color will be set to white, 575the background color will be set to white,
378the border color will be set to grey, 576the border color will be set to grey,
379and the text and mouse cursors will be set to black. 577and the text and mouse cursors will be set to black.
578.
579.SS Using the Mouse
380.PP 580.PP
381.SM Using the Mouse 581The following lists some of the mouse button bindings for the
382.PP
383The following lists the mouse button bindings for the
384.I Emacs 582.I Emacs
385window under X11. 583window under X11.
386 584.
585.RS
387.TS 586.TS
587l l
588- -
388l l. 589l l.
389MOUSE BUTTON FUNCTION 590MOUSE BUTTON FUNCTION
390left Set point. 591left Set point.
@@ -394,83 +595,93 @@ SHIFT-middle Cut text into X cut buffer.
394SHIFT-right Paste text. 595SHIFT-right Paste text.
395CTRL-middle Cut text into X cut buffer and kill it. 596CTRL-middle Cut text into X cut buffer and kill it.
396CTRL-right T{ 597CTRL-right T{
397Select this window, then split it into 598Select this window, then split it into two windows.
398two windows. Same as typing CTRL-x 2. 599Same as typing CTRL\-x 2.
399T} 600T}
400.\" START DELETING HERE IF YOU'RE NOT USING X MENUS 601.\" START DELETING HERE IF YOU'RE NOT USING X MENUS
401CTRL-SHIFT-left T{ 602CTRL-SHIFT-left T{
402X buffer menu \(em hold the buttons and keys 603X buffer menu \(em hold the buttons and keys
403down, wait for menu to appear, select 604down, wait for menu to appear, select buffer, and release.
404buffer, and release. Move mouse out of 605Move mouse out of menu and release to cancel.
405menu and release to cancel. 606T}
607CTRL-SHIFT-middle T{
608X help menu \(em pop up index card menu for Emacs help.
406T} 609T}
407CTRL-SHIFT-middle X help menu \(em pop up index card menu for Emacs help.
408.\" STOP DELETING HERE IF YOU'RE NOT USING X MENUS 610.\" STOP DELETING HERE IF YOU'RE NOT USING X MENUS
409CTRL-SHIFT-right T{ 611CTRL-SHIFT-right T{
410Select window with mouse, and delete all 612Select window with mouse, and delete all other windows.
411other windows. Same as typing CTRL-x 1. 613Same as typing CTRL\-x 1.
412T} 614T}
413.\" STOP DELETING HERE IF YOU'RE NOT USING X 615.\" STOP DELETING HERE IF YOU'RE NOT USING X
414.TE 616.TE
415.PP 617.RE
618.
619.
416.SH MANUALS 620.SH MANUALS
417You can order printed copies of the GNU Emacs Manual from the Free 621You can order printed copies of the GNU Emacs Manual from the Free
418Software Foundation, which develops GNU software. See the file ORDERS 622Software Foundation, which develops GNU software.
419for ordering information. 623See the file ORDERS for ordering information.
420.br 624.br
421Your local Emacs maintainer might also have copies available. As 625Your local Emacs maintainer might also have copies available.
422with all software and publications from FSF, everyone is permitted to 626As with all software and publications from FSF, everyone is permitted
423make and distribute copies of the Emacs manual. The TeX source to the 627to make and distribute copies of the Emacs manual.
424manual is also included in the Emacs source distribution. 628The TeX source to the manual is also included in the Emacs source
425.PP 629distribution.
630.
631.
426.SH FILES 632.SH FILES
427/usr/local/share/info - files for the Info documentation browser. 633/usr/local/share/info \(em files for the Info documentation browser.
428The complete text of the Emacs reference manual is included in a 634The complete text of the Emacs reference manual is included in a
429convenient tree structured form. Also includes the Emacs Lisp 635convenient tree structured form.
430Reference Manual, useful to anyone wishing to write programs in the 636Also includes the Emacs Lisp Reference Manual, useful to anyone
431Emacs Lisp extension language. 637wishing to write programs in the Emacs Lisp extension language.
432 638
433/usr/local/share/emacs/$VERSION/lisp - Lisp source files and compiled files 639/usr/local/share/emacs/$VERSION/lisp \(em Lisp source files and
434that define most editing commands. Some are preloaded; 640compiled files that define most editing commands.
435others are autoloaded from this directory when used. 641Some are preloaded; others are autoloaded from this directory when
642used.
436 643
437/usr/local/libexec/emacs/$VERSION/$ARCH - various programs that are 644/usr/local/libexec/emacs/$VERSION/$ARCH \(em various programs that are
438used with GNU Emacs. 645used with GNU Emacs.
439 646
440/usr/local/share/emacs/$VERSION/etc - various files of information. 647/usr/local/share/emacs/$VERSION/etc \(em various files of information.
441 648
442/usr/local/share/emacs/$VERSION/etc/DOC.* - contains the documentation 649/usr/local/share/emacs/$VERSION/etc/DOC.* \(em contains the documentation
443strings for the Lisp primitives and preloaded Lisp functions 650strings for the Lisp primitives and preloaded Lisp functions
444of GNU Emacs. They are stored here to reduce the size of 651of GNU Emacs.
445Emacs proper. 652They are stored here to reduce the size of Emacs proper.
446 653
447.br
448/usr/local/share/emacs/$VERSION/etc/SERVICE lists people offering 654/usr/local/share/emacs/$VERSION/etc/SERVICE lists people offering
449various services to assist users of GNU Emacs, including education, 655various services to assist users of GNU Emacs, including education,
450troubleshooting, porting and customization. 656troubleshooting, porting and customization.
451 657.
452.PP 658.
453.SH BUGS 659.SH BUGS
454There is a mailing list, bug-gnu-emacs@gnu.org, for reporting Emacs 660There is a mailing list, bug-gnu-emacs@gnu.org, for reporting Emacs
455bugs and fixes. But before reporting something as a bug, please try 661bugs and fixes.
456to be sure that it really is a bug, not a misunderstanding or a 662But before reporting something as a bug, please try to be sure that
457deliberate feature. We ask you to read the section ``Reporting Emacs 663it really is a bug, not a misunderstanding or a deliberate feature.
458Bugs'' near the end of the reference manual (or Info system) for hints 664We ask you to read the section ``Reporting Emacs Bugs'' near the
459on how and when to report bugs. Also, include the version number of 665end of the reference manual (or Info system) for hints on how and
460the Emacs you are running in \fIevery\fR bug report that you send in. 666when to report bugs.
667Also, include the version number of the Emacs you are running in
668\fIevery\fR bug report that you send in.
461 669
462Do not expect a personal answer to a bug report. The purpose of reporting 670Do not expect a personal answer to a bug report.
463bugs is to get them fixed for everyone in the next release, if possible. 671The purpose of reporting bugs is to get them fixed for everyone
672in the next release, if possible.
464For personal assistance, look in the SERVICE file (see above) for 673For personal assistance, look in the SERVICE file (see above) for
465a list of people who offer it. 674a list of people who offer it.
466 675
467Please do not send anything but bug reports to this mailing list. 676Please do not send anything but bug reports to this mailing list.
468For more information about Emacs mailing lists, see the 677For more information about Emacs mailing lists, see the
469file /usr/local/emacs/etc/MAILINGLISTS. Bugs tend actually to be 678file /usr/local/emacs/etc/MAILINGLISTS.
470fixed if they can be isolated, so it is in your interest to report 679Bugs tend actually to be fixed if they can be isolated, so it is
471them in such a way that they can be easily reproduced. 680in your interest to report them in such a way that they can be
681easily reproduced.
682.
683.
472.SH UNRESTRICTIONS 684.SH UNRESTRICTIONS
473.PP
474.I Emacs 685.I Emacs
475is free; anyone may redistribute copies of 686is free; anyone may redistribute copies of
476.I Emacs 687.I Emacs
@@ -487,25 +698,37 @@ Copies of
487.I Emacs 698.I Emacs
488may sometimes be received packaged with distributions of Unix systems, 699may sometimes be received packaged with distributions of Unix systems,
489but it is never included in the scope of any license covering those 700but it is never included in the scope of any license covering those
490systems. Such inclusion violates the terms on which distribution 701systems.
491is permitted. In fact, the primary purpose of the General Public 702Such inclusion violates the terms on which distribution is permitted.
492License is to prohibit anyone from attaching any other restrictions 703In fact, the primary purpose of the General Public License is to
493to redistribution of 704prohibit anyone from attaching any other restrictions to
494.I Emacs. 705redistribution of
706.IR Emacs .
495.PP 707.PP
496Richard Stallman encourages you to improve and extend 708Richard Stallman encourages you to improve and extend
497.I Emacs, 709.IR Emacs ,
498and urges that 710and urges that
499you contribute your extensions to the GNU library. Eventually GNU 711you contribute your extensions to the GNU library.
500(Gnu's Not Unix) will be a complete replacement for Unix. 712Eventually GNU (Gnu's Not Unix) will be a complete replacement
713for Unix.
501Everyone will be free to use, copy, study and change the GNU system. 714Everyone will be free to use, copy, study and change the GNU system.
715.
716.
502.SH SEE ALSO 717.SH SEE ALSO
503emacsclient(1), etags(1), X(1), xlsfonts(1), xterm(1), xrdb(1) 718.BR emacsclient (1),
719.BR etags (1),
720.BR X (7),
721.BR xlsfonts (1),
722.BR xterm (1),
723.BR xrdb (1)
724.
725.
504.SH AUTHORS 726.SH AUTHORS
505.PP
506.I Emacs 727.I Emacs
507was written by Richard Stallman and the Free Software Foundation. 728was written by Richard Stallman and the Free Software Foundation.
508Joachim Martillo and Robert Krawitz added the X features. 729Joachim Martillo and Robert Krawitz added the X features.
730.
731.
509.SH COPYING 732.SH COPYING
510Copyright 733Copyright
511.if t \(co 734.if t \(co
@@ -526,5 +749,5 @@ Permission is granted to copy and distribute translations of this
526document into another language, under the above conditions for 749document into another language, under the above conditions for
527modified versions, except that this permission notice may be stated 750modified versions, except that this permission notice may be stated
528in a translation approved by the Free Software Foundation. 751in a translation approved by the Free Software Foundation.
529 752.
530.\" arch-tag: 04dfd376-b46e-4924-919a-cecc3b257eaa 753.\" arch-tag: 04dfd376-b46e-4924-919a-cecc3b257eaa
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c0b00b8fbb1..e808cf75937 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,318 @@
12007-06-16 Karl Fogel <kfogel@red-bean.com>
2
3 * thingatpt.el (thing-at-point-email-regexp): Don't require two
4 chars before the "@" in an email address. Andreas Roehler noticed
5 this problem.
6
72007-06-15 Karl Fogel <kfogel@red-bean.com>
8
9 * thingatpt.el: Add support for email addresses (`email').
10 (thing-at-point, bounds-of-thing-at-point): Document `email' support.
11 (thing-at-point-email-regexp): New variable.
12 (`email'): Put `bounds-of-thing-at-point' and `thing-at-point'
13 properties on this symbol, with lambda forms for values.
14
152007-06-15 Masatake YAMATO <jet@gyve.org>
16
17 * vc-bzr.el (vc-bzr-root): Cache the output of shell command
18 execution.
19
20 * vc.el (vc-dired-hook): Check the backend returned from
21 `vc-responsible-backend' can really handle `subdir'.
22
232007-06-15 Chong Yidong <cyd@stupidchicken.com>
24
25 * wid-edit.el (widget-add-documentation-string-button): Fix
26 handling of documentation indent.
27
282007-06-15 Miles Bader <miles@fencepost.gnu.org>
29
30 * mb-depth.el: New file.
31
322007-06-15 Masatake YAMATO <jet@gyve.org>
33
34 * vc.el (vc-dired-mode): Show backend name as part of mode name.
35
362007-06-14 Chong Yidong <cyd@stupidchicken.com>
37
38 * wid-edit.el (widget-default-create): Move ?h handling here...
39 (widget-default-format-handler): ...from here.
40 (widget-docstring, widget-add-documentation-string-button): New funs.
41 (documentation-string): Add :visibility-widget property.
42 (widget-documentation-string-value-create): Use it.
43
44 * cus-edit.el (custom-split-regexp-maybe): Simplify.
45 (custom-buffer-create-internal): Simplify message.
46 (custom-variable-tag): Reduce height to normal.
47 (custom-variable-value-create, custom-face-value-create)
48 (custom-visibility): New widget.
49 (custom-visibility): New face.
50 (custom-group-value-create): Call
51 widget-add-documentation-string-button, using `custom-visibility'.
52
532007-06-14 Stefan Monnier <monnier@iro.umontreal.ca>
54
55 * emacs-lisp/bytecomp.el (byte-compile-current-group)
56 (byte-compile-nogroup-warn, byte-compile-file): Revert part of last
57 change. Apparently the "warning even if the group is implicit" is
58 a feature rather than a bug.
59
602007-06-14 Michael Kifer <kifer@cs.stonybrook.edu>
61
62 * viper.el (viper-describe-key-ad, viper-describe-key-briefly-ad):
63 different advices for Emacs and XEmacs. Compile them conditionally.
64 (viper-version): belated version change.
65
662007-06-14 Juanma Barranquero <lekktu@gmail.com>
67
68 * follow.el (follow-all-followers, follow-generic-filter):
69 * pcomplete.el (pcomplete-restore-windows):
70 * x-dnd.el (x-dnd-maybe-call-test-function, x-dnd-save-state)
71 (x-dnd-drop-data):
72 * emacs-lisp/edebug.el (edebug-pop-to-buffer, edebug-display):
73 * progmodes/python.el (python-complete-symbol):
74 * term/mac-win.el (mac-dnd-drop-data): Remove redundant check.
75
762007-06-13 Ryan Yeske <rcyeske@gmail.com>
77
78 * rcirc.el (rcirc-format-response-string): Use rcirc-nick-syntax
79 around bright and dim regexps. Make sure bright and dim matches
80 use word anchors. Send text through rcirc-markup functions.
81 (rcirc-url-regexp): Add single quote character.
82 (rcirc-connect): Write logs to disk on auto-save-hook.
83 Make server a non-optional argument.
84 (rcirc-log-alist): New variable.
85 (rcirc-log-directory): Make customizable.
86 (rcirc-log-flag): New customizable variable.
87 (rcirc-log): New function.
88 (rcirc-print): Use above function.
89 (rcirc-log-write): New function.
90 (rcirc-generate-new-buffer-name): Strip text properties.
91 (rcirc-switch-to-buffer-function): Remove variable.
92 (rcirc-last-non-irc-buffer): Remove variable.
93 (rcirc-non-irc-buffer): Add function.
94 (rcirc-next-active-buffer): Use above function.
95 (rcirc-keepalive): Send KEEPALIVE ctcp instead of a PING.
96 (rcirc-handler-ctcp-KEEPALIVE): Add handler.
97 (rcirc-handler-CTCP): Don't print KEEPALIVE responses.
98 (rcirc-omit-mode): Add minor-mode.
99 (rcirc-mode-map): Change C-c C-o binding.
100 (rcirc-mode): Clear mode-line-process. Use a custom
101 fill-paragraph-function. Set up buffer-invisibility-spec.
102 (rcirc-response-formats): Remove timestamp code.
103 (rcirc-omit-responses): Add variable.
104 (rcirc-print): Don't put the overlay arrow on potentially omitted
105 lines. Log line to disk. Record activity for private messages
106 from /dim nicks. Facify the fill-prefix with rcirc-timestamp face.
107 (rcirc-jump-to-first-unread-line): Print message if there is no
108 unread text.
109 (rcirc-clear-unread): New function.
110 (rcirc-markup-text-functions): Add variable.
111 (rcirc-markup-timestamp, rcirc-markup-fill): Add functions.
112 (rcirc-debug): Don't mess with window configuration.
113 (rcirc-send-message): Send message before printing locally.
114 Add SILENT argument, do not print message if non-nil.
115 (rcirc-visible-buffers): New function and variable.
116 (rcirc-window-configuration-change-1): Add function.
117 (rcirc-target-buffer): Make sure ACTIONs don't get sent to the
118 server buffer.
119 (rcirc-clean-up-buffer): Set rcirc-target to nil when finished.
120 (rcirc-fill-paragraph): Add function.
121 (rcirc-record-activity, rcirc-window-configuration-change-1):
122 Only update the activity string if it has actually changed.
123 (rcirc-update-activity-string): Remove padding characters from the
124 mode-line string.
125 (rcirc-disconnect-buffer): New function to be called when a
126 channel is parted or the user quits.
127 (rcirc-server-name): Warn when the server-name hasn't been set.
128 (rcirc-window-configuration-change): Postpone work until
129 post-command-hook.
130 (rcirc-window-configuration-change-1): Update mode-line and
131 overlay arrows here.
132 (rcirc-authenticate): Fix chanserv identification.
133 (rcirc-default-server): Remove variable.
134 (rcirc): Connect according to rcirc-connections.
135 (rcirc-connections): Add variable.
136 (rcirc-startup-channels-alist): Remove variable.
137 (rcirc-startup-channels): Remove function.
138
1392007-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
140
141 * diff-mode.el (diff-font-lock-keywords): Fix M. Kifer's last change.
142
1432007-06-13 Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se> (tiny change)
144
145 * term/xterm.el (terminal-init-xterm): Escape parens in character
146 constants.
147
1482007-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
149
150 * progmodes/sh-script.el: Remove unneeded * from docstrings.
151 Use [:alpha:] and [:alnum:] where applicable.
152 (sh-quoted-subshell): Rewrite to correctly
153 handle nested mixes of `...` and $(...).
154 (sh-apply-quoted-subshell): Remove.
155 (sh-font-lock-syntactic-keywords): Adjust call to sh-quoted-subshell.
156
157 * vc-arch.el (vc-arch-command): Remove bzr. It's a different program.
158
1592007-06-12 Tom Tromey <tromey@redhat.com>
160
161 * subr.el (user-emacs-directory): New defconst.
162 * cmuscheme.el (scheme-start-file):
163 * shell.el (shell):
164 * completion.el (save-completions-file-name):
165 * custom.el (custom-theme-directory):
166 * term/x-win.el (emacs-session-filename):
167 * filesets.el (filesets-menu-cache-file):
168 * thumbs.el (thumbs-thumbsdir):
169 * server.el (server-auth-dir):
170 * image-dired.el (image-dired-dir):
171 (image-dired-db-file):
172 (image-dired-temp-image-file):
173 (image-dired-gallery-dir):
174 (image-dired-temp-rotate-image-file):
175 * play/gamegrid.el (gamegrid-user-score-file-directory):
176 * savehist.el (savehist-file):
177 * tutorial.el (tutorial--saved-dir):
178 * startup.el (auto-save-list-file-prefix): Use user-emacs-directory.
179
1802007-06-12 Ralf Angeli <angeli@caeruleus.net>
181
182 * scroll-lock.el (scroll-lock-mode): Doc fix.
183
1842007-06-12 Michael Kifer <kifer@cs.stonybrook.edu>
185
186 * ediff-ptch.el (ediff-context-diff-label-regexp): Spurious parenthesis.
187
188 * ediff-init.el: Doc strings.
189
1902007-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
191
192 * emacs-lisp/bytecomp.el (byte-compile-current-group): New var.
193 (byte-compile-file): Bind it.
194 (byte-compile-nogroup-warn): Use it to avoid spurious warnings when the
195 group argument is provided implicitly.
196 (byte-compile-format-warn, byte-compile-from-buffer)
197 (byte-compile-insert-header): Don't hardcode point-min==1.
198 (byte-compile-file-form-require): Remove unused var old-load-list.
199 (byte-compile-eval): Remove unused vars old-autoloads and hist-nil-new.
200
2012007-06-12 Michael Kifer <kifer@cs.stonybrook.edu>
202
203 * emulation/viper-cmd.el (viper-prefix-arg-com, viper-prefix-arg-value):
204 Display error messages.
205 (viper-prev-destructive-command, viper-insert-prev-from-insertion-ring):
206 Get rid of cl.el dependencies.
207
208 * emulation/viper-init.el (viper-suppress-input-method-change-message):
209 New variable.
210 (viper-activate-input-method-action)
211 (viper-inactivate-input-method-action):
212 Use viper-suppress-input-method-change-message.
213
214 * emulation/viper-kem.el (viper-vi-basic-map): Disable the bindings
215 for C-s, C-r.
216
217 * emulation/viper-util.el (viper-set-cursor-color-according-to-state):
218 Use viper-replace-overlay-cursor-color instead of
219 viper-replace-overlay-cursor-color.
220 (viper-sit-for-short): Use sit-for with 3 arguments.
221
222 * emulation/viper.el (viper-insert-state-mode-list): Add gud-mode.
223 (viper-major-mode-modifier-list): Add viper-comint-mode-modifier-map
224 to gud-mode.
225
226 * ediff-mult.el (ediff-meta-buffer-brief-message)
227 (ediff-meta-buffer-verbose-message): New variables.
228 (ediff-meta-buffer-message): Variable deleted.
229 (ediff-verbose-help-enabled): New variable.
230 (ediff-toggle-verbose-help-meta-buffer): New function.
231 (ediff-redraw-directory-group-buffer): Made aware of short/verbose
232 message options
233
234 * ediff-ptch.el (ediff-context-diff-label-regexp): Better regexp.
235 (ediff-fixup-patch-map): Improve heuristic.
236
2372007-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
238
239 * log-view.el (log-view-file-re, log-view-message-re): Use \(?1:...\).
240 (log-view-font-lock-keywords): Simplify.
241 (log-view-current-file, log-view-current-tag): Simplify.
242
2432007-06-12 Sam Steingold <sds@gnu.org>
244
245 * vc-arch.el (vc-arch-command): Also try "baz" and "bzr".
246
2472007-06-12 Juanma Barranquero <lekktu@gmail.com>
248
249 * desktop.el (desktop-load-locked-desktop): New option.
250 (desktop-read): Use it.
251 (desktop-truncate, desktop-outvar, desktop-restore-file-buffer):
252 Use `when'.
253
2542007-06-12 Davis Herring <herring@lanl.gov>
255
256 * desktop.el (desktop-save-mode-off): New function.
257 (desktop-base-lock-name, desktop-not-loaded-hook): New variables.
258 (desktop-full-lock-name, desktop-file-modtime, desktop-owner)
259 (desktop-claim-lock, desktop-release-lock): New functions.
260 (desktop-kill): Tell `desktop-save' that this is the last save.
261 Release the lock afterwards.
262 (desktop-buffer-info): New function.
263 (desktop-save): Use it. Run `desktop-save-hook' where the doc
264 says to. Detect conflicts, and manage the lock.
265 (desktop-read): Detect conflicts. Manage the lock.
266
2672007-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
268
269 * emulation/tpu-mapper.el (tpu-emacs-map-key): Use new keymap names.
270
271 * emulation/tpu-edt.el (tpu-gold-map): Rename from GOLD-map.
272 (tpu-lucid-emacs-p): Remove. Use (featurep 'xemacs) instead.
273 (CSI-map, GOLD-CSI-map, GOLD-SS3-map, SS3-map): Delete vars.
274 (tpu-gold-map, tpu-global-map): Add all the SS3 and CSI bindings, using
275 keysyms rather than byte sequences.
276 (tpu-copy-keyfile): Don't force the user to use tpu-mapper.el.
277
2782007-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
279
280 * font-lock.el (font-lock-add-keywords): In case font-lock was only
281 half-activated, forcefully activate it completely.
282
2832007-06-11 Richard Stallman <rms@gnu.org>
284
285 * cus-edit.el (custom-variable-type): Doc fix.
286
2872007-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
288
289 * progmodes/sh-script.el (sh-font-lock-backslash-quote)
290 (sh-font-lock-flush-syntax-ppss-cache): New functions.
291 (sh-font-lock-syntactic-keywords): Use them to distinguish the
292 different possible cases for \'.
293
294 * complete.el (PC-bindings): Don't bind things already bound in the
295 parent keymap.
296
297 * textmodes/bibtex-style.el: New file.
298
2992007-06-11 Riccardo Murri <riccardo.murri@gmail.com>
300
301 * vc-bzr.el: New file.
302
3032007-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
304
305 * vc-svn.el (vc-svn-program): New var.
306 (vc-svn-command): Use it.
307
3082007-06-11 Juanma Barranquero <lekktu@gmail.com>
309
310 * server.el (server-switch-buffer): Remove redundant check.
311
12007-06-10 Martin Rudalics <rudalics@gmx.at> 3122007-06-10 Martin Rudalics <rudalics@gmx.at>
2 313
3 * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions): Match 314 * emacs-lisp/bytecomp.el (byte-compile-find-cl-functions):
4 against file-name-nondirectory. 315 Match against file-name-nondirectory.
5 Fix text on user customization variables. 316 Fix text on user customization variables.
6 Reported by Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>. 317 Reported by Johan Bockg,Ae(Brd <bojohan@dd.chalmers.se>.
7 318
diff --git a/lisp/cmuscheme.el b/lisp/cmuscheme.el
index 12840441a6a..b89470b0045 100644
--- a/lisp/cmuscheme.el
+++ b/lisp/cmuscheme.el
@@ -271,7 +271,7 @@ Search in the directories \"~\" and \"~/.emacs.d\", in this
271order. Return nil if no start file found." 271order. Return nil if no start file found."
272 (let* ((progname (file-name-nondirectory prog)) 272 (let* ((progname (file-name-nondirectory prog))
273 (start-file (concat "~/.emacs_" progname)) 273 (start-file (concat "~/.emacs_" progname))
274 (alt-start-file (concat "~/.emacs.d/init_" progname ".scm"))) 274 (alt-start-file (concat user-emacs-directory "init_" progname ".scm")))
275 (if (file-exists-p start-file) 275 (if (file-exists-p start-file)
276 start-file 276 start-file
277 (and (file-exists-p alt-start-file) alt-start-file)))) 277 (and (file-exists-p alt-start-file) alt-start-file))))
diff --git a/lisp/complete.el b/lisp/complete.el
index b1bb36f9dfa..7d9bd989089 100644
--- a/lisp/complete.el
+++ b/lisp/complete.el
@@ -153,11 +153,8 @@ If nil, means use the colon-separated path in the variable $INCPATH instead."
153 (define-key completion-map " " 'minibuffer-complete-word) 153 (define-key completion-map " " 'minibuffer-complete-word)
154 (define-key completion-map "?" 'minibuffer-completion-help) 154 (define-key completion-map "?" 'minibuffer-completion-help)
155 155
156 (define-key must-match-map "\t" 'minibuffer-complete)
157 (define-key must-match-map " " 'minibuffer-complete-word)
158 (define-key must-match-map "\r" 'minibuffer-complete-and-exit) 156 (define-key must-match-map "\r" 'minibuffer-complete-and-exit)
159 (define-key must-match-map "\n" 'minibuffer-complete-and-exit) 157 (define-key must-match-map "\n" 'minibuffer-complete-and-exit)
160 (define-key must-match-map "?" 'minibuffer-completion-help)
161 158
162 (define-key global-map [remap lisp-complete-symbol] nil)) 159 (define-key global-map [remap lisp-complete-symbol] nil))
163 (PC-default-bindings 160 (PC-default-bindings
@@ -173,17 +170,11 @@ If nil, means use the colon-separated path in the variable $INCPATH instead."
173 (define-key completion-map "\e\n" 'PC-force-complete-and-exit) 170 (define-key completion-map "\e\n" 'PC-force-complete-and-exit)
174 (define-key completion-map "\e?" 'PC-completion-help) 171 (define-key completion-map "\e?" 'PC-completion-help)
175 172
176 (define-key must-match-map "\t" 'PC-complete)
177 (define-key must-match-map " " 'PC-complete-word)
178 (define-key must-match-map "\r" 'PC-complete-and-exit) 173 (define-key must-match-map "\r" 'PC-complete-and-exit)
179 (define-key must-match-map "\n" 'PC-complete-and-exit) 174 (define-key must-match-map "\n" 'PC-complete-and-exit)
180 (define-key must-match-map "?" 'PC-completion-help)
181 175
182 (define-key must-match-map "\e\t" 'PC-complete)
183 (define-key must-match-map "\e " 'PC-complete-word)
184 (define-key must-match-map "\e\r" 'PC-complete-and-exit) 176 (define-key must-match-map "\e\r" 'PC-complete-and-exit)
185 (define-key must-match-map "\e\n" 'PC-complete-and-exit) 177 (define-key must-match-map "\e\n" 'PC-complete-and-exit)
186 (define-key must-match-map "\e?" 'PC-completion-help)
187 178
188 (define-key global-map [remap lisp-complete-symbol] 'PC-lisp-complete-symbol))))) 179 (define-key global-map [remap lisp-complete-symbol] 'PC-lisp-complete-symbol)))))
189 180
diff --git a/lisp/completion.el b/lisp/completion.el
index 25b95852536..c9e27ab3091 100644
--- a/lisp/completion.el
+++ b/lisp/completion.el
@@ -301,9 +301,9 @@ See also `save-completions-retention-time'."
301 (let ((olddef (convert-standard-filename "~/.completions"))) 301 (let ((olddef (convert-standard-filename "~/.completions")))
302 (cond 302 (cond
303 ((file-readable-p olddef) olddef) 303 ((file-readable-p olddef) olddef)
304 ((file-directory-p (convert-standard-filename "~/.emacs.d/")) 304 ((file-directory-p user-emacs-directory)
305 (convert-standard-filename 305 (convert-standard-filename
306 (expand-file-name "completions" "~/.emacs.d/"))) 306 (expand-file-name "completions" user-emacs-directory)))
307 (t olddef))) 307 (t olddef)))
308 "The filename to save completions to." 308 "The filename to save completions to."
309 :type 'file 309 :type 'file
diff --git a/lisp/cus-edit.el b/lisp/cus-edit.el
index 4dae3bab018..9adb72c735c 100644
--- a/lisp/cus-edit.el
+++ b/lisp/cus-edit.el
@@ -501,17 +501,12 @@
501 501
502(defun custom-split-regexp-maybe (regexp) 502(defun custom-split-regexp-maybe (regexp)
503 "If REGEXP is a string, split it to a list at `\\|'. 503 "If REGEXP is a string, split it to a list at `\\|'.
504You can get the original back with from the result with: 504You can get the original back from the result with:
505 (mapconcat 'identity result \"\\|\") 505 (mapconcat 'identity result \"\\|\")
506 506
507IF REGEXP is not a string, return it unchanged." 507IF REGEXP is not a string, return it unchanged."
508 (if (stringp regexp) 508 (if (stringp regexp)
509 (let ((start 0) 509 (split-string regexp "\\\\|")
510 all)
511 (while (string-match "\\\\|" regexp start)
512 (setq all (cons (substring regexp start (match-beginning 0)) all)
513 start (match-end 0)))
514 (nreverse (cons (substring regexp start) all)))
515 regexp)) 510 regexp))
516 511
517(defun custom-variable-prompt () 512(defun custom-variable-prompt ()
@@ -1559,18 +1554,15 @@ Editing a setting changes only the text in the buffer."
1559 "Square brackets indicate"))) 1554 "Square brackets indicate")))
1560 (if init-file-user 1555 (if init-file-user
1561 (widget-insert " 1556 (widget-insert "
1562Use the setting's State button to set it or save changes in it. 1557Use the Save or Set buttons to set apply your changes.
1563Saving a change normally works by editing your Emacs init file.") 1558Saving a change normally works by editing your Emacs ")
1564 (widget-insert " 1559 (widget-insert "
1565\nSince you started Emacs with `-q', which inhibits use of the 1560\nSince you started Emacs with `-q', you cannot save settings into
1566Emacs init file, you cannot save settings into the Emacs init file.")) 1561the Emacs "))
1567 (widget-insert "\nSee ")
1568 (widget-create 'custom-manual 1562 (widget-create 'custom-manual
1569 :tag "Custom file" 1563 :tag "init file"
1570 "(emacs)Saving Customizations") 1564 "(emacs)Saving Customizations")
1571 (widget-insert 1565 (widget-insert ".\nSee ")
1572 " for information on how to save in a different file.\n
1573See ")
1574 (widget-create 'custom-manual 1566 (widget-create 'custom-manual
1575 :tag "Help" 1567 :tag "Help"
1576 :help-echo "Read the online help." 1568 :help-echo "Read the online help."
@@ -2439,13 +2431,13 @@ If INITIAL-STRING is non-nil, use that rather than \"Parent groups:\"."
2439(defface custom-variable-tag 2431(defface custom-variable-tag
2440 `((((class color) 2432 `((((class color)
2441 (background dark)) 2433 (background dark))
2442 (:foreground "light blue" :weight bold :height 1.2 :inherit variable-pitch)) 2434 (:foreground "light blue" :weight bold :inherit variable-pitch))
2443 (((min-colors 88) (class color) 2435 (((min-colors 88) (class color)
2444 (background light)) 2436 (background light))
2445 (:foreground "blue1" :weight bold :height 1.2 :inherit variable-pitch)) 2437 (:foreground "blue1" :weight bold :inherit variable-pitch))
2446 (((class color) 2438 (((class color)
2447 (background light)) 2439 (background light))
2448 (:foreground "blue" :weight bold :height 1.2 :inherit variable-pitch)) 2440 (:foreground "blue" :weight bold :inherit variable-pitch))
2449 (t (:weight bold))) 2441 (t (:weight bold)))
2450 "Face used for unpushable variable tags." 2442 "Face used for unpushable variable tags."
2451 :group 'custom-faces) 2443 :group 'custom-faces)
@@ -2500,7 +2492,8 @@ However, setting it through Custom sets the default value.")
2500(defun custom-variable-type (symbol) 2492(defun custom-variable-type (symbol)
2501 "Return a widget suitable for editing the value of SYMBOL. 2493 "Return a widget suitable for editing the value of SYMBOL.
2502If SYMBOL has a `custom-type' property, use that. 2494If SYMBOL has a `custom-type' property, use that.
2503Otherwise, look up symbol in `custom-guess-type-alist'." 2495Otherwise, try matching SYMBOL against `custom-guess-name-alist' and
2496try matching its doc string against `custom-guess-doc-alist'."
2504 (let* ((type (or (get symbol 'custom-type) 2497 (let* ((type (or (get symbol 'custom-type)
2505 (and (not (get symbol 'standard-value)) 2498 (and (not (get symbol 'standard-value))
2506 (custom-guess-type symbol)) 2499 (custom-guess-type symbol))
@@ -2635,15 +2628,11 @@ Otherwise, look up symbol in `custom-guess-type-alist'."
2635 widget 'custom-magic nil))) 2628 widget 'custom-magic nil)))
2636 (widget-put widget :custom-magic magic) 2629 (widget-put widget :custom-magic magic)
2637 (push magic buttons)) 2630 (push magic buttons))
2638 ;; ### NOTE: this is ugly!!!! I need to update the :buttons property
2639 ;; before the call to `widget-default-format-handler'. Otherwise, I
2640 ;; loose my current `buttons'. This function shouldn't be called like
2641 ;; this anyway. The doc string widget should be added like the others.
2642 ;; --dv
2643 (widget-put widget :buttons buttons) 2631 (widget-put widget :buttons buttons)
2644 (insert "\n") 2632 (insert "\n")
2645 ;; Insert documentation. 2633 ;; Insert documentation.
2646 (widget-default-format-handler widget ?h) 2634 (widget-add-documentation-string-button
2635 widget :visibility-widget 'custom-visibility)
2647 2636
2648 ;; The comment field 2637 ;; The comment field
2649 (unless (eq state 'hidden) 2638 (unless (eq state 'hidden)
@@ -2983,6 +2972,21 @@ to switch between two values."
2983 ;; This call will possibly make the comment invisible 2972 ;; This call will possibly make the comment invisible
2984 (custom-redraw widget))) 2973 (custom-redraw widget)))
2985 2974
2975;;; The `custom-visibility' Widget
2976
2977(define-widget 'custom-visibility 'visibility
2978 "Show or hide a documentation string."
2979 :button-face 'custom-visibility
2980 :pressed-face 'custom-visibility
2981 :mouse-face 'highlight
2982 :pressed-face 'highlight)
2983
2984(defface custom-visibility
2985 '((t :height 0.8 :inherit link))
2986 "Face for the `custom-visibility' widget."
2987 :version "23.1"
2988 :group 'custom-faces)
2989
2986;;; The `custom-face-edit' Widget. 2990;;; The `custom-face-edit' Widget.
2987 2991
2988(define-widget 'custom-face-edit 'checklist 2992(define-widget 'custom-face-edit 'checklist
@@ -3354,7 +3358,9 @@ SPEC must be a full face spec."
3354 ;; Update buttons. 3358 ;; Update buttons.
3355 (widget-put widget :buttons buttons) 3359 (widget-put widget :buttons buttons)
3356 ;; Insert documentation. 3360 ;; Insert documentation.
3357 (widget-default-format-handler widget ?h) 3361 (widget-add-documentation-string-button
3362 widget :visibility-widget 'custom-visibility)
3363
3358 ;; The comment field 3364 ;; The comment field
3359 (unless (eq state 'hidden) 3365 (unless (eq state 'hidden)
3360 (let* ((comment (get symbol 'face-comment)) 3366 (let* ((comment (get symbol 'face-comment))
@@ -3926,7 +3932,9 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
3926 ;; Insert documentation. 3932 ;; Insert documentation.
3927 (if (and (eq custom-buffer-style 'links) (> level 1)) 3933 (if (and (eq custom-buffer-style 'links) (> level 1))
3928 (widget-put widget :documentation-indent 0)) 3934 (widget-put widget :documentation-indent 0))
3929 (widget-default-format-handler widget ?h)) 3935 (widget-add-documentation-string-button
3936 widget :visibility-widget 'custom-visibility))
3937
3930 ;; Nested style. 3938 ;; Nested style.
3931 (t ;Visible. 3939 (t ;Visible.
3932 ;; Add parent groups references above the group. 3940 ;; Add parent groups references above the group.
@@ -3934,7 +3942,7 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
3934 ;;; was made to display a group. 3942 ;;; was made to display a group.
3935 (when (eq level 1) 3943 (when (eq level 1)
3936 (if (custom-add-parent-links widget 3944 (if (custom-add-parent-links widget
3937 "Go to parent group:") 3945 "Parent group:")
3938 (insert "\n")))) 3946 (insert "\n"))))
3939 ;; Create level indicator. 3947 ;; Create level indicator.
3940 (insert-char ?\ (* custom-buffer-indent (1- level))) 3948 (insert-char ?\ (* custom-buffer-indent (1- level)))
@@ -3970,7 +3978,9 @@ If GROUPS-ONLY non-nil, return only those members that are groups."
3970 ;; Update buttons. 3978 ;; Update buttons.
3971 (widget-put widget :buttons buttons) 3979 (widget-put widget :buttons buttons)
3972 ;; Insert documentation. 3980 ;; Insert documentation.
3973 (widget-default-format-handler widget ?h) 3981 (widget-add-documentation-string-button
3982 widget :visibility-widget 'custom-visibility)
3983
3974 ;; Parent groups. 3984 ;; Parent groups.
3975 (if nil ;;; This should test that the buffer 3985 (if nil ;;; This should test that the buffer
3976 ;;; was not made to display a group. 3986 ;;; was not made to display a group.
diff --git a/lisp/custom.el b/lisp/custom.el
index f5028ddc0d5..98a301d80f1 100644
--- a/lisp/custom.el
+++ b/lisp/custom.el
@@ -1009,10 +1009,7 @@ Every theme X has a property `provide-theme' whose value is \"X-theme\".
1009;;; Loading themes. 1009;;; Loading themes.
1010 1010
1011(defcustom custom-theme-directory 1011(defcustom custom-theme-directory
1012 (if (eq system-type 'ms-dos) 1012 user-emacs-directory
1013 ;; MS-DOS cannot have initial dot.
1014 "~/_emacs.d/"
1015 "~/.emacs.d/")
1016 "Directory in which Custom theme files should be written. 1013 "Directory in which Custom theme files should be written.
1017`load-theme' searches this directory in addition to load-path. 1014`load-theme' searches this directory in addition to load-path.
1018The command `customize-create-theme' writes the files it produces 1015The command `customize-create-theme' writes the files it produces
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 76fcb8a519f..98b0826084e 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -162,6 +162,10 @@ and function `desktop-read' for details."
162(define-obsolete-variable-alias 'desktop-enable 162(define-obsolete-variable-alias 'desktop-enable
163 'desktop-save-mode "22.1") 163 'desktop-save-mode "22.1")
164 164
165(defun desktop-save-mode-off ()
166 "Disable `desktop-save-mode'. Provided for use in hooks."
167 (desktop-save-mode 0))
168
165(defcustom desktop-save 'ask-if-new 169(defcustom desktop-save 'ask-if-new
166 "*Specifies whether the desktop should be saved when it is killed. 170 "*Specifies whether the desktop should be saved when it is killed.
167A desktop is killed when the user changes desktop or quits Emacs. 171A desktop is killed when the user changes desktop or quits Emacs.
@@ -186,6 +190,22 @@ determine where the desktop is saved."
186 :group 'desktop 190 :group 'desktop
187 :version "22.1") 191 :version "22.1")
188 192
193(defcustom desktop-load-locked-desktop 'ask
194 "Specifies whether the desktop should be loaded if locked.
195Possible values are:
196 t -- load anyway.
197 nil -- don't load.
198 ask -- ask the user.
199If the value is nil, or `ask' and the user chooses not to load the desktop,
200the normal hook `desktop-not-loaded-hook' is run."
201 :type
202 '(choice
203 (const :tag "Load anyway" t)
204 (const :tag "Don't load" nil)
205 (const :tag "Ask the user" ask))
206 :group 'desktop
207 :version "23.1")
208
189(defcustom desktop-base-file-name 209(defcustom desktop-base-file-name
190 (convert-standard-filename ".emacs.desktop") 210 (convert-standard-filename ".emacs.desktop")
191 "Name of file for Emacs desktop, excluding the directory part." 211 "Name of file for Emacs desktop, excluding the directory part."
@@ -194,6 +214,13 @@ determine where the desktop is saved."
194(define-obsolete-variable-alias 'desktop-basefilename 214(define-obsolete-variable-alias 'desktop-basefilename
195 'desktop-base-file-name "22.1") 215 'desktop-base-file-name "22.1")
196 216
217(defcustom desktop-base-lock-name
218 (convert-standard-filename ".emacs.desktop.lock")
219 "Name of lock file for Emacs desktop, excluding the directory part."
220 :type 'file
221 :group 'desktop
222 :version "23.1")
223
197(defcustom desktop-path '("." "~") 224(defcustom desktop-path '("." "~")
198 "List of directories to search for the desktop file. 225 "List of directories to search for the desktop file.
199The base name of the file is specified in `desktop-base-file-name'." 226The base name of the file is specified in `desktop-base-file-name'."
@@ -219,6 +246,15 @@ May be used to show a dired buffer."
219 :group 'desktop 246 :group 'desktop
220 :version "22.1") 247 :version "22.1")
221 248
249(defcustom desktop-not-loaded-hook nil
250 "Normal hook run when the user declines to re-use a desktop file.
251Run in the directory in which the desktop file was found.
252May be used to deal with accidental multiple Emacs jobs."
253 :type 'hook
254 :group 'desktop
255 :options '(desktop-save-mode-off save-buffers-kill-emacs)
256 :version "23.1")
257
222(defcustom desktop-after-read-hook nil 258(defcustom desktop-after-read-hook nil
223 "Normal hook run after a successful `desktop-read'. 259 "Normal hook run after a successful `desktop-read'.
224May be used to show a buffer list." 260May be used to show a buffer list."
@@ -486,6 +522,11 @@ See also `desktop-minor-mode-table'.")
486DIRNAME omitted or nil means use `desktop-dirname'." 522DIRNAME omitted or nil means use `desktop-dirname'."
487 (expand-file-name desktop-base-file-name (or dirname desktop-dirname))) 523 (expand-file-name desktop-base-file-name (or dirname desktop-dirname)))
488 524
525(defun desktop-full-lock-name (&optional dirname)
526 "Return the full name of the desktop lock file in DIRNAME.
527DIRNAME omitted or nil means use `desktop-dirname'."
528 (expand-file-name desktop-base-lock-name (or dirname desktop-dirname)))
529
489(defconst desktop-header 530(defconst desktop-header
490";; -------------------------------------------------------------------------- 531";; --------------------------------------------------------------------------
491;; Desktop File for Emacs 532;; Desktop File for Emacs
@@ -496,11 +537,44 @@ DIRNAME omitted or nil means use `desktop-dirname'."
496 "Hooks run after all buffers are loaded; intended for internal use.") 537 "Hooks run after all buffers are loaded; intended for internal use.")
497 538
498;; ---------------------------------------------------------------------------- 539;; ----------------------------------------------------------------------------
540;; Desktop file conflict detection
541(defvar desktop-file-modtime nil
542 "When the desktop file was last modified to the knowledge of this Emacs.
543Used to detect desktop file conflicts.")
544
545(defun desktop-owner (&optional dirname)
546 "Return the PID of the Emacs process that owns the desktop file in DIRNAME.
547Return nil if no desktop file found or no Emacs process is using it.
548DIRNAME omitted or nil means use `desktop-dirname'."
549 (let (owner)
550 (and (file-exists-p (desktop-full-lock-name dirname))
551 (condition-case nil
552 (with-temp-buffer
553 (insert-file-contents-literally (desktop-full-lock-name dirname))
554 (goto-char (point-min))
555 (setq owner (read (current-buffer)))
556 (integerp owner))
557 (error nil))
558 owner)))
559
560(defun desktop-claim-lock (&optional dirname)
561 "Record this Emacs process as the owner of the desktop file in DIRNAME.
562DIRNAME omitted or nil means use `desktop-dirname'."
563 (write-region (number-to-string (emacs-pid)) nil
564 (desktop-full-lock-name dirname)))
565
566(defun desktop-release-lock (&optional dirname)
567 "Remove the lock file for the desktop in DIRNAME.
568DIRNAME omitted or nil means use `desktop-dirname'."
569 (let ((file (desktop-full-lock-name dirname)))
570 (when (file-exists-p file) (delete-file file))))
571
572;; ----------------------------------------------------------------------------
499(defun desktop-truncate (list n) 573(defun desktop-truncate (list n)
500 "Truncate LIST to at most N elements destructively." 574 "Truncate LIST to at most N elements destructively."
501 (let ((here (nthcdr (1- n) list))) 575 (let ((here (nthcdr (1- n) list)))
502 (if (consp here) 576 (when (consp here)
503 (setcdr here nil)))) 577 (setcdr here nil))))
504 578
505;; ---------------------------------------------------------------------------- 579;; ----------------------------------------------------------------------------
506;;;###autoload 580;;;###autoload
@@ -513,7 +587,7 @@ Furthermore, it clears the variables listed in `desktop-globals-to-clear'."
513 (desktop-lazy-abort) 587 (desktop-lazy-abort)
514 (dolist (var desktop-globals-to-clear) 588 (dolist (var desktop-globals-to-clear)
515 (if (symbolp var) 589 (if (symbolp var)
516 (eval `(setq-default ,var nil)) 590 (eval `(setq-default ,var nil))
517 (eval `(setq-default ,(car var) ,(cdr var))))) 591 (eval `(setq-default ,(car var) ,(cdr var)))))
518 (let ((buffers (buffer-list)) 592 (let ((buffers (buffer-list))
519 (preserve-regexp (concat "^\\(" 593 (preserve-regexp (concat "^\\("
@@ -556,10 +630,12 @@ is nil, ask the user where to save the desktop."
556 (lambda (dir) 630 (lambda (dir)
557 (interactive "DDirectory for desktop file: ") dir)))))) 631 (interactive "DDirectory for desktop file: ") dir))))))
558 (condition-case err 632 (condition-case err
559 (desktop-save desktop-dirname) 633 (desktop-save desktop-dirname t)
560 (file-error 634 (file-error
561 (unless (yes-or-no-p "Error while saving the desktop. Ignore? ") 635 (unless (yes-or-no-p "Error while saving the desktop. Ignore? ")
562 (signal (car err) (cdr err))))))) 636 (signal (car err) (cdr err))))))
637 ;; If we own it, we don't anymore.
638 (when (eq (emacs-pid) (desktop-owner)) (desktop-release-lock)))
563 639
564;; ---------------------------------------------------------------------------- 640;; ----------------------------------------------------------------------------
565(defun desktop-list* (&rest args) 641(defun desktop-list* (&rest args)
@@ -574,83 +650,123 @@ is nil, ask the user where to save the desktop."
574 value))) 650 value)))
575 651
576;; ---------------------------------------------------------------------------- 652;; ----------------------------------------------------------------------------
653(defun desktop-buffer-info (buffer)
654 (set-buffer buffer)
655 (list
656 ;; basic information
657 (desktop-file-name (buffer-file-name) dirname)
658 (buffer-name)
659 major-mode
660 ;; minor modes
661 (let (ret)
662 (mapc
663 #'(lambda (minor-mode)
664 (and (boundp minor-mode)
665 (symbol-value minor-mode)
666 (let* ((special (assq minor-mode desktop-minor-mode-table))
667 (value (cond (special (cadr special))
668 ((functionp minor-mode) minor-mode))))
669 (when value (add-to-list 'ret value)))))
670 (mapcar #'car minor-mode-alist))
671 ret)
672 ;; point and mark, and read-only status
673 (point)
674 (list (mark t) mark-active)
675 buffer-read-only
676 ;; auxiliary information
677 (when (functionp desktop-save-buffer)
678 (funcall desktop-save-buffer dirname))
679 ;; local variables
680 (let ((locals desktop-locals-to-save)
681 (loclist (buffer-local-variables))
682 (ll))
683 (while locals
684 (let ((here (assq (car locals) loclist)))
685 (if here
686 (setq ll (cons here ll))
687 (when (member (car locals) loclist)
688 (setq ll (cons (car locals) ll)))))
689 (setq locals (cdr locals)))
690 ll)))
691
692;; ----------------------------------------------------------------------------
577(defun desktop-internal-v2s (value) 693(defun desktop-internal-v2s (value)
578 "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE. 694 "Convert VALUE to a pair (QUOTE . TXT); (eval (read TXT)) gives VALUE.
579TXT is a string that when read and evaluated yields value. 695TXT is a string that when read and evaluated yields value.
580QUOTE may be `may' (value may be quoted), 696QUOTE may be `may' (value may be quoted),
581`must' (values must be quoted), or nil (value may not be quoted)." 697`must' (values must be quoted), or nil (value may not be quoted)."
582 (cond 698 (cond
583 ((or (numberp value) (null value) (eq t value) (keywordp value)) 699 ((or (numberp value) (null value) (eq t value) (keywordp value))
584 (cons 'may (prin1-to-string value))) 700 (cons 'may (prin1-to-string value)))
585 ((stringp value) 701 ((stringp value)
586 (let ((copy (copy-sequence value))) 702 (let ((copy (copy-sequence value)))
587 (set-text-properties 0 (length copy) nil copy) 703 (set-text-properties 0 (length copy) nil copy)
588 ;; Get rid of text properties because we cannot read them 704 ;; Get rid of text properties because we cannot read them
589 (cons 'may (prin1-to-string copy)))) 705 (cons 'may (prin1-to-string copy))))
590 ((symbolp value) 706 ((symbolp value)
591 (cons 'must (prin1-to-string value))) 707 (cons 'must (prin1-to-string value)))
592 ((vectorp value) 708 ((vectorp value)
593 (let* ((special nil) 709 (let* ((special nil)
594 (pass1 (mapcar 710 (pass1 (mapcar
595 (lambda (el) 711 (lambda (el)
596 (let ((res (desktop-internal-v2s el))) 712 (let ((res (desktop-internal-v2s el)))
597 (if (null (car res)) 713 (if (null (car res))
598 (setq special t)) 714 (setq special t))
599 res)) 715 res))
600 value))) 716 value)))
601 (if special 717 (if special
602 (cons nil (concat "(vector " 718 (cons nil (concat "(vector "
603 (mapconcat (lambda (el) 719 (mapconcat (lambda (el)
604 (if (eq (car el) 'must) 720 (if (eq (car el) 'must)
605 (concat "'" (cdr el)) 721 (concat "'" (cdr el))
606 (cdr el))) 722 (cdr el)))
607 pass1 723 pass1
608 " ") 724 " ")
609 ")")) 725 ")"))
610 (cons 'may (concat "[" (mapconcat 'cdr pass1 " ") "]"))))) 726 (cons 'may (concat "[" (mapconcat 'cdr pass1 " ") "]")))))
611 ((consp value) 727 ((consp value)
612 (let ((p value) 728 (let ((p value)
613 newlist 729 newlist
614 use-list* 730 use-list*
615 anynil) 731 anynil)
616 (while (consp p) 732 (while (consp p)
617 (let ((q.txt (desktop-internal-v2s (car p)))) 733 (let ((q.txt (desktop-internal-v2s (car p))))
618 (or anynil (setq anynil (null (car q.txt)))) 734 (or anynil (setq anynil (null (car q.txt))))
619 (setq newlist (cons q.txt newlist))) 735 (setq newlist (cons q.txt newlist)))
620 (setq p (cdr p))) 736 (setq p (cdr p)))
621 (if p 737 (if p
622 (let ((last (desktop-internal-v2s p))) 738 (let ((last (desktop-internal-v2s p)))
623 (or anynil (setq anynil (null (car last)))) 739 (or anynil (setq anynil (null (car last))))
624 (or anynil 740 (or anynil
625 (setq newlist (cons '(must . ".") newlist))) 741 (setq newlist (cons '(must . ".") newlist)))
626 (setq use-list* t) 742 (setq use-list* t)
627 (setq newlist (cons last newlist)))) 743 (setq newlist (cons last newlist))))
628 (setq newlist (nreverse newlist)) 744 (setq newlist (nreverse newlist))
629 (if anynil 745 (if anynil
630 (cons nil 746 (cons nil
631 (concat (if use-list* "(desktop-list* " "(list ") 747 (concat (if use-list* "(desktop-list* " "(list ")
632 (mapconcat (lambda (el) 748 (mapconcat (lambda (el)
633 (if (eq (car el) 'must) 749 (if (eq (car el) 'must)
634 (concat "'" (cdr el)) 750 (concat "'" (cdr el))
635 (cdr el))) 751 (cdr el)))
636 newlist 752 newlist
637 " ") 753 " ")
638 ")")) 754 ")"))
639 (cons 'must 755 (cons 'must
640 (concat "(" (mapconcat 'cdr newlist " ") ")"))))) 756 (concat "(" (mapconcat 'cdr newlist " ") ")")))))
641 ((subrp value) 757 ((subrp value)
642 (cons nil (concat "(symbol-function '" 758 (cons nil (concat "(symbol-function '"
643 (substring (prin1-to-string value) 7 -1) 759 (substring (prin1-to-string value) 7 -1)
644 ")"))) 760 ")")))
645 ((markerp value) 761 ((markerp value)
646 (let ((pos (prin1-to-string (marker-position value))) 762 (let ((pos (prin1-to-string (marker-position value)))
647 (buf (prin1-to-string (buffer-name (marker-buffer value))))) 763 (buf (prin1-to-string (buffer-name (marker-buffer value)))))
648 (cons nil (concat "(let ((mk (make-marker)))" 764 (cons nil (concat "(let ((mk (make-marker)))"
649 " (add-hook 'desktop-delay-hook" 765 " (add-hook 'desktop-delay-hook"
650 " (list 'lambda '() (list 'set-marker mk " 766 " (list 'lambda '() (list 'set-marker mk "
651 pos " (get-buffer " buf ")))) mk)")))) 767 pos " (get-buffer " buf ")))) mk)"))))
652 (t ; save as text 768 (t ; save as text
653 (cons 'may "\"Unprintable entity\"")))) 769 (cons 'may "\"Unprintable entity\""))))
654 770
655;; ---------------------------------------------------------------------------- 771;; ----------------------------------------------------------------------------
656(defun desktop-value-to-string (value) 772(defun desktop-value-to-string (value)
@@ -676,17 +792,16 @@ which means to truncate VAR's value to at most MAX-SIZE elements
676 (if (consp varspec) 792 (if (consp varspec)
677 (setq var (car varspec) size (cdr varspec)) 793 (setq var (car varspec) size (cdr varspec))
678 (setq var varspec)) 794 (setq var varspec))
679 (if (boundp var) 795 (when (boundp var)
680 (progn 796 (when (and (integerp size)
681 (if (and (integerp size) 797 (> size 0)
682 (> size 0) 798 (listp (eval var)))
683 (listp (eval var))) 799 (desktop-truncate (eval var) size))
684 (desktop-truncate (eval var) size)) 800 (insert "(setq "
685 (insert "(setq " 801 (symbol-name var)
686 (symbol-name var) 802 " "
687 " " 803 (desktop-value-to-string (symbol-value var))
688 (desktop-value-to-string (symbol-value var)) 804 ")\n"))))
689 ")\n")))))
690 805
691;; ---------------------------------------------------------------------------- 806;; ----------------------------------------------------------------------------
692(defun desktop-save-buffer-p (filename bufname mode &rest dummy) 807(defun desktop-save-buffer-p (filename bufname mode &rest dummy)
@@ -722,92 +837,73 @@ DIRNAME must be the directory in which the desktop file will be saved."
722 ((eq desktop-file-name-format 'local) (file-relative-name filename dirname)) 837 ((eq desktop-file-name-format 'local) (file-relative-name filename dirname))
723 (t (expand-file-name filename)))) 838 (t (expand-file-name filename))))
724 839
840
725;; ---------------------------------------------------------------------------- 841;; ----------------------------------------------------------------------------
726;;;###autoload 842;;;###autoload
727(defun desktop-save (dirname) 843(defun desktop-save (dirname &optional release)
728 "Save the desktop in a desktop file. 844 "Save the desktop in a desktop file.
729Parameter DIRNAME specifies where to save the desktop file. 845Parameter DIRNAME specifies where to save the desktop file.
846Optional parameter RELEASE says whether we're done with this desktop.
730See also `desktop-base-file-name'." 847See also `desktop-base-file-name'."
731 (interactive "DDirectory to save desktop file in: ") 848 (interactive "DDirectory to save desktop file in: ")
732 (run-hooks 'desktop-save-hook) 849 (setq desktop-dirname (file-name-as-directory (expand-file-name dirname)))
733 (setq dirname (file-name-as-directory (expand-file-name dirname)))
734 (save-excursion 850 (save-excursion
735 (let ((filename (desktop-full-file-name dirname)) 851 (let ((eager desktop-restore-eager)
736 (info 852 (new-modtime (nth 5 (file-attributes (desktop-full-file-name)))))
737 (mapcar 853 (when
738 #'(lambda (b) 854 (or (not new-modtime) ; nothing to overwrite
739 (set-buffer b) 855 (equal desktop-file-modtime new-modtime)
740 (list 856 (yes-or-no-p (if desktop-file-modtime
741 (desktop-file-name (buffer-file-name) dirname) 857 (if (> (float-time new-modtime) (float-time desktop-file-modtime))
742 (buffer-name) 858 "Desktop file is more recent than the one loaded. Save anyway? "
743 major-mode 859 "Desktop file isn't the one loaded. Overwrite it? ")
744 ;; minor modes 860 "Current desktop was not loaded from a file. Overwrite this desktop file? "))
745 (let (ret) 861 (unless release (error "Desktop file conflict")))
746 (mapc 862
747 #'(lambda (minor-mode) 863 ;; If we're done with it, release the lock.
748 (and 864 ;; Otherwise, claim it if it's unclaimed or if we created it.
749 (boundp minor-mode) 865 (if release
750 (symbol-value minor-mode) 866 (desktop-release-lock)
751 (let* ((special (assq minor-mode desktop-minor-mode-table)) 867 (unless (and new-modtime (desktop-owner)) (desktop-claim-lock)))
752 (value (cond (special (cadr special)) 868
753 ((functionp minor-mode) minor-mode)))) 869 (with-temp-buffer
754 (when value (add-to-list 'ret value))))) 870 (insert
755 (mapcar #'car minor-mode-alist)) 871 ";; -*- mode: emacs-lisp; coding: emacs-mule; -*-\n"
756 ret) 872 desktop-header
757 (point) 873 ";; Created " (current-time-string) "\n"
758 (list (mark t) mark-active) 874 ";; Desktop file format version " desktop-file-version "\n"
759 buffer-read-only 875 ";; Emacs version " emacs-version "\n")
760 ;; Auxiliary information 876 (save-excursion (run-hooks 'desktop-save-hook))
761 (when (functionp desktop-save-buffer) 877 (goto-char (point-max))
762 (funcall desktop-save-buffer dirname)) 878 (insert "\n;; Global section:\n")
763 (let ((locals desktop-locals-to-save) 879 (mapc (function desktop-outvar) desktop-globals-to-save)
764 (loclist (buffer-local-variables)) 880 (when (memq 'kill-ring desktop-globals-to-save)
765 (ll)) 881 (insert
766 (while locals 882 "(setq kill-ring-yank-pointer (nthcdr "
767 (let ((here (assq (car locals) loclist))) 883 (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer)))
768 (if here 884 " kill-ring))\n"))
769 (setq ll (cons here ll)) 885
770 (when (member (car locals) loclist) 886 (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
771 (setq ll (cons (car locals) ll))))) 887 (dolist (l (mapcar 'desktop-buffer-info (buffer-list)))
772 (setq locals (cdr locals))) 888 (when (apply 'desktop-save-buffer-p l)
773 ll))) 889 (insert "("
774 (buffer-list))) 890 (if (or (not (integerp eager))
775 (eager desktop-restore-eager)) 891 (if (zerop eager)
776 (with-temp-buffer 892 nil
777 (insert 893 (setq eager (1- eager))))
778 ";; -*- mode: emacs-lisp; coding: utf-8-emacs; -*-\n" 894 "desktop-create-buffer"
779 desktop-header 895 "desktop-append-buffer-args")
780 ";; Created " (current-time-string) "\n" 896 " "
781 ";; Desktop file format version " desktop-file-version "\n" 897 desktop-file-version)
782 ";; Emacs version " emacs-version "\n\n" 898 (dolist (e l)
783 ";; Global section:\n") 899 (insert "\n " (desktop-value-to-string e)))
784 (dolist (varspec desktop-globals-to-save) 900 (insert ")\n\n")))
785 (desktop-outvar varspec)) 901
786 (if (memq 'kill-ring desktop-globals-to-save) 902 (setq default-directory dirname)
787 (insert 903 (let ((coding-system-for-write 'emacs-mule))
788 "(setq kill-ring-yank-pointer (nthcdr " 904 (write-region (point-min) (point-max) (desktop-full-file-name) nil 'nomessage))
789 (int-to-string (- (length kill-ring) (length kill-ring-yank-pointer))) 905 ;; We remember when it was modified (which is presumably just now).
790 " kill-ring))\n")) 906 (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name)))))))))
791
792 (insert "\n;; Buffer section -- buffers listed in same order as in buffer list:\n")
793 (dolist (l info)
794 (when (apply 'desktop-save-buffer-p l)
795 (insert "("
796 (if (or (not (integerp eager))
797 (unless (zerop eager)
798 (setq eager (1- eager))
799 t))
800 "desktop-create-buffer"
801 "desktop-append-buffer-args")
802 " "
803 desktop-file-version)
804 (dolist (e l)
805 (insert "\n " (desktop-value-to-string e)))
806 (insert ")\n\n")))
807 (setq default-directory dirname)
808 (let ((coding-system-for-write 'utf-8-emacs))
809 (write-region (point-min) (point-max) filename nil 'nomessage)))))
810 (setq desktop-dirname dirname))
811 907
812;; ---------------------------------------------------------------------------- 908;; ----------------------------------------------------------------------------
813;;;###autoload 909;;;###autoload
@@ -856,35 +952,56 @@ It returns t if a desktop file was loaded, nil otherwise."
856 ;; Default: Home directory. 952 ;; Default: Home directory.
857 "~")))) 953 "~"))))
858 (if (file-exists-p (desktop-full-file-name)) 954 (if (file-exists-p (desktop-full-file-name))
859 ;; Desktop file found, process it. 955 ;; Desktop file found, but is it already in use?
860 (let ((desktop-first-buffer nil) 956 (let ((desktop-first-buffer nil)
861 (desktop-buffer-ok-count 0) 957 (desktop-buffer-ok-count 0)
862 (desktop-buffer-fail-count 0) 958 (desktop-buffer-fail-count 0)
863 ;; Avoid desktop saving during evaluation of desktop buffer. 959 (owner (desktop-owner))
864 (desktop-save nil)) 960 ;; Avoid desktop saving during evaluation of desktop buffer.
865 (desktop-lazy-abort) 961 (desktop-save nil))
866 ;; Evaluate desktop buffer. 962 (if (and owner
867 (load (desktop-full-file-name) t t t) 963 (memq desktop-load-locked-desktop '(nil ask))
868 ;; `desktop-create-buffer' puts buffers at end of the buffer list. 964 (or (null desktop-load-locked-desktop)
869 ;; We want buffers existing prior to evaluating the desktop (and not reused) 965 (not (y-or-n-p (format "Warning: desktop file appears to be in use by PID %s.\n\
870 ;; to be placed at the end of the buffer list, so we move them here. 966Using it may cause conflicts. Use it anyway? " owner)))))
871 (mapc 'bury-buffer 967 (progn
872 (nreverse (cdr (memq desktop-first-buffer (nreverse (buffer-list)))))) 968 (setq desktop-dirname nil)
873 (switch-to-buffer (car (buffer-list))) 969 (let ((default-directory desktop-dirname))
874 (run-hooks 'desktop-delay-hook) 970 (run-hooks 'desktop-not-loaded-hook))
875 (setq desktop-delay-hook nil) 971 (message "Desktop file in use; not loaded."))
876 (run-hooks 'desktop-after-read-hook) 972 (desktop-lazy-abort)
877 (message "Desktop: %d buffer%s restored%s%s." 973 ;; Evaluate desktop buffer and remember when it was modified.
878 desktop-buffer-ok-count 974 (load (desktop-full-file-name) t t t)
879 (if (= 1 desktop-buffer-ok-count) "" "s") 975 (setq desktop-file-modtime (nth 5 (file-attributes (desktop-full-file-name))))
880 (if (< 0 desktop-buffer-fail-count) 976 ;; If it wasn't already, mark it as in-use, to bother other
881 (format ", %d failed to restore" desktop-buffer-fail-count) 977 ;; desktop instances.
882 "") 978 (unless owner
883 (if desktop-buffer-args-list 979 (condition-case nil
884 (format ", %d to restore lazily" 980 (desktop-claim-lock)
885 (length desktop-buffer-args-list)) 981 (file-error (message "Couldn't record use of desktop file")
886 "")) 982 (sit-for 1))))
887 t) 983
984 ;; `desktop-create-buffer' puts buffers at end of the buffer list.
985 ;; We want buffers existing prior to evaluating the desktop (and
986 ;; not reused) to be placed at the end of the buffer list, so we
987 ;; move them here.
988 (mapc 'bury-buffer
989 (nreverse (cdr (memq desktop-first-buffer (nreverse (buffer-list))))))
990 (switch-to-buffer (car (buffer-list)))
991 (run-hooks 'desktop-delay-hook)
992 (setq desktop-delay-hook nil)
993 (run-hooks 'desktop-after-read-hook)
994 (message "Desktop: %d buffer%s restored%s%s."
995 desktop-buffer-ok-count
996 (if (= 1 desktop-buffer-ok-count) "" "s")
997 (if (< 0 desktop-buffer-fail-count)
998 (format ", %d failed to restore" desktop-buffer-fail-count)
999 "")
1000 (if desktop-buffer-args-list
1001 (format ", %d to restore lazily"
1002 (length desktop-buffer-args-list))
1003 ""))
1004 t))
888 ;; No desktop file found. 1005 ;; No desktop file found.
889 (desktop-clear) 1006 (desktop-clear)
890 (let ((default-directory desktop-dirname)) 1007 (let ((default-directory desktop-dirname))
@@ -946,28 +1063,28 @@ directory DIRNAME."
946 desktop-buffer-name 1063 desktop-buffer-name
947 desktop-buffer-misc) 1064 desktop-buffer-misc)
948 "Restore a file buffer." 1065 "Restore a file buffer."
949 (if desktop-buffer-file-name 1066 (when desktop-buffer-file-name
950 (if (or (file-exists-p desktop-buffer-file-name) 1067 (if (or (file-exists-p desktop-buffer-file-name)
951 (let ((msg (format "Desktop: File \"%s\" no longer exists." 1068 (let ((msg (format "Desktop: File \"%s\" no longer exists."
952 desktop-buffer-file-name))) 1069 desktop-buffer-file-name)))
953 (if desktop-missing-file-warning 1070 (if desktop-missing-file-warning
954 (y-or-n-p (concat msg " Re-create buffer? ")) 1071 (y-or-n-p (concat msg " Re-create buffer? "))
955 (message "%s" msg) 1072 (message "%s" msg)
956 nil))) 1073 nil)))
957 (let* ((auto-insert nil) ; Disable auto insertion 1074 (let* ((auto-insert nil) ; Disable auto insertion
958 (coding-system-for-read 1075 (coding-system-for-read
959 (or coding-system-for-read 1076 (or coding-system-for-read
960 (cdr (assq 'buffer-file-coding-system 1077 (cdr (assq 'buffer-file-coding-system
961 desktop-buffer-locals)))) 1078 desktop-buffer-locals))))
962 (buf (find-file-noselect desktop-buffer-file-name))) 1079 (buf (find-file-noselect desktop-buffer-file-name)))
963 (condition-case nil 1080 (condition-case nil
964 (switch-to-buffer buf) 1081 (switch-to-buffer buf)
965 (error (pop-to-buffer buf))) 1082 (error (pop-to-buffer buf)))
966 (and (not (eq major-mode desktop-buffer-major-mode)) 1083 (and (not (eq major-mode desktop-buffer-major-mode))
967 (functionp desktop-buffer-major-mode) 1084 (functionp desktop-buffer-major-mode)
968 (funcall desktop-buffer-major-mode)) 1085 (funcall desktop-buffer-major-mode))
969 buf) 1086 buf)
970 nil))) 1087 nil)))
971 1088
972(defun desktop-load-file (function) 1089(defun desktop-load-file (function)
973 "Load the file where auto loaded FUNCTION is defined." 1090 "Load the file where auto loaded FUNCTION is defined."
@@ -1062,19 +1179,19 @@ directory DIRNAME."
1062 (error (message "%s" (error-message-string err)) 1)))) 1179 (error (message "%s" (error-message-string err)) 1))))
1063 (when desktop-buffer-mark 1180 (when desktop-buffer-mark
1064 (if (consp desktop-buffer-mark) 1181 (if (consp desktop-buffer-mark)
1065 (progn 1182 (progn
1066 (set-mark (car desktop-buffer-mark)) 1183 (set-mark (car desktop-buffer-mark))
1067 (setq mark-active (car (cdr desktop-buffer-mark)))) 1184 (setq mark-active (car (cdr desktop-buffer-mark))))
1068 (set-mark desktop-buffer-mark))) 1185 (set-mark desktop-buffer-mark)))
1069 ;; Never override file system if the file really is read-only marked. 1186 ;; Never override file system if the file really is read-only marked.
1070 (if desktop-buffer-read-only (setq buffer-read-only desktop-buffer-read-only)) 1187 (when desktop-buffer-read-only (setq buffer-read-only desktop-buffer-read-only))
1071 (while desktop-buffer-locals 1188 (while desktop-buffer-locals
1072 (let ((this (car desktop-buffer-locals))) 1189 (let ((this (car desktop-buffer-locals)))
1073 (if (consp this) 1190 (if (consp this)
1074 ;; an entry of this form `(symbol . value)' 1191 ;; an entry of this form `(symbol . value)'
1075 (progn 1192 (progn
1076 (make-local-variable (car this)) 1193 (make-local-variable (car this))
1077 (set (car this) (cdr this))) 1194 (set (car this) (cdr this)))
1078 ;; an entry of the form `symbol' 1195 ;; an entry of the form `symbol'
1079 (make-local-variable this) 1196 (make-local-variable this)
1080 (makunbound this))) 1197 (makunbound this)))
diff --git a/lisp/diff-mode.el b/lisp/diff-mode.el
index 87fade841ca..973e387f230 100644
--- a/lisp/diff-mode.el
+++ b/lisp/diff-mode.el
@@ -338,7 +338,7 @@ when editing big diffs)."
338 ("^--- .+ ----$" . diff-hunk-header-face) ;context 338 ("^--- .+ ----$" . diff-hunk-header-face) ;context
339 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal 339 ("^[0-9,]+[acd][0-9,]+$" . diff-hunk-header-face) ;normal
340 ("^---$" . diff-hunk-header-face) ;normal 340 ("^---$" . diff-hunk-header-face) ;normal
341 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\(\\S-+\\)\\(.*[^*-]\\)?\n" 341 ("^\\(---\\|\\+\\+\\+\\|\\*\\*\\*\\) \\([^ \t]+\\)\\(.*[^*-]\\)?\n"
342 (0 diff-header-face) (2 diff-file-header-face prepend)) 342 (0 diff-header-face) (2 diff-file-header-face prepend))
343 ("^\\([-<]\\)\\(.*\n\\)" 343 ("^\\([-<]\\)\\(.*\n\\)"
344 (1 diff-indicator-removed-face) (2 diff-removed-face)) 344 (1 diff-indicator-removed-face) (2 diff-removed-face))
diff --git a/lisp/ediff-init.el b/lisp/ediff-init.el
index d37096f9e89..8d05f2def09 100644
--- a/lisp/ediff-init.el
+++ b/lisp/ediff-init.el
@@ -102,7 +102,7 @@ that Ediff doesn't know about.")
102 (boundp 'ediff-use-toolbar-p) 102 (boundp 'ediff-use-toolbar-p)
103 ediff-use-toolbar-p)) ;Does the user want it ? 103 ediff-use-toolbar-p)) ;Does the user want it ?
104 104
105;; Defines SYMBOL as an advertised local variable. 105;; Defines VAR as an advertised local variable.
106;; Performs a defvar, then executes `make-variable-buffer-local' on 106;; Performs a defvar, then executes `make-variable-buffer-local' on
107;; the variable. Also sets the `permanent-local' property, 107;; the variable. Also sets the `permanent-local' property,
108;; so that `kill-all-local-variables' (called by major-mode setting 108;; so that `kill-all-local-variables' (called by major-mode setting
@@ -110,6 +110,7 @@ that Ediff doesn't know about.")
110;; 110;;
111;; Plagiarised from `emerge-defvar-local' for XEmacs. 111;; Plagiarised from `emerge-defvar-local' for XEmacs.
112(defmacro ediff-defvar-local (var value doc) 112(defmacro ediff-defvar-local (var value doc)
113 "Defines VAR as a local variable."
113 (declare (indent defun)) 114 (declare (indent defun))
114 `(progn 115 `(progn
115 (defvar ,var ,value ,doc) 116 (defvar ,var ,value ,doc)
@@ -259,6 +260,7 @@ It needs to be killed when we quit the session.")
259;; Doesn't save the point and mark. 260;; Doesn't save the point and mark.
260;; This is `with-current-buffer' with the added test for live buffers." 261;; This is `with-current-buffer' with the added test for live buffers."
261(defmacro ediff-with-current-buffer (buffer &rest body) 262(defmacro ediff-with-current-buffer (buffer &rest body)
263 "Evaluates BODY in BUFFER."
262 (declare (indent 1) (debug (form body))) 264 (declare (indent 1) (debug (form body)))
263 `(if (ediff-buffer-live-p ,buffer) 265 `(if (ediff-buffer-live-p ,buffer)
264 (save-current-buffer 266 (save-current-buffer
diff --git a/lisp/ediff-mult.el b/lisp/ediff-mult.el
index 8fdd319746c..12dca168412 100644
--- a/lisp/ediff-mult.el
+++ b/lisp/ediff-mult.el
@@ -129,9 +129,15 @@
129;; the registry buffer 129;; the registry buffer
130(defvar ediff-registry-buffer nil) 130(defvar ediff-registry-buffer nil)
131 131
132(defconst ediff-meta-buffer-message "This is an Ediff Session Group Panel: %s 132(defconst ediff-meta-buffer-brief-message "Ediff Session Group Panel: %s
133 133
134Useful commands: 134 Type ? to show useful commands in this buffer
135
136")
137
138(defconst ediff-meta-buffer-verbose-message "Ediff Session Group Panel: %s
139
140Useful commands (type ? to hide them and free up screen):
135 button2, v, or RET over session record: start that Ediff session 141 button2, v, or RET over session record: start that Ediff session
136 M:\tin sessions invoked from here, brings back this group panel 142 M:\tin sessions invoked from here, brings back this group panel
137 R:\tdisplay the registry of active Ediff sessions 143 R:\tdisplay the registry of active Ediff sessions
@@ -360,10 +366,24 @@ buffers."
360 (if (stringp (ediff-get-session-objC-name session-info)) 366 (if (stringp (ediff-get-session-objC-name session-info))
361 (file-directory-p (ediff-get-session-objC-name session-info)) t))) 367 (file-directory-p (ediff-get-session-objC-name session-info)) t)))
362 368
369
370(ediff-defvar-local ediff-verbose-help-enabled nil
371 "If t, display redundant help in ediff-directories and other meta buffers.
372Toggled by ediff-toggle-verbose-help-meta-buffer" )
373
374;; Toggle verbose help in meta-buffers
375;; TODO: Someone who understands all this can make it better.
376(defun ediff-toggle-verbose-help-meta-buffer ()
377 "Toggle showing tediously verbose help in meta buffers."
378 (interactive)
379 (setq ediff-verbose-help-enabled (not ediff-verbose-help-enabled))
380 (ediff-update-meta-buffer (current-buffer) 'must-redraw))
381
363;; set up the keymap in the meta buffer 382;; set up the keymap in the meta buffer
364(defun ediff-setup-meta-map () 383(defun ediff-setup-meta-map ()
365 (setq ediff-meta-buffer-map (make-sparse-keymap)) 384 (setq ediff-meta-buffer-map (make-sparse-keymap))
366 (suppress-keymap ediff-meta-buffer-map) 385 (suppress-keymap ediff-meta-buffer-map)
386 (define-key ediff-meta-buffer-map "?" 'ediff-toggle-verbose-help-meta-buffer)
367 (define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer) 387 (define-key ediff-meta-buffer-map "q" 'ediff-quit-meta-buffer)
368 (define-key ediff-meta-buffer-map "T" 'ediff-toggle-filename-truncation) 388 (define-key ediff-meta-buffer-map "T" 'ediff-toggle-filename-truncation)
369 (define-key ediff-meta-buffer-map "R" 'ediff-show-registry) 389 (define-key ediff-meta-buffer-map "R" 'ediff-show-registry)
@@ -924,27 +944,31 @@ behavior."
924 (mapcar 'delete-overlay (overlays-in 1 1)) ; emacs 944 (mapcar 'delete-overlay (overlays-in 1 1)) ; emacs
925 ) 945 )
926 946
927 (insert (format ediff-meta-buffer-message
928 (ediff-abbrev-jobname ediff-metajob-name)))
929
930 (setq regexp (ediff-get-group-regexp meta-list) 947 (setq regexp (ediff-get-group-regexp meta-list)
931 merge-autostore-dir 948 merge-autostore-dir
932 (ediff-get-group-merge-autostore-dir meta-list)) 949 (ediff-get-group-merge-autostore-dir meta-list))
933 950
934 (cond ((ediff-collect-diffs-metajob) 951 (if ediff-verbose-help-enabled
935 (insert 952 (progn
936 " P:\tcollect custom diffs of all marked sessions\n")) 953 (insert (format ediff-meta-buffer-verbose-message
937 ((ediff-patch-metajob) 954 (ediff-abbrev-jobname ediff-metajob-name)))
938 (insert 955
939 " P:\tshow patch appropriately for the context (session or group)\n"))) 956 (cond ((ediff-collect-diffs-metajob)
940 (insert 957 (insert
941 " ^:\tshow parent session group\n") 958 " P:\tcollect custom diffs of all marked sessions\n"))
942 (or (ediff-one-filegroup-metajob) 959 ((ediff-patch-metajob)
943 (insert 960 (insert
944 " D:\tshow differences among directories\n" 961 " P:\tshow patch appropriately for the context (session or group)\n")))
945 " ==:\tfor each session, show which files are identical\n" 962 (insert
946 " =h:\tlike ==, but also marks those sessions for hiding\n" 963 " ^:\tshow parent session group\n")
947 " =m:\tlike ==, but also marks those sessions for operation\n\n")) 964 (or (ediff-one-filegroup-metajob)
965 (insert
966 " D:\tshow differences among directories\n"
967 " ==:\tfor each session, show which files are identical\n"
968 " =h:\tlike ==, but also marks sessions for hiding\n"
969 " =m:\tlike ==, but also marks sessions for operation\n\n")))
970 (insert (format ediff-meta-buffer-brief-message
971 (ediff-abbrev-jobname ediff-metajob-name))))
948 972
949 (insert "\n") 973 (insert "\n")
950 (if (and (stringp regexp) (> (length regexp) 0)) 974 (if (and (stringp regexp) (> (length regexp) 0))
diff --git a/lisp/ediff-ptch.el b/lisp/ediff-ptch.el
index c8a8b70f162..8c0be8b1c8d 100644
--- a/lisp/ediff-ptch.el
+++ b/lisp/ediff-ptch.el
@@ -134,11 +134,13 @@ patch. So, don't change these variables, unless the default doesn't work."
134 :type '(choice (const nil) string) 134 :type '(choice (const nil) string)
135 :group 'ediff-ptch) 135 :group 'ediff-ptch)
136 136
137;; This context diff does not recognize spaces inside files, but removing ' '
138;; from [^ \t] breaks normal patches for some reason
137(defcustom ediff-context-diff-label-regexp 139(defcustom ediff-context-diff-label-regexp
138 (concat "\\(" ; context diff 2-liner 140 (concat "\\(" ; context diff 2-liner
139 "^\\*\\*\\* \\([^ \t]+\\)[^*]+[\t ]*\n--- \\([^ \t]+\\)" 141 "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)"
140 "\\|" ; GNU unified format diff 2-liner 142 "\\|" ; GNU unified format diff 2-liner
141 "^--- \\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ \\([^ \t]+\\)" 143 "^--- +\\([^ \t]+\\)[\t ]+.*\n\\+\\+\\+ +\\([^ \t]+\\)"
142 "\\)") 144 "\\)")
143 "*Regexp matching filename 2-liners at the start of each context diff. 145 "*Regexp matching filename 2-liners at the start of each context diff.
144You probably don't want to change that, unless you are using an obscure patch 146You probably don't want to change that, unless you are using an obscure patch
@@ -231,7 +233,7 @@ program."
231 ;; possible-file-names is holding the new file names until we 233 ;; possible-file-names is holding the new file names until we
232 ;; insert the old file name in the patch map 234 ;; insert the old file name in the patch map
233 ;; It is a pair 235 ;; It is a pair
234 ;; (filename-from-1st-header-line . fn from 2nd line) 236 ;; (filename-from-1st-header-line . filename-from-2nd-line)
235 (setq possible-file-names 237 (setq possible-file-names
236 (cons (if (and beg1 end1) 238 (cons (if (and beg1 end1)
237 (buffer-substring beg1 end1) 239 (buffer-substring beg1 end1)
@@ -309,12 +311,13 @@ program."
309 ;; these dirs lead to the actual files starting at the present 311 ;; these dirs lead to the actual files starting at the present
310 ;; directory. So, we don't strip these relative dirs from the 312 ;; directory. So, we don't strip these relative dirs from the
311 ;; file names. This is a heuristic intended to improve guessing 313 ;; file names. This is a heuristic intended to improve guessing
312 (unless (or (file-name-absolute-p base-dir1) 314 (let ((default-directory (file-name-directory filename)))
313 (file-name-absolute-p base-dir2) 315 (unless (or (file-name-absolute-p base-dir1)
314 (not (file-exists-p base-dir1)) 316 (file-name-absolute-p base-dir2)
315 (not (file-exists-p base-dir2))) 317 (not (file-exists-p base-dir1))
316 (setq base-dir1 "" 318 (not (file-exists-p base-dir2)))
317 base-dir2 "")) 319 (setq base-dir1 ""
320 base-dir2 "")))
318 (or (string= (car proposed-file-names) "/dev/null") 321 (or (string= (car proposed-file-names) "/dev/null")
319 (setcar proposed-file-names 322 (setcar proposed-file-names
320 (ediff-file-name-sans-prefix 323 (ediff-file-name-sans-prefix
diff --git a/lisp/ediff.el b/lisp/ediff.el
index c5f5c48f8da..69717ca13ad 100644
--- a/lisp/ediff.el
+++ b/lisp/ediff.el
@@ -7,8 +7,8 @@
7;; Created: February 2, 1994 7;; Created: February 2, 1994
8;; Keywords: comparing, merging, patching, tools, unix 8;; Keywords: comparing, merging, patching, tools, unix
9 9
10(defconst ediff-version "2.81.1" "The current version of Ediff") 10(defconst ediff-version "2.81.2" "The current version of Ediff")
11(defconst ediff-date "October 23, 2006" "Date of last update") 11(defconst ediff-date "June 13, 2007" "Date of last update")
12 12
13 13
14;; This file is part of GNU Emacs. 14;; This file is part of GNU Emacs.
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el
index c791026a95b..9775bb58707 100644
--- a/lisp/emacs-lisp/bytecomp.el
+++ b/lisp/emacs-lisp/bytecomp.el
@@ -853,13 +853,11 @@ Each function's symbol gets added to `byte-compile-noruntime-functions'."
853 (when (and (consp s) (eq t (car s))) 853 (when (and (consp s) (eq t (car s)))
854 (push (cdr s) old-autoloads))))))) 854 (push (cdr s) old-autoloads)))))))
855 (when (memq 'cl-functions byte-compile-warnings) 855 (when (memq 'cl-functions byte-compile-warnings)
856 (let ((hist-new load-history) 856 (let ((hist-new load-history))
857 (hist-nil-new current-load-list))
858 ;; Go through load-history, look for newly loaded files 857 ;; Go through load-history, look for newly loaded files
859 ;; and mark all the functions defined therein. 858 ;; and mark all the functions defined therein.
860 (while (and hist-new (not (eq hist-new hist-orig))) 859 (while (and hist-new (not (eq hist-new hist-orig)))
861 (let ((xs (pop hist-new)) 860 (let ((xs (pop hist-new)))
862 old-autoloads)
863 ;; Make sure the file was not already loaded before. 861 ;; Make sure the file was not already loaded before.
864 (when (and (equal (car xs) "cl") (not (assoc (car xs) hist-orig))) 862 (when (and (equal (car xs) "cl") (not (assoc (car xs) hist-orig)))
865 (byte-compile-find-cl-functions))))))))) 863 (byte-compile-find-cl-functions)))))))))
@@ -1265,7 +1263,7 @@ extra args."
1265 (get (car form) 'byte-compile-format-like)) 1263 (get (car form) 'byte-compile-format-like))
1266 (let ((nfields (with-temp-buffer 1264 (let ((nfields (with-temp-buffer
1267 (insert (nth 1 form)) 1265 (insert (nth 1 form))
1268 (goto-char 1) 1266 (goto-char (point-min))
1269 (let ((n 0)) 1267 (let ((n 0))
1270 (while (re-search-forward "%." nil t) 1268 (while (re-search-forward "%." nil t)
1271 (unless (eq ?% (char-after (1+ (match-beginning 0)))) 1269 (unless (eq ?% (char-after (1+ (match-beginning 0))))
@@ -1283,19 +1281,19 @@ extra args."
1283;; Warn if a custom definition fails to specify :group. 1281;; Warn if a custom definition fails to specify :group.
1284(defun byte-compile-nogroup-warn (form) 1282(defun byte-compile-nogroup-warn (form)
1285 (let ((keyword-args (cdr (cdr (cdr (cdr form))))) 1283 (let ((keyword-args (cdr (cdr (cdr (cdr form)))))
1286 (name (cadr form))) 1284 (name (cadr form)))
1287 (or (not (eq (car-safe name) 'quote)) 1285 (or (not (eq (car-safe name) 'quote))
1288 (and (eq (car form) 'custom-declare-group) 1286 (and (eq (car form) 'custom-declare-group)
1289 (equal name ''emacs)) 1287 (equal name ''emacs))
1290 (plist-get keyword-args :group) 1288 (plist-get keyword-args :group)
1291 (not (and (consp name) (eq (car name) 'quote))) 1289 (not (and (consp name) (eq (car name) 'quote)))
1292 (byte-compile-warn 1290 (byte-compile-warn
1293 "%s for `%s' fails to specify containing group" 1291 "%s for `%s' fails to specify containing group"
1294 (cdr (assq (car form) 1292 (cdr (assq (car form)
1295 '((custom-declare-group . defgroup) 1293 '((custom-declare-group . defgroup)
1296 (custom-declare-face . defface) 1294 (custom-declare-face . defface)
1297 (custom-declare-variable . defcustom)))) 1295 (custom-declare-variable . defcustom))))
1298 (cadr name))))) 1296 (cadr name)))))
1299 1297
1300;; Warn if the function or macro is being redefined with a different 1298;; Warn if the function or macro is being redefined with a different
1301;; number of arguments. 1299;; number of arguments.
@@ -1834,9 +1832,8 @@ With argument, insert value in current buffer after the form."
1834 ;; byte-compile-warnings)) 1832 ;; byte-compile-warnings))
1835 ) 1833 )
1836 (byte-compile-close-variables 1834 (byte-compile-close-variables
1837 (save-excursion 1835 (with-current-buffer
1838 (setq outbuffer 1836 (setq outbuffer (get-buffer-create " *Compiler Output*"))
1839 (set-buffer (get-buffer-create " *Compiler Output*")))
1840 (set-buffer-multibyte t) 1837 (set-buffer-multibyte t)
1841 (erase-buffer) 1838 (erase-buffer)
1842 ;; (emacs-lisp-mode) 1839 ;; (emacs-lisp-mode)
@@ -1850,9 +1847,8 @@ With argument, insert value in current buffer after the form."
1850 (setq overwrite-mode 'overwrite-mode-binary)) 1847 (setq overwrite-mode 'overwrite-mode-binary))
1851 (displaying-byte-compile-warnings 1848 (displaying-byte-compile-warnings
1852 (and filename (byte-compile-insert-header filename inbuffer outbuffer)) 1849 (and filename (byte-compile-insert-header filename inbuffer outbuffer))
1853 (save-excursion 1850 (with-current-buffer inbuffer
1854 (set-buffer inbuffer) 1851 (goto-char (point-min))
1855 (goto-char 1)
1856 1852
1857 ;; Compile the forms from the input buffer. 1853 ;; Compile the forms from the input buffer.
1858 (while (progn 1854 (while (progn
@@ -1920,7 +1916,7 @@ With argument, insert value in current buffer after the form."
1920 (let ((dynamic-docstrings byte-compile-dynamic-docstrings) 1916 (let ((dynamic-docstrings byte-compile-dynamic-docstrings)
1921 (dynamic byte-compile-dynamic)) 1917 (dynamic byte-compile-dynamic))
1922 (set-buffer outbuffer) 1918 (set-buffer outbuffer)
1923 (goto-char 1) 1919 (goto-char (point-min))
1924 ;; The magic number of .elc files is ";ELC", or 0x3B454C43. After 1920 ;; The magic number of .elc files is ";ELC", or 0x3B454C43. After
1925 ;; that is the file-format version number (18, 19, 20, or 23) as a 1921 ;; that is the file-format version number (18, 19, 20, or 23) as a
1926 ;; byte, followed by some nulls. The primary motivation for doing 1922 ;; byte, followed by some nulls. The primary motivation for doing
@@ -2241,8 +2237,7 @@ list that represents a doc string reference.
2241 2237
2242(put 'require 'byte-hunk-handler 'byte-compile-file-form-require) 2238(put 'require 'byte-hunk-handler 'byte-compile-file-form-require)
2243(defun byte-compile-file-form-require (form) 2239(defun byte-compile-file-form-require (form)
2244 (let ((old-load-list current-load-list) 2240 (let ((args (mapcar 'eval (cdr form))))
2245 (args (mapcar 'eval (cdr form))))
2246 (apply 'require args) 2241 (apply 'require args)
2247 ;; Detect (require 'cl) in a way that works even if cl is already loaded. 2242 ;; Detect (require 'cl) in a way that works even if cl is already loaded.
2248 (if (member (car args) '("cl" cl)) 2243 (if (member (car args) '("cl" cl))
diff --git a/lisp/emacs-lisp/edebug.el b/lisp/emacs-lisp/edebug.el
index 9ae33599f09..3d9e63bc802 100644
--- a/lisp/emacs-lisp/edebug.el
+++ b/lisp/emacs-lisp/edebug.el
@@ -369,7 +369,7 @@ Return the result of the last expression in BODY."
369 ;; Otherwise, find a new window, possibly splitting one. 369 ;; Otherwise, find a new window, possibly splitting one.
370 (setq window 370 (setq window
371 (cond 371 (cond
372 ((and (windowp window) (edebug-window-live-p window) 372 ((and (edebug-window-live-p window)
373 (eq (window-buffer window) buffer)) 373 (eq (window-buffer window) buffer))
374 window) 374 window)
375 ((eq (window-buffer (selected-window)) buffer) 375 ((eq (window-buffer (selected-window)) buffer)
@@ -2739,7 +2739,7 @@ MSG is printed after `::::} '."
2739 2739
2740 ;; Unrestore edebug-buffer's window-start, if displayed. 2740 ;; Unrestore edebug-buffer's window-start, if displayed.
2741 (let ((window (car edebug-window-data))) 2741 (let ((window (car edebug-window-data)))
2742 (if (and window (edebug-window-live-p window) 2742 (if (and (edebug-window-live-p window)
2743 (eq (window-buffer) edebug-buffer)) 2743 (eq (window-buffer) edebug-buffer))
2744 (progn 2744 (progn
2745 (set-window-start window (cdr edebug-window-data) 2745 (set-window-start window (cdr edebug-window-data)
diff --git a/lisp/emulation/tpu-edt.el b/lisp/emulation/tpu-edt.el
index 8d65a267c4e..68e1561ae4d 100644
--- a/lisp/emulation/tpu-edt.el
+++ b/lisp/emulation/tpu-edt.el
@@ -207,16 +207,16 @@
207 207
208;; ; The emacs universal-argument function is very useful. 208;; ; The emacs universal-argument function is very useful.
209;; ; This line maps universal-argument to Gold-PF1. 209;; ; This line maps universal-argument to Gold-PF1.
210;; (define-key GOLD-SS3-map "P" 'universal-argument) ; Gold-PF1 210;; (define-key tpu-gold-map [kp_f1] 'universal-argument) ; Gold-PF1
211 211
212;; ; Make KP7 move by paragraphs, instead of pages. 212;; ; Make KP7 move by paragraphs, instead of pages.
213;; (define-key SS3-map "w" 'tpu-paragraph) ; KP7 213;; (define-key tpu-global-map [kf_7] 'tpu-paragraph) ; KP7
214 214
215;; ; Repeat the preceding mappings for X-windows. 215;; ; Repeat the preceding mappings for X-windows.
216;; (cond 216;; (cond
217;; (window-system 217;; (window-system
218;; (global-set-key [kp_7] 'tpu-paragraph) ; KP7 218;; (define-key tpu-global-map [kp_7] 'tpu-paragraph) ; KP7
219;; (define-key GOLD-map [kp_f1] 'universal-argument))) ; GOLD-PF1 219;; (define-key tpu-gold-map [kp_f1] 'universal-argument))) ; GOLD-PF1
220 220
221;; ; Display the TPU-edt version. 221;; ; Display the TPU-edt version.
222;; (tpu-version) 222;; (tpu-version)
@@ -292,146 +292,88 @@
292;;; User Configurable Variables 292;;; User Configurable Variables
293;;; 293;;;
294(defcustom tpu-have-ispell t 294(defcustom tpu-have-ispell t
295 "*If non-nil (default), TPU-edt uses ispell for spell checking." 295 "If non-nil (default), TPU-edt uses ispell for spell checking."
296 :type 'boolean 296 :type 'boolean
297 :group 'tpu) 297 :group 'tpu)
298 298
299(defcustom tpu-kill-buffers-silently nil 299(defcustom tpu-kill-buffers-silently nil
300 "*If non-nil, TPU-edt kills modified buffers without asking." 300 "If non-nil, TPU-edt kills modified buffers without asking."
301 :type 'boolean 301 :type 'boolean
302 :group 'tpu) 302 :group 'tpu)
303 303
304(defcustom tpu-percent-scroll 75 304(defcustom tpu-percent-scroll 75
305 "*Percentage of the screen to scroll for next/previous screen commands." 305 "Percentage of the screen to scroll for next/previous screen commands."
306 :type 'integer 306 :type 'integer
307 :group 'tpu) 307 :group 'tpu)
308 308
309(defcustom tpu-pan-columns 16 309(defcustom tpu-pan-columns 16
310 "*Number of columns the tpu-pan functions scroll left or right." 310 "Number of columns the tpu-pan functions scroll left or right."
311 :type 'integer 311 :type 'integer
312 :group 'tpu) 312 :group 'tpu)
313 313
314 314
315;;; 315;;;
316;;; Emacs version identifiers - currently referenced by
317;;;
318;;; o tpu-mark o tpu-set-mark
319;;; o mode line section o tpu-load-xkeys
320;;;
321(defconst tpu-lucid-emacs-p
322 (string-match "Lucid" emacs-version)
323 "Non-nil if we are running Lucid Emacs.")
324
325;;;
326;;; Global Keymaps 316;;; Global Keymaps
327;;; 317;;;
328(defvar CSI-map
329 (let ((map (make-sparse-keymap)))
330 (define-key map "A" 'tpu-previous-line) ; up
331 (define-key map "B" 'tpu-next-line) ; down
332 (define-key map "D" 'tpu-backward-char) ; left
333 (define-key map "C" 'tpu-forward-char) ; right
334
335 (define-key map "1~" 'tpu-search) ; Find
336 (define-key map "2~" 'tpu-paste) ; Insert Here
337 (define-key map "3~" 'tpu-cut) ; Remove
338 (define-key map "4~" 'tpu-select) ; Select
339 (define-key map "5~" 'tpu-scroll-window-down) ; Prev Screen
340 (define-key map "6~" 'tpu-scroll-window-up) ; Next Screen
341
342 (define-key map "11~" 'nil) ; F1
343 (define-key map "12~" 'nil) ; F2
344 (define-key map "13~" 'nil) ; F3
345 (define-key map "14~" 'nil) ; F4
346 (define-key map "15~" 'nil) ; F5
347 (define-key map "17~" 'nil) ; F6
348 (define-key map "18~" 'nil) ; F7
349 (define-key map "19~" 'nil) ; F8
350 (define-key map "20~" 'nil) ; F9
351 (define-key map "21~" 'tpu-exit) ; F10
352 (define-key map "23~" 'tpu-insert-escape) ; F11 (ESC)
353 (define-key map "24~" 'tpu-next-beginning-of-line) ; F12 (BS)
354 (define-key map "25~" 'tpu-delete-previous-word) ; F13 (LF)
355 (define-key map "26~" 'tpu-toggle-overwrite-mode) ; F14
356 (define-key map "28~" 'tpu-help) ; HELP
357 (define-key map "29~" 'execute-extended-command) ; DO
358 (define-key map "31~" 'tpu-goto-breadcrumb) ; F17
359 (define-key map "32~" 'nil) ; F18
360 (define-key map "33~" 'nil) ; F19
361 (define-key map "34~" 'nil) ; F20
362 map)
363 "Maps the CSI function keys on the VT100 keyboard.
364CSI is DEC's name for the sequence <ESC>[.")
365 318
366(defvar GOLD-CSI-map 319(defvar tpu-gold-map
367 (let ((map (make-sparse-keymap)))
368 (define-key map "A" 'tpu-move-to-beginning) ; up-arrow
369 (define-key map "B" 'tpu-move-to-end) ; down-arrow
370 (define-key map "C" 'end-of-line) ; right-arrow
371 (define-key map "D" 'beginning-of-line) ; left-arrow
372
373 (define-key map "1~" 'nil) ; Find
374 (define-key map "2~" 'nil) ; Insert Here
375 (define-key map "3~" 'tpu-store-text) ; Remove
376 (define-key map "4~" 'tpu-unselect) ; Select
377 (define-key map "5~" 'tpu-previous-window) ; Prev Screen
378 (define-key map "6~" 'tpu-next-window) ; Next Screen
379
380 (define-key map "11~" 'nil) ; F1
381 (define-key map "12~" 'nil) ; F2
382 (define-key map "13~" 'nil) ; F3
383 (define-key map "14~" 'nil) ; F4
384 (define-key map "16~" 'nil) ; F5
385 (define-key map "17~" 'nil) ; F6
386 (define-key map "18~" 'nil) ; F7
387 (define-key map "19~" 'nil) ; F8
388 (define-key map "20~" 'nil) ; F9
389 (define-key map "21~" 'nil) ; F10
390 (define-key map "23~" 'nil) ; F11
391 (define-key map "24~" 'nil) ; F12
392 (define-key map "25~" 'nil) ; F13
393 (define-key map "26~" 'nil) ; F14
394 (define-key map "28~" 'describe-bindings) ; HELP
395 (define-key map "29~" 'nil) ; DO
396 (define-key map "31~" 'tpu-drop-breadcrumb) ; F17
397 (define-key map "32~" 'nil) ; F18
398 (define-key map "33~" 'nil) ; F19
399 (define-key map "34~" 'nil) ; F20
400 map)
401 "Maps the function keys on the VT100 keyboard preceded by GOLD-CSI.")
402
403(defvar GOLD-SS3-map
404 (let ((map (make-sparse-keymap)))
405 (define-key map "A" 'tpu-move-to-beginning) ; up-arrow
406 (define-key map "B" 'tpu-move-to-end) ; down-arrow
407 (define-key map "C" 'end-of-line) ; right-arrow
408 (define-key map "D" 'beginning-of-line) ; left-arrow
409
410 (define-key map "P" 'keyboard-quit) ; PF1
411 (define-key map "Q" 'help-for-help) ; PF2
412 (define-key map "R" 'tpu-search) ; PF3
413 (define-key map "S" 'tpu-undelete-lines) ; PF4
414 (define-key map "p" 'open-line) ; KP0
415 (define-key map "q" 'tpu-change-case) ; KP1
416 (define-key map "r" 'tpu-delete-to-eol) ; KP2
417 (define-key map "s" 'tpu-special-insert) ; KP3
418 (define-key map "t" 'tpu-move-to-end) ; KP4
419 (define-key map "u" 'tpu-move-to-beginning) ; KP5
420 (define-key map "v" 'tpu-paste) ; KP6
421 (define-key map "w" 'execute-extended-command) ; KP7
422 (define-key map "x" 'tpu-fill) ; KP8
423 (define-key map "y" 'tpu-replace) ; KP9
424 (define-key map "m" 'tpu-undelete-words) ; KP-
425 (define-key map "l" 'tpu-undelete-char) ; KP,
426 (define-key map "n" 'tpu-unselect) ; KP.
427 (define-key map "M" 'tpu-substitute) ; KPenter
428 map)
429 "Maps the function keys on the VT100 keyboard preceded by GOLD-SS3.")
430
431(defvar GOLD-map
432 (let ((map (make-keymap))) 320 (let ((map (make-keymap)))
433 (define-key map "\e[" GOLD-CSI-map) ; GOLD-CSI map 321 ;; Previously we used escape sequences here. We now instead presume
434 (define-key map "\eO" GOLD-SS3-map) ; GOLD-SS3 map 322 ;; that term/*.el does its job to map the escape sequence to the right
323 ;; key-symbol.
324
325 (define-key map [up] 'tpu-move-to-beginning) ; up-arrow
326 (define-key map [down] 'tpu-move-to-end) ; down-arrow
327 (define-key map [right] 'end-of-line) ; right-arrow
328 (define-key map [left] 'beginning-of-line) ; left-arrow
329
330 (define-key map [find] 'nil) ; Find
331 (define-key map [insert] 'nil) ; Insert Here
332 (define-key map [delete] 'tpu-store-text) ; Remove
333 (define-key map [select] 'tpu-unselect) ; Select
334 (define-key map [prior] 'tpu-previous-window) ; Prev Screen
335 (define-key map [next] 'tpu-next-window) ; Next Screen
336
337 (define-key map [f1] 'nil) ; F1
338 (define-key map [f2] 'nil) ; F2
339 (define-key map [f3] 'nil) ; F3
340 (define-key map [f4] 'nil) ; F4
341 (define-key map [f5] 'nil) ; F5
342 (define-key map [f6] 'nil) ; F6
343 (define-key map [f7] 'nil) ; F7
344 (define-key map [f8] 'nil) ; F8
345 (define-key map [f9] 'nil) ; F9
346 (define-key map [f10] 'nil) ; F10
347 (define-key map [f11] 'nil) ; F11
348 (define-key map [f12] 'nil) ; F12
349 (define-key map [f13] 'nil) ; F13
350 (define-key map [f14] 'nil) ; F14
351 (define-key map [help] 'describe-bindings) ; HELP
352 (define-key map [menu] 'nil) ; DO
353 (define-key map [f17] 'tpu-drop-breadcrumb) ; F17
354 (define-key map [f18] 'nil) ; F18
355 (define-key map [f19] 'nil) ; F19
356 (define-key map [f20] 'nil) ; F20
357
358 (define-key map [kp-f1] 'keyboard-quit) ; PF1
359 (define-key map [kp-f2] 'help-for-help) ; PF2
360 (define-key map [kp-f3] 'tpu-search) ; PF3
361 (define-key map [kp-f4] 'tpu-undelete-lines) ; PF4
362 (define-key map [kp-0] 'open-line) ; KP0
363 (define-key map [kp-1] 'tpu-change-case) ; KP1
364 (define-key map [kp-2] 'tpu-delete-to-eol) ; KP2
365 (define-key map [kp-3] 'tpu-special-insert) ; KP3
366 (define-key map [kp-4] 'tpu-move-to-end) ; KP4
367 (define-key map [kp-5] 'tpu-move-to-beginning) ; KP5
368 (define-key map [kp-6] 'tpu-paste) ; KP6
369 (define-key map [kp-7] 'execute-extended-command) ; KP7
370 (define-key map [kp-8] 'tpu-fill) ; KP8
371 (define-key map [kp-9] 'tpu-replace) ; KP9
372 (define-key map [kp-subtract] 'tpu-undelete-words) ; KP-
373 (define-key map [kp-separator] 'tpu-undelete-char) ; KP,
374 (define-key map [kp-decimal] 'tpu-unselect) ; KP.
375 (define-key map [kp-enter] 'tpu-substitute) ; KPenter
376
435 ;; 377 ;;
436 (define-key map "\C-A" 'tpu-toggle-overwrite-mode) ; ^A 378 (define-key map "\C-A" 'tpu-toggle-overwrite-mode) ; ^A
437 (define-key map "\C-B" 'nil) ; ^B 379 (define-key map "\C-B" 'nil) ; ^B
@@ -553,48 +495,72 @@ CSI is DEC's name for the sequence <ESC>[.")
553 map) 495 map)
554 "Maps the function keys on the VT100 keyboard preceded by PF1. 496 "Maps the function keys on the VT100 keyboard preceded by PF1.
555GOLD is the ASCII 7-bit escape sequence <ESC>OP.") 497GOLD is the ASCII 7-bit escape sequence <ESC>OP.")
498(define-obsolete-variable-alias 'GOLD-map 'tpu-gold-map "23.1")
556 499
557(defvar SS3-map 500(defvar tpu-global-map
558 (let ((map (make-sparse-keymap))) 501 (let ((map (make-sparse-keymap)))
559 (define-key map "P" GOLD-map) ; GOLD map 502
503 ;; Previously defined in CSI-map. We now presume that term/*.el does
504 ;; its job to map the escape sequence to the right key-symbol.
505 (define-key map [find] 'tpu-search) ; Find
506 (define-key map [insert] 'tpu-paste) ; Insert Here
507 (define-key map [delete] 'tpu-cut) ; Remove
508 (define-key map [select] 'tpu-select) ; Select
509 (define-key map [prior] 'tpu-scroll-window-down) ; Prev Screen
510 (define-key map [next] 'tpu-scroll-window-up) ; Next Screen
511
512 (define-key map [f1] 'nil) ; F1
513 (define-key map [f2] 'nil) ; F2
514 (define-key map [f3] 'nil) ; F3
515 (define-key map [f4] 'nil) ; F4
516 (define-key map [f5] 'nil) ; F5
517 (define-key map [f6] 'nil) ; F6
518 (define-key map [f7] 'nil) ; F7
519 (define-key map [f8] 'nil) ; F8
520 (define-key map [f9] 'nil) ; F9
521 (define-key map [f10] 'tpu-exit) ; F10
522 (define-key map [f11] 'tpu-insert-escape) ; F11 (ESC)
523 (define-key map [f12] 'tpu-next-beginning-of-line) ; F12 (BS)
524 (define-key map [f13] 'tpu-delete-previous-word) ; F13 (LF)
525 (define-key map [f14] 'tpu-toggle-overwrite-mode) ; F14
526 (define-key map [help] 'tpu-help) ; HELP
527 (define-key map [menu] 'execute-extended-command) ; DO
528 (define-key map [f17] 'tpu-goto-breadcrumb) ; F17
529 (define-key map [f18] 'nil) ; F18
530 (define-key map [f19] 'nil) ; F19
531 (define-key map [f20] 'nil) ; F20
532
533
534 ;; Previously defined in SS3-map. We now presume that term/*.el does
535 ;; its job to map the escape sequence to the right key-symbol.
536 (define-key map [kp-f1] tpu-gold-map) ; GOLD map
560 ;; 537 ;;
561 (define-key map "A" 'tpu-previous-line) ; up 538 (define-key map [up] 'tpu-previous-line) ; up
562 (define-key map "B" 'tpu-next-line) ; down 539 (define-key map [down] 'tpu-next-line) ; down
563 (define-key map "C" 'tpu-forward-char) ; right 540 (define-key map [right] 'tpu-forward-char) ; right
564 (define-key map "D" 'tpu-backward-char) ; left 541 (define-key map [left] 'tpu-backward-char) ; left
565 542
566 (define-key map "Q" 'tpu-help) ; PF2 543 (define-key map [kp-f2] 'tpu-help) ; PF2
567 (define-key map "R" 'tpu-search-again) ; PF3 544 (define-key map [kp-f3] 'tpu-search-again) ; PF3
568 (define-key map "S" 'tpu-delete-current-line) ; PF4 545 (define-key map [kp-f4] 'tpu-delete-current-line) ; PF4
569 (define-key map "p" 'tpu-line) ; KP0 546 (define-key map [kp-0] 'tpu-line) ; KP0
570 (define-key map "q" 'tpu-word) ; KP1 547 (define-key map [kp-1] 'tpu-word) ; KP1
571 (define-key map "r" 'tpu-end-of-line) ; KP2 548 (define-key map [kp-2] 'tpu-end-of-line) ; KP2
572 (define-key map "s" 'tpu-char) ; KP3 549 (define-key map [kp-3] 'tpu-char) ; KP3
573 (define-key map "t" 'tpu-advance-direction) ; KP4 550 (define-key map [kp-4] 'tpu-advance-direction) ; KP4
574 (define-key map "u" 'tpu-backup-direction) ; KP5 551 (define-key map [kp-5] 'tpu-backup-direction) ; KP5
575 (define-key map "v" 'tpu-cut) ; KP6 552 (define-key map [kp-6] 'tpu-cut) ; KP6
576 (define-key map "w" 'tpu-page) ; KP7 553 (define-key map [kp-7] 'tpu-page) ; KP7
577 (define-key map "x" 'tpu-scroll-window) ; KP8 554 (define-key map [kp-8] 'tpu-scroll-window) ; KP8
578 (define-key map "y" 'tpu-append-region) ; KP9 555 (define-key map [kp-9] 'tpu-append-region) ; KP9
579 (define-key map "m" 'tpu-delete-current-word) ; KP- 556 (define-key map [kp-subtract] 'tpu-delete-current-word) ; KP-
580 (define-key map "l" 'tpu-delete-current-char) ; KP, 557 (define-key map [kp-separator] 'tpu-delete-current-char) ; KP,
581 (define-key map "n" 'tpu-select) ; KP. 558 (define-key map [kp-decimal] 'tpu-select) ; KP.
582 (define-key map "M" 'newline) ; KPenter 559 (define-key map [kp-enter] 'newline) ; KPenter
583 map)
584 "Maps the SS3 function keys on the VT100 keyboard.
585SS3 is DEC's name for the sequence <ESC>O.")
586 560
587(defvar tpu-global-map
588 (let ((map (make-sparse-keymap)))
589 (define-key map "\e[" CSI-map)
590 (define-key map "\eO" SS3-map)
591 map) 561 map)
592 "TPU-edt global keymap.") 562 "TPU-edt global keymap.")
593 563
594(and (not (boundp 'minibuffer-local-ns-map))
595 (defvar minibuffer-local-ns-map (make-sparse-keymap)
596 "Hack to give Lucid Emacs the same maps as ordinary Emacs."))
597
598 564
599;;; 565;;;
600;;; Global Variables 566;;; Global Variables
@@ -697,7 +663,7 @@ SS3 is DEC's name for the sequence <ESC>O.")
697 (setq tpu-mark-flag (if transient-mark-mode "" (if (tpu-mark) " @" " "))) 663 (setq tpu-mark-flag (if transient-mark-mode "" (if (tpu-mark) " @" " ")))
698 (force-mode-line-update)) 664 (force-mode-line-update))
699 665
700(cond (tpu-lucid-emacs-p 666(cond ((featurep 'xemacs)
701 (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line) 667 (add-hook 'zmacs-deactivate-region-hook 'tpu-update-mode-line)
702 (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line)) 668 (add-hook 'zmacs-activate-region-hook 'tpu-update-mode-line))
703 (t 669 (t
@@ -778,7 +744,7 @@ Otherwise sets the tpu-match markers to nil and returns nil."
778 "TPU-edt version of the mark function. 744 "TPU-edt version of the mark function.
779Return the appropriate value of the mark for the current 745Return the appropriate value of the mark for the current
780version of Emacs." 746version of Emacs."
781 (cond (tpu-lucid-emacs-p (mark (not zmacs-regions))) 747 (cond ((featurep 'xemacs) (mark (not zmacs-regions)))
782 (t (and mark-active (mark (not transient-mark-mode)))))) 748 (t (and mark-active (mark (not transient-mark-mode))))))
783 749
784(defun tpu-set-mark (pos) 750(defun tpu-set-mark (pos)
@@ -2366,7 +2332,7 @@ If FILE is nil, try to load a default file. The default file names are
2366 (setq file (expand-file-name file))) 2332 (setq file (expand-file-name file)))
2367 (tpu-xkeys-file 2333 (tpu-xkeys-file
2368 (setq file (expand-file-name tpu-xkeys-file))) 2334 (setq file (expand-file-name tpu-xkeys-file)))
2369 (tpu-lucid-emacs-p 2335 ((featurep 'xemacs)
2370 (setq file (convert-standard-filename 2336 (setq file (convert-standard-filename
2371 (expand-file-name "~/.tpu-lucid-keys")))) 2337 (expand-file-name "~/.tpu-lucid-keys"))))
2372 (t 2338 (t
@@ -2382,34 +2348,11 @@ If FILE is nil, try to load a default file. The default file names are
2382 (cond ((file-readable-p file) 2348 (cond ((file-readable-p file)
2383 (load-file file)) 2349 (load-file file))
2384 (t 2350 (t
2385 (switch-to-buffer "*scratch*") 2351 ;; FIXME: This used to force the user to build `file'. With the
2386 (erase-buffer) 2352 ;; new code, such a file is not even necessary, but we'll keep
2387 (insert " 2353 ;; a warning message.
2388 2354 (message "%s not found: use tpu-mapper.el to create it"
2389 Ack!! You're running TPU-edt under X-windows without loading an 2355 (abbreviate-file-name file)))))
2390 X key definition file. To create a TPU-edt X key definition
2391 file, run the tpu-mapper.el program. It came with TPU-edt. It
2392 even includes directions on how to use it! Perhaps it's lying
2393 around here someplace. ")
2394 (let ((file "tpu-mapper.el")
2395 (found nil)
2396 (path nil)
2397 (search-list (append (list (expand-file-name ".")) load-path)))
2398 (while (and (not found) search-list)
2399 (setq path (concat (car search-list)
2400 (if (string-match "/$" (car search-list)) "" "/")
2401 file))
2402 (if (and (file-exists-p path) (not (file-directory-p path)))
2403 (setq found t))
2404 (setq search-list (cdr search-list)))
2405 (cond (found
2406 (insert (format
2407 "Ah yes, there it is, in \n\n %s \n\n" path))
2408 (if (tpu-y-or-n-p "Do you want to run it now? ")
2409 (load-file path)))
2410 (t
2411 (insert "Nope, I can't seem to find it. :-(\n\n")
2412 (sit-for 120)))))))
2413 2356
2414(defun tpu-copy-keyfile (oldname newname) 2357(defun tpu-copy-keyfile (oldname newname)
2415 "Copy the TPU-edt X key definitions file to the new default name." 2358 "Copy the TPU-edt X key definitions file to the new default name."
diff --git a/lisp/emulation/tpu-mapper.el b/lisp/emulation/tpu-mapper.el
index 975e61c8df3..eeaa5c7c560 100644
--- a/lisp/emulation/tpu-mapper.el
+++ b/lisp/emulation/tpu-mapper.el
@@ -202,9 +202,9 @@
202 (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]")) 202 (setq tpu-key (concat "[" (format "%s" tpu-key-seq) "]"))
203 (cond ((not (equal tpu-key tpu-return)) 203 (cond ((not (equal tpu-key tpu-return))
204 (set-buffer "Keys") 204 (set-buffer "Keys")
205 (insert (format"(global-set-key %s %s)\n" tpu-key func)) 205 (insert (format"(define-key tpu-global-map %s %s)\n" tpu-key func))
206 (set-buffer "Gold-Keys") 206 (set-buffer "Gold-Keys")
207 (insert (format "(define-key GOLD-map %s %s)\n" tpu-key gold-func)) 207 (insert (format "(define-key tpu-gold-map %s %s)\n" tpu-key gold-func))
208 (set-buffer "Directions")) 208 (set-buffer "Directions"))
209 ;; bogosity to get next prompt to come up, if the user hits <CR>! 209 ;; bogosity to get next prompt to come up, if the user hits <CR>!
210 ;; check periodically to see if this is still needed... 210 ;; check periodically to see if this is still needed...
@@ -393,5 +393,5 @@
393") 393")
394(goto-char (point-min)) 394(goto-char (point-min))
395 395
396;;; arch-tag: bab5872f-cd3a-4c1c-aedb-047b67646f6c 396;; arch-tag: bab5872f-cd3a-4c1c-aedb-047b67646f6c
397;;; tpu-mapper.el ends here 397;;; tpu-mapper.el ends here
diff --git a/lisp/emulation/viper-cmd.el b/lisp/emulation/viper-cmd.el
index 9bd1654020b..f4c0650b1c8 100644
--- a/lisp/emulation/viper-cmd.el
+++ b/lisp/emulation/viper-cmd.el
@@ -106,7 +106,7 @@
106;; define viper-charpair-command-p 106;; define viper-charpair-command-p
107(viper-test-com-defun viper-charpair-command) 107(viper-test-com-defun viper-charpair-command)
108 108
109(defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?H ?j ?k ?l 109(defconst viper-movement-commands '(?b ?B ?e ?E ?f ?F ?G ?h ?j ?k ?l
110 ?H ?M ?L ?n ?t ?T ?w ?W ?$ ?% 110 ?H ?M ?L ?n ?t ?T ?w ?W ?$ ?%
111 ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?` 111 ?^ ?( ?) ?- ?+ ?| ?{ ?} ?[ ?] ?' ?`
112 ?\; ?, ?0 ?? ?/ ?\ ?\C-m 112 ?\; ?, ?0 ?? ?/ ?\ ?\C-m
@@ -1321,10 +1321,10 @@ as a Meta key and any number of multiple escapes is allowed."
1321 (setq last-command-event 1321 (setq last-command-event
1322 (viper-copy-event 1322 (viper-copy-event
1323 (if viper-xemacs-p (character-to-event char) char))) 1323 (if viper-xemacs-p (character-to-event char) char)))
1324 (condition-case nil 1324 (condition-case err
1325 (funcall cmd-to-exec-at-end cmd-info) 1325 (funcall cmd-to-exec-at-end cmd-info)
1326 (error 1326 (error
1327 (error ""))))) 1327 (error "%s" (error-message-string err))))))
1328 )) 1328 ))
1329 1329
1330(defun viper-describe-arg (arg) 1330(defun viper-describe-arg (arg)
@@ -1902,7 +1902,7 @@ With prefix argument, find next destructive command."
1902 (setq viper-intermediate-command 1902 (setq viper-intermediate-command
1903 'repeating-display-destructive-command) 1903 'repeating-display-destructive-command)
1904 ;; first search through command history--set temp ring 1904 ;; first search through command history--set temp ring
1905 (setq viper-temp-command-ring (copy-list viper-command-ring))) 1905 (setq viper-temp-command-ring (copy-sequence viper-command-ring)))
1906 (setq cmd (if next 1906 (setq cmd (if next
1907 (viper-special-ring-rotate1 viper-temp-command-ring 1) 1907 (viper-special-ring-rotate1 viper-temp-command-ring 1)
1908 (viper-special-ring-rotate1 viper-temp-command-ring -1))) 1908 (viper-special-ring-rotate1 viper-temp-command-ring -1)))
@@ -1936,7 +1936,7 @@ to in the global map, instead of cycling through the insertion ring."
1936 (length viper-last-inserted-string-from-insertion-ring)))) 1936 (length viper-last-inserted-string-from-insertion-ring))))
1937 ) 1937 )
1938 ;;first search through insertion history 1938 ;;first search through insertion history
1939 (setq viper-temp-insertion-ring (copy-list viper-insertion-ring))) 1939 (setq viper-temp-insertion-ring (copy-sequence viper-insertion-ring)))
1940 (setq this-command 'viper-insert-from-insertion-ring) 1940 (setq this-command 'viper-insert-from-insertion-ring)
1941 ;; so that things will be undone properly 1941 ;; so that things will be undone properly
1942 (setq buffer-undo-list (cons nil buffer-undo-list)) 1942 (setq buffer-undo-list (cons nil buffer-undo-list))
diff --git a/lisp/emulation/viper-init.el b/lisp/emulation/viper-init.el
index 86e0e044641..4a1bae82711 100644
--- a/lisp/emulation/viper-init.el
+++ b/lisp/emulation/viper-init.el
@@ -97,6 +97,13 @@
97 :tag "Is it VMS?" 97 :tag "Is it VMS?"
98 :group 'viper-misc) 98 :group 'viper-misc)
99 99
100(defcustom viper-suppress-input-method-change-message nil
101 "If t, the message notifying about changes in the input method is not displayed.
102Normally, a message is displayed each time on enters the vi, insert or replace
103state."
104 :type 'boolean
105 :group 'viper-misc)
106
100(defcustom viper-force-faces nil 107(defcustom viper-force-faces nil
101 "If t, Viper will think that it is running on a display that supports faces. 108 "If t, Viper will think that it is running on a display that supports faces.
102This is provided as a temporary relief for users of graphics-capable terminals 109This is provided as a temporary relief for users of graphics-capable terminals
@@ -326,7 +333,8 @@ Use `M-x viper-set-expert-level' to change this.")
326 ;; turn off special input methods in vi-state 333 ;; turn off special input methods in vi-state
327 (if (eq viper-current-state 'vi-state) 334 (if (eq viper-current-state 'vi-state)
328 (viper-set-input-method nil)) 335 (viper-set-input-method nil))
329 (if (memq viper-current-state '(vi-state insert-state replace-state)) 336 (if (and (memq viper-current-state '(vi-state insert-state replace-state))
337 (not viper-suppress-input-method-change-message))
330 (message "Viper special input method%s: on" 338 (message "Viper special input method%s: on"
331 (if (or current-input-method default-input-method) 339 (if (or current-input-method default-input-method)
332 (format " %S" 340 (format " %S"
@@ -339,7 +347,8 @@ Use `M-x viper-set-expert-level' to change this.")
339 (if (null viper-mule-hook-flag) 347 (if (null viper-mule-hook-flag)
340 () 348 ()
341 (setq viper-special-input-method nil) 349 (setq viper-special-input-method nil)
342 (if (memq viper-current-state '(vi-state insert-state replace-state)) 350 (if (and (memq viper-current-state '(vi-state insert-state replace-state))
351 (not viper-suppress-input-method-change-message))
343 (message "Viper special input method%s: off" 352 (message "Viper special input method%s: off"
344 (if (or current-input-method default-input-method) 353 (if (or current-input-method default-input-method)
345 (format " %S" 354 (format " %S"
@@ -369,7 +378,7 @@ Use `M-x viper-set-expert-level' to change this.")
369;; Set quail-mode to ARG 378;; Set quail-mode to ARG
370(defun viper-set-input-method (arg) 379(defun viper-set-input-method (arg)
371 (setq viper-mule-hook-flag t) ; just a precaution 380 (setq viper-mule-hook-flag t) ; just a precaution
372 (let (viper-mule-hook-flag) ; temporarily inactivate viper mule hooks 381 (let (viper-mule-hook-flag) ; temporarily deactivate viper mule hooks
373 (cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method) 382 (cond ((and arg (> (prefix-numeric-value arg) 0) default-input-method)
374 ;; activate input method 383 ;; activate input method
375 (viper-activate-input-method)) 384 (viper-activate-input-method))
diff --git a/lisp/emulation/viper-keym.el b/lisp/emulation/viper-keym.el
index 9dd78ce8aa1..1d158274198 100644
--- a/lisp/emulation/viper-keym.el
+++ b/lisp/emulation/viper-keym.el
@@ -339,8 +339,8 @@ If running in a terminal, [(escape)] is not understood, so must use \"\\e\"."
339(define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol) 339(define-key viper-vi-basic-map "\C-m" 'viper-next-line-at-bol)
340(define-key viper-vi-basic-map "\C-u" 'viper-scroll-down) 340(define-key viper-vi-basic-map "\C-u" 'viper-scroll-down)
341(define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one) 341(define-key viper-vi-basic-map "\C-y" 'viper-scroll-down-one)
342(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward) 342;;(define-key viper-vi-basic-map "\C-s" 'viper-isearch-forward)
343(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward) 343;;(define-key viper-vi-basic-map "\C-r" 'viper-isearch-backward)
344(define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style) 344(define-key viper-vi-basic-map "\C-c/" 'viper-toggle-search-style)
345(define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file) 345(define-key viper-vi-basic-map "\C-c\C-g" 'viper-info-on-file)
346 346
diff --git a/lisp/emulation/viper-util.el b/lisp/emulation/viper-util.el
index 0419af5fedf..eef92106de2 100644
--- a/lisp/emulation/viper-util.el
+++ b/lisp/emulation/viper-util.el
@@ -168,7 +168,7 @@
168 168
169(defun viper-set-cursor-color-according-to-state (&optional frame) 169(defun viper-set-cursor-color-according-to-state (&optional frame)
170 (cond ((eq viper-current-state 'replace-state) 170 (cond ((eq viper-current-state 'replace-state)
171 (viper-change-cursor-color viper-replace-state-cursor-color frame)) 171 (viper-change-cursor-color viper-replace-overlay-cursor-color frame))
172 ((and (eq viper-current-state 'emacs-state) 172 ((and (eq viper-current-state 'emacs-state)
173 viper-emacs-state-cursor-color) 173 viper-emacs-state-cursor-color)
174 (viper-change-cursor-color viper-emacs-state-cursor-color frame)) 174 (viper-change-cursor-color viper-emacs-state-cursor-color frame))
@@ -889,9 +889,7 @@
889;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg 889;; Sit for VAL milliseconds. XEmacs doesn't support the millisecond arg
890;; in sit-for, so this function smoothes out the differences. 890;; in sit-for, so this function smoothes out the differences.
891(defsubst viper-sit-for-short (val &optional nodisp) 891(defsubst viper-sit-for-short (val &optional nodisp)
892 (if viper-xemacs-p 892 (sit-for (/ val 1000.0) nodisp))
893 (sit-for (/ val 1000.0) nodisp)
894 (sit-for 0 val nodisp)))
895 893
896;; EVENT may be a single event of a sequence of events 894;; EVENT may be a single event of a sequence of events
897(defsubst viper-ESC-event-p (event) 895(defsubst viper-ESC-event-p (event)
diff --git a/lisp/emulation/viper.el b/lisp/emulation/viper.el
index 67ec3660c65..a42e7f1eb91 100644
--- a/lisp/emulation/viper.el
+++ b/lisp/emulation/viper.el
@@ -9,7 +9,7 @@
9;; Author: Michael Kifer <kifer@cs.stonybrook.edu> 9;; Author: Michael Kifer <kifer@cs.stonybrook.edu>
10;; Keywords: emulations 10;; Keywords: emulations
11 11
12(defconst viper-version "3.13.1 of October 23, 2006" 12(defconst viper-version "3.14 of June 14, 2007"
13 "The current version of Viper") 13 "The current version of Viper")
14 14
15;; This file is part of GNU Emacs. 15;; This file is part of GNU Emacs.
@@ -298,7 +298,6 @@
298;;; Code: 298;;; Code:
299 299
300(require 'advice) 300(require 'advice)
301(require 'cl)
302(require 'ring) 301(require 'ring)
303 302
304;; compiler pacifier 303;; compiler pacifier
@@ -457,6 +456,7 @@ unless it is coming up in a wrong Viper state."
457(defcustom viper-insert-state-mode-list 456(defcustom viper-insert-state-mode-list
458 '(internal-ange-ftp-mode 457 '(internal-ange-ftp-mode
459 comint-mode 458 comint-mode
459 gud-mode
460 inferior-emacs-lisp-mode 460 inferior-emacs-lisp-mode
461 erc-mode 461 erc-mode
462 eshell-mode 462 eshell-mode
@@ -481,6 +481,7 @@ unless it is coming up in a wrong Viper state."
481 '((help-mode emacs-state viper-slash-and-colon-map) 481 '((help-mode emacs-state viper-slash-and-colon-map)
482 (comint-mode insert-state viper-comint-mode-modifier-map) 482 (comint-mode insert-state viper-comint-mode-modifier-map)
483 (comint-mode vi-state viper-comint-mode-modifier-map) 483 (comint-mode vi-state viper-comint-mode-modifier-map)
484 (gud-mode insert-state viper-comint-mode-modifier-map)
484 (shell-mode insert-state viper-comint-mode-modifier-map) 485 (shell-mode insert-state viper-comint-mode-modifier-map)
485 (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map) 486 (inferior-emacs-lisp-mode insert-state viper-comint-mode-modifier-map)
486 (shell-mode vi-state viper-comint-mode-modifier-map) 487 (shell-mode vi-state viper-comint-mode-modifier-map)
@@ -1025,48 +1026,63 @@ It also can't undo some Viper settings."
1025 (setq global-mode-string 1026 (setq global-mode-string
1026 (append '("" viper-mode-string) (cdr global-mode-string)))) 1027 (append '("" viper-mode-string) (cdr global-mode-string))))
1027 1028
1028 (defadvice describe-key (before viper-describe-key-ad protect activate) 1029 (viper-cond-compile-for-xemacs-or-emacs
1029 "Force to read key via `viper-read-key-sequence'." 1030 ;; XEmacs
1030 (interactive (let (key) 1031 (defadvice describe-key (before viper-describe-key-ad protect activate)
1031 (setq key (viper-read-key-sequence 1032 "Force to read key via `viper-read-key-sequence'."
1032 "Describe key (or click or menu item): ")) 1033 (interactive (list (viper-read-key-sequence "Describe key: "))))
1033 (list key 1034 ;; Emacs
1034 (prefix-numeric-value current-prefix-arg) 1035 (defadvice describe-key (before viper-describe-key-ad protect activate)
1035 ;; If KEY is a down-event, read also the 1036 "Force to read key via `viper-read-key-sequence'."
1036 ;; corresponding up-event. 1037 (interactive (let (key)
1037 (and (vectorp key) 1038 (setq key (viper-read-key-sequence
1038 (let ((last-idx (1- (length key)))) 1039 "Describe key (or click or menu item): "))
1039 (and (eventp (aref key last-idx)) 1040 (list key
1040 (memq 'down (event-modifiers 1041 (prefix-numeric-value current-prefix-arg)
1041 (aref key last-idx))))) 1042 ;; If KEY is a down-event, read also the
1042 (or (and (eventp (aref key 0)) 1043 ;; corresponding up-event.
1043 (memq 'down (event-modifiers 1044 (and (vectorp key)
1044 (aref key 0))) 1045 (let ((last-idx (1- (length key))))
1045 ;; For the C-down-mouse-2 popup 1046 (and (eventp (aref key last-idx))
1046 ;; menu, there is no subsequent up-event. 1047 (memq 'down (event-modifiers
1047 (= (length key) 1)) 1048 (aref key last-idx)))))
1048 (and (> (length key) 1) 1049 (or (and (eventp (aref key 0))
1049 (eventp (aref key 1)) 1050 (memq 'down (event-modifiers
1050 (memq 'down (event-modifiers (aref key 1))))) 1051 (aref key 0)))
1051 (read-event)))))) 1052 ;; For the C-down-mouse-2 popup menu,
1052 1053 ;; there is no subsequent up-event
1053 (defadvice describe-key-briefly 1054 (= (length key) 1))
1054 (before viper-describe-key-briefly-ad protect activate) 1055 (and (> (length key) 1)
1055 "Force to read key via `viper-read-key-sequence'." 1056 (eventp (aref key 1))
1056 (interactive (let (key) 1057 (memq 'down (event-modifiers (aref key 1)))))
1057 (setq key (viper-read-key-sequence 1058 (read-event))))))
1058 "Describe key (or click or menu item): ")) 1059 ) ; viper-cond-compile-for-xemacs-or-emacs
1059 ;; If KEY is a down-event, read and discard the 1060
1060 ;; corresponding up-event. 1061 (viper-cond-compile-for-xemacs-or-emacs
1061 (and (vectorp key) 1062 ;; XEmacs
1062 (let ((last-idx (1- (length key)))) 1063 (defadvice describe-key-briefly
1063 (and (eventp (aref key last-idx)) 1064 (before viper-describe-key-briefly-ad protect activate)
1064 (memq 'down (event-modifiers (aref key last-idx))))) 1065 "Force to read key via `viper-read-key-sequence'."
1065 (read-event)) 1066 (interactive (list (viper-read-key-sequence "Describe key briefly: "))))
1066 (list key 1067 ;; Emacs
1067 (if current-prefix-arg 1068 (defadvice describe-key-briefly
1068 (prefix-numeric-value current-prefix-arg)) 1069 (before viper-describe-key-briefly-ad protect activate)
1069 1)))) 1070 "Force to read key via `viper-read-key-sequence'."
1071 (interactive (let (key)
1072 (setq key (viper-read-key-sequence
1073 "Describe key (or click or menu item): "))
1074 ;; If KEY is a down-event, read and discard the
1075 ;; corresponding up-event.
1076 (and (vectorp key)
1077 (let ((last-idx (1- (length key))))
1078 (and (eventp (aref key last-idx))
1079 (memq 'down (event-modifiers (aref key last-idx)))))
1080 (read-event))
1081 (list key
1082 (if current-prefix-arg
1083 (prefix-numeric-value current-prefix-arg))
1084 1))))
1085 ) ;; viper-cond-compile-for-xemacs-or-emacs
1070 1086
1071 (defadvice find-file (before viper-add-suffix-advice activate) 1087 (defadvice find-file (before viper-add-suffix-advice activate)
1072 "Use `read-file-name' for reading arguments." 1088 "Use `read-file-name' for reading arguments."
diff --git a/lisp/erc/ChangeLog b/lisp/erc/ChangeLog
index 9ffbcbd5201..33206ab6cd9 100644
--- a/lisp/erc/ChangeLog
+++ b/lisp/erc/ChangeLog
@@ -1,3 +1,7 @@
12007-06-14 Juanma Barranquero <lekktu@gmail.com>
2
3 * erc-goodies.el (erc-scroll-to-bottom): Remove redundant check.
4
12007-06-06 Juanma Barranquero <lekktu@gmail.com> 52007-06-06 Juanma Barranquero <lekktu@gmail.com>
2 6
3 * erc.el (erc-show-channel-key-p, erc-startup-file-list): 7 * erc.el (erc-show-channel-key-p, erc-startup-file-list):
diff --git a/lisp/erc/erc-goodies.el b/lisp/erc/erc-goodies.el
index 933e6b34b52..6820f91628a 100644
--- a/lisp/erc/erc-goodies.el
+++ b/lisp/erc/erc-goodies.el
@@ -77,7 +77,7 @@ You can control which line is recentered to by customizing the
77variable `erc-input-line-position'. 77variable `erc-input-line-position'.
78 78
79DISPLAY-START is ignored." 79DISPLAY-START is ignored."
80 (if (and window (window-live-p window)) 80 (if (window-live-p window)
81 ;; Temporarily bind resize-mini-windows to nil so that users who have it 81 ;; Temporarily bind resize-mini-windows to nil so that users who have it
82 ;; set to a non-nil value will not suffer from premature minibuffer 82 ;; set to a non-nil value will not suffer from premature minibuffer
83 ;; shrinkage due to the below recenter call. I have no idea why this 83 ;; shrinkage due to the below recenter call. I have no idea why this
diff --git a/lisp/filesets.el b/lisp/filesets.el
index e13c4a321dd..8b18f910a66 100644
--- a/lisp/filesets.el
+++ b/lisp/filesets.el
@@ -354,7 +354,7 @@ See `add-submenu' for documentation."
354(defcustom filesets-menu-cache-file 354(defcustom filesets-menu-cache-file
355 (if filesets-running-xemacs 355 (if filesets-running-xemacs
356 "~/.xemacs/filesets-cache.el" 356 "~/.xemacs/filesets-cache.el"
357 "~/.emacs.d/filesets-cache.el") 357 (concat user-emacs-directory "filesets-cache.el"))
358 "*File to be used for saving the filesets menu between sessions. 358 "*File to be used for saving the filesets menu between sessions.
359Set this to \"\", to disable caching of menus. 359Set this to \"\", to disable caching of menus.
360Don't forget to check out `filesets-menu-ensure-use-cached'." 360Don't forget to check out `filesets-menu-ensure-use-cached'."
diff --git a/lisp/follow.el b/lisp/follow.el
index 90555a786cc..048db9bf11a 100644
--- a/lisp/follow.el
+++ b/lisp/follow.el
@@ -912,7 +912,7 @@ of the way from the true end."
912 "Return all windows displaying the same buffer as the TESTWIN. 912 "Return all windows displaying the same buffer as the TESTWIN.
913The list contains only windows displayed in the same frame as TESTWIN. 913The list contains only windows displayed in the same frame as TESTWIN.
914If TESTWIN is nil the selected window is used." 914If TESTWIN is nil the selected window is used."
915 (or (and testwin (window-live-p testwin)) 915 (or (window-live-p testwin)
916 (setq testwin (selected-window))) 916 (setq testwin (selected-window)))
917 (let* ((top (frame-first-window (window-frame testwin))) 917 (let* ((top (frame-first-window (window-frame testwin)))
918 (win top) 918 (win top)
@@ -1968,7 +1968,7 @@ report this using the `report-emacs-bug' function."
1968 ;; If we're in follow mode, do our stuff. Select a new window and 1968 ;; If we're in follow mode, do our stuff. Select a new window and
1969 ;; redisplay. (Actually, it is redundant to check `buf', but I 1969 ;; redisplay. (Actually, it is redundant to check `buf', but I
1970 ;; feel it's more correct.) 1970 ;; feel it's more correct.)
1971 (if (and buf win (window-live-p win)) 1971 (if (and buf (window-live-p win))
1972 (progn 1972 (progn
1973 (set-buffer buf) 1973 (set-buffer buf)
1974 (if (and (boundp 'follow-mode) follow-mode) 1974 (if (and (boundp 'follow-mode) follow-mode)
diff --git a/lisp/font-lock.el b/lisp/font-lock.el
index 306cf5fd399..bf01532c2e4 100644
--- a/lisp/font-lock.el
+++ b/lisp/font-lock.el
@@ -698,6 +698,14 @@ see the variables `c-font-lock-extra-types', `c++-font-lock-extra-types',
698 ;; contain the new keywords. 698 ;; contain the new keywords.
699 (font-lock-update-removed-keyword-alist mode keywords how)) 699 (font-lock-update-removed-keyword-alist mode keywords how))
700 (t 700 (t
701 (when (and font-lock-mode
702 (not (or font-lock-keywords font-lock-defaults)))
703 ;; The major mode has not set any keywords, so when we enabled
704 ;; font-lock-mode it only enabled the font-core.el part, not the
705 ;; font-lock-mode-internal. Try again.
706 (font-lock-mode -1)
707 (set (make-local-variable 'font-lock-defaults) '(nil t))
708 (font-lock-mode 1))
701 ;; Otherwise set or add the keywords now. 709 ;; Otherwise set or add the keywords now.
702 ;; This is a no-op if it has been done already in this buffer 710 ;; This is a no-op if it has been done already in this buffer
703 ;; for the correct major mode. 711 ;; for the correct major mode.
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog
index 17ef7f996b3..0e9da63da1a 100644
--- a/lisp/gnus/ChangeLog
+++ b/lisp/gnus/ChangeLog
@@ -1,3 +1,14 @@
12007-06-14 Katsumi Yamaoka <yamaoka@jpl.org>
2
3 * gnus-agent.el (gnus-agent-fetch-headers)
4 (gnus-agent-retrieve-headers): Bind
5 gnus-decode-encoded-address-function to identity.
6
7 * nntp.el (nntp-send-xover-command): Recognize an xover command is
8 available also when the server returns simply a dot.
9
10 * gnus-ems.el (gnus-x-splash): Redisplay window before measuring it.
11
12007-06-08 Katsumi Yamaoka <yamaoka@jpl.org> 122007-06-08 Katsumi Yamaoka <yamaoka@jpl.org>
2 13
3 * gnus-ems.el (gnus-x-splash): Make it work. 14 * gnus-ems.el (gnus-x-splash): Make it work.
diff --git a/lisp/gnus/ChangeLog.2 b/lisp/gnus/ChangeLog.2
index 4dac2ac55ea..d4472992aeb 100644
--- a/lisp/gnus/ChangeLog.2
+++ b/lisp/gnus/ChangeLog.2
@@ -6370,8 +6370,7 @@
6370 6370
6371 * message.el (message-required-headers): Add From. 6371 * message.el (message-required-headers): Add From.
6372 6372
63732003-01-02 Katsumi Yamaoka <yamaoka@jpl.org> 63732003-01-02 Norbert Koch <nk@viteno.net> (tiny change)
6374 Trivial patch from Norbert Koch <nk@viteno.net>.
6375 6374
6376 * gnus-msg.el (gnus-gcc-externalize-attachments): Fix typo. 6375 * gnus-msg.el (gnus-gcc-externalize-attachments): Fix typo.
6377 6376
@@ -6984,8 +6983,7 @@
6984 * nnmaildir.el (nnmaildir-request-group): bugfix: don't erase 6983 * nnmaildir.el (nnmaildir-request-group): bugfix: don't erase
6985 nntp-server-buffer if we aren't going to write to it. 6984 nntp-server-buffer if we aren't going to write to it.
6986 6985
69872002-12-04 Katsumi Yamaoka <yamaoka@jpl.org> 69862002-12-04 Itai Zukerman <zukerman@math-hat.com> (tiny change)
6988 Trivial patch from Itai Zukerman <zukerman@math-hat.com>.
6989 6987
6990 * mm-decode.el (mm-w3m-safe-url-regexp): Fix parenthesis. 6988 * mm-decode.el (mm-w3m-safe-url-regexp): Fix parenthesis.
6991 6989
@@ -7233,8 +7231,7 @@
7233 * nnimap.el (nnimap-request-expire-articles): Compress sequence 7231 * nnimap.el (nnimap-request-expire-articles): Compress sequence
7234 before storing \Deleted mark on expired articles. 7232 before storing \Deleted mark on expired articles.
7235 7233
72362002-11-17 Shenghuo Zhu <zsh@cs.rochester.edu> 72342002-11-17 Markus Rost <rost@math.ohio-state.edu> (tiny change)
7237 Trivial patch from Markus Rost <rost@math.ohio-state.edu>
7238 7235
7239 * gnus-sum.el (gnus-summary-goto-unread): Doc fix - escape open 7236 * gnus-sum.el (gnus-summary-goto-unread): Doc fix - escape open
7240 parens in column 0. 7237 parens in column 0.
@@ -7906,10 +7903,12 @@
7906 (mml1991-pgg-sign, mml1991-pgg-encrypt): New functions. 7903 (mml1991-pgg-sign, mml1991-pgg-encrypt): New functions.
7907 (mml1991-pgg-encrypt): Fix recipients querying. 7904 (mml1991-pgg-encrypt): Fix recipients querying.
7908 7905
79062002-09-28 <dme@dme.org> (tiny change)
7907
7908 * mml2015.el (autoload): Autoload correct files.
7909
79092002-09-28 Simon Josefsson <jas@extundo.com> 79102002-09-28 Simon Josefsson <jas@extundo.com>
7910 7911
7911 * mml2015.el (autoload): Autoload correct files. Trivial patch
7912 from dme@dme.org.
7913 (mml2015-pgg-decrypt, mml2015-pgg-verify): Make sure either nil or 7912 (mml2015-pgg-decrypt, mml2015-pgg-verify): Make sure either nil or
7914 handle is returned. 7913 handle is returned.
7915 7914
@@ -8486,12 +8485,10 @@
8486 * imap.el (imap-shell-open): Allow non-list `imap-shell-program'. 8485 * imap.el (imap-shell-open): Allow non-list `imap-shell-program'.
8487 (imap-shell-open): Skip initial junk before IMAP greeting. 8486 (imap-shell-open): Skip initial junk before IMAP greeting.
8488 8487
84892002-08-11 Simon Josefsson <jas@extundo.com> 84882002-08-11 Reiner Steib <Reiner.Steib@gmx.de>
8490 8489
8491 * message-utils.el (message-xpost-default, 8490 * message-utils.el (message-xpost-default)
8492 message-xpost-fup2-header, message-xpost-fup2): Fixed 8491 (message-xpost-fup2-header, message-xpost-fup2): Fixed Typos.
8493 Typos. Trivial changes from Reiner Steib
8494 <4uce.02.r.steib@gmx.net>.
8495 8492
84962002-08-09 Simon Josefsson <jas@extundo.com> 84932002-08-09 Simon Josefsson <jas@extundo.com>
8497 8494
@@ -9915,10 +9912,9 @@
9915 (mm-inline-wash-with-file): New function. 9912 (mm-inline-wash-with-file): New function.
9916 (mm-inline-wash-with-stdin): New function. 9913 (mm-inline-wash-with-stdin): New function.
9917 9914
99182002-02-17 ShengHuo ZHU <zsh@cs.rochester.edu> 99152002-02-17 Reiner Steib <Reiner.Steib@gmx.de>
9919 9916
9920 * message-utils.el: Fix installation doc. 9917 * message-utils.el: Fix installation doc.
9921 From: Reiner Steib <4uce.02.r.steib@gmx.net>
9922 9918
99232002-02-16 ShengHuo ZHU <zsh@cs.rochester.edu> 99192002-02-16 ShengHuo ZHU <zsh@cs.rochester.edu>
9924 9920
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index f54b568a7ef..7a18c42d7cd 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -1768,6 +1768,7 @@ article numbers will be returned."
1768 (gnus-uncompress-range (gnus-active group)) 1768 (gnus-uncompress-range (gnus-active group))
1769 (gnus-list-of-unread-articles group))) 1769 (gnus-list-of-unread-articles group)))
1770 (gnus-decode-encoded-word-function 'identity) 1770 (gnus-decode-encoded-word-function 'identity)
1771 (gnus-decode-encoded-address-function 'identity)
1771 (file (gnus-agent-article-name ".overview" group))) 1772 (file (gnus-agent-article-name ".overview" group)))
1772 1773
1773 (unless fetch-all 1774 (unless fetch-all
@@ -3571,6 +3572,7 @@ has been fetched."
3571 (save-excursion 3572 (save-excursion
3572 (gnus-agent-create-buffer) 3573 (gnus-agent-create-buffer)
3573 (let ((gnus-decode-encoded-word-function 'identity) 3574 (let ((gnus-decode-encoded-word-function 'identity)
3575 (gnus-decode-encoded-address-function 'identity)
3574 (file (gnus-agent-article-name ".overview" group)) 3576 (file (gnus-agent-article-name ".overview" group))
3575 cached-articles uncached-articles) 3577 cached-articles uncached-articles)
3576 (gnus-make-directory (nnheader-translate-file-chars 3578 (gnus-make-directory (nnheader-translate-file-chars
diff --git a/lisp/gnus/gnus-ems.el b/lisp/gnus/gnus-ems.el
index 4400b81f041..9b2ddc3ee88 100644
--- a/lisp/gnus/gnus-ems.el
+++ b/lisp/gnus/gnus-ems.el
@@ -183,6 +183,7 @@
183 (file (nnheader-find-etc-directory "images/gnus/x-splash" t)) 183 (file (nnheader-find-etc-directory "images/gnus/x-splash" t))
184 pixmap fcw fch width height fringes sbars left yoffset top ls) 184 pixmap fcw fch width height fringes sbars left yoffset top ls)
185 (erase-buffer) 185 (erase-buffer)
186 (sit-for 0) ;; Necessary for measuring the window size correctly.
186 (when (and file 187 (when (and file
187 (ignore-errors 188 (ignore-errors
188 (let ((coding-system-for-read 'raw-text) 189 (let ((coding-system-for-read 'raw-text)
diff --git a/lisp/gnus/nntp.el b/lisp/gnus/nntp.el
index 25b924a93e7..2b62cd7fffa 100644
--- a/lisp/gnus/nntp.el
+++ b/lisp/gnus/nntp.el
@@ -1580,7 +1580,8 @@ password contained in '~/.nntp-authinfo'."
1580 ;; article number. How... helpful. 1580 ;; article number. How... helpful.
1581 (progn 1581 (progn
1582 (forward-line 1) 1582 (forward-line 1)
1583 (looking-at "[0-9]+\t...")) ; More text after number. 1583 ;; More text after number, or a dot.
1584 (looking-at "[0-9]+\t...\\|\\.\r?\n"))
1584 (setq nntp-server-xover (car commands)))) 1585 (setq nntp-server-xover (car commands))))
1585 (setq commands (cdr commands))) 1586 (setq commands (cdr commands)))
1586 ;; If none of the commands worked, we disable XOVER. 1587 ;; If none of the commands worked, we disable XOVER.
diff --git a/lisp/image-dired.el b/lisp/image-dired.el
index 867c50df013..d520d99ea11 100644
--- a/lisp/image-dired.el
+++ b/lisp/image-dired.el
@@ -166,7 +166,7 @@
166 :prefix "image-dired-" 166 :prefix "image-dired-"
167 :group 'multimedia) 167 :group 'multimedia)
168 168
169(defcustom image-dired-dir "~/.emacs.d/image-dired/" 169(defcustom image-dired-dir (concat user-emacs-directory "image-dired/")
170 "Directory where thumbnail images are stored." 170 "Directory where thumbnail images are stored."
171 :type 'string 171 :type 'string
172 :group 'image-dired) 172 :group 'image-dired)
@@ -187,17 +187,20 @@ that allows sharing of thumbnails across different programs."
187 (const :tag "Per-directory" per-directory)) 187 (const :tag "Per-directory" per-directory))
188 :group 'image-dired) 188 :group 'image-dired)
189 189
190(defcustom image-dired-db-file "~/.emacs.d/image-dired/.image-dired_db" 190(defcustom image-dired-db-file
191 (concat user-emacs-directory "image-dired/.image-dired_db")
191 "Database file where file names and their associated tags are stored." 192 "Database file where file names and their associated tags are stored."
192 :type 'string 193 :type 'string
193 :group 'image-dired) 194 :group 'image-dired)
194 195
195(defcustom image-dired-temp-image-file "~/.emacs.d/image-dired/.image-dired_temp" 196(defcustom image-dired-temp-image-file
197 (concat user-emacs-directory "image-dired/.image-dired_temp")
196 "Name of temporary image file used by various commands." 198 "Name of temporary image file used by various commands."
197 :type 'string 199 :type 'string
198 :group 'image-dired) 200 :group 'image-dired)
199 201
200(defcustom image-dired-gallery-dir "~/.emacs.d/image-dired/.image-dired_gallery" 202(defcustom image-dired-gallery-dir
203 (concat user-emacs-directory "image-dired/.image-dired_gallery")
201 "Directory to store generated gallery html pages. 204 "Directory to store generated gallery html pages.
202This path needs to be \"shared\" to the public so that it can access 205This path needs to be \"shared\" to the public so that it can access
203the index.html page that image-dired creates." 206the index.html page that image-dired creates."
@@ -342,7 +345,7 @@ original image file name and %t which is replaced by
342 :group 'image-dired) 345 :group 'image-dired)
343 346
344(defcustom image-dired-temp-rotate-image-file 347(defcustom image-dired-temp-rotate-image-file
345 "~/.emacs.d/image-dired/.image-dired_rotate_temp" 348 (concat user-emacs-directory "image-dired/.image-dired_rotate_temp")
346 "Temporary file for rotate operations." 349 "Temporary file for rotate operations."
347 :type 'string 350 :type 'string
348 :group 'image-dired) 351 :group 'image-dired)
diff --git a/lisp/indent.el b/lisp/indent.el
index 0b0588ab515..7a94963ff4d 100644
--- a/lisp/indent.el
+++ b/lisp/indent.el
@@ -50,8 +50,8 @@ Don't rebind TAB unless you really need to.")
50 "*Controls the operation of the TAB key. 50 "*Controls the operation of the TAB key.
51If t, hitting TAB always just indents the current line. 51If t, hitting TAB always just indents the current line.
52If nil, hitting TAB indents the current line if point is at the left margin 52If nil, hitting TAB indents the current line if point is at the left margin
53or in the line's indentation, otherwise it insert a \"real\" TAB character. 53or in the line's indentation, otherwise it inserts a \"real\" TAB character.
54Most programming language modes have their own variable to control this, 54Some programming language modes have their own variable to control this,
55e.g., `c-tab-always-indent', and do not respect this variable." 55e.g., `c-tab-always-indent', and do not respect this variable."
56 :group 'indent 56 :group 'indent
57 :type '(choice (const nil) (const t) (const always))) 57 :type '(choice (const nil) (const t) (const always)))
diff --git a/lisp/log-view.el b/lisp/log-view.el
index e4f50c15351..bf029045a8c 100644
--- a/lisp/log-view.el
+++ b/lisp/log-view.el
@@ -129,14 +129,15 @@
129(defvar log-view-message-face 'log-view-message) 129(defvar log-view-message-face 'log-view-message)
130 130
131(defconst log-view-file-re 131(defconst log-view-file-re
132 (concat "^\\(?:Working file: \\(.+\\)" ;RCS and CVS. 132 (concat "^\\(?:Working file: \\(?1:.+\\)" ;RCS and CVS.
133 "\\|\\(?:SCCS/s\\.\\|Changes to \\)\\(.+\\):" ;SCCS and Darcs. 133 ;; Subversion has no such thing??
134 "\\|\\(?:SCCS/s\\.\\|Changes to \\)\\(?1:.+\\):" ;SCCS and Darcs.
134 "\\)\n")) ;Include the \n for font-lock reasons. 135 "\\)\n")) ;Include the \n for font-lock reasons.
135 136
136(defconst log-view-message-re 137(defconst log-view-message-re
137 (concat "^\\(?:revision \\([.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS. 138 (concat "^\\(?:revision \\(?1:[.0-9]+\\)\\(?:\t.*\\)?" ; RCS and CVS.
138 "\\|r\\([0-9]+\\) | .* | .*" ; Subversion. 139 "\\|r\\(?1:[0-9]+\\) | .* | .*" ; Subversion.
139 "\\|D \\([.0-9]+\\) .*" ; SCCS. 140 "\\|D \\(?1:[.0-9]+\\) .*" ; SCCS.
140 ;; Darcs doesn't have revision names. VC-darcs uses patch names 141 ;; Darcs doesn't have revision names. VC-darcs uses patch names
141 ;; instead. Darcs patch names are hashcodes, which do not appear 142 ;; instead. Darcs patch names are hashcodes, which do not appear
142 ;; in the log output :-(, but darcs accepts any prefix of the log 143 ;; in the log output :-(, but darcs accepts any prefix of the log
@@ -145,13 +146,12 @@
145 ;; First loosely match the date format. 146 ;; First loosely match the date format.
146 (concat "\\|[^ \n].*[^0-9\n][0-9][0-9]:[0-9][0-9][^0-9\n].*[^ \n]" 147 (concat "\\|[^ \n].*[^0-9\n][0-9][0-9]:[0-9][0-9][^0-9\n].*[^ \n]"
147 ;;Email of user and finally Msg, used as revision name. 148 ;;Email of user and finally Msg, used as revision name.
148 " .*@.*\n\\(?: \\* \\(.*\\)\\)?") 149 " .*@.*\n\\(?: \\* \\(?1:.*\\)\\)?")
149 "\\)$")) 150 "\\)$"))
150 151
151(defconst log-view-font-lock-keywords 152(defconst log-view-font-lock-keywords
152 `((,log-view-file-re 153 `((,log-view-file-re
153 (1 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t) 154 (1 (if (boundp 'cvs-filename-face) cvs-filename-face))
154 (2 (if (boundp 'cvs-filename-face) cvs-filename-face) nil t)
155 (0 log-view-file-face append)) 155 (0 log-view-file-face append))
156 (,log-view-message-re . log-view-message-face))) 156 (,log-view-message-re . log-view-message-face)))
157(defconst log-view-font-lock-defaults 157(defconst log-view-font-lock-defaults
@@ -194,7 +194,7 @@
194 (forward-line 1) 194 (forward-line 1)
195 (or (re-search-backward log-view-file-re nil t) 195 (or (re-search-backward log-view-file-re nil t)
196 (re-search-forward log-view-file-re)) 196 (re-search-forward log-view-file-re))
197 (let* ((file (or (match-string 1) (match-string 2))) 197 (let* ((file (match-string 1))
198 (cvsdir (and (re-search-backward log-view-dir-re nil t) 198 (cvsdir (and (re-search-backward log-view-dir-re nil t)
199 (match-string 1))) 199 (match-string 1)))
200 (pcldir (and (boundp 'cvs-pcl-cvs-dirchange-re) 200 (pcldir (and (boundp 'cvs-pcl-cvs-dirchange-re)
@@ -212,10 +212,7 @@
212 (forward-line 1) 212 (forward-line 1)
213 (let ((pt (point))) 213 (let ((pt (point)))
214 (when (re-search-backward log-view-message-re nil t) 214 (when (re-search-backward log-view-message-re nil t)
215 (let (rev) 215 (let ((rev (match-string 1)))
216 ;; Find the subgroup that matched.
217 (dotimes (i (/ (length (match-data 'integers)) 2))
218 (setq rev (or rev (match-string (1+ i)))))
219 (unless (re-search-forward log-view-file-re pt t) 216 (unless (re-search-forward log-view-file-re pt t)
220 rev)))))) 217 rev))))))
221 218
diff --git a/lisp/mb-depth.el b/lisp/mb-depth.el
new file mode 100644
index 00000000000..256c7ee6a99
--- /dev/null
+++ b/lisp/mb-depth.el
@@ -0,0 +1,72 @@
1;;; mb-depth.el --- Indicate minibuffer-depth in prompt
2;;
3;; Copyright (C) 2006, 2007 Free Software Foundation, Inc.
4;;
5;; Author: Miles Bader <miles@gnu.org>
6;; Keywords: convenience
7
8;; This file is part of GNU Emacs.
9
10;; GNU Emacs is free software; you can redistribute it and/or modify
11;; it under the terms of the GNU General Public License as published by
12;; the Free Software Foundation; either version 2, or (at your option)
13;; any later version.
14
15;; GNU Emacs is distributed in the hope that it will be useful,
16;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;; GNU General Public License for more details.
19
20;; You should have received a copy of the GNU General Public License
21;; along with GNU Emacs; see the file COPYING. If not, write to the
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA.
24
25;;; Commentary:
26;;
27;; Defines the minor mode `minibuffer-indicate-depth-mode'.
28;;
29;; When active, any recursive use of the minibuffer will show
30;; the recursion depth in the minibuffer prompt. This is only
31;; useful if `enable-recursive-minibuffers' is non-nil.
32
33;;; Code:
34
35;; An overlay covering the prompt. This is a buffer-local variable in
36;; each affected minibuffer.
37;;
38(defvar minibuf-depth-overlay)
39(make-variable-buffer-local 'minibuf-depth-overlay)
40
41;; This function goes on minibuffer-setup-hook
42(defun minibuf-depth-setup-minibuffer ()
43 "Set up a minibuffer for `minibuffer-indicate-depth-mode'.
44The prompt should already have been inserted."
45 (when (> (minibuffer-depth) 1)
46 (setq minibuf-depth-overlay (make-overlay (point-min) (1+ (point-min))))
47 (overlay-put minibuf-depth-overlay 'before-string
48 (propertize (format "[%d]" (minibuffer-depth))
49 'face 'highlight))
50 (overlay-put minibuf-depth-overlay 'evaporate t)))
51
52;;;###autoload
53(define-minor-mode minibuffer-indicate-depth-mode
54 "Toggle Minibuffer Indicate Depth mode.
55When active, any recursive use of the minibuffer will show
56the recursion depth in the minibuffer prompt. This is only
57useful if `enable-recursive-minibuffers' is non-nil.
58
59With prefix argument ARG, turn on if positive, otherwise off.
60Returns non-nil if the new state is enabled."
61 :global t
62 :group 'minibuffer
63 (if minibuffer-indicate-depth-mode
64 ;; Enable the mode
65 (add-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer)
66 ;; Disable the mode
67 (remove-hook 'minibuffer-setup-hook 'minibuf-depth-setup-minibuffer)))
68
69(provide 'mb-depth)
70
71;; arch-tag: 50224089-5bf5-46f8-803d-18f018c5eacf
72;;; mb-depth.el ends here
diff --git a/lisp/net/rcirc.el b/lisp/net/rcirc.el
index 60d81aedb7a..04f3fa45ceb 100644
--- a/lisp/net/rcirc.el
+++ b/lisp/net/rcirc.el
@@ -55,9 +55,24 @@
55 :link '(custom-manual "(rcirc)") 55 :link '(custom-manual "(rcirc)")
56 :group 'applications) 56 :group 'applications)
57 57
58(defcustom rcirc-default-server "irc.freenode.net" 58(defcustom rcirc-connections
59 "The default server to connect to." 59 '(("irc.freenode.net" :channels ("#rcirc")))
60 :type 'string 60 "An alist of IRC connections to establish when running `rcirc'.
61Each element looks like (SERVER-NAME PARAMETERS).
62
63SERVER-NAME is a string describing the server to connect
64to.
65
66PARAMETERS is a plist of optional connection parameters. Valid
67properties are: nick (a string), port (number or string),
68user-name (string), full-name (string), and channels (list of
69strings)."
70 :type '(alist :key-type string
71 :value-type (plist :options ((nick string)
72 (port integer)
73 (user-name string)
74 (full-name string)
75 (channels (repeat string)))))
61 :group 'rcirc) 76 :group 'rcirc)
62 77
63(defcustom rcirc-default-port 6667 78(defcustom rcirc-default-port 6667
@@ -82,12 +97,6 @@
82 :type 'string 97 :type 'string
83 :group 'rcirc) 98 :group 'rcirc)
84 99
85(defcustom rcirc-startup-channels-alist '(("^irc.freenode.net$" "#rcirc"))
86 "Alist of channels to join at startup.
87Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
88 :type '(alist :key-type string :value-type (repeat string))
89 :group 'rcirc)
90
91(defcustom rcirc-fill-flag t 100(defcustom rcirc-fill-flag t
92 "*Non-nil means line-wrap messages printed in channel buffers." 101 "*Non-nil means line-wrap messages printed in channel buffers."
93 :type 'boolean 102 :type 'boolean
@@ -95,11 +104,9 @@ Each element looks like (SERVER-REGEXP . CHANNEL-LIST)."
95 104
96(defcustom rcirc-fill-column nil 105(defcustom rcirc-fill-column nil
97 "*Column beyond which automatic line-wrapping should happen. 106 "*Column beyond which automatic line-wrapping should happen.
98If nil, use value of `fill-column'. 107If nil, use value of `fill-column'. If 'frame-width, use the
99If `window-width', use the window's width as maximum. 108maximum frame width."
100If `frame-width', use the frame's width as maximum."
101 :type '(choice (const :tag "Value of `fill-column'") 109 :type '(choice (const :tag "Value of `fill-column'")
102 (const :tag "Full window width" window-width)
103 (const :tag "Full frame width" frame-width) 110 (const :tag "Full frame width" frame-width)
104 (integer :tag "Number of columns")) 111 (integer :tag "Number of columns"))
105 :group 'rcirc) 112 :group 'rcirc)
@@ -120,6 +127,11 @@ underneath each nick."
120 "If non-nil, activity in this buffer is considered low priority.") 127 "If non-nil, activity in this buffer is considered low priority.")
121(make-variable-buffer-local 'rcirc-low-priority-flag) 128(make-variable-buffer-local 'rcirc-low-priority-flag)
122 129
130(defvar rcirc-omit-mode nil
131 "Non-nil if Rcirc-Omit mode is enabled.
132Use the command `rcirc-omit-mode' to change this variable.")
133(make-variable-buffer-local 'rcirc-omit-mode)
134
123(defcustom rcirc-time-format "%H:%M " 135(defcustom rcirc-time-format "%H:%M "
124 "*Describes how timestamps are printed. 136 "*Describes how timestamps are printed.
125Used as the first arg to `format-time-string'." 137Used as the first arg to `format-time-string'."
@@ -145,7 +157,8 @@ number. If zero or nil, no truncating is done."
145 :group 'rcirc) 157 :group 'rcirc)
146 158
147(defcustom rcirc-scroll-show-maximum-output t 159(defcustom rcirc-scroll-show-maximum-output t
148 "*If non-nil, scroll buffer to keep the point at the bottom of the window." 160 "*If non-nil, scroll buffer to keep the point at the bottom of
161the window."
149 :type 'boolean 162 :type 'boolean
150 :group 'rcirc) 163 :group 'rcirc)
151 164
@@ -319,36 +332,69 @@ and the cdr part is used for encoding."
319(defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version)) 332(defconst rcirc-id-string (concat "rcirc on GNU Emacs " emacs-version))
320 333
321(defvar rcirc-startup-channels nil) 334(defvar rcirc-startup-channels nil)
335
322;;;###autoload 336;;;###autoload
323(defun rcirc (arg) 337(defun rcirc (arg)
324 "Connect to IRC. 338 "Connect to all servers in `rcirc-connections'.
325If ARG is non-nil, prompt for a server to connect to." 339
340Do not connect to a server if it is already connected.
341
342If ARG is non-nil, instead prompt for connection parameters."
326 (interactive "P") 343 (interactive "P")
327 (if arg 344 (if arg
328 (let* ((server (read-string "IRC Server: " rcirc-default-server)) 345 (let* ((server (completing-read "IRC Server: "
329 (port (read-string "IRC Port: " (number-to-string rcirc-default-port))) 346 rcirc-connections
330 (nick (read-string "IRC Nick: " rcirc-default-nick)) 347 nil nil
348 (caar rcirc-connections)))
349 (server-plist (cdr (assoc-string server rcirc-connections)))
350 (port (read-string "IRC Port: "
351 (number-to-string
352 (or (plist-get server-plist 'port)
353 rcirc-default-port))))
354 (nick (read-string "IRC Nick: "
355 (or (plist-get server-plist 'nick)
356 rcirc-default-nick)))
331 (channels (split-string 357 (channels (split-string
332 (read-string "IRC Channels: " 358 (read-string "IRC Channels: "
333 (mapconcat 'identity (rcirc-startup-channels server) " ")) 359 (mapconcat 'identity
360 (plist-get server-plist
361 'channels)
362 " "))
334 "[, ]+" t))) 363 "[, ]+" t)))
335 (rcirc-connect server port nick rcirc-default-user-name rcirc-default-user-full-name 364 (rcirc-connect server port nick rcirc-default-user-name
365 rcirc-default-user-full-name
336 channels)) 366 channels))
337 ;; make new connection using defaults unless already connected to 367 ;; connect to servers in `rcirc-connections'
338 ;; the default rcirc-server 368 (let (connected-servers)
339 (let (connected) 369 (dolist (c rcirc-connections)
340 (dolist (p (rcirc-process-list)) 370 (let ((server (car c))
341 (when (string= rcirc-default-server (process-name p)) 371 (port (or (plist-get (cdr c) 'port) rcirc-default-port))
342 (setq connected p))) 372 (nick (or (plist-get (cdr c) 'nick) rcirc-default-nick))
343 (if (not connected) 373 (user-name (or (plist-get (cdr c) 'user-name)
344 (rcirc-connect rcirc-default-server rcirc-default-port 374 rcirc-default-user-name))
345 rcirc-default-nick rcirc-default-user-name 375 (full-name (or (plist-get (cdr c) 'full-name)
346 rcirc-default-user-full-name 376 rcirc-default-user-full-name))
347 (rcirc-startup-channels rcirc-default-server)) 377 (channels (plist-get (cdr c) 'channels)))
348 (switch-to-buffer (process-buffer connected)) 378 (when server
349 (message "Connected to %s" 379 (let (connected)
350 (process-contact (get-buffer-process (current-buffer)) 380 (dolist (p (rcirc-process-list))
351 :host)))))) 381 (when (string= server (process-name p))
382 (setq connected p)))
383 (if (not connected)
384 (condition-case e
385 (rcirc-connect server port nick user-name
386 full-name channels)
387 (quit (message "Quit connecting to %s" server)))
388 (with-current-buffer (process-buffer connected)
389 (setq connected-servers
390 (cons (process-contact (get-buffer-process
391 (current-buffer)) :host)
392 connected-servers))))))))
393 (when connected-servers
394 (message "Already connected to %s"
395 (concat (mapconcat 'identity (butlast connected-servers) ", ")
396 ", and " (car (last connected-servers))))))))
397
352;;;###autoload 398;;;###autoload
353(defalias 'irc 'rcirc) 399(defalias 'irc 'rcirc)
354 400
@@ -365,7 +411,8 @@ If ARG is non-nil, prompt for a server to connect to."
365(defvar rcirc-process nil) 411(defvar rcirc-process nil)
366 412
367;;;###autoload 413;;;###autoload
368(defun rcirc-connect (&optional server port nick user-name full-name startup-channels) 414(defun rcirc-connect (server &optional port nick user-name full-name
415 startup-channels)
369 (save-excursion 416 (save-excursion
370 (message "Connecting to %s..." server) 417 (message "Connecting to %s..." server)
371 (let* ((inhibit-eol-conversion) 418 (let* ((inhibit-eol-conversion)
@@ -374,7 +421,6 @@ If ARG is non-nil, prompt for a server to connect to."
374 (string-to-number port) 421 (string-to-number port)
375 port) 422 port)
376 rcirc-default-port)) 423 rcirc-default-port))
377 (server (or server rcirc-default-server))
378 (nick (or nick rcirc-default-nick)) 424 (nick (or nick rcirc-default-nick))
379 (user-name (or user-name rcirc-default-user-name)) 425 (user-name (or user-name rcirc-default-user-name))
380 (full-name (or full-name rcirc-default-user-full-name)) 426 (full-name (or full-name rcirc-default-user-full-name))
@@ -412,6 +458,8 @@ If ARG is non-nil, prompt for a server to connect to."
412 (make-local-variable 'rcirc-connecting) 458 (make-local-variable 'rcirc-connecting)
413 (setq rcirc-connecting t) 459 (setq rcirc-connecting t)
414 460
461 (add-hook 'auto-save-hook 'rcirc-log-write)
462
415 ;; identify 463 ;; identify
416 (rcirc-send-string process (concat "NICK " nick)) 464 (rcirc-send-string process (concat "NICK " nick))
417 (rcirc-send-string process (concat "USER " user-name 465 (rcirc-send-string process (concat "USER " user-name
@@ -446,12 +494,21 @@ last ping."
446 (mapc (lambda (process) 494 (mapc (lambda (process)
447 (with-rcirc-process-buffer process 495 (with-rcirc-process-buffer process
448 (when (not rcirc-connecting) 496 (when (not rcirc-connecting)
449 (rcirc-send-string process (concat "PING " (rcirc-server-name process)))))) 497 (rcirc-send-string process
498 (format "PRIVMSG %s :\C-aKEEPALIVE %f\C-a"
499 rcirc-nick
500 (time-to-seconds
501 (current-time)))))))
450 (rcirc-process-list)) 502 (rcirc-process-list))
451 ;; no processes, clean up timer 503 ;; no processes, clean up timer
452 (cancel-timer rcirc-keepalive-timer) 504 (cancel-timer rcirc-keepalive-timer)
453 (setq rcirc-keepalive-timer nil))) 505 (setq rcirc-keepalive-timer nil)))
454 506
507(defun rcirc-handler-ctcp-KEEPALIVE (process target sender message)
508 (with-rcirc-process-buffer process
509 (setq header-line-format (format "%f" (- (time-to-seconds (current-time))
510 (string-to-number message))))))
511
455(defvar rcirc-debug-buffer " *rcirc debug*") 512(defvar rcirc-debug-buffer " *rcirc debug*")
456(defvar rcirc-debug-flag nil 513(defvar rcirc-debug-flag nil
457 "If non-nil, write information to `rcirc-debug-buffer'.") 514 "If non-nil, write information to `rcirc-debug-buffer'.")
@@ -461,14 +518,13 @@ Debug text is written to `rcirc-debug-buffer' if `rcirc-debug-flag'
461is non-nil." 518is non-nil."
462 (when rcirc-debug-flag 519 (when rcirc-debug-flag
463 (save-excursion 520 (save-excursion
464 (save-window-excursion 521 (set-buffer (get-buffer-create rcirc-debug-buffer))
465 (set-buffer (get-buffer-create rcirc-debug-buffer)) 522 (goto-char (point-max))
466 (goto-char (point-max)) 523 (insert (concat
467 (insert (concat 524 "["
468 "[" 525 (format-time-string "%Y-%m-%dT%T ") (process-name process)
469 (format-time-string "%Y-%m-%dT%T ") (process-name process) 526 "] "
470 "] " 527 text)))))
471 text))))))
472 528
473(defvar rcirc-sentinel-hooks nil 529(defvar rcirc-sentinel-hooks nil
474 "Hook functions called when the process sentinel is called. 530 "Hook functions called when the process sentinel is called.
@@ -486,12 +542,16 @@ Functions are called with PROCESS and SENTINEL arguments.")
486 (process-name process) 542 (process-name process)
487 sentinel 543 sentinel
488 (process-status process)) (not rcirc-target)) 544 (process-status process)) (not rcirc-target))
489 ;; remove the prompt from buffers 545 (rcirc-disconnect-buffer)))
490 (let ((inhibit-read-only t))
491 (delete-region rcirc-prompt-start-marker
492 rcirc-prompt-end-marker))))
493 (run-hook-with-args 'rcirc-sentinel-hooks process sentinel)))) 546 (run-hook-with-args 'rcirc-sentinel-hooks process sentinel))))
494 547
548(defun rcirc-disconnect-buffer (&optional buffer)
549 (with-current-buffer (or buffer (current-buffer))
550 ;; set rcirc-target to nil for each channel so cleanup
551 ;; doesnt happen when we reconnect
552 (setq rcirc-target nil)
553 (setq mode-line-process ":disconnected")))
554
495(defun rcirc-process-list () 555(defun rcirc-process-list ()
496 "Return a list of rcirc processes." 556 "Return a list of rcirc processes."
497 (let (ps) 557 (let (ps)
@@ -593,7 +653,8 @@ With no argument or nil as argument, use the current buffer."
593(defun rcirc-server-name (process) 653(defun rcirc-server-name (process)
594 "Return PROCESS server name, given by the 001 response." 654 "Return PROCESS server name, given by the 001 response."
595 (with-rcirc-process-buffer process 655 (with-rcirc-process-buffer process
596 (or rcirc-server-name rcirc-default-server))) 656 (or rcirc-server-name
657 (warn "server name for process %S unknown" process))))
597 658
598(defun rcirc-nick (process) 659(defun rcirc-nick (process)
599 "Return PROCESS nick." 660 "Return PROCESS nick."
@@ -610,9 +671,10 @@ With no argument or nil as argument, use the current buffer."
610(defvar rcirc-max-message-length 420 671(defvar rcirc-max-message-length 420
611 "Messages longer than this value will be split.") 672 "Messages longer than this value will be split.")
612 673
613(defun rcirc-send-message (process target message &optional noticep) 674(defun rcirc-send-message (process target message &optional noticep silent)
614 "Send TARGET associated with PROCESS a privmsg with text MESSAGE. 675 "Send TARGET associated with PROCESS a privmsg with text MESSAGE.
615If NOTICEP is non-nil, send a notice instead of privmsg." 676If NOTICEP is non-nil, send a notice instead of privmsg.
677If SILENT is non-nil, do not print the message in any irc buffer."
616 ;; max message length is 512 including CRLF 678 ;; max message length is 512 including CRLF
617 (let* ((response (if noticep "NOTICE" "PRIVMSG")) 679 (let* ((response (if noticep "NOTICE" "PRIVMSG"))
618 (oversize (> (length message) rcirc-max-message-length)) 680 (oversize (> (length message) rcirc-max-message-length))
@@ -625,8 +687,9 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
625 (more (if oversize 687 (more (if oversize
626 (substring message rcirc-max-message-length)))) 688 (substring message rcirc-max-message-length))))
627 (rcirc-get-buffer-create process target) 689 (rcirc-get-buffer-create process target)
628 (rcirc-print process (rcirc-nick process) response target text)
629 (rcirc-send-string process (concat response " " target " :" text)) 690 (rcirc-send-string process (concat response " " target " :" text))
691 (unless silent
692 (rcirc-print process (rcirc-nick process) response target text))
630 (when more (rcirc-send-message process target more noticep)))) 693 (when more (rcirc-send-message process target more noticep))))
631 694
632(defvar rcirc-input-ring nil) 695(defvar rcirc-input-ring nil)
@@ -711,7 +774,7 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
711(define-key rcirc-mode-map (kbd "C-c C-d") 'rcirc-cmd-mode) 774(define-key rcirc-mode-map (kbd "C-c C-d") 'rcirc-cmd-mode)
712(define-key rcirc-mode-map (kbd "C-c C-m") 'rcirc-cmd-msg) 775(define-key rcirc-mode-map (kbd "C-c C-m") 'rcirc-cmd-msg)
713(define-key rcirc-mode-map (kbd "C-c C-r") 'rcirc-cmd-nick) ; rename 776(define-key rcirc-mode-map (kbd "C-c C-r") 'rcirc-cmd-nick) ; rename
714(define-key rcirc-mode-map (kbd "C-c C-o") 'rcirc-cmd-oper) 777(define-key rcirc-mode-map (kbd "C-c C-o") 'rcirc-omit-mode)
715(define-key rcirc-mode-map (kbd "C-c C-p") 'rcirc-cmd-part) 778(define-key rcirc-mode-map (kbd "C-c C-p") 'rcirc-cmd-part)
716(define-key rcirc-mode-map (kbd "C-c C-q") 'rcirc-cmd-query) 779(define-key rcirc-mode-map (kbd "C-c C-q") 'rcirc-cmd-query)
717(define-key rcirc-mode-map (kbd "C-c C-t") 'rcirc-cmd-topic) 780(define-key rcirc-mode-map (kbd "C-c C-t") 'rcirc-cmd-topic)
@@ -737,6 +800,10 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
737 800
738(defvar rcirc-last-post-time nil) 801(defvar rcirc-last-post-time nil)
739 802
803(defvar rcirc-log-alist nil
804 "Alist of lines to log to disk when `rcirc-log-flag' is non-nil.
805Each element looks like (FILENAME . TEXT).")
806
740(defun rcirc-mode (process target) 807(defun rcirc-mode (process target)
741 "Major mode for IRC channel buffers. 808 "Major mode for IRC channel buffers.
742 809
@@ -745,6 +812,7 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
745 (use-local-map rcirc-mode-map) 812 (use-local-map rcirc-mode-map)
746 (setq mode-name "rcirc") 813 (setq mode-name "rcirc")
747 (setq major-mode 'rcirc-mode) 814 (setq major-mode 'rcirc-mode)
815 (setq mode-line-process nil)
748 816
749 (make-local-variable 'rcirc-input-ring) 817 (make-local-variable 'rcirc-input-ring)
750 (setq rcirc-input-ring (make-ring rcirc-input-ring-size)) 818 (setq rcirc-input-ring (make-ring rcirc-input-ring-size))
@@ -756,6 +824,8 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
756 (setq rcirc-topic nil) 824 (setq rcirc-topic nil)
757 (make-local-variable 'rcirc-last-post-time) 825 (make-local-variable 'rcirc-last-post-time)
758 (setq rcirc-last-post-time (current-time)) 826 (setq rcirc-last-post-time (current-time))
827 (make-local-variable 'fill-paragraph-function)
828 (setq fill-paragraph-function 'rcirc-fill-paragraph)
759 829
760 (make-local-variable 'rcirc-short-buffer-name) 830 (make-local-variable 'rcirc-short-buffer-name)
761 (setq rcirc-short-buffer-name nil) 831 (setq rcirc-short-buffer-name nil)
@@ -785,6 +855,8 @@ If NOTICEP is non-nil, send a notice instead of privmsg."
785 (setq overlay-arrow-position (make-marker)) 855 (setq overlay-arrow-position (make-marker))
786 (set-marker overlay-arrow-position nil) 856 (set-marker overlay-arrow-position nil)
787 857
858 (setq buffer-invisibility-spec '(rcirc-ignored-user))
859
788 ;; if the user changes the major mode or kills the buffer, there is 860 ;; if the user changes the major mode or kills the buffer, there is
789 ;; cleanup work to do 861 ;; cleanup work to do
790 (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t) 862 (add-hook 'change-major-mode-hook 'rcirc-change-major-mode-hook nil t)
@@ -873,14 +945,16 @@ If ALL is non-nil, update prompts in all IRC buffers."
873 (when rcirc-target 945 (when rcirc-target
874 (rcirc-remove-nick-channel (rcirc-buffer-process) 946 (rcirc-remove-nick-channel (rcirc-buffer-process)
875 (rcirc-buffer-nick) 947 (rcirc-buffer-nick)
876 rcirc-target)))))) 948 rcirc-target))))
949 (setq rcirc-target nil)))
877 950
878(defun rcirc-generate-new-buffer-name (process target) 951(defun rcirc-generate-new-buffer-name (process target)
879 "Return a buffer name based on PROCESS and TARGET. 952 "Return a buffer name based on PROCESS and TARGET.
880This is used for the initial name given to IRC buffers." 953This is used for the initial name given to IRC buffers."
881 (if target 954 (substring-no-properties
882 (concat target "@" (process-name process)) 955 (if target
883 (concat "*" (process-name process) "*"))) 956 (concat target "@" (process-name process))
957 (concat "*" (process-name process) "*"))))
884 958
885(defun rcirc-get-buffer (process target &optional server) 959(defun rcirc-get-buffer (process target &optional server)
886 "Return the buffer associated with the PROCESS and TARGET. 960 "Return the buffer associated with the PROCESS and TARGET.
@@ -902,14 +976,14 @@ Create the buffer if it doesn't exist."
902 (when (not rcirc-target) 976 (when (not rcirc-target)
903 (setq rcirc-target target)) 977 (setq rcirc-target target))
904 buffer) 978 buffer)
905 ;; create the buffer 979 ;; create the buffer
906 (with-rcirc-process-buffer process 980 (with-rcirc-process-buffer process
907 (let ((new-buffer (get-buffer-create 981 (let ((new-buffer (get-buffer-create
908 (rcirc-generate-new-buffer-name process target)))) 982 (rcirc-generate-new-buffer-name process target))))
909 (with-current-buffer new-buffer 983 (with-current-buffer new-buffer
910 (rcirc-mode process target)) 984 (rcirc-mode process target))
911 (rcirc-put-nick-channel process (rcirc-nick process) target) 985 (rcirc-put-nick-channel process (rcirc-nick process) target)
912 new-buffer))))) 986 new-buffer)))))
913 987
914(defun rcirc-send-input () 988(defun rcirc-send-input ()
915 "Send input to target associated with the current buffer." 989 "Send input to target associated with the current buffer."
@@ -943,6 +1017,14 @@ Create the buffer if it doesn't exist."
943 (ring-insert rcirc-input-ring input) 1017 (ring-insert rcirc-input-ring input)
944 (setq rcirc-input-ring-index 0)))))) 1018 (setq rcirc-input-ring-index 0))))))
945 1019
1020(defun rcirc-fill-paragraph (&optional arg)
1021 (interactive "p")
1022 (when (> (point) rcirc-prompt-end-marker)
1023 (save-restriction
1024 (narrow-to-region rcirc-prompt-end-marker (point-max))
1025 (let ((fill-column rcirc-max-message-length))
1026 (fill-region (point-min) (point-max))))))
1027
946(defun rcirc-process-input-line (line) 1028(defun rcirc-process-input-line (line)
947 (if (string-match "^/\\([^ ]+\\) ?\\(.*\\)$" line) 1029 (if (string-match "^/\\([^ ]+\\) ?\\(.*\\)$" line)
948 (rcirc-process-command (match-string 1 line) 1030 (rcirc-process-command (match-string 1 line)
@@ -1021,7 +1103,6 @@ Create the buffer if it doesn't exist."
1021(defun rcirc-multiline-minor-submit () 1103(defun rcirc-multiline-minor-submit ()
1022 "Send the text in buffer back to parent buffer." 1104 "Send the text in buffer back to parent buffer."
1023 (interactive) 1105 (interactive)
1024 (assert rcirc-parent-buffer)
1025 (untabify (point-min) (point-max)) 1106 (untabify (point-min) (point-max))
1026 (let ((text (buffer-substring (point-min) (point-max))) 1107 (let ((text (buffer-substring (point-min) (point-max)))
1027 (buffer (current-buffer)) 1108 (buffer (current-buffer))
@@ -1052,12 +1133,12 @@ Create the buffer if it doesn't exist."
1052 (process-buffer process))))) 1133 (process-buffer process)))))
1053 1134
1054(defcustom rcirc-response-formats 1135(defcustom rcirc-response-formats
1055 '(("PRIVMSG" . "%T<%N> %m") 1136 '(("PRIVMSG" . "<%N> %m")
1056 ("NOTICE" . "%T-%N- %m") 1137 ("NOTICE" . "-%N- %m")
1057 ("ACTION" . "%T[%N %m]") 1138 ("ACTION" . "[%N %m]")
1058 ("COMMAND" . "%T%m") 1139 ("COMMAND" . "%m")
1059 ("ERROR" . "%T%fw!!! %m") 1140 ("ERROR" . "%fw!!! %m")
1060 (t . "%T%fp*** %fs%n %r %m")) 1141 (t . "%fp*** %fs%n %r %m"))
1061 "An alist of formats used for printing responses. 1142 "An alist of formats used for printing responses.
1062The format is looked up using the response-type as a key; 1143The format is looked up using the response-type as a key;
1063if no match is found, the default entry (with a key of `t') is used. 1144if no match is found, the default entry (with a key of `t') is used.
@@ -1069,7 +1150,6 @@ the of the following escape sequences replaced by the described values:
1069 %n The sender's nick 1150 %n The sender's nick
1070 %N The sender's nick (with face `rcirc-my-nick' or `rcirc-other-nick') 1151 %N The sender's nick (with face `rcirc-my-nick' or `rcirc-other-nick')
1071 %r The response-type 1152 %r The response-type
1072 %T The timestamp (with face `rcirc-timestamp')
1073 %t The target 1153 %t The target
1074 %fw Following text uses the face `font-lock-warning-face' 1154 %fw Following text uses the face `font-lock-warning-face'
1075 %fp Following text uses the face `rcirc-server-prefix' 1155 %fp Following text uses the face `rcirc-server-prefix'
@@ -1082,92 +1162,67 @@ the of the following escape sequences replaced by the described values:
1082 :value-type string) 1162 :value-type string)
1083 :group 'rcirc) 1163 :group 'rcirc)
1084 1164
1165(defcustom rcirc-omit-responses
1166 '("JOIN" "PART" "QUIT")
1167 "Responses which will be hidden when `rcirc-omit-mode' is enabled."
1168 :type '(repeat string)
1169 :group 'rcirc)
1170
1085(defun rcirc-format-response-string (process sender response target text) 1171(defun rcirc-format-response-string (process sender response target text)
1086 "Return a nicely-formatted response string, incorporating TEXT 1172 "Return a nicely-formatted response string, incorporating TEXT
1087\(and perhaps other arguments). The specific formatting used 1173\(and perhaps other arguments). The specific formatting used
1088is found by looking up RESPONSE in `rcirc-response-formats'." 1174is found by looking up RESPONSE in `rcirc-response-formats'."
1089 (let ((chunks 1175 (with-temp-buffer
1090 (split-string (or (cdr (assoc response rcirc-response-formats)) 1176 (insert (or (cdr (assoc response rcirc-response-formats))
1091 (cdr (assq t rcirc-response-formats))) 1177 (cdr (assq t rcirc-response-formats))))
1092 "%")) 1178 (goto-char (point-min))
1093 (sender (or sender "")) 1179 (let ((start (point-min))
1094 (result "") 1180 (sender (if (or (not sender)
1095 (face nil) 1181 (string= (rcirc-server-name process) sender))
1096 key face-key repl) 1182 ""
1097 (when (equal (car chunks) "") 1183 sender))
1098 (pop chunks)) 1184 face)
1099 (dolist (chunk chunks) 1185 (while (re-search-forward "%\\(\\(f\\(.\\)\\)\\|\\(.\\)\\)" nil t)
1100 (if (equal chunk "") 1186 (rcirc-add-face start (match-beginning 0) face)
1101 (setq key ?%) 1187 (setq start (match-beginning 0))
1102 (setq key (aref chunk 0)) 1188 (replace-match
1103 (setq chunk (substring chunk 1))) 1189 (case (aref (match-string 1) 0)
1104 (setq repl 1190 (?f (setq face
1105 (cond ((eq key ?%) 1191 (case (string-to-char (match-string 3))
1106 ;; %% -- literal % character 1192 (?w 'font-lock-warning-face)
1107 "%") 1193 (?p 'rcirc-server-prefix)
1108 ((or (eq key ?n) (eq key ?N)) 1194 (?s 'rcirc-server)
1109 ;; %n/%N -- nick 1195 (t nil)))
1110 (let ((nick (concat (if (string= (rcirc-server-name process) 1196 "")
1111 sender) 1197 (?n sender)
1112 "" 1198 (?N (let ((my-nick (rcirc-nick process)))
1113 sender) 1199 (save-match-data
1114 (and target (concat "," target))))) 1200 (with-syntax-table rcirc-nick-syntax-table
1115 (rcirc-facify nick 1201 (rcirc-facify sender
1116 (if (eq key ?n) 1202 (cond ((string= sender my-nick)
1117 face 1203 'rcirc-my-nick)
1118 (cond ((string= sender (rcirc-nick process)) 1204 ((and rcirc-bright-nicks
1119 'rcirc-my-nick) 1205 (string-match
1120 ((and rcirc-bright-nicks 1206 (regexp-opt rcirc-bright-nicks
1121 (string-match 1207 'words)
1122 (regexp-opt rcirc-bright-nicks) 1208 sender))
1123 sender)) 1209 'rcirc-bright-nick)
1124 'rcirc-bright-nick) 1210 ((and rcirc-dim-nicks
1125 ((and rcirc-dim-nicks 1211 (string-match
1126 (string-match 1212 (regexp-opt rcirc-dim-nicks
1127 (regexp-opt rcirc-dim-nicks) 1213 'words)
1128 sender)) 1214 sender))
1129 'rcirc-dim-nick) 1215 'rcirc-dim-nick)
1130 (t 1216 (t
1131 'rcirc-other-nick)))))) 1217 'rcirc-other-nick)))))))
1132 ((eq key ?T) 1218 (?m (propertize text 'rcirc-text text))
1133 ;; %T -- timestamp 1219 (?r response)
1134 (rcirc-facify 1220 (?t (or target ""))
1135 (format-time-string rcirc-time-format (current-time)) 1221 (t (concat "UNKNOWN CODE:" (match-string 0))))
1136 'rcirc-timestamp)) 1222 t t nil 0)
1137 ((eq key ?m) 1223 (rcirc-add-face (match-beginning 0) (match-end 0) face))
1138 ;; %m -- message text 1224 (rcirc-add-face start (match-beginning 0) face))
1139 (rcirc-markup-text process sender response (rcirc-facify text face))) 1225 (buffer-substring (point-min) (point-max))))
1140 ((eq key ?t)
1141 ;; %t -- target
1142 (rcirc-facify (or rcirc-target "") face))
1143 ((eq key ?r)
1144 ;; %r -- response
1145 (rcirc-facify response face))
1146 ((eq key ?f)
1147 ;; %f -- change face
1148 (setq face-key (aref chunk 0))
1149 (setq chunk (substring chunk 1))
1150 (cond ((eq face-key ?w)
1151 ;; %fw -- warning face
1152 (setq face 'font-lock-warning-face))
1153 ((eq face-key ?p)
1154 ;; %fp -- server-prefix face
1155 (setq face 'rcirc-server-prefix))
1156 ((eq face-key ?s)
1157 ;; %fs -- warning face
1158 (setq face 'rcirc-server))
1159 ((eq face-key ?-)
1160 ;; %fs -- warning face
1161 (setq face nil))
1162 ((and (eq face-key ?\[)
1163 (string-match "^\\([^]]*\\)[]]" chunk)
1164 (facep (match-string 1 chunk)))
1165 ;; %f[...] -- named face
1166 (setq face (intern (match-string 1 chunk)))
1167 (setq chunk (substring chunk (match-end 0)))))
1168 "")))
1169 (setq result (concat result repl (rcirc-facify chunk face))))
1170 result))
1171 1226
1172(defun rcirc-target-buffer (process sender response target text) 1227(defun rcirc-target-buffer (process sender response target text)
1173 "Return a buffer to print the server response." 1228 "Return a buffer to print the server response."
@@ -1177,7 +1232,8 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
1177 (rcirc-any-buffer process)) 1232 (rcirc-any-buffer process))
1178 ((not (rcirc-channel-p target)) 1233 ((not (rcirc-channel-p target))
1179 ;; message from another user 1234 ;; message from another user
1180 (if (string= response "PRIVMSG") 1235 (if (or (string= response "PRIVMSG")
1236 (string= response "ACTION"))
1181 (rcirc-get-buffer-create process (if (string= sender rcirc-nick) 1237 (rcirc-get-buffer-create process (if (string= sender rcirc-nick)
1182 target 1238 target
1183 sender)) 1239 sender))
@@ -1190,6 +1246,17 @@ is found by looking up RESPONSE in `rcirc-response-formats'."
1190(defvar rcirc-last-sender nil) 1246(defvar rcirc-last-sender nil)
1191(make-variable-buffer-local 'rcirc-last-sender) 1247(make-variable-buffer-local 'rcirc-last-sender)
1192 1248
1249(defcustom rcirc-log-directory "~/.emacs.d/rcirc-log"
1250 "Directory to keep IRC logfiles."
1251 :type 'directory
1252 :group 'rcirc)
1253
1254(defcustom rcirc-log-flag nil
1255 "Non-nil means log IRC activity to disk.
1256Logfiles are kept in `rcirc-log-directory'."
1257 :type 'boolean
1258 :group 'rcirc)
1259
1193(defun rcirc-print (process sender response target text &optional activity) 1260(defun rcirc-print (process sender response target text &optional activity)
1194 "Print TEXT in the buffer associated with TARGET. 1261 "Print TEXT in the buffer associated with TARGET.
1195Format based on SENDER and RESPONSE. If ACTIVITY is non-nil, 1262Format based on SENDER and RESPONSE. If ACTIVITY is non-nil,
@@ -1212,7 +1279,8 @@ record activity."
1212 (setq text (decode-coding-string text rcirc-decode-coding-system)) 1279 (setq text (decode-coding-string text rcirc-decode-coding-system))
1213 ;; mark the line with overlay arrow 1280 ;; mark the line with overlay arrow
1214 (unless (or (marker-position overlay-arrow-position) 1281 (unless (or (marker-position overlay-arrow-position)
1215 (get-buffer-window (current-buffer))) 1282 (get-buffer-window (current-buffer))
1283 (member response rcirc-omit-responses))
1216 (set-marker overlay-arrow-position 1284 (set-marker overlay-arrow-position
1217 (marker-position rcirc-prompt-start-marker)))) 1285 (marker-position rcirc-prompt-start-marker))))
1218 1286
@@ -1222,44 +1290,40 @@ record activity."
1222 (set-marker-insertion-type rcirc-prompt-start-marker t) 1290 (set-marker-insertion-type rcirc-prompt-start-marker t)
1223 (set-marker-insertion-type rcirc-prompt-end-marker t) 1291 (set-marker-insertion-type rcirc-prompt-end-marker t)
1224 1292
1225 (let ((fmted-text 1293 (let ((start (point)))
1226 (rcirc-format-response-string process sender response nil 1294 (insert (rcirc-format-response-string process sender response nil
1227 text))) 1295 text)
1228 1296 (propertize "\n" 'hard t))
1229 (insert fmted-text (propertize "\n" 'hard t)) 1297
1230 (set-marker-insertion-type rcirc-prompt-start-marker nil) 1298 ;; squeeze spaces out of text before rcirc-text
1231 (set-marker-insertion-type rcirc-prompt-end-marker nil) 1299 (fill-region fill-start
1232 1300 (1- (or (next-single-property-change fill-start
1233 (let ((text-start (make-marker))) 1301 'rcirc-text)
1234 (set-marker text-start 1302 rcirc-prompt-end-marker)))
1235 (or (next-single-property-change fill-start 1303
1236 'rcirc-text) 1304 ;; run markup functions
1237 rcirc-prompt-end-marker)) 1305 (save-excursion
1238 ;; squeeze spaces out of text before rcirc-text 1306 (save-restriction
1239 (fill-region fill-start (1- text-start)) 1307 (narrow-to-region start rcirc-prompt-start-marker)
1240 1308 (goto-char (or (next-single-property-change start 'rcirc-text)
1241 ;; fill the text we just inserted, maybe 1309 (point)))
1242 (when (and rcirc-fill-flag 1310 (when (rcirc-buffer-process)
1243 (not (string= response "372"))) ;/motd 1311 (save-excursion (rcirc-markup-timestamp sender response))
1244 (let ((fill-prefix 1312 (dolist (fn rcirc-markup-text-functions)
1245 (or rcirc-fill-prefix 1313 (save-excursion (funcall fn sender response)))
1246 (make-string (- text-start fill-start) ?\s))) 1314 (save-excursion (rcirc-markup-fill sender response)))
1247 (fill-column (cond ((eq rcirc-fill-column 'frame-width) 1315
1248 (1- (frame-width))) 1316 (when rcirc-read-only-flag
1249 ((eq rcirc-fill-column 'window-width) 1317 (add-text-properties (point-min) (point-max)
1250 (1- (window-width))) 1318 '(read-only t front-sticky t))))
1251 (rcirc-fill-column 1319 ;; make text omittable
1252 rcirc-fill-column) 1320 (when (and (member response rcirc-omit-responses)
1253 (t fill-column)))) 1321 (> start (point-min)))
1254 (fill-region fill-start rcirc-prompt-start-marker 'left t))))) 1322 (put-text-property (1- start) (1- rcirc-prompt-start-marker)
1255 1323 'invisible 'rcirc-omit))))
1256 ;; set inserted text to be read-only 1324
1257 (when rcirc-read-only-flag 1325 (set-marker-insertion-type rcirc-prompt-start-marker nil)
1258 (put-text-property rcirc-prompt-start-marker fill-start 'read-only t) 1326 (set-marker-insertion-type rcirc-prompt-end-marker nil)
1259 (let ((inhibit-read-only t))
1260 (put-text-property rcirc-prompt-start-marker fill-start
1261 'front-sticky t)
1262 (put-text-property (1- (point)) (point) 'rear-nonsticky t)))
1263 1327
1264 ;; truncate buffer if it is very long 1328 ;; truncate buffer if it is very long
1265 (save-excursion 1329 (save-excursion
@@ -1275,27 +1339,26 @@ record activity."
1275 (window-buffer w)) 1339 (window-buffer w))
1276 (>= (window-point w) 1340 (>= (window-point w)
1277 rcirc-prompt-end-marker)) 1341 rcirc-prompt-end-marker))
1278 (set-window-point w (point-max)))) 1342 (set-window-point w (point-max))))
1279 nil t) 1343 nil t)
1280 1344
1281 ;; restore the point 1345 ;; restore the point
1282 (goto-char (if moving rcirc-prompt-end-marker old-point)) 1346 (goto-char (if moving rcirc-prompt-end-marker old-point))
1283 1347
1284 ;; keep window on bottom line if it was already there 1348 ;; keep window on bottom line if it was already there
1285 (when rcirc-scroll-show-maximum-output 1349 (when rcirc-scroll-show-maximum-output
1286 (walk-windows (lambda (w) 1350 (walk-windows (lambda (w)
1287 (when (eq (window-buffer w) (current-buffer)) 1351 (when (eq (window-buffer w) (current-buffer))
1288 (with-current-buffer (window-buffer w) 1352 (with-current-buffer (window-buffer w)
1289 (when (eq major-mode 'rcirc-mode) 1353 (when (eq major-mode 'rcirc-mode)
1290 (with-selected-window w 1354 (with-selected-window w
1291 (when (<= (- (window-height) 1355 (when (<= (- (window-height)
1292 (count-screen-lines 1356 (count-screen-lines (window-point)
1293 (window-point) 1357 (window-start))
1294 (window-start))
1295 1) 1358 1)
1296 0) 1359 0)
1297 (recenter -1))))))) 1360 (recenter -1)))))))
1298 nil t)) 1361 nil t))
1299 1362
1300 ;; flush undo (can we do something smarter here?) 1363 ;; flush undo (can we do something smarter here?)
1301 (buffer-disable-undo) 1364 (buffer-disable-undo)
@@ -1305,22 +1368,45 @@ record activity."
1305 (when (and activity 1368 (when (and activity
1306 (not rcirc-ignore-buffer-activity-flag) 1369 (not rcirc-ignore-buffer-activity-flag)
1307 (not (and rcirc-dim-nicks sender 1370 (not (and rcirc-dim-nicks sender
1308 (string-match (regexp-opt rcirc-dim-nicks) sender)))) 1371 (string-match (regexp-opt rcirc-dim-nicks) sender)
1372 (rcirc-channel-p target))))
1309 (rcirc-record-activity (current-buffer) 1373 (rcirc-record-activity (current-buffer)
1310 (when (not (rcirc-channel-p rcirc-target)) 1374 (when (not (rcirc-channel-p rcirc-target))
1311 'nick))) 1375 'nick)))
1312 1376
1377 (when rcirc-log-flag
1378 (rcirc-log process sender response target text))
1379
1313 (sit-for 0) ; displayed text before hook 1380 (sit-for 0) ; displayed text before hook
1314 (run-hook-with-args 'rcirc-print-hooks 1381 (run-hook-with-args 'rcirc-print-hooks
1315 process sender response target text))))) 1382 process sender response target text)))))
1316 1383
1317(defun rcirc-startup-channels (server) 1384(defun rcirc-log (process sender response target text)
1318 "Return the list of startup channels for SERVER." 1385 "Record line in `rcirc-log', to be later written to disk."
1319 (let (channels) 1386 (let* ((filename (rcirc-generate-new-buffer-name process target))
1320 (dolist (i rcirc-startup-channels-alist) 1387 (cell (assoc-string filename rcirc-log-alist))
1321 (if (string-match (car i) server) 1388 (line (concat (format-time-string rcirc-time-format)
1322 (setq channels (append channels (cdr i))))) 1389 (substring-no-properties
1323 channels)) 1390 (rcirc-format-response-string process sender
1391 response target text))
1392 "\n")))
1393 (if cell
1394 (setcdr cell (concat (cdr cell) line))
1395 (setq rcirc-log-alist
1396 (cons (cons filename line) rcirc-log-alist)))))
1397
1398(defun rcirc-log-write ()
1399 "Flush `rcirc-log-alist' data to disk.
1400
1401Log data is written to `rcirc-log-directory'."
1402 (make-directory rcirc-log-directory t)
1403 (dolist (cell rcirc-log-alist)
1404 (with-temp-buffer
1405 (insert (cdr cell))
1406 (write-region (point-min) (point-max)
1407 (concat rcirc-log-directory "/" (car cell))
1408 t 'quiet)))
1409 (setq rcirc-log-alist nil))
1324 1410
1325(defun rcirc-join-channels (process channels) 1411(defun rcirc-join-channels (process channels)
1326 "Join CHANNELS." 1412 "Join CHANNELS."
@@ -1437,6 +1523,9 @@ if NICK is also on `rcirc-ignore-list-automatic'."
1437(or (assq 'rcirc-low-priority-flag minor-mode-alist) 1523(or (assq 'rcirc-low-priority-flag minor-mode-alist)
1438 (setq minor-mode-alist 1524 (setq minor-mode-alist
1439 (cons '(rcirc-low-priority-flag " LowPri") minor-mode-alist))) 1525 (cons '(rcirc-low-priority-flag " LowPri") minor-mode-alist)))
1526(or (assq 'rcirc-omit-mode minor-mode-alist)
1527 (setq minor-mode-alist
1528 (cons '(rcirc-omit-mode " Omit") minor-mode-alist)))
1440 1529
1441(defun rcirc-toggle-ignore-buffer-activity () 1530(defun rcirc-toggle-ignore-buffer-activity ()
1442 "Toggle the value of `rcirc-ignore-buffer-activity-flag'." 1531 "Toggle the value of `rcirc-ignore-buffer-activity-flag'."
@@ -1458,48 +1547,59 @@ if NICK is also on `rcirc-ignore-list-automatic'."
1458 "Activity in this buffer is normal priority")) 1547 "Activity in this buffer is normal priority"))
1459 (force-mode-line-update)) 1548 (force-mode-line-update))
1460 1549
1461(defvar rcirc-switch-to-buffer-function 'switch-to-buffer 1550(defun rcirc-omit-mode ()
1462 "Function to use when switching buffers. 1551 "Toggle the Rcirc-Omit mode.
1463Possible values are `switch-to-buffer', `pop-to-buffer', and 1552If enabled, \"uninteresting\" lines are not shown.
1464`display-buffer'.") 1553Uninteresting lines are those whose responses are listed in
1554`rcirc-omit-responses'."
1555 (interactive)
1556 (setq rcirc-omit-mode (not rcirc-omit-mode))
1557 (let ((line (1- (count-screen-lines (point) (window-start)))))
1558 (if rcirc-omit-mode
1559 (progn
1560 (add-to-invisibility-spec 'rcirc-omit)
1561 (message "Rcirc-Omit mode enabled"))
1562 (remove-from-invisibility-spec 'rcirc-omit)
1563 (message "Rcirc-Omit mode disabled"))
1564 (recenter line))
1565 (force-mode-line-update))
1465 1566
1466(defun rcirc-switch-to-server-buffer () 1567(defun rcirc-switch-to-server-buffer ()
1467 "Switch to the server buffer associated with current channel buffer." 1568 "Switch to the server buffer associated with current channel buffer."
1468 (interactive) 1569 (interactive)
1469 (funcall rcirc-switch-to-buffer-function rcirc-server-buffer)) 1570 (switch-to-buffer rcirc-server-buffer))
1470 1571
1471(defun rcirc-jump-to-first-unread-line () 1572(defun rcirc-jump-to-first-unread-line ()
1472 "Move the point to the first unread line in this buffer." 1573 "Move the point to the first unread line in this buffer."
1473 (interactive) 1574 (interactive)
1474 (when (marker-position overlay-arrow-position) 1575 (if (marker-position overlay-arrow-position)
1475 (goto-char overlay-arrow-position))) 1576 (goto-char overlay-arrow-position)
1476 1577 (message "No unread messages")))
1477(defvar rcirc-last-non-irc-buffer nil 1578
1478 "The buffer to switch to when there is no more activity.") 1579(defun rcirc-non-irc-buffer ()
1580 (let ((buflist (buffer-list))
1581 buffer)
1582 (while (and buflist (not buffer))
1583 (with-current-buffer (car buflist)
1584 (unless (or (eq major-mode 'rcirc-mode)
1585 (= ?\s (aref (buffer-name) 0)) ; internal buffers
1586 (get-buffer-window (current-buffer)))
1587 (setq buffer (current-buffer))))
1588 (setq buflist (cdr buflist)))
1589 buffer))
1479 1590
1480(defun rcirc-next-active-buffer (arg) 1591(defun rcirc-next-active-buffer (arg)
1481 "Go to the next rcirc buffer with activity. 1592 "Switch to the next rcirc buffer with activity.
1482With prefix ARG, go to the next low priority buffer with activity. 1593With prefix ARG, go to the next low priority buffer with activity."
1483The function given by `rcirc-switch-to-buffer-function' is used to
1484show the buffer."
1485 (interactive "P") 1594 (interactive "P")
1486 (let* ((pair (rcirc-split-activity rcirc-activity)) 1595 (let* ((pair (rcirc-split-activity rcirc-activity))
1487 (lopri (car pair)) 1596 (lopri (car pair))
1488 (hipri (cdr pair))) 1597 (hipri (cdr pair)))
1489 (if (or (and (not arg) hipri) 1598 (if (or (and (not arg) hipri)
1490 (and arg lopri)) 1599 (and arg lopri))
1491 (progn 1600 (switch-to-buffer (car (if arg lopri hipri)) t)
1492 (unless (eq major-mode 'rcirc-mode)
1493 (setq rcirc-last-non-irc-buffer (current-buffer)))
1494 (funcall rcirc-switch-to-buffer-function
1495 (car (if arg lopri hipri))))
1496 (if (eq major-mode 'rcirc-mode) 1601 (if (eq major-mode 'rcirc-mode)
1497 (if (not (and rcirc-last-non-irc-buffer 1602 (switch-to-buffer (rcirc-non-irc-buffer))
1498 (buffer-live-p rcirc-last-non-irc-buffer)))
1499 (message "No IRC activity. Start something.")
1500 (message "No more IRC activity. Go back to work.")
1501 (funcall rcirc-switch-to-buffer-function rcirc-last-non-irc-buffer)
1502 (setq rcirc-last-non-irc-buffer nil))
1503 (message (concat 1603 (message (concat
1504 "No IRC activity." 1604 "No IRC activity."
1505 (when lopri 1605 (when lopri
@@ -1518,15 +1618,19 @@ activity. Only run if the buffer is not visible and
1518(defun rcirc-record-activity (buffer &optional type) 1618(defun rcirc-record-activity (buffer &optional type)
1519 "Record BUFFER activity with TYPE." 1619 "Record BUFFER activity with TYPE."
1520 (with-current-buffer buffer 1620 (with-current-buffer buffer
1521 (when (not (get-buffer-window (current-buffer) t)) 1621 (let ((old-activity rcirc-activity)
1522 (setq rcirc-activity 1622 (old-types rcirc-activity-types))
1523 (sort (add-to-list 'rcirc-activity (current-buffer)) 1623 (when (not (get-buffer-window (current-buffer) t))
1524 (lambda (b1 b2) 1624 (setq rcirc-activity
1525 (let ((t1 (with-current-buffer b1 rcirc-last-post-time)) 1625 (sort (add-to-list 'rcirc-activity (current-buffer))
1526 (t2 (with-current-buffer b2 rcirc-last-post-time))) 1626 (lambda (b1 b2)
1527 (time-less-p t2 t1))))) 1627 (let ((t1 (with-current-buffer b1 rcirc-last-post-time))
1528 (pushnew type rcirc-activity-types) 1628 (t2 (with-current-buffer b2 rcirc-last-post-time)))
1529 (rcirc-update-activity-string))) 1629 (time-less-p t2 t1)))))
1630 (pushnew type rcirc-activity-types)
1631 (unless (and (equal rcirc-activity old-activity)
1632 (member type old-types))
1633 (rcirc-update-activity-string)))))
1530 (run-hook-with-args 'rcirc-activity-hooks buffer)) 1634 (run-hook-with-args 'rcirc-activity-hooks buffer))
1531 1635
1532(defun rcirc-clear-activity (buffer) 1636(defun rcirc-clear-activity (buffer)
@@ -1535,6 +1639,12 @@ activity. Only run if the buffer is not visible and
1535 (with-current-buffer buffer 1639 (with-current-buffer buffer
1536 (setq rcirc-activity-types nil))) 1640 (setq rcirc-activity-types nil)))
1537 1641
1642(defun rcirc-clear-unread (buffer)
1643 "Erase the last read message arrow from BUFFER."
1644 (when (buffer-live-p buffer)
1645 (with-current-buffer buffer
1646 (set-marker overlay-arrow-position nil))))
1647
1538(defun rcirc-split-activity (activity) 1648(defun rcirc-split-activity (activity)
1539 "Return a cons cell with ACTIVITY split into (lopri . hipri)." 1649 "Return a cons cell with ACTIVITY split into (lopri . hipri)."
1540 (let (lopri hipri) 1650 (let (lopri hipri)
@@ -1546,6 +1656,9 @@ activity. Only run if the buffer is not visible and
1546 (add-to-list 'hipri buf t)))) 1656 (add-to-list 'hipri buf t))))
1547 (cons lopri hipri))) 1657 (cons lopri hipri)))
1548 1658
1659(defvar rcirc-update-activity-string-hook nil
1660 "Hook run whenever the activity string is updated.")
1661
1549;; TODO: add mouse properties 1662;; TODO: add mouse properties
1550(defun rcirc-update-activity-string () 1663(defun rcirc-update-activity-string ()
1551 "Update mode-line string." 1664 "Update mode-line string."
@@ -1554,19 +1667,18 @@ activity. Only run if the buffer is not visible and
1554 (hipri (cdr pair))) 1667 (hipri (cdr pair)))
1555 (setq rcirc-activity-string 1668 (setq rcirc-activity-string
1556 (cond ((or hipri lopri) 1669 (cond ((or hipri lopri)
1557 (concat "-" 1670 (concat (and hipri "[")
1558 (and hipri "[")
1559 (rcirc-activity-string hipri) 1671 (rcirc-activity-string hipri)
1560 (and hipri lopri ",") 1672 (and hipri lopri ",")
1561 (and lopri 1673 (and lopri
1562 (concat "(" 1674 (concat "("
1563 (rcirc-activity-string lopri) 1675 (rcirc-activity-string lopri)
1564 ")")) 1676 ")"))
1565 (and hipri "]") 1677 (and hipri "]")))
1566 "-"))
1567 ((not (null (rcirc-process-list))) 1678 ((not (null (rcirc-process-list)))
1568 "-[]-") 1679 "[]")
1569 (t ""))))) 1680 (t "[]")))
1681 (run-hooks 'rcirc-update-activity-string-hook)))
1570 1682
1571(defun rcirc-activity-string (buffers) 1683(defun rcirc-activity-string (buffers)
1572 (mapconcat (lambda (b) 1684 (mapconcat (lambda (b)
@@ -1586,33 +1698,47 @@ activity. Only run if the buffer is not visible and
1586 (with-current-buffer buffer 1698 (with-current-buffer buffer
1587 (or rcirc-short-buffer-name (buffer-name)))) 1699 (or rcirc-short-buffer-name (buffer-name))))
1588 1700
1589(defvar rcirc-current-buffer nil) 1701(defun rcirc-visible-buffers ()
1590(defun rcirc-window-configuration-change () 1702 "Return a list of the visible buffers that are in rcirc-mode."
1591 "Go through visible windows and remove buffers from activity list. 1703 (let (acc)
1592Also, clear the overlay arrow if the current buffer is now hidden."
1593 (let ((current-now-hidden t))
1594 (walk-windows (lambda (w) 1704 (walk-windows (lambda (w)
1595 (let ((buf (window-buffer w))) 1705 (with-current-buffer (window-buffer w)
1596 (with-current-buffer buf 1706 (when (eq major-mode 'rcirc-mode)
1597 (when (eq major-mode 'rcirc-mode) 1707 (push (current-buffer) acc)))))
1598 (rcirc-clear-activity buf))) 1708 acc))
1599 (when (eq buf rcirc-current-buffer) 1709
1600 (setq current-now-hidden nil))))) 1710(defvar rcirc-visible-buffers nil)
1601 ;; add overlay arrow if the buffer isn't displayed 1711(defun rcirc-window-configuration-change ()
1602 (when (and current-now-hidden 1712 (unless (minibuffer-window-active-p (minibuffer-window))
1603 rcirc-current-buffer 1713 ;; delay this until command has finished to make sure window is
1604 (buffer-live-p rcirc-current-buffer)) 1714 ;; actually visible before clearing activity
1605 (with-current-buffer rcirc-current-buffer 1715 (add-hook 'post-command-hook 'rcirc-window-configuration-change-1)))
1606 (when (and (eq major-mode 'rcirc-mode) 1716
1607 (marker-position overlay-arrow-position)) 1717(defun rcirc-window-configuration-change-1 ()
1608 (set-marker overlay-arrow-position nil))))) 1718 ;; clear activity and overlay arrows
1609 1719 (let* ((old-activity rcirc-activity)
1610 ;; remove any killed buffers from list 1720 (hidden-buffers rcirc-visible-buffers))
1611 (setq rcirc-activity 1721
1612 (delq nil (mapcar (lambda (buf) (when (buffer-live-p buf) buf)) 1722 (setq rcirc-visible-buffers (rcirc-visible-buffers))
1613 rcirc-activity))) 1723
1614 (rcirc-update-activity-string) 1724 (dolist (vbuf rcirc-visible-buffers)
1615 (setq rcirc-current-buffer (current-buffer))) 1725 (setq hidden-buffers (delq vbuf hidden-buffers))
1726 ;; clear activity for all visible buffers
1727 (rcirc-clear-activity vbuf))
1728
1729 ;; clear unread arrow from recently hidden buffers
1730 (dolist (hbuf hidden-buffers)
1731 (rcirc-clear-unread hbuf))
1732
1733 ;; remove any killed buffers from list
1734 (setq rcirc-activity
1735 (delq nil (mapcar (lambda (buf) (when (buffer-live-p buf) buf))
1736 rcirc-activity)))
1737 ;; update the mode-line string
1738 (unless (equal old-activity rcirc-activity)
1739 (rcirc-update-activity-string)))
1740
1741 (remove-hook 'post-command-hook 'rcirc-window-configuration-change-1))
1616 1742
1617 1743
1618;;; buffer name abbreviation 1744;;; buffer name abbreviation
@@ -1722,8 +1848,9 @@ Also, clear the overlay arrow if the current buffer is now hidden."
1722 (car (split-string channel))))) 1848 (car (split-string channel)))))
1723 (rcirc-send-string process (concat "JOIN " channel)) 1849 (rcirc-send-string process (concat "JOIN " channel))
1724 (when (not (eq (selected-window) (minibuffer-window))) 1850 (when (not (eq (selected-window) (minibuffer-window)))
1725 (funcall rcirc-switch-to-buffer-function buffer)))) 1851 (switch-to-buffer buffer))))
1726 1852
1853;; TODO: /part #channel reason, or consider removing #channel altogether
1727(defun-rcirc-command part (channel) 1854(defun-rcirc-command part (channel)
1728 "Part CHANNEL." 1855 "Part CHANNEL."
1729 (interactive "sPart channel: ") 1856 (interactive "sPart channel: ")
@@ -1902,7 +2029,7 @@ keywords when no KEYWORD is given."
1902 word-boundary)) 2029 word-boundary))
1903 (optional 2030 (optional
1904 (and "/" 2031 (and "/"
1905 (1+ (char "-a-zA-Z0-9_=!?#$\@~`%&*+|\\/:;.,{}[]()")) 2032 (1+ (char "-a-zA-Z0-9_='!?#$\@~`%&*+|\\/:;.,{}[]()"))
1906 (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()"))))) 2033 (char "-a-zA-Z0-9_=#$\@~`%&*+|\\/:;{}[]()")))))
1907 "Regexp matching URLs. Set to nil to disable URL features in rcirc.") 2034 "Regexp matching URLs. Set to nil to disable URL features in rcirc.")
1908 2035
@@ -1932,38 +2059,25 @@ keywords when no KEYWORD is given."
1932 2059
1933 2060
1934(defvar rcirc-markup-text-functions 2061(defvar rcirc-markup-text-functions
1935 '(rcirc-markup-body-text 2062 '(rcirc-markup-attributes
1936 rcirc-markup-attributes
1937 rcirc-markup-my-nick 2063 rcirc-markup-my-nick
1938 rcirc-markup-urls 2064 rcirc-markup-urls
1939 rcirc-markup-keywords 2065 rcirc-markup-keywords
1940 rcirc-markup-bright-nicks) 2066 rcirc-markup-bright-nicks
2067 rcirc-markup-fill)
2068
1941 "List of functions used to manipulate text before it is printed. 2069 "List of functions used to manipulate text before it is printed.
1942 2070
1943Each function takes three arguments, PROCESS, SENDER, RESPONSE 2071Each function takes two arguments, SENDER, RESPONSE. The buffer
1944and CHANNEL-BUFFER. The current buffer is temporary buffer that 2072is narrowed with the text to be printed and the point is at the
1945contains the text to manipulate. Each function works on the text 2073beginning of the `rcirc-text' propertized text.")
1946in this buffer.")
1947 2074
1948(defun rcirc-markup-text (process sender response text) 2075(defun rcirc-markup-timestamp (sender response)
1949 "Return TEXT with properties added based on various patterns." 2076 (goto-char (point-min))
1950 (let ((channel-buffer (current-buffer))) 2077 (insert (rcirc-facify (format-time-string rcirc-time-format)
1951 (with-temp-buffer 2078 'rcirc-timestamp)))
1952 (insert text)
1953 (goto-char (point-min))
1954 (dolist (fn rcirc-markup-text-functions)
1955 (save-excursion
1956 (funcall fn process sender response channel-buffer)))
1957 (buffer-substring (point-min) (point-max)))))
1958 2079
1959(defun rcirc-markup-body-text (process sender response channel-buffer) 2080(defun rcirc-markup-attributes (sender response)
1960 ;; We add the text property `rcirc-text' to identify this as the
1961 ;; body text.
1962 (add-text-properties (point-min) (point-max)
1963 (list 'rcirc-text (buffer-substring-no-properties
1964 (point-min) (point-max)))))
1965
1966(defun rcirc-markup-attributes (process sender response channel-buffer)
1967 (while (re-search-forward "\\([\C-b\C-_\C-v]\\).*?\\(\\1\\|\C-o\\)" nil t) 2081 (while (re-search-forward "\\([\C-b\C-_\C-v]\\).*?\\(\\1\\|\C-o\\)" nil t)
1968 (rcirc-add-face (match-beginning 0) (match-end 0) 2082 (rcirc-add-face (match-beginning 0) (match-end 0)
1969 (case (char-after (match-beginning 1)) 2083 (case (char-after (match-beginning 1))
@@ -1979,19 +2093,21 @@ in this buffer.")
1979 (while (re-search-forward "\C-o+" nil t) 2093 (while (re-search-forward "\C-o+" nil t)
1980 (delete-region (match-beginning 0) (match-end 0)))) 2094 (delete-region (match-beginning 0) (match-end 0))))
1981 2095
1982(defun rcirc-markup-my-nick (process sender response channel-buffer) 2096(defun rcirc-markup-my-nick (sender response)
1983 (with-syntax-table rcirc-nick-syntax-table 2097 (with-syntax-table rcirc-nick-syntax-table
1984 (while (re-search-forward (concat "\\b" 2098 (while (re-search-forward (concat "\\b"
1985 (regexp-quote (rcirc-nick process)) 2099 (regexp-quote (rcirc-nick
2100 (rcirc-buffer-process)))
1986 "\\b") 2101 "\\b")
1987 nil t) 2102 nil t)
1988 (rcirc-add-face (match-beginning 0) (match-end 0) 2103 (rcirc-add-face (match-beginning 0) (match-end 0)
1989 'rcirc-nick-in-message) 2104 'rcirc-nick-in-message)
1990 (when (string= response "PRIVMSG") 2105 (when (string= response "PRIVMSG")
1991 (rcirc-add-face (point-min) (point-max) 'rcirc-nick-in-message-full-line) 2106 (rcirc-add-face (point-min) (point-max)
1992 (rcirc-record-activity channel-buffer 'nick))))) 2107 'rcirc-nick-in-message-full-line)
2108 (rcirc-record-activity (current-buffer) 'nick)))))
1993 2109
1994(defun rcirc-markup-urls (process sender response channel-buffer) 2110(defun rcirc-markup-urls (sender response)
1995 (while (re-search-forward rcirc-url-regexp nil t) 2111 (while (re-search-forward rcirc-url-regexp nil t)
1996 (let ((start (match-beginning 0)) 2112 (let ((start (match-beginning 0))
1997 (end (match-end 0))) 2113 (end (match-end 0)))
@@ -1999,30 +2115,41 @@ in this buffer.")
1999 (add-text-properties start end (list 'mouse-face 'highlight 2115 (add-text-properties start end (list 'mouse-face 'highlight
2000 'keymap rcirc-browse-url-map)) 2116 'keymap rcirc-browse-url-map))
2001 ;; record the url 2117 ;; record the url
2002 (let ((url (buffer-substring-no-properties start end))) 2118 (push (buffer-substring-no-properties start end) rcirc-urls))))
2003 (with-current-buffer channel-buffer 2119
2004 (push url rcirc-urls)))))) 2120(defun rcirc-markup-keywords (sender response)
2005 2121 (when (and (string= response "PRIVMSG")
2006(defun rcirc-markup-keywords (process sender response channel-buffer) 2122 (not (string= sender (rcirc-nick (rcirc-buffer-process)))))
2007 (let* ((target (with-current-buffer channel-buffer (or rcirc-target ""))) 2123 (let* ((target (or rcirc-target ""))
2008 (keywords (delq nil (mapcar (lambda (keyword) 2124 (keywords (delq nil (mapcar (lambda (keyword)
2009 (when (not (string-match keyword target)) 2125 (when (not (string-match keyword
2010 keyword)) 2126 target))
2011 rcirc-keywords)))) 2127 keyword))
2012 (when keywords 2128 rcirc-keywords))))
2013 (while (re-search-forward (regexp-opt keywords 'words) nil t) 2129 (when keywords
2014 (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword) 2130 (while (re-search-forward (regexp-opt keywords 'words) nil t)
2015 (when (and (string= response "PRIVMSG") 2131 (rcirc-add-face (match-beginning 0) (match-end 0) 'rcirc-keyword)
2016 (not (string= sender (rcirc-nick process)))) 2132 (rcirc-record-activity (current-buffer) 'keyword))))))
2017 (rcirc-record-activity channel-buffer 'keyword)))))) 2133
2018 2134(defun rcirc-markup-bright-nicks (sender response)
2019(defun rcirc-markup-bright-nicks (process sender response channel-buffer)
2020 (when (and rcirc-bright-nicks 2135 (when (and rcirc-bright-nicks
2021 (string= response "NAMES")) 2136 (string= response "NAMES"))
2022 (with-syntax-table rcirc-nick-syntax-table 2137 (with-syntax-table rcirc-nick-syntax-table
2023 (while (re-search-forward (regexp-opt rcirc-bright-nicks 'words) nil t) 2138 (while (re-search-forward (regexp-opt rcirc-bright-nicks 'words) nil t)
2024 (rcirc-add-face (match-beginning 0) (match-end 0) 2139 (rcirc-add-face (match-beginning 0) (match-end 0)
2025 'rcirc-bright-nick))))) 2140 'rcirc-bright-nick)))))
2141
2142(defun rcirc-markup-fill (sender response)
2143 (when (not (string= response "372")) ; /motd
2144 (let ((fill-prefix
2145 (or rcirc-fill-prefix
2146 (make-string (- (point) (line-beginning-position)) ?\s)))
2147 (fill-column (cond ((eq rcirc-fill-column 'frame-width)
2148 (1- (frame-width)))
2149 (rcirc-fill-column
2150 rcirc-fill-column)
2151 (t fill-column))))
2152 (fill-region (point) (point-max) nil t))))
2026 2153
2027;;; handlers 2154;;; handlers
2028;; these are called with the server PROCESS, the SENDER, which is a 2155;; these are called with the server PROCESS, the SENDER, which is a
@@ -2099,8 +2226,7 @@ in this buffer.")
2099 ;; if the buffer is still around, make it inactive 2226 ;; if the buffer is still around, make it inactive
2100 (let ((buffer (rcirc-get-buffer process channel))) 2227 (let ((buffer (rcirc-get-buffer process channel)))
2101 (when buffer 2228 (when buffer
2102 (with-current-buffer buffer 2229 (rcirc-disconnect-buffer buffer)))))
2103 (setq rcirc-target nil))))))
2104 2230
2105(defun rcirc-handler-PART (process sender args text) 2231(defun rcirc-handler-PART (process sender args text)
2106 (let* ((channel (car args)) 2232 (let* ((channel (car args))
@@ -2169,7 +2295,7 @@ in this buffer.")
2169 (when rcirc-auto-authenticate-flag (rcirc-authenticate)))))) 2295 (when rcirc-auto-authenticate-flag (rcirc-authenticate))))))
2170 2296
2171(defun rcirc-handler-PING (process sender args text) 2297(defun rcirc-handler-PING (process sender args text)
2172 (rcirc-send-string process (concat "PONG " (car args)))) 2298 (rcirc-send-string process (concat "PONG :" (car args))))
2173 2299
2174(defun rcirc-handler-PONG (process sender args text) 2300(defun rcirc-handler-PONG (process sender args text)
2175 ;; do nothing 2301 ;; do nothing
@@ -2289,7 +2415,7 @@ Passwords are stored in `rcirc-authinfo' (which see)."
2289 process 2415 process
2290 (concat 2416 (concat
2291 "PRIVMSG chanserv :identify " 2417 "PRIVMSG chanserv :identify "
2292 (cadr args) " " (car args)))) 2418 (car args) " " (cadr args))))
2293 ((equal method 'bitlbee) 2419 ((equal method 'bitlbee)
2294 (rcirc-send-string 2420 (rcirc-send-string
2295 process 2421 process
@@ -2314,7 +2440,8 @@ Passwords are stored in `rcirc-authinfo' (which see)."
2314 (format "%s sent unsupported ctcp: %s" sender text) 2440 (format "%s sent unsupported ctcp: %s" sender text)
2315 t) 2441 t)
2316 (funcall handler process target sender args) 2442 (funcall handler process target sender args)
2317 (if (not (string= request "ACTION")) 2443 (unless (or (string= request "ACTION")
2444 (string= request "KEEPALIVE"))
2318 (rcirc-print process sender "CTCP" target 2445 (rcirc-print process sender "CTCP" target
2319 (format "%s" text) t)))))) 2446 (format "%s" text) t))))))
2320 2447
diff --git a/lisp/pcomplete.el b/lisp/pcomplete.el
index c1da9fb9132..efb5980766d 100644
--- a/lisp/pcomplete.el
+++ b/lisp/pcomplete.el
@@ -934,7 +934,7 @@ generate the completions list. This means that the hook
934 (if pcomplete-last-window-config 934 (if pcomplete-last-window-config
935 (let* ((cbuf (get-buffer "*Completions*")) 935 (let* ((cbuf (get-buffer "*Completions*"))
936 (cwin (and cbuf (get-buffer-window cbuf)))) 936 (cwin (and cbuf (get-buffer-window cbuf))))
937 (when (and cwin (window-live-p cwin)) 937 (when (window-live-p cwin)
938 (bury-buffer cbuf) 938 (bury-buffer cbuf)
939 (set-window-configuration pcomplete-last-window-config)))) 939 (set-window-configuration pcomplete-last-window-config))))
940 (setq pcomplete-last-window-config nil 940 (setq pcomplete-last-window-config nil
diff --git a/lisp/play/gamegrid.el b/lisp/play/gamegrid.el
index a5689e6f0ea..0c49d81ec06 100644
--- a/lisp/play/gamegrid.el
+++ b/lisp/play/gamegrid.el
@@ -66,7 +66,8 @@
66(defvar gamegrid-score-file-length 50 66(defvar gamegrid-score-file-length 50
67 "Number of high scores to keep") 67 "Number of high scores to keep")
68 68
69(defvar gamegrid-user-score-file-directory "~/.emacs.d/games" 69(defvar gamegrid-user-score-file-directory
70 (concat user-emacs-directory "games")
70 "A directory for game scores which can't be shared. 71 "A directory for game scores which can't be shared.
71If Emacs was built without support for shared game scores, then this 72If Emacs was built without support for shared game scores, then this
72directory will be used.") 73directory will be used.")
diff --git a/lisp/progmodes/python.el b/lisp/progmodes/python.el
index d2e913f2315..5c117dffd5d 100644
--- a/lisp/progmodes/python.el
+++ b/lisp/progmodes/python.el
@@ -1925,7 +1925,7 @@ Repeating the command scrolls the completion window."
1925 (interactive) 1925 (interactive)
1926 (let ((window (get-buffer-window "*Completions*"))) 1926 (let ((window (get-buffer-window "*Completions*")))
1927 (if (and (eq last-command this-command) 1927 (if (and (eq last-command this-command)
1928 window (window-live-p window) (window-buffer window) 1928 (window-live-p window) (window-buffer window)
1929 (buffer-name (window-buffer window))) 1929 (buffer-name (window-buffer window)))
1930 (with-current-buffer (window-buffer window) 1930 (with-current-buffer (window-buffer window)
1931 (if (pos-visible-in-window-p (point-max) window) 1931 (if (pos-visible-in-window-p (point-max) window)
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index dc8eae8e850..106b7eceb06 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -235,7 +235,7 @@
235 (wsh . sh) 235 (wsh . sh)
236 (zsh . ksh88) 236 (zsh . ksh88)
237 (rpm . sh)) 237 (rpm . sh))
238 "*Alist showing the direct ancestor of various shells. 238 "Alist showing the direct ancestor of various shells.
239This is the basis for `sh-feature'. See also `sh-alias-alist'. 239This is the basis for `sh-feature'. See also `sh-alias-alist'.
240By default we have the following three hierarchies: 240By default we have the following three hierarchies:
241 241
@@ -270,7 +270,7 @@ sh Bourne Shell
270 '((ksh . ksh88) 270 '((ksh . ksh88)
271 (bash2 . bash) 271 (bash2 . bash)
272 (sh5 . sh))) 272 (sh5 . sh)))
273 "*Alist for transforming shell names to what they really are. 273 "Alist for transforming shell names to what they really are.
274Use this where the name of the executable doesn't correspond to the type of 274Use this where the name of the executable doesn't correspond to the type of
275shell it really is." 275shell it really is."
276 :type '(repeat (cons symbol symbol)) 276 :type '(repeat (cons symbol symbol))
@@ -296,7 +296,7 @@ shell it really is."
296 (file-name-sans-extension (downcase shell))))) 296 (file-name-sans-extension (downcase shell)))))
297 (getenv "SHELL") 297 (getenv "SHELL")
298 "/bin/sh") 298 "/bin/sh")
299 "*The executable file name for the shell being programmed." 299 "The executable file name for the shell being programmed."
300 :type 'string 300 :type 'string
301 :group 'sh-script) 301 :group 'sh-script)
302 302
@@ -315,7 +315,7 @@ shell it really is."
315 (wksh) 315 (wksh)
316 ;; -f means don't run .zshrc. 316 ;; -f means don't run .zshrc.
317 (zsh . "-f")) 317 (zsh . "-f"))
318 "*Single argument string for the magic number. See `sh-feature'." 318 "Single argument string for the magic number. See `sh-feature'."
319 :type '(repeat (cons (symbol :tag "Shell") 319 :type '(repeat (cons (symbol :tag "Shell")
320 (choice (const :tag "No Arguments" nil) 320 (choice (const :tag "No Arguments" nil)
321 (string :tag "Arguments") 321 (string :tag "Arguments")
@@ -324,8 +324,8 @@ shell it really is."
324 324
325(defcustom sh-imenu-generic-expression 325(defcustom sh-imenu-generic-expression
326 `((sh 326 `((sh
327 . ((nil "^\\s-*\\(function\\s-+\\)?\\([A-Za-z_][A-Za-z_0-9]+\\)\\s-*()" 2)))) 327 . ((nil "^\\s-*\\(function\\s-+\\)?\\([[:alpha:]_][[:alnum:]_]+\\)\\s-*()" 2))))
328 "*Alist of regular expressions for recognizing shell function definitions. 328 "Alist of regular expressions for recognizing shell function definitions.
329See `sh-feature' and `imenu-generic-expression'." 329See `sh-feature' and `imenu-generic-expression'."
330 :type '(alist :key-type (symbol :tag "Shell") 330 :type '(alist :key-type (symbol :tag "Shell")
331 :value-type (alist :key-type (choice :tag "Title" 331 :value-type (alist :key-type (choice :tag "Title"
@@ -501,7 +501,7 @@ This is buffer-local in every such buffer.")
501 '(shell-dynamic-complete-environment-variable 501 '(shell-dynamic-complete-environment-variable
502 shell-dynamic-complete-command 502 shell-dynamic-complete-command
503 comint-dynamic-complete-filename) 503 comint-dynamic-complete-filename)
504 "*Functions for doing TAB dynamic completion." 504 "Functions for doing TAB dynamic completion."
505 :type '(repeat function) 505 :type '(repeat function)
506 :group 'sh-script) 506 :group 'sh-script)
507 507
@@ -509,7 +509,7 @@ This is buffer-local in every such buffer.")
509(defcustom sh-require-final-newline 509(defcustom sh-require-final-newline
510 '((csh . t) 510 '((csh . t)
511 (pdksh . t)) 511 (pdksh . t))
512 "*Value of `require-final-newline' in Shell-Script mode buffers. 512 "Value of `require-final-newline' in Shell-Script mode buffers.
513\(SHELL . t) means use the value of `mode-require-final-newline' for SHELL. 513\(SHELL . t) means use the value of `mode-require-final-newline' for SHELL.
514See `sh-feature'." 514See `sh-feature'."
515 :type '(repeat (cons (symbol :tag "Shell") 515 :type '(repeat (cons (symbol :tag "Shell")
@@ -519,12 +519,12 @@ See `sh-feature'."
519 519
520 520
521(defcustom sh-assignment-regexp 521(defcustom sh-assignment-regexp
522 '((csh . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=") 522 '((csh . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[ \t]*[-+*/%^]?=")
523 ;; actually spaces are only supported in let/(( ... )) 523 ;; actually spaces are only supported in let/(( ... ))
524 (ksh88 . "\\<\\([a-zA-Z0-9_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=") 524 (ksh88 . "\\<\\([[:alnum:]_]+\\)\\(\\[.+\\]\\)?[ \t]*\\([-+*/%&|~^]\\|<<\\|>>\\)?=")
525 (rc . "\\<\\([a-zA-Z0-9_*]+\\)[ \t]*=") 525 (rc . "\\<\\([[:alnum:]_*]+\\)[ \t]*=")
526 (sh . "\\<\\([a-zA-Z0-9_]+\\)=")) 526 (sh . "\\<\\([[:alnum:]_]+\\)="))
527 "*Regexp for the variable name and what may follow in an assignment. 527 "Regexp for the variable name and what may follow in an assignment.
528First grouping matches the variable name. This is upto and including the `=' 528First grouping matches the variable name. This is upto and including the `='
529sign. See `sh-feature'." 529sign. See `sh-feature'."
530 :type '(repeat (cons (symbol :tag "Shell") 530 :type '(repeat (cons (symbol :tag "Shell")
@@ -540,7 +540,7 @@ sign. See `sh-feature'."
540 540
541 541
542(defcustom sh-remember-variable-min 3 542(defcustom sh-remember-variable-min 3
543 "*Don't remember variables less than this length for completing reads." 543 "Don't remember variables less than this length for completing reads."
544 :type 'integer 544 :type 'integer
545 :group 'sh-script) 545 :group 'sh-script)
546 546
@@ -551,16 +551,16 @@ That command is also used for setting this variable.")
551 551
552 552
553(defcustom sh-beginning-of-command 553(defcustom sh-beginning-of-command
554 "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~a-zA-Z0-9:]\\)" 554 "\\([;({`|&]\\|\\`\\|[^\\]\n\\)[ \t]*\\([/~[:alnum:]:]\\)"
555 "*Regexp to determine the beginning of a shell command. 555 "Regexp to determine the beginning of a shell command.
556The actual command starts at the beginning of the second \\(grouping\\)." 556The actual command starts at the beginning of the second \\(grouping\\)."
557 :type 'regexp 557 :type 'regexp
558 :group 'sh-script) 558 :group 'sh-script)
559 559
560 560
561(defcustom sh-end-of-command 561(defcustom sh-end-of-command
562 "\\([/~a-zA-Z0-9:]\\)[ \t]*\\([;#)}`|&]\\|$\\)" 562 "\\([/~[:alnum:]:]\\)[ \t]*\\([;#)}`|&]\\|$\\)"
563 "*Regexp to determine the end of a shell command. 563 "Regexp to determine the end of a shell command.
564The actual command ends at the end of the first \\(grouping\\)." 564The actual command ends at the end of the first \\(grouping\\)."
565 :type 'regexp 565 :type 'regexp
566 :group 'sh-script) 566 :group 'sh-script)
@@ -647,6 +647,7 @@ removed when closing the here document."
647 (shell "cd" "echo" "eval" "set" "shift" "umask" "unset" "wait") 647 (shell "cd" "echo" "eval" "set" "shift" "umask" "unset" "wait")
648 648
649 (wksh sh-append ksh88 649 (wksh sh-append ksh88
650 ;; FIXME: This looks too much like a regexp. --Stef
650 "Xt[A-Z][A-Za-z]*") 651 "Xt[A-Z][A-Za-z]*")
651 652
652 (zsh sh-append ksh88 653 (zsh sh-append ksh88
@@ -656,7 +657,7 @@ removed when closing the here document."
656 "readonly" "rehash" "sched" "setopt" "source" "suspend" "true" 657 "readonly" "rehash" "sched" "setopt" "source" "suspend" "true"
657 "ttyctl" "type" "unfunction" "unhash" "unlimit" "unsetopt" "vared" 658 "ttyctl" "type" "unfunction" "unhash" "unlimit" "unsetopt" "vared"
658 "which")) 659 "which"))
659 "*List of all shell builtins for completing read and fontification. 660 "List of all shell builtins for completing read and fontification.
660Note that on some systems not all builtins are available or some are 661Note that on some systems not all builtins are available or some are
661implemented as aliases. See `sh-feature'." 662implemented as aliases. See `sh-feature'."
662 :type '(repeat (cons (symbol :tag "Shell") 663 :type '(repeat (cons (symbol :tag "Shell")
@@ -677,7 +678,7 @@ implemented as aliases. See `sh-feature'."
677 (rc "else") 678 (rc "else")
678 679
679 (sh "!" "do" "elif" "else" "if" "then" "trap" "type" "until" "while")) 680 (sh "!" "do" "elif" "else" "if" "then" "trap" "type" "until" "while"))
680 "*List of keywords that may be immediately followed by a builtin or keyword. 681 "List of keywords that may be immediately followed by a builtin or keyword.
681Given some confusion between keywords and builtins depending on shell and 682Given some confusion between keywords and builtins depending on shell and
682system, the distinction here has been based on whether they influence the 683system, the distinction here has been based on whether they influence the
683flow of control or syntax. See `sh-feature'." 684flow of control or syntax. See `sh-feature'."
@@ -716,7 +717,7 @@ flow of control or syntax. See `sh-feature'."
716 717
717 (zsh sh-append bash 718 (zsh sh-append bash
718 "select")) 719 "select"))
719 "*List of keywords not in `sh-leading-keywords'. 720 "List of keywords not in `sh-leading-keywords'.
720See `sh-feature'." 721See `sh-feature'."
721 :type '(repeat (cons (symbol :tag "Shell") 722 :type '(repeat (cons (symbol :tag "Shell")
722 (choice (repeat string) 723 (choice (repeat string)
@@ -837,18 +838,18 @@ See `sh-feature'.")
837 838
838(defvar sh-font-lock-keywords-var 839(defvar sh-font-lock-keywords-var
839 '((csh sh-append shell 840 '((csh sh-append shell
840 ("\\${?[#?]?\\([A-Za-z_][A-Za-z0-9_]*\\|0\\)" 1 841 ("\\${?[#?]?\\([[:alpha:]_][[:alnum:]_]*\\|0\\)" 1
841 font-lock-variable-name-face)) 842 font-lock-variable-name-face))
842 843
843 (es sh-append executable-font-lock-keywords 844 (es sh-append executable-font-lock-keywords
844 ("\\$#?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\)" 1 845 ("\\$#?\\([[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\)" 1
845 font-lock-variable-name-face)) 846 font-lock-variable-name-face))
846 847
847 (rc sh-append es) 848 (rc sh-append es)
848 (bash sh-append shell ("\\$(\\(\\sw+\\)" (1 'sh-quoted-exec t) )) 849 (bash sh-append shell ("\\$(\\(\\sw+\\)" (1 'sh-quoted-exec t) ))
849 (sh sh-append shell 850 (sh sh-append shell
850 ;; Variable names. 851 ;; Variable names.
851 ("\\$\\({#?\\)?\\([A-Za-z_][A-Za-z0-9_]*\\|[-#?@!]\\)" 2 852 ("\\$\\({#?\\)?\\([[:alpha:]_][[:alnum:]_]*\\|[-#?@!]\\)" 2
852 font-lock-variable-name-face) 853 font-lock-variable-name-face)
853 ;; Function names. 854 ;; Function names.
854 ("^\\(\\sw+\\)[ \t]*(" 1 font-lock-function-name-face) 855 ("^\\(\\sw+\\)[ \t]*(" 1 font-lock-function-name-face)
@@ -861,8 +862,8 @@ See `sh-feature'.")
861 (shell 862 (shell
862 ;; Using font-lock-string-face here confuses sh-get-indent-info. 863 ;; Using font-lock-string-face here confuses sh-get-indent-info.
863 ("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'sh-escaped-newline) 864 ("\\(^\\|[^\\]\\)\\(\\\\\\\\\\)*\\(\\\\\\)$" 3 'sh-escaped-newline)
864 ("\\\\[^A-Za-z0-9]" 0 font-lock-string-face) 865 ("\\\\[^[:alnum:]]" 0 font-lock-string-face)
865 ("\\${?\\([A-Za-z_][A-Za-z0-9_]*\\|[0-9]+\\|[$*_]\\)" 1 866 ("\\${?\\([[:alpha:]_][[:alnum:]_]*\\|[0-9]+\\|[$*_]\\)" 1
866 font-lock-variable-name-face)) 867 font-lock-variable-name-face))
867 (rpm sh-append rpm2 868 (rpm sh-append rpm2
868 ("%{?\\(\\sw+\\)" 1 font-lock-keyword-face)) 869 ("%{?\\(\\sw+\\)" 1 font-lock-keyword-face))
@@ -884,7 +885,7 @@ See `sh-feature'.")
884(defconst sh-here-doc-syntax (string-to-syntax "|")) ;; generic string 885(defconst sh-here-doc-syntax (string-to-syntax "|")) ;; generic string
885 886
886(defconst sh-escaped-line-re 887(defconst sh-escaped-line-re
887 ;; Should match until the real end-of-continued line, but if that is not 888 ;; Should match until the real end-of-continued-line, but if that is not
888 ;; possible (because we bump into EOB or the search bound), then we should 889 ;; possible (because we bump into EOB or the search bound), then we should
889 ;; match until the search bound. 890 ;; match until the search bound.
890 "\\(?:\\(?:.*[^\\\n]\\)?\\(?:\\\\\\\\\\)*\\\\\n\\)*.*") 891 "\\(?:\\(?:.*[^\\\n]\\)?\\(?:\\\\\\\\\\)*\\\\\n\\)*.*")
@@ -991,46 +992,38 @@ subshells can nest."
991 (eq ?\" (nth 3 (syntax-ppss)))) 992 (eq ?\" (nth 3 (syntax-ppss))))
992 ;; bingo we have a $( or a ` inside a "" 993 ;; bingo we have a $( or a ` inside a ""
993 (let ((char (char-after (point))) 994 (let ((char (char-after (point)))
994 (continue t) 995 ;; `state' can be: double-quote, backquote, code.
995 (pos (point)) 996 (state (if (eq (char-before) ?`) 'backquote 'code))
996 (data nil) ;; value to put into match-data (and return) 997 ;; Stacked states in the context.
997 (last nil) ;; last char seen 998 (states '(double-quote)))
998 (bq (equal (match-string 1) "`")) ;; ` state flip-flop 999 (while (and state (progn (skip-chars-forward "^'\\\"`$()" limit)
999 (seen nil) ;; list of important positions 1000 (< (point) limit)))
1000 (nest 1)) ;; subshell nesting level 1001 ;; unescape " inside a $( ... ) construct.
1001 (while (and continue char (<= pos limit)) 1002 (case (char-after)
1002 ;; unescaped " inside a $( ... ) construct. 1003 (?\' (skip-chars-forward "^'" limit))
1003 ;; state machine time... 1004 (?\\ (forward-char 1))
1004 ;; \ => ignore next char; 1005 (?\" (case state
1005 ;; ` => increase or decrease nesting level based on bq flag 1006 (double-quote (setq state (pop states)))
1006 ;; ) [where nesting > 0] => decrease nesting 1007 (t (push state states) (setq state 'double-quote)))
1007 ;; ( [where nesting > 0] => increase nesting 1008 (if state (put-text-property (point) (1+ (point))
1008 ;; ( [preceeded by $ ] => increase nesting 1009 'syntax-table '(1))))
1009 ;; " [nesting <= 0 ] => terminate, we're done. 1010 (?\` (case state
1010 ;; " [nesting > 0 ] => remember this, it's not a proper " 1011 (backquote (setq state (pop states)))
1011 ;; FIXME: don't count parens that appear within quotes. 1012 (t (push state states) (setq state 'backquote))))
1012 (cond 1013 (?\$ (if (not (eq (char-after (1+ (point))) ?\())
1013 ((eq ?\\ last) nil) 1014 nil
1014 ((eq ?\` char) (setq nest (+ nest (if bq -1 1)) bq (not bq))) 1015 (case state
1015 ((and (> nest 0) (eq ?\) char)) (setq nest (1- nest))) 1016 (t (push state states) (setq state 'code)))))
1016 ((and (eq ?$ last) (eq ?\( char)) (setq nest (1+ nest))) 1017 (?\( (case state
1017 ((and (> nest 0) (eq ?\( char)) (setq nest (1+ nest))) 1018 (double-quote nil)
1018 ((eq char ?\") 1019 (t (push state states) (setq state 'code))))
1019 (if (>= 0 nest) (setq continue nil) (push pos seen)))) 1020 (?\) (case state
1020 ;;(message "POS: %d [%d]" pos nest) 1021 (double-quote nil)
1021 (setq last char 1022 (t (setq state (pop states)))))
1022 pos (1+ pos) 1023 (t (error "Internal error in sh-quoted-subshell")))
1023 char (char-after pos)) ) 1024 (forward-char 1)))
1024 ;; FIXME: why construct a costly match data to pass to 1025 t))
1025 ;; sh-apply-quoted-subshell rather than apply the highlight 1026
1026 ;; directly here? -- Stef
1027 (when seen
1028 ;;(message "SEEN: %S" seen)
1029 (setq data (list (current-buffer)))
1030 (dolist(P seen)
1031 (setq data (cons P (cons (1+ P) data))))
1032 (store-match-data data))
1033 data) ))
1034 1027
1035(defun sh-is-quoted-p (pos) 1028(defun sh-is-quoted-p (pos)
1036 (and (eq (char-before pos) ?\\) 1029 (and (eq (char-before pos) ?\\)
@@ -1062,16 +1055,18 @@ subshells can nest."
1062 (when (save-excursion (backward-char 2) (looking-at ";;\\|in")) 1055 (when (save-excursion (backward-char 2) (looking-at ";;\\|in"))
1063 sh-st-punc))) 1056 sh-st-punc)))
1064 1057
1065(defun sh-apply-quoted-subshell () 1058(defun sh-font-lock-backslash-quote ()
1066 "Apply the `sh-st-punc' syntax to all the matches in `match-data'. 1059 (if (eq (save-excursion (nth 3 (syntax-ppss (match-beginning 0)))) ?\')
1067This is used to flag quote characters in subshell constructs inside strings 1060 ;; In a '...' the backslash is not escaping.
1068\(which should therefore not be treated as normal quote characters\)" 1061 sh-st-punc
1069 (let ((m (match-data)) a b) 1062 nil))
1070 (while m 1063
1071 (setq a (car m) 1064(defun sh-font-lock-flush-syntax-ppss-cache (limit)
1072 b (cadr m) 1065 ;; This should probably be a standard function provided by font-lock.el
1073 m (cddr m)) 1066 ;; (or syntax.el).
1074 (put-text-property a b 'syntax-table sh-st-punc))) sh-st-punc) 1067 (syntax-ppss-flush-cache (point))
1068 (goto-char limit)
1069 nil)
1075 1070
1076(defconst sh-font-lock-syntactic-keywords 1071(defconst sh-font-lock-syntactic-keywords
1077 ;; A `#' begins a comment when it is unquoted and at the beginning of a 1072 ;; A `#' begins a comment when it is unquoted and at the beginning of a
@@ -1080,7 +1075,11 @@ This is used to flag quote characters in subshell constructs inside strings
1080 ;; of the shell command language (under `quoting') but with `$' removed. 1075 ;; of the shell command language (under `quoting') but with `$' removed.
1081 `(("[^|&;<>()`\\\"' \t\n]\\(#+\\)" 1 ,sh-st-symbol) 1076 `(("[^|&;<>()`\\\"' \t\n]\\(#+\\)" 1 ,sh-st-symbol)
1082 ;; In a '...' the backslash is not escaping. 1077 ;; In a '...' the backslash is not escaping.
1083 ("\\(\\\\\\)'" 1 ,sh-st-punc) 1078 ("\\(\\\\\\)'" (1 (sh-font-lock-backslash-quote)))
1079 ;; The previous rule uses syntax-ppss, but the subsequent rules may
1080 ;; change the syntax, so we have to tell syntax-ppss that the states it
1081 ;; has just computed will need to be recomputed.
1082 (sh-font-lock-flush-syntax-ppss-cache)
1084 ;; Make sure $@ and @? are correctly recognized as sexps. 1083 ;; Make sure $@ and @? are correctly recognized as sexps.
1085 ("\\$\\([?@]\\)" 1 ,sh-st-symbol) 1084 ("\\$\\([?@]\\)" 1 ,sh-st-symbol)
1086 ;; Find HEREDOC starters and add a corresponding rule for the ender. 1085 ;; Find HEREDOC starters and add a corresponding rule for the ender.
@@ -1095,8 +1094,7 @@ This is used to flag quote characters in subshell constructs inside strings
1095 (")" 0 (sh-font-lock-paren (match-beginning 0))) 1094 (")" 0 (sh-font-lock-paren (match-beginning 0)))
1096 ;; highlight (possibly nested) subshells inside "" quoted regions correctly. 1095 ;; highlight (possibly nested) subshells inside "" quoted regions correctly.
1097 ;; This should be at the very end because it uses syntax-ppss. 1096 ;; This should be at the very end because it uses syntax-ppss.
1098 (sh-quoted-subshell 1097 (sh-quoted-subshell)))
1099 (1 (sh-apply-quoted-subshell) t t))))
1100 1098
1101(defun sh-font-lock-syntactic-face-function (state) 1099(defun sh-font-lock-syntactic-face-function (state)
1102 (let ((q (nth 3 state))) 1100 (let ((q (nth 3 state)))
@@ -1117,17 +1115,17 @@ and command `sh-reset-indent-vars-to-global-values'."
1117 1115
1118 1116
1119(defcustom sh-set-shell-hook nil 1117(defcustom sh-set-shell-hook nil
1120 "*Hook run by `sh-set-shell'." 1118 "Hook run by `sh-set-shell'."
1121 :type 'hook 1119 :type 'hook
1122 :group 'sh-script) 1120 :group 'sh-script)
1123 1121
1124(defcustom sh-mode-hook nil 1122(defcustom sh-mode-hook nil
1125 "*Hook run by `sh-mode'." 1123 "Hook run by `sh-mode'."
1126 :type 'hook 1124 :type 'hook
1127 :group 'sh-script) 1125 :group 'sh-script)
1128 1126
1129(defcustom sh-learn-basic-offset nil 1127(defcustom sh-learn-basic-offset nil
1130 "*When `sh-guess-basic-offset' should learn `sh-basic-offset'. 1128 "When `sh-guess-basic-offset' should learn `sh-basic-offset'.
1131 1129
1132nil mean: never. 1130nil mean: never.
1133t means: only if there seems to be an obvious value. 1131t means: only if there seems to be an obvious value.
@@ -1139,7 +1137,7 @@ Anything else means: whenever we have a \"good guess\" as to the value."
1139 :group 'sh-indentation) 1137 :group 'sh-indentation)
1140 1138
1141(defcustom sh-popup-occur-buffer nil 1139(defcustom sh-popup-occur-buffer nil
1142 "*Controls when `sh-learn-buffer-indent' pops the `*indent*' buffer. 1140 "Controls when `sh-learn-buffer-indent' pops the `*indent*' buffer.
1143If t it is always shown. If nil, it is shown only when there 1141If t it is always shown. If nil, it is shown only when there
1144are conflicts." 1142are conflicts."
1145 :type '(choice 1143 :type '(choice
@@ -1148,7 +1146,7 @@ are conflicts."
1148 :group 'sh-indentation) 1146 :group 'sh-indentation)
1149 1147
1150(defcustom sh-blink t 1148(defcustom sh-blink t
1151 "*If non-nil, `sh-show-indent' shows the line indentation is relative to. 1149 "If non-nil, `sh-show-indent' shows the line indentation is relative to.
1152The position on the line is not necessarily meaningful. 1150The position on the line is not necessarily meaningful.
1153In some cases the line will be the matching keyword, but this is not 1151In some cases the line will be the matching keyword, but this is not
1154always the case." 1152always the case."
@@ -1156,7 +1154,7 @@ always the case."
1156 :group 'sh-indentation) 1154 :group 'sh-indentation)
1157 1155
1158(defcustom sh-first-lines-indent 0 1156(defcustom sh-first-lines-indent 0
1159 "*The indentation of the first non-blank non-comment line. 1157 "The indentation of the first non-blank non-comment line.
1160Usually 0 meaning first column. 1158Usually 0 meaning first column.
1161Can be set to a number, or to nil which means leave it as is." 1159Can be set to a number, or to nil which means leave it as is."
1162 :type '(choice 1160 :type '(choice
@@ -1167,13 +1165,13 @@ Can be set to a number, or to nil which means leave it as is."
1167 1165
1168 1166
1169(defcustom sh-basic-offset 4 1167(defcustom sh-basic-offset 4
1170 "*The default indentation increment. 1168 "The default indentation increment.
1171This value is used for the `+' and `-' symbols in an indentation variable." 1169This value is used for the `+' and `-' symbols in an indentation variable."
1172 :type 'integer 1170 :type 'integer
1173 :group 'sh-indentation) 1171 :group 'sh-indentation)
1174 1172
1175(defcustom sh-indent-comment nil 1173(defcustom sh-indent-comment nil
1176 "*How a comment line is to be indented. 1174 "How a comment line is to be indented.
1177nil means leave it as it is; 1175nil means leave it as it is;
1178t means indent it as a normal line, aligning it to previous non-blank 1176t means indent it as a normal line, aligning it to previous non-blank
1179 non-comment line; 1177 non-comment line;
@@ -1212,7 +1210,7 @@ a number means align to that column, e.g. 0 means fist column."
1212 :menu-tag "/ Indent left half sh-basic-offset"))) 1210 :menu-tag "/ Indent left half sh-basic-offset")))
1213 1211
1214(defcustom sh-indent-for-else 0 1212(defcustom sh-indent-for-else 0
1215 "*How much to indent an `else' relative to its `if'. Usually 0." 1213 "How much to indent an `else' relative to its `if'. Usually 0."
1216 :type `(choice 1214 :type `(choice
1217 (integer :menu-tag "A number (positive=>indent right)" 1215 (integer :menu-tag "A number (positive=>indent right)"
1218 :tag "A number") 1216 :tag "A number")
@@ -1228,41 +1226,41 @@ a number means align to that column, e.g. 0 means fist column."
1228 sh-symbol-list)) 1226 sh-symbol-list))
1229 1227
1230(defcustom sh-indent-for-fi 0 1228(defcustom sh-indent-for-fi 0
1231 "*How much to indent a `fi' relative to its `if'. Usually 0." 1229 "How much to indent a `fi' relative to its `if'. Usually 0."
1232 :type `(choice ,@ sh-number-or-symbol-list ) 1230 :type `(choice ,@ sh-number-or-symbol-list )
1233 :group 'sh-indentation) 1231 :group 'sh-indentation)
1234 1232
1235(defcustom sh-indent-for-done 0 1233(defcustom sh-indent-for-done 0
1236 "*How much to indent a `done' relative to its matching stmt. Usually 0." 1234 "How much to indent a `done' relative to its matching stmt. Usually 0."
1237 :type `(choice ,@ sh-number-or-symbol-list ) 1235 :type `(choice ,@ sh-number-or-symbol-list )
1238 :group 'sh-indentation) 1236 :group 'sh-indentation)
1239 1237
1240(defcustom sh-indent-after-else '+ 1238(defcustom sh-indent-after-else '+
1241 "*How much to indent a statement after an `else' statement." 1239 "How much to indent a statement after an `else' statement."
1242 :type `(choice ,@ sh-number-or-symbol-list ) 1240 :type `(choice ,@ sh-number-or-symbol-list )
1243 :group 'sh-indentation) 1241 :group 'sh-indentation)
1244 1242
1245(defcustom sh-indent-after-if '+ 1243(defcustom sh-indent-after-if '+
1246 "*How much to indent a statement after an `if' statement. 1244 "How much to indent a statement after an `if' statement.
1247This includes lines after `else' and `elif' statements, too, but 1245This includes lines after `else' and `elif' statements, too, but
1248does not affect the `else', `elif' or `fi' statements themselves." 1246does not affect the `else', `elif' or `fi' statements themselves."
1249 :type `(choice ,@ sh-number-or-symbol-list ) 1247 :type `(choice ,@ sh-number-or-symbol-list )
1250 :group 'sh-indentation) 1248 :group 'sh-indentation)
1251 1249
1252(defcustom sh-indent-for-then 0 1250(defcustom sh-indent-for-then 0
1253 "*How much to indent a `then' relative to its `if'." 1251 "How much to indent a `then' relative to its `if'."
1254 :type `(choice ,@ sh-number-or-symbol-list ) 1252 :type `(choice ,@ sh-number-or-symbol-list )
1255 :group 'sh-indentation) 1253 :group 'sh-indentation)
1256 1254
1257(defcustom sh-indent-for-do 0 1255(defcustom sh-indent-for-do 0
1258 "*How much to indent a `do' statement. 1256 "How much to indent a `do' statement.
1259This is relative to the statement before the `do', typically a 1257This is relative to the statement before the `do', typically a
1260`while', `until', `for', `repeat' or `select' statement." 1258`while', `until', `for', `repeat' or `select' statement."
1261 :type `(choice ,@ sh-number-or-symbol-list) 1259 :type `(choice ,@ sh-number-or-symbol-list)
1262 :group 'sh-indentation) 1260 :group 'sh-indentation)
1263 1261
1264(defcustom sh-indent-after-do '+ 1262(defcustom sh-indent-after-do '+
1265 "*How much to indent a line after a `do' statement. 1263 "How much to indent a line after a `do' statement.
1266This is used when the `do' is the first word of the line. 1264This is used when the `do' is the first word of the line.
1267This is relative to the statement before the `do', typically a 1265This is relative to the statement before the `do', typically a
1268`while', `until', `for', `repeat' or `select' statement." 1266`while', `until', `for', `repeat' or `select' statement."
@@ -1270,7 +1268,7 @@ This is relative to the statement before the `do', typically a
1270 :group 'sh-indentation) 1268 :group 'sh-indentation)
1271 1269
1272(defcustom sh-indent-after-loop-construct '+ 1270(defcustom sh-indent-after-loop-construct '+
1273 "*How much to indent a statement after a loop construct. 1271 "How much to indent a statement after a loop construct.
1274 1272
1275This variable is used when the keyword `do' is on the same line as the 1273This variable is used when the keyword `do' is on the same line as the
1276loop statement (e.g., `until', `while' or `for'). 1274loop statement (e.g., `until', `while' or `for').
@@ -1280,7 +1278,7 @@ If the `do' is on a line by itself, then `sh-indent-after-do' is used instead."
1280 1278
1281 1279
1282(defcustom sh-indent-after-done 0 1280(defcustom sh-indent-after-done 0
1283 "*How much to indent a statement after a `done' keyword. 1281 "How much to indent a statement after a `done' keyword.
1284Normally this is 0, which aligns the `done' to the matching 1282Normally this is 0, which aligns the `done' to the matching
1285looping construct line. 1283looping construct line.
1286Setting it non-zero allows you to have the `do' statement on a line 1284Setting it non-zero allows you to have the `do' statement on a line
@@ -1289,55 +1287,55 @@ by itself and align the done under to do."
1289 :group 'sh-indentation) 1287 :group 'sh-indentation)
1290 1288
1291(defcustom sh-indent-for-case-label '+ 1289(defcustom sh-indent-for-case-label '+
1292 "*How much to indent a case label statement. 1290 "How much to indent a case label statement.
1293This is relative to the line containing the `case' statement." 1291This is relative to the line containing the `case' statement."
1294 :type `(choice ,@ sh-number-or-symbol-list) 1292 :type `(choice ,@ sh-number-or-symbol-list)
1295 :group 'sh-indentation) 1293 :group 'sh-indentation)
1296 1294
1297(defcustom sh-indent-for-case-alt '++ 1295(defcustom sh-indent-for-case-alt '++
1298 "*How much to indent statements after the case label. 1296 "How much to indent statements after the case label.
1299This is relative to the line containing the `case' statement." 1297This is relative to the line containing the `case' statement."
1300 :type `(choice ,@ sh-number-or-symbol-list) 1298 :type `(choice ,@ sh-number-or-symbol-list)
1301 :group 'sh-indentation) 1299 :group 'sh-indentation)
1302 1300
1303 1301
1304(defcustom sh-indent-for-continuation '+ 1302(defcustom sh-indent-for-continuation '+
1305 "*How much to indent for a continuation statement." 1303 "How much to indent for a continuation statement."
1306 :type `(choice ,@ sh-number-or-symbol-list) 1304 :type `(choice ,@ sh-number-or-symbol-list)
1307 :group 'sh-indentation) 1305 :group 'sh-indentation)
1308 1306
1309(defcustom sh-indent-after-open '+ 1307(defcustom sh-indent-after-open '+
1310 "*How much to indent after a line with an opening parenthesis or brace. 1308 "How much to indent after a line with an opening parenthesis or brace.
1311For an open paren after a function, `sh-indent-after-function' is used." 1309For an open paren after a function, `sh-indent-after-function' is used."
1312 :type `(choice ,@ sh-number-or-symbol-list) 1310 :type `(choice ,@ sh-number-or-symbol-list)
1313 :group 'sh-indentation) 1311 :group 'sh-indentation)
1314 1312
1315(defcustom sh-indent-after-function '+ 1313(defcustom sh-indent-after-function '+
1316 "*How much to indent after a function line." 1314 "How much to indent after a function line."
1317 :type `(choice ,@ sh-number-or-symbol-list) 1315 :type `(choice ,@ sh-number-or-symbol-list)
1318 :group 'sh-indentation) 1316 :group 'sh-indentation)
1319 1317
1320;; These 2 are for the rc shell: 1318;; These 2 are for the rc shell:
1321 1319
1322(defcustom sh-indent-after-switch '+ 1320(defcustom sh-indent-after-switch '+
1323 "*How much to indent a `case' statement relative to the `switch' statement. 1321 "How much to indent a `case' statement relative to the `switch' statement.
1324This is for the rc shell." 1322This is for the rc shell."
1325 :type `(choice ,@ sh-number-or-symbol-list) 1323 :type `(choice ,@ sh-number-or-symbol-list)
1326 :group 'sh-indentation) 1324 :group 'sh-indentation)
1327 1325
1328(defcustom sh-indent-after-case '+ 1326(defcustom sh-indent-after-case '+
1329 "*How much to indent a statement relative to the `case' statement. 1327 "How much to indent a statement relative to the `case' statement.
1330This is for the rc shell." 1328This is for the rc shell."
1331 :type `(choice ,@ sh-number-or-symbol-list) 1329 :type `(choice ,@ sh-number-or-symbol-list)
1332 :group 'sh-indentation) 1330 :group 'sh-indentation)
1333 1331
1334(defcustom sh-backslash-column 48 1332(defcustom sh-backslash-column 48
1335 "*Column in which `sh-backslash-region' inserts backslashes." 1333 "Column in which `sh-backslash-region' inserts backslashes."
1336 :type 'integer 1334 :type 'integer
1337 :group 'sh) 1335 :group 'sh)
1338 1336
1339(defcustom sh-backslash-align t 1337(defcustom sh-backslash-align t
1340 "*If non-nil, `sh-backslash-region' will align backslashes." 1338 "If non-nil, `sh-backslash-region' will align backslashes."
1341 :type 'boolean 1339 :type 'boolean
1342 :group 'sh) 1340 :group 'sh)
1343 1341
@@ -1347,7 +1345,7 @@ This is for the rc shell."
1347 "Make a regexp which matches WORD as a word. 1345 "Make a regexp which matches WORD as a word.
1348This specifically excludes an occurrence of WORD followed by 1346This specifically excludes an occurrence of WORD followed by
1349punctuation characters like '-'." 1347punctuation characters like '-'."
1350 (concat word "\\([^-a-z0-9_]\\|$\\)")) 1348 (concat word "\\([^-[:alnum:]_]\\|$\\)"))
1351 1349
1352(defconst sh-re-done (sh-mkword-regexpr "done")) 1350(defconst sh-re-done (sh-mkword-regexpr "done"))
1353 1351
@@ -2234,6 +2232,7 @@ STRING This is ignored for the purposes of calculating
2234 (setq align-point (point)))) 2232 (setq align-point (point))))
2235 (or (bobp) 2233 (or (bobp)
2236 (forward-char -1)) 2234 (forward-char -1))
2235 ;; FIXME: This charset looks too much like a regexp. --Stef
2237 (skip-chars-forward "[a-z0-9]*?") 2236 (skip-chars-forward "[a-z0-9]*?")
2238 ) 2237 )
2239 ((string-match "[])}]" x) 2238 ((string-match "[])}]" x)
@@ -2442,7 +2441,7 @@ we go to the end of the previous line and do not check for continuations."
2442 (if (looking-at "[\"'`]") 2441 (if (looking-at "[\"'`]")
2443 (sh-safe-forward-sexp) 2442 (sh-safe-forward-sexp)
2444 ;; (> (skip-chars-forward "^ \t\n\"'`") 0) 2443 ;; (> (skip-chars-forward "^ \t\n\"'`") 0)
2445 (> (skip-chars-forward "-_a-zA-Z$0-9") 0) 2444 (> (skip-chars-forward "-_$[:alnum:]") 0)
2446 )) 2445 ))
2447 (buffer-substring start (point)) 2446 (buffer-substring start (point))
2448 )) 2447 ))
diff --git a/lisp/savehist.el b/lisp/savehist.el
index 9555bce9bd4..9343fc2ccb1 100644
--- a/lisp/savehist.el
+++ b/lisp/savehist.el
@@ -101,8 +101,8 @@ minibuffer histories, such as `compile-command' or `kill-ring'."
101 (cond 101 (cond
102 ;; Backward compatibility with previous versions of savehist. 102 ;; Backward compatibility with previous versions of savehist.
103 ((file-exists-p "~/.emacs-history") "~/.emacs-history") 103 ((file-exists-p "~/.emacs-history") "~/.emacs-history")
104 ((and (not (featurep 'xemacs)) (file-directory-p "~/.emacs.d/")) 104 ((and (not (featurep 'xemacs)) (file-directory-p user-emacs-directory))
105 "~/.emacs.d/history") 105 (concat user-emacs-directory "history"))
106 ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/")) 106 ((and (featurep 'xemacs) (file-directory-p "~/.xemacs/"))
107 "~/.xemacs/history") 107 "~/.xemacs/history")
108 ;; For users without `~/.emacs.d/' or `~/.xemacs/'. 108 ;; For users without `~/.emacs.d/' or `~/.xemacs/'.
diff --git a/lisp/scroll-lock.el b/lisp/scroll-lock.el
index 7075377d1b0..5896d6478eb 100644
--- a/lisp/scroll-lock.el
+++ b/lisp/scroll-lock.el
@@ -50,7 +50,7 @@
50 50
51;;;###autoload 51;;;###autoload
52(define-minor-mode scroll-lock-mode 52(define-minor-mode scroll-lock-mode
53 "Minor mode for pager-like scrolling. 53 "Buffer-local minor mode for pager-like scrolling.
54Keys which normally move point by line or paragraph will scroll 54Keys which normally move point by line or paragraph will scroll
55the buffer by the respective amount of lines instead and point 55the buffer by the respective amount of lines instead and point
56will be kept vertically fixed relative to window boundaries 56will be kept vertically fixed relative to window boundaries
diff --git a/lisp/server.el b/lisp/server.el
index 690f51034f2..9f6755fc26b 100644
--- a/lisp/server.el
+++ b/lisp/server.el
@@ -105,7 +105,7 @@ If set, the server accepts remote connections; otherwise it is local."
105 :version "22.1") 105 :version "22.1")
106(put 'server-host 'risky-local-variable t) 106(put 'server-host 'risky-local-variable t)
107 107
108(defcustom server-auth-dir "~/.emacs.d/server/" 108(defcustom server-auth-dir (concat user-emacs-directory "server/")
109 "Directory for server authentication files." 109 "Directory for server authentication files."
110 :group 'server 110 :group 'server
111 :type 'directory 111 :type 'directory
@@ -735,8 +735,7 @@ Arg NEXT-BUFFER is a suggestion; if it is a live buffer, use it."
735 (select-window win) 735 (select-window win)
736 (set-buffer next-buffer)) 736 (set-buffer next-buffer))
737 ;; Otherwise, let's find an appropriate window. 737 ;; Otherwise, let's find an appropriate window.
738 (cond ((and (windowp server-window) 738 (cond ((window-live-p server-window)
739 (window-live-p server-window))
740 (select-window server-window)) 739 (select-window server-window))
741 ((framep server-window) 740 ((framep server-window)
742 (unless (frame-live-p server-window) 741 (unless (frame-live-p server-window)
diff --git a/lisp/shell.el b/lisp/shell.el
index a218981256a..9e07540d9d8 100644
--- a/lisp/shell.el
+++ b/lisp/shell.el
@@ -557,7 +557,7 @@ Otherwise, one argument `-i' is passed to the shell.
557 (startfile (concat "~/.emacs_" name)) 557 (startfile (concat "~/.emacs_" name))
558 (xargs-name (intern-soft (concat "explicit-" name "-args")))) 558 (xargs-name (intern-soft (concat "explicit-" name "-args"))))
559 (unless (file-exists-p startfile) 559 (unless (file-exists-p startfile)
560 (setq startfile (concat "~/.emacs.d/init_" name ".sh"))) 560 (setq startfile (concat user-emacs-directory "init_" name ".sh")))
561 (apply 'make-comint-in-buffer "shell" buffer prog 561 (apply 'make-comint-in-buffer "shell" buffer prog
562 (if (file-exists-p startfile) startfile) 562 (if (file-exists-p startfile) startfile)
563 (if (and xargs-name (boundp xargs-name)) 563 (if (and xargs-name (boundp xargs-name))
diff --git a/lisp/startup.el b/lisp/startup.el
index c128b24551c..5f4081277a0 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -263,9 +263,9 @@ init file is read, in case it sets `mail-host-address'."
263(defcustom auto-save-list-file-prefix 263(defcustom auto-save-list-file-prefix
264 (cond ((eq system-type 'ms-dos) 264 (cond ((eq system-type 'ms-dos)
265 ;; MS-DOS cannot have initial dot, and allows only 8.3 names 265 ;; MS-DOS cannot have initial dot, and allows only 8.3 names
266 "~/_emacs.d/auto-save.list/_s") 266 (concat user-emacs-directory "auto-save.list/_s"))
267 (t 267 (t
268 "~/.emacs.d/auto-save-list/.saves-")) 268 (concat user-emacs-directory "auto-save-list/.saves-")))
269 "Prefix for generating `auto-save-list-file-name'. 269 "Prefix for generating `auto-save-list-file-name'.
270This is used after reading your `.emacs' file to initialize 270This is used after reading your `.emacs' file to initialize
271`auto-save-list-file-name', by appending Emacs's pid and the system name, 271`auto-save-list-file-name', by appending Emacs's pid and the system name,
diff --git a/lisp/subr.el b/lisp/subr.el
index d42c096a414..42f2049ace2 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2041,6 +2041,15 @@ On other systems, this variable is normally always nil.")
2041(put 'cl-assertion-failed 'error-conditions '(error)) 2041(put 'cl-assertion-failed 'error-conditions '(error))
2042(put 'cl-assertion-failed 'error-message "Assertion failed") 2042(put 'cl-assertion-failed 'error-message "Assertion failed")
2043 2043
2044(defconst user-emacs-directory
2045 (if (eq system-type 'ms-dos)
2046 ;; MS-DOS cannot have initial dot.
2047 "~/_emacs.d/"
2048 "~/.emacs.d/")
2049 "Directory beneath which additional per-user Emacs-specific files are placed.
2050Various programs in Emacs store information in this directory.
2051Note that this should end with a directory separator.")
2052
2044 2053
2045;;;; Misc. useful functions. 2054;;;; Misc. useful functions.
2046 2055
diff --git a/lisp/term/mac-win.el b/lisp/term/mac-win.el
index 0a2de1e9a38..59a87e1c1cd 100644
--- a/lisp/term/mac-win.el
+++ b/lisp/term/mac-win.el
@@ -2302,7 +2302,7 @@ See also `mac-dnd-known-types'."
2302 (handler (cdr type-info)) 2302 (handler (cdr type-info))
2303 (w (posn-window (event-start event)))) 2303 (w (posn-window (event-start event))))
2304 (when handler 2304 (when handler
2305 (if (and (windowp w) (window-live-p w) 2305 (if (and (window-live-p w)
2306 (not (window-minibuffer-p w)) 2306 (not (window-minibuffer-p w))
2307 (not (window-dedicated-p w))) 2307 (not (window-dedicated-p w)))
2308 ;; If dropping in an ordinary window which we could use, 2308 ;; If dropping in an ordinary window which we could use,
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el
index c68e655a212..c779cd98ae7 100644
--- a/lisp/term/x-win.el
+++ b/lisp/term/x-win.el
@@ -263,7 +263,7 @@ See also `emacs-session-save'.")
263If the directory ~/.emacs.d exists, we make a filename in there, otherwise 263If the directory ~/.emacs.d exists, we make a filename in there, otherwise
264a file in the home directory." 264a file in the home directory."
265 (let ((basename (concat "session." session-id)) 265 (let ((basename (concat "session." session-id))
266 (emacs-dir "~/.emacs.d/")) 266 (emacs-dir user-emacs-directory))
267 (expand-file-name (if (file-directory-p emacs-dir) 267 (expand-file-name (if (file-directory-p emacs-dir)
268 (concat emacs-dir basename) 268 (concat emacs-dir basename)
269 (concat "~/.emacs-" basename))))) 269 (concat "~/.emacs-" basename)))))
diff --git a/lisp/term/xterm.el b/lisp/term/xterm.el
index 297ee7df5cd..a7249536f7b 100644
--- a/lisp/term/xterm.el
+++ b/lisp/term/xterm.el
@@ -272,8 +272,8 @@
272 (define-key map "\e[27;6;36~" [?\C-$]) 272 (define-key map "\e[27;6;36~" [?\C-$])
273 (define-key map "\e[27;6;37~" [?\C-%]) 273 (define-key map "\e[27;6;37~" [?\C-%])
274 (define-key map "\e[27;6;38~" [?\C-&]) 274 (define-key map "\e[27;6;38~" [?\C-&])
275 (define-key map "\e[27;6;40~" [?\C-(]) 275 (define-key map "\e[27;6;40~" [?\C-\(])
276 (define-key map "\e[27;6;41~" [?\C-)]) 276 (define-key map "\e[27;6;41~" [?\C-\)])
277 (define-key map "\e[27;6;42~" [?\C-*]) 277 (define-key map "\e[27;6;42~" [?\C-*])
278 (define-key map "\e[27;6;43~" [?\C-+]) 278 (define-key map "\e[27;6;43~" [?\C-+])
279 (define-key map "\e[27;6;58~" [?\C-:]) 279 (define-key map "\e[27;6;58~" [?\C-:])
@@ -312,8 +312,8 @@
312 (define-key map "\e[27;14;36~" [?\C-\M-$]) 312 (define-key map "\e[27;14;36~" [?\C-\M-$])
313 (define-key map "\e[27;14;37~" [?\C-\M-%]) 313 (define-key map "\e[27;14;37~" [?\C-\M-%])
314 (define-key map "\e[27;14;38~" [?\C-\M-&]) 314 (define-key map "\e[27;14;38~" [?\C-\M-&])
315 (define-key map "\e[27;14;40~" [?\C-\M-(]) 315 (define-key map "\e[27;14;40~" [?\C-\M-\(])
316 (define-key map "\e[27;14;41~" [?\C-\M-)]) 316 (define-key map "\e[27;14;41~" [?\C-\M-\)])
317 (define-key map "\e[27;14;42~" [?\C-\M-*]) 317 (define-key map "\e[27;14;42~" [?\C-\M-*])
318 (define-key map "\e[27;14;43~" [?\C-\M-+]) 318 (define-key map "\e[27;14;43~" [?\C-\M-+])
319 (define-key map "\e[27;14;58~" [?\C-\M-:]) 319 (define-key map "\e[27;14;58~" [?\C-\M-:])
@@ -350,8 +350,8 @@
350 (define-key map "\e[27;8;36~" [?\C-\M-$]) 350 (define-key map "\e[27;8;36~" [?\C-\M-$])
351 (define-key map "\e[27;8;37~" [?\C-\M-%]) 351 (define-key map "\e[27;8;37~" [?\C-\M-%])
352 (define-key map "\e[27;8;38~" [?\C-\M-&]) 352 (define-key map "\e[27;8;38~" [?\C-\M-&])
353 (define-key map "\e[27;8;40~" [?\C-\M-(]) 353 (define-key map "\e[27;8;40~" [?\C-\M-\(])
354 (define-key map "\e[27;8;41~" [?\C-\M-)]) 354 (define-key map "\e[27;8;41~" [?\C-\M-\)])
355 (define-key map "\e[27;8;42~" [?\C-\M-*]) 355 (define-key map "\e[27;8;42~" [?\C-\M-*])
356 (define-key map "\e[27;8;43~" [?\C-\M-+]) 356 (define-key map "\e[27;8;43~" [?\C-\M-+])
357 (define-key map "\e[27;8;58~" [?\C-\M-:]) 357 (define-key map "\e[27;8;58~" [?\C-\M-:])
diff --git a/lisp/textmodes/bibtex-style.el b/lisp/textmodes/bibtex-style.el
new file mode 100644
index 00000000000..8afc92968d9
--- /dev/null
+++ b/lisp/textmodes/bibtex-style.el
@@ -0,0 +1,155 @@
1;;; bibtex-style.el --- Major mode for BibTeX Style files
2
3;; Copyright (C) 2005,2007 Free Software Foundation, Inc.
4
5;; Author: Stefan Monnier <monnier@iro.umontreal.ca>
6;; Keywords:
7
8;; This file is free software; you can redistribute it and/or modify
9;; it under the terms of the GNU General Public License as published by
10;; the Free Software Foundation; either version 2, or (at your option)
11;; any later version.
12
13;; This file is distributed in the hope that it will be useful,
14;; but WITHOUT ANY WARRANTY; without even the implied warranty of
15;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16;; GNU General Public License for more details.
17
18;; You should have received a copy of the GNU General Public License
19;; along with GNU Emacs; see the file COPYING. If not, write to the
20;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21;; Boston, MA 02110-1301, USA.
22
23;;; Commentary:
24
25;; Done: font-lock, imenu, outline, commenting, indentation.
26;; Todo: tab-completion.
27;; Bugs:
28
29;;; Code:
30
31(defvar bibtex-style-mode-syntax-table
32 (let ((st (make-syntax-table)))
33 (modify-syntax-entry ?% "<" st)
34 (modify-syntax-entry ?\n ">" st)
35 (modify-syntax-entry ?\{ "(}" st)
36 (modify-syntax-entry ?\} "){" st)
37 (modify-syntax-entry ?\" "\"" st)
38 (modify-syntax-entry ?. "_" st)
39 (modify-syntax-entry ?' "'" st)
40 (modify-syntax-entry ?# "'" st)
41 (modify-syntax-entry ?* "." st)
42 (modify-syntax-entry ?= "." st)
43 (modify-syntax-entry ?$ "_" st)
44 st))
45
46
47(defconst bibtex-style-commands
48 '("ENTRY" "EXECUTE" "FUNCTION" "INTEGERS" "ITERATE" "MACRO" "READ"
49 "REVERSE" "SORT" "STRINGS"))
50
51(defconst bibtex-style-functions
52 ;; From http://www.eeng.dcu.ie/local-docs/btxdocs/btxhak/btxhak/node4.html.
53 '("<" ">" "=" "+" "-" "*" ":="
54 "add.period$" "call.type$" "change.case$" "chr.to.int$" "cite$"
55 "duplicate$" "empty$" "format.name$" "if$" "int.to.chr$" "int.to.str$"
56 "missing$" "newline$" "num.names$" "pop$" "preamble$" "purify$" "quote$"
57 "skip$" "stack$" "substring$" "swap$" "text.length$" "text.prefix$"
58 "top$" "type$" "warning$" "while$" "width$" "write$"))
59
60(defvar bibtex-style-font-lock-keywords
61 `((,(regexp-opt bibtex-style-commands 'words) . font-lock-keyword-face)
62 ("\\w+\\$" . font-lock-keyword-face)
63 ("\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}"
64 (2 font-lock-function-name-face))))
65
66;;;###autoload (add-to-list 'auto-mode-alist '("\\.bst\\'" . bibtex-style-mode))
67
68;;;###autoload
69(define-derived-mode bibtex-style-mode nil "BibStyle"
70 "Major mode for editing BibTeX style files."
71 (set (make-local-variable 'comment-start) "%")
72 (set (make-local-variable 'outline-regexp) "^[a-z]")
73 (set (make-local-variable 'imenu-generic-expression)
74 '((nil "\\<\\(FUNCTION\\|MACRO\\)\\s-+{\\([^}\n]+\\)}" 2)))
75 (set (make-local-variable 'indent-line-function) 'bibtex-style-indent-line)
76 (set (make-local-variable 'parse-sexp-ignore-comments) t)
77 (setq font-lock-defaults
78 '(bibtex-style-font-lock-keywords nil t
79 ((?. . "w")))))
80
81(defun bibtex-style-indent-line ()
82 "Indent current line of BibTeX Style code."
83 (interactive)
84 (let* ((savep (point))
85 (indent (condition-case nil
86 (save-excursion
87 (forward-line 0)
88 (skip-chars-forward " \t")
89 (if (>= (point) savep) (setq savep nil))
90 (max (bibtex-style-calculate-indentation) 0))
91 (error 0))))
92 (if savep
93 (save-excursion (indent-line-to indent))
94 (indent-line-to indent))))
95
96(defcustom bibtex-style-indent-basic 2
97 "Basic amount of indentation to use in BibTeX Style mode."
98 :type 'integer)
99
100(defun bibtex-style-calculate-indentation (&optional virt)
101 (or
102 ;; Stick the first line at column 0.
103 (and (= (point-min) (line-beginning-position)) 0)
104 ;; Commands start at column 0.
105 (and (looking-at (regexp-opt bibtex-style-commands 'words)) 0)
106 ;; Trust the current indentation, if such info is applicable.
107 (and virt (save-excursion (skip-chars-backward " \t{") (bolp))
108 (current-column))
109 ;; Put leading close-paren where the matching open brace would be.
110 (and (looking-at "}")
111 (condition-case nil
112 (save-excursion
113 (up-list -1)
114 (bibtex-style-calculate-indentation 'virt))
115 (scan-error nil)))
116 ;; Align leading "if$" with previous command.
117 (and (looking-at "if\\$")
118 (condition-case nil
119 (save-excursion
120 (backward-sexp 3)
121 (bibtex-style-calculate-indentation 'virt))
122 (scan-error
123 ;; There is no command before the "if$".
124 (condition-case nil
125 (save-excursion
126 (up-list -1)
127 (+ bibtex-style-indent-basic
128 (bibtex-style-calculate-indentation 'virt)))
129 (scan-error nil)))))
130 ;; Right after an opening brace.
131 (condition-case err (save-excursion (backward-sexp 1) nil)
132 (scan-error (goto-char (nth 2 err))
133 (+ bibtex-style-indent-basic
134 (bibtex-style-calculate-indentation 'virt))))
135 ;; Default, align with previous command.
136 (let ((fai ;; First arm of an "if$".
137 (condition-case nil
138 (save-excursion
139 (forward-sexp 2)
140 (forward-comment (point-max))
141 (looking-at "if\\$"))
142 (scan-error nil))))
143 (save-excursion
144 (condition-case err
145 (while (progn
146 (backward-sexp 1)
147 (save-excursion (skip-chars-backward " \t{") (not (bolp)))))
148 (scan-error nil))
149 (+ (current-column)
150 (if (or fai (looking-at "ENTRY")) bibtex-style-indent-basic 0))))))
151
152
153(provide 'bibtex-style)
154;; arch-tag: b20ad41a-fd36-466e-8fd2-cc6137f9c55c
155;;; bibtex-style.el ends here
diff --git a/lisp/textmodes/org-publish.el b/lisp/textmodes/org-publish.el
index 74cd7096935..1afcee0182b 100644
--- a/lisp/textmodes/org-publish.el
+++ b/lisp/textmodes/org-publish.el
@@ -6,8 +6,6 @@
6;; Keywords: hypermedia, outlines 6;; Keywords: hypermedia, outlines
7;; Version: 1.80 7;; Version: 1.80
8 8
9;; $Id: org-publish.el,v 1.2 2007/06/07 02:04:17 miles Exp $
10
11;; This file is free software; you can redistribute it and/or modify 9;; This file is free software; you can redistribute it and/or modify
12;; it under the terms of the GNU General Public License as published by 10;; it under the terms of the GNU General Public License as published by
13;; the Free Software Foundation; either version 2, or (at your option) 11;; the Free Software Foundation; either version 2, or (at your option)
diff --git a/lisp/thingatpt.el b/lisp/thingatpt.el
index fd387a22c0f..416812dbbf5 100644
--- a/lisp/thingatpt.el
+++ b/lisp/thingatpt.el
@@ -67,7 +67,7 @@
67 "Determine the start and end buffer locations for the THING at point. 67 "Determine the start and end buffer locations for the THING at point.
68THING is a symbol which specifies the kind of syntactic entity you want. 68THING is a symbol which specifies the kind of syntactic entity you want.
69Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', 69Possibilities include `symbol', `list', `sexp', `defun', `filename', `url',
70`word', `sentence', `whitespace', `line', `page' and others. 70`email', `word', `sentence', `whitespace', `line', `page' and others.
71 71
72See the file `thingatpt.el' for documentation on how to define 72See the file `thingatpt.el' for documentation on how to define
73a symbol as a valid THING. 73a symbol as a valid THING.
@@ -124,7 +124,7 @@ of the textual entity that was found."
124 "Return the THING at point. 124 "Return the THING at point.
125THING is a symbol which specifies the kind of syntactic entity you want. 125THING is a symbol which specifies the kind of syntactic entity you want.
126Possibilities include `symbol', `list', `sexp', `defun', `filename', `url', 126Possibilities include `symbol', `list', `sexp', `defun', `filename', `url',
127`word', `sentence', `whitespace', `line', `page' and others. 127`email', `word', `sentence', `whitespace', `line', `page' and others.
128 128
129See the file `thingatpt.el' for documentation on how to define 129See the file `thingatpt.el' for documentation on how to define
130a symbol as a valid THING." 130a symbol as a valid THING."
@@ -340,6 +340,33 @@ point."
340 (goto-char (car bounds)) 340 (goto-char (car bounds))
341 (error "No URL here"))))) 341 (error "No URL here")))))
342 342
343;; Email addresses
344(defvar thing-at-point-email-regexp
345 "<?[-+_.~a-zA-Z][-+_.~:a-zA-Z0-9]*@[-.a-zA-Z0-9]+>?"
346 "A regular expression probably matching an email address.
347This does not match the real name portion, only the address, optionally
348with angle brackets.")
349
350;; Haven't set 'forward-op on 'email nor defined 'forward-email' because
351;; not sure they're actually needed, and URL seems to skip them too.
352;; Note that (end-of-thing 'email) and (beginning-of-thing 'email)
353;; work automagically, though.
354
355(put 'email 'bounds-of-thing-at-point
356 (lambda ()
357 (let ((thing (thing-at-point-looking-at thing-at-point-email-regexp)))
358 (if thing
359 (let ((beginning (match-beginning 0))
360 (end (match-end 0)))
361 (cons beginning end))))))
362
363(put 'email 'thing-at-point
364 (lambda ()
365 (let ((boundary-pair (bounds-of-thing-at-point 'email)))
366 (if boundary-pair
367 (buffer-substring-no-properties
368 (car boundary-pair) (cdr boundary-pair))))))
369
343;; Whitespace 370;; Whitespace
344 371
345(defun forward-whitespace (arg) 372(defun forward-whitespace (arg)
diff --git a/lisp/thumbs.el b/lisp/thumbs.el
index 7df2d295c9e..56f4e45dcb3 100644
--- a/lisp/thumbs.el
+++ b/lisp/thumbs.el
@@ -67,7 +67,7 @@
67 :version "22.1" 67 :version "22.1"
68 :group 'multimedia) 68 :group 'multimedia)
69 69
70(defcustom thumbs-thumbsdir "~/.emacs.d/thumbs" 70(defcustom thumbs-thumbsdir (concat user-emacs-directory "thumbs")
71 "*Directory to store thumbnails." 71 "*Directory to store thumbnails."
72 :type 'directory 72 :type 'directory
73 :group 'thumbs) 73 :group 'thumbs)
diff --git a/lisp/tutorial.el b/lisp/tutorial.el
index 384b9b8415c..7c97579ab6e 100644
--- a/lisp/tutorial.el
+++ b/lisp/tutorial.el
@@ -623,8 +623,7 @@ with some explanatory links."
623 623
624(defun tutorial--saved-dir () 624(defun tutorial--saved-dir ()
625 "Directory to which tutorials are saved." 625 "Directory to which tutorials are saved."
626 (expand-file-name "tutorial" 626 (expand-file-name "tutorial" user-emacs-directory))
627 (if (eq system-type 'ms-dos) "~/_emacs.d/" "~/.emacs.d/")))
628 627
629(defun tutorial--saved-file () 628(defun tutorial--saved-file ()
630 "File name in which to save tutorials." 629 "File name in which to save tutorials."
diff --git a/lisp/url/ChangeLog b/lisp/url/ChangeLog
index d9efd3a4540..bd0e4b2e4b1 100644
--- a/lisp/url/ChangeLog
+++ b/lisp/url/ChangeLog
@@ -1,3 +1,18 @@
12007-06-12 Tom Tromey <tromey@redhat.com>
2
3 * url.el (url-configuration-directory): Use user-emacs-directory.
4
52007-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
6
7 * url-cookie.el (url-cookie-name, url-cookie-value)
8 (url-cookie-expires, url-cookie-localpart, url-cookie-domain)
9 (url-cookie-secure, url-cookie-set-name, url-cookie-set-value)
10 (url-cookie-set-expires, url-cookie-set-localpart)
11 (url-cookie-set-domain, url-cookie-set-secure)
12 (url-cookie-retrieve-arg, url-cookie-create, url-cookie-p): Remove.
13 (url-cookie): New struct.
14 (url-cookie-store): Use setf instead of url-cookie-set-*.
15
12007-05-29 Chong Yidong <cyd@stupidchicken.com> 162007-05-29 Chong Yidong <cyd@stupidchicken.com>
2 17
3 * url-mailto.el (url-mailto): Insert body after 18 * url-mailto.el (url-mailto): Insert body after
diff --git a/lisp/url/url-cookie.el b/lisp/url/url-cookie.el
index 8d729c92369..44ef8aed779 100644
--- a/lisp/url/url-cookie.el
+++ b/lisp/url/url-cookie.el
@@ -33,51 +33,6 @@
33 33
34;; See http://home.netscape.com/newsref/std/cookie_spec.html for the 34;; See http://home.netscape.com/newsref/std/cookie_spec.html for the
35;; 'open standard' defining this crap. 35;; 'open standard' defining this crap.
36;;
37;; A cookie is stored internally as a vector of 7 slots
38;; [ cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ]
39
40(defsubst url-cookie-name (cookie) (aref cookie 1))
41(defsubst url-cookie-value (cookie) (aref cookie 2))
42(defsubst url-cookie-expires (cookie) (aref cookie 3))
43(defsubst url-cookie-localpart (cookie) (aref cookie 4))
44(defsubst url-cookie-domain (cookie) (aref cookie 5))
45(defsubst url-cookie-secure (cookie) (aref cookie 6))
46
47(defsubst url-cookie-set-name (cookie val) (aset cookie 1 val))
48(defsubst url-cookie-set-value (cookie val) (aset cookie 2 val))
49(defsubst url-cookie-set-expires (cookie val) (aset cookie 3 val))
50(defsubst url-cookie-set-localpart (cookie val) (aset cookie 4 val))
51(defsubst url-cookie-set-domain (cookie val) (aset cookie 5 val))
52(defsubst url-cookie-set-secure (cookie val) (aset cookie 6 val))
53(defsubst url-cookie-retrieve-arg (key args) (nth 1 (memq key args)))
54
55(defsubst url-cookie-create (&rest args)
56 "Create a cookie vector object from keyword-value pairs ARGS.
57The keywords allowed are
58 :name NAME
59 :value VALUE
60 :expires TIME
61 :localpart LOCALPAR
62 :domain DOMAIN
63 :secure ???
64Could someone fill in more information?"
65 (let ((retval (make-vector 7 nil)))
66 (aset retval 0 'cookie)
67 (url-cookie-set-name retval (url-cookie-retrieve-arg :name args))
68 (url-cookie-set-value retval (url-cookie-retrieve-arg :value args))
69 (url-cookie-set-expires retval (url-cookie-retrieve-arg :expires args))
70 (url-cookie-set-localpart retval (url-cookie-retrieve-arg :localpart args))
71 (url-cookie-set-domain retval (url-cookie-retrieve-arg :domain args))
72 (url-cookie-set-secure retval (url-cookie-retrieve-arg :secure args))
73 retval))
74
75(defun url-cookie-p (obj)
76 "Return non-nil if OBJ is a cookie vector object.
77These objects represent cookies in the URL package.
78A cookie vector object is a vector of 7 slots:
79 [cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE]."
80 (and (vectorp obj) (= (length obj) 7) (eq (aref obj 0) 'cookie)))
81 36
82(defgroup url-cookie nil 37(defgroup url-cookie nil
83 "URL cookies." 38 "URL cookies."
@@ -85,6 +40,20 @@ A cookie vector object is a vector of 7 slots:
85 :prefix "url-cookie-" 40 :prefix "url-cookie-"
86 :group 'url) 41 :group 'url)
87 42
43;; A cookie is stored internally as a vector of 7 slots
44;; [ cookie NAME VALUE EXPIRES LOCALPART DOMAIN SECURE ]
45
46(defstruct (url-cookie
47 (:constructor url-cookie-create)
48 (:copier nil)
49 ;; For compatibility with a previous version which did not use
50 ;; defstruct, and also in order to make sure that the printed
51 ;; representation does not depend on CL internals, we use an
52 ;; explicitly managed tag.
53 (:type vector))
54 (tag 'cookie :read-only t)
55 name value expires localpart domain secure)
56
88(defvar url-cookie-storage nil "Where cookies are stored.") 57(defvar url-cookie-storage nil "Where cookies are stored.")
89(defvar url-cookie-secure-storage nil "Where secure cookies are stored.") 58(defvar url-cookie-secure-storage nil "Where secure cookies are stored.")
90(defcustom url-cookie-file nil 59(defcustom url-cookie-file nil
@@ -199,8 +168,8 @@ telling Microsoft that."
199 (if (and (equal localpart (url-cookie-localpart cur)) 168 (if (and (equal localpart (url-cookie-localpart cur))
200 (equal name (url-cookie-name cur))) 169 (equal name (url-cookie-name cur)))
201 (progn 170 (progn
202 (url-cookie-set-expires cur expires) 171 (setf (url-cookie-expires cur) expires)
203 (url-cookie-set-value cur value) 172 (setf (url-cookie-value cur) value)
204 (setq tmp t)))) 173 (setq tmp t))))
205 (if (not tmp) 174 (if (not tmp)
206 ;; New cookie 175 ;; New cookie
diff --git a/lisp/url/url.el b/lisp/url/url.el
index a150733e40d..4cdf781e87f 100644
--- a/lisp/url/url.el
+++ b/lisp/url/url.el
@@ -50,7 +50,8 @@
50(defvar url-configuration-directory 50(defvar url-configuration-directory
51 (cond 51 (cond
52 ((file-directory-p "~/.url") "~/.url") 52 ((file-directory-p "~/.url") "~/.url")
53 ((file-directory-p "~/.emacs.d") "~/.emacs.d/url") 53 ((file-directory-p user-emacs-directory)
54 (concat user-emacs-directory "url"))
54 (t "~/.url"))) 55 (t "~/.url")))
55 56
56(defun url-do-setup () 57(defun url-do-setup ()
diff --git a/lisp/vc-arch.el b/lisp/vc-arch.el
index 488f9108d36..ede8c57ec98 100644
--- a/lisp/vc-arch.el
+++ b/lisp/vc-arch.el
@@ -62,7 +62,7 @@
62;;; 62;;;
63 63
64(defvar vc-arch-command 64(defvar vc-arch-command
65 (let ((candidates '("tla"))) 65 (let ((candidates '("tla" "baz")))
66 (while (and candidates (not (executable-find (car candidates)))) 66 (while (and candidates (not (executable-find (car candidates))))
67 (setq candidates (cdr candidates))) 67 (setq candidates (cdr candidates)))
68 (or (car candidates) "tla"))) 68 (or (car candidates) "tla")))
diff --git a/lisp/vc-bzr.el b/lisp/vc-bzr.el
index 0ff1668cf80..e5481b5f405 100644
--- a/lisp/vc-bzr.el
+++ b/lisp/vc-bzr.el
@@ -463,8 +463,12 @@ Return nil if current line isn't annotated."
463;; if there are any symbolic links. 463;; if there are any symbolic links.
464(defun vc-bzr-root (dir) 464(defun vc-bzr-root (dir)
465 "Return the root directory of the bzr repository containing DIR." 465 "Return the root directory of the bzr repository containing DIR."
466 (substring 466 ;; Cache technique copied from vc-arch.el.
467 (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1)) 467 (or (vc-file-getprop dir 'bzr-root)
468 (vc-file-setprop
469 dir 'bzr-root
470 (substring
471 (shell-command-to-string (concat vc-bzr-program " root " dir)) 0 -1))))
468 472
469;; TODO: it would be nice to mark the conflicted files in VC Dired, 473;; TODO: it would be nice to mark the conflicted files in VC Dired,
470;; and implement a command to run ediff and `bzr resolve' once the 474;; and implement a command to run ediff and `bzr resolve' once the
diff --git a/lisp/vc-svn.el b/lisp/vc-svn.el
index 1538a2a1ab3..b109f48d91d 100644
--- a/lisp/vc-svn.el
+++ b/lisp/vc-svn.el
@@ -464,11 +464,16 @@ NAME is assumed to be a URL."
464;;; Internal functions 464;;; Internal functions
465;;; 465;;;
466 466
467(defcustom vc-svn-program "svn"
468 "Name of the svn executable."
469 :type 'string
470 :group 'vc)
471
467(defun vc-svn-command (buffer okstatus file &rest flags) 472(defun vc-svn-command (buffer okstatus file &rest flags)
468 "A wrapper around `vc-do-command' for use in vc-svn.el. 473 "A wrapper around `vc-do-command' for use in vc-svn.el.
469The difference to vc-do-command is that this function always invokes `svn', 474The difference to vc-do-command is that this function always invokes `svn',
470and that it passes `vc-svn-global-switches' to it before FLAGS." 475and that it passes `vc-svn-global-switches' to it before FLAGS."
471 (apply 'vc-do-command buffer okstatus "svn" file 476 (apply 'vc-do-command buffer okstatus vc-svn-program file
472 (if (stringp vc-svn-global-switches) 477 (if (stringp vc-svn-global-switches)
473 (cons vc-svn-global-switches flags) 478 (cons vc-svn-global-switches flags)
474 (append vc-svn-global-switches 479 (append vc-svn-global-switches
diff --git a/lisp/vc.el b/lisp/vc.el
index a65e698669e..d5c53a15a76 100644
--- a/lisp/vc.el
+++ b/lisp/vc.el
@@ -2096,7 +2096,7 @@ See Info node `Merging'."
2096 (define-key vmap "t" 'vc-dired-toggle-terse-mode) 2096 (define-key vmap "t" 'vc-dired-toggle-terse-mode)
2097 map)) 2097 map))
2098 2098
2099(define-derived-mode vc-dired-mode dired-mode "Dired under VC" 2099(define-derived-mode vc-dired-mode dired-mode "Dired under "
2100 "The major mode used in VC directory buffers. 2100 "The major mode used in VC directory buffers.
2101 2101
2102It works like Dired, but lists only files under version control, with 2102It works like Dired, but lists only files under version control, with
@@ -2156,6 +2156,8 @@ There is a special command, `*l', to mark all files currently locked."
2156 (set (make-local-variable 'dired-actual-switches) 2156 (set (make-local-variable 'dired-actual-switches)
2157 vc-dired-switches)) 2157 vc-dired-switches))
2158 (set (make-local-variable 'vc-dired-terse-mode) vc-dired-terse-display) 2158 (set (make-local-variable 'vc-dired-terse-mode) vc-dired-terse-display)
2159 (setq mode-name (concat mode-name (symbol-name (vc-responsible-backend
2160 default-directory))))
2159 (setq vc-dired-mode t)) 2161 (setq vc-dired-mode t))
2160 2162
2161(defun vc-dired-toggle-terse-mode () 2163(defun vc-dired-toggle-terse-mode ()
@@ -2214,7 +2216,9 @@ Called by dired after any portion of a vc-dired buffer has been read in."
2214 ;; if the backend supports it, get the state 2216 ;; if the backend supports it, get the state
2215 ;; of all files in this directory at once 2217 ;; of all files in this directory at once
2216 (let ((backend (vc-responsible-backend subdir))) 2218 (let ((backend (vc-responsible-backend subdir)))
2217 (if (vc-find-backend-function backend 'dir-state) 2219 ;; check `backend' can really handle `subdir'.
2220 (if (and (vc-call-backend backend 'responsible-p subdir)
2221 (vc-find-backend-function backend 'dir-state))
2218 (vc-call-backend backend 'dir-state subdir))) 2222 (vc-call-backend backend 'dir-state subdir)))
2219 (forward-line 1) 2223 (forward-line 1)
2220 ;; erase (but don't remove) the "total" line 2224 ;; erase (but don't remove) the "total" line
diff --git a/lisp/wid-edit.el b/lisp/wid-edit.el
index 9c791631e33..1cb32e5f951 100644
--- a/lisp/wid-edit.el
+++ b/lisp/wid-edit.el
@@ -1491,6 +1491,8 @@ If that does not exists, call the value of `widget-complete-field'."
1491 (delete-backward-char 1)) 1491 (delete-backward-char 1))
1492 (insert ?\n) 1492 (insert ?\n)
1493 (setq doc-end (point))))) 1493 (setq doc-end (point)))))
1494 ((eq escape ?h)
1495 (widget-add-documentation-string-button widget))
1494 ((eq escape ?v) 1496 ((eq escape ?v)
1495 (if (and button-begin (not button-end)) 1497 (if (and button-begin (not button-end))
1496 (widget-apply widget :value-create) 1498 (widget-apply widget :value-create)
@@ -1516,44 +1518,7 @@ If that does not exists, call the value of `widget-complete-field'."
1516 (widget-clear-undo)) 1518 (widget-clear-undo))
1517 1519
1518(defun widget-default-format-handler (widget escape) 1520(defun widget-default-format-handler (widget escape)
1519 ;; We recognize the %h escape by default. 1521 (error "Unknown escape `%c'" escape))
1520 (let* ((buttons (widget-get widget :buttons)))
1521 (cond ((eq escape ?h)
1522 (let* ((doc-property (widget-get widget :documentation-property))
1523 (doc-try (cond ((widget-get widget :doc))
1524 ((functionp doc-property)
1525 (funcall doc-property
1526 (widget-get widget :value)))
1527 ((symbolp doc-property)
1528 (documentation-property
1529 (widget-get widget :value)
1530 doc-property))))
1531 (doc-text (and (stringp doc-try)
1532 (> (length doc-try) 1)
1533 doc-try))
1534 (doc-indent (widget-get widget :documentation-indent)))
1535 (when doc-text
1536 (and (eq (preceding-char) ?\n)
1537 (widget-get widget :indent)
1538 (insert-char ?\s (widget-get widget :indent)))
1539 ;; The `*' in the beginning is redundant.
1540 (when (eq (aref doc-text 0) ?*)
1541 (setq doc-text (substring doc-text 1)))
1542 ;; Get rid of trailing newlines.
1543 (when (string-match "\n+\\'" doc-text)
1544 (setq doc-text (substring doc-text 0 (match-beginning 0))))
1545 (push (widget-create-child-and-convert
1546 widget 'documentation-string
1547 :indent (cond ((numberp doc-indent )
1548 doc-indent)
1549 ((null doc-indent)
1550 nil)
1551 (t 0))
1552 doc-text)
1553 buttons))))
1554 (t
1555 (error "Unknown escape `%c'" escape)))
1556 (widget-put widget :buttons buttons)))
1557 1522
1558(defun widget-default-button-face-get (widget) 1523(defun widget-default-button-face-get (widget)
1559 ;; Use :button-face or widget-button-face 1524 ;; Use :button-face or widget-button-face
@@ -1665,13 +1630,32 @@ If that does not exists, call the value of `widget-complete-field'."
1665 (widget-default-action widget event)) 1630 (widget-default-action widget event))
1666 1631
1667(defun widget-default-prompt-value (widget prompt value unbound) 1632(defun widget-default-prompt-value (widget prompt value unbound)
1668 "Read an arbitrary value. Stolen from `set-variable'." 1633 "Read an arbitrary value."
1669;; (let ((initial (if unbound
1670;; nil
1671;; It would be nice if we could do a `(cons val 1)' here.
1672;; (prin1-to-string (custom-quote value))))))
1673 (eval-minibuffer prompt)) 1634 (eval-minibuffer prompt))
1674 1635
1636(defun widget-docstring (widget)
1637 "Return the documentation string specificied by WIDGET, or nil if none.
1638If WIDGET has a `:doc' property, that specifies the documentation string.
1639Otherwise, try the `:documentation-property' property. If this
1640is a function, call it with the widget's value as an argument; if
1641it is a symbol, use this symbol together with the widget's value
1642as the argument to `documentation-property'."
1643 (let ((doc (or (widget-get widget :doc)
1644 (let ((doc-prop (widget-get widget :documentation-property))
1645 (value (widget-get widget :value)))
1646 (cond ((functionp doc-prop)
1647 (funcall doc-prop value))
1648 ((symbolp doc-prop)
1649 (documentation-property value doc-prop)))))))
1650 (when (and (stringp doc) (> (length doc) 0))
1651 ;; Remove any redundant `*' in the beginning.
1652 (when (eq (aref doc 0) ?*)
1653 (setq doc (substring doc 1)))
1654 ;; Remove trailing newlines.
1655 (when (string-match "\n+\\'" doc)
1656 (setq doc (substring doc 0 (match-beginning 0))))
1657 doc)))
1658
1675;;; The `item' Widget. 1659;;; The `item' Widget.
1676 1660
1677(define-widget 'item 'default 1661(define-widget 'item 'default
@@ -2913,7 +2897,8 @@ link for that string."
2913 "A documentation string." 2897 "A documentation string."
2914 :format "%v" 2898 :format "%v"
2915 :action 'widget-documentation-string-action 2899 :action 'widget-documentation-string-action
2916 :value-create 'widget-documentation-string-value-create) 2900 :value-create 'widget-documentation-string-value-create
2901 :visibility-widget 'visibility)
2917 2902
2918(defun widget-documentation-string-value-create (widget) 2903(defun widget-documentation-string-value-create (widget)
2919 ;; Insert documentation string. 2904 ;; Insert documentation string.
@@ -2929,7 +2914,7 @@ link for that string."
2929 (widget-documentation-link-add widget start (point)) 2914 (widget-documentation-link-add widget start (point))
2930 (setq button 2915 (setq button
2931 (widget-create-child-and-convert 2916 (widget-create-child-and-convert
2932 widget 'visibility 2917 widget (widget-get widget :visibility-widget)
2933 :help-echo "Show or hide rest of the documentation." 2918 :help-echo "Show or hide rest of the documentation."
2934 :on "Hide Rest" 2919 :on "Hide Rest"
2935 :off "More" 2920 :off "More"
@@ -2954,6 +2939,29 @@ link for that string."
2954 (not (widget-get parent :documentation-shown)))) 2939 (not (widget-get parent :documentation-shown))))
2955 ;; Redraw. 2940 ;; Redraw.
2956 (widget-value-set widget (widget-value widget))) 2941 (widget-value-set widget (widget-value widget)))
2942
2943(defun widget-add-documentation-string-button (widget &rest args)
2944 "Insert a new `documentation-string' widget based on WIDGET.
2945The new widget becomes a child of WIDGET, and is also added to
2946its `:buttons' list. The documentation string is found from
2947WIDGET using the function `widget-docstring'.
2948Optional ARGS specifies additional keyword arguments for the
2949`documentation-string' widget."
2950 (let ((doc (widget-docstring widget))
2951 (indent (widget-get widget :indent))
2952 (doc-indent (widget-get widget :documentation-indent)))
2953 (when doc
2954 (and (eq (preceding-char) ?\n)
2955 indent
2956 (insert-char ?\s indent))
2957 (unless (or (numberp doc-indent) (null doc-indent))
2958 (setq doc-indent 0))
2959 (widget-put widget :buttons
2960 (cons (apply 'widget-create-child-and-convert
2961 widget 'documentation-string
2962 :indent doc-indent
2963 (nconc args (list doc)))
2964 (widget-get widget :buttons))))))
2957 2965
2958;;; The Sexp Widgets. 2966;;; The Sexp Widgets.
2959 2967
diff --git a/lisp/x-dnd.el b/lisp/x-dnd.el
index c3a9e7910a6..a215faab85e 100644
--- a/lisp/x-dnd.el
+++ b/lisp/x-dnd.el
@@ -171,7 +171,7 @@ FRAME-OR-WINDOW is the frame or window that the mouse is over."
171WINDOW is the window the mouse is over. ACTION is the suggested 171WINDOW is the window the mouse is over. ACTION is the suggested
172action from the source. If nothing has changed, return the last 172action from the source. If nothing has changed, return the last
173action and type we got from `x-dnd-test-function'." 173action and type we got from `x-dnd-test-function'."
174 (let ((buffer (when (and (windowp window) (window-live-p window)) 174 (let ((buffer (when (window-live-p window)
175 (window-buffer window))) 175 (window-buffer window)))
176 (current-state (x-dnd-get-state-for-frame window))) 176 (current-state (x-dnd-get-state-for-frame window)))
177 (when (or (not (equal buffer (aref current-state 0))) 177 (when (or (not (equal buffer (aref current-state 0)))
@@ -206,9 +206,7 @@ EXTRA-DATA is data needed for a specific protocol."
206 (when types (aset current-state 2 types)) 206 (when types (aset current-state 2 types))
207 (when extra-data (aset current-state 6 extra-data)) 207 (when extra-data (aset current-state 6 extra-data))
208 (aset current-state 1 window) 208 (aset current-state 1 window)
209 (aset current-state 0 (if (and (windowp window) 209 (aset current-state 0 (and (window-live-p window) (window-buffer window)))
210 (window-live-p window))
211 (window-buffer window) nil))
212 (setcdr (x-dnd-get-state-cons-for-frame window) current-state))) 210 (setcdr (x-dnd-get-state-cons-for-frame window) current-state)))
213 211
214 212
@@ -319,7 +317,7 @@ nil if not."
319 (action (aref state 5)) 317 (action (aref state 5))
320 (w (posn-window (event-start event)))) 318 (w (posn-window (event-start event))))
321 (when handler 319 (when handler
322 (if (and (windowp w) (window-live-p w) 320 (if (and (window-live-p w)
323 (not (window-minibuffer-p w)) 321 (not (window-minibuffer-p w))
324 (not (window-dedicated-p w))) 322 (not (window-dedicated-p w)))
325 ;; If dropping in an ordinary window which we could use, 323 ;; If dropping in an ordinary window which we could use,
diff --git a/lispref/.gitignore b/lispref/.gitignore
index fddb4062824..a149258f6dd 100644
--- a/lispref/.gitignore
+++ b/lispref/.gitignore
@@ -11,3 +11,7 @@ index.texi
11elisp 11elisp
12elisp-? 12elisp-?
13elisp-?? 13elisp-??
14vol1.*
15vol2.*
16elisp1*
17elisp2*
diff --git a/lispref/ChangeLog b/lispref/ChangeLog
index 7802c74f054..20006d9eea7 100644
--- a/lispref/ChangeLog
+++ b/lispref/ChangeLog
@@ -1,3 +1,25 @@
12007-06-15 Juanma Barranquero <lekktu@gmail.com>
2
3 * display.texi (Overlay Arrow): Doc fix.
4
52007-06-14 Karl Berry <karl@tug.org>
6
7 * anti.texi (Antinews): Typo.
8
92007-06-14 Chong Yidong <cyd@stupidchicken.com>
10
11 * display.texi (Image Cache): Document image-refresh.
12
132007-06-12 Karl Berry <karl@gnu.org>
14
15 * vol1.texi, vol2.texi, two-volume-cross-refs.txt: Update.
16 * two-volume.make: New file.
17 * .cvsignore: Ignore two-volume files.
18
192007-06-12 Tom Tromey <tromey@redhat.com>
20
21 * os.texi (Init File): Document user-emacs-directory.
22
12007-06-03 Nick Roberts <nickrob@snap.net.nz> 232007-06-03 Nick Roberts <nickrob@snap.net.nz>
2 24
3 * commands.texi (Click Events): Describe width and height when 25 * commands.texi (Click Events): Describe width and height when
@@ -58,7 +80,7 @@
58 80
592007-05-07 Karl Berry <karl@gnu.org> 812007-05-07 Karl Berry <karl@gnu.org>
60 82
61 * elisp.texi (EMACSVER): back to 22. 83 * elisp.texi (EMACSVER): Back to 22.
62 84
632007-05-06 Richard Stallman <rms@gnu.org> 852007-05-06 Richard Stallman <rms@gnu.org>
64 86
@@ -81,7 +103,7 @@
812007-05-03 Karl Berry <karl@gnu.org> 1032007-05-03 Karl Berry <karl@gnu.org>
82 104
83 * elisp.texi (\urlcolor, \linkcolor) [smallbook]: \Black for printing. 105 * elisp.texi (\urlcolor, \linkcolor) [smallbook]: \Black for printing.
84 (EMACSVER) [smallbook]: 22 for printed version. 106 (EMACSVER) [smallbook]: 22 for printed version.
85 107
86 * control.texi (Signaling Errors) <signal>: texinfo.tex is fixed, 108 * control.texi (Signaling Errors) <signal>: texinfo.tex is fixed,
87 so restore anchor to normal position after defun. Found by Kevin Ryde. 109 so restore anchor to normal position after defun. Found by Kevin Ryde.
@@ -143,16 +165,16 @@
143 165
1442007-04-11 Karl Berry <karl@gnu.org> 1662007-04-11 Karl Berry <karl@gnu.org>
145 167
146 * anti.texi (Antinews), 168 * anti.texi (Antinews):
147 * display.texi (Overlay Properties) and (Defining Images), 169 * display.texi (Overlay Properties, Defining Images):
148 * processes.texi (Synchronous Processes) and (Sentinels), 170 * processes.texi (Synchronous Processes, Sentinels):
149 * syntax.texi (Syntax Table Internals), 171 * syntax.texi (Syntax Table Internals):
150 * searching.texi (Regexp Special), 172 * searching.texi (Regexp Special):
151 * nonascii.texi (Default Coding Systems), 173 * nonascii.texi (Default Coding Systems):
152 * text.texi (Special Properties), 174 * text.texi (Special Properties):
153 * minibuf.texi (Basic Completion): Wording to improve breaks in 175 * minibuf.texi (Basic Completion): Wording to improve breaks in
154 8.5x11 format. 176 8.5x11 format.
155 * elisp.texi (smallbook): new @set to more easily switch between 177 * elisp.texi (smallbook): New @set to more easily switch between
156 smallbook and 8.5x11. 178 smallbook and 8.5x11.
157 179
1582007-04-11 Richard Stallman <rms@gnu.org> 1802007-04-11 Richard Stallman <rms@gnu.org>
@@ -299,10 +321,10 @@
299 321
3002007-04-01 Karl Berry <karl@gnu.org> 3222007-04-01 Karl Berry <karl@gnu.org>
301 323
302 * processes.texi (Low-Level Network): typo. 324 * processes.texi (Low-Level Network): Typo.
303 * loading.texi (Hooks for Loading): avoid double "the". 325 * loading.texi (Hooks for Loading): Avoid double "the".
304 * keymaps.texi (Key Sequences): no double "and". 326 * keymaps.texi (Key Sequences): No double "and".
305 (Changing Key Bindings): shorten to improve line break. 327 (Changing Key Bindings): Shorten to improve line break.
306 328
3072007-03-31 Glenn Morris <rgm@gnu.org> 3292007-03-31 Glenn Morris <rgm@gnu.org>
308 330
diff --git a/lispref/anti.texi b/lispref/anti.texi
index b258e959a46..1ec0c5ef327 100644
--- a/lispref/anti.texi
+++ b/lispref/anti.texi
@@ -111,7 +111,7 @@ Several simplifications have been made to mouse support:
111@item 111@item
112Clicking @kbd{mouse-1} won't follow links, as that is alien to the 112Clicking @kbd{mouse-1} won't follow links, as that is alien to the
113spirit of Emacs. Therefore, the @code{follow-link} property doesn't 113spirit of Emacs. Therefore, the @code{follow-link} property doesn't
114has any special meaning, and the function @code{mouse-on-link-p} has 114have any special meaning, and the function @code{mouse-on-link-p} has
115been removed. 115been removed.
116 116
117@item 117@item
diff --git a/lispref/display.texi b/lispref/display.texi
index f644a02c2eb..664ad1d2c15 100644
--- a/lispref/display.texi
+++ b/lispref/display.texi
@@ -3103,7 +3103,7 @@ overwritten.
3103 3103
3104The overlay-arrow string is displayed in any given buffer if the value 3104The overlay-arrow string is displayed in any given buffer if the value
3105of @code{overlay-arrow-position} in that buffer points into that 3105of @code{overlay-arrow-position} in that buffer points into that
3106buffer. Thus, it works to can display multiple overlay arrow strings 3106buffer. Thus, it is possible to display multiple overlay arrow strings
3107by creating buffer-local bindings of @code{overlay-arrow-position}. 3107by creating buffer-local bindings of @code{overlay-arrow-position}.
3108However, it is usually cleaner to use 3108However, it is usually cleaner to use
3109@code{overlay-arrow-variable-list} to achieve this result. 3109@code{overlay-arrow-variable-list} to achieve this result.
@@ -4276,13 +4276,43 @@ cache, it can always be displayed, even if the value of
4276@subsection Image Cache 4276@subsection Image Cache
4277@cindex image cache 4277@cindex image cache
4278 4278
4279 Emacs stores images in an image cache when it displays them, so it can 4279 Emacs stores images in an image cache so that it can display them
4280display them again more efficiently. It removes an image from the cache 4280again more efficiently. When Emacs displays an image, it searches the
4281when it hasn't been displayed for a specified period of time. 4281image cache for an existing image specification @code{equal} to the
4282desired specification. If a match is found, the image is displayed
4283from the cache; otherwise, Emacs loads the image normally.
4284
4285 Occasionally, you may need to tell Emacs to refresh the images
4286associated with a given image specification. For example, suppose you
4287display an image using a specification that contains a @code{:file}
4288property. The image is loaded from the given file and stored in the
4289image cache. If you later display the image again, using the same
4290image specification, the image is displayed from the image cache.
4291Normally, this is not a problem. However, if the image file has
4292changed in the meantime, Emacs would be displaying the old version of
4293the image. In such a situation, it is necessary to ``refresh'' the
4294image using @code{image-refresh}.
4295
4296@defun image-refresh spec &optional frame
4297This function refreshes any images having image specifications
4298@code{equal} to @var{spec} on frame @var{frame}. If @var{frame} is
4299@code{nil}, the selected frame is used. If @var{frame} is @code{t},
4300the refresh is applied to all existing frames.
4301
4302This works by removing all image with image specifications matching
4303@var{spec} from the image cache. Thus, the next time the image is
4304displayed, Emacs will load the image again.
4305@end defun
4306
4307@defun clear-image-cache &optional frame
4308This function clears the entire image cache. If @var{frame} is
4309non-@code{nil}, only the cache for that frame is cleared. Otherwise,
4310all frames' caches are cleared.
4311@end defun
4282 4312
4283When an image is looked up in the cache, its specification is compared 4313If an image in the image cache has not been displayed for a specified
4284with cached image specifications using @code{equal}. This means that 4314period of time, Emacs removes it from the cache and frees the
4285all images with equal specifications share the same image in the cache. 4315associated memory.
4286 4316
4287@defvar image-cache-eviction-delay 4317@defvar image-cache-eviction-delay
4288This variable specifies the number of seconds an image can remain in the 4318This variable specifies the number of seconds an image can remain in the
@@ -4294,12 +4324,6 @@ except when you explicitly clear it. This mode can be useful for
4294debugging. 4324debugging.
4295@end defvar 4325@end defvar
4296 4326
4297@defun clear-image-cache &optional frame
4298This function clears the image cache. If @var{frame} is non-@code{nil},
4299only the cache for that frame is cleared. Otherwise all frames' caches
4300are cleared.
4301@end defun
4302
4303@node Buttons 4327@node Buttons
4304@section Buttons 4328@section Buttons
4305@cindex buttons in buffers 4329@cindex buttons in buffers
diff --git a/lispref/os.texi b/lispref/os.texi
index 498cc857eab..08f94b427eb 100644
--- a/lispref/os.texi
+++ b/lispref/os.texi
@@ -258,6 +258,11 @@ actual init file loaded is a compiled file, such as @file{.emacs.elc},
258the value refers to the corresponding source file. 258the value refers to the corresponding source file.
259@end defvar 259@end defvar
260 260
261@defvar user-emacs-directory
262This variable holds the name of the @file{.emacs.d} directory. It is
263ordinarily @file{~/.emacs.d}, but differs on some platforms.
264@end defvar
265
261@node Terminal-Specific 266@node Terminal-Specific
262@subsection Terminal-Specific Initialization 267@subsection Terminal-Specific Initialization
263@cindex terminal-specific initialization 268@cindex terminal-specific initialization
diff --git a/lispref/searching.texi b/lispref/searching.texi
index 10e8c672962..70926478ea7 100644
--- a/lispref/searching.texi
+++ b/lispref/searching.texi
@@ -650,6 +650,16 @@ Shy groups are particularly useful for mechanically-constructed regular
650expressions because they can be added automatically without altering the 650expressions because they can be added automatically without altering the
651numbering of any ordinary, non-shy groups. 651numbering of any ordinary, non-shy groups.
652 652
653@item \(?@var{num}: @dots{} \)
654is the @dfn{explicitly numbered group} construct. Normal groups get
655their number implicitly, based on their position, which can be
656inconvenient. This construct allows you to force a particular group
657number. There is no particular restriction on the numbering,
658e.g.@: you can have several groups with the same number in which case
659the last one to match (i.e.@: the rightmost match) will win.
660Implicitly numbered groups always get the smallest integer larger than
661the one of any previous group.
662
653@item \@var{digit} 663@item \@var{digit}
654matches the same text that matched the @var{digit}th occurrence of a 664matches the same text that matched the @var{digit}th occurrence of a
655grouping (@samp{\( @dots{} \)}) construct. 665grouping (@samp{\( @dots{} \)}) construct.
diff --git a/lispref/two-volume-cross-refs.txt b/lispref/two-volume-cross-refs.txt
index 07624f99b49..1e923cab8e6 100644
--- a/lispref/two-volume-cross-refs.txt
+++ b/lispref/two-volume-cross-refs.txt
@@ -5,7 +5,24 @@ Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007
5Two Volume Cross References 5Two Volume Cross References
6=========================== 6===========================
7 7
818 March 1992 812 June 2007 (karl)
9
10For lispref 2.9 (for Emacs 22, June 2007), I created a very ugly
11Makefile, in the file two-volume.make, to encapsulate all the steps
12below, without manual intervention. In theory, simply running "make -f
13two-volume.make" should create a vol1.pdf and vol2.pdf with all the
14niceties worked out.
15
16One issue not explicitly discussed below is getting page numbers right.
17It's not enough to go through the whole process. You have to go through
18the whole process twice -- otherwise, some index entries and/or toc
19entries will be off by one. See two-volume.make for a few more comments.
20
21For future editions, it should suffice to update the usual things in
22vol[12].texi (as well as elisp.texi). That was my hope, anyway.
23
24
2518 March 1992 (bob)
9 26
10This enables you to create manuals in *two* volumes, with tables of 27This enables you to create manuals in *two* volumes, with tables of
11contents, cross references, and indices in each volume referring to 28contents, cross references, and indices in each volume referring to
@@ -57,23 +74,23 @@ Here are the steps in detail:
57% cp vol1.aux elisp1-aux 74% cp vol1.aux elisp1-aux
58% cp vol2.aux elisp2-aux 75% cp vol2.aux elisp2-aux
59 76
60% cp vol1.aux elisp1-aux-vol-number-added 77% cp vol1.aux elisp1-aux-vol-added
61% cp vol2.aux elisp2-aux-vol-number-added 78% cp vol2.aux elisp2-aux-vol-added
62 79
63on elisp1-aux-vol-number-added 80on elisp1-aux-vol-number-added
64(volume-aux-markup 1) see defun for volum-aux-markup below. 81(volume-aux-markup 1) see defun for volume-aux-markup below.
65to create elisp1-aux-vol-number-added 82to create elisp1-aux-vol-added
66 83
67on elisp2-aux-vol-number-added 84on elisp2-aux-vol-number-added
68(volume-aux-markup 2) 85(volume-aux-markup 2)
69to create elisp2-aux-vol-number-added 86to create elisp2-aux-vol-added
70 87
71insert elisp2-aux-vol-number-added into vol1.aux (append) 88insert elisp2-aux-vol-added into vol1.aux (append)
72insert elisp1-aux-vol-number-added into vol2.aux (prepend) 89insert elisp1-aux-vol-added into vol2.aux (prepend)
73 90
74(so you dont have to do it again) 91(so you dont have to do it again)
75% cp vol1.aux elisp1-aux-2vol-ready 92% cp vol1.aux elisp1-aux-ready
76% cp vol2.aux elisp2-aux-2vol-ready 93% cp vol2.aux elisp2-aux-ready
77 94
78 95
79### Create .fn files with volume numbers for other volume. 96### Create .fn files with volume numbers for other volume.
@@ -167,45 +184,6 @@ Do not change the .texi files; they will call the elisp-toc-2vol.toc file.
167% tex vol2.texi 184% tex vol2.texi
168 185
169================================================================ 186================================================================
170
171@c ================================================================
172@tex
173% Special @contents command
174% This inputs fixed up table of contents file rather than create new one.
175\global\def\contents{%
176 \startcontents{Table of Contents}%
177 \input elisp-toc-2vol.toc
178 \endgroup
179 \vfill \eject
180}
181
182% Special @summarycontents command
183% This inputs fixed up table of contents file rather than create new one.
184\outer\def\summarycontents{%
185 \startcontents{Short Contents}%
186 %
187 \let\chapentry = \shortchapentry
188 \let\unnumbchapentry = \shortunnumberedentry
189 % We want a true roman here for the page numbers.
190 \secfonts
191 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
192 \rm
193 \advance\baselineskip by 1pt % Open it up a little.
194 \def\secentry ##1##2##3##4{}
195 \def\unnumbsecentry ##1##2{}
196 \def\subsecentry ##1##2##3##4##5{}
197 \def\unnumbsubsecentry ##1##2{}
198 \def\subsubsecentry ##1##2##3##4##5##6{}
199 \def\unnumbsubsubsecentry ##1##2{}
200 \input elisp-toc-2vol.toc
201 \endgroup
202 \vfill \eject
203}
204@end tex
205@c ================================================================
206
207
208================================================================
209 187
210 188
211(defun volume-aux-markup (arg) 189(defun volume-aux-markup (arg)
diff --git a/lispref/two-volume.make b/lispref/two-volume.make
new file mode 100644
index 00000000000..5b531ab87a5
--- /dev/null
+++ b/lispref/two-volume.make
@@ -0,0 +1,227 @@
1# Copyright 2007 Free Software Foundation, Inc.
2# See end for copying conditions.
3
4# although it would be nice to use tex rather than pdftex to avoid
5# colors, spurious warnings about names being referenced but not
6# existing, etc., dvips | ps2pdf doesn't preserve the page size.
7# Instead of creating a special dvips config file, put up with the warnings.
8tex = pdftex -interaction=nonstopmode
9
10all: vol1.pdf vol2.pdf
11
12# vol1.texi and vol2.texi specially define \tocreadfilename so we can
13# use our premade .toc's.
14#
15vol1.pdf: elisp1med-fns-ready elisp1med-aux-ready elisp1med-toc-ready
16 @echo -e "\f Final TeX run for volume 1..."
17 cp elisp1med-toc-ready elisp1-toc-ready.toc
18 cp elisp1med-fns-ready vol1.fns
19 cp elisp1med-aux-ready vol1.aux
20 $(tex) vol1.texi
21#
22vol2.pdf: elisp2med-fns-ready elisp2med-aux-ready elisp2med-toc-ready
23 @echo "Final TeX run for volume 2..."
24 cp elisp2med-toc-ready elisp2-toc-ready.toc
25 cp elisp2med-fns-ready vol2.fns
26 cp elisp2med-aux-ready vol2.aux
27 $(tex) vol2.texi
28
29# intermediate toc files.
30#
31# vol1 toc: volume 1, page break, volume 2 (with II: prepended).
32elisp1med-toc-ready: elisp1med-init elisp2med-init
33 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
34 cat elisp1med-toc >>$@
35 echo '@page' >>$@
36 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
37 sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2med-toc >>$@
38#
39# vol2 toc: volume 1 (with I: prepended), page break, volume 2.
40elisp2med-toc-ready: elisp1med-init elisp2med-init
41 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
42 sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1med-toc >>$@
43 echo '@page' >>$@
44 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
45 cat elisp2med-toc >>$@
46
47
48# intermediate aux files.
49#
50# append vol2's fixed aux to normal vol1.
51elisp1med-aux-ready: elisp2med-aux-vol-added
52 cat elisp1med-aux $< >$@
53#
54# prepend vol1's fixed aux to vol2.
55elisp2med-aux-ready: elisp1med-aux-vol-added
56 cat $< elisp2med-aux >$@
57
58# on -pg entries, append volume number after page number.
59elisp1med-aux-vol-added: elisp1med-init
60 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie1}/' elisp1med-aux >$@
61#
62elisp2med-aux-vol-added: elisp2med-init
63 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2med-aux >$@
64
65
66
67# intermediate index (fns) file.
68#
69elisp1med-fns-ready: elisp1med-fn-vol-added elisp2med-fn-vol-added
70 cat elisp2med-fn-vol-added >>vol1.fn
71 texindex vol1.fn
72 cp vol1.fns $@
73#
74elisp2med-fns-ready: elisp1med-fn-vol-added elisp2med-fn-vol-added
75 cat elisp1med-fn-vol-added >>vol2.fn
76 texindex vol2.fn
77 cp vol2.fns $@
78
79# Insert volume number (I: or II:) into index file.
80elisp1med-fn-vol-added: elisp1med-init
81 cp vol1.fn elisp1med-fn
82 sed 's/}{/}{I:/' elisp1med-fn >$@
83#
84elisp2med-fn-vol-added: elisp2med-init
85 cp vol2.fn elisp2med-fn
86 sed 's/}{/}{II:/' elisp2med-fn >$@
87
88# -----------------------------------------------------------------------------
89# everything above is essentially a duplicate of everything below. sorry.
90# -----------------------------------------------------------------------------
91
92# intermediate TeX runs.
93#
94# this generates what would be the final versions -- except the page
95# numbers aren't right. The process of adding the I: and II: changes
96# the page breaks, so a few index entries, at least are wrong. (In
97# 2007, x-meta-keysym in vol.II ended up on page 374 when the index had
98# it on page 375 from the initial run.)
99#
100# So, we start all over again, from these fns/aux/toc files.
101#
102elisp1med-init: elisp1-fns-ready elisp1-aux-ready elisp1init-toc-ready texinfo.tex
103 @echo -e "\f Intermediate TeX run for volume 1..."
104 cp elisp1init-toc-ready elisp1-toc-ready.toc
105 cp elisp1-fns-ready vol1.fns
106 cp elisp1-aux-ready vol1.aux
107 $(tex) vol1.texi
108 texindex vol1.??
109 mv vol1.aux elisp1med-aux
110 mv vol1.toc elisp1med-toc
111#
112elisp2med-init: elisp2-fns-ready elisp2-aux-ready elisp2init-toc-ready texinfo.tex
113 @echo "Final TeX run for volume 2..."
114 cp elisp2init-toc-ready elisp2-toc-ready.toc
115 cp elisp2-fns-ready vol2.fns
116 cp elisp2-aux-ready vol2.aux
117 $(tex) vol2.texi
118 texindex vol2.??
119 mv vol2.aux elisp2med-aux
120 mv vol2.toc elisp2med-toc
121
122
123# initial toc files.
124#
125# vol1 toc: volume 1, page break, volume 2 (with II: prepended).
126elisp1init-toc-ready: elisp1-init elisp2-init
127 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
128 cat elisp1-toc >>$@
129 echo '@page' >>$@
130 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
131 sed 's/{\([^}]*\)}$$/{II:\1}/' elisp2-toc >>$@
132#
133# vol2 toc: volume 1 (with I: prepended), page break, volume 2.
134elisp2init-toc-ready: elisp1-init elisp2-init
135 echo '@unnchapentry{@b{Volume 1}}{10001}{vol1}{}' >$@
136 sed 's/{\([^}]*\)}$$/{I:\1}/' elisp1-toc >>$@
137 echo '@page' >>$@
138 echo '@unnchapentry{@b{Volume 2}}{10001}{vol2}{}' >>$@
139 cat elisp2-toc >>$@
140
141
142# initial aux files.
143#
144# append vol2's fixed aux to normal vol1. The initial runs saved
145# elisp1-aux and elisp2-aux.
146elisp1-aux-ready: elisp2-aux-vol-added
147 cat elisp1-aux $< >$@
148#
149# prepend vol1's fixed aux to vol2.
150elisp2-aux-ready: elisp1-aux-vol-added
151 cat $< elisp2-aux >$@
152
153# on -pg entries, append volume number after page number.
154elisp1-aux-vol-added: elisp1-init
155 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie1}/' elisp1-aux >$@
156#
157elisp2-aux-vol-added: elisp2-init
158 sed 's/-pg}{\(.*\)}$$/-pg}{\1, vol.@tie2}/' elisp2-aux >$@
159
160
161# initial index (fns) file.
162#
163# Append other volume's index entries to this one's.
164# Index entries in this volume will then take precedence.
165elisp1-fns-ready: elisp1-fn-vol-added elisp2-fn-vol-added
166 cat elisp2-fn-vol-added >>vol1.fn
167 texindex vol1.fn
168 cp vol1.fns $@
169#
170elisp2-fns-ready: elisp1-fn-vol-added elisp2-fn-vol-added
171 cat elisp1-fn-vol-added >>vol2.fn
172 texindex vol2.fn
173 cp vol2.fns $@
174
175# Insert volume number (I: or II:) into index file.
176elisp1-fn-vol-added: elisp1-init
177 cp vol1.fn elisp1-fn
178 sed 's/}{/}{I:/' elisp1-fn >$@
179#
180elisp2-fn-vol-added: elisp2-init
181 cp vol2.fn elisp2-fn
182 sed 's/}{/}{II:/' elisp2-fn >$@
183
184
185# initial TeX runs.
186#
187# We use the .fn, .aux, and .toc files created here in subsequent
188# processing. The page numbers generated here will not be correct yet,
189# but we run texindex and TeX a second time just to get them closer.
190# Otherwise it might take even longer for them to converge.
191#
192elisp1-init: vol1.texi
193 @echo -e "\f Initial TeX run for volume 1..."
194 rm -f vol1.aux vol1.toc
195 $(tex) $<
196 texindex vol1.??
197 mv vol1.aux elisp1-aux
198 mv vol1.toc elisp1-toc
199 touch $@
200#
201elisp2-init: vol2.texi
202 @echo "Initial TeX run for volume 2..."
203 rm -f vol2.aux vol2.toc
204 $(tex) $<
205 texindex vol2.??
206 mv vol2.aux elisp2-aux
207 mv vol2.toc elisp2-toc
208 touch $@
209
210# COPYING CONDITIONS
211#
212# This file is free software; you can redistribute it and/or modify
213# it under the terms of the GNU General Public License as published by
214# the Free Software Foundation; either version 2, or (at your option)
215# any later version.
216#
217# This file is distributed in the hope that it will be useful,
218# but WITHOUT ANY WARRANTY; without even the implied warranty of
219# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
220# GNU General Public License for more details.
221#
222# You should have received a copy of the GNU General Public License
223# along with this file; see the file COPYING. If not, write to
224# the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
225# Boston, MA 02110-1301, USA.
226
227# arch-tag: 5c258a2e-d4a9-4d0e-b279-fb3a6faa27eb
diff --git a/lispref/vol1.texi b/lispref/vol1.texi
index 9ac873bdcce..5dff4f076b9 100644
--- a/lispref/vol1.texi
+++ b/lispref/vol1.texi
@@ -1,213 +1,130 @@
1This file is obsolete, and no longer part of the Emacs Lisp Reference Manual. 1\input texinfo @c -*-texinfo-*-
2It is still present in CVS in case we ever want to use some of it again. 2@c This file is used for printing the GNU Emacs Lisp Reference Manual
3 3@c in two volumes. It is a modified version of elisp.texi.
4@c This is part of the GNU Emacs Lisp Reference Manual.
5@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 4@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
6@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 5@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
7@c See the file elisp.texi for copying conditions.
8
9\input texinfo @c -*-texinfo-*-
10@c %**start of header 6@c %**start of header
11@setfilename elisp 7@setfilename elisp
12@settitle GNU Emacs Lisp Reference Manual: Volume 1 8@settitle GNU Emacs Lisp Reference Manual: Volume 1
13@smallbook
14@c %**end of header 9@c %**end of header
15 10
16 11@c See two-volume-cross-refs.txt.
17@tex
18%%%% Experiment with smaller skip before sections and subsections.
19%%%% --rjc 30mar92
20
21\global\secheadingskip = 17pt plus 6pt minus 3pt
22\global\subsecheadingskip = 14pt plus 6pt minus 3pt
23
24% The defaults are:
25% \secheadingskip = 21pt plus 8pt minus 4pt
26% \subsecheadingskip = 17pt plus 8pt minus 4pt
27@end tex
28
29@finalout
30@c tex
31@c \overfullrule=0pt
32@c end tex
33
34@c Start volume 1 chapter numbering on chapter 1;
35@c this must be listed as chapno 0.
36@tex 12@tex
13\message{Formatting for two volume edition...Volume 1...}
14%
15% Read special toc file, set up in two-volume.make.
16\gdef\tocreadfilename{elisp1-toc-ready.toc}
17%
18% Don't make outlines, they're not needed and \readdatafile can't pay
19% attention to the special definition above.
20\global\let\pdfmakeoutlines=\relax
21%
22% Start volume 1 chapter numbering at 1; this must be listed as chapno0.
37\global\chapno=0 23\global\chapno=0
38@end tex 24@end tex
39 25
40@c ================================================================ 26@c Version of the manual and of Emacs.
41@c Note: I was unable to figure out how to get .aux files copied 27@c Please remember to update the edition number in README as well.
42@c properly in the time I had. Hence need to copy .aux file before 28@set VERSION 2.9
43@c running Tex. --rjc 29@set EMACSVER 22.0.99
44
45@tex
46
47\message{}
48\message{Redefining contents commands...}
49\message{}
50
51% Special @contents command
52
53% This inputs fixed up table of contents file rather than create new one.
54\global\def\contents{%
55 \startcontents{Table of Contents}%
56 \input elisp1-toc-ready.toc
57 \endgroup
58 \vfill \eject
59}
60
61% Special @summarycontents command
62% This inputs fixed up table of contents file rather than create new one.
63\global\def\summarycontents{%
64 \startcontents{Short Contents}%
65 %
66 \let\chapentry = \shortchapentry
67 \let\unnumbchapentry = \shortunnumberedentry
68 % We want a true roman here for the page numbers.
69 \secfonts
70 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
71 \rm
72 \advance\baselineskip by 1pt % Open it up a little.
73 \def\secentry ##1##2##3##4{}
74 \def\unnumbsecentry ##1##2{}
75 \def\subsecentry ##1##2##3##4##5{}
76 \def\unnumbsubsecentry ##1##2{}
77 \def\subsubsecentry ##1##2##3##4##5##6{}
78 \def\unnumbsubsubsecentry ##1##2{}
79 \input elisp1-toc-ready.toc
80 \endgroup
81 \vfill \eject
82}
83
84\message{}
85\message{Formatting special two volume edition...Volume 1...}
86\message{}
87@end tex
88@c ================================================================
89
90 30
91@c ==> This `elisp-small.texi' is a `smallbook' version of the manual. 31@dircategory Emacs
32@direntry
33* Elisp: (elisp). The Emacs Lisp Reference Manual.
34@end direntry
92 35
93@c ==== Following are acceptable over and underfull hboxes in TeX ==== 36@c in general, keep the following line commented out, unless doing a
37@c copy of this manual that will be published. the manual should go
38@c onto the distribution in the full, 8.5 x 11" size.
39@set smallbook
94 40
95@c ----- 41@ifset smallbook
96@c [163] [164] [165] [166]) (loading.texi Chapter 13 [167] [168] [169] 42@smallbook
97@c Overfull \hbox (20.5428pt too wide) in paragraph at lines 131--131 43@end ifset
98@c []@ninett
99@c setenv EMAC-SLOAD-PATH .:/user/bil/emacs:/usr/local/lib/emacs/lisp[]
100@c -----
101@c (minibuf.texi Chapter 17 [206] [207] [208] [209] [210] [211] [212] [213]
102@c [214] [215]
103@c Overfull \hbox (2.09094pt too wide) in paragraph at lines 550--560
104@c @texttt map[] @textrm if @textsl require-match @textrm is
105@c @texttt nil[]@textrm , or else with the keymap @texttt minibuffer-
106@c -----
107@c (locals.texi Appendix @char 68 [533] [534]
108@c Underfull \hbox (badness 2512) in paragraph at lines 4--4
109@c []@chaprm Appendix DStandard Buffer-Local
110 44
111@c ------------------------------------------------------------------- 45@c per rms and peterb, use 10pt fonts for the main text, mostly to
46@c save on paper cost.
47@c Do this inside @tex for now, so current makeinfo does not complain.
48@tex
49@ifset smallbook
50@fonttextsize 10
51@set EMACSVER 22
52\global\let\urlcolor=\Black % don't print links in grayscale
53\global\let\linkcolor=\Black
54@end ifset
55\global\hbadness=6666 % don't worry about not-too-underfull boxes
56@end tex
112 57
113@c
114@c Combine indices. 58@c Combine indices.
115@synindex cp fn 59@synindex cp fn
116@syncodeindex vr fn 60@syncodeindex vr fn
117@syncodeindex ky fn 61@syncodeindex ky fn
118@syncodeindex pg fn 62@syncodeindex pg fn
119@syncodeindex tp fn 63@c We use the "type index" to index new functions and variables.
120@c oops: texinfo-format-buffer ignores synindex 64@c @syncodeindex tp fn
121@c 65
122 66@copying
123@ifinfo 67This is edition @value{VERSION} of the GNU Emacs Lisp Reference Manual,@*
124This file documents GNU Emacs Lisp. 68corresponding to Emacs version @value{EMACSVER}.
125 69
126@c The edition number appears in several places in this file 70Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
127@c and also in the file intro.texi. 711999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
128This is edition 2.4 of the GNU Emacs Lisp Reference 72Foundation, Inc.
129Manual. It corresponds to Emacs Version 19.29. 73
130@c Please REMEMBER to update edition number in *four* places in this file 74@quotation
131@c and also in *one* place in ==> intro.texi <== 75Permission is granted to copy, distribute and/or modify this document
132@c huh? i only found three real places where the edition is stated, and 76under the terms of the GNU Free Documentation License, Version 1.2 or
133@c one place where it is not stated explicitly ("this info file is newer 77any later version published by the Free Software Foundation; with the
134@c than the foobar edition"). --mew 13sep93 78Invariant Sections being ``GNU General Public License,'' with the
135 79Front-Cover texts being ``A GNU Manual,'' and with the Back-Cover
136Published by the Free Software Foundation 80Texts as in (a) below. A copy of the license is included in the
13751 Franklin Street, Fifth Floor 81section entitled ``GNU Free Documentation License.''
138Boston, MA 02110-1301 USA 82
139@end ifinfo 83(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
140 84this GNU Manual, like GNU software. Copies published by the Free
141@setchapternewpage odd 85Software Foundation raise funds for GNU development.''
142 86@end quotation
143@iftex 87@end copying
144@shorttitlepage The GNU Emacs Lisp Reference Manual: Volume 1 88
145@end iftex
146@titlepage 89@titlepage
147@sp 1 90@title GNU Emacs Lisp Reference Manual
148@center @titlefont{The} 91@subtitle Volume 1
149@sp 1 92@subtitle For Emacs Version @value{EMACSVER}
150@center @titlefont{GNU Emacs Lisp} 93@subtitle Revision @value{VERSION}, June 2007
151@sp 1 94
152@center @titlefont{Reference Manual} 95@author by Bil Lewis, Dan LaLiberte, Richard Stallman
153@sp 2 96@author and the GNU Manual Group
154@center GNU Emacs Version 19.29
155@center for Unix Users
156@sp 1
157@center Edition 2.4, June 1995
158@sp 2
159@center @titlefont{Volume 1}
160@sp 3
161@center by Bil Lewis, Dan LaLiberte,
162@center and the GNU Manual Group
163@page 97@page
164@vskip 0pt plus 1filll 98@vskip 0pt plus 1filll
165Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 99@insertcopying
166 100
167@sp 2 101@sp 2
168Edition 2.4 @*
169Revised for Emacs Version 19.29,@*
170June, 1995.@*
171@sp 2
172ISBN 1-882114-71-X
173 102
174@sp 2
175Published by the Free Software Foundation @* 103Published by the Free Software Foundation @*
17651 Franklin Street, Fifth Floor @* 10451 Franklin St, Fifth Floor @*
177Boston, MA 02110-1301 USA 105Boston, MA 02110-1301 @*
178 106USA @*
179@sp 1 107ISBN 1-882114-74-4
180Permission is granted to make and distribute verbatim copies of this
181manual provided the copyright notice and this permission notice are
182preserved on all copies.
183
184Permission is granted to copy and distribute modified versions of this
185manual under the conditions for verbatim copying, provided also that the
186section entitled ``GNU General Public License'' is included
187exactly as in the original, and provided that the entire resulting
188derived work is distributed under the terms of a permission notice
189identical to this one.
190
191Permission is granted to copy and distribute translations of this manual
192into another language, under the above conditions for modified versions,
193except that the section entitled ``GNU General Public License'' may be
194included in a translation approved by the Free Software Foundation
195instead of in the original English.
196 108
197@sp 2 109@sp 2
198Cover art by Etienne Suvasa. 110Cover art by Etienne Suvasa.
199@end titlepage 111@end titlepage
200@page
201 112
202@node Top, Copying, (dir), (dir)
203 113
204@ifinfo 114@c Print the tables of contents
205This Info file contains edition 2.4 of the GNU Emacs Lisp Reference 115@summarycontents
206Manual, corresponding to GNU Emacs version 19.29. 116@contents
207@end ifinfo 117
118
119@ifnottex
120@node Top, Introduction, (dir), (dir)
121@top Emacs Lisp
122
123This Info file contains edition @value{VERSION} of the GNU Emacs Lisp
124Reference Manual, corresponding to GNU Emacs version @value{EMACSVER}.
125@end ifnottex
208 126
209@menu 127@menu
210* Copying:: Conditions for copying and changing GNU Emacs.
211* Introduction:: Introduction and conventions used. 128* Introduction:: Introduction and conventions used.
212 129
213* Lisp Data Types:: Data types of objects in Emacs Lisp. 130* Lisp Data Types:: Data types of objects in Emacs Lisp.
@@ -217,6 +134,7 @@ Manual, corresponding to GNU Emacs version 19.29.
217* Sequences Arrays Vectors:: Lists, strings and vectors are called sequences. 134* Sequences Arrays Vectors:: Lists, strings and vectors are called sequences.
218 Certain functions act on any kind of sequence. 135 Certain functions act on any kind of sequence.
219 The description of vectors is here as well. 136 The description of vectors is here as well.
137* Hash Tables:: Very fast lookup-tables.
220* Symbols:: Symbols represent names, uniquely. 138* Symbols:: Symbols represent names, uniquely.
221 139
222* Evaluation:: How Lisp expressions are evaluated. 140* Evaluation:: How Lisp expressions are evaluated.
@@ -225,9 +143,11 @@ Manual, corresponding to GNU Emacs version 19.29.
225* Functions:: A function is a Lisp program 143* Functions:: A function is a Lisp program
226 that can be invoked from other functions. 144 that can be invoked from other functions.
227* Macros:: Macros are a way to extend the Lisp language. 145* Macros:: Macros are a way to extend the Lisp language.
146* Customization:: Writing customization declarations.
228 147
229* Loading:: Reading files of Lisp code into Lisp. 148* Loading:: Reading files of Lisp code into Lisp.
230* Byte Compilation:: Compilation makes programs run faster. 149* Byte Compilation:: Compilation makes programs run faster.
150* Advising Functions:: Adding to the definition of a function.
231* Debugging:: Tools and tips for debugging Lisp programs. 151* Debugging:: Tools and tips for debugging Lisp programs.
232 152
233* Read and Print:: Converting Lisp objects to text and back. 153* Read and Print:: Converting Lisp objects to text and back.
@@ -243,36 +163,51 @@ Manual, corresponding to GNU Emacs version 19.29.
243 files are made. 163 files are made.
244* Buffers:: Creating and using buffer objects. 164* Buffers:: Creating and using buffer objects.
245* Windows:: Manipulating windows and displaying buffers. 165* Windows:: Manipulating windows and displaying buffers.
246* Frames:: Making multiple X windows. 166* Frames:: Making multiple system-level windows.
247* Positions:: Buffer positions and motion functions. 167* Positions:: Buffer positions and motion functions.
248* Markers:: Markers represent positions and update 168* Markers:: Markers represent positions and update
249 automatically when the text is changed. 169 automatically when the text is changed.
250 170
251* Text:: Examining and changing text in buffers. 171* Text:: Examining and changing text in buffers.
172* Non-ASCII Characters:: Non-ASCII text in buffers and strings.
252* Searching and Matching:: Searching buffers for strings or regexps. 173* Searching and Matching:: Searching buffers for strings or regexps.
253* Syntax Tables:: The syntax table controls word and list parsing. 174* Syntax Tables:: The syntax table controls word and list parsing.
254* Abbrevs:: How Abbrev mode works, and its data structures. 175* Abbrevs:: How Abbrev mode works, and its data structures.
255 176
256* Processes:: Running and communicating with subprocesses. 177* Processes:: Running and communicating with subprocesses.
178* Display:: Features for controlling the screen display.
257* System Interface:: Getting the user id, system type, environment 179* System Interface:: Getting the user id, system type, environment
258 variables, and other such things. 180 variables, and other such things.
259* Display:: Parameters controlling screen usage.
260 The bell. Waiting for input.
261 181
262Appendices 182Appendices
263 183
264* Tips:: Advice for writing Lisp programs. 184* Antinews:: Info for users downgrading to Emacs 21.
185* GNU Free Documentation License:: The license for this documentation
186* GPL:: Conditions for copying and changing GNU Emacs.
187* Tips:: Advice and coding conventions for Emacs Lisp.
265* GNU Emacs Internals:: Building and dumping Emacs; 188* GNU Emacs Internals:: Building and dumping Emacs;
266 internal data structures. 189 internal data structures.
267* Standard Errors:: List of all error symbols. 190* Standard Errors:: List of all error symbols.
268* Standard Buffer-Local Variables:: List of variables local in all buffers. 191* Standard Buffer-Local Variables::
192 List of variables buffer-local in all buffers.
269* Standard Keymaps:: List of standard keymaps. 193* Standard Keymaps:: List of standard keymaps.
270* Standard Hooks:: List of standard hook variables. 194* Standard Hooks:: List of standard hook variables.
271 195
272* Index:: Index including concepts, functions, variables, 196* Index:: Index including concepts, functions, variables,
273 and other terms. 197 and other terms.
274 198
275 --- The Detailed Node Listing --- 199@ignore
200* New Symbols:: New functions and variables in Emacs @value{EMACSVER}.
201@end ignore
202
203@c Do NOT modify the following 3 lines! They must have this form to
204@c be correctly identified by `texinfo-multiple-files-update'. In
205@c particular, the detailed menu header line MUST be identical to the
206@c value of `texinfo-master-menu-header'. See texnfo-upd.el.
207
208@detailmenu
209 --- The Detailed Node Listing ---
210 ---------------------------------
276 211
277Here are other nodes that are inferiors of those already listed, 212Here are other nodes that are inferiors of those already listed,
278mentioned here so you can get to them in one step: 213mentioned here so you can get to them in one step:
@@ -282,6 +217,7 @@ Introduction
282* Caveats:: Flaws and a request for help. 217* Caveats:: Flaws and a request for help.
283* Lisp History:: Emacs Lisp is descended from Maclisp. 218* Lisp History:: Emacs Lisp is descended from Maclisp.
284* Conventions:: How the manual is formatted. 219* Conventions:: How the manual is formatted.
220* Version Info:: Which Emacs version is running?
285* Acknowledgements:: The authors, editors, and sponsors of this manual. 221* Acknowledgements:: The authors, editors, and sponsors of this manual.
286 222
287Conventions 223Conventions
@@ -296,8 +232,10 @@ Conventions
296 232
297Format of Descriptions 233Format of Descriptions
298 234
299* A Sample Function Description:: 235* A Sample Function Description:: A description of an imaginary
300* A Sample Variable Description:: 236 function, @code{foo}.
237* A Sample Variable Description:: A description of an imaginary
238 variable, @code{electric-future-map}.
301 239
302Lisp Data Types 240Lisp Data Types
303 241
@@ -305,6 +243,7 @@ Lisp Data Types
305* Comments:: Comments and their formatting conventions. 243* Comments:: Comments and their formatting conventions.
306* Programming Types:: Types found in all Lisp systems. 244* Programming Types:: Types found in all Lisp systems.
307* Editing Types:: Types specific to Emacs. 245* Editing Types:: Types specific to Emacs.
246* Circular Objects:: Read syntax for circular structure.
308* Type Predicates:: Tests related to types. 247* Type Predicates:: Tests related to types.
309* Equality Predicates:: Tests of equality between any two objects. 248* Equality Predicates:: Tests of equality between any two objects.
310 249
@@ -313,70 +252,95 @@ Programming Types
313* Integer Type:: Numbers without fractional parts. 252* Integer Type:: Numbers without fractional parts.
314* Floating Point Type:: Numbers with fractional parts and with a large range. 253* Floating Point Type:: Numbers with fractional parts and with a large range.
315* Character Type:: The representation of letters, numbers and 254* Character Type:: The representation of letters, numbers and
316 control characters. 255 control characters.
256* Symbol Type:: A multi-use object that refers to a function,
257 variable, property list, or itself.
317* Sequence Type:: Both lists and arrays are classified as sequences. 258* Sequence Type:: Both lists and arrays are classified as sequences.
318* Cons Cell Type:: Cons cells, and lists (which are made from cons cells). 259* Cons Cell Type:: Cons cells, and lists (which are made from cons cells).
319* Array Type:: Arrays include strings and vectors. 260* Array Type:: Arrays include strings and vectors.
320* String Type:: An (efficient) array of characters. 261* String Type:: An (efficient) array of characters.
321* Vector Type:: One-dimensional arrays. 262* Vector Type:: One-dimensional arrays.
322* Symbol Type:: A multi-use object that refers to a function, 263* Char-Table Type:: One-dimensional sparse arrays indexed by characters.
323 variable, property list, or itself. 264* Bool-Vector Type:: One-dimensional arrays of @code{t} or @code{nil}.
265* Hash Table Type:: Super-fast lookup tables.
324* Function Type:: A piece of executable code you can call from elsewhere. 266* Function Type:: A piece of executable code you can call from elsewhere.
325* Macro Type:: A method of expanding an expression into another 267* Macro Type:: A method of expanding an expression into another
326 expression, more fundamental but less pretty. 268 expression, more fundamental but less pretty.
327* Primitive Function Type:: A function written in C, callable from Lisp. 269* Primitive Function Type:: A function written in C, callable from Lisp.
328* Byte-Code Type:: A function written in Lisp, then compiled. 270* Byte-Code Type:: A function written in Lisp, then compiled.
329* Autoload Type:: A type used for automatically loading seldom-used 271* Autoload Type:: A type used for automatically loading seldom-used
330 functions. 272 functions.
273
274Character Type
331 275
332List Type 276* Basic Char Syntax:: Syntax for regular characters.
277* General Escape Syntax:: How to specify characters by their codes.
278* Ctl-Char Syntax:: Syntax for control characters.
279* Meta-Char Syntax:: Syntax for meta-characters.
280* Other Char Bits:: Syntax for hyper-, super-, and alt-characters.
333 281
282Cons Cell and List Types
283
284* Box Diagrams:: Drawing pictures of lists.
334* Dotted Pair Notation:: An alternative syntax for lists. 285* Dotted Pair Notation:: An alternative syntax for lists.
335* Association List Type:: A specially constructed list. 286* Association List Type:: A specially constructed list.
336 287
288String Type
289
290* Syntax for Strings:: How to specify Lisp strings.
291* Non-ASCII in Strings:: International characters in strings.
292* Nonprinting Characters:: Literal unprintable characters in strings.
293* Text Props and Strings:: Strings with text properties.
294
337Editing Types 295Editing Types
338 296
339* Buffer Type:: The basic object of editing. 297* Buffer Type:: The basic object of editing.
340* Window Type:: What makes buffers visible.
341* Window Configuration Type::Save what the screen looks like.
342* Marker Type:: A position in a buffer. 298* Marker Type:: A position in a buffer.
299* Window Type:: What makes buffers visible.
300* Frame Type:: Windows subdivide frames.
301* Window Configuration Type:: Recording the way a frame is subdivided.
302* Frame Configuration Type:: Recording the status of all frames.
343* Process Type:: A process running on the underlying OS. 303* Process Type:: A process running on the underlying OS.
344* Stream Type:: Receive or send characters. 304* Stream Type:: Receive or send characters.
345* Keymap Type:: What function a keystroke invokes. 305* Keymap Type:: What function a keystroke invokes.
346* Syntax Table Type:: What a character means. 306* Overlay Type:: How an overlay is represented.
347 307
348Numbers 308Numbers
349 309
350* Integer Basics:: Representation and range of integers. 310* Integer Basics:: Representation and range of integers.
351* Float Basics:: Representation and range of floating point. 311* Float Basics:: Representation and range of floating point.
352* Predicates on Numbers:: Testing for numbers. 312* Predicates on Numbers:: Testing for numbers.
353* Comparison of Numbers:: Equality and inequality predicates. 313* Comparison of Numbers:: Equality and inequality predicates.
354* Arithmetic Operations:: How to add, subtract, multiply and divide. 314* Numeric Conversions:: Converting float to integer and vice versa.
355* Bitwise Operations:: Logical and, or, not, shifting. 315* Arithmetic Operations:: How to add, subtract, multiply and divide.
356* Numeric Conversions:: Converting float to integer and vice versa. 316* Rounding Operations:: Explicitly rounding floating point numbers.
357* Math Functions:: Trig, exponential and logarithmic functions. 317* Bitwise Operations:: Logical and, or, not, shifting.
358* Random Numbers:: Obtaining random integers, predictable or not. 318* Math Functions:: Trig, exponential and logarithmic functions.
319* Random Numbers:: Obtaining random integers, predictable or not.
359 320
360Strings and Characters 321Strings and Characters
361 322
362* String Basics:: Basic properties of strings and characters. 323* String Basics:: Basic properties of strings and characters.
363* Predicates for Strings:: Testing whether an object is a string or char. 324* Predicates for Strings:: Testing whether an object is a string or char.
364* Creating Strings:: Functions to allocate new strings. 325* Creating Strings:: Functions to allocate new strings.
326* Modifying Strings:: Altering the contents of an existing string.
365* Text Comparison:: Comparing characters or strings. 327* Text Comparison:: Comparing characters or strings.
366* String Conversion:: Converting characters or strings and vice versa. 328* String Conversion:: Converting characters to strings and vice versa.
367* Formatting Strings:: @code{format}: Emacs's analog of @code{printf}. 329* Formatting Strings:: @code{format}: Emacs's analogue of @code{printf}.
368* Character Case:: Case conversion functions. 330* Case Conversion:: Case conversion functions.
331* Case Tables:: Customizing case conversion.
369 332
370Lists 333Lists
371 334
372* Cons Cells:: How lists are made out of cons cells. 335* Cons Cells:: How lists are made out of cons cells.
373* Lists as Boxes:: Graphical notation to explain lists.
374* List-related Predicates:: Is this object a list? Comparing two lists. 336* List-related Predicates:: Is this object a list? Comparing two lists.
375* List Elements:: Extracting the pieces of a list. 337* List Elements:: Extracting the pieces of a list.
376* Building Lists:: Creating list structure. 338* Building Lists:: Creating list structure.
339* List Variables:: Modifying lists stored in variables.
377* Modifying Lists:: Storing new pieces into an existing list. 340* Modifying Lists:: Storing new pieces into an existing list.
378* Sets And Lists:: A list can represent a finite mathematical set. 341* Sets And Lists:: A list can represent a finite mathematical set.
379* Association Lists:: A list can represent a finite relation or mapping. 342* Association Lists:: A list can represent a finite relation or mapping.
343* Rings:: Managing a fixed-size ring of objects.
380 344
381Modifying Existing List Structure 345Modifying Existing List Structure
382 346
@@ -390,7 +354,17 @@ Sequences, Arrays, and Vectors
390* Sequence Functions:: Functions that accept any kind of sequence. 354* Sequence Functions:: Functions that accept any kind of sequence.
391* Arrays:: Characteristics of arrays in Emacs Lisp. 355* Arrays:: Characteristics of arrays in Emacs Lisp.
392* Array Functions:: Functions specifically for arrays. 356* Array Functions:: Functions specifically for arrays.
393* Vectors:: Functions specifically for vectors. 357* Vectors:: Special characteristics of Emacs Lisp vectors.
358* Vector Functions:: Functions specifically for vectors.
359* Char-Tables:: How to work with char-tables.
360* Bool-Vectors:: How to work with bool-vectors.
361
362Hash Tables
363
364* Creating Hash:: Functions to create hash tables.
365* Hash Access:: Reading and writing the hash table contents.
366* Defining Hash:: Defining new comparison methods
367* Other Hash:: Miscellaneous.
394 368
395Symbols 369Symbols
396 370
@@ -401,19 +375,28 @@ Symbols
401* Property Lists:: Each symbol has a property list 375* Property Lists:: Each symbol has a property list
402 for recording miscellaneous information. 376 for recording miscellaneous information.
403 377
378Property Lists
379
380* Plists and Alists:: Comparison of the advantages of property
381 lists and association lists.
382* Symbol Plists:: Functions to access symbols' property lists.
383* Other Plists:: Accessing property lists stored elsewhere.
384
404Evaluation 385Evaluation
405 386
406* Intro Eval:: Evaluation in the scheme of things. 387* Intro Eval:: Evaluation in the scheme of things.
407* Eval:: How to invoke the Lisp interpreter explicitly.
408* Forms:: How various sorts of objects are evaluated. 388* Forms:: How various sorts of objects are evaluated.
409* Quoting:: Avoiding evaluation (to put constants in 389* Quoting:: Avoiding evaluation (to put constants in
410 the program). 390 the program).
391* Eval:: How to invoke the Lisp interpreter explicitly.
411 392
412Kinds of Forms 393Kinds of Forms
413 394
414* Self-Evaluating Forms:: Forms that evaluate to themselves. 395* Self-Evaluating Forms:: Forms that evaluate to themselves.
415* Symbol Forms:: Symbols evaluate as variables. 396* Symbol Forms:: Symbols evaluate as variables.
416* Classifying Lists:: How to distinguish various sorts of list forms. 397* Classifying Lists:: How to distinguish various sorts of list forms.
398* Function Indirection:: When a symbol appears as the car of a list,
399 we find the real function via the symbol.
417* Function Forms:: Forms that call functions. 400* Function Forms:: Forms that call functions.
418* Macro Forms:: Forms that call macros. 401* Macro Forms:: Forms that call macros.
419* Special Forms:: "Special forms" are idiosyncratic primitives, 402* Special Forms:: "Special forms" are idiosyncratic primitives,
@@ -424,7 +407,7 @@ Kinds of Forms
424Control Structures 407Control Structures
425 408
426* Sequencing:: Evaluation in textual order. 409* Sequencing:: Evaluation in textual order.
427* Conditionals:: @code{if}, @code{cond}. 410* Conditionals:: @code{if}, @code{cond}, @code{when}, @code{unless}.
428* Combining Conditions:: @code{and}, @code{or}, @code{not}. 411* Combining Conditions:: @code{and}, @code{or}, @code{not}.
429* Iteration:: @code{while} loops. 412* Iteration:: @code{while} loops.
430* Nonlocal Exits:: Jumping out of a sequence. 413* Nonlocal Exits:: Jumping out of a sequence.
@@ -443,6 +426,7 @@ Errors
443* Processing of Errors:: What Emacs does when you report an error. 426* Processing of Errors:: What Emacs does when you report an error.
444* Handling Errors:: How you can trap errors and continue execution. 427* Handling Errors:: How you can trap errors and continue execution.
445* Error Symbols:: How errors are classified for trapping them. 428* Error Symbols:: How errors are classified for trapping them.
429* Standard Errors:: List of all error symbols.
446 430
447Variables 431Variables
448 432
@@ -451,11 +435,21 @@ Variables
451* Local Variables:: Variable values that exist only temporarily. 435* Local Variables:: Variable values that exist only temporarily.
452* Void Variables:: Symbols that lack values. 436* Void Variables:: Symbols that lack values.
453* Defining Variables:: A definition says a symbol is used as a variable. 437* Defining Variables:: A definition says a symbol is used as a variable.
438* Tips for Defining:: Things you should think about when you
439 define a variable.
454* Accessing Variables:: Examining values of variables whose names 440* Accessing Variables:: Examining values of variables whose names
455 are known only at run time. 441 are known only at run time.
456* Setting Variables:: Storing new values in variables. 442* Setting Variables:: Storing new values in variables.
457* Variable Scoping:: How Lisp chooses among local and global values. 443* Variable Scoping:: How Lisp chooses among local and global values.
458* Buffer-Local Variables:: Variable values in effect only in one buffer. 444* Buffer-Local Variables:: Variable values in effect only in one buffer.
445* Frame-Local Variables:: Variable values in effect only in one frame.
446* Future Local Variables:: New kinds of local values we might add some day.
447* File Local Variables:: Handling local variable lists in files.
448* Variable Aliases:: Variables that are aliases for other variables.
449* Variables with Restricted Values:: Non-constant variables whose value can
450 @emph{not} be an arbitrary Lisp object.
451* Standard Buffer-Local Variables::
452 List of variables buffer-local in all buffers.
459 453
460Scoping Rules for Variable Bindings 454Scoping Rules for Variable Bindings
461 455
@@ -471,7 +465,7 @@ Buffer-Local Variables
471* Intro to Buffer-Local:: Introduction and concepts. 465* Intro to Buffer-Local:: Introduction and concepts.
472* Creating Buffer-Local:: Creating and destroying buffer-local bindings. 466* Creating Buffer-Local:: Creating and destroying buffer-local bindings.
473* Default Value:: The default value is seen in buffers 467* Default Value:: The default value is seen in buffers
474 that don't have their own local values. 468 that don't have their own buffer-local values.
475 469
476Functions 470Functions
477 471
@@ -484,6 +478,9 @@ Functions
484* Anonymous Functions:: Lambda-expressions are functions with no names. 478* Anonymous Functions:: Lambda-expressions are functions with no names.
485* Function Cells:: Accessing or setting the function definition 479* Function Cells:: Accessing or setting the function definition
486 of a symbol. 480 of a symbol.
481* Obsolete Functions:: Declaring functions obsolete.
482* Inline Functions:: Defining functions that the compiler will open code.
483* Function Safety:: Determining whether a function is safe to call.
487* Related Topics:: Cross-references to specific Lisp primitives 484* Related Topics:: Cross-references to specific Lisp primitives
488 that have a special bearing on how 485 that have a special bearing on how
489 functions work. 486 functions work.
@@ -504,30 +501,86 @@ Macros
504* Backquote:: Easier construction of list structure. 501* Backquote:: Easier construction of list structure.
505* Problems with Macros:: Don't evaluate the macro arguments too many times. 502* Problems with Macros:: Don't evaluate the macro arguments too many times.
506 Don't hide the user's variables. 503 Don't hide the user's variables.
504* Indenting Macros:: Specifying how to indent macro calls.
505
506Common Problems Using Macros
507
508* Wrong Time:: Do the work in the expansion, not in the macro.
509* Argument Evaluation:: The expansion should evaluate each macro arg once.
510* Surprising Local Vars:: Local variable bindings in the expansion
511 require special care.
512* Eval During Expansion:: Don't evaluate them; put them in the expansion.
513* Repeated Expansion:: Avoid depending on how many times expansion is done.
514
515Writing Customization Definitions
516
517* Common Keywords:: Common keyword arguments for all kinds of
518 customization declarations.
519* Group Definitions:: Writing customization group definitions.
520* Variable Definitions:: Declaring user options.
521* Customization Types:: Specifying the type of a user option.
522
523Customization Types
524
525* Simple Types:: Simple customization types: sexp, integer, number,
526 string, file, directory, alist.
527* Composite Types:: Build new types from other types or data.
528* Splicing into Lists:: Splice elements into list with @code{:inline}.
529* Type Keywords:: Keyword-argument pairs in a customization type.
530* Defining New Types:: Give your type a name.
507 531
508Loading 532Loading
509 533
510* How Programs Do Loading:: The @code{load} function and others. 534* How Programs Do Loading:: The @code{load} function and others.
535* Load Suffixes:: Details about the suffixes that @code{load} tries.
536* Library Search:: Finding a library to load.
537* Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files.
511* Autoload:: Setting up a function to autoload. 538* Autoload:: Setting up a function to autoload.
512* Named Features:: Loading a library if it isn't already loaded.
513* Repeated Loading:: Precautions about loading a file twice. 539* Repeated Loading:: Precautions about loading a file twice.
540* Named Features:: Loading a library if it isn't already loaded.
541* Where Defined:: Finding which file defined a certain symbol.
542* Unloading:: How to "unload" a library that was loaded.
543* Hooks for Loading:: Providing code to be run when
544 particular libraries are loaded.
514 545
515Byte Compilation 546Byte Compilation
516 547
548* Speed of Byte-Code:: An example of speedup from byte compilation.
517* Compilation Functions:: Byte compilation functions. 549* Compilation Functions:: Byte compilation functions.
550* Docs and Compilation:: Dynamic loading of documentation strings.
551* Dynamic Loading:: Dynamic loading of individual functions.
552* Eval During Compile:: Code to be evaluated when you compile.
553* Compiler Errors:: Handling compiler error messages.
554* Byte-Code Objects:: The data type used for byte-compiled functions.
518* Disassembly:: Disassembling byte-code; how to read byte-code. 555* Disassembly:: Disassembling byte-code; how to read byte-code.
519 556
557Advising Emacs Lisp Functions
558
559* Simple Advice:: A simple example to explain the basics of advice.
560* Defining Advice:: Detailed description of @code{defadvice}.
561* Around-Advice:: Wrapping advice around a function's definition.
562* Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}.
563* Activation of Advice:: Advice doesn't do anything until you activate it.
564* Enabling Advice:: You can enable or disable each piece of advice.
565* Preactivation:: Preactivation is a way of speeding up the
566 loading of compiled advice.
567* Argument Access in Advice:: How advice can access the function's arguments.
568* Advising Primitives:: Accessing arguments when advising a primitive.
569* Combined Definition:: How advice is implemented.
570
520Debugging Lisp Programs 571Debugging Lisp Programs
521 572
522* Debugger:: How the Emacs Lisp debugger is implemented. 573* Debugger:: How the Emacs Lisp debugger is implemented.
574* Edebug:: A source-level Emacs Lisp debugger.
523* Syntax Errors:: How to find syntax errors. 575* Syntax Errors:: How to find syntax errors.
576* Test Coverage:: Ensuring you have tested all branches in your code.
524* Compilation Errors:: How to find errors that show up in 577* Compilation Errors:: How to find errors that show up in
525 byte compilation. 578 byte compilation.
526* Edebug:: A source-level Emacs Lisp debugger.
527 579
528The Lisp Debugger 580The Lisp Debugger
529 581
530* Error Debugging:: Entering the debugger when an error happens. 582* Error Debugging:: Entering the debugger when an error happens.
583* Infinite Loops:: Stopping and debugging a program that doesn't exit.
531* Function Debugging:: Entering it when a certain function is called. 584* Function Debugging:: Entering it when a certain function is called.
532* Explicit Debug:: Entering it at a certain point in the program. 585* Explicit Debug:: Entering it at a certain point in the program.
533* Using Debugger:: What the debugger does; what you see while in it. 586* Using Debugger:: What the debugger does; what you see while in it.
@@ -535,6 +588,27 @@ The Lisp Debugger
535* Invoking the Debugger:: How to call the function @code{debug}. 588* Invoking the Debugger:: How to call the function @code{debug}.
536* Internals of Debugger:: Subroutines of the debugger, and global variables. 589* Internals of Debugger:: Subroutines of the debugger, and global variables.
537 590
591Edebug
592
593* Using Edebug:: Introduction to use of Edebug.
594* Instrumenting:: You must instrument your code
595 in order to debug it with Edebug.
596* Edebug Execution Modes:: Execution modes, stopping more or less often.
597* Jumping:: Commands to jump to a specified place.
598* Edebug Misc:: Miscellaneous commands.
599* Breaks:: Setting breakpoints to make the program stop.
600* Trapping Errors:: Trapping errors with Edebug.
601* Edebug Views:: Views inside and outside of Edebug.
602* Edebug Eval:: Evaluating expressions within Edebug.
603* Eval List:: Expressions whose values are displayed
604 each time you enter Edebug.
605* Printing in Edebug:: Customization of printing.
606* Trace Buffer:: How to produce trace output in a buffer.
607* Coverage Testing:: How to test evaluation coverage.
608* The Outside Context:: Data that Edebug saves and restores.
609* Edebug and Macros:: Specifying how to handle macro calls.
610* Edebug Options:: Option variables for customizing Edebug.
611
538Debugging Invalid Lisp Syntax 612Debugging Invalid Lisp Syntax
539 613
540* Excess Open:: How to find a spurious open paren or missing close. 614* Excess Open:: How to find a spurious open paren or missing close.
@@ -549,14 +623,25 @@ Reading and Printing Lisp Objects
549* Output Streams:: Various data types that can be used as 623* Output Streams:: Various data types that can be used as
550 output streams. 624 output streams.
551* Output Functions:: Functions to print Lisp objects as text. 625* Output Functions:: Functions to print Lisp objects as text.
626* Output Variables:: Variables that control what the printing
627 functions do.
552 628
553Minibuffers 629Minibuffers
554 630
555* Intro to Minibuffers:: Basic information about minibuffers. 631* Intro to Minibuffers:: Basic information about minibuffers.
556* Text from Minibuffer:: How to read a straight text string. 632* Text from Minibuffer:: How to read a straight text string.
557* Object from Minibuffer:: How to read a Lisp object or expression. 633* Object from Minibuffer:: How to read a Lisp object or expression.
634* Minibuffer History:: Recording previous minibuffer inputs
635 so the user can reuse them.
636* Initial Input:: Specifying initial contents for the minibuffer.
558* Completion:: How to invoke and customize completion. 637* Completion:: How to invoke and customize completion.
559* Yes-or-No Queries:: Asking a question with a simple answer. 638* Yes-or-No Queries:: Asking a question with a simple answer.
639* Multiple Queries:: Asking a series of similar questions.
640* Reading a Password:: Reading a password from the terminal.
641* Minibuffer Commands:: Commands used as key bindings in minibuffers.
642* Minibuffer Contents:: How such commands access the minibuffer text.
643* Minibuffer Windows:: Operating on the special minibuffer windows.
644* Recursive Mini:: Whether recursive entry to minibuffer is allowed.
560* Minibuffer Misc:: Various customization hooks and variables. 645* Minibuffer Misc:: Various customization hooks and variables.
561 646
562Completion 647Completion
@@ -576,8 +661,10 @@ Command Loop
576* Defining Commands:: Specifying how a function should read arguments. 661* Defining Commands:: Specifying how a function should read arguments.
577* Interactive Call:: Calling a command, so that it will read arguments. 662* Interactive Call:: Calling a command, so that it will read arguments.
578* Command Loop Info:: Variables set by the command loop for you to examine. 663* Command Loop Info:: Variables set by the command loop for you to examine.
664* Adjusting Point:: Adjustment of point after a command.
579* Input Events:: What input looks like when you read it. 665* Input Events:: What input looks like when you read it.
580* Reading Input:: How to read input events from the keyboard or mouse. 666* Reading Input:: How to read input events from the keyboard or mouse.
667* Special Events:: Events processed immediately and individually.
581* Waiting:: Waiting for user input or elapsed time. 668* Waiting:: Waiting for user input or elapsed time.
582* Quitting:: How @kbd{C-g} works. How to catch or defer quitting. 669* Quitting:: How @kbd{C-g} works. How to catch or defer quitting.
583* Prefix Command Arguments:: How the commands to set prefix args work. 670* Prefix Command Arguments:: How the commands to set prefix args work.
@@ -594,50 +681,155 @@ Defining Commands
594 in various ways. 681 in various ways.
595* Interactive Examples:: Examples of how to read interactive arguments. 682* Interactive Examples:: Examples of how to read interactive arguments.
596 683
684Input Events
685
686* Keyboard Events:: Ordinary characters--keys with symbols on them.
687* Function Keys:: Function keys--keys with names, not symbols.
688* Mouse Events:: Overview of mouse events.
689* Click Events:: Pushing and releasing a mouse button.
690* Drag Events:: Moving the mouse before releasing the button.
691* Button-Down Events:: A button was pushed and not yet released.
692* Repeat Events:: Double and triple click (or drag, or down).
693* Motion Events:: Just moving the mouse, not pushing a button.
694* Focus Events:: Moving the mouse between frames.
695* Misc Events:: Other events the system can generate.
696* Event Examples:: Examples of the lists for mouse events.
697* Classifying Events:: Finding the modifier keys in an event symbol.
698* Accessing Events:: Functions to extract info from events.
699* Strings of Events:: Special considerations for putting
700 keyboard character events in a string.
701
702Reading Input
703
704* Key Sequence Input:: How to read one key sequence.
705* Reading One Event:: How to read just one event.
706* Event Mod:: How Emacs modifies events as they are read.
707* Invoking the Input Method:: How reading an event uses the input method.
708* Quoted Character Input:: Asking the user to specify a character.
709* Event Input Misc:: How to reread or throw away input events.
710
597Keymaps 711Keymaps
598 712
599* Keymap Terminology:: Definitions of terms pertaining to keymaps. 713* Key Sequences:: Key sequences as Lisp objects.
600* Format of Keymaps:: What a keymap looks like as a Lisp object. 714* Keymap Basics:: Basic concepts of keymaps.
601* Creating Keymaps:: Functions to create and copy keymaps. 715* Format of Keymaps:: What a keymap looks like as a Lisp object.
602* Inheritance and Keymaps:: How one keymap can inherit the bindings 716* Creating Keymaps:: Functions to create and copy keymaps.
603 of another keymap. 717* Inheritance and Keymaps:: How one keymap can inherit the bindings
604* Prefix Keys:: Defining a key with a keymap as its definition. 718 of another keymap.
605* Menu Keymaps:: A keymap can define a menu for X 719* Prefix Keys:: Defining a key with a keymap as its definition.
606 or for use from the terminal. 720* Active Keymaps:: How Emacs searches the active keymaps
607* Active Keymaps:: Each buffer has a local keymap 721 for a key binding.
608 to override the standard (global) bindings. 722* Searching Keymaps:: A pseudo-Lisp summary of searching active maps.
609 Each minor mode can also override them. 723* Controlling Active Maps:: Each buffer has a local keymap
610* Key Lookup:: How extracting elements from keymaps works. 724 to override the standard (global) bindings.
725 A minor mode can also override them.
726* Key Lookup:: How extracting elements from keymaps works.
611* Functions for Key Lookup:: How to request key lookup. 727* Functions for Key Lookup:: How to request key lookup.
612* Changing Key Bindings:: Redefining a key in a keymap. 728* Changing Key Bindings:: Redefining a key in a keymap.
613* Key Binding Commands:: Interactive interfaces for redefining keys. 729* Remapping Commands:: A keymap can translate one command to another.
614* Scanning Keymaps:: Looking through all keymaps, for printing help. 730* Translation Keymaps:: Keymaps for translating sequences of events.
731* Key Binding Commands:: Interactive interfaces for redefining keys.
732* Scanning Keymaps:: Looking through all keymaps, for printing help.
733* Menu Keymaps:: A keymap can define a menu for X
734 or for use from the terminal.
735* Standard Keymaps:: List of standard keymaps.
615 736
616Major and Minor Modes 737Major and Minor Modes
617 738
739* Hooks:: How to use hooks; how to write code that
740 provides hooks.
618* Major Modes:: Defining major modes. 741* Major Modes:: Defining major modes.
619* Minor Modes:: Defining minor modes. 742* Minor Modes:: Defining minor modes.
620* Mode Line Format:: Customizing the text that appears in the mode line. 743* Mode Line Format:: Customizing the text that appears in the mode line.
621* Hooks:: How to use hooks; how to write code that 744* Imenu:: How a mode can provide a menu
622 provides hooks. 745 of definitions in the buffer.
746* Font Lock Mode:: How modes can highlight text according to syntax.
747* Desktop Save Mode:: How modes can have buffer state saved between
748 Emacs sessions.
749
750Menu Keymaps
751
752* Defining Menus:: How to make a keymap that defines a menu.
753* Mouse Menus:: How users actuate the menu with the mouse.
754* Keyboard Menus:: How users actuate the menu with the keyboard.
755* Menu Example:: Making a simple menu.
756* Menu Bar:: How to customize the menu bar.
757* Tool Bar:: A tool bar is a row of images.
758* Modifying Menus:: How to add new items to a menu.
759
760Defining Menus
761
762* Simple Menu Items:: A simple kind of menu key binding,
763 limited in capabilities.
764* Extended Menu Items:: More powerful menu item definitions
765 let you specify keywords to enable
766 various features.
767* Menu Separators:: Drawing a horizontal line through a menu.
768* Alias Menu Items:: Using command aliases in menu items.
769
770Major and Minor Modes
771
772* Hooks:: How to use hooks; how to write code that provides hooks.
773* Major Modes:: Defining major modes.
774* Minor Modes:: Defining minor modes.
775* Mode Line Format:: Customizing the text that appears in the mode line.
776* Imenu:: How a mode can provide a menu
777 of definitions in the buffer.
778* Font Lock Mode:: How modes can highlight text according to syntax.
779* Desktop Save Mode:: How modes can have buffer state saved between
780 Emacs sessions.
623 781
624Major Modes 782Major Modes
625 783
784* Major Mode Basics::
626* Major Mode Conventions:: Coding conventions for keymaps, etc. 785* Major Mode Conventions:: Coding conventions for keymaps, etc.
627* Example Major Modes:: Text mode and Lisp modes. 786* Example Major Modes:: Text mode and Lisp modes.
628* Auto Major Mode:: How Emacs chooses the major mode automatically. 787* Auto Major Mode:: How Emacs chooses the major mode automatically.
629* Mode Help:: Finding out how to use a mode. 788* Mode Help:: Finding out how to use a mode.
789* Derived Modes:: Defining a new major mode based on another major
790 mode.
791* Generic Modes:: Defining a simple major mode that supports
792 comment syntax and Font Lock mode.
793* Mode Hooks:: Hooks run at the end of major mode functions.
630 794
631Minor Modes 795Minor Modes
632 796
633* Minor Mode Conventions:: Tips for writing a minor mode. 797* Minor Mode Conventions:: Tips for writing a minor mode.
634* Keymaps and Minor Modes:: How a minor mode can have its own keymap. 798* Keymaps and Minor Modes:: How a minor mode can have its own keymap.
799* Defining Minor Modes:: A convenient facility for defining minor modes.
635 800
636Mode Line Format 801Mode Line Format
637 802
803* Mode Line Basics::
638* Mode Line Data:: The data structure that controls the mode line. 804* Mode Line Data:: The data structure that controls the mode line.
639* Mode Line Variables:: Variables used in that data structure. 805* Mode Line Variables:: Variables used in that data structure.
640* %-Constructs:: Putting information into a mode line. 806* %-Constructs:: Putting information into a mode line.
807* Properties in Mode:: Using text properties in the mode line.
808* Header Lines:: Like a mode line, but at the top.
809* Emulating Mode Line:: Formatting text as the mode line would.
810
811Font Lock Mode
812
813* Font Lock Basics:: Overview of customizing Font Lock.
814* Search-based Fontification:: Fontification based on regexps.
815* Customizing Keywords:: Customizing search-based fontification.
816* Other Font Lock Variables:: Additional customization facilities.
817* Levels of Font Lock:: Each mode can define alternative levels
818 so that the user can select more or less.
819* Precalculated Fontification:: How Lisp programs that produce the buffer
820 contents can also specify how to fontify it.
821* Faces for Font Lock:: Special faces specifically for Font Lock.
822* Syntactic Font Lock:: Fontification based on syntax tables.
823* Setting Syntax Properties:: Defining character syntax based on context
824 using the Font Lock mechanism.
825* Multiline Font Lock:: How to coerce Font Lock into properly
826 highlighting multiline constructs.
827
828Multiline Font Lock Constructs
829
830* Font Lock Multiline:: Marking multiline chunks with a text property
831* Region to Fontify:: Controlling which region gets refontified
832 after a buffer change.
641 833
642Documentation 834Documentation
643 835
@@ -656,11 +848,15 @@ Files
656* Reading from Files:: Reading files into other buffers. 848* Reading from Files:: Reading files into other buffers.
657* Writing to Files:: Writing new files from parts of buffers. 849* Writing to Files:: Writing new files from parts of buffers.
658* File Locks:: Locking and unlocking files, to prevent 850* File Locks:: Locking and unlocking files, to prevent
659 simultaneous editing by two people. 851 simultaneous editing by two people.
660* Information about Files:: Testing existence, accessibility, size of files. 852* Information about Files:: Testing existence, accessibility, size of files.
661* Contents of Directories:: Getting a list of the files in a directory. 853* Changing Files:: Renaming files, changing protection, etc.
662* Changing File Attributes:: Renaming files, changing protection, etc. 854* File Names:: Decomposing and expanding file names.
663* File Names:: Decomposing and expanding file names. 855* Contents of Directories:: Getting a list of the files in a directory.
856* Create/Delete Dirs:: Creating and Deleting Directories.
857* Magic File Names:: Defining "magic" special handling
858 for certain file names.
859* Format Conversion:: Conversion to and from various file formats.
664 860
665Visiting Files 861Visiting Files
666 862
@@ -670,19 +866,23 @@ Visiting Files
670Information about Files 866Information about Files
671 867
672* Testing Accessibility:: Is a given file readable? Writable? 868* Testing Accessibility:: Is a given file readable? Writable?
673* Kinds of Files:: Is it a directory? A link? 869* Kinds of Files:: Is it a directory? A symbolic link?
870* Truenames:: Eliminating symbolic links from a file name.
674* File Attributes:: How large is it? Any other names? Etc. 871* File Attributes:: How large is it? Any other names? Etc.
872* Locating Files:: How to find a file in standard places.
675 873
676File Names 874File Names
677 875
678* File Name Components:: The directory part of a file name, and the rest. 876* File Name Components:: The directory part of a file name, and the rest.
679* Directory Names:: A directory's name as a directory
680 is different from its name as a file.
681* Relative File Names:: Some file names are relative to a 877* Relative File Names:: Some file names are relative to a
682 current directory. 878 current directory.
879* Directory Names:: A directory's name as a directory
880 is different from its name as a file.
683* File Name Expansion:: Converting relative file names to absolute ones. 881* File Name Expansion:: Converting relative file names to absolute ones.
684* Unique File Names:: Generating names for temporary files. 882* Unique File Names:: Generating names for temporary files.
685* File Name Completion:: Finding the completions for a given file name. 883* File Name Completion:: Finding the completions for a given file name.
884* Standard File Names:: If your package uses a fixed file name,
885 how to handle various operating systems simply.
686 886
687Backups and Auto-Saving 887Backups and Auto-Saving
688 888
@@ -704,19 +904,22 @@ Backup Files
704Buffers 904Buffers
705 905
706* Buffer Basics:: What is a buffer? 906* Buffer Basics:: What is a buffer?
907* Current Buffer:: Designating a buffer as current
908 so primitives will access its contents.
707* Buffer Names:: Accessing and changing buffer names. 909* Buffer Names:: Accessing and changing buffer names.
708* Buffer File Name:: The buffer file name indicates which file 910* Buffer File Name:: The buffer file name indicates which file
709 is visited. 911 is visited.
710* Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved. 912* Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved.
711* Modification Time:: Determining whether the visited file was changed 913* Modification Time:: Determining whether the visited file was changed
712 "behind Emacs's back". 914 ``behind Emacs's back''.
713* Read Only Buffers:: Modifying text is not allowed in a 915* Read Only Buffers:: Modifying text is not allowed in a
714 read-only buffer. 916 read-only buffer.
715* The Buffer List:: How to look at all the existing buffers. 917* The Buffer List:: How to look at all the existing buffers.
716* Creating Buffers:: Functions that create buffers. 918* Creating Buffers:: Functions that create buffers.
717* Killing Buffers:: Buffers exist until explicitly killed. 919* Killing Buffers:: Buffers exist until explicitly killed.
718* Current Buffer:: Designating a buffer as current 920* Indirect Buffers:: An indirect buffer shares text with some
719 so primitives will access its contents. 921 other buffer.
922* Buffer Gap:: The gap in the buffer.
720 923
721Windows 924Windows
722 925
@@ -726,21 +929,28 @@ Windows
726* Selecting Windows:: The selected window is the one that you edit in. 929* Selecting Windows:: The selected window is the one that you edit in.
727* Cyclic Window Ordering:: Moving around the existing windows. 930* Cyclic Window Ordering:: Moving around the existing windows.
728* Buffers and Windows:: Each window displays the contents of a buffer. 931* Buffers and Windows:: Each window displays the contents of a buffer.
729* Displaying Buffers:: Higher-lever functions for displaying a buffer 932* Displaying Buffers:: Higher-level functions for displaying a buffer
730 and choosing a window for it. 933 and choosing a window for it.
934* Choosing Window:: How to choose a window for displaying a buffer.
731* Window Point:: Each window has its own location of point. 935* Window Point:: Each window has its own location of point.
732* Window Start:: The display-start position controls which text 936* Window Start:: The display-start position controls which text
733 is on-screen in the window. 937 is on-screen in the window.
734* Vertical Scrolling:: Moving text up and down in the window. 938* Textual Scrolling:: Moving text up and down through the window.
735* Horizontal Scrolling:: Moving text sideways on the window. 939* Vertical Scrolling:: Moving the contents up and down on the window.
940* Horizontal Scrolling:: Moving the contents sideways on the window.
736* Size of Window:: Accessing the size of a window. 941* Size of Window:: Accessing the size of a window.
737* Resizing Windows:: Changing the size of a window. 942* Resizing Windows:: Changing the size of a window.
943* Coordinates and Windows:: Converting coordinates to windows.
944* Window Tree:: The layout and sizes of all windows in a frame.
738* Window Configurations:: Saving and restoring the state of the screen. 945* Window Configurations:: Saving and restoring the state of the screen.
946* Window Hooks:: Hooks for scrolling, window size changes,
947 redisplay going past a certain point,
948 or window configuration changes.
739 949
740Frames 950Frames
741 951
742* Creating Frames:: Creating additional frames. 952* Creating Frames:: Creating additional frames.
743* Multiple Displays:: Creating frames on other X displays. 953* Multiple Displays:: Creating frames on other displays.
744* Frame Parameters:: Controlling frame size, position, font, etc. 954* Frame Parameters:: Controlling frame size, position, font, etc.
745* Frame Titles:: Automatic updating of frame titles. 955* Frame Titles:: Automatic updating of frame titles.
746* Deleting Frames:: Frames last until explicitly deleted. 956* Deleting Frames:: Frames last until explicitly deleted.
@@ -750,18 +960,40 @@ Frames
750* Minibuffers and Frames:: How a frame finds the minibuffer to use. 960* Minibuffers and Frames:: How a frame finds the minibuffer to use.
751* Input Focus:: Specifying the selected frame. 961* Input Focus:: Specifying the selected frame.
752* Visibility of Frames:: Frames may be visible or invisible, or icons. 962* Visibility of Frames:: Frames may be visible or invisible, or icons.
753* Raising and Lowering:: Raising a frame makes it hide other X windows; 963* Raising and Lowering:: Raising a frame makes it hide other windows;
754 lowering it makes the others hide them. 964 lowering it puts it underneath the others.
755* Frame Configurations:: Saving the state of all frames. 965* Frame Configurations:: Saving the state of all frames.
756* Mouse Tracking:: Getting events that say when the mouse moves. 966* Mouse Tracking:: Getting events that say when the mouse moves.
757* Mouse Position:: Asking where the mouse is, or moving it. 967* Mouse Position:: Asking where the mouse is, or moving it.
758* Pop-Up Menus:: Displaying a menu for the user to select from. 968* Pop-Up Menus:: Displaying a menu for the user to select from.
759* Dialog Boxes:: Displaying a box to ask yes or no. 969* Dialog Boxes:: Displaying a box to ask yes or no.
760* Pointer Shapes:: Specifying the shape of the mouse pointer. 970* Pointer Shape:: Specifying the shape of the mouse pointer.
761* X Selections:: Transferring text to and from other X clients. 971* Window System Selections::Transferring text to and from other windows.
972* Drag and Drop:: Internals of Drag-and-Drop implementation.
762* Color Names:: Getting the definitions of color names. 973* Color Names:: Getting the definitions of color names.
974* Text Terminal Colors:: Defining colors for text-only terminals.
763* Resources:: Getting resource values from the server. 975* Resources:: Getting resource values from the server.
764* Server Data:: Getting info about the X server. 976* Display Feature Testing:: Determining the features of a terminal.
977
978Frame Parameters
979
980* Parameter Access:: How to change a frame's parameters.
981* Initial Parameters:: Specifying frame parameters when you make a frame.
982* Window Frame Parameters:: List of frame parameters for window systems.
983* Size and Position:: Changing the size and position of a frame.
984* Geometry:: Parsing geometry specifications.
985
986Window Frame Parameters
987
988* Basic Parameters:: Parameters that are fundamental.
989* Position Parameters:: The position of the frame on the screen.
990* Size Parameters:: Frame's size.
991* Layout Parameters:: Size of parts of the frame, and
992 enabling or disabling some parts.
993* Buffer Parameters:: Which buffers have been or should be shown.
994* Management Parameters:: Communicating with the window manager.
995* Cursor Parameters:: Controlling the cursor appearance.
996* Color Parameters:: Colors of various parts of the frame.
765 997
766Positions 998Positions
767 999
@@ -785,9 +1017,11 @@ Markers
785* Overview of Markers:: The components of a marker, and how it relocates. 1017* Overview of Markers:: The components of a marker, and how it relocates.
786* Predicates on Markers:: Testing whether an object is a marker. 1018* Predicates on Markers:: Testing whether an object is a marker.
787* Creating Markers:: Making empty markers or markers at certain places. 1019* Creating Markers:: Making empty markers or markers at certain places.
788* Information from Markers:: Finding the marker's buffer or character 1020* Information from Markers::Finding the marker's buffer or character
789 position. 1021 position.
790* Changing Markers:: Moving the marker to a new buffer or position. 1022* Marker Insertion Types:: Two ways a marker can relocate when you
1023 insert where it points.
1024* Moving Markers:: Moving the marker to a new buffer or position.
791* The Mark:: How "the mark" is implemented with a marker. 1025* The Mark:: How "the mark" is implemented with a marker.
792* The Region:: How to access "the region". 1026* The Region:: How to access "the region".
793 1027
@@ -795,6 +1029,7 @@ Text
795 1029
796* Near Point:: Examining text in the vicinity of point. 1030* Near Point:: Examining text in the vicinity of point.
797* Buffer Contents:: Examining text in a general fashion. 1031* Buffer Contents:: Examining text in a general fashion.
1032* Comparing Text:: Comparing substrings of buffers.
798* Insertion:: Adding new text to a buffer. 1033* Insertion:: Adding new text to a buffer.
799* Commands for Insertion:: User-level commands to insert text. 1034* Commands for Insertion:: User-level commands to insert text.
800* Deletion:: Removing text from a buffer. 1035* Deletion:: Removing text from a buffer.
@@ -802,21 +1037,32 @@ Text
802* The Kill Ring:: Where removed text sometimes is saved for 1037* The Kill Ring:: Where removed text sometimes is saved for
803 later use. 1038 later use.
804* Undo:: Undoing changes to the text of a buffer. 1039* Undo:: Undoing changes to the text of a buffer.
805* Auto Filling:: How auto-fill mode is implemented to break lines. 1040* Maintaining Undo:: How to enable and disable undo information.
1041 How to control how much information is kept.
806* Filling:: Functions for explicit filling. 1042* Filling:: Functions for explicit filling.
807* Margins:: How to specify margins for filling commands. 1043* Margins:: How to specify margins for filling commands.
1044* Adaptive Fill:: Adaptive Fill mode chooses a fill prefix
1045 from context.
1046* Auto Filling:: How auto-fill mode is implemented to break lines.
808* Sorting:: Functions for sorting parts of the buffer. 1047* Sorting:: Functions for sorting parts of the buffer.
809* Indentation:: Functions to insert or adjust indentation.
810* Columns:: Computing horizontal positions, and using them. 1048* Columns:: Computing horizontal positions, and using them.
1049* Indentation:: Functions to insert or adjust indentation.
811* Case Changes:: Case conversion of parts of the buffer. 1050* Case Changes:: Case conversion of parts of the buffer.
1051* Text Properties:: Assigning Lisp property lists to text characters.
812* Substitution:: Replacing a given character wherever it appears. 1052* Substitution:: Replacing a given character wherever it appears.
1053* Transposition:: Swapping two portions of a buffer.
813* Registers:: How registers are implemented. Accessing 1054* Registers:: How registers are implemented. Accessing
814 the text or position stored in a register. 1055 the text or position stored in a register.
1056* Base 64:: Conversion to or from base 64 encoding.
1057* MD5 Checksum:: Compute the MD5 "message digest"/"checksum".
1058* Atomic Changes:: Installing several buffer changes "atomically".
1059* Change Hooks:: Supplying functions to be run when text is changed.
815 1060
816The Kill Ring 1061The Kill Ring
817 1062
818* Kill Ring Concepts:: What text looks like in the kill ring. 1063* Kill Ring Concepts:: What text looks like in the kill ring.
819* Kill Functions:: Functions that kill text. 1064* Kill Functions:: Functions that kill text.
1065* Yanking:: How yanking is done.
820* Yank Commands:: Commands that access the kill ring. 1066* Yank Commands:: Commands that access the kill ring.
821* Low-Level Kill Ring:: Functions and variables for kill ring access. 1067* Low-Level Kill Ring:: Functions and variables for kill ring access.
822* Internals of Kill Ring:: Variables that hold kill-ring data. 1068* Internals of Kill Ring:: Variables that hold kill-ring data.
@@ -830,48 +1076,130 @@ Indentation
830* Indent Tabs:: Adjustable, typewriter-like tab stops. 1076* Indent Tabs:: Adjustable, typewriter-like tab stops.
831* Motion by Indent:: Move to first non-blank character. 1077* Motion by Indent:: Move to first non-blank character.
832 1078
1079Text Properties
1080
1081* Examining Properties:: Looking at the properties of one character.
1082* Changing Properties:: Setting the properties of a range of text.
1083* Property Search:: Searching for where a property changes value.
1084* Special Properties:: Particular properties with special meanings.
1085* Format Properties:: Properties for representing formatting of text.
1086* Sticky Properties:: How inserted text gets properties from
1087 neighboring text.
1088* Saving Properties:: Saving text properties in files, and reading
1089 them back.
1090* Lazy Properties:: Computing text properties in a lazy fashion
1091 only when text is examined.
1092* Clickable Text:: Using text properties to make regions of text
1093 do something when you click on them.
1094* Links and Mouse-1:: How to make @key{Mouse-1} follow a link.
1095* Fields:: The @code{field} property defines
1096 fields within the buffer.
1097* Not Intervals:: Why text properties do not use
1098 Lisp-visible text intervals.
1099
1100Non-ASCII Characters
1101
1102* Text Representations:: Unibyte and multibyte representations
1103* Converting Representations:: Converting unibyte to multibyte and vice versa.
1104* Selecting a Representation:: Treating a byte sequence as unibyte or multi.
1105* Character Codes:: How unibyte and multibyte relate to
1106 codes of individual characters.
1107* Character Sets:: The space of possible character codes
1108 is divided into various character sets.
1109* Chars and Bytes:: More information about multibyte encodings.
1110* Splitting Characters:: Converting a character to its byte sequence.
1111* Scanning Charsets:: Which character sets are used in a buffer?
1112* Translation of Characters:: Translation tables are used for conversion.
1113* Coding Systems:: Coding systems are conversions for saving files.
1114* Input Methods:: Input methods allow users to enter various
1115 non-ASCII characters without special keyboards.
1116* Locales:: Interacting with the POSIX locale.
1117
1118Coding Systems
1119
1120* Coding System Basics:: Basic concepts.
1121* Encoding and I/O:: How file I/O functions handle coding systems.
1122* Lisp and Coding Systems:: Functions to operate on coding system names.
1123* User-Chosen Coding Systems:: Asking the user to choose a coding system.
1124* Default Coding Systems:: Controlling the default choices.
1125* Specifying Coding Systems:: Requesting a particular coding system
1126 for a single file operation.
1127* Explicit Encoding:: Encoding or decoding text without doing I/O.
1128* Terminal I/O Encoding:: Use of encoding for terminal I/O.
1129* MS-DOS File Types:: How DOS "text" and "binary" files
1130 relate to coding systems.
1131
833Searching and Matching 1132Searching and Matching
834 1133
835* String Search:: Search for an exact match. 1134* String Search:: Search for an exact match.
1135* Searching and Case:: Case-independent or case-significant searching.
836* Regular Expressions:: Describing classes of strings. 1136* Regular Expressions:: Describing classes of strings.
837* Regexp Search:: Searching for a match for a regexp. 1137* Regexp Search:: Searching for a match for a regexp.
838* Match Data:: Finding out which part of the text matched 1138* POSIX Regexps:: Searching POSIX-style for the longest match.
839 various parts of a regexp, after regexp search. 1139* Match Data:: Finding out which part of the text matched,
840* Saving Match Data:: Saving and restoring this information. 1140 after a string or regexp search.
1141* Search and Replace:: Commands that loop, searching and replacing.
841* Standard Regexps:: Useful regexps for finding sentences, pages,... 1142* Standard Regexps:: Useful regexps for finding sentences, pages,...
842* Searching and Case:: Case-independent or case-significant searching.
843 1143
844Regular Expressions 1144Regular Expressions
845 1145
846* Syntax of Regexps:: Rules for writing regular expressions. 1146* Syntax of Regexps:: Rules for writing regular expressions.
847* Regexp Example:: Illustrates regular expression syntax. 1147* Regexp Example:: Illustrates regular expression syntax.
1148* Regexp Functions:: Functions for operating on regular expressions.
1149
1150Syntax of Regular Expressions
1151
1152* Regexp Special:: Special characters in regular expressions.
1153* Char Classes:: Character classes used in regular expressions.
1154* Regexp Backslash:: Backslash-sequences in regular expressions.
1155
1156The Match Data
1157
1158* Replacing Match:: Replacing a substring that was matched.
1159* Simple Match Data:: Accessing single items of match data,
1160 such as where a particular subexpression started.
1161* Entire Match Data:: Accessing the entire match data at once, as a list.
1162* Saving Match Data:: Saving and restoring the match data.
848 1163
849Syntax Tables 1164Syntax Tables
850 1165
1166* Syntax Basics:: Basic concepts of syntax tables.
851* Syntax Descriptors:: How characters are classified. 1167* Syntax Descriptors:: How characters are classified.
852* Syntax Table Functions:: How to create, examine and alter syntax tables. 1168* Syntax Table Functions:: How to create, examine and alter syntax tables.
1169* Syntax Properties:: Overriding syntax with text properties.
1170* Motion and Syntax:: Moving over characters with certain syntaxes.
853* Parsing Expressions:: Parsing balanced expressions 1171* Parsing Expressions:: Parsing balanced expressions
854 using the syntax table. 1172 using the syntax table.
855* Standard Syntax Tables:: Syntax tables used by various major modes. 1173* Standard Syntax Tables:: Syntax tables used by various major modes.
856* Syntax Table Internals:: How syntax table information is stored. 1174* Syntax Table Internals:: How syntax table information is stored.
1175* Categories:: Another way of classifying character syntax.
857 1176
858Syntax Descriptors 1177Syntax Descriptors
859 1178
860* Syntax Class Table:: Table of syntax classes. 1179* Syntax Class Table:: Table of syntax classes.
861* Syntax Flags:: Additional flags each character can have. 1180* Syntax Flags:: Additional flags each character can have.
862 1181
1182Parsing Expressions
1183
1184* Motion via Parsing:: Motion functions that work by parsing.
1185* Position Parse:: Determining the syntactic state of a position.
1186* Parser State:: How Emacs represents a syntactic state.
1187* Low-Level Parsing:: Parsing across a specified region.
1188* Control Parsing:: Parameters that affect parsing.
1189
863Abbrevs And Abbrev Expansion 1190Abbrevs And Abbrev Expansion
864 1191
865* Abbrev Mode:: Setting up Emacs for abbreviation. 1192* Abbrev Mode:: Setting up Emacs for abbreviation.
866* Tables: Abbrev Tables. Creating and working with abbrev tables. 1193* Abbrev Tables:: Creating and working with abbrev tables.
867* Defining Abbrevs:: Specifying abbreviations and their expansions. 1194* Defining Abbrevs:: Specifying abbreviations and their expansions.
868* Files: Abbrev Files. Saving abbrevs in files. 1195* Abbrev Files:: Saving abbrevs in files.
869* Expansion: Abbrev Expansion. Controlling expansion; expansion subroutines. 1196* Abbrev Expansion:: Controlling expansion; expansion subroutines.
870* Standard Abbrev Tables:: Abbrev tables used by various major modes. 1197* Standard Abbrev Tables:: Abbrev tables used by various major modes.
871 1198
872Processes 1199Processes
873 1200
874* Subprocess Creation:: Functions that start subprocesses. 1201* Subprocess Creation:: Functions that start subprocesses.
1202* Shell Arguments:: Quoting an argument to pass it to a shell.
875* Synchronous Processes:: Details of using synchronous subprocesses. 1203* Synchronous Processes:: Details of using synchronous subprocesses.
876* Asynchronous Processes:: Starting up an asynchronous subprocess. 1204* Asynchronous Processes:: Starting up an asynchronous subprocess.
877* Deleting Processes:: Eliminating an asynchronous subprocess. 1205* Deleting Processes:: Eliminating an asynchronous subprocess.
@@ -881,68 +1209,219 @@ Processes
881 an asynchronous subprocess. 1209 an asynchronous subprocess.
882* Output from Processes:: Collecting output from an asynchronous subprocess. 1210* Output from Processes:: Collecting output from an asynchronous subprocess.
883* Sentinels:: Sentinels run when process run-status changes. 1211* Sentinels:: Sentinels run when process run-status changes.
1212* Query Before Exit:: Whether to query if exiting will kill a process.
1213* Transaction Queues:: Transaction-based communication with subprocesses.
884* Network:: Opening network connections. 1214* Network:: Opening network connections.
1215* Network Servers:: Network servers let Emacs accept net connections.
1216* Datagrams:: UDP network connections.
1217* Low-Level Network:: Lower-level but more general function
1218 to create connections and servers.
1219* Misc Network:: Additional relevant functions for network connections.
1220* Byte Packing:: Using bindat to pack and unpack binary data.
885 1221
886Receiving Output from Processes 1222Receiving Output from Processes
887 1223
888* Process Buffers:: If no filter, output is put in a buffer. 1224* Process Buffers:: If no filter, output is put in a buffer.
889* Filter Functions:: Filter functions accept output from the process. 1225* Filter Functions:: Filter functions accept output from the process.
1226* Decoding Output:: Filters can get unibyte or multibyte strings.
890* Accepting Output:: How to wait until process output arrives. 1227* Accepting Output:: How to wait until process output arrives.
891 1228
1229Low-Level Network Access
1230
1231* Proc: Network Processes. Using @code{make-network-process}.
1232* Options: Network Options. Further control over network connections.
1233* Features: Network Feature Testing.
1234 Determining which network features work on
1235 the machine you are using.
1236
1237Packing and Unpacking Byte Arrays
1238
1239* Bindat Spec:: Describing data layout.
1240* Bindat Functions:: Doing the unpacking and packing.
1241* Bindat Examples:: Samples of what bindat.el can do for you!
1242
1243Emacs Display
1244
1245* Refresh Screen:: Clearing the screen and redrawing everything on it.
1246* Forcing Redisplay:: Forcing redisplay.
1247* Truncation:: Folding or wrapping long text lines.
1248* The Echo Area:: Displaying messages at the bottom of the screen.
1249* Warnings:: Displaying warning messages for the user.
1250* Invisible Text:: Hiding part of the buffer text.
1251* Selective Display:: Hiding part of the buffer text (the old way).
1252* Temporary Displays:: Displays that go away automatically.
1253* Overlays:: Use overlays to highlight parts of the buffer.
1254* Width:: How wide a character or string is on the screen.
1255* Line Height:: Controlling the height of lines.
1256* Faces:: A face defines a graphics style
1257 for text characters: font, colors, etc.
1258* Fringes:: Controlling window fringes.
1259* Scroll Bars:: Controlling vertical scroll bars.
1260* Display Property:: Enabling special display features.
1261* Images:: Displaying images in Emacs buffers.
1262* Buttons:: Adding clickable buttons to Emacs buffers.
1263* Abstract Display:: Emacs' Widget for Object Collections.
1264* Blinking:: How Emacs shows the matching open parenthesis.
1265* Usual Display:: The usual conventions for displaying nonprinting chars.
1266* Display Tables:: How to specify other conventions.
1267* Beeping:: Audible signal to the user.
1268* Window Systems:: Which window system is being used.
1269
1270The Echo Area
1271
1272* Displaying Messages:: Explicitly displaying text in the echo area.
1273* Progress:: Informing user about progress of a long operation.
1274* Logging Messages:: Echo area messages are logged for the user.
1275* Echo Area Customization:: Controlling the echo area.
1276
1277Reporting Warnings
1278
1279* Warning Basics:: Warnings concepts and functions to report them.
1280* Warning Variables:: Variables programs bind to customize their warnings.
1281* Warning Options:: Variables users set to control display of warnings.
1282
1283Overlays
1284
1285* Managing Overlays:: Creating and moving overlays.
1286* Overlay Properties:: How to read and set properties.
1287 What properties do to the screen display.
1288* Finding Overlays:: Searching for overlays.
1289
1290Faces
1291
1292* Defining Faces:: How to define a face with @code{defface}.
1293* Face Attributes:: What is in a face?
1294* Attribute Functions:: Functions to examine and set face attributes.
1295* Displaying Faces:: How Emacs combines the faces specified for
1296 a character.
1297* Font Selection:: Finding the best available font for a face.
1298* Face Functions:: How to define and examine faces.
1299* Auto Faces:: Hook for automatic face assignment.
1300* Font Lookup:: Looking up the names of available fonts
1301 and information about them.
1302* Fontsets:: A fontset is a collection of fonts
1303 that handle a range of character sets.
1304
1305Fringes
1306
1307* Fringe Size/Pos:: Specifying where to put the window fringes.
1308* Fringe Indicators:: Displaying indicator icons in the window fringes.
1309* Fringe Cursors:: Displaying cursors in the right fringe.
1310* Fringe Bitmaps:: Specifying bitmaps for fringe indicators.
1311* Customizing Bitmaps:: Specifying your own bitmaps to use in the fringes.
1312* Overlay Arrow:: Display of an arrow to indicate position.
1313
1314The @code{display} Property
1315
1316* Specified Space:: Displaying one space with a specified width.
1317* Pixel Specification:: Specifying space width or height in pixels.
1318* Other Display Specs:: Displaying an image; magnifying text; moving it
1319 up or down on the page; adjusting the width
1320 of spaces within text.
1321* Display Margins:: Displaying text or images to the side of
1322 the main text.
1323
1324Images
1325
1326* Image Descriptors:: How to specify an image for use in @code{:display}.
1327* XBM Images:: Special features for XBM format.
1328* XPM Images:: Special features for XPM format.
1329* GIF Images:: Special features for GIF format.
1330* PostScript Images:: Special features for PostScript format.
1331* Other Image Types:: Various other formats are supported.
1332* Defining Images:: Convenient ways to define an image for later use.
1333* Showing Images:: Convenient ways to display an image once
1334 it is defined.
1335* Image Cache:: Internal mechanisms of image display.
1336
1337Buttons
1338
1339* Button Properties:: Button properties with special meanings.
1340* Button Types:: Defining common properties for classes of buttons.
1341* Making Buttons:: Adding buttons to Emacs buffers.
1342* Manipulating Buttons:: Getting and setting properties of buttons.
1343* Button Buffer Commands:: Buffer-wide commands and bindings for buttons.
1344
1345Abstract Display
1346
1347* Abstract Display Functions:: Functions in the Ewoc package.
1348* Abstract Display Example:: Example of using Ewoc.
1349
1350Display Tables
1351
1352* Display Table Format:: What a display table consists of.
1353* Active Display Table:: How Emacs selects a display table to use.
1354* Glyphs:: How to define a glyph, and what glyphs mean.
1355
892Operating System Interface 1356Operating System Interface
893 1357
894* Starting Up:: Customizing Emacs start-up processing. 1358* Starting Up:: Customizing Emacs start-up processing.
895* Getting Out:: How exiting works (permanent or temporary). 1359* Getting Out:: How exiting works (permanent or temporary).
896* System Environment:: Distinguish the name and kind of system. 1360* System Environment:: Distinguish the name and kind of system.
897* Terminal Input:: Recording terminal input for debugging. 1361* User Identification:: Finding the name and user id of the user.
898* Terminal Output:: Recording terminal output for debugging. 1362* Time of Day:: Getting the current time.
899* Flow Control:: How to turn output flow control on or off. 1363* Time Conversion:: Converting a time from numeric form to a string, or
1364 to calendrical data (or vice versa).
1365* Time Parsing:: Converting a time from numeric form to text
1366 and vice versa.
1367* Processor Run Time:: Getting the run time used by Emacs.
1368* Time Calculations:: Adding, subtracting, comparing times, etc.
1369* Timers:: Setting a timer to call a function at a certain time.
1370* Idle Timers:: Setting a timer to call a function when Emacs has
1371 been idle for a certain length of time.
1372* Terminal Input:: Accessing and recording terminal input.
1373* Terminal Output:: Controlling and recording terminal output.
1374* Sound Output:: Playing sounds on the computer's speaker.
1375* X11 Keysyms:: Operating on key symbols for X Windows
900* Batch Mode:: Running Emacs without terminal interaction. 1376* Batch Mode:: Running Emacs without terminal interaction.
1377* Session Management:: Saving and restoring state with X Session Management.
901 1378
902Starting Up Emacs 1379Starting Up Emacs
903 1380
904* Start-up Summary:: Sequence of actions Emacs performs at start-up. 1381* Startup Summary:: Sequence of actions Emacs performs at start-up.
905* Init File:: Details on reading the init file (@file{.emacs}). 1382* Init File:: Details on reading the init file (@file{.emacs}).
906* Terminal-Specific:: How the terminal-specific Lisp file is read. 1383* Terminal-Specific:: How the terminal-specific Lisp file is read.
907* Command Line Arguments:: How command line arguments are processed, 1384* Command-Line Arguments:: How command-line arguments are processed,
908 and how you can customize them. 1385 and how you can customize them.
909 1386
910Getting out of Emacs 1387Getting Out of Emacs
911 1388
912* Killing Emacs:: Exiting Emacs irreversibly. 1389* Killing Emacs:: Exiting Emacs irreversibly.
913* Suspending Emacs:: Exiting Emacs reversibly. 1390* Suspending Emacs:: Exiting Emacs reversibly.
914 1391
915Emacs Display 1392Terminal Input
916 1393
917* Refresh Screen:: Clearing the screen and redrawing everything on it. 1394* Input Modes:: Options for how input is processed.
918* Truncation:: Folding or wrapping long text lines. 1395* Recording Input:: Saving histories of recent or all input events.
919* The Echo Area:: Where messages are displayed. 1396
920* Selective Display:: Hiding part of the buffer text. 1397Tips and Conventions
921* Overlay Arrow:: Display of an arrow to indicate position. 1398
922* Temporary Displays:: Displays that go away automatically. 1399* Coding Conventions:: Conventions for clean and robust programs.
923* Waiting:: Forcing display update and waiting for user. 1400* Key Binding Conventions:: Which keys should be bound by which programs.
924* Blinking:: How Emacs shows the matching open parenthesis. 1401* Programming Tips:: Making Emacs code fit smoothly in Emacs.
925* Usual Display:: How control characters are displayed. 1402* Compilation Tips:: Making compiled code run fast.
926* Beeping:: Audible signal to the user. 1403* Warning Tips:: Turning off compiler warnings.
927* Window Systems:: Which window system is being used. 1404* Documentation Tips:: Writing readable documentation strings.
1405* Comment Tips:: Conventions for writing comments.
1406* Library Headers:: Standard headers for library packages.
928 1407
929GNU Emacs Internals 1408GNU Emacs Internals
930 1409
931* Building Emacs:: How to preload Lisp libraries into Emacs. 1410* Building Emacs:: How the dumped Emacs is made.
932* Pure Storage:: A kludge to make preloaded Lisp functions sharable. 1411* Pure Storage:: A kludge to make preloaded Lisp functions sharable.
933* Garbage Collection:: Reclaiming space for Lisp objects no longer used. 1412* Garbage Collection:: Reclaiming space for Lisp objects no longer used.
934* Object Internals:: Data formats of buffers, windows, processes. 1413* Memory Usage:: Info about total size of Lisp objects made so far.
935* Writing Emacs Primitives:: Writing C code for Emacs. 1414* Writing Emacs Primitives:: Writing C code for Emacs.
1415* Object Internals:: Data formats of buffers, windows, processes.
936 1416
937Object Internals 1417Object Internals
938 1418
939* Buffer Internals:: Components of a buffer structure. 1419* Buffer Internals:: Components of a buffer structure.
940* Window Internals:: Components of a window structure. 1420* Window Internals:: Components of a window structure.
941* Process Internals:: Components of a process structure. 1421* Process Internals:: Components of a process structure.
1422@end detailmenu
942@end menu 1423@end menu
943 1424
944@c ================ Volume 1 ================
945
946@include intro.texi 1425@include intro.texi
947@include objects.texi 1426@include objects.texi
948@include numbers.texi 1427@include numbers.texi
@@ -950,6 +1429,7 @@ Object Internals
950 1429
951@include lists.texi 1430@include lists.texi
952@include sequences.texi 1431@include sequences.texi
1432@include hash.texi
953@include symbols.texi 1433@include symbols.texi
954@include eval.texi 1434@include eval.texi
955 1435
@@ -958,36 +1438,40 @@ Object Internals
958@include functions.texi 1438@include functions.texi
959@include macros.texi 1439@include macros.texi
960 1440
1441@include customize.texi
961@include loading.texi 1442@include loading.texi
962@include compile.texi 1443@include compile.texi
1444@include advice.texi
1445
963@include debugging.texi 1446@include debugging.texi
964@include streams.texi 1447@include streams.texi
965
966@include minibuf.texi 1448@include minibuf.texi
967@include commands.texi 1449@include commands.texi
1450
968@include keymaps.texi 1451@include keymaps.texi
969@include modes.texi 1452@include modes.texi
1453@include help.texi
1454@include files.texi
970 1455
971@c ================ Beginning of Volume 2 ================ 1456@include backups.texi
972 1457
973@c include help.texi 1458@c ================ Beginning of Volume 2 ================
974@c include files.texi
975@c include backups.texi
976@c include buffers.texi 1459@c include buffers.texi
977
978@c include windows.texi 1460@c include windows.texi
979@c include frames.texi 1461@c include frames.texi
1462
980@c include positions.texi 1463@c include positions.texi
981@c include markers.texi 1464@c include markers.texi
982@c include text.texi 1465@c include text.texi
1466@c include nonascii.texi
983 1467
984@c include searching.texi 1468@c include searching.texi
985@c include syntax.texi 1469@c include syntax.texi
986@c include abbrevs.texi 1470@c include abbrevs.texi
987
988@c include processes.texi 1471@c include processes.texi
989@c include os.texi 1472
990@c include display.texi 1473@c include display.texi
1474@c include os.texi
991 1475
992@c MOVE to Emacs Manual: include misc-modes.texi 1476@c MOVE to Emacs Manual: include misc-modes.texi
993 1477
@@ -995,21 +1479,24 @@ Object Internals
995 1479
996@c REMOVE this: include non-hacker.texi 1480@c REMOVE this: include non-hacker.texi
997 1481
1482@c include anti.texi
1483@c include doclicense.texi
1484@c include gpl.texi
998@c include tips.texi 1485@c include tips.texi
999@c include internals.texi 1486@c include internals.texi
1000@c include errors.texi 1487@c include errors.texi
1001@c include locals.texi 1488@c include locals.texi
1002@c include maps.texi 1489@c include maps.texi
1003@c include hooks.texi 1490@c include hooks.texi
1004@c include anti.texi
1005 1491
1006@include index-vol1.texi 1492@include index.texi
1007 1493
1008@page 1494@ignore
1009@c Print the tables of contents 1495@node New Symbols, , Index, Top
1010@summarycontents 1496@unnumbered New Symbols Since the Previous Edition
1011@contents 1497
1012@c That's all 1498@printindex tp
1499@end ignore
1013 1500
1014@bye 1501@bye
1015 1502
diff --git a/lispref/vol2.texi b/lispref/vol2.texi
index d21723be037..2ccbaefca9b 100644
--- a/lispref/vol2.texi
+++ b/lispref/vol2.texi
@@ -1,214 +1,129 @@
1This file is obsolete, and no longer part of the Emacs Lisp Reference Manual. 1\input texinfo @c -*-texinfo-*-
2It is still present in CVS in case we ever want to use some of it again. 2@c This file is used for printing the GNU Emacs Lisp Reference Manual
3 3@c in two volumes. It is a modified version of elisp.texi.
4@c This is part of the GNU Emacs Lisp Reference Manual.
5@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001, 4@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2001,
6@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc. 5@c 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
7@c See the file elisp.texi for copying conditions.
8
9
10\input texinfo @c -*-texinfo-*-
11@c %**start of header 6@c %**start of header
12@setfilename elisp 7@setfilename elisp
13@settitle GNU Emacs Lisp Reference Manual: Volume 2 8@settitle GNU Emacs Lisp Reference Manual: Volume 2
14@smallbook
15@c %**end of header 9@c %**end of header
16 10
17 11@c See two-volume-cross-refs.txt.
18@tex 12@tex
19%%%% Experiment with smaller skip before sections and subsections. 13\message{Formatting for two volume edition...Volume 2...}
20%%%% --rjc 30mar92 14%
21 15% Read special toc file, set up in two-volume.make.
22\global\secheadingskip = 17pt plus 6pt minus 3pt 16\gdef\tocreadfilename{elisp2-toc-ready.toc}
23\global\subsecheadingskip = 14pt plus 6pt minus 3pt 17%
24 18% Don't make outlines, they're not needed and \readdatafile can't pay
25% The defaults are: 19% attention to the special definition above.
26% \secheadingskip = 21pt plus 8pt minus 4pt 20\global\let\pdfmakeoutlines=\relax
27% \subsecheadingskip = 17pt plus 8pt minus 4pt 21%
22% Start volume 2 chapter numbering at 27; this must be listed as chapno26
23\global\chapno=26
28@end tex 24@end tex
29 25
30@finalout 26@c Version of the manual and of Emacs.
31@c tex 27@c Please remember to update the edition number in README as well.
32@c \overfullrule=0pt 28@set VERSION 2.9
33@c end tex 29@set EMACSVER 22.0.99
34 30
35@c Start volume 2 chapter numbering on chapter 21; 31@dircategory Emacs
36@c this must be listed as chapno 20. 32@direntry
37@tex 33* Elisp: (elisp). The Emacs Lisp Reference Manual.
38\global\chapno=20 34@end direntry
39@end tex
40 35
41@c ================================================================ 36@c in general, keep the following line commented out, unless doing a
42@c Note: I was unable to figure out how to get .aux files copied 37@c copy of this manual that will be published. the manual should go
43@c properly in the time I had. Hence need to copy .aux file before 38@c onto the distribution in the full, 8.5 x 11" size.
44@c running Tex. --rjc 39@set smallbook
45 40
46@tex 41@ifset smallbook
42@smallbook
43@end ifset
47 44
48\message{} 45@c per rms and peterb, use 10pt fonts for the main text, mostly to
49\message{Redefining contents commands...} 46@c save on paper cost.
50\message{} 47@c Do this inside @tex for now, so current makeinfo does not complain.
51 48@tex
52% Special @contents command 49@ifset smallbook
53 50@fonttextsize 10
54% This inputs fixed up table of contents file rather than create new one. 51@set EMACSVER 22
55\global\def\contents{% 52\global\let\urlcolor=\Black % don't print links in grayscale
56 \startcontents{Table of Contents}% 53\global\let\linkcolor=\Black
57 \input elisp2-toc-ready.toc 54@end ifset
58 \endgroup 55\global\hbadness=6666 % don't worry about not-too-underfull boxes
59 \vfill \eject
60}
61
62% Special @summarycontents command
63% This inputs fixed up table of contents file rather than create new one.
64\global\def\summarycontents{%
65 \startcontents{Short Contents}%
66 %
67 \let\chapentry = \shortchapentry
68 \let\unnumbchapentry = \shortunnumberedentry
69 % We want a true roman here for the page numbers.
70 \secfonts
71 \let\rm=\shortcontrm \let\bf=\shortcontbf \let\sl=\shortcontsl
72 \rm
73 \advance\baselineskip by 1pt % Open it up a little.
74 \def\secentry ##1##2##3##4{}
75 \def\unnumbsecentry ##1##2{}
76 \def\subsecentry ##1##2##3##4##5{}
77 \def\unnumbsubsecentry ##1##2{}
78 \def\subsubsecentry ##1##2##3##4##5##6{}
79 \def\unnumbsubsubsecentry ##1##2{}
80 \input elisp2-toc-ready.toc
81 \endgroup
82 \vfill \eject
83}
84
85\message{}
86\message{Formatting special two volume edition...Volume 2...}
87\message{}
88@end tex 56@end tex
89@c ================================================================
90
91
92@c ==> This `elisp-small.texi' is a `smallbook' version of the manual.
93 57
94@c ==== Following are acceptable over and underfull hboxes in TeX ====
95
96@c -----
97@c [163] [164] [165] [166]) (loading.texi Chapter 13 [167] [168] [169]
98@c Overfull \hbox (20.5428pt too wide) in paragraph at lines 131--131
99@c []@ninett
100@c setenv EMAC-SLOAD-PATH .:/user/bil/emacs:/usr/local/lib/emacs/lisp[]
101@c -----
102@c (minibuf.texi Chapter 17 [206] [207] [208] [209] [210] [211] [212] [213]
103@c [214] [215]
104@c Overfull \hbox (2.09094pt too wide) in paragraph at lines 550--560
105@c @texttt map[] @textrm if @textsl require-match @textrm is
106@c @texttt nil[]@textrm , or else with the keymap @texttt minibuffer-
107@c -----
108@c (locals.texi Appendix @char 68 [533] [534]
109@c Underfull \hbox (badness 2512) in paragraph at lines 4--4
110@c []@chaprm Appendix DStandard Buffer-Local
111
112@c -------------------------------------------------------------------
113
114@c
115@c Combine indices. 58@c Combine indices.
116@synindex cp fn 59@synindex cp fn
117@syncodeindex vr fn 60@syncodeindex vr fn
118@syncodeindex ky fn 61@syncodeindex ky fn
119@syncodeindex pg fn 62@syncodeindex pg fn
120@syncodeindex tp fn 63@c We use the "type index" to index new functions and variables.
121@c oops: texinfo-format-buffer ignores synindex 64@c @syncodeindex tp fn
122@c 65
123 66@copying
124@ifinfo 67This is edition @value{VERSION} of the GNU Emacs Lisp Reference Manual,@*
125This file documents GNU Emacs Lisp. 68corresponding to Emacs version @value{EMACSVER}.
126 69
127@c The edition number appears in several places in this file 70Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1998,
128@c and also in the file intro.texi. 711999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
129This is edition 2.4 of the GNU Emacs Lisp Reference 72Foundation, Inc.
130Manual. It corresponds to Emacs Version 19.29. 73
131@c Please REMEMBER to update edition number in *four* places in this file 74@quotation
132@c and also in *one* place in ==> intro.texi <== 75Permission is granted to copy, distribute and/or modify this document
133@c huh? i only found three real places where the edition is stated, and 76under the terms of the GNU Free Documentation License, Version 1.2 or
134@c one place where it is not stated explicitly ("this info file is newer 77any later version published by the Free Software Foundation; with the
135@c than the foobar edition"). --mew 13sep93 78Invariant Sections being ``GNU General Public License,'' with the
136 79Front-Cover texts being ``A GNU Manual,'' and with the Back-Cover
137Published by the Free Software Foundation 80Texts as in (a) below. A copy of the license is included in the
13851 Franklin Street, Fifth Floor 81section entitled ``GNU Free Documentation License.''
139Boston, MA 02110-1301 USA 82
140@end ifinfo 83(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
141 84this GNU Manual, like GNU software. Copies published by the Free
142@setchapternewpage odd 85Software Foundation raise funds for GNU development.''
143 86@end quotation
144@iftex 87@end copying
145@shorttitlepage The GNU Emacs Lisp Reference Manual: Volume 2 88
146@end iftex
147@titlepage 89@titlepage
148@sp 1 90@title GNU Emacs Lisp Reference Manual
149@center @titlefont{The} 91@subtitle Volume 2
150@sp 1 92@subtitle For Emacs Version @value{EMACSVER}
151@center @titlefont{GNU Emacs Lisp} 93@subtitle Revision @value{VERSION}, June 2007
152@sp 1 94
153@center @titlefont{Reference Manual} 95@author by Bil Lewis, Dan LaLiberte, Richard Stallman
154@sp 2 96@author and the GNU Manual Group
155@center GNU Emacs Version 19.29
156@center for Unix Users
157@sp 1
158@center Edition 2.4, June 1995
159@sp 2
160@center @titlefont{Volume 2}
161@sp 3
162@center by Bil Lewis, Dan LaLiberte,
163@center and the GNU Manual Group
164@page 97@page
165@vskip 0pt plus 1filll 98@vskip 0pt plus 1filll
166Copyright @copyright{} 1990, 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. 99@insertcopying
167
168@sp 2
169Edition 2.4 @*
170Revised for Emacs Version 19.29,@*
171June, 1995.@*
172@sp 2
173ISBN 1-882114-71-X
174 100
175@sp 2 101@sp 2
176Published by the Free Software Foundation @* 102Published by the Free Software Foundation @*
17751 Franklin Street, Fifth Floor @* 10351 Franklin St, Fifth Floor @*
178Boston, MA 02110-1301 USA 104Boston, MA 02110-1301 @*
179 105USA @*
180@sp 1 106ISBN 1-882114-74-4
181Permission is granted to make and distribute verbatim copies of this
182manual provided the copyright notice and this permission notice are
183preserved on all copies.
184
185Permission is granted to copy and distribute modified versions of this
186manual under the conditions for verbatim copying, provided also that the
187section entitled ``GNU General Public License'' is included
188exactly as in the original, and provided that the entire resulting
189derived work is distributed under the terms of a permission notice
190identical to this one.
191
192Permission is granted to copy and distribute translations of this manual
193into another language, under the above conditions for modified versions,
194except that the section entitled ``GNU General Public License'' may be
195included in a translation approved by the Free Software Foundation
196instead of in the original English.
197 107
198@sp 2 108@sp 2
199Cover art by Etienne Suvasa. 109Cover art by Etienne Suvasa.
200@end titlepage 110@end titlepage
201@page
202 111
203@node Top, Copying, (dir), (dir)
204 112
205@ifinfo 113@c Print the tables of contents
206This Info file contains edition 2.4 of the GNU Emacs Lisp Reference 114@summarycontents
207Manual, corresponding to GNU Emacs version 19.29. 115@contents
208@end ifinfo 116
117
118@ifnottex
119@node Top, Introduction, (dir), (dir)
120@top Emacs Lisp
121
122This Info file contains edition @value{VERSION} of the GNU Emacs Lisp
123Reference Manual, corresponding to GNU Emacs version @value{EMACSVER}.
124@end ifnottex
209 125
210@menu 126@menu
211* Copying:: Conditions for copying and changing GNU Emacs.
212* Introduction:: Introduction and conventions used. 127* Introduction:: Introduction and conventions used.
213 128
214* Lisp Data Types:: Data types of objects in Emacs Lisp. 129* Lisp Data Types:: Data types of objects in Emacs Lisp.
@@ -218,6 +133,7 @@ Manual, corresponding to GNU Emacs version 19.29.
218* Sequences Arrays Vectors:: Lists, strings and vectors are called sequences. 133* Sequences Arrays Vectors:: Lists, strings and vectors are called sequences.
219 Certain functions act on any kind of sequence. 134 Certain functions act on any kind of sequence.
220 The description of vectors is here as well. 135 The description of vectors is here as well.
136* Hash Tables:: Very fast lookup-tables.
221* Symbols:: Symbols represent names, uniquely. 137* Symbols:: Symbols represent names, uniquely.
222 138
223* Evaluation:: How Lisp expressions are evaluated. 139* Evaluation:: How Lisp expressions are evaluated.
@@ -226,9 +142,11 @@ Manual, corresponding to GNU Emacs version 19.29.
226* Functions:: A function is a Lisp program 142* Functions:: A function is a Lisp program
227 that can be invoked from other functions. 143 that can be invoked from other functions.
228* Macros:: Macros are a way to extend the Lisp language. 144* Macros:: Macros are a way to extend the Lisp language.
145* Customization:: Writing customization declarations.
229 146
230* Loading:: Reading files of Lisp code into Lisp. 147* Loading:: Reading files of Lisp code into Lisp.
231* Byte Compilation:: Compilation makes programs run faster. 148* Byte Compilation:: Compilation makes programs run faster.
149* Advising Functions:: Adding to the definition of a function.
232* Debugging:: Tools and tips for debugging Lisp programs. 150* Debugging:: Tools and tips for debugging Lisp programs.
233 151
234* Read and Print:: Converting Lisp objects to text and back. 152* Read and Print:: Converting Lisp objects to text and back.
@@ -244,36 +162,51 @@ Manual, corresponding to GNU Emacs version 19.29.
244 files are made. 162 files are made.
245* Buffers:: Creating and using buffer objects. 163* Buffers:: Creating and using buffer objects.
246* Windows:: Manipulating windows and displaying buffers. 164* Windows:: Manipulating windows and displaying buffers.
247* Frames:: Making multiple X windows. 165* Frames:: Making multiple system-level windows.
248* Positions:: Buffer positions and motion functions. 166* Positions:: Buffer positions and motion functions.
249* Markers:: Markers represent positions and update 167* Markers:: Markers represent positions and update
250 automatically when the text is changed. 168 automatically when the text is changed.
251 169
252* Text:: Examining and changing text in buffers. 170* Text:: Examining and changing text in buffers.
171* Non-ASCII Characters:: Non-ASCII text in buffers and strings.
253* Searching and Matching:: Searching buffers for strings or regexps. 172* Searching and Matching:: Searching buffers for strings or regexps.
254* Syntax Tables:: The syntax table controls word and list parsing. 173* Syntax Tables:: The syntax table controls word and list parsing.
255* Abbrevs:: How Abbrev mode works, and its data structures. 174* Abbrevs:: How Abbrev mode works, and its data structures.
256 175
257* Processes:: Running and communicating with subprocesses. 176* Processes:: Running and communicating with subprocesses.
177* Display:: Features for controlling the screen display.
258* System Interface:: Getting the user id, system type, environment 178* System Interface:: Getting the user id, system type, environment
259 variables, and other such things. 179 variables, and other such things.
260* Display:: Parameters controlling screen usage.
261 The bell. Waiting for input.
262 180
263Appendices 181Appendices
264 182
265* Tips:: Advice for writing Lisp programs. 183* Antinews:: Info for users downgrading to Emacs 21.
184* GNU Free Documentation License:: The license for this documentation
185* GPL:: Conditions for copying and changing GNU Emacs.
186* Tips:: Advice and coding conventions for Emacs Lisp.
266* GNU Emacs Internals:: Building and dumping Emacs; 187* GNU Emacs Internals:: Building and dumping Emacs;
267 internal data structures. 188 internal data structures.
268* Standard Errors:: List of all error symbols. 189* Standard Errors:: List of all error symbols.
269* Standard Buffer-Local Variables:: List of variables local in all buffers. 190* Standard Buffer-Local Variables::
191 List of variables buffer-local in all buffers.
270* Standard Keymaps:: List of standard keymaps. 192* Standard Keymaps:: List of standard keymaps.
271* Standard Hooks:: List of standard hook variables. 193* Standard Hooks:: List of standard hook variables.
272 194
273* Index:: Index including concepts, functions, variables, 195* Index:: Index including concepts, functions, variables,
274 and other terms. 196 and other terms.
275 197
276 --- The Detailed Node Listing --- 198@ignore
199* New Symbols:: New functions and variables in Emacs @value{EMACSVER}.
200@end ignore
201
202@c Do NOT modify the following 3 lines! They must have this form to
203@c be correctly identified by `texinfo-multiple-files-update'. In
204@c particular, the detailed menu header line MUST be identical to the
205@c value of `texinfo-master-menu-header'. See texnfo-upd.el.
206
207@detailmenu
208 --- The Detailed Node Listing ---
209 ---------------------------------
277 210
278Here are other nodes that are inferiors of those already listed, 211Here are other nodes that are inferiors of those already listed,
279mentioned here so you can get to them in one step: 212mentioned here so you can get to them in one step:
@@ -283,6 +216,7 @@ Introduction
283* Caveats:: Flaws and a request for help. 216* Caveats:: Flaws and a request for help.
284* Lisp History:: Emacs Lisp is descended from Maclisp. 217* Lisp History:: Emacs Lisp is descended from Maclisp.
285* Conventions:: How the manual is formatted. 218* Conventions:: How the manual is formatted.
219* Version Info:: Which Emacs version is running?
286* Acknowledgements:: The authors, editors, and sponsors of this manual. 220* Acknowledgements:: The authors, editors, and sponsors of this manual.
287 221
288Conventions 222Conventions
@@ -297,8 +231,10 @@ Conventions
297 231
298Format of Descriptions 232Format of Descriptions
299 233
300* A Sample Function Description:: 234* A Sample Function Description:: A description of an imaginary
301* A Sample Variable Description:: 235 function, @code{foo}.
236* A Sample Variable Description:: A description of an imaginary
237 variable, @code{electric-future-map}.
302 238
303Lisp Data Types 239Lisp Data Types
304 240
@@ -306,6 +242,7 @@ Lisp Data Types
306* Comments:: Comments and their formatting conventions. 242* Comments:: Comments and their formatting conventions.
307* Programming Types:: Types found in all Lisp systems. 243* Programming Types:: Types found in all Lisp systems.
308* Editing Types:: Types specific to Emacs. 244* Editing Types:: Types specific to Emacs.
245* Circular Objects:: Read syntax for circular structure.
309* Type Predicates:: Tests related to types. 246* Type Predicates:: Tests related to types.
310* Equality Predicates:: Tests of equality between any two objects. 247* Equality Predicates:: Tests of equality between any two objects.
311 248
@@ -314,70 +251,95 @@ Programming Types
314* Integer Type:: Numbers without fractional parts. 251* Integer Type:: Numbers without fractional parts.
315* Floating Point Type:: Numbers with fractional parts and with a large range. 252* Floating Point Type:: Numbers with fractional parts and with a large range.
316* Character Type:: The representation of letters, numbers and 253* Character Type:: The representation of letters, numbers and
317 control characters. 254 control characters.
255* Symbol Type:: A multi-use object that refers to a function,
256 variable, property list, or itself.
318* Sequence Type:: Both lists and arrays are classified as sequences. 257* Sequence Type:: Both lists and arrays are classified as sequences.
319* Cons Cell Type:: Cons cells, and lists (which are made from cons cells). 258* Cons Cell Type:: Cons cells, and lists (which are made from cons cells).
320* Array Type:: Arrays include strings and vectors. 259* Array Type:: Arrays include strings and vectors.
321* String Type:: An (efficient) array of characters. 260* String Type:: An (efficient) array of characters.
322* Vector Type:: One-dimensional arrays. 261* Vector Type:: One-dimensional arrays.
323* Symbol Type:: A multi-use object that refers to a function, 262* Char-Table Type:: One-dimensional sparse arrays indexed by characters.
324 variable, property list, or itself. 263* Bool-Vector Type:: One-dimensional arrays of @code{t} or @code{nil}.
264* Hash Table Type:: Super-fast lookup tables.
325* Function Type:: A piece of executable code you can call from elsewhere. 265* Function Type:: A piece of executable code you can call from elsewhere.
326* Macro Type:: A method of expanding an expression into another 266* Macro Type:: A method of expanding an expression into another
327 expression, more fundamental but less pretty. 267 expression, more fundamental but less pretty.
328* Primitive Function Type:: A function written in C, callable from Lisp. 268* Primitive Function Type:: A function written in C, callable from Lisp.
329* Byte-Code Type:: A function written in Lisp, then compiled. 269* Byte-Code Type:: A function written in Lisp, then compiled.
330* Autoload Type:: A type used for automatically loading seldom-used 270* Autoload Type:: A type used for automatically loading seldom-used
331 functions. 271 functions.
272
273Character Type
332 274
333List Type 275* Basic Char Syntax:: Syntax for regular characters.
276* General Escape Syntax:: How to specify characters by their codes.
277* Ctl-Char Syntax:: Syntax for control characters.
278* Meta-Char Syntax:: Syntax for meta-characters.
279* Other Char Bits:: Syntax for hyper-, super-, and alt-characters.
334 280
281Cons Cell and List Types
282
283* Box Diagrams:: Drawing pictures of lists.
335* Dotted Pair Notation:: An alternative syntax for lists. 284* Dotted Pair Notation:: An alternative syntax for lists.
336* Association List Type:: A specially constructed list. 285* Association List Type:: A specially constructed list.
337 286
287String Type
288
289* Syntax for Strings:: How to specify Lisp strings.
290* Non-ASCII in Strings:: International characters in strings.
291* Nonprinting Characters:: Literal unprintable characters in strings.
292* Text Props and Strings:: Strings with text properties.
293
338Editing Types 294Editing Types
339 295
340* Buffer Type:: The basic object of editing. 296* Buffer Type:: The basic object of editing.
341* Window Type:: What makes buffers visible.
342* Window Configuration Type::Save what the screen looks like.
343* Marker Type:: A position in a buffer. 297* Marker Type:: A position in a buffer.
298* Window Type:: What makes buffers visible.
299* Frame Type:: Windows subdivide frames.
300* Window Configuration Type:: Recording the way a frame is subdivided.
301* Frame Configuration Type:: Recording the status of all frames.
344* Process Type:: A process running on the underlying OS. 302* Process Type:: A process running on the underlying OS.
345* Stream Type:: Receive or send characters. 303* Stream Type:: Receive or send characters.
346* Keymap Type:: What function a keystroke invokes. 304* Keymap Type:: What function a keystroke invokes.
347* Syntax Table Type:: What a character means. 305* Overlay Type:: How an overlay is represented.
348 306
349Numbers 307Numbers
350 308
351* Integer Basics:: Representation and range of integers. 309* Integer Basics:: Representation and range of integers.
352* Float Basics:: Representation and range of floating point. 310* Float Basics:: Representation and range of floating point.
353* Predicates on Numbers:: Testing for numbers. 311* Predicates on Numbers:: Testing for numbers.
354* Comparison of Numbers:: Equality and inequality predicates. 312* Comparison of Numbers:: Equality and inequality predicates.
355* Arithmetic Operations:: How to add, subtract, multiply and divide. 313* Numeric Conversions:: Converting float to integer and vice versa.
356* Bitwise Operations:: Logical and, or, not, shifting. 314* Arithmetic Operations:: How to add, subtract, multiply and divide.
357* Numeric Conversions:: Converting float to integer and vice versa. 315* Rounding Operations:: Explicitly rounding floating point numbers.
358* Math Functions:: Trig, exponential and logarithmic functions. 316* Bitwise Operations:: Logical and, or, not, shifting.
359* Random Numbers:: Obtaining random integers, predictable or not. 317* Math Functions:: Trig, exponential and logarithmic functions.
318* Random Numbers:: Obtaining random integers, predictable or not.
360 319
361Strings and Characters 320Strings and Characters
362 321
363* String Basics:: Basic properties of strings and characters. 322* String Basics:: Basic properties of strings and characters.
364* Predicates for Strings:: Testing whether an object is a string or char. 323* Predicates for Strings:: Testing whether an object is a string or char.
365* Creating Strings:: Functions to allocate new strings. 324* Creating Strings:: Functions to allocate new strings.
325* Modifying Strings:: Altering the contents of an existing string.
366* Text Comparison:: Comparing characters or strings. 326* Text Comparison:: Comparing characters or strings.
367* String Conversion:: Converting characters or strings and vice versa. 327* String Conversion:: Converting characters to strings and vice versa.
368* Formatting Strings:: @code{format}: Emacs's analog of @code{printf}. 328* Formatting Strings:: @code{format}: Emacs's analogue of @code{printf}.
369* Character Case:: Case conversion functions. 329* Case Conversion:: Case conversion functions.
330* Case Tables:: Customizing case conversion.
370 331
371Lists 332Lists
372 333
373* Cons Cells:: How lists are made out of cons cells. 334* Cons Cells:: How lists are made out of cons cells.
374* Lists as Boxes:: Graphical notation to explain lists.
375* List-related Predicates:: Is this object a list? Comparing two lists. 335* List-related Predicates:: Is this object a list? Comparing two lists.
376* List Elements:: Extracting the pieces of a list. 336* List Elements:: Extracting the pieces of a list.
377* Building Lists:: Creating list structure. 337* Building Lists:: Creating list structure.
338* List Variables:: Modifying lists stored in variables.
378* Modifying Lists:: Storing new pieces into an existing list. 339* Modifying Lists:: Storing new pieces into an existing list.
379* Sets And Lists:: A list can represent a finite mathematical set. 340* Sets And Lists:: A list can represent a finite mathematical set.
380* Association Lists:: A list can represent a finite relation or mapping. 341* Association Lists:: A list can represent a finite relation or mapping.
342* Rings:: Managing a fixed-size ring of objects.
381 343
382Modifying Existing List Structure 344Modifying Existing List Structure
383 345
@@ -391,7 +353,17 @@ Sequences, Arrays, and Vectors
391* Sequence Functions:: Functions that accept any kind of sequence. 353* Sequence Functions:: Functions that accept any kind of sequence.
392* Arrays:: Characteristics of arrays in Emacs Lisp. 354* Arrays:: Characteristics of arrays in Emacs Lisp.
393* Array Functions:: Functions specifically for arrays. 355* Array Functions:: Functions specifically for arrays.
394* Vectors:: Functions specifically for vectors. 356* Vectors:: Special characteristics of Emacs Lisp vectors.
357* Vector Functions:: Functions specifically for vectors.
358* Char-Tables:: How to work with char-tables.
359* Bool-Vectors:: How to work with bool-vectors.
360
361Hash Tables
362
363* Creating Hash:: Functions to create hash tables.
364* Hash Access:: Reading and writing the hash table contents.
365* Defining Hash:: Defining new comparison methods
366* Other Hash:: Miscellaneous.
395 367
396Symbols 368Symbols
397 369
@@ -402,19 +374,28 @@ Symbols
402* Property Lists:: Each symbol has a property list 374* Property Lists:: Each symbol has a property list
403 for recording miscellaneous information. 375 for recording miscellaneous information.
404 376
377Property Lists
378
379* Plists and Alists:: Comparison of the advantages of property
380 lists and association lists.
381* Symbol Plists:: Functions to access symbols' property lists.
382* Other Plists:: Accessing property lists stored elsewhere.
383
405Evaluation 384Evaluation
406 385
407* Intro Eval:: Evaluation in the scheme of things. 386* Intro Eval:: Evaluation in the scheme of things.
408* Eval:: How to invoke the Lisp interpreter explicitly.
409* Forms:: How various sorts of objects are evaluated. 387* Forms:: How various sorts of objects are evaluated.
410* Quoting:: Avoiding evaluation (to put constants in 388* Quoting:: Avoiding evaluation (to put constants in
411 the program). 389 the program).
390* Eval:: How to invoke the Lisp interpreter explicitly.
412 391
413Kinds of Forms 392Kinds of Forms
414 393
415* Self-Evaluating Forms:: Forms that evaluate to themselves. 394* Self-Evaluating Forms:: Forms that evaluate to themselves.
416* Symbol Forms:: Symbols evaluate as variables. 395* Symbol Forms:: Symbols evaluate as variables.
417* Classifying Lists:: How to distinguish various sorts of list forms. 396* Classifying Lists:: How to distinguish various sorts of list forms.
397* Function Indirection:: When a symbol appears as the car of a list,
398 we find the real function via the symbol.
418* Function Forms:: Forms that call functions. 399* Function Forms:: Forms that call functions.
419* Macro Forms:: Forms that call macros. 400* Macro Forms:: Forms that call macros.
420* Special Forms:: "Special forms" are idiosyncratic primitives, 401* Special Forms:: "Special forms" are idiosyncratic primitives,
@@ -425,7 +406,7 @@ Kinds of Forms
425Control Structures 406Control Structures
426 407
427* Sequencing:: Evaluation in textual order. 408* Sequencing:: Evaluation in textual order.
428* Conditionals:: @code{if}, @code{cond}. 409* Conditionals:: @code{if}, @code{cond}, @code{when}, @code{unless}.
429* Combining Conditions:: @code{and}, @code{or}, @code{not}. 410* Combining Conditions:: @code{and}, @code{or}, @code{not}.
430* Iteration:: @code{while} loops. 411* Iteration:: @code{while} loops.
431* Nonlocal Exits:: Jumping out of a sequence. 412* Nonlocal Exits:: Jumping out of a sequence.
@@ -444,6 +425,7 @@ Errors
444* Processing of Errors:: What Emacs does when you report an error. 425* Processing of Errors:: What Emacs does when you report an error.
445* Handling Errors:: How you can trap errors and continue execution. 426* Handling Errors:: How you can trap errors and continue execution.
446* Error Symbols:: How errors are classified for trapping them. 427* Error Symbols:: How errors are classified for trapping them.
428* Standard Errors:: List of all error symbols.
447 429
448Variables 430Variables
449 431
@@ -452,11 +434,21 @@ Variables
452* Local Variables:: Variable values that exist only temporarily. 434* Local Variables:: Variable values that exist only temporarily.
453* Void Variables:: Symbols that lack values. 435* Void Variables:: Symbols that lack values.
454* Defining Variables:: A definition says a symbol is used as a variable. 436* Defining Variables:: A definition says a symbol is used as a variable.
437* Tips for Defining:: Things you should think about when you
438 define a variable.
455* Accessing Variables:: Examining values of variables whose names 439* Accessing Variables:: Examining values of variables whose names
456 are known only at run time. 440 are known only at run time.
457* Setting Variables:: Storing new values in variables. 441* Setting Variables:: Storing new values in variables.
458* Variable Scoping:: How Lisp chooses among local and global values. 442* Variable Scoping:: How Lisp chooses among local and global values.
459* Buffer-Local Variables:: Variable values in effect only in one buffer. 443* Buffer-Local Variables:: Variable values in effect only in one buffer.
444* Frame-Local Variables:: Variable values in effect only in one frame.
445* Future Local Variables:: New kinds of local values we might add some day.
446* File Local Variables:: Handling local variable lists in files.
447* Variable Aliases:: Variables that are aliases for other variables.
448* Variables with Restricted Values:: Non-constant variables whose value can
449 @emph{not} be an arbitrary Lisp object.
450* Standard Buffer-Local Variables::
451 List of variables buffer-local in all buffers.
460 452
461Scoping Rules for Variable Bindings 453Scoping Rules for Variable Bindings
462 454
@@ -472,7 +464,7 @@ Buffer-Local Variables
472* Intro to Buffer-Local:: Introduction and concepts. 464* Intro to Buffer-Local:: Introduction and concepts.
473* Creating Buffer-Local:: Creating and destroying buffer-local bindings. 465* Creating Buffer-Local:: Creating and destroying buffer-local bindings.
474* Default Value:: The default value is seen in buffers 466* Default Value:: The default value is seen in buffers
475 that don't have their own local values. 467 that don't have their own buffer-local values.
476 468
477Functions 469Functions
478 470
@@ -485,6 +477,9 @@ Functions
485* Anonymous Functions:: Lambda-expressions are functions with no names. 477* Anonymous Functions:: Lambda-expressions are functions with no names.
486* Function Cells:: Accessing or setting the function definition 478* Function Cells:: Accessing or setting the function definition
487 of a symbol. 479 of a symbol.
480* Obsolete Functions:: Declaring functions obsolete.
481* Inline Functions:: Defining functions that the compiler will open code.
482* Function Safety:: Determining whether a function is safe to call.
488* Related Topics:: Cross-references to specific Lisp primitives 483* Related Topics:: Cross-references to specific Lisp primitives
489 that have a special bearing on how 484 that have a special bearing on how
490 functions work. 485 functions work.
@@ -505,30 +500,86 @@ Macros
505* Backquote:: Easier construction of list structure. 500* Backquote:: Easier construction of list structure.
506* Problems with Macros:: Don't evaluate the macro arguments too many times. 501* Problems with Macros:: Don't evaluate the macro arguments too many times.
507 Don't hide the user's variables. 502 Don't hide the user's variables.
503* Indenting Macros:: Specifying how to indent macro calls.
504
505Common Problems Using Macros
506
507* Wrong Time:: Do the work in the expansion, not in the macro.
508* Argument Evaluation:: The expansion should evaluate each macro arg once.
509* Surprising Local Vars:: Local variable bindings in the expansion
510 require special care.
511* Eval During Expansion:: Don't evaluate them; put them in the expansion.
512* Repeated Expansion:: Avoid depending on how many times expansion is done.
513
514Writing Customization Definitions
515
516* Common Keywords:: Common keyword arguments for all kinds of
517 customization declarations.
518* Group Definitions:: Writing customization group definitions.
519* Variable Definitions:: Declaring user options.
520* Customization Types:: Specifying the type of a user option.
521
522Customization Types
523
524* Simple Types:: Simple customization types: sexp, integer, number,
525 string, file, directory, alist.
526* Composite Types:: Build new types from other types or data.
527* Splicing into Lists:: Splice elements into list with @code{:inline}.
528* Type Keywords:: Keyword-argument pairs in a customization type.
529* Defining New Types:: Give your type a name.
508 530
509Loading 531Loading
510 532
511* How Programs Do Loading:: The @code{load} function and others. 533* How Programs Do Loading:: The @code{load} function and others.
534* Load Suffixes:: Details about the suffixes that @code{load} tries.
535* Library Search:: Finding a library to load.
536* Loading Non-ASCII:: Non-@acronym{ASCII} characters in Emacs Lisp files.
512* Autoload:: Setting up a function to autoload. 537* Autoload:: Setting up a function to autoload.
513* Named Features:: Loading a library if it isn't already loaded.
514* Repeated Loading:: Precautions about loading a file twice. 538* Repeated Loading:: Precautions about loading a file twice.
539* Named Features:: Loading a library if it isn't already loaded.
540* Where Defined:: Finding which file defined a certain symbol.
541* Unloading:: How to "unload" a library that was loaded.
542* Hooks for Loading:: Providing code to be run when
543 particular libraries are loaded.
515 544
516Byte Compilation 545Byte Compilation
517 546
547* Speed of Byte-Code:: An example of speedup from byte compilation.
518* Compilation Functions:: Byte compilation functions. 548* Compilation Functions:: Byte compilation functions.
549* Docs and Compilation:: Dynamic loading of documentation strings.
550* Dynamic Loading:: Dynamic loading of individual functions.
551* Eval During Compile:: Code to be evaluated when you compile.
552* Compiler Errors:: Handling compiler error messages.
553* Byte-Code Objects:: The data type used for byte-compiled functions.
519* Disassembly:: Disassembling byte-code; how to read byte-code. 554* Disassembly:: Disassembling byte-code; how to read byte-code.
520 555
556Advising Emacs Lisp Functions
557
558* Simple Advice:: A simple example to explain the basics of advice.
559* Defining Advice:: Detailed description of @code{defadvice}.
560* Around-Advice:: Wrapping advice around a function's definition.
561* Computed Advice:: ...is to @code{defadvice} as @code{fset} is to @code{defun}.
562* Activation of Advice:: Advice doesn't do anything until you activate it.
563* Enabling Advice:: You can enable or disable each piece of advice.
564* Preactivation:: Preactivation is a way of speeding up the
565 loading of compiled advice.
566* Argument Access in Advice:: How advice can access the function's arguments.
567* Advising Primitives:: Accessing arguments when advising a primitive.
568* Combined Definition:: How advice is implemented.
569
521Debugging Lisp Programs 570Debugging Lisp Programs
522 571
523* Debugger:: How the Emacs Lisp debugger is implemented. 572* Debugger:: How the Emacs Lisp debugger is implemented.
573* Edebug:: A source-level Emacs Lisp debugger.
524* Syntax Errors:: How to find syntax errors. 574* Syntax Errors:: How to find syntax errors.
575* Test Coverage:: Ensuring you have tested all branches in your code.
525* Compilation Errors:: How to find errors that show up in 576* Compilation Errors:: How to find errors that show up in
526 byte compilation. 577 byte compilation.
527* Edebug:: A source-level Emacs Lisp debugger.
528 578
529The Lisp Debugger 579The Lisp Debugger
530 580
531* Error Debugging:: Entering the debugger when an error happens. 581* Error Debugging:: Entering the debugger when an error happens.
582* Infinite Loops:: Stopping and debugging a program that doesn't exit.
532* Function Debugging:: Entering it when a certain function is called. 583* Function Debugging:: Entering it when a certain function is called.
533* Explicit Debug:: Entering it at a certain point in the program. 584* Explicit Debug:: Entering it at a certain point in the program.
534* Using Debugger:: What the debugger does; what you see while in it. 585* Using Debugger:: What the debugger does; what you see while in it.
@@ -536,6 +587,27 @@ The Lisp Debugger
536* Invoking the Debugger:: How to call the function @code{debug}. 587* Invoking the Debugger:: How to call the function @code{debug}.
537* Internals of Debugger:: Subroutines of the debugger, and global variables. 588* Internals of Debugger:: Subroutines of the debugger, and global variables.
538 589
590Edebug
591
592* Using Edebug:: Introduction to use of Edebug.
593* Instrumenting:: You must instrument your code
594 in order to debug it with Edebug.
595* Edebug Execution Modes:: Execution modes, stopping more or less often.
596* Jumping:: Commands to jump to a specified place.
597* Edebug Misc:: Miscellaneous commands.
598* Breaks:: Setting breakpoints to make the program stop.
599* Trapping Errors:: Trapping errors with Edebug.
600* Edebug Views:: Views inside and outside of Edebug.
601* Edebug Eval:: Evaluating expressions within Edebug.
602* Eval List:: Expressions whose values are displayed
603 each time you enter Edebug.
604* Printing in Edebug:: Customization of printing.
605* Trace Buffer:: How to produce trace output in a buffer.
606* Coverage Testing:: How to test evaluation coverage.
607* The Outside Context:: Data that Edebug saves and restores.
608* Edebug and Macros:: Specifying how to handle macro calls.
609* Edebug Options:: Option variables for customizing Edebug.
610
539Debugging Invalid Lisp Syntax 611Debugging Invalid Lisp Syntax
540 612
541* Excess Open:: How to find a spurious open paren or missing close. 613* Excess Open:: How to find a spurious open paren or missing close.
@@ -550,14 +622,25 @@ Reading and Printing Lisp Objects
550* Output Streams:: Various data types that can be used as 622* Output Streams:: Various data types that can be used as
551 output streams. 623 output streams.
552* Output Functions:: Functions to print Lisp objects as text. 624* Output Functions:: Functions to print Lisp objects as text.
625* Output Variables:: Variables that control what the printing
626 functions do.
553 627
554Minibuffers 628Minibuffers
555 629
556* Intro to Minibuffers:: Basic information about minibuffers. 630* Intro to Minibuffers:: Basic information about minibuffers.
557* Text from Minibuffer:: How to read a straight text string. 631* Text from Minibuffer:: How to read a straight text string.
558* Object from Minibuffer:: How to read a Lisp object or expression. 632* Object from Minibuffer:: How to read a Lisp object or expression.
633* Minibuffer History:: Recording previous minibuffer inputs
634 so the user can reuse them.
635* Initial Input:: Specifying initial contents for the minibuffer.
559* Completion:: How to invoke and customize completion. 636* Completion:: How to invoke and customize completion.
560* Yes-or-No Queries:: Asking a question with a simple answer. 637* Yes-or-No Queries:: Asking a question with a simple answer.
638* Multiple Queries:: Asking a series of similar questions.
639* Reading a Password:: Reading a password from the terminal.
640* Minibuffer Commands:: Commands used as key bindings in minibuffers.
641* Minibuffer Contents:: How such commands access the minibuffer text.
642* Minibuffer Windows:: Operating on the special minibuffer windows.
643* Recursive Mini:: Whether recursive entry to minibuffer is allowed.
561* Minibuffer Misc:: Various customization hooks and variables. 644* Minibuffer Misc:: Various customization hooks and variables.
562 645
563Completion 646Completion
@@ -577,8 +660,10 @@ Command Loop
577* Defining Commands:: Specifying how a function should read arguments. 660* Defining Commands:: Specifying how a function should read arguments.
578* Interactive Call:: Calling a command, so that it will read arguments. 661* Interactive Call:: Calling a command, so that it will read arguments.
579* Command Loop Info:: Variables set by the command loop for you to examine. 662* Command Loop Info:: Variables set by the command loop for you to examine.
663* Adjusting Point:: Adjustment of point after a command.
580* Input Events:: What input looks like when you read it. 664* Input Events:: What input looks like when you read it.
581* Reading Input:: How to read input events from the keyboard or mouse. 665* Reading Input:: How to read input events from the keyboard or mouse.
666* Special Events:: Events processed immediately and individually.
582* Waiting:: Waiting for user input or elapsed time. 667* Waiting:: Waiting for user input or elapsed time.
583* Quitting:: How @kbd{C-g} works. How to catch or defer quitting. 668* Quitting:: How @kbd{C-g} works. How to catch or defer quitting.
584* Prefix Command Arguments:: How the commands to set prefix args work. 669* Prefix Command Arguments:: How the commands to set prefix args work.
@@ -595,50 +680,155 @@ Defining Commands
595 in various ways. 680 in various ways.
596* Interactive Examples:: Examples of how to read interactive arguments. 681* Interactive Examples:: Examples of how to read interactive arguments.
597 682
683Input Events
684
685* Keyboard Events:: Ordinary characters--keys with symbols on them.
686* Function Keys:: Function keys--keys with names, not symbols.
687* Mouse Events:: Overview of mouse events.
688* Click Events:: Pushing and releasing a mouse button.
689* Drag Events:: Moving the mouse before releasing the button.
690* Button-Down Events:: A button was pushed and not yet released.
691* Repeat Events:: Double and triple click (or drag, or down).
692* Motion Events:: Just moving the mouse, not pushing a button.
693* Focus Events:: Moving the mouse between frames.
694* Misc Events:: Other events the system can generate.
695* Event Examples:: Examples of the lists for mouse events.
696* Classifying Events:: Finding the modifier keys in an event symbol.
697* Accessing Events:: Functions to extract info from events.
698* Strings of Events:: Special considerations for putting
699 keyboard character events in a string.
700
701Reading Input
702
703* Key Sequence Input:: How to read one key sequence.
704* Reading One Event:: How to read just one event.
705* Event Mod:: How Emacs modifies events as they are read.
706* Invoking the Input Method:: How reading an event uses the input method.
707* Quoted Character Input:: Asking the user to specify a character.
708* Event Input Misc:: How to reread or throw away input events.
709
598Keymaps 710Keymaps
599 711
600* Keymap Terminology:: Definitions of terms pertaining to keymaps. 712* Key Sequences:: Key sequences as Lisp objects.
601* Format of Keymaps:: What a keymap looks like as a Lisp object. 713* Keymap Basics:: Basic concepts of keymaps.
602* Creating Keymaps:: Functions to create and copy keymaps. 714* Format of Keymaps:: What a keymap looks like as a Lisp object.
603* Inheritance and Keymaps:: How one keymap can inherit the bindings 715* Creating Keymaps:: Functions to create and copy keymaps.
604 of another keymap. 716* Inheritance and Keymaps:: How one keymap can inherit the bindings
605* Prefix Keys:: Defining a key with a keymap as its definition. 717 of another keymap.
606* Menu Keymaps:: A keymap can define a menu for X 718* Prefix Keys:: Defining a key with a keymap as its definition.
607 or for use from the terminal. 719* Active Keymaps:: How Emacs searches the active keymaps
608* Active Keymaps:: Each buffer has a local keymap 720 for a key binding.
609 to override the standard (global) bindings. 721* Searching Keymaps:: A pseudo-Lisp summary of searching active maps.
610 Each minor mode can also override them. 722* Controlling Active Maps:: Each buffer has a local keymap
611* Key Lookup:: How extracting elements from keymaps works. 723 to override the standard (global) bindings.
724 A minor mode can also override them.
725* Key Lookup:: How extracting elements from keymaps works.
612* Functions for Key Lookup:: How to request key lookup. 726* Functions for Key Lookup:: How to request key lookup.
613* Changing Key Bindings:: Redefining a key in a keymap. 727* Changing Key Bindings:: Redefining a key in a keymap.
614* Key Binding Commands:: Interactive interfaces for redefining keys. 728* Remapping Commands:: A keymap can translate one command to another.
615* Scanning Keymaps:: Looking through all keymaps, for printing help. 729* Translation Keymaps:: Keymaps for translating sequences of events.
730* Key Binding Commands:: Interactive interfaces for redefining keys.
731* Scanning Keymaps:: Looking through all keymaps, for printing help.
732* Menu Keymaps:: A keymap can define a menu for X
733 or for use from the terminal.
734* Standard Keymaps:: List of standard keymaps.
616 735
617Major and Minor Modes 736Major and Minor Modes
618 737
738* Hooks:: How to use hooks; how to write code that
739 provides hooks.
619* Major Modes:: Defining major modes. 740* Major Modes:: Defining major modes.
620* Minor Modes:: Defining minor modes. 741* Minor Modes:: Defining minor modes.
621* Mode Line Format:: Customizing the text that appears in the mode line. 742* Mode Line Format:: Customizing the text that appears in the mode line.
622* Hooks:: How to use hooks; how to write code that 743* Imenu:: How a mode can provide a menu
623 provides hooks. 744 of definitions in the buffer.
745* Font Lock Mode:: How modes can highlight text according to syntax.
746* Desktop Save Mode:: How modes can have buffer state saved between
747 Emacs sessions.
748
749Menu Keymaps
750
751* Defining Menus:: How to make a keymap that defines a menu.
752* Mouse Menus:: How users actuate the menu with the mouse.
753* Keyboard Menus:: How users actuate the menu with the keyboard.
754* Menu Example:: Making a simple menu.
755* Menu Bar:: How to customize the menu bar.
756* Tool Bar:: A tool bar is a row of images.
757* Modifying Menus:: How to add new items to a menu.
758
759Defining Menus
760
761* Simple Menu Items:: A simple kind of menu key binding,
762 limited in capabilities.
763* Extended Menu Items:: More powerful menu item definitions
764 let you specify keywords to enable
765 various features.
766* Menu Separators:: Drawing a horizontal line through a menu.
767* Alias Menu Items:: Using command aliases in menu items.
768
769Major and Minor Modes
770
771* Hooks:: How to use hooks; how to write code that provides hooks.
772* Major Modes:: Defining major modes.
773* Minor Modes:: Defining minor modes.
774* Mode Line Format:: Customizing the text that appears in the mode line.
775* Imenu:: How a mode can provide a menu
776 of definitions in the buffer.
777* Font Lock Mode:: How modes can highlight text according to syntax.
778* Desktop Save Mode:: How modes can have buffer state saved between
779 Emacs sessions.
624 780
625Major Modes 781Major Modes
626 782
783* Major Mode Basics::
627* Major Mode Conventions:: Coding conventions for keymaps, etc. 784* Major Mode Conventions:: Coding conventions for keymaps, etc.
628* Example Major Modes:: Text mode and Lisp modes. 785* Example Major Modes:: Text mode and Lisp modes.
629* Auto Major Mode:: How Emacs chooses the major mode automatically. 786* Auto Major Mode:: How Emacs chooses the major mode automatically.
630* Mode Help:: Finding out how to use a mode. 787* Mode Help:: Finding out how to use a mode.
788* Derived Modes:: Defining a new major mode based on another major
789 mode.
790* Generic Modes:: Defining a simple major mode that supports
791 comment syntax and Font Lock mode.
792* Mode Hooks:: Hooks run at the end of major mode functions.
631 793
632Minor Modes 794Minor Modes
633 795
634* Minor Mode Conventions:: Tips for writing a minor mode. 796* Minor Mode Conventions:: Tips for writing a minor mode.
635* Keymaps and Minor Modes:: How a minor mode can have its own keymap. 797* Keymaps and Minor Modes:: How a minor mode can have its own keymap.
798* Defining Minor Modes:: A convenient facility for defining minor modes.
636 799
637Mode Line Format 800Mode Line Format
638 801
802* Mode Line Basics::
639* Mode Line Data:: The data structure that controls the mode line. 803* Mode Line Data:: The data structure that controls the mode line.
640* Mode Line Variables:: Variables used in that data structure. 804* Mode Line Variables:: Variables used in that data structure.
641* %-Constructs:: Putting information into a mode line. 805* %-Constructs:: Putting information into a mode line.
806* Properties in Mode:: Using text properties in the mode line.
807* Header Lines:: Like a mode line, but at the top.
808* Emulating Mode Line:: Formatting text as the mode line would.
809
810Font Lock Mode
811
812* Font Lock Basics:: Overview of customizing Font Lock.
813* Search-based Fontification:: Fontification based on regexps.
814* Customizing Keywords:: Customizing search-based fontification.
815* Other Font Lock Variables:: Additional customization facilities.
816* Levels of Font Lock:: Each mode can define alternative levels
817 so that the user can select more or less.
818* Precalculated Fontification:: How Lisp programs that produce the buffer
819 contents can also specify how to fontify it.
820* Faces for Font Lock:: Special faces specifically for Font Lock.
821* Syntactic Font Lock:: Fontification based on syntax tables.
822* Setting Syntax Properties:: Defining character syntax based on context
823 using the Font Lock mechanism.
824* Multiline Font Lock:: How to coerce Font Lock into properly
825 highlighting multiline constructs.
826
827Multiline Font Lock Constructs
828
829* Font Lock Multiline:: Marking multiline chunks with a text property
830* Region to Fontify:: Controlling which region gets refontified
831 after a buffer change.
642 832
643Documentation 833Documentation
644 834
@@ -657,11 +847,15 @@ Files
657* Reading from Files:: Reading files into other buffers. 847* Reading from Files:: Reading files into other buffers.
658* Writing to Files:: Writing new files from parts of buffers. 848* Writing to Files:: Writing new files from parts of buffers.
659* File Locks:: Locking and unlocking files, to prevent 849* File Locks:: Locking and unlocking files, to prevent
660 simultaneous editing by two people. 850 simultaneous editing by two people.
661* Information about Files:: Testing existence, accessibility, size of files. 851* Information about Files:: Testing existence, accessibility, size of files.
662* Contents of Directories:: Getting a list of the files in a directory. 852* Changing Files:: Renaming files, changing protection, etc.
663* Changing File Attributes:: Renaming files, changing protection, etc. 853* File Names:: Decomposing and expanding file names.
664* File Names:: Decomposing and expanding file names. 854* Contents of Directories:: Getting a list of the files in a directory.
855* Create/Delete Dirs:: Creating and Deleting Directories.
856* Magic File Names:: Defining "magic" special handling
857 for certain file names.
858* Format Conversion:: Conversion to and from various file formats.
665 859
666Visiting Files 860Visiting Files
667 861
@@ -671,19 +865,23 @@ Visiting Files
671Information about Files 865Information about Files
672 866
673* Testing Accessibility:: Is a given file readable? Writable? 867* Testing Accessibility:: Is a given file readable? Writable?
674* Kinds of Files:: Is it a directory? A link? 868* Kinds of Files:: Is it a directory? A symbolic link?
869* Truenames:: Eliminating symbolic links from a file name.
675* File Attributes:: How large is it? Any other names? Etc. 870* File Attributes:: How large is it? Any other names? Etc.
871* Locating Files:: How to find a file in standard places.
676 872
677File Names 873File Names
678 874
679* File Name Components:: The directory part of a file name, and the rest. 875* File Name Components:: The directory part of a file name, and the rest.
680* Directory Names:: A directory's name as a directory
681 is different from its name as a file.
682* Relative File Names:: Some file names are relative to a 876* Relative File Names:: Some file names are relative to a
683 current directory. 877 current directory.
878* Directory Names:: A directory's name as a directory
879 is different from its name as a file.
684* File Name Expansion:: Converting relative file names to absolute ones. 880* File Name Expansion:: Converting relative file names to absolute ones.
685* Unique File Names:: Generating names for temporary files. 881* Unique File Names:: Generating names for temporary files.
686* File Name Completion:: Finding the completions for a given file name. 882* File Name Completion:: Finding the completions for a given file name.
883* Standard File Names:: If your package uses a fixed file name,
884 how to handle various operating systems simply.
687 885
688Backups and Auto-Saving 886Backups and Auto-Saving
689 887
@@ -705,19 +903,22 @@ Backup Files
705Buffers 903Buffers
706 904
707* Buffer Basics:: What is a buffer? 905* Buffer Basics:: What is a buffer?
906* Current Buffer:: Designating a buffer as current
907 so primitives will access its contents.
708* Buffer Names:: Accessing and changing buffer names. 908* Buffer Names:: Accessing and changing buffer names.
709* Buffer File Name:: The buffer file name indicates which file 909* Buffer File Name:: The buffer file name indicates which file
710 is visited. 910 is visited.
711* Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved. 911* Buffer Modification:: A buffer is @dfn{modified} if it needs to be saved.
712* Modification Time:: Determining whether the visited file was changed 912* Modification Time:: Determining whether the visited file was changed
713 "behind Emacs's back". 913 ``behind Emacs's back''.
714* Read Only Buffers:: Modifying text is not allowed in a 914* Read Only Buffers:: Modifying text is not allowed in a
715 read-only buffer. 915 read-only buffer.
716* The Buffer List:: How to look at all the existing buffers. 916* The Buffer List:: How to look at all the existing buffers.
717* Creating Buffers:: Functions that create buffers. 917* Creating Buffers:: Functions that create buffers.
718* Killing Buffers:: Buffers exist until explicitly killed. 918* Killing Buffers:: Buffers exist until explicitly killed.
719* Current Buffer:: Designating a buffer as current 919* Indirect Buffers:: An indirect buffer shares text with some
720 so primitives will access its contents. 920 other buffer.
921* Buffer Gap:: The gap in the buffer.
721 922
722Windows 923Windows
723 924
@@ -727,21 +928,28 @@ Windows
727* Selecting Windows:: The selected window is the one that you edit in. 928* Selecting Windows:: The selected window is the one that you edit in.
728* Cyclic Window Ordering:: Moving around the existing windows. 929* Cyclic Window Ordering:: Moving around the existing windows.
729* Buffers and Windows:: Each window displays the contents of a buffer. 930* Buffers and Windows:: Each window displays the contents of a buffer.
730* Displaying Buffers:: Higher-lever functions for displaying a buffer 931* Displaying Buffers:: Higher-level functions for displaying a buffer
731 and choosing a window for it. 932 and choosing a window for it.
933* Choosing Window:: How to choose a window for displaying a buffer.
732* Window Point:: Each window has its own location of point. 934* Window Point:: Each window has its own location of point.
733* Window Start:: The display-start position controls which text 935* Window Start:: The display-start position controls which text
734 is on-screen in the window. 936 is on-screen in the window.
735* Vertical Scrolling:: Moving text up and down in the window. 937* Textual Scrolling:: Moving text up and down through the window.
736* Horizontal Scrolling:: Moving text sideways on the window. 938* Vertical Scrolling:: Moving the contents up and down on the window.
939* Horizontal Scrolling:: Moving the contents sideways on the window.
737* Size of Window:: Accessing the size of a window. 940* Size of Window:: Accessing the size of a window.
738* Resizing Windows:: Changing the size of a window. 941* Resizing Windows:: Changing the size of a window.
942* Coordinates and Windows:: Converting coordinates to windows.
943* Window Tree:: The layout and sizes of all windows in a frame.
739* Window Configurations:: Saving and restoring the state of the screen. 944* Window Configurations:: Saving and restoring the state of the screen.
945* Window Hooks:: Hooks for scrolling, window size changes,
946 redisplay going past a certain point,
947 or window configuration changes.
740 948
741Frames 949Frames
742 950
743* Creating Frames:: Creating additional frames. 951* Creating Frames:: Creating additional frames.
744* Multiple Displays:: Creating frames on other X displays. 952* Multiple Displays:: Creating frames on other displays.
745* Frame Parameters:: Controlling frame size, position, font, etc. 953* Frame Parameters:: Controlling frame size, position, font, etc.
746* Frame Titles:: Automatic updating of frame titles. 954* Frame Titles:: Automatic updating of frame titles.
747* Deleting Frames:: Frames last until explicitly deleted. 955* Deleting Frames:: Frames last until explicitly deleted.
@@ -751,18 +959,40 @@ Frames
751* Minibuffers and Frames:: How a frame finds the minibuffer to use. 959* Minibuffers and Frames:: How a frame finds the minibuffer to use.
752* Input Focus:: Specifying the selected frame. 960* Input Focus:: Specifying the selected frame.
753* Visibility of Frames:: Frames may be visible or invisible, or icons. 961* Visibility of Frames:: Frames may be visible or invisible, or icons.
754* Raising and Lowering:: Raising a frame makes it hide other X windows; 962* Raising and Lowering:: Raising a frame makes it hide other windows;
755 lowering it makes the others hide them. 963 lowering it puts it underneath the others.
756* Frame Configurations:: Saving the state of all frames. 964* Frame Configurations:: Saving the state of all frames.
757* Mouse Tracking:: Getting events that say when the mouse moves. 965* Mouse Tracking:: Getting events that say when the mouse moves.
758* Mouse Position:: Asking where the mouse is, or moving it. 966* Mouse Position:: Asking where the mouse is, or moving it.
759* Pop-Up Menus:: Displaying a menu for the user to select from. 967* Pop-Up Menus:: Displaying a menu for the user to select from.
760* Dialog Boxes:: Displaying a box to ask yes or no. 968* Dialog Boxes:: Displaying a box to ask yes or no.
761* Pointer Shapes:: Specifying the shape of the mouse pointer. 969* Pointer Shape:: Specifying the shape of the mouse pointer.
762* X Selections:: Transferring text to and from other X clients. 970* Window System Selections::Transferring text to and from other windows.
971* Drag and Drop:: Internals of Drag-and-Drop implementation.
763* Color Names:: Getting the definitions of color names. 972* Color Names:: Getting the definitions of color names.
973* Text Terminal Colors:: Defining colors for text-only terminals.
764* Resources:: Getting resource values from the server. 974* Resources:: Getting resource values from the server.
765* Server Data:: Getting info about the X server. 975* Display Feature Testing:: Determining the features of a terminal.
976
977Frame Parameters
978
979* Parameter Access:: How to change a frame's parameters.
980* Initial Parameters:: Specifying frame parameters when you make a frame.
981* Window Frame Parameters:: List of frame parameters for window systems.
982* Size and Position:: Changing the size and position of a frame.
983* Geometry:: Parsing geometry specifications.
984
985Window Frame Parameters
986
987* Basic Parameters:: Parameters that are fundamental.
988* Position Parameters:: The position of the frame on the screen.
989* Size Parameters:: Frame's size.
990* Layout Parameters:: Size of parts of the frame, and
991 enabling or disabling some parts.
992* Buffer Parameters:: Which buffers have been or should be shown.
993* Management Parameters:: Communicating with the window manager.
994* Cursor Parameters:: Controlling the cursor appearance.
995* Color Parameters:: Colors of various parts of the frame.
766 996
767Positions 997Positions
768 998
@@ -786,9 +1016,11 @@ Markers
786* Overview of Markers:: The components of a marker, and how it relocates. 1016* Overview of Markers:: The components of a marker, and how it relocates.
787* Predicates on Markers:: Testing whether an object is a marker. 1017* Predicates on Markers:: Testing whether an object is a marker.
788* Creating Markers:: Making empty markers or markers at certain places. 1018* Creating Markers:: Making empty markers or markers at certain places.
789* Information from Markers:: Finding the marker's buffer or character 1019* Information from Markers::Finding the marker's buffer or character
790 position. 1020 position.
791* Changing Markers:: Moving the marker to a new buffer or position. 1021* Marker Insertion Types:: Two ways a marker can relocate when you
1022 insert where it points.
1023* Moving Markers:: Moving the marker to a new buffer or position.
792* The Mark:: How "the mark" is implemented with a marker. 1024* The Mark:: How "the mark" is implemented with a marker.
793* The Region:: How to access "the region". 1025* The Region:: How to access "the region".
794 1026
@@ -796,6 +1028,7 @@ Text
796 1028
797* Near Point:: Examining text in the vicinity of point. 1029* Near Point:: Examining text in the vicinity of point.
798* Buffer Contents:: Examining text in a general fashion. 1030* Buffer Contents:: Examining text in a general fashion.
1031* Comparing Text:: Comparing substrings of buffers.
799* Insertion:: Adding new text to a buffer. 1032* Insertion:: Adding new text to a buffer.
800* Commands for Insertion:: User-level commands to insert text. 1033* Commands for Insertion:: User-level commands to insert text.
801* Deletion:: Removing text from a buffer. 1034* Deletion:: Removing text from a buffer.
@@ -803,21 +1036,32 @@ Text
803* The Kill Ring:: Where removed text sometimes is saved for 1036* The Kill Ring:: Where removed text sometimes is saved for
804 later use. 1037 later use.
805* Undo:: Undoing changes to the text of a buffer. 1038* Undo:: Undoing changes to the text of a buffer.
806* Auto Filling:: How auto-fill mode is implemented to break lines. 1039* Maintaining Undo:: How to enable and disable undo information.
1040 How to control how much information is kept.
807* Filling:: Functions for explicit filling. 1041* Filling:: Functions for explicit filling.
808* Margins:: How to specify margins for filling commands. 1042* Margins:: How to specify margins for filling commands.
1043* Adaptive Fill:: Adaptive Fill mode chooses a fill prefix
1044 from context.
1045* Auto Filling:: How auto-fill mode is implemented to break lines.
809* Sorting:: Functions for sorting parts of the buffer. 1046* Sorting:: Functions for sorting parts of the buffer.
810* Indentation:: Functions to insert or adjust indentation.
811* Columns:: Computing horizontal positions, and using them. 1047* Columns:: Computing horizontal positions, and using them.
1048* Indentation:: Functions to insert or adjust indentation.
812* Case Changes:: Case conversion of parts of the buffer. 1049* Case Changes:: Case conversion of parts of the buffer.
1050* Text Properties:: Assigning Lisp property lists to text characters.
813* Substitution:: Replacing a given character wherever it appears. 1051* Substitution:: Replacing a given character wherever it appears.
1052* Transposition:: Swapping two portions of a buffer.
814* Registers:: How registers are implemented. Accessing 1053* Registers:: How registers are implemented. Accessing
815 the text or position stored in a register. 1054 the text or position stored in a register.
1055* Base 64:: Conversion to or from base 64 encoding.
1056* MD5 Checksum:: Compute the MD5 "message digest"/"checksum".
1057* Atomic Changes:: Installing several buffer changes "atomically".
1058* Change Hooks:: Supplying functions to be run when text is changed.
816 1059
817The Kill Ring 1060The Kill Ring
818 1061
819* Kill Ring Concepts:: What text looks like in the kill ring. 1062* Kill Ring Concepts:: What text looks like in the kill ring.
820* Kill Functions:: Functions that kill text. 1063* Kill Functions:: Functions that kill text.
1064* Yanking:: How yanking is done.
821* Yank Commands:: Commands that access the kill ring. 1065* Yank Commands:: Commands that access the kill ring.
822* Low-Level Kill Ring:: Functions and variables for kill ring access. 1066* Low-Level Kill Ring:: Functions and variables for kill ring access.
823* Internals of Kill Ring:: Variables that hold kill-ring data. 1067* Internals of Kill Ring:: Variables that hold kill-ring data.
@@ -831,48 +1075,130 @@ Indentation
831* Indent Tabs:: Adjustable, typewriter-like tab stops. 1075* Indent Tabs:: Adjustable, typewriter-like tab stops.
832* Motion by Indent:: Move to first non-blank character. 1076* Motion by Indent:: Move to first non-blank character.
833 1077
1078Text Properties
1079
1080* Examining Properties:: Looking at the properties of one character.
1081* Changing Properties:: Setting the properties of a range of text.
1082* Property Search:: Searching for where a property changes value.
1083* Special Properties:: Particular properties with special meanings.
1084* Format Properties:: Properties for representing formatting of text.
1085* Sticky Properties:: How inserted text gets properties from
1086 neighboring text.
1087* Saving Properties:: Saving text properties in files, and reading
1088 them back.
1089* Lazy Properties:: Computing text properties in a lazy fashion
1090 only when text is examined.
1091* Clickable Text:: Using text properties to make regions of text
1092 do something when you click on them.
1093* Links and Mouse-1:: How to make @key{Mouse-1} follow a link.
1094* Fields:: The @code{field} property defines
1095 fields within the buffer.
1096* Not Intervals:: Why text properties do not use
1097 Lisp-visible text intervals.
1098
1099Non-ASCII Characters
1100
1101* Text Representations:: Unibyte and multibyte representations
1102* Converting Representations:: Converting unibyte to multibyte and vice versa.
1103* Selecting a Representation:: Treating a byte sequence as unibyte or multi.
1104* Character Codes:: How unibyte and multibyte relate to
1105 codes of individual characters.
1106* Character Sets:: The space of possible character codes
1107 is divided into various character sets.
1108* Chars and Bytes:: More information about multibyte encodings.
1109* Splitting Characters:: Converting a character to its byte sequence.
1110* Scanning Charsets:: Which character sets are used in a buffer?
1111* Translation of Characters:: Translation tables are used for conversion.
1112* Coding Systems:: Coding systems are conversions for saving files.
1113* Input Methods:: Input methods allow users to enter various
1114 non-ASCII characters without special keyboards.
1115* Locales:: Interacting with the POSIX locale.
1116
1117Coding Systems
1118
1119* Coding System Basics:: Basic concepts.
1120* Encoding and I/O:: How file I/O functions handle coding systems.
1121* Lisp and Coding Systems:: Functions to operate on coding system names.
1122* User-Chosen Coding Systems:: Asking the user to choose a coding system.
1123* Default Coding Systems:: Controlling the default choices.
1124* Specifying Coding Systems:: Requesting a particular coding system
1125 for a single file operation.
1126* Explicit Encoding:: Encoding or decoding text without doing I/O.
1127* Terminal I/O Encoding:: Use of encoding for terminal I/O.
1128* MS-DOS File Types:: How DOS "text" and "binary" files
1129 relate to coding systems.
1130
834Searching and Matching 1131Searching and Matching
835 1132
836* String Search:: Search for an exact match. 1133* String Search:: Search for an exact match.
1134* Searching and Case:: Case-independent or case-significant searching.
837* Regular Expressions:: Describing classes of strings. 1135* Regular Expressions:: Describing classes of strings.
838* Regexp Search:: Searching for a match for a regexp. 1136* Regexp Search:: Searching for a match for a regexp.
839* Match Data:: Finding out which part of the text matched 1137* POSIX Regexps:: Searching POSIX-style for the longest match.
840 various parts of a regexp, after regexp search. 1138* Match Data:: Finding out which part of the text matched,
841* Saving Match Data:: Saving and restoring this information. 1139 after a string or regexp search.
1140* Search and Replace:: Commands that loop, searching and replacing.
842* Standard Regexps:: Useful regexps for finding sentences, pages,... 1141* Standard Regexps:: Useful regexps for finding sentences, pages,...
843* Searching and Case:: Case-independent or case-significant searching.
844 1142
845Regular Expressions 1143Regular Expressions
846 1144
847* Syntax of Regexps:: Rules for writing regular expressions. 1145* Syntax of Regexps:: Rules for writing regular expressions.
848* Regexp Example:: Illustrates regular expression syntax. 1146* Regexp Example:: Illustrates regular expression syntax.
1147* Regexp Functions:: Functions for operating on regular expressions.
1148
1149Syntax of Regular Expressions
1150
1151* Regexp Special:: Special characters in regular expressions.
1152* Char Classes:: Character classes used in regular expressions.
1153* Regexp Backslash:: Backslash-sequences in regular expressions.
1154
1155The Match Data
1156
1157* Replacing Match:: Replacing a substring that was matched.
1158* Simple Match Data:: Accessing single items of match data,
1159 such as where a particular subexpression started.
1160* Entire Match Data:: Accessing the entire match data at once, as a list.
1161* Saving Match Data:: Saving and restoring the match data.
849 1162
850Syntax Tables 1163Syntax Tables
851 1164
1165* Syntax Basics:: Basic concepts of syntax tables.
852* Syntax Descriptors:: How characters are classified. 1166* Syntax Descriptors:: How characters are classified.
853* Syntax Table Functions:: How to create, examine and alter syntax tables. 1167* Syntax Table Functions:: How to create, examine and alter syntax tables.
1168* Syntax Properties:: Overriding syntax with text properties.
1169* Motion and Syntax:: Moving over characters with certain syntaxes.
854* Parsing Expressions:: Parsing balanced expressions 1170* Parsing Expressions:: Parsing balanced expressions
855 using the syntax table. 1171 using the syntax table.
856* Standard Syntax Tables:: Syntax tables used by various major modes. 1172* Standard Syntax Tables:: Syntax tables used by various major modes.
857* Syntax Table Internals:: How syntax table information is stored. 1173* Syntax Table Internals:: How syntax table information is stored.
1174* Categories:: Another way of classifying character syntax.
858 1175
859Syntax Descriptors 1176Syntax Descriptors
860 1177
861* Syntax Class Table:: Table of syntax classes. 1178* Syntax Class Table:: Table of syntax classes.
862* Syntax Flags:: Additional flags each character can have. 1179* Syntax Flags:: Additional flags each character can have.
863 1180
1181Parsing Expressions
1182
1183* Motion via Parsing:: Motion functions that work by parsing.
1184* Position Parse:: Determining the syntactic state of a position.
1185* Parser State:: How Emacs represents a syntactic state.
1186* Low-Level Parsing:: Parsing across a specified region.
1187* Control Parsing:: Parameters that affect parsing.
1188
864Abbrevs And Abbrev Expansion 1189Abbrevs And Abbrev Expansion
865 1190
866* Abbrev Mode:: Setting up Emacs for abbreviation. 1191* Abbrev Mode:: Setting up Emacs for abbreviation.
867* Tables: Abbrev Tables. Creating and working with abbrev tables. 1192* Abbrev Tables:: Creating and working with abbrev tables.
868* Defining Abbrevs:: Specifying abbreviations and their expansions. 1193* Defining Abbrevs:: Specifying abbreviations and their expansions.
869* Files: Abbrev Files. Saving abbrevs in files. 1194* Abbrev Files:: Saving abbrevs in files.
870* Expansion: Abbrev Expansion. Controlling expansion; expansion subroutines. 1195* Abbrev Expansion:: Controlling expansion; expansion subroutines.
871* Standard Abbrev Tables:: Abbrev tables used by various major modes. 1196* Standard Abbrev Tables:: Abbrev tables used by various major modes.
872 1197
873Processes 1198Processes
874 1199
875* Subprocess Creation:: Functions that start subprocesses. 1200* Subprocess Creation:: Functions that start subprocesses.
1201* Shell Arguments:: Quoting an argument to pass it to a shell.
876* Synchronous Processes:: Details of using synchronous subprocesses. 1202* Synchronous Processes:: Details of using synchronous subprocesses.
877* Asynchronous Processes:: Starting up an asynchronous subprocess. 1203* Asynchronous Processes:: Starting up an asynchronous subprocess.
878* Deleting Processes:: Eliminating an asynchronous subprocess. 1204* Deleting Processes:: Eliminating an asynchronous subprocess.
@@ -882,68 +1208,219 @@ Processes
882 an asynchronous subprocess. 1208 an asynchronous subprocess.
883* Output from Processes:: Collecting output from an asynchronous subprocess. 1209* Output from Processes:: Collecting output from an asynchronous subprocess.
884* Sentinels:: Sentinels run when process run-status changes. 1210* Sentinels:: Sentinels run when process run-status changes.
1211* Query Before Exit:: Whether to query if exiting will kill a process.
1212* Transaction Queues:: Transaction-based communication with subprocesses.
885* Network:: Opening network connections. 1213* Network:: Opening network connections.
1214* Network Servers:: Network servers let Emacs accept net connections.
1215* Datagrams:: UDP network connections.
1216* Low-Level Network:: Lower-level but more general function
1217 to create connections and servers.
1218* Misc Network:: Additional relevant functions for network connections.
1219* Byte Packing:: Using bindat to pack and unpack binary data.
886 1220
887Receiving Output from Processes 1221Receiving Output from Processes
888 1222
889* Process Buffers:: If no filter, output is put in a buffer. 1223* Process Buffers:: If no filter, output is put in a buffer.
890* Filter Functions:: Filter functions accept output from the process. 1224* Filter Functions:: Filter functions accept output from the process.
1225* Decoding Output:: Filters can get unibyte or multibyte strings.
891* Accepting Output:: How to wait until process output arrives. 1226* Accepting Output:: How to wait until process output arrives.
892 1227
1228Low-Level Network Access
1229
1230* Proc: Network Processes. Using @code{make-network-process}.
1231* Options: Network Options. Further control over network connections.
1232* Features: Network Feature Testing.
1233 Determining which network features work on
1234 the machine you are using.
1235
1236Packing and Unpacking Byte Arrays
1237
1238* Bindat Spec:: Describing data layout.
1239* Bindat Functions:: Doing the unpacking and packing.
1240* Bindat Examples:: Samples of what bindat.el can do for you!
1241
1242Emacs Display
1243
1244* Refresh Screen:: Clearing the screen and redrawing everything on it.
1245* Forcing Redisplay:: Forcing redisplay.
1246* Truncation:: Folding or wrapping long text lines.
1247* The Echo Area:: Displaying messages at the bottom of the screen.
1248* Warnings:: Displaying warning messages for the user.
1249* Invisible Text:: Hiding part of the buffer text.
1250* Selective Display:: Hiding part of the buffer text (the old way).
1251* Temporary Displays:: Displays that go away automatically.
1252* Overlays:: Use overlays to highlight parts of the buffer.
1253* Width:: How wide a character or string is on the screen.
1254* Line Height:: Controlling the height of lines.
1255* Faces:: A face defines a graphics style
1256 for text characters: font, colors, etc.
1257* Fringes:: Controlling window fringes.
1258* Scroll Bars:: Controlling vertical scroll bars.
1259* Display Property:: Enabling special display features.
1260* Images:: Displaying images in Emacs buffers.
1261* Buttons:: Adding clickable buttons to Emacs buffers.
1262* Abstract Display:: Emacs' Widget for Object Collections.
1263* Blinking:: How Emacs shows the matching open parenthesis.
1264* Usual Display:: The usual conventions for displaying nonprinting chars.
1265* Display Tables:: How to specify other conventions.
1266* Beeping:: Audible signal to the user.
1267* Window Systems:: Which window system is being used.
1268
1269The Echo Area
1270
1271* Displaying Messages:: Explicitly displaying text in the echo area.
1272* Progress:: Informing user about progress of a long operation.
1273* Logging Messages:: Echo area messages are logged for the user.
1274* Echo Area Customization:: Controlling the echo area.
1275
1276Reporting Warnings
1277
1278* Warning Basics:: Warnings concepts and functions to report them.
1279* Warning Variables:: Variables programs bind to customize their warnings.
1280* Warning Options:: Variables users set to control display of warnings.
1281
1282Overlays
1283
1284* Managing Overlays:: Creating and moving overlays.
1285* Overlay Properties:: How to read and set properties.
1286 What properties do to the screen display.
1287* Finding Overlays:: Searching for overlays.
1288
1289Faces
1290
1291* Defining Faces:: How to define a face with @code{defface}.
1292* Face Attributes:: What is in a face?
1293* Attribute Functions:: Functions to examine and set face attributes.
1294* Displaying Faces:: How Emacs combines the faces specified for
1295 a character.
1296* Font Selection:: Finding the best available font for a face.
1297* Face Functions:: How to define and examine faces.
1298* Auto Faces:: Hook for automatic face assignment.
1299* Font Lookup:: Looking up the names of available fonts
1300 and information about them.
1301* Fontsets:: A fontset is a collection of fonts
1302 that handle a range of character sets.
1303
1304Fringes
1305
1306* Fringe Size/Pos:: Specifying where to put the window fringes.
1307* Fringe Indicators:: Displaying indicator icons in the window fringes.
1308* Fringe Cursors:: Displaying cursors in the right fringe.
1309* Fringe Bitmaps:: Specifying bitmaps for fringe indicators.
1310* Customizing Bitmaps:: Specifying your own bitmaps to use in the fringes.
1311* Overlay Arrow:: Display of an arrow to indicate position.
1312
1313The @code{display} Property
1314
1315* Specified Space:: Displaying one space with a specified width.
1316* Pixel Specification:: Specifying space width or height in pixels.
1317* Other Display Specs:: Displaying an image; magnifying text; moving it
1318 up or down on the page; adjusting the width
1319 of spaces within text.
1320* Display Margins:: Displaying text or images to the side of
1321 the main text.
1322
1323Images
1324
1325* Image Descriptors:: How to specify an image for use in @code{:display}.
1326* XBM Images:: Special features for XBM format.
1327* XPM Images:: Special features for XPM format.
1328* GIF Images:: Special features for GIF format.
1329* PostScript Images:: Special features for PostScript format.
1330* Other Image Types:: Various other formats are supported.
1331* Defining Images:: Convenient ways to define an image for later use.
1332* Showing Images:: Convenient ways to display an image once
1333 it is defined.
1334* Image Cache:: Internal mechanisms of image display.
1335
1336Buttons
1337
1338* Button Properties:: Button properties with special meanings.
1339* Button Types:: Defining common properties for classes of buttons.
1340* Making Buttons:: Adding buttons to Emacs buffers.
1341* Manipulating Buttons:: Getting and setting properties of buttons.
1342* Button Buffer Commands:: Buffer-wide commands and bindings for buttons.
1343
1344Abstract Display
1345
1346* Abstract Display Functions:: Functions in the Ewoc package.
1347* Abstract Display Example:: Example of using Ewoc.
1348
1349Display Tables
1350
1351* Display Table Format:: What a display table consists of.
1352* Active Display Table:: How Emacs selects a display table to use.
1353* Glyphs:: How to define a glyph, and what glyphs mean.
1354
893Operating System Interface 1355Operating System Interface
894 1356
895* Starting Up:: Customizing Emacs start-up processing. 1357* Starting Up:: Customizing Emacs start-up processing.
896* Getting Out:: How exiting works (permanent or temporary). 1358* Getting Out:: How exiting works (permanent or temporary).
897* System Environment:: Distinguish the name and kind of system. 1359* System Environment:: Distinguish the name and kind of system.
898* Terminal Input:: Recording terminal input for debugging. 1360* User Identification:: Finding the name and user id of the user.
899* Terminal Output:: Recording terminal output for debugging. 1361* Time of Day:: Getting the current time.
900* Flow Control:: How to turn output flow control on or off. 1362* Time Conversion:: Converting a time from numeric form to a string, or
1363 to calendrical data (or vice versa).
1364* Time Parsing:: Converting a time from numeric form to text
1365 and vice versa.
1366* Processor Run Time:: Getting the run time used by Emacs.
1367* Time Calculations:: Adding, subtracting, comparing times, etc.
1368* Timers:: Setting a timer to call a function at a certain time.
1369* Idle Timers:: Setting a timer to call a function when Emacs has
1370 been idle for a certain length of time.
1371* Terminal Input:: Accessing and recording terminal input.
1372* Terminal Output:: Controlling and recording terminal output.
1373* Sound Output:: Playing sounds on the computer's speaker.
1374* X11 Keysyms:: Operating on key symbols for X Windows
901* Batch Mode:: Running Emacs without terminal interaction. 1375* Batch Mode:: Running Emacs without terminal interaction.
1376* Session Management:: Saving and restoring state with X Session Management.
902 1377
903Starting Up Emacs 1378Starting Up Emacs
904 1379
905* Start-up Summary:: Sequence of actions Emacs performs at start-up. 1380* Startup Summary:: Sequence of actions Emacs performs at start-up.
906* Init File:: Details on reading the init file (@file{.emacs}). 1381* Init File:: Details on reading the init file (@file{.emacs}).
907* Terminal-Specific:: How the terminal-specific Lisp file is read. 1382* Terminal-Specific:: How the terminal-specific Lisp file is read.
908* Command Line Arguments:: How command line arguments are processed, 1383* Command-Line Arguments:: How command-line arguments are processed,
909 and how you can customize them. 1384 and how you can customize them.
910 1385
911Getting out of Emacs 1386Getting Out of Emacs
912 1387
913* Killing Emacs:: Exiting Emacs irreversibly. 1388* Killing Emacs:: Exiting Emacs irreversibly.
914* Suspending Emacs:: Exiting Emacs reversibly. 1389* Suspending Emacs:: Exiting Emacs reversibly.
915 1390
916Emacs Display 1391Terminal Input
917 1392
918* Refresh Screen:: Clearing the screen and redrawing everything on it. 1393* Input Modes:: Options for how input is processed.
919* Truncation:: Folding or wrapping long text lines. 1394* Recording Input:: Saving histories of recent or all input events.
920* The Echo Area:: Where messages are displayed. 1395
921* Selective Display:: Hiding part of the buffer text. 1396Tips and Conventions
922* Overlay Arrow:: Display of an arrow to indicate position. 1397
923* Temporary Displays:: Displays that go away automatically. 1398* Coding Conventions:: Conventions for clean and robust programs.
924* Waiting:: Forcing display update and waiting for user. 1399* Key Binding Conventions:: Which keys should be bound by which programs.
925* Blinking:: How Emacs shows the matching open parenthesis. 1400* Programming Tips:: Making Emacs code fit smoothly in Emacs.
926* Usual Display:: How control characters are displayed. 1401* Compilation Tips:: Making compiled code run fast.
927* Beeping:: Audible signal to the user. 1402* Warning Tips:: Turning off compiler warnings.
928* Window Systems:: Which window system is being used. 1403* Documentation Tips:: Writing readable documentation strings.
1404* Comment Tips:: Conventions for writing comments.
1405* Library Headers:: Standard headers for library packages.
929 1406
930GNU Emacs Internals 1407GNU Emacs Internals
931 1408
932* Building Emacs:: How to preload Lisp libraries into Emacs. 1409* Building Emacs:: How the dumped Emacs is made.
933* Pure Storage:: A kludge to make preloaded Lisp functions sharable. 1410* Pure Storage:: A kludge to make preloaded Lisp functions sharable.
934* Garbage Collection:: Reclaiming space for Lisp objects no longer used. 1411* Garbage Collection:: Reclaiming space for Lisp objects no longer used.
935* Object Internals:: Data formats of buffers, windows, processes. 1412* Memory Usage:: Info about total size of Lisp objects made so far.
936* Writing Emacs Primitives:: Writing C code for Emacs. 1413* Writing Emacs Primitives:: Writing C code for Emacs.
1414* Object Internals:: Data formats of buffers, windows, processes.
937 1415
938Object Internals 1416Object Internals
939 1417
940* Buffer Internals:: Components of a buffer structure. 1418* Buffer Internals:: Components of a buffer structure.
941* Window Internals:: Components of a window structure. 1419* Window Internals:: Components of a window structure.
942* Process Internals:: Components of a process structure. 1420* Process Internals:: Components of a process structure.
1421@end detailmenu
943@end menu 1422@end menu
944 1423
945@c ================ Volume 1 ================
946
947@c include intro.texi 1424@c include intro.texi
948@c include objects.texi 1425@c include objects.texi
949@c include numbers.texi 1426@c include numbers.texi
@@ -951,6 +1428,7 @@ Object Internals
951 1428
952@c include lists.texi 1429@c include lists.texi
953@c include sequences.texi 1430@c include sequences.texi
1431@c include hash.texi
954@c include symbols.texi 1432@c include symbols.texi
955@c include eval.texi 1433@c include eval.texi
956 1434
@@ -959,36 +1437,40 @@ Object Internals
959@c include functions.texi 1437@c include functions.texi
960@c include macros.texi 1438@c include macros.texi
961 1439
1440@c include customize.texi
962@c include loading.texi 1441@c include loading.texi
963@c include compile.texi 1442@c include compile.texi
1443@c include advice.texi
1444
964@c include debugging.texi 1445@c include debugging.texi
965@c include streams.texi 1446@c include streams.texi
966
967@c include minibuf.texi 1447@c include minibuf.texi
968@c include commands.texi 1448@c include commands.texi
1449
969@c include keymaps.texi 1450@c include keymaps.texi
970@c include modes.texi 1451@c include modes.texi
1452@c include help.texi
1453@c include files.texi
971 1454
972@c ================ Beginning of Volume 2 ================ 1455@c include backups.texi
973 1456
974@include help.texi 1457@c ================ Beginning of Volume 2 ================
975@include files.texi
976@include backups.texi
977@include buffers.texi 1458@include buffers.texi
978
979@include windows.texi 1459@include windows.texi
980@include frames.texi 1460@include frames.texi
1461
981@include positions.texi 1462@include positions.texi
982@include markers.texi 1463@include markers.texi
983@include text.texi 1464@include text.texi
1465@include nonascii.texi
984 1466
985@include searching.texi 1467@include searching.texi
986@include syntax.texi 1468@include syntax.texi
987@include abbrevs.texi 1469@include abbrevs.texi
988
989@include processes.texi 1470@include processes.texi
990@include os.texi 1471
991@include display.texi 1472@include display.texi
1473@include os.texi
992 1474
993@c MOVE to Emacs Manual: include misc-modes.texi 1475@c MOVE to Emacs Manual: include misc-modes.texi
994 1476
@@ -996,6 +1478,9 @@ Object Internals
996 1478
997@c REMOVE this: include non-hacker.texi 1479@c REMOVE this: include non-hacker.texi
998 1480
1481@include anti.texi
1482@include doclicense.texi
1483@include gpl.texi
999@include tips.texi 1484@include tips.texi
1000@include internals.texi 1485@include internals.texi
1001@include errors.texi 1486@include errors.texi
@@ -1003,13 +1488,14 @@ Object Internals
1003@include maps.texi 1488@include maps.texi
1004@include hooks.texi 1489@include hooks.texi
1005 1490
1006@include index-vol2.texi 1491@include index.texi
1007 1492
1008@page 1493@ignore
1009@c Print the tables of contents 1494@node New Symbols, , Index, Top
1010@summarycontents 1495@unnumbered New Symbols Since the Previous Edition
1011@contents 1496
1012@c That's all 1497@printindex tp
1498@end ignore
1013 1499
1014@bye 1500@bye
1015 1501
diff --git a/lwlib/ChangeLog b/lwlib/ChangeLog
index f6764e87e17..fb722be920f 100644
--- a/lwlib/ChangeLog
+++ b/lwlib/ChangeLog
@@ -1,3 +1,7 @@
12007-06-13 Chong Yidong <cyd@stupidchicken.com>
2
3 * lwlib-Xaw.c, lwlib.c: Link to xaw3d if available.
4
12007-06-02 Chong Yidong <cyd@stupidchicken.com> 52007-06-02 Chong Yidong <cyd@stupidchicken.com>
2 6
3 * Version 22.1 released. 7 * Version 22.1 released.
diff --git a/lwlib/lwlib-Xaw.c b/lwlib/lwlib-Xaw.c
index be1990ed6fe..4ef2d3fcb67 100644
--- a/lwlib/lwlib-Xaw.c
+++ b/lwlib/lwlib-Xaw.c
@@ -35,12 +35,21 @@ Boston, MA 02110-1301, USA. */
35#include <X11/CoreP.h> 35#include <X11/CoreP.h>
36#include <X11/Shell.h> 36#include <X11/Shell.h>
37 37
38#ifdef HAVE_XAW3D
39#include <X11/Xaw3d/Scrollbar.h>
40#include <X11/Xaw3d/Paned.h>
41#include <X11/Xaw3d/Dialog.h>
42#include <X11/Xaw3d/Form.h>
43#include <X11/Xaw3d/Command.h>
44#include <X11/Xaw3d/Label.h>
45#else /* !HAVE_XAW3D */
38#include <X11/Xaw/Scrollbar.h> 46#include <X11/Xaw/Scrollbar.h>
39#include <X11/Xaw/Paned.h> 47#include <X11/Xaw/Paned.h>
40#include <X11/Xaw/Dialog.h> 48#include <X11/Xaw/Dialog.h>
41#include <X11/Xaw/Form.h> 49#include <X11/Xaw/Form.h>
42#include <X11/Xaw/Command.h> 50#include <X11/Xaw/Command.h>
43#include <X11/Xaw/Label.h> 51#include <X11/Xaw/Label.h>
52#endif /* HAVE_XAW3D */
44 53
45#include <X11/Xatom.h> 54#include <X11/Xatom.h>
46 55
diff --git a/lwlib/lwlib.c b/lwlib/lwlib.c
index bd5d9adbf9d..542b3ba5a60 100644
--- a/lwlib/lwlib.c
+++ b/lwlib/lwlib.c
@@ -48,7 +48,11 @@ Boston, MA 02110-1301, USA. */
48#endif /* not USE_MOTIF && USE_LUCID */ 48#endif /* not USE_MOTIF && USE_LUCID */
49#endif 49#endif
50#if defined (USE_XAW) 50#if defined (USE_XAW)
51#ifdef HAVE_XAW3D
52#include <X11/Xaw3d/Paned.h>
53#else /* !HAVE_XAW3D */
51#include <X11/Xaw/Paned.h> 54#include <X11/Xaw/Paned.h>
55#endif /* HAVE_XAW3D */
52#include "lwlib-Xaw.h" 56#include "lwlib-Xaw.h"
53#endif 57#endif
54 58
diff --git a/nt/ChangeLog b/nt/ChangeLog
index c2f784da78a..c1f5293059b 100644
--- a/nt/ChangeLog
+++ b/nt/ChangeLog
@@ -1,3 +1,9 @@
12007-06-15 Jason Rumney <jasonr@gnu.org>
2
3 * emacs.manifest: New file.
4
5 * emacs.rc: Use it.
6
12007-06-02 Chong Yidong <cyd@stupidchicken.com> 72007-06-02 Chong Yidong <cyd@stupidchicken.com>
2 8
3 * Version 22.1 released. 9 * Version 22.1 released.
diff --git a/nt/emacs.manifest b/nt/emacs.manifest
new file mode 100644
index 00000000000..4c1894c335f
--- /dev/null
+++ b/nt/emacs.manifest
@@ -0,0 +1,11 @@
1<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
3 <dependency>
4 <dependentAssembly>
5 <assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
6 version="6.0.0.0" processorArchitecture="X86"
7 publicKeyToken="6595b64144ccf1df"
8 language="*"/>
9 </dependentAssembly>
10 </dependency>
11</assembly> \ No newline at end of file
diff --git a/nt/emacs.rc b/nt/emacs.rc
index cf72b88a8ea..861b336fd35 100644
--- a/nt/emacs.rc
+++ b/nt/emacs.rc
@@ -1,5 +1,6 @@
1Emacs ICON icons\emacs.ico 1Emacs ICON icons\emacs.ico
232649 CURSOR icons\hand.cur 232649 CURSOR icons\hand.cur
31 24 "emacs.manifest"
3 4
4#ifndef VS_VERSION_INFO 5#ifndef VS_VERSION_INFO
5#define VS_VERSION_INFO 1 6#define VS_VERSION_INFO 1
diff --git a/src/ChangeLog b/src/ChangeLog
index ea0d71f90db..51975848e71 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,93 @@
12007-06-16 Eli Zaretskii <eliz@gnu.org>
2
3 * w32menu.c (add_menu_item): Escape `&' characters in menu items
4 and their keybindings.
5
62007-06-15 Chong Yidong <cyd@stupidchicken.com>
7
8 * composite.c (update_compositions): Fix last fix.
9
102007-06-14 Jason Rumney <jasonr@gnu.org>
11
12 * w32.c (get_process_times_fn): New function pointer.
13 (globals_of_w32): Intialize it if present in kernel32.dll.
14 (w32_get_internal_run_time): New function.
15
16 * editfns.c (Fget_internal_run_time) [WINDOWSNT]: Use it.
17
182007-06-14 Kenichi Handa <handa@etlken.m17n.org>
19
20 * composite.c (update_compositions): Check the validness of
21 compositions.
22
232007-06-14 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
24
25 * frame.h (struct frame) [MAC_OS]: New member external_tool_bar.
26 (FRAME_EXTERNAL_TOOL_BAR) [MAC_OS]: Use it.
27
28 * macfns.c (mac_window) [USE_MAC_TOOLBAR]: Set toolbar_win_gravity.
29 (x_set_tool_bar_lines) [USE_MAC_TOOLBAR]: Set FRAME_EXTERNAL_TOOL_BAR.
30
31 * macgui.h (USE_MAC_TOOLBAR): New define.
32
33 * macmenu.c [TARGET_API_MAC_CARBON] (menu_target_item_handler):
34 Return immediately unless popup is activated.
35
36 * macterm.c (x_draw_fringe_bitmap) [MAC_OSX]: Extend fringe
37 background to scroll bar gap.
38 (x_scroll_bar_create) [MAC_OSX]: Set bar->fringe_extended_p.
39 (XTset_vertical_scroll_bar) [MAC_OSX]: Put leftmost/rightmost
40 scroll bars on frame edge. Check fringe background extension.
41 Don't clear extended fringe background area.
42 (TOOLBAR_IDENTIFIER, TOOLBAR_ICON_ITEM_IDENTIFIER)
43 (TOOLBAR_ITEM_COMMAND_ID_OFFSET, TOOLBAR_ITEM_COMMAND_ID_P)
44 (TOOLBAR_ITEM_COMMAND_ID_VALUE, TOOLBAR_ITEM_MAKE_COMMAND_ID):
45 [USE_MAC_TOOLBAR]: New macros.
46 (mac_move_window_with_gravity, mac_get_window_origin_with_gravity)
47 (mac_handle_toolbar_event, mac_image_spec_to_cg_image)
48 (mac_create_frame_tool_bar, update_frame_tool_bar, free_frame_tool_bar)
49 (mac_tool_bar_note_mouse_movement, mac_handle_toolbar_command_event)
50 [USE_MAC_TOOLBAR]: New functions.
51 (mac_handle_window_event) [USE_MAC_TOOLBAR]: Reposition window
52 manually if previous repositioning has failed.
53 (mac_handle_keyboard_event): Use precomputed event kind.
54 (XTread_socket) [USE_MAC_TOOLBAR]: Handle click in structure region
55 as tool bar item click. Handle mouse movement over tool bar items.
56
57 * macterm.h (struct mac_output) [USE_MAC_TOOLBAR]: New member
58 toolbar_win_gravity.
59 (struct scroll_bar) [MAC_OSX]: New member fringe_extended_p.
60 (update_frame_tool_bar, free_frame_tool_bar) [USE_MAC_TOOLBAR]:
61 Add externs.
62
63 * xdisp.c (update_tool_bar, redisplay_tool_bar, redisplay_window)
64 [USE_MAC_TOOLBAR]: Sync with GTK+ tool bar display.
65
662007-06-14 Chong Yidong <cyd@stupidchicken.com>
67
68 * image.c (search_image_cache): Remove unused variable.
69
702007-06-13 Chong Yidong <cyd@stupidchicken.com>
71
72 * xfns.c, xmenu.c: Link to xaw3d if available.
73
742007-06-13 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
75
76 * dispextern.h (struct image) [HAVE_WINDOW_SYSTEM]: New members
77 frame_foreground and frame_background.
78
79 * image.c (lookup_image): Save frame foreground and background colors.
80 (search_image_cache): Check if saved and current frame colors match.
81
822007-06-12 Stefan Monnier <monnier@iro.umontreal.ca>
83
84 * regex.c (regex_compile): Remove the `regnum' counter.
85 Use bufp->re_nsub instead. Add support for \(?N:RE\).
86
872007-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
88
89 * term.c: Include intervals.h to declare Fget_text_property.
90
12007-06-10 Jason Rumney <jasonr@gnu.org> 912007-06-10 Jason Rumney <jasonr@gnu.org>
2 92
3 * w32fns.c (Fx_file_dialog): Take size from struct not pointer. 93 * w32fns.c (Fx_file_dialog): Take size from struct not pointer.
@@ -106,11 +196,11 @@
106 New function. 196 New function.
107 (init_dm_notification_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: 197 (init_dm_notification_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
108 Register it. 198 Register it.
109 (XTread_socket) [TARGET_API_MAC_CARBON]: Consolidate 199 (XTread_socket) [TARGET_API_MAC_CARBON]:
110 SendEventToEventTarget calls. Use FRAME_OUTER_TO_INNER_DIFF_X and 200 Consolidate SendEventToEventTarget calls.
111 FRAME_OUTER_TO_INNER_DIFF_Y. Move application activation handler 201 Use FRAME_OUTER_TO_INNER_DIFF_X and FRAME_OUTER_TO_INNER_DIFF_Y.
112 to mac_handle_application_event. Move keyboard handler to 202 Move application activation handler to mac_handle_application_event.
113 mac_handle_keyboard_event. 203 Move keyboard handler to mac_handle_keyboard_event.
114 (XTread_socket) [!TARGET_API_MAC_CARBON]: Use do_keystroke. 204 (XTread_socket) [!TARGET_API_MAC_CARBON]: Use do_keystroke.
115 (mac_initialize) [TARGET_API_MAC_CARBON]: Don't call 205 (mac_initialize) [TARGET_API_MAC_CARBON]: Don't call
116 init_command_handler. Call install_application_handler. 206 init_command_handler. Call install_application_handler.
@@ -124,8 +214,7 @@
124 214
1252007-06-06 Chong Yidong <cyd@stupidchicken.com> 2152007-06-06 Chong Yidong <cyd@stupidchicken.com>
126 216
127 * image.c (xpm_load): Remove spurious call to 217 * image.c (xpm_load): Remove spurious call to xpm_init_color_cache.
128 xpm_init_color_cache.
129 218
1302007-06-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp> 2192007-06-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
131 220
diff --git a/src/composite.c b/src/composite.c
index d44acf24722..332f4df81de 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -537,7 +537,8 @@ update_compositions (from, to, check_mask)
537 avoid it, in such a case, we change the property of the 537 avoid it, in such a case, we change the property of the
538 latter to the copy of it. */ 538 latter to the copy of it. */
539 if (from > BEGV 539 if (from > BEGV
540 && find_composition (from - 1, -1, &start, &end, &prop, Qnil)) 540 && find_composition (from - 1, -1, &start, &end, &prop, Qnil)
541 && COMPOSITION_VALID_P (start, end, prop))
541 { 542 {
542 min_pos = start; 543 min_pos = start;
543 if (end > to) 544 if (end > to)
@@ -550,7 +551,8 @@ update_compositions (from, to, check_mask)
550 from = end; 551 from = end;
551 } 552 }
552 else if (from < ZV 553 else if (from < ZV
553 && find_composition (from, -1, &start, &from, &prop, Qnil)) 554 && find_composition (from, -1, &start, &from, &prop, Qnil)
555 && COMPOSITION_VALID_P (start, from, prop))
554 { 556 {
555 if (from > to) 557 if (from > to)
556 max_pos = from; 558 max_pos = from;
@@ -565,6 +567,7 @@ update_compositions (from, to, check_mask)
565 (to - 1). */ 567 (to - 1). */
566 while (from < to - 1 568 while (from < to - 1
567 && find_composition (from, to, &start, &from, &prop, Qnil) 569 && find_composition (from, to, &start, &from, &prop, Qnil)
570 && COMPOSITION_VALID_P (start, from, prop)
568 && from < to - 1) 571 && from < to - 1)
569 run_composition_function (start, from, prop); 572 run_composition_function (start, from, prop);
570 } 573 }
@@ -572,7 +575,8 @@ update_compositions (from, to, check_mask)
572 if (check_mask & CHECK_TAIL) 575 if (check_mask & CHECK_TAIL)
573 { 576 {
574 if (from < to 577 if (from < to
575 && find_composition (to - 1, -1, &start, &end, &prop, Qnil)) 578 && find_composition (to - 1, -1, &start, &end, &prop, Qnil)
579 && COMPOSITION_VALID_P (start, end, prop))
576 { 580 {
577 /* TO should be also at composition boundary. But, 581 /* TO should be also at composition boundary. But,
578 insertion or deletion will make two compositions adjacent 582 insertion or deletion will make two compositions adjacent
@@ -589,7 +593,8 @@ update_compositions (from, to, check_mask)
589 run_composition_function (start, end, prop); 593 run_composition_function (start, end, prop);
590 } 594 }
591 else if (to < ZV 595 else if (to < ZV
592 && find_composition (to, -1, &start, &end, &prop, Qnil)) 596 && find_composition (to, -1, &start, &end, &prop, Qnil)
597 && COMPOSITION_VALID_P (start, end, prop))
593 { 598 {
594 run_composition_function (start, end, prop); 599 run_composition_function (start, end, prop);
595 max_pos = end; 600 max_pos = end;
diff --git a/src/config.in b/src/config.in
index 136565ab928..db6b5ebaee3 100644
--- a/src/config.in
+++ b/src/config.in
@@ -231,7 +231,8 @@ Boston, MA 02110-1301, USA. */
231/* Define to 1 if you have the `get_current_dir_name' function. */ 231/* Define to 1 if you have the `get_current_dir_name' function. */
232#undef HAVE_GET_CURRENT_DIR_NAME 232#undef HAVE_GET_CURRENT_DIR_NAME
233 233
234/* Define to 1 if you have the ungif library (-lungif). */ 234/* Define to 1 if you have a gif library (default -lungif; otherwise specify
235 with LIBGIF). */
235#undef HAVE_GIF 236#undef HAVE_GIF
236 237
237/* Define to 1 if you have the gpm library (-lgpm). */ 238/* Define to 1 if you have the gpm library (-lgpm). */
@@ -777,6 +778,9 @@ Boston, MA 02110-1301, USA. */
777 Solaris, for example). */ 778 Solaris, for example). */
778#undef LD_SWITCH_X_SITE_AUX 779#undef LD_SWITCH_X_SITE_AUX
779 780
781/* Compiler option to link with the gif library (if not -lungif). */
782#undef LIBGIF
783
780/* Define to 1 if localtime caches TZ. */ 784/* Define to 1 if localtime caches TZ. */
781#undef LOCALTIME_CACHE 785#undef LOCALTIME_CACHE
782 786
diff --git a/src/dispextern.h b/src/dispextern.h
index e2ad4b73e5a..9aeb660bc0f 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2441,6 +2441,10 @@ struct image
2441 if necessary. */ 2441 if necessary. */
2442 unsigned long background; 2442 unsigned long background;
2443 2443
2444 /* Foreground and background colors of the frame on which the image
2445 is created. */
2446 unsigned long frame_foreground, frame_background;
2447
2444 /* True if this image has a `transparent' background -- that is, is 2448 /* True if this image has a `transparent' background -- that is, is
2445 uses an image mask. The accessor macro for this is 2449 uses an image mask. The accessor macro for this is
2446 `IMAGE_BACKGROUND_TRANSPARENT'. */ 2450 `IMAGE_BACKGROUND_TRANSPARENT'. */
diff --git a/src/editfns.c b/src/editfns.c
index 22aa47688a5..b615012c700 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -84,6 +84,11 @@ extern char **environ;
84 84
85extern size_t emacs_strftimeu P_ ((char *, size_t, const char *, 85extern size_t emacs_strftimeu P_ ((char *, size_t, const char *,
86 const struct tm *, int)); 86 const struct tm *, int));
87
88#ifdef WINDOWSNT
89extern Lisp_Object w32_get_internal_run_time ();
90#endif
91
87static int tm_diff P_ ((struct tm *, struct tm *)); 92static int tm_diff P_ ((struct tm *, struct tm *));
88static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *)); 93static void find_field P_ ((Lisp_Object, Lisp_Object, Lisp_Object, int *, Lisp_Object, int *));
89static void update_buffer_properties P_ ((int, int)); 94static void update_buffer_properties P_ ((int, int));
@@ -1481,9 +1486,13 @@ on systems that do not provide resolution finer than a second. */)
1481 return list3 (make_number ((secs >> 16) & 0xffff), 1486 return list3 (make_number ((secs >> 16) & 0xffff),
1482 make_number ((secs >> 0) & 0xffff), 1487 make_number ((secs >> 0) & 0xffff),
1483 make_number (usecs)); 1488 make_number (usecs));
1484#else 1489#else /* ! HAVE_GETRUSAGE */
1490#if WINDOWSNT
1491 return w32_get_internal_run_time ();
1492#else /* ! WINDOWSNT */
1485 return Fcurrent_time (); 1493 return Fcurrent_time ();
1486#endif 1494#endif /* WINDOWSNT */
1495#endif /* HAVE_GETRUSAGE */
1487} 1496}
1488 1497
1489 1498
diff --git a/src/frame.h b/src/frame.h
index db60700c5ad..4a97a6095e0 100644
--- a/src/frame.h
+++ b/src/frame.h
@@ -218,7 +218,7 @@ struct frame
218 be used for output. */ 218 be used for output. */
219 unsigned glyphs_initialized_p : 1; 219 unsigned glyphs_initialized_p : 1;
220 220
221#if defined (USE_GTK) 221#if defined (USE_GTK) || defined (MAC_OS)
222 /* Nonzero means using a tool bar that comes from the toolkit. */ 222 /* Nonzero means using a tool bar that comes from the toolkit. */
223 int external_tool_bar; 223 int external_tool_bar;
224#endif 224#endif
@@ -561,7 +561,7 @@ typedef struct frame *FRAME_PTR;
561 561
562/* Nonzero if this frame should display a tool bar 562/* Nonzero if this frame should display a tool bar
563 in a way that does not use any text lines. */ 563 in a way that does not use any text lines. */
564#if defined (USE_GTK) 564#if defined (USE_GTK) || defined (MAC_OS)
565#define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar 565#define FRAME_EXTERNAL_TOOL_BAR(f) (f)->external_tool_bar
566#else 566#else
567#define FRAME_EXTERNAL_TOOL_BAR(f) 0 567#define FRAME_EXTERNAL_TOOL_BAR(f) 0
diff --git a/src/image.c b/src/image.c
index 9cfcd5a63f8..2dd578afc39 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1642,22 +1642,28 @@ search_image_cache (f, spec, hash)
1642{ 1642{
1643 struct image *img; 1643 struct image *img;
1644 struct image_cache *c = FRAME_X_IMAGE_CACHE (f); 1644 struct image_cache *c = FRAME_X_IMAGE_CACHE (f);
1645 Lisp_Object specified_bg = image_spec_value (spec, QCbackground, NULL);
1646 int i = hash % IMAGE_CACHE_BUCKETS_SIZE; 1645 int i = hash % IMAGE_CACHE_BUCKETS_SIZE;
1647 1646
1648 /* If the image spec does not specify a background color, the cached 1647 /* If the image spec does not specify a background color, the cached
1649 image must have the same background color as the current frame. 1648 image must have the same background color as the current frame.
1650 The following code be improved. For example, jpeg does not 1649 The foreground color must also match, for the sake of monochrome
1651 support transparency, but currently a jpeg image spec won't match 1650 images.
1652 a cached spec created with a different frame background. The 1651
1653 extra memory usage is probably negligible in practice. */ 1652 In fact, we could ignore the foreground color matching condition
1653 for color images, or if the image spec specifies :foreground;
1654 similarly we could ignore the background color matching condition
1655 for formats that don't use transparency (such as jpeg), or if the
1656 image spec specifies :background. However, the extra memory
1657 usage is probably negligible in practice, so we don't bother. */
1654 if (!c) return NULL; 1658 if (!c) return NULL;
1655 1659
1656 for (img = c->buckets[i]; img; img = img->next) 1660 for (img = c->buckets[i]; img; img = img->next)
1657 if (img->hash == hash 1661 if (img->hash == hash
1658 && !NILP (Fequal (img->spec, spec)) 1662 && !NILP (Fequal (img->spec, spec))
1659 && (STRINGP (specified_bg) 1663 /* If the image spec specifies a background, it doesn't matter
1660 || img->background == FRAME_BACKGROUND_PIXEL (f))) 1664 what the frame background is. */
1665 && img->frame_foreground == FRAME_FOREGROUND_PIXEL (f)
1666 && img->frame_background == FRAME_BACKGROUND_PIXEL (f))
1661 break; 1667 break;
1662 return img; 1668 return img;
1663} 1669}
@@ -1929,6 +1935,8 @@ lookup_image (f, spec)
1929 img = make_image (spec, hash); 1935 img = make_image (spec, hash);
1930 cache_image (f, img); 1936 cache_image (f, img);
1931 img->load_failed_p = img->type->load (f, img) == 0; 1937 img->load_failed_p = img->type->load (f, img) == 0;
1938 img->frame_foreground = FRAME_FOREGROUND_PIXEL (f);
1939 img->frame_background = FRAME_BACKGROUND_PIXEL (f);
1932 1940
1933 /* If we can't load the image, and we don't have a width and 1941 /* If we can't load the image, and we don't have a width and
1934 height, use some arbitrary width and height so that we can 1942 height, use some arbitrary width and height so that we can
diff --git a/src/macfns.c b/src/macfns.c
index b3ab709116a..d47a716c928 100644
--- a/src/macfns.c
+++ b/src/macfns.c
@@ -1682,6 +1682,25 @@ x_set_tool_bar_lines (f, value, oldval)
1682 /* Make sure we redisplay all windows in this frame. */ 1682 /* Make sure we redisplay all windows in this frame. */
1683 ++windows_or_buffers_changed; 1683 ++windows_or_buffers_changed;
1684 1684
1685#if USE_MAC_TOOLBAR
1686 FRAME_TOOL_BAR_LINES (f) = 0;
1687 if (nlines)
1688 {
1689 FRAME_EXTERNAL_TOOL_BAR (f) = 1;
1690 if (FRAME_MAC_P (f) && !IsWindowToolbarVisible (FRAME_MAC_WINDOW (f)))
1691 /* Make sure next redisplay shows the tool bar. */
1692 XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt;
1693 }
1694 else
1695 {
1696 if (FRAME_EXTERNAL_TOOL_BAR (f))
1697 free_frame_tool_bar (f);
1698 FRAME_EXTERNAL_TOOL_BAR (f) = 0;
1699 }
1700
1701 return;
1702#endif
1703
1685 delta = nlines - FRAME_TOOL_BAR_LINES (f); 1704 delta = nlines - FRAME_TOOL_BAR_LINES (f);
1686 1705
1687 /* Don't resize the tool-bar to more than we have room for. */ 1706 /* Don't resize the tool-bar to more than we have room for. */
@@ -2284,6 +2303,16 @@ mac_window (f)
2284 XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f), 2303 XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f),
2285 FRAME_BACKGROUND_PIXEL (f)); 2304 FRAME_BACKGROUND_PIXEL (f));
2286 2305
2306#if USE_MAC_TOOLBAR
2307 /* At the moment, the size of the tool bar is not yet known. We
2308 record the gravity value of the newly created window and use it
2309 to adjust the position of the window (especially for a negative
2310 specification of its vertical position) when the tool bar is
2311 first redisplayed. */
2312 if (FRAME_EXTERNAL_TOOL_BAR (f))
2313 f->output_data.mac->toolbar_win_gravity = f->win_gravity;
2314#endif
2315
2287 validate_x_resource_name (); 2316 validate_x_resource_name ();
2288 2317
2289 /* x_set_name normally ignores requests to set the name if the 2318 /* x_set_name normally ignores requests to set the name if the
diff --git a/src/macgui.h b/src/macgui.h
index 34a3f905487..a141a6563f0 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -119,6 +119,13 @@ typedef unsigned long Time;
119#endif 119#endif
120#endif 120#endif
121 121
122/* Whether to use HIToolbar. */
123#ifndef USE_MAC_TOOLBAR
124#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 && MAC_OS_X_VERSION_MIN_REQUIRED != 1020
125#define USE_MAC_TOOLBAR 1
126#endif
127#endif
128
122typedef WindowRef Window; 129typedef WindowRef Window;
123typedef GWorldPtr Pixmap; 130typedef GWorldPtr Pixmap;
124 131
diff --git a/src/macmenu.c b/src/macmenu.c
index 5e6ad6f7d10..932af50bbd8 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1602,6 +1602,10 @@ menu_target_item_handler (next_handler, event, data)
1602 GrafPtr port; 1602 GrafPtr port;
1603 int specpdl_count = SPECPDL_INDEX (); 1603 int specpdl_count = SPECPDL_INDEX ();
1604 1604
1605 /* Don't be bothered with the overflowed toolbar items menu. */
1606 if (!popup_activated ())
1607 return eventNotHandledErr;
1608
1605 err = GetEventParameter (event, kEventParamDirectObject, typeMenuRef, 1609 err = GetEventParameter (event, kEventParamDirectObject, typeMenuRef,
1606 NULL, sizeof (MenuRef), NULL, &menu); 1610 NULL, sizeof (MenuRef), NULL, &menu);
1607 if (err == noErr) 1611 if (err == noErr)
diff --git a/src/macterm.c b/src/macterm.c
index 1a67a9ebec1..d770f867ff7 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -2197,6 +2197,57 @@ x_draw_fringe_bitmap (w, row, p)
2197 struct face *face = p->face; 2197 struct face *face = p->face;
2198 int rowY; 2198 int rowY;
2199 2199
2200#ifdef MAC_OSX
2201 if (p->bx >= 0 && !p->overlay_p)
2202 {
2203 int bx = p->bx, nx = p->nx;
2204
2205#if 0 /* MAC_TODO: stipple */
2206 /* In case the same realized face is used for fringes and
2207 for something displayed in the text (e.g. face `region' on
2208 mono-displays, the fill style may have been changed to
2209 FillSolid in x_draw_glyph_string_background. */
2210 if (face->stipple)
2211 XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled);
2212 else
2213 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background);
2214#endif
2215
2216 /* If the fringe is adjacent to the left (right) scroll bar of a
2217 leftmost (rightmost, respectively) window, then extend its
2218 background to the gap between the fringe and the bar. */
2219 if ((WINDOW_LEFTMOST_P (w)
2220 && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
2221 || (WINDOW_RIGHTMOST_P (w)
2222 && WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)))
2223 {
2224 int sb_width = WINDOW_CONFIG_SCROLL_BAR_WIDTH (w);
2225
2226 if (sb_width > 0)
2227 {
2228 int left = WINDOW_SCROLL_BAR_AREA_X (w);
2229 int width = (WINDOW_CONFIG_SCROLL_BAR_COLS (w)
2230 * FRAME_COLUMN_WIDTH (f));
2231
2232 if (left + width == bx)
2233 {
2234 bx = left + sb_width;
2235 nx += width - sb_width;
2236 }
2237 else if (bx + nx == left)
2238 nx += width - sb_width;
2239 }
2240 }
2241
2242 mac_erase_rectangle (f, face->gc, bx, p->by, nx, p->ny);
2243
2244#if 0 /* MAC_TODO: stipple */
2245 if (!face->stipple)
2246 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground);
2247#endif
2248 }
2249#endif /* MAC_OSX */
2250
2200 /* Must clip because of partially visible lines. */ 2251 /* Must clip because of partially visible lines. */
2201 rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); 2252 rowY = WINDOW_TO_FRAME_PIXEL_Y (w, row->y);
2202 if (p->y < rowY) 2253 if (p->y < rowY)
@@ -2214,6 +2265,7 @@ x_draw_fringe_bitmap (w, row, p)
2214 else 2265 else
2215 x_clip_to_row (w, row, -1, face->gc); 2266 x_clip_to_row (w, row, -1, face->gc);
2216 2267
2268#ifndef MAC_OSX
2217 if (p->bx >= 0 && !p->overlay_p) 2269 if (p->bx >= 0 && !p->overlay_p)
2218 { 2270 {
2219#if 0 /* MAC_TODO: stipple */ 2271#if 0 /* MAC_TODO: stipple */
@@ -2234,6 +2286,7 @@ x_draw_fringe_bitmap (w, row, p)
2234 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); 2286 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground);
2235#endif 2287#endif
2236 } 2288 }
2289#endif /* !MAC_OSX */
2237 2290
2238 if (p->which 2291 if (p->which
2239#if USE_CG_DRAWING 2292#if USE_CG_DRAWING
@@ -4997,6 +5050,9 @@ x_scroll_bar_create (w, top, left, width, height, disp_top, disp_height)
4997 XSETINT (bar->start, 0); 5050 XSETINT (bar->start, 0);
4998 XSETINT (bar->end, 0); 5051 XSETINT (bar->end, 0);
4999 bar->dragging = Qnil; 5052 bar->dragging = Qnil;
5053#ifdef MAC_OSX
5054 bar->fringe_extended_p = Qnil;
5055#endif
5000#ifdef USE_TOOLKIT_SCROLL_BARS 5056#ifdef USE_TOOLKIT_SCROLL_BARS
5001 bar->track_top = Qnil; 5057 bar->track_top = Qnil;
5002 bar->track_height = Qnil; 5058 bar->track_height = Qnil;
@@ -5129,6 +5185,9 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5129 struct scroll_bar *bar; 5185 struct scroll_bar *bar;
5130 int top, height, left, sb_left, width, sb_width, disp_top, disp_height; 5186 int top, height, left, sb_left, width, sb_width, disp_top, disp_height;
5131 int window_y, window_height; 5187 int window_y, window_height;
5188#ifdef MAC_OSX
5189 int fringe_extended_p;
5190#endif
5132 5191
5133 /* Get window dimensions. */ 5192 /* Get window dimensions. */
5134 window_box (w, -1, 0, &window_y, 0, &window_height); 5193 window_box (w, -1, 0, &window_y, 0, &window_height);
@@ -5148,9 +5207,9 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5148 5207
5149 /* Compute the left edge of the scroll bar. */ 5208 /* Compute the left edge of the scroll bar. */
5150 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w)) 5209 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_RIGHT (w))
5151 sb_left = left; 5210 sb_left = left + (WINDOW_RIGHTMOST_P (w) ? width - sb_width : 0);
5152 else 5211 else
5153 sb_left = left + width - sb_width; 5212 sb_left = left + (WINDOW_LEFTMOST_P (w) ? 0 : width - sb_width);
5154 5213
5155 /* Adjustments according to Inside Macintosh to make it look nice */ 5214 /* Adjustments according to Inside Macintosh to make it look nice */
5156 disp_top = top; 5215 disp_top = top;
@@ -5171,11 +5230,29 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5171 sb_left++; 5230 sb_left++;
5172#endif 5231#endif
5173 5232
5233#ifdef MAC_OSX
5234 if (WINDOW_HAS_VERTICAL_SCROLL_BAR_ON_LEFT (w))
5235 fringe_extended_p = (WINDOW_LEFTMOST_P (w)
5236 && WINDOW_LEFT_FRINGE_WIDTH (w)
5237 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
5238 || WINDOW_LEFT_MARGIN_COLS (w) == 0));
5239 else
5240 fringe_extended_p = (WINDOW_RIGHTMOST_P (w)
5241 && WINDOW_RIGHT_FRINGE_WIDTH (w)
5242 && (WINDOW_HAS_FRINGES_OUTSIDE_MARGINS (w)
5243 || WINDOW_RIGHT_MARGIN_COLS (w) == 0));
5244#endif
5245
5174 /* Does the scroll bar exist yet? */ 5246 /* Does the scroll bar exist yet? */
5175 if (NILP (w->vertical_scroll_bar)) 5247 if (NILP (w->vertical_scroll_bar))
5176 { 5248 {
5177 BLOCK_INPUT; 5249 BLOCK_INPUT;
5178 mac_clear_area (f, left, top, width, height); 5250#ifdef MAC_OSX
5251 if (fringe_extended_p)
5252 mac_clear_area (f, sb_left, top, sb_width, height);
5253 else
5254#endif
5255 mac_clear_area (f, left, top, width, height);
5179 UNBLOCK_INPUT; 5256 UNBLOCK_INPUT;
5180 bar = x_scroll_bar_create (w, top, sb_left, sb_width, height, disp_top, 5257 bar = x_scroll_bar_create (w, top, sb_left, sb_width, height, disp_top,
5181 disp_height); 5258 disp_height);
@@ -5195,11 +5272,20 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5195 if (!(XINT (bar->left) == sb_left 5272 if (!(XINT (bar->left) == sb_left
5196 && XINT (bar->top) == top 5273 && XINT (bar->top) == top
5197 && XINT (bar->width) == sb_width 5274 && XINT (bar->width) == sb_width
5198 && XINT (bar->height) == height)) 5275 && XINT (bar->height) == height
5276#ifdef MAC_OSX
5277 && !NILP (bar->fringe_extended_p) == fringe_extended_p
5278#endif
5279 ))
5199 { 5280 {
5200 /* Since toolkit scroll bars are smaller than the space reserved 5281 /* Since toolkit scroll bars are smaller than the space reserved
5201 for them on the frame, we have to clear "under" them. */ 5282 for them on the frame, we have to clear "under" them. */
5202 mac_clear_area (f, left, top, width, height); 5283#ifdef MAC_OSX
5284 if (fringe_extended_p)
5285 mac_clear_area (f, sb_left, top, sb_width, height);
5286 else
5287#endif
5288 mac_clear_area (f, left, top, width, height);
5203 5289
5204#if USE_CG_DRAWING 5290#if USE_CG_DRAWING
5205 mac_prepare_for_quickdraw (f); 5291 mac_prepare_for_quickdraw (f);
@@ -5228,6 +5314,10 @@ XTset_vertical_scroll_bar (w, portion, whole, position)
5228 UNBLOCK_INPUT; 5314 UNBLOCK_INPUT;
5229 } 5315 }
5230 5316
5317#ifdef MAC_OSX
5318 bar->fringe_extended_p = fringe_extended_p ? Qt : Qnil;
5319#endif
5320
5231#ifdef USE_TOOLKIT_SCROLL_BARS 5321#ifdef USE_TOOLKIT_SCROLL_BARS
5232 if (NILP (bar->track_top)) 5322 if (NILP (bar->track_top))
5233 { 5323 {
@@ -5591,6 +5681,539 @@ x_scroll_bar_clear (f)
5591 5681
5592 5682
5593/*********************************************************************** 5683/***********************************************************************
5684 Tool-bars
5685 ***********************************************************************/
5686#if USE_MAC_TOOLBAR
5687
5688/* In identifiers such as function/variable names, Emacs tool bar is
5689 referred to as `tool_bar', and Carbon HIToolbar as `toolbar'. */
5690
5691#define TOOLBAR_IDENTIFIER (CFSTR ("org.gnu.Emacs.toolbar"))
5692#define TOOLBAR_ICON_ITEM_IDENTIFIER (CFSTR ("org.gnu.Emacs.toolbar.icon"))
5693
5694#define TOOLBAR_ITEM_COMMAND_ID_OFFSET 'Tb\0\0'
5695#define TOOLBAR_ITEM_COMMAND_ID_P(id) \
5696 (((id) & ~0xffff) == TOOLBAR_ITEM_COMMAND_ID_OFFSET)
5697#define TOOLBAR_ITEM_COMMAND_ID_VALUE(id) \
5698 ((id) - TOOLBAR_ITEM_COMMAND_ID_OFFSET)
5699#define TOOLBAR_ITEM_MAKE_COMMAND_ID(value) \
5700 ((value) + TOOLBAR_ITEM_COMMAND_ID_OFFSET)
5701
5702static int mac_event_to_emacs_modifiers P_ ((EventRef));
5703static void mac_handle_origin_change P_ ((struct frame *));
5704static OSStatus mac_handle_toolbar_command_event P_ ((EventHandlerCallRef,
5705 EventRef, void *));
5706
5707static void
5708mac_move_window_with_gravity (f, win_gravity, left, top)
5709 struct frame *f;
5710 int win_gravity;
5711 short left, top;
5712{
5713 Rect inner, outer;
5714
5715 mac_get_window_bounds (f, &inner, &outer);
5716
5717 switch (win_gravity)
5718 {
5719 case NorthWestGravity:
5720 case WestGravity:
5721 case SouthWestGravity:
5722 left += inner.left - outer.left;
5723 break;
5724
5725 case NorthGravity:
5726 case CenterGravity:
5727 case SouthGravity:
5728 left += ((inner.left - outer.left) + (inner.right - outer.right)) / 2;
5729 break;
5730
5731 case NorthEastGravity:
5732 case EastGravity:
5733 case SouthEastGravity:
5734 left += inner.right - outer.right;
5735 break;
5736 }
5737
5738 switch (win_gravity)
5739 {
5740 case NorthWestGravity:
5741 case NorthGravity:
5742 case NorthEastGravity:
5743 top += inner.top - outer.top;
5744 break;
5745
5746 case WestGravity:
5747 case CenterGravity:
5748 case EastGravity:
5749 top += ((inner.top - outer.top) + (inner.bottom - outer.bottom)) / 2;
5750 break;
5751
5752 case SouthWestGravity:
5753 case SouthGravity:
5754 case SouthEastGravity:
5755 top += inner.bottom - outer.bottom;
5756 break;
5757 }
5758
5759 MoveWindow (FRAME_MAC_WINDOW (f), left, top, false);
5760}
5761
5762static void
5763mac_get_window_origin_with_gravity (f, win_gravity, left, top)
5764 struct frame *f;
5765 int win_gravity;
5766 short *left, *top;
5767{
5768 Rect inner, outer;
5769
5770 mac_get_window_bounds (f, &inner, &outer);
5771
5772 switch (win_gravity)
5773 {
5774 case NorthWestGravity:
5775 case WestGravity:
5776 case SouthWestGravity:
5777 *left = outer.left;
5778 break;
5779
5780 case NorthGravity:
5781 case CenterGravity:
5782 case SouthGravity:
5783 *left = outer.left + ((outer.right - outer.left)
5784 - (inner.right - inner.left)) / 2;
5785 break;
5786
5787 case NorthEastGravity:
5788 case EastGravity:
5789 case SouthEastGravity:
5790 *left = outer.right - (inner.right - inner.left);
5791 break;
5792 }
5793
5794 switch (win_gravity)
5795 {
5796 case NorthWestGravity:
5797 case NorthGravity:
5798 case NorthEastGravity:
5799 *top = outer.top;
5800 break;
5801
5802 case WestGravity:
5803 case CenterGravity:
5804 case EastGravity:
5805 *top = outer.top + ((outer.bottom - outer.top)
5806 - (inner.bottom - inner.top)) / 2;
5807 break;
5808
5809 case SouthWestGravity:
5810 case SouthGravity:
5811 case SouthEastGravity:
5812 *top = outer.bottom - (inner.bottom - inner.top);
5813 break;
5814 }
5815}
5816
5817static OSStatus
5818mac_handle_toolbar_event (next_handler, event, data)
5819 EventHandlerCallRef next_handler;
5820 EventRef event;
5821 void *data;
5822{
5823 OSStatus err, result = eventNotHandledErr;
5824
5825 switch (GetEventKind (event))
5826 {
5827 case kEventToolbarGetDefaultIdentifiers:
5828 result = noErr;
5829 break;
5830
5831 case kEventToolbarGetAllowedIdentifiers:
5832 {
5833 CFMutableArrayRef array;
5834
5835 GetEventParameter (event, kEventParamMutableArray,
5836 typeCFMutableArrayRef, NULL,
5837 sizeof (CFMutableArrayRef), NULL, &array);
5838 CFArrayAppendValue (array, TOOLBAR_ICON_ITEM_IDENTIFIER);
5839 result = noErr;
5840 }
5841 break;
5842
5843 case kEventToolbarCreateItemWithIdentifier:
5844 {
5845 CFStringRef identifier;
5846 HIToolbarItemRef item = NULL;
5847
5848 GetEventParameter (event, kEventParamToolbarItemIdentifier,
5849 typeCFStringRef, NULL,
5850 sizeof (CFStringRef), NULL, &identifier);
5851
5852 if (CFStringCompare (identifier, TOOLBAR_ICON_ITEM_IDENTIFIER, 0)
5853 == kCFCompareEqualTo)
5854 HIToolbarItemCreate (identifier,
5855 kHIToolbarItemAllowDuplicates
5856 | kHIToolbarItemCantBeRemoved, &item);
5857
5858 if (item)
5859 {
5860 SetEventParameter (event, kEventParamToolbarItem,
5861 typeHIToolbarItemRef,
5862 sizeof (HIToolbarItemRef), &item);
5863 result = noErr;
5864 }
5865 }
5866 break;
5867
5868 default:
5869 abort ();
5870 }
5871
5872 return result;
5873}
5874
5875static CGImageRef
5876mac_image_spec_to_cg_image (f, image)
5877 struct frame *f;
5878 Lisp_Object image;
5879{
5880 if (!valid_image_p (image))
5881 return NULL;
5882 else
5883 {
5884 int img_id = lookup_image (f, image);
5885 struct image *img = IMAGE_FROM_ID (f, img_id);
5886
5887 prepare_image_for_display (f, img);
5888
5889 return img->data.ptr_val;
5890 }
5891}
5892
5893/* Create a tool bar for frame F. */
5894
5895static OSStatus
5896mac_create_frame_tool_bar (f)
5897 FRAME_PTR f;
5898{
5899 OSStatus err;
5900 HIToolbarRef toolbar;
5901
5902 err = HIToolbarCreate (TOOLBAR_IDENTIFIER, kHIToolbarNoAttributes,
5903 &toolbar);
5904 if (err == noErr)
5905 {
5906 static const EventTypeSpec specs[] =
5907 {{kEventClassToolbar, kEventToolbarGetDefaultIdentifiers},
5908 {kEventClassToolbar, kEventToolbarGetAllowedIdentifiers},
5909 {kEventClassToolbar, kEventToolbarCreateItemWithIdentifier}};
5910
5911 err = InstallEventHandler (HIObjectGetEventTarget (toolbar),
5912 mac_handle_toolbar_event,
5913 GetEventTypeCount (specs), specs,
5914 f, NULL);
5915 }
5916
5917 if (err == noErr)
5918 err = HIToolbarSetDisplayMode (toolbar, kHIToolbarDisplayModeIconOnly);
5919 if (err == noErr)
5920 {
5921 static const EventTypeSpec specs[] =
5922 {{kEventClassCommand, kEventCommandProcess}};
5923
5924 err = InstallWindowEventHandler (FRAME_MAC_WINDOW (f),
5925 mac_handle_toolbar_command_event,
5926 GetEventTypeCount (specs),
5927 specs, f, NULL);
5928 }
5929 if (err == noErr)
5930 err = SetWindowToolbar (FRAME_MAC_WINDOW (f), toolbar);
5931
5932 if (toolbar)
5933 CFRelease (toolbar);
5934
5935 return err;
5936}
5937
5938/* Update the tool bar for frame F. Add new buttons and remove old. */
5939
5940void
5941update_frame_tool_bar (f)
5942 FRAME_PTR f;
5943{
5944 HIToolbarRef toolbar = NULL;
5945 short left, top;
5946 CFArrayRef old_items = NULL;
5947 CFIndex old_count;
5948 int i, pos, win_gravity = f->output_data.mac->toolbar_win_gravity;
5949 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
5950
5951 BLOCK_INPUT;
5952
5953 GetWindowToolbar (FRAME_MAC_WINDOW (f), &toolbar);
5954 if (toolbar == NULL)
5955 {
5956 mac_create_frame_tool_bar (f);
5957 GetWindowToolbar (FRAME_MAC_WINDOW (f), &toolbar);
5958 if (toolbar == NULL)
5959 goto out;
5960 if (win_gravity >= NorthWestGravity && win_gravity <= SouthEastGravity)
5961 mac_get_window_origin_with_gravity (f, win_gravity, &left, &top);
5962 }
5963
5964 HIToolbarCopyItems (toolbar, &old_items);
5965 if (old_items == NULL)
5966 goto out;
5967
5968 old_count = CFArrayGetCount (old_items);
5969 pos = 0;
5970 for (i = 0; i < f->n_tool_bar_items; ++i)
5971 {
5972#define PROP(IDX) AREF (f->tool_bar_items, i * TOOL_BAR_ITEM_NSLOTS + (IDX))
5973
5974 int enabled_p = !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P));
5975 int selected_p = !NILP (PROP (TOOL_BAR_ITEM_SELECTED_P));
5976 int idx;
5977 Lisp_Object image;
5978 CGImageRef cg_image;
5979 CFStringRef label;
5980 HIToolbarItemRef item;
5981
5982 /* If image is a vector, choose the image according to the
5983 button state. */
5984 image = PROP (TOOL_BAR_ITEM_IMAGES);
5985 if (VECTORP (image))
5986 {
5987 if (enabled_p)
5988 idx = (selected_p
5989 ? TOOL_BAR_IMAGE_ENABLED_SELECTED
5990 : TOOL_BAR_IMAGE_ENABLED_DESELECTED);
5991 else
5992 idx = (selected_p
5993 ? TOOL_BAR_IMAGE_DISABLED_SELECTED
5994 : TOOL_BAR_IMAGE_DISABLED_DESELECTED);
5995
5996 xassert (ASIZE (image) >= idx);
5997 image = AREF (image, idx);
5998 }
5999 else
6000 idx = -1;
6001
6002 cg_image = mac_image_spec_to_cg_image (f, image);
6003 /* Ignore invalid image specifications. */
6004 if (cg_image == NULL)
6005 continue;
6006
6007 label = cfstring_create_with_string (PROP (TOOL_BAR_ITEM_CAPTION));
6008 if (label == NULL)
6009 label = CFSTR ("");
6010
6011 if (pos < old_count)
6012 {
6013 CGImageRef old_cg_image = NULL;
6014 CFStringRef old_label = NULL;
6015 Boolean old_enabled_p;
6016
6017 item = (HIToolbarItemRef) CFArrayGetValueAtIndex (old_items, pos);
6018
6019 HIToolbarItemCopyImage (item, &old_cg_image);
6020 if (cg_image != old_cg_image)
6021 HIToolbarItemSetImage (item, cg_image);
6022 CGImageRelease (old_cg_image);
6023
6024 HIToolbarItemCopyLabel (item, &old_label);
6025 if (CFStringCompare (label, old_label, 0) != kCFCompareEqualTo)
6026 HIToolbarItemSetLabel (item, label);
6027 CFRelease (old_label);
6028
6029 old_enabled_p = HIToolbarItemIsEnabled (item);
6030 if ((enabled_p || idx >= 0) != old_enabled_p)
6031 HIToolbarItemSetEnabled (item, (enabled_p || idx >= 0));
6032 }
6033 else
6034 {
6035 item = NULL;
6036 HIToolbarCreateItemWithIdentifier (toolbar,
6037 TOOLBAR_ICON_ITEM_IDENTIFIER,
6038 NULL, &item);
6039 if (item)
6040 {
6041 HIToolbarItemSetImage (item, cg_image);
6042 HIToolbarItemSetLabel (item, label);
6043 HIToolbarItemSetEnabled (item, (enabled_p || idx >= 0));
6044 HIToolbarAppendItem (toolbar, item);
6045 CFRelease (item);
6046 }
6047 }
6048
6049 CFRelease (label);
6050 if (item)
6051 {
6052 HIToolbarItemSetCommandID (item, TOOLBAR_ITEM_MAKE_COMMAND_ID (i));
6053 pos++;
6054 }
6055 }
6056
6057 CFRelease (old_items);
6058
6059 while (pos < old_count)
6060 HIToolbarRemoveItemAtIndex (toolbar, --old_count);
6061
6062 ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), true,
6063 !win_gravity && f == mac_focus_frame (dpyinfo));
6064 /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events on
6065 toolbar visibility change. */
6066 mac_handle_origin_change (f);
6067 if (win_gravity >= NorthWestGravity && win_gravity <= SouthEastGravity)
6068 {
6069 mac_move_window_with_gravity (f, win_gravity, left, top);
6070 /* If the title bar is completely outside the screen, adjust the
6071 position. */
6072 ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
6073 kWindowConstrainMoveRegardlessOfFit
6074 | kWindowConstrainAllowPartial, NULL, NULL);
6075 f->output_data.mac->toolbar_win_gravity = 0;
6076 }
6077
6078 out:
6079 UNBLOCK_INPUT;
6080}
6081
6082/* Hide the tool bar on frame F. Unlike the counterpart on GTK+, it
6083 doesn't deallocate the resources. */
6084
6085void
6086free_frame_tool_bar (f)
6087 FRAME_PTR f;
6088{
6089 if (IsWindowToolbarVisible (FRAME_MAC_WINDOW (f)))
6090 {
6091 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
6092
6093 BLOCK_INPUT;
6094 ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), false,
6095 f == mac_focus_frame (dpyinfo));
6096 /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events
6097 on toolbar visibility change. */
6098 mac_handle_origin_change (f);
6099 UNBLOCK_INPUT;
6100 }
6101}
6102
6103static void
6104mac_tool_bar_note_mouse_movement (f, event)
6105 struct frame *f;
6106 EventRef event;
6107{
6108 OSStatus err;
6109 struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
6110 int mouse_down_p;
6111 HIViewRef item_view;
6112 UInt32 command_id;
6113
6114 mouse_down_p = (dpyinfo->grabbed
6115 && f == last_mouse_frame
6116 && FRAME_LIVE_P (f));
6117 if (mouse_down_p)
6118 return;
6119
6120 err = HIViewGetViewForMouseEvent (HIViewGetRoot (FRAME_MAC_WINDOW (f)),
6121 event, &item_view);
6122 /* This doesn't work on Mac OS X 10.2. On Mac OS X 10.3 and 10.4, a
6123 toolbar item view seems to have the same command ID with that of
6124 the toolbar item. */
6125 if (err == noErr)
6126 err = GetControlCommandID (item_view, &command_id);
6127 if (err == noErr && TOOLBAR_ITEM_COMMAND_ID_P (command_id))
6128 {
6129 int i = TOOLBAR_ITEM_COMMAND_ID_VALUE (command_id);
6130
6131 if (i < f->n_tool_bar_items)
6132 {
6133 HIRect bounds;
6134 HIViewRef content_view;
6135
6136 err = HIViewGetBounds (item_view, &bounds);
6137 if (err == noErr)
6138 err = HIViewFindByID (HIViewGetRoot (FRAME_MAC_WINDOW (f)),
6139 kHIViewWindowContentID, &content_view);
6140 if (err == noErr)
6141 err = HIViewConvertRect (&bounds, item_view, content_view);
6142 if (err == noErr)
6143 SetRect (&last_mouse_glyph,
6144 CGRectGetMinX (bounds), CGRectGetMinY (bounds),
6145 CGRectGetMaxX (bounds), CGRectGetMaxY (bounds));
6146
6147 help_echo_object = help_echo_window = Qnil;
6148 help_echo_pos = -1;
6149 help_echo_string = PROP (TOOL_BAR_ITEM_HELP);
6150 if (NILP (help_echo_string))
6151 help_echo_string = PROP (TOOL_BAR_ITEM_CAPTION);
6152 }
6153 }
6154}
6155
6156static OSStatus
6157mac_handle_toolbar_command_event (next_handler, event, data)
6158 EventHandlerCallRef next_handler;
6159 EventRef event;
6160 void *data;
6161{
6162 OSStatus err, result = eventNotHandledErr;
6163 struct frame *f = (struct frame *) data;
6164 HICommand command;
6165
6166 err = GetEventParameter (event, kEventParamDirectObject,
6167 typeHICommand, NULL,
6168 sizeof (HICommand), NULL, &command);
6169 if (err != noErr)
6170 return result;
6171
6172 switch (GetEventKind (event))
6173 {
6174 case kEventCommandProcess:
6175 if (!TOOLBAR_ITEM_COMMAND_ID_P (command.commandID))
6176 result = CallNextEventHandler (next_handler, event);
6177 else
6178 {
6179 int i = TOOLBAR_ITEM_COMMAND_ID_VALUE (command.commandID);
6180
6181 if (i < f->n_tool_bar_items
6182 && !NILP (PROP (TOOL_BAR_ITEM_ENABLED_P)))
6183 {
6184 Lisp_Object frame;
6185 struct input_event buf;
6186
6187 EVENT_INIT (buf);
6188
6189 XSETFRAME (frame, f);
6190 buf.kind = TOOL_BAR_EVENT;
6191 buf.frame_or_window = frame;
6192 buf.arg = frame;
6193 kbd_buffer_store_event (&buf);
6194
6195 buf.kind = TOOL_BAR_EVENT;
6196 buf.frame_or_window = frame;
6197 buf.arg = PROP (TOOL_BAR_ITEM_KEY);
6198 buf.modifiers = mac_event_to_emacs_modifiers (event);
6199 kbd_buffer_store_event (&buf);
6200
6201 result = noErr;
6202 }
6203 }
6204 break;
6205
6206 default:
6207 abort ();
6208 }
6209#undef PROP
6210
6211 return result;
6212}
6213#endif /* USE_MAC_TOOLBAR */
6214
6215
6216/***********************************************************************
5594 Text Cursor 6217 Text Cursor
5595 ***********************************************************************/ 6218 ***********************************************************************/
5596 6219
@@ -10101,6 +10724,13 @@ mac_handle_window_event (next_handler, event, data)
10101 kWindowCascadeOnParentWindowScreen 10724 kWindowCascadeOnParentWindowScreen
10102#endif 10725#endif
10103 ); 10726 );
10727#if USE_MAC_TOOLBAR
10728 /* This is a workaround. RepositionWindow fails to put
10729 a window at the cascading position when its parent
10730 window has a Carbon HIToolbar. */
10731 if (f->top_pos == sf->top_pos && f->left_pos == sf->left_pos)
10732 MoveWindowStructure (wp, f->left_pos + 10, f->top_pos + 32);
10733#endif
10104 } 10734 }
10105 result = noErr; 10735 result = noErr;
10106 } 10736 }
@@ -10383,8 +11013,7 @@ mac_handle_keyboard_event (next_handler, event, data)
10383 if (err != noErr) 11013 if (err != noErr)
10384 break; 11014 break;
10385 11015
10386 do_keystroke ((GetEventKind (event) == kEventRawKeyDown 11016 do_keystroke ((event_kind == kEventRawKeyDown ? keyDown : autoKey),
10387 ? keyDown : autoKey),
10388 char_code, key_code, modifiers, 11017 char_code, key_code, modifiers,
10389 ((unsigned long) 11018 ((unsigned long)
10390 (GetEventTime (event) / kEventDurationMillisecond)), 11019 (GetEventTime (event) / kEventDurationMillisecond)),
@@ -11438,6 +12067,21 @@ XTread_socket (sd, expected, hold_quit)
11438 do_zoom_window (window_ptr, part_code); 12067 do_zoom_window (window_ptr, part_code);
11439 break; 12068 break;
11440 12069
12070#if USE_MAC_TOOLBAR
12071 case inStructure:
12072 {
12073 OSStatus err;
12074 HIViewRef ch;
12075
12076 err = HIViewGetViewForMouseEvent (HIViewGetRoot (window_ptr),
12077 eventRef, &ch);
12078 /* This doesn't work on Mac OS X 10.2. */
12079 if (err == noErr)
12080 HIViewClick (ch, eventRef);
12081 }
12082 break;
12083#endif /* USE_MAC_TOOLBAR */
12084
11441 default: 12085 default:
11442 break; 12086 break;
11443 } 12087 }
@@ -11522,6 +12166,10 @@ XTread_socket (sd, expected, hold_quit)
11522 } 12166 }
11523 if (!note_mouse_movement (f, &mouse_pos)) 12167 if (!note_mouse_movement (f, &mouse_pos))
11524 help_echo_string = previous_help_echo_string; 12168 help_echo_string = previous_help_echo_string;
12169#if USE_MAC_TOOLBAR
12170 else
12171 mac_tool_bar_note_mouse_movement (f, eventRef);
12172#endif
11525 } 12173 }
11526 } 12174 }
11527 12175
diff --git a/src/macterm.h b/src/macterm.h
index 7984ff2b970..f6ab9f70449 100644
--- a/src/macterm.h
+++ b/src/macterm.h
@@ -333,6 +333,16 @@ struct mac_output
333 /* Hints for the size and the position of a window. */ 333 /* Hints for the size and the position of a window. */
334 XSizeHints *size_hints; 334 XSizeHints *size_hints;
335 335
336#if USE_MAC_TOOLBAR
337 /* This variable records the gravity value of the window position if
338 the window has an external tool bar when it is created. The
339 position of the window is adjusted using this information when
340 the tool bar is first redisplayed. Once the tool bar is
341 redisplayed, it is set to 0 in order to avoid further
342 adjustment. */
343 int toolbar_win_gravity;
344#endif
345
336#if USE_CG_DRAWING 346#if USE_CG_DRAWING
337 /* Quartz 2D graphics context. */ 347 /* Quartz 2D graphics context. */
338 CGContextRef cg_context; 348 CGContextRef cg_context;
@@ -441,6 +451,12 @@ struct scroll_bar {
441 being dragged, this is Qnil. */ 451 being dragged, this is Qnil. */
442 Lisp_Object dragging; 452 Lisp_Object dragging;
443 453
454#ifdef MAC_OSX
455 /* t if the background of the fringe that is adjacent to a scroll
456 bar is extended to the gap between the fringe and the bar. */
457 Lisp_Object fringe_extended_p;
458#endif
459
444#ifdef USE_TOOLKIT_SCROLL_BARS 460#ifdef USE_TOOLKIT_SCROLL_BARS
445 /* The position and size of the scroll bar handle track area in 461 /* The position and size of the scroll bar handle track area in
446 pixels, relative to the frame. */ 462 pixels, relative to the frame. */
@@ -651,6 +667,10 @@ extern void mac_prepare_for_quickdraw P_ ((struct frame *));
651#endif 667#endif
652extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *)); 668extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
653extern int mac_quit_char_key_p P_ ((UInt32, UInt32)); 669extern int mac_quit_char_key_p P_ ((UInt32, UInt32));
670#if USE_MAC_TOOLBAR
671extern void update_frame_tool_bar P_ ((FRAME_PTR f));
672extern void free_frame_tool_bar P_ ((FRAME_PTR f));
673#endif
654 674
655#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0 675#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
656#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0 676#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
diff --git a/src/regex.c b/src/regex.c
index 81c37730a9a..48f0dd92737 100644
--- a/src/regex.c
+++ b/src/regex.c
@@ -2620,11 +2620,6 @@ regex_compile (pattern, size, syntax, bufp)
2620 last -- ends with a forward jump of this sort. */ 2620 last -- ends with a forward jump of this sort. */
2621 unsigned char *fixup_alt_jump = 0; 2621 unsigned char *fixup_alt_jump = 0;
2622 2622
2623 /* Counts open-groups as they are encountered. Remembered for the
2624 matching close-group on the compile stack, so the same register
2625 number is put in the stop_memory as the start_memory. */
2626 regnum_t regnum = 0;
2627
2628 /* Work area for range table of charset. */ 2623 /* Work area for range table of charset. */
2629 struct range_table_work_area range_table_work; 2624 struct range_table_work_area range_table_work;
2630 2625
@@ -3276,28 +3271,54 @@ regex_compile (pattern, size, syntax, bufp)
3276 handle_open: 3271 handle_open:
3277 { 3272 {
3278 int shy = 0; 3273 int shy = 0;
3274 regnum_t regnum = 0;
3279 if (p+1 < pend) 3275 if (p+1 < pend)
3280 { 3276 {
3281 /* Look for a special (?...) construct */ 3277 /* Look for a special (?...) construct */
3282 if ((syntax & RE_SHY_GROUPS) && *p == '?') 3278 if ((syntax & RE_SHY_GROUPS) && *p == '?')
3283 { 3279 {
3284 PATFETCH (c); /* Gobble up the '?'. */ 3280 PATFETCH (c); /* Gobble up the '?'. */
3285 PATFETCH (c); 3281 while (!shy)
3286 switch (c)
3287 { 3282 {
3288 case ':': shy = 1; break; 3283 PATFETCH (c);
3289 default: 3284 switch (c)
3290 /* Only (?:...) is supported right now. */ 3285 {
3291 FREE_STACK_RETURN (REG_BADPAT); 3286 case ':': shy = 1; break;
3287 case '0':
3288 /* An explicitly specified regnum must start
3289 with non-0. */
3290 if (regnum == 0)
3291 FREE_STACK_RETURN (REG_BADPAT);
3292 case '1': case '2': case '3': case '4':
3293 case '5': case '6': case '7': case '8': case '9':
3294 regnum = 10*regnum + (c - '0'); break;
3295 default:
3296 /* Only (?:...) is supported right now. */
3297 FREE_STACK_RETURN (REG_BADPAT);
3298 }
3292 } 3299 }
3293 } 3300 }
3294 } 3301 }
3295 3302
3296 if (!shy) 3303 if (!shy)
3297 { 3304 regnum = ++bufp->re_nsub;
3298 bufp->re_nsub++; 3305 else if (regnum)
3299 regnum++; 3306 { /* It's actually not shy, but explicitly numbered. */
3307 shy = 0;
3308 if (regnum > bufp->re_nsub)
3309 bufp->re_nsub = regnum;
3310 else if (regnum > bufp->re_nsub
3311 /* Ideally, we'd want to check that the specified
3312 group can't have matched (i.e. all subgroups
3313 using the same regnum are in other branches of
3314 OR patterns), but we don't currently keep track
3315 of enough info to do that easily. */
3316 || group_in_compile_stack (compile_stack, regnum))
3317 FREE_STACK_RETURN (REG_BADPAT);
3300 } 3318 }
3319 else
3320 /* It's really shy. */
3321 regnum = - bufp->re_nsub;
3301 3322
3302 if (COMPILE_STACK_FULL) 3323 if (COMPILE_STACK_FULL)
3303 { 3324 {
@@ -3316,12 +3337,11 @@ regex_compile (pattern, size, syntax, bufp)
3316 COMPILE_STACK_TOP.fixup_alt_jump 3337 COMPILE_STACK_TOP.fixup_alt_jump
3317 = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0; 3338 = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
3318 COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer; 3339 COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
3319 COMPILE_STACK_TOP.regnum = shy ? -regnum : regnum; 3340 COMPILE_STACK_TOP.regnum = regnum;
3320 3341
3321 /* Do not push a 3342 /* Do not push a start_memory for groups beyond the last one
3322 start_memory for groups beyond the last one we can 3343 we can represent in the compiled pattern. */
3323 represent in the compiled pattern. */ 3344 if (regnum <= MAX_REGNUM && regnum > 0)
3324 if (regnum <= MAX_REGNUM && !shy)
3325 BUF_PUSH_2 (start_memory, regnum); 3345 BUF_PUSH_2 (start_memory, regnum);
3326 3346
3327 compile_stack.avail++; 3347 compile_stack.avail++;
@@ -3366,7 +3386,7 @@ regex_compile (pattern, size, syntax, bufp)
3366 /* We don't just want to restore into `regnum', because 3386 /* We don't just want to restore into `regnum', because
3367 later groups should continue to be numbered higher, 3387 later groups should continue to be numbered higher,
3368 as in `(ab)c(de)' -- the second group is #2. */ 3388 as in `(ab)c(de)' -- the second group is #2. */
3369 regnum_t this_group_regnum; 3389 regnum_t regnum;
3370 3390
3371 compile_stack.avail--; 3391 compile_stack.avail--;
3372 begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset; 3392 begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
@@ -3375,7 +3395,7 @@ regex_compile (pattern, size, syntax, bufp)
3375 ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1 3395 ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
3376 : 0; 3396 : 0;
3377 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset; 3397 laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
3378 this_group_regnum = COMPILE_STACK_TOP.regnum; 3398 regnum = COMPILE_STACK_TOP.regnum;
3379 /* If we've reached MAX_REGNUM groups, then this open 3399 /* If we've reached MAX_REGNUM groups, then this open
3380 won't actually generate any code, so we'll have to 3400 won't actually generate any code, so we'll have to
3381 clear pending_exact explicitly. */ 3401 clear pending_exact explicitly. */
@@ -3383,8 +3403,8 @@ regex_compile (pattern, size, syntax, bufp)
3383 3403
3384 /* We're at the end of the group, so now we know how many 3404 /* We're at the end of the group, so now we know how many
3385 groups were inside this one. */ 3405 groups were inside this one. */
3386 if (this_group_regnum <= MAX_REGNUM && this_group_regnum > 0) 3406 if (regnum <= MAX_REGNUM && regnum > 0)
3387 BUF_PUSH_2 (stop_memory, this_group_regnum); 3407 BUF_PUSH_2 (stop_memory, regnum);
3388 } 3408 }
3389 break; 3409 break;
3390 3410
@@ -3710,8 +3730,9 @@ regex_compile (pattern, size, syntax, bufp)
3710 3730
3711 reg = c - '0'; 3731 reg = c - '0';
3712 3732
3713 /* Can't back reference to a subexpression before its end. */ 3733 if (reg > bufp->re_nsub || reg < 1
3714 if (reg > regnum || group_in_compile_stack (compile_stack, reg)) 3734 /* Can't back reference to a subexp before its end. */
3735 || group_in_compile_stack (compile_stack, reg))
3715 FREE_STACK_RETURN (REG_ESUBREG); 3736 FREE_STACK_RETURN (REG_ESUBREG);
3716 3737
3717 laststart = b; 3738 laststart = b;
diff --git a/src/term.c b/src/term.c
index 566b8b84915..0210a66afa9 100644
--- a/src/term.c
+++ b/src/term.c
@@ -42,6 +42,7 @@ Boston, MA 02110-1301, USA. */
42#include "window.h" 42#include "window.h"
43#include "keymap.h" 43#include "keymap.h"
44#include "blockinput.h" 44#include "blockinput.h"
45#include "intervals.h"
45 46
46/* For now, don't try to include termcap.h. On some systems, 47/* For now, don't try to include termcap.h. On some systems,
47 configure finds a non-standard termcap.h that the main build 48 configure finds a non-standard termcap.h that the main build
diff --git a/src/w32.c b/src/w32.c
index 9ad82c7a231..2d52b84af4c 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -137,6 +137,15 @@ typedef BOOL (WINAPI * GetTokenInformation_Proc) (
137 LPVOID TokenInformation, 137 LPVOID TokenInformation,
138 DWORD TokenInformationLength, 138 DWORD TokenInformationLength,
139 PDWORD ReturnLength); 139 PDWORD ReturnLength);
140typedef BOOL (WINAPI * GetProcessTimes_Proc) (
141 HANDLE process_handle,
142 LPFILETIME creation_time,
143 LPFILETIME exit_time,
144 LPFILETIME kernel_time,
145 LPFILETIME user_time);
146
147GetProcessTimes_Proc get_process_times_fn = NULL;
148
140#ifdef _UNICODE 149#ifdef _UNICODE
141const char * const LookupAccountSid_Name = "LookupAccountSidW"; 150const char * const LookupAccountSid_Name = "LookupAccountSidW";
142#else 151#else
@@ -172,6 +181,46 @@ is_windows_9x ()
172 return s_b_ret; 181 return s_b_ret;
173} 182}
174 183
184/* Get total user and system times for get-internal-run-time.
185 Returns a list of three integers if the times are provided by the OS
186 (NT derivatives), otherwise it returns the result of current-time. */
187Lisp_Object
188w32_get_internal_run_time ()
189{
190 if (get_process_times_fn)
191 {
192 FILETIME create, exit, kernel, user;
193 HANDLE proc = GetCurrentProcess();
194 if ((*get_process_times_fn) (proc, &create, &exit, &kernel, &user))
195 {
196 LARGE_INTEGER user_int, kernel_int, total;
197 int microseconds;
198 user_int.LowPart = user.dwLowDateTime;
199 user_int.HighPart = user.dwHighDateTime;
200 kernel_int.LowPart = kernel.dwLowDateTime;
201 kernel_int.HighPart = kernel.dwHighDateTime;
202 total.QuadPart = user_int.QuadPart + kernel_int.QuadPart;
203 /* FILETIME is 100 nanosecond increments, Emacs only wants
204 microsecond resolution. */
205 total.QuadPart /= 10;
206 microseconds = total.QuadPart % 1000000;
207 total.QuadPart /= 1000000;
208
209 /* Sanity check to make sure we can represent the result. */
210 if (total.HighPart == 0)
211 {
212 int secs = total.LowPart;
213
214 return list3 (make_number ((secs >> 16) & 0xffff),
215 make_number (secs & 0xffff),
216 make_number (microseconds));
217 }
218 }
219 }
220
221 return Fcurrent_time ();
222}
223
175 /* ** The wrapper functions ** */ 224 /* ** The wrapper functions ** */
176 225
177BOOL WINAPI open_process_token ( 226BOOL WINAPI open_process_token (
@@ -486,20 +535,16 @@ init_user_info ()
486 the user-sid as the user id value (same for group id using the 535 the user-sid as the user id value (same for group id using the
487 primary group sid from the process token). */ 536 primary group sid from the process token). */
488 537
489 char user_sid[256], name[256], domain[256]; 538 char user_sid[256], name[256], domain[256];
490 DWORD length = sizeof (name), dlength = sizeof (domain), trash; 539 DWORD length = sizeof (name), dlength = sizeof (domain), trash;
491 HANDLE token = NULL; 540 HANDLE token = NULL;
492 SID_NAME_USE user_type; 541 SID_NAME_USE user_type;
493 542
494 if ( 543 if (open_process_token (GetCurrentProcess (), TOKEN_QUERY, &token)
495 open_process_token (GetCurrentProcess (), TOKEN_QUERY, &token) 544 && get_token_information (token, TokenUser,
496 && get_token_information ( 545 (PVOID) user_sid, sizeof (user_sid), &trash)
497 token, TokenUser, 546 && lookup_account_sid (NULL, *((PSID *) user_sid), name, &length,
498 (PVOID) user_sid, sizeof (user_sid), &trash) 547 domain, &dlength, &user_type))
499 && lookup_account_sid (
500 NULL, *((PSID *) user_sid), name, &length,
501 domain, &dlength, &user_type)
502 )
503 { 548 {
504 strcpy (the_passwd.pw_name, name); 549 strcpy (the_passwd.pw_name, name);
505 /* Determine a reasonable uid value. */ 550 /* Determine a reasonable uid value. */
@@ -524,7 +569,7 @@ init_user_info ()
524 569
525 /* Get group id */ 570 /* Get group id */
526 if (get_token_information (token, TokenPrimaryGroup, 571 if (get_token_information (token, TokenPrimaryGroup,
527 (PVOID) user_sid, sizeof (user_sid), &trash)) 572 (PVOID) user_sid, sizeof (user_sid), &trash))
528 { 573 {
529 SID_IDENTIFIER_AUTHORITY * pSIA; 574 SID_IDENTIFIER_AUTHORITY * pSIA;
530 575
@@ -541,7 +586,7 @@ init_user_info ()
541 } 586 }
542 } 587 }
543 /* If security calls are not supported (presumably because we 588 /* If security calls are not supported (presumably because we
544 are running under Windows 95), fallback to this. */ 589 are running under Windows 95), fallback to this. */
545 else if (GetUserName (name, &length)) 590 else if (GetUserName (name, &length))
546 { 591 {
547 strcpy (the_passwd.pw_name, name); 592 strcpy (the_passwd.pw_name, name);
@@ -4148,6 +4193,11 @@ BOOL WINAPI shutdown_handler(DWORD type)
4148void 4193void
4149globals_of_w32 () 4194globals_of_w32 ()
4150{ 4195{
4196 HMODULE kernel32 = GetModuleHandle ("kernel32.dll");
4197
4198 get_process_times_fn = (GetProcessTimes_Proc)
4199 GetProcAddress (kernel32, "GetProcessTimes");
4200
4151 g_b_init_is_windows_9x = 0; 4201 g_b_init_is_windows_9x = 0;
4152 g_b_init_open_process_token = 0; 4202 g_b_init_open_process_token = 0;
4153 g_b_init_get_token_information = 0; 4203 g_b_init_get_token_information = 0;
diff --git a/src/w32menu.c b/src/w32menu.c
index d7fdcd49b9f..3169be007ba 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -23,6 +23,7 @@ Boston, MA 02110-1301, USA. */
23#include <signal.h> 23#include <signal.h>
24 24
25#include <stdio.h> 25#include <stdio.h>
26#include <mbstring.h>
26#include "lisp.h" 27#include "lisp.h"
27#include "termhooks.h" 28#include "termhooks.h"
28#include "keyboard.h" 29#include "keyboard.h"
@@ -2262,8 +2263,9 @@ static int
2262add_menu_item (HMENU menu, widget_value *wv, HMENU item) 2263add_menu_item (HMENU menu, widget_value *wv, HMENU item)
2263{ 2264{
2264 UINT fuFlags; 2265 UINT fuFlags;
2265 char *out_string; 2266 char *out_string, *p, *q;
2266 int return_value; 2267 int return_value;
2268 size_t nlen, orig_len;
2267 2269
2268 if (name_is_separator (wv->name)) 2270 if (name_is_separator (wv->name))
2269 { 2271 {
@@ -2287,6 +2289,33 @@ add_menu_item (HMENU menu, widget_value *wv, HMENU item)
2287 else 2289 else
2288 out_string = wv->name; 2290 out_string = wv->name;
2289 2291
2292 /* Quote any special characters within the menu item's text and
2293 key binding. */
2294 nlen = orig_len = strlen (out_string);
2295 for (p = out_string; *p; p = _mbsinc (p))
2296 {
2297 if (_mbsnextc (p) == '&')
2298 nlen++;
2299 }
2300 if (nlen > orig_len)
2301 {
2302 p = out_string;
2303 out_string = alloca (nlen + 1);
2304 q = out_string;
2305 while (*p)
2306 {
2307 if (_mbsnextc (p) == '&')
2308 {
2309 _mbsncpy (q, p, 1);
2310 q = _mbsinc (q);
2311 }
2312 _mbsncpy (q, p, 1);
2313 p = _mbsinc (p);
2314 q = _mbsinc (q);
2315 }
2316 *q = '\0';
2317 }
2318
2290 if (item != NULL) 2319 if (item != NULL)
2291 fuFlags = MF_POPUP; 2320 fuFlags = MF_POPUP;
2292 else if (wv->title || wv->call_data == 0) 2321 else if (wv->title || wv->call_data == 0)
diff --git a/src/xdisp.c b/src/xdisp.c
index b87a3d3ac08..9477ea76aee 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -9525,7 +9525,7 @@ update_tool_bar (f, save_match_data)
9525 struct frame *f; 9525 struct frame *f;
9526 int save_match_data; 9526 int save_match_data;
9527{ 9527{
9528#ifdef USE_GTK 9528#if defined (USE_GTK) || USE_MAC_TOOLBAR
9529 int do_update = FRAME_EXTERNAL_TOOL_BAR (f); 9529 int do_update = FRAME_EXTERNAL_TOOL_BAR (f);
9530#else 9530#else
9531 int do_update = WINDOWP (f->tool_bar_window) 9531 int do_update = WINDOWP (f->tool_bar_window)
@@ -9991,7 +9991,7 @@ redisplay_tool_bar (f)
9991 struct it it; 9991 struct it it;
9992 struct glyph_row *row; 9992 struct glyph_row *row;
9993 9993
9994#ifdef USE_GTK 9994#if defined (USE_GTK) || USE_MAC_TOOLBAR
9995 if (FRAME_EXTERNAL_TOOL_BAR (f)) 9995 if (FRAME_EXTERNAL_TOOL_BAR (f))
9996 update_frame_tool_bar (f); 9996 update_frame_tool_bar (f);
9997 return 0; 9997 return 0;
@@ -13616,7 +13616,7 @@ redisplay_window (window, just_this_one_p)
13616 display_menu_bar (w); 13616 display_menu_bar (w);
13617 13617
13618#ifdef HAVE_WINDOW_SYSTEM 13618#ifdef HAVE_WINDOW_SYSTEM
13619#ifdef USE_GTK 13619#if defined (USE_GTK) || USE_MAC_TOOLBAR
13620 redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f); 13620 redisplay_tool_bar_p = FRAME_EXTERNAL_TOOL_BAR (f);
13621#else 13621#else
13622 redisplay_tool_bar_p = WINDOWP (f->tool_bar_window) 13622 redisplay_tool_bar_p = WINDOWP (f->tool_bar_window)
diff --git a/src/xfns.c b/src/xfns.c
index dbc9f2d9b16..e4eeb737205 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -77,8 +77,13 @@ Boston, MA 02110-1301, USA. */
77#include <X11/Shell.h> 77#include <X11/Shell.h>
78 78
79#ifndef USE_MOTIF 79#ifndef USE_MOTIF
80#ifdef HAVE_XAW3D
81#include <X11/Xaw3d/Paned.h>
82#include <X11/Xaw3d/Label.h>
83#else /* !HAVE_XAW3D */
80#include <X11/Xaw/Paned.h> 84#include <X11/Xaw/Paned.h>
81#include <X11/Xaw/Label.h> 85#include <X11/Xaw/Label.h>
86#endif /* HAVE_XAW3D */
82#endif /* USE_MOTIF */ 87#endif /* USE_MOTIF */
83 88
84#ifdef USG 89#ifdef USG
diff --git a/src/xmenu.c b/src/xmenu.c
index 4390e34a914..16ff30334d3 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -82,7 +82,11 @@ Boston, MA 02110-1301, USA. */
82#include <X11/StringDefs.h> 82#include <X11/StringDefs.h>
83#include <X11/Shell.h> 83#include <X11/Shell.h>
84#ifdef USE_LUCID 84#ifdef USE_LUCID
85#ifdef HAVE_XAW3D
86#include <X11/Xaw3d/Paned.h>
87#else /* !HAVE_XAW3D */
85#include <X11/Xaw/Paned.h> 88#include <X11/Xaw/Paned.h>
89#endif /* HAVE_XAW3D */
86#endif /* USE_LUCID */ 90#endif /* USE_LUCID */
87#include "../lwlib/lwlib.h" 91#include "../lwlib/lwlib.h"
88#else /* not USE_X_TOOLKIT */ 92#else /* not USE_X_TOOLKIT */