aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiles Bader2005-06-09 07:13:03 +0000
committerMiles Bader2005-06-09 07:13:03 +0000
commitd113efea8e0a56aedd60615f5dc6669c72aca77f (patch)
treec51aa1cd5076acfc2391217b0d7dea96552011de /src
parent2435213ba6b74f7425e15b1f799c9ae18467e43d (diff)
parent47600d8e97925ed8816b099267e24f4ab3311e75 (diff)
downloademacs-d113efea8e0a56aedd60615f5dc6669c72aca77f.tar.gz
emacs-d113efea8e0a56aedd60615f5dc6669c72aca77f.zip
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-61
Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 353-357) - Update from CVS
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog102
-rw-r--r--src/config.in9
-rw-r--r--src/eval.c2
-rw-r--r--src/image.c4
-rw-r--r--src/keyboard.c1
-rw-r--r--src/lisp.h8
-rw-r--r--src/macmenu.c155
-rw-r--r--src/macterm.c4
-rw-r--r--src/makefile.w32-in2
-rw-r--r--src/process.c38
-rw-r--r--src/process.h4
-rw-r--r--src/search.c96
-rw-r--r--src/unexmacosx.c1
-rw-r--r--src/unexw32.c3
-rw-r--r--src/w32heap.c1
-rw-r--r--src/w32heap.h9
-rw-r--r--src/w32menu.c3
-rw-r--r--src/w32proc.c5
-rw-r--r--src/window.c49
-rw-r--r--src/xdisp.c79
-rw-r--r--src/xmenu.c6
-rw-r--r--src/xterm.c7
22 files changed, 474 insertions, 114 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6eeb4fc09f5..8736a6f156a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,105 @@
12005-06-08 Steven Tamm <steventamm@mac.com>
2
3 * unexmacosx.c (copy_data_segment): Copy __la_sym_ptr2 section
4 used by gcc4 on intel mac.
5
62005-06-09 Kim F. Storm <storm@cua.dk>
7
8 * search.c (Fmatch_data): Add optional RESEAT arg. Unchain markers
9 in REUSE list if non-nil; free them if equal to evaporate.
10 (Fset_match_data): Add optional RESEAT arg. Unchain markers in LIST
11 if non-nil; free them if equal to evaporate. Use XCAR/XCDR.
12 (restore_search_regs): Rename from restore_match_data. Uses changed.
13 (unwind_set_match_data): New function.
14 (record_unwind_save_match_data): New function like save-match-data.
15
16 * lisp.h (Fmatch_data, Fset_match_data): Fix EXFUN.
17 (record_unwind_save_match_data): Add prototype.
18 (restore_search_regs): Rename from restore_match_data.
19
20 * composite.c (compose_chars_in_text):
21 * eval.c (do_autoload):
22 * macmenu.c (set_frame_menubar):
23 * process.c (read_process_output, exec_sentinel):
24 * xmenu.c (set_frame_menubar):
25 * xdisp.c (prepare_menu_bars, update_menu_bar, update_tool_bar):
26 * w32menu.c (set_frame_menubar):
27 Use record_unwind_save_match_data.
28
292005-06-08 Richard M. Stallman <rms@gnu.org>
30
31 * xdisp.c (get_next_display_element): Alter previous change:
32 Distinguish Vshow_nonbreak_escape = t or not t.
33 For t, use escape_glyph once again, as before previous change.
34 Use space or hyphen for display, instead of the non-ASCII char.
35 (syms_of_xdisp) <show-nonbreak-escape>: Doc fix.
36
37 * process.c (Fstart_process): Don't touch command_channel_p slot.
38
39 * process.h (struct process): Delete command_channel_p.
40
412005-06-07 Masatake YAMATO <jet@gyve.org>
42
43 * xdisp.c (note_mode_line_or_margin_highlight): Check
44 the overlapping of re-rendering area to avoid flickering.
45 (note_mouse_highlight): Call clear_mouse_face if PART
46 is not ON_MODE_LINE nor ON_HEADER_LINE.
47
482005-06-07 Kim F. Storm <storm@cua.dk>
49
50 * process.c: Improve commentary for adaptive read buffering.
51
522005-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
53
54 * xterm.c (x_create_toolkit_scroll_bar): Use XtNarrowScrollbars
55 if available.
56
572005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
58
59 * macmenu.c (menu_quit_handler, install_menu_quit_handler): New
60 functions for popping down menus on C-g.
61 (set_frame_menubar, mac_menu_show): Call install_menu_quit_handler.
62
63 * macterm.c: Make mac_quit_char_modifiers and mac_quit_char_keycode
64 non-static.
65
66 * config.in: Added HAVE_CANCELMENUTRACKING
67
682005-06-06 Eli Zaretskii <eliz@gnu.org>
69
70 * w32heap.h (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_PTR): Remove
71 macros.
72
73 * unexw32.c (RVA_TO_PTR): Moved here from w32heap.h.
74
75 * w32proc.c (RVA_TO_PTR): New macro.
76
77 * w32heap.c (RVA_TO_PTR): No need to #undef now.
78
79 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/w32select.$(O)):
80 Depend on w32heap.h.
81
822005-06-06 Luc Teirlinck <teirllm@auburn.edu>
83
84 * keyboard.c (command_loop_1): Update Vthis_original_command.
85
862005-06-06 Richard M. Stallman <rms@gnu.org>
87
88 * xmenu.c (popup_get_selection): Undo previous change.
89
902005-06-06 Juri Linkov <juri@jurta.org>
91
92 * xdisp.c (Qno_break_space): New variable.
93 (syms_of_xdisp): Initialize it.
94 (get_next_display_element): Add no-break space and soft hypen
95 codes for iso8859-2 and iso8859-5. Don't add `\' for them.
96 Use `no-break-space' face for no-break spaces.
97
982005-06-06 Jan Dj,Ad(Brv <jan.h.d@swipnet.se>
99
100 * window.c (delete_window): Handle the case where a h/vchild has
101 a h/vchild.
102
12005-06-05 Eli Zaretskii <eliz@gnu.org> 1032005-06-05 Eli Zaretskii <eliz@gnu.org>
2 104
3 * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the 105 * w32.c (sys_setsockopt): Change arg 4 to `const void *'. In the
diff --git a/src/config.in b/src/config.in
index 6939ff2577c..93ee6488e0c 100644
--- a/src/config.in
+++ b/src/config.in
@@ -96,6 +96,9 @@ Boston, MA 02111-1307, USA. */
96/* Define to 1 if you have the `bzero' function. */ 96/* Define to 1 if you have the `bzero' function. */
97#undef HAVE_BZERO 97#undef HAVE_BZERO
98 98
99/* Define to 1 if CancelMenuTracking is available (Mac OSX). */
100#undef HAVE_CANCELMENUTRACKING
101
99/* Define to 1 if you are using the Carbon API on Mac OS X. */ 102/* Define to 1 if you are using the Carbon API on Mac OS X. */
100#undef HAVE_CARBON 103#undef HAVE_CARBON
101 104
@@ -782,9 +785,9 @@ Boston, MA 02111-1307, USA. */
782/* If using the C implementation of alloca, define if you know the 785/* If using the C implementation of alloca, define if you know the
783 direction of stack growth for your system; otherwise it will be 786 direction of stack growth for your system; otherwise it will be
784 automatically deduced at run-time. 787 automatically deduced at run-time.
785 STACK_DIRECTION > 0 => grows toward higher addresses 788 STACK_DIRECTION > 0 => grows toward higher addresses
786 STACK_DIRECTION < 0 => grows toward lower addresses 789 STACK_DIRECTION < 0 => grows toward lower addresses
787 STACK_DIRECTION = 0 => direction of growth unknown */ 790 STACK_DIRECTION = 0 => direction of growth unknown */
788#undef STACK_DIRECTION 791#undef STACK_DIRECTION
789 792
790/* Define to 1 if you have the ANSI C header files. */ 793/* Define to 1 if you have the ANSI C header files. */
diff --git a/src/eval.c b/src/eval.c
index 0eb1482ee0b..46affcac418 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1971,7 +1971,7 @@ do_autoload (fundef, funname)
1971 GCPRO3 (fun, funname, fundef); 1971 GCPRO3 (fun, funname, fundef);
1972 1972
1973 /* Preserve the match data. */ 1973 /* Preserve the match data. */
1974 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 1974 record_unwind_save_match_data ();
1975 1975
1976 /* Value saved here is to be restored into Vautoload_queue. */ 1976 /* Value saved here is to be restored into Vautoload_queue. */
1977 record_unwind_protect (un_autoload, Vautoload_queue); 1977 record_unwind_protect (un_autoload, Vautoload_queue);
diff --git a/src/image.c b/src/image.c
index 15e835fef3b..bc88c9d1d04 100644
--- a/src/image.c
+++ b/src/image.c
@@ -6265,8 +6265,8 @@ jpeg_image_p (object)
6265#endif /* HAVE_STLIB_H */ 6265#endif /* HAVE_STLIB_H */
6266 6266
6267#if defined (HAVE_NTGUI) && !defined (__WIN32__) 6267#if defined (HAVE_NTGUI) && !defined (__WIN32__)
6268/* jpeglib.h will define boolean differently depending on __WIN32__, 6268/* In older releases of the jpeg library, jpeglib.h will define boolean
6269 so make sure it is defined. */ 6269 differently depending on __WIN32__, so make sure it is defined. */
6270#define __WIN32__ 1 6270#define __WIN32__ 1
6271#endif 6271#endif
6272 6272
diff --git a/src/keyboard.c b/src/keyboard.c
index 31c0b5d709c..dee131b8c61 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -1522,6 +1522,7 @@ command_loop_1 ()
1522 1522
1523 Vthis_command = Qnil; 1523 Vthis_command = Qnil;
1524 real_this_command = Qnil; 1524 real_this_command = Qnil;
1525 Vthis_original_command = Qnil;
1525 1526
1526 /* Read next key sequence; i gets its length. */ 1527 /* Read next key sequence; i gets its length. */
1527 i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0], 1528 i = read_key_sequence (keybuf, sizeof keybuf / sizeof keybuf[0],
diff --git a/src/lisp.h b/src/lisp.h
index fa08ab07dce..af07de3fbaa 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2804,6 +2804,7 @@ EXFUN (Fbuffer_disable_undo, 1);
2804EXFUN (Fbuffer_enable_undo, 1); 2804EXFUN (Fbuffer_enable_undo, 1);
2805EXFUN (Ferase_buffer, 0); 2805EXFUN (Ferase_buffer, 0);
2806extern Lisp_Object Qoverlayp; 2806extern Lisp_Object Qoverlayp;
2807extern Lisp_Object Qevaporate;
2807extern Lisp_Object get_truename_buffer P_ ((Lisp_Object)); 2808extern Lisp_Object get_truename_buffer P_ ((Lisp_Object));
2808extern struct buffer *all_buffers; 2809extern struct buffer *all_buffers;
2809EXFUN (Fprevious_overlay_change, 1); 2810EXFUN (Fprevious_overlay_change, 1);
@@ -2871,11 +2872,12 @@ extern void syms_of_abbrev P_ ((void));
2871/* defined in search.c */ 2872/* defined in search.c */
2872extern void shrink_regexp_cache P_ ((void)); 2873extern void shrink_regexp_cache P_ ((void));
2873EXFUN (Fstring_match, 3); 2874EXFUN (Fstring_match, 3);
2874extern void restore_match_data P_ ((void)); 2875extern void restore_search_regs P_ ((void));
2875EXFUN (Fmatch_data, 2); 2876EXFUN (Fmatch_data, 3);
2876EXFUN (Fset_match_data, 1); 2877EXFUN (Fset_match_data, 2);
2877EXFUN (Fmatch_beginning, 1); 2878EXFUN (Fmatch_beginning, 1);
2878EXFUN (Fmatch_end, 1); 2879EXFUN (Fmatch_end, 1);
2880extern void record_unwind_save_match_data P_ ((void));
2879EXFUN (Flooking_at, 1); 2881EXFUN (Flooking_at, 1);
2880extern int fast_string_match P_ ((Lisp_Object, Lisp_Object)); 2882extern int fast_string_match P_ ((Lisp_Object, Lisp_Object));
2881extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *)); 2883extern int fast_c_string_match_ignore_case P_ ((Lisp_Object, const char *));
diff --git a/src/macmenu.c b/src/macmenu.c
index e97a968d92d..ee83a5f609f 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -1356,6 +1356,68 @@ update_submenu_strings (first_wv)
1356} 1356}
1357 1357
1358 1358
1359/* Event handler function that pops down a menu on C-g. We can only pop
1360 down menus if CancelMenuTracking is present (OSX 10.3 or later). */
1361
1362#ifdef HAVE_CANCELMENUTRACKING
1363static pascal OSStatus
1364menu_quit_handler (nextHandler, theEvent, userData)
1365 EventHandlerCallRef nextHandler;
1366 EventRef theEvent;
1367 void* userData;
1368{
1369 UInt32 keyCode;
1370 UInt32 keyModifiers;
1371 extern int mac_quit_char_modifiers;
1372 extern int mac_quit_char_keycode;
1373
1374 GetEventParameter (theEvent, kEventParamKeyCode,
1375 typeUInt32, NULL, sizeof(UInt32), NULL, &keyCode);
1376
1377 GetEventParameter (theEvent, kEventParamKeyModifiers,
1378 typeUInt32, NULL, sizeof(UInt32),
1379 NULL, &keyModifiers);
1380
1381 if (keyCode == mac_quit_char_keycode
1382 && keyModifiers == mac_quit_char_modifiers)
1383 {
1384 MenuRef menu = userData != 0
1385 ? (MenuRef)userData : AcquireRootMenu ();
1386
1387 CancelMenuTracking (menu, true, 0);
1388 if (!userData) ReleaseMenu (menu);
1389 return noErr;
1390 }
1391
1392 return CallNextEventHandler (nextHandler, theEvent);
1393}
1394#endif /* HAVE_CANCELMENUTRACKING */
1395
1396/* Add event handler for MENU_HANDLE so we can detect C-g.
1397 If MENU_HANDLE is NULL, install handler for all menus in the menu bar.
1398 If CancelMenuTracking isn't available, do nothing. */
1399
1400static void
1401install_menu_quit_handler (MenuHandle menu_handle)
1402{
1403#ifdef HAVE_CANCELMENUTRACKING
1404 EventHandlerUPP handler = NewEventHandlerUPP(menu_quit_handler);
1405 UInt32 numTypes = 1;
1406 EventTypeSpec typesList[] = { { kEventClassKeyboard, kEventRawKeyDown } };
1407 int i = MIN_MENU_ID;
1408 MenuHandle menu = menu_handle ? menu_handle : GetMenuHandle (i);
1409
1410 while (menu != NULL)
1411 {
1412 InstallMenuEventHandler (menu, handler, GetEventTypeCount (typesList),
1413 typesList, menu_handle, NULL);
1414 if (menu_handle) break;
1415 menu = GetMenuHandle (++i);
1416 }
1417 DisposeEventHandlerUPP (handler);
1418#endif /* HAVE_CANCELMENUTRACKING */
1419}
1420
1359/* Set the contents of the menubar widgets of frame F. 1421/* Set the contents of the menubar widgets of frame F.
1360 The argument FIRST_TIME is currently ignored; 1422 The argument FIRST_TIME is currently ignored;
1361 it is set the first time this is called, from initialize_frame_menubar. */ 1423 it is set the first time this is called, from initialize_frame_menubar. */
@@ -1413,7 +1475,7 @@ set_frame_menubar (f, first_time, deep_p)
1413 because it is not reentrant. */ 1475 because it is not reentrant. */
1414 specbind (Qdebug_on_next_call, Qnil); 1476 specbind (Qdebug_on_next_call, Qnil);
1415 1477
1416 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 1478 record_unwind_save_match_data ();
1417 if (NILP (Voverriding_local_map_menu_flag)) 1479 if (NILP (Voverriding_local_map_menu_flag))
1418 { 1480 {
1419 specbind (Qoverriding_terminal_local_map, Qnil); 1481 specbind (Qoverriding_terminal_local_map, Qnil);
@@ -1575,6 +1637,8 @@ set_frame_menubar (f, first_time, deep_p)
1575 1637
1576 DrawMenuBar (); 1638 DrawMenuBar ();
1577 1639
1640 /* Add event handler so we can detect C-g. */
1641 install_menu_quit_handler (NULL);
1578 free_menubar_widget_value_tree (first_wv); 1642 free_menubar_widget_value_tree (first_wv);
1579 1643
1580 UNBLOCK_INPUT; 1644 UNBLOCK_INPUT;
@@ -1606,7 +1670,43 @@ free_frame_menubar (f)
1606} 1670}
1607 1671
1608 1672
1609/* mac_menu_show actually displays a menu using the panes and items in 1673static Lisp_Object
1674pop_down_menu (arg)
1675 Lisp_Object arg;
1676{
1677 struct Lisp_Save_Value *p1 = XSAVE_VALUE (Fcar (arg));
1678 struct Lisp_Save_Value *p2 = XSAVE_VALUE (Fcdr (arg));
1679
1680 FRAME_PTR f = p1->pointer;
1681 MenuHandle *menu = p2->pointer;
1682
1683 BLOCK_INPUT;
1684
1685 /* Must reset this manually because the button release event is not
1686 passed to Emacs event loop. */
1687 FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0;
1688
1689 /* delete all menus */
1690 {
1691 int i = MIN_POPUP_SUBMENU_ID;
1692 MenuHandle submenu = GetMenuHandle (i);
1693 while (submenu != NULL)
1694 {
1695 DeleteMenu (i);
1696 DisposeMenu (submenu);
1697 submenu = GetMenuHandle (++i);
1698 }
1699 }
1700
1701 DeleteMenu (POPUP_SUBMENU_ID);
1702 DisposeMenu (*menu);
1703
1704 UNBLOCK_INPUT;
1705
1706 return Qnil;
1707}
1708
1709/* Mac_menu_show actually displays a menu using the panes and items in
1610 menu_items and returns the value selected from it; we assume input 1710 menu_items and returns the value selected from it; we assume input
1611 is blocked by the caller. */ 1711 is blocked by the caller. */
1612 1712
@@ -1644,6 +1744,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1644 = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object)); 1744 = (Lisp_Object *) alloca (menu_items_used * sizeof (Lisp_Object));
1645 int submenu_depth = 0; 1745 int submenu_depth = 0;
1646 int first_pane; 1746 int first_pane;
1747 int specpdl_count = SPECPDL_INDEX ();
1647 1748
1648 *error = NULL; 1749 *error = NULL;
1649 1750
@@ -1817,7 +1918,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1817 title = ENCODE_MENU_STRING (title); 1918 title = ENCODE_MENU_STRING (title);
1818#endif 1919#endif
1819 wv_title->name = (char *) SDATA (title); 1920 wv_title->name = (char *) SDATA (title);
1820 wv_title->enabled = TRUE; 1921 wv_title->enabled = FALSE;
1821 wv_title->title = TRUE; 1922 wv_title->title = TRUE;
1822 wv_title->button_type = BUTTON_TYPE_NONE; 1923 wv_title->button_type = BUTTON_TYPE_NONE;
1823 wv_title->help = Qnil; 1924 wv_title->help = Qnil;
@@ -1830,6 +1931,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1830 submenu_id = MIN_POPUP_SUBMENU_ID; 1931 submenu_id = MIN_POPUP_SUBMENU_ID;
1831 fill_submenu (menu, first_wv->contents); 1932 fill_submenu (menu, first_wv->contents);
1832 1933
1934 /* Free the widget_value objects we used to specify the
1935 contents. */
1936 free_menubar_widget_value_tree (first_wv);
1937
1833 /* Adjust coordinates to be root-window-relative. */ 1938 /* Adjust coordinates to be root-window-relative. */
1834 pos.h = x; 1939 pos.h = x;
1835 pos.v = y; 1940 pos.v = y;
@@ -1844,11 +1949,18 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1844 1949
1845 InsertMenu (menu, -1); 1950 InsertMenu (menu, -1);
1846 1951
1952 record_unwind_protect (pop_down_menu,
1953 Fcons (make_save_value (f, 0),
1954 make_save_value (&menu, 0)));
1955
1956 /* Add event handler so we can detect C-g. */
1957 install_menu_quit_handler (menu);
1958
1847 /* Display the menu. */ 1959 /* Display the menu. */
1848 menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0); 1960 menu_item_choice = PopUpMenuSelect (menu, pos.v, pos.h, 0);
1849 menu_item_selection = LoWord (menu_item_choice); 1961 menu_item_selection = LoWord (menu_item_choice);
1850 1962
1851 /* Get the refcon to find the correct item*/ 1963 /* Get the refcon to find the correct item */
1852 if (menu_item_selection) 1964 if (menu_item_selection)
1853 { 1965 {
1854 MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice)); 1966 MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice));
@@ -1856,35 +1968,10 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1856 GetMenuItemRefCon (sel_menu, menu_item_selection, &refcon); 1968 GetMenuItemRefCon (sel_menu, menu_item_selection, &refcon);
1857 } 1969 }
1858 } 1970 }
1859 1971 else if (! for_click)
1860#if 0 1972 /* Make "Cancel" equivalent to C-g unless this menu was popped up by
1861 /* Clean up extraneous mouse events which might have been generated 1973 a mouse press. */
1862 during the call. */ 1974 Fsignal (Qquit, Qnil);
1863 discard_mouse_events ();
1864#endif
1865
1866 /* Must reset this manually because the button release event is not
1867 passed to Emacs event loop. */
1868 FRAME_MAC_DISPLAY_INFO (f)->grabbed = 0;
1869
1870 /* Free the widget_value objects we used to specify the
1871 contents. */
1872 free_menubar_widget_value_tree (first_wv);
1873
1874 /* delete all menus */
1875 {
1876 int i = MIN_POPUP_SUBMENU_ID;
1877 MenuHandle submenu = GetMenuHandle (i);
1878 while (submenu != NULL)
1879 {
1880 DeleteMenu (i);
1881 DisposeMenu (submenu);
1882 submenu = GetMenuHandle (++i);
1883 }
1884 }
1885
1886 DeleteMenu (POPUP_SUBMENU_ID);
1887 DisposeMenu (menu);
1888 1975
1889 /* Find the selected item, and its pane, to return 1976 /* Find the selected item, and its pane, to return
1890 the proper value. */ 1977 the proper value. */
@@ -1944,6 +2031,8 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
1944 /* Make "Cancel" equivalent to C-g. */ 2031 /* Make "Cancel" equivalent to C-g. */
1945 Fsignal (Qquit, Qnil); 2032 Fsignal (Qquit, Qnil);
1946 2033
2034 unbind_to (specpdl_count, Qnil);
2035
1947 return Qnil; 2036 return Qnil;
1948} 2037}
1949 2038
diff --git a/src/macterm.c b/src/macterm.c
index 13d8fb455d8..dd48d43a039 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -9916,8 +9916,8 @@ MakeMeTheFrontProcess ()
9916/***** Code to handle C-g testing *****/ 9916/***** Code to handle C-g testing *****/
9917 9917
9918/* Contains the Mac modifier formed from quit_char */ 9918/* Contains the Mac modifier formed from quit_char */
9919static mac_quit_char_modifiers = 0; 9919int mac_quit_char_modifiers = 0;
9920static mac_quit_char_keycode; 9920int mac_quit_char_keycode;
9921extern int quit_char; 9921extern int quit_char;
9922 9922
9923static void 9923static void
diff --git a/src/makefile.w32-in b/src/makefile.w32-in
index 553ebb72abb..471f0cbc6ea 100644
--- a/src/makefile.w32-in
+++ b/src/makefile.w32-in
@@ -634,6 +634,7 @@ $(BLD)/emacs.$(O) : \
634 $(SRC)/termhooks.h \ 634 $(SRC)/termhooks.h \
635 $(SRC)/w32bdf.h \ 635 $(SRC)/w32bdf.h \
636 $(SRC)/w32gui.h \ 636 $(SRC)/w32gui.h \
637 $(SRC)/w32heap.h \
637 $(SRC)/window.h 638 $(SRC)/window.h
638 639
639$(BLD)/eval.$(O) : \ 640$(BLD)/eval.$(O) : \
@@ -1494,6 +1495,7 @@ $(BLD)/w32select.$(O): \
1494 $(SRC)/systime.h \ 1495 $(SRC)/systime.h \
1495 $(SRC)/w32bdf.h \ 1496 $(SRC)/w32bdf.h \
1496 $(SRC)/w32gui.h \ 1497 $(SRC)/w32gui.h \
1498 $(SRC)/w32heap.h \
1497 $(SRC)/w32term.h 1499 $(SRC)/w32term.h
1498 1500
1499$(BLD)/w32reg.$(O): \ 1501$(BLD)/w32reg.$(O): \
diff --git a/src/process.c b/src/process.c
index 34966d35160..d60fe1e3bf6 100644
--- a/src/process.c
+++ b/src/process.c
@@ -272,17 +272,19 @@ int update_tick;
272#define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5) 272#define READ_OUTPUT_DELAY_MAX (READ_OUTPUT_DELAY_INCREMENT * 5)
273#define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7) 273#define READ_OUTPUT_DELAY_MAX_MAX (READ_OUTPUT_DELAY_INCREMENT * 7)
274 274
275/* Number of processes which might be delayed. */ 275/* Number of processes which have a non-zero read_output_delay,
276 and therefore might be delayed for adaptive read buffering. */
276 277
277static int process_output_delay_count; 278static int process_output_delay_count;
278 279
279/* Non-zero if any process has non-nil process_output_skip. */ 280/* Non-zero if any process has non-nil read_output_skip. */
280 281
281static int process_output_skip; 282static int process_output_skip;
282 283
283/* Non-nil means to delay reading process output to improve buffering. 284/* Non-nil means to delay reading process output to improve buffering.
284 A value of t means that delay is reset after each send, any other 285 A value of t means that delay is reset after each send, any other
285 non-nil value does not reset the delay. */ 286 non-nil value does not reset the delay. A value of nil disables
287 adaptive read buffering completely. */
286static Lisp_Object Vprocess_adaptive_read_buffering; 288static Lisp_Object Vprocess_adaptive_read_buffering;
287#else 289#else
288#define process_output_delay_count 0 290#define process_output_delay_count 0
@@ -1536,7 +1538,6 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS) */)
1536 1538
1537 XPROCESS (proc)->childp = Qt; 1539 XPROCESS (proc)->childp = Qt;
1538 XPROCESS (proc)->plist = Qnil; 1540 XPROCESS (proc)->plist = Qnil;
1539 XPROCESS (proc)->command_channel_p = Qnil;
1540 XPROCESS (proc)->buffer = buffer; 1541 XPROCESS (proc)->buffer = buffer;
1541 XPROCESS (proc)->sentinel = Qnil; 1542 XPROCESS (proc)->sentinel = Qnil;
1542 XPROCESS (proc)->filter = Qnil; 1543 XPROCESS (proc)->filter = Qnil;
@@ -4320,6 +4321,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4320#endif 4321#endif
4321 4322
4322#ifdef ADAPTIVE_READ_BUFFERING 4323#ifdef ADAPTIVE_READ_BUFFERING
4324 /* Set the timeout for adaptive read buffering if any
4325 process has non-nil read_output_skip and non-zero
4326 read_output_delay, and we are not reading output for a
4327 specific wait_channel. It is not executed if
4328 Vprocess_adaptive_read_buffering is nil. */
4323 if (process_output_skip && check_delay > 0) 4329 if (process_output_skip && check_delay > 0)
4324 { 4330 {
4325 int usecs = EMACS_USECS (timeout); 4331 int usecs = EMACS_USECS (timeout);
@@ -4330,6 +4336,8 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4330 proc = chan_process[channel]; 4336 proc = chan_process[channel];
4331 if (NILP (proc)) 4337 if (NILP (proc))
4332 continue; 4338 continue;
4339 /* Find minimum non-zero read_output_delay among the
4340 processes with non-nil read_output_skip. */
4333 if (XINT (XPROCESS (proc)->read_output_delay) > 0) 4341 if (XINT (XPROCESS (proc)->read_output_delay) > 0)
4334 { 4342 {
4335 check_delay--; 4343 check_delay--;
@@ -4880,10 +4888,10 @@ read_process_output (proc, channel)
4880 { 4888 {
4881 Lisp_Object tem; 4889 Lisp_Object tem;
4882 /* Don't clobber the CURRENT match data, either! */ 4890 /* Don't clobber the CURRENT match data, either! */
4883 tem = Fmatch_data (Qnil, Qnil); 4891 tem = Fmatch_data (Qnil, Qnil, Qnil);
4884 restore_match_data (); 4892 restore_search_regs ();
4885 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 4893 record_unwind_save_match_data ();
4886 Fset_match_data (tem); 4894 Fset_match_data (tem, Qt);
4887 } 4895 }
4888 4896
4889 /* For speed, if a search happens within this code, 4897 /* For speed, if a search happens within this code,
@@ -4939,7 +4947,7 @@ read_process_output (proc, channel)
4939 read_process_output_error_handler); 4947 read_process_output_error_handler);
4940 4948
4941 /* If we saved the match data nonrecursively, restore it now. */ 4949 /* If we saved the match data nonrecursively, restore it now. */
4942 restore_match_data (); 4950 restore_search_regs ();
4943 running_asynch_code = outer_running_asynch_code; 4951 running_asynch_code = outer_running_asynch_code;
4944 4952
4945 /* Handling the process output should not deactivate the mark. */ 4953 /* Handling the process output should not deactivate the mark. */
@@ -6338,10 +6346,10 @@ exec_sentinel (proc, reason)
6338 if (outer_running_asynch_code) 6346 if (outer_running_asynch_code)
6339 { 6347 {
6340 Lisp_Object tem; 6348 Lisp_Object tem;
6341 tem = Fmatch_data (Qnil, Qnil); 6349 tem = Fmatch_data (Qnil, Qnil, Qnil);
6342 restore_match_data (); 6350 restore_search_regs ();
6343 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 6351 record_unwind_save_match_data ();
6344 Fset_match_data (tem); 6352 Fset_match_data (tem, Qt);
6345 } 6353 }
6346 6354
6347 /* For speed, if a search happens within this code, 6355 /* For speed, if a search happens within this code,
@@ -6355,7 +6363,7 @@ exec_sentinel (proc, reason)
6355 exec_sentinel_error_handler); 6363 exec_sentinel_error_handler);
6356 6364
6357 /* If we saved the match data nonrecursively, restore it now. */ 6365 /* If we saved the match data nonrecursively, restore it now. */
6358 restore_match_data (); 6366 restore_search_regs ();
6359 running_asynch_code = outer_running_asynch_code; 6367 running_asynch_code = outer_running_asynch_code;
6360 6368
6361 Vdeactivate_mark = odeactivate; 6369 Vdeactivate_mark = odeactivate;
@@ -6709,7 +6717,7 @@ init_process ()
6709#endif /* HAVE_SOCKETS */ 6717#endif /* HAVE_SOCKETS */
6710 6718
6711#if defined (DARWIN) || defined (MAC_OSX) 6719#if defined (DARWIN) || defined (MAC_OSX)
6712 /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive 6720 /* PTYs are broken on Darwin < 6, but are sometimes useful for interactive
6713 processes. As such, we only change the default value. */ 6721 processes. As such, we only change the default value. */
6714 if (initialized) 6722 if (initialized)
6715 { 6723 {
diff --git a/src/process.h b/src/process.h
index 6e2641d6b06..8e3f9028c0b 100644
--- a/src/process.h
+++ b/src/process.h
@@ -52,8 +52,6 @@ struct Lisp_Process
52 Lisp_Object buffer; 52 Lisp_Object buffer;
53 /* Number of this process */ 53 /* Number of this process */
54 Lisp_Object pid; 54 Lisp_Object pid;
55 /* Non-nil if this is really a command channel */
56 Lisp_Object command_channel_p;
57 /* t if this is a real child process. 55 /* t if this is a real child process.
58 For a net connection, it is a plist based on the arguments to make-network-process. */ 56 For a net connection, it is a plist based on the arguments to make-network-process. */
59 Lisp_Object childp; 57 Lisp_Object childp;
@@ -105,7 +103,7 @@ struct Lisp_Process
105 Initialized from `Vprocess_adaptive_read_buffering'. */ 103 Initialized from `Vprocess_adaptive_read_buffering'. */
106 Lisp_Object adaptive_read_buffering; 104 Lisp_Object adaptive_read_buffering;
107 /* Hysteresis to try to read process output in larger blocks. 105 /* Hysteresis to try to read process output in larger blocks.
108 On some systems, e.g. the Linux kernel, emacs is seen as 106 On some systems, e.g. GNU/Linux, Emacs is seen as
109 an interactive app also when reading process output, meaning 107 an interactive app also when reading process output, meaning
110 that process output can be read in as little as 1 byte at a 108 that process output can be read in as little as 1 byte at a
111 time. Value is micro-seconds to delay reading output from 109 time. Value is micro-seconds to delay reading output from
diff --git a/src/search.c b/src/search.c
index b7d3e78ac1d..18f92f41327 100644
--- a/src/search.c
+++ b/src/search.c
@@ -2701,7 +2701,7 @@ Zero means the entire text matched by the whole regexp or whole string. */)
2701 return match_limit (subexp, 0); 2701 return match_limit (subexp, 0);
2702} 2702}
2703 2703
2704DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 2, 0, 2704DEFUN ("match-data", Fmatch_data, Smatch_data, 0, 3, 0,
2705 doc: /* Return a list containing all info on what the last search matched. 2705 doc: /* Return a list containing all info on what the last search matched.
2706Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'. 2706Element 2N is `(match-beginning N)'; element 2N + 1 is `(match-end N)'.
2707All the elements are markers or nil (nil if the Nth pair didn't match) 2707All the elements are markers or nil (nil if the Nth pair didn't match)
@@ -2713,17 +2713,35 @@ integers \(rather than markers) to represent buffer positions. In
2713this case, and if the last match was in a buffer, the buffer will get 2713this case, and if the last match was in a buffer, the buffer will get
2714stored as one additional element at the end of the list. 2714stored as one additional element at the end of the list.
2715 2715
2716If REUSE is a list, reuse it as part of the value. If REUSE is long enough 2716If REUSE is a list, reuse it as part of the value. If REUSE is long
2717to hold all the values, and if INTEGERS is non-nil, no consing is done. 2717enough to hold all the values, and if INTEGERS is non-nil, no consing
2718is done.
2719
2720If optional third arg RESEAT is non-nil, any previous markers on the
2721REUSE list will be modified to point to nowhere.
2722
2723If RESEAT is `evaporate', put markers back on the free list.
2724Note: No other references to the markers must exist if you use this.
2718 2725
2719Return value is undefined if the last search failed. */) 2726Return value is undefined if the last search failed. */)
2720 (integers, reuse) 2727 (integers, reuse, reseat)
2721 Lisp_Object integers, reuse; 2728 Lisp_Object integers, reuse, reseat;
2722{ 2729{
2723 Lisp_Object tail, prev; 2730 Lisp_Object tail, prev;
2724 Lisp_Object *data; 2731 Lisp_Object *data;
2725 int i, len; 2732 int i, len;
2726 2733
2734 if (!NILP (reseat))
2735 for (tail = reuse; CONSP (tail); tail = XCDR (tail))
2736 if (MARKERP (XCAR (tail)))
2737 {
2738 if (EQ (reseat, Qevaporate))
2739 free_marker (XCAR (tail));
2740 else
2741 unchain_marker (XMARKER (XCAR (tail)));
2742 XSETCAR (tail, Qnil);
2743 }
2744
2727 if (NILP (last_thing_searched)) 2745 if (NILP (last_thing_searched))
2728 return Qnil; 2746 return Qnil;
2729 2747
@@ -2759,10 +2777,10 @@ Return value is undefined if the last search failed. */)
2759 /* last_thing_searched must always be Qt, a buffer, or Qnil. */ 2777 /* last_thing_searched must always be Qt, a buffer, or Qnil. */
2760 abort (); 2778 abort ();
2761 2779
2762 len = 2*(i+1); 2780 len = 2 * i + 2;
2763 } 2781 }
2764 else 2782 else
2765 data[2 * i] = data [2 * i + 1] = Qnil; 2783 data[2 * i] = data[2 * i + 1] = Qnil;
2766 } 2784 }
2767 2785
2768 if (BUFFERP (last_thing_searched) && !NILP (integers)) 2786 if (BUFFERP (last_thing_searched) && !NILP (integers))
@@ -2796,11 +2814,15 @@ Return value is undefined if the last search failed. */)
2796} 2814}
2797 2815
2798 2816
2799DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 1, 0, 2817DEFUN ("set-match-data", Fset_match_data, Sset_match_data, 1, 2, 0,
2800 doc: /* Set internal data on last search match from elements of LIST. 2818 doc: /* Set internal data on last search match from elements of LIST.
2801LIST should have been created by calling `match-data' previously. */) 2819LIST should have been created by calling `match-data' previously.
2802 (list) 2820
2803 register Lisp_Object list; 2821If optional arg RESEAT is non-nil, make markers on LIST point nowhere.
2822If RESEAT is `evaporate', put the markers back on the free list.
2823Note: No other references to the markers must exist if you use this. */)
2824 (list, reseat)
2825 register Lisp_Object list, reseat;
2804{ 2826{
2805 register int i; 2827 register int i;
2806 register Lisp_Object marker; 2828 register Lisp_Object marker;
@@ -2844,9 +2866,9 @@ LIST should have been created by calling `match-data' previously. */)
2844 search_regs.num_regs = length; 2866 search_regs.num_regs = length;
2845 } 2867 }
2846 2868
2847 for (i = 0;; i++) 2869 for (i = 0; CONSP (list); i++)
2848 { 2870 {
2849 marker = Fcar (list); 2871 marker = XCAR (list);
2850 if (BUFFERP (marker)) 2872 if (BUFFERP (marker))
2851 { 2873 {
2852 last_thing_searched = marker; 2874 last_thing_searched = marker;
@@ -2857,12 +2879,14 @@ LIST should have been created by calling `match-data' previously. */)
2857 if (NILP (marker)) 2879 if (NILP (marker))
2858 { 2880 {
2859 search_regs.start[i] = -1; 2881 search_regs.start[i] = -1;
2860 list = Fcdr (list); 2882 list = XCDR (list);
2861 } 2883 }
2862 else 2884 else
2863 { 2885 {
2864 int from; 2886 int from;
2887 Lisp_Object m;
2865 2888
2889 m = marker;
2866 if (MARKERP (marker)) 2890 if (MARKERP (marker))
2867 { 2891 {
2868 if (XMARKER (marker)->buffer == 0) 2892 if (XMARKER (marker)->buffer == 0)
@@ -2873,17 +2897,38 @@ LIST should have been created by calling `match-data' previously. */)
2873 2897
2874 CHECK_NUMBER_COERCE_MARKER (marker); 2898 CHECK_NUMBER_COERCE_MARKER (marker);
2875 from = XINT (marker); 2899 from = XINT (marker);
2876 list = Fcdr (list);
2877 2900
2878 marker = Fcar (list); 2901 if (!NILP (reseat) && MARKERP (m))
2902 {
2903 if (EQ (reseat, Qevaporate))
2904 free_marker (m);
2905 else
2906 unchain_marker (XMARKER (m));
2907 XSETCAR (list, Qnil);
2908 }
2909
2910 if ((list = XCDR (list), !CONSP (list)))
2911 break;
2912
2913 m = marker = XCAR (list);
2914
2879 if (MARKERP (marker) && XMARKER (marker)->buffer == 0) 2915 if (MARKERP (marker) && XMARKER (marker)->buffer == 0)
2880 XSETFASTINT (marker, 0); 2916 XSETFASTINT (marker, 0);
2881 2917
2882 CHECK_NUMBER_COERCE_MARKER (marker); 2918 CHECK_NUMBER_COERCE_MARKER (marker);
2883 search_regs.start[i] = from; 2919 search_regs.start[i] = from;
2884 search_regs.end[i] = XINT (marker); 2920 search_regs.end[i] = XINT (marker);
2921
2922 if (!NILP (reseat) && MARKERP (m))
2923 {
2924 if (EQ (reseat, Qevaporate))
2925 free_marker (m);
2926 else
2927 unchain_marker (XMARKER (m));
2928 XSETCAR (list, Qnil);
2929 }
2885 } 2930 }
2886 list = Fcdr (list); 2931 list = XCDR (list);
2887 } 2932 }
2888 2933
2889 for (; i < search_regs.num_regs; i++) 2934 for (; i < search_regs.num_regs; i++)
@@ -2921,7 +2966,7 @@ save_search_regs ()
2921 2966
2922/* Called upon exit from filters and sentinels. */ 2967/* Called upon exit from filters and sentinels. */
2923void 2968void
2924restore_match_data () 2969restore_search_regs ()
2925{ 2970{
2926 if (search_regs_saved) 2971 if (search_regs_saved)
2927 { 2972 {
@@ -2939,6 +2984,21 @@ restore_match_data ()
2939 } 2984 }
2940} 2985}
2941 2986
2987static Lisp_Object
2988unwind_set_match_data (list)
2989 Lisp_Object list;
2990{
2991 return Fset_match_data (list, Qevaporate);
2992}
2993
2994/* Called to unwind protect the match data. */
2995void
2996record_unwind_save_match_data ()
2997{
2998 record_unwind_protect (unwind_set_match_data,
2999 Fmatch_data (Qnil, Qnil, Qnil));
3000}
3001
2942/* Quote a string to inactivate reg-expr chars */ 3002/* Quote a string to inactivate reg-expr chars */
2943 3003
2944DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0, 3004DEFUN ("regexp-quote", Fregexp_quote, Sregexp_quote, 1, 1, 0,
diff --git a/src/unexmacosx.c b/src/unexmacosx.c
index e54dbea448c..1a2c211a09d 100644
--- a/src/unexmacosx.c
+++ b/src/unexmacosx.c
@@ -695,6 +695,7 @@ copy_data_segment (struct load_command *lc)
695 } 695 }
696 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0 696 else if (strncmp (sectp->sectname, "__la_symbol_ptr", 16) == 0
697 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0 697 || strncmp (sectp->sectname, "__nl_symbol_ptr", 16) == 0
698 || strncmp (sectp->sectname, "__la_sym_ptr2", 16) == 0
698 || strncmp (sectp->sectname, "__dyld", 16) == 0 699 || strncmp (sectp->sectname, "__dyld", 16) == 0
699 || strncmp (sectp->sectname, "__const", 16) == 0 700 || strncmp (sectp->sectname, "__const", 16) == 0
700 || strncmp (sectp->sectname, "__cfstring", 16) == 0) 701 || strncmp (sectp->sectname, "__cfstring", 16) == 0)
diff --git a/src/unexw32.c b/src/unexw32.c
index b1838644965..1b2dbe74c31 100644
--- a/src/unexw32.c
+++ b/src/unexw32.c
@@ -325,6 +325,9 @@ relocate_offset (DWORD offset,
325/* Convert address in executing image to RVA. */ 325/* Convert address in executing image to RVA. */
326#define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL)) 326#define PTR_TO_RVA(ptr) ((DWORD)(ptr) - (DWORD) GetModuleHandle (NULL))
327 327
328#define RVA_TO_PTR(var,section,filedata) \
329 ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base))
330
328#define PTR_TO_OFFSET(ptr, pfile_data) \ 331#define PTR_TO_OFFSET(ptr, pfile_data) \
329 ((unsigned char *)(ptr) - (pfile_data)->file_base) 332 ((unsigned char *)(ptr) - (pfile_data)->file_base)
330 333
diff --git a/src/w32heap.c b/src/w32heap.c
index d947842474f..4c28718a510 100644
--- a/src/w32heap.c
+++ b/src/w32heap.c
@@ -31,7 +31,6 @@ Boston, MA 02111-1307, USA.
31#include "w32heap.h" 31#include "w32heap.h"
32#include "lisp.h" /* for VALMASK */ 32#include "lisp.h" /* for VALMASK */
33 33
34#undef RVA_TO_PTR
35#define RVA_TO_PTR(rva) ((unsigned char *)((DWORD)(rva) + (DWORD)GetModuleHandle (NULL))) 34#define RVA_TO_PTR(rva) ((unsigned char *)((DWORD)(rva) + (DWORD)GetModuleHandle (NULL)))
36 35
37/* This gives us the page size and the size of the allocation unit on NT. */ 36/* This gives us the page size and the size of the allocation unit on NT. */
diff --git a/src/w32heap.h b/src/w32heap.h
index 7fdf952683c..556c7fb28b4 100644
--- a/src/w32heap.h
+++ b/src/w32heap.h
@@ -82,15 +82,6 @@ typedef struct file_data {
82 unsigned char *file_base; 82 unsigned char *file_base;
83} file_data; 83} file_data;
84 84
85#define OFFSET_TO_RVA(var,section) \
86 (section->VirtualAddress + ((DWORD)(var) - section->PointerToRawData))
87
88#define RVA_TO_OFFSET(var,section) \
89 (section->PointerToRawData + ((DWORD)(var) - section->VirtualAddress))
90
91#define RVA_TO_PTR(var,section,filedata) \
92 ((void *)(RVA_TO_OFFSET(var,section) + (filedata).file_base))
93
94int open_input_file (file_data *p_file, char *name); 85int open_input_file (file_data *p_file, char *name);
95int open_output_file (file_data *p_file, char *name, unsigned long size); 86int open_output_file (file_data *p_file, char *name, unsigned long size);
96void close_file_data (file_data *p_file); 87void close_file_data (file_data *p_file);
diff --git a/src/w32menu.c b/src/w32menu.c
index 8a90eae7ec7..c5af0aae980 100644
--- a/src/w32menu.c
+++ b/src/w32menu.c
@@ -1443,7 +1443,8 @@ set_frame_menubar (f, first_time, deep_p)
1443 because it is not reentrant. */ 1443 because it is not reentrant. */
1444 specbind (Qdebug_on_next_call, Qnil); 1444 specbind (Qdebug_on_next_call, Qnil);
1445 1445
1446 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 1446 record_unwind_save_match_data ();
1447
1447 if (NILP (Voverriding_local_map_menu_flag)) 1448 if (NILP (Voverriding_local_map_menu_flag))
1448 { 1449 {
1449 specbind (Qoverriding_terminal_local_map, Qnil); 1450 specbind (Qoverriding_terminal_local_map, Qnil);
diff --git a/src/w32proc.c b/src/w32proc.c
index 9abee2bf0c2..48b5e2c14a3 100644
--- a/src/w32proc.c
+++ b/src/w32proc.c
@@ -57,6 +57,11 @@ extern BOOL WINAPI IsValidLocale(LCID, DWORD);
57#include "syssignal.h" 57#include "syssignal.h"
58#include "w32term.h" 58#include "w32term.h"
59 59
60#define RVA_TO_PTR(var,section,filedata) \
61 ((void *)((section)->PointerToRawData \
62 + ((DWORD)(var) - (section)->VirtualAddress) \
63 + (filedata).file_base))
64
60/* Control whether spawnve quotes arguments as necessary to ensure 65/* Control whether spawnve quotes arguments as necessary to ensure
61 correct parsing by child process. Because not all uses of spawnve 66 correct parsing by child process. Because not all uses of spawnve
62 are careful about constructing argv arrays, we make this behaviour 67 are careful about constructing argv arrays, we make this behaviour
diff --git a/src/window.c b/src/window.c
index 35aeb4411ae..4d7c71f82c6 100644
--- a/src/window.c
+++ b/src/window.c
@@ -1452,8 +1452,10 @@ delete_window (window)
1452 tem = par->hchild; 1452 tem = par->hchild;
1453 if (NILP (tem)) 1453 if (NILP (tem))
1454 tem = par->vchild; 1454 tem = par->vchild;
1455 if (NILP (XWINDOW (tem)->next)) 1455 if (NILP (XWINDOW (tem)->next)) {
1456 replace_window (parent, tem); 1456 replace_window (parent, tem);
1457 par = XWINDOW (tem);
1458 }
1457 1459
1458 /* Since we may be deleting combination windows, we must make sure that 1460 /* Since we may be deleting combination windows, we must make sure that
1459 not only p but all its children have been marked as deleted. */ 1461 not only p but all its children have been marked as deleted. */
@@ -1465,6 +1467,51 @@ delete_window (window)
1465 /* Mark this window as deleted. */ 1467 /* Mark this window as deleted. */
1466 p->buffer = p->hchild = p->vchild = Qnil; 1468 p->buffer = p->hchild = p->vchild = Qnil;
1467 1469
1470 if (! NILP (par->parent))
1471 par = XWINDOW (par->parent);
1472
1473 /* Check if we have a v/hchild with a v/hchild. In that case remove
1474 one of them. */
1475
1476 if (! NILP (par->vchild) && ! NILP (XWINDOW (par->vchild)->vchild))
1477 {
1478 p = XWINDOW (par->vchild);
1479 par->vchild = p->vchild;
1480 tem = p->vchild;
1481 }
1482 else if (! NILP (par->hchild) && ! NILP (XWINDOW (par->hchild)->hchild))
1483 {
1484 p = XWINDOW (par->hchild);
1485 par->hchild = p->hchild;
1486 tem = p->hchild;
1487 }
1488 else
1489 p = 0;
1490
1491 if (p)
1492 {
1493 while (! NILP (tem)) {
1494 XWINDOW (tem)->parent = p->parent;
1495 if (NILP (XWINDOW (tem)->next))
1496 break;
1497 tem = XWINDOW (tem)->next;
1498 }
1499 if (! NILP (tem)) {
1500 /* The next of the v/hchild we are removing is now the next of the
1501 last child for the v/hchild:
1502 Before v/hchild -> v/hchild -> next1 -> next2
1503 |
1504 -> next3
1505 After: v/hchild -> next1 -> next2 -> next3
1506 */
1507 XWINDOW (tem)->next = p->next;
1508 if (! NILP (p->next))
1509 XWINDOW (p->next)->prev = tem;
1510 }
1511 p->next = p->prev = p->vchild = p->hchild = p->buffer = Qnil;
1512 }
1513
1514
1468 /* Adjust glyph matrices. */ 1515 /* Adjust glyph matrices. */
1469 adjust_glyphs (f); 1516 adjust_glyphs (f);
1470 UNBLOCK_INPUT; 1517 UNBLOCK_INPUT;
diff --git a/src/xdisp.c b/src/xdisp.c
index 6ad0bb9166a..54e6c7fe8f6 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -351,6 +351,10 @@ Lisp_Object Qtrailing_whitespace;
351 351
352Lisp_Object Qescape_glyph; 352Lisp_Object Qescape_glyph;
353 353
354/* Name and number of the face used to highlight non-breaking spaces. */
355
356Lisp_Object Qno_break_space;
357
354/* The symbol `image' which is the car of the lists used to represent 358/* The symbol `image' which is the car of the lists used to represent
355 images in Lisp. */ 359 images in Lisp. */
356 360
@@ -5203,6 +5207,8 @@ get_next_display_element (it)
5203 int face_id, lface_id = 0 ; 5207 int face_id, lface_id = 0 ;
5204 GLYPH escape_glyph; 5208 GLYPH escape_glyph;
5205 5209
5210 /* Handle control characters with ^. */
5211
5206 if (it->c < 128 && it->ctl_arrow_p) 5212 if (it->c < 128 && it->ctl_arrow_p)
5207 { 5213 {
5208 g = '^'; /* default glyph for Control */ 5214 g = '^'; /* default glyph for Control */
@@ -5234,7 +5240,28 @@ get_next_display_element (it)
5234 goto display_control; 5240 goto display_control;
5235 } 5241 }
5236 5242
5237 escape_glyph = '\\'; /* default for Octal display */ 5243 /* Handle non-break space in the mode where it only gets
5244 highlighting. */
5245
5246 if (! EQ (Vshow_nonbreak_escape, Qt)
5247 && (it->c == 0x8a0 || it->c == 0x920
5248 || it->c == 0xe20 || it->c == 0xf20))
5249 {
5250 /* Merge the no-break-space face into the current face. */
5251 face_id = merge_faces (it->f, Qno_break_space, 0,
5252 it->face_id);
5253
5254 g = it->c = ' ';
5255 XSETINT (it->ctl_chars[0], g);
5256 ctl_len = 1;
5257 goto display_control;
5258 }
5259
5260 /* Handle sequences that start with the "escape glyph". */
5261
5262 /* the default escape glyph is \. */
5263 escape_glyph = '\\';
5264
5238 if (it->dp 5265 if (it->dp
5239 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp)) 5266 && INTEGERP (DISP_ESCAPE_GLYPH (it->dp))
5240 && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp)))) 5267 && GLYPH_CHAR_VALID_P (XFASTINT (DISP_ESCAPE_GLYPH (it->dp))))
@@ -5244,6 +5271,8 @@ get_next_display_element (it)
5244 } 5271 }
5245 if (lface_id) 5272 if (lface_id)
5246 { 5273 {
5274 /* The display table specified a face.
5275 Merge it into face_id and also into escape_glyph. */
5247 escape_glyph = FAST_GLYPH_CHAR (escape_glyph); 5276 escape_glyph = FAST_GLYPH_CHAR (escape_glyph);
5248 face_id = merge_faces (it->f, Qt, lface_id, 5277 face_id = merge_faces (it->f, Qt, lface_id,
5249 it->face_id); 5278 it->face_id);
@@ -8552,7 +8581,7 @@ prepare_menu_bars ()
8552 Lisp_Object tail, frame; 8581 Lisp_Object tail, frame;
8553 int count = SPECPDL_INDEX (); 8582 int count = SPECPDL_INDEX ();
8554 8583
8555 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 8584 record_unwind_save_match_data ();
8556 8585
8557 FOR_EACH_FRAME (tail, frame) 8586 FOR_EACH_FRAME (tail, frame)
8558 { 8587 {
@@ -8675,7 +8704,7 @@ update_menu_bar (f, save_match_data)
8675 8704
8676 set_buffer_internal_1 (XBUFFER (w->buffer)); 8705 set_buffer_internal_1 (XBUFFER (w->buffer));
8677 if (save_match_data) 8706 if (save_match_data)
8678 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 8707 record_unwind_save_match_data ();
8679 if (NILP (Voverriding_local_map_menu_flag)) 8708 if (NILP (Voverriding_local_map_menu_flag))
8680 { 8709 {
8681 specbind (Qoverriding_terminal_local_map, Qnil); 8710 specbind (Qoverriding_terminal_local_map, Qnil);
@@ -8866,7 +8895,7 @@ update_tool_bar (f, save_match_data)
8866 8895
8867 /* Save match data, if we must. */ 8896 /* Save match data, if we must. */
8868 if (save_match_data) 8897 if (save_match_data)
8869 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 8898 record_unwind_save_match_data ();
8870 8899
8871 /* Make sure that we don't accidentally use bogus keymaps. */ 8900 /* Make sure that we don't accidentally use bogus keymaps. */
8872 if (NILP (Voverriding_local_map_menu_flag)) 8901 if (NILP (Voverriding_local_map_menu_flag))
@@ -21620,10 +21649,8 @@ note_mode_line_or_margin_highlight (window, x, y, area)
21620 int total_pixel_width; 21649 int total_pixel_width;
21621 int ignore; 21650 int ignore;
21622 21651
21623 21652 int vpos, hpos;
21624 if (clear_mouse_face (dpyinfo)) 21653
21625 cursor = No_Cursor;
21626
21627 b = Fprevious_single_property_change (make_number (charpos + 1), 21654 b = Fprevious_single_property_change (make_number (charpos + 1),
21628 Qmouse_face, string, Qnil); 21655 Qmouse_face, string, Qnil);
21629 if (NILP (b)) 21656 if (NILP (b))
@@ -21666,15 +21693,30 @@ note_mode_line_or_margin_highlight (window, x, y, area)
21666 for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++) 21693 for (tmp_glyph = glyph - gpos; tmp_glyph != glyph; tmp_glyph++)
21667 total_pixel_width += tmp_glyph->pixel_width; 21694 total_pixel_width += tmp_glyph->pixel_width;
21668 21695
21669 dpyinfo->mouse_face_beg_col = (x - gpos); 21696 /* Pre calculation of re-rendering position */
21670 dpyinfo->mouse_face_beg_row = (area == ON_MODE_LINE 21697 vpos = (x - gpos);
21671 ? (w->current_matrix)->nrows - 1 21698 hpos = (area == ON_MODE_LINE
21672 : 0); 21699 ? (w->current_matrix)->nrows - 1
21700 : 0);
21701
21702 /* If the re-rendering position is included in the last
21703 re-rendering area, we should do nothing. */
21704 if ( window == dpyinfo->mouse_face_window
21705 && dpyinfo->mouse_face_beg_col <= vpos
21706 && vpos < dpyinfo->mouse_face_end_col
21707 && dpyinfo->mouse_face_beg_row == hpos )
21708 return;
21709
21710 if (clear_mouse_face (dpyinfo))
21711 cursor = No_Cursor;
21712
21713 dpyinfo->mouse_face_beg_col = vpos;
21714 dpyinfo->mouse_face_beg_row = hpos;
21673 21715
21674 dpyinfo->mouse_face_beg_x = original_x_pixel - (total_pixel_width + dx); 21716 dpyinfo->mouse_face_beg_x = original_x_pixel - (total_pixel_width + dx);
21675 dpyinfo->mouse_face_beg_y = 0; 21717 dpyinfo->mouse_face_beg_y = 0;
21676 21718
21677 dpyinfo->mouse_face_end_col = (x - gpos) + gseq_length; 21719 dpyinfo->mouse_face_end_col = vpos + gseq_length;
21678 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row; 21720 dpyinfo->mouse_face_end_row = dpyinfo->mouse_face_beg_row;
21679 21721
21680 dpyinfo->mouse_face_end_x = 0; 21722 dpyinfo->mouse_face_end_x = 0;
@@ -21746,7 +21788,8 @@ note_mouse_highlight (f, x, y)
21746 /* If we were displaying active text in another window, clear that. 21788 /* If we were displaying active text in another window, clear that.
21747 Also clear if we move out of text area in same window. */ 21789 Also clear if we move out of text area in same window. */
21748 if (! EQ (window, dpyinfo->mouse_face_window) 21790 if (! EQ (window, dpyinfo->mouse_face_window)
21749 || (part != ON_TEXT && !NILP (dpyinfo->mouse_face_window))) 21791 || (part != ON_TEXT && part != ON_MODE_LINE && part != ON_HEADER_LINE
21792 && !NILP (dpyinfo->mouse_face_window)))
21750 clear_mouse_face (dpyinfo); 21793 clear_mouse_face (dpyinfo);
21751 21794
21752 /* Not on a window -> return. */ 21795 /* Not on a window -> return. */
@@ -22861,6 +22904,8 @@ syms_of_xdisp ()
22861 staticpro (&Qtrailing_whitespace); 22904 staticpro (&Qtrailing_whitespace);
22862 Qescape_glyph = intern ("escape-glyph"); 22905 Qescape_glyph = intern ("escape-glyph");
22863 staticpro (&Qescape_glyph); 22906 staticpro (&Qescape_glyph);
22907 Qno_break_space = intern ("no-break-space");
22908 staticpro (&Qno_break_space);
22864 Qimage = intern ("image"); 22909 Qimage = intern ("image");
22865 staticpro (&Qimage); 22910 staticpro (&Qimage);
22866 QCmap = intern (":map"); 22911 QCmap = intern (":map");
@@ -22967,7 +23012,11 @@ The face used for trailing whitespace is `trailing-whitespace'. */);
22967 Vshow_trailing_whitespace = Qnil; 23012 Vshow_trailing_whitespace = Qnil;
22968 23013
22969 DEFVAR_LISP ("show-nonbreak-escape", &Vshow_nonbreak_escape, 23014 DEFVAR_LISP ("show-nonbreak-escape", &Vshow_nonbreak_escape,
22970 doc: /* *Non-nil means display escape character before non-break space and hyphen. */); 23015 doc: /* *Control highlighting of non-break space and soft hyphen.
23016t means highlight the character itself (for non-break space,
23017use face `non-break-space'.
23018nil means no highlighting.
23019other values mean display the escape glyph before the character. */);
22971 Vshow_nonbreak_escape = Qt; 23020 Vshow_nonbreak_escape = Qt;
22972 23021
22973 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer, 23022 DEFVAR_LISP ("void-text-area-pointer", &Vvoid_text_area_pointer,
diff --git a/src/xmenu.c b/src/xmenu.c
index 826c9330c46..a05c9793750 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1235,10 +1235,6 @@ popup_get_selection (initial_event, dpyinfo, id, do_timers)
1235 if (event.type == ButtonRelease 1235 if (event.type == ButtonRelease
1236 && dpyinfo->display == event.xbutton.display) 1236 && dpyinfo->display == event.xbutton.display)
1237 { 1237 {
1238 /* If the click is not on the menu, deactivate the menu. */
1239 if (x_any_window_to_frame (dpyinfo, event.xexpose.window))
1240 popup_activated_flag = 0;
1241
1242 dpyinfo->grabbed &= ~(1 << event.xbutton.button); 1238 dpyinfo->grabbed &= ~(1 << event.xbutton.button);
1243#ifdef USE_MOTIF /* Pretending that the event came from a 1239#ifdef USE_MOTIF /* Pretending that the event came from a
1244 Btn1Down seems the only way to convince Motif to 1240 Btn1Down seems the only way to convince Motif to
@@ -2034,7 +2030,7 @@ set_frame_menubar (f, first_time, deep_p)
2034 because it is not reentrant. */ 2030 because it is not reentrant. */
2035 specbind (Qdebug_on_next_call, Qnil); 2031 specbind (Qdebug_on_next_call, Qnil);
2036 2032
2037 record_unwind_protect (Fset_match_data, Fmatch_data (Qnil, Qnil)); 2033 record_unwind_save_match_data ();
2038 record_unwind_protect (unuse_menu_items, Qnil); 2034 record_unwind_protect (unuse_menu_items, Qnil);
2039 if (NILP (Voverriding_local_map_menu_flag)) 2035 if (NILP (Voverriding_local_map_menu_flag))
2040 { 2036 {
diff --git a/src/xterm.c b/src/xterm.c
index be61c15afdd..0a22930fb4f 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -4595,11 +4595,14 @@ x_create_toolkit_scroll_bar (f, bar)
4595 char *initial = ""; 4595 char *initial = "";
4596 char *val = initial; 4596 char *val = initial;
4597 XtVaGetValues (widget, XtNscrollVCursor, (XtPointer) &val, 4597 XtVaGetValues (widget, XtNscrollVCursor, (XtPointer) &val,
4598#ifdef XtNarrowScrollbars
4599 XtNarrowScrollbars, (XtPointer) &xaw3d_arrow_scroll,
4600#endif
4598 XtNpickTop, (XtPointer) &xaw3d_pick_top, NULL); 4601 XtNpickTop, (XtPointer) &xaw3d_pick_top, NULL);
4599 if (val == initial) 4602 if (xaw3d_arrow_scroll || val == initial)
4600 { /* ARROW_SCROLL */ 4603 { /* ARROW_SCROLL */
4601 xaw3d_arrow_scroll = True; 4604 xaw3d_arrow_scroll = True;
4602 /* Isn't that just a personal preference ? -sm */ 4605 /* Isn't that just a personal preference ? --Stef */
4603 XtVaSetValues (widget, XtNcursorName, "top_left_arrow", NULL); 4606 XtVaSetValues (widget, XtNcursorName, "top_left_arrow", NULL);
4604 } 4607 }
4605 } 4608 }