aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa2010-11-25 12:56:41 +0900
committerKenichi Handa2010-11-25 12:56:41 +0900
commite957f9ae90f3cab1584c06877cbff075d52a6a9a (patch)
treed19aea6f4c6a3e369604ab8bc97be6d419073b0c /src
parentb84ae584330c940010bc543fd925eddeb13fd9e2 (diff)
parent33aeea0eb66921329fde41e14cfda2565c6bad6d (diff)
downloademacs-e957f9ae90f3cab1584c06877cbff075d52a6a9a.tar.gz
emacs-e957f9ae90f3cab1584c06877cbff075d52a6a9a.zip
merge emacs-23
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog149
-rw-r--r--src/Makefile.in3
-rw-r--r--src/alloc.c11
-rw-r--r--src/atimer.c6
-rw-r--r--src/config.in28
-rw-r--r--src/dbusbind.c12
-rw-r--r--src/dispextern.h4
-rw-r--r--src/dispnew.c24
-rw-r--r--src/editfns.c4
-rw-r--r--src/font.c37
-rw-r--r--src/frame.c27
-rw-r--r--src/gtkutil.c30
-rw-r--r--src/image.c11
-rw-r--r--src/keyboard.c56
-rw-r--r--src/lread.c4
-rw-r--r--src/m/amdx86-64.h17
-rw-r--r--src/m/ibms390x.h12
-rw-r--r--src/process.c85
-rw-r--r--src/process.h4
-rw-r--r--src/w32.c6
-rw-r--r--src/xdisp.c14
-rw-r--r--src/xfns.c41
-rw-r--r--src/xsettings.c2
-rw-r--r--src/xterm.c70
-rw-r--r--src/xterm.h4
25 files changed, 535 insertions, 126 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 7daa09c703f..45aed177ef2 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -14,6 +14,155 @@
14 * lread.c (read_emacs_mule_char): Adjust for the change of 14 * lread.c (read_emacs_mule_char): Adjust for the change of
15 emacs_mule_charset. 15 emacs_mule_charset.
16 16
172010-11-22 Eli Zaretskii <eliz@gnu.org>
18
19 * w32.c (_PROCESS_MEMORY_COUNTERS_EX): Don't define with versions
20 of w32api >= 3.15. (Bug#6989) (Bug#7452)
21
222010-11-22 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
23
24 * alloc.c (mark_terminals): Ensure that the image cache is marked
25 even if the terminal object was marked earlier (Bug#6301).
26
272010-11-21 Chong Yidong <cyd@stupidchicken.com>
28
29 * editfns.c (Fbyte_to_string): Signal an error arg is not a byte.
30
312010-11-20 Jan Djärv <jan.h.d@swipnet.se>
32
33 * gtkutil.c (menubar_map_cb): New function (Bug#7425).
34 (xg_update_frame_menubar): Connect signal map to menubar_map_cb.
35 Use 23 as menubar height if 0. (Bug#7425).
36
372010-11-14 Jan Djärv <jan.h.d@swipnet.se>
38
39 * xsettings.c (init_gconf): Check HAVE_G_TYPE_INIT.
40
41 * config.in (HAVE_G_TYPE_INIT): New symbol.
42
432010-11-12 Eli Zaretskii <eliz@gnu.org>
44
45 * lread.c (Fload): Mention `load-in-progress' and
46 `load-file-name'. (Bug#7346)
47
482010-11-09 Eli Zaretskii <eliz@gnu.org>
49
50 * keyboard.c (kbd_buffer_nr_stored): Define only ifdef subprocesses.
51 (kbd_buffer_store_event_hold, kbd_buffer_get_event)
52 (tty_read_avail_input): Call kbd_buffer_nr_stored only ifdef
53 subprocesses. Use buffer_free only ifdef subprocesses.
54
55 * process.c (init_process) [subprocesses]: Init kbd_is_on_hold in
56 the subprocesses version, not in the non-subprocesses one.
57
58 * Makefile.in: Don't use ## comment, it breaks the MSDOS build.
59
60 * xfns.c (x_real_positions): Fix declaration-after-statement
61 problem.
62
632010-11-05 Chong Yidong <cyd@stupidchicken.com>
64
65 * image.c (free_image): Don't garbage the frame here, since this
66 function can be called while redisplaying (Bug#7210).
67 (uncache_image): Garbage the frame here (Bug#6426).
68
692010-11-04 Chong Yidong <cyd@stupidchicken.com>
70
71 * process.c (Fmake_network_process): Don't apply Bug#5173 fix for
72 Windows.
73
742010-11-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
75
76 * process.c (Fmake_network_process): Don't call turn_on_atimers around
77 `connect' (Bug#5723).
78
792010-11-04 Helmut Eller <eller.helmut@gmail.com>
80
81 * process.c (Fmake_network_process): Call `select' for interrupted
82 `connect' rather than creating new socket (Bug#5173).
83
842010-11-04 Kenichi Handa <handa@m17n.org>
85
86 * font.c (font_delete_unmatched): Check Vface_ignored_fonts.
87 Don't sheck SPEC if it is nil.
88 (font_list_entities): Call font_delete_unmatched if
89 Vface_ignored_fonts is non-nil.
90
912010-11-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
92
93 * dispextern.h (TRY_WINDOW_CHECK_MARGINS)
94 (TRY_WINDOW_IGNORE_FONTS_CHANGE): New defines.
95
96 * xdisp.c (try_window): Change arg from CHECK_MARGINS to FLAGS.
97 Don't abort with fonts change if TRY_WINDOW_IGNORE_FONTS_CHANGE is
98 set in FLAGS. Callers with non-zero CHECK_MARGINS changed to use
99 TRY_WINDOW_CHECK_MARGINS.
100
101 * xfns.c (Fx_show_tip): Undo last change. Call try_window with
102 TRY_WINDOW_IGNORE_FONTS_CHANGE (Bug#2423).
103
1042010-11-04 Jan Djärv <jan.h.d@swipnet.se>
105
106 * xfns.c (x_real_positions): Only use _NET_FRAME_EXTENTS if our
107 parent is the root window. Check this after traversing window tree.
108
109 * xterm.c (x_term_init): Initialize Xatom_net_frame_extents.
110
111 * xterm.h (struct x_display_info): Xatom_net_frame_extents is new.
112
113 * xfns.c (x_real_positions): Try to get _NET_FRAME_EXTENTS first
114 before traversing window tree (Bug#5721).
115
1162010-11-03 Glenn Morris <rgm@gnu.org>
117
118 * Makefile.in (CRT_DIR): New variable, set by configure.
119 * m/amdx86-64.h, m/ibms390x.h (START_FILES, LIB_STANDARD):
120 Use $CRT_DIR rather than HAVE_LIB64_DIR. (Bug#5655)
121
1222010-11-01 Jan Djärv <jan.h.d@swipnet.se>
123
124 * process.c (kbd_is_on_hold): New variable.
125 (hold_keyboard_input, unhold_keyboard_input, kbd_on_hold_p):
126 New functions.
127 (wait_reading_process_output): If kbd_on_hold_p returns non-zero,
128 select on empty input mask.
129 (init_process): Initialize kbd_is_on_hold to 0.
130
131 * process.h (hold_keyboard_input, unhold_keyboard_input)
132 (kbd_on_hold_p): Declare.
133
134 * keyboard.c (input_available_signal): Declare.
135 (kbd_buffer_nr_stored): New function.
136 (kbd_buffer_store_event_hold): If kbd_buffer_nr_stored returns
137 more than KBD_BUFFER_SIZE/2, stop reding input (Bug#6571).
138 (kbd_buffer_get_event): If input is suspended and kbd_buffer_nr_stored
139 returns less than KBD_BUFFER_SIZE/4, resume reding input (Bug#6571).
140 (tty_read_avail_input): If input is on hold, return.
141 Don't read more that free slots in kbd_buffer (Bug#6571).
142
1432010-10-31 Chong Yidong <cyd@stupidchicken.com>
144
145 * xterm.c (x_connection_closed): Print informative error message
146 when aborting on GTK. This requires using shut_down_emacs
147 directly instead of Fkill_emacs.
148
1492010-10-25 Michael Albinus <michael.albinus@gmx.de>
150
151 * dbusbind.c (Fdbus_call_method_asynchronously)
152 (Fdbus_register_signal, Fdbus_register_method): Check, whether
153 `dbus-registered-objects-table' is initialized.
154
1552010-10-24 Chong Yidong <cyd@stupidchicken.com>
156
157 * xterm.c (x_connection_closed): Kill Emacs unconditionally.
158
1592010-10-22 Eli Zaretskii <eliz@gnu.org>
160
161 * frame.c (Fframep, Fwindow_system): Deprecate use as a predicate.
162
163 * dispnew.c (syms_of_display) <initial-window-system, window-system>:
164 Deprecate use as a boolean flag.
165
172010-10-18 Ken Brown <kbrown@cornell.edu> 1662010-10-18 Ken Brown <kbrown@cornell.edu>
18 167
19 * s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225). 168 * s/cygwin.h (SIGNALS_VIA_CHARACTERS): New define (bug#7225).
diff --git a/src/Makefile.in b/src/Makefile.in
index 9caa01d9066..5187ff4922a 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -67,6 +67,9 @@ bootstrap_exe = ../src/bootstrap-emacs${EXEEXT}
67 67
68OTHER_FILES = @OTHER_FILES@ 68OTHER_FILES = @OTHER_FILES@
69 69
70# Only used by amdx86-64 and ibms390x GNU/Linux.
71CRT_DIR=@CRT_DIR@
72
70# ========================== start of cpp stuff ======================= 73# ========================== start of cpp stuff =======================
71/* From here on, comments must be done in C syntax. */ 74/* From here on, comments must be done in C syntax. */
72 75
diff --git a/src/alloc.c b/src/alloc.c
index da63fe0f82b..4d19d3ac479 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -5771,13 +5771,14 @@ mark_terminals (void)
5771 for (t = terminal_list; t; t = t->next_terminal) 5771 for (t = terminal_list; t; t = t->next_terminal)
5772 { 5772 {
5773 eassert (t->name != NULL); 5773 eassert (t->name != NULL);
5774 if (!VECTOR_MARKED_P (t))
5775 {
5776#ifdef HAVE_WINDOW_SYSTEM 5774#ifdef HAVE_WINDOW_SYSTEM
5777 mark_image_cache (t->image_cache); 5775 /* If a terminal object is reachable from a stacpro'ed object,
5776 it might have been marked already. Make sure the image cache
5777 gets marked. */
5778 mark_image_cache (t->image_cache);
5778#endif /* HAVE_WINDOW_SYSTEM */ 5779#endif /* HAVE_WINDOW_SYSTEM */
5779 mark_vectorlike ((struct Lisp_Vector *)t); 5780 if (!VECTOR_MARKED_P (t))
5780 } 5781 mark_vectorlike ((struct Lisp_Vector *)t);
5781 } 5782 }
5782} 5783}
5783 5784
diff --git a/src/atimer.c b/src/atimer.c
index 432e2590dad..bcd38632ebd 100644
--- a/src/atimer.c
+++ b/src/atimer.c
@@ -175,9 +175,9 @@ cancel_atimer (timer)
175 for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next) 175 for (t = *list, prev = NULL; t && t != timer; prev = t, t = t->next)
176 ; 176 ;
177 177
178 /* If it is, take it off the its list, and put in on the 178 /* If it is, take it off its list, and put in on the free-list.
179 free-list. We don't bother to arrange for setting a 179 We don't bother to arrange for setting a different alarm time,
180 different alarm time, since a too early one doesn't hurt. */ 180 since a too early one doesn't hurt. */
181 if (t) 181 if (t)
182 { 182 {
183 if (prev) 183 if (prev)
diff --git a/src/config.in b/src/config.in
index 4667c0feb28..f7c5bbc7daf 100644
--- a/src/config.in
+++ b/src/config.in
@@ -292,6 +292,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
292/* Define to 1 if GTK can handle more than one display. */ 292/* Define to 1 if GTK can handle more than one display. */
293#undef HAVE_GTK_MULTIDISPLAY 293#undef HAVE_GTK_MULTIDISPLAY
294 294
295/* Define to 1 if you have the `g_type_init' function. */
296#undef HAVE_G_TYPE_INIT
297
295/* Define to 1 if netdb.h declares h_errno. */ 298/* Define to 1 if netdb.h declares h_errno. */
296#undef HAVE_H_ERRNO 299#undef HAVE_H_ERRNO
297 300
@@ -334,9 +337,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
334/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ 337/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
335#undef HAVE_LANGINFO_CODESET 338#undef HAVE_LANGINFO_CODESET
336 339
337/* Define to 1 if the directory /usr/lib64 exists. */
338#undef HAVE_LIB64_DIR
339
340/* Define to 1 if you have the `com_err' library (-lcom_err). */ 340/* Define to 1 if you have the `com_err' library (-lcom_err). */
341#undef HAVE_LIBCOM_ERR 341#undef HAVE_LIBCOM_ERR
342 342
@@ -1178,15 +1178,19 @@ extern char *getenv ();
1178#ifdef HAVE_STDLIB_H 1178#ifdef HAVE_STDLIB_H
1179#include <stdlib.h> 1179#include <stdlib.h>
1180#endif 1180#endif
1181#ifndef __GNUC__ 1181#ifdef HAVE_ALLOCA_H
1182# ifdef HAVE_ALLOCA_H 1182# include <alloca.h>
1183# include <alloca.h> 1183#elif defined __GNUC__
1184# else /* AIX files deal with #pragma. */ 1184# define alloca __builtin_alloca
1185# ifndef alloca /* predefined by HP cc +Olibcalls */ 1185#elif defined _AIX
1186char *alloca (); 1186# define alloca __alloca
1187# endif 1187#else
1188# endif /* HAVE_ALLOCA_H */ 1188# include <stddef.h>
1189#endif /* __GNUC__ */ 1189# ifdef __cplusplus
1190extern "C"
1191# endif
1192void *alloca (size_t);
1193#endif
1190#ifndef HAVE_SIZE_T 1194#ifndef HAVE_SIZE_T
1191typedef unsigned size_t; 1195typedef unsigned size_t;
1192#endif 1196#endif
diff --git a/src/dbusbind.c b/src/dbusbind.c
index 60697c8a4e9..37bfbf4badf 100644
--- a/src/dbusbind.c
+++ b/src/dbusbind.c
@@ -1175,6 +1175,10 @@ usage: (dbus-call-method-asynchronously BUS SERVICE PATH INTERFACE METHOD HANDLE
1175 SDATA (interface), 1175 SDATA (interface),
1176 SDATA (method)); 1176 SDATA (method));
1177 1177
1178 /* Check dbus-registered-objects-table. */
1179 if (!HASH_TABLE_P (Vdbus_registered_objects_table))
1180 XD_SIGNAL1 (build_string ("dbus.el is not loaded"));
1181
1178 /* Open a connection to the bus. */ 1182 /* Open a connection to the bus. */
1179 connection = xd_initialize (bus); 1183 connection = xd_initialize (bus);
1180 1184
@@ -1863,6 +1867,10 @@ usage: (dbus-register-signal BUS SERVICE PATH INTERFACE SIGNAL HANDLER &rest ARG
1863 wrong_type_argument (intern ("functionp"), handler); 1867 wrong_type_argument (intern ("functionp"), handler);
1864 GCPRO6 (bus, service, path, interface, signal, handler); 1868 GCPRO6 (bus, service, path, interface, signal, handler);
1865 1869
1870 /* Check dbus-registered-objects-table. */
1871 if (!HASH_TABLE_P (Vdbus_registered_objects_table))
1872 XD_SIGNAL1 (build_string ("dbus.el is not loaded"));
1873
1866 /* Retrieve unique name of service. If service is a known name, we 1874 /* Retrieve unique name of service. If service is a known name, we
1867 will register for the corresponding unique name, if any. Signals 1875 will register for the corresponding unique name, if any. Signals
1868 are sent always with the unique name as sender. Note: the unique 1876 are sent always with the unique name as sender. Note: the unique
@@ -1976,6 +1984,10 @@ used for composing the returning D-Bus message. */)
1976 /* TODO: We must check for a valid service name, otherwise there is 1984 /* TODO: We must check for a valid service name, otherwise there is
1977 a segmentation fault. */ 1985 a segmentation fault. */
1978 1986
1987 /* Check dbus-registered-objects-table. */
1988 if (!HASH_TABLE_P (Vdbus_registered_objects_table))
1989 XD_SIGNAL1 (build_string ("dbus.el is not loaded"));
1990
1979 /* Open a connection to the bus. */ 1991 /* Open a connection to the bus. */
1980 connection = xd_initialize (bus); 1992 connection = xd_initialize (bus);
1981 1993
diff --git a/src/dispextern.h b/src/dispextern.h
index ca91c5b6812..bc34aec2dd5 100644
--- a/src/dispextern.h
+++ b/src/dispextern.h
@@ -2841,6 +2841,10 @@ extern int x_intersect_rectangles P_ ((XRectangle *, XRectangle *,
2841 XRectangle *)); 2841 XRectangle *));
2842#endif 2842#endif
2843 2843
2844/* Flags passed to try_window. */
2845#define TRY_WINDOW_CHECK_MARGINS (1 << 0)
2846#define TRY_WINDOW_IGNORE_FONTS_CHANGE (1 << 1)
2847
2844/* Defined in fringe.c */ 2848/* Defined in fringe.c */
2845 2849
2846int lookup_fringe_bitmap (Lisp_Object); 2850int lookup_fringe_bitmap (Lisp_Object);
diff --git a/src/dispnew.c b/src/dispnew.c
index d32ce48cce6..b6149057a5a 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -7141,13 +7141,29 @@ It is up to you to set this variable if your terminal can do that. */);
7141 7141
7142 DEFVAR_LISP ("initial-window-system", &Vinitial_window_system, 7142 DEFVAR_LISP ("initial-window-system", &Vinitial_window_system,
7143 doc: /* Name of the window system that Emacs uses for the first frame. 7143 doc: /* Name of the window system that Emacs uses for the first frame.
7144The value is a symbol--for instance, `x' for X windows. 7144The value is a symbol:
7145The value is nil if Emacs is using a text-only terminal. */); 7145 nil for a termcap frame (a character-only terminal),
7146 'x' for an Emacs frame that is really an X window,
7147 'w32' for an Emacs frame that is a window on MS-Windows display,
7148 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
7149 'pc' for a direct-write MS-DOS frame.
7150
7151Use of this variable as a boolean is deprecated. Instead,
7152use `display-graphic-p' or any of the other `display-*-p'
7153predicates which report frame's specific UI-related capabilities. */);
7146 7154
7147 DEFVAR_KBOARD ("window-system", Vwindow_system, 7155 DEFVAR_KBOARD ("window-system", Vwindow_system,
7148 doc: /* Name of window system through which the selected frame is displayed. 7156 doc: /* Name of window system through which the selected frame is displayed.
7149The value is a symbol--for instance, `x' for X windows. 7157The value is a symbol:
7150The value is nil if the selected frame is on a text-only-terminal. */); 7158 nil for a termcap frame (a character-only terminal),
7159 'x' for an Emacs frame that is really an X window,
7160 'w32' for an Emacs frame that is a window on MS-Windows display,
7161 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
7162 'pc' for a direct-write MS-DOS frame.
7163
7164Use of this variable as a boolean is deprecated. Instead,
7165use `display-graphic-p' or any of the other `display-*-p'
7166predicates which report frame's specific UI-related capabilities. */);
7151 7167
7152 DEFVAR_LISP ("window-system-version", &Vwindow_system_version, 7168 DEFVAR_LISP ("window-system-version", &Vwindow_system_version,
7153 doc: /* The version number of the window system in use. 7169 doc: /* The version number of the window system in use.
diff --git a/src/editfns.c b/src/editfns.c
index ea279a462f2..910fd13aed4 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -222,12 +222,14 @@ usage: (char-to-string CHAR) */)
222} 222}
223 223
224DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0, 224DEFUN ("byte-to-string", Fbyte_to_string, Sbyte_to_string, 1, 1, 0,
225 doc: /* Convert arg BYTE to a string containing that byte. */) 225 doc: /* Convert arg BYTE to a unibyte string containing that byte. */)
226 (byte) 226 (byte)
227 Lisp_Object byte; 227 Lisp_Object byte;
228{ 228{
229 unsigned char b; 229 unsigned char b;
230 CHECK_NUMBER (byte); 230 CHECK_NUMBER (byte);
231 if (XINT (byte) < 0 || XINT (byte) > 255)
232 error ("Invalid byte");
231 b = XINT (byte); 233 b = XINT (byte);
232 return make_string_from_bytes (&b, 1, 1); 234 return make_string_from_bytes (&b, 1, 1);
233} 235}
diff --git a/src/font.c b/src/font.c
index 77f43c81d71..f65b04255e2 100644
--- a/src/font.c
+++ b/src/font.c
@@ -2821,6 +2821,14 @@ font_clear_cache (f, cache, driver)
2821 2821
2822static Lisp_Object scratch_font_spec, scratch_font_prefer; 2822static Lisp_Object scratch_font_spec, scratch_font_prefer;
2823 2823
2824/* Check each font-entity in VEC, and return a list of font-entities
2825 that satisfy this condition:
2826 (1) matches with SPEC and SIZE if SPEC is not nil, and
2827 (2) doesn't match with any regexps in Vface_ignored_fonts (if non-nil).
2828*/
2829
2830extern Lisp_Object Vface_ignored_fonts;
2831
2824Lisp_Object 2832Lisp_Object
2825font_delete_unmatched (vec, spec, size) 2833font_delete_unmatched (vec, spec, size)
2826 Lisp_Object vec, spec; 2834 Lisp_Object vec, spec;
@@ -2833,6 +2841,29 @@ font_delete_unmatched (vec, spec, size)
2833 for (val = Qnil, i = ASIZE (vec) - 1; i >= 0; i--) 2841 for (val = Qnil, i = ASIZE (vec) - 1; i >= 0; i--)
2834 { 2842 {
2835 entity = AREF (vec, i); 2843 entity = AREF (vec, i);
2844 if (! NILP (Vface_ignored_fonts))
2845 {
2846 char name[256];
2847 Lisp_Object tail, regexp;
2848
2849 if (font_unparse_xlfd (entity, 0, name, 256) >= 0)
2850 {
2851 for (tail = Vface_ignored_fonts; CONSP (tail); tail = XCDR (tail))
2852 {
2853 regexp = XCAR (tail);
2854 if (STRINGP (regexp)
2855 && fast_c_string_match_ignore_case (regexp, name) >= 0)
2856 break;
2857 }
2858 if (CONSP (tail))
2859 continue;
2860 }
2861 }
2862 if (NILP (spec))
2863 {
2864 val = Fcons (entity, val);
2865 continue;
2866 }
2836 for (prop = FONT_WEIGHT_INDEX; prop < FONT_SIZE_INDEX; prop++) 2867 for (prop = FONT_WEIGHT_INDEX; prop < FONT_SIZE_INDEX; prop++)
2837 if (INTEGERP (AREF (spec, prop)) 2868 if (INTEGERP (AREF (spec, prop))
2838 && ((XINT (AREF (spec, prop)) >> 8) 2869 && ((XINT (AREF (spec, prop)) >> 8)
@@ -2932,8 +2963,10 @@ font_list_entities (frame, spec)
2932 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type); 2963 ASET (copy, FONT_TYPE_INDEX, driver_list->driver->type);
2933 XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache))); 2964 XSETCDR (cache, Fcons (Fcons (copy, val), XCDR (cache)));
2934 } 2965 }
2935 if (ASIZE (val) > 0 && need_filtering) 2966 if (ASIZE (val) > 0
2936 val = font_delete_unmatched (val, spec, size); 2967 && (need_filtering
2968 || ! NILP (Vface_ignored_fonts)))
2969 val = font_delete_unmatched (val, need_filtering ? spec : Qnil, size);
2937 if (ASIZE (val) > 0) 2970 if (ASIZE (val) > 0)
2938 list = Fcons (val, list); 2971 list = Fcons (val, list);
2939 } 2972 }
diff --git a/src/frame.c b/src/frame.c
index a30d1e18175..c542cae5f6d 100644
--- a/src/frame.c
+++ b/src/frame.c
@@ -211,11 +211,12 @@ extern Lisp_Object QCname, Qfont_param;
211 211
212DEFUN ("framep", Fframep, Sframep, 1, 1, 0, 212DEFUN ("framep", Fframep, Sframep, 1, 1, 0,
213 doc: /* Return non-nil if OBJECT is a frame. 213 doc: /* Return non-nil if OBJECT is a frame.
214Value is t for a termcap frame (a character-only terminal), 214Value is:
215`x' for an Emacs frame that is really an X window, 215 t for a termcap frame (a character-only terminal),
216`w32' for an Emacs frame that is a window on MS-Windows display, 216 'x' for an Emacs frame that is really an X window,
217`ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display, 217 'w32' for an Emacs frame that is a window on MS-Windows display,
218`pc' for a direct-write MS-DOS frame. 218 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
219 'pc' for a direct-write MS-DOS frame.
219See also `frame-live-p'. */) 220See also `frame-live-p'. */)
220 (object) 221 (object)
221 Lisp_Object object; 222 Lisp_Object object;
@@ -259,10 +260,18 @@ return values. */)
259 260
260DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0, 261DEFUN ("window-system", Fwindow_system, Swindow_system, 0, 1, 0,
261 doc: /* The name of the window system that FRAME is displaying through. 262 doc: /* The name of the window system that FRAME is displaying through.
262The value is a symbol---for instance, 'x' for X windows. 263The value is a symbol:
263The value is nil if Emacs is using a text-only terminal. 264 nil for a termcap frame (a character-only terminal),
264 265 'x' for an Emacs frame that is really an X window,
265FRAME defaults to the currently selected frame. */) 266 'w32' for an Emacs frame that is a window on MS-Windows display,
267 'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
268 'pc' for a direct-write MS-DOS frame.
269
270FRAME defaults to the currently selected frame.
271
272Use of this function as a predicate is deprecated. Instead,
273use `display-graphic-p' or any of the other `display-*-p'
274predicates which report frame's specific UI-related capabilities. */)
266 (frame) 275 (frame)
267 Lisp_Object frame; 276 Lisp_Object frame;
268{ 277{
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 7a25bbb1e3f..7102823a814 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -2936,6 +2936,23 @@ xg_modify_menubar_widgets (menubar, f, val, deep_p,
2936 gtk_widget_show_all (menubar); 2936 gtk_widget_show_all (menubar);
2937} 2937}
2938 2938
2939/* Callback called when the menu bar W is mapped.
2940 Used to find the height of the menu bar if we didn't get it
2941 after showing the widget. */
2942
2943static void
2944menubar_map_cb (GtkWidget *w, gpointer user_data)
2945{
2946 GtkRequisition req;
2947 FRAME_PTR f = (FRAME_PTR) user_data;
2948 gtk_widget_size_request (w, &req);
2949 if (FRAME_MENUBAR_HEIGHT (f) != req.height)
2950 {
2951 FRAME_MENUBAR_HEIGHT (f) = req.height;
2952 xg_height_changed (f);
2953 }
2954}
2955
2939/* Recompute all the widgets of frame F, when the menu bar has been 2956/* Recompute all the widgets of frame F, when the menu bar has been
2940 changed. Value is non-zero if widgets were updated. */ 2957 changed. Value is non-zero if widgets were updated. */
2941 2958
@@ -2958,10 +2975,19 @@ xg_update_frame_menubar (f)
2958 FALSE, FALSE, 0); 2975 FALSE, FALSE, 0);
2959 gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0); 2976 gtk_box_reorder_child (GTK_BOX (x->vbox_widget), x->menubar_widget, 0);
2960 2977
2978 g_signal_connect (x->menubar_widget, "map", G_CALLBACK (menubar_map_cb), f);
2961 gtk_widget_show_all (x->menubar_widget); 2979 gtk_widget_show_all (x->menubar_widget);
2962 gtk_widget_size_request (x->menubar_widget, &req); 2980 gtk_widget_size_request (x->menubar_widget, &req);
2963 FRAME_MENUBAR_HEIGHT (f) = req.height; 2981 /* If menu bar doesn't know its height yet, cheat a little so the frame
2964 xg_height_changed (f); 2982 doesn't jump so much when resized later in menubar_map_cb. */
2983 if (req.height == 0)
2984 req.height = 23;
2985
2986 if (FRAME_MENUBAR_HEIGHT (f) != req.height)
2987 {
2988 FRAME_MENUBAR_HEIGHT (f) = req.height;
2989 xg_height_changed (f);
2990 }
2965 UNBLOCK_INPUT; 2991 UNBLOCK_INPUT;
2966 2992
2967 return 1; 2993 return 1;
diff --git a/src/image.c b/src/image.c
index e7db3a7df1b..0fa0a0cd064 100644
--- a/src/image.c
+++ b/src/image.c
@@ -1094,10 +1094,6 @@ free_image (f, img)
1094 /* Free resources, then free IMG. */ 1094 /* Free resources, then free IMG. */
1095 img->type->free (f, img); 1095 img->type->free (f, img);
1096 xfree (img); 1096 xfree (img);
1097
1098 /* As display glyphs may still be referring to the image ID, we
1099 must garbage the frame (Bug#6426). */
1100 SET_FRAME_GARBAGED (f);
1101 } 1097 }
1102} 1098}
1103 1099
@@ -1544,7 +1540,12 @@ uncache_image (f, spec)
1544{ 1540{
1545 struct image *img = search_image_cache (f, spec, sxhash (spec, 0)); 1541 struct image *img = search_image_cache (f, spec, sxhash (spec, 0));
1546 if (img) 1542 if (img)
1547 free_image (f, img); 1543 {
1544 free_image (f, img);
1545 /* As display glyphs may still be referring to the image ID, we
1546 must garbage the frame (Bug#6426). */
1547 SET_FRAME_GARBAGED (f);
1548 }
1548} 1549}
1549 1550
1550 1551
diff --git a/src/keyboard.c b/src/keyboard.c
index 22c58985a56..b35e4ae84e2 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -642,6 +642,9 @@ static Lisp_Object apply_modifiers P_ ((int, Lisp_Object));
642static void clear_event P_ ((struct input_event *)); 642static void clear_event P_ ((struct input_event *));
643static Lisp_Object restore_kboard_configuration P_ ((Lisp_Object)); 643static Lisp_Object restore_kboard_configuration P_ ((Lisp_Object));
644static SIGTYPE interrupt_signal P_ ((int signalnum)); 644static SIGTYPE interrupt_signal P_ ((int signalnum));
645#ifdef SIGIO
646static SIGTYPE input_available_signal (int signo);
647#endif
645static void handle_interrupt P_ ((void)); 648static void handle_interrupt P_ ((void));
646static void timer_start_idle P_ ((void)); 649static void timer_start_idle P_ ((void));
647static void timer_stop_idle P_ ((void)); 650static void timer_stop_idle P_ ((void));
@@ -3780,6 +3783,20 @@ event_to_kboard (event)
3780 return FRAME_KBOARD (XFRAME (frame)); 3783 return FRAME_KBOARD (XFRAME (frame));
3781} 3784}
3782 3785
3786#ifdef subprocesses
3787/* Return the number of slots occupied in kbd_buffer. */
3788
3789static int
3790kbd_buffer_nr_stored (void)
3791{
3792 return kbd_fetch_ptr == kbd_store_ptr
3793 ? 0
3794 : (kbd_fetch_ptr < kbd_store_ptr
3795 ? kbd_store_ptr - kbd_fetch_ptr
3796 : ((kbd_buffer + KBD_BUFFER_SIZE) - kbd_fetch_ptr
3797 + (kbd_store_ptr - kbd_buffer)));
3798}
3799#endif /* subprocesses */
3783 3800
3784Lisp_Object Vthrow_on_input; 3801Lisp_Object Vthrow_on_input;
3785 3802
@@ -3903,6 +3920,19 @@ kbd_buffer_store_event_hold (event, hold_quit)
3903 { 3920 {
3904 *kbd_store_ptr = *event; 3921 *kbd_store_ptr = *event;
3905 ++kbd_store_ptr; 3922 ++kbd_store_ptr;
3923#ifdef subprocesses
3924 if (kbd_buffer_nr_stored () > KBD_BUFFER_SIZE/2 && ! kbd_on_hold_p ())
3925 {
3926 /* Don't read keyboard input until we have processed kbd_buffer.
3927 This happens when pasting text longer than KBD_BUFFER_SIZE/2. */
3928 hold_keyboard_input ();
3929#ifdef SIGIO
3930 if (!noninteractive)
3931 signal (SIGIO, SIG_IGN);
3932#endif
3933 stop_polling ();
3934 }
3935#endif /* subprocesses */
3906 } 3936 }
3907 3937
3908 /* If we're inside while-no-input, and this event qualifies 3938 /* If we're inside while-no-input, and this event qualifies
@@ -4071,6 +4101,20 @@ kbd_buffer_get_event (kbp, used_mouse_menu, end_time)
4071 register int c; 4101 register int c;
4072 Lisp_Object obj; 4102 Lisp_Object obj;
4073 4103
4104#ifdef subprocesses
4105 if (kbd_on_hold_p () && kbd_buffer_nr_stored () < KBD_BUFFER_SIZE/4)
4106 {
4107 /* Start reading input again, we have processed enough so we can
4108 accept new events again. */
4109 unhold_keyboard_input ();
4110#ifdef SIGIO
4111 if (!noninteractive)
4112 signal (SIGIO, input_available_signal);
4113#endif /* SIGIO */
4114 start_polling ();
4115 }
4116#endif /* subprocesses */
4117
4074 if (noninteractive 4118 if (noninteractive
4075 /* In case we are running as a daemon, only do this before 4119 /* In case we are running as a daemon, only do this before
4076 detaching from the terminal. */ 4120 detaching from the terminal. */
@@ -7270,6 +7314,12 @@ tty_read_avail_input (struct terminal *terminal,
7270 int n_to_read, i; 7314 int n_to_read, i;
7271 struct tty_display_info *tty = terminal->display_info.tty; 7315 struct tty_display_info *tty = terminal->display_info.tty;
7272 int nread = 0; 7316 int nread = 0;
7317#ifdef subprocesses
7318 int buffer_free = KBD_BUFFER_SIZE - kbd_buffer_nr_stored () - 1;
7319
7320 if (kbd_on_hold_p () || buffer_free <= 0)
7321 return 0;
7322#endif /* subprocesses */
7273 7323
7274 if (!terminal->name) /* Don't read from a dead terminal. */ 7324 if (!terminal->name) /* Don't read from a dead terminal. */
7275 return 0; 7325 return 0;
@@ -7351,6 +7401,12 @@ tty_read_avail_input (struct terminal *terminal,
7351#endif 7401#endif
7352#endif 7402#endif
7353 7403
7404#ifdef subprocesses
7405 /* Don't read more than we can store. */
7406 if (n_to_read > buffer_free)
7407 n_to_read = buffer_free;
7408#endif /* subprocesses */
7409
7354 /* Now read; for one reason or another, this will not block. 7410 /* Now read; for one reason or another, this will not block.
7355 NREAD is set to the number of chars read. */ 7411 NREAD is set to the number of chars read. */
7356 do 7412 do
diff --git a/src/lread.c b/src/lread.c
index 13de4d01317..17861d3bb23 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -1007,6 +1007,10 @@ Loading a file records its definitions, and its `provide' and
1007`require' calls, in an element of `load-history' whose 1007`require' calls, in an element of `load-history' whose
1008car is the file name loaded. See `load-history'. 1008car is the file name loaded. See `load-history'.
1009 1009
1010While the file is in the process of being loaded, the variable
1011`load-in-progress' is non-nil and the variable `load-file-name'
1012is bound to the file's name.
1013
1010Return t if the file exists and loads successfully. */) 1014Return t if the file exists and loads successfully. */)
1011 (file, noerror, nomessage, nosuffix, must_suffix) 1015 (file, noerror, nomessage, nosuffix, must_suffix)
1012 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix; 1016 Lisp_Object file, noerror, nomessage, nosuffix, must_suffix;
diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h
index 4bea30d12de..0401b8bf90f 100644
--- a/src/m/amdx86-64.h
+++ b/src/m/amdx86-64.h
@@ -80,7 +80,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
80 a native binary of Emacs on FreeBSD/amd64 we can just point to /usr/lib. */ 80 a native binary of Emacs on FreeBSD/amd64 we can just point to /usr/lib. */
81 81
82#undef START_FILES 82#undef START_FILES
83#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o 83#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
84 84
85/* The duplicate -lgcc is intentional in the definition of LIB_STANDARD. 85/* The duplicate -lgcc is intentional in the definition of LIB_STANDARD.
86 The reason is that some functions in libgcc.a call functions from libc.a, 86 The reason is that some functions in libgcc.a call functions from libc.a,
@@ -88,14 +88,14 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
88 versions of ld are one-pass linkers, we need to mention -lgcc twice, 88 versions of ld are one-pass linkers, we need to mention -lgcc twice,
89 or else we risk getting unresolved externals. */ 89 or else we risk getting unresolved externals. */
90#undef LIB_STANDARD 90#undef LIB_STANDARD
91#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o 91#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
92 92
93#elif defined(__OpenBSD__) 93#elif defined(__OpenBSD__)
94 94
95#undef START_FILES 95#undef START_FILES
96#define START_FILES pre-crt0.o /usr/lib/crt0.o /usr/lib/crtbegin.o 96#define START_FILES pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o
97#undef LIB_STANDARD 97#undef LIB_STANDARD
98#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o 98#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtend.o
99 99
100#elif defined(__NetBSD__) 100#elif defined(__NetBSD__)
101 101
@@ -119,13 +119,8 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
119 or else we risk getting unresolved externals. */ 119 or else we risk getting unresolved externals. */
120#undef START_FILES 120#undef START_FILES
121#undef LIB_STANDARD 121#undef LIB_STANDARD
122#ifdef HAVE_LIB64_DIR 122#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
123#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o 123#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
124#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
125#else
126#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
127#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
128#endif
129 124
130#endif /* __FreeBSD__ */ 125#endif /* __FreeBSD__ */
131#endif /* !i386 */ 126#endif /* !i386 */
diff --git a/src/m/ibms390x.h b/src/m/ibms390x.h
index 9429e4282bf..ea0fa11ec3f 100644
--- a/src/m/ibms390x.h
+++ b/src/m/ibms390x.h
@@ -91,18 +91,10 @@ NOTE-END */
91#define XPNTR(a) XUINT (a) 91#define XPNTR(a) XUINT (a)
92 92
93#undef START_FILES 93#undef START_FILES
94#ifdef HAVE_LIB64_DIR 94#define START_FILES pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o
95#define START_FILES pre-crt0.o /usr/lib64/crt1.o /usr/lib64/crti.o
96#else
97#define START_FILES pre-crt0.o /usr/lib/crt1.o /usr/lib/crti.o
98#endif
99 95
100#undef LIB_STANDARD 96#undef LIB_STANDARD
101#ifdef HAVE_LIB64_DIR 97#define LIB_STANDARD -lgcc -lc -lgcc $(CRT_DIR)/crtn.o
102#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib64/crtn.o
103#else
104#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtn.o
105#endif
106 98
107/* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519 99/* arch-tag: 4b87653c-6add-4663-8691-7d9dc17b5519
108 (do not change this comment) */ 100 (do not change this comment) */
diff --git a/src/process.c b/src/process.c
index 3e2aa61ffe6..384a7acfccd 100644
--- a/src/process.c
+++ b/src/process.c
@@ -346,6 +346,9 @@ static int max_keyboard_desc;
346/* The largest descriptor currently in use for gpm mouse input. */ 346/* The largest descriptor currently in use for gpm mouse input. */
347static int max_gpm_desc; 347static int max_gpm_desc;
348 348
349/* Non-zero if keyboard input is on hold, zero otherwise. */
350static int kbd_is_on_hold;
351
349/* Nonzero means delete a process right away if it exits. */ 352/* Nonzero means delete a process right away if it exits. */
350static int delete_exited_processes; 353static int delete_exited_processes;
351 354
@@ -3653,23 +3656,9 @@ usage: (make-network-process &rest ARGS) */)
3653 immediate_quit = 1; 3656 immediate_quit = 1;
3654 QUIT; 3657 QUIT;
3655 3658
3656 /* This turns off all alarm-based interrupts; the
3657 bind_polling_period call above doesn't always turn all the
3658 short-interval ones off, especially if interrupt_input is
3659 set.
3660
3661 It'd be nice to be able to control the connect timeout
3662 though. Would non-blocking connect calls be portable?
3663
3664 This used to be conditioned by HAVE_GETADDRINFO. Why? */
3665
3666 turn_on_atimers (0);
3667
3668 ret = connect (s, lres->ai_addr, lres->ai_addrlen); 3659 ret = connect (s, lres->ai_addr, lres->ai_addrlen);
3669 xerrno = errno; 3660 xerrno = errno;
3670 3661
3671 turn_on_atimers (1);
3672
3673 if (ret == 0 || xerrno == EISCONN) 3662 if (ret == 0 || xerrno == EISCONN)
3674 { 3663 {
3675 /* The unwind-protect will be discarded afterwards. 3664 /* The unwind-protect will be discarded afterwards.
@@ -3689,6 +3678,40 @@ usage: (make-network-process &rest ARGS) */)
3689#endif 3678#endif
3690#endif 3679#endif
3691 3680
3681#ifndef WINDOWSNT
3682 if (xerrno == EINTR)
3683 {
3684 /* Unlike most other syscalls connect() cannot be called
3685 again. (That would return EALREADY.) The proper way to
3686 wait for completion is select(). */
3687 int sc, len;
3688 SELECT_TYPE fdset;
3689 retry_select:
3690 FD_ZERO (&fdset);
3691 FD_SET (s, &fdset);
3692 QUIT;
3693 sc = select (s + 1, (SELECT_TYPE *)0, &fdset, (SELECT_TYPE *)0,
3694 (EMACS_TIME *)0);
3695 if (sc == -1)
3696 {
3697 if (errno == EINTR)
3698 goto retry_select;
3699 else
3700 report_file_error ("select failed", Qnil);
3701 }
3702 eassert (sc > 0);
3703
3704 len = sizeof xerrno;
3705 eassert (FD_ISSET (s, &fdset));
3706 if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1)
3707 report_file_error ("getsockopt failed", Qnil);
3708 if (xerrno)
3709 errno = xerrno, report_file_error ("error during connect", Qnil);
3710 else
3711 break;
3712 }
3713#endif /* !WINDOWSNT */
3714
3692 immediate_quit = 0; 3715 immediate_quit = 0;
3693 3716
3694 /* Discard the unwind protect closing S. */ 3717 /* Discard the unwind protect closing S. */
@@ -3696,8 +3719,10 @@ usage: (make-network-process &rest ARGS) */)
3696 emacs_close (s); 3719 emacs_close (s);
3697 s = -1; 3720 s = -1;
3698 3721
3722#ifdef WINDOWSNT
3699 if (xerrno == EINTR) 3723 if (xerrno == EINTR)
3700 goto retry_connect; 3724 goto retry_connect;
3725#endif
3701 } 3726 }
3702 3727
3703 if (s >= 0) 3728 if (s >= 0)
@@ -4795,7 +4820,11 @@ wait_reading_process_output (time_limit, microsecs, read_kbd, do_display,
4795 SELECT_TYPE Ctemp; 4820 SELECT_TYPE Ctemp;
4796#endif 4821#endif
4797 4822
4798 Atemp = input_wait_mask; 4823 if (kbd_on_hold_p ())
4824 FD_ZERO (&Atemp);
4825 else
4826 Atemp = input_wait_mask;
4827
4799 IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask); 4828 IF_NON_BLOCKING_CONNECT (Ctemp = connect_wait_mask);
4800 4829
4801 EMACS_SET_SECS_USECS (timeout, 0, 0); 4830 EMACS_SET_SECS_USECS (timeout, 0, 0);
@@ -7224,6 +7253,31 @@ keyboard_bit_set (mask)
7224 7253
7225 return 0; 7254 return 0;
7226} 7255}
7256
7257/* Stop reading input from keyboard sources. */
7258
7259void
7260hold_keyboard_input (void)
7261{
7262 kbd_is_on_hold = 1;
7263}
7264
7265/* Resume reading input from keyboard sources. */
7266
7267void
7268unhold_keyboard_input (void)
7269{
7270 kbd_is_on_hold = 0;
7271}
7272
7273/* Return non-zero if keyboard input is on hold, zero otherwise. */
7274
7275int
7276kbd_on_hold_p (void)
7277{
7278 return kbd_is_on_hold;
7279}
7280
7227 7281
7228/* Enumeration of and access to system processes a-la ps(1). */ 7282/* Enumeration of and access to system processes a-la ps(1). */
7229 7283
@@ -7302,6 +7356,7 @@ init_process ()
7302 register int i; 7356 register int i;
7303 7357
7304 inhibit_sentinels = 0; 7358 inhibit_sentinels = 0;
7359 kbd_is_on_hold = 0;
7305 7360
7306#ifdef SIGCHLD 7361#ifdef SIGCHLD
7307#ifndef CANNOT_DUMP 7362#ifndef CANNOT_DUMP
diff --git a/src/process.h b/src/process.h
index a8cd0a02da6..12b91d697b9 100644
--- a/src/process.h
+++ b/src/process.h
@@ -170,5 +170,9 @@ extern Lisp_Object Qtime, Qctime;
170extern Lisp_Object list_system_processes (void); 170extern Lisp_Object list_system_processes (void);
171extern Lisp_Object system_process_attributes (Lisp_Object); 171extern Lisp_Object system_process_attributes (Lisp_Object);
172 172
173extern void hold_keyboard_input (void);
174extern void unhold_keyboard_input (void);
175extern int kbd_on_hold_p (void);
176
173/* arch-tag: dffedfc4-d7bc-4b58-a26f-c16155449c72 177/* arch-tag: dffedfc4-d7bc-4b58-a26f-c16155449c72
174 (do not change this comment) */ 178 (do not change this comment) */
diff --git a/src/w32.c b/src/w32.c
index d96abd346f5..1b01a631850 100644
--- a/src/w32.c
+++ b/src/w32.c
@@ -94,8 +94,11 @@ typedef struct _MEMORY_STATUS_EX {
94 94
95#include <tlhelp32.h> 95#include <tlhelp32.h>
96#include <psapi.h> 96#include <psapi.h>
97#include <w32api.h>
98#if !defined(__MINGW32__) || __W32API_MAJOR_VERSION < 3 || (__W32API_MAJOR_VERSION == 3 && __W32API_MINOR_VERSION < 15)
97/* This either is not in psapi.h or guarded by higher value of 99/* This either is not in psapi.h or guarded by higher value of
98 _WIN32_WINNT than what we use. */ 100 _WIN32_WINNT than what we use. w32api supplied with MinGW 3.15
101 defines it in psapi.h */
99typedef struct _PROCESS_MEMORY_COUNTERS_EX { 102typedef struct _PROCESS_MEMORY_COUNTERS_EX {
100 DWORD cb; 103 DWORD cb;
101 DWORD PageFaultCount; 104 DWORD PageFaultCount;
@@ -109,6 +112,7 @@ typedef struct _PROCESS_MEMORY_COUNTERS_EX {
109 DWORD PeakPagefileUsage; 112 DWORD PeakPagefileUsage;
110 DWORD PrivateUsage; 113 DWORD PrivateUsage;
111} PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX; 114} PROCESS_MEMORY_COUNTERS_EX,*PPROCESS_MEMORY_COUNTERS_EX;
115#endif
112 116
113#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */ 117#ifdef HAVE_SOCKETS /* TCP connection support, if kernel can do it */
114#include <sys/socket.h> 118#include <sys/socket.h>
diff --git a/src/xdisp.c b/src/xdisp.c
index 59e38e440e4..a416c8ff435 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -13577,7 +13577,7 @@ redisplay_window (window, just_this_one_p)
13577 = try_window_reusing_current_matrix (w))) 13577 = try_window_reusing_current_matrix (w)))
13578 { 13578 {
13579 IF_DEBUG (debug_method_add (w, "1")); 13579 IF_DEBUG (debug_method_add (w, "1"));
13580 if (try_window (window, startp, 1) < 0) 13580 if (try_window (window, startp, TRY_WINDOW_CHECK_MARGINS) < 0)
13581 /* -1 means we need to scroll. 13581 /* -1 means we need to scroll.
13582 0 means we need new matrices, but fonts_changed_p 13582 0 means we need new matrices, but fonts_changed_p
13583 is set in that case, so we will detect it below. */ 13583 is set in that case, so we will detect it below. */
@@ -13936,13 +13936,15 @@ redisplay_window (window, just_this_one_p)
13936 Value is 1 if successful. It is zero if fonts were loaded during 13936 Value is 1 if successful. It is zero if fonts were loaded during
13937 redisplay which makes re-adjusting glyph matrices necessary, and -1 13937 redisplay which makes re-adjusting glyph matrices necessary, and -1
13938 if point would appear in the scroll margins. 13938 if point would appear in the scroll margins.
13939 (We check that only if CHECK_MARGINS is nonzero. */ 13939 (We check the former only if TRY_WINDOW_IGNORE_FONTS_CHANGE is
13940 unset in FLAGS, and the latter only if TRY_WINDOW_CHECK_MARGINS is
13941 set in FLAGS.) */
13940 13942
13941int 13943int
13942try_window (window, pos, check_margins) 13944try_window (window, pos, flags)
13943 Lisp_Object window; 13945 Lisp_Object window;
13944 struct text_pos pos; 13946 struct text_pos pos;
13945 int check_margins; 13947 int flags;
13946{ 13948{
13947 struct window *w = XWINDOW (window); 13949 struct window *w = XWINDOW (window);
13948 struct it it; 13950 struct it it;
@@ -13964,12 +13966,12 @@ try_window (window, pos, check_margins)
13964 { 13966 {
13965 if (display_line (&it)) 13967 if (display_line (&it))
13966 last_text_row = it.glyph_row - 1; 13968 last_text_row = it.glyph_row - 1;
13967 if (fonts_changed_p) 13969 if (fonts_changed_p && !(flags & TRY_WINDOW_IGNORE_FONTS_CHANGE))
13968 return 0; 13970 return 0;
13969 } 13971 }
13970 13972
13971 /* Don't let the cursor end in the scroll margins. */ 13973 /* Don't let the cursor end in the scroll margins. */
13972 if (check_margins 13974 if ((flags & TRY_WINDOW_CHECK_MARGINS)
13973 && !MINI_WINDOW_P (w)) 13975 && !MINI_WINDOW_P (w))
13974 { 13976 {
13975 int this_scroll_margin; 13977 int this_scroll_margin;
diff --git a/src/xfns.c b/src/xfns.c
index 1d7d3d03580..2e2bda49246 100644
--- a/src/xfns.c
+++ b/src/xfns.c
@@ -533,12 +533,20 @@ x_real_positions (f, xptr, yptr)
533 int real_x = 0, real_y = 0; 533 int real_x = 0, real_y = 0;
534 int had_errors = 0; 534 int had_errors = 0;
535 Window win = f->output_data.x->parent_desc; 535 Window win = f->output_data.x->parent_desc;
536 Atom actual_type;
537 unsigned long actual_size, bytes_remaining;
538 int i, rc, actual_format;
539 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f);
540 long max_len = 400;
541 Display *dpy = FRAME_X_DISPLAY (f);
542 unsigned char *tmp_data = NULL;
543 Atom target_type = XA_CARDINAL;
536 544
537 BLOCK_INPUT; 545 BLOCK_INPUT;
538 546
539 x_catch_errors (FRAME_X_DISPLAY (f)); 547 x_catch_errors (dpy);
540 548
541 if (win == FRAME_X_DISPLAY_INFO (f)->root_window) 549 if (win == dpyinfo->root_window)
542 win = FRAME_OUTER_WINDOW (f); 550 win = FRAME_OUTER_WINDOW (f);
543 551
544 /* This loop traverses up the containment tree until we hit the root 552 /* This loop traverses up the containment tree until we hit the root
@@ -623,6 +631,33 @@ x_real_positions (f, xptr, yptr)
623 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f)); 631 had_errors = x_had_errors_p (FRAME_X_DISPLAY (f));
624 } 632 }
625 633
634
635 if (dpyinfo->root_window == f->output_data.x->parent_desc)
636 {
637 /* Try _NET_FRAME_EXTENTS if our parent is the root window. */
638 rc = XGetWindowProperty (dpy, win, dpyinfo->Xatom_net_frame_extents,
639 0, max_len, False, target_type,
640 &actual_type, &actual_format, &actual_size,
641 &bytes_remaining, &tmp_data);
642
643 if (rc == Success && actual_type == target_type && !x_had_errors_p (dpy)
644 && actual_size == 4 && actual_format == 32)
645 {
646 int ign;
647 Window rootw;
648 long *fe = (long *)tmp_data;
649
650 XGetGeometry (FRAME_X_DISPLAY (f), win,
651 &rootw, &real_x, &real_y, &ign, &ign, &ign, &ign);
652 outer_x = -fe[0];
653 outer_y = -fe[2];
654 real_x -= fe[0];
655 real_y -= fe[2];
656 }
657 }
658
659 if (tmp_data) XFree (tmp_data);
660
626 x_uncatch_errors (); 661 x_uncatch_errors ();
627 662
628 UNBLOCK_INPUT; 663 UNBLOCK_INPUT;
@@ -5188,7 +5223,7 @@ Text larger than the specified size is clipped. */)
5188 clear_glyph_matrix (w->desired_matrix); 5223 clear_glyph_matrix (w->desired_matrix);
5189 clear_glyph_matrix (w->current_matrix); 5224 clear_glyph_matrix (w->current_matrix);
5190 SET_TEXT_POS (pos, BEGV, BEGV_BYTE); 5225 SET_TEXT_POS (pos, BEGV, BEGV_BYTE);
5191 try_window (FRAME_ROOT_WINDOW (f), pos, 0); 5226 try_window (FRAME_ROOT_WINDOW (f), pos, TRY_WINDOW_IGNORE_FONTS_CHANGE);
5192 5227
5193 /* Compute width and height of the tooltip. */ 5228 /* Compute width and height of the tooltip. */
5194 width = height = 0; 5229 width = height = 0;
diff --git a/src/xsettings.c b/src/xsettings.c
index 945007db2f0..de37063c741 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -563,7 +563,9 @@ init_gconf ()
563 int i; 563 int i;
564 char *s; 564 char *s;
565 565
566#ifdef HAVE_G_TYPE_INIT
566 g_type_init (); 567 g_type_init ();
568#endif
567 gconf_client = gconf_client_get_default (); 569 gconf_client = gconf_client_get_default ();
568 s = gconf_client_get_string (gconf_client, SYSTEM_MONO_FONT, NULL); 570 s = gconf_client_get_string (gconf_client, SYSTEM_MONO_FONT, NULL);
569 if (s) 571 if (s)
diff --git a/src/xterm.c b/src/xterm.c
index 1fee90754fc..22019e2279b 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -7882,45 +7882,44 @@ x_connection_closed (dpy, error_message)
7882 delete_frame (frame, Qnoelisp); 7882 delete_frame (frame, Qnoelisp);
7883 } 7883 }
7884 7884
7885 /* We have to close the display to inform Xt that it doesn't 7885 /* If DPYINFO is null, this means we didn't open the display in the
7886 exist anymore. If we don't, Xt will continue to wait for 7886 first place, so don't try to close it. */
7887 events from the display. As a consequence, a sequence of
7888
7889 M-x make-frame-on-display RET :1 RET
7890 ...kill the new frame, so that we get an IO error...
7891 M-x make-frame-on-display RET :1 RET
7892
7893 will indefinitely wait in Xt for events for display `:1', opened
7894 in the first call to make-frame-on-display.
7895
7896 Closing the display is reported to lead to a bus error on
7897 OpenWindows in certain situations. I suspect that is a bug
7898 in OpenWindows. I don't know how to circumvent it here. */
7899
7900 if (dpyinfo) 7887 if (dpyinfo)
7901 { 7888 {
7902#ifdef USE_X_TOOLKIT 7889#ifdef USE_X_TOOLKIT
7903 /* If DPYINFO is null, this means we didn't open the display 7890 /* We have to close the display to inform Xt that it doesn't
7904 in the first place, so don't try to close it. */ 7891 exist anymore. If we don't, Xt will continue to wait for
7905 { 7892 events from the display. As a consequence, a sequence of
7906 extern void (*fatal_error_signal_hook) P_ ((void)); 7893
7907 fatal_error_signal_hook = x_fatal_error_signal; 7894 M-x make-frame-on-display RET :1 RET
7908 XtCloseDisplay (dpy); 7895 ...kill the new frame, so that we get an IO error...
7909 fatal_error_signal_hook = NULL; 7896 M-x make-frame-on-display RET :1 RET
7910 } 7897
7911#endif 7898 will indefinitely wait in Xt for events for display `:1',
7899 opened in the first call to make-frame-on-display.
7900
7901 Closing the display is reported to lead to a bus error on
7902 OpenWindows in certain situations. I suspect that is a bug
7903 in OpenWindows. I don't know how to circumvent it here. */
7904 extern void (*fatal_error_signal_hook) P_ ((void));
7905 fatal_error_signal_hook = x_fatal_error_signal;
7906 XtCloseDisplay (dpy);
7907 fatal_error_signal_hook = NULL;
7908#endif /* USE_X_TOOLKIT */
7912 7909
7913#ifdef USE_GTK 7910#ifdef USE_GTK
7914 /* Due to bugs in some Gtk+ versions, just exit here if this 7911 /* A long-standing GTK bug prevents proper disconnect handling
7915 is the last display/terminal. */ 7912 (https://bugzilla.gnome.org/show_bug.cgi?id=85715). Once,
7916 if (terminal_list->next_terminal == NULL) 7913 the resulting Glib error message loop filled a user's disk.
7917 { 7914 To avoid this, kill Emacs unconditionally on disconnect. */
7918 fprintf (stderr, "%s\n", error_msg); 7915 shut_down_emacs (0, 0, Qnil);
7919 shut_down_emacs (0, 0, Qnil); 7916 fprintf (stderr, "%s\n\
7920 exit (70); 7917When compiled with GTK, Emacs cannot recover from X disconnects.\n\
7921 } 7918This is a GTK bug: https://bugzilla.gnome.org/show_bug.cgi?id=85715\n\
7922 xg_display_close (dpyinfo->display); 7919For details, see etc/PROBLEMS.\n",
7923#endif 7920 error_msg);
7921 abort ();
7922#endif /* USE_GTK */
7924 7923
7925 /* Indicate that this display is dead. */ 7924 /* Indicate that this display is dead. */
7926 dpyinfo->display = 0; 7925 dpyinfo->display = 0;
@@ -10523,7 +10522,8 @@ x_term_init (display_name, xrm_option, resource_name)
10523 = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE", False); 10522 = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE", False);
10524 dpyinfo->Xatom_net_window_type_tooltip 10523 dpyinfo->Xatom_net_window_type_tooltip
10525 = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE_TOOLTIP", False); 10524 = XInternAtom (dpyinfo->display, "_NET_WM_WINDOW_TYPE_TOOLTIP", False);
10526 10525 dpyinfo->Xatom_net_frame_extents
10526 = XInternAtom (dpyinfo->display, "_NET_FRAME_EXTENTS", False);
10527 dpyinfo->cut_buffers_initialized = 0; 10527 dpyinfo->cut_buffers_initialized = 0;
10528 10528
10529 dpyinfo->x_dnd_atoms_size = 8; 10529 dpyinfo->x_dnd_atoms_size = 8;
diff --git a/src/xterm.h b/src/xterm.h
index c8601b8c43d..07eaec3060c 100644
--- a/src/xterm.h
+++ b/src/xterm.h
@@ -362,10 +362,10 @@ struct x_display_info
362 Window net_supported_window; 362 Window net_supported_window;
363 Atom Xatom_net_window_type, Xatom_net_window_type_tooltip; 363 Atom Xatom_net_window_type, Xatom_net_window_type_tooltip;
364 364
365 /* Atoms dealing with maximization and fullscreen */ 365 /* Atoms dealing with EWMH (i.e. _NET_...) */
366 Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom, 366 Atom Xatom_net_wm_state, Xatom_net_wm_state_fullscreen_atom,
367 Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert, 367 Xatom_net_wm_state_maximized_horz, Xatom_net_wm_state_maximized_vert,
368 Xatom_net_wm_state_sticky; 368 Xatom_net_wm_state_sticky, Xatom_net_frame_extents;
369 369
370 /* XSettings atoms and windows. */ 370 /* XSettings atoms and windows. */
371 Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr; 371 Atom Xatom_xsettings_sel, Xatom_xsettings_prop, Xatom_xsettings_mgr;