Port the font backend from the Mac port.
[bpt/emacs.git] / src / ChangeLog
1 2013-09-15 Jan Djärv <jan.h.d@swipnet.se>
2
3 * nsterm.m: Include macfont.h.
4 (ns_tmp_flags, ns_tmp_font): Remove.
5 (ns_compute_glyph_string_overhangs): Check for driver Qns.
6 (ns_draw_glyph_string): Use local variables instead of ns_tmp_flags,
7 ns_tmp_font. Call ns_draw_text_decoration here instead of nsfont.m.
8 (changeFont:): Fix code style. Check for font driver type when
9 getiing font.
10
11 * nsterm.h (FONT_DESCENT, FONT_ASCENT): Define to (f)->ascent and
12 (f)->descent.
13
14 * nsfont.m (ns_tmp_flags, ns_tmp_font): Remove.
15 (nsfont_open): Set font driver type.
16 Set font->ascent and font->descent. Figure out font instead of
17 ns_tmp_font, and flags instead of ns_tmp_flags.
18 Fix indentation. Remove call to ns_draw_text_decoration,
19 moved to nsterm.
20
21 * nsfns.m: Include macfont.h.
22 (Fx_create_frame): Register macfont driver, make a better default font.
23 (Fns_popup_font_panel): Get font from macfont driver, if used.
24
25 * macfont.m, macfont.h, maccuvs.h: New files.
26
27 * font.h: Declare syms_of_macfont.
28
29 * font.c (syms_of_font): Call syms_of_macfont.
30
31 * Makefile.in (NS_OBJ, SOME_MACHINE_OBJECTS): Add macfont.o.
32
33 2013-09-15 Dmitry Antipov <dmantipov@yandex.ru>
34
35 Drop VERTICAL_SCROLL_BAR_WIDTH_TRIM. For X, it is zero since 1999,
36 and it is always zero for others, so I assume that this is an ancient
37 leftover which nobody will want to change any more.
38 * xterm.h, w32term.h, nsterm.h (VERTICAL_SCROLL_BAR_WIDTH_TRIM): Remove.
39 (VERTICAL_SCROLL_BAR_INSIDE_WIDTH):
40 * frame.c (x_set_scroll_bar_width):
41 * w32fns.c (w32_createscrollbar):
42 * w32term.c (w32_set_vertical_scroll_bar):
43 * xfns.c (x_set_scroll_bar_default_width):
44 * xterm.c (XTflash, x_scroll_bar_create, XTset_vertical_scroll_bar)
45 (x_scroll_bar_expose): Related users changed.
46
47 2013-09-15 Dmitry Antipov <dmantipov@yandex.ru>
48
49 * xterm.h (FRAME_X_SCREEN_NUMBER): Add comment.
50 (BLACK_PIX_DEFAULT, WHITE_PIX_DEFAULT): Use FRAME_X_SCREEN_NUMBER.
51 (SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET) [USE_X_TOOLKIT]:
52 Define as such.
53 * frame.h (FRAME_SMALLEST_CHAR_WIDTH, FRAME_SMALLEST_FONT_HEIGHT):
54 Define once here...
55 * nsterm.h, w32term.h, xterm.h: ...and not here.
56 * w32term.h (SCROLL_BAR_X_WIDGET, SET_SCROLL_BAR_X_WIDGET):
57 Remove unused Xisms.
58 * xterm.c, xfns.c (toplevel): Remove #ifdef HAVE_X_WINDOWS because
59 these modules are never compiled otherwise.
60
61 2013-09-14 Eli Zaretskii <eliz@gnu.org>
62
63 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>:
64 Doc fix. (Bug#15375)
65
66 2013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
67
68 Unify Fx_focus_frame between all ports.
69 * frame.h (x_focus_frame): New prototype.
70 * xfns.c (Fx_focus_frame): Remove.
71 (syms_of_xfns): Do not defsubr it.
72 (x_focus_frame): X implementation.
73 * nsfns.m (Fx_focus_frame): Remove.
74 (syms_of_nsfns): Do not defsubr it.
75 (x_focus_frame): NS implementation.
76 * w32term.c (Fx_focus_frame): Remove.
77 (x_focus_on_frame): Rename to...
78 (x_focus_frame): W32 implementation.
79 * w32term.h (x_focus_on_frame): Remove prototype.
80 * w32fns.c (Fx_focus_frame): Remove.
81 (syms_of_w32fns): Do not defsubr it.
82 * frame.c (Fx_focus_frame): Define here.
83 (syms_of_frame): Defsubr here.
84 * gtkutil.c (xg_tool_bar_callback): Use x_focus_frame.
85
86 2013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
87
88 Unify FRAME_window_system_DISPLAY_INFO macros between all ports.
89 All of them are replaced with FRAME_DISPLAY_INFO, defined in
90 each port to reference the port-specific window system data.
91 * msdos.h (FRAME_X_DISPLAY_INFO): Remove.
92 (FRAME_DISPLAY_INFO): Define.
93 * w32term.h (FRAME_W32_DISPLAY_INFO, FRAME_X_DISPLAY_INFO): Remove.
94 (FRAME_DISPLAY_INFO): Define. Adjust users.
95 * xterm.h (FRAME_X_DISPLAY_INFO): Remove.
96 (FRAME_DISPLAY_INFO): Define. Adjust users.
97 * frame.h (FRAME_RES_X, FRAME_RES_Y): Unify.
98 * font.c, frame.c, gtkutil.c, image.c, menu.c, msdos.c, nsfns.m:
99 * nsfont.m, nsterm.m, w32fns.c, w32font.c, w32menu.c, w32term.c:
100 * w32xfns.c, widget.c, xdisp.c, xfaces.c, xfns.c, xfont.c, xmenu.c:
101 * xselect.c, xterm.c: All related users changed.
102
103 2013-09-13 Dmitry Antipov <dmantipov@yandex.ru>
104
105 * xterm.h (x_window_to_frame, x_any_window_to_frame)
106 (x_menubar_window_to_frame): Remove prototypes.
107 * xfns.c (x_window_to_frame, x_any_window_to_frame)
108 (x_menubar_window_to_frame, x_top_window_to_frame):
109 Move from here...
110 * xterm.c (x_window_to_frame, x_any_window_to_frame)
111 (x_menubar_window_to_frame, x_top_window_to_frame):
112 ...to here and convert all but the last to static.
113
114 2013-09-12 Eli Zaretskii <eliz@gnu.org>
115
116 * lisp.mk (lisp): Add w32-common-fns.elc.
117
118 2013-09-12 Xue Fuqiao <xfq.free@gmail.com>
119
120 * charset.c (char_charset): Document an exception for char-charset.
121
122 2013-09-12 Dmitry Antipov <dmantipov@yandex.ru>
123
124 * xterm.h (x_display_info): New field last_user_time...
125 * xterm.c (toplevel): ...to replace static last_user_time.
126 (handle_one_xevent, x_ewmh_activate_frame): Adjust users.
127
128 2013-09-12 Dmitry Antipov <dmantipov@yandex.ru>
129
130 * xterm.c (x_set_scroll_bar_thumb) [USE_LUCID && !HAVE_XAW3D]: Clip
131 scroll bar values to prevent thumb from disappear and update comment.
132
133 2013-09-11 Glenn Morris <rgm@gnu.org>
134
135 * emacs.c (usage_message): Possessive apostrophe tweak.
136
137 2013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
138
139 * nsterm.m (syms_of_nsterm): Use Qns.
140 * w32fns.c (Fx_open_connection): Remove old '#if 0' code.
141 * w32term.c (w32_create_terminal, syms_of_w32term): Use Qw32.
142 * xfns.c (x_display_info_for_name, Fx_open_connection):
143 Remove old '#if 0' code.
144 (syms_of_xfns): Use Qx.
145 * termhooks.h (fullscreen_hook): Remove the leftover.
146 (struct terminal): Fix typo in comment.
147
148 2013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
149
150 Cleaning up a few X scroll bar bits.
151 * termhooks.h (enum scroll_bar_part): Add scroll_bar_nowhere member.
152 * xterm.h (struct scroll_bar) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
153 New member last_seen_part, going to replace...
154 * xterm.c [USE_TOOLKIT_SCROLL_BARS]: ...global last_scroll_bar_part.
155 (xt_action_hook) [USE_LUCID]: Adjust user.
156 (xm_scroll_callback, xg_scroll_callback): Do not bloat with
157 Lucid-specific scroll bar support.
158 (xaw_jump_callback, xaw_scroll_callback): Prefer enum scroll_par_part
159 to int and adjust to use last_seen_part member.
160 (x_set_toolkit_scroll_bar_thumb) [USE_LUCID]: Adjust user.
161 (x_scroll_bar_create) [USE_TOOLKIT_SCROLL_BARS && USE_LUCID]:
162 Initialize last_seen_part.
163
164 2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
165
166 * insdel.c (insert_from_buffer_1): Don't mark buffer as modified when
167 insert-buffer-substring an empty string.
168
169 2013-09-11 Paul Eggert <eggert@cs.ucla.edu>
170
171 * xdisp.c (Ftool_bar_lines_needed): Declare as 'const' if ifdeffed out,
172 avoiding a GCC warning.
173
174 2013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
175
176 Ifdef away frame tool bar code when it is not really used.
177 * frame.h (struct frame) [HAVE_WINDOW_SYSTEM && !USE_GTK && !HAVE_NS]:
178 Move tool_bar_window, desired_tool_bar_string, current_tool_bar_string
179 and minimize_tool_bar_window_p under the above.
180 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
181 (fset_tool_bar_window): Likewise.
182 * dispnew.c (clear_current_matrices, clear_desired_matrices)
183 (adjust_frame_glyphs_for_window_redisplay, free_glyphs, update_frame)
184 (change_frame_size_1):
185 * window.c (window_from_coordinates, Frecenter): Adjust users.
186 * window.h (WINDOW_TOOL_BAR_P): Define to zero when frame tool bar
187 code is not really used.
188 * xdisp.c (build_desired_tool_bar_string, display_tool_bar_line)
189 (tool_bar_lines_needed, MAX_FRAME_TOOL_BAR_HEIGHT, tool_bar_item_info)
190 (get_tool_bar_item, handle_tool_bar_click, note_tool_bar_highlight)
191 [!USE_GTK && !HAVE_NS]: Define as such.
192 (Ftool_bar_lines_needed, redisplay_tool_bar, show_mouse_face)
193 (note_mouse_highlight, expose_frame):
194 * xfns.c (x_set_tool_bar_lines):
195 * xterm.c (handle_one_xevent): Adjust users.
196
197 2013-09-11 Paul Eggert <eggert@cs.ucla.edu>
198
199 Fix corruption with multiple emacsclient -t instances (Bug#15222).
200 This bug was introduced by my 2013-08-26 patch, which incorrectly
201 assumed that the terminfo implementation doesn't use termcap buffers.
202 * term.c (init_tty) [TERMINFO]: Remove optimization, as
203 these buffers apparently are used after all.
204 * termchar.h (TERMCAP_BUFFER_SIZE) [TERMINFO]: Define here too.
205 (struct tty_display_info): Define members termcap_term_buffer and
206 termcap_strings_buffer even if TERMINFO.
207
208 2013-09-11 Dmitry Antipov <dmantipov@yandex.ru>
209
210 Fix last change.
211 * data.c (Feqlsign, Flss, Fgtr, Fleq, Fgeq): Add convenient
212 'usage' docstring entry to pacify make-docfile.
213
214 2013-09-11 Barry O'Reilly <gundaetiapo@gmail.com>
215
216 Change comparison functions =, <, >, <=, >= to take many arguments.
217 * data.c: Change comparison functions' interface and implementation.
218 * lisp.h: Make arithcompare available for efficient two arg
219 comparisons.
220 * bytecode.c: Use arithcompare.
221 * fileio.c: Use new interface.
222
223 2013-09-11 Stefan Monnier <monnier@iro.umontreal.ca>
224
225 * keyboard.c (read_char): Don't break immediate_echo (bug#15332).
226
227 2013-09-10 Stefan Monnier <monnier@iro.umontreal.ca>
228
229 * eval.c (Feval): Document the new use of `lexical'.
230
231 2013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
232
233 Review and drop old frame resize hack.
234 * frame.h (struct frame): Remove force_flush_display_p.
235 * dispnew.c (update_frame): Adjust user and don't call
236 flush_frame here. The comment has said that there was an issues
237 with redisplaying fringes, but I don't see any differences with
238 and without this hack. Hopefully we can continue without it.
239 * xdisp.c (clear_garbaged_frames): Adjust user and do not clear
240 current frame matrices twice if resized_p is set.
241
242 2013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
243
244 Do not populate pure Xism x_sync to other ports.
245 * frame.h (x_sync): Move under HAVE_X_WINDOWS.
246 * frame.c (other_visible_frames) [HAVE_X_WINDOWS]: Use as such.
247 * nsfns.m, w32xfns.c (x_sync): Remove no-op.
248 * w32term.h (x_sync): Remove prototype.
249
250 2013-09-09 Dmitry Antipov <dmantipov@yandex.ru>
251
252 Cleanup frame flushing.
253 * dispextern.h (struct redisplay_interface):
254 Drop flush_display_optional because flush_display is enough
255 for X and flushing via RIF is just a no-op for others.
256 * frame.h (flush_frame): New function.
257 * dispnew.c (update_frame):
258 * minibuf.c (read_minibuf):
259 * xdisp.c (echo_area_display, redisplay_preserve_echo_area):
260 Use it.
261 * keyboard.c (detect_input_pending_run_timers): Do not flush
262 all frames but selected one in redisplay_preserve_echo_area.
263 * nsterm.m (ns_flush): Remove no-op.
264 (ns_redisplay_interface): Adjust user.
265 * w32term.h (x_flush): Remove no-op.
266 (w32_redisplay_interface): Adjust user.
267 * xterm.c (x_flush): Simplify because we do not flush all
268 frames at once any more. Adjust comment.
269 (x_redisplay_interface): Adjust user.
270
271 2013-09-07 Paul Eggert <eggert@cs.ucla.edu>
272
273 Port --without-x --enable-gcc-warnings to Fedora 19.
274 * gfilenotify.c (globals_of_gfilenotify):
275 Call g_type_init only if using an older glib version that needs it.
276
277 2013-09-06 Dmitry Antipov <dmantipov@yandex.ru>
278
279 * lisp.h (last_glyphless_glyph_frame, last_glyphless_glyph_face_id)
280 (last_glyphless_glyph_merged_face_id): Remove declarations.
281 * dispextern.h (merge_glyphless_glyph_face): Add prototype.
282 * xdisp.c (last_glyphless_glyph_frame, last_glyphless_glyph_face_id)
283 (last_glyphless_glyph_merged_face_id): Now static.
284 (merge_escape_glyph_face): New function, refactored from...
285 (get_next_display_element): ...here.
286 (merge_glyphless_glyph_face): New function, refactored from...
287 (produce_glyphless_glyph): ...here...
288 * term.c (produce_glyphless_glyph): ...and here.
289
290 2013-09-06 Stefan Monnier <monnier@iro.umontreal.ca>
291
292 * eval.c (eval_sub): Only call Ffunction if necessary.
293
294 2013-09-06 Dmitry Antipov <dmantipov@yandex.ru>
295
296 Attempt to make redisplay more selective when changing cursor type.
297 * frame.h (struct frame): New bitfield cursor_type_changed.
298 * xdisp.c (cursor_type_changed): Remove.
299 (try_cursor_movement, redisplay_window, try_window_id)
300 (set_frame_cursor_types, try_window_reusing_current_matrix):
301 Adjust to use per-frame bitfield.
302 (redisplay_internal): Look for cursor type change on each visible
303 frame and consider all frames if cursor type has been changed on
304 the frame other than selected. If cursor type has been changed on
305 selected frame only, do not use fast update.
306
307 2013-09-06 Dmitry Antipov <dmantipov@yandex.ru>
308
309 Attempt to make redisplay more selective when changing fonts.
310 * frame.h (struct frame): New bitfield fonts_changed.
311 * dispextern.h (fonts_changed_p, adjust_glyphs): Remove declaration.
312 (adjust_frame_glyphs): Add prototype.
313 * dispnew.c (fonts_changed_p): Remove.
314 (adjust_glyphs): Remove because we do not
315 adjust matrices on all frames at once any more.
316 (adjust_frame_glyphs): Block and unblock input here.
317 (adjust_glyph_matrix): Use fonts_changed.
318 (change_frame_size_1): Use adjust_frame_glyphs.
319 * font.c (font_open_entity): Use fonts_changed.
320 * frame.c (set_menu_bar_lines, Fmake_terminal_frame):
321 * w32fns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
322 * window.c (Fdelete_other_windows_internal, Fwindow_resize_apply)
323 (Fsplit_window_internal, Fdelete_window_internal, grow_mini_window)
324 (shrink_mini_window, Fresize_mini_window_internal)
325 (window_scroll_pixel_based, Fset_window_configuration)
326 (apply_window_adjustment, Fset_window_vscroll):
327 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_show_tip):
328 Use adjust_frame_glyphs.
329 * xdisp.c (redisplay_tool_bar, redisplay_window, try_window)
330 (try_window_reusing_current_matrix, try_window_id, display_line)
331 (IT_EXPAND_MATRIX_WIDTH): Use fonts_changed.
332 (redisplay_internal): Consider fonts_changed and adjust frame
333 matrices for each frame only if the frame is visible. If font
334 has been changed on some frame during full redisplay, retry
335 only visible frames where the font has been actually changed.
336
337 2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
338
339 Cache current header and mode line height for each window.
340 * window.h (struct window): New fields mode_line_height
341 and header_line_height.
342 * window.c (make_window): Initialize them.
343 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
344 (CURRENT_HEADER_LINE_HEIGHT): Use them. Adjust comment.
345 (current_mode_line_height, current_header_line_height):
346 Remove declaration.
347 * xdisp.c (current_mode_line_height, current_header_line_height):
348 Remove.
349 (pos_visible_p, init_xdisp): Adjust user.
350 (redisplay_window): Invalidate mode_line_height and
351 header_line_height if current and desired matrices do not agree.
352
353 2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
354
355 * fontset.c, window.c, xdisp.c (toplevel): Use TERM_HEADER.
356 * xfaces.c (toplevel) [HAVE_X_WINDOWS]: Do not include xterm.h twice.
357
358 2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
359
360 Make --without-x compatible with --enable-gcc-warnings.
361 * font.c (register_font_driver): Move check under HAVE_WINDOW_SYSTEM.
362 * font.h (struct font_driver): Move draw, get_bitmap and free_bitmap
363 members under HAVE_WINDOW_SYSTEM.
364 * keyboard.c (make_lispy_focus_out): Likewise.
365 (record_menu_key): Move under HAVE_MENUS.
366 * xdisp.c (toplevel): Move hourglass_shown_p, hourglass_atimer and
367 THIN_SPACE_WIDTH under HAVE_WINDOW_SYSTEM.
368 (syms_of_xdisp): Adjust user.
369 (window_box_edges): Define only if HAVE_WINDOW_SYSTEM.
370 (start_hourglass, cancel_hourglass):
371 * xfaces.c (toplevel): Likewise with PT_PER_INCH,
372 clear_font_table_count, CLEAR_FONT_TABLE_COUNT
373 and CLEAR_FONT_TABLE_NFONTS.
374 (set_font_frame_param, clear_face_gcs, realize_non_ascii_face):
375 Declare only if HAVE_WINDOW_SYSTEM.
376 (lface_same_font_attributes_p, clear_face_gcs): Define only
377 if HAVE_WINDOW_SYSTEM.
378
379 2013-09-05 Dmitry Antipov <dmantipov@yandex.ru>
380
381 * frame.c (check_minibuf_window): Update 'frame' with frame pointer.
382 * xterm.c (x_scroll_bar_handle_click) [!USE_TOOLKIT_SCROLL_BARS]:
383 Don't pass C integer to XINT (tiny fix for 2013-09-03 change).
384
385 2013-09-05 Stefan Monnier <monnier@iro.umontreal.ca>
386
387 * cmds.c (Fself_insert_command): Don't pass a non-integer to XINT.
388
389 2013-09-04 Paul Eggert <eggert@cs.ucla.edu>
390
391 * alloc.c (make_event_array): First arg is now ptrdiff_t, not int.
392 This fixes a type error on hosts where ptrdiff_t is wider than int.
393
394 2013-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
395
396 * keyboard.c (read_key_sequence_vs): New function.
397 (Fread_key_sequence_vector, Fread_key_sequence): Use it to factor out
398 common code.
399
400 * callint.c (Fcall_interactively): Always return a vector for 'K'.
401
402 2013-09-04 Paul Eggert <eggert@cs.ucla.edu>
403
404 Makefile improvements.
405 * Makefile.in (config.status): Don't use double-colon rules, as
406 they are not portable according to POSIX. Fix shell typo with `;
407 I guess this rule has never been tested?
408 (VCSWITNESS): New macro, to override any environment var.
409
410 2013-09-04 Dmitry Antipov <dmantipov@yandex.ru>
411
412 * xterm.h (struct x_display_info): Do not track X connection
413 fd separately because it is always available from Display.
414 * xterm.c (x_term_init, x_delete_terminal, x_delete_display):
415 Adjust users.
416
417 2013-09-03 Dmitry Antipov <dmantipov@yandex.ru>
418
419 * buffer.c (drop_overlay):
420 * fileio.c (restore_point_unwind): Prefer unchain_marker to
421 Fset_marker (X, Qnil, ...) (which is the same but a bit slower).
422
423 2013-09-03 Dmitry Antipov <dmantipov@yandex.ru>
424
425 * buffer.c (Fmake_overlay, Fmove_overlay):
426 * intervals.c (set_point_from_marker):
427 * print.c (PRINTPREPARE): Prefer signal_error
428 to plain error and report unsuitable marker too.
429
430 2013-09-03 Dmitry Antipov <dmantipov@yandex.ru>
431
432 * xterm.h (struct scroll_bar): Prefer int to Lisp_Object
433 for 'dragging' member.
434 (struct x_output): Remove set-but-unused leftovers
435 'left_before_move' and 'top_before_move'.
436 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
437 * xterm.c (xt_action_hook, xm_scroll_callback, xg_scroll_callback)
438 (xg_end_scroll_callback, xaw_jump_callback, xaw_scroll_callback)
439 (x_set_toolkit_scroll_bar_thumb, x_scroll_bar_create)
440 (x_scroll_bar_set_handle, XTset_vertical_scroll_bar)
441 (x_scroll_bar_handle_click, x_scroll_bar_note_movement)
442 (x_scroll_bar_report_motion, x_set_offset): Related users changed.
443 * xfns.c, image.c (XLIB_ILLEGAL_ACCESS): No longer needed.
444
445 2013-09-03 Jan Djärv <jan.h.d@swipnet.se>
446
447 * nsfont.m (INVALID_GLYPH): New define.
448 (nsfont_encode_char): Use INVALID_GLYPH.
449 (ns_uni_to_glyphs): Ditto, check for NSNullGlyph (Bug#15138).
450
451 2013-09-02 Dmitry Antipov <dmantipov@yandex.ru>
452
453 * xterm.c (x_last_mouse_movement_time): Revert last change.
454 This code should use XDisplayMotionBufferSize to check display's
455 motion history first, and there are few other issues as well.
456 (x_scroll_bar_note_movement): Pass XMotionEvent rather than XEvent.
457 (handle_one_xevent): Adjust user.
458
459 2013-09-02 Martin Rudalics <rudalics@gmx.at>
460
461 * dispnew.c (Flast_nonminibuf_frame): Move from here ...
462 * frame.c (Flast_nonminibuf_frame): ... to here.
463 (check_minibuf_window): Don't abort if no window was found
464 (Bug#15247).
465
466 2013-09-02 Dmitry Antipov <dmantipov@yandex.ru>
467
468 Use XGetMotionEvents to ask the last mouse motion time from X server.
469 * xterm.c (X_MOTION_HISTORY): Default to 1.
470 (x_last_mouse_movement_time) [X_MOTION_HISTORY]: New function.
471 (x_last_mouse_movement_time) [!X_MOTION_HISTORY]: Legacy version.
472 (note_mouse_movement, x_scroll_bar_note_movement) [!X_MOTION_HISTORY]:
473 Ifdef away legacy code.
474 (XTmouse_position, x_scroll_bar_report_motion):
475 Use x_last_mouse_movement_time.
476 (handle_one_xevent): Use event.xunmap and not event.xmap when handling
477 UnmapNotify event.
478
479 2013-09-02 Dmitry Antipov <dmantipov@yandex.ru>
480
481 * msdos.c (last_mouse_window): Move to...
482 (dos_rawgetc): ...this function and adjust comment.
483 * nsterm.m (last_window): Rename to last_mouse_window, move to...
484 (mouseMoved): ...this function and adjust comment.
485 * w32term.c (last_window): Likewise with...
486 (w32_read_socket): ...this function.
487 * xterm.c (last_window): Likewise with...
488 (handle_one_xevent): ...this function.
489
490 2013-09-02 Dmitry Antipov <dmantipov@yandex.ru>
491
492 * window.h (Vmouse_window, Vmouse_event): Remove the leftovers.
493 * xterm.c (toplevel): Drop obsolete comment and move compose_status...
494 (handle_one_xevent): ...to here.
495 (STORE_KEYSYM_FOR_DEBUG): Move under ENABLE_CHECKING and make no-op
496 otherwise.
497
498 2013-09-02 Dmitry Antipov <dmantipov@yandex.ru>
499
500 * msdos.c (IT_set_terminal_window): Remove no-op.
501 (initialize_msdos_display): Adjust terminal setup.
502 * w32console.c (w32con_set_terminal_window): Remove no-op.
503 (initialize_w32_display): Adjust terminal setup.
504 * w32term.c (w32_set_terminal_window): Remove no-op.
505 (w32_create_terminal): Adjust terminal setup.
506 * xterm.c (XTset_terminal_window): Remove no-op.
507 (x_create_terminal): Adjust terminal setup.
508
509 2013-09-01 Dmitry Antipov <dmantipov@yandex.ru>
510
511 * nsterm.m (ns_set_terminal_modes, ns_reset_terminal_modes):
512 Remove no-ops.
513 (ns_create_terminal): Adjust terminal setup.
514 * w32term.c (w32_set_terminal_modes, w32_reset_terminal_modes):
515 Remove no-ops.
516 (w32_create_terminal): Adjust terminal setup.
517 * xterm.c (XTset_terminal_modes, XTreset_terminal_modes):
518 Remove no-ops.
519 (x_create_terminal): Adjust terminal setup.
520
521 2013-09-01 Dmitry Antipov <dmantipov@yandex.ru>
522
523 * dispextern.h (SET_TEXT_POS_FROM_MARKER): Indent.
524 (CLIP_TEXT_POS_FROM_MARKER): New macro.
525 * dispnew.c (buffer_posn_from_coords):
526 * window.c (Fwindow_end, displayed_window_lines):
527 * xdisp.c (redisplay_mode_lines): Use it.
528
529 2013-09-01 Jan Djärv <jan.h.d@swipnet.se>
530
531 * fontset.c (face_for_char): Check char in the current face font first
532 if HAVE_NS (Bug#15138).
533
534 2013-08-31 Martin Rudalics <rudalics@gmx.at>
535
536 * window.c (temp_output_buffer_show): Make sure window returned
537 by display_buffer is live (Bug#15213).
538
539 2013-08-30 Dmitry Antipov <dmantipov@yandex.ru>
540
541 Minor cleanup to avoid forward declarations.
542 * coding.h (struct ccl_spec): Remove forward declaration.
543 * composite.h (toplevel): Include font.h.
544 (struct composition_it, struct face, struct font_metrics):
545 Remove forward declaration.
546 * dispextern.h (struct image, struct atimer): Likewise.
547 * emacsgtkfixed.h (struct frame): Likewise.
548 * emacsgtkfixed.c (toplevel): Reorder headers and drop stdio.h.
549 * font.h (struct font_driver, struct font, struct glyph_string)
550 (struct face): Remove forward declaration.
551 * fontset.h (struct face, struct font): Likewise.
552 * frame.h (toplevel): Style cleanup.
553 (enum output_method): Move to...
554 * termhooks.h (enum output_method): ...here.
555 (struct glyph, struct frame, struct ns_display_info)
556 (struct x_display_info, struct w32_display_info):
557 Remove forward declaration.
558 * xterm.h (toplevel): Include termhooks.h.
559 (struct font, struct window, struct glyph_matrix, struct frame)
560 (struct input_event, struct face, struct image): Remove forward
561 declaration.
562 * gtkutil.h (struct _widget_value): Likewise.
563 * keyboard.h (toplevel): Include termhooks.h.
564 (struct input_event): Remove forward declaration.
565
566 2013-08-29 Dmitry Antipov <dmantipov@yandex.ru>
567
568 * intervals.c (set_point_from_marker): New function.
569 * editfns.c (Fgoto_char):
570 * process.c (Finternal_default_process_filter):
571 * window.c (select_window_1): Use it.
572 * buffer.h (set_point_from_marker): Add prototype.
573
574 2013-08-29 Eli Zaretskii <eliz@gnu.org>
575
576 * w32.c (term_winsock): Call release_listen_threads before calling
577 WSACleanup.
578 (_sys_wait_accept): Wait for accept event in a loop with a finite
579 timeout, instead of waiting indefinitely. Will hopefully avoid
580 hanging during exit because WSACleanup deadlocks waiting for the
581 event object to be released. (Bug#14333)
582
583 * w32proc.c (release_listen_threads): New function, signals all
584 the reader threads that listen for connections to stop waiting.
585
586 * w32.h (release_listen_threads): Add prototype.
587
588 2013-08-29 Dmitry Antipov <dmantipov@yandex.ru>
589
590 * alloc.c (Fmake_marker, build_marker): Zero need_adjustment
591 field of new marker (for sanity and safety).
592 * lisp.h (XSETMARKER): Remove unused macro (it doesn't work
593 anyway because XMISCTYPE is a function and can't be an lvalue).
594
595 2013-08-29 Dmitry Antipov <dmantipov@yandex.ru>
596
597 * xterm.c (x_clear_area): Lost 7th arg because it is always False.
598 (x_after_update_window_line, x_scroll_bar_create):
599 (x_scroll_bar_set_handle, XTset_vertical_scroll_bar):
600 (handle_one_xevent, x_clear_frame_area):
601 * gtkutil.c (xg_clear_under_internal_border, xg_update_scrollbar_pos):
602 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines): Adjust users.
603 * xterm.h (x_clear_area): Adjust prototype.
604
605 2013-08-29 Dmitry Antipov <dmantipov@yandex.ru>
606
607 Hook scanning and indentation functions to find_newline. This helps
608 to avoid duplicated code and renders more respect to newline cache.
609 * lisp.h (scan_newline): Prefer ptrdiff_t to EMACS_INT.
610 * cmds.c (Fforward_line):
611 * indent.c (scan_for_column, Fcurrent_indentation, indented_beyond_p):
612 Use find_newline and avoid unnecessary point movements.
613 * search.c (scan_newline): Implement on top of find_newline.
614
615 2013-08-28 Stefan Monnier <monnier@iro.umontreal.ca>
616
617 * eval.c (Ffuncall): Fix handling of ((lambda ..) ..) in lexically
618 scoped code (bug#11258).
619
620 2013-08-28 Davor Cubranic <cubranic@stat.ubc.ca> (tiny change)
621
622 * nsterm.m (last_window): New variable.
623 (EV_TRAILER2): New macro.
624 (EV_TRAILER): Call EV_TRAILER2.
625 (mouseMoved:): Add support for mouse-autoselect-window
626 on nextstep (Bug#6888).
627
628 2013-08-28 Andreas Schwab <schwab@suse.de>
629
630 * regex.c (CHAR_CHARSET, CHARSET_LEADING_CODE_BASE, CHAR_HEAD_P)
631 (SINGLE_BYTE_CHAR_P, SAME_CHARSET_P, MAKE_CHAR, BYTE8_TO_CHAR):
632 Remove unused macro definitions.
633 (CHARSET_RANGE_TABLE_BITS, EXTEND_RANGE_TABLE)
634 (SET_RANGE_TABLE_WORK_AREA_BIT, SET_RANGE_TABLE_WORK_AREA):
635 Only define if emacs.
636
637 2013-08-28 Dmitry Antipov <dmantipov@yandex.ru>
638
639 Prefer enum glyph_row_area to int where appropriate.
640 * dispextern.h (enum glyph_row_area): Add ANY_AREA member.
641 Fix comment.
642 (window_box, window_box_width, window_box_left, window_box_left_offset)
643 (window_box_right, window_box_right_offset): Adjust prototypes.
644 * xdisp.c (window_box, window_box_width, window_box_left)
645 (window_box_left_offset, window_box_right, window_box_right_offset):
646 Use enum glyph_row_area. Adjust users and tweak comment where needed.
647 (window_box_edges): Likewise. Lost 2nd arg since it is always ANY_AREA.
648 * nsterm.m (ns_clip_to_row):
649 * w32term.c (w32_clip_to_row):
650 * xterm.c (x_clip_to_row): Likewise.
651
652 2013-08-28 Dmitry Antipov <dmantipov@yandex.ru>
653
654 * buffer.c (Foverlays_at, Foverlays_in, Fnext_overlay_change)
655 (Fprevious_overlay_change): Fast path for buffer with no overlays.
656
657 2013-08-28 Paul Eggert <eggert@cs.ucla.edu>
658
659 * Makefile.in (SHELL): Now @SHELL@, not /bin/sh,
660 for portability to hosts where /bin/sh has problems.
661
662 2013-08-28 Dmitry Antipov <dmantipov@yandex.ru>
663
664 Redesign redisplay interface to drop global output_cursor.
665 * dispextern.h (struct redisplay_interface): Remove cursor_to member.
666 (toplevel): Remove declaration of output_cursor.
667 (set_output_cursor, x_cursor_to): Remove prototype.
668 * window.h (struct window): New member output_cursor.
669 (output_cursor_to): New function to replace RIF member.
670 * dispnew.c (redraw_overlapped_rows, update_marginal_area)
671 (update_text_area, set_window_cursor_after_update): Use it.
672 * xdisp.c (output_cursor, set_output_cursor, x_cursor_to): Remove.
673 (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
674 * nsterm.m (ns_update_window_begin, ns_update_window_end):
675 * w32term.c (x_update_window_begin, x_update_window_end):
676 * xterm.c (x_update_window_begin, x_update_window_end):
677 Adjust to use per-window output cursor.
678
679 2013-08-27 Paul Eggert <eggert@cs.ucla.edu>
680
681 Simplify SELECT_TYPE-related code.
682 Like EMACS_TIME, this portability layer is no longer needed, since
683 Emacs has been using fd_set as a portability layer for some time.
684 * sysselect.h (FD_SETSIZE): Rename from MAXDESC. All uses changed.
685 (SELECT_TYPE): Remove. All uses changed to fd_set.
686 (fd_set) [!FD_SET]: New typedef.
687
688 Simplify EMACS_TIME-related code.
689 This portability layer is no longer needed, since Emacs has been
690 using struct timespec as a portability layer for some time.
691 * atimer.h, buffer.h, dispextern.h, xgselect.h:
692 Include <time.h> rather than "systime.h"; that's all that's needed now.
693 * dispnew.c: Include <timespec.h> rather than "systime.h";
694 that's all that's needed now.
695 * systime.h (EMACS_TIME): Remove. All uses changed to struct timespec.
696 (EMACS_TIME_RESOLUTION): Remove. All uses changed to
697 TIMESPEC_RESOLUTION.
698 (LOG10_EMACS_TIME_RESOLUTION): Remove. All uses changed to
699 LOG10_TIMESPEC_RESOLUTION.
700 (EMACS_SECS, emacs_secs_addr): Remove. All uses changed to tv_sec.
701 (EMACS_NSECS): Remove. All uses changed to tv_nsec.
702 (make_emacs_time): Remove. All used changed to make_timespec.
703 (invalid_timespec): Rename from invalid_emacs_time. All uses changed.
704 (current_timespec): Rename from current_emacs_time. All uses changed.
705 (add_emacs_time): Remove. All uses changed to timespec_add.
706 (sub_emacs_time): Remove. All uses change dot timespec_sub.
707 (EMACS_TIME_SIGN): Remove. All uses changed to timespec_sign.
708 (timespec_valid_p): Rename from EMACS_TIME_VALID_P. All uses changed.
709 (EMACS_TIME_FROM_DOUBLE): Remove. All uses changed to dtotimespec.
710 (EMACS_TIME_TO_DOUBLE): Remove. All uses changed to timespectod.
711 (current_timespec): Rename from current_emacs_time. All uses changed.
712 (EMACS_TIME_EQ, EMACS_TIME_LT, EMACS_TIME_LE): Remove. All uses
713 changed to timespec_cmp.
714 * xgselect.c: Include <timespec.h>, since our .h files don't.
715
716 2013-08-27 Dmitry Antipov <dmantipov@yandex.ru>
717
718 * xterm.h (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE:)
719 * nsterm.h (FONT_TYPE_FOR_UNIBYTE, FONT_TYPE_FOR_MULTIBYTE):
720 Remove the leftovers.
721 * gtkutil.c (toplevel): Do not declare Qxft but include
722 font.h to do so.
723 * image.c (toplevel): Do not declare Vlibrary_cache because
724 it's already done in lisp.h.
725
726 2013-08-27 Dmitry Antipov <dmantipov@yandex.ru>
727
728 * lisp.h (Mouse_HLInfo): Move from here...
729 * dispextern.h (Mouse_HLInfo): ...to here and offload lisp.h.
730 (reset_mouse_highlight): New function.
731 * msdos.c (dos_set_window_size, IT_update_begin)
732 (internal_terminal_init):
733 * nsterm.m (ns_update_window_end, x_free_frame_resources)
734 (ns_initialize_display_info):
735 * w32console.c (initialize_w32_display):
736 * w32term.c (x_update_window_end, x_free_frame_resources)
737 (w32_initialize_display_info):
738 * xterm.c (x_update_window_end, x_free_frame_resources, x_term_init):
739 * window.c (Fdelete_other_windows_internal):
740 * xdisp.c (clear_mouse_face, cancel_mouse_face): Use it.
741 * termchar.h (toplevel):
742 * xterm.h (toplevel): Include dispextern.h.
743
744 2013-08-26 Paul Eggert <eggert@cs.ucla.edu>
745
746 Fix minor problems found by static checking.
747 * image.c (XGetPixel, XPutPixel) [HAVE_NS]: Now static.
748 (expect): Avoid nested-if warning.
749 (x_build_heuristic_mask) [HAVE_NS]: Avoid unused-var warning.
750 * nsmenu.m (fillWithWidgetValue:): Avoid type warning.
751 * nsterm.h, nsterm.m (ns_select):
752 * xgselect.c, xgselect.h (xg_select):
753 Adjust signature to better match pselect's.
754 * nsterm.m (ns_select):
755 Don't set *TIMEOUT, since pselect doesn't.
756 * regex.c (whitespace_regexp): Now const_re_char *, to avoid
757 diagnostic about assigning const char * to it.
758 * xfaces.c (x_display_info) [HAVE_NS]: Remove; unused.
759
760 2013-08-26 Stefan Monnier <monnier@iro.umontreal.ca>
761
762 * lread.c (substitute_object_recurse): Handle hash-tables as well
763 (bug#15190).
764
765 2013-08-26 Paul Eggert <eggert@cs.ucla.edu>
766
767 Fix unlikely core dump in init_tty, and simplify terminfo case.
768 * term.c (init_tty) [TERMINFO]: Fix check for buffer overrun.
769 The old version incorrectly dumped core if malloc returned a
770 buffer containing only non-NUL bytes.
771 (init_tty): Do not allocate or free termcap buffers; the
772 struct does that for us now.
773 * termchar.h (TERMCAP_BUFFER_SIZE) [!TERMINFO]: New constant.
774 (struct tty_display_info): Define members termcap_term_buffer and
775 termcap_strings_buffer only if !TERMINFO, since terminfo doesn't
776 use them. Allocate them directly in struct rather than indirectly
777 via a pointer, to simplify init_tty.
778
779 * frame.c (check_minibuf_window): Initialize 'window' properly,
780 so that Emacs reliably aborts later if 'window' is not initialized.
781
782 2013-08-26 Jan Djärv <jan.h.d@swipnet.se>
783
784 * gtkutil.c (xg_initialize): Set gtk-menu-bar-accel to "" instead
785 of VoidSymbol (Bug#15154).
786
787 2013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
788
789 * lisp.h (Mouse_HLInfo): Drop set-but-unused members
790 mouse_face_beg_y and mouse_face_end_y.
791 * xdisp.c (note_tool_bar_highlight, mouse_face_from_buffer_pos)
792 (mouse_face_from_string_pos, note_mode_line_or_margin_highlight):
793 Adjust users and update comment where appropriate.
794
795 2013-08-26 Martin Rudalics <rudalics@gmx.at>
796
797 * frame.c (check_minibuf_window): New function.
798 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
799 Call check_minibuf_window (Bug#15183).
800
801 2013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
802
803 * window.h (struct window): Replace last_cursor with last_cursor_vpos
804 because this is the only last cursor data we need to keep and consult.
805 * window.c (replace_window, set_window_buffer, Fsplit_window_internal):
806 * xdisp.c (mark_window_display_accurate_1, try_cursor_movement):
807 Adjust users.
808
809 2013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
810
811 Fix recovering from possible decompression error.
812 Since insert_from_gap doesn't always move point, we can't use PT as
813 the position where the partially decompressed data ends, and
814 should count how many bytes was produced so far.
815 * decompress.c (struct decompress_unwind_data): Add nbytes member.
816 (unwind_decompress): Really delete partially uncompressed data.
817 (Fzlib_decompress_region): Take decompressed data size into account.
818
819 2013-08-26 Dmitry Antipov <dmantipov@yandex.ru>
820
821 * syntax.c (init_syntax_once): Adjust comment and do an early
822 initialization of Qchar_table_extra_slots just once...
823 * casetab.c (init_casetab_once):
824 * category.c (init_category_once):
825 * character.c (syms_of_character):
826 * coding.c (syms_of_coding):
827 * xdisp.c (syms_of_xdisp): ...and omit it here.
828
829 2013-08-24 Eli Zaretskii <eliz@gnu.org>
830
831 * xdisp.c (get_next_display_element): Don't apply to characters
832 from a display vector the logic of setting it->end_of_box_run_p
833 suitable for characters from a buffer. (Bug#15175)
834
835 * w32.c (fdutimens): Call 'utime', which is implemented on w32.c
836 to handle directories, rather than '_utime' which doesn't.
837 (Bug#15176)
838
839 2013-08-24 Jan Djärv <jan.h.d@swipnet.se>
840
841 * gtkutil.c (x_wm_set_size_hint): Don't set hints when maximized
842 or fullscreen (Bug#14627).
843
844 2013-08-24 Paul Eggert <eggert@cs.ucla.edu>
845
846 System-dependent integer overflow fixes.
847 * process.c (Fset_process_window_size): Signal an error if
848 the window size is outside the range supported by the lower level.
849 * sysdep.c (set_window_size): Return negative on error,
850 nonnegative on success, rather than -1, 0, 1 on not in system,
851 failure, success. This is simpler. Caller changed.
852 (serial_configure): Remove unnecessary initialization of local.
853 (procfs_get_total_memory) [GNU_LINUX]: Don't assume system memory
854 size fits in unsigned long; this isn't true on some 32-bit hosts.
855 Avoid buffer overrun if some future version of /proc/meminfo has a
856 variable name longer than 20 bytes.
857 (system_process_attributes) [__FreeBSD__]:
858 Don't assume hw.availpages fits in 'int'.
859
860 2013-08-23 Paul Eggert <eggert@cs.ucla.edu>
861
862 Don't let very long directory names overrun the stack.
863 Fix some related minor problems involving "//", vfork.
864 * callproc.c (encode_current_directory): New function.
865 (call_process): Don't append "/"; not needed.
866 * fileio.c (file_name_as_directory_slop): New constant.
867 (file_name_as_directory): Allow SRC to be longer than SRCLEN;
868 this can save the caller having to alloca.
869 (Ffile_name_as_directory, Fdirectory_file_name, Fexpand_file_name):
870 Use SAFE_ALLOCA, not alloca.
871 (directory_file_name, Fexpand_file_name): Leave leading "//"
872 alone, since it can be special even on POSIX platforms.
873 * callproc.c (call_process):
874 * process.c (Fformat_network_address):
875 * sysdep.c (sys_subshell):
876 Use encode_current_directory rather than rolling our own.
877 (create_process): No need to encode directory; caller does that now.
878 * process.h (encode_current_directory): New decl.
879 * sysdep.c (sys_subshell): Work even if vfork trashes saved_handlers.
880 Rework to avoid 'goto xyzzy;'.
881
882 2013-08-23 Eli Zaretskii <eliz@gnu.org>
883
884 * xdisp.c (handle_face_prop): If the default face was remapped use
885 the remapped face for strings from prefix properties. (Bug#15155)
886
887 2013-08-23 Dmitry Antipov <dmantipov@yandex.ru>
888
889 Minor cleanup for redisplay interface and few related functions.
890 * frame.h (enum text_cursor_kinds): Move from here...
891 * dispextern.h (enum text_cursor_kinds): ...to here.
892 (toplevel): Drop unnecessary declarations.
893 (struct redisplay_interface): Use bool and enum text_cursor_kinds
894 in update_window_end_hook and draw_window_cursor functions.
895 (display_and_set_cursor, x_update_cursor): Adjust prototypes.
896 * nsterm.m (ns_update_window_end, ns_draw_window_cursor):
897 * w32term.c (x_update_window_end,w32_draw_window_cursor):
898 * xterm.c (x_update_window_end, x_draw_window_cursor):
899 * xdisp.c (display_and_set_cursor, update_window_cursor)
900 (update_cursor_in_window_tree, x_update_cursor): Use bool and
901 enum text_cursor_kinds where appropriate.
902
903 2013-08-23 Dmitry Antipov <dmantipov@yandex.ru>
904
905 Redesign redisplay interface to drop updated_row and updated_area.
906 * dispextern.h (updated_row, updated_area): Remove declaration.
907 (struct redisplay_interface): Pass glyph row and row area parameters
908 to write_glyphs, insert_glyphs and clear_end_of_line functions.
909 (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
910 Adjust prototypes.
911 * dispnew.c (updated_row, updated_area): Remove.
912 (redraw_overlapped_rows, update_window_line): Adjust user.
913 (update_marginal_area, update_text_area): Likewise. Pass updated row
914 as a parameter. Prefer enum glyph_row_area to int where appropriate.
915 * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
916 Adjust users.
917
918 2013-08-22 Paul Eggert <eggert@cs.ucla.edu>
919
920 * process.c (flush_pending_output): Remove stub.
921 All uses removed.
922
923 2013-08-21 Paul Eggert <eggert@cs.ucla.edu>
924
925 * callproc.c: Fix race that killed background processes (Bug#15144).
926 (call_process): New arg TEMPFILE_INDEX. Callers changed.
927 Record deleted process-id in critical section, not afterwards.
928 Don't mistakenly kill process created by a call-process invocation
929 that discards output and does not wait.
930
931 2013-08-21 Dmitry Antipov <dmantipov@yandex.ru>
932
933 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE
934 and GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES.
935 * alloc.c (toplevel): Remove unnecessary nested #if...#endif.
936 (mark_maybe_object) [!GC_MARK_STACK]: Define to emacs_abort
937 to shut up compiler in mark_object.
938 (dump_zombies): Convert to global and add EXTERNALLY_VISIBLE.
939
940 2013-08-21 Paul Eggert <eggert@cs.ucla.edu>
941
942 * process.c (allocate_pty) [PTY_OPEN]: Set fd's FD_CLOEXEC flag.
943 We can't portably rely on PTY_OPEN doing that, even if
944 it calls posix_openpt with O_CLOEXEC.
945
946 2013-08-20 Kenichi Handa <handa@gnu.org>
947
948 * character.c (string_char): Improve commentary.
949
950 2013-08-20 Paul Eggert <eggert@cs.ucla.edu>
951
952 * image.c (SIGNATURE_DIGESTSIZE): Remove.
953 (struct animation_cache): Make signature a flexible array member.
954 All uses changed. This is a tad slower but may insulate us better
955 from future changes to ImageMagick.
956
957 2013-08-19 Paul Eggert <eggert@cs.ucla.edu>
958
959 * image.c: Shrink memory needed for animation cache.
960 (SIGNATURE_DIGESTSIZE): New constant.
961 (struct animation_cache): Make 'signature' a fixed size array of bytes.
962 (imagemagick_create_cache): Copy the signature. This saves
963 several KB of memory that ImageMagick wastes per signature.
964 Don't bother updating the update_time, as the caller does that now.
965 (imagemagick_prune_animation_cache): Don't destroy the signature, as
966 it's a fixed size struct member now.
967 (imagemagick_get_animation_cache): Always destroy the signature,
968 as it's now imagemagick_create_cache's responsibility to copy it.
969 Avoid duplicate calls to strcmp and to imagemagick_create_cache,
970 and use memcmp rather than strcmp.
971 eassert that ImageMagick returns a signature of the specified length.
972
973 2013-08-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
974
975 * image.c (imagemagick_get_animation_cache): Don't segfault on
976 each invocation.
977 (imagemagick_get_animation_cache): Revert to previous definition
978 so that it actually works. But keep the memory leak fix.
979 (imagemagick_get_animation_cache): Fix memory leak.
980
981 2013-08-19 Paul Eggert <eggert@cs.ucla.edu>
982
983 * image.c: Fix animation cache signature memory leak.
984 Fix some other minor performance problems while we're at it.
985 (imagemagick_create_cache): Clear just the members that
986 need clearing. Don't set update_time, as caller does that now.
987 (imagemagick_prune_animation_cache, imagemagick_get_animation_cache):
988 Simplify by using pointer-to-pointer instead of a prev pointer.
989 (imagemagick_prune_animation_cache): Use make_emacs_time rather
990 than EMACS_TIME_FROM_DOUBLE, and DestroyString rather than free.
991 (imagemagick_get_animation_cache): Don't xstrdup the image signature;
992 it's already a copy. Free the signature probe unless it's cached.
993
994 * process.c (handle_child_signal): Fix crash; deleted pid (Bug#15106).
995 This was introduced by my 2013-08-12 fix for Bug#15035.
996
997 2013-08-19 Dmitry Antipov <dmantipov@yandex.ru>
998
999 * image.c (imagemagick_create_cache, imagemagick_get_animation_cache)
1000 (imagemagick_prune_animation_cache): Now static.
1001
1002 2013-08-18 Lars Magne Ingebrigtsen <larsi@gnus.org>
1003
1004 * image.c (imagemagick_get_animation_cache): Don't segfault when
1005 pruning all entries.
1006
1007 2013-08-18 Ken Brown <kbrown@cornell.edu>
1008
1009 * sheap.c (STATIC_HEAP_SIZE): Adjust to current needs; use bigger
1010 static heap if ENABLE_CHECKING is defined.
1011 (max_bss_sbrk_ptr): New variable.
1012 (bss_sbrk): Use it.
1013 (report_sheap_usage): Report maximum static heap usage instead of
1014 ending static heap usage.
1015
1016 2013-08-17 Eli Zaretskii <eliz@gnu.org>
1017
1018 * decompress.c (Fzlib_available_p) [WINDOWSNT]: Update the value
1019 of zlib_initialized according to the results of calling
1020 init_zlib_functions.
1021
1022 2013-08-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
1023
1024 * image.c: Implement an ImageMagick per-image cache.
1025 (imagemagick_get_animation_cache): Fix a double-free error.
1026 (imagemagick_load_image): Remove the ping_wand code, which only
1027 apparently saved time on invalid animated images, and slowed down
1028 everything else. Optimise for the common case.
1029
1030 2013-08-16 Xue Fuqiao <xfq.free@gmail.com>
1031
1032 * buffer.c (syms_of_buffer) <buffer-undo-list>: Doc fix.
1033
1034 * editfns.c (insert_before_markers): Mention overlay in the doc string.
1035
1036 * marker.c (set_marker): Remove documentation of undefined behavior.
1037
1038 2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
1039
1040 * image.c (imagemagick_compute_animated_image): Animate correctly
1041 when sub-images are smaller than the main image.
1042 (imagemagick_compute_animated_image): Setting the iterator row to
1043 zero is apparently not allowed.
1044 (imagemagick_compute_animated_image): Allow images that say they
1045 have sub-images that are bigger than the main image, but just crop
1046 them.
1047
1048 2013-08-15 Jan Djärv <jan.h.d@swipnet.se>
1049
1050 * nsmenu.m (menuWillOpen:): Fix preprocessor test (Bug#15001).
1051
1052 2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
1053
1054 * image.c (imagemagick_compute_animated_image): Respect the GIF
1055 disposal methods.
1056
1057 2013-08-15 Ken Brown <kbrown@cornell.edu>
1058
1059 * emacs.c (main): Update comment about G_SLICE_ALWAYS_MALLOC.
1060 * gmalloc.c (memalign) [CYGWIN]: Revert last change; it's not
1061 needed.
1062
1063 2013-08-15 Paul Eggert <eggert@cs.ucla.edu>
1064
1065 Fix minor problems found by static checking.
1066 * frame.c (delete_frame):
1067 * xdisp.c (next_element_from_display_vector):
1068 Avoid uninitialized local.
1069 * image.c (imagemagick_compute_animated_image): Port to C89.
1070 Prefer usual GNU indentation style for loops.
1071 Be more careful about bizarrely large sizes, by using ptrdiff_t
1072 instead of int.
1073
1074 2013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1075
1076 Fix infinite frame selection loop (Bug#15025).
1077 * frame.c (delete_frame): Prefer fast ad-hoc loop to next_frame.
1078
1079 2013-08-15 Eli Zaretskii <eliz@gnu.org>
1080
1081 * xdisp.c (compute_window_start_on_continuation_line):
1082 When WORD_WRAP is in effect, use move_it_to instead of move_it_by_lines
1083 to make sure we end up setting the window start at the leftmost
1084 visible character of the display line. This avoids funky
1085 horizontal shifting because the window start is not kept on the
1086 same position. (Bug#15090)
1087 (next_element_from_display_vector): Support 'box' face attribute
1088 in the face definitions of a display vector. (Bug#15099)
1089
1090 2013-08-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
1091
1092 * image.c (imagemagick_compute_animated_image): Implement animated
1093 images (bug#14700).
1094 (imagemagick_compute_animated_image): Fix some compilation
1095 warnings. Implement a very simple cache to make the animation
1096 usable at all, but it should be replaced with a per-image cache.
1097
1098 2013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1099
1100 * lisp.h (FOR_EACH_ALIST_VALUE): New macro
1101 to do `for' loops over alist values.
1102 * buffer.h (FOR_EACH_BUFFER):
1103 * process.c (FOR_EACH_PROCESS): Use it.
1104 (handle_child_signal, status_notify, Fget_buffer_process)
1105 (kill_buffer_processes): Use FOR_EACH_PROCESS.
1106
1107 2013-08-15 Dmitry Antipov <dmantipov@yandex.ru>
1108
1109 * term.c (get_named_tty, create_tty_output, tty_free_frame_resources)
1110 (tty_free_frame_resources, delete_tty): Prefer eassert to emacs_abort.
1111 * image.c (make_image_cache): For struct image_cache, prefer xmalloc
1112 to xzalloc and so avoid redundant call to memset.
1113 * xterm.c (x_term_init): Avoid unnecessary initializations of dpyinfo
1114 members because it is allocated with xzalloc and so already zeroed.
1115
1116 2013-08-14 Ken Brown <kbrown@cornell.edu>
1117
1118 * gmalloc.c (memalign) [CYGWIN]: Rename to emacs_memalign
1119 (Bug#15094).
1120
1121 2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1122
1123 Utility function and macro to copy Lisp string to C string.
1124 * lisp.h (xlispstrdupa): New macro.
1125 (xlispstrdup): New prototype.
1126 * alloc.c (xlispstrdup): New function.
1127 * callint.c (Fcall_interactively):
1128 * fileio.c (Ffile_name_directory, Fexpand_file_name)
1129 (Fsubstitute_in_file_name):
1130 * frame.c (Fmake_terminal_frame): Use xlispstrdupa.
1131 * image.c (x_create_bitmap_from_file):
1132 * w32term.c (w32_term_init):
1133 * xterm.c (x_term_init): Use xlispstrdup.
1134
1135 2013-08-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
1136
1137 * image.c (imagemagick_load_image): Make animated pictures work.
1138 There's still some problems with background color settings, though
1139 (bug#14700).
1140
1141 * decompress.c (unwind_decompress): Always restore point.
1142
1143 2013-08-14 Xue Fuqiao <xfq.free@gmail.com>
1144
1145 * marker.c (set_marker): Reformat documentation.
1146
1147 2013-08-14 Paul Eggert <eggert@cs.ucla.edu>
1148
1149 * xdisp.c (cursor_type_changed): Now static.
1150
1151 * image.c (imagemagick_filename_hint): New arg HINT_BUFFER.
1152 Use changed. This avoids the need to call xmalloc and for the
1153 caller to call xfree, and avoids memory leaks in some situations.
1154
1155 2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1156
1157 * xdisp.c (adjust_window_ends): Move duplicated code to new function.
1158 (try_window, try_window_reusing_current_matrix, try_window_id): Use it.
1159 (redisplay_window): If window_end_valid is cleared due to non-zero
1160 windows_or_buffers_changed, clear current_matrix_up_to_date_p and
1161 so do not call to try_cursor_movement for that window.
1162
1163 2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1164
1165 * window.h (struct window): Convert window_end_pos and
1166 window_end_vpos from Lisp_Object to ptrdiff_t and int, respectively.
1167 (wset_window_end_pos, wset_window_end_vpos): Remove.
1168 * dispnew.c (adjust_glyph_matrix):
1169 * window.c (Fwindow_end, replace_window, set_window_buffer)
1170 (make_window):
1171 * xdisp.c (check_window_end, move_it_to, redisplay_internal)
1172 (set_vertical_scroll_bar, redisplay_window, try_window)
1173 (try_window_reusing_current_matrix, find_first_unchanged_at_end_row)
1174 (try_window_id, decode_mode_spec, mouse_face_from_buffer_pos)
1175 (note_mouse_highlight): Adjust users.
1176 (try_cursor_movement): Likewise. Convert old precondition to eassert.
1177 Add comment.
1178
1179 2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1180
1181 Fix --enable-gcc-warnings errors introduced in 2013-08-13 commit.
1182 * image.c (imagemagick_filename_hint): Use `const char *' and
1183 prefer SSDATA to SDATA to avoid warnings.
1184
1185 2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1186
1187 Cleanup window fringes, margins and scroll bars adjustments.
1188 * window.c (set_window_fringes, set_window_margins)
1189 (set_window_scroll_bars, apply_window_adjustment): New functions.
1190 (set_window_buffer, Fset_window_margins, Fset_window_fringes)
1191 (Fset_window_scroll_bars): Use them.
1192
1193 2013-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1194
1195 * window.h (struct window): Convert scroll_bar_width
1196 from Lisp_Object to integer. Adjust comment.
1197 (WINDOW_CONFIG_SCROLL_BAR_WIDTH, WINDOW_CONFIG_SCROLL_BAR_COLS):
1198 Adjust users.
1199 * window.c (wset_scroll_bar_width): Remove.
1200 (make_window): Initialize scroll_bar_width.
1201 (Fsplit_window_internal): Use direct assignment.
1202 (Fset_window_configuration, save_window_save):
1203 Convert Lisp_Object to integer and back where appropriate.
1204 (Fset_window_scroll_bars): Adjust user. Return t if any scroll
1205 bar was actually changed, and mention this in docstring.
1206
1207 2013-08-13 Paul Eggert <eggert@cs.ucla.edu>
1208
1209 * decompress.c: Minor simplifications.
1210 (Fzlib_decompress_region): Don't bother verifying
1211 that avail_out <= UINT_MAX, as that was confusing.
1212 Mention the restriction in a comment instead.
1213 Prefer 'int' to 'ptrdiff_t' when 'int' is wide enough.
1214
1215 2013-08-13 Jan Djärv <jan.h.d@swipnet.se>
1216
1217 * nsmenu.m (x_activate_menubar): Check for OSX >= 10.5
1218 (trackingNotification:): Call ns_check_menu_open only for OSX >= 10.5.
1219
1220 2013-08-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
1221
1222 * image.c (imagemagick_filename_hint): Check for errors in the
1223 alist structure.
1224
1225 2013-08-13 Eli Zaretskii <eliz@gnu.org>
1226
1227 * window.c (Fwindow_margins): Return nil when there's no marginal
1228 area, as per the documented API.
1229
1230 * w32term.c (x_scroll_bar_create): Use ALLOCATE_PSEUDOVECTOR, not
1231 Fmake_vector, as scroll bar's struct members are not all Lisp
1232 objects now. This avoids crashes in GC.
1233
1234 * w32term.h (struct scroll_bar): Convert fringe_extended_p to a
1235 bool, so its address could be taken.
1236
1237 2013-08-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
1238
1239 * image.c (imagemagick_filename_hint): New function to possibly
1240 apply `image-content-type-suffixes'.
1241 (imagemagick_load_image): Use it.
1242
1243 2013-08-13 Eli Zaretskii <eliz@gnu.org>
1244
1245 * decompress.c (Fzlib_decompress_region) [WINDOWSNT]: Return Qnil
1246 if loading zlib failed.
1247
1248 2013-08-13 Jan Djärv <jan.h.d@swipnet.se>
1249
1250 * nsterm.m (ns_set_vertical_scroll_bar): Fix breakage intruduced by
1251 2013-08-13 checkin below. Change bool to BOOL, rule is:
1252 All Obj-C code uses BOOL, except for interfaces callable from C.
1253
1254 * nsterm.h: Fix CGFloat for OSX 10.4 (Bug#15086).
1255
1256 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1257
1258 * window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
1259 * nsterm.m (ns_set_vertical_scroll_bar): Use it. Use convenient
1260 bool instead of BOOL.
1261 * w32term.h (struct scroll_bar): Convert fringe_extended_p
1262 from Lisp_Object to bitfield. Adjust comment.
1263 * w32term.c (x_scroll_bar_create): Adjust user.
1264 Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
1265 * xterm.c (XTset_vertical_scroll_bar): Likewise.
1266 Use bool for boolean.
1267 * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
1268 to `unsigned int' when defining a bitfield.
1269
1270 2013-08-13 Paul Eggert <eggert@cs.ucla.edu>
1271
1272 * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.
1273
1274 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1275
1276 * window.h (struct window): Convert left_margin_cols and
1277 right_margin_cols from Lisp_Objects to integers. Adjust comment.
1278 (WINDOW_LEFT_MARGIN_COLS, WINDOW_RIGHT_MARGIN_COLS)
1279 (WINDOW_LEFT_MARGIN_WIDTH, WINDOW_RIGHT_MARGIN_WIDTH):
1280 Adjust users.
1281 * dispnew.c (margin_glyphs_to_reserve): Convert 3rd arg to int.
1282 Adjust comment.
1283 (showing_window_margins_p, update_window_line, update_frame_1):
1284 * fringe.c (draw_fringe_bitmap_1):
1285 * xdisp.c (window_box_width): Adjust users.
1286 * window.c (wset_left_margin_cols, wset_right_margin_cols): Remove.
1287 (adjust_window_margins, set_window_buffer, Fsplit_window_internal):
1288 Use direct assignment.
1289 (Fset_window_configuration, save_window_save, Fwindow_margins):
1290 Convert Lisp_Object to integer and back where appropriate.
1291 (Fset_window_margins): Adjust user. Return t if any margin
1292 was actually changed, and mention this in docstring.
1293
1294 2013-08-13 Xue Fuqiao <xfq.free@gmail.com>
1295
1296 * syntax.c (forward_word):
1297 * cmds.c (forward_char, backward_char): Mention the optional argument.
1298
1299 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1300
1301 * window.h (struct window): Convert left_fringe_width
1302 and right_fringe_width from Lisp_Objects to integers.
1303 Adjust comment.
1304 (WINDOW_FRINGE_COLS, WINDOW_LEFT_FRINGE_WIDTH)
1305 (WINDOW_RIGHT_FRINGE_WIDTH): Adjust users.
1306 * window.c (wset_left_fringe_width, wset_right_fringe_width):
1307 Remove.
1308 (make_window): Initialize new integer fields to -1.
1309 (Fsplit_window_internal): Use direct assignment.
1310 (Fset_window_configuration, save_window_save):
1311 Convert Lisp_Object to integer and back where appropriate.
1312 (Fset_window_fringes): Adjust user. Return t if any fringe
1313 was actually changed, and mention this in docstring.
1314
1315 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1316
1317 * keyboard.c (Fdiscard_input): Do not increment update_mode_lines.
1318 * nsfns.m (x_set_cursor_type):
1319 * w32fns.c (x_set_cursor_type):
1320 * xfns.m (x_set_cursor_type): Do not set cursor_type_changed here...
1321 * xdisp.c (set_frame_cursor_types): ...but in common code.
1322
1323 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1324
1325 * font.c (clear_font_cache): New function, stripped from...
1326 (Fclear_font_cache): ...here, which now uses the function
1327 above. Adjust comment.
1328 * font.h (clear_font_cache): Add prototype.
1329 * xfaces.c (clear_face_cache): Use clear_font_cache.
1330
1331 2013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1332
1333 * window.c (Fset_window_start): Compare `w', not `window' because
1334 `w' might not be equal to `window' after call to decode_live_window.
1335
1336 2013-08-12 Paul Eggert <eggert@cs.ucla.edu>
1337
1338 * process.c (deactivate_process): Reset fds to -1 (Bug#15035).
1339 This fixes a problem introduced by the Bug#15035 patch
1340 when using GPG. Reported by Herbert J. Skuhra.
1341
1342 2013-08-12 Eli Zaretskii <eliz@gnu.org>
1343
1344 * decompress.c <zlib_initialized> [WINDOWSNT]: New static variable.
1345 (Fzlib_decompress_region) [WINDOWSNT]: Call init_zlib_functions if
1346 not yet initialized.
1347
1348 2013-08-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
1349
1350 * decompress.c (Fzlib_decompress_region): Support zlib
1351 decompression, too, and rename.
1352
1353 2013-08-12 Paul Eggert <eggert@cs.ucla.edu>
1354
1355 Minor zlib configuration tweaks.
1356 * decompress.c (fn_inflateInit2) [!WINDOWSNT]:
1357 Don't assume presence of fn_inflateInit2_ zlib internal function.
1358
1359 2013-08-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
1360
1361 * decompress.c (Fzlib_decompress_gzipped_region): Rename to
1362 include the zlib prefix.
1363
1364 2013-08-12 Eli Zaretskii <eliz@gnu.org>
1365
1366 * decompress.c [WINDOWSNT]: Include windows.h and w32.h.
1367 (DEF_ZLIB_FN, LOAD_ZLIB_FN) [WINDOWSNT]: New macros. Use them to
1368 define static variables that are pointers to zlib functions to be
1369 dynamically loaded.
1370 (init_zlib_functions) [WINDOWSNT]: New function.
1371 (fn_inflateInit2_, fn_inflate, fn_inflateEnd, fn_inflateInit2):
1372 New macros.
1373 (Fdecompress_gzipped_region, unwind_decompress): Use the fn_*
1374 macros instead of invoking the zlib functions directly.
1375 (syms_of_decompress): DEFSYM Qzlib_dll.
1376 Staticpro Szlib_available_p.
1377
1378 2013-08-12 Dmitry Antipov <dmantipov@yandex.ru>
1379
1380 Avoid looping over all frame windows to freeze and unfreeze.
1381 * window.h (struct window): Drop frozen_window_start_p.
1382 (freeze_window_starts): Drop prototype.
1383 * frame.h (struct frame): New frozen_window_starts flag.
1384 (FRAME_WINDOWS_FROZEN): New macro.
1385 * window.c (freeze_window_start, freeze_window_starts):
1386 Remove.
1387 (select_window, replace_window): Adjust users.
1388 * xdisp.c (resize_mini_window): Use FRAME_WINDOWS_FROZEN.
1389 (window_frozen_p): New function.
1390 (redisplay_window): Use it.
1391
1392 2013-08-12 Paul Eggert <eggert@cs.ucla.edu>
1393
1394 Fix some fd issues when running subprocesses (Bug#15035).
1395 Fix bugs that can leak files or file descriptors on errors.
1396 Don't unlink open temp files, as that's hard for users to diagnose
1397 when things go awry (e.g., temp disk exhausted).
1398 Don't bother to lock temp files. Check for invalid recursion.
1399 * callproc.c (synch_process_fd): Remove. All uses removed.
1400 (synch_process_tempfile): New var or macro.
1401 (CALLPROC_STDOUT, CALLPROC_STDERR, CALLPROC_PIPEREAD, CALLPROC_FDS):
1402 New constants.
1403 (record_kill_process): New arg, the temp name. All callers changed.
1404 (delete_temp_file): Now just a simple wrapper around unlink.
1405 (call_process_kill): New arg, the call_process_fd array.
1406 Close them all. Clear synch_process_pid. Remove the temp file,
1407 or arrange for it to be removed.
1408 (call_process_cleanup) [MSDOS]: Arg no longer contains file name;
1409 that's been moved to synch_process_tempfile. Caller changed.
1410 Do not remove the tempfile; that's now call_process_kill's
1411 responsibility.
1412 (call_process_cleanup) [!MSDOS]: Do not record unwind-protect for
1413 call_process_kill; the caller now does that.
1414 (call_process_cleanup): Do not close the process fd; that's now
1415 call_process_kill's responsibility.
1416 (Fcall_process): Implement via new function call_process, which
1417 has most of the old body of Fcall_process, but with a different API.
1418 (call_process): New function that does not open or close filefd if
1419 it is nonnegative. Record which fds need to be closed, and let
1420 call_process_kill close (and remove the tempfile, on MSDOS) on error.
1421 Signal an error if invoked recursively (could be done via a hook).
1422 Simplify creation of the tempfile in the MSDOS case.
1423 Don't create the output file until after checking for the executable.
1424 Report any failure to open /dev/null.
1425 Don't open /dev/null for writing twice; once is enough.
1426 Don't create pipe if all output is being discarded or sent to file.
1427 Don't worry about setting up the coding system or reading from the
1428 pipe if all output is being discarded.
1429 Hoist fd_error local into top level, to lessen block nesting.
1430 Don't record deleted pid here; now done by Fcall_process_region.
1431 (Fcall_process) [MSDOS]: Report mktemp failure immediately,
1432 and note its success in synch_process_tempfile.
1433 Do not leak resources when child_setup fails.
1434 (Fcall_process) [!MSDOS && !WINDOWSNT]: Remove duplicate assignment
1435 to child_errno. Remove unnecessary close of fd0; it's close-on-exec.
1436 (create_temp_file): Now returns open fd, with an additional
1437 Lisp_Object * argument to return the name. All callers changed.
1438 Do not close the file; rewind it instead, and leave it open for
1439 the caller. Do not lock the temp file. Unwind-protect the file
1440 and the file-descriptor.
1441 (Fcall_process_region): If the input is /dev/null, unwind-protect it.
1442 If an asynchrounous process, record it here, not in call_process.
1443 (syms_of_callproc) [MSDOS]: Initialize synch_process_tempfile.
1444 * eval.c (set_unwind_protect): New function.
1445 * fileio.c (write_region): New function, generalized from the
1446 old Fwrite_region. Do not lock temp files.
1447 (Fwrite_region): Use it.
1448 * lisp.h (set_unwind_protect, write_region): New decls.
1449 * process.c: Include <verify.h>.
1450 (make_process): Mark fds as initially closed.
1451 (deleted_pid_list): Now a list of pid-filename pairs.
1452 All uses changed.
1453 (close_process_fd): New function.
1454 (SUBPROCESS_STDIN, WRITE_TO_SUBPROCESS, READ_FROM_SUBPROCESS)
1455 (SUBPROCESS_STDOUT, READ_FROM_EXEC_MONITOR, EXEC_MONITOR_OUTPUT):
1456 New constants. Verify that their number matches PROCESS_OPEN_FDS.
1457 (create_process, create_pty, Fmake_serial_process)
1458 (server_accept_connection): Record which fds need to be closed,
1459 and let deactivate_process close them.
1460 (Fmake_network_process): Do not discard the unwind-protect
1461 until it's safe to do so.
1462 (deactivate_process): Close the fds opened by create_process etc.
1463 (Fprocess_send_eof): Adjust to new way of recording open fds.
1464 Report an error if /dev/null can't be opened, instead of aborting.
1465 * process.h (PROCESS_OPEN_FDS): New constant.
1466 (struct Lisp_Process): New member open_fds.
1467 (record_kill_process, record_deleted_pid): Adjust signatures.
1468 (record_deleted_pid): Move decl here ...
1469 * syswait.h (record_deleted_pid): ... from here.
1470
1471 2013-08-11 Paul Eggert <eggert@cs.ucla.edu>
1472
1473 * decompress.c: Fix bugs with large buffers and weird inputs.
1474 Tune a bit. Reindent as per usual Emacs style.
1475 (BUFFER_SIZE): Remove.
1476 (Fdecompress_gzipped_region): Do not mishandle input buffers with
1477 more than UINT_MAX bytes. Decompress into the gap instead of into
1478 an auto buffer, as this should avoid copying. Return nil if
1479 'inflate' returns Z_NEED_DICT, as we have no dictionary. Do not
1480 set immediate_quit; we shouldn't trust zlib code that much.
1481
1482 2013-08-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
1483
1484 * decompress.c (Fdecompress_gzipped_region): Respect all zlib
1485 errors, and really move the gap to where we want it.
1486
1487 * lisp.h: Include decompress.c support.
1488
1489 * emacs.c (main): Include decompress.c support.
1490
1491 * Makefile.in: Include -lz if present.
1492
1493 2013-08-11 Jan Djärv <jan.h.d@swipnet.se>
1494
1495 * nsmenu.m (ns_update_menubar): Call fillWithWidgetValue:frame:
1496 (initWithTitle:): Initialize frame to 0.
1497 (fillWithWidgetValue:): Call fillWithWidgetValue:frame.
1498 (fillWithWidgetValue:frame:): Rename from
1499 fillWithWidgetValue:setDelegate, call initWithTile:frame: if f.
1500
1501 * nsterm.h (EmacsMenu): fillWithWidgetValue:setDelegate renamed to
1502 fillWithWidgetValue:frame:
1503
1504 * nsfns.m (Fns_convert_utf8_nfd_to_nfc): Allocate and release pool to
1505 remove memory leak warnings.
1506
1507 * nsterm.m (menu_pending_title, ns_get_pending_menu_title): Remove.
1508 (ns_check_menu_open): Handle menu == nil. Remove assignment to
1509 menu_pending_title.
1510
1511 * nsmenu.m (ns_update_menubar): Call fillWithWidgetValue:setDelegate.
1512 (x_activate_menubar): Update the whole menu.
1513 (trackingNotification:): Call ns_check_menu_open if tracking ends.
1514 (menuWillOpen:): Increment trackingMenu. For OSX <= 10.6, exit if
1515 current event is not NSSystemDefined (Bug#15001).
1516 Call ns_check_menu_open only if trackingMenu is 2.
1517 (menuDidClose:): New method, decrease trackingMenu.
1518 (fillWithWidgetValue:setDelegate:): New method.
1519 (fillWithWidgetValue:): Call the above.
1520
1521 * nsterm.h (EmacsMenu): Add fillWithWidgetValue:setDelegate:
1522
1523 2013-08-11 Paul Eggert <eggert@cs.ucla.edu>
1524
1525 Omit some unnecessary casts.
1526 Many of these go back to the old pre-C89 days, when they may have
1527 been needed, but we've been assuming C89 or later for a while now.
1528 * alloc.c (live_string_p, live_cons_p, live_symbol_p)
1529 (live_float_p, live_misc_p, live_vector_p):
1530 * buffer.c (compare_overlays, cmp_for_strings, mmap_find)
1531 (mmap_alloc, alloc_buffer_text, enlarge_buffer_text)
1532 (defvar_per_buffer):
1533 * callint.c (Fcall_interactively):
1534 * doc.c (Fsubstitute_command_keys):
1535 * filelock.c (get_boot_time):
1536 * frame.c (xrdb_get_resource):
1537 * gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb)
1538 (delete_cb, xg_dialog_response_cb, xg_maybe_add_timer)
1539 (xg_get_file_name_from_selector, menuitem_destroy_callback)
1540 (menuitem_highlight_callback, menu_destroy_callback)
1541 (xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb)
1542 (xg_tool_bar_callback, xg_get_tool_bar_widgets)
1543 (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
1544 (xg_tool_bar_help_callback, tb_size_cb):
1545 * image.c (xpm_alloc_color, png_read_from_memory)
1546 (png_read_from_file, png_load_body, our_memory_skip_input_data)
1547 (jpeg_memory_src, jpeg_file_src, imagemagick_load_image)
1548 (syms_of_image):
1549 * keymap.c (describe_map):
1550 * nsfns.m (Fns_display_monitor_attributes_list):
1551 * nsmenu.m (process_dialog:):
1552 * nsterm.m (hold_event):
1553 * process.c (wait_reading_process_output):
1554 * regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec):
1555 * scroll.c (do_direct_scrolling, scrolling_1):
1556 * termcap.c (tgetent):
1557 * window.c (check_window_containing, add_window_to_list)
1558 (freeze_window_starts):
1559 * xdisp.c (compare_overlay_entries, vmessage):
1560 * xfns.c (x_window, x_get_monitor_attributes_xinerama)
1561 (x_get_monitor_attributes_xrandr)
1562 (Fx_display_monitor_attributes_list, x_display_info_for_name)
1563 (Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb):
1564 * xfont.c (xfont_match, xfont_open):
1565 * xmenu.c (x_menu_wait_for_event, menu_highlight_callback)
1566 (menubar_selection_callback, menu_position_func)
1567 (popup_selection_callback, create_and_show_popup_menu)
1568 (dialog_selection_callback, create_and_show_dialog):
1569 * xrdb.c (x_get_string_resource):
1570 (main) [TESTRM]:
1571 * xsmfns.c (x_session_check_input):
1572 * xterm.c (x_draw_glyphless_glyph_string_foreground)
1573 (xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback)
1574 (xaw_jump_callback, xaw_scroll_callback):
1575 Omit unnecessary casts.
1576
1577 2013-08-10 Paul Eggert <eggert@cs.ucla.edu>
1578
1579 Minor string-length refactoring.
1580 * alloc.c (xstrdup): Use memcpy, not strcpy, since the length's known.
1581 * frame.c (make_monitor_attribute_list):
1582 Prefer build_string to strlen + make_string.
1583
1584 2013-08-10 Jan Djärv <jan.h.d@swipnet.se>
1585
1586 * xterm.c (x_error_handler): Also ignore BadWindow for X_SetInputFocus,
1587 don't check minor_code (Bug#14417).
1588
1589 2013-08-09 Eli Zaretskii <eliz@gnu.org>
1590
1591 * xdisp.c (draw_glyphs): Don't compare row pointers, compare row
1592 vertical positions instead. This avoids calling MATRIX_ROW with
1593 row numbers that are possibly beyond valid limits. (Bug#15064)
1594
1595 2013-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1596
1597 Use xstrdup and build_unibyte_string where applicable.
1598 * alloc.c (xstrdup): Tiny cleanup. Add eassert.
1599 * xfns.c (x_window):
1600 * xrdb.c (x_get_customization_string):
1601 * xterm.c (xim_initialize):
1602 * w32fns.c (w32_window): Use xstrdup.
1603 (w32_display_monitor_attributes_list):
1604 * emacs.c (init_cmdargs):
1605 * keyboard.c (PUSH_C_STR):
1606 * nsfont.m (nsfont_open):
1607 * sysdep.c (system_process_attributes):
1608 * w32.c (system_process_attributes):
1609 * xdisp.c (message1, message1_nolog): Use build_unibyte_string.
1610
1611 2013-08-09 Eli Zaretskii <eliz@gnu.org>
1612
1613 * w32.c (PEXCEPTION_POINTERS, PEXCEPTION_RECORD, PCONTEXT): Define
1614 variables of these types so that GDB would know about them, as aid
1615 for debugging fatal exceptions. (Bug#15024) See also
1616 http://sourceware.org/ml/gdb/2013-08/msg00010.html for related
1617 discussions.
1618
1619 2013-08-08 Jan Djärv <jan.h.d@swipnet.se>
1620
1621 * nsterm.m (ns_update_begin): Don't change clip path if it would be
1622 larger than the NSWindow (Bug#14934).
1623
1624 2013-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1625
1626 Redesign redisplay interface to drop global variable updated_window.
1627 Always pass currently updated window as a parameter to update routines.
1628 * dispextern.h (updated_window): Remove declaration.
1629 (struct redisplay_interface): Pass window parameter to
1630 write_glyphs, insert_glyphs, clear_end_of_line, cursor_to
1631 and after_update_window_hook.
1632 (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line, x_cursor_to):
1633 Adjust prototypes.
1634 * dispnew.c (updated_window): Remove.
1635 (redraw_overlapped_rows, update_marginal_area, update_text_area)
1636 (update_window_line): Adjust to match redisplay interface changes.
1637 * nsterm.m (ns_update_window_begin, ns_update_window_end)
1638 (ns_scroll_run, ns_after_update_window_line):
1639 * w32term.c (x_update_window_begin, x_update_window_end)
1640 (x_after_update_window_line, x_scroll_run):
1641 * xterm.c (x_update_window_begin, x_update_window_end)
1642 (x_after_update_window_line, x_scroll_run):
1643 * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
1644 Likewise. Adjust comments where appropriate.
1645 (x_cursor_to): Simplify because this is always called during window
1646 update (but install debugging check anyway).
1647 (expose_window): Check must_be_updated_p flag to see whether this
1648 function is called during window update.
1649
1650 2013-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1651
1652 Do not reset window modification event counters excessively.
1653 These leftovers and poor man's tricky methods to catch extra
1654 redisplay's attention are no longer needed.
1655 * frame.c (set_menu_bar_lines_1):
1656 * minibuf.c (read_minibuf_unwind):
1657 * window.c (Fset_window_start, set_window_buffer, window_resize_apply)
1658 (grow_mini_window, shrink_mini_window, window_scroll_pixel_based)
1659 (window_scroll_line_based, Fset_window_configuration):
1660 * xdisp.c (redisplay_window): Do not reset last_modified and
1661 last_overlay_modified counters.
1662
1663 2013-08-07 Jan Djärv <jan.h.d@swipnet.se>
1664
1665 * xselect.c (x_send_client_event): Set send_event and serial, memset
1666 data.l as it might be bigger than data.b. Use 24 bit mask to
1667 XSendEvent (Bug#15034).
1668
1669 2013-08-07 Eli Zaretskii <eliz@gnu.org>
1670
1671 * xdisp.c (prepare_menu_bars): Don't call x_consider_frame_title
1672 for TTY frames that are not the top frame on their console.
1673 (Bug#14616)
1674
1675 2013-08-07 Martin Rudalics <rudalics@gmx.at>
1676
1677 * w32term.c (w32fullscreen_hook): Really maximize frame when
1678 asked for (Bug#14841).
1679
1680 2013-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1681
1682 Prefer selected_window to Fselected_window, likewise for frames.
1683 * buffer.c (Fbuffer_swap_text):
1684 * data.c (Fvariable_binding_locus):
1685 * window.c (run_window_configuration_change_hook): Adjust users.
1686 * w16select.c (Fw16_set_clipboard_data, Fw16_get_clipboard_data):
1687 Use decode_live_frame.
1688
1689 2013-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1690
1691 Be more careful if selected window shows the buffer other than current,
1692 use window_outdated only if this is not so. This change should also
1693 address some weird issues discussed in Bug#13012.
1694 * window.h (window_outdated): New prototype.
1695 * window.c (window_outdated): Now here. Convert from static and
1696 always assume window's buffer.
1697 (Fwindow_end, Fwindow_line_height): Use it.
1698 * xdisp.c (reconsider_clip_changes): Remove prototype, drop 2nd arg
1699 and always assume window's buffer.
1700 (redisplay_window): Adjust user.
1701 (redisplay_internal): Call to reconsider_clip_changes once and
1702 check whether mode line should be updated only if selected window
1703 shows current buffer.
1704 (run_window_scroll_functions): Use eassert for debugging check.
1705 (Fmove_point_visually, note_mouse_highlight): Use window_outdated.
1706
1707 2013-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1708
1709 * window.c (window_scroll, window_scroll_pixel_based)
1710 (window_scroll_line_based): Use bool for booleans.
1711
1712 2013-08-06 Paul Eggert <eggert@cs.ucla.edu>
1713
1714 * process.c: Fix minor off-by-one issues in descriptor counts.
1715 This shouldn't fix any real bugs, but it cleans up the code a bit.
1716 (max_process_desc, max_input_desc): -1, not 0, means none.
1717 All uses changed.
1718 (delete_input_desc): New function.
1719 (delete_write_fd, delete_keyboard_wait_descriptor): Use it.
1720 (deactivate_process): Scan backwards when recomuting max_process_desc;
1721 that should be faster.
1722 (init_process_emacs): Initialize max_input_desc.
1723
1724 2013-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1725
1726 Use region cache to speedup bidi_find_paragraph_start.
1727 * buffer.h (struct buffer): New member bidi_paragraph_cache.
1728 Rename cache_long_line_scans to cache_long_scans.
1729 * buffer.c (bset_cache_long_line_scans): Rename to
1730 bset_cache_long_scans.
1731 (Fget_buffer_create, Fmake_indirect_buffer, Fkill_buffer)
1732 (Fbuffer_swap_text, init_buffer_once): Take bidi_paragraph_cache
1733 into account.
1734 (syms_of_buffer): Rename cache-long-line-scans to
1735 cache-long-scans. Adjust docstring.
1736 * search.c (newline_cache_on_off):
1737 * indent.c (width_run_cache_on_off): Adjust users.
1738 * bidi.c (bidi_paragraph_cache_on_off): New function.
1739 (bidi_find_paragraph_start): Use bidi_paragraph_cache if needed.
1740 * insdel.c (prepare_to_modify_buffer):
1741 Invalidate bidi_paragraph_cache if enabled.
1742
1743 2013-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1744
1745 Invalidate region caches only if buffer text is going to be changed.
1746 * lisp.h (modify_region_1): Remove 3rd arg and rename to...
1747 (modify_text): ...new prototype.
1748 (prepare_to_modify_buffer_1): New prototype.
1749 * textprop.c (modify_region): Rename to...
1750 (modify_text_properties): ...new function.
1751 (add_text_properties_1, set_text_properties, Fremove_text_properties)
1752 (Fremove_list_of_text_properties): Adjust users.
1753 * insdel.c (modify_region_1): Remove 3rd arg and reimplement as...
1754 (modify_text): ...new function.
1755 (prepare_to_modify_buffer): Reimplement mostly as a wrapper for...
1756 (prepare_to_modify_buffer_1): ...new function.
1757 * casefiddle.c (casify_region):
1758 * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
1759 (Ftranspose_regions): Use modify_text.
1760
1761 2013-08-05 Stefan Monnier <monnier@iro.umontreal.ca>
1762
1763 * lisp.mk (lisp): Add nadvice.elc.
1764
1765 2013-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1766
1767 New macro to iterate over live buffers similar to frames.
1768 * buffer.h (FOR_EACH_LIVE_BUFFER): New macro.
1769 (Vbuffer_alist, Qpriority, Qbefore_string, Qafter_string):
1770 Declare buffer-related variables here to offload lisp.h.
1771 * buffer.c (Vbuffer_alist): Adjust comment.
1772 (Fget_file_buffer, get_truename_buffer, Fother_buffer)
1773 (other_buffer_safely):
1774 * data.c (store_symval_forwarding):
1775 * dispnew.c (Fframe_or_buffer_changed_p):
1776 * fileio.c (Fdo_auto_save):
1777 * filelock.c (unlock_all_files):
1778 * minibuf.c (read_minibuf): Use FOR_EACH_LIVE_BUFFER.
1779
1780 2013-08-04 Paul Eggert <eggert@cs.ucla.edu>
1781
1782 Fix some minor races in hosts lacking mkostemp (Bug#15015).
1783 * callproc.c (create_temp_file):
1784 * filelock.c (create_lock_file):
1785 Assume mkostemp, since it's now provided by Gnulib.
1786
1787 2013-08-04 Eli Zaretskii <eliz@gnu.org>
1788
1789 * w32.c (mkostemp): New function.
1790 (mktemp): Remove, no longer used. Most of the code reused in
1791 mkostemp. (Bug#15015)
1792 (mktemp): Don't undef.
1793
1794 2013-08-04 Dmitry Antipov <dmantipov@yandex.ru>
1795
1796 * dispnew.c (glyph_matrix_count, glyph_pool_count):
1797 Move under GLYPH_DEBUG and ENABLE_CHECKING.
1798 (new_glyph_matrix, free_glyph_matrix, new_glyph_pool)
1799 (free_glyph_pool, check_glyph_memory): Likewise for
1800 all users. Adjust comments where appropriate.
1801
1802 2013-08-03 Paul Eggert <eggert@cs.ucla.edu>
1803
1804 * composite.h: Minor fixups.
1805 (composition_registered_p): Rename from COMPOSITION_REGISTERD_P
1806 to fix a misspelling, and change it to an inline function while
1807 we're at it (it need not be a macro). All uses changed.
1808 (composition_method, composition_valid_p):
1809 Rewrite to avoid assignments in if-conditions.
1810
1811 2013-08-03 Dmitry Antipov <dmantipov@yandex.ru>
1812
1813 Do not use global Lisp_Object in composition macros.
1814 * composite.h (composition_temp): Remove declaration.
1815 (COMPOSITION_METHOD, COMPOSITION_VALID_P): Replace with...
1816 (composition_method, composition_valid_p): ...inline functions.
1817 (compose_region): Remove the leftover.
1818 * composite.c (composition_temp): Remove.
1819 (run_composition_function, update_compositions)
1820 (composition_compute_stop_pos, composition_adjust_point)
1821 (Ffind_composition_internal):
1822 * coding.c (handle_composition_annotation):
1823 * xdisp.c (handle_composition_prop, check_point_in_composition):
1824 Related users changed.
1825
1826 2013-08-03 Dmitry Antipov <dmantipov@yandex.ru>
1827
1828 Drop FRAME_PTR typedef.
1829 * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
1830 * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
1831 * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
1832 * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
1833 * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
1834 * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
1835 * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
1836 All related users changed.
1837
1838 2013-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
1839
1840 * eval.c (default_toplevel_binding): New function.
1841 (Fdefvar): Use it.
1842 (unbind_to, backtrace_eval_unrewind): Do a bit of CSE simplification.
1843 (Fdefault_toplevel_value, Fset_default_toplevel_value): New subrs.
1844 (syms_of_eval): Export them.
1845 * data.c (Fdefault_value): Micro cleanup.
1846 * term.c (init_tty): Use "false".
1847
1848 2013-08-02 Dmitry Antipov <dmantipov@yandex.ru>
1849
1850 Fix X GC leak in GTK and raw (no toolkit) X ports.
1851 * xterm.c (x_free_frame_resources): If white and black relief
1852 GCs are allocated, always free them here.
1853 * xfns.c (x_make_gc): Omit redundant initialization.
1854 * widget.c (create_frame_gcs): Remove the leftover.
1855 (EmacsFrameDestroy): Do nothing because all GCs are now freed
1856 in x_free_frame_resources.
1857
1858 2013-08-02 Jan Djärv <jan.h.d@swipnet.se>
1859
1860 * nsterm.m (windowWillResize:toSize:): Only change title if
1861 ! maximizing_resize && FULLSCREEN_NONE (Bug#15005). strdup title before
1862 modifying it.
1863 (viewDidEndLiveResize): New method.
1864
1865 * nsterm.h (EmacsView): Add maximizing_resize, put it and old_title
1866 inside NS_IMPL_COCOA.
1867
1868 2013-08-02 Dmitry Antipov <dmantipov@yandex.ru>
1869
1870 * insdel.c (adjust_after_replace, replace_range, del_range_2):
1871 Do not check whether undo is enabled because record_insert and
1872 record_delete does that themselves.
1873
1874 2013-08-02 Dmitry Antipov <dmantipov@yandex.ru>
1875
1876 * xterm.h (struct x_output) [HAVE_X_I18N]: Remove xic_base_fontname
1877 member which is not really used any more.
1878 (FRAME_XIC_BASE_FONTNAME): Remove.
1879 * xfns.c (xic_free_fontset): Adjust user.
1880 * xmenu.c (mouse_position_for_popup, x_activate_menubar)
1881 (update_frame_menubar, set_frame_menubar, free_frame_menubar)
1882 (create_and_show_popup_menu, xmenu_show, create_and_show_dialog)
1883 (xdialog_show): Use eassert for debugging check.
1884 * w32term.c (x_unfocus_frame): Remove unused dummy function.
1885
1886 2013-08-01 Paul Eggert <eggert@cs.ucla.edu>
1887
1888 * fileio.c, fns.c (merge): Move extern decl from here ...
1889 * lisp.h (merge): ... to here.
1890
1891 2013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1892
1893 Fix last font-related change.
1894 * w32font.h (w32font_list_internal, w32font_match_internal):
1895 Fix prototype.
1896 * w32uniscribe.c (uniscribe_list, uniscribe_match):
1897 (uniscribe_list_family): Adjust to match font API change.
1898 MS-Windows breakage reported by Juanma Barranquero <lekktu@gmail.com>
1899 at http://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00006.html.
1900
1901 2013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1902
1903 * frame.h (FRAME_MOUSE_UPDATE):
1904 * nsterm.m (ns_frame_up_to_date): Omit redundant check
1905 whether hlinfo->mouse_face_mouse_frame is non-NULL.
1906
1907 2013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1908
1909 Avoid redundant Lisp_Object <-> struct frame conversions in font API.
1910 * font.h (struct font_driver): Change list, match, and list_family
1911 functions to accept struct frame * as first arg.
1912 * font.c (font_score, font_compare, font_sort_entities):
1913 Remove prototypes.
1914 (font_sort_entities, font_list_entities, font_select_entity):
1915 (font_find_for_lface, Flist_fonts, Ffont_family_list): Adjust to
1916 match font API change.
1917 * xfont.c (xfont_list, xfont_match, xfont_list_family):
1918 * ftfont.c (ftfont_list, ftfont_match, ftfont_list_family):
1919 * ftxfont.c (ftxfont_list, ftxfont_match):
1920 * xftfont.c (xftfont_list, xftfont_match):
1921 * nsfont.m (nsfont_list, nsfont_match, nsfont_list_family):
1922 * w32font.c (w32font_list, w32font_match, w32font_list):
1923 (w32font_list_internal, w32_font_match_internal): Likewise.
1924 * xfaces.c (Fx_family_fonts): Adjust user.
1925
1926 2013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1927
1928 Do not use pure Xism x_wm_set_icon_position in non-X ports.
1929 * frame.c (x_set_frame_parameters): Call to x_wm_set_icon_position
1930 only if HAVE_X_WINDOWS is in use.
1931 * frame.h (x_set_frame_parameters): Move under HAVE_X_WINDOWS.
1932 * nsterm.m (x_wm_set_icon_position): Remove no-op.
1933 * w32term.c (x_wm_set_icon_position): Likewise.
1934 * w32fns.c (x_icon): Adjust user.
1935
1936 2013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1937
1938 * xterm.c (last_mouse_press_frame): Remove the
1939 leftover which is not really used any more.
1940 (handle_one_xevent, syms_of_xterm): Adjust users.
1941 (x_flush): Call XFlush once per each X display, not frame.
1942 This is better because this code always unconditionally skips
1943 non-X frames in Vframe_list and issues the only XFlush if we
1944 have more than one X frame on the same X display.
1945 (any_help_event_p, x_draw_glyph_string_background, x_display_ok):
1946 Use bool for booleans.
1947 (x_draw_glyph_string_background, cvt_string_to_pixel):
1948 (cvt_pixel_dtor): Drop unnecessary prototypes.
1949 * xterm.h (x_display_ok): Adjust prototype.
1950
1951 2013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1952
1953 Drop unnecessary functions that deals with frame pixel size.
1954 * frame.h, msdos.h, w32term.h, xterm.h (x_pixel_width)
1955 (x_pixel_height): Drop prototypes.
1956 * msdos.c, nsfns.m, w32fns.c, xfns.c (x_pixel_width)
1957 (x_pixel_height): Drop implementations.
1958 * frame.c (Fframe_pixel_height): Use FRAME_PIXEL_HEIGHT
1959 which should be always valid for window frame.
1960 (Frame_pixel_width): Likewise with FRAME_PIXEL_WIDTH.
1961 * w32menu.c (Fx_popup_dialog):
1962 * xmenu.c (Fx_popup_dialog): Likewise for both.
1963
1964 2013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1965
1966 * frame.c (Fmake_terminal_frame): Use store_in_alist to setup
1967 frame parameters and call to Fmodify_frame_parameters just once.
1968 (Fset_frame_height, Fset_frame_width): Mention nil frame in docstring.
1969 (Fset_frame_size, Fset_frame_position): Use decode_live_frame
1970 and mention nil frame in docstring.
1971
1972 2013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1973
1974 * frame.c (make_frame, x_set_frame_parameters): Use bool for boolean.
1975 (x_figure_window_size): Likewise. Adjust to return long.
1976 (syms_of_frame): Do not DEFSYM Qterminal_live_p.
1977 (toplevel): Move Qterminal_live_p to...
1978 * terminal.c (toplevel): ...here, make it static, and...
1979 (syms_of_terminal): ...DEFSYM here.
1980 * frame.h (Qterminal_live_p): Remove declaration.
1981 (make_frame, x_figure_window_size): Adjust prototype.
1982 * nsfns.m (Fx_create_frame): Use long for window flags.
1983
1984 2013-07-30 Paul Eggert <eggert@cs.ucla.edu>
1985
1986 Fix tempfile bug on platforms lacking mkostemp and mkstemp (Bug#14986).
1987 * callproc.c (create_temp_file) [! (HAVE_MKOSTEMP || HAVE_MKSTEMP)]:
1988 Do not assume that emacs_close (INT_MAX) is a no-op.
1989
1990 2013-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1991
1992 * xfaces.c (make_face_cache): For struct face_cache, prefer
1993 xmalloc to xzalloc and so avoid redundant call to memset.
1994 (Finternal_set_lisp_face_attribute): Fix comment typo and style.
1995
1996 2013-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1997
1998 * fringe.c (draw_window_fringes, update_window_fringes)
1999 (compute_fringe_widths):
2000 * w32term.c (x_draw_glyph_string):
2001 * window.c (candidate_window_p, Frecenter):
2002 * xfaces.c (realize_basic_faces, realize_default_face)
2003 (Fbitmap_space_p, Finternal_set_lisp_face_attribute)
2004 (x_update_menu_appearance, face_attr_equal_p, lface_equal_p):
2005 * xfns.c (x_set_cursor_color, xic_free_xfontset):
2006 * xmenu.c (Fx_menu_bar_open_internal):
2007 * xselect.c (x_reply_selection_request, Fx_get_atom_name):
2008 * xsettings.c (xft_settings_event):
2009 * xterm.c (x_draw_glyph_string, x_had_errors_p):
2010 Use bool for booleans. Adjust style and comments where
2011 appropriate.
2012 * dispextern.h (draw_window_fringes, update_window_fringes)
2013 (compute_fringe_widths):
2014 * xterm.h (x_had_errors_p): Adjust prototype.
2015
2016 2013-07-30 Dmitry Antipov <dmantipov@yandex.ru>
2017
2018 * frame.c (Fmodify_frame_parameters): Always check 2nd arg with
2019 CHECK_LIST. Rewrite the loop to avoid useless local variable.
2020
2021 2013-07-29 Dmitry Antipov <dmantipov@yandex.ru>
2022
2023 * fns.c (toplevel): Remove comment before Fsafe_length because
2024 it checks for QUIT.
2025
2026 2013-07-28 Paul Eggert <eggert@cs.ucla.edu>
2027
2028 * frame.c (delete_frame): Avoid unnecessary 'this_f' test (Bug#14970).
2029
2030 2013-07-28 Eli Zaretskii <eliz@gnu.org>
2031
2032 * w32fns.c (w32_wnd_proc) <WM_IME_STARTCOMPOSITION>: Make sure the
2033 frame which got the message is still alive, before dereferencing
2034 its pointer. (Bug#14970)
2035
2036 * frame.c (delete_frame): Test "this" frame's minibuffer window to
2037 be a live window, before using it as such. (Bug#14970)
2038
2039 2013-07-27 Eli Zaretskii <eliz@gnu.org>
2040
2041 * w32term.c (w32_read_socket) <WM_KILLFOCUS>: Call
2042 w32_detect_focus_change instead of doing part of its job by hand.
2043 This fixes the problem whereby FOCUS_OUT events were not sent to
2044 the event queue.
2045
2046 2013-07-26 Eli Zaretskii <eliz@gnu.org>
2047
2048 * process.c (Fprocess_list): Doc fix.
2049
2050 * w32term.c (w32_read_socket) <WM_EMACS_PAINT>: Warn about frame
2051 being re-exposed only if it didn't ask to become visible.
2052 <WM_SIZE>: Under SIZE_RESTORED, only set the frame visible if it
2053 was previously iconified. (Bug#14841)
2054 (x_iconify_frame): Mark the frame iconified.
2055
2056 2013-07-26 Paul Eggert <eggert@cs.ucla.edu>
2057
2058 Fix minor problems found by static checking.
2059 * eval.c (get_backtrace_frame, backtrace_eval_unrewind): Now static.
2060 (backtrace_eval_unrewind): ';' -> '{}' to pacify GCC.
2061
2062 2013-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2063
2064 * eval.c (set_specpdl_old_value): New function.
2065 (unbind_to): Minor simplification.
2066 (get_backtrace_frame): New function.
2067 (Fbacktrace_frame): Use it. Add `base' argument.
2068 (backtrace_eval_unrewind, Fbacktrace_eval): New functions.
2069 (syms_of_eval): Export backtrace-eval.
2070 * xterm.c (x_focus_changed): Simplify.
2071
2072 2013-07-25 Paul Eggert <eggert@cs.ucla.edu>
2073
2074 * fileio.c (Finsert_file_contents): Avoid double-close (Bug#14936).
2075
2076 2013-07-24 Eli Zaretskii <eliz@gnu.org>
2077
2078 * xdisp.c (redisplay_window): Instead of moving point out of
2079 scroll margin, reject the force_start method, and try scrolling
2080 instead. (Bug#14780)
2081
2082 2013-07-24 Ken Brown <kbrown@cornell.edu>
2083
2084 * alloc.c (make_save_ptr): Define if HAVE_NTGUI is defined
2085 (Bug#14944).
2086
2087 2013-07-24 Paul Eggert <eggert@cs.ucla.edu>
2088
2089 * eval.c (Fprogn): Do not check that BODY is a proper list.
2090 This undoes the previous change. The check slows down the
2091 interpreter, and is not needed to prevent a crash. See
2092 <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00693.html>.
2093
2094 2013-07-23 Glenn Morris <rgm@gnu.org>
2095
2096 * Makefile.in ($(etc)/DOC, temacs$(EXEEXT)): Ensure etc/ exists.
2097
2098 2013-07-23 Paul Eggert <eggert@cs.ucla.edu>
2099
2100 Port to GNU/Linux systems with tinfo but not ncurses.
2101 * dispnew.c (init_display): Depend on USE_NCURSES, not GNU_LINUX,
2102 to decide whether ncurses is being used. Without this change,
2103 GCC complains about tgetent not being declared, on a system
2104 that has tinfo installed but ncurses not installed.
2105
2106 * eval.c (Fprogn): Check that BODY is a proper list.
2107
2108 Tune UNEVALLED functions by using XCAR instead of Fcar, etc.
2109 * data.c (Fsetq_default):
2110 * eval.c (Fif, Fcond, Fprog1, Fsetq, Fquote, Ffunction, Fdefvar)
2111 (Fdefconst, FletX, Flet, Fwhile, Fcatch, Funwind_protect)
2112 (Fcondition_case):
2113 Tune by taking advantage of the fact that ARGS is always a list
2114 when a function is declared to have UNEVALLED args.
2115
2116 * emacsgtkfixed.c: Port to GCC 4.6.
2117 GCC 4.6 complains about -Wunused-local-typedefs, introduced in 4.7.
2118
2119 2013-07-23 Juanma Barranquero <lekktu@gmail.com>
2120
2121 * callproc.c (child_setup)[!WINDOWSNT]: Move exec_errno and pid
2122 here to silence compiler warnings.
2123
2124 2013-07-22 Paul Eggert <eggert@cs.ucla.edu>
2125
2126 * sysdep.c (frame) [__FreeBSD__]: #define to freebsd_frame
2127 when including <sys/user.h>, to prevent Sparc/ARM machine/frame.h
2128 from messing up Emacs's 'struct frame' (Bug#14923).
2129
2130 2013-07-21 Paul Eggert <eggert@cs.ucla.edu>
2131
2132 * alloc.c (make_save_ptr_ptr): Define this function.
2133 It was inadvertently omitted. It's needed only if
2134 HAVE_MENUS && ! (USE_X_TOOLKIT || USE_GTK).
2135
2136 2013-07-21 Jan Djärv <jan.h.d@swipnet.se>
2137
2138 * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs
2139 frame have focus (Bug#14895).
2140
2141 2013-07-21 Paul Eggert <eggert@cs.ucla.edu>
2142
2143 Avoid vfork-related deadlock more cleanly.
2144 * callproc.c (child_setup): When the child's exec fails, output
2145 the program name, as that's more useful. Use O_NONBLOCK to avoid
2146 deadlock.
2147 * process.c (create_process_1): Remove; no longer needed.
2148 (create_process): Remove timer hack; no longer needed, now that
2149 the child avoids deadlock.
2150
2151 2013-07-20 Glenn Morris <rgm@gnu.org>
2152
2153 * image.c (Fimage_flush): Fix doc typo.
2154
2155 2013-07-20 Paul Eggert <eggert@cs.ucla.edu>
2156
2157 Fix array bounds violation when pty allocation fails.
2158 * process.c (PTY_NAME_SIZE): New constant.
2159 (pty_name): Remove static variable; it's now auto.
2160 (allocate_pty): Define even if !HAVE_PTYS; that's simpler.
2161 Take pty_name as an arg rather than using a static variable.
2162 All callers changed.
2163 (create_process): Recover pty_flag from process, not from volatile local.
2164 (create_pty): Stay inside array even when pty allocation fails.
2165 (Fmake_serial_process): Omit unnecessary initializaiton of pty_flag.
2166
2167 * lread.c (Fload): Avoid initialization only when lint checking.
2168 Mention that it's needed only for older GCCs.
2169
2170 2013-07-20 Kenichi Handa <handa@gnu.org>
2171
2172 * coding.c (CODING_ISO_FLAG_LEVEL_4): New macro.
2173 (decode_coding_iso_2022): Check the single-shift area. (Bug#8522)
2174
2175 2013-07-20 Andreas Schwab <schwab@linux-m68k.org>
2176
2177 * lread.c (Fload): Avoid uninitialized warning.
2178
2179 2013-07-19 Paul Eggert <eggert@cs.ucla.edu>
2180
2181 Fix some minor file descriptor leaks and related glitches.
2182 * filelock.c (create_lock_file) [!O_CLOEXEC]: Use fcntl with FD_CLOEXEC.
2183 (create_lock_file): Use write, not emacs_write.
2184 * image.c (slurp_file, png_load_body):
2185 * process.c (Fnetwork_interface_list, Fnetwork_interface_info)
2186 (server_accept_connection):
2187 Don't leak an fd on memory allocation failure.
2188 * image.c (slurp_file): Add a cheap heuristic for growing files.
2189 * xfaces.c (Fx_load_color_file): Block input around the fopen too,
2190 as that's what the other routines do. Maybe input need not be
2191 blocked at all, but it's better to be consistent.
2192 Avoid undefined behavior when strlen is zero.
2193
2194 * alloc.c (staticpro): Avoid buffer overrun on repeated calls.
2195 (NSTATICS): Now a constant; doesn't need to be a macro.
2196
2197 2013-07-19 Richard Stallman <rms@gnu.org>
2198
2199 * coding.c (decode_coding_utf_8): Add simple loop for fast
2200 processing of ASCII characters.
2201
2202 2013-07-19 Paul Eggert <eggert@cs.ucla.edu>
2203
2204 * conf_post.h (RE_TRANSLATE_P) [emacs]: Remove obsolete optimization.
2205
2206 2013-07-19 Eli Zaretskii <eliz@gnu.org>
2207
2208 * keyboard.c (kbd_buffer_get_event): Use Display_Info instead of
2209 unportable 'struct x_display_info'.
2210 (DISPLAY_LIST_INFO): Delete macro: not needed, since Display_Info
2211 is a portable type.
2212
2213 2013-07-19 Paul Eggert <eggert@cs.ucla.edu>
2214
2215 * sysdep.c [GNU_LINUX]: Fix fd and memory leaks and similar issues.
2216 (procfs_ttyname): Don't use uninitialized storage if emacs_fopen
2217 or fscanf fails.
2218 (system_process_attributes): Prefer plain char to unsigned char
2219 when either will do. Clean up properly if interrupted or if
2220 memory allocations fail. Don't assume sscanf succeeds.
2221 Remove no-longer-needed workaround to stop GCC from whining.
2222 Read command-line once, instead of multiple times. Check read status a
2223 bit more carefully.
2224
2225 Fix obscure porting bug with varargs functions.
2226 The code assumed that int is treated like ptrdiff_t in a vararg
2227 function, which is not a portable assumption. There was a similar
2228 -- though these days less likely -- porting problem with various
2229 assumptions that pointers of different types all smell the same as
2230 far as vararg functions is conserved. To make this problem less
2231 likely in the future, redo the API to use varargs functions.
2232 * alloc.c (make_save_value): Remove this vararg function.
2233 All uses changed to ...
2234 (make_save_int_int_int, make_save_obj_obj_obj_obj)
2235 (make_save_ptr_int, make_save_funcptr_ptr_obj, make_save_memory):
2236 New functions.
2237 (make_save_ptr): Rename from make_save_pointer, for consistency with
2238 the above. Define only on platforms that need it. All uses changed.
2239
2240 2013-07-18 Paul Eggert <eggert@cs.ucla.edu>
2241
2242 * keyboard.c: Try to fix typos in previous change.
2243 (DISPLAY_LIST_INFO): New macro.
2244 (kbd_buffer_get_event): Do not access members that are not present
2245 in X11. Revert inadvertent change of "!=" to "=".
2246
2247 2013-07-18 Juanma Barranquero <lekktu@gmail.com>
2248
2249 * keyboard.c (kbd_buffer_get_event):
2250 * w32term.c (x_focus_changed): Port FOCUS_(IN|OUT)_EVENT changes to W32.
2251 Followup to 2013-07-16T11:41:06Z!jan.h.d@swipnet.se.
2252
2253 2013-07-18 Paul Eggert <eggert@cs.ucla.edu>
2254
2255 * filelock.c: Fix unlikely file descriptor leaks.
2256 (get_boot_time_1): Rework to avoid using emacs_open.
2257 This doesn't actually fix a leak, but is better anyway.
2258 (read_lock_data): Use read, not emacs_read.
2259
2260 * doc.c: Fix minor memory and file descriptor leaks.
2261 * doc.c (get_doc_string): Fix memory leak when doc file absent.
2262 (get_doc_string, Fsnarf_documentation):
2263 Fix file descriptor leak on error.
2264
2265 * term.c: Fix minor fdopen-related file descriptor leaks.
2266 * term.c (Fresume_tty) [!MSDOS]: Close fd if fdopen (fd) fails.
2267 (init_tty) [!DOS_NT]: Likewise. Also close fd if isatty (fd) fails.
2268
2269 * charset.c: Fix file descriptor leaks and errno issues.
2270 Include <errno.h>.
2271 (load_charset_map_from_file): Don't leak file descriptor on error.
2272 Use plain record_xmalloc since the allocation is larger than
2273 MAX_ALLOCA; that's simpler here. Simplify test for exhaustion
2274 of entries.
2275 * eval.c (record_unwind_protect_nothing):
2276 * fileio.c (fclose_unwind):
2277 New functions.
2278 * lread.c (load_unwind): Remove. All uses replaced by fclose_unwind.
2279 The replacement doesn't block input, but that no longer seems
2280 necessary.
2281
2282 2013-07-17 Paul Eggert <eggert@cs.ucla.edu>
2283
2284 * lread.c: Fix file descriptor leaks and errno issues.
2285 (Fload): Close some races that leaked fds or streams when 'load'
2286 was interrupted.
2287 (Fload, openp): Report error number of last nontrivial failure to open.
2288 ENOENT counts as trivial.
2289 * eval.c (do_nothing, clear_unwind_protect, set_unwind_protect_ptr):
2290 New functions.
2291 * fileio.c (close_file_unwind): No need to test whether FD is nonnegative,
2292 now that the function is always called with a nonnegative arg.
2293 * lisp.h (set_unwind_protect_ptr, set_unwind_protect_int): Remove.
2294 All uses replaced with ...
2295 (clear_unwind_protect, set_unwind_protect_ptr): New decls.
2296
2297 A few more minor file errno-reporting bugs.
2298 * callproc.c (Fcall_process):
2299 * doc.c (Fsnarf_documentation):
2300 * fileio.c (Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
2301 * process.c (set_socket_option):
2302 Don't let a constructor trash errno.
2303 * doc.c: Include <errno.h>.
2304
2305 2013-07-16 Juanma Barranquero <lekktu@gmail.com>
2306
2307 * w32fns.c (unwind_create_tip_frame): Fix declaration.
2308
2309 2013-07-16 Paul Eggert <eggert@cs.ucla.edu>
2310
2311 Fix w32 bug with call-process-region (Bug#14885).
2312 * callproc.c (Fcall_process_region): Pass nil, not "/dev/null",
2313 to Fcall_process when the input is empty. This simplifies the
2314 code a bit. It makes no difference on POSIXish platforms but
2315 apparently it fixes a bug on w32.
2316
2317 Fix bug where insert-file-contents closes a file twice (Bug#14839).
2318 * fileio.c (close_file_unwind): Don't close if FD is negative;
2319 this can happen when unwinding a zapped file descriptor.
2320 (Finsert_file_contents): Unwind-protect the fd before the point marker,
2321 in case Emacs runs out of memory between the two unwind-protects.
2322 Don't trash errno when closing FD.
2323 Zap the FD in the specpdl when closing it, instead of deferring
2324 the removal of the unwind-protect; this fixes a bug where a child
2325 function unwinds the stack past us.
2326
2327 New unwind-protect flavors to better type-check C callbacks.
2328 This also lessens the need to write wrappers for callbacks,
2329 and the need for make_save_pointer.
2330 * alloca.c (free_save_value):
2331 * atimer.c (run_all_atimers):
2332 Now extern.
2333 * alloc.c (safe_alloca_unwind):
2334 * atimer.c (unwind_stop_other_atimers):
2335 * keyboard.c (cancel_hourglass_unwind) [HAVE_WINDOW_SYSTEM]:
2336 * menu.c (cleanup_popup_menu) [HAVE_NS]:
2337 * minibuf.c (choose_minibuf_frame_1):
2338 * process.c (make_serial_process_unwind):
2339 * xdisp.h (pop_message_unwind):
2340 * xselect.c (queue_selection_requests_unwind):
2341 Remove no-longer-needed wrapper. All uses replaced by the wrappee.
2342 * alloca.c (record_xmalloc):
2343 Prefer record_unwind_protect_ptr to record_unwind_protect with
2344 make_save_pointer.
2345 * alloca.c (Fgarbage_collect):
2346 Prefer record_unwind_protect_void to passing a dummy.
2347 * buffer.c (restore_buffer):
2348 * window.c (restore_window_configuration):
2349 * xfns.c, w32fns.c (do_unwind_create_frame)
2350 New wrapper. All record-unwind uses of wrappee changed.
2351 * buffer.c (set_buffer_if_live):
2352 * callproc.c (call_process_cleanup, delete_temp_file):
2353 * coding.c (code_conversion_restore):
2354 * dired.c (directory_files_internal_w32_unwind) [WINDOWSNT]:
2355 * editfns.c (save_excursion_restore)
2356 (subst_char_in_region_unwind, subst_char_in_region_unwind_1)
2357 (save_restriction_restore):
2358 * eval.c (restore_stack_limits, un_autoload):
2359 * fns.c (require_unwind):
2360 * keyboard.c (recursive_edit_unwind, tracking_off):
2361 * lread.c (record_load_unwind, load_warn_old_style_backquotes):
2362 * macros.c (pop_kbd_macro, restore_menu_items):
2363 * nsfns.m (unwind_create_frame):
2364 * print.c (print_unwind):
2365 * process.c (start_process_unwind):
2366 * search.c (unwind_set_match_data):
2367 * window.c (select_window_norecord, select_frame_norecord):
2368 * xdisp.c (unwind_with_echo_area_buffer, unwind_format_mode_line)
2369 (fast_set_selected_frame):
2370 * xfns.c, w32fns.c (unwind_create_tip_frame):
2371 Return void, not a dummy Lisp_Object. All uses changed.
2372 * buffer.h (set_buffer_if_live): Move decl here from lisp.h.
2373 * callproc.c (call_process_kill):
2374 * fileio.c (restore_point_unwind, decide_coding_unwind)
2375 (build_annotations_unwind):
2376 * insdel.c (Fcombine_after_change_execute_1):
2377 * keyboard.c (read_char_help_form_unwind):
2378 * menu.c (unuse_menu_items):
2379 * minibuf.c (run_exit_minibuf_hook, read_minibuf_unwind):
2380 * sound.c (sound_cleanup):
2381 * xdisp.c (unwind_redisplay):
2382 * xfns.c (clean_up_dialog):
2383 * xselect.c (x_selection_request_lisp_error, x_catch_errors_unwind):
2384 Accept no args and return void, instead of accepting and returning
2385 a dummy Lisp_Object. All uses changed.
2386 * cygw32.c (fchdir_unwind):
2387 * fileio.c (close_file_unwind):
2388 * keyboard.c (restore_kboard_configuration):
2389 * lread.c (readevalllop_1):
2390 * process.c (wait_reading_process_output_unwind):
2391 Accept int and return void, rather than accepting an Emacs integer
2392 and returning a dummy object. In some cases this fixes an
2393 unlikely bug when the corresponding int is outside Emacs integer
2394 range. All uses changed.
2395 * dired.c (directory_files_internal_unwind):
2396 * fileio.c (do_auto_save_unwind):
2397 * gtkutil.c (pop_down_dialog):
2398 * insdel.c (reset_var_on_error):
2399 * lread.c (load_unwind):
2400 * xfns.c (clean_up_file_dialog):
2401 * xmenu.c, nsmenu.m (pop_down_menu):
2402 * xmenu.c (cleanup_widget_value_tree):
2403 * xselect.c (wait_for_property_change_unwind):
2404 Accept pointer and return void, rather than accepting an Emacs
2405 save value encapsulating the pointer and returning a dummy object.
2406 All uses changed.
2407 * editfns.c (Fformat): Update the saved pointer directly via
2408 set_unwind_protect_ptr rather than indirectly via make_save_pointer.
2409 * eval.c (specpdl_func): Remove. All uses replaced by definiens.
2410 (unwind_body): New function.
2411 (record_unwind_protect): First arg is now a function returning void,
2412 not a dummy Lisp_Object.
2413 (record_unwind_protect_ptr, record_unwind_protect_int)
2414 (record_unwind_protect_void): New functions.
2415 (unbind_to): Support SPECPDL_UNWIND_PTR etc.
2416 * fileio.c (struct auto_save_unwind): New type.
2417 (do_auto_save_unwind): Use it.
2418 (do_auto_save_unwind_1): Remove; subsumed by new do_auto_save_unwind.
2419 * insdel.c (struct rvoe_arg): New type.
2420 (reset_var_on_error): Use it.
2421 * lisp.h (SPECPDL_UNWIND_PTR, SPECPDL_UNWIND_INT, SPECPDL_UNWIND_VOID):
2422 New constants.
2423 (specbinding_func): Remove; there are now several such functions.
2424 (union specbinding): New members unwind_ptr, unwind_int, unwind_void.
2425 (set_unwind_protect_ptr): New function.
2426 * xselect.c: Remove unnecessary forward decls, to simplify maintenance.
2427
2428 Be simpler and more consistent about reporting I/O errors.
2429 * fileio.c (Fcopy_file, Finsert_file_contents, Fwrite_region):
2430 Say "Read error" and "Write error", rather than "I/O error", or
2431 "IO error reading", or "IO error writing", when a read or write
2432 error occurs.
2433 * process.c (Fmake_network_process, wait_reading_process_output)
2434 (send_process, Fprocess_send_eof, wait_reading_process_output):
2435 Capitalize diagnostics consistently. Put "failed foo" at the
2436 start of the diagnostic, so that we don't capitalize the
2437 function name "foo". Consistently say "failed" for such
2438 diagnostics.
2439 * sysdep.c, w32.c (serial_open): Now accepts Lisp string, not C string.
2440 All callers changed. This is so it can use report_file_error.
2441 * sysdep.c (serial_open, serial_configure): Capitalize I/O
2442 diagnostics consistently as above.
2443
2444 * fileio.c (report_file_errno): Fix errno reporting bug.
2445 If the file name is neither null nor a pair, package it up as a
2446 singleton list. All callers changed, both to this function and to
2447 report_file_error. This fixes a bug where the memory allocator
2448 invoked by list1 set errno so that the immediately following
2449 report_file_error reported the wrong errno value.
2450
2451 Fix minor problems found by --enable-gcc-warnings.
2452 * frame.c (Fhandle_focus_in, Fhandle_focus_out): Return a value.
2453 * keyboard.c (kbd_buffer_get_event): Remove unused local.
2454
2455 2013-07-16 Jan Djärv <jan.h.d@swipnet.se>
2456
2457 * xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
2458 Set event->arg to Qt if switch-event shall be generated.
2459 Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
2460
2461 * termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.
2462
2463 * nsterm.m (windowDidResignKey): If this is the focused frame, generate
2464 FOCUS_OUT_EVENT.
2465
2466 * keyboard.c (Qfocus_in, Qfocus_out): New static objects.
2467 (make_lispy_focus_in, make_lispy_focus_out): Declare and define.
2468 (kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
2469 switch frame event is made. Check ! NILP (event->arg) if X11 (moved
2470 from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
2471 and there is a focused frame.
2472 (head_table): Add focus-in and focus-out.
2473 (keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
2474 bind to handle-focus-in/out.
2475
2476 * frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
2477 (Fhandle_switch_frame): Call Fhandle_focus_in.
2478 (syms_of_frame): defsubr handle-focus-in/out.
2479
2480 2013-07-16 Paul Eggert <eggert@cs.ucla.edu>
2481
2482 Fix porting bug to older POSIXish platforms (Bug#14862).
2483 * sysdep.c (emacs_pipe): New function, that implements
2484 pipe2 (fd, O_CLOEXEC) even on hosts that lack O_CLOEXEC.
2485 This should port better to CentOS 5 and to Mac OS X 10.6.
2486 All calls to pipe2 changed.
2487
2488 Prefer list1 (X) to Fcons (X, Qnil) when building lists.
2489 This makes the code easier to read and the executable a bit smaller.
2490 Do not replace all calls to Fcons that happen to create lists,
2491 just calls that are intended to create lists. For example, when
2492 creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
2493 rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
2494 Similarly for list2 through list5.
2495 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2496 * bytecode.c (exec_byte_code):
2497 * callint.c (quotify_arg, Fcall_interactively):
2498 * callproc.c (Fcall_process, create_temp_file):
2499 * charset.c (load_charset_map_from_file)
2500 (Fdefine_charset_internal, init_charset):
2501 * coding.c (get_translation_table, detect_coding_system)
2502 (Fcheck_coding_systems_region)
2503 (Fset_terminal_coding_system_internal)
2504 (Fdefine_coding_system_internal, Fdefine_coding_system_alias):
2505 * composite.c (update_compositions, Ffind_composition_internal):
2506 * dired.c (directory_files_internal, file_name_completion)
2507 (Fsystem_users):
2508 * dispnew.c (Fopen_termscript, bitch_at_user, init_display):
2509 * doc.c (Fsnarf_documentation):
2510 * editfns.c (Fmessage_box):
2511 * emacs.c (main):
2512 * eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
2513 (Feval, eval_sub, Ffuncall, apply_lambda):
2514 * fileio.c (make_temp_name, Fcopy_file, Faccess_file)
2515 (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
2516 (Fset_file_times, Finsert_file_contents)
2517 (Fchoose_write_coding_system, Fwrite_region):
2518 * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
2519 * font.c (font_registry_charsets, font_parse_fcname)
2520 (font_prepare_cache, font_update_drivers, Flist_fonts):
2521 * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
2522 * frame.c (make_frame, Fmake_terminal_frame)
2523 (x_set_frame_parameters, x_report_frame_params)
2524 (x_default_parameter, Fx_parse_geometry):
2525 * ftfont.c (syms_of_ftfont):
2526 * image.c (gif_load):
2527 * keyboard.c (command_loop_1):
2528 * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
2529 (Fcopy_keymap, append_key, Fcurrent_active_maps)
2530 (Fminor_mode_key_binding, accessible_keymaps_1)
2531 (Faccessible_keymaps, Fwhere_is_internal):
2532 * lread.c (read_emacs_mule_char):
2533 * menu.c (find_and_return_menu_selection):
2534 * minibuf.c (get_minibuffer):
2535 * nsfns.m (Fns_perform_service):
2536 * nsfont.m (ns_script_to_charset):
2537 * nsmenu.m (ns_popup_dialog):
2538 * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
2539 (Fx_own_selection_internal):
2540 * nsterm.m (append2):
2541 * print.c (Fredirect_debugging_output)
2542 (print_prune_string_charset):
2543 * process.c (Fdelete_process, Fprocess_contact)
2544 (Fformat_network_address, set_socket_option)
2545 (read_and_dispose_of_process_output, write_queue_push)
2546 (send_process, exec_sentinel):
2547 * sound.c (Fplay_sound_internal):
2548 * textprop.c (validate_plist, add_properties)
2549 (Fput_text_property, Fadd_face_text_property)
2550 (copy_text_properties, text_property_list, syms_of_textprop):
2551 * unexaix.c (report_error):
2552 * unexcoff.c (report_error):
2553 * unexsol.c (unexec):
2554 * xdisp.c (redisplay_tool_bar, store_mode_line_string)
2555 (Fformat_mode_line, syms_of_xdisp):
2556 * xfaces.c (set_font_frame_param)
2557 (Finternal_lisp_face_attribute_values)
2558 (Finternal_merge_in_global_face, syms_of_xfaces):
2559 * xfns.c (x_default_scroll_bar_color_parameter)
2560 (x_default_font_parameter, x_create_tip_frame):
2561 * xfont.c (xfont_supported_scripts):
2562 * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
2563 (menu_help_callback, xmenu_show):
2564 * xml.c (make_dom):
2565 * xterm.c (set_wm_state):
2566 Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
2567 and similarly for list2 through list5.
2568
2569 2013-07-15 Paul Eggert <eggert@cs.ucla.edu>
2570
2571 * callproc.c (Fcall_process_region): Fix minor race and tune.
2572 (create_temp_file): New function, with the temp-file-creation part
2573 of the old Fcall_process_region. Use Fcopy_sequence to create the
2574 temp file name, rather than alloca + build_string, for simplicity.
2575 Don't bother to block input around the temp file creation;
2576 shouldn't be needed. Simplify use of mktemp.
2577 Use record_unwind_protect immediately after creating the temp file;
2578 this closes an unlikely race where the temp file was not removed.
2579 Use memcpy rather than an open-coded loop.
2580 (Fcall_process_region): Use the new function. If the input is
2581 empty, redirect from /dev/null rather than from a newly created
2582 empty temp file; this avoids unnecessary file system traffic.
2583
2584 2013-07-14 Paul Eggert <eggert@cs.ucla.edu>
2585
2586 * filelock.c (create_lock_file) [!HAVE_MKOSTEMP && !HAVE_MKSTEMP]:
2587 Simplify by making this case like the other two. This is a bit
2588 slower on obsolete hosts, but the extra complexity isn't worth it.
2589
2590 * callproc.c (child_setup, relocate_fd) [!DOS_NT]:
2591 * process.c (create_process) [!DOS_NT]:
2592 Remove now-unnecessary calls to emacs_close.
2593
2594 2013-07-13 Eli Zaretskii <eliz@gnu.org>
2595
2596 * w32term.c (x_draw_hollow_cursor): Delete the brush object when
2597 returning early. (Bug#14850)
2598
2599 * coding.c (syms_of_coding): Set up inhibit-null-byte-detection
2600 and inhibit-iso-escape-detection attributes of 'undecided'.
2601 (Bug#14822)
2602
2603 2013-07-13 Paul Eggert <eggert@cs.ucla.edu>
2604
2605 * deps.mk (sysdep.o): Remove dependency on ../lib/ignore-value.h.
2606 Reported by Herbert J. Skuhra in
2607 <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00455.html>.
2608
2609 Don't lose top specpdl entry when memory is exhausted.
2610 * eval.c (grow_specpdl): Increment specpdl top by 1 and check for
2611 specpdl overflow here, to simplify callers; all callers changed.
2612 Always reserve an unused entry at the stack top; this avoids
2613 losing the top entry's information when memory is exhausted.
2614
2615 2013-07-12 Paul Eggert <eggert@cs.ucla.edu>
2616
2617 Clean up errno reporting and fix some errno-reporting bugs.
2618 * callproc.c (Fcall_process):
2619 * fileio.c (Fcopy_file, Finsert_file_contents, Fwrite_region):
2620 * process.c (create_process, Fmake_network_process):
2621 * unexaix.c (report_error):
2622 * unexcoff.c (report_error):
2623 Be more careful about reporting the errno of failed operations.
2624 The code previously reported the wrong errno sometimes.
2625 Also, prefer report_file_errno to setting errno + report_file_error.
2626 (Fcall_process): Look at openp return value rather than at path,
2627 as that's a bit faster and clearer when there's a numeric predicate.
2628 * fileio.c (report_file_errno): New function, with most of the
2629 old contents of report_file_error.
2630 (report_file_error): Use it.
2631 (Ffile_exists_p, Ffile_accessible_directory_p):
2632 Set errno to 0 when it is junk.
2633 * fileio.c (Faccess_file):
2634 * image.c (x_create_bitmap_from_file):
2635 Use faccessat rather than opening the file, to avoid the hassle of
2636 having a file descriptor open.
2637 * lisp.h (report_file_errno): New decl.
2638 * lread.c (Flocate_file_internal): File descriptor 0 is valid, too.
2639
2640 Minor EBADF fixes.
2641 * process.c (create_process, wait_reading_process_output) [AIX]:
2642 Remove obsolete SIGHUP-related code, as Emacs no longer disables
2643 SIGHUP, so EBADF is no longer acceptable here (it wouldn't work in
2644 a multithreaded environment anyway).
2645 * sysdep.c (emacs_close): It's not dangerous to invoke emacs_close (-1).
2646
2647 2013-07-12 Andreas Schwab <schwab@linux-m68k.org>
2648
2649 * image.c (x_find_image_file): Don't close a remote file handle.
2650
2651 2013-07-12 Paul Eggert <eggert@cs.ucla.edu>
2652
2653 Fix races with threads and file descriptors.
2654 * callproc.c (Fcall_process_region):
2655 * dired.c (open_directory):
2656 * emacs.c (main, Fdaemon_initialized):
2657 * image.c (x_find_image_file):
2658 * inotify.c (Finotify_rm_watch):
2659 * lread.c (Flocate_file_internal):
2660 * process.c (Fnetwork_interface_list, Fnetwork_interface_info):
2661 * term.c (term_mouse_moveto, init_tty):
2662 * termcap.c (tgetent):
2663 * unexaix.c, unexcoff.c (report_error, report_error_1, adjust_lnnoptrs)
2664 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c (unexec):
2665 * unexhp9k800.c, unexmacosx.c (unexec):
2666 * callproc.c (Fcall_process_region):
2667 Use emacs_close, not close.
2668 * sysdep.c (POSIX_CLOSE_RESTART, posix_close) [!POSIX_CLOSE_RESTART]:
2669 New macro and function, which emulates the POSIX_CLOSE_RESTART macro
2670 and posix_close function on current platforms (which all lack them).
2671 (emacs_close): Use it. This should fix the races on GNU/Linux and
2672 on AIX and on future platforms that support POSIX_CLOSE_RESTART,
2673 and it should avoid closing random victim file descriptors on
2674 other platforms.
2675
2676 2013-07-11 Paul Eggert <eggert@cs.ucla.edu>
2677
2678 * inotify.c (uninitialized): Remove. All uses replaced by -1.
2679 (Finotify_add_watch): Simplify, since -1 means uninitialized now.
2680 Touch up doc a bit.
2681
2682 * eval.c (backtrace_function, backtrace_args): Now EXTERNALLY_VISIBLE.
2683 This is for .gdbinit xbacktrace.
2684
2685 * sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
2686 * sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
2687 (emacs_set_tty): Now static.
2688 * sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
2689 * term.c (tty_capable_p, tty_default_color_capabilities)
2690 (get_tty_terminal, term_mouse_movement)
2691 (handle_one_term_event, init_tty, maybe_fatal):
2692 * termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
2693 (tgetent, scan_file, name_match, compare_contin):
2694 * terminal.c (get_terminal):
2695 Use bool for boolean.
2696 * sysdep.c (init_system_name): Don't overflow stack on huge hostname.
2697 Prefer char to unsigned char if either will do.
2698 * term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
2699 (tty_write_glyphs): Prefer int to unsigned.
2700 (produce_glyphless_glyph): Remove 2nd (unused) int arg.
2701 All callers changed.
2702 * termcap.c (tprint, main) [TEST]: Remove non-working test.
2703
2704 2013-07-10 Paul Eggert <eggert@cs.ucla.edu>
2705
2706 Port to C89.
2707 * bytecode.c (BYTE_CODE_THREADED): Do not define if __STRICT_ANSI__.
2708 (B__dummy__): New dummy symbol, to pacify C89.
2709 * dbusbind.c (XD_DEBUG_MESSAGE): Omit debugging on C89 hosts, since
2710 they can't grok varargs macros.
2711 * dispnew.c (add_window_display_history)
2712 (add_frame_display_history):
2713 * print.c (print_object):
2714 * xdisp.c (debug_method_add):
2715 Use %p printf format only for void pointers.
2716 * emacs.c (usage_message): New constant, replacing ...
2717 (USAGE1, USAGE2, USAGE3): Remove; they were too long for C89.
2718 (main): Adjust to usage reorg.
2719 * fns.c (syms_of_fns):
2720 * profiler.c (syms_of_profiler):
2721 Don't use non-constant struct initializers.
2722 * gnutls.h (gnutls_initstage_t):
2723 * lisp.h (enum Lisp_Fwd_Type):
2724 * lread.c (lisp_file_lexically_bound_p):
2725 * xsettings.c (anonymous enum):
2726 Remove trailing comma.
2727 * xsettings.c (apply_xft_settings): Use %f, not %lf; %lf is a C99ism.
2728 * lisp.h (ENUM_BF): Use unsigned if pedantic.
2729 (DEFUN_FUNCTION_INIT): New macro, that falls back on a cast if pre-C99.
2730 (DEFUN): Use it.
2731 * regex.c (const_re_char): New type, to pacify strict C89.
2732 All uses of 'const re_char' replaced to use it.
2733 * regex.h (_Restrict_): Rename from __restrict, to avoid clash
2734 with glibc when strict C89. This change is imported from gnulib.
2735 All uses changed.
2736 (_Restrict_arr_): Rename from __restrict_arr, similarly.
2737 * sysdep.c (time_from_jiffies) [!HAVE_LONG_LONG_INT]:
2738 Omit GNU_LINUX implementation, since it requires long long.
2739 * xterm.c (x_draw_underwave):
2740 Do not assume the traditional order of struct's members.
2741 (x_term_init): Rewrite to avoid the need for non-constant structure
2742 initializers.
2743
2744 Syntax cleanup, mostly replacing macros with functions.
2745 This removes the need for the syntax_temp hack.
2746 * search.c: Include syntax.h after buffer.h, since syntax.h uses BVAR.
2747 * syntax.c (SYNTAX_INLINE): New macro.
2748 (SYNTAX_FLAGS_COMSTART_FIRST, SYNTAX_FLAGS_COMSTART_SECOND)
2749 (SYNTAX_FLAGS_COMEND_FIRST, SYNTAX_FLAGS_COMEND_SECOND)
2750 (SYNTAX_FLAGS_PREFIX, SYNTAX_FLAGS_COMMENT_STYLEB)
2751 (SYNTAX_FLAGS_COMMENT_STYLEC, SYNTAX_FLAGS_COMMENT_STYLEC2)
2752 (SYNTAX_FLAGS_COMMENT_NESTED, SYNTAX_FLAGS_COMMENT_STYLE)
2753 (SYNTAX_COMEND_FIRST): Now functions, not macros.
2754 (ST_COMMENT_STYLE, ST_STRING_STYLE, INTERVALS_AT_ONCE):
2755 Now constants, not macros.
2756 (syntax_temp) [!__GNUC__]: Remove.
2757 (SYNTAX_PREFIX): Remove; all uses replaced by syntax_prefix_flag_p.
2758 (syntax_prefix_flag_p): Move implementation of SYNTAX_PREFIX here.
2759 (SET_RAW_SYNTAX_ENTRY, SET_RAW_SYNTAX_ENTRY_RANGE, SYNTAX_MATCH)
2760 (SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT):
2761 Move here from syntax.h; now functions, not macros. Except for the
2762 last function, these are static since only syntax.c uses them.
2763 (syntax_multibyte): Rename from SYNTAX_WITH_MULTIBYTE_CHECK.
2764 All uses changed. Now a function, not a macro; use this fact
2765 to simplify the code.
2766 (scan_lists, scan_sexps_forward): Remove workarounds for ancient
2767 compiler bugs; no longer relevant.
2768 * syntax.h: Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
2769 (SYNTAX_INLINE): New macro.
2770 (struct gl_state_s, gl_state): Move earlier, so that it's in scope
2771 for the new functions. Use bool for boolean member.
2772 (SYNTAX_ENTRY, SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH)
2773 (SYNTAX_TABLE_BYTE_TO_CHAR, UPDATE_SYNTAX_TABLE_FORWARD)
2774 (UPDATE_SYNTAX_TABLE_BACKWARD, UPDATE_SYNTAX_TABLE)
2775 (SETUP_BUFFER_SYNTAX_TABLE):
2776 Now extern inline functions, not macros.
2777 (CURRENT_SYNTAX_TABLE, SYNTAX_ENTRY_INT):
2778 Remove; all uses replaced by implementation.
2779 (syntax_temp) [!__GNUC__]: Remove decl.
2780 (SETUP_SYNTAX_TABLE_FOR_OBJECT): New decl.
2781
2782 2013-07-10 Jan Djärv <jan.h.d@swipnet.se>
2783
2784 * emacs.c (main): Fix syntax error.
2785
2786 2013-07-10 Paul Eggert <eggert@cs.ucla.edu>
2787
2788 Timestamp fixes for undo (Bug#14824).
2789 * atimer.c (schedule_atimer):
2790 * fileio.c (Ffile_newer_than_file_p):
2791 Minor cleanup: use EMACS_TIME_LT so that we can remove EMACS_TIME_GT.
2792 * buffer.c (buffer-undo-list): Document (t . 0) and (t . -1).
2793 * fileio.c (Fclear_visited_file_modtime): Move to lisp/files.el.
2794 (syms_of_fileio): Remove Sclear_visited_file_name.
2795 (Fvisited_file_modtime): Return -1, not (-1 ...), when the visited
2796 file doesn't exist; this avoids an ambiguity with negative timestamps.
2797 (Fset_visited_file_modtime): Accept -1 and 0 as time-list arg.
2798 * systime.h (make_emacs_time, invalid_emacs_time):
2799 Don't assume struct timespec layout; POSIX doesn't guarantee it.
2800 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE): Remove.
2801 * undo.c (record_first_change): Push (visited-file-modtime) onto
2802 undo list rather than reimplementing it by hand, incorrectly.
2803
2804 2013-07-09 Ken Brown <kbrown@cornell.edu>
2805
2806 * sheap.c (STATIC_HEAP_SIZE) [__x86_64__]: Increase to 18MB.
2807
2808 2013-07-09 Juanma Barranquero <lekktu@gmail.com>
2809
2810 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/sysdep.$(O)): Update.
2811
2812 2013-07-09 Paul Eggert <eggert@cs.ucla.edu>
2813
2814 Handle errno and exit status a bit more carefully.
2815 * callproc.c (child_setup) [!DOS_NT]: Don't try to stuff an error
2816 number into an exit status. Instead, use EXIT_CANCELED.
2817 (child_setup) [!MSDOS]: Avoid possible deadlock with vfork.
2818 * callproc.c (relocate_fd):
2819 * emacs.c (close_output_streams, main):
2820 * process.c (create_process):
2821 * sysdep.c (sys_subshell) [!DOS_NT || !WINDOWSNT]:
2822 Use emacs_perror for simplicity.
2823 * callproc.c (relocate_fd, main):
2824 * sysdep.c (sys_subshell):
2825 Exit with EXIT_CANCELED etc., not 1, when exec setup fails.
2826 (shut_down_emacs): Use emacs_write, not write.
2827 * emacs.c, sysdep.c: Don't include <ignore-value.h>.
2828 * fileio.c (Fcopy_file, e_write):
2829 * nsterm.m (ns_select):
2830 * process.c (send_process):
2831 * sound.c (vox_write):
2832 Use emacs_write_sig, not emacs_write.
2833 * lisp.h (emacs_write_sig, emacs_perror): New decls.
2834 * process.h (EXIT_CANCELED), EXIT_CANNOT_INVOKE, EXIT_ENOENT):
2835 New constants.
2836 * sysdep.c (emacs_backtrace): Use emacs_write, not ignore_value
2837 of write.
2838 (emacs_full_write): New function.
2839 (emacs_write): Rewrite to use it.
2840 (emacswrite_sig, emacs_perror): New functions.
2841 * xrdb.c (fatal): Don't invoke perror, since errno might be garbage.
2842
2843 2013-07-08 Magnus Henoch <magnus.henoch@gmail.com> (tiny change)
2844
2845 * image.c (imagemagick_load_image): Do not use MagickExportImagePixels
2846 on NS even if it is present. Pixmap on NS is a void*.
2847
2848 2013-07-07 Paul Eggert <eggert@cs.ucla.edu>
2849
2850 Port to Ubuntu 10 (Bug#14803).
2851 Problem reported by T.V. Raman.
2852 * process.c (close_on_exec, accept4, process_socket):
2853 Define these if !HAVE_ACCEPT4, not if !SOCK_CLOEXEC.
2854
2855 2013-07-07 Eli Zaretskii <eliz@gnu.org>
2856
2857 * w32.c (sys_dup): Declare prototype.
2858
2859 * filelock.c:
2860 * emacs.c:
2861 * callproc.c [WINDOWSNT]: Include sys/socket.h.
2862
2863 2013-07-07 Paul Eggert <eggert@cs.ucla.edu>
2864
2865 Make file descriptors close-on-exec when possible (Bug#14803).
2866 This simplifies Emacs a bit, since it no longer needs to worry
2867 about closing file descriptors by hand in some cases.
2868 It also fixes some unlikely races. Not all such races, as
2869 libraries often open files internally without setting
2870 close-on-exec, but it's an improvement.
2871 * alloc.c (valid_pointer_p) [!WINDOWSNT]:
2872 * callproc.c (Fcall_process) [!MSDOS]:
2873 * emacs.c (main) [!DOS_NT]:
2874 * nsterm.m (ns_term_init):
2875 * process.c (create_process):
2876 Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
2877 * emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
2878 * filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
2879 Prefer mkostemp with O_CLOEXEC to mkstemp.
2880 * callproc.c (relocate_fd) [!WINDOWSNT]:
2881 * emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
2882 No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
2883 now using pipe2.
2884 * filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
2885 Make the resulting file descriptor close-on-exec.
2886 * lisp.h, lread.c, process.c (close_load_descs, close_process_descs):
2887 * lread.c (load_descriptor_list, load_descriptor_unwind):
2888 Remove; no longer needed. All uses removed.
2889 * process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
2890 (close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
2891 New functions.
2892 (socket) [!SOCK_CLOEXEC]: Supply a substitute.
2893 (Fmake_network_process, Fnetwork_interface_list):
2894 (Fnetwork_interface_info, server_accept_connection):
2895 Make newly-created socket close-on-exec.
2896 * sysdep.c (emacs_open, emacs_fopen):
2897 Make new-created descriptor close-on-exec.
2898 * w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
2899 * w32.c, w32.h (pipe2): Rename from 'pipe', with new flags arg.
2900
2901 2013-07-07 Jan Djärv <jan.h.d@swipnet.se>
2902
2903 * nsterm.m (sendEvent:): Propagate keyboard events to modal windows
2904 for NS_IMPL_GNUSTEP.
2905
2906 2013-07-07 Paul Eggert <eggert@cs.ucla.edu>
2907
2908 Fix openp errno handling.
2909 * callproc.c (Fcall_process): Preserve openp errno around close.
2910 * lread.c (openp): Set errno when returning -1, as some callers
2911 expect this.
2912
2913 2013-07-06 Jan Djärv <jan.h.d@swipnet.se>
2914
2915 * nsterm.m (sendEvent:): Handle NSAPP_DATA2_RUNFILEDIALOG.
2916
2917 * nsterm.h (NSSavePanel): Update comment.
2918 (NSAPP_DATA2_RUNFILEDIALOG): Define.
2919 (ns_run_file_dialog): Declare.
2920
2921 * nsfns.m: Remove panelOK.
2922 (ns_fd_data): New.
2923 (ns_run_file_dialog): New function.
2924 (Fns_read_file_name): Fill in ns_fd_data, post an event and start the
2925 event loop, so file dialog is popped up by ns_run_file_dialog, called
2926 by sendEvent (Bug#14578).
2927 (EmacsSavePanel, EmacsOpenPanel): Remove ok and cancel methods.
2928
2929 2013-07-06 Eli Zaretskii <eliz@gnu.org>
2930
2931 * xdisp.c (default_line_pixel_height): New function.
2932 (pos_visible_p, move_it_vertically_backward, try_scrolling)
2933 (try_cursor_movement, redisplay_window, try_window)
2934 (try_window_id): Use it instead of FRAME_LINE_HEIGHT. (Bug#14771)
2935
2936 * window.c (window_scroll_pixel_based):
2937 use default_line_pixel_height.
2938
2939 * dispextern.h (default_line_pixel_height): Add prototype.
2940
2941 * frame.c (x_set_line_spacing): Accept a float value for
2942 line-spacing parameter, per the documentation.
2943
2944 * data.c (Fmultibyte_string_p): Doc fix.
2945
2946 2013-07-05 Paul Eggert <eggert@cs.ucla.edu>
2947
2948 Use emacs_open more consistently when opening files.
2949 This handles EINTR more consistently now, and makes it easier
2950 to introduce other uniform changes to file descriptor handling.
2951 * src/systdio.h: New file.
2952 * src/buffer.c (mmap_init):
2953 * cygw32.c (chdir_to_default_directory):
2954 * dispnew.c (Fopen_termscript):
2955 * emacs.c (Fdaemon_initialized):
2956 * fileio.c (Fdo_auto_save):
2957 * image.c (slurp_file, png_load_body, jpeg_load_body):
2958 * keyboard.c (Fopen_dribble_file):
2959 * lread.c (Fload):
2960 * print.c (Fredirect_debugging_output):
2961 * sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory):
2962 * termcap.c (tgetent):
2963 * unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs):
2964 * unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec):
2965 * w32term.c (w32_initialize) [CYGWIN]:
2966 * xfaces.c (Fx_load_color_file):
2967 Use emacs_open instead of plain open, and emacs_fopen instead of
2968 plain fopen.
2969 * dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c:
2970 * xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen.
2971 * callproc.c (default_output_mode): New constant.
2972 (Fcall_process): Use it to call emacs_open instead of plain creat.
2973 * dispnew.c (Fopen_termscript): Fix minor race in opening termscript.
2974 * sysdep.c (emacs_open): Add commentary and don't call file name "path".
2975 (emacs_fopen): New function.
2976 * unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c:
2977 Include <lisp.h>, for emacs_open.
2978 * unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
2979
2980 Remove duplicate #include directives.
2981 * alloc.c [GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES]:
2982 * xfaces.c:
2983 Don't include stdio.h twice.
2984 * buffer.c [USE_MMAP_FOR_BUFFERS]:
2985 Don't include sys/types.h or stdio.h twice.
2986 * fileio.c [WINDOWSNT | MSDOS]: Don't include fcntl.h twice.
2987 * lread.c: Don't include coding.h twice.
2988 * nsfont.m: Don't include frame.h twice.
2989 * process.c [HAVE_RES_INIT]: Don't include <netinet/in.h> twice.
2990 * ralloc.c: Don't include <unistd.h> twice.
2991 * xdisp.c: Don't include font.h twice.
2992 * xterm.c: Don't include fontset.h twice.
2993 * xterm.h [USE_X_TOOLKIT]: Don't include X11/StringDefs.h twice.
2994
2995 2013-07-04 Paul Eggert <eggert@cs.ucla.edu>
2996
2997 Scale ImageMagick images more carefully.
2998 * image.c (scale_image_size) [HAVE_IMAGEMAGICK]: New function.
2999 (compute_image_size): Use it. Define only if HAVE_IMAGEMAGICK.
3000 Be more careful about avoiding undefined behavior after
3001 integer overflow and division by zero.
3002
3003 2013-07-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3004
3005 * w32fns.c (Qgeometry, Qworkarea, Qmm_size, Qframes): New variables.
3006 (syms_of_w32fns): DEFSYM them.
3007 (MONITORINFOF_PRIMARY, SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN)
3008 (CCHDEVICENAME): Define macros if not defined.
3009 (struct MONITOR_INFO_EX): New struct.
3010 (MonitorEnum_Proc, EnumDisplayMonitors_Proc): New prototypes.
3011 (enum_display_monitors_fn): New variable.
3012 (globals_of_w32fns): Initialize it.
3013 (Fx_display_pixel_width, Fx_display_pixel_height)
3014 (Fx_display_mm_height, Fx_display_mm_width): Mention behavior on
3015 multi-monitor setups in docstrings.
3016 (Fx_display_mm_height, Fx_display_mm_width): Approximate whole
3017 screen size by primary monitor's millimeter per pixel.
3018 (w32_monitor_enum, w32_display_monitor_attributes_list)
3019 (w32_display_monitor_attributes_list_fallback)
3020 (Fw32_display_monitor_attributes_list): New functions.
3021 (syms_of_w32fns): Defsubr Sw32_display_monitor_attributes_list.
3022
3023 * w32term.c (SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN): Define macros
3024 if not defined.
3025 (x_display_pixel_height, x_display_pixel_width): Use GetSystemMetrics.
3026
3027 2013-07-04 Michael Albinus <michael.albinus@gmx.de>
3028
3029 * fileio.c (Qfile_notify_error): New error symbol.
3030
3031 * gfilenotify.c (Fgfile_add_watch, Fgfile_rm_watch):
3032 * inotify.c (inotify_callback, symbol_to_inotifymask)
3033 (Finotify_add_watch, Finotify_rm_watch): Use it.
3034 (inotifyevent_to_event): Exchange order of cookie and file name.
3035 (Finotify_add_watch): Adapt docstring.
3036
3037 * lisp.h (Qfile_notify_error): Declare.
3038
3039 2013-07-04 Paul Eggert <eggert@cs.ucla.edu>
3040
3041 Try again to fix FreeBSD bug re multithreaded memory alloc (Bug#14569).
3042 * emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
3043 Do not clear _malloc_thread_enabled_p, undoing the previous change,
3044 which did not work (see <http://bugs.gnu.org/14569#307>).
3045 (main): Do not invoke malloc_enable_thread if (! CANNOT_DUMP
3046 && (!noninteractive || initialized)). This attempts to thread
3047 the needle between the Scylla of FreeBSD and the Charybdis of Cygwin.
3048
3049 2013-07-04 Juanma Barranquero <lekktu@gmail.com>
3050
3051 * image.c (x_to_xcolors) [HAVE_NTGUI]: Remove unused var `hdc'.
3052 (x_build_heuristic_mask) [HAVE_NTGUI]: Remove unused var `frame_dc'.
3053
3054 2013-07-04 Paul Eggert <eggert@cs.ucla.edu>
3055
3056 Try to fix FreeBSD bug re multithreaded memory allocation (Bug#14569).
3057 * emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
3058 Clear _malloc_thread_enabled_p at startup. Reported by Ashish SHUKLA in
3059 <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00088.html>.
3060
3061 2013-07-02 Paul Eggert <eggert@cs.ucla.edu>
3062
3063 * sysdep.c (sys_siglist) [HAVE_DECL___SYS_SIGLIST]:
3064 Define to __sys_siglist.
3065
3066 2013-07-02 Eli Zaretskii <eliz@gnu.org>
3067
3068 * xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): Don't disallow
3069 word-wrap, so that overflow-newline-into-fringe would work in
3070 visual-line-mode. (Bug#2749)
3071 (move_it_in_display_line_to): When the last scanned display
3072 element fits exactly on the display line, and
3073 overflow-newline-into-fringe is non-nil, but wrap_it is valid,
3074 don't return MOVE_NEWLINE_OR_CR, but instead back up to the last
3075 wrap point and return MOVE_LINE_CONTINUED. Fixes problems with
3076 finding buffer position that corresponds to pixel coordinates,
3077 e.g. in buffer_posn_from_coords.
3078
3079 2013-07-02 Jan Djärv <jan.h.d@swipnet.se>
3080
3081 * process.c (handle_child_signal): Call catch_child_signal if
3082 NS_IMPL_GNUSTEP.
3083
3084 2013-07-02 Paul Eggert <eggert@cs.ucla.edu>
3085
3086 Don't convert function pointers to void * and back.
3087 It isn't portable C, and it's easy enough to avoid.
3088 * alloc.c: Verify SAVE_FUNCPOINTER bits, too.
3089 (make_save_value): Add support for SAVE_FUNCPOINTER.
3090 * keymap.c (map_keymap_char_table_item, map_keymap_internal):
3091 * print.c (print_object):
3092 Distinguish function from object pointers.
3093 * lisp.h (SAVE_FUNCPOINTER): New constant.
3094 (SAVE_SLOT_BITS): Adjust to it.
3095 (SAVE_TYPE_FUNCPTR_PTR_OBJ): New constant, replacing
3096 SAVE_TYPE_PTR_PTR_OBJ. Change the only use.
3097 (voidfuncptr): New typedef.
3098 (struct Lisp_Save_Value): New member data[0].funcpointer.
3099 (XSAVE_FUNCPOINTER): New function.
3100
3101 Simplify buildobj processing.
3102 * Makefile.in (buildobj.h): Make it a sequence of strings each
3103 followed by comma, rather than a single string. Put it into a
3104 .tmp file in case there's an error while generating it.
3105 (gl-stamp): Use .tmp for temp files.
3106 (mostlyclean): Clean .tmp files.
3107 * doc.c (buildobj): Move to just the routine that needs it.
3108 It's now an array of strings, so processing is simpler.
3109
3110 2013-07-01 Paul Eggert <eggert@cs.ucla.edu>
3111
3112 Fix bug re noninteractive multithreaded memory allocation (Bug#14569).
3113 * emacs.c (malloc_enable_thread): Hoist extern decl to top level.
3114 (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
3115 Invoke malloc_enable_thread even when not interactive.
3116 Problem reported by Ken Brown in <http://bugs.gnu.org/14569#275>.
3117 * process.c (init_process_emacs) [CYGWIN]: Tickle glib even
3118 in this case, since the underlying bug has now been fixed.
3119
3120 2013-07-01 Juanma Barranquero <lekktu@gmail.com>
3121
3122 * emacs.c (Fkill_emacs): Expand Vauto_save_list_file_name before
3123 unlinking it (bug#14691).
3124
3125 2013-06-30 Michal Nazarewicz <mina86@mina86.com>
3126
3127 * buffer.c (FKill_buffer): Run `kill-buffer-query-functions'
3128 before checking whether buffer is modified. This lets
3129 `kill-buffer-query-functions' cancel killing of the buffer or save
3130 its content before `kill-buffer' asks user the "Buffer %s
3131 modified; kill anyway?" question.
3132
3133 2013-06-30 Jan Djärv <jan.h.d@swipnet.se>
3134
3135 * nsfns.m (handlePanelKeys): Don't process Command+Function keys.
3136 Let the super performKeyEquivalent deal with them (Bug#14747).
3137
3138 2013-06-30 Paul Eggert <eggert@cs.ucla.edu>
3139
3140 * widget.c (resize_cb): Remove unused local.
3141
3142 Do not use GTK 3 if it exists but cannot be compiled.
3143 * xmenu.c (x_menu_wait_for_event) [!USE_GTK]:
3144 * xterm.c (x_error_handler) [!USE_GTK]:
3145 Do not use GTK 3.
3146
3147 * intervals.c (get_local_map): Actually clip POSITION (Bug#14753).
3148
3149 2013-06-30 Eli Zaretskii <eliz@gnu.org>
3150
3151 * intervals.c (get_local_map): Instead of aborting, clip POSITION
3152 to the valid range of values. (Bug#14753)
3153
3154 * xdisp.c (Fmove_point_visually): Invalidate the cursor position
3155 when moving point by using the current glyph matrix. This avoids
3156 the need to force redisplay when this function is called in a
3157 loop.
3158
3159 2013-06-29 Paul Eggert <eggert@cs.ucla.edu>
3160
3161 Fix minor problems found by static checking.
3162 * coding.c (encode_inhibit_flag, inhibit_flag): New functions.
3163 Redo the latter's body to sidestep GCC parenthesization warnings.
3164 (setup_coding_system, detect_coding, detect_coding_system): Use them.
3165 * coding.c (detect_coding, detect_coding_system):
3166 * coding.h (struct undecided_spec):
3167 Use bool for boolean.
3168 * image.c (QCmax_width, QCmax_height): Now static.
3169 * xdisp.c (Fmove_point_visually): Remove unused local.
3170
3171 2013-06-29 Eli Zaretskii <eliz@gnu.org>
3172
3173 * xdisp.c (Fmove_point_visually): New function.
3174
3175 2013-06-28 Kenichi Handa <handa@gnu.org>
3176
3177 * coding.h (define_coding_undecided_arg_index): New enum.
3178 (coding_attr_index): New members
3179 coding_attr_undecided_inhibit_null_byte_detection,
3180 coding_attr_undecided_inhibit_iso_escape_detection,
3181 coding_attr_undecided_prefer_utf_8.
3182 (undecided_spec): New struct.
3183 (struct coding_system): New member `undecided' of the member
3184 `spec'.
3185
3186 * coding.c (setup_coding_system): Handle CODING->spec.undecided.
3187 (detect_coding): Likewise.
3188 (detect_coding_system): Likewise.
3189 (Fdefine_coding_system_internal): New coding system properties
3190 :inhibit-null-byte-detection, :inhibit-iso-escape-detection, and
3191 :prefer-utf-8.
3192 (syms_of_coding): Adjust for coding_arg_undecided_max.
3193
3194 2013-06-28 Paul Eggert <eggert@cs.ucla.edu>
3195
3196 * image.c (x_from_xcolors): Remove unused local.
3197
3198 2013-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3199
3200 Defer image data transfer between X client and server until actual
3201 display happens.
3202
3203 * dispextern.h (struct image) [HAVE_X_WINDOWS]: New members `ximg'
3204 and `mask_img'.
3205
3206 * image.c (Destroy_Image): Remove.
3207 (x_clear_image_1): New arg `flags' instead of 3 bools `pixmap_p',
3208 `mask_p', and `colors_p'. All uses changed.
3209 (x_clear_image_1) [HAVE_X_WINDOWS]: Destroy `ximg' and `mask_img'.
3210 (CLEAR_IMAGE_PIXMAP, CLEAR_IMAGE_MASK, CLEAR_IMAGE_COLORS):
3211 New macros for `flags' arg to x_clear_image_1.
3212 (postprocess_image, xpm_load_image, x_build_heuristic_mask)
3213 (png_load_body): Use x_clear_image_1 instead of Free_Pixmap.
3214 (ZPixmap, XGetImage) [HAVE_NS]: Remove.
3215 (image_get_x_image_or_dc, image_unget_x_image_or_dc)
3216 (image_get_x_image, image_unget_x_image): New functions or macros.
3217 (image_background, image_background_transparent, x_to_xcolors)
3218 (x_build_heuristic_mask): Use image_get_x_image_or_dc instead of
3219 XGetImage or CreateCompatibleDC. Use image_unget_x_image_or_dc
3220 instead of Destroy_Image.
3221 (image_create_x_image_and_pixmap, image_put_x_image): New functions.
3222 (xpm_load_image, x_from_xcolors, x_build_heuristic_mask, pbm_load)
3223 (png_load_body, jpeg_load_body, tiff_load, gif_load)
3224 (imagemagick_load_image, svg_load_image): Use them instead of
3225 x_create_x_image_and_pixmap, and x_put_x_image followed by
3226 x_destroy_x_image, respectively.
3227 (xpm_load) [HAVE_XPM && !HAVE_NTGUI]: Use XpmReadFileToImage and
3228 XpmCreateImageFromBuffer instead of XpmReadFileToPixmap and
3229 XpmCreatePixmapFromBuffer. Create pixmaps. Fill background and
3230 background_transparent fields.
3231 (image_sync_to_pixmaps) [HAVE_X_WINDOWS]: New function.
3232 (prepare_image_for_display, x_disable_image) [HAVE_X_WINDOWS]: Use it.
3233
3234 2013-06-27 Paul Eggert <eggert@cs.ucla.edu>
3235
3236 Do not tickle glib SIGCHLD handling if Cygwin (Bug#14569).
3237 This mostly consists of undoing recent changes.
3238 * callproc.c (Fcall_process):
3239 * process.c (create_process):
3240 Do not worry about catching SIGCHLD here, undoing previous change.
3241 * nsterm.m (ns_term_init): Re-catch SIGCHLD, undoing previous change.
3242 * process.c, process.h (catch_child_signal):
3243 No longer extern if !NS_IMPL_GNUSTEP, undoing 06-22 change.
3244 * process.c (catch_child_handler): Don't worry about being called
3245 lazily and do not assume caller has blocked SIGCHLD, undoing
3246 previous change. Move first-time stuff back to
3247 init_process_emacs, undoing 06-22 change. If CYGWIN, do not
3248 tickle glib, as that causes Cygwin bootstrap to fail. Do not
3249 set lib_child_handler if it's already initialized, which may
3250 help avoid problems on GNUStep.
3251
3252 2013-06-23 Paul Eggert <eggert@cs.ucla.edu>
3253
3254 A more-conservative workaround for Cygwin SIGCHLD issues (Bug#14569).
3255 * callproc.c (Fcall_process):
3256 * process.c (create_process):
3257 Make sure SIGCHLD is caught before we fork,
3258 since Emacs startup no arranges to catch SIGCHLD.
3259 * process.c (lib_child_handler): Initialize to null, not to
3260 dummy_handler.
3261 (catch_child_signal): Allow self to be called lazily.
3262 Do nothing if it's already been called.
3263 Assume caller has blocked SIGCHLD (all callers do now).
3264 * emacs.c (main): Do not catch SIGCHLD here; defer it until
3265 just before it's really needed.
3266 * nsterm.m (ns_term_init): No need to re-catch SIGCHLD here,
3267 since it hasn't been caught yet.
3268
3269 2013-06-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
3270
3271 * image.c (compute_image_size): New function to implement
3272 :max-width and :max-height.
3273 (imagemagick_load_image): Use it.
3274
3275 2013-06-23 Paul Eggert <eggert@cs.ucla.edu>
3276
3277 Try to avoid malloc SEGVs on Cygwin (Bug#14569).
3278 * callproc.c, process.h (block_child_signal, unblock_child_signal):
3279 Now extern.
3280 * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify.
3281 * process.c (catch_child_signal): Block SIGCHLD while futzing with
3282 the SIGCHLD handler, since the code is not atomic and (due to glib)
3283 signals may be arriving now.
3284 * sysdep.c (init_signals): Do not catch child signals here;
3285 'main' now does that later, at a safer time.
3286
3287 2013-06-22 Paul Eggert <eggert@cs.ucla.edu>
3288
3289 Clean up SIGCHLD handling a bit (Bug#14569).
3290 * process.c, process.h (catch_child_signal):
3291 Now always extern, even if !NS_IMPL_GNUSTEP.
3292 * process.c (catch_child_signal): Move glib tickler here from
3293 init_process_emacs, so that it's done earlier in Emacs
3294 initialization. Also move the noninteractive && !initialized
3295 check here from init_process_emacs. This is all a bit cleaner for
3296 GNUish platforms, and I hope it works around the Cygwin bug.
3297 * sysdep.c (init_signals): Invoke catch_child_signal here, so
3298 that glib signal handling is tickled before glib creates threads.
3299
3300 * process.c (wait_reading_process_output): Avoid int overflow
3301 when reading more than 2 GiB total from a process.
3302
3303 2013-06-21 Paul Eggert <eggert@cs.ucla.edu>
3304
3305 * process.c (create_process): Handle a couple more cases,
3306 i.e., work even if new_argv and wait_child_setup[i] are cached.
3307 Use Fcall_process's style for volatile vars.
3308
3309 2013-06-21 Andreas Schwab <schwab@linux-m68k.org>
3310
3311 * process.c (create_process): Mark PROCESS volatile.
3312
3313 2013-06-21 Paul Eggert <eggert@cs.ucla.edu>
3314
3315 Use C99-style flexible array members if available.
3316 This avoids some subtle aliasing issues, which typically
3317 aren't a problem with GCC but may be a problem elsewhere.
3318 * alloc.c (sdata): New typedef, replacing the old struct sdata.
3319 It is a struct if GC_CHECK_STRING_BYTES, a union otherwise.
3320 In either case, it uses a flexible array member rather than
3321 the old struct hack. All uses changed.
3322 (SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]:
3323 Adjust to sdata reorganization.
3324 * alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect):
3325 Use offsetof (struct, flex_array_member), not sizeof (struct), as
3326 that ports better to pre-C99 non-GCC.
3327 * chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
3328 Use CHAR_TABLE_STANDARD_SLOTS rather than its definition,
3329 as the latter has changed.
3330 * conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c,
3331 and port better to pre-C99 GCC.
3332 * image.c (struct xpm_cached_color):
3333 * lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
3334 (struct Lisp_Char_Table, struct Lisp_Sub_Char_Table):
3335 Use FLEXIBLE_ARRAY_MEMBER.
3336 * lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]:
3337 Move decl to top level so it gets checked against implementation.
3338 (CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change.
3339 * w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h.
3340
3341 2013-06-20 Paul Eggert <eggert@cs.ucla.edu>
3342
3343 * syntax.c: Integer cleanups.
3344 (SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
3345 All uses that need 0-or-2 changed to:
3346 (SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
3347 as the old SYNTAX_FLAGS_COMMENT_STYLEC.
3348 (struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
3349 (char_quoted, prev_char_comend_first, back_comment)
3350 (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
3351 (in_classes, forw_comment, scan_lists, scan_sexps_forward):
3352 Use bool for boolean.
3353 (update_syntax_table, skip_chars, skip_syntaxes):
3354 Prefer int to unsigned when either will do.
3355 (back_comment): Return boolean success flag, like forw_comment,
3356 instead of positive-or-minus-1 (which might have overflowed int anyway).
3357 Don't stuff ptrdiff_t into int.
3358 (syntax_spec_code, syntax_code_spec): Now const.
3359 (Fmatching_paren, scan_lists, scan_sexps_forward):
3360 Use enum syntaxcode for syntax code.
3361 (Fmatching_paren): Check that arg is a character, not just an integer.
3362 (Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
3363 (Finternal_describe_syntax_value): Omit no-longer-needed
3364 comparison to 0.
3365 (skip_chars): Use char, not unsigned char, when the distinction
3366 doesn't matter.
3367 (forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
3368 * bytecode.c (exec_byte_code):
3369 * syntax.c (syntax_spec_code, Fchar_syntax)
3370 (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
3371 (init_syntax_once):
3372 * syntax.h (SYNTAX_WITH_FLAGS):
3373 Omit unnecessary casts.
3374
3375 2013-06-20 Eli Zaretskii <eliz@gnu.org>
3376
3377 * w32fns.c (w32_wnd_proc): Don't compute the header line and mode
3378 line dimensions here, to avoid race conditions with the main
3379 thread. (Bug#14062, bug#14630, bug#14669)
3380
3381 * w32term.c (w32_draw_window_cursor): Compute the header line and
3382 mode line dimensions here.
3383 <w32_system_caret_window, w32_system_caret_hdr_height>:
3384 <w32_system_caret_mode_height>: New variables.
3385
3386 * w32term.h: Declare them.
3387
3388 2013-06-20 Paul Eggert <eggert@cs.ucla.edu>
3389
3390 * alloc.c (die): Move "assertion failed" string here ...
3391 * lisp.h (eassert): ... from here. Also, suppress evaluation of
3392 COND when SUPPRESS_CHECKING. This shrinks the executable text
3393 size by 0.8% to 2.2% when configured with --enable-checking,
3394 depending on optimization flags (GCC 4.8.1 x86-64).
3395
3396 * floatfns.c (Flog10): Move to Lisp (marked obsolete there).
3397
3398 2013-06-20 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
3399
3400 * floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
3401 base is 2; this is more accurate.
3402
3403 2013-06-19 Juanma Barranquero <lekktu@gmail.com>
3404
3405 * sound.c (string_default): Move to !WINDOWSNT section.
3406 (Fplay_sound_internal) [WINDOWSNT]: Remove i_result to avoid warning.
3407
3408 2013-06-19 Paul Eggert <eggert@cs.ucla.edu>
3409
3410 * sound.c: Integer cleanups.
3411 Remove unnecessary forward decls.
3412 (struct sound_device): The 'file' member is now a Lisp_Object, not
3413 a char *, so that we needn't invoke alloca on a huge size.
3414 (Fplay_sound_internal): Adjust to this.
3415 (string_default): New function.
3416 (vox_open, vox_init, alsa_open, alsa_configure, alsa_init):
3417 Use it to adjust to the struct sound_device change.
3418 (parse_sound, wav_init, au_init, alsa_init): Use bool for booleans.
3419 (be2hs) [0]: Remove.
3420
3421 * syntax.c (skip_chars): Don't use uninitialized storage
3422 when searching a multibyte buffer for characters that are not in a
3423 unibyte string that contains non-ASCII characters.
3424
3425 2013-06-18 Jan Djärv <jan.h.d@swipnet.se>
3426
3427 * process.c: Include xgselect.h if HAVE_GLIB. Include glib.h
3428 if HAVE_GLIB && ! WINDOWSNT (Bug#14654).
3429
3430 2013-06-18 Paul Eggert <eggert@cs.ucla.edu>
3431
3432 * conf_post.h: Add comments for INLINE, EXTERN_INLINE, etc.
3433
3434 2013-06-18 Kenichi Handa <handa@gnu.org>
3435
3436 * font.c (Ffont_spec): Signal an error for an invalid font name
3437 (Bug#14648).
3438
3439 2013-06-18 Paul Eggert <eggert@cs.ucla.edu>
3440
3441 Porting fixes for merged specpdl and backtrace stacks (Bug#14643).
3442 In particular this ports to 32-bit sparc Sun cc.
3443 * eval.c (init_eval_once, grow_specpdl): Allocate a specbinding
3444 array with a dummy element at specpdl[-1], so that its address can
3445 be taken portably.
3446 (unbind_to): Do not copy the binding; not needed, now that we
3447 copy old_value in the one place where the copy is needed.
3448 * fileio.c (Fwrite_region): Use ptrdiff_t, not int, for specpdl count.
3449 * lisp.h (BITS_PER_PTRDIFF_T): Remove; no longer needed.
3450 (union specbinding): Rename from struct specbinding. Redo layout
3451 to avoid the need for 'ptrdiff_t nargs : BITS_PER_PTRDIFF_T - 1;',
3452 which is not portable. With Sun C 5.12 32-bit sparc, the
3453 declaration causes nargs to be an unsigned bitfield, a behavior
3454 that the C standard allows; but Emacs wants nargs to be signed.
3455 The overall type is now a union of structures rather than a
3456 structure of union of structures, and the 'kind' member is now a
3457 bitfield, so that the overall type doesn't grow. All uses changed.
3458 * process.c (Fmake_serial_process): Remove unnecessary initialization.
3459
3460 2013-06-17 Paul Eggert <eggert@cs.ucla.edu>
3461
3462 * frame.c (x_report_frame_params): Cast parent_desc to uintptr_t.
3463 Needed if HAVE_NTGUI. Reported by Juanma Barranquero.
3464
3465 * nsfont.m (ns_registry_to_script): Parenthesize while expression.
3466
3467 2013-06-17 Eli Zaretskii <eliz@gnu.org>
3468
3469 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
3470 unless we know that the window w's frame is a frame object.
3471 Another attempt at solving bug#14062 and bug#14630.
3472
3473 2013-06-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
3474
3475 * textprop.c (property_set_type): New enum.
3476 (add_properties): Allow appending/prepending text properties.
3477 (add_text_properties_1): Factored out of Fadd_text_properties.
3478 (Fadd_text_properties): Move all the code into
3479 add_text_properties_1.
3480 (Fadd_face_text_property): New function that calls
3481 add_text_properties_1.
3482
3483 2013-06-17 Paul Eggert <eggert@cs.ucla.edu>
3484
3485 Move functions from lisp.h to individual modules when possible.
3486 From a suggestion by Andreas Schwab in <http://bugs.gnu.org/11935#68>.
3487 * alloc.c (XFLOAT_INIT, set_symbol_name):
3488 * buffer.c (CHECK_OVERLAY):
3489 * chartab.c (CHECK_CHAR_TABLE, set_char_table_ascii)
3490 (set_char_table_parent):
3491 * coding.c (CHECK_NATNUM_CAR, CHECK_NATNUM_CDR):
3492 * data.c (BOOLFWDP, INTFWDP, KBOARD_OBJFWDP, OBJFWDP, XBOOLFWD)
3493 (XKBOARD_OBJFWD, XINTFWD, XOBJFWD, CHECK_SUBR, set_blv_found)
3494 (blv_value, set_blv_value, set_blv_where, set_blv_defcell)
3495 (set_blv_valcell):
3496 * emacs.c (setlocale) [!HAVE_SETLOCALE]:
3497 * eval.c (specpdl_symbol, specpdl_old_value, specpdl_where)
3498 (specpdl_arg, specpdl_func, backtrace_function, backtrace_nargs)
3499 (backtrace_args, backtrace_debug_on_exit):
3500 * floatfns.c (CHECK_FLOAT):
3501 * fns.c (CHECK_HASH_TABLE, CHECK_LIST_END)
3502 (set_hash_key_and_value, set_hash_next, set_hash_next_slot)
3503 (set_hash_hash, set_hash_hash_slot, set_hash_index)
3504 (set_hash_index_slot):
3505 * keymap.c (CHECK_VECTOR_OR_CHAR_TABLE):
3506 * marker.c (CHECK_MARKER):
3507 * textprop.c (CHECK_STRING_OR_BUFFER):
3508 * window.c (CHECK_WINDOW_CONFIGURATION):
3509 Move here from lisp.h, and make these functions static rather than
3510 extern inline.
3511 * buffer.c (Qoverlayp):
3512 * data.c (Qsubrp):
3513 * fns.c (Qhash_table_p):
3514 * window.c (Qwindow_configuration_p):
3515 Now static.
3516 * lisp.h: Remove the abovementioned defns and decls.
3517
3518 Use functions, not macros, for XINT etc (Bug#11935).
3519 In lisp.h, prefer functions to function-like macros, and
3520 constants to object-like macros, when either will do. This:
3521 . simplifies use, as there's no more need to worry about
3522 arguments' side effects being evaluated multiple times.
3523 . makes the code easier to debug on some platforms.
3524 However, when using gcc -O0, keep using function-like macros
3525 for a few critical operations, for performance reasons.
3526 This sort of thing isn't needed with gcc -Og, but -Og
3527 is a GCC 4.8 feature and isn't widely-enough available yet.
3528 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]:
3529 Remove enum lsb_bits; no longer needed.
3530 (allocate_misc, free_misc): Don't use XMISCTYPE as an lvalue.
3531 * buffer.c (Qoverlap):
3532 * data.c (Qsubrp):
3533 * fns.c (Qhash_table_p):
3534 Now extern, so lisp.h can use these symbols.
3535 * dispextern.h: Include character.h, for MAX_CHAR etc.
3536 (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
3537 (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
3538 (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
3539 (GLYPH_CODE_P): Move here from lisp.h.
3540 (GLYPH_CHAR, GLYPH_FACE, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
3541 (GLYPH_CHAR_VALID_P, GLYPH_CODE_P): Now functions, not macros.
3542 (GLYPH_MODE_LINE_FACE): Now enums, not macros.
3543 * eval.c (Fautoload): Cast XUNTAG output to intptr_t, since
3544 XUNTAG now returns void *.
3545 * lisp.h (lisp_h_XLI, lisp_h_XIL, lisp_h_CHECK_LIST_CONS)
3546 (lisp_h_CHECK_NUMBER CHECK_SYMBOL, lisp_h_CHECK_TYPE)
3547 (lisp_h_CONSP, lisp_h_EQ, lisp_h_FLOATP, lisp_h_INTEGERP)
3548 (lisp_h_MARKERP, lisp_h_MISCP, lisp_h_NILP)
3549 (lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_CONSTANT_P)
3550 (lisp_h_SYMBOL_VAL, lisp_h_SYMBOLP, lisp_h_VECTORLIKEP)
3551 (lisp_h_XCAR, lisp_h_XCDR, lisp_h_XCONS, lisp_h_XHASH)
3552 (lisp_h_XPNTR, lisp_h_XSYMBOL):
3553 New macros, renamed from their sans-lisp_h_ counterparts.
3554 (XLI, XIL, CHECK_LIST_CONS, CHECK_NUMBER CHECK_SYMBOL)
3555 (CHECK_TYPE, CONSP, EQ, FLOATP, INTEGERP, MARKERP)
3556 (MISCP, NILP, SET_SYMBOL_VAL, SYMBOL_CONSTANT_P, SYMBOL_VAL, SYMBOLP)
3557 (VECTORLIKEP, XCAR, XCDR, XCONS, XHASH, XPNTR, XSYMBOL):
3558 If compiling via GCC without optimization, define these as macros
3559 in addition to inline functions.
3560 To disable this, compile with -DINLINING=0.
3561 (LISP_MACRO_DEFUN, LISP_MACRO_DEFUN_VOID): New macros.
3562 (check_cons_list) [!GC_CHECK_CONS_LIST]: Likewise.
3563 (make_number, XFASTINT, XINT, XTYPE, XUNTAG): Likewise, but
3564 hand-optimize only in the USE_LSB_TAG case, as GNUish hosts do that.
3565 (INTMASK, VALMASK): Now macros, since static values cannot be
3566 accessed from extern inline functions.
3567 (VALMASK): Also a constant, for benefit of old GDB.
3568 (LISP_INT_TAG_P): Remove; no longer needed as the only caller
3569 is INTEGERP, which can fold it in.
3570 (XLI, XIL, XHASH, XTYPE, XINT, XFASTINT, XUINT)
3571 (make_number, XPNTR, XUNTAG, EQ, XCONS, XVECTOR, XSTRING, XSYMBOL)
3572 (XFLOAT, XPROCESS, XWINDOW, XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE)
3573 (XSUB_CHAR_TABLE, XBOOL_VECTOR, make_lisp_ptr, CHECK_TYPE)
3574 (CHECK_STRING_OR_BUFFER, XCAR, XCDR, XSETCAR, XSETCDR, CAR, CDR)
3575 (CAR_SAFE, CDR_SAFE, STRING_MULTIBYTE, SDATA, SSDATA, SREF, SSET)
3576 (SCHARS, STRING_BYTES, SBYTES, STRING_SET_CHARS, STRING_COPYIN, AREF)
3577 (ASIZE, ASET, CHAR_TABLE_REF_ASCII, CHAR_TABLE_REF)
3578 (CHAR_TABLE_SET, CHAR_TABLE_EXTRA_SLOTS, SYMBOL_VAL, SYMBOL_ALIAS)
3579 (SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL, SET_SYMBOL_ALIAS)
3580 (SET_SYMBOL_BLV, SET_SYMBOL_FWD, SYMBOL_NAME, SYMBOL_INTERNED_P)
3581 (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P, SYMBOL_CONSTANT_P)
3582 (XHASH_TABLE, HASH_TABLE_P, CHECK_HASH_TABLE, HASH_KEY, HASH_VALUE)
3583 (HASH_NEXT, HASH_HASH, HASH_INDEX, HASH_TABLE_SIZE)
3584 (XMISC, XMISCANY, XMARKER, XOVERLAY, XSAVE_VALUE, XFWDTYPE)
3585 (XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD, XKBOARD_OBJFWD)
3586 (XFLOAT_DATA, XFLOAT_INIT, NILP, NUMBERP, NATNUMP)
3587 (RANGED_INTEGERP, CONSP, FLOATP, MISCP, STRINGP, SYMBOLP)
3588 (INTEGERP, VECTORLIKEP, VECTORP, OVERLAYP)
3589 (MARKERP, SAVE_VALUEP, AUTOLOADP, INTFWDP, BOOLFWDP, OBJFWDP)
3590 (BUFFER_OBJFWDP, KBOARD_OBJFWDP, PSEUDOVECTOR_TYPEP)
3591 (PSEUDOVECTORP, WINDOW_CONFIGURATIONP, PROCESSP, WINDOWP)
3592 (TERMINALP, SUBRP, COMPILEDP, BUFFERP, CHAR_TABLE_P)
3593 (SUB_CHAR_TABLE_P, BOOL_VECTOR_P, FRAMEP, IMAGEP, ARRAYP)
3594 (CHECK_LIST, CHECK_LIST_CONS, CHECK_LIST_END, CHECK_STRING)
3595 (CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
3596 (CHECK_VECTOR, CHECK_VECTOR_OR_STRING, CHECK_ARRAY)
3597 (CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER, CHECK_WINDOW)
3598 (CHECK_WINDOW_CONFIGURATION, CHECK_PROCESS, CHECK_SUBR)
3599 (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, XFLOATINT)
3600 (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT, CHECK_OVERLAY)
3601 (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR, CHECK_NATNUM_CAR)
3602 (CHECK_NATNUM_CDR, FUNCTIONP, SPECPDL_INDEX, LOADHIST_ATTACH)
3603 Now functions.
3604 (check_cons_list) [!GC_CHECK_CONS_LIST]: New empty function.
3605 (LISP_MAKE_RVALUE, TYPEMASK): Remove; no longer needed.
3606 (VALMASK): Define in one place rather than in two, merging the
3607 USE_LSB_TAG parts; this is simpler.
3608 (aref_addr, gc_aset, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM)
3609 (max, min, struct Lisp_String, UNSIGNED_CMP, ASCII_CHAR_P):
3610 Move up, to avoid use before definition.
3611 Also include "globals.h" earlier, for the same reason.
3612 (make_natnum): New function.
3613 (XUNTAG): Now returns void *, not intptr_t, as this means fewer casts.
3614 (union Lisp_Fwd, BOOLFWDP, BOOL_VECTOR_P, BUFFER_OBJFWDP, BUFFERP)
3615 (CHAR_TABLE_P, CHAR_TABLE_REF_ASCII, CONSP, FLOATP, INTEGERP, INTFWDP)
3616 (KBOARD_OBJFWDP, MARKERP, MISCP, NILP, OBJFWDP, OVERLAYP, PROCESSP)
3617 (PSEUDOVECTORP, SAVE_VALUEP, STRINGP, SUB_CHAR_TABLE_P, SUBRP, SYMBOLP)
3618 (VECTORLIKEP, WINDOWP, Qoverlayp, char_table_ref, char_table_set)
3619 (char_table_translate, Qarrayp, Qbufferp, Qbuffer_or_string_p)
3620 (Qchar_table_p, Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp)
3621 (Qnil, Qnumberp, Qsubrp, Qstringp, Qsymbolp, Qvectorp)
3622 (Qvector_or_char_table_p, Qwholenump, Ffboundp, wrong_type_argument)
3623 (initialized, Qhash_table_p, extract_float, Qprocessp, Qwindowp)
3624 (Qwindow_configuration_p, Qimage): New forward declarations.
3625 (XSETFASTINT): Simplify by rewriting in terms of make_natnum.
3626 (STRING_COPYIN): Remove; unused.
3627 (XCAR_AS_LVALUE, XCDR_AS_LVALUE): Remove these macros, replacing with ...
3628 (xcar_addr, xcdr_addr): New functions. All uses changed.
3629 (IEEE_FLOATING_POINT): Now a constant, not a macro.
3630 (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
3631 (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
3632 (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
3633 (GLYPH_CODE_P): Move to dispextern.h, to avoid define-before-use.
3634 (TYPE_RANGED_INTEGERP): Simplify.
3635 (Qsubrp, Qhash_table_p, Qoverlayp): New extern decls.
3636 (setlocale, fixup_locale, synchronize_system_messages_locale)
3637 (synchronize_system_time_locale) [!HAVE_SETLOCALE]:
3638 Now empty functions, not macros.
3639 (functionp): Return bool, not int.
3640 * window.c (Qwindow_configuration_p): Now extern,
3641 so window.h can use it.
3642 * window.h (Qwindowp): Move decl back to lisp.h.
3643
3644 2013-06-15 Eli Zaretskii <eliz@gnu.org>
3645
3646 * xdisp.c (Fline_pixel_height): New function, required for solving
3647 bug #14567.
3648
3649 2013-06-15 Paul Eggert <eggert@cs.ucla.edu>
3650
3651 * fns.c (Fcopy_sequence): Simplify XTYPE calculation.
3652
3653 2013-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
3654
3655 * lread.c (syms_of_lread):
3656 * fns.c (Fprovide): Adjust to new format of after-load-alist.
3657
3658 2013-06-13 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
3659
3660 * fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479)
3661
3662 2013-06-12 Xue Fuqiao <xfq.free@gmail.com>
3663
3664 * fileio.c (expand_file_name): Doc fix.
3665
3666 2013-06-11 Paul Eggert <eggert@cs.ucla.edu>
3667
3668 Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
3669 * process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
3670 Wait for self, not for 0. This can't hurt on GNU or similar
3671 system, and may help with Cygwin.
3672
3673 * keyboard.c: Don't use PROP (...) as an lvalue.
3674 (parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
3675 Use set_prop (A, B), not PROP (A) = B.
3676
3677 2013-06-10 Eli Zaretskii <eliz@gnu.org>
3678
3679 * xdisp.c (get_it_property): Use it->window instead of generating
3680 a Lisp object from it->w.
3681
3682 2013-06-09 Eli Zaretskii <eliz@gnu.org>
3683
3684 * xdisp.c (get_it_property): If it->object is a buffer, pass to
3685 get-char-property the window that is being rendered, instead of
3686 the buffer, to support window-specific overlays. (Bug#14575)
3687 (compute_display_string_pos): When W is NULL, use the current
3688 buffer as the object to pass to get-char-property.
3689 (Fcurrent_bidi_paragraph_direction): Assign NULL to the window
3690 pointer member of the bidi iterator, since no window is pertinent
3691 to this function.
3692
3693 2013-06-08 Eli Zaretskii <eliz@gnu.org>
3694
3695 * bidi.c (bidi_fetch_char): Accept additional argument, the window
3696 being displayed, and pass it to compute_display_string_pos.
3697 (bidi_level_of_next_char, bidi_resolve_explicit_1)
3698 (bidi_paragraph_init): All callers changed.
3699
3700 * xdisp.c (init_from_display_pos, init_iterator)
3701 (handle_single_display_spec, next_overlay_string)
3702 (get_overlay_strings_1, reseat_1, reseat_to_string)
3703 (push_prefix_prop, Fcurrent_bidi_paragraph_direction):
3704 Set bidi_it.w member from it->w.
3705 (compute_display_string_pos): Accept additional argument, the
3706 window being displayed, and pass it to Fget_char_property.
3707 (Bug#14575)
3708
3709 * dispextern.h (struct bidi_it): New member w, the window being
3710 displayed.
3711 (compute_display_string_pos): Adjust prototype.
3712
3713 2013-06-08 Jan Djärv <jan.h.d@swipnet.se>
3714
3715 * xgselect.c: Remove unneeded include xterm.h.
3716
3717 * process.c (wait_reading_process_output): Check for NS before GLIB.
3718 GLIB may be linked in due to rsvg, but ns_select must be called.
3719
3720 * xgselect.c (xg_select): Remove call to window_system_available
3721 and g_main_context_pending at the top, so Gdk events (i.e. file
3722 notify) are processed when Emacs is started with -nw.
3723
3724 2013-06-07 Eli Zaretskii <eliz@gnu.org>
3725
3726 * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
3727 (ctagsfiles3): New variable, includes only *.m files.
3728 (TAGS): Use an explicit language name in the regular expressions,
3729 to avoid transformation of '/SOMETHING' by MSYS to
3730 'c:\MSYS\SOMETHING'.
3731
3732 2013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
3733
3734 * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
3735
3736 2013-06-06 Eli Zaretskii <eliz@gnu.org>
3737
3738 * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
3739 still need to set the mouse pointer shape and activate help-echo.
3740 (Bug#14558)
3741
3742 2013-06-06 Paul Eggert <eggert@cs.ucla.edu>
3743
3744 A few porting etc. fixes for the new file monitor code.
3745 See the thread containing
3746 <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
3747 * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
3748 (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
3749 (dir_monitor_callback, Fgfile_rm_watch):
3750 Use assq_no_quit instead of Fassoc, for speed.
3751 (dir_monitor_callback, Fgfile_rm_watch):
3752 eassert that the monitor is a fixnum.
3753 (dir_monitor_callback): No need for CDR_SAFE.
3754 Simplify building of lisp with alternative tails.
3755 (Fgfile_add_watch, Fgfile_rm_watch):
3756 Do not assume glib functions set errno reliably on failure.
3757 (Fgfile_add_watch): Check that the monitor survives the XIL trick,
3758 and signal an error otherwise.
3759 (Fgfile_rm_watch): Prefer CONSP to !NILP.
3760 Use Fdelq instead of Fdelete, for speed.
3761
3762 2013-06-05 Eli Zaretskii <eliz@gnu.org>
3763
3764 * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
3765 don't insist on being invoked on a highlighted tool-bar button.
3766 Avoids losing tool-bar functionality when mouse-highlight is nil.
3767 (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
3768 Don't highlight when mouse-highlight is nil.
3769 (note_mouse_highlight): When mouse-highlight is nil, don't return
3770 right away; instead, run tool-bar and mode-line highlight
3771 subroutine, clear any existing highlight, and revert the mouse
3772 pointer to its default shape. (Bug#14558)
3773
3774 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
3775
3776 * lisp.mk (lisp): Add prog-mode.el.
3777
3778 2013-06-05 Paul Eggert <eggert@cs.ucla.edu>
3779
3780 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
3781 * process.c (dummy_handler): New function.
3782 (lib_child_handler): New static var.
3783 (handle_child_signal): Invoke it.
3784 (catch_child_signal): If a library has set up a signal handler,
3785 save it into lib_child_handler.
3786 (init_process_emacs): If using glib and not on Windows, tickle glib's
3787 child-handling code so that it initializes its private SIGCHLD handler.
3788 * syssignal.h (SA_SIGINFO): Default to 0.
3789 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
3790 31; it should no longer be needed now.
3791
3792 2013-06-05 Michael Albinus <michael.albinus@gmx.de>
3793
3794 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
3795
3796 * gfilenotify.c (globals_of_gfilenotify): New function.
3797 (syms_of_gfilenotify): Move global initialization there.
3798
3799 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
3800
3801 2013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
3802
3803 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
3804 * keyboard.c (menu_bar_items, tool_bar_items):
3805 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
3806 not override local keymaps any more.
3807
3808 2013-06-04 Eli Zaretskii <eliz@gnu.org>
3809
3810 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
3811
3812 2013-06-03 Eli Zaretskii <eliz@gnu.org>
3813
3814 * w32console.c (initialize_w32_display): Return the dimensions of
3815 the console window via 2 additional arguments, not via the current
3816 frame. This avoids crashes due to overrunning the bounds of
3817 frame's decode_mode_spec_buffer, which is not resized following
3818 the change of the frame dimensions from the initial 10x10.
3819
3820 * w32term.h (w32_initialize_display_info): Adjust prototype.
3821
3822 * term.c (init_tty): Take dimensions of the frame from the values
3823 returned by initialize_w32_display.
3824
3825 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
3826 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
3827 (LIBES): Add $(GFILENOTIFY_LIBS).
3828
3829 * w32inevt.c (handle_file_notifications): Add dummy implementation
3830 for !HAVE_W32NOTIFY.
3831
3832 * w32term.c: Wrap code with HAVE_W32NOTIFY.
3833
3834 2013-06-03 Jan Djärv <jan.h.d@swipnet.se>
3835
3836 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
3837
3838 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
3839
3840 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
3841
3842 2013-06-03 Paul Eggert <eggert@cs.ucla.edu>
3843
3844 Fix minor problems found by static checking.
3845 * data.c (pure_write_error):
3846 Use xsignal2, not Fsignal, as Fsignal might return.
3847 * eval.c (set_backtrace_debug_on_exit): Now static.
3848 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
3849 No longer inline. EXTERN_INLINE is needed only for functions
3850 defined in .h files. Reindent function header as per GNU style.
3851 (backtrace_p, backtrace_top, backtrace_next):
3852 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
3853 compiler or linker. Add extern decls to pacify gcc -Wall.
3854 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
3855 Now static.
3856 * frame.c (free_monitors): Define only on platforms that need it.
3857 * nsterm.m (ns_term_init):
3858 * process.c (catch_child_signal):
3859 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
3860 defined on all porting targets these days.
3861 * process.c, process.h (catch_child_signal):
3862 Make it extern only if NS_IMPL_GNUSTEP is defined.
3863
3864 2013-06-03 Eli Zaretskii <eliz@gnu.org>
3865
3866 * w32.c (gettimeofday): Make the signature identical to prototype
3867 in nt/inc/sys/time.h.
3868
3869 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
3870
3871 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
3872 .gdbinit.
3873
3874 * keyboard.c (safe_run_hooks_error): Improve error message.
3875
3876 * data.c (pure_write_error): Add `object' argument.
3877 * puresize.h (CHECK_IMPURE): Use it.
3878
3879 2013-06-03 Michael Albinus <michael.albinus@gmx.de>
3880
3881 * Makefile.in (NOTIFY_OBJ): New variable.
3882 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
3883
3884 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
3885 Call syms_of_gfilenotify.
3886
3887 * gfilenotify.c: New file.
3888
3889 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
3890 and Qfile_w32notify.
3891 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
3892 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
3893
3894 * lisp.h: Declare syms_of_gfilenotify.
3895
3896 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
3897
3898 2013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
3899
3900 Merge the specpdl and backtrace stacks. Make the structure of the
3901 specpdl entries more obvious via a tagged union of structs.
3902 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
3903 (enum specbind_tag): New enum.
3904 (struct specbinding): Make it a tagged union of structs.
3905 Add a case for backtrace records.
3906 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
3907 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
3908 (backtrace_debug_on_exit): New accessors.
3909 (struct backtrace): Remove.
3910 (struct catchtag): Remove backlist field.
3911 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
3912 Move to eval.c.
3913 (Flocal_variable_p): Speed up the common case where the binding is
3914 already loaded.
3915 * eval.c (backtrace_list): Remove.
3916 (set_specpdl_symbol, set_specpdl_old_value): Remove.
3917 (set_backtrace_args, set_backtrace_nargs)
3918 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
3919 (backtrace_next): New functions.
3920 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
3921 (unwind_to_catch, internal_lisp_condition_case)
3922 (internal_condition_case, internal_condition_case_1)
3923 (internal_condition_case_2, internal_condition_case_n): Don't bother
3924 with backtrace_list any more.
3925 (Fsignal): Adjust to new backtrace format.
3926 (grow_specpdl): Move up.
3927 (record_in_backtrace): New function.
3928 (eval_sub, Ffuncall): Use it.
3929 (apply_lambda): Adjust to new backtrace format.
3930 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
3931 data.c.
3932 (specbind): Adjust to new specpdl format. Simplify.
3933 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
3934 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
3935 backtrace format.
3936 (mark_backtrace): Remove.
3937 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
3938 * xdisp.c (redisplay_internal): Use record_in_backtrace.
3939 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
3940 Use mark_specpdl.
3941 * profiler.c (record_backtrace): Use get_backtrace.
3942 (handle_profiler_signal): Use backtrace_top_function.
3943 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
3944 accessor functions.
3945
3946 2013-06-02 Jan Djärv <jan.h.d@swipnet.se>
3947
3948 * process.h (catch_child_signal): Declare.
3949
3950 * process.c (catch_child_signal): New function.
3951 (init_process_emacs): Call it.
3952
3953 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
3954 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
3955 NS_IMPL_COCOA.
3956 (x_set_cursor_type): Remove declaration.
3957 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
3958 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
3959 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
3960 (ns_get_color): Use F suffix on float.
3961 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
3962 (ns_get_rgb_color): Remove.
3963 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
3964 (note_mouse_movement): x and y are CGFloat.
3965 (ns_draw_fringe_bitmap): Remove unused rowY.
3966 Change #if to COCOA && >= 10_6.
3967 (ns_draw_window_cursor): Remove unused overspill.
3968 (ns_draw_underwave): width and x are EamcsCGFloat.
3969 (ns_draw_box): thickness is CGFloat.
3970 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
3971 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
3972 if not in main thread.
3973 (ns_get_pending_menu_title, ns_check_menu_open)
3974 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
3975 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
3976 (sendFromMainThread:): New method.
3977 (changeFont:): size is CGFloat.
3978 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
3979 Disable warning about permanent text.
3980 (characterIndexForPoint:): Adjust return type depending on GNUStep
3981 version.
3982 (mouseDown:): delta is CGFloat.
3983 (updateFrameSize): Remove unised variable f.
3984 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
3985 Cast float to EmacsCGFloat.
3986 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
3987 also to -1 when restoring.
3988 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
3989 inside NS_IMPL_COCOA.
3990 (toggleFullScreen:): Put call to toggleFullScreen inside
3991 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
3992 (setPosition:portion:whole:): por is CGFloat.
3993 (getMouseMotionPart:window:x:y:): Add F suffix to float.
3994 (mouseDown:): Use CGFloat.
3995 (mouseDragged:): Remove unised variable edge.
3996 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
3997
3998 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
3999 of CGFloat differs.
4000 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
4001 when NS_IMPL_GNUSTEP.
4002 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
4003 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
4004 (EmacsToolbar): Add clearAll. Add tag argument to
4005 addDisplayItemWithImage.
4006 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
4007
4008 * nsselect.m (ns_get_local_selection): Remove unused variable type.
4009
4010 * nsmenu.m (ns_update_menubar): Make static.
4011 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
4012 (fillWithWidgetValue:): Add cast to SEL for setAction.
4013 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
4014 (update_frame_tool_bar): Update code for GNUStep.
4015 (clearAll): New method.
4016 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
4017 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
4018 Move identifierToItem setObject and activeIdentifiers addObject before
4019 call to insertItemWithItemIdentifier.
4020 (validateVisibleItems): Fix indentation.
4021 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
4022 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
4023 UtilityWindow to aStyle, remove call to setStyleMask.
4024
4025 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
4026
4027 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
4028 (ns_charset_covers, ns_get_covering_families, nsfont_open):
4029 Use F suffix on floats.
4030 (ns_char_width): Returns CGFloat.
4031 (ns_ascii_average_width): w is CGFloat instead of float.
4032 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
4033 DPSxshow.
4034 (ns_glyph_metrics): CGFloat instead of float.
4035
4036 * nsfns.m (x_set_foreground_color, x_set_background_color):
4037 Use EmacsCGFloat.
4038 (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
4039 remove unused variables.
4040 (Fns_read_file_name): Keep track if panel is for save.
4041 Use ns_filename_from_panel/ns_directory_from_panel.
4042 (Fns_list_services): delegate only used for COCOA.
4043 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
4044 Just return the input if GNUStep.
4045 (x_screen_planes): Remove.
4046 (Fxw_color_values): Use EmacsCGFloat
4047 (Fns_display_monitor_attributes_list): Only get screen number for
4048 Cocoa.
4049 (getDirectory, getFilename): Remove from EmacsOpenPanel and
4050 EmacsSavePanel.
4051 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
4052 ns_directory_from_panel.
4053
4054 2013-06-01 Paul Eggert <eggert@cs.ucla.edu>
4055
4056 * process.c (handle_child_signal): Also use WCONTINUED.
4057 This is so that list-processes doesn't mistakenly list the process
4058 as stopped, when the process has actually been continued and is
4059 now running.
4060
4061 2013-05-31 Paul Eggert <eggert@cs.ucla.edu>
4062
4063 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
4064 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
4065 not already configured.
4066
4067 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
4068
4069 2013-05-29 Eli Zaretskii <eliz@gnu.org>
4070
4071 * Makefile.in (mostlyclean): Remove *.res files.
4072
4073 2013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
4074
4075 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
4076 a buffer (bug#8447).
4077
4078 2013-05-27 Eli Zaretskii <eliz@gnu.org>
4079
4080 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
4081 display vector, and we backtrack, handle the case that the
4082 previous character position is also displayed from a display
4083 vector or covered by a display string or image. (Bug#14476)
4084
4085 2013-05-25 Jan Djärv <jan.h.d@swipnet.se>
4086
4087 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
4088 (struct MonitorInfo, free_monitors): Remove.
4089 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
4090 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
4091 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
4092 Qframes, Qsource.
4093
4094 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
4095 (struct MonitorInfo, free_monitors): Remove.
4096 (ns_screen_name): Make static.
4097 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
4098 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
4099 Qframes, Qsource.
4100
4101 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
4102 (struct MonitorInfo): New struct.
4103 (free_monitors, make_monitor_attribute_list): Declare.
4104
4105 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
4106 New Lisp_Object:s.
4107 (free_monitors, make_monitor_attribute_list): New functions.
4108 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
4109 Qsource.
4110
4111 2013-05-25 Xue Fuqiao <xfq.free@gmail.com>
4112
4113 * callproc.c (call_process): Refine the doc string. (Bug#14045)
4114
4115 2013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
4116
4117 * keyboard.c: Apply keyboard decoding only to events that come directly
4118 from the tty, not from unread-command-events (bug#14368).
4119 (read_event_from_main_queue): New function, extracted from read_char).
4120 (read_decoded_char): Remove.
4121 (read_decoded_event_from_main_queue): New function to replace it.
4122 (read_char): Use it.
4123 (read_key_sequence): Use read_char rather than read_decoded_char.
4124
4125 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
4126
4127 2013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4128
4129 * casetab.c (init_casetab_once): Fix last change (bug#14424).
4130
4131 2013-05-22 Kenichi Handa <handa@gnu.org>
4132
4133 The following changes are to fix the setting of
4134 buffer-file-coding-system on, for instance, C-x RET c unix RET
4135 _FILE_OF_DOS_EOL_TYPE_ RET.
4136
4137 * coding.h (struct coding_system): New member detected_utf8_chars.
4138
4139 * coding.c (detect_coding_utf_8): Count characters and check EOL
4140 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
4141 BOM is there.
4142 (setup_coding_system): Do not initialize coding->head_ascii.
4143 (check_ascii): Do not set coding->eol_seen but update it. Do not
4144 call adjust_coding_eol_type here.
4145 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
4146 If the eol-type of CODING is already specified, adjust the eol type
4147 of the found coding-system.
4148 (decode_coding_gap): Cancel previous change. Utilize the
4149 character numbers counted by detect_coding_utf_8. Fix detection
4150 of BOM for utf-8.
4151
4152 2013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
4153
4154 * search.c (looking_at_1): Only set last_thing_searched if the match
4155 changed the match-data (bug#14281).
4156
4157 2013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
4158
4159 * xdisp.c (reseat_at_previous_visible_line_start):
4160 Already declared in dispextern.h, so remove it here.
4161 (move_it_vertically_backward): Likewise.
4162
4163 2013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4164
4165 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
4166 (Fx_display_pixel_width, Fx_display_pixel_height)
4167 (Fx_display_mm_width, Fx_display_mm_height):
4168 Mention `display-monitor-attributes-list' in docstrings.
4169
4170 * nsfns.m (ns_get_screen): Remove function. All uses removed.
4171 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
4172 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
4173 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
4174 (Fx_display_backing_store, Fx_display_visual_class)
4175 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
4176 (Fx_display_grayscale_p, Fx_display_pixel_width)
4177 (Fx_display_pixel_height, Fx_display_planes)
4178 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
4179 (Fx_display_screens): Don't confuse X11 screens with NS screens.
4180 (Fx_display_mm_width, Fx_display_mm_height)
4181 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
4182 height for all physical monitors as in X11.
4183
4184 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
4185 Return pixel width or height for all physical monitors as in X11.
4186
4187 2013-05-18 Paul Eggert <eggert@cs.ucla.edu>
4188
4189 Port --enable-gcc-warnings to clang.
4190 * bytecode.c (exec_byte_code):
4191 * regex.c:
4192 Redo diagnostic pragmas to pacify clang, too.
4193 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
4194 * editfns.c (Fencode_time):
4195 * fileio.c (file_accessible_directory_p):
4196 * font.c (font_unparse_xlfd):
4197 Use '&"string"[index]' instead of '"string" + (index)'.
4198 * undo.c (user_error): Remove; unused.
4199
4200 2013-05-16 Eli Zaretskii <eliz@gnu.org>
4201
4202 * insdel.c (insert_1_both): Document the arguments, instead of
4203 referring to insert_1, which no longer exists.
4204
4205 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
4206 some window, increment windows_or_buffers_changed, so that
4207 *Messages* display in that window is updated. (Bug#14408)
4208
4209 * w32.c: Include epaths.h.
4210 (init_environment): Use cmdproxy.exe without leading directories.
4211 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
4212 case.
4213 (gettimeofday): Adjust signature and return value to Posix
4214 expectations.
4215
4216 * unexw32.c (open_output_file): Delete the existing emacs.exe
4217 before creating it, to break the hard link to the versioned
4218 executable.
4219
4220 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
4221 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
4222 (FIRSTFILE_OBJ): New variables.
4223 (W32_RES): Rename to EMACSRES. All users changed.
4224 (base_obj): Use $(CM_OBJ).
4225 (ALLOBJS): Use $(FIRSTFILE_OBJ).
4226 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
4227 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
4228 $(W32_RES_LINK) before $(LIBES).
4229 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
4230
4231 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4232
4233 * makefile.w32-in (DOC): Use just "DOC".
4234
4235 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
4236
4237 * process.c: Export default filters and sentinels to Elisp.
4238 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
4239 New constants.
4240 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
4241 (Fset_process_sentinel, Fformat_network_address):
4242 Default to them instead of nil.
4243 (server_accept_connection): Sentinels can't be nil any more.
4244 (read_and_dispose_of_process_output): New function, extracted from
4245 read_process_output.
4246 (read_process_output): Use it; filters can't be nil.
4247 (Finternal_default_process_filter): New function, extracted from
4248 read_process_output.
4249 (exec_sentinel_unwind): Remove function.
4250 (exec_sentinel): Don't zilch sentinel while running.
4251 (status_notify): Sentinels can't be nil.
4252 (Finternal_default_process_sentinel): New function extracted from
4253 status_notify.
4254 (setup_process_coding_systems): Default filter is not nil any more.
4255 (syms_of_process): Export new Elisp functions and initialize
4256 new constants.
4257 * lisp.h (make_lisp_proc): New function.
4258
4259 2013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
4260
4261 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
4262
4263 2013-05-14 Eli Zaretskii <eliz@gnu.org>
4264
4265 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
4266 unless we know that the window w is a leaf window.
4267 Another attempt at solving bug#14062.
4268
4269 2013-05-14 Jan Djärv <jan.h.d@swipnet.se>
4270
4271 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
4272 fdesc (Bug#14375).
4273
4274 2013-05-12 Paul Eggert <eggert@cs.ucla.edu>
4275
4276 * image.c (gif_load): Check that subimages fit (Bug#14345).
4277
4278 2013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
4279
4280 * lread.c (skip_dyn_eof): New function.
4281 (read1): Use it to skip the end of a file in response to #@00.
4282
4283 * doc.c (get_doc_string): Slightly relax the sanity checking.
4284
4285 2013-05-09 Jan Djärv <jan.h.d@swipnet.se>
4286
4287 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
4288 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
4289 (MonitorInfo): New struct.
4290 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
4291 (Fns_display_monitor_attributes_list): New functions.
4292 (display-usable-bounds): Remove.
4293 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
4294 Qsource.
4295
4296 2013-05-09 Paul Eggert <eggert@cs.ucla.edu>
4297
4298 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
4299 (GTK_CHECK_VERSION): New macro, if not already defined.
4300 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
4301 replaced by GTK_CHECK_VERSION.
4302
4303 2013-05-08 Paul Eggert <eggert@cs.ucla.edu>
4304
4305 * xterm.h (GTK_PREREQ): New macro.
4306 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
4307 to use this macro instead, for consistency and clarity.
4308
4309 2013-05-08 Eli Zaretskii <eliz@gnu.org>
4310
4311 * xdisp.c (row_for_charpos_p): New function, with code of
4312 cursor_row_p, but accepts an additional argument CHARPOS instead
4313 of using a hardcoded PT.
4314 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
4315 (row_containing_pos): Call row_for_charpos_p instead of partially
4316 doing the same. Fixes cursor positioning under longlines-mode
4317 when longlines-show-effect includes more than one newline, when
4318 moving the cursor vertically up.
4319
4320 2013-05-08 Juanma Barranquero <lekktu@gmail.com>
4321
4322 * makefile.w32-in (ACL_H): New macro.
4323 ($(BLD)/fileio.$(O)): Update dependencies.
4324
4325 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
4326
4327 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
4328 * Makefile.in (LIB_ACL): New macro.
4329 (LIBACL_LIBS): Remove.
4330 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
4331 * fileio.c: Include <acl.h>.
4332 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
4333 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
4334 !acl_errno_valid.
4335 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
4336 it ourselves.
4337
4338 * unexelf.c: Don't assume ElfW (Half) fits in int.
4339 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
4340 when dealing with ElfW (Half) values, since they can exceed 2**31
4341 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
4342 (entry_address): Omit unused NUM arg. All uses changed.
4343
4344 2013-05-07 Juri Linkov <juri@jurta.org>
4345
4346 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
4347 to the string converted from number with `Fnumber_to_string'.
4348 (Bug#14254)
4349
4350 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
4351
4352 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
4353 This fixes a problem introduced by my previous change.
4354
4355 2013-05-07 Glenn Morris <rgm@gnu.org>
4356
4357 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
4358
4359 2013-05-07 Jan Djärv <jan.h.d@swipnet.se>
4360
4361 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
4362
4363 2013-05-07 Paul Eggert <eggert@cs.ucla.edu>
4364
4365 Static checking by GCC 4.8.0.
4366 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
4367 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
4368 (x_get_monitor_attributes_fallback)
4369 (x_get_monitor_attributes_xinerama)
4370 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
4371 Define only if USE_GTK.
4372 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
4373 (x_get_monitor_attributes_fallback): Omit unused locals.
4374 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
4375 Use double, not float, to avoid mixed-mode floating point arithmetic.
4376
4377 2013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
4378 Jan Djärv <jan.h.d@swipnet.se>
4379
4380 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
4381 (XINERAMA_CFLAGS): New macros.
4382 (ALL_CFLAGS, LIBES): Use them.
4383
4384 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
4385 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
4386 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
4387 (syms_of_xfns): DEFSYM them.
4388 (struct MonitorInfo): New struct.
4389 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
4390 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
4391 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
4392 (x_get_monitor_attributes_xinerama): New functions.
4393 (Fx_display_monitor_attributes_list): New primitive.
4394 (syms_of_xfns): Defsubr it.
4395
4396 * xterm.h (x_display_info): Add Xatom_net_workarea and
4397 Xatom_net_current_desktop.
4398
4399 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
4400 and dpyinfo->Xatom_net_current_desktop.
4401
4402 2013-05-06 Eli Zaretskii <eliz@gnu.org>
4403
4404 * xdisp.c (pos_visible_p): Use the special code for finding the
4405 beginning of a display property or overlay for any "replacing"
4406 display property, not just for display strings. This solves
4407 incorrect reporting of position by posn-at-point. (Bug#14241)
4408
4409 2013-05-06 Paul Eggert <eggert@cs.ucla.edu>
4410
4411 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
4412 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
4413 Verify that ElfW (Half) fits in int.
4414 (fatal): Use same signature as lisp.h.
4415 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
4416 configure and build with -DUNEXELF_DEBUG without worrying about
4417 other modules that use DEBUG.
4418 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
4419 possibly-wide integers now uses it instead of plain fprintf.
4420 (entry_address): New function, which avoids problems with 32-bit
4421 overflow on 64-bit hosts.
4422 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
4423 (round_up): Don't assume the remainder fits in int.
4424 (find_section): Use bool for boolean. Simplify debug code.
4425 (unexec): Don't assume file sizes fit in int or size_t.
4426 Omit unnecessary trailing newline in 'fatal' format.
4427 Use strerror rather than outputting decimal error number.
4428 Remove unused code when emacs is not defined;
4429 this file relies on Emacs now.
4430 Don't assume e_phnum and e_shnum are positive.
4431
4432 * regex.c: Fix problems when DEBUG is defined.
4433 (extract_number, extract_number_and_incr): Define regardless of
4434 whether DEBUG is defined; that's simpler and makes the code less
4435 likely to go stale in the normal case when DEBUG is not defined.
4436 Return int rather than taking an int * arg. All callers changed.
4437 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
4438 Remove, replacing with ...
4439 (DEBUG_PRINT): New macro. All callers changed.
4440 (DEBUG_COMPILES_ARGUMENTS): New macro.
4441 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
4442 (print_compiled_pattern, print_double_string) [DEBUG]:
4443 Use prototype rather than old-style definition.
4444 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
4445 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
4446 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
4447 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
4448 Don't assume ptrdiff_t, size_t, and long are the same width as int.
4449 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
4450 This matters only when DEBUG is defined.
4451
4452 2013-05-05 Eli Zaretskii <eliz@gnu.org>
4453
4454 * xdisp.c (set_iterator_to_next): Set the
4455 ignore_overlay_strings_at_pos_p flag only if we are _really_
4456 iterating over an overlay string, as indicated by the
4457 current.overlay_string_index member. (Bug#14306)
4458
4459 2013-05-05 Jan Djärv <jan.h.d@swipnet.se>
4460
4461 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
4462 to where it is used, to avoid autorelease issues (Bug#14050).
4463
4464 2013-05-05 Paul Eggert <eggert@cs.ucla.edu>
4465
4466 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
4467 * fileio.c (syms_of_fileio): Implement this.
4468 * filelock.c (create_lock_file): If symbolic links don't work, so
4469 we use a regular file as a lock file, do not fsync the lock file;
4470 it's not needed.
4471
4472 2013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
4473
4474 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
4475 (syms_of_minibuf): Adjust accodingly.
4476 * lread.c (Fread):
4477 * callint.c (Fcall_interactively): Adjust calls accordingly.
4478
4479 2013-05-04 Eli Zaretskii <eliz@gnu.org>
4480
4481 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
4482 w->contents is a buffer before computing everything else.
4483 Use parentheses to disambiguate last part of the condition.
4484
4485 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
4486 assertion violations. (Bug#14062)
4487
4488 2013-05-01 David Reitter <david.reitter@gmail.com>
4489
4490 * nsfns.m (ns_tooltip): Initialize.
4491
4492 2013-04-28 Eli Zaretskii <eliz@gnu.org>
4493
4494 * coding.c (decode_coding_gap): Don't remove the character before
4495 a newline unless it's a CR character. (Bug#14287)
4496
4497 2013-04-28 Dan Nicolaescu <dann@gnu.org>
4498
4499 * dispextern.h (struct face): Move enum face_underline_type
4500 earlier so that bitfields can be in the same word.
4501
4502 2013-04-28 Jan Djärv <jan.h.d@swipnet.se>
4503
4504 * nsfns.m (handlePanelKeys): New function.
4505 (EmacsOpenPanel:performKeyEquivalent:)
4506 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
4507 arrows/function/control and copy/paste keys (Bug#14296).
4508
4509 2013-04-27 Juri Linkov <juri@jurta.org>
4510
4511 * callint.c (Fcall_interactively): Call `Qread_number' for
4512 interactive code letter `n' instead of using duplicate code.
4513 (Bug#14254)
4514
4515 2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
4516
4517 * systime.h (make_timeval): Declare as 'const'.
4518
4519 2013-04-27 Kenichi Handa <handa@gnu.org>
4520
4521 * font.c (font_open_entity): Always open a font of manageable
4522 size.
4523
4524 2013-04-26 Paul Eggert <eggert@cs.ucla.edu>
4525
4526 Port better to AIX (Bug#14258).
4527 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
4528 to pacify AIX xlc.
4529
4530 2013-04-24 Kenichi Handa <handa@gnu.org>
4531
4532 * coding.c (decode_coding_iso_2022): When an invalid escape
4533 sequence is encountered, reset the invocation and designation
4534 status to the safest one.
4535
4536 2013-04-22 Paul Eggert <eggert@cs.ucla.edu>
4537
4538 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
4539 Without this fix, "make distclean" leaves stamp-h1 behind.
4540
4541 2013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
4542
4543 * w32fns.c (w32_fullscreen_rect): New function to compute the
4544 window rectangle for the given fullscreen mode.
4545 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
4546 longer tunes the window size. This keeps the window's edges flush
4547 with the screen and allows the taskbar to hide itself in fullboth.
4548
4549 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
4550 window decorations and uses the entire screen.
4551
4552 * w32term.h (w32_fullscreen_rect) Add prototype.
4553 (struct w32_output): Replace normal_width, normal_height,
4554 normal_top, and normal_left members with a single normal_placement
4555 struct.
4556 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
4557 Remove macros.
4558 (FRAME_NORMAL_PLACEMENT): New macro.
4559
4560 2013-04-16 Juanma Barranquero <lekktu@gmail.com>
4561
4562 * minibuf.c (Ftest_completion): Silence compiler warning.
4563
4564 2013-04-15 Eli Zaretskii <eliz@gnu.org>
4565
4566 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
4567 bug#14062.
4568
4569 * frame.h (WINDOW_FRAME): Protect macro and its argument with
4570 parentheses.
4571
4572 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
4573 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
4574 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
4575 parentheses where appropriate.
4576
4577 2013-04-14 Paul Eggert <eggert@cs.ucla.edu>
4578
4579 * keyboard.c (timer_start_idle): Remove no-longer-used local.
4580
4581 2013-04-14 Eli Zaretskii <eliz@gnu.org>
4582
4583 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
4584 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
4585 Mention in the doc string that setting these variables takes
4586 effect only after a call to set-window-buffer. (Bug#14200)
4587
4588 2013-04-13 Eli Zaretskii <eliz@gnu.org>
4589
4590 * indent.c (Fvertical_motion): Don't consider display strings on
4591 overlay strings as display strings on the buffer position we
4592 started from. This prevents vertical cursor motion from jumping
4593 more than one line when there's an overlay string with a display
4594 property at end of line.
4595 Reported by Karl Chen <Karl.Chen@quarl.org> in
4596 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
4597
4598 2013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
4599
4600 * window.c (select_window): `record_buffer' even if window is
4601 already selected (bug#14191).
4602
4603 2013-04-11 Eli Zaretskii <eliz@gnu.org>
4604
4605 * window.c (Fwindow_end): Test more flags, including the buffer's
4606 last_overlay_modified flag, to determine whether the window's
4607 display is really up-to-date. Prevents the function from
4608 returning a stale value. (Bug#14170)
4609 (Fwindow_line_height): Fix the test for up-to-date-ness of the
4610 current matrix.
4611
4612 2013-04-10 Eli Zaretskii <eliz@gnu.org>
4613
4614 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
4615 garbaged only if it is not already the top frame on its TTY.
4616 This prevents flickering due to constant redrawing of TTY frames when
4617 there are GUI frames open in the same session. (Bug#13864)
4618
4619 2013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
4620
4621 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
4622 of marking the idle timers directly.
4623
4624 2013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
4625
4626 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
4627 tables (bug#14054).
4628
4629 2013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
4630
4631 * window.c (select_window): Don't record_buffer while the invariant is
4632 temporarily broken (bug#14161).
4633
4634 * fns.c (Fdelq): Don't assume !NILP => CONSP.
4635
4636 2013-04-07 Eli Zaretskii <eliz@gnu.org>
4637
4638 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
4639
4640 2013-04-07 Romain Francoise <romain@orebokech.com>
4641
4642 Ignore additional platform-specific ACL errors (Bug#13702).
4643 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
4644 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
4645
4646 2013-03-31 Jan Djärv <jan.h.d@swipnet.se>
4647
4648 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
4649 f->output_data.ns.
4650
4651 2013-04-07 Paul Eggert <eggert@cs.ucla.edu>
4652
4653 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
4654 This bug was introduced by my 2013-02-25 change that simplified
4655 data_start configuration. Without this change, on GNU/Linux
4656 an Emacs configured with --enable-profiling fails immediately
4657 due to a profiler signal.
4658 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
4659 with these flags. On platforms where special flags are needed
4660 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
4661 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
4662 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
4663
4664 2013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
4665
4666 Get rid of some platform-specific functions examining window
4667 system and its capabilities. This is a partial rework of the
4668 2013-04-05 change.
4669 * lisp.h (have_menus_p): Remove prototype. This function is
4670 replaced with platform-independent window_system_available.
4671 (check_window_system): Move to...
4672 * frame.h (decode_window_system_frame, window_system_available):
4673 ...here, add new prototypes.
4674 * frame.c (window_system_available, decode_window_system_frame):
4675 New functions.
4676 (check_window_system): Platform-independent now.
4677 * xterm.h (x_in_use): Remove declaration.
4678 (check_x_frame):
4679 * w32term.h (check_x_frame):
4680 * nsterm.h (check_x_frame): Remove prototypes. This function
4681 is replaced with platform-independent decode_window_system_frame.
4682 * msdos.c (have_menus_p): Remove.
4683 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
4684 Remove platform-specific functions. Use check_window_system,
4685 decode_window_system_frame and check_ns_display_info where
4686 appropriate. Minor style and comment tweaks.
4687 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
4688 (check_x_frame): Likewise.
4689 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
4690 Likewise.
4691 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
4692 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
4693 * xmenu.c, xselect.c: All related users changed.
4694
4695 2013-04-03 Kenichi Handa <handa@gnu.org>
4696
4697 The following changes is to optimize the code for reading UTF-8
4698 files.
4699
4700 * coding.c (check_ascii): Rename from detect_ascii. Return value
4701 changed. Check EOL format. Do not call adjust_coding_eol_type
4702 here.
4703 (check_utf_8): New function.
4704 (adjust_coding_eol_type): Do nothing if already adjusted.
4705 (detect_coding): Compare the return value of check_ascii with
4706 coding->src_bytes. Call adjust_coding_eol_type if necessary.
4707 (decode_coding_gap): Optimize for valid UTF-8.
4708
4709 2013-03-21 Kenichi Handa <handa@gnu.org>
4710
4711 * coding.c (syms_of_coding): Cancel previous change.
4712
4713 * insdel.c (insert_from_gap): Fix previous change.
4714
4715 2013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
4716
4717 Consistently use platform-specific function to detect window system.
4718 * lisp.h (check_window_system): New prototype. This function is
4719 going to replace check_x, check_w32 and check_ns.
4720 (have_menus_p): Mention msdos.c in comment.
4721 * fontset.c (check_window_system_func): Remove. Adjust all users.
4722 * fontset.h (check_window_system_func): Remove prototype.
4723 * nsterm.h (check_ns):
4724 * xterm.h (check_x):
4725 * w32term.h (check_w32): Likewise.
4726 * menu.c (Fx_popup_menu): Use check_window_system.
4727 * msdos.c (check_window_system): Define for MS-DOS.
4728 * nsfns.m (check_window_system): Define for NS. Adjust all users.
4729 * w32fns.c (check_window_system): Likewise for MS-Windows.
4730 * xfns.c (check_window_system): Likewise for X.
4731 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
4732 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
4733
4734 2013-04-02 Paul Eggert <eggert@cs.ucla.edu>
4735
4736 Prefer < to > in range checks such as 0 <= i && i < N.
4737 This makes it easier to visualize quantities on a number line.
4738 This patch doesn't apply to all such range checks,
4739 only to the range checks affected by the 2013-03-24 change.
4740 This patch reverts most of the 2013-03-24 change.
4741 * alloc.c (xpalloc, Fgarbage_collect):
4742 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
4743 * character.c (string_escape_byte8):
4744 * charset.c (read_hex):
4745 * data.c (cons_to_unsigned):
4746 * dispnew.c (update_frame_1):
4747 * doc.c (Fsubstitute_command_keys):
4748 * doprnt.c (doprnt):
4749 * editfns.c (hi_time, decode_time_components):
4750 * fileio.c (file_offset):
4751 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
4752 * font.c (font_intern_prop):
4753 * frame.c (x_set_alpha):
4754 * gtkutil.c (get_utf8_string):
4755 * indent.c (check_display_width):
4756 * keymap.c (Fkey_description):
4757 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
4758 * lread.c (read1):
4759 * minibuf.c (read_minibuf_noninteractive):
4760 * process.c (wait_reading_process_output):
4761 * search.c (Freplace_match):
4762 * window.c (get_phys_cursor_glyph):
4763 * xdisp.c (redisplay_internal):
4764 * xsmfns.c (smc_save_yourself_CB):
4765 Prefer < to > for range checks.
4766 * dispnew.c (sit_for): Don't mishandle NaNs.
4767 This fixes a bug introduced in the 2013-03-24 change.
4768 * editfns.c (decode_time_components): Don't hoist comparison.
4769 This fixes another bug introduced in the 2013-03-24 change.
4770
4771 2013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
4772
4773 * frame.h (struct frame): Drop scroll_bottom_vpos
4774 member becaue all real users are dead long ago.
4775 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
4776 * xdisp.c (redisplay_internal): Adjust user.
4777
4778 2013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
4779
4780 * nsmenu.m (showAtX:Y:for:): setLevel to
4781 NSPopUpMenuWindowLevel (Bug#13998).
4782
4783 2013-03-30 Jan Djärv <jan.h.d@swipnet.se>
4784
4785 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
4786 (ns_check_pending_open_menu): Declare.
4787
4788 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
4789 (x_activate_menubar): Update the menu with title that matches
4790 ns_get_pending_menu_title, and call
4791 ns_check_pending_openmenu (Bug#12698).
4792 (menuWillOpen:): New method.
4793 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
4794
4795 * nsterm.m (menu_will_open_state, menu_mouse_point)
4796 (menu_pending_title): New varaibles.
4797 (ns_get_pending_menu_title, ns_check_menu_open)
4798 (ns_check_pending_open_menu): New functions.
4799
4800 2013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
4801
4802 * indent.c (current_column_bol_cache): Remove leftover which is not
4803 used in Fmove_to_column any more.
4804 (current_column, scan_for_column): Adjust users.
4805 * keyboard.c (last_point_position_buffer, last_point_position_window):
4806 Remove leftovers which are not used for recording undo any more.
4807 (command_loop_1, syms_of_keyboard): Adjust users.
4808 * xdisp.c (last_max_ascent): Remove leftover which is not used in
4809 redisplay_window any more.
4810 (move_it_to): Adjust user.
4811
4812 2013-03-29 Juanma Barranquero <lekktu@gmail.com>
4813
4814 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
4815 Update dependencies.
4816
4817 2013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
4818
4819 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
4820 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
4821 forward references.
4822
4823 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
4824
4825 * window.h (struct window): Replace hchild, vchild and buffer slots
4826 with the only contents slot. This is possible because each valid
4827 window may have either the child window (in vertical or horizontal
4828 combination) or buffer to display (for the leaf window). Using that,
4829 a lof of operations to traverse and/or change window hierarchies may
4830 be simplified. New member horizontal is used to distinguish between
4831 horizontal and vertical combinations of internal windows.
4832 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
4833 (WINDOW_VERTICAL_COMBINATION_P): New macros.
4834 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
4835 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
4836 Use contents slot, not buffer, where appropriate.
4837 (wset_combination): New function.
4838 (wset_buffer): Add eassert.
4839 (Fframe_first_window): Simplify the loop reaching first window.
4840 (Fwindow_buffer): Use WINDOW_LEAF_P.
4841 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
4842 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
4843 (unshow_buffer): Convert initial debugging check to eassert.
4844 (replace_window, recombine_windows, Fdelete_other_windows_internal)
4845 (make_parent_window, window_resize_check, window_resize_apply)
4846 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
4847 (Fset_window_configuration, delete_all_child_windows, save_window_save):
4848 Adjust to match struct window changes.
4849 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
4850 (mark_window_cursors_off, count_windows, get_leaf_windows)
4851 (foreach_window_1): Simplify the loop.
4852 * alloc.c (mark_object): Do not check for the leaf window because
4853 internal windows has no glyph matrices anyway.
4854 * dispnew.c (clear_window_matrices, showing_window_margins_p)
4855 (allocate_matrices_for_window_redisplay, fake_current_matrices)
4856 (allocate_matrices_for_frame_redisplay, free_window_matrices)
4857 (build_frame_matrix_from_window_tree, mirror_make_current)
4858 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
4859 (update_window_tree, set_window_update_flags): Simplify the loop.
4860 (sync_window_with_frame_matrix_rows): Enforce live window.
4861 Use contents slot, not buffer, where appropriate.
4862 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
4863 and WINDOW_HORIZONTAL_COMBINATION_P.
4864 (make_frame_visible_1): Simplify the loop.
4865 Use contents slot, not buffer, where appropriate.
4866 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
4867 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
4868 (expose_window_tree): Likewise.
4869 Use contents slot, not buffer, where appropriate.
4870 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
4871 to avoid deleted windows. Use contents slot instead of buffer.
4872 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
4873 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
4874 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
4875 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
4876
4877 2013-03-28 Eli Zaretskii <eliz@gnu.org>
4878
4879 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
4880 identify the reasons for assertion violations in bug#14062 and
4881 similar ones.
4882 (Fx_show_tip): Fix compilation error under
4883 "--enable-check-lisp-object-type". (Bug#14073)
4884
4885 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
4886 Reported by <rzl24ozi@gmail.com>.
4887
4888 2013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
4889
4890 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
4891 start marker...
4892 (unwind_with_echo_area_buffer): ...to restore it here.
4893 This is needed to ensure that...
4894 (redisplay_window): ...both window markers are valid here,
4895 which is verified by eassert.
4896 * editfns.c (save_excursion_save): Do not assume that
4897 selected_window always displays the buffer.
4898 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
4899 Fix comment.
4900
4901 2013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
4902
4903 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
4904 the upcase table.
4905
4906 2013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
4907
4908 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
4909
4910 2013-03-27 Eli Zaretskii <eliz@gnu.org>
4911
4912 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
4913 since MinGW's w32api headers do. This avoids compiler warnings.
4914
4915 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
4916 if already defined.
4917
4918 2013-03-26 Eli Zaretskii <eliz@gnu.org>
4919
4920 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
4921
4922 2013-03-26 Jan Djärv <jan.h.d@swipnet.se>
4923
4924 * gtkutil.c (style_changed_cb): Check if frame is live and an
4925 X frame (Bug#14038).
4926
4927 2013-03-26 Eli Zaretskii <eliz@gnu.org>
4928
4929 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
4930 Define only for _WIN32_WINNT less than 0x0500.
4931 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
4932 MinGW64.
4933 Move inclusion of time.h before sys/time.h, so that MinGW64 could
4934 see its own definitions of 'struct timeval' and 'struct timezone'.
4935
4936 Fix incompatibilities between MinGW.org and MinGW64 headers.
4937 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
4938
4939 * w32.c (REPARSE_DATA_BUFFER): Guard with
4940 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
4941
4942 2013-03-25 Jan Djärv <jan.h.d@swipnet.se>
4943
4944 * xterm.c: Include X11/XKBlib.h
4945 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
4946
4947 2013-03-24 Andreas Schwab <schwab@linux-m68k.org>
4948
4949 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
4950 written backwards.
4951 * blockinput.h (input_blocked_p): Likewise.
4952 * bytecode.c (exec_byte_code): Likewise.
4953 * callproc.c (call_process_kill, call_process_cleanup)
4954 (Fcall_process): Likewise.
4955 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
4956 (Fccl_execute_on_string): Likewise.
4957 * character.c (string_escape_byte8): Likewise.
4958 * charset.c (read_hex): Likewise.
4959 * cm.c (calccost): Likewise.
4960 * data.c (cons_to_unsigned): Likewise.
4961 * dired.c (directory_files_internal, file_name_completion):
4962 Likewise.
4963 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
4964 (sit_for): Likewise.
4965 * doc.c (Fsubstitute_command_keys): Likewise.
4966 * doprnt.c (doprnt): Likewise.
4967 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
4968 * emacsgtkfixed.c: Likewise.
4969 * fileio.c (file_offset, Fwrite_region): Likewise.
4970 * floatfns.c (Fexpt, fmod_float): Likewise.
4971 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
4972 Likewise.
4973 * font.c (font_intern_prop): Likewise.
4974 * frame.c (x_set_alpha): Likewise.
4975 * gtkutil.c (get_utf8_string): Likewise.
4976 * indent.c (check_display_width): Likewise.
4977 * intervals.c (create_root_interval, rotate_right, rotate_left)
4978 (split_interval_right, split_interval_left)
4979 (adjust_intervals_for_insertion, delete_node)
4980 (interval_deletion_adjustment, adjust_intervals_for_deletion)
4981 (merge_interval_right, merge_interval_left, copy_intervals)
4982 (set_intervals_multibyte_1): Likewise.
4983 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
4984 * keymap.c (Fkey_description): Likewise.
4985 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
4986 * lread.c (openp, read_integer, read1, string_to_number):
4987 Likewise.
4988 * menu.c (ensure_menu_items): Likewise.
4989 * minibuf.c (read_minibuf_noninteractive): Likewise.
4990 * print.c (printchar, strout): Likewise.
4991 * process.c (create_process, Faccept_process_output)
4992 (wait_reading_process_output, read_process_output, send_process)
4993 (wait_reading_process_output): Likewise.
4994 * profiler.c (make_log, handle_profiler_signal): Likewise.
4995 * regex.c (re_exec): Likewise.
4996 * regex.h: Likewise.
4997 * search.c (looking_at_1, Freplace_match): Likewise.
4998 * sysdep.c (get_child_status, procfs_ttyname)
4999 (procfs_get_total_memory): Likewise.
5000 * systime.h (EMACS_TIME_VALID_P): Likewise.
5001 * term.c (dissociate_if_controlling_tty): Likewise.
5002 * window.c (get_phys_cursor_glyph): Likewise.
5003 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
5004 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
5005 Likewise.
5006 * xfns.c (Fx_window_property): Likewise.
5007 * xmenu.c (set_frame_menubar): Likewise.
5008 * xselect.c (x_get_window_property, x_handle_dnd_message):
5009 Likewise.
5010 * xsmfns.c (smc_save_yourself_CB): Likewise.
5011 * xterm.c (x_scroll_bar_set_handle): Likewise.
5012
5013 2013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
5014
5015 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
5016 to be optional or nil. Adjust comment and convert it to docstring.
5017 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
5018 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
5019
5020 2013-03-24 Paul Eggert <eggert@cs.ucla.edu>
5021
5022 Static checking by GCC 4.8-20130319.
5023 * image.c (gif_load): Assume pass < 3 to pacify GCC.
5024 * process.c (Fset_process_datagram_address)
5025 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
5026 * xdisp.c (get_char_face_and_encoding):
5027 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
5028 (get_glyph_face_and_encoding): Prepare face before possibly using it.
5029 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
5030
5031 2013-03-24 Ken Brown <kbrown@cornell.edu>
5032
5033 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
5034 fix compilation on 64-bit Cygwin, where underscores are not
5035 automatically prepended.
5036
5037 * w32term.c (w32_initialize): Silence compiler warning.
5038
5039 2013-03-23 Eli Zaretskii <eliz@gnu.org>
5040
5041 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
5042 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
5043 variables, to save and restore frame dimensions.
5044 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
5045 after returning from a 'fullscreen' configuration.
5046 use SendMessage instead of PostMessage to send the SC_RESTORE message,
5047 to avoid races between the main thread and the input thread.
5048
5049 * w32term.h (struct w32_output): New members normal_width,
5050 normal_height, normal_top, normal_left, and prev_fsmode.
5051 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
5052 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
5053 members of a frame.
5054
5055 * w32term.c (w32fullscreen_hook): Record last value of the frame's
5056 'fullscreen' parameter. Always record previous width and height
5057 of the frame, except when switching out of maximized modes, so
5058 that they could be restored correctly, instead of resetting to the
5059 default frame dimensions. Send SC_RESTORE command to the frame,
5060 unless we are going to send SC_MAXIMIZE, to restore the frame
5061 resize hints in the mouse pointer shown by the window manager.
5062 (Bug#14032)
5063
5064 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
5065
5066 * lisp.h (get_frame_param): Adjust conditions for prototype
5067 declaration.
5068
5069 2013-03-22 Ken Brown <kbrown@cornell.edu>
5070
5071 * unexcw.c: Drop unneeded inclusion of w32common.h.
5072 (report_sheap_usage): Declare.
5073 (read_exe_header): Add magic numbers for x86_64.
5074 (fixup_executable): Fix printf format specifier for unsigned long
5075 argument.
5076
5077 2013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
5078
5079 * frame.h (struct frame): Put menu_bar_window under #ifdef
5080 because this member is not needed when X toolkit is in use.
5081 (fset_menu_bar_window):
5082 * dispnew.c (clear_current_matrices, clear_desired_matrices)
5083 (free_glyphs, update_frame):
5084 * xdisp.c (expose_frame): Likewise.
5085 (display_menu_bar): Likewise. Remove redundant eassert.
5086 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
5087 toolkit is in use.
5088
5089 2013-03-21 Paul Eggert <eggert@cs.ucla.edu>
5090
5091 Use functions and constants to manipulate Lisp_Save_Value objects.
5092 This replaces code that used macros and strings and token-pasting.
5093 The change makes the C source a bit easier to follow,
5094 and shrinks the Emacs executable a bit.
5095 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
5096 (make_save_value): Change 1st arg from string to enum. All callers
5097 changed.
5098 (INTX): Remove.
5099 (mark_object): Use if, not #if, for GC_MARK_STACK.
5100 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
5101 (XSAVE_OBJECT): Now functions, not macros.
5102 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
5103 the constant was never used.
5104 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
5105 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
5106 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
5107 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
5108 New constants.
5109 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
5110 type3 with a single member save_type. All uses changed.
5111 (save_type, set_save_pointer, set_save_integer): New functions.
5112 * print.c (PRINTX): Remove.
5113
5114 * alloc.c: Remove redundant static declarations.
5115
5116 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
5117
5118 * window.h (struct window): Convert left_col, top_line, total_lines
5119 and total_cols from Lisp_Objects to integers. Adjust comments.
5120 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
5121 Remove.
5122 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
5123 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
5124 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
5125 Adjust users where appropriate.
5126
5127 2013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
5128
5129 * frame.h (struct frame): Drop resx and resy because the same data is
5130 available from window system-specific output context. Adjust users.
5131 (default_pixels_per_inch_x, default_pixels_per_inch_y):
5132 New functions to provide defaults when no window system available.
5133 (FRAME_RES_X, FRAME_RES_Y): New macros.
5134 (NUMVAL): Move from xdisp.c.
5135 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
5136 (Ffont_face_attributes, Fopen_font):
5137 * image.c (gs_load):
5138 * w32font.c (fill_in_logfont):
5139 * xdisp.c (calc_pixel_width_or_height):
5140 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
5141 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
5142
5143 2013-03-20 Kenichi Handa <handa@gnu.org>
5144
5145 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
5146 to 1 (temporary workaround until a bug related to ASCII
5147 optimization is fixed).
5148
5149 2013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
5150
5151 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
5152 Signal error if window is not internal. Adjust docstring.
5153 (delete_all_child_windows): Use combination_limit to save the buffer.
5154 (Fset_window_configuration): Adjust accordingly.
5155 * print.c (syms_of_print): Initialize debugging output not here...
5156 (init_print_once): ...but in a new function here.
5157 * lisp.h (init_print_once): Add prototype.
5158 * emacs.c (main): Add call to init_print_once. Adjust comments.
5159
5160 2013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
5161
5162 * window.c (window_resize_check, window_resize_apply)
5163 (window_from_coordinates, recombine_windows, set_window_buffer)
5164 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
5165 (Fsplit_window_internal, Fdelete_window_internal)
5166 (freeze_window_starts): Use bool for booleans.
5167 * window.h (window_frame_coordinates, resize_frame_windows)
5168 (freeze_window_starts, set_window_buffer): Adjust prototypes.
5169
5170 2013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
5171
5172 * dispnew.c (bitch_at_user): Use `user-error'.
5173
5174 2013-03-17 Ken Brown <kbrown@cornell.edu>
5175
5176 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
5177 as return type of image_background. (Bug#13981)
5178 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
5179
5180 2013-03-16 Jan Djärv <jan.h.d@swipnet.se>
5181
5182 * nsterm.m (updateFrameSize:): Change resize increments if needed.
5183 (ns_select): Don't return with result uninitialized.
5184
5185 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
5186 and getDirectory.
5187
5188 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
5189 New functions.
5190 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
5191 directories. If filename is nil, get directory name (Bug#13932).
5192 Use getFilename and getDirectory.
5193 (getFilename, getDirectory): New methods for EmacsSavePanel and
5194 EmacsOpenPanel.
5195 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
5196
5197 2013-03-15 Paul Eggert <eggert@cs.ucla.edu>
5198
5199 * coding.c (decode_coding_gap): Fix typo caught by static checking.
5200
5201 2013-03-15 Kenichi Handa <handa@gnu.org>
5202
5203 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
5204 (adjust_after_replace): Make it back to static. Delete the third
5205 arg text_at_gap_tail. Cancel the code for handling it.
5206
5207 * coding.h (struct coding_system): New member eol_seen.
5208
5209 * coding.c (detect_ascii): New function.
5210 (detect_coding): Set coding->head_ascii and coding->eol_seen only
5211 when the source bytes are actually scanned. On detecting for
5212 coding_category_utf_8_auto, call detect_ascii instead of scanning
5213 source bytes directly.
5214 (produce_chars): Call insert_from_gap with the new arg 0.
5215 (encode_coding): Likewise.
5216 (decode_coding_gap): Control ASCII optimization by the variable
5217 disable_ascii_optimization instead of #ifndef .. #endif.
5218 Deccode EOL format according to coding->eol_seen.
5219 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
5220 variable.
5221
5222 * lisp.h (adjust_after_replace): Cancel externing it.
5223 (insert_from_gap): Adjust prototype.
5224
5225 2013-03-15 Eli Zaretskii <eliz@gnu.org>
5226
5227 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
5228 FULLSCREEN_MAXIMIZED. (Bug#13935)
5229
5230 2013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
5231
5232 * region-cache.c (find_cache_boundary, move_cache_gap)
5233 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
5234 Simplify debugging check and convert to eassert. Adjust comment.
5235 (pp_cache): Put under ENABLE_CHECKING.
5236
5237 2013-03-14 Eli Zaretskii <eliz@gnu.org>
5238
5239 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
5240 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
5241 and WM_ACTIVATEAPP.
5242 (w32fullscreen_hook): If the frame is visible, reset
5243 f->want_fullscreen flag after changing the frame size. If the
5244 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
5245 (Bug#13953)
5246
5247 2013-03-13 Daniel Colascione <dancol@dancol.org>
5248
5249 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
5250 too so that these builds can use Cygwin's file conversion
5251 functions. (We've been building and linking cygw32.o all along
5252 and just not using it.)
5253
5254 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
5255
5256 File synchronization fixes (Bug#13944).
5257 * Makefile.in (LIB_FDATASYNC): New macro.
5258 (LIBES): Use it.
5259 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
5260 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
5261 Don't worry about HAVE_FSYNC, since a substitute fsync is
5262 available if the system lacks one.
5263 (Fwrite_regin): Retry fsync if interrupted.
5264
5265 2013-03-13 Eli Zaretskii <eliz@gnu.org>
5266
5267 * w32term.c (w32_read_socket): If the Emacs frame is being
5268 activated, call w32fullscreen_hook, to make sure the new frame
5269 dimensions are in effect. (Bug#13937)
5270
5271 2013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
5272
5273 * xdisp.c (init_iterator): Simplify because both character and byte
5274 positions are either specified or -1. Add eassert. Adjust comment.
5275 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
5276 character and byte positions can be obtained from marker.
5277
5278 2013-03-13 Paul Eggert <eggert@cs.ucla.edu>
5279
5280 Static checking by Sun C 5.12.
5281 * alloc.c (buffer_memory_full) [REL_ALLOC]:
5282 * bytecode.c (exec_byte_code):
5283 * dispnew.c (init_display):
5284 * eval.c (error):
5285 * fileio.c (Fsubstitute_in_file_name):
5286 * keyboard.c (Fevent_convert_list):
5287 * keymap.c (Fsingle_key_description):
5288 * term.c (maybe_fatal, fatal):
5289 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
5290 * xsmfns.c (Fhandle_save_session):
5291 Omit unreachable code.
5292 * keymap.c (map_keymap_char_table_item): Cast void * to
5293 a function pointer type; the C Standard requires this.
5294
5295 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
5296 Include <sys/param.h> unconditionally, as that works elsewhere and
5297 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
5298 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
5299 and FreeBSD now.
5300
5301 See ChangeLog.12 for earlier changes.
5302
5303 ;; Local Variables:
5304 ;; coding: utf-8
5305 ;; End:
5306
5307 Copyright (C) 2011-2013 Free Software Foundation, Inc.
5308
5309 This file is part of GNU Emacs.
5310
5311 GNU Emacs is free software: you can redistribute it and/or modify
5312 it under the terms of the GNU General Public License as published by
5313 the Free Software Foundation, either version 3 of the License, or
5314 (at your option) any later version.
5315
5316 GNU Emacs is distributed in the hope that it will be useful,
5317 but WITHOUT ANY WARRANTY; without even the implied warranty of
5318 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
5319 GNU General Public License for more details.
5320
5321 You should have received a copy of the GNU General Public License
5322 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.