aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJuanma Barranquero2003-01-31 15:24:20 +0000
committerJuanma Barranquero2003-01-31 15:24:20 +0000
commitc60ee5e70f7ae20f1bbf7d0e2d36f40658f3dff1 (patch)
tree7d28300d64e41bf2aeed37bc8f1293f9fc52a36a /src
parent2454c12d458c60b871f6f36c3fd6ba752aad61bf (diff)
downloademacs-c60ee5e70f7ae20f1bbf7d0e2d36f40658f3dff1.tar.gz
emacs-c60ee5e70f7ae20f1bbf7d0e2d36f40658f3dff1.zip
Cygwin support patch.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog13
-rw-r--r--src/Makefile.in50
-rw-r--r--src/fileio.c18
-rw-r--r--src/keyboard.c266
-rw-r--r--src/mem-limits.h4
5 files changed, 184 insertions, 167 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 09369df682c..06580d307a0 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,16 @@
12003-01-31 Joe Buehler <jhpb@draco.hekimian.com>
2
3 * fileio.c: Support // at start of name for Cygwin (just added proper
4 preprocessor tests).
5
6 * keyboard.c: Port to Cygwin (just added proper preprocessor tests).
7
8 * Makefile.in: Use @EXEEXT@ for Cygwin.
9
10 * mem-limits.h: Added ifdef to define BSD4_2 for Cygwin.
11
12 * s/cygwin.h: Added for Cygwin port.
13
12003-01-31 Juanma Barranquero <lektu@terra.es> 142003-01-31 Juanma Barranquero <lektu@terra.es>
2 15
3 * w32fns.c (DrawText): Kludge to avoid a redefinition on Windows 16 * w32fns.c (DrawText): Kludge to avoid a redefinition on Windows
diff --git a/src/Makefile.in b/src/Makefile.in
index 320b3e5874a..9f8e13c5a0f 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -525,7 +525,7 @@ LD=ld
525#endif /* not ORDINARY_LINK */ 525#endif /* not ORDINARY_LINK */
526 526
527/* Flags to pass to LD only for temacs. */ 527/* Flags to pass to LD only for temacs. */
528/* Don't split this line with a backslash. That can cause trouble with 528/* Don't split this line with a backslash. That can cause trouble with
529 some cpps. */ 529 some cpps. */
530TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE 530TEMACS_LDFLAGS = LD_SWITCH_SYSTEM LD_SWITCH_SYSTEM_TEMACS LD_SWITCH_MACHINE LD_SWITCH_MACHINE_TEMACS LD_SWITCH_SITE
531 531
@@ -887,12 +887,12 @@ LIBES = $(LOADLIBES) $(LIBS) $(LIBX) $(LIBSOUND) \
887#define OBJECTS_MACHINE 887#define OBJECTS_MACHINE
888#endif 888#endif
889 889
890all: emacs OTHER_FILES 890all: emacs@EXEEXT@ OTHER_FILES
891 891
892emacs: temacs ${etc}DOC ${lisp} 892emacs@EXEEXT@: temacs@EXEEXT@ ${etc}DOC ${lisp}
893#ifdef CANNOT_DUMP 893#ifdef CANNOT_DUMP
894 rm -f emacs 894 rm -f emacs@EXEEXT@
895 ln temacs emacs 895 ln temacs@EXEEXT@ emacs@EXEEXT@
896#else 896#else
897#ifdef HAVE_SHM 897#ifdef HAVE_SHM
898 LC_ALL=C ./temacs -nl -batch -l loadup dump 898 LC_ALL=C ./temacs -nl -batch -l loadup dump
@@ -915,15 +915,15 @@ ${etc}DOC: ${libsrc}make-docfile ${obj} ${shortlisp} ${SOME_MACHINE_LISP}
915 ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC 915 ${libsrc}make-docfile -d ${srcdir} ${SOME_MACHINE_OBJECTS} ${obj} > ${etc}DOC
916 ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp} 916 ${libsrc}make-docfile -a ${etc}DOC -d ${srcdir} ${SOME_MACHINE_LISP} ${shortlisp}
917 917
918${libsrc}make-docfile: 918${libsrc}make-docfile@EXEEXT@:
919 cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile 919 cd ${libsrc}; ${MAKE} ${MFLAGS} make-docfile@EXEEXT@
920 920
921/* Some systems define this to cause parallel Make-ing. */ 921/* Some systems define this to cause parallel Make-ing. */
922#ifndef MAKE_PARALLEL 922#ifndef MAKE_PARALLEL
923#define MAKE_PARALLEL 923#define MAKE_PARALLEL
924#endif 924#endif
925 925
926temacs: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args 926temacs@EXEEXT@: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj} OBJECTS_MACHINE prefix-args@EXEEXT@
927 $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \ 927 $(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${TEMACS_LDFLAGS}) $(LDFLAGS) \
928 -o temacs ${STARTFILES} ${obj} ${otherobj} \ 928 -o temacs ${STARTFILES} ${obj} ${otherobj} \
929 OBJECTS_MACHINE ${LIBES} 929 OBJECTS_MACHINE ${LIBES}
@@ -931,7 +931,7 @@ temacs: MAKE_PARALLEL $(LOCALCPP) $(STARTFILES) stamp-oldxmenu ${obj} ${otherobj
931/* We don't use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE 931/* We don't use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
932 often contain options that have to do with using Emacs's crt0, 932 often contain options that have to do with using Emacs's crt0,
933 which are only good with temacs. */ 933 which are only good with temacs. */
934prefix-args: prefix-args.c $(config_h) 934prefix-args@EXEEXT@: prefix-args.c $(config_h)
935 $(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args 935 $(CC) $(ALL_CFLAGS) $(LDFLAGS) ${srcdir}/prefix-args.c -o prefix-args
936 936
937/* Don't lose if this was not defined. */ 937/* Don't lose if this was not defined. */
@@ -950,7 +950,7 @@ prefix-args: prefix-args.c $(config_h)
950 to both ensure that lwlib gets remade based on its dependencies 950 to both ensure that lwlib gets remade based on its dependencies
951 in its own makefile, 951 in its own makefile,
952 and remake temacs if lwlib gets changed by this. */ 952 and remake temacs if lwlib gets changed by this. */
953stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU) 953stamp-oldxmenu: ${OLDXMENU} ../src/$(OLDXMENU)
954 touch stamp-oldxmenu 954 touch stamp-oldxmenu
955/* Supply an ordering for parallel make. */ 955/* Supply an ordering for parallel make. */
956../src/$(OLDXMENU): ${OLDXMENU} 956../src/$(OLDXMENU): ${OLDXMENU}
@@ -1253,25 +1253,25 @@ macosx-bundle: ${emacsapp}Contents/Resources/English.lproj \
1253 ${emacsapp}Contents/Resources/English.lproj/InfoPlist.strings 1253 ${emacsapp}Contents/Resources/English.lproj/InfoPlist.strings
1254macosx-app: macosx-bundle ${emacsapp}Contents/MacOS/Emacs \ 1254macosx-app: macosx-bundle ${emacsapp}Contents/MacOS/Emacs \
1255 ${emacsapp}Contents/Resources/Emacs.rsrc 1255 ${emacsapp}Contents/Resources/Emacs.rsrc
1256${emacsapp}Contents/MacOS/Emacs: emacs 1256${emacsapp}Contents/MacOS/Emacs: emacs@EXEEXT@
1257 mkdir -p ${emacsapp}Contents/MacOS/; 1257 mkdir -p ${emacsapp}Contents/MacOS/;
1258 cd ${emacsapp}Contents/MacOS/; cp ../../../../src/emacs Emacs 1258 cd ${emacsapp}Contents/MacOS/; cp ../../../../src/emacs@EXEEXT@ Emacs@EXEEXT@
1259${emacsapp}Contents/Resources/Emacs.rsrc: ../mac/src/Emacs.r 1259${emacsapp}Contents/Resources/Emacs.rsrc: ../mac/src/Emacs.r
1260 /Developer/Tools/Rez -useDF \ 1260 /Developer/Tools/Rez -useDF \
1261 -o ${emacsapp}Contents/Resources/Emacs.rsrc \ 1261 -o ${emacsapp}Contents/Resources/Emacs.rsrc \
1262 /System/Library/Frameworks/Carbon.framework/Headers/Carbon.r $< 1262 /System/Library/Frameworks/Carbon.framework/Headers/Carbon.r $<
1263#endif 1263#endif
1264 1264
1265${libsrc}emacstool: ${libsrc}emacstool.c 1265${libsrc}emacstool@EXEEXT@: ${libsrc}emacstool.c
1266 cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool 1266 cd ${libsrc}; ${MAKE} ${MFLAGS} emacstool@EXEEXT@
1267bootstrapclean: 1267bootstrapclean:
1268 rm -f bootstrap-emacs 1268 rm -f bootstrap-emacs@EXEEXT@
1269mostlyclean: 1269mostlyclean:
1270 rm -f temacs prefix-args core *.core \#* *.o libXMenu11.a liblw.a 1270 rm -f temacs@EXEEXT@ prefix-args@EXEEXT@ core *.core \#* *.o libXMenu11.a liblw.a
1271 rm -f ../etc/DOC 1271 rm -f ../etc/DOC
1272 rm -f bootstrap-emacs 1272 rm -f bootstrap-emacs@EXEEXT@
1273clean: mostlyclean 1273clean: mostlyclean
1274 rm -f emacs-* emacs 1274 rm -f emacs-*@EXEEXT@ emacs@EXEEXT@
1275/**/# This is used in making a distribution. 1275/**/# This is used in making a distribution.
1276/**/# Do not use it on development directories! 1276/**/# Do not use it on development directories!
1277distclean: clean 1277distclean: clean
@@ -1284,7 +1284,7 @@ maintainer-clean: distclean
1284 @echo "it deletes files that may require special tools to rebuild." 1284 @echo "it deletes files that may require special tools to rebuild."
1285 rm -f TAGS 1285 rm -f TAGS
1286versionclean: 1286versionclean:
1287 -rm -f emacs emacs-* ../etc/DOC* 1287 -rm -f emacs@EXEEXT@ emacs-* ../etc/DOC*
1288extraclean: distclean 1288extraclean: distclean
1289 -rm -f *~ \#* m/?*~ s/?*~ 1289 -rm -f *~ \#* m/?*~ s/?*~
1290 1290
@@ -1302,7 +1302,7 @@ relock:
1302/* Arrange to make a tags table TAGS-LISP for ../lisp, 1302/* Arrange to make a tags table TAGS-LISP for ../lisp,
1303 plus TAGS for the C files, which includes ../lisp/TAGS by reference. */ 1303 plus TAGS for the C files, which includes ../lisp/TAGS by reference. */
1304 1304
1305ctagsfiles1 = [xyzXYZ]*.[hc] 1305ctagsfiles1 = [xyzXYZ]*.[hc]
1306ctagsfiles2 = [a-wA-W]*.[hc] 1306ctagsfiles2 = [a-wA-W]*.[hc]
1307 1307
1308TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2) 1308TAGS: $(srcdir)/$(ctagsfiles1) $(srcdir)/$(ctagsfiles2)
@@ -1322,20 +1322,20 @@ tags: TAGS TAGS-LISP $(lwlibdir)TAGS
1322 1322
1323/* Bootstrapping. */ 1323/* Bootstrapping. */
1324 1324
1325bootstrap: bootstrap-emacs 1325bootstrap: bootstrap-emacs@EXEEXT@
1326 1326
1327/* Dump an Emacs executable named bootstrap-emacs containing the 1327/* Dump an Emacs executable named bootstrap-emacs containing the
1328 files from loadup.el in source form. */ 1328 files from loadup.el in source form. */
1329 1329
1330bootstrap-emacs: temacs 1330bootstrap-emacs@EXEEXT@: temacs@EXEEXT@
1331#ifdef CANNOT_DUMP 1331#ifdef CANNOT_DUMP
1332 ln temacs bootstrap-emacs 1332 ln temacs@EXEEXT@ bootstrap-emacs@EXEEXT@
1333#else 1333#else
1334#ifdef HAVE_SHM 1334#ifdef HAVE_SHM
1335 ./temacs -nl -batch -l loadup bootstrap 1335 ./temacs -nl -batch -l loadup bootstrap
1336#else /* ! defined (HAVE_SHM) */ 1336#else /* ! defined (HAVE_SHM) */
1337 ./temacs --batch --load loadup bootstrap 1337 ./temacs --batch --load loadup bootstrap
1338#endif /* ! defined (HAVE_SHM) */ 1338#endif /* ! defined (HAVE_SHM) */
1339 mv -f emacs@EXEEXT@ bootstrap-emacs@EXEEXT@
1339#endif /* ! defined (CANNOT_DUMP) */ 1340#endif /* ! defined (CANNOT_DUMP) */
1340 mv -f emacs bootstrap-emacs
1341 1341
diff --git a/src/fileio.c b/src/fileio.c
index b3fcda88e98..72c9faccddd 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -2052,13 +2052,13 @@ duplicates what `expand-file-name' does. */)
2052 for (p = nm; p != endp; p++) 2052 for (p = nm; p != endp; p++)
2053 { 2053 {
2054 if ((p[0] == '~' 2054 if ((p[0] == '~'
2055#if defined (APOLLO) || defined (WINDOWSNT) 2055#if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN)
2056 /* // at start of file name is meaningful in Apollo and 2056 /* // at start of file name is meaningful in Apollo,
2057 WindowsNT systems. */ 2057 WindowsNT and Cygwin systems. */
2058 || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm) 2058 || (IS_DIRECTORY_SEP (p[0]) && p - 1 != nm)
2059#else /* not (APOLLO || WINDOWSNT) */ 2059#else /* not (APOLLO || WINDOWSNT || CYGWIN) */
2060 || IS_DIRECTORY_SEP (p[0]) 2060 || IS_DIRECTORY_SEP (p[0])
2061#endif /* not (APOLLO || WINDOWSNT) */ 2061#endif /* not (APOLLO || WINDOWSNT || CYGWIN) */
2062 ) 2062 )
2063 && p != nm 2063 && p != nm
2064 && (0 2064 && (0
@@ -2230,11 +2230,11 @@ duplicates what `expand-file-name' does. */)
2230 2230
2231 for (p = xnm; p != x; p++) 2231 for (p = xnm; p != x; p++)
2232 if ((p[0] == '~' 2232 if ((p[0] == '~'
2233#if defined (APOLLO) || defined (WINDOWSNT) 2233#if defined (APOLLO) || defined (WINDOWSNT) || defined(CYGWIN)
2234 || (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm) 2234 || (IS_DIRECTORY_SEP (p[0]) && p - 1 != xnm)
2235#else /* not (APOLLO || WINDOWSNT) */ 2235#else /* not (APOLLO || WINDOWSNT || CYGWIN) */
2236 || IS_DIRECTORY_SEP (p[0]) 2236 || IS_DIRECTORY_SEP (p[0])
2237#endif /* not (APOLLO || WINDOWSNT) */ 2237#endif /* not (APOLLO || WINDOWSNT || CYGWIN) */
2238 ) 2238 )
2239 && p != xnm && IS_DIRECTORY_SEP (p[-1])) 2239 && p != xnm && IS_DIRECTORY_SEP (p[-1]))
2240 xnm = p; 2240 xnm = p;
@@ -6116,7 +6116,7 @@ provides a file dialog box. */)
6116 (NILP (predicate) ? Qfile_exists_p : predicate)); 6116 (NILP (predicate) ? Qfile_exists_p : predicate));
6117 6117
6118 GCPRO2 (insdef, default_filename); 6118 GCPRO2 (insdef, default_filename);
6119 6119
6120#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK) 6120#if defined (USE_MOTIF) || defined (HAVE_NTGUI) || defined (USE_GTK)
6121 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event)) 6121 if ((NILP (last_nonmenu_event) || CONSP (last_nonmenu_event))
6122 && use_dialog_box 6122 && use_dialog_box
diff --git a/src/keyboard.c b/src/keyboard.c
index dae9470f70c..279bdc60049 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -741,7 +741,7 @@ echo_char (c)
741 Lisp_Object echo_string; 741 Lisp_Object echo_string;
742 742
743 echo_string = current_kboard->echo_string; 743 echo_string = current_kboard->echo_string;
744 744
745 /* If someone has passed us a composite event, use its head symbol. */ 745 /* If someone has passed us a composite event, use its head symbol. */
746 c = EVENT_HEAD (c); 746 c = EVENT_HEAD (c);
747 747
@@ -753,7 +753,7 @@ echo_char (c)
753 { 753 {
754 Lisp_Object name = SYMBOL_NAME (c); 754 Lisp_Object name = SYMBOL_NAME (c);
755 int nbytes = SBYTES (name); 755 int nbytes = SBYTES (name);
756 756
757 if (size - (ptr - buffer) < nbytes) 757 if (size - (ptr - buffer) < nbytes)
758 { 758 {
759 int offset = ptr - buffer; 759 int offset = ptr - buffer;
@@ -771,7 +771,7 @@ echo_char (c)
771 { 771 {
772 const char *text = " (Type ? for further options)"; 772 const char *text = " (Type ? for further options)";
773 int len = strlen (text); 773 int len = strlen (text);
774 774
775 if (size - (ptr - buffer) < len) 775 if (size - (ptr - buffer) < len)
776 { 776 {
777 int offset = ptr - buffer; 777 int offset = ptr - buffer;
@@ -820,12 +820,12 @@ echo_dash ()
820 if (!current_kboard->immediate_echo 820 if (!current_kboard->immediate_echo
821 && SCHARS (current_kboard->echo_string) == 0) 821 && SCHARS (current_kboard->echo_string) == 0)
822 return; 822 return;
823 823
824 /* Do nothing if we just printed a prompt. */ 824 /* Do nothing if we just printed a prompt. */
825 if (current_kboard->echo_after_prompt 825 if (current_kboard->echo_after_prompt
826 == SCHARS (current_kboard->echo_string)) 826 == SCHARS (current_kboard->echo_string))
827 return; 827 return;
828 828
829 /* Put a dash at the end of the buffer temporarily, 829 /* Put a dash at the end of the buffer temporarily,
830 but make it go away when the next character is added. */ 830 but make it go away when the next character is added. */
831 current_kboard->echo_string = concat2 (current_kboard->echo_string, 831 current_kboard->echo_string = concat2 (current_kboard->echo_string,
@@ -1032,12 +1032,12 @@ recursive_edit_unwind (info)
1032{ 1032{
1033 if (BUFFERP (XCAR (info))) 1033 if (BUFFERP (XCAR (info)))
1034 Fset_buffer (XCAR (info)); 1034 Fset_buffer (XCAR (info));
1035 1035
1036 if (NILP (XCDR (info))) 1036 if (NILP (XCDR (info)))
1037 any_kboard_state (); 1037 any_kboard_state ();
1038 else 1038 else
1039 single_kboard_state (); 1039 single_kboard_state ();
1040 1040
1041 command_loop_level--; 1041 command_loop_level--;
1042 update_mode_lines = 1; 1042 update_mode_lines = 1;
1043 return Qnil; 1043 return Qnil;
@@ -1214,7 +1214,7 @@ cmd_error_internal (data, context)
1214 since they are asyncronous. */ 1214 since they are asyncronous. */
1215 if (EQ (XCAR (data), Qquit)) 1215 if (EQ (XCAR (data), Qquit))
1216 Vsignaling_function = Qnil; 1216 Vsignaling_function = Qnil;
1217 1217
1218 print_error_message (data, stream, context, Vsignaling_function); 1218 print_error_message (data, stream, context, Vsignaling_function);
1219 1219
1220 Vsignaling_function = Qnil; 1220 Vsignaling_function = Qnil;
@@ -1557,7 +1557,7 @@ command_loop_1 ()
1557 if the symbol is a local variable. */ 1557 if the symbol is a local variable. */
1558 if (!NILP (Vpre_command_hook) && !NILP (Vrun_hooks)) 1558 if (!NILP (Vpre_command_hook) && !NILP (Vrun_hooks))
1559 safe_run_hooks (Qpre_command_hook); 1559 safe_run_hooks (Qpre_command_hook);
1560 1560
1561 already_adjusted = 0; 1561 already_adjusted = 0;
1562 1562
1563 if (NILP (Vthis_command)) 1563 if (NILP (Vthis_command))
@@ -1663,7 +1663,7 @@ command_loop_1 ()
1663 } 1663 }
1664 nonundocount++; 1664 nonundocount++;
1665 } 1665 }
1666 1666
1667 lose = ((XFASTINT (XWINDOW (selected_window)->last_modified) 1667 lose = ((XFASTINT (XWINDOW (selected_window)->last_modified)
1668 < MODIFF) 1668 < MODIFF)
1669 || (XFASTINT (XWINDOW (selected_window)->last_overlay_modified) 1669 || (XFASTINT (XWINDOW (selected_window)->last_overlay_modified)
@@ -1676,7 +1676,7 @@ command_loop_1 ()
1676 || detect_input_pending () 1676 || detect_input_pending ()
1677 || !NILP (XWINDOW (selected_window)->column_number_displayed) 1677 || !NILP (XWINDOW (selected_window)->column_number_displayed)
1678 || !NILP (Vexecuting_macro)); 1678 || !NILP (Vexecuting_macro));
1679 1679
1680 value = internal_self_insert (c, 0); 1680 value = internal_self_insert (c, 0);
1681 1681
1682 if (value == 2) 1682 if (value == 2)
@@ -1887,7 +1887,7 @@ adjust_point_for_property (last_pt, modified)
1887 (make_number (beg), Qinvisible, Qnil, Qnil); 1887 (make_number (beg), Qinvisible, Qnil, Qnil);
1888 beg = NATNUMP (tmp) ? XFASTINT (tmp) : BEGV; 1888 beg = NATNUMP (tmp) ? XFASTINT (tmp) : BEGV;
1889 } 1889 }
1890 1890
1891 /* Move away from the inside area. */ 1891 /* Move away from the inside area. */
1892 if (beg < PT && end > PT) 1892 if (beg < PT && end > PT)
1893 { 1893 {
@@ -2011,7 +2011,7 @@ start_polling ()
2011 /* Turn alarm handling on unconditionally. It might have 2011 /* Turn alarm handling on unconditionally. It might have
2012 been turned off in process.c. */ 2012 been turned off in process.c. */
2013 turn_on_atimers (1); 2013 turn_on_atimers (1);
2014 2014
2015 /* If poll timer doesn't exist, are we need one with 2015 /* If poll timer doesn't exist, are we need one with
2016 a different interval, start a new one. */ 2016 a different interval, start a new one. */
2017 if (poll_timer == NULL 2017 if (poll_timer == NULL
@@ -2021,7 +2021,7 @@ start_polling ()
2021 2021
2022 if (poll_timer) 2022 if (poll_timer)
2023 cancel_atimer (poll_timer); 2023 cancel_atimer (poll_timer);
2024 2024
2025 EMACS_SET_SECS_USECS (interval, polling_period, 0); 2025 EMACS_SET_SECS_USECS (interval, polling_period, 0);
2026 poll_timer = start_atimer (ATIMER_CONTINUOUS, interval, 2026 poll_timer = start_atimer (ATIMER_CONTINUOUS, interval,
2027 poll_for_input, NULL); 2027 poll_for_input, NULL);
@@ -2182,7 +2182,7 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
2182 } 2182 }
2183 else 2183 else
2184 help = safe_eval (help); 2184 help = safe_eval (help);
2185 2185
2186 if (!STRINGP (help)) 2186 if (!STRINGP (help))
2187 return; 2187 return;
2188 } 2188 }
@@ -2205,7 +2205,7 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
2205 2205
2206 if (!help_echo_showing_p) 2206 if (!help_echo_showing_p)
2207 Vpre_help_message = current_message (); 2207 Vpre_help_message = current_message ();
2208 2208
2209 specbind (Qmessage_truncate_lines, Qt); 2209 specbind (Qmessage_truncate_lines, Qt);
2210 message3_nolog (help, SBYTES (help), 2210 message3_nolog (help, SBYTES (help),
2211 STRING_MULTIBYTE (help)); 2211 STRING_MULTIBYTE (help));
@@ -2221,7 +2221,7 @@ show_help_echo (help, window, object, pos, ok_to_overwrite_keystroke_echo)
2221 else 2221 else
2222 message (0); 2222 message (0);
2223 } 2223 }
2224 2224
2225 help_echo_showing_p = STRINGP (help); 2225 help_echo_showing_p = STRINGP (help);
2226 } 2226 }
2227} 2227}
@@ -2336,13 +2336,13 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2336 && EQ (XCDR (c), Qdisabled) 2336 && EQ (XCDR (c), Qdisabled)
2337 && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c)))) 2337 && (SYMBOLP (XCAR (c)) || INTEGERP (XCAR (c))))
2338 c = XCAR (c); 2338 c = XCAR (c);
2339 2339
2340 /* If the queued event is something that used the mouse, 2340 /* If the queued event is something that used the mouse,
2341 set used_mouse_menu accordingly. */ 2341 set used_mouse_menu accordingly. */
2342 if (used_mouse_menu 2342 if (used_mouse_menu
2343 && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar))) 2343 && (EQ (c, Qtool_bar) || EQ (c, Qmenu_bar)))
2344 *used_mouse_menu = 1; 2344 *used_mouse_menu = 1;
2345 2345
2346 reread = 1; 2346 reread = 1;
2347 goto reread_for_input_method; 2347 goto reread_for_input_method;
2348 } 2348 }
@@ -2439,7 +2439,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2439 } 2439 }
2440 2440
2441 /* Message turns off echoing unless more keystrokes turn it on again. 2441 /* Message turns off echoing unless more keystrokes turn it on again.
2442 2442
2443 The code in 20.x for the condition was 2443 The code in 20.x for the condition was
2444 2444
2445 1. echo_area_glyphs && *echo_area_glyphs 2445 1. echo_area_glyphs && *echo_area_glyphs
@@ -2447,10 +2447,10 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2447 3. && ok_to_echo_at_next_pause != echo_area_glyphs 2447 3. && ok_to_echo_at_next_pause != echo_area_glyphs
2448 2448
2449 (1) means there's a current message displayed 2449 (1) means there's a current message displayed
2450 2450
2451 (2) means it's not the message from echoing from the current 2451 (2) means it's not the message from echoing from the current
2452 kboard. 2452 kboard.
2453 2453
2454 (3) There's only one place in 20.x where ok_to_echo_at_next_pause 2454 (3) There's only one place in 20.x where ok_to_echo_at_next_pause
2455 is set to a non-null value. This is done in read_char and it is 2455 is set to a non-null value. This is done in read_char and it is
2456 set to echo_area_glyphs after a call to echo_char. That means 2456 set to echo_area_glyphs after a call to echo_char. That means
@@ -2462,7 +2462,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2462 must be either null, or the current message isn't from echoing at 2462 must be either null, or the current message isn't from echoing at
2463 all, or it's from echoing from a different kboard than the 2463 all, or it's from echoing from a different kboard than the
2464 current one. */ 2464 current one. */
2465 2465
2466 if (/* There currently is something in the echo area. */ 2466 if (/* There currently is something in the echo area. */
2467 !NILP (echo_area_buffer[0]) 2467 !NILP (echo_area_buffer[0])
2468 && (/* And it's either not from echoing. */ 2468 && (/* And it's either not from echoing. */
@@ -2474,7 +2474,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2474 cancel_echoing (); 2474 cancel_echoing ();
2475 else 2475 else
2476 echo_dash (); 2476 echo_dash ();
2477 2477
2478 /* Try reading a character via menu prompting in the minibuf. 2478 /* Try reading a character via menu prompting in the minibuf.
2479 Try this before the sit-for, because the sit-for 2479 Try this before the sit-for, because the sit-for
2480 would do the wrong thing if we are supposed to do 2480 would do the wrong thing if we are supposed to do
@@ -2549,7 +2549,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2549 /* If in middle of key sequence and minibuffer not active, 2549 /* If in middle of key sequence and minibuffer not active,
2550 start echoing if enough time elapses. */ 2550 start echoing if enough time elapses. */
2551 2551
2552 if (minibuf_level == 0 2552 if (minibuf_level == 0
2553 && !current_kboard->immediate_echo 2553 && !current_kboard->immediate_echo
2554 && this_command_key_count > 0 2554 && this_command_key_count > 0
2555 && ! noninteractive 2555 && ! noninteractive
@@ -2566,7 +2566,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2566 || (!echo_kboard && ok_to_echo_at_next_pause))) 2566 || (!echo_kboard && ok_to_echo_at_next_pause)))
2567 { 2567 {
2568 Lisp_Object tem0; 2568 Lisp_Object tem0;
2569 2569
2570 /* After a mouse event, start echoing right away. 2570 /* After a mouse event, start echoing right away.
2571 This is because we are probably about to display a menu, 2571 This is because we are probably about to display a menu,
2572 and we don't want to delay before doing so. */ 2572 and we don't want to delay before doing so. */
@@ -2930,7 +2930,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
2930 && (unsigned) XINT (c) != 127 2930 && (unsigned) XINT (c) != 127
2931 && (unsigned) XINT (c) < 256) 2931 && (unsigned) XINT (c) < 256)
2932 { 2932 {
2933 Lisp_Object keys; 2933 Lisp_Object keys;
2934 int key_count; 2934 int key_count;
2935 struct gcpro gcpro1; 2935 struct gcpro gcpro1;
2936 int count = SPECPDL_INDEX (); 2936 int count = SPECPDL_INDEX ();
@@ -3030,7 +3030,7 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu)
3030 timer_idleness_start_time = last_idle_start; 3030 timer_idleness_start_time = last_idle_start;
3031 goto retry; 3031 goto retry;
3032 } 3032 }
3033 3033
3034 if (this_command_key_count == 0 || ! reread) 3034 if (this_command_key_count == 0 || ! reread)
3035 { 3035 {
3036 before_command_key_count = this_command_key_count; 3036 before_command_key_count = this_command_key_count;
@@ -3162,19 +3162,19 @@ record_char (c)
3162 3162
3163 Lisp_Object ev1, ev2, ev3; 3163 Lisp_Object ev1, ev2, ev3;
3164 int ix1, ix2, ix3; 3164 int ix1, ix2, ix3;
3165 3165
3166 if ((ix1 = recent_keys_index - 1) < 0) 3166 if ((ix1 = recent_keys_index - 1) < 0)
3167 ix1 = NUM_RECENT_KEYS - 1; 3167 ix1 = NUM_RECENT_KEYS - 1;
3168 ev1 = AREF (recent_keys, ix1); 3168 ev1 = AREF (recent_keys, ix1);
3169 3169
3170 if ((ix2 = ix1 - 1) < 0) 3170 if ((ix2 = ix1 - 1) < 0)
3171 ix2 = NUM_RECENT_KEYS - 1; 3171 ix2 = NUM_RECENT_KEYS - 1;
3172 ev2 = AREF (recent_keys, ix2); 3172 ev2 = AREF (recent_keys, ix2);
3173 3173
3174 if ((ix3 = ix2 - 1) < 0) 3174 if ((ix3 = ix2 - 1) < 0)
3175 ix3 = NUM_RECENT_KEYS - 1; 3175 ix3 = NUM_RECENT_KEYS - 1;
3176 ev3 = AREF (recent_keys, ix3); 3176 ev3 = AREF (recent_keys, ix3);
3177 3177
3178 if (EQ (XCAR (c), Qhelp_echo)) 3178 if (EQ (XCAR (c), Qhelp_echo))
3179 { 3179 {
3180 /* Don't record `help-echo' in recent_keys unless it shows some help 3180 /* Don't record `help-echo' in recent_keys unless it shows some help
@@ -3245,7 +3245,7 @@ record_char (c)
3245 } 3245 }
3246 3246
3247 num_nonmacro_input_events++; 3247 num_nonmacro_input_events++;
3248 3248
3249 /* Write c to the dribble file. If c is a lispy event, write 3249 /* Write c to the dribble file. If c is a lispy event, write
3250 the event's symbol to the dribble file, in <brackets>. Bleaugh. 3250 the event's symbol to the dribble file, in <brackets>. Bleaugh.
3251 If you, dear reader, have a better idea, you've got the source. :-) */ 3251 If you, dear reader, have a better idea, you've got the source. :-) */
@@ -3560,7 +3560,7 @@ kbd_buffer_store_event (event)
3560 if (kbd_fetch_ptr - 1 != kbd_store_ptr) 3560 if (kbd_fetch_ptr - 1 != kbd_store_ptr)
3561 { 3561 {
3562 int idx; 3562 int idx;
3563 3563
3564#if 0 /* The SELECTION_REQUEST_EVENT case looks bogus, and it's error 3564#if 0 /* The SELECTION_REQUEST_EVENT case looks bogus, and it's error
3565 prone to assign individual members for other events, in case 3565 prone to assign individual members for other events, in case
3566 the input_event structure is changed. --2000-07-13, gerd. */ 3566 the input_event structure is changed. --2000-07-13, gerd. */
@@ -3684,7 +3684,7 @@ kbd_buffer_events_waiting (discard)
3684 int discard; 3684 int discard;
3685{ 3685{
3686 struct input_event *sp; 3686 struct input_event *sp;
3687 3687
3688 for (sp = kbd_fetch_ptr; 3688 for (sp = kbd_fetch_ptr;
3689 sp != kbd_store_ptr && sp->kind == NO_EVENT; 3689 sp != kbd_store_ptr && sp->kind == NO_EVENT;
3690 ++sp) 3690 ++sp)
@@ -3987,7 +3987,7 @@ kbd_buffer_get_event (kbp, used_mouse_menu)
3987 if (NILP (obj)) 3987 if (NILP (obj))
3988 { 3988 {
3989 obj = make_lispy_event (event); 3989 obj = make_lispy_event (event);
3990 3990
3991#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined(MAC_OS) \ 3991#if defined (USE_X_TOOLKIT) || defined (HAVE_NTGUI) || defined(MAC_OS) \
3992 || defined (USE_GTK) 3992 || defined (USE_GTK)
3993 /* If this was a menu selection, then set the flag to inhibit 3993 /* If this was a menu selection, then set the flag to inhibit
@@ -4318,7 +4318,7 @@ timer_check (do_it_now)
4318 difference = idle_timer_difference; 4318 difference = idle_timer_difference;
4319 } 4319 }
4320 vector = XVECTOR (chosen_timer)->contents; 4320 vector = XVECTOR (chosen_timer)->contents;
4321 4321
4322 /* If timer is ripe, run it if it hasn't been run. */ 4322 /* If timer is ripe, run it if it hasn't been run. */
4323 if (EMACS_TIME_NEG_P (difference) 4323 if (EMACS_TIME_NEG_P (difference)
4324 || (EMACS_SECS (difference) == 0 4324 || (EMACS_SECS (difference) == 0
@@ -4335,7 +4335,7 @@ timer_check (do_it_now)
4335 vector[0] = Qt; 4335 vector[0] = Qt;
4336 4336
4337 specbind (Qinhibit_quit, Qt); 4337 specbind (Qinhibit_quit, Qt);
4338 4338
4339 call1 (Qtimer_event_handler, chosen_timer); 4339 call1 (Qtimer_event_handler, chosen_timer);
4340 Vdeactivate_mark = old_deactivate_mark; 4340 Vdeactivate_mark = old_deactivate_mark;
4341 timers_run++; 4341 timers_run++;
@@ -4513,36 +4513,36 @@ static char *lispy_accent_keys[] =
4513char *lispy_function_keys[] = 4513char *lispy_function_keys[] =
4514 { 4514 {
4515 0, /* 0 */ 4515 0, /* 0 */
4516 4516
4517 0, /* VK_LBUTTON 0x01 */ 4517 0, /* VK_LBUTTON 0x01 */
4518 0, /* VK_RBUTTON 0x02 */ 4518 0, /* VK_RBUTTON 0x02 */
4519 "cancel", /* VK_CANCEL 0x03 */ 4519 "cancel", /* VK_CANCEL 0x03 */
4520 0, /* VK_MBUTTON 0x04 */ 4520 0, /* VK_MBUTTON 0x04 */
4521 4521
4522 0, 0, 0, /* 0x05 .. 0x07 */ 4522 0, 0, 0, /* 0x05 .. 0x07 */
4523 4523
4524 "backspace", /* VK_BACK 0x08 */ 4524 "backspace", /* VK_BACK 0x08 */
4525 "tab", /* VK_TAB 0x09 */ 4525 "tab", /* VK_TAB 0x09 */
4526 4526
4527 0, 0, /* 0x0A .. 0x0B */ 4527 0, 0, /* 0x0A .. 0x0B */
4528 4528
4529 "clear", /* VK_CLEAR 0x0C */ 4529 "clear", /* VK_CLEAR 0x0C */
4530 "return", /* VK_RETURN 0x0D */ 4530 "return", /* VK_RETURN 0x0D */
4531 4531
4532 0, 0, /* 0x0E .. 0x0F */ 4532 0, 0, /* 0x0E .. 0x0F */
4533 4533
4534 0, /* VK_SHIFT 0x10 */ 4534 0, /* VK_SHIFT 0x10 */
4535 0, /* VK_CONTROL 0x11 */ 4535 0, /* VK_CONTROL 0x11 */
4536 0, /* VK_MENU 0x12 */ 4536 0, /* VK_MENU 0x12 */
4537 "pause", /* VK_PAUSE 0x13 */ 4537 "pause", /* VK_PAUSE 0x13 */
4538 "capslock", /* VK_CAPITAL 0x14 */ 4538 "capslock", /* VK_CAPITAL 0x14 */
4539 4539
4540 0, 0, 0, 0, 0, 0, /* 0x15 .. 0x1A */ 4540 0, 0, 0, 0, 0, 0, /* 0x15 .. 0x1A */
4541 4541
4542 "escape", /* VK_ESCAPE 0x1B */ 4542 "escape", /* VK_ESCAPE 0x1B */
4543 4543
4544 0, 0, 0, 0, /* 0x1C .. 0x1F */ 4544 0, 0, 0, 0, /* 0x1C .. 0x1F */
4545 4545
4546 0, /* VK_SPACE 0x20 */ 4546 0, /* VK_SPACE 0x20 */
4547 "prior", /* VK_PRIOR 0x21 */ 4547 "prior", /* VK_PRIOR 0x21 */
4548 "next", /* VK_NEXT 0x22 */ 4548 "next", /* VK_NEXT 0x22 */
@@ -4559,25 +4559,25 @@ char *lispy_function_keys[] =
4559 "insert", /* VK_INSERT 0x2D */ 4559 "insert", /* VK_INSERT 0x2D */
4560 "delete", /* VK_DELETE 0x2E */ 4560 "delete", /* VK_DELETE 0x2E */
4561 "help", /* VK_HELP 0x2F */ 4561 "help", /* VK_HELP 0x2F */
4562 4562
4563 /* VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */ 4563 /* VK_0 thru VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */
4564 4564
4565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4565 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4566 4566
4567 0, 0, 0, 0, 0, 0, 0, /* 0x3A .. 0x40 */ 4567 0, 0, 0, 0, 0, 0, 0, /* 0x3A .. 0x40 */
4568 4568
4569 /* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */ 4569 /* VK_A thru VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */
4570 4570
4571 0, 0, 0, 0, 0, 0, 0, 0, 0, 4571 0, 0, 0, 0, 0, 0, 0, 0, 0,
4572 0, 0, 0, 0, 0, 0, 0, 0, 0, 4572 0, 0, 0, 0, 0, 0, 0, 0, 0,
4573 0, 0, 0, 0, 0, 0, 0, 0, 4573 0, 0, 0, 0, 0, 0, 0, 0,
4574 4574
4575 "lwindow", /* VK_LWIN 0x5B */ 4575 "lwindow", /* VK_LWIN 0x5B */
4576 "rwindow", /* VK_RWIN 0x5C */ 4576 "rwindow", /* VK_RWIN 0x5C */
4577 "apps", /* VK_APPS 0x5D */ 4577 "apps", /* VK_APPS 0x5D */
4578 4578
4579 0, 0, /* 0x5E .. 0x5F */ 4579 0, 0, /* 0x5E .. 0x5F */
4580 4580
4581 "kp-0", /* VK_NUMPAD0 0x60 */ 4581 "kp-0", /* VK_NUMPAD0 0x60 */
4582 "kp-1", /* VK_NUMPAD1 0x61 */ 4582 "kp-1", /* VK_NUMPAD1 0x61 */
4583 "kp-2", /* VK_NUMPAD2 0x62 */ 4583 "kp-2", /* VK_NUMPAD2 0x62 */
@@ -4618,13 +4618,13 @@ char *lispy_function_keys[] =
4618 "f22", /* VK_F22 0x85 */ 4618 "f22", /* VK_F22 0x85 */
4619 "f23", /* VK_F23 0x86 */ 4619 "f23", /* VK_F23 0x86 */
4620 "f24", /* VK_F24 0x87 */ 4620 "f24", /* VK_F24 0x87 */
4621 4621
4622 0, 0, 0, 0, /* 0x88 .. 0x8B */ 4622 0, 0, 0, 0, /* 0x88 .. 0x8B */
4623 0, 0, 0, 0, /* 0x8C .. 0x8F */ 4623 0, 0, 0, 0, /* 0x8C .. 0x8F */
4624 4624
4625 "kp-numlock", /* VK_NUMLOCK 0x90 */ 4625 "kp-numlock", /* VK_NUMLOCK 0x90 */
4626 "scroll", /* VK_SCROLL 0x91 */ 4626 "scroll", /* VK_SCROLL 0x91 */
4627 4627
4628 "kp-space", /* VK_NUMPAD_CLEAR 0x92 */ 4628 "kp-space", /* VK_NUMPAD_CLEAR 0x92 */
4629 "kp-enter", /* VK_NUMPAD_ENTER 0x93 */ 4629 "kp-enter", /* VK_NUMPAD_ENTER 0x93 */
4630 "kp-prior", /* VK_NUMPAD_PRIOR 0x94 */ 4630 "kp-prior", /* VK_NUMPAD_PRIOR 0x94 */
@@ -4646,17 +4646,17 @@ char *lispy_function_keys[] =
4646 * No other API or message will distinguish left and right keys this way. 4646 * No other API or message will distinguish left and right keys this way.
4647 */ 4647 */
4648 /* 0xA0 .. 0xEF */ 4648 /* 0xA0 .. 0xEF */
4649 4649
4650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4650 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4651 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4651 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4652 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4652 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4653 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4653 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4654 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4654 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
4655 4655
4656 /* 0xF0 .. 0xF5 */ 4656 /* 0xF0 .. 0xF5 */
4657 4657
4658 0, 0, 0, 0, 0, 0, 4658 0, 0, 0, 0, 0, 0,
4659 4659
4660 "attn", /* VK_ATTN 0xF6 */ 4660 "attn", /* VK_ATTN 0xF6 */
4661 "crsel", /* VK_CRSEL 0xF7 */ 4661 "crsel", /* VK_CRSEL 0xF7 */
4662 "exsel", /* VK_EXSEL 0xF8 */ 4662 "exsel", /* VK_EXSEL 0xF8 */
@@ -4689,7 +4689,7 @@ static char *lispy_kana_keys[] =
4689 0,0,0,0,0,0,0,0,0,0,0,0,0,0,"overline",0, 4689 0,0,0,0,0,0,0,0,0,0,0,0,0,0,"overline",0,
4690 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x480 .. 0x48f */ 4690 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x480 .. 0x48f */
4691 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x490 .. 0x49f */ 4691 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* 0x490 .. 0x49f */
4692 0, "kana-fullstop", "kana-openingbracket", "kana-closingbracket", 4692 0, "kana-fullstop", "kana-openingbracket", "kana-closingbracket",
4693 "kana-comma", "kana-conjunctive", "kana-WO", "kana-a", 4693 "kana-comma", "kana-conjunctive", "kana-WO", "kana-a",
4694 "kana-i", "kana-u", "kana-e", "kana-o", 4694 "kana-i", "kana-u", "kana-e", "kana-o",
4695 "kana-ya", "kana-yu", "kana-yo", "kana-tsu", 4695 "kana-ya", "kana-yu", "kana-yo", "kana-tsu",
@@ -4808,9 +4808,9 @@ static char *iso_lispy_function_keys[] =
4808 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe10 */ 4808 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe10 */
4809 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe18 */ 4809 0, 0, 0, 0, 0, 0, 0, 0, /* 0xfe18 */
4810 "iso-lefttab", /* 0xfe20 */ 4810 "iso-lefttab", /* 0xfe20 */
4811 "iso-move-line-up", "iso-move-line-down", 4811 "iso-move-line-up", "iso-move-line-down",
4812 "iso-partial-line-up", "iso-partial-line-down", 4812 "iso-partial-line-up", "iso-partial-line-down",
4813 "iso-partial-space-left", "iso-partial-space-right", 4813 "iso-partial-space-left", "iso-partial-space-right",
4814 "iso-set-margin-left", "iso-set-margin-right", /* 0xffe27, 28 */ 4814 "iso-set-margin-left", "iso-set-margin-right", /* 0xffe27, 28 */
4815 "iso-release-margin-left", "iso-release-margin-right", 4815 "iso-release-margin-left", "iso-release-margin-right",
4816 "iso-release-both-margins", 4816 "iso-release-both-margins",
@@ -4832,7 +4832,7 @@ Lisp_Object Vlispy_mouse_stem;
4832 which they operate, and a delta corresponding to the amount and 4832 which they operate, and a delta corresponding to the amount and
4833 direction that the wheel is rotated. Clicking the mouse-wheel 4833 direction that the wheel is rotated. Clicking the mouse-wheel
4834 generates a mouse-2 event. */ 4834 generates a mouse-2 event. */
4835static char *lispy_mouse_wheel_names[] = 4835static char *lispy_mouse_wheel_names[] =
4836{ 4836{
4837 "mouse-wheel" 4837 "mouse-wheel"
4838}; 4838};
@@ -5138,7 +5138,7 @@ make_lispy_event (event)
5138 the mouse that may have a `local-map' property. */ 5138 the mouse that may have a `local-map' property. */
5139 Lisp_Object string; 5139 Lisp_Object string;
5140 int charpos; 5140 int charpos;
5141 5141
5142 posn = part == 1 ? Qmode_line : Qheader_line; 5142 posn = part == 1 ? Qmode_line : Qheader_line;
5143 string = mode_line_string (w, wx, wy, part == 1, &charpos); 5143 string = mode_line_string (w, wx, wy, part == 1, &charpos);
5144 if (STRINGP (string)) 5144 if (STRINGP (string))
@@ -5203,7 +5203,7 @@ make_lispy_event (event)
5203 button + 1, Qnil); 5203 button + 1, Qnil);
5204 mouse_syms = larger_vector (mouse_syms, button + 1, Qnil); 5204 mouse_syms = larger_vector (mouse_syms, button + 1, Qnil);
5205 } 5205 }
5206 5206
5207 start_pos_ptr = &AREF (button_down_location, button); 5207 start_pos_ptr = &AREF (button_down_location, button);
5208 start_pos = *start_pos_ptr; 5208 start_pos = *start_pos_ptr;
5209 *start_pos_ptr = Qnil; 5209 *start_pos_ptr = Qnil;
@@ -5236,7 +5236,7 @@ make_lispy_event (event)
5236 && ((int)(event->timestamp - button_down_time) 5236 && ((int)(event->timestamp - button_down_time)
5237 < XINT (Vdouble_click_time))))); 5237 < XINT (Vdouble_click_time)))));
5238 } 5238 }
5239 5239
5240 last_mouse_button = button; 5240 last_mouse_button = button;
5241 last_mouse_x = XINT (event->x); 5241 last_mouse_x = XINT (event->x);
5242 last_mouse_y = XINT (event->y); 5242 last_mouse_y = XINT (event->y);
@@ -5301,7 +5301,7 @@ make_lispy_event (event)
5301 button_down_time = 0; 5301 button_down_time = 0;
5302 event->modifiers |= drag_modifier; 5302 event->modifiers |= drag_modifier;
5303 } 5303 }
5304 5304
5305 /* Don't check is_double; treat this as multiple 5305 /* Don't check is_double; treat this as multiple
5306 if the down-event was multiple. */ 5306 if the down-event was multiple. */
5307 if (double_click_count > 1) 5307 if (double_click_count > 1)
@@ -5360,7 +5360,7 @@ make_lispy_event (event)
5360 The incoming input_event contains in its `part' member an 5360 The incoming input_event contains in its `part' member an
5361 index of type `enum scroll_bar_part' which we can use as an 5361 index of type `enum scroll_bar_part' which we can use as an
5362 index in scroll_bar_parts to get the appropriate symbol. */ 5362 index in scroll_bar_parts to get the appropriate symbol. */
5363 5363
5364 case SCROLL_BAR_CLICK_EVENT: 5364 case SCROLL_BAR_CLICK_EVENT:
5365 { 5365 {
5366 Lisp_Object position, head, window, portion_whole, part; 5366 Lisp_Object position, head, window, portion_whole, part;
@@ -5389,7 +5389,7 @@ make_lispy_event (event)
5389 XVECTOR (mouse_syms)->size); 5389 XVECTOR (mouse_syms)->size);
5390 return Fcons (head, Fcons (position, Qnil)); 5390 return Fcons (head, Fcons (position, Qnil));
5391 } 5391 }
5392 5392
5393#endif /* USE_TOOLKIT_SCROLL_BARS */ 5393#endif /* USE_TOOLKIT_SCROLL_BARS */
5394 5394
5395#ifdef WINDOWSNT 5395#ifdef WINDOWSNT
@@ -5427,7 +5427,7 @@ make_lispy_event (event)
5427 5427
5428 head = modify_event_symbol (button, 5428 head = modify_event_symbol (button,
5429 event->modifiers, 5429 event->modifiers,
5430 Qmouse_click, 5430 Qmouse_click,
5431 Vlispy_mouse_stem, 5431 Vlispy_mouse_stem,
5432 NULL, &mouse_syms, 5432 NULL, &mouse_syms,
5433 XVECTOR (mouse_syms)->size); 5433 XVECTOR (mouse_syms)->size);
@@ -5617,10 +5617,10 @@ make_lispy_event (event)
5617 case USER_SIGNAL_EVENT: 5617 case USER_SIGNAL_EVENT:
5618 /* A user signal. */ 5618 /* A user signal. */
5619 return *lispy_user_signals[event->code]; 5619 return *lispy_user_signals[event->code];
5620 5620
5621 case SAVE_SESSION_EVENT: 5621 case SAVE_SESSION_EVENT:
5622 return Qsave_session; 5622 return Qsave_session;
5623 5623
5624 /* The 'kind' field of the event is something we don't recognize. */ 5624 /* The 'kind' field of the event is something we don't recognize. */
5625 default: 5625 default:
5626 abort (); 5626 abort ();
@@ -5670,13 +5670,13 @@ make_lispy_movement (frame, bar_window, part, x, y, time)
5670 { 5670 {
5671 struct window *w = XWINDOW (window); 5671 struct window *w = XWINDOW (window);
5672 int wx, wy; 5672 int wx, wy;
5673 5673
5674 /* Get window relative coordinates. */ 5674 /* Get window relative coordinates. */
5675 wx = FRAME_TO_WINDOW_PIXEL_X (w, XINT (x)); 5675 wx = FRAME_TO_WINDOW_PIXEL_X (w, XINT (x));
5676 wy = FRAME_TO_WINDOW_PIXEL_Y (w, XINT (y)); 5676 wy = FRAME_TO_WINDOW_PIXEL_Y (w, XINT (y));
5677 XSETINT (x, wx); 5677 XSETINT (x, wx);
5678 XSETINT (y, wy); 5678 XSETINT (y, wy);
5679 5679
5680 if (area == 1) 5680 if (area == 1)
5681 posn = Qmode_line; 5681 posn = Qmode_line;
5682 else if (area == 2) 5682 else if (area == 2)
@@ -6518,7 +6518,7 @@ read_avail_input (expected)
6518 if (n_to_read > sizeof cbuf) 6518 if (n_to_read > sizeof cbuf)
6519 n_to_read = sizeof cbuf; 6519 n_to_read = sizeof cbuf;
6520#else /* no FIONREAD */ 6520#else /* no FIONREAD */
6521#if defined (USG) || defined (DGUX) 6521#if defined (USG) || defined (DGUX) || defined(CYGWIN)
6522 /* Read some input if available, but don't wait. */ 6522 /* Read some input if available, but don't wait. */
6523 n_to_read = sizeof cbuf; 6523 n_to_read = sizeof cbuf;
6524 fcntl (input_fd, F_SETFL, O_NDELAY); 6524 fcntl (input_fd, F_SETFL, O_NDELAY);
@@ -6575,9 +6575,9 @@ read_avail_input (expected)
6575 ); 6575 );
6576 6576
6577#ifndef FIONREAD 6577#ifndef FIONREAD
6578#if defined (USG) || defined (DGUX) 6578#if defined (USG) || defined (DGUX) || defined (CYGWIN)
6579 fcntl (input_fd, F_SETFL, 0); 6579 fcntl (input_fd, F_SETFL, 0);
6580#endif /* USG or DGUX */ 6580#endif /* USG or DGUX or CYGWIN */
6581#endif /* no FIONREAD */ 6581#endif /* no FIONREAD */
6582 for (i = 0; i < nread; i++) 6582 for (i = 0; i < nread; i++)
6583 { 6583 {
@@ -6963,7 +6963,7 @@ menu_item_eval_property_1 (arg)
6963 return Qnil; 6963 return Qnil;
6964} 6964}
6965 6965
6966/* Evaluate an expression and return the result (or nil if something 6966/* Evaluate an expression and return the result (or nil if something
6967 went wrong). Used to evaluate dynamic parts of menu items. */ 6967 went wrong). Used to evaluate dynamic parts of menu items. */
6968Lisp_Object 6968Lisp_Object
6969menu_item_eval_property (sexpr) 6969menu_item_eval_property (sexpr)
@@ -7016,7 +7016,7 @@ parse_menu_item (item, notreal, inmenubar)
7016 for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++) 7016 for (i = ITEM_PROPERTY_DEF; i < ITEM_PROPERTY_ENABLE; i++)
7017 AREF (item_properties, i) = Qnil; 7017 AREF (item_properties, i) = Qnil;
7018 AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt; 7018 AREF (item_properties, ITEM_PROPERTY_ENABLE) = Qt;
7019 7019
7020 /* Save the item here to protect it from GC. */ 7020 /* Save the item here to protect it from GC. */
7021 AREF (item_properties, ITEM_PROPERTY_ITEM) = item; 7021 AREF (item_properties, ITEM_PROPERTY_ITEM) = item;
7022 7022
@@ -7036,7 +7036,7 @@ parse_menu_item (item, notreal, inmenubar)
7036 start = item; 7036 start = item;
7037 item = XCDR (item); 7037 item = XCDR (item);
7038 } 7038 }
7039 7039
7040 /* Maybe key binding cache. */ 7040 /* Maybe key binding cache. */
7041 if (CONSP (item) && CONSP (XCAR (item)) 7041 if (CONSP (item) && CONSP (XCAR (item))
7042 && (NILP (XCAR (XCAR (item))) 7042 && (NILP (XCAR (XCAR (item)))
@@ -7045,7 +7045,7 @@ parse_menu_item (item, notreal, inmenubar)
7045 cachelist = XCAR (item); 7045 cachelist = XCAR (item);
7046 item = XCDR (item); 7046 item = XCDR (item);
7047 } 7047 }
7048 7048
7049 /* This is the real definition--the function to run. */ 7049 /* This is the real definition--the function to run. */
7050 AREF (item_properties, ITEM_PROPERTY_DEF) = item; 7050 AREF (item_properties, ITEM_PROPERTY_DEF) = item;
7051 7051
@@ -7141,7 +7141,7 @@ parse_menu_item (item, notreal, inmenubar)
7141 return 0; 7141 return 0;
7142 AREF (item_properties, ITEM_PROPERTY_NAME) = item_string; 7142 AREF (item_properties, ITEM_PROPERTY_NAME) = item_string;
7143 } 7143 }
7144 7144
7145 /* If got a filter apply it on definition. */ 7145 /* If got a filter apply it on definition. */
7146 def = AREF (item_properties, ITEM_PROPERTY_DEF); 7146 def = AREF (item_properties, ITEM_PROPERTY_DEF);
7147 if (!NILP (filter)) 7147 if (!NILP (filter))
@@ -7169,7 +7169,7 @@ parse_menu_item (item, notreal, inmenubar)
7169 is OK in a submenu but not in the menubar. */ 7169 is OK in a submenu but not in the menubar. */
7170 if (NILP (def)) 7170 if (NILP (def))
7171 return (inmenubar ? 0 : 1); 7171 return (inmenubar ? 0 : 1);
7172 7172
7173 /* See if this is a separate pane or a submenu. */ 7173 /* See if this is a separate pane or a submenu. */
7174 def = AREF (item_properties, ITEM_PROPERTY_DEF); 7174 def = AREF (item_properties, ITEM_PROPERTY_DEF);
7175 tem = get_keymap (def, 0, 1); 7175 tem = get_keymap (def, 0, 1);
@@ -7180,7 +7180,7 @@ parse_menu_item (item, notreal, inmenubar)
7180 AREF (item_properties, ITEM_PROPERTY_DEF) = tem; 7180 AREF (item_properties, ITEM_PROPERTY_DEF) = tem;
7181 return 1; 7181 return 1;
7182 } 7182 }
7183 7183
7184 /* At the top level in the menu bar, do likewise for commands also. 7184 /* At the top level in the menu bar, do likewise for commands also.
7185 The menu bar does not display equivalent key bindings anyway. 7185 The menu bar does not display equivalent key bindings anyway.
7186 ITEM_PROPERTY_DEF is already set up properly. */ 7186 ITEM_PROPERTY_DEF is already set up properly. */
@@ -7207,7 +7207,7 @@ parse_menu_item (item, notreal, inmenubar)
7207 XSETCAR (cachelist, Qt); 7207 XSETCAR (cachelist, Qt);
7208 } 7208 }
7209 } 7209 }
7210 7210
7211 tem = XCAR (cachelist); 7211 tem = XCAR (cachelist);
7212 if (!EQ (tem, Qt)) 7212 if (!EQ (tem, Qt))
7213 { 7213 {
@@ -7315,7 +7315,7 @@ parse_menu_item (item, notreal, inmenubar)
7315 } 7315 }
7316 */ 7316 */
7317 7317
7318 /* Handle radio buttons or toggle boxes. */ 7318 /* Handle radio buttons or toggle boxes. */
7319 tem = AREF (item_properties, ITEM_PROPERTY_SELECTED); 7319 tem = AREF (item_properties, ITEM_PROPERTY_SELECTED);
7320 if (!NILP (tem)) 7320 if (!NILP (tem))
7321 AREF (item_properties, ITEM_PROPERTY_SELECTED) 7321 AREF (item_properties, ITEM_PROPERTY_SELECTED)
@@ -7382,13 +7382,13 @@ tool_bar_items (reuse, nitems)
7382 avoids risk of specpdl overflow. */ 7382 avoids risk of specpdl overflow. */
7383 oquit = Vinhibit_quit; 7383 oquit = Vinhibit_quit;
7384 Vinhibit_quit = Qt; 7384 Vinhibit_quit = Qt;
7385 7385
7386 /* Initialize tool_bar_items_vector and protect it from GC. */ 7386 /* Initialize tool_bar_items_vector and protect it from GC. */
7387 init_tool_bar_items (reuse); 7387 init_tool_bar_items (reuse);
7388 7388
7389 /* Build list of keymaps in maps. Set nmaps to the number of maps 7389 /* Build list of keymaps in maps. Set nmaps to the number of maps
7390 to process. */ 7390 to process. */
7391 7391
7392 /* Should overriding-terminal-local-map and overriding-local-map apply? */ 7392 /* Should overriding-terminal-local-map and overriding-local-map apply? */
7393 if (!NILP (Voverriding_local_map_menu_flag)) 7393 if (!NILP (Voverriding_local_map_menu_flag))
7394 { 7394 {
@@ -7433,7 +7433,7 @@ tool_bar_items (reuse, nitems)
7433 if (CONSP (keymap)) 7433 if (CONSP (keymap))
7434 { 7434 {
7435 Lisp_Object tail; 7435 Lisp_Object tail;
7436 7436
7437 /* KEYMAP is a list `(keymap (KEY . BINDING) ...)'. */ 7437 /* KEYMAP is a list `(keymap (KEY . BINDING) ...)'. */
7438 for (tail = keymap; CONSP (tail); tail = XCDR (tail)) 7438 for (tail = keymap; CONSP (tail); tail = XCDR (tail))
7439 { 7439 {
@@ -7471,7 +7471,7 @@ process_tool_bar_item (key, def)
7471 for (i = 0; i < ntool_bar_items; i += TOOL_BAR_ITEM_NSLOTS) 7471 for (i = 0; i < ntool_bar_items; i += TOOL_BAR_ITEM_NSLOTS)
7472 { 7472 {
7473 Lisp_Object *v = XVECTOR (tool_bar_items_vector)->contents + i; 7473 Lisp_Object *v = XVECTOR (tool_bar_items_vector)->contents + i;
7474 7474
7475 if (EQ (key, v[TOOL_BAR_ITEM_KEY])) 7475 if (EQ (key, v[TOOL_BAR_ITEM_KEY]))
7476 { 7476 {
7477 if (ntool_bar_items > i + TOOL_BAR_ITEM_NSLOTS) 7477 if (ntool_bar_items > i + TOOL_BAR_ITEM_NSLOTS)
@@ -7497,41 +7497,41 @@ process_tool_bar_item (key, def)
7497 invalid. 7497 invalid.
7498 7498
7499 ITEM is a list `(menu-item CAPTION BINDING PROPS...)'. 7499 ITEM is a list `(menu-item CAPTION BINDING PROPS...)'.
7500 7500
7501 CAPTION is the caption of the item, If it's not a string, it is 7501 CAPTION is the caption of the item, If it's not a string, it is
7502 evaluated to get a string. 7502 evaluated to get a string.
7503 7503
7504 BINDING is the tool bar item's binding. Tool-bar items with keymaps 7504 BINDING is the tool bar item's binding. Tool-bar items with keymaps
7505 as binding are currently ignored. 7505 as binding are currently ignored.
7506 7506
7507 The following properties are recognized: 7507 The following properties are recognized:
7508 7508
7509 - `:enable FORM'. 7509 - `:enable FORM'.
7510 7510
7511 FORM is evaluated and specifies whether the tool bar item is 7511 FORM is evaluated and specifies whether the tool bar item is
7512 enabled or disabled. 7512 enabled or disabled.
7513 7513
7514 - `:visible FORM' 7514 - `:visible FORM'
7515 7515
7516 FORM is evaluated and specifies whether the tool bar item is visible. 7516 FORM is evaluated and specifies whether the tool bar item is visible.
7517 7517
7518 - `:filter FUNCTION' 7518 - `:filter FUNCTION'
7519 7519
7520 FUNCTION is invoked with one parameter `(quote BINDING)'. Its 7520 FUNCTION is invoked with one parameter `(quote BINDING)'. Its
7521 result is stored as the new binding. 7521 result is stored as the new binding.
7522 7522
7523 - `:button (TYPE SELECTED)' 7523 - `:button (TYPE SELECTED)'
7524 7524
7525 TYPE must be one of `:radio' or `:toggle'. SELECTED is evaluated 7525 TYPE must be one of `:radio' or `:toggle'. SELECTED is evaluated
7526 and specifies whether the button is selected (pressed) or not. 7526 and specifies whether the button is selected (pressed) or not.
7527 7527
7528 - `:image IMAGES' 7528 - `:image IMAGES'
7529 7529
7530 IMAGES is either a single image specification or a vector of four 7530 IMAGES is either a single image specification or a vector of four
7531 image specifications. See enum tool_bar_item_images. 7531 image specifications. See enum tool_bar_item_images.
7532 7532
7533 - `:help HELP-STRING'. 7533 - `:help HELP-STRING'.
7534 7534
7535 Gives a help string to display for the tool bar item. */ 7535 Gives a help string to display for the tool bar item. */
7536 7536
7537static int 7537static int
@@ -7565,11 +7565,11 @@ parse_tool_bar_item (key, item)
7565 else 7565 else
7566 tool_bar_item_properties 7566 tool_bar_item_properties
7567 = Fmake_vector (make_number (TOOL_BAR_ITEM_NSLOTS), Qnil); 7567 = Fmake_vector (make_number (TOOL_BAR_ITEM_NSLOTS), Qnil);
7568 7568
7569 /* Set defaults. */ 7569 /* Set defaults. */
7570 PROP (TOOL_BAR_ITEM_KEY) = key; 7570 PROP (TOOL_BAR_ITEM_KEY) = key;
7571 PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt; 7571 PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt;
7572 7572
7573 /* Get the caption of the item. If the caption is not a string, 7573 /* Get the caption of the item. If the caption is not a string,
7574 evaluate it to get a string. If we don't get a string, skip this 7574 evaluate it to get a string. If we don't get a string, skip this
7575 item. */ 7575 item. */
@@ -7656,13 +7656,13 @@ parse_tool_bar_item (key, item)
7656 PROP (TOOL_BAR_ITEM_ENABLED_P) 7656 PROP (TOOL_BAR_ITEM_ENABLED_P)
7657 = menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P)); 7657 = menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P));
7658 7658
7659 /* Handle radio buttons or toggle boxes. */ 7659 /* Handle radio buttons or toggle boxes. */
7660 if (!NILP (PROP (TOOL_BAR_ITEM_SELECTED_P))) 7660 if (!NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)))
7661 PROP (TOOL_BAR_ITEM_SELECTED_P) 7661 PROP (TOOL_BAR_ITEM_SELECTED_P)
7662 = menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P)); 7662 = menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P));
7663 7663
7664 return 1; 7664 return 1;
7665 7665
7666#undef PROP 7666#undef PROP
7667} 7667}
7668 7668
@@ -7689,7 +7689,7 @@ static void
7689append_tool_bar_item () 7689append_tool_bar_item ()
7690{ 7690{
7691 Lisp_Object *to, *from; 7691 Lisp_Object *to, *from;
7692 7692
7693 /* Enlarge tool_bar_items_vector if necessary. */ 7693 /* Enlarge tool_bar_items_vector if necessary. */
7694 if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS 7694 if (ntool_bar_items + TOOL_BAR_ITEM_NSLOTS
7695 >= XVECTOR (tool_bar_items_vector)->size) 7695 >= XVECTOR (tool_bar_items_vector)->size)
@@ -7991,7 +7991,7 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
7991 tem = build_string (NILP (selected) ? "[X] " : "[ ] "); 7991 tem = build_string (NILP (selected) ? "[X] " : "[ ] ");
7992 s = concat2 (tem, s); 7992 s = concat2 (tem, s);
7993 } 7993 }
7994 7994
7995 7995
7996 /* If we have room for the prompt string, add it to this line. 7996 /* If we have room for the prompt string, add it to this line.
7997 If this is the first on the line, always add it. */ 7997 If this is the first on the line, always add it. */
@@ -8054,7 +8054,7 @@ read_char_minibuf_menu_prompt (commandflag, nmaps, maps)
8054 } 8054 }
8055 8055
8056 /* Prompt with that and read response. */ 8056 /* Prompt with that and read response. */
8057 message2_nolog (menu, strlen (menu), 8057 message2_nolog (menu, strlen (menu),
8058 ! NILP (current_buffer->enable_multibyte_characters)); 8058 ! NILP (current_buffer->enable_multibyte_characters));
8059 8059
8060 /* Make believe its not a keyboard macro in case the help char 8060 /* Make believe its not a keyboard macro in case the help char
@@ -8691,7 +8691,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
8691 orig_keymap = get_local_map (PT, current_buffer, Qkeymap); 8691 orig_keymap = get_local_map (PT, current_buffer, Qkeymap);
8692 goto replay_sequence; 8692 goto replay_sequence;
8693 } 8693 }
8694 8694
8695 /* For a mouse click, get the local text-property keymap 8695 /* For a mouse click, get the local text-property keymap
8696 of the place clicked on, rather than point. */ 8696 of the place clicked on, rather than point. */
8697 if (last_real_key_start == 0 8697 if (last_real_key_start == 0
@@ -8702,7 +8702,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
8702 8702
8703 localized_local_map = 1; 8703 localized_local_map = 1;
8704 start = EVENT_START (key); 8704 start = EVENT_START (key);
8705 8705
8706 if (CONSP (start) && CONSP (XCDR (start))) 8706 if (CONSP (start) && CONSP (XCDR (start)))
8707 { 8707 {
8708 pos = POSN_BUFFER_POSN (start); 8708 pos = POSN_BUFFER_POSN (start);
@@ -8741,7 +8741,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
8741 { 8741 {
8742 if (t + 1 >= bufsize) 8742 if (t + 1 >= bufsize)
8743 error ("Key sequence too long"); 8743 error ("Key sequence too long");
8744 8744
8745 keybuf[t] = posn; 8745 keybuf[t] = posn;
8746 keybuf[t + 1] = key; 8746 keybuf[t + 1] = key;
8747 mock_input = t + 2; 8747 mock_input = t + 2;
@@ -8863,7 +8863,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
8863 else 8863 else
8864 { 8864 {
8865 Lisp_Object head; 8865 Lisp_Object head;
8866 8866
8867 /* Remember the position to put an upper bound on fkey.start. */ 8867 /* Remember the position to put an upper bound on fkey.start. */
8868 first_unbound = min (t, first_unbound); 8868 first_unbound = min (t, first_unbound);
8869 8869
@@ -9141,7 +9141,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9141 && (!NILP (Farrayp (XSYMBOL (next)->function)) 9141 && (!NILP (Farrayp (XSYMBOL (next)->function))
9142 || KEYMAPP (XSYMBOL (next)->function))) 9142 || KEYMAPP (XSYMBOL (next)->function)))
9143 next = XSYMBOL (next)->function; 9143 next = XSYMBOL (next)->function;
9144 9144
9145 /* If the key translation map gives a function, not an 9145 /* If the key translation map gives a function, not an
9146 array, then call the function with one arg and use 9146 array, then call the function with one arg and use
9147 its value instead. */ 9147 its value instead. */
@@ -9305,7 +9305,7 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last,
9305 add_command_key (keybuf[t]); 9305 add_command_key (keybuf[t]);
9306 } 9306 }
9307 9307
9308 9308
9309 9309
9310 UNGCPRO; 9310 UNGCPRO;
9311 return t; 9311 return t;
@@ -9899,7 +9899,7 @@ KEEP-RECORD is non-nil. */)
9899 Lisp_Object keep_record; 9899 Lisp_Object keep_record;
9900{ 9900{
9901 int i; 9901 int i;
9902 9902
9903 this_command_key_count = 0; 9903 this_command_key_count = 0;
9904 9904
9905 if (NILP (keep_record)) 9905 if (NILP (keep_record))
@@ -10048,25 +10048,25 @@ stuff_buffered_input (stuffstring)
10048 stuff_char (*p++); 10048 stuff_char (*p++);
10049 stuff_char ('\n'); 10049 stuff_char ('\n');
10050 } 10050 }
10051 10051
10052 /* Anything we have read ahead, put back for the shell to read. */ 10052 /* Anything we have read ahead, put back for the shell to read. */
10053 /* ?? What should this do when we have multiple keyboards?? 10053 /* ?? What should this do when we have multiple keyboards??
10054 Should we ignore anything that was typed in at the "wrong" kboard? */ 10054 Should we ignore anything that was typed in at the "wrong" kboard? */
10055 for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++) 10055 for (; kbd_fetch_ptr != kbd_store_ptr; kbd_fetch_ptr++)
10056 { 10056 {
10057 int idx; 10057 int idx;
10058 10058
10059 if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE) 10059 if (kbd_fetch_ptr == kbd_buffer + KBD_BUFFER_SIZE)
10060 kbd_fetch_ptr = kbd_buffer; 10060 kbd_fetch_ptr = kbd_buffer;
10061 if (kbd_fetch_ptr->kind == ASCII_KEYSTROKE_EVENT) 10061 if (kbd_fetch_ptr->kind == ASCII_KEYSTROKE_EVENT)
10062 stuff_char (kbd_fetch_ptr->code); 10062 stuff_char (kbd_fetch_ptr->code);
10063 10063
10064 kbd_fetch_ptr->kind = NO_EVENT; 10064 kbd_fetch_ptr->kind = NO_EVENT;
10065 idx = 2 * (kbd_fetch_ptr - kbd_buffer); 10065 idx = 2 * (kbd_fetch_ptr - kbd_buffer);
10066 ASET (kbd_buffer_gcpro, idx, Qnil); 10066 ASET (kbd_buffer_gcpro, idx, Qnil);
10067 ASET (kbd_buffer_gcpro, idx + 1, Qnil); 10067 ASET (kbd_buffer_gcpro, idx + 1, Qnil);
10068 } 10068 }
10069 10069
10070 input_pending = 0; 10070 input_pending = 0;
10071#endif 10071#endif
10072#endif /* BSD_SYSTEM and not BSD4_1 */ 10072#endif /* BSD_SYSTEM and not BSD4_1 */
@@ -10096,7 +10096,7 @@ clear_waiting_for_input ()
10096} 10096}
10097 10097
10098/* This routine is called at interrupt level in response to C-g. 10098/* This routine is called at interrupt level in response to C-g.
10099 10099
10100 If interrupt_input, this is the handler for SIGINT. Otherwise, it 10100 If interrupt_input, this is the handler for SIGINT. Otherwise, it
10101 is called from kbd_buffer_store_event, in handling SIGIO or 10101 is called from kbd_buffer_store_event, in handling SIGIO or
10102 SIGTINT. 10102 SIGTINT.
@@ -10186,7 +10186,7 @@ interrupt_signal (signalnum) /* If we don't have an argument, */
10186 } 10186 }
10187 while (c != '\n') c = getchar (); 10187 while (c != '\n') c = getchar ();
10188 } 10188 }
10189 else 10189 else
10190 { 10190 {
10191 /* During GC, it must be safe to reenable quitting again. */ 10191 /* During GC, it must be safe to reenable quitting again. */
10192 Vinhibit_quit = Qnil; 10192 Vinhibit_quit = Qnil;
@@ -10428,7 +10428,7 @@ delete_kboard (kb)
10428 KBOARD *kb; 10428 KBOARD *kb;
10429{ 10429{
10430 KBOARD **kbp; 10430 KBOARD **kbp;
10431 10431
10432 for (kbp = &all_kboards; *kbp != kb; kbp = &(*kbp)->next_kboard) 10432 for (kbp = &all_kboards; *kbp != kb; kbp = &(*kbp)->next_kboard)
10433 if (*kbp == NULL) 10433 if (*kbp == NULL)
10434 abort (); 10434 abort ();
@@ -10443,7 +10443,7 @@ delete_kboard (kb)
10443 if (current_kboard == kb) 10443 if (current_kboard == kb)
10444 abort (); 10444 abort ();
10445 } 10445 }
10446 10446
10447 wipe_kboard (kb); 10447 wipe_kboard (kb);
10448 xfree (kb); 10448 xfree (kb);
10449} 10449}
@@ -10545,7 +10545,7 @@ syms_of_keyboard ()
10545{ 10545{
10546 Vpre_help_message = Qnil; 10546 Vpre_help_message = Qnil;
10547 staticpro (&Vpre_help_message); 10547 staticpro (&Vpre_help_message);
10548 10548
10549 Vlispy_mouse_stem = build_string ("mouse"); 10549 Vlispy_mouse_stem = build_string ("mouse");
10550 staticpro (&Vlispy_mouse_stem); 10550 staticpro (&Vlispy_mouse_stem);
10551 10551
@@ -10620,7 +10620,7 @@ syms_of_keyboard ()
10620 10620
10621 Qsave_session = intern ("save-session"); 10621 Qsave_session = intern ("save-session");
10622 staticpro(&Qsave_session); 10622 staticpro(&Qsave_session);
10623 10623
10624 Qusr1_signal = intern ("usr1-signal"); 10624 Qusr1_signal = intern ("usr1-signal");
10625 staticpro (&Qusr1_signal); 10625 staticpro (&Qusr1_signal);
10626 Qusr2_signal = intern ("usr2-signal"); 10626 Qusr2_signal = intern ("usr2-signal");
@@ -10918,7 +10918,7 @@ instead of pixels.
10918This variable is also the threshold for motion of the mouse 10918This variable is also the threshold for motion of the mouse
10919to count as a drag. */); 10919to count as a drag. */);
10920 double_click_fuzz = 3; 10920 double_click_fuzz = 3;
10921 10921
10922 DEFVAR_BOOL ("inhibit-local-menu-bar-menus", &inhibit_local_menu_bar_menus, 10922 DEFVAR_BOOL ("inhibit-local-menu-bar-menus", &inhibit_local_menu_bar_menus,
10923 doc: /* *Non-nil means inhibit local map menu bar menus. */); 10923 doc: /* *Non-nil means inhibit local map menu bar menus. */);
10924 inhibit_local_menu_bar_menus = 0; 10924 inhibit_local_menu_bar_menus = 0;
diff --git a/src/mem-limits.h b/src/mem-limits.h
index 67835770742..3ba8f3ceaf8 100644
--- a/src/mem-limits.h
+++ b/src/mem-limits.h
@@ -46,6 +46,10 @@ extern int etext, __data_start; weak_extern (__data_start)
46#define BSD4_2 46#define BSD4_2
47#endif 47#endif
48 48
49#ifdef CYGWIN
50#define BSD4_2
51#endif
52
49#ifndef BSD4_2 53#ifndef BSD4_2
50#ifndef USG 54#ifndef USG
51#ifndef MSDOS 55#ifndef MSDOS