* window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
c8ae93b0
DA
12013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
2
3 * window.h (WINDOW_FRINGE_EXTENDED_P): New macro.
4 * nsterm.m (ns_set_vertical_scroll_bar): Use it. Use convenient
5 bool instead of BOOL.
6 * w32term.h (struct scroll_bar): Convert fringe_extended_p
7 from Lisp_Object to bitfield. Adjust comment.
8 * w32term.c (x_scroll_bar_create): Adjust user.
9 Use WINDOW_FRINGE_EXTENDED_P and bool for boolean.
10 * xterm.c (XTset_vertical_scroll_bar): Likewise.
11 Use bool for boolean.
12 * xterm.h (struct scroll_bar): Prefer commonly used `unsigned'
13 to `unsigned int' when defining a bitfield.
14
53b64418
PE
152013-08-13 Paul Eggert <eggert@cs.ucla.edu>
16
17 * decompress.c (Fzlib_decompress_region): Try to clarify 'avail_out'.
18
eeaf9bf3
DA
192013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
20
21 * window.h (struct window): Convert left_margin_cols and
22 right_margin_cols from Lisp_Objects to integers. Adjust comment.
23 (WINDOW_LEFT_MARGIN_COLS, WINDOW_RIGHT_MARGIN_COLS)
24 (WINDOW_LEFT_MARGIN_WIDTH, WINDOW_RIGHT_MARGIN_WIDTH):
25 Adjust users.
26 * dispnew.c (margin_glyphs_to_reserve): Convert 3rd arg to int.
27 Adjust comment.
28 (showing_window_margins_p, update_window_line, update_frame_1):
29 * fringe.c (draw_fringe_bitmap_1):
30 * xdisp.c (window_box_width): Adjust users.
31 * window.c (wset_left_margin_cols, wset_right_margin_cols): Remove.
32 (adjust_window_margins, set_window_buffer, Fsplit_window_internal):
33 Use direct assignment.
34 (Fset_window_configuration, save_window_save, Fwindow_margins):
35 Convert Lisp_Object to integer and back where appropriate.
36 (Fset_window_margins): Adjust user. Return t if any margin
37 was actually changed, and mention this in docstring.
38
956720af
XF
392013-08-13 Xue Fuqiao <xfq.free@gmail.com>
40
f73f4ce6 41 * syntax.c (forward_word):
956720af
XF
42 * cmds.c (forward_char, backward_char): Mention the optional argument.
43
9e37ee3b
DA
442013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
45
46 * window.h (struct window): Convert left_fringe_width
47 and right_fringe_width from Lisp_Objects to integers.
48 Adjust comment.
49 (WINDOW_FRINGE_COLS, WINDOW_LEFT_FRINGE_WIDTH)
50 (WINDOW_RIGHT_FRINGE_WIDTH): Adjust users.
51 * window.c (wset_left_fringe_width, wset_right_fringe_width):
52 Remove.
53 (make_window): Initialize new integer fields to -1.
54 (Fsplit_window_internal): Use direct assignment.
55 (Fset_window_configuration, save_window_save): Convert
56 Lisp_Object to integer and back where appropriate.
57 (Fset_window_fringes): Adjust user. Return t if any fringe
58 was actually changed, and mention this in docstring.
59
e4375ca7
DA
602013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
61
62 * keyboard.c (Fdiscard_input): Do not increment update_mode_lines.
9cda66e4
DA
63 * nsfns.m (x_set_cursor_type):
64 * w32fns.c (x_set_cursor_type):
65 * xfns.m (x_set_cursor_type): Do not set cursor_type_changed here...
66 * xdisp.c (set_frame_cursor_types): ...but in common code.
e4375ca7 67
a45543bc
DA
682013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
69
70 * font.c (clear_font_cache): New function, stripped from...
71 (Fclear_font_cache): ...here, which now uses the function
72 above. Adjust comment.
73 * font.h (clear_font_cache): Add prototype.
74 * xfaces.c (clear_face_cache): Use clear_font_cache.
75
ae966a86
DA
762013-08-13 Dmitry Antipov <dmantipov@yandex.ru>
77
78 * window.c (Fset_window_start): Compare `w', not `window' because
79 `w' might not be equal to `window' after call to decode_live_window.
80
297a545b
PE
812013-08-12 Paul Eggert <eggert@cs.ucla.edu>
82
83 * process.c (deactivate_process): Reset fds to -1 (Bug#15035).
84 This fixes a problem introduced by the Bug#15035 patch
85 when using GPG. Reported by Herbert J. Skuhra.
86
aa942e2b
EZ
872013-08-12 Eli Zaretskii <eliz@gnu.org>
88
89 * decompress.c <zlib_initialized> [WINDOWSNT]: New static variable.
90 (Fzlib_decompress_region) [WINDOWSNT]: Call init_zlib_functions if
91 not yet initialized.
92
7699d09e
LMI
932013-08-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
94
95 * decompress.c (Fzlib_decompress_region): Support zlib
96 decompression, too, and rename.
97
1d238bc7
PE
982013-08-12 Paul Eggert <eggert@cs.ucla.edu>
99
100 Minor zlib configuration tweaks.
101 * decompress.c (fn_inflateInit2) [!WINDOWSNT]:
102 Don't assume presence of fn_inflateInit2_ zlib internal function.
103
8a44a184
LMI
1042013-08-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
105
106 * decompress.c (Fzlib_decompress_gzipped_region): Rename to
107 include the zlib prefix.
108
594a4307
EZ
1092013-08-12 Eli Zaretskii <eliz@gnu.org>
110
111 * decompress.c [WINDOWSNT]: Include windows.h and w32.h.
112 (DEF_ZLIB_FN, LOAD_ZLIB_FN) [WINDOWSNT]: New macros. Use them to
113 define static variables that are pointers to zlib functions to be
114 dynamically loaded.
115 (init_zlib_functions) [WINDOWSNT]: New function.
116 (fn_inflateInit2_, fn_inflate, fn_inflateEnd, fn_inflateInit2):
117 New macros.
118 (Fdecompress_gzipped_region, unwind_decompress): Use the fn_*
119 macros instead of invoking the zlib functions directly.
120 (syms_of_decompress): DEFSYM Qzlib_dll. Staticpro
121 Szlib_available_p.
122
d2e113bc
DA
1232013-08-12 Dmitry Antipov <dmantipov@yandex.ru>
124
125 Avoid looping over all frame windows to freeze and unfreeze.
126 * window.h (struct window): Drop frozen_window_start_p.
127 (freeze_window_starts): Drop prototype.
128 * frame.h (struct frame): New frozen_window_starts flag.
129 (FRAME_WINDOWS_FROZEN): New macro.
130 * window.c (freeze_window_start, freeze_window_starts):
131 Remove.
132 (select_window, replace_window): Adjust users.
133 * xdisp.c (resize_mini_window): Use FRAME_WINDOWS_FROZEN.
134 (window_frozen_p): New function.
135 (redisplay_window): Use it.
136
94fcd171
PE
1372013-08-12 Paul Eggert <eggert@cs.ucla.edu>
138
139 Fix some fd issues when running subprocesses (Bug#15035).
140 Fix bugs that can leak files or file descriptors on errors.
141 Don't unlink open temp files, as that's hard for users to diagnose
142 when things go awry (e.g., temp disk exhausted).
143 Don't bother to lock temp files. Check for invalid recursion.
144 * callproc.c (synch_process_fd): Remove. All uses removed.
145 (synch_process_tempfile): New var or macro.
146 (CALLPROC_STDOUT, CALLPROC_STDERR, CALLPROC_PIPEREAD, CALLPROC_FDS):
147 New constants.
148 (record_kill_process): New arg, the temp name. All callers changed.
149 (delete_temp_file): Now just a simple wrapper around unlink.
150 (call_process_kill): New arg, the call_process_fd array.
151 Close them all. Clear synch_process_pid. Remove the temp file,
152 or arrange for it to be removed.
153 (call_process_cleanup) [MSDOS]: Arg no longer contains file name;
154 that's been moved to synch_process_tempfile. Caller changed.
155 Do not remove the tempfile; that's now call_process_kill's
156 responsibility.
157 (call_process_cleanup) [!MSDOS]: Do not record unwind-protect for
158 call_process_kill; the caller now does that.
159 (call_process_cleanup): Do not close the process fd; that's now
160 call_process_kill's responsibility.
161 (Fcall_process): Implement via new function call_process, which
162 has most of the old body of Fcall_process, but with a different API.
163 (call_process): New function that does not open or close filefd if
164 it is nonnegative. Record which fds need to be closed, and let
165 call_process_kill close (and remove the tempfile, on MSDOS) on error.
166 Signal an error if invoked recursively (could be done via a hook).
167 Simplify creation of the tempfile in the MSDOS case.
168 Don't create the output file until after checking for the executable.
169 Report any failure to open /dev/null.
170 Don't open /dev/null for writing twice; once is enough.
171 Don't create pipe if all output is being discarded or sent to file.
172 Don't worry about setting up the coding system or reading from the
173 pipe if all output is being discarded.
174 Hoist fd_error local into top level, to lessen block nesting.
175 Don't record deleted pid here; now done by Fcall_process_region.
176 (Fcall_process) [MSDOS]: Report mktemp failure immediately,
177 and note its success in synch_process_tempfile.
178 Do not leak resources when child_setup fails.
179 (Fcall_process) [!MSDOS && !WINDOWSNT]: Remove duplicate assignment
180 to child_errno. Remove unnecessary close of fd0; it's close-on-exec.
181 (create_temp_file): Now returns open fd, with an additional
182 Lisp_Object * argument to return the name. All callers changed.
183 Do not close the file; rewind it instead, and leave it open for
184 the caller. Do not lock the temp file. Unwind-protect the file
185 and the file-descriptor.
186 (Fcall_process_region): If the input is /dev/null, unwind-protect it.
187 If an asynchrounous process, record it here, not in call_process.
188 (syms_of_callproc) [MSDOS]: Initialize synch_process_tempfile.
189 * eval.c (set_unwind_protect): New function.
190 * fileio.c (write_region): New function, generalized from the
191 old Fwrite_region. Do not lock temp files.
192 (Fwrite_region): Use it.
193 * lisp.h (set_unwind_protect, write_region): New decls.
194 * process.c: Include <verify.h>.
195 (make_process): Mark fds as initially closed.
196 (deleted_pid_list): Now a list of pid-filename pairs.
197 All uses changed.
198 (close_process_fd): New function.
199 (SUBPROCESS_STDIN, WRITE_TO_SUBPROCESS, READ_FROM_SUBPROCESS)
200 (SUBPROCESS_STDOUT, READ_FROM_EXEC_MONITOR, EXEC_MONITOR_OUTPUT):
201 New constants. Verify that their number matches PROCESS_OPEN_FDS.
202 (create_process, create_pty, Fmake_serial_process)
203 (server_accept_connection): Record which fds need to be closed,
204 and let deactivate_process close them.
205 (Fmake_network_process): Do not discard the unwind-protect
206 until it's safe to do so.
207 (deactivate_process): Close the fds opened by create_process etc.
208 (Fprocess_send_eof): Adjust to new way of recording open fds.
209 Report an error if /dev/null can't be opened, instead of aborting.
210 * process.h (PROCESS_OPEN_FDS): New constant.
211 (struct Lisp_Process): New member open_fds.
212 (record_kill_process, record_deleted_pid): Adjust signatures.
213 (record_deleted_pid): Move decl here ...
214 * syswait.h (record_deleted_pid): ... from here.
215
d0e615c3
PE
2162013-08-11 Paul Eggert <eggert@cs.ucla.edu>
217
218 * decompress.c: Fix bugs with large buffers and weird inputs.
219 Tune a bit. Reindent as per usual Emacs style.
220 (BUFFER_SIZE): Remove.
221 (Fdecompress_gzipped_region): Do not mishandle input buffers with
222 more than UINT_MAX bytes. Decompress into the gap instead of into
223 an auto buffer, as this should avoid copying. Return nil if
224 'inflate' returns Z_NEED_DICT, as we have no dictionary. Do not
225 set immediate_quit; we shouldn't trust zlib code that much.
226
313546eb
LMI
2272013-08-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
228
99a32242
LMI
229 * decompress.c (Fdecompress_gzipped_region): Respect all zlib
230 errors, and really move the gap to where we want it.
231
313546eb
LMI
232 * lisp.h: Include decompress.c support.
233
234 * emacs.c (main): Include decompress.c support.
235
236 * Makefile.in: Include -lz if present.
237
d2d699ac
JD
2382013-08-11 Jan Djärv <jan.h.d@swipnet.se>
239
f90e3ebd
JD
240 * nsmenu.m (ns_update_menubar): Call fillWithWidgetValue:frame:
241 (initWithTitle:): Initialize frame to 0.
242 (fillWithWidgetValue:): Call fillWithWidgetValue:frame.
243 (fillWithWidgetValue:frame:): Renamed from
244 fillWithWidgetValue:setDelegate, call initWithTile:frame: if f.
245
246 * nsterm.h (EmacsMenu): fillWithWidgetValue:setDelegate renamed to
247 fillWithWidgetValue:frame:
248
423d3b3f
JD
249 * nsfns.m (Fns_convert_utf8_nfd_to_nfc): Allocate and release pool to
250 remove memory leak warnings.
251
d2d699ac
JD
252 * nsterm.m (menu_pending_title, ns_get_pending_menu_title): Remove.
253 (ns_check_menu_open): Handle menu == nil. Remove assignment to
254 menu_pending_title.
255
256 * nsmenu.m (ns_update_menubar): Call fillWithWidgetValue:setDelegate.
257 (x_activate_menubar): Update the whole menu.
258 (trackingNotification:): Call ns_check_menu_open if tracking ends.
259 (menuWillOpen:): Increment trackingMenu. For OSX <= 10.6, exit if
260 current event is not NSSystemDefined (Bug#15001).
261 Call ns_check_menu_open only if trackingMenu is 2.
262 (menuDidClose:): New method, decrease trackingMenu.
263 (fillWithWidgetValue:setDelegate:): New method.
264 (fillWithWidgetValue:): Call the above.
265
266 * nsterm.h (EmacsMenu): Add fillWithWidgetValue:setDelegate:
267
7d652d97
PE
2682013-08-11 Paul Eggert <eggert@cs.ucla.edu>
269
270 Omit some unnecessary casts.
271 Many of these go back to the old pre-C89 days, when they may have
272 been needed, but we've been assuming C89 or later for a while now.
273 * alloc.c (live_string_p, live_cons_p, live_symbol_p)
274 (live_float_p, live_misc_p, live_vector_p):
275 * buffer.c (compare_overlays, cmp_for_strings, mmap_find)
276 (mmap_alloc, alloc_buffer_text, enlarge_buffer_text)
277 (defvar_per_buffer):
278 * callint.c (Fcall_interactively):
279 * doc.c (Fsubstitute_command_keys):
280 * filelock.c (get_boot_time):
281 * frame.c (xrdb_get_resource):
282 * gtkutil.c (hierarchy_ch_cb, qttip_cb, style_changed_cb)
283 (delete_cb, xg_dialog_response_cb, xg_maybe_add_timer)
284 (xg_get_file_name_from_selector, menuitem_destroy_callback)
285 (menuitem_highlight_callback, menu_destroy_callback)
286 (xg_update_menu_item, xg_modify_menubar_widgets, menubar_map_cb)
287 (xg_tool_bar_callback, xg_get_tool_bar_widgets)
288 (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
289 (xg_tool_bar_help_callback, tb_size_cb):
290 * image.c (xpm_alloc_color, png_read_from_memory)
291 (png_read_from_file, png_load_body, our_memory_skip_input_data)
292 (jpeg_memory_src, jpeg_file_src, imagemagick_load_image)
293 (syms_of_image):
294 * keymap.c (describe_map):
295 * nsfns.m (Fns_display_monitor_attributes_list):
296 * nsmenu.m (process_dialog:):
297 * nsterm.m (hold_event):
298 * process.c (wait_reading_process_output):
299 * regex.c (REGEX_REALLOCATE, re_set_registers, re_exec, regexec):
300 * scroll.c (do_direct_scrolling, scrolling_1):
301 * termcap.c (tgetent):
302 * window.c (check_window_containing, add_window_to_list)
303 (freeze_window_starts):
304 * xdisp.c (compare_overlay_entries, vmessage):
305 * xfns.c (x_window, x_get_monitor_attributes_xinerama)
306 (x_get_monitor_attributes_xrandr)
307 (Fx_display_monitor_attributes_list, x_display_info_for_name)
308 (Fx_open_connection, file_dialog_cb, file_dialog_unmap_cb):
309 * xfont.c (xfont_match, xfont_open):
310 * xmenu.c (x_menu_wait_for_event, menu_highlight_callback)
311 (menubar_selection_callback, menu_position_func)
312 (popup_selection_callback, create_and_show_popup_menu)
313 (dialog_selection_callback, create_and_show_dialog):
314 * xrdb.c (x_get_string_resource):
315 (main) [TESTRM]:
316 * xsmfns.c (x_session_check_input):
317 * xterm.c (x_draw_glyphless_glyph_string_foreground)
318 (xm_scroll_callback, xg_scroll_callback, xg_end_scroll_callback)
319 (xaw_jump_callback, xaw_scroll_callback):
320 Omit unnecessary casts.
321
9acc1074
PE
3222013-08-10 Paul Eggert <eggert@cs.ucla.edu>
323
324 Minor string-length refactoring.
325 * alloc.c (xstrdup): Use memcpy, not strcpy, since the length's known.
326 * frame.c (make_monitor_attribute_list):
327 Prefer build_string to strlen + make_string.
328
361c0eb8
JD
3292013-08-10 Jan Djärv <jan.h.d@swipnet.se>
330
331 * xterm.c (x_error_handler): Also ignore BadWindow for X_SetInputFocus,
332 don't check minor_code (Bug#14417).
333
14ba0822
EZ
3342013-08-09 Eli Zaretskii <eliz@gnu.org>
335
336 * xdisp.c (draw_glyphs): Don't compare row pointers, compare row
337 vertical positions instead. This avoids calling MATRIX_ROW with
338 row numbers that are possibly beyond valid limits. (Bug#15064)
339
309f24d1
DA
3402013-08-09 Dmitry Antipov <dmantipov@yandex.ru>
341
342 Use xstrdup and build_unibyte_string where applicable.
343 * alloc.c (xstrdup): Tiny cleanup. Add eassert.
344 * xfns.c (x_window):
345 * xrdb.c (x_get_customization_string):
346 * xterm.c (xim_initialize):
347 * w32fns.c (w32_window): Use xstrdup.
348 (w32_display_monitor_attributes_list):
349 * emacs.c (init_cmdargs):
350 * keyboard.c (PUSH_C_STR):
351 * nsfont.m (nsfont_open):
352 * sysdep.c (system_process_attributes):
353 * w32.c (system_process_attributes):
354 * xdisp.c (message1, message1_nolog): Use build_unibyte_string.
355
55902276
EZ
3562013-08-09 Eli Zaretskii <eliz@gnu.org>
357
358 * w32.c (PEXCEPTION_POINTERS, PEXCEPTION_RECORD, PCONTEXT): Define
359 variables of these types so that GDB would know about them, as aid
360 for debugging fatal exceptions. (Bug#15024) See also
361 http://sourceware.org/ml/gdb/2013-08/msg00010.html for related
362 discussions.
363
10bf7f5a
JD
3642013-08-08 Jan Djärv <jan.h.d@swipnet.se>
365
366 * nsterm.m (ns_update_begin): Don't change clip path if it would be
367 larger than the NSWindow (Bug#14934).
368
65620264
DA
3692013-08-08 Dmitry Antipov <dmantipov@yandex.ru>
370
371 Redesign redisplay interface to drop global variable updated_window.
372 Always pass currently updated window as a parameter to update routines.
373 * dispextern.h (updated_window): Remove declaration.
374 (struct redisplay_interface): Pass window parameter to
375 write_glyphs, insert_glyphs, clear_end_of_line, cursor_to
376 and after_update_window_hook.
377 (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line, x_cursor_to):
378 Adjust prototypes.
379 * dispnew.c (updated_window): Remove.
380 (redraw_overlapped_rows, update_marginal_area, update_text_area)
381 (update_window_line): Adjust to match redisplay interface changes.
382 * nsterm.m (ns_update_window_begin, ns_update_window_end)
383 (ns_scroll_run, ns_after_update_window_line):
384 * w32term.c (x_update_window_begin, x_update_window_end)
385 (x_after_update_window_line, x_scroll_run):
386 * xterm.c (x_update_window_begin, x_update_window_end)
387 (x_after_update_window_line, x_scroll_run):
388 * xdisp.c (x_write_glyphs, x_insert_glyphs, x_clear_end_of_line):
389 Likewise. Adjust comments where appropriate.
390 (x_cursor_to): Simplify because this is always called during window
391 update (but install debugging check anyway).
392 (expose_window): Check must_be_updated_p flag to see whether this
393 function is called during window update.
394
628fdc56
DA
3952013-08-08 Dmitry Antipov <dmantipov@yandex.ru>
396
397 Do not reset window modification event counters excessively.
398 These leftovers and poor man's tricky methods to catch extra
399 redisplay's attention are no longer needed.
400 * frame.c (set_menu_bar_lines_1):
401 * minibuf.c (read_minibuf_unwind):
402 * window.c (Fset_window_start, set_window_buffer, window_resize_apply)
403 (grow_mini_window, shrink_mini_window, window_scroll_pixel_based)
404 (window_scroll_line_based, Fset_window_configuration):
405 * xdisp.c (redisplay_window): Do not reset last_modified and
406 last_overlay_modified counters.
407
8fd9c92e
JD
4082013-08-07 Jan Djärv <jan.h.d@swipnet.se>
409
410 * xselect.c (x_send_client_event): Set send_event and serial, memset
411 data.l as it might be bigger than data.b. Use 24 bit mask to
412 XSendEvent (Bug#15034).
413
0ee18172
EZ
4142013-08-07 Eli Zaretskii <eliz@gnu.org>
415
416 * xdisp.c (prepare_menu_bars): Don't call x_consider_frame_title
417 for TTY frames that are not the top frame on their console.
418 (Bug#14616)
419
16ddd1a6
MR
4202013-08-07 Martin Rudalics <rudalics@gmx.at>
421
422 * w32term.c (w32fullscreen_hook): Really maximize frame when
423 asked for (Bug#14841).
424
d2a95ffb
DA
4252013-08-07 Dmitry Antipov <dmantipov@yandex.ru>
426
427 Prefer selected_window to Fselected_window, likewise for frames.
428 * buffer.c (Fbuffer_swap_text):
429 * data.c (Fvariable_binding_locus):
430 * window.c (run_window_configuration_change_hook): Adjust users.
431 * w16select.c (Fw16_set_clipboard_data, Fw16_get_clipboard_data):
432 Use decode_live_frame.
433
170da1ec
DA
4342013-08-07 Dmitry Antipov <dmantipov@yandex.ru>
435
436 Be more careful if selected window shows the buffer other than current,
437 use window_outdated only if this is not so. This change should also
438 address some weird issues discussed in Bug#13012.
439 * window.h (window_outdated): New prototype.
440 * window.c (window_outdated): Now here. Convert from static and
441 always assume window's buffer.
442 (Fwindow_end, Fwindow_line_height): Use it.
443 * xdisp.c (reconsider_clip_changes): Remove prototype, drop 2nd arg
444 and always assume window's buffer.
445 (redisplay_window): Adjust user.
e5eefe9b 446 (redisplay_internal): Call to reconsider_clip_changes once and
170da1ec
DA
447 check whether mode line should be updated only if selected window
448 shows current buffer.
449 (run_window_scroll_functions): Use eassert for debugging check.
450 (Fmove_point_visually, note_mouse_highlight): Use window_outdated.
451
56b5d5b1
DA
4522013-08-06 Dmitry Antipov <dmantipov@yandex.ru>
453
454 * window.c (window_scroll, window_scroll_pixel_based)
455 (window_scroll_line_based): Use bool for booleans.
456
2878ba7e
PE
4572013-08-06 Paul Eggert <eggert@cs.ucla.edu>
458
459 * process.c: Fix minor off-by-one issues in descriptor counts.
460 This shouldn't fix any real bugs, but it cleans up the code a bit.
461 (max_process_desc, max_input_desc): -1, not 0, means none.
462 All uses changed.
463 (delete_input_desc): New function.
464 (delete_write_fd, delete_keyboard_wait_descriptor): Use it.
465 (deactivate_process): Scan backwards when recomuting max_process_desc;
466 that should be faster.
467 (init_process_emacs): Initialize max_input_desc.
468
e30b79c1
DA
4692013-08-06 Dmitry Antipov <dmantipov@yandex.ru>
470
471 Use region cache to speedup bidi_find_paragraph_start.
472 * buffer.h (struct buffer): New member bidi_paragraph_cache.
473 Rename cache_long_line_scans to cache_long_scans.
474 * buffer.c (bset_cache_long_line_scans): Rename to
475 bset_cache_long_scans.
476 (Fget_buffer_create, Fmake_indirect_buffer, Fkill_buffer)
477 (Fbuffer_swap_text, init_buffer_once): Take bidi_paragraph_cache
478 into account.
479 (syms_of_buffer): Rename cache-long-line-scans to
480 cache-long-scans. Adjust docstring.
481 * search.c (newline_cache_on_off):
482 * indent.c (width_run_cache_on_off): Adjust users.
483 * bidi.c (bidi_paragraph_cache_on_off): New function.
484 (bidi_find_paragraph_start): Use bidi_paragraph_cache if needed.
485 * insdel.c (prepare_to_modify_buffer): Invalidate
486 bidi_paragraph_cache if enabled.
487
00012b86
DA
4882013-08-06 Dmitry Antipov <dmantipov@yandex.ru>
489
490 Invalidate region caches only if buffer text is going to be changed.
491 * lisp.h (modify_region_1): Remove 3rd arg and rename to...
492 (modify_text): ...new prototype.
493 (prepare_to_modify_buffer_1): New prototype.
494 * textprop.c (modify_region): Rename to...
495 (modify_text_properties): ...new function.
496 (add_text_properties_1, set_text_properties, Fremove_text_properties)
497 (Fremove_list_of_text_properties): Adjust users.
498 * insdel.c (modify_region_1): Remove 3rd arg and reimplement as...
499 (modify_text): ...new function.
500 (prepare_to_modify_buffer): Reimplement mostly as a wrapper for...
501 (prepare_to_modify_buffer_1): ...new function.
502 * casefiddle.c (casify_region):
503 * editfns.c (Fsubst_char_in_region, Ftranslate_region_internal)
504 (Ftranspose_regions): Use modify_text.
505
dc6c0eda
SM
5062013-08-05 Stefan Monnier <monnier@iro.umontreal.ca>
507
508 * lisp.mk (lisp): Add nadvice.elc.
509
8f3a2c26
DA
5102013-08-05 Dmitry Antipov <dmantipov@yandex.ru>
511
512 New macro to iterate over live buffers similar to frames.
513 * buffer.h (FOR_EACH_LIVE_BUFFER): New macro.
514 (Vbuffer_alist, Qpriority, Qbefore_string, Qafter_string):
515 Declare buffer-related variables here to offload lisp.h.
516 * buffer.c (Vbuffer_alist): Adjust comment.
517 (Fget_file_buffer, get_truename_buffer, Fother_buffer)
518 (other_buffer_safely):
519 * data.c (store_symval_forwarding):
520 * dispnew.c (Fframe_or_buffer_changed_p):
521 * fileio.c (Fdo_auto_save):
522 * filelock.c (unlock_all_files):
523 * minibuf.c (read_minibuf): Use FOR_EACH_LIVE_BUFFER.
524
e0fdb694
PE
5252013-08-04 Paul Eggert <eggert@cs.ucla.edu>
526
527 Fix some minor races in hosts lacking mkostemp (Bug#15015).
528 * callproc.c (create_temp_file):
529 * filelock.c (create_lock_file):
530 Assume mkostemp, since it's now provided by Gnulib.
531
63f5c6c2
EZ
5322013-08-04 Eli Zaretskii <eliz@gnu.org>
533
534 * w32.c (mkostemp): New function.
535 (mktemp): Remove, no longer used. Most of the code reused in
536 mkostemp. (Bug#15015)
484ab239 537 (mktemp): Don't undef.
63f5c6c2 538
f0b79313
DA
5392013-08-04 Dmitry Antipov <dmantipov@yandex.ru>
540
541 * dispnew.c (glyph_matrix_count, glyph_pool_count):
542 Move under GLYPH_DEBUG and ENABLE_CHECKING.
543 (new_glyph_matrix, free_glyph_matrix, new_glyph_pool)
544 (free_glyph_pool, check_glyph_memory): Likewise for
545 all users. Adjust comments where appropriate.
546
98f638d6
PE
5472013-08-03 Paul Eggert <eggert@cs.ucla.edu>
548
549 * composite.h: Minor fixups.
550 (composition_registered_p): Rename from COMPOSITION_REGISTERD_P
551 to fix a misspelling, and change it to an inline function while
552 we're at it (it need not be a macro). All uses changed.
553 (composition_method, composition_valid_p):
554 Rewrite to avoid assignments in if-conditions.
555
75c59fb3
DA
5562013-08-03 Dmitry Antipov <dmantipov@yandex.ru>
557
558 Do not use global Lisp_Object in composition macros.
559 * composite.h (composition_temp): Remove declaration.
560 (COMPOSITION_METHOD, COMPOSITION_VALID_P): Replace with...
561 (composition_method, composition_valid_p): ...inline functions.
416a3e01 562 (compose_region): Remove the leftover.
75c59fb3
DA
563 * composite.c (composition_temp): Remove.
564 (run_composition_function, update_compositions)
565 (composition_compute_stop_pos, composition_adjust_point)
566 (Ffind_composition_internal):
567 * coding.c (handle_composition_annotation):
568 * xdisp.c (handle_composition_prop, check_point_in_composition):
569 Related users changed.
570
a10c8269
DA
5712013-08-03 Dmitry Antipov <dmantipov@yandex.ru>
572
573 Drop FRAME_PTR typedef.
574 * composite.c, font.c, font.h, fontset.c, fontset.h, frame.c, frame.h:
575 * ftfont.c, ftxfont.c, gtkutil.c, gtkutil.h, image.c, keyboard.c:
576 * menu.c, menu.h, msdos.c, nsfns.m, nsfont.m, nsmenu.m, nsterm.h:
577 * nsterm.m, scroll.c, term.c, w32fns.c, w32font.c, w32font.h:
578 * w32inevt.c, w32inevt.h, w32menu.c, w32notify.c, w32term.c, w32term.h:
579 * w32uniscribe.c, w32xfns.c, widget.c, window.c, xdisp.c, xfaces.c:
580 * xfns.c, xfont.c, xftfont.c, xmenu.c, xselect.c, xterm.c:
581 All related users changed.
582
a104f656
SM
5832013-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
584
585 * eval.c (default_toplevel_binding): New function.
586 (Fdefvar): Use it.
587 (unbind_to, backtrace_eval_unrewind): Do a bit of CSE simplification.
588 (Fdefault_toplevel_value, Fset_default_toplevel_value): New subrs.
589 (syms_of_eval): Export them.
590 * data.c (Fdefault_value): Micro cleanup.
591 * term.c (init_tty): Use "false".
592
4b5c9326
DA
5932013-08-02 Dmitry Antipov <dmantipov@yandex.ru>
594
595 Fix X GC leak in GTK and raw (no toolkit) X ports.
596 * xterm.c (x_free_frame_resources): If white and black relief
597 GCs are allocated, always free them here.
598 * xfns.c (x_make_gc): Omit redundant initialization.
599 * widget.c (create_frame_gcs): Remove the leftover.
600 (EmacsFrameDestroy): Do nothing because all GCs are now freed
601 in x_free_frame_resources.
602
b19aa636
JD
6032013-08-02 Jan Djärv <jan.h.d@swipnet.se>
604
605 * nsterm.m (windowWillResize:toSize:): Only change title if
606 ! maximizing_resize && FULLSCREEN_NONE (Bug#15005). strdup title before
607 modifying it.
608 (viewDidEndLiveResize): New method.
609
610 * nsterm.h (EmacsView): Add maximizing_resize, put it and old_title
611 inside NS_IMPL_COCOA.
612
af1f7e06
DA
6132013-08-02 Dmitry Antipov <dmantipov@yandex.ru>
614
615 * insdel.c (adjust_after_replace, replace_range, del_range_2):
616 Do not check whether undo is enabled because record_insert and
617 record_delete does that themselves.
618
65b02bb9
DA
6192013-08-02 Dmitry Antipov <dmantipov@yandex.ru>
620
621 * xterm.h (struct x_output) [HAVE_X_I18N]: Remove xic_base_fontname
622 member which is not really used any more.
623 (FRAME_XIC_BASE_FONTNAME): Remove.
624 * xfns.c (xic_free_fontset): Adjust user.
625 * xmenu.c (mouse_position_for_popup, x_activate_menubar)
626 (update_frame_menubar, set_frame_menubar, free_frame_menubar)
627 (create_and_show_popup_menu, xmenu_show, create_and_show_dialog)
628 (xdialog_show): Use eassert for debugging check.
7ee0f047 629 * w32term.c (x_unfocus_frame): Remove unused dummy function.
65b02bb9 630
6318cde0
PE
6312013-08-01 Paul Eggert <eggert@cs.ucla.edu>
632
633 * fileio.c, fns.c (merge): Move extern decl from here ...
634 * lisp.h (merge): ... to here.
635
6c1a09ba
DA
6362013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
637
638 Fix last font-related change.
639 * w32font.h (w32font_list_internal, w32font_match_internal):
640 Fix prototype.
641 * w32uniscribe.c (uniscribe_list, uniscribe_match):
642 (uniscribe_list_family): Adjust to match font API change.
643 MS-Windows breakage reported by Juanma Barranquero <lekktu@gmail.com>
644 at http://lists.gnu.org/archive/html/emacs-devel/2013-08/msg00006.html.
645
f8c20208
DA
6462013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
647
648 * frame.h (FRAME_MOUSE_UPDATE):
649 * nsterm.m (ns_frame_up_to_date): Omit redundant check
650 whether hlinfo->mouse_face_mouse_frame is non-NULL.
651
fdb396e2
DA
6522013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
653
654 Avoid redundant Lisp_Object <-> struct frame conversions in font API.
655 * font.h (struct font_driver): Change list, match, and list_family
656 functions to accept struct frame * as first arg.
657 * font.c (font_score, font_compare, font_sort_entities): Remove
658 prototypes.
659 (font_sort_entities, font_list_entities, font_select_entity):
660 (font_find_for_lface, Flist_fonts, Ffont_family_list): Adjust to
661 match font API change.
662 * xfont.c (xfont_list, xfont_match, xfont_list_family):
663 * ftfont.c (ftfont_list, ftfont_match, ftfont_list_family):
664 * ftxfont.c (ftxfont_list, ftxfont_match):
665 * xftfont.c (xftfont_list, xftfont_match):
666 * nsfont.m (nsfont_list, nsfont_match, nsfont_list_family):
667 * w32font.c (w32font_list, w32font_match, w32font_list):
668 (w32font_list_internal, w32_font_match_internal): Likewise.
669 * xfaces.c (Fx_family_fonts): Adjust user.
670
52b8a085
DA
6712013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
672
673 Do not use pure Xism x_wm_set_icon_position in non-X ports.
674 * frame.c (x_set_frame_parameters): Call to x_wm_set_icon_position
675 only if HAVE_X_WINDOWS is in use.
676 * frame.h (x_set_frame_parameters): Move under HAVE_X_WINDOWS.
677 * nsterm.m (x_wm_set_icon_position): Remove no-op.
678 * w32term.c (x_wm_set_icon_position): Likewise.
679 * w32fns.c (x_icon): Adjust user.
680
c791c18e
DA
6812013-08-01 Dmitry Antipov <dmantipov@yandex.ru>
682
683 * xterm.c (last_mouse_press_frame): Remove the
684 leftover which is not really used any more.
685 (handle_one_xevent, syms_of_xterm): Adjust users.
1ca6cc28
DA
686 (x_flush): Call XFlush once per each X display, not frame.
687 This is better because this code always unconditionally skips
688 non-X frames in Vframe_list and issues the only XFlush if we
689 have more than one X frame on the same X display.
2f935d86
DA
690 (any_help_event_p, x_draw_glyph_string_background, x_display_ok):
691 Use bool for booleans.
692 (x_draw_glyph_string_background, cvt_string_to_pixel):
693 (cvt_pixel_dtor): Drop unnecessary prototypes.
694 * xterm.h (x_display_ok): Adjust prototype.
c791c18e 695
f435830e
DA
6962013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
697
698 Drop unnecessary functions that deals with frame pixel size.
699 * frame.h, msdos.h, w32term.h, xterm.h (x_pixel_width)
700 (x_pixel_height): Drop prototypes.
701 * msdos.c, nsfns.m, w32fns.c, xfns.c (x_pixel_width)
702 (x_pixel_height): Drop implementations.
703 * frame.c (Fframe_pixel_height): Use FRAME_PIXEL_HEIGHT
704 which should be always valid for window frame.
705 (Frame_pixel_width): Likewise with FRAME_PIXEL_WIDTH.
706 * w32menu.c (Fx_popup_dialog):
707 * xmenu.c (Fx_popup_dialog): Likewise for both.
708
84231434
DA
7092013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
710
711 * frame.c (Fmake_terminal_frame): Use store_in_alist to setup
712 frame parameters and call to Fmodify_frame_parameters just once.
4c131798
DA
713 (Fset_frame_height, Fset_frame_width): Mention nil frame in docstring.
714 (Fset_frame_size, Fset_frame_position): Use decode_live_frame
715 and mention nil frame in docstring.
84231434 716
959067a1
DA
7172013-07-31 Dmitry Antipov <dmantipov@yandex.ru>
718
719 * frame.c (make_frame, x_set_frame_parameters): Use bool for boolean.
720 (x_figure_window_size): Likewise. Adjust to return long.
721 (syms_of_frame): Do not DEFSYM Qterminal_live_p.
722 (toplevel): Move Qterminal_live_p to...
723 * terminal.c (toplevel): ...here, make it static, and...
724 (syms_of_terminal): ...DEFSYM here.
725 * frame.h (Qterminal_live_p): Remove declaration.
726 (make_frame, x_figure_window_size): Adjust prototype.
727 * nsfns.m (Fx_create_frame): Use long for window flags.
728
f4b169ce
PE
7292013-07-30 Paul Eggert <eggert@cs.ucla.edu>
730
731 Fix tempfile bug on platforms lacking mkostemp and mkstemp (Bug#14986).
732 * callproc.c (create_temp_file) [! (HAVE_MKOSTEMP || HAVE_MKSTEMP)]:
733 Do not assume that emacs_close (INT_MAX) is a no-op.
734
bee6a2c7
DA
7352013-07-30 Dmitry Antipov <dmantipov@yandex.ru>
736
737 * xfaces.c (make_face_cache): For struct face_cache, prefer
738 xmalloc to xzalloc and so avoid redundant call to memset.
739 (Finternal_set_lisp_face_attribute): Fix comment typo and style.
740
d7e6881a
DA
7412013-07-30 Dmitry Antipov <dmantipov@yandex.ru>
742
743 * fringe.c (draw_window_fringes, update_window_fringes)
744 (compute_fringe_widths):
745 * w32term.c (x_draw_glyph_string):
746 * window.c (candidate_window_p, Frecenter):
747 * xfaces.c (realize_basic_faces, realize_default_face)
748 (Fbitmap_space_p, Finternal_set_lisp_face_attribute)
749 (x_update_menu_appearance, face_attr_equal_p, lface_equal_p):
750 * xfns.c (x_set_cursor_color, xic_free_xfontset):
751 * xmenu.c (Fx_menu_bar_open_internal):
752 * xselect.c (x_reply_selection_request, Fx_get_atom_name):
753 * xsettings.c (xft_settings_event):
754 * xterm.c (x_draw_glyph_string, x_had_errors_p):
755 Use bool for booleans. Adjust style and comments where
756 appropriate.
757 * dispextern.h (draw_window_fringes, update_window_fringes)
758 (compute_fringe_widths):
759 * xterm.h (x_had_errors_p): Adjust prototype.
760
ec3058af
DA
7612013-07-30 Dmitry Antipov <dmantipov@yandex.ru>
762
763 * frame.c (Fmodify_frame_parameters): Always check 2nd arg with
764 CHECK_LIST. Rewrite the loop to avoid useless local variable.
765
218e0637
DA
7662013-07-29 Dmitry Antipov <dmantipov@yandex.ru>
767
768 * fns.c (toplevel): Remove comment before Fsafe_length because
769 it checks for QUIT.
770
e560aba9
PE
7712013-07-28 Paul Eggert <eggert@cs.ucla.edu>
772
773 * frame.c (delete_frame): Avoid unnecessary 'this_f' test (Bug#14970).
774
2e5ce5de
EZ
7752013-07-28 Eli Zaretskii <eliz@gnu.org>
776
777 * w32fns.c (w32_wnd_proc) <WM_IME_STARTCOMPOSITION>: Make sure the
778 frame which got the message is still alive, before dereferencing
779 its pointer. (Bug#14970)
780
781 * frame.c (delete_frame): Test "this" frame's minibuffer window to
782 be a live window, before using it as such. (Bug#14970)
783
e95da6d3
EZ
7842013-07-27 Eli Zaretskii <eliz@gnu.org>
785
786 * w32term.c (w32_read_socket) <WM_KILLFOCUS>: Call
787 w32_detect_focus_change instead of doing part of its job by hand.
788 This fixes the problem whereby FOCUS_OUT events were not sent to
789 the event queue.
790
a8f93651
EZ
7912013-07-26 Eli Zaretskii <eliz@gnu.org>
792
fec92060
EZ
793 * process.c (Fprocess_list): Doc fix.
794
a8f93651
EZ
795 * w32term.c (w32_read_socket) <WM_EMACS_PAINT>: Warn about frame
796 being re-exposed only if it didn't ask to become visible.
797 <WM_SIZE>: Under SIZE_RESTORED, only set the frame visible if it
798 was previously iconified. (Bug#14841)
799 (x_iconify_frame): Mark the frame iconified.
800
d5a7a9d9
PE
8012013-07-26 Paul Eggert <eggert@cs.ucla.edu>
802
803 Fix minor problems found by static checking.
804 * eval.c (get_backtrace_frame, backtrace_eval_unrewind): Now static.
805 (backtrace_eval_unrewind): ';' -> '{}' to pacify GCC.
806
56ea7291
SM
8072013-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
808
809 * eval.c (set_specpdl_old_value): New function.
810 (unbind_to): Minor simplification.
811 (get_backtrace_frame): New function.
812 (Fbacktrace_frame): Use it. Add `base' argument.
813 (backtrace_eval_unrewind, Fbacktrace_eval): New functions.
814 (syms_of_eval): Export backtrace-eval.
815 * xterm.c (x_focus_changed): Simplify.
816
9d611ffe
PE
8172013-07-25 Paul Eggert <eggert@cs.ucla.edu>
818
819 * fileio.c (Finsert_file_contents): Avoid double-close (Bug#14936).
820
999c74e3
EZ
8212013-07-24 Eli Zaretskii <eliz@gnu.org>
822
823 * xdisp.c (redisplay_window): Instead of moving point out of
824 scroll margin, reject the force_start method, and try scrolling
825 instead. (Bug#14780)
826
198fa217
KB
8272013-07-24 Ken Brown <kbrown@cornell.edu>
828
829 * alloc.c (make_save_ptr): Define if HAVE_NTGUI is defined
830 (Bug#14944).
831
53840e55
PE
8322013-07-24 Paul Eggert <eggert@cs.ucla.edu>
833
834 * eval.c (Fprogn): Do not check that BODY is a proper list.
835 This undoes the previous change. The check slows down the
836 interpreter, and is not needed to prevent a crash. See
837 <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00693.html>.
838
60967f56
GM
8392013-07-23 Glenn Morris <rgm@gnu.org>
840
841 * Makefile.in ($(etc)/DOC, temacs$(EXEEXT)): Ensure etc/ exists.
842
9ca960e2
PE
8432013-07-23 Paul Eggert <eggert@cs.ucla.edu>
844
a29c3e6d
PE
845 Port to GNU/Linux systems with tinfo but not ncurses.
846 * dispnew.c (init_display): Depend on USE_NCURSES, not GNU_LINUX,
847 to decide whether ncurses is being used. Without this change,
848 GCC complains about tgetent not being declared, on a system
849 that has tinfo installed but ncurses not installed.
850
f274311c
PE
851 * eval.c (Fprogn): Check that BODY is a proper list.
852
16b0520a
PE
853 Tune UNEVALLED functions by using XCAR instead of Fcar, etc.
854 * data.c (Fsetq_default):
855 * eval.c (Fif, Fcond, Fprog1, Fsetq, Fquote, Ffunction, Fdefvar)
856 (Fdefconst, FletX, Flet, Fwhile, Fcatch, Funwind_protect)
857 (Fcondition_case):
858 Tune by taking advantage of the fact that ARGS is always a list
859 when a function is declared to have UNEVALLED args.
860
9ca960e2
PE
861 * emacsgtkfixed.c: Port to GCC 4.6.
862 GCC 4.6 complains about -Wunused-local-typedefs, introduced in 4.7.
863
afacaa1b
JB
8642013-07-23 Juanma Barranquero <lekktu@gmail.com>
865
866 * callproc.c (child_setup)[!WINDOWSNT]: Move exec_errno and pid
867 here to silence compiler warnings.
868
368a85a4
PE
8692013-07-22 Paul Eggert <eggert@cs.ucla.edu>
870
871 * sysdep.c (frame) [__FreeBSD__]: #define to freebsd_frame
872 when including <sys/user.h>, to prevent Sparc/ARM machine/frame.h
873 from messing up Emacs's 'struct frame' (Bug#14923).
874
f4e891b5
PE
8752013-07-21 Paul Eggert <eggert@cs.ucla.edu>
876
877 * alloc.c (make_save_ptr_ptr): Define this function.
878 It was inadvertently omitted. It's needed only if
879 HAVE_MENUS && ! (USE_X_TOOLKIT || USE_GTK).
880
96c8b65e
JD
8812013-07-21 Jan Djärv <jan.h.d@swipnet.se>
882
883 * nsterm.m (sendEvent:): Skip mouse moved if no dialog and no Emacs
884 frame have focus (Bug#14895).
885
ee010797
PE
8862013-07-21 Paul Eggert <eggert@cs.ucla.edu>
887
888 Avoid vfork-related deadlock more cleanly.
889 * callproc.c (child_setup): When the child's exec fails, output
890 the program name, as that's more useful. Use O_NONBLOCK to avoid
891 deadlock.
892 * process.c (create_process_1): Remove; no longer needed.
893 (create_process): Remove timer hack; no longer needed, now that
894 the child avoids deadlock.
895
f0398ec1 8962013-07-20 Glenn Morris <rgm@gnu.org>
8bfcc21a
GM
897
898 * image.c (Fimage_flush): Fix doc typo.
899
b2a069c2
PE
9002013-07-20 Paul Eggert <eggert@cs.ucla.edu>
901
6496aec9
PE
902 Fix array bounds violation when pty allocation fails.
903 * process.c (PTY_NAME_SIZE): New constant.
904 (pty_name): Remove static variable; it's now auto.
905 (allocate_pty): Define even if !HAVE_PTYS; that's simpler.
906 Take pty_name as an arg rather than using a static variable.
907 All callers changed.
908 (create_process): Recover pty_flag from process, not from volatile local.
909 (create_pty): Stay inside array even when pty allocation fails.
910 (Fmake_serial_process): Omit unnecessary initializaiton of pty_flag.
911
b2a069c2
PE
912 * lread.c (Fload): Avoid initialization only when lint checking.
913 Mention that it's needed only for older GCCs.
914
99107004
KH
9152013-07-20 Kenichi Handa <handa@gnu.org>
916
917 * coding.c (CODING_ISO_FLAG_LEVEL_4): New macro.
918 (decode_coding_iso_2022): Check the single-shift area. (Bug#8522)
919
6b1b199d
AS
9202013-07-20 Andreas Schwab <schwab@linux-m68k.org>
921
922 * lread.c (Fload): Avoid uninitialized warning.
923
4195afc3
PE
9242013-07-19 Paul Eggert <eggert@cs.ucla.edu>
925
3f5bef16
PE
926 Fix some minor file descriptor leaks and related glitches.
927 * filelock.c (create_lock_file) [!O_CLOEXEC]: Use fcntl with FD_CLOEXEC.
928 (create_lock_file): Use write, not emacs_write.
929 * image.c (slurp_file, png_load_body):
930 * process.c (Fnetwork_interface_list, Fnetwork_interface_info)
931 (server_accept_connection):
932 Don't leak an fd on memory allocation failure.
933 * image.c (slurp_file): Add a cheap heuristic for growing files.
934 * xfaces.c (Fx_load_color_file): Block input around the fopen too,
935 as that's what the other routines do. Maybe input need not be
936 blocked at all, but it's better to be consistent.
937 Avoid undefined behavior when strlen is zero.
938
4195afc3
PE
939 * alloc.c (staticpro): Avoid buffer overrun on repeated calls.
940 (NSTATICS): Now a constant; doesn't need to be a macro.
941
a1aeeffe
RS
9422013-07-19 Richard Stallman <rms@gnu.org>
943
944 * coding.c (decode_coding_utf_8): Add simple loop for fast
945 processing of ASCII characters.
946
63b34baa
PE
9472013-07-19 Paul Eggert <eggert@cs.ucla.edu>
948
949 * conf_post.h (RE_TRANSLATE_P) [emacs]: Remove obsolete optimization.
950
621dd9ac
EZ
9512013-07-19 Eli Zaretskii <eliz@gnu.org>
952
953 * keyboard.c (kbd_buffer_get_event): Use Display_Info instead of
954 unportable 'struct x_display_info'.
955 (DISPLAY_LIST_INFO): Delete macro: not needed, since Display_Info
956 is a portable type.
957
1396ac86
PE
9582013-07-19 Paul Eggert <eggert@cs.ucla.edu>
959
ab9980cd
PE
960 * sysdep.c [GNU_LINUX]: Fix fd and memory leaks and similar issues.
961 (procfs_ttyname): Don't use uninitialized storage if emacs_fopen
962 or fscanf fails.
963 (system_process_attributes): Prefer plain char to unsigned char
964 when either will do. Clean up properly if interrupted or if
965 memory allocations fail. Don't assume sscanf succeeds. Remove
966 no-longer-needed workaround to stop GCC from whining. Read
967 command-line once, instead of multiple times. Check read status a
968 bit more carefully.
969
1396ac86
PE
970 Fix obscure porting bug with varargs functions.
971 The code assumed that int is treated like ptrdiff_t in a vararg
972 function, which is not a portable assumption. There was a similar
973 -- though these days less likely -- porting problem with various
974 assumptions that pointers of different types all smell the same as
975 far as vararg functions is conserved. To make this problem less
976 likely in the future, redo the API to use varargs functions.
977 * alloc.c (make_save_value): Remove this vararg function.
978 All uses changed to ...
979 (make_save_int_int_int, make_save_obj_obj_obj_obj)
980 (make_save_ptr_int, make_save_funcptr_ptr_obj, make_save_memory):
981 New functions.
982 (make_save_ptr): Rename from make_save_pointer, for consistency with
983 the above. Define only on platforms that need it. All uses changed.
984
4d19d194
PE
9852013-07-18 Paul Eggert <eggert@cs.ucla.edu>
986
987 * keyboard.c: Try to fix typos in previous change.
988 (DISPLAY_LIST_INFO): New macro.
989 (kbd_buffer_get_event): Do not access members that are not present
c7064f05 990 in X11. Revert inadvertent change of "!=" to "=".
4d19d194 991
945c5bb1
JB
9922013-07-18 Juanma Barranquero <lekktu@gmail.com>
993
994 * keyboard.c (kbd_buffer_get_event):
995 * w32term.c (x_focus_changed): Port FOCUS_(IN|OUT)_EVENT changes to W32.
996 Followup to 2013-07-16T11:41:06Z!jan.h.d@swipnet.se.
997
f4b1eb36
PE
9982013-07-18 Paul Eggert <eggert@cs.ucla.edu>
999
5e679a2c
PE
1000 * filelock.c: Fix unlikely file descriptor leaks.
1001 (get_boot_time_1): Rework to avoid using emacs_open.
1002 This doesn't actually fix a leak, but is better anyway.
1003 (read_lock_data): Use read, not emacs_read.
1004
a8cd4836
PE
1005 * doc.c: Fix minor memory and file descriptor leaks.
1006 * doc.c (get_doc_string): Fix memory leak when doc file absent.
1007 (get_doc_string, Fsnarf_documentation):
1008 Fix file descriptor leak on error.
1009
ef30e638
PE
1010 * term.c: Fix minor fdopen-related file descriptor leaks.
1011 * term.c (Fresume_tty) [!MSDOS]: Close fd if fdopen (fd) fails.
1012 (init_tty) [!DOS_NT]: Likewise. Also close fd if isatty (fd) fails.
1013
f4b1eb36
PE
1014 * charset.c: Fix file descriptor leaks and errno issues.
1015 Include <errno.h>.
1016 (load_charset_map_from_file): Don't leak file descriptor on error.
1017 Use plain record_xmalloc since the allocation is larger than
1018 MAX_ALLOCA; that's simpler here. Simplify test for exhaustion
1019 of entries.
1020 * eval.c (record_unwind_protect_nothing):
1021 * fileio.c (fclose_unwind):
1022 New functions.
1023 * lread.c (load_unwind): Remove. All uses replaced by fclose_unwind.
1024 The replacement doesn't block input, but that no longer seems
1025 necessary.
1026
b648c163
PE
10272013-07-17 Paul Eggert <eggert@cs.ucla.edu>
1028
a0931322
PE
1029 * lread.c: Fix file descriptor leaks and errno issues.
1030 (Fload): Close some races that leaked fds or streams when 'load'
1031 was interrupted.
1032 (Fload, openp): Report error number of last nontrivial failure to open.
1033 ENOENT counts as trivial.
1034 * eval.c (do_nothing, clear_unwind_protect, set_unwind_protect_ptr):
1035 New functions.
1036 * fileio.c (close_file_unwind): No need to test whether FD is nonnegative,
1037 now that the function is always called with a nonnegative arg.
1038 * lisp.h (set_unwind_protect_ptr, set_unwind_protect_int): Remove.
1039 All uses replaced with ...
1040 (clear_unwind_protect, set_unwind_protect_ptr): New decls.
1041
b648c163
PE
1042 A few more minor file errno-reporting bugs.
1043 * callproc.c (Fcall_process):
1044 * doc.c (Fsnarf_documentation):
1045 * fileio.c (Frename_file, Fadd_name_to_file, Fmake_symbolic_link):
1046 * process.c (set_socket_option):
1047 Don't let a constructor trash errno.
1048 * doc.c: Include <errno.h>.
1049
b1dc4084
JB
10502013-07-16 Juanma Barranquero <lekktu@gmail.com>
1051
1052 * w32fns.c (unwind_create_tip_frame): Fix declaration.
1053
c43843aa
PE
10542013-07-16 Paul Eggert <eggert@cs.ucla.edu>
1055
50a30cce
PE
1056 Fix w32 bug with call-process-region (Bug#14885).
1057 * callproc.c (Fcall_process_region): Pass nil, not "/dev/null",
1058 to Fcall_process when the input is empty. This simplifies the
1059 code a bit. It makes no difference on POSIXish platforms but
1060 apparently it fixes a bug on w32.
1061
44e18199 1062 Fix bug where insert-file-contents closes a file twice (Bug#14839).
41d48a42
PE
1063 * fileio.c (close_file_unwind): Don't close if FD is negative;
1064 this can happen when unwinding a zapped file descriptor.
1065 (Finsert_file_contents): Unwind-protect the fd before the point marker,
1066 in case Emacs runs out of memory between the two unwind-protects.
1067 Don't trash errno when closing FD.
1068 Zap the FD in the specpdl when closing it, instead of deferring
1069 the removal of the unwind-protect; this fixes a bug where a child
1070 function unwinds the stack past us.
1071
27e498e6
PE
1072 New unwind-protect flavors to better type-check C callbacks.
1073 This also lessens the need to write wrappers for callbacks,
1074 and the need for make_save_pointer.
1075 * alloca.c (free_save_value):
1076 * atimer.c (run_all_atimers):
1077 Now extern.
1078 * alloc.c (safe_alloca_unwind):
1079 * atimer.c (unwind_stop_other_atimers):
1080 * keyboard.c (cancel_hourglass_unwind) [HAVE_WINDOW_SYSTEM]:
1081 * menu.c (cleanup_popup_menu) [HAVE_NS]:
1082 * minibuf.c (choose_minibuf_frame_1):
1083 * process.c (make_serial_process_unwind):
1084 * xdisp.h (pop_message_unwind):
1085 * xselect.c (queue_selection_requests_unwind):
1086 Remove no-longer-needed wrapper. All uses replaced by the wrappee.
1087 * alloca.c (record_xmalloc):
1088 Prefer record_unwind_protect_ptr to record_unwind_protect with
1089 make_save_pointer.
1090 * alloca.c (Fgarbage_collect):
1091 Prefer record_unwind_protect_void to passing a dummy.
1092 * buffer.c (restore_buffer):
1093 * window.c (restore_window_configuration):
1094 * xfns.c, w32fns.c (do_unwind_create_frame)
1095 New wrapper. All record-unwind uses of wrappee changed.
1096 * buffer.c (set_buffer_if_live):
1097 * callproc.c (call_process_cleanup, delete_temp_file):
1098 * coding.c (code_conversion_restore):
1099 * dired.c (directory_files_internal_w32_unwind) [WINDOWSNT]:
1100 * editfns.c (save_excursion_restore)
1101 (subst_char_in_region_unwind, subst_char_in_region_unwind_1)
1102 (save_restriction_restore):
1103 * eval.c (restore_stack_limits, un_autoload):
1104 * fns.c (require_unwind):
1105 * keyboard.c (recursive_edit_unwind, tracking_off):
1106 * lread.c (record_load_unwind, load_warn_old_style_backquotes):
1107 * macros.c (pop_kbd_macro, restore_menu_items):
1108 * nsfns.m (unwind_create_frame):
1109 * print.c (print_unwind):
1110 * process.c (start_process_unwind):
1111 * search.c (unwind_set_match_data):
1112 * window.c (select_window_norecord, select_frame_norecord):
1113 * xdisp.c (unwind_with_echo_area_buffer, unwind_format_mode_line)
1114 (fast_set_selected_frame):
1115 * xfns.c, w32fns.c (unwind_create_tip_frame):
1116 Return void, not a dummy Lisp_Object. All uses changed.
1117 * buffer.h (set_buffer_if_live): Move decl here from lisp.h.
1118 * callproc.c (call_process_kill):
1119 * fileio.c (restore_point_unwind, decide_coding_unwind)
1120 (build_annotations_unwind):
1121 * insdel.c (Fcombine_after_change_execute_1):
1122 * keyboard.c (read_char_help_form_unwind):
1123 * menu.c (unuse_menu_items):
1124 * minibuf.c (run_exit_minibuf_hook, read_minibuf_unwind):
1125 * sound.c (sound_cleanup):
1126 * xdisp.c (unwind_redisplay):
1127 * xfns.c (clean_up_dialog):
1128 * xselect.c (x_selection_request_lisp_error, x_catch_errors_unwind):
1129 Accept no args and return void, instead of accepting and returning
1130 a dummy Lisp_Object. All uses changed.
1131 * cygw32.c (fchdir_unwind):
1132 * fileio.c (close_file_unwind):
1133 * keyboard.c (restore_kboard_configuration):
1134 * lread.c (readevalllop_1):
1135 * process.c (wait_reading_process_output_unwind):
1136 Accept int and return void, rather than accepting an Emacs integer
1137 and returning a dummy object. In some cases this fixes an
1138 unlikely bug when the corresponding int is outside Emacs integer
1139 range. All uses changed.
1140 * dired.c (directory_files_internal_unwind):
1141 * fileio.c (do_auto_save_unwind):
1142 * gtkutil.c (pop_down_dialog):
1143 * insdel.c (reset_var_on_error):
1144 * lread.c (load_unwind):
1145 * xfns.c (clean_up_file_dialog):
1146 * xmenu.c, nsmenu.m (pop_down_menu):
1147 * xmenu.c (cleanup_widget_value_tree):
1148 * xselect.c (wait_for_property_change_unwind):
1149 Accept pointer and return void, rather than accepting an Emacs
1150 save value encapsulating the pointer and returning a dummy object.
1151 All uses changed.
1152 * editfns.c (Fformat): Update the saved pointer directly via
1153 set_unwind_protect_ptr rather than indirectly via make_save_pointer.
1154 * eval.c (specpdl_func): Remove. All uses replaced by definiens.
1155 (unwind_body): New function.
1156 (record_unwind_protect): First arg is now a function returning void,
1157 not a dummy Lisp_Object.
1158 (record_unwind_protect_ptr, record_unwind_protect_int)
1159 (record_unwind_protect_void): New functions.
1160 (unbind_to): Support SPECPDL_UNWIND_PTR etc.
1161 * fileio.c (struct auto_save_unwind): New type.
1162 (do_auto_save_unwind): Use it.
1163 (do_auto_save_unwind_1): Remove; subsumed by new do_auto_save_unwind.
1164 * insdel.c (struct rvoe_arg): New type.
1165 (reset_var_on_error): Use it.
1166 * lisp.h (SPECPDL_UNWIND_PTR, SPECPDL_UNWIND_INT, SPECPDL_UNWIND_VOID):
1167 New constants.
1168 (specbinding_func): Remove; there are now several such functions.
1169 (union specbinding): New members unwind_ptr, unwind_int, unwind_void.
1170 (set_unwind_protect_ptr): New function.
1171 * xselect.c: Remove unnecessary forward decls, to simplify maintenance.
1172
4e604a5d
PE
1173 Be simpler and more consistent about reporting I/O errors.
1174 * fileio.c (Fcopy_file, Finsert_file_contents, Fwrite_region):
1175 Say "Read error" and "Write error", rather than "I/O error", or
1176 "IO error reading", or "IO error writing", when a read or write
1177 error occurs.
1178 * process.c (Fmake_network_process, wait_reading_process_output)
1179 (send_process, Fprocess_send_eof, wait_reading_process_output):
1180 Capitalize diagnostics consistently. Put "failed foo" at the
1181 start of the diagnostic, so that we don't capitalize the
1182 function name "foo". Consistently say "failed" for such
1183 diagnostics.
1184 * sysdep.c, w32.c (serial_open): Now accepts Lisp string, not C string.
1185 All callers changed. This is so it can use report_file_error.
1186 * sysdep.c (serial_open, serial_configure): Capitalize I/O
1187 diagnostics consistently as above.
1188
a9757f6a
PE
1189 * fileio.c (report_file_errno): Fix errno reporting bug.
1190 If the file name is neither null nor a pair, package it up as a
1191 singleton list. All callers changed, both to this function and to
1192 report_file_error. This fixes a bug where the memory allocator
1193 invoked by list1 set errno so that the immediately following
1194 report_file_error reported the wrong errno value.
1195
c43843aa
PE
1196 Fix minor problems found by --enable-gcc-warnings.
1197 * frame.c (Fhandle_focus_in, Fhandle_focus_out): Return a value.
1198 * keyboard.c (kbd_buffer_get_event): Remove unused local.
1199
18c26d81
JD
12002013-07-16 Jan Djärv <jan.h.d@swipnet.se>
1201
1202 * xterm.c (x_focus_changed): Always generate FOCUS_IN_EVENT.
1203 Set event->arg to Qt if switch-event shall be generated.
1204 Generate FOCUS_OUT_EVENT for FocusOut if this is the focused frame.
1205
1206 * termhooks.h (enum event_kind): Add FOCUS_OUT_EVENT.
1207
1208 * nsterm.m (windowDidResignKey): If this is the focused frame, generate
1209 FOCUS_OUT_EVENT.
1210
1211 * keyboard.c (Qfocus_in, Qfocus_out): New static objects.
1212 (make_lispy_focus_in, make_lispy_focus_out): Declare and define.
1213 (kbd_buffer_get_event): For FOCUS_IN, make a focus_in event if no
1214 switch frame event is made. Check ! NILP (event->arg) if X11 (moved
44e18199 1215 from xterm.c). Make focus_out event for FOCUS_OUT_EVENT if NS or X11
18c26d81
JD
1216 and there is a focused frame.
1217 (head_table): Add focus-in and focus-out.
1218 (keys_of_keyboard): Add focus-in and focus-out to Vspecial_event_map,
1219 bind to handle-focus-in/out.
1220
1221 * frame.c (Fhandle_focus_in, Fhandle_focus_out): New functions.
1222 (Fhandle_switch_frame): Call Fhandle_focus_in.
1223 (syms_of_frame): defsubr handle-focus-in/out.
1224
6c6f1994
PE
12252013-07-16 Paul Eggert <eggert@cs.ucla.edu>
1226
c7ddc792
PE
1227 Fix porting bug to older POSIXish platforms (Bug#14862).
1228 * sysdep.c (emacs_pipe): New function, that implements
1229 pipe2 (fd, O_CLOEXEC) even on hosts that lack O_CLOEXEC.
1230 This should port better to CentOS 5 and to Mac OS X 10.6.
1231 All calls to pipe2 changed.
1232
6c6f1994
PE
1233 Prefer list1 (X) to Fcons (X, Qnil) when building lists.
1234 This makes the code easier to read and the executable a bit smaller.
1235 Do not replace all calls to Fcons that happen to create lists,
1236 just calls that are intended to create lists. For example, when
1237 creating an alist that maps FOO to nil, use list1 (Fcons (FOO, Qnil))
1238 rather than list1 (list1 (FOO)) or Fcons (Fcons (FOO, Qnil), Qnil).
1239 Similarly for list2 through list5.
1240 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
1241 * bytecode.c (exec_byte_code):
1242 * callint.c (quotify_arg, Fcall_interactively):
1243 * callproc.c (Fcall_process, create_temp_file):
1244 * charset.c (load_charset_map_from_file)
1245 (Fdefine_charset_internal, init_charset):
1246 * coding.c (get_translation_table, detect_coding_system)
1247 (Fcheck_coding_systems_region)
1248 (Fset_terminal_coding_system_internal)
1249 (Fdefine_coding_system_internal, Fdefine_coding_system_alias):
1250 * composite.c (update_compositions, Ffind_composition_internal):
1251 * dired.c (directory_files_internal, file_name_completion)
1252 (Fsystem_users):
1253 * dispnew.c (Fopen_termscript, bitch_at_user, init_display):
1254 * doc.c (Fsnarf_documentation):
1255 * editfns.c (Fmessage_box):
1256 * emacs.c (main):
1257 * eval.c (do_debug_on_call, signal_error, maybe_call_debugger)
1258 (Feval, eval_sub, Ffuncall, apply_lambda):
1259 * fileio.c (make_temp_name, Fcopy_file, Faccess_file)
1260 (Fset_file_selinux_context, Fset_file_acl, Fset_file_modes)
1261 (Fset_file_times, Finsert_file_contents)
1262 (Fchoose_write_coding_system, Fwrite_region):
1263 * fns.c (Flax_plist_put, Fyes_or_no_p, syms_of_fns):
1264 * font.c (font_registry_charsets, font_parse_fcname)
1265 (font_prepare_cache, font_update_drivers, Flist_fonts):
1266 * fontset.c (Fset_fontset_font, Ffontset_info, syms_of_fontset):
1267 * frame.c (make_frame, Fmake_terminal_frame)
1268 (x_set_frame_parameters, x_report_frame_params)
1269 (x_default_parameter, Fx_parse_geometry):
1270 * ftfont.c (syms_of_ftfont):
1271 * image.c (gif_load):
1272 * keyboard.c (command_loop_1):
1273 * keymap.c (Fmake_keymap, Fmake_sparse_keymap, access_keymap_1)
1274 (Fcopy_keymap, append_key, Fcurrent_active_maps)
1275 (Fminor_mode_key_binding, accessible_keymaps_1)
1276 (Faccessible_keymaps, Fwhere_is_internal):
1277 * lread.c (read_emacs_mule_char):
1278 * menu.c (find_and_return_menu_selection):
1279 * minibuf.c (get_minibuffer):
1280 * nsfns.m (Fns_perform_service):
1281 * nsfont.m (ns_script_to_charset):
1282 * nsmenu.m (ns_popup_dialog):
1283 * nsselect.m (ns_get_local_selection, ns_string_from_pasteboard)
1284 (Fx_own_selection_internal):
1285 * nsterm.m (append2):
1286 * print.c (Fredirect_debugging_output)
1287 (print_prune_string_charset):
1288 * process.c (Fdelete_process, Fprocess_contact)
1289 (Fformat_network_address, set_socket_option)
1290 (read_and_dispose_of_process_output, write_queue_push)
1291 (send_process, exec_sentinel):
1292 * sound.c (Fplay_sound_internal):
1293 * textprop.c (validate_plist, add_properties)
1294 (Fput_text_property, Fadd_face_text_property)
1295 (copy_text_properties, text_property_list, syms_of_textprop):
1296 * unexaix.c (report_error):
1297 * unexcoff.c (report_error):
1298 * unexsol.c (unexec):
1299 * xdisp.c (redisplay_tool_bar, store_mode_line_string)
1300 (Fformat_mode_line, syms_of_xdisp):
1301 * xfaces.c (set_font_frame_param)
1302 (Finternal_lisp_face_attribute_values)
1303 (Finternal_merge_in_global_face, syms_of_xfaces):
1304 * xfns.c (x_default_scroll_bar_color_parameter)
1305 (x_default_font_parameter, x_create_tip_frame):
1306 * xfont.c (xfont_supported_scripts):
1307 * xmenu.c (Fx_popup_dialog, xmenu_show, xdialog_show)
1308 (menu_help_callback, xmenu_show):
1309 * xml.c (make_dom):
1310 * xterm.c (set_wm_state):
1311 Prefer list1 (FOO) to Fcons (FOO, Qnil) when creating a list,
1312 and similarly for list2 through list5.
1313
bafe80ce
PE
13142013-07-15 Paul Eggert <eggert@cs.ucla.edu>
1315
1316 * callproc.c (Fcall_process_region): Fix minor race and tune.
1317 (create_temp_file): New function, with the temp-file-creation part
1318 of the old Fcall_process_region. Use Fcopy_sequence to create the
1319 temp file name, rather than alloca + build_string, for simplicity.
1320 Don't bother to block input around the temp file creation;
1321 shouldn't be needed. Simplify use of mktemp. Use
1322 record_unwind_protect immediately after creating the temp file;
1323 this closes an unlikely race where the temp file was not removed.
1324 Use memcpy rather than an open-coded loop.
1325 (Fcall_process_region): Use the new function. If the input is
1326 empty, redirect from /dev/null rather than from a newly created
1327 empty temp file; this avoids unnecessary file system traffic.
1328
4700b5a5
PE
13292013-07-14 Paul Eggert <eggert@cs.ucla.edu>
1330
5c97beae
PE
1331 * filelock.c (create_lock_file) [!HAVE_MKOSTEMP && !HAVE_MKSTEMP]:
1332 Simplify by making this case like the other two. This is a bit
1333 slower on obsolete hosts, but the extra complexity isn't worth it.
1334
4700b5a5
PE
1335 * callproc.c (child_setup, relocate_fd) [!DOS_NT]:
1336 * process.c (create_process) [!DOS_NT]:
1337 Remove now-unnecessary calls to emacs_close.
1338
f9a74c4c
EZ
13392013-07-13 Eli Zaretskii <eliz@gnu.org>
1340
922ae7ee
EZ
1341 * w32term.c (x_draw_hollow_cursor): Delete the brush object when
1342 returning early. (Bug#14850)
1343
f9a74c4c
EZ
1344 * coding.c (syms_of_coding): Set up inhibit-null-byte-detection
1345 and inhibit-iso-escape-detection attributes of 'undecided'.
1346 (Bug#14822)
1347
5e301d76
PE
13482013-07-13 Paul Eggert <eggert@cs.ucla.edu>
1349
69e0e5ee
PE
1350 * deps.mk (sysdep.o): Remove dependency on ../lib/ignore-value.h.
1351 Reported by Herbert J. Skuhra in
1352 <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00455.html>.
1353
5e301d76
PE
1354 Don't lose top specpdl entry when memory is exhausted.
1355 * eval.c (grow_specpdl): Increment specpdl top by 1 and check for
1356 specpdl overflow here, to simplify callers; all callers changed.
1357 Always reserve an unused entry at the stack top; this avoids
1358 losing the top entry's information when memory is exhausted.
1359
7e649856
PE
13602013-07-12 Paul Eggert <eggert@cs.ucla.edu>
1361
a773ed9a
PE
1362 Clean up errno reporting and fix some errno-reporting bugs.
1363 * callproc.c (Fcall_process):
1364 * fileio.c (Fcopy_file, Finsert_file_contents, Fwrite_region):
1365 * process.c (create_process, Fmake_network_process):
1366 * unexaix.c (report_error):
1367 * unexcoff.c (report_error):
1368 Be more careful about reporting the errno of failed operations.
1369 The code previously reported the wrong errno sometimes.
1370 Also, prefer report_file_errno to setting errno + report_file_error.
1371 (Fcall_process): Look at openp return value rather than at path,
1372 as that's a bit faster and clearer when there's a numeric predicate.
1373 * fileio.c (report_file_errno): New function, with most of the
1374 old contents of report_file_error.
1375 (report_file_error): Use it.
1376 (Ffile_exists_p, Ffile_accessible_directory_p):
1377 Set errno to 0 when it is junk.
1378 * fileio.c (Faccess_file):
1379 * image.c (x_create_bitmap_from_file):
1380 Use faccessat rather than opening the file, to avoid the hassle of
1381 having a file descriptor open.
1382 * lisp.h (report_file_errno): New decl.
1383 * lread.c (Flocate_file_internal): File descriptor 0 is valid, too.
1384
7e649856
PE
1385 Minor EBADF fixes.
1386 * process.c (create_process, wait_reading_process_output) [AIX]:
1387 Remove obsolete SIGHUP-related code, as Emacs no longer disables
1388 SIGHUP, so EBADF is no longer acceptable here (it wouldn't work in
1389 a multithreaded environment anyway).
1390 * sysdep.c (emacs_close): It's not dangerous to invoke emacs_close (-1).
1391
f6774c1a
AS
13922013-07-12 Andreas Schwab <schwab@linux-m68k.org>
1393
1394 * image.c (x_find_image_file): Don't close a remote file handle.
1395
bacba3c2
PE
13962013-07-12 Paul Eggert <eggert@cs.ucla.edu>
1397
1398 Fix races with threads and file descriptors.
1399 * callproc.c (Fcall_process_region):
1400 * dired.c (open_directory):
1401 * emacs.c (main, Fdaemon_initialized):
1402 * image.c (x_find_image_file):
1403 * inotify.c (Finotify_rm_watch):
1404 * lread.c (Flocate_file_internal):
1405 * process.c (Fnetwork_interface_list, Fnetwork_interface_info):
1406 * term.c (term_mouse_moveto, init_tty):
1407 * termcap.c (tgetent):
1408 * unexaix.c, unexcoff.c (report_error, report_error_1, adjust_lnnoptrs)
1409 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c (unexec):
1410 * unexhp9k800.c, unexmacosx.c (unexec):
1411 * callproc.c (Fcall_process_region):
1412 Use emacs_close, not close.
1413 * sysdep.c (POSIX_CLOSE_RESTART, posix_close) [!POSIX_CLOSE_RESTART]:
1414 New macro and function, which emulates the POSIX_CLOSE_RESTART macro
1415 and posix_close function on current platforms (which all lack them).
1416 (emacs_close): Use it. This should fix the races on GNU/Linux and
1417 on AIX and on future platforms that support POSIX_CLOSE_RESTART,
1418 and it should avoid closing random victim file descriptors on
1419 other platforms.
1420
653d4f43
PE
14212013-07-11 Paul Eggert <eggert@cs.ucla.edu>
1422
c8536ec4
PE
1423 * inotify.c (uninitialized): Remove. All uses replaced by -1.
1424 (Finotify_add_watch): Simplify, since -1 means uninitialized now.
1425 Touch up doc a bit.
1426
9c203066
PE
1427 * eval.c (backtrace_function, backtrace_args): Now EXTERNALLY_VISIBLE.
1428 This is for .gdbinit xbacktrace.
1429
653d4f43
PE
1430 * sysdep.c, term.c, termcap.c, terminal.c: Integer-related minor fixes.
1431 * sysdep.c (emacs_get_tty): Return void, since nobody uses the value.
1432 (emacs_set_tty): Now static.
1433 * sysdep.c (emacs_set_tty, tabs_safe_p, emacs_close):
1434 * term.c (tty_capable_p, tty_default_color_capabilities)
1435 (get_tty_terminal, term_mouse_movement)
1436 (handle_one_term_event, init_tty, maybe_fatal):
1437 * termcap.c (tgetst1, struct termcap_buffer, valid_filename_p)
1438 (tgetent, scan_file, name_match, compare_contin):
1439 * terminal.c (get_terminal):
1440 Use bool for boolean.
1441 * sysdep.c (init_system_name): Don't overflow stack on huge hostname.
1442 Prefer char to unsigned char if either will do.
1443 * term.c (OUTPUT, turn_on_face): Omit unnecessary casts to int.
1444 (tty_write_glyphs): Prefer int to unsigned.
1445 (produce_glyphless_glyph): Remove 2nd (unused) int arg.
1446 All callers changed.
1447 * termcap.c (tprint, main) [TEST]: Remove non-working test.
1448
45b683a1
PE
14492013-07-10 Paul Eggert <eggert@cs.ucla.edu>
1450
29abe551
PE
1451 Port to C89.
1452 * bytecode.c (BYTE_CODE_THREADED): Do not define if __STRICT_ANSI__.
1453 (B__dummy__): New dummy symbol, to pacify C89.
1454 * dbusbind.c (XD_DEBUG_MESSAGE): Omit debugging on C89 hosts, since
1455 they can't grok varargs macros.
1456 * dispnew.c (add_window_display_history)
1457 (add_frame_display_history):
1458 * print.c (print_object):
1459 * xdisp.c (debug_method_add):
1460 Use %p printf format only for void pointers.
1461 * emacs.c (usage_message): New constant, replacing ...
1462 (USAGE1, USAGE2, USAGE3): Remove; they were too long for C89.
1463 (main): Adjust to usage reorg.
1464 * fns.c (syms_of_fns):
1465 * profiler.c (syms_of_profiler):
1466 Don't use non-constant struct initializers.
1467 * gnutls.h (gnutls_initstage_t):
1468 * lisp.h (enum Lisp_Fwd_Type):
1469 * lread.c (lisp_file_lexically_bound_p):
1470 * xsettings.c (anonymous enum):
1471 Remove trailing comma.
1472 * xsettings.c (apply_xft_settings): Use %f, not %lf; %lf is a C99ism.
1473 * lisp.h (ENUM_BF): Use unsigned if pedantic.
1474 (DEFUN_FUNCTION_INIT): New macro, that falls back on a cast if pre-C99.
1475 (DEFUN): Use it.
1476 * regex.c (const_re_char): New type, to pacify strict C89.
1477 All uses of 'const re_char' replaced to use it.
1478 * regex.h (_Restrict_): Rename from __restrict, to avoid clash
1479 with glibc when strict C89. This change is imported from gnulib.
1480 All uses changed.
1481 (_Restrict_arr_): Rename from __restrict_arr, similarly.
1482 * sysdep.c (time_from_jiffies) [!HAVE_LONG_LONG_INT]:
1483 Omit GNU_LINUX implementation, since it requires long long.
1484 * xterm.c (x_draw_underwave):
1485 Do not assume the traditional order of struct's members.
1486 (x_term_init): Rewrite to avoid the need for non-constant structure
1487 initializers.
1488
45b683a1 1489 Syntax cleanup, mostly replacing macros with functions.
763a086d 1490 This removes the need for the syntax_temp hack.
45b683a1
PE
1491 * search.c: Include syntax.h after buffer.h, since syntax.h uses BVAR.
1492 * syntax.c (SYNTAX_INLINE): New macro.
1493 (SYNTAX_FLAGS_COMSTART_FIRST, SYNTAX_FLAGS_COMSTART_SECOND)
1494 (SYNTAX_FLAGS_COMEND_FIRST, SYNTAX_FLAGS_COMEND_SECOND)
1495 (SYNTAX_FLAGS_PREFIX, SYNTAX_FLAGS_COMMENT_STYLEB)
1496 (SYNTAX_FLAGS_COMMENT_STYLEC, SYNTAX_FLAGS_COMMENT_STYLEC2)
1497 (SYNTAX_FLAGS_COMMENT_NESTED, SYNTAX_FLAGS_COMMENT_STYLE)
1498 (SYNTAX_COMEND_FIRST): Now functions, not macros.
1499 (ST_COMMENT_STYLE, ST_STRING_STYLE, INTERVALS_AT_ONCE):
1500 Now constants, not macros.
1501 (syntax_temp) [!__GNUC__]: Remove.
1502 (SYNTAX_PREFIX): Remove; all uses replaced by syntax_prefix_flag_p.
1503 (syntax_prefix_flag_p): Move implementation of SYNTAX_PREFIX here.
1504 (SET_RAW_SYNTAX_ENTRY, SET_RAW_SYNTAX_ENTRY_RANGE, SYNTAX_MATCH)
1505 (SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT):
1506 Move here from syntax.h; now functions, not macros. Except for the
1507 last function, these are static since only syntax.c uses them.
1508 (syntax_multibyte): Rename from SYNTAX_WITH_MULTIBYTE_CHECK.
1509 All uses changed. Now a function, not a macro; use this fact
1510 to simplify the code.
1511 (scan_lists, scan_sexps_forward): Remove workarounds for ancient
1512 compiler bugs; no longer relevant.
1513 * syntax.h: Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1514 (SYNTAX_INLINE): New macro.
1515 (struct gl_state_s, gl_state): Move earlier, so that it's in scope
1516 for the new functions. Use bool for boolean member.
1517 (SYNTAX_ENTRY, SYNTAX, SYNTAX_WITH_FLAGS, SYNTAX_MATCH)
1518 (SYNTAX_TABLE_BYTE_TO_CHAR, UPDATE_SYNTAX_TABLE_FORWARD)
1519 (UPDATE_SYNTAX_TABLE_BACKWARD, UPDATE_SYNTAX_TABLE)
1520 (SETUP_BUFFER_SYNTAX_TABLE):
1521 Now extern inline functions, not macros.
1522 (CURRENT_SYNTAX_TABLE, SYNTAX_ENTRY_INT):
1523 Remove; all uses replaced by implementation.
1524 (syntax_temp) [!__GNUC__]: Remove decl.
1525 (SETUP_SYNTAX_TABLE_FOR_OBJECT): New decl.
1526
29be4a50
JD
15272013-07-10 Jan Djärv <jan.h.d@swipnet.se>
1528
1529 * emacs.c (main): Fix syntax error.
1530
954b166e
PE
15312013-07-10 Paul Eggert <eggert@cs.ucla.edu>
1532
1533 Timestamp fixes for undo (Bug#14824).
1534 * atimer.c (schedule_atimer):
1535 * fileio.c (Ffile_newer_than_file_p):
1536 Minor cleanup: use EMACS_TIME_LT so that we can remove EMACS_TIME_GT.
1537 * buffer.c (buffer-undo-list): Document (t . 0) and (t . -1).
1538 * fileio.c (Fclear_visited_file_modtime): Move to lisp/files.el.
1539 (syms_of_fileio): Remove Sclear_visited_file_name.
1540 (Fvisited_file_modtime): Return -1, not (-1 ...), when the visited
1541 file doesn't exist; this avoids an ambiguity with negative timestamps.
1542 (Fset_visited_file_modtime): Accept -1 and 0 as time-list arg.
1543 * systime.h (make_emacs_time, invalid_emacs_time):
1544 Don't assume struct timespec layout; POSIX doesn't guarantee it.
1545 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE): Remove.
1546 * undo.c (record_first_change): Push (visited-file-modtime) onto
1547 undo list rather than reimplementing it by hand, incorrectly.
1548
d74647c3
KB
15492013-07-09 Ken Brown <kbrown@cornell.edu>
1550
1551 * sheap.c (STATIC_HEAP_SIZE) [__x86_64__]: Increase to 18MB.
1552
3c51b96b
JB
15532013-07-09 Juanma Barranquero <lekktu@gmail.com>
1554
1555 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/sysdep.$(O)): Update.
1556
4ebbdd67
PE
15572013-07-09 Paul Eggert <eggert@cs.ucla.edu>
1558
1559 Handle errno and exit status a bit more carefully.
1560 * callproc.c (child_setup) [!DOS_NT]: Don't try to stuff an error
1561 number into an exit status. Instead, use EXIT_CANCELED.
1562 (child_setup) [!MSDOS]: Avoid possible deadlock with vfork.
1563 * callproc.c (relocate_fd):
1564 * emacs.c (close_output_streams, main):
1565 * process.c (create_process):
1566 * sysdep.c (sys_subshell) [!DOS_NT || !WINDOWSNT]:
1567 Use emacs_perror for simplicity.
1568 * callproc.c (relocate_fd, main):
1569 * sysdep.c (sys_subshell):
1570 Exit with EXIT_CANCELED etc., not 1, when exec setup fails.
1571 (shut_down_emacs): Use emacs_write, not write.
1572 * emacs.c, sysdep.c: Don't include <ignore-value.h>.
1573 * fileio.c (Fcopy_file, e_write):
1574 * nsterm.m (ns_select):
1575 * process.c (send_process):
1576 * sound.c (vox_write):
1577 Use emacs_write_sig, not emacs_write.
1578 * lisp.h (emacs_write_sig, emacs_perror): New decls.
1579 * process.h (EXIT_CANCELED), EXIT_CANNOT_INVOKE, EXIT_ENOENT):
1580 New constants.
1581 * sysdep.c (emacs_backtrace): Use emacs_write, not ignore_value
1582 of write.
1583 (emacs_full_write): New function.
1584 (emacs_write): Rewrite to use it.
1585 (emacswrite_sig, emacs_perror): New functions.
1586 * xrdb.c (fatal): Don't invoke perror, since errno might be garbage.
1587
44e18199 15882013-07-08 Magnus Henoch <magnus.henoch@gmail.com> (tiny change)
e4b1e5af
JD
1589
1590 * image.c (imagemagick_load_image): Do not use MagickExportImagePixels
1591 on NS even if it is present. Pixmap on NS is a void*.
1592
9caab067
PE
15932013-07-07 Paul Eggert <eggert@cs.ucla.edu>
1594
1595 Port to Ubuntu 10 (Bug#14803).
1596 Problem reported by T.V. Raman.
1597 * process.c (close_on_exec, accept4, process_socket):
1598 Define these if !HAVE_ACCEPT4, not if !SOCK_CLOEXEC.
1599
1d442672
EZ
16002013-07-07 Eli Zaretskii <eliz@gnu.org>
1601
1602 * w32.c (sys_dup): Declare prototype.
1603
1604 * filelock.c:
1605 * emacs.c:
1606 * callproc.c [WINDOWSNT]: Include sys/socket.h.
1607
067428c1
PE
16082013-07-07 Paul Eggert <eggert@cs.ucla.edu>
1609
1610 Make file descriptors close-on-exec when possible (Bug#14803).
1611 This simplifies Emacs a bit, since it no longer needs to worry
1612 about closing file descriptors by hand in some cases.
1613 It also fixes some unlikely races. Not all such races, as
1614 libraries often open files internally without setting
1615 close-on-exec, but it's an improvement.
1616 * alloc.c (valid_pointer_p) [!WINDOWSNT]:
1617 * callproc.c (Fcall_process) [!MSDOS]:
1618 * emacs.c (main) [!DOS_NT]:
1619 * nsterm.m (ns_term_init):
1620 * process.c (create_process):
1621 Use 'pipe2' with O_CLOEXEC instead of 'pipe'.
1622 * emacs.c (Fcall_process_region) [HAVE_MKOSTEMP]:
1623 * filelock.c (create_lock_file) [HAVE_MKOSTEMP]:
1624 Prefer mkostemp with O_CLOEXEC to mkstemp.
1625 * callproc.c (relocate_fd) [!WINDOWSNT]:
1626 * emacs.c (main): Use F_DUPFD_CLOEXEC, not plain F_DUPFD.
1627 No need to use fcntl (..., F_SETFD, FD_CLOEXEC), since we're
1628 now using pipe2.
1629 * filelock.c (create_lock_file) [! HAVE_MKOSTEMP]:
1630 Make the resulting file descriptor close-on-exec.
1631 * lisp.h, lread.c, process.c (close_load_descs, close_process_descs):
1632 * lread.c (load_descriptor_list, load_descriptor_unwind):
1633 Remove; no longer needed. All uses removed.
1634 * process.c (SOCK_CLOEXEC): Define to 0 if not supplied by system.
1635 (close_on_exec, accept4, process_socket) [!SOCK_CLOEXEC]:
1636 New functions.
1637 (socket) [!SOCK_CLOEXEC]: Supply a substitute.
1638 (Fmake_network_process, Fnetwork_interface_list):
1639 (Fnetwork_interface_info, server_accept_connection):
1640 Make newly-created socket close-on-exec.
1641 * sysdep.c (emacs_open, emacs_fopen):
1642 Make new-created descriptor close-on-exec.
1643 * w32.c (fcntl): Support F_DUPFD_CLOEXEC well enough for Emacs.
1644 * w32.c, w32.h (pipe2): Rename from 'pipe', with new flags arg.
1645
0da857dd
JD
16462013-07-07 Jan Djärv <jan.h.d@swipnet.se>
1647
1648 * nsterm.m (sendEvent:): Propagate keyboard events to modal windows
1649 for NS_IMPL_GNUSTEP.
1650
5f86adcd
PE
16512013-07-07 Paul Eggert <eggert@cs.ucla.edu>
1652
1653 Fix openp errno handling.
1654 * callproc.c (Fcall_process): Preserve openp errno around close.
1655 * lread.c (openp): Set errno when returning -1, as some callers
1656 expect this.
1657
1afb1d07
JD
16582013-07-06 Jan Djärv <jan.h.d@swipnet.se>
1659
1660 * nsterm.m (sendEvent:): Handle NSAPP_DATA2_RUNFILEDIALOG.
1661
1662 * nsterm.h (NSSavePanel): Update comment.
1663 (NSAPP_DATA2_RUNFILEDIALOG): Define.
1664 (ns_run_file_dialog): Declare.
1665
1666 * nsfns.m: Remove panelOK.
1667 (ns_fd_data): New.
1668 (ns_run_file_dialog): New function.
1669 (Fns_read_file_name): Fill in ns_fd_data, post an event and start the
1670 event loop, so file dialog is popped up by ns_run_file_dialog, called
1671 by sendEvent (Bug#14578).
1672 (EmacsSavePanel, EmacsOpenPanel): Remove ok and cancel methods.
1673
3323c263
EZ
16742013-07-06 Eli Zaretskii <eliz@gnu.org>
1675
fdda0220
EZ
1676 * xdisp.c (default_line_pixel_height): New function.
1677 (pos_visible_p, move_it_vertically_backward, try_scrolling)
1678 (try_cursor_movement, redisplay_window, try_window)
1679 (try_window_id): Use it instead of FRAME_LINE_HEIGHT. (Bug#14771)
1680
1681 * window.c (window_scroll_pixel_based): use
1682 default_line_pixel_height.
1683
1684 * dispextern.h (default_line_pixel_height): Add prototype.
1685
1686 * frame.c (x_set_line_spacing): Accept a float value for
1687 line-spacing parameter, per the documentation.
1688
3323c263
EZ
1689 * data.c (Fmultibyte_string_p): Doc fix.
1690
47ba6d43
PE
16912013-07-05 Paul Eggert <eggert@cs.ucla.edu>
1692
406af475
PE
1693 Use emacs_open more consistently when opening files.
1694 This handles EINTR more consistently now, and makes it easier
1695 to introduce other uniform changes to file descriptor handling.
1696 * src/systdio.h: New file.
1697 * src/buffer.c (mmap_init):
1698 * cygw32.c (chdir_to_default_directory):
1699 * dispnew.c (Fopen_termscript):
1700 * emacs.c (Fdaemon_initialized):
1701 * fileio.c (Fdo_auto_save):
1702 * image.c (slurp_file, png_load_body, jpeg_load_body):
1703 * keyboard.c (Fopen_dribble_file):
1704 * lread.c (Fload):
1705 * print.c (Fredirect_debugging_output):
1706 * sysdep.c (get_up_time, procfs_ttyname, procfs_get_total_memory):
1707 * termcap.c (tgetent):
1708 * unexaix.c, unexcoff.c (unexec, adjust_lnnoptrs):
1709 * unexcw.c, unexelf.c, unexhp9k800.c, unexmacosx.c (unexec):
1710 * w32term.c (w32_initialize) [CYGWIN]:
1711 * xfaces.c (Fx_load_color_file):
1712 Use emacs_open instead of plain open, and emacs_fopen instead of
1713 plain fopen.
1714 * dispnew.c, fileio.c, image.c, keyboard.c, lread.c, print.c, sysdep.c:
1715 * xfaces.c: Include sysstdio.h rather than stdio.h, for emacs_fopen.
1716 * callproc.c (default_output_mode): New constant.
1717 (Fcall_process): Use it to call emacs_open instead of plain creat.
1718 * dispnew.c (Fopen_termscript): Fix minor race in opening termscript.
1719 * sysdep.c (emacs_open): Add commentary and don't call file name "path".
1720 (emacs_fopen): New function.
1721 * unexaix.c, unexcoff.c, unexelf.c, unexhp9k800.c, unexmacosx.c:
1722 Include <lisp.h>, for emacs_open.
1723 * unexelf.c (fatal): Remove decl; not needed with <lisp.h> included.
1724
47ba6d43
PE
1725 Remove duplicate #include directives.
1726 * alloc.c [GC_MARK_STACK == GC_USE_GCPROS_CHECK_ZOMBIES]:
1727 * xfaces.c:
1728 Don't include stdio.h twice.
1729 * buffer.c [USE_MMAP_FOR_BUFFERS]:
1730 Don't include sys/types.h or stdio.h twice.
1731 * fileio.c [WINDOWSNT | MSDOS]: Don't include fcntl.h twice.
1732 * lread.c: Don't include coding.h twice.
1733 * nsfont.m: Don't include frame.h twice.
1734 * process.c [HAVE_RES_INIT]: Don't include <netinet/in.h> twice.
1735 * ralloc.c: Don't include <unistd.h> twice.
1736 * xdisp.c: Don't include font.h twice.
1737 * xterm.c: Don't include fontset.h twice.
1738 * xterm.h [USE_X_TOOLKIT]: Don't include X11/StringDefs.h twice.
1739
b9ed53d5
PE
17402013-07-04 Paul Eggert <eggert@cs.ucla.edu>
1741
1742 Scale ImageMagick images more carefully.
1743 * image.c (scale_image_size) [HAVE_IMAGEMAGICK]: New function.
1744 (compute_image_size): Use it. Define only if HAVE_IMAGEMAGICK.
1745 Be more careful about avoiding undefined behavior after
1746 integer overflow and division by zero.
1747
cf13177e
YM
17482013-07-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1749
1750 * w32fns.c (Qgeometry, Qworkarea, Qmm_size, Qframes): New variables.
1751 (syms_of_w32fns): DEFSYM them.
1752 (MONITORINFOF_PRIMARY, SM_XVIRTUALSCREEN, SM_YVIRTUALSCREEN)
1753 (CCHDEVICENAME): Define macros if not defined.
1754 (struct MONITOR_INFO_EX): New struct.
1755 (MonitorEnum_Proc, EnumDisplayMonitors_Proc): New prototypes.
1756 (enum_display_monitors_fn): New variable.
1757 (globals_of_w32fns): Initialize it.
1758 (Fx_display_pixel_width, Fx_display_pixel_height)
1759 (Fx_display_mm_height, Fx_display_mm_width): Mention behavior on
1760 multi-monitor setups in docstrings.
1761 (Fx_display_mm_height, Fx_display_mm_width): Approximate whole
1762 screen size by primary monitor's millimeter per pixel.
1763 (w32_monitor_enum, w32_display_monitor_attributes_list)
1764 (w32_display_monitor_attributes_list_fallback)
1765 (Fw32_display_monitor_attributes_list): New functions.
1766 (syms_of_w32fns): Defsubr Sw32_display_monitor_attributes_list.
1767
1768 * w32term.c (SM_CXVIRTUALSCREEN, SM_CYVIRTUALSCREEN): Define macros
1769 if not defined.
1770 (x_display_pixel_height, x_display_pixel_width): Use GetSystemMetrics.
1771
86dfb7a8
MA
17722013-07-04 Michael Albinus <michael.albinus@gmx.de>
1773
1774 * fileio.c (Qfile_notify_error): New error symbol.
1775
1776 * gfilenotify.c (Fgfile_add_watch, Fgfile_rm_watch):
1777 * inotify.c (inotify_callback, symbol_to_inotifymask)
1778 (Finotify_add_watch, Finotify_rm_watch): Use it.
1779 (inotifyevent_to_event): Exchange order of cookie and file name.
1780 (Finotify_add_watch): Adapt docstring.
1781
1782 * lisp.h (Qfile_notify_error): Declare.
1783
2c1c974b
PE
17842013-07-04 Paul Eggert <eggert@cs.ucla.edu>
1785
1786 Try again to fix FreeBSD bug re multithreaded memory alloc (Bug#14569).
1787 * emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
1788 Do not clear _malloc_thread_enabled_p, undoing the previous change,
1789 which did not work (see <http://bugs.gnu.org/14569#307>).
1790 (main): Do not invoke malloc_enable_thread if (! CANNOT_DUMP
1791 && (!noninteractive || initialized)). This attempts to thread
1792 the needle between the Scylla of FreeBSD and the Charybdis of Cygwin.
1793
7a35b20f
JB
17942013-07-04 Juanma Barranquero <lekktu@gmail.com>
1795
1796 * image.c (x_to_xcolors) [HAVE_NTGUI]: Remove unused var `hdc'.
1797 (x_build_heuristic_mask) [HAVE_NTGUI]: Remove unused var `frame_dc'.
1798
1ce5cd04
PE
17992013-07-04 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 Try to fix FreeBSD bug re multithreaded memory allocation (Bug#14569).
1802 * emacs.c (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
1803 Clear _malloc_thread_enabled_p at startup. Reported by Ashish SHUKLA in
1804 <http://lists.gnu.org/archive/html/emacs-devel/2013-07/msg00088.html>.
1805
57f8c490
PE
18062013-07-02 Paul Eggert <eggert@cs.ucla.edu>
1807
1808 * sysdep.c (sys_siglist) [HAVE_DECL___SYS_SIGLIST]:
1809 Define to __sys_siglist.
1810
bcffb5ca
EZ
18112013-07-02 Eli Zaretskii <eliz@gnu.org>
1812
1813 * xdisp.c (IT_OVERFLOW_NEWLINE_INTO_FRINGE): Don't disallow
1814 word-wrap, so that overflow-newline-into-fringe would work in
1815 visual-line-mode. (Bug#2749)
1816 (move_it_in_display_line_to): When the last scanned display
1817 element fits exactly on the display line, and
1818 overflow-newline-into-fringe is non-nil, but wrap_it is valid,
1819 don't return MOVE_NEWLINE_OR_CR, but instead back up to the last
1820 wrap point and return MOVE_LINE_CONTINUED. Fixes problems with
1821 finding buffer position that corresponds to pixel coordinates,
1822 e.g. in buffer_posn_from_coords.
1823
2c41e781
JD
18242013-07-02 Jan Djärv <jan.h.d@swipnet.se>
1825
1826 * process.c (handle_child_signal): Call catch_child_signal if
1827 NS_IMPL_GNUSTEP.
1828
c2418359
PE
18292013-07-02 Paul Eggert <eggert@cs.ucla.edu>
1830
52a9bcae
PE
1831 Don't convert function pointers to void * and back.
1832 It isn't portable C, and it's easy enough to avoid.
1833 * alloc.c: Verify SAVE_FUNCPOINTER bits, too.
1834 (make_save_value): Add support for SAVE_FUNCPOINTER.
1835 * keymap.c (map_keymap_char_table_item, map_keymap_internal):
1836 * print.c (print_object):
1837 Distinguish function from object pointers.
1838 * lisp.h (SAVE_FUNCPOINTER): New constant.
1839 (SAVE_SLOT_BITS): Adjust to it.
1840 (SAVE_TYPE_FUNCPTR_PTR_OBJ): New constant, replacing
1841 SAVE_TYPE_PTR_PTR_OBJ. Change the only use.
1842 (voidfuncptr): New typedef.
1843 (struct Lisp_Save_Value): New member data[0].funcpointer.
1844 (XSAVE_FUNCPOINTER): New function.
1845
c2418359
PE
1846 Simplify buildobj processing.
1847 * Makefile.in (buildobj.h): Make it a sequence of strings each
1848 followed by comma, rather than a single string. Put it into a
1849 .tmp file in case there's an error while generating it.
1850 (gl-stamp): Use .tmp for temp files.
1851 (mostlyclean): Clean .tmp files.
1852 * doc.c (buildobj): Move to just the routine that needs it.
1853 It's now an array of strings, so processing is simpler.
1854
8f43ce49
PE
18552013-07-01 Paul Eggert <eggert@cs.ucla.edu>
1856
1857 Fix bug re noninteractive multithreaded memory allocation (Bug#14569).
1858 * emacs.c (malloc_enable_thread): Hoist extern decl to top level.
1859 (main) [HAVE_PTHREAD && !SYSTEM_MALLOC && !DOUG_LEA_MALLOC]:
1860 Invoke malloc_enable_thread even when not interactive.
1861 Problem reported by Ken Brown in <http://bugs.gnu.org/14569#275>.
1862 * process.c (init_process_emacs) [CYGWIN]: Tickle glib even
1863 in this case, since the underlying bug has now been fixed.
1864
24827db9
JB
18652013-07-01 Juanma Barranquero <lekktu@gmail.com>
1866
1867 * emacs.c (Fkill_emacs): Expand Vauto_save_list_file_name before
1868 unlinking it (bug#14691).
1869
ef099a94
MN
18702013-06-30 Michal Nazarewicz <mina86@mina86.com>
1871
1872 * buffer.c (FKill_buffer): Run `kill-buffer-query-functions'
1873 before checking whether buffer is modified. This lets
1874 `kill-buffer-query-functions' cancel killing of the buffer or save
1875 its content before `kill-buffer' asks user the "Buffer %s
1876 modified; kill anyway?" question.
1877
9d3f2fc2
JD
18782013-06-30 Jan Djärv <jan.h.d@swipnet.se>
1879
1880 * nsfns.m (handlePanelKeys): Don't process Command+Function keys.
1881 Let the super performKeyEquivalent deal with them (Bug#14747).
1882
e6c6c8c7
PE
18832013-06-30 Paul Eggert <eggert@cs.ucla.edu>
1884
1d71c1d9
PE
1885 * widget.c (resize_cb): Remove unused local.
1886
8f5f35cc
PE
1887 Do not use GTK 3 if it exists but cannot be compiled.
1888 * xmenu.c (x_menu_wait_for_event) [!USE_GTK]:
1889 * xterm.c (x_error_handler) [!USE_GTK]:
1890 Do not use GTK 3.
1891
e6c6c8c7
PE
1892 * intervals.c (get_local_map): Actually clip POSITION (Bug#14753).
1893
0ba54312
EZ
18942013-06-30 Eli Zaretskii <eliz@gnu.org>
1895
5d1c3286
EZ
1896 * intervals.c (get_local_map): Instead of aborting, clip POSITION
1897 to the valid range of values. (Bug#14753)
1898
0ba54312
EZ
1899 * xdisp.c (Fmove_point_visually): Invalidate the cursor position
1900 when moving point by using the current glyph matrix. This avoids
1901 the need to force redisplay when this function is called in a
1902 loop.
1903
9c90cc06
PE
19042013-06-29 Paul Eggert <eggert@cs.ucla.edu>
1905
1906 Fix minor problems found by static checking.
1907 * coding.c (encode_inhibit_flag, inhibit_flag): New functions.
1908 Redo the latter's body to sidestep GCC parenthesization warnings.
1909 (setup_coding_system, detect_coding, detect_coding_system): Use them.
1910 * coding.c (detect_coding, detect_coding_system):
1911 * coding.h (struct undecided_spec):
1912 Use bool for boolean.
1913 * image.c (QCmax_width, QCmax_height): Now static.
1914 * xdisp.c (Fmove_point_visually): Remove unused local.
1915
4c672a0f
EZ
19162013-06-29 Eli Zaretskii <eliz@gnu.org>
1917
1918 * xdisp.c (Fmove_point_visually): New function.
1919
c1ea3abf
JB
19202013-06-28 Kenichi Handa <handa@gnu.org>
1921
1922 * coding.h (define_coding_undecided_arg_index): New enum.
1923 (coding_attr_index): New members
1924 coding_attr_undecided_inhibit_null_byte_detection,
1925 coding_attr_undecided_inhibit_iso_escape_detection,
1926 coding_attr_undecided_prefer_utf_8.
1927 (undecided_spec): New struct.
1928 (struct coding_system): New member `undecided' of the member
1929 `spec'.
1930
1931 * coding.c (setup_coding_system): Handle CODING->spec.undecided.
1932 (detect_coding): Likewise.
1933 (detect_coding_system): Likewise.
1934 (Fdefine_coding_system_internal): New coding system properties
1935 :inhibit-null-byte-detection, :inhibit-iso-escape-detection, and
1936 :prefer-utf-8.
1937 (syms_of_coding): Adjust for coding_arg_undecided_max.
1938
ba3de9e6
PE
19392013-06-28 Paul Eggert <eggert@cs.ucla.edu>
1940
1941 * image.c (x_from_xcolors): Remove unused local.
1942
547c9269
YM
19432013-06-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1944
1945 Defer image data transfer between X client and server until actual
1946 display happens.
1947
1948 * dispextern.h (struct image) [HAVE_X_WINDOWS]: New members `ximg'
1949 and `mask_img'.
1950
1951 * image.c (Destroy_Image): Remove.
1952 (x_clear_image_1): New arg `flags' instead of 3 bools `pixmap_p',
1953 `mask_p', and `colors_p'. All uses changed.
1954 (x_clear_image_1) [HAVE_X_WINDOWS]: Destroy `ximg' and `mask_img'.
ef099a94
MN
1955 (CLEAR_IMAGE_PIXMAP, CLEAR_IMAGE_MASK, CLEAR_IMAGE_COLORS):
1956 New macros for `flags' arg to x_clear_image_1.
547c9269
YM
1957 (postprocess_image, xpm_load_image, x_build_heuristic_mask)
1958 (png_load_body): Use x_clear_image_1 instead of Free_Pixmap.
04b66ce7 1959 (ZPixmap, XGetImage) [HAVE_NS]: Remove.
547c9269
YM
1960 (image_get_x_image_or_dc, image_unget_x_image_or_dc)
1961 (image_get_x_image, image_unget_x_image): New functions or macros.
1962 (image_background, image_background_transparent, x_to_xcolors)
1963 (x_build_heuristic_mask): Use image_get_x_image_or_dc instead of
1964 XGetImage or CreateCompatibleDC. Use image_unget_x_image_or_dc
1965 instead of Destroy_Image.
1966 (image_create_x_image_and_pixmap, image_put_x_image): New functions.
1967 (xpm_load_image, x_from_xcolors, x_build_heuristic_mask, pbm_load)
1968 (png_load_body, jpeg_load_body, tiff_load, gif_load)
1969 (imagemagick_load_image, svg_load_image): Use them instead of
1970 x_create_x_image_and_pixmap, and x_put_x_image followed by
1971 x_destroy_x_image, respectively.
1972 (xpm_load) [HAVE_XPM && !HAVE_NTGUI]: Use XpmReadFileToImage and
1973 XpmCreateImageFromBuffer instead of XpmReadFileToPixmap and
1974 XpmCreatePixmapFromBuffer. Create pixmaps. Fill background and
1975 background_transparent fields.
1976 (image_sync_to_pixmaps) [HAVE_X_WINDOWS]: New function.
1977 (prepare_image_for_display, x_disable_image) [HAVE_X_WINDOWS]: Use it.
1978
dae2f5ef
PE
19792013-06-27 Paul Eggert <eggert@cs.ucla.edu>
1980
1981 Do not tickle glib SIGCHLD handling if Cygwin (Bug#14569).
1982 This mostly consists of undoing recent changes.
1983 * callproc.c (Fcall_process):
1984 * process.c (create_process):
1985 Do not worry about catching SIGCHLD here, undoing previous change.
1986 * nsterm.m (ns_term_init): Re-catch SIGCHLD, undoing previous change.
1987 * process.c, process.h (catch_child_signal):
1988 No longer extern if !NS_IMPL_GNUSTEP, undoing 06-22 change.
1989 * process.c (catch_child_handler): Don't worry about being called
1990 lazily and do not assume caller has blocked SIGCHLD, undoing
1991 previous change. Move first-time stuff back to
1992 init_process_emacs, undoing 06-22 change. If CYGWIN, do not
1993 tickle glib, as that causes Cygwin bootstrap to fail. Do not
1994 set lib_child_handler if it's already initialized, which may
1995 help avoid problems on GNUStep.
1996
fa55d2aa
PE
19972013-06-23 Paul Eggert <eggert@cs.ucla.edu>
1998
1999 A more-conservative workaround for Cygwin SIGCHLD issues (Bug#14569).
2000 * callproc.c (Fcall_process):
2001 * process.c (create_process):
2002 Make sure SIGCHLD is caught before we fork,
2003 since Emacs startup no arranges to catch SIGCHLD.
2004 * process.c (lib_child_handler): Initialize to null, not to
2005 dummy_handler.
2006 (catch_child_signal): Allow self to be called lazily.
2007 Do nothing if it's already been called.
2008 Assume caller has blocked SIGCHLD (all callers do now).
2009 * emacs.c (main): Do not catch SIGCHLD here; defer it until
2010 just before it's really needed.
2011 * nsterm.m (ns_term_init): No need to re-catch SIGCHLD here,
2012 since it hasn't been caught yet.
2013
f3f9606c
LMI
20142013-06-23 Lars Magne Ingebrigtsen <larsi@gnus.org>
2015
2016 * image.c (compute_image_size): New function to implement
2017 :max-width and :max-height.
2018 (imagemagick_load_image): Use it.
2019
c7041908
PE
20202013-06-23 Paul Eggert <eggert@cs.ucla.edu>
2021
2022 Try to avoid malloc SEGVs on Cygwin (Bug#14569).
2023 * callproc.c, process.h (block_child_signal, unblock_child_signal):
2024 Now extern.
2025 * emacs.c (main): Catch SIGCHLD just before initializing gfilenotify.
2026 * process.c (catch_child_signal): Block SIGCHLD while futzing with
2027 the SIGCHLD handler, since the code is not atomic and (due to glib)
2028 signals may be arriving now.
2029 * sysdep.c (init_signals): Do not catch child signals here;
2030 'main' now does that later, at a safer time.
2031
f86852b4
PE
20322013-06-22 Paul Eggert <eggert@cs.ucla.edu>
2033
0dfeed58
PE
2034 Clean up SIGCHLD handling a bit (Bug#14569).
2035 * process.c, process.h (catch_child_signal):
2036 Now always extern, even if !NS_IMPL_GNUSTEP.
2037 * process.c (catch_child_signal): Move glib tickler here from
2038 init_process_emacs, so that it's done earlier in Emacs
2039 initialization. Also move the noninteractive && !initialized
2040 check here from init_process_emacs. This is all a bit cleaner for
2041 GNUish platforms, and I hope it works around the Cygwin bug.
2042 * sysdep.c (init_signals): Invoke catch_child_signal here, so
2043 that glib signal handling is tickled before glib creates threads.
2044
f86852b4
PE
2045 * process.c (wait_reading_process_output): Avoid int overflow
2046 when reading more than 2 GiB total from a process.
2047
cbd6509c
PE
20482013-06-21 Paul Eggert <eggert@cs.ucla.edu>
2049
2050 * process.c (create_process): Handle a couple more cases,
2051 i.e., work even if new_argv and wait_child_setup[i] are cached.
2052 Use Fcall_process's style for volatile vars.
2053
9de1114a
AS
20542013-06-21 Andreas Schwab <schwab@linux-m68k.org>
2055
2056 * process.c (create_process): Mark PROCESS volatile.
2057
fbe9e0b9
PE
20582013-06-21 Paul Eggert <eggert@cs.ucla.edu>
2059
2060 Use C99-style flexible array members if available.
2061 This avoids some subtle aliasing issues, which typically
2062 aren't a problem with GCC but may be a problem elsewhere.
2063 * alloc.c (sdata): New typedef, replacing the old struct sdata.
2064 It is a struct if GC_CHECK_STRING_BYTES, a union otherwise.
2065 In either case, it uses a flexible array member rather than
2066 the old struct hack. All uses changed.
2067 (SDATA_NBYTES, sweep_strings) [!GC_CHECK_STRING_BYTES]:
2068 Adjust to sdata reorganization.
2069 * alloc.c (VBLOCK_BYTES_MIN, allocate_vectorlike, Fgarbage_collect):
2070 Use offsetof (struct, flex_array_member), not sizeof (struct), as
2071 that ports better to pre-C99 non-GCC.
2072 * chartab.c (Fmake_char_table, make_sub_char_table, copy_char_table):
2073 Use CHAR_TABLE_STANDARD_SLOTS rather than its definition,
2074 as the latter has changed.
2075 * conf_post.h (FLEXIBLE_ARRAY_MEMBER): Move here from w32.c,
2076 and port better to pre-C99 GCC.
2077 * image.c (struct xpm_cached_color):
2078 * lisp.h (struct Lisp_Vector, struct Lisp_Bool_Vector)
2079 (struct Lisp_Char_Table, struct Lisp_Sub_Char_Table):
2080 Use FLEXIBLE_ARRAY_MEMBER.
2081 * lisp.h (string_bytes) [GC_CHECK_STRING_BYTES]:
2082 Move decl to top level so it gets checked against implementation.
2083 (CHAR_TABLE_STANDARD_SLOTS): Adjust to struct Lisp_Char_Table change.
2084 * w32.c (FLEXIBLE_ARRAY_MEMBER): Move to conf_post.h.
2085
1fc71008
PE
20862013-06-20 Paul Eggert <eggert@cs.ucla.edu>
2087
2088 * syntax.c: Integer cleanups.
2089 (SYNTAX_FLAGS_COMMENT_STYLEC): Return a boolean, not 0-or-2.
2090 All uses that need 0-or-2 changed to:
2091 (SYNTAX_FLAGS_COMMENT_STYLEC2): New macro, with the same semantics
2092 as the old SYNTAX_FLAGS_COMMENT_STYLEC.
2093 (struct lisp_parse_state, syntax_prefix_flag_p, update_syntax_table)
2094 (char_quoted, prev_char_comend_first, back_comment)
2095 (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
2096 (in_classes, forw_comment, scan_lists, scan_sexps_forward):
2097 Use bool for boolean.
2098 (update_syntax_table, skip_chars, skip_syntaxes):
2099 Prefer int to unsigned when either will do.
2100 (back_comment): Return boolean success flag, like forw_comment,
2101 instead of positive-or-minus-1 (which might have overflowed int anyway).
2102 Don't stuff ptrdiff_t into int.
2103 (syntax_spec_code, syntax_code_spec): Now const.
2104 (Fmatching_paren, scan_lists, scan_sexps_forward):
2105 Use enum syntaxcode for syntax code.
2106 (Fmatching_paren): Check that arg is a character, not just an integer.
2107 (Fstring_to_syntax): Don't assume 0377 fits in enum syntaxcode.
2108 (Finternal_describe_syntax_value): Omit no-longer-needed
2109 comparison to 0.
2110 (skip_chars): Use char, not unsigned char, when the distinction
2111 doesn't matter.
2112 (forw_comment, scan_lists): Prefer A |= B to A = A || B when B's cheap.
2113 * bytecode.c (exec_byte_code):
2114 * syntax.c (syntax_spec_code, Fchar_syntax)
2115 (Finternal_describe_syntax_value, skip_chars, skip_syntaxes)
2116 (init_syntax_once):
2117 * syntax.h (SYNTAX_WITH_FLAGS):
2118 Omit unnecessary casts.
2119
b932cad7
EZ
21202013-06-20 Eli Zaretskii <eliz@gnu.org>
2121
2122 * w32fns.c (w32_wnd_proc): Don't compute the header line and mode
2123 line dimensions here, to avoid race conditions with the main
2124 thread. (Bug#14062, bug#14630, bug#14669)
2125
2126 * w32term.c (w32_draw_window_cursor): Compute the header line and
2127 mode line dimensions here.
2128 <w32_system_caret_window, w32_system_caret_hdr_height>:
2129 <w32_system_caret_mode_height>: New variables.
2130
2131 * w32term.h: Declare them.
2132
89561f72
PE
21332013-06-20 Paul Eggert <eggert@cs.ucla.edu>
2134
5013fc08
PE
2135 * alloc.c (die): Move "assertion failed" string here ...
2136 * lisp.h (eassert): ... from here. Also, suppress evaluation of
2137 COND when SUPPRESS_CHECKING. This shrinks the executable text
2138 size by 0.8% to 2.2% when configured with --enable-checking,
2139 depending on optimization flags (GCC 4.8.1 x86-64).
2140
89561f72
PE
2141 * floatfns.c (Flog10): Move to Lisp (marked obsolete there).
2142
763a086d 21432013-06-20 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
89561f72
PE
2144
2145 * floatfns.c (Flog) [HAVE_LOG2]: Use log2 if available and if the
2146 base is 2; this is more accurate.
2147
983aeb9a
JB
21482013-06-19 Juanma Barranquero <lekktu@gmail.com>
2149
2150 * sound.c (string_default): Move to !WINDOWSNT section.
2151 (Fplay_sound_internal) [WINDOWSNT]: Remove i_result to avoid warning.
2152
178ba3e6
PE
21532013-06-19 Paul Eggert <eggert@cs.ucla.edu>
2154
bbc51b15
PE
2155 * sound.c: Integer cleanups.
2156 Remove unnecessary forward decls.
2157 (struct sound_device): The 'file' member is now a Lisp_Object, not
2158 a char *, so that we needn't invoke alloca on a huge size.
2159 (Fplay_sound_internal): Adjust to this.
2160 (string_default): New function.
2161 (vox_open, vox_init, alsa_open, alsa_configure, alsa_init):
2162 Use it to adjust to the struct sound_device change.
2163 (parse_sound, wav_init, au_init, alsa_init): Use bool for booleans.
2164 (be2hs) [0]: Remove.
2165
178ba3e6
PE
2166 * syntax.c (skip_chars): Don't use uninitialized storage
2167 when searching a multibyte buffer for characters that are not in a
2168 unibyte string that contains non-ASCII characters.
2169
69f60cdc
JD
21702013-06-18 Jan Djärv <jan.h.d@swipnet.se>
2171
2172 * process.c: Include xgselect.h if HAVE_GLIB. Include glib.h
2173 if HAVE_GLIB && ! WINDOWSNT (Bug#14654).
2174
0d6224d4
PE
21752013-06-18 Paul Eggert <eggert@cs.ucla.edu>
2176
2177 * conf_post.h: Add comments for INLINE, EXTERN_INLINE, etc.
2178
3c542890
KH
21792013-06-18 Kenichi Handa <handa@gnu.org>
2180
f7e3f7cd
KH
2181 * font.c (Ffont_spec): Signal an error for an invalid font name
2182 (Bug#14648).
3c542890 2183
9349e5f7
PE
21842013-06-18 Paul Eggert <eggert@cs.ucla.edu>
2185
2186 Porting fixes for merged specpdl and backtrace stacks (Bug#14643).
2187 In particular this ports to 32-bit sparc Sun cc.
2188 * eval.c (init_eval_once, grow_specpdl): Allocate a specbinding
2189 array with a dummy element at specpdl[-1], so that its address can
2190 be taken portably.
2191 (unbind_to): Do not copy the binding; not needed, now that we
2192 copy old_value in the one place where the copy is needed.
2193 * fileio.c (Fwrite_region): Use ptrdiff_t, not int, for specpdl count.
2194 * lisp.h (BITS_PER_PTRDIFF_T): Remove; no longer needed.
2195 (union specbinding): Rename from struct specbinding. Redo layout
2196 to avoid the need for 'ptrdiff_t nargs : BITS_PER_PTRDIFF_T - 1;',
2197 which is not portable. With Sun C 5.12 32-bit sparc, the
2198 declaration causes nargs to be an unsigned bitfield, a behavior
2199 that the C standard allows; but Emacs wants nargs to be signed.
2200 The overall type is now a union of structures rather than a
2201 structure of union of structures, and the 'kind' member is now a
2202 bitfield, so that the overall type doesn't grow. All uses changed.
2203 * process.c (Fmake_serial_process): Remove unnecessary initialization.
2204
0a4df6a5
PE
22052013-06-17 Paul Eggert <eggert@cs.ucla.edu>
2206
ec6ecaad
PE
2207 * frame.c (x_report_frame_params): Cast parent_desc to uintptr_t.
2208 Needed if HAVE_NTGUI. Reported by Juanma Barranquero.
2209
0a4df6a5
PE
2210 * nsfont.m (ns_registry_to_script): Parenthesize while expression.
2211
7bfe8dbc
EZ
22122013-06-17 Eli Zaretskii <eliz@gnu.org>
2213
2214 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
2215 unless we know that the window w's frame is a frame object.
2216 Another attempt at solving bug#14062 and bug#14630.
2217
708e05f6
LMI
22182013-06-17 Lars Magne Ingebrigtsen <larsi@gnus.org>
2219
2220 * textprop.c (property_set_type): New enum.
2221 (add_properties): Allow appending/prepending text properties.
2222 (add_text_properties_1): Factored out of Fadd_text_properties.
ef099a94 2223 (Fadd_text_properties): Move all the code into
708e05f6
LMI
2224 add_text_properties_1.
2225 (Fadd_face_text_property): New function that calls
2226 add_text_properties_1.
2227
84575e67
PE
22282013-06-17 Paul Eggert <eggert@cs.ucla.edu>
2229
2230 Move functions from lisp.h to individual modules when possible.
2231 From a suggestion by Andreas Schwab in <http://bugs.gnu.org/11935#68>.
2232 * alloc.c (XFLOAT_INIT, set_symbol_name):
2233 * buffer.c (CHECK_OVERLAY):
2234 * chartab.c (CHECK_CHAR_TABLE, set_char_table_ascii)
2235 (set_char_table_parent):
2236 * coding.c (CHECK_NATNUM_CAR, CHECK_NATNUM_CDR):
2237 * data.c (BOOLFWDP, INTFWDP, KBOARD_OBJFWDP, OBJFWDP, XBOOLFWD)
2238 (XKBOARD_OBJFWD, XINTFWD, XOBJFWD, CHECK_SUBR, set_blv_found)
2239 (blv_value, set_blv_value, set_blv_where, set_blv_defcell)
2240 (set_blv_valcell):
2241 * emacs.c (setlocale) [!HAVE_SETLOCALE]:
2242 * eval.c (specpdl_symbol, specpdl_old_value, specpdl_where)
2243 (specpdl_arg, specpdl_func, backtrace_function, backtrace_nargs)
2244 (backtrace_args, backtrace_debug_on_exit):
2245 * floatfns.c (CHECK_FLOAT):
2246 * fns.c (CHECK_HASH_TABLE, CHECK_LIST_END)
2247 (set_hash_key_and_value, set_hash_next, set_hash_next_slot)
2248 (set_hash_hash, set_hash_hash_slot, set_hash_index)
2249 (set_hash_index_slot):
2250 * keymap.c (CHECK_VECTOR_OR_CHAR_TABLE):
2251 * marker.c (CHECK_MARKER):
2252 * textprop.c (CHECK_STRING_OR_BUFFER):
2253 * window.c (CHECK_WINDOW_CONFIGURATION):
2254 Move here from lisp.h, and make these functions static rather than
2255 extern inline.
2256 * buffer.c (Qoverlayp):
2257 * data.c (Qsubrp):
2258 * fns.c (Qhash_table_p):
2259 * window.c (Qwindow_configuration_p):
2260 Now static.
2261 * lisp.h: Remove the abovementioned defns and decls.
2262
44e18199 2263 Use functions, not macros, for XINT etc (Bug#11935).
84575e67
PE
2264 In lisp.h, prefer functions to function-like macros, and
2265 constants to object-like macros, when either will do. This:
2266 . simplifies use, as there's no more need to worry about
2267 arguments' side effects being evaluated multiple times.
2268 . makes the code easier to debug on some platforms.
2269 However, when using gcc -O0, keep using function-like macros
2270 for a few critical operations, for performance reasons.
2271 This sort of thing isn't needed with gcc -Og, but -Og
2272 is a GCC 4.8 feature and isn't widely-enough available yet.
2273 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]:
2274 Remove enum lsb_bits; no longer needed.
2275 (allocate_misc, free_misc): Don't use XMISCTYPE as an lvalue.
2276 * buffer.c (Qoverlap):
2277 * data.c (Qsubrp):
2278 * fns.c (Qhash_table_p):
2279 Now extern, so lisp.h can use these symbols.
2280 * dispextern.h: Include character.h, for MAX_CHAR etc.
2281 (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
2282 (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
2283 (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
2284 (GLYPH_CODE_P): Move here from lisp.h.
2285 (GLYPH_CHAR, GLYPH_FACE, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
2286 (GLYPH_CHAR_VALID_P, GLYPH_CODE_P): Now functions, not macros.
2287 (GLYPH_MODE_LINE_FACE): Now enums, not macros.
2288 * eval.c (Fautoload): Cast XUNTAG output to intptr_t, since
2289 XUNTAG now returns void *.
2290 * lisp.h (lisp_h_XLI, lisp_h_XIL, lisp_h_CHECK_LIST_CONS)
2291 (lisp_h_CHECK_NUMBER CHECK_SYMBOL, lisp_h_CHECK_TYPE)
2292 (lisp_h_CONSP, lisp_h_EQ, lisp_h_FLOATP, lisp_h_INTEGERP)
2293 (lisp_h_MARKERP, lisp_h_MISCP, lisp_h_NILP)
2294 (lisp_h_SET_SYMBOL_VAL, lisp_h_SYMBOL_CONSTANT_P)
2295 (lisp_h_SYMBOL_VAL, lisp_h_SYMBOLP, lisp_h_VECTORLIKEP)
2296 (lisp_h_XCAR, lisp_h_XCDR, lisp_h_XCONS, lisp_h_XHASH)
2297 (lisp_h_XPNTR, lisp_h_XSYMBOL):
2298 New macros, renamed from their sans-lisp_h_ counterparts.
2299 (XLI, XIL, CHECK_LIST_CONS, CHECK_NUMBER CHECK_SYMBOL)
2300 (CHECK_TYPE, CONSP, EQ, FLOATP, INTEGERP, MARKERP)
2301 (MISCP, NILP, SET_SYMBOL_VAL, SYMBOL_CONSTANT_P, SYMBOL_VAL, SYMBOLP)
2302 (VECTORLIKEP, XCAR, XCDR, XCONS, XHASH, XPNTR, XSYMBOL):
2303 If compiling via GCC without optimization, define these as macros
2304 in addition to inline functions.
2305 To disable this, compile with -DINLINING=0.
2306 (LISP_MACRO_DEFUN, LISP_MACRO_DEFUN_VOID): New macros.
2307 (check_cons_list) [!GC_CHECK_CONS_LIST]: Likewise.
2308 (make_number, XFASTINT, XINT, XTYPE, XUNTAG): Likewise, but
2309 hand-optimize only in the USE_LSB_TAG case, as GNUish hosts do that.
2310 (INTMASK, VALMASK): Now macros, since static values cannot be
2311 accessed from extern inline functions.
2312 (VALMASK): Also a constant, for benefit of old GDB.
2313 (LISP_INT_TAG_P): Remove; no longer needed as the only caller
2314 is INTEGERP, which can fold it in.
5165d44a 2315 (XLI, XIL, XHASH, XTYPE, XINT, XFASTINT, XUINT)
84575e67
PE
2316 (make_number, XPNTR, XUNTAG, EQ, XCONS, XVECTOR, XSTRING, XSYMBOL)
2317 (XFLOAT, XPROCESS, XWINDOW, XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE)
2318 (XSUB_CHAR_TABLE, XBOOL_VECTOR, make_lisp_ptr, CHECK_TYPE)
2319 (CHECK_STRING_OR_BUFFER, XCAR, XCDR, XSETCAR, XSETCDR, CAR, CDR)
2320 (CAR_SAFE, CDR_SAFE, STRING_MULTIBYTE, SDATA, SSDATA, SREF, SSET)
2321 (SCHARS, STRING_BYTES, SBYTES, STRING_SET_CHARS, STRING_COPYIN, AREF)
2322 (ASIZE, ASET, CHAR_TABLE_REF_ASCII, CHAR_TABLE_REF)
2323 (CHAR_TABLE_SET, CHAR_TABLE_EXTRA_SLOTS, SYMBOL_VAL, SYMBOL_ALIAS)
2324 (SYMBOL_BLV, SYMBOL_FWD, SET_SYMBOL_VAL, SET_SYMBOL_ALIAS)
2325 (SET_SYMBOL_BLV, SET_SYMBOL_FWD, SYMBOL_NAME, SYMBOL_INTERNED_P)
2326 (SYMBOL_INTERNED_IN_INITIAL_OBARRAY_P, SYMBOL_CONSTANT_P)
2327 (XHASH_TABLE, HASH_TABLE_P, CHECK_HASH_TABLE, HASH_KEY, HASH_VALUE)
2328 (HASH_NEXT, HASH_HASH, HASH_INDEX, HASH_TABLE_SIZE)
2329 (XMISC, XMISCANY, XMARKER, XOVERLAY, XSAVE_VALUE, XFWDTYPE)
2330 (XINTFWD, XBOOLFWD, XOBJFWD, XBUFFER_OBJFWD, XKBOARD_OBJFWD)
2331 (XFLOAT_DATA, XFLOAT_INIT, NILP, NUMBERP, NATNUMP)
2332 (RANGED_INTEGERP, CONSP, FLOATP, MISCP, STRINGP, SYMBOLP)
2333 (INTEGERP, VECTORLIKEP, VECTORP, OVERLAYP)
2334 (MARKERP, SAVE_VALUEP, AUTOLOADP, INTFWDP, BOOLFWDP, OBJFWDP)
2335 (BUFFER_OBJFWDP, KBOARD_OBJFWDP, PSEUDOVECTOR_TYPEP)
2336 (PSEUDOVECTORP, WINDOW_CONFIGURATIONP, PROCESSP, WINDOWP)
2337 (TERMINALP, SUBRP, COMPILEDP, BUFFERP, CHAR_TABLE_P)
2338 (SUB_CHAR_TABLE_P, BOOL_VECTOR_P, FRAMEP, IMAGEP, ARRAYP)
2339 (CHECK_LIST, CHECK_LIST_CONS, CHECK_LIST_END, CHECK_STRING)
2340 (CHECK_STRING_CAR, CHECK_CONS, CHECK_SYMBOL, CHECK_CHAR_TABLE)
2341 (CHECK_VECTOR, CHECK_VECTOR_OR_STRING, CHECK_ARRAY)
2342 (CHECK_VECTOR_OR_CHAR_TABLE, CHECK_BUFFER, CHECK_WINDOW)
2343 (CHECK_WINDOW_CONFIGURATION, CHECK_PROCESS, CHECK_SUBR)
2344 (CHECK_NUMBER, CHECK_NATNUM, CHECK_MARKER, XFLOATINT)
2345 (CHECK_FLOAT, CHECK_NUMBER_OR_FLOAT, CHECK_OVERLAY)
2346 (CHECK_NUMBER_CAR, CHECK_NUMBER_CDR, CHECK_NATNUM_CAR)
2347 (CHECK_NATNUM_CDR, FUNCTIONP, SPECPDL_INDEX, LOADHIST_ATTACH)
2348 Now functions.
2349 (check_cons_list) [!GC_CHECK_CONS_LIST]: New empty function.
2350 (LISP_MAKE_RVALUE, TYPEMASK): Remove; no longer needed.
2351 (VALMASK): Define in one place rather than in two, merging the
2352 USE_LSB_TAG parts; this is simpler.
2353 (aref_addr, gc_aset, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM)
2354 (max, min, struct Lisp_String, UNSIGNED_CMP, ASCII_CHAR_P):
2355 Move up, to avoid use before definition.
2356 Also include "globals.h" earlier, for the same reason.
2357 (make_natnum): New function.
2358 (XUNTAG): Now returns void *, not intptr_t, as this means fewer casts.
2359 (union Lisp_Fwd, BOOLFWDP, BOOL_VECTOR_P, BUFFER_OBJFWDP, BUFFERP)
2360 (CHAR_TABLE_P, CHAR_TABLE_REF_ASCII, CONSP, FLOATP, INTEGERP, INTFWDP)
2361 (KBOARD_OBJFWDP, MARKERP, MISCP, NILP, OBJFWDP, OVERLAYP, PROCESSP)
2362 (PSEUDOVECTORP, SAVE_VALUEP, STRINGP, SUB_CHAR_TABLE_P, SUBRP, SYMBOLP)
2363 (VECTORLIKEP, WINDOWP, Qoverlayp, char_table_ref, char_table_set)
2364 (char_table_translate, Qarrayp, Qbufferp, Qbuffer_or_string_p)
2365 (Qchar_table_p, Qconsp, Qfloatp, Qintegerp, Qlambda, Qlistp, Qmarkerp)
2366 (Qnil, Qnumberp, Qsubrp, Qstringp, Qsymbolp, Qvectorp)
2367 (Qvector_or_char_table_p, Qwholenump, Ffboundp, wrong_type_argument)
2368 (initialized, Qhash_table_p, extract_float, Qprocessp, Qwindowp)
2369 (Qwindow_configuration_p, Qimage): New forward declarations.
2370 (XSETFASTINT): Simplify by rewriting in terms of make_natnum.
2371 (STRING_COPYIN): Remove; unused.
2372 (XCAR_AS_LVALUE, XCDR_AS_LVALUE): Remove these macros, replacing with ...
2373 (xcar_addr, xcdr_addr): New functions. All uses changed.
2374 (IEEE_FLOATING_POINT): Now a constant, not a macro.
2375 (GLYPH, GLYPH_CHAR, GLYPH_FACE, SET_GLYPH_CHAR, SET_GLYPH_FACE)
2376 (SET_GLYPH, GLYPH_CODE_CHAR, GLYPH_CODE_FACE)
2377 (SET_GLYPH_FROM_GLYPH_CODE, GLYPH_MODE_LINE_FACE, GLYPH_CHAR_VALID_P)
2378 (GLYPH_CODE_P): Move to dispextern.h, to avoid define-before-use.
2379 (TYPE_RANGED_INTEGERP): Simplify.
2380 (Qsubrp, Qhash_table_p, Qoverlayp): New extern decls.
2381 (setlocale, fixup_locale, synchronize_system_messages_locale)
2382 (synchronize_system_time_locale) [!HAVE_SETLOCALE]:
2383 Now empty functions, not macros.
2384 (functionp): Return bool, not int.
2385 * window.c (Qwindow_configuration_p): Now extern,
2386 so window.h can use it.
2387 * window.h (Qwindowp): Move decl back to lisp.h.
2388
9583ec36
EZ
23892013-06-15 Eli Zaretskii <eliz@gnu.org>
2390
2391 * xdisp.c (Fline_pixel_height): New function, required for solving
2392 bug #14567.
2393
210272ce
PE
23942013-06-15 Paul Eggert <eggert@cs.ucla.edu>
2395
2396 * fns.c (Fcopy_sequence): Simplify XTYPE calculation.
2397
de0503df
SM
23982013-06-13 Stefan Monnier <monnier@iro.umontreal.ca>
2399
2400 * lread.c (syms_of_lread):
2401 * fns.c (Fprovide): Adjust to new format of after-load-alist.
2402
afbfe143
KD
24032013-06-13 Kelly Dean <kellydeanch@yahoo.com> (tiny change)
2404
2405 * fileio.c (Fdo_auto_save): Trap errors in auto-save-hook. (Bug#14479)
2406
d177e213
XF
24072013-06-12 Xue Fuqiao <xfq.free@gmail.com>
2408
2409 * fileio.c (expand_file_name): Doc fix.
2410
05e3e412
PE
24112013-06-11 Paul Eggert <eggert@cs.ucla.edu>
2412
f7394b12
PE
2413 Tickle glib by waiting for Emacs itself, not for process 0 (Bug#14569).
2414 * process.c (init_process_emacs) [HAVE_GLIB && !WINDOWSNT]:
2415 Wait for self, not for 0. This can't hurt on GNU or similar
2416 system, and may help with Cygwin.
2417
05e3e412
PE
2418 * keyboard.c: Don't use PROP (...) as an lvalue.
2419 (parse_tool_bar_item) [!USE_GTK && !HAVE_NS]:
2420 Use set_prop (A, B), not PROP (A) = B.
2421
17dd3097
EZ
24222013-06-10 Eli Zaretskii <eliz@gnu.org>
2423
2424 * xdisp.c (get_it_property): Use it->window instead of generating
2425 a Lisp object from it->w.
2426
52fab9c9
EZ
24272013-06-09 Eli Zaretskii <eliz@gnu.org>
2428
2429 * xdisp.c (get_it_property): If it->object is a buffer, pass to
2430 get-char-property the window that is being rendered, instead of
2431 the buffer, to support window-specific overlays. (Bug#14575)
ad257d4f
EZ
2432 (compute_display_string_pos): When W is NULL, use the current
2433 buffer as the object to pass to get-char-property.
2434 (Fcurrent_bidi_paragraph_direction): Assign NULL to the window
2435 pointer member of the bidi iterator, since no window is pertinent
2436 to this function.
52fab9c9 2437
5bf97bfc
EZ
24382013-06-08 Eli Zaretskii <eliz@gnu.org>
2439
2440 * bidi.c (bidi_fetch_char): Accept additional argument, the window
2441 being displayed, and pass it to compute_display_string_pos.
2442 (bidi_level_of_next_char, bidi_resolve_explicit_1)
2443 (bidi_paragraph_init): All callers changed.
2444
2445 * xdisp.c (init_from_display_pos, init_iterator)
2446 (handle_single_display_spec, next_overlay_string)
2447 (get_overlay_strings_1, reseat_1, reseat_to_string)
e7b41c4c
JB
2448 (push_prefix_prop, Fcurrent_bidi_paragraph_direction):
2449 Set bidi_it.w member from it->w.
5bf97bfc
EZ
2450 (compute_display_string_pos): Accept additional argument, the
2451 window being displayed, and pass it to Fget_char_property.
2452 (Bug#14575)
2453
2454 * dispextern.h (struct bidi_it): New member w, the window being
2455 displayed.
2456 (compute_display_string_pos): Adjust prototype.
2457
5de0e011
JD
24582013-06-08 Jan Djärv <jan.h.d@swipnet.se>
2459
e7b41c4c 2460 * xgselect.c: Remove unneeded include xterm.h.
b33f93ee
JD
2461
2462 * process.c (wait_reading_process_output): Check for NS before GLIB.
2463 GLIB may be linked in due to rsvg, but ns_select must be called.
2464
5de0e011
JD
2465 * xgselect.c (xg_select): Remove call to window_system_available
2466 and g_main_context_pending at the top, so Gdk events (i.e. file
2467 notify) are processed when Emacs is started with -nw.
2468
a822acff
EZ
24692013-06-07 Eli Zaretskii <eliz@gnu.org>
2470
2471 * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files.
2472 (ctagsfiles3): New variable, includes only *.m files.
2473 (TAGS): Use an explicit language name in the regular expressions,
2474 to avoid transformation of '/SOMETHING' by MSYS to
2475 'c:\MSYS\SOMETHING'.
2476
6c0a9ed1
RC
24772013-06-07 Richard Copley <rcopley@gmail.com> (tiny change)
2478
2479 * epaths.in: Fix commentary to PATH_SITELOADSEARCH.
2480
9ef6111b
EZ
24812013-06-06 Eli Zaretskii <eliz@gnu.org>
2482
2483 * xdisp.c (note_mouse_highlight): When mouse-highlight is off,
2484 still need to set the mouse pointer shape and activate help-echo.
2485 (Bug#14558)
2486
7d300d64
PE
24872013-06-06 Paul Eggert <eggert@cs.ucla.edu>
2488
2489 A few porting etc. fixes for the new file monitor code.
2490 See the thread containing
2491 <http://lists.gnu.org/archive/html/emacs-devel/2013-06/msg00109.html>.
2492 * gfilenotify.c (dir_monitor_callback, Fgfile_add_watch)
2493 (Fgfile_rm_watch): Don't assume EMACS_INT is the same width as a pointer.
2494 (dir_monitor_callback, Fgfile_rm_watch):
2495 Use assq_no_quit instead of Fassoc, for speed.
2496 (dir_monitor_callback, Fgfile_rm_watch):
2497 eassert that the monitor is a fixnum.
2498 (dir_monitor_callback): No need for CDR_SAFE.
2499 Simplify building of lisp with alternative tails.
2500 (Fgfile_add_watch, Fgfile_rm_watch):
2501 Do not assume glib functions set errno reliably on failure.
2502 (Fgfile_add_watch): Check that the monitor survives the XIL trick,
2503 and signal an error otherwise.
2504 (Fgfile_rm_watch): Prefer CONSP to !NILP.
2505 Use Fdelq instead of Fdelete, for speed.
2506
817ebfcf
EZ
25072013-06-05 Eli Zaretskii <eliz@gnu.org>
2508
2509 * xdisp.c (handle_tool_bar_click): When mouse-highlight is off,
2510 don't insist on being invoked on a highlighted tool-bar button.
2511 Avoids losing tool-bar functionality when mouse-highlight is nil.
2512 (note_tool_bar_highlight, note_mode_line_or_margin_highlight):
2513 Don't highlight when mouse-highlight is nil.
2514 (note_mouse_highlight): When mouse-highlight is nil, don't return
2515 right away; instead, run tool-bar and mode-line highlight
2516 subroutine, clear any existing highlight, and revert the mouse
2517 pointer to its default shape. (Bug#14558)
2518
55577e7c
SM
25192013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
2520
2521 * lisp.mk (lisp): Add prog-mode.el.
2522
f019a684
PE
25232013-06-05 Paul Eggert <eggert@cs.ucla.edu>
2524
2525 Chain glib's SIGCHLD handler from Emacs's (Bug#14474).
2526 * process.c (dummy_handler): New function.
2527 (lib_child_handler): New static var.
2528 (handle_child_signal): Invoke it.
2529 (catch_child_signal): If a library has set up a signal handler,
2530 save it into lib_child_handler.
2531 (init_process_emacs): If using glib and not on Windows, tickle glib's
2532 child-handling code so that it initializes its private SIGCHLD handler.
2533 * syssignal.h (SA_SIGINFO): Default to 0.
2534 * xterm.c (x_term_init): Remove D-bus hack that I installed on May
2535 31; it should no longer be needed now.
2536
90db8702
MA
25372013-06-05 Michael Albinus <michael.albinus@gmx.de>
2538
2539 * emacs.c (main) [HAVE_GFILENOTIFY]: Call globals_of_gfilenotify.
2540
2541 * gfilenotify.c (globals_of_gfilenotify): New function.
2542 (syms_of_gfilenotify): Move global initialization there.
2543
2544 * lisp.h (globals_of_gfilenotify) [HAVE_GFILENOTIFY]: Add prototype.
2545
bfa3acd6
SM
25462013-06-05 Stefan Monnier <monnier@iro.umontreal.ca>
2547
2548 * keymap.c (Fcurrent_active_maps, Fdescribe_buffer_bindings):
2549 * keyboard.c (menu_bar_items, tool_bar_items):
2550 * doc.c (Fsubstitute_command_keys): Voverriding_terminal_local_map does
2551 not override local keymaps any more.
2552
ba59bd80
EZ
25532013-06-04 Eli Zaretskii <eliz@gnu.org>
2554
2555 * window.c (Fpos_visible_in_window_p): Doc fix. (Bug#14540)
2556
7f203aa1
EZ
25572013-06-03 Eli Zaretskii <eliz@gnu.org>
2558
9337e206
EZ
2559 * w32console.c (initialize_w32_display): Return the dimensions of
2560 the console window via 2 additional arguments, not via the current
2561 frame. This avoids crashes due to overrunning the bounds of
2562 frame's decode_mode_spec_buffer, which is not resized following
2563 the change of the frame dimensions from the initial 10x10.
2564
2565 * w32term.h (w32_initialize_display_info): Adjust prototype.
2566
2567 * term.c (init_tty): Take dimensions of the frame from the values
2568 returned by initialize_w32_display.
2569
7f203aa1
EZ
2570 * Makefile.in (GFILENOTIFY_CFLAGS, GFILENOTIFY_LIBS): New variables.
2571 (ALL_CFLAGS): Add $(GFILENOTIFY_CFLAGS).
2572 (LIBES): Add $(GFILENOTIFY_LIBS).
2573
2574 * w32inevt.c (handle_file_notifications): Add dummy implementation
2575 for !HAVE_W32NOTIFY.
2576
2577 * w32term.c: Wrap code with HAVE_W32NOTIFY.
2578
55a87246
JD
25792013-06-03 Jan Djärv <jan.h.d@swipnet.se>
2580
2581 * xgselect.c: Replace #if defined ... with #ifdef HAVE_GLIB.
2582
2583 * process.c (wait_reading_process_output): Call xg_select if HAVE_GLIB.
2584
2585 * Makefile.in (XGSELOBJ): New, xgselect.o if GLib is used, or empty.
2586
3d5ee10a
PE
25872013-06-03 Paul Eggert <eggert@cs.ucla.edu>
2588
2589 Fix minor problems found by static checking.
2590 * data.c (pure_write_error):
2591 Use xsignal2, not Fsignal, as Fsignal might return.
2592 * eval.c (set_backtrace_debug_on_exit): Now static.
2593 (backtrace_p, backtrace_top, backtrace_next, record_in_backtrace):
2594 No longer inline. EXTERN_INLINE is needed only for functions
2595 defined in .h files. Reindent function header as per GNU style.
2596 (backtrace_p, backtrace_top, backtrace_next):
2597 Mark EXTERNALLY_VISIBLE so they don't get optimized away by the
2598 compiler or linker. Add extern decls to pacify gcc -Wall.
2599 * frame.c, frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
2600 Now static.
2601 * frame.c (free_monitors): Define only on platforms that need it.
2602 * nsterm.m (ns_term_init):
2603 * process.c (catch_child_signal):
2604 Don't worry about whether SIGCHLD is defined, as SIGCHLD is
2605 defined on all porting targets these days.
2606 * process.c, process.h (catch_child_signal):
2607 Make it extern only if NS_IMPL_GNUSTEP is defined.
2608
e2d8a6f0
EZ
26092013-06-03 Eli Zaretskii <eliz@gnu.org>
2610
2611 * w32.c (gettimeofday): Make the signature identical to prototype
2612 in nt/inc/sys/time.h.
2613
a8a7c5f6
SM
26142013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
2615
2616 * eval.c (backtrace_p, backtrace_top, backtrace_next): Export them to
2617 .gdbinit.
2618
2619 * keyboard.c (safe_run_hooks_error): Improve error message.
2620
2621 * data.c (pure_write_error): Add `object' argument.
2622 * puresize.h (CHECK_IMPURE): Use it.
2623
c9628c79
MA
26242013-06-03 Michael Albinus <michael.albinus@gmx.de>
2625
2626 * Makefile.in (NOTIFY_OBJ): New variable.
2627 (base_obj): Replace inotify.o by $(NOTIFY_OBJ).
2628
2629 * emacs.c (main): Use HAVE_W32NOTIFY to wrap respective code.
2630 Call syms_of_gfilenotify.
2631
2632 * gfilenotify.c: New file.
2633
2634 * keyboard.c (Qfile_notify): New variable. Replaces Qfile_inotify
2635 and Qfile_w32notify.
2636 (top): Wrap respective code by HAVE_GFILENOTIFY, HAVE_INOTIFY,
2637 HAVE_W32NOTIFY and USE_FILE_NOTIFY.
2638
2639 * lisp.h: Declare syms_of_gfilenotify.
2640
2641 * termhooks.h (e): Wrap enum by USE_FILE_NOTIFY.
2642
2f592f95
SM
26432013-06-03 Stefan Monnier <monnier@iro.umontreal.ca>
2644
2645 Merge the specpdl and backtrace stacks. Make the structure of the
2646 specpdl entries more obvious via a tagged union of structs.
2647 * lisp.h (BITS_PER_PTRDIFF_T): New constant.
2648 (enum specbind_tag): New enum.
2649 (struct specbinding): Make it a tagged union of structs.
2650 Add a case for backtrace records.
2651 (specpdl_symbol, specpdl_old_value, specpdl_where, specpdl_arg)
2652 (specpdl_func, backtrace_function, backtrace_nargs, backtrace_args)
2653 (backtrace_debug_on_exit): New accessors.
2654 (struct backtrace): Remove.
2655 (struct catchtag): Remove backlist field.
2656 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
2657 Move to eval.c.
2658 (Flocal_variable_p): Speed up the common case where the binding is
2659 already loaded.
2660 * eval.c (backtrace_list): Remove.
2661 (set_specpdl_symbol, set_specpdl_old_value): Remove.
2662 (set_backtrace_args, set_backtrace_nargs)
2663 (set_backtrace_debug_on_exit, backtrace_p, backtrace_top)
2664 (backtrace_next): New functions.
2665 (Fdefvaralias, Fdefvar): Adjust to new specpdl format.
2666 (unwind_to_catch, internal_lisp_condition_case)
2667 (internal_condition_case, internal_condition_case_1)
2668 (internal_condition_case_2, internal_condition_case_n): Don't bother
2669 with backtrace_list any more.
2670 (Fsignal): Adjust to new backtrace format.
2671 (grow_specpdl): Move up.
2672 (record_in_backtrace): New function.
2673 (eval_sub, Ffuncall): Use it.
2674 (apply_lambda): Adjust to new backtrace format.
2675 (let_shadows_buffer_binding_p, let_shadows_global_binding_p): Move from
2676 data.c.
2677 (specbind): Adjust to new specpdl format. Simplify.
2678 (record_unwind_protect, unbind_to): Adjust to new specpdl format.
2679 (Fbacktrace_debug, Fbacktrace, Fbacktrace_frame): Adjust to new
2680 backtrace format.
2681 (mark_backtrace): Remove.
2682 (mark_specpdl, get_backtrace, backtrace_top_function): New functions.
2683 * xdisp.c (redisplay_internal): Use record_in_backtrace.
2684 * alloc.c (Fgarbage_collect): Use record_in_backtrace.
2685 Use mark_specpdl.
2686 * profiler.c (record_backtrace): Use get_backtrace.
2687 (handle_profiler_signal): Use backtrace_top_function.
2688 * .gdbinit (xbacktrace, hookpost-backtrace): Use new backtrace
2689 accessor functions.
2690
c0342369
JD
26912013-06-02 Jan Djärv <jan.h.d@swipnet.se>
2692
2693 * process.h (catch_child_signal): Declare.
2694
2695 * process.c (catch_child_signal): New function.
2696 (init_process_emacs): Call it.
2697
2698 * nsterm.m: Include process.h if NS_IMPL_GNUSTEP.
2699 (ns_menu_bar_is_hidden, menu_will_open_state): Define only if
2700 NS_IMPL_COCOA.
2701 (x_set_cursor_type): Remove declaration.
2702 (ns_update_begin): Only use r and bp if NS_IMPL_COCOA.
2703 (ns_update_end, ns_focus, ns_unfocus): Remove GNUStep specific code.
2704 (x_set_window_size): Remove 3 pixels from toolbar if NS_IMPL_GNUSTEP.
2705 (ns_get_color): Use F suffix on float.
2706 (ns_color_to_lisp, ns_query_color): Use EmacsCGFloat.
2707 (ns_get_rgb_color): Remove.
2708 (x_set_frame_alpha): Move view inside NS_IMPL_COCOA.
2709 (note_mouse_movement): x and y are CGFloat.
2710 (ns_draw_fringe_bitmap): Remove unused rowY.
2711 Change #if to COCOA && >= 10_6.
2712 (ns_draw_window_cursor): Remove unused overspill.
2713 (ns_draw_underwave): width and x are EamcsCGFloat.
2714 (ns_draw_box): thickness is CGFloat.
2715 (ns_dumpglyphs_image): Change #if to COCOA && >= 10_6.
2716 (ns_send_appdefined): When NS_IMPL_GNUSTEP, redirect to main thread
2717 if not in main thread.
2718 (ns_get_pending_menu_title, ns_check_menu_open)
2719 (ns_check_pending_open_menu): Put inside #if COCOA && >= 10_5.
2720 (ns_term_init): Call catch_child_signal if NS_IMPL_GNUSTEP && SIGCHLD.
2721 (sendFromMainThread:): New method.
2722 (changeFont:): size is CGFloat.
2723 (keyDown:): Check for Delete when NS_IMPL_GNUSTEP.
2724 Disable warning about permanent text.
2725 (characterIndexForPoint:): Adjust return type depending on GNUStep
2726 version.
2727 (mouseDown:): delta is CGFloat.
2728 (updateFrameSize): Remove unised variable f.
2729 (initFrameFromEmacs): Move toggleButton inside NS_IMPL_COCOA.
2730 Cast float to EmacsCGFloat.
2731 (windowWillUseStandardFrame:defaultFrame:): Set maximized_height
2732 also to -1 when restoring.
2733 (windowDidExitFullScreen:): Put call to updateCollectionBehaviour
2734 inside NS_IMPL_COCOA.
2735 (toggleFullScreen:): Put call to toggleFullScreen inside
2736 NS_IMPL_COCOA. Cast float to EmacsCGFloat.
2737 (setPosition:portion:whole:): por is CGFloat.
2738 (getMouseMotionPart:window:x:y:): Add F suffix to float.
2739 (mouseDown:): Use CGFloat.
2740 (mouseDragged:): Remove unised variable edge.
2741 (EmacsDocument): Implement for NS_IMPL_GNUSTEP.
2742
2743 * nsterm.h (EmacsCGFloat): Typedef for OSX and GNUStep when the size
2744 of CGFloat differs.
2745 (EmacsApp): New variable nextappdefined. Declare sendFromMainThread
2746 when NS_IMPL_GNUSTEP.
2747 (EmacsDocument): Declare when NS_IMPL_GNUSTEP.
2748 (EmacsView): Remove unlockFocusNeedsFlush, add windowDidMove.
2749 (EmacsToolbar): Add clearAll. Add tag argument to
2750 addDisplayItemWithImage.
2751 (EmacsSavePanel, EmacsOpenPanel): Remove getFilename and getDirectory.
2752
2753 * nsselect.m (ns_get_local_selection): Remove unused variable type.
2754
2755 * nsmenu.m (ns_update_menubar): Make static.
2756 (x_activate_menubar): Surround with ifdef NS_IMPL_COCOA
2757 (fillWithWidgetValue:): Add cast to SEL for setAction.
2758 (addSubmenuWithTitle:forFrame:): Add cast to SEL for action.
2759 (update_frame_tool_bar): Update code for GNUStep.
2760 (clearAll): New method.
2761 (addDisplayItemWithImage:idx:tag:helpText:enabled:): Handle new tag
4f405069 2762 argument. Call insertItemWithItemIdentifier when NS_IMPL_GNUSTEP.
e7b41c4c 2763 Move identifierToItem setObject and activeIdentifiers addObject before
c0342369
JD
2764 call to insertItemWithItemIdentifier.
2765 (validateVisibleItems): Fix indentation.
2766 (toolbarAllowedItemIdentifiers:): Return activeIdentifiers.
2767 (initWithContentRect:styleMask:backing:defer:): Add ClosableWindow and
2768 UtilityWindow to aStyle, remove call to setStyleMask.
2769
2770 * nsimage.m (setXBMColor:, getPixelAtX:Y:): Use EmacsCGFloat.
2771
2772 * nsfont.m (ns_attribute_fvalue, ns_spec_to_descriptor)
2773 (ns_charset_covers, ns_get_covering_families, nsfont_open):
2774 Use F suffix on floats.
2775 (ns_char_width): Returns CGFloat.
2776 (ns_ascii_average_width): w is CGFloat instead of float.
e7b41c4c 2777 (nsfont_draw): cbuf and c are unsigned. Cast to char* in call to
c0342369
JD
2778 DPSxshow.
2779 (ns_glyph_metrics): CGFloat instead of float.
2780
a0eb10b3
JB
2781 * nsfns.m (x_set_foreground_color, x_set_background_color):
2782 Use EmacsCGFloat.
2783 (ns_implicitly_set_icon_type, Fx_create_frame): Make static,
2784 remove unused variables.
2785 (Fns_read_file_name): Keep track if panel is for save.
2786 Use ns_filename_from_panel/ns_directory_from_panel.
c0342369 2787 (Fns_list_services): delegate only used for COCOA.
a0eb10b3
JB
2788 (Fns_convert_utf8_nfd_to_nfc): Remove warning for GNUStep.
2789 Just return the input if GNUStep.
c0342369
JD
2790 (x_screen_planes): Remove.
2791 (Fxw_color_values): Use EmacsCGFloat
2792 (Fns_display_monitor_attributes_list): Only get screen number for
2793 Cocoa.
ef099a94 2794 (getDirectory, getFilename): Remove from EmacsOpenPanel and
c0342369
JD
2795 EmacsSavePanel.
2796 (EmacsOpenPanel:ok:): Use ns_filename_from_panel and
2797 ns_directory_from_panel.
2798
da9aff11
PE
27992013-06-01 Paul Eggert <eggert@cs.ucla.edu>
2800
2801 * process.c (handle_child_signal): Also use WCONTINUED.
2802 This is so that list-processes doesn't mistakenly list the process
2803 as stopped, when the process has actually been continued and is
2804 now running.
2805
0e64479a
PE
28062013-05-31 Paul Eggert <eggert@cs.ucla.edu>
2807
fc186a96
PE
2808 Don't let D-bus autolaunch mess up SIGCHLD handling (Bug#14474).
2809 * xterm.c (x_term_init): Inhibit D-Bus autolaunch if D-Bus is
2810 not already configured.
2811
0e64479a
PE
2812 * fileio.c (Finsert_file_contents): Remove unused local (Bug#8447).
2813
38b787fa
EZ
28142013-05-29 Eli Zaretskii <eliz@gnu.org>
2815
2816 * Makefile.in (mostlyclean): Remove *.res files.
2817
22513e52
SM
28182013-05-29 Stefan Monnier <monnier@iro.umontreal.ca>
2819
2820 * fileio.c (Finsert_file_contents): Preserve undo info when reverting
2821 a buffer (bug#8447).
2822
6ef3db10
EZ
28232013-05-27 Eli Zaretskii <eliz@gnu.org>
2824
2825 * xdisp.c (pos_visible_p): When CHARPOS is displayed frrom a
2826 display vector, and we backtrack, handle the case that the
2827 previous character position is also displayed from a display
2828 vector or covered by a display string or image. (Bug#14476)
2829
6799bb26
JD
28302013-05-25 Jan Djärv <jan.h.d@swipnet.se>
2831
2832 * xfns.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
2833 (struct MonitorInfo, free_monitors): Remove.
2834 (x_make_monitor_attribute_list): Call make_monitor_attribute_list.
2835 (Fx_display_monitor_attributes_list): Call make_monitor_attribute_list.
2836 (syms_of_xfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
2837 Qframes, Qsource.
2838
2839 * nsfns.m (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Remove.
2840 (struct MonitorInfo, free_monitors): Remove.
2841 (ns_screen_name): Make static.
2842 (ns_make_monitor_attribute_list): Call make_monitor_attribute_list.
2843 (syms_of_nsfns): Remove DEFSYM for Qgeometry, Qworkarea, Qmm_size,
2844 Qframes, Qsource.
2845
2846 * frame.h (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
2847 (struct MonitorInfo): New struct.
2848 (free_monitors, make_monitor_attribute_list): Declare.
2849
22513e52
SM
2850 * frame.c (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource):
2851 New Lisp_Object:s.
6799bb26
JD
2852 (free_monitors, make_monitor_attribute_list): New functions.
2853 (syms_of_frame): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes,
2854 Qsource.
2855
38cd43eb
XF
28562013-05-25 Xue Fuqiao <xfq.free@gmail.com>
2857
2858 * callproc.c (call_process): Refine the doc string. (Bug#14045)
2859
2af0948d
SM
28602013-05-23 Stefan Monnier <monnier@iro.umontreal.ca>
2861
a7eb9b0f
SM
2862 * keyboard.c: Apply keyboard decoding only to events that come directly
2863 from the tty, not from unread-command-events (bug#14368).
2864 (read_event_from_main_queue): New function, extracted from read_char).
2865 (read_decoded_char): Remove.
2866 (read_decoded_event_from_main_queue): New function to replace it.
2867 (read_char): Use it.
2868 (read_key_sequence): Use read_char rather than read_decoded_char.
2869
2af0948d
SM
2870 * keyboard.c (read_decoded_char): Don't decode under w32 (bug#14403).
2871
1413e9a5
BR
28722013-05-22 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
2873
2874 * casetab.c (init_casetab_once): Fix last change (bug#14424).
2875
e6d2f155
KH
28762013-05-22 Kenichi Handa <handa@gnu.org>
2877
2878 The following changes are to fix the setting of
2879 buffer-file-coding-system on, for instance, C-x RET c unix RET
2880 _FILE_OF_DOS_EOL_TYPE_ RET.
2881
2882 * coding.h (struct coding_system): New member detected_utf8_chars.
2883
2884 * coding.c (detect_coding_utf_8): Count characters and check EOL
2885 format. Include CATEGORY_MASK_UTF_8_AUTO in detect_info->found if
2886 BOM is there.
2887 (setup_coding_system): Do not initialize coding->head_ascii.
2888 (check_ascii): Do not set coding->eol_seen but update it. Do not
2889 call adjust_coding_eol_type here.
1413e9a5
BR
2890 (detect_coding): Fix detection of BOM for utf-8 and utf-16.
2891 If the eol-type of CODING is already specified, adjust the eol type
e6d2f155
KH
2892 of the found coding-system.
2893 (decode_coding_gap): Cancel previous change. Utilize the
2894 character numbers counted by detect_coding_utf_8. Fix detection
2895 of BOM for utf-8.
2896
ab56a6f4 28972013-05-21 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
fc30d803
SM
2898
2899 * search.c (looking_at_1): Only set last_thing_searched if the match
2900 changed the match-data (bug#14281).
2901
ecc3c6ed
DA
29022013-05-21 Dmitry Antipov <dmantipov@yandex.ru>
2903
2904 * xdisp.c (reseat_at_previous_visible_line_start):
a0eb10b3 2905 Already declared in dispextern.h, so remove it here.
ecc3c6ed
DA
2906 (move_it_vertically_backward): Likewise.
2907
5ba8bf35
YM
29082013-05-20 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2909
2910 * xfns.c (check_x_display_info): Don't use XINT for terminal object.
d6635ba2 2911 (Fx_display_pixel_width, Fx_display_pixel_height)
fc30d803
SM
2912 (Fx_display_mm_width, Fx_display_mm_height):
2913 Mention `display-monitor-attributes-list' in docstrings.
5ba8bf35 2914
91e8418b 2915 * nsfns.m (ns_get_screen): Remove function. All uses removed.
a0eb10b3 2916 (check_ns_display_info): Sync with check_x_display_info in xfns.c.
91e8418b
YM
2917 (Fx_server_max_request_size, Fx_server_vendor, Fx_server_version)
2918 (Fx_display_screens, Fx_display_mm_width, Fx_display_mm_height)
2919 (Fx_display_backing_store, Fx_display_visual_class)
2920 (Fx_display_save_under, Fx_close_connection, Fxw_display_color_p)
2921 (Fx_display_grayscale_p, Fx_display_pixel_width)
2922 (Fx_display_pixel_height, Fx_display_planes)
2923 (Fx_display_color_cells): Sync args and docstrings with xfns.c.
2924 (Fx_display_screens): Don't confuse X11 screens with NS screens.
2925 (Fx_display_mm_width, Fx_display_mm_height)
2926 (Fx_display_pixel_width, Fx_display_pixel_width): Return width or
2927 height for all physical monitors as in X11.
2928
fc30d803
SM
2929 * nsterm.m (x_display_pixel_width, x_display_pixel_height):
2930 Return pixel width or height for all physical monitors as in X11.
91e8418b 2931
31ff141c
PE
29322013-05-18 Paul Eggert <eggert@cs.ucla.edu>
2933
2934 Port --enable-gcc-warnings to clang.
2935 * bytecode.c (exec_byte_code):
2936 * regex.c:
2937 Redo diagnostic pragmas to pacify clang, too.
2938 * dbusbind.c (xd_retrieve_arg): Do not use uninitialized variable.
2939 * editfns.c (Fencode_time):
2940 * fileio.c (file_accessible_directory_p):
2941 * font.c (font_unparse_xlfd):
2942 Use '&"string"[index]' instead of '"string" + (index)'.
2943 * undo.c (user_error): Remove; unused.
2944
df065a0b
EZ
29452013-05-16 Eli Zaretskii <eliz@gnu.org>
2946
04d360e7
EZ
2947 * insdel.c (insert_1_both): Document the arguments, instead of
2948 referring to insert_1, which no longer exists.
2949
5bb98290
EZ
2950 * xdisp.c (message_dolog): If the *Messages* buffer is shown in
2951 some window, increment windows_or_buffers_changed, so that
2952 *Messages* display in that window is updated. (Bug#14408)
2953
df065a0b
EZ
2954 * w32.c: Include epaths.h.
2955 (init_environment): Use cmdproxy.exe without leading directories.
2956 Support emacs.exe in src; point SHELL to cmdproxy in ../nt in that
2957 case.
2958 (gettimeofday): Adjust signature and return value to Posix
2959 expectations.
2960
2961 * unexw32.c (open_output_file): Delete the existing emacs.exe
2962 before creating it, to break the hard link to the versioned
2963 executable.
2964
2965 * Makefile.in (EMACS_MANIFEST, CM_OBJ, TEMACS_POST_LINK)
2966 (ADDSECTION, EMACS_HEAPSIZE, MINGW_TEMACS_POST_LINK)
2967 (FIRSTFILE_OBJ): New variables.
2968 (W32_RES): Rename to EMACSRES. All users changed.
2969 (base_obj): Use $(CM_OBJ).
2970 (ALLOBJS): Use $(FIRSTFILE_OBJ).
2971 (emacs$(EXEEXT)): Depend on $(ADDSECTION).
2972 (temacs$(EXEEXT)): Use $(TEMACS_POST_LINK), and move
2973 $(W32_RES_LINK) before $(LIBES).
2974 (emacs.res): Depend on $(EMACS_MANIFEST). Put emacs.rc in nt.
2975
1aa8d505
SM
29762013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
2977
6e911150
SM
2978 * makefile.w32-in (DOC): Use just "DOC".
2979
2980 * Makefile.in (bootstrap-clean): DOC-* doesn't exist any more.
2981
1aa8d505
SM
2982 * process.c: Export default filters and sentinels to Elisp.
2983 (Qinternal_default_process_sentinel, Qinternal_default_process_filter):
2984 New constants.
2985 (pset_filter, pset_sentinel, make_process, Fset_process_filter)
2986 (Fset_process_sentinel, Fformat_network_address):
2987 Default to them instead of nil.
2988 (server_accept_connection): Sentinels can't be nil any more.
2989 (read_and_dispose_of_process_output): New function, extracted from
2990 read_process_output.
2991 (read_process_output): Use it; filters can't be nil.
2992 (Finternal_default_process_filter): New function, extracted from
2993 read_process_output.
2994 (exec_sentinel_unwind): Remove function.
2995 (exec_sentinel): Don't zilch sentinel while running.
2996 (status_notify): Sentinels can't be nil.
2997 (Finternal_default_process_sentinel): New function extracted from
2998 status_notify.
2999 (setup_process_coding_systems): Default filter is not nil any more.
3000 (syms_of_process): Export new Elisp functions and initialize
3001 new constants.
3002 * lisp.h (make_lisp_proc): New function.
3003
5ac2eb34
SM
30042013-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
3005
3006 * regex.c (regex_compile) [\=, \>, \<]: Don't forget to set laststart.
3007
eda9c7d7
EZ
30082013-05-14 Eli Zaretskii <eliz@gnu.org>
3009
3010 * w32fns.c (w32_wnd_proc): Don't call WINDOW_HEADER_LINE_HEIGHT
5ac2eb34
SM
3011 unless we know that the window w is a leaf window.
3012 Another attempt at solving bug#14062.
eda9c7d7 3013
8fdeaad5
JD
30142013-05-14 Jan Djärv <jan.h.d@swipnet.se>
3015
3016 * nsfont.m (ns_spec_to_descriptor): Retain and autorelease
3017 fdesc (Bug#14375).
3018
44aa9ee6
PE
30192013-05-12 Paul Eggert <eggert@cs.ucla.edu>
3020
3021 * image.c (gif_load): Check that subimages fit (Bug#14345).
3022
759fd763
SM
30232013-05-09 Stefan Monnier <monnier@iro.umontreal.ca>
3024
3025 * lread.c (skip_dyn_eof): New function.
3026 (read1): Use it to skip the end of a file in response to #@00.
3027
3028 * doc.c (get_doc_string): Slightly relax the sanity checking.
3029
4465bfb4
JD
30302013-05-09 Jan Djärv <jan.h.d@swipnet.se>
3031
3032 * nsfns.m: Include IOGraphicsLib.h if Cocoa.
3033 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): Declare.
3034 (MonitorInfo): New struct.
3035 (free_monitors, ns_screen_name, ns_make_monitor_attribute_list)
3036 (Fns_display_monitor_attributes_list): New functions.
3037 (display-usable-bounds): Remove.
3038 (syms_of_nsfns): DEFSYM Qgeometry, Qworkarea, Qmm_size, Qframes and
3039 Qsource.
3040
7583e2a0
PE
30412013-05-09 Paul Eggert <eggert@cs.ucla.edu>
3042
3043 * xterm.h (GTK_PREREQ): Remove, replacing with GTK_CHECK_VERSION.
3044 (GTK_CHECK_VERSION): New macro, if not already defined.
3045 All uses of GTK_PREREQ, GTK_MAJOR_VERSION, etc.
3046 replaced by GTK_CHECK_VERSION.
3047
ad75d77e
PE
30482013-05-08 Paul Eggert <eggert@cs.ucla.edu>
3049
3050 * xterm.h (GTK_PREREQ): New macro.
3051 All simple uses of GTK_MAJOR_VERSION and GTK_MINOR_VERSION changed
3052 to use this macro instead, for consistency and clarity.
3053
07525f77
EZ
30542013-05-08 Eli Zaretskii <eliz@gnu.org>
3055
3056 * xdisp.c (row_for_charpos_p): New function, with code of
3057 cursor_row_p, but accepts an additional argument CHARPOS instead
3058 of using a hardcoded PT.
3059 (cursor_row_p): Call row_for_charpos_p with 2nd argument PT.
3060 (row_containing_pos): Call row_for_charpos_p instead of partially
3061 doing the same. Fixes cursor positioning under longlines-mode
3062 when longlines-show-effect includes more than one newline, when
3063 moving the cursor vertically up.
3064
d901fc8d
JB
30652013-05-08 Juanma Barranquero <lekktu@gmail.com>
3066
3067 * makefile.w32-in (ACL_H): New macro.
3068 ($(BLD)/fileio.$(O)): Update dependencies.
3069
f269bc61
PE
30702013-05-07 Paul Eggert <eggert@cs.ucla.edu>
3071
e7b41c4c 3072 Use Gnulib ACL implementation, for benefit of Solaris etc. (Bug#14295)
ffdc270a
PE
3073 * Makefile.in (LIB_ACL): New macro.
3074 (LIBACL_LIBS): Remove.
3075 (LIBES): Use LIB_ACL, not LIBACL_LIBS.
3076 * fileio.c: Include <acl.h>.
3077 Use HAVE_ACL_SET_FILE rather than HAVE_POSIX_ACL.
3078 (ACL_NOT_WELL_SUPPORTED): Remove. All uses replaced by
3079 !acl_errno_valid.
3080 (Fcopy_file) [!WINDOWSNT]: Use qcopy_acl instead of rolling
3081 it ourselves.
3082
f269bc61
PE
3083 * unexelf.c: Don't assume ElfW (Half) fits in int.
3084 (entry_address, find_section, unexec): Use ptrdiff_t, not int,
3085 when dealing with ElfW (Half) values, since they can exceed 2**31
3086 on 64-bit OpenBSD hosts. Problem reported privately by Han Boetes.
3087 (entry_address): Omit unused NUM arg. All uses changed.
3088
a261c53e
JL
30892013-05-07 Juri Linkov <juri@jurta.org>
3090
3091 * callint.c (Fcall_interactively): Set `visargs[i]' for code 'n'
3092 to the string converted from number with `Fnumber_to_string'.
3093 (Bug#14254)
3094
2b66427d
PE
30952013-05-07 Paul Eggert <eggert@cs.ucla.edu>
3096
3097 * xfns.c (x_get_net_workarea): Define only if !GTK || GTK<3.4.
3098 This fixes a problem introduced by my previous change.
3099
15acfe41
GM
31002013-05-07 Glenn Morris <rgm@gnu.org>
3101
3102 * lread.c (readchar): Don't read from a dead buffer. (Bug#14280)
3103
5ea03bf5
JD
31042013-05-07 Jan Djärv <jan.h.d@swipnet.se>
3105
3106 * xfns.c: Move misplaced ifndef USE_GTK from previous checkin.
3107
e0c9d565
PE
31082013-05-07 Paul Eggert <eggert@cs.ucla.edu>
3109
3110 Static checking by GCC 4.8.0.
3111 * xfns.c (x_get_net_workarea, struct MonitorInfo, free_monitors)
3112 (x_get_monitor_for_frame, x_make_monitor_attribute_list)
3113 (x_get_monitor_attributes_fallback)
3114 (x_get_monitor_attributes_xinerama)
3115 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes):
3116 Define only if USE_GTK.
3117 (free_monitors): Define only if HAVE_XINERAMA || HAVE_XRANDR.
3118 (x_get_monitor_attributes_fallback): Omit unused locals.
3119 (x_get_monitor_attributes_xinerama, Fx_display_monitor_attributes_list):
3120 Use double, not float, to avoid mixed-mode floating point arithmetic.
3121
4e3f9230
YM
31222013-05-07 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3123 Jan Djärv <jan.h.d@swipnet.se>
3124
3125 * Makefile.in (XRANDR_LIBS, XRANDR_CFLAGS, XINERAMA_LIBS)
3126 (XINERAMA_CFLAGS): New macros.
3127 (ALL_CFLAGS, LIBES): Use them.
3128
3129 * xfns.c: Include <X11/extensions/Xrandr.h> if HAVE_XRANDR, and
3130 include <X11/extensions/Xinerama.h> if HAVE_XINERAMA.
3131 (Qgeometry, Qworkarea, Qmm_size, Qframes, Qsource): New variables.
3132 (syms_of_xfns): DEFSYM them.
3133 (struct MonitorInfo): New struct.
3134 (x_get_net_workarea, free_monitors, x_get_monitor_for_frame)
3135 (x_make_monitor_attribute_list, x_get_monitor_attributes_fallback)
3136 (x_get_monitor_attributes_xrandr, x_get_monitor_attributes)
3137 (x_get_monitor_attributes_xinerama): New functions.
3138 (Fx_display_monitor_attributes_list): New primitive.
3139 (syms_of_xfns): Defsubr it.
3140
3141 * xterm.h (x_display_info): Add Xatom_net_workarea and
3142 Xatom_net_current_desktop.
3143
3144 * xterm.c (x_term_init): Initialize dpyinfo->Xatom_net_workarea
3145 and dpyinfo->Xatom_net_current_desktop.
3146
05839b6a
EZ
31472013-05-06 Eli Zaretskii <eliz@gnu.org>
3148
3149 * xdisp.c (pos_visible_p): Use the special code for finding the
3150 beginning of a display property or overlay for any "replacing"
3151 display property, not just for display strings. This solves
3152 incorrect reporting of position by posn-at-point. (Bug#14241)
3153
dc4a2ee0
PE
31542013-05-06 Paul Eggert <eggert@cs.ucla.edu>
3155
5ee94506
PE
3156 * unexelf.c: Fix some 32-bit integer problems, notably when debugging.
3157 Include <limits.h>, <stdbool.h>, <intprops.h>, <verify.h>.
3158 Verify that ElfW (Half) fits in int.
3159 (fatal): Use same signature as lisp.h.
3160 (UNEXELF_DEBUG): New macro, replacing DEBUG, so that people can
3161 configure and build with -DUNEXELF_DEBUG without worrying about
3162 other modules that use DEBUG.
3163 (DEBUG_LOG) [UNEXELF_DEBUG]: New macro. All debug code that prints
3164 possibly-wide integers now uses it instead of plain fprintf.
3165 (entry_address): New function, which avoids problems with 32-bit
3166 overflow on 64-bit hosts.
3167 (OLD_SECTION_H, NEW_SECTION_H, NEW_PROGRAM_H): Use it.
3168 (round_up): Don't assume the remainder fits in int.
3169 (find_section): Use bool for boolean. Simplify debug code.
3170 (unexec): Don't assume file sizes fit in int or size_t.
3171 Omit unnecessary trailing newline in 'fatal' format.
3172 Use strerror rather than outputting decimal error number.
3173 Remove unused code when emacs is not defined;
3174 this file relies on Emacs now.
3175 Don't assume e_phnum and e_shnum are positive.
3176
dc4a2ee0
PE
3177 * regex.c: Fix problems when DEBUG is defined.
3178 (extract_number, extract_number_and_incr): Define regardless of
3179 whether DEBUG is defined; that's simpler and makes the code less
3180 likely to go stale in the normal case when DEBUG is not defined.
3181 Return int rather than taking an int * arg. All callers changed.
3182 (DEBUG_PRINT1, DEBUG_PRINT2, DEBUG_PRINT3, DEBUG_PRINT4):
3183 Remove, replacing with ...
3184 (DEBUG_PRINT): New macro. All callers changed.
3185 (DEBUG_COMPILES_ARGUMENTS): New macro.
3186 (print_fastmap, print_partial_compiled_pattern) [DEBUG]:
3187 (print_compiled_pattern, print_double_string) [DEBUG]:
3188 Use prototype rather than old-style definition.
3189 (print_partial_compiled_pattern, print_compiled_pattern) [DEBUG]:
3190 (ENSURE_FAIL_STACK, PUSH_FAILURE_REG) [DEBUG]:
3191 (POP_FAILURE_REG_OR_COUNT, PUSH_FAILURE_POINT) [DEBUG]:
3192 (POP_FAILURE_POINT, re_match_2_internal) [DEBUG]:
3193 Don't assume ptrdiff_t, size_t, and long are the same width as int.
3194 (POINTER_TO_OFFSET): Return ptrdiff_t, not regoff_t.
3195 This matters only when DEBUG is defined.
3196
14c7ed05
EZ
31972013-05-05 Eli Zaretskii <eliz@gnu.org>
3198
3199 * xdisp.c (set_iterator_to_next): Set the
3200 ignore_overlay_strings_at_pos_p flag only if we are _really_
3201 iterating over an overlay string, as indicated by the
3202 current.overlay_string_index member. (Bug#14306)
3203
e6076b1b
JD
32042013-05-05 Jan Djärv <jan.h.d@swipnet.se>
3205
3206 * nsmenu.m (ns_update_menubar): Move initialization of submenuTitle
3207 to where it is used, to avoid autorelease issues (Bug#14050).
3208
cbee2131
PE
32092013-05-05 Paul Eggert <eggert@cs.ucla.edu>
3210
3211 `write-region-inhibit-fsync' defaults to noninteractive (Bug#14273).
3212 * fileio.c (syms_of_fileio): Implement this.
3213 * filelock.c (create_lock_file): If symbolic links don't work, so
3214 we use a regular file as a lock file, do not fsync the lock file;
3215 it's not needed.
3216
30c7e542
SM
32172013-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
3218
3219 * minibuf.c (Fread_minibuffer, Feval_minibuffer): Move to Elisp.
3220 (syms_of_minibuf): Adjust accodingly.
3221 * lread.c (Fread):
3222 * callint.c (Fcall_interactively): Adjust calls accordingly.
3223
5bebd186
EZ
32242013-05-04 Eli Zaretskii <eliz@gnu.org>
3225
3226 * dispextern.h (WINDOW_WANTS_HEADER_LINE_P): Verify that
30c7e542
SM
3227 w->contents is a buffer before computing everything else.
3228 Use parentheses to disambiguate last part of the condition.
5bebd186
EZ
3229
3230 * w32fns.c (w32_wnd_proc): Remove temporary code used to trap
3231 assertion violations. (Bug#14062)
3232
0fb0a4f3
DR
32332013-05-01 David Reitter <david.reitter@gmail.com>
3234
3235 * nsfns.m (ns_tooltip): Initialize.
3236
9e63b4a5
EZ
32372013-04-28 Eli Zaretskii <eliz@gnu.org>
3238
3239 * coding.c (decode_coding_gap): Don't remove the character before
3240 a newline unless it's a CR character. (Bug#14287)
3241
ad60824e
DN
32422013-04-28 Dan Nicolaescu <dann@gnu.org>
3243
3244 * dispextern.h (struct face): Move enum face_underline_type
3245 earlier so that bitfields can be in the same word.
3246
edbdcec0
JD
32472013-04-28 Jan Djärv <jan.h.d@swipnet.se>
3248
3249 * nsfns.m (handlePanelKeys): New function.
3250 (EmacsOpenPanel:performKeyEquivalent:)
3251 (EmacsSavePanel:performKeyEquivalent:): Call handlePanelKeys to handle
3252 arrows/function/control and copy/paste keys (Bug#14296).
3253
0208ede7
JL
32542013-04-27 Juri Linkov <juri@jurta.org>
3255
3256 * callint.c (Fcall_interactively): Call `Qread_number' for
3257 interactive code letter `n' instead of using duplicate code.
3258 (Bug#14254)
3259
b8dd59f7
PE
32602013-04-27 Paul Eggert <eggert@cs.ucla.edu>
3261
3262 * systime.h (make_timeval): Declare as 'const'.
3263
8bd722db
KH
32642013-04-27 Kenichi Handa <handa@gnu.org>
3265
3266 * font.c (font_open_entity): Always open a font of manageable
3267 size.
3268
13d0e56f 32692013-04-26 Paul Eggert <eggert@cs.ucla.edu>
cbee2131 3270
f780d632
PE
3271 Port better to AIX (Bug#14258).
3272 * lisp.h (ENUM_BF) [__IBMC__]: Make it 'unsigned int' here, too,
3273 to pacify AIX xlc.
3274
ec509856
KH
32752013-04-24 Kenichi Handa <handa@gnu.org>
3276
3277 * coding.c (decode_coding_iso_2022): When an invalid escape
3278 sequence is encountered, reset the invocation and designation
3279 status to the safest one.
3280
84fc48e5
PE
32812013-04-22 Paul Eggert <eggert@cs.ucla.edu>
3282
3283 * Makefile.in (bootstrap-clean): Remove stamp-h1 too.
3284 Without this fix, "make distclean" leaves stamp-h1 behind.
3285
806bda47
EC
32862013-04-20 Erik Charlebois <erikcharlebois@gmail.com>
3287
3288 * w32fns.c (w32_fullscreen_rect): New function to compute the
3289 window rectangle for the given fullscreen mode.
3290 (w32_wnd_proc): When in a fullscreen mode, WM_WINDOWPOSCHANGING no
3291 longer tunes the window size. This keeps the window's edges flush
3292 with the screen and allows the taskbar to hide itself in fullboth.
3293
3294 * w32term.c (w32fullscreen_hook): 'fullboth' now shows without
3295 window decorations and uses the entire screen.
3296
3297 * w32term.h (w32_fullscreen_rect) Add prototype.
3298 (struct w32_output): Replace normal_width, normal_height,
3299 normal_top, and normal_left members with a single normal_placement
3300 struct.
3301 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP):
3302 Remove macros.
3303 (FRAME_NORMAL_PLACEMENT): New macro.
3304
9cc2810b
JB
33052013-04-16 Juanma Barranquero <lekktu@gmail.com>
3306
3307 * minibuf.c (Ftest_completion): Silence compiler warning.
3308
fd16b54c
EZ
33092013-04-15 Eli Zaretskii <eliz@gnu.org>
3310
3311 * w32fns.c (w32_wnd_proc): Add more assertions to investigate
5fbcd237 3312 bug#14062.
fd16b54c
EZ
3313
3314 * frame.h (WINDOW_FRAME): Protect macro and its argument with
3315 parentheses.
3316
3317 * dispextern.h (CURRENT_MODE_LINE_HEIGHT)
3318 (CURRENT_HEADER_LINE_HEIGHT, WINDOW_WANTS_MODELINE_P)
3319 (WINDOW_WANTS_HEADER_LINE_P): Protect macro arguments with
3320 parentheses where appropriate.
3321
9e3379a0
PE
33222013-04-14 Paul Eggert <eggert@cs.ucla.edu>
3323
3324 * keyboard.c (timer_start_idle): Remove no-longer-used local.
3325
ddd6b685
EZ
33262013-04-14 Eli Zaretskii <eliz@gnu.org>
3327
3328 * buffer.c (syms_of_buffer) <left-margin-width, right-margin-width>
3329 <left-fringe-width, right-fringe-width, fringes-outside-margins>:
3330 Mention in the doc string that setting these variables takes
3331 effect only after a call to set-window-buffer. (Bug#14200)
3332
29b79ba1
EZ
33332013-04-13 Eli Zaretskii <eliz@gnu.org>
3334
3335 * indent.c (Fvertical_motion): Don't consider display strings on
3336 overlay strings as display strings on the buffer position we
3337 started from. This prevents vertical cursor motion from jumping
3338 more than one line when there's an overlay string with a display
3339 property at end of line.
3340 Reported by Karl Chen <Karl.Chen@quarl.org> in
3341 http://lists.gnu.org/archive/html/emacs-devel/2013-04/msg00362.html.
3342
562c6ee9
SM
33432013-04-12 Stefan Monnier <monnier@iro.umontreal.ca>
3344
3345 * window.c (select_window): `record_buffer' even if window is
3346 already selected (bug#14191).
3347
fcc1fe85
EZ
33482013-04-11 Eli Zaretskii <eliz@gnu.org>
3349
3350 * window.c (Fwindow_end): Test more flags, including the buffer's
3351 last_overlay_modified flag, to determine whether the window's
3352 display is really up-to-date. Prevents the function from
3353 returning a stale value. (Bug#14170)
3354 (Fwindow_line_height): Fix the test for up-to-date-ness of the
3355 current matrix.
3356
f009190a
EZ
33572013-04-10 Eli Zaretskii <eliz@gnu.org>
3358
3359 * frame.c (do_switch_frame): Mark the TTY frame we switch to as
562c6ee9
SM
3360 garbaged only if it is not already the top frame on its TTY.
3361 This prevents flickering due to constant redrawing of TTY frames when
f009190a
EZ
3362 there are GUI frames open in the same session. (Bug#13864)
3363
78ce603d
SM
33642013-04-10 Stefan Monnier <monnier@iro.umontreal.ca>
3365
3366 * keyboard.c (timer_start_idle): Call internal-timer-start-idle instead
3367 of marking the idle timers directly.
3368
a8036e40
SM
33692013-04-09 Stefan Monnier <monnier@iro.umontreal.ca>
3370
3371 * minibuf.c (Ftest_completion): Ignore non-string/symbol keys in hash
3372 tables (bug#14054).
3373
7ffe7ef6
SM
33742013-04-08 Stefan Monnier <monnier@iro.umontreal.ca>
3375
3376 * window.c (select_window): Don't record_buffer while the invariant is
3377 temporarily broken (bug#14161).
3378
3379 * fns.c (Fdelq): Don't assume !NILP => CONSP.
3380
7d9f6883
EZ
33812013-04-07 Eli Zaretskii <eliz@gnu.org>
3382
3383 * fileio.c (ACL_NOT_WELL_SUPPORTED): Define macro for WINDOWSNT.
3384
5406cfd9
RF
33852013-04-07 Romain Francoise <romain@orebokech.com>
3386
3387 Ignore additional platform-specific ACL errors (Bug#13702).
3388 * fileio.c (ACL_NOT_WELL_SUPPORTED): New macro copied from gnulib.
3389 (Fcopy_file, Fset_file_acl) [HAVE_POSIX_ACL]: Use it.
3390
95c0e83b
JD
33912013-03-31 Jan Djärv <jan.h.d@swipnet.se>
3392
3393 * nsterm.m (ns_mouse_position): Use NS_FRAME_P instead of checking
3394 f->output_data.ns.
3395
876da980
PE
33962013-04-07 Paul Eggert <eggert@cs.ucla.edu>
3397
3398 Fix --enable-profiling bug introduced by 2013-02-25 change (Bug#13783).
3399 This bug was introduced by my 2013-02-25 change that simplified
3400 data_start configuration. Without this change, on GNU/Linux
3401 an Emacs configured with --enable-profiling fails immediately
3402 due to a profiler signal.
3403 * Makefile.in: Compile with $(PROFILING_CFLAGS), but do not link
3404 with these flags. On platforms where special flags are needed
3405 when linking temacs, the flags are now in LD_SWITCH_SYSTEM_TEMACS.
3406 (ALL_CFLAGS): Remove $(PROFILING_CFLAGS).
3407 (.c.o, .m.o): Compile with $(PROFILING_CFLAGS).
3408
7452b7bd
DA
34092013-04-07 Dmitry Antipov <dmantipov@yandex.ru>
3410
3411 Get rid of some platform-specific functions examining window
3412 system and its capabilities. This is a partial rework of the
3413 2013-04-05 change.
3414 * lisp.h (have_menus_p): Remove prototype. This function is
3415 replaced with platform-independent window_system_available.
3416 (check_window_system): Move to...
3417 * frame.h (decode_window_system_frame, window_system_available):
3418 ...here, add new prototypes.
3419 * frame.c (window_system_available, decode_window_system_frame):
3420 New functions.
3421 (check_window_system): Platform-independent now.
3422 * xterm.h (x_in_use): Remove declaration.
3423 (check_x_frame):
3424 * w32term.h (check_x_frame):
3425 * nsterm.h (check_x_frame): Remove prototypes. This function
3426 is replaced with platform-independent decode_window_system_frame.
3427 * msdos.c (have_menus_p): Remove.
3428 * nsfns.m (check_window_system, have_menus_p, check_ns_frame):
3429 Remove platform-specific functions. Use check_window_system,
3430 decode_window_system_frame and check_ns_display_info where
3431 appropriate. Minor style and comment tweaks.
3432 * w32fns.c (w32_in_use, check_window_system, have_menus_p)
3433 (check_x_frame): Likewise.
3434 * xfns.c (x_in_use, check_window_system, have_menus_p, check_x_frame):
3435 Likewise.
3436 * fileio.c, fns.c, font.c, fontset.c, image.c, menu.c, nsmenu.m:
3437 * nsselect.m, nsterm.m, w32font.c, w32menu.c, xfaces.c, xgselect.c:
3438 * xmenu.c, xselect.c: All related users changed.
3439
251e9147
KH
34402013-04-03 Kenichi Handa <handa@gnu.org>
3441
3442 The following changes is to optimize the code for reading UTF-8
3443 files.
3444
562c6ee9 3445 * coding.c (check_ascii): Rename from detect_ascii. Return value
251e9147
KH
3446 changed. Check EOL format. Do not call adjust_coding_eol_type
3447 here.
3448 (check_utf_8): New function.
3449 (adjust_coding_eol_type): Do nothing if already adjusted.
3450 (detect_coding): Compare the return value of check_ascii with
3451 coding->src_bytes. Call adjust_coding_eol_type if necessary.
3452 (decode_coding_gap): Optimize for valid UTF-8.
3453
8bc369d4
KH
34542013-03-21 Kenichi Handa <handa@gnu.org>
3455
3456 * coding.c (syms_of_coding): Cancel previous change.
3457
3458 * insdel.c (insert_from_gap): Fix previous change.
3459
73931ad1
DA
34602013-04-05 Dmitry Antipov <dmantipov@yandex.ru>
3461
3462 Consistently use platform-specific function to detect window system.
3463 * lisp.h (check_window_system): New prototype. This function is
3464 going to replace check_x, check_w32 and check_ns.
3465 (have_menus_p): Mention msdos.c in comment.
3466 * fontset.c (check_window_system_func): Remove. Adjust all users.
3467 * fontset.h (check_window_system_func): Remove prototype.
3468 * nsterm.h (check_ns):
3469 * xterm.h (check_x):
3470 * w32term.h (check_w32): Likewise.
3471 * menu.c (Fx_popup_menu): Use check_window_system.
3472 * msdos.c (check_window_system): Define for MS-DOS.
3473 * nsfns.m (check_window_system): Define for NS. Adjust all users.
3474 * w32fns.c (check_window_system): Likewise for MS-Windows.
3475 * xfns.c (check_window_system): Likewise for X.
3476 * font.c, frame.c, nsmenu.m, nsselect.m, nsterm.m, w32menu.c:
3477 * xfaces.c, xmenu.c: Use check_window_system where appropriate.
3478
7216e43b
PE
34792013-04-02 Paul Eggert <eggert@cs.ucla.edu>
3480
3481 Prefer < to > in range checks such as 0 <= i && i < N.
3482 This makes it easier to visualize quantities on a number line.
3483 This patch doesn't apply to all such range checks,
3484 only to the range checks affected by the 2013-03-24 change.
3485 This patch reverts most of the 2013-03-24 change.
3486 * alloc.c (xpalloc, Fgarbage_collect):
3487 * ccl.c (ccl_driver, resolve_symbol_ccl_program):
3488 * character.c (string_escape_byte8):
3489 * charset.c (read_hex):
3490 * data.c (cons_to_unsigned):
3491 * dispnew.c (update_frame_1):
3492 * doc.c (Fsubstitute_command_keys):
3493 * doprnt.c (doprnt):
3494 * editfns.c (hi_time, decode_time_components):
3495 * fileio.c (file_offset):
3496 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
3497 * font.c (font_intern_prop):
3498 * frame.c (x_set_alpha):
3499 * gtkutil.c (get_utf8_string):
3500 * indent.c (check_display_width):
3501 * keymap.c (Fkey_description):
3502 * lisp.h (FIXNUM_OVERFLOW_P, vcopy):
3503 * lread.c (read1):
3504 * minibuf.c (read_minibuf_noninteractive):
3505 * process.c (wait_reading_process_output):
3506 * search.c (Freplace_match):
3507 * window.c (get_phys_cursor_glyph):
3508 * xdisp.c (redisplay_internal):
3509 * xsmfns.c (smc_save_yourself_CB):
3510 Prefer < to > for range checks.
3511 * dispnew.c (sit_for): Don't mishandle NaNs.
3512 This fixes a bug introduced in the 2013-03-24 change.
3513 * editfns.c (decode_time_components): Don't hoist comparison.
3514 This fixes another bug introduced in the 2013-03-24 change.
3515
92759988
DA
35162013-03-31 Dmitry Antipov <dmantipov@yandex.ru>
3517
3518 * frame.h (struct frame): Drop scroll_bottom_vpos
3519 member becaue all real users are dead long ago.
3520 (FRAME_SCROLL_BOTTOM_VPOS): Remove.
3521 * xdisp.c (redisplay_internal): Adjust user.
3522
9a1971bb
GM
35232013-03-30 Darren Ho <darren.hoo@gmail.com> (tiny change)
3524
f38ab167
JD
3525 * nsmenu.m (showAtX:Y:for:): setLevel to
3526 NSPopUpMenuWindowLevel (Bug#13998).
3527
6d01f1fe
JD
35282013-03-30 Jan Djärv <jan.h.d@swipnet.se>
3529
3530 * nsterm.h (ns_get_pending_menu_title, ns_check_menu_open)
3531 (ns_check_pending_open_menu): Declare.
3532
3533 * nsmenu.m (ns_update_menubar): Correct NSTRACE.
3534 (x_activate_menubar): Update the menu with title that matches
3535 ns_get_pending_menu_title, and call
3536 ns_check_pending_openmenu (Bug#12698).
3537 (menuWillOpen:): New method.
3538 (menuNeedsUpdate:): Add check for ! COCOA || OSX < 10.5 (Bug#12698).
3539
3540 * nsterm.m (menu_will_open_state, menu_mouse_point)
3541 (menu_pending_title): New varaibles.
3542 (ns_get_pending_menu_title, ns_check_menu_open)
3543 (ns_check_pending_open_menu): New functions.
3544
781f4782
DA
35452013-03-29 Dmitry Antipov <dmantipov@yandex.ru>
3546
3547 * indent.c (current_column_bol_cache): Remove leftover which is not
3548 used in Fmove_to_column any more.
3549 (current_column, scan_for_column): Adjust users.
3550 * keyboard.c (last_point_position_buffer, last_point_position_window):
3551 Remove leftovers which are not used for recording undo any more.
3552 (command_loop_1, syms_of_keyboard): Adjust users.
3553 * xdisp.c (last_max_ascent): Remove leftover which is not used in
3554 redisplay_window any more.
3555 (move_it_to): Adjust user.
3556
1921c31b
JB
35572013-03-29 Juanma Barranquero <lekktu@gmail.com>
3558
3559 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/filelock.$(O)):
3560 Update dependencies.
3561
717b8bcd
SM
35622013-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
3563
3564 * lisp.h (save_type, XSAVE_POINTER, set_save_pointer, XSAVE_INTEGER)
3565 (set_save_integer, XSAVE_OBJECT, XSAVE_VALUE): Move to avoid
3566 forward references.
3567
e74aeda8
DA
35682013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
3569
3570 * window.h (struct window): Replace hchild, vchild and buffer slots
3571 with the only contents slot. This is possible because each valid
3572 window may have either the child window (in vertical or horizontal
3573 combination) or buffer to display (for the leaf window). Using that,
3574 a lof of operations to traverse and/or change window hierarchies may
3575 be simplified. New member horizontal is used to distinguish between
3576 horizontal and vertical combinations of internal windows.
3577 (WINDOW_LEAF_P, WINDOW_HORIZONTAL_COMBINATION_P)
3578 (WINDOW_VERTICAL_COMBINATION_P): New macros.
3579 (WINDOW_VALID_P, WINDOW_LIVE_P): Adjust to match struct window changes.
3580 * window.c (wset_hchild, wset_vchild): Remove. Adjust all users.
3581 Use contents slot, not buffer, where appropriate.
3582 (wset_combination): New function.
3583 (wset_buffer): Add eassert.
3584 (Fframe_first_window): Simplify the loop reaching first window.
3585 (Fwindow_buffer): Use WINDOW_LEAF_P.
3586 (Fwindow_top_child): Use WINDOW_VERTICAL_COMBINATION_P.
3587 (Fwindow_left_child): Use WINDOW_HORIZONTAL_COMBINATION_P.
3588 (unshow_buffer): Convert initial debugging check to eassert.
3589 (replace_window, recombine_windows, Fdelete_other_windows_internal)
3590 (make_parent_window, window_resize_check, window_resize_apply)
3591 (resize_frame_windows, Fsplit_window_internal, Fdelete_window_internal)
3592 (Fset_window_configuration, delete_all_child_windows, save_window_save):
3593 Adjust to match struct window changes.
3594 (window_loop): Check for broken markers in CHECK_ALL_WINDOWS.
3595 (mark_window_cursors_off, count_windows, get_leaf_windows)
3596 (foreach_window_1): Simplify the loop.
3597 * alloc.c (mark_object): Do not check for the leaf window because
3598 internal windows has no glyph matrices anyway.
3599 * dispnew.c (clear_window_matrices, showing_window_margins_p)
3600 (allocate_matrices_for_window_redisplay, fake_current_matrices)
3601 (allocate_matrices_for_frame_redisplay, free_window_matrices)
3602 (build_frame_matrix_from_window_tree, mirror_make_current)
3603 (frame_row_to_window, mirror_line_dance, check_window_matrix_pointers)
3604 (update_window_tree, set_window_update_flags): Simplify the loop.
3605 (sync_window_with_frame_matrix_rows): Enforce live window.
3606 Use contents slot, not buffer, where appropriate.
3607 * frame.c (set_menu_bar_lines_1): Use WINDOW_VERTICAL_COMBINATION_P
3608 and WINDOW_HORIZONTAL_COMBINATION_P.
3609 (make_frame_visible_1): Simplify the loop.
3610 Use contents slot, not buffer, where appropriate.
3611 * xdisp.c (hscroll_window_tree, mark_window_display_accurate)
3612 (redisplay_windows, redisplay_mode_lines, update_cursor_in_window_tree)
3613 (expose_window_tree): Likewise.
3614 Use contents slot, not buffer, where appropriate.
3615 * textprop.c (get_char_property_and_overlay): Add CHECK_LIVE_WINDOW
3616 to avoid deleted windows. Use contents slot instead of buffer.
3617 * buffer.c, dispextern.h, editfns.c, fileio.c, font.c, fringe.c:
3618 * indent.c, insdel.c, keyboard.c, keymap.c, minibuf.c, msdos.c:
3619 * nsfns.m, nsmenu.m, nsterm.m, print.c, w32fns.c, w32menu.c, xfaces.c:
3620 * xfns.c, xmenu.c: Use contents slot, not buffer, where appropriate.
3621
121ab1cd
EZ
36222013-03-28 Eli Zaretskii <eliz@gnu.org>
3623
ef454cf7
EZ
3624 * w32fns.c (w32_wnd_proc) [ENABLE_CHECKING]: Add code to help
3625 identify the reasons for assertion violations in bug#14062 and
3626 similar ones.
21e930f8
EZ
3627 (Fx_show_tip): Fix compilation error under
3628 "--enable-check-lisp-object-type". (Bug#14073)
ef454cf7 3629
121ab1cd
EZ
3630 * image.c (g_error_free) [WINDOWSNT]: Add DEF_IMGLIB_FN.
3631 Reported by <rzl24ozi@gmail.com>.
3632
5c89ca24
DA
36332013-03-28 Dmitry Antipov <dmantipov@yandex.ru>
3634
3635 * xdisp.c (with_echo_area_buffer_unwind_data): Save window
3636 start marker...
562c6ee9
SM
3637 (unwind_with_echo_area_buffer): ...to restore it here.
3638 This is needed to ensure that...
5c89ca24
DA
3639 (redisplay_window): ...both window markers are valid here,
3640 which is verified by eassert.
3641 * editfns.c (save_excursion_save): Do not assume that
3642 selected_window always displays the buffer.
c7f53895
DA
3643 * buffer.c (Fbuffer_swap_text): Adjust window start markers.
3644 Fix comment.
5c89ca24 3645
f557c1b1
SM
36462013-03-27 Stefan Monnier <monnier@iro.umontreal.ca>
3647
3648 * casetab.c (init_casetab_once): Don't abuse the ascii eqv table for
3649 the upcase table.
3650
40693bba 36512013-03-27 rzl24ozi <rzl24ozi@gmail.com> (tiny changes)
3652
3653 * image.c [WINDOWSNT]: Fix calls to DEF_IMGLIB_FN for SVG function.
3654
c86f791f
EZ
36552013-03-27 Eli Zaretskii <eliz@gnu.org>
3656
3657 * w32proc.c (IsValidLocale) [__GNUC__]: Don't declare prototype,
3658 since MinGW's w32api headers do. This avoids compiler warnings.
3659
3660 * w32.c (FSCTL_GET_REPARSE_POINT) [_MSC_VER || _W64]: Don't define
3661 if already defined.
3662
c6e72e17
EZ
36632013-03-26 Eli Zaretskii <eliz@gnu.org>
3664
3665 * w32.c (_REPARSE_DATA_BUFFER): Condition by _MSVC and _W64.
3666
54e95010
JD
36672013-03-26 Jan Djärv <jan.h.d@swipnet.se>
3668
3669 * gtkutil.c (style_changed_cb): Check if frame is live and an
3670 X frame (Bug#14038).
3671
b88b62de
EZ
36722013-03-26 Eli Zaretskii <eliz@gnu.org>
3673
a18d7de6
EZ
3674 * w32.c (_PROCESS_MEMORY_COUNTERS_EX) [_WIN32_WINNT < 0x0500]:
3675 Define only for _WIN32_WINNT less than 0x0500.
da9dcbb8
EZ
3676 (_ANONYMOUS_UNION, _ANONYMOUS_STRUCT) [!_W64]: Don't define for
3677 MinGW64.
8f5e14c8
EZ
3678 Move inclusion of time.h before sys/time.h, so that MinGW64 could
3679 see its own definitions of 'struct timeval' and 'struct timezone'.
a18d7de6 3680
b88b62de
EZ
3681 Fix incompatibilities between MinGW.org and MinGW64 headers.
3682 * w32term.c (WCRANGE, GLYPHSET): Don't define if _W64 is defined.
3683
3684 * w32.c (REPARSE_DATA_BUFFER): Guard with
3685 MAXIMUM_REPARSE_DATA_BUFFER_SIZE being defined.
3686
c074e458
JD
36872013-03-25 Jan Djärv <jan.h.d@swipnet.se>
3688
3689 * xterm.c: Include X11/XKBlib.h
3690 (XTring_bell): Use XkbBell if HAVE_XKB (Bug#14041).
3691
908589fd
AS
36922013-03-24 Andreas Schwab <schwab@linux-m68k.org>
3693
3694 * alloc.c (xpalloc, Fgarbage_collect): Reorder conditions that are
3695 written backwards.
3696 * blockinput.h (input_blocked_p): Likewise.
3697 * bytecode.c (exec_byte_code): Likewise.
3698 * callproc.c (call_process_kill, call_process_cleanup)
3699 (Fcall_process): Likewise.
3700 * ccl.c (ccl_driver, resolve_symbol_ccl_program)
3701 (Fccl_execute_on_string): Likewise.
3702 * character.c (string_escape_byte8): Likewise.
3703 * charset.c (read_hex): Likewise.
3704 * cm.c (calccost): Likewise.
3705 * data.c (cons_to_unsigned): Likewise.
3706 * dired.c (directory_files_internal, file_name_completion):
3707 Likewise.
3708 * dispnew.c (scrolling_window, update_frame_1, Fsleep_for)
3709 (sit_for): Likewise.
3710 * doc.c (Fsubstitute_command_keys): Likewise.
3711 * doprnt.c (doprnt): Likewise.
3712 * editfns.c (hi_time, decode_time_components, Fformat): Likewise.
3713 * emacsgtkfixed.c: Likewise.
3714 * fileio.c (file_offset, Fwrite_region): Likewise.
3715 * floatfns.c (Fexpt, fmod_float): Likewise.
3716 * fns.c (larger_vector, make_hash_table, Fmake_hash_table):
3717 Likewise.
3718 * font.c (font_intern_prop): Likewise.
3719 * frame.c (x_set_alpha): Likewise.
3720 * gtkutil.c (get_utf8_string): Likewise.
3721 * indent.c (check_display_width): Likewise.
3722 * intervals.c (create_root_interval, rotate_right, rotate_left)
3723 (split_interval_right, split_interval_left)
3724 (adjust_intervals_for_insertion, delete_node)
3725 (interval_deletion_adjustment, adjust_intervals_for_deletion)
3726 (merge_interval_right, merge_interval_left, copy_intervals)
3727 (set_intervals_multibyte_1): Likewise.
3728 * keyboard.c (gobble_input, append_tool_bar_item): Likewise.
3729 * keymap.c (Fkey_description): Likewise.
3730 * lisp.h (FIXNUM_OVERFLOW_P, vcopy): Likewise.
3731 * lread.c (openp, read_integer, read1, string_to_number):
3732 Likewise.
3733 * menu.c (ensure_menu_items): Likewise.
3734 * minibuf.c (read_minibuf_noninteractive): Likewise.
3735 * print.c (printchar, strout): Likewise.
3736 * process.c (create_process, Faccept_process_output)
3737 (wait_reading_process_output, read_process_output, send_process)
3738 (wait_reading_process_output): Likewise.
3739 * profiler.c (make_log, handle_profiler_signal): Likewise.
3740 * regex.c (re_exec): Likewise.
3741 * regex.h: Likewise.
3742 * search.c (looking_at_1, Freplace_match): Likewise.
3743 * sysdep.c (get_child_status, procfs_ttyname)
3744 (procfs_get_total_memory): Likewise.
3745 * systime.h (EMACS_TIME_VALID_P): Likewise.
3746 * term.c (dissociate_if_controlling_tty): Likewise.
3747 * window.c (get_phys_cursor_glyph): Likewise.
3748 * xdisp.c (init_iterator, redisplay_internal, redisplay_window)
3749 (try_window_reusing_current_matrix, try_window_id, pint2hrstr):
3750 Likewise.
3751 * xfns.c (Fx_window_property): Likewise.
3752 * xmenu.c (set_frame_menubar): Likewise.
3753 * xselect.c (x_get_window_property, x_handle_dnd_message):
3754 Likewise.
3755 * xsmfns.c (smc_save_yourself_CB): Likewise.
3756 * xterm.c (x_scroll_bar_set_handle): Likewise.
3757
2bf7d27a
DA
37582013-03-24 Dmitry Antipov <dmantipov@yandex.ru>
3759
3760 * xfaces.c (Finternal_face_x_get_resource): Allow 3rd (frame) argument
3761 to be optional or nil. Adjust comment and convert it to docstring.
3762 * xselect.c (Fx_send_client_event): Rename to Fx_send_client_message.
3763 * frame.c (display_x_get_resource, Fx_get_resource): Break long line.
3764
a9ebfa0b
PE
37652013-03-24 Paul Eggert <eggert@cs.ucla.edu>
3766
3767 Static checking by GCC 4.8-20130319.
3768 * image.c (gif_load): Assume pass < 3 to pacify GCC.
3769 * process.c (Fset_process_datagram_address)
3770 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
3771 * xdisp.c (get_char_face_and_encoding):
3772 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
3773 (get_glyph_face_and_encoding): Prepare face before possibly using it.
3774 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
3775
4f3576ee
KB
37762013-03-24 Ken Brown <kbrown@cornell.edu>
3777
789b5e9a
KB
3778 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
3779 fix compilation on 64-bit Cygwin, where underscores are not
3780 automatically prepended.
3781
4f3576ee
KB
3782 * w32term.c (w32_initialize): Silence compiler warning.
3783
b5b7745f
EZ
37842013-03-23 Eli Zaretskii <eliz@gnu.org>
3785
cdc0d0bd
EZ
3786 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
3787 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
562c6ee9
SM
3788 variables, to save and restore frame dimensions.
3789 Use FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
3790 after returning from a 'fullscreen' configuration.
3791 use SendMessage instead of PostMessage to send the SC_RESTORE message,
cdc0d0bd
EZ
3792 to avoid races between the main thread and the input thread.
3793
3794 * w32term.h (struct w32_output): New members normal_width,
3795 normal_height, normal_top, normal_left, and prev_fsmode.
3796 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
3797 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
3798 members of a frame.
3799
b5b7745f
EZ
3800 * w32term.c (w32fullscreen_hook): Record last value of the frame's
3801 'fullscreen' parameter. Always record previous width and height
3802 of the frame, except when switching out of maximized modes, so
3803 that they could be restored correctly, instead of resetting to the
3804 default frame dimensions. Send SC_RESTORE command to the frame,
3805 unless we are going to send SC_MAXIMIZE, to restore the frame
3806 resize hints in the mouse pointer shown by the window manager.
3807 (Bug#14032)
3808
3809 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
3810
3811 * lisp.h (get_frame_param): Adjust conditions for prototype
3812 declaration.
3813
a3454eed
KB
38142013-03-22 Ken Brown <kbrown@cornell.edu>
3815
3816 * unexcw.c: Drop unneeded inclusion of w32common.h.
3817 (report_sheap_usage): Declare.
3818 (read_exe_header): Add magic numbers for x86_64.
3819 (fixup_executable): Fix printf format specifier for unsigned long
3820 argument.
3821
5a49b79c
DA
38222013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
3823
3824 * frame.h (struct frame): Put menu_bar_window under #ifdef
3825 because this member is not needed when X toolkit is in use.
3826 (fset_menu_bar_window):
3827 * dispnew.c (clear_current_matrices, clear_desired_matrices)
3828 (free_glyphs, update_frame):
3829 * xdisp.c (expose_frame): Likewise.
3830 (display_menu_bar): Likewise. Remove redundant eassert.
3831 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
3832 toolkit is in use.
3833
d6723bf7
PE
38342013-03-21 Paul Eggert <eggert@cs.ucla.edu>
3835
7b1123d8
PE
3836 Use functions and constants to manipulate Lisp_Save_Value objects.
3837 This replaces code that used macros and strings and token-pasting.
3838 The change makes the C source a bit easier to follow,
3839 and shrinks the Emacs executable a bit.
3840 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
3841 (make_save_value): Change 1st arg from string to enum. All callers
3842 changed.
3843 (INTX): Remove.
3844 (mark_object): Use if, not #if, for GC_MARK_STACK.
3845 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
3846 (XSAVE_OBJECT): Now functions, not macros.
3847 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
3848 the constant was never used.
3849 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
3850 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
3851 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
3852 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
3853 New constants.
3854 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
3855 type3 with a single member save_type. All uses changed.
3856 (save_type, set_save_pointer, set_save_integer): New functions.
3857 * print.c (PRINTX): Remove.
3858
d6723bf7
PE
3859 * alloc.c: Remove redundant static declarations.
3860
5f24fa51
DA
38612013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
3862
3863 * window.h (struct window): Convert left_col, top_line, total_lines
3864 and total_cols from Lisp_Objects to integers. Adjust comments.
3865 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
3866 Remove.
3867 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
3868 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
3869 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
3870 Adjust users where appropriate.
3871
42143acd
DA
38722013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
3873
3874 * frame.h (struct frame): Drop resx and resy because the same data is
3875 available from window system-specific output context. Adjust users.
562c6ee9
SM
3876 (default_pixels_per_inch_x, default_pixels_per_inch_y):
3877 New functions to provide defaults when no window system available.
42143acd 3878 (FRAME_RES_X, FRAME_RES_Y): New macros.
562c6ee9 3879 (NUMVAL): Move from xdisp.c.
42143acd
DA
3880 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
3881 (Ffont_face_attributes, Fopen_font):
3882 * image.c (gs_load):
3883 * w32font.c (fill_in_logfont):
3884 * xdisp.c (calc_pixel_width_or_height):
3885 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
3886 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
3887
c0a17406
KH
38882013-03-20 Kenichi Handa <handa@gnu.org>
3889
3890 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
3891 to 1 (temporary workaround until a bug related to ASCII
3892 optimization is fixed).
3893
095d384d
DA
38942013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
3895
3896 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
3897 Signal error if window is not internal. Adjust docstring.
3898 (delete_all_child_windows): Use combination_limit to save the buffer.
3899 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
3900 * print.c (syms_of_print): Initialize debugging output not here...
3901 (init_print_once): ...but in a new function here.
3902 * lisp.h (init_print_once): Add prototype.
3903 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 3904
748fa866
DA
39052013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
3906
3907 * window.c (window_resize_check, window_resize_apply)
3908 (window_from_coordinates, recombine_windows, set_window_buffer)
3909 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
3910 (Fsplit_window_internal, Fdelete_window_internal)
3911 (freeze_window_starts): Use bool for booleans.
3912 * window.h (window_frame_coordinates, resize_frame_windows)
3913 (freeze_window_starts, set_window_buffer): Adjust prototypes.
3914
81519fd2
SM
39152013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
3916
3917 * dispnew.c (bitch_at_user): Use `user-error'.
3918
6db423a9
KB
39192013-03-17 Ken Brown <kbrown@cornell.edu>
3920
3921 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
3922 as return type of image_background. (Bug#13981)
3923 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
3924
8f2906f5
JD
39252013-03-16 Jan Djärv <jan.h.d@swipnet.se>
3926
960ce480 3927 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 3928 (ns_select): Don't return with result uninitialized.
960ce480 3929
8f2906f5
JD
3930 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
3931 and getDirectory.
3932
81519fd2
SM
3933 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
3934 New functions.
8f2906f5
JD
3935 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
3936 directories. If filename is nil, get directory name (Bug#13932).
3937 Use getFilename and getDirectory.
3938 (getFilename, getDirectory): New methods for EmacsSavePanel and
3939 EmacsOpenPanel.
3940 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
3941
cded56c1
PE
39422013-03-15 Paul Eggert <eggert@cs.ucla.edu>
3943
3944 * coding.c (decode_coding_gap): Fix typo caught by static checking.
3945
251e9147 39462013-03-15 Kenichi Handa <handa@gnu.org>
8a44e6d1
KH
3947
3948 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
3949 (adjust_after_replace): Make it back to static. Delete the third
3950 arg text_at_gap_tail. Cancel the code for handling it.
3951
3952 * coding.h (struct coding_system): New member eol_seen.
3953
3954 * coding.c (detect_ascii): New function.
3955 (detect_coding): Set coding->head_ascii and coding->eol_seen only
3956 when the source bytes are actually scanned. On detecting for
3957 coding_category_utf_8_auto, call detect_ascii instead of scanning
3958 source bytes directly.
3959 (produce_chars): Call insert_from_gap with the new arg 0.
3960 (encode_coding): Likewise.
3961 (decode_coding_gap): Control ASCII optimization by the variable
3962 disable_ascii_optimization instead of #ifndef .. #endif.
3963 Deccode EOL format according to coding->eol_seen.
3964 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
3965 variable.
3966
8a44e6d1
KH
3967 * lisp.h (adjust_after_replace): Cancel externing it.
3968 (insert_from_gap): Adjust prototype.
3969
5f795e34
EZ
39702013-03-15 Eli Zaretskii <eliz@gnu.org>
3971
3972 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
3973 FULLSCREEN_MAXIMIZED. (Bug#13935)
3974
f258b4be
DA
39752013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
3976
3977 * region-cache.c (find_cache_boundary, move_cache_gap)
3978 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
3979 Simplify debugging check and convert to eassert. Adjust comment.
3980 (pp_cache): Put under ENABLE_CHECKING.
3981
a5cc4dde
EZ
39822013-03-14 Eli Zaretskii <eliz@gnu.org>
3983
3984 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
3985 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
3986 and WM_ACTIVATEAPP.
3987 (w32fullscreen_hook): If the frame is visible, reset
3988 f->want_fullscreen flag after changing the frame size. If the
3989 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
3990 (Bug#13953)
3991
3fc5e44a
DC
39922013-03-13 Daniel Colascione <dancol@dancol.org>
3993
3994 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
3995 too so that these builds can use Cygwin's file conversion
3996 functions. (We've been building and linking cygw32.o all along
3997 and just not using it.)
3998
47d7532e
PE
39992013-03-13 Paul Eggert <eggert@cs.ucla.edu>
4000
4001 File synchronization fixes (Bug#13944).
4002 * Makefile.in (LIB_FDATASYNC): New macro.
4003 (LIBES): Use it.
4004 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
4005 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
4006 Don't worry about HAVE_FSYNC, since a substitute fsync is
4007 available if the system lacks one.
4008 (Fwrite_regin): Retry fsync if interrupted.
4009
c7ffccaf
EZ
40102013-03-13 Eli Zaretskii <eliz@gnu.org>
4011
4e2df81d 4012 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
4013 activated, call w32fullscreen_hook, to make sure the new frame
4014 dimensions are in effect. (Bug#13937)
4015
8a7debc1
DA
40162013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
4017
4018 * xdisp.c (init_iterator): Simplify because both character and byte
4019 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
4020 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
4021 character and byte positions can be obtained from marker.
8a7debc1 4022
7fd8c501
PE
40232013-03-13 Paul Eggert <eggert@cs.ucla.edu>
4024
d9df6f40
PE
4025 Static checking by Sun C 5.12.
4026 * alloc.c (buffer_memory_full) [REL_ALLOC]:
4027 * bytecode.c (exec_byte_code):
4028 * dispnew.c (init_display):
4029 * eval.c (error):
4030 * fileio.c (Fsubstitute_in_file_name):
4031 * keyboard.c (Fevent_convert_list):
4032 * keymap.c (Fsingle_key_description):
4033 * term.c (maybe_fatal, fatal):
4034 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
4035 * xsmfns.c (Fhandle_save_session):
4036 Omit unreachable code.
4037 * keymap.c (map_keymap_char_table_item): Cast void * to
4038 a function pointer type; the C Standard requires this.
4039
7fd8c501
PE
4040 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
4041 Include <sys/param.h> unconditionally, as that works elsewhere and
4042 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
4043 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
4044 and FreeBSD now.
4045
a020afb9 4046See ChangeLog.12 for earlier changes.
aac0c6e3
MR
4047
4048;; Local Variables:
4049;; coding: utf-8
aac0c6e3
MR
4050;; End:
4051
ab422c4d 4052 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
4053
4054 This file is part of GNU Emacs.
4055
4056 GNU Emacs is free software: you can redistribute it and/or modify
4057 it under the terms of the GNU General Public License as published by
4058 the Free Software Foundation, either version 3 of the License, or
4059 (at your option) any later version.
4060
4061 GNU Emacs is distributed in the hope that it will be useful,
4062 but WITHOUT ANY WARRANTY; without even the implied warranty of
4063 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4064 GNU General Public License for more details.
4065
4066 You should have received a copy of the GNU General Public License
4067 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.