Static checking by GCC 4.8-20130319.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
a9ebfa0b
PE
12013-03-24 Paul Eggert <eggert@cs.ucla.edu>
2
3 Static checking by GCC 4.8-20130319.
4 * image.c (gif_load): Assume pass < 3 to pacify GCC.
5 * process.c (Fset_process_datagram_address)
6 (Fmake_network_process): Check get_lisp_to_sockaddr_size return value.
7 * xdisp.c (get_char_face_and_encoding):
8 (get_glyph_face_and_encoding): Ensure that *CHAR2B is initialized.
9 (get_glyph_face_and_encoding): Prepare face before possibly using it.
10 (get_per_char_metric): Don't use CHAR2B if it might not be initialized.
11
4f3576ee
KB
122013-03-24 Ken Brown <kbrown@cornell.edu>
13
789b5e9a
KB
14 * w32fns.c (emacs_abort) [CYGWIN]: Define `_open' as a macro to
15 fix compilation on 64-bit Cygwin, where underscores are not
16 automatically prepended.
17
4f3576ee
KB
18 * w32term.c (w32_initialize): Silence compiler warning.
19
b5b7745f
EZ
202013-03-23 Eli Zaretskii <eliz@gnu.org>
21
cdc0d0bd
EZ
22 * w32term.c (w32fullscreen_hook): Use FRAME_NORMAL_WIDTH,
23 FRAME_NORMAL_HEIGHT, and FRAME_PREV_FSMODE, instead of static
24 variables, to save and restore frame dimensions. Use
25 FRAME_NORMAL_LEFT and FRAME_NORMAL_TOP to restore frame position
26 after returning from a 'fullscreen' configuration. use
27 SendMessage instead of PostMessage to send the SC_RESTORE message,
28 to avoid races between the main thread and the input thread.
29
30 * w32term.h (struct w32_output): New members normal_width,
31 normal_height, normal_top, normal_left, and prev_fsmode.
32 (FRAME_NORMAL_WIDTH, FRAME_NORMAL_HEIGHT, FRAME_NORMAL_TOP)
33 (FRAME_NORMAL_LEFT, FRAME_PREV_FSMODE): New macros to access these
34 members of a frame.
35
b5b7745f
EZ
36 * w32term.c (w32fullscreen_hook): Record last value of the frame's
37 'fullscreen' parameter. Always record previous width and height
38 of the frame, except when switching out of maximized modes, so
39 that they could be restored correctly, instead of resetting to the
40 default frame dimensions. Send SC_RESTORE command to the frame,
41 unless we are going to send SC_MAXIMIZE, to restore the frame
42 resize hints in the mouse pointer shown by the window manager.
43 (Bug#14032)
44
45 * frame.c (get_frame_param): Now extern for WINDOWSNT as well.
46
47 * lisp.h (get_frame_param): Adjust conditions for prototype
48 declaration.
49
a3454eed
KB
502013-03-22 Ken Brown <kbrown@cornell.edu>
51
52 * unexcw.c: Drop unneeded inclusion of w32common.h.
53 (report_sheap_usage): Declare.
54 (read_exe_header): Add magic numbers for x86_64.
55 (fixup_executable): Fix printf format specifier for unsigned long
56 argument.
57
5a49b79c
DA
582013-03-22 Dmitry Antipov <dmantipov@yandex.ru>
59
60 * frame.h (struct frame): Put menu_bar_window under #ifdef
61 because this member is not needed when X toolkit is in use.
62 (fset_menu_bar_window):
63 * dispnew.c (clear_current_matrices, clear_desired_matrices)
64 (free_glyphs, update_frame):
65 * xdisp.c (expose_frame): Likewise.
66 (display_menu_bar): Likewise. Remove redundant eassert.
67 * window.h (WINDOW_MENU_BAR_P): Always define to 0 if X
68 toolkit is in use.
69
d6723bf7
PE
702013-03-21 Paul Eggert <eggert@cs.ucla.edu>
71
7b1123d8
PE
72 Use functions and constants to manipulate Lisp_Save_Value objects.
73 This replaces code that used macros and strings and token-pasting.
74 The change makes the C source a bit easier to follow,
75 and shrinks the Emacs executable a bit.
76 * alloc.c: Verify some properties of Lisp_Save_Value's representation.
77 (make_save_value): Change 1st arg from string to enum. All callers
78 changed.
79 (INTX): Remove.
80 (mark_object): Use if, not #if, for GC_MARK_STACK.
81 * lisp.h (SAVE_VALUEP, XSAVE_VALUE, XSAVE_POINTER, XSAVE_INTEGER)
82 (XSAVE_OBJECT): Now functions, not macros.
83 (STRING_BYTES_BOUND): Now just a macro, not a constant too;
84 the constant was never used.
85 (SAVE_SLOT_BITS, SAVE_VALUE_SLOTS, SAVE_TYPE_BITS, SAVE_TYPE_INT_INT)
86 (SAVE_TYPE_INT_INT_INT, SAVE_TYPE_OBJ_OBJ, SAVE_TYPE_OBJ_OBJ_OBJ)
87 (SAVE_TYPE_OBJ_OBJ_OBJ_OBJ, SAVE_TYPE_PTR_INT, SAVE_TYPE_PTR_OBJ)
88 (SAVE_TYPE_PTR_PTR, SAVE_TYPE_PTR_PTR_OBJ, SAVE_TYPE_MEMORY):
89 New constants.
90 (struct Lisp_Save_Value): Replace members area, type0, type1, type2,
91 type3 with a single member save_type. All uses changed.
92 (save_type, set_save_pointer, set_save_integer): New functions.
93 * print.c (PRINTX): Remove.
94
d6723bf7
PE
95 * alloc.c: Remove redundant static declarations.
96
5f24fa51
DA
972013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
98
99 * window.h (struct window): Convert left_col, top_line, total_lines
100 and total_cols from Lisp_Objects to integers. Adjust comments.
101 (wset_left_col, wset_top_line, wset_total_cols, wset_total_lines):
102 Remove.
103 (WINDOW_TOTAL_COLS, WINDOW_TOTAL_LINES, WINDOW_LEFT_EDGE_COL)
104 (WINDOW_TOP_EDGE_LINE): Drop Lisp_Object to integer conversion.
105 * dispnew.c, frame.c, w32fns.c, window.c, xdisp.c, xfns.c:
106 Adjust users where appropriate.
107
42143acd
DA
1082013-03-20 Dmitry Antipov <dmantipov@yandex.ru>
109
110 * frame.h (struct frame): Drop resx and resy because the same data is
111 available from window system-specific output context. Adjust users.
96061a21 112 (default_pixels_per_inch_x, default_pixels_per_inch_y): New
42143acd
DA
113 functions to provide defaults when no window system available.
114 (FRAME_RES_X, FRAME_RES_Y): New macros.
115 (NUMVAL): Moved from xdisp.c.
116 * font.c (font_pixel_size, font_find_for_lface, font_open_for_lface)
117 (Ffont_face_attributes, Fopen_font):
118 * image.c (gs_load):
119 * w32font.c (fill_in_logfont):
120 * xdisp.c (calc_pixel_width_or_height):
121 * xfaces.c (Fx_family_fonts, set_lface_from_font): Use them.
122 * xsettings.c (apply_xft_settings): Drop frame loop and adjust comment.
123
c0a17406
KH
1242013-03-20 Kenichi Handa <handa@gnu.org>
125
126 * coding.c (syms_of_coding): Initialize disable_ascii_optimization
127 to 1 (temporary workaround until a bug related to ASCII
128 optimization is fixed).
129
095d384d
DA
1302013-03-19 Dmitry Antipov <dmantipov@yandex.ru>
131
132 * window.c (Fwindow_combination_limit, Fset_window_combination_limit):
133 Signal error if window is not internal. Adjust docstring.
134 (delete_all_child_windows): Use combination_limit to save the buffer.
135 (Fset_window_configuration): Adjust accordingly.
cf4bb06d
DA
136 * print.c (syms_of_print): Initialize debugging output not here...
137 (init_print_once): ...but in a new function here.
138 * lisp.h (init_print_once): Add prototype.
139 * emacs.c (main): Add call to init_print_once. Adjust comments.
095d384d 140
748fa866
DA
1412013-03-18 Dmitry Antipov <dmantipov@yandex.ru>
142
143 * window.c (window_resize_check, window_resize_apply)
144 (window_from_coordinates, recombine_windows, set_window_buffer)
145 (make_parent_window, Fwindow_resize_apply, resize_frame_windows)
146 (Fsplit_window_internal, Fdelete_window_internal)
147 (freeze_window_starts): Use bool for booleans.
148 * window.h (window_frame_coordinates, resize_frame_windows)
149 (freeze_window_starts, set_window_buffer): Adjust prototypes.
150
81519fd2
SM
1512013-03-17 Stefan Monnier <monnier@iro.umontreal.ca>
152
153 * dispnew.c (bitch_at_user): Use `user-error'.
154
6db423a9
KB
1552013-03-17 Ken Brown <kbrown@cornell.edu>
156
157 * dispextern.h (RGB_PIXEL_COLOR): Move here from image.c. Use it
158 as return type of image_background. (Bug#13981)
159 * image.c (RGB_PIXEL_COLOR): Move to dispextern.h.
160
8f2906f5
JD
1612013-03-16 Jan Djärv <jan.h.d@swipnet.se>
162
960ce480 163 * nsterm.m (updateFrameSize:): Change resize increments if needed.
6615748a 164 (ns_select): Don't return with result uninitialized.
960ce480 165
8f2906f5
JD
166 * nsterm.h (EmacsSavePanel, EmacsOpenPanel): Add getFilename
167 and getDirectory.
168
81519fd2
SM
169 * nsfns.m (ns_filename_from_panel, ns_directory_from_panel):
170 New functions.
8f2906f5
JD
171 (Fns_read_file_name): ret is BOOL. If ! dir_only_p, don't choose
172 directories. If filename is nil, get directory name (Bug#13932).
173 Use getFilename and getDirectory.
174 (getFilename, getDirectory): New methods for EmacsSavePanel and
175 EmacsOpenPanel.
176 (ok:): In EmacsOpenPanel, if we can't choose directories, just return.
177
cded56c1
PE
1782013-03-15 Paul Eggert <eggert@cs.ucla.edu>
179
180 * coding.c (decode_coding_gap): Fix typo caught by static checking.
181
8a44e6d1
KH
1822013-03-15 handa <handa@gnu.org>
183
184 * insdel.c (insert_from_gap): New arg text_at_gap_tail.
185 (adjust_after_replace): Make it back to static. Delete the third
186 arg text_at_gap_tail. Cancel the code for handling it.
187
188 * coding.h (struct coding_system): New member eol_seen.
189
190 * coding.c (detect_ascii): New function.
191 (detect_coding): Set coding->head_ascii and coding->eol_seen only
192 when the source bytes are actually scanned. On detecting for
193 coding_category_utf_8_auto, call detect_ascii instead of scanning
194 source bytes directly.
195 (produce_chars): Call insert_from_gap with the new arg 0.
196 (encode_coding): Likewise.
197 (decode_coding_gap): Control ASCII optimization by the variable
198 disable_ascii_optimization instead of #ifndef .. #endif.
199 Deccode EOL format according to coding->eol_seen.
200 (syms_of_coding): Declare disable-ascii-optimization as a Lisp
201 variable.
202
8a44e6d1
KH
203 * lisp.h (adjust_after_replace): Cancel externing it.
204 (insert_from_gap): Adjust prototype.
205
5f795e34
EZ
2062013-03-15 Eli Zaretskii <eliz@gnu.org>
207
208 * w32term.c (w32fullscreen_hook): Swap FULLSCREEN_BOTH and
209 FULLSCREEN_MAXIMIZED. (Bug#13935)
210
f258b4be
DA
2112013-03-15 Dmitry Antipov <dmantipov@yandex.ru>
212
213 * region-cache.c (find_cache_boundary, move_cache_gap)
214 (insert_cache_boundary, delete_cache_boundaries, set_cache_region):
215 Simplify debugging check and convert to eassert. Adjust comment.
216 (pp_cache): Put under ENABLE_CHECKING.
217
a5cc4dde
EZ
2182013-03-14 Eli Zaretskii <eliz@gnu.org>
219
220 * w32term.c (w32_read_socket) <WM_WINDOWPOSCHANGED>: Remove old
221 and incorrect code. Treat WM_WINDOWPOSCHANGED like WM_ACTIVATE
222 and WM_ACTIVATEAPP.
223 (w32fullscreen_hook): If the frame is visible, reset
224 f->want_fullscreen flag after changing the frame size. If the
225 frame is not visible, set f->want_fullscreen to FULLSCREEN_WAIT.
226 (Bug#13953)
227
3fc5e44a
DC
2282013-03-13 Daniel Colascione <dancol@dancol.org>
229
230 * emacs.c (main): Call syms_of_cygw32 on CYGWIN non-NTGUI builds
231 too so that these builds can use Cygwin's file conversion
232 functions. (We've been building and linking cygw32.o all along
233 and just not using it.)
234
47d7532e
PE
2352013-03-13 Paul Eggert <eggert@cs.ucla.edu>
236
237 File synchronization fixes (Bug#13944).
238 * Makefile.in (LIB_FDATASYNC): New macro.
239 (LIBES): Use it.
240 * conf_post.h (BSD_SYSTEM, BSD_SYSTEM_AHB): Remove; no longer needed.
241 * fileio.c (Fwrite_region, write_region_inhibit_fsync):
242 Don't worry about HAVE_FSYNC, since a substitute fsync is
243 available if the system lacks one.
244 (Fwrite_regin): Retry fsync if interrupted.
245
c7ffccaf
EZ
2462013-03-13 Eli Zaretskii <eliz@gnu.org>
247
4e2df81d 248 * w32term.c (w32_read_socket): If the Emacs frame is being
c7ffccaf
EZ
249 activated, call w32fullscreen_hook, to make sure the new frame
250 dimensions are in effect. (Bug#13937)
251
8a7debc1
DA
2522013-03-13 Dmitry Antipov <dmantipov@yandex.ru>
253
254 * xdisp.c (init_iterator): Simplify because both character and byte
255 positions are either specified or -1. Add eassert. Adjust comment.
ffcd945e
DA
256 * window.c (Fscroll_other_window): Use SET_PT_BOTH because both
257 character and byte positions can be obtained from marker.
8a7debc1 258
7fd8c501
PE
2592013-03-13 Paul Eggert <eggert@cs.ucla.edu>
260
d9df6f40
PE
261 Static checking by Sun C 5.12.
262 * alloc.c (buffer_memory_full) [REL_ALLOC]:
263 * bytecode.c (exec_byte_code):
264 * dispnew.c (init_display):
265 * eval.c (error):
266 * fileio.c (Fsubstitute_in_file_name):
267 * keyboard.c (Fevent_convert_list):
268 * keymap.c (Fsingle_key_description):
269 * term.c (maybe_fatal, fatal):
270 * xfns.c (Fx_display_backing_store, Fx_display_visual_class):
271 * xsmfns.c (Fhandle_save_session):
272 Omit unreachable code.
273 * keymap.c (map_keymap_char_table_item): Cast void * to
274 a function pointer type; the C Standard requires this.
275
7fd8c501
PE
276 * sysdep.c: Remove a use of BSD_SYSTEM, which I'm trying to phase out.
277 Include <sys/param.h> unconditionally, as that works elsewhere and
278 is simpler here. Include <sys/sysctl.h> if DARWIN_OS ||
279 __FreeBSD__, not if BSD_SYSTEM, since it's needed only for Darwin
280 and FreeBSD now.
281
cb0290df
PE
2822013-03-11 Paul Eggert <eggert@cs.ucla.edu>
283
284 * insdel.c (adjust_after_replace): Use bool for boolean.
285
cbae07d5
SM
2862013-03-11 Stefan Monnier <monnier@iro.umontreal.ca>
287
288 * keyboard.c: Move keyboard decoding to read_key_sequence.
289 (decode_keyboard_code): Remove.
290 (tty_read_avail_input): Don't try to decode input.
291 (read_decoded_char): New function.
292 (read_key_sequence): Use it.
293
819e2da9
DC
2942013-03-10 Daniel Colascione <dancol@dancol.org>
295
296 * w32term.h (GUISTR, GUI_ENCODE_FILE, GUI_ENCODE_SYSTEM, GUI_FN)
297 (GUI_SDATA, guichar_t): Macros to abstract out differences between
298 NTGUI_UNICODE and !NTGUI_UNICODE builds, some moved out of
299 w32fns.c.
300
301 * w32term.c (construct_drag_n_drop): Use the above macros to make
302 drag-and-drop work for non-ASCII filenames in cygw32 builds.
303
304 * w32fns.c (x_set_name, x_set_title): Use the above macros to
305 properly display non-ASCII frame titles in cygw32 builds.
306
307 * w32fns.c (Fw32_shell_execute): Use the above macros to properly
308 call ShellExecute in cygw32 builds.
309
310 * w32fn.c (Fx_file_dialog): Use the above macros to simplify the
311 common file dialog code.
312
313 * w32fns.c (Ffile_system_info): Remove from cygw32 builds, which
314 can just use du like other systems.
315
316 * coding.c (from_unicode_buffer): Declare.
317 * coding.c (from_unicode_buffer): Implement.
318
99ec1647
SM
3192013-03-10 Stefan Monnier <monnier@iro.umontreal.ca>
320
d2e24f92
SM
321 * lread.c: Minor cleanup.
322 (FROM_FILE_P): New macro.
323 (skip_dyn_bytes, unreadchar, read1): Use it.
324 (read_list): Consolidate duplicated code.
325
99ec1647
SM
326 * bytecode.c (struct byte_stack): Remove `constants' when unused.
327
138c0ae8
EZ
3282013-03-10 Eli Zaretskii <eliz@gnu.org>
329
330 * xdisp.c (display_tool_bar_line, redisplay_tool_bar)
331 (redisplay_internal, set_cursor_from_row, try_window)
332 (try_window_id, dump_glyph_row, extend_face_to_end_of_line)
333 (display_line, notice_overwritten_cursor)
99ec1647
SM
334 (mouse_face_from_buffer_pos, note_mouse_highlight):
335 Use MATRIX_ROW_DISPLAYS_TEXT_P.
138c0ae8 336 (note_mouse_highlight): Use MATRIX_ROW_GLYPH_START.
99ec1647
SM
337 (mouse_face_from_string_pos, fast_find_string_pos):
338 Use MATRIX_ROW_VPOS.
138c0ae8
EZ
339
340 * xfns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
341
342 * w32fns.c (Fx_show_tip): Use MATRIX_ROW_DISPLAYS_TEXT_P.
343
344 * xdisp.c (try_cursor_movement): Use MATRIX_ROW and
345 MATRIX_MODE_LINE_ROW.
346
347 * dispnew.c (update_window): Use MATRIX_ROW and MATRIX_MODE_LINE_ROW.
348
c230dd7d
KH
3492013-03-10 handa <handa@gnu.org>
350
351 * lisp.h (adjust_after_replace): Extern it.
352
353 * coding.c (detect_coding): Cound the heading ASCII bytes in the
354 case of detection for coding_category_utf_8_auto.
99ec1647
SM
355 (decode_coding_gap) [not CODING_DISABLE_ASCII_OPTIMIZATION]:
356 Skip decoding if all bytes are ASCII.
c230dd7d
KH
357
358 * insdel.c (adjust_after_replace): Make it public. New arg
359 text_at_gap_tail.
360 (adjust_after_insert): Call adjust_after_replace with the new arg
361 value 0.
362
27a98a62
SM
3632013-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
364
365 * keyboard.h (EVENT_START, EVENT_END, POSN_WINDOW, POSN_POSN)
366 (POSN_WINDOW_POSN, POSN_TIMESTAMP): Be careful since events may come
367 from Elisp via unread-command-events.
368
369 * keyboard.c (access_keymap_keyremap): Accept nil return value from
370 functions to mean "no change".
371
457882c2
PE
3722013-03-08 Paul Eggert <eggert@cs.ucla.edu>
373
374 region-cache.c, scroll.c, search.c: Use bool for booleans.
375 * lisp.h (compile_pattern):
376 * scroll.c (do_scrolling, do_direct_scrolling):
377 * search.c (struct regexp_cache, compile_pattern_1)
378 (compile_pattern, string_match_1, search_command)
379 (trivial_regexp_p, search_buffer, Freplace_match, match_limit)
380 (search_regs_saved, Fregexp_quote):
381 Use bool for boolean.
382 * region-cache.c (region_cache_forward, region_cache_backward):
383 Fix comments to match code: these functions return int, not boolean.
384
b5426561
DA
3852013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
386
387 * search.c (find_newline): Accept start and end byte positions
388 as arguments and allow -1 if not known.
389 (find_newline_no_quit): Likewise for start position.
390 * lisp.h (find_newline, find_newline_no_quit): Adjust prototype.
391 * bidi.c (bidi_find_paragraph_start): Pass byte position to
392 find_newline_no_quit, thus eliminating CHAR_TO_BYTE.
27a98a62
SM
393 * editfns.c (Fconstrain_to_field): Break long line.
394 Adjust call to find_newline.
b5426561
DA
395 * indent.c (vmotion): Adjust calls to find_newline_no_quit.
396 Use DEC_BOTH to start next search from the previous buffer
397 position, where appropriate.
398 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
399 (get_visually_first_element, move_it_vertically_backward): Likewise.
400 Obtain byte position from the display iterator, where appropriate.
401
0bce5d9e
PE
4022013-03-08 Paul Eggert <eggert@cs.ucla.edu>
403
404 print.c, process.c: Use bool for booleans.
405 * lisp.h (wait_reading_process_output):
406 * print.c (print_output_debug_flag, PRINTDECLARE, printchar)
407 (strout, debug_output_compilation_hack, float_to_string, print)
408 (print_object):
409 * process.c (kbd_is_on_hold, inhibit_sentinels, process_output_skip)
410 (decode_status, status_message, create_process, create_pty)
411 (Fmake_network_process, Fnetwork_interface_info)
412 (wait_reading_process_output, read_process_output)
413 (write_queue_push, write_queue_pop, process_send_signal)
414 (handle_child_signal, keyboard_bit_set, kbd_on_hold_p):
415 * process.h (struct Lisp_Process, inhibit_sentinels, kbd_on_hold_p):
416 Use bool for booleans.
417 * process.c (Fnetwork_interface_list): Remove unused local.
418 (connect_counter): Now EMACS_INT, not int.
419
36075a19
DA
4202013-03-08 Dmitry Antipov <dmantipov@yandex.ru>
421
422 * bidi.c (bidi_fetch_char): Swap first and second arguments
423 to match other functions accepting character and byte positions.
424 Adjust comment.
425 (bidi_resolve_explicit_1, bidi_level_of_next_char): Adjust users.
426 (bidi_paragraph_init): Likewise. Use DEC_BOTH which is faster
427 when you need just to move to the previous buffer position.
428 * xdisp.c (Fcurrent_bidi_paragraph_direction): Use DEC_BOTH.
429
4aae1914
EZ
4302013-03-07 Eli Zaretskii <eliz@gnu.org>
431
432 * .gdbinit (prowlims): Display the enabled_p flag of the row.
433
c54aa166
DA
4342013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
435
436 Avoid character to byte conversions in motion subroutines.
437 * indent.h (compute_motion, vmotion): Add byte position argument.
438 * indent.c (compute_motion): Use it and avoid CHAR_TO_BYTE.
439 Add eassert.
440 (Fcompute_motion): Break long line. Adjust call to compute_motion.
441 Use list5 for return value.
442 (vmotion): Use byte position argument and avoid call to CHAR_TO_BYTE.
443 Adjust comments, style and calls to compute_motion.
444 (Fvertical_motion): Adjust call to vmotion.
445 * window.c (Fdelete_other_windows_internal): Record window start
446 byte position and adjust call to vmotion.
447 (window_scroll_line_based): Likewise with call to compute_motion.
448 Use SET_PT_BOTH.
449 (Frecenter): Adjust calls to vmotion.
450
3de717bd
DA
4512013-03-07 Dmitry Antipov <dmantipov@yandex.ru>
452
453 * lisp.h (list2i, list3i): New functions.
454 (list4i): Move from window.c and make LISP_INLINE.
455 * editfns.c (make_lisp_time):
456 * fns.c (Flocale_info):
457 * keyboard.c (parse_modifiers):
458 * xterm.c (x_ewmh_activate_frame): Use list2i.
459 * instel.c (signal_after_change):
460 * nsfns.m (Fx_server_version, Fxw_color_values):
461 * w32fns.c (Fxw_color_values, Fx_server_version):
462 * xfns.c (Fxw_color_values, Fx_server_version): Use list3i.
463 * fileio.c (Fvisited_file_modtime):
464 * nsfns.m (Fns_display_usable_bounds):
465 * w32.c (ltime): Use list4i.
466
d26e478e
EZ
4672013-03-06 Eli Zaretskii <eliz@gnu.org>
468
a611149e
EZ
469 * search.c (find_newline_no_quit): Rename from find_next_newline.
470 Add commentary.
471
472 * lisp.h (find_newline_no_quit): Rename prototype.
473
474 * xdisp.c (back_to_previous_line_start)
475 (forward_to_next_line_start, get_visually_first_element)
476 (move_it_vertically_backward): Callers of find_newline_no_quit changed.
477 * indent.c (vmotion): Callers of find_newline_no_quit changed.
478 * bidi.c (bidi_find_paragraph_start): Callers of
479 find_newline_no_quit changed.
480
d26e478e
EZ
481 * msdos.c: Change encoding to cp850. (Bug#13879)
482 (fr_keyboard, it_keyboard, dk_keyboard): Update keyboard layouts.
483
1af1a51a
DA
4842013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
485
486 Coding system support cleanup and minor refactoring.
487 * coding.h (enum coding_result_code): Remove
488 CODING_RESULT_INCONSISTENT_EOL and CODING_RESULT_INSUFFICIENT_MEM.
489 (toplevel): Remove unused CODING_MODE_INHIBIT_INCONSISTENT_EOL.
490 (CODING_MODE_LAST_BLOCK, CODING_MODE_SELECTIVE_DISPLAY)
491 (CODING_MODE_DIRECTION, CODING_MODE_FIXED_DESTINATION)
492 (CODING_MODE_SAFE_ENCODING): Rearrange bit values.
493 (decode_coding_region, encode_coding_region, decode_coding_string):
494 Remove unused compatibility macros.
495 * coding.c (Qinconsistent_eol, Qinsufficient_memory): Remove.
496 (record_conversion_result): Adjust user.
497 (syms_of_coding): Likewise.
498 (ALLOC_CONVERSION_WORK_AREA): Use SAFE_ALLOCA.
499 (decode_coding, encode_coding): Add USE_SAFE_ALLOCA and SAFE_FREE.
500 (decode_coding_object): Simplify since xrealloc never returns NULL.
501 Add eassert.
502
0bafabe7 5032013-03-06 Paul Eggert <eggert@cs.ucla.edu>
725eb027 504
9b1c3271 505 Fix a build failure on OpenBSD 4.x and MirBSD (Bug#13881).
0845a75c
PE
506 * sysdep.c (list_system_processes)
507 [BSD_SYSTEM && !DARWIN_OS && !__FreeBSD__]:
9b1c3271 508 Make it a stub in this case; otherwise the build might fail,
0845a75c 509 and this code hasn't been tested on such hosts anyway.
725eb027 510 Problem reported by Nelson H. F. Beebe in
9b1c3271
PE
511 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00021.html>
512 and analyzed by Jérémie Courrèges-Anglas in
513 <http://lists.gnu.org/archive/html/emacs-devel/2013-03/msg00062.html>.
725eb027 514
ffc65bee
DA
5152013-03-06 Dmitry Antipov <dmantipov@yandex.ru>
516
517 * lisp.h (find_next_newline_no_quit): Rename to find_next_newline.
518 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start)
519 (get_visually_first_element, move_it_vertically_backward): Ajust users.
520 * bidi.c (bidi_find_paragraph_start): Likewise.
521 * indent.c (vmotion): Likewise.
522
70743157
PE
5232013-03-05 Paul Eggert <eggert@cs.ucla.edu>
524
525 FILE's lock is now always .#FILE and may be a regular file (Bug#13807).
526 * filelock.c: Include <c-ctype.h>.
527 (MAX_LFINFO): New top-level constant.
528 (lock_info_type): Remove members pid, boot_time. Add members at,
529 dot, colon. Change user member to be the entire buffer, not a
530 pointer. This allows us to handle the case where a foreign
531 pid or boot time exceeds the local range. All uses changed.
532 (LINKS_MIGHT_NOT_WORK): New constant.
533 (FREE_LOCK_INFO): Remove, as the pieces no longer need freeing.
534 (defined_WINDOWSNT): Remove.
535 (MAKE_LOCK_NAME, file_in_lock_file_name):
536 Always use .#FILE (not .#-FILE) for the file lock,
537 even if it is a regular file.
538 (rename_lock_file): New function.
539 (create_lock_file): Use it.
540 (create_lock_file, read_lock_data):
541 Prefer a symbolic link for the lock file, falling back on a
542 regular file if symlinks don't work. Do not try to create
543 symlinks on MS-Windows, due to security hassles. Stick with
544 POSIXish functions (open, read, write, close, fchmod, readlink, symlink,
545 link, rename, unlink, mkstemp) when creating locks, as a GNUish
546 host may be using a Windowsish file system, and cannot use
547 MS-Windows-only system calls. Fall back on mktemp if mkstemp
548 doesn't work. Don't fail merely because of a symlink-contents
549 length limit in the current file system; fall back on regular
550 files. Increase the symlink contents length limit to 8 KiB, this
551 should be big enough for any real use and doesn't crunch the
552 stack.
553 (create_lock_file, lock_file_1, read_lock_data):
554 Simplify allocation of lock file buffers now that they fit in 8 KiB.
555 (lock_file_1): Return error number, not bool. All callers changed.
556 (ELOOP): New macro, if not already defined.
557 (read_lock_data): Return size of lock file contents, not Lisp object.
558 All callers changed. Handle a race condition if some other process
559 replaces a regular-file lock with a symlink lock or vice versa,
560 while we're trying to read the lock.
561 (current_lock_owner): Parse contents more carefully, to help avoid
562 confusing a regular-file lock with some other application's use
563 of the file. Check for lock file contents being too long, or
564 not parsing correctly.
565 (current_lock_owner, lock_file):
566 Allow foreign pid and boot times that exceed the local range.
567 (current_lock_owner, lock_if_free, lock_file):
568 Simplify allocation of lock file contents.
569 * w32.c (sys_rename_replace): New function, containing most of
570 the contents of the old sys_rename.
571 (sys_rename): Use it.
572 (fchmod): New dummy function.
573 * w32.h (sys_rename_replace, fchmod): New decls.
574
05e193f1
EZ
5752013-03-05 Eli Zaretskii <eliz@gnu.org>
576
577 * bidi.c (bidi_resolve_explicit_1): Don't call CHAR_TO_BYTE or
578 bidi_count_bytes, as the callers now arrange for bidi_it->charpos
579 to be in sync with bidi_it->bytepos. Suggested by Dmitry Antipov
580 <dmantipov@yandex.ru>.
581
3bfc46eb
DA
5822013-03-05 Dmitry Antipov <dmantipov@yandex.ru>
583
584 * composite.c (get_composition_id, fill_gstring_header):
585 Use make_uninit_vector where appropriate.
586 * font.c (Ffont_get_glyphs, build_style_table): Likewise.
587 * xselect.c (clean_local_selection_data): Likewise.
588
84ac6f9d
PE
5892013-03-04 Paul Eggert <eggert@cs.ucla.edu>
590
591 Fix misuse of ImageMagick that caused core dump (Bug#13846).
592 * image.c (imagemagick_load_image): Calculate height and width
593 after flattening the image, not before.
594
42926ec8
DA
5952013-03-04 Dmitry Antipov <dmantipov@yandex.ru>
596
597 * font.c (Ffont_get_glyphs): Use convenient LGLYPH_NEW.
598 * ftfont.c (ftfont_shape_by_flt): Likewise.
599 * w32uniscribe.c (uniscribe_shape): Likewise.
600
b5029e23
PE
6012013-03-02 Paul Eggert <eggert@cs.ucla.edu>
602
603 The lock for FILE is now .#FILE or .#-FILE (Bug#13807).
604 The old approach, which fell back on DIR/.#FILE.0 through
605 DIR/.#FILE.9, had race conditions that could not be easily fixed.
606 If DIR/.#FILE is a non-symlink file, Emacs now does not create a
607 lock file for DIR/FILE; that is, DIR/FILE is no longer partly
608 protected by a lock if DIR/.#FILE is a non-symlink file ("partly"
609 because the locking mechanism was never reliable in that case).
610 This patch fixes this and other bugs discovered by a code
611 inspection that was prompted by
612 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00531.html>.
613 Also, this patch switches to .#-FILE (not .#FILE) on MS-Windows,
614 to avoid interoperability problems between the MS-Windows and
615 non-MS-Windows implementations. MS-Windows and non-MS-Windows
616 instances of Emacs now ignore each others' locks.
617 * filelock.c (defined_WINDOWSNT): New constant.
618 (MAKE_LOCK_NAME, fill_in_lock_file_name):
619 Don't create DIR/.#FILE.0 through DIR/.#FILE.9. Instead, create
620 DIR/.#FILE symlinks on non-MS-Windows hosts, and DIR/.#-FILE
621 regular files on MS-Windows hosts.
622 (MAKE_LOCK_NAME, unlock_file, Ffile_locked_p):
623 Use SAFE_ALLOCA to avoid problems with long file names.
624 (MAX_LFINFO): Now a local constant, not a global macro.
625 (IS_LOCK_FILE): Remove.
626 (lock_file_1): Don't inspect errno if symlink call succeeds;
627 that's not portable.
628 (lock_file): Document that this function can return if lock
629 creation fails.
2db41375 630 (lock_file): Don't access freed storage.
b5029e23 631
b270d116
AS
6322013-03-02 Andreas Schwab <schwab@linux-m68k.org>
633
634 * lisp.h (XPNTR) [!USE_LSB_TAG]: Remove extra paren. (Bug#13734)
635
81c23309
PE
6362013-03-02 Paul Eggert <eggert@cs.ucla.edu>
637
638 * textprop.c: Use bool for booleans.
639 (validate_interval_range, Fadd_text_properties)
640 (Fremove_text_properties): Prefer bool to int when either works.
641
18f2ac09
EZ
6422013-03-02 Eli Zaretskii <eliz@gnu.org>
643
27a98a62
SM
644 * textprop.c (Fadd_text_properties, Fremove_text_properties):
645 If the interval tree changes as a side effect of calling
18f2ac09
EZ
646 modify_region, re-do processing starting from the call to
647 validate_interval_range. (Bug#13743)
648
929aeac6 6492013-02-28 Eli Zaretskii <eliz@gnu.org>
c49e2256
EZ
650
651 * w32.c (sys_open): Don't reset the flags for FD in fd_info[].
652 (Bug#13546).
653
531e70ec
EZ
6542013-02-27 Eli Zaretskii <eliz@gnu.org>
655
656 * filelock.c (create_lock_file) [WINDOWSNT]: Use _sopen with
657 _SH_DENYRW flag, instead of emacs_open, to deny any other process
658 access to the lock file until it is written and closed.
659 (Bug#13807)
660
6e65b9cc
PE
6612013-02-27 Paul Eggert <eggert@cs.ucla.edu>
662
663 * callint.c (Qcall_interactively):
664 * macros.c (Qexecute_kbd_macro):
665 Now static.
666
3b166f09
BG
6672013-02-26 Bastien Guerry <bzg@gnu.org>
668
669 * window.c (Frecenter): Tiny docstring enhancement.
670
ecc0fdd4
PE
6712013-02-26 Paul Eggert <eggert@cs.ucla.edu>
672
673 Minor textprop integer cleanup.
674 * intervals.h, textprop.c (add_text_properties_from_list):
675 Return void, not int, since nobody uses the return value.
676 * textprop.c (validate_plist, add_properties, remove_properties)
677 (Fadd_text_properties):
678 Don't assume list length fits in int.
679 (interval_has_all_properties, interval_has_some_properties)
680 (interval_has_some_properties_list, add_properties, remove_properties)
681 (Fadd_text_properties, Fremove_text_properties)
682 (Fremove_list_of_text_properties, text_property_stickiness):
683 Use bool for booleans.
684 (Fadd_text_properties, Fremove_text_properties):
685 (Fremove_list_of_text_properties):
686 Reindent do-while as per GNU style.
687
0248b0d7
EZ
6882013-02-25 Eli Zaretskii <eliz@gnu.org>
689
343a2aef
EZ
690 Implement CLASH_DETECTION for MS-Windows.
691
692 * filelock.c [WINDOWSNT]: Include w32.h.
693 (MAKE_LOCK_NAME): Don't use 'lock', it clashes with MS runtime
694 function of that name. Up-case the macro arguments.
695 (IS_LOCK_FILE): New macro.
696 (fill_in_lock_file_name): Use IS_LOCK_FILE instead of S_ISLNK.
697 (create_lock_file): New function, with body extracted from
698 lock_file_1.
699 [WINDOWSNT]: Implement lock files by writing a regular file with
700 the lock information as its contents.
701 (read_lock_data): New function, on Posix platforms just calls
702 emacs_readlinkat.
703 [WINDOWSNT]: Read the lock info from the file.
704 (current_lock_owner): Call read_lock_data instead of calling
705 emacs_readlinkat directly.
706 (lock_file) [WINDOWSNT]: Run the file name through
707 dostounix_filename.
708
709 * w32proc.c (sys_kill): Support the case of SIG = 0, in which case
710 just check if the process by that PID exists.
711
712 * w32.c (sys_open): Don't reset the _O_CREAT flag if _O_EXCL is
713 also present, as doing so will fail to error out if the file
714 already exists.
715
716 * makefile.w32-in ($(BLD)/filelock.$(O)): Depend on src/w32.h.
717
0248b0d7
EZ
718 * textprop.c (Fadd_text_properties, Fremove_text_properties)
719 (Fremove_list_of_text_properties): Skip all of the intervals in
720 the region between START and END that already have resp. don't
27a98a62
SM
721 have the requested properties, not just the first one.
722 Add assertions that the loop afterwards always modifies the
0248b0d7
EZ
723 properties. (Bug#13743)
724
b5071fc7
SM
7252013-02-25 Stefan Monnier <monnier@iro.umontreal.ca>
726
727 * callint.c (Fcall_interactively): Use the right lexical environment
728 for `interactive' specs (bug#13811).
729 * eval.c (Feval): Accept a lexical environment.
730
1ddc2bd6
PE
7312013-02-25 Paul Eggert <eggert@cs.ucla.edu>
732
733 Simplify data_start configuration (Bug#13783).
734 This is a followon simplification to the fix for Bug#13650.
735 * Makefile.in (LD_FIRSTFLAG, LIB_GCC, CRT_DIR, LIB_STANDARD)
736 (START_FILES): Remove. All uses removed.
737 (otherobj): Remove $(VMLIMIT_OBJ), as it's now first.
738 (ALLOBJS): Move here from autodeps.mk, and with VMLIMITS_OBJ first.
739 (buildobj.h): Use it.
740 ($(ALLOBJS)): Depend on globals.h.
741 (temacs$(EXEEXT)): Use $(ALLOBJS).
742 * autodeps.mk (ALLOBJS): Move to Makefile.in.
743 * deps.mk (vm-limit.o):
744 * makefile.w32-in ($(BLD)/vm-limit.$(O)):
745 Do not depend on mem-limits.h.
746 * emacs.c (__do_global_ctors, __do_global_ctors_aux)
747 (__do_global_dtors, __CTOR_LIST__, __DTOR_LIST__)
748 [__GNUC__ && !ORDINARY_LINK]: Remove.
749 * mem-limits.h, pre-crt0.c: Remove.
750 * unexaix.c, unexcoff.c: Don't include mem-limits.h.
751 * unexcoff.c (etext): New decl.
752 (make_hdr): Use DATA_START instead of start_of_data.
753 * vm-limit.c: Move most of mem-limits.h's contents here.
754 (data_start): New decl. It's OK if this is approximate,
755 so simplify-away some unnecessary exactness.
756 (POINTER): Remove; all uses removed.
757 (data_space_start): Now char *, to avoid casts.
758 (exceeds_lisp_ptr): New function, replacing the old
759 EXCEEDS_LISP_PTR macro. All uses changed.
760 (check_memory_limits): Simplify and remove casts.
761 (start_of_data) [!CANNOT_DUMP || !SYSTEM_MALLOC]: Remove.
762 (memory_warnings): Use data_start instead of start_of_data.
763
51aa2a8b
AS
7642013-02-24 Andreas Schwab <schwab@linux-m68k.org>
765
766 * xdisp.c (set_message): Only check for debug-on-message if STRING
767 is a string. (Bug#13797)
768
1938d88c
PE
7692013-02-24 Paul Eggert <eggert@cs.ucla.edu>
770
771 Fix regression introduced by July 10 filelock.c patch.
772 * filelock.c (fill_in_lock_file_name): Fix crash caused by the
773 2012-07-10 patch to this file. Reported by Eli Zaretskii in
774 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00533.html>
775 and diagnosed by Andreas Schwab in
776 <http://lists.gnu.org/archive/html/emacs-devel/2013-02/msg00534.html>.
777
fcee5028
PE
7782013-02-22 Paul Eggert <eggert@cs.ucla.edu>
779
780 Assume C89 or better.
781 * ralloc.c (SIZE, POINTER, NIL):
782 * vm-limit.c (POINTER):
783 Remove, replacing all uses with C89 equivalents. These old
784 symbols were present only for porting to pre-C89 platforms.
785
d78cf5ed
CB
7862013-02-22 Claudio Bley <claudio.bley@gmail.com>
787
788 * w32.c (emacs_gnutls_pull): Don't call 'select', and don't loop.
789 This avoids warning messages reported as part of Bug#13546.
790
6bcd97a4
KB
7912013-02-21 Ken Brown <kbrown@cornell.edu>
792
793 * sheap.c (report_sheap_usage): Fix arguments of message1_no_log.
794
b6c2bfff
SM
7952013-02-20 Stefan Monnier <monnier@iro.umontreal.ca>
796
e11dacb5
SM
797 * sheap.c (report_sheap_usage): Prefer message1_nolog.
798
b6c2bfff
SM
799 * keyboard.c (Qcommand_execute): New var.
800 (command_loop_1, read_char): Use it.
801 (Fcommand_execute): Remove, replace by an Elisp implementation.
802 (syms_of_keyboard): Adjust accordingly.
803
d69f1120 8042013-02-19 Daniel Colascione <dancol@dancol.org>
b6c2bfff 805
d69f1120
DC
806 * sheap.c (report_sheap_usage): Use message, not message1, so
807 that we don't try to create a buffer while we're in the middle
808 of dumping Emacs. Explain why.
b6c2bfff 809
2a14a4f1 8102013-02-20 Dmitry Antipov <dmantipov@yandex.ru>
42926ec8 811
2a14a4f1
DA
812 * search.c (find_newline): Return byte position in bytepos.
813 Adjust comment.
b6c2bfff
SM
814 (find_next_newline_no_quit, find_before_next_newline):
815 Add bytepos argument.
2a14a4f1
DA
816 * lisp.h (find_newline, find_next_newline_no_quit)
817 (find_before_next_newline): Adjust prototypes.
818 * bidi.c (bidi_find_paragraph_start):
819 * editfns.c (Fconstrain_to_field, Fline_end_position):
820 * indent.c (compute_motion, vmotion):
821 * xdisp.c (back_to_previous_line_start, forward_to_next_line_start):
822 (get_visually_first_element, move_it_vertically_backward):
823 Adjust users and avoid calls to CHAR_TO_BYTE where appropriate.
824
872faefb 8252013-02-19 Eli Zaretskii <eliz@gnu.org>
17ddfd15
EZ
826
827 * w32proc.c (new_child): Avoid leaking handles if the subprocess
828 resources were not orderly released.
829
fd80c659
EZ
8302013-02-17 Eli Zaretskii <eliz@gnu.org>
831
832 * xdisp.c (x_draw_vertical_border): For a window that is neither
833 the leftmost nor the rightmost, redraw both the left and the right
834 vertical borders. (Bug#13723)
835
2f73da9c
SM
8362013-02-17 Stefan Monnier <monnier@iro.umontreal.ca>
837
838 * xml.c (init_libxml2_functions):
839 * sound.c (sound_warning):
840 * sheap.c (report_sheap_usage):
841 * process.c (wait_reading_process_output):
842 * msdos.c (XMenuActivate):
843 * macros.c (Fstart_kbd_macro, Fend_kbd_macro):
844 * keyboard.c (top_level_1):
845 * editfns.c (Fmessage, Fmessage_box):
846 * callint.c (Fcall_interactively):
847 * fns.c (Fyes_or_no_p): Prefer `message1' over `message'.
848
fd9547e8
JD
8492013-02-17 Jan Djärv <jan.h.d@swipnet.se>
850
851 * xterm.c (syms_of_xterm): Move scroll-bar-adjust-thumb-portion ...
fd9547e8
JD
852 * frame.c (syms_of_frame): ... to here.
853
f277993b
EZ
8542013-02-16 Eli Zaretskii <eliz@gnu.org>
855
c7939585
EZ
856 * w32.c (sys_chown): Remove unused function.
857
cd91fb4b
EZ
858 * w32term.c <input_signal_count>: Declare 'volatile'
859 unconditionally. (Bug#9066)
860
f277993b
EZ
861 * w32.c (set_errno): Reset h_errno and don't set it to any other
862 value. Set errno instead.
863 (check_errno): Reset h_errno.
864 (sys_socket, socket_to_fd, sys_bind, sys_connect)
865 (sys_gethostname, sys_getservbyname, sys_getpeername)
866 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
867 (sys_accept, sys_recvfrom, sys_sendto, fcntl, sys_read): Don't set
868 h_errno.
869 (sys_gethostbyname): Set h_errno only errors detected.
870
e454145b
PE
8712013-02-15 Paul Eggert <eggert@cs.ucla.edu>
872
873 * process.c (h_errno) [!HAVE_H_ERRNO]: Remove unused decl.
874
bcf7fe2a
EZ
8752013-02-15 Eli Zaretskii <eliz@gnu.org>
876
ef9c57e2
EZ
877 * keyboard.c (read_char): Fix calculation of auto-save time out
878 when auto-save-timeout is less than 4. (Bug#13720)
879
ef862e20 880 * w32proc.c (new_child): Free up to 2 slots of dead processes at a
b2af991a 881 time. Improve diagnostics in DebPrint. (Bug#13546)
ef862e20 882
bcf7fe2a
EZ
883 * w32.c (sys_socket, sys_bind, sys_connect, sys_gethostname)
884 (sys_gethostbyname, sys_getservbyname, sys_getpeername)
885 (sys_shutdown, sys_setsockopt, sys_listen, sys_getsockname)
886 (sys_accept, sys_recvfrom, sys_sendto, fcntl): In case of failure,
887 make sure errno is set to an appropriate value. (Bug#13546)
888 (socket_to_fd): Add assertion against indexing fd_info[] with a
889 value that is out of bounds.
890 (sys_accept): If fd is negative, do not set up the child_process
891 structure for reading.
892
0063fdb1
DA
8932013-02-15 Dmitry Antipov <dmantipov@yandex.ru>
894
895 * composite.c (fill_gstring_header): Remove useless prototype.
896 Break long line.
897 * lisp.h (message_dolog, compile_pattern): Adjust prototype.
898 * print.c (PRINTDECLARE, print_object):
899 * search.c (compile_pattern, fast_looking_at, search_buffer):
900 (simple_search, boyer_moore, Freplace_match):
901 * xdisp.c (c_string_pos, number_of_chars, message_dolog):
902 (get_overlay_arrow_glyph_row, display_mode_element):
903 (decode_mode_spec_coding, message3):
904 * xfaces.c (face_at_string_position): Use bool for booleans.
905 Adjust comments.
906
648e5523 9072013-02-15 Paul Eggert <eggert@cs.ucla.edu>
974c7646 908
35b3a27e
PE
909 Fix AIX port (Bug#13650).
910 * lisp.h (XPNTR) [!USE_LSB_TAG && DATA_SEG_BITS]:
911 Fix bug introduced in 2012-07-27 change. DATA_SEG_BITS, if set,
912 was #undeffed earlier, so it cannot be used as a macro here.
913 Use the constant and not the macro.
35b3a27e 914
648e5523 9152013-02-15 Eli Zaretskii <eliz@gnu.org>
6e432f0c 916
0e4e7b74
EZ
917 * w32proc.c (new_child): If no vacant slots are found in
918 child_procs[], make another pass looking for slots whose process
919 has exited or died. (Bug#13546)
920
6e432f0c
EZ
921 * w32.c (sys_pipe): When failing due to file descriptors above
922 MAXDESC, set errno to EMFILE.
923 (_sys_read_ahead): Update cp->status when failing to read serial
924 communications input, so that the status doesn't stay at
925 STATUS_READ_IN_PROGRESS. (Bug#13546)
926
51b3a99c
JD
9272013-02-14 Jan Djärv <jan.h.d@swipnet.se>
928
929 * gtkutil.c (tb_size_cb): New function.
930 (xg_create_tool_bar): Connect size-allocate to tb_size_cb (Bug#13512).
931
e31560a7
SM
9322013-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
933
934 * keyboard.c (active_maps): Fcurrent_active_maps expects a position, not
935 an event.
936
fe336261
SM
9372013-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
938
939 * keyboard.c (syms_of_keyboard): Further tweaks of docstring.
940
5a655b9f
DA
9412013-02-13 Dmitry Antipov <dmantipov@yandex.ru>
942
943 * font.c (font_range): Add pos_byte argument. Adjust comment
944 and break long line.
945 * font.h (font_range): Adjust prototype.
946 * composite.c (autocmp_chars): Pass byte position to font_range.
947 Break long line. Remove useless prototype and format comment.
948
1a359750
GM
9492013-02-13 Glenn Morris <rgm@gnu.org>
950
951 * keyboard.c (input-decode-map, key-translation-map): Doc fixes.
952
01fcc3a5 9532013-02-13 Paul Eggert <eggert@cs.ucla.edu>
4458c255 954
f53f992a
PE
955 Improve AIX port some more (Bug#13650).
956 With this, it should be as good as it was in 23.3, though it's
957 still pretty bad: the dumped emacs does not run. See Mark Fleishman in
958 http://lists.gnu.org/archive/html/help-gnu-emacs/2011-04/msg00287.html
959 * unexaix.c (start_of_text): Remove.
960 (_data, _text): Declare as char[], not int, as AIX manual suggests.
961 (bias, lnnoptr, text_scnptr, data_scnptr, load_scnptr)
962 (orig_load_scnptr, orig_data_scnptr):
963 Now off_t, not long, since they are file offsets.
964 (make_hdr): Use _data, not start_of_data ().
965 This is the key part of the fix.
966 (make_hdr, unrelocate_symbols): Use off_t for file offsets.
967 (unrelocate_symbols): Cast pointers to intptr_t, not to ulong.
968
4458c255
PE
969 * pre-crt0.c (data_start): Initialize to 1.
970 This ports to compilers that optimize the external declaration
971 'int x = 0;' as if it were 'int x;' to shrink the executable.
972
227be86d
PE
973 Improve AIX port (Bug#13650).
974 This doesn't fix the bug, but it makes progress: Emacs builds now.
975 * unexaix.c: Include inttypes.h, stdarg.h.
976 (report_error, report_error_1): Mark as _Noreturn.
977 (report_error): Don't report the wrong errno.
978 (report_error_1): Now varargs. All callers changed.
979 (make_hdr): Use uintptr_t, not unsigned, when converting pointers
980 to unsigned. Don't use ADDR_CORRECT, as it no longer exists.
981 (write_ptr): Use %p to print address rather than %lx and a cast
982 to unsigned long. Grow buffer a bit, to be safer.
983
01fcc3a5 9842013-02-13 Eli Zaretskii <eliz@gnu.org>
713bfeaa
EZ
985
986 * bidi.c (bidi_resolve_neutral): After finding the next
987 non-neutral character, accept NEUTRAL_ON type as well, because
988 directional control characters, such as LRE and RLE, have their
989 type converted to that by bidi_resolve_weak. This avoids aborts
990 when LRE/RLE follows a run of neutrals.
991 (bidi_move_to_visually_next): Assert that return value of
992 bidi_peek_at_next_level is non-negative. Negative values will
993 cause an infloop.
994
83be8524
PE
9952013-02-13 Paul Eggert <eggert@cs.ucla.edu>
996
997 Minor getenv-related fixes.
998 * callproc.c (Fcall_process_region) [!DOS_NT]:
999 Avoid unnecessary duplicate call to getenv.
1000 * callproc.c (init_callproc):
1001 * dispnew.c (init_display):
1002 * sysdep.c (sys_subshell):
1003 Omit unnecessary cast of getenv or egetenv.
1004
45b2b768
JB
10052013-02-13 Juanma Barranquero <lekktu@gmail.com>
1006
1007 * makefile.w32-in ($(BLD)/filelock.$(O), $(BLD)/sysdep.$(O)):
1008 Update dependencies.
1009
33b49d71
EZ
10102013-02-12 Eli Zaretskii <eliz@gnu.org>
1011
1012 * xdisp.c (redisplay_internal): Don't set w->region_showing to the
1013 marker's position.
1014 (display_line): Set w->region_showing to the value of
1015 it->region_beg_charpos, not to -1. This fixes redisplay
1016 optimization when cursor is moved up after M->. (Bug#13623)
1017 (Bug#13626)
c4131562
EZ
1018 (try_scrolling): Scroll text up more if point is too close to ZV
1019 and inside the scroll margin. This makes sure point is moved
1020 outside the scroll margin in these cases.
33b49d71
EZ
1021
1022 * window.h (struct window): region_showing can no longer be
1023 negative.
1024
b09a4810
PE
10252013-02-11 Paul Eggert <eggert@cs.ucla.edu>
1026
a84b7c53
PE
1027 Tune by using memchr and memrchr.
1028 * doc.c (Fsnarf_documentation):
1029 * fileio.c (Fsubstitute_in_file_name):
1030 * search.c (find_newline, scan_newline):
1031 * xdisp.c (pos_visible_p, display_count_lines):
1032 Use memchr and memrchr rather than scanning byte-by-byte.
1033 * search.c (find_newline): Rename from scan_buffer.
1034 Omit first arg TARGET, as it's always '\n'. All callers changed.
1035
b09a4810
PE
1036 Clean up read_key_sequence a tiny bit more.
1037 * keyboard.c (read_char_x_menu_prompt) [HAVE_MENUS]:
1038 (read_key_sequence): Remove unused locals.
1039
99d0d6dc
SM
10402013-02-11 Stefan Monnier <monnier@iro.umontreal.ca>
1041
1042 Clean up read_key_sequence a bit; reread active keymaps after first event.
1043 * keyboard.c (read_char, read_char_x_menu_prompt)
1044 (read_char_minibuf_menu_prompt):
1045 Replace nmaps+maps with a single `map' arg.
1046 (follow_key): Operate on a single map.
1047 (active_maps): New function.
1048 (test_undefined): Also return true for nil bindings.
1049 (read_key_sequence): Use active_maps to replace the arrays of keymaps with
1050 a single (composed) keymap. Remember `first_event' to choose the right
1051 set of active keymaps. Recompute the set of keymaps after receiving
1052 the first event. Remove GOBBLE_FIRST_EVENT.
1053 (syms_of_keyboard): Remove inhibit_local_menu_bar_menus.
1054 * keyboard.h (read_char): Update declaration.
1055 * lread.c (read_filtered_event): Adjust call to read_char.
1056
f5e1b680
EZ
10572013-02-11 Eli Zaretskii <eliz@gnu.org>
1058
99d0d6dc
SM
1059 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1060 Don't use the limitation on backwards movement when lines are truncated
f5e1b680
EZ
1061 in the window. (Bug#13675)
1062
f74de345
DA
10632013-02-11 Dmitry Antipov <dmantipov@yandex.ru>
1064
1065 * marker.c (set_marker_internal): If desired position is passed
1066 as a marker, avoid call to buf_charpos_to_bytepos.
1067 * window.c (Fset_window_point): Omit redundant type checking.
1068 (Fset_window_start): Likewise. Format comment.
1069 (window_scroll_pixel_based): Use set_marker_restricted_both
1070 with character and byte positions obtained from an iterator.
1071 (Fset_window_configuration): Use set_marker_restricted_both.
1072 * xdisp.c (message_dolog): Likewise.
1073
a4ba3963
EZ
10742013-02-10 Eli Zaretskii <eliz@gnu.org>
1075
99d0d6dc
SM
1076 * xdisp.c (move_it_vertically_backward, move_it_by_lines):
1077 When text lines are longer than window's screen lines, don't move back
a4ba3963
EZ
1078 too far. This speeds up some redisplay operations. (Bug#13675)
1079
68643cde
DA
10802013-02-10 Dmitry Antipov <dmantipov@yandex.ru>
1081
1082 * syntax.c (scan_sexps_forward): Fix byte position calculation
1083 Bug#13664 (a.k.a Bug#13667) introduced with 2013-02-08 change.
1084
7ba11bee
PE
10852013-02-10 Paul Eggert <eggert@cs.ucla.edu>
1086
1087 * fileio.c (Fexpand_file_name): Omit confusing pointer comparison
1088 that was not needed.
1089
eff1c190
PE
10902013-02-09 Paul Eggert <eggert@cs.ucla.edu>
1091
1092 Minor hashing refactoring.
1093 * fns.c (SXHASH_REDUCE): Move to lisp.h.
1094 (sxhash_float): Return EMACS_UINT, for consistency with the other
1095 hash functions.
1096 * lisp.h (INTMASK): Now a macro, since SXHASH_REDUCE is now a
1097 non-static inline function and therefore can't use static vars.
1098 (SXHASH_REDUCE): Move here from fns.c, and make it inline.
1099 * profiler.c (hashfn_profiler): Use SXHASH_REDUCE, to be consistent
1100 with the other hash functions.
1101
6b48c831
EZ
11022013-02-09 Eli Zaretskii <eliz@gnu.org>
1103
4dde2087
EZ
1104 * callproc.c (Fcall_process_region) [WINDOWSNT]: Make sure the
1105 XXXXXX part of the temporary file pattern is not downcased even
1106 when w32-downcase-file-names is non-nil. (Bug#13661)
74ba1583 1107
8549f9e8
EZ
1108 * xdisp.c (decode_mode_spec): Remove handling of %t.
1109
6b48c831
EZ
1110 * msdos.c (careadlinkatcwd): Remove.
1111
75a65c7e
SM
11122013-02-08 Stefan Monnier <monnier@iro.umontreal.ca>
1113
1114 * lread.c (skip_dyn_bytes): New function (bug#12598).
1115 (read1): Use it. Use getc instead of READCHAR to read bytes.
1116 (load_each_byte): Remove. Update users.
1117
8ca30920
DA
11182013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1119
1120 * search.c (scan_buffer): Calculate end byte position just once.
1121 (scan_newline): Do not recalculate start_byte.
1122 (search_command): Use eassert.
1123 * syntax.c (struct lisp_parse_state): New member location_byte.
1124 (scan_sexps_forward): Record from_byte and avoid redundant
1125 character to byte position calculation ...
1126 (Fparse_partial_sexp): ... here. Break too long line.
1127
25721f5b
DA
11282013-02-08 Dmitry Antipov <dmantipov@yandex.ru>
1129
1130 * lisp.h (make_uninit_vector): New function.
1131 * alloc.c (Fvector, Fmake_byte_code):
1132 * ccl.c (Fregister_ccl_program):
1133 * charset.c (Fdefine_charset_internal, define_charset_internal):
1134 * coding.c (make_subsidiaries, Fdefine_coding_system_internal):
1135 * composite.c (syms_of_composite):
1136 * font.c (Fquery_font, Ffont_info, syms_of_font):
1137 * fontset.c (FONT_DEF_NEW, Fset_fontset_font):
1138 * ftfont.c (ftfont_shape_by_flt):
1139 * indent.c (recompute_width_table):
1140 * nsselect.m (clean_local_selection_data):
1141 * syntax.c (init_syntax_once):
1142 * w32unsubscribe.c (uniscribe_shape):
1143 * window.c (Fcurrent_window_configuration):
1144 * xfaces.c (Fx_family_fonts):
1145 * xselect.c (selection_data_to_lisp_data): Use it.
1146
9a9d91d9
DA
11472013-02-07 Dmitry Antipov <dmantipov@yandex.ru>
1148
1149 * coding.c (Fdefine_coding_system_internal): Use AREF where
1150 argument is known to be a vector.
1151 * fns.c (Flocale_info): Likewise for ASET.
1152 * xselect.c (selection_data_to_lisp_data): Likewise for ASET.
1153 * w32fns.c (w32_parse_hot_key): Likewise for ASIZE and AREF.
1154
6871e574
JD
11552013-02-05 Jan Djärv <jan.h.d@swipnet.se>
1156
1157 * nsmenu.m (update_frame_tool_bar): Check for negative tool bar
1158 height.
1159
1160 * nsterm.h (HAVE_NATIVE_FS): Define if OSX => 10.7.
1161 (EmacsView): Add fs_is_native, fsIsNative, isFullscreen and
1162 updateCollectionBehaviour.
1163
1164 * nsterm.m (NEW_STYLE_FS): Remove.
1165 (ns_last_use_native_fullscreen): New variable.
1166 (x_make_frame_visible): Replace NEW_STYLE_FS with isFullscreen.
1167 (x_set_window_size): Do not take title bar and tool bar into account
1168 if isFullscreen returns YES.
1169 (ns_fullscreen_hook): Replace NEW_STYLE_FS with isFullscreen.
1170 (check_native_fs): New function.
1171 (ns_select, ns_read_socket): Call check_native_fs if HAVE_NATIVE_FS.
1172 (ns_term_init): Remove NEW_STYLE_FS.
1173 (updateFrameSize:, windowWillResize:toSize:): Only adjust for title bar
1174 and tool bar if isFullscreen returns NO.
1175 (windowDidResize:): Replace NEW_STYLE_FS with fsIsNative.
1176 (initFrameFromEmacs:): Initialize fs_is_native. Replace NEW_STYLE_FS
1177 with HAVE_NATIVE_FS.
1178 (window:willUseFullScreenPresentationOptions:): New method.
1179 (windowDidEnterFullScreen:): Replace NEW_STYLE_FS with fsIsNative.
1180 Hide toolbar if not enabled (Bug#13444).
1181 (windowDidExitFullScreen:): Call updateCollectionBehaviour.
1182 Restore tool bar if enabled, hide it otherwise (Bug#13444).
1183 (fsIsNative, isFullscreen, updateCollectionBehaviour): New methods.
1184 (toggleFullScreen:): If fs_is_native, call toggleFullScreen on
1185 window. Do no set FRAME_EXTERNAL_TOOL_BAR (f) to 0.
1186 Check FRAME_EXTERNAL_TOOL_BAR (f) before restoring
1187 FRAME_TOOLBAR_HEIGHT (f). Call updateFrameSize when going non-fs.
1188 (syms_of_nsterm): Add ns-use-native-fullscreen.
1189
3f011c7f
PE
11902013-02-04 Paul Eggert <eggert@cs.ucla.edu>
1191
1192 * fileio.c (Qchoose_write_coding_system): Now static.
1193
86f7c0fe
EZ
11942013-02-04 Eli Zaretskii <eliz@gnu.org>
1195
1196 * xdisp.c (window_buffer_changed): region_showing can be negative,
1197 which still means region is being displayed.
1198 (redisplay_internal): Resurrect code that forced redisplay of the
99d0d6dc
SM
1199 whole window when showing region and the mark has changed.
1200 Record the new mark position to allow redisplay optimizations.
86f7c0fe
EZ
1201 (display_line): If it->region_beg_charpos is non-zero, set the
1202 window's region_showing member to -1. (Bug#13623) (Bug#13626)
1203
1204 * window.h (struct window) <region_showing>: Declare ptrdiff_t,
1205 not bitfield of 1 bit.
1206
5257b701
DC
12072013-02-03 Daniel Colascione <dancol@dancol.org>
1208
1209 * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that
1210 daemon mode works on cygw32 when Emacs is installed and not just
1211 during development.
1212
8ea41ea9
PE
12132013-02-02 Paul Eggert <eggert@cs.ucla.edu>
1214
1215 Avoid file time stamp bug on MS-Windows (Bug#13149).
1216 * fileio.c (Fwrite_region): Don't use the heuristic on empty files,
1217 as FAT32 doesn't update time stamps when truncating them.
1218 Also, check that a file time stamp is not a multiple of 100 ns;
1219 this should catch all instances of the problem on MS-Windows,
1220 as its native file system resolution is 100 ns or worse, and
1221 checking for a non-multiple of 100 ns should impose only a small
1222 overhead on systems with ns resolution.
1223
94fbc901 12242013-02-02 Eli Zaretskii <eliz@gnu.org>
18a80473 1225
e7ac588e
EZ
1226 Avoid encoding file names on MS-Windows when they need to be run
1227 through dostounix_filename.
1228 * w32.c (normalize_filename): Accept an additional argument
1229 MULTIBYTE; if non-zero, traverse the file name by bytes and don't
1230 downcase it even if w32-downcase-file-names is non-nil.
1231 (dostounix_filename): Accept an additional argument MULTIBYTE and
1232 pass it to normalize_filename.
1233 (emacs_root_dir): Adjust.
1234
1235 * msdos.h (dostounix_filename): Adjust prototype.
1236
1237 * w32.h (dostounix_filename): Adjust prototype.
1238
1239 * msdos.c (dostounix_filename): Accept an additional argument and
1240 ignore it.
1241 (init_environment): Adjust callers of dostounix_filename.
1242
1243 * fileio.c (Ffile_name_directory, file_name_as_directory)
1244 (directory_file_name, Fexpand_file_name)
1245 (Fsubstitute_in_file_name): [DOS_NT] Adjust call to
1246 dostounix_filename.
1247 [WINDOWSNT]: Downcase file names if w32-downcase-file-names is
1248 non-nil.
1249 (Fsubstitute_in_file_name): [DOS_NT] Don't downcase environment
1250 variables, as egetenv is case-insensitive for DOS_NT.
1251
1252 * dired.c (file_name_completion): Don't call Fdirectory_file_name
1253 with an encoded file name.
1254
99d0d6dc
SM
1255 * w32proc.c (Fw32_short_file_name, Fw32_long_file_name):
1256 Adjust calls to dostounix_filename.
e7ac588e
EZ
1257
1258 * w32fns.c (Fx_file_dialog): Adjust call to dostounix_filename.
1259
1260 * unexw32.c (unexec): Adjust call to dostounix_filename.
1261
1262 * termcap.c (tgetent) [MSDOS]: Adjust call to dostounix_filename.
1263
1264 * emacs.c (decode_env_path) [DOS_NT]: Adjust call to
1265 dostounix_filename.
1266
1267 * callproc.c (Fcall_process) [MSDOS]: Adjust call to
1268 dostounix_filename.
1269
e7c3fb06
EZ
1270 * callproc.c (Fcall_process): Make sure program name in PATH and
1271 new_argv[0] is encoded, if needed. Otherwise, un-encoded string
1272 is passed to exec/spawnve, which fails unless the file-name
1273 encoding is UTF-8.
1274
18a80473
EZ
1275 * w32proc.c (sys_spawnve): Make sure escape_char is initialized,
1276 even if w32-quote-process-args is nil.
1277
35e85499
PE
12782013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1279
1280 Fix timestamp bug when write-region appends nothing (Bug#13149).
1281 * fileio.c (Fwrite_region): When neither O_EXCL nor O_TRUNC is used,
1282 the file's time stamp doesn't change if Emacs happens to write nothing
1283 to the file, and on a buggy file system this could cause Emacs to
1284 incorrectly infer that the file system doesn't have the bug.
1285 Avoid this problem by inhibiting the inference in this case.
1286
422ff52b
DA
12872013-02-01 Dmitry Antipov <dmantipov@yandex.ru>
1288
1289 * window.h (struct window): Convert base_line_number, base_line_pos
1290 and column_number_displayed members from Lisp_Object to ptrdiff_t.
1291 Convert region_showing member from Lisp_Object to bitfield.
1292 Remove sequence_number member. Adjust comments.
1293 * window.c (sequence_number): Remove.
1294 (make_window): Initialize column_number_displayed.
1295 * print.c (print_object): Follow the printed representation of
1296 frames and print window pointer to distinguish between windows.
1297 (adjust_window_count): Invalidate base_line_pos. Adjust comment.
1298 * xdisp.c (wset_base_line_number, wset_base_line_pos)
1299 (wset_column_number_displayed, wset_region_showing): Remove.
1300 (window_buffer_changed, mode_line_update_needed, redisplay_internal)
1301 (try_scrolling, try_cursor_movement, redisplay_window)
1302 (try_window_reusing_current_matrix, try_window_id, display_line)
1303 (display_mode_lines, decode_mode_spec): Adjust users.
1304 * .gdbinit (pwinx): Do not print sequence_number.
1305
8654f9d7
PE
13062013-02-01 Paul Eggert <eggert@cs.ucla.edu>
1307
1308 Use fdopendir, fstatat and readlinkat, for efficiency (Bug#13539).
1309 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): Remove.
1310 * dired.c: Include <fcntl.h>.
1311 (open_directory): New function, which uses open and fdopendir
1312 rather than opendir. DOS_NT platforms still use opendir, though.
1313 (directory_files_internal, file_name_completion): Use it.
1314 (file_attributes): New function, with most of the old Ffile_attributes.
1315 (directory_files_internal, Ffile_attributes): Use it.
1316 (file_attributes, file_name_completion_stat): First arg is now fd,
1317 not dir name. All uses changed. Use fstatat rather than lstat +
1318 stat.
1319 (file_attributes): Use emacs_readlinkat rather than Ffile_symlink_p.
1320 * fileio.c: Include <allocator.h>, <careadlinkat.h>.
1321 (emacs_readlinkat): New function, with much of the old
1322 Ffile_symlink_p, but with an fd argument for speed.
1323 It uses readlinkat rather than careadlinkatcwd, so that it
1324 need not assume the working directory.
1325 (Ffile_symlink_p): Use it.
1326 * filelock.c (current_lock_owner): Use emacs_readlinkat
1327 rather than emacs_readlink.
1328 * lisp.h (emacs_readlinkat): New decl.
1329 (READLINK_BUFSIZE, emacs_readlink): Remove.
1330 * sysdep.c: Do not include <allocator.h>, <careadlinkat.h>.
1331 (emacs_norealloc_allocator, emacs_readlink): Remove.
1332 This stuff is moved to fileio.c.
1333 * w32.c (fstatat, readlinkat): New functions.
1334 (careadlinkat): Don't check that fd == AT_FDCWD.
1335 (careadlinkatcwd): Remove; no longer needed.
1336
9dbda100
GM
13372013-01-31 Glenn Morris <rgm@gnu.org>
1338
1339 * fileio.c (choose_write_coding_system): Make it callable from Lisp.
20a8c477
GM
1340 (Fwrite_region): Update for new choose_write_coding_system args.
1341 Move the last piece of choose_write_coding_system here. (Bug#13522)
9dbda100
GM
1342 (syms_of_fileio): Add choose-write-coding-system.
1343
3f82a88a 13442013-01-30 Eli Zaretskii <eliz@gnu.org>
224f4ec1
EZ
1345
1346 * w32.c (sys_open): Zero out the flags for the new file descriptor.
1347 (sys_close): Zero out the flags for the file descriptor before
1348 closing it. (Bug#13546)
1349
806fed21 1350 * w32.c (parse_root, get_volume_info, readdir, read_unc_volume)
99d0d6dc
SM
1351 (logon_network_drive, stat_worker, symlink, chase_symlinks):
1352 Use CharNextExA and CharPrevExA to iterate over file names encoded in
806fed21
EZ
1353 DBCS. (Bug#13553)
1354
6ee4509a
EZ
1355 * w32.c (w32_get_long_filename, init_environment, readlink):
1356 Support file names encoded in DBCS codepages.
26854e9c
EZ
1357 (readlink): Use the current file-name-coding-system, not the ANSI
1358 codepage, to decode and handle targets of symlinks.
6ee4509a 1359
cf01a359
EZ
13602013-01-28 Eli Zaretskii <eliz@gnu.org>
1361
1362 * w32.c (opendir): Now accepts a 'const char *'.
1363
6fd326b7
DA
13642013-01-28 Dmitry Antipov <dmantipov@yandex.ru>
1365
1366 Remove obsolete redisplay code. See the discussion at
1367 http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00576.html.
1368 * dispnew.c (preemption_period, preemption_next_check): Remove.
1369 (Vredisplay_preemption_period): Likewise.
1370 (update_frame, update_single_window, update_window, update_frame_1):
1371 Adjust users. Always assume that PERIODIC_PREEMPTION_CHECKING is not
1372 used, following the 2012-06-22 change.
1373
d8cd7742
EZ
13742013-01-25 Eli Zaretskii <eliz@gnu.org>
1375
1376 * w32notify.c (Fw32notify_add_watch): Doc fix. (Bug#13540)
1377
266fee4f
DA
13782013-01-25 Dmitry Antipov <dmantipov@yandex.ru>
1379
1380 * font.c (num_fonts): Remove the leftover from old
1381 debugging code. Adjust comment style here and there.
59e624b3
DA
1382 * insdel.c (insert_1): Remove.
1383 * lisp.h (insert_1): Remove prototype.
1384 * xdisp.c (message_dolog): Adjust users to call insert_1_both.
266fee4f 1385
830e46e6 13862013-01-25 Eli Zaretskii <eliz@gnu.org>
6d2851de
EZ
1387
1388 * w32.c (max_filename_mbslen): New function.
1389 (normalize_filename, readdir): Use it to detect locales where ANSI
1390 encoding of file names uses a double-byte character set (DBCS).
1391 If a DBCS encoding is used, advance by characters using
99d0d6dc
SM
1392 CharNextExA, instead of incrementing a 'char *' pointer.
1393 Use _mbslwr instead of _strlwr. (Bug#13515)
6d2851de 1394
81abbb95
EZ
1395 * w32heap.c (allocate_heap) [!_WIN64]: Decrease the initial
1396 request of memory reservation to 1.7GB. (Bug#13065)
1397
830e46e6 13982013-01-25 Andreas Schwab <schwab@linux-m68k.org>
ba14c607
AS
1399
1400 * coding.c (detect_coding_iso_2022): Move back mis-reordered code
1401 at check_extra_latin label. (Bug#13505)
1402
fd3ceb09
DA
14032013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1404
1405 * nsfont.m (ns_escape_name, ns_unescape_name, ns_registry_to_script):
1406 Avoid redundant calls to strlen.
1407
edfa7fa0
DA
14082013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1409
1410 Drop async_visible and async_iconified fields of struct frame.
1411 This is possible because async input is gone; for details, see
1412 http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00734.html.
1413 * frame.h (struct frame): Remove async_visible and async_iconified
1414 members, convert garbaged to unsigned bitfield. Adjust comments.
1415 (FRAME_SAMPLE_VISIBILITY): Remove. Adjust all users.
1416 (SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED): New macros.
1417 * frame.c, gtkutil.c, term.c, w32fns.c, window.c, xdisp.c:
1418 Consistently use SET_FRAME_VISIBLE, SET_FRAME_ICONIFIED,
1419 FRAME_VISIBLE_P and FRAME_ICONIFIED_P macros where appropriate.
1420 * w32term.c: Ditto.
1421 (w32_read_socket): Save iconified state to generate DEICONIFY_EVENT
1422 properly. Likewise for obscured.
1423 * xterm.c: Ditto.
266fee4f 1424 (handle_one_xevent): Save visible state to generate ICONIFY_EVENT
edfa7fa0
DA
1425 properly.
1426 * nsterm.m: Ditto.
1427 (windowDidDeminiaturize): Generate DEICONIFY_EVENT.
1428
5ad86e34
DA
14292013-01-24 Dmitry Antipov <dmantipov@yandex.ru>
1430
1431 * insdel.c (prepare_to_modify_buffer): Revert last change as suggested
1432 in http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00555.html.
1433
b09cca6a
SM
14342013-01-23 Stefan Monnier <monnier@iro.umontreal.ca>
1435
1436 * xdisp.c (message2, message2_nolog): Remove functions.
1437 (message3, message3_nolog): Extract nbytes and multibyteness directly
1438 from the string. Change all callers.
1439 (message3_nolog): Don't set message_enable_multibyte since set_message
1440 will reset it anyway.
1441 (message1, message1_nolog): Use message3.
1442 (vmessage): Use a stack allocated buffer rather than f->message_buf.
1443 (with_echo_area_buffer): Remove last two arguments. Update all callers.
1444 (set_message): Drop all but the second arg, which has to be a string.
1445 (set_message_1): Simplify now that we know that a1 is NULL and the
1446 second arg is a string.
1447 * frame.h (struct frame): Remove `message_buf' field.
1448 Use glyphs_initialized_p instead.
1449 (FRAME_MESSAGE_BUF): Remove macro.
1450 * w16select.c (Fw16_set_clipboard_data): Prefer message3 to message2.
1451 * lisp.h (message2, message2_nolog): Remove declarations.
1452 (message3, message3_nolog): Update declarations.
1453 * keyboard.c (read_char_minibuf_menu_text)
1454 (read_char_minibuf_menu_width): Remove vars.
1455 (read_char_minibuf_menu_prompt): Rewrite the menu's construction so as
1456 to correctly handle multibyte strings.
1457 * frame.c (delete_frame): Don't free message_buf any more.
1458 * editfns.c (message_text, message_length): Remove vars.
1459 (Fmessage_box): Don't copy the Lisp string's bytes any longer.
1460 * fileio.c (auto_save_error): Use message3 instead of message2.
1461 * dispnew.c (adjust_frame_message_buffer): Remove function.
1462
54ab1c5a
EZ
14632013-01-23 Eli Zaretskii <eliz@gnu.org>
1464
1465 * w32term.c (w32fullscreen_hook): Account correctly for the screen
1466 real estate used for the tool bar and the menu bar.
1467
6c27465b
DA
14682013-01-23 Dmitry Antipov <dmantipov@yandex.ru>
1469
1470 * insdel.c (prepare_to_modify_buffer): Force redisplay if
1471 hidden buffer is prepared to modification (Bug#13164).
1472
9d93ce29
DA
14732013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1474
1475 * window.h (struct window): Change window_end_valid member from
1476 Lisp_Object to a bitfield. Adjust comments.
1477 (wset_window_end_valid): Remove.
1478 * window.c (adjust_window_count): Clear window_end_valid.
1479 (Fwindow_end): Adjust user. Remove ancient #if 0 code.
1480 (Fwindow_line_height, set_window_buffer, Frecenter)
1481 (Fsplit_window_internal, Fdelete_other_windows_internal)
1482 (Fset_window_fringes, Fset_window_scroll_bars): Adjust users.
1483 * dispnew.c (adjust_glyph_matrix, clear_window_matrices): Likewise.
1484 * xdisp.c (check_window_end, reconsider_clip_changes)
1485 (redisplay_internal, mark_window_display_accurate_1, redisplay_window)
1486 (try_window, try_window_reusing_current_matrix, note_mouse_highlight)
1487 (find_first_unchanged_at_end_row, try_window_id): Likewise.
1488
1dcb8ea2
DA
14892013-01-22 Dmitry Antipov <dmantipov@yandex.ru>
1490
1491 * xdisp.c (mark_window_display_accurate): Simplify the loop
1492 assuming that the only one of vchild, hchild or buffer window
1493 slots is non-nil. Call mark_window_display_accurate_1 for
1494 the leaf windows only.
1495 (mark_window_display_accurate_1): Always assume leaf window.
1496 Adjust comment.
1497
b41b8a7e
PE
14982013-01-22 Paul Eggert <eggert@cs.ucla.edu>
1499
593a5f2e
PE
1500 * emacs.c (Qkill_emacs_hook): Now static.
1501
b41b8a7e
PE
1502 * fileio.c (Finsert_file_contents): Simplify.
1503 Remove unnecessary assignments and tests.
1504
84e5ed96
EZ
15052013-01-21 Eli Zaretskii <eliz@gnu.org>
1506
1507 * w32.c (acl_set_file): Don't test for errors unless
1508 set_file_security returns FALSE. Avoids spurious errors when
1509 saving files.
1510
2ef88fd4
DA
15112013-01-21 Dmitry Antipov <dmantipov@yandex.ru>
1512
1513 * fileio.c (Finsert_file_contents): Revert code introduced at
1514 2013-01-18 in favor of the simpler and generally better fix.
1515 Save stack space by removing 'buffer' and reusing 'read_buf'
1516 where appropriate.
1517
d7a0a7c9
PE
15182013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1519
1520 * lisp.h (eabs): Define unconditionally (Bug#13419).
1521 The old "#if !defined (eabs)" was an unnecessary revenant of back
1522 when this macro was called "abs". Document 'eabs' better.
1523
795e7a5b 15242013-01-19 Glenn Morris <rgm@gnu.org>
085d34c4
GM
1525
1526 * fns.c (Frandom): Doc fix.
1527
59ac2d13
EZ
15282013-01-19 Eli Zaretskii <eliz@gnu.org>
1529
1530 * editfns.c (get_pos_property): Use SAFE_ALLOCA_LISP, to avoid
1531 segfault when there are lots of overlays.
1532
1533 * buffer.c (sort_overlays): Use SAFE_NALLOCA, to avoid segfault
99d0d6dc
SM
1534 when there are lots of overlays.
1535 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00421.html
59ac2d13
EZ
1536 for the details and a way to reproduce.
1537
b3fbb395
PE
15382013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1539
3a955a1f
PE
1540 * fileio.c: Use O_APPEND to append.
1541 This corresponds better to the natural interpretation of "append",
1542 and avoids the need to open the output file twice, or to invoke
1543 lseek when APPEND is neither nil nor a number.
1544 This relies on POSIX 1003.1-1988 or later, which is OK nowadays.
1545 (Fwrite_region): Simplify. Use O_APPEND instead of opening the
1546 file possibly twice, and lseeking to its end; this avoids the
1547 need to lseek on non-regular files. Do not use O_EXCL and O_TRUNC
1548 at the same time: the combination is never needed and apparently
1549 it doesn't work with DOS_NT.
1550
21cd50b8
PE
1551 Fix size bug on DOS_NT introduced by CIFS workaround (Bug#13149).
1552 * fileio.c (Fwrite_region): Use O_BINARY in checking code, too.
1553
b3fbb395
PE
1554 Allow floating-point file offsets.
1555 Problem reported by Vitalie Spinu in
1556 <http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00411.html>.
1557 * fileio.c (emacs_lseek): Remove.
1558 (file_offset): New function.
1559 (Finsert_file_contents, Fwrite_region): Use it.
1560
73c14218
CY
15612013-01-19 Chong Yidong <cyd@gnu.org>
1562
1563 * emacs.c (Fkill_emacs): Set waiting_for_input to 0 to avoid
1564 aborting on Fsignal (Bug#13289).
1565
6a9465f3
EZ
15662013-01-19 Eli Zaretskii <eliz@gnu.org>
1567
1568 * w32.c (acl_set_file): Treat ERROR_ACCESS_DENIED from
1569 set_file_security as failure due to insufficient privileges.
1570 Reported by Fabrice Popineau <fabrice.popineau@supelec.fr>.
76e9f7b9 1571 (fstat): Return owner and group like 'stat' and 'lstat' do.
6a9465f3 1572
fa705c99
PE
15732013-01-19 Paul Eggert <eggert@cs.ucla.edu>
1574
9fe43ff6
PE
1575 Work around bug in CIFS and vboxsf file systems (Bug#13149).
1576 The bug was observed on Ubuntu operating inside a virtual machine,
1577 editing files mounted via CIFS or vboxsf from the MS Windows 7 host.
1578 The workaround introduces a race condition on non-buggy hosts,
1579 but it's an unlikely race and anyway there's a nearly identical
1580 nearby race that can't be fixed.
1581 * fileio.c (valid_timestamp_file_system, timestamp_file_system):
1582 New static vars.
1583 (Fwrite_region): Test for file system time stamp bug.
1584 (init_fileio): New function.
1585 * lisp.h (init_fileio): Declare it.
1586 * emacs.c (main): Call it.
1587
fa705c99
PE
1588 * fileio.c (Finsert_file_contents): Simplify new diagnostic
1589 and make it more consistent with other stat-failure diagnostics.
1590
e07469fa
DA
15912013-01-18 Dmitry Antipov <dmantipov@yandex.ru>
1592
99d0d6dc
SM
1593 Fix crash when inserting data from non-regular files.
1594 See http://lists.gnu.org/archive/html/emacs-devel/2013-01/msg00406.html
e07469fa
DA
1595 for the error description produced by valgrind.
1596 * fileio.c (read_non_regular): Rename to read_contents.
1597 Free Lisp_Save_Value object used to pass parameters.
1598 (read_non_regular_quit): Rename to read_contents_quit.
1599 (Finsert_file_contents): Redesign internal file reading loop to adjust
1600 gap and end positions after each read and so help make_gap to work
1601 properly. Do not signal an I/O error too early and so do not leave
1602 not yet decoded characters in a buffer, which was the reason of
1603 redisplay crash. Use list2 to build return value. Adjust comments.
1604
67722112
PE
16052013-01-17 Paul Eggert <eggert@cs.ucla.edu>
1606
1607 Close a race when statting and reading files (Bug#13149).
1608 * fileio.c (Finsert_file_contents): Use open+fstat, not stat+open.
1609 This avoids a race if the file is renamed between stat and open.
1610 This race is not the problem originally noted in Bug#13149;
1611 see <http://bugs.gnu.org/13149#73> and later messages in the thread.
1612
468afbac
DA
16132013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1614
1615 * lisp.h (toplevel): Add comment about using Lisp_Save_Value
1616 objects, related functions and macros.
1617 (make_save_value): Adjust prototype.
1618 (make_save_pointer): New prototype.
1619 (SAFE_NALLOCA): Fix indentation. Use make_save_pointer.
1620 (SAFE_ALLOCA_LISP): Adjust make_save_value usage.
1621 * alloc.c (format_save_value): Rename to make_save_value.
1622 (make_save_pointer): New function.
1623 (record_xmalloc): Use make_save_pointer.
1624 * dired.c, editfns.c, fileio.c, font.c, gtkutil.c, lread.c:
1625 * nsmenu.m, nsterm.m, xfns.c, xmenu.c, xselect.c, keymap.c:
1626 Change users of make_save_value to make_save_pointer.
1627 Likewise for format_save_value and make_save_value.
1628
0e70695a
DA
16292013-01-17 Dmitry Antipov <dmantipov@yandex.ru>
1630
1631 * buffer.h (NARROWED, BUF_NARROWED): Drop unused macros.
1632 (DECODE_POSITION, BUFFER_CHECK_INDIRECTION): Fix indentation.
1633 * buffer.c (toplevel, syms_of_buffer): Drop old commented-out
1634 debugging stubs.
1635
963ea40f
PE
16362013-01-15 Paul Eggert <eggert@cs.ucla.edu>
1637
1638 * alloc.c (free_save_value): Now static.
1639
3346c1d0
DA
16402013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1641
1642 * keymap.c (map_keymap_internal): Use format_save_value.
1643 (map_keymap_char_table_item): Adjust accordingly.
1644 * fileio.c (non_regular_fd, non_regular_inserted)
1645 (non_regular_nbytes): Remove.
99d0d6dc
SM
1646 (Finsert_file_contents): Convert trytry to ptrdiff_t.
1647 Use format_save_value to pass parameters to read_non_regular.
3346c1d0
DA
1648 (read_non_regular): Use XSAVE_ macros to extract parameters.
1649 Adjust comment.
1650 * xmenu.c (xmenu_show) [!USE_X_TOOLKIT && !USE_GTK]: Use
1651 format_save_value.
1652 (pop_down_menu) [!USE_X_TOOLKIT && !USE_GTK]: Adjust user.
1653
2b30549c
DA
16542013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1655
1656 * lisp.h (XSAVE_POINTER, XSAVE_INTEGER): Change to allow
1657 extraction from any Lisp_Save_Value slot. Add type checking.
1658 * alloc.c, dired.c, editfns.c, fileio.c, ftfont.c, gtkutil.c:
1659 * keymap.c, lread.c, nsterm.h, nsmenu.c, xfns.c, xmenu.c:
1660 * xselect.c: All users changed.
1661
1b971ac1
DA
16622013-01-15 Dmitry Antipov <dmantipov@yandex.ru>
1663
1664 Some convenient bits to deal with Lisp_Save_Values.
1665 * lisp.h (XSAVE_OBJECT): New macro to extract saved objects.
1666 (allocate_misc): Remove prototype.
1667 (format_save_value): New prototype.
1668 * alloc.c (allocate_misc): Revert back to static.
1669 (format_save_value): New function to build Lisp_Save_Value
1670 object with the specified internal structure.
1671 (make_save_value): Reimplement using format_save_value.
1672 * editfns.c (save_excursion_save): Use format_save_value.
1673 (save_excursion_restore): Use XSAVE_OBJECT.
1674
c50cf2ea
PE
16752013-01-14 Paul Eggert <eggert@cs.ucla.edu>
1676
1677 Avoid needless casts with XSAVE_POINTER.
1678 * alloc.c (mark_object) [GC_MARK_STACK]:
1679 * dired.c (directory_files_internal_unwind):
1680 * fileio.c (do_auto_save_unwind):
1681 * gtkutil.c (pop_down_dialog):
1682 * keymap.c (map_keymap_char_table_item):
1683 * lread.c (load_unwind):
1684 * nsmenu.m (pop_down_menu):
1685 * print.c (print_object) [GC_MARK_STACK]:
1686 * xfns.c (clean_up_file_dialog):
1687 * xmenu.c (cleanup_widget_value_tree):
1688 Omit casts between XSAVE_POINTER and a pointer type.
1689
9d5a1260
DA
16902013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1691
1692 Fix compilation with GC_MARK_STACK == GC_USE_GCPROS_AS_BEFORE.
1693 * eval.c (eval_sub): Protect `form' from being GCed before its
1694 car and cdr becomes protected with the backtrace entry.
1695
73ebd38f
DA
16962013-01-14 Dmitry Antipov <dmantipov@yandex.ru>
1697
1698 Make Lisp_Save_Value more versatile storage for up to four objects.
1699 * lisp.h (toplevel): Enumeration to describe types of saved objects.
1700 (struct Lisp_Save_Value): New layout. Adjust comments.
1701 (XSAVE_POINTER): New macro.
1702 (XSAVE_INTEGER): Likewise.
1703 (allocate_misc): Add prototype.
1704 (free_misc): Likewise.
1705 * alloc.c (allocate_misc): Now global.
1706 (free_misc): Likewise. Adjust comment.
1707 (make_save_value): Use new Lisp_Save_Value layout. Adjust comment.
1708 (free_save_value): Likewise.
1709 (mark_object): Likewise.
1710 * editfns.c (save_excursion_save): Pack everything within
1711 Lisp_Save_Value and so avoid xmalloc.
1712 (save_excursion_restore): Adjust to match new layout. Use free_misc
1713 because we do not allocate extra memory any more. Add eassert.
1714 * print.c (print_object): New code to print Lisp_Save_Value. Do not
1715 rely on valid_lisp_object_p if !GC_MARK_STACK. Adjust comments.
1716 * dired.c, fileio.c, font.c, ftfont.c, gtkutil.c, keymap.c,
1717 * lread.c, nsmenu.m, nsterm.h, xfns.c, xmenu.c, xselect.c:
1718 Use XSAVE_POINTER and XSAVE_INTEGER where appropriate.
1719
b826986f
JD
17202013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1721
1722 * nsfont.m (LCD_SMOOTHING_MARGIN): New define.
1723 (nsfont_draw): Remove disabling of LCD smoothing.
1724 (ns_glyph_metrics): Add LCD_SMOOTHING_MARGIN to bearings to fix
2e7a1892 1725 Bug#11484 with LCD smoothing on.
b826986f 1726
c0511b57 17272013-01-13 Paul Eggert <eggert@cs.ucla.edu>
45b7bfdd 1728
b6f960a0
PE
1729 Fix SIGDANGER handlers, for AIX (Bug#13408).
1730 * sysdep.c.c (handle_danger_signal, deliver_danger_signal) [SIGDANGER]:
1731 Move handlers here from emacs.c; they were out of place.
1732
616763d5
JD
17332013-01-11 Jan Djärv <jan.h.d@swipnet.se>
1734
1735 * xterm.c (syms_of_xterm): Adjust documentation for
1736 scroll-bar-adjust-thumb-portion.
1737
0b59090b 17382012-12-31 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
ec782c5f
JD
1739
1740 * xterm.c (scroll-bar-adjust-thumb-portion): New variable to
1741 determine whether scroll bar thumb size should be adjusted or
1742 not. Use variable for MOTIF.
1743
1744 * gtkutil.c (scroll-bar-adjust-thumb-portion): Use variable for
1745 GTK.
1746
7bc916b4
JD
17472013-01-13 Jan Djärv <jan.h.d@swipnet.se>
1748
eac4d08f
JD
1749 * nsterm.m (keyDown:): Set processingCompose to NO if an emacs key
1750 event is generated.
1751 (doCommandBySelector:): Set processingCompose to NO.
1752
7bc916b4
JD
1753 * nsfont.m (ns_findfonts): Add block/unblock_input calls.
1754 Remove check for fkeys count > zero, block/unblock fixes the real bug.
1755 (nsfont_list_family): Add block/unblock_input calls.
1756 (nsfont_open): Move block_input earlier. Add unblock_input before early
1757 return.
1758 (nsfont_draw): Add block/unblock_input calls.
1759
bdc9b756
PE
17602013-01-12 Dmitry Antipov <dmantipov@yandex.ru>
1761
1762 * indent.c (Fvertical_motion): Remove now-incorrect GCPROs
1763 for old_charpos and old_bytepos.
1764
ee56a6dc
PE
17652013-01-12 Paul Eggert <eggert@cs.ucla.edu>
1766
1767 Fix bug with set-time-zone-rule and LOCALTIME_CACHE (Bug#13415).
1768 * editfns.c (set_time_zone_rule) [LOCALTIME_CACHE]:
1769 Clear tzvalbuf_in_environ if this workaround is in effect.
1770 Problem and fix reported by Kazuhiro Ito.
1771
9fc9a531
AH
17722013-01-11 Aaron S. Hawley <Aaron.Hawley@vtinfo.com>
1773
99d0d6dc
SM
1774 * insdel.c (Fcombine_after_change_execute, syms_of_insdel):
1775 Fix ambiguous doc string cross-reference(s).
9fc9a531
AH
1776
1777 * keyboard.c (Fcommand_execute, syms_of_keyboard): Fix ambiguous
1778 doc string cross-reference(s).
1779
1780 * window.c (Fwindow_point, syms_of_window): Fix ambiguous doc
1781 string cross-reference(s).
1782
6020559a
DA
17832013-01-11 Dmitry Antipov <dmantipov@yandex.ru>
1784
1785 Avoid unnecessary byte position calculation for the gap movement.
1786 Since all users of move_gap do CHAR_TO_BYTE for other purposes
1787 anyway, all of them should use move_gap_both instead.
1788 * lisp.h (move_gap): Remove prototype.
1789 * insdel.c (move_gap): Remove.
1790 (move_gap_both): Add eassert.
1791 * editfns.c (Ftranspose_regions): Tweak to use move_gap_both.
1792 * xml.c (parse_region): Likewise.
1793
b8956427
PE
17942013-01-11 Paul Eggert <eggert@cs.ucla.edu>
1795
1796 emacsclient -t should not suspend Emacs server (Bug#13387)
1797 * lisp.h, sysdep.c (block_tty_out_signal, unblock_tty_out_signal):
1798 New functions.
1799 * term.c (init_tty): Use them instead of rolling our own code.
1800 * sysdep.c (tcsetpgrp_without_stopping): Likewise. Here, this
1801 switches from 'signal' to 'pthread_sigmask', which is safer in
1802 multithreaded applications.
1803 * term.c (Fresume_tty): Don't bother dissociating if O_IGNORE_CTTY,
1804 which has already arranged for that.
1805 (dissociate_if_controlling_tty): If setsid fails, fall back on TIOCNOTTY.
1806 This is the main part of the bug fix.
1807
0b59090b 18082013-01-10 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> (tiny change)
48660ca5
JD
1809
1810 * gtkutil.c (xg_initialize): Add ifdef HAVE_FREETYPE around
1811 x_last_font_name (Bug#13403).
1812
58cc0a01
DA
18132013-01-10 Dmitry Antipov <dmantipov@yandex.ru>
1814
1815 Omit buffer_slot_type_mismatch and use generic predicates to enforce
1816 the type of per-buffer values where appropriate.
1817 * lisp.h (struct Lisp_Buffer_Objfwd): Rename slottype member to
1818 predicate, which is how it's really used now. Adjust comment.
1819 * buffer.h (buffer_slot_type_mismatch): Remove prototype.
1820 * buffer.c (buffer_slot_type_mismatch): Remove.
1821 (DEFVAR_PER_BUFFER, defvar_per_buffer): Rename type argument to
1822 predicate. Adjust comment.
1823 (syms_of_buffer): Use Qsymbolp for major-mode. Use Qintegerp for
1824 fill-column, left-margin, tab-width, buffer-saved-size,
1825 left-margin-width, right-margin-width, left-fringe-width,
1826 right-fringe-width, scroll-bar-width and buffer-display-count.
1827 Use Qstringp for default-directory, buffer-file-name,
1828 buffer-file-truename and buffer-auto-save-file-name. Use Qfloatp for
1829 scroll-up-aggressively and scroll-down-aggressively. Use Qnumberp for
1830 line-spacing.
1831 * data.c (store_symval_forwarding): Adjust to call the predicate.
1832
5104861e
JB
18332013-01-09 Juanma Barranquero <lekktu@gmail.com>
1834
1835 * w32.c (get_name_and_id, acl_set_file):
1836 * w32term.c (w32fullscreen_hook): Remove unused local variables.
1837
eefd7278
DA
18382013-01-09 Dmitry Antipov <dmantipov@yandex.ru>
1839
1840 * lisp.h (make_gap_1): New prototype.
1841 * buffer.h (GAP_BYTES_DFL, GAP_BYTES_MIN): New macros for the special
1842 gap size values.
1843 * editfns.c (Fbuffer_size): Rename from Fbufsize to fit the common
1844 naming convention.
1845 (syms_of_editfns): Adjust defsubr. Drop commented-out obsolete code.
2eae9ccc 1846 * insdel.c (make_gap_larger): Use GAP_BYTES_DFL. Adjust comment.
eefd7278
DA
1847 (make_gap_smaller): Use GAP_BYTES_MIN. Adjust comment.
1848 (make_gap_1): New function to adjust the gap of any buffer.
1849 * coding.c (coding_alloc_by_making_gap): Use it.
1850 * buffer.c (compact_buffer): Likewise. Use BUF_Z_BYTE, BUF_GAP_SIZE,
1851 GAP_BYTES_DFL and GAP_BYTES_MIN. Adjust comment.
1852
073ca75b
JL
18532013-01-08 Juri Linkov <juri@jurta.org>
1854
1855 * xfaces.c (tty_supports_face_attributes_p): Return 0 for the case
1856 of (supports :underline (:style wave)). (Bug#13000)
1857
3bace969
AH
18582013-01-08 Aaron S. Hawley <aaron.s.hawley@gmail.com>
1859
1860 * undo.c (Fprimitive_undo): Move to simple.el.
1861 (syms_of_undo): Remove declarations for Sprimitive_undo.
1862
63a63bd4
SM
18632013-01-08 Stefan Monnier <monnier@iro.umontreal.ca>
1864
1865 * keyboard.c (echo_add_key): Rename from echo_add_char.
1866
56ed110a
CY
18672013-01-06 Chong Yidong <cyd@gnu.org>
1868
1869 * keyboard.c (echo_add_char): New function, factored out from
1870 echo_char. Don't add a space if the previous echo string was
1871 empty (Bug#13255).
1872 (echo_char): Use it.
1873 (read_key_sequence): When echoing mock input, ensure that the
1874 trailing dash is properly added.
1875
b630991b
EZ
18762013-01-05 Eli Zaretskii <eliz@gnu.org>
1877
1878 * xdisp.c (dump_glyph): Align glyph data better. Use "pD" instead
1879 of a non-portable "t" to print ptrdiff_t values. Allow up to 9
63a63bd4
SM
1880 digits for buffer positions, before misalignment starts.
1881 Display "0" for integer "object" field.
b630991b
EZ
1882 (dump_glyph_row): Adapt the header line to changes in dump_glyph.
1883 Display the newline glyph more unambiguously.
1884
f032a318
YM
18852013-01-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
1886
1887 * nsterm.m (ns_draw_underwave):
1888 * w32term.c (w32_draw_underwave):
1889 * xterm.c (x_draw_underwave): Make underwave look more triangular
1890 and also degrade gracefully for small fonts. (Bug#13000)
1891
4240dd3c
YM
1892 * nsterm.m (ns_draw_text_decoration):
1893 * w32term.c (x_draw_glyph_string):
1894 * xterm.c (x_draw_glyph_string): Don't use previous underline
1895 thickness and position if previous underline type is underwave.
1896
553081a5
SM
18972013-01-04 Stefan Monnier <monnier@iro.umontreal.ca>
1898
1899 * fileio.c (Ffile_acl): Undocument return format.
1900
9539d465 19012013-01-02 Glenn Morris <rgm@gnu.org>
08f59219
GM
1902
1903 * keymap.c (Fkey_description): Doc fix. (Bug#13323)
1904
71376d4b
PE
19052013-01-02 Paul Eggert <eggert@cs.ucla.edu>
1906
1907 Simplify via eabs.
1908 * dired.c (file_name_completion):
1909 * doc.c (get_doc_string):
1910 * floatfns.c (round2):
1911 * font.c (font_score, font_delete_unmatched):
1912 * fringe.c (compute_fringe_widths):
1913 * lread.c (read_list):
1914 * minibuf.c (Ftry_completion):
1915 * term.c (tty_ins_del_lines):
1916 * xterm.c (x_draw_image_foreground, x_draw_image_foreground_1):
1917 Use eabs (x) rather than open-coding it as (x < 0 ? -x : x).
1918
a7f11948
EZ
19192012-12-31 Eli Zaretskii <eliz@gnu.org>
1920
1921 * w32.c (unsetenv): Set up the string passed to _putenv
63a63bd4
SM
1922 correctly.
1923 See http://lists.gnu.org/archive/html/emacs-devel/2012-12/msg00863.html
a7f11948
EZ
1924 for the bug this caused.
1925
84cc1ab6
PE
19262012-12-30 Paul Eggert <eggert@cs.ucla.edu>
1927
1928 * coding.c (Qmac): Now static.
1929
5a1d858b
JD
19302012-12-30 Jan Djärv <jan.h.d@swipnet.se>
1931
1932 * gtkutil.c (TOOLBAR_TOP_WIDGET): New macro.
1933 (xg_pack_tool_bar): Use TOOLBAR_TOP_WIDGET, condition out use of
1934 handlebox_widget. Set toolbar_in_hbox to false/true, set
1935 toolbar_is_packed to true.
1936 (xg_update_tool_bar_sizes): Use widget returned by TOOLBAR_TOP_WIDGET.
1937 (update_frame_tool_bar): Check toolbar_is_packed for packing.
1938 Show all on TOOLBAR_TOP_WIDGET.
1939 (free_frame_tool_bar): Check toolbar_is_packed. Use widget returned
1940 by TOOLBAR_TOP_WIDGET.
1941 (xg_change_toolbar_position): Use widget returned by TOOLBAR_TOP_WIDGET.
1942 Check toolbar_is_packed.
8b745d92
JD
1943 (xg_have_tear_offs, tearoff_remove, tearoff_activate): Condition on
1944 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1945 (xg_have_tear_offs): When ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW, return
1946 false.
1947 (create_menus): Create tearoff only if HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1948 (xg_update_menubar): Update title only if
1949 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1950 (xg_update_submenu): Skip tearoff only if
1951 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
1952 (xg_initialize): Initialize xg_detached_menus only if
1953 HAVE_GTK_TEAROFF_MENU_ITEM_NEW.
5a1d858b
JD
1954
1955 * xterm.h (struct x_output): Surround handlebox_widget with
1956 #ifdef HAVE_GTK_HANDLE_BOX_NEW. toolbar_is_packed is new,
1957 toolbar_in_hbox is bool.
1958
d5e5e7b4 19592012-12-30 Andreas Schwab <schwab@linux-m68k.org>
2550c6e4
AS
1960
1961 * src/Makefile.in (TEMACS_LDFLAGS2): Remove.
1962 (LIBS_GNUSTEP): Define.
1963 (LIBES): Add $(LIBS_GNUSTEP).
1964 (temacs$(EXEEXT)): Use $(LDFLAGS) instead of $(TEMACS_LDFLAGS2).
1965
d5e5e7b4 19662012-12-30 Eli Zaretskii <eliz@gnu.org>
7a3a7493
EZ
1967
1968 * xdisp.c (set_cursor_from_row): Don't confuse a truncation or
1969 continuation glyph on a TTY with an indication of an empty line.
1970 (Bug#13277)
1971
e7ae8039
EZ
19722012-12-29 Eli Zaretskii <eliz@gnu.org>
1973
ccad023b
EZ
1974 * fileio.c (Fset_file_selinux_context, Fset_file_acl): Return t if
1975 file's SELinux context or ACLs successfully set, nil otherwise.
1976 (Bug#13298)
8d23a331 1977 (Fcopy_file) [WINDOWSNT]: Improve diagnostics when CopyFile fails.
ccad023b 1978
e7ae8039
EZ
1979 * w32proc.c (reader_thread): Avoid passing NULL handles to
1980 SetEvent and WaitForSingleObject.
1981
7456e13f
PE
19822012-12-28 Paul Eggert <eggert@cs.ucla.edu>
1983
1984 Port EXTERNALLY_VISIBLE to Clang 3.2.
1985 * conf_post.h (__has_attribute): New macro.
1986 (EXTERNALLY_VISIBLE): Use it. This ports to Clang 3.2.
1987
1ab0c851
GM
19882012-12-27 Glenn Morris <rgm@gnu.org>
1989
1990 * cygw32.c (Fcygwin_convert_file_name_to_windows)
1991 (Fcygwin_convert_file_name_from_windows): Doc fixes.
1992
82e2a1f0 19932012-12-27 Eli Zaretskii <eliz@gnu.org>
f5c81c80 1994
63a63bd4
SM
1995 * fileio.c (file_name_as_directory, directory_file_name):
1996 Accept an additional argument MULTIBYTE to indicate whether the input C
f5c81c80
EZ
1997 came from a multibyte or a unibyte Lisp string; all callers
1998 adjusted. Don't assume the input string is always multibyte.
1999 (Bug#13262)
2000 (Ffile_name_directory) [DOS_NT]: Handle unibyte strings correctly:
2001 don't ENCODE_FILE them, and return a unibyte string if the input
2002 was unibyte.
2003 (Fexpand_file_name): Don't mix unibyte with multibyte strings, and
2004 don't assume the input strings will always be multibyte. If the
2005 input strings are multibyte, decode strings obtained from C
2006 library functions.
2007
8847a0de
DA
20082012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2009
2010 * lisp.h (toplevel): Add two notices to the comment about
2011 defining a new Lisp data type.
6cda572a
DA
2012 * print.c (print_object): If Lisp_Save_Value object's pointer
2013 is the address of a memory area containing Lisp_Objects, try
2014 to print them.
2015 * alloc.c (valid_lisp_object_p): Adjust comment.
8847a0de 2016
4b298d5a
DA
20172012-12-26 Dmitry Antipov <dmantipov@yandex.ru>
2018
2019 * keyboard.c (record_asynch_buffer_change): Initialize an event
2020 only if it's really needed.
2021 * frame.h (enum output_method): Remove output_mac member since
2022 it's a leftover from the deleted code.
2023 * frame.c (Fframep): Adjust user here ...
2024 * terminal.c (Fterminal_live_p): ... and here.
2025 * coding.c (Qmac): Now here because it's only used to denote
2026 end-of-line encoding type.
2027 (syms_of_coding): DEFSYM it.
2028 * frame.h (Qmac): Remove duplicated declaration.
2029
12384b01
PE
20302012-12-26 Paul Eggert <eggert@cs.ucla.edu>
2031
2032 * window.c (select_window_1): Now static, since it's used only here.
2033
f1665bdc
EZ
20342012-12-25 Eli Zaretskii <eliz@gnu.org>
2035
2036 * window.c (window_body_cols): Subtract display margins from the
2037 window body width on TTYs as well. See
2038 http://lists.gnu.org/archive/html/help-gnu-emacs/2012-12/msg00317.html
2039 for the original report.
2040
9a0d4f34
DA
20412012-12-25 Dmitry Antipov <dmantipov@yandex.ru>
2042
2043 * xdisp.c (redisplay_window): Remove inner local variable
2044 because the outer shadowed one has the same meaning.
cd78d9b1
DA
2045 * xterm.h (struct x_output): Remove toolbar_detached member since it's
2046 set but never used.
2047 * gtkutil.c (xg_tool_bar_detach_callback, xg_tool_bar_attach_callback)
2048 (xg_create_tool_bar): Adjust users.
9a0d4f34 2049
f9e7c67e
DA
20502012-12-24 Dmitry Antipov <dmantipov@yandex.ru>
2051
2052 * buffer.h (BUF_COMPACT): New macro to follow the common style.
2053 * buffer.c (Fget_buffer_create): Use it to set compact field of
2054 struct buffer_text to avoid accessing an uninitialized value
2055 when compact_buffer is called for the first time.
2056 (compact_buffer): Use convenient BUF_COMPACT and BUF_MODIFF.
2944d406
DA
2057 (Fset_buffer_modified_p): Use buffer_window_count to check
2058 whether the buffer is displayed in some window.
2059 * xdisp.c (message_dolog): Likewise.
f9e7c67e 2060
299614f3
EZ
20612012-12-23 Eli Zaretskii <eliz@gnu.org>
2062
40ff07a5
EZ
2063 * w32.c (acl_set_file): If setting the file security descriptor
2064 fails, and the new DACL is identical to the existing one, silently
2065 return success. This fixes problems for users backing up their
2066 own files without having the necessary privileges for setting
2067 security descriptors.
2068
299614f3
EZ
2069 * w32proc.c (reader_thread): Do not index fd_info[] with negative
2070 values.
2071 (reader_thread): Exit when cp->status becomes STATUS_READ_ERROR
2072 after WaitForSingleObject returns normally. This expedites reader
2073 thread shutdown when delete_child triggers it.
2074 (reap_subprocess): More accurate commentary for why we call
2075 delete_child only when cp->fd is negative.
2076
2077 * w32.c (sys_close): Do not call delete_child on a subprocess
2078 whose handle is not yet closed. Instead, set its file descriptor
2079 to a negative value, so that reap_subprocess will call
63a63bd4
SM
2080 delete_child on that subprocess when its SIGCHLD arrives.
2081 This avoids closing handles used for communications between sys_select
299614f3
EZ
2082 and reader_thread, which doesn't give sys_select a chance to
2083 notice that the process exited and invoke the SIGCHLD handler for
2084 it.
2085
cf162aee
JD
20862012-12-23 Jan Djärv <jan.h.d@swipnet.se>
2087
2088 * nsfns.m (Fns_do_applescript): Run event loop until script has
2089 been executed (Bug#12969).
2090 (ns_run_ascript): Chech as_script for nil, set to nil after
2091 executing script.
2092
94900bfe
MR
20932012-12-22 Martin Rudalics <rudalics@gmx.at>
2094
2095 * window.c (Fselect_window): Reword doc-string (Bug#13248).
2096
b2faf49c
EZ
20972012-12-22 Eli Zaretskii <eliz@gnu.org>
2098
2099 * w32term.c (w32fullscreen_hook): New function.
2100 (w32_create_terminal): Plug it into the terminal's fullscreen_hook.
2101
7efa3fb3
EZ
21022012-12-21 Eli Zaretskii <eliz@gnu.org>
2103
bb085aed
EZ
2104 * fileio.c (Finsert_file_contents): Doc fix.
2105
7efa3fb3
EZ
2106 * w32proc.c (new_child, delete_child, find_child_pid): For a
2107 subprocess, consider its slot being in use as long as its process
2108 handle (procinfo.hProcess) is not NULL. This avoids reusing the
2109 slot when a new process is started immediately after killing
2110 another one, without waiting enough time for the first process to
2111 be reaped and resources allocated for it be orderly freed.
2112 (Bug#13086)
2113 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2114
c1f02afa
CY
21152012-12-21 Chong Yidong <cyd@gnu.org>
2116
2117 * buffer.c (Fset_buffer_major_mode): Doc fix (Bug#13231).
2118
5bec25eb
CY
2119 * fns.c (Fcompare_strings): Doc fix (Bug#13081).
2120
a4b0cca1 21212012-12-21 Eli Zaretskii <eliz@gnu.org>
92340ec7
EZ
2122
2123 * w32.c (get_name_and_id): Always pass NULL as the first argument
2124 of lookup_account_sid. Avoids crashes with UNC file names that
2125 refer to DFS domains, not to specific machine names. (Bug#12621)
2126 Remove now unused argument FNAME; all callers changed.
2127 (get_file_owner_and_group): Remove now unused argument FNAME; all
2128 callers changed.
2129
34b4b7eb
CY
21302012-12-21 Chong Yidong <cyd@gnu.org>
2131
2132 * editfns.c (Finsert_char): Since read-char-by-name now signals an
2133 error for invalid chars, don't check for a nil return value.
2134
13002885
DA
21352012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2136
2137 Avoid calls to CHAR_TO_BYTE if byte position is known.
2138 * editfns.c (make_buffer_string_both): Use move_gap_both.
2139 (Fbuffer_string): Use make_buffer_string_both.
2140 * marker.c (buf_charpos_to_bytepos): Convert to eassert.
2141 Adjust comment.
2142 (buf_bytepos_to_charpos): Likewise.
2143 (charpos_to_bytepos): Remove.
2144 * fileio.c (Finsert_file_contents): Use move_gap_both.
2145 * search.c (Freplace_match): Likewise.
9a0d4f34 2146 * process.c (process_send_region): Likewise. Use convenient
13002885
DA
2147 names for byte positions.
2148 * lisp.h (charpos_to_bytepos): Remove prototype.
2149 * indent.c (scan_for_column): Use CHAR_TO_BYTE.
2150 * insdel.c (move_gap): Likewise.
2151
99e9311c
PE
21522012-12-20 Paul Eggert <eggert@cs.ucla.edu>
2153
2154 * xdisp.c (redisplay_internal): Remove now-unused local.
2155
e02230bf
SM
21562012-12-20 Stefan Monnier <monnier@iro.umontreal.ca>
2157
2158 * xdisp.c (select_frame_for_redisplay, ensure_selected_frame): Remove.
2159 (redisplay_internal): Don't bother selecting the frame to get the
4a74c818 2160 proper value of frame-local variables (bug#13225).
e02230bf 2161
1687fb14
DA
21622012-12-20 Dmitry Antipov <dmantipov@yandex.ru>
2163
2164 * textprop.c (set_text_properties_1): Do not allow NULL interval.
2165 Rename 4th argument since it may be buffer or string. Adjust comment.
2166 * intervals.c (graft_intervals_info_buffer): Find an interval here.
2167
a2f07cd2
DA
21682012-12-19 Dmitry Antipov <dmantipov@yandex.ru>
2169
2170 * coding.c (Fdetect_coding_region): Do not check start and end with
2171 CHECK_NUMBER_COERCE_MARKER since validate_region does that itself.
2172 (code_convert_region): Likewise.
2173
474d441e
EZ
21742012-12-18 Eli Zaretskii <eliz@gnu.org>
2175
2176 * w32.c (acl_get_file, acl_set_file): Run the file name through
2177 map_w32_filename, and resolve any symlinks in the file name, like
2178 Posix platforms do.
2179 (acl_set_file): Call revert_to_self, if any privileges were
2180 enabled.
2181
8725c076
JB
21822012-12-17 Juanma Barranquero <lekktu@gmail.com>
2183
2184 * makefile.w32-in ($(BLD)/editfns.$(O), $(BLD)/fileio.$(O))
2185 ($(BLD)/w32.$(O)): Update dependencies.
2186
1e101a4b
SM
21872012-12-17 Stefan Monnier <monnier@iro.umontreal.ca>
2188
2189 * xdisp.c (select_frame_for_redisplay): Use select_window_1 to
2190 propagate redisplay's scrolling (if any) to the right window.
2191 (redisplay_internal): Use ensure_selected_frame.
2192 (display_mode_lines): Complete last fix.
2193 * window.c (select_window_1): New func, extracted from select_window.
2194 (select_window): Use it.
2195 * window.h (select_window_1): Declare.
2196
66447e07
EZ
21972012-12-17 Eli Zaretskii <eliz@gnu.org>
2198
2199 Emulate Posix ACL APIs on MS-Windows.
2200 * w32.c: Include sddl.h and sys/acl.h.
2201 (SDDL_REVISION_1): Define if not already defined.
2202 (g_b_init_get_security_descriptor_dacl)
2203 (g_b_init_convert_sd_to_sddl, g_b_init_convert_sddl_to_sd)
2204 (g_b_init_is_valid_security_descriptor)
2205 (g_b_init_set_file_security): New static flags.
2206 (globals_of_w32): Initialize them to zero.
2207 (SetFileSecurity_Name): New string constant.
2208 (SetFileSecurity_Proc, GetSecurityDescriptorDacl_Proc)
2209 (ConvertStringSecurityDescriptorToSecurityDescriptor_Proc)
2210 (ConvertSecurityDescriptorToStringSecurityDescriptor_Proc)
2211 (IsValidSecurityDescriptor_Proc): New typedefs.
2212 (get_file_security, get_security_descriptor_owner)
2213 (get_security_descriptor_group): Set errno to ENOTSUP.
2214 (set_file_security, get_security_descriptor_dacl)
2215 (is_valid_security_descriptor, convert_sd_to_sddl)
2216 (convert_sddl_to_sd, acl_valid, acl_to_text, acl_from_text)
2217 (acl_free, acl_get_file, acl_set_file): New functions.
2218
2219 * fileio.c (Fcopy_file) [WINDOWSNT]: Support copying ACLs.
2220
207a7ef0
PE
22212012-12-17 Paul Eggert <eggert@cs.ucla.edu>
2222
2223 Don't reraise SIGCHLD, as that can now lose (Bug#13192).
2224 With the 2012-12-03 fix for Bug#12980 in place, an old workaround
2225 for some of that bug's symptoms can now cause Emacs to abort.
2226 Remove the workaround.
2227 * process.c (wait_reading_process_output): Don't reraise SIGCHLD.
2228 The bug that caused SIGCHLD to get lost has been fixed, and the
2229 workaround for it can now cause Emacs to abort.
2230
17fdfc15
PE
22312012-12-16 Paul Eggert <eggert@cs.ucla.edu>
2232
2233 * sysdep.c (emacs_abort): Bump backtrace size to 40.
2234 Companion to the 2012-09-30 patch. Suggested by Eli Zaretskii in
2235 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
2236
7c3d167f
RF
22372012-12-16 Romain Francoise <romain@orebokech.com>
2238
2239 * fileio.c (Ffile_acl, Fset_file_acl): New functions.
2240 (Fcopy_file): Change last arg to `preserve_extended_attributes'
1e101a4b 2241 and copy ACL entries of file in addition to SELinux context if set.
7c3d167f
RF
2242 (syms_of_fileio): Add `file-acl' and `set-file-acl'.
2243
2244 * Makefile.in (LIBACL_LIBS): New macro.
2245 (LIBES): Use it.
2246
7d80ea23
PE
22472012-12-15 Paul Eggert <eggert@cs.ucla.edu>
2248
2249 * fileio.c (internal_delete_file): Use bool for boolean.
2250
b0728617
EZ
22512012-12-15 Eli Zaretskii <eliz@gnu.org>
2252
2253 Fix bug #13079 on MS-Windows with temp files not being deleted.
2254 * w32.h (_child_process): New members input_file and
2255 pending_deletion.
2256 (register_child): First argument is now pid_t.
2257 (record_infile, record_pending_deletion): New prototypes.
2258
2259 * w32proc.c (new_child): Initialize input_file and
2260 pending_deletion members of the child.
2261 (delete_child): Delete the child's temporary input file, if any,
2262 that is pending deletion.
2263 (register_child): First argument is now pid_t.
2264 (record_infile, record_pending_deletion): New functions.
2265 (reap_subprocess): Fix a typo in DebPrint string.
2266 (sys_spawnve, sys_kill): Use pid_t for PID arguments.
2267
2268 * fileio.c (internal_delete_file): Return an int again: non-zero
2269 if delete-file succeeds, zero otherwise.
2270
2271 * lisp.h (internal_delete_file): Adjust prototype.
2272
2273 * callproc.c (Fcall_process): Don't overwrite infile with result
2274 of DECODE_FILE.
2275 [WINDOWSNT] If BUFFER is an integer, i.e. we are launching an
2276 asynchronous subprocess, record the name of the input file name,
2277 if any.
2278 (delete_temp_file) [WINDOWSNT]: If internal_delete_file fails to
2279 delete the file, record it as pending deletion when the subprocess
2280 exits.
2281
7e90af26
EZ
22822012-12-14 Eli Zaretskii <eliz@gnu.org>
2283
2284 * editfns.c [HAVE_PWD_H]: Include grp.h.
2285
2286 * makefile.w32-in ($(BLD)/editfns.$(O)): Add $(NT_INC)/grp.h.
2287
97976f9f
PE
22882012-12-14 Paul Eggert <eggert@cs.ucla.edu>
2289
2290 Fix permissions bugs with setgid directories etc. (Bug#13125)
2291 * dired.c (Ffile_attributes): Return t as the 9th attribute,
2292 to mark it as a placeholder. The old value was often wrong.
2293 The only user of this attribute has been changed to use
2294 file-ownership-preserved-p instead, with its new group arg.
2295 * editfns.c (Fgroup_gid, Fgroup_real_gid): New functions.
2296
26ec1f49
SM
22972012-12-14 Stefan Monnier <monnier@iro.umontreal.ca>
2298
ad966fe7
SM
2299 * xdisp.c (select_frame_for_redisplay, display_mode_lines):
2300 Keep selected_window and selected_frame in sync.
26ec1f49 2301
5c207910
EZ
23022012-12-14 Eli Zaretskii <eliz@gnu.org>
2303
2304 * w32.c (stat_worker): If w32_stat_get_owner_group is zero, do not
2305 try to get accurate owner and group information from NT file
2306 security APIs. This is to make most callers of 'stat' and
2307 'lstat', which don't need that information, much faster.
2308
26ec1f49
SM
2309 * dired.c (Ffile_attributes) [WINDOWSNT]:
2310 Set w32_stat_get_owner_group to a non-zero value, to request accurate
5c207910
EZ
2311 owner and group information from 'lstat'.
2312
893f52d8
PE
23132012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2314
4c95c9a5
PE
2315 * fileio.c (Finsert_file_contents): Don't put tail into head area,
2316 as that confuses set-auto-coding, so insist on the head-read
2317 returning the full 1024 bytes. Let lseek compute the tail offset;
2318 less work for us. Do not ignore I/O errors when reading the tail.
2319
893f52d8
PE
2320 * xdisp.c: Minor style fixes.
2321 (init_iterator): Hoist assignment out of if-expression.
2322 (markpos_of_region): Callers now test for sign, not for -1.
2323
40d1e434
DA
23242012-12-13 Dmitry Antipov <dmantipov@yandex.ru>
2325
2326 Minor redisplay optimization when the region length is zero.
2327 * xdisp.c (markpos_of_region): New function.
2328 (init_iterator): Do not highlight the region of zero length.
2329 (redisplay_window): Check whether the region is of non-zero length.
2330 (try_cursor_movement): Allow if the region length is zero.
2331 (try_window_reusing_current_matrix, try_window_id): Likewise.
2332
727f9739 23332012-12-13 Eli Zaretskii <eliz@gnu.org>
e8c6e965
EZ
2334
2335 * search.c (search_buffer): Check the inverse translations of each
2336 character in pattern when the buffer being searched is unibyte.
2337 (Bug#13084)
2338
727f9739 23392012-12-13 Paul Eggert <eggert@cs.ucla.edu>
184246df
PE
2340
2341 * fileio.c (Fvisited_file_modtime): Return (-1 ...) for nonexistent
2342 files, fixing a regression from 24.2.
645c6a30 2343 (Fverify_visited_file_modtime): Don't read uninitialized st.st_size.
184246df 2344
d20704ef
PE
23452012-12-13 Paul Eggert <eggert@cs.ucla.edu>
2346
2347 * fileio.c (Fcopy_file): Make fstat failure as serious as open failure.
2348 fstat shouldn't fail, and if it does fail copy-file should not proceed.
2349 Remove unnecessary S_ISLNK test, as (contra the comments) this
2350 function can't copy symlinks. Improve quality of error message
2351 when attempting to copy files that are neither regular files nor
2352 directories.
2353
2dd61a9b
DA
23542012-12-12 Dmitry Antipov <dmantipov@yandex.ru>
2355
2356 * dispnew.c (set_window_cursor_after_update): Use clip_to_bounds.
2357 * gtkutil.c (xg_set_toolkit_scroll_bar_thumb):
2358 * window.c (Frecenter):
2359 * xdisp.c (resize_mini_window, hscroll_window_tree, draw_glyphs):
2360 * xterm.c (x_set_toolkit_scroll_bar_thumb): Likewise.
2361
cc98b684
DC
23622012-12-12 Daniel Colascione <dancol@dancol.org>
2363
1e101a4b 2364 * unexcw.c (fixup_executable): Use posix_fallocate to ensure that
cc98b684
DC
2365 the dumped Emacs is not a sparse file, greatly improving Cygwin
2366 "make bootstrap" performance.
2367
38e791fd
MA
23682012-12-11 Michael Albinus <michael.albinus@gmx.de>
2369
2370 * inotify.c (inotify_callback): Generate an Emacs event for every
2371 incoming inotify event.
2372
f9d1448f
EZ
23732012-12-11 Eli Zaretskii <eliz@gnu.org>
2374
2375 * xdisp.c (handle_face_prop): Fix logic of computing
2376 it->start_of_box_run_p.
2377 (append_space_for_newline): If the glyph row is R2L, reset the
2378 iterator's end_of_box_run_p flag before prepending the space glyph.
2379 (extend_face_to_end_of_line): If the glyph row is R2L, reset the
2380 iterator's start_of_box_run_p flag before prepending the stretch.
2381 (append_glyph, produce_image_glyph, append_composite_glyph)
2382 (append_stretch_glyph, append_glyphless_glyph): Reverse the
2383 left_box_line_p and right_box_line_p flags of the glyph for R2L
2384 glyph rows. (Bug#13011)
2385
c6afe371
DA
23862012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2387
2388 * buffer.c (Fset_buffer_multibyte): Do not force redisplay
2389 if changed buffer is not shown in a window.
2390 * insdel.c (prepare_to_modify_buffer): Likewise.
2391 * window.c (replace_buffer_in_windows_safely): Do nothing
2392 if buffer is not shown in a window.
2393 (Fforce_window_update): Likewise if string or buffer argument
2394 is passed.
2395
1b47babd
EZ
23962012-12-11 Eli Zaretskii <eliz@gnu.org>
2397
2398 * inotify.c (Finotify_add_watch): Rename decoded_file_name to
2399 encoded_file_name, which is what it is.
2400
4c1acb95
DA
24012012-12-11 Dmitry Antipov <dmantipov@yandex.ru>
2402
2403 Consistently use marker_position and marker_byte_position.
2404 * fringe.c (Ffringe_bitmaps_at_pos):
2405 * indent.c (Fvertical_motion):
2406 * insdel.c (prepare_to_modify_buffer):
2407 * keyboard.c (make_lispy_position):
2408 * window.c (Fwindow_end, Fpos_visible_in_window_p, unshow_buffer)
2409 (window_scroll_pixel_based, displayed_window_lines)
2410 (Fset_window_configuration):
2411 * xdisp.c (message_dolog, with_echo_area_buffer_unwind_data)
2412 (mark_window_display_accurate_1, redisplay_window, decode_mode_spec):
2413 Replace direct access to marker fields with calls
2414 to marker_position and/or marker_byte_position.
2415
0eeb69fe
JB
24162012-12-11 Juanma Barranquero <lekktu@gmail.com>
2417
2418 * makefile.w32-in (SIG2STR_H): New macro.
2419 (SYSWAIT_H, $(BLD)/emacs.$(O), $(BLD)/process.$(O))
2420 ($(BLD)/w32notify.$(O)): Update dependencies.
2421
1cf1bbd5
DC
24222012-12-10 Daniel Colascione <dancol@dancol.org>
2423
8db4b52f
DC
2424 * w32term.c, keyboard.c: Fix build break in cygw32 by omitting
2425 Windows file notification functionality unless WINDOWSNT.
2426
1cf1bbd5
DC
2427 * w32gui.h (hprevinst, lpCmdLine, nCmdShow): Remove unused
2428 declarations.
2429
2430 * w32fns.c (cache_system_info): Initialize the global hinst
2431 variable here so various initialization calls DTRT.
2432
1e101a4b 2433 * unexw32.c (hprevinst, lpCmdLine, nCmdShow): Remove unused variables.
1cf1bbd5
DC
2434 (hinst): Remove unneeded extern declaration.
2435 (_start): Remove initialization of above variables; remove
2436 initialization of hinst, as cache_system_info now does that.
2437
2438 * emacs.c (main): Call cache_system_info early in startup; we
2439 previously weren't calling it in Cygwin builds.
2440
26ec1f49
SM
2441 * Makefile.in (ntsource, WINDRES, W32_RES, W#@_RES_LINK):
2442 Teach the autoconf build system how to compile a Windows resource file
1cf1bbd5
DC
2443 and link it to Emacs.
2444
98a07056
DA
24452012-12-10 Dmitry Antipov <dmantipov@yandex.ru>
2446
2447 Per-buffer window counters.
2448 * buffer.h (struct buffer): New member window_count.
2449 (buffer_window_count): New function.
2450 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
2451 Initialize window_count.
2452 (Fkill_buffer): Verify window_count for the buffer being killed.
2453 (modify_overlay): Do not force redisplay if buffer is not shown
2454 in any window.
2455 (init_buffer_once): Initialize window_count for buffer_defaults
2456 and buffer_local_symbols.
2457 * window.h (buffer_shared): Remove declaration.
2458 (wset_buffer): Convert from inline ...
2459 * window.c (wset_buffer): ... to an ordinary function.
2460 (adjust_window_count): New function.
2461 (make_parent_window): Use it.
2462 * xdisp.c (buffer_shared): Remove.
2463 (redisplay_internal, redisplay_window): Adjust users.
2464 (buffer_shared_and_changed): Use per-buffer window counter.
2465
2b8c9064
EZ
24662012-12-10 Eli Zaretskii <eliz@gnu.org>
2467
2468 Support for filesystem notifications on MS-Windows.
2469 * w32proc.c (sys_select): If drain_message_queue returns non-zero,
2470 and this is a TTY frame, signal the caller that keyboard input is
2471 available.
2472
2473 * w32xfns.c (drain_message_queue): Now returns an int: an
2474 indication whether any WM_EMACS_FILENOTIFY messages were found in
2475 the queue.
2476
2477 * w32inevt.c (handle_file_notifications): New function.
2478 (w32_console_read_socket): Call it to process file notifications.
2479
2480 * w32console.c (initialize_w32_display): Record the main thread ID
2481 in dwMainThreadId.
2482
2483 * deps.mk (inotify.o): New dependency list.
2484
2485 * Makefile.in (SOME_MACHINE_OBJECTS): Add w32notify.o.
2486
2487 * w32term.h (WM_EMACS_FILENOTIFY): New custom message.
2488 (WM_EMACS_END): Bump value by 1.
2489 (notification_buffer_in_use, file_notifications)
2490 (notifications_size, notifications_desc): Declare.
2491 (w32_get_watch_object, lispy_file_action, globals_of_w32notify):
2492 Add prototypes.
2493
2494 * w32term.c (lispy_file_action, queue_notifications): New functions.
2495 (syms_of_w32term) <Qadded, Qremoved, Qmodified, Qrenamed_from>
2496 <Qrenamed_to>: New symbols.
2497 (w32_read_socket): Handle the WM_EMACS_FILENOTIFY message.
2498
2499 * w32notify.c: New file, implements file event notifications for
2500 MS-Windows.
2501
2502 * w32fns.c (w32_wnd_proc): Handle the WM_EMACS_FILENOTIFY message
2503 by posting it to the w32_read_socket queue.
2504
1e101a4b 2505 * termhooks.h (enum event_kind) [HAVE_NTGUI]: Support FILE_NOTIFY_EVENT.
2b8c9064
EZ
2506
2507 * makefile.w32-in (OBJ2): Add $(BLD)/w32notify.$(O).
2508 (GLOBAL_SOURCES): Add w32notify.c
2509 ($(BLD)/w32notify.$(O)): New set of dependencies.
2510
2511 * lisp.h (syms_of_w32notify) [WINDOWSNT]: Add prototype.
2512
1e101a4b
SM
2513 * keyboard.c (kbd_buffer_get_event) [WINDOWSNT]:
2514 Handle FILE_NOTIFY_EVENT.
2b8c9064
EZ
2515 (syms_of_keyboard) [HAVE_NTGUI] <Qfile_notify>: New symbol.
2516 (keys_of_keyboard) [WINDOWSNT]: Bind file-notify to
2517 w32notify-handle-event by default.
2518
2519 * emacs.c (main) [WINDOWSNT]: Call globals_of_w32notify and
2520 syms_of_w32notify.
2521
81606b10
RS
25222012-12-10 Rüdiger Sonderfeld <ruediger@c-plusplus.de>
2523
2b8c9064 2524 Support for filesystem notifications on GNU/Linux via inotify.
1e101a4b 2525 * termhooks.h (enum event_kind) [HAVE_INOTIFY]: Add FILE_NOTIFY_EVENT.
81606b10
RS
2526
2527 * lisp.h (syms_of_inotify) [HAVE_INOTIFY]: Add prototype.
2528
2529 * keyboard.c (Qfile_inotify) [HAVE_INOTIFY]: New variable.
2530 (syms_of_keyboard): DEFSYM it.
2531 (kbd_buffer_get_event) [HAVE_INOTIFY]: Generate FILE_NOTIFY_EVENT.
2532 (make_lispy_event): Support FILE_NOTIFY_EVENT by generating
2533 Qfile_inotify events.
2534 (keys_of_keyboard) [HAVE_INOTIFY]: Bind file-inotify events in
2535 special-event-map to inotify-handle-event.
2536
2537 * emacs.c (main) [HAVE_INOTIFY]: Call syms_of_inotify.
2538
2539 * Makefile.in (base_obj): Add inotify.o.
2540
2541 * inotify.c: New file.
2542
265c2fbf 25432012-12-10 Jan Djärv <jan.h.d@swipnet.se>
a06ae17d
JD
2544
2545 * nsterm.m (fd_handler:): FD_ZERO fds (Bug#13103).
2546
265c2fbf 25472012-12-10 Fabrice Popineau <fabrice.popineau@gmail.com>
cb576b5c
FP
2548
2549 * w32fns.c (cache_system_info): Cast sysinfo_cache.dwPageSize to
2550 DWORD_PTR, for compatibility with 64-bit builds.
2551
a06ae17d 2552 * w32.c (_PROCESS_MEMORY_COUNTERS_EX):
cb576b5c
FP
2553 (GetProcessWorkingSetSize_Proc, get_process_working_set_size)
2554 (system_process_attributes): Use SIZE_T rather than DWORD, for
2555 compatibility with 64-bit builds.
2556
265c2fbf 25572012-12-10 Christopher Schmidt <christopher@ch.ristopher.com>
76b92fee
CS
2558
2559 * lread.c (Vload_source_file_function): Doc fix (Bug#11647).
2560
265c2fbf 25612012-12-10 Eli Zaretskii <eliz@gnu.org>
81d8cc53
EZ
2562
2563 * indent.c (Fvertical_motion): If a display string will be
2564 displayed on the left or the right margin, don't consider it as a
2565 factor in cursor positioning. (Bug#13108)
2566
265c2fbf 25672012-12-10 Martin Rudalics <rudalics@gmx.at>
2cec368c
MR
2568
2569 * editfns.c (Fcompare_buffer_substrings): Reword doc-string.
2570
5f460827
PE
25712012-12-10 Paul Eggert <eggert@cs.ucla.edu>
2572
2573 * fileio.c (Fsubstitute_in_file_name): Use ptrdiff_t, not int,
2574 for string length.
2575
a16e75cd
EZ
25762012-12-08 Eli Zaretskii <eliz@gnu.org>
2577
2578 * w32.c (unsetenv): Return 0 if the input string is too long.
2579
5745a7df
PE
25802012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2581
2582 Use putenv+unsetenv instead of modifying environ directly (Bug#13070).
2583 * alloc.c (xputenv): New function.
2584 * dbusbind.c (Fdbus_init_bus):
2585 * emacs.c (main):
2586 * xterm.c (x_term_init):
2587 Use xputenv instead of setenv or putenv, to detect memory exhaustion.
2588 * editfns.c (initial_tz): Move static var decl up.
2589 (tzvalbuf_in_environ): New static var.
2590 (init_editfns): Initialize these two static vars.
2591 (Fencode_time): Don't assume arbitrary limit on EMACS_INT width.
2592 Save old TZ value on stack, if it's small.
2593 (Fencode_time, set_time_zone_rule): Don't modify 'environ' directly;
2594 instead, use xputenv+unsetenv to set and restore TZ.
2595 (environbuf): Remove static var. All uses removed.
2596 (Fset_time_zone_rule): Do not save TZ and environ;
2597 no longer needed here.
2598 (set_time_zone_rule_tz1, set_time_zone_rule_tz2) [LOCALTIME_CACHE]:
2599 Move to inside set_time_zone_rule; they don't need file scope any more.
2600 (set_time_zone_rule): Maintain the TZ=value string separately.
2601 (syms_of_editfns): Don't initialize initial_tz;
2602 init_editfns now does it.
2603 * emacs.c (dump_tz) [HAVE_TZSET]: Now const.
2604 * lisp.h (xputenv): New decl.
2605
c56efa40
FP
26062012-12-08 Fabrice Popineau <fabrice.popineau@gmail.com>
2607
2608 * w32fns.c (emacs_abort): Don't do arithmetics on void pointers.
2609
75ceee05
EZ
26102012-12-08 Eli Zaretskii <eliz@gnu.org>
2611
2612 * w32.c (unsetenv, sys_putenv): New functions.
2613
1b6dbfeb
CY
26142012-12-08 Chong Yidong <cyd@gnu.org>
2615
2616 * editfns.c (Finsert_char): Make the error message more
2617 informative (Bug#12992).
2618
d983a10b
PE
26192012-12-08 Paul Eggert <eggert@cs.ucla.edu>
2620
7be78020
PE
2621 Simplify get_lim_data.
2622 * vm-limit.c (get_lim_data): Combine RLIMIT_AS and RLIMIT_DATA methods.
2623 Remove USG and vlimit methods; no longer used these days.
2624 Add #error catchall just in case.
2625
d983a10b
PE
2626 Assume POSIX 1003.1-1988 or later for signal.h (Bug#13026).
2627 Exceptions: do not assume SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN,
2628 SIGTTOU, SIGUSR1, SIGUSR2, as Microsoft platforms lack these.
2629 * process.c [subprocesses]: Include <c-ctype.h>, <sig2str.h>.
2630 (deleted_pid_list, Fdelete_process, create_process)
2631 (record_child_status_change, handle_child_signal, deliver_child_signal)
2632 (init_process_emacs, syms_of_process):
2633 Assume SIGCHLD is defined.
2634 (parse_signal): Remove. All uses removed.
2635 (abbr_to_signal): New static function.
2636 (Fsignal_process): Use it to convert signal names to ints.
2637 * sysdep.c (sys_suspend) [!DOS_NT]: Use kill (0, ...) rather than
2638 kill (getpgrp (), ...).
2639 (emacs_sigaction_init): Assume SIGCHLD is defined.
2640 (init_signals): Assume SIGALRM, SIGCHLD, SIGHUP, SIGKILL,
2641 SIGPIPE, and SIGQUIT are defined. Do not worry about SIGCLD any more.
2642 * syssignal.h (EMACS_KILLPG): Remove.
2643 All uses replaced by 'kill' with a negative pid.
2644 (SIGCHLD): Remove definition, as we now assume SIGCHLD.
2645 * w32proc.c (sys_kill): Support negative pids compatibly with POSIX.
2646
9cdde1e2
PE
26472012-12-07 Paul Eggert <eggert@cs.ucla.edu>
2648
2649 * sysdep.c (get_child_status): Abort on internal error (Bug#13086).
2650 This will cause a production Emacs to dump core instead of
2651 infinite-looping.
2652
822995f8
DA
26532012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2654
2655 * frame.c (make_frame): Do not set window's buffer to t.
2656 * window.c (Fsplit_window_internal): Likewise. Previously it was
2657 used to indicate that the window is being set up. Now we use
2658 set_window_buffer for all new windows, so the condition in ...
2659 (Fset_window_buffer): ... is always true and can be removed.
2660
ed08365b
DA
26612012-12-07 Dmitry Antipov <dmantipov@yandex.ru>
2662
2663 Convenient macro to check whether the buffer is hidden.
2664 * buffer.h (BUFFER_HIDDEN_P): New macro.
2665 * frame.c (make_frame): Use it. Adjust comment.
2666 * buffer.c (candidate_buffer): New function.
2667 (Fother_buffer, other_buffer_safely): Use it.
2668
e86f5134
EZ
26692012-12-06 Eli Zaretskii <eliz@gnu.org>
2670
2671 * w32proc.c (waitpid): Avoid busy-waiting when called with WNOHANG
2672 if the child process is still running. Instead, exit the wait
2673 loop and return zero. (Bug#13086)
2674
1700db3c
DA
26752012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2676
2677 * frame.h (x_char_width, x_char_height): Remove prototypes.
2678 * w32term.h (x_char_width, x_char_height): Likewise.
2679 * xfns.c (x_char_width, x_char_height): Remove.
2680 * w32fns.c (x_char_width, x_char_height): Likewise.
2681 * nsfns.c (x_char_width, x_char_height): Likewise.
2682 * frame.c (Fframe_char_width): Use FRAME_COLUMN_WIDTH for
2683 all window frames.
2684 (Fframe_char_height): Likewise with FRAME_LINE_HEIGHT.
2685 * keyboard.c (command_loop_1): Remove prototype.
2686 (command_loop_2, top_level_1): Add static to match prototype.
2687
35fb8050
PE
26882012-12-06 Paul Eggert <eggert@cs.ucla.edu>
2689
2690 Fix a recently-introduced delete-process race condition.
2691 * callproc.c, process.h (record_kill_process):
2692 New function, containing part of the old call_process_kill.
2693 (call_process_kill): Use it.
2694 This does not change call_process_kill's behavior.
2695 * process.c (Fdelete_process): Use record_kill_process to fix a
2696 race condition that could cause Emacs to lose track of a child.
2697
565212e5
DA
26982012-12-06 Dmitry Antipov <dmantipov@yandex.ru>
2699
2700 Avoid code duplication between prev_frame and next_frame.
2701 * frame.c (candidate_frame): New function. Add comment.
2702 (prev_frame, next_frame): Use it. Adjust comment.
2703
d8ad4d3f 27042012-12-06 Eli Zaretskii <eliz@gnu.org>
d3cefd13
EZ
2705
2706 * callproc.c (Fcall_process_region) [!HAVE_MKSTEMP]: If mktemp
2707 fails, signal an error instead of continuing with an empty
2708 string. (Bug#13079)
7c2fcf9b
EZ
2709 Encode expanded temp file pattern before passing it to mkstemp or
2710 mktemp.
d3cefd13 2711
2e7cddd3
EZ
2712 * fileio.c (file_name_as_directory, directory_file_name) [DOS_NT]:
2713 Encode the file name before passing it to dostounix_filename, in
2714 case it will downcase it (under w32-downcase-file-names).
2715 (Bug#12933)
2716
644d3f0d
PE
27172012-12-05 Paul Eggert <eggert@cs.ucla.edu>
2718
2719 Minor call-process cleanups.
2720 * callproc.c (Fcall_process): Do record-unwind-protect on MSDOS
2721 at the same time as other platforms, to simplify analysis.
2722 No need for fd0_volatile since we have synch_process_fd.
2723 Avoid needless emacs_close; arg is always negative.
2724
396376f1
AS
27252012-12-04 Andreas Schwab <schwab@linux-m68k.org>
2726
2727 * callproc.c (Fcall_process): Fix specpdl nesting for asynchronous
2728 processes.
2729
350f51ad
DA
27302012-12-04 Dmitry Antipov <dmantipov@yandex.ru>
2731
2732 * lisp.h (Mouse_HLInfo): Remove set-but-unused mouse_face_image_state
2733 member. Adjust users. Convert mouse_face_past_end, mouse_face_defer
2734 and mouse_face_hidden members to a bitfields.
2735 * frame.h (struct frame): Remove set-but-not-used space_width member.
2736 (FRAME_SPACE_WIDTH): Remove.
2737 * nsterm.m, w32term.c, xterm.c: Adjust users.
2738 * termchar.h (struct tty_display_info): Remove set-but-unused se_is_so
2739 member. Adjust users. Convert term_initted, delete_in_insert_mode,
2740 costs_set, insert_mode, standout_mode, cursor_hidden and flow_control
2741 members to a bitfields.
2742
bc9dbce6
PE
27432012-12-03 Paul Eggert <eggert@cs.ucla.edu>
2744
bb5f74ee
PE
2745 Don't let call-process be a zombie factory (Bug#12980).
2746 Fixing this bug required some cleanup of the signal-handling code.
2747 As a side effect, this change also fixes a longstanding rare race
2748 condition whereby Emacs could mistakenly kill unrelated processes,
2749 and it fixes a bug where a second C-g does not kill a recalcitrant
2750 synchronous process in GNU/Linux and similar platforms.
2751 The patch should also fix the last vestiges of Bug#9488,
2752 a bug which has mostly been fixed on the trunk by other changes.
2753 * callproc.c, process.h (synch_process_alive, synch_process_death)
2754 (synch_process_termsig, sync_process_retcode):
2755 Remove. All uses removed, to simplify analysis and so that
2756 less consing is done inside critical sections.
2757 * callproc.c (call_process_exited): Remove. All uses replaced
2758 with !synch_process_pid.
2759 * callproc.c (synch_process_pid, synch_process_fd): New static vars.
2760 These take the role of what used to be in unwind-protect arg.
2761 All uses changed.
2762 (block_child_signal, unblock_child_signal):
2763 New functions, to avoid races that could kill innocent-victim processes.
2764 (call_process_kill, call_process_cleanup, Fcall_process): Use them.
2765 (call_process_kill): Record killed processes as deleted, so that
2766 zombies do not clutter up the system. Do this inside a critical
2767 section, to avoid a race that would allow the clutter.
2768 (call_process_cleanup): Fix code so that the second C-g works again
2769 on common platforms such as GNU/Linux.
2770 (Fcall_process): Create the child process in a critical section,
2771 to fix a race condition. If creating an asynchronous process,
2772 record it as deleted so that zombies do not clutter up the system.
2773 Do unwind-protect for WINDOWSNT too, as that's simpler in the
2774 light of these changes. Omit unnecessary call to emacs_close
2775 before failure, as the unwind-protect code does that.
2776 * callproc.c (call_process_cleanup):
2777 * w32proc.c (waitpid): Simplify now that synch_process_alive is gone.
2778 * process.c (record_deleted_pid): New function, containing
2779 code refactored out of Fdelete_process.
2780 (Fdelete_process): Use it.
2781 (process_status_retrieved): Remove. All callers changed to use
2782 child_status_change.
2783 (record_child_status_change): Remove, folding its contents into ...
2784 (handle_child_signal): ... this signal handler. Now, this
2785 function is purely a handler for SIGCHLD, and is not called after
2786 a synchronous waitpid returns; the synchronous code is moved to
2787 wait_for_termination. There is no need to worry about reaping
2788 more than one child now.
2789 * sysdep.c (get_child_status, child_status_changed): New functions.
2790 (wait_for_termination): Now takes int * status and bool
2791 interruptible arguments, too. Do not record child status change;
2792 that's now the caller's responsibility. All callers changed.
2793 Reimplement in terms of get_child_status.
2794 (wait_for_termination_1, interruptible_wait_for_termination):
2795 Remove. All callers changed to use wait_for_termination.
2796 * syswait.h: Include <stdbool.h>, for bool.
2797 (record_child_status_change, interruptible_wait_for_termination):
2798 Remove decls.
2799 (record_deleted_pid, child_status_changed): New decls.
2800 (wait_for_termination): Adjust to API changes noted above.
2801
bc9dbce6
PE
2802 * bytecode.c, lisp.h (Qbytecode): Remove.
2803 No longer needed after 2012-11-20 interactive-p changes.
2804
3cf3c607
EZ
28052012-12-03 Eli Zaretskii <eliz@gnu.org>
2806
2807 * xdisp.c (redisplay_window): If the cursor is visible, but inside
2808 the scroll margin, move point outside the margin. (Bug#13055)
2809
005c8d13
JD
28102012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2811
2812 * gtkutil.c (my_log_handler): New function.
2813 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
2814
20edc1c9
DA
28152012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2816
2817 * lisp.h (modify_region): Rename to...
2818 (modify_region_1): ...new prototype.
2819 * textprop.c (modify_region): Now static. Adjust users.
2820 * insdel.c (modify_region): Rename to...
2821 (modify_region_1): ...new function to work with current buffer.
2822 Adjust comment and users. Use true and false for booleans.
2823
62c2e5ed
DA
28242012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2825
2826 * alloc.c (free_save_value): New function.
2827 (safe_alloca_unwind): Use it.
2828 * lisp.h (free_save_value): New prototype.
2829 * editfns.c (save_excursion_save): Use Lisp_Misc_Save_Value.
2830 Add comment.
2831 (save_excursion_restore): Adjust to match saved data structure.
2832 Use free_save_value to offload some work from GC. Drop obsolete
2833 #if 0 code.
2834
c5bc2d1d 28352012-12-03 Chong Yidong <cyd@gnu.org>
a2458031
CY
2836
2837 * fileio.c (Vauto_save_list_file_name): Doc fix.
2838
c5bc2d1d 28392012-12-03 Fabrice Popineau <fabrice.popineau@gmail.com>
c7b36b95
FP
2840
2841 * w32fns.c: Remove prototype of atof.
1e101a4b 2842 (syspage_mask): Make it DWORD_PTR, for compatibility with 64-bit
c7b36b95 2843 builds.
1e101a4b 2844 (file_dialog_callback): Make it UINT_PTR.
c7b36b95
FP
2845
2846 * w32common.h (syspage_mask): Declare DWORD_PTR, for compatibility
2847 with 64-bit builds.
2848
2849 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
2850 (FILE_ANY_ACCESS, CTL_CODE) [_MSC_VER]: Define only if not already
2851 defined.
2852
c5bc2d1d 28532012-12-03 Glenn Morris <rgm@gnu.org>
14d27346 2854
a9de9f0c 2855 * data.c (Fboundp, Fsymbol_value): Doc fix re lexical-binding.
14d27346 2856
21e54a94
PE
28572012-12-02 Paul Eggert <eggert@cs.ucla.edu>
2858
2dd2e622
PE
2859 Fix xpalloc confusion after memory is exhausted.
2860 * alloc.c (xpalloc): Comment fix.
2861 * charset.c (Fdefine_charset_internal): If xpalloc exhausts memory
2862 and signals an error, do not clear charset_table_size, as
2863 charset_table is still valid.
2864 * doprnt.c (evxprintf): Clear *BUF after freeing it.
2865
21e54a94
PE
2866 Use execve to avoid need to munge environ (Bug#13054).
2867 * callproc.c (Fcall_process):
2868 * process.c (create_process):
2869 Don't save and restore environ; no longer needed.
2870 * callproc.c (child_setup):
2871 Use execve, not execvp, to preserve environ.
2872
3e5490f7
PE
28732012-12-01 Paul Eggert <eggert@cs.ucla.edu>
2874
2875 * xterm.c (x_draw_image_relief): Remove unused locals (Bug#10500).
2876
75b4f59c
YM
28772012-12-01 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
2878
2879 * xterm.c (x_draw_relief_rect, x_draw_image_relief): Fix relief
2880 display for sliced images (Bug#10500).
2881
2882 * w32term.c (w32_draw_relief_rect, x_draw_image_relief): Likewise.
2883
f8aff4c6
JB
28842012-11-30 Juanma Barranquero <lekktu@gmail.com>
2885
2886 * doc.c (Fdocumentation): Re-add handling of function-documentation,
2887 accidentally removed in 2012-11-09T04:10:16Z!monnier@iro.umontreal.ca (bug#13034).
2888
3940b924
DA
28892012-11-29 Dmitry Antipov <dmantipov@yandex.ru>
2890
2891 * xdisp.c (window_outdated): Remove eassert since it hits
2892 some suspicious corner cases (see Bug#13007 and Bug#13012).
2893 (mode_line_update_needed): New function.
2894 (redisplay_internal, redisplay_window): Use it.
2895 (ensure_selected_frame): New function.
2896 (redisplay_internal, unwind_redisplay): Use it.
2897 (redisplay_internal): Move comment about buffer_shared...
2898 (buffer_shared_and_changed): ...near to its real use.
2899
4a9204fe
PE
29002012-11-29 Paul Eggert <eggert@cs.ucla.edu>
2901
2902 * callproc.c (Fcall_process): Don't misreport vfork failure.
2903
60aeceb8
PE
29042012-11-28 Paul Eggert <eggert@cs.ucla.edu>
2905
2906 * callproc.c (Fcall_process): Fix vfork portability problems.
2907 Do not assume that fd[0], count, filefd, and save_environ survive
2908 vfork. Fix bug whereby wrong errno value could be reported for
2909 pipe failure. Some minor cleanups, too, as follows. Move buf and
2910 bufsize to the context where they're needed. Change new_argv to
2911 be of type char **, as this is more convenient and avoids casts.
2912 (CALLPROC_BUFFER_SIZE_MIN, CALLPROC_BUFFER_SIZE_MAX):
2913 Now local constants, not macros.
2914
00dc3ead
KH
29152012-11-18 Kenichi Handa <handa@gnu.org>
2916
2917 * font.c (font_unparse_xlfd): Fix previous change. Keep "const"
2918 for the variable "f".
2919
e1bf05c1
KH
29202012-11-13 Kenichi Handa <handa@gnu.org>
2921
2922 * font.c (font_unparse_xlfd): Exclude special characters from the
2923 generating XLFD name.
2924
22626a85
PE
29252012-11-27 Paul Eggert <eggert@cs.ucla.edu>
2926
350e0088
PE
2927 Assume POSIX 1003.1-1988 or later for grp.h, pwd.h.
2928 * dired.c (stat_uname, stat_gname):
2929 * fileio.c (Fexpand_file_name): Remove no-longer-needed casts.
2930
22626a85
PE
2931 Assume POSIX 1003.1-1988 or later for errno.h (Bug#12968).
2932 * dired.c (directory_files_internal, file_name_completion):
2933 Assume EAGAIN and EINTR are defined.
350e0088 2934
22626a85
PE
2935 * fileio.c (Fcopy_file): Assume EISDIR is defined.
2936 * gmalloc.c (ENOMEM, EINVAL): Assume they're defined.
2937 * gnutls.c (emacs_gnutls_write): Assume EAGAIN is defined.
2938 * lread.c (readbyte_from_file): Assume EINTR is defined.
2939 * process.c (wait_reading_process_output, send_process) [subprocesses]:
2940 Assume EIO and EAGAIN are defined.
2941 * unexcoff.c (write_segment): Assume EFAULT is defined.
2942
5c9cf0a3 29432012-11-27 Eli Zaretskii <eliz@gnu.org>
3fa1e84d
EZ
2944
2945 * fontset.c (Finternal_char_font): Return nil on non-GUI frames.
2946 (Bug#11964)
2947
22294a56
EZ
2948 * xdisp.c (draw_glyphs): Don't draw in mouse face if mouse
2949 highlighting on the frame was cleared. Prevents assertion
2950 violations when repeatedly clicking on the "Top" link of the
2951 "bread-crumbs" in Info buffers.
2952
5fbab051
PE
29532012-11-25 Paul Eggert <eggert@cs.ucla.edu>
2954
2955 * sysdep.c (sys_subshell): Don't assume pid_t fits in int.
2956
bcd77a2b
KB
29572012-11-24 Ken Brown <kbrown@cornell.edu>
2958
2959 * keyboard.c (HAVE_MOUSE):
2960 * frame.c (HAVE_MOUSE): Remove, and rewrite code as if HAVE_MOUSE
2961 were always defined.
2962
d125ca15 29632012-11-24 Eli Zaretskii <eliz@gnu.org>
8654a41b 2964
24becea4
EZ
2965 * xdisp.c (set_cursor_from_row): Skip step 2 only if point is not
2966 between bpos_covered and bpos_max. This fixes cursor display when
2967 several display strings follow each other.
2968
8654a41b
EZ
2969 * .gdbinit (pgx): If the glyph's object is a string, display the
2970 pointer to string data, rather than the value of the string object
2971 itself (which barfs under CHECK_LISP_OBJECT_TYPE).
2972
cb5867b1
EZ
2973 * indent.c (Fvertical_motion): If the starting position is covered
2974 by a display string, return to one position before that, to avoid
2975 overshooting it inside move_it_to. (Bug#12930)
2976
f418b22e
DA
29772012-11-23 Dmitry Antipov <dmantipov@yandex.ru>
2978
2979 * frame.h (struct frame): Remove display_preempted member
2980 since all users are dead long ago.
2981 * nsterm.h (struct x_output): Use the only dummy member.
2982 * w32menu.c (pending_menu_activation): Remove since not
2983 really used.
2984 (set_frame_menubar): Adjust user.
2985 * w32term.h (struct x_output): Drop outdated #if 0 code.
2986 (struct w32_output): Use bitfields for explicit_parent,
26ec1f49
SM
2987 asked_for_visible and menubar_active members.
2988 Drop unused pending_menu_activation member.
f418b22e
DA
2989 * xterm.h (struct x_output): Drop outdated #if 0 code.
2990 Use bitfields for explicit_parent, asked_for_visible,
2991 has_been_visible and net_wm_state_hidden_seen members.
2992
a879f0ea
EZ
29932012-11-23 Eli Zaretskii <eliz@gnu.org>
2994
2995 * makefile.w32-in (globals.h, gl-stamp): Use $(SWITCHCHAR) instead
2996 of a literal "/". (Bug#12955)
2997 (gl-stamp): Invoke fc.exe directly, not through cmd.
2998
95ef7787
PE
29992012-11-23 Paul Eggert <eggert@cs.ucla.edu>
3000
3001 Assume POSIX 1003.1-1988 or later for dirent.h (Bug#12958).
3002 * dired.c: Assume HAVE_DIRENT_H.
3003 (NAMLEN): Remove, replacing with ...
3004 (dirent_namelen): New function. All uses changed. Use the GNU macro
3005 _D_EXACT_NAMELEN if available, as it's faster than strlen.
3006 (DIRENTRY): Remove, replacing all uses with 'struct dirent'.
3007 (DIRENTRY_NONEMPTY): Remove. All callers now assume it's nonzero.
3008 * makefile.w32-in (DIR_H): Remove. All uses replaced with
3009 $(NT_INC)/dirent.h.
3010 ($(BLD)/w32.$(O)): Do not depend on $(SRC)/ndir.h.
3011 * ndir.h: Rename to ../nt/inc/dirent.h.
3012 * sysdep.h (closedir) [!HAVE_CLOSEDIR]: Remove.
3013 Do not include <dirent.h>; no longer needed.
3014 * w32.c: Include <dirent.h> rather than "ndir.h".
3015
12645ae6
CY
30162012-11-23 Chong Yidong <cyd@gnu.org>
3017
3018 * xftfont.c (xftfont_open): Remove duplicate assignment.
3019
5c747675
DA
30202012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3021
3022 * alloc.c (Fgarbage_collect): Unblock input after clearing
3023 gc_in_progress to avoid note_mouse_highlight glitch with GC.
3024 * frame.h (FRAME_MOUSE_UPDATE): New macro.
3025 * msdos.c (IT_frame_up_to_date): Use it here...
3026 * w32term.c (w32_frame_up_to_date): ...here...
3027 * xterm.c (XTframe_up_to_date): ...and here...
3028 * nsterm.m (ns_frame_up_to_date): ...but not here.
3029 * lisp.h (Mouse_HLInfo): Remove mouse_face_deferred_gc member.
3030 Adjust users.
3031 * xdisp.c (message2_nolog, message3_nolog, note_mouse_highlight):
3032 Do not check whether GC is in progress.
3033
6ceeb5f1
DA
30342012-11-22 Dmitry Antipov <dmantipov@yandex.ru>
3035
3036 * xdisp.c (window_buffer_changed): New function.
3037 (update_menu_bar, update_tool_bar): Use it to
3038 simplify large 'if' statements.
3039 (redisplay_internal): Generalize commonly used
3040 'tail' and 'frame' local variables.
3041
ec84768f
EZ
30422012-11-22 Eli Zaretskii <eliz@gnu.org>
3043
3044 * w32.c (getcwd): Fix the 2nd argument type, to prevent conflicts
3045 with Windows system header.
3046
9239d970
PE
30472012-11-21 Paul Eggert <eggert@cs.ucla.edu>
3048
3049 Assume POSIX 1003.1-1988 or later for unistd.h (Bug#12945).
3050 * alloc.c: Assume unistd.h exists.
3051 * fileio.c (Fexpand_file_name) [DOS_NT]: Use getcwd, not getwd.
3052 * sysdep.c (get_current_dir_name): Assume getcwd exists.
3053 (getwd) [USG]: Remove; no longer needed.
3054 (sys_subshell) [DOS_NT]: Use getcwd, not getwd.
3055 * w32.c (getcwd): Rename from getwd, and switch to getcwd's API.
3056 * w32.h (getcwd): Remove decl.
3057
954bba56
SM
30582012-11-21 Stefan Monnier <monnier@iro.umontreal.ca>
3059
3060 * xdisp.c (fast_set_selected_frame): Rename from update_tool_bar_unwind.
3061 Make it set selected_window as well.
3062 (update_tool_bar): Use it.
3063
6ef2e5ef 30642012-11-21 Ken Brown <kbrown@cornell.edu>
4ffea447
KB
3065
3066 * emacs.c (main): Set the G_SLICE environment variable for all
3067 Cygwin builds, not just GTK builds. See
3068 https://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00368.html.
3069
6ef2e5ef 30702012-11-21 Eli Zaretskii <eliz@gnu.org>
88c4a13c
EZ
3071
3072 * w32.c (FILE_DEVICE_FILE_SYSTEM, METHOD_BUFFERED)
3073 (FILE_ANY_ACCESS, CTL_CODE, FSCTL_GET_REPARSE_POINT) [_MSC_VER]:
3074 Define for the MSVC compiler.
3075
6ef2e5ef 3076 * w32term.h (EnumSystemLocalesW) [_MSC_VER]: Add a missing semi-colon.
273ac8d1
EZ
3077
3078 * fileio.c (Fsubstitute_in_file_name, Ffile_name_directory)
3079 (Fexpand_file_name) [DOS_NT]: Pass encoded file name to
3080 dostounix_filename. Prevents crashes down the road, because
26ec1f49
SM
3081 dostounix_filename assumes it gets a unibyte string.
3082 Reported by Michel de Ruiter <michel@sentient.nl>, see
273ac8d1
EZ
3083 http://lists.gnu.org/archive/html/help-emacs-windows/2012-11/msg00017.html
3084
eadf1faa
SM
30852012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3086
3087 Conflate Qnil and Qunbound for `symbol-function'.
3088 * alloc.c (Fmake_symbol): Initialize `function' to Qnil.
3089 * lread.c (init_obarray): Set `function' fields to Qnil.
3090 * eval.c (Fcommandp): Ignore Qunbound.
3091 (Fautoload, eval_sub, Fapply, Ffuncall, Fmacroexpand):
3092 * data.c (Ffset, Ffboundp, indirect_function, Findirect_function):
3093 Test NILP rather than Qunbound.
3094 (Ffmakunbound): Set to Qnil.
3095 (Fsymbol_function): Never signal an error.
3096 (Finteractive_form): Ignore Qunbound.
3097
b83fdfa9
PE
30982012-11-20 Paul Eggert <eggert@cs.ucla.edu>
3099
3100 * eval.c (interactive_p): Remove no-longer-used decl.
3101
952580c5
DA
31022012-11-20 Dmitry Antipov <dmantipov@yandex.ru>
3103
3104 * xdisp.c (buffer_shared): Adjust comment.
3105 (buffer_shared_and_changed): New function.
3106 (prepare_menu_bars, redisplay_internal): Use it to
3107 decide whether all windows or frames should be updated.
ea6de9b1
DA
3108 (window_outdated): New function.
3109 (text_outside_line_unchanged_p, redisplay_window): Use it.
3110 (redisplay_internal): Likewise. Fix indentation.
952580c5 3111
23ba2705
SM
31122012-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
3113
3114 * eval.c (Finteractive_p, Fcalled_interactively_p, interactive_p): Remove.
3115 (syms_of_eval): Remove corresponding defsubr.
3116 * bytecode.c (exec_byte_code): `interactive-p' is now a Lisp function.
3117
6e9f7997
DC
31182012-11-19 Daniel Colascione <dancol@dancol.org>
3119
3120 * w32fns.c (Fx_file_dialog):
3121 (Fx_file_dialog): Accomodate rename of cygwin_convert_path* to
3122 cygwin_convert_file_name*.
3123
3124 * cygw32.c (Fcygwin_convert_path_to_windows, syms_of_cygw32):
3125 Rename cygwin_convert_path* to cygwin_convert_file_name*.
3126
552a1590
PE
31272012-11-18 Paul Eggert <eggert@cs.ucla.edu>
3128
3129 * nsterm.m (ns_select): Send SIGIO only to self, not to process group.
3130
2ac9538d 31312012-11-18 Eli Zaretskii <eliz@gnu.org>
d8715cdf
EZ
3132
3133 * w32select.c: Include w32common.h before w32term.h, so that
3134 windows.h gets included before w32term.h uses some of its
3135 features, see below.
3136
23ba2705
SM
3137 * w32term.h (LOCALE_ENUMPROCA, LOCALE_ENUMPROCW) [_MSC_VER]:
3138 New typedefs.
3139 (EnumSystemLocalesA, EnumSystemLocalesW) [_MSC_VER]:
3140 New prototypes.
d8715cdf
EZ
3141 (EnumSystemLocales) [_MSC_VER]: Define if undefined. (Bug#12878)
3142
2ac9538d 31432012-11-18 Jan Djärv <jan.h.d@swipnet.se>
7436fc63
JD
3144
3145 * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834).
3146 (ns_select): Return at once if events are held (Bug#12834).
3147
2ac9538d 31482012-11-18 enami tsugutomo <tsugutomo.enami@jp.sony.com>
86dcf21c 3149
3150 * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64.
3151 Needed following 2012-10-20 change. (Bug#12902)
3152
c1f7ba3a
JB
31532012-11-18 Juanma Barranquero <lekktu@gmail.com>
3154
3155 * w32proc.c (waitpid): Remove unused label get_result.
3156
a75ce9d3
JB
31572012-11-17 Juanma Barranquero <lekktu@gmail.com>
3158
3159 * makefile.w32-in (SYSWAIT_H): New macro.
3160 ($(BLD)/callproc.$(O), $(BLD)/w32proc.$(O), $(BLD)/process.$(O))
3161 ($(BLD)/sysdep.$(O)): Update dependencies.
3162
49cdacda
PE
31632012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3164
3165 Assume POSIX 1003.1-1988 or later for fcntl.h (Bug#12881).
3166 * callproc.c (relocate_fd): Assume F_DUPFD.
3167 * emacs.c, term.c (O_RDWR): Remove.
3168 * keyboard.c (tty_read_avail_input): Use O_NONBLOCK rather than
3169 O_NDELAY, since O_NONBLOCK is the standard name for this flag.
3170 * nsterm.m: Assume <fcntl.h> exists.
3171 * process.c (NON_BLOCKING_CONNECT, allocate_pty, create_process)
3172 (create_pty, Fmake_network_process, server_accept_connection)
3173 (wait_reading_process_output, init_process_emacs):
3174 Assume O_NONBLOCK.
3175 (wait_reading_process_output): Put in a special case for WINDOWSNT
3176 to mimick the older behavior where it had O_NDELAY but not O_NONBLOCK.
3177 It's not clear this is needed, but it's a more-conservative change.
3178 (create_process): Assume FD_CLOEXEC.
3179 (create_process, create_pty): Assume O_NOCTTY.
3180 * sysdep.c (init_sys_modes, reset_sys_modes): Assume F_SETFL.
3181 (reset_sys_modes): Use O_NONBLOCK rather than O_NDELAY.
3182 Omit if not DOS_NT, since F_GETFL is not defined there.
3183 (serial_open): Assume O_NONBLOCK and O_NOCTTY.
3184 * term.c: Include <fcntl.h>, for flags like O_NOCTTY.
3185 (O_NOCTTY): Remove.
3186 (init_tty): Assume O_IGNORE_CTTY is defined to 0 on platforms that
3187 lack it, since gnulib guarantees this.
3188 * w32.c (fcntl): Test for O_NONBLOCK rather than O_NDELAY.
3189
22bae83f
EZ
31902012-11-17 Eli Zaretskii <eliz@gnu.org>
3191
6ad30855
EZ
3192 * w32.c (faccessat): Pretend that directories have the execute bit
3193 set. Emacs expects that, e.g., in files.el:cd-absolute.
3194
22bae83f
EZ
3195 * w32proc.c (create_child): Don't clip the PID of the child
3196 process to fit into an Emacs integer, as this is no longer a
3197 restriction.
3198 (waitpid): Rename from sys_wait. Emulate a Posix 'waitpid' by
3199 reaping only the process specified by PID argument, if that is
3200 positive. Use PID instead of dead_child to know which process to
3201 reap. Wait for the child to die only if WNOHANG is not in
3202 OPTIONS.
3203 (sys_select): Don't set dead_child.
3204
3205 * sysdep.c (wait_for_termination_1): Remove the WINDOWSNT portion,
3206 as it is no longer needed.
3207
3208 * process.c (waitpid, WUNTRACED) [!WNOHANG]: Remove definitions,
3209 no longer needed.
3210 (record_child_status_change): Remove the setting of
3211 record_at_most_one_child for the !WNOHANG case.
3212
a631d0e0
PE
32132012-11-17 Paul Eggert <eggert@cs.ucla.edu>
3214
3215 Fix problems in ns port found by static checking.
3216 * nsterm.m: Include <pthread.h>, for pthread_mutex_lock etc.
3217 (hold_event, setPosition:portion:whole:): Send SIGIO only to self,
3218 not to process group.
3219 (ns_select): Use emacs_write, not write, as that's more robust
3220 in the presence of signals.
3221 (fd_handler:): Check for read errors.
3222
d56f2e49
GM
32232012-11-16 Glenn Morris <rgm@gnu.org>
3224
3225 * editfns.c (Fmessage): Mention message-log-max. (Bug#12849)
3226
96e05507 32272012-11-16 Stefan Monnier <monnier@iro.umontreal.ca>
5c2a7148
SM
3228
3229 * eval.c (Finteractive_p): Revert lexbind-merge mishap.
3230
96e05507 32312012-11-16 Eli Zaretskii <eliz@gnu.org>
730b2d8f
EZ
3232
3233 * w32proc.c (timer_loop): Make sure SuspendThread and ResumeThread
3234 use the same value of thread handle.
3235 (start_timer_thread): If the timer thread exited (due to error),
3236 clean up by closing the two handles it used. Duplicate the caller
3237 thread's handle here, so it gets duplicated only once, when
3238 launching the timer thread. Set priority of the timer thread, not
3239 the caller thread.
3240 (getitimer): Don't duplicate the caller thread's handle here.
3241 (Bug#12832)
3242
96e05507 32432012-11-16 Jan Djärv <jan.h.d@swipnet.se>
f99c65e5
JD
3244
3245 * nsterm.m (hold_event): Send SIGIO to make sure ns_read_socket is
3246 called (Bug#12834).
3247
3d082a26
PE
32482012-11-16 Paul Eggert <eggert@cs.ucla.edu>
3249
3250 Remove no-longer-used pty_max_bytes variable.
3251 * process.c (pty_max_bytes): Remove; unused.
3252 (send_process): Do not set it.
3253
b72c161c
JB
32542012-11-15 Juanma Barranquero <lekktu@gmail.com>
3255
3256 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/emacs.$(O)):
3257 Update dependencies.
3258
bf20ea80
PE
32592012-11-15 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 * eval.c (mark_backtrace) [BYTE_MARK_STACK]: Remove stray '*'.
3262 This follows up on the 2012-09-29 patch that removed indirection
3263 for the 'function' field. Reported by Sergey Vinokurov in
3264 <http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00263.html>.
3265
14f20728
EZ
32662012-11-14 Eli Zaretskii <eliz@gnu.org>
3267
3268 * w32.c (faccessat): Rename from sys_faccessat. (No need to use a
3269 different name, as the MS runtime does not have such a function,
3270 and probably never will.) All callers changed. Ignore DIRFD
3271 value if PATH is an absolute file name, to match Posix spec
3272 better. If AT_SYMLINK_NOFOLLOW is set in FLAGS, don't resolve
3273 symlinks.
3274
77731919
DA
32752012-11-14 Dmitry Antipov <dmantipov@yandex.ru>
3276
3277 * xdisp.c (echo_area_display, redisplay_internal):
3278 Omit redundant check whether frame_garbaged is set.
3279
73dcdb9f
PE
32802012-11-14 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 Use faccessat, not access, when checking file permissions (Bug#12632).
3283 This fixes a bug that has been present in Emacs since its creation.
3284 It was reported by Chris Torek in 1983 even before GNU Emacs existed,
3285 which must set some sort of record. (Torek's bug report was against
3286 a predecessor of GNU Emacs, but GNU Emacs happened to have the
3287 same common flaw.) See Torek's Usenet posting
3288 "setuid/setgid programs & Emacs" Article-I.D.: sri-arpa.858
3289 Posted: Fri Apr 8 14:18:56 1983.
3290 * Makefile.in (LIB_EACCESS): New macro.
3291 (LIBES): Use it.
3292 * callproc.c (init_callproc):
3293 * charset.c (init_charset):
3294 * fileio.c (check_existing, check_executable, check_writable)
3295 (Ffile_readable_p):
3296 * lread.c (openp, load_path_check):
3297 * process.c (allocate_pty):
3298 * xrdb.c (file_p):
3299 Use effective UID when checking permissions, not real UID.
3300 * callproc.c (init_callproc):
3301 * charset.c (init_charset):
3302 * lread.c (load_path_check, init_lread):
3303 Test whether directories are accessible, not merely whether they exist.
3304 * conf_post.h (GNULIB_SUPPORT_ONLY_AT_FDCWD): New macro.
3305 * fileio.c (check_existing, check_executable, check_writable)
3306 (Ffile_readable_p):
3307 Use symbolic names instead of integers for the flags, as they're
3308 portable now.
3309 (check_writable): New arg AMODE. All uses changed.
3310 Set errno on failure.
3311 (Ffile_readable_p): Use faccessat, not stat + open + close.
3312 (Ffile_writable_p): No need to call check_existing + check_writable.
3313 Just call check_writable and then look at errno. This saves a syscall.
3314 dir should never be nil; replace an unnecessary runtime check
3315 with an eassert. When checking the parent directory of a nonexistent
3316 file, check that the directory is searchable as well as writable, as
3317 we can't create files in unsearchable directories.
3318 (file_directory_p): New function, which uses 'stat' on most platforms
3319 but faccessat with D_OK (for efficiency) if WINDOWSNT.
3320 (Ffile_directory_p, Fset_file_times): Use it.
3321 (file_accessible_directory_p): New function, which uses a single
3322 syscall for efficiency.
3323 (Ffile_accessible_directory_p): Use it.
3324 * xrdb.c (file_p): Use file_directory_p.
3325 * lisp.h (file_directory_p, file_accessible_directory_p): New decls.
3326 * lread.c (openp): When opening a file, use fstat rather than
3327 stat, as that avoids a permissions race. When not opening a file,
3328 use file_directory_p rather than stat.
3329 (dir_warning): First arg is now a usage string, not a format.
3330 Use errno. All uses changed.
3331 * nsterm.m (ns_term_init): Remove unnecessary call to file-readable
3332 that merely introduced a race.
3333 * process.c, sysdep.c, term.c: All uses of '#ifdef O_NONBLOCK'
3334 changed to '#if O_NONBLOCK', to accommodate gnulib O_* style,
3335 and similarly for the other O_* flags.
3336 * w32.c (sys_faccessat): Rename from sys_access and switch to
3337 faccessat's API. All uses changed.
3338 * xrdb.c: Do not include <sys/stat.h>; no longer needed.
3339 (magic_db): Rename from magic_file_p.
3340 (magic_db, search_magic_path): Return an XrmDatabase rather than a
3341 char *, so that we don't have to test for file existence
3342 separately from opening the file for reading. This removes a race
3343 fixes a permission-checking problem, and simplifies the code.
3344 All uses changed.
3345 (file_p): Remove; no longer needed.
3346
2a14f83b
DA
33472012-11-13 Dmitry Antipov <dmantipov@yandex.ru>
3348
3349 Omit glyphs initialization at startup.
3350 * dispnew.c (glyphs_initialized_initially_p): Remove.
3351 (adjust_frame_glyphs_initially): Likewise. Adjust users.
3352 (Fredraw_frame): Move actual code from here...
c7085245 3353 (redraw_frame): ...to here. Add eassert. Adjust comment.
2a14f83b
DA
3354 (Fredraw_display): Use redraw_frame.
3355 * xdisp.c (clear_garbaged_frames): Likewise.
3356
f78ee6af 33572012-11-13 Eli Zaretskii <eliz@gnu.org>
32520273
EZ
3358
3359 * xdisp.c (decode_mode_spec): Limit the value of WIDTH argument
3360 passed to pint2str and pint2hrstr to be at most the size of the
3361 frame's decode_mode_spec_buffer. This avoids crashes with very
3362 large values of FIELD_WIDTH argument to decode_mode_spec.
3363 (Bug#12867)
3364
b95a9c0c
PE
33652012-11-13 Paul Eggert <eggert@cs.ucla.edu>
3366
3367 Fix a race with verify-visited-file-modtime (Bug#12863).
3368 Since at least 1991 Emacs has ignored an mtime difference of no
3369 more than one second, but my guess is that this was to work around
3370 file system bugs that were fixed long ago. Since the race is
3371 causing problems now, let's remove that code.
3372 * fileio.c (Fverify_visited_file_modtime): Do not accept a file
3373 whose time stamp is off by no more than a second. Insist that the
3374 file time stamps match exactly.
3375
be49ba74
DA
33762012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3377
3378 * frame.h (struct frame): Convert external_tool_bar member to
3379 1-bit unsigned bitfield.
3380 * termhooks.h (struct terminal): Remove mouse_moved member since
3381 all users are long dead. Adjust comment on mouse_position_hook.
3382
5b04e9f9
DA
33832012-11-12 Dmitry Antipov <dmantipov@yandex.ru>
3384
3385 Simplify by using FOR_EACH_FRAME here and there.
3386 * frame.c (next_frame, prev_frame, other_visible_frames)
3387 (delete_frame, visible-frame-list): Use FOR_EACH_FRAME.
3388 * w32term.c (x_window_to_scroll_bar): Likewise.
3389 * window.c (window_list): Likewise.
3390 * xdisp.c (x_consider_frame_title): Likewise.
3391 * xfaces.c ( Fdisplay_supports_face_attributes_p): Likewise.
3392 * xfns.c (x_window_to_frame, x_any_window_to_frame)
3393 (x_menubar_window_to_frame, x_top_window_to_frame): Likewise.
3394 * xmenu.c (menubar_id_to_frame): Likewise.
3395 * xselect.c (frame_for_x_selection): Likewise.
3396 * xterm.c (x_frame_of_widget, x_window_to_scroll_bar)
3397 (x_window_to_menu_bar): Likewise.
3398 * w32fns.c (x_window_to_frame): Likewise. Adjust comment.
3399
76ae24d7
PE
34002012-11-12 Paul Eggert <eggert@cs.ucla.edu>
3401
12cc4337
PE
3402 * data.c (Qdefalias_fset_function): Now static.
3403
76ae24d7
PE
3404 Another tweak to vectorlike_header change.
3405 * alloc.c (struct Lisp_Vectorlike_Free, NEXT_IN_FREE_LIST):
3406 Remove, and replace all uses with ...
3407 (next_in_free_list, set_next_in_free_list):
3408 New functions, which respect C's aliasing rules better.
3409
1479c557
PE
34102012-11-11 Paul Eggert <eggert@cs.ucla.edu>
3411
3412 * window.c (list4i): Rename from 'quad'. All uses changed.
3413 Needed because <sys/types.h> defines 'quad' on Solaris 10.
3414
11235c03
JB
34152012-11-11 Juanma Barranquero <lekktu@gmail.com>
3416
3417 * xdisp.c (start_hourglass) [HAVE_NTGUI]: Add block to silence
3418 warning about mixing declarations and code in ISO C90.
3419
6baf66d5 34202012-11-10 Martin Rudalics <rudalics@gmx.at>
fdaf534a
MR
3421
3422 * window.c (Fsplit_window_internal): Set combination limit of
3423 new parent window to t iff Vwindow_combination_limit is t;
3424 fixing a regression introduced with the change from 2012-09-22.
6baf66d5 3425 (Fset_window_combination_limit): Fix doc-string.
fdaf534a 3426
6baf66d5 34272012-11-10 Eli Zaretskii <eliz@gnu.org>
acf93bcf
EZ
3428
3429 * xdisp.c (try_scrolling): Fix correction of aggressive-scroll
3430 amount when the scroll margins are too large. When scrolling
3431 backwards in the buffer, give up if cannot reach point or the
23ba2705
SM
3432 scroll margin within a reasonable number of screen lines.
3433 Fixes point position in window under scroll-up/down-aggressively when
acf93bcf
EZ
3434 point is positioned many lines beyond the window top/bottom.
3435 (Bug#12811)
3436
508f51f5
EZ
3437 * ralloc.c (relinquish): If real_morecore fails to return memory
3438 to the system, don't crash; instead, leave the last heap
3439 unchanged and return. (Bug#12774)
3440
32e5c58c
SM
34412012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3442
3443 * lisp.h (AUTOLOADP): New macro.
3444 * eval.c (Fautoload): Don't attach to loadhist, call Fdefalias instead.
3445 * data.c (Ffset): Remove special ad-advice-info handling.
3446 (Fdefalias): Handle autoload definitions and new Qdefalias_fset_function.
3447 (Fsubr_arity): CSE.
3448 (Finteractive_form): Simplify.
3449 (Fquo): Don't insist on having at least 2 arguments.
3450 (Qdefalias_fset_function): New var.
3451
719b0aa5
JD
34522012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3453
4ab15c3e
JD
3454 * image.c (xpm_make_color_table_h): Change to hashtest_equal.
3455
719b0aa5
JD
3456 * nsfont.m (Qcondensed, Qexpanded): New variables.
3457 (ns_descriptor_to_entity): Restore Qcondensed, Qexpanded setting.
3458 (syms_of_nsfont): Defsym Qcondensed, Qexpanded.
3459
535cc8e9
DA
34602012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3461
3462 Fix recently introduced crash on MS-Windows (Bug#12839).
3463 * w32term.h (struct scroll_bar): Use convenient header.
3464 (SCROLL_BAR_VEC_SIZE): Remove.
3465 * w32term.c (x_scroll_bar_create): Use VECSIZE.
3466
7d377c48
DA
34672012-11-09 Dmitry Antipov <dmantipov@yandex.ru>
3468
3469 Tweak last vectorlike_header change.
3470 * alloc.c (struct Lisp_Vectorlike_Free): Special type to represent
3471 vectorlike object on the free list. This is introduced to avoid
3472 some (but not all) pointer casting and aliasing problems, see
3473 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00105.html.
3474 * .gdbinit (pvectype, pvecsize): New commands to examine vectorlike
3475 objects.
3476 (xvectype, xvecsize): Use them to examine Lisp_Object values.
3477
7ad27466
JD
34782012-11-09 Jan Djärv <jan.h.d@swipnet.se>
3479
32e5c58c 3480 * nsfont.m (ns_descriptor_to_entity): Qcondensed and Qexpanded has
7ad27466
JD
3481 been removed, so remove them here also.
3482
57618ecf
SM
34832012-11-09 Stefan Monnier <monnier@iro.umontreal.ca>
3484
3485 * doc.c (Fdocumentation): Handle new property
3486 dynamic-docstring-function to replace the old ad-advice-info.
3487
53371430
PE
34882012-11-09 Paul Eggert <eggert@cs.ucla.edu>
3489
3490 * fns.c (Qeql, hashtest_eq): Now static.
3491
61ddb1b9
SM
34922012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3493
3494 * lisp.h (XHASH): Redefine to be imperfect and fit in a Lisp int.
3495 * fns.c (hashfn_eq, hashfn_eql, sxhash):
3496 * profiler.c (hashfn_profiler): Don't use XUINT on non-integers.
3497 * buffer.c (compare_overlays): Use XLI rather than XHASH.
3498
04a2d0d3
PE
34992012-11-08 Paul Eggert <eggert@cs.ucla.edu>
3500
3501 Use same hash function for hashfn_profiler as for hash_string etc.
3502 * fns.c (SXHASH_COMBINE): Remove. All uses replaced by sxhash_combine.
3503 * lisp.h (sxhash_combine): New inline function, with the contents
3504 of the old SXHASH_COMBINE.
3505 * profiler.c (hashfn_profiler): Use it, instead of having a
3506 special hash function containing a comparison that always yields 1.
3507
de5ef41a
SM
35082012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3509
3510 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic)
3511 (Qultra_condensed, Qextra_condensed, Qcondensed, Qsemi_condensed)
3512 (Qsemi_expanded, Qextra_expanded, Qexpanded, Qultra_expanded):
3513 Remove unused vars.
3514
a23c4171
JD
35152012-11-08 Jan Djärv <jan.h.d@swipnet.se>
3516
3517 * image.c (xpm_make_color_table_h): Fix compiler error because
3518 make_hash_table changed.
3519
0b59090b 35202012-11-08 Thomas Kappler <tkappler@gmail.com> (tiny change)
074d7bb0
JD
3521
3522 * nsfont.m (ns_findfonts): Handle empty matchingDescs (Bug#11541).
3523
b7432bb2
SM
35242012-11-08 Stefan Monnier <monnier@iro.umontreal.ca>
3525
3526 Use ad-hoc comparison function for the profiler's hash-tables.
3527 * profiler.c (Qprofiler_backtrace_equal, hashtest_profiler): New vars.
3528 (make_log): Use them.
3529 (handle_profiler_signal): Don't inhibit quit any longer since we don't
3530 call Fequal any more.
3531 (Ffunction_equal): New function.
3532 (cmpfn_profiler, hashfn_profiler): New functions.
3533 (syms_of_profiler): Initialize them.
3534 * lisp.h (struct hash_table_test): New struct.
3535 (struct Lisp_Hash_Table): Use it.
3536 * alloc.c (mark_object): Mark hash_table_test fields of hash tables.
3537 * fns.c (make_hash_table): Take a struct to describe the test.
3538 (cmpfn_eql, cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
3539 (hashfn_equal, hashfn_user_defined): Adjust to new calling convention.
3540 (hash_lookup, hash_remove_from_table): Move assertion checking of
3541 hashfn result here. Check hash-equality before calling cmpfn.
3542 (Fmake_hash_table): Adjust call to make_hash_table.
3543 (hashtest_eq, hashtest_eql, hashtest_equal): New structs.
3544 (syms_of_fns): Initialize them.
3545 * emacs.c (main): Move syms_of_fns earlier.
3546 * xterm.c (syms_of_xterm):
3547 * category.c (hash_get_category_set): Adjust call to make_hash_table.
3548 * print.c (print_object): Adjust to new hash-table struct.
3549 * composite.c (composition_gstring_put_cache): Adjust to new hashfn.
3550
88002743
EZ
35512012-11-08 Eli Zaretskii <eliz@gnu.org>
3552
3553 * w32fns.c (modifier_set): Fix handling of Scroll Lock when the
3554 value of w32-scroll-lock-modifier is neither nil nor one of the
3555 known key modifiers. (Bug#12806)
3556
914adc42
DA
35572012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3558
3559 Shrink struct vectorlike_header to the only size field.
3560 * lisp.h (enum pvec_type): Avoid explicit enum member values.
3561 Adjust comment.
3562 (enum More_Lisp_Bits): Change PSEUDOVECTOR_SIZE_BITS and
3563 PVEC_TYPE_MASK to arrange new bitfield in the vector header.
3564 (PSEUDOVECTOR_REST_BITS, PSEUDOVECTOR_REST_MASK): New members.
3565 (PSEUDOVECTOR_AREA_BITS): New member used to extract subtype
3566 information from the vector header. Adjust comment.
3567 (XSETPVECTYPE, XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR)
3568 (PSEUDOVECTOR_TYPEP, DEFUN): Adjust to match new vector header
3569 layout.
3570 (XSETSUBR, SUBRP): Adjust to match new Lisp_Subr layout.
3571 (struct vectorlike_header): Remove next member. Adjust comment.
3572 (struct Lisp_Subr): Add convenient header. Adjust comment.
3573 (allocate_pseudovector): Adjust prototype.
3574 * alloc.c (mark_glyph_matrix, mark_face_cache, allocate_string)
3575 (sweep_string, lisp_malloc): Remove useless prototypes.
3576 (enum mem_type): Adjust comment.
3577 (NEXT_IN_FREE_LIST): New macro.
3578 (SETUP_ON_FREE_LIST): Adjust XSETPVECTYPESIZE usage.
3579 (Fmake_bool_vector): Likewise.
3580 (struct large_vector): New type to represent allocation unit for
3581 the vectors with the memory footprint more than VBLOOCK_BYTES_MAX.
3582 (large_vectors): Change type to struct large_vector.
3583 (allocate_vector_from_block): Simplify.
3584 (PSEUDOVECTOR_NBYTES): Replace with...
3585 (vector_nbytes): ...new function. Adjust users.
3586 (sweep_vectors): Adjust processing of large vectors.
3587 (allocate_vectorlike): Likewise.
3588 (allocate_pseudovector): Change type of 3rd arg to enum pvec_type.
3589 Add easserts. Adjust XSETPVECTYPESIZE usage.
3590 (allocate_buffer): Use BUFFER_PVEC_INIT.
3591 (live_vector_p): Adjust to match large vector.
3592 * buffer.c (init_buffer_once): Use BUFFER_PVEC_INIT.
3593 * buffer.h (struct buffer): Add next member.
3594 (BUFFER_LISP_SIZE, BUFFER_REST_SIZE, BUFFER_PVEC_INIT):
3595 New macros.
3596 (FOR_EACH_BUFFER): Adjust to match struct buffer change.
3597 * fns.c (internal_equal): Adjust to match enum pvec_type change.
3598 (copy_hash_table): Adjust to match vector header change.
3599 * lread.c (defsubr): Use XSETPVECTYPE.
3600 * .gdbinit (xpr, xbacktrace): Adjust to match vector header change.
3601 (xvectype): Likewise. Print PVEC_NORMAL_VECTOR for regular vectors.
3602 (xvecsize): New command.
3603
c66f21ea
DA
36042012-11-08 Dmitry Antipov <dmantipov@yandex.ru>
3605
3606 * keyboard.c (event_to_kboard): Do not dereference
3607 frame_or_window field of SELECTION_REQUEST_EVENT
3608 and SELECTION_CLEAR_EVENT events (Bug#12814).
3609 * xterm.h (struct selection_input_event): Adjust comment.
3610
eb147960
EZ
36112012-11-07 Eli Zaretskii <eliz@gnu.org>
3612
dab72075
EZ
3613 * w32fns.c (modifier_set): Don't report modifiers from toggle key,
3614 such as Scroll Lock, if the respective keys are treated as
3615 function keys, not as modifiers. This avoids destroying non-ASCII
6b064c16 3616 keyboard input when Scroll Lock is toggled ON. (Bug#12806)
eb147960 3617
5890e400
DA
36182012-11-07 Dmitry Antipov <dmantipov@yandex.ru>
3619
3620 * xfns.c (Fx_wm_set_size_hint): Use check_x_frame. Adjust docstring.
3621
b6b3b294
PE
36222012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3623
3624 Restore some duplicate definitions (Bug#12814).
3625 This undoes part of the 2012-11-03 changes. Some people build
3626 with plain -g rather than with -g3, and they need the duplicate
3627 definitions for .gdbinit to work; see <http://bugs.gnu.org/12814#26>.
3628 * lisp.h (GCTYPEBITS, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK):
3629 Define as macros, as well as as enums or as constants.
3630
e770aad5
JD
36312012-11-06 Jan Djärv <jan.h.d@swipnet.se>
3632
3633 * nsterm.m (convert_ns_to_X_keysym, keyDown:): Add NSNumericPadKeyMask
3634 to keypad keys (Bug#12816).
3635
68f8f1c0
PE
36362012-11-06 Paul Eggert <eggert@cs.ucla.edu>
3637
3638 Minor adjustments of recently-changed frame functions.
3639 * buffer.c (Fbuffer_list): Omit CHECK_FRAME, since arg is already
3640 known to be a frame (we're in the FRAMEP branch).
3641 * lisp.h (Qframep): Remove decl. frame.h declares this.
3642 * window.c (quad): Args are of type EMACS_INT, not ptrdiff_t,
3643 since they're meant for Lisp fixnum values.
3644
72f94d4b
DA
36452012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3646
3647 * window.c (Fwindow_combination_limit): Revert to the only
3648 required argument and adjust docstring as suggested in
3649 http://lists.gnu.org/archive/html/emacs-diffs/2012-11/msg01082.html
3650 by Martin Rudalics <rudalics@gmx.at>.
3651
d9f07150
DA
36522012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3653
3654 Widely used frame validity and checking functions.
3655 * frame.h (decode_live_frame, decode_any_frame): Add prototypes.
3656 * frame.c (decode_live_frame, decode_any_frame): New functions.
3657 (delete_frame, Fredirect_frame_focus, Fframe_parameters)
3658 (Fframe_parameter, Fframe_char_height, Fframe_char_width)
3659 (Fframe_pixel_height, Fframe_pixel_width, Ftool_bar_pixel_width)
3660 (Fframe_pointer_visible_p): Use decode_any_frame.
3661 (Fmake_frame_visible, Fmake_frame_invisible, Ficonify_frame)
3662 (Fraise_frame, Flower_frame, Fmodify_frame_parameters)
3663 (Fset_frame_height, Fset_frame_width): Use decode_live_frame.
3664 (Fframe_focus): Likewise. Allow zero number of arguments.
3665 Adjust docstring.
3666 (frame_buffer_list, frame_buffer_predicate): Remove.
3667 * lisp.h (frame_buffer_predicate): Remove prototype.
3668 * buffer.c (Fother_buffer): Use decode_any_frame.
3669 * xdisp.c (Ftool_bar_lines_needed): Likewise.
3670 * xfaces.c (Fcolor_gray_p, Fcolor_supported_p): Likewise.
3671 * font.c (Ffont_face_attributes, Ffont_family_list, Fopen_font)
3672 (Fclose_font, Ffont_info): Use decode_live_frame.
3673 * fontset.c (check_fontset_name): Likewise.
3674 * terminal.c (Fframe_terminal): Likewise.
3675 * w32fns.c (check_x_frame): Likewise.
3676 * window.c (Fminibuffer_window, Fwindow_at)
3677 (Fcurrent_window_configuration): Likewise.
3678 (Frun_window_configuration_change_hook, Fwindow_resize_apply):
3679 Likewise. Allow zero number of arguments. Adjust docstring.
3680 * dispnew.c (Fredraw_frame): Likewise.
3681 * xfaces.c (frame_or_selected_frame): Remove.
3682 (Fx_list_fonts, Finternal_get_lisp_face_attribute, Fface_font)
3683 (Finternal_lisp_face_equal_p, Finternal_lisp_face_empty_p)
3684 (Fframe_face_alist): Use decode_live_frame.
3685 * xfns.c (check_x_frame): Likewise.
3686
89bc0592
DA
36872012-11-06 Dmitry Antipov <dmantipov@yandex.ru>
3688
3689 * window.c (quad): New function.
3690 (Fwindow_edges, Fwindow_pixel_edges, Fwindow_inside_edges)
3691 (Fwindow_absolute_pixel_edges, Fwindow_inside_absolute_pixel_edges)
3692 (Fwindow_inside_pixel_edges, Fpos_visible_in_window_p)
3693 (Fwindow_line_height): Use it.
3694 (Fwindow_fringes): Use list3.
3695 (Fwindow_scroll_bars): Use list4.
3696 (Fwindow_frame, Fwindow_top_child, Fwindow_left_child)
3697 (Fwindow_combination_limit): Allow zero number of arguments.
3698
c8e3a9c3
EZ
36992012-11-05 Eli Zaretskii <eliz@gnu.org>
3700
3701 * makefile.w32-in ($(BLD)/w32fns.$(O)): Depend on $(NT_INC)/unistd.h.
3702
8e2417bf 3703 * w32fns.c: Include unistd.h, to avoid compiler warnings on Cygwin.
c8e3a9c3 3704 (emacs_abort) [CYGWIN]: Don't call _open_osfhandle; instead, use
ae600a8e 3705 file descriptor 2 for standard error. (Bug#12805)
c8e3a9c3 3706
209c6a58
CY
37072012-11-05 Chong Yidong <cyd@gnu.org>
3708
3709 * process.c (wait_reading_process_output): Revert previous change.
3710
8148369c
PE
37112012-11-05 Paul Eggert <eggert@cs.ucla.edu>
3712
dd0333b6
PE
3713 Assume at least POSIX.1-1988 for getpgrp, setpgid, setsid (Bug#12800).
3714 This removes code that has been obsolete since around 1990.
3715 * callproc.c (Fcall_process):
3716 * emacs.c (main):
3717 * process.c (create_process):
3718 * term.c (dissociate_if_controlling_tty):
3719 Assume setsid exists.
3720 * callproc.c (child_setup): Assume setpgid exists and behaves as
3721 per POSIX.1-1988 or later.
3722 * conf_post.h (setpgid) [!HAVE_SETPGID]: Remove.
3723 * emacs.c (shut_down_emacs):
3724 * sysdep.c (sys_suspend, init_foreground_group):
3725 Assume getpgrp behaves as per POSIX.1-1998 or later.
3726 * msdos.c (setpgrp): Remove.
3727 (tcgetpgrp, setpgid, setsid): New functions.
3728 * systty.h (EMACS_GETPGRP): Remove. All callers now use getpgrp.
3729 * term.c (no_controlling_tty): Remove; unused.
3730 * w32proc.c (setpgrp): Remove.
3731 (setsid, tcgetpgrp): New functions.
3732
8148369c
PE
3733 Simplify by assuming __fpending.
3734 * dispnew.c: Include <fpending.h>, not <stdio_ext.h>.
3735 (update_frame_1): Use __fpending, not PENDING_OUTPUT_COUNT.
3736 Do not assume that __fpending's result fits in int.
3737
76abf5e5
PE
37382012-11-04 Paul Eggert <eggert@cs.ucla.edu>
3739
06b63c9b
PE
3740 Remove EMACS_OUTQSIZE+sleep hack.
3741 * dispnew.c (update_frame_1): Remove hack for terminals slower
de5ef41a
SM
3742 than 2400 bps, which throttled Emacs by having it sleep.
3743 This code hasn't worked since at least 2007, when the multi-tty stuff
06b63c9b
PE
3744 was added, and anyway those old terminals are long dead.
3745 * systty.h (EMACS_OUTQSIZE): Remove; unused. The macro isn't used even
3746 without the dispnew.c change, as dispnew.c doesn't include systty.h.
3747
76abf5e5
PE
3748 Fix data-loss with --version (Bug#9574).
3749 * emacs.c (close_output_streams): Use strerror, not emacs_strerror,
3750 as we can't assume that emacs_strerror is initialized, and strerror
3751 is good enough here.
3752 (main): Invoke atexit earlier, to catch earlier instances of
3753 sending data to stdout and exiting, e.g., "emacs --version >/dev/full".
3754
8f31e74b
MM
37552012-11-04 Michael Marchionna <tralfaz@pacbell.net>
3756
3757 * nsterm.m: Add NSClearLineFunctionKey and keypad keys (Bug#8680).
3758 (keyDown): Remap keypad keys to X11 virtual key codes.
3759
0d879dca
PE
37602012-11-03 Paul Eggert <eggert@cs.ucla.edu>
3761
7ccfb720
PE
3762 Fix data-loss with --batch (Bug#9574).
3763 * emacs.c: Include <close-stream.h>.
3764 (close_output_streams): New function.
3765 (main): Pass it to atexit, so that Emacs closes stdout and stderr
3766 and handles errors appropriately.
3767 (Fkill_emacs): Don't worry about flushing, as close_output_stream
3768 does that now.
3769
0b3d4a47
PE
3770 Fix a race condition that causes Emacs to mess up glib (Bug#8855).
3771 The symptom is a diagnostic "GLib-WARNING **: In call to
3772 g_spawn_sync(), exit status of a child process was requested but
3773 SIGCHLD action was set to SIG_IGN and ECHILD was received by
3774 waitpid(), so exit status can't be returned." The diagnostic
3775 is partly wrong, as the SIGCHLD action is not set to SIG_IGN.
3776 The real bug is a race condition between Emacs and glib: Emacs
3777 does a waitpid (-1, ...) and reaps glib's subprocess by mistake,
3778 so that glib can't find it. Work around the bug by invoking
3779 waitpid only on subprocesses that Emacs itself creates.
3780 * process.c (create_process, record_child_status_change):
3781 Don't use special value -1 in pid field, as the caller now must
de5ef41a
SM
3782 know the pid rather than having the callee infer it.
3783 The inference was sometimes incorrect anyway, due to another race.
0b3d4a47
PE
3784 (create_process): Set new 'alive' member if child is created.
3785 (process_status_retrieved): New function.
3786 (record_child_status_change): Use it.
3787 Accept negative 1st argument, which means to wait for the
3788 processes that Emacs already knows about. Move special-case code
3789 for DOS_NT (which lacks WNOHANG) here, from caller. Keep track of
3790 processes that have already been waited for, by testing and
3791 clearing new 'alive' member.
3792 (CAN_HANDLE_MULTIPLE_CHILDREN): Remove, as record_child_status_change
3793 now does this internally.
3794 (handle_child_signal): Let record_child_status_change do all
3795 the work, since we do not want to reap all exited child processes,
3796 only the child processes that Emacs itself created.
3797 * process.h (Lisp_Process): New boolean member 'alive'.
3798
0d879dca
PE
3799 Omit duplicate definitions no longer needed with gcc -g3.
3800 * lisp.h (GCTYPEBITS, GCALIGNMENT, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG)
3801 (VALMASK, MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM):
3802 Define only as macros. There's no longer any need to also define
3803 these symbols as enums or as constants, since we now assume
3804 gcc -g3 when debugging.
3805
3478f4b5
EZ
38062012-11-03 Eli Zaretskii <eliz@gnu.org>
3807
3808 * lisp.mk: Adjust comments to the fact that term/internal is now
3809 loaded from loadup.el.
3810
3811 * msdos.c (msdos_abort): Rename from emacs_abort, and make static.
3812 (msdos_fatal_signal): New function.
3813 (XMenuActivate): Adjust the call to kbd_buffer_events_waiting to
3814 its argument list.
3815
3816 * conf_post.h (_GL_EXECINFO_INLINE) [MSDOS]: Define to "inline"
3817 for GCC versions before 4.
3818 (emacs_raise): Define to call msdos_fatal_signal.
3819
3820 * xdisp.c (init_from_display_pos): Fix initialization of the bidi
3821 iterator when starting in the middle of a display or overlay
3822 string. (Bug#12745)
3823
85fabcb7
CY
38242012-11-03 Chong Yidong <cyd@gnu.org>
3825
3826 * process.c (wait_reading_process_output): Clean up the last
3827 change.
3828
893cc455
CY
38292012-11-03 Jim Paris <jim@jtan.com> (tiny change)
3830
3831 * process.c (wait_reading_process_output): Avoid a race condition
3832 with SIGIO delivery (Bug#11536).
3833
0f7b074f
CY
38342012-11-03 Chong Yidong <cyd@gnu.org>
3835
3836 * buffer.c (cursor_type): Untabify docstring.
3837
3737fee7
DA
38382012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3839
3840 * frame.h (struct frame): Drop can_have_scroll_bars member
3841 which is meaningless for a long time. Adjust comments.
3842 (FRAME_CAN_HAVE_SCROLL_BARS): Remove.
3843 * frame.c, nsfns.m, term.c, w32fns.c, xfns.c: Adjust users.
3844
b6a9e8b1
DA
38452012-11-03 Dmitry Antipov <dmantipov@yandex.ru>
3846
3847 * window.c (decode_next_window_args): Update window arg after
3848 calling decode_live_window and so fix crash reported at
3849 http://lists.gnu.org/archive/html/emacs-devel/2012-11/msg00035.html
3850 by Juanma Barranquero <lekktu@gmail.com>.
3851 (Fwindow_body_width, Fwindow_body_height): Simplify a bit.
3852 * font.c (Ffont_at): Likewise.
3853
600d4768
JD
38542012-11-01 Jan Djärv <jan.h.d@swipnet.se>
3855
3856 * widget.c (resize_cb): New function.
3857 (EmacsFrameRealize): Add resize_cb as event handler (Bug#12733).
3858 (EmacsFrameResize): Check if all is up to date before changing frame
3859 size.
3860
1005b4b9
EZ
38612012-11-02 Eli Zaretskii <eliz@gnu.org>
3862
3863 Implement backtrace output for fatal errors on MS-Windows.
3864 * w32fns.c (CaptureStackBackTrace_proc): New typedef.
3865 (BACKTRACE_LIMIT_MAX): New macro.
3866 (w32_backtrace): New function.
3867 (emacs_abort): Use w32_backtrace when the user chooses not to
3868 attach a debugger. Update the text of the abort dialog.
3869
b9e9df47
DA
38702012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3871
3872 Window-related stuff cleanup here and there.
3873 * dispnew.c (Finternal_show_cursor, Finternal_show_cursor_p):
3874 Use decode_any_window.
3875 * fringe.c (Ffringe_bitmaps_at_pos): Likewise.
3876 * xdisp.c (Fformat_mode_line): Likewise.
3877 * font.c (Ffont_at): Use decode_live_window.
3878 * indent.c (Fcompute_motion, Fvertical_motion): Likewise.
3879 * window.c (decode_next_window_args): Likewise.
3880 (decode_any_window): Remove static.
3881 * window.h (decode_any_window): Add prototype.
3882 * lisp.h (CHECK_VALID_WINDOW, CHECK_LIVE_WINDOW): Move from here...
3883 * window.h: ...to here, redefine via WINDOW_VALID_P and WINDOW_LIVE_P,
3884 respectively.
3885
2b371ff7
DA
38862012-11-02 Dmitry Antipov <dmantipov@yandex.ru>
3887
3888 Remove pad from struct input_event.
3889 * termhooks.h (struct input_event): Remove padding field.
3890 Adjust comment.
3891 * keyboard.c (event_to_kboard): Simplify because frame_or_window
3892 member is never cons for a long time. Adjust comment.
3893 (mark_kboards): Adjust because SELECTION_REQUEST_EVENT and
3894 SELECTION_CLEAR_EVENT has no Lisp_Objects to mark. Add comment.
3895 * xterm.c (handle_one_xevent): Do not initialize frame_or_window
3896 field of SELECTION_REQUEST_EVENT and SELECTION_CLEAR_EVENT.
3897
7e8b50d9
EZ
38982012-11-01 Eli Zaretskii <eliz@gnu.org>
3899
3900 * w32proc.c (getpgrp, setpgid): New functions. (Bug#12776)
3901
322aea6d
PE
39022012-10-31 Paul Eggert <eggert@cs.ucla.edu>
3903
3904 Fix crash when using Emacs as commit editor for git (Bug#12697).
3905 * callproc.c (setpgrp): Remove macro, as we now use setpgid
3906 and it is configured in conf_post.h.
3907 (Fcall_process): Don't invoke both setsid and setpgid; the former
3908 is enough, if it exists.
3909 * callproc.c (Fcall_process, child_setup):
3910 * process.c (create_process): Use setpgid.
3911 * conf_post.h (setpgid) [!HAVE_SETPGID]: New macro, which substitutes
3912 for the real thing.
3913 * dispnew.c (init_display): Initialize the foreground group
3914 if we are running a tty display.
3915 * emacs.c (main): Do not worry about setpgrp; init_display does it now.
3916 * lisp.h (init_foreground_group): New decl.
3917 * sysdep.c (inherited_pgroup): New static var.
3918 (init_foreground_group, tcsetpgrp_without_stopping)
3919 (narrow_foreground_group, widen_foreground_group): New functions.
3920 (init_sys_modes): Narrow foreground group.
3921 (reset_sys_modes): Widen foreground group.
3922
220cb2bd
MA
39232012-10-31 Michael Albinus <michael.albinus@gmx.de>
3924
3925 * dbusbind.c: Fix cut'n'waste error. Use HAVE_DBUS_VALIDATE_INTERFACE.
3926
218e997a
MR
39272012-10-31 Martin Rudalics <rudalics@gmx.at>
3928
3929 * minibuf.c (read_minibuf): Restore current buffer since
3930 choose_minibuf_frame calling Fset_frame_selected_window may
3931 change it (Bug#12766).
3932
02615da0
JD
39332012-10-30 Jan Djärv <jan.h.d@swipnet.se>
3934
3935 * frame.c (Fframe_pixel_height): Fix documentation (Bug#12733).
3936
aee5b18e
KH
39372012-10-30 Kenichi Handa <handa@gnu.org>
3938
3939 * font.c (Ffont_at): If WINDOW is specified and it is not
3940 displaying the current buffer, signal an error.
3941
ba116008
DC
39422012-10-29 Daniel Colascione <dancol@dancol.org>
3943
de5ef41a
SM
3944 * cygw32.h, cygw32.c (Qutf_16le, from_unicode, to_unicode):
3945 In preparation for fixing bug#12739, move these functions from
ba116008
DC
3946 here...
3947
3948 * coding.h, coding.c: ... to here, and compile them only when
53372c27
DC
3949 WINDOWSNT or CYGWIN. Moving these functions out of cygw32 proper
3950 lets us write cygw32-agnostic code for the HAVE_NTGUI case.
ba116008 3951
640bf8ad
EZ
39522012-10-28 Eli Zaretskii <eliz@gnu.org>
3953
3954 * w32proc.c (TIMER_TICKS_PER_SEC): New macro.
3955 (timer_loop, getitimer, setitimer): Use it instead of
3956 CLOCKS_PER_SEC, which is no longer pertinent, since we don't use
3957 'clock'.
3958 (w32_get_timer_time): Use 10*TIMER_TICKS_PER_SEC instead of a
3959 literal 10000.
3960
64ccff5f
JD
39612012-10-28 Jan Djärv <jan.h.d@swipnet.se>
3962
3963 * nsterm.m (NO_APPDEFINED_DATA): New define.
3964 (last_appdefined_event_data): New variable
3965 (last_appdefined_event): Remove.
3966 (ns_select): Initialize t from last_appdefined_event_data instead
3967 of [last_appdefined_event data1].
3968 (sendEvent:): Save [theEvent data1] to last_appdefined_event_data,
3969 remove last_appdefined_event (Bug#12698).
3970
e483264c
SM
39712012-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
3972
3973 * frame.c (x_set_font): Catch internal error.
3974
6c16c13e
EZ
39752012-10-27 Eli Zaretskii <eliz@gnu.org>
3976
e483264c
SM
3977 Avoid overflow in w32 implementation of interval timers.
3978 When possible, for ITIMER_PROF count only times the main thread
6c16c13e
EZ
3979 actually executes.
3980 * w32proc.c <struct itimer_data>: 'expire' and 'reload' are now
2e612797
EZ
3981 'volatile ULONGLONG' types. All the other data which was
3982 previously clock_t is now ULONGLONG. 'terminate' is 'volatile int'.
6c16c13e
EZ
3983 (GetThreadTimes_Proc): New typedef.
3984 (w32_get_timer_time): New function, returns a suitable time value
3985 for the timer.
3986 (timer_loop): Enter critical section when accessing ULONGLONG
3987 values of the itimer_data struct, as these accesses are no longer
e483264c
SM
3988 atomic. Call 'w32_get_timer_time' instead of 'clock'.
3989 Remove unused variable.
6c16c13e
EZ
3990 (init_timers): Initialize s_pfn_Get_Thread_Times.
3991 (start_timer_thread): Don't assign itimer->caller_thread here.
3992 (getitimer): Assign itimer->caller_thread here.
3993 (setitimer): Always call getitimer to get the value of ticks_now.
2f246cd3 3994 (sys_spawnve): Avoid compiler warning about format mismatch.
6c16c13e 3995
ccc83f50
EZ
39962012-10-26 Eli Zaretskii <eliz@gnu.org>
3997
3998 * w32fns.c (w32_wnd_proc) <WM_MOUSEMOVE>: Don't enable tracking of
3999 mouse movement events if the menu bar is active. This avoids
4000 producing a busy "hour-glass" cursor by Windows if the mouse
4001 pointer is positioned over a tooltip shown for some menu item.
4002
69deda53
PE
40032012-10-25 Paul Eggert <eggert@cs.ucla.edu>
4004
4005 Don't assume process IDs fit in int.
4006 * emacs.c (shut_down_emacs) [!DOS_NT]:
4007 * sysdep.c (sys_suspend) [SIGTSTP && !MSDOS]:
4008 * term.c (dissociate_if_controlling_tty) [!DOS_NT]:
4009 Use pid_t, not int, to store process IDs, as 'int'
4010 is not wide enough on a few platforms (e.g., AIX and IRIX).
4011
7e70a152
KH
40122012-10-23 Kenichi Handa <handa@gnu.org>
4013
4014 The following change is to make face-font-rescale-alist work
4015 correctly for non-ASCII fonts.
4016
4017 * font.c (font_open_entity): Don't handle Vface_font_rescale_alist.
4018 (font_open_for_lface): Handle Vface_font_rescale_alist.
4019
49238e7f
CY
40202012-10-23 Chong Yidong <cyd@gnu.org>
4021
4022 * xfaces.c (Vfont_list_limit): Move unused variable to faces.el.
4023
5ec86886
JD
40242012-10-21 Jan Djärv <jan.h.d@swipnet.se>
4025
ef446959
JD
4026 * nsfont.m (nsfont_open, ns_glyph_metrics): Force integer advancement
4027 for screen font.
4028 (nsfont_draw): Turn off LCD-smoothing (Bug#11484).
4029
5ec86886
JD
4030 * xterm.c (x_focus_changed): Check if daemonp when sending focus in
4031 event (Bug#12681).
4032
ee7a418d
GM
40332012-10-21 Glenn Morris <rgm@gnu.org>
4034
4035 * lisp.mk (lisp): Add cp51932.el and eucjp-ms.el.
4036
4973679b
PE
40372012-10-20 Paul Eggert <eggert@cs.ucla.edu>
4038
4039 Port to OpenBSD 5.1.
4040 * frame.c (Fmouse_position, Fmouse_pixel_position):
4041 * xdisp.c (produce_stretch_glyph):
4042 Declare local vars only when they're needed.
4043 This is clearer and avoids a warning on OpenBSD about unused vars.
4044 * frame.h (FRAME_WINDOW_P): Always evaluate its argument.
4045 This is safer, and avoids OpenBSD warnings about unused vars.
4046 * keyboard.c (record_menu_key): Remove unnecessary decl.
4047 (poll_timer): Define only if POLL_FOR_INPUT is defined.
4048 * unexelf.c (ELFSIZE) [!ElfW]: Do not define if already defined,
4049 as our definition clashes with OpenBSD's.
4050 * xfaces.c (load_face_colors, check_lface_attrs)
4051 (get_lface_attributes_no_remap, get_lface_attributes)
4052 (lface_fully_specified_p, x_supports_face_attributes_p)
4053 (tty_supports_face_attributes_p, face_fontset, realize_face)
4054 (realize_x_face, realize_tty_face):
4055 Declare parameters to be Lisp_Object[LFACE_VECTOR_SIZE], not
4056 merely Lisp_Object *. This is more informative and avoids
4057 a warning on OpenBSD about accessing beyond an object's size.
4058
c664f463
CY
40592012-10-20 Chong Yidong <cyd@gnu.org>
4060
4061 * lread.c (Fload): Doc fix (Bug#12592).
4062
6ec83f92 40632012-10-19 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
a0d7415f
KH
4064
4065 * font.c (Ffont_at): Fix previous change.
4066
d2824928
EZ
40672012-10-19 Eli Zaretskii <eliz@gnu.org>
4068
e483264c
SM
4069 * puresize.h (BASE_PURESIZE): Bump the base value to 1700000.
4070 See http://lists.gnu.org/archive/html/emacs-devel/2012-10/msg00593.html
c052c554
EZ
4071 for the reasons.
4072
d2824928
EZ
4073 * alloc.c (NSTATICS): Decrease to 0x800.
4074
f60d391f
SM
40752012-10-19 Stefan Monnier <monnier@iro.umontreal.ca>
4076
4a0e1924 4077 * fns.c (Fnreverse): Include the problem element when signaling an
f60d391f
SM
4078 error (bug#12677).
4079
1a9327d5
JD
40802012-10-18 Jan Djärv <jan.h.d@swipnet.se>
4081
4082 * nsterm.m (ns_select): Check writefds before call to
4083 FD_ISSET (Bug#12668).
4084
14145a1e
DC
40852012-10-18 Daniel Colascione <dancol@dancol.org>
4086
4087 * alloc.c (NSTATICS): Increase from 0x650 to 0x1000
4088 (staticpro): If we run out of staticpro slots, die with an
4089 informative error instead of just calling emacs_abort.
4090
1f76f6f5
MR
40912012-10-18 Martin Rudalics <rudalics@gmx.at>
4092
4093 Fix two flaws reported by Dmitry Antipov.
4094 * window.c (Ftemp_output_buffer_show): Remove.
4095 (Fwindow_vscroll, Fset_window_vscroll): Use decode_live_window.
4096 (syms_of_window): Remove defsubr for Stemp_output_buffer_show.
4097
fcf14875
EZ
40982012-10-17 Eli Zaretskii <eliz@gnu.org>
4099
1f76f6f5
MR
4100 * makefile.w32-in ($(BLD)/w32.$(O)):
4101 ($(BLD)/vm-limit.$(O)):
4102 ($(BLD)/term.$(O)):
4103 ($(BLD)/unexw32.$(O)):
4104 ($(BLD)/fileio.$(O)):
a68089e4
EZ
4105 ($(BLD)/dispnew.$(O)): Update dependencies.
4106
4107 * w32term.h (w32_initialize_display_info, initialize_w32_display):
4108 Add prototypes.
4109
4110 * w32proc.c: Include ctype.h.
4111
4112 * w32.h (init_environment, check_windows_init_file)
4113 (syms_of_ntproc, syms_of_ntterm, dostounix_filename)
4114 (unixtodos_filename, init_winsock, srandom, random, sys_pipe)
4115 (set_process_dir, sys_spawnve, register_child, sys_sleep, getwd)
4116 (sys_link): Add prototypes.
4117
4118 * w32.c: Include w32select.h.
4119 (sys_access, e_malloc, sys_select): Add prototypes.
4120 (emacs_gnutls_pull): 'timeout' is now EMACS_TIME, not struct timeval.
4121
4122 * vm-limit.c [WINDOWSNT]: Include w32heap.h.
4123
4124 * unexw32.c: Include lisp.h and w32.h.
4125
4126 * term.c [WINDOWSNT]: Include w32term.h.
4127
4128 * process.c [WINDOWSNT]: Add prototype of sys_select.
4129
4130 * fileio.c [WINDOWSNT]: Include w32.h.
4131
4132 * dispnew.c [WINDOWSNT]: Include w32.h.
4133
fcf14875
EZ
4134 * cygw32.c (Fcygwin_convert_path_to_windows)
4135 (Fcygwin_convert_path_from_windows): Use EQ to compare 2
4136 Lisp_Object values. (Bug#12661)
4137
4138 * w32fns.c (w32_msg_pump): Use XIL instead of casting an integer
4139 to Lisp_Object. (Bug#12661)
4140
fe0b1ec4
KH
41412012-10-17 Kenichi Handa <handa@gnu.org>
4142
4143 * xdisp.c (reseat_1): Make the information stored in it->cmp_it
4144 invalidate.
4145
d556ebf9
DA
41462012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4147
4148 * buffer.c (Fkill_buffer): When unchaining the marker,
1f9f395d 4149 reset its buffer pointer to NULL (Bug#12652).
d556ebf9 4150
f0863a54
DA
41512012-10-17 Dmitry Antipov <dmantipov@yandex.ru>
4152
4153 Do not verify indirection counters of killed buffers (Bug#12579).
4154 * buffer.h (BUFFER_CHECK_INDIRECTION): New macro.
4155 * buffer.c (compact_buffer, set_buffer_internal_1): Use it.
4156
12fbe755
DA
41572012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4158
4159 * alloc.c (Fmake_byte_code): Fix typo in comment.
4160 * print.c (print_interval): Define as static to match prototype.
4161 * indent.c (disptab_matches_widthtab, recompute_width_table):
4162 Convert to eassert.
4163
61655b89
DA
41642012-10-16 Dmitry Antipov <dmantipov@yandex.ru>
4165
4166 * editfns.c (get_system_name): Remove.
4167 * lisp.h (get_system_name): Remove prototype.
4168 * xrdb.c (getenv, getpwuid, getpwnam): Remove prototypes.
4169 (get_environ_db): Use Vsystem_name. Avoid call to strlen.
4170
9520f2f2
DC
41712012-10-15 Daniel Colascione <dancol@dancol.org>
4172
4173 * dbusbind.c: Add comment explaining reason for previous change.
4174
dca778d5
MR
41752012-10-15 Martin Rudalics <rudalics@gmx.at>
4176
4177 * window.c (Fwindow_end): Rewrite check whether cached position
4178 can be used (Bug#12600).
4179 (resize_frame_windows, grow_mini_window, shrink_mini_window):
4180 Set windows_or_buffers_changed.
4181
3e0341b0
DC
41822012-10-15 Daniel Colascione <dancol@dancol.org>
4183
4184 * dbusbind.c: Fix cygw32 build break when compiling with dbus
4185 enabled by undefining the symbol "interface", which the platform
4186 headers define to something incompatible.
4187
33d4113c
DC
41882012-10-14 Daniel Colascione <dancol@dancol.org>
4189
4190 * image.c (init_tiff_functions, init_imagemagick_functions)
4191 (init_svg_functions): Fix cygw32 build break by using these
4192 functions only when WINDOWSNT _and_ HAVE_NTGUI.
4193
a36fb15e
JD
41942012-10-14 Jan Djärv <jan.h.d@swipnet.se>
4195
4196 * nsterm.m (ns_select): Count fd:s in writefs also (Bug#12422).
4197
537f336d
JD
41982012-10-13 Jan Djärv <jan.h.d@swipnet.se>
4199
4200 * gtkutil.c (xg_set_widget_bg): Divide by 65535 (Bug#12612).
4201
0ba06a77
KH
42022012-10-13 HANATAKA, Shinya <bogytech@gmail.com> (tiny change)
4203
4204 * coding.c (detect_coding): Set coding->id before calling
4205 this->detector.
4206
ce2fe65a
AS
42072012-10-13 Andreas Schwab <schwab@linux-m68k.org>
4208
4209 * fileio.c: Formatting fixes.
4210
d6453ce4
PE
42112012-10-13 Paul Eggert <eggert@cs.ucla.edu>
4212
4213 Fix some stat-related races.
4214 * fileio.c (Fwrite_region): Avoid race condition if a file is
4215 removed or renamed by some other process immediately after Emacs
4216 writes it but before Emacs stats it. Do not assume that stat (or
4217 fstat) succeeds.
4218 * image.c (slurp_file): Resolve the file name with fopen + fstat
4219 rather than stat + fopen.
4220 (pbm_read_file) [0]: Remove unused code with stat race.
4221 * process.c (allocate_pty) [HAVE_PTYS && !PTY_ITERATION && !PTY_OPEN]:
4222 Remove ineffective code with stat race.
4223
06485aa8
SM
42242012-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
4225
4226 * doc.c (get_doc_string): Don't signal an error if the file is missing.
4227
167e3640
JD
42282012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4229
4230 * nsterm.m (hold_event_q): New static variable.
4231 (EV_TRAILER, sendScrollEventAtLoc:fromEvent:): Call hold_event if
4232 ! q_event_ptr.
4233 (hold_event): New function.
4234 (ns_read_socket): If hold_event_q have events, store them and
4235 return (Bug#12384).
4236 (setPosition:portion:whole:): Send SIGIO to ourselves if apploopnr
4237 is zero (Bug#12384).
4238
c40239df
JB
42392012-10-12 Juanma Barranquero <lekktu@gmail.com>
4240
4241 * makefile.w32-in ($(BLD)/w32select.$(O)): Update dependencies.
4242
bb385a92
EZ
42432012-10-12 Eli Zaretskii <eliz@gnu.org>
4244
2a9f1099
EZ
4245 * makefile.w32-in ($(BLD)/fileio.$(O)): Add sys/file.h.
4246
bb385a92
EZ
4247 * fileio.c (check_existing): New function.
4248 (make_temp_name, Ffile_exists_p, Ffile_writable_p): Call it
4249 instead of calling 'stat', when what's needed is to check whether
4250 a file exists. This avoids expensive system calls on MS-Windows.
4251 (Bug#12587)
4252
8599b23a 4253 * w32.c (init_environment): Call 'check_existing' instead of 'stat'.
bb385a92
EZ
4254
4255 * lread.c (openp) [WINDOWSNT]: Call 'access' instead of 'stat' to
4256 determine whether a file exists and is not a directory.
4257
4258 * lisp.h (check_existing): Add prototype.
4259
2b9c2e68
JD
42602012-10-12 Jan Djärv <jan.h.d@swipnet.se>
4261
4262 * nsfont.m (nsfont_open): Remove font cache, it is not GC correct.
4263
81749a23
GM
42642012-10-12 Glenn Morris <rgm@gnu.org>
4265
4266 * buffer.c (Fset_buffer): Doc fix. (Bug#12624)
4267
5253a5fd
SM
42682012-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
4269
389a94a5
SM
4270 * buffer.c (Fkill_buffer): Null out the overlay list(s) as well.
4271
5253a5fd
SM
4272 * eval.c (Fautoload): Remember previous autoload status in load-history.
4273
7cded46f
PE
42742012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4275
4276 lread.c, macros.c, marker.c, menu.c, minibuf.c: Use bool for booleans.
4277 * lread.c (load_each_byte, new_backquote_flag, readchar)
4278 (read_filtered_event, lisp_file_lexically_bound_p)
4279 (safe_to_load_version, Fload, complete_filename_p, openp)
4280 (build_load_history, readevalloop, read_escape, read1)
4281 (string_to_number, read_vector, read_list):
4282 * macros.c (Fstart_kbd_macro):
4283 * marker.c (CONSIDER):
4284 * menu.c (parse_single_submenu, digest_single_submenu)
4285 (find_and_return_menu_selection, Fx_popup_menu):
4286 * minibuf.c (read_minibuf_noninteractive, read_minibuf)
4287 (Ftry_completion):
4288 * nsmenu.m (ns_update_menubar, runMenuAt:forFrame:keymaps:):
4289 (ns_menu_show):
4290 * xmenu.c (set_frame_menubar, create_and_show_popup_menu)
4291 (xmenu_show, xdialog_show):
4292 Use bool for booleans.
4293 * lread.c (safe_to_load_version): Rename from safe_to_load_p,
4294 as it's not a predicate. All uses changed. Omit unnecessary
4295 buffer termination.
4296
549c3414
DA
42972012-10-11 Dmitry Antipov <dmantipov@yandex.ru>
4298
4299 * editfns.c (save_excursion_save): Use nil if mark points to nowhere.
4300 (save_excursion_restore): Do not restore mark if it was not saved.
4301
e85aafe7
PE
43022012-10-11 Paul Eggert <eggert@cs.ucla.edu>
4303
fd2f90cf
PE
4304 * marker.c (cached_modiff): EMACS_INT, not int.
4305
c1af190b
PE
4306 * w32select.c (waiting_for_input): Declare by including "keyboard.h"
4307 instead of having a wrong decl.
e85aafe7
PE
4308 * nsmenu.m (waiting_for_input): Remove wrong decl.
4309
e738ca56
PE
43102012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4311
9fa1de30
PE
4312 keyboard.c, keymap.c: Use bool for booleans.
4313 * dispnew.c (sit_for): Distinguish between 3-way display_option
4314 and boolean do_display.
4315 * keyboard.c (single_kboard, this_command_key_count_reset)
4316 (waiting_for_input, echoing, immediate_quit, input_pending)
4317 (interrupt_input, interrupts_deferred, pop_kboard)
4318 (temporarily_switch_to_single_kboard, ignore_mouse_drag_p)
4319 (command_loop_1, adjust_point_for_property)
4320 (safe_run_hooks_error, input_polling_used, read_char):
4321 (help_char_p, readable_events, kbd_buffer_events_waiting)
4322 (kbd_buffer_get_event, timer_check_2, make_lispy_event)
4323 (lucid_event_type_list_p, get_input_pending):
4324 (gobble_input, menu_separator_name_p, menu_bar_item)
4325 (parse_menu_item, parse_tool_bar_item, read_char_x_menu_prompt)
4326 (read_char_minibuf_menu_prompt, access_keymap_keyremap)
4327 (keyremap_step, test_undefined, read_key_sequence)
4328 (detect_input_pending, detect_input_pending_ignore_squeezables)
4329 (detect_input_pending_run_timers, requeued_events_pending_p)
4330 (quit_throw_to_read_char, Fset_input_interrupt_mode):
4331 * keymap.c (get_keymap, keymap_parent, keymap_memberp)
4332 (access_keymap_1, access_keymap, map_keymap, get_keyelt)
4333 (Fdefine_key, Flookup_key, struct accessible_keymaps_data)
4334 (accessible_keymaps_1, Fkey_description, push_key_description):
4335 (shadow_lookup, struct where_is_internal_data)
4336 (where_is_internal, Fwhere_is_internal, where_is_internal_1)
4337 (Fdescribe_buffer_bindings, describe_map_tree, struct describe_map_elt)
4338 (describe_map, describe_vector):
4339 * menu.c (single_menu_item):
4340 * nsmenu.m (ns_update_menubar):
4341 * process.c (wait_reading_process_output):
4342 * search.c (scan_buffer, scan_newline):
4343 Use bool for boolean.
4344 * keyboard.c (timers_run, swallow_events)
4345 (detect_input_pending_run_timers):
4346 * process.c (wait_reading_process_output):
4347 Use unsigned for counter where wraparound-on-overflow is desired,
4348 since unsigned is guaranteed to have that behavior and signed is not.
4349 (read_char): Use ptrdiff_t for string length.
4350 (get_input_pending): Remove first argument, since it was always
4351 the same pointer-to-int (now pointer-to-boolean) &input_pending,
4352 and behave as if it had that value. Return new value of
4353 input_pending. All callers changed.
4354 * keyboard.h (struct kboard): Use unsigned : 1 for boolean member
4355 immediate_echo. Use ptrdiff_t for echo_after_prompt, since it's
4356 a string length.
4357 * keymap.c (push_key_description): Omit last arg, which was always 1.
4358 All callers changed.
4359
e738ca56
PE
4360 * regex.c (immediate_quit) [emacs]: Remove duplicate decl.
4361
29f21cdf
JB
43622012-10-10 Juanma Barranquero <lekktu@gmail.com>
4363
4364 * makefile.w32-in ($(BLD)/dispnew.$(O), $(BLD)/indent.$(O))
4365 ($(BLD)/term.$(O)): Update dependencies.
4366
6aea7528
DA
43672012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4368
4369 * alloc.c (mark_object): Use meaningful PVEC_NORMAL_VECTOR.
4370 * lisp.h (enum pvec_type): Adjust comments and omit explicit
4371 initializer for PVEC_NORMAL_VECTOR.
4372
5f3f57be
PE
43732012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4374
4375 Clean out old termopts cruft.
4376 * termopts.h (flow_control, meta_key): Remove unused decls.
4377 * dispnew.c, indent.c, nsterm.m, term.c, xsettings.c, xsmfns.c:
4378 Don't include termopts.h.
4379
3e98c68e
DA
43802012-10-10 Dmitry Antipov <dmantipov@yandex.ru>
4381
4382 * alloc.c (gc_sweep): Use pointer-to-a-pointer loop for buffers.
4383
77e344e5
PE
43842012-10-10 Paul Eggert <eggert@cs.ucla.edu>
4385
4386 * commands.h (immediate_quit): Remove duplicate decl.
4387
5683d7cd
JD
43882012-10-09 Jan Djärv <jan.h.d@swipnet.se>
4389
4390 * nsfont.m (Vfonts_in_cache): Remove, not needed as font.c handles
4391 caching.
4392 (nsfont_open): Remove setting of Vfonts_in_cache.
1f9f395d 4393 (syms_of_nsfont): Remove initialization of Vfonts_in_cache.
5683d7cd 4394
cf5fc6db
EZ
43952012-10-09 Eli Zaretskii <eliz@gnu.org>
4396
b15736e6
EZ
4397 * w32fns.c (w32_last_error): Change the return value to DWORD, to
4398 match what GetLastError returns. Explain why the function is
4399 needed.
4400
cf5fc6db
EZ
4401 * frame.c (delete_frame): Rename local variable 'tooltip_frame' to
4402 'is_tooltip_frame', to avoid confusion with its global namesake.
4403
f99714ce
DC
44042012-10-08 Daniel Colascione <dancol@dancol.org>
4405
4406 * xdisp.c (start_hourglass): Call w32_note_current_window when
2b1f11ed
EZ
4407 HAVE_NTGUI, not just WINDOWSNT, resolving a problem in the cygw32
4408 build that caused Emacs to display the hourglass cursor forever.
f99714ce 4409
fd59cb29
GM
4410 * w32fns.c (Fx_display_color_cells): Instead of using NCOLORS,
4411 which is broken under remote desktop, calculate the number of
4412 colors available for a display based on the display's number of
4413 planes and number of bits per pixel per plane. (bug#10397).
4414
62c480c9 44152012-10-08 Jan Djärv <jan.h.d@swipnet.se>
fd59cb29 4416
62c480c9
JD
4417 * nsfont.m (Vfonts_in_cache): New variable.
4418 (nsfont_open): Use unsignedLongLongValue for cache in case wide ints
4419 are used. Add cached fonts to Vfonts_in_cache.
4420 (syms_of_nsfont): Initialize and staticpro Vfonts_in_cache.
4421
607446ba
JB
44222012-10-08 Juanma Barranquero <lekktu@gmail.com>
4423
fd5125ad
JB
4424 * makefile.w32-in (LOCAL_FLAGS): Don't define HAVE_NTGUI, it's now
4425 in nt/config.nt.
46979e0b
JB
4426 (FONT_H): Define after FRAME_H.
4427 ($(BLD)/emacs.$(O), $(BLD)/process.$(O), $(BLD)/w32heap.$(O)):
4428 Update dependencies.
fd5125ad 4429
607446ba
JB
4430 * w32term.c: Remove leftover declaration of keyboard_codepage.
4431
b6f4e300
EZ
44322012-10-08 Eli Zaretskii <eliz@gnu.org>
4433
c54ebba4
EZ
4434 * makefile.w32-in (FONT_H): Add $(FRAME_H).
4435 (W32TERM_H): Add $(ATIMER_H) and $(FRAME_H).
4436 ($(BLD)/emacs.$(O), $(BLD)/w32console.$(O)): Update dependencies.
4437 (GLOBAL_SOURCES): Add cygw32.c.
fd59cb29
GM
4438 ($(BLD)/unexw32.$(O)):
4439 ($(BLD)/w32.$(O)):
4440 ($(BLD)/w32console.$(O)):
4441 ($(BLD)/w32fns.$(O)):
4442 ($(BLD)/w32heap.$(O)):
4443 ($(BLD)/w32menu.$(O)):
15c720a3 4444 ($(BLD)/w32proc.$(O)): Add w32common.h.
c54ebba4 4445
b6f4e300
EZ
4446 * w32fns.c (w32_color_map_lookup, x_to_w32_color): Argument is now
4447 'const char *'.
4448 (x_to_w32_color): Don't modify the argument, modify a copy instead.
4449
501199a3
DC
44502012-10-08 Daniel Colascione <dancol@dancol.org>
4451
4452 * w32term.h (WM_EMACS_BRINGTOTOP, WM_EMACS_INPUT_READY)
4453 (WM_EMACS_END): Change WM_EMACS_BRINGTOTOP from 22 to 21 to close
4454 accidental message numbering hole. Change other messages to
4455 match.
4456
4457 * w32select.h (HAVE_W32SELECT): Remove.
4458
4459 * w32select.c, w32proc.c, w32menu.c, w32console.c, w32.c: Include
1f9f395d 4460 w32common.h instead of w32heap.h.
501199a3
DC
4461
4462 * w32heap.h (ROUND_UP, ROUND_DOWN, get_page_size)
4463 (get_allocation_unit, get_processor_type, get_w32_major_version)
4464 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4465 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4466 (OS_NT, os_subtype, cache_system_info): Move declarations to
4467 w32common.
4468
4469 * w32heap.c: Include w32common.h.
4470 (sysinfo_cache, syspage_mask, osinfo_cache, w32_major_version)
8599b23a
SM
4471 (w32_minor_version, w32_build_number, w32_subtype):
4472 Remove duplicate definitions.
501199a3
DC
4473
4474 * w32fns.c: Include w32common.h; include w32heap.h only in
4475 WINDOWSNT.
4476
4477 (Fx_file_dialog): Clarify comment on GetOpenFileName structure.
4478 Use `report_file_error' instead of `error' in order to better
4479 inform users of what went wrong. Increase NTGUI_UNICODE file
4480 dialog box file name length to 32k, the maximum allowed by the NT
4481 kernel.
4482
4483 * w32common.h: New file.
4484 (ROUND_UP, ROUND_DOWN, get_page_size)
4485 (get_allocation_unit, get_processor_type, get_w32_major_version)
4486 (get_w32_minor_version, sysinfo_cache, osinfo_cache)
4487 (w32_major_version, w32_minor_version, w32_build_number, OS_9X)
4488 (OS_NT, os_subtype, cache_system_info): Move here.
4489
4490 * unexw32.c, unexcw.c: Include w32common.h.
4491
4492 * emacs.c (main): Use (defined (WINDOWSNT) || defined
4493 HAVE_NTGUI) instead of removed HAVE_W32SELECT to decide whether
4494 to call syms_of_w32select.
4495
4496 * cygw32.h: Remove obsolete EXFUN declarations.
4497
4498 * cygw32.c (Qutf_16_le): Rename to Qutf_16le.
4499
4500 * Makefile.in (SOME_MACHINE_OBJECTS): Reverse accidental removal
4501 of w32inevt.o from SOME_MACHINE_OBJECTS.
4502
93aa5c81
DC
45032012-10-08 Daniel Colascione <dancol@dancol.org>
4504
4505 * image.c: Permanent fix for JPEG compilation issue --- limit
4506 jpeglib `boolean' redefinition to Cygwin builds.
4507
d424f3d8
EZ
45082012-10-08 Eli Zaretskii <eliz@gnu.org>
4509
8ee4c6ce
EZ
4510 * image.c (CHECK_LIB_AVAILABLE): Remove, no longer used.
4511
d424f3d8
EZ
4512 * emacs.c (DAEMON_MUST_EXEC) [HAVE_NTGUI]: Define this only on
4513 Cygwin.
4514
e08348a0
DC
45152012-10-08 Daniel Colascione <dancol@dancol.org>
4516
4517 * xfaces.c, xdisp.c, window.c, w32xfns.c, w32term.h, w32term.c,
4518 w32select.h w32select.c, w32proc.c, w32menu.c, w32inevt.c,
4519 w32help.c, w32font.c, w32font.c, w32fns.c, w32console.c, w32.h,
4520 w32.c, unexw32.c, termhooks.h, process.c, menu.c, keyboard.h,
4521 keyboard.c, image.c, frame.h, frame.c, fontset.c, font.h, font.c,
4522 emacs.c, dispextern.h, cygw32.h, cygw32.c, conf_post.h,
4523 Makefile.in: use HAVE_NTGUI for W32 GUI and WINDOWSNT for the
4524 operating system. defined(HAVE_NTGUI) && !defined(WINDOWSNT) is
4525 now a supported configuration.
4526
4527 * Makefile.in: consolidate image variables into LIBIMAGE; add
8e2417bf 4528 W32_OBJ and W32_LIBS. Compile new files.
e08348a0
DC
4529
4530 * conf_post.h:
4531 (_DebPrint) declare tracing facility for W32 debugging. We need
4532 to unify tracing later.
4533
4534 (NTGUI_UNICODE) Define when compiling for Cygwin to allow the
4535 unconditional use of W32 Unicode functions. Cygwin runs only on
4536 100% Unicode operating systems.
4537
4538 * cygw32.c: New file. Define Cygwin-specific facilities.
4539 (Fcygwin_convert_path_to_windows)
4540 (Fcygwin_convert_path_from_windows): New user functions for
4541 accessing Cygwin path-munging routines.
4542
4543 * cygw32.h: New file.
4544 (WCSDATA, to_unicode, from_unicode): Define facilities for storing
4545 UTF-16LE strings temporarily inside non-Lisp-visible string
4546 objects.
4547
4548 (w32_strerror): Just what it says on the tin.
4549
4550 * emacs.c: Make the NS fork-then-exec code for daemon-launching
4551 also run for Cygwin; both systems have the same problem with using
4552 GUI facilities in a forked child. Also call syms_of_cygw32,
4553 syms_of_w32select in correct places.
4554
4555 (DAEMON_MUST_EXEC): new macro defined to signal that a platform
4556 needs fork-then-exec for daemon launching.
4557
4558 * font.h: Include frame.h.
4559
4560 * image.c: Use the image library cache machinery only when we're
4561 compiling for native WINDOWSNT; Cygwin can use shared libraries
4562 like any other Unixlike system.
4563
4564 * keyboard.c: Clarify a comment regarding the input loop.
4565
4566 * menu.c: When NTGUI_UNICODE is defined, use Unicode menu
4567 functions directly instead of trying to detect at runtime that our
4568 host operating system supports them. We make this change for two
4569 reasons: Cygwin lacks support for the multibyte character
4570 conversion functions used by the legacy menu code, and Cygwin
4571 never needs to rely on non-Unicode APIs.
4572
4573 * unexw32.c (hinst): Declare extern.
4574
4575 * w32.c: Change header order;
4576 (w32_strerror): Move to w32fns.c because we need it for
4577 non-WINDOWSNT builds.
4578
4579 * w32.h: Add #error macro to make sure we don't include w32.h for
4580 Cygwin builds. Remove w32select declarations.
4581
4582 * w32console.c (w32_sys_ring_bell, Fset_message_beep): Move to
1f9f395d 4583 w32fns.c. w32console.c is WINDOWSNT-only.
e08348a0
DC
4584
4585 * w32fns.c: Include cygw32.h or w32.h depending on CYGWIN; more
4586 NTGUI_UNICODE tweaks. (See above.) Change _snprintf to the more
4587 POSIXy alternative.
4588 (faked_key, sysinfo_cache, osinfo_cahce, syspage_mask)
4589 (w32_major_version, w32_minor_version, w32_build_number)
4590 (os_subtype, sound_type): Define here
4591 (w32_defined_color): Make color parameter const for consistency
4592 with other _defined_color functions.
4593 (w32_createwindow): Unconditionally call w32_init_class instead of
4594 doing so only when hprevinst is non-NULL. Plumbing hprevinst
4595 through the code is complex and unnecessary because class
4596 registration is practically free.
4597 (w32_name_of_message): New EMACSDEBUG-only function.
4598 (Fset_message_beep): Move here
4599 (Fx_open_connection): Require that the display name for Windows be
4600 "w32" for consistency, emacsclient disambiguation, and maybe, one
4601 day, multi-window-system support.
4602 (file_dialog_callback): NTGUI_UNICODE changes; encode and decode
4603 Cygwin files for W32 GUI facilities, since these clearly don't
4604 expect Cygwin names.
4605 (_DebPrint): Define.
4606 (w32_strerror, w32_console_toggle_lock_key, w32_kbd_mods_to_emacs)
4607 (w32_kbd_patch_key, w32_sys_ring_bell): Move here.
4608 (Ssystem_move_file_to_trash): Define only for native WINDOWSNT.
4609 (w32_last_error): Remove.
4610
4611 * w32font.c: Define _strlwr to strlwr for non-WINDOWSNT builds.
4612
4613 * w32heap.c (syspage_mask): Declare here.
4614 (cache_system_info): Remove.
4615
4616 * w32inevt.c (faked_key): Define globally, not statically.
4617 (w32_kbd_mods_to_emacs, w32_kbd_patch_key, faked_key)
4618 (w32_console_toggle_lock_key): Move to w32fns.c.
4619
4620 * w32menu.c: Include setjmp.h. NTGUI_UNICODE changes throughout.
4621
4622 * w32proc.c (_DebPrint): Move to w32fns.c.
4623 * w32select.c: Include string.h, stdio.h for Cygwin.
4624 * w32select.h: New File.
4625
4626 * w32term.c: Include io.h for non-CYGWIN builds; needed for
4627 get_osfhandle.
4628 (w32_message_fd): New variable. Under Cygwin, holds the file
4629 descriptor the system used to tell us about pending thread
4630 messages.
4631
4632 (w32_init_term): Remove incorrect calls to fcntl and init_sigio
4633 that prevented compilation under non-WINDOWSNT systems.
4634
4635 (w32_initialize): Open /dev/windows and assign it to
4636 w32_message_fd. Provide w32 feature.
4637
4638 * w32term.h: Include frame.h, atimer.h. Declare various frame functions.
4639 (WM_EMACS_INPUT_READY): add.
4640 (prepend_msg, w32_message_fd): Declare globally.
4641
4642 * w32xfns.c:
4643 (keyboard_handle): Use only when WINDOWSNT.
4644 (notify_msg_ready): New function. Posts a message to the main
4645 thread's message queue under CYGWIN, which wakes up the main
4646 thread from select(2) by making the /dev/windows file descriptor
4647 ready. Under WINDOWSNT, it sets an event the same way the old
4648 code did.
4649
4650 (post, prepend_msg): Actually call notify_msg_ready instead of
4651 setting the input event directly.
4652
98daa893
EZ
46532012-10-07 Eli Zaretskii <eliz@gnu.org>
4654
4655 * ralloc.c (relinquish): If a heap is ready to be relinquished,
4656 but it still has blocs in it, don't return it to the system,
4657 instead of aborting. (Bug#12402)
4658
3bc0a2f7
JD
46592012-10-07 Jan Djärv <jan.h.d@swipnet.se>
4660
8ad5b73b 4661 * nsterm.m (ns_dumpglyphs_image): Only draw slice of image (Bug#12506).
493b5b1c 4662
335f5ae4
JD
4663 * nsterm.m (ns_update_auto_hide_menu_bar): Remove defintion of
4664 MAC_OS_X_VERSION_10_6.
8ad5b73b
JD
4665 (syms_of_nsterm): Remove comment about Panther and above for
4666 ns-antialias-text.
335f5ae4
JD
4667 * nsterm.h (MAC_OS_X_VERSION_10_3, onTiger): Remove.
4668 (EmacsApp): Remove check for >= MAC_OS_X_VERSION_10_4.
4669 (struct nsfont_info): Remove check for >= MAC_OS_X_VERSION_10_3.
4670
4671 * nsselect.m (ns_string_from_pasteboard): Remove check for >=
4672 MAC_OS_X_VERSION_10_4.
4673
8ad5b73b
JD
4674 * nsmenu.m (fillWithWidgetValue:): Remove code for <
4675 MAC_OS_X_VERSION_10_2.
335f5ae4
JD
4676
4677 * nsimage.m (setPixmapData, getPixelAtX, setAlphaAtX): Remove onTiger.
4678
4679 * nsfns.m (Fns_list_services): Remove comment and check for OSX < 10.4.
4680 (ns_do_applescript): Remove check for >= MAC_OS_X_VERSION_10_4.
4681
3bc0a2f7
JD
4682 * nsterm.m (ns_in_resize): Remove (Bug#12479).
4683 (ns_resize_handle_rect, mouseDown, mouseUp, mouseDragged): Remove.
8599b23a
SM
4684 (ns_clear_frame, sendEvent, windowDidResize, drawRect:):
4685 Remove ns_in_resize check.
3bc0a2f7
JD
4686 (ns_clear_frame_area): Remove resize handle code.
4687
4688 * nsfns.m (ns_in_resize): Remove.
e483264c
SM
4689 (x_set_icon_name, ns_set_name, ns_set_name_as_filename):
4690 Remove ns_in_resize check.
3bc0a2f7 4691
c622b48f
PE
46922012-10-07 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 Improve sys_siglist detection.
4695 * sysdep.c (sys_siglist, init_signals): Use _sys_siglist if it's
4696 defined as a macro, as is done in Solaris.
4697 (sys_siglist_entries): New macro.
4698 (save_strsignal): Use it.
4699 * syssignal.h (safe_strsignal): Now ATTRIBUTE_CONST, to pacify
4700 GCC 4.7.2 on Fedora 17 with the fixed sys_siglist detection.
4701
04fafa46
JD
47022012-10-06 Jan Djärv <jan.h.d@swipnet.se>
4703
4704 * nsfns.m (Fx_create_frame): Call x_default_parameter with
4705 fullscreen/Fullscreen.
4706
4707 * nsterm.h (EmacsView): Rename tbar_height to tibar_height.
4708 tobar_height is new.
4709
4710 * nsterm.m (x_make_frame_visible): Check for fullscreen.
4711 (ns_fullscreen_hook): Activate old style fullscreen with a timer.
4712 (ns_term_init): Set activateIgnoringOtherApps if old style fullscreen.
4713 (windowDidResize:): Check for correct window if old style fullscreen.
4714 Capitalize word in comment. Remove incorrect comment.
4715 (initFrameFromEmacs:): tbar_height renamed tibar_height.
4716 (windowDidEnterFullScreen:): Toggle toolbar for fullscreen to fix
4717 error in drawing background.
1f9f395d 4718 (toggleFullScreen:): Remove comment. Rearrange calls.
04fafa46
JD
4719 Set toolbar values to zero, save old height in tobar_height.
4720 Restore tool bar height when leaving fullscreen.
4721 (canBecomeMainWindow): New function.
4722
c6e21c03
PE
47232012-10-06 Paul Eggert <eggert@cs.ucla.edu>
4724
4725 * keyboard.c (read_char): Remove unnecessary 'volatile's and label.
4726
0d9f584b
EZ
47272012-10-05 Eli Zaretskii <eliz@gnu.org>
4728
a65fbb5f
EZ
4729 * w32proc.c (stop_timer_thread): Fix declaration of 'err'.
4730
0d9f584b 4731 * w32.c (utime): Open the file with FILE_FLAG_BACKUP_SEMANTICS, so
8599b23a
SM
4732 that time stamps of directories could also be changed.
4733 Don't request the too broad GENERIC_WRITE, only the more restrictive
0d9f584b
EZ
4734 FILE_WRITE_ATTRIBUTES access rights.
4735
4736 * fileio.c (Fset_file_times): Special-case ignoring errors for
4737 directories only on MSDOS, not on MS-Windows.
4738
e8757f09 47392012-10-05 Ikumi Keita <ikumi@ikumi.que.jp> (tiny change)
ca347e3d
IK
4740
4741 * minibuf.c (Fcompleting_read): Doc fix. (Bug#12555)
4742
7604f298
EZ
47432012-10-04 Eli Zaretskii <eliz@gnu.org>
4744
4745 * w32.c (utime): Test for INVALID_HANDLE_VALUE, not for NULL, to
4746 see whether CreateFile failed.
4747
88d69b7d
PE
47482012-10-04 Paul Eggert <eggert@cs.ucla.edu>
4749
4750 * profiler.c (handle_profiler_signal): Inhibit pending signals too,
4751 to avoid similar races.
4752 * keyboard.c (pending_signals): Now bool, not int.
4753
7509f454
PE
4754 Port timers to OpenBSD, plus check for timer failures.
4755 OpenBSD problem reported by Han Boetes.
4756 * profiler.c (setup_cpu_timer): Check for failure of timer_settime
4757 and/or setitimer.
4758 (Fprofiler_cpu_stop): Don't assume HAVE_SETITIMER.
4759 * syssignal.h (HAVE_ITIMERSPEC): New macro. This is for platforms
4760 like OpenBSD, which has timer_settime but does not declare it.
4761 OpenBSD does not define SIGEV_SIGNAL, so use that when deciding
4762 whether to use itimerspec-related primitives. All uses of
4763 HAVE_TIMER_SETTIME replaced with HAVE_ITIMERSPEC.
4764
a3c5c0c5
PE
47652012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4766
4767 * profiler.c (handle_profiler_signal): Fix a malloc race
4768 that caused Emacs to hang on Fedora 17 when profiling Lisp.
4769
914e743b
JD
47702012-10-02 Jan Djärv <jan.h.d@swipnet.se>
4771
4772 * nsterm.m (windowDidEnterFullScreen): Remove fprintf.
4773
d8ab37a8
EZ
47742012-10-02 Eli Zaretskii <eliz@gnu.org>
4775
4776 * w32proc.c (sys_wait): Declare 'signame' 'const char *', to be
4777 consistent with the change in return value of 'safe_strsignal'.
4778
b3ecad33
PE
47792012-10-02 Paul Eggert <eggert@cs.ucla.edu>
4780
0a99eee1
PE
4781 Prefer plain 'static' to 'static inline' (Bug#12541).
4782 * bidi.c (bidi_get_type, bidi_check_type, bidi_get_category)
4783 (bidi_set_sor_type, bidi_push_embedding_level)
4784 (bidi_pop_embedding_level, bidi_remember_char, bidi_copy_it)
4785 (bidi_cache_reset, bidi_cache_shrink, bidi_cache_fetch_state)
4786 (bidi_cache_search, bidi_cache_ensure_space)
4787 (bidi_cache_iterator_state, bidi_cache_find)
4788 (bidi_peek_at_next_level, bidi_set_paragraph_end)
4789 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4790 (bidi_explicit_dir_char, bidi_resolve_neutral_1):
4791 Now 'static', not 'static inline'.
4792
b3ecad33
PE
4793 Count overruns when profiling; change units to ns.
4794 * profiler.c (handle_profiler_signal): Count sampling intervals, not ms.
4795 Give extra weight to samples after overruns, to attempt to count
4796 the time more accurately.
4797 (setup_cpu_timer): Change sampling interval units from ms to ns, since
4798 the underlying primitives nominally do ns.
4799 (Fprofiler_cpu_start): Document the change. Mention that
4800 the sampling intervals are only approximate.
4801
090cf9db
SM
48022012-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
4803
4804 * frame.c (Fmake_terminal_frame): Prefer safer CONSP over !NILP.
4805
4806 * coding.h (ENCODE_FILE, DECODE_FILE, DECODE_SYSTEM): Remove special
4807 case for the special 0 coding-system.
4808
4809 * buffer.c (Fset_buffer_multibyte): Signal an error instead of widening.
4810 (Fmake_overlay): Remove redundant tests.
64edc777 4811 (fix_start_end_in_overlays): Remove redundant recentering.
090cf9db 4812
81550bf4
JB
48132012-10-02 Juanma Barranquero <lekktu@gmail.com>
4814
4815 * makefile.w32-in ($(BLD)/alloc.$(O), $(BLD)/gmalloc.$(O)):
4816 Update dependencies.
4817
aa1ba90e
PE
48182012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4819
4820 Fix a malloc race condition involving strsignal.
4821 A signal can arrive in the middle of a malloc, and Emacs's signal
4822 handler can invoke strsignal, which can invoke malloc, which is
4823 not portable. This race condition bug makes Emacs hang on GNU/Linux.
4824 Fix it by altering the signal handler so that it does not invoke
4825 strsignal.
4826 * emacs.c (shut_down_emacs): Use safe_strsignal, not strsignal.
4827 * process.c (status_message): Use const pointer, in case strsignal
4828 is #defined to safe_strsignal.
4829 * sysdep.c (sys_siglist, init_signals): Always define and
4830 initialize a substitute sys_siglist if the system does not define
4831 one, even if HAVE_STRSIGNAL.
4832 (safe_strsignal): Rename from strsignal. Always define,
4833 using sys_siglist. Return a const pointer.
4834 * syssignal.h (safe_strsignal): New decl.
4835 (strsignal) [!HAVE_STRSIGNAL]: Define in terms of safe_strsignal.
4836
ace917bd
EZ
48372012-10-01 Eli Zaretskii <eliz@gnu.org>
4838
4839 * w32proc.c (timer_loop): Fix code that waits for timer
4840 expiration, to avoid high CPU usage.
4841
9eb71b9c
SM
48422012-10-01 Stefan Monnier <monnier@iro.umontreal.ca>
4843
4844 * fns.c (check_hash_table, get_key_arg, maybe_resize_hash_table)
4845 (sweep_weak_table): Remove redundant prototypes.
4846
b3317662
FP
48472012-10-01 Fabrice Popineau <fabrice.popineau@gmail.com>
4848
4849 * emacs.c: Move the inclusion of TERM_HEADER after including
4850 windows.h on WINDOWSNT. This avoids compilation problems with
4851 MSVC.
4852
f0e5f225
EZ
48532012-10-01 Eli Zaretskii <eliz@gnu.org>
4854
2d7d1608
EZ
4855 * unexw32.c (OFFSET_TO_RVA, RVA_TO_OFFSET)
4856 (RVA_TO_SECTION_OFFSET): Encode all macro arguments in parentheses.
4857 (RVA_TO_PTR): Cast the result of RVA_TO_OFFSET to 'unsigned char *',
4858 as the previous version used 'void *'.
4859
4860 * ralloc.c (ROUNDUP): Fix last change.
4861 (MEM_ROUNDUP): Don't cast MEM_ALIGN, it is already of type
4862 'size_t'.
4863
f0e5f225
EZ
4864 * w32proc.c <disable_itimers>: New static flag.
4865 (init_timers): Initialize it to zero, after creating the critical
4866 sections used by the timer threads.
4867 (term_timers): Set to 1 before deleting the critical sections.
4868 (getitimer, setitimer): If disable_itimers is non-zero, return an
4869 error indication without doing anything. Reported by Fabrice
4870 Popineau <fabrice.popineau@supelec.fr> as part of bug#12544.
4cdfbb89
EZ
4871 (alarm) [HAVE_SETITIMER]: Be more conformant to the expected
4872 return results.
4873 [!HAVE_SETITIMER]: Behave as the previous version that didn't
4874 support timers.
f0e5f225
EZ
4875
4876 * emacs.c (shut_down_emacs) [WINDOWSNT]: Move the call to
4877 term_ntproc after all the other bookkeeping, to get timers working
4878 as long as possible.
4879
82ef37c1
PE
48802012-10-01 Paul Eggert <eggert@cs.ucla.edu>
4881
b3a4c387
PE
4882 * xdisp.c (syms_of_xdisp): Default message-log-max to 1000, not 100.
4883 Suggested by Juri Linkov in
4884 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00821.html>.
4885
b0ab8123
PE
4886 Prefer plain 'static' to 'static inline' (Bug#12541).
4887 With static functions, modern compilers inline pretty well by
4888 themselves; advice from programmers often hurts as much as it helps.
4889 On my host (x86-64, Fedora 17, GCC 4.7.2, default 'configure'),
4890 this change shrinks the text size of the Emacs executable by 1.1%
4891 without affecting CPU significantly in my benchmark.
4892 * alloc.c (mem_find, live_string_p, live_cons_p, live_symbol_p)
4893 (live_float_p, live_misc_p, live_vector_p, live_buffer_p)
4894 (mark_maybe_object, mark_maybe_pointer, bounded_number):
4895 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
4896 (bset_auto_fill_function, bset_auto_save_file_format)
4897 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
4898 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
4899 (bset_cache_long_line_scans, bset_case_fold_search)
4900 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
4901 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
4902 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
4903 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
4904 (bset_header_line_format, bset_indicate_buffer_boundaries)
4905 (bset_indicate_empty_lines, bset_invisibility_spec)
4906 (bset_left_fringe_width, bset_major_mode, bset_mark)
4907 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
4908 (bset_name, bset_overwrite_mode, bset_pt_marker)
4909 (bset_right_fringe_width, bset_save_length)
4910 (bset_scroll_bar_width, bset_scroll_down_aggressively)
4911 (bset_scroll_up_aggressively, bset_selective_display)
4912 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
4913 (bset_word_wrap, bset_zv_marker, set_buffer_overlays_before)
4914 (set_buffer_overlays_after):
4915 * category.c (bset_category_table):
4916 * charset.c (read_hex):
4917 * coding.c (produce_composition, produce_charset)
4918 (handle_composition_annotation, handle_charset_annotation)
4919 (char_encodable_p):
4920 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers)
4921 (assign_row, set_frame_matrix_frame, make_current)
4922 (add_row_entry):
4923 * eval.c (set_specpdl_symbol, set_specpdl_old_value):
4924 * fns.c (maybe_resize_hash_table):
4925 * frame.c (fset_buffer_predicate, fset_minibuffer_window):
4926 * gmalloc.c (register_heapinfo):
4927 * image.c (lookup_image_type):
4928 * intervals.c (set_interval_object, set_interval_left)
4929 (set_interval_right, copy_interval_parent, rotate_right)
4930 (rotate_left, balance_possible_root_interval):
4931 * keyboard.c (kset_echo_string, kset_kbd_queue)
4932 (kset_keyboard_translate_table, kset_last_prefix_arg)
4933 (kset_last_repeatable_command, kset_local_function_key_map)
4934 (kset_overriding_terminal_local_map, kset_real_last_command)
4935 (kset_system_key_syms, clear_event, set_prop):
4936 * lread.c (digit_to_number):
4937 * marker.c (attach_marker, live_buffer, set_marker_internal):
4938 * nsterm.m (ns_compute_glyph_string_overhangs):
4939 * process.c (pset_buffer, pset_command)
4940 (pset_decode_coding_system, pset_decoding_buf)
4941 (pset_encode_coding_system, pset_encoding_buf, pset_filter)
4942 (pset_log, pset_mark, pset_name, pset_plist, pset_sentinel)
4943 (pset_status, pset_tty_name, pset_type, pset_write_queue):
4944 * syntax.c (bset_syntax_table, dec_bytepos):
4945 * terminal.c (tset_param_alist):
4946 * textprop.c (interval_has_some_properties)
4947 (interval_has_some_properties_list):
4948 * window.c (wset_combination_limit, wset_dedicated)
4949 (wset_display_table, wset_hchild, wset_left_fringe_width)
4950 (wset_left_margin_cols, wset_new_normal, wset_new_total)
4951 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
4952 (wset_right_fringe_width, wset_right_margin_cols)
4953 (wset_scroll_bar_width, wset_start, wset_temslot, wset_vchild)
4954 (wset_vertical_scroll_bar_type, wset_window_parameters):
4955 * xdisp.c (wset_base_line_number, wset_base_line_pos)
4956 (wset_column_number_displayed, wset_region_showing)
4957 (window_box_edges, run_window_scroll_functions)
4958 (append_glyph_string_lists, prepend_glyph_string_lists)
4959 (append_glyph_string, set_glyph_string_background_width)
4960 (append_glyph, append_composite_glyph)
4961 (take_vertical_position_into_account):
4962 * xfaces.c (x_create_gc, x_free_gc, merge_face_vectors)
4963 (face_attr_equal_p, lface_equal_p, hash_string_case_insensitive)
4964 (lface_hash, lface_same_font_attributes_p, lookup_face):
4965 * xml.c (libxml2_loaded_p):
4966 * xterm.c (x_set_mode_line_face_gc, x_set_glyph_string_gc)
4967 (x_set_glyph_string_clipping, x_clear_glyph_string_rect):
4968 Now 'static', not 'static inline'.
4969
05584c31
PE
4970 * bidi.c: Tune.
4971 (bidi_copy_it): Do the whole copy with a single memcpy.
4972 (bidi_char_at_pos): Merge the two STRING_CHAR calls into one.
4973
86ec63ba
PE
4974 Revert the FOLLOW-SYMLINKS change for file-attributes.
4975 Doing it right would require several changes to Tramp, and there's
4976 not enough time to get that tested before the freeze today.
4977 * dired.c (directory_files_internal, Ffile_attributes):
4978 Undo last change.
4979
82ef37c1
PE
4980 * frame.c (x_report_frame_params): Port better to wider ints.
4981 Do not assume that EMACS_UINT is the same width as uprintmax_t,
4982 or that pointers can be printed in 15 decimal digits.
4983 Avoid GCC warnings if EMACS_UINT is wider than a pointer.
4984
62aba0d4
FP
49852012-09-30 Fabrice Popineau <fabrice.popineau@supelec.fr>
4986
4987 Support x64 build on MS-Windows.
4988 * w32term.h (SCROLL_BAR_PACK, SCROLL_BAR_UNPACK): Define for x64.
4989 (SET_SCROLL_BAR_W32_WINDOW): Cast ID to intptr_t, for
4990 compatibility with x64.
5e4daaf3 4991 (x_get_focus_frame): Add prototype.
62aba0d4
FP
4992
4993 * w32term.c (w32_draw_underwave): Don't use GCC extensions for
4994 defining an XRectangle structure.
4995
4996 * w32proc.c (RVA_TO_PTR, w32_executable_type): Fix pointer
4997 arithmetics for compatibility with x64.
4998
4999 * w32menu.c (add_menu_item): Use UINT_PTR instead of UINT, for
5000 compatibility with x64.
5001
5002 * w32heap.h: Adjust prototypes and declarations.
5003
5004 * w32heap.c (RVA_TO_PTR, allocate_heap, sbrk, init_heap)
5005 (round_heap): Use DWORD_PTR, ptrdiff_t and size_t instead of
5006 DWORD, long, and unsigned long, for compatibility with x64.
5007 (allocate_heap) [_WIN64]: Reserve 32GB of memory.
5008 (sbrk): Argument is now of type ptrdiff_t.
5009
5010 * w32fns.c (HMONITOR): Condition declaration on _WIN32_WINNT being
5011 less than 0x0500.
5012 (w32_msg_pump): Use WPARAM type for 'result'.
5013
5014 * w32.c (init_environment, get_emacs_configuration): Support AMD64
5015 architecture.
5016 (init_ntproc): Cast arguments of _open_osfhandle to intptr_t, for
5017 compatibility with x64.
5018
5019 * vm-limit.c (lim_data): Now size_t.
5020 (check_memory_limits): Adjust prototypes of real_morecore and
5021 __morecore to receive argument of type ptrdiff_t. Use size_t for
5022 five_percent and data_size.
5023
5024 * unexw32.c: Use DWORD_PTR instead of DWORD for file-scope
5025 variables, for compatibility with x64.
5026 (rva_to_section, offset_to_section, relocate_offset)
5027 (OFFSET_TO_RVA, RVA_TO_OFFSET, RVA_TO_SECTION_OFFSET)
5028 (PTR_TO_RVA, RVA_TO_PTR, OFFSET_TO_PTR, get_section_info)
5029 (copy_executable_and_dump_data): Use DWORD_PTR instead of DWORD
5030 for compatibility with x64.
5031
5032 * sysdep.c (STDERR_FILENO): Define if not already defined.
5033
5034 * ralloc.c (real_morecore): Argument type is now ptrdiff_t.
5035 (__morecore): Argument type is now ptrdiff_t.
5036 (ROUNDUP, MEM_ROUNDUP): Use size_t instead of 'unsigned long'.
5037 (relinquish): Use ptrdiff_t type for 'excess'.
5038 (r_alloc_sbrk): Argument type is now ptrdiff_t.
5039
5040 * makefile.w32-in (HEAPSIZE): Get value from EMACS_HEAPSIZE.
5041 (bootstrap-temacs-CMD, bootstrap-temacs-SH): Use $(EMACS_PURESIZE)
5042 instead of a literal number.
5043
5044 * gmalloc.c [WINDOWSNT]: Include w32heap.h.
5045 (min): Define only if not already defined.
5046
5047 * frame.c (x_report_frame_params): Use EMACS_UINT for the return
5048 value of FRAME_X_WINDOW, to fit a 64-bit pointer on 64-bit Windows
5049 hosts.
5050
5051 * image.c (x_bitmap_pixmap): Return ptrdiff_t, not int, since
5052 'bitmaps' is a pointer.
5053
5054 * dispextern.h (x_bitmap_pixmap): Adjust prototype.
5055
5056 * alloc.c (gdb_make_enums_visible): Now conditional on __GNUC__.
5057
e7a2937b
PE
50582012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5059
5060 file-attributes has a new optional arg FOLLOW-SYMLINKS.
5061 * dired.c (directory_files_internal, Ffile_attributes):
5062 New arg follow_symlinks. All uses changed.
5063
b43d62ae
SM
50642012-09-30 Stefan Monnier <monnier@iro.umontreal.ca>
5065
5066 * .gdbinit (xbacktrace): Adjust to recent "struct backtrace" change.
5067
c06c382a
EZ
50682012-09-30 Eli Zaretskii <eliz@gnu.org>
5069
5070 Support atimers and CPU profiler via profile.c on MS-Windows.
5071 * w32proc.c (sig_mask, crit_sig): New static variables.
5072 (sys_signal): Support SIGALRM and SIGPROF.
5073 (sigemptyset, sigaddset, sigfillset, sigprocmask)
b43d62ae 5074 (pthread_sigmask, setpgrp): Move here from w32.c. sigaddset,
c06c382a
EZ
5075 sigfillset, and sigprocmask are no longer no-ops.
5076 (sigismember): New function.
5077 (struct itimer_data): New definition.
5078 (ticks_now, real_itimer, prof_itimer, clocks_min, crit_real)
5079 (crit_prof): New static variables.
5080 (MAX_SINGLE_SLEEP): New definition.
5081 (timer_loop, stop_timer_thread, term_timers, init_timers)
5082 (start_timer_thread, getitimer, setitimer): New functions.
5083 (alarm): No longer a no-op, calls setitimer.
5084
5085 * w32.c (term_ntproc): Call term_timers.
5086 (init_ntproc): Make sure all signals are unblocked at startup, to
5087 erase any traces of dumping. Call init_timers.
5088
5089 * w32fns.c (hourglass_timer, HOURGLASS_ID): Remove.
5090 Windows-specific code to display the hourglass mouse pointer is no
5091 longer used.
5092 (w32_wnd_proc): Remove code that handled the WM_TIMER message due
5093 to hourglass timer expiration.
5094 (start_hourglass, cancel_hourglass, DEFAULT_HOURGLASS_DELAY):
5095 Remove, no longer used.
b43d62ae
SM
5096 (w32_note_current_window, show_hourglass, hide_hourglass):
5097 New functions, in support of hourglass cursor display similar to other
c06c382a
EZ
5098 window systems.
5099 (syms_of_w32fns): Don't initialize hourglass_timer.
5100
5101 * xdisp.c (start_hourglass, cancel_hourglass): Now used on
5102 WINDOWSNT as well.
5103 (start_hourglass) [WINDOWSNT]: Call w32_note_current_window.
5104
5105 * w32.h (init_timers, term_timers): Add prototypes.
5106
95402d5f
KH
51072012-09-30 Kenichi Handa <handa@gnu.org>
5108
5109 * coding.c (decode_coding_ccl, encode_coding_ccl): Pay attention
5110 to the buffer relocation which may be caused by ccl_driver.
5111
dd946752
JD
51122012-09-30 Jan Djärv <jan.h.d@swipnet.se>
5113
d7e642cc
JD
5114 * xfns.c (Fx_file_dialog): Update comment.
5115
5116 * w32fns.c (Fx_file_dialog): Update comment.
5117
5118 * nsfns.m (Fns_read_file_name): Add argument DIR_ONLY_P.
5119 Initialize panel name field if OSX >= 10.6.
5120
5121 * fileio.c (Fnext_read_file_uses_dialog_p): Add HAVE_NS.
5122
dd946752
JD
5123 * nsfns.m (ns_frame_parm_handlers): Add x_set_fullscreen.
5124
5125 * nsterm.m (NEW_STYLE_FS): New define.
5126 (ns_fullscreen_hook, windowWillEnterFullScreen)
5127 (windowDidEnterFullScreen, windowWillExitFullScreen)
5128 (windowDidExitFullScreen, toggleFullScreen, handleFS)
5129 (setFSValue): New functions.
5130 (EmacsFSWindow): New implementation.
5131 (canBecomeKeyWindow): New function for EmacsFSWindow.
5132 (ns_create_terminal): Set fullscreen_hook to ns_fullscreen_hook.
5133 (dealloc): Release nonfs_window if in fullscreen.
5134 (updateFrameSize:): Call windowDidMove to update top/left.
5135 (windowWillResize:toSize:): Check if frame is still maximized.
5136 (initFrameFromEmacs:): Initialize fs_state, fs_before_fs,
5137 next_maximized, maximized_width, maximized_height and nonfs_window.
5138 Call setCollectionBehavior if NEW_STYLE_FS. Initialize bwidth and
5139 tbar_height.
5140 (windowWillUseStandardFrame:defaultFrame:): Update frame parameter
1f9f395d 5141 fullscreen. Set maximized_width/height. Act on next_maximized.
dd946752
JD
5142
5143 * nsterm.h (MAC_OS_X_VERSION_10_7, MAC_OS_X_VERSION_10_8): New.
5144 (EmacsView): Add variables for fullscreen.
5145 (handleFS, setFSValue, toggleFullScreen): New in EmacsView.
5146 (EmacsFSWindow): New interface for fullscreen.
5147
427730eb
JB
51482012-09-30 Juanma Barranquero <lekktu@gmail.com>
5149
5150 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5151
48de8b12
CY
51522012-09-30 Chong Yidong <cyd@gnu.org>
5153
5154 * fns.c (Frandom): Doc fix.
5155
5938d519
MR
51562012-09-30 Martin Rudalics <rudalics@gmx.at>
5157
5158 * window.c (Vwindow_combination_limit): New default value.
5159 (Qwindow_size): New symbol replacing Qtemp_buffer_resize.
5160
cb5b0266
PE
51612012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5162
5163 * syssignal.h (PROFILER_CPU_SUPPORT): Don't define if PROFILING.
5164 Suggested by Eli Zaretskii in
5165 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00811.html>.
5166
84f72efd
EZ
51672012-09-30 Eli Zaretskii <eliz@gnu.org>
5168
5169 * profiler.c (Fprofiler_cpu_stop): Use timer_settime only if
5170 HAVE_TIMER_SETTIME is defined.
5171
9d4dcdc9
PE
51722012-09-30 Paul Eggert <eggert@cs.ucla.edu>
5173
d89460ed
PE
5174 Profiler improvements: more-accurate timers, overflow checks.
5175 * profiler.c: Don't include stdio.h, limits.h, sys/time.h,
5176 signal.h, setjmp.h. Include systime.h instead.
5177 (saturated_add): New function.
5178 (record_backtrace, current_sample_interval): Use EMACS_INT, not size_t.
5179 (record_backtrace, handle_profiler_signal): Saturate on fixnum overflow.
5180 (profiler_timer, profiler_timer_ok) [HAVE_TIMER_SETTIME]:
5181 New static vars.
84f72efd 5182 (enum profiler_cpu_running): New enum.
d89460ed
PE
5183 (profiler_cpu_running): Now of that enum type, not bool.
5184 All uses changed to store the new value.
5185 (handle_profiler_signal): Rename from sigprof_handler_1,
5186 for consistency with other handlers. Do not check whether
5187 cpu_log is a hash-table if garbage collecting, since it
5188 doesn't matter in that case.
5189 (deliver_profiler_signal): Rename from sigprof_handler,
5190 for consistency with other handlers.
5191 (setup_cpu_timer): New function, with much of what used to be in
5192 Fprofiler_cpu_start. Check for out-of-range argument.
5193 Prefer timer_settime if available, and prefer
5194 thread cputime clocks, then process cputime clocks, then
5195 monotonic clocks, to the old realtime clock. Use make_timeval
5196 to round more-correctly when falling back to setitimer.
5197 (Fprofiler_cpu_start): Use it.
5198 (Fprofiler_cpu_stop): Prefer timer_settime if available.
5199 Don't assume that passing NULL as the 2nd argument of setitimer
5200 is the same as passing a pointer to all-zero storage.
5201 Ignore SIGPROF afterwards.
5202 (malloc_probe): Saturate at MOST_POSITIVE_FIXNUM.
5203 * sysdep.c (emacs_sigaction_init): Also mask out SIGPROF in
5204 non-fatal signal handlers. Ignore SIGPROF on startup.
5205 * syssignal.h (PROFILER_CPU_SUPPORT): Define this macro here, not
5206 in profiler.c, since sysdep.c now uses it.
5207
9d4dcdc9
PE
5208 * sysdep.c (handle_fatal_signal): Bump backtrace size to 40.
5209 Suggested by Eli Zaretskii in
5210 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00796.html>.
5211
8e5691a0
JB
52122012-09-29 Juanma Barranquero <lekktu@gmail.com>
5213
5214 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5215
e7c1b6ef
SM
52162012-09-29 Stefan Monnier <monnier@iro.umontreal.ca>
5217
5218 * lisp.h (struct backtrace): Remove indirection for `function' field.
5219 * xdisp.c (redisplay_internal):
5220 * profiler.c (record_backtrace, sigprof_handler_1):
5221 * alloc.c (Fgarbage_collect):
5222 * eval.c (interactive_p, Fsignal, eval_sub, Ffuncall, Fbacktrace)
5223 (Fbacktrace_frame): Adjust accordingly.
5224
e61d39cd 52252012-09-28 Glenn Morris <rgm@gnu.org>
d393cefb
GM
5226
5227 * eval.c (Frun_hook_with_args, Frun_hook_with_args_until_success)
5228 (Frun_hook_with_args_until_failure): Doc fixes.
5229
404043ea
EZ
52302012-09-28 Eli Zaretskii <eliz@gnu.org>
5231
5232 * xdisp.c (syms_of_xdisp) <Qredisplay_internal>: Rename from
5233 Qautomatic_redisplay and change the symbol name. All users changed.
5234
704d3f45
TM
52352012-09-28 Tomohiro Matsuyama <tomo@cx4a.org>
5236
5237 * profiler.c (sigprof_handler): Fix race condition.
5238
757140ff
GM
52392012-09-28 Glenn Morris <rgm@gnu.org>
5240
5241 * lread.c (lisp_file_lexically_bound_p): Handle #! lines. (Bug#12528)
5242
a615a3ae
PE
52432012-09-27 Paul Eggert <eggert@cs.ucla.edu>
5244
5245 Check more robustly for timer_settime.
89d17fd0
PE
5246 * Makefile.in (LIB_TIMER_TIME): New macro.
5247 (LIBES): Add it.
a615a3ae
PE
5248 * atimer.c (alarm_timer, alarm_timer_ok, set_alarm, init_atimer):
5249 Use HAVE_TIMER_SETTIME, not SIGEV_SIGNAL, to decide whether to
5250 call timer_settime.
5251
3670daf7
TM
52522012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5253
5254 * profiler.c (Fprofiler_cpu_start): Remove unnecessary flag SA_SIGINFO.
5255
6a586b7f
JB
52562012-09-26 Juanma Barranquero <lekktu@gmail.com>
5257
5258 * makefile.w32-in ($(BLD)/profiler.$(O)): Update dependencies.
5259
41c8bfcf
PE
52602012-09-26 Paul Eggert <eggert@cs.ucla.edu>
5261
5262 * character.h (MAYBE_UNIFY_CHAR): Remove.
5263 * charset.c, charset.h (maybe_unify_char): Now static.
5264 * charset.c (decode_char): Use maybe_unify_char, not MAYBE_UNIFY_CHAR.
5265 Since this stuff is now private to charset.c, there's no need for
5266 a public macro and no need to inline by hand.
5267
3a880af4
SM
52682012-09-26 Tomohiro Matsuyama <tomo@cx4a.org>
5269 Stefan Monnier <monnier@iro.umontreal.ca>
5270 Juanma Barranquero <lekktu@gmail.com>
611b7507 5271
3a880af4
SM
5272 * profiler.c: New file.
5273 * Makefile.in (base_obj): Add profiler.o.
611b7507
JB
5274 * makefile.w32-in (OBJ2, GLOBAL_SOURCES): Add profiler.c.
5275 ($(BLD)/profiler.$(O)): New target.
3a880af4
SM
5276 * emacs.c (main): Call syms_of_profiler.
5277 * alloc.c (Qautomatic_gc): New constant.
5278 (MALLOC_PROBE): New macro.
5279 (xmalloc, xzalloc, xrealloc, lisp_malloc, lisp_align_malloc): Use it.
5280 (total_bytes_of_live_objects): New function.
5281 (Fgarbage_collect): Use it. Record itself in backtrace_list.
5282 Call malloc_probe for the memory profiler.
5283 (syms_of_alloc): Define Qautomatic_gc.
5284 * eval.c (eval_sub, Ffuncall): Reorder assignments to avoid
5285 race condition.
5286 (struct backtrace): Move definition...
5287 * lisp.h (struct backtrace): ..here.
5288 (Qautomatic_gc, profiler_memory_running): Declare vars.
5289 (malloc_probe, syms_of_profiler): Declare functions.
5290 * xdisp.c (Qautomatic_redisplay): New constant.
5291 (redisplay_internal): Record itself in backtrace_list.
5292 (syms_of_xdisp): Define Qautomatic_redisplay.
611b7507 5293
5938d519 52942012-09-25 Eli Zaretskii <eliz@gnu.org>
b67238c2
JB
52952012-09-25 Juanma Barranquero <lekktu@gmail.com>
5296
5297 * makefile.w32-in ($(BLD)/callproc.$(O)): Update dependencies.
5298
e26fd2e4
PE
52992012-09-25 Paul Eggert <eggert@cs.ucla.edu>
5300
5301 Prefer POSIX timers if available.
5302 They avoid a race if the timer is too close to the current time.
5303 * atimer.c (alarm_timer, alarm_timer_ok) [SIGEV_SIGNAL]: New static vars.
5304 (set_alarm) [SIGEV_SIGNAL]: Use POSIX timers if available.
9180598c 5305 (init_atimer) [SIGEV_SIGNAL]: Initialize them.
e26fd2e4 5306
eedec3ee
EZ
53072012-09-25 Eli Zaretskii <eliz@gnu.org>
5308
5309 * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY): Make it an alias of
5310 CHAR_STRING_ADVANCE.
5311 (STRING_CHAR_ADVANCE_NO_UNIFY): Make it an alias of
5312 STRING_CHAR_ADVANCE.
5313
aa15c6bb
JB
53142012-09-25 Juanma Barranquero <lekktu@gmail.com>
5315
5316 Move Vlibrary_cache to emacs.c and reset before dumping.
5317
5318 * lisp.h (reset_image_types): Declare.
5319 [WINDOWSNT] (Vlibrary_cache): Declare.
5320
5321 * image.c (reset_image_types): New function.
5322
5323 * emacs.c [WINDOWSNT] (Vlibrary_cache): Move from w32.c.
5324 (syms_of_emacs) [WINDOWSNT] <Vlibrary_cache>: Initialize and staticpro.
5325 (Fdump_emacs): Reset Vlibrary_cache and image_types.
5326
5327 * w32.c (Vlibrary_cache): Do not define; moved to emacs.c
5328 (globals_of_w32) <Vlibrary_cache>: Do not initialize.
5329
5330 * w32.h (Vlibrary_cache): Do not declare.
5331
54d629be
EZ
53322012-09-25 Eli Zaretskii <eliz@gnu.org>
5333
16b22fef
EZ
5334 * w32proc.c (sys_signal): Handle all signals defined by the
5335 MS-Windows runtime, not just SIGCHLD. Actually install the signal
5336 handlers for signals supported by Windows. Don't override
5337 term_ntproc as the handler for SIGABRT.
5338 (sigaction): Rewrite to call sys_signal instead of duplicating its
5339 code.
5340 (sys_kill): Improve commentary.
5341
5342 * w32.c (term_ntproc): Accept (and ignore) one argument, for
5343 consistency with a signature of a signal handler. All callers
5344 changed.
5345 (init_ntproc): Accept an argument DUMPING. If dumping, don't
5346 install term_ntproc as a signal handler for SIGABRT, as that
5347 should be done by the dumped Emacs.
5348
5349 * w32.h (init_ntproc, term_ntproc): Adjust prototypes.
5350
5351 * w32select.c (term_w32select): Protect against repeated
5352 invocation by setting clipboard_owner to NULL after calling
5353 DestroyWindow.
5354
5355 * emacs.c (shut_down_emacs, main): Adapt the calls to init_ntproc
5356 and term_ntproc to their modified signatures.
5357
54d629be
EZ
5358 * character.c (char_string, string_char): Remove calls to
5359 MAYBE_UNIFY_CHAR. See the discussion starting at
5360 http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00433.html
5361 for the details.
5362
59f7af81
CY
53632012-09-25 Chong Yidong <cyd@gnu.org>
5364
5365 * xdisp.c (mode_line_inverse_video): Delete obsolete variable.
5366
22e8cf4a
SM
53672012-09-24 Stefan Monnier <monnier@iro.umontreal.ca>
5368
5369 * bytecode.c (exec_byte_code): Signal an error instead of aborting,
5370 when encountering an unknown bytecode.
5371
578098f3
PE
53722012-09-24 Paul Eggert <eggert@cs.ucla.edu>
5373
5374 image.c, indent.c: Use bool for booleans.
5375 * dispextern.h (struct image_type): Members valid_p, load, init
5376 now return bool, not int. All uses changed.
5377 * image.c: Omit unnecessary static decls.
5378 (x_create_bitmap_mask, x_build_heuristic_mask):
5379 Return void, not int, since callers don't care about the return value.
5380 (x_create_bitmap_mask, define_image_type, valid_image_p)
5381 (struct image_keyword, parse_image_spec, image_spec_value)
5382 (check_image_size, image_background)
5383 (image_background_transparent, x_clear_image_1)
5384 (postprocess_image, lookup_image, x_check_image_size)
5385 (x_create_x_image_and_pixmap, xbm_image_p)
5386 (Create_Pixmap_From_Bitmap_Data, xbm_read_bitmap_data)
5387 (xbm_load_image, xbm_file_p, xbm_load, xpm_lookup_color)
5388 (init_xpm_functions, xpm_valid_color_symbols_p, xpm_image_p)
5389 (xpm_load, xpm_load_image, lookup_rgb_color, lookup_pixel_color)
5390 (x_to_xcolors, x_build_heuristic_mask, pbm_image_p, pbm_load)
5391 (png_image_p, init_png_functions, png_load_body, png_load)
5392 (jpeg_image_p, init_jpeg_functions, jpeg_load_body, jpeg_load)
5393 (tiff_image_p, init_tiff_functions, tiff_load, gif_image_p)
5394 (init_gif_functions, gif_load, imagemagick_image_p)
5395 (imagemagick_load_image, imagemagick_load, svg_image_p)
5396 (init_svg_functions, svg_load, svg_load_image, gs_image_p)
5397 (gs_load):
5398 * nsimage.m (ns_load_image):
5399 * nsterm.m (ns_defined_color):
5400 * xfaces.c (tty_lookup_color, tty_defined_color, defined_color):
5401 * xfns.c (x_defined_color):
5402 * xterm.c (x_alloc_lighter_color_for_widget)
5403 (x_alloc_nearest_color_1, x_alloc_nearest_color)
5404 (x_alloc_lighter_color):
5405 * indent.c (disptab_matches_widthtab, current_column)
5406 (scan_for_column, string_display_width, indented_beyond_p)
5407 (compute_motion, vmotion, Fvertical_motion):
5408 Use bool for booleans.
5409
a5f2b6ec
CY
54102012-09-24 Chong Yidong <cyd@gnu.org>
5411
5412 * chartab.c (Fset_char_table_default): Obsolete function removed.
5413
18e27ea8
PE
54142012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5415
afea8a8a
PE
5416 Move pid_t related decls out of lisp.h.
5417 * lisp.h, syswait.h (record_child_status_change, wait_for_termination)
5418 (interruptible_wait_for_termination):
5419 Move these decls from lisp.h to syswait.h, since they use pid_t.
5420 Needed on FreeBSD; see Herbert J. Skuhra in
5421 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00571.html>.
5422 * callproc.c: Include syswait.h.
5423
18e27ea8
PE
5424 gnutls.c, gtkutil.c: Use bool for boolean.
5425 * gnutls.c (gnutls_global_initialized, init_gnutls_functions)
5426 (emacs_gnutls_handle_error):
5427 * gtkutil.c (xg_check_special_colors, xg_prepare_tooltip)
5428 (xg_hide_tooltip, xg_create_frame_widgets)
5429 (create_dialog, xg_uses_old_file_dialog)
5430 (xg_get_file_with_chooser, xg_get_file_with_selection)
5431 (xg_get_file_name, xg_have_tear_offs, create_menus, xg_create_widget)
5432 (xg_item_label_same_p, xg_update_menubar)
5433 (xg_modify_menubar_widgets, xg_event_is_for_menubar)
5434 (xg_ignore_gtk_scrollbar, xg_set_toolkit_scroll_bar_thumb)
5435 (xg_event_is_for_scrollbar, xg_pack_tool_bar, xg_make_tool_item)
5436 (is_box_type, xg_tool_item_stale_p, xg_update_tool_bar_sizes)
5437 (update_frame_tool_bar, free_frame_tool_bar):
5438 * gtkutil.c, w32term.c, xterm.c (x_wm_set_size_hint):
5439 * nsmenu.m (ns_update_menubar):
5440 * nsmenu.m, w32menu.c, xmenu.c (set_frame_menubar):
5441 * xfns.c (Fx_show_tip) [USE_GTK]:
5442 Use bool for boolean.
5443 * gtkutil.c (xg_update_frame_menubar):
5444 * xmenu.c (update_frame_menubar):
5445 Return void, not int, since caller ignores return value.
5446 * gtkutil.c (xg_change_toolbar_position):
5447 Return void, not 1.
5448
af0e9f75
JB
54492012-09-23 Juanma Barranquero <lekktu@gmail.com>
5450
5451 * makefile.w32-in (BLOCKINPUT_H): Remove.
5452 (SYSSIGNAL_H): New macro.
5453 ($(BLD)/alloc.$(O), $(BLD)/atimer.$(O), $(BLD)/buffer.$(O))
5454 ($(BLD)/callproc.$(O), $(BLD)/data.$(O), $(BLD)/dired.$(O))
5455 ($(BLD)/dispnew.$(O), $(BLD)/editfns.$(O), $(BLD)/emacs.$(O))
5456 ($(BLD)/eval.$(O), $(BLD)/fileio.$(O), $(BLD)/floatfns.$(O))
5457 ($(BLD)/fns.$(O), $(BLD)/fontset.$(O), $(BLD)/frame.$(O))
5458 ($(BLD)/fringe.$(O), $(BLD)/image.$(O), $(BLD)/insdel.$(O))
5459 ($(BLD)/keyboard.$(O), $(BLD)/keymap.$(O), $(BLD)/lread.$(O))
5460 ($(BLD)/menu.$(O), $(BLD)/w32inevt.$(O), $(BLD)/w32proc.$(O))
5461 ($(BLD)/print.$(O), $(BLD)/process.$(O), $(BLD)/ralloc.$(O))
5462 ($(BLD)/search.$(O), $(BLD)/sound.$(O), $(BLD)/sysdep.$(O))
5463 ($(BLD)/term.$(O), $(BLD)/window.$(O), $(BLD)/xdisp.$(O))
5464 ($(BLD)/xfaces.$(O), $(BLD)/w32fns.$(O), $(BLD)/w32menu.$(O))
5465 ($(BLD)/w32term.$(O), $(BLD)/w32select.$(O), $(BLD)/w32reg.$(O))
5466 ($(BLD)/w32xfns.$(O)): Update dependencies.
5467
5101529e
EZ
54682012-09-23 Eli Zaretskii <eliz@gnu.org>
5469
5470 * .gdbinit: Set breakpoint on terminate_due_to_signal, not on
5471 fatal_error_backtrace.
5472
5473 * w32proc.c (sys_kill): Undo last change: don't do anything when
5474 invoked to deliver SIGABRT to our own process. This is now
5475 handled by emacs_raise.
5476
2c3ee0ad
JB
54772012-09-23 Juanma Barranquero <lekktu@gmail.com>
5478
5479 * w32term.c (w32_read_socket): Remove leftover reference to
5480 interrupt_input_pending.
5481
62a1d661
PE
54822012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5483
5484 Do not use SA_NODEFER.
5485 Problem reported by Dani Moncayo in
5486 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00557.html>.
5487 * alloc.c (die):
5488 * sysdep.c (emacs_abort): Do not reset signal handler.
5489 * emacs.c (terminate_due_to_signal): Reset signal handler here.
5490 * sysdep.c (init_signals): Do not use SA_NODEFER. It wasn't
5491 wanted even on POSIXish hosts, and it doesn't work on Windows.
5492
a0942b9a
JD
54932012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5494
5495 * xterm.c (x_term_init): Call fixup_locale before and after calling
5496 gtk_init (Bug#12392).
5497
d07ff9db
CY
54982012-09-23 Chong Yidong <cyd@gnu.org>
5499
5500 * w32.c (w32_delayed_load): Remove LIBRARIES argument; always use
5501 Vdynamic_library_alist.
5502
5503 * gnutls.c (init_gnutls_functions): Caller changed; remove arg.
5504 (Fgnutls_available_p): Caller changed.
5505
5506 * xml.c (init_libxml2_functions, Flibxml_parse_html_region)
5507 (Flibxml_parse_xml_region): Likewise.
5508
5509 * dispextern.h (struct image_type): Remove arg from init function.
5510
5511 * image.c (Finit_image_library, lookup_image_type)
5512 (define_image_type): Remove now-unneeded second arg.
5513 (init_xpm_functions, init_png_functions, init_jpeg_functions)
5514 (init_tiff_functions, init_gif_functions, init_svg_functions):
5515 Arglist and w32_delayed_load calling convention changed.
5516 (gs_type): Remove init_gs_functions; there is no such function.
641cfd14 5517 (valid_image_p, make_image): Fix caller to lookup_image_type.
d07ff9db 5518
4d7e6e51
PE
55192012-09-23 Paul Eggert <eggert@cs.ucla.edu>
5520
5521 Simplify and avoid signal-handling races (Bug#12471).
5522 * alloc.c (die):
5523 * sysdep.c (emacs_abort) [HAVE_NTGUI]:
5524 Avoid recursive loop if there's a fatal error in the function itself.
5525 * atimer.c (pending_atimers):
5526 * blockinput.h: Don't include "atimer.h"; no longer needed.
5527 (interrupt_input_pending): Remove. All uses removed.
5528 pending_signals now counts both atimers and ordinary interrupts.
5529 This is less racy than having three separate pending-signal flags.
5530 (block_input, unblock_input, totally_unblock_input, unblock_input_to)
5531 (input_blocked_p):
5532 Rename from their upper-case counterparts BLOCK_INPUT,
5533 UNBLOCK_INPUT, TOTALLY_UNBLOCK_INPUT, UNBLOCK_INPUT_TO,
5534 INPUT_BLOCKED_P, and turn into functions. All uses changed.
5535 This makes it easier to access volatile variables more accurately.
5536 (BLOCK_INPUT_RESIGNAL): Remove. All uses replaced by unblock_input ().
5537 (input_blocked_p): Prefer this to 'interrupt_input_blocked', as
5538 that's more reliable if the code is buggy and sets
5539 interrupt_input_blocked to a negative value. All uses changed.
5540 * atimer.c (deliver_alarm_signal):
5541 Remove. No need to deliver this to the parent; any thread can
5542 handle this signal now. All uses replaced by underlying handler.
5543 * atimer.c (turn_on_atimers):
5544 * dispnew.c (handle_window_change_signal):
5545 * emacs.c (handle_danger_signal):
5546 * keyboard.c (kbd_buffer_get_event):
5547 Don't reestablish signal handler; not needed with sigaction.
5548 * blockinput.h (UNBLOCK_INPUT_TO, TOTALLY_UNBLOCK_INPUT)
5549 (UNBLOCK_INPUT_TO):
5550 Rework to avoid unnecessary accesses to volatile variables.
5551 (UNBLOCK_INPUT_TO): Now a function.
5552 (totally_unblock_input, unblock_input): New decls.
5553 * data.c (handle_arith_signal, deliver_arith_signal): Move to sysdep.c
5554 (init_data): Remove. Necessary stuff now done in init_signal.
5555 * emacs.c, xdisp.c: Include "atimer.h", since we invoke atimer functions.
5556 * emacs.c (handle_fatal_signal, deliver_fatal_signal): Move to sysdep.c.
5557 (fatal_error_code): Remove; no longer needed.
5558 (terminate_due_to_signal): Rename from fatal_error_backtrace, since
5559 it doesn't always backtrace. All uses changed. No need to reset
5560 signal to default, since sigaction and/or die does that for us now.
5561 Use emacs_raise (FOO), not kill (getpid (), FOO).
5562 (main): Check more-accurately whether we're dumping.
5563 Move fatal-error setup to sysdep.c
5564 * floatfns.c: Do not include "syssignal.h"; no longer needed.
5565 * gtkutil.c (xg_get_file_name, xg_get_font):
5566 Remove no-longer-needed signal-mask manipulation.
5567 * keyboard.c, process.c (POLL_FOR_INPUT):
5568 Don't depend on USE_ASYNC_EVENTS, a symbol that is never defined.
5569 * keyboard.c (read_avail_input): Remove.
5570 All uses replaced by gobble_input.
5571 (Ftop_level): Use TOTALLY_UNBLOCK_INPUT rather than open code.
5572 (kbd_buffer_store_event_hold, gobble_input):
5573 (record_asynch_buffer_change) [USABLE_SIGIO]:
5574 (store_user_signal_events):
5575 No need to mess with signal mask.
5576 (gobble_input): If blocking input and there are terminals, simply
5577 set pending_signals to 1 and return. All hooks changed to not
5578 worry about whether input is blocked.
5579 (process_pending_signals): Clear pending_signals before processing
5580 them, in case a signal comes in while we're processing.
5581 By convention callers now test pending_signals before calling us.
5582 (UNBLOCK_INPUT_TO, unblock_input, totally_unblock_input):
5583 New functions, to support changes to blockinput.h.
5584 (handle_input_available_signal): Now extern.
5585 (reinvoke_input_signal): Remove. All uses replaced by
5586 handle_async_input.
5587 (quit_count): Now volatile, since a signal handler uses it.
3a880af4
SM
5588 (handle_interrupt): Now takes bool IN_SIGNAL_HANDLER as arg.
5589 All callers changed. Block SIGINT only if not already blocked.
4d7e6e51
PE
5590 Clear sigmask reliably, even if Fsignal returns, which it can.
5591 Omit unnecessary accesses to volatile var.
5592 (quit_throw_to_read_char): No need to restore sigmask.
5593 * keyboard.c (gobble_input, handle_user_signal):
5594 * process.c (wait_reading_process_output):
5595 Call signal-handling code rather than killing ourselves.
5596 * lisp.h: Include <float.h>, for...
5597 (IEEE_FLOATING_POINT): New macro, moved here to avoid duplication.
5598 (pending_signals): Now volatile.
5599 (syms_of_data): Now const if IEEE floating point.
5600 (handle_input_available_signal) [USABLE_SIGIO]:
5601 (terminate_due_to_signal, record_child_status_change): New decls.
5602 * process.c (create_process): Avoid disaster if memory is exhausted
5603 while we're processing a vfork, by tightening the critical section
5604 around the vfork.
5605 (send_process_frame, process_sent_to, handle_pipe_signal)
5606 (deliver_pipe_signal): Remove. No longer needed, as Emacs now
5607 ignores SIGPIPE.
5608 (send_process): No need for setjmp/longjmp any more, since the
5609 SIGPIPE stuff is now gone. Instead, report an error if errno
5610 is EPIPE.
5611 (record_child_status_change): Now extern. PID and W are now args.
5612 Return void, not bool. All callers changed.
5613 * sysdep.c (wait_debugging) [(BSD_SYSTEM || HPUX) && !defined (__GNU__)]:
5614 Remove. All uses removed. This bug should be fixed now in a
5615 different way.
5616 (wait_for_termination_1): Use waitpid rather than sigsuspend,
5617 and record the child status change directly. This avoids the
5618 need to futz with the signal mask.
5619 (process_fatal_action): Move here from emacs.c.
5620 (emacs_sigaction_flags): New function, containing
5621 much of what used to be in emacs_sigaction_init.
5622 (emacs_sigaction_init): Use it. Block nonfatal system signals that are
5623 caught by emacs, to make races less likely.
5624 (deliver_process_signal): Rename from handle_on_main_thread.
5625 All uses changed.
5626 (BACKTRACE_LIMIT_MAX): Now at top level.
5627 (thread_backtrace_buffer, threadback_backtrace_pointers):
5628 New static vars.
5629 (deliver_thread_signal, deliver_fatal_thread_signal):
5630 New functions, for more-accurate delivery of thread-specific signals.
5631 (handle_fatal_signal, deliver_fatal_signal): Move here from emacs.c.
5632 (deliver_arith_signal): Handle in this thread, not
5633 in the main thread, since it's triggered by this thread.
5634 (maybe_fatal_sig): New function.
5635 (init_signals): New arg DUMPING so that we can be more accurate
5636 about whether we're dumping. Caller changed.
5637 Treat thread-specific signals differently from process-general signals.
5638 Block all signals while handling fatal error; that's safer.
5639 xsignal from SIGFPE only on non-IEEE hosts, treating it as fatal
5640 on IEEE hosts.
5641 When batch, ignore SIGHUP, SIGINT, SIGTERM if they were already ignored.
5642 Ignore SIGPIPE unless batch.
5643 (emacs_backtrace): Output backtrace for the appropriate thread,
5644 which is not necessarily the main thread.
5645 * syssignal.h: Include <stdbool.h>.
5646 (emacs_raise): New macro.
5647 * xterm.c (x_connection_signal): Remove; no longer needed
5648 now that we use sigaction.
5649 (x_connection_closed): No need to mess with sigmask now.
5650 (x_initialize): No need to reset SIGPIPE handler here, since
5651 init_signals does this for us now.
5652
8f4635e9
JD
56532012-09-23 Jan Djärv <jan.h.d@swipnet.se>
5654
5655 * nsterm.m (ns_dumpglyphs_image): dr is a new rect to draw image into,
fb39b937 5656 background rect may be larger (Bug#12245).
8f4635e9 5657
3296976d
CY
56582012-09-23 Chong Yidong <cyd@gnu.org>
5659
5660 * keyboard.c (timer_check): Avoid quitting during Fcopy_sequence.
5661
d41e491e
PE
56622012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 * .gdbinit: Just stop at fatal_error_backtrace.
5665 See Stefan Monnier's request in
5666 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00549.html>.
5667 Remove no-longer-used query of system type.
5668
c88b867f
CY
56692012-09-22 Chong Yidong <cyd@gnu.org>
5670
5671 * search.c (Freplace_match): Doc fix (Bug#12325).
5672
5673 * minibuf.c (Finternal_complete_buffer): Doc fix (Bug#12391).
5674
5675 * editfns.c (Fline_beginning_position): Doc fix (Bug#12416).
5676 (Fline_end_position): Doc fix.
5677
5678 * cmds.c (Fforward_char, Fbackward_char): Doc fix (Bug#12414).
5679
bb4d86b4
CY
56802012-09-22 Chong Yidong <cyd@gnu.org>
5681
5682 * dispextern.h (struct image_type): Add new slot, storing a type
5683 initialization function.
5684
5685 * image.c (define_image_type): Call the image initializer function
5686 if it is defined. Arguments and return value changed.
5687 (valid_image_p, make_image): Callers changed.
5688 (xbm_type, xpm_type, pbm_type, png_type, jpeg_type, tiff_type)
3a880af4
SM
5689 (gif_type, imagemagick_type, svg_type, gs_type):
5690 Add initialization functions.
bb4d86b4
CY
5691 (Finit_image_library): Call lookup_image_type.
5692 (CHECK_LIB_AVAILABLE): Macro deleted.
5693 (lookup_image_type): Call define_image_type here, rather than via
5694 Finit_image_library, and without using CHECK_LIB_AVAILABLE.
5695 (syms_of_image): Move define_image_type calls for xbm_type and
5696 pbm_type to lookup_image_type.
5697
df9685f3
EZ
56982012-09-22 Eli Zaretskii <eliz@gnu.org>
5699
5700 * keyboard.c (timer_check_2): Move calculation of 'timers' and
5701 'idle_timers' from here ...
5702 (timer_check): ... to here. Use Fcopy_sequence to copy the timer
5703 lists, to avoid infloops when the timer does something stupid,
5704 like reinvoke itself with the same or smaller time-out.
5705 (Bug#12447)
5706
8e17c9ba
MR
57072012-09-22 Martin Rudalics <rudalics@gmx.at>
5708
5709 * window.c (Fsplit_window_internal): Handle only Qt value of
5710 Vwindow_combination_limit separately.
5711 (Qtemp_buffer_resize): New symbol.
3a880af4
SM
5712 (Vwindow_combination_limit): New default value.
5713 Rewrite doc-string.
8e17c9ba 5714
589bd69b
EZ
57152012-09-22 Eli Zaretskii <eliz@gnu.org>
5716
5717 * xdisp.c (next_overlay_string): Initialize it->end_charpos for
5718 the new overlay string. (Bug#10159)
5719
01108e3f
PE
57202012-09-22 Paul Eggert <eggert@cs.ucla.edu>
5721
5722 * emacs.c (shut_down_emacs): Don't assume stderr is buffered,
5723 or that fprintf is async-signal-safe. POSIX doesn't require
5724 either assumption.
5725
82f8cd94
CY
57262012-09-22 Chong Yidong <cyd@gnu.org>
5727
5728 * buffer.c (Fset_buffer_modified_p): Handle indirect buffers
5729 (Bug#8207).
5730
3cccbd87
KH
57312012-09-22 Kenichi Handa <handa@gnu.org>
5732
5733 * composite.c (composition_reseat_it): Handle the case that a
5734 grapheme cluster is not covered by a single font (Bug#12352).
5735
09c01941
CY
57362012-09-21 Chong Yidong <cyd@gnu.org>
5737
5738 * image.c (define_image_type): Avoid adding duplicate types to
5739 image_types (Bug#12463). Suggested by Jörg Walter.
5740
acfa068f 57412012-09-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
e25c1a30
YM
5742
5743 * unexmacosx.c: Define LC_DATA_IN_CODE if not defined.
5744 (print_load_command_name): Add case LC_DATA_IN_CODE.
5745 (dump_it) [LC_DATA_IN_CODE]: Call copy_linkedit_data.
5746
acfa068f 57472012-09-21 Glenn Morris <rgm@gnu.org>
1e9bbf47
GM
5748
5749 * eval.c (Frun_hook_with_args_until_success)
5750 (Frun_hook_with_args_until_failure): Doc fixes. (Bug#12393)
5751
acfa068f 57522012-09-21 Andreas Schwab <schwab@linux-m68k.org>
c6ba4138
AS
5753
5754 * fileio.c (Ffile_selinux_context): Only call freecon when
5755 lgetfilecon succeeded.
5756 (Fset_file_selinux_context): Likewise. (Bug#12444)
5757
acfa068f 57582012-09-21 Eli Zaretskii <eliz@gnu.org>
aa36e4d2
EZ
5759
5760 * xdisp.c (try_window_reusing_current_matrix): Under bidi
5761 reordering, locate the cursor by calling set_cursor_from_row; if
5762 that fails, clear the desired glyph matrix before returning a
5763 failure indication to the caller. Fixes leaving garbled display
5764 when fast scrolling with a down-key. (Bug#12403)
f2016bea
EZ
5765 (compute_stop_pos_backwards): Fix a typo that caused crashes while
5766 scrolling through multibyte text.
aa36e4d2 5767
e99f70c8
SM
57682012-09-20 Stefan Monnier <monnier@iro.umontreal.ca>
5769
5770 * alloc.c (mark_object) <PVEC_WINDOW>: Mark prev/next_buffers *after*
5771 calling mark_vectorlike since that's the one that marks the window.
5772 (mark_discard_killed_buffers): Mark the final cdr.
5773 * window.h (struct window): Move prev/next_buffers to the
5774 non-standard fields.
5775 * window.c (make_window): Initialize prev/next_buffers manually.
5776
f75beb47
PE
57772012-09-20 Paul Eggert <eggert@cs.ucla.edu>
5778
5779 Omit unused arg EXPECTED from socket hooks.
5780 * keyboard.c (gobble_input, read_avail_input, tty_read_avail_input):
5781 * nsterm.m (ns_term_init):
5782 * termhooks.h (struct terminal.read_socket_hook):
5783 * w32inevt.c (w32_console_read_socket):
5784 * w32term.c (w32_read_socket):
5785 * xterm.c (XTread_socket):
5786 Omit unused arg EXPECTED. All callers changed.
5787 (store_user_signal_events): Return void, not int, since callers no
5788 longer care about the return value. All uses changed.
5789
b019b76a
JB
57902012-09-20 Juanma Barranquero <lekktu@gmail.com>
5791
5792 * w32gui.h (XParseGeometry): Do not declare.
5793
05642592
PE
57942012-09-19 Paul Eggert <eggert@cs.ucla.edu>
5795
e4bce92a 5796 * w32inevt.c (w32_console_read_socket): Return -1 on failure, not 0.
1f9f395d 5797 Ignore 'expected'. See Eli Zaretskii in
e4bce92a
PE
5798 <http://bugs.gnu.org/12471#8> (last line).
5799
05642592
PE
5800 * frame.c (read_integer): Remove. All uses replaced by strtol/strtoul.
5801 (XParseGeometry): Now static. Substitute extremal values for
5802 values that are out of range.
5803
e543ae91
JD
58042012-09-19 Jan Djärv <jan.h.d@swipnet.se>
5805
5806 * w32xfns.c (read_integer, XParseGeometry): Move to frame.c.
5807
5808 * nsfns.m (XParseGeometry): Remove.
5809 (Fx_create_frame): Call x_set_offset to correctly interpret
5810 top_pos in geometry.
5811
3a880af4 5812 * frame.c (read_integer, XParseGeometry): Move from w32xfns.c.
e543ae91
JD
5813 (Fx_parse_geometry): If there is a space in string, call
5814 Qns_parse_geometry, otherwise do as on other terms (Bug#12368).
5815
45ba16c7
EZ
58162012-09-17 Eli Zaretskii <eliz@gnu.org>
5817
c8b9f1bc
EZ
5818 * search.c (scan_buffer): Use character positions in calls to
5819 region_cache_forward and region_cache_backward, not byte
5820 positions. (Bug#12196)
5821
b4c932a2
EZ
5822 * w32term.c (w32_read_socket): Set pending_signals to 1, like
5823 xterm.c does. Reported by Daniel Colascione <dancol@dancol.org>.
5824
45ba16c7
EZ
5825 * ralloc.c (r_alloc_init) [!SYSTEM_MALLOC]: Initialize
5826 __malloc_extra_blocks to 32 instead of 64, like alloc.c did in
5827 emacs_blocked_malloc, now deleted.
5828
eeceac93
PE
58292012-09-17 Paul Eggert <eggert@cs.ucla.edu>
5830
5831 Remove no-longer-needed Solaris 2.4 vfork bug workaround.
5832 The workaround was for improving performance on Solaris 2.4, but
5833 is getting in the way now. Emacs will still work if someone is
5834 still running Solaris 2.4 in a museum somewhere; Sun dropped
5835 support for Solaris 2.4 in 2003.
5836 * callproc.c (Fcall_process) [HAVE_WORKING_VFORK]:
5837 * process.c (create_process) [HAVE_WORKING_VFORK]:
5838 Omit now-unnecessary workaround for the Solaris 2.4 vfork bug,
5839 since Emacs no longer uses vfork on that platform.
5840
78f83752
GM
58412012-09-17 Glenn Morris <rgm@gnu.org>
5842
5843 * emacs.c: Use COPYRIGHT.
5844
634b8cac
PE
58452012-09-16 Paul Eggert <eggert@cs.ucla.edu>
5846
0caaedb1
PE
5847 Remove configure's --without-sync-input option (Bug#12450).
5848 When auditing signal-handling in preparation for cleaning it up,
5849 I found that SYNC_INPUT has race conditions and would be a real
5850 pain to fix. Since it's an undocumented and deprecated
5851 configure-time option, now seems like a good time to remove it.
5852 Also see <http://bugs.gnu.org/11080#16>.
5853 * alloc.c (_bytes_used, __malloc_extra_blocks, _malloc_internal)
5854 (_free_internal) [!DOUG_LEA_MALLOC]: Remove decls.
5855 (alloc_mutex) [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5856 (malloc_hysteresis):
5857 (check_depth) [XMALLOC_OVERRUN_CHECK]:
5858 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT):
5859 (__malloc_hook, __realloc_hook, __free_hook, BYTES_USED)
5860 (dont_register_blocks, bytes_used_when_reconsidered)
5861 (bytes_used_when_full, emacs_blocked_free, emacs_blocked_malloc)
5862 (emacs_blocked_realloc, reset_malloc_hooks, uninterrupt_malloc):
5863 [!SYSTEM_MALLOC && !SYNC_INPUT]:
1f9f395d 5864 Remove. All uses removed.
0caaedb1
PE
5865 (MALLOC_BLOCK_INPUT, MALLOC_UNBLOCK_INPUT): Use a different
5866 implementation, one that depends on whether the new macro
5867 XMALLOC_BLOCK_INPUT_CHECK is defined, not on whether SYNC_INPUT
5868 is defined.
5869 * atimer.c (run_timers, handle_alarm_signal):
5870 * keyboard.c (pending_signal, poll_for_input_1, poll_for_input)
5871 (handle_async_input, process_pending_signals)
5872 (handle_input_available_signal, init_keyboard):
5873 * nsterm.m (ns_read_socket):
5874 * process.c (wait_reading_process_output):
5875 * regex.c (immediate_quit, IMMEDIATE_QUIT_CHECK):
5876 * sysdep.c (emacs_sigaction_init) [SA_RESTART]:
5877 (emacs_write):
5878 * xterm.c (XTread_socket):
5879 Assume SYNC_INPUT.
5880 * conf_post.h (SA_RESTART) [IRIX6_5]: Do not #undef.
5881 * eval.c (handling_signal): Remove. All uses removed.
5882 * lisp.h (ELSE_PENDING_SIGNALS): Remove.
5883 All uses replaced with the SYNC_INPUT version.
5884 (reset_malloc_hooks, uninterrupt_malloc, handling_signal):
5885 Remove decls.
5886 * sysdep.c, syssignal.h (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
5887 Now static.
5888
634b8cac
PE
5889 * font.c (Ffont_shape_gstring): Remove unused local.
5890
83da1b55
GM
58912012-09-16 Glenn Morris <rgm@gnu.org>
5892
518650a5
GM
5893 * Makefile.in (clean): No longer run nextstep's clean.
5894
83da1b55
GM
5895 * Makefile.in (ns_appdir, ns_appbindir, ns_appsrc): Remove variables.
5896 (ns_frag): Remove.
5897 (ns-app): Move here from ns.mk, and simplify.
5898 (clean): Simplify nextstep entry.
5899 * ns.mk: Remove file.
5900
85a43e2e
KH
59012012-09-17 Kenichi Handa <handa@gnu.org>
5902
5903 * font.c (Ffont_shape_gstring): Fix previous change; GLYPHs may
5904 not covert the last few charactes.
5905
ba13e616 59062012-09-16 Kenichi Handa <handa@gnu.org>
ea964864
KH
5907
5908 * font.c (Ffont_shape_gstring): Don't adjust grapheme cluster
5909 here, but just check the validity of glyphs in the glyph-string.
5910
a8c729af
MR
59112012-09-16 Martin Rudalics <rudalics@gmx.at>
5912
3a880af4
SM
5913 * window.c (Fwindow_parameter, Fset_window_parameter):
5914 Accept any window as argument (Bug#12452).
a8c729af 5915
c077c059
JD
59162012-09-16 Jan Djärv <jan.h.d@swipnet.se>
5917
5918 * nsfns.m (Fx_open_connection): Move initialization of ns_*_types
5919 to ns_term_init to avoid memory leak.
5920
5921 * nsterm.m (ns_update_begin): Initialize bp after lcokFocus, use
5922 explicit retain/release.
5923 (ns_term_init): Only allow one display. Initialize outerpool and
5924 ns_*_types.
5925
39a57ad0
PE
59262012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5927
5928 Port _setjmp fix to POSIXish hosts as well as Microsoft.
5929 * image.c (_setjmp) [!HAVE__SETJMP]: Restore definition, as
5930 it's needed on POSIXish hosts that lack _setjmp. Attempt to solve
5931 the Microsoft problem in a different way, by altering ../nt/config.nt.
5932
7105c8cb
EZ
59332012-09-15 Eli Zaretskii <eliz@gnu.org>
5934
5935 * w32xfns.c:
5936 * w32uniscribe.c:
5937 * w32term.c:
5938 * w32select.c:
5939 * w32reg.c:
5940 * w32proc.c:
5941 * w32menu.c:
5942 * w32inevt.c:
5943 * w32heap.c:
5944 * w32font.c:
5945 * w32fns.c:
5946 * w32console.c:
5947 * w32.c:
5948 * w16select.c: Remove inclusion of setjmp.h, as it is now included
5949 by lisp.h. This completes removal of setjmp.h inclusion
5950 erroneously announced in the previous commit. (Bug#12446)
5951
5952 * lisp.h [!HAVE__SETJMP, !HAVE_SIGSETJMP]: Make the commentary
5953 more accurate.
5954
5955 * image.c (_setjmp) [!HAVE__SETJMP]: Define only if 'setjmp' is
5956 not defined as a macro. The latter happens on MS-Windows.
5957 (Bug#12446)
5958
0328b6de
PE
59592012-09-15 Paul Eggert <eggert@cs.ucla.edu>
5960
5961 Port better to POSIX hosts lacking _setjmp (Bug#12446).
5962 * lisp.h: Include <setjmp.h> here, since we use its symbols here.
7105c8cb 5963 Some instances of '#include <setjmp.h>' removed, if the
0328b6de
PE
5964 only reason for the instance was because "lisp.h" was included.
5965 (sys_jmp_buf, sys_setjmp, sys_longjmp): New symbols.
5966 Unless otherwise specified, replace all uses of jmp_buf, _setjmp,
5967 and _longjmp with the new symbols. Emacs already uses _setjmp if
5968 available, so this change affects only POSIXish hosts that have
5969 sigsetjmp but not _setjmp, such as some versions of Solaris and
5970 Unixware. (Also, POSIX-2008 marks _setjmp as obsolescent.)
5971 * image.c (_setjmp, _longjmp) [HAVE_PNG && !HAVE__SETJMP]: New macros.
5972 (png_load_body) [HAVE_PNG]:
5973 (PNG_LONGJMP) [HAVE_PNG && PNG_LIBPNG_VER < 10500]:
5974 (PNG_JMPBUF) [HAVE_PNG && PNG_LIBPNG_VER >= 10500]:
5975 Use _setjmp and _longjmp rather than sys_setjmp and sys_longjmp,
5976 since PNG requires jmp_buf. This is the only exception to the
5977 general rule that we now use sys_setjmp and sys_longjmp.
5978 This exception is OK since this code does not change the signal
5979 mask or longjmp out of a signal handler.
5980
2af03429
PE
59812012-09-14 Paul Eggert <eggert@cs.ucla.edu>
5982
5983 * alloc.c [!SYSTEM_MALLOC && !SYNC_INPUT && HAVE_PTHREAD]:
5984 Include "syssignal.h", for 'main_thread'.
5985
2f294edf
DA
59862012-09-14 Dmitry Antipov <dmantipov@yandex.ru>
5987
5988 Avoid out-of-range marker position (Bug#12426).
3a880af4
SM
5989 * insdel.c (replace_range, replace_range_2):
5990 Adjust markers before overlays, as suggested by comments.
2f294edf
DA
5991 (insert_1_both, insert_from_buffer_1, adjust_after_replace):
5992 Remove redundant check before calling offset_intervals.
5993
6b533e9c
MR
59942012-09-14 Martin Rudalics <rudalics@gmx.at>
5995
5996 * xdisp.c (Fformat_mode_line): Unconditionally save/restore
5997 current buffer (Bug#12387).
5998
2a7931e3
JB
59992012-09-14 Juanma Barranquero <lekktu@gmail.com>
6000
6001 * makefile.w32-in ($(BLD)/alloc.$(O)): Update dependencies.
6002
c18e885b
PE
60032012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 Use a more backwards-compatible timer format (Bug#12430).
6006 * keyboard.c (decode_timer): Get PSECS from the 8th (origin-0)
6007 vector element, not from the 4th, since PSECS is now at the end.
6008 (Fcurrent_idle_time): Doc fix.
6009
d59a1afb
DA
60102012-09-13 Dmitry Antipov <dmantipov@yandex.ru>
6011
6012 Function to mark objects and remove killed buffers at once.
6013 * alloc.c (discard_killed_buffers): Rename to ...
6014 (mark_discard_killed buffers) ... new name. Add marking
6015 of remaining objects. Fix comment. Adjust users.
6016 (mark_object): Do not touch frame buffer lists here.
6017 * frame.c (delete_frame): Reset frame buffer lists here.
6018
5f0cb45a
PE
60192012-09-13 Paul Eggert <eggert@cs.ucla.edu>
6020
8ea47e3a
PE
6021 Better workaround for GNOME bug when --enable-gcc-warnings.
6022 * emacsgtkfixed.c (G_STATIC_ASSERT): Remove, undoing last change.
6023 Instead, disable -Wunused-local-typedefs. See Dmitry Antipov in
6024 <http://lists.gnu.org/archive/html/emacs-devel/2012-09/msg00335.html>.
6025
4a4bbad2
PE
6026 Simplify SIGIO usage (Bug#12408).
6027 The code that dealt with SIGIO was crufty and confusing, e.g., it
6028 played tricks like "#undef SIGIO" but these tricks were not used
6029 consistently. Simplify mostly by not #undeffing standard symbols,
6030 e.g., use "defined USABLE_SIGIO" (our symbol, which we can define
6031 or not as we please) rather than "defined SIGIO" (standard symbol
6032 that we probably shouldn't #undef).
6033 * conf_post.h [USG5_4]: Do not include <sys/wait.h> here.
6034 Modules that need it can include it.
6035 [USG5_4 && emacs]: Likewise, do not include the streams stuff here.
6036 * dispextern.h (ignore_sigio): New decl.
6037 * emacs.c (shut_down_emacs): Invoke unrequest_sigio
6038 unconditionally, since it's now a no-op if !USABLE_SIGIO.
6039 * emacs.c (shut_down_emacs):
6040 * keyboard.c (kbd_buffer_store_event_hold):
6041 Use ignore_sigio rather than invoking 'signal' directly.
6042 * keyboard.c (USABLE_FIONREAD && USG5_4): Include <sys/filio.h>,
6043 for FIONREAD.
6044 (FIONREAD, SIGIO): Do not #undef.
6045 (tty_read_avail_input): Use #error rather than a syntax error.
6046 * process.c [USG5_4]: Include <sys/stream.h> and <sys/stropts.h>,
6047 for I_PIPE, used by SETUP_SLAVE_PTY.
6048 (DATAGRAM_SOCKETS): Simplify defn, based on USABLE_FIONREAD.
6049 * sysdep.c (croak): Remove; no longer needed. This bit of
6050 temporary code, with Fred N. Fish's comment that it's temporary,
6051 has been in Emacs since at least 1992!
6052 (init_sigio, reset_sigio, request_sigio, unrequest_sigio):
6053 Arrange for them to be no-ops in all cases when ! USABLE_SIGIO.
6054 * syssignal.h (croak): Remove decl.
6055 (SIGIO, SIGPOO, SIGAIO, SIGPTY): Do not #undef; that's too fragile.
6056 * systty.h [!NO_TERMIO]: Do not include <termio.h>; no longer needed
6057 now that we're termios-only.
6058 (FIONREAD, ASYNC) [BROKEN_FIONREAD]: Do not #undef.
6059 * term.c (dissociate_if_controlling_tty): Use #error rather than
6060 a run-time error.
6061
5f0cb45a
PE
6062 Work around GCC and GNOME bugs when --enable-gcc-warnings.
6063 * emacsgtkfixed.c (G_STATIC_ASSERT): Redefine to use 'verify',
6064 to work around GNOME bug 683906.
6065 * image.c (jpeg_load_body) [HAVE_JPEG && lint]: Pacify gcc -Wclobber.
6066 (struct my_jpeg_error_mgr) [HAVE_JPEG && lint]: New member fp.
6067 This works around GCC bug 54561.
6068
40bce90b
PE
60692012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6070
6071 More fixes for 'volatile' and setjmp/longjmp.
6072 * eval.c (Fdefvar, Fcondition_case): Remove unnecessary 'volatile's.
6073 * image.c (struct png_load_context) [HAVE_PNG]: New type.
6074 (png_load_body) [HAVE_PNG]:
6075 (jpeg_load_body) [HAVE_JPEG]:
6076 New function, with most of the old parent function's body.
6077 (png_load) [HAVE_PNG]:
6078 (jpeg_load) [HAVE_JPEG]:
6079 Invoke the new function, to avoid longjmp munging our locals.
6080 (struct my_jpeg_error_mgr) [HAVE_JPEG]: New members cinfo, failure_code.
6081 (my_error_exit) [HAVE_JPEG]: Don't trust 'setjmp' to return 2 when
6082 longjmp is passed 2, as the C standard doesn't guarantee this.
6083 Instead, store the failure code into mgr->failure_code.
6084
bfeae2cf
SM
60852012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6086
6087 * keyboard.c (read_char, requeued_events_pending_p, Finput_pending_p)
6088 (Fdiscard_input, quit_throw_to_read_char, init_keyboard)
6089 (syms_of_keyboard): Remove support for unread-command-char.
6090
8099e36b
EZ
60912012-09-12 Eli Zaretskii <eliz@gnu.org>
6092
6093 * w32proc.c (sys_kill): If PID is our process ID and the signal is
6094 SIGABRT, call emacs_abort. Avoids silently exiting upon assertion
6095 violation. (Bug#12426)
6096
92547ff9
PE
60972012-09-12 Paul Eggert <eggert@cs.ucla.edu>
6098
6099 * image.c (jpeg_memory_src): Don't assume string len fits in unsigned.
6100
45b82ad0
SM
61012012-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
6102
6103 * eval.c: Add `inhibit-debugger'.
6104 (Qinhibit_debugger): New symbol.
6105 (call_debugger): Bind it instead of Qdebug_on_error.
6106 (maybe_call_debugger): Test Vinhibit_debugger.
6107 (syms_of_eval): Define inhibit-debugger.
6108 * xdisp.c (set_message): Don't bind Qinhibit_debug_on_message.
6109 (syms_of_xdisp): Remove inhibit-debug-on-message.
6110
5779a1dc
PE
61112012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6112
50f2e553
PE
6113 Avoid _setjmp/_longjmp problems with local nonvolatile variables.
6114 If a nonvolatile local variable is written before a _longjmp to
6115 the frame containing the variable, and is read after the _longjmp,
6116 the value read is indeterminate. Some local variables of type
6117 'struct handler' and 'struct catchtag' are used in this way, so
6118 mark each of their slots as volatile if the slot can be set before
6119 _longjmp and read afterwards.
6120 * lisp.h (struct handler): var and chosen_clause are now volatile.
6121 (struct catchtag): val, next, and pdlcount are now volatile.
6122
ae1d87e2
PE
6123 * bidi.c (bidi_push_it, bidi_pop_it):
6124 * fns.c (copy_hash_table):
6125 * image.c (define_image_type):
6126 * keyboard.c (kbd_buffer_store_event_hold):
6127 * process.c (Fprocess_send_eof):
6128 * xfaces.c (x_create_gc) [HAVE_NS]:
6129 * xgselect.c (xg_select):
6130 Prefer assignment to memcpy when either will do.
6131
5779a1dc
PE
6132 * alloc.c (discard_killed_buffers): Tune and simplify a bit.
6133 Use pointer-to-a-pointer to simplify and avoid a NILP check each
6134 time an item is removed. No need to mark this function 'inline';
6135 the compiler knows better than we do.
6136
c4c9756b
JD
61372012-09-11 Jan Djärv <jan.h.d@swipnet.se>
6138
6139 * nsterm.m (ns_judge_scroll_bars): Pass NO to updateFrameSize.
6140 (updateFrameSize:): Add delay parameter to updateFrameSize, send it
6141 to change_frame_size (Bug#12388).
6142 (windowDidResize:): Pass YES to updateFrameSize.
6143
6144 * nsterm.h: Add delay parameter to updateFrameSize.
6145
d73e321c
DA
61462012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6147
6148 Discard killed buffers from deleted window and frame objects.
6149 This reduces an amount of references to killed buffers and
6150 helps GC to reclaim them faster.
6151 * alloc.c (discard_killed_buffers): New function.
6152 (mark_object): Use it for deleted windows and frames.
6153 (mark_object): If symbol's value is set up for a killed buffer
1f9f395d 6154 or deleted frame, restore its global binding.
d73e321c
DA
6155 * data.c (swap_in_global_binding): Add GC notice.
6156 (swap_in_symval_forwarding): Use convenient set_blv_where.
6157 * window.c (wset_next_buffers, wset_prev_buffers): Move ...
6158 * window.h: ... to here.
6159
e578f381
DA
61602012-09-11 Dmitry Antipov <dmantipov@yandex.ru>
6161
6162 Convenient macro to check whether the buffer is live.
6163 * buffer.h (BUFFER_LIVE_P): New macro.
6164 * alloc.c, buffer.c, editfns.c, insdel.c, lread.c, marker.c:
6165 * minibuf.c, print.c, process.c, window.c, xdisp.c: Use it.
6166
3057e615
YM
61672012-09-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
6168
6169 * xdisp.c (right_overwritten, right_overwriting): Also handle gstring
6170 composition cases (Bug#12364).
6171
6172 * xterm.c (x_draw_glyph_string): Avoid overwriting inverted left
6173 overhang of succeeding glyphs overlapping box cursor.
6174
6175 * w32term.c (x_draw_glyph_string): Likewise.
6176
6fda35f2
PE
61772012-09-11 Paul Eggert <eggert@cs.ucla.edu>
6178
c990426a
PE
6179 Simplify, document, and port floating-point (Bug#12381).
6180 The porting part of this patch fixes bugs on non-IEEE platforms
6181 with frexp, ldexp, logb.
6182 * data.c, lisp.h (Qdomain_error, Qsingularity_error, Qunderflow_error):
6183 Now static.
6184 * floatfns.c: Simplify discussion of functions that Emacs doesn't
6185 support, by removing commented-out code and briefly listing the
6186 C89 functions excluded. The commented-out stuff was confusing
6187 maintenance, e.g., we thought we needed cbrt but it was commented out.
6188 (logb): Remove decl; no longer needed.
6189 (isfinite): New macro, if not already supplied.
6190 (isnan): Don't replace any existing macro.
6191 (Ffrexp, Fldexp): Define even if !HAVE_COPYSIGN, as frexp and ldexp
6192 are present on all C89 platforms.
6193 (Ffrexp): Do not special-case zero, as frexp does the right thing
6194 for that case.
6195 (Flogb): Do not use logb, as it doesn't have the desired meaning
6196 on hosts that use non-base-2 floating point. Instead, stick with
6197 frexp, which is C89 anyway. Do not pass an infinity or a NaN to
6198 frexp, to avoid getting an unspecified result.
6199
6fda35f2
PE
6200 * xdisp.c (Qinhibit_debug_on_message): Now static.
6201
16130a58
JD
62022012-09-10 Jan Djärv <jan.h.d@swipnet.se>
6203
6204 * nsterm.m (ns_update_begin): Set clip path to whole view by using
6205 NSBezierPath (Bug#12131).
6206
d105a573
CY
62072012-09-10 Chong Yidong <cyd@gnu.org>
6208
6209 * fns.c (Fdelq, Fdelete): Doc fix.
6210
ff55dfe8
PE
62112012-09-10 Paul Eggert <eggert@cs.ucla.edu>
6212
6213 * lisp.h (XSETINT, XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL)
6214 (XSETFLOAT, XSETMISC): Parenthesize macro bodies.
6215
e7032e7c
SM
62162012-09-09 Stefan Monnier <monnier@iro.umontreal.ca>
6217
6218 * lisp.h (make_lisp_ptr): New macro to replace XSET.
6219 (XSETCONS, XSETVECTOR, XSETSTRING, XSETSYMBOL, XSETFLOAT, XSETMISC):
6220 Use it.
6221
e9957956
EZ
62222012-09-09 Eli Zaretskii <eliz@gnu.org>
6223
aba05ce9
EZ
6224 * fringe.c (draw_fringe_bitmap_1): Don't reduce the width of the
6225 left fringe if the window has a left margin. This avoids leaving
6226 traces of the cursor because its leftmost pixel is not drawn over.
6227
e9957956
EZ
6228 * dispnew.c (update_window_line): When the left margin area of a
6229 screen line is updated, set the redraw_fringe_bitmaps_p flag of
6230 that screen line. (Bug#12277)
6231
f6196b87
PE
62322012-09-09 Paul Eggert <eggert@cs.ucla.edu>
6233
6234 Assume C89 or later for math functions (Bug#12381).
6235 This simplifies the code, and makes it a bit smaller and faster,
6236 and (most important) makes it easier to clean up signal handling
6237 since we can stop worring about floating-point exceptions in
6238 library code. That was a problem before C89, but the problem
6239 went away many years ago on all practical Emacs targets.
6240 * data.c, image.c, lread.c, print.c:
6241 Don't include <math.h>; no longer needed.
6242 * data.c, floatfns.c (IEEE_FLOATING_POINT): Don't worry that it
6243 might be autoconfigured, as that never happens.
6244 * data.c (fmod):
6245 * doprnt.c (DBL_MAX_10_EXP):
6246 * print.c (DBL_DIG):
6247 Remove. C89 or later always defines these.
6248 * floatfns.c (HAVE_MATHERR, FLOAT_CHECK_ERRNO, FLOAT_CHECK_DOMAIN)
6249 (in_float, float_error_arg, float_error_arg2, float_error_fn_name)
6250 (arith_error, domain_error, domain_error2):
6251 Remove all this pre-C89 cruft. Do not include <errno.h> as that's
6252 no longer needed -- we simply return what C returns. All uses removed.
6253 (IN_FLOAT, IN_FLOAT2): Remove. All uses replaced with
6254 the wrapped code.
6255 (FLOAT_TO_INT, FLOAT_TO_INT2, range_error, range_error2):
6256 Remove. All uses expanded, as these macros are no longer used
6257 more than once and are now more trouble than they're worth.
6258 (Ftan): Use tan, not sin / cos.
6259 (Flogb): Assume C89 frexp.
6260 (fmod_float): Assume C89 fmod.
6261 (matherr) [HAVE_MATHERR]: Remove; no longer needed.
6262 (init_floatfns): Remove. All uses removed.
6263
9d7f1863
JD
62642012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6265
6266 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Take back
6267 compositeToPoint for OSX < 10.6 (Bug#12390).
6268
eabf0404
PE
62692012-09-08 Paul Eggert <eggert@cs.ucla.edu>
6270
6271 * floatfns.c (Ftan): Use tan (x), not (sin (x) / cos (x)).
6272 This produces more-accurate results.
6273
0b3b1d23
JD
62742012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6275
6276 * nsterm.m (updateFrameSize): Call setFrame: on the view when size
6277 changes (Bug#12088).
6278
6dcef6ec
CY
62792012-09-08 Chong Yidong <cyd@gnu.org>
6280
6281 * syntax.c (Fstring_to_syntax): Doc fix.
6282
aa7d57c5
JD
62832012-09-08 Jan Djärv <jan.h.d@swipnet.se>
6284
6285 * nsterm.m (ns_clip_to_row): Remove code that deals with drawing fringe
6286 in the internal border.
6287 (x_set_window_size): Remove static variables and their usage.
6288 (ns_redraw_scroll_bars): Fix NSTRACE arg.
3a880af4
SM
6289 (ns_after_update_window_line, ns_draw_fringe_bitmap):
6290 Remove fringe/internal border adjustment (Bug#11052).
aa7d57c5
JD
6291 (ns_draw_fringe_bitmap): Make code more like other terms (xterm.c).
6292 (ns_draw_window_cursor): Remove fringe/internal border adjustment.
6293 (ns_fix_rect_ibw): Remove.
6294 (ns_get_glyph_string_clip_rect): Remove call to ns_fix_rect_ibw.
6295 (ns_dumpglyphs_box_or_relief): Ditto.
6296 (ns_maybe_dumpglyphs_background): Remove fringe/internal border
6297 adjustment.
6298 (ns_dumpglyphs_image): Ditto.
fc0c31f8 6299 (ns_dumpglyphs_stretch): Fix coding style. Remove fringe/internal
aa7d57c5
JD
6300 border adjustment.
6301 (ns_set_vertical_scroll_bar): Remove variables barOnVeryLeft/Right and
6302 their usage. Add fringe_extended_p and its use as in other terms.
6303 (ns_judge_scroll_bars): Code style fix. Call updateFrameSize if
6304 scroll bar was removed.
6305 (updateFrameSize): New function.
6306 (windowDidResize): Move code to updateFrameSize and call it.
6307
6308 * nsterm.h (EmacsView): Add updateFrameSize.
6309
1a5432bc
CY
63102012-09-07 Chong Yidong <cyd@gnu.org>
6311
b4f5313e
CY
6312 * textprop.c (Fget_text_property): Minor doc fix (Bug#12323).
6313
1a5432bc
CY
6314 * data.c (Flocal_variable_if_set_p): Doc fix (Bug#10713).
6315
1a4f1e9b
PE
63162012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6317
6318 More signal-handler cleanup (Bug#12327).
eddb36a7
PE
6319 * emacs.c (main): Convert three 'signal' calls to 'sigaction' calls.
6320 Problem introduced when merging patches. Noted by Eli Zaretskii in
6321 <http://bugs.gnu.org/12327#67>.
1a4f1e9b
PE
6322 * floatfns.c: Comment fix.
6323 * lisp.h (force_auto_save_soon): Declare regardless of SIGDANGER.
6324 SIGDANGER might not be in scope so "#ifdef SIGDANGER" is not right,
6325 and anyway the declaration is harmless even if SIGDANGER is not defined.
6326 * syssignal.h (SIGIO): Also #undef if (! defined FIONREAD ||
6327 defined BROKEN_FIONREAD). systty.h formerly did this, but other
6328 source files not surprisingly expected syssignal.h to define, or
6329 not define, SIGIO, and it's cleaner to do it that way, for consistency.
6330 Include <sys/ioctl.h>, for FIONREAD.
6331 * systty.h (SIGIO): Do not #undef here; it's now syssignal.h's job.
6332 This eliminates a problem whereby other files mysteriously had
6333 to include "syssignal.h" before including "systty.h" if they
6334 wanted to use "#ifdef SIGIO".
6335
bc8000ff
EZ
63362012-09-07 Eli Zaretskii <eliz@gnu.org>
6337
3e6d6928
EZ
6338 * w32proc.c (sigaction): New function, emulates Posix 'sigaction'.
6339
6340 * w32.c (sigemptyset): Empty the set.
6341 (sigsetmask, sigmask, sigblock, sigunblock): Remove unused functions.
6342
bc8000ff
EZ
6343 * alloc.c [ENABLE_CHECKING]: Include signal.h, since we need SIGABRT.
6344
b4fa72f2
DA
63452012-09-07 Dmitry Antipov <dmantipov@yandex.ru>
6346
6347 * alloc.c (mark_buffer): Revert unsafe marking optimization.
6348 (mark_object): Likewise for frame objects.
6349
30730c93
PE
63502012-09-07 Paul Eggert <eggert@cs.ucla.edu>
6351
6352 * syssignal.h (handle_on_main_thread): Always declare,
6353 even if FORWARD_SIGNAL_TO_MAIN_THREAD is not defined.
6354 This ports to platforms without HAVE_PTHREAD.
6355
2fe28299
PE
63562012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6357
6358 Signal-handler cleanup (Bug#12327).
6359 Emacs's signal handlers were written in the old 4.2BSD style with
6360 sigblock and sigmask and so forth, and this led to some
6361 inefficiencies and confusion. Rewrite these to use
6362 pthread_sigmask etc. without copying signal sets around. Also,
6363 get rid of the confusing macros 'SIGNAL_THREAD_CHECK' and
6364 'signal', and instead use functions that do not attempt to take
6365 over the system name space. This patch causes Emacs's text
6366 segment to shrink by 0.7% on my platform, Fedora 17 x86-64.
6367 * alloc.c, emacsgtkfixed.c, nsfns.m, widget.c, xmenu.c:
6368 Do not include <signal.h> or "syssignal.h", as these
6369 modules do not use signals.
6370 * atimer.c, callproc.c, data.c, dispnew.c, emacs.c, floatfns.c:
6371 * gtkutil.c, keyboard.c, process.c, sound.c, sysdep.c, term.c, xterm.c:
6372 Do not include <signal.h>, as "syssignal.h" does that for us now.
6373 * atimer.c (sigmask_atimers): New function.
6374 (block_atimers, unblock_atimers): New functions,
6375 replacing the old macros BLOCK_ATIMERS and UNBLOCK_ATIMERS.
6376 All uses replaced.
6377 * conf_post.h [SIGNAL_H_AHB]: Do not include <signal.h>;
6378 no longer needed here.
6379 * emacs.c (main): Inspect existing signal handler with sigaction,
fc0c31f8 6380 so that there's no need to block and unblock SIGHUP.
2fe28299
PE
6381 * sysdep.c (struct save_signal): New member 'action', replacing
6382 old member 'handler'.
6383 (save_signal_handlers, restore_signal_handlers):
6384 Use sigaction instead of 'signal' to save and restore.
6385 (get_set_sighandler, set_sighandler) [!WINDOWSNT]:
6386 New function. All users of 'signal' modified to use set_sighandler
6387 if they're writeonly, and to use sys_signal if they're read+write.
6388 (emacs_sigaction_init, forwarded_signal): New functions.
6389 (sys_signal): Remove. All uses replaced by calls to sigaction
6390 and emacs_sigaction_init, or by direct calls to 'signal'.
6391 (sys_sigmask) [!__GNUC__]: Remove; no longer needed.
6392 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove;
6393 all uses replaced by pthread_sigmask etc. calls.
6394 * syssignal.h: Include <signal.h>.
6395 (emacs_sigaction_init, forwarded_signal): New decls.
6396 (SIGMASKTYPE): Remove. All uses replaced by its definiens, sigset_t.
6397 (SIGEMPTYMASK): Remove; all uses replaced by its definiens, empty_mask.
6398 (sigmask, sys_sigmask): Remove; no longer needed.
6399 (sigpause): Remove. All uses replaced by its definiens, sigsuspend.
6400 (sigblock, sigunblock, sigfree):
6401 (sigsetmask) [!defined sigsetmask]:
6402 Remove. All uses replaced by pthread_sigmask.
6403 (signal): Remove. Its remaining uses (with SIG_DFL and SIG_IGN)
6404 no longer need to be replaced, and its typical old uses
6405 are now done via emacs_sigaction_init and sigaction.
6406 (sys_sigblock, sys_sigunblock, sys_sigsetmask): Remove decls.
6407 (sys_sigdel): Remove; unused.
6408 (NSIG): Remove a FIXME; the code's fine. Remove an unnecessary ifdef.
6409
0216c128
EZ
64102012-09-06 Eli Zaretskii <eliz@gnu.org>
6411
6412 * process.c (CAN_HANDLE_MULTIPLE_CHILDREN): Fix a typo that broke
6413 SIGCHLD handling on systems that don't have WNOHANG. (Bug#12327)
6414
c752cfa9
DA
64152012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6416
6417 Explicitly mark buffer_defaults and buffer_local_symbols.
6418 * alloc.c (Fgarbage_collect): Mark buffer_defaults and
6419 mark_local_symbols here.
6420 (mark_object): If GC_CHECK_MARKED_OBJECTS, simplify checking
6421 since special buffers aren't marked here any more.
6422 (allocate_buffer): Chain new buffer with all_buffers here...
6423 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer): ...and
6424 not here.
6425 (Vbuffer_defaults, Vbuffer_local_symbols): Remove.
6426 (syms_of_buffer): Remove staticpro of the above.
6427 (init_buffer_once): Set names for buffer_defaults and
6428 buffer_local_symbols.
6429
a864ef14
PE
64302012-09-06 Paul Eggert <eggert@cs.ucla.edu>
6431
6432 Use bool for booleans in font-related modules.
6433 * font.c (font_intern_prop, font_style_to_value)
6434 (font_style_symbolic, font_parse_xlfd, font_parse_fcname)
6435 (generate_otf_features, font_check_otf_features, font_check_otf)
6436 (font_match_p, font_list_entities, font_at):
6437 * fontset.c (fontset_id_valid_p, reorder_font_vector
6438 (fontset_find_font, Fset_fontset_font)
6439 (face_suitable_for_char_p) [0]:
6440 * ftfont.c (fc_initialized, ftfont_get_open_type_spec)
6441 (ftfont_open, ftfont_text_extents, ftfont_check_otf):
6442 (m17n_flt_initialized, ftfont_shape_by_flt):
6443 * ftxfont.c (ftxfont_draw_bitmap, ftxfont_draw):
6444 * nsfont.m (nsfont_draw):
6445 * w32font.c (w32font_draw):
6446 * w32term.c (x_draw_glyphless_glyph_string_foreground):
6447 Use bool for booleans.
6448 * font.h: Adjust to above API changes.
6449 (struct font, struct font_driver, struct font_driver_list):
6450 Use bool for booleans.
6451 (struct font): Remove useless member encoding_type.
6452 All users removed.
6453 * fontset.c, xftfont.c: Omit unnecessary static decls.
6454
0699fc18
DA
64552012-09-06 Dmitry Antipov <dmantipov@yandex.ru>
6456
6457 * alloc.c (mark_object): Revert window marking code
6458 since it's unsafe for the Fset_window_configuration.
6459
20ef56db
PE
64602012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6461
2fe28299 6462 Fix race conditions with signal handlers and errno (Bug#12327).
20ef56db
PE
6463 Be more systematic about preserving errno whenever a signal
6464 handler returns, even if it's not in the main thread. Do this by
6465 renaming signal handlers to distinguish between signal delivery
6466 and signal handling. All uses changed.
6467 * atimer.c (deliver_alarm_signal): Rename from alarm_signal_handler.
6468 * data.c (deliver_arith_signal): Rename from arith_error.
6469 * dispnew.c (deliver_window_change_signal): Rename from
6470 window_change_signal.
6471 * emacs.c (deliver_error_signal): Rename from fatal_error_signal.
6472 (deliver_danger_signal) [SIGDANGER]: Rename from memory_warning_signal.
6473 * keyboard.c (deliver_input_available_signal): Rename from
6474 input_available_signal.
6475 (deliver_user_signal): Rename from handle_user_signal.
6476 (deliver_interrupt_signal): Rename from interrupt_signal.
6477 * process.c (deliver_pipe_signal): Rename from send_process_trap.
6478 (deliver_child_signal): Rename from sigchld_handler.
6479 * atimer.c (handle_alarm_signal):
6480 * data.c (handle_arith_signal):
6481 * dispnew.c (handle_window_change_signal):
6482 * emacs.c (handle_fatal_signal, handle_danger_signal):
6483 * keyboard.c (handle_input_available_signal):
6484 * keyboard.c (handle_user_signal, handle_interrupt_signal):
6485 * process.c (handle_pipe_signal, handle_child_signal):
6486 New functions, with the actual signal-handling code taken from the
6487 original respective signal handlers, sans the sporadic attempts to
6488 preserve errno, since that's now done by handle_on_main_thread.
6489 * atimer.c (alarm_signal_handler): Remove unnecessary decl.
6490 * emacs.c, floatfns.c, lisp.h: Remove unused FLOAT_CATCH_SIGKILL cruft.
6491 * emacs.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6492 Move to sysdep.c.
6493 (main) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6494 Move initialization of main_thread to sysdep.c's init_signals.
6495 * process.c (waitpid) [!WNOHANG]: #define to wait; that's good enough for
6496 our usage, and simplifies the mainline code.
6497 (record_child_status_change): New static function, as a helper
6498 for handle_child_signal, and with most of the old child handler's
6499 contents.
6500 (CAN_HANDLE_MULTIPLE_CHILDREN): New constant.
6501 (handle_child_signal): Use the above.
6502 * sysdep.c (main_thread) [FORWARD_SIGNAL_TO_MAIN_THREAD]:
6503 Moved here from emacs.c.
6504 (init_signals) [FORWARD_SIGNAL_TO_MAIN_THREAD]: Initialize it;
6505 code moved here from emacs.c's main function.
6506 * sysdep.c, syssignal.h (handle_on_main_thread): New function,
3a880af4
SM
6507 replacing the old SIGNAL_THREAD_CHECK. All uses changed.
6508 This lets callers save and restore errno properly.
20ef56db 6509
e3ccf108
DA
65102012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6511
6512 Remove redundant or unused things here and there.
6513 * lisp.h (CYCLE_CHECK, CHAR_TABLE_TRANSLATE): Remove.
6514 * conf_post.h (RE_TRANSLATE): Use char_table_translate.
6515 * editfns.c (Fcompare_buffer_substrings): Likewise.
6516 * frame.h (struct terminal, struct font_driver_list):
6517 Remove redundant declarations.
6518 * window.h (Qleft, Qright): Likewise.
6519
697e1e39
DA
65202012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6521
6522 Do not mark objects from deleted buffers, windows and frames.
6523 * alloc.c (mark_buffer): Mark just the buffer if it is dead.
6524 (mark_object): Likewise for windows and frames.
6525
c1ca42ca
DA
65262012-09-05 Dmitry Antipov <dmantipov@yandex.ru>
6527
6528 * alloc.c (valid_lisp_object_p): Treat killed buffers,
6529 buffer_defaults and buffer_local_symbols as valid objects.
6530 Return special value to denote them.
6531
014d93be
PE
65322012-09-05 Paul Eggert <eggert@cs.ucla.edu>
6533
f75d7a91
PE
6534 * fileio.c, filelock.c, floatfns.c, fns.c: Use bool for boolean.
6535 * fileio.c (auto_saving, auto_save_error_occurred, make_temp_name)
6536 (Fexpand_file_name, barf_or_query_if_file_exists, Fcopy_file)
6537 (file_name_absolute_p, Fsubstitute_in_file_name):
6538 (check_executable, check_writable, Ffile_accessible_directory_p)
6539 (Fset_file_selinux_context, Fdefault_file_modes)
6540 (Finsert_file_contents, choose_write_coding_system)
6541 (Fwrite_region, build_annotations, a_write, e_write)
6542 (Fdo_auto_save):
6543 * filelock.c (boot_time_initialized, get_boot_time)
6544 (get_boot_time_1, lock_file_1, within_one_second):
6545 * floatfns.c (in_float):
6546 * fns.c (concat, internal_equal, Frequire, base64_encode_1)
6547 (base64_decode_1, cmpfn_eql, cmpfn_user_defined)
6548 (sweep_weak_table, sweep_weak_hash_tables, secure_hash):
6549 * lisp.h (struct Lisp_Hash_Table.cmpfn):
6550 * window.c (compare_window_configurations):
6551 Use bool for booleans.
6552 * fileio.c (auto_saving_dir_umask, auto_saving_mode_bits)
6553 (Fdefault_file_modes): Now mode_t, not int, for modes.
6554 (Fdo_auto_save): Set a boolean to 1 rather than using ++.
6555 (internal_delete_file): Now returns void, not a (boolean) int,
6556 since nobody was looking at the return value.
6557 * lisp.h, window.h: Adjust to above API changes.
6558
014d93be
PE
6559 * xdisp.c (set_message): Simplify and reindent last change.
6560
776f29e1
JB
65612012-09-05 Juanma Barranquero <lekktu@gmail.com>
6562
6563 * makefile.w32-in ($(BLD)/sysdep.$(O)): Update dependencies.
6564
7f7e0167
LI
65652012-09-04 Lars Ingebrigtsen <larsi@gnus.org>
6566
6567 * eval.c (call_debugger): Make the function non-static so that we
6568 can call it from set_message.
6569
6570 * xdisp.c (set_message): Implement the new variable `debug-on-message'.
6571 (syms_of_xdisp): Defvar it and `inhibit-debug-on-message'.
6572
cf29dd84
PE
65732012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6574
6575 Give more-useful info on a fatal error (Bug#12328).
6576 * alloc.c [ENABLE_CHECKING]: Do not include <execinfo.h>.
6577 (die) [ENABLE_CHECKING]: Call fatal_error_backtrace instead
6578 of doing the work ourselves.
6579 * emacs.c (fatal_error_signal): Let fatal_error_backtrace
6580 do most of the work.
6581 (fatal_error_backtrace): New function, taken from the guts
6582 of the old fatal_error_signal, but with a new option to output
6583 a backtrace.
6584 (shut_down_emacs) [!DOS_NT]: Use strsignal to give more-useful
6585 info about the signal than just its number.
6586 * lisp.h (fatal_error_backtrace, emacs_backtrace): New decls.
6587 * sysdep.c: Include <execinfo.h>
6588 (emacs_backtrace): New function, taken partly from the previous
6589 code of the 'die' function.
6590 (emacs_abort): Call fatal_error_backtrace rather than abort.
6591
972debf2
SM
65922012-09-04 Stefan Monnier <monnier@iro.umontreal.ca>
6593
6594 * lread.c (readevalloop): Call internal-macroexpand-for-load to perform
6595 eager (load-time) macro-expansion.
6596 * lisp.mk (lisp): Add macroexp.
6597
1088b922
PE
65982012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6599
6600 Simplify redefinition of 'abort' (Bug#12316).
6601 Do not try to redefine the 'abort' function. Instead, redo
6602 the code so that it calls 'emacs_abort' rather than 'abort'.
6603 This removes the need for the NO_ABORT configure-time macro
6604 and makes it easier to change the abort code to do a backtrace.
6605 * .gdbinit: Just stop at emacs_abort, not at w32_abort or abort.
6606 * emacs.c (abort) [!DOS_NT && !NO_ABORT]:
6607 Remove; sysdep.c's emacs_abort now takes its place.
6608 * lisp.h (emacs_abort): New decl. All calls from Emacs code to
6609 'abort' changed to use 'emacs_abort'.
6610 * msdos.c (dos_abort) [defined abort]: Remove; not used.
6611 (abort) [!defined abort]: Rename to ...
6612 (emacs_abort): ... new name.
6613 * sysdep.c (emacs_abort) [!HAVE_NTGUI]: New function, taking
6614 the place of the old 'abort' in emacs.c.
6615 * w32.c, w32fns.c (abort): Do not #undef.
6616 * w32.c (emacs_abort): Rename from w32_abort.
6617
30934d33
EZ
66182012-09-04 Eli Zaretskii <eliz@gnu.org>
6619
6620 * w32uniscribe.c (uniscribe_shape): Reverse the sign of
6621 offsets[j].dv, since the y axis of the screen coordinates points
6622 down, while the y axis of the font definition coordinates points
6623 up. This fixes display of Arabic diacritics such as KASRA and
6624 KASRATAN. (Bug#11860)
6625
af26b72c
PE
66262012-09-04 Paul Eggert <eggert@cs.ucla.edu>
6627
6628 Be more systematic about _setjmp vs setjmp.
6629 * alloc.c (test_setjmp, mark_stack):
6630 * image.c (PNG_LONGJMP) [PNG_LIBPNG_VER < 10500]:
6631 (PNG_JMPBUF) [! (PNG_LIBPNG_VER < 10500)]:
6632 (png_load, my_error_exit, jpeg_load):
6633 * process.c (send_process_trap, send_process):
6634 Uniformly prefer _setjmp and _longjmp to setjmp and longjmp.
6635 The underscored versions are up to 30x faster on some hosts.
6636 Formerly, the code used setjmp+longjmp sometimes and
6637 _setjmp+_longjmp at other times, with no particular reason to
6638 prefer setjmp+longjmp.
6639
26d4541d
PE
66402012-09-03 Paul Eggert <eggert@cs.ucla.edu>
6641
d42f4f0f 6642 Fix minor problem found by static checking.
26d4541d 6643 * buffer.c (Fdelete_all_overlays): Return nil.
26d4541d 6644
c5e28e39
MR
66452012-09-03 Martin Rudalics <rudalics@gmx.at>
6646
6647 * buffer.c (Fdelete_all_overlays): New function.
6648
3eab3ca9
CY
66492012-09-03 Chong Yidong <cyd@gnu.org>
6650
6651 * gtkutil.c: Add extern decl for Qxft.
6652
c04889f8
PE
66532012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6654
1882aa38
PE
6655 * emacs.c, eval.c: Use bool for boolean.
6656 * emacs.c (initialized, inhibit_window_system, running_asynch_code):
6657 (malloc_using_checking) [DOUG_LEA_MALLOC]:
6658 (display_arg) [HAVE_X_WINDOWS || HAVE_NS]:
6659 (noninteractive, no_site_lisp, fatal_error_in_progress, argmatch)
6660 (main, decode_env_path, Fdaemon_initialized):
6661 * eval.c (call_debugger, Finteractive_p, interactive_p):
6662 (unwind_to_catch, Fsignal, wants_debugger, skip_debugger)
6663 (maybe_call_debugger, Fbacktrace):
6664 * process.c (read_process_output, exec_sentinel):
6665 Use bool for booleans.
6666 * emacs.c (shut_down_emacs): Omit unused boolean argument NO_X.
6667 All callers changed.
6668 * eval.c (interactive_p): Omit always-true boolean argument
6669 EXCLUDE_SUBRS_P. All callers changed.
6670 * dispextern.h, lisp.h: Reflect above API changes.
6671 * firstfile.c (dummy): Use the address of 'main', whose signature
6672 won't change, instead of the address of 'initialize', whose
6673 signature just changed from int to bool.
6674 * lisp.h (fatal_error_in_progress): New decl of boolean, moved here ...
6675 * msdos.c (fatal_error_in_progress): ... from here.
6676 * xdisp.c (redisplaying_p): Now a boolean. Set it to 1 instead
6677 of incrementing it.
6678 (redisplay_internal, unwind_redisplay): Simply clear
6679 REDISPLAYING_P when unwinding, instead of saving its previous,
6680 always-false value and then restoring it.
6681
a411ac43
PE
6682 Clean up some extern decls.
6683 Mostly, this hoists extern decls out of .c files and into .h files.
6684 That way, we're more likely to catch errors if the interfaces change.
6685 * alloc.c [USE_GTK]: Include "gtkutil.h" so that we need not
6686 declare xg_mark_data.
6687 * dispextern.h (x_frame_parm_handlers):
6688 * font.h (Qxft):
6689 * lisp.h (Qlexical_binding, Qinternal_interpreter_environment)
6690 (Qextra_light, Qlight, Qsemi_light, Qsemi_bold, Qbold, Qextra_bold)
6691 (Qultra_bold, Qoblique, Qitalic):
6692 Move extern decl here from .c file.
6693 * alloc.c (xg_mark_data) [USE_GTK]:
6694 * doc.c (Qclosure):
6695 * eval.c (Qlexical_binding):
6696 * fns.c (time) [!HAVE_UNISTD_H]:
6697 * gtkutil.c (Qxft, Qnormal, Qextra_light, Qlight, Qsemi_light)
6698 (Qsemi_bold, Qbold, Qextra_bold, Qultra_bold, Qoblique, Qitalic):
6699 * image.c (Vlibrary_cache, QCloaded_from) [HAVE_NTGUI]:
6700 * lread.c (Qinternal_interpreter_environment):
6701 * minibuf.c (Qbuffer):
6702 * process.c (QCfamily, QCfilter):
6703 * widget.c (free_frame_faces):
6704 * xfaces.c (free_frame_menubar) [USE_X_TOOLKIT]:
6705 * xfont.c (x_clear_errors):
6706 * xterm.c (x_frame_parm_handlers):
6707 Remove now-redundant extern decls.
6708 * keyboard.c, keyboard.h (ignore_mouse_drag_p) [USE_GTK || HAVE_NS]:
6709 * xfaces.c (Qultra_light, Qreverse_oblique, Qreverse_italic):
6710 Now static.
6711 * xfaces.c: Remove unnecessary static decls.
6712 * xterm.c (updating_frame): Remove decl of nonexistent object.
6713
c04889f8
PE
6714 * Makefile.in (gl-stamp): Don't scan $(SOME_MACHINE_OBJECTS)
6715 when building globals.h, as the objects that are not built on
6716 this host are not needed to compile C files on this host.
6717
8b339673
JD
67182012-09-02 Jan Djärv <jan.h.d@swipnet.se>
6719
6720 * gtkutil.h: Remove prototype for x_wm_set_size_hint.
6721
6722 * frame.h: Add missing prototype for x_wm_set_size_hint.
6723
a08d4ba7
PE
67242012-09-02 Paul Eggert <eggert@cs.ucla.edu>
6725
6726 * doc.c, editfns.c, insdel.c, intervals.c: Use bool for boolean.
6727 * doc.c (read_bytecode_char, get_doc_string, reread_doc_file)
6728 (Fdocumentation, Fdocumentation_property, Fsnarf_documentation)
6729 (Fsubstitute_command_keys):
6730 * editfns.c (region_limit, find_field, Fconstrain_to_field)
6731 (save_excursion_save, save_excursion_restore)
6732 (disassemble_lisp_time, decode_time_components, emacs_nmemftime)
6733 (format_time_string, general_insert_function)
6734 (make_buffer_string, make_buffer_string_both)
6735 (Fsubst_char_in_region, Ftranslate_region_internal, Fformat):
6736 * insdel.c (check_markers, gap_left, adjust_markers_for_insert)
6737 (copy_text, insert_1, insert_1_both, insert_from_string)
6738 (insert_from_string_before_markers, insert_from_string_1)
6739 (insert_from_buffer, insert_from_buffer_1, replace_range)
6740 (replace_range_2, del_range_1, del_range_byte, del_range_both)
6741 (del_range_2, modify_region):
6742 * intervals.c (intervals_equal, balance_possible_root_interval)
6743 (adjust_intervals_for_insertion, merge_properties_sticky)
6744 (graft_intervals_into_buffer, lookup_char_property)
6745 (adjust_for_invis_intang, set_point_both)
6746 (get_property_and_range, compare_string_intervals)
6747 (set_intervals_multibyte_1, set_intervals_multibyte):
6748 * keyboard.c (decode_timer):
6749 Use bool for boolean.
6750 * intervals.h, lisp.h, systime.h: Reflect above API changes.
6751 * editfns.c (struct info): Use 1-bit unsigned bitfields for booleans.
6752
48c948de
CY
67532012-09-02 Chong Yidong <cyd@gnu.org>
6754
6755 * keymap.c (push_key_description): Print M-TAB as C-M-i
6756 (Bug#11758).
6757
6c49a40b
JB
67582012-09-02 Juanma Barranquero <lekktu@gmail.com>
6759
6760 * makefile.w32-in (CCL_H, W32FONT_H): New macros.
6761 (ATIMER_H, FONT_H, $(BLD)/alloc.$(O), $(BLD)/callproc.$(O))
6762 ($(BLD)/editfns.$(O), $(BLD)/ccl.$(O), $(BLD)/chartab.$(O))
6763 ($(BLD)/coding.$(O), $(BLD)/sysdep.$(O), $(BLD)/fontset.$(O))
6764 ($(BLD)/sysdep.$(O), $(BLD)/w32fns.$(O), $(BLD)/keyboard.$(O))
6765 ($(BLD)/w32term.$(O), $(BLD)/w32menu.$(O), $(BLD)/process.$(O))
6766 ($(BLD)/w32font.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
6767
4dfbd238
EZ
67682012-09-01 Eli Zaretskii <eliz@gnu.org>
6769
7e510e28
EZ
6770 * w32uniscribe.c (uniscribe_shape): Handle correctly the case of
6771 more than one grapheme cluster passed to the shaper: compute the
6772 offset adjustment values separately for each cluster. (Bug#11860)
6773
4dfbd238
EZ
6774 * image.c: Restore mistakenly removed inclusion of w32.h. Without
6775 it, GCC doesn't see prototypes of w32_delayed_load, and complains
6776 about implicit conversions from integer to pointer.
6777
86571ae0
DC
67782012-09-01 Daniel Colascione <dancol@dancol.org>
6779
6780 * w32fns.c (x_display_info_for_name): Prevent crash if w32 window
6781 system used too early.
6782
0e23ef9d
PE
67832012-09-01 Paul Eggert <eggert@cs.ucla.edu>
6784
6785 Better seed support for (random).
6786 * emacs.c (main): Call init_random.
6787 * fns.c (Frandom): Set the seed from a string argument, if given.
6788 Remove long-obsolete Gentzel cruft.
6789 * lisp.h, sysdep.c (seed_random): Now takes address and size, not long.
6790 (init_random): New function.
6791
17a2cbbd
DC
67922012-09-01 Daniel Colascione <dancol@dancol.org>
6793
6794 * xterm.h: Add header guards. Declare x_menubar_window_to_frame.
6795 Remove x_set_frame_alpha, x_bitmap_icon, x_make_frame_visible,
6796 x_make_frame_invisible, x_iconify_frame, x_free_frame_resources,
6797 x_wm_set_size_hint, x_query_colors, x_real_positions,
6798 x_set_menu_bar_lines, x_char_width, x_char_height, x_sync,
6799 x_set_tool_bar_lines, x_activate_menubar, and free_frame_menubar,
6800 all of which have been moved to common code.
6801
6802 * xfaces.c: Include TERM_HEADER instead of listing all possible
6803 window-system headers.
6804
6805 * w32xfns.c (x_sync): Correct definition of x_sync (a no-op here)
6806 to match header.
6807
6808 * w32term.h (FRAME_X_WINDOW): Use FRAME_W32_WINDOW instead of
6809 directly accessing frame internals.
6810
f18cbb28 6811 * w32font.h: Include font.h. Define syms_of_w32font and
17a2cbbd
DC
6812 globals_of_w32font.
6813
6814 * process.c: Include TERM_HEADER instead of listing all possible
6815 window-system headers.
6816
3a880af4
SM
6817 * nsterm.h: Remove declarations now in frame.h.
6818 Define FRAME_X_SCREEN, FRAME_X_VISUAL.
17a2cbbd
DC
6819
6820 * menu.c: Include TERM_HEADER instead of listing all possible
6821 window-system headers.
6822
6823 * keyboard.h: Declare ignore_mouse_drag_p whenever we have a
6824 window system.
6825
6826 * keyboard.c: Include TERM_HEADER instead of listing all possible
6827 window-system headers.
6828
6829 * image.c: Include TERM_HEADER instead of listing all possible
6830 window-system headers. Declare Vlibrary_cache when compiling for
6831 Windows.
6832
6833 * gtkutil.h (xg_list_node_): Include xterm.h to pick up needed
6834 window system declarations.
6835
6836 * frame.h: Move common functions here: set_frame_menubar,
6837 x_set_window_size, x_sync, x_get_focus_frame,
6838 x_set_mouse_position, x_set_mouse_pixel_position,
6839 x_make_frame_visible, x_make_frame_invisible, x_iconify_frame,
6840 x_char_width, x_char_height, x_pixel_width, x_pixel_height,
6841 x_set_frame_alpha, x_set_menu_bar_lines, x_set_tool_bar_lines,
6842 x_activate_menubar, x_real_positions, x_bitmap_icon,
6843 x_set_menu_bar_lines, free_frame_menubar, x_free_frame_resources,
6844 and x_query_colors.
6845
6846 * frame.c: Include TERM_HEADER instead of listing all possible
6847 window-system headers.
6848
6849 * font.c: Include TERM_HEADER instead of listing all possible
6850 window-system headers.
6851
6852 * emacs.c: Include TERM_HEADER.
6853
f18cbb28
EZ
6854 * dispnew.c: Include TERM_HEADER instead of listing all possible
6855 window-system headers.
17a2cbbd 6856
f18cbb28 6857 * ccl.h: Include character.h.
17a2cbbd
DC
6858
6859 * Makefile.in: Define WINDOW_SYSTEM_OBJ to hold objects needed for
6860 the current window system; include in list of objects to link into
6861 Emacs.
6862
c650a5de
DA
68632012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6864
6865 Remove mark_ttys function and fix tty_display_info initialization.
6866 * lisp.h (mark_ttys): Remove prototype.
6867 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6868 to mark_ttys because all possible values of 'top_frame' slot are
6869 the frames which are reachable from Vframe_list.
6870 * term.c (mark_ttys): Remove.
6871 (init_tty): Safely initialize 'top_frame' slot with Qnil.
6872
4e0f6479
DA
68732012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6874
6875 Change struct frame bitfields from unsigned char to unsigned.
6876 * frame.h (struct frame): Change type of 'display_preempted',
6877 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
6878 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
6879 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
6880 bitfields from unsigned char to unsigned.
6881
8b96a52c
DA
68822012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
6883
6884 Remove unused member of struct x_output and struct w32_output.
6885 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
6886 * w32term.h (struct w32_output): Likewise.
6887
b4444c8a
JD
68882012-08-30 Jan Djärv <jan.h.d@swipnet.se>
6889
6890 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
6891 does not become zero (Bug#12234).
6892
b98521db
PE
68932012-08-30 Paul Eggert <eggert@cs.ucla.edu>
6894
6895 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
6896 for GCC 4.7.1 x86-64.
6897
31d02438
GM
68982012-08-30 Glenn Morris <rgm@gnu.org>
6899
6900 * lread.c (init_lread): For out-of-tree builds, only add the
6901 source directory's site-lisp dir to the load-path if it exists,
6902 consistent with in-tree builds. (Bug#12302)
6903
7f8941d8
JD
69042012-08-28 Jan Djärv <jan.h.d@swipnet.se>
6905
6906 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
fc0c31f8 6907 button_values to NULL. Call setStykeMask so dialogs get a close button.
7f8941d8
JD
6908 (windowShouldClose:): Set window_closed.
6909 (dealloc): New member, free button_values.
fc0c31f8
JB
6910 (process_dialog:): Make member function. Remove window argument,
6911 replace window with self. Count buttons and allocate and store values
7f8941d8
JD
6912 in button_values.
6913 (addButton:value:row:): value is int with the name tag. Call setTag
fc0c31f8 6914 with tag. Remove return self, declare return value as void.
7f8941d8
JD
6915 (addString:row:): Remove return self, declare return value as void.
6916 (addSplit): Remove return self, declare return value as void.
6917 (clicked:): Remove return self, declare return value as void.
fc0c31f8 6918 Set dialog_return to button_values[seltag]. Code formatting change.
7f8941d8
JD
6919 (initFromContents:isQuestion:): Adjust call to process_dialog.
6920 Code formatting change.
6921 (timeout_handler:): Set timer_fired to YES.
6922 (runDialogAt:): Set timer_fired to NO.
6923 Handle click on close button as quit.
6924
6925 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
6926 Add window_closed and button_values. Add void as return value for
6927 add(Button|String|Split). addButton takes int instead of Lisp_Object.
6928 Add process_dialog as new member.
6929
eada0861 69302012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 6931
eada0861
GM
6932 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
6933 is not one of the heaps we manage. (Bug#12242)
6934
69352012-08-28 Glenn Morris <rgm@gnu.org>
6936
6937 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
6938
457294dd
MR
69392012-08-28 Martin Rudalics <rudalics@gmx.at>
6940
6941 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
6942 auto-buffer-name window parameter. Install revision of reverted
6943 fix.
457294dd 6944
4f2daf31
DA
69452012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6946
6947 Do not allow to set major mode for a dead buffer.
6948 * buffer.c (Fset_buffer_major_mode): Signal an error
6949 if the buffer is dead.
6950 (Fother_buffer, other_buffer_safely): Remove redundant
6951 nested declaration.
6952
66322887
DA
69532012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6954
6955 Always use set_buffer_if_live to restore original buffer at unwind.
6956 * buffer.h (record_unwind_current_buffer): New function.
6957 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
6958 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
6959 * undo.c, window.c: Adjust users.
6960 * buffer.c (set_buffer_if_live): Fix comment.
6961
a3d794a1
DA
69622012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
6963
6964 Fix usage of set_buffer_internal.
6965 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
6966 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
6967 * coding.c (decode_coding): Omit redundant test.
6968 * fileio.c (decide_coding_unwind): Likewise.
6969 * fns.c (secure_hash): Likewise.
6970 * insdel.c (modify_region): Likewise.
6971 * keyboard.c (command_loop_1): Likewise.
6972 * print.c (PRINTFINISH): Likewise.
6973 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
6974
59ea14cd
PE
69752012-08-27 Paul Eggert <eggert@cs.ucla.edu>
6976
6977 * dispnew.c: Use bool for boolean.
6978 (frame_garbaged, display_completed, delayed_size_change)
6979 (fonts_changed_p, add_window_display_history)
6980 (add_frame_display_history, verify_row_hash)
6981 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
6982 (row_equal_p, realloc_glyph_pool)
6983 (allocate_matrices_for_frame_redisplay)
6984 (showing_window_margins_p)
6985 (adjust_frame_glyphs_for_frame_redisplay)
6986 (build_frame_matrix_from_leaf_window, make_current)
6987 (mirrored_line_dance, mirror_line_dance, update_frame)
6988 (update_window_tree, update_single_window)
6989 (check_current_matrix_flags, update_window, update_text_area)
6990 (update_window_line, set_window_update_flags, scrolling_window)
6991 (update_frame_1, scrolling, buffer_posn_from_coords)
6992 (do_pending_window_change, change_frame_size)
6993 (change_frame_size_1, sit_for):
6994 Use bool for boolean.
6995 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
6996 and remove last int (actually boolean) argument, which was always 0.
6997 All callers changed.
6998 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
6999 * dispextern.h (struct composition_it): Use bool for boolean.
7000 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
7001 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
7002 * dired.c (file_name_completion):
7003 Use bool for boolean. (This was missed in an earlier change.)
7004
95072a94
MR
70052012-08-27 Martin Rudalics <rudalics@gmx.at>
7006
7007 * window.c (Fset_window_configuration): Revert first part of
7008 last change.
7009
0f19feff
JD
70102012-08-27 Jan Djärv <jan.h.d@swipnet.se>
7011
7012 * nsterm.h (NSPanel): New class variable dialog_return.
7013
3a880af4
SM
7014 * nsmenu.m (initWithContentRect:styleMask:backing:defer:):
7015 Initialize dialog_return.
0f19feff
JD
7016 (windowShouldClose:): Use stop instead of stopModalWithCode.
7017 (clicked:): Ditto, and also set dialog_return (Bug#12258).
7018 (timeout_handler:): Use stop instead of abortModal. Send a dummy
7019 event.
7020 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
7021 modal loop returns.
7022
f10fe38f
PE
70232012-08-27 Paul Eggert <eggert@cs.ucla.edu>
7024
de1339b0
PE
7025 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
7026 * composite.c (find_composition, composition_gstring_p)
7027 (composition_reseat_it, find_automatic_composition):
7028 * data.c (let_shadows_buffer_binding_p)
7029 (let_shadows_global_binding_p, set_internal, make_blv)
7030 (Fmake_variable_buffer_local, Fmake_local_variable)
7031 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
7032 (cons_to_signed, arith_driver):
7033 * dbusbind.c (xd_in_read_queued_messages):
7034 * dired.c (directory_files_internal, file_name_completion):
7035 Use bool for booleans.
7036 * dired.c (file_name_completion):
7037 * process.h (fd_callback):
7038 Omit int (actually boolean) argument. It wasn't being used.
7039 All uses changed.
7040 * composite.h, lisp.h: Reflect above API changes.
7041
f10fe38f
PE
7042 * cmds.c, coding.c: Use bool for booleans.
7043 * cmds.c (move_point, Fself_insert_command):
7044 * coding.h (struct composition status, struct coding_system):
7045 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7046 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
7047 (emacs_mule_char, decode_coding_emacs_mule)
7048 (encode_coding_emacs_mule, detect_coding_iso_2022)
7049 (decode_coding_iso_2022, encode_invocation_designation)
7050 (encode_designation_at_bol, encode_coding_iso_2022)
7051 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
7052 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
7053 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
7054 (encode_coding_raw_text, detect_coding_charset)
7055 (decode_coding_charset, encode_coding_charset, detect_eol)
7056 (detect_coding, get_translation_table, produce_chars)
7057 (consume_chars, reused_workbuf_in_use)
7058 (make_conversion_work_buffer, code_conversion_save)
7059 (decode_coding_object, encode_coding_object)
7060 (detect_coding_system, char_encodable_p)
7061 (Funencodable_char_position, code_convert_region)
7062 (code_convert_string, code_convert_string_norecord)
7063 (Fset_coding_system_priority):
7064 * fileio.c (Finsert_file_contents):
7065 Use bool for booleans.
7066 * coding.h, lisp.h: Reflect above API changes.
7067 * coding.c: Remove unnecessary static function decls.
7068 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
7069 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
7070 not a boolean 'int', since callers never look at the return value.
7071 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
7072 * coding.h (decoding_buffer_size, encoding_buffer_size)
7073 (emacs_mule_string_char): Remove unused extern decls.
7074 (struct iso_2022_spec, struct coding_system):
7075 Use 'unsigned int : 1' for boolean fields, since there's more than one.
7076 (struct emacs_mule_spec): Remove unused field 'full_support'.
7077 All initializations removed.
7078 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
7079
5474c384
DA
70802012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7081
f10fe38f 7082 Fix spare memory change (Bug#12286).
5474c384
DA
7083 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
7084 (valid_lisp_object_p): Likewise.
7085
c4b6914d
MR
70862012-08-27 Martin Rudalics <rudalics@gmx.at>
7087
7088 * window.c (Fset_window_configuration): Record any window's old
7089 buffer if it's replaced (see Bug#8789). If the new current
7090 buffer doesn't appear in the selected window, go to its old
7091 point (Bug#12208).
7092
35aaa1ea
DA
70932012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
7094
7095 Special MEM_TYPE_SPARE to denote reserved memory.
7096 * alloc.c (enum mem_type): New memory type.
7097 (refill_memory_reserve): Use new type for spare memory.
7098 This prevents live_cons_p and live_string_p from incorrect
7099 detection of uninitialized objects from spare memory as live.
7100
6af64513
PE
71012012-08-26 Paul Eggert <eggert@cs.ucla.edu>
7102
8b2e00a3
PE
7103 Spelling fixes.
7104 * Makefile.in (.PHONY): versioclean -> versionclean.
7105
b52d6985
PE
7106 Remove unused external symbols.
7107 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
7108 * window.c (Qwindow_valid_p, decode_valid_window):
7109 Now static, not extern.
7110 * data.c (Qinterval): Remove; unused.
7111 (syms_of_data): Do not define 'interval'.
7112 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
7113 * window.h (decode_valid_window):
7114 Remove decls.
7115
d5172d4f
PE
7116 * character.c, charset.c, chartab.c: Use bool for booleans.
7117 * character.c (lisp_string_width, string_count_byte8)
7118 (string_escape_byte8):
7119 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7120 (load_charset_map_from_file, map_charset_chars)
7121 (Fdefine_charset_internal, define_charset_internal)
7122 (Fdeclare_equiv_charset, find_charsets_in_text)
7123 (Ffind_charset_region, char_charset, Fiso_charset):
7124 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
7125 (sub_char_table_set, sub_char_table_set_range)
7126 (char_table_set_range, optimize_sub_char_table)
7127 (map_sub_char_table):
7128 Use bool for boolean.
7129 * character.c (str_to_unibyte): Omit last boolean argument; it was
7130 always 0. All callers changed.
7131 * character.h, charset.h: Adjust to match previous changes.
7132 * character.h (char_printable_p): Remove decl of nonexistent function.
7133 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
7134 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
7135 are all boolean, so make them single-bit bitfields.
7136
6af64513
PE
7137 * lisp.h (ASET): Remove attempt to detect side effects.
7138 It was meant to be temporary and it often doesn't work,
7139 because when IDX has side effects the behavior of IDX==IDX
7140 is undefined. See Stefan Monnier in
7141 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
7142
e1f29348
BR
71432012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7144
7145 * lisp.h (functionp): New function (extracted from Ffunctionp).
7146 (FUNCTIONP): Use it.
7147 * eval.c (Ffunctionp): Use it.
7148
17c05d74
PE
71492012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7150
0f46bc75
PE
7151 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
7152 as that's faster and simpler than static storage. Don't bother
7153 with the g_main_context_query overhead if g_main_context_pending
7154 says no events are pending.
7155 (gfds, gfds_size): Remove these static vars.
7156 (xgselect_initialize): Remove; no longer needed.
7157 All uses and decls removed.
7158
ee4c0f69
PE
7159 * emacs.c (fatal_error_signal_hook): Remove.
7160 All uses removed. This leftover from old code was always 0.
7161
17c05d74
PE
7162 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
7163 * casefiddle.c (casify_object, casify_region):
7164 * casetab.c (set_case_table):
7165 * category.c, category.h (word_boundary_p):
7166 * category.h (CHAR_HAS_CATEGORY):
7167 Use bool for booleans, instead of int.
7168
391ceac5
EZ
71692012-08-25 Eli Zaretskii <eliz@gnu.org>
7170
7171 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
7172
2f221583
PE
71732012-08-25 Paul Eggert <eggert@cs.ucla.edu>
7174
f4a681b0
PE
7175 On assertion failure, print backtrace if available.
7176 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
7177 (die) [ENABLE_CHECKING]: Print a backtrace if available.
7178 * Makefile.in (LIB_EXECINFO): New macro.
7179 (LIBES): Use it.
7180
2f221583
PE
7181 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
7182 * bytecode.c (exec_byte_code):
7183 * callint.c (check_mark, Fcall_interactively):
7184 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
7185 (getenv_internal, sync_process_alive, call_process_exited):
7186 * lisp.h (USE_SAFE_ALLOCA):
7187 Use bool for booleans, instead of int.
7188 * lisp.h, process.h: Adjust prototypes to match above changes.
7189 * callint.c (Fcall_interactively): Don't assume the mark's
7190 offset fits in 'int'.
7191
37ef52bb
PE
71922012-08-24 Paul Eggert <eggert@cs.ucla.edu>
7193
7194 * buffer.c, buffer.h: Use bool for boolean.
7195 * buffer.c (reset_buffer_local_variables)
7196 (buffer_lisp_local_variables, Fset_buffer_modified_p)
7197 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
7198 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
7199 (overlay_touches_p, overlay_strings, Foverlay_put)
7200 (report_overlay_modification, call_overlay_mod_hooks):
7201 (mmap_enlarge, mmap_set_vars):
7202 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
7203 Use bool for booleans, instead of int.
7204 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
7205 since the 1-or-0 return value is always ignored anyway.
7206 (mmap_initialized_p):
7207 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
7208 * buffer.h, lisp.h: Adjust prototypes to match above changes.
7209
2cc21167
PE
72102012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7211
7212 * bidi.c: Use bool for boolean.
7213 This is a bit more readable, and makes the text segment of bidi.o
7214 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
7215 Presumably it's faster too.
7216 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
7217 Now bool.
7218 (bidi_cache_find_level_change, bidi_cache_iterator_state)
7219 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
7220 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
7221 (bidi_explicit_dir_char, bidi_level_of_next_char)
7222 (bidi_find_other_level_edge, bidi_move_to_visually_next):
7223 Use bool for booleans, instead of int.
7224 * dispextern.h (bidi_init_it, bidi_paragraph_init)
7225 (bidi_unshelve_cache): Adjust decls to match code.
7226
7db4ddf4
MR
72272012-08-23 Martin Rudalics <rudalics@gmx.at>
7228
7229 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
7230 argument.
7231
b1bb8011
PE
72322012-08-23 Paul Eggert <eggert@cs.ucla.edu>
7233
7234 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
7235 * atimer.h: Include <stdbool.h>.
7236
ff687885
DN
72372012-08-22 Dan Nicolaescu <dann@gnu.org>
7238
7239 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
7240 compile time tests instead of run time tests on systems that do
7241 not use them.
7242 (FRAME_MAC_P): Remove leftover from deleted code.
7243 * frame.c (syms_of_frame): Remove leftover from deleted code.
7244
4ce7a138
JD
72452012-08-22 Jan Djärv <jan.h.d@swipnet.se>
7246
7247 * nsterm.m (insertText:): Don't clear modifiers if code is space.
7248
d733ec6d
PE
72492012-08-22 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
7252 Otherwise, the compiler complains about (A?B:C) where B is void
fc0c31f8 7253 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
d733ec6d
PE
7254 (fontset_add): Return void, for FONTSET_ADD.
7255
d0d2d26f
PE
72562012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7257
fce31d69
PE
7258 * alloc.c: Use bool for booleans.
7259 (gc_in_progress, abort_on_gc)
7260 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7261 (dont_register_blocks) [GC_MALLOC_CHECK]:
7262 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
7263 (check_string_bytes, make_specified_string, memory_full)
7264 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
7265 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
7266 (mark_stack, valid_pointer_p, make_pure_string)
7267 (Fgarbage_collect, survives_gc_p, gc_sweep):
7268 Use bool for booleans, instead of int.
7269 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
7270 Remove unused local.
7271 * alloc.c (PURE_POINTER_P):
7272 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
7273 * editfns.c (Fformat):
7274 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
7275 (Fdo_auto_save):
7276 * fns.c (sweep_weak_table):
7277 * lisp.h (suppress_checking, push_message, survives_gc_p)
7278 (make_pure_string, gc_in_progress, abort_on_gc):
7279 * lread.c (readchar, read1):
7280 * print.c (Fprin1_to_string):
7281 * xdisp.c (push_message):
7282 Use bool for booleans affected directly or indirectly by
7283 alloc.c's changes.
7284
d0d2d26f
PE
7285 Make recently-introduced setters macros.
7286 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
7287 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
7288 (set_fontset_default, set_fontset_fallback): Rename from their
7289 upper-case counterparts, and make them functions rather than macros.
7290 This is more consistent with the other recently-introduced setters.
7291 These don't need to be inline, since they're local.
7292
d18e2bb6
JD
72932012-08-21 Jan Djärv <jan.h.d@swipnet.se>
7294
7295 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
7296 the loop (Bug#12247).
7297
1b9d9d16
PE
72982012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7299
7300 * lisp.h (vcopy): Use memcpy rather than our own loop.
7301 This fixes a performance regression introduced by the recent
7302 addition of vcopy. This means 'vcopy' will need to be modified
7303 for a copying collector, but that's OK. Also, tighten the
7304 checking in the assertion.
7305
b2f09701
EZ
73062012-08-21 Eli Zaretskii <eliz@gnu.org>
7307
7308 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
7309 components for RTL text (Bug#11860). Adjust X-OFFSET of each
7310 non-base glyph for the width of the base character, according to
e1f29348
BR
7311 what x_draw_composite_glyph_string_foreground expects.
7312 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
7313 expectations, to produce correct width of the composed character.
7314 Reverse the sign of the DU offset produced by ScriptPlace.
7315
9b994fed
PE
73162012-08-21 Paul Eggert <eggert@cs.ucla.edu>
7317
7318 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
7319
086ca913
DA
73202012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7321
7322 Avoid direct writes to contents member of struct Lisp_Vector.
7323 * lisp.h (vcopy): New function to copy data into vector.
7324 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
7325 * fns.c (Ffillarray): Use ASET.
7326 * keyboard.c (timer_check_2): Use AREF and ASET.
7327 (append_tool_bar_item, Frecent_keys): Use vcopy.
7328 * lread.c (read_vector): Use ASET.
7329 * msdos.c (Frecent_doskeys): Use vcopy.
7330 * xface.c (Finternal_copy_lisp_face): Use vcopy.
7331 (Finternal_merge_in_global_face): Use ASET and vcopy.
7332 * xfont.c (xfont_list_pattern): Likewise.
7333
5481664a
MR
73342012-08-21 Martin Rudalics <rudalics@gmx.at>
7335
7336 * window.c (Fwindow_point): For the selected window always return
7337 the position of its buffer's point.
7338 (Fset_window_point): For the selected window always go in its
7339 buffer to the specified position.
7340
6d470bdd
DA
73412012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
7342
7343 Setter macros for fontsets.
7344 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
7345 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
7346 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
7347 Adjust users.
7348
24564fe1
GM
73492012-08-20 Glenn Morris <rgm@gnu.org>
7350
7351 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
7352 Don't assume that `ln -f' works.
7353
0a05a035
EZ
73542012-08-20 Eli Zaretskii <eliz@gnu.org>
7355
7356 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
7357 and later about non-assignments with no effect. See discussion at
7358 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
7359 details.
7360
e46f2325
DA
73612012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7362
7363 Inline setter functions for Lisp_Objects slots of struct specbinding.
7364 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
7365 Adjust users.
7366
734fbd86
MR
73672012-08-20 Martin Rudalics <rudalics@gmx.at>
7368
7369 * window.c (select_window): Always make selected window's buffer
7370 current.
7371
f1a95992
DA
73722012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7373
7374 Use AREF and ASET for docstrings of category tables.
7375 * category.h (CATEGORY_DOCSTRING): Use AREF.
7376 (SET_CATEGORY_DOCSTRING): Use ASET.
7377 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
7378
e83064be
DA
73792012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7380
7381 Inline setter functions for hash table members.
7382 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
7383 (set_hash_hash, set_hash_index): Rename with _slot suffix.
7384 (set_hash_key_and_value, set_hash_index, set_hash_next)
7385 (set_hash_hash): New functions.
7386 * charset.c, fns.c: Adjust users.
7387
4ce60d2e
DA
73882012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
7389
7390 Inline getter and setter functions for per-buffer values.
7391 * buffer.h (per_buffer_default, set_per_buffer_default)
7392 (per_buffer_value, set_per_buffer_value): New functions.
7393 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
7394 * buffer.c, data.c: Adjust users.
7395
c06c9690
JB
73962012-08-20 Juanma Barranquero <lekktu@gmail.com>
7397
7398 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
7399
32bd4250
PE
74002012-08-19 Paul Eggert <eggert@cs.ucla.edu>
7401
bad03192 7402 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
7403 as gnulib does this if the system doesn't.
7404 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
7405 Remove declaration. MS-Windows declares it on stdlib.h which is
7406 included by conf_post.h.
b69a6d22
PE
7407 * emacs.c (environ) [DOUG_LEA_MALLOC]:
7408 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
7409 * vm-limit.c: Include <unistd.h>, for 'environ'.
7410
22d7feb2
PE
7411 * unexaix.c, unexcoff.c: Include "mem-limits.h".
7412 (start_of_data): Remove decl; mem-limits.h provides it.
7413
32bd4250
PE
7414 * xdisp.c (handle_invisible_prop): Make it a bit faster
7415 and avoid a gcc -Wmaybe-uninitialized diagnostic.
7416
450809af
CY
74172012-08-19 Chong Yidong <cyd@gnu.org>
7418
7419 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
7420 ends (Bug#3874).
7421
9e677988
AS
74222012-08-19 Andreas Schwab <schwab@linux-m68k.org>
7423
6b1319ce
AS
7424 * .gdbinit: Use call instead of set when calling a function in the
7425 inferior.
7426
9e677988
AS
7427 * data.c (set_internal): Don't use set_blv_found.
7428 (Fkill_local_variable): Likewise.
7429
d7191076
AA
74302012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
7431
7432 * nsfont.m (ns_ascii_average_width): Ensure the string
7433 ascii_printable is initialized with a null-terminated character
7434 array. Otherwise, it can contain undesired extra characters.
7435
e757f1c6
PE
74362012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7437
7438 port new setting code to Sun C 5.8 2005/10/13
7439 * chartab.c, lisp.h (char_table_set, char_table_set_range):
7440 Return void, not Lisp_Object. Otherwise, the compiler
7441 complains about (A?B:C) where B is void and C is Lisp_Object
7442 when compiling CHAR_TABLE_SET, due to the recent change to
7443 the API of sub_char_table_set_contents.
7444
a999ce26
CY
74452012-08-18 Chong Yidong <cyd@gnu.org>
7446
7447 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
7448 for the string case (Bug#3874).
7449
3f22b86f
PE
74502012-08-18 Paul Eggert <eggert@cs.ucla.edu>
7451
39eb03f1
PE
7452 * buffer.h (BSET): Remove (Bug#12215).
7453 Replace all uses with calls to new setter functions.
7454 (bset_bidi_paragraph_direction, bset_case_canon_table)
7455 (bset_case_eqv_table, bset_directory, bset_display_count)
7456 (bset_display_time, bset_downcase_table)
7457 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
7458 (bset_last_selected_window, bset_local_var_alist)
7459 (bset_mark_active, bset_point_before_scroll, bset_read_only)
7460 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
7461 (bset_width_table):
7462 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
7463 (bset_auto_fill_function, bset_auto_save_file_format)
7464 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
7465 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
7466 (bset_cache_long_line_scans, bset_case_fold_search)
7467 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
7468 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
7469 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
7470 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
7471 (bset_header_line_format, bset_indicate_buffer_boundaries)
7472 (bset_indicate_empty_lines, bset_invisibility_spec)
7473 (bset_left_fringe_width, bset_major_mode, bset_mark)
7474 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
7475 (bset_name, bset_overwrite_mode, bset_pt_marker)
7476 (bset_right_fringe_width, bset_save_length)
7477 (bset_scroll_bar_width, bset_scroll_down_aggressively)
7478 (bset_scroll_up_aggressively, bset_selective_display)
7479 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
7480 (bset_word_wrap, bset_zv_marker):
7481 * category.c (bset_category_table):
7482 * syntax.c (bset_syntax_table):
7483 New setter functions.
7484
6a09a33b
PE
7485 * process.h (PSET): Remove (Bug#12215).
7486 Replace all uses with calls to new setter functions.
7487 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7488 (PROCESS_INLINE): New macro.
7489 (pset_childp): New setter function.
7490 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
7491 * process.c (PROCESS_INLINE):
7492 Define to EXTERN_INLINE, so that the corresponding functions
7493 are compiled into code.
7494 (pset_buffer, pset_command, pset_decode_coding_system)
7495 (pset_decoding_buf, pset_encode_coding_system)
7496 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
7497 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
7498 (pset_type, pset_write_queue): New setter functions.
7499
e8c17b81
PE
7500 * window.h (WSET): Remove (Bug#12215).
7501 Replace all uses with calls to new setter functions.
7502 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7503 (WINDOW_INLINE): New macro.
7504 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
7505 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
7506 (wset_total_lines, wset_vertical_scroll_bar)
7507 (wset_window_end_pos, wset_window_end_valid)
7508 (wset_window_end_vpos): New setter functions.
7509 * window.c (WINDOW_INLINE):
7510 Define to EXTERN_INLINE, so that the corresponding functions
7511 are compiled into code.
7512 (wset_combination_limit, wset_dedicated, wset_display_table)
7513 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
7514 (wset_new_normal, wset_new_total, wset_next_buffers)
7515 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
7516 (wset_prev_buffers, wset_right_fringe_width)
7517 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
7518 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
7519 (wset_window_parameters):
7520 * xdisp.c (wset_base_line_number, wset_base_line_pos)
7521 (wset_column_number_displayed, wset_region_showing):
7522 New setter functions.
7523
3f22b86f
PE
7524 * termhooks.h (TSET): Remove (Bug#12215).
7525 Replace all uses with calls to new setter functions.
7526 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7527 (TERMHOOKS_INLINE): New macro.
7528 (tset_charset_list, tset_selection_alist): New setter functions.
7529 * terminal.c (TERMHOOKS_INLINE):
7530 Define to EXTERN_INLINE, so that the corresponding functions
7531 are compiled into code.
7532 (tset_param_alist): New setter function.
7533
742af32f
PE
75342012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7535
15dbb4d6
PE
7536 * keyboard.h (KSET): Remove (Bug#12215).
7537 Replace all uses with calls to new setter functions.
7538 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7539 (KEYBOARD_INLINE): New macro.
7540 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
7541 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
7542 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
7543 New setter functions.
7544 * keyboard.c (KEYBOARD_INLINE):
7545 Define to EXTERN_INLINE, so that the corresponding functions
7546 are compiled into code.
7547 (kset_echo_string, kset_kbd_queue)
7548 (kset_keyboard_translate_table, kset_last_prefix_arg)
7549 (kset_last_repeatable_command, kset_local_function_key_map)
7550 (kset_overriding_terminal_local_map, kset_real_last_command)
7551 (kset_system_key_syms): New setter functions.
7552
f00af5b1
PE
7553 * frame.h (FSET): Remove (Bug#12215).
7554 Replace all uses with calls to new setter functions.
7555 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
7556 (FRAME_INLINE): New macro.
7557 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
7558 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
7559 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
7560 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
7561 (fset_param_alist, fset_root_window, fset_scroll_bars)
7562 (fset_selected_window, fset_title, fset_tool_bar_items)
7563 (fset_tool_bar_position, fset_tool_bar_window): New functions.
7564 * frame.c (FRAME_INLINE):
7565 Define to EXTERN_INLINE, so that the corresponding functions
7566 are compiled into code.
7567 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
7568
0c94c8d6
PE
7569 A few more naming-convention fixes for getters and setters.
7570 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
7571 and rename from buffer_overlays_set_before.
7572 (set_buffer_overlays_after): Move here from buffer.h, and rename
7573 from buffer_overlays_set_after.
7574 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
7575 All uses changed.
7576 (set_buffer_intervals): Rename from buffer_set_intervals.
7577 * intervals.c (set_interval_object): Move here from intervals.h,
7578 and rename from interval_set_object.
7579 (set_interval_left): Move here from intervals.h, and rename from
7580 interval_set_left.
7581 (set_interval_right): Move here from intervals.h, and rename from
7582 interval_set_right.
7583 (copy_interval_parent): Move here from intervals.h, and rename from
7584 interval_copy_parent.
7585 * intervals.h (set_interval_parent): Rename from interval_set_parent.
7586 (set_interval_plist): Rename from interval_set_plist.
7587 Return void, not Lisp_Object, since no caller uses the result.
7588 * lisp.h (string_intervals): Rename from string_get_intervals.
7589 (set_string_intervals): Rename from string_set_intervals.
7590
34dabdb7
PE
7591 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
7592 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 7593 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
7594 All uses changed. See the end of
7595 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
7596
742af32f
PE
7597 * lisp.h (CSET): Remove (Bug#12215).
7598 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
7599 (set_char_table_purpose): New functions,
7600 replacing CSET. All uses changed. For example, replace
7601 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 7602 "set_char_table_parent (char_table, parent);".
742af32f
PE
7603 The old version was confusing because it used the same name
7604 'parent' for two different things.
7605
a04e2c62
DA
76062012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7607
7608 Functions to get and set Lisp_Object fields of buffer-local variables.
7609 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
7610 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
7611 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
7612 * data.c, eval.c, frame.c: Adjust users.
7613
383dcbf9
CY
76142012-08-17 Chong Yidong <cyd@gnu.org>
7615
7616 * xfaces.c (merge_face_vectors): If the target font specfies a
7617 font spec, make the font's attributes take precedence over
7618 directly-specified attributes.
7619 (merge_face_ref): Recognize :font.
7620
44386687
DA
76212012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
7622
7623 Do not use memcpy for copying intervals.
7624 * intervals.c (reproduce_interval): New function.
7625 (reproduce_tree, reproduce_tree_obj): Use it.
7626 (reproduce_tree_obj): Remove prototype.
7627
927c7216
PE
76282012-08-17 Paul Eggert <eggert@cs.ucla.edu>
7629
7630 * lisp.h (duration_to_sec_usec): Remove unused decl.
7631
93044f7b
AA
76322012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
7633
7634 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
7635 to an allocated instance of NSString, not to the class itself.
7636
9851e4a5
JB
76372012-08-17 Juanma Barranquero <lekktu@gmail.com>
7638
7639 * makefile.w32-in (C_CTYPE_H): New macro.
7640 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
7641 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
7642 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
7643
620f13b0
PE
76442012-08-16 Paul Eggert <eggert@cs.ucla.edu>
7645
7646 Use ASCII tests for character types.
7647 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
7648 * xfns.c, xterm.c:
7649 Don't include <ctype.h>; was not needed.
7650 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
7651 * sysdep.c, xfaces.c:
7652 Include <c-ctype.h> instead of <ctype.h>.
7653 * nsterm.m: Include <c-ctype.h>.
7654 * charset.c (read_hex):
7655 * doc.c (Fsnarf_documentation):
7656 * fileio.c (IS_DRIVE) [WINDOWSNT]:
7657 (DRIVE_LETTER) [DOS_NT]:
7658 (Ffile_name_directory, Fexpand_file_name)
7659 (Fsubstitute_in_file_name):
7660 * font.c (font_parse_xlfd, font_parse_fcname):
7661 * frame.c (x_set_font_backend):
7662 * gtkutil.c (xg_get_font):
7663 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
7664 * nsimage.m (hexchar):
7665 * nsterm.m (ns_xlfd_to_fontname):
7666 * sysdep.c (system_process_attributes):
7667 * xfaces.c (hash_string_case_insensitive):
7668 Use C-locale tests instead of locale-specific tests for character
7669 types, since we want the ASCII interpretation here, not the
7670 interpretation suitable for whatever happens to be the current locale.
7671
52162052
MR
76722012-08-16 Martin Rudalics <rudalics@gmx.at>
7673
7674 Consistently check windows for validity/liveness
7675 (Bug#11984, Bug#12025, Bug#12026).
7676 * lisp.h (CHECK_VALID_WINDOW): New macro.
7677 * window.c (decode_window): Rename to decode_live_window.
7678 (decode_valid_window, Fwindow_valid_p): New functions.
7679 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
7680 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
7681 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
7682 (Fwindow_prev_sibling, Fwindow_combination_limit)
7683 (Fset_window_combination_limit, Fwindow_use_time)
7684 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
7685 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
7686 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
7687 (Fwindow_hscroll, Fset_window_hscroll)
7688 (Fwindow_redisplay_end_trigger)
7689 (Fset_window_redisplay_end_trigger, Fwindow_edges)
7690 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
7691 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7692 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
7693 (Fwindow_end, Fset_window_point, Fset_window_start)
7694 (Fpos_visible_in_window_p, Fwindow_line_height)
7695 (Fwindow_dedicated_p, Fset_window_dedicated_p)
7696 (Fwindow_prev_buffers, Fset_window_prev_buffers)
7697 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
7698 (Fset_window_parameter, Fwindow_display_table)
7699 (Fset_window_display_table, Fdelete_other_windows_internal)
7700 (Fset_window_buffer, Fset_window_new_total)
7701 (Fset_window_new_normal, Fdelete_window_internal)
7702 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
7703 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
7704 (Fwindow_scroll_bars): Check whether argument window is a valid or
7705 live window. Update doc-strings.
7706 (syms_of_window): New symbol Qwindow_valid_p.
7707 * keyboard.c (Fposn_at_x_y): Check whether argument
7708 frame_or_window denotes a valid window.
7709
2751c80f
DA
77102012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7711
7712 Fix previous char table change.
7713 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
7714 * chartab.c (optimize_sub_char_table): Likewise.
7715
032a42c8
CY
77162012-08-16 Chong Yidong <cyd@gnu.org>
7717
a2d19368
CY
7718 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
7719
032a42c8
CY
7720 * xfont.c (xfont_open):
7721 * xftfont.c (xftfont_open): Set the font's max_width field.
7722
7723 * nsfont.m (nsfont_open): Similar to the Xft backend, set
7724 min_width to space_width and average_width to the average over
7725 printable ASCII characters.
7726 (ns_char_width): Code cleanup.
7727 (ns_ascii_average_width): New utility function.
7728
7729 * font.h (struct font): Update comments.
7730
a098c930
DA
77312012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
7732
032a42c8 7733 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
7734 * lisp.h (CSET): New macro.
7735 (char_table_set_extras, char_table_set_contents)
7736 (sub_char_table_set_contents): New function.
7737 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
7738 * syntax.c: Adjust users.
7739
8be3a09c
SM
77402012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
7741
7742 * eval.c (eval_sub): Bind lexical-binding.
7743 * lread.c (Qlexical_binding): Make non-static.
7744
ac4845a6
JD
77452012-08-15 Jan Djärv <jan.h.d@swipnet.se>
7746
ddee6515
JD
7747 * nsmenu.m (popupSession): Remove.
7748 (pop_down_menu): Remove endModalSession.
7749 (timeout_handler:): New method.
7750 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
7751 Call runModalForWindow. Check timer_fired when it returns.
7752 If not set, cancel timer and break out of loop.
7753 Otherwise loop again, with a new timeout.
7754
7755 * nsterm.m: Include fcntl.h if present.
7756 (fd_entry, t_readfds, inNsSelect): Remove.
7757 (select_writefds, select_valid, select_timeout, selfds)
7758 (select_mutex, apploopnr): Add.
7759 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
7760 Otherwise call kbd_buffer_store_event.
7761 (ns_send_appdefined): Remove release of fd_entry.
7762 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
7763 Increment and decrement apploopnr.
7764 (ns_select): If no file descriptors, just do a NSTimer.
7765 Otherwise copy read/write masks and start select thread (fd_handler).
7766 Start main loop and wait for application defined event.
7767 Inform select thread to stop selecting after main loop is exited.
7768 (ns_term_init): Create selfds pipe and set non-blocking.
fc0c31f8 7769 Initialize select_mutex. Start the select thread (fd_handler).
ddee6515
JD
7770 (fd_handler:): Loop forever, wait for info from the main thread
7771 to either start or stop selecting. When select returns, send
7772 and appdefined event.
7773 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
7774 If not call kbd_buffer_store_event.
7775
7776 * nsterm.h (EmacsApp): fd_handler takes id argument.
7777 (EmacsDialogPanel): Add timer_fired and timeout_handler.
7778
ac4845a6
JD
7779 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
7780
eb424fe3
EZ
77812012-08-15 Eli Zaretskii <eliz@gnu.org>
7782
7783 * region-cache.c (move_cache_gap): Update gap_len using the actual
7784 growth of the boundaries array. Do not change cache_len.
7785 (Bug#12196)
7786
4e6a86c6
DA
77872012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7788
7789 Generalize and cleanup font subsystem checks.
7790 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
7791 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
7792 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 7793
5bf192ca
DA
77942012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
7795
7796 * gtkutil.c (xg_get_font): Use pango_units_to_double.
7797
f2045622
CY
77982012-08-15 Chong Yidong <cyd@gnu.org>
7799
8be3a09c
SM
7800 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
7801 When using the new font chooser, use gtk_font_chooser_get_font_desc to
7802 extract the font descriptor instead of just the font name.
7803 In that case, return a font spec instead of a string.
f2045622
CY
7804 (x_last_font_name): Move to this file from xfns.c.
7805
7806 * xfns.c (Fx_select_font): The return value can also be a font
7807 spec. Move x_last_font_name management to gtkutil.c.
7808
7809 * xfaces.c: Make font weight and style symbols non-static.
7810
7f6feb56
SM
78112012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
7812
7813 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
7814 (bug#12117).
7815
fecbd8ff
SM
78162012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
7817
7818 * alloc.c (Fgarbage_collect): Use plural form consistently.
7819
9b8d5165
EZ
78202012-08-14 Eli Zaretskii <eliz@gnu.org>
7821
7822 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
7823 iteration through the command loop. Fixes a problem whereby mouse
7824 movements are ignored until the first mouse click.
7825
f5d9e83a
PE
78262012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7827
7828 Use bool, not int, for Lisp booleans.
7829 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
7830 makes Emacs a bit smaller and presumably a bit faster.
7831 * lisp.h: Include <stdbool.h>.
7832 (struct Lisp_Boolfwd, defvar_bool):
7833 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
7834 * regex.c [!emacs]: Include <stdbool.h>.
7835 (false, true): Remove; <stdbool.h> does this for us now.
7836
55802e4a
CY
78372012-08-14 Chong Yidong <cyd@gnu.org>
7838
4abcdac8
CY
7839 * character.c (Fcharacterp): Doc fix (Bug#12076).
7840
7841 * data.c (Findirect_variable): Doc fix (Bug#11040).
7842
55802e4a
CY
7843 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
7844
7845 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 7846 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 7847
8e99d072
BR
78482012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
7849
7850 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
7851 (bug#12022).
7852
08908aca
MR
78532012-08-14 Martin Rudalics <rudalics@gmx.at>
7854
7855 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
7856 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
7857 * minibuf.c (choose_minibuf_frame, read_minibuf):
7858 * w32fns.c (x_create_tip_frame):
7859 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
7860 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
7861
56120d6f
PE
78622012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7863
7864 * intervals.c (offset_intervals): Remove obsolete comment.
7865
67b77c0b
AS
78662012-08-14 Andreas Schwab <schwab@linux-m68k.org>
7867
7868 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
7869
f48b82fd
GR
78702012-08-14 Gergely Risko <gergely@risko.hu>
7871
7872 * coding.c (decode_coding): Record buffer modification before
7873 disabling undo_list (Bug#11773).
7874
fd318b54
DA
78752012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7876
7877 Revert and cleanup some recent overlay changes.
7878 * buffer.h (enum overlay_type): Remove.
7879 (buffer_get_overlays, buffer_set_overlays): Likewise.
7880 (buffer_set_overlays_before, buffer_set_overlays_after):
7881 New function. Adjust users.
7882 (unchain_both): Add eassert.
7883
41a62dd9
DA
78842012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
7885
7886 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
7887
5884c324
PE
78882012-08-14 Paul Eggert <eggert@cs.ucla.edu>
7889
7890 * gtkutil.c (xg_mark_data): Don't assume C99.
7891
ca06f160
JD
78922012-08-13 Jan Djärv <jan.h.d@swipnet.se>
7893
7894 * gtkutil.c (xg_frame_tb_info): New struct.
7895 (TB_INFO_KEY): New define.
7896 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
7897 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
7898 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
7899 if not present.
7900 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
fc0c31f8 7901 is up to date. Otherwise store new data.
ca06f160
JD
7902 (free_frame_tool_bar): Free xg_frame_tb_info if present.
7903
7864a3f7
DA
79042012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7905
7906 Use KSET for write access to Lisp_Object members of struct kboard.
7907 * keyboard.h (KSET): New macro.
7908 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
7909 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
7910 * xterm.c: Adjust users.
7911
4c31be61
DA
79122012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
7913
7914 Use BSET for write access to Lisp_Object members of struct buffer.
7915 * buffer.h (BSET): New macro.
7916 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
7917 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
7918 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
7919 * window.c, xdisp.c, xfns.c: Adjust users.
7920
14ae4239
BT
79212012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
7922
7923 * lread.c (syms_of_lread): Initialize Vlexical_binding.
7924
32bcadb4
JD
79252012-08-11 Jan Djärv <jan.h.d@swipnet.se>
7926
3d29b2ce 7927 * nsterm.m (not_in_argv): New function.
fc0c31f8 7928 (application:openFile, application:openTempFile:):
3d29b2ce
JD
7929 (application:openFileWithoutUI:, application:openFiles:): Open file
7930 if not_in_argv returns non-zero (bug#12171).
7931
32bcadb4 7932 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
7933 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
7934 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
7935 (xg_get_font_name): Use those functions/macros here.
7936 Reported by Frans Oilinki <moilinki@gmail.com>.
7937
9ff9402d 79382012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
7939
7940 * unexmacosx.c (copy_data_segment): Copy initialized data in
7941 statically linked libraries from input file rather than memory.
7942
db74a5fc
YM
7943 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
7944 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
7945 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
7946
25e65510
GM
79472012-08-10 Glenn Morris <rgm@gnu.org>
7948
7949 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
7950 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
7951
7961135c
DA
79522012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7953
7954 Fix last change to allow compilation with low optimization levels.
7955 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
7956 Reported by Jan Djärv <jan.h.d@swipnet.se>.
7957
42b3a444
DA
79582012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7959
7960 Use common inline syntax in intervals.h.
7961 * intervals.h (INTERVALS_INLINE): New macro.
7962 Change all users from LISP_INLINE.
7963
9fb0c957
DA
79642012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7965
7966 Define Qnone once for all platforms.
7967 * frame.c (Qnone): Define here.
7968 (syms_of_frame): DEFSYM it.
7969 * lisp.h (Qnone): New declaration.
7970 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
7971 * xfns.c: Remove duplication. Adjust users.
7972
65e8ee52
DA
79732012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
7974
7975 Remove unused macros from intervals.h.
7976 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
7977 * intervals.c: Adjust comment.
7978
9b855fd6
EZ
79792012-08-10 Eli Zaretskii <eliz@gnu.org>
7980
7981 * w32fns.c <w32_unicode_gui>: New static variable.
7982 (globals_of_w32fns): Initialize it according to os_subtype.
7983 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
7984 testing os_subtype.
7985
39cb9e56 79862012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
7987 Eli Zaretskii <eliz@gnu.org>
7988
7989 Fix bug #10299 with Unicode characters sent by customized
7990 keyboards created by MSKLC.
7991 * w32fns.c (INIT_WINDOW_CLASS): New macro.
7992 (w32_init_class): Use it to initialize the Emacs class with either
7993 ANSI or Unicode API calls.
7994 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
7995 later.
7996 (w32_wnd_proc): If the character code sent by WM_CHAR or
7997 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
7998 original message. Call DefWindowProcW on NT and later.
7999
9374581a
GM
80002012-08-10 Glenn Morris <rgm@gnu.org>
8001
4b94e8cf
GM
8002 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
8003
9374581a
GM
8004 * lisp.h (DIRECTORY_SEP): Let configure set it.
8005
a2752828
DA
80062012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
8007
8008 Use TSET for write access to Lisp_Object slots of struct terminal.
8009 * termhooks.h (TSET): New macro.
8010 * coding.c, terminal.c, xselect.c: Adjust users.
8011
cc92c454
SM
80122012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
8013
8014 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
8015 the failing expression, include them in the error message.
8016 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
8017 * lisp.h (internal_condition_case_n): Update declaration.
8018
4cb3e6b3
DA
80192012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8020
8021 Inline functions to examine and change buffer overlays.
8022 * buffer.c (unchain_both): New function.
8023 * buffer.h (buffer_get_overlays, buffer_set_overlays):
8024 (buffer_has_overlays): New function.
8025 (enum overlay_type): New enum.
8026 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
8027 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
8028
8707c1e5
DA
80292012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8030
8031 Inline functions to examine and change buffer intervals.
8032 * alloc.c (mark_interval_tree): Remove.
8033 (MARK_INTERVAL_TREE): Simplify.
8034 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
8035 * intervals.c (buffer_balance_intervals): New function.
8036 (graft_intervals_into_buffer): Adjust indentation.
8037 (set_intervals_multibyte): Simplify.
8038 * buffer.h (BUF_INTERVALS): Remove.
8039 (buffer_get_intervals, buffer_set_intervals): New function.
8040 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
8041 * intervals.c, textprop.c: Adjust users.
8042
ad8c997f
DA
80432012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8044
8045 Inline functions to examine and change string intervals.
8046 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
8047 (string_get_intervals, string_set_intervals): New function.
8048 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8049 * lread.c, print.c, textprop.c: Adjust users.
8050
32ac3a6b
GM
80512012-08-08 Glenn Morris <rgm@gnu.org>
8052
8053 * lisp.mk (lisp): Remove language/persian.elc.
8054
77c7bcb1
DA
80552012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8056
8057 Cleanup intervals.
8058 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
8059 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
8060 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
8061 Adjust comment. Move under #if 0.
77c7bcb1
DA
8062 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
8063 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
8064
9c08a8d4
DA
80652012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
8066
8067 Check total length of intervals with eassert.
8068 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
8069 * intervals.c: Change all users to eassert.
8070
26d16b35
EZ
80712012-08-07 Eli Zaretskii <eliz@gnu.org>
8072
14ae4239
BT
8073 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
8074 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
8075 INTERNAL_FIELD in Lisp_Cons.
8076
c644523b
DA
80772012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8078
8079 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
8080 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
8081 name since all xname users are fixed long time ago. Do not
8082 use INTERNAL_FIELD.
8083 (set_symbol_name, set_symbol_function, set_symbol_plist):
8084 (set_symbol_next, set_overlay_plist): New function.
8085 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
8086 (struct Lisp_Overlay): Likewise.
8087 (CVAR, MVAR, SVAR): Remove.
8088 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
8089 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
8090 * xterm.c: Adjust users.
8091 * .gdbinit: Change to use name field of struct Lisp_Symbol
8092 where appropriate.
8093
6a3d20cc
DA
80942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8095
8096 Basic functions to set Lisp_Object and pointer slots of intervals.
8097 * intervals.h (interval_set_parent, interval_set_object):
8098 (interval_set_left, interval_set_right, interval_set_plist):
8099 (interval_copy_parent): New function.
8100 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
8101 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
8102 Adjust indentation.
6a3d20cc
DA
8103 (INTERVAL_SIZE): Remove. Adjust users.
8104 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
8105
4d2b044c
DA
81062012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8107
8108 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
8109 * process.h (PGET): Remove.
8110 (struct Lisp_Process): Do not use INTERNAL_FIELD.
8111 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8112
d3d50620
DA
81132012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8114
8115 Drop WGET and revert read access to Lisp_Objects slots of struct window.
8116 * window.h (WGET): Remove.
8117 (struct window): Do not use INTERNAL_FIELD.
8118 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8119 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8120 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8121 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8122 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8123 Adjust users.
8124
d10a51dc
CY
81252012-08-07 Chong Yidong <cyd@gnu.org>
8126
8127 * window.c (Fwindow_edges, Fwindow_pixel_edges)
8128 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
8129 (Fdelete_window_internal): Signal an error if the window is not on
8130 a live frame (Bug#12025).
8131
e69b0960
DA
81322012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
8133
8134 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
8135 * frame.h (FGET): Remove.
8136 (struct frame): Do not use INTERNAL_FIELD.
8137 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8138 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8139 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8140 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8141
25a20a3a
JB
81422012-08-06 Juanma Barranquero <lekktu@gmail.com>
8143
8144 * w32.c: Silence compiler warnings.
8145 (map_w32_filename): Remove unused variable `is_fat'.
8146 (chase_symlinks): Add parentheses around expression.
8147
1c6f11f4
GM
81482012-08-06 Glenn Morris <rgm@gnu.org>
8149
1db4583a
GM
8150 * sysdep.c: Respect BROKEN_GETWD.
8151
1c6f11f4
GM
8152 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
8153 Let configure handle it.
8154 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
8155
2b90362b
DA
81562012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8157
8158 Use GCALIGNMENT where appropriate.
8159 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
8160 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
8161 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
8162
5f50daf2
EZ
81632012-08-06 Eli Zaretskii <eliz@gnu.org>
8164
14ae4239
BT
8165 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
8166 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 8167
cbcc7007
SM
81682012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
8169
8170 * buffer.h (struct buffer): Revert `indirections' to a simple int;
8171 that should be sufficient for everyone.
8172
4d365fa4
JD
81732012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8174
8175 * keyboard.c (timer_check_2): Add break so timer_check returns next
8176 timeout.
8177
dd86bd82
DA
81782012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8179
8180 Fix Windows build errors introduced after converting to WGET and WSET.
8181 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
8182 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8183
054e1668
JD
81842012-08-06 Jan Djärv <jan.h.d@swipnet.se>
8185
8186 * nsterm.m (ns_frame_rehighlight): Use FSET.
8187
8188 * nsmenu.m (ns_update_menubar): Use FSET.
8189
21238f11
DA
81902012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8191
8192 Separate read and write access to Lisp_Object slots of Lisp_Process.
8193 * process.h (PGET, PSET): New macros similar to AREF and ASET.
8194 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
8195
077288cf
DA
81962012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8197
8198 Separate read and write access to Lisp_Object slots of struct window.
8199 * window.h (WGET, WSET): New macros similar to AREF and ASET.
8200 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8201 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8202 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
8203 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
8204 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
8205 Adjust users.
8206
71688bd7
DA
82072012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8208
8209 Fix Windows build errors introduced after converting to FGET and FSET.
8210 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
8211 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
8212 (w32_judge_scroll_bars): Change to use FSET.
8213 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
8214
f99bac93
DA
82152012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8216
8217 Fix replacement typo.
8218 * window.c (replace_window): Set root_window instead of
8219 selected_window. This fixes a total window subsystem
8220 malfunction reported by Bastien Guerry <bzg@gnu.org>.
8221
8c2a0f2d
GM
82222012-08-06 Glenn Morris <rgm@gnu.org>
8223
8224 * lisp.mk (lisp): Add language/persian.elc.
8225
edd74c35
DA
82262012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
8227
8228 Separate read and write access to Lisp_Object slots of struct frame.
8229 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
8230 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
8231 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
8232 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
8233 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
8234
8671676c
AS
82352012-08-05 Andreas Schwab <schwab@linux-m68k.org>
8236
8237 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
8238
663e2b3f
DA
82392012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
8240
8241 Generalize common compile-time constants.
8242 * lisp.h (header_size, bool_header_size, word_size): Now here.
8243 (struct Lisp_Vector): Add comment.
8244 (struct Lisp_Bool_Vector): Move up to define handy constants.
8245 (VECSIZE, PSEUDOVECSIZE): Simplify.
8246 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
8247 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
8248 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
8249 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
8250 * xfont.c, xmenu.c: Use word_size where appropriate.
8251
d32e47af
LM
82522012-08-05 Lawrence Mitchell <wence@gmx.li>
8253
8254 * search.c (Freplace_match): Treat \? in the replacement text
8255 literally (Bug#8161).
8256
e5d9c0d1
CY
82572012-08-05 Chong Yidong <cyd@gnu.org>
8258
8259 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
8260 * frame.c (Vdelete_frame_functions):
8261 * emacs.c (Vkill_emacs_hook): Doc fix.
8262
8da0576b
EZ
82632012-08-04 Eli Zaretskii <eliz@gnu.org>
8264
8265 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
8266 --with-x-toolkit=no builds.
8267 Reported by Carsten Mattner <carstenmattner@gmail.com>.
8268
02676e5d
CY
82692012-08-04 Chong Yidong <cyd@gnu.org>
8270
8271 * syntax.c (Fmodify_syntax_entry): Doc fix.
8272
97147da9
EZ
82732012-08-04 Eli Zaretskii <eliz@gnu.org>
8274
76151e2c
EZ
8275 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
8276 * w32.c (init_environment): Change the default values of many
8277 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
8278 them into environment when they were not already defined.
8279 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 8280 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
8281 (check_windows_init_file): Now external, not static.
8282 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
8283 called when Vload_path is already set up.
8284
8285 * w32.h (check_windows_init_file): Add prototype.
8286
8287 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
8288 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
8289 compatibility with Posix platforms.
8290 (main): Move the call to check_windows_init_file to here from
8291 w32.c.
8292 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
8293 any, in the DEFALT argument into the root of the Emacs build or
8294 installation tree, as appropriate.
8295
8296 * callproc.c (init_callproc_1): Call decode_env_path instead of
8297 doing its equivalent by hand.
8298 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
8299 the code that sets Vexec_path run on MS-Windows.
8300
8301 * lread.c (init_lread): Add comments to #ifdef's.
8302
97147da9
EZ
8303 * msdos.c (dos_set_window_size, IT_update_begin)
8304 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
8305 instead of direct references.
8306
185ee146
PE
83072012-08-04 Paul Eggert <eggert@cs.ucla.edu>
8308
8309 Export DEFAULT_REHASH_* to GDB.
8310 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
8311 Now constants, not macros.
8312
8834c57a
PE
83132012-08-03 Paul Eggert <eggert@cs.ucla.edu>
8314
98c6f1e3
PE
8315 Remove unnecessary casts involving pointers.
8316 These casts are no longer needed now that we assume C89 or later,
8317 since they involve casting to or from void *.
8318 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
8319 (make_pure_float, make_pure_vector):
8320 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
8321 * macros.c (Fstart_kbd_macro):
8322 * menu.c (find_and_return_menu_selection):
8323 * minibuf.c (read_minibuf_noninteractive):
8324 * sysdep.c (closedir):
8325 * xdisp.c (x_produce_glyphs):
8326 * xfaces.c (compare_fonts_by_sort_order):
8327 * xfns.c (x_real_positions, select_visual):
8328 * xselect.c (x_stop_queuing_selection_requests)
8329 (x_get_window_property, x_get_window_property_as_lisp_data):
8330 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
8331 Remove unnecessary pointer casts.
8332 * alloc.c (record_xmalloc): New function.
8333 * lisp.h (record_xmalloc): New decl.
8334 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
8335 more like a function. This is because the pointer cast is not
8336 needed. All uses changed.
8337 * print.c (print_string, print_error_message): Avoid length recalc.
8338
8834c57a
PE
8339 Improve fix for macroexp crash with debugging (Bug#12118).
8340 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
8341 ARRAY_MARK_FLAG when checking subscripts, because ASET is
8342 not supposed to be invoked from the garbage collector.
8343 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
8344 (gc_aset): New function, which is like ASET but can be
8345 used in the garbage collector.
8346 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8347 (set_hash_index): Use it instead of ASET.
8348
6dad7178
EZ
83492012-08-03 Eli Zaretskii <eliz@gnu.org>
8350
8351 Support symlinks on latest versions of MS-Windows.
8352 * w32.c: Include winioctl.h and aclapi.h.
8353 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
8354 (revert_to_self): Forward declarations of static functions.
8355 <static BOOL g_b_init_get_security_info>:
8356 <g_b_init_create_symbolic_link>: New static flags.
8357 (globals_of_w32): Initialize them to zero.
8358 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
8359 (map_w32_filename): Improve commentary. Simplify switch.
8360 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
8361 headers (most versions of MinGW w32api don't).
8362 (get_security_info, create_symbolic_link)
8363 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
8364 New functions.
8365 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
8366 in the argument file name.
8367 (sys_access): Call unc_volume_file_attributes only if
8368 GetFileAttributes fails with network-related error codes.
8369 (sys_rename): Diagnose renaming of a symlink when the user doesn't
8370 have the required privileges.
14ae4239 8371 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
8372 get_file_security_desc.
8373 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
8374 with addition of handling of symlinks and support for 'lstat'.
8375 If possible, get file's attributes and security information by
6dad7178
EZ
8376 handle, not by name. Produce S_IFLNK bit for symlinks, when
8377 called from 'lstat'.
8378 (stat, lstat): New functions, call 'stat_worker'.
8379 (symlink, readlink, careadlinkat): Rewritten to create and resolve
8380 symlinks when the underlying filesystem supports them.
8381
f162bcc3
PE
83822012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8383
79ea6c20
PE
8384 Fix macroexp crash on Windows with debugging (Bug#12118).
8385 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
8386 checking subscripts; problem introduced with the recent
8387 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
8388 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
8389 since it's used in non-static inline functions now.
8390
c0ce93fd
PE
8391 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
8392 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 8393
f162bcc3
PE
8394 Use C99-style 'extern inline' if available.
8395 * buffer.h (BUFFER_INLINE):
8396 * category.h (CATEGORY_INLINE):
8397 * character.h (CHARACTER_INLINE):
8398 * charset.h (CHARSET_INLINE):
8399 * composite.h (COMPOSITE_INLINE):
8400 * dispextern.h (DISPEXTERN_INLINE):
8401 * lisp.h (LISP_INLINE):
8402 * systime.h (SYSTIME_INLINE):
8403 New macro, replacing 'static inline' in this header.
8404 * buffer.h, category.h, character.h, charset.h, composite.h:
8405 * dispextern.h, lisp.h, systime.h:
8406 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
8407 * alloc.c (LISP_INLINE):
8408 * buffer.c (BUFFER_INLINE):
8409 * category.c (CATEGORY_INLINE):
8410 * character.c (CHARACTER_INLINE):
8411 * charset.c (CHARSET_INLINE):
8412 * composite.c (COMPOSITE_INLINE):
8413 * dispnew.c (DISPEXTERN_INLINE):
8414 * sysdep.c (SYSTIME_INLINE):
8415 Define to EXTERN_INLINE, so that the corresponding functions
8416 are compiled into code.
8417 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
8418 (INLINE_HEADER_END): New macros.
8419 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
8420 since it's used in non-static inline functions now.
a8333d03 8421 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 8422
837b365b
GM
84232012-08-02 Glenn Morris <rgm@gnu.org>
8424
d66b744d
GM
8425 * s/: Remove empty directory.
8426
837b365b
GM
8427 * s/ms-w32.h: Move to ../nt/inc.
8428 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
8429 Update for new ms-w32.h location.
8430
13294f95
PE
84312012-08-02 Paul Eggert <eggert@cs.ucla.edu>
8432
8433 Port to Solaris 8.
8434 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
8435
90df0db3
GM
84362012-08-02 Glenn Morris <rgm@gnu.org>
8437
8438 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
8439 hard-coding the path separator.
8440
4939150c
PE
84412012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8442
8443 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
8444 This how ASET and AREF are supposed to work, and makes
8445 it easier to think about future improvements. See
8446 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
8447 * charset.h (set_charset_attr): New function.
8448 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
8449 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
8450 (aref_addr): New function. All uses of &AREF(...) changed.
8451 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
8452 (set_hash_index): New functions. All lvalue-style uses of
8453 HASH_KEY etc. changed.
8454 * keyboard.c (set_prop): New function. All lvalue-style uses
8455 of PROP changed.
8456
947b2afd
AA
84572012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
8458
8459 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
8460 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1f9f395d 8461 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
947b2afd
AA
8462 * nsfns.m (ns_set_name_as_filename): Likewise.
8463 * nsmenu.m (ns_update_menubar): Likewise.
8464 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
8465
4f5d0325
EZ
84662012-08-01 Eli Zaretskii <eliz@gnu.org>
8467
2008beae
EZ
8468 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
8469 Adapt to latest changes in field names of the corresponding Lisp
288479f6 8470 objects.
2008beae 8471
4f5d0325
EZ
8472 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
8473
fe3cc771
GM
84742012-08-01 Glenn Morris <rgm@gnu.org>
8475
8476 * s/msdos.h: Remove file.
8477 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
8478 * Makefile.in (S_FILE): Remove.
8479 (config_h): Remove S_FILE.
8480
c90acc54
JB
84812012-08-01 Juanma Barranquero <lekktu@gmail.com>
8482
8483 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
8484 Remove; moved to nt/config.nt.
8485
d8a05828
DA
84862012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8487
8488 Use INTERNAL_FIELD for conses and overlays.
8489 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
8490 Remove obsolete comment.
8491 (MVAR): New macro.
8492 (struct Lisp_Overlay): Use INTERNAL_FIELD.
8493 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
8494
8271d590
DA
84952012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8496
8497 Use INTERNAL_FIELD for symbols.
8498 * lisp.h (SVAR): New macro. Adjust users.
8499 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
8500 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
8501
3193acd2
DA
85022012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8503
8504 Use INTERNAL_FIELD for processes.
8505 * process.h (PVAR): New macro. Adjust style.
8506 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
8507 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
8508
3a45383a
DA
85092012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
8510
8511 Use INTERNAL_FIELD for windows.
8512 * window.h (WVAR): New macro.
8513 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
8514 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
8515 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
8516 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
8517 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
8518 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8519
c1dbc63c
PE
85202012-08-01 Paul Eggert <eggert@cs.ucla.edu>
8521
8522 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
8523
5c0c0e8a
GM
85242012-08-01 Glenn Morris <rgm@gnu.org>
8525
8526 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
8527 Move to configure.ac.
8528
552a99b4
JB
85292012-08-01 Juanma Barranquero <lekktu@gmail.com>
8530
8531 * makefile.w32-in (CONFIG_H): Update dependencies.
8532 (CONF_POST_H): New macro.
8533
8534 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
8535
8d8e2dfe
GM
85362012-07-31 Glenn Morris <rgm@gnu.org>
8537
bc96620a
GM
8538 * Makefile.in (S_FILE): No longer set by configure.
8539
476b1b2d
GM
8540 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
8541 is available.
8542 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
8543
b2c7a106
GM
8544 * process.h (NULL_DEVICE):
8545 * emacs.c (SEPCHAR):
8546 * editfns.c (USER_FULL_NAME): Let configure set them.
8547
d53d062a
GM
8548 * s/README, s/template.h: Remove files.
8549
4515017f
GM
8550 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
8551
8d8e2dfe
GM
8552 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
8553 Move to configure.ac.
8554
5b20b3cc
EZ
85552012-07-31 Eli Zaretskii <eliz@gnu.org>
8556
1e0afd9a
EZ
8557 * .gdbinit (xframe): Adapt to introduction of FVAR and the
8558 resulting renaming of 'struct frame' members.
8559
5b20b3cc
EZ
8560 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
8561
8562 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
8563 after introduction of FVAR.
8564
f1310128
JD
85652012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8566
79e721e0
JD
8567 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
8568
8569 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
8570 instead of compositeToPoint.
8571 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
8572
8d7c7eed 8573 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 8574
e34f7f79
DA
85752012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8576
8577 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
8578 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 8579 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
8580 (BVAR): Change to use INTERNAL_FIELD.
8581 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
8582 (KVAR): Change to use INTERNAL_FIELD.
8583 * frame.h (FVAR): New macro.
8584 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
8585 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
8586 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
8587 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
8588 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
8589
c09bfb2f
DA
85902012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
8591
8592 Miscellaneous fixes for non-default X toolkits.
8593 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
8594 * xterm.c (x_frame_of_widget): Remove redundant prototype.
8595 Move under #ifdef USE_LUCID.
8596 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
8597 definition and usage to avoid warnings.
8598
14c114ae
JD
85992012-07-31 Jan Djärv <jan.h.d@swipnet.se>
8600
8601 * nsterm.m (openFiles): Fix previous checkin.
8602
3bd21e82
PE
86032012-07-31 Paul Eggert <eggert@cs.ucla.edu>
8604
8605 * indent.c (compute_motion): Remove unused local.
8606
c1529ded
GM
86072012-07-31 Glenn Morris <rgm@gnu.org>
8608
400d5621
GM
8609 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
8610
268e2432
GM
8611 * conf_post.h [USG5_4]:
8612 Move remaining contents of s/usg5-4-common.h here.
8613 * s/usg5-4-common.h: Remove file.
8614
7552f3ee
GM
8615 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
8616 * s/irix6-5.h: Remove file.
8617
6a381852
GM
8618 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
8619 * s/darwin.h: Remove file.
8620
c1529ded
GM
8621 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
8622 * s/hpux10-20.h: Remove file, which is now empty.
8623
b429a4ee
GM
86242012-07-30 Glenn Morris <rgm@gnu.org>
8625
8626 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
8627 * Makefile.in (config_h): Add conf_post.h.
8628 * makefile.w32-in (CONFIG_H): Add conf_post.h.
8629
adff3182
JD
86302012-07-30 Jan Djärv <jan.h.d@swipnet.se>
8631
8632 * nsterm.m (ns_do_open_file): New variable.
b9031d69 8633 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
8634 (openFile, openTempFile, openFileWithoutUI, openFiles):
8635 Open files only if ns_do_open_file.
adff3182 8636
c32af1e4
PE
86372012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8638
7393bcbb
PE
8639 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
8640 This no-op macro hasn't been needed for many years.
8641 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
8642
c32af1e4
PE
8643 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
8644 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
8645 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
8646 gdb_make_enums_visible.
8647 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
8648 (DIRECTORY_SEP): Now a constant, not a macro.
8649
302fc036
EZ
86502012-07-30 Eli Zaretskii <eliz@gnu.org>
8651
8652 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
8653 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
8654
8655 * w32term.c <w32_keyboard_codepage>: Renamed from
8656 keyboard_codepage and now external. All users changed.
8657
8658 * w32term.h: Add declaration of w32_keyboard_codepage.
8659
8660 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
8661 the codepage to translate keys to Unicode. If this argument is
8662 -1, use the value returned by GetConsoleCP. All callers changed.
8663
88fb40b4
PE
86642012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8665
0aee6912
PE
8666 Update .PHONY listings in makefiles.
8667 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
8668 bootstrap-clean, distclean, maintainer-clean, versioclean,
8669 extraclean, frc.
8670
88fb40b4
PE
8671 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
8672 This is a bit clearer. Fix some commentary typos.
8673
0a763bd1
GM
86742012-07-30 Glenn Morris <rgm@gnu.org>
8675
32bac6d6
GM
8676 * s/netbsd.h: Let configure include signal.h if needed.
8677 Remove file, which is now empty.
8678
b65e7c46
GM
8679 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
8680 Let configure set them.
8681 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
8682 No more need to undefine.
0a763bd1 8683
169304bd
AS
86842012-07-30 Andreas Schwab <schwab@linux-m68k.org>
8685
8686 * keymap.c (Fkey_description): Don't remove 0x80 bit from
8687 non-single-byte char when adding meta modifier. (Bug#12090)
8688
6cd7a139
DA
86892012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8690
8691 Convert safe_call to use variable number of arguments.
8692 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
8693 (safe_call2): Fix comment.
8694 * lisp.h (safe_call): Adjust prototype.
8695 * coding.c (encode_coding_object): Change to use safe_call2.
8696 * xfaces.c (merge_face_heights): Change to use safe_call1.
8697
d34d6ffc
GM
86982012-07-30 Glenn Morris <rgm@gnu.org>
8699
7b8a48e4 8700 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 8701 does that unconditionally. Remove file, which is now empty.
7b8a48e4 8702
d34d6ffc
GM
8703 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
8704 Remove empty files.
8705
03a660a6
PE
87062012-07-30 Paul Eggert <eggert@cs.ucla.edu>
8707
8708 Export to GDB most of lisp.h's remaining object-like macros.
8709 * lisp.h (min, max): Move earlier, because they're used earlier now.
8710 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
8711 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
8712 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
8713 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
8714 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
8715 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
8716 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
8717 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
8718 Now constants, for GDB. They need not be macros.
8719 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
8720 Now constants, for GDB, as well as macros, for static initializers.
8721 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
8722 Move to after the definition of struct Lisp_Char_Table,
8723 since the former now needs that type defined.
8724 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
8725 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
8726 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
8727 New enums, for gdb_make_enums_visible.
8728 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 8729 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
8730 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
8731 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
8732 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
8733 enum maxargs, enum MAX_ALLOCA.
8734 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
8735 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
8736 no longer needed, now that they are done in lisp.h.
8737
e499d0ee
DA
87382012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
8739
8740 Cleanup string bytes checking.
8741 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
8742 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
8743 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
8744 (check_sblock, compact_small_strings): Simplify.
8745
d5040d2d
PE
87462012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8747
8748 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
8749 These macros are confusing and no longer need to be defined, as
8750 the enum values now suffice. All uses replaced with definiens.
8751 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
8752
7f259ae6
JB
87532012-07-29 Juanma Barranquero <lekktu@gmail.com>
8754
8755 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
8756 ($(BLD)/w32console.$(O)): Update dependencies.
8757
7e63e0c3
DA
87582012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8759
8760 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
8761 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
8762 time. Adjust users.
8763 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
8764
ffd817eb
JD
87652012-07-29 Jan Djärv <jan.h.d@swipnet.se>
8766
8767 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
8768 setting sitelisp (Bug#12010).
8769
417a7a0e
EZ
87702012-07-29 Eli Zaretskii <eliz@gnu.org>
8771
14ae4239 8772 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
8773
8774 * w32heap.c (cache_system_info):
8775 * w32.c (sys_rename):
8776 * w32proc.c (find_child_console, sys_kill): All users changed.
8777
387d4d92
PE
87782012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8779
8780 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
8781
55a6cca6
EZ
87822012-07-29 Eli Zaretskii <eliz@gnu.org>
8783
8784 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
8785
dbcf001c
DA
87862012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8787
8788 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
8789 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
8790 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 8791
e2688e4a
DA
87922012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
8793
8794 Generalize marker debugging code under MARKER_DEBUG and use eassert.
8795 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
8796 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
8797 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
8798 (replace_range, replace_range_2, del_range_2): Change to eassert.
8799 * marker.c (byte_char_debug_check): Adjust style.
8800
b46a6a83
PE
88012012-07-29 Paul Eggert <eggert@cs.ucla.edu>
8802
8803 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
8804 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
8805 long-ago-commented-out code that talks about "WIN32".
8806 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
8807 All uses changed.
8808
e32a5799
PE
88092012-07-28 Paul Eggert <eggert@cs.ucla.edu>
8810
8811 Use Gnulib stdalign module (Bug#9772, Bug#9960).
8812 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
8813 Simplify by using alignof.
8814 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
8815 * lisp.h: Include <stdalign.h>.
8816 (GCALIGNMENT): New macro and constant.
8817 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
8818 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
8819 (stdalign): New macro, if not already defined.
8820
df81cd29
EZ
88212012-07-28 Eli Zaretskii <eliz@gnu.org>
8822
01bd1b0d
EZ
8823 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
8824 * w32inevt.c: Include w32inevt.h.
8825 (w32_read_console_input): New inline function, calls either
8826 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
8827 w32_console_unicode_input.
8828 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
8829 (w32_kbd_patch_key, key_event): Use the codepage returned by
8830 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
8831 (key_event): use uChar.UnicodeChar only if
8832 w32_console_unicode_input is non-zero.
8833
8834 * w32console.c: Include w32heap.h.
8835 <w32_console_unicode_input>: New global variable.
8836 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
8837 family of Windows, zero otherwise.
8838
8839 * w32inevt.h: Declare w32_console_unicode_input.
8840
df81cd29
EZ
8841 * xdisp.c (init_iterator): Don't reference tip_frame in a build
8842 --without-x. (Bug#11742)
8843
c20fdd9e
PE
88442012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8845
8846 Adjust GDB to reflect pvec_type changes (Bug#12036).
8847 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
8848 2012-07-04 changes to pseudovector representation.
8849 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 8850
32770973 88512012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
8852
8853 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
8854 bus address.
8855 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
8856
3438fe21
EZ
88572012-07-27 Eli Zaretskii <eliz@gnu.org>
8858
bcfbc9de
EZ
8859 * alloc.c (listn): Fix the order the arguments are consed onto the
8860 list.
8861
3438fe21
EZ
8862 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
8863 enumeration constants, as PURE and HEAP are too general, and clash
8864 with other headers and sources, such as gmalloc.c and the
8865 MS-Windows system headers. All users changed.
8866
eeaea515
DA
88672012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8868
8869 Revert last save_excursion_save and save_excursion_restore changes.
8870 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
8871 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
8872
073c88c2
DA
88732012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8874
8875 Fix recently-introduced typos in Windows port.
8876 Reported by Martin Rudalics <rudalics@gmx.at>.
8877 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 8878 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 8879
4706125e
PE
88802012-07-27 Paul Eggert <eggert@cs.ucla.edu>
8881
8882 Improve GDB symbol export (Bug#12036).
8883 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
8884 arms of an 'if', not using conditional expressions; otherwise GDB
8885 complains about the types in the unevaluated arm when the argument
8886 is an integer literal.
8887 (xgetint): Simplify expression.
8888 * alloc.c (gdb_make_enums_visible): New constant. This ports to
8889 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
8890 Zaretskii in <http://bugs.gnu.org/12036#13>.
8891 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
8892 needed now that we have gdb_make_enums_visible.
8893 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
8894 (enum enum_USE_LSB_TAG):
8895 New enum types, packaging up enums that need to be exported to GDB.
8896
694b6c97
DA
88972012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8898
8899 Utility function to make a list from specified amount of objects.
8900 * lisp.h (enum constype): New datatype.
8901 (listn): New prototype.
8902 * alloc.c (listn): New function.
8903 (Fmemory_use_count, syms_of_alloc): Use it.
8904 * buffer.c (syms_of_buffer): Likewise.
8905 * callint.c (syms_of_callint): Likewise.
8906 * charset.c (define_charset_internal): Likewise.
8907 * coding.c (syms_of_coding): Likewise.
8908 * keymap.c (syms_of_keymap): Likewise.
8909 * search.c (syms_of_search): Likewise.
8910 * syntax.c (syms_of_syntax): Likewise.
8911 * w32.c (init_environment): Likewise.
8912 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
8913 * xdisp.c (syms_of_xdisp): Likewise.
8914 * xfns.c (syms_of_xfns): Likewise.
8915
6195f384
DA
89162012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
8917
8918 Fast save_excursion_save and save_excursion_restore.
8919 * lisp.h (struct Lisp_Excursion): New data type.
8920 (PVEC_EXCURSION): New pseudovector type.
8921 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
8922 to deal with it. Adjust comments.
8923 (init_marker, attach_marker): New prototype.
8924 (unchain_marker): Adjust prototype.
8925 * marker.c (attach_marker): Change to global.
8926 (init_marker): New function.
8927 * alloc.c (Fmake_marker, build_marker): Use it.
8928 (build_marker): More easserts.
8929 (mark_object): Handle struct Lisp_Excursion.
8930 * editfns.c (save_excursion_save, save_excursion_restore):
8931 Reimplement to use struct Lisp_Excursion. Add comments.
8932
5eceb8fb
PE
89332012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8934
8935 Fix export of symbols to GDB (Bug#12036).
8936 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
8937 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
8938 emacs.c, as this is a more-suitable home. Had this been done earlier
8939 the fix for 12036 would have avoided some of the problems noted in
8940 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
8941 would have been more obvious.
562157c8
PE
8942 * emacs.c: Do not include <verify.h>; no longer needed.
8943 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
8944 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
8945 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8946 Remove; now done in lisp.h.
8947 * lisp.h (PUBLISH_TO_GDB): New macro.
8948 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
8949 (DATA_SEG_BITS): Use it.
8950 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
8951 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
8952 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
8953 not be usable in #if. This simplifies things.
8954
d6749401
JB
89552012-07-26 Juanma Barranquero <lekktu@gmail.com>
8956
8957 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
8958
1781b9e9
PE
89592012-07-26 Paul Eggert <eggert@cs.ucla.edu>
8960
d89518db 8961 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
8962 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
8963 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
8964 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
8965 Adjust to changes in lisp.h and emacs.c, by using
8966 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
8967 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
8968 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
8969 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
8970 instead of gdb_valbits.
8971 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
8972 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
8973 instead of gdb_array_mark_flag.
8974 (xboolvector): Get size from $->size, not $->header.size.
8975 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
8976 (xreload, hook-run, hookpost-run): Remove.
8977 * emacs.c: Include <verify.h>.
8978 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
8979 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
8980 Remove.
8981 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
8982 (gdb_USE_LSB_TAG): New enum constants.
8983 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
8984 Also define these as enum constants, so they're visible to GDB.
8985 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
8986 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
8987 as constants, so they're visible to GDB.
8988 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
8989 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
8990 Now enum constants, not macros, so they're visible to GDB.
8991 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
8992 more convenient now. All uses changed.
8993 (VALMASK) [USE_LSB_TAG]: Also define in this case.
8994 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
8995
3628596a
DA
89962012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
8997
8998 Explicitly free restriction data that are not needed anymore.
8999 * editfns.c (save_restriction_restore): Free restriction data.
9000
7abaf5cc
SM
90012012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
9002
9003 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
9004 add argument, tune behavior, and adjust all callers.
9005
71f88e00
PE
90062012-07-25 Paul Eggert <eggert@cs.ucla.edu>
9007
9008 Use typedef for EMACS_INT, EMACS_UINT.
9009 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
9010 than macros. This simplifies debugging in the usual case, since
9011 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
9012 and it allows expressions involving EMACS_INT casts.
9013 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
9014
57ec3034
JD
90152012-07-25 Jan Djärv <jan.h.d@swipnet.se>
9016
9017 * nsterm.m (ns_read_socket): Return early if there is a modal
9018 window (Bug#12043).
9019
8137e7b3
MR
90202012-07-25 Martin Rudalics <rudalics@gmx.at>
9021
9022 * frame.c (Fredirect_frame_focus): In doc-string don't mention
9023 that FOCUS-FRAME can be omitted.
9024
04e9897c
DA
90252012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
9026
9027 Adjust buffer text indirection counters at the end of Fkill_buffer.
9028 * buffer.c (Fkill_buffer): Adjust indirection counters when the
9029 buffer is definitely dead. This should really fix an issue reported
9030 by Christoph Scholtes again. (Bug#12007).
9031 (init_buffer_once): Initialize indirection counters of
9032 buffer_defaults and buffer_local_symbols (for sanity and safety).
9033
8a0484e1
EZ
90342012-07-24 Eli Zaretskii <eliz@gnu.org>
9035
9036 * xdisp.c (init_iterator): Don't compute dimensions of truncation
9037 and continuation glyphs on tooltip frames, leave them at zero.
9038 Avoids continued lines in tooltips. (Bug#11832)
9039
fa691a83
DA
90402012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
9041
9042 Simplify copy_overlay.
04e9897c 9043 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
9044 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
9045
436bc8e0
EZ
90462012-07-23 Eli Zaretskii <eliz@gnu.org>
9047
9048 * print.c (print_object): Don't crash when a frame's name is nil
9049 or invalid. (Bug#12025)
9050
9051 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
9052 it signals an error when a tooltip frame is being created.
9053
d7a7fda3
DA
90542012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
9055
9056 Cleanup miscellaneous objects allocation and initialization.
9057 * alloc.c (allocate_misc): Change to static. Add argument to
9058 specify the subtype. Adjust comment and users.
9059 (build_overlay): New function.
9060 * buffer.c (copy_overlays, Fmake_overlay): Use it.
9061 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
9062 (allocate_misc): Remove prototype.
9063 (build_overlay): Add prototype.
9064
90652012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
9066
9067 Swap buffer text indirection counters in Fbuffer_swap_text.
9068 * buffer.c (Fbuffer_swap_text): Swap indirections too.
9069 This avoids crash reported by Christoph Scholtes at
9070 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
9071
9d7fa573
JD
90722012-07-22 Jan Djärv <jan.h.d@swipnet.se>
9073
9074 * nsmenu.m (Popdown_data): New struct.
9075 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
9076 free Popdown_data.
9077 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
9078 (initWithContentRect): Make imgView and contentView non-static
9079 and autorelease them. Also autorelease img and matrix (Bug#12005).
9080 (dealloc): Remove (Bug#12005).
9081
0dd6d66d
DA
90822012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9083
9084 Adjust consing_since_gc when objects are explicitly freed.
9085 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
9086 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
9087 (free_cons, free_misc): Subtract object size from consing_since_gc.
9088
d36d71df
DA
90892012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
9090
9091 Simplify and cleanup markers positioning code.
9092 * marker.c (attach_marker): More useful eassert.
9093 (live_buffer, set_marker_internal): New function.
9094 (Fset_marker, set_marker_restricted): Use set_marker_internal.
9095 (set_marker_both, set_marker_restricted_both): Use live_buffer.
9096
fb9ea40f
PE
90972012-07-22 Paul Eggert <eggert@cs.ucla.edu>
9098
9099 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
9100 as it's limited by the amount of memory, not by INT_MAX.
9101
2d5c5f7d
EZ
91022012-07-21 Eli Zaretskii <eliz@gnu.org>
9103
07fb592e
EZ
9104 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
9105 in special-event-map. See the discussion at
9106 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
9107 for the reasons.
9108
37a9eac8 9109 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
9110 info.dwItemData. Fixes crashes on 64-bit Windows.
9111 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 9112
c4328746
JD
91132012-07-21 Jan Djärv <jan.h.d@swipnet.se>
9114
fc0c31f8 9115 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 9116 (conversationIdentifier): Return value is NSInteger.
784051c4 9117 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 9118
6e5d1c12
CY
91192012-07-21 Chong Yidong <cyd@gnu.org>
9120
9121 * window.c (decode_any_window): Signal an error if the window is
9122 on a dead frame (Bug#11984).
9123
9928463d
DA
91242012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9125
9126 Add indirection counting to speed up Fkill_buffer.
9127 * buffer.h (struct buffer): New member.
9128 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
9129 (Fmake_indirect_buffer): Set indirection counter to -1, increment
9130 base buffer indirection counter.
9131 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
9132 (Fkill_buffer): Adjust indirection counters as needed, don't walk
9133 through buffer list if indirection counter is 0.
9134
f8643a6b
DA
91352012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9136
9137 Extend the value returned by Fgarbage_collect with heap statistics.
9138 * alloc.c (Qheap): New symbol.
9139 (syms_of_alloc): DEFSYM it.
9140 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
9141 (Fmemory_free): Remove.
9142 (syms_of_alloc): Don't defsubr it.
9143 * buffer.c (Fcompact_buffer): Remove.
9144 (syms_of_buffer): Don't defsubr it.
9145
dac616ff
DA
91462012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9147
9148 Make maybe_gc inline.
9149 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
9150 * lisp.h (consing_since_gc, gc_relative_threshold)
9151 (memory_full_cons_threshold): Revert declaration.
9152 (maybe_gc): Remove prototype, define as inline.
9153 * alloc.c: Remove old commented-out code.
9154 (consing_since_gc, gc_relative_threshold)
9155 (memory_full_cons_threshold): Revert to global.
9156 (maybe_gc): Remove.
9157
d7ea76b4
DA
91582012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9159
9160 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
9161 * lisp.h (build_unibyte_string): New function.
9162 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
9163 * sysdep.c, w32fns.c, xfns.c: Use it.
9164 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
9165 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
9166 Adjust users accordingly.
9167 * font.h (font_open_by_name): Adjust prototype.
9168
765e61e3
DA
91692012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
9170
9171 Cleanup calls to Fgarbage_collect.
9172 * lisp.h (maybe_gc): New prototype.
9173 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9174 Remove declarations.
9175 * alloc.c (maybe_gc): New function.
9176 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
9177 Make them static.
9178 * bytecode.c (MAYBE_GC): Use maybe_gc.
9179 * eval.c (eval_sub, Ffuncall): Likewise.
9180 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
9181 to avoid dependency from auto-save feature.
9182
52b852c7
PE
91832012-07-19 Paul Eggert <eggert@cs.ucla.edu>
9184
9185 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
9186 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
9187 'for_each_per_buffer_object_at'.
9188 All uses changed. It's better to use upper-case for macros that
9189 cannot be implemented as functions, to give the reader a clue
9190 that they're special.
9191
5db81e33
SM
91922012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
9193
9194 * alloc.c (Fgarbage_collect): Tweak docstring.
9195
5b835e1d
DA
91962012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9197
9198 Tweak the value returned from Fgarbage_collect again.
9199 * alloc.c (Fgarbage_collect): New return value, as confirmed in
9200 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
9201 Adjust documentation.
9202 (total_vector_bytes): Rename to total_vector_slots, adjust
9203 accounting.
9204 (total_free_vector_bytes): Rename to total_free_vector_slots,
9205 adjust accounting.
9206 (Qstring_bytes, Qvector_slots): New symbols.
9207 (syms_of_alloc): DEFSYM them.
9208
9cd47b72
DA
92092012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9210
9211 Buffer compaction primitive which may be used from Lisp.
9212 * buffer.c (compact_buffer, Fcompact_buffer): New function.
9213 (syms_of_buffer): Register Fcompact_buffer.
9214 * alloc.c (Fgarbage_collect): Use compact_buffer.
9215 * buffer.h (compact_buffer): New prototype.
9216 (struct buffer_text): New member.
9217
d17337e5
DA
92182012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
9219
9220 New macro to iterate over all buffers, miscellaneous cleanups.
9221 * lisp.h (all_buffers): Remove declaration.
9222 * buffer.h (all_buffers): Add declaration, with comment.
9223 (for_each_buffer): New macro.
9224 * alloc.c (Fgarbage_collect, mark_object): Use it.
9225 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
9226 (init_buffer): Likewise.
9227 * data.c (Fset_default): Likewise.
9228 * coding.c (code_conversion_restore): Remove redundant check
9229 for dead buffer.
9230 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
9231
60cfd278
AS
92322012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9233
9234 Fix bug that created negative-length intervals.
9235 * intervals.c (merge_interval_right, merge_interval_left):
9236 Do not zero out this interval if it is absorbed by its children,
9237 as this interval's total length doesn't change in that case. See
9238 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
9239
d06714cb
PE
92402012-07-18 Paul Eggert <eggert@cs.ucla.edu>
9241
83713154
PE
9242 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
9243 when invoking (make-bool-vector N t) and N is a positive
9244 multiple of 8 -- the last 8 bits were mistakenly cleared.
9245
d06714cb
PE
9246 Remove some struct layout assumptions in bool vectors.
9247 * alloc.c (bool_header_size): New constant.
9248 (header_size, word_size): Move earlier, as they're now used earlier.
9249 Use 'word_size' in a few more places, where it's appropriate.
9250 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
9251 padding before the data member of a bool vector.
9252 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
9253 than doing the check by hand with an abort ().
9254
464d5a5e
SM
92552012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
9256
5fbc0409
SM
9257 * eval.c (Fdefvar): Don't check constants since we only set the var if
9258 it's not yet defined anyway (bug#11904).
9259
464d5a5e
SM
9260 * lisp.h (last_undo_boundary): Declare new var.
9261 * keyboard.c (command_loop_1): Set it.
9262 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
9263 were auto-added by the command loop (bug#11774).
9264
8dc2e44a
AS
92652012-07-18 Andreas Schwab <schwab@linux-m68k.org>
9266
9267 * w32font.c (Qsymbol): Remove local definition.
9268 (syms_of_w32font): Don't DEFSYM it.
9269
169925ec
DA
92702012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9271
9272 Fix sweep_vectors to handle large bool vectors correctly.
9273 * alloc.c (sweep_vectors): Account total_vector_bytes for
9274 bool vectors larger than VBLOCK_BYTES_MAX.
9275
5fbfb018
CY
92762012-07-18 Chong Yidong <cyd@gnu.org>
9277
9278 * frame.c (x_set_frame_parameters): Revert bogus change introduced
9279 in 2012-05-25 commit by Paul Eggert (Bug#11738).
9280
3ab6e069
DA
92812012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
9282
9283 Return more descriptive data from Fgarbage_collect.
9284 Suggested by Stefan Monnier in
9285 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
9286 * alloc.c (bounded_number): New function.
9287 (total_buffers, total_vectors): New variable.
9288 (total_string_size): Rename to total_string_bytes, adjust users.
9289 (total_vector_size): Rename to total_vector_bytes, adjust users.
9290 (sweep_vectors): Account total_vectors and total_vector_bytes.
9291 (Fgarbage_collect): New return value. Adjust documentation.
9292 (gc_sweep): Account total_buffers.
9293 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
9294 (VECTOR_SIZE): Remove.
9295 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
9296 (Qinterval, Qmisc): New symbols.
9297 (syms_of_data): Initialize them.
9298 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
9299 (Qcons, Qbuffer): New declarations.
9300
6d02fe5b
PE
93012012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9302
9303 * alloc.c (Fmemory_free): Account for memory-free's own storage.
9304 Round up, not down. Improve doc.
9305
b7ffe040
DA
93062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9307
9308 Restore old code in allocate_string_data to avoid Faset breakage.
9309 Reported by Julien Danjou <julien@danjou.info> in
9310 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
9311 * alloc.c (allocate_string_data): Restore old code with minor
9312 adjustments, fix comment to explain this subtle issue.
9313
4dc7c8d5
SM
93142012-07-17 Eli Zaretskii <eliz@gnu.org>
9315
9316 Remove FILE_SYSTEM_CASE.
9317 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
9318
9319 * fileio.c (FILE_SYSTEM_CASE): Don't define.
9320 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
9321 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
9322 call-process-region passes it through expand-file-name.
9323
9324 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
9325
93262012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9327
9328 Fix crash when creating indirect buffer (Bug#11917)
9329 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
9330 Don't handle unbound variables specially if non-zero.
9331 (Fbuffer_local_variables): Pass zero.
9332 (clone_per_buffer_values): Pass non-zero.
9333
93342012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9335
9336 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
9337 to make the loop interruptible.
9338
93392012-07-17 Andreas Schwab <schwab@linux-m68k.org>
9340
9341 * gnutls.c (emacs_gnutls_handshake): Only retry if
9342 GNUTLS_E_INTERRUPTED.
9343
cce7fefc
DA
93442012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9345
9346 Cleanup and convert miscellaneous checks to eassert.
9347 * alloc.c (mark_interval): Fix comment, partially rephrase
9348 old comment from intervals.h (see below).
9349 * intervals.c (find_interval, adjust_intervals_for_insertion)
9350 (delete_interval, adjust_intervals_for_deletion)
9351 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
9352 Convert to eassert.
9353 (adjust_intervals_for_insertion, make_new_interval):
9354 Remove obsolete and unused code.
9355 * intervals.h (struct interval): Remove obsolete comment.
9356 * textprotp.c (erase_properties): Remove unused code.
9357 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
9358 (Fremove_list_of_text_properties): Convert to eassert.
9359
9ea10cc3
CY
93602012-07-17 Chong Yidong <cyd@gnu.org>
9361
9362 * editfns.c (Finsert_char): Doc fix.
9363
3900d5de
DA
93642012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9365
9366 Fix previous change to make Fmemory_free always accurate.
9367 * alloc.c (make_interval): Update total_free_intervals.
9368 (make_float): Likewise for total_free_floats.
9369 (free_cons, Fcons): Likewise for total_free_conses.
9370 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
9371 Likewise for total_free_vector_bytes.
9372 (Fmake_symbol): Likewise for total_free_symbols.
9373 (bytes_free): Remove.
9374
7098646f
DA
93752012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9376
9377 Simple free memory accounting feature.
9378 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
9379 (sweep_vectors): Accumulate size of free vectors.
9380 (Fgarbage_collect): Setup bytes_free.
9381 (Fmemory_free): New function.
9382 (syms_of_alloc): Register it.
9383
22657b40
DA
93842012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
9385
9386 Cleanup overlays checking.
9387 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
9388 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
9389 eassert and OVERLAYP.
9390 (sort_overlays): Change to use OVERLAYP.
9391
ddfc8813
RK
93922012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
9393
9394 * editfns.c (Finsert_char): Make it interactive, and make the
9395 second arg optional. Copy interactive spec and docstring from
9396 ucs-insert.
9397
7c26cf3c
PE
93982012-07-17 Paul Eggert <eggert@cs.ucla.edu>
9399
9400 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
9401 Unlike the other wrapped functions, fabs has an unspecified
9402 effect on errno.
9403
5d127af9
JD
94042012-07-16 Jan Djärv <jan.h.d@swipnet.se>
9405
9406 * nsterm.m (keyDown): Interpret flags without left/right bits
9407 as the left key (Bug#11670).
9408
6a0dd1d7
DA
94092012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9410
9411 Remove empty and useless init functions.
9412 * lisp.h (init_character_once, init_fns, init_image)
9413 (init_filelock, init_sound): Remove prototype.
9414 * character.c (init_character_once): Remove.
9415 * filelock.c (init_filelock): Likewise.
9416 * fns.c (init_fns): Likewise.
9417 * image.c (init_image): Likewise.
9418 * sound.c (init_sound): Likewise.
9419 * emacs.c (main): Adjust accordingly.
9420
7a6136fd
DA
94212012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
9422
9423 * gtkutil.h: Tiny cleanups.
9424 (use_old_gtk_file_dialog): Remove useless declaration.
9425 (xg_uses_old_file_dialog): Add suggested const attribute.
9426
ce811ad9
EZ
94272012-07-15 Eli Zaretskii <eliz@gnu.org>
9428
9429 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
9430 (bidi_paragraph_init): Use it to limit search forward for a strong
9431 directional character in abnormally large paragraphs full of
9432 neutral or weak characters. (Bug#11943)
9433
c9adfeaa
SF
94342012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
9435
9436 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
9437 the toolbar (Bug#9451).
9438 (xg_make_tool_item): Give the widget event box a transparent
9439 background.
9440
fff62aa9
DA
94412012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9442
9443 Cleanup basic allocation variables and functions.
9444 * alloc.c (ignore_warnings, init_intervals, init_float)
9445 (init_cons, init_symbol, init_marker): Remove.
9446 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
9447 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
9448 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
9449 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
9450 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
9451 (staticidx, init_alloc_once, init_strings, free_ablock):
9452 Remove redundant initialization.
9453 * fns.c (init_weak_hash_tables): Remove.
9454 * lisp.h (init_weak_hash_tables): Remove prototype.
9455
9730daca
DA
94562012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
9457
9458 Use zero_vector where appropriate.
9459 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
9460 accordingly.
9461 * lisp.h (zero_vector): New declaration.
9462 * font.c (null_vector): Remove.
9463 (syms_of_font): Remove initialization and staticpro.
9464 (font_list_entities, font_find_for_lface): Change to use zero_vector.
9465 * keymap.c (Faccessible_keymaps): Likewise.
9466
2e2d2a13
LL
94672012-07-15 Leo Liu <sdl.web@gmail.com>
9468
9469 * fringe.c: Fix typo in comments.
9470
cd276f6e
LL
94712012-07-14 Leo Liu <sdl.web@gmail.com>
9472
9473 * fringe.c: Add a new bitmap exclamation-mark.
9474
5a1131d9
EZ
94752012-07-14 Eli Zaretskii <eliz@gnu.org>
9476
9477 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
9478
9479 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
9480 (HAVE_MENUS): Don't define, defined by editing config.in with
9481 msdos/sed2v2.inp.
9482 (GMALLOC_INHIBIT_VALLOC): Don't define.
9483 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
9484
22e983b7
JB
94852012-07-14 Juanma Barranquero <lekktu@gmail.com>
9486
9487 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
9488
5b3f250f
GM
94892012-07-14 Glenn Morris <rgm@gnu.org>
9490
9491 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
9492 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
9493 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
9494
33d63ff4
GM
94952012-07-13 Glenn Morris <rgm@gnu.org>
9496
5b633342
GM
9497 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
9498
33d63ff4
GM
9499 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
9500 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
9501
b55b9f85
JD
95022012-07-13 Jan Djärv <jan.h.d@swipnet.se>
9503
0dc8cf50
JD
9504 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
9505 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
9506 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
9507 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
9508 where appropriate.
9509 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
9510 as boolean expression.
9511 (x_set_window_size): Remove unused variable toolbar.
9512 (ns_get_color_default, ns_mod_to_lisp): Remove.
9513 (ns_mouse_position): Remove unused variables xchar and ychar.
9514 (ns_compute_glyph_string_overhangs): Remove unused variable face.
9515 (ns_set_vertical_scroll_bar): Remove unused variable count.
9516 (ns_delete_terminal): Remove unused variable i.
9517 (ns_term_init): Remove unused variables r, g and b.
9518 (mouseDown): Remove unused variable window.
9519 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
9520 (initFrameFromEmacs): Remove unused variable vbextra.
9521 (mouseEntered): Remove unused variables p and dpyinfo.
9522 (mouseExited): Remove unused variables p and r.
9523 (ns_define_frame_cursor, ns_clear_frame_area)
9524 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
9525 (menuDown): Assign [sender tag] to variable and cast the variable.
9526
9527 * nsterm.h (menuDown): Add id as type to argument sender.
9528 (ns_display_info_for_name): Add Lisp_Object argument.
9529 (ns_term_init): Add Lisp_Object argument.
9530 (ns_map_event_to_object): Add void argument.
9531 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
9532 prototype with arguments and only declare if __OBJC__.
9533 (nxatoms_of_nsselect): Add void argument.
9534 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
9535 (ns_alloc_autorelease_pool): Add void argument.
9536 (ns_release_autorelease_pool): Add void* argument.
9537 (ns_get_defaults_value): Add const char* argument.
9538
9539 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
9540 (initFromContents): Use SSDATA where appropriate.
9541 (ns_update_menubar): Add braces to ambigous if-else.
9542 (initWithTitle): Put () around assignment in if statement.
9543 (ns_menu_show): Remove unused variables window and keymap.
9544 (update_frame_tool_bar): Remove unused variable selected_p.
9545 (initWithContentRect): Remove unused variable this_cmd_name.
9546
9547 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
9548 appropriate.
9549 (setXBMColor): Remove unused variable len.
9550 (setPixmapData): Put () around assignment in loop statement.
9551
9552 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
9553 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
9554 where appropriate.
9555 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
9556 around assignment in loop statement.
9557 (nsfont_open): Remove unused variable i.
9558 (nsfont_open): Remove unused variable len.
9559 (nsfont_draw): Remove unused variable cs.
9560
9561 * nsfns.m (x_set_icon_name, ns_set_name_internal)
9562 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
9563 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
9564 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
9565 (Fns_font_name, Fns_perform_service)
9566 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
9567 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
9568 (ns_set_name): Remove unused variable view.
9569 (x_set_menu_bar_lines): Remove unused variable olines.
9570 (x_set_tool_bar_lines): Remove unused variable root_window.
9571 (Fns_list_colors): Put () around assignment in while statement.
9572 (Fns_perform_service): Remove unused variable len.
9573 (Fns_display_usable_bounds): Remove unused variable top.
9574 (syms_of_nsfns): Remove unused variable i.
9575
b55b9f85
JD
9576 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
9577 memcpy (Bug#11907).
9578
ed9265fc 95792012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
9580
9581 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
9582 and free it with DestroyExceptionInfo (Bug#11558).
9583
ef099b57
JB
95842012-07-13 Juanma Barranquero <lekktu@gmail.com>
9585
9586 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
9587 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
9588 Set here, not in nt/config.nt.
9589
ea814a5d
EZ
95902012-07-13 Eli Zaretskii <eliz@gnu.org>
9591
9592 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
9593 cursor overflow into the last glyph on display line when the right
9594 fringe is off. (Bug#11832)
9595
1a952767
PE
95962012-07-13 Paul Eggert <eggert@cs.ucla.edu>
9597
9598 * xdisp.c (produce_special_glyphs): Now static.
9599 * dispextern.h (produce_special_glyphs): Remove decl.
9600
983188fd
GM
96012012-07-13 Glenn Morris <rgm@gnu.org>
9602
8d7c7eed 9603 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
9604 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
9605
983188fd
GM
9606 * s/usg5-4-common.h (USG, USG5):
9607 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
9608 * s/sol2-6.h (SOLARIS2):
9609 * s/irix6-5.h (IRIX6_5):
9610 * s/hpux10-20.h (USG, USG5, HPUX):
9611 * s/gnu-linux.h (USG, GNU_LINUX):
9612 * s/freebsd.h (BSD_SYSTEM):
9613 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
9614 * s/cygwin.h (CYGWIN):
9615 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
9616 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
9617
d1e68667 96182012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
9619
9620 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 9621
6de0e799
GM
96222012-07-13 Glenn Morris <rgm@gnu.org>
9623
739ae010
GM
9624 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
9625
dbee5793
GM
9626 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
9627
6de0e799
GM
9628 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
9629 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
9630
b82da769
GM
96312012-07-12 Glenn Morris <rgm@gnu.org>
9632
4fae5a7a 9633 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
9634
9635 * process.c (init_process_emacs): Rename from init_process.
9636 The old name is also the name of a Mach system call.
9637 * lisp.h, emacs.c: Update for this name change.
9638 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
9639 longer needed.
9640
5a979817
EZ
96412012-07-12 Eli Zaretskii <eliz@gnu.org>
9642
9643 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
9644 memmove call that removes glyphs covered by the left truncation
9645 glyph. Improve commentary.
9646 (display_line): Fix display of continuation glyphs on GUI frames
9647 when the right fringe is turned off and variable-size fonts are
9648 used in the window. Move the code that appends a stretch glyph to
9649 produce_special_glyphs, so that it could be used for truncation
9650 and continuation glyphs alike.
9651 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
9652 glyph of a suitably computed width, to align the special glyphs at
9653 the window margin. Code moved from display_line. (Bug#11832)
9654
3e91a053
GM
96552012-07-12 Glenn Morris <rgm@gnu.org>
9656
ba9e4b84
GM
9657 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
9658
9659 * s/gnu-linux.h, s/hpux10-20.h:
9660 Do not unconditionally define HAVE_XRMSETDATABASE.
9661
3e91a053
GM
9662 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
9663
b300b1f4
PE
96642012-07-12 Paul Eggert <eggert@cs.ucla.edu>
9665
9666 Fix typos that broke OS X build.
9667 Reported by Randal L. Schwartz in
9668 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
9669 * nsterm.m (ns_timeout): Add missing local decl.
9670 (ns_get_color): snprintf -> sprintf, to fix typo.
9671
6e777848
GM
96722012-07-12 Glenn Morris <rgm@gnu.org>
9673
3f922c37
GM
9674 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
9675 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
9676 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
9677 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
9678
0ab7b23a
GM
9679 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
9680 Move PTY_OPEN to configure.
9681
6e777848
GM
9682 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9683 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
9684 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
9685
4a7edc24
DA
96862012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
9687
9688 Use empty_unibyte_string where applicable.
9689 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
9690 * lread.c (read1): Likewise.
9691 * xsettings.c (syms_of_xsettings): Likewise.
9692
308aab79
GM
96932012-07-12 Glenn Morris <rgm@gnu.org>
9694
42bd1719
GM
9695 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
9696 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
9697 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
9698 * s/hpux10-20.h (RUN_TIME_REMAP):
9699 * s/bsd-common.h (TABDLY): Move to configure.
9700
9701 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
9702
9703 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
9704
ea0bbd17 9705 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 9706 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
9707
9708 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 9709
308aab79
GM
9710 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
9711 * s/template.h: Move NARROWPROTO to configure.
9712
ee1cf5cf
GM
97132012-07-11 Glenn Morris <rgm@gnu.org>
9714
30fe9bf4
GM
9715 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
9716 unused since 2011-01-17 change to systty.h.
9717
ee1cf5cf
GM
9718 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
9719 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9720 Move HAVE_PTYS and HAVE_SOCKETS to configure.
9721
63e47e07
PE
97222012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9723
9724 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
9725
c43fb4c3
GM
97262012-07-11 Glenn Morris <rgm@gnu.org>
9727
9728 * s/darwin.h, s/gnu-linux.h, s/template.h:
9729 Move INTERRUPT_INPUT to configure.
9730
e8df9267
DA
97312012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9732
9733 Minor adjustments to interning code.
9734 * lisp.h (intern, intern_c_string): Redefine as static inline
9735 wrappers for intern_1 and intern_c_string_1, respectively.
9736 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
9737 * lread.c (intern_1, intern_c_string_1, oblookup):
9738 Simplify Vobarray checking.
e8df9267
DA
9739 * font.c (font_intern_prop): Likewise. Adjust comment.
9740 * w32font.c (intern_font_name): Likewise.
9741
34348bd4
AS
97422012-07-11 Andreas Schwab <schwab@linux-m68k.org>
9743
d96a1e0c
AS
9744 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
9745
34348bd4
AS
9746 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
9747 of Fcar/Fcdr if possible.
9748 * font.c (check_otf_features): Likewise.
9749 * fontset.c (Fnew_fontset): Likewise.
9750 * gnutls.c (Fgnutls_boot): Likewise.
9751 * minibuf.c (read_minibuf): Likewise.
9752 * msdos.c (IT_set_frame_parameters): Likewise.
9753 * xmenu.c (Fx_popup_dialog): Likewise.
9754 * w32menu.c (Fx_popup_dialog): Likewise.
9755
c8add24e
GM
97562012-07-11 Glenn Morris <rgm@gnu.org>
9757
4b575b3c
GM
9758 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
9759 since nothing has defined it on these platforms.
9760
09f4e3b0
GM
9761 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
9762 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
9763
172bedef
GM
9764 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
9765 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
9766 Move CLASH_DETECTION to configure.
9767
249685df
GM
9768 * s/gnu.h: Remove file, which is now empty.
9769
c8add24e
GM
9770 * s/gnu.h, s/gnu-linux.h:
9771 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
9772
b41253a3
JW
97732012-07-11 John Wiegley <johnw@newartisans.com>
9774
9775 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
9776 function attribute, so we only use it if it exists in the
9777 compiler.
9778
d923b542
DA
97792012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9780
9781 Avoid call to strlen in fast_c_string_match_ignore_case.
9782 * search.c (fast_c_string_match_ignore_case): Change to use
9783 length argument. Adjust users accordingly.
9784 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
9785
5ebbef1d
PE
97862012-07-11 Paul Eggert <eggert@cs.ucla.edu>
9787
bb352260
PE
9788 Assume mkdir, rmdir.
9789 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
9790 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
9791
57054ddd
PE
9792 Assume rename.
9793 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
9794
b747d3f7
PE
9795 Assume perror.
9796 * s/hpux10-20.h (HAVE_PERROR): Remove.
9797 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
9798 Remove dummy definition, as this problem was obsolete long ago.
9799
5ebbef1d
PE
9800 Assume strerror.
9801 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
9802
984e7f30
DA
98032012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
9804
9805 Avoid calls to strlen in font processing functions.
9806 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
9807 (font_open_by_name): Change to use length argument.
9808 Adjust users accordingly.
d923b542
DA
9809 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
9810 Adjust prototypes.
9811 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
9812 Change to return ptrdiff_t.
984e7f30
DA
9813 (xfont_list_pattern, xfont_match): Use length returned by
9814 xfont_decode_coding_xlfd.
9815 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
9816
20e94fdd
GM
98172012-07-11 Glenn Morris <rgm@gnu.org>
9818
9d596af3
GM
9819 * s/darwin.h, s/freebsd.h, s/netbsd.h:
9820 Move DONT_REOPEN_PTY to configure.
9821
20e94fdd
GM
9822 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
9823 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
9824
e99a530f
PE
98252012-07-10 Paul Eggert <eggert@cs.ucla.edu>
9826
22ffb973
PE
9827 Remove "#define unix" that is no longer needed (Bug#11905).
9828 * s/aix4-2.h (unix): Remove; no longer needed.
9829
e9a9ae03
PE
9830 EMACS_TIME simplification (Bug#11875).
9831 This replaces macros (which typically do not work in GDB)
9832 with functions, typedefs and enums, making the code easier to debug.
9833 The functional style also makes code easier to read and maintain.
9834 * systime.h: Include <sys/time.h> on all hosts, not just if
9835 WINDOWSNT, since 'struct timeval' is needed in general.
9836 (EMACS_TIME): Now a typedef, not a macro.
9837 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
9838 not macros.
9839 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
9840 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
9841 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
9842 (EMACS_TIME_LE): Now functions, not macros.
9843 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
9844 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
9845 which are not functions. All uses rewritten to use:
9846 (make_emacs_time): New function.
9847 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
9848 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
9849 not functions. All uses rewritten to use the following, respectively:
9850 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
9851 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 9852 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
9853 * fileio.c (Fcopy_file):
9854 * xterm.c (XTflash): Get the current time closer to when it's used.
9855 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
9856
ffacb126
PE
9857 * bytecode.c (targets): Suppress -Woverride-init warnings.
9858
e99a530f
PE
9859 Simplify by avoiding confusing use of strncpy etc.
9860 * doc.c (Fsnarf_documentation):
9861 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
9862 * frame.c (Fmake_terminal_frame):
9863 * gtkutil.c (get_utf8_string):
9864 * lread.c (openp):
9865 * nsmenu.m (ns_update_menubar):
9866 * regex.c (regerror):
9867 Prefer memcpy to strncpy and strncat when either will do.
9868 * fileio.c (Fsubstitute_in_file_name):
9869 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
9870 (menu_separator_name_p):
9871 * nsmenu.m (ns_update_menubar):
9872 Prefer memcmp to strncmp when either will do.
9873 * nsterm.m: Include <ftoastr.h>.
9874 (ns_get_color):
9875 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
9876 Prefer snprintf to strncpy.
9877 * nsterm.m (ns_term_init):
9878 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
9879 * nsterm.m (ns_term_init):
9880 Avoid the need for strncpy, by using build_string or
9881 make_unibyte_string directly. Use dtoastr, not snprintf.
9882 * process.c (Fmake_network_process): Diagnose service names that
9883 are too long, rather than silently truncating them or creating
9884 non-null-terminated names.
9885 (Fnetwork_interface_info): Likewise, for interface names.
9886 * sysdep.c (system_process_attributes) [GNU_LINUX]:
9887 Prefer sprintf to strncat.
9888 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
9889 Prefer vsnprintf to vsprintf + strncpy.
9890
c59592b3
GM
98912012-07-10 Glenn Morris <rgm@gnu.org>
9892
9893 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
9894 Clarify fallback case.
9895
7d7bbefd
DA
98962012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9897
9898 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
9899 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
9900 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 9901 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
9902 where argument type is known to be a Lisp_Cons.
9903
3a4c8000
TT
99042012-07-10 Tom Tromey <tromey@redhat.com>
9905
9906 * bytecode.c (BYTE_CODE_THREADED): New macro.
9907 (BYTE_CODES): New macro. Replaces all old byte-code defines.
9908 (enum byte_code_op): New type.
9909 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
9910 (exec_byte_code): Use them. Use token threading when applicable.
9911
2a0213a6
DA
99122012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9913
9914 Optimize pure C strings initialization.
9915 * lisp.h (make_pure_string): Fix prototype.
9916 (build_pure_c_string): New function, defined as static inline. This
9917 provides a better opportunity to optimize away calls to strlen when
9918 the function is called with compile-time constant argument.
9919 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
9920 argument, adjust users accordingly. Use build_pure_c_string where
9921 appropriate.
9922 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
9923 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
9924 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
9925
cb1caeaf
DA
99262012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9927
9928 Avoid calls to strlen in miscellaneous functions.
9929 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
9930 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
9931 * lread.c (openp): Likewise.
9932
c293e30c
DA
99332012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
9934
9935 Avoid calls to strlen in path processing functions.
9936 * fileio.c (file_name_as_directory): Add comment. Change to add
9937 srclen argument and return the length of result. Adjust users
9938 accordingly.
9939 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
9940 swap 1st and 2nd arguments to obey the common convention.
9941 Adjust users accordingly.
c293e30c
DA
9942 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
9943
9e059e3f
GM
99442012-07-10 Glenn Morris <rgm@gnu.org>
9945
d02eb359
GM
9946 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
9947 Move PENDING_OUTPUT_COUNT definition to configure.
9948
882cf227
GM
9949 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
9950 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
9951 * s/gnu.h (DATA_START): Move definitions to configure.
9952
af6e839f
GM
9953 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
9954 We include usg5-4-common.h, which defines them both.
9955
40289a12
GM
9956 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
9957 O_RDONLY already includes it).
9958
9e059e3f
GM
9959 Stop ns builds setting the EMACSLOADPATH environment variable.
9960 * nsterm.m (ns_load_path): Rename from ns_init_paths.
9961 Now it does not set EMACSLOADPATH, just returns the load-path string.
9962 * nsterm.h: Update accordingly.
9963 * lread.c [HAVE_NS]: Include nsterm.h.
9964 (init_lread) [HAVE_NS]: Use ns_load_path.
9965 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
9966
7c4e8ec0
GM
99672012-07-09 Glenn Morris <rgm@gnu.org>
9968
d4f600ff
GM
9969 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
9970 since the included bsd-common.h does so.
9971
cbb31951
GM
9972 Stop ns builds setting the EMACSPATH environment variable.
9973 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
9974 (ns_init_paths): Do not set EMACSPATH.
9975 * nsterm.h (ns_exec_path): Add it.
9976 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
9977 Use ns_exec_path.
9978
7c4e8ec0
GM
9979 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
9980
26bccfae
PE
99812012-07-09 Paul Eggert <eggert@cs.ucla.edu>
9982
a0bee46f
PE
9983 * process.c (wait_reading_process_output): 'waitchannels' was unset
9984 when read_kbd || !NILP (wait_for_cell); fix this.
9985
5994c183
PE
9986 Add GCC-style 'const' attribute to functions that can use it.
9987 * character.h (char_resolve_modifier_mask):
9988 * keyboard.h (make_ctrl_char):
9989 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
9990 (init_character_once, next_almost_prime, init_fns, init_image)
9991 (flush_pending_output, init_sound):
9992 * mem-limits.h (start_of_data):
9993 * menu.h (finish_menu_items):
9994 Add ATTRIBUTE_CONST.
9995 * emacs.c (DEFINE_DUMMY_FUNCTION):
9996 Declare the dummy function with ATTRIBUTE_CONST.
9997 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
9998 Add decls with ATTRIBUTE_CONST.
9999
26bccfae
PE
10000 Minor improvements to make_formatted_string.
10001 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
10002 where int is good enough, as vsprintf returns an int.
10003 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
10004
a8290ec3
DA
100052012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10006
10007 Use make_formatted_string to avoid double length calculation.
10008 * lisp.h (make_formatted_string): New prototype.
10009 * alloc.c (make_formatted_string): New function.
10010 * buffer.c (Fgenerate_new_buffer_name): Use it.
220cb2bd 10011 * dbusbind.c (syms_of_dbusbind): Likewise.
a8290ec3
DA
10012 * editfns.c (Fcurrent_time_zone): Likewise.
10013 * filelock.c (get_boot_time): Likewise.
10014 * frame.c (make_terminal_frame, set_term_frame_name)
10015 (x_report_frame_params): Likewise.
10016 * image.c (gs_load): Likewise.
10017 * minibuf.c (get_minibuffer): Likewise.
10018 * msdos.c (dos_set_window_size): Likewise.
10019 * process.c (make_process): Likewise.
10020 * xdisp.c (ensure_echo_area_buffers): Likewise.
10021 * xsettings.c (apply_xft_settings): Likewise.
10022
d01ba2f1
GM
100232012-07-09 Glenn Morris <rgm@gnu.org>
10024
10025 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
10026 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
10027 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
10028 * nsterm.h (ns_etc_directory): Add it.
10029 * callproc.c [HAVE_NS]: Include nsterm.h.
10030 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
10031
f1f924b6
DA
100322012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
10033
10034 Move marker debugging code under MARKER_DEBUG.
10035 * marker.c (MARKER_DEBUG): Move marker debugging code under
10036 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
10037 for bootstrap with --enable-checking (~3x slowdown reported
10038 by Juanma Barranquero <lekktu@gmail.com>).
10039 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
10040
ab531b66
PE
100412012-07-08 Paul Eggert <eggert@cs.ucla.edu>
10042
10043 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
10044 See <http://bugs.gnu.org/11825#29>.
10045
c4b3bc8a
EZ
100462012-07-08 Eli Zaretskii <eliz@gnu.org>
10047
10048 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
10049 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
10050 (display_line): Add commentary about displaying truncation glyphs
10051 on GUI frames.
10052 (produce_special_glyphs): Move here from term.c.
10053
10054 * term.c (produce_special_glyphs): Move to xdisp.c.
10055
10056 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
10057 section.
c4b3bc8a 10058
b676b881
AS
100592012-07-07 Andreas Schwab <schwab@linux-m68k.org>
10060
f17c5273
AS
10061 * xdisp.c (display_line): Avoid warning about implicit declaration
10062 of FRAME_FONT.
10063
298819b9
AS
10064 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
10065
b676b881
AS
10066 * lisp.h: Remove empty conditional.
10067
6045c4fd
PE
100682012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10069
b3350bf9
PE
10070 * lread.c (load_path_check): Now static.
10071
6045c4fd
PE
10072 Fix some minor --with-ns problems found by static checking.
10073 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
10074 (x_set_font) [!HAVE_X_WINDOWS]:
10075 * image.c (xpm_load_image) [HAVE_NS]:
10076 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
10077 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
10078 Remove unused local.
10079 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
10080 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
10081 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
10082 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
10083 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
10084 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
10085 Fix pointer signedness problem.
10086 * xfaces.c (FRAME_X_FONT_TABLE):
10087 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
10088
929e7845
GM
100892012-07-07 Glenn Morris <rgm@gnu.org>
10090
10091 * lread.c (load_path_check): New function, split from init_lread.
10092 (init_lread): Reorganize. Motivation:
10093 If EMACSLOADPATH is set, check/warn about that rather than the
10094 defaults, which we are not going to use. Hence we can remove
10095 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
10096 Don't warn if site-lisp directories are missing.
10097 If not installed, start from a blank load-path, since
10098 PATH_LOADSEARCH refers to the eventual installation directories.
10099
58dd0aa4
EZ
101002012-07-07 Eli Zaretskii <eliz@gnu.org>
10101
10102 Support truncation and continuation glyphs on GUI frames, when
10103 fringes are disabled. (Bug#11832)
10104 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
10105 continuation glyphs even if on GUI frames.
10106 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
10107 or both, are absent.
10108 (start_display, move_it_in_display_line_to): Handle the case of a
10109 GUI frame without a fringe to display continuation or truncation
10110 glyphs.
10111 (insert_left_trunc_glyphs): Support GUI frames: make sure
10112 truncation glyphs overwrite enough glyphs from the current line to
10113 have sufficient space in pixels.
10114 (display_line): Support truncation and continuation glyphs on GUI
10115 frames. If some spare pixels are left on the line after inserting
10116 the truncation glyphs, fill that space with a stretch glyph of a
10117 suitably computed width.
10118
10119 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
10120 produce_glyphs, to support GUI sessions.
10121
31571fd7
PE
101222012-07-07 Paul Eggert <eggert@cs.ucla.edu>
10123
5a16b9bc
PE
10124 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
10125
f3047c75
PE
10126 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
10127
31571fd7
PE
10128 Do not require float-time's arg to fit in time_t (Bug#11825).
10129 This works better on hosts where time_t is unsigned, and where
10130 float-time is applied to the (negative) difference between two times.
10131 * editfns.c (decode_time_components): Last arg is now double *,
10132 not int *, and means to store all the result as a double, without
10133 worrying about whether the seconds part fits in time_t.
10134 All callers changed.
10135 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
10136 All callers changed.
10137 (Ffloat_time): Do not fail merely because the specified time falls
10138 outside of time_t range.
10139
4516fbef
GM
101402012-07-07 Glenn Morris <rgm@gnu.org>
10141
10142 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
10143 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
10144 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
10145
07adc2c6
JB
101462012-07-07 Juanma Barranquero <lekktu@gmail.com>
10147
10148 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
10149 Update dependencies.
10150
10151 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
10152
fd573f31
PE
101532012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10154
fee5959d
PE
10155 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
10156 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
10157 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
10158 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
10159 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
10160 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
10161
fd573f31
PE
10162 * xfont.c (compare_font_names): Redo to omit the need for casts.
10163
ddadbc0e
AS
101642012-07-06 Andreas Schwab <schwab@linux-m68k.org>
10165
fca8d6b6
AS
10166 * xfns.c (Fx_change_window_property): Doc fix.
10167 * w32fns.c (Fx_change_window_property): Doc fix.
10168
ddadbc0e
AS
10169 * w32fns.c (Fx_window_property): Accept the same arguments as the
10170 X Windows version. Doc fix.
10171 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
10172
ed9265fc 101732012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
10174 Eli Zaretskii <eliz@gnu.org>
10175
10176 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
10177 Windows-specific code from nt/config.nt moved here.
10178 Obsolete settings removed.
10179
216ee680
PE
101802012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10181
10182 * process.c: Avoid unnecessary calls to gettime.
10183 (wait_reading_process_output): Don't get the time of day
10184 when gobbling data immediately and not waiting, as there's no need
10185 for it in that case. This removes a FIXME.
10186
bdd091e4
JD
101872012-07-06 Jan Djärv <jan.h.d@swipnet.se>
10188
10189 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
10190 is defined (Bug#11768).
10191
9d44f8ce
DA
101922012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10193
10194 Fix marker debugging code.
10195 * marker.c (byte_char_debug_check): Do not perform the check
10196 if buffer is not multibyte.
090bd7cb
JB
10197 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10198 Call byte_char_debug_check with correct arguments.
9d44f8ce 10199
90fc4786
DA
102002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10201
10202 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
10203 * marker.c (byte_char_debug_check, count_markers):
10204 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
10205 (byte_debug_flag): Remove.
10206 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
10207 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
10208
7b7ae965
DA
102092012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10210
4e57b342
DA
10211 Avoid code repetition in marker-related functions.
10212 * marker.c (attach_marker): New function.
10213 (Fset_marker, set_marker_restricted, set_marker_both)
10214 (set_marker_restricted_both): Use it.
10215 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
10216 Consistently rename charno to charpos.
10217 (marker_position): Add eassert.
10218 (marker_byte_position): Convert to eassert.
10219
102202012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10221
10222 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 10223 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 10224 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 10225
657924ff
DA
102262012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10227
10228 Introduce fast path for the widely used marker operation.
10229 * alloc.c (build_marker): New function.
10230 * lisp.h (build_marker): New prototype.
10231 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
10232 * composite.c (autocmp_chars): Likewise.
10233 * editfns.c (buildmark): Remove.
10234 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
10235 (save_restriction_save): Use build_marker.
10236 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
10237 * window.c (save_window_save): Likewise.
10238
041a49a6
DA
102392012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
10240
10241 Do not use Fdelete_overlay in delete_all_overlays
10242 to avoid redundant calls to unchain_overlay.
10243 * buffer.c (drop_overlay): New function.
10244 (delete_all_overlays, Fdelete_overlay): Use it.
10245 * minibuf.c (get_minibuffer): Fix comment.
10246
7dca65a4
PE
102472012-07-06 Paul Eggert <eggert@cs.ucla.edu>
10248
10249 Port to OpenBSD 5.1 amd64.
10250 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
10251 This is needed for OpenBSD, and should be harmless on all BSD systems.
10252 Also, include <sys/sysctl.h>, as it should be available on all
10253 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
10254 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
10255 use p_pid member, not kp_proc.pid.
10256
8eb876e2
GM
102572012-07-06 Glenn Morris <rgm@gnu.org>
10258
10259 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
10260
38182d90
PE
102612012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10262
10263 More xmalloc and related cleanup.
10264 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
10265 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
10266 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
10267 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
10268 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
10269 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
10270 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
10271 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
10272 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
10273 * xterm.c:
10274 Omit needless casts involving void * pointers and allocation.
10275 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
10276 as the former is more robust if P's type is changed.
10277 Prefer xzalloc to xmalloc + memset 0.
10278 Simplify malloc-or-realloc to realloc.
10279 Don't worry about xmalloc returning a null pointer.
10280 Prefer xstrdup to xmalloc + strcpy.
10281 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
10282 growing it.
10283 * keyboard.c (apply_modifiers_uncached): Prefer local array to
10284 alloca of a constant.
10285
6dd5a677
EZ
102862012-07-05 Eli Zaretskii <eliz@gnu.org>
10287
10288 * xdisp.c (display_line): Fix horizontal pixel coordinates when
10289 hscroll is larger than the line width. Fixes long and futile
10290 looping inside extend_face_to_end_of_line (on a TTY) producing
10291 glyphs that are not needed and thrown away.
10292
6b312f0f
DA
102932012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10294
10295 * marker.c (set_marker_restricted_both): Simplify by using
10296 clip_to_bounds.
10297
f520ef9b
PE
102982012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10299
10300 * editfns.c (region_limit): Simplify by using clip_to_bounds.
10301
383b7c95
JD
103022012-07-05 Jan Djärv <jan.h.d@swipnet.se>
10303
10304 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
10305 not defined (Bug#11768).
10306 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
10307 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
10308 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
10309 followed by gtk_box_set_homogeneous (Bug#11768).
10310 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
10311 (update_theme_scrollbar_width, xg_create_scroll_bar):
10312 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
10313 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
10314 (is_box_type): New function (Bug#11768).
10315 (xg_tool_item_stale_p): Call is_box_type.
5293d758 10316 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
10317 with default display (Bug#11768).
10318
d6e7bf45
EZ
103192012-07-05 Eli Zaretskii <eliz@gnu.org>
10320
10321 * xdisp.c (window_hscroll_limited): New function.
10322 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
10323 coordinates when window's hscroll is set to insanely large
10324 values. (Bug#11857)
10325
431391ec
JB
103262012-07-05 Juanma Barranquero <lekktu@gmail.com>
10327
10328 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
10329 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
10330
23f86fce
DA
103312012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
10332
10333 Cleanup xmalloc.
10334 * lisp.h (xzalloc): New prototype. Omit needless casts.
10335 * alloc.c (xzalloc): New function. Omit needless casts.
10336 * charset.c: Omit needless casts. Convert all calls to
10337 xmalloc with following memset to xzalloc.
10338 * dispnew.c: Likewise.
10339 * fringe.c: Likewise.
10340 * image.c: Likewise.
10341 * sound.c: Likewise.
10342 * term.c: Likewise.
10343 * w32fns.c: Likewise.
10344 * w32font.c: Likewise.
10345 * w32term.c: Likewise.
10346 * xfaces.c: Likewise.
10347 * xfns.c: Likewise.
10348 * xterm.c: Likewise.
10349 * atimer.c: Omit needless casts.
10350 * buffer.c: Likewise.
10351 * callproc.c: Likewise.
10352 * ccl.c: Likewise.
10353 * coding.c: Likewise.
10354 * composite.c: Likewise.
10355 * doc.c: Likewise.
10356 * doprnt.c: Likewise.
10357 * editfns.c: Likewise.
10358 * emacs.c: Likewise.
10359 * eval.c: Likewise.
10360 * filelock.c: Likewise.
10361 * fns.c: Likewise.
10362 * gtkutil.c: Likewise.
10363 * keyboard.c: Likewise.
10364 * lisp.h: Likewise.
10365 * lread.c: Likewise.
10366 * minibuf.c: Likewise.
10367 * msdos.c: Likewise.
10368 * print.c: Likewise.
10369 * process.c: Likewise.
10370 * region-cache.c: Likewise.
10371 * search.c: Likewise.
10372 * sysdep.c: Likewise.
10373 * termcap.c: Likewise.
10374 * terminal.c: Likewise.
10375 * tparam.c: Likewise.
10376 * w16select.c: Likewise.
10377 * w32.c: Likewise.
10378 * w32reg.c: Likewise.
10379 * w32select.c: Likewise.
10380 * w32uniscribe.c: Likewise.
10381 * widget.c: Likewise.
10382 * xdisp.c: Likewise.
10383 * xmenu.c: Likewise.
10384 * xrdb.c: Likewise.
10385 * xselect.c: Likewise.
10386
0497dc44
PE
103872012-07-05 Paul Eggert <eggert@cs.ucla.edu>
10388
10389 * fileio.c (time_error_value): Check the right error number.
10390 Problem reported by Troels Nielsen in
10391 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
10392
356e7178
PE
103932012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10394
4e71fd89
PE
10395 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
10396 This should be fixed in a better way; see Eli Zaretskii in
10397 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
10398 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
10399
f0941253
PE
10400 * fileio.c (time_error_value): Rename from special_mtime.
10401 The old name's problems were noted by Eli Zaretskii in
10402 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
10403
065c9eb4
PE
10404 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
10405 This variable's comment says Emacs needs at least one GDB-visible
10406 symbol of type enum pvec_type, to work around GDB problems.
10407 The symbol's value doesn't matter.
10408
356e7178
PE
10409 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
10410 that causes compilation to fail on pre-C99 compilers.
10411
ed9265fc 104122012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
10413
10414 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
10415 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
10416
3884d954
DA
104172012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10418
d209e2fb 10419 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
10420 headers for buffer_defaults and buffer_local_symbols.
10421 Reported by Juanma Barranquero <lekktu@gmail.com>.
10422
ee28be33
SM
104232012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10424
10425 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
10426 * lisp.h (enum pvec_type): Use fewer bits.
10427 (PSEUDOVECTOR_SIZE_BITS): New constant.
10428 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
10429 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
10430 change in pvec_type.
10431 (PSEUDOVECTOR_TYPEP): New macro.
10432 (TYPED_PSEUDOVECTORP): Use it.
10433 * fns.c (internal_equal): Adapt code to extract pvectype.
10434 * emacs.c (gdb_pvec_type): Update type.
10435 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
10436 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
10437 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
10438 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
10439 (sweep_vectors): Use it. Use local var `total_bytes' instead of
10440 abusing vector->header.next.nbytes.
10441 (live_vector_p): Use PVEC_TYPE.
10442 (mark_object): Adapt code to extract pvectype. Use switch.
10443
c7f2cd7f
PE
104442012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10445
10446 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
10447 Tighten new eassert a bit.
10448
8ce70ed2
DA
104492012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10450
10451 Fix compilation with --enable-gcc-warnings and -O1
10452 optimization level.
10453 * doprnt.c (doprnt): Change type of tem to int, initialize
10454 to avoid compiler warning. Add eassert.
10455 * search.c (simple_search): Initialize match_byte to avoid
10456 compiler warning. Add eassert.
10457
dea7f1e5
PE
104582012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10459
24a212eb
PE
10460 Avoid weird behavior with large horizontal scrolls.
10461 Without this change, for example, large hscroll values would
10462 mess up Emacs's display on Fedora 15 x86, presumably due to
10463 overflows in int calculations in the display code.
10464 Also, if buffers had long lines, Emacs would freeze.
10465 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
10466 (set_window_hscroll): New function, containing the old guts of
10467 Fset_window_hscroll. Return the clipped value.
10468 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
10469 This avoids the need to check against PTRDIFF_MAX.
10470
dea7f1e5
PE
10471 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
10472
76046526
DA
104732012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
10474
10475 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
10476
39adff0d
PE
104772012-07-04 Paul Eggert <eggert@cs.ucla.edu>
10478
63807d47
PE
10479 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
10480 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
10481 since GCC 4.4.6 issues a bogus warning for them.
10482
39adff0d
PE
10483 Fix bugs in file timestamp newness comparisons.
10484 * fileio.c (Ffile_newer_than_file_p):
10485 * lread.c (Fload): Use full timestamp resolution of files,
10486 not just the 1-second resolution, so that files that are only
10487 slightly newer still count as newer.
10488 * fileio.c (Ffile_newer_than_file_p): Don't assume file
10489 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
10490
dbeed9a6
PE
104912012-07-03 Paul Eggert <eggert@cs.ucla.edu>
10492
10493 * fileio.c: Improve handling of file time marker. (Bug#11852)
10494 (special_mtime): New function.
10495 (Finsert_file_contents, Fverify_visited_file_modtime):
10496 Use it to set special mtime values consistently.
10497
636334d6
AS
104982012-07-03 Andreas Schwab <schwab@linux-m68k.org>
10499
10500 * fileio.c (Finsert_file_contents): Properly handle st_mtime
10501 marker for non-existing file. (Bug#11852)
10502
e2017fe2
GM
105032012-07-03 Glenn Morris <rgm@gnu.org>
10504
10505 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
10506 and did not make it into globals.h).
10507
404dbd37
TT
105082012-07-03 Tom Tromey <tromey@redhat.com>
10509
10510 * window.c (Fset_window_margins, Fset_window_fringes)
10511 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
10512 * textprop.c (Fprevious_property_change): No longer static.
10513 * syntax.c (Fsyntax_table_p): No longer static.
10514 * process.c (Fget_process, Fprocess_datagram_address): No longer
10515 static.
10516 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
10517 * keyboard.c (Fcommand_execute): No longer static.
10518 Remove EXFUN.
10519 * insdel.c (Fcombine_after_change_execute): No longer static.
10520 * image.c (Finit_image_library): No longer static.
10521 * fileio.c (Fmake_symbolic_link): No longer static.
10522 * eval.c (Ffetch_bytecode): No longer static.
10523 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
10524 * doc.c (Fdocumentation_property, Fsnarf_documentation):
10525 No longer static.
404dbd37
TT
10526 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
10527 static.
10528 * dired.c (Ffile_attributes): No longer static.
10529 * composite.c (Fcomposition_get_gstring): No longer static.
10530 * callproc.c (Fgetenv_internal): No longer static.
10531
10532 * ccl.h: Remove EXFUNs.
10533 * buffer.h: Remove EXFUNs.
10534 * dispextern.h: Remove EXFUNs.
10535 * intervals.h: Remove EXFUNs.
10536 * fontset.h: Remove EXFUN.
10537 * font.h: Remove EXFUNs.
10538 * dosfns.c (system_process_attributes): Remove EXFUN.
10539 * keymap.h: Remove EXFUNs.
10540 * lisp.h: Remove EXFUNs.
10541 * w32term.h: Remove EXFUNs.
10542 * window.h: Remove EXFUNs.
10543 * xsettings.h: Remove EXFUN.
10544 * xterm.h: Remove EXFUN.
10545
8e4fd1e1
GM
105462012-07-03 Glenn Morris <rgm@gnu.org>
10547
10548 * lisp.h (Frandom): Make it visible to C.
10549 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
10550 buffer for invisible buffers. (Bug#1229)
10551
ca95b3eb
DA
105522012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10553
10554 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
10555 values which aren't power of 2.
14ae4239 10556 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
1f9f395d 10557 Verify its value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
10558 accordingly.
10559
7555c33f
SM
105602012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
10561
10562 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
10563
10564 * alloc.c (mark_object): Revert part of last patch to use `switch'.
10565
d12e8f5a
DA
105662012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10567
10568 * alloc.c (allocate_vector_block): Remove redundant
10569 calls to mallopt if DOUG_LEA_MALLOC is defined.
10570 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
10571 avoid calls to mallopt if zero_vector is returned.
10572
296094c3
DA
105732012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10574
10575 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
10576 is enabled, avoid dereferencing NULL current_sblock if
10577 running undumped.
10578
36429c89
DA
105792012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
10580
10581 Cleanup basic buffer management.
10582 * buffer.h (struct buffer): Change layout to use generic vector
10583 marking code. Fix some comments. Change type of 'clip_changed'
10584 to bitfield. Remove unused #ifndef old.
10585 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
10586 (GET_OVERLAYS_AT): Fix indentation.
10587 (for_each_per_buffer_object_at): New macro.
10588 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
10589 (Fbuffer_local_variables): Use it.
10590 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
10591 * alloc.c (allocate_buffer): Adjust to match new layout of
10592 struct buffer. Fix comment.
10593 (mark_overlay): New function.
10594 (mark_buffer): Use it. Use mark_vectorlike to mark normal
10595 Lisp area of struct buffer.
10596 (mark_object): Use it. Adjust marking of misc objects
10597 and related comments.
10598
3b3e4cac
PE
105992012-07-02 Paul Eggert <eggert@cs.ucla.edu>
10600
10601 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
10602 wrapper that is not needed because the wrapped code is a no-op (zero
10603 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
10604 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
10605
cf5c0175
DA
106062012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
10607
10608 * alloc.c (mark_buffer): Simplify. Remove prototype.
10609 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 10610 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
10611 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
10612 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 10613
ca26824c
GM
106142012-06-30 Glenn Morris <rgm@gnu.org>
10615
2e4c5312
GM
10616 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
10617
ca26824c
GM
10618 * epaths.in (PATH_SITELOADSEARCH): New.
10619 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
10620 This is rather than relying on --enable-locallisppath elements
10621 having "site-lisp" in their names. (Bug#10208#25, 11658)
10622
0d23c240
EZ
106232012-06-30 Eli Zaretskii <eliz@gnu.org>
10624
c9240d7a
EZ
10625 * w32proc.c (sys_select): Accept and ignore one more argument.
10626
10627 * w32.c (emacs_gnutls_pull): Call select with one more argument.
10628
0d23c240 10629 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 10630 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
10631
10632 * sysdep.c: Don't include dos.h and dosfns.h.
10633
10634 * process.c (sys_select):
10635 * msdos.c (sys_select): Accept one more argument and ignore it.
10636
10637 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
10638 adapt data types and code to that.
10639
10640 * dosfns.c:
10641 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
10642 which clashes with the gnulib function of the same name.
10643
af5a5a98
AS
106442012-06-30 Andreas Schwab <schwab@linux-m68k.org>
10645
c5e4379c
AS
10646 * font.c (font_style_to_value, font_style_symbolic)
10647 (font_prop_validate_style): Add type checks for values in
10648 font_style_table.
10649
af5a5a98
AS
10650 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
10651 argument.
10652 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
10653 uses.
10654
8d38f461
EZ
106552012-06-29 Eli Zaretskii <eliz@gnu.org>
10656
2e5a6631
EZ
10657 * xdisp.c (try_window_id): Undo last change.
10658
8d38f461
EZ
10659 * w32.c (getwd): Adjust commentary about startup_dir.
10660 (init_environment): Always call sys_access, even in non-MSVC
10661 builds. Don't chdir to the directory of the Emacs executable.
10662 This undoes code from 1997 which was justified by the need to
10663 "avoid conflicts when removing and renaming directories". But its
10664 downside was that every relative file name was being interpreted
10665 relative to the directory of the Emacs executable, which can never
10666 be TRT. In particular, it broke sys_access when called with
10667 relative file names.
10668 (sys_access): Map GetLastError to errno.
10669
2af3565e
DA
106702012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10671
10672 * window.h (struct window): Change type of 'fringes_outside_margins'
10673 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 10674 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
10675 Adjust comment.
10676 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
10677 to ptrdiff_t.
10678
c8d3a25c 106792012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 10680
c8d3a25c
GM
10681 * gnutls.c (emacs_gnutls_handshake):
10682 Add QUIT to make the loop interruptible.
57570cd3 10683
c8d3a25c 106842012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 10685
c8d3a25c
GM
10686 * charset.c (init_charset): Make lack of etc/charsets fatal.
10687
3e984ee8
DA
106882012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10689
10690 * editfns.c (region_limit): Fix type mismatch.
10691
ef884f23
DA
106922012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
10693
10694 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
10695 undefined. Convert from xassert to eassert.
10696 * nsmenu.m: Convert from xassert to eassert.
10697 * nsterm.m: Likewise.
10698
7d7e0027
SM
106992012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
10700
10701 * editfns.c (region_limit): Clip to narrowing (bug#11770).
10702
aa754e6a
PE
107032012-06-28 Paul Eggert <eggert@cs.ucla.edu>
10704
10705 Avoid integer overflow on scroll-left and scroll-right.
10706 * window.c (HSCROLL_MAX): New macro.
10707 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
10708 overflow when requested scroll falls outside ptrdiff_t range.
10709
80b00b08
DA
107102012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10711
10712 * window.h (struct window): Change type of 'hscroll',
10713 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
10714 'last_modified' and 'last_overlay_modified' to EMACS_INT.
10715 Adjust users accordingly.
10716 * xdisp.c (try_cursor_movement): Replace type check with eassert.
10717 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
10718 from EMACS_INT to ptrdiff_t.
10719 (make_window): Omit redundant initialization.
10720
62b2bcf6
JB
107212012-06-28 Juanma Barranquero <lekktu@gmail.com>
10722
10723 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
10724
45942c7d
DA
107252012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10726
10727 * window.h (struct window): Change type of 'use_time' and
10728 'sequence_number' from Lisp_Object to int.
10729 * frame.c (make_frame): Adjust users accordingly.
10730 * print.c (print_object): Likewise.
10731 * window.c (select_window, Fwindow_use_time, make_parent_window)
10732 (make_window): Likewise.
10733
e509cfa6
DA
107342012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10735
10736 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
10737 enabled with --enable-checking=[all,glyphs] configure option.
10738 Fix GLYPH_DEBUG usage assuming that it may be undefined,
10739 adjust comments accordingly.
10740 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
10741 undefined, adjust comments accordingly.
10742 * image.c: Likewise.
10743 * scroll.c: Likewise.
10744 * w32fns.c: Likewise.
10745 * w32term.c: Likewise.
10746 * xdisp.c: Likewise.
10747 * xfaces.c: Likewise.
10748 * xfns.c: Likewise.
10749 * xterm.c: Likewise.
10750
a54e2c05
DA
107512012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
10752
10753 Generalize run-time debugging checks.
10754 * dispextern.h (XASSERTS): Remove.
10755 * fontset.c (xassert): Remove.
10756 Convert from xassert to eassert.
10757 * alloc.c: Convert from xassert to eassert.
10758 * bidi.c: Likewise.
10759 * dispnew.c: Likewise.
10760 * fns.c: Likewise.
10761 * fringe.c: Likewise.
10762 * ftfont.c: Likewise.
10763 * gtkutil.c: Likewise.
10764 * image.c: Likewise.
10765 * keyboard.c: Likewise.
10766 * menu.c: Likewise.
10767 * process.c: Likewise.
10768 * scroll.c: Likewise.
10769 * sound.c: Likewise.
10770 * term.c: Likewise.
10771 * w32console.c: Likewise.
10772 * w32fns.c: Likewise.
10773 * w32term.c: Likewise.
10774 * window.c: Likewise.
10775 * xdisp.c: Likewise.
10776 * xfaces.c: Likewise.
10777 * xfns.c: Likewise.
10778 * xselect.c: Likewise.
10779 * xterm.c: Likewise.
10780
1ec4b7b2
SM
107812012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
10782
10783 * fns.c (maybe_resize_hash_table): Output message when growing the
10784 purify-hashtable.
10785
2014308a
DA
107862012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10787
10788 * alloc.c (allocate_string_data): Remove dead code.
10789 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
10790 avoid GCC warning about unused macro.
10791
246155eb
DA
107922012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10793
10794 * alloc.c (allocate_string): Omit intervals initialization.
10795 * alloc.c (make_uninit_multibyte_string): Initialize intervals
10796 as in make_pure_string and make_pure_c_string.
10797
43184b7b
DA
107982012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10799
d209e2fb 10800 * alloc.c (allocate_string): Fix last change.
43184b7b 10801
3fe6dd74
DA
108022012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
10803
d209e2fb 10804 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
10805 to memset, add explicit initialization where appropriate.
10806
1ba6038a
GM
108072012-06-27 Glenn Morris <rgm@gnu.org>
10808
10809 * lisp.mk (lisp): Remove paths.elc.
10810
c89926a5
CY
108112012-06-27 Chong Yidong <cyd@gnu.org>
10812
10813 * doc.c (Fsubstitute_command_keys): Fix punctuation.
10814
ed6b3510
JW
108152012-06-26 John Wiegley <johnw@newartisans.com>
10816
1ec4b7b2 10817 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
10818 on Mac OS X Lion: __mod_init_func and __mod_term_func.
10819
ed6b3510
JW
10820 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
10821 when building with Clang.
10822
8edd4a2b
SM
108232012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
10824
10825 * eval.c (Fapply): Allow calling it with a single argument.
10826
f6f62d1b
EZ
108272012-06-26 Eli Zaretskii <eliz@gnu.org>
10828
10829 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
10830 _stricmp and _strnicmp.
10831 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
10832
62efea5e
DA
108332012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10834
10835 * alloc.c (allocate_window): Zero out non-Lisp part of newly
10836 allocated window.
10837 (allocate_process): Likewise for new process.
8edd4a2b 10838 (allocate_terminal): Change to use offsetof.
62efea5e
DA
10839 (allocate_frame): Likewise.
10840 * frame.c (make_frame): Omit redundant initialization.
10841 * window.c (make_parent_window): Use memset.
10842 (make_window): Omit redundant initialization.
10843 * process.c (make_process): Omit redundant initialization.
10844 * terminal.c (create_terminal): Likewise.
10845
42997f4d
DA
108462012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10847
10848 * term.c (delete_tty): Remove redundant call to memset.
10849
1130ecfc
DA
108502012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
10851
10852 * alloc.c: Remove build_string.
10853 * lisp.h: Define build_string as static inline. This provides
10854 a better opportunity to optimize away calls to strlen when the
10855 function is called with compile-time constant argument.
10856 * image.c (imagemagick_error): Convert to build_string.
10857 * w32proc.c (sys_spawnve): Likewise.
10858 * xterm.c (x_term_init): Likewise.
10859
cf38a720
PE
108602012-06-26 Paul Eggert <eggert@cs.ucla.edu>
10861
99027bdd
PE
10862 Use sprintf return value instead of invoking strlen on result.
10863 In the old days this wasn't portable, since some sprintf
10864 implementations returned char *. But they died out years ago and
10865 Emacs already assumes sprintf returns int.
10866 Similarly for float_to_string.
10867 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
10868 * ccl.c (ccl_driver):
10869 * character.c (string_escape_byte8):
10870 * data.c (Fnumber_to_string):
10871 * doprnt.c (doprnt):
10872 * print.c (print_object):
10873 * xdisp.c (message_dolog):
10874 * xfns.c (syms_of_xfns):
10875 Use sprintf or float_to_string result to avoid need to call strlen.
10876 * data.c (Fnumber_to_string):
10877 Use make_unibyte_string, since the string must be ASCII.
10878 * lisp.h, print.c (float_to_string): Now returns int length.
10879 * term.c (produce_glyphless_glyph):
10880 Use sprintf result rather than recomputing it.
10881
cf38a720
PE
10882 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
10883 * Makefile.in (ALL_CFLAGS):
10884 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
10885 * gmalloc.c, regex.c: Include <config.h> unconditionally.
10886
3511c784
DA
108872012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10888
0a08eb21 10889 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
10890 strcasecmp if available.
10891 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
10892
fb7da12e
AS
108932012-06-25 Andreas Schwab <schwab@linux-m68k.org>
10894
10895 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
10896 Avoid comma operator.
10897 * menu.c (push_submenu_start, push_submenu_end)
10898 (push_left_right_boundary, push_menu_pane): Likewise.
10899 * msdos.c (dos_rawgetc): Likewise.
10900
afa2ffd8
DA
109012012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10902
10903 * xfns.c (xic_create_fontsetname): Remove redundant calls
10904 to memset.
10905
b3b4476b
PE
109062012-06-25 Paul Eggert <eggert@cs.ucla.edu>
10907
4495ff38
PE
10908 * gtkutil.c (get_utf8_string): Remove redundant assignment.
10909 sprintf already null-terminates its output.
10910
b3b4476b
PE
10911 * xfns.c (x_window): Remove redundant cast.
10912
b00876c9
DA
109132012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
10914
10915 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
10916 `const char *' to `char *' to avoid compiler warning.
10917
d188e26b
PE
109182012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10919
885d1d74
PE
10920 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
10921 instead of truncating it to 63 (admittedly a generous limit).
10922
d188e26b
PE
10923 * process.c: Fix spelling and caps in comments.
10924
e2f560b1
DN
109252012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
10926
e86db54b 10927 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
10928 * sysdep.c (setpgrp): Remove definition, not used in this file.
10929
7583a3a1
JB
109302012-06-24 Juanma Barranquero <lekktu@gmail.com>
10931
10932 * makefile.w32-in: Update dependencies.
10933
696056c2
EZ
109342012-06-24 Eli Zaretskii <eliz@gnu.org>
10935
10936 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
10937 (SYSTIME_H): Add nt/inc/sys/time.h.
10938
10939 * systime.h [WINDOWSNT]: Include sys/time.h.
10940
10941 * s/ms-w32.h (struct timespec): Definition moved from
10942 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
10943
845ca893
PE
109442012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10945
10946 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
10947 * buffer.h (buffer_slot_type_mismatch):
10948 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10949 * eval.c (unwind_to_catch):
10950 * image.c (my_png_error, my_error_exit):
10951 * keyboard.c (quit_throw_to_read_char, user_error)
10952 (Fexit_recursive_edit, Fabort_recursive_edit):
10953 * lisp.h (die, args_out_of_range, args_out_of_range_3)
10954 (wrong_type_argument, buffer_overflow, __executable_start)
10955 (memory_full, buffer_memory_full, string_overflow, Fthrow)
10956 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
10957 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
10958 (fatal):
10959 (child_setup) [!DOS_NT]:
10960 * lread.c (end_of_file_error, invalid_syntax):
10961 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
10962 * puresize.h (pure_write_error):
10963 * search.c (matcher_overflow):
10964 * sound.c (sound_perror, alsa_sound_perror):
10965 * sysdep.c, syssignal.h (croak):
10966 * term.c (maybe_fatal, vfatal):
10967 * textprop.c (text_read_only):
10968 * undo.c (user_error):
10969 * unexmacosx.c (unexec_error):
10970 * xterm.c (x_ins_del_lines, x_delete_glyphs):
10971 Use _Noreturn rather than NO_RETURN.
10972 No need for separate decl merely because of _Noreturn.
10973 * sound.c (sound_warning, parse_sound):
10974 Remove unnecessary forward decls.
10975
f1dd8073
PE
109762012-06-24 Paul Eggert <eggert@cs.ucla.edu>
10977
10978 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
10979 * lisp.h (WAIT_READING_MAX): New macro.
10980 * dispnew.c (Fsleep_for, sit_for):
10981 * keyboard.c (kbd_buffer_get_event):
10982 * process.c (Faccept_process_output):
10983 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
10984 This improves on the previous patch, which introduced a bug
10985 when time_t is unsigned and as wide as intmax_t.
10986 See <http://bugs.gnu.org/9000#51>.
10987
b82c1755
EZ
109882012-06-23 Eli Zaretskii <eliz@gnu.org>
10989
10990 * dispnew.c (sit_for, Fsleep_for):
10991 * keyboard.c (kbd_buffer_get_event):
10992 * process.c (Faccept_process_output): Avoid compiler warnings when
10993 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
10994
ca300656
JB
109952012-06-23 Juanma Barranquero <lekktu@gmail.com>
10996
049ec95b
JB
10997 * makefile.w32-in: Update dependencies.
10998
ca300656
JB
10999 * w32.c (ltime): Add return type and declare static.
11000 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
11001
db7b8d06
PE
110022012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11003
11004 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
11005 Privately reported by Herbert J. Skuhra.
11006 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
11007 All uses changed.
11008 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
11009 not make_lisp_timeval, when the argument is of type EMACS_TIME.
11010
0bd8297f
EZ
110112012-06-23 Eli Zaretskii <eliz@gnu.org>
11012
96512555
EZ
11013 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
11014 last argument of make_unibyte_string.
11015
0bd8297f
EZ
11016 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
11017 language ID in the event parameters.
11018
11019 * w32term.c (w32_read_socket): Put the new keyboard codepage into
11020 event.code, not the obscure "character set ID".
11021
63def6b6
CY
110222012-06-23 Chong Yidong <cyd@gnu.org>
11023
11024 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
11025
e8a02204
EZ
110262012-06-23 Eli Zaretskii <eliz@gnu.org>
11027
388cdec0
EZ
11028 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
11029 * w32.c (fdutimens): New function.
11030
11031 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
11032
11033 * s/ms-w32.h (pselect): Redirect to sys_select.
11034
11035 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
11036
e8a02204
EZ
11037 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
11038 in the logic of incrementing and decrementing the value of
11039 use_relocatable_buffers.
11040
d054f3fb
PE
110412012-06-23 Paul Eggert <eggert@cs.ucla.edu>
11042
11043 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
11044 Privately reported by Herbert J. Skuhra.
11045 [__FreeBSD__]: Remove "*/" typo after "#include".
11046 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
11047 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
11048 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
11049 Don't assume EMACS_TIME and struct timeval are the same type.
11050
d35af63c
PE
110512012-06-22 Paul Eggert <eggert@cs.ucla.edu>
11052
11053 Support higher-resolution time stamps (Bug#9000).
11054 The time stamps are only nanosecond-resolution at the C level,
11055 since that's the best that any real-world system supports now.
11056 But they are picosecond-resolution at the Lisp level, as that's
11057 easy, and leaves room for future OS improvements.
11058
11059 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
11060 (LIBES): Use it.
11061
11062 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
11063 Don't get current time unless it's needed.
11064
11065 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
11066 now provides it if it's absent.
11067 (start_atimer): Port to higher-res time stamps.
11068 Check for time stamp overflow. Don't get current time more
11069 often than is needed.
11070
11071 * buffer.h (struct buffer): Buffer modtime now has high resolution.
11072 Include systime.h, not time.h.
11073 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
11074
11075 * dired.c: Include stat-time.h.
11076 (Ffile-attributes): File times now have higher resolution.
11077
11078 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
11079 (struct image): Timestamp now has higher resolution.
11080
11081 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
11082 has at least microseconds now. All uses removed.
11083 (update_frame, update_single_window, update_window, update_frame_1)
11084 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 11085 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
11086
11087 * editfns.c (time_overflow): Now extern.
11088 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
11089 (float-time, Fformat_time_string, Fcurrent_time_string)
11090 (Fcurrent_time_zone): Accept and generate higher-resolution
11091 time stamps.
11092 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
11093 (decode_time_components, lisp_seconds_argument): New functions.
11094 (make_time): Now static.
11095 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
11096 Report an error if the time is invalid, rather than having the caller
11097 do that.
11098
11099 * fileio.c: Include <stat-time.h>
11100 (Fcopy_file): Copy higher-resolution time stamps.
11101 Prefer to set the time stamp via a file descriptor if that works.
11102 (Fset_file_times, Finsert_file_contents, Fwrite_region)
11103 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
11104 (Fvisited_file_modtime, Fset_visited_file_modtime):
11105 Support higher-resolution time stamps.
11106
11107 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
11108
11109 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
11110
11111 * image.c (prepare_image_for_display, clear_image_cache)
11112 (lookup_image): Port to higer-resolution time stamps.
11113
11114 * keyboard.c (start_polling, bind_polling_period):
11115 Check for time stamp overflow.
11116 (read_char, kbd_buffer_get_event, timer_start_idle)
11117 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
11118 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
11119 Port to higher-resolution time stamps. Do not assume time_t is signed.
11120 (decode_timer): New function. Timers are now vectors of length 9,
11121 not 8, to accommodate the picosecond component.
11122 (timer_check_2): Use it.
11123
11124 * nsterm.m (select_timeout, timeval_subtract): Remove.
11125 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
11126 as they're a bit more accurate and handle overflow better.
11127 (ns_select): Change prototype to be compatible with pselect.
11128 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
11129 * nsterm.h (ns_select): Adjust prototype.
11130
11131 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
11132 us-resolution time stamps.
11133 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
11134
11135 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
11136
11137 * lisp.h (time_overflow): New decl.
11138 (wait_reading_process_output): First arg is now intmax_t, not int,
11139 to accommodate larger waits.
11140
11141 * process.h (struct Lisp_Process.read_output_delay):
11142 Now counts nanoseconds, not microseconds.
11143 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
11144 EMACS_HAS_USECS.
11145 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
11146 (wait_reading_process_output):
11147 Port to ns-resolution time stamps.
11148 (Faccept_process_output, wait_reading_process_output):
11149 Check for time stamp overflow. Do not assume time_t is signed.
11150 (select_wrapper): Remove; we now use pselect.
11151 (Fprocess_attributes): Now generates ns-resolution time stamps.
11152
11153 * sysdep.c: Include utimens.h. Don't include utime.h
11154 or worry about struct utimbuf; gnulib does that for us now.
11155 (gettimeofday): Remove; gnulib provides a substitute.
11156 (make_timeval): New function.
11157 (set_file_times): Now sets ns-resolution time stamps.
11158 New arg FD; all uses changed.
11159 (time_from_jiffies, ltime_from_jiffies, get_up_time)
11160 (system_process_attributes):
11161 Now returns ns-resolution time stamp. All uses changed.
11162 Check for time stamp overflow.
11163
11164 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
11165 provides a substitute now.
11166
11167 * systime.h: Include timespec.h rather than sys/time.h and time.h,
11168 since it guarantees struct timespec.
11169 (EMACS_TIME): Now struct timespec, so that we can support
11170 ns-resolution time stamps.
11171 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
11172 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
11173 (EMACS_USECS): Remove.
11174 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
11175 so multiply the arg by 1000 before storing it.
11176 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
11177 New macros.
11178 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
11179 Port to ns-resolution time stamps.
11180 (EMACS_TIME_NEG_P): Remove; replaced by....
11181 (EMACS_TIME_SIGN): New macro.
11182 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
11183 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
11184 (set_file_times, make_time, lisp_time_argument): Adjust signature.
11185 (make_timeval, make_lisp_time, decode_time_components): New decls.
11186 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
11187 that it mishandled time_t overflow. You can't compare by subtracting!
11188 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
11189 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
11190
11191 * term.c: Include <sys/time.h>.
11192 (timeval_to_Time): New function, for proper overflow wraparound.
11193 (term_mouse_position, term_mouse_click): Use it.
11194
11195 * undo.c (record_first_change): Support higher-resolution time stamps
11196 in the undo buffer.
11197 (Fprimitive_undo): Use them when restoring time stamps.
11198
11199 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
11200 (w32_get_internal_run_time):
11201 Port to higher-resolution Emacs time stamps.
11202 (ltime): Now accepts single 64-bit integer, as that's more convenient
11203 for callers.
11204
11205 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
11206
11207 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
11208 for compatibility with pselect. Support ns-resolution time stamps.
11209
11210 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
11211
11212 * xselect.c (wait_for_property_change, x_get_foreign_selection):
11213 Check for time stamp overflow, and support ns-resolution time stamps.
11214
11215 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
11216 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
11217 (timeval_subtract): Remove; no longer needed.
11218 (XTflash, XTring_bell, x_wait_for_event):
11219 Port to ns-resolution time stamps. Don't assume time_t is signed.
11220
b6a92dfe
CY
112212012-06-22 Chong Yidong <cyd@gnu.org>
11222
11223 * xdisp.c (x_consider_frame_title): Revert last change.
11224
d251c37c
EZ
112252012-06-22 Eli Zaretskii <eliz@gnu.org>
11226
11227 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
11228 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
11229 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
11230 staticidx goes up to 1597 out of 1600 = 0x640.)
11231
f10deafb
PE
112322012-06-20 Paul Eggert <eggert@cs.ucla.edu>
11233
11234 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
11235 Otherwise, the umask might be mistakenly 0 while handling input signals.
11236
ec6de1e2
SM
112372012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
11238
11239 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
11240
28be1ada
DA
112412012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
11242
11243 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
11244 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
11245 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
11246 access to `contents' member of Lisp_Vector objects with AREF and ASET
11247 where appropriate.
11248
c6bf3022
CY
112492012-06-19 Chong Yidong <cyd@gnu.org>
11250
11251 * frame.c (delete_frame): When selecting a frame on a different
11252 text terminal, do not alter the terminal's top-frame.
11253
11254 * xdisp.c (format_mode_line_unwind_data): Record the target
11255 frame's selected window and its terminal's top-frame.
11256 (unwind_format_mode_line): Restore them.
11257 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
11258 Callers changed.
11259 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
11260 since tty frames can be explicitly named.
11261 (prepare_menu_bars): Likewise.
11262
11263 * term.c (Ftty_top_frame): New function.
11264
defd4196
PE
112652012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11266
11267 Port byte-code-meter to modern targets.
11268 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
11269 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 11270 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
11271 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
11272 (METER_1, METER_2): Simplify.
11273
1053a871
SM
112742012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
11275
11276 * data.c (Fdefalias): Return `symbol' (bug#11686).
11277
b7e8d081
MR
112782012-06-18 Martin Rudalics <rudalics@gmx.at>
11279
11280 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
11281 gets killed during executing of this function (Bug#11665).
11282 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
11283 (Vkill_buffer_query_functions): In doc-string say that functions
11284 run by this hook should not change the current buffer.
11285
7ea2b339
PE
112862012-06-18 Paul Eggert <eggert@cs.ucla.edu>
11287
11288 Fix recently-introduced process.c problems found by static checking.
11289 * process.c (write_queue_push, write_queue_pop, send_process):
11290 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
11291 (write_queue_pop): Fix pointer signedness problem.
11292 (send_process): Remove unused local.
11293
96a313a1
CY
112942012-06-17 Chong Yidong <cyd@gnu.org>
11295
11296 * xdisp.c (redisplay_internal): No need to redisplay terminal
11297 frames that are not on top.
11298
20ca2e94
TN
112992012-06-17 Troels Nielsen <bn.troels@gmail.com>
11300
11301 * process.c (make_process): Initialize write_queue.
11302 (write_queue_push, write_queue_pop): New functions.
11303 (send_process): Use them to maintain correct ordering of process
11304 writes (Bug#10815).
11305
9a900ca9
PE
113062012-06-17 Paul Eggert <eggert@cs.ucla.edu>
11307
310fbfa8
PE
11308 * lisp.h (eassert): Assume C89 or later.
11309 This removes the need for CHECK.
11310 (CHECK): Remove. Its comments about always evaluating its
11311 argument were confusing, as 'eassert' typically does not evaluate
11312 its argument.
11313
27bb1ca4
PE
11314 * coding.c (produce_chars): Use ptrdiff_t, not int.
11315
9a900ca9
PE
11316 * xterm.c (x_draw_underwave): Check for integer overflow.
11317 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
11318
41b7f8bc 113192012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
11320
11321 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
11322 referenced (Bug#11583).
11323
9b0e3eba
AA
113242012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
11325
11326 Implement wave-style variant of underlining.
11327 * dispextern.h (face_underline_type): New enum.
11328 (face): Add field for underline type.
11329 * nsterm.m (ns_draw_underwave): New function.
11330 (ns_draw_text_decoration): Use it.
11331 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
11332 New functions.
11333 (x_draw_glyph_string): Use them.
11334 * xfaces.c (Qline, Qwave): New Lisp objects.
11335 (check_lface_attrs, merge_face_ref)
1053a871
SM
11336 (Finternal_set_lisp_face_attribute, realize_x_face):
11337 Handle wave-style underline face attributes.
9b0e3eba
AA
11338 * xterm.c (x_draw_underwave): New function.
11339 (x_draw_glyph_string): Use it.
11340
0fb52f11
JB
113412012-06-16 Juanma Barranquero <lekktu@gmail.com>
11342
11343 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
11344 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
11345 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
11346 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
11347 ($(BLD)/w32select.$(O)): Update dependencies.
11348
e5560ff7
AS
113492012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11350
11351 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
11352 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
11353 * character.c (_fetch_multibyte_char_p): Remove.
11354 * alloc.c: Include "character.h" before "buffer.h".
11355 * bidi.c: Likewise.
11356 * buffer.c: Likewise.
11357 * bytecode.c: Likewise.
11358 * callint.c: Likewise.
11359 * callproc.c: Likewise.
11360 * casefiddle.c: Likewise.
11361 * casetab.c: Likewise.
11362 * category.c: Likewise.
11363 * cmds.c: Likewise.
11364 * coding.c: Likewise.
11365 * composite.c: Likewise.
11366 * dired.c: Likewise.
11367 * dispnew.c: Likewise.
11368 * doc.c: Likewise.
11369 * dosfns.c: Likewise.
11370 * editfns.c: Likewise.
11371 * emacs.c: Likewise.
11372 * fileio.c: Likewise.
11373 * filelock.c: Likewise.
11374 * font.c: Likewise.
11375 * fontset.c: Likewise.
11376 * fringe.c: Likewise.
11377 * indent.c: Likewise.
11378 * insdel.c: Likewise.
11379 * intervals.c: Likewise.
11380 * keyboard.c: Likewise.
11381 * keymap.c: Likewise.
11382 * lread.c: Likewise.
11383 * macros.c: Likewise.
11384 * marker.c: Likewise.
11385 * minibuf.c: Likewise.
11386 * nsfns.m: Likewise.
11387 * nsmenu.m: Likewise.
11388 * print.c: Likewise.
11389 * process.c: Likewise.
11390 * regex.c: Likewise.
11391 * region-cache.c: Likewise.
11392 * search.c: Likewise.
11393 * syntax.c: Likewise.
11394 * term.c: Likewise.
11395 * textprop.c: Likewise.
11396 * undo.c: Likewise.
11397 * unexsol.c: Likewise.
11398 * w16select.c: Likewise.
11399 * w32fns.c: Likewise.
11400 * w32menu.c: Likewise.
11401 * window.c: Likewise.
11402 * xdisp.c: Likewise.
11403 * xfns.c: Likewise.
11404 * xmenu.c: Likewise.
11405 * xml.c: Likewise.
11406 * xselect.c: Likewise.
11407
2f07e6af
EZ
114082012-06-16 Eli Zaretskii <eliz@gnu.org>
11409
1053a871
SM
11410 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
11411 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 11412 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
11413 row.
11414 (handle_face_prop): Use chunk-relative overlay string index when
11415 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
11416 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
11417 the rightmost. (Bug#11720)
2f07e6af 11418
29b83cec
AS
114192012-06-16 Andreas Schwab <schwab@linux-m68k.org>
11420
11421 * category.h (CHAR_HAS_CATEGORY): Define as inline.
11422 (CATEGORY_MEMBER): Enforce 1/0 value.
11423 * category.c (_temp_category_set): Remove.
11424
4c5501e9
EZ
114252012-06-16 Eli Zaretskii <eliz@gnu.org>
11426
11427 * window.c (Fdelete_other_windows_internal)
11428 (Fdelete_window_internal): Don't access frame's mouse highlight
11429 info of the initial frame. (Bug#11677)
11430
2b570124
PE
114312012-06-14 Paul Eggert <eggert@cs.ucla.edu>
11432
e93864f9
PE
11433 * .gdbinit (xgetint): Fix recently-introduced paren typo.
11434 Assume USE_2_TAGS_FOR_INTS.
11435 (xreload): Adjust $tagmask width to match recent lisp.h change.
11436
2b570124
PE
11437 Simplify lisp.h in minor ways that should not affect code.
11438 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
11439 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
11440 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
11441 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
11442 (INTTYPEBITS): New macro, for clarity.
11443 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
11444 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
11445 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
11446 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
11447 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
11448
81755f69
JB
114492012-06-13 Juanma Barranquero <lekktu@gmail.com>
11450
11451 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
11452
16192a57
GM
114532012-06-13 Glenn Morris <rgm@gnu.org>
11454
11455 * s/bsd-common.h (BSD4_3):
11456 * s/usg5-4-common.h (USG5_4): No longer define; unused.
11457
646b5f55
AS
114582012-06-13 Andreas Schwab <schwab@linux-m68k.org>
11459
11460 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
11461 instead of union.
11462 (XLI, XIL): Define.
1053a871
SM
11463 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
11464 Use them.
11465 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 11466 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 11467 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
11468 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
11469 * frame.c (delete_frame): Remove outdated comment.
11470 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
11471 USE_LISP_UNION_TYPE.
11472 (Fw32_unregister_hot_key): Likewise.
11473 (Fw32_toggle_lock_key): Likewise.
11474 * w32menu.c (add_menu_item): Likewise.
11475 (w32_menu_display_help): Use XIL instead of checking
11476 USE_LISP_UNION_TYPE.
11477 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
11478 (init_heap): Likewise.
11479 * w32term.c (w32_read_socket): Update comment.
11480
1d3823c9
GM
114812012-06-13 Glenn Morris <rgm@gnu.org>
11482
c62ff706
GM
11483 * s/usg5-4-common.h, src/s/unixware.h:
11484 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
11485
1d3823c9
GM
11486 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
11487
bfe3e0a2
PE
114882012-06-13 Paul Eggert <eggert@cs.ucla.edu>
11489
11490 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
11491 * alloc.c (make_number) [!defined make_number]:
11492 Remove, as lisp.h always defines this now.
11493 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
11494 (roundup_size): Verify that it is a power of 2.
11495 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
11496 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
11497 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
11498 -DUSE_LSB_TAG=0, to override the automatically-selected default.
11499 USE_LSB_TAG now is always defined to be either 0 or 1.
11500 All uses changed.
11501 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
11502 code works fine either way, and efficiency is not a concern here,
11503 as the union type is for debugging, not for production.
11504 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
11505 Use an inline function on all platforms when using the union type,
11506 since this is simpler and 'static inline' can be used portably
11507 within Emacs now.
11508 (LISP_INITIALLY_ZERO): New macro.
11509 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
11510 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
11511
45fa9c0f
GM
115122012-06-12 Glenn Morris <rgm@gnu.org>
11513
b4492cba
GM
11514 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
11515
11516 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 11517
45fa9c0f
GM
11518 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
11519 Move BROKEN_SIGIO to configure.
11520
11521 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
11522 Move NO_TERMIO to configure.
11523
0e25d334
CY
115242012-06-12 Chong Yidong <cyd@gnu.org>
11525
11526 * image.c (imagemagick_load_image): Use MagickFlattenImage if
11527 MagickMergeImageLayers is undefined. Use pixel pusher loop if
11528 MagickExportImagePixels is undefined.
11529
43682bb6
PE
115302012-06-12 Paul Eggert <eggert@cs.ucla.edu>
11531
11532 * image.c (imagemagick_load_image): Remove unused label.
11533
a9be7d2b
GM
115342012-06-11 Glenn Morris <rgm@gnu.org>
11535
11536 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
11537 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
11538 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
11539 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
11540
3017f87f
SM
115412012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
11542
11543 * alloc.c (make_byte_code): New function.
11544 (Fmake_byte_code): Use it. Don't purify here.
11545 * lread.c (read1): Use it as well to avoid extra allocation.
11546
1b9b4cf4
CY
115472012-06-11 Chong Yidong <cyd@gnu.org>
11548
11549 * image.c (imagemagick_load_image): Implement transparency.
11550
95988fcf
AS
115512012-06-10 Andreas Schwab <schwab@linux-m68k.org>
11552
11553 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
11554 account for preceding backslashes. (Bug#11663)
11555
cd4eb164
CY
115562012-06-09 Chong Yidong <cyd@gnu.org>
11557
11558 * term.c: Support italics in capable terminals (Bug#9652).
11559 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
11560 (turn_on_face): Output using TS_enter_italic_mode if available.
11561 Don't handle unused blinking and alt-charset cases.
11562 (turn_off_face): Handle italic case; discard unused tty_blinking_p
11563 and tty_alt_charset_p cases.
11564 (tty_capable_p, init_tty): Support italics.
11565
11566 * termchar.h (struct tty_display_info): Add field for italics.
11567 Remove unused blink field.
11568
11569 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
11570 Handle slant.
11571
11572 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
11573 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
11574 tty_alt_charset_p. Add tty_italic_p.
11575
ff88beb8
MA
115762012-06-09 Michael Albinus <michael.albinus@gmx.de>
11577
11578 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
11579 dbus_type_is_basic if available.
11580 (xd_extract_signed, xd_extract_unsigned): Rename from
11581 extract_signed and extract_unsigned, respectively. Adapt callers.
11582
44286096
CY
115832012-06-09 Chong Yidong <cyd@gnu.org>
11584
1682701f
CY
11585 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
11586
44286096
CY
11587 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
11588 case (Bug#9752).
11589
d86feb17
PE
115902012-06-08 Paul Eggert <eggert@cs.ucla.edu>
11591
11592 * xdisp.c (vmessage): Treat frame message as multibyte.
11593 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
11594 would generate the diagnostic "Making \302\247 buffer-local while
11595 let-bound!".
11596
d5c20fe8
EZ
115972012-06-08 Eli Zaretskii <eliz@gnu.org>
11598
11599 * dispnew.c (showing_window_margins_p): Undo last change, which
11600 was done due to an inadvertent commit.
11601 (adjust_frame_glyphs_for_frame_redisplay): Do call
11602 showing_window_margins_p.
11603
513749ee
SM
116042012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11605
11606 * eval.c (Fmake_var_non_special): New primitive.
11607 (syms_of_eval): Defsubr it.
11608 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
11609
d4a8f5c1
JB
116102012-06-08 Juanma Barranquero <lekktu@gmail.com>
11611
11612 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
11613 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
11614
8bbbc977
EZ
116152012-06-08 Eli Zaretskii <eliz@gnu.org>
11616
11617 * alloc.c (allocate_vectorlike): Fix last change.
11618
f3372c87
DA
116192012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
11620
11621 Block-based vector allocation of small vectors.
11622 * lisp.h (struct vectorlike_header): New field `nbytes',
11623 adjust comment accordingly.
11624 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
fc0c31f8 11625 to denote vector blocks. Adjust users (live_vector_p,
f3372c87
DA
11626 mark_maybe_pointer, valid_lisp_object_p) accordingly.
11627 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
11628 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
11629 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
11630 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
11631 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
11632 (roundup_size): New constant.
11633 (struct vector_block): New data type.
11634 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 11635 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
11636 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
11637 (sweep_vectors): New functions.
11638 (allocate_vectorlike): Return `zero_vector' as the only vector of
fc0c31f8 11639 0 items. Allocate new vector from block if vector size is less than
f3372c87
DA
11640 or equal to VBLOCK_BYTES_MAX.
11641 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
11642 (init_alloc_once): Add call to init_vectors.
11643
4f18a4ed
SM
116442012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
11645
11646 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
11647
86f158bc
PE
116482012-06-07 Paul Eggert <eggert@cs.ucla.edu>
11649
11650 * doprnt.c (doprnt): Truncate multibyte char correctly.
11651 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
11652 would mishandle a string argument "Xc" if X was a multibyte
11653 character of length 2: it would truncate after X's first byte
11654 rather than including all of X.
11655
c5cfcbe0
CY
116562012-06-06 Chong Yidong <cyd@gnu.org>
11657
11658 * buffer.c (word_wrap): Doc fix.
11659
c05cf390
PE
116602012-06-04 Paul Eggert <eggert@cs.ucla.edu>
11661
11662 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
11663
0c3461de
GM
116642012-06-03 Glenn Morris <rgm@gnu.org>
11665
11666 * xdisp.c (tool-bar-style): Doc fix.
11667
c71232db
UM
116682012-06-03 Ulrich Müller <ulm@gentoo.org>
11669
11670 * Makefile.in (PAXCTL): Define.
11671 (temacs$(EXEEXT)): Disable memory randomization for the temacs
11672 binary via PaX flags if the paxctl utility is available.
11673 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
11674 Restore PaX flags to their default. (Bug#11398)
11675
383f7350
CY
116762012-06-03 Chong Yidong <cyd@gnu.org>
11677
11678 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
11679 buffer (Bug#11226).
11680
5f2c76c6
CY
116812012-06-03 Chong Yidong <cyd@gnu.org>
11682
11683 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
11684 (note_mode_line_or_margin_highlight): If there is no help echo,
11685 use mode-line-default-help-echo. Handle the case where the mouse
11686 position is past the end of the mode line string.
11687
11688 * buffer.c (buffer_local_value_1): New function, split from
11689 Fbuffer_local_value; can return Qunbound.
11690 (Fbuffer_local_value): Use it.
11691 (Vmode_line_format): Docstring tweaks.
11692
773d47f6
PE
116932012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11694
11695 * sysdep.c (system_process_attributes): Improve comment.
11696
f2d6a3df
SM
116972012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
11698
11699 * keyboard.c: Export real-this-command to Elisp.
11700 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
11701 and DEFVAR it. Update all users.
11702
63810350
PE
117032012-06-02 Paul Eggert <eggert@cs.ucla.edu>
11704
7bd5c1f4
PE
11705 * minibuf.c (Fassoc_string): Remove duplicate declaration.
11706
63810350
PE
11707 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
11708 Convert pctcpu and pctmem to Lisp float properly.
11709 Let the compiler fold better, as 100.0/0x8000 is exact.
11710
a2821611
AS
117112012-06-02 Andreas Schwab <schwab@linux-m68k.org>
11712
11713 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
11714 cons_block.
11715
5fceba1d
PE
117162012-06-01 Paul Eggert <eggert@cs.ucla.edu>
11717
11718 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
11719
c98ff5dd
DA
117202012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
11721
11722 For a 'struct window', replace some Lisp_Object fields to
11723 bitfields where appropriate, remove unused fields.
11724 * window.h (struct window): Remove unused 'last_mark_x' and
11725 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
1f9f395d 11726 change its type from Lisp_Object to bitfield.
c98ff5dd
DA
11727 Change type of 'force_start', 'optional_new_start',
11728 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
fc0c31f8 11729 fields from Lisp_Object to bitfield. Adjust users accordingly.
c98ff5dd 11730
ca34e0be
PE
117312012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11732
11733 Pacify gcc -Wdouble-precision when using Xaw.
11734 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
11735 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
11736 Use 'float' consistently, rather than 'float' in most places
11737 and 'double' in a couple of places.
11738
efc00ab1 117392012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
11740
11741 * xdisp.c (handle_stop): Detect whether we have overlay strings
11742 loaded by testing it->current.overlay_string_index to be
11743 non-negative, instead of checking whether n_overlay_strings is
11744 positive. (Bug#11587)
11745
efc00ab1 117462012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
11747
11748 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
11749
11750 * doc.c (Fsubstitute_command_keys): Doc fix.
11751
efc00ab1 117522012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
11753
11754 * search.c (search_buffer): Remove calls to
11755 r_alloc_inhibit_buffer_relocation, as it is now called by
11756 maybe_unify_char, which was the cause of relocation of buffer text
11757 in bug#11519.
11758
efc00ab1 117592012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
11760
11761 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
11762 for the duration of call to load_charset, to avoid problems with
11763 callers of maybe_unify_char that access buffer text through C
11764 pointers.
11765
11766 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
11767 decrement the inhibition flag, instead of just setting or
11768 resetting it.
11769
ba93a187
PE
117702012-05-31 Paul Eggert <eggert@cs.ucla.edu>
11771
11772 Remove obsolete '#define static' cruft.
11773 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
11774 This #undef was "temporary" in 2000; it is no longer needed
11775 now that '#define static' has gone away.
11776 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
11777 (gray_bitmap_bits): Remove; no longer needed.
11778 All uses replaced with definiens.
11779 * xterm.c: Include "bitmaps/gray.xbm".
11780
9e4bf381
PE
117812012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11782
11783 Clean up __executable_start, monstartup when --enable-profiling.
11784 The following changes affect the code only when profiling.
11785 * dispnew.c (__executable_start): Rename from safe_bcopy.
11786 Define only on platforms that need it.
11787 * emacs.c: Include <sys/gmon.h> when profiling.
11788 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
11789 (__executable_start): Remove decl, since lisp.h does it now.
11790 (safe_bcopy): Remove decl; no longer has that name.
11791 (main): Coalesce #if into single bit of code, for simplicity.
11792 Cast pointers to uintptr_t, since standard libraries want integers
11793 and not pointers.
11794 * lisp.h (__executable_start): New decl.
11795
32d72c2f
GM
117962012-05-31 Glenn Morris <rgm@gnu.org>
11797
11798 * image.c (Fimagemagick_types): Doc fix.
11799
baac5bc7
JM
118002012-05-30 Jim Meyering <meyering@redhat.com>
11801
11802 * callproc.c (Fcall_process_region): Include directory component
11803 in mkstemp error message (Bug#11586).
11804
72cb32cf
PE
118052012-05-30 Paul Eggert <eggert@cs.ucla.edu>
11806
11807 * alloc.c, lisp.h (make_pure_vector): Now static.
11808
61b108cc
SM
118092012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
11810
11811 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
11812 Move to byte-run.el.
11813 (Fautoload): Do the hash-doc more carefully.
11814 * data.c (Fdefalias): Purify definition, except for keymaps.
11815 (Qdefun): Move from eval.c.
11816 * lisp.h (Qdefun): Remove.
11817 * lread.c (read1): Tiny simplification.
11818
471fe23d
TN
118192012-05-29 Troels Nielsen <bn.troels@gmail.com>
11820
934f3f58 11821 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
11822 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
11823 Bug#9642, but explicitly check that the buffer the overlay would
11824 be moved to is live and rearrange lines to make sure that errors
11825 will not put the overlay in an inconsistent state.
11826 (Fdelete_overlay): Cosmetics.
11827
85d0efd1
EZ
118282012-05-28 Eli Zaretskii <eliz@gnu.org>
11829
11830 * w32term.c (my_bring_window_to_top): New function.
11831 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
11832 could be different from the original one.
11833 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
11834 (Bug#11513)
11835
11836 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
11837 by calling BringWindowToTop.
11838
11839 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
11840 (WM_EMACS_END): Increase by one.
11841
da92a98c
PE
118422012-05-28 Paul Eggert <eggert@cs.ucla.edu>
11843
11844 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
11845 This avoids undefined behavior that might cause the eassert
11846 to not catch an out-of-range value.
11847
74d1f848
JB
118482012-05-28 Juanma Barranquero <lekktu@gmail.com>
11849
11850 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
11851 Update dependencies.
11852
9e1a06fc
EZ
118532012-05-27 Eli Zaretskii <eliz@gnu.org>
11854
11855 * bidi.c (bidi_mirror_char): Fix last change.
11856
f3dd7312
AS
118572012-05-27 Andreas Schwab <schwab@linux-m68k.org>
11858
11859 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
11860 when referring to sectname field in printf format.
11861
81899c91
PE
118622012-05-27 Paul Eggert <eggert@cs.ucla.edu>
11863
57b81a9f
PE
11864 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
11865 Only r_alloc_inhibit_buffer_relocation needed to be added;
11866 the others were already declared.
11867
81899c91
PE
11868 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
11869 before checking whether it's out of range. Put the check inside
11870 eassert. See
11871 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
11872
33017faf 118732012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
11874
11875 * callproc.c (Fcall_process): Restore a line that was accidentally
11876 commented out in the 2011-02-13 change (bug#11547).
11877
33017faf 118782012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
11879
11880 * lisp.h [REL_ALLOC]: Add prototypes for external functions
11881 defined on ralloc.c.
11882
11883 * buffer.c [REL_ALLOC]: Remove prototypes of
11884 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
11885 they are now on lisp.h.
11886
11887 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
11888
11889 * search.c (search_buffer): Use it to inhibit relocation of buffer
11890 text while re_search_2 is doing its job, because re_search_2 is
11891 passed C pointers to buffer text. (Bug#11519)
11892
23415acf
EZ
11893 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
11894 Update value to 24.
11895
44e27368
EZ
11896 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
11897 state after an additional call to move_it_in_display_line_to, keep
11898 the values of it->max_ascent and it->max_descent found for the
11899 entire line.
11900 (pos_visible_p): Revert the comparison against bottom_y to what it
11901 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
11902 (Bug#11464)
11903
c1892f11
PE
119042012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11905
11906 Fix coding-related core dumps with gcc -ftrapv.
11907 The code was computing A - B, where A and B are pointers, and B is
11908 random garbage. This can lead to core dumps on platforms that
11909 have special pointer registers, and it also leads to core dumps on
11910 x86-64 when compiled with gcc -ftrapv. The fix is to compute
11911 A - B only when B is initialized properly.
11912 * coding.c (coding_set_source, coding_set_destination): Return void.
11913 (coding_change_source, coding_change_destinations): New functions,
11914 with the old behaviors of coding_set_source and coding_set_destination.
11915 All callers that need an offset changed to use these new functions.
11916
eb7afdad
GM
119172012-05-26 Glenn Morris <rgm@gnu.org>
11918
11919 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
11920
f12fdf02
EZ
119212012-05-26 Eli Zaretskii <eliz@gnu.org>
11922
53a63be6 11923 Extend mouse support on W32 text-mode console.
61b108cc
SM
11924 * xdisp.c (draw_row_with_mouse_face):
11925 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 11926
eb3f6f01 11927 * w32console.c: Include window.h.
61b108cc
SM
11928 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
11929 New functions.
eb3f6f01
EZ
11930 (initialize_w32_display): Initialize mouse-highlight data.
11931
53a63be6
EZ
11932 * w32inevt.c: Include termchar.h and window.h.
11933 (do_mouse_event): Support mouse-autoselect-window. When the mouse
11934 moves, call note_mouse_highlight. If help_echo changed, call
11935 gen_help_event to produce help-echo message in the echo area.
11936 Call clear_mouse_face if mouse_face_hidden is set in the mouse
11937 highlight info.
11938
4cfd81f6
PE
119392012-05-26 Paul Eggert <eggert@cs.ucla.edu>
11940
11941 * lread.c (read1): Simplify slightly to avoid an overflow warning
11942 with GCC 4.7.0 on x86-64.
11943
4446092a
EZ
119442012-05-26 Eli Zaretskii <eliz@gnu.org>
11945
11946 * bidi.c (bidi_mirror_char): Revert last change: an int is
11947 definitely wide enough here.
11948
42b2a986 119492012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 11950
42b2a986 11951 Fix integer width and related bugs (Bug#9874).
eb106a49 11952 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
11953 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
11954 (string_bytes, check_sblock, allocate_string_data):
11955 (compact_small_strings, Fmake_bool_vector, make_string)
11956 (make_unibyte_string, make_multibyte_string)
11957 (make_string_from_bytes, make_specified_string)
11958 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
11959 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
11960 (mark_vectorlike):
11961 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11962 (allocate_pseudovector):
11963 Use int, not EMACS_INT, where int is wide enough.
11964 (inhibit_garbage_collection, Fgarbage_collect):
11965 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11966 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
11967 int might not be wide enough.
11968 (bidi_cache_search, bidi_cache_find, bidi_init_it)
11969 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
11970 (bidi_at_paragraph_end, bidi_find_paragraph_start)
11971 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
11972 (bidi_level_of_next_char, bidi_move_to_visually_next):
11973 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11974 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
11975 (Fkill_buffer, Fset_buffer_major_mode)
11976 (advance_to_char_boundary, Fbuffer_swap_text)
11977 (Fset_buffer_multibyte, overlays_at, overlays_in)
11978 (overlay_touches_p, struct sortvec, record_overlay_string)
11979 (overlay_strings, recenter_overlay_lists)
11980 (adjust_overlays_for_insert, adjust_overlays_for_delete)
11981 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
11982 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
11983 (Foverlay_recenter, last_overlay_modification_hooks_used)
11984 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
11985 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
11986 (validate_region): Omit unnecessary test for b <= e,
11987 since that's guaranteed by the previous test.
d311d28c
PE
11988 (adjust_overlays_for_delete): Avoid pos + length overflow.
11989 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
11990 (report_overlay_modification):
11991 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
11992 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
11993 Omit pointer cast, which isn't needed anyway, and doesn't work
11994 after the EMACS_INT -> ptrdiff_t change.
02481186 11995 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
11996 * buffer.h: Adjust decls to match defn changes elsewhere.
11997 (struct buffer_text, struct buffer):
11998 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
11999 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
12000 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
12001 not int, to avoid needless 32-bit limit on 64-bit hosts.
12002 (exec_byte_code): Use tighter memory-full test, one that checks
12003 for alloca overflow. Don't compute the address of the object just
12004 before an array, as that's not portable. Use EMACS_INT, not
12005 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
12006 * callint.c (Fcall_interactively):
12007 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12008 * callproc.c (call_process_kill, Fcall_process):
12009 Don't assume pid_t fits into an Emacs fixnum.
12010 (call_process_cleanup, Fcall_process, child_setup):
12011 Don't assume pid_t fits into int.
12012 (call_process_cleanup, Fcall_process, delete_temp_file)
12013 (Fcall_process_region):
12014 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12015 (Fcall_process): Simplify handling of volatile integers.
12016 Use int, not EMACS_INT, where int will do.
12017 * casefiddle.c (casify_object, casify_region, operate_on_word)
12018 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
12019 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12020 (casify_object): Avoid integer overflow when overallocating buffer.
12021 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 12022 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
12023 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
12024 * category.h (CATEGORYP): Don't assume arg is nonnegative.
12025 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
12026 integers are now checked earlier. All uses replaced with XINT.
12027 (ccl_driver):
12028 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12029 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
12030 (ccl_driver, Fregister_code_conversion_map):
12031 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
12032 (resolve_symbol_ccl_program): Check that vector header is in range.
12033 Always copy the vector, so that we can check its contents reliably
12034 now rather than having to recheck each instruction as it's being
12035 executed. Check that vector words fit in 'int'.
12036 (ccl_get_compiled_code, Fregister_ccl_program)
12037 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
12038 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
12039 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
12040 contents are in range.
12041 (Fccl_execute_on_string): Check that status is in range.
12042 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
12043 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
12044 Accept and return EMACS_INT, not int, because callers can pass values
12045 out of 'int' range.
12046 (c_string_width, strwidth, lisp_string_width, chars_in_text)
12047 (multibyte_chars_in_text, parse_str_as_multibyte)
12048 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
12049 (str_as_unibyte, str_to_unibyte, string_count_byte8)
12050 (string_escape_byte8, Fget_byte):
12051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 12052 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
12053 avoid mishandling large integers.
12054 * character.h: Adjust decls to match defn changes elsewhere.
12055 * charset.c (load_charset_map_from_file, find_charsets_in_text)
12056 (Ffind_charset_region):
12057 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12058 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
12059 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 12060 Don't assume fixnum fits in int.
d311d28c
PE
12061 (load_charset_map_from_vector, Fmap_charset_chars):
12062 Remove now-unnecessary CHECK_NATNUMs.
12063 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
12064 Don't rely on undefined behavior with signed left shift overflow.
12065 Don't assume unsigned int fits into fixnum, or that fixnum fits
12066 into unsigned int. Don't require max_code to be a valid fixnum;
12067 that's not true for gb10830 4-byte on a 32-bit host. Allow
12068 invalid_code to be a cons, for the same reason. Require code_offset
12069 to be a character. Avoid int overflow if max_char is close
12070 to INT_MAX.
12071 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
12072 this is intended anyway and avoids some undefined behavior.
12073 (load_charset_map): Pass unsigned, not int, as 2nd arg of
12074 INDEX_TO_CODE_POINT, as that's what it expects.
12075 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
12076 * charset.h (DECODE_CHAR): Return int, not unsigned;
12077 this is what was intended anyway, and it avoids undefined behavior.
12078 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
12079 integer-overflow issues.
12080 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
12081 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
12082 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
12083 * chartab.c (Fmake_char_table, Fset_char_table_range)
12084 (uniprop_get_decoder, uniprop_get_encoder):
12085 Don't assume fixnum fits in int.
12086 * cmds.c (move_point): New function, that does the gist of
12087 Fforward_char and Fbackward_char, but does so while checking
12088 for integer overflow more accurately.
c96e5d6a 12089 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
12090 (Fforward_line, Fend_of_line, internal_self_insert)
12091 (internal_self_insert):
12092 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12093 Fix a FIXME, by checking for integer overflow when calculating
12094 target_clm and actual_clm.
12095 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 12096 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
12097 (ASSURE_DESTINATION, coding_alloc_by_realloc)
12098 (coding_alloc_by_making_gap, alloc_destination)
12099 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
12100 (encode_coding_utf_16, detect_coding_emacs_mule)
12101 (decode_coding_emacs_mule, encode_coding_emacs_mule)
12102 (detect_coding_iso_2022, decode_coding_iso_2022)
12103 (encode_invocation_designation, encode_designation_at_bol)
12104 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
12105 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
12106 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
12107 (encode_coding_ccl, encode_coding_raw_text)
12108 (detect_coding_charset, decode_coding_charset)
12109 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
12110 (produce_composition, produce_charset, produce_annotation)
12111 (decode_coding, handle_composition_annotation)
12112 (handle_charset_annotation, consume_chars, decode_coding_gap)
12113 (decode_coding_object, encode_coding_object, detect_coding_system)
12114 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
12115 (code_convert_region, code_convert_string)
8f50130c
PE
12116 (Fdefine_coding_system_internal)
12117 (coding_set_source, coding_set_destination):
d311d28c
PE
12118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12119 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
12120 (Fdefine_coding_system_internal):
12121 Don't assume fixnums fit in int.
12122 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 12123 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
12124 (Funencodable_char_position, Fcheck_coding_systems_region)
12125 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 12126 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 12127 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 12128 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 12129 Don't access memory outside of the args array.
d311d28c 12130 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
12131 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
12132 result of ENCODE_CHAR.
d311d28c
PE
12133 * coding.h: Adjust decls to match defn changes elsewhere.
12134 (struct coding_system):
12135 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12136 * composite.c (get_composition_id, find_composition)
12137 (run_composition_function, update_compositions)
12138 (compose_text, composition_gstring_put_cache)
12139 (composition_gstring_p, composition_gstring_width)
12140 (fill_gstring_header, fill_gstring_body, autocmp_chars)
12141 (composition_compute_stop_pos, composition_reseat_it)
12142 (composition_update_it, struct position_record)
12143 (find_automatic_composition, composition_adjust_point)
12144 (Fcomposition_get_gstring, Ffind_composition_internal):
12145 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12146 (update_compositions):
12147 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12148 * composite.h: Adjust decls to match defn changes elsewhere.
12149 (struct composition):
12150 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12151 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
12152 Do not attempt to compute the address of the object just before a
12153 buffer; this is not portable.
12154 (Faref, Faset):
12155 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12156 (Faset): Use int, not EMACS_INT, where int is wide enough.
12157 (Fstring_to_number): Don't assume fixnums fit in int.
12158 (Frem): Don't assume arg is nonnegative.
12159 * dbusbind.c (xd_append_arg): Check for integers out of range.
12160 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 12161 (extract_signed, extract_unsigned): New functions.
243e0530
PE
12162 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
12163 (xd_get_connection_references): Return ptrdiff_t, not int.
12164 All uses changed.
12165 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
12166 (xd_read_message_1):
12167 Use int, not unsigned, where the dbus API uses int.
12168 (Fdbus_message_internal): Don't overflow mtype.
12169 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
12170 * dired.c (directory_files_internal, file_name_completion, scmp)
12171 (file_name_completion_stat):
12172 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12173 (file_name_completion): Don't overflow matchcount.
12174 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
12175 * dispextern.h: Adjust decls to match defn changes elsewhere.
12176 (struct text_pos, struct glyph, struct bidi_saved_info)
12177 (struct bidi_string_data, struct bidi_it, struct composition_it)
12178 (struct it):
12179 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12180 (struct display_pos, struct composition_it, struct it):
12181 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12182 * dispnew.c (increment_matrix_positions)
12183 (increment_row_positions, mode_line_string)
12184 (marginal_area_string):
12185 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 12186 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
12187 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12188 (duration_to_sec_usec): New function, to check for overflow better.
12189 (Fsleep_for, sit_for): Use it.
12190 * doc.c (get_doc_string, store_function_docstring):
12191 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12192 (get_doc_string, Fsnarf_documentation):
12193 Use int, not EMACS_INT, where int is wide enough.
12194 (get_doc_string):
12195 Use SAFE_ALLOCA, not alloca.
12196 Check for overflow when converting EMACS_INT to off_t.
12197 * doprnt.c (doprnt):
12198 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12199 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
12200 Don't assume uid_t fits into fixnum.
12201 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
12202 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
12203 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
12204 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
12205 (general_insert_function)
12206 (Finsert_char, make_buffer_string, make_buffer_string_both)
12207 (update_buffer_properties, Fbuffer_substring)
12208 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
12209 (Fsubst_char_in_region, check_translation)
12210 (Ftranslate_region_internal, save_restriction_restore, Fformat)
12211 (transpose_markers, Ftranspose_regions):
12212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12213 (clip_to_bounds): Move to lisp.h as an inline function).
12214 (Fconstrain_to_field): Don't assume integers are nonnegative.
12215 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
12216 (Fsubst_char_in_region, Fsave_restriction):
12217 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12218 (Femacs_pid): Don't assume pid_t fits into fixnum.
12219 (lo_time): Use int, not EMACS_INT, when int suffices.
12220 (lisp_time_argument): Check for usec out of range.
12221 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
12222 (Fuser_login_name, Fuser_full_name): Signal an error
12223 if a uid argument is out of range, rather than relying on
12224 undefined behavior.
c8d5c857
PE
12225 (Fformat_time_string): Remove now-unnecessary check.
12226 lisp_time_argument checks for out-of-range usec now.
243e0530 12227 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
12228 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
12229 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
12230 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
12231 (init_cmdargs, Fdump_emacs):
12232 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12233 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
12234 the bottom (typically) 32 bits of the fixnum.
12235 * eval.c (specpdl_size, call_debugger):
12236 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12237 (when_entered_debugger, Fbacktrace_debug):
12238 Don't assume fixnum can fit in int.
12239 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
12240 the object just before a buffer; this is not portable.
12241 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
12242 (grow_specpdl, unbind_to):
12243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12244 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
12245 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 12246 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
12247 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
12248 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
12249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12250 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
12251 (a_write, e_write):
12252 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12253 (Fcopy_file, non_regular_nbytes, read_non_regular)
12254 (Finsert_file_contents):
12255 Use int, not EMACS_INT, where int is wide enough.
12256 (READ_BUF_SIZE): Verify that it fits in int.
12257 (Finsert_file_contents): Check that counts are in proper range,
12258 rather than assuming fixnums fit into ptrdiff_t etc.
12259 Don't assume fixnums fit into int.
125b3835 12260 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
12261 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
12262 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
12263 (string_char_to_byte, string_byte_to_char)
12264 (string_make_multibyte, string_to_multibyte)
12265 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
12266 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
12267 (substring_both, Fdelete, internal_equal, Ffillarray)
12268 (Fclear_string, mapcar1)
12269 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
12270 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
12271 (larger_vector, make_hash_table, maybe_resize_hash_table)
12272 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
12273 (Fmaphash, secure_hash):
12274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12275 (concat): Check for string index and length overflow.
12276 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
12277 (Frequire):
12278 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12279 (larger_vector): New API (vec, incr_min, size_max) replaces old
12280 one (vec, new_size, init). This catches size overflow.
12281 INIT was removed because it was always Qnil.
12282 All callers changed.
12283 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
12284 the upper bound on a hash table index size.
12285 (make_hash_table, maybe_resize_hash_table): Use it.
12286 (secure_hash): Computer start_byte and end_byte only after
12287 they're known to be in ptrdiff_t range.
12288 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
12289 (Ffont_get_glyphs, Ffont_at):
12290 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12291 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
12292 (Flist_fonts, Fopen_font):
12293 Don't assume fixnum can fit in int.
12294 (check_gstring): Don't assume index can fit in int.
12295 (font_match_p): Check that fixnum is a character, not a nonnegative
12296 fixnum, since the later code needs to stuff it into an int.
12297 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
12298 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
12299 conversion overflow issues.
12300 (Fopen_font): Check for integer out of range.
12301 (Ffont_get_glyphs): Don't assume index can fit in int.
12302 * font.h: Adjust decls to match defn changes elsewhere.
12303 * fontset.c (reorder_font_vector): Redo score calculation to avoid
12304 integer overflow.
12305 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
12306 printmax_t, where ptrdiff_t is wide enough.
12307 (Finternal_char_font):
12308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12309 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
12310 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
12311 (Fset_frame_position, x_set_frame_parameters)
12312 (x_set_line_spacing, x_set_border_width)
12313 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
12314 Check that fixnums are in proper range for system types.
12315 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
12316 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12317 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
12318 Use SAFE_ALLOCA_LISP, not alloca.
12319 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
12320 intptr_t is wide enough.
12321 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
12322 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
12323 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
12324 Check for fixnum out of range.
12325 * ftfont.c (ftfont_list): Don't assume index fits in int.
12326 Check that fixnums are in proper range for system types.
12327 (ftfont_shape_by_flt):
12328 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
12329 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
12330 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12331 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
12332 Check that fixnums are in proper range for system types.
12333 * gnutls.h: Adjust decls to match defn changes elsewhere.
12334 * gtkutil.c (xg_dialog_run):
12335 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12336 (update_frame_tool_bar):
12337 Check that fixnums are in proper range for system types.
12338 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 12339 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
12340 * indent.c (last_known_column, last_known_column_point):
12341 (current_column_bol_cache):
12342 (skip_invisible, current_column, check_display_width):
12343 (check_display_width, scan_for_column, current_column_1)
12344 (Findent_to, Fcurrent_indentation, position_indentation)
12345 (indented_beyond_p, Fmove_to_column, compute_motion):
12346 (Fcompute_motion, Fvertical_motion):
12347 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12348 (last_known_column_modified): Use EMACS_INT, not int.
12349 (check_display_width):
12350 (Fcompute_motion):
12351 Check that fixnums and floats are in proper range for system types.
12352 (compute_motion): Don't assume index or fixnum fits in int.
12353 (compute_motion, Fcompute_motion):
12354 Use int, not EMACS_INT, when it is wide enough.
12355 (vmotion): Omit local var start_hpos that is always 0; that way
12356 we don't need to worry about overflow in expressions involving it.
12357 * indent.h: Adjust decls to match defn changes elsewhere.
12358 (struct position):
12359 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12360 Use int, not EMACS_INT, where int is wide enough.
12361 Remove unused members ovstring_chars_done and tab_offset;
12362 all uses removed.
12363 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
12364 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
12365 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
12366 (make_gap, copy_text, insert, insert_and_inherit)
12367 (insert_before_markers, insert_before_markers_and_inherit)
12368 (insert_1, count_combining_before, count_combining_after)
12369 (insert_1_both, insert_from_string)
12370 (insert_from_string_before_markers, insert_from_string_1)
12371 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
12372 (adjust_after_replace, adjust_after_insert, replace_range)
12373 (replace_range_2, del_range, del_range_1, del_range_byte)
12374 (del_range_both, del_range_2, modify_region)
12375 (prepare_to_modify_buffer, signal_before_change)
12376 (signal_after_change, Fcombine_after_change_execute):
12377 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12378 * intervals.c (traverse_intervals, rotate_right, rotate_left)
12379 (balance_an_interval, split_interval_right, split_interval_left)
12380 (find_interval, next_interval, update_interval)
12381 (adjust_intervals_for_insertion, delete_node, delete_interval)
12382 (interval_deletion_adjustment, adjust_intervals_for_deletion)
12383 (static_offset_intervals, offset_intervals)
12384 (merge_interval_right, merge_interval_left, make_new_interval)
12385 (graft_intervals_into_buffer, temp_set_point_both)
12386 (temp_set_point, set_point, adjust_for_invis_intang)
12387 (set_point_both, move_if_not_intangible, get_property_and_range)
12388 (get_local_map, copy_intervals, copy_intervals_to_string)
12389 (compare_string_intervals, set_intervals_multibyte_1):
12390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12391 * intervals.h: Adjust decls to match defn changes elsewhere.
12392 (struct interval):
12393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12394 * keyboard.c (this_command_key_count, this_single_command_key_start)
12395 (before_command_key_count, before_command_echo_length, echo_now)
12396 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
12397 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
12398 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
12399 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
12400 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12401 (last_non_minibuf_size, last_point_position, echo_truncate)
12402 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
12403 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
12404 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
12405 (stuff_buffered_input):
12406 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12407 (last_auto_save, command_loop_1, read_char):
12408 Use EMACS_INT, not int, to avoid integer overflow.
12409 (record_char): Avoid overflow in total_keys computation.
12410 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
12411 * keyboard.h: Adjust decls to match defn changes elsewhere.
12412 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
12413 (Fkey_description, Fdescribe_vector, Flookup_key):
12414 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12415 (click_position): New function, to check that positions are in range.
12416 (Fcurrent_active_maps):
12417 (describe_command):
12418 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12419 (Faccessible_keymaps, Fkey_description):
12420 (preferred_sequence_p):
12421 Don't assume fixnum can fit into int.
12422 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
12423 Check for integer overflow in size calculations.
12424 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
12425 avoid mishandling large integers.
12426 * lisp.h: Adjust decls to match defn changes elsewhere.
12427 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
12428 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
12429 (struct Lisp_Marker):
12430 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12431 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
12432 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
12433 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
12434 All callers changed.
12435 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
12436 Assume the arg has valid form, since it always does.
12437 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
12438 unsigned integer system type.
12439 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
12440 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
12441 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12442 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
12443 (duration_to_sec_usec): New decl.
12444 * lread.c (read_from_string_index, read_from_string_index_byte)
12445 (read_from_string_limit, readchar, unreadchar, openp)
12446 (read_internal_start, read1, oblookup):
12447 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12448 (Fload, readevalloop, Feval_buffer, Feval_region):
12449 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12450 (openp): Check for out-of-range argument to 'access'.
12451 (read1): Use int, not EMACS_INT, where int is wide enough.
12452 Don't assume fixnum fits into int.
6efdadfd 12453 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
12454 (read_filtered_event): Use duration_to_sec_usec
12455 to do proper overflow checking on durations.
d311d28c
PE
12456 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
12457 in size calculation.
12458 (Fexecute_kbd_macro):
12459 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12460 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
12461 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
12462 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
12463 (set_marker_both, set_marker_restricted_both, marker_position)
12464 (marker_byte_position, Fbuffer_has_markers_at):
12465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12466 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 12467 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
12468 It now merely ensures that the menu is large enough, without
12469 necessarily growing it, as this avoids some integer overflow issues.
12470 All callers changed.
12471 (keymap_panes, parse_single_submenu, Fx_popup_menu):
12472 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12473 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
12474 Use SAFE_ALLOCA_LISP, not alloca.
12475 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
12476 to EMACS_INT. Check that fixnums are in proper range for system types.
12477 * minibuf.c (minibuf_prompt_width, string_to_object)
12478 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
12479 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
12480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12481 (get_minibuffer, read_minibuf_unwind):
12482 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12483 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
12484 this simplifies overflow checking. All callers changed.
12485 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
12486 (Ftest_completion):
12487 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12488 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
12489 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
12490 Check that fixnums are in proper range for system types.
12491 (Fx_create_frame, Fx_show_tip):
12492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12493 * nsfont.m (ns_findfonts, nsfont_list_family):
12494 Don't assume fixnum fits in long.
12495 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
12496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12497 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
12498 wide enough.
17fdb222 12499 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
12500 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12501 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
12502 (PRINTDECLARE, PRINTPREPARE):
12503 (strout, print_string):
12504 (print, print_preprocess, print_check_string_charset_prop)
12505 (print_object):
12506 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12507 (PRINTDECLARE):
12508 (temp_output_buffer_setup, Fprin1_to_string, print_object):
12509 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12510 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 12511 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 12512 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
12513 (print_error_message): Use SAFE_ALLOCA, not alloca.
12514 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
12515 (print_depth, new_backquote_output, print_number_index):
12516 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
12517 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
12518 (Fset_process_window_size, Fformat_network_address)
12519 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 12520 (sigchld_handler):
d311d28c 12521 Check that fixnums are in proper range for system types.
d44287d4 12522 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
12523 Check for process-ids out of pid_t range rather than relying on
12524 undefined behavior.
e4d81efc 12525 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
12526 (Fformat_network_address, read_process_output, send_process)
12527 (Fprocess_send_region, status_notify):
12528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12529 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
12530 (wait_reading_process_output, read_process_output, exec_sentinel):
12531 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12532 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
12533 (Faccept_process_output): Use duration_to_sec_usec to do proper
12534 overflow checking on durations.
dde14581
PE
12535 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
12536 Don't assume pid_t fits in int.
02481186
PE
12537 * process.h (struct Lisp_Process): Members tick and update_tick
12538 are now of type EMACS_INT, not int.
b62b53e8
PE
12539 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
12540 configured --with-wide-int.
d311d28c
PE
12541 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
12542 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
12543 * search.c (looking_at_1, string_match_1):
12544 (fast_string_match, fast_c_string_match_ignore_case)
12545 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
12546 (scan_newline, find_before_next_newline, search_command)
12547 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
12548 (set_search_regs, wordify):
12549 (Freplace_match):
12550 (Fmatch_data):
12551 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12552 (string_match_1, search_buffer, set_search_regs):
12553 (Fmatch_data):
12554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12555 (wordify): Check for overflow in size calculation.
12556 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
12557 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
12558 Check that fixnums are in proper range for system types.
12559 * sound.c (struct sound_device)
12560 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
12561 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12562 (Fplay_sound_internal):
12563 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 12564 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
12565 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
12566 (Fparse_partial_sexp):
12567 Don't assume fixnums can fit in int.
12568 (struct lisp_parse_state, find_start_pos, find_start_value)
12569 (find_start_value_byte, find_start_begv)
12570 (update_syntax_table, char_quoted, dec_bytepos)
12571 (find_defun_start, prev_char_comend_first, back_comment):
12572 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
12573 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
12574 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12575 (Finternal_describe_syntax_value): Check that match_lisp is a
12576 character, not an integer, since the code stuffs it into int.
12577 (scan_words, scan_sexps_forward):
12578 Check that fixnums are in proper range for system types.
12579 (Fforward_word):
12580 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12581 (scan_sexps_forward):
12582 Use CHARACTERP, not INTEGERP, since the value must fit into int.
12583 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
12584 * syntax.h: Adjust decls to match defn changes elsewhere.
12585 (struct gl_state_s):
12586 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
12587 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
12588 MOST_POSITIVE_FIXNUM.
d311d28c
PE
12589 * sysdep.c (wait_for_termination_1, wait_for_termination)
12590 (interruptible_wait_for_termination, mkdir):
12591 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
12592 (emacs_read, emacs_write):
12593 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
12594 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
12595 and double all fit in int.
d311d28c
PE
12596 * term.c (set_tty_color_mode):
12597 Check that fixnums are in proper range for system types.
12598 * termhooks.h (struct input_event):
12599 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12600 * textprop.c (validate_interval_range, interval_of)
12601 (Fadd_text_properties, set_text_properties_1)
12602 (Fremove_text_properties, Fremove_list_of_text_properties)
12603 (Ftext_property_any, Ftext_property_not_all)
12604 (copy_text_properties, text_property_list, extend_property_ranges)
12605 (verify_interval_modification):
12606 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12607 (Fnext_single_char_property_change)
12608 (Fprevious_single_char_property_change):
12609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
12610 (copy_text_properties):
12611 Check for integer overflow in index calculation.
d311d28c
PE
12612 * undo.c (last_boundary_position, record_point, record_insert)
12613 (record_delete, record_marker_adjustment, record_change)
12614 (record_property_change):
12615 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12616 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
12617 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12618 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12619 (Fx_hide_tip, Fx_file_dialog):
12620 * w32menu.c (set_frame_menubar):
12621 Use ptrdiff_t, not int, for consistency with rest of code.
12622 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
12623 (select_window, Fdelete_other_windows_internal)
12624 (window_scroll_pixel_based, window_scroll_line_based)
12625 (Frecenter, Fset_window_configuration):
12626 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12627 (Fset_window_hscroll, run_window_configuration_change_hook)
12628 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 12629 (Fscroll_other_window, Frecenter):
d311d28c
PE
12630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12631 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
12632 Don't assume fixnum fits in int.
12633 (Fset_window_scroll_bars):
12634 Check that fixnums are in proper range for system types.
12635 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
12636 (string_pos, c_string_pos, number_of_chars, init_iterator)
12637 (in_ellipses_for_invisible_text_p, init_from_display_pos)
12638 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
12639 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
12640 (face_before_or_after_it_pos, handle_invisible_prop)
12641 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
12642 (display_prop_intangible_p, string_buffer_position_lim)
12643 (string_buffer_position, handle_composition_prop, load_overlay_strings)
12644 (get_overlay_strings_1, get_overlay_strings)
12645 (iterate_out_of_display_property, forward_to_next_line_start)
12646 (back_to_previous_visible_line_start, reseat, reseat_to_string)
12647 (get_next_display_element, set_iterator_to_next)
12648 (get_visually_first_element, compute_stop_pos_backwards)
12649 (handle_stop_backwards, next_element_from_buffer)
12650 (move_it_in_display_line_to, move_it_in_display_line)
12651 (move_it_to, move_it_vertically_backward, move_it_by_lines)
12652 (add_to_log, message_dolog, message_log_check_duplicate)
12653 (message2, message2_nolog, message3, message3_nolog
12654 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
12655 (current_message_1, truncate_echo_area, truncate_message_1)
12656 (set_message, set_message_1, store_mode_line_noprop)
12657 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
12658 (text_outside_line_unchanged_p, check_point_in_composition)
12659 (reconsider_clip_changes)
12660 (redisplay_internal, set_cursor_from_row, try_scrolling)
12661 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
12662 (redisplay_window, find_last_unchanged_at_beg_row)
12663 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
12664 (trailing_whitespace_p, find_row_edges, display_line)
12665 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
12666 (display_mode_element, store_mode_line_string)
12667 (pint2str, pint2hrstr, decode_mode_spec)
12668 (display_count_lines, display_string, draw_glyphs)
12669 (x_produce_glyphs, x_insert_glyphs)
12670 (rows_from_pos_range, mouse_face_from_buffer_pos)
12671 (fast_find_string_pos, mouse_face_from_string_pos)
12672 (note_mode_line_or_margin_highlight, note_mouse_highlight):
12673 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12674 (safe_call, init_from_display_pos, handle_fontified_prop)
12675 (handle_single_display_spec, load_overlay_strings)
12676 (with_echo_area_buffer, setup_echo_area_for_printing)
12677 (display_echo_area, echo_area_display)
12678 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
12679 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
12680 (redisplay_window, dump_glyph_row, display_mode_line)
12681 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 12682 (handle_display_spec, display_prop_string_p):
d311d28c
PE
12683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12684 (handle_single_display_spec, build_desired_tool_bar_string)
12685 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
12686 (get_specified_cursor_type):
12687 Check that fixnums are in proper range for system types.
12688 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
12689 (Flookup_image_map):
12690 Don't assume fixnums fit in int.
12691 (compare_overlay_entries):
12692 Avoid mishandling comparisons due to subtraction overflow.
12693 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
12694 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
12695 (handle_tool_bar_click):
12696 Use int, not unsigned, since we prefer signed and the signedness
12697 doesn't matter here.
12698 (get_next_display_element, next_element_from_display_vector):
12699 Use int, not EMACS_INT, when int is wide enough.
12700 (start_hourglass): Use duration_to_sec_usec to do proper
12701 overflow checking on durations.
12702 * xfaces.c (Fbitmap_spec_p):
12703 Check that fixnums are in proper range for system types.
12704 (compare_fonts_by_sort_order):
12705 Avoid mishandling comparisons due to subtraction overflow.
12706 (Fx_family_fonts, realize_basic_faces):
12707 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12708 (Fx_family_fonts):
12709 Don't assume fixnum fits in int.
12710 Use SAFE_ALLOCA_LISP, not alloca.
12711 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
12712 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
12713 (face_at_buffer_position, face_for_overlay_string)
12714 (face_at_string_position):
12715 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12716 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
12717 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
12718 (Fx_show_tip):
12719 Check that fixnums are in proper range for system types.
12720 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
12721 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
12722 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12723 (Fx_change_window_property): Don't assume fixnums fit in int.
12724 * xfont.c (xfont_chars_supported):
12725 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12726 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
12727 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
12728 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12729 * xml.c (parse_region):
12730 * xrdb.c (magic_file_p):
12731 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
12732 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
12733 (x_get_local_selection, x_reply_selection_request)
12734 (x_handle_selection_request, wait_for_property_change):
12735 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12736 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
12737 short is wide enough.
12738 (x_send_client_event): Don't assume fixnum fits in int.
12739 * xterm.c (x_x_to_emacs_modifiers):
12740 Don't assume EMACS_INT overflows nicely into int.
12741 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
12742 may come from Lisp.
12743 (handle_one_xevent): NATNUMP can eval its arg twice.
12744 (x_connection_closed):
12745 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
12746 * xterm.h: Adjust decls to match defn changes elsewhere.
12747 (struct scroll_bar): Use struct vectorlike_header
12748 rather than rolling our own approximation.
12749 (SCROLL_BAR_VEC_SIZE): Remove; not used.
12750
c6574eb5
GM
127512012-05-25 Glenn Morris <rgm@gnu.org>
12752
12753 * lisp.mk (lisp): Update for more files being compiled now.
12754
e8d32c7e
SM
127552012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
12756
48def666
SM
12757 * lread.c: Remove `read_pure' which makes no difference.
12758 (read_pure): Remove var.
12759 (unreadpure): Remove function.
12760 (readevalloop): Don't call read_list with -1 flag.
12761 (read1, read_vector): Don't test read_pure any more.
12762 (read_list): Simplify.
12763
e8d32c7e
SM
12764 * fileio.c, character.h: Minor style tweaks.
12765
4b2addb7
DA
127662012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
12767
12768 * window.h (clip_changed): Remove useless declaration.
12769
584461b2
JB
127702012-05-22 Juanma Barranquero <lekktu@gmail.com>
12771
12772 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
12773 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
12774
34374650
PE
127752012-05-22 Paul Eggert <eggert@cs.ucla.edu>
12776
12777 Remove src/m/*.
12778 This directory predates autoconf and is no longer needed nowadays.
12779 Move its few remaining bits of functionality to where they're needed.
12780 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
12781 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
12782 * m/template.h: Remove.
12783 * Makefile.in (M_FILE): Remove. All uses removed.
12784 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
12785 * lisp.h (USE_LSB_TAG):
12786 * mem-limits.h (EXCEEDS_LISP_PTR):
12787 Use VAL_MAX, not VALBITS, in #if.
12788 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
12789 (EMACS_UINT): Define unconditionally now.
12790 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
12791 (BITS_PER_EMACS_INT): New constants, replacing
12792 what used to be in config.h, but not useful in #if.
12793 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
12794 define them any more.
12795 (VAL_MAX): New macro.
12796 (VALMASK): Use it.
12797 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
12798 BITS_PER_EMACS_INT, in #if.
12799 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
12800 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
12801 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
12802 * s/ms-w32.h (DATA_START):
12803 Move here from removed file m/intel386.h.
12804 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
12805 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
12806
261cb4bb
PE
128072012-05-21 Paul Eggert <eggert@cs.ucla.edu>
12808
12809 Assume C89 or later.
12810 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
12811 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
12812 (xrealloc):
12813 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
12814 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
12815 * textprop.c, tparam.c (NULL): Remove.
12816 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
12817 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
12818 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
12819 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
12820 * xterm.c (input_signal_count): Assume volatile works.
12821
ff23cd9f
KB
128222012-05-21 Ken Brown <kbrown@cornell.edu>
12823
12824 * xgselect.c (xg_select): Fix first argument in call to 'select'
12825 (bug#11508).
12826
1b170bc6
KB
128272012-05-20 Ken Brown <kbrown@cornell.edu>
12828
12829 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 12830 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 12831
b2f4d39f
KB
128322012-05-19 Ken Brown <kbrown@cornell.edu>
12833
12834 * xfns.c (x_in_use): Remove `static' qualifier.
12835 * xterm.h (x_in_use): Declare.
12836 * xgselect.c: Include xterm.h.
12837 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
12838 and `display_arg' (bug#9754).
12839
003fdae2
PE
128402012-05-19 Paul Eggert <eggert@cs.ucla.edu>
12841
9232a6d9
PE
12842 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
12843
003fdae2
PE
12844 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
12845 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
12846
784b56e2
EZ
128472012-05-18 Eli Zaretskii <eliz@gnu.org>
12848
12849 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
12850
12851 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 12852 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
12853
12854 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
12855 reference to image_cache->refcount.
12856 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
12857
a0a79cde
JL
128582012-05-17 Juri Linkov <juri@jurta.org>
12859
12860 * search.c (Fword_search_regexp, Fword_search_backward)
12861 (Fword_search_forward, Fword_search_backward_lax)
12862 (Fword_search_forward_lax): Move functions to isearch.el
12863 (bug#10145, bug#11381).
12864
b0572523
PE
128652012-05-16 Paul Eggert <eggert@cs.ucla.edu>
12866
12867 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
12868
9660f5fc
SM
128692012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
12870
12871 * lread.c (init_obarray): Declare Qt and Qnil as special.
12872
4374de83
GM
128732012-05-14 Glenn Morris <rgm@gnu.org>
12874
12875 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 12876 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 12877
dc44c39a
PE
128782012-05-14 Paul Eggert <eggert@cs.ucla.edu>
12879
078c97cb
PE
12880 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
12881
dc44c39a
PE
12882 * unexaix.c: Port to more-recent AIX compilers.
12883 (report_error, report_error_1, make_hdr, copy_sym)
12884 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
12885 Make arguments const char *, not char *, to avoid violations of C
12886 standard and to fix some AIX warnings reported by Gilles Pion.
12887
e18afed7 128882012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
12889
12890 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
12891 already have overlays loaded.
12892 (handle_single_display_spec): Before returning without displaying
12893 fringe bitmap, synchronize the bidi iterator with the main display
12894 iterator, by calling iterate_out_of_display_property.
12895 (iterate_out_of_display_property): Detect buffer iteration by
12896 testing that it->string is a Lisp string.
12897 (get_next_display_element): When the current object is exhausted,
12898 and there's something on it->stack, call set_iterator_to_next to
12899 proceed with what's on the stack, instead of returning zero.
12900 (set_iterator_to_next): If called at the end of a Lisp string,
12901 proceed to consider_string_end without incrementing string
12902 position. Don't increment display vector index past the end of
12903 the display vector. (Bug#11417)
c8fb9dc6
EZ
12904 (pos_visible_p): Don't report a position visible when move_it_to
12905 stopped at the last line of window, which happens to be scanned
12906 backwards by the bidi iteration. (Bug#11464)
ac268e67 12907
e18afed7 129082012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
12909
12910 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
12911 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
12912 are on a TTY, and thus unable to display on the fringes.
12913 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
12914 so we need to signal to the caller that this is a "replacing"
12915 display spec. This fixes display when the spec is invalid or we
12916 are on a TTY.
12917
e18afed7 129182012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
12919
12920 * unexaix.c (make_hdr): Fix typo in prototype.
12921 This bug broke the build on AIX. Problem reported by Gilles Pion.
12922
9d0a235a
MA
129232012-05-14 Michael Albinus <michael.albinus@gmx.de>
12924
12925 * keyboard.c (kbd_buffer_get_event): Read special events also in
12926 batch mode. (Bug#11415)
12927
9e6b06ed
GM
129282012-05-12 Glenn Morris <rgm@gnu.org>
12929
12930 * ns.mk: Update for ns_appbindir no longer having trailing "/".
12931
c1a1d7a3
EZ
129322012-05-12 Eli Zaretskii <eliz@gnu.org>
12933
12934 * lisp.mk (lisp): Add newcomment.elc.
12935
3fe7cdc8
GM
129362012-05-12 Glenn Morris <rgm@gnu.org>
12937
12938 * Makefile.in (MKDIR_P): New, set by configure.
12939 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
12940
53f7d2c0
PE
129412012-05-11 Paul Eggert <eggert@cs.ucla.edu>
12942
12943 Remove unused function hourglass_started.
12944 * dispextern.h (hourglass_started):
12945 * w32fns.c (hourglass_started):
12946 * xdisp.c (hourglass_started): Remove.
12947
75aafb17
JB
129482012-05-10 Juanma Barranquero <lekktu@gmail.com>
12949
12950 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
12951 Update dependencies.
12952
12959e8e
PE
129532012-05-10 Paul Eggert <eggert@cs.ucla.edu>
12954
97107e2e
PE
12955 * xgselect.c (xg_select): Put maxfds+1 into a var.
12956 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
12957
12959e8e
PE
12958 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
12959
836d29b3
DA
129602012-05-10 Dave Abrahams <dave@boostpro.com>
12961
12962 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
12963 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
12964
5cb67954
MA
129652012-05-09 Michael Albinus <michael.albinus@gmx.de>
12966
12967 * dbusbind.c (xd_registered_buses): New internal Lisp object.
cccaebd2 12968 Rename all occurrences of Vdbus_registered_buses to xd_registered_buses.
5cb67954
MA
12969 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
12970 Initialize xd_registered_buses.
12971
3478ec45
PE
129722012-05-09 Paul Eggert <eggert@cs.ucla.edu>
12973
b263a6b0
PE
12974 Untag more efficiently if USE_LSB_TAG.
12975 This is based on a proposal by YAMAMOTO Mitsuharu in
12976 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
12977 For an admittedly artificial (nth 8000 longlist) benchmark on
12978 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
12979 Emacs's overall text size by 1%.
12980 * lisp.h (XUNTAG): New macro.
12981 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
12982 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
12983 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
12984 * eval.c (Fautoload):
12985 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
12986 * frame.h (XFRAME): Use XUNTAG.
12987
3478ec45
PE
12988 Port recent dbusbind.c changes to 32-bit --with-wide-int.
12989 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
12990 Remove unportable assumptions about print widths of types like
12991 dbus_uint32_t.
12992 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
12993 intptr_t when converting between pointer and integer, to avoid GCC
12994 warnings about wrong width.
12995
666b903b 129962012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
12997
12998 * w32proc.c (new_child): Force Windows to reserve only 64KB of
12999 stack for each reader_thread, instead of defaulting to 8MB
13000 determined by the linker. This avoids failures in creating
13001 subprocesses on Windows 7, see the discussion in this thread:
13002 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
13003
b120cc17
JC
130042012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
13005
13006 Fix up display of the *Minibuf-0* buffer in the mini window.
13007 * keyboard.c (read_char): Don't clear the echo area if there's no
13008 message to clear.
13009 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 13010 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 13011
9a4b36f8
MA
130122012-05-07 Michael Albinus <michael.albinus@gmx.de>
13013
13014 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
13015 batch mode.
13016
e5f9458f
CY
130172012-05-06 Chong Yidong <cyd@gnu.org>
13018
13019 * lisp.mk (lisp): Update.
13020
eceeb5fc 130212012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
13022
13023 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
13024
71873e2b
SM
130252012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
13026
13027 * data.c (PUT_ERROR): New macro.
13028 (syms_of_data): Use it. Add new error type `user-error'.
13029 * undo.c (user_error): New function.
13030 (Fprimitive_undo): Use it.
13031 * print.c (print_error_message): Adjust print style for `user-error'.
13032 * keyboard.c (user_error): New function.
13033 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
13034
ab0fa4e4
PE
130352012-05-03 Paul Eggert <eggert@cs.ucla.edu>
13036
13037 Do not limit current-time-string to years 1000..9999.
13038 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
13039 (Fcurrent_time_string): Support any year that is supported by the
13040 underlying localtime representation. Don't use asctime, as it
13041 has undefined behavior for years outside the range -999..9999.
13042
7ed806a7
PE
130432012-05-02 Paul Eggert <eggert@cs.ucla.edu>
13044
13045 Fix race conditions involving setenv, gmtime, localtime, asctime.
13046 Without this fix, interrupts could mess up code that uses these
13047 nonreentrant functions, since setting TZ invalidates existing
13048 tm_zone or tzname values, and since most of these functions return
13049 pointers to static storage.
13050 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
13051 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
13052 Grow the critical sections to include not just invoking
13053 localtime/gmtime, but also accessing these functions' results
13054 including their tm_zone values if any, and any related TZ setting.
13055 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
13056 so that the struct tm is saved in the critical section.
13057 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
13058 motivated by the fact that memory allocation needs to be outside
13059 the critical section.
13060
0c16dfed
DA
130612012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
13062
13063 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
13064 with RESET_INTERVAL.
13065
13066 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
13067 Remove duplicated buffer name initialization.
13068
3f83ace8
JM
130692012-05-02 Jim Meyering <jim@meyering.net>
13070
13071 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
13072
c7b8541e
JM
13073 * xfns.c (x_window): Use xstrdup (Bug#11375).
13074
90207a15 130752012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
13076
13077 * xdisp.c (pos_visible_p): If already at a newline from the
13078 display string before the 'while' loop, don't walk back the glyphs
13079 from it3.glyph_row. Solves assertion violation when the display
13080 string begins with a newline (egg.el). (Bug#11367)
13081
b593d6a9
AH
130822012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
13083
13084 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
13085 Move to simple.el.
13086
4737362e
GM
130872012-05-01 Glenn Morris <rgm@gnu.org>
13088
99cf43f9
GM
13089 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
13090 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
13091 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
13092 All were removed before 23.1.
13093
9311dcff
GM
13094 * dispnew.c: Remove HAVE_LIBNCURSES test;
13095 it is always true on relevant platforms.
13096
4d5c6349
GM
13097 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
13098 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
13099
4737362e
GM
13100 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
13101
74dd3a6b
AS
131022012-04-30 Andreas Schwab <schwab@linux-m68k.org>
13103
13104 * .gdbinit (xpr): Remove checks for no longer existing misc types.
13105 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
13106 Remove.
13107
13c379ee
PE
131082012-04-28 Paul Eggert <eggert@cs.ucla.edu>
13109
13110 Do not avoid creating empty evaporating overlays (Bug#9642).
13111 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
13112 That is, do not delete an evaporating overlay if it becomes
13113 empty after its bounds are adjusted to fit within its buffer.
13114 This fix caused other problems, and I'm reverting it until we get
13115 to the bottom of them.
13116
a8e7d6d7 131172012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
13118
13119 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
13120
a8e7d6d7 131212012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
13122
13123 * xdisp.c (pos_visible_p): If the window start position is beyond
13124 ZV, start the display from buffer beginning. Prevents assertion
13125 violation in init_iterator when the minibuffer window is scrolled
13126 via the scroll bar.
13127
13128 * window.c (window_scroll_pixel_based): Likewise.
13129
a8e7d6d7 131302012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
13131
13132 * keymap.c (where_is_internal): Doc fix (Bug#10872).
13133
a8e7d6d7 131342012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
13135
13136 * fileio.c (Fcopy_file, Fset_file_selinux_context):
13137 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
13138
a8e7d6d7 131392012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 13140
b593d6a9
AH
13141 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
13142 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 13143
1c6900d9
EZ
131442012-04-26 Eli Zaretskii <eliz@gnu.org>
13145
4c3fa1d9
EZ
13146 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
13147 display element, check also the underlying string or buffer
13148 character. (Bug#11341)
13149
1c6900d9
EZ
13150 * w32menu.c: Include w32heap.h.
13151 (add_menu_item): If the call to AppendMenuW (via
13152 unicode_append_menu) fails, disable Unicode menus only if we are
13153 running on Windows 9X/Me.
13154
42bf8205
AS
131552012-04-24 Andreas Schwab <schwab@linux-m68k.org>
13156
13157 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
13158 (xgetint): Add missing shift for LSB tags.
13159
b1bac16e
MR
131602012-04-24 Martin Rudalics <rudalics@gmx.at>
13161
13162 * keyboard.c (read_char): Don't wipe echo area for select window
13163 events: These might get delayed via `mouse-autoselect-window'
13164 (Bug#11304).
13165
d69621cc
JB
131662012-04-24 Juanma Barranquero <lekktu@gmail.com>
13167
13168 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
13169 manipulation of :loaded-from data.
13170
02fd101b
JB
131712012-04-23 Juanma Barranquero <lekktu@gmail.com>
13172
13173 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
13174 now a cons (bug#11311).
13175
888bec30
PE
131762012-04-23 Paul Eggert <eggert@cs.ucla.edu>
13177
89a438bd
PE
13178 Do not create empty overlays with the evaporate property (Bug#9642).
13179 * buffer.c (Fmove_overlay): Delete an evaporating overlay
13180 if it becomes empty after its bounds are adjusted to fit within
13181 its buffer. Without this fix, in a nonempty buffer (let ((o
13182 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
13183 yields an empty overlay that has the evaporate property, which is
13184 not supposed to happen.
13185
1068fe4d
PE
13186 Fix minor GTK3 problems found by static checking.
13187 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13188 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13189 (struct _EmacsFixedClass, emacs_fixed_get_type):
13190 Move decls here from emacsgtkfixed.h, since they needn't be public.
13191 (emacs_fixed_get_type): Now static.
13192 (emacs_fixed_class_init): Omit unused local.
13193 (emacs_fixed_child_type): Remove; unused.
13194 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
13195 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
13196 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
13197 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
13198 (EMACS_FIXED_GET_CLASS): Remove; unused.
13199 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
13200
888bec30
PE
13201 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
13202 Problem reported by Juanma Barranquero for Windows -Wunused-function.
13203
de85e130
PE
132042012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13205
d0baac98 13206 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 13207 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
13208 (__malloc_size_t, __malloc_ptrdiff_t):
13209 Remove. All uses removed, replaced by the definiens if needed,
13210 since we can assume C89 or better now.
13211 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
13212 (protect_malloc_state, align, get_contiguous_space)
13213 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
13214 (malloc_atfork_handler_child, malloc_enable_thread)
13215 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
13216 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
13217 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
13218 (special_realloc, _realloc_internal_nolock, _realloc_internal)
13219 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
13220 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
13221 Define using prototypes, not old style.
13222 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
13223 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
13224 (align): Don't assume that signed integer overflow wraps around.
13225 Omit unused local var.
13226 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
13227 (_free_internal_nolock, memalign, mallochook, reallochook):
13228 Omit no-longer-needed casts.
13229 (valloc): Use getpagesize, not __getpagesize.
13230 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
13231 (struct hdr): The 'magic' member is now size_t, not unsigned long.
13232
de85e130
PE
13233 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
13234
dcbf5805
MA
132352012-04-22 Michael Albinus <michael.albinus@gmx.de>
13236
13237 Move functions from C to Lisp. Make non-blocking method calls
13238 the default. Implement further D-Bus standard interfaces.
13239
13240 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
13241 (QCdbus_request_name_allow_replacement)
13242 (QCdbus_request_name_replace_existing)
13243 (QCdbus_request_name_do_not_queue)
13244 (QCdbus_request_name_reply_primary_owner)
13245 (QCdbus_request_name_reply_in_queue)
13246 (QCdbus_request_name_reply_exists)
13247 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
13248 (QCdbus_registered_serial, QCdbus_registered_method)
13249 (QCdbus_registered_signal): New Lisp objects.
13250 (XD_DEBUG_MESSAGE): Use sizeof.
13251 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
13252 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
13253 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
13254 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
13255 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
13256 (xd_signature, xd_append_arg): Allow float for integer types.
13257 (xd_get_connection_references): New function.
b593d6a9
AH
13258 (xd_get_connection_address): Rename from xd_initialize.
13259 Return cached address.
dcbf5805
MA
13260 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
13261 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
13262 level.
13263 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 13264 Return number of refcounts.
dcbf5805
MA
13265 (Fdbus_get_unique_name): Make stronger parameter check.
13266 (Fdbus_message_internal): New defun.
13267 (Fdbus_call_method, Fdbus_call_method_asynchronously)
13268 (Fdbus_method_return_internal, Fdbus_method_error_internal)
13269 (Fdbus_send_signal, Fdbus_register_service)
13270 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
13271 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
13272 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
13273 (Vdbus_compiled_version, Vdbus_runtime_version)
13274 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
13275 (Vdbus_message_type_method_return, Vdbus_message_type_error)
13276 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
13277 (Vdbus_registered_buses, Vdbus_registered_objects_table):
13278 Adapt docstring.
dcbf5805 13279
52828e02
PE
132802012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13281
da05bc4c
PE
13282 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
13283 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
13284 Do not assume ptrdiff_t is the same width as 'int'.
13285
52828e02
PE
13286 * alloc.c: Handle unusual debugging option combinations.
13287 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
13288 since the two debugging options are incompatible.
13289 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
13290 is defined.
13291 (mem_init, mem_insert, mem_insert_fixup):
13292 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
13293 (NEED_MEM_INSERT): Remove; no longer needed.
13294
f01769f9
LL
132952012-04-22 Leo Liu <sdl.web@gmail.com>
13296
13297 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
13298
5790543d
PE
132992012-04-22 Paul Eggert <eggert@cs.ucla.edu>
13300
13301 * sysdep.c [__FreeBSD__]: Minor cleanups.
13302 (list_system_processes, system_process_attributes) [__FreeBSD__]:
13303 Use Emacs indenting style more consistently. Avoid some casts.
13304 Use 'double' consistently rather than mixing 'float' and 'double'.
13305
b91b7e4d
EW
133062012-04-21 Eduard Wiebe <usenet@pusto.de>
13307
b593d6a9
AH
13308 * sysdep.c (list_system_processes, system_process_attributes):
13309 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 13310
6114eb15
AS
133112012-04-21 Andreas Schwab <schwab@linux-m68k.org>
13312
13313 * lisp.mk (lisp): Update.
13314
2f38dff7
PE
133152012-04-20 Paul Eggert <eggert@cs.ucla.edu>
13316
13317 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
13318 It is never used otherwise.
13319
4ae29f89
SM
133202012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
13321
13322 * print.c (print_preprocess): Only check print_depth if print-circle
13323 is nil.
13324 (print_object): Check for cycles even when print-circle is nil and
13325 print-gensym is t, but only check print_depth if print-circle is nil.
13326
f30d612a
CY
133272012-04-20 Chong Yidong <cyd@gnu.org>
13328
13329 * process.c (wait_reading_process_output): If EIO occurs on a pty,
13330 set the status to "failed" and ensure that sentinel is run.
13331
c07a4c0b 133322012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
13333
13334 * process.c (Fset_process_inherit_coding_system_flag)
13335 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 13336 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 13337
c07a4c0b 133382012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
13339
13340 * xdisp.c (string_buffer_position_lim): Limit starting position to
13341 BEGV.
13342 (set_cursor_from_row): If called for a mode-line or header-line
13343 row, return zero immediately.
13344 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
13345 farther than the first row after the header line, if any.
13346 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
13347 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
13348
c07a4c0b 133492012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13350
4ae29f89
SM
13351 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
13352 (bug#11238).
ad3a2b41 13353
c07a4c0b 133542012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 133552012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
13356
13357 configure: new option --enable-gcc-warnings (Bug#11207)
13358 * Makefile.in (C_WARNINGS_SWITCH): Remove.
13359 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
13360 (ALL_CFLAGS): Use new macros rather than old.
13361 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
13362 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
13363 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
13364 -Wunused-result, -Wunused-variable. This should go away once
13365 the Emacs and Gnulib regex code is merged.
13366 (xmalloc, xrealloc): Now static.
13367
aba027e8
PE
133682012-04-17 Paul Eggert <eggert@cs.ucla.edu>
13369
13370 * dired.c (Fsystem_groups): Remove unused local.
13371
e5a36063
GM
133722012-04-17 Glenn Morris <rgm@gnu.org>
13373
13374 * dired.c (Fsystem_users): Doc fix.
13375
316411f0
DA
133762012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
13377
13378 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
13379 (syms_of_dired): Add them.
13380
9426aba4
PE
133812012-04-16 Paul Eggert <eggert@cs.ucla.edu>
13382
b62a57be
PE
13383 Fix minor alloc.c problems found by static checking.
13384 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
13385 New extern decls, to avoid calling undeclared functions.
13386 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
13387 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
13388 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
13389 (NEED_MEM_INSERT): New macro.
13390 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 13391 Remove one incorrect comment and fix another.
b62a57be 13392
3539f31f
PE
13393 Fix minor ralloc.c problems found by static checking.
13394 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13395 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
13396 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
13397 (r_alloc_sbrk): Now static.
13398
a041960a
PE
13399 Improve ralloc.c interface checking.
13400 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
13401 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
13402 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
13403 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
13404 [REL_ALLOC]: ... to here, to check interface.
13405 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
13406 Remove decls. This fixes an "It stinks!".
13407
9426aba4
PE
13408 * alloc.c (which_symbols): Fix alignment issue / type clash.
13409
d55c12ed
AS
134102012-04-15 Andreas Schwab <schwab@linux-m68k.org>
13411
13412 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
13413 (struct Lisp_Misc_Any): Likewise.
13414 (struct Lisp_Free): Likewise.
13415 * alloc.c (union aligned_Lisp_Symbol): Define.
13416 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
13417 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
13418 (union aligned_Lisp_Misc): Define.
13419 (MARKER_BLOCK_SIZE, struct marker_block): Use union
13420 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 13421 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 13422
b948ce8b
PE
134232012-04-14 Paul Eggert <eggert@cs.ucla.edu>
13424
13425 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
13426 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
13427 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
13428 * s/netbsd.h, s/sol2-6.h:
13429 Remove definition of GC_MARK_STACK, since the default now works.
13430 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
13431 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
13432 no longer the default.
13433 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
13434
35dc09a1 134352012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 13436
35dc09a1
GM
13437 * lread.c (lisp_file_lexically_bound_p):
13438 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 13439
35dc09a1
GM
134402012-04-14 Eli Zaretskii <eliz@gnu.org>
13441
13442 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
13443 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
13444
134452012-04-14 Jan Djärv <jan.h.d@swipnet.se>
13446
13447 * nsterm.m (constrainFrameRect): Always constrain when there is only
13448 one screen (Bug#10962).
13449
bcd86815
KB
134502012-04-13 Ken Brown <kbrown@cornell.edu>
13451
13452 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
13453
c25df26e
RT
134542012-04-13 Reuben Thomas <rrt@sc3d.org>
13455
13456 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
13457
0fc59f1e
DC
134582012-04-11 Daniel Colascione <dancol@dancol.org>
13459
13460 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
13461 against is gone. It's better to use vfork now so that when Cygwin
13462 gains a new, working vfork, we use it automatically (bug#10398).
13463
de8c03dc
SM
134642012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13465
13466 * window.c (save_window_save): Obey window-point-insertion-type.
13467
2f097256
GM
134682012-04-11 Glenn Morris <rgm@gnu.org>
13469
13470 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
13471
453b951e
SM
134722012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
13473
13474 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
13475
75f1671a 134762012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
13477
13478 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
13479 (force_quit_count): New var.
13480 (handle_interrupt): Use it.
13481
2a8ce227
JB
134822012-04-10 Juanma Barranquero <lekktu@gmail.com>
13483
13484 * w32.c (w32_delayed_load): Record the full path of the library
13485 being loaded (bug#10424).
13486
935396c0
GM
134872012-04-09 Glenn Morris <rgm@gnu.org>
13488
05920a43
GM
13489 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
13490 not just in the obarray, before snarfing them. (Bug#11036)
13491
935396c0
GM
13492 * Makefile.in ($(leimdir)/leim-list.el):
13493 Pass EMACS rather than BUILT_EMACS.
13494
a18ecafa
TZ
134952012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
13496
13497 * process.c (make_process):
13498 * process.h: Add integer `gnutls_handshakes_tried' member to
13499 process struct.
13500
6bbef4e5
JC
13501 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
13502 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
13503
13504 * gnutls.c (gnutls_log_function2i): Convenience log function.
13505 (emacs_gnutls_read): Use new log functions,
13506 `gnutls_handshakes_tried' process member, and
13507 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
13508 attempts per process (connection).
13509
b4d3bc10
CY
135102012-04-09 Chong Yidong <cyd@gnu.org>
13511
13512 * eval.c (Fuser_variable_p, user_variable_p_eh)
13513 (lisp_indirect_variable): Functions deleted.
13514 (Fdefvar): Caller changed.
13515
13516 * callint.c (Finteractive, Fcall_interactively):
13517 * minibuf.c (Fread_variable): Callers changed.
13518
70f4d973
EZ
135192012-04-09 Eli Zaretskii <eliz@gnu.org>
13520
13521 * xdisp.c (set_cursor_from_row): If the display string appears in
13522 the buffer at position that is closer to point than the position
13523 after the display string, display the cursor on the first glyph of
13524 the display string. Fixes cursor display when a 'display' text
13525 property immediately follows invisible text. (Bug#11094)
13526
cb3c2e3e
PE
135272012-04-09 Paul Eggert <eggert@cs.ucla.edu>
13528
13529 composite.c: use 'double' consistently
13530 * composite.c (get_composition_id): Use 'double' consistently
13531 instead of converting 'float' to 'double' and vice versa; this is
13532 easier to understand and avoids a GCC warning.
13533
fd06db5d
GM
135342012-04-09 Glenn Morris <rgm@gnu.org>
13535
50fe702a
GM
13536 * Makefile.in: Generate leim-list with bootstrap-emacs, in
13537 preparation for dumping it with emacs. (Bug#4789)
13538 (leimdir): New variable.
13539 ($(leimdir)/leim-list.el): New rule.
13540 (emacs$(EXEEXT)): Depend on leim-list.el.
13541
fd06db5d
GM
13542 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
13543 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
13544 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
13545
55c131ee
AS
135462012-04-08 Andreas Schwab <schwab@linux-m68k.org>
13547
13548 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
13549 proper alignment.
13550
9209588f
JB
135512012-04-07 Juanma Barranquero <lekktu@gmail.com>
13552
13553 * xml.c (init_libxml2_functions) [WINDOWSNT]:
13554 Remove unused local variable.
13555
e3fb2efb
PE
135562012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13557
13558 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
13559 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
13560 (mark_memory): Mark Lisp_Objects only if pointers might hide in
13561 objects, as mark_maybe_pointer will catch them otherwise.
13562 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
13563 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
13564
b5385551
PE
135652012-04-07 Paul Eggert <eggert@cs.ucla.edu>
13566
13567 Fix typo that broke non-Windows builds.
13568 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
13569
9078ead6
EZ
135702012-04-07 Eli Zaretskii <eliz@gnu.org>
13571
13572 Support building on MS-Windows with libxml2.
13573
13574 * makefile.w32-in (OBJ2): Add xml.$(O).
13575 (GLOBAL_SOURCES): Add xml.c.
13576 ($(BLD)/xml.$(O)): New dependency list.
13577
13578 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
13579 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
13580 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
13581 [!WINDOWSNT]: New macros.
13582 (init_libxml2_functions, libxml2_loaded_p): New functions.
13583 (parse_region): Call fn_xmlCheckVersion instead of using the macro
13584 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
13585 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
13586 Calls xmlCleanupParser only if libxml2 was loaded (or statically
13587 linked in).
6bbef4e5
JC
13588 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
13589 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
13590 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
13591
13592 * emacs.c: Don't include libxml/parser.h.
13593 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
13594 xmlCleanupParser directly.
13595
13596 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
13597
3811fdf3
EZ
135982012-04-07 Eli Zaretskii <eliz@gnu.org>
13599
13600 * indent.c (Fvertical_motion): If there is a display string at
13601 point, use it.vpos to compute how many lines to backtrack after
13602 move_it_to point. (Bug#11133)
13603
2f8e16b2
EZ
136042012-04-06 Eli Zaretskii <eliz@gnu.org>
13605
13606 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
13607 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
13608 about subtle differences between FETCH_CHAR* and STRING_CHAR*
13609 macros related to unification of CJK characters. For the details,
13610 see the discussion following the message here:
13611 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
13612
3d439cd1
CY
136132012-04-04 Chong Yidong <cyd@gnu.org>
13614
13615 * keyboard.c (Vdelayed_warnings_list): Doc fix.
13616
8bc53d00
EZ
136172012-04-01 Eli Zaretskii <eliz@gnu.org>
13618
13619 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
13620 instead of alloca. (Bug#11138)
13621
3b0512a3
AS
136222012-04-01 Andreas Schwab <schwab@linux-m68k.org>
13623
13624 * w32menu.c (is_simple_dialog): Properly check lisp types.
13625 (Bug#11141)
13626
8427ddd2
EZ
136272012-03-31 Eli Zaretskii <eliz@gnu.org>
13628
979022ef
EZ
13629 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
13630 position we get to after a call to move_it_to fails the
13631 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
13632 only if we wind up in a string from display property. (Bug#11063)
13633
a6b1c7cc
EZ
13634 * window.c (Fdelete_other_windows_internal): Invalidate the row
13635 and column information about mouse highlight, so that redisplay
13636 restores it after reallocating the glyph matrices. (Bug#7464)
13637
8427ddd2
EZ
13638 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
13639 string comes from a `display' text property, use the buffer
13640 position of that property as if we actually saw that position in
13641 the row's glyphs.
697ba24b
EZ
13642 (move_it_by_lines): Remove the assertion that
13643 "it->current_x == 0 && it->hpos == 0" which can be legitimately
13644 violated when there's a before-string at the beginning of a line.
13645 (Bug#11063)
8427ddd2 13646
65a0a738
EZ
136472012-03-30 Eli Zaretskii <eliz@gnu.org>
13648
13649 * xdisp.c (append_space_for_newline): If the default face was
13650 remapped, use the remapped face for the appended newline.
13651 (extend_face_to_end_of_line): Use the remapped default face for
13652 extending the face to the end of the line.
13653 (display_line): Call extend_face_to_end_of_line when the default
13654 face was remapped. (Bug#11068)
13655
581355cc
EZ
136562012-03-29 Eli Zaretskii <eliz@gnu.org>
13657
13658 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
13659
e8fc049f
SM
136602012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
13661
13662 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
13663
4fb9a543
GM
136642012-03-27 Glenn Morris <rgm@gnu.org>
13665
13666 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
13667 Doc fixes.
13668
679910f1
KH
136692012-03-26 Kenichi Handa <handa@m17n.org>
13670
13671 * dispextern.h (struct glyph): Fix previous change. Change the
13672 bit length of glyphless.ch to 25 (Bug#11082).
13673
90d49b7f
CY
136742012-03-26 Chong Yidong <cyd@gnu.org>
13675
13676 * keyboard.c (Vselection_inhibit_update_commands): New variable.
13677 (command_loop_1): Use it; inhibit selection update for
13678 handle-select-window too (Bug#8996).
13679
f514f6f0
FP
136802012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
13681
e8fc049f 13682 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 13683
bf43fa51
KH
136842012-03-25 Kenichi Handa <handa@m17n.org>
13685
13686 * dispextern.h (struct glyph): Change the bit length of
13687 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
13688
8a0c01dd
EZ
136892012-03-24 Eli Zaretskii <eliz@gnu.org>
13690
13691 * s/ms-w32.h (tzname): Include time.h before redirecting to
13692 _tzname. Fixes the MSVC build. (Bug#9960)
13693
7d1c3a76
AS
136942012-03-24 Andreas Schwab <schwab@linux-m68k.org>
13695
8ed79523
AS
13696 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
13697 characters.
13698
7d1c3a76
AS
13699 * xterm.c (XTread_socket): Only modify handling_signal if
13700 !SYNC_INPUT. (Bug#11080)
13701
e99a9b8b
EZ
137022012-03-23 Eli Zaretskii <eliz@gnu.org>
13703
13704 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
13705 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
13706 when fetching a multibyte character consumes more bytes than
13707 CHAR_BYTES returns, due to unification of CJK characters in
13708 string_char. (Bug#11073)
13709
5063c0e1
TN
137102012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
13711
13712 * process.c (wait_reading_process_output): Handle pty disconnect
13713 by refraining from sending oneself a SIGCHLD (bug#10933).
13714
9f851fbd
CY
137152012-03-22 Chong Yidong <cyd@gnu.org>
13716
13717 * dispextern.h (struct it): New member string_from_prefix_prop_p.
13718
5063c0e1 13719 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
13720 Mark string as coming from a prefix property.
13721 (handle_face_prop): Use default face for prefix strings (Bug#4281).
13722 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
13723
fb5b8aca
CY
137242012-03-21 Chong Yidong <cyd@gnu.org>
13725
13726 * xfaces.c (Vface_remapping_alist): Doc fix.
13727
62356a1b
EZ
137282012-03-20 Eli Zaretskii <eliz@gnu.org>
13729
13730 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
13731 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
13732 Doc fixes.
62356a1b 13733
025de85b
CY
137342012-03-20 Chong Yidong <cyd@gnu.org>
13735
13736 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
13737 to reflect default non-nil value of redisplay-dont-pause.
13738
4827f94e
KH
137392012-03-19 Kenichi Handa <handa@m17n.org>
13740
13741 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
13742 it fit in a valid range (Bug#11003).
13743
e50a24a2
EZ
137442012-03-18 Eli Zaretskii <eliz@gnu.org>
13745
13746 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
13747 that is not from display property, accept the row as a "cursor
13748 row" if one of the string's character has a non-nil `cursor'
13749 property. Fixes cursor positioning when there are newlines in
13750 overlay strings, e.g. in icomplete.el. (Bug#11035)
13751
9af5ed87
PE
137522012-03-12 Paul Eggert <eggert@cs.ucla.edu>
13753
13754 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
13755
d1f55f16
CY
137562012-03-12 Chong Yidong <cyd@gnu.org>
13757
13758 * eval.c (inhibit_lisp_code): Rename from
13759 inhibit_window_configuration_change_hook; move from window.c.
13760
13761 * xfns.c (unwind_create_frame_1, Fx_create_frame):
13762 * window.c (run_window_configuration_change_hook)
13763 (syms_of_window): Callers changed.
13764
66c5eebd
CY
137652012-03-11 Chong Yidong <cyd@gnu.org>
13766
413df973
CY
13767 * keymap.c (Fkey_description): Doc fix (Bug#9700).
13768
66c5eebd
CY
13769 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
13770
1de11f56
CY
137712012-03-10 Chong Yidong <cyd@gnu.org>
13772
13773 * frame.c (other_visible_frames): Don't assume the selected frame
13774 is visible (Bug#10955).
13775
cae07000
SM
137762012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
13777
13778 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
13779
89c94350
JD
137802012-03-08 Jan Djärv <jan.h.d@swipnet.se>
13781
13782 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
13783 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
13784 zero (Bug#10954).
13785
999dd333
GM
137862012-03-03 Glenn Morris <rgm@gnu.org>
13787
01a6dcc8 13788 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 13789
de0100f2
EZ
137902012-03-02 Eli Zaretskii <eliz@gnu.org>
13791
13792 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
13793 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
13794 (redisplay_window, next_element_from_string): Fix typos in
13795 comments.
3e441275
EZ
13796 (redisplay_window): Pass to move_it_vertically the margin in
13797 pixels, not in screen lines.
de0100f2 13798
96a72ee9
GM
137992012-03-02 Glenn Morris <rgm@gnu.org>
13800
13801 * buffer.c (buffer-list-update-hook): Doc fix.
13802
312508d7
EZ
138032012-02-29 Eli Zaretskii <eliz@gnu.org>
13804
13805 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
13806 push_it before setting up the iterator for the first overlay
13807 string, even if we have an empty string loaded.
13808 (next_overlay_string): If there's an empty string on the iterator
13809 stack, pop the stack. (Bug#10903)
13810
27f3c637
PE
138112012-02-25 Paul Eggert <eggert@cs.ucla.edu>
13812
13813 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
13814 Suggested by Stefan Monnier in
13815 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
13816 * alloc.c (widen_to_Lisp_Object): New static function.
13817 (mark_memory): Also mark Lisp_Objects by fetching pointer words
13818 and widening them to Lisp_Objects. This would work even if
13819 USE_LSB_TAG is defined and wide integers are used, which might
13820 happen in a future version of Emacs.
13821
3c9dfce6
CY
138222012-02-25 Chong Yidong <cyd@gnu.org>
13823
fa74b241
CY
13824 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
13825 Doc fix.
13826
3c9dfce6
CY
13827 * xselect.c (Fx_selection_exists_p): Doc fix.
13828 (x_clipboard_manager_save_all): Print an informative message
13829 before saving to clipboard manager.
13830
9486df08
CY
138312012-02-24 Chong Yidong <cyd@gnu.org>
13832
13833 * keyboard.c (process_special_events): Handle all X selection
13834 requests in kbd_buffer, not just the next one (Bug#8869).
13835
f01d3321
CY
138362012-02-23 Chong Yidong <cyd@gnu.org>
13837
13838 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
13839 call when setting menu-bar-lines and tool-bar-lines parameters.
13840 (unwind_create_frame_1): New helper function.
13841
13842 * window.c (inhibit_window_configuration_change_hook): New var.
13843 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 13844 (syms_of_window): Initialize it.
f01d3321 13845
86b847b6
CY
138462012-02-22 Chong Yidong <cyd@gnu.org>
13847
13848 * xterm.c (x_draw_image_relief): Add missing type check for
13849 Vtool_bar_button_margin (Bug#10743).
13850
a59225b1
CY
138512012-02-21 Chong Yidong <cyd@gnu.org>
13852
13853 * fileio.c (Vfile_name_handler_alist): Doc fix.
13854
13855 * buffer.c (Fget_file_buffer): Protect against invalid file
13856 handler return value.
13857
310f5bd4
PE
138582012-02-20 Paul Eggert <eggert@cs.ucla.edu>
13859
cb3a28cc
PE
13860 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
13861 when computing $valmask.
13862
310f5bd4
PE
13863 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
13864 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
13865 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
13866 It's useless in that case, and it can cause problems on hosts
13867 that allocate halves of EMACS_INT values separately.
13868 Reported by Dan Horák. Diagnosed by Andreas Schwab in
13869 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
13870 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
13871 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
13872 it avoids undefined behavior on hosts where shifting right by more
13873 than the word width has undefined behavior.
13874
2375c96a
CY
138752012-02-19 Chong Yidong <cyd@gnu.org>
13876
13877 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
13878 (Funhandled_file_name_directory, Ffile_name_as_directory)
13879 (Fdirectory_file_name, Fexpand_file_name)
13880 (Fsubstitute_in_file_name): Protect against invalid file handler
13881 return values (Bug#10845).
13882
3eb49e71
EZ
138832012-02-18 Eli Zaretskii <eliz@gnu.org>
13884
13885 * .gdbinit (pitx): Fix incorrect references to fields of the
13886 iterator stack.
13887
7b926f3f
CY
138882012-02-17 Chong Yidong <cyd@gnu.org>
13889
13890 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
13891
11273115
PE
138922012-02-15 Paul Eggert <eggert@cs.ucla.edu>
13893
13894 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
13895 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
13896
c3a70e2b
CY
138972012-02-15 Chong Yidong <cyd@gnu.org>
13898
13899 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
13900 marked as special. Also, starting docstrings with * is obsolete.
13901
0ca43699
AS
139022012-02-13 Andreas Schwab <schwab@linux-m68k.org>
13903
13904 * gnutls.c (emacs_gnutls_write): Fix last change.
13905
2e8f3c56
LI
139062012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
13907
13908 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
13909 send_process.
13910
af70074f
SM
139112012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
13912
13913 * keymap.c (Fsingle_key_description): Handle char ranges.
13914
95986d52
CY
139152012-02-12 Chong Yidong <cyd@gnu.org>
13916
afd83bd1
CY
13917 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
13918 as that creates a dangerous corner case.
13919
95986d52
CY
13920 * window.c (Fdelete_window_internal): Invalidate the mouse
13921 highlight (Bug#9904).
13922
bd7da63e
GM
139232012-02-12 Glenn Morris <rgm@gnu.org>
13924
13925 * xselect.c (Fx_own_selection_internal)
13926 (Fx_get_selection_internal, Fx_disown_selection_internal)
13927 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
13928 * nsselect.m (Fx_own_selection_internal)
13929 (Fx_disown_selection_internal, Fx_selection_exists_p)
13930 (Fx_selection_owner_p, Fx_get_selection_internal):
13931 Sync docs and argument specs with the xselect.c versions.
13932
77abcbc2
LI
139332012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
13934
13935 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
13936
90b671e2
EZ
139372012-02-11 Eli Zaretskii <eliz@gnu.org>
13938
1c0ca0b7
EZ
13939 * w32select.c (Fx_selection_exists_p): Sync doc string and
13940 argument list with xselect.c. (Bug#10783)
13941
13942 * w16select.c (Fx_selection_exists_p): Sync doc string and
13943 argument list with xselect.c. (Bug#10783)
90b671e2 13944
49241268
GM
139452012-02-10 Glenn Morris <rgm@gnu.org>
13946
13947 * fns.c (Fsecure_hash): Doc fix.
13948
f998bbe7 139492012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
13950
13951 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
13952
0992bd9c
CY
139532012-02-07 Chong Yidong <cyd@gnu.org>
13954
13955 * buffer.c (Fbuffer_local_variables)
13956 (buffer_lisp_local_variables): Handle unbound vars correctly;
13957 don't let Qunbound leak into Lisp.
13958
af008560
GM
139592012-02-07 Glenn Morris <rgm@gnu.org>
13960
dd605cc4
GM
13961 * image.c (Fimagemagick_types): Doc fix.
13962
af008560
GM
13963 * image.c (imagemagick-render-type): Change it from a lisp object
13964 to an integer. Move the doc here from the lisp manual.
13965 Treat all values not equal to 0 the same.
13966
1449fa1d
CY
139672012-02-06 Chong Yidong <cyd@gnu.org>
13968
13969 * doc.c (store_function_docstring): Avoid applying docstring of
13970 alias to base function (Bug#2603).
13971
3723ec07
AS
139722012-02-04 Andreas Schwab <schwab@linux-m68k.org>
13973
13974 * .gdbinit (pp1, pv1): Remove redundant defines.
13975 (pr): Use pp.
13976
79c1cc1e
CY
139772012-02-04 Chong Yidong <cyd@gnu.org>
13978
13979 * nsterm.m: Declare a global (Bug#10694).
13980
d7f29f8e
EZ
139812012-02-04 Eli Zaretskii <eliz@gnu.org>
13982
cae07000
SM
13983 * w32.c (get_emacs_configuration_options):
13984 Include --enable-checking, if specified, in the return value.
d7f29f8e 13985
3b95a6f9
MR
139862012-02-04 Martin Rudalics <rudalics@gmx.at>
13987
13988 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
13989 after rounding frame sizes. (Bug#9723)
13990
d6fa96a6
EZ
139912012-02-04 Eli Zaretskii <eliz@gnu.org>
13992
13993 * keyboard.c (adjust_point_for_property): Don't position point
13994 before BEGV. (Bug#10696)
13995
df0b2940
PE
139962012-02-03 Paul Eggert <eggert@cs.ucla.edu>
13997
13998 Handle overflow when computing char display width (Bug#9496).
13999 * character.c (char_width): Return EMACS_INT, not int.
14000 (char_width, c_string_width): Check for overflow when
14001 computing the width; this is possible now that individual
14002 characters can have unbounded width. Problem introduced
14003 by merge from Emacs 23 on 2012-01-19.
14004
6bee44d6
MA
140052012-02-02 Michael Albinus <michael.albinus@gmx.de>
14006
14007 * dbusbind.c (Fdbus_register_method): Mention the return value
14008 :ignore in the docstring.
14009
44f92739
GM
140102012-02-02 Glenn Morris <rgm@gnu.org>
14011
1b9f60cc
GM
14012 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
14013
44f92739
GM
14014 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14015 Unconditionally set to t. (Bug#10673)
14016 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
14017 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
14018 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
14019
c5d3843c
KH
140202012-02-02 Kenichi Handa <handa@m17n.org>
14021
14022 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
14023 0, do not call append_composite_glyph.
14024
159462d4 140252012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
14026
14027 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
14028 NULL (Bug#6988).
14029 (x_produce_glyphs): If the component of a composition is a null
14030 string, set it->pixel_width to 1 to avoid zero-width glyph.
14031
78cef877
EZ
140322012-02-01 Eli Zaretskii <eliz@gnu.org>
14033
14034 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
14035 first 2 arguments are identical. This makes inserting large
14036 output from a subprocess an order of magnitude faster on
14037 MS-Windows, where all sbrk'ed memory is always contiguous.
14038
97897668
GM
140392012-01-31 Glenn Morris <rgm@gnu.org>
14040
14041 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 14042 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
14043 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
14044
31fd3586
GM
140452012-01-29 Glenn Morris <rgm@gnu.org>
14046
14047 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
14048
0e24a8b2
CY
140492012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
14050
14051 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
14052
cc0adcb0
CY
140532012-01-28 Chong Yidong <cyd@gnu.org>
14054
14055 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
14056
acc28cb9
CY
140572012-01-26 Chong Yidong <cyd@gnu.org>
14058
9c69cfb7
CY
14059 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
14060
acc28cb9
CY
14061 * search.c (Fsearch_forward, Fsearch_backward): Document negative
14062 repeat counts (Bug#10507).
14063
48da7392
GM
140642012-01-26 Glenn Morris <rgm@gnu.org>
14065
14066 * lread.c (syms_of_lread): Doc fix.
14067
14af5f7f
CY
140682012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
14069
14070 * coding.c (encode_designation_at_bol): Change return value to
14071 EMACS_INT.
14072
0b21c100
CY
140732012-01-25 Chong Yidong <cyd@gnu.org>
14074
14075 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
14076
3c2907f7
CY
140772012-01-21 Chong Yidong <cyd@gnu.org>
14078
14079 * floatfns.c (Fcopysign): Make the second argument non-optional,
14080 since nil is not allowed anyway.
14081
959ad23f
AS
140822012-01-21 Andreas Schwab <schwab@linux-m68k.org>
14083
14084 * process.c (read_process_output): Use p instead of XPROCESS (proc).
14085 (send_process): Likewise.
14086
34a02f46
MR
140872012-01-19 Martin Rudalics <rudalics@gmx.at>
14088
14089 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
14090 (Vwindow_persistent_parameters): Do not use Qstate.
14091 Rewrite doc-strings.
34a02f46 14092
1259009a 140932012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
14094
14095 * character.c (char_width): New function.
70d4fdf6
GM
14096 (Fchar_width, c_string_width, lisp_string_width):
14097 Use char_width (Bug#9496).
25ed9e61 14098
6a6ee00d
MR
140992012-01-16 Martin Rudalics <rudalics@gmx.at>
14100
14101 * window.c (Vwindow_persistent_parameters): New variable.
14102 (Fset_window_configuration, save_window_save): Handle persistent
14103 window parameters.
14104
c85efaf7
EZ
141052012-01-14 Eli Zaretskii <eliz@gnu.org>
14106
14107 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
14108 thrashing the stack of the thread. (Bug#9087)
14109
5944709e
PE
141102012-01-12 Paul Eggert <eggert@cs.ucla.edu>
14111
14112 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
14113
e71f5d99
EZ
141142012-01-11 Eli Zaretskii <eliz@gnu.org>
14115
14116 * xdisp.c (rows_from_pos_range): Handle the case where the
14117 highlight ends on a newline. (Bug#10464)
14118 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
14119 he end column for display of highlight that ends on a newline
14120 before a R2L line.
14121
ce316182
GM
141222012-01-11 Glenn Morris <rgm@gnu.org>
14123
14124 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
14125 from load-path also when installation-directory is nil. (Bug#10208)
14126
5b43da69
GM
141272012-01-10 Glenn Morris <rgm@gnu.org>
14128
74cc8ff9
GM
14129 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
14130
7d8d6e4e
GM
14131 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
14132 Update template values to be closer to their typical values these days.
5b43da69 14133
a0db8d43
EZ
141342012-01-09 Eli Zaretskii <eliz@gnu.org>
14135
14136 * xdisp.c (rows_from_pos_range): Accept additional argument
14137 DISP_STRING, and accept any glyph in a row whose object is that
14138 string as eligible for mouse highlight. Fixes mouse highlight of
14139 display strings from overlays. (Bug#10464)
14140
9a0115ab 141412012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 14142
b9110d6a 14143 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
14144 * fileio.c (auto_saving_dir_umask): New static var.
14145 (Fmake_directory_internal): Use it.
14146 (do_auto_save_make_dir): Set it, instead of invoking chmod after
14147 creating the directory. The old code temporarily assigns
14148 too-generous permissions to the directory.
14149 (do_auto_save_eh): Clear it.
b9110d6a 14150 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
14151 that the var is always cleared.
14152
6c1bd3f3
EZ
141532012-01-07 Eli Zaretskii <eliz@gnu.org>
14154
14155 * search.c (scan_buffer): Pass character positions to
14156 know_region_cache, not byte positions. (Bug#6540)
14157
069d2b50
L
141582012-01-07 LynX <_LynX@bk.ru> (tiny change)
14159
14160 * w32.c (sys_rename): Report EXDEV when rename of a directory
14161 fails because the target is on another logical disk. (Bug#10284)
14162
75bf0d33
DB
141632012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
14164
14165 * xterm.c (x_embed_request_focus): New function.
14166
14167 * xterm.h: Add prototype.
14168
14169 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
14170
1c6e5a32
GM
141712012-01-05 Glenn Morris <rgm@gnu.org>
14172
14173 * emacs.c (emacs_copyright): Update short copyright year to 2012.
14174
651e947e
EZ
141752012-01-01 Eli Zaretskii <eliz@gnu.org>
14176
14177 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
14178 Load gnutls_transport_set_lowat only if GnuTLS version is below
14179 2.11.1.
14180 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
14181 GnuTLS versions below 2.11.1.
14182
3778cdd8
AL
141832011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
14184
14185 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
14186 to the doc string advising against its use for altering the way
14187 windows are scrolled.
14188
0e5317f7
KH
141892011-12-28 Kenichi Handa <handa@m17n.org>
14190
14191 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
14192 coding-system ASCII compatible only when it does not produce BOM
14193 on encoding (Bug#10383).
14194
93d5ca1f
JD
141952011-12-26 Jan Djärv <jan.h.d@swipnet.se>
14196
14197 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
14198 can scroll.
14199 (create_and_show_popup_menu): Always use menu_position_func for
14200 Gtk3 (Bug#10361).
14201
ca22b785
AS
142022011-12-24 Andreas Schwab <schwab@linux-m68k.org>
14203
14204 * callint.c (Fcall_interactively): Don't truncate prompt string.
14205
d048e1e6
EZ
142062011-12-23 Eli Zaretskii <eliz@gnu.org>
14207
14208 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
14209 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 14210 resumed from there (after widening). (Bug#10360)
d048e1e6 14211
5ccaba1f
JD
142122011-12-22 Jan Djärv <jan.h.d@swipnet.se>
14213
14214 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
14215
204ee57f
JD
142162011-12-21 Jan Djärv <jan.h.d@swipnet.se>
14217
b81d40f0
JB
14218 * nsterm.m (x_free_frame_resources):
14219 Release f->output_data.ns->miniimage.
204ee57f
JD
14220 (ns_index_color): Fix indentation. Do not retain
14221 color_table->colors[i].
14222
14223 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
14224 before returning.
14225
14226 * nsfns.m (x_set_background_color): Assign return value from
14227 ns_index_color to face-background instead of NSColor*.
14228 (ns_implicitly_set_icon_type): Fix indentation.
14229 Change assignment in for loop to comparison.
14230
14231 * emacs.c (ns_pool): New variable.
14232 (main): Assign ns_pool.
14233 (Fkill_emacs): Call ns_release_autorelease_pool.
14234
14235 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
14236 autorelease fdesc, release fdAttrs and tdict.
14237 (ns_get_covering_families): Release charset.
14238 (ns_findfonts): Release NSFontDescriptor created with new.
14239 (ns_uni_to_glyphs): Fix indentation.
14240 (setString): Release attrStr before assigning new value.
14241
c803b2b7
JD
142422011-12-18 Jan Djärv <jan.h.d@swipnet.se>
14243
678f4426
JD
14244 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
14245 and NS_IMPL_COCOA.
14246 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
14247 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
14248
cd394be1 142492011-12-18 David Reitter <reitter@cmu.edu>
678f4426 14250
5fecd5fc
JD
14251 * nsterm.m (ns_term_init): Subscribe for notifications
14252 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
14253 to method trackingNotification in EmacsMenu.
14254
14255 * nsmenu.m (trackingMenu): New variable.
3771cb17 14256 (trackingNotification): New method (from Aquamacs).
5fecd5fc 14257 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 14258 from Aquamacs (Bug#7030).
678f4426
JD
14259
142602011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 14261
c803b2b7
JD
14262 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
14263 (symbol_to_nsstring): Fix indentation.
14264 (ns_symbol_to_pb): New function.
cae07000
SM
14265 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
14266 (Fns_rotate_cut_buffers_internal): Remove.
14267 (Fns_store_selection_internal): Rename from
c803b2b7
JD
14268 Fns_store_cut_buffer_internal.
14269 (ns_get_foreign_selection, Fx_own_selection_internal)
14270 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
14271 (Fns_get_selection_internal, Fns_store_selection_internal):
14272 Use ns_symbol_to_pb and check if return value is nil.
14273 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
14274 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
14275 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
14276 renamed to Sns_store_selection_internal.
14277 (ns_handle_selection_request): Move code to Fx_own_selection_internal
14278 and remove this function.
14279 (ns_handle_selection_clear): Remove, never used.
14280 (Fx_own_selection_internal): Move code from ns_handle_selection_request
14281 here.
14282
e1b01a3a
KB
142832011-12-17 Ken Brown <kbrown@cornell.edu>
14284
14285 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
14286 GID is unknown (Bug#10257).
14287
2adb6e85
PE
142882011-12-17 Paul Eggert <eggert@cs.ucla.edu>
14289
14290 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
14291 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
14292 which caused a build failure on GNU/Linux IA-64. This problem was
14293 introduced by my 2011-10-07 patch.
14294
d1d7b339
JL
142952011-12-15 Juri Linkov <juri@jurta.org>
14296
14297 * image.c (imagemagick_error): New function. (Bug#10112)
14298 (imagemagick_load_image): Comment out `MagickSetResolution' call.
14299 Use `imagemagick_error' where ImageMagick functions return
14300 `MagickFalse'.
14301 (Fimagemagick_types): Add `Fnreverse' to return the list in the
14302 proper order.
14303
100d5755
KH
143042011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14305
14306 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
14307 fill background (Bug#8992).
14308
454592a6
MR
143092011-12-13 Martin Rudalics <rudalics@gmx.at>
14310
14311 * window.c (Vwindow_combination_resize)
14312 (Vwindow_combination_limit): Use t instead of non-nil in
14313 doc-strings.
61d4b438
MR
14314 (Vrecenter_redisplay): Add first sentence of doc-string on
14315 separate line.
53524d93 14316 (Frecenter): Fix doc-string typo.
454592a6 14317
3633e3aa
KH
143182011-12-11 Kenichi Handa <handa@m17n.org>
14319
14320 * coding.c (Funencodable_char_position): Pay attention to the
14321 buffer text relocation (Bug#9389).
14322
7b9d523a 143232011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 14324
7b9d523a
JD
14325 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
14326 gtk_init (Bug#10100).
14327
b73189c6
EZ
143282011-12-10 Eli Zaretskii <eliz@gnu.org>
14329
14330 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
14331 IT->string is nil. (Bug#10263)
14332
f7dfe5d6
JD
143332011-12-10 Jan Djärv <jan.h.d@swipnet.se>
14334
83faebb4
JD
14335 * nsterm.h (x_free_frame_resources): Declare.
14336
f7dfe5d6
JD
14337 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
14338 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
14339
14340 * nsterm.h (ns_get_defaults_value): Declare.
14341
14342 * nsterm.m (ns_default): Call ns_get_defaults_value.
14343
7cd4e72c
EZ
143442011-12-09 Eli Zaretskii <eliz@gnu.org>
14345
14346 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
14347 (Bug#10170)
14348
b34d7317
YM
143492011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14350
14351 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
14352 that where the value of an _OBJC_* symbol points to is in the .bss
14353 section (Bug#10240).
14354
76470ad1
KH
143552011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14356
14357 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 14358 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 14359
745fff94
KH
143602011-12-08 Kenichi Handa <handa@m17n.org>
14361
14362 * ftfont.c (get_adstyle_property): Fix previous change
14363 (Bug#10233).
14364
6e44397c
JB
143652011-12-07 Juanma Barranquero <lekktu@gmail.com>
14366
14367 * w32.c (init_environment): If no_site_lisp, remove site-lisp
14368 dirs from the default value of EMACSLOADPATH (bug#10208).
14369
7efa6272
GM
143702011-12-07 Glenn Morris <rgm@gnu.org>
14371
14372 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
14373 installation and source directories as well. (Bug#10208)
14374
f6fc4d87
CY
143752011-12-06 Chong Yidong <cyd@gnu.org>
14376
14377 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
14378
2bf26180
GM
143792011-12-06 Glenn Morris <rgm@gnu.org>
14380
14381 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
14382 as an error, not just -1. (Bug#10217)
14383
3a6ad4f0
CY
143842011-12-05 Chong Yidong <cyd@gnu.org>
14385
14386 * keyboard.c (process_special_events): New function.
14387 (swallow_events, Finput_pending_p): Use it (Bug#10195).
14388
75a3b399
PE
143892011-12-05 Paul Eggert <eggert@cs.ucla.edu>
14390
14391 * coding.c (encode_designation_at_bol): Don't use uninitialized
14392 local variable (Bug#9318).
14393
c3c9e25e
KH
143942011-12-05 Kenichi Handa <handa@m17n.org>
14395
14396 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
14397 return Qnil (Bug#8046, Bug#10193).
14398
5eb05ea3
KH
143992011-12-05 Kenichi Handa <handa@m17n.org>
14400
14401 * coding.c (encode_designation_at_bol): New args charbuf_end and
14402 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
14403 (coding_set_source): Return how many bytes coding->source was
14404 relocated.
14405 (coding_set_destination): Return how many bytes
14406 coding->destination was relocated.
14407 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 14408 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
14409
144102011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
14411
14412 * coding.c (CODING_CHAR_CHARSET_P): New macro.
14413 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
14414 macro (Bug#9318).
14415
144162011-12-05 Andreas Schwab <schwab@linux-m68k.org>
14417
14418 The following changes are to fix Bug#9318.
14419
a79703f5 14420 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
14421 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
14422 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 14423 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 14424
7dbda6df
JB
144252011-12-05 Juanma Barranquero <lekktu@gmail.com>
14426
14427 * lisp.h (process_quit_flag): Fix external declaration.
14428
6d5eb5b0
SM
144292011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
14430
14431 Don't macro-inline non-performance-critical code.
14432 * eval.c (process_quit_flag): New function.
14433 * lisp.h (QUIT): Use it.
14434
a0c3fad0
JD
144352011-12-04 Jan Djärv <jan.h.d@swipnet.se>
14436
14437 * nsfns.m (get_geometry_from_preferences): New function.
14438 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
14439
6c07aac2
AS
144402011-12-04 Andreas Schwab <schwab@linux-m68k.org>
14441
14442 * emacs.c (Qkill_emacs): Define.
14443 (syms_of_emacs): Initialize it.
14444 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
14445 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
14446 (quit_throw_to_read_char): Add parameter `from_signal'.
14447 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
14448 * lisp.h (QUIT): Call Fkill_emacs if requested.
14449
c052ead4
JD
144502011-12-03 Jan Djärv <jan.h.d@swipnet.se>
14451
14452 * widget.c (update_wm_hints): Return if wmshell is null.
14453 (widget_update_wm_size_hints): New function.
14454
14455 * widget.h (widget_update_wm_size_hints): Declare.
14456
14457 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
14458 widget_update_wm_size_hints (Bug#10104).
14459
9e49252b
EZ
144602011-12-03 Eli Zaretskii <eliz@gnu.org>
14461
14462 * xdisp.c (handle_invisible_prop): If the invisible text ends just
14463 before a newline, prepare the bidi iterator for consuming the
14464 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 14465 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 14466
02b16839
JL
144672011-12-02 Juri Linkov <juri@jurta.org>
14468
14469 * search.c (Fword_search_regexp): New Lisp function created from
14470 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
14471 (Fword_search_backward, Fword_search_forward)
14472 (Fword_search_backward_lax, Fword_search_forward_lax):
14473 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
14474 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
14475
0068070e
SM
144762011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
14477
14478 * fileio.c (Finsert_file_contents): Move after-change-function call
14479 to before the "handled:" label, since all "goto handled" appear in
14480 cases where the *-change-functions have already been properly called
14481 (bug#10117).
14482
3360a3fc
AS
144832011-12-01 Andreas Schwab <schwab@linux-m68k.org>
14484
14485 * keyboard.c (interrupt_signal): Don't call kill-emacs when
14486 waiting for input. (Bug#10169)
14487
73d6c093
EZ
144882011-11-30 Eli Zaretskii <eliz@gnu.org>
14489
14490 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
14491 verifies glyph row's hash code--we have just reallocated the
14492 glyphs, so their contents can be complete garbage. (Bug#10164)
14493
febe6bea
JB
144942011-11-30 Juanma Barranquero <lekktu@gmail.com>
14495
14496 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
14497
801a4313
EZ
144982011-11-30 Eli Zaretskii <eliz@gnu.org>
14499
14500 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
14501 attributes are tested _before_ calling verify_row_hash, to protect
14502 against GCC re-ordering of the tests. (Bug#10164)
14503
2b56b87e
JD
145042011-11-29 Jan Djärv <jan.h.d@swipnet.se>
14505
14506 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
14507
14508 * xterm.c (handle_one_xevent): Only set async_visible and friends
14509 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 14510 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
14511 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
14512
dbf31225
PE
145132011-11-28 Paul Eggert <eggert@cs.ucla.edu>
14514
14515 Remove GCPRO-related macros that exist only to avoid shadowing locals.
14516 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
14517 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
14518 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14519 All uses changed to use GCPRO1 etc.
14520 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
14521 Revert to old implementation (i.e., before 2011-03-11).
14522
1305621b
YM
145232011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14524
14525 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
14526 of scroll runs so as to avoid assigning disabled bogus rows and
14527 unnecessary graphics copy operations.
14528
8c9afb46
EZ
145292011-11-27 Eli Zaretskii <eliz@gnu.org>
14530
14531 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
14532 (snprintf) [_MSC_VER]: Redirect to _snprintf.
14533 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
14534 (malloc, free, realloc, calloc): Redirect to e_* only when
14535 compiling Emacs.
14536
14537 * lisp.h (GCTYPEBITS): Move before first use.
14538 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
14539 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
14540 this macro definition.
14541
14542 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
14543 _MSC_VER.
14544
54e9e3bf
JD
145452011-11-27 Jan Djärv <jan.h.d@swipnet.se>
14546
6d5eb5b0
SM
14547 * gtkutil.c (xg_create_frame_widgets):
14548 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
14549 present with Gtk+ 2.0.
14550
83aca1cb
PE
145512011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14552
14553 * fileio.c (Finsert_file_contents): Undo previous change; see
14554 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
14555
5b76caa4
PE
145562011-11-26 Paul Eggert <eggert@cs.ucla.edu>
14557
14558 Rename locals to avoid shadowing.
14559 * fileio.c (Finsert_file_contents):
14560 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
14561 * process.c (wait_reading_process_output):
14562 Rename inner 'proc' to 'p' to avoid shadowing.
14563 Indent for consistency with usual Emacs style.
14564
8c535114
EZ
145652011-11-25 Eli Zaretskii <eliz@gnu.org>
14566
14567 * xdisp.c (redisplay_window): If cursor row is not fully visible
14568 after recentering, and scroll-conservatively is set to a large
14569 number, scroll window by a few more lines to make the cursor fully
14570 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
14571 (start_display): Don't move to the next line if the display should
14572 start at a newline that is part of a display vector or an overlay
14573 string. (Bug#10119)
8c535114 14574
fa4fdb5c
JL
145752011-11-24 Juri Linkov <juri@jurta.org>
14576
14577 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
14578 after the `MagickPingImage' call. (Bug#10112)
14579
90ec88df
CY
145802011-11-23 Chong Yidong <cyd@gnu.org>
14581
14582 * window.c (Fcoordinates_in_window_p): Accept only live windows.
14583
56e2e794
MR
145842011-11-23 Martin Rudalics <rudalics@gmx.at>
14585
14586 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
14587 making another buffer current. (Bug#10114)
14588
b6e64c41
GM
145892011-11-23 Glenn Morris <rgm@gnu.org>
14590
14591 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
14592
6b21de18
CY
145932011-11-23 Chong Yidong <cyd@gnu.org>
14594
14595 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
14596 using it (Bug#5984).
14597
b12cd789
EZ
145982011-11-22 Eli Zaretskii <eliz@gnu.org>
14599
14600 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
14601 and header-lines, as they don't have one computed for them.
14602 (Bug#10098)
14603
14604 * .gdbinit (prow): Make displayed values more self-explaining.
14605 Add row's hash code.
14606
261b6fd4
LMI
146072011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
14608
14609 * process.c (wait_reading_process_output): Fix asynchrounous
14610 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 14611 (wait_reading_process_output): Add comment and URL.
261b6fd4 14612
e7cfd277
JD
146132011-11-21 Jan Djärv <jan.h.d@swipnet.se>
14614
14615 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
14616
a9b9b7f5
CY
146172011-11-21 Chong Yidong <cyd@gnu.org>
14618
14619 * window.c (Fnext_window, Fprevious_window): Doc fix.
14620
b0d15b4f
SM
146212011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14622
14623 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
14624
fe7a3057
JB
146252011-11-20 Juanma Barranquero <lekktu@gmail.com>
14626
14627 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
14628
d2999b1a
MR
146292011-11-20 Martin Rudalics <rudalics@gmx.at>
14630
14631 * window.c (Fset_window_combination_limit): Rename argument
14632 STATUS to LIMIT.
14633 (Vwindow_combination_limit): Remove "status" from doc-string.
14634
d5ff9cd0
AS
146352011-11-20 Andreas Schwab <schwab@linux-m68k.org>
14636
14637 * m/ibms390.h: Remove.
14638 * m/ibms390x.h: Don't include "ibms390.h".
14639
a5bb9bd3
SM
146402011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
14641
14642 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
14643 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
14644
cd1181db
JB
146452011-11-20 Juanma Barranquero <lekktu@gmail.com>
14646
14647 * casetab.c (Fset_case_table):
14648 * charset.c (Fcharset_after): Fix typos.
14649
615a3b8d 146502011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 14651
17e845af
PE
14652 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
14653 Otherwise, valgrind does not work on some platforms.
14654 Problem reported by Andreas Schwab in
6a0bf43d
PE
14655 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
14656 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
14657 is set, removing the need for VIRT_ADDRESS_VARIES.
14658 (PURE_P): Use a more-efficient implementation that needs just one
14659 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
14660 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
14661 to 4 (xorl, subq, cmpq, setbe).
14662 * alloc.c (pure): Always extern now, since that's the
14663 VIRT_ADDR_VARIES behavior.
14664 (PURE_POINTER_P): Use a single comparison, not two, for
14665 consistency with the new puresize.h.
14666 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
14667 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
14668 Remove VIRT_ADDR_VARIES no longer needed.
14669
f8fe6f96
EZ
146702011-11-19 Eli Zaretskii <eliz@gnu.org>
14671
14672 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
14673 (erase_phys_cursor, update_window_cursor, show_mouse_face)
14674 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
14675 behave as if the cursor position were at the window margin.
14676
14677 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
14678 and the cursor position is out of bounds, behave as if the cursor
14679 position were at the window margin. (Bug#10075)
14680
df05a53c
CY
146812011-11-18 Chong Yidong <cyd@gnu.org>
14682
14683 * window.c (Fwindow_combination_limit): Make first argument
14684 non-optional, since it is meaningless for live windows like the
14685 selected window.
61ccba97 14686
2071918e
DA
146872011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
14688
14689 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
14690
b50a28de
SM
146912011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
14692
14693 * intervals.c: Fix grafting over the whole buffer (bug#10071).
14694 (graft_intervals_into_buffer): Simplify.
14695
015137db
EZ
146962011-11-18 Eli Zaretskii <eliz@gnu.org>
14697
14698 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
14699 hash values of the two rows.
14700 (copy_row_except_pointers): Preserve the used[] arrays and the
14701 hash values of the two rows. (Bug#10035)
68c95424 14702 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
14703
14704 * xdisp.c (row_hash): New function, body extracted from
14705 compute_line_metrics.
14706 (compute_line_metrics): Call row_hash, instead of computing the
14707 hash code inline.
14708
14709 * dispnew.c (verify_row_hash): Call row_hash for computing the
14710 hash code of a row, instead of duplicating code from xdisp.c.
14711
14712 * dispextern.h (row_hash): Add prototype.
14713
a2addb04
TH
147142011-11-18 Tassilo Horn <tassilo@member.fsf.org>
14715
14716 * frame.c (delete_frame): Don't delete the terminal when the last
14717 X frame is closed if emacs is built with GTK toolkit.
14718
df85d315
JB
147192011-11-17 Juanma Barranquero <lekktu@gmail.com>
14720
14721 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
14722
a0c2d0ae
MR
147232011-11-17 Martin Rudalics <rudalics@gmx.at>
14724
14725 * window.c (Vwindow_splits): Rename to
14726 Vwindow_combination_resize. Suggested by Juri Linkov.
14727 (Fsplit_window_internal): Use Vwindow_combination_resize instead
14728 of Vwindow_splits.
14729
58179cce
JB
147302011-11-16 Juanma Barranquero <lekktu@gmail.com>
14731
7877f373
JB
14732 * nsfns.m (Fns_font_name):
14733 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 14734
b6f67890
MR
147352011-11-16 Martin Rudalics <rudalics@gmx.at>
14736
14737 * window.h (window): Rename slot "nest" to "combination_limit".
14738 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
14739 (Fset_window_nest): Rename to Fset_window_combination_limit.
14740 (Vwindow_nest): Rename to Vwindow_combination_limit.
14741 (recombine_windows, make_parent_window, make_window)
14742 (Fsplit_window_internal, saved_window)
14743 (Fset_window_configuration, save_window_save): Rename all
14744 occurrences of window_nest to window_combination_limit.
14745
c7015153
JB
147462011-11-15 Juanma Barranquero <lekktu@gmail.com>
14747
14748 * image.c (imagemagick_load_image): Fix typo.
14749
322ad6ec
EZ
147502011-11-14 Eli Zaretskii <eliz@gnu.org>
14751
14752 * xdisp.c (display_line): Move the call to
14753 highlight_trailing_whitespace before the call to
14754 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
14755 faces of all the glyphs to compute ROW's hash value.
14756 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 14757
f067b8ec
JB
147582011-11-14 Juanma Barranquero <lekktu@gmail.com>
14759
14760 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
14761 just return (bug#10044).
14762
1e5b2111
EZ
147632011-11-12 Eli Zaretskii <eliz@gnu.org>
14764
7ef3cbd5
EZ
14765 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
14766 with user-defined heap size. Bump the default size of the temacs
14767 heap to 27MB, to avoid memory warning when running temacs.
14768 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
14769
1e5b2111
EZ
14770 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
14771 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
14772 (verify_row_hash) [XASSERTS]: New function.
14773 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
14774 that the hash value of glyph rows is correct.
1e5b2111 14775
89d61221
MR
147762011-11-12 Martin Rudalics <rudalics@gmx.at>
14777
14778 * window.h (window): Remove splits slot.
14779 * window.c (Fwindow_splits, Fset_window_splits): Remove.
14780 (Fdelete_other_windows_internal, make_parent_window)
14781 (make_window, Fsplit_window_internal, Fdelete_window_internal)
14782 (Fset_window_configuration, save_window_save): Don't deal with
14783 split status of windows.
14784 (saved_window): Remove splits slot.
14785 (Vwindow_splits): Rewrite doc-string.
14786
97f18cc8
JD
147872011-11-11 Jan Djärv <jan.h.d@swipnet.se>
14788
14789 * xfns.c (unwind_create_frame):
14790 * nsfns.m (unwind_create_frame):
14791 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
14792 Vframe_list (Bug#9999).
14793
22a648b4
DA
147942011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
14795
0b381c7e 14796 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 14797
659afede
KH
147982011-11-11 Kenichi Handa <handa@m17n.org>
14799
14800 * callproc.c (Fcall_process): Set the member dst_multibyte of
14801 process_coding.
14802
9ac0394b
KH
148032011-11-11 Johan Bockgård <bojohan@gnu.org>
14804
14805 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
14806 avoid a crash (bug#9496).
14807
2fbdc249
CY
148082011-11-09 Chong Yidong <cyd@gnu.org>
14809
14810 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
14811 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
14812
ac6b1f81
PE
148132011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14814
14815 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
14816
09db192c
PE
148172011-11-08 Paul Eggert <eggert@cs.ucla.edu>
14818
14819 Avoid some portability problems by eschewing 'extern inline' functions.
14820 The trivial performance wins aren't worth the portability hassles; see
14821 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
14822 et seq.
14823 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14824 (window_box_width, window_box_left, window_box_left_offset)
14825 (window_box_right, window_box_right_offset): Undo previous change,
14826 by removing the "extern"s.
14827 * intervals.c (adjust_intervals_for_insertion)
14828 (adjust_intervals_for_deletion): Undo previous change,
14829 making these static again.
14830 (offset_intervals, temp_set_point_both, temp_set_point)
14831 (copy_intervals_to_string): No longer inline.
14832 * xdisp.c (window_text_bottom_y, window_box_width)
14833 (window_box_height, window_box_left_offset)
14834 (window_box_right_offset, window_box_left, window_box_right)
14835 (window_box): No longer inline.
14836
105216ed
CY
148372011-11-08 Chong Yidong <cyd@gnu.org>
14838
14839 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
14840 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
14841 Signal an error if not a live window.
105216ed
CY
14842 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
14843 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
14844
ae9e237f
JB
148452011-11-07 Juanma Barranquero <lekktu@gmail.com>
14846
14847 * lisp.h (syms_of_abbrev): Remove declaration.
14848 Reported by CHENG Gao <chenggao@royau.me>.
14849
c7aa8333
EZ
148502011-11-07 Eli Zaretskii <eliz@gnu.org>
14851
14852 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
14853 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
14854 of temacs in GUI mode.
14855
be7f5545
MR
148562011-11-07 Martin Rudalics <rudalics@gmx.at>
14857
14858 * window.h: Declare delete_all_child_windows instead of
14859 delete_all_subwindows.
14860 * window.c (Fwindow_nest, Fset_window_nest)
14861 (Fset_window_new_total, Fset_window_new_normal)
14862 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
14863 (delete_all_subwindows): Rename to delete_all_child_windows.
14864 (Fdelete_other_windows_internal, Fset_window_configuration):
14865 Call delete_all_child_windows instead of delete_all_subwindows.
14866 * frame.c (delete_frame): Call delete_all_child_windows instead
14867 of delete_all_subwindows.
14868
ca78dc43
PE
148692011-11-07 Paul Eggert <eggert@cs.ucla.edu>
14870
14871 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
14872 This is also needed for porting to any host where GC_MARK_STACK is
14873 not GC_MAKE_GCPROS_NOOPS.
14874 (which_symbols): Use it.
14875
a0241d01
KH
148762011-11-07 Kenichi Handa <handa@m17n.org>
14877
14878 * coding.c (coding_set_destination): Check coding->src_pos only
14879 when coding->src_object is a buffer (bug#9910).
14880
14881 * process.c (send_process): Set the member src_multibyte of coding
14882 to 0 (bug#9911) when sending a unibyte text.
14883
14884 * callproc.c (Fcall_process): Set the member src_multibyte of
14885 process_coding to 0 (bug#9912).
14886
a64bfdfa 148872011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
14888
14889 * xmenu.c (cleanup_widget_value_tree): New function.
14890 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
14891 calling free_menubar_widget_value_tree directly (Bug#9830).
14892
cb41b32a
PE
148932011-11-06 Paul Eggert <eggert@cs.ucla.edu>
14894
14895 Fix some portability problems with 'inline'.
14896 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
14897 (window_box_width, window_box_left, window_box_left_offset)
14898 (window_box_right, window_box_right_offset): Declare extern.
14899 Otherwise, these inline functions do not conform to C99 and
14900 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
14901 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
14902 * intervals.c (adjust_intervals_for_insertion)
14903 (adjust_intervals_for_deletion): Now extern, because otherwise the
14904 extern inline functions 'offset_intervals' couldn't refer to it.
14905 (static_offset_intervals): Remove.
14906 (offset_intervals): Rewrite using the old contents of
14907 static_offset_intervals. The old version didn't conform to C99
14908 because an extern inline function contained a reference to an
14909 identifier with static linkage.
14910
b7041366
AS
149112011-11-06 Andreas Schwab <schwab@linux-m68k.org>
14912
14913 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
14914 GC.
14915
88a37c4d
EZ
149162011-11-06 Eli Zaretskii <eliz@gnu.org>
14917
14918 * xdisp.c (init_iterator, reseat_to_string): Don't set the
14919 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
14920 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
14921 return Qleft_to_right.
14922
49745b39
CY
149232011-11-06 Chong Yidong <cyd@gnu.org>
14924
14925 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
14926 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
14927 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
14928 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
14929 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
14930 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
14931 (Fwindow_vscroll): Doc fix.
14932 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
14933 argument, since it makes no sense to pass a live window and for
14934 consistency with window-child.
14935
1f05cd82
CS
149362011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
14937
14938 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
14939 support MSVC.
14940
22610910
JR
149412011-11-05 Jason Rumney <jasonr@gnu.org>
14942
14943 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
14944 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
14945 fonts (Bug#6029).
14946 (add_font_entity_to_list): Fix logic errors in mixed boolean and
14947 bitwise arithmetic preventing use of unicode-sip and non-truetype
14948 opentype fonts.
14949
a06776b2
EZ
149502011-11-05 Eli Zaretskii <eliz@gnu.org>
14951
3ad924ba
EZ
14952 * s/ms-w32.h (fstat, stat, utime): Move redirections to
14953 "emacs"-only part.
14954
a06776b2
EZ
14955 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
14956 initialization code to keep similarity to xfns.c after changes
14957 from 2011-11-05.
14958
c9e7db78
JD
149592011-11-05 Jan Djärv <jan.h.d@swipnet.se>
14960
a97f8f3f
JD
14961 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
14962 (unwind_create_frame): New function (Bug#9943).
14963 (Fx_create_frame): Restructure code to be more similar to the one in
14964 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
14965 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
14966 Move terminal->reference_count++ just before making the frame official
14967 (Bug#9943).
14968
14969 * nsterm.m (x_free_frame_resources): New function.
14970 (x_destroy_window): Move code to x_free_frame_resources.
14971
c9e7db78 14972 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
14973 (Fx_create_frame, x_create_tip_frame):
14974 Move terminal->reference_count++ just before making the frame
75f1671a 14975 official. Move initialization of image_cache_refcount and
c9e7db78
JD
14976 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
14977
a6fc3b5c
EZ
149782011-11-05 Eli Zaretskii <eliz@gnu.org>
14979
14980 Support MSVC build with newer versions of Visual Studio.
14981 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
14982 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
14983 nt/gmake.defs.
14984
14985 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
14986 which are not supported by MSVC.
14987 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
14988 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
14989 bitfields.
14990 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
14991 types in bitfields.
14992 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
14993
14994 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
14995
58179cce 149962011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
14997
14998 Support MSVC build with newer versions of Visual Studio.
14999 * w32.c: Don't include w32api.h for MSVC.
15000 (init_environment) [_MSC_VER]: Call sys_access, not _access.
15001
15002 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
15003 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
15004 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
15005 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
15006 e_* cousins.
15007 (alloca) [_MSC_VER]: Define to _alloca.
15008
15009 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
15010
15011 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
15012
a58c13ed
EZ
150132011-11-04 Eli Zaretskii <eliz@gnu.org>
15014
15015 * xdisp.c (note_mouse_highlight): If either of
15016 previous/next-single-property-change returns nil, treat that as
15017 the beginning or the end of the buffer. (Bug#9955)
15018
fe0b6370
JD
150192011-11-04 Jan Djärv <jan.h.d@swipnet.se>
15020
a58c13ed 15021 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
15022 label is not null (Bug#9951).
15023 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
15024 may be NULL.
15025
89bd5ee1
EZ
150262011-11-04 Eli Zaretskii <eliz@gnu.org>
15027
15028 * window.c (Fwindow_body_size): Mention in the doc string that the
15029 return value is in frame's canonical units. (Bug#9949)
15030
84c3edb9
EZ
150312011-11-03 Eli Zaretskii <eliz@gnu.org>
15032
4e2fb5c7
EZ
15033 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
15034
84c3edb9 15035 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 15036 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 15037 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 15038
bc17a887
EZ
150392011-11-01 Eli Zaretskii <eliz@gnu.org>
15040
15041 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
15042 Don't stop backward scan on the continuation glyph, even though
15043 its CHARPOS is positive.
6d5eb5b0
SM
15044 (mouse_face_from_buffer_pos, note_mouse_highlight):
15045 Rename cover_string to disp_string.
bc17a887 15046
4ee88440
MR
150472011-11-01 Martin Rudalics <rudalics@gmx.at>
15048
15049 * window.c (temp_output_buffer_show): Don't use
15050 Vtemp_buffer_show_specifiers.
15051 (Vtemp_buffer_show_specifiers): Remove unused variable.
15052
c2ff3c02
EZ
150532011-10-30 Eli Zaretskii <eliz@gnu.org>
15054
15055 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
15056 past the beginning of the current glyph matrix.
15057
58179cce 150582011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
15059
15060 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
15061 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
15062 HAVE_GTK3 (Bug#9869).
b77a6a7f 15063
3b574623
JD
15064 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
15065 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
15066
b77a6a7f
JD
15067 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
15068
15069 * xterm.c: Declare x_handle_net_wm_state to return int.
15070 (handle_one_xevent): Check if we are iconified but don't have
15071 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
15072 (get_current_wm_state): Return non-zero if not hidden,
15073 check for _NET_WM_STATE_HIDDEN (Bug#9893).
15074 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
15075 (x_handle_net_wm_state): Return what get_current_wm_state returns.
15076 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
15077
196e41e4
PE
150782011-10-29 Paul Eggert <eggert@cs.ucla.edu>
15079
15080 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
15081 so that this new function doesn't get optimized away by a
15082 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
15083
021f2e1a
AS
150842011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15085
15086 * frame.h (MOUSE_HL_INFO): Remove excess parens.
15087
8b058d44
EZ
150882011-10-29 Eli Zaretskii <eliz@gnu.org>
15089
15090 Fix the `xbytecode' command.
15091 * .gdbinit (xprintbytestr): New command.
b50a28de 15092 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
15093 (xbytecode): Print the byte-code string as well.
15094
4452fb80
EZ
150952011-10-29 Kim Storm <storm@cua.dk>
15096
8b058d44
EZ
15097 * alloc.c (which_symbols): New function.
15098
21b72067
AS
150992011-10-29 Andreas Schwab <schwab@linux-m68k.org>
15100
15101 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
15102 line. (Bug#9903)
15103
83ed7b5c
GM
151042011-10-29 Glenn Morris <rgm@gnu.org>
15105
15106 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
15107 Not clear what it was for, and it causes various bugs. (Bug#9839)
15108
5a7a728b
EZ
151092011-10-28 Eli Zaretskii <eliz@gnu.org>
15110
15111 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
15112 possible random value that matches one of those tested as
15113 condition to clear the mouse face.
15114
d3d0842f
CY
151152011-10-28 Chong Yidong <cyd@gnu.org>
15116
15117 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
15118
31b39d13
DN
151192011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
15120
15121 * window.c (make_window): Initialize phys_cursor_on_p.
15122
9aba6043
SM
151232011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
15124
15125 * lisp.h (struct Lisp_Symbol): Update comments.
15126
c20992f4
JB
151272011-10-28 Juanma Barranquero <lekktu@gmail.com>
15128
15129 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
15130
db4f02f2
EZ
151312011-10-28 Eli Zaretskii <eliz@gnu.org>
15132
15133 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
15134 <oslsachem@gmail.com> for helping to debug this.
15135
15136 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
15137 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
15138 (g_b_init_get_glyph_outline_w): New static variables.
15139 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
15140 (GetGlyphOutlineW_Proc): New typedefs.
15141 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
15142 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
15143 New functions.
15144 (w32font_open_internal, compute_metrics):
15145 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
15146 instead of calling the "wide" APIs directly.
15147
15148 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
15149
15150 * w32.h (syms_of_w32font): Add prototype.
15151
87e68db4
JB
151522011-10-27 Juanma Barranquero <lekktu@gmail.com>
15153
15154 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
15155 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
15156 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
15157 (Fmove_to_window_line): Doc fix.
15158
435c1d67
CY
151592011-10-27 Chong Yidong <cyd@gnu.org>
15160
15161 * process.c (make_process): Set gnutls_state to NULL.
15162
15163 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
15164 non-NULL, regardless of GNUTLS_INITSTAGE.
15165 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
15166 an error. Set process slots as soon as we allocate them.
15167
15168 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
15169
9c6c6f49
CY
151702011-10-27 Chong Yidong <cyd@gnu.org>
15171
9aba6043
SM
15172 * gnutls.c (emacs_gnutls_deinit): New function.
15173 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
15174 (Fgnutls_deinit, Fgnutls_boot): Use it.
15175
15176 * process.c (make_process): Initialize GnuTLS credentials to NULL.
15177 (deactivate_process): Call emacs_gnutls_deinit.
15178
657d08d3
JB
151792011-10-27 Juanma Barranquero <lekktu@gmail.com>
15180
15181 * image.c (x_create_x_image_and_pixmap):
15182 * w32.c (sys_rename, w32_delayed_load):
15183 * w32font.c (fill_in_logfont):
15184 * w32reg.c (x_get_string_resource): Silence compiler warnings.
15185
5430d399
JB
151862011-10-26 Juanma Barranquero <lekktu@gmail.com>
15187
15188 * w32fns.c (w32_default_color_map): New function,
15189 extracted from Fw32_default_color_map.
a7ef684b 15190 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 15191
fe0055fa
PE
151922011-10-25 Paul Eggert <eggert@cs.ucla.edu>
15193
15194 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
15195
e6346438
SM
151962011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
15197
15198 * keyboard.c (test_undefined): New function (bug#9751).
15199 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
15200
e112cc37
ET
152012011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
15202
15203 * sysdep.c (init_sys_modes): Fix the check for the controlling
15204 terminal (Bug#6649).
15205
7b5d6677
EZ
152062011-10-20 Eli Zaretskii <eliz@gnu.org>
15207
15208 * dispextern.h (struct bidi_it): New member next_en_type.
15209
15210 * bidi.c (bidi_line_init): Initialize the next_en_type member.
15211 (bidi_resolve_explicit_1): When next_en_pos is valid for the
15212 current character, check also for next_en_type being WEAK_EN.
15213 (bidi_resolve_weak): Don't enter the expensive loop if the current
15214 position is before next_en_pos. Record the bidi type of the first
15215 non-ET, non-BN character we find, in addition to its position.
15216 (bidi_level_of_next_char): Invalidate next_en_type when
15217 next_en_pos is over-stepped.
15218
7da0b018
PE
152192011-10-20 Paul Eggert <eggert@cs.ucla.edu>
15220
15221 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
15222 * editfns.c: Rewrite current-time-zone so that it invokes
15223 the equivalent of (format-time-string "%Z") to get the time zone name.
15224 This fixes a bug when the time zone name contains characters that
15225 need converting from the system time locale to Emacs internal format.
15226 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
15227 that patch fixed format-time-string to do the conversion, but
15228 I forgot to fix current-time-zone.
15229 (format_time_string): New function, containing most of
15230 what Fformat_time_string used to contain.
15231 (Fformat_time_string): Rewrite in terms of format_time_string.
15232 This doesn't change this function's behavior.
15233 (current-time-zone): Rewrite to use format_time_string.
15234 This fixes the bug reported by Michael Schierl in
15235 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
15236 Jason Rumney's 2007-06-07 change worked around this bug, but
15237 didn't fix it.
15238 * systime.h (tzname, timezone): Remove no-longer-used declarations.
15239
8547b010
EZ
152402011-10-19 Eli Zaretskii <eliz@gnu.org>
15241
15242 * xdisp.c (start_display): If the character at POS is displayed
15243 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
15244 (try_window_reusing_current_matrix): If a line ends in a display
15245 vector or the next line starts in a display vector, continue
15246 redrawing the window even though the character position of
15247 start_row was reached.
8547b010
EZ
15248 (Bug#9771, part 2)
15249
4e948d15
CY
152502011-10-18 Chong Yidong <cyd@gnu.org>
15251
15252 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
15253 with nobreak-char-display too.
15254
4787455f
EZ
152552011-10-18 Eli Zaretskii <eliz@gnu.org>
15256
15257 Fix part 3 of bug#9771.
15258 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
15259 (bidi_resolve_neutral): Don't enter the expensive loop looking for
15260 non-neutral characters if the current character is a paragraph
15261 separator (a.k.a. Newline). This avoids running the same
15262 expensive loop twice, once when we consume the preceding newline
15263 and the other time when the line actually needs to be displayed.
15264 Avoid the loop when we see neutrals on the base embedding level
15265 following a character whose directionality is the same as the
15266 paragraph's. This avoids running the expensive loop when a line
15267 ends in a long sequence of neutrals, like control characters.
15268 Add assertion against STRONG_AL type. Slightly rearrange code
15269 that determines the type of a neutral given the first non-neutral
15270 that follows it.
15271 (bidi_level_of_next_char): Set next_en_pos to zero when
15272 invalidating its info.
15273
2c91f553
EZ
152742011-10-17 Eli Zaretskii <eliz@gnu.org>
15275
15276 * xdisp.c (push_display_prop): Determine whether to record string
15277 or buffer position by IT->string, not by IT->method. Allow
15278 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
15279 (move_it_vertically_backward): Don't look for character position
15280 immediately after the newline when in a continuation line.
15281 (Bug#9771, part 1)
2c91f553 15282
c7b08b0d
MR
152832011-10-15 Martin Rudalics <rudalics@gmx.at>
15284
15285 * window.c (coordinates_in_window): Rewrite and delabelize
15286 vertical border check. (Bug#5357) (Bug#9618)
15287
6b02f655
SM
152882011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
15289
15290 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
15291 errors in XSetWindowBorder (bug#9310).
15292
81d40c92
DA
152932011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
15294
15295 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
15296 avoid crash when xmalloc overrun checking is enabled.
15297
d4172c3b
EZ
152982011-10-13 Eli Zaretskii <eliz@gnu.org>
15299
15300 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
15301 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
15302 cursor motion with <left> and <right> arrow keys.
15303
15304 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
15305 some callers set that themselves.
15306
b00eea75
EZ
153072011-10-12 Eli Zaretskii <eliz@gnu.org>
15308
15309 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
15310 display string and the previous row comes from the same string and
15311 is empty. (Bug#9739) (Bug#9738)
15312
8fe012c4
SM
153132011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
15314
15315 * doc.c (get_doc_string): Encode file name (bug#9735).
15316
0074aef2
EZ
153172011-10-12 Eli Zaretskii <eliz@gnu.org>
15318
79beb178
EZ
15319 * bidi.c (bidi_level_of_next_char):
15320 * xdisp.c (get_visually_first_element): Remove old incorrect
15321 comments regarding the Unicode Line Separator character.
15322
0074aef2
EZ
15323 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
15324
6e4b3fbe
DA
153252011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
15326
15327 * alloc.c (Fgc_status): Do not access beyond zombies array
15328 boundary if nzombies > MAX_ZOMBIES.
15329 * alloc.c (dump_zombies): Add missing format specifier.
15330
0324f3af
PE
153312011-10-12 Paul Eggert <eggert@cs.ucla.edu>
15332
b5525cac
PE
15333 * xdisp.c (set_cursor_from_row): Simplify conditionals,
15334 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
15335
0324f3af
PE
15336 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
15337 Some packages use them to denote characters with modifiers.
15338
e9b5f888
AS
153392011-10-11 Andreas Schwab <schwab@linux-m68k.org>
15340
15341 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
15342 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
15343 matching a pp-number. Rename parameter var to var1.
15344
127827c0
SM
153452011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
15346
15347 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
15348
c8fd3bd0
GM
153492011-10-08 Glenn Morris <rgm@gnu.org>
15350
15351 * callint.c (Fcall_interactively): Give a more explicit error for the
15352 'c' case with a non-character input. (Bug#8479)
15353
352ec8ff
EZ
153542011-10-08 Eli Zaretskii <eliz@gnu.org>
15355
03669ccb
EZ
15356 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
15357 lines.
7061c986
EZ
15358 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
15359 lines that are hscrolled on the left.
03669ccb 15360
352ec8ff
EZ
15361 * dispnew.c (buffer_posn_from_coords): Account for a possible
15362 presence of header-line. (Bug#4426)
15363
a66cfb1c
SM
153642011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
15365
6b02f655
SM
15366 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
15367 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 15368
7c5ee88e
PE
153692011-10-07 Paul Eggert <eggert@cs.ucla.edu>
15370
15371 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
15372 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
15373 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
15374 this makes Emacs dump core during garbage collection on rare
15375 occasions. sizeof is obviously inferior to offsetof here, so
15376 stick with offsetof.
15377 (GC_POINTER_ALIGNMENT): New macro.
15378 (mark_memory): Omit 3rd (offset) arg; caller changed.
15379 Don't assume EMACS_INT alignment is the same as pointer alignment.
15380
df1bbe5b
SM
153812011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
15382
15383 * keyboard.c (read_key_sequence_remapped): New var.
15384 (read_key_sequence): Compute remapping in the right buffer.
15385 (command_loop_1): Use read_key_sequence's remapping directly.
15386
51553db6
SM
153872011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
15388
32c1fffd
SM
15389 * dired.c (file_name_completion): Don't expand file name.
15390 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
15391 before checking file name handler.
15392
51553db6
SM
15393 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
15394 they've been requested explicitly (bug#9591).
15395
b6bd1599 153962011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
15397
15398 * keymap.c (Fsingle_key_description): Use make_specified_string
15399 instead of build_string to build string from push_key_description.
15400 (Bug#5193)
15401
f701dc2a
PE
154022011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15403
4222c55d
PE
15404 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
15405 This fixes a Y2038 bug on 64-bit hosts.
15406 * buffer.c (reset_buffer):
15407 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
15408 (Fclear_buffer_auto_save_failure):
15409 Use 0, not -1, to represent an unset failure time, since time_t
15410 might not be signed.
15411
f701dc2a
PE
15412 Remove dependency on glibc malloc internals.
15413 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15414 Move back here from lisp.h, but with their new implementations.
15415 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15416 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
15417 * charset.c (charset_table_init): New static var.
15418 (syms_of_charset): Use it instead of xmalloc. This removes a
15419 dependency on glibc malloc internals. See Eli Zaretskii's comment in
15420 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
15421 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15422 Move back to alloc.c.
15423 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15424 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
15425
9ceebf39
JD
154262011-09-30 Jan Djärv <jan.h.d@swipnet.se>
15427
15428 * nsterm.m (windowDidResize): Call x_set_window_size only when
15429 ns_in_resize is true. Otherwise set pixelwidth/height and
15430 call change_frame_size (Bug#9628).
15431
cb993c58
PE
154322011-09-30 Paul Eggert <eggert@cs.ucla.edu>
15433
3930c88b
PE
15434 Port --enable-checking=all to Fedora 14 x86-64.
15435 * charset.c (syms_of_charset): Also account for glibc malloc's
15436 internal overhead when calculating the initial malloc maximum.
15437
cb993c58
PE
15438 Port --enable-checking=all to Fedora 14 x86.
15439 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15440 Move to lisp.h.
15441 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
15442 (overrun_check_realloc, overrun_check_free):
15443 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
15444 That way, xmalloc returns a properly-aligned pointer even if
15445 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
15446 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
15447 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
15448 into account when calculating the initial malloc maximum.
15449 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
15450 Move here from alloc.c, so that charset.c can use it too.
15451 Properly align; the old code wasn't right for common 32-bit hosts
15452 when configured with --enable-checking=all.
15453 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
15454 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
15455
31bed486
EZ
154562011-09-29 Eli Zaretskii <eliz@gnu.org>
15457
04c70788 15458 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
15459 use EDOM.
15460
fbcaa2f3
EZ
154612011-09-28 Eli Zaretskii <eliz@gnu.org>
15462
15463 * xdisp.c (compute_display_string_end): If there's no display
15464 string at CHARPOS, return -1.
15465
15466 * bidi.c (bidi_fetch_char): When compute_display_string_end
15467 returns a negative value, treat the character as a normal
15468 character not covered by a display string. (Bug#9624)
15469
a239d4e9
JB
154702011-09-28 Juanma Barranquero <lekktu@gmail.com>
15471
15472 * lread.c (Fread_from_string): Fix typo in docstring.
15473
88652fd5
EZ
154742011-09-27 Eli Zaretskii <eliz@gnu.org>
15475
15476 * xdisp.c (handle_invisible_prop): If invisible text ends on a
15477 newline, reseat the iterator instead of bidi-iterating there one
15478 character at a time. (Bug#9610)
32c1fffd
SM
15479 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
15480 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 15481
ed497dd4
AS
154822011-09-27 Andreas Schwab <schwab@linux-m68k.org>
15483
15484 * lread.c (readevalloop): Use correct code for NBSP.
15485 (read1): Likewise. (Bug#9608)
15486
b2bf61aa
MA
154872011-09-25 Michael Albinus <michael.albinus@gmx.de>
15488
15489 * dbusbind.c (Fdbus_register_signal): When service is not
15490 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
15491
32bbb17c
GM
154922011-09-25 Glenn Morris <rgm@gnu.org>
15493
15494 * buffer.c (truncate-lines): Doc fix.
15495
94e0933e
CY
154962011-09-24 Chong Yidong <cyd@stupidchicken.com>
15497
15498 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
15499 (Fset_window_next_buffers): Doc fix.
15500
cddde921
GM
155012011-09-24 Glenn Morris <rgm@gnu.org>
15502
15503 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
15504
1260aef1
PE
155052011-09-24 Paul Eggert <eggert@cs.ucla.edu>
15506
25b4bfa0
PE
15507 Fix minor problems found by static checking.
15508 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
15509 * indent.c (Fvertical_motion): Fix == vs = typo.
15510
e3cbd34b
EZ
155112011-09-24 Eli Zaretskii <eliz@gnu.org>
15512
a66cfb1c
SM
15513 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
15514 Default value is now t. Doc fix.
6bf7006f 15515
e3cbd34b 15516 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 15517 logic when moving up, not only when moving down. Fix the
e3cbd34b 15518 confusing name and values of the it_overshoot_expected variable;
32c1fffd 15519 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
15520
15521 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
15522 CHARPOS is covered by a display string which includes newlines.
15523 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
15524 is covered by a display string with embedded newlines.
15525
a3de0cbd
MA
155262011-09-24 Michael Albinus <michael.albinus@gmx.de>
15527
15528 * dbusbind.c (Fdbus_register_signal): Add match rule to
15529 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
15530 (Fdbus_register_method, Vdbus_registered_objects_table):
15531 Fix docstring.
a3de0cbd 15532
b260039d
JM
155332011-09-24 Jim Meyering <meyering@redhat.com>
15534
32c1fffd 15535 do not ignore write error for any output size
b260039d
JM
15536 The previous change was incomplete.
15537 While it makes emacs --batch detect the vast majority of stdout
15538 write failures, errors were still ignored whenever the output size is
15539 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
15540 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
15541 && echo FAIL: ignored write error
15542 FAIL: ignored write error
15543 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
15544 && echo FAIL: ignored write error
15545 FAIL: ignored write error
15546 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
15547
8eca8a7c
AS
155482011-09-23 Andreas Schwab <schwab@linux-m68k.org>
15549
15550 * emacs.c (Fkill_emacs): In noninteractive mode exit
15551 non-successfully if a write error occurred on stdout. (Bug#9574)
15552
3341db62
EZ
155532011-09-21 Eli Zaretskii <eliz@gnu.org>
15554
15555 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
15556 the xassert test.
15557
15558 * dispextern.h (struct it): Update the comment documenting what
15559 can it->OBJECT be.
15560
8c203dbf
EZ
155612011-09-20 Eli Zaretskii <eliz@gnu.org>
15562
15563 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
15564 a display string, extend search for cursor position to end of row.
15565 (find_row_edges): If the row ends in a newline from a display
15566 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
15567 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
15568 (Fcurrent_bidi_paragraph_direction): Fix search for previous
15569 non-empty line. Fixes confusing cursor motion with arrow keys at
15570 the beginning of a line that starts with whitespace.
8c203dbf 15571
a4824228
LMI
155722011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
15573
15574 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
15575 (bug#9493).
15576
33ed493b
CY
155772011-09-18 Chong Yidong <cyd@stupidchicken.com>
15578
15579 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
15580 boolean (Bug#9154).
15581
56cd55c8
EZ
155822011-09-18 Eli Zaretskii <eliz@gnu.org>
15583
15584 * xdisp.c (display_line): Record maximum and minimum buffer
15585 positions even if no glyphs were produced (e.g., by a zero-width
15586 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
15587 buffer positions that will be removed from the glyph row because
15588 they don't fit.
c02dcedf
EZ
15589 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
15590 column is beyond frame width: don't subtract 1 "pixel" when
15591 computing width of the stretch.
3e62b7e0
EZ
15592 (reseat_at_next_visible_line_start): Undo the change made on
15593 2011-09-17 that saved paragraph information and restored it after
15594 the call to `reseat'. (Bug#9545)
56cd55c8 15595
5ed99d36 155962011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
15597
15598 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
15599 and turn window cursor on if cleared (Bug#9415).
15600
5ed99d36 156012011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
15602
15603 * search.c (boyer_moore): Take unibyte characters from pattern
15604 literally. (Bug#9458)
15605
9bade7b2
EZ
156062011-09-18 Eli Zaretskii <eliz@gnu.org>
15607
15608 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
15609
e5e9d610
PE
156102011-09-18 Paul Eggert <eggert@cs.ucla.edu>
15611
87e4427a
PE
15612 Fix minor problem found by static checking.
15613 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
15614 initialized, to pacify gcc -Wuninitialized.
15615
e5e9d610
PE
15616 * fileio.c: Report proper errno when syscall falls.
15617 (Finsert_file_contents): Save and restore errno,
15618 so that report_file_error outputs the correct diagnostic.
15619 (Fwrite_region) [CLASH_DETECTION]: Likewise.
15620
a1674f0b
EZ
156212011-09-18 Eli Zaretskii <eliz@gnu.org>
15622
15623 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
15624
fbfb6dd4
EZ
156252011-09-17 Eli Zaretskii <eliz@gnu.org>
15626
15627 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
15628 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
15629
bb187662
EZ
156302011-09-17 Eli Zaretskii <eliz@gnu.org>
15631
1137e8b8 15632 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 15633 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
15634
15635 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
15636 (bidi_find_paragraph_start): Search back for paragraph beginning
15637 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
15638 (bidi_move_to_visually_next): Only trigger paragraph-related
15639 computations when the last character is a newline or at EOB, not
15640 just any NEUTRAL_B. (Bug#9470)
15641
bb187662
EZ
15642 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
15643 truncated lines if point is covered by a display string. (Bug#9524)
15644
2e621251
PE
156452011-09-16 Paul Eggert <eggert@cs.ucla.edu>
15646
15647 * xselect.c: Relax test for outgoing X longs (Bug#9498).
15648 (cons_to_x_long): New function.
15649 (lisp_data_to_selection_data): Use it. Correct the test for
15650 short-versus-long data; it was negated. Break out of vector
15651 loop, for efficiency, when a long datum is discovered.
15652
91a15bc6
SM
156532011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
15654
15655 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
15656
b41c3a35
EZ
156572011-09-16 Eli Zaretskii <eliz@gnu.org>
15658
15659 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
15660 GCC PR/17406) by declaring this function with external scope.
15661
7812ba2d
PE
156622011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15663
15664 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
15665 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
15666
cf7edc2a
AS
156672011-09-15 Andreas Schwab <schwab@linux-m68k.org>
15668
15669 * editfns.c (Fformat): Correctly handle text properties on "%%".
15670
bd01620e
EZ
156712011-09-15 Eli Zaretskii <eliz@gnu.org>
15672
15673 * xterm.c (x_draw_composite_glyph_string_foreground):
15674 * w32term.c (x_draw_composite_glyph_string_foreground):
15675 * term.c (encode_terminal_code):
15676 * composite.c (composition_update_it, get_composition_id):
15677 * xdisp.c (get_next_display_element)
15678 (fill_composite_glyph_string): Add comments about special meaning
15679 of TAB characters in a composition.
15680
a02719a3
PE
156812011-09-15 Paul Eggert <eggert@cs.ucla.edu>
15682
15683 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
15684 This occurs when processing a multibyte format.
15685 Problem reported by Wolfgang Jenker.
a02719a3 15686
72589a3c
JB
156872011-09-15 Johan Bockgård <bojohan@gnu.org>
15688
15689 * xdisp.c (try_cursor_movement): Only check for exact match if
15690 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
15691
1c14176c
PE
156922011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15693
15694 Remove unused external symbols.
15695 * dispextern.h (calc_pixel_width_or_height): Remove decl.
15696 * xdisp.c (calc_pixel_width_or_height): Now static.
15697 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
15698 * indent.c (check_display_width):
15699 * w32term.c: Fix comment to match code.
15700 * xterm.c, xterm.h (x_catching_errors): Remove.
15701
d2eea5b5
PE
157022011-09-14 Paul Eggert <eggert@cs.ucla.edu>
15703
15704 * xselect.c: Use signed conversions more consistently (Bug#9498).
15705 (selection_data_to_lisp_data): Assume incoming selection data are
15706 signed integers, not unsigned. This is to be consistent with
15707 outgoing selection data, which was modified to use signed integers
15708 in as part of the fix to Bug#9196 in response to Jan D.'s comment
15709 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
15710 expects long, not unsigned long.
15711
46888499
EZ
157122011-09-14 Eli Zaretskii <eliz@gnu.org>
15713
15714 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
15715 computation of loop end. Reported by Johan Bockgård
15716 <bojohan@gnu.org>.
15717
ef8ef9fb
CY
157182011-09-13 Chong Yidong <cyd@stupidchicken.com>
15719
15720 * frame.c (Fother_visible_frames_p): Function deleted.
15721
fa819fed
EZ
157222011-09-12 Eli Zaretskii <eliz@gnu.org>
15723
15724 * indent.c (compute_motion): Process display vector front to back
15725 rather than the other way around. (Bug#2496)
15726
2ba8e008
SM
157272011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
15728
15729 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
15730
20f53c69
CY
157312011-09-11 Chong Yidong <cyd@stupidchicken.com>
15732
15733 * minibuf.c (Fread_from_minibuffer): Doc fix.
15734
d562d7a4
EZ
157352011-09-11 Eli Zaretskii <eliz@gnu.org>
15736
15737 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
15738 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
15739
1c4d7f3d
LMI
157402011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
15741
15742 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
15743 value for non-existent files.
15744
b885bf36
EZ
157452011-09-11 Eli Zaretskii <eliz@gnu.org>
15746
15747 * fileio.c (Finsert_file_contents): If the file cannot be opened,
15748 set its "size" to -1. This will set the modtime_size field of
15749 the corresponding buffer to -1, which is what
15750 verify-visited-file-modtime expects for files that do not exist.
15751 (Bug#9139)
15752
6612f0bf
PE
157532011-09-11 Paul Eggert <eggert@cs.ucla.edu>
15754
15755 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
15756 here ...
15757 * lisp.h: ... from here. push_key_description is no longer
15758 defined in keyboard.c, so its declaration should not be in
15759 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
15760 logically belongs with push_key_description.
15761
dfb3f755
PE
157622011-09-10 Paul Eggert <eggert@cs.ucla.edu>
15763
15764 * buffer.h: Include <sys/types.h> instead of <time.h>.
15765 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
15766 Problem reported by Herbert J. Skuhra.
15767
3134906c
LMI
157682011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
15769
15770 * xml.c (parse_region): Make the parsing work for
15771 non-comment-starting XML files again (bug#9144).
15772
8d903f4e
AS
157732011-09-10 Andreas Schwab <schwab@linux-m68k.org>
15774
15775 * image.c (gif_load): Fix calculation of bottom and right corner.
15776 (Bug#9468)
15777
80ad64f4
EZ
157782011-09-10 Eli Zaretskii <eliz@gnu.org>
15779
15780 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
15781 redisplay in small windows.
15782
208a048d
EZ
157832011-09-09 Eli Zaretskii <eliz@gnu.org>
15784
15785 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
15786
9b1c252e
MR
157872011-09-08 Martin Rudalics <rudalics@gmx.at>
15788
15789 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
15790 Operate on live windows only.
15791
2949f33b
JB
157922011-09-08 Juanma Barranquero <lekktu@gmail.com>
15793
15794 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
15795
e08dcafd
EZ
157962011-09-07 Eli Zaretskii <eliz@gnu.org>
15797
15798 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
15799 only under bidi iteration.
15800
115b96bd
JD
158012011-09-07 Jan Djärv <jan.h.d@swipnet.se>
15802
15803 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
15804
c8199d0f
PE
158052011-09-06 Paul Eggert <eggert@cs.ucla.edu>
15806
15807 isnan: Fix porting problem to Solaris 10 with bundled gcc.
15808 Without this fix, the command to link temacs failed due to an
15809 undefined symbol __builtin_isnan. This is because
15810 /usr/include/iso/math_c99.h #defines isnan(x) to
15811 __builtin_isnan(x), but the bundled gcc, which identifies itself
15812 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
15813 a __builtin_isnan.
15814 * floatfns.c (isnan): #undef, and then #define to a clone of
15815 what's in data.c.
15816 (Fisnan): Always define, since it's always available now.
15817 (syms_of_floatfns): Always define isnan at the Lisp level.
15818
e39b275c 158192011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
15820
15821 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
15822
b2db44d9 158232011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 15824
f4af5137 15825 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
15826 The previous code assumed that file offsets (off_t values) fit in
15827 EMACS_INT variables, which is not true on typical 32-bit hosts.
15828 The code messed up by falsely reporting buffer overflow in cases
15829 such as (insert-file-contents "big" nil 1 2) into an empty buffer
15830 when "big" contains more than 2**29 bytes, even though this
15831 inserts just one byte and does not overflow the buffer.
15832 (Finsert_file_contents): Store file offsets as off_t
15833 values, not as EMACS_INT values. Check for overflow when
15834 converting between EMACS_INT and off_t. When checking for
15835 buffer overflow or for overlap, take the offsets into account.
15836 Don't use EMACS_INT for small values where int suffices.
15837 When checking for overlap, fix a typo: ZV was used where
15838 ZV_BYTE was intended.
15839 (Fwrite_region): Don't assume off_t fits into 'long'.
15840 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
15841
ecfc0a49
MA
158422011-09-05 Michael Albinus <michael.albinus@gmx.de>
15843
15844 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
15845
6511acf2 158462011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 15847
0999621a 15848 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
15849
15850 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 15851 (esprintf, exprintf, evxprintf): New functions.
62f19c19 15852 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 15853 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
15854 (modify_event_symbol): Do not assume that the length of
15855 name_alist_or_stem is safe to alloca and fits in int.
15856 (Fexecute_extended_command): Likewise for function name and binding.
15857 (Frecursion_depth): Wrap around reliably on integer overflow.
15858 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
15859 since some callers pass EMACS_INT values.
15860 (Fsingle_key_description): Don't crash if symbol name contains more
15861 than MAX_ALLOCA bytes.
15862 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
15863 (get_minibuffer): Arg is now EMACS_INT, not int.
15864 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 15865 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
15866 * window.h (command_loop_level, minibuf_level): Reflect API changes.
15867
2be7d702
PE
15868 * dbusbind.c (signature_cat): New function.
15869 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
15870 Do not overrun buffer; instead, report string overflow.
15871
9d1df220
PE
15872 * dispnew.c (add_window_display_history): Don't overrun buffer.
15873 Truncate instead; this is OK since it's just a log.
15874
33ef5c64
PE
15875 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
15876 even if the time zone offset is outlandishly large.
15877 Don't mishandle offset == INT_MIN.
15878
66c6fdd5
PE
15879 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
15880 when creating daemon; the previous buffer-overflow check was incorrect.
15881
d749b01b
PE
15882 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
15883 which has the guts of the old verror function.
15884
b5cd1905
PE
15885 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
15886 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
15887
6e1a67fb
PE
15888 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
15889 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 15890 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 15891 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
15892 length of string rather than counting it via multiple sprintfs;
15893 that's simpler and more reliable.
c21721cc
PE
15894 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
15895 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
15896 sprintf, in case result does not fit in int.
15897
c57b67fc
PE
15898 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
15899 (fontset_from_font): Print it.
15900
8a401434
PE
15901 * frame.c (tty_frame_count): Now printmax_t, not int.
15902 (make_terminal_frame, set_term_frame_name): Print it.
15903 (x_report_frame_params): In X, window IDs are unsigned long,
15904 not signed long, so print them as unsigned.
15905 (validate_x_resource_name): Check for implausibly long names,
15906 and don't assume name length fits in 'int'.
15907 (x_get_resource_string): Don't blindly alloca invocation name;
15908 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
15909 not fit in int.
15910
6e1a67fb
PE
15911 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
15912 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
15913 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
15914
0df02bf3
PE
15915 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
15916 Use esprintf, not sprintf, in case result does not fit in int.
15917
48e30793
PE
15918 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15919 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
15920 it as a large positive number.
15921 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
15922 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
15923
a66ff6d8
PE
15924 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
15925 in case result does not fit in int.
15926
aca216ff
PE
15927 * print.c (float_to_string): Detect width overflow more reliably.
15928 (print_object): Make sprintf buffer a bit bigger, to avoid potential
15929 buffer overrun. Don't assume list length fits in 'int'. Treat
15930 print length of 0 as 0, not as infinity; to be consistent with other
15931 uses of print length in this function. Don't overflow print length
15932 index. Don't assume hash table size fits in 'long', or that
15933 vectorlike size fits in 'unsigned long'.
15934
31c286f7
PE
15935 * process.c (make_process): Use printmax_t, not int, to format
15936 process-name gensyms.
15937
55e5faa1
PE
15938 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
15939
80f2e268
PE
15940 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
15941 to avoid potential buffer overrun.
15942
670741ab
PE
15943 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
15944 if X resource line is longer than 512 bytes.
15945
b7163a50
PE
15946 * xfns.c (x_window): Make sprintf buffer a bit bigger
15947 to avoid potential buffer overrun.
15948
ae58ff1f
PE
15949 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
15950
c43c8a6a
PE
15951 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
15952
3f8236f4
PE
159532011-09-04 Paul Eggert <eggert@cs.ucla.edu>
15954
53e9fe90 15955 Integer overflow fixes for scrolling, etc.
6511acf2
PE
15956 Without these, Emacs silently mishandles large integers sometimes.
15957 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
15958 it were "C-u 1 M-x recenter" on a typical 64-bit host.
15959
6511acf2
PE
15960 * xdisp.c (try_window_id): Check Emacs fixnum range before
15961 converting to 'int'.
806add1d 15962
6511acf2 15963 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
15964 Check that an Emacs fixnum is in range before assigning it to 'int'.
15965 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
15966 values converted from Emacs fixnums.
15967 (Frecenter): Don't wrap around a line count if it is out of 'int'
15968 range; instead, treat it as an extreme value.
15969 (Fset_window_configuration, compare_window_configurations):
15970 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
15971
6511acf2
PE
15972 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
15973 that can exceed INT_MAX. Check that EMACS_INT value is in range
15974 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
15975 (match_limit): Don't assume that a fixnum can fit in 'int'.
15976
6511acf2 15977 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
15978 exceed INT_MAX.
15979
6511acf2 15980 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
15981 (Fvertical_motion): Don't wrap around LINES values that don't fit
15982 in 'int'. Instead, treat them as extreme values. This is good
15983 enough for windows, which can't have more than INT_MAX lines anyway.
15984
fcb901a7
LMI
159852011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
15986
0f2f6b6d
LMI
15987 * Require libxml/parser.h to avoid compilation warning.
15988
fcb901a7
LMI
15989 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
15990
15991 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
15992 since this reportedly can destroy thread storage.
15993
6e20a0d4
CY
159942011-08-30 Chong Yidong <cyd@stupidchicken.com>
15995
15996 * syntax.c (find_defun_start): Update all cache variables if
15997 exiting early (Bug#9401).
15998
148ae00e
EZ
159992011-08-30 Eli Zaretskii <eliz@gnu.org>
16000
f6cfbd8f
EZ
16001 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
16002
148ae00e
EZ
16003 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
16004 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
16005 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
16006
16007 * term.c (tty_append_glyph): New function.
16008 (produce_stretch_glyph): Static function and its prototype deleted.
16009
a66cfb1c
SM
16010 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
16011 Add prototypes.
148ae00e 16012
c4a07a4c
PE
160132011-08-29 Paul Eggert <eggert@cs.ucla.edu>
16014
16015 * image.c (parse_image_spec): Check for nonnegative, not for positive,
16016 when checking :margin (Bug#9390).
16017 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 16018 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
16019 so that the name doesn't mislead. All uses changed.
16020
6bc8cd65
JB
160212011-08-28 Johan Bockgård <bojohan@gnu.org>
16022
16023 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
16024 set_tty_hooks.
16025
dca4927e
EZ
160262011-08-27 Eli Zaretskii <eliz@gnu.org>
16027
16028 * xdisp.c (move_it_to): Don't bail out early when reaching
16029 position beyond to_charpos, if we are scanning backwards.
16030 (move_it_vertically_backward): When DY == 0, make sure we get to
16031 the first character in the line after the newline.
16032
f2cad773
PE
160332011-08-27 Paul Eggert <eggert@cs.ucla.edu>
16034
16035 * ccl.c: Improve and simplify overflow checking (Bug#9196).
16036 (ccl_driver): Do not generate an out-of-range pointer.
16037 (Fccl_execute_on_string): Remove unnecessary check for
16038 integer overflow, noted by Stefan Monnier in
16039 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
16040 Remove a FIXME that didn't need fixing.
16041 Simplify the newly-introduced buffer reallocation code.
16042
0cae2cdb
JB
160432011-08-27 Juanma Barranquero <lekktu@gmail.com>
16044
16045 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
16046
5fc295a4 160472011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 16048
70c60eb2 16049 Integer and memory overflow issues (Bug#9196).
726e0ab1 16050
d31850da
PE
16051 * doc.c (get_doc_string): Rework so that
16052 get_doc_string_buffer_size is the actual buffer size, rather than
16053 being 1 less than the actual buffer size; this makes xpalloc more
16054 convenient.
16055
a69fbedb
PE
16056 * image.c (x_allocate_bitmap_record, cache_image):
16057 * xselect.c (Fx_register_dnd_atom):
16058 Simplify previous changes by using xpalloc.
16059
fe5c5d37
PE
16060 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
16061 since either will do and ptrdiff_t is convenient with xpalloc.
16062
0065d054
PE
16063 * charset.c (charset_table_size)
16064 (struct charset_sort_data.priority): Now ptrdiff_t.
16065 (charset_compare): Don't overflow if priorities differ greatly.
16066 (Fsort_charsets): Don't assume list length fits in int.
16067 Check for size-calculation overflow when allocating sort data.
16068 (syms_of_charset): Allocate an initial charset table that is
16069 just under 64 KiB, to avoid problems with glibc malloc and mmap.
16070
16071 * cmds.c (internal_self_insert): Check for size-calculation overflow.
16072
16073 * composite.h (struct composition.glyph_len): Now int, not unsigned.
16074 The actual value is always <= INT_MAX, and leaving it unsigned made
16075 overflow checking harder.
16076
16077 * dispextern.h (struct glyph_matrix.rows_allocated)
16078 (struct face_cache.size): Now ptrdiff_t, for convenience in use
16079 with xpalloc. The values are still always <= INT_MAX.
16080
16081 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
16082
16083 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
16084 (SAFE_NALLOCA): New macro.
16085
16086 * region-cache.c (struct boundary.pos, find_cache_boundary)
16087 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
16088 (set_cache_region, invalidate_region_cache)
16089 (revalidate_region_cache, know_region_cache, region_cache_forward)
16090 (region_cache_backward, pp_cache):
16091 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
16092 so that ptrdiff_t * can be passed to xpalloc.
16093 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
16094 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
16095 (pp_cache): Don't assume cache_len fits in int.
16096 * region-cache.h: Adjust extern decls to match.
16097
16098 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
16099 EMACS_INT, since either will do, for xpalloc.
16100
16101 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
16102 (xnmalloc, xnrealloc, xpalloc): New functions.
16103
726e0ab1
PE
16104 * bidi.c (bidi_shelve_header_size): New constant.
16105 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
16106 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
16107
51f30bc5 16108 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
16109 * buffer.c (overlays_at, overlays_in, record_overlay_string)
16110 (overlay_strings):
16111 Don't update size of array until after memory allocation succeeds,
16112 because xmalloc/xrealloc may not return.
0065d054
PE
16113 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
16114 now that we have proper integer overflow checking.
16115 (record_overlay_string, overlay_strings): Catch overflows when
16116 calculating size of overlay_str_buf.
726e0ab1 16117
0065d054
PE
16118 * callproc.c (Fcall_process): Check for size overflow when
16119 calculating size of args2.
16120 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
16121 Normally we prefer signed values, but sticking with ptrdiff_t would
16122 require adding more-complicated checks.
726e0ab1
PE
16123
16124 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
16125 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
16126 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 16127 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
16128
16129 * character.c (Fstring): Check for size-calculation overflow.
16130
16131 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
16132 unnecessary integer overflow. Check for size overflow.
16133 (encode_coding_object): Don't update size until xmalloc succeeds.
16134
16135 * composite.c (get_composition_id): Check for overflow in glyph
16136 length calculations.
16137
16138 Integer and memory overflow fixes for display code.
16139 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
16140 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
16141 (scrolling_window): Check for overflow in size calculations.
16142 (line_draw_cost, realloc_glyph_pool, add_row_entry):
16143 Don't assume glyph table len fits in int.
16144 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
16145 (row_table_size): Now ptrdiff_t, not int.
16146 (scrolling_window): Avoid overflow in size calculations.
16147 Don't update size until allocation succeeds.
16148 * fns.c (concat): Check for overflow in size calculations.
16149 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
16150 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16151 (NEXT_ALMOST_PRIME_LIMIT): New constant.
16152
16153 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
16154 (get_doc_string): Check for size calculation overflow.
16155 Don't update size until allocation succeeds.
16156 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
16157 EMACS_INT, where ptrdiff_t will do.
16158 (Fsubstitute_command_keys): Check for string overflow.
16159
16160 * editfns.c (set_time_zone_rule): Don't assume environment length
16161 fits in int.
16162 (message_length): Now ptrdiff_t, not int.
16163 (Fmessage_box): Don't update size until allocation succeeds.
16164 Don't assume message length fits in int.
16165 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
16166
0065d054
PE
16167 * emacs.c (main): Do not reallocate argv, since there is a null at
16168 the end that can be overwritten, and this way there's no need to
16169 worry about size-calculation overflow.
16170 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
16171
16172 * eval.c (init_eval_once, grow_specpdl): Don't update size until
16173 alloc succeeds.
16174 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
16175
16176 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
16177 (x_set_scroll_bar_width, x_figure_window_size):
16178 Check for integer overflow.
16179 (x_set_alpha): Do not assume XINT fits in int.
16180
16181 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
16182 This is for the members text_lines, text_cols, total_lines, total_cols,
16183 where the system imposes an 'int' limit.
16184
16185 * fringe.c (Fdefine_fringe_bitmap):
16186 Don't update size until alloc works.
16187
16188 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
16189 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
16190
16191 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
16192 Check for size-calculation overflow.
16193 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
16194 do, as we prefer signed integers.
16195 (id_to_widget.max_size, id_to_widget.used)
16196 (xg_store_widget_in_map, xg_remove_widget_from_map)
16197 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
16198 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
16199 Use and return ptrdiff_t, not int.
16200 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
16201 * gtkutil.h: Change prototypes to match the above.
16202
16203 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
16204 are duplicate now that they've been promoted to lisp.h.
16205 (x_allocate_bitmap_record, x_alloc_image_color)
16206 (make_image_cache, cache_image, xpm_load):
16207 Don't update size until alloc is done.
16208 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
16209 (x_detect_edges):
3256efce 16210 Check for size calculation overflow.
726e0ab1
PE
16211 (ct_colors_allocated_max): New constant.
16212 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
16213 overflow.
3256efce 16214
726e0ab1
PE
16215 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
16216 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
16217 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
16218 Use ptrdiff_t, not int, to count maps.
16219 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
16220 calculations. Don't update size until allocation succeeds.
16221 Redo calculations to avoid overflow.
726e0ab1
PE
16222 * keyboard.h: Change prototypes to match the above.
16223
16224 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
16225 to count maps.
16226 (current_minor_maps): Check for size calculation overflow.
16227 * keymap.h: Change prototypes to match the above.
16228
16229 * lread.c (read1, init_obarray): Don't update size until alloc done.
16230
16231 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
16232 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
16233
726e0ab1
PE
16234 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
16235 Now ptrdiff_t, not int.
16236 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
16237 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
16238
16239 * process.c (Fnetwork_interface_list): Check for overflow
16240 in size calculation.
16241
16242 * region-cache.c (move_cache_gap): Check for size calculation overflow.
16243
16244 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
16245 overflow. Don't bother calling xmalloc when xrealloc will do.
16246
16247 * search.c (Freplace_match): Check for size calculation overflow.
16248 (Fset_match_data): Don't assume list lengths fit in 'int'.
16249
16250 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
16251 for command line length. Do not attempt to address one before the
16252 beginning of an array, as that's not portable.
16253
16254 * term.c (max_frame_lines): Remove; unused.
16255 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
16256 not int.
16257 (encode_terminal_code, calculate_costs): Check for size
16258 calculation overflow.
16259 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
16260 table lengths and related sizes. Don't update size until alloc
16261 done. Redo calculations to avoid overflow.
16262 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
16263
16264 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
16265 subtracting pointers.
16266 (gobble_line): Check for overflow more carefully. Don't update size
16267 until alloc done.
16268
16269 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
16270 Don't update size until alloc done.
16271 Redo size calculations to avoid overflow.
16272 Check for size calculation overflow.
0065d054 16273 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
16274
16275 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
16276 Use ptrdiff_t, not int, for sizes.
16277 (store_mode_line_noprop_char): Don't update size until alloc done.
16278
0065d054
PE
16279 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
16280 Use ptrdiff_t, not int, for sizes.
16281 (Finternal_make_lisp_face, cache_face):
16282 Check for size calculation overflow.
16283 (cache_face): Treat size calculation overflows as if they were
16284 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
16285
16286 * xfns.c (x_encode_text, x_set_name_internal)
16287 (Fx_change_window_property): Use ptrdiff_t, not int, to count
16288 sizes, since they can exceed INT_MAX in size. Check for size
16289 calculation overflow.
16290
0065d054
PE
16291 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
16292 (xg_select): Check for size calculation overflow.
726e0ab1
PE
16293 Don't update size until alloc done.
16294
0065d054 16295 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 16296 as sprintf is limited to int lengths.
1d526e2f 16297
252c5ee1
PE
16298 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
16299 (X_LONG_MIN): New macros.
864d7ce7
PE
16300 Use them to make the following changes clearer.
16301 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
16302 This change doesn't affect the value now, but it may help remind
16303 future maintainers not to raise the value too much later.
16304 (SELECTION_QUANTUM): Remove, replacing with ...
16305 (selection_quantum): ... new function, which avoids overflow.
16306 All uses changed.
16307 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
16308 assumption that selection length fits in 'int'.
16309 (x_reply_selection_request, x_handle_selection_request)
16310 (x_get_window_property, receive_incremental_selection)
16311 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
16312 (lisp_data_to_selection_data, clean_local_selection_data):
16313 Use ptrdiff_t, not int, to record length of selection.
16314 (x_reply_selection_request, x_get_window_property)
16315 (receive_incremental_selection, x_property_data_to_lisp):
16316 Redo calculations to avoid overflow.
16317 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 16318 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
16319 something.
16320 (x_get_window_property, receive_incremental_selection)
16321 (lisp_data_to_selection_data, x_property_data_to_lisp):
16322 Check for size-calculation overflow.
16323 (x_get_window_property, receive_incremental_selection)
16324 (lisp_data_to_selection_data, Fx_register_dnd_atom):
16325 Don't store size until memory allocation succeeds.
16326 (x_get_window_property): Plug memory leak on memory exhaustion.
16327 Don't double-block input; malloc is safe here. Don't assume 2**34
16328 - 4 fits in unsigned long. Add an xassert to check
16329 XGetWindowProperty overflow. Be more careful about overflow
16330 calculations, and distinguish size from memory overflow better.
16331 (receive_incremental_selection): When tracing, don't assume
16332 unsigned int is less than INT_MAX.
16333 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
16334 harmful) conversions of unsigned short to int.
16335 (lisp_data_to_selection_data): Don't assume that integers
16336 in the range -65535 through -1 fit in an X unsigned short.
16337 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
16338 result parameters unless successful. Rely on cons_to_unsigned
16339 to report problems with elements; the old code wasn't right anyway.
16340 (x_check_property_data): Check for int overflow; we cannot use
16341 a wider type due to X limits.
16342 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
16343
726e0ab1 16344 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 16345
0065d054
PE
16346 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
16347 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
16348 (x_color_cells): Don't store size until memory allocation succeeds.
16349 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 16350 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
16351 (x_term_init): Don't assume length fits in int (sprintf is limited
16352 to int size).
bc18e09d 16353
ebfa62c0
PE
16354 Use ptrdiff_t for composition IDs.
16355 * character.c (lisp_string_width):
16356 * composite.c (composition_table_size, n_compositions)
16357 (get_composition_id, composition_gstring_from_id):
16358 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
16359 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
16360 * window.c (Frecenter):
16361 Use ptrdiff_t, not int, for composition IDs.
16362 * composite.c (get_composition_id): Check for integer overflow.
16363 * composite.h: Adjust prototypes to match the above changes.
16364
d3411f89
PE
16365 Use ptrdiff_t for hash table indexes.
16366 * category.c (hash_get_category_set):
16367 * ccl.c (ccl_driver):
16368 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
16369 * coding.c (coding_system_charset_list, detect_coding_system):
16370 * coding.h (struct coding_system.id):
16371 * composite.c (get_composition_id, gstring_lookup_cache):
16372 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
16373 * image.c (xpm_get_color_table_h):
16374 * lisp.h (hash_lookup, hash_put):
16375 * minibuf.c (Ftest_completion):
16376 Use ptrdiff_t for hash table indexes, not int (which is too
16377 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
16378 32-bit --with-wide-int hosts).
16379
e097a6fa
PE
16380 * charset.c (Fdefine_charset_internal): Check for integer overflow.
16381 Add a FIXME comment about memory leaks.
16382 (syms_of_charset): Don't assume xmalloc returns.
16383
5637687f
PE
16384 Don't assume that stated character widths fit in int.
16385 * character.c (Fchar_width, c_string_width, lisp_string_width):
16386 * character.h (CHAR_WIDTH):
16387 * indent.c (MULTIBYTE_BYTES_WIDTH):
16388 Use sanitize_char_width to avoid undefined and/or bad behavior
16389 with outlandish widths.
a66cfb1c 16390 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
16391 now that we have two such functions. All uses changed.
16392 (sanitize_char_width): New inline function.
16393
a2271ba2
PE
16394 Don't assume that tab-width fits in int.
16395 * character.h (sanitize_width): New inline function.
16396 (SANE_TAB_WIDTH): New macro.
16397 (ASCII_CHAR_WIDTH): Use it.
16398 * indent.c (sane_tab_width): Remove. All uses replaced by
16399 SANE_TAB_WIDTH (current_buffer).
16400 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
16401
18c52557
PE
16402 * fileio.c: Integer overflow issues with file modes.
16403 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
16404
caeeedc1
PE
16405 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
16406 Remove unreachable code.
16407 (read_hex, load_charset_map_from_file): Check for integer overflow.
16408
6df6ae42 16409 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
16410 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
16411 (x_send_scroll_bar_event): Likewise. Check that the size does not
16412 exceed limits imposed by XClientMessageEvent, as well as the usual
16413 ptrdiff_t and size_t limits.
16414
b13995db
PE
16415 * keyboard.c: Overflow, signedness and related fixes.
16416 (make_lispy_movement): Use same integer type in forward decl
16417 that is used in the definition.
16418 (read_key_sequence, keyremap_step):
16419 Change bufsize argument back to int, undoing my 2011-03-30 change.
16420 We prefer signed types, and int is wide enough here.
16421 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
16422 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
16423 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
16424 length, not size_t. Use ptrdiff_t for index, not int.
16425 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
16426 possibility of integer overflow.
16427
13464394
PE
16428 Overflow, signedness and related fixes for images.
16429
16430 * dispextern.h (struct it.stack[0].u.image.image_id)
16431 (struct_it.image_id, struct image.id, struct image_cache.size)
16432 (struct image_cache.used, struct image_cache.ref_count):
16433 * gtkutil.c (update_frame_tool_bar):
16434 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
16435 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
16436 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
16437 * nsmenu.m (update_frame_tool_bar):
16438 * xdisp.c (calc_pixel_width_or_height):
16439 * xfns.c (image_cache_refcount):
16440 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
16441 on typical 64-bit hosts.
16442
16443 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
16444 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
16445 Omit unnecessary casts to int.
16446 (parse_image_spec): Check that integers fall into 'int' range
16447 when the callers expect that.
16448 (image_ascent): Redo ascent calculation to avoid int overflow.
16449 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
16450 (lookup_image): Remove unnecessary tests.
16451 (xbm_image_p): Locals are now of int, not EMACS_INT,
16452 since parse_image_check makes sure they fit into int.
16453 (png_load, gif_load, svg_load_image):
16454 Prefer int to unsigned where either will do.
16455 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
16456 old tiff_error_handler and tiff_warning_handler.
16457 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
16458 stack buffer overflows. It uses only the features of vsnprintf
16459 that are common to both POSIX and native Microsoft.
16460 (tiff_error_handler, tiff_warning_handler): Use it.
16461 (tiff_load, gif_load, imagemagick_load_image):
16462 Don't assume :index value fits in 'int'.
16463 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
16464 (imagemagick_load_image): Check that crop parameters fit into
16465 the integer types that MagickCropImage accepts. Don't assume
16466 Vimagemagick_render_type has a nonnegative value. Don't assume
16467 size_t fits in 'long'.
16468 (gs_load): Use printmax_t to print the widest integers possible.
16469 Check for integer overflow when computing image height and width.
16470
c11821d4
EZ
164712011-08-26 Eli Zaretskii <eliz@gnu.org>
16472
16473 * xdisp.c (redisplay_window): Don't force window start if point
16474 will be invisible in the resulting window. (Bug#9324)
16475
0c95fcf7
EZ
164762011-08-25 Eli Zaretskii <eliz@gnu.org>
16477
16478 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
16479 the display spec is of the form `(space ...)'.
16480 (handle_display_spec): Return the value returned by
16481 handle_single_display_spec, not just 1 or zero.
16482 (handle_single_display_spec): If the display spec is of the form
16483 `(space ...)', and specifies display in the text area, return 2
16484 rather than 1.
fee65a97 16485 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
16486 accurately, and prefer exact match for point under bidi.
16487 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
16488
16489 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
16490 into disp_prop; all users changed.
16491
16492 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
16493 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
16494 for the text covered by the display property.
16495
e4ed06f1
CY
164962011-08-25 Chong Yidong <cyd@stupidchicken.com>
16497
16498 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
16499 Change return value to nil.
16500 (Frecord_buffer): Delete unused function.
16501
f67cdd7f
EZ
165022011-08-24 Eli Zaretskii <eliz@gnu.org>
16503
5980d4c6
EZ
16504 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
16505 buffers, return left-to-right.
8610fe8b
EZ
16506 (set_cursor_from_row): Consider candidate row a win if its glyph
16507 represents a newline and point is on that newline. Fixes cursor
16508 positioning on the newline at EOL of R2L text within L2R
16509 paragraph, and vice versa.
16510 (try_cursor_movement): Check continued rows, in addition to
16511 continuation rows. Fixes unwarranted scroll when point enters a
16512 continued line of R2L text within an L2R paragraph, or vice versa.
16513 (cursor_row_p): Consider the case of point being equal to
16514 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
16515 from the end of a short line to the beginning of a continued line
16516 of R2L text within L2R paragraph.
16517 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
16518 composed characters.
5980d4c6 16519
f67cdd7f
EZ
16520 * bidi.c (bidi_check_type): Use xassert.
16521 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
16522 members.
16523
bca633fb
EZ
165242011-08-23 Eli Zaretskii <eliz@gnu.org>
16525
16526 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
16527 a character.
16528
4a5885a7
CY
165292011-08-23 Chong Yidong <cyd@stupidchicken.com>
16530
16531 * nsfont.m (ns_otf_to_script): Fix typo.
16532
0902a04e
KH
165332011-08-22 Kenichi Handa <handa@m17n.org>
16534
16535 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
16536 extra slot even if the purpose is char-code-property-table.
16537
1a2e6670
EZ
165382011-08-23 Eli Zaretskii <eliz@gnu.org>
16539
8ddde651
EZ
16540 * xdisp.c (redisplay_window): When computing centering_position,
16541 account for the height of the header line. (Bug#8874)
16542
425cc014
EZ
16543 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
16544 instead of CHAR_TO_BYTE. Fixes a crash when a completion
16545 candidate is selected by the mouse, and that candidate has a
16546 composed character under the mouse.
16547
1a2e6670
EZ
16548 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
16549 coordinates reported by pos-visible-in-window-p for a composed
16550 character in column zero.
16551
8b76d6f8
SM
165522011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
16553
16554 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
16555
dac347dd
EZ
165562011-08-22 Eli Zaretskii <eliz@gnu.org>
16557
16558 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
16559 consider it a hit if to_charpos is anywhere in the range of the
16560 composed buffer positions.
16561
e013fb34
CY
165622011-08-22 Chong Yidong <cyd@stupidchicken.com>
16563
16564 * image.c (gif_load): Don't assume that each subimage has the same
16565 dimensions as the base image. Handle disposal method that is
16566 "undefined" by the gif spec (Bug#9335).
16567
bd1ba3e8
CY
165682011-08-20 Chong Yidong <cyd@stupidchicken.com>
16569
16570 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 16571 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 16572
54a1215b
EZ
165732011-08-19 Eli Zaretskii <eliz@gnu.org>
16574
823564e5
EZ
16575 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
16576 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
16577 from an Org mode buffer to a Speedbar frame.
16578
54a1215b
EZ
16579 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
16580 a composition, take its buffer position from IT->cmp_it.charpos.
16581 Fixes cursor positioning at the beginning of a line that begins
16582 with a composed character.
16583
9778ebcc
EZ
165842011-08-18 Eli Zaretskii <eliz@gnu.org>
16585
0be6ee06
EZ
16586 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
16587 character bidirectional type, use STRONG_L instead. Fixes crashes
16588 in a buffer produced by `describe-categories'.
16589
9778ebcc
EZ
16590 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
16591 members before the level stack, so they would be saved and
16592 restored when copying iterator state. Fixes incorrect reordering
16593 around TABs covered by display properties.
16594
156bffbe
AS
165952011-08-18 Andreas Schwab <schwab@linux-m68k.org>
16596
6b02f655 16597 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 16598
72ad093b
CY
165992011-08-17 Chong Yidong <cyd@stupidchicken.com>
16600
16601 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
16602 (internal_condition_case_2, internal_condition_case_n):
16603 Remove unnecessary aborts (Bug#9081).
72ad093b 16604
35774242
EZ
166052011-08-17 Eli Zaretskii <eliz@gnu.org>
16606
16607 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
16608 has no `load' handler, try opening the file locally. (Bug#9311)
16609
db76dd85
KB
166102011-08-16 Ken Brown <kbrown@cornell.edu>
16611
16612 * gmalloc.c: Expand comment.
16613
b215eee5
EZ
166142011-08-16 Eli Zaretskii <eliz@gnu.org>
16615
16616 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
16617 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
16618
a4579d33
KB
166192011-08-16 Ken Brown <kbrown@cornell.edu>
16620
16621 Fix memory allocation problems in Cygwin build (Bug#9273).
16622
16623 * unexcw.c ( __malloc_initialized): Declare external variable.
16624 (fixup_executable): Force the dumped emacs to reinitialize malloc.
16625
8b76d6f8
SM
16626 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
16627 New variables.
a4579d33
KB
16628 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
16629 dumped emacs.
16630 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
16631 in the static heap.
16632 [CYGWIN] (special_realloc): New function.
16633 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
16634 requests to realloc storage in the static heap.
16635
3ebec551
PE
166362011-08-15 Paul Eggert <eggert@cs.ucla.edu>
16637
16638 * bidi.c (bidi_initialize): Remove unused local.
16639
9fd8be00
EZ
166402011-08-15 Eli Zaretskii <eliz@gnu.org>
16641
6b02f655
SM
16642 * bidimirror.h:
16643 * biditype.h: Remove file.
16644 * makefile.w32-in ($(BLD)/bidi.$(O)):
16645 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
16646
16647 * dispextern.h: Fix a typo in the comment to bidi_type_t.
16648
16649 * chartab.c: Improve commentary for the uniprop_table API.
16650
32413314
EZ
16651 * bidi.c (bidi_paragraph_init): Support zero value of
16652 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
16653 (bidi_initialize): Use uniprop_table instead of including
16654 biditype.h and bidimirror.h.
32413314 16655
9fd8be00
EZ
16656 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
16657 coordinates of the iterator when restoring from ppos_it.
16658 (Bug#9296)
16659
5cf2b69b
KH
166602011-08-14 Kenichi Handa <handa@m17n.org>
16661
16662 * process.c (create_process): Call setup_process_coding_systems
72ad093b 16663 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 16664
daf17d00
EZ
166652011-08-14 Eli Zaretskii <eliz@gnu.org>
16666
16667 * xdisp.c (move_it_in_display_line_to): Don't invoke
16668 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
16669 ppos_it. Fixes vertical cursor motion when line beginning is
16670 covered by an image. (Bug#9296)
16671
08e3161a
JD
166722011-08-14 Jan Djärv <jan.h.d@swipnet.se>
16673
16674 * nsterm.h (ns_run_ascript): Declare.
16675 (NSAPP_DATA2_RUNASSCRIPT): Define.
16676
16677 * nsfns.m (as_script, as_result, as_status): New static variables.
16678 (ns_run_ascript): New function.
5e617bc2 16679 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
16680 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
16681 the event loop. Get status from as_status (Bug#7276).
16682
16683 * nsterm.m (sendEvent): If event is NSApplicationDefined and
16684 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
16685 the event loop (Bug#7276).
16686
a3720aa2
AS
166872011-08-14 Andreas Schwab <schwab@linux-m68k.org>
16688
16689 * gnutls.c (QCgnutls_bootprop_priority)
16690 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
16691 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
16692 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
16693 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
16694 (QCgnutls_bootprop_verify_hostname_error)
16695 (QCgnutls_bootprop_callbacks_verify): Rename from
16696 Qgnutls_bootprop_..., all uses changed.
16697
16698 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
16699 uses changed.
16700
0a0d27fb
PE
167012011-08-14 Paul Eggert <eggert@cs.ucla.edu>
16702
19d5c50c
PE
16703 * xfaces.c (Qframe_set_background_mode): Now static.
16704 * dispextern.h (Qframe_set_background_mode): Remove decl.
16705
0a0d27fb
PE
16706 * process.c (Fnetwork_interface_info): Declare local only if needed.
16707
377538cb
JD
167082011-08-13 Jan Djärv <jan.h.d@swipnet.se>
16709
16710 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
16711 (Fnetwork_interface_list): Allocate in increments of bytes instead
16712 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
16713 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
16714 sockaddr.
16715 (struct ifflag_def): notrailers is smart on OSX.
16716 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
16717 Get hardware address with getifaddrs if available.
16718
08fff70c
EZ
167192011-08-12 Eli Zaretskii <eliz@gnu.org>
16720
16721 * xdisp.c (iterate_out_of_display_property): xassert that
16722 IT->position is set to within IT->object's boundaries. Break from
16723 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
16724 when IT->position is set up wrongly due to some bug.
16725 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
16726 (push_display_prop): Allow GET_FROM_STRING as IT->method on
16727 entry. Force push_it to save on the stack the current
16728 buffer/string position, to be restored by pop_it. Fix flags in
16729 the iterator structure wrt the object coming from a display
16730 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
16731 properties. (Bug#9284)
16732
7be1c708 167332011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 16734
7be1c708
CY
16735 * fontset.c (fontset_get_font_group): Add proper type checks.
16736 (Bug#9172)
aac0c6e3 16737
7be1c708 167382011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 16739
7be1c708
CY
16740 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
16741 and LC_VERSION_MIN_MACOSX.
16742 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
16743 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 16744
97bb72a6
EZ
167452011-08-08 Eli Zaretskii <eliz@gnu.org>
16746
16747 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
16748 no-display-properties-and-no-overlays under bidi display.
16749 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 16750 properties and overlays.
97bb72a6 16751
d5617611
CY
167522011-08-08 Chong Yidong <cyd@stupidchicken.com>
16753
37e11a63
CY
16754 * editfns.c (Fset_time_zone_rule): Document relationship with the
16755 setenv function.
16756
d5617611
CY
16757 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
16758 the font entity extracted from the cache (Bug#8109).
16759
58872834
CY
167602011-08-07 Chong Yidong <cyd@stupidchicken.com>
16761
16762 * composite.c (autocmp_chars): Don't reset point. That is done by
16763 restore_point_unwind (Bug#5984).
16764
75bfc667
JL
167652011-08-07 Juri Linkov <juri@jurta.org>
16766
16767 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
16768 to show the arg `TIME' instead of `TIMEVAL'.
16769
d1410150
EZ
167702011-08-06 Eli Zaretskii <eliz@gnu.org>
16771
16772 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
16773 display property strides EOL and includes a newline, as in
16774 longlines-mode. (Bug#9254)
75b771e4
EZ
16775 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
16776 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
16777
16778 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
16779 is non-zero, even if the data buffer is NULL. Fixes a crash in
16780 vertical-motion with longlines-mode. (Bug#9254)
16781
35928349
EZ
167822011-08-05 Eli Zaretskii <eliz@gnu.org>
16783
ec7cc85b
EZ
16784 * bidi.c <bidi_cache_total_alloc>: Now static.
16785 (bidi_initialize): Initialize bidi_cache_total_alloc.
16786
8b76d6f8 16787 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
16788 cache. (Bug#9221)
16789
16790 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
16791 amount allocated this far in `bidi_cache_total_alloc'.
16792 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
16793 non-zero, only free the data buffer without restoring the cache
16794 contents. All callers changed.
16795
16796 * dispextern.h (bidi_unshelve_cache): Update prototype.
16797
16798 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
16799 (move_it_in_display_line, move_it_to)
16800 (move_it_vertically_backward, move_it_by_lines): Replace the call
16801 to xfree to an equivalent call to bidi_unshelve_cache.
16802 (move_it_in_display_line_to): Fix logic of returning
412b6358 16803 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 16804
e2e2423b
EZ
168052011-08-05 Eli Zaretskii <eliz@gnu.org>
16806
16807 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
16808 came from a string character with a `cursor' property. (Bug#9229)
16809
ae9e757a
JD
168102011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16811
16812 * Makefile.in (LIB_PTHREAD): New variable.
16813 (LIBES): Add LIB_PTHREAD (Bug#9216).
16814
16815 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
16816 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
16817
213bd7f2
AS
168182011-08-04 Andreas Schwab <schwab@linux-m68k.org>
16819
6b02f655 16820 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 16821
99aaf75f
JD
168222011-08-04 Jan Djärv <jan.h.d@swipnet.se>
16823
16824 * xterm.c (x_find_topmost_parent): New function.
16825 (x_set_frame_alpha): Find topmost parent window with
16826 x_find_topmost_parent and set the property there also (bug#9181).
16827 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
16828
c74e9d86
PE
168292011-08-04 Paul Eggert <eggert@cs.ucla.edu>
16830
16831 * callproc.c (Fcall_process): Avoid vfork clobbering
16832 the local vars buffer, coding_systems, current_dir.
16833
640c8776
SM
168342011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
16835
16836 * keymap.c (Fmake_composed_keymap): Move to subr.el.
16837
f26d0e4c
PE
168382011-08-03 Paul Eggert <eggert@cs.ucla.edu>
16839
8a10d76c
PE
16840 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
16841 so that it is not optimized away.
16842
f26d0e4c
PE
16843 * xdisp.c (compute_display_string_pos): Remove unused local.
16844
55439c61
EZ
168452011-08-02 Eli Zaretskii <eliz@gnu.org>
16846
16847 Fix slow cursor motion and scrolling in large buffers with
16848 selective display, like Org Mode buffers. (Bug#9218)
16849
16850 * dispextern.h (struct bidi_it): New member disp_prop_p.
16851
16852 * xdisp.c: Remove one-slot cache of display string positions.
16853 (compute_display_string_pos): Accept an additional argument
5e617bc2 16854 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
16855 for a display string or property. If found, set DISP_PROP_P
16856 non-zero.
16857
16858 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
16859 DISP_PROP_P, and pass it to compute_display_string_pos.
16860 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
16861 non-zero. All callers of bidi_fetch_char changed.
16862
fb33fa43
SM
168632011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
16864
16865 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
16866
b099e063
DM
168672010-12-03 Don March <don@ohspite.net>
16868
16869 * keymap.c (Fdefine_key): Fix non-prefix key error message when
16870 last character M-[char] is translated to ESC [char] (bug#7541).
16871
5cc7f7af
KH
168722011-08-02 Kenichi Handa <handa@m17n.org>
16873
d0fffa3f 16874 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
16875
16876 * chartab.c (uniprop_table): Make it non-static.
16877
525d5e6e
EZ
168782011-08-01 Eli Zaretskii <eliz@gnu.org>
16879
16880 * xdisp.c (forward_to_next_line_start): Accept additional argument
16881 BIDI_IT_PREV, and store into it the state of the bidi iterator had
16882 on the newline.
16883 (reseat_at_next_visible_line_start): Use the bidi iterator state
16884 returned by forward_to_next_line_start to restore the state of
16885 it->bidi_it after backing up to previous newline. (Bug#9212)
16886
31011111
AS
168872011-07-30 Andreas Schwab <schwab@linux-m68k.org>
16888
16889 * regex.c (re_comp): Protoize.
16890 (re_exec): Fix return type.
16891 (regexec): Fix type of `ret'. (Bug#9203)
16892
476371c4
PE
168932011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16894
e5d76069
PE
16895 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
16896 This is needed if max-image-size is a floating-point number.
16897
9a79b20c
AS
168982011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16899
16900 * print.c (print_object): Print empty symbol as ##.
16901
16902 * lread.c (read1): Read ## as empty symbol.
16903
d8c2fa78
AA
169042011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
16905
16906 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
16907 setting frame foreground color (Bug#9175).
16908 (x_set_background_color): Likewise.
16909
ffe57a7a
AA
16910 * nsmenu.m (-setText): Size tooltip dimensions precisely to
16911 contents (Bug#9176).
16912 (EmacsTooltip -init): Remove bezels and add shadows to
16913 tooltip windows.
16914
bf3492a5
AA
16915 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
16916 or scroll bar (Bug#8470).
16917
d55e9c53
AA
16918 * nsfont.m (nsfont_open): Remove assignment to voffset and
16919 unnecessary vars hshink, expand, hd, full_height, min_height.
16920 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
16921
16922 * nsterm.h (nsfont_info): Remove voffset field.
16923
d8c2fa78 169242011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
16925
16926 Implement strike-through and overline on NextStep (Bug#8863).
16927
16928 * nsfont.m (nsfont_open): Use underline position provided by font,
16929 instead of hard-coded value of 2.
16930 (nsfont_draw): Call ns_draw_text_decoration instead.
16931
16932 * nsterm.h: Add declaration for ns_draw_text_decoration.
16933
16934 * nsterm.m (ns_draw_text_decoration): New function for drawing
16935 underline, overline, and strike-through.
16936 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
16937 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 16938 accommodate underlining, etc.
4843aac3 16939
4cc60b9b
EZ
169402011-07-28 Eli Zaretskii <eliz@gnu.org>
16941
bc7ece87
EZ
16942 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
16943 default.
4cc60b9b 16944
476371c4
PE
169452011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16946
66606eea
PE
16947 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
16948 Without this fix, if a signal arrives just after memory fills up,
16949 'malloc' might be invoked reentrantly.
16950
476371c4
PE
16951 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
16952 In other words, assume that every image size is allowed, on non-X
16953 hosts. This assumption is probably wrong, but it lets Emacs compile.
16954
f3fcc40d
AS
169552011-07-28 Andreas Schwab <schwab@linux-m68k.org>
16956
16957 * regex.c (re_iswctype): Convert return values to boolean.
16958
350c992f
EZ
169592011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
16960
16961 * xdisp.c (compute_display_string_pos): Don't use cached display
16962 string position if the buffer had its restriction changed.
16963 (Bug#9184)
16964
5266b4bb
PE
169652011-07-28 Paul Eggert <eggert@cs.ucla.edu>
16966
16967 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
16968
2573a837 169692011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 16970
41f55ccd 16971 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 16972
39e378da
PE
16973 * bidi.c: Integer size and overflow fixes.
16974 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
16975 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
16976 (bidi_cache_find_level_change, bidi_cache_ensure_space)
16977 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
16978 (bidi_find_other_level_edge):
16979 Use ptrdiff_t instead of EMACS_INT where either will do.
16980 This works better on 32-bit hosts configured --with-wide-int.
16981 (bidi_cache_ensure_space): Check for size-calculation overflow.
16982 Use % rather than repeated addition, for better worst-case speed.
16983 Don't set bidi_cache_size until after xrealloc returns, because it
16984 might not return.
16985 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
16986 (bidi_cache_ensure_space): Also check that the bidi cache size
16987 does not exceed that of the largest Lisp string or buffer. See Eli
16988 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 16989
5e927815
PE
16990 * alloc.c (__malloc_size_t): Remove.
16991 All uses replaced by size_t. See Andreas Schwab's note
16992 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
16993
ca4aa935
PE
16994 * image.c: Improve checking for integer overflow.
16995 (check_image_size): Assume that f is nonnull, since
16996 it is always nonnull in practice. This is one less thing to
16997 worry about when checking for integer overflow later.
16998 (x_check_image_size): New function, which checks for integer
16999 overflow issues inside X.
17000 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
17001 This removes the need for a memory_full check.
17002 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
17003 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
17004 (xbm_read_bitmap_data): Change locals back to 'int', since
17005 their values must fit in 'int'.
17006 (xpm_load_image, png_load, tiff_load):
17007 Invoke x_create_x_image_and_pixmap earlier,
17008 to avoid much needless work if the image is too large.
17009 (tiff_load): Treat overly large images as if
17010 x_create_x_image_and_pixmap failed, not as malloc failures.
17011 (gs_load): Use x_check_image_size.
17012
5f8f9cc2
PE
17013 * gtkutil.c: Omit integer casts.
17014 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
17015 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
17016
5adf60bc
PE
17017 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
17018
c8907a93
PE
17019 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
17020 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
17021 would wrongly return t on a 64-bit host.
17022
e3c25c68
PE
17023 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
17024 The plain *_OVERFLOW macros run afoul of GCC bug 49705
17025 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
17026 and therefore cause GCC to emit a bogus diagnostic in some cases.
17027
3f791afe
PE
17028 * image.c: Integer signedness and overflow and related fixes.
17029 This is not an exhaustive set of fixes, but it's time to
17030 record what I've got.
17031 (lookup_pixel_color, check_image_size): Remove redundant decls.
17032 (check_image_size): Don't assume that arbitrary EMACS_INT values
17033 fit in 'int', or that arbitrary 'double' values fit in 'int'.
17034 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
17035 (tiff_load, imagemagick_load_image):
17036 Check for overflow in size calculations.
17037 (x_create_x_image_and_pixmap): Remove unnecessary test for
17038 xmalloc returning NULL; that can't happen.
17039 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
17040 (xpm_color_bucket): Use better integer hashing function.
17041 (xpm_cache_color): Don't possibly over-allocate memory.
17042 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
17043 (gif_memory_source):
17044 Use ptrdiff_t, not int or size_t, to record sizes.
17045 (png_load): Don't assume values greater than 2**31 fit in 'int'.
17046 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
17047 either works, as we prefer signed integers.
17048 (tiff_read_from_memory, tiff_write_from_memory):
17049 Return tsize_t, not size_t, since that's what the TIFF API wants.
17050 (tiff_read_from_memory): Don't fail simply because the read would
17051 go past EOF; instead, return a short read.
17052 (tiff_load): Omit no-longer-needed casts.
17053 (Fimagemagick_types): Don't assume size fits into 'int'.
17054
3cc5a532
PE
17055 Improve hashing quality when configured --with-wide-int.
17056 * fns.c (hash_string): New function, taken from sxhash_string.
17057 Do not discard information about ASCII character case; this
17058 discarding is no longer needed.
17059 (sxhash-string): Use it. Change sig to match it. Caller changed.
17060 * lisp.h: Declare it.
17061 * lread.c (hash_string): Remove, since we now use fns.c's version.
17062 The fns.c version returns a wider integer if --with-wide-int is
17063 specified, so this should help the quality of the hashing a bit.
17064
b312a492
PE
17065 * emacs.c: Integer overflow minor fix.
17066 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
17067 Define only if GNU_LINUX.
17068 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
17069
dfd153ae
PE
17070 * dispnew.c: Integer signedness and overflow fixes.
17071 Remove unnecessary forward decls, that were a maintenance hassle.
17072 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
17073 All uses changed.
17074 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
17075 (scrolling_window): Use ptrdiff_t, not int, for byte count.
17076 (prepare_desired_row, line_draw_cost):
17077 Use int, not unsigned, where either works.
17078 (save_current_matrix, restore_current_matrix):
17079 Use ptrdiff_t, not size_t, where either works.
17080 (init_display): Check for overflow more accurately, and without
17081 relying on undefined behavior.
17082
a81d11a3
PE
17083 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
17084 Remove, replacing with the new symbols in lisp.h. All uses changed.
17085 * fileio.c (make_temp_name):
17086 * filelock.c (lock_file_1, lock_file):
17087 * xdisp.c (message_dolog):
17088 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
17089 Use pMd etc. instead.
17090 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
17091 replacing the pWIDE etc. symbols removed from editfns.c.
17092
3300e6fd
PE
17093 * keyboard.h (num_input_events): Now uintmax_t.
17094 This is (very slightly) less likely to mess up due to wraparound.
17095 All uses changed.
17096
fd05c7e9
PE
17097 * buffer.c: Integer signedness fixes.
17098 (alloc_buffer_text, enlarge_buffer_text):
17099 Use ptrdiff_t rather than size_t when either will do, as we prefer
17100 signed integers.
17101
903fe15d
PE
17102 * alloc.c: Integer signedness and overflow fixes.
17103 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
17104 (__malloc_size_t): Default to size_t, not to int.
17105 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
17106 (Fgarbage_collect, mark_object_loop_halt, mark_object):
17107 Prefer ptrdiff_t to size_t when either would do, as we prefer
17108 signed integers.
17109 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
17110 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
17111 Now const. Initialize with values that are in range even if char
17112 is signed.
17113 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
17114 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
17115 These functions do the right thing with sizes > 2**32.
17116 (check_depth): Now ptrdiff_t, not int.
17117 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
17118 Adjust to new way of storing sizes. Check for size overflow bugs
17119 in rest of code.
17120 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
17121 slightly wrong anyway, as it missed one instance of
17122 XMALLOC_OVERRUN_CHECK_OVERHEAD.
17123 (refill_memory_reserve): Omit needless cast to size_t.
17124 (mark_object_loop_halt): Mark as externally visible.
17125
ac82cc6a
PE
17126 * xselect.c: Integer signedness and overflow fixes.
17127 (Fx_register_dnd_atom, x_handle_dnd_message):
17128 Use ptrdiff_t, not size_t, since we prefer signed.
17129 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
17130 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
17131 x_dnd_atoms_size and x_dnd_atoms_length.
17132
c2d1e36d
PE
17133 * doprnt.c: Prefer signed to unsigned when either works.
17134 * eval.c (verror):
17135 * doprnt.c (doprnt):
17136 * lisp.h (doprnt):
17137 * xdisp.c (vmessage):
17138 Use ptrdiff_t, not size_t, when using or implementing doprnt,
17139 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
17140 prefer signed arithmetic to avoid comparison confusion.
17141 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
17142 but is a bit tricky.
17143
0e926e56
PE
17144 Assume freestanding C89 headers, string.h, stdlib.h.
17145 * data.c, doprnt.c, floatfns.c, print.c:
17146 Include float.h unconditionally.
17147 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
17148 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
17149 * regex.c: Likewise for stddef.h, string.h.
17150 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
17151 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
17152 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
17153 (STDC_HEADERS): Remove obsolete defines.
17154 * sysdep.c: Include limits.h unconditionally.
17155
9cfdb3ec
PE
17156 Assume support for memcmp, memcpy, memmove, memset.
17157 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
17158 * regex.c (memcmp, memcpy):
17159 Remove; we assume C89 now.
17160
17161 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
17162 (__malloc_safe_bcopy): Remove; no longer needed.
17163
cf950e6b 17164 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
17165 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
17166 well either way, and we prefer signed to unsigned.
17167
dbf38e02
LMI
171682011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
17169
17170 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
17171 closes the connection while we're reading (bug#9182).
17172
d6f0886c 171732011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 17174
d6f0886c
JD
17175 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
17176 are specified (Bug#9168).
24e0f6b1 17177
2eb1f9e6
PE
171782011-07-25 Paul Eggert <eggert@cs.ucla.edu>
17179
17180 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
17181 Found by GCC static checking and --with-wide-int on a 32-bit host.
17182
22381272 171832011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
17184
17185 * xdisp.c (compute_display_string_pos): Fix logic of caching
17186 previous display string position. Initialize cached_prev_pos to
17187 -1. Fixes slow-down at the beginning of a buffer.
17188
f25e39b4
EZ
171892011-07-24 Eli Zaretskii <eliz@gnu.org>
17190
17191 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
17192 for attrs[LFACE_FONTSET_INDEX].
17193
04c4b52e
PE
171942011-07-23 Paul Eggert <eggert@cs.ucla.edu>
17195
17196 * xml.c (parse_region): Remove unused local
17197 that was recently introduced.
17198
c1734fbd
EZ
171992011-07-23 Eli Zaretskii <eliz@gnu.org>
17200
be18c5a5
EZ
17201 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
17202 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
17203
c1734fbd
EZ
17204 * xdisp.c (move_it_in_display_line_to): Record the best matching
17205 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
17206 exit if none of the characters scanned was an exact match.
17207 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
17208 when exact match is impossible due to invisible text, and the
17209 lines are truncated.
17210
a258d627
JD
172112011-07-23 Jan Djärv <jan.h.d@swipnet.se>
17212
17213 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
17214 for OSX >= 10.7.
17215
b6d5a689
EZ
172162011-07-22 Eli Zaretskii <eliz@gnu.org>
17217
0f74f785
EZ
17218 Fix a significant slow-down of cursor motion with C-n, C-p,
17219 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
17220 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 17221 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
17222 (next_element_from_buffer): Call compute_stop_pos_backwards to
17223 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
17224 base_level_stop.
17225 (reseat): Don't look for prev_stop, as that could mean a very long
17226 run.
17227 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
17228 <cached_disp_overlay_modiff>: Cache for last found display string
17229 position.
551918c1 17230 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
17231 about the same buffer in the same area of character positions, and
17232 the buffer wasn't changed since the time the display string
17233 position was cached.
551918c1 17234
b2d0c91a
EZ
172352011-07-22 Eli Zaretskii <eliz@gnu.org>
17236
17237 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
17238 is an integer, which is important for empty lines. (Bug#9149)
17239
043604ee
CY
172402011-07-22 Chong Yidong <cyd@stupidchicken.com>
17241
17242 * frame.c (Fmodify_frame_parameters): In tty case, update the
17243 default face if necessary (Bug#4238).
17244
da4adb04
CY
172452011-07-21 Chong Yidong <cyd@stupidchicken.com>
17246
17247 * editfns.c (Fstring_to_char): No need to explain what a character
17248 is in the docstring (Bug#6576).
17249
9abd0532
LMI
172502011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17251
17252 * xml.c (parse_region): Make sure we always return a tree.
17253
36881d16
HK
172542011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
17255
17256 * xml.c (parse_region): If a document contains only comments,
17257 return that, too.
17258
1e98674d
LMI
172592011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
17260
17261 * xml.c (make_dom): Return comments, too.
17262
590bd467
PE
172632011-07-19 Paul Eggert <eggert@cs.ucla.edu>
17264
17265 Port to OpenBSD.
17266 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
17267 and the surrounding thread.
17268 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
17269 rather than fgets, and retry after EINTR. Otherwise, 'emacs
17270 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
17271 timer goes off.
17272 * s/openbsd.h (BROKEN_SIGIO): Define.
17273 * unexelf.c (unexec) [__OpenBSD__]:
17274 Don't update the .mdebug section of the Alpha COFF symbol table.
17275
f41628b2
LMI
172762011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
17277
17278 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
17279 (bug#8460).
17280
b59b67c5
PE
172812011-07-18 Paul Eggert <eggert@cs.ucla.edu>
17282
15e3a074
PE
17283 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
17284 This fixes some race conditions on the permissions of any newly
17285 created file.
17286
41bed37d
PE
17287 * alloc.c (valid_pointer_p): Use pipe, not open.
17288 This fixes some permissions issues when debugging.
17289
b59b67c5
PE
17290 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
17291 If fchown fails to set both uid and gid, try to set just gid,
17292 as that is sometimes allowed. Adjust the file's mode to eliminate
17293 setuid or setgid bits that are inappropriate if fchown fails.
17294
925a6be7
SM
172952011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
17296
17297 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
17298 to compare Lisp_Objects.
17299 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
17300 global_gnutls_log_level, don't mistake it for a Lisp_Object.
17301 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
17302
52968808
AS
173032011-07-17 Andreas Schwab <schwab@linux-m68k.org>
17304
0a6a104b
AS
17305 * lread.c (read_integer): Unread even EOF character.
17306 (read1): Likewise. Properly record start position of symbol.
17307
52968808
AS
17308 * lread.c (read1): Read `#:' as empty uninterned symbol if no
17309 symbol character follows.
17310
9e381cdd
PE
173112011-07-17 Paul Eggert <eggert@cs.ucla.edu>
17312
17313 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
17314 This works around a problem with the previous change to Fcopy_file.
17315 Recent glibc declares fchown with __attribute__((warn_unused_result)),
17316 and without this change, GCC might complain about discarding
17317 fchown's return value.
17318
b5641435
JB
173192011-07-16 Juanma Barranquero <lekktu@gmail.com>
17320
17321 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
17322
a8031457
PE
173232011-07-16 Paul Eggert <eggert@cs.ucla.edu>
17324
17325 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
17326
dd889327
LMI
173272011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
17328
750c33f7
LMI
17329 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
17330 it's used from the C level.
17331
dd889327
LMI
17332 * process.c: Use the same condition for POLL_FOR_INPUT in both
17333 keyboard.c and process.c (bug#1858).
17334
87e86684
LM
173352011-07-09 Lawrence Mitchell <wence@gmx.li>
17336
17337 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
17338 (Fgnutls_boot): Use it.
17339
64348f40
AS
173402011-07-15 Andreas Schwab <schwab@linux-m68k.org>
17341
17342 * doc.c (Fsubstitute_command_keys): Revert last change.
17343
1d698799
LMI
173442011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
17345
f863868c
LMI
17346 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
17347 quotes the next character, and doesn't affect other longer
17348 sequences (bug#8935).
17349
1d698799
LMI
17350 * lread.c (syms_of_lread): Clarify that is isn't only
17351 `eval-buffer' and `eval-defun' that's affected by
17352 `lexical-binding' (bug#8460).
17353
aa4b6df6
EZ
173542011-07-15 Eli Zaretskii <eliz@gnu.org>
17355
17356 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 17357 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 17358
5d856da6
PE
173592011-07-14 Paul Eggert <eggert@cs.ucla.edu>
17360
ad6042bb
PE
17361 Fix minor problems found by static checking.
17362 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
17363 (elsz): Now a signed constant, not a size_t var. We prefer signed
17364 types to unsigned, to avoid integer comparison confusion. Without
17365 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
17366 "cannot optimize loop, the loop counter may overflow", a symptom
17367 of the confusion.
f00bbb22 17368 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
17369 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
17370
6468f31c
LMI
173712011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17372
49080b10
LMI
17373 * search.c (Fre_search_backward): Mention `case-fold-search' in
17374 all the re_search_* functions (bug#8138).
17375
6468f31c
LMI
17376 * keyboard.c (Fopen_dribble_file): Document when the file is
17377 closed (bug#8056).
17378
c965adc5
EZ
173792011-07-14 Eli Zaretskii <eliz@gnu.org>
17380
df9733bf
EZ
17381 * bidi.c (bidi_dump_cached_states): Fix format of displaying
17382 bidi_cache_idx.
17383
0bb23927
EZ
17384 Support bidi reordering of display and overlay strings.
17385 * xdisp.c (compute_display_string_pos)
17386 (compute_display_string_end): Accept additional argument STRING.
17387 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
17388 (reseat_to_string): Initialize bidi_it->string.s and
17389 bidi_it->string.schars.
17390 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
17391 NULL (avoids a crash in bidi_paragraph_init).
17392 Initialize itb.string.lstring.
0bb23927
EZ
17393 (init_iterator): Call bidi_init_it only of a valid
17394 buffer position was specified. Initialize paragraph_embedding to
17395 L2R.
17396 (reseat_to_string): Initialize the bidi iterator.
17397 (display_string): If we need to ignore text properties of
17398 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
17399 original value of -1 will not work with bidi.)
17400 (compute_display_string_pos): First arg is now struct
17401 `text_pos *'; all callers changed. Support display properties on
17402 Lisp strings.
17403 (compute_display_string_end): Support display properties on Lisp
17404 strings.
17405 (init_iterator, reseat_1, reseat_to_string): Initialize the
17406 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
17407 when iterating on a string not from display properties).
640c8776
SM
17408 (compute_display_string_pos, compute_display_string_end):
17409 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
17410 arrow keys.
17411 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
17412 base_level_stop; instead, set base_level_stop to BEGV.
17413 Fixes crashes in vertical-motion.
0bb23927
EZ
17414 (next_element_from_buffer): Improve commentary for when
17415 the iterator is before prev_stop.
17416 (init_iterator): Initialize bidi_p from the default value of
17417 bidi-display-reordering, not from buffer-local value. Use the
17418 buffer-local value only if initializing for buffer iteration.
17419 (handle_invisible_prop): Support invisible properties on strings
17420 that are being bidi-reordered.
17421 (set_iterator_to_next): Support bidi reordering of C strings and
17422 Lisp strings.
17423 (next_element_from_string): Support bidi reordering of Lisp
17424 strings.
17425 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
17426 (display_string): Support display of R2L glyph rows.
17427 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
17428 (init_iterator): Don't initialize it->bidi_p for strings
17429 here.
17430 (reseat_to_string): Initialize it->bidi_p for strings here.
17431 (next_element_from_string, next_element_from_c_string)
17432 (next_element_from_buffer): Add xassert's for correspondence
17433 between IT's object being iterated and it->bidi_it.string
17434 structure.
17435 (face_before_or_after_it_pos): Support bidi iteration.
17436 (next_element_from_c_string): Handle the case of the first string
17437 character that is not the first one in the visual order.
17438 (get_visually_first_element): New function, refactored from common
17439 parts of next_element_from_buffer, next_element_from_string, and
17440 next_element_from_c_string.
17441 (tool_bar_lines_needed, redisplay_tool_bar)
17442 (display_menu_bar): Force left-to-right direction. Add a FIXME
17443 comment for making that be controlled by a user option.
17444 (push_it, pop_it): Save and restore the state of the
17445 bidi iterator. Save and restore the bidi_p flag.
17446 (pop_it): Iterate out of display property for string iteration as
17447 well.
17448 (iterate_out_of_display_property): Support iteration over strings.
17449 (handle_single_display_spec): Set up it->bidi_it for iteration
17450 over a display string, and call bidi_init_it.
17451 (handle_single_display_spec, next_overlay_string)
17452 (get_overlay_strings_1, push_display_prop): Set up the bidi
17453 iterator for displaying display or overlay strings.
17454 (forward_to_next_line_start): Don't use the shortcut if
17455 bidi-iterating.
17456 (back_to_previous_visible_line_start): If handle_display_prop
17457 pushed the iterator stack, restore the internal state of the bidi
17458 iterator by calling bidi_pop_it same number of times.
17459 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
17460 and we are bidi-iterating, don't decrement the iterator position;
17461 instead, set the first_elt flag in the bidi iterator, to produce
17462 the same effect.
17463 (reseat_1): Remove redundant setting of string_from_display_prop_p.
17464 (push_display_prop): xassert that we are iterating a buffer.
17465 (push_it, pop_it): Save and restore paragraph_embedding member.
17466 (handle_single_display_spec, next_overlay_string)
17467 (get_overlay_strings_1, reseat_1, reseat_to_string)
17468 (push_display_prop): Set up the `unibyte' member of bidi_it.string
17469 correctly. Don't assume unibyte strings are not bidi-reordered.
17470 (compute_display_string_pos)
17471 (compute_display_string_end): Fix handling the case of C string.
17472 (push_it, pop_it): Save and restore from_disp_prop_p.
17473 (handle_single_display_spec, push_display_prop): Set the
17474 from_disp_prop_p flag.
17475 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
17476 (pop_it): Call iterate_out_of_display_property only if we are
17477 popping after iteration over a string that came from a display
17478 property. Fix a typo in popping stretch info. Add an assertion
17479 for verifying that the iterator position is in sync with the bidi
17480 iterator.
17481 (handle_single_display_spec, get_overlay_strings_1)
17482 (push_display_prop): Fix initialization of paragraph direction for
17483 string when that of the parent object is not yet determined.
17484 (reseat_1): Call bidi_init_it to resync the bidi
17485 iterator with IT's position. (Bug#7616)
17486 (find_row_edges): If ROW->start.pos gives position
17487 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
17488 (handle_stop, back_to_previous_visible_line_start, reseat_1):
17489 Reset the from_disp_prop_p flag.
17490 (SAVE_IT, RESTORE_IT): New macros.
17491 (pos_visible_p, face_before_or_after_it_pos)
17492 (back_to_previous_visible_line_start)
17493 (move_it_in_display_line_to, move_it_in_display_line)
17494 (move_it_to, move_it_vertically_backward, move_it_by_lines)
17495 (try_scrolling, redisplay_window, display_line): Use them when
17496 saving a temporary copy of the iterator and restoring it back.
17497 (back_to_previous_visible_line_start, reseat_1)
17498 (init_iterator): Empty the bidi cache "stack".
17499 (move_it_in_display_line_to): If iterator ended up at
17500 EOL, but we never saw any buffer positions smaller than
17501 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
17502 motion in bidi-reordered lines.
17503 (move_it_in_display_line_to): Record prev_method and prev_pos
17504 immediately before the call to set_iterator_to_next. Fixes cursor
17505 motion in bidi-reordered lines with stretch glyphs and strings
17506 displayed in margins. (Bug#8133) (Bug#8867)
17507 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
17508 TO_CHARPOS.
640c8776
SM
17509 (pos_visible_p): Support positions in bidi-reordered lines.
17510 Save and restore bidi cache.
0bb23927
EZ
17511
17512 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
17513 (bidi_paragraph_info): Delete unused struct.
17514 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
17515 (bidi_cache_start): New variable.
17516 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
17517 to zero.
17518 (bidi_cache_fetch_state, bidi_cache_search)
17519 (bidi_cache_find_level_change, bidi_cache_iterator_state)
17520 (bidi_cache_find, bidi_peek_at_next_level)
17521 (bidi_level_of_next_char, bidi_find_other_level_edge)
17522 (bidi_move_to_visually_next): Compare cache index with
17523 bidi_cache_start rather than with zero.
17524 (bidi_fetch_char): Accept new argument STRING; all callers
17525 changed. Support iteration over a string. Support strings with
17526 display properties. Support unibyte strings. Fix the type of
17527 `len' according to what STRING_CHAR_AND_LENGTH expects.
17528 (bidi_paragraph_init, bidi_resolve_explicit_1)
17529 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
17530 (bidi_level_of_next_char, bidi_move_to_visually_next):
17531 Support iteration over a string.
0bb23927
EZ
17532 (bidi_set_sor_type, bidi_resolve_explicit_1)
17533 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
17534 can now be zero (for strings); special values 0 and -1 were
17535 changed to -1 and -2, respectively.
17536 (bidi_char_at_pos): New function.
17537 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
17538 Call it instead of FETCH_MULTIBYTE_CHAR.
17539 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
17540 initialized to valid values.
17541 (bidi_init_it): Don't initialize charpos and bytepos with invalid
17542 values.
17543 (bidi_level_of_next_char): Allow the sentinel "position" to pass
17544 the test for valid cached positions. Fix the logic for looking up
17545 the sentinel state in the cache. GCPRO the Lisp string we are
17546 iterating.
17547 (bidi_push_it, bidi_pop_it): New functions.
17548 (bidi_initialize): Initialize the bidi cache start stack pointer.
17549 (bidi_cache_ensure_space): New function, refactored from part of
17550 bidi_cache_iterator_state. Don't assume the required size is just
17551 one BIDI_CACHE_CHUNK away.
17552 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
17553 (bidi_count_bytes, bidi_char_at_pos): New functions.
17554 (bidi_cache_search): Don't assume bidi_cache_last_idx is
17555 always valid if bidi_cache_idx is valid.
17556 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
17557 is valid if it's going to be used.
17558 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
17559 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
17560 (bidi_cache_find_level_change, bidi_cache_ensure_space)
17561 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
17562 (bidi_find_other_level_edge, bidi_cache_start_stack):
17563 All variables related to cache indices are now EMACS_INT.
c965adc5 17564
0bb23927
EZ
17565 * dispextern.h (struct bidi_string_data): New structure.
17566 (struct bidi_it): New member `string'. Make flag members be 1-bit
17567 fields, and put them last in the struct.
640c8776
SM
17568 (compute_display_string_pos, compute_display_string_end):
17569 Update prototypes.
0bb23927
EZ
17570 (bidi_push_it, bidi_pop_it): Add prototypes.
17571 (struct iterator_stack_entry): New members bidi_p,
17572 paragraph_embedding, and from_disp_prop_p.
17573 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
17574 (bidi_shelve_cache, bidi_unshelve_cache):
17575 Declare prototypes.
0bb23927
EZ
17576
17577 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
17578 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
17579 and vector-like objects.
17580
17581 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
17582 cache around display iteration.
17583
17584 * window.c (Fwindow_end, window_scroll_pixel_based)
17585 (displayed_window_lines, Frecenter): Save and restore the bidi
17586 cache around display iteration.
17587
3bbd2265
LMI
175882011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
17589
17590 * editfns.c (Fdelete_region): Clarify the use of the named
17591 parameters (bug#6788).
17592
adc47434
MR
175932011-07-14 Martin Rudalics <rudalics@gmx.at>
17594
17595 * indent.c (Fvertical_motion): Set and restore w->pointm when
17596 saving and restoring the window's buffer (Bug#9006).
17597
837c31f8
LMI
175982011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
17599
17600 * editfns.c (Fstring_to_char): Clarify just what is returned
17601 (bug#6576). Text by Eli Zaretskii.
17602
ac389d0c
JB
176032011-07-13 Juanma Barranquero <lekktu@gmail.com>
17604
17605 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
17606
0be0ce47
EZ
176072011-07-13 Eli Zaretskii <eliz@gnu.org>
17608
17609 * buffer.c (mmap_find): Fix a typo.
17610
cd18e7e3
JB
176112011-07-13 Johan Bockgård <bojohan@gnu.org>
17612
17613 Fix execution of x selection hooks.
17614 * xselect.c (Qx_lost_selection_functions)
17615 (Qx_sent_selection_functions): New vars.
17616 (syms_of_xselect): DEFSYM them.
17617 (x_handle_selection_request): Pass Qx_sent_selection_functions
17618 rather than Vx_sent_selection_functions to Frun_hook_with_args.
17619 (x_handle_selection_clear,x_clear_frame_selections):
17620 Pass Qx_lost_selection_functions rather than
17621 Vx_lost_selection_functions to Frun_hook_with_args.
17622
47ea7f44
PE
176232011-07-13 Paul Eggert <eggert@cs.ucla.edu>
17624
ac389d0c 17625 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
17626 The old code sometimes used this field without initializing it.
17627
47ea7f44
PE
17628 * alloc.c (gc_sweep): Don't read past end of array.
17629 In theory, the old code could also have corrupted Emacs internals,
17630 though it'd be very unlikely.
17631
bc985c87
AS
176322011-07-12 Andreas Schwab <schwab@linux-m68k.org>
17633
17634 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 17635 argument. (Bug#4026)
bc985c87 17636
0cf34688
LMI
176372011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
17638
b3dadd76
LMI
17639 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
17640 key" (bug#4257).
17641
0cf34688
LMI
17642 * window.c (Fset_window_start): Doc fix (bug#4199).
17643 (Fset_window_hscroll): Ditto.
17644
270768cd
PE
176452011-07-12 Paul Eggert <eggert@cs.ucla.edu>
17646
077e3dda 17647 Fix minor new problems caught by GCC 4.6.1.
270768cd 17648 * term.c (init_tty): Remove unused local.
490011a6 17649 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 17650 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 17651 not used otherwise.
270768cd 17652
b1f58454
CY
176532011-07-12 Chong Yidong <cyd@stupidchicken.com>
17654
17655 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
17656
22b9578d
LMI
176572011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
17658
6e70ab07
LMI
17659 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
17660 are the mini-buffer and the echo area (bug#3320).
17661
22b9578d
LMI
17662 * term.c (init_tty): Remove support for supdup, c10 and perq
17663 terminals, which are no longer supported (bug#1482).
17664
8974cc9f
JB
176652011-07-10 Johan Bockgård <bojohan@gnu.org>
17666
17667 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
17668
a560d974
JD
176692011-07-10 Jan Djärv <jan.h.d@swipnet.se>
17670
17671 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
17672 for non-popups (Bug#3642).
17673
1dae0f0a
AS
176742011-07-10 Andreas Schwab <schwab@linux-m68k.org>
17675
268c2c36 17676 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 17677 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
17678 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
17679 * cm.c (losecursor): Likewise.
1dae0f0a
AS
17680 * data.c (fmod): Likewise.
17681 * dispnew.c (swap_glyphs_in_rows): Likewise.
17682 * emacs.c (memory_warning_signal): Likewise.
17683 * floatfns.c (float_error): Likewise.
17684 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
17685 (otf_open, font_otf_capability, generate_otf_features)
17686 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
17687 Likewise.
17688 * image.c (pbm_read_file): Likewise.
17689 * indent.c (string_display_width): Likewise.
17690 * intervals.c (check_for_interval, search_for_interval)
17691 (inc_interval_count, count_intervals, root_interval)
17692 (adjust_intervals_for_insertion, make_new_interval): Likewise.
17693 * lread.c (defalias): Likewise.
268c2c36 17694 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
17695 * regex.c (set_image_of_range_1, set_image_of_range)
17696 (regex_grow_registers): Likewise.
17697 * sysdep.c (strerror): Likewise.
17698 * termcap.c (valid_filename_p, tprint, main): Likewise.
17699 * tparam.c (main): Likewise.
17700 * unexhp9k800.c (run_time_remap, save_data_space)
17701 (update_file_ptrs, read_header, write_header, calculate_checksum)
17702 (copy_file, copy_rest, display_header): Likewise.
17703 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
17704 Likewise.
17705 * xdisp.c (check_it): Likewise.
17706 * xfaces.c (register_color, unregister_color, unregister_colors):
17707 Likewise.
17708 * xfns.c (print_fontset_result): Likewise.
17709 * xrdb.c (member, fatal, main): Likewise.
17710
99033785
PE
177112011-07-10 Paul Eggert <eggert@cs.ucla.edu>
17712
17713 Fix minor problems found by static checking (Bug#9031).
17714 * chartab.c (char_table_set_range, map_sub_char_table):
17715 Remove unused locals.
17716 (uniprop_table): Now static.
17717 * composite.c (_work_char): Remove unused static var.
17718
9cb2ac56
JB
177192011-07-09 Juanma Barranquero <lekktu@gmail.com>
17720
17721 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
17722
f25661f0
JD
177232011-07-09 Jan Djärv <jan.h.d@swipnet.se>
17724
17725 * gtkutil.c (qttip_cb): Remove code without function.
17726
8278c4fe
EZ
177272011-07-09 Eli Zaretskii <eliz@gnu.org>
17728
17729 * w32.c (pthread_sigmask): New stub.
17730
1692ae2d 177312011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 17732
8a6ebd58 17733 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
17734 sigprocmask is portable only for single-threaded applications, and
17735 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
17736 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
17737 (LIBES): Use it.
17738 * callproc.c (Fcall_process):
17739 * process.c (create_process):
17740 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
17741 Use pthread_sigmask, not sigprocmask.
123403e4 17742
1b854618
JD
177432011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17744
17745 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
17746 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
17747 wrong (Bug#8591).
17748
3fe4b549
JD
177492011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17750
0ce7e563
JD
17751 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
17752 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
17753 (xg_hide_tooltip): Fix comment.
17754
3fe4b549
JD
17755 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
17756 in registerServicesMenuSendTypes.
17757 (validRequestorForSendType): Don't check ns_return_types.
17758
17759 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
17760 ns_return_type.
17761
5df75e47
JR
177622011-07-08 Jason Rumney <jasonr@gnu.org>
17763
22610910
JR
17764 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
17765 SH_SHOW for hidden windows (Bug#5482).
17766
5df75e47
JR
17767 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
17768 frame struct members of non-existent frames (Bug#6284).
17769
699c10bd
JD
177702011-07-08 Jan Djärv <jan.h.d@swipnet.se>
17771
4393663b
JD
17772 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
17773 variable firstTime not needed on OSX >= 10.6.
17774 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
17775 >= 10.5. Use setKnobProportion, setDoubleValue.
17776
17777 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
17778 (MAC_OS_X_VERSION_10_5): Define if not defined.
17779 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
17780 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
17781 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
17782
17783 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 17784 cString and lossyCString on OSX >= 10.4.
4393663b 17785
58179cce 17786 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
17787 sizeToFit on OSX >= 10.2.
17788
17789 * nsimage.m (allocInitFromFile): Don't use deprecated method
17790 bestRepresentationForDevice on OSX >= 10.6.
17791
17792 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
17793 to avoid warning.
17794
17795 * emacs.c: Declare unexec_init_emacs_zone.
17796
a63e0781
JD
17797 * nsgui.h: Fix compiler warning about gnulib redefining verify.
17798
699c10bd
JD
17799 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
17800
17801 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
17802 on svcsMenu (Bug#8842).
17803
17804 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
17805 ns_return_types.
17806 (Fns_list_services): Just return Qnil on 10.6, code not working there.
17807
17808 * nsterm.m (QUTF8_STRING): Declare.
17809 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
17810 (validRequestorForSendType): Return type is (id).
17811 Change indexOfObjectIdenticalTo to indexOfObject.
17812 Check if we have local selection before returning self (Bug#8842).
17813 (writeSelectionToPasteboard): Put local selection into paste board
17814 if we have a local selection (Bug#8842).
17815 (syms_of_nsterm): DEFSYM QUTF8_STRING.
17816
17817 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
17818 (ns_get_local_selection): Declare.
17819
54e10184
LMI
178202011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17821
9888ff71
LMI
17822 * keymap.c (describe_map_tree): Don't insert a double newline at
17823 the end of the buffer (bug#1169) and return whether we inserted
17824 something.
17825
54e10184
LMI
17826 * callint.c (Fcall_interactively): Change "reading args" to
17827 "providing args" to try to clarify what it does (bug#1010).
17828
15fa4783
KH
178292011-07-07 Kenichi Handa <handa@m17n.org>
17830
17831 * composite.c (composition_compute_stop_pos): Ignore a static
17832 composition starting before CHARPOS (Bug#8915).
17833
17834 * xdisp.c (handle_composition_prop): Likewise.
17835
a8815b00
EZ
178362011-07-07 Eli Zaretskii <eliz@gnu.org>
17837
17838 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
17839 (Bug#9015)
17840
ef7b981d 178412011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
17842
17843 * character.h (unicode_category_t): New enum type.
17844
17845 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
17846 (Qchar_code_property_table): New variable.
17847 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
17848 (UNIPROP_COMPRESSED_FORM_P): New macros.
17849 (char_table_ascii): Uncompress the compressed values.
17850 (sub_char_table_ref): New arg is_uniprop. Callers changed.
17851 Uncompress the compressed values.
ac389d0c 17852 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
17853 (char_table_ref_and_range): Uncompress the compressed values.
17854 (sub_char_table_set): New arg is_uniprop. Callers changed.
17855 Uncompress the compressed values.
17856 (sub_char_table_set_range): Args changed. Callers changed.
17857 (char_table_set_range): Adjuted for the above change.
17858 (map_sub_char_table): Delete args default_val and parent. Add arg
17859 top. Give decoded values to a Lisp function.
640c8776 17860 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
17861 values to a Lisp function. Gcpro more variables.
17862 (uniprop_table_uncompress)
17863 (uniprop_decode_value_run_length): New functions.
17864 (uniprop_decoder, uniprop_decoder_count): New variables.
17865 (uniprop_get_decoder, uniprop_encode_value_character)
17866 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
17867 New functions.
17868 (uniprop_encoder, uniprop_encoder_count): New variables.
17869 (uniprop_get_encoder, uniprop_table)
17870 (Funicode_property_table_internal, Fget_unicode_property_internal)
17871 (Fput_unicode_property_internal): New functions.
17872 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
17873 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 17874 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
17875 char-code-property-alist.
17876
640c8776 17877 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
17878 Vunicode_category_table.
17879
640c8776 17880 * font.c (font_range): Adjust for the change of
c805dec0
KH
17881 Vunicode_category_table.
17882
76b397fb
DN
178832011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
17884
17885 * m/iris4d.h: Remove file, move contents ...
17886 * s/irix6-5.h: ... here.
17887
22b4128e
PE
178882011-07-06 Paul Eggert <eggert@cs.ucla.edu>
17889
17890 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
17891 * alloc.c (mark_buffer):
17892 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
17893 (clone_per_buffer_values): Don't assume that
22b4128e
PE
17894 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
17895 This isn't true in general, and it's particularly not true
17896 if Emacs is configured with --with-wide-int.
17897 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
17898 New macros, used in the buffer.c change.
17899
869795d6
JD
179002011-07-05 Jan Djärv <jan.h.d@swipnet.se>
17901
17902 * xsettings.c: Use both GConf and GSettings if both are available.
17903 (store_config_changed_event): Add comment.
17904 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
17905 (store_tool_bar_style_changed): New functions.
5e617bc2 17906 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
17907 (struct xsettings): Move font inside HAVE_XFT.
17908 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 17909 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 17910 Move inside HAVE_XFT.
640c8776 17911 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
17912 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
17913 also.
17914 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 17915 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 17916 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
17917 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
17918 (parse_settings): Move check for font inside HAVE_XFT.
17919 (read_settings, apply_xft_settings): Add comment.
17920 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
17921 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
17922 call store_font_name_changed.
17923 (xft_settings_event): Add comment.
17924 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
17925 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
17926 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
17927 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
17928 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
17929 (xsettings_get_system_font, xsettings_get_system_normal_font):
17930 Add comment.
869795d6 17931
d8ed26bd
PE
179322011-07-05 Paul Eggert <eggert@cs.ucla.edu>
17933
17934 Random fixes. E.g., (random) never returned negative values.
17935 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
17936 subseconds part to the entropy, as that's a bit more random.
17937 Prefer signed to unsigned, since the signedness doesn't matter and
17938 in general we prefer signed. When given a limit, use a
17939 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
17940 latter isn't right if USE_2_TAGS_FOR_INTS.
17941 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
17942 not 0..VALMASK. Don't discard "excess" bits that random () returns.
17943
cabf1cac
SM
179442011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
17945
17946 * textprop.c (text_property_stickiness):
17947 Obey Vtext_property_default_nonsticky.
17948 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
17949 * w32fns.c (syms_of_w32fns):
17950 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
17951
6e9b2be9
PE
179522011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17953
17954 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
17955 This is more efficient than Ffile_directory_p and avoids a minor race.
17956
90186c68
LMI
179572011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
17958
7c301272
LMI
17959 * buffer.c (Foverlay_put): Say what the return value is
17960 (bug#7835).
17961
c4f2d8d4
LMI
17962 * fileio.c (barf_or_query_if_file_exists): Check first if the file
17963 is a directory before asking whether to use the file name
17964 (bug#7564).
ad637907
LMI
17965 (barf_or_query_if_file_exists): Make the "File is a directory"
17966 error be more correct.
c4f2d8d4 17967
90186c68
LMI
17968 * fns.c (Frequire): Remove the mention of the .gz files, since
17969 that's installation-specific, but keep the mention of
17970 `get-load-suffixes'.
17971
da64016e
PE
179722011-07-04 Paul Eggert <eggert@cs.ucla.edu>
17973
17974 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
17975 Report string overflow if the output is too long.
17976
7d47b580
JB
179772011-07-04 Juanma Barranquero <lekktu@gmail.com>
17978
a555cb87
JB
17979 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
17980 (syms_of_gnutls): Remove duplicate DEFSYM for
17981 Qgnutls_bootprop_verify_hostname_error, an error for
17982 Qgnutls_bootprop_verify_error (which is no longer used).
17983
7d47b580
JB
17984 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
17985 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
17986 Also (re)move comments that are misplaced or no longer relevant.
17987
1e49bfab
LMI
179882011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17989
17990 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
17991
1485f4c0
CY
179922011-07-03 Chong Yidong <cyd@stupidchicken.com>
17993
17994 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
17995 and background color parameters if they have been changed.
17996
a9ab721e
LMI
179972011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
17998
17999 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
18000
cf7cff57
PE
180012011-07-03 Paul Eggert <eggert@cs.ucla.edu>
18002
2e13213d
PE
18003 * xsettings.c (SYSTEM_FONT): Define only when used.
18004 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
18005
cf7cff57
PE
18006 * keymap.c (access_keymap_1): Now static.
18007
7a8e04f7
CY
180082011-07-02 Chong Yidong <cyd@stupidchicken.com>
18009
18010 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
18011 leave any prefix arg for the up event (Bug#1586).
18012
61352f62
LMI
180132011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
18014
69bb1ef7
LMI
18015 * lread.c (syms_of_lread): Mention single symbols defined by
18016 `defvar' or `defconst' (bug#7154).
18017
61352f62 18018 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 18019 (Frequire): Mention get-load-suffixes.
61352f62 18020
28545e04
MR
180212011-07-02 Martin Rudalics <rudalics@gmx.at>
18022
18023 * window.h (window): Remove clone_number slot.
18024 * window.c (Fwindow_clone_number, Fset_window_clone_number):
18025 Remove.
18026 (make_parent_window, make_window, saved_window)
18027 (Fset_window_configuration, save_window_save): Don't deal with
18028 clone numbers.
18029 * buffer.c (Qclone_number): Remove declaration.
18030 (sort_overlays, overlay_strings): Don't deal with clone numbers.
18031
3349e122
SM
180322011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
18033
18034 Add multiple inheritance to keymaps.
18035 * keymap.c (Fmake_composed_keymap): New function.
18036 (Fset_keymap_parent): Simplify.
18037 (fix_submap_inheritance): Remove.
18038 (access_keymap_1): New function extracted from access_keymap to handle
18039 embedded parents and handle lists of maps.
18040 (access_keymap): Use it.
18041 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
18042 (Fcopy_keymap): Handle embedded parents.
18043 (Fcommand_remapping, define_as_prefix): Simplify.
18044 (Fkey_binding): Simplify.
18045 (syms_of_keymap): Move minibuffer-local-completion-map,
18046 minibuffer-local-filename-completion-map,
18047 minibuffer-local-must-match-map, and
18048 minibuffer-local-filename-must-match-map to Elisp.
18049 (syms_of_keymap): Defsubr make-composed-keymap.
18050 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
18051 (parse_menu_item): Trivial simplification.
18052
3279eb87
GM
180532011-07-01 Glenn Morris <rgm@gnu.org>
18054
18055 * Makefile.in (SETTINGS_LIBS): Fix typo.
18056
39cb9e56 180572011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
18058
18059 * coding.c (Fencode_coding_string): Record the last coding system
18060 used, as the function doc string says (bug#8738).
18061
0949d2b6
JD
180622011-07-01 Jan Djärv <jan.h.d@swipnet.se>
18063
18064 * xsettings.c (store_monospaced_changed): Take new font as arg and
18065 check for change against current_mono_font.
18066 (EMACS_TYPE_SETTINGS): Remove this and related defines.
18067 (emacs_settings_constructor, emacs_settings_get_property)
18068 (emacs_settings_set_property, emacs_settings_class_init)
18069 (emacs_settings_init, gsettings_obj): Remove.
18070 (something_changedCB): New function for HAVE_GSETTINGS.
18071 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
18072 with value as argument.
18073 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
18074 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 18075 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
18076 "changed".
18077
18078 * xgselect.c: Add defined (HAVE_GSETTINGS).
18079 (xgselect_initialize): Ditto.
18080
18081 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
18082 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
18083 xg_select.
18084
bbc6b304
PE
180852011-07-01 Paul Eggert <eggert@cs.ucla.edu>
18086
18087 * eval.c (struct backtrace): Simplify and port the data structure.
18088 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
18089 signed bit field, as this assumption is not portable and it makes
18090 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
18091 "char debug_on_exit : 1" as this is not portable either; instead,
18092 use the portable "unsigned int debug_on_exit : 1". Remove unused
18093 member evalargs. Remove obsolete comments about cc bombing out.
18094
9851bfc5
JD
180952011-06-30 Jan Djärv <jan.h.d@swipnet.se>
18096
51bb811f 18097 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
18098 Let HAVE_GSETTINGS override HAVE_GCONF.
18099 (store_monospaced_changed): New function.
18100 (EMACS_SETTINGS): A new type derived from GObject to handle
18101 GSettings notifications.
18102 (emacs_settings_constructor, emacs_settings_get_property)
18103 (emacs_settings_set_property, emacs_settings_class_init):
18104 New functions.
18105 (gsettings_client, gsettings_obj): New variables.
18106 (GSETTINGS_SCHEMA): New define.
18107 (something_changedCB): Call store_monospaced_changed.
18108 (init_gsettings): New function.
18109 (xsettings_initialize): Call init_gsettings.
18110 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
18111 to NULL.
18112
640c8776 18113 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
18114 GCONF_CFLAGS/LIBS.
18115
5386012d
MR
181162011-06-29 Martin Rudalics <rudalics@gmx.at>
18117
18118 * window.c (resize_root_window, grow_mini_window)
18119 (shrink_mini_window): Rename Qresize_root_window to
18120 Qwindow_resize_root_window and Qresize_root_window_vertically to
18121 Qwindow_resize_root_window_vertically.
18122
f13e0b08
PE
181232011-06-28 Paul Eggert <eggert@cs.ucla.edu>
18124
18125 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
18126
94515237
JB
181272011-06-27 Juanma Barranquero <lekktu@gmail.com>
18128
18129 * makefile.w32-in: Redesign dependencies so they reflect more
18130 clearly which files are directly included by each source file,
18131 and not through other includes.
18132
e43b6e43
MR
181332011-06-27 Martin Rudalics <rudalics@gmx.at>
18134
18135 * buffer.c (Qclone_number): Declare static and DEFSYM it.
18136 (sort_overlays, overlay_strings): When an overlay's clone number
18137 matches the window's clone number process the overlay even if
18138 the overlay's window property doesn't match the current window.
18139
d68443dc
MR
18140 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
18141 (Fwindow_hchild): Rename to Fwindow_left_child.
18142 (Fwindow_next): Rename to Fwindow_next_sibling.
18143 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
18144 (resize_window_check): Rename to window_resize_check.
18145 (resize_window_apply): Rename to window_resize_apply.
18146 (Fresize_window_apply): Rename to Fwindow_resize_apply.
18147 (Fdelete_other_windows_internal, resize_frame_windows)
18148 (Fsplit_window_internal, Fdelete_window_internal)
18149 (grow_mini_window, shrink_mini_window)
18150 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 18151
c7e73be5
JD
181522011-06-26 Jan Djärv <jan.h.d@swipnet.se>
18153
18154 * emacsgtkfixed.h: State that this is only used with Gtk+3.
18155 (emacs_fixed_set_min_size): Remove.
18156 (emacs_fixed_new): Take frame as argument.
18157
18158 * emacsgtkfixed.c: State that this is only used with Gtk+3.
18159 (_EmacsFixedPrivate): Remove minwidth/height.
18160 Add struct frame *f.
18161 (emacs_fixed_init): Initialize priv->f.
18162 (get_parent_class, emacs_fixed_set_min_size): Remove.
18163 (emacs_fixed_new): Set priv->f to argument.
18164 (emacs_fixed_get_preferred_width)
18165 (emacs_fixed_get_preferred_height): Use min_width/height from
18166 frames size_hint to set minimum and natural (Bug#8919).
18167 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
18168 and use min_width/height from frames size_hint to set
18169 min_width/height (Bug#8919).
18170
18171 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
18172 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
18173 Fix indentation.
c7e73be5 18174
cf99dcf8
EZ
181752011-06-26 Eli Zaretskii <eliz@gnu.org>
18176
18177 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
18178 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
18179 called at ZV.
18180
029529ac
CY
181812011-06-26 Chong Yidong <cyd@stupidchicken.com>
18182
18183 * process.c (wait_reading_process_output): Bypass select if
18184 waiting for a cell while ignoring keyboard input, and input is
18185 pending. Suggested by Jan Djärv (Bug#8869).
18186
7a7ef429
PE
181872011-06-25 Paul Eggert <eggert@cs.ucla.edu>
18188
18189 Use gnulib's dup2 module instead of rolling our own.
18190 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
18191
11fdef7d 181922011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
18193
18194 * dispnew.c (scrolling_window): Before scrolling, turn off a
18195 mouse-highlight in the window being scrolled.
18196
cd3520a4
JB
181972011-06-24 Juanma Barranquero <lekktu@gmail.com>
18198
18199 Move DEFSYM to lisp.h and use everywhere.
18200
18201 * character.h (DEFSYM): Move declaration...
18202 * lisp.h (DEFSYM): ...here.
18203
18204 * gnutls.c:
18205 * minibuf.c:
18206 * w32menu.c:
18207 * w32proc.c:
18208 * w32select.c: Don't include character.h.
18209
18210 * alloc.c (syms_of_alloc):
18211 * buffer.c (syms_of_buffer):
18212 * bytecode.c (syms_of_bytecode):
18213 * callint.c (syms_of_callint):
18214 * casefiddle.c (syms_of_casefiddle):
18215 * casetab.c (init_casetab_once):
18216 * category.c (init_category_once, syms_of_category):
18217 * ccl.c (syms_of_ccl):
18218 * cmds.c (syms_of_cmds):
18219 * composite.c (syms_of_composite):
18220 * dbusbind.c (syms_of_dbusbind):
18221 * dired.c (syms_of_dired):
18222 * dispnew.c (syms_of_display):
18223 * doc.c (syms_of_doc):
18224 * editfns.c (syms_of_editfns):
18225 * emacs.c (syms_of_emacs):
18226 * eval.c (syms_of_eval):
18227 * fileio.c (syms_of_fileio):
18228 * fns.c (syms_of_fns):
18229 * frame.c (syms_of_frame):
18230 * fringe.c (syms_of_fringe):
18231 * insdel.c (syms_of_insdel):
18232 * keymap.c (syms_of_keymap):
18233 * lread.c (init_obarray, syms_of_lread):
18234 * macros.c (syms_of_macros):
18235 * msdos.c (syms_of_msdos):
18236 * print.c (syms_of_print):
18237 * process.c (syms_of_process):
18238 * search.c (syms_of_search):
18239 * sound.c (syms_of_sound):
18240 * syntax.c (init_syntax_once, syms_of_syntax):
18241 * terminal.c (syms_of_terminal):
18242 * textprop.c (syms_of_textprop):
18243 * undo.c (syms_of_undo):
18244 * w32.c (globals_of_w32):
18245 * window.c (syms_of_window):
18246 * xdisp.c (syms_of_xdisp):
18247 * xfaces.c (syms_of_xfaces):
18248 * xfns.c (syms_of_xfns):
18249 * xmenu.c (syms_of_xmenu):
18250 * xsettings.c (syms_of_xsettings):
18251 * xterm.c (syms_of_xterm): Use DEFSYM.
18252
4228cf16
TZ
182532011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
18254
cd3520a4 18255 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 18256
7fcccf1e
PE
182572011-06-23 Paul Eggert <eggert@cs.ucla.edu>
18258
7efb4e0e
PE
18259 Integer and buffer overflow fixes (Bug#8873).
18260
ff5844ad
PE
18261 * print.c (printchar, strout): Check for string overflow.
18262 (PRINTPREPARE, printchar, strout):
18263 Don't set size unless allocation succeeds.
18264
90532f02
PE
18265 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
18266 for sizes. Check for string overflow more accurately.
18267 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
18268
6d84508d
PE
18269 * macros.c: Integer and buffer overflow fixes.
18270 * keyboard.h (struct keyboard.kbd_macro_bufsize):
18271 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
18272 Use ptrdiff_t, not int, for sizes.
18273 Don't increment bufsize until after realloc succeeds.
18274 Check for size-calculation overflow.
18275 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
18276
437b2cb4
PE
18277 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
18278
8b9ac8b4
PE
18279 * lread.c: Integer overflow fixes.
18280 (read_integer): Radix is now EMACS_INT, not int,
18281 to improve quality of diagnostics for out-of-range radices.
18282 Calculate buffer size correctly for out-of-range radices.
18283 (read1): Check for integer overflow in radices, and in
18284 read-circle numbers.
82cb60d3
PE
18285 (read_escape): Avoid int overflow.
18286 (Fload, openp, read_buffer_size, read1)
18287 (substitute_object_recurse, read_vector, read_list, map_obarray):
18288 Use ptrdiff_t, not int, for sizes.
18289 (read1): Use EMACS_INT, not int, for sizes.
20270765 18290 Check for size overflow.
8b9ac8b4 18291
7fcccf1e
PE
18292 * image.c (cache_image): Check for size arithmetic overflow.
18293
bfbbd7e7
PE
18294 * lread.c: Integer overflow issues.
18295 (saved_doc_string_size, saved_doc_string_length)
18296 (prev_saved_doc_string_size, prev_saved_doc_string_length):
18297 Now ptrdiff_t, not int.
18298 (read1): Don't assume doc string length fits in int. Check for
18299 out-of-range doc string lengths.
18300 (read_list): Don't assume file position fits in int.
39019e54 18301 (read_escape): Check for hex character overflow.
bfbbd7e7 18302
4e323265
LL
183032011-06-22 Leo Liu <sdl.web@gmail.com>
18304
18305 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
18306 Move to minibuffer.el.
18307
85fece3e
PE
183082011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18309
20b84ce9 18310 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
18311 The following patches are for when GLYPH_DEBUG && !XASSERT.
18312 * dispextern.h (trace_redisplay_p, dump_glyph_string):
18313 * dispnew.c (flush_stdout):
18314 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
18315 Mark as externally visible.
18316 * dispnew.c (check_window_matrix_pointers): Now static.
18317 * dispnew.c (window_to_frame_vpos):
18318 * xfns.c (unwind_create_frame):
18319 * xterm.c (x_check_font): Remove unused local.
18320 * scroll.c (CHECK_BOUNDS):
18321 * xfaces.c (cache_fache): Rename local to avoid shadowing.
18322 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
18323 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
18324 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
18325 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
18326 Now static.
18327 (debug_method_add): Use va_list and vsprintf rather than relying
18328 on undefined behavior with wrong number of arguments.
18329 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
18330 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
18331 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
18332 since we're not interested in debugging glyphs with old libraries.
18333 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
18334 GCC 4.6.0's static checking.
18335
0766b489
PE
183362011-06-22 Paul Eggert <eggert@cs.ucla.edu>
18337
31fd4b32
PE
18338 Integer overflow and signedness fixes (Bug#8873).
18339 A few related buffer overrun fixes, too.
18340
b79e8648
PE
18341 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
18342
0766b489
PE
18343 * dispextern.h (struct face.stipple):
18344 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
18345 (x_bitmap_mask, x_allocate_bitmap_record)
18346 (x_create_bitmap_from_data, x_create_bitmap_from_file)
18347 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
18348 (x_create_bitmap_from_xpm_data):
18349 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
18350 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
18351 (.bitmaps_last):
18352 * xfaces.c (load_pixmap):
18353 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
18354 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
18355 (.bitmaps_last, struct x_output.icon_bitmap):
18356 Use ptrdiff_t, not int, for bitmap indexes.
18357 (x_allocate_bitmap_record): Check for size overflow.
18358 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
18359
b081724f
PE
18360 Use ptrdiff_t, not int, for overlay counts.
18361 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
18362 * editfns.c (overlays_around, get_pos_property):
18363 * textprop.c (get_char_property_and_overlay):
18364 * xdisp.c (next_overlay_change, note_mouse_highlight):
18365 * xfaces.c (face_at_buffer_position):
21514da7
PE
18366 * buffer.c (OVERLAY_COUNT_MAX): New macro.
18367 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
18368 (Fnext_overlay_change, Fprevious_overlay_change)
18369 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 18370 Use ptrdiff_t, not int, for sizes.
21514da7 18371 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 18372
3de73e5e
PE
18373 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
18374
2606c57b
PE
18375 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
18376 (x_session_initialize): Do not assume string length fits in int.
18377
aaafe47a
PE
18378 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
18379 This is unlikely, but can occur if DPI is outlandish.
18380
2674ddc8 18381 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
18382 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
18383
28154962
PE
18384 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
18385 * xrdb.c (magic_file_p, search_magic_path):
18386 Omit last arg SUFFIX; it was always 0. All callers changed.
18387 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
18388
7de51af5
PE
18389 * xfont.c (xfont_match): Avoid need for strlen.
18390
25ed6cc3
PE
18391 * xfns.c: Don't assume strlen fits in int.
18392 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
18393
4eab31dd
PE
18394 * xdisp.c (message_log_check_duplicate): Return intmax_t,
18395 not unsigned long, as we prefer signed integers. All callers changed.
18396 Detect integer overflow in repeat count.
18397 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 18398 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 18399
171e2a58
PE
18400 * termcap.c: Don't assume sizes fit in int and never overflow.
18401 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
18402 (gobble_line): Check for size-calculation overflow.
18403
ad39faca 18404 * minibuf.c (Fread_buffer):
6e5bb2dc 18405 * lread.c (intern, intern_c_string):
74ca2eb3
PE
18406 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
18407 Don't assume string length fits in int.
18408
52c61c22 18409 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
18410 * gtkutil.c (style_changed_cb): Avoid need for strlen.
18411
b5b8c9e5
PE
18412 * font.c: Don't assume string length fits in int.
18413 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
18414 Use ptrdiff_t, not int.
ccd6111c
PE
18415 (font_intern_prop): Don't assume string length fits in int.
18416 Don't assume integer property fits in fixnum.
18417 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 18418
882f0d81 18419 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 18420 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
18421 Reformulate so as not to need the command string.
18422 Invoke gzip -cd rather than gunzip, as it's more portable.
18423 (lock_info_type, lock_file_1, lock_file):
18424 Don't assume pid_t and time_t fit in unsigned long.
18425 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
18426 (current_lock_owner): Prefer signed type for sizes.
18427 Use memcpy, not strncpy, where memcpy is what is really wanted.
18428 Don't assume (via atoi) that time_t and pid_t fit in int.
18429 Check for time_t and/or pid_t out of range, e.g., via a network share.
18430 Don't alloca where an auto var works fine.
18431
93f4cf88
PE
18432 * fileio.c: Fix some integer overflow issues.
18433 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
18434 Don't assume string length fits in int.
18435 (directory_file_name): Don't assume string length fits in long.
18436 (make_temp_name): Don't assume pid fits in int, or that its print
18437 length is less than 20.
18438
f3e92b69
PE
18439 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
18440
1bfdaf10
PE
18441 * coding.c (make_subsidiaries): Don't assume string length fits in int.
18442
35016e9a
PE
18443 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
18444
3d1e65a1
PE
18445 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
18446 We prefer signed integers, even for size calculations.
18447
0b963a93
PE
18448 * emacs.c: Don't assume string length fits in 'int'.
18449 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
18450 (main): Don't invoke strlen when not needed.
18451
573f4b54
PE
18452 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
18453 (XD_DEBUG_MESSAGE): Don't waste a byte.
18454
989f33ba
PE
18455 * callproc.c (getenv_internal_1, getenv_internal)
18456 (Fgetenv_internal):
965d34eb
PE
18457 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
18458
e4d29b33
PE
18459 * lread.c (invalid_syntax): Omit length argument.
18460 All uses changed. This doesn't fix a bug, but it simplifies the
18461 code away from its former Hollerith-constant appearance, and it's
18462 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 18463 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 18464
eb49b136
PE
18465 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
18466 This didn't break anything, but it didn't help either.
18467 It's confusing to put a bogus integer in a place where the actual
18468 value does not matter.
9f62aeb1 18469 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 18470 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 18471
15375a22
PE
18472 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
18473 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
18474 implementation.
b61cc01c
PE
18475 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
18476 We prefer signed types, and the value cannot exceed the EMACS_INT
18477 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
18478 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
18479 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
18480 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 18481
53b2623d
PE
18482 * indent.c (sane_tab_width): New function.
18483 (current_column, scan_for_column, Findent_to, position_indentation)
18484 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 18485 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 18486
51cab52b 18487 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 18488
f2ed8a70
PE
18489 * lisp.h (lint_assume): New macro.
18490 * composite.c (composition_gstring_put_cache):
18491 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
18492
abe80cc6
PE
18493 * editfns.c, insdel.c:
18494 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 18495
b02c740e
PE
18496 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
18497
ebc96716
PE
18498 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
18499
b4e50fa0 18500 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 18501 Use much-faster test for byte-length change.
311d5d7c 18502 Don't assume string byte-length fits in 'int'.
a4cf38e4 18503 Check that character arg fits in 'int'.
85461888 18504 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 18505
c0c1ee9f
PE
18506 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
18507
a498d7f4
PE
18508 * fns.c (concat): Catch string overflow earlier.
18509 Do not rely on integer wraparound.
18510
51cab52b
PE
18511 * dispextern.h (struct it.overlay_strings_charpos)
18512 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
18513 * xdisp.c (forward_to_next_line_start)
18514 (back_to_previous_visible_line_start)
18515 (reseat_at_next_visible_line_start, next_element_from_buffer):
18516 Don't arbitrarily truncate the value of 'selective' to int.
18517
76031fad
PE
18518 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
18519
5eb55db9
PE
18520 * composite.c: Don't truncate sizes to 'int'.
18521 (composition_gstring_p, composition_reseat_it)
18522 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
18523 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
18524 not EMACS_UINT, for indexes.
5eb55db9 18525
0703a717
PE
18526 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
18527
d6202519
PE
18528 * buffer.c: Include <verify.h>.
18529 (struct sortvec.priority, struct sortstr.priority):
8961a454 18530 Now EMACS_INT, not int.
c20998a7 18531 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
18532 (struct sortstr.size, record_overlay_string)
18533 (struct sortstrlist.size, struct sortlist.used):
18534 Don't truncate size to int.
18535 (record_overlay_string): Check for size-calculation overflow.
d6202519 18536 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 18537
d5a19415
JM
185382011-06-22 Jim Meyering <meyering@redhat.com>
18539
029529ac 18540 Don't leak an XBM-image-sized buffer
d5a19415
JM
18541 * image.c (xbm_load): Free the image buffer after using it.
18542
a9041e6c
PE
185432011-06-21 Paul Eggert <eggert@cs.ucla.edu>
18544
18545 Port to Sun C.
18546 * composite.c (find_automatic_composition): Omit needless 'return 0;'
18547 that Sun C diagnosed.
18548 * fns.c (secure_hash): Fix pointer signedness issue.
18549 * intervals.c (static_offset_intervals): New function.
18550 (offset_intervals): Use it.
18551
7f3f739f
LL
185522011-06-21 Leo Liu <sdl.web@gmail.com>
18553
18554 * deps.mk (fns.o):
18555 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
18556 sha512.h.
18557
18558 * fns.c (secure_hash): Rename from crypto_hash_function and change
18559 the first arg to accept symbols.
5b66d427 18560 (Fsecure_hash): New primitive.
7f3f739f
LL
18561 (syms_of_fns): New symbols.
18562
76147d94
DD
185632011-06-20 Deniz Dogan <deniz@dogan.se>
18564
18565 * process.c (Fset_process_buffer): Clarify return value in
18566 docstring.
18567
7d7d0045
CY
185682011-06-18 Chong Yidong <cyd@stupidchicken.com>
18569
18570 * dispnew.c (add_window_display_history): Use BVAR.
18571
18572 * xdisp.c (debug_method_add): Use BVAR.
18573 (check_window_end, dump_glyph_matrix, dump_glyph)
18574 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
18575
18576 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
18577 Likewise.
18578
18579 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
18580 check till after the cache is created in init_frame_faces.
18581
ff2bc410
SM
185822011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
18583
18584 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
18585
28177add
PE
185862011-06-16 Paul Eggert <eggert@cs.ucla.edu>
18587
dd3482fe
PE
18588 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
18589 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
18590 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
18591
393d71f3 18592 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
18593 * fileio.c (Finsert_file_contents):
18594 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
18595 Remove the old (too-loose) buffer overflow checks.
18596 They weren't needed, since make_gap checks for buffer overflow.
18597 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
18598 The old code merely checked for Emacs fixnum overflow, and relied
18599 on undefined (wraparound) behavior. The new code avoids undefined
18600 behavior, and also checks for ptrdiff_t and/or size_t overflow.
18601
2e6813b0 18602 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
18603 Tune. Don't use wider integers than needed. Don't use alloca.
18604 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 18605
599a9e4f
PE
18606 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
18607
99561444
PE
18608 * insdel.c, lisp.h (buffer_overflow): New function.
18609 (insert_from_buffer_1, replace_range, replace_range_2):
18610 * insdel.c (make_gap_larger):
18611 * editfns.c (Finsert_char):
18612 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
18613
28177add
PE
18614 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
18615
e69dafad
PE
186162011-06-15 Paul Eggert <eggert@cs.ucla.edu>
18617
4baa020d 18618 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 18619
b1c46f02
PE
18620 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
18621 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
18622
e69dafad
PE
18623 * fileio.c: Don't assume EMACS_INT fits in off_t.
18624 (emacs_lseek): New static function.
18625 (Finsert_file_contents, Fwrite_region): Use it.
18626 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
18627
566684ea
PE
18628 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
18629
e6966cd6
PE
18630 * fns.c: Don't overflow int when computing a list length.
18631 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
18632 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
18633 truncation on 64-bit hosts. Check for QUIT every
18634 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
18635 faster and is responsive enough.
18636 (Flength): Report an error instead of overflowing an integer.
18637 (Fsafe_length): Return a float if the value is not representable
18638 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 18639 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 18640 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 18641
dd0b0efb
PE
18642 * alloc.c: Check that resized vectors' lengths fit in fixnums.
18643 (header_size, word_size): New constants.
18644 (allocate_vectorlike): Don't check size overflow here.
18645 (allocate_vector): Check it here instead, since this is the only
18646 caller of allocate_vectorlike that could cause overflow.
18647 Check that the new vector's length is representable as a fixnum.
18648
86fe5cfe
PE
18649 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
18650 The previous code was bogus. For example, next_almost_prime (32)
18651 returned 39, which is undesirable as it is a multiple of 3; and
18652 next_almost_prime (24) returned 25, which is a multiple of 5 so
18653 why was the code bothering to check for multiples of 7?
18654
80e88859
PE
18655 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
18656
4a2f0ad6
PE
18657 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
18658
f66c7cf8
PE
18659 Variadic C functions now count arguments with ptrdiff_t.
18660 This partly undoes my 2011-03-30 change, which replaced int with size_t.
18661 Back then I didn't know that the Emacs coding style prefers signed int.
18662 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
18663 were being counted with int, which may truncate counts on 64-bit
18664 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
18665 * lisp.h (struct Lisp_Subr.function.aMANY)
18666 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
18667 Arg counts are now ptrdiff_t, not size_t.
18668 All variadic functions and their callers changed accordingly.
18669 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
18670 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
18671 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
18672 * callint.c (Fcall_interactively): Check arg count for overflow,
18673 to avoid potential buffer overrun. Use signed char, not 'int',
18674 for 'varies' array, so that we needn't bother to check its size
18675 calculation for overflow.
18676 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
18677 * eval.c (apply_lambda):
18678 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
18679 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
18680 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
18681
a1759b76
PE
18682 * callint.c (Fcall_interactively): Don't use index var as event count.
18683
d96be9fc
PE
18684 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
18685 * mem-limits.h (SIZE): Remove; no longer used.
18686
a690a978 18687 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 18688
578c21e6
PE
18689 Remove unnecessary casts.
18690 * xterm.c (x_term_init):
18691 * xfns.c (x_set_border_pixel):
18692 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
18693 These aren't needed now that we assume ANSI C.
18694
96f53c6c
PE
18695 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
18696 It's more likely to cause problems (due to unsigned overflow)
18697 than to cure them.
18698
83c77d31
PE
18699 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
18700
ee2079f1
PE
18701 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
18702
6da65536
PE
18703 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
18704
7147c4a4
PE
18705 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
18706
193e32d9
PE
18707 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
18708
e5533da6
PE
18709 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
18710
9910e595
PE
18711 GLYPH_CODE_FACE returns EMACS_INT, not int.
18712 * dispextern.h (merge_faces):
18713 * xfaces.c (merge_faces):
01103c44
PE
18714 * xdisp.c (get_next_display_element, next_element_from_display_vector):
18715 Don't assume EMACS_INT fits in int.
9910e595 18716
2638320e
PE
18717 * character.h (CHAR_VALID_P): Remove unused parameter.
18718 * fontset.c, lisp.h, xdisp.c: All uses changed.
18719
045eb8d9
PE
18720 * editfns.c (Ftranslate_region_internal): Omit redundant test.
18721
c1f134b5
PE
18722 * fns.c (concat): Minor tuning based on overflow analysis.
18723 This doesn't fix any bugs. Use int to hold character, instead
18724 of constantly refetching from Emacs object. Use XFASTINT, not
18725 XINT, for value known to be a character. Don't bother comparing
18726 a single byte to 0400, as it's always less.
18727
395fcb93 18728 * floatfns.c (Fexpt):
327eeec8
PE
18729 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
18730
abbd3d23
PE
18731 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
18732 for characters.
18733
684a03ef
PE
18734 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
18735
0fed43f3
PE
18736 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
18737 Without this fix, on a 64-bit host (aset S 0 4294967386) would
18738 incorrectly succeed when S was a string, because 4294967386 was
18739 truncated before it was used.
18740
8fd02eb7
PE
18741 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
18742 Otherwise, an out-of-range integer could cause undefined behavior
18743 on a 64-bit host.
18744
f8c86b69
PE
18745 * composite.c: Use int, not EMACS_INT, for characters.
18746 (fill_gstring_body, composition_compute_stop_pos): Use int, not
18747 EMACS_INT, for values that are known to be in character range.
18748 This doesn't fix any bugs but is the usual style inside Emacs and
18749 may generate better code on 32-bit machines.
18750
34206dd2
PE
18751 Make sure a 64-bit char is never passed to ENCODE_CHAR.
18752 This is for reasons similar to the recent CHAR_STRING fix.
18753 * charset.c (Fencode_char): Check that character arg is actually
18754 a character. Pass an int to ENCODE_CHAR.
18755 * charset.h (ENCODE_CHAR): Verify that the character argument is no
18756 wider than 'int', as a compile-time check to prevent future regressions
18757 in this area.
18758
c5958d4c 18759 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
18760
18761 Make sure a 64-bit char is never passed to CHAR_STRING.
18762 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
18763 by silently ignoring the top 32 bits, allowing some values
18764 that were far too large to be valid characters.
18765 * character.h: Include <verify.h>.
18766 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
18767 arguments are no wider than unsigned, as a compile-time check
18768 to prevent future regressions in this area.
18769 * data.c (Faset):
01103c44 18770 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
18771 (Fsubst_char_in_region):
18772 * fns.c (concat):
18773 * xdisp.c (decode_mode_spec_coding):
18774 Adjust to CHAR_STRING's new requirement.
18775 * editfns.c (Finsert_char, Fsubst_char_in_region):
18776 * fns.c (concat): Check that character args are actually
18777 characters. Without this test, these functions did the wrong
18778 thing with wildly out-of-range values on 64-bit hosts.
18779
d37ca623
PE
18780 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
18781 These casts should not be needed on 32-bit hosts, either.
18782 * keyboard.c (read_char):
18783 * lread.c (Fload): Remove casts to unsigned.
18784
ea204efb
PE
18785 * lisp.h (UNSIGNED_CMP): New macro.
18786 This fixes comparison bugs on 64-bit hosts.
18787 (ASCII_CHAR_P): Use it.
18788 * casefiddle.c (casify_object):
01103c44 18789 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
18790 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
18791 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
18792 * dispextern.h (FACE_FROM_ID):
18793 * keyboard.c (read_char): Use UNSIGNED_CMP.
18794
41cb286c
PE
18795 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
18796 not to EMACS_INT, to avoid GCC warning.
18797
4a1b9832
PE
18798 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
18799
55daad71
PE
18800 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
18801 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
18802 isn't needed on 32-bit machines.
8f95c75c 18803
01103c44
PE
18804 * buffer.c (Fgenerate_new_buffer_name):
18805 Use EMACS_INT for count, not int.
0ceccced 18806 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
18807
18808 * data.c (Qcompiled_function): Now static.
18809
c6f072e7
PE
18810 * window.c (window_body_lines): Now static.
18811
20ce5912
PE
18812 * image.c (gif_load): Rename local to avoid shadowing.
18813
9c4c5f81
PE
18814 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
18815 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
18816 * alloc.c (make_save_value): Integer argument is now of type
18817 ptrdiff_t, not int.
18818 (mark_object): Use ptrdiff_t, not int.
18819 * lisp.h (pD): New macro.
18820 * print.c (print_object): Use it.
18821
c0c5c8ae
PE
18822 * alloc.c: Use EMACS_INT, not int, to count objects.
18823 (total_conses, total_markers, total_symbols, total_vector_size)
18824 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
18825 (total_free_floats, total_floats, total_free_intervals)
18826 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
18827 Now EMACS_INT, not int. All uses changed.
18828 (Fgarbage_collect): Compute overall total using a double, so that
18829 integer overflow is less likely to be a problem. Check for overflow
18830 when converting back to an integer.
5a25e253
PE
18831 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
18832 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
18833 These were 'int' variables that could overflow on 64-bit hosts;
18834 they were never used, so remove them instead of repairing them.
211a0b2a 18835 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
18836 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
18837 Previously, this ceilinged at INT_MAX, but that doesn't work on
18838 64-bit machines.
e46bb31a 18839 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 18840
c78baabf 18841 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 18842 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
18843 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
18844 when a (possibly-narrower) signed value would do just as well.
18845 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 18846
c9d624c6
PE
18847 * alloc.c: Catch some string size overflows that we were missing.
18848 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
18849 for convenience in STRING_BYTES_MAX.
18850 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
18851 The definition here is exact; the one in lisp.h was approximate.
18852 (allocate_string_data): Check for string overflow. This catches
18853 some instances we weren't catching before. Also, it catches
18854 size_t overflow on (unusual) hosts where SIZE_MAX <= min
18855 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
18856 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 18857
c9d624c6
PE
18858 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
18859 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 18860 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 18861
353032ce
PE
18862 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
18863
2bccce07
PE
18864 * alloc.c (Fmake_string): Check for out-of-range init.
18865
0ac30604
SM
188662011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
18867
18868 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
18869
c195f2de
JD
188702011-06-14 Jan Djärv <jan.h.d@swipnet.se>
18871
18872 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
18873 xg_get_default_scrollbar_width.
18874
18875 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
18876 (int_gtk_range_get_value): Move to the scroll bar part of the file.
18877 (style_changed_cb): Call update_theme_scrollbar_width and call
18878 x_set_scroll_bar_default_width and xg_frame_set_char_size for
18879 all frames (Bug#8505).
18880 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
18881 Call gtk_window_set_resizable if HAVE_GTK3.
18882 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
18883 and height if HAVE_GTK3 (Bug#8505).
18884 (scroll_bar_width_for_theme): New variable.
18885 (update_theme_scrollbar_width): New function.
18886 (xg_get_default_scrollbar_width): Move code to
18887 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
18888 (xg_initialize): Call update_theme_scrollbar_width.
18889
18890 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
18891
18892 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
18893
e10ac9f1
MR
188942011-06-12 Martin Rudalics <rudalics@gmx.at>
18895
18896 * frame.c (make_frame): Call other_buffer_safely instead of
18897 other_buffer.
18898
18899 * window.c (temp_output_buffer_show): Call display_buffer with
18900 second argument Vtemp_buffer_show_specifiers and reset latter
18901 immediately after the call.
18902 (Vtemp_buffer_show_specifiers): New variable.
18903 (auto_window_vscroll_p, next_screen_context_lines)
18904 (Vscroll_preserve_screen_position): Remove leading asterisks from
18905 doc-strings.
18906
2d3c217e 189072011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 18908
7b7f97e8 18909 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
18910 * buffer.c (Qclone_number): Remove for now, as it's unused.
18911 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
18912 (record_buffer): Remove unused local.
18913 * frame.c (other_visible_frames, frame_buffer_list): Now static.
18914 (set_frame_buffer_list): Remove; unused.
18915 * frame.h (other_visible_frames): Remove decl.
18916 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
18917 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
18918 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
18919 if HAVE_GPM.
18920 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
18921 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
18922 Define only if HAVE_GPM.
18923 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
18924 (update_hints_inhibit): Remove; never set. All uses removed.
18925 * widgetprv.h (emacsFrameClassRec): Remove decl.
18926 * window.c (delete_deletable_window): Now returns void, since it
18927 wasn't returning anything.
18928 (compare_window_configurations): Remove unused locals.
18929 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
18930 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
18931 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
18932 the same widths as pointers. This follows up on the 2011-05-06 patch.
18933 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
18934 * xterm.h: Likewise.
18935 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
18936
1384b89e
JB
189372011-06-12 Juanma Barranquero <lekktu@gmail.com>
18938
18939 * makefile.w32-in: Update dependencies.
18940 (LISP_H): Add lib/intprops.h.
18941
1100a63c
CY
189422011-06-11 Chong Yidong <cyd@stupidchicken.com>
18943
18944 * image.c (gif_load): Add animation frame delay to the metadata.
18945 (syms_of_image): Use DEFSYM. New symbol `delay'.
18946
6198ccd0
MR
189472011-06-11 Martin Rudalics <rudalics@gmx.at>
18948
18949 * window.c (delete_deletable_window): Re-add.
18950 (Fset_window_configuration): Rewrite to handle dead buffers and
18951 consequently deletable windows.
18952 (window_tree, Fwindow_tree): Remove. Supply functionality in
18953 window.el.
18954 (compare_window_configurations): Simplify code.
18955
b6e3633c
AS
189562011-06-11 Andreas Schwab <schwab@linux-m68k.org>
18957
1ab0dee5
AS
18958 * image.c (imagemagick_load_image): Fix type mismatch.
18959 (Fimagemagick_types): Likewise.
18960
b6e3633c
AS
18961 * window.h (replace_buffer_in_windows): Declare.
18962
9397e56f
MR
189632011-06-11 Martin Rudalics <rudalics@gmx.at>
18964
18965 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
18966 Qclone_number. Remove external declaration of Qdelete_window.
18967 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
18968 code.
640c8776
SM
18969 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
18970 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
18971 (Fother_buffer): Rewrite doc-string. Major rewrite for new
18972 buffer list implementation.
18973 (other_buffer_safely): New function.
18974 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
18975 calls to replace_buffer_in_windows and
18976 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
18977 if allowed.
18978 (record_buffer): Inhibit quitting and rewrite using quittable
18979 functions. Run Qbuffer_list_update_hook if allowed.
18980 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
18981 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
18982 Move switch-to-buffer to window.el.
9397e56f
MR
18983 (bury-buffer): Move to window.el.
18984 (Vbuffer_list_update_hook): New variable.
18985
18986 * lisp.h (other_buffer_safely): Add prototype in buffer.c
18987 section.
18988
18989 * window.h (resize_frame_windows): Move up in code.
18990 (Fwindow_frame): Remove EXFUN.
18991 (replace_buffer_in_all_windows): Remove prototype.
18992 (replace_buffer_in_windows_safely): Add prototype.
18993
18994 * window.c: Declare Qdelete_window static again. Move down
18995 declaration of select_count.
18996 (Fnext_window, Fprevious_window): Rewrite doc-strings.
18997 (Fother_window): Move to window.el.
18998 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
18999 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
19000 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
19001 window.el.
19002 (replace_buffer_in_windows): Implement by calling
19003 Qreplace_buffer_in_windows.
19004 (replace_buffer_in_all_windows): Remove with some functionality
19005 moved into replace_buffer_in_windows_safely.
19006 (replace_buffer_in_windows_safely): New function.
19007 (select_window_norecord, select_frame_norecord): Move in front
19008 of run_window_configuration_change_hook. Remove now obsolete
19009 declarations.
640c8776
SM
19010 (Fset_window_buffer): Rewrite doc-string.
19011 Call Qrecord_window_buffer.
9397e56f
MR
19012 (keys_of_window): Move binding for other-window to window.el.
19013
b50691aa
CY
190142011-06-11 Chong Yidong <cyd@stupidchicken.com>
19015
19016 * dispextern.h (struct image): Replace data member, whose int_val
19017 and ptr_val fields were not used by anything, with a single
19018 lisp_val object.
19019
19020 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
19021 (gif_clear_image, gif_load, imagemagick_load_image)
19022 (gs_clear_image, gs_load): Callers changed.
19023
3f754b86
PE
190242011-06-10 Paul Eggert <eggert@cs.ucla.edu>
19025
cca69397
PE
19026 * buffer.h: Include <time.h>, for time_t.
19027 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
19028
109e28d0
PE
19029 Fix minor problems found by static checking.
19030
60737f02
PE
19031 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
19032
4b66faf3
PE
19033 Make identifiers static if they are not used in other modules.
19034 * data.c (Qcompiled_function, Qframe, Qvector):
19035 * image.c (QimageMagick, Qsvg):
19036 * minibuf.c (Qmetadata):
19037 * window.c (resize_window_check, resize_root_window): Now static.
19038 * window.h (resize_window_check, resize_root_window): Remove decls.
19039
109e28d0
PE
19040 * window.c (window_deletion_count, delete_deletable_window):
19041 Remove; unused.
46a4ce9e
PE
19042 (window_body_lines): Now static.
19043 (Fdelete_other_windows_internal): Mark vars as initialized.
19044 Make sure 'resize_failed' is initialized.
19045 (run_window_configuration_change_hook): Rename local to avoid shadowing.
19046 (resize_window_apply): Remove unused local.
19047 * window.h (delete_deletable_window): Remove decl.
19048
109e28d0 19049 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
19050 (imagemagick_load_image): Fix pointer signedness problem by changing
19051 last arg from unsigned char * to char *. All uses changed.
19052 Also, fix a local for similar reasons.
19053 Remove unused locals. Remove locals to avoid shadowing.
19054 (fn_rsvg_handle_free): Remove; unused.
19055 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 19056 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 19057
3f754b86
PE
19058 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
19059
2547adb1
CY
190602011-06-10 Chong Yidong <cyd@stupidchicken.com>
19061
19062 * image.c (gif_load): Fix omitted cast error introduced by
19063 2011-06-06 change.
19064
2c8e37d4
MR
190652011-06-10 Martin Rudalics <rudalics@gmx.at>
19066
19067 * window.h (resize_proportionally, orig_total_lines)
19068 (orig_top_line): Remove from window structure.
19069 (set_window_height, set_window_width, change_window_heights)
19070 (Fdelete_window): Remove prototypes.
19071 (resize_frame_windows): Remove duplicate declaration.
19072
440a42e3
EZ
190732011-06-10 Eli Zaretskii <eliz@gnu.org>
19074
19075 * window.h (resize_frame_windows, resize_window_check)
19076 (delete_deletable_window, resize_root_window)
19077 (resize_frame_windows): Declare prototypes.
19078
19079 * window.c (resize_window_apply): Make definition be "static" to
19080 match the prototype.
19081
562dd5e9
MR
190822011-06-10 Martin Rudalics <rudalics@gmx.at>
19083
19084 * window.c: Remove declarations of Qwindow_size_fixed,
19085 window_min_size_1, window_min_size_2, window_min_size,
19086 size_window, window_fixed_size_p, enlarge_window, delete_window.
19087 Remove static from declaration of Qdelete_window, it's
19088 temporarily needed by Fbury_buffer.
19089 (replace_window): Don't assign orig_top_line and
19090 orig_total_lines.
19091 (Fdelete_window, delete_window): Remove. Window deletion is
19092 handled by window.el.
640c8776
SM
19093 (window_loop): Remove DELETE_OTHER_WINDOWS case.
19094 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
19095 (Fdelete_other_windows): Remove. Deleting other windows is
19096 handled by window.el.
19097 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
19098 handled in window.el.
19099 (window_min_size_2, window_min_size_1, window_min_size): Remove.
19100 Window minimum sizes are handled in window.el.
19101 (shrink_windows, size_window, set_window_height)
19102 (set_window_width, change_window_heights, window_height)
19103 (window_width, CURBEG, CURSIZE, enlarge_window)
19104 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
19105 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
19106 handled in window.el.
19107 (make_dummy_parent): Rename to make_parent_window and give it a
19108 second argument horflag.
19109 (make_window): Don't set resize_proportionally any more.
19110 (Fsplit_window): Remove. Windows are split in window.el.
19111 (save_restore_action, save_restore_orig_size)
19112 (shrink_window_lowest_first, save_restore_orig_size): Remove.
19113 Resize mini windows in window.el.
19114 (grow_mini_window, shrink_mini_window): Implement by calling
19115 Qresize_root_window_vertically, resize_window_check and
19116 resize_window_apply.
640c8776
SM
19117 (saved_window, Fset_window_configuration, save_window_save):
19118 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
19119 resize_proportionally.
19120 (window_min_height, window_min_width): Move to window.el.
19121 (keys_of_window): Move bindings for delete-other-windows,
19122 split-window, delete-window and enlarge-window to window.el.
19123
19124 * buffer.c: Temporarily extern Qdelete_window.
19125 (Fbury_buffer): Temporarily call Qdelete_window instead of
19126 Fdelete_window (Fbury_buffer will move to window.el soon).
19127
19128 * frame.c (set_menu_bar_lines_1): Remove code handling
19129 orig_top_line and orig_total_lines.
19130
19131 * dispnew.c (adjust_frame_glyphs_initially): Don't use
19132 set_window_height but set heights directly.
19133 (change_frame_size_1): Use resize_frame_windows.
19134
19135 * xdisp.c (init_xdisp): Don't use set_window_height but set
19136 heights directly.
19137
640c8776
SM
19138 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
19139 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
19140 run_window_configuration_change_hook.
19141
19142 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
19143 instead of change_window_heights and run
19144 run_window_configuration_change_hook.
19145
1a13852e
MR
191462011-06-09 Martin Rudalics <rudalics@gmx.at>
19147
19148 * window.c (replace_window): Rename second argument REPLACEMENT to
19149 NEW. New third argument SETFLAG. Rewrite.
19150 (delete_window, make_dummy_parent): Call replace_window with
19151 third argument 1.
19152 (window_list_1): Move down in code.
19153 (run_window_configuration_change_hook): Move set_buffer part
19154 before select_frame_norecord part in order to unwind correctly.
19155 Rename count1 to count.
19156 (recombine_windows, delete_deletable_window, resize_root_window)
19157 (Fdelete_other_windows_internal)
19158 (Frun_window_configuration_change_hook, make_parent_window)
19159 (resize_window_check, resize_window_apply, Fresize_window_apply)
19160 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
19161 (Fdelete_window_internal, Fresize_mini_window_internal):
19162 New functions.
1a13852e
MR
19163 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
19164
f3d1777e
MR
191652011-06-08 Martin Rudalics <rudalics@gmx.at>
19166
496e208e
MR
19167 * window.h (window): Add some new members to window structure -
19168 normal_lines, normal_cols, new_total, new_normal, clone_number,
19169 splits, nest, prev_buffers, next_buffers.
19170 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 19171 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 19172
f3d1777e
MR
19173 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
19174 Remove.
496e208e
MR
19175 (make_dummy_parent): Set new members of windows structure.
19176 (make_window): Move down in code. Handle new members of window
19177 structure.
19178 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
19179 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
19180 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
19181 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
19182 (Fset_window_next_buffers, Fset_window_clone_number):
19183 New functions.
496e208e
MR
19184 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
19185 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
19186 Doc-string fixes.
19187 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
19188 Argument WINDOW can be now internal window too.
19189 (Fwindow_use_time): Move up in code.
19190 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
19191 Rewrite doc-string.
19192 (Fset_window_configuration, saved_window)
19193 (Fcurrent_window_configuration, save_window_save): Handle new
19194 members of window structure.
b9e809c2
MR
19195 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
19196 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
19197 (syms_of_window): New Lisp objects Qrecord_window_buffer,
19198 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
19199 Qget_mru_window, Qresize_root_window,
19200 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
19201 Qauto_buffer_name; staticpro them.
f3d1777e 19202
abde8f8c
MR
192032011-06-07 Martin Rudalics <rudalics@gmx.at>
19204
19205 * window.c (Fwindow_total_size, Fwindow_left_column)
19206 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
19207 (Fwindow_list_1): New functions.
19208 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
19209 (Fwindow_width, Fscroll_left, Fscroll_right):
19210 Use window_body_cols instead of window_box_text_cols.
19211 (delete_window, Fset_window_configuration):
19212 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
19213 (delete_all_subwindows): Take a window as argument and not a
19214 structure. Rewrite.
190b47e6
MR
19215 (window_loop): Remove handling of GET_LRU_WINDOW and
19216 GET_LARGEST_WINDOW.
19217 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
19218
19219 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
19220 window_box_text_cols. delete_all_subwindows now takes a
19221 Lisp_Object as argument.
abde8f8c 19222
640c8776
SM
19223 * indent.c (compute_motion, Fcompute_motion):
19224 Use window_body_cols instead of window_box_text_cols.
abde8f8c 19225
fa8a67e6
MR
19226 * frame.c (delete_frame): Call delete_all_subwindows with root
19227 window as argument.
19228
a54e3482
DC
192292011-06-07 Daniel Colascione <dan.colascione@gmail.com>
19230
19231 * fns.c (Fputhash): Document return value.
19232
60002bf5
CY
192332011-06-06 Chong Yidong <cyd@stupidchicken.com>
19234
19235 * image.c (gif_load): Implement gif89a spec "no disposal" method.
19236
0c671da6 192372011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 19238
b862a52a 19239 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 19240
be44ca6c
PE
19241 Check for overflow when converting integer to cons and back.
19242 * charset.c (Fdefine_charset_internal, Fdecode_char):
19243 Use cons_to_unsigned to catch overflow.
19244 (Fencode_char): Use INTEGER_TO_CONS.
19245 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
19246 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
19247 * data.c (long_to_cons, cons_to_long): Remove.
19248 (cons_to_unsigned, cons_to_signed): New functions.
19249 These signal an error for invalid or out-of-range values.
19250 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
19251 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
19252 * font.c (Ffont_variation_glyphs):
19253 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
19254 * lisp.h: Include <intprops.h>.
19255 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
19256 (cons_to_signed, cons_to_unsigned): New decls.
19257 (long_to_cons, cons_to_long): Remove decls.
19258 * undo.c (record_first_change): Use INTEGER_TO_CONS.
19259 (Fprimitive_undo): Use CONS_TO_INTEGER.
19260 * xfns.c (Fx_window_property): Likewise.
19261 * xselect.c: Include <limits.h>.
19262 (x_own_selection, selection_data_to_lisp_data):
19263 Use INTEGER_TO_CONS.
19264 (x_handle_selection_request, x_handle_selection_clear)
19265 (x_get_foreign_selection, Fx_disown_selection_internal)
19266 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
19267 (lisp_data_to_selection_data): Use cons_to_unsigned.
19268 (x_fill_property_data): Use cons_to_signed.
19269 Report values out of range.
19270
d1f3d2af
PE
19271 Check for buffer and string overflow more precisely.
19272 * buffer.h (BUF_BYTES_MAX): New macro.
19273 * lisp.h (STRING_BYTES_MAX): New macro.
19274 * alloc.c (Fmake_string):
19275 * character.c (string_escape_byte8):
19276 * coding.c (coding_alloc_by_realloc):
19277 * doprnt.c (doprnt):
19278 * editfns.c (Fformat):
19279 * eval.c (verror):
19280 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
19281 since they may not be the same number.
19282 * editfns.c (Finsert_char):
19283 * fileio.c (Finsert_file_contents):
19284 Likewise for BUF_BYTES_MAX.
19285
dd52fcea
PE
19286 * image.c: Use ptrdiff_t, not int, for sizes.
19287 (slurp_file): Switch from int to ptrdiff_t.
19288 All uses changed.
19289 (slurp_file): Check that file size fits in both size_t (for
19290 malloc) and ptrdiff_t (for sanity and safety).
19291
7f9bbdbb
PE
19292 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
19293 if b->modtime has its maximal value.
19294
dfe18f82
PE
19295 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
19296
84acfcf0
PE
19297 Don't assume time_t can fit into int.
19298 * buffer.h (struct buffer.modtime): Now time_t, not int.
19299 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
19300 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
19301
ccd9a01a
PE
19302 Minor fixes for signed vs unsigned integers.
19303 * character.h (MAYBE_UNIFY_CHAR):
19304 * charset.c (maybe_unify_char):
19305 * keyboard.c (read_char, reorder_modifiers):
19306 XINT -> XFASTINT, since the integer must be nonnegative.
19307 * ftfont.c (ftfont_spec_pattern):
19308 * keymap.c (access_keymap, silly_event_symbol_error):
19309 XUINT -> XFASTINT, since the integer must be nonnegative.
19310 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
19311 since it makes no difference and we prefer signed.
19312 * keyboard.c (record_char): Use XUINT when all the neighbors do.
19313 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
19314 nonnegative.
19315
d6d100dd
SM
193162011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
19317
19318 * window.h (Fwindow_frame): Declare.
19319
2b6148e4
PE
193202011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19321
19322 * alloc.c: Simplify handling of large-request failures (Bug#8800).
19323 (SPARE_MEMORY): Always define.
19324 (LARGE_REQUEST): Remove.
19325 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
19326
f230ecc9
MR
193272011-06-06 Martin Rudalics <rudalics@gmx.at>
19328
727e958e
MR
19329 * lisp.h: Move EXFUNS for Fframe_root_window,
19330 Fframe_first_window and Fset_frame_selected_window to window.h.
19331
19332 * window.h: Move EXFUNS for Fframe_root_window,
19333 Fframe_first_window and Fset_frame_selected_window here from
19334 lisp.h.
19335
19336 * frame.c (Fwindow_frame, Fframe_first_window)
19337 (Fframe_root_window, Fframe_selected_window)
19338 (Fset_frame_selected_window): Move to window.c.
19339 (Factive_minibuffer_window): Move to minibuf.c.
19340 (Fother_visible_frames_p): New function.
19341
19342 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
19343
f230ecc9
MR
19344 * window.c (decode_window, decode_any_window): Move up in code.
19345 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
19346 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
19347 (Fwindow_buffer): Move up and rewrite doc-string.
19348 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
19349 (Fwindow_prev): New functions.
727e958e
MR
19350 (Fwindow_frame): Move here from frame.c. Accept any window as
19351 argument.
19352 (Fframe_root_window, Fframe_first_window)
19353 (Fframe_selected_window): Move here from frame.c. Accept frame
19354 or arbitrary window as argument. Update doc-strings.
19355 (Fminibuffer_window): Move up in code.
19356 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
19357 (Fset_frame_selected_window): Move here from frame.c.
19358 Marginal rewrite.
727e958e
MR
19359 (Fselected_window, select_window, Fselect_window): Move up in
19360 code. Minor doc-string fixes.
f230ecc9 19361
4d09bcf6
PE
193622011-06-06 Paul Eggert <eggert@cs.ucla.edu>
19363
19364 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
19365 Do not assume that spare memory exists; that assumption is valid
19366 only if SYSTEM_MALLOC.
19367 (LARGE_REQUEST): New macro, so that the issue of large requests
19368 is separated from the issue of spare memory.
19369
810928a2
AS
193702011-06-05 Andreas Schwab <schwab@linux-m68k.org>
19371
172418ad
AS
19372 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
19373 format. (Bug#8806)
19374
43f862f7
AS
19375 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
19376
810928a2
AS
19377 * xfns.c (x_set_scroll_bar_default_width): Move declarations
19378 before statements.
19379
a059fe24
JD
193802011-06-05 Jan Djärv <jan.h.d@swipnet.se>
19381
19382 * gtkutil.c (xg_get_default_scrollbar_width): New function.
19383
19384 * gtkutil.h: Declare xg_get_default_scrollbar_width.
19385
19386 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
19387 min width by calling x_set_scroll_bar_default_width (Bug#8505).
19388
989bf368
JB
193892011-06-05 Juanma Barranquero <lekktu@gmail.com>
19390
19391 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
19392
4b80f674
CY
193932011-06-04 Chong Yidong <cyd@stupidchicken.com>
19394
19395 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
19396 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
19397 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
19398 New error handlers.
4b80f674
CY
19399 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
19400 Obey Vx_select_enable_clipboard_manager. Catch errors in
19401 x_clipboard_manager_save (Bug#8779).
19402 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 19403 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 19404
99a33b77 194052011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
19406
19407 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
19408
99a33b77 194092011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
19410
19411 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
19412 in the current matrix if keep_current_p is non-zero.
19413
8264569d
EZ
194142011-06-04 Eli Zaretskii <eliz@gnu.org>
19415
19416 * bidi.c (bidi_level_of_next_char): Fix last change.
19417
57f97249
EZ
194182011-06-03 Eli Zaretskii <eliz@gnu.org>
19419
fec2107c 19420 Support bidi reordering of text covered by display properties.
57f97249 19421
fec2107c
EZ
19422 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
19423 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
19424 (bidi_cache_search, bidi_cache_iterator_state)
19425 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
19426 (bidi_level_of_next_char, bidi_move_to_visually_next):
19427 Support character positions inside a run of characters covered by a
fec2107c
EZ
19428 display string.
19429 (bidi_paragraph_init, bidi_resolve_explicit_1)
19430 (bidi_level_of_next_char): Call bidi_fetch_char and
19431 bidi_fetch_char_advance instead of FETCH_CHAR and
19432 FETCH_CHAR_ADVANCE.
19433 (bidi_init_it): Initialize new members.
19434 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
19435 definitions.
19436 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
19437 instead of using explicit *_CHAR codes.
d6d100dd
SM
19438 (bidi_resolve_explicit, bidi_resolve_weak):
19439 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
19440 bidirectional text is supported only in multibyte buffers.
19441 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
19442 it to initialize the frame_window_p member of struct bidi_it.
19443 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
19444 (bidi_resolve_explicit, bidi_resolve_weak)
19445 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
19446 bidi_it->nchars is non-positive.
19447 (bidi_level_of_next_char): Don't try to lookup the cache for the
19448 next/previous character if nothing is cached there yet, or if we
19449 were just reseat()'ed to a new position.
c40e2fb2 19450
0e14fe90
EZ
19451 * xdisp.c (set_cursor_from_row): Set start and stop points
19452 according to the row's direction when priming the loop that looks
19453 for the glyph on which to display cursor.
19454 (single_display_spec_intangible_p): Function deleted.
19455 (display_prop_intangible_p): Reimplement to call
19456 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
19457 Accept 3 additional arguments needed by handle_display_spec.
19458 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
19459 values: lists, `(when COND...)' forms, etc.
19460 (single_display_spec_string_p): Support property values that are
19461 lists with the argument STRING its top-level element.
19462 (display_prop_string_p): Fix the condition for processing a
19463 property that is a list to be consistent with handle_display_spec.
fec2107c 19464 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
19465 last portion of handle_display_prop.
19466 (compute_display_string_pos): Accept additional argument
19467 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
19468 value of a `display' property is a "replacing spec".
19469 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
19470 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
19471 the display property, but just return a value indicating whether
19472 the display property will replace the characters it covers.
19473 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
19474 frame_window_p members of struct bidi_it.
d6d100dd
SM
19475 (compute_display_string_pos, compute_display_string_end):
19476 New functions.
fec2107c
EZ
19477 (push_it): Accept second argument POSITION, where pop_it should
19478 jump to continue iteration.
19479 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 19480
fec2107c
EZ
19481 * keyboard.c (adjust_point_for_property): Adjust the call to
19482 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
19483
19484 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
19485 (bidi_init_it): Update prototypes.
19486 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
19487 (compute_display_string_pos, compute_display_string_end):
19488 Declare prototypes.
fec2107c
EZ
19489 (struct bidi_it): New members nchars and disp_pos. ch_len is now
19490 EMACS_INT.
fc6f18ce 19491
40087514 194922011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 19493
57f53182
PE
19494 Malloc failure behavior now depends on size of allocation.
19495 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
19496 * lisp.h: Change signatures accordingly.
19497 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
19498 All callers changed. (Bug#8762)
19499
19500 * gnutls.c: Use Emacs's memory allocators.
19501 Without this change, the gnutls library would invoke malloc etc.
19502 directly, which causes problems on non-SYNC_INPUT hosts, and which
19503 runs afoul of improving memory_full behavior. (Bug#8761)
19504 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
19505 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
19506 xfree instead of the default malloc, realloc, free.
19507 (Fgnutls_boot): No need to check for memory allocation failure,
19508 since xmalloc does that for us.
19509
ac32cd99 19510 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
19511 * category.c (hash_get_category_set):
19512 * ccl.c (ccl_driver):
19513 * charset.c (Fdefine_charset_internal):
19514 * charset.h (struct charset.hash_index):
19515 * composite.c (get_composition_id, gstring_lookup_cache)
19516 (composition_gstring_put_cache):
19517 * composite.h (struct composition.hash_index):
19518 * dispextern.h (struct image.hash):
19519 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
19520 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
19521 (hashfn_equal, hashfn_user_defined, make_hash_table)
19522 (maybe_resize_hash_table, hash_lookup, hash_put)
19523 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
19524 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
19525 (Fsxhash, Fgethash, Fputhash, Fmaphash):
19526 * image.c (make_image, search_image_cache, lookup_image)
19527 (xpm_put_color_table_h):
19528 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 19529 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 19530 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 19531 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
19532 * alloc.c (allocate_vectorlike):
19533 Check for overflow in vector size calculations.
19534 * ccl.c (ccl_driver):
19535 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
19536 * fns.c, image.c: Remove unnecessary static decls that would otherwise
19537 need to be updated by these changes.
40087514
PE
19538 * fns.c (make_hash_table, maybe_resize_hash_table):
19539 Check for integer overflow with large hash tables.
0de4bb68
PE
19540 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
19541 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
19542 (SXHASH_REDUCE): New macro.
19543 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
19544 Use it instead of discarding useful hash info with large hash values.
19545 (sxhash_float): New function.
19546 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
19547 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
19548 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
19549 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
19550 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
19551 Adjust signatures to match updated version of code.
19552 (consing_since_gc): Now EMACS_INT, since a single hash table can
19553 use more than INT_MAX bytes.
19554
698d32e2
DN
195552011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
19556
19557 Make it possible to build with GCC-4.6+ -O2 -flto.
19558
19559 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
19560
fd6fa53f
SM
195612011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
19562
19563 * minibuf.c (get_minibuffer, read_minibuf_unwind):
19564 Call minibuffer-inactive-mode.
19565
864db017
JB
195662011-05-31 Juanma Barranquero <lekktu@gmail.com>
19567
19568 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
19569 Update dependencies.
19570
2ad0baf4
DN
195712011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19572
19573 * data.c (init_data): Remove code for UTS, this system is not
19574 supported anymore.
19575
4fcc2638
DN
195762011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19577
19578 Don't force ./temacs to start in terminal mode.
19579
19580 * frame.c (make_initial_frame): Initialize faces in all cases, not
19581 only when CANNOT_DUMP is defined.
19582 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
19583
c56e0fd5
DN
195842011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19585
19586 * dispnew.c (add_window_display_history): Use const for the string
19587 pointer. Remove declaration, not needed.
19588
333d54da 195892011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 19590
55d4c1b2 19591 Use 'inline', not 'INLINE'.
333d54da 19592 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
19593 * alloc.c, fontset.c (INLINE): Remove.
19594 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
19595 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
19596 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
19597 * gmalloc.c (register_heapinfo): Use inline unconditionally.
19598 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
19599
738db178
DN
196002011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
19601
19602 Make it possible to run ./temacs.
19603
19604 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
19605 syms_of_callproc does the same thing. Remove test for
19606 "initialized", do it in the caller.
19607 * emacs.c (main): Avoid calling set_initial_environment when dumping.
19608
620c53a6
SM
196092011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
19610
19611 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
19612 (read_minibuf): Use get_minibuffer.
19613 (syms_of_minibuf): Use DEFSYM.
19614 (Qmetadata): New var.
19615 * data.c (Qbuffer): Don't make it static.
19616 (syms_of_data): Use DEFSYM.
19617
e003a292
PE
196182011-05-31 Paul Eggert <eggert@cs.ucla.edu>
19619
19620 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
19621 (CCL_CODE_MIN): New macro.
19622
ed008a6d
PE
196232011-05-30 Paul Eggert <eggert@cs.ucla.edu>
19624
3687c2ef
PE
19625 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
19626
ed008a6d
PE
19627 * eval.c (Qdebug): Now static.
19628 * lisp.h (Qdebug): Remove decl. This reverts a part of the
19629 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
19630 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
19631
d66c4c7c
CY
196322011-05-29 Chong Yidong <cyd@stupidchicken.com>
19633
19634 * image.c: Various fixes to ImageMagick code comments.
19635 (Fimagemagick_types): Doc fix.
19636
5fbc2025
PE
196372011-05-29 Paul Eggert <eggert@cs.ucla.edu>
19638
0196f88a
PE
19639 Minor fixes prompted by GCC 4.6.0 warnings.
19640
19641 * xselect.c (converted_selections, conversion_fail_tag): Now static.
19642
5fbc2025
PE
19643 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
19644 (x_clipboard_manager_save_all): Move extern decl to ...
19645 * xterm.h: ... here, so that it can be checked for consistency.
19646
1dd3c2d9
CY
196472011-05-29 Chong Yidong <cyd@stupidchicken.com>
19648
19649 * xselect.c (x_clipboard_manager_save_frame)
19650 (x_clipboard_manager_save_all): New functions.
19651 (Fx_clipboard_manager_save): Lisp function deleted.
19652
19653 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
19654 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
19655
19656 * xterm.h: Update prototype.
19657
5ba6571d
WX
196582011-05-28 William Xu <william.xwl@gmail.com>
19659
19660 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
19661 exiting (Bug#8239).
19662
3eaff834
JM
196632011-05-28 Jim Meyering <meyering@redhat.com>
19664
e1900994 19665 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
19666 * fns.c (to_uchar): Define.
19667 (crypto_hash_function): Use it to convert some newly-signed
19668 variables to unsigned, to avoid sign-extension bugs. For example,
19669 without this change, (md5 "truc") would evaluate to
19670 45723a2aff78ff4fff7fff1114760e62 rather than the expected
19671 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 19672 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 19673
0f6990a7
PE
196742011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19675
19676 Integer overflow fixes.
c8a9ca5a 19677
08686060
PE
19678 * dbusbind.c: Serial number integer overflow fixes.
19679 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
19680 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
19681 to hold a serial number that is too large for a fixnum.
19682 (Fdbus_method_return_internal, Fdbus_method_error_internal):
19683 Check for serial numbers out of range. Decode any serial number
59568bf0 19684 that was so large that it became a float. (Bug#8722)
08686060 19685
2d1fc3c7
PE
19686 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
19687 (Fdbus_call_method, Fdbus_call_method_asynchronously):
19688 Use XFASTINT rather than XUINT when numbers are nonnegative.
19689 (xd_append_arg, Fdbus_method_return_internal):
19690 (Fdbus_method_error_internal): Likewise. Also, for unsigned
19691 arguments, check that Lisp number is nonnegative, rather than
59568bf0 19692 silently wrapping negative numbers around. (Bug#8722)
30217ff0 19693 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 19694 (Bug#8722)
2d1fc3c7 19695
c8a9ca5a
PE
19696 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
19697
519e1d69
PE
19698 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
19699
6df6ae42 19700 ccl: Add integer overflow checks.
30569699
PE
19701 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
19702 (IN_INT_RANGE): New macros.
19703 (ccl_driver): Use them to check for integer overflow when
19704 decoding a CCL program. Many of the new checks are whether XINT (x)
19705 fits in int; it doesn't always, on 64-bit hosts. The new version
19706 doesn't catch all possible integer overflows, but it's an
847044ea 19707 improvement. (Bug#8719)
30569699 19708
c11285dc
PE
19709 * alloc.c (make_event_array): Use XINT, not XUINT.
19710 There's no need for unsigned here.
19711
fdccd48e
PE
19712 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
19713 This follows up to the 2011-05-06 change that substituted uintptr_t
19714 for EMACS_INT. This case wasn't caught back then.
19715
37910ab2
PE
19716 Rework Fformat to avoid integer overflow issues.
19717 * editfns.c: Include <float.h> unconditionally, as it's everywhere
19718 now (part of C89). Include <verify.h>.
19719 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
19720 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
19721 (Fformat): Avoid the prepass trying to compute sizes; it was only
19722 approximate and thus did not catch overflow reliably. Instead, walk
19723 through the format just once, formatting and computing sizes as we go,
19724 checking for integer overflow at every step, and allocating a larger
19725 buffer as needed. Keep track separately whether the format is
19726 multibyte. Keep only the most-recently calculated precision, rather
19727 than them all. Record whether each argument has been converted to
19728 string. Use EMACS_INT, not int, for byte and char and arg counts.
19729 Support field widths and precisions larger than INT_MAX. Avoid
19730 sprintf's undefined behavior with conversion specifications such as %#d
19731 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
19732 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
19733 formatting out-of-range floating point numbers with int
9173deec 19734 formats. (Bug#8668)
37910ab2 19735
2e6578fb
PE
19736 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
19737
0ae6bdee
PE
19738 * data.c: Avoid integer truncation in expressions involving floats.
19739 * data.c: Include <intprops.h>.
19740 (arith_driver): When there's an integer overflow in an expression
19741 involving floating point, convert the integers to floating point
19742 so that the resulting value does not suffer from catastrophic
19743 integer truncation. For example, on a 64-bit host (* 4
19744 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
19745 Do not rely on undefined behavior after integer overflow.
19746
de883a70
PE
19747 merge count_size_as_multibyte, parse_str_to_multibyte
19748 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 19749 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
19750 Check for integer overflow.
19751 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
19752 since it's now a duplicate of the other. This is more of
19753 a character than a buffer op, so better that it's in character.c.
19754 * fns.c, print.c: Adjust to above changes.
19755
2ff916cb
PE
197562011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
19757
19758 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
19759
f1b54466
PE
197602011-05-27 Paul Eggert <eggert@cs.ucla.edu>
19761
fb1ac845
PE
19762 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19763 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
19764 (x_clipboard_manager_save): Now static.
19765 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
19766
f1b54466
PE
19767 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
19768 (crypto_hash_function): Now static.
19769 Fix pointer signedness problems. Avoid unnecessary initializations.
19770
a9f737ee
CY
197712011-05-27 Chong Yidong <cyd@stupidchicken.com>
19772
19773 * termhooks.h (Vselection_alist): Make it terminal-local.
19774
19775 * terminal.c (create_terminal): Initialize it.
19776
19777 * xselect.c: Support for clipboard managers.
19778 (Vselection_alist): Move to termhooks.h as terminal-local var.
19779 (LOCAL_SELECTION): New macro.
19780 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
19781 (symbol_to_x_atom): Remove gratuitous arg.
19782 (x_handle_selection_request, lisp_data_to_selection_data)
19783 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
19784 (x_own_selection, x_get_local_selection, x_convert_selection):
19785 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
19786 (some_frame_on_display): Delete unused function.
19787 (Fx_own_selection_internal, Fx_get_selection_internal)
19788 (Fx_disown_selection_internal, Fx_selection_owner_p)
19789 (Fx_selection_exists_p): New optional frame arg.
19790 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
19791 (x_handle_selection_clear): Don't treat other terminals with the
19792 same keyboard specially. Use the terminal-local Vselection_alist.
19793 (x_clear_frame_selections): Use Frun_hook_with_args.
19794
19795 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
19796
19797 * xterm.h: Add support for those atoms.
19798
e067f0c1
CY
197992011-05-26 Chong Yidong <cyd@stupidchicken.com>
19800
19801 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
19802 (converted_selections, conversion_fail_tag): New global variables.
19803 (x_selection_request_lisp_error): Free the above.
19804 (x_get_local_selection): Remove unnecessary code.
19805 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
19806 of converted selections stored in converted_selections.
19807 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
19808 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
19809 (x_convert_selection): New function.
19810 (x_handle_selection_event): Simplify.
19811 (x_get_foreign_selection): Don't ignore incoming requests while
19812 waiting for an answer; this will fail when we implement
19813 SAVE_TARGETS, and seems unnecessary anyway.
19814 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
19815 (Vx_sent_selection_functions): Doc fix.
19816
0f4aebc0
LL
198172011-05-26 Leo Liu <sdl.web@gmail.com>
19818
19819 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
19820
e61124cd
YM
198212011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19822
19823 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
19824
19825 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
19826 for fringe update if it has periodic bitmap.
ac389d0c 19827 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
19828 and fringe_bitmap_periodic_p.
19829
19830 * fringe.c (get_fringe_bitmap_data): New function.
19831 (draw_fringe_bitmap_1, update_window_fringes): Use it.
19832 (update_window_fringes): Record periodicity of fringe bitmap in glyph
19833 row. Mark glyph row for fringe update if periodicity changed.
19834
19835 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
19836 for fringe update unless it has periodic bitmap.
19837
f16d9837
KH
198382011-05-25 Kenichi Handa <handa@m17n.org>
19839
19840 * xdisp.c (get_next_display_element): Set correct it->face_id for
19841 a static composition.
19842
e1b90ef6
LL
198432011-05-24 Leo Liu <sdl.web@gmail.com>
19844
19845 * deps.mk (fns.o):
19846 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
19847
19848 * fns.c (crypto_hash_function, Fsha1): New function.
19849 (Fmd5): Use crypto_hash_function.
19850 (syms_of_fns): Add Ssha1.
19851
7400048f
PE
198522011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19853
19854 * gnutls.c: Remove unused macros.
19855 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
19856 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
19857 Remove macros that are defined and never used.
19858 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
19859
abb71cf4
CY
198602011-05-22 Chong Yidong <cyd@stupidchicken.com>
19861
19862 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
19863 (Fx_get_selection_internal): Minor cleanup.
19864 (Fx_own_selection_internal): Rename arguments for consistency with
19865 select.el.
19866
6307db39
PE
198672011-05-22 Paul Eggert <eggert@cs.ucla.edu>
19868
19869 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
19870
f3d4e0a4
CY
198712011-05-22 Chong Yidong <cyd@stupidchicken.com>
19872
19873 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
19874
4d8ade89
YM
198752011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
19876
19877 * dispnew.c (scrolling_window): Don't exclude the case that the
19878 last enabled row in the desired matrix touches the bottom boundary.
19879
32078c8d
GM
198802011-05-21 Glenn Morris <rgm@gnu.org>
19881
19882 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
19883 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
19884 and add some more files.
32078c8d 19885
7285dc67
EZ
198862011-05-20 Eli Zaretskii <eliz@gnu.org>
19887
19888 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
19889 report_file_error introduced by the change from 2011-05-07.
19890
89d1bd22
PE
198912011-05-20 Paul Eggert <eggert@cs.ucla.edu>
19892
19893 * systime.h (Time): Define only if emacs is defined.
19894 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
19895 where the include path doesn't have X11/X.h by default. See
19896 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
19897
cd394be1 198982011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
19899
19900 * composite.c (find_automatic_composition): Fix previous change.
19901
b9704ad9
GM
199022011-05-20 Glenn Morris <rgm@gnu.org>
19903
19904 * lisp.mk: New file, split from Makefile.in.
19905 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
19906 (shortlisp): Remove.
19907 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
19908
4a720484
GM
199092011-05-19 Glenn Morris <rgm@gnu.org>
19910
19911 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
19912 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
19913 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
19914 (lisp): Set the order to that of loadup.el.
19915 (shortlisp): Make it a copy of $lisp.
19916 (SOME_MACHINE_LISP): Remove.
19917 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
19918 Use just $shortlisp, not $SOME_MACHINE_LISP too.
19919
a28d4396
KH
199202011-05-18 Kenichi Handa <handa@m17n.org>
19921
19922 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
19923 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
19924 (find_automatic_composition): Mostly rewrite for efficiency.
19925
a2b1fa8e
JB
199262011-05-18 Juanma Barranquero <lekktu@gmail.com>
19927
19928 * makefile.w32-in: Update dependencies.
19929
8e1f5610
CS
199302011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
19931
19932 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 19933 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 19934
7025ee00 199352011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 19936
cdfa6eab
PE
19937 Fix some integer overflow issues, such as string length overflow.
19938
06d6db33
PE
19939 * insdel.c (count_size_as_multibyte): Check for string overflow.
19940
2b4560a8
PE
19941 * character.c (lisp_string_width): Check for string overflow.
19942 Use EMACS_INT, not int, for string indexes and lengths; in
19943 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
19944 the resulting string length overflows an EMACS_INT; instead,
19945 report a string overflow if no precision given. When checking for
19946 precision exhaustion, use a check that cannot possibly have
19947 integer overflow. (Bug#8675)
19948 * character.h (lisp_string_width): Adjust to new signature.
19949
cb93f9be
PE
19950 * alloc.c (string_overflow): New function.
19951 (Fmake_string): Use it. This doesn't change behavior, but saves
19952 a few bytes and will simplify future changes.
19953 * character.c (string_escape_byte8): Likewise.
19954 * lisp.h (string_overflow): New decl.
19955
1a1f3366
PE
19956 Fixups, following up to the user-interface timestamp change.
19957 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
19958 for UI timestamps, instead of unsigned long.
9fbd6841
PE
19959 * msdos.c (mouse_get_pos): Likewise.
19960 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
19961 * w32gui.h (Time): Define by including "systime.h" rather than by
19962 declaring it ourselves. (Bug#8664)
19963
d4e3e4d3
PE
19964 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
19965 * image.c (clear_image_cache): Likewise.
19966
f6a24d19
PE
19967 * term.c (term_mouse_position): Don't assume time_t wraparound.
19968
08dc5ae6
PE
19969 Be more systematic about user-interface timestamps.
19970 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
19971 and sometimes 'EMACS_UINT', to represent these timestamps.
19972 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
19973 This makes the code easier to follow, and makes it easier to catch
19974 integer overflow bugs such as Bug#8664.
19975 * frame.c (Fmouse_position, Fmouse_pixel_position):
19976 Use Time, not unsigned long, for user-interface timestamps.
19977 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
19978 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
19979 * keyboard.h (last_event_timestamp): Likewise.
19980 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
19981 * menu.h (xmenu_show): Likewise.
19982 * term.c (term_mouse_position): Likewise.
19983 * termhooks.h (struct input_event.timestamp): Likewise.
19984 (struct terminal.mouse_position_hook): Likewise.
19985 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
19986 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
19987 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
19988 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
19989 what it was before.
19990 * menu.h, termhooks.h: Include "systime.h", for Time.
19991
8e55734a
PE
19992 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
19993 Don't assume that the difference between two unsigned long values
19994 can fit into an integer. At this point, we know button_down_time
19995 <= event->timestamp, so the difference must be nonnegative, so
19996 there's no need to cast the result if double-click-time is
19997 nonnegative, as it should be; check that it's nonnegative, just in
19998 case. This bug is triggered when events are more than 2**31 ms
86db42d2 19999 apart (about 25 days). (Bug#8664)
8e55734a 20000
841f1b75 20001 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 20002 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 20003
3e26f69c
PE
20004 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
20005 that always fit in int. Use a sentinel instead of a counter, to
20006 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
20007 * frame.h (struct frame): Use int for menu_bar_items_used
20008 instead of EMACS_INT, since it always fits in int.
3e26f69c 20009
5cc152c0
PE
20010 * menu.c (grow_menu_items): Check for int overflow.
20011
d89eb65e
PE
20012 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
20013
5235bd3e
PE
20014 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
20015 Before, the code was not consistent. These values cannot exceed
20016 2**31 - 1 so there's no need to make them unsigned.
20017 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
20018 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
20019 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
20020 as modifiers.
20021 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
20022
bc827e23
PE
20023 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
20024 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
20025 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
20026 presumably because the widths might not match.
20027
78eb494e
PE
20028 * window.c (size_window): Avoid needless test at loop start.
20029
04f2d78b
CB
200302011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
20031
20032 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
20033
d2fc7e3d 200342011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
20035
20036 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
20037
d2fc7e3d 200382011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
20039
20040 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
20041 `width' to `bar_area_x' and `bar_area_width', respectively.
20042 (x_scroll_run): Take account of fringe background extension.
20043
04f2d78b
CB
20044 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
20045 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
20046 `bar_area_width', respectively.
20047 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
20048 background extension.
20049
79b70037
GM
200502011-05-10 Jim Meyering <meyering@redhat.com>
20051
20052 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
20053
2f142cc5
JB
200542011-05-10 Juanma Barranquero <lekktu@gmail.com>
20055
20056 * image.c (Finit_image_library): Return t for built-in image types,
20057 like pbm and xbm. (Bug#8640)
20058
57679c86
AS
200592011-05-09 Andreas Schwab <schwab@linux-m68k.org>
20060
20061 * w32menu.c (set_frame_menubar): Fix submenu allocation.
20062
888c9e86
EZ
200632011-05-07 Eli Zaretskii <eliz@gnu.org>
20064
b0512a1d
EZ
20065 * w32console.c (Fset_screen_color): Doc fix.
20066 (Fget_screen_color): New function.
20067 (syms_of_ntterm): Defsubr it.
20068
7285dc67
EZ
20069 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
20070 unlink the temporary file if Fcall_process didn't create it in the
20071 first place.
20072 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
20073 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
20074 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
20075 cue to call_process_cleanup not to close that handle.
20076
4d3fcc8e
BK
200772011-05-07 Ben Key <bkey76@gmail.com>
20078
20079 * makefile.w32-in: The bootstrap-temacs rule now makes use of
20080 one of two shell specific rules, either bootstrap-temacs-CMD or
20081 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
20082 to the previous implementation of the bootstrap-temacs rule.
20083 The bootstrap-temacs-CMD rule is similar to the previous
20084 implementation of the bootstrap-temacs rule except that it
20085 makes use of the ESC_CFLAGS variable instead of the CFLAGS
20086 variable.
20087
20088 These changes, along with some changes to nt/configure.bat,
20089 nt/gmake.defs, and nt/nmake.defs, are required to extend my
20090 earlier fix to add support for --cflags and --ldflags options
20091 that include quotes so that it works whether make uses cmd or
20092 sh as the shell.
20093
b4289b64
MA
200942011-05-06 Michael Albinus <michael.albinus@gmx.de>
20095
20096 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
20097 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
20098 is a constant.
20099 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
20100 a string. Handle both cases.
20101 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
20102 (Fdbus_register_method): Use Qinvalid_function.
20103
af4c0e28
JB
201042011-05-06 Juanma Barranquero <lekktu@gmail.com>
20105
20106 * makefile.w32-in: Update dependencies.
20107 (LISP_H): Add inttypes.h and stdin.h.
20108 (PROCESS_H): Add unistd.h.
20109
c51453d9
EZ
201102011-05-06 Eli Zaretskii <eliz@gnu.org>
20111
20112 * lread.c: Include limits.h (fixes the MS-Windows build broken by
20113 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
20114
8ff0ac3c 201152011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 20116
4c4b566b
PE
20117 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
20118
aab2b9b5
PE
20119 * term.c (vfatal): Remove stray call to va_end.
20120 It's not needed and the C Standard doesn't allow it here anyway.
20121
c378da0b
PE
20122 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
20123 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
20124
288b08c7
PE
20125 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
20126 bytes.
20127
e3601888
PE
20128 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
20129
db6c0e74
PE
20130 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
20131
dd5963ea
PE
20132 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
20133
88c9450f
PE
20134 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
20135
2f9442b8
PE
20136 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
20137
c032b5f8
PE
20138 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
20139 * charset.c (Fdefine_charset_internal): Don't initialize
20140 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 20141 32-bit int (Bug#8600).
a108c10b
PE
20142
20143 * lread.c (read_integer): Be more consistent with string-to-number.
20144 Use string_to_number to do the actual conversion; this avoids
20145 rounding errors and fixes some other screwups. Without this fix,
20146 for example, #x1fffffffffffffff was misread as -2305843009213693952.
20147 (digit_to_number): Move earlier, for benefit of read_integer.
20148 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 20149 not a digit in any supported base. (Bug#8602)
a108c10b 20150
ad5f9eea
PE
20151 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
20152
aec1708a
PE
20153 * dispnew.c (scrolling_window): Return 1 if we scrolled,
20154 to match comment at start of function. This also removes a
20155 GCC warning about overflow in a 32+64-bit port.
20156
47be4ab5
PE
20157 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
20158
371cac43
PE
20159 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
20160 Reported by Stefan Monnier in
20161 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
20162 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20163 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 20164
d01a7826
PE
20165 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
20166 (EMACS_UINTPTR): Likewise, with uintptr_t.
20167
7fd47d5c
PE
20168 * lisp.h: Prefer 64-bit EMACS_INT if available.
20169 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
20170 on 32-bit hosts that have 64-bit int, so that they can access
20171 large files.
122b0c86
PE
20172 However, temporarily disable this change unless the temporary
20173 symbol WIDE_EMACS_INT is defined.
7fd47d5c 20174
8727937b
PE
20175 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
20176
8ac068ac
PE
20177 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
20178 This removes an assumption that EMACS_INT and long are the same
20179 width as pointers. The assumption is true for Emacs porting targets
20180 now, but we want to make other targets possible.
20181 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
20182 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
20183 In the rest of the code, change types of integers that hold casted
20184 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
20185 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
20186 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
20187 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
20188 No need to cast type when ORing.
20189 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
20190 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
20191 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
20192 assume EMACS_INT is the same width as char *.
20193 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
20194 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
20195 Remove no-longer-needed casts.
20196 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
20197 (xg_tool_bar_help_callback, xg_make_tool_item):
20198 Use EMACS_INTPTR to hold an integer
20199 that will be cast to void *; this can avoid a GCC warning
20200 if EMACS_INT is not the same width as void *.
20201 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
20202 * xdisp.c (display_echo_area_1, resize_mini_window_1):
20203 (current_message_1, set_message_1):
20204 Use a local to convert to proper width without a cast.
20205 * xmenu.c (dialog_selection_callback): Likewise.
20206
ede49d71
PE
20207 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
20208 Also, don't assume VALBITS / RAND_BITS is less than 5,
20209 and don't rely on undefined behavior when shifting a 1 left into
20210 the sign bit.
20211 * lisp.h (get_random): Change signature to match.
20212
2f30ecd0
PE
20213 * lread.c (hash_string): Use size_t, not int, for hash computation.
20214 Normally we prefer signed values; but hashing is special, because
20215 it's better to use unsigned division on hash table sizes so that
20216 the remainder is nonnegative. Also, size_t is the natural width
20217 for hashing into memory. The previous code used 'int', which doesn't
20218 retain enough info to hash well into very large tables.
20219 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
20220
2a866e7b
PE
20221 * dbusbind.c: Don't possibly lose pointer info when converting.
20222 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
20223 Use XPNTR rather than XHASH, so that the high-order bits of
20224 the pointer aren't lost when converting through void *.
20225
51639eac
PE
20226 * eval.c (Fautoload): Don't double-shift a pointer.
20227
92394119
PE
20228 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
20229
dbdb9a7c
JB
202302011-05-06 Juanma Barranquero <lekktu@gmail.com>
20231
20232 * gnutls.c (DEF_GNUTLS_FN):
20233 * image.c (DEF_IMGLIB_FN): Make function pointers static.
20234
db7a0b4f
AS
202352011-05-05 Andreas Schwab <schwab@linux-m68k.org>
20236
20237 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
20238 marker. (Bug#8610)
20239
cd394be1 202402011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
20241
20242 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
20243 New version that can reserve upto 2GB of heap space.
20244
f7ff1b0f 202452011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
20246
20247 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
20248
639c109b
TZ
202492011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
20250
20251 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
20252 `gnutls_certificate_set_x509_key_file'.
20253
d2127135
JB
202542011-05-05 Juanma Barranquero <lekktu@gmail.com>
20255
20256 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
20257 Update dependencies.
20258
e968f4f3
JB
202592011-05-04 Juanma Barranquero <lekktu@gmail.com>
20260
20261 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
20262 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
20263 Remove unused parameter `fildes'.
20264 * process.c (read_process_output, send_process): Don't pass it.
20265
84d358f0
JB
202662011-05-04 Juanma Barranquero <lekktu@gmail.com>
20267
20268 Fix previous change: the library cache is defined in w32.c.
20269 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
20270 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
20271
0898ca10
JB
202722011-05-04 Juanma Barranquero <lekktu@gmail.com>
20273
20274 Implement dynamic loading of GnuTLS on Windows.
20275
20276 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
20277 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
20278 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20279 Declare.
20280
20281 * gnutls.c (Qgnutls_dll): Define.
20282 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
20283 (gnutls_*): Declare function pointers.
20284 (init_gnutls_functions): New function to initialize function pointers.
20285 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
20286 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
20287 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
20288 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
20289 (emacs_gnutls_write, emacs_gnutls_read)
20290 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
20291 (Fgnutls_available_p): New function.
20292 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
20293 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
20294 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
20295
20296 * image.c: Include w32.h.
20297 (Vimage_type_cache): Delete.
20298 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
20299 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
20300 (w32_delayed_load): Move to w32.c.
20301
20302 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
20303
20304 * w32.c (QCloaded_from, Vlibrary_cache): Define.
20305 (w32_delayed_load): Move from image.c. When loading a library, record
20306 its filename in the :loaded-from property of the library id.
20307 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
20308 Initialize and staticpro them.
20309 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
20310
20311 * process.c: Include lisp.h before w32.h, not after.
20312 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
20313 instead of gnutls_record_check_pending.
20314
20315 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
20316
ff4de4aa
TZ
203172011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
20318
20319 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
20320 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
20321 as passed in.
20322
abe95abb
JD
203232011-05-03 Jan Djärv <jan.h.d@swipnet.se>
20324
20325 * xterm.c (x_set_frame_alpha): Do not set property on anything
20326 else than FRAME_X_OUTER_WINDOW (Bug#8608).
20327
e16e55d4
JB
203282011-05-02 Juanma Barranquero <lekktu@gmail.com>
20329
20330 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
20331
bafcf6a5
JB
203322011-05-02 Juanma Barranquero <lekktu@gmail.com>
20333
20334 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
20335 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
20336 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
20337 (gnutls_global_initialized, Qgnutls_bootprop_priority)
20338 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
20339 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
20340 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
20341 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
20342 (Qgnutls_bootprop_callbacks_verify): Make static.
20343
e7a6747f
AS
203442011-05-01 Andreas Schwab <schwab@linux-m68k.org>
20345
19ed11ba
AS
20346 * callproc.c: Indentation fixup.
20347
e7a6747f 20348 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
20349 (wait_for_termination, interruptible_wait_for_termination):
20350 Move after wait_for_termination_1.
e7a6747f 20351
1ef14cb4
LMI
203522011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
20353
20354 * sysdep.c (interruptible_wait_for_termination): New function
20355 which is like wait_for_termination, but allows keyboard
20356 interruptions.
20357
20358 * callproc.c (Fcall_process): Add (:file "file") as an option for
20359 the STDOUT buffer.
20360 (Fcall_process_region): Ditto.
20361
330d880c
EZ
203622011-04-30 Eli Zaretskii <eliz@gnu.org>
20363
8db90b73
EZ
20364 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
20365 rather than `XVECTOR (FOO)->size'.
20366
330d880c
EZ
20367 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
20368 inttypes.h, as a gnulib replacement is used if it not available in
20369 system headers.
20370
15cbd324
EZ
203712011-04-21 Eli Zaretskii <eliz@gnu.org>
20372
20373 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
20374 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
20375 of MOST_POSITIVE_FIXNUM. (Bug#8528)
20376
20377 * coding.c (coding_alloc_by_realloc): Error out if destination
20378 will grow beyond MOST_POSITIVE_FIXNUM.
20379 (decode_coding_emacs_mule): Abort if there isn't enough place in
20380 charbuf for the composition carryover bytes. Reserve an extra
20381 space for up to 2 characters produced in a loop.
20382 (decode_coding_iso_2022): Abort if there isn't enough place in
20383 charbuf for the composition carryover bytes.
20384
203852011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 20386
ae940cca
EZ
20387 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
20388 aborting when %lld or %lll format is passed.
20389 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
20390 %llo or %llx format is passed. (Bug#8545)
20391
03ab8921
EZ
20392 * window.c (window_scroll_line_based): Use a marker instead of
20393 simple variables to record original value of point. (Bug#7952)
20394
afda1437
EZ
20395 * doprnt.c (doprnt): Fix the case where a multibyte sequence
20396 produced by %s or %c overflows available buffer space. (Bug#8545)
20397
f76dee0c
PE
203982011-04-28 Paul Eggert <eggert@cs.ucla.edu>
20399
20400 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 20401 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 20402
fdc5744d
JB
204032011-04-28 Juanma Barranquero <lekktu@gmail.com>
20404
20405 * w32.c (init_environment): Warn about defaulting HOME to C:\.
20406
638f053a
JB
204072011-04-28 Juanma Barranquero <lekktu@gmail.com>
20408
20409 * keyboard.c (Qdelayed_warnings_hook): Define.
20410 (command_loop_1): Run `delayed-warnings-hook'
20411 if Vdelayed_warnings_list is non-nil.
20412 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
20413 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
20414
d178f871
EZ
204152011-04-28 Eli Zaretskii <eliz@gnu.org>
20416
20417 * doprnt.c (doprnt): Don't return value smaller than the buffer
20418 size if the message was truncated. (Bug#8545).
20419
b124fd93
JB
204202011-04-28 Juanma Barranquero <lekktu@gmail.com>
20421
20422 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
20423 (Fx_window_property): #if-0 the whole functions, not just the bodies.
20424
e810457d
PE
204252011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20426
20427 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
20428
ea51cceb
JB
204292011-04-27 Juanma Barranquero <lekktu@gmail.com>
20430
20431 * makefile.w32-in: Update dependencies.
20432
94dcfacf
EZ
204332011-04-27 Eli Zaretskii <eliz@gnu.org>
20434
20435 Improve `doprnt' and its usage. (Bug#8545)
20436 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
20437 `format_end'. Remove support for %l as a conversion specifier.
20438 Don't use xrealloc. Improve diagnostics when the %l size modifier
20439 is used. Update the commentary.
20440
20441 * eval.c (verror): Simplify calculation of size_t.
20442
20443 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
20444 messages.
20445
f61f41d7
PE
204462011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
20447
20448 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
20449 change.
20450
96fb4434
PE
204512011-04-27 Paul Eggert <eggert@cs.ucla.edu>
20452
20453 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
20454 This makes this file independent of the recent pseudovector change.
20455
671875da 204562011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 20457
69e9b5a3
PE
20458 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
20459
b5f869a7 20460 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 20461 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 20462 Remove unused local.
c8926152 20463 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 20464
841a1577 20465 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
20466 GCC 4.6.0 optimizes based on type-based alias analysis.
20467 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
20468 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
20469 != &v->size, and therefore "v->size = 1; b->size = 2; return
20470 v->size;" must therefore return 1. This assumption is incorrect
20471 for Emacs, since it type-puns struct Lisp_Vector * with many other
20472 types. To fix this problem, this patch adds a new type struct
f904488f 20473 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
20474 and pseudovectors, and helps optimizing compilers not get fooled
20475 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
20476 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
20477 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
20478 the size member.
eab3844f
PE
20479 (XSETPVECTYPE): Rewrite in terms of new macro.
20480 (XSETPVECTYPESIZE): New macro, specifying both type and size.
20481 This is a bit clearer, and further avoids the possibility of
20482 undesirable aliasing.
20483 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 20484 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
20485 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
20486 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
20487 (ASIZE): Now uses header.size rather than size.
20488 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
20489 to avoid the hassle of writing XVECTOR (foo)->header.size.
20490 (struct vectorlike_header): New type.
eab3844f
PE
20491 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
20492 object, to help avoid aliasing.
20493 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
20494 (SUBRP): Likewise, since Lisp_Subr is a special case.
20495 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
20496 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
20497 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 20498 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
20499 changed to be "header.size" and "header.next".
20500 * buffer.h (struct buffer): Likewise.
20501 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
20502 * frame.h (struct frame): Likewise.
20503 * process.h (struct Lisp_Process): Likewise.
20504 * termhooks.h (struct terminal): Likewise.
20505 * window.c (struct save_window_data, struct saved_window): Likewise.
20506 * window.h (struct window): Likewise.
20507 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
20508 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
20509 * buffer.c (init_buffer_once): Likewise.
20510 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
20511 special case.
20512 * process.c (Fformat_network_address): Use local var for size,
20513 for brevity.
20514
0df1eac5
PE
20515 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
20516
847ab9d1 20517 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
20518 * data.c (atof): Remove decl; no longer used or needed.
20519 (digit_to_number): Move to lread.c.
20520 (Fstring_to_number): Use new string_to_number function, to be
20521 consistent with how the Lisp reader treats infinities and NaNs.
20522 Do not assume that floating-point numbers represent EMACS_INT
20523 without losing information; this is not true on most 64-bit hosts.
20524 Avoid double-rounding errors, by insisting on integers when
20525 parsing non-base-10 numbers, as the documentation specifies.
20526 * lisp.h (string_to_number): New decl, replacing ...
20527 (isfloat_string): Remove.
bc0a5c13 20528 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 20529 (read1): Do not accept +. and -. as integers; this
452f4150
PE
20530 appears to have been a coding error. Similarly, do not accept
20531 strings like +-1e0 as floating point numbers. Do not report
20532 overflow for integer overflows unless the base is not 10 which
20533 means we have no simple and reliable way to continue.
20534 Break out the floating-point parsing into a new
20535 function string_to_number, so that Fstring_to_number parses
20536 floating point numbers consistently with the Lisp reader.
04f2d78b 20537 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
20538 (E_CHAR, EXP_INT): Remove, replacing with ...
20539 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
20540 (string_to_number): New function, replacing isfloat_string.
20541 This function checks for valid syntax and produces the resulting
20542 Lisp float number too. Rework it so that string-to-number
bc0a5c13 20543 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
20544 so that overflow for non-base-10 numbers is reported only when
20545 there's no portable and simple way to convert to floating point.
452f4150 20546
67769ffc
PE
20547 * textprop.c (set_text_properties_1): Rewrite for clarity,
20548 and to avoid GCC warning about integer overflow.
20549
c20db43f
PE
20550 * intervals.h (struct interval): Use EMACS_INT for members
20551 where EMACS_UINT might cause problems. See
20552 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
20553 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
20554 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
20555 All uses changed.
37aa2f85
PE
20556 (offset_intervals): Tell GCC not to worry about length overflow
20557 when negating a negative length.
c20db43f 20558
2538aa2f
PE
20559 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
20560 (overrun_check_free): Likewise.
20561
f2d3008d
PE
20562 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
20563 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
20564 word size.
20565
ec8df744
PE
20566 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20567 (gnutls_make_error): Rename local to avoid shadowing.
20568 (gnutls_emacs_global_deinit): ifdef out; not used.
20569 (Fgnutls_boot): Use const for pointer to readonly storage.
20570 Comment out unused local. Fix pointer signedness problems.
20571
640ee02d
PE
20572 * lread.c (openp): Don't stuff size_t into an 'int'.
20573 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
20574 about possible signed overflow.
20575
6048fb2a
PE
20576 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
20577 (GDK_KEY_g): Don't define if already defined.
20578 (xg_prepare_tooltip): Avoid pointer signedness problem.
20579 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
20580
fa3c87e1
PE
20581 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
20582 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
20583
2172544b
PE
20584 * xfns.c (Fx_window_property): Simplify a bit,
20585 to make a bit faster and to avoid GCC 4.6.0 warning.
20586 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
20587
9b821a21
PE
20588 * fns.c (internal_equal): Don't assume size_t fits in int.
20589
3c616cfa
PE
20590 * alloc.c (compact_small_strings): Tighten assertion a little.
20591
c2982e87
PE
20592 Replace pEd with more-general pI, and fix some printf arg casts.
20593 * lisp.h (pI): New macro, generalizing old pEd macro to other
20594 conversion specifiers. For example, use "...%"pI"d..." rather
20595 than "...%"pEd"...".
20596 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 20597 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
20598 * alloc.c (check_pure_size): Don't overflow by converting size to int.
20599 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
20600 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
20601 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
20602 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
20603 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
20604 64-bit hosts.
20605 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
20606 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
20607 * print.c (safe_debug_print, print_object): Likewise.
20608 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
20609 to int.
6f04d126
PE
20610 Use pI instead of if-then-else-abort. Use %p to avoid casts,
20611 avoiding the 0 flag, which is not portable.
c2982e87
PE
20612 * process.c (Fmake_network_process): Use pI to avoid cast.
20613 * region-cache.c (pp_cache): Likewise.
20614 * xdisp.c (decode_mode_spec): Likewise.
20615 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
20616 behavior on 64-bit hosts with printf arg.
6f04d126 20617 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
20618 (x_stop_queuing_selection_requests): Likewise.
20619 (x_get_window_property): Don't truncate byte count to an 'int'
20620 when tracing.
0b432f21 20621
5e073ec7
PE
20622 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
20623 here, since it parses constructs like leading '-' and spaces,
20624 which are not wanted; and it overflows with large numbers.
20625 Instead, simply match F[0-9]+, which is what is wanted anyway.
20626
36372bf9
PE
20627 * alloc.c: Remove unportable assumptions about struct layout.
20628 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
20629 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
20630 (allocate_vectorlike, make_pure_vector): Use the new macros,
20631 plus offsetof, to remove unportable assumptions about struct layout.
20632 These assumptions hold on all porting targets that I know of, but
20633 they are not guaranteed, they're easy to remove, and removing them
20634 makes further changes easier.
20635
0b432f21
PE
20636 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
20637 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
20638 (string_overrun_cookie): Now const. Use initializers that
20639 don't formally overflow signed char, to avoid warnings.
000098c1
PE
20640 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
20641 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
20642 (allocate_buffer): Don't assume sizeof (struct buffer) is a
20643 multiple of sizeof (EMACS_INT); it need not be, if
20644 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 20645 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 20646
895009e1
JB
206472011-04-26 Juanma Barranquero <lekktu@gmail.com>
20648
20649 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
20650
6a7a1b0b
TZ
206512011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
20652
20653 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 20654 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
20655 Reported by Paul Eggert <eggert@cs.ucla.edu>.
20656
841a1577 206572011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
20658
20659 * lisp.h (Qdebug): List symbol.
895009e1 20660 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
20661 * keyboard.c (debug-on-event): New variable.
20662 (handle_user_signal): Break into debugger when debug-on-event
20663 matches the current signal symbol.
20664
f2d3ba6f
DN
206652011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
20666
20667 * alloc.c (check_sblock, check_string_bytes)
20668 (check_string_free_list): Convert to standard C.
20669
42ce4c63
TZ
206702011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
20671
20672 * w32.c (emacs_gnutls_push): Fix typo.
20673
825cd63c
EZ
206742011-04-25 Eli Zaretskii <eliz@gnu.org>
20675
fb11d64d
EZ
20676 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
20677 "cast to pointer from integer of different size".
20678
825cd63c
EZ
20679 Improve doprnt and its use in verror. (Bug#8545)
20680 * doprnt.c (doprnt): Document the set of format control sequences
20681 supported by the function. Use SAFE_ALLOCA instead of always
20682 using `alloca'.
20683
20684 * eval.c (verror): Don't limit the buffer size at size_max-1, that
20685 is one byte too soon. Don't use xrealloc; instead xfree and
20686 xmalloc anew.
20687
e061a11b
TZ
206882011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
20689
20690 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
20691 callbacks stage.
20692
20693 * gnutls.c: Renamed global_initialized to
20694 gnutls_global_initialized. Added internals for the
20695 :verify-hostname-error, :verify-error, and :verify-flags
20696 parameters of `gnutls-boot' and documented those parameters in the
20697 docstring. Start callback support.
9173deec
JB
20698 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
20699 unless a fatal error occurred. Call gnutls_alert_send_appropriate
20700 on error. Return error code.
e061a11b
TZ
20701 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
20702 (emacs_gnutls_read): Likewise.
20703 (Fgnutls_boot): Return handshake error code.
20704 (emacs_gnutls_handle_error): New function.
20705 (wsaerror_to_errno): Likewise.
20706
20707 * w32.h (emacs_gnutls_pull): Add prototype.
20708 (emacs_gnutls_push): Likewise.
20709
20710 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
20711 (emacs_gnutls_push): Likewise.
20712
207132011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
20714
20715 * process.c (wait_reading_process_output): Check if GnuTLS
20716 buffered some data internally if no FDs are set for TLS
20717 connections.
20718
20719 * makefile.w32-in (OBJ2): Add gnutls.$(O).
20720 (LIBS): Link to USER_LIBS.
20721 ($(BLD)/gnutls.$(0)): New target.
20722
fa6996bc
EZ
207232011-04-24 Eli Zaretskii <eliz@gnu.org>
20724
eb35682e
EZ
20725 * xdisp.c (handle_single_display_spec): Rename the
20726 display_replaced_before_p argument into display_replaced_p, to
20727 make it consistent with the commentary. Fix typos in the
20728 commentary.
20729
e2ad650c
EZ
20730 * textprop.c (syms_of_textprop): Remove dead code.
20731 (copy_text_properties): Delete obsolete commentary about an
20732 interface that was deleted long ago. Fix typos in the description
20733 of arguments.
20734
1b2de274
EZ
20735 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
20736 to changes in oldXMenu/XMenu.h from 2011-04-16.
20737 <menu_help_message, prev_menu_help_message>: Constify.
20738 (IT_menu_make_room): menu->help_text is now `const char **';
20739 adjust.
20740
20741 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
20742 to changes in oldXMenu/XMenu.h from 2011-04-16.
20743 (struct XMenu): Declare `help_text' `const char **'.
20744
20745 * xfaces.c <Qunspecified>: Make extern again.
20746
20747 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 20748 required by POSIX.
1b2de274 20749
762b15be
EZ
20750 * doc.c (get_doc_string): Improve the format passed to `error'.
20751
20752 * doprnt.c (doprnt): Improve commentary.
20753
20754 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
20755
20756 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
20757 them with etags.
20758
f1052e5d
EZ
20759 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
20760 changes in globals.h immediately force recompilation.
762b15be
EZ
20761 (TAGS): Depend on $(CURDIR)/m/intel386.h and
20762 $(CURDIR)/s/ms-w32.h.
20763 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 20764
fa6996bc
EZ
20765 * character.c (Fchar_direction): Function deleted.
20766 (syms_of_character): Don't defsubr it.
20767 <char-direction-table>: Deleted.
20768
e6c3da20
EZ
207692011-04-23 Eli Zaretskii <eliz@gnu.org>
20770
20771 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
20772 * doprnt.c: Include limits.h.
20773 (SIZE_MAX): New macro.
04f2d78b
CB
20774 (doprnt): Return a size_t value. 2nd arg is now size_t.
20775 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
20776 Improve overflow protection. Support `l' modifier for integer
20777 conversions. Support %l conversion. Don't assume an EMACS_INT
20778 argument for integer conversions and for %c.
20779
20780 * lisp.h (doprnt): Restore prototype.
20781
20782 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
20783 $(SRC)/character.h.
20784
20785 * Makefile.in (base_obj): Add back doprnt.o.
20786
20787 * deps.mk (doprnt.o): Add back prerequisites.
20788 (callint.o): Depend on character.h.
20789
20790 * eval.c (internal_lisp_condition_case): Include the handler
20791 representation in the error message.
20792 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
20793 when breaking from the loop.
20794
20795 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
20796
20797 * callint.c (Fcall_interactively): When displaying error message
20798 about invalid control letter, pass the character's codepoint, not
20799 a pointer to its multibyte form. Improve display of the character
20800 in octal and display also its hex code.
20801
20802 * character.c (char_string): Use %x to display the (unsigned)
20803 codepoint of an invalid character, to avoid displaying a bogus
20804 negative value.
20805
20806 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
20807 `error', not SYMBOL_NAME itself.
20808
20809 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
20810 character arguments to `error'.
20811
20812 * charset.c (check_iso_charset_parameter): Fix incorrect argument
20813 to `error' in error message about FINAL_CHAR argument. Make sure
20814 FINAL_CHAR is a character, and use %c when it is passed as
20815 argument to `error'.
20816
4ffd0d6b 208172011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
20818
20819 * s/ms-w32.h (localtime): Redirect to sys_localtime.
20820
20821 * w32.c: Include <time.h>.
20822 (sys_localtime): New function.
20823
4ffd0d6b 208242011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
20825
20826 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
20827
4ffd0d6b 20828 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 20829
4ffd0d6b 208302011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 20831
4ffd0d6b
GM
20832 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
20833 zombies (Bug#8467).
aac0c6e3 20834
04c56954
EZ
208352011-04-19 Eli Zaretskii <eliz@gnu.org>
20836
20837 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
20838 gl_state.e_property when gl_state.object is Qt.
20839
20840 * insdel.c (make_gap_larger): Remove limitation of buffer size
20841 to <= INT_MAX.
20842
16a43933
CY
208432011-04-18 Chong Yidong <cyd@stupidchicken.com>
20844
20845 * xdisp.c (lookup_glyphless_char_display)
20846 (produce_glyphless_glyph): Handle cons cell entry in
20847 glyphless-char-display.
20848 (Vglyphless_char_display): Document it.
20849
20850 * term.c (produce_glyphless_glyph): Handle cons cell entry in
20851 glyphless-char-display.
20852
4581706e
CY
208532011-04-17 Chong Yidong <cyd@stupidchicken.com>
20854
20855 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
20856
20857 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
20858
20859 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
20860 definition for no-X builds.
20861
4887c6e2 208622011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 20863
fd35b6f9
PE
20864 Static checks with GCC 4.6.0 and non-default toolkits.
20865
5c1ccb01
PE
20866 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
20867
006c5daa
PE
20868 * process.c (keyboard_bit_set): Define only if SIGIO.
20869 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
20870 (send_process): Repair possible setjmp clobbering.
20871
efc736d3
PE
20872 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
20873
4e2fe2e6
PE
20874 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
20875
f97334a2
PE
20876 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
20877
4e75f29d
PE
20878 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
20879 Define only if needed.
20880
90efadd1
PE
20881 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
20882 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 20883 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 20884
3c647824
PE
20885 * dispextern.h (struct redisplay_interface): Rename param
20886 to avoid shadowing.
e264f262 20887 * termhooks.h (struct terminal): Likewise.
761383f4 20888 * xterm.c (xembed_send_message): Likewise.
3c647824 20889
b58c5c4a
PE
20890 * insdel.c (make_gap_smaller): Define only if
20891 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
20892
cad59032
PE
20893 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
20894 it.
20895
c339dc2e
PE
20896 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
20897 so that we aren't warned about unused symbols.
20898
91a3e27b
PE
20899 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
20900
399c71d3 20901 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 20902
8ffc96f5
PE
20903 * xfns.c (x_real_positions): Mark locals as initialized.
20904
eef9bc79
PE
20905 * xmenu.c (xmenu_show): Don't use uninitialized vars.
20906
098db9dd
PE
20907 * xterm.c: Fix problems found by static analysis with other toolkits.
20908 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
20909 (x_dispatch_event): Declare static if USE_GTK, and
20910 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 20911 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 20912 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
20913 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
20914 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 20915
eb18f6cc
PE
20916 * xmenu.c (menu_help_callback): Pointer type fixes.
20917 Use const pointers when pointing at readonly data. Avoid pointer
20918 signedness clashes.
20919 (FALSE): Remove unused macro.
20920 (update_frame_menubar): Remove unused decl.
20921
1fe72bf8
PE
20922 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
20923
60d9e1db
PE
20924 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
20925 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
20926 (single_menu_item): Rename local to avoid shadowing.
20927
39261c26
PE
20928 * keyboard.c (make_lispy_event): Remove unused local var.
20929
018c5e19
PE
20930 * frame.c, frame.h (x_get_resource_string): Bring this back, but
20931 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
20932
63d2b86e
PE
20933 * bitmaps: Change bitmaps from unsigned char back to the X11
20934 compatible char. Avoid the old compiler warnings about
20935 out-of-range initializers by using, for example, '\xab' rather
20936 than 0xab.
20937
aefd87e1
PE
20938 * xgselect.c (xgselect_initialize): Check vs interface
20939 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
20940
bf501fb9
PE
20941 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
20942
e9829fdf
PE
20943 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
20944 to read-only memory.
20945
1086c095
PE
20946 * fns.c (vector): Remove; this old hack is no longer needed.
20947
2baccd04 20948 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 20949 Remove unused var.
dde42981 20950 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 20951
72391843 20952 * xrdb.c (x_load_resources): Omit unused local.
3565b346 20953
436c16df 20954 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 20955 (x_window): Rename locals to avoid shadowing.
dc5ddd85 20956 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 20957
92bb796d 20958 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 20959 (x_term_init): Remove local to avoid shadowing.
92bb796d 20960
764430a3 20961 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
20962
20963 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
20964 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
20965
d1dfb56c
EZ
209662011-04-16 Eli Zaretskii <eliz@gnu.org>
20967
c4354cb4
EZ
20968 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
20969
d1dfb56c
EZ
20970 Fix regex.c, syntax.c and friends for buffers > 2GB.
20971 * syntax.h (struct gl_state_s): Declare character position members
20972 EMACS_INT.
20973
20974 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
20975
04f2d78b
CB
20976 * textprop.c (verify_interval_modification, interval_of):
20977 Declare arguments EMACS_INT.
d1dfb56c
EZ
20978
20979 * intervals.c (adjust_intervals_for_insertion): Declare arguments
20980 EMACS_INT.
20981
20982 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
20983
20984 * indent.c (Fvertical_motion): Local variable it_start is now
20985 EMACS_INT.
20986
20987 * regex.c (re_match, re_match_2, re_match_2_internal)
20988 (bcmp_translate, regcomp, regexec, print_double_string)
20989 (group_in_compile_stack, re_search, re_search_2, regex_compile)
20990 (re_compile_pattern, re_exec): Declare arguments and local
20991 variables `size_t' and `ssize_t' and return values `regoff_t', as
20992 appropriate.
20993 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
20994 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
20995 <compile_stack_type>: `size' and `avail' are now `size_t'.
20996
20997 * regex.h <regoff_t>: Use ssize_t, not int.
20998 (re_search, re_search_2, re_match, re_match_2): Arguments that
20999 specify buffer/string position and length are now ssize_t and
21000 size_t. Return type is regoff_t.
21001
613052cd
BK
210022011-04-16 Ben Key <bkey76@gmail.com>
21003
21004 * nsfont.m: Fixed bugs in ns_get_family and
21005 ns_descriptor_to_entity that were caused by using free to
21006 deallocate memory blocks that were allocated by xmalloc (via
21007 xstrdup). This caused Emacs to crash when compiled with
21008 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
21009 --enable-checking=xmallocoverrun). xfree is now used to
21010 deallocate these memory blocks.
21011
4170f62f 210122011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 21013
71b41406
PE
21014 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
21015
9587a89d
PE
21016 emacs_write: Accept and return EMACS_INT for sizes.
21017 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
21018 et seq.
21019 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
21020 Accept and return EMACS_INT.
21021 (emacs_gnutls_write): Return the number of bytes written on
21022 partial writes.
21023 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
21024 (emacs_read, emacs_write): Remove check for negative size, as the
21025 Emacs source code has been audited now.
9587a89d
PE
21026 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
21027 (emacs_read, emacs_write): Use it.
273a5f82
PE
21028 * process.c (send_process): Adjust to the new signatures of
21029 emacs_write and emacs_gnutls_write. Do not attempt to store
21030 a byte offset into an 'int'; it might overflow.
9587a89d 21031 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 21032
3e047f51
PE
21033 * sound.c: Don't assume sizes fit in 'int'.
21034 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 21035 Return EMACS_INT, not int.
3e047f51 21036 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
21037 Accept EMACS_INT, not int.
21038 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
21039 record read return values.
21040
cc39a9db
BK
210412011-04-15 Ben Key <bkey76@gmail.com>
21042
c9d0ec6d
JB
21043 * keyboard.c (Qundefined): Don't declare static since it is used
21044 in nsfns.m.
21045 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
21046 static since they are used in nsfont.m.
cc39a9db 21047
6c60eb9f
SM
210482011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
21049
21050 * process.c (Qprocessp): Don't declare static.
21051 * lisp.h (Qprocessp): Declare again.
21052
7990b61a
JB
210532011-04-15 Juanma Barranquero <lekktu@gmail.com>
21054
21055 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
21056
5d4cb038
PE
210572011-04-14 Paul Eggert <eggert@cs.ucla.edu>
21058
8bd7b830 21059 Improve C-level modularity by making more things 'static'.
cd64ea1d 21060
e3b27b31
PE
21061 Don't publish debugger-only interfaces to other modules.
21062 * lisp.h (safe_debug_print, debug_output_compilation_hack):
21063 (verify_bytepos, count_markers): Move decls to the only modules
21064 that need them.
21065 * region-cache.h (pp_cache): Likewise.
21066 * window.h (check_all_windows): Likewise.
21067 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
21068
5d4cb038
PE
21069 * sysdep.c (croak): Now static, if
21070 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
21071 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
21072
21073 * alloc.c (refill_memory_reserve): Now static if
21074 !defined REL_ALLOC || defined SYSTEM_MALLOC.
21075 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 21076
e87b6180
PE
21077 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
21078 Define only if USE_LUCID.
21079
ac64929e
PE
21080 * xrdb.c (x_customization_string, x_rm_string): Now static.
21081
6f37259d
PE
21082 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
21083 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
21084
1683e3ab
PE
21085 * xdisp.c (draw_row_with_mouse_face): Now static.
21086 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
21087
de9c2632
PE
21088 * window.h (check_all_windows): Mark externally visible.
21089
2b96acb7
PE
21090 * window.c (window_deletion_count): Now static.
21091
21092 * undo.c: Make symbols static if they're not exported.
21093 (last_undo_buffer, last_boundary_position, pending_boundary):
21094 Now static.
21095
50436f33
PE
21096 * textprop.c (interval_insert_behind_hooks): Now static.
21097 (interval_insert_in_front_hooks): Likewise.
21098
64520e5c
PE
21099 * term.c: Make symbols static if they're not exported.
21100 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
21101 (max_frame_lines, tty_set_terminal_modes):
21102 (tty_reset_terminal_modes, tty_turn_off_highlight):
21103 (get_tty_terminal): Now static.
21104 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
21105 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 21106 HAVE_WINDOW_SYSTEM.
64520e5c
PE
21107 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
21108 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
21109
1fa53021
PE
21110 * sysdep.c: Make symbols static if they're not exported.
21111 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
21112 Now static.
21113 (sigprocmask_set, full_mask): Remove; unused.
21114 (wait_debugging): Mark as visible.
21115 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
21116 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
21117
d4b43b22
PE
21118 * syntax.c (syntax_temp): Define only if !__GNUC__.
21119
b7c513d0
PE
21120 * sound.c (current_sound_device, current_sound): Now static.
21121
989b29ad
PE
21122 * search.c (searchbufs, searchbuf_head): Now static.
21123
13a55a78
PE
21124 * scroll.c (scroll_cost): Remove; unused.
21125 * dispextern.h (scroll_cost): Remove decl.
21126
de68a1fc
PE
21127 * region-cache.h (pp_cache): Mark as externally visible.
21128
40ccffa6
PE
21129 * process.c: Make symbols static if they're not exported.
21130 (process_tick, update_tick, create_process, chan_process):
21131 (Vprocess_alist, proc_buffered_char, datagram_access):
21132 (fd_callback_data, send_process_frame, process_sent_to): Now static.
21133 (deactivate_process): Mark defn as static, as well as decl.
21134 * lisp.h (create_process): Remove decl.
21135 * process.h (chan_process, Vprocess_alist): Remove decls.
21136
ad64fc97
PE
21137 * print.c: Make symbols static if they're not exported.
21138 (print_depth, new_backquote_output, being_printed, print_buffer):
21139 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
21140 (print_interval, print_number_index, initial_stderr_stream):
21141 Now static.
21142 * lisp.h (Fprinc): Remove decl.
21143 (debug_output_compilation_hack): Mark as externally visible.
21144
adddb265
PE
21145 * sysdep.c (croak): Move decl from here to syssignal.h.
21146 * syssignal.h (croak): Put it here, so the API can be checked when
21147 'croak' is called from dissociate_if_controlling_tty.
21148
1717ede2
PE
21149 * minibuf.c: Make symbols static if they're not exported.
21150 (minibuf_save_list, choose_minibuf_frame): Now static.
21151 * lisp.h (choose_minibuf_frame): Remove decl.
21152
fa5fb2bc
PE
21153 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
21154
1e3890d1
PE
21155 * lread.c: Make symbols static if they're not exported.
21156 (read_objects, initial_obarray, oblookup_last_bucket_number):
21157 Now static.
21158 (make_symbol): Remove; unused.
21159 * lisp.h (initial_obarray, make_symbol): Remove decls.
21160
8a1414fa
PE
21161 * keyboard.c: Make symbols static if they're not exported.
21162 (single_kboard, recent_keys_index, total_keys, recent_keys):
21163 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
21164 (this_single_command_key_start, echoing, last_auto_save):
21165 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
21166 (command_loop, echo_now, keyboard_init_hook, help_char_p):
21167 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
21168 (Vlispy_mouse_stem, double_click_count):
21169 Now static.
21170 (force_auto_save_soon): Define only if SIGDANGER.
21171 (ignore_mouse_drag_p): Now static if
21172 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
21173 (print_help): Remove; unused.
21174 (stop_character, last_timer_event): Mark as externally visible.
21175 * keyboard.h (ignore_mouse_drag_p): Declare only if
21176 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
21177 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
21178 * lisp.h (echoing): Remove decl.
21179 (force_auto_save_soon): Declare only if SIGDANGER.
21180 * xdisp.c (redisplay_window): Simplify code, to make it more
21181 obvious that ignore_mouse_drag_p is not accessed if !defined
21182 USE_GTK && !defined HAVE_NS.
21183
93ea6e8f
PE
21184 * intervals.c: Make symbols static if they're not exported.
21185 (merge_properties_sticky, merge_interval_right, delete_interval):
21186 Now static.
21187 * intervals.h (merge_interval_right, delete_interval): Remove decls.
21188
77382fcc
PE
21189 * insdel.c: Make symbols static if they're not exported.
21190 However, leave prepare_to_modify_buffer alone. It's never
21191 called from outside this function, but that appears to be a bug.
21192 (combine_after_change_list, combine_after_change_buffer):
4889fc82 21193 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
21194 (adjust_after_replace_noundo): Remove; unused.
21195 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 21196 (signal_before_change): Remove decls.
77382fcc 21197
9306c32e
PE
21198 * indent.c (val_compute_motion, val_vmotion): Now static.
21199
cd44d2eb
PE
21200 * image.c: Make symbols static if they're not exported.
21201 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
21202 if USE_GTK.
21203 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
21204 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
21205
ad9a7a06
PE
21206 * fringe.c (standard_bitmaps): Now static.
21207 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
21208
81626931
PE
21209 * frame.c: Make symbols static if they're not exported.
21210 (x_report_frame_params, make_terminal_frame): Now static.
21211 (get_frame_param): Now static, unless HAVE_NS.
21212 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
21213 (x_get_resource_string): Remove; not used.
21214 * frame.h (make_terminal_frame, x_report_frame_params):
21215 (x_get_resource_string); Remove decls.
21216 (x_fullscreen_adjust): Declare only if WINDOWSNT.
21217 * lisp.h (get_frame_param): Declare only if HAVE_NS.
21218
239f9db9
PE
21219 * font.c, fontset.c: Make symbols static if they're not exported.
21220 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
21221 (FACE_SUITABLE_FOR_CHAR_P): Use it.
21222 * font.c (font_close_object): Now static.
21223 * font.h (font_close_object): Remove.
21224 * fontset.c (FONTSET_OBJLIST): Remove.
21225 (free_realized_fontset) #if-0 the body, which does nothing.
21226 (face_suitable_for_char_p): #if-0, as it's never called.
21227 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
21228 * xfaces.c (face_at_string_position):
21229 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
21230 since 0 is always ASCII.
21231
dfcf3579
PE
21232 * fns.c (weak_hash_tables): Now static.
21233
5045092b
PE
21234 * fileio.c: Make symbols static if they're not exported.
21235 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
21236 (Vwrite_region_annotation_buffers): Now static.
21237
57a96f5c
PE
21238 * eval.c: Make symbols static if they're not exported.
21239 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
21240 * lisp.h (backtrace_list): Remove decl.
21241
35f08c38
PE
21242 * emacs.c: Make symbols static if they're not exported.
21243 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
21244 (fatal_error_code, fatal_error_signal_hook, standard_args):
21245 Now static.
21246 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
21247 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
21248 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
21249 * lisp.h (fatal_error_signal_hook): Remove decl.
21250 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
21251
f44bd759
PE
21252 * editfns.c: Move a (normally-unused) function to its only use.
21253 * editfns.c, lisp.h (get_operating_system_release): Remove.
21254 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
21255 worth the hassle of breaking this out.
21256
b532497d
PE
21257 * xterm.c: Make symbols static if they're not exported.
21258 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
21259 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
21260 (x_destroy_window, x_delete_display):
21261 Now static.
21262 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
21263 (x_mouse_leave): Remove; unused.
21264 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
21265 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
21266 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
21267 Remove decls.
21268 (x_mouse_leave): Declare only if WINDOWSNT.
21269 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
21270 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
21271 USE_X_TOOLKIT.
21272
1675728f
PE
21273 * ftxfont.c: Make symbols static if they're not exported.
21274 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
21275 HAVE_FREETYPE.
21276 * font.h (ftxfont_driver): Likewise.
21277
e4cebfca
PE
21278 * xfns.c: Make symbols static if they're not exported.
21279 (x_last_font_name, x_display_info_for_name):
21280 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
21281 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
21282 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
21283 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
21284 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
21285 (last_show_tip_args): Now static.
21286 (xic_defaut_fontset, xic_create_fontsetname): Define only if
21287 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
21288 (x_screen_planes): Remove; unused.
21289 * dispextern.h (x_screen_planes): Remove decl.
21290
5bf46f05
PE
21291 * dispnew.c: Make symbols static if they're not exported.
21292 * dispextern.h (redraw_garbaged_frames, scrolling):
21293 (increment_row_positions): Remove.
21294 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
21295 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
21296 Now static.
21297 (redraw_garbaged_frames): Remove; unused.
21298
435f4c28
PE
21299 * xfaces.c: Make symbols static if they're not exported.
21300 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
21301 Remove decls.
21302 * xterm.h (defined_color): Remove decls.
21303 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
21304 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
21305 (menu_face_changed_default, defined_color, free_realized_face):
21306 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
21307 (ascii_face_of_lisp_face): Remove; unused.
21308
8524aef3
PE
21309 * xdisp.c: Make symbols static if they're not exported.
21310 * dispextern.h (scratch_glyph_row, window_box_edges):
21311 (glyph_to_pixel_coords, set_cursor_from_row):
21312 (get_next_display_element, set_iterator_to_next):
21313 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
21314 (show_mouse_face): Remove decls
21315 * frame.h (message_buf_print): Likewise.
21316 * lisp.h (pop_message, set_message, check_point_in_composition):
21317 Likewise.
21318 * xterm.h (set_vertical_scroll_bar): Likewise.
21319 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
21320 (message_buf_print, scratch_glyph_row, displayed_buffer):
21321 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
21322 (get_next_display_element, show_mouse_face, window_box_edges):
21323 (frame_to_window_pixel_xy, check_point_in_composition):
21324 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
21325 (glyph_to_pixel_coords): Remove; unused.
21326
16390cd2
PE
21327 * dired.c (file_name_completion): Now static.
21328
21329 * dbusbind.c (xd_in_read_queued_messages): Now static.
21330
a25f4dfa
PE
21331 * lisp.h (circular_list_error, FOREACH): Remove; unused.
21332 * data.c (circular_list_error): Remove.
21333
14a9c8df
PE
21334 * commands.h (last_point_position, last_point_position_buffer):
21335 (last_point_position_window): Remove decls.
21336 * keyboard.c: Make these variables static.
21337
04f2d78b
CB
21338 * coding.h (coding, code_convert_region, encode_coding_gap):
21339 Remove decls.
74ab6df5
PE
21340 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
21341 (iso_code_class, detect_coding, code_convert_region): Now static.
21342 (encode_coding_gap): Remove; unused.
21343
38dfbee1
PE
21344 * chartab.c (chartab_chars, chartab_bits): Now static.
21345
a2cb4e63
PE
21346 * charset.h (charset_iso_8859_1): Remove decl.
21347 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
21348 Now static.
21349
127198fd
PE
21350 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
21351 * ccl.c (Vccl_program_table): Now static.
21352 (check_ccl_update): Remove; unused.
21353
d85b608f
PE
21354 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
21355 * category.h: ... from here.
21356 * category.c (check_category_table, set_category_set): Now static.
21357
31cd66f3
PE
21358 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
21359 * lisp.h: Remove these decls.
21360
c358e587
PE
21361 * buffer.c (buffer_count): Remove unused var.
21362
e78aecca
PE
21363 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
21364 so that it's not optimized away.
21365 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
21366 * dispextern.h (bidi_dump_cached_states): Remove, since it's
21367 exported only to the debugger.
21368
e192d7d3 21369 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 21370 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 21371
92470028
PE
21372 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
21373 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
21374 was inaccessible from Lisp.
21375 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
21376 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
21377
244ed907
PE
21378 alloc.c: Import and export fewer symbols, and remove unused items.
21379 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
21380 is defined.
21381 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
21382 it's not optimized away by whole-program optimization.
21383 (message_enable_multibyte, free_misc): Remove.
21384 (catchlist, handlerlist, mark_backtrace):
21385 Declare only if BYTE_MARK_STACK.
21386 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
21387 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
21388 (message_enable_multibyte): Remove decl.
21389 (free_misc, interval_free_list, float_block, float_block_index):
21390 (n_float_blocks, float_free_list, cons_block, cons_block_index):
21391 (cons_free_list, last_marked_index):
21392 Now static.
21393 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
21394 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
21395 (mark_backtrace): Define only if BYTE_MARK_STACK.
21396 * xdisp.c (message_enable_multibyte): Now static.
21397
61c2b50e 21398 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
21399 This makes it easier for human readers (and static analyzers)
21400 to see whether these variables are used from other modules.
21401 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
21402 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
21403 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
21404 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
21405 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
21406 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
21407 * xmenu.c, xselect.c:
21408 Declare Q* vars static if they are not used in other modules.
21409 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
21410 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
21411 Remove decls of unexported vars.
21412 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
21413
95c82688
PE
21414 * lisp.h (DEFINE_FUNC): Make sname 'static'.
21415
16a97296
PE
21416 Make Emacs functions such as Fatom 'static' by default.
21417 This makes it easier for human readers (and static analyzers)
21418 to see whether these functions can be called from other modules.
21419 DEFUN now defines a static function. To make the function external
21420 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
21421 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
21422 (Finit_image_library):
16a97296
PE
21423 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
21424 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
21425 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
21426 Remove decls, since these functions are now static.
21427 (Funintern, Fget_internal_run_time): New decls, since these functions
21428 were already external.
95c82688 21429
16a97296
PE
21430 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
21431 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
21432 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
21433 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
21434 * keyboard.c, keymap.c, lread.c:
21435 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
21436 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
21437 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
21438 Mark functions with DEFUE instead of DEFUN,
21439 if they are used in other modules.
21440 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
21441 decls for now-static functions.
21442 * buffer.h (Fdelete_overlay): Remove decl.
21443 * callproc.c (Fgetenv_internal): Mark as internal.
21444 * composite.c (Fremove_list_of_text_properties): Remove decl.
21445 (Fcomposition_get_gstring): New forward static decl.
21446 * composite.h (Fcomposite_get_gstring): Remove decl.
21447 * dired.c (Ffile_attributes): New forward static decl.
21448 * doc.c (Fdocumntation_property): New forward static decl.
21449 * eval.c (Ffetch_bytecode): New forward static decl.
21450 (Funintern): Remove extern decl; now in .h file where it belongs.
21451 * fileio.c (Fmake_symbolic_link): New forward static decl.
21452 * image.c (Finit_image_library): New forward static decl.
21453 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
21454 * intervals.h (Fprevious_property_change):
21455 (Fremove_list_of_text_properties): Remove decls.
21456 * keyboard.c (Fthis_command_keys): Remove decl.
21457 (Fcommand_execute): New forward static decl.
21458 * keymap.c (Flookup_key): New forward static decl.
21459 (Fcopy_keymap): Now static.
21460 * keymap.h (Flookup_key): Remove decl.
21461 * process.c (Fget_process): New forward static decl.
21462 (Fprocess_datagram_address): Mark as internal.
21463 * syntax.c (Fsyntax_table_p): New forward static decl.
21464 (skip_chars): Remove duplicate decl.
21465 * textprop.c (Fprevious_property_change): New forward static decl.
21466 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
21467 Now internal.
21468 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
21469 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
21470
785bbd42
PE
21471 * editfns.c (Fformat): Remove unreachable code.
21472
8b913b57
AS
214732011-04-14 Andreas Schwab <schwab@linux-m68k.org>
21474
21475 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
21476 change. (Bug#8496)
21477
a6744a35
EZ
214782011-04-13 Eli Zaretskii <eliz@gnu.org>
21479
21480 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
21481 when at ZV. (Bug#8487)
21482
e7974947
AS
214832011-04-12 Andreas Schwab <schwab@linux-m68k.org>
21484
baad03f0
AS
21485 * charset.c (Fclear_charset_maps): Use xfree instead of free.
21486 (Bug#8437)
21487 * keyboard.c (parse_tool_bar_item): Likewise.
21488 * sound.c (sound_cleanup, alsa_close): Likewise.
21489 * termcap.c (tgetent): Likewise.
21490 * xfns.c (x_default_font_parameter): Likewise.
21491 * xsettings.c (read_and_apply_settings): Likewise.
21492
e7974947
AS
21493 * alloc.c (overrun_check_malloc, overrun_check_realloc)
21494 (overrun_check_free): Protoize.
21495
28272684
PE
214962011-04-12 Paul Eggert <eggert@cs.ucla.edu>
21497
21498 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
21499 since callers should never pass a negative size.
21500 Change the signature to match that of plain 'read' and 'write'; see
21501 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
21502 * lisp.h: Update prototypes of emacs_write and emacs_read.
21503
11997c76
EZ
215042011-04-11 Eli Zaretskii <eliz@gnu.org>
21505
21506 * xdisp.c (redisplay_window): Don't try to determine the character
21507 position of the scroll margin if the window start point w->startp
e896f03c 21508 is outside the buffer's accessible region. (Bug#8468)
11997c76 21509
8a2cbd72
EZ
215102011-04-10 Eli Zaretskii <eliz@gnu.org>
21511
21512 Fix write-region and its subroutines for buffers > 2GB.
21513 * fileio.c (a_write, e_write): Modify declaration of arguments and
21514 local variables to support buffers larger than 2GB.
21515 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
21516
21517 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
21518 argument, local variables, and return value.
21519
21520 * lisp.h: Update prototypes of emacs_write and emacs_read.
21521
21522 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
21523
4073e537 215242011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 21525
1ebfdcb6
PE
21526 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
21527
b2ded58d
PE
21528 Fix more problems found by GCC 4.6.0's static checks.
21529
7d66342c
PE
21530 * xdisp.c (vmessage): Use a better test for character truncation.
21531
bbf47d44
PE
21532 * charset.c (load_charset_map): <, not <=, for optimization,
21533 and to avoid potential problems with integer overflow.
9248994d 21534 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 21535 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 21536 * editfns.c (Fformat): Likewise.
1e69125e 21537 * syntax.c (skip_chars): Likewise.
3befa583 21538
e3019616
PE
21539 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
21540 This also lets GCC 4.6.0 generate slightly better loop code.
21541
becfa255
PE
21542 * callint.c (Fcall_interactively): <, not <=, for optimization.
21543 (Fcall_interactively): Count the number of arguments produced,
21544 not the number of arguments given. This is simpler and lets GCC
21545 4.6.0 generate slightly better code.
21546
dae0cd48
PE
21547 * ftfont.c: Distingish more carefully between FcChar8 and char.
21548 The previous code passed unsigned char * to a functions like
21549 strlen and xstrcasecmp that expect char *, which does not
21550 conform to the C standard.
21551 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
21552 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
21553 char * when the C standard requires it.
21554
76032d70
PE
21555 * keyboard.c (read_char): Remove unused var.
21556
eb3f1cc8
PE
21557 * eval.c: Port to Windows vsnprintf (Bug#8435).
21558 Include <limits.h>.
21559 (SIZE_MAX): Define if the headers do not.
21560 (verror): Do not give up if vsnprintf returns a negative count.
21561 Instead, grow the buffer. This ports to Windows vsnprintf, which
21562 does not conform to C99. Problem reported by Eli Zaretskii.
21563 Also, simplify the allocation scheme, by avoiding the need for
21564 calling realloc, and removing the ALLOCATED variable.
21565
70476b54
PE
21566 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
21567
12020a9e
PE
21568 Remove invocations of doprnt, as Emacs now uses vsnprintf.
21569 But keep the doprint source code for now, as we might revamp it
21570 and use it again (Bug#8435).
ea6c7ae6
PE
21571 * lisp.h (doprnt): Remove.
21572 * Makefile.in (base_obj): Remove doprnt.o.
21573 * deps.mk (doprnt.o): Remove.
21574
5fdb398c
PE
21575 error: Print 32- and 64-bit integers portably (Bug#8435).
21576 Without this change, on typical 64-bit hosts error ("...%d...", N)
21577 was used to print both 32- and 64-bit integers N, which relied on
21578 undefined behavior.
61bdb816 21579 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
21580 * lisp.h (error, verror): Mark as printf-like functions.
21581 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
21582 Report overflow in size calculations when allocating printf buffer.
21583 Do not truncate output string at its first null byte.
21584 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
21585 Truncate the output at a character boundary, since vsnprintf does not
21586 do that.
21587 * charset.c (check_iso_charset_parameter): Convert internal
21588 character to string before calling 'error', since %c now has the
21589 printf meaning.
21590 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
21591 overflow when computing char to be passed to 'error'. Do not
21592 pass Lisp_Object to 'error'; pass the integer instead.
21593 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
21594 formatted with plain %d.
21595
b189fa66
PE
21596 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
21597
bff87ef0
PE
21598 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
21599
7e2cac20
PE
21600 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
21601
ce4d90b5
PE
21602 * xterm.c (x_catch_errors): Remove duplicate declaration.
21603
266c9547
PE
21604 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
21605
79c49ad2
PE
21606 * xdisp.c, lisp.h (message_nolog): Remove; unused.
21607
368f4090
JM
216082011-04-10 Jim Meyering <meyering@redhat.com>
21609
21610 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
21611 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
21612 return ssize_t not "int", and use size_t as the buffer length.
21613 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
21614 * gnutls.h: Update declarations.
21615 * process.c (read_process_output): Use ssize_t, to match.
21616 (send_process): Likewise.
21617
a32d4040
CY
216182011-04-09 Chong Yidong <cyd@stupidchicken.com>
21619
21620 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
21621
8546720e 216222011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 21623
04f2d78b
CB
21624 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
21625 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 21626
8546720e
GM
21627 * xterm.c (handle_one_xevent):
21628 * xmenu.c (create_and_show_popup_menu):
21629 * xselect.c (x_decline_selection_request)
21630 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 21631
0a2f5c1a 216322011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
21633
21634 Fix some uses of `int' instead of EMACS_INT.
21635 * search.c (string_match_1, fast_string_match)
21636 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
21637 (scan_buffer, find_next_newline_no_quit)
21638 (find_before_next_newline, search_command, Freplace_match)
21639 (Fmatch_data): Make some `int' variables be EMACS_INT.
21640
21641 * xdisp.c (display_count_lines): 3rd argument and return value now
21642 EMACS_INT. All callers changed.
21643 (pint2hrstr): Last argument is now EMACS_INT.
21644
21645 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
21646 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
21647 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
21648 (decode_coding_utf_16, decode_coding_emacs_mule)
21649 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
21650 (decode_coding_ccl, decode_coding_charset)
21651 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
21652 (decode_coding_iso_2022, decode_coding_emacs_mule)
21653 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
21654 <char_offset, last_offset>: Declare EMACS_INT.
21655 (encode_coding_utf_8, encode_coding_utf_16)
21656 (encode_coding_emacs_mule, encode_invocation_designation)
21657 (encode_designation_at_bol, encode_coding_iso_2022)
21658 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
21659 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
21660 Declare EMACS_INT.
21661 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
21662 (encode_invocation_designation): Last argument P_NCHARS is now
21663 EMACS_INT.
21664 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
21665 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
21666
21667 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
21668 All users changed.
21669
21670 * ccl.c (Fccl_execute_on_string): Declare some variables
21671 EMACS_INT.
21672
8546720e 216732011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
21674
21675 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
21676
4e19a977
CS
216772011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
21678
21679 * process.c (Fformat_network_address): Doc fix.
21680
87302331
R
216812011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
21682
ee7683eb 21683 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 21684
cbb59342
CY
216852011-04-08 Chong Yidong <cyd@stupidchicken.com>
21686
21687 * keyboard.c (read_char): Call Lisp function help-form-show,
21688 instead of using internal_with_output_to_temp_buffer.
21689 (Qhelp_form_show): New var.
e0d38eeb 21690 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
21691
21692 * print.c (internal_with_output_to_temp_buffer): Function deleted.
21693
21694 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
21695
e67a13ab
CY
216962011-04-06 Chong Yidong <cyd@stupidchicken.com>
21697
04f2d78b
CB
21698 * process.c (Flist_processes): Remove to Lisp.
21699 (list_processes_1): Delete.
e67a13ab 21700
973f782d
EZ
217012011-04-06 Eli Zaretskii <eliz@gnu.org>
21702
7c106b1e
EZ
21703 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
21704
973f782d
EZ
21705 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
21706
41cf7d1a 217072011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 21708
ca23cc88
PE
21709 Fix more problems found by GCC 4.6.0's static checks.
21710
f390e2d5
PE
21711 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
21712
42eea0d0
PE
21713 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
21714
b69769da 21715 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 21716
f9541e84
PE
21717 * xdisp.c (vmessage): Mark as a printf-like function.
21718
13841b55
PE
21719 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
21720
c136c10f
PE
21721 * sound.c (sound_warning): Don't crash if arg contains a printf format.
21722
5e2d4a30
PE
21723 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
21724 printf-like functions.
21725 (tiff_load): Add casts to remove these marks before passing them
21726 to system-supplied API.
21727
583f48b9
PE
21728 * eval.c (Fsignal): Remove excess argument to 'fatal'.
21729
b25d760e
PE
21730 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
21731 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
21732 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
21733 directly, rather than having caller test rule sign. This avoids
21734 some unnecessary tests.
21735 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
21736 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
21737 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 21738
bc7b6697 21739 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 21740 (xfont_open): Avoid unnecessary tests.
bc7b6697 21741
27ccc379
PE
21742 * composite.c (composition_gstring_put_cache): Use unsigned integer.
21743
dcd5c89a
PE
21744 * composite.h, composite.c (composition_gstring_put_cache):
21745 Use EMACS_INT, not int, for length.
21746
b13a45c6
PE
21747 * composite.h (COMPOSITION_DECODE_REFS): New macro,
21748 breaking out part of COMPOSITION_DECODE_RULE.
21749 (COMPOSITION_DECODE_RULE): Use it.
21750 * composite.c (get_composition_id): Remove unused local vars,
21751 by using the new macro.
21752
1e792e4d
PE
21753 * textprop.c (set_text_properties_1): Change while to do-while,
21754 since the condition is always true at first.
21755
dc6c6455 21756 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
21757 (interval_deletion_adjustment): Return unsigned value.
21758 All uses changed.
dc6c6455 21759
aba7731a
PE
21760 * process.c (list_processes_1, create_pty, read_process_output):
21761 (exec_sentinel): Remove vars that were set but not used.
afd4052b 21762 (create_pty): Remove unnecessary "volatile"s.
bc57d757 21763 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 21764 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 21765 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 21766
fdfc4bf3
PE
21767 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
21768
fca8fe46 21769 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 21770 (update_syntax_table): Use unsigned instead of int.
fca8fe46 21771
06a0259a 21772 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 21773 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 21774 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 21775
e7b9e80f
PE
21776 * print.c (print_error_message): Avoid int overflow.
21777
56201685
PE
21778 * font.c (font_list_entities): Redo for clarity,
21779 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
21780
78834453 21781 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 21782 (font_score): Avoid potential overflow in diff calculation.
78834453 21783
0bc0b309 21784 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 21785 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 21786
e610eaca
PE
21787 * eval.c (funcall_lambda): Rename local to avoid shadowing.
21788
b895abce
PE
21789 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
21790 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
21791 can always succeed if overflow has undefined behavior.
21792
1f1d9321 21793 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 21794 (wordify): Omit three unnecessary tests.
1f1d9321 21795
c59478bc
PE
21796 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
21797 All callers changed. This avoids the need for an unused var.
21798
79b73827
PE
21799 * casefiddle.c (casify_region): Remove var that is set but not used.
21800
a4db5dfe
PE
21801 * dired.c (file_name_completion): Remove var that is set but not used.
21802
43aae36e
PE
21803 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
21804
2a47c44d 21805 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 21806 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 21807
a37c69bf
PE
21808 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
21809 Check for integer overflow on size calculations.
21810
328ab8e7
PE
21811 * buffer.c (Fprevious_overlay_change): Remove var that is set
21812 but not used.
21813
e5a2a5cb
PE
21814 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
21815 Remove vars that are set but not used.
8d84a6eb 21816 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 21817 (timer_check_2): Mark vars as initialized.
e5a2a5cb 21818
a60e5f68
PE
21819 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
21820
f661cb61 21821 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 21822 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 21823
f0397f5a
PE
21824 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
21825 that are set but not used.
21826
8664db06 21827 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 21828 if XCreateBitmapFromData fails (Bug#8410).
8664db06 21829
6abdaa4a
PE
21830 * xselect.c (x_get_local_selection, x_handle_property_notify):
21831 Remove vars that are set but not used.
21832
0ce7538d 21833 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 21834 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 21835
9ae848fc
PE
21836 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
21837 Remove var that is set but not used.
0b918413
PE
21838 (scroll_bar_windows_size): Now size_t, not int.
21839 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
21840 Check for overflow.
9ae848fc 21841
a5a62657
PE
21842 * xfaces.c (realize_named_face): Remove vars that are set but not used.
21843 (map_tty_color) [!defined MSDOS]: Likewise.
21844
5c5cdd39
PE
21845 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
21846
66ebf983
PE
21847 * coding.c: Remove vars that are set but not used.
21848 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
21849 All callers changed.
21850 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
21851 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
21852 (decode_coding_charset): Remove vars that are set but not used.
21853
1be4d761
PE
21854 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
21855 that is set but not used.
21856
47553fa8
PE
21857 * print.c (print_object): Remove var that is set but not used.
21858
1f7196bf 21859 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
21860 The gnulib version avoids calling malloc in the usual case,
21861 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
21862 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
21863 * filelock.c (current_lock_owner): Likewise.
21864 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
21865 * sysdep.c: Include allocator.h, careadlinkat.h.
21866 (emacs_no_realloc_allocator): New static constant.
21867 (emacs_readlink): New function.
fdb61804
PE
21868 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
21869 ../lib/careadlinkat.h.
d1fdcab7 21870
f84c17c7
SM
218712011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
21872
21873 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
21874 first non-nil return value).
21875
ef3862ad
JD
218762011-04-03 Jan Djärv <jan.h.d@swipnet.se>
21877
21878 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
21879 if not defined (Bug#8403).
21880
376a7006
JB
218812011-04-02 Juanma Barranquero <lekktu@gmail.com>
21882
21883 * xdisp.c (display_count_lines): Remove parameter `start',
21884 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21885 (get_char_face_and_encoding): Remove parameter `multibyte_p',
21886 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21887 (fill_stretch_glyph_string): Remove parameters `row' and `area',
21888 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
21889 and thereabouts. All callers changed.
21890 (get_per_char_metric): Remove parameter `f', unused since
21891 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
21892
6ca3801d
JM
218932011-04-02 Jim Meyering <meyering@redhat.com>
21894
21895 do not dereference NULL upon failed strdup
21896 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
21897 (ns_get_family): Likewise.
21898
d8e2b5ba
JB
218992011-04-02 Juanma Barranquero <lekktu@gmail.com>
21900
21901 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
21902
8c74fcbd
JD
219032011-04-02 Jan Djärv <jan.h.d@swipnet.se>
21904
21905 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
21906 later (Bug#8403).
21907
7200d79c
SM
219082011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
21909
03408648 21910 Add lexical binding.
7200d79c 21911
03408648
SM
21912 * window.c (Ftemp_output_buffer_show): New fun.
21913 (Fsave_window_excursion):
21914 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
21915
21916 * lread.c (lisp_file_lexically_bound_p): New function.
21917 (Fload): Bind Qlexical_binding.
21918 (readevalloop): Remove `evalfun' arg.
21919 Bind Qinternal_interpreter_environment.
21920 (Feval_buffer): Bind Qlexical_binding.
21921 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
21922 Mark as dynamic.
21923 (syms_of_lread): Declare `lexical-binding'.
21924
21925 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
21926
21927 * keyboard.c (eval_dyn): New fun.
21928 (menu_item_eval_property): Use it.
ca105506
SM
21929
21930 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 21931
03408648
SM
21932 * fns.c (concat, mapcar1): Accept byte-code-functions.
21933
21934 * eval.c (Fsetq): Handle lexical vars.
21935 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
21936 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
21937 (FletX, Flet): Obey lexical binding.
21938 (Fcommandp): Handle closures.
21939 (Feval): New `lexical' arg.
21940 (eval_sub): New function extracted from Feval. Use it almost
21941 everywhere where Feval was used. Look up vars in lexical env.
21942 Handle closures.
21943 (Ffunctionp): Move from subr.el.
21944 (Ffuncall): Handle closures.
21945 (apply_lambda): Remove `eval_flags'.
21946 (funcall_lambda): Handle closures and new byte-code-functions.
21947 (Fspecial_variable_p): New function.
21948 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
21949 but without exporting it to Lisp.
23aba0ea 21950
23aba0ea 21951 * doc.c (Fdocumentation, store_function_docstring):
03408648 21952 * data.c (Finteractive_form): Handle closures.
23aba0ea 21953
03408648
SM
21954 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
21955 interactive spec.
ba83908c 21956
04f2d78b
CB
21957 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
21958 New byte-codes.
03408648
SM
21959 (exec_byte_code): New function extracted from Fbyte_code to handle new
21960 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 21961
03408648 21962 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 21963
03408648 21964 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 21965
e2abce01
JB
219662011-03-31 Juanma Barranquero <lekktu@gmail.com>
21967
21968 * xdisp.c (redisplay_internal): Fix prototype.
21969
63696a73 219702011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 21971
63696a73 21972 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
21973 (try_scrolling): Use it when setting scroll_limit.
21974 Limit scrolling to 100 screen lines.
63696a73
EZ
21975 (redisplay_window): Even when falling back on "recentering",
21976 position point in the window according to scroll-conservatively,
21977 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
21978
21979 (try_scrolling): When point is above the window, allow searching
21980 as far as scroll_max, or one screenful, to compute vertical
21981 distance from PT to the scroll margin position. This prevents
21982 try_scrolling from unnecessarily failing when
21983 scroll-conservatively is set to a value slightly larger than the
21984 window height. Clean up the case of PT below the margin at bottom
21985 of window: scroll_max can no longer be INT_MAX. When aggressive
21986 scrolling is in use, don't let point enter the opposite scroll
21987 margin as result of the scroll.
21988 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
21989 threshold of 100 lines for never-recentering scrolling.
21990
e4cc2dfc
JB
219912011-03-31 Juanma Barranquero <lekktu@gmail.com>
21992
21993 * dispextern.h (move_it_by_lines):
21994 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
21995 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
21996 (message_log_check_duplicate): Remove parameters `prev_bol' and
21997 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
21998 (redisplay_internal): Remove parameter `preserve_echo_area',
21999 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
22000
22001 * indent.c (Fvertical_motion):
22002 * window.c (window_scroll_pixel_based, Frecenter):
22003 Don't pass `need_y_p' to `move_it_by_lines'.
22004
1c470562
SM
220052011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
22006
44f230aa
SM
22007 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
22008 steal a few bits to be more compact.
22009 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
22010 Remove unneeded casts.
22011
1c470562
SM
22012 * bytecode.c (Fbyte_code): CAR and CDR can GC.
22013
888adce9
ZK
220142011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
22015
22016 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
22017 binding" message (bug#7967).
22018
f838ed7b
PE
220192011-03-30 Paul Eggert <eggert@cs.ucla.edu>
22020
77861b95
PE
22021 Fix more problems found by GCC 4.6.0's static checks.
22022
de6dbc14
PE
22023 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
22024 Remove unused local var.
22025
f838ed7b
PE
22026 * editfns.c (Fmessage_box): Remove unused local var.
22027
792c7b2b
PE
22028 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
22029 (note_mode_line_or_margin_highlight, note_mouse_highlight):
22030 Omit unused local vars.
c499e557 22031 * window.c (shrink_windows): Omit unused local var.
b01a1c29 22032 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
22033 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
22034 Omit unused local var.
22035
ba0165e1
PE
22036 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
22037 Don't assume string length fits in int.
32ad8845 22038 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 22039 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 22040
3c59b4c9
PE
22041 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
22042 instead of alloca (Bug#8344).
22043
a3eed478 22044 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 22045 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 22046
eb4d412d
PE
22047 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
22048
1658b401
PE
22049 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
22050 concerns.
22051
22052 * term.c (produce_glyphless_glyph): Remove unnecessary test.
22053
22054 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 22055
9a2c6e05
PE
22056 * keyboard.c (syms_of_keyboard): Use the same style as later
22057 in this function when indexing through an array. This also
22058 works around GCC bug 48267.
22059
03d0a109
PE
22060 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
22061
44f730c8
PE
22062 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
22063
fe75f926
PE
22064 * chartab.c (sub_char_table_ref_and_range): Redo for slight
22065 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
22066
ffa8c828
PE
22067 * keyboard.c, keyboard.h (num_input_events): Now size_t.
22068 This avoids undefined behavior on integer overflow, and is a bit
22069 more convenient anyway since it is compared to a size_t variable.
22070
c5101a77
PE
22071 Variadic C functions now count arguments with size_t, not int.
22072 This avoids an unnecessary limitation on 64-bit machines, which
22073 caused (substring ...) to crash on large vectors (Bug#8344).
22074 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
22075 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 22076 All variadic functions and their callers changed accordingly.
c5101a77
PE
22077 (struct gcpro.nvars): Now size_t, not int. All uses changed.
22078 * data.c (arith_driver, float_arith_driver): Likewise.
22079 * editfns.c (general_insert_function): Likewise.
22080 * eval.c (struct backtrace.nargs, interactive_p)
22081 (internal_condition_case_n, run_hook_with_args, apply_lambda)
22082 (funcall_lambda, mark_backtrace): Likewise.
22083 * fns.c (concat): Likewise.
22084 * frame.c (x_set_frame_parameters): Likewise.
22085 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
22086 0 if not found, not -1. All callers changed.
22087
dd3f25f7
PE
22088 * alloc.c (garbage_collect): Don't assume stack size fits in int.
22089 (stack_copy_size): Now size_t, not int.
22090 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
22091
461c2ab9
JB
220922011-03-28 Juanma Barranquero <lekktu@gmail.com>
22093
22094 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
22095 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22096 All callers changed.
22097
22098 * lisp.h (multibyte_char_to_unibyte):
22099 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
22100 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
22101 * character.h (CHAR_TO_BYTE8):
22102 * cmds.c (internal_self_insert):
22103 * editfns.c (general_insert_function):
22104 * keymap.c (push_key_description):
22105 * search.c (Freplace_match):
22106 * xdisp.c (message_dolog, set_message_1): All callers changed.
22107
f6d62986
SM
221082011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
22109
22110 * keyboard.c (safe_run_hook_funcall): New function.
22111 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
22112 don't set the hook to nil, but remove the offending function instead.
22113 (Qcommand_hook_internal): Remove, unused.
22114 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
22115 Vcommand_hook_internal.
22116
22117 * eval.c (enum run_hooks_condition): Remove.
22118 (funcall_nil, funcall_not): New functions.
22119 (run_hook_with_args): Call each function through a `funcall' argument.
22120 Remove `cond' argument, now redundant.
22121 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
22122 (Frun_hook_with_args_until_failure): Adjust accordingly.
22123 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
22124
1db5b1ad
JB
221252011-03-28 Juanma Barranquero <lekktu@gmail.com>
22126
22127 * dispextern.h (string_buffer_position): Remove declaration.
22128
22129 * print.c (strout): Remove parameter `multibyte', unused since
22130 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
22131
22132 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
22133 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
22134 All callers changed.
22135
22136 * w32.c (_wsa_errlist): Use braces for struct initializers.
22137
22138 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
22139 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
22140 All callers changed.
22141 (string_buffer_position): Likewise. Also, make static (it's never
22142 used outside xdisp.c).
22143 (cursor_row_p): Remove parameter `w', unused since
22144 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
22145 (decode_mode_spec): Remove parameter `precision', introduced during
22146 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
22147 All callers changed.
22148
5ffb62aa
JD
221492011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22150
22151 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
22152
461c2ab9 221532011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
22154
22155 * nsterm.m (ns_menu_bar_is_hidden): New variable.
22156 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
22157 (ns_update_auto_hide_menu_bar): New functions.
22158 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
22159 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
22160 ns_constrain_all_frames.
22161 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
22162 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
22163
5c380ffb
JD
221642011-03-27 Jan Djärv <jan.h.d@swipnet.se>
22165
22166 * nsmenu.m (runDialogAt): Remove argument to timer_check.
22167
9af30bdf
GM
221682011-03-27 Glenn Morris <rgm@gnu.org>
22169
22170 * syssignal.h: Replace RETSIGTYPE with void.
22171 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
22172 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
22173 Replace SIGTYPE with void everywhere.
22174 * s/usg5-4-common.h (SIGTYPE): Remove definition.
22175 * s/template.h (SIGTYPE): Remove commented out definition.
22176
e2abce01
JB
221772011-03-26 Eli Zaretskii <eliz@gnu.org>
22178
22179 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
22180 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
22181
f868cd8a
JB
221822011-03-26 Juanma Barranquero <lekktu@gmail.com>
22183
59eb0929
JB
22184 * w32.c (read_unc_volume): Use parameter `henum', instead of
22185 global variable `wget_enum_handle'.
22186
22187 * keymap.c (describe_vector): Remove parameters `indices' and
22188 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
22189 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
22190
f868cd8a
JB
22191 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
22192
22193 * keyboard.c (timer_check): Remove parameter `do_it_now',
22194 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
22195 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
22196 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
22197
22198 * keyboard.c (read_char):
22199 * w32menu.c (w32_menu_display_help):
22200 * xmenu.c (show_help_event, menu_help_callback):
22201 Adjust calls to `show_help_echo'.
22202
22203 * gtkutil.c (xg_maybe_add_timer):
22204 * keyboard.c (readable_events):
22205 * process.c (wait_reading_process_output):
22206 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
22207
22208 * insdel.c (adjust_markers_gap_motion):
22209 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
22210 (gap_left, gap_right): Don't call it.
22211
2ecf6fdb
CY
222122011-03-25 Chong Yidong <cyd@stupidchicken.com>
22213
22214 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
22215 incurred during fontification.
22216
6b1f9ba4
JB
222172011-03-25 Juanma Barranquero <lekktu@gmail.com>
22218
22219 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
22220 (DEFVAR_PER_BUFFER): Don't pass it.
22221
22222 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
22223 (scrolling_window): Don't pass it.
22224
0f4a96b5
JB
222252011-03-25 Juanma Barranquero <lekktu@gmail.com>
22226
22227 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
22228
22229 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
22230 and `suffix'.
22231 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
22232 of variables specific to SELinux and computation of `encoded_absname'.
22233
22234 * image.c (XPutPixel): Remove unused variable `height'.
22235
22236 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
22237
22238 * unexw32.c (get_section_info): Remove unused variable `section'.
22239
22240 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
22241 (system_process_attributes): Remove unused variable `sess'.
22242 (sys_read): Remove unused variable `err'.
22243
22244 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
22245 (w32_wnd_proc): Remove unused variable `isdead'.
22246 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
22247 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
22248 (x_create_tip_frame): Remove unused variable `tem'.
22249
22250 * w32inevt.c (w32_console_read_socket):
22251 Remove unused variable `no_events'.
22252
22253 * w32term.c (x_draw_composite_glyph_string_foreground):
22254 Remove unused variable `width'.
22255
1149507c
JB
222562011-03-24 Juanma Barranquero <lekktu@gmail.com>
22257
22258 * w32term.c (x_set_glyph_string_clipping):
22259 Don't pass uninitialized region to CombineRgn.
22260
9c88f339
JB
222612011-03-23 Juanma Barranquero <lekktu@gmail.com>
22262
22263 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
22264 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
22265 (Fx_close_connection): Remove unused variable `i'.
22266
22267 * w32font.c (w32font_draw): Return number of glyphs.
22268 (w32font_open_internal): Remove unused variable `i'.
22269 (w32font_driver): Add missing initializer.
22270
22271 * w32menu.c (utf8to16): Remove unused variable `utf16'.
22272 (fill_in_menu): Remove unused variable `items_added'.
22273
22274 * w32term.c (last_mouse_press_frame): Remove static global variable.
22275 (w32_clip_to_row): Remove unused variable `f'.
22276 (x_delete_terminal): Remove unused variable `i'.
22277
22278 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
22279 (NOTHING): Remove unused static global variable.
22280 (uniscribe_check_otf): Remove unused variable `table'.
22281 (uniscribe_font_driver): Add missing initializers.
22282
dee091a3
JD
222832011-03-23 Julien Danjou <julien@danjou.info>
22284
22285 * term.c (Fsuspend_tty, Fresume_tty):
22286 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
22287 * window.c (temp_output_buffer_show):
22288 * insdel.c (signal_before_change):
22289 * frame.c (Fhandle_switch_frame):
22290 * fileio.c (Fdo_auto_save):
22291 * emacs.c (Fkill_emacs):
22292 * editfns.c (save_excursion_restore):
22293 * cmds.c (internal_self_insert):
22294 * callint.c (Fcall_interactively):
22295 * buffer.c (Fkill_all_local_variables):
22296 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
22297 Use Frun_hooks.
0f4a96b5 22298 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 22299 unconditionally since it does the check itself.
dee091a3 22300
2c520ab5 223012011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 22302
c9c49752
PE
22303 Fix more problems found by GCC 4.5.2's static checks.
22304
8abc3f12
PE
22305 * coding.c (encode_coding_raw_text): Avoid unnecessary test
22306 the first time through the loop, since we know p0 < p1 then.
22307 This also avoids a gcc -Wstrict-overflow warning.
22308
a2d26660
PE
22309 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
22310 leading to a memory leak, possible in functions like
22311 load_charset_map_from_file that can allocate an unbounded number
b12ef411 22312 of objects (Bug#8318).
a2d26660 22313
916c72e9
PE
22314 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
22315 that could (at least in theory) be that large.
22316
19ab8a18
PE
22317 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
22318 This is less likely to overflow, and avoids undefined behavior if
22319 overflow does occur. All callers changed. Use strtoul to scan
22320 for the unsigned long integer.
b7cbbd6f
PE
22321 (pint2hrstr): Simplify and tune code slightly.
22322 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 22323
f0641eff
PE
22324 * scroll.c (do_scrolling): Work around GCC bug 48228.
22325 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
22326
7f650bb9
PE
22327 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
22328 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
22329 (validate_x_resource_name): Simplify count usage.
22330 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 22331
37dd57d1
PE
22332 * fileio.c (Fcopy_file): Report error if fchown or fchmod
22333 fail (Bug#8306).
81e56e61 22334
699979fc 22335 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 22336
401bf9b4
PE
22337 * process.c (Fmake_network_process): Use socklen_t, not int,
22338 where POSIX says socklen_t is required in portable programs.
22339 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 22340 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
22341 (Fmake_network_process, server_accept_connection):
22342 (wait_reading_process_output, read_process_output):
22343 Likewise.
22344
b93aacde
PE
22345 * process.c: Rename or move locals to avoid shadowing.
22346 (list_processes_1, Fmake_network_process):
22347 (read_process_output_error_handler, exec_sentinel_error_handler):
22348 Rename or move locals.
4dc343ee 22349 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 22350 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 22351 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 22352 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 22353 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 22354
af8a867c 22355 Make tparam.h and terminfo.c consistent.
44f230aa
SM
22356 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
22357 Include tparam.h instead, since it declares them.
af8a867c
PE
22358 * cm.h (PC): Remove extern decl; tparam.h now does this.
22359 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
22360 * terminfo.c: Include tparam.h, to check interfaces.
22361 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
22362 (tparam): Adjust signature to match interface in tparam.h;
22363 this removes some undefined behavior. Check that outstring and len
22364 are zero, which they always are with Emacs.
22365 * tparam.h (PC, BC, UP): New extern decls.
22366
0248044d 22367 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 22368 (xftfont_open): Rename locals to avoid shadowing.
0248044d 22369
8ff096c1 22370 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
22371 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
22372 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 22373 (ftfont_list): Remove unused local.
49eaafba
PE
22374 (get_adstyle_property, ftfont_pattern_entity):
22375 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
22376 Rename locals to avoid shadowing.
8ff096c1 22377
e2be39f6
PE
22378 * xfont.c (xfont_list_family): Mark var as initialized.
22379
c9735e30
PE
22380 * xml.c (make_dom): Now static.
22381
8f5201ae
PE
22382 * composite.c (composition_compute_stop_pos): Rename local to
22383 avoid shadowing.
b246f932
PE
22384 (composition_reseat_it): Remove unused locals.
22385 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 22386 (composition_update_it): Mark var as initialized.
11b61122
PE
22387 (find_automatic_composition): Mark vars as initialized,
22388 with a FIXME (Bug#8290).
8f5201ae 22389
760fbc2c
PE
22390 character.h: Rename locals to avoid shadowing.
22391 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
22392 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
22393 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
22394 (BUF_DEC_POS): Be more systematic about renaming local temporaries
22395 to avoid shadowing.
22396
ff08eb85
PE
22397 * textprop.c (property_change_between_p): Remove; unused.
22398
fc7bf025
PE
22399 * intervals.c (interval_start_pos): Now static.
22400
235d7abc
PE
22401 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
22402
44f230aa
SM
22403 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
22404 Rename locals to avoid shadowing.
3e7d6594 22405
50060332
PE
22406 * sound.c (wav_play, au_play, Fplay_sound_internal):
22407 Fix pointer signedness.
d01f234b 22408 (alsa_choose_format): Remove unused local var.
c83b8872
PE
22409 (wav_play): Initialize a variable to 0, to prevent undefined
22410 behavior (Bug#8278).
50060332 22411
c4fc4e30
PE
22412 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
22413
918436ed
PE
22414 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
22415
c939f91b
PE
22416 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
22417 clobbering (Bug#8298).
b9c7f648
PE
22418 * sysdep.c (sys_subshell): Likewise.
22419 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 22420
6bd8c144
PE
22421 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
22422 This should get cleaned up, so that child_setup has the
22423 same signature on all platforms.
22424
7710357c 22425 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 22426 (relocate_fd): Rename locals to avoid shadowing.
7710357c 22427
c59da222
CY
224282011-03-22 Chong Yidong <cyd@stupidchicken.com>
22429
22430 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
22431 not to be necessary, and produces flickering.
22432
66b87493
GM
224332011-03-20 Glenn Morris <rgm@gnu.org>
22434
22435 * config.in: Remove file.
22436
45b6f6d5
JB
224372011-03-20 Juanma Barranquero <lekktu@gmail.com>
22438
22439 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
22440 are now in src/globals.h.
22441 (syms_of_minibuf): Remove spurious & from previous change.
22442
cd394be1 224432011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
22444
22445 * minibuf.c (completing-read-function): New variable.
22446 (completing-read-default): Rename from completing-read.
22447 (completing-read): Call completing-read-function.
22448
b14e3e21
CY
224492011-03-19 Juanma Barranquero <lekktu@gmail.com>
22450
22451 * xfaces.c (Fx_load_color_file):
22452 Read color file from absolute filename (bug#8250).
22453
f2b726e6
JB
224542011-03-19 Juanma Barranquero <lekktu@gmail.com>
22455
22456 * makefile.w32-in: Update dependencies.
22457
09f6ff02
EZ
224582011-03-17 Eli Zaretskii <eliz@gnu.org>
22459
22460 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
22461
29a6015a
PE
224622011-03-17 Paul Eggert <eggert@cs.ucla.edu>
22463
a3a6c54e
PE
22464 Fix more problems found by GCC 4.5.2's static checks.
22465
b766f867
PE
22466 * process.c (make_serial_process_unwind, send_process_trap):
22467 (sigchld_handler): Now static.
22468
be02381c
PE
22469 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
22470 That way, the code declares only the vars that it needs.
22471 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
22472 * s/cygwin.h (PTY_ITERATION): Likewise.
22473 * s/darwin.h (PTY_ITERATION): Likewise.
22474 * s/gnu-linux.h (PTY_ITERATION): Likewise.
22475
57048744
PE
22476 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
22477 * process.c (allocate_pty): Don't declare stb unless it's needed.
22478
7914961c 22479 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
22480 (CONSTANTLIM): Remove; unused.
22481 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
22482 Define only if needed.
7914961c 22483
b3967b18
PE
22484 * unexelf.c (unexec): Name an expression,
22485 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
22486 Use a different way to cause a compilation error if anyone uses
22487 n rather than nn, a way that does not involve shadowing.
73366a00 22488 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 22489
29a6015a
PE
22490 * deps.mk (unexalpha.o): Remove; unused.
22491
43cfc33e 22492 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 22493 * unexec.h: New file.
ce701a33
PE
22494 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
22495 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
22496 Depend on unexec.h.
22497 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
22498 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
22499 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 22500 Change as necessary to match prototype in unexec.h.
ce701a33 22501
01f44d5a
PE
22502 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
22503 shadowing.
4f63c6bb 22504 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 22505
a6670b0b
PE
22506 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
22507 Rename locals to avoid shadowing.
22508
cef2010d 22509 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 22510 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 22511
d4d7173a
PE
22512 * print.c (Fredirect_debugging_output): Fix pointer signedess.
22513
f08b802a
PE
22514 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
22515 warning when compiling print.c.
22516
3ddb0639
PE
22517 * font.c (font_unparse_fcname): Abort in an "impossible" situation
22518 instead of using an uninitialized var.
5ad03b97 22519 (font_sort_entities): Mark var as initialized.
3ddb0639 22520
170a2692
PE
22521 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
22522
e663c700
PE
22523 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
22524 pointers to constants.
89bc529a 22525 (font_parse_fcname): Remove unused vars.
7b81e2d0 22526 (font_delete_unmatched): Now static.
ea838e10 22527 (font_get_spec): Remove; unused.
13a547c6
PE
22528 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
22529 (font_update_drivers, Ffont_get_glyphs, font_add_log):
22530 Rename or move locals to avoid shadowing.
e663c700 22531
2a80c887 22532 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 22533 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 22534
1384fa33 22535 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 22536 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 22537
8b2c52e9
PE
22538 * alloc.c (mark_backtrace): Move decl from here ...
22539 * lisp.h: ... to here, so that it can be checked.
22540
475545b5 22541 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 22542 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
22543 (lisp_indirect_variable): Name an expression,
22544 to avoid gcc -Wbad-function-cast warning.
1faed8ae 22545 (Fdefvar): Rename locals to avoid shadowing.
475545b5 22546
b1349114 22547 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 22548 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 22549 Use const pointer when appropriate.
b1349114 22550
a2928364
PE
22551 * lisp.h (get_system_name, get_operating_system_release):
22552 Move decls here, to check interfaces.
22553 * process.c (get_operating_system_release): Move decl to lisp.h.
22554 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
22555 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
22556 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
22557 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
22558 (Fformat_time_string, Fencode_time, Finsert_char):
22559 (Ftranslate_region_internal, Fformat):
22560 Rename or remove local vars to avoid shadowing.
9710023e 22561 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 22562
a415e694
PE
22563 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
22564 avoid shadowing.
22565
8ef4622d
PE
22566 * lisp.h (eassert): Check that the argument compiles, even if
22567 ENABLE_CHECKING is not defined.
22568
946f9a5b
PE
22569 * data.c (Findirect_variable): Name an expression, to avoid
22570 gcc -Wbad-function-cast warning.
112396d6 22571 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 22572 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
22573 (Fmake_variable_buffer_local, Fmake_local_variable):
22574 Mark variables as initialized.
52746918 22575 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 22576
e5aab7e7 22577 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
22578 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
22579 Rename locals to avoid shadowing.
dff45157
PE
22580 (mark_stack): Move local variables into the #ifdef region where
22581 they're used.
7bc26fdb
PE
22582 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
22583 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
22584 needed otherwise.
22585 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
22586 (GC_STRING_CHARS): Remove; not used.
d40d4be1 22587 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 22588
e5aab7e7
PE
22589 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
22590 avoids undefined behavior in theory.
22591
4da60324
PE
22592 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
22593
88043301
PE
22594 Use functions, not macros, for up- and down-casing (Bug#8254).
22595 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22596 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
22597 to use the following functions instead of these macros.
22598 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
22599 EMACS_INT, since callers assume the returned value fits in int.
22600 (upcase1): Likewise, for UPCASE_TABLE.
22601 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 22602 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 22603 the race-condition problem in the old DOWNCASE.
88043301 22604
19ed5445
PE
22605 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
22606 Rename locals to avoid shadowing.
22607 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
22608 (regex_compile, re_search_2, re_match_2_internal):
22609 Remove unused local vars.
952db0d7
PE
22610 (FREE_VAR): Rewrite so as not to use empty "else",
22611 which gcc can warn about.
da053e48 22612 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
22613 (RETALLOC_IF): Define only if needed.
22614 (WORDCHAR_P): Likewise. This one is never needed, but is used
22615 only in a comment talking about a compiler bug, so put inside
22616 the #if 0 of that comment.
22617 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
22618 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
22619 Remove; unused.
19ed5445 22620
1f3561e4 22621 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
22622 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
22623 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 22624
ded6f8f7
PE
22625 * search.c (simple_search): Remove unused var.
22626
dbd37a95
PE
22627 * dired.c (compile_pattern): Move decl from here ...
22628 * lisp.h: ... to here, so that it can be checked.
22629 (struct re_registers): New forward decl.
22630
7e47afad
PE
22631 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
22632
85f24f61
PE
22633 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
22634 All uses changed.
22635 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
22636 Rename locals to avoid shadowing.
5671df8f 22637 (Fvertical_motion): Mark locals as initialized.
85f24f61 22638
181aa2be 22639 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 22640 (casify_region): Mark local as initialized.
181aa2be 22641
930d429c
PE
22642 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
22643
7082eac6
PE
22644 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
22645 New macros, so that the caller can use some names other than
22646 gcpro1, gcpro2, etc.
22647 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
22648 of the new macros.
22649 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
22650 argument, for consistency with GCPRO2_VAR, etc: it is now the
22651 prefix of the variable, not the variable itself. All uses
22652 changed.
38b2c076
PE
22653 * dired.c (directory_files_internal, file_name_completion):
22654 Rename locals to avoid shadowing.
22655
15206ed9
PE
22656 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
22657 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
22658 dired.c's scmp function, had undefined behavior.
22659 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
22660 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
22661 * buffer.h: ... to here, because these macros use current_buffer,
22662 and the new implementation with inline functions needs to have
22663 current_buffer in scope now, rather than later when the macros
22664 are used.
22665 (downcase, upcase1): New static inline functions.
22666 (DOWNCASE, UPCASE1): Reimplement using these functions.
22667 This avoids undefined behavior in expressions like
22668 DOWNCASE (x) == DOWNCASE (y), which previously suffered
22669 from race conditions in accessing the global variables
22670 case_temp1 and case_temp2.
22671 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
22672 * lisp.h (case_temp1, case_temp2): Remove their decls.
22673 * character.h (ASCII_CHAR_P): Move from here ...
22674 * lisp.h: ... to here, so that the inline functions mentioned
22675 above can use them.
22676
4a6bea26
PE
22677 * dired.c (directory_files_internal_unwind): Now static.
22678
f14b7e14
PE
22679 * fileio.c (file_name_as_directory, directory_file_name):
22680 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
22681 Now static.
2893f146
PE
22682 (file_name_as_directory): Use const pointers when appropriate.
22683 (Fexpand_file_name): Likewise. In particular, newdir might
22684 point at constant storage, so make it a const pointer.
fd4ead52 22685 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
22686 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
22687 signedness issues.
f839df0c
PE
22688 (Fset_file_times, Finsert_file_contents, auto_save_error):
22689 Rename locals to avoid shadowing.
f14b7e14 22690
5716756e 22691 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
22692 (Ftry_completion, Fall_completions): Rename or remove locals
22693 to avoid shadowing.
5716756e 22694
b4c3046a
PE
22695 * marker.c (bytepos_to_charpos): Remove; unused.
22696
b45db522
PE
22697 * lisp.h (verify_bytepos, count_markers): New decls,
22698 so that gcc does not warn that these functions aren't declared.
22699
85876d07
PE
22700 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
22701 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 22702 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 22703 (copy_text): Remove unused local var.
85876d07 22704
03d78a21 22705 * filelock.c (within_one_second): Now static.
b3dd38ab 22706 (lock_file_1): Rename local to avoid shadowing.
03d78a21 22707
5df8f01b
PE
22708 * buffer.c (fix_overlays_before): Mark locals as initialized.
22709 (fix_start_end_in_overlays): Likewise. This function should be
22710 simplified by using pointers-to-pointers, but that's a different
22711 matter.
b1d876f1 22712 (switch_to_buffer_1): Now static.
8f54f30a
PE
22713 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
22714 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 22715
a70072c9 22716 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 22717 Fix pointer signedness issue.
edced198
PE
22718 (sys_subshell): Mark local as volatile if checking for lint,
22719 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 22720 (MAXPATHLEN): Define only if needed.
a70072c9 22721
a0977c44
PE
22722 * process.c (serial_open, serial_configure): Move decls from here ...
22723 * systty.h: ... to here, so that they can be checked.
22724
a884fdcc
PE
22725 * fns.c (get_random, seed_random): Move extern decls from here ...
22726 * lisp.h: ... to here, so that they can be checked.
22727
604efe86 22728 * sysdep.c (reset_io): Now static.
b8950c94 22729 (wait_for_termination_signal): Remove; unused.
604efe86 22730
38fc62d9
PE
22731 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
22732 (copy_keymap_item, append_key, push_text_char_description):
22733 Now static.
1004a21a 22734 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 22735 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
22736 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
22737 (describe_map_tree):
22738 Rename locals to avoid shadowing.
38fc62d9 22739
2f2650da
PE
22740 * keyboard.c: Declare functions static if they are not used elsewhere.
22741 (echo_char, echo_dash, cmd_error, top_level_2):
22742 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
22743 (read_char, kbd_buffer_get_event, make_lispy_position):
22744 (make_lispy_event, make_lispy_movement, apply_modifiers):
22745 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
22746 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
22747 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 22748 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 22749 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 22750
a053e86c 22751 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
22752 (mark_kboards): Move decl here ...
22753 * alloc.c (mark_kboards): ... from here.
a053e86c 22754
4752793e
PE
22755 * lisp.h (force_auto_save_soon): New decl.
22756
74f10ca7 22757 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
22758 (DEFINE_DUMMY_FUNCTION): New macro.
22759 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
22760 Use it.
c03cd23f
PE
22761 (main): Add casts to avoid warnings
22762 if GCC considers string literals to be constants.
74f10ca7 22763
022e70d4
PE
22764 * lisp.h (fatal_error_signal): Add decl, since it's exported.
22765
59d6fe83
PE
22766 * dbusbind.c: Pointer signedness fixes.
22767 (xd_signature, xd_append_arg, xd_initialize):
22768 (Fdbus_call_method, Fdbus_call_method_asynchronously):
22769 (Fdbus_method_return_internal, Fdbus_method_error_internal):
22770 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
22771 (Fdbus_register_signal): Use SSDATA when the context wants char *.
22772
78320123
PE
22773 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
22774 if GCC considers string literals to be constants.
49cebcca 22775 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 22776
35ac2a97
SM
227772011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
22778
fb103ca9
SM
22779 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
22780 (print_preprocess, print_object): New macro to fix last change.
22781
35ac2a97
SM
22782 * print.c (print_preprocess): Don't forget font objects.
22783
62973b41
JB
227842011-03-16 Juanma Barranquero <lekktu@gmail.com>
22785
22786 * emacs.c (USAGE3): Doc fixes.
22787
0e48bb22
AS
227882011-03-15 Andreas Schwab <schwab@linux-m68k.org>
22789
22790 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
22791 structure.
22792
7684e57b
JB
227932011-03-14 Juanma Barranquero <lekktu@gmail.com>
22794
22795 * lisp.h (VWindow_system, Qfile_name_history):
22796 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
22797 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
22798 (w32_system_caret_x, w32_system_caret_y): Declare extern.
22799
22800 * w32select.c: Don't #include "keyboard.h".
c96bbc66 22801 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
22802
22803 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
22804 * w32console.c (detect_input_pending, read_input_pending)
22805 (encode_terminal_code):
22806 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
22807 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
22808 (w32_system_caret_y, Qfile_name_history):
22809 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
22810 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
22811 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
22812 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
22813 * w32proc.c (Qlocal, report_file_error):
22814 * w32term.c (Vwindow_system, updating_frame):
22815 * w32uniscribe.c (initialized, uniscribe_font_driver):
22816 Remove unneeded extern declarations.
22817
2aa46d6c
CY
228182011-03-14 Chong Yidong <cyd@stupidchicken.com>
22819
c96bbc66 22820 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 22821
cffc6f3b
CY
228222011-03-13 Chong Yidong <cyd@stupidchicken.com>
22823
22824 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
22825 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
22826 These macros can no longer be used for assignment.
22827
44f230aa
SM
22828 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
22829 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
22830 (record_buffer_markers, fetch_buffer_markers): New functions for
22831 recording and fetching special buffer markers.
22832 (set_buffer_internal_1, set_buffer_temp): Use them.
22833
22834 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
22835
22836 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
22837
22838 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
22839 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
22840
22841 * xdisp.c (hscroll_window_tree):
22842 (reconsider_clip_changes): Use PT instead of BUF_PT.
22843
d251f04b
EZ
228442011-03-13 Eli Zaretskii <eliz@gnu.org>
22845
22846 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
22847 $(EMACS_ROOT)/lib/intprops.h.
22848
f0c77cd1
PE
228492011-03-13 Paul Eggert <eggert@cs.ucla.edu>
22850
3eca4629
PE
22851 Fix more problems found by GCC 4.5.2's static checks.
22852
7c86ee98
PE
22853 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
22854 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
22855 (xg_free_frame_widgets): Make it clear that a local variable is
22856 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
22857 (gdk_window_get_screen): Make it clear that this macro is needed
22858 only if USE_GTK_TOOLTIP.
1e5524e7
PE
22859 (int_gtk_range_get_value): New function, which avoids a diagnostic
22860 from gcc -Wbad-function-cast.
22861 (xg_set_toolkit_scroll_bar_thumb): Use it.
22862 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
22863 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
22864 (get_utf8_string, xg_get_file_with_chooser):
22865 Rename locals to avoid shadowing.
22866 (create_dialog): Move locals to avoid shadowing.
7c86ee98 22867
41729b81
PE
22868 * xgselect.c (xg_select): Remove unused var.
22869
f0c77cd1
PE
22870 * image.c (four_corners_best): Mark locals as initialized.
22871 (gif_load): Initialize transparent_p to zero (Bug#8238).
22872 Mark another local as initialized.
ec6cf4c6 22873 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 22874
ce0ad53d 22875 * image.c (clear_image_cache): Now static.
d5d5a617 22876 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 22877 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
22878 (x_edge_detection): Remove unnecessary cast that
22879 gcc -Wbad-function-cast diagnoses.
2037898d 22880 (gif_load): Fix pointer signedness.
6ae141d6
PE
22881 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
22882 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 22883
33383987 228842011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 22885
d32df629
PE
22886 Improve quality of tests for time stamp overflow.
22887 For example, without this patch (encode-time 0 0 0 1 1
22888 1152921504606846976) returns the obviously-bogus value (-948597
22889 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
22890 reports time overflow. See
22891 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
22892 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
22893 * editfns.c: Include limits.h and intprops.h.
22894 (TIME_T_MIN, TIME_T_MAX): New macros.
22895 (time_overflow): Move earlier, to before first use.
22896 (hi_time, lo_time): New functions, for an accurate test for
22897 out-of-range times.
22898 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
22899 (Fget_internal_run_time): Don't assume time_t fits in int.
22900 (make_time): Use list2 instead of Fcons twice.
22901 (Fdecode_time): More accurate test for out-of-range times.
22902 (check_tm_member): New function.
22903 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
22904 (lisp_time_argument): Don't rely on undefined left-shift and
22905 right-shift behavior when checking for time stamp overflow.
8be6f318 22906
fe31d94c
PE
22907 * editfns.c (time_overflow): New function, refactoring common code.
22908 (Fformat_time_string, Fdecode_time, Fencode_time):
22909 (Fcurrent_time_string): Use it.
22910
8be6f318
PE
22911 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
22912 * dired.c (make_time): Move to ...
22913 * editfns.c (make_time): ... here.
22914 * systime.h: Note the move.
22915
09d9db2c 229162011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 22917
126bc0dc
YM
22918 * fringe.c (update_window_fringes): Remove unused variables.
22919
c47cbdfd
YM
22920 * unexmacosx.c (copy_data_segment): Also copy __got section.
22921 (Bug#8223)
22922
7ac80be9
EZ
229232011-03-12 Eli Zaretskii <eliz@gnu.org>
22924
c96bbc66 22925 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
22926 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
22927 Constify `char *' arguments and their references according to
22928 prototypes in tparam.h.
22929
ecb0f94d 22930 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 22931
7ac80be9
EZ
22932 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
22933 Adapt all references accordingly.
22934
22935 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
22936
ef1fd07e
TT
229372011-03-11 Tom Tromey <tromey@redhat.com>
22938
22939 * buffer.c (syms_of_buffer): Remove obsolete comment.
22940
7ef4b50c
EZ
229412011-03-11 Eli Zaretskii <eliz@gnu.org>
22942
22943 * termhooks.h (encode_terminal_code): Declare prototype.
22944
22945 * msdos.c (encode_terminal_code): Don't declare prototype.
22946
22947 * term.c (encode_terminal_code): Now external again, used by
22948 w32console.c and msdos.c.
22949
44f230aa
SM
22950 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
22951 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 22952
4b1ec863 229532011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 22954
1714f52b 22955 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 22956
4b1ec863
PE
22957 * fringe.c (update_window_fringes): Mark locals as initialized
22958 (Bug#8227).
22959 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 22960
524c7aa6
PE
22961 * alloc.c (mark_fringe_data): Move decl from here ...
22962 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
22963 to check its interface.
22964 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
22965
a5c0af81 22966 * fontset.c (free_realized_fontset): Now static.
7519b8cd 22967 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 22968 (fontset_font): Mark local as initialized.
a9a06e0b 22969 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 22970
b4716021
PE
22971 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
22972
811e9bac 22973 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 22974 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
22975 (x_own_selection, Fx_disown_selection_internal): Rename locals
22976 to avoid shadowing.
22977 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 22978
7e3ab302
PE
22979 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
22980 so that the caller can use some name other than gcpro1.
22981 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
22982 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22983 (Fx_backspace_delete_keys_p):
22984 Use them to avoid shadowing, and rename vars to avoid shadowing.
22985 (x_decode_color, x_set_name, x_window): Now static.
6b437900 22986 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 22987 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
22988 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
22989 Remove unused locals.
7e3ab302
PE
22990 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
22991 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
22992 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
22993 macros.
f78faa98 22994
e2b13473
PE
22995 * xterm.h (x_mouse_leave): New decl.
22996
77f23912
PE
22997 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
22998 Remove unused functions.
cdf4ba58
PE
22999 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
23000 (x_calc_absolute_position): Now static.
7411c686 23001 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 23002 Don't declare local "event" unless it's used.
ed7bf3a5
PE
23003 (x_iconify_frame, x_free_frame_resources): Don't declare locals
23004 unless they are used.
38d0b34a
PE
23005 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
23006 (x_fatal_error_signal): Remove; not used.
a6067996
PE
23007 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
23008 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
23009 (x_error_catcher, x_connection_closed, x_error_handler):
23010 (x_error_quitter, xembed_send_message, x_iconify_frame):
23011 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 23012 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 23013 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 23014
44f230aa
SM
23015 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
23016 Rename or move locals to avoid shadowing.
6b463e58 23017 (tty_defined_color, merge_face_heights): Now static.
5967d051 23018 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
23019 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
23020 does not deduce is never used uninitialized.
73719eba
PE
23021 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
23022 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 23023
426994c3 23024 * terminal.c (store_terminal_param): Now static.
5489860b 23025
032f1620 23026 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 23027 (set_frame_menubar): Remove unused local.
d4323972 23028 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
23029 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
23030 since they might point to immutable storage.
281585b0
PE
23031 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
23032 since it's unused otherwise.
032f1620 23033
367c19e5 23034 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 23035 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
23036 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
23037 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 23038 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
23039 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
23040 does not deduce are never used uninitialized.
70739cbe 23041
07b48fa9
PE
23042 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
23043
8868a238 23044 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
23045 * window.c (window_loop, size_window):
23046 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 23047
7e5cf297 23048 * window.c (display_buffer): Now static.
d6550a9f
PE
23049 (size_window): Mark variables that gcc -Wuninitialized
23050 does not deduce are never used uninitialized.
a586633d
PE
23051 * window.h (check_all_windows): New decl, to forestall
23052 gcc -Wmissing-prototypes diagnostic.
5b555da1 23053 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 23054
f6095868
PE
23055 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
23056 shadowing.
23057 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
23058 Include <limits.h>.
23059 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
23060 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
23061 (load_charset_map): Mark variables that gcc -Wuninitialized
23062 does not deduce are never used uninitialized.
53df7c11 23063 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 23064
f38b440c
PE
23065 * coding.c (coding_set_source, coding_set_destination):
23066 Use "else { /* comment */ }" rather than "else /* comment */;"
23067 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
23068 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
23069 a block, when the outer 'i' will do.
23070 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
23071 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
23072 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
23073 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
23074 (Fdecode_sjis_char, Fdefine_coding_system_internal):
23075 Rename locals to avoid shadowing.
23076 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
23077 * coding.c (emacs_mule_char, encode_invocation_designation):
23078 Now static, since they're not used elsewhere.
413bb2db 23079 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 23080 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
23081 (decode_coding_emacs_mule): Mark variables that gcc
23082 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
23083 (detect_coding_iso_2022): Initialize a local variable that might
23084 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 23085 this initialization is needed. (Bug#8211)
5f58e762
PE
23086 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
23087 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
23088 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
23089 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
23090 Remove unused macros.
f38b440c 23091
232b38b9 23092 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 23093 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 23094 * character.c (string_count_byte8): Likewise.
232b38b9 23095
fb90da1b
PE
23096 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
23097 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
23098
fb93dbc2
PE
23099 * chartab.c (copy_sub_char_table): Now static, since it's not used
23100 elsewhere.
5c156ace
PE
23101 (sub_char_table_ref_and_range, char_table_ref_and_range):
23102 Rename locals to avoid shadowing.
bbcd0949 23103 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 23104
7d3b3862 23105 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 23106 (BIDI_BOB): Remove unused macro.
7d3b3862 23107
6be7d3da
PE
23108 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
23109 deduce are never used uninitialized.
c2ed9c8b 23110 * term.c (encode_terminal_code): Likewise.
6be7d3da 23111
75f8807f 23112 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 23113
50938595
PE
23114 * tparam.h: New file.
23115 * term.c, tparam.h: Include it.
23116 * deps.mk (term.o, tparam.o): Depend on tparam.h.
23117 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
23118 Move these decls to tparam.h, and make them agree with what
23119 is actually in tparam.c. The previous trick of using incompatible
23120 decls in different modules does not conform to the C standard.
23121 All callers of tparam changed to use tparam's actual API.
23122 * tparam.c (tparam1, tparam, tgoto):
23123 Use const pointers where appropriate.
23124
fbceeba2
PE
23125 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
23126 * cm.h (struct cm): Likewise.
23127 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
23128 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
23129 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
23130 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
23131 (turn_on_face, init_tty): Likewise.
23132 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 23133
7f3f1250
PE
23134 * term.c (term_mouse_position): Rename local to avoid shadowing.
23135
e6ca6543
PE
23136 * alloc.c (mark_ttys): Move decl from here ...
23137 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
23138
c40f8d15
AS
231392011-03-11 Andreas Schwab <schwab@linux-m68k.org>
23140
23141 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
23142
cfe0661d
JB
231432011-03-09 Juanma Barranquero <lekktu@gmail.com>
23144
23145 * search.c (compile_pattern_1): Remove argument regp, unused since
23146 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
23147 (compile_pattern): Don't pass it.
23148
0afb4571
J
231492011-03-08 Jan Djärv <jan.h.d@swipnet.se>
23150
23151 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
23152 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
23153 for ! HAVE_GTK3.
23154 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
23155
23156 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
23157
23158 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
23159 gdk_window_get_screen, gdk_window_get_geometry,
23160 gdk_x11_window_lookup_for_display and GDK_KEY_g.
23161 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
23162 (xg_get_pixbuf_from_pixmap): New function.
23163 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
23164 to Pixmap, take frame as parameter, remove GdkColormap parameter.
23165 Call xg_get_pixbuf_from_pixmap instead of
23166 gdk_pixbuf_get_from_drawable.
23167 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
23168 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
23169 (xg_check_special_colors): Use GtkStyleContext and its functions
23170 for HAVE_GTK3.
23171 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
23172 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
23173 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
23174 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
23175 Call gtk_widget_get_preferred_size.
0afb4571
J
23176 (xg_frame_resized): gdk_window_get_geometry only takes 5
23177 parameters.
44f230aa
SM
23178 (xg_win_to_widget, xg_event_is_for_menubar):
23179 Call gdk_x11_window_lookup_for_display.
0afb4571
J
23180 (xg_set_widget_bg): New function.
23181 (delete_cb): New function.
895009e1 23182 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 23183 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
23184 (xg_set_background_color): Call xg_set_widget_bg.
23185 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
23186 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
23187 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
23188 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
23189 if ! HAVE_GTK3.
23190 (update_frame_tool_bar): Call gtk_widget_hide.
23191 (xg_initialize): Use GDK_KEY_g.
23192
23193 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
23194 if ! HAVE_GTK3
23195 (x_session_initialize): Call gdk_x11_set_sm_client_id.
23196
23197 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
23198 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
23199 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
23200
1c2cc4ef
JB
232012011-03-08 Juanma Barranquero <lekktu@gmail.com>
23202
23203 * w32xfns.c (select_palette): Check success of RealizePalette against
23204 GDI_ERROR, not zero.
23205
33383987 23206See ChangeLog.11 for earlier changes.
aac0c6e3
MR
23207
23208;; Local Variables:
23209;; coding: utf-8
aac0c6e3
MR
23210;; End:
23211
ab422c4d 23212 Copyright (C) 2011-2013 Free Software Foundation, Inc.
aac0c6e3
MR
23213
23214 This file is part of GNU Emacs.
23215
23216 GNU Emacs is free software: you can redistribute it and/or modify
23217 it under the terms of the GNU General Public License as published by
23218 the Free Software Foundation, either version 3 of the License, or
23219 (at your option) any later version.
23220
23221 GNU Emacs is distributed in the hope that it will be useful,
23222 but WITHOUT ANY WARRANTY; without even the implied warranty of
23223 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23224 GNU General Public License for more details.
23225
23226 You should have received a copy of the GNU General Public License
23227 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.