* character.c, charset.c, chartab.c: Use bool for booleans.
[bpt/emacs.git] / src / ChangeLog
1 2012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2
3 * character.c, charset.c, chartab.c: Use bool for booleans.
4 * character.c (lisp_string_width, string_count_byte8)
5 (string_escape_byte8):
6 * charset.c (charset_map_loaded, load_charset_map, read_hex):
7 (load_charset_map_from_file, map_charset_chars)
8 (Fdefine_charset_internal, define_charset_internal)
9 (Fdeclare_equiv_charset, find_charsets_in_text)
10 (Ffind_charset_region, char_charset, Fiso_charset):
11 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
12 (sub_char_table_set, sub_char_table_set_range)
13 (char_table_set_range, optimize_sub_char_table)
14 (map_sub_char_table):
15 Use bool for boolean.
16 * character.c (str_to_unibyte): Omit last boolean argument; it was
17 always 0. All callers changed.
18 * character.h, charset.h: Adjust to match previous changes.
19 * character.h (char_printable_p): Remove decl of nonexistent function.
20 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
21 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
22 are all boolean, so make them single-bit bitfields.
23
24 * lisp.h (ASET): Remove attempt to detect side effects.
25 It was meant to be temporary and it often doesn't work,
26 because when IDX has side effects the behavior of IDX==IDX
27 is undefined. See Stefan Monnier in
28 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
29
30 2012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
31
32 * lisp.h (functionp): New function (extracted from Ffunctionp).
33 (FUNCTIONP): Use it.
34 * eval.c (Ffunctionp): Use it.
35
36 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
37
38 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
39 as that's faster and simpler than static storage. Don't bother
40 with the g_main_context_query overhead if g_main_context_pending
41 says no events are pending.
42 (gfds, gfds_size): Remove these static vars.
43 (xgselect_initialize): Remove; no longer needed.
44 All uses and decls removed.
45
46 * emacs.c (fatal_error_signal_hook): Remove.
47 All uses removed. This leftover from old code was always 0.
48
49 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
50 * casefiddle.c (casify_object, casify_region):
51 * casetab.c (set_case_table):
52 * category.c, category.h (word_boundary_p):
53 * category.h (CHAR_HAS_CATEGORY):
54 Use bool for booleans, instead of int.
55
56 2012-08-25 Eli Zaretskii <eliz@gnu.org>
57
58 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
59
60 2012-08-25 Paul Eggert <eggert@cs.ucla.edu>
61
62 On assertion failure, print backtrace if available.
63 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
64 (die) [ENABLE_CHECKING]: Print a backtrace if available.
65 * Makefile.in (LIB_EXECINFO): New macro.
66 (LIBES): Use it.
67
68 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
69 * bytecode.c (exec_byte_code):
70 * callint.c (check_mark, Fcall_interactively):
71 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
72 (getenv_internal, sync_process_alive, call_process_exited):
73 * lisp.h (USE_SAFE_ALLOCA):
74 Use bool for booleans, instead of int.
75 * lisp.h, process.h: Adjust prototypes to match above changes.
76 * callint.c (Fcall_interactively): Don't assume the mark's
77 offset fits in 'int'.
78
79 2012-08-24 Paul Eggert <eggert@cs.ucla.edu>
80
81 * buffer.c, buffer.h: Use bool for boolean.
82 * buffer.c (reset_buffer_local_variables)
83 (buffer_lisp_local_variables, Fset_buffer_modified_p)
84 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
85 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
86 (overlay_touches_p, overlay_strings, Foverlay_put)
87 (report_overlay_modification, call_overlay_mod_hooks):
88 (mmap_enlarge, mmap_set_vars):
89 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
90 Use bool for booleans, instead of int.
91 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
92 since the 1-or-0 return value is always ignored anyway.
93 (mmap_initialized_p):
94 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
95 * buffer.h, lisp.h: Adjust prototypes to match above changes.
96
97 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
98
99 * bidi.c: Use bool for boolean.
100 This is a bit more readable, and makes the text segment of bidi.o
101 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
102 Presumably it's faster too.
103 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
104 Now bool.
105 (bidi_cache_find_level_change, bidi_cache_iterator_state)
106 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
107 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
108 (bidi_explicit_dir_char, bidi_level_of_next_char)
109 (bidi_find_other_level_edge, bidi_move_to_visually_next):
110 Use bool for booleans, instead of int.
111 * dispextern.h (bidi_init_it, bidi_paragraph_init)
112 (bidi_unshelve_cache): Adjust decls to match code.
113
114 2012-08-23 Martin Rudalics <rudalics@gmx.at>
115
116 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
117 argument.
118
119 2012-08-23 Paul Eggert <eggert@cs.ucla.edu>
120
121 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
122 * atimer.h: Include <stdbool.h>.
123
124 2012-08-22 Dan Nicolaescu <dann@gnu.org>
125
126 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
127 compile time tests instead of run time tests on systems that do
128 not use them.
129 (FRAME_MAC_P): Remove leftover from deleted code.
130 * frame.c (syms_of_frame): Remove leftover from deleted code.
131
132 2012-08-22 Jan Djärv <jan.h.d@swipnet.se>
133
134 * nsterm.m (insertText:): Don't clear modifiers if code is space.
135
136 2012-08-22 Paul Eggert <eggert@cs.ucla.edu>
137
138 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
139 Otherwise, the compiler complains about (A?B:C) where B is void
140 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
141 (fontset_add): Return void, for FONTSET_ADD.
142
143 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
144
145 * alloc.c: Use bool for booleans.
146 (gc_in_progress, abort_on_gc)
147 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
148 (dont_register_blocks) [GC_MALLOC_CHECK]:
149 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
150 (check_string_bytes, make_specified_string, memory_full)
151 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
152 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
153 (mark_stack, valid_pointer_p, make_pure_string)
154 (Fgarbage_collect, survives_gc_p, gc_sweep):
155 Use bool for booleans, instead of int.
156 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
157 Remove unused local.
158 * alloc.c (PURE_POINTER_P):
159 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
160 * editfns.c (Fformat):
161 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
162 (Fdo_auto_save):
163 * fns.c (sweep_weak_table):
164 * lisp.h (suppress_checking, push_message, survives_gc_p)
165 (make_pure_string, gc_in_progress, abort_on_gc):
166 * lread.c (readchar, read1):
167 * print.c (Fprin1_to_string):
168 * xdisp.c (push_message):
169 Use bool for booleans affected directly or indirectly by
170 alloc.c's changes.
171
172 Make recently-introduced setters macros.
173 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
174 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
175 (set_fontset_default, set_fontset_fallback): Rename from their
176 upper-case counterparts, and make them functions rather than macros.
177 This is more consistent with the other recently-introduced setters.
178 These don't need to be inline, since they're local.
179
180 2012-08-21 Jan Djärv <jan.h.d@swipnet.se>
181
182 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
183 the loop (Bug#12247).
184
185 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
186
187 * lisp.h (vcopy): Use memcpy rather than our own loop.
188 This fixes a performance regression introduced by the recent
189 addition of vcopy. This means 'vcopy' will need to be modified
190 for a copying collector, but that's OK. Also, tighten the
191 checking in the assertion.
192
193 2012-08-21 Eli Zaretskii <eliz@gnu.org>
194
195 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
196 components for RTL text (Bug#11860). Adjust X-OFFSET of each
197 non-base glyph for the width of the base character, according to
198 what x_draw_composite_glyph_string_foreground expects.
199 Generate WADJUST value according to composition_gstring_width's
200 expectations, to produce correct width of the composed character.
201 Reverse the sign of the DU offset produced by ScriptPlace.
202
203 2012-08-21 Paul Eggert <eggert@cs.ucla.edu>
204
205 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
206
207 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
208
209 Avoid direct writes to contents member of struct Lisp_Vector.
210 * lisp.h (vcopy): New function to copy data into vector.
211 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
212 * fns.c (Ffillarray): Use ASET.
213 * keyboard.c (timer_check_2): Use AREF and ASET.
214 (append_tool_bar_item, Frecent_keys): Use vcopy.
215 * lread.c (read_vector): Use ASET.
216 * msdos.c (Frecent_doskeys): Use vcopy.
217 * xface.c (Finternal_copy_lisp_face): Use vcopy.
218 (Finternal_merge_in_global_face): Use ASET and vcopy.
219 * xfont.c (xfont_list_pattern): Likewise.
220
221 2012-08-21 Martin Rudalics <rudalics@gmx.at>
222
223 * window.c (Fwindow_point): For the selected window always return
224 the position of its buffer's point.
225 (Fset_window_point): For the selected window always go in its
226 buffer to the specified position.
227
228 2012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
229
230 Setter macros for fontsets.
231 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
232 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
233 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
234 Adjust users.
235
236 2012-08-20 Glenn Morris <rgm@gnu.org>
237
238 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
239 Don't assume that `ln -f' works.
240
241 2012-08-20 Eli Zaretskii <eliz@gnu.org>
242
243 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
244 and later about non-assignments with no effect. See discussion at
245 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
246 details.
247
248 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
249
250 Inline setter functions for Lisp_Objects slots of struct specbinding.
251 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
252 Adjust users.
253
254 2012-08-20 Martin Rudalics <rudalics@gmx.at>
255
256 * window.c (select_window): Always make selected window's buffer
257 current.
258
259 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
260
261 Use AREF and ASET for docstrings of category tables.
262 * category.h (CATEGORY_DOCSTRING): Use AREF.
263 (SET_CATEGORY_DOCSTRING): Use ASET.
264 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
265
266 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
267
268 Inline setter functions for hash table members.
269 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
270 (set_hash_hash, set_hash_index): Rename with _slot suffix.
271 (set_hash_key_and_value, set_hash_index, set_hash_next)
272 (set_hash_hash): New functions.
273 * charset.c, fns.c: Adjust users.
274
275 2012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
276
277 Inline getter and setter functions for per-buffer values.
278 * buffer.h (per_buffer_default, set_per_buffer_default)
279 (per_buffer_value, set_per_buffer_value): New functions.
280 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
281 * buffer.c, data.c: Adjust users.
282
283 2012-08-20 Juanma Barranquero <lekktu@gmail.com>
284
285 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
286
287 2012-08-19 Paul Eggert <eggert@cs.ucla.edu>
288
289 Rely on <config.h> + <unistd.h> to declare 'environ',
290 as gnulib does this if the system doesn't.
291 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
292 Remove declaration. MS-Windows declares it on stdlib.h which is
293 included by conf_post.h.
294 * emacs.c (environ) [DOUG_LEA_MALLOC]:
295 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
296 * vm-limit.c: Include <unistd.h>, for 'environ'.
297
298 * unexaix.c, unexcoff.c: Include "mem-limits.h".
299 (start_of_data): Remove decl; mem-limits.h provides it.
300
301 * xdisp.c (handle_invisible_prop): Make it a bit faster
302 and avoid a gcc -Wmaybe-uninitialized diagnostic.
303
304 2012-08-19 Chong Yidong <cyd@gnu.org>
305
306 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
307 ends (Bug#3874).
308
309 2012-08-19 Andreas Schwab <schwab@linux-m68k.org>
310
311 * .gdbinit: Use call instead of set when calling a function in the
312 inferior.
313
314 * data.c (set_internal): Don't use set_blv_found.
315 (Fkill_local_variable): Likewise.
316
317 2012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
318
319 * nsfont.m (ns_ascii_average_width): Ensure the string
320 ascii_printable is initialized with a null-terminated character
321 array. Otherwise, it can contain undesired extra characters.
322
323 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
324
325 port new setting code to Sun C 5.8 2005/10/13
326 * chartab.c, lisp.h (char_table_set, char_table_set_range):
327 Return void, not Lisp_Object. Otherwise, the compiler
328 complains about (A?B:C) where B is void and C is Lisp_Object
329 when compiling CHAR_TABLE_SET, due to the recent change to
330 the API of sub_char_table_set_contents.
331
332 2012-08-18 Chong Yidong <cyd@gnu.org>
333
334 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
335 for the string case (Bug#3874).
336
337 2012-08-18 Paul Eggert <eggert@cs.ucla.edu>
338
339 * buffer.h (BSET): Remove (Bug#12215).
340 Replace all uses with calls to new setter functions.
341 (bset_bidi_paragraph_direction, bset_case_canon_table)
342 (bset_case_eqv_table, bset_directory, bset_display_count)
343 (bset_display_time, bset_downcase_table)
344 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
345 (bset_last_selected_window, bset_local_var_alist)
346 (bset_mark_active, bset_point_before_scroll, bset_read_only)
347 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
348 (bset_width_table):
349 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
350 (bset_auto_fill_function, bset_auto_save_file_format)
351 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
352 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
353 (bset_cache_long_line_scans, bset_case_fold_search)
354 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
355 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
356 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
357 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
358 (bset_header_line_format, bset_indicate_buffer_boundaries)
359 (bset_indicate_empty_lines, bset_invisibility_spec)
360 (bset_left_fringe_width, bset_major_mode, bset_mark)
361 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
362 (bset_name, bset_overwrite_mode, bset_pt_marker)
363 (bset_right_fringe_width, bset_save_length)
364 (bset_scroll_bar_width, bset_scroll_down_aggressively)
365 (bset_scroll_up_aggressively, bset_selective_display)
366 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
367 (bset_word_wrap, bset_zv_marker):
368 * category.c (bset_category_table):
369 * syntax.c (bset_syntax_table):
370 New setter functions.
371
372 * process.h (PSET): Remove (Bug#12215).
373 Replace all uses with calls to new setter functions.
374 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
375 (PROCESS_INLINE): New macro.
376 (pset_childp): New setter function.
377 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
378 * process.c (PROCESS_INLINE):
379 Define to EXTERN_INLINE, so that the corresponding functions
380 are compiled into code.
381 (pset_buffer, pset_command, pset_decode_coding_system)
382 (pset_decoding_buf, pset_encode_coding_system)
383 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
384 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
385 (pset_type, pset_write_queue): New setter functions.
386
387 * window.h (WSET): Remove (Bug#12215).
388 Replace all uses with calls to new setter functions.
389 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
390 (WINDOW_INLINE): New macro.
391 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
392 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
393 (wset_total_lines, wset_vertical_scroll_bar)
394 (wset_window_end_pos, wset_window_end_valid)
395 (wset_window_end_vpos): New setter functions.
396 * window.c (WINDOW_INLINE):
397 Define to EXTERN_INLINE, so that the corresponding functions
398 are compiled into code.
399 (wset_combination_limit, wset_dedicated, wset_display_table)
400 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
401 (wset_new_normal, wset_new_total, wset_next_buffers)
402 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
403 (wset_prev_buffers, wset_right_fringe_width)
404 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
405 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
406 (wset_window_parameters):
407 * xdisp.c (wset_base_line_number, wset_base_line_pos)
408 (wset_column_number_displayed, wset_region_showing):
409 New setter functions.
410
411 * termhooks.h (TSET): Remove (Bug#12215).
412 Replace all uses with calls to new setter functions.
413 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
414 (TERMHOOKS_INLINE): New macro.
415 (tset_charset_list, tset_selection_alist): New setter functions.
416 * terminal.c (TERMHOOKS_INLINE):
417 Define to EXTERN_INLINE, so that the corresponding functions
418 are compiled into code.
419 (tset_param_alist): New setter function.
420
421 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
422
423 * keyboard.h (KSET): Remove (Bug#12215).
424 Replace all uses with calls to new setter functions.
425 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
426 (KEYBOARD_INLINE): New macro.
427 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
428 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
429 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
430 New setter functions.
431 * keyboard.c (KEYBOARD_INLINE):
432 Define to EXTERN_INLINE, so that the corresponding functions
433 are compiled into code.
434 (kset_echo_string, kset_kbd_queue)
435 (kset_keyboard_translate_table, kset_last_prefix_arg)
436 (kset_last_repeatable_command, kset_local_function_key_map)
437 (kset_overriding_terminal_local_map, kset_real_last_command)
438 (kset_system_key_syms): New setter functions.
439
440 * frame.h (FSET): Remove (Bug#12215).
441 Replace all uses with calls to new setter functions.
442 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
443 (FRAME_INLINE): New macro.
444 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
445 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
446 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
447 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
448 (fset_param_alist, fset_root_window, fset_scroll_bars)
449 (fset_selected_window, fset_title, fset_tool_bar_items)
450 (fset_tool_bar_position, fset_tool_bar_window): New functions.
451 * frame.c (FRAME_INLINE):
452 Define to EXTERN_INLINE, so that the corresponding functions
453 are compiled into code.
454 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
455
456 A few more naming-convention fixes for getters and setters.
457 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
458 and rename from buffer_overlays_set_before.
459 (set_buffer_overlays_after): Move here from buffer.h, and rename
460 from buffer_overlays_set_after.
461 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
462 All uses changed.
463 (set_buffer_intervals): Rename from buffer_set_intervals.
464 * intervals.c (set_interval_object): Move here from intervals.h,
465 and rename from interval_set_object.
466 (set_interval_left): Move here from intervals.h, and rename from
467 interval_set_left.
468 (set_interval_right): Move here from intervals.h, and rename from
469 interval_set_right.
470 (copy_interval_parent): Move here from intervals.h, and rename from
471 interval_copy_parent.
472 * intervals.h (set_interval_parent): Rename from interval_set_parent.
473 (set_interval_plist): Rename from interval_set_plist.
474 Return void, not Lisp_Object, since no caller uses the result.
475 * lisp.h (string_intervals): Rename from string_get_intervals.
476 (set_string_intervals): Rename from string_set_intervals.
477
478 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
479 (set_char_table_contents): Rename from char_table_set_contents.
480 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
481 All uses changed. See the end of
482 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
483
484 * lisp.h (CSET): Remove (Bug#12215).
485 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
486 (set_char_table_purpose): New functions,
487 replacing CSET. All uses changed. For example, replace
488 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
489 "set_char_table_parent (char_table, parent);".
490 The old version was confusing because it used the same name
491 'parent' for two different things.
492
493 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
494
495 Functions to get and set Lisp_Object fields of buffer-local variables.
496 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
497 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
498 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
499 * data.c, eval.c, frame.c: Adjust users.
500
501 2012-08-17 Chong Yidong <cyd@gnu.org>
502
503 * xfaces.c (merge_face_vectors): If the target font specfies a
504 font spec, make the font's attributes take precedence over
505 directly-specified attributes.
506 (merge_face_ref): Recognize :font.
507
508 2012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
509
510 Do not use memcpy for copying intervals.
511 * intervals.c (reproduce_interval): New function.
512 (reproduce_tree, reproduce_tree_obj): Use it.
513 (reproduce_tree_obj): Remove prototype.
514
515 2012-08-17 Paul Eggert <eggert@cs.ucla.edu>
516
517 * lisp.h (duration_to_sec_usec): Remove unused decl.
518
519 2012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
520
521 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
522 to an allocated instance of NSString, not to the class itself.
523
524 2012-08-17 Juanma Barranquero <lekktu@gmail.com>
525
526 * makefile.w32-in (C_CTYPE_H): New macro.
527 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
528 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
529 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
530
531 2012-08-16 Paul Eggert <eggert@cs.ucla.edu>
532
533 Use ASCII tests for character types.
534 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
535 * xfns.c, xterm.c:
536 Don't include <ctype.h>; was not needed.
537 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
538 * sysdep.c, xfaces.c:
539 Include <c-ctype.h> instead of <ctype.h>.
540 * nsterm.m: Include <c-ctype.h>.
541 * charset.c (read_hex):
542 * doc.c (Fsnarf_documentation):
543 * fileio.c (IS_DRIVE) [WINDOWSNT]:
544 (DRIVE_LETTER) [DOS_NT]:
545 (Ffile_name_directory, Fexpand_file_name)
546 (Fsubstitute_in_file_name):
547 * font.c (font_parse_xlfd, font_parse_fcname):
548 * frame.c (x_set_font_backend):
549 * gtkutil.c (xg_get_font):
550 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
551 * nsimage.m (hexchar):
552 * nsterm.m (ns_xlfd_to_fontname):
553 * sysdep.c (system_process_attributes):
554 * xfaces.c (hash_string_case_insensitive):
555 Use C-locale tests instead of locale-specific tests for character
556 types, since we want the ASCII interpretation here, not the
557 interpretation suitable for whatever happens to be the current locale.
558
559 2012-08-16 Martin Rudalics <rudalics@gmx.at>
560
561 Consistently check windows for validity/liveness
562 (Bug#11984, Bug#12025, Bug#12026).
563 * lisp.h (CHECK_VALID_WINDOW): New macro.
564 * window.c (decode_window): Rename to decode_live_window.
565 (decode_valid_window, Fwindow_valid_p): New functions.
566 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
567 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
568 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
569 (Fwindow_prev_sibling, Fwindow_combination_limit)
570 (Fset_window_combination_limit, Fwindow_use_time)
571 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
572 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
573 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
574 (Fwindow_hscroll, Fset_window_hscroll)
575 (Fwindow_redisplay_end_trigger)
576 (Fset_window_redisplay_end_trigger, Fwindow_edges)
577 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
578 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
579 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
580 (Fwindow_end, Fset_window_point, Fset_window_start)
581 (Fpos_visible_in_window_p, Fwindow_line_height)
582 (Fwindow_dedicated_p, Fset_window_dedicated_p)
583 (Fwindow_prev_buffers, Fset_window_prev_buffers)
584 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
585 (Fset_window_parameter, Fwindow_display_table)
586 (Fset_window_display_table, Fdelete_other_windows_internal)
587 (Fset_window_buffer, Fset_window_new_total)
588 (Fset_window_new_normal, Fdelete_window_internal)
589 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
590 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
591 (Fwindow_scroll_bars): Check whether argument window is a valid or
592 live window. Update doc-strings.
593 (syms_of_window): New symbol Qwindow_valid_p.
594 * keyboard.c (Fposn_at_x_y): Check whether argument
595 frame_or_window denotes a valid window.
596
597 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
598
599 Fix previous char table change.
600 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
601 * chartab.c (optimize_sub_char_table): Likewise.
602
603 2012-08-16 Chong Yidong <cyd@gnu.org>
604
605 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
606
607 * xfont.c (xfont_open):
608 * xftfont.c (xftfont_open): Set the font's max_width field.
609
610 * nsfont.m (nsfont_open): Similar to the Xft backend, set
611 min_width to space_width and average_width to the average over
612 printable ASCII characters.
613 (ns_char_width): Code cleanup.
614 (ns_ascii_average_width): New utility function.
615
616 * font.h (struct font): Update comments.
617
618 2012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
619
620 Simple interface to set Lisp_Object fields of character tables.
621 * lisp.h (CSET): New macro.
622 (char_table_set_extras, char_table_set_contents)
623 (sub_char_table_set_contents): New function.
624 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
625 * syntax.c: Adjust users.
626
627 2012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
628
629 * eval.c (eval_sub): Bind lexical-binding.
630 * lread.c (Qlexical_binding): Make non-static.
631
632 2012-08-15 Jan Djärv <jan.h.d@swipnet.se>
633
634 * nsmenu.m (popupSession): Remove.
635 (pop_down_menu): Remove endModalSession.
636 (timeout_handler:): New method.
637 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
638 Call runModalForWindow. Check timer_fired when it returns.
639 If not set, cancel timer and break out of loop.
640 Otherwise loop again, with a new timeout.
641
642 * nsterm.m: Include fcntl.h if present.
643 (fd_entry, t_readfds, inNsSelect): Remove.
644 (select_writefds, select_valid, select_timeout, selfds)
645 (select_mutex, apploopnr): Add.
646 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
647 Otherwise call kbd_buffer_store_event.
648 (ns_send_appdefined): Remove release of fd_entry.
649 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
650 Increment and decrement apploopnr.
651 (ns_select): If no file descriptors, just do a NSTimer.
652 Otherwise copy read/write masks and start select thread (fd_handler).
653 Start main loop and wait for application defined event.
654 Inform select thread to stop selecting after main loop is exited.
655 (ns_term_init): Create selfds pipe and set non-blocking.
656 Initialize select_mutex. Start the select thread (fd_handler).
657 (fd_handler:): Loop forever, wait for info from the main thread
658 to either start or stop selecting. When select returns, send
659 and appdefined event.
660 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
661 If not call kbd_buffer_store_event.
662
663 * nsterm.h (EmacsApp): fd_handler takes id argument.
664 (EmacsDialogPanel): Add timer_fired and timeout_handler.
665
666 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
667
668 2012-08-15 Eli Zaretskii <eliz@gnu.org>
669
670 * region-cache.c (move_cache_gap): Update gap_len using the actual
671 growth of the boundaries array. Do not change cache_len.
672 (Bug#12196)
673
674 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
675
676 Generalize and cleanup font subsystem checks.
677 * font.h (FONT_DEBUG, font_assert): Remove.
678 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
679 Change font_assert to eassert. Use eassert where appropriate.
680
681 2012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
682
683 * gtkutil.c (xg_get_font): Use pango_units_to_double.
684
685 2012-08-15 Chong Yidong <cyd@gnu.org>
686
687 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
688 When using the new font chooser, use gtk_font_chooser_get_font_desc to
689 extract the font descriptor instead of just the font name.
690 In that case, return a font spec instead of a string.
691 (x_last_font_name): Move to this file from xfns.c.
692
693 * xfns.c (Fx_select_font): The return value can also be a font
694 spec. Move x_last_font_name management to gtkutil.c.
695
696 * xfaces.c: Make font weight and style symbols non-static.
697
698 2012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
699
700 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
701 (bug#12117).
702
703 2012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
704
705 * alloc.c (Fgarbage_collect): Use plural form consistently.
706
707 2012-08-14 Eli Zaretskii <eliz@gnu.org>
708
709 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
710 iteration through the command loop. Fixes a problem whereby mouse
711 movements are ignored until the first mouse click.
712
713 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
714
715 Use bool, not int, for Lisp booleans.
716 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
717 makes Emacs a bit smaller and presumably a bit faster.
718 * lisp.h: Include <stdbool.h>.
719 (struct Lisp_Boolfwd, defvar_bool):
720 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
721 * regex.c [!emacs]: Include <stdbool.h>.
722 (false, true): Remove; <stdbool.h> does this for us now.
723
724 2012-08-14 Chong Yidong <cyd@gnu.org>
725
726 * character.c (Fcharacterp): Doc fix (Bug#12076).
727
728 * data.c (Findirect_variable): Doc fix (Bug#11040).
729
730 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
731
732 * editfns.c (Fformat): Doc fix (Bug#12059).
733 (Fsave_current_buffer): Doc fix (Bug#11542).
734
735 2012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
736
737 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
738 (bug#12022).
739
740 2012-08-14 Martin Rudalics <rudalics@gmx.at>
741
742 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
743 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
744 * minibuf.c (choose_minibuf_frame, read_minibuf):
745 * w32fns.c (x_create_tip_frame):
746 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
747 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
748
749 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
750
751 * intervals.c (offset_intervals): Remove obsolete comment.
752
753 2012-08-14 Andreas Schwab <schwab@linux-m68k.org>
754
755 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
756
757 2012-08-14 Gergely Risko <gergely@risko.hu>
758
759 * coding.c (decode_coding): Record buffer modification before
760 disabling undo_list (Bug#11773).
761
762 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
763
764 Revert and cleanup some recent overlay changes.
765 * buffer.h (enum overlay_type): Remove.
766 (buffer_get_overlays, buffer_set_overlays): Likewise.
767 (buffer_set_overlays_before, buffer_set_overlays_after):
768 New function. Adjust users.
769 (unchain_both): Add eassert.
770
771 2012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
772
773 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
774
775 2012-08-14 Paul Eggert <eggert@cs.ucla.edu>
776
777 * gtkutil.c (xg_mark_data): Don't assume C99.
778
779 2012-08-13 Jan Djärv <jan.h.d@swipnet.se>
780
781 * gtkutil.c (xg_frame_tb_info): New struct.
782 (TB_INFO_KEY): New define.
783 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
784 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
785 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
786 if not present.
787 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
788 is up to date. Otherwise store new data.
789 (free_frame_tool_bar): Free xg_frame_tb_info if present.
790
791 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
792
793 Use KSET for write access to Lisp_Object members of struct kboard.
794 * keyboard.h (KSET): New macro.
795 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
796 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
797 * xterm.c: Adjust users.
798
799 2012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
800
801 Use BSET for write access to Lisp_Object members of struct buffer.
802 * buffer.h (BSET): New macro.
803 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
804 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
805 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
806 * window.c, xdisp.c, xfns.c: Adjust users.
807
808 2012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
809
810 * lread.c (syms_of_lread): Initialize Vlexical_binding.
811
812 2012-08-11 Jan Djärv <jan.h.d@swipnet.se>
813
814 * nsterm.m (not_in_argv): New function.
815 (application:openFile, application:openTempFile:):
816 (application:openFileWithoutUI:, application:openFiles:): Open file
817 if not_in_argv returns non-zero (bug#12171).
818
819 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
820 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
821 Define for Gtk+ versions less than 3.2.
822 (xg_get_font_name): Use those functions/macros here.
823 Reported by Frans Oilinki <moilinki@gmail.com>.
824
825 2012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
826
827 * unexmacosx.c (copy_data_segment): Copy initialized data in
828 statically linked libraries from input file rather than memory.
829
830 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
831 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
832 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
833
834 2012-08-10 Glenn Morris <rgm@gnu.org>
835
836 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
837 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
838
839 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
840
841 Fix last change to allow compilation with low optimization levels.
842 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
843 Reported by Jan Djärv <jan.h.d@swipnet.se>.
844
845 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
846
847 Use common inline syntax in intervals.h.
848 * intervals.h (INTERVALS_INLINE): New macro.
849 Change all users from LISP_INLINE.
850
851 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
852
853 Define Qnone once for all platforms.
854 * frame.c (Qnone): Define here.
855 (syms_of_frame): DEFSYM it.
856 * lisp.h (Qnone): New declaration.
857 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
858 * xfns.c: Remove duplication. Adjust users.
859
860 2012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
861
862 Remove unused macros from intervals.h.
863 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
864 * intervals.c: Adjust comment.
865
866 2012-08-10 Eli Zaretskii <eliz@gnu.org>
867
868 * w32fns.c <w32_unicode_gui>: New static variable.
869 (globals_of_w32fns): Initialize it according to os_subtype.
870 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
871 testing os_subtype.
872
873 2012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
874 Eli Zaretskii <eliz@gnu.org>
875
876 Fix bug #10299 with Unicode characters sent by customized
877 keyboards created by MSKLC.
878 * w32fns.c (INIT_WINDOW_CLASS): New macro.
879 (w32_init_class): Use it to initialize the Emacs class with either
880 ANSI or Unicode API calls.
881 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
882 later.
883 (w32_wnd_proc): If the character code sent by WM_CHAR or
884 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
885 original message. Call DefWindowProcW on NT and later.
886
887 2012-08-10 Glenn Morris <rgm@gnu.org>
888
889 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
890
891 * lisp.h (DIRECTORY_SEP): Let configure set it.
892
893 2012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
894
895 Use TSET for write access to Lisp_Object slots of struct terminal.
896 * termhooks.h (TSET): New macro.
897 * coding.c, terminal.c, xselect.c: Adjust users.
898
899 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
900
901 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
902 the failing expression, include them in the error message.
903 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
904 * lisp.h (internal_condition_case_n): Update declaration.
905
906 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
907
908 Inline functions to examine and change buffer overlays.
909 * buffer.c (unchain_both): New function.
910 * buffer.h (buffer_get_overlays, buffer_set_overlays):
911 (buffer_has_overlays): New function.
912 (enum overlay_type): New enum.
913 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
914 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
915
916 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
917
918 Inline functions to examine and change buffer intervals.
919 * alloc.c (mark_interval_tree): Remove.
920 (MARK_INTERVAL_TREE): Simplify.
921 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
922 * intervals.c (buffer_balance_intervals): New function.
923 (graft_intervals_into_buffer): Adjust indentation.
924 (set_intervals_multibyte): Simplify.
925 * buffer.h (BUF_INTERVALS): Remove.
926 (buffer_get_intervals, buffer_set_intervals): New function.
927 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
928 * intervals.c, textprop.c: Adjust users.
929
930 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
931
932 Inline functions to examine and change string intervals.
933 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
934 (string_get_intervals, string_set_intervals): New function.
935 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
936 * lread.c, print.c, textprop.c: Adjust users.
937
938 2012-08-08 Glenn Morris <rgm@gnu.org>
939
940 * lisp.mk (lisp): Remove language/persian.elc.
941
942 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
943
944 Cleanup intervals.
945 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
946 (NULL_INTERVAL_P): Likewise. Adjust users.
947 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
948 Adjust comment. Move under #if 0.
949 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
950 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
951
952 2012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
953
954 Check total length of intervals with eassert.
955 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
956 * intervals.c: Change all users to eassert.
957
958 2012-08-07 Eli Zaretskii <eliz@gnu.org>
959
960 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
961 Rename fields to match removal of FGET and WGET and disuse of
962 INTERNAL_FIELD in Lisp_Cons.
963
964 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
965
966 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
967 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
968 name since all xname users are fixed long time ago. Do not
969 use INTERNAL_FIELD.
970 (set_symbol_name, set_symbol_function, set_symbol_plist):
971 (set_symbol_next, set_overlay_plist): New function.
972 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
973 (struct Lisp_Overlay): Likewise.
974 (CVAR, MVAR, SVAR): Remove.
975 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
976 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
977 * xterm.c: Adjust users.
978 * .gdbinit: Change to use name field of struct Lisp_Symbol
979 where appropriate.
980
981 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
982
983 Basic functions to set Lisp_Object and pointer slots of intervals.
984 * intervals.h (interval_set_parent, interval_set_object):
985 (interval_set_left, interval_set_right, interval_set_plist):
986 (interval_copy_parent): New function.
987 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
988 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
989 Adjust indentation.
990 (INTERVAL_SIZE): Remove. Adjust users.
991 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
992
993 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
994
995 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
996 * process.h (PGET): Remove.
997 (struct Lisp_Process): Do not use INTERNAL_FIELD.
998 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
999
1000 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1001
1002 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1003 * window.h (WGET): Remove.
1004 (struct window): Do not use INTERNAL_FIELD.
1005 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1006 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1007 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1008 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1009 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1010 Adjust users.
1011
1012 2012-08-07 Chong Yidong <cyd@gnu.org>
1013
1014 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1015 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1016 (Fdelete_window_internal): Signal an error if the window is not on
1017 a live frame (Bug#12025).
1018
1019 2012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1020
1021 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1022 * frame.h (FGET): Remove.
1023 (struct frame): Do not use INTERNAL_FIELD.
1024 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1025 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1026 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1027 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1028
1029 2012-08-06 Juanma Barranquero <lekktu@gmail.com>
1030
1031 * w32.c: Silence compiler warnings.
1032 (map_w32_filename): Remove unused variable `is_fat'.
1033 (chase_symlinks): Add parentheses around expression.
1034
1035 2012-08-06 Glenn Morris <rgm@gnu.org>
1036
1037 * sysdep.c: Respect BROKEN_GETWD.
1038
1039 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1040 Let configure handle it.
1041 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1042
1043 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1044
1045 Use GCALIGNMENT where appropriate.
1046 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1047 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1048 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1049
1050 2012-08-06 Eli Zaretskii <eliz@gnu.org>
1051
1052 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1053 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
1054
1055 2012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1056
1057 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1058 that should be sufficient for everyone.
1059
1060 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1061
1062 * keyboard.c (timer_check_2): Add break so timer_check returns next
1063 timeout.
1064
1065 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1066
1067 Fix Windows build errors introduced after converting to WGET and WSET.
1068 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1069 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1070
1071 2012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1072
1073 * nsterm.m (ns_frame_rehighlight): Use FSET.
1074
1075 * nsmenu.m (ns_update_menubar): Use FSET.
1076
1077 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1078
1079 Separate read and write access to Lisp_Object slots of Lisp_Process.
1080 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1081 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1082
1083 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1084
1085 Separate read and write access to Lisp_Object slots of struct window.
1086 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1087 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1088 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1089 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1090 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1091 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1092 Adjust users.
1093
1094 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1095
1096 Fix Windows build errors introduced after converting to FGET and FSET.
1097 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1098 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1099 (w32_judge_scroll_bars): Change to use FSET.
1100 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1101
1102 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1103
1104 Fix replacement typo.
1105 * window.c (replace_window): Set root_window instead of
1106 selected_window. This fixes a total window subsystem
1107 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1108
1109 2012-08-06 Glenn Morris <rgm@gnu.org>
1110
1111 * lisp.mk (lisp): Add language/persian.elc.
1112
1113 2012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1114
1115 Separate read and write access to Lisp_Object slots of struct frame.
1116 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1117 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1118 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1119 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1120 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1121
1122 2012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1123
1124 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1125
1126 2012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1127
1128 Generalize common compile-time constants.
1129 * lisp.h (header_size, bool_header_size, word_size): Now here.
1130 (struct Lisp_Vector): Add comment.
1131 (struct Lisp_Bool_Vector): Move up to define handy constants.
1132 (VECSIZE, PSEUDOVECSIZE): Simplify.
1133 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1134 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1135 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1136 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1137 * xfont.c, xmenu.c: Use word_size where appropriate.
1138
1139 2012-08-05 Lawrence Mitchell <wence@gmx.li>
1140
1141 * search.c (Freplace_match): Treat \? in the replacement text
1142 literally (Bug#8161).
1143
1144 2012-08-05 Chong Yidong <cyd@gnu.org>
1145
1146 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1147 * frame.c (Vdelete_frame_functions):
1148 * emacs.c (Vkill_emacs_hook): Doc fix.
1149
1150 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1151
1152 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1153 --with-x-toolkit=no builds.
1154 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1155
1156 2012-08-04 Chong Yidong <cyd@gnu.org>
1157
1158 * syntax.c (Fmodify_syntax_entry): Doc fix.
1159
1160 2012-08-04 Eli Zaretskii <eliz@gnu.org>
1161
1162 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1163 * w32.c (init_environment): Change the default values of many
1164 environment variables in dflt_envvars[] to NULL, to avoid pushing
1165 them into environment when they were not already defined.
1166 Remove the code that deletes site-lisp subdirectories from the default
1167 value of EMACSLOADPATH, as it is no longer needed.
1168 (check_windows_init_file): Now external, not static.
1169 Use Vload_path as is, without adding anything, as this function is now
1170 called when Vload_path is already set up.
1171
1172 * w32.h (check_windows_init_file): Add prototype.
1173
1174 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1175 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1176 compatibility with Posix platforms.
1177 (main): Move the call to check_windows_init_file to here from
1178 w32.c.
1179 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1180 any, in the DEFALT argument into the root of the Emacs build or
1181 installation tree, as appropriate.
1182
1183 * callproc.c (init_callproc_1): Call decode_env_path instead of
1184 doing its equivalent by hand.
1185 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1186 the code that sets Vexec_path run on MS-Windows.
1187
1188 * lread.c (init_lread): Add comments to #ifdef's.
1189
1190 * msdos.c (dos_set_window_size, IT_update_begin)
1191 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1192 instead of direct references.
1193
1194 2012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1195
1196 Export DEFAULT_REHASH_* to GDB.
1197 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1198 Now constants, not macros.
1199
1200 2012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1201
1202 Remove unnecessary casts involving pointers.
1203 These casts are no longer needed now that we assume C89 or later,
1204 since they involve casting to or from void *.
1205 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1206 (make_pure_float, make_pure_vector):
1207 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1208 * macros.c (Fstart_kbd_macro):
1209 * menu.c (find_and_return_menu_selection):
1210 * minibuf.c (read_minibuf_noninteractive):
1211 * sysdep.c (closedir):
1212 * xdisp.c (x_produce_glyphs):
1213 * xfaces.c (compare_fonts_by_sort_order):
1214 * xfns.c (x_real_positions, select_visual):
1215 * xselect.c (x_stop_queuing_selection_requests)
1216 (x_get_window_property, x_get_window_property_as_lisp_data):
1217 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1218 Remove unnecessary pointer casts.
1219 * alloc.c (record_xmalloc): New function.
1220 * lisp.h (record_xmalloc): New decl.
1221 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1222 more like a function. This is because the pointer cast is not
1223 needed. All uses changed.
1224 * print.c (print_string, print_error_message): Avoid length recalc.
1225
1226 Improve fix for macroexp crash with debugging (Bug#12118).
1227 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1228 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1229 not supposed to be invoked from the garbage collector.
1230 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1231 (gc_aset): New function, which is like ASET but can be
1232 used in the garbage collector.
1233 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1234 (set_hash_index): Use it instead of ASET.
1235
1236 2012-08-03 Eli Zaretskii <eliz@gnu.org>
1237
1238 Support symlinks on latest versions of MS-Windows.
1239 * w32.c: Include winioctl.h and aclapi.h.
1240 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1241 (revert_to_self): Forward declarations of static functions.
1242 <static BOOL g_b_init_get_security_info>:
1243 <g_b_init_create_symbolic_link>: New static flags.
1244 (globals_of_w32): Initialize them to zero.
1245 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1246 (map_w32_filename): Improve commentary. Simplify switch.
1247 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1248 headers (most versions of MinGW w32api don't).
1249 (get_security_info, create_symbolic_link)
1250 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1251 New functions.
1252 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1253 in the argument file name.
1254 (sys_access): Call unc_volume_file_attributes only if
1255 GetFileAttributes fails with network-related error codes.
1256 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1257 have the required privileges.
1258 (get_file_security_desc_by_name): Rename from
1259 get_file_security_desc.
1260 (stat_worker): New function, with most of the guts of 'stat', and
1261 with addition of handling of symlinks and support for 'lstat'.
1262 If possible, get file's attributes and security information by
1263 handle, not by name. Produce S_IFLNK bit for symlinks, when
1264 called from 'lstat'.
1265 (stat, lstat): New functions, call 'stat_worker'.
1266 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1267 symlinks when the underlying filesystem supports them.
1268
1269 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1270
1271 Fix macroexp crash on Windows with debugging (Bug#12118).
1272 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1273 checking subscripts; problem introduced with the recent
1274 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1275 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1276 since it's used in non-static inline functions now.
1277
1278 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1279 Don't assume buffer size fits in 'int'. Remove unused local.
1280
1281 Use C99-style 'extern inline' if available.
1282 * buffer.h (BUFFER_INLINE):
1283 * category.h (CATEGORY_INLINE):
1284 * character.h (CHARACTER_INLINE):
1285 * charset.h (CHARSET_INLINE):
1286 * composite.h (COMPOSITE_INLINE):
1287 * dispextern.h (DISPEXTERN_INLINE):
1288 * lisp.h (LISP_INLINE):
1289 * systime.h (SYSTIME_INLINE):
1290 New macro, replacing 'static inline' in this header.
1291 * buffer.h, category.h, character.h, charset.h, composite.h:
1292 * dispextern.h, lisp.h, systime.h:
1293 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1294 * alloc.c (LISP_INLINE):
1295 * buffer.c (BUFFER_INLINE):
1296 * category.c (CATEGORY_INLINE):
1297 * character.c (CHARACTER_INLINE):
1298 * charset.c (CHARSET_INLINE):
1299 * composite.c (COMPOSITE_INLINE):
1300 * dispnew.c (DISPEXTERN_INLINE):
1301 * sysdep.c (SYSTIME_INLINE):
1302 Define to EXTERN_INLINE, so that the corresponding functions
1303 are compiled into code.
1304 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1305 (INLINE_HEADER_END): New macros.
1306 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1307 since it's used in non-static inline functions now.
1308 (VALMASK) [!USE_LSB_TAG]: Likewise.
1309
1310 2012-08-02 Glenn Morris <rgm@gnu.org>
1311
1312 * s/: Remove empty directory.
1313
1314 * s/ms-w32.h: Move to ../nt/inc.
1315 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1316 Update for new ms-w32.h location.
1317
1318 2012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1319
1320 Port to Solaris 8.
1321 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1322
1323 2012-08-02 Glenn Morris <rgm@gnu.org>
1324
1325 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1326 hard-coding the path separator.
1327
1328 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1329
1330 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1331 This how ASET and AREF are supposed to work, and makes
1332 it easier to think about future improvements. See
1333 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1334 * charset.h (set_charset_attr): New function.
1335 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1336 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1337 (aref_addr): New function. All uses of &AREF(...) changed.
1338 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1339 (set_hash_index): New functions. All lvalue-style uses of
1340 HASH_KEY etc. changed.
1341 * keyboard.c (set_prop): New function. All lvalue-style uses
1342 of PROP changed.
1343
1344 2012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1345
1346 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1347 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1348 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1349 * nsfns.m (ns_set_name_as_filename): Likewise.
1350 * nsmenu.m (ns_update_menubar): Likewise.
1351 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1352
1353 2012-08-01 Eli Zaretskii <eliz@gnu.org>
1354
1355 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1356 Adapt to latest changes in field names of the corresponding Lisp
1357 objects.
1358
1359 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1360
1361 2012-08-01 Glenn Morris <rgm@gnu.org>
1362
1363 * s/msdos.h: Remove file.
1364 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1365 * Makefile.in (S_FILE): Remove.
1366 (config_h): Remove S_FILE.
1367
1368 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1369
1370 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1371 Remove; moved to nt/config.nt.
1372
1373 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1374
1375 Use INTERNAL_FIELD for conses and overlays.
1376 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1377 Remove obsolete comment.
1378 (MVAR): New macro.
1379 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1380 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1381
1382 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1383
1384 Use INTERNAL_FIELD for symbols.
1385 * lisp.h (SVAR): New macro. Adjust users.
1386 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1387 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1388
1389 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1390
1391 Use INTERNAL_FIELD for processes.
1392 * process.h (PVAR): New macro. Adjust style.
1393 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1394 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1395
1396 2012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1397
1398 Use INTERNAL_FIELD for windows.
1399 * window.h (WVAR): New macro.
1400 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1401 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1402 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1403 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1404 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1405 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1406
1407 2012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1408
1409 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1410
1411 2012-08-01 Glenn Morris <rgm@gnu.org>
1412
1413 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1414 Move to configure.ac.
1415
1416 2012-08-01 Juanma Barranquero <lekktu@gmail.com>
1417
1418 * makefile.w32-in (CONFIG_H): Update dependencies.
1419 (CONF_POST_H): New macro.
1420
1421 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1422
1423 2012-07-31 Glenn Morris <rgm@gnu.org>
1424
1425 * Makefile.in (S_FILE): No longer set by configure.
1426
1427 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1428 is available.
1429 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1430
1431 * process.h (NULL_DEVICE):
1432 * emacs.c (SEPCHAR):
1433 * editfns.c (USER_FULL_NAME): Let configure set them.
1434
1435 * s/README, s/template.h: Remove files.
1436
1437 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1438
1439 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1440 Move to configure.ac.
1441
1442 2012-07-31 Eli Zaretskii <eliz@gnu.org>
1443
1444 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1445 resulting renaming of 'struct frame' members.
1446
1447 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1448
1449 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1450 after introduction of FVAR.
1451
1452 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1453
1454 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1455
1456 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1457 instead of compositeToPoint.
1458 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1459
1460 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
1461
1462 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1463
1464 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1465 * lisp.h (INTERNAL_FIELD): New macro.
1466 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
1467 (BVAR): Change to use INTERNAL_FIELD.
1468 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1469 (KVAR): Change to use INTERNAL_FIELD.
1470 * frame.h (FVAR): New macro.
1471 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
1472 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1473 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1474 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1475 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1476
1477 2012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1478
1479 Miscellaneous fixes for non-default X toolkits.
1480 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1481 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1482 Move under #ifdef USE_LUCID.
1483 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1484 definition and usage to avoid warnings.
1485
1486 2012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1487
1488 * nsterm.m (openFiles): Fix previous checkin.
1489
1490 2012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1491
1492 * indent.c (compute_motion): Remove unused local.
1493
1494 2012-07-31 Glenn Morris <rgm@gnu.org>
1495
1496 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1497
1498 * conf_post.h [USG5_4]:
1499 Move remaining contents of s/usg5-4-common.h here.
1500 * s/usg5-4-common.h: Remove file.
1501
1502 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1503 * s/irix6-5.h: Remove file.
1504
1505 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1506 * s/darwin.h: Remove file.
1507
1508 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1509 * s/hpux10-20.h: Remove file, which is now empty.
1510
1511 2012-07-30 Glenn Morris <rgm@gnu.org>
1512
1513 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1514 * Makefile.in (config_h): Add conf_post.h.
1515 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1516
1517 2012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1518
1519 * nsterm.m (ns_do_open_file): New variable.
1520 (ns_term_init): Set ns_do_open_file to YES after run returns.
1521 (openFile, openTempFile, openFileWithoutUI, openFiles):
1522 Open files only if ns_do_open_file.
1523
1524 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1525
1526 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1527 This no-op macro hasn't been needed for many years.
1528 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1529
1530 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1531 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1532 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1533 gdb_make_enums_visible.
1534 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1535 (DIRECTORY_SEP): Now a constant, not a macro.
1536
1537 2012-07-30 Eli Zaretskii <eliz@gnu.org>
1538
1539 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1540 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1541
1542 * w32term.c <w32_keyboard_codepage>: Renamed from
1543 keyboard_codepage and now external. All users changed.
1544
1545 * w32term.h: Add declaration of w32_keyboard_codepage.
1546
1547 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1548 the codepage to translate keys to Unicode. If this argument is
1549 -1, use the value returned by GetConsoleCP. All callers changed.
1550
1551 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1552
1553 Update .PHONY listings in makefiles.
1554 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1555 bootstrap-clean, distclean, maintainer-clean, versioclean,
1556 extraclean, frc.
1557
1558 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1559 This is a bit clearer. Fix some commentary typos.
1560
1561 2012-07-30 Glenn Morris <rgm@gnu.org>
1562
1563 * s/netbsd.h: Let configure include signal.h if needed.
1564 Remove file, which is now empty.
1565
1566 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1567 Let configure set them.
1568 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1569 No more need to undefine.
1570
1571 2012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1572
1573 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1574 non-single-byte char when adding meta modifier. (Bug#12090)
1575
1576 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1577
1578 Convert safe_call to use variable number of arguments.
1579 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1580 (safe_call2): Fix comment.
1581 * lisp.h (safe_call): Adjust prototype.
1582 * coding.c (encode_coding_object): Change to use safe_call2.
1583 * xfaces.c (merge_face_heights): Change to use safe_call1.
1584
1585 2012-07-30 Glenn Morris <rgm@gnu.org>
1586
1587 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
1588 does that unconditionally. Remove file, which is now empty.
1589
1590 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1591 Remove empty files.
1592
1593 2012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1594
1595 Export to GDB most of lisp.h's remaining object-like macros.
1596 * lisp.h (min, max): Move earlier, because they're used earlier now.
1597 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1598 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1599 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1600 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1601 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1602 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1603 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1604 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1605 Now constants, for GDB. They need not be macros.
1606 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1607 Now constants, for GDB, as well as macros, for static initializers.
1608 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1609 Move to after the definition of struct Lisp_Char_Table,
1610 since the former now needs that type defined.
1611 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1612 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1613 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1614 New enums, for gdb_make_enums_visible.
1615 (GLYPH_MODE_LINE_FACE): Remove; unused.
1616 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
1617 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1618 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1619 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1620 enum maxargs, enum MAX_ALLOCA.
1621 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1622 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1623 no longer needed, now that they are done in lisp.h.
1624
1625 2012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1626
1627 Cleanup string bytes checking.
1628 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1629 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1630 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1631 (check_sblock, compact_small_strings): Simplify.
1632
1633 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1634
1635 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1636 These macros are confusing and no longer need to be defined, as
1637 the enum values now suffice. All uses replaced with definiens.
1638 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1639
1640 2012-07-29 Juanma Barranquero <lekktu@gmail.com>
1641
1642 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1643 ($(BLD)/w32console.$(O)): Update dependencies.
1644
1645 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1646
1647 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1648 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1649 time. Adjust users.
1650 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1651
1652 2012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1653
1654 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1655 setting sitelisp (Bug#12010).
1656
1657 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1658
1659 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
1660
1661 * w32heap.c (cache_system_info):
1662 * w32.c (sys_rename):
1663 * w32proc.c (find_child_console, sys_kill): All users changed.
1664
1665 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1668
1669 2012-07-29 Eli Zaretskii <eliz@gnu.org>
1670
1671 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1672
1673 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1674
1675 Cleanup statistics calculation in Fgarbage_collect.
1676 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1677 Fix zombies percentage calculation. Simplify elapsed time calculation.
1678
1679 2012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1680
1681 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1682 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1683 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1684 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1685 (replace_range, replace_range_2, del_range_2): Change to eassert.
1686 * marker.c (byte_char_debug_check): Adjust style.
1687
1688 2012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1689
1690 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1691 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1692 long-ago-commented-out code that talks about "WIN32".
1693 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1694 All uses changed.
1695
1696 2012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1697
1698 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1699 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1700 Simplify by using alignof.
1701 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1702 * lisp.h: Include <stdalign.h>.
1703 (GCALIGNMENT): New macro and constant.
1704 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1705 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1706 (stdalign): New macro, if not already defined.
1707
1708 2012-07-28 Eli Zaretskii <eliz@gnu.org>
1709
1710 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1711 * w32inevt.c: Include w32inevt.h.
1712 (w32_read_console_input): New inline function, calls either
1713 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1714 w32_console_unicode_input.
1715 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1716 (w32_kbd_patch_key, key_event): Use the codepage returned by
1717 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1718 (key_event): use uChar.UnicodeChar only if
1719 w32_console_unicode_input is non-zero.
1720
1721 * w32console.c: Include w32heap.h.
1722 <w32_console_unicode_input>: New global variable.
1723 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1724 family of Windows, zero otherwise.
1725
1726 * w32inevt.h: Declare w32_console_unicode_input.
1727
1728 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1729 --without-x. (Bug#11742)
1730
1731 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1732
1733 Adjust GDB to reflect pvec_type changes (Bug#12036).
1734 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
1735 2012-07-04 changes to pseudovector representation.
1736 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
1737
1738 2012-07-27 Michael Albinus <michael.albinus@gmx.de>
1739
1740 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1741 bus address.
1742 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1743
1744 2012-07-27 Eli Zaretskii <eliz@gnu.org>
1745
1746 * alloc.c (listn): Fix the order the arguments are consed onto the
1747 list.
1748
1749 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1750 enumeration constants, as PURE and HEAP are too general, and clash
1751 with other headers and sources, such as gmalloc.c and the
1752 MS-Windows system headers. All users changed.
1753
1754 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1755
1756 Revert last save_excursion_save and save_excursion_restore changes.
1757 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1758 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1759
1760 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1761
1762 Fix recently-introduced typos in Windows port.
1763 Reported by Martin Rudalics <rudalics@gmx.at>.
1764 * w32.c (init_environment): Replace comma with semicolon.
1765 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
1766
1767 2012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1768
1769 Improve GDB symbol export (Bug#12036).
1770 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1771 arms of an 'if', not using conditional expressions; otherwise GDB
1772 complains about the types in the unevaluated arm when the argument
1773 is an integer literal.
1774 (xgetint): Simplify expression.
1775 * alloc.c (gdb_make_enums_visible): New constant. This ports to
1776 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
1777 Zaretskii in <http://bugs.gnu.org/12036#13>.
1778 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
1779 needed now that we have gdb_make_enums_visible.
1780 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1781 (enum enum_USE_LSB_TAG):
1782 New enum types, packaging up enums that need to be exported to GDB.
1783
1784 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1785
1786 Utility function to make a list from specified amount of objects.
1787 * lisp.h (enum constype): New datatype.
1788 (listn): New prototype.
1789 * alloc.c (listn): New function.
1790 (Fmemory_use_count, syms_of_alloc): Use it.
1791 * buffer.c (syms_of_buffer): Likewise.
1792 * callint.c (syms_of_callint): Likewise.
1793 * charset.c (define_charset_internal): Likewise.
1794 * coding.c (syms_of_coding): Likewise.
1795 * keymap.c (syms_of_keymap): Likewise.
1796 * search.c (syms_of_search): Likewise.
1797 * syntax.c (syms_of_syntax): Likewise.
1798 * w32.c (init_environment): Likewise.
1799 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1800 * xdisp.c (syms_of_xdisp): Likewise.
1801 * xfns.c (syms_of_xfns): Likewise.
1802
1803 2012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1804
1805 Fast save_excursion_save and save_excursion_restore.
1806 * lisp.h (struct Lisp_Excursion): New data type.
1807 (PVEC_EXCURSION): New pseudovector type.
1808 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1809 to deal with it. Adjust comments.
1810 (init_marker, attach_marker): New prototype.
1811 (unchain_marker): Adjust prototype.
1812 * marker.c (attach_marker): Change to global.
1813 (init_marker): New function.
1814 * alloc.c (Fmake_marker, build_marker): Use it.
1815 (build_marker): More easserts.
1816 (mark_object): Handle struct Lisp_Excursion.
1817 * editfns.c (save_excursion_save, save_excursion_restore):
1818 Reimplement to use struct Lisp_Excursion. Add comments.
1819
1820 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1821
1822 Fix export of symbols to GDB (Bug#12036).
1823 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1824 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
1825 emacs.c, as this is a more-suitable home. Had this been done earlier
1826 the fix for 12036 would have avoided some of the problems noted in
1827 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
1828 would have been more obvious.
1829 * emacs.c: Do not include <verify.h>; no longer needed.
1830 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
1831 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
1832 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1833 Remove; now done in lisp.h.
1834 * lisp.h (PUBLISH_TO_GDB): New macro.
1835 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
1836 (DATA_SEG_BITS): Use it.
1837 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
1838 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
1839 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
1840 not be usable in #if. This simplifies things.
1841
1842 2012-07-26 Juanma Barranquero <lekktu@gmail.com>
1843
1844 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1845
1846 2012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1847
1848 Simplify export of symbols to GDB (Bug#12036).
1849 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1850 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1851 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1852 Adjust to changes in lisp.h and emacs.c, by using
1853 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1854 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1855 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1856 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1857 instead of gdb_valbits.
1858 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1859 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1860 instead of gdb_array_mark_flag.
1861 (xboolvector): Get size from $->size, not $->header.size.
1862 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1863 (xreload, hook-run, hookpost-run): Remove.
1864 * emacs.c: Include <verify.h>.
1865 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1866 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1867 Remove.
1868 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1869 (gdb_USE_LSB_TAG): New enum constants.
1870 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1871 Also define these as enum constants, so they're visible to GDB.
1872 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1873 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1874 as constants, so they're visible to GDB.
1875 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1876 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1877 Now enum constants, not macros, so they're visible to GDB.
1878 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1879 more convenient now. All uses changed.
1880 (VALMASK) [USE_LSB_TAG]: Also define in this case.
1881 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1882
1883 2012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
1884
1885 Explicitly free restriction data that are not needed anymore.
1886 * editfns.c (save_restriction_restore): Free restriction data.
1887
1888 2012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
1889
1890 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
1891 add argument, tune behavior, and adjust all callers.
1892
1893 2012-07-25 Paul Eggert <eggert@cs.ucla.edu>
1894
1895 Use typedef for EMACS_INT, EMACS_UINT.
1896 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
1897 than macros. This simplifies debugging in the usual case, since
1898 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
1899 and it allows expressions involving EMACS_INT casts.
1900 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
1901
1902 2012-07-25 Jan Djärv <jan.h.d@swipnet.se>
1903
1904 * nsterm.m (ns_read_socket): Return early if there is a modal
1905 window (Bug#12043).
1906
1907 2012-07-25 Martin Rudalics <rudalics@gmx.at>
1908
1909 * frame.c (Fredirect_frame_focus): In doc-string don't mention
1910 that FOCUS-FRAME can be omitted.
1911
1912 2012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
1913
1914 Adjust buffer text indirection counters at the end of Fkill_buffer.
1915 * buffer.c (Fkill_buffer): Adjust indirection counters when the
1916 buffer is definitely dead. This should really fix an issue reported
1917 by Christoph Scholtes again. (Bug#12007).
1918 (init_buffer_once): Initialize indirection counters of
1919 buffer_defaults and buffer_local_symbols (for sanity and safety).
1920
1921 2012-07-24 Eli Zaretskii <eliz@gnu.org>
1922
1923 * xdisp.c (init_iterator): Don't compute dimensions of truncation
1924 and continuation glyphs on tooltip frames, leave them at zero.
1925 Avoids continued lines in tooltips. (Bug#11832)
1926
1927 2012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
1928
1929 Simplify copy_overlay.
1930 * buffer.c (copy_overlay): Simplify. Use build_marker.
1931 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
1932
1933 2012-07-23 Eli Zaretskii <eliz@gnu.org>
1934
1935 * print.c (print_object): Don't crash when a frame's name is nil
1936 or invalid. (Bug#12025)
1937
1938 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
1939 it signals an error when a tooltip frame is being created.
1940
1941 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1942
1943 Cleanup miscellaneous objects allocation and initialization.
1944 * alloc.c (allocate_misc): Change to static. Add argument to
1945 specify the subtype. Adjust comment and users.
1946 (build_overlay): New function.
1947 * buffer.c (copy_overlays, Fmake_overlay): Use it.
1948 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
1949 (allocate_misc): Remove prototype.
1950 (build_overlay): Add prototype.
1951
1952 2012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1953
1954 Swap buffer text indirection counters in Fbuffer_swap_text.
1955 * buffer.c (Fbuffer_swap_text): Swap indirections too.
1956 This avoids crash reported by Christoph Scholtes at
1957 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
1958
1959 2012-07-22 Jan Djärv <jan.h.d@swipnet.se>
1960
1961 * nsmenu.m (Popdown_data): New struct.
1962 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
1963 free Popdown_data.
1964 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
1965 (initWithContentRect): Make imgView and contentView non-static
1966 and autorelease them. Also autorelease img and matrix (Bug#12005).
1967 (dealloc): Remove (Bug#12005).
1968
1969 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1970
1971 Adjust consing_since_gc when objects are explicitly freed.
1972 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
1973 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
1974 (free_cons, free_misc): Subtract object size from consing_since_gc.
1975
1976 2012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1977
1978 Simplify and cleanup markers positioning code.
1979 * marker.c (attach_marker): More useful eassert.
1980 (live_buffer, set_marker_internal): New function.
1981 (Fset_marker, set_marker_restricted): Use set_marker_internal.
1982 (set_marker_both, set_marker_restricted_both): Use live_buffer.
1983
1984 2012-07-22 Paul Eggert <eggert@cs.ucla.edu>
1985
1986 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
1987 as it's limited by the amount of memory, not by INT_MAX.
1988
1989 2012-07-21 Eli Zaretskii <eliz@gnu.org>
1990
1991 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
1992 in special-event-map. See the discussion at
1993 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
1994 for the reasons.
1995
1996 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
1997 info.dwItemData. Fixes crashes on 64-bit Windows.
1998 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
1999
2000 2012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2001
2002 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
2003 (conversationIdentifier): Return value is NSInteger.
2004 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
2005
2006 2012-07-21 Chong Yidong <cyd@gnu.org>
2007
2008 * window.c (decode_any_window): Signal an error if the window is
2009 on a dead frame (Bug#11984).
2010
2011 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2012
2013 Add indirection counting to speed up Fkill_buffer.
2014 * buffer.h (struct buffer): New member.
2015 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2016 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2017 base buffer indirection counter.
2018 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2019 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2020 through buffer list if indirection counter is 0.
2021
2022 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2023
2024 Extend the value returned by Fgarbage_collect with heap statistics.
2025 * alloc.c (Qheap): New symbol.
2026 (syms_of_alloc): DEFSYM it.
2027 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2028 (Fmemory_free): Remove.
2029 (syms_of_alloc): Don't defsubr it.
2030 * buffer.c (Fcompact_buffer): Remove.
2031 (syms_of_buffer): Don't defsubr it.
2032
2033 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2034
2035 Make maybe_gc inline.
2036 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2037 * lisp.h (consing_since_gc, gc_relative_threshold)
2038 (memory_full_cons_threshold): Revert declaration.
2039 (maybe_gc): Remove prototype, define as inline.
2040 * alloc.c: Remove old commented-out code.
2041 (consing_since_gc, gc_relative_threshold)
2042 (memory_full_cons_threshold): Revert to global.
2043 (maybe_gc): Remove.
2044
2045 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2046
2047 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2048 * lisp.h (build_unibyte_string): New function.
2049 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2050 * sysdep.c, w32fns.c, xfns.c: Use it.
2051 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2052 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2053 Adjust users accordingly.
2054 * font.h (font_open_by_name): Adjust prototype.
2055
2056 2012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2057
2058 Cleanup calls to Fgarbage_collect.
2059 * lisp.h (maybe_gc): New prototype.
2060 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2061 Remove declarations.
2062 * alloc.c (maybe_gc): New function.
2063 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2064 Make them static.
2065 * bytecode.c (MAYBE_GC): Use maybe_gc.
2066 * eval.c (eval_sub, Ffuncall): Likewise.
2067 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2068 to avoid dependency from auto-save feature.
2069
2070 2012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2071
2072 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2073 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2074 'for_each_per_buffer_object_at'.
2075 All uses changed. It's better to use upper-case for macros that
2076 cannot be implemented as functions, to give the reader a clue
2077 that they're special.
2078
2079 2012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2080
2081 * alloc.c (Fgarbage_collect): Tweak docstring.
2082
2083 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2084
2085 Tweak the value returned from Fgarbage_collect again.
2086 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2087 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2088 Adjust documentation.
2089 (total_vector_bytes): Rename to total_vector_slots, adjust
2090 accounting.
2091 (total_free_vector_bytes): Rename to total_free_vector_slots,
2092 adjust accounting.
2093 (Qstring_bytes, Qvector_slots): New symbols.
2094 (syms_of_alloc): DEFSYM them.
2095
2096 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2097
2098 Buffer compaction primitive which may be used from Lisp.
2099 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2100 (syms_of_buffer): Register Fcompact_buffer.
2101 * alloc.c (Fgarbage_collect): Use compact_buffer.
2102 * buffer.h (compact_buffer): New prototype.
2103 (struct buffer_text): New member.
2104
2105 2012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2106
2107 New macro to iterate over all buffers, miscellaneous cleanups.
2108 * lisp.h (all_buffers): Remove declaration.
2109 * buffer.h (all_buffers): Add declaration, with comment.
2110 (for_each_buffer): New macro.
2111 * alloc.c (Fgarbage_collect, mark_object): Use it.
2112 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2113 (init_buffer): Likewise.
2114 * data.c (Fset_default): Likewise.
2115 * coding.c (code_conversion_restore): Remove redundant check
2116 for dead buffer.
2117 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2118
2119 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2120
2121 Fix bug that created negative-length intervals.
2122 * intervals.c (merge_interval_right, merge_interval_left):
2123 Do not zero out this interval if it is absorbed by its children,
2124 as this interval's total length doesn't change in that case. See
2125 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2126
2127 2012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2128
2129 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2130 when invoking (make-bool-vector N t) and N is a positive
2131 multiple of 8 -- the last 8 bits were mistakenly cleared.
2132
2133 Remove some struct layout assumptions in bool vectors.
2134 * alloc.c (bool_header_size): New constant.
2135 (header_size, word_size): Move earlier, as they're now used earlier.
2136 Use 'word_size' in a few more places, where it's appropriate.
2137 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2138 padding before the data member of a bool vector.
2139 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2140 than doing the check by hand with an abort ().
2141
2142 2012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2143
2144 * eval.c (Fdefvar): Don't check constants since we only set the var if
2145 it's not yet defined anyway (bug#11904).
2146
2147 * lisp.h (last_undo_boundary): Declare new var.
2148 * keyboard.c (command_loop_1): Set it.
2149 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2150 were auto-added by the command loop (bug#11774).
2151
2152 2012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2153
2154 * w32font.c (Qsymbol): Remove local definition.
2155 (syms_of_w32font): Don't DEFSYM it.
2156
2157 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2158
2159 Fix sweep_vectors to handle large bool vectors correctly.
2160 * alloc.c (sweep_vectors): Account total_vector_bytes for
2161 bool vectors larger than VBLOCK_BYTES_MAX.
2162
2163 2012-07-18 Chong Yidong <cyd@gnu.org>
2164
2165 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2166 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2167
2168 2012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2169
2170 Return more descriptive data from Fgarbage_collect.
2171 Suggested by Stefan Monnier in
2172 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2173 * alloc.c (bounded_number): New function.
2174 (total_buffers, total_vectors): New variable.
2175 (total_string_size): Rename to total_string_bytes, adjust users.
2176 (total_vector_size): Rename to total_vector_bytes, adjust users.
2177 (sweep_vectors): Account total_vectors and total_vector_bytes.
2178 (Fgarbage_collect): New return value. Adjust documentation.
2179 (gc_sweep): Account total_buffers.
2180 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2181 (VECTOR_SIZE): Remove.
2182 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2183 (Qinterval, Qmisc): New symbols.
2184 (syms_of_data): Initialize them.
2185 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2186 (Qcons, Qbuffer): New declarations.
2187
2188 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2189
2190 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2191 Round up, not down. Improve doc.
2192
2193 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2194
2195 Restore old code in allocate_string_data to avoid Faset breakage.
2196 Reported by Julien Danjou <julien@danjou.info> in
2197 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2198 * alloc.c (allocate_string_data): Restore old code with minor
2199 adjustments, fix comment to explain this subtle issue.
2200
2201 2012-07-17 Eli Zaretskii <eliz@gnu.org>
2202
2203 Remove FILE_SYSTEM_CASE.
2204 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2205
2206 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2207 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2208 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2209 call-process-region passes it through expand-file-name.
2210
2211 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2212
2213 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2214
2215 Fix crash when creating indirect buffer (Bug#11917)
2216 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2217 Don't handle unbound variables specially if non-zero.
2218 (Fbuffer_local_variables): Pass zero.
2219 (clone_per_buffer_values): Pass non-zero.
2220
2221 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2222
2223 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2224 to make the loop interruptible.
2225
2226 2012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2227
2228 * gnutls.c (emacs_gnutls_handshake): Only retry if
2229 GNUTLS_E_INTERRUPTED.
2230
2231 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2232
2233 Cleanup and convert miscellaneous checks to eassert.
2234 * alloc.c (mark_interval): Fix comment, partially rephrase
2235 old comment from intervals.h (see below).
2236 * intervals.c (find_interval, adjust_intervals_for_insertion)
2237 (delete_interval, adjust_intervals_for_deletion)
2238 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2239 Convert to eassert.
2240 (adjust_intervals_for_insertion, make_new_interval):
2241 Remove obsolete and unused code.
2242 * intervals.h (struct interval): Remove obsolete comment.
2243 * textprotp.c (erase_properties): Remove unused code.
2244 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2245 (Fremove_list_of_text_properties): Convert to eassert.
2246
2247 2012-07-17 Chong Yidong <cyd@gnu.org>
2248
2249 * editfns.c (Finsert_char): Doc fix.
2250
2251 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2252
2253 Fix previous change to make Fmemory_free always accurate.
2254 * alloc.c (make_interval): Update total_free_intervals.
2255 (make_float): Likewise for total_free_floats.
2256 (free_cons, Fcons): Likewise for total_free_conses.
2257 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2258 Likewise for total_free_vector_bytes.
2259 (Fmake_symbol): Likewise for total_free_symbols.
2260 (bytes_free): Remove.
2261
2262 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2263
2264 Simple free memory accounting feature.
2265 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2266 (sweep_vectors): Accumulate size of free vectors.
2267 (Fgarbage_collect): Setup bytes_free.
2268 (Fmemory_free): New function.
2269 (syms_of_alloc): Register it.
2270
2271 2012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2272
2273 Cleanup overlays checking.
2274 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2275 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2276 eassert and OVERLAYP.
2277 (sort_overlays): Change to use OVERLAYP.
2278
2279 2012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2280
2281 * editfns.c (Finsert_char): Make it interactive, and make the
2282 second arg optional. Copy interactive spec and docstring from
2283 ucs-insert.
2284
2285 2012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2286
2287 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2288 Unlike the other wrapped functions, fabs has an unspecified
2289 effect on errno.
2290
2291 2012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2292
2293 * nsterm.m (keyDown): Interpret flags without left/right bits
2294 as the left key (Bug#11670).
2295
2296 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2297
2298 Remove empty and useless init functions.
2299 * lisp.h (init_character_once, init_fns, init_image)
2300 (init_filelock, init_sound): Remove prototype.
2301 * character.c (init_character_once): Remove.
2302 * filelock.c (init_filelock): Likewise.
2303 * fns.c (init_fns): Likewise.
2304 * image.c (init_image): Likewise.
2305 * sound.c (init_sound): Likewise.
2306 * emacs.c (main): Adjust accordingly.
2307
2308 2012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2309
2310 * gtkutil.h: Tiny cleanups.
2311 (use_old_gtk_file_dialog): Remove useless declaration.
2312 (xg_uses_old_file_dialog): Add suggested const attribute.
2313
2314 2012-07-15 Eli Zaretskii <eliz@gnu.org>
2315
2316 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2317 (bidi_paragraph_init): Use it to limit search forward for a strong
2318 directional character in abnormally large paragraphs full of
2319 neutral or weak characters. (Bug#11943)
2320
2321 2012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2322
2323 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2324 the toolbar (Bug#9451).
2325 (xg_make_tool_item): Give the widget event box a transparent
2326 background.
2327
2328 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2329
2330 Cleanup basic allocation variables and functions.
2331 * alloc.c (ignore_warnings, init_intervals, init_float)
2332 (init_cons, init_symbol, init_marker): Remove.
2333 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2334 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2335 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2336 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2337 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2338 (staticidx, init_alloc_once, init_strings, free_ablock):
2339 Remove redundant initialization.
2340 * fns.c (init_weak_hash_tables): Remove.
2341 * lisp.h (init_weak_hash_tables): Remove prototype.
2342
2343 2012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2344
2345 Use zero_vector where appropriate.
2346 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2347 accordingly.
2348 * lisp.h (zero_vector): New declaration.
2349 * font.c (null_vector): Remove.
2350 (syms_of_font): Remove initialization and staticpro.
2351 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2352 * keymap.c (Faccessible_keymaps): Likewise.
2353
2354 2012-07-15 Leo Liu <sdl.web@gmail.com>
2355
2356 * fringe.c: Fix typo in comments.
2357
2358 2012-07-14 Leo Liu <sdl.web@gmail.com>
2359
2360 * fringe.c: Add a new bitmap exclamation-mark.
2361
2362 2012-07-14 Eli Zaretskii <eliz@gnu.org>
2363
2364 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2365
2366 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2367 (HAVE_MENUS): Don't define, defined by editing config.in with
2368 msdos/sed2v2.inp.
2369 (GMALLOC_INHIBIT_VALLOC): Don't define.
2370 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2371
2372 2012-07-14 Juanma Barranquero <lekktu@gmail.com>
2373
2374 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2375
2376 2012-07-14 Glenn Morris <rgm@gnu.org>
2377
2378 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2379 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2380 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2381
2382 2012-07-13 Glenn Morris <rgm@gnu.org>
2383
2384 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2385
2386 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2387 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2388
2389 2012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2390
2391 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2392 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2393 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2394 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2395 where appropriate.
2396 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2397 as boolean expression.
2398 (x_set_window_size): Remove unused variable toolbar.
2399 (ns_get_color_default, ns_mod_to_lisp): Remove.
2400 (ns_mouse_position): Remove unused variables xchar and ychar.
2401 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2402 (ns_set_vertical_scroll_bar): Remove unused variable count.
2403 (ns_delete_terminal): Remove unused variable i.
2404 (ns_term_init): Remove unused variables r, g and b.
2405 (mouseDown): Remove unused variable window.
2406 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2407 (initFrameFromEmacs): Remove unused variable vbextra.
2408 (mouseEntered): Remove unused variables p and dpyinfo.
2409 (mouseExited): Remove unused variables p and r.
2410 (ns_define_frame_cursor, ns_clear_frame_area)
2411 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2412 (menuDown): Assign [sender tag] to variable and cast the variable.
2413
2414 * nsterm.h (menuDown): Add id as type to argument sender.
2415 (ns_display_info_for_name): Add Lisp_Object argument.
2416 (ns_term_init): Add Lisp_Object argument.
2417 (ns_map_event_to_object): Add void argument.
2418 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2419 prototype with arguments and only declare if __OBJC__.
2420 (nxatoms_of_nsselect): Add void argument.
2421 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2422 (ns_alloc_autorelease_pool): Add void argument.
2423 (ns_release_autorelease_pool): Add void* argument.
2424 (ns_get_defaults_value): Add const char* argument.
2425
2426 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2427 (initFromContents): Use SSDATA where appropriate.
2428 (ns_update_menubar): Add braces to ambigous if-else.
2429 (initWithTitle): Put () around assignment in if statement.
2430 (ns_menu_show): Remove unused variables window and keymap.
2431 (update_frame_tool_bar): Remove unused variable selected_p.
2432 (initWithContentRect): Remove unused variable this_cmd_name.
2433
2434 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2435 appropriate.
2436 (setXBMColor): Remove unused variable len.
2437 (setPixmapData): Put () around assignment in loop statement.
2438
2439 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2440 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2441 where appropriate.
2442 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2443 around assignment in loop statement.
2444 (nsfont_open): Remove unused variable i.
2445 (nsfont_open): Remove unused variable len.
2446 (nsfont_draw): Remove unused variable cs.
2447
2448 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2449 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2450 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2451 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2452 (Fns_font_name, Fns_perform_service)
2453 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2454 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2455 (ns_set_name): Remove unused variable view.
2456 (x_set_menu_bar_lines): Remove unused variable olines.
2457 (x_set_tool_bar_lines): Remove unused variable root_window.
2458 (Fns_list_colors): Put () around assignment in while statement.
2459 (Fns_perform_service): Remove unused variable len.
2460 (Fns_display_usable_bounds): Remove unused variable top.
2461 (syms_of_nsfns): Remove unused variable i.
2462
2463 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2464 memcpy (Bug#11907).
2465
2466 2012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2467
2468 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2469 and free it with DestroyExceptionInfo (Bug#11558).
2470
2471 2012-07-13 Juanma Barranquero <lekktu@gmail.com>
2472
2473 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2474 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2475 Set here, not in nt/config.nt.
2476
2477 2012-07-13 Eli Zaretskii <eliz@gnu.org>
2478
2479 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2480 cursor overflow into the last glyph on display line when the right
2481 fringe is off. (Bug#11832)
2482
2483 2012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2484
2485 * xdisp.c (produce_special_glyphs): Now static.
2486 * dispextern.h (produce_special_glyphs): Remove decl.
2487
2488 2012-07-13 Glenn Morris <rgm@gnu.org>
2489
2490 * s/bsd-common.h, s/cygwin.h: Remove empty files.
2491 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2492
2493 * s/usg5-4-common.h (USG, USG5):
2494 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2495 * s/sol2-6.h (SOLARIS2):
2496 * s/irix6-5.h (IRIX6_5):
2497 * s/hpux10-20.h (USG, USG5, HPUX):
2498 * s/gnu-linux.h (USG, GNU_LINUX):
2499 * s/freebsd.h (BSD_SYSTEM):
2500 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2501 * s/cygwin.h (CYGWIN):
2502 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2503 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2504
2505 2012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
2506
2507 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
2508
2509 2012-07-13 Glenn Morris <rgm@gnu.org>
2510
2511 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2512
2513 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2514
2515 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2516 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2517
2518 2012-07-12 Glenn Morris <rgm@gnu.org>
2519
2520 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
2521
2522 * process.c (init_process_emacs): Rename from init_process.
2523 The old name is also the name of a Mach system call.
2524 * lisp.h, emacs.c: Update for this name change.
2525 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2526 longer needed.
2527
2528 2012-07-12 Eli Zaretskii <eliz@gnu.org>
2529
2530 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2531 memmove call that removes glyphs covered by the left truncation
2532 glyph. Improve commentary.
2533 (display_line): Fix display of continuation glyphs on GUI frames
2534 when the right fringe is turned off and variable-size fonts are
2535 used in the window. Move the code that appends a stretch glyph to
2536 produce_special_glyphs, so that it could be used for truncation
2537 and continuation glyphs alike.
2538 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2539 glyph of a suitably computed width, to align the special glyphs at
2540 the window margin. Code moved from display_line. (Bug#11832)
2541
2542 2012-07-12 Glenn Morris <rgm@gnu.org>
2543
2544 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2545
2546 * s/gnu-linux.h, s/hpux10-20.h:
2547 Do not unconditionally define HAVE_XRMSETDATABASE.
2548
2549 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2550
2551 2012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2552
2553 Fix typos that broke OS X build.
2554 Reported by Randal L. Schwartz in
2555 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2556 * nsterm.m (ns_timeout): Add missing local decl.
2557 (ns_get_color): snprintf -> sprintf, to fix typo.
2558
2559 2012-07-12 Glenn Morris <rgm@gnu.org>
2560
2561 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2562 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2563 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2564 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2565
2566 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2567 Move PTY_OPEN to configure.
2568
2569 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2570 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2571 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2572
2573 2012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2574
2575 Use empty_unibyte_string where applicable.
2576 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2577 * lread.c (read1): Likewise.
2578 * xsettings.c (syms_of_xsettings): Likewise.
2579
2580 2012-07-12 Glenn Morris <rgm@gnu.org>
2581
2582 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2583 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
2584 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2585 * s/hpux10-20.h (RUN_TIME_REMAP):
2586 * s/bsd-common.h (TABDLY): Move to configure.
2587
2588 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2589
2590 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2591
2592 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
2593 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
2594
2595 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
2596
2597 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2598 * s/template.h: Move NARROWPROTO to configure.
2599
2600 2012-07-11 Glenn Morris <rgm@gnu.org>
2601
2602 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2603 unused since 2011-01-17 change to systty.h.
2604
2605 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2606 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2607 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2608
2609 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2610
2611 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2612
2613 2012-07-11 Glenn Morris <rgm@gnu.org>
2614
2615 * s/darwin.h, s/gnu-linux.h, s/template.h:
2616 Move INTERRUPT_INPUT to configure.
2617
2618 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2619
2620 Minor adjustments to interning code.
2621 * lisp.h (intern, intern_c_string): Redefine as static inline
2622 wrappers for intern_1 and intern_c_string_1, respectively.
2623 (intern_1, intern_c_string_1): Rename prototypes.
2624 * lread.c (intern_1, intern_c_string_1, oblookup):
2625 Simplify Vobarray checking.
2626 * font.c (font_intern_prop): Likewise. Adjust comment.
2627 * w32font.c (intern_font_name): Likewise.
2628
2629 2012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2630
2631 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2632
2633 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2634 of Fcar/Fcdr if possible.
2635 * font.c (check_otf_features): Likewise.
2636 * fontset.c (Fnew_fontset): Likewise.
2637 * gnutls.c (Fgnutls_boot): Likewise.
2638 * minibuf.c (read_minibuf): Likewise.
2639 * msdos.c (IT_set_frame_parameters): Likewise.
2640 * xmenu.c (Fx_popup_dialog): Likewise.
2641 * w32menu.c (Fx_popup_dialog): Likewise.
2642
2643 2012-07-11 Glenn Morris <rgm@gnu.org>
2644
2645 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2646 since nothing has defined it on these platforms.
2647
2648 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2649 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2650
2651 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2652 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2653 Move CLASH_DETECTION to configure.
2654
2655 * s/gnu.h: Remove file, which is now empty.
2656
2657 * s/gnu.h, s/gnu-linux.h:
2658 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2659
2660 2012-07-11 John Wiegley <johnw@newartisans.com>
2661
2662 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2663 function attribute, so we only use it if it exists in the
2664 compiler.
2665
2666 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2667
2668 Avoid call to strlen in fast_c_string_match_ignore_case.
2669 * search.c (fast_c_string_match_ignore_case): Change to use
2670 length argument. Adjust users accordingly.
2671 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2672
2673 2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2674
2675 Assume mkdir, rmdir.
2676 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2677 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2678
2679 Assume rename.
2680 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2681
2682 Assume perror.
2683 * s/hpux10-20.h (HAVE_PERROR): Remove.
2684 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2685 Remove dummy definition, as this problem was obsolete long ago.
2686
2687 Assume strerror.
2688 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2689
2690 2012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2691
2692 Avoid calls to strlen in font processing functions.
2693 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
2694 (font_open_by_name): Change to use length argument.
2695 Adjust users accordingly.
2696 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2697 Adjust prototypes.
2698 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2699 Change to return ptrdiff_t.
2700 (xfont_list_pattern, xfont_match): Use length returned by
2701 xfont_decode_coding_xlfd.
2702 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2703
2704 2012-07-11 Glenn Morris <rgm@gnu.org>
2705
2706 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2707 Move DONT_REOPEN_PTY to configure.
2708
2709 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2710 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2711
2712 2012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2713
2714 Remove "#define unix" that is no longer needed (Bug#11905).
2715 * s/aix4-2.h (unix): Remove; no longer needed.
2716
2717 EMACS_TIME simplification (Bug#11875).
2718 This replaces macros (which typically do not work in GDB)
2719 with functions, typedefs and enums, making the code easier to debug.
2720 The functional style also makes code easier to read and maintain.
2721 * systime.h: Include <sys/time.h> on all hosts, not just if
2722 WINDOWSNT, since 'struct timeval' is needed in general.
2723 (EMACS_TIME): Now a typedef, not a macro.
2724 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2725 not macros.
2726 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2727 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2728 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2729 (EMACS_TIME_LE): Now functions, not macros.
2730 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2731 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2732 which are not functions. All uses rewritten to use:
2733 (make_emacs_time): New function.
2734 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2735 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2736 not functions. All uses rewritten to use the following, respectively:
2737 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2738 (add_emacs_time, sub_emacs_time): New functions.
2739 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
2740 * fileio.c (Fcopy_file):
2741 * xterm.c (XTflash): Get the current time closer to when it's used.
2742 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2743
2744 * bytecode.c (targets): Suppress -Woverride-init warnings.
2745
2746 Simplify by avoiding confusing use of strncpy etc.
2747 * doc.c (Fsnarf_documentation):
2748 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2749 * frame.c (Fmake_terminal_frame):
2750 * gtkutil.c (get_utf8_string):
2751 * lread.c (openp):
2752 * nsmenu.m (ns_update_menubar):
2753 * regex.c (regerror):
2754 Prefer memcpy to strncpy and strncat when either will do.
2755 * fileio.c (Fsubstitute_in_file_name):
2756 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2757 (menu_separator_name_p):
2758 * nsmenu.m (ns_update_menubar):
2759 Prefer memcmp to strncmp when either will do.
2760 * nsterm.m: Include <ftoastr.h>.
2761 (ns_get_color):
2762 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2763 Prefer snprintf to strncpy.
2764 * nsterm.m (ns_term_init):
2765 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2766 * nsterm.m (ns_term_init):
2767 Avoid the need for strncpy, by using build_string or
2768 make_unibyte_string directly. Use dtoastr, not snprintf.
2769 * process.c (Fmake_network_process): Diagnose service names that
2770 are too long, rather than silently truncating them or creating
2771 non-null-terminated names.
2772 (Fnetwork_interface_info): Likewise, for interface names.
2773 * sysdep.c (system_process_attributes) [GNU_LINUX]:
2774 Prefer sprintf to strncat.
2775 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2776 Prefer vsnprintf to vsprintf + strncpy.
2777
2778 2012-07-10 Glenn Morris <rgm@gnu.org>
2779
2780 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2781 Clarify fallback case.
2782
2783 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2784
2785 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2786 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2787 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
2788 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
2789 where argument type is known to be a Lisp_Cons.
2790
2791 2012-07-10 Tom Tromey <tromey@redhat.com>
2792
2793 * bytecode.c (BYTE_CODE_THREADED): New macro.
2794 (BYTE_CODES): New macro. Replaces all old byte-code defines.
2795 (enum byte_code_op): New type.
2796 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2797 (exec_byte_code): Use them. Use token threading when applicable.
2798
2799 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2800
2801 Optimize pure C strings initialization.
2802 * lisp.h (make_pure_string): Fix prototype.
2803 (build_pure_c_string): New function, defined as static inline. This
2804 provides a better opportunity to optimize away calls to strlen when
2805 the function is called with compile-time constant argument.
2806 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
2807 argument, adjust users accordingly. Use build_pure_c_string where
2808 appropriate.
2809 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2810 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2811 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2812
2813 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2814
2815 Avoid calls to strlen in miscellaneous functions.
2816 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2817 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
2818 * lread.c (openp): Likewise.
2819
2820 2012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2821
2822 Avoid calls to strlen in path processing functions.
2823 * fileio.c (file_name_as_directory): Add comment. Change to add
2824 srclen argument and return the length of result. Adjust users
2825 accordingly.
2826 (directory_file_name): Fix comment. Change to add srclen argument,
2827 swap 1st and 2nd arguments to obey the common convention.
2828 Adjust users accordingly.
2829 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
2830
2831 2012-07-10 Glenn Morris <rgm@gnu.org>
2832
2833 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
2834 Move PENDING_OUTPUT_COUNT definition to configure.
2835
2836 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
2837 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
2838 * s/gnu.h (DATA_START): Move definitions to configure.
2839
2840 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
2841 We include usg5-4-common.h, which defines them both.
2842
2843 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2844 O_RDONLY already includes it).
2845
2846 Stop ns builds setting the EMACSLOADPATH environment variable.
2847 * nsterm.m (ns_load_path): Rename from ns_init_paths.
2848 Now it does not set EMACSLOADPATH, just returns the load-path string.
2849 * nsterm.h: Update accordingly.
2850 * lread.c [HAVE_NS]: Include nsterm.h.
2851 (init_lread) [HAVE_NS]: Use ns_load_path.
2852 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2853
2854 2012-07-09 Glenn Morris <rgm@gnu.org>
2855
2856 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2857 since the included bsd-common.h does so.
2858
2859 Stop ns builds setting the EMACSPATH environment variable.
2860 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2861 (ns_init_paths): Do not set EMACSPATH.
2862 * nsterm.h (ns_exec_path): Add it.
2863 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2864 Use ns_exec_path.
2865
2866 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2867
2868 2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
2869
2870 * process.c (wait_reading_process_output): 'waitchannels' was unset
2871 when read_kbd || !NILP (wait_for_cell); fix this.
2872
2873 Add GCC-style 'const' attribute to functions that can use it.
2874 * character.h (char_resolve_modifier_mask):
2875 * keyboard.h (make_ctrl_char):
2876 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2877 (init_character_once, next_almost_prime, init_fns, init_image)
2878 (flush_pending_output, init_sound):
2879 * mem-limits.h (start_of_data):
2880 * menu.h (finish_menu_items):
2881 Add ATTRIBUTE_CONST.
2882 * emacs.c (DEFINE_DUMMY_FUNCTION):
2883 Declare the dummy function with ATTRIBUTE_CONST.
2884 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2885 Add decls with ATTRIBUTE_CONST.
2886
2887 Minor improvements to make_formatted_string.
2888 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2889 where int is good enough, as vsprintf returns an int.
2890 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
2891
2892 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2893
2894 Use make_formatted_string to avoid double length calculation.
2895 * lisp.h (make_formatted_string): New prototype.
2896 * alloc.c (make_formatted_string): New function.
2897 * buffer.c (Fgenerate_new_buffer_name): Use it.
2898 * dbus.c (syms_of_dbusbind): Likewise.
2899 * editfns.c (Fcurrent_time_zone): Likewise.
2900 * filelock.c (get_boot_time): Likewise.
2901 * frame.c (make_terminal_frame, set_term_frame_name)
2902 (x_report_frame_params): Likewise.
2903 * image.c (gs_load): Likewise.
2904 * minibuf.c (get_minibuffer): Likewise.
2905 * msdos.c (dos_set_window_size): Likewise.
2906 * process.c (make_process): Likewise.
2907 * xdisp.c (ensure_echo_area_buffers): Likewise.
2908 * xsettings.c (apply_xft_settings): Likewise.
2909
2910 2012-07-09 Glenn Morris <rgm@gnu.org>
2911
2912 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
2913 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
2914 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
2915 * nsterm.h (ns_etc_directory): Add it.
2916 * callproc.c [HAVE_NS]: Include nsterm.h.
2917 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
2918
2919 2012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2920
2921 Move marker debugging code under MARKER_DEBUG.
2922 * marker.c (MARKER_DEBUG): Move marker debugging code under
2923 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
2924 for bootstrap with --enable-checking (~3x slowdown reported
2925 by Juanma Barranquero <lekktu@gmail.com>).
2926 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
2927
2928 2012-07-08 Paul Eggert <eggert@cs.ucla.edu>
2929
2930 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
2931 See <http://bugs.gnu.org/11825#29>.
2932
2933 2012-07-08 Eli Zaretskii <eliz@gnu.org>
2934
2935 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
2936 has no font, use the frame's font. (Bug#11813)
2937 (display_line): Add commentary about displaying truncation glyphs
2938 on GUI frames.
2939 (produce_special_glyphs): Move here from term.c.
2940
2941 * term.c (produce_special_glyphs): Move to xdisp.c.
2942
2943 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
2944 section.
2945
2946 2012-07-07 Andreas Schwab <schwab@linux-m68k.org>
2947
2948 * xdisp.c (display_line): Avoid warning about implicit declaration
2949 of FRAME_FONT.
2950
2951 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
2952
2953 * lisp.h: Remove empty conditional.
2954
2955 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2956
2957 * lread.c (load_path_check): Now static.
2958
2959 Fix some minor --with-ns problems found by static checking.
2960 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
2961 (x_set_font) [!HAVE_X_WINDOWS]:
2962 * image.c (xpm_load_image) [HAVE_NS]:
2963 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
2964 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
2965 Remove unused local.
2966 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
2967 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
2968 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
2969 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
2970 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
2971 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
2972 Fix pointer signedness problem.
2973 * xfaces.c (FRAME_X_FONT_TABLE):
2974 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
2975
2976 2012-07-07 Glenn Morris <rgm@gnu.org>
2977
2978 * lread.c (load_path_check): New function, split from init_lread.
2979 (init_lread): Reorganize. Motivation:
2980 If EMACSLOADPATH is set, check/warn about that rather than the
2981 defaults, which we are not going to use. Hence we can remove
2982 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
2983 Don't warn if site-lisp directories are missing.
2984 If not installed, start from a blank load-path, since
2985 PATH_LOADSEARCH refers to the eventual installation directories.
2986
2987 2012-07-07 Eli Zaretskii <eliz@gnu.org>
2988
2989 Support truncation and continuation glyphs on GUI frames, when
2990 fringes are disabled. (Bug#11832)
2991 * xdisp.c (init_iterator): Get dimensions of truncation and
2992 continuation glyphs even if on GUI frames.
2993 Adjust it->last_visible_x on GUI frames when the left or right fringes,
2994 or both, are absent.
2995 (start_display, move_it_in_display_line_to): Handle the case of a
2996 GUI frame without a fringe to display continuation or truncation
2997 glyphs.
2998 (insert_left_trunc_glyphs): Support GUI frames: make sure
2999 truncation glyphs overwrite enough glyphs from the current line to
3000 have sufficient space in pixels.
3001 (display_line): Support truncation and continuation glyphs on GUI
3002 frames. If some spare pixels are left on the line after inserting
3003 the truncation glyphs, fill that space with a stretch glyph of a
3004 suitably computed width.
3005
3006 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3007 produce_glyphs, to support GUI sessions.
3008
3009 2012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3010
3011 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3012
3013 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3014
3015 Do not require float-time's arg to fit in time_t (Bug#11825).
3016 This works better on hosts where time_t is unsigned, and where
3017 float-time is applied to the (negative) difference between two times.
3018 * editfns.c (decode_time_components): Last arg is now double *,
3019 not int *, and means to store all the result as a double, without
3020 worrying about whether the seconds part fits in time_t.
3021 All callers changed.
3022 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3023 All callers changed.
3024 (Ffloat_time): Do not fail merely because the specified time falls
3025 outside of time_t range.
3026
3027 2012-07-07 Glenn Morris <rgm@gnu.org>
3028
3029 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3030 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3031 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3032
3033 2012-07-07 Juanma Barranquero <lekktu@gmail.com>
3034
3035 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3036 Update dependencies.
3037
3038 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3039
3040 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3041
3042 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3043 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3044 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3045 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3046 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3047 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3048
3049 * xfont.c (compare_font_names): Redo to omit the need for casts.
3050
3051 2012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3052
3053 * xfns.c (Fx_change_window_property): Doc fix.
3054 * w32fns.c (Fx_change_window_property): Doc fix.
3055
3056 * w32fns.c (Fx_window_property): Accept the same arguments as the
3057 X Windows version. Doc fix.
3058 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3059
3060 2012-07-06 Juanma Barranquero <lekktu@gmail.com>
3061 Eli Zaretskii <eliz@gnu.org>
3062
3063 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3064 Windows-specific code from nt/config.nt moved here.
3065 Obsolete settings removed.
3066
3067 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3068
3069 * process.c: Avoid unnecessary calls to gettime.
3070 (wait_reading_process_output): Don't get the time of day
3071 when gobbling data immediately and not waiting, as there's no need
3072 for it in that case. This removes a FIXME.
3073
3074 2012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3075
3076 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3077 is defined (Bug#11768).
3078
3079 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3080
3081 Fix marker debugging code.
3082 * marker.c (byte_char_debug_check): Do not perform the check
3083 if buffer is not multibyte.
3084 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3085 Call byte_char_debug_check with correct arguments.
3086
3087 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3088
3089 Compile marker debugging code only if ENABLE_CHECKING is defined.
3090 * marker.c (byte_char_debug_check, count_markers):
3091 Use only if ENABLE_CHECKING is defined.
3092 (byte_debug_flag): Remove.
3093 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3094 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3095
3096 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3097
3098 Avoid code repetition in marker-related functions.
3099 * marker.c (attach_marker): New function.
3100 (Fset_marker, set_marker_restricted, set_marker_both)
3101 (set_marker_restricted_both): Use it.
3102 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3103 Consistently rename charno to charpos.
3104 (marker_position): Add eassert.
3105 (marker_byte_position): Convert to eassert.
3106
3107 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3108
3109 Simplify list operations in unchain_overlay and unchain_marker.
3110 * buffer.c (unchain_overlay): Simplify. Add comment.
3111 * marker.c (unchain_marker): Simplify. Fix comments.
3112
3113 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3114
3115 Introduce fast path for the widely used marker operation.
3116 * alloc.c (build_marker): New function.
3117 * lisp.h (build_marker): New prototype.
3118 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3119 * composite.c (autocmp_chars): Likewise.
3120 * editfns.c (buildmark): Remove.
3121 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3122 (save_restriction_save): Use build_marker.
3123 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3124 * window.c (save_window_save): Likewise.
3125
3126 2012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3127
3128 Do not use Fdelete_overlay in delete_all_overlays
3129 to avoid redundant calls to unchain_overlay.
3130 * buffer.c (drop_overlay): New function.
3131 (delete_all_overlays, Fdelete_overlay): Use it.
3132 * minibuf.c (get_minibuffer): Fix comment.
3133
3134 2012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3135
3136 Port to OpenBSD 5.1 amd64.
3137 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3138 This is needed for OpenBSD, and should be harmless on all BSD systems.
3139 Also, include <sys/sysctl.h>, as it should be available on all
3140 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3141 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3142 use p_pid member, not kp_proc.pid.
3143
3144 2012-07-06 Glenn Morris <rgm@gnu.org>
3145
3146 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3147
3148 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3149
3150 More xmalloc and related cleanup.
3151 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3152 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3153 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3154 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3155 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3156 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3157 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3158 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3159 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3160 * xterm.c:
3161 Omit needless casts involving void * pointers and allocation.
3162 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3163 as the former is more robust if P's type is changed.
3164 Prefer xzalloc to xmalloc + memset 0.
3165 Simplify malloc-or-realloc to realloc.
3166 Don't worry about xmalloc returning a null pointer.
3167 Prefer xstrdup to xmalloc + strcpy.
3168 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3169 growing it.
3170 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3171 alloca of a constant.
3172
3173 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3174
3175 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3176 hscroll is larger than the line width. Fixes long and futile
3177 looping inside extend_face_to_end_of_line (on a TTY) producing
3178 glyphs that are not needed and thrown away.
3179
3180 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3181
3182 * marker.c (set_marker_restricted_both): Simplify by using
3183 clip_to_bounds.
3184
3185 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3186
3187 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3188
3189 2012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3190
3191 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3192 not defined (Bug#11768).
3193 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3194 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3195 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3196 followed by gtk_box_set_homogeneous (Bug#11768).
3197 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
3198 (update_theme_scrollbar_width, xg_create_scroll_bar):
3199 Use gtk_scrollbar_new (Bug#11768).
3200 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3201 (is_box_type): New function (Bug#11768).
3202 (xg_tool_item_stale_p): Call is_box_type.
3203 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
3204 with default display (Bug#11768).
3205
3206 2012-07-05 Eli Zaretskii <eliz@gnu.org>
3207
3208 * xdisp.c (window_hscroll_limited): New function.
3209 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3210 coordinates when window's hscroll is set to insanely large
3211 values. (Bug#11857)
3212
3213 2012-07-05 Juanma Barranquero <lekktu@gmail.com>
3214
3215 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3216 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3217
3218 2012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3219
3220 Cleanup xmalloc.
3221 * lisp.h (xzalloc): New prototype. Omit needless casts.
3222 * alloc.c (xzalloc): New function. Omit needless casts.
3223 * charset.c: Omit needless casts. Convert all calls to
3224 xmalloc with following memset to xzalloc.
3225 * dispnew.c: Likewise.
3226 * fringe.c: Likewise.
3227 * image.c: Likewise.
3228 * sound.c: Likewise.
3229 * term.c: Likewise.
3230 * w32fns.c: Likewise.
3231 * w32font.c: Likewise.
3232 * w32term.c: Likewise.
3233 * xfaces.c: Likewise.
3234 * xfns.c: Likewise.
3235 * xterm.c: Likewise.
3236 * atimer.c: Omit needless casts.
3237 * buffer.c: Likewise.
3238 * callproc.c: Likewise.
3239 * ccl.c: Likewise.
3240 * coding.c: Likewise.
3241 * composite.c: Likewise.
3242 * doc.c: Likewise.
3243 * doprnt.c: Likewise.
3244 * editfns.c: Likewise.
3245 * emacs.c: Likewise.
3246 * eval.c: Likewise.
3247 * filelock.c: Likewise.
3248 * fns.c: Likewise.
3249 * gtkutil.c: Likewise.
3250 * keyboard.c: Likewise.
3251 * lisp.h: Likewise.
3252 * lread.c: Likewise.
3253 * minibuf.c: Likewise.
3254 * msdos.c: Likewise.
3255 * print.c: Likewise.
3256 * process.c: Likewise.
3257 * region-cache.c: Likewise.
3258 * search.c: Likewise.
3259 * sysdep.c: Likewise.
3260 * termcap.c: Likewise.
3261 * terminal.c: Likewise.
3262 * tparam.c: Likewise.
3263 * w16select.c: Likewise.
3264 * w32.c: Likewise.
3265 * w32reg.c: Likewise.
3266 * w32select.c: Likewise.
3267 * w32uniscribe.c: Likewise.
3268 * widget.c: Likewise.
3269 * xdisp.c: Likewise.
3270 * xmenu.c: Likewise.
3271 * xrdb.c: Likewise.
3272 * xselect.c: Likewise.
3273
3274 2012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3275
3276 * fileio.c (time_error_value): Check the right error number.
3277 Problem reported by Troels Nielsen in
3278 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3279
3280 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3281
3282 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3283 This should be fixed in a better way; see Eli Zaretskii in
3284 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3285 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3286
3287 * fileio.c (time_error_value): Rename from special_mtime.
3288 The old name's problems were noted by Eli Zaretskii in
3289 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3290
3291 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3292 This variable's comment says Emacs needs at least one GDB-visible
3293 symbol of type enum pvec_type, to work around GDB problems.
3294 The symbol's value doesn't matter.
3295
3296 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3297 that causes compilation to fail on pre-C99 compilers.
3298
3299 2012-07-04 Juanma Barranquero <lekktu@gmail.com>
3300
3301 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3302 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3303
3304 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3305
3306 * buffer.c (init_buffer_once): Fix initialization of
3307 headers for buffer_defaults and buffer_local_symbols.
3308 Reported by Juanma Barranquero <lekktu@gmail.com>.
3309
3310 2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3311
3312 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3313 * lisp.h (enum pvec_type): Use fewer bits.
3314 (PSEUDOVECTOR_SIZE_BITS): New constant.
3315 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3316 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3317 change in pvec_type.
3318 (PSEUDOVECTOR_TYPEP): New macro.
3319 (TYPED_PSEUDOVECTORP): Use it.
3320 * fns.c (internal_equal): Adapt code to extract pvectype.
3321 * emacs.c (gdb_pvec_type): Update type.
3322 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3323 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3324 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3325 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3326 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3327 abusing vector->header.next.nbytes.
3328 (live_vector_p): Use PVEC_TYPE.
3329 (mark_object): Adapt code to extract pvectype. Use switch.
3330
3331 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3332
3333 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3334 Tighten new eassert a bit.
3335
3336 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3337
3338 Fix compilation with --enable-gcc-warnings and -O1
3339 optimization level.
3340 * doprnt.c (doprnt): Change type of tem to int, initialize
3341 to avoid compiler warning. Add eassert.
3342 * search.c (simple_search): Initialize match_byte to avoid
3343 compiler warning. Add eassert.
3344
3345 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3346
3347 Avoid weird behavior with large horizontal scrolls.
3348 Without this change, for example, large hscroll values would
3349 mess up Emacs's display on Fedora 15 x86, presumably due to
3350 overflows in int calculations in the display code.
3351 Also, if buffers had long lines, Emacs would freeze.
3352 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3353 (set_window_hscroll): New function, containing the old guts of
3354 Fset_window_hscroll. Return the clipped value.
3355 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3356 This avoids the need to check against PTRDIFF_MAX.
3357
3358 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3359
3360 2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3361
3362 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3363
3364 2012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3365
3366 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3367 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3368 since GCC 4.4.6 issues a bogus warning for them.
3369
3370 Fix bugs in file timestamp newness comparisons.
3371 * fileio.c (Ffile_newer_than_file_p):
3372 * lread.c (Fload): Use full timestamp resolution of files,
3373 not just the 1-second resolution, so that files that are only
3374 slightly newer still count as newer.
3375 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3376 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3377
3378 2012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3379
3380 * fileio.c: Improve handling of file time marker. (Bug#11852)
3381 (special_mtime): New function.
3382 (Finsert_file_contents, Fverify_visited_file_modtime):
3383 Use it to set special mtime values consistently.
3384
3385 2012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3386
3387 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3388 marker for non-existing file. (Bug#11852)
3389
3390 2012-07-03 Glenn Morris <rgm@gnu.org>
3391
3392 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3393 and did not make it into globals.h).
3394
3395 2012-07-03 Tom Tromey <tromey@redhat.com>
3396
3397 * window.c (Fset_window_margins, Fset_window_fringes)
3398 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3399 * textprop.c (Fprevious_property_change): No longer static.
3400 * syntax.c (Fsyntax_table_p): No longer static.
3401 * process.c (Fget_process, Fprocess_datagram_address): No longer
3402 static.
3403 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3404 * keyboard.c (Fcommand_execute): No longer static.
3405 Remove EXFUN.
3406 * insdel.c (Fcombine_after_change_execute): No longer static.
3407 * image.c (Finit_image_library): No longer static.
3408 * fileio.c (Fmake_symbolic_link): No longer static.
3409 * eval.c (Ffetch_bytecode): No longer static.
3410 * editfns.c (Fuser_full_name): No longer static.
3411 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3412 No longer static.
3413 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3414 static.
3415 * dired.c (Ffile_attributes): No longer static.
3416 * composite.c (Fcomposition_get_gstring): No longer static.
3417 * callproc.c (Fgetenv_internal): No longer static.
3418
3419 * ccl.h: Remove EXFUNs.
3420 * buffer.h: Remove EXFUNs.
3421 * dispextern.h: Remove EXFUNs.
3422 * intervals.h: Remove EXFUNs.
3423 * fontset.h: Remove EXFUN.
3424 * font.h: Remove EXFUNs.
3425 * dosfns.c (system_process_attributes): Remove EXFUN.
3426 * keymap.h: Remove EXFUNs.
3427 * lisp.h: Remove EXFUNs.
3428 * w32term.h: Remove EXFUNs.
3429 * window.h: Remove EXFUNs.
3430 * xsettings.h: Remove EXFUN.
3431 * xterm.h: Remove EXFUN.
3432
3433 2012-07-03 Glenn Morris <rgm@gnu.org>
3434
3435 * lisp.h (Frandom): Make it visible to C.
3436 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3437 buffer for invisible buffers. (Bug#1229)
3438
3439 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3440
3441 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3442 values which aren't power of 2.
3443 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3444 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
3445 accordingly.
3446
3447 2012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3448
3449 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3450
3451 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3452
3453 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3454
3455 * alloc.c (allocate_vector_block): Remove redundant
3456 calls to mallopt if DOUG_LEA_MALLOC is defined.
3457 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3458 avoid calls to mallopt if zero_vector is returned.
3459
3460 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3461
3462 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3463 is enabled, avoid dereferencing NULL current_sblock if
3464 running undumped.
3465
3466 2012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3467
3468 Cleanup basic buffer management.
3469 * buffer.h (struct buffer): Change layout to use generic vector
3470 marking code. Fix some comments. Change type of 'clip_changed'
3471 to bitfield. Remove unused #ifndef old.
3472 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3473 (GET_OVERLAYS_AT): Fix indentation.
3474 (for_each_per_buffer_object_at): New macro.
3475 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3476 (Fbuffer_local_variables): Use it.
3477 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3478 * alloc.c (allocate_buffer): Adjust to match new layout of
3479 struct buffer. Fix comment.
3480 (mark_overlay): New function.
3481 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3482 Lisp area of struct buffer.
3483 (mark_object): Use it. Adjust marking of misc objects
3484 and related comments.
3485
3486 2012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3487
3488 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3489 wrapper that is not needed because the wrapped code is a no-op (zero
3490 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3491 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3492
3493 2012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3494
3495 * alloc.c (mark_buffer): Simplify. Remove prototype.
3496 (mark_object): Add comment. Reorganize marking of vector-like
3497 objects. Use CHECK_LIVE for all vector-like objects except buffers
3498 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3499 Avoid redundant calls to mark_vectorlike for bool vectors.
3500
3501 2012-06-30 Glenn Morris <rgm@gnu.org>
3502
3503 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3504
3505 * epaths.in (PATH_SITELOADSEARCH): New.
3506 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3507 This is rather than relying on --enable-locallisppath elements
3508 having "site-lisp" in their names. (Bug#10208#25, 11658)
3509
3510 2012-06-30 Eli Zaretskii <eliz@gnu.org>
3511
3512 * w32proc.c (sys_select): Accept and ignore one more argument.
3513
3514 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3515
3516 * sysselect.h [DOS_NT]: Don't include sys/select.h.
3517 (pselect) [!MS_DOS]: Redirect to sys_select.
3518
3519 * sysdep.c: Don't include dos.h and dosfns.h.
3520
3521 * process.c (sys_select):
3522 * msdos.c (sys_select): Accept one more argument and ignore it.
3523
3524 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3525 adapt data types and code to that.
3526
3527 * dosfns.c:
3528 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3529 which clashes with the gnulib function of the same name.
3530
3531 2012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3532
3533 * font.c (font_style_to_value, font_style_symbolic)
3534 (font_prop_validate_style): Add type checks for values in
3535 font_style_table.
3536
3537 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3538 argument.
3539 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3540 uses.
3541
3542 2012-06-29 Eli Zaretskii <eliz@gnu.org>
3543
3544 * xdisp.c (try_window_id): Undo last change.
3545
3546 * w32.c (getwd): Adjust commentary about startup_dir.
3547 (init_environment): Always call sys_access, even in non-MSVC
3548 builds. Don't chdir to the directory of the Emacs executable.
3549 This undoes code from 1997 which was justified by the need to
3550 "avoid conflicts when removing and renaming directories". But its
3551 downside was that every relative file name was being interpreted
3552 relative to the directory of the Emacs executable, which can never
3553 be TRT. In particular, it broke sys_access when called with
3554 relative file names.
3555 (sys_access): Map GetLastError to errno.
3556
3557 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3558
3559 * window.h (struct window): Change type of 'fringes_outside_margins'
3560 to bitfield. Fix comment. Adjust users accordingly.
3561 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
3562 Adjust comment.
3563 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3564 to ptrdiff_t.
3565
3566 2012-06-29 Andreas Schwab <schwab@linux-m68k.org>
3567
3568 * gnutls.c (emacs_gnutls_handshake):
3569 Add QUIT to make the loop interruptible.
3570
3571 2012-06-29 Glenn Morris <rgm@gnu.org>
3572
3573 * charset.c (init_charset): Make lack of etc/charsets fatal.
3574
3575 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3576
3577 * editfns.c (region_limit): Fix type mismatch.
3578
3579 2012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3580
3581 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3582 undefined. Convert from xassert to eassert.
3583 * nsmenu.m: Convert from xassert to eassert.
3584 * nsterm.m: Likewise.
3585
3586 2012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3587
3588 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3589
3590 2012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3591
3592 Avoid integer overflow on scroll-left and scroll-right.
3593 * window.c (HSCROLL_MAX): New macro.
3594 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3595 overflow when requested scroll falls outside ptrdiff_t range.
3596
3597 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3598
3599 * window.h (struct window): Change type of 'hscroll',
3600 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3601 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3602 Adjust users accordingly.
3603 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3604 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3605 from EMACS_INT to ptrdiff_t.
3606 (make_window): Omit redundant initialization.
3607
3608 2012-06-28 Juanma Barranquero <lekktu@gmail.com>
3609
3610 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3611
3612 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3613
3614 * window.h (struct window): Change type of 'use_time' and
3615 'sequence_number' from Lisp_Object to int.
3616 * frame.c (make_frame): Adjust users accordingly.
3617 * print.c (print_object): Likewise.
3618 * window.c (select_window, Fwindow_use_time, make_parent_window)
3619 (make_window): Likewise.
3620
3621 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3622
3623 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3624 enabled with --enable-checking=[all,glyphs] configure option.
3625 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3626 adjust comments accordingly.
3627 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3628 undefined, adjust comments accordingly.
3629 * image.c: Likewise.
3630 * scroll.c: Likewise.
3631 * w32fns.c: Likewise.
3632 * w32term.c: Likewise.
3633 * xdisp.c: Likewise.
3634 * xfaces.c: Likewise.
3635 * xfns.c: Likewise.
3636 * xterm.c: Likewise.
3637
3638 2012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3639
3640 Generalize run-time debugging checks.
3641 * dispextern.h (XASSERTS): Remove.
3642 * fontset.c (xassert): Remove.
3643 Convert from xassert to eassert.
3644 * alloc.c: Convert from xassert to eassert.
3645 * bidi.c: Likewise.
3646 * dispnew.c: Likewise.
3647 * fns.c: Likewise.
3648 * fringe.c: Likewise.
3649 * ftfont.c: Likewise.
3650 * gtkutil.c: Likewise.
3651 * image.c: Likewise.
3652 * keyboard.c: Likewise.
3653 * menu.c: Likewise.
3654 * process.c: Likewise.
3655 * scroll.c: Likewise.
3656 * sound.c: Likewise.
3657 * term.c: Likewise.
3658 * w32console.c: Likewise.
3659 * w32fns.c: Likewise.
3660 * w32term.c: Likewise.
3661 * window.c: Likewise.
3662 * xdisp.c: Likewise.
3663 * xfaces.c: Likewise.
3664 * xfns.c: Likewise.
3665 * xselect.c: Likewise.
3666 * xterm.c: Likewise.
3667
3668 2012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3669
3670 * fns.c (maybe_resize_hash_table): Output message when growing the
3671 purify-hashtable.
3672
3673 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3674
3675 * alloc.c (allocate_string_data): Remove dead code.
3676 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3677 avoid GCC warning about unused macro.
3678
3679 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3680
3681 * alloc.c (allocate_string): Omit intervals initialization.
3682 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3683 as in make_pure_string and make_pure_c_string.
3684
3685 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3686
3687 * alloc.c (allocate_string): Fix last change.
3688
3689 2012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3690
3691 * alloc.c (allocate_string): Remove two redundant calls
3692 to memset, add explicit initialization where appropriate.
3693
3694 2012-06-27 Glenn Morris <rgm@gnu.org>
3695
3696 * lisp.mk (lisp): Remove paths.elc.
3697
3698 2012-06-27 Chong Yidong <cyd@gnu.org>
3699
3700 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3701
3702 2012-06-26 John Wiegley <johnw@newartisans.com>
3703
3704 * unexmacosx.c (copy_data_segment): Add two section names used
3705 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3706
3707 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3708 when building with Clang.
3709
3710 2012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3711
3712 * eval.c (Fapply): Allow calling it with a single argument.
3713
3714 2012-06-26 Eli Zaretskii <eliz@gnu.org>
3715
3716 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3717 _stricmp and _strnicmp.
3718 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3719
3720 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3721
3722 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3723 allocated window.
3724 (allocate_process): Likewise for new process.
3725 (allocate_terminal): Change to use offsetof.
3726 (allocate_frame): Likewise.
3727 * frame.c (make_frame): Omit redundant initialization.
3728 * window.c (make_parent_window): Use memset.
3729 (make_window): Omit redundant initialization.
3730 * process.c (make_process): Omit redundant initialization.
3731 * terminal.c (create_terminal): Likewise.
3732
3733 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3734
3735 * term.c (delete_tty): Remove redundant call to memset.
3736
3737 2012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3738
3739 * alloc.c: Remove build_string.
3740 * lisp.h: Define build_string as static inline. This provides
3741 a better opportunity to optimize away calls to strlen when the
3742 function is called with compile-time constant argument.
3743 * image.c (imagemagick_error): Convert to build_string.
3744 * w32proc.c (sys_spawnve): Likewise.
3745 * xterm.c (x_term_init): Likewise.
3746
3747 2012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3748
3749 Use sprintf return value instead of invoking strlen on result.
3750 In the old days this wasn't portable, since some sprintf
3751 implementations returned char *. But they died out years ago and
3752 Emacs already assumes sprintf returns int.
3753 Similarly for float_to_string.
3754 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3755 * ccl.c (ccl_driver):
3756 * character.c (string_escape_byte8):
3757 * data.c (Fnumber_to_string):
3758 * doprnt.c (doprnt):
3759 * print.c (print_object):
3760 * xdisp.c (message_dolog):
3761 * xfns.c (syms_of_xfns):
3762 Use sprintf or float_to_string result to avoid need to call strlen.
3763 * data.c (Fnumber_to_string):
3764 Use make_unibyte_string, since the string must be ASCII.
3765 * lisp.h, print.c (float_to_string): Now returns int length.
3766 * term.c (produce_glyphless_glyph):
3767 Use sprintf result rather than recomputing it.
3768
3769 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3770 * Makefile.in (ALL_CFLAGS):
3771 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3772 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3773
3774 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3775
3776 * dispextern.h (xstrcasecmp): Define to library function
3777 strcasecmp if available.
3778 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3779
3780 2012-06-25 Andreas Schwab <schwab@linux-m68k.org>
3781
3782 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3783 Avoid comma operator.
3784 * menu.c (push_submenu_start, push_submenu_end)
3785 (push_left_right_boundary, push_menu_pane): Likewise.
3786 * msdos.c (dos_rawgetc): Likewise.
3787
3788 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3789
3790 * xfns.c (xic_create_fontsetname): Remove redundant calls
3791 to memset.
3792
3793 2012-06-25 Paul Eggert <eggert@cs.ucla.edu>
3794
3795 * gtkutil.c (get_utf8_string): Remove redundant assignment.
3796 sprintf already null-terminates its output.
3797
3798 * xfns.c (x_window): Remove redundant cast.
3799
3800 2012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3801
3802 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3803 `const char *' to `char *' to avoid compiler warning.
3804
3805 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3806
3807 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3808 instead of truncating it to 63 (admittedly a generous limit).
3809
3810 * process.c: Fix spelling and caps in comments.
3811
3812 2012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
3813
3814 * emacs.c (setpgrp): Remove definition, unused.
3815 * sysdep.c (setpgrp): Remove definition, not used in this file.
3816
3817 2012-06-24 Juanma Barranquero <lekktu@gmail.com>
3818
3819 * makefile.w32-in: Update dependencies.
3820
3821 2012-06-24 Eli Zaretskii <eliz@gnu.org>
3822
3823 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3824 (SYSTIME_H): Add nt/inc/sys/time.h.
3825
3826 * systime.h [WINDOWSNT]: Include sys/time.h.
3827
3828 * s/ms-w32.h (struct timespec): Definition moved from
3829 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3830
3831 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3832
3833 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
3834 * buffer.h (buffer_slot_type_mismatch):
3835 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3836 * eval.c (unwind_to_catch):
3837 * image.c (my_png_error, my_error_exit):
3838 * keyboard.c (quit_throw_to_read_char, user_error)
3839 (Fexit_recursive_edit, Fabort_recursive_edit):
3840 * lisp.h (die, args_out_of_range, args_out_of_range_3)
3841 (wrong_type_argument, buffer_overflow, __executable_start)
3842 (memory_full, buffer_memory_full, string_overflow, Fthrow)
3843 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3844 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3845 (fatal):
3846 (child_setup) [!DOS_NT]:
3847 * lread.c (end_of_file_error, invalid_syntax):
3848 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3849 * puresize.h (pure_write_error):
3850 * search.c (matcher_overflow):
3851 * sound.c (sound_perror, alsa_sound_perror):
3852 * sysdep.c, syssignal.h (croak):
3853 * term.c (maybe_fatal, vfatal):
3854 * textprop.c (text_read_only):
3855 * undo.c (user_error):
3856 * unexmacosx.c (unexec_error):
3857 * xterm.c (x_ins_del_lines, x_delete_glyphs):
3858 Use _Noreturn rather than NO_RETURN.
3859 No need for separate decl merely because of _Noreturn.
3860 * sound.c (sound_warning, parse_sound):
3861 Remove unnecessary forward decls.
3862
3863 2012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3864
3865 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3866 * lisp.h (WAIT_READING_MAX): New macro.
3867 * dispnew.c (Fsleep_for, sit_for):
3868 * keyboard.c (kbd_buffer_get_event):
3869 * process.c (Faccept_process_output):
3870 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3871 This improves on the previous patch, which introduced a bug
3872 when time_t is unsigned and as wide as intmax_t.
3873 See <http://bugs.gnu.org/9000#51>.
3874
3875 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3876
3877 * dispnew.c (sit_for, Fsleep_for):
3878 * keyboard.c (kbd_buffer_get_event):
3879 * process.c (Faccept_process_output): Avoid compiler warnings when
3880 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3881
3882 2012-06-23 Juanma Barranquero <lekktu@gmail.com>
3883
3884 * makefile.w32-in: Update dependencies.
3885
3886 * w32.c (ltime): Add return type and declare static.
3887 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3888
3889 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3890
3891 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
3892 Privately reported by Herbert J. Skuhra.
3893 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
3894 All uses changed.
3895 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
3896 not make_lisp_timeval, when the argument is of type EMACS_TIME.
3897
3898 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3899
3900 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
3901 last argument of make_unibyte_string.
3902
3903 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
3904 language ID in the event parameters.
3905
3906 * w32term.c (w32_read_socket): Put the new keyboard codepage into
3907 event.code, not the obscure "character set ID".
3908
3909 2012-06-23 Chong Yidong <cyd@gnu.org>
3910
3911 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
3912
3913 2012-06-23 Eli Zaretskii <eliz@gnu.org>
3914
3915 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
3916 * w32.c (fdutimens): New function.
3917
3918 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
3919
3920 * s/ms-w32.h (pselect): Redirect to sys_select.
3921
3922 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
3923
3924 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
3925 in the logic of incrementing and decrementing the value of
3926 use_relocatable_buffers.
3927
3928 2012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3929
3930 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
3931 Privately reported by Herbert J. Skuhra.
3932 [__FreeBSD__]: Remove "*/" typo after "#include".
3933 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
3934 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
3935 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
3936 Don't assume EMACS_TIME and struct timeval are the same type.
3937
3938 2012-06-22 Paul Eggert <eggert@cs.ucla.edu>
3939
3940 Support higher-resolution time stamps (Bug#9000).
3941 The time stamps are only nanosecond-resolution at the C level,
3942 since that's the best that any real-world system supports now.
3943 But they are picosecond-resolution at the Lisp level, as that's
3944 easy, and leaves room for future OS improvements.
3945
3946 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
3947 (LIBES): Use it.
3948
3949 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
3950 Don't get current time unless it's needed.
3951
3952 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
3953 now provides it if it's absent.
3954 (start_atimer): Port to higher-res time stamps.
3955 Check for time stamp overflow. Don't get current time more
3956 often than is needed.
3957
3958 * buffer.h (struct buffer): Buffer modtime now has high resolution.
3959 Include systime.h, not time.h.
3960 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
3961
3962 * dired.c: Include stat-time.h.
3963 (Ffile-attributes): File times now have higher resolution.
3964
3965 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
3966 (struct image): Timestamp now has higher resolution.
3967
3968 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
3969 has at least microseconds now. All uses removed.
3970 (update_frame, update_single_window, update_window, update_frame_1)
3971 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
3972 (duration_to_sec_usec): Remove; no longer needed.
3973
3974 * editfns.c (time_overflow): Now extern.
3975 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
3976 (float-time, Fformat_time_string, Fcurrent_time_string)
3977 (Fcurrent_time_zone): Accept and generate higher-resolution
3978 time stamps.
3979 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
3980 (decode_time_components, lisp_seconds_argument): New functions.
3981 (make_time): Now static.
3982 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
3983 Report an error if the time is invalid, rather than having the caller
3984 do that.
3985
3986 * fileio.c: Include <stat-time.h>
3987 (Fcopy_file): Copy higher-resolution time stamps.
3988 Prefer to set the time stamp via a file descriptor if that works.
3989 (Fset_file_times, Finsert_file_contents, Fwrite_region)
3990 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
3991 (Fvisited_file_modtime, Fset_visited_file_modtime):
3992 Support higher-resolution time stamps.
3993
3994 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
3995
3996 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
3997
3998 * image.c (prepare_image_for_display, clear_image_cache)
3999 (lookup_image): Port to higer-resolution time stamps.
4000
4001 * keyboard.c (start_polling, bind_polling_period):
4002 Check for time stamp overflow.
4003 (read_char, kbd_buffer_get_event, timer_start_idle)
4004 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4005 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4006 Port to higher-resolution time stamps. Do not assume time_t is signed.
4007 (decode_timer): New function. Timers are now vectors of length 9,
4008 not 8, to accommodate the picosecond component.
4009 (timer_check_2): Use it.
4010
4011 * nsterm.m (select_timeout, timeval_subtract): Remove.
4012 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4013 as they're a bit more accurate and handle overflow better.
4014 (ns_select): Change prototype to be compatible with pselect.
4015 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4016 * nsterm.h (ns_select): Adjust prototype.
4017
4018 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4019 us-resolution time stamps.
4020 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4021
4022 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4023
4024 * lisp.h (time_overflow): New decl.
4025 (wait_reading_process_output): First arg is now intmax_t, not int,
4026 to accommodate larger waits.
4027
4028 * process.h (struct Lisp_Process.read_output_delay):
4029 Now counts nanoseconds, not microseconds.
4030 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4031 EMACS_HAS_USECS.
4032 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4033 (wait_reading_process_output):
4034 Port to ns-resolution time stamps.
4035 (Faccept_process_output, wait_reading_process_output):
4036 Check for time stamp overflow. Do not assume time_t is signed.
4037 (select_wrapper): Remove; we now use pselect.
4038 (Fprocess_attributes): Now generates ns-resolution time stamps.
4039
4040 * sysdep.c: Include utimens.h. Don't include utime.h
4041 or worry about struct utimbuf; gnulib does that for us now.
4042 (gettimeofday): Remove; gnulib provides a substitute.
4043 (make_timeval): New function.
4044 (set_file_times): Now sets ns-resolution time stamps.
4045 New arg FD; all uses changed.
4046 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4047 (system_process_attributes):
4048 Now returns ns-resolution time stamp. All uses changed.
4049 Check for time stamp overflow.
4050
4051 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4052 provides a substitute now.
4053
4054 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4055 since it guarantees struct timespec.
4056 (EMACS_TIME): Now struct timespec, so that we can support
4057 ns-resolution time stamps.
4058 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4059 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4060 (EMACS_USECS): Remove.
4061 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4062 so multiply the arg by 1000 before storing it.
4063 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4064 New macros.
4065 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4066 Port to ns-resolution time stamps.
4067 (EMACS_TIME_NEG_P): Remove; replaced by....
4068 (EMACS_TIME_SIGN): New macro.
4069 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4070 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4071 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4072 (make_timeval, make_lisp_time, decode_time_components): New decls.
4073 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4074 that it mishandled time_t overflow. You can't compare by subtracting!
4075 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4076 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4077
4078 * term.c: Include <sys/time.h>.
4079 (timeval_to_Time): New function, for proper overflow wraparound.
4080 (term_mouse_position, term_mouse_click): Use it.
4081
4082 * undo.c (record_first_change): Support higher-resolution time stamps
4083 in the undo buffer.
4084 (Fprimitive_undo): Use them when restoring time stamps.
4085
4086 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4087 (w32_get_internal_run_time):
4088 Port to higher-resolution Emacs time stamps.
4089 (ltime): Now accepts single 64-bit integer, as that's more convenient
4090 for callers.
4091
4092 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4093
4094 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4095 for compatibility with pselect. Support ns-resolution time stamps.
4096
4097 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4098
4099 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4100 Check for time stamp overflow, and support ns-resolution time stamps.
4101
4102 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4103 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4104 (timeval_subtract): Remove; no longer needed.
4105 (XTflash, XTring_bell, x_wait_for_event):
4106 Port to ns-resolution time stamps. Don't assume time_t is signed.
4107
4108 2012-06-22 Chong Yidong <cyd@gnu.org>
4109
4110 * xdisp.c (x_consider_frame_title): Revert last change.
4111
4112 2012-06-22 Eli Zaretskii <eliz@gnu.org>
4113
4114 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4115 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4116 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4117 staticidx goes up to 1597 out of 1600 = 0x640.)
4118
4119 2012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4120
4121 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4122 Otherwise, the umask might be mistakenly 0 while handling input signals.
4123
4124 2012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4125
4126 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4127
4128 2012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4129
4130 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4131 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4132 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4133 access to `contents' member of Lisp_Vector objects with AREF and ASET
4134 where appropriate.
4135
4136 2012-06-19 Chong Yidong <cyd@gnu.org>
4137
4138 * frame.c (delete_frame): When selecting a frame on a different
4139 text terminal, do not alter the terminal's top-frame.
4140
4141 * xdisp.c (format_mode_line_unwind_data): Record the target
4142 frame's selected window and its terminal's top-frame.
4143 (unwind_format_mode_line): Restore them.
4144 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4145 Callers changed.
4146 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4147 since tty frames can be explicitly named.
4148 (prepare_menu_bars): Likewise.
4149
4150 * term.c (Ftty_top_frame): New function.
4151
4152 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4153
4154 Port byte-code-meter to modern targets.
4155 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4156 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
4157 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
4158 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4159 (METER_1, METER_2): Simplify.
4160
4161 2012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4162
4163 * data.c (Fdefalias): Return `symbol' (bug#11686).
4164
4165 2012-06-18 Martin Rudalics <rudalics@gmx.at>
4166
4167 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
4168 gets killed during executing of this function (Bug#11665).
4169 Try to always return Qt when the buffer has been actually killed.
4170 (Vkill_buffer_query_functions): In doc-string say that functions
4171 run by this hook should not change the current buffer.
4172
4173 2012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4174
4175 Fix recently-introduced process.c problems found by static checking.
4176 * process.c (write_queue_push, write_queue_pop, send_process):
4177 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4178 (write_queue_pop): Fix pointer signedness problem.
4179 (send_process): Remove unused local.
4180
4181 2012-06-17 Chong Yidong <cyd@gnu.org>
4182
4183 * xdisp.c (redisplay_internal): No need to redisplay terminal
4184 frames that are not on top.
4185
4186 2012-06-17 Troels Nielsen <bn.troels@gmail.com>
4187
4188 * process.c (make_process): Initialize write_queue.
4189 (write_queue_push, write_queue_pop): New functions.
4190 (send_process): Use them to maintain correct ordering of process
4191 writes (Bug#10815).
4192
4193 2012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4194
4195 * lisp.h (eassert): Assume C89 or later.
4196 This removes the need for CHECK.
4197 (CHECK): Remove. Its comments about always evaluating its
4198 argument were confusing, as 'eassert' typically does not evaluate
4199 its argument.
4200
4201 * coding.c (produce_chars): Use ptrdiff_t, not int.
4202
4203 * xterm.c (x_draw_underwave): Check for integer overflow.
4204 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4205
4206 2012-06-17 Jan Djärv <jan.h.d@swipnet.se>
4207
4208 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4209 referenced (Bug#11583).
4210
4211 2012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4212
4213 Implement wave-style variant of underlining.
4214 * dispextern.h (face_underline_type): New enum.
4215 (face): Add field for underline type.
4216 * nsterm.m (ns_draw_underwave): New function.
4217 (ns_draw_text_decoration): Use it.
4218 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4219 New functions.
4220 (x_draw_glyph_string): Use them.
4221 * xfaces.c (Qline, Qwave): New Lisp objects.
4222 (check_lface_attrs, merge_face_ref)
4223 (Finternal_set_lisp_face_attribute, realize_x_face):
4224 Handle wave-style underline face attributes.
4225 * xterm.c (x_draw_underwave): New function.
4226 (x_draw_glyph_string): Use it.
4227
4228 2012-06-16 Juanma Barranquero <lekktu@gmail.com>
4229
4230 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4231 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4232 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4233 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4234 ($(BLD)/w32select.$(O)): Update dependencies.
4235
4236 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4237
4238 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4239 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4240 * character.c (_fetch_multibyte_char_p): Remove.
4241 * alloc.c: Include "character.h" before "buffer.h".
4242 * bidi.c: Likewise.
4243 * buffer.c: Likewise.
4244 * bytecode.c: Likewise.
4245 * callint.c: Likewise.
4246 * callproc.c: Likewise.
4247 * casefiddle.c: Likewise.
4248 * casetab.c: Likewise.
4249 * category.c: Likewise.
4250 * cmds.c: Likewise.
4251 * coding.c: Likewise.
4252 * composite.c: Likewise.
4253 * dired.c: Likewise.
4254 * dispnew.c: Likewise.
4255 * doc.c: Likewise.
4256 * dosfns.c: Likewise.
4257 * editfns.c: Likewise.
4258 * emacs.c: Likewise.
4259 * fileio.c: Likewise.
4260 * filelock.c: Likewise.
4261 * font.c: Likewise.
4262 * fontset.c: Likewise.
4263 * fringe.c: Likewise.
4264 * indent.c: Likewise.
4265 * insdel.c: Likewise.
4266 * intervals.c: Likewise.
4267 * keyboard.c: Likewise.
4268 * keymap.c: Likewise.
4269 * lread.c: Likewise.
4270 * macros.c: Likewise.
4271 * marker.c: Likewise.
4272 * minibuf.c: Likewise.
4273 * nsfns.m: Likewise.
4274 * nsmenu.m: Likewise.
4275 * print.c: Likewise.
4276 * process.c: Likewise.
4277 * regex.c: Likewise.
4278 * region-cache.c: Likewise.
4279 * search.c: Likewise.
4280 * syntax.c: Likewise.
4281 * term.c: Likewise.
4282 * textprop.c: Likewise.
4283 * undo.c: Likewise.
4284 * unexsol.c: Likewise.
4285 * w16select.c: Likewise.
4286 * w32fns.c: Likewise.
4287 * w32menu.c: Likewise.
4288 * window.c: Likewise.
4289 * xdisp.c: Likewise.
4290 * xfns.c: Likewise.
4291 * xmenu.c: Likewise.
4292 * xml.c: Likewise.
4293 * xselect.c: Likewise.
4294
4295 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4296
4297 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4298 If all the glyphs of the glyph row came from strings, and we have no
4299 cursor positioning clues, put the cursor on the first glyph of the
4300 row.
4301 (handle_face_prop): Use chunk-relative overlay string index when
4302 indexing into it->string_overlays array. (Bug#11653)
4303 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4304 the rightmost. (Bug#11720)
4305
4306 2012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4307
4308 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4309 (CATEGORY_MEMBER): Enforce 1/0 value.
4310 * category.c (_temp_category_set): Remove.
4311
4312 2012-06-16 Eli Zaretskii <eliz@gnu.org>
4313
4314 * window.c (Fdelete_other_windows_internal)
4315 (Fdelete_window_internal): Don't access frame's mouse highlight
4316 info of the initial frame. (Bug#11677)
4317
4318 2012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4319
4320 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4321 Assume USE_2_TAGS_FOR_INTS.
4322 (xreload): Adjust $tagmask width to match recent lisp.h change.
4323
4324 Simplify lisp.h in minor ways that should not affect code.
4325 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4326 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4327 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4328 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4329 (INTTYPEBITS): New macro, for clarity.
4330 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
4331 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4332 Simplify now that USE_LSB_TAG is always defined.
4333 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4334 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4335
4336 2012-06-13 Juanma Barranquero <lekktu@gmail.com>
4337
4338 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4339
4340 2012-06-13 Glenn Morris <rgm@gnu.org>
4341
4342 * s/bsd-common.h (BSD4_3):
4343 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4344
4345 2012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4346
4347 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4348 instead of union.
4349 (XLI, XIL): Define.
4350 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4351 Use them.
4352 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
4353 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
4354 * alloc.c (widen_to_Lisp_Object): Remove.
4355 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4356 * frame.c (delete_frame): Remove outdated comment.
4357 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4358 USE_LISP_UNION_TYPE.
4359 (Fw32_unregister_hot_key): Likewise.
4360 (Fw32_toggle_lock_key): Likewise.
4361 * w32menu.c (add_menu_item): Likewise.
4362 (w32_menu_display_help): Use XIL instead of checking
4363 USE_LISP_UNION_TYPE.
4364 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4365 (init_heap): Likewise.
4366 * w32term.c (w32_read_socket): Update comment.
4367
4368 2012-06-13 Glenn Morris <rgm@gnu.org>
4369
4370 * s/usg5-4-common.h, src/s/unixware.h:
4371 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4372
4373 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4374
4375 2012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4376
4377 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4378 * alloc.c (make_number) [!defined make_number]:
4379 Remove, as lisp.h always defines this now.
4380 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4381 (roundup_size): Verify that it is a power of 2.
4382 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4383 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4384 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4385 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4386 USE_LSB_TAG now is always defined to be either 0 or 1.
4387 All uses changed.
4388 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4389 code works fine either way, and efficiency is not a concern here,
4390 as the union type is for debugging, not for production.
4391 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4392 Use an inline function on all platforms when using the union type,
4393 since this is simpler and 'static inline' can be used portably
4394 within Emacs now.
4395 (LISP_INITIALLY_ZERO): New macro.
4396 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4397 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4398
4399 2012-06-12 Glenn Morris <rgm@gnu.org>
4400
4401 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4402
4403 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
4404
4405 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4406 Move BROKEN_SIGIO to configure.
4407
4408 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4409 Move NO_TERMIO to configure.
4410
4411 2012-06-12 Chong Yidong <cyd@gnu.org>
4412
4413 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4414 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4415 MagickExportImagePixels is undefined.
4416
4417 2012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4418
4419 * image.c (imagemagick_load_image): Remove unused label.
4420
4421 2012-06-11 Glenn Morris <rgm@gnu.org>
4422
4423 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4424 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4425 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4426 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4427
4428 2012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4429
4430 * alloc.c (make_byte_code): New function.
4431 (Fmake_byte_code): Use it. Don't purify here.
4432 * lread.c (read1): Use it as well to avoid extra allocation.
4433
4434 2012-06-11 Chong Yidong <cyd@gnu.org>
4435
4436 * image.c (imagemagick_load_image): Implement transparency.
4437
4438 2012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4439
4440 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4441 account for preceding backslashes. (Bug#11663)
4442
4443 2012-06-09 Chong Yidong <cyd@gnu.org>
4444
4445 * term.c: Support italics in capable terminals (Bug#9652).
4446 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4447 (turn_on_face): Output using TS_enter_italic_mode if available.
4448 Don't handle unused blinking and alt-charset cases.
4449 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4450 and tty_alt_charset_p cases.
4451 (tty_capable_p, init_tty): Support italics.
4452
4453 * termchar.h (struct tty_display_info): Add field for italics.
4454 Remove unused blink field.
4455
4456 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4457 Handle slant.
4458
4459 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4460 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4461 tty_alt_charset_p. Add tty_italic_p.
4462
4463 2012-06-09 Michael Albinus <michael.albinus@gmx.de>
4464
4465 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4466 dbus_type_is_basic if available.
4467 (xd_extract_signed, xd_extract_unsigned): Rename from
4468 extract_signed and extract_unsigned, respectively. Adapt callers.
4469
4470 2012-06-09 Chong Yidong <cyd@gnu.org>
4471
4472 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4473
4474 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4475 case (Bug#9752).
4476
4477 2012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4478
4479 * xdisp.c (vmessage): Treat frame message as multibyte.
4480 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4481 would generate the diagnostic "Making \302\247 buffer-local while
4482 let-bound!".
4483
4484 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4485
4486 * dispnew.c (showing_window_margins_p): Undo last change, which
4487 was done due to an inadvertent commit.
4488 (adjust_frame_glyphs_for_frame_redisplay): Do call
4489 showing_window_margins_p.
4490
4491 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4492
4493 * eval.c (Fmake_var_non_special): New primitive.
4494 (syms_of_eval): Defsubr it.
4495 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4496
4497 2012-06-08 Juanma Barranquero <lekktu@gmail.com>
4498
4499 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4500 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4501
4502 2012-06-08 Eli Zaretskii <eliz@gnu.org>
4503
4504 * alloc.c (allocate_vectorlike): Fix last change.
4505
4506 2012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4507
4508 Block-based vector allocation of small vectors.
4509 * lisp.h (struct vectorlike_header): New field `nbytes',
4510 adjust comment accordingly.
4511 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4512 to denote vector blocks. Adjust users (live_vector_p,
4513 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4514 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4515 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4516 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4517 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4518 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4519 (roundup_size): New constant.
4520 (struct vector_block): New data type.
4521 (vector_blocks, vector_free_lists, zero_vector): New variables.
4522 (all_vectors): Rename to `large_vectors'.
4523 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4524 (sweep_vectors): New functions.
4525 (allocate_vectorlike): Return `zero_vector' as the only vector of
4526 0 items. Allocate new vector from block if vector size is less than
4527 or equal to VBLOCK_BYTES_MAX.
4528 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4529 (init_alloc_once): Add call to init_vectors.
4530
4531 2012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4532
4533 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4534
4535 2012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4536
4537 * doprnt.c (doprnt): Truncate multibyte char correctly.
4538 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4539 would mishandle a string argument "Xc" if X was a multibyte
4540 character of length 2: it would truncate after X's first byte
4541 rather than including all of X.
4542
4543 2012-06-06 Chong Yidong <cyd@gnu.org>
4544
4545 * buffer.c (word_wrap): Doc fix.
4546
4547 2012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4548
4549 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4550
4551 2012-06-03 Glenn Morris <rgm@gnu.org>
4552
4553 * xdisp.c (tool-bar-style): Doc fix.
4554
4555 2012-06-03 Ulrich Müller <ulm@gentoo.org>
4556
4557 * Makefile.in (PAXCTL): Define.
4558 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4559 binary via PaX flags if the paxctl utility is available.
4560 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4561 Restore PaX flags to their default. (Bug#11398)
4562
4563 2012-06-03 Chong Yidong <cyd@gnu.org>
4564
4565 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4566 buffer (Bug#11226).
4567
4568 2012-06-03 Chong Yidong <cyd@gnu.org>
4569
4570 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4571 (note_mode_line_or_margin_highlight): If there is no help echo,
4572 use mode-line-default-help-echo. Handle the case where the mouse
4573 position is past the end of the mode line string.
4574
4575 * buffer.c (buffer_local_value_1): New function, split from
4576 Fbuffer_local_value; can return Qunbound.
4577 (Fbuffer_local_value): Use it.
4578 (Vmode_line_format): Docstring tweaks.
4579
4580 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4581
4582 * sysdep.c (system_process_attributes): Improve comment.
4583
4584 2012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4585
4586 * keyboard.c: Export real-this-command to Elisp.
4587 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4588 and DEFVAR it. Update all users.
4589
4590 2012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4591
4592 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4593
4594 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4595 Convert pctcpu and pctmem to Lisp float properly.
4596 Let the compiler fold better, as 100.0/0x8000 is exact.
4597
4598 2012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4599
4600 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4601 cons_block.
4602
4603 2012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4604
4605 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4606
4607 2012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4608
4609 For a 'struct window', replace some Lisp_Object fields to
4610 bitfields where appropriate, remove unused fields.
4611 * window.h (struct window): Remove unused 'last_mark_x' and
4612 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4613 change it's type from Lisp_Object to bitfield.
4614 Change type of 'force_start', 'optional_new_start',
4615 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4616 fields from Lisp_Object to bitfield. Adjust users accordingly.
4617
4618 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4619
4620 Pacify gcc -Wdouble-precision when using Xaw.
4621 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4622 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4623 Use 'float' consistently, rather than 'float' in most places
4624 and 'double' in a couple of places.
4625
4626 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4627
4628 * xdisp.c (handle_stop): Detect whether we have overlay strings
4629 loaded by testing it->current.overlay_string_index to be
4630 non-negative, instead of checking whether n_overlay_strings is
4631 positive. (Bug#11587)
4632
4633 2012-05-31 Chong Yidong <cyd@gnu.org>
4634
4635 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4636
4637 * doc.c (Fsubstitute_command_keys): Doc fix.
4638
4639 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4640
4641 * search.c (search_buffer): Remove calls to
4642 r_alloc_inhibit_buffer_relocation, as it is now called by
4643 maybe_unify_char, which was the cause of relocation of buffer text
4644 in bug#11519.
4645
4646 2012-05-31 Eli Zaretskii <eliz@gnu.org>
4647
4648 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4649 for the duration of call to load_charset, to avoid problems with
4650 callers of maybe_unify_char that access buffer text through C
4651 pointers.
4652
4653 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4654 decrement the inhibition flag, instead of just setting or
4655 resetting it.
4656
4657 2012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4658
4659 Remove obsolete '#define static' cruft.
4660 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4661 This #undef was "temporary" in 2000; it is no longer needed
4662 now that '#define static' has gone away.
4663 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4664 (gray_bitmap_bits): Remove; no longer needed.
4665 All uses replaced with definiens.
4666 * xterm.c: Include "bitmaps/gray.xbm".
4667
4668 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4669
4670 Clean up __executable_start, monstartup when --enable-profiling.
4671 The following changes affect the code only when profiling.
4672 * dispnew.c (__executable_start): Rename from safe_bcopy.
4673 Define only on platforms that need it.
4674 * emacs.c: Include <sys/gmon.h> when profiling.
4675 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4676 (__executable_start): Remove decl, since lisp.h does it now.
4677 (safe_bcopy): Remove decl; no longer has that name.
4678 (main): Coalesce #if into single bit of code, for simplicity.
4679 Cast pointers to uintptr_t, since standard libraries want integers
4680 and not pointers.
4681 * lisp.h (__executable_start): New decl.
4682
4683 2012-05-31 Glenn Morris <rgm@gnu.org>
4684
4685 * image.c (Fimagemagick_types): Doc fix.
4686
4687 2012-05-30 Jim Meyering <meyering@redhat.com>
4688
4689 * callproc.c (Fcall_process_region): Include directory component
4690 in mkstemp error message (Bug#11586).
4691
4692 2012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 * alloc.c, lisp.h (make_pure_vector): Now static.
4695
4696 2012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4697
4698 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4699 Move to byte-run.el.
4700 (Fautoload): Do the hash-doc more carefully.
4701 * data.c (Fdefalias): Purify definition, except for keymaps.
4702 (Qdefun): Move from eval.c.
4703 * lisp.h (Qdefun): Remove.
4704 * lread.c (read1): Tiny simplification.
4705
4706 2012-05-29 Troels Nielsen <bn.troels@gmail.com>
4707
4708 Do not create empty overlays with the evaporate property (Bug#9642).
4709 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4710 Bug#9642, but explicitly check that the buffer the overlay would
4711 be moved to is live and rearrange lines to make sure that errors
4712 will not put the overlay in an inconsistent state.
4713 (Fdelete_overlay): Cosmetics.
4714
4715 2012-05-28 Eli Zaretskii <eliz@gnu.org>
4716
4717 * w32term.c (my_bring_window_to_top): New function.
4718 (x_raise_frame): Use handle returned by DeferWindowPos, which
4719 could be different from the original one.
4720 Call my_bring_window_to_top instead of my_set_foreground_window.
4721 (Bug#11513)
4722
4723 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4724 by calling BringWindowToTop.
4725
4726 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4727 (WM_EMACS_END): Increase by one.
4728
4729 2012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4730
4731 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4732 This avoids undefined behavior that might cause the eassert
4733 to not catch an out-of-range value.
4734
4735 2012-05-28 Juanma Barranquero <lekktu@gmail.com>
4736
4737 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4738 Update dependencies.
4739
4740 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4741
4742 * bidi.c (bidi_mirror_char): Fix last change.
4743
4744 2012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4745
4746 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4747 when referring to sectname field in printf format.
4748
4749 2012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4750
4751 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4752 Only r_alloc_inhibit_buffer_relocation needed to be added;
4753 the others were already declared.
4754
4755 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4756 before checking whether it's out of range. Put the check inside
4757 eassert. See
4758 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4759
4760 2012-05-27 Ken Brown <kbrown@cornell.edu>
4761
4762 * callproc.c (Fcall_process): Restore a line that was accidentally
4763 commented out in the 2011-02-13 change (bug#11547).
4764
4765 2012-05-27 Eli Zaretskii <eliz@gnu.org>
4766
4767 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4768 defined on ralloc.c.
4769
4770 * buffer.c [REL_ALLOC]: Remove prototypes of
4771 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4772 they are now on lisp.h.
4773
4774 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4775
4776 * search.c (search_buffer): Use it to inhibit relocation of buffer
4777 text while re_search_2 is doing its job, because re_search_2 is
4778 passed C pointers to buffer text. (Bug#11519)
4779
4780 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4781 Update value to 24.
4782
4783 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4784 state after an additional call to move_it_in_display_line_to, keep
4785 the values of it->max_ascent and it->max_descent found for the
4786 entire line.
4787 (pos_visible_p): Revert the comparison against bottom_y to what it
4788 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4789 (Bug#11464)
4790
4791 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4792
4793 Fix coding-related core dumps with gcc -ftrapv.
4794 The code was computing A - B, where A and B are pointers, and B is
4795 random garbage. This can lead to core dumps on platforms that
4796 have special pointer registers, and it also leads to core dumps on
4797 x86-64 when compiled with gcc -ftrapv. The fix is to compute
4798 A - B only when B is initialized properly.
4799 * coding.c (coding_set_source, coding_set_destination): Return void.
4800 (coding_change_source, coding_change_destinations): New functions,
4801 with the old behaviors of coding_set_source and coding_set_destination.
4802 All callers that need an offset changed to use these new functions.
4803
4804 2012-05-26 Glenn Morris <rgm@gnu.org>
4805
4806 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
4807
4808 2012-05-26 Eli Zaretskii <eliz@gnu.org>
4809
4810 Extend mouse support on W32 text-mode console.
4811 * xdisp.c (draw_row_with_mouse_face):
4812 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
4813
4814 * w32console.c: Include window.h.
4815 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4816 New functions.
4817 (initialize_w32_display): Initialize mouse-highlight data.
4818
4819 * w32inevt.c: Include termchar.h and window.h.
4820 (do_mouse_event): Support mouse-autoselect-window. When the mouse
4821 moves, call note_mouse_highlight. If help_echo changed, call
4822 gen_help_event to produce help-echo message in the echo area.
4823 Call clear_mouse_face if mouse_face_hidden is set in the mouse
4824 highlight info.
4825
4826 2012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4827
4828 * lread.c (read1): Simplify slightly to avoid an overflow warning
4829 with GCC 4.7.0 on x86-64.
4830
4831 2012-05-26 Eli Zaretskii <eliz@gnu.org>
4832
4833 * bidi.c (bidi_mirror_char): Revert last change: an int is
4834 definitely wide enough here.
4835
4836 2012-05-25 Paul Eggert <eggert@cs.ucla.edu>
4837
4838 Fix integer width and related bugs (Bug#9874).
4839 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
4840 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
4841 (string_bytes, check_sblock, allocate_string_data):
4842 (compact_small_strings, Fmake_bool_vector, make_string)
4843 (make_unibyte_string, make_multibyte_string)
4844 (make_string_from_bytes, make_specified_string)
4845 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4846 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4847 (mark_vectorlike):
4848 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4849 (allocate_pseudovector):
4850 Use int, not EMACS_INT, where int is wide enough.
4851 (inhibit_garbage_collection, Fgarbage_collect):
4852 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4853 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4854 int might not be wide enough.
4855 (bidi_cache_search, bidi_cache_find, bidi_init_it)
4856 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4857 (bidi_at_paragraph_end, bidi_find_paragraph_start)
4858 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4859 (bidi_level_of_next_char, bidi_move_to_visually_next):
4860 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4861 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4862 (Fkill_buffer, Fset_buffer_major_mode)
4863 (advance_to_char_boundary, Fbuffer_swap_text)
4864 (Fset_buffer_multibyte, overlays_at, overlays_in)
4865 (overlay_touches_p, struct sortvec, record_overlay_string)
4866 (overlay_strings, recenter_overlay_lists)
4867 (adjust_overlays_for_insert, adjust_overlays_for_delete)
4868 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4869 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4870 (Foverlay_recenter, last_overlay_modification_hooks_used)
4871 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4872 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4873 (validate_region): Omit unnecessary test for b <= e,
4874 since that's guaranteed by the previous test.
4875 (adjust_overlays_for_delete): Avoid pos + length overflow.
4876 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4877 (report_overlay_modification):
4878 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4879 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4880 Omit pointer cast, which isn't needed anyway, and doesn't work
4881 after the EMACS_INT -> ptrdiff_t change.
4882 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
4883 * buffer.h: Adjust decls to match defn changes elsewhere.
4884 (struct buffer_text, struct buffer):
4885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4886 Use EMACS_INT, not int, where int might not be wide enough.
4887 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4888 not int, to avoid needless 32-bit limit on 64-bit hosts.
4889 (exec_byte_code): Use tighter memory-full test, one that checks
4890 for alloca overflow. Don't compute the address of the object just
4891 before an array, as that's not portable. Use EMACS_INT, not
4892 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
4893 * callint.c (Fcall_interactively):
4894 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4895 * callproc.c (call_process_kill, Fcall_process):
4896 Don't assume pid_t fits into an Emacs fixnum.
4897 (call_process_cleanup, Fcall_process, child_setup):
4898 Don't assume pid_t fits into int.
4899 (call_process_cleanup, Fcall_process, delete_temp_file)
4900 (Fcall_process_region):
4901 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4902 (Fcall_process): Simplify handling of volatile integers.
4903 Use int, not EMACS_INT, where int will do.
4904 * casefiddle.c (casify_object, casify_region, operate_on_word)
4905 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4906 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4907 (casify_object): Avoid integer overflow when overallocating buffer.
4908 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
4909 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
4910 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
4911 * category.h (CATEGORYP): Don't assume arg is nonnegative.
4912 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
4913 integers are now checked earlier. All uses replaced with XINT.
4914 (ccl_driver):
4915 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4916 For CCL_MapSingle, check that content and value are in int range.
4917 (ccl_driver, Fregister_code_conversion_map):
4918 Check that Vcode_version_map_vector is a vector.
4919 (resolve_symbol_ccl_program): Check that vector header is in range.
4920 Always copy the vector, so that we can check its contents reliably
4921 now rather than having to recheck each instruction as it's being
4922 executed. Check that vector words fit in 'int'.
4923 (ccl_get_compiled_code, Fregister_ccl_program)
4924 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
4925 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
4926 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
4927 contents are in range.
4928 (Fccl_execute_on_string): Check that status is in range.
4929 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
4930 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
4931 Accept and return EMACS_INT, not int, because callers can pass values
4932 out of 'int' range.
4933 (c_string_width, strwidth, lisp_string_width, chars_in_text)
4934 (multibyte_chars_in_text, parse_str_as_multibyte)
4935 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
4936 (str_as_unibyte, str_to_unibyte, string_count_byte8)
4937 (string_escape_byte8, Fget_byte):
4938 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4939 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
4940 avoid mishandling large integers.
4941 * character.h: Adjust decls to match defn changes elsewhere.
4942 * charset.c (load_charset_map_from_file, find_charsets_in_text)
4943 (Ffind_charset_region):
4944 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4945 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
4946 (load_charset_map_from_vector, Fdefine_charset_internal):
4947 Don't assume fixnum fits in int.
4948 (load_charset_map_from_vector, Fmap_charset_chars):
4949 Remove now-unnecessary CHECK_NATNUMs.
4950 (Fdefine_charset_internal): Check ranges here, more carefully.
4951 Don't rely on undefined behavior with signed left shift overflow.
4952 Don't assume unsigned int fits into fixnum, or that fixnum fits
4953 into unsigned int. Don't require max_code to be a valid fixnum;
4954 that's not true for gb10830 4-byte on a 32-bit host. Allow
4955 invalid_code to be a cons, for the same reason. Require code_offset
4956 to be a character. Avoid int overflow if max_char is close
4957 to INT_MAX.
4958 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
4959 this is intended anyway and avoids some undefined behavior.
4960 (load_charset_map): Pass unsigned, not int, as 2nd arg of
4961 INDEX_TO_CODE_POINT, as that's what it expects.
4962 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
4963 * charset.h (DECODE_CHAR): Return int, not unsigned;
4964 this is what was intended anyway, and it avoids undefined behavior.
4965 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
4966 integer-overflow issues.
4967 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
4968 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
4969 where the argument is EMACS_INT, and this behavior is not intended.
4970 * chartab.c (Fmake_char_table, Fset_char_table_range)
4971 (uniprop_get_decoder, uniprop_get_encoder):
4972 Don't assume fixnum fits in int.
4973 * cmds.c (move_point): New function, that does the gist of
4974 Fforward_char and Fbackward_char, but does so while checking
4975 for integer overflow more accurately.
4976 (Fforward_char, Fbackward_char): Use it.
4977 (Fforward_line, Fend_of_line, internal_self_insert)
4978 (internal_self_insert):
4979 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4980 Fix a FIXME, by checking for integer overflow when calculating
4981 target_clm and actual_clm.
4982 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
4983 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
4984 (ASSURE_DESTINATION, coding_alloc_by_realloc)
4985 (coding_alloc_by_making_gap, alloc_destination)
4986 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
4987 (encode_coding_utf_16, detect_coding_emacs_mule)
4988 (decode_coding_emacs_mule, encode_coding_emacs_mule)
4989 (detect_coding_iso_2022, decode_coding_iso_2022)
4990 (encode_invocation_designation, encode_designation_at_bol)
4991 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4992 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
4993 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
4994 (encode_coding_ccl, encode_coding_raw_text)
4995 (detect_coding_charset, decode_coding_charset)
4996 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
4997 (produce_composition, produce_charset, produce_annotation)
4998 (decode_coding, handle_composition_annotation)
4999 (handle_charset_annotation, consume_chars, decode_coding_gap)
5000 (decode_coding_object, encode_coding_object, detect_coding_system)
5001 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5002 (code_convert_region, code_convert_string)
5003 (Fdefine_coding_system_internal)
5004 (coding_set_source, coding_set_destination):
5005 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5006 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5007 (Fdefine_coding_system_internal):
5008 Don't assume fixnums fit in int.
5009 (decode_coding_gap, decode_coding_object, encode_coding_object)
5010 (Fread_coding_system, Fdetect_coding_region)
5011 (Funencodable_char_position, Fcheck_coding_systems_region)
5012 (get_translation, handle_composition_annotation, consume_chars):
5013 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5014 (consume_chars): Rewrite to not calculate an address outside buffer.
5015 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
5016 Don't access memory outside of the args array.
5017 (Fdefine_coding_system_internal): Check for charset-id overflow.
5018 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5019 result of ENCODE_CHAR.
5020 * coding.h: Adjust decls to match defn changes elsewhere.
5021 (struct coding_system):
5022 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5023 * composite.c (get_composition_id, find_composition)
5024 (run_composition_function, update_compositions)
5025 (compose_text, composition_gstring_put_cache)
5026 (composition_gstring_p, composition_gstring_width)
5027 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5028 (composition_compute_stop_pos, composition_reseat_it)
5029 (composition_update_it, struct position_record)
5030 (find_automatic_composition, composition_adjust_point)
5031 (Fcomposition_get_gstring, Ffind_composition_internal):
5032 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5033 (update_compositions):
5034 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5035 * composite.h: Adjust decls to match defn changes elsewhere.
5036 (struct composition):
5037 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5038 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5039 Do not attempt to compute the address of the object just before a
5040 buffer; this is not portable.
5041 (Faref, Faset):
5042 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5043 (Faset): Use int, not EMACS_INT, where int is wide enough.
5044 (Fstring_to_number): Don't assume fixnums fit in int.
5045 (Frem): Don't assume arg is nonnegative.
5046 * dbusbind.c (xd_append_arg): Check for integers out of range.
5047 (Fdbus_call_method): Don't overflow the timeout int.
5048 (extract_signed, extract_unsigned): New functions.
5049 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5050 (xd_get_connection_references): Return ptrdiff_t, not int.
5051 All uses changed.
5052 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5053 (xd_read_message_1):
5054 Use int, not unsigned, where the dbus API uses int.
5055 (Fdbus_message_internal): Don't overflow mtype.
5056 (syms_of_dbusbind): Allocate right-sized buffer for integers.
5057 * dired.c (directory_files_internal, file_name_completion, scmp)
5058 (file_name_completion_stat):
5059 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5060 (file_name_completion): Don't overflow matchcount.
5061 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5062 * dispextern.h: Adjust decls to match defn changes elsewhere.
5063 (struct text_pos, struct glyph, struct bidi_saved_info)
5064 (struct bidi_string_data, struct bidi_it, struct composition_it)
5065 (struct it):
5066 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5067 (struct display_pos, struct composition_it, struct it):
5068 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5069 * dispnew.c (increment_matrix_positions)
5070 (increment_row_positions, mode_line_string)
5071 (marginal_area_string):
5072 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5073 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
5074 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5075 (duration_to_sec_usec): New function, to check for overflow better.
5076 (Fsleep_for, sit_for): Use it.
5077 * doc.c (get_doc_string, store_function_docstring):
5078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5079 (get_doc_string, Fsnarf_documentation):
5080 Use int, not EMACS_INT, where int is wide enough.
5081 (get_doc_string):
5082 Use SAFE_ALLOCA, not alloca.
5083 Check for overflow when converting EMACS_INT to off_t.
5084 * doprnt.c (doprnt):
5085 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5086 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5087 Don't assume uid_t fits into fixnum.
5088 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5089 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5090 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5091 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5092 (general_insert_function)
5093 (Finsert_char, make_buffer_string, make_buffer_string_both)
5094 (update_buffer_properties, Fbuffer_substring)
5095 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5096 (Fsubst_char_in_region, check_translation)
5097 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5098 (transpose_markers, Ftranspose_regions):
5099 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5100 (clip_to_bounds): Move to lisp.h as an inline function).
5101 (Fconstrain_to_field): Don't assume integers are nonnegative.
5102 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5103 (Fsubst_char_in_region, Fsave_restriction):
5104 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5105 (Femacs_pid): Don't assume pid_t fits into fixnum.
5106 (lo_time): Use int, not EMACS_INT, when int suffices.
5107 (lisp_time_argument): Check for usec out of range.
5108 (Fencode_time): Don't assume fixnum fits in int.
5109 (Fuser_login_name, Fuser_full_name): Signal an error
5110 if a uid argument is out of range, rather than relying on
5111 undefined behavior.
5112 (Fformat_time_string): Remove now-unnecessary check.
5113 lisp_time_argument checks for out-of-range usec now.
5114 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
5115 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5116 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5117 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5118 (init_cmdargs, Fdump_emacs):
5119 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5120 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5121 the bottom (typically) 32 bits of the fixnum.
5122 * eval.c (specpdl_size, call_debugger):
5123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5124 (when_entered_debugger, Fbacktrace_debug):
5125 Don't assume fixnum can fit in int.
5126 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5127 the object just before a buffer; this is not portable.
5128 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5129 (grow_specpdl, unbind_to):
5130 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5131 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5132 (grow_specpdl): Simplify allocation by using xpalloc.
5133 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
5134 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5135 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5136 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5137 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5138 (a_write, e_write):
5139 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5140 (Fcopy_file, non_regular_nbytes, read_non_regular)
5141 (Finsert_file_contents):
5142 Use int, not EMACS_INT, where int is wide enough.
5143 (READ_BUF_SIZE): Verify that it fits in int.
5144 (Finsert_file_contents): Check that counts are in proper range,
5145 rather than assuming fixnums fit into ptrdiff_t etc.
5146 Don't assume fixnums fit into int.
5147 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5148 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5149 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
5150 (string_char_to_byte, string_byte_to_char)
5151 (string_make_multibyte, string_to_multibyte)
5152 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5153 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5154 (substring_both, Fdelete, internal_equal, Ffillarray)
5155 (Fclear_string, mapcar1)
5156 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5157 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5158 (larger_vector, make_hash_table, maybe_resize_hash_table)
5159 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5160 (Fmaphash, secure_hash):
5161 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5162 (concat): Check for string index and length overflow.
5163 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5164 (Frequire):
5165 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5166 (larger_vector): New API (vec, incr_min, size_max) replaces old
5167 one (vec, new_size, init). This catches size overflow.
5168 INIT was removed because it was always Qnil.
5169 All callers changed.
5170 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5171 the upper bound on a hash table index size.
5172 (make_hash_table, maybe_resize_hash_table): Use it.
5173 (secure_hash): Computer start_byte and end_byte only after
5174 they're known to be in ptrdiff_t range.
5175 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5176 (Ffont_get_glyphs, Ffont_at):
5177 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5178 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5179 (Flist_fonts, Fopen_font):
5180 Don't assume fixnum can fit in int.
5181 (check_gstring): Don't assume index can fit in int.
5182 (font_match_p): Check that fixnum is a character, not a nonnegative
5183 fixnum, since the later code needs to stuff it into an int.
5184 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5185 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5186 conversion overflow issues.
5187 (Fopen_font): Check for integer out of range.
5188 (Ffont_get_glyphs): Don't assume index can fit in int.
5189 * font.h: Adjust decls to match defn changes elsewhere.
5190 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5191 integer overflow.
5192 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5193 printmax_t, where ptrdiff_t is wide enough.
5194 (Finternal_char_font):
5195 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5196 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5197 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5198 (Fset_frame_position, x_set_frame_parameters)
5199 (x_set_line_spacing, x_set_border_width)
5200 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5201 Check that fixnums are in proper range for system types.
5202 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5203 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5204 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5205 Use SAFE_ALLOCA_LISP, not alloca.
5206 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5207 intptr_t is wide enough.
5208 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5209 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5210 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5211 Check for fixnum out of range.
5212 * ftfont.c (ftfont_list): Don't assume index fits in int.
5213 Check that fixnums are in proper range for system types.
5214 (ftfont_shape_by_flt):
5215 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5216 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5218 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5219 Check that fixnums are in proper range for system types.
5220 * gnutls.h: Adjust decls to match defn changes elsewhere.
5221 * gtkutil.c (xg_dialog_run):
5222 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5223 (update_frame_tool_bar):
5224 Check that fixnums are in proper range for system types.
5225 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5226 (lookup_image): Check that fixnums are in range for system types.
5227 * indent.c (last_known_column, last_known_column_point):
5228 (current_column_bol_cache):
5229 (skip_invisible, current_column, check_display_width):
5230 (check_display_width, scan_for_column, current_column_1)
5231 (Findent_to, Fcurrent_indentation, position_indentation)
5232 (indented_beyond_p, Fmove_to_column, compute_motion):
5233 (Fcompute_motion, Fvertical_motion):
5234 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5235 (last_known_column_modified): Use EMACS_INT, not int.
5236 (check_display_width):
5237 (Fcompute_motion):
5238 Check that fixnums and floats are in proper range for system types.
5239 (compute_motion): Don't assume index or fixnum fits in int.
5240 (compute_motion, Fcompute_motion):
5241 Use int, not EMACS_INT, when it is wide enough.
5242 (vmotion): Omit local var start_hpos that is always 0; that way
5243 we don't need to worry about overflow in expressions involving it.
5244 * indent.h: Adjust decls to match defn changes elsewhere.
5245 (struct position):
5246 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5247 Use int, not EMACS_INT, where int is wide enough.
5248 Remove unused members ovstring_chars_done and tab_offset;
5249 all uses removed.
5250 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5251 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5252 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5253 (make_gap, copy_text, insert, insert_and_inherit)
5254 (insert_before_markers, insert_before_markers_and_inherit)
5255 (insert_1, count_combining_before, count_combining_after)
5256 (insert_1_both, insert_from_string)
5257 (insert_from_string_before_markers, insert_from_string_1)
5258 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5259 (adjust_after_replace, adjust_after_insert, replace_range)
5260 (replace_range_2, del_range, del_range_1, del_range_byte)
5261 (del_range_both, del_range_2, modify_region)
5262 (prepare_to_modify_buffer, signal_before_change)
5263 (signal_after_change, Fcombine_after_change_execute):
5264 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5265 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5266 (balance_an_interval, split_interval_right, split_interval_left)
5267 (find_interval, next_interval, update_interval)
5268 (adjust_intervals_for_insertion, delete_node, delete_interval)
5269 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5270 (static_offset_intervals, offset_intervals)
5271 (merge_interval_right, merge_interval_left, make_new_interval)
5272 (graft_intervals_into_buffer, temp_set_point_both)
5273 (temp_set_point, set_point, adjust_for_invis_intang)
5274 (set_point_both, move_if_not_intangible, get_property_and_range)
5275 (get_local_map, copy_intervals, copy_intervals_to_string)
5276 (compare_string_intervals, set_intervals_multibyte_1):
5277 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5278 * intervals.h: Adjust decls to match defn changes elsewhere.
5279 (struct interval):
5280 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5281 * keyboard.c (this_command_key_count, this_single_command_key_start)
5282 (before_command_key_count, before_command_echo_length, echo_now)
5283 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5284 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5285 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5286 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5287 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5288 (last_non_minibuf_size, last_point_position, echo_truncate)
5289 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5290 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5291 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5292 (stuff_buffered_input):
5293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5294 (last_auto_save, command_loop_1, read_char):
5295 Use EMACS_INT, not int, to avoid integer overflow.
5296 (record_char): Avoid overflow in total_keys computation.
5297 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5298 * keyboard.h: Adjust decls to match defn changes elsewhere.
5299 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5300 (Fkey_description, Fdescribe_vector, Flookup_key):
5301 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5302 (click_position): New function, to check that positions are in range.
5303 (Fcurrent_active_maps):
5304 (describe_command):
5305 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5306 (Faccessible_keymaps, Fkey_description):
5307 (preferred_sequence_p):
5308 Don't assume fixnum can fit into int.
5309 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5310 Check for integer overflow in size calculations.
5311 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5312 avoid mishandling large integers.
5313 * lisp.h: Adjust decls to match defn changes elsewhere.
5314 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5315 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5316 (struct Lisp_Marker):
5317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5318 (clip_to_bounds): Now an inline function, moved here from editfns.c.
5319 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5320 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5321 All callers changed.
5322 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5323 Assume the arg has valid form, since it always does.
5324 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5325 unsigned integer system type.
5326 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5327 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5328 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5329 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5330 (duration_to_sec_usec): New decl.
5331 * lread.c (read_from_string_index, read_from_string_index_byte)
5332 (read_from_string_limit, readchar, unreadchar, openp)
5333 (read_internal_start, read1, oblookup):
5334 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5335 (Fload, readevalloop, Feval_buffer, Feval_region):
5336 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5337 (openp): Check for out-of-range argument to 'access'.
5338 (read1): Use int, not EMACS_INT, where int is wide enough.
5339 Don't assume fixnum fits into int.
5340 Fix off-by-one error that can read outside a buffer.
5341 (read_filtered_event): Use duration_to_sec_usec
5342 to do proper overflow checking on durations.
5343 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5344 in size calculation.
5345 (Fexecute_kbd_macro):
5346 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5347 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5348 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5349 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5350 (set_marker_both, set_marker_restricted_both, marker_position)
5351 (marker_byte_position, Fbuffer_has_markers_at):
5352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5353 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
5354 * menu.c (ensure_menu_items): Rename from grow_menu_items.
5355 It now merely ensures that the menu is large enough, without
5356 necessarily growing it, as this avoids some integer overflow issues.
5357 All callers changed.
5358 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5359 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5360 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5361 Use SAFE_ALLOCA_LISP, not alloca.
5362 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5363 to EMACS_INT. Check that fixnums are in proper range for system types.
5364 * minibuf.c (minibuf_prompt_width, string_to_object)
5365 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5366 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5368 (get_minibuffer, read_minibuf_unwind):
5369 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5370 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5371 this simplifies overflow checking. All callers changed.
5372 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5373 (Ftest_completion):
5374 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5375 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5376 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5377 Check that fixnums are in proper range for system types.
5378 (Fx_create_frame, Fx_show_tip):
5379 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5380 * nsfont.m (ns_findfonts, nsfont_list_family):
5381 Don't assume fixnum fits in long.
5382 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5383 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5384 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5385 wide enough.
5386 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
5387 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5388 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5389 (PRINTDECLARE, PRINTPREPARE):
5390 (strout, print_string):
5391 (print, print_preprocess, print_check_string_charset_prop)
5392 (print_object):
5393 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5394 (PRINTDECLARE):
5395 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5396 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5397 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
5398 (printchar, strout): Use xpalloc to catch size calculation overflow.
5399 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
5400 (print_error_message): Use SAFE_ALLOCA, not alloca.
5401 (print_object): Use int, not EMACS_INT, where int is wide enough.
5402 (print_depth, new_backquote_output, print_number_index):
5403 Use ptrdiff_t, not int, where int might not be wide enough.
5404 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5405 (Fset_process_window_size, Fformat_network_address)
5406 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
5407 (sigchld_handler):
5408 Check that fixnums are in proper range for system types.
5409 (Fsignal_process): Simplify by avoiding a goto.
5410 Check for process-ids out of pid_t range rather than relying on
5411 undefined behavior.
5412 (process_tick, update_tick): Use EMACS_INT, not int.
5413 (Fformat_network_address, read_process_output, send_process)
5414 (Fprocess_send_region, status_notify):
5415 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5416 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5417 (wait_reading_process_output, read_process_output, exec_sentinel):
5418 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5419 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5420 (Faccept_process_output): Use duration_to_sec_usec to do proper
5421 overflow checking on durations.
5422 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5423 Don't assume pid_t fits in int.
5424 * process.h (struct Lisp_Process): Members tick and update_tick
5425 are now of type EMACS_INT, not int.
5426 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5427 configured --with-wide-int.
5428 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5429 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5430 * search.c (looking_at_1, string_match_1):
5431 (fast_string_match, fast_c_string_match_ignore_case)
5432 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5433 (scan_newline, find_before_next_newline, search_command)
5434 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5435 (set_search_regs, wordify):
5436 (Freplace_match):
5437 (Fmatch_data):
5438 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5439 (string_match_1, search_buffer, set_search_regs):
5440 (Fmatch_data):
5441 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5442 (wordify): Check for overflow in size calculation.
5443 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5444 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5445 Check that fixnums are in proper range for system types.
5446 * sound.c (struct sound_device)
5447 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5448 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5449 (Fplay_sound_internal):
5450 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5451 * syntax.c (struct lisp_parse_state, find_start_modiff)
5452 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5453 (Fparse_partial_sexp):
5454 Don't assume fixnums can fit in int.
5455 (struct lisp_parse_state, find_start_pos, find_start_value)
5456 (find_start_value_byte, find_start_begv)
5457 (update_syntax_table, char_quoted, dec_bytepos)
5458 (find_defun_start, prev_char_comend_first, back_comment):
5459 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5460 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5461 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5462 (Finternal_describe_syntax_value): Check that match_lisp is a
5463 character, not an integer, since the code stuffs it into int.
5464 (scan_words, scan_sexps_forward):
5465 Check that fixnums are in proper range for system types.
5466 (Fforward_word):
5467 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5468 (scan_sexps_forward):
5469 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5470 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5471 * syntax.h: Adjust decls to match defn changes elsewhere.
5472 (struct gl_state_s):
5473 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5474 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5475 MOST_POSITIVE_FIXNUM.
5476 * sysdep.c (wait_for_termination_1, wait_for_termination)
5477 (interruptible_wait_for_termination, mkdir):
5478 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5479 (emacs_read, emacs_write):
5480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5481 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5482 and double all fit in int.
5483 * term.c (set_tty_color_mode):
5484 Check that fixnums are in proper range for system types.
5485 * termhooks.h (struct input_event):
5486 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5487 * textprop.c (validate_interval_range, interval_of)
5488 (Fadd_text_properties, set_text_properties_1)
5489 (Fremove_text_properties, Fremove_list_of_text_properties)
5490 (Ftext_property_any, Ftext_property_not_all)
5491 (copy_text_properties, text_property_list, extend_property_ranges)
5492 (verify_interval_modification):
5493 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5494 (Fnext_single_char_property_change)
5495 (Fprevious_single_char_property_change):
5496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5497 (copy_text_properties):
5498 Check for integer overflow in index calculation.
5499 * undo.c (last_boundary_position, record_point, record_insert)
5500 (record_delete, record_marker_adjustment, record_change)
5501 (record_property_change):
5502 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5503 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5504 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5505 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5506 (Fx_hide_tip, Fx_file_dialog):
5507 * w32menu.c (set_frame_menubar):
5508 Use ptrdiff_t, not int, for consistency with rest of code.
5509 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5510 (select_window, Fdelete_other_windows_internal)
5511 (window_scroll_pixel_based, window_scroll_line_based)
5512 (Frecenter, Fset_window_configuration):
5513 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5514 (Fset_window_hscroll, run_window_configuration_change_hook)
5515 (set_window_buffer, temp_output_buffer_show, scroll_command)
5516 (Fscroll_other_window, Frecenter):
5517 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5518 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5519 Don't assume fixnum fits in int.
5520 (Fset_window_scroll_bars):
5521 Check that fixnums are in proper range for system types.
5522 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5523 (string_pos, c_string_pos, number_of_chars, init_iterator)
5524 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5525 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5526 (compute_display_string_end, handle_face_prop)
5527 (face_before_or_after_it_pos, handle_invisible_prop)
5528 (handle_display_prop, handle_display_spec, handle_single_display_spec)
5529 (display_prop_intangible_p, string_buffer_position_lim)
5530 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5531 (get_overlay_strings_1, get_overlay_strings)
5532 (iterate_out_of_display_property, forward_to_next_line_start)
5533 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5534 (get_next_display_element, set_iterator_to_next)
5535 (get_visually_first_element, compute_stop_pos_backwards)
5536 (handle_stop_backwards, next_element_from_buffer)
5537 (move_it_in_display_line_to, move_it_in_display_line)
5538 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5539 (add_to_log, message_dolog, message_log_check_duplicate)
5540 (message2, message2_nolog, message3, message3_nolog
5541 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5542 (current_message_1, truncate_echo_area, truncate_message_1)
5543 (set_message, set_message_1, store_mode_line_noprop)
5544 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5545 (text_outside_line_unchanged_p, check_point_in_composition)
5546 (reconsider_clip_changes)
5547 (redisplay_internal, set_cursor_from_row, try_scrolling)
5548 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5549 (redisplay_window, find_last_unchanged_at_beg_row)
5550 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5551 (trailing_whitespace_p, find_row_edges, display_line)
5552 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5553 (display_mode_element, store_mode_line_string)
5554 (pint2str, pint2hrstr, decode_mode_spec)
5555 (display_count_lines, display_string, draw_glyphs)
5556 (x_produce_glyphs, x_insert_glyphs)
5557 (rows_from_pos_range, mouse_face_from_buffer_pos)
5558 (fast_find_string_pos, mouse_face_from_string_pos)
5559 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5561 (safe_call, init_from_display_pos, handle_fontified_prop)
5562 (handle_single_display_spec, load_overlay_strings)
5563 (with_echo_area_buffer, setup_echo_area_for_printing)
5564 (display_echo_area, echo_area_display)
5565 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5566 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5567 (redisplay_window, dump_glyph_row, display_mode_line)
5568 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
5569 (handle_display_spec, display_prop_string_p):
5570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5571 (handle_single_display_spec, build_desired_tool_bar_string)
5572 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5573 (get_specified_cursor_type):
5574 Check that fixnums are in proper range for system types.
5575 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5576 (Flookup_image_map):
5577 Don't assume fixnums fit in int.
5578 (compare_overlay_entries):
5579 Avoid mishandling comparisons due to subtraction overflow.
5580 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5581 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5582 (handle_tool_bar_click):
5583 Use int, not unsigned, since we prefer signed and the signedness
5584 doesn't matter here.
5585 (get_next_display_element, next_element_from_display_vector):
5586 Use int, not EMACS_INT, when int is wide enough.
5587 (start_hourglass): Use duration_to_sec_usec to do proper
5588 overflow checking on durations.
5589 * xfaces.c (Fbitmap_spec_p):
5590 Check that fixnums are in proper range for system types.
5591 (compare_fonts_by_sort_order):
5592 Avoid mishandling comparisons due to subtraction overflow.
5593 (Fx_family_fonts, realize_basic_faces):
5594 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5595 (Fx_family_fonts):
5596 Don't assume fixnum fits in int.
5597 Use SAFE_ALLOCA_LISP, not alloca.
5598 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5599 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5600 (face_at_buffer_position, face_for_overlay_string)
5601 (face_at_string_position):
5602 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5603 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5604 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5605 (Fx_show_tip):
5606 Check that fixnums are in proper range for system types.
5607 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5608 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5609 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5610 (Fx_change_window_property): Don't assume fixnums fit in int.
5611 * xfont.c (xfont_chars_supported):
5612 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5613 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5614 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5615 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5616 * xml.c (parse_region):
5617 * xrdb.c (magic_file_p):
5618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5619 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5620 (x_get_local_selection, x_reply_selection_request)
5621 (x_handle_selection_request, wait_for_property_change):
5622 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5623 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5624 short is wide enough.
5625 (x_send_client_event): Don't assume fixnum fits in int.
5626 * xterm.c (x_x_to_emacs_modifiers):
5627 Don't assume EMACS_INT overflows nicely into int.
5628 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5629 may come from Lisp.
5630 (handle_one_xevent): NATNUMP can eval its arg twice.
5631 (x_connection_closed):
5632 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5633 * xterm.h: Adjust decls to match defn changes elsewhere.
5634 (struct scroll_bar): Use struct vectorlike_header
5635 rather than rolling our own approximation.
5636 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5637
5638 2012-05-25 Glenn Morris <rgm@gnu.org>
5639
5640 * lisp.mk (lisp): Update for more files being compiled now.
5641
5642 2012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5643
5644 * lread.c: Remove `read_pure' which makes no difference.
5645 (read_pure): Remove var.
5646 (unreadpure): Remove function.
5647 (readevalloop): Don't call read_list with -1 flag.
5648 (read1, read_vector): Don't test read_pure any more.
5649 (read_list): Simplify.
5650
5651 * fileio.c, character.h: Minor style tweaks.
5652
5653 2012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5654
5655 * window.h (clip_changed): Remove useless declaration.
5656
5657 2012-05-22 Juanma Barranquero <lekktu@gmail.com>
5658
5659 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5660 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5661
5662 2012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5663
5664 Remove src/m/*.
5665 This directory predates autoconf and is no longer needed nowadays.
5666 Move its few remaining bits of functionality to where they're needed.
5667 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5668 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5669 * m/template.h: Remove.
5670 * Makefile.in (M_FILE): Remove. All uses removed.
5671 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5672 * lisp.h (USE_LSB_TAG):
5673 * mem-limits.h (EXCEEDS_LISP_PTR):
5674 Use VAL_MAX, not VALBITS, in #if.
5675 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5676 (EMACS_UINT): Define unconditionally now.
5677 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5678 (BITS_PER_EMACS_INT): New constants, replacing
5679 what used to be in config.h, but not useful in #if.
5680 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5681 define them any more.
5682 (VAL_MAX): New macro.
5683 (VALMASK): Use it.
5684 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5685 BITS_PER_EMACS_INT, in #if.
5686 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5687 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5688 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5689 * s/ms-w32.h (DATA_START):
5690 Move here from removed file m/intel386.h.
5691 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5692 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5693
5694 2012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5695
5696 Assume C89 or later.
5697 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5698 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5699 (xrealloc):
5700 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5701 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5702 * textprop.c, tparam.c (NULL): Remove.
5703 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5704 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5705 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5706 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5707 * xterm.c (input_signal_count): Assume volatile works.
5708
5709 2012-05-21 Ken Brown <kbrown@cornell.edu>
5710
5711 * xgselect.c (xg_select): Fix first argument in call to 'select'
5712 (bug#11508).
5713
5714 2012-05-20 Ken Brown <kbrown@cornell.edu>
5715
5716 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
5717 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
5718
5719 2012-05-19 Ken Brown <kbrown@cornell.edu>
5720
5721 * xfns.c (x_in_use): Remove `static' qualifier.
5722 * xterm.h (x_in_use): Declare.
5723 * xgselect.c: Include xterm.h.
5724 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5725 and `display_arg' (bug#9754).
5726
5727 2012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5728
5729 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5730
5731 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5732 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5733
5734 2012-05-18 Eli Zaretskii <eliz@gnu.org>
5735
5736 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5737
5738 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
5739 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
5740
5741 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5742 reference to image_cache->refcount.
5743 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5744
5745 2012-05-17 Juri Linkov <juri@jurta.org>
5746
5747 * search.c (Fword_search_regexp, Fword_search_backward)
5748 (Fword_search_forward, Fword_search_backward_lax)
5749 (Fword_search_forward_lax): Move functions to isearch.el
5750 (bug#10145, bug#11381).
5751
5752 2012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5753
5754 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5755
5756 2012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5757
5758 * lread.c (init_obarray): Declare Qt and Qnil as special.
5759
5760 2012-05-14 Glenn Morris <rgm@gnu.org>
5761
5762 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
5763 Put "libexec" before "bin", for the sake of init_callproc_1.
5764
5765 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5766
5767 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5768
5769 * unexaix.c: Port to more-recent AIX compilers.
5770 (report_error, report_error_1, make_hdr, copy_sym)
5771 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5772 Make arguments const char *, not char *, to avoid violations of C
5773 standard and to fix some AIX warnings reported by Gilles Pion.
5774
5775 2012-05-14 Eli Zaretskii <eliz@gnu.org>
5776
5777 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5778 already have overlays loaded.
5779 (handle_single_display_spec): Before returning without displaying
5780 fringe bitmap, synchronize the bidi iterator with the main display
5781 iterator, by calling iterate_out_of_display_property.
5782 (iterate_out_of_display_property): Detect buffer iteration by
5783 testing that it->string is a Lisp string.
5784 (get_next_display_element): When the current object is exhausted,
5785 and there's something on it->stack, call set_iterator_to_next to
5786 proceed with what's on the stack, instead of returning zero.
5787 (set_iterator_to_next): If called at the end of a Lisp string,
5788 proceed to consider_string_end without incrementing string
5789 position. Don't increment display vector index past the end of
5790 the display vector. (Bug#11417)
5791 (pos_visible_p): Don't report a position visible when move_it_to
5792 stopped at the last line of window, which happens to be scanned
5793 backwards by the bidi iteration. (Bug#11464)
5794
5795 2012-05-14 Eli Zaretskii <eliz@gnu.org>
5796
5797 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5798 and right-margin display specs even if the spec is invalid or we
5799 are on a TTY, and thus unable to display on the fringes.
5800 That's because the text with the property will not be displayed anyway,
5801 so we need to signal to the caller that this is a "replacing"
5802 display spec. This fixes display when the spec is invalid or we
5803 are on a TTY.
5804
5805 2012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5806
5807 * unexaix.c (make_hdr): Fix typo in prototype.
5808 This bug broke the build on AIX. Problem reported by Gilles Pion.
5809
5810 2012-05-14 Michael Albinus <michael.albinus@gmx.de>
5811
5812 * keyboard.c (kbd_buffer_get_event): Read special events also in
5813 batch mode. (Bug#11415)
5814
5815 2012-05-12 Glenn Morris <rgm@gnu.org>
5816
5817 * ns.mk: Update for ns_appbindir no longer having trailing "/".
5818
5819 2012-05-12 Eli Zaretskii <eliz@gnu.org>
5820
5821 * lisp.mk (lisp): Add newcomment.elc.
5822
5823 2012-05-12 Glenn Morris <rgm@gnu.org>
5824
5825 * Makefile.in (MKDIR_P): New, set by configure.
5826 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
5827
5828 2012-05-11 Paul Eggert <eggert@cs.ucla.edu>
5829
5830 Remove unused function hourglass_started.
5831 * dispextern.h (hourglass_started):
5832 * w32fns.c (hourglass_started):
5833 * xdisp.c (hourglass_started): Remove.
5834
5835 2012-05-10 Juanma Barranquero <lekktu@gmail.com>
5836
5837 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
5838 Update dependencies.
5839
5840 2012-05-10 Paul Eggert <eggert@cs.ucla.edu>
5841
5842 * xgselect.c (xg_select): Put maxfds+1 into a var.
5843 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5844
5845 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5846
5847 2012-05-10 Dave Abrahams <dave@boostpro.com>
5848
5849 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5850 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
5851
5852 2012-05-09 Michael Albinus <michael.albinus@gmx.de>
5853
5854 * dbusbind.c (xd_registered_buses): New internal Lisp object.
5855 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5856 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5857 Initialize xd_registered_buses.
5858
5859 2012-05-09 Paul Eggert <eggert@cs.ucla.edu>
5860
5861 Untag more efficiently if USE_LSB_TAG.
5862 This is based on a proposal by YAMAMOTO Mitsuharu in
5863 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5864 For an admittedly artificial (nth 8000 longlist) benchmark on
5865 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
5866 Emacs's overall text size by 1%.
5867 * lisp.h (XUNTAG): New macro.
5868 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5869 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5870 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5871 * eval.c (Fautoload):
5872 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5873 * frame.h (XFRAME): Use XUNTAG.
5874
5875 Port recent dbusbind.c changes to 32-bit --with-wide-int.
5876 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5877 Remove unportable assumptions about print widths of types like
5878 dbus_uint32_t.
5879 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5880 intptr_t when converting between pointer and integer, to avoid GCC
5881 warnings about wrong width.
5882
5883 2012-05-09 Eli Zaretskii <eliz@gnu.org>
5884
5885 * w32proc.c (new_child): Force Windows to reserve only 64KB of
5886 stack for each reader_thread, instead of defaulting to 8MB
5887 determined by the linker. This avoids failures in creating
5888 subprocesses on Windows 7, see the discussion in this thread:
5889 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5890
5891 2012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
5892
5893 Fix up display of the *Minibuf-0* buffer in the mini window.
5894 * keyboard.c (read_char): Don't clear the echo area if there's no
5895 message to clear.
5896 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
5897 contents of *Minibuf-0*) if there's no message displayed in its stead.
5898
5899 2012-05-07 Michael Albinus <michael.albinus@gmx.de>
5900
5901 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
5902 batch mode.
5903
5904 2012-05-06 Chong Yidong <cyd@gnu.org>
5905
5906 * lisp.mk (lisp): Update.
5907
5908 2012-05-05 Jim Meyering <meyering@redhat.com>
5909
5910 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
5911
5912 2012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
5913
5914 * data.c (PUT_ERROR): New macro.
5915 (syms_of_data): Use it. Add new error type `user-error'.
5916 * undo.c (user_error): New function.
5917 (Fprimitive_undo): Use it.
5918 * print.c (print_error_message): Adjust print style for `user-error'.
5919 * keyboard.c (user_error): New function.
5920 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
5921
5922 2012-05-03 Paul Eggert <eggert@cs.ucla.edu>
5923
5924 Do not limit current-time-string to years 1000..9999.
5925 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
5926 (Fcurrent_time_string): Support any year that is supported by the
5927 underlying localtime representation. Don't use asctime, as it
5928 has undefined behavior for years outside the range -999..9999.
5929
5930 2012-05-02 Paul Eggert <eggert@cs.ucla.edu>
5931
5932 Fix race conditions involving setenv, gmtime, localtime, asctime.
5933 Without this fix, interrupts could mess up code that uses these
5934 nonreentrant functions, since setting TZ invalidates existing
5935 tm_zone or tzname values, and since most of these functions return
5936 pointers to static storage.
5937 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
5938 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
5939 Grow the critical sections to include not just invoking
5940 localtime/gmtime, but also accessing these functions' results
5941 including their tm_zone values if any, and any related TZ setting.
5942 (format_time_string): Last arg is now struct tm *, not struct tm **,
5943 so that the struct tm is saved in the critical section.
5944 All callers changed. Simplify allocation of initial buffer, partly
5945 motivated by the fact that memory allocation needs to be outside
5946 the critical section.
5947
5948 2012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
5949
5950 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
5951 with RESET_INTERVAL.
5952
5953 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5954 Remove duplicated buffer name initialization.
5955
5956 2012-05-02 Jim Meyering <jim@meyering.net>
5957
5958 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
5959
5960 * xfns.c (x_window): Use xstrdup (Bug#11375).
5961
5962 2012-05-02 Eli Zaretskii <eliz@gnu.org>
5963
5964 * xdisp.c (pos_visible_p): If already at a newline from the
5965 display string before the 'while' loop, don't walk back the glyphs
5966 from it3.glyph_row. Solves assertion violation when the display
5967 string begins with a newline (egg.el). (Bug#11367)
5968
5969 2012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
5970
5971 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
5972 Move to simple.el.
5973
5974 2012-05-01 Glenn Morris <rgm@gnu.org>
5975
5976 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
5977 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
5978 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
5979 All were removed before 23.1.
5980
5981 * dispnew.c: Remove HAVE_LIBNCURSES test;
5982 it is always true on relevant platforms.
5983
5984 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
5985 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
5986
5987 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
5988
5989 2012-04-30 Andreas Schwab <schwab@linux-m68k.org>
5990
5991 * .gdbinit (xpr): Remove checks for no longer existing misc types.
5992 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
5993 Remove.
5994
5995 2012-04-28 Paul Eggert <eggert@cs.ucla.edu>
5996
5997 Do not avoid creating empty evaporating overlays (Bug#9642).
5998 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
5999 That is, do not delete an evaporating overlay if it becomes
6000 empty after its bounds are adjusted to fit within its buffer.
6001 This fix caused other problems, and I'm reverting it until we get
6002 to the bottom of them.
6003
6004 2012-04-27 Chong Yidong <cyd@gnu.org>
6005
6006 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6007
6008 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6009
6010 * xdisp.c (pos_visible_p): If the window start position is beyond
6011 ZV, start the display from buffer beginning. Prevents assertion
6012 violation in init_iterator when the minibuffer window is scrolled
6013 via the scroll bar.
6014
6015 * window.c (window_scroll_pixel_based): Likewise.
6016
6017 2012-04-27 Chong Yidong <cyd@gnu.org>
6018
6019 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6020
6021 2012-04-27 Glenn Morris <rgm@gnu.org>
6022
6023 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6024 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6025
6026 2012-04-27 Eli Zaretskii <eliz@gnu.org>
6027
6028 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6029 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
6030
6031 2012-04-26 Eli Zaretskii <eliz@gnu.org>
6032
6033 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6034 display element, check also the underlying string or buffer
6035 character. (Bug#11341)
6036
6037 * w32menu.c: Include w32heap.h.
6038 (add_menu_item): If the call to AppendMenuW (via
6039 unicode_append_menu) fails, disable Unicode menus only if we are
6040 running on Windows 9X/Me.
6041
6042 2012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6043
6044 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6045 (xgetint): Add missing shift for LSB tags.
6046
6047 2012-04-24 Martin Rudalics <rudalics@gmx.at>
6048
6049 * keyboard.c (read_char): Don't wipe echo area for select window
6050 events: These might get delayed via `mouse-autoselect-window'
6051 (Bug#11304).
6052
6053 2012-04-24 Juanma Barranquero <lekktu@gmail.com>
6054
6055 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6056 manipulation of :loaded-from data.
6057
6058 2012-04-23 Juanma Barranquero <lekktu@gmail.com>
6059
6060 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6061 now a cons (bug#11311).
6062
6063 2012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6064
6065 Do not create empty overlays with the evaporate property (Bug#9642).
6066 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6067 if it becomes empty after its bounds are adjusted to fit within
6068 its buffer. Without this fix, in a nonempty buffer (let ((o
6069 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6070 yields an empty overlay that has the evaporate property, which is
6071 not supposed to happen.
6072
6073 Fix minor GTK3 problems found by static checking.
6074 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6075 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6076 (struct _EmacsFixedClass, emacs_fixed_get_type):
6077 Move decls here from emacsgtkfixed.h, since they needn't be public.
6078 (emacs_fixed_get_type): Now static.
6079 (emacs_fixed_class_init): Omit unused local.
6080 (emacs_fixed_child_type): Remove; unused.
6081 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6082 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6083 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6084 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6085 (EMACS_FIXED_GET_CLASS): Remove; unused.
6086 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6087
6088 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6089 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6090
6091 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6092
6093 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
6094 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
6095 (__malloc_size_t, __malloc_ptrdiff_t):
6096 Remove. All uses removed, replaced by the definiens if needed,
6097 since we can assume C89 or better now.
6098 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6099 (protect_malloc_state, align, get_contiguous_space)
6100 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6101 (malloc_atfork_handler_child, malloc_enable_thread)
6102 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6103 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6104 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6105 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6106 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6107 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6108 Define using prototypes, not old style.
6109 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6110 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6111 (align): Don't assume that signed integer overflow wraps around.
6112 Omit unused local var.
6113 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6114 (_free_internal_nolock, memalign, mallochook, reallochook):
6115 Omit no-longer-needed casts.
6116 (valloc): Use getpagesize, not __getpagesize.
6117 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6118 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6119
6120 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6121
6122 2012-04-22 Michael Albinus <michael.albinus@gmx.de>
6123
6124 Move functions from C to Lisp. Make non-blocking method calls
6125 the default. Implement further D-Bus standard interfaces.
6126
6127 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6128 (QCdbus_request_name_allow_replacement)
6129 (QCdbus_request_name_replace_existing)
6130 (QCdbus_request_name_do_not_queue)
6131 (QCdbus_request_name_reply_primary_owner)
6132 (QCdbus_request_name_reply_in_queue)
6133 (QCdbus_request_name_reply_exists)
6134 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6135 (QCdbus_registered_serial, QCdbus_registered_method)
6136 (QCdbus_registered_signal): New Lisp objects.
6137 (XD_DEBUG_MESSAGE): Use sizeof.
6138 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6139 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6140 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6141 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6142 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6143 (xd_signature, xd_append_arg): Allow float for integer types.
6144 (xd_get_connection_references): New function.
6145 (xd_get_connection_address): Rename from xd_initialize.
6146 Return cached address.
6147 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6148 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6149 level.
6150 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
6151 Return number of refcounts.
6152 (Fdbus_get_unique_name): Make stronger parameter check.
6153 (Fdbus_message_internal): New defun.
6154 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6155 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6156 (Fdbus_send_signal, Fdbus_register_service)
6157 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6158 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6159 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6160 (Vdbus_compiled_version, Vdbus_runtime_version)
6161 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6162 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6163 (Vdbus_message_type_signal): New defvars.
6164 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6165 Adapt docstring.
6166
6167 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6168
6169 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6170 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6171 Do not assume ptrdiff_t is the same width as 'int'.
6172
6173 * alloc.c: Handle unusual debugging option combinations.
6174 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6175 since the two debugging options are incompatible.
6176 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6177 is defined.
6178 (mem_init, mem_insert, mem_insert_fixup):
6179 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6180 (NEED_MEM_INSERT): Remove; no longer needed.
6181
6182 2012-04-22 Leo Liu <sdl.web@gmail.com>
6183
6184 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6185
6186 2012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6187
6188 * sysdep.c [__FreeBSD__]: Minor cleanups.
6189 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6190 Use Emacs indenting style more consistently. Avoid some casts.
6191 Use 'double' consistently rather than mixing 'float' and 'double'.
6192
6193 2012-04-21 Eduard Wiebe <usenet@pusto.de>
6194
6195 * sysdep.c (list_system_processes, system_process_attributes):
6196 Add implementation for FreeBSD (Bug#5243).
6197
6198 2012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6199
6200 * lisp.mk (lisp): Update.
6201
6202 2012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6203
6204 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6205 It is never used otherwise.
6206
6207 2012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6208
6209 * print.c (print_preprocess): Only check print_depth if print-circle
6210 is nil.
6211 (print_object): Check for cycles even when print-circle is nil and
6212 print-gensym is t, but only check print_depth if print-circle is nil.
6213
6214 2012-04-20 Chong Yidong <cyd@gnu.org>
6215
6216 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6217 set the status to "failed" and ensure that sentinel is run.
6218
6219 2012-04-20 Glenn Morris <rgm@gnu.org>
6220
6221 * process.c (Fset_process_inherit_coding_system_flag)
6222 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
6223 (Fmake_network_process, Fmake_serial_process): Doc fix.
6224
6225 2012-04-20 Eli Zaretskii <eliz@gnu.org>
6226
6227 * xdisp.c (string_buffer_position_lim): Limit starting position to
6228 BEGV.
6229 (set_cursor_from_row): If called for a mode-line or header-line
6230 row, return zero immediately.
6231 (try_cursor_movement): If inside continuation line, don't back up
6232 farther than the first row after the header line, if any.
6233 Don't consider the header-line row as "partially visible", even if
6234 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6235
6236 2012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6237
6238 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6239 (bug#11238).
6240
6241 2012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6242 2012-04-18 Paul Eggert <eggert@cs.ucla.edu>
6243
6244 configure: new option --enable-gcc-warnings (Bug#11207)
6245 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6246 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6247 (ALL_CFLAGS): Use new macros rather than old.
6248 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6249 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6250 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6251 -Wunused-result, -Wunused-variable. This should go away once
6252 the Emacs and Gnulib regex code is merged.
6253 (xmalloc, xrealloc): Now static.
6254
6255 2012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6256
6257 * dired.c (Fsystem_groups): Remove unused local.
6258
6259 2012-04-17 Glenn Morris <rgm@gnu.org>
6260
6261 * dired.c (Fsystem_users): Doc fix.
6262
6263 2012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6264
6265 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6266 (syms_of_dired): Add them.
6267
6268 2012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6269
6270 Fix minor alloc.c problems found by static checking.
6271 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6272 New extern decls, to avoid calling undeclared functions.
6273 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6274 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6275 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6276 (NEED_MEM_INSERT): New macro.
6277 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
6278 Remove one incorrect comment and fix another.
6279
6280 Fix minor ralloc.c problems found by static checking.
6281 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6282 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6283 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6284 (r_alloc_sbrk): Now static.
6285
6286 Improve ralloc.c interface checking.
6287 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6288 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6289 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6290 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6291 [REL_ALLOC]: ... to here, to check interface.
6292 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6293 Remove decls. This fixes an "It stinks!".
6294
6295 * alloc.c (which_symbols): Fix alignment issue / type clash.
6296
6297 2012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6298
6299 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6300 (struct Lisp_Misc_Any): Likewise.
6301 (struct Lisp_Free): Likewise.
6302 * alloc.c (union aligned_Lisp_Symbol): Define.
6303 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6304 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6305 (union aligned_Lisp_Misc): Define.
6306 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6307 aligned_Lisp_Misc instead of union Lisp_Misc.
6308 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
6309
6310 2012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6311
6312 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6313 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6314 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6315 * s/netbsd.h, s/sol2-6.h:
6316 Remove definition of GC_MARK_STACK, since the default now works.
6317 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6318 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6319 no longer the default.
6320 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6321
6322 2012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
6323
6324 * lread.c (lisp_file_lexically_bound_p):
6325 Fix hang at ";-*-\n" (bug#11238).
6326
6327 2012-04-14 Eli Zaretskii <eliz@gnu.org>
6328
6329 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6330 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6331
6332 2012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6333
6334 * nsterm.m (constrainFrameRect): Always constrain when there is only
6335 one screen (Bug#10962).
6336
6337 2012-04-13 Ken Brown <kbrown@cornell.edu>
6338
6339 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6340
6341 2012-04-13 Reuben Thomas <rrt@sc3d.org>
6342
6343 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6344
6345 2012-04-11 Daniel Colascione <dancol@dancol.org>
6346
6347 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6348 against is gone. It's better to use vfork now so that when Cygwin
6349 gains a new, working vfork, we use it automatically (bug#10398).
6350
6351 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6352
6353 * window.c (save_window_save): Obey window-point-insertion-type.
6354
6355 2012-04-11 Glenn Morris <rgm@gnu.org>
6356
6357 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6358
6359 2012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6360
6361 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6362
6363 2012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6364
6365 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6366 (force_quit_count): New var.
6367 (handle_interrupt): Use it.
6368
6369 2012-04-10 Juanma Barranquero <lekktu@gmail.com>
6370
6371 * w32.c (w32_delayed_load): Record the full path of the library
6372 being loaded (bug#10424).
6373
6374 2012-04-09 Glenn Morris <rgm@gnu.org>
6375
6376 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6377 not just in the obarray, before snarfing them. (Bug#11036)
6378
6379 * Makefile.in ($(leimdir)/leim-list.el):
6380 Pass EMACS rather than BUILT_EMACS.
6381
6382 2012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6383
6384 * process.c (make_process):
6385 * process.h: Add integer `gnutls_handshakes_tried' member to
6386 process struct.
6387
6388 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6389 Add convenience `GNUTLS_LOG2i' macro.
6390
6391 * gnutls.c (gnutls_log_function2i): Convenience log function.
6392 (emacs_gnutls_read): Use new log functions,
6393 `gnutls_handshakes_tried' process member, and
6394 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6395 attempts per process (connection).
6396
6397 2012-04-09 Chong Yidong <cyd@gnu.org>
6398
6399 * eval.c (Fuser_variable_p, user_variable_p_eh)
6400 (lisp_indirect_variable): Functions deleted.
6401 (Fdefvar): Caller changed.
6402
6403 * callint.c (Finteractive, Fcall_interactively):
6404 * minibuf.c (Fread_variable): Callers changed.
6405
6406 2012-04-09 Eli Zaretskii <eliz@gnu.org>
6407
6408 * xdisp.c (set_cursor_from_row): If the display string appears in
6409 the buffer at position that is closer to point than the position
6410 after the display string, display the cursor on the first glyph of
6411 the display string. Fixes cursor display when a 'display' text
6412 property immediately follows invisible text. (Bug#11094)
6413
6414 2012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6415
6416 composite.c: use 'double' consistently
6417 * composite.c (get_composition_id): Use 'double' consistently
6418 instead of converting 'float' to 'double' and vice versa; this is
6419 easier to understand and avoids a GCC warning.
6420
6421 2012-04-09 Glenn Morris <rgm@gnu.org>
6422
6423 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6424 preparation for dumping it with emacs. (Bug#4789)
6425 (leimdir): New variable.
6426 ($(leimdir)/leim-list.el): New rule.
6427 (emacs$(EXEEXT)): Depend on leim-list.el.
6428
6429 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6430 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6431 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6432
6433 2012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6434
6435 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6436 proper alignment.
6437
6438 2012-04-07 Juanma Barranquero <lekktu@gmail.com>
6439
6440 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6441 Remove unused local variable.
6442
6443 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6444
6445 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6446 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6447 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6448 objects, as mark_maybe_pointer will catch them otherwise.
6449 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6450 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6451
6452 2012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6453
6454 Fix typo that broke non-Windows builds.
6455 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6456
6457 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6458
6459 Support building on MS-Windows with libxml2.
6460
6461 * makefile.w32-in (OBJ2): Add xml.$(O).
6462 (GLOBAL_SOURCES): Add xml.c.
6463 ($(BLD)/xml.$(O)): New dependency list.
6464
6465 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6466 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6467 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6468 [!WINDOWSNT]: New macros.
6469 (init_libxml2_functions, libxml2_loaded_p): New functions.
6470 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6471 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6472 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6473 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6474 linked in).
6475 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6476 Call init_libxml2_functions before calling libxml2 functions.
6477 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6478
6479 * emacs.c: Don't include libxml/parser.h.
6480 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6481 xmlCleanupParser directly.
6482
6483 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6484
6485 2012-04-07 Eli Zaretskii <eliz@gnu.org>
6486
6487 * indent.c (Fvertical_motion): If there is a display string at
6488 point, use it.vpos to compute how many lines to backtrack after
6489 move_it_to point. (Bug#11133)
6490
6491 2012-04-06 Eli Zaretskii <eliz@gnu.org>
6492
6493 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6494 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6495 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6496 macros related to unification of CJK characters. For the details,
6497 see the discussion following the message here:
6498 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6499
6500 2012-04-04 Chong Yidong <cyd@gnu.org>
6501
6502 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6503
6504 2012-04-01 Eli Zaretskii <eliz@gnu.org>
6505
6506 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6507 instead of alloca. (Bug#11138)
6508
6509 2012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6510
6511 * w32menu.c (is_simple_dialog): Properly check lisp types.
6512 (Bug#11141)
6513
6514 2012-03-31 Eli Zaretskii <eliz@gnu.org>
6515
6516 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6517 position we get to after a call to move_it_to fails the
6518 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6519 only if we wind up in a string from display property. (Bug#11063)
6520
6521 * window.c (Fdelete_other_windows_internal): Invalidate the row
6522 and column information about mouse highlight, so that redisplay
6523 restores it after reallocating the glyph matrices. (Bug#7464)
6524
6525 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6526 string comes from a `display' text property, use the buffer
6527 position of that property as if we actually saw that position in
6528 the row's glyphs.
6529 (move_it_by_lines): Remove the assertion that
6530 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6531 violated when there's a before-string at the beginning of a line.
6532 (Bug#11063)
6533
6534 2012-03-30 Eli Zaretskii <eliz@gnu.org>
6535
6536 * xdisp.c (append_space_for_newline): If the default face was
6537 remapped, use the remapped face for the appended newline.
6538 (extend_face_to_end_of_line): Use the remapped default face for
6539 extending the face to the end of the line.
6540 (display_line): Call extend_face_to_end_of_line when the default
6541 face was remapped. (Bug#11068)
6542
6543 2012-03-29 Eli Zaretskii <eliz@gnu.org>
6544
6545 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6546
6547 2012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6548
6549 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6550
6551 2012-03-27 Glenn Morris <rgm@gnu.org>
6552
6553 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6554 Doc fixes.
6555
6556 2012-03-26 Kenichi Handa <handa@m17n.org>
6557
6558 * dispextern.h (struct glyph): Fix previous change. Change the
6559 bit length of glyphless.ch to 25 (Bug#11082).
6560
6561 2012-03-26 Chong Yidong <cyd@gnu.org>
6562
6563 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6564 (command_loop_1): Use it; inhibit selection update for
6565 handle-select-window too (Bug#8996).
6566
6567 2012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6568
6569 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
6570
6571 2012-03-25 Kenichi Handa <handa@m17n.org>
6572
6573 * dispextern.h (struct glyph): Change the bit length of
6574 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6575
6576 2012-03-24 Eli Zaretskii <eliz@gnu.org>
6577
6578 * s/ms-w32.h (tzname): Include time.h before redirecting to
6579 _tzname. Fixes the MSVC build. (Bug#9960)
6580
6581 2012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6582
6583 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6584 characters.
6585
6586 * xterm.c (XTread_socket): Only modify handling_signal if
6587 !SYNC_INPUT. (Bug#11080)
6588
6589 2012-03-23 Eli Zaretskii <eliz@gnu.org>
6590
6591 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6592 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6593 when fetching a multibyte character consumes more bytes than
6594 CHAR_BYTES returns, due to unification of CJK characters in
6595 string_char. (Bug#11073)
6596
6597 2012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6598
6599 * process.c (wait_reading_process_output): Handle pty disconnect
6600 by refraining from sending oneself a SIGCHLD (bug#10933).
6601
6602 2012-03-22 Chong Yidong <cyd@gnu.org>
6603
6604 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6605
6606 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
6607 Mark string as coming from a prefix property.
6608 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6609 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6610
6611 2012-03-21 Chong Yidong <cyd@gnu.org>
6612
6613 * xfaces.c (Vface_remapping_alist): Doc fix.
6614
6615 2012-03-20 Eli Zaretskii <eliz@gnu.org>
6616
6617 * w32proc.c (Fw32_set_console_codepage)
6618 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6619 Doc fixes.
6620
6621 2012-03-20 Chong Yidong <cyd@gnu.org>
6622
6623 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6624 to reflect default non-nil value of redisplay-dont-pause.
6625
6626 2012-03-19 Kenichi Handa <handa@m17n.org>
6627
6628 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6629 it fit in a valid range (Bug#11003).
6630
6631 2012-03-18 Eli Zaretskii <eliz@gnu.org>
6632
6633 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6634 that is not from display property, accept the row as a "cursor
6635 row" if one of the string's character has a non-nil `cursor'
6636 property. Fixes cursor positioning when there are newlines in
6637 overlay strings, e.g. in icomplete.el. (Bug#11035)
6638
6639 2012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6640
6641 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6642
6643 2012-03-12 Chong Yidong <cyd@gnu.org>
6644
6645 * eval.c (inhibit_lisp_code): Rename from
6646 inhibit_window_configuration_change_hook; move from window.c.
6647
6648 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6649 * window.c (run_window_configuration_change_hook)
6650 (syms_of_window): Callers changed.
6651
6652 2012-03-11 Chong Yidong <cyd@gnu.org>
6653
6654 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6655
6656 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6657
6658 2012-03-10 Chong Yidong <cyd@gnu.org>
6659
6660 * frame.c (other_visible_frames): Don't assume the selected frame
6661 is visible (Bug#10955).
6662
6663 2012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6664
6665 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6666
6667 2012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6668
6669 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6670 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6671 zero (Bug#10954).
6672
6673 2012-03-03 Glenn Morris <rgm@gnu.org>
6674
6675 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
6676
6677 2012-03-02 Eli Zaretskii <eliz@gnu.org>
6678
6679 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6680 position past the first glyph_row that ends at ZV. (Bug#10902)
6681 (redisplay_window, next_element_from_string): Fix typos in
6682 comments.
6683 (redisplay_window): Pass to move_it_vertically the margin in
6684 pixels, not in screen lines.
6685
6686 2012-03-02 Glenn Morris <rgm@gnu.org>
6687
6688 * buffer.c (buffer-list-update-hook): Doc fix.
6689
6690 2012-02-29 Eli Zaretskii <eliz@gnu.org>
6691
6692 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6693 push_it before setting up the iterator for the first overlay
6694 string, even if we have an empty string loaded.
6695 (next_overlay_string): If there's an empty string on the iterator
6696 stack, pop the stack. (Bug#10903)
6697
6698 2012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6699
6700 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6701 Suggested by Stefan Monnier in
6702 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6703 * alloc.c (widen_to_Lisp_Object): New static function.
6704 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6705 and widening them to Lisp_Objects. This would work even if
6706 USE_LSB_TAG is defined and wide integers are used, which might
6707 happen in a future version of Emacs.
6708
6709 2012-02-25 Chong Yidong <cyd@gnu.org>
6710
6711 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6712 Doc fix.
6713
6714 * xselect.c (Fx_selection_exists_p): Doc fix.
6715 (x_clipboard_manager_save_all): Print an informative message
6716 before saving to clipboard manager.
6717
6718 2012-02-24 Chong Yidong <cyd@gnu.org>
6719
6720 * keyboard.c (process_special_events): Handle all X selection
6721 requests in kbd_buffer, not just the next one (Bug#8869).
6722
6723 2012-02-23 Chong Yidong <cyd@gnu.org>
6724
6725 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6726 call when setting menu-bar-lines and tool-bar-lines parameters.
6727 (unwind_create_frame_1): New helper function.
6728
6729 * window.c (inhibit_window_configuration_change_hook): New var.
6730 (run_window_configuration_change_hook): Obey it.
6731 (syms_of_window): Initialize it.
6732
6733 2012-02-22 Chong Yidong <cyd@gnu.org>
6734
6735 * xterm.c (x_draw_image_relief): Add missing type check for
6736 Vtool_bar_button_margin (Bug#10743).
6737
6738 2012-02-21 Chong Yidong <cyd@gnu.org>
6739
6740 * fileio.c (Vfile_name_handler_alist): Doc fix.
6741
6742 * buffer.c (Fget_file_buffer): Protect against invalid file
6743 handler return value.
6744
6745 2012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6746
6747 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6748 when computing $valmask.
6749
6750 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6751 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6752 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6753 It's useless in that case, and it can cause problems on hosts
6754 that allocate halves of EMACS_INT values separately.
6755 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6756 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6757 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6758 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6759 it avoids undefined behavior on hosts where shifting right by more
6760 than the word width has undefined behavior.
6761
6762 2012-02-19 Chong Yidong <cyd@gnu.org>
6763
6764 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6765 (Funhandled_file_name_directory, Ffile_name_as_directory)
6766 (Fdirectory_file_name, Fexpand_file_name)
6767 (Fsubstitute_in_file_name): Protect against invalid file handler
6768 return values (Bug#10845).
6769
6770 2012-02-18 Eli Zaretskii <eliz@gnu.org>
6771
6772 * .gdbinit (pitx): Fix incorrect references to fields of the
6773 iterator stack.
6774
6775 2012-02-17 Chong Yidong <cyd@gnu.org>
6776
6777 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6778
6779 2012-02-15 Paul Eggert <eggert@cs.ucla.edu>
6780
6781 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6782 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6783
6784 2012-02-15 Chong Yidong <cyd@gnu.org>
6785
6786 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6787 marked as special. Also, starting docstrings with * is obsolete.
6788
6789 2012-02-13 Andreas Schwab <schwab@linux-m68k.org>
6790
6791 * gnutls.c (emacs_gnutls_write): Fix last change.
6792
6793 2012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
6794
6795 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6796 send_process.
6797
6798 2012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
6799
6800 * keymap.c (Fsingle_key_description): Handle char ranges.
6801
6802 2012-02-12 Chong Yidong <cyd@gnu.org>
6803
6804 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6805 as that creates a dangerous corner case.
6806
6807 * window.c (Fdelete_window_internal): Invalidate the mouse
6808 highlight (Bug#9904).
6809
6810 2012-02-12 Glenn Morris <rgm@gnu.org>
6811
6812 * xselect.c (Fx_own_selection_internal)
6813 (Fx_get_selection_internal, Fx_disown_selection_internal)
6814 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6815 * nsselect.m (Fx_own_selection_internal)
6816 (Fx_disown_selection_internal, Fx_selection_exists_p)
6817 (Fx_selection_owner_p, Fx_get_selection_internal):
6818 Sync docs and argument specs with the xselect.c versions.
6819
6820 2012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
6821
6822 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6823
6824 2012-02-11 Eli Zaretskii <eliz@gnu.org>
6825
6826 * w32select.c (Fx_selection_exists_p): Sync doc string and
6827 argument list with xselect.c. (Bug#10783)
6828
6829 * w16select.c (Fx_selection_exists_p): Sync doc string and
6830 argument list with xselect.c. (Bug#10783)
6831
6832 2012-02-10 Glenn Morris <rgm@gnu.org>
6833
6834 * fns.c (Fsecure_hash): Doc fix.
6835
6836 2012-02-09 Kenichi Handa <handa@m17n.org>
6837
6838 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
6839
6840 2012-02-07 Chong Yidong <cyd@gnu.org>
6841
6842 * buffer.c (Fbuffer_local_variables)
6843 (buffer_lisp_local_variables): Handle unbound vars correctly;
6844 don't let Qunbound leak into Lisp.
6845
6846 2012-02-07 Glenn Morris <rgm@gnu.org>
6847
6848 * image.c (Fimagemagick_types): Doc fix.
6849
6850 * image.c (imagemagick-render-type): Change it from a lisp object
6851 to an integer. Move the doc here from the lisp manual.
6852 Treat all values not equal to 0 the same.
6853
6854 2012-02-06 Chong Yidong <cyd@gnu.org>
6855
6856 * doc.c (store_function_docstring): Avoid applying docstring of
6857 alias to base function (Bug#2603).
6858
6859 2012-02-04 Andreas Schwab <schwab@linux-m68k.org>
6860
6861 * .gdbinit (pp1, pv1): Remove redundant defines.
6862 (pr): Use pp.
6863
6864 2012-02-04 Chong Yidong <cyd@gnu.org>
6865
6866 * nsterm.m: Declare a global (Bug#10694).
6867
6868 2012-02-04 Eli Zaretskii <eliz@gnu.org>
6869
6870 * w32.c (get_emacs_configuration_options):
6871 Include --enable-checking, if specified, in the return value.
6872
6873 2012-02-04 Martin Rudalics <rudalics@gmx.at>
6874
6875 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6876 after rounding frame sizes. (Bug#9723)
6877
6878 2012-02-04 Eli Zaretskii <eliz@gnu.org>
6879
6880 * keyboard.c (adjust_point_for_property): Don't position point
6881 before BEGV. (Bug#10696)
6882
6883 2012-02-03 Paul Eggert <eggert@cs.ucla.edu>
6884
6885 Handle overflow when computing char display width (Bug#9496).
6886 * character.c (char_width): Return EMACS_INT, not int.
6887 (char_width, c_string_width): Check for overflow when
6888 computing the width; this is possible now that individual
6889 characters can have unbounded width. Problem introduced
6890 by merge from Emacs 23 on 2012-01-19.
6891
6892 2012-02-02 Michael Albinus <michael.albinus@gmx.de>
6893
6894 * dbusbind.c (Fdbus_register_method): Mention the return value
6895 :ignore in the docstring.
6896
6897 2012-02-02 Glenn Morris <rgm@gnu.org>
6898
6899 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
6900
6901 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6902 Unconditionally set to t. (Bug#10673)
6903 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6904 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6905 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
6906
6907 2012-02-02 Kenichi Handa <handa@m17n.org>
6908
6909 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
6910 0, do not call append_composite_glyph.
6911
6912 2012-02-02 Kenichi Handa <handa@m17n.org>
6913
6914 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
6915 NULL (Bug#6988).
6916 (x_produce_glyphs): If the component of a composition is a null
6917 string, set it->pixel_width to 1 to avoid zero-width glyph.
6918
6919 2012-02-01 Eli Zaretskii <eliz@gnu.org>
6920
6921 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
6922 first 2 arguments are identical. This makes inserting large
6923 output from a subprocess an order of magnitude faster on
6924 MS-Windows, where all sbrk'ed memory is always contiguous.
6925
6926 2012-01-31 Glenn Morris <rgm@gnu.org>
6927
6928 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6929 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6930 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
6931
6932 2012-01-29 Glenn Morris <rgm@gnu.org>
6933
6934 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
6935
6936 2012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
6937
6938 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
6939
6940 2012-01-28 Chong Yidong <cyd@gnu.org>
6941
6942 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
6943
6944 2012-01-26 Chong Yidong <cyd@gnu.org>
6945
6946 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
6947
6948 * search.c (Fsearch_forward, Fsearch_backward): Document negative
6949 repeat counts (Bug#10507).
6950
6951 2012-01-26 Glenn Morris <rgm@gnu.org>
6952
6953 * lread.c (syms_of_lread): Doc fix.
6954
6955 2012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
6956
6957 * coding.c (encode_designation_at_bol): Change return value to
6958 EMACS_INT.
6959
6960 2012-01-25 Chong Yidong <cyd@gnu.org>
6961
6962 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
6963
6964 2012-01-21 Chong Yidong <cyd@gnu.org>
6965
6966 * floatfns.c (Fcopysign): Make the second argument non-optional,
6967 since nil is not allowed anyway.
6968
6969 2012-01-21 Andreas Schwab <schwab@linux-m68k.org>
6970
6971 * process.c (read_process_output): Use p instead of XPROCESS (proc).
6972 (send_process): Likewise.
6973
6974 2012-01-19 Martin Rudalics <rudalics@gmx.at>
6975
6976 * window.c (save_window_save, Fcurrent_window_configuration)
6977 (Vwindow_persistent_parameters): Do not use Qstate.
6978 Rewrite doc-strings.
6979
6980 2012-01-19 Kenichi Handa <handa@m17n.org>
6981
6982 * character.c (char_width): New function.
6983 (Fchar_width, c_string_width, lisp_string_width):
6984 Use char_width (Bug#9496).
6985
6986 2012-01-16 Martin Rudalics <rudalics@gmx.at>
6987
6988 * window.c (Vwindow_persistent_parameters): New variable.
6989 (Fset_window_configuration, save_window_save): Handle persistent
6990 window parameters.
6991
6992 2012-01-14 Eli Zaretskii <eliz@gnu.org>
6993
6994 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
6995 thrashing the stack of the thread. (Bug#9087)
6996
6997 2012-01-12 Paul Eggert <eggert@cs.ucla.edu>
6998
6999 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7000
7001 2012-01-11 Eli Zaretskii <eliz@gnu.org>
7002
7003 * xdisp.c (rows_from_pos_range): Handle the case where the
7004 highlight ends on a newline. (Bug#10464)
7005 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7006 he end column for display of highlight that ends on a newline
7007 before a R2L line.
7008
7009 2012-01-11 Glenn Morris <rgm@gnu.org>
7010
7011 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7012 from load-path also when installation-directory is nil. (Bug#10208)
7013
7014 2012-01-10 Glenn Morris <rgm@gnu.org>
7015
7016 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7017
7018 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7019 Update template values to be closer to their typical values these days.
7020
7021 2012-01-09 Eli Zaretskii <eliz@gnu.org>
7022
7023 * xdisp.c (rows_from_pos_range): Accept additional argument
7024 DISP_STRING, and accept any glyph in a row whose object is that
7025 string as eligible for mouse highlight. Fixes mouse highlight of
7026 display strings from overlays. (Bug#10464)
7027
7028 2012-01-07 Paul Eggert <eggert@cs.ucla.edu>
7029
7030 emacs: fix an auto-save permissions race condition (Bug#10400)
7031 * fileio.c (auto_saving_dir_umask): New static var.
7032 (Fmake_directory_internal): Use it.
7033 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7034 creating the directory. The old code temporarily assigns
7035 too-generous permissions to the directory.
7036 (do_auto_save_eh): Clear it.
7037 (Fdo_auto_save): Catch all errors, not just file errors, so
7038 that the var is always cleared.
7039
7040 2012-01-07 Eli Zaretskii <eliz@gnu.org>
7041
7042 * search.c (scan_buffer): Pass character positions to
7043 know_region_cache, not byte positions. (Bug#6540)
7044
7045 2012-01-07 LynX <_LynX@bk.ru> (tiny change)
7046
7047 * w32.c (sys_rename): Report EXDEV when rename of a directory
7048 fails because the target is on another logical disk. (Bug#10284)
7049
7050 2012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7051
7052 * xterm.c (x_embed_request_focus): New function.
7053
7054 * xterm.h: Add prototype.
7055
7056 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7057
7058 2012-01-05 Glenn Morris <rgm@gnu.org>
7059
7060 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7061
7062 2012-01-01 Eli Zaretskii <eliz@gnu.org>
7063
7064 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7065 Load gnutls_transport_set_lowat only if GnuTLS version is below
7066 2.11.1.
7067 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7068 GnuTLS versions below 2.11.1.
7069
7070 2011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7071
7072 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7073 to the doc string advising against its use for altering the way
7074 windows are scrolled.
7075
7076 2011-12-28 Kenichi Handa <handa@m17n.org>
7077
7078 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7079 coding-system ASCII compatible only when it does not produce BOM
7080 on encoding (Bug#10383).
7081
7082 2011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7083
7084 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7085 can scroll.
7086 (create_and_show_popup_menu): Always use menu_position_func for
7087 Gtk3 (Bug#10361).
7088
7089 2011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7090
7091 * callint.c (Fcall_interactively): Don't truncate prompt string.
7092
7093 2011-12-23 Eli Zaretskii <eliz@gnu.org>
7094
7095 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7096 property that ends at ZV, so that the bidi iteration could be
7097 resumed from there (after widening). (Bug#10360)
7098
7099 2011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7100
7101 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7102
7103 2011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7104
7105 * nsterm.m (x_free_frame_resources):
7106 Release f->output_data.ns->miniimage.
7107 (ns_index_color): Fix indentation. Do not retain
7108 color_table->colors[i].
7109
7110 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7111 before returning.
7112
7113 * nsfns.m (x_set_background_color): Assign return value from
7114 ns_index_color to face-background instead of NSColor*.
7115 (ns_implicitly_set_icon_type): Fix indentation.
7116 Change assignment in for loop to comparison.
7117
7118 * emacs.c (ns_pool): New variable.
7119 (main): Assign ns_pool.
7120 (Fkill_emacs): Call ns_release_autorelease_pool.
7121
7122 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7123 autorelease fdesc, release fdAttrs and tdict.
7124 (ns_get_covering_families): Release charset.
7125 (ns_findfonts): Release NSFontDescriptor created with new.
7126 (ns_uni_to_glyphs): Fix indentation.
7127 (setString): Release attrStr before assigning new value.
7128
7129 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7130
7131 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7132 and NS_IMPL_COCOA.
7133 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7134 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7135
7136 2011-12-18 David Reitter <reitter@cmu.edu>
7137
7138 * nsterm.m (ns_term_init): Subscribe for notifications
7139 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7140 to method trackingNotification in EmacsMenu.
7141
7142 * nsmenu.m (trackingMenu): New variable.
7143 (trackingNotification): New method (from Aquamacs).
7144 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
7145 from Aquamacs (Bug#7030).
7146
7147 2011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7148
7149 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7150 (symbol_to_nsstring): Fix indentation.
7151 (ns_symbol_to_pb): New function.
7152 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7153 (Fns_rotate_cut_buffers_internal): Remove.
7154 (Fns_store_selection_internal): Rename from
7155 Fns_store_cut_buffer_internal.
7156 (ns_get_foreign_selection, Fx_own_selection_internal)
7157 (Fx_disown_selection_internal, Fx_selection_exists_p)
7158 (Fns_get_selection_internal, Fns_store_selection_internal):
7159 Use ns_symbol_to_pb and check if return value is nil.
7160 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7161 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
7162 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7163 renamed to Sns_store_selection_internal.
7164 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7165 and remove this function.
7166 (ns_handle_selection_clear): Remove, never used.
7167 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7168 here.
7169
7170 2011-12-17 Ken Brown <kbrown@cornell.edu>
7171
7172 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7173 GID is unknown (Bug#10257).
7174
7175 2011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7176
7177 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7178 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7179 which caused a build failure on GNU/Linux IA-64. This problem was
7180 introduced by my 2011-10-07 patch.
7181
7182 2011-12-15 Juri Linkov <juri@jurta.org>
7183
7184 * image.c (imagemagick_error): New function. (Bug#10112)
7185 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7186 Use `imagemagick_error' where ImageMagick functions return
7187 `MagickFalse'.
7188 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7189 proper order.
7190
7191 2011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7192
7193 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7194 fill background (Bug#8992).
7195
7196 2011-12-13 Martin Rudalics <rudalics@gmx.at>
7197
7198 * window.c (Vwindow_combination_resize)
7199 (Vwindow_combination_limit): Use t instead of non-nil in
7200 doc-strings.
7201 (Vrecenter_redisplay): Add first sentence of doc-string on
7202 separate line.
7203 (Frecenter): Fix doc-string typo.
7204
7205 2011-12-11 Kenichi Handa <handa@m17n.org>
7206
7207 * coding.c (Funencodable_char_position): Pay attention to the
7208 buffer text relocation (Bug#9389).
7209
7210 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7211
7212 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7213 gtk_init (Bug#10100).
7214
7215 2011-12-10 Eli Zaretskii <eliz@gnu.org>
7216
7217 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7218 IT->string is nil. (Bug#10263)
7219
7220 2011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7221
7222 * nsterm.h (x_free_frame_resources): Declare.
7223
7224 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7225 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7226
7227 * nsterm.h (ns_get_defaults_value): Declare.
7228
7229 * nsterm.m (ns_default): Call ns_get_defaults_value.
7230
7231 2011-12-09 Eli Zaretskii <eliz@gnu.org>
7232
7233 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7234 (Bug#10170)
7235
7236 2011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7237
7238 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7239 that where the value of an _OBJC_* symbol points to is in the .bss
7240 section (Bug#10240).
7241
7242 2011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7243
7244 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
7245 after the loop to call ccl_driver at least once (Bug#8619).
7246
7247 2011-12-08 Kenichi Handa <handa@m17n.org>
7248
7249 * ftfont.c (get_adstyle_property): Fix previous change
7250 (Bug#10233).
7251
7252 2011-12-07 Juanma Barranquero <lekktu@gmail.com>
7253
7254 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7255 dirs from the default value of EMACSLOADPATH (bug#10208).
7256
7257 2011-12-07 Glenn Morris <rgm@gnu.org>
7258
7259 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7260 installation and source directories as well. (Bug#10208)
7261
7262 2011-12-06 Chong Yidong <cyd@gnu.org>
7263
7264 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7265
7266 2011-12-06 Glenn Morris <rgm@gnu.org>
7267
7268 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7269 as an error, not just -1. (Bug#10217)
7270
7271 2011-12-05 Chong Yidong <cyd@gnu.org>
7272
7273 * keyboard.c (process_special_events): New function.
7274 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7275
7276 2011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7277
7278 * coding.c (encode_designation_at_bol): Don't use uninitialized
7279 local variable (Bug#9318).
7280
7281 2011-12-05 Kenichi Handa <handa@m17n.org>
7282
7283 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7284 return Qnil (Bug#8046, Bug#10193).
7285
7286 2011-12-05 Kenichi Handa <handa@m17n.org>
7287
7288 * coding.c (encode_designation_at_bol): New args charbuf_end and
7289 dst. Return the number of produced bytes. Callers changed.
7290 (coding_set_source): Return how many bytes coding->source was
7291 relocated.
7292 (coding_set_destination): Return how many bytes
7293 coding->destination was relocated.
7294 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
7295 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
7296
7297 2011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7298
7299 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7300 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7301 macro (Bug#9318).
7302
7303 2011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7304
7305 The following changes are to fix Bug#9318.
7306
7307 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
7308 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7309 (encode_coding_iso_2022, encode_coding_sjis)
7310 (encode_coding_big5, encode_coding_charset): Use the above macros.
7311
7312 2011-12-05 Juanma Barranquero <lekktu@gmail.com>
7313
7314 * lisp.h (process_quit_flag): Fix external declaration.
7315
7316 2011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7317
7318 Don't macro-inline non-performance-critical code.
7319 * eval.c (process_quit_flag): New function.
7320 * lisp.h (QUIT): Use it.
7321
7322 2011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7323
7324 * nsfns.m (get_geometry_from_preferences): New function.
7325 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7326
7327 2011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7328
7329 * emacs.c (Qkill_emacs): Define.
7330 (syms_of_emacs): Initialize it.
7331 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7332 Qquit_flag to `kill-emacs' instead.
7333 (quit_throw_to_read_char): Add parameter `from_signal'.
7334 All callers changed. Call Fkill_emacs if requested and safe.
7335 * lisp.h (QUIT): Call Fkill_emacs if requested.
7336
7337 2011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7338
7339 * widget.c (update_wm_hints): Return if wmshell is null.
7340 (widget_update_wm_size_hints): New function.
7341
7342 * widget.h (widget_update_wm_size_hints): Declare.
7343
7344 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7345 widget_update_wm_size_hints (Bug#10104).
7346
7347 2011-12-03 Eli Zaretskii <eliz@gnu.org>
7348
7349 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7350 before a newline, prepare the bidi iterator for consuming the
7351 newline, and keep the current paragraph direction. (Bug#10183)
7352 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
7353
7354 2011-12-02 Juri Linkov <juri@jurta.org>
7355
7356 * search.c (Fword_search_regexp): New Lisp function created from
7357 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7358 (Fword_search_backward, Fword_search_forward)
7359 (Fword_search_backward_lax, Fword_search_forward_lax):
7360 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7361 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7362
7363 2011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7364
7365 * fileio.c (Finsert_file_contents): Move after-change-function call
7366 to before the "handled:" label, since all "goto handled" appear in
7367 cases where the *-change-functions have already been properly called
7368 (bug#10117).
7369
7370 2011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7371
7372 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7373 waiting for input. (Bug#10169)
7374
7375 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7376
7377 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7378 verifies glyph row's hash code--we have just reallocated the
7379 glyphs, so their contents can be complete garbage. (Bug#10164)
7380
7381 2011-11-30 Juanma Barranquero <lekktu@gmail.com>
7382
7383 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7384
7385 2011-11-30 Eli Zaretskii <eliz@gnu.org>
7386
7387 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7388 attributes are tested _before_ calling verify_row_hash, to protect
7389 against GCC re-ordering of the tests. (Bug#10164)
7390
7391 2011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7392
7393 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7394
7395 * xterm.c (handle_one_xevent): Only set async_visible and friends
7396 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7397 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
7398 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7399
7400 2011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7401
7402 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7403 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7404 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7405 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7406 All uses changed to use GCPRO1 etc.
7407 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7408 Revert to old implementation (i.e., before 2011-03-11).
7409
7410 2011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7411
7412 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7413 of scroll runs so as to avoid assigning disabled bogus rows and
7414 unnecessary graphics copy operations.
7415
7416 2011-11-27 Eli Zaretskii <eliz@gnu.org>
7417
7418 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7419 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7420 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7421 (malloc, free, realloc, calloc): Redirect to e_* only when
7422 compiling Emacs.
7423
7424 * lisp.h (GCTYPEBITS): Move before first use.
7425 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7426 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7427 this macro definition.
7428
7429 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7430 _MSC_VER.
7431
7432 2011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7433
7434 * gtkutil.c (xg_create_frame_widgets):
7435 Call gtk_window_set_has_resize_grip (FALSE) if that function is
7436 present with Gtk+ 2.0.
7437
7438 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7439
7440 * fileio.c (Finsert_file_contents): Undo previous change; see
7441 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7442
7443 2011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7444
7445 Rename locals to avoid shadowing.
7446 * fileio.c (Finsert_file_contents):
7447 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7448 * process.c (wait_reading_process_output):
7449 Rename inner 'proc' to 'p' to avoid shadowing.
7450 Indent for consistency with usual Emacs style.
7451
7452 2011-11-25 Eli Zaretskii <eliz@gnu.org>
7453
7454 * xdisp.c (redisplay_window): If cursor row is not fully visible
7455 after recentering, and scroll-conservatively is set to a large
7456 number, scroll window by a few more lines to make the cursor fully
7457 visible and out of scroll-margin. (Bug#10105)
7458 (start_display): Don't move to the next line if the display should
7459 start at a newline that is part of a display vector or an overlay
7460 string. (Bug#10119)
7461
7462 2011-11-24 Juri Linkov <juri@jurta.org>
7463
7464 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7465 after the `MagickPingImage' call. (Bug#10112)
7466
7467 2011-11-23 Chong Yidong <cyd@gnu.org>
7468
7469 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7470
7471 2011-11-23 Martin Rudalics <rudalics@gmx.at>
7472
7473 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7474 making another buffer current. (Bug#10114)
7475
7476 2011-11-23 Glenn Morris <rgm@gnu.org>
7477
7478 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7479
7480 2011-11-23 Chong Yidong <cyd@gnu.org>
7481
7482 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7483 using it (Bug#5984).
7484
7485 2011-11-22 Eli Zaretskii <eliz@gnu.org>
7486
7487 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7488 and header-lines, as they don't have one computed for them.
7489 (Bug#10098)
7490
7491 * .gdbinit (prow): Make displayed values more self-explaining.
7492 Add row's hash code.
7493
7494 2011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7495
7496 * process.c (wait_reading_process_output): Fix asynchrounous
7497 GnuTLS socket handling on some versions of the GnuTLS library.
7498 (wait_reading_process_output): Add comment and URL.
7499
7500 2011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7501
7502 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7503
7504 2011-11-21 Chong Yidong <cyd@gnu.org>
7505
7506 * window.c (Fnext_window, Fprevious_window): Doc fix.
7507
7508 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7509
7510 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7511
7512 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7513
7514 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7515
7516 2011-11-20 Martin Rudalics <rudalics@gmx.at>
7517
7518 * window.c (Fset_window_combination_limit): Rename argument
7519 STATUS to LIMIT.
7520 (Vwindow_combination_limit): Remove "status" from doc-string.
7521
7522 2011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7523
7524 * m/ibms390.h: Remove.
7525 * m/ibms390x.h: Don't include "ibms390.h".
7526
7527 2011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7528
7529 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7530 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7531
7532 2011-11-20 Juanma Barranquero <lekktu@gmail.com>
7533
7534 * casetab.c (Fset_case_table):
7535 * charset.c (Fcharset_after): Fix typos.
7536
7537 2011-11-20 Paul Eggert <eggert@cs.ucla.edu>
7538
7539 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7540 Otherwise, valgrind does not work on some platforms.
7541 Problem reported by Andreas Schwab in
7542 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7543 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7544 is set, removing the need for VIRT_ADDRESS_VARIES.
7545 (PURE_P): Use a more-efficient implementation that needs just one
7546 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7547 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7548 to 4 (xorl, subq, cmpq, setbe).
7549 * alloc.c (pure): Always extern now, since that's the
7550 VIRT_ADDR_VARIES behavior.
7551 (PURE_POINTER_P): Use a single comparison, not two, for
7552 consistency with the new puresize.h.
7553 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7554 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7555 Remove VIRT_ADDR_VARIES no longer needed.
7556
7557 2011-11-19 Eli Zaretskii <eliz@gnu.org>
7558
7559 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7560 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7561 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7562 behave as if the cursor position were at the window margin.
7563
7564 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7565 and the cursor position is out of bounds, behave as if the cursor
7566 position were at the window margin. (Bug#10075)
7567
7568 2011-11-18 Chong Yidong <cyd@gnu.org>
7569
7570 * window.c (Fwindow_combination_limit): Make first argument
7571 non-optional, since it is meaningless for live windows like the
7572 selected window.
7573
7574 2011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7575
7576 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7577
7578 2011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7579
7580 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7581 (graft_intervals_into_buffer): Simplify.
7582
7583 2011-11-18 Eli Zaretskii <eliz@gnu.org>
7584
7585 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7586 hash values of the two rows.
7587 (copy_row_except_pointers): Preserve the used[] arrays and the
7588 hash values of the two rows. (Bug#10035)
7589 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
7590
7591 * xdisp.c (row_hash): New function, body extracted from
7592 compute_line_metrics.
7593 (compute_line_metrics): Call row_hash, instead of computing the
7594 hash code inline.
7595
7596 * dispnew.c (verify_row_hash): Call row_hash for computing the
7597 hash code of a row, instead of duplicating code from xdisp.c.
7598
7599 * dispextern.h (row_hash): Add prototype.
7600
7601 2011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7602
7603 * frame.c (delete_frame): Don't delete the terminal when the last
7604 X frame is closed if emacs is built with GTK toolkit.
7605
7606 2011-11-17 Juanma Barranquero <lekktu@gmail.com>
7607
7608 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7609
7610 2011-11-17 Martin Rudalics <rudalics@gmx.at>
7611
7612 * window.c (Vwindow_splits): Rename to
7613 Vwindow_combination_resize. Suggested by Juri Linkov.
7614 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7615 of Vwindow_splits.
7616
7617 2011-11-16 Juanma Barranquero <lekktu@gmail.com>
7618
7619 * nsfns.m (Fns_font_name):
7620 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
7621
7622 2011-11-16 Martin Rudalics <rudalics@gmx.at>
7623
7624 * window.h (window): Rename slot "nest" to "combination_limit".
7625 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7626 (Fset_window_nest): Rename to Fset_window_combination_limit.
7627 (Vwindow_nest): Rename to Vwindow_combination_limit.
7628 (recombine_windows, make_parent_window, make_window)
7629 (Fsplit_window_internal, saved_window)
7630 (Fset_window_configuration, save_window_save): Rename all
7631 occurrences of window_nest to window_combination_limit.
7632
7633 2011-11-15 Juanma Barranquero <lekktu@gmail.com>
7634
7635 * image.c (imagemagick_load_image): Fix typo.
7636
7637 2011-11-14 Eli Zaretskii <eliz@gnu.org>
7638
7639 * xdisp.c (display_line): Move the call to
7640 highlight_trailing_whitespace before the call to
7641 compute_line_metrics, since the latter needs to see the final
7642 faces of all the glyphs to compute ROW's hash value.
7643 Fixes assertion violations in row_equal_p. (Bug#10035)
7644
7645 2011-11-14 Juanma Barranquero <lekktu@gmail.com>
7646
7647 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7648 just return (bug#10044).
7649
7650 2011-11-12 Eli Zaretskii <eliz@gnu.org>
7651
7652 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7653 with user-defined heap size. Bump the default size of the temacs
7654 heap to 27MB, to avoid memory warning when running temacs.
7655 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7656
7657 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7658 current_matrix and desired_matrix. (Bug#9990)
7659 (verify_row_hash) [XASSERTS]: New function.
7660 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7661 that the hash value of glyph rows is correct.
7662
7663 2011-11-12 Martin Rudalics <rudalics@gmx.at>
7664
7665 * window.h (window): Remove splits slot.
7666 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7667 (Fdelete_other_windows_internal, make_parent_window)
7668 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7669 (Fset_window_configuration, save_window_save): Don't deal with
7670 split status of windows.
7671 (saved_window): Remove splits slot.
7672 (Vwindow_splits): Rewrite doc-string.
7673
7674 2011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7675
7676 * xfns.c (unwind_create_frame):
7677 * nsfns.m (unwind_create_frame):
7678 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7679 Vframe_list (Bug#9999).
7680
7681 2011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7682
7683 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
7684
7685 2011-11-11 Kenichi Handa <handa@m17n.org>
7686
7687 * callproc.c (Fcall_process): Set the member dst_multibyte of
7688 process_coding.
7689
7690 2011-11-11 Johan Bockgård <bojohan@gnu.org>
7691
7692 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7693 avoid a crash (bug#9496).
7694
7695 2011-11-09 Chong Yidong <cyd@gnu.org>
7696
7697 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7698 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7699
7700 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7701
7702 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7703
7704 2011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7705
7706 Avoid some portability problems by eschewing 'extern inline' functions.
7707 The trivial performance wins aren't worth the portability hassles; see
7708 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7709 et seq.
7710 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7711 (window_box_width, window_box_left, window_box_left_offset)
7712 (window_box_right, window_box_right_offset): Undo previous change,
7713 by removing the "extern"s.
7714 * intervals.c (adjust_intervals_for_insertion)
7715 (adjust_intervals_for_deletion): Undo previous change,
7716 making these static again.
7717 (offset_intervals, temp_set_point_both, temp_set_point)
7718 (copy_intervals_to_string): No longer inline.
7719 * xdisp.c (window_text_bottom_y, window_box_width)
7720 (window_box_height, window_box_left_offset)
7721 (window_box_right_offset, window_box_left, window_box_right)
7722 (window_box): No longer inline.
7723
7724 2011-11-08 Chong Yidong <cyd@gnu.org>
7725
7726 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
7727 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7728 Signal an error if not a live window.
7729 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7730 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7731
7732 2011-11-07 Juanma Barranquero <lekktu@gmail.com>
7733
7734 * lisp.h (syms_of_abbrev): Remove declaration.
7735 Reported by CHENG Gao <chenggao@royau.me>.
7736
7737 2011-11-07 Eli Zaretskii <eliz@gnu.org>
7738
7739 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7740 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7741 of temacs in GUI mode.
7742
7743 2011-11-07 Martin Rudalics <rudalics@gmx.at>
7744
7745 * window.h: Declare delete_all_child_windows instead of
7746 delete_all_subwindows.
7747 * window.c (Fwindow_nest, Fset_window_nest)
7748 (Fset_window_new_total, Fset_window_new_normal)
7749 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7750 (delete_all_subwindows): Rename to delete_all_child_windows.
7751 (Fdelete_other_windows_internal, Fset_window_configuration):
7752 Call delete_all_child_windows instead of delete_all_subwindows.
7753 * frame.c (delete_frame): Call delete_all_child_windows instead
7754 of delete_all_subwindows.
7755
7756 2011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7757
7758 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7759 This is also needed for porting to any host where GC_MARK_STACK is
7760 not GC_MAKE_GCPROS_NOOPS.
7761 (which_symbols): Use it.
7762
7763 2011-11-07 Kenichi Handa <handa@m17n.org>
7764
7765 * coding.c (coding_set_destination): Check coding->src_pos only
7766 when coding->src_object is a buffer (bug#9910).
7767
7768 * process.c (send_process): Set the member src_multibyte of coding
7769 to 0 (bug#9911) when sending a unibyte text.
7770
7771 * callproc.c (Fcall_process): Set the member src_multibyte of
7772 process_coding to 0 (bug#9912).
7773
7774 2011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7775
7776 * xmenu.c (cleanup_widget_value_tree): New function.
7777 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7778 calling free_menubar_widget_value_tree directly (Bug#9830).
7779
7780 2011-11-06 Paul Eggert <eggert@cs.ucla.edu>
7781
7782 Fix some portability problems with 'inline'.
7783 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7784 (window_box_width, window_box_left, window_box_left_offset)
7785 (window_box_right, window_box_right_offset): Declare extern.
7786 Otherwise, these inline functions do not conform to C99 and
7787 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
7788 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7789 * intervals.c (adjust_intervals_for_insertion)
7790 (adjust_intervals_for_deletion): Now extern, because otherwise the
7791 extern inline functions 'offset_intervals' couldn't refer to it.
7792 (static_offset_intervals): Remove.
7793 (offset_intervals): Rewrite using the old contents of
7794 static_offset_intervals. The old version didn't conform to C99
7795 because an extern inline function contained a reference to an
7796 identifier with static linkage.
7797
7798 2011-11-06 Andreas Schwab <schwab@linux-m68k.org>
7799
7800 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7801 GC.
7802
7803 2011-11-06 Eli Zaretskii <eliz@gnu.org>
7804
7805 * xdisp.c (init_iterator, reseat_to_string): Don't set the
7806 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
7807 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7808 return Qleft_to_right.
7809
7810 2011-11-06 Chong Yidong <cyd@gnu.org>
7811
7812 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7813 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7814 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7815 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7816 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7817 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7818 (Fwindow_vscroll): Doc fix.
7819 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7820 argument, since it makes no sense to pass a live window and for
7821 consistency with window-child.
7822
7823 2011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
7824
7825 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
7826 support MSVC.
7827
7828 2011-11-05 Jason Rumney <jasonr@gnu.org>
7829
7830 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
7831 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
7832 fonts (Bug#6029).
7833 (add_font_entity_to_list): Fix logic errors in mixed boolean and
7834 bitwise arithmetic preventing use of unicode-sip and non-truetype
7835 opentype fonts.
7836
7837 2011-11-05 Eli Zaretskii <eliz@gnu.org>
7838
7839 * s/ms-w32.h (fstat, stat, utime): Move redirections to
7840 "emacs"-only part.
7841
7842 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
7843 initialization code to keep similarity to xfns.c after changes
7844 from 2011-11-05.
7845
7846 2011-11-05 Jan Djärv <jan.h.d@swipnet.se>
7847
7848 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7849 (unwind_create_frame): New function (Bug#9943).
7850 (Fx_create_frame): Restructure code to be more similar to the one in
7851 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
7852 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7853 Move terminal->reference_count++ just before making the frame official
7854 (Bug#9943).
7855
7856 * nsterm.m (x_free_frame_resources): New function.
7857 (x_destroy_window): Move code to x_free_frame_resources.
7858
7859 * xfns.c (unwind_create_frame): Fix comment.
7860 (Fx_create_frame, x_create_tip_frame):
7861 Move terminal->reference_count++ just before making the frame
7862 official. Move initialization of image_cache_refcount and
7863 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7864
7865 2011-11-05 Eli Zaretskii <eliz@gnu.org>
7866
7867 Support MSVC build with newer versions of Visual Studio.
7868 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7869 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
7870 nt/gmake.defs.
7871
7872 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7873 which are not supported by MSVC.
7874 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7875 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7876 bitfields.
7877 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7878 types in bitfields.
7879 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7880
7881 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7882
7883 2011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
7884
7885 Support MSVC build with newer versions of Visual Studio.
7886 * w32.c: Don't include w32api.h for MSVC.
7887 (init_environment) [_MSC_VER]: Call sys_access, not _access.
7888
7889 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7890 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
7891 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
7892 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
7893 e_* cousins.
7894 (alloca) [_MSC_VER]: Define to _alloca.
7895
7896 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
7897
7898 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
7899
7900 2011-11-04 Eli Zaretskii <eliz@gnu.org>
7901
7902 * xdisp.c (note_mouse_highlight): If either of
7903 previous/next-single-property-change returns nil, treat that as
7904 the beginning or the end of the buffer. (Bug#9955)
7905
7906 2011-11-04 Jan Djärv <jan.h.d@swipnet.se>
7907
7908 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
7909 label is not null (Bug#9951).
7910 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
7911 may be NULL.
7912
7913 2011-11-04 Eli Zaretskii <eliz@gnu.org>
7914
7915 * window.c (Fwindow_body_size): Mention in the doc string that the
7916 return value is in frame's canonical units. (Bug#9949)
7917
7918 2011-11-03 Eli Zaretskii <eliz@gnu.org>
7919
7920 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
7921
7922 * w32fns.c (unwind_create_frame): If needed, free the glyph
7923 matrices of the partially constructed frame. (Bug#9943)
7924 * xfns.c (unwind_create_frame): Likewise.
7925
7926 2011-11-01 Eli Zaretskii <eliz@gnu.org>
7927
7928 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
7929 Don't stop backward scan on the continuation glyph, even though
7930 its CHARPOS is positive.
7931 (mouse_face_from_buffer_pos, note_mouse_highlight):
7932 Rename cover_string to disp_string.
7933
7934 2011-11-01 Martin Rudalics <rudalics@gmx.at>
7935
7936 * window.c (temp_output_buffer_show): Don't use
7937 Vtemp_buffer_show_specifiers.
7938 (Vtemp_buffer_show_specifiers): Remove unused variable.
7939
7940 2011-10-30 Eli Zaretskii <eliz@gnu.org>
7941
7942 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
7943 past the beginning of the current glyph matrix.
7944
7945 2011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
7946
7947 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
7948 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
7949 HAVE_GTK3 (Bug#9869).
7950
7951 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
7952 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
7953
7954 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
7955
7956 * xterm.c: Declare x_handle_net_wm_state to return int.
7957 (handle_one_xevent): Check if we are iconified but don't have
7958 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
7959 (get_current_wm_state): Return non-zero if not hidden,
7960 check for _NET_WM_STATE_HIDDEN (Bug#9893).
7961 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
7962 (x_handle_net_wm_state): Return what get_current_wm_state returns.
7963 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
7964
7965 2011-10-29 Paul Eggert <eggert@cs.ucla.edu>
7966
7967 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
7968 so that this new function doesn't get optimized away by a
7969 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
7970
7971 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7972
7973 * frame.h (MOUSE_HL_INFO): Remove excess parens.
7974
7975 2011-10-29 Eli Zaretskii <eliz@gnu.org>
7976
7977 Fix the `xbytecode' command.
7978 * .gdbinit (xprintbytestr): New command.
7979 (xwhichsymbols): Rename from `which'; all callers changed.
7980 (xbytecode): Print the byte-code string as well.
7981
7982 2011-10-29 Kim Storm <storm@cua.dk>
7983
7984 * alloc.c (which_symbols): New function.
7985
7986 2011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7987
7988 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
7989 line. (Bug#9903)
7990
7991 2011-10-29 Glenn Morris <rgm@gnu.org>
7992
7993 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
7994 Not clear what it was for, and it causes various bugs. (Bug#9839)
7995
7996 2011-10-28 Eli Zaretskii <eliz@gnu.org>
7997
7998 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
7999 possible random value that matches one of those tested as
8000 condition to clear the mouse face.
8001
8002 2011-10-28 Chong Yidong <cyd@gnu.org>
8003
8004 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8005
8006 2011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8007
8008 * window.c (make_window): Initialize phys_cursor_on_p.
8009
8010 2011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8011
8012 * lisp.h (struct Lisp_Symbol): Update comments.
8013
8014 2011-10-28 Juanma Barranquero <lekktu@gmail.com>
8015
8016 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8017
8018 2011-10-28 Eli Zaretskii <eliz@gnu.org>
8019
8020 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8021 <oslsachem@gmail.com> for helping to debug this.
8022
8023 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8024 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8025 (g_b_init_get_glyph_outline_w): New static variables.
8026 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8027 (GetGlyphOutlineW_Proc): New typedefs.
8028 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
8029 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8030 New functions.
8031 (w32font_open_internal, compute_metrics):
8032 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
8033 instead of calling the "wide" APIs directly.
8034
8035 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8036
8037 * w32.h (syms_of_w32font): Add prototype.
8038
8039 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8040
8041 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8042 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8043 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8044 (Fmove_to_window_line): Doc fix.
8045
8046 2011-10-27 Chong Yidong <cyd@gnu.org>
8047
8048 * process.c (make_process): Set gnutls_state to NULL.
8049
8050 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8051 non-NULL, regardless of GNUTLS_INITSTAGE.
8052 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8053 an error. Set process slots as soon as we allocate them.
8054
8055 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8056
8057 2011-10-27 Chong Yidong <cyd@gnu.org>
8058
8059 * gnutls.c (emacs_gnutls_deinit): New function.
8060 Deallocate credentials structures as well as calling gnutls_deinit.
8061 (Fgnutls_deinit, Fgnutls_boot): Use it.
8062
8063 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8064 (deactivate_process): Call emacs_gnutls_deinit.
8065
8066 2011-10-27 Juanma Barranquero <lekktu@gmail.com>
8067
8068 * image.c (x_create_x_image_and_pixmap):
8069 * w32.c (sys_rename, w32_delayed_load):
8070 * w32font.c (fill_in_logfont):
8071 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8072
8073 2011-10-26 Juanma Barranquero <lekktu@gmail.com>
8074
8075 * w32fns.c (w32_default_color_map): New function,
8076 extracted from Fw32_default_color_map.
8077 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
8078
8079 2011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8080
8081 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8082
8083 2011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8084
8085 * keyboard.c (test_undefined): New function (bug#9751).
8086 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8087
8088 2011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8089
8090 * sysdep.c (init_sys_modes): Fix the check for the controlling
8091 terminal (Bug#6649).
8092
8093 2011-10-20 Eli Zaretskii <eliz@gnu.org>
8094
8095 * dispextern.h (struct bidi_it): New member next_en_type.
8096
8097 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8098 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8099 current character, check also for next_en_type being WEAK_EN.
8100 (bidi_resolve_weak): Don't enter the expensive loop if the current
8101 position is before next_en_pos. Record the bidi type of the first
8102 non-ET, non-BN character we find, in addition to its position.
8103 (bidi_level_of_next_char): Invalidate next_en_type when
8104 next_en_pos is over-stepped.
8105
8106 2011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8107
8108 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8109 * editfns.c: Rewrite current-time-zone so that it invokes
8110 the equivalent of (format-time-string "%Z") to get the time zone name.
8111 This fixes a bug when the time zone name contains characters that
8112 need converting from the system time locale to Emacs internal format.
8113 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8114 that patch fixed format-time-string to do the conversion, but
8115 I forgot to fix current-time-zone.
8116 (format_time_string): New function, containing most of
8117 what Fformat_time_string used to contain.
8118 (Fformat_time_string): Rewrite in terms of format_time_string.
8119 This doesn't change this function's behavior.
8120 (current-time-zone): Rewrite to use format_time_string.
8121 This fixes the bug reported by Michael Schierl in
8122 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8123 Jason Rumney's 2007-06-07 change worked around this bug, but
8124 didn't fix it.
8125 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8126
8127 2011-10-19 Eli Zaretskii <eliz@gnu.org>
8128
8129 * xdisp.c (start_display): If the character at POS is displayed
8130 via a display vector, reset IT->current.dpvec_index to zero.
8131 (try_window_reusing_current_matrix): If a line ends in a display
8132 vector or the next line starts in a display vector, continue
8133 redrawing the window even though the character position of
8134 start_row was reached.
8135 (Bug#9771, part 2)
8136
8137 2011-10-18 Chong Yidong <cyd@gnu.org>
8138
8139 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8140 with nobreak-char-display too.
8141
8142 2011-10-18 Eli Zaretskii <eliz@gnu.org>
8143
8144 Fix part 3 of bug#9771.
8145 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8146 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8147 non-neutral characters if the current character is a paragraph
8148 separator (a.k.a. Newline). This avoids running the same
8149 expensive loop twice, once when we consume the preceding newline
8150 and the other time when the line actually needs to be displayed.
8151 Avoid the loop when we see neutrals on the base embedding level
8152 following a character whose directionality is the same as the
8153 paragraph's. This avoids running the expensive loop when a line
8154 ends in a long sequence of neutrals, like control characters.
8155 Add assertion against STRONG_AL type. Slightly rearrange code
8156 that determines the type of a neutral given the first non-neutral
8157 that follows it.
8158 (bidi_level_of_next_char): Set next_en_pos to zero when
8159 invalidating its info.
8160
8161 2011-10-17 Eli Zaretskii <eliz@gnu.org>
8162
8163 * xdisp.c (push_display_prop): Determine whether to record string
8164 or buffer position by IT->string, not by IT->method. Allow
8165 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
8166 (move_it_vertically_backward): Don't look for character position
8167 immediately after the newline when in a continuation line.
8168 (Bug#9771, part 1)
8169
8170 2011-10-15 Martin Rudalics <rudalics@gmx.at>
8171
8172 * window.c (coordinates_in_window): Rewrite and delabelize
8173 vertical border check. (Bug#5357) (Bug#9618)
8174
8175 2011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8176
8177 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8178 errors in XSetWindowBorder (bug#9310).
8179
8180 2011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8181
8182 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8183 avoid crash when xmalloc overrun checking is enabled.
8184
8185 2011-10-13 Eli Zaretskii <eliz@gnu.org>
8186
8187 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8188 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8189 cursor motion with <left> and <right> arrow keys.
8190
8191 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8192 some callers set that themselves.
8193
8194 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8195
8196 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8197 display string and the previous row comes from the same string and
8198 is empty. (Bug#9739) (Bug#9738)
8199
8200 2011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8201
8202 * doc.c (get_doc_string): Encode file name (bug#9735).
8203
8204 2011-10-12 Eli Zaretskii <eliz@gnu.org>
8205
8206 * bidi.c (bidi_level_of_next_char):
8207 * xdisp.c (get_visually_first_element): Remove old incorrect
8208 comments regarding the Unicode Line Separator character.
8209
8210 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8211
8212 2011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8213
8214 * alloc.c (Fgc_status): Do not access beyond zombies array
8215 boundary if nzombies > MAX_ZOMBIES.
8216 * alloc.c (dump_zombies): Add missing format specifier.
8217
8218 2011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8219
8220 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8221 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8222
8223 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8224 Some packages use them to denote characters with modifiers.
8225
8226 2011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8227
8228 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8229 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8230 matching a pp-number. Rename parameter var to var1.
8231
8232 2011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8233
8234 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8235
8236 2011-10-08 Glenn Morris <rgm@gnu.org>
8237
8238 * callint.c (Fcall_interactively): Give a more explicit error for the
8239 'c' case with a non-character input. (Bug#8479)
8240
8241 2011-10-08 Eli Zaretskii <eliz@gnu.org>
8242
8243 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8244 lines.
8245 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8246 lines that are hscrolled on the left.
8247
8248 * dispnew.c (buffer_posn_from_coords): Account for a possible
8249 presence of header-line. (Bug#4426)
8250
8251 2011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8252
8253 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8254 Don't advertise functionality which we discourage or doesn't work.
8255
8256 2011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8257
8258 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8259 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8260 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8261 this makes Emacs dump core during garbage collection on rare
8262 occasions. sizeof is obviously inferior to offsetof here, so
8263 stick with offsetof.
8264 (GC_POINTER_ALIGNMENT): New macro.
8265 (mark_memory): Omit 3rd (offset) arg; caller changed.
8266 Don't assume EMACS_INT alignment is the same as pointer alignment.
8267
8268 2011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8269
8270 * keyboard.c (read_key_sequence_remapped): New var.
8271 (read_key_sequence): Compute remapping in the right buffer.
8272 (command_loop_1): Use read_key_sequence's remapping directly.
8273
8274 2011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8275
8276 * dired.c (file_name_completion): Don't expand file name.
8277 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8278 before checking file name handler.
8279
8280 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8281 they've been requested explicitly (bug#9591).
8282
8283 2011-10-01 Andreas Schwab <schwab@linux-m68k.org>
8284
8285 * keymap.c (Fsingle_key_description): Use make_specified_string
8286 instead of build_string to build string from push_key_description.
8287 (Bug#5193)
8288
8289 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8290
8291 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8292 This fixes a Y2038 bug on 64-bit hosts.
8293 * buffer.c (reset_buffer):
8294 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8295 (Fclear_buffer_auto_save_failure):
8296 Use 0, not -1, to represent an unset failure time, since time_t
8297 might not be signed.
8298
8299 Remove dependency on glibc malloc internals.
8300 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8301 Move back here from lisp.h, but with their new implementations.
8302 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8303 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8304 * charset.c (charset_table_init): New static var.
8305 (syms_of_charset): Use it instead of xmalloc. This removes a
8306 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8307 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8308 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8309 Move back to alloc.c.
8310 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8311 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8312
8313 2011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8314
8315 * nsterm.m (windowDidResize): Call x_set_window_size only when
8316 ns_in_resize is true. Otherwise set pixelwidth/height and
8317 call change_frame_size (Bug#9628).
8318
8319 2011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8320
8321 Port --enable-checking=all to Fedora 14 x86-64.
8322 * charset.c (syms_of_charset): Also account for glibc malloc's
8323 internal overhead when calculating the initial malloc maximum.
8324
8325 Port --enable-checking=all to Fedora 14 x86.
8326 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8327 Move to lisp.h.
8328 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8329 (overrun_check_realloc, overrun_check_free):
8330 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8331 That way, xmalloc returns a properly-aligned pointer even if
8332 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8333 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8334 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8335 into account when calculating the initial malloc maximum.
8336 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8337 Move here from alloc.c, so that charset.c can use it too.
8338 Properly align; the old code wasn't right for common 32-bit hosts
8339 when configured with --enable-checking=all.
8340 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8341 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8342
8343 2011-09-29 Eli Zaretskii <eliz@gnu.org>
8344
8345 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
8346 use EDOM.
8347
8348 2011-09-28 Eli Zaretskii <eliz@gnu.org>
8349
8350 * xdisp.c (compute_display_string_end): If there's no display
8351 string at CHARPOS, return -1.
8352
8353 * bidi.c (bidi_fetch_char): When compute_display_string_end
8354 returns a negative value, treat the character as a normal
8355 character not covered by a display string. (Bug#9624)
8356
8357 2011-09-28 Juanma Barranquero <lekktu@gmail.com>
8358
8359 * lread.c (Fread_from_string): Fix typo in docstring.
8360
8361 2011-09-27 Eli Zaretskii <eliz@gnu.org>
8362
8363 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8364 newline, reseat the iterator instead of bidi-iterating there one
8365 character at a time. (Bug#9610)
8366 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8367 TO_CHARPOS if the bidi iterator is at base embedding level.
8368
8369 2011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8370
8371 * lread.c (readevalloop): Use correct code for NBSP.
8372 (read1): Likewise. (Bug#9608)
8373
8374 2011-09-25 Michael Albinus <michael.albinus@gmx.de>
8375
8376 * dbusbind.c (Fdbus_register_signal): When service is not
8377 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8378
8379 2011-09-25 Glenn Morris <rgm@gnu.org>
8380
8381 * buffer.c (truncate-lines): Doc fix.
8382
8383 2011-09-24 Chong Yidong <cyd@stupidchicken.com>
8384
8385 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8386 (Fset_window_next_buffers): Doc fix.
8387
8388 2011-09-24 Glenn Morris <rgm@gnu.org>
8389
8390 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8391
8392 2011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8393
8394 Fix minor problems found by static checking.
8395 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
8396 * indent.c (Fvertical_motion): Fix == vs = typo.
8397
8398 2011-09-24 Eli Zaretskii <eliz@gnu.org>
8399
8400 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8401 Default value is now t. Doc fix.
8402
8403 * indent.c (Fvertical_motion): Compute and apply the overshoot
8404 logic when moving up, not only when moving down. Fix the
8405 confusing name and values of the it_overshoot_expected variable;
8406 logic changes accordingly. (Bug#9254) (Bug#9549)
8407
8408 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8409 CHARPOS is covered by a display string which includes newlines.
8410 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8411 is covered by a display string with embedded newlines.
8412
8413 2011-09-24 Michael Albinus <michael.albinus@gmx.de>
8414
8415 * dbusbind.c (Fdbus_register_signal): Add match rule to
8416 Vdbus_registered_objects_table. (Bug#9581)
8417 (Fdbus_register_method, Vdbus_registered_objects_table):
8418 Fix docstring.
8419
8420 2011-09-24 Jim Meyering <meyering@redhat.com>
8421
8422 do not ignore write error for any output size
8423 The previous change was incomplete.
8424 While it makes emacs --batch detect the vast majority of stdout
8425 write failures, errors were still ignored whenever the output size is
8426 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8427 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8428 && echo FAIL: ignored write error
8429 FAIL: ignored write error
8430 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8431 && echo FAIL: ignored write error
8432 FAIL: ignored write error
8433 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8434
8435 2011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8436
8437 * emacs.c (Fkill_emacs): In noninteractive mode exit
8438 non-successfully if a write error occurred on stdout. (Bug#9574)
8439
8440 2011-09-21 Eli Zaretskii <eliz@gnu.org>
8441
8442 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8443 the xassert test.
8444
8445 * dispextern.h (struct it): Update the comment documenting what
8446 can it->OBJECT be.
8447
8448 2011-09-20 Eli Zaretskii <eliz@gnu.org>
8449
8450 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8451 a display string, extend search for cursor position to end of row.
8452 (find_row_edges): If the row ends in a newline from a display
8453 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8454 Handle the case of a display string with multiple newlines.
8455 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8456 non-empty line. Fixes confusing cursor motion with arrow keys at
8457 the beginning of a line that starts with whitespace.
8458
8459 2011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8460
8461 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8462 (bug#9493).
8463
8464 2011-09-18 Chong Yidong <cyd@stupidchicken.com>
8465
8466 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8467 boolean (Bug#9154).
8468
8469 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8470
8471 * xdisp.c (display_line): Record maximum and minimum buffer
8472 positions even if no glyphs were produced (e.g., by a zero-width
8473 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8474 buffer positions that will be removed from the glyph row because
8475 they don't fit.
8476 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8477 column is beyond frame width: don't subtract 1 "pixel" when
8478 computing width of the stretch.
8479 (reseat_at_next_visible_line_start): Undo the change made on
8480 2011-09-17 that saved paragraph information and restored it after
8481 the call to `reseat'. (Bug#9545)
8482
8483 2011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8484
8485 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8486 and turn window cursor on if cleared (Bug#9415).
8487
8488 2011-09-18 Andreas Schwab <schwab@linux-m68k.org>
8489
8490 * search.c (boyer_moore): Take unibyte characters from pattern
8491 literally. (Bug#9458)
8492
8493 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8494
8495 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8496
8497 2011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8498
8499 Fix minor problem found by static checking.
8500 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8501 initialized, to pacify gcc -Wuninitialized.
8502
8503 * fileio.c: Report proper errno when syscall falls.
8504 (Finsert_file_contents): Save and restore errno,
8505 so that report_file_error outputs the correct diagnostic.
8506 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8507
8508 2011-09-18 Eli Zaretskii <eliz@gnu.org>
8509
8510 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8511
8512 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8513
8514 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8515 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8516
8517 2011-09-17 Eli Zaretskii <eliz@gnu.org>
8518
8519 * xdisp.c (reseat_at_next_visible_line_start): Keep information
8520 about the current paragraph and restore it after the call to reseat.
8521
8522 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8523 (bidi_find_paragraph_start): Search back for paragraph beginning
8524 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8525 (bidi_move_to_visually_next): Only trigger paragraph-related
8526 computations when the last character is a newline or at EOB, not
8527 just any NEUTRAL_B. (Bug#9470)
8528
8529 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8530 truncated lines if point is covered by a display string. (Bug#9524)
8531
8532 2011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8533
8534 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8535 (cons_to_x_long): New function.
8536 (lisp_data_to_selection_data): Use it. Correct the test for
8537 short-versus-long data; it was negated. Break out of vector
8538 loop, for efficiency, when a long datum is discovered.
8539
8540 2011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8541
8542 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8543
8544 2011-09-16 Eli Zaretskii <eliz@gnu.org>
8545
8546 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8547 GCC PR/17406) by declaring this function with external scope.
8548
8549 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8550
8551 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8552 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8553
8554 2011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8555
8556 * editfns.c (Fformat): Correctly handle text properties on "%%".
8557
8558 2011-09-15 Eli Zaretskii <eliz@gnu.org>
8559
8560 * xterm.c (x_draw_composite_glyph_string_foreground):
8561 * w32term.c (x_draw_composite_glyph_string_foreground):
8562 * term.c (encode_terminal_code):
8563 * composite.c (composition_update_it, get_composition_id):
8564 * xdisp.c (get_next_display_element)
8565 (fill_composite_glyph_string): Add comments about special meaning
8566 of TAB characters in a composition.
8567
8568 2011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8569
8570 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
8571 This occurs when processing a multibyte format.
8572 Problem reported by Wolfgang Jenker.
8573
8574 2011-09-15 Johan Bockgård <bojohan@gnu.org>
8575
8576 * xdisp.c (try_cursor_movement): Only check for exact match if
8577 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8578
8579 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8580
8581 Remove unused external symbols.
8582 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8583 * xdisp.c (calc_pixel_width_or_height): Now static.
8584 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8585 * indent.c (check_display_width):
8586 * w32term.c: Fix comment to match code.
8587 * xterm.c, xterm.h (x_catching_errors): Remove.
8588
8589 2011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8590
8591 * xselect.c: Use signed conversions more consistently (Bug#9498).
8592 (selection_data_to_lisp_data): Assume incoming selection data are
8593 signed integers, not unsigned. This is to be consistent with
8594 outgoing selection data, which was modified to use signed integers
8595 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8596 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8597 expects long, not unsigned long.
8598
8599 2011-09-14 Eli Zaretskii <eliz@gnu.org>
8600
8601 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8602 computation of loop end. Reported by Johan Bockgård
8603 <bojohan@gnu.org>.
8604
8605 2011-09-13 Chong Yidong <cyd@stupidchicken.com>
8606
8607 * frame.c (Fother_visible_frames_p): Function deleted.
8608
8609 2011-09-12 Eli Zaretskii <eliz@gnu.org>
8610
8611 * indent.c (compute_motion): Process display vector front to back
8612 rather than the other way around. (Bug#2496)
8613
8614 2011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8615
8616 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8617
8618 2011-09-11 Chong Yidong <cyd@stupidchicken.com>
8619
8620 * minibuf.c (Fread_from_minibuffer): Doc fix.
8621
8622 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8623
8624 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8625 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8626
8627 2011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8628
8629 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8630 value for non-existent files.
8631
8632 2011-09-11 Eli Zaretskii <eliz@gnu.org>
8633
8634 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8635 set its "size" to -1. This will set the modtime_size field of
8636 the corresponding buffer to -1, which is what
8637 verify-visited-file-modtime expects for files that do not exist.
8638 (Bug#9139)
8639
8640 2011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8641
8642 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8643 here ...
8644 * lisp.h: ... from here. push_key_description is no longer
8645 defined in keyboard.c, so its declaration should not be in
8646 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8647 logically belongs with push_key_description.
8648
8649 2011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8650
8651 * buffer.h: Include <sys/types.h> instead of <time.h>.
8652 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8653 Problem reported by Herbert J. Skuhra.
8654
8655 2011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8656
8657 * xml.c (parse_region): Make the parsing work for
8658 non-comment-starting XML files again (bug#9144).
8659
8660 2011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8661
8662 * image.c (gif_load): Fix calculation of bottom and right corner.
8663 (Bug#9468)
8664
8665 2011-09-10 Eli Zaretskii <eliz@gnu.org>
8666
8667 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8668 redisplay in small windows.
8669
8670 2011-09-09 Eli Zaretskii <eliz@gnu.org>
8671
8672 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8673
8674 2011-09-08 Martin Rudalics <rudalics@gmx.at>
8675
8676 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8677 Operate on live windows only.
8678
8679 2011-09-08 Juanma Barranquero <lekktu@gmail.com>
8680
8681 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8682
8683 2011-09-07 Eli Zaretskii <eliz@gnu.org>
8684
8685 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8686 only under bidi iteration.
8687
8688 2011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8689
8690 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8691
8692 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8693
8694 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8695 Without this fix, the command to link temacs failed due to an
8696 undefined symbol __builtin_isnan. This is because
8697 /usr/include/iso/math_c99.h #defines isnan(x) to
8698 __builtin_isnan(x), but the bundled gcc, which identifies itself
8699 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8700 a __builtin_isnan.
8701 * floatfns.c (isnan): #undef, and then #define to a clone of
8702 what's in data.c.
8703 (Fisnan): Always define, since it's always available now.
8704 (syms_of_floatfns): Always define isnan at the Lisp level.
8705
8706 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8707
8708 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8709
8710 2011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8711
8712 * fileio.c: Fix bugs with large file offsets (Bug#9428).
8713 The previous code assumed that file offsets (off_t values) fit in
8714 EMACS_INT variables, which is not true on typical 32-bit hosts.
8715 The code messed up by falsely reporting buffer overflow in cases
8716 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8717 when "big" contains more than 2**29 bytes, even though this
8718 inserts just one byte and does not overflow the buffer.
8719 (Finsert_file_contents): Store file offsets as off_t
8720 values, not as EMACS_INT values. Check for overflow when
8721 converting between EMACS_INT and off_t. When checking for
8722 buffer overflow or for overlap, take the offsets into account.
8723 Don't use EMACS_INT for small values where int suffices.
8724 When checking for overlap, fix a typo: ZV was used where
8725 ZV_BYTE was intended.
8726 (Fwrite_region): Don't assume off_t fits into 'long'.
8727 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8728
8729 2011-09-05 Michael Albinus <michael.albinus@gmx.de>
8730
8731 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8732
8733 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8734
8735 sprintf-related integer and memory overflow issues (Bug#9412).
8736
8737 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8738 (esprintf, exprintf, evxprintf): New functions.
8739 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
8740 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
8741 (modify_event_symbol): Do not assume that the length of
8742 name_alist_or_stem is safe to alloca and fits in int.
8743 (Fexecute_extended_command): Likewise for function name and binding.
8744 (Frecursion_depth): Wrap around reliably on integer overflow.
8745 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8746 since some callers pass EMACS_INT values.
8747 (Fsingle_key_description): Don't crash if symbol name contains more
8748 than MAX_ALLOCA bytes.
8749 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8750 (get_minibuffer): Arg is now EMACS_INT, not int.
8751 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8752 (esprintf, exprintf, evxprintf): New decls.
8753 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8754
8755 * dbusbind.c (signature_cat): New function.
8756 (xd_signature, Fdbus_register_signal):
8757 Do not overrun buffer; instead, report string overflow.
8758
8759 * dispnew.c (add_window_display_history): Don't overrun buffer.
8760 Truncate instead; this is OK since it's just a log.
8761
8762 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8763 even if the time zone offset is outlandishly large.
8764 Don't mishandle offset == INT_MIN.
8765
8766 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8767 when creating daemon; the previous buffer-overflow check was incorrect.
8768
8769 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8770 which has the guts of the old verror function.
8771
8772 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8773 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
8774
8775 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8776 (font_unparse_xlfd): Don't blindly alloca long strings.
8777 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8778 fits in int, when using sprintf. Use single snprintf to count
8779 length of string rather than counting it via multiple sprintfs;
8780 that's simpler and more reliable.
8781 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8782 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8783 sprintf, in case result does not fit in int.
8784
8785 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8786 (fontset_from_font): Print it.
8787
8788 * frame.c (tty_frame_count): Now printmax_t, not int.
8789 (make_terminal_frame, set_term_frame_name): Print it.
8790 (x_report_frame_params): In X, window IDs are unsigned long,
8791 not signed long, so print them as unsigned.
8792 (validate_x_resource_name): Check for implausibly long names,
8793 and don't assume name length fits in 'int'.
8794 (x_get_resource_string): Don't blindly alloca invocation name;
8795 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
8796 not fit in int.
8797
8798 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8799 (xg_check_special_colors, xg_set_geometry):
8800 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8801
8802 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8803 Use esprintf, not sprintf, in case result does not fit in int.
8804
8805 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8806 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8807 it as a large positive number.
8808 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8809 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8810
8811 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8812 in case result does not fit in int.
8813
8814 * print.c (float_to_string): Detect width overflow more reliably.
8815 (print_object): Make sprintf buffer a bit bigger, to avoid potential
8816 buffer overrun. Don't assume list length fits in 'int'. Treat
8817 print length of 0 as 0, not as infinity; to be consistent with other
8818 uses of print length in this function. Don't overflow print length
8819 index. Don't assume hash table size fits in 'long', or that
8820 vectorlike size fits in 'unsigned long'.
8821
8822 * process.c (make_process): Use printmax_t, not int, to format
8823 process-name gensyms.
8824
8825 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
8826
8827 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
8828 to avoid potential buffer overrun.
8829
8830 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
8831 if X resource line is longer than 512 bytes.
8832
8833 * xfns.c (x_window): Make sprintf buffer a bit bigger
8834 to avoid potential buffer overrun.
8835
8836 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
8837
8838 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
8839
8840 2011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8841
8842 Integer overflow fixes for scrolling, etc.
8843 Without these, Emacs silently mishandles large integers sometimes.
8844 For example, "C-u 4294967297 M-x recenter" was treated as if
8845 it were "C-u 1 M-x recenter" on a typical 64-bit host.
8846
8847 * xdisp.c (try_window_id): Check Emacs fixnum range before
8848 converting to 'int'.
8849
8850 * window.c (window_scroll_line_based, Frecenter):
8851 Check that an Emacs fixnum is in range before assigning it to 'int'.
8852 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8853 values converted from Emacs fixnums.
8854 (Frecenter): Don't wrap around a line count if it is out of 'int'
8855 range; instead, treat it as an extreme value.
8856 (Fset_window_configuration, compare_window_configurations):
8857 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8858
8859 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8860 that can exceed INT_MAX. Check that EMACS_INT value is in range
8861 before assigning it to the (possibly-narrower) index.
8862 (match_limit): Don't assume that a fixnum can fit in 'int'.
8863
8864 * print.c (print_object): Use ptrdiff_t, not int, for index that can
8865 exceed INT_MAX.
8866
8867 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
8868 (Fvertical_motion): Don't wrap around LINES values that don't fit
8869 in 'int'. Instead, treat them as extreme values. This is good
8870 enough for windows, which can't have more than INT_MAX lines anyway.
8871
8872 2011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8873
8874 * Require libxml/parser.h to avoid compilation warning.
8875
8876 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8877
8878 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8879 since this reportedly can destroy thread storage.
8880
8881 2011-08-30 Chong Yidong <cyd@stupidchicken.com>
8882
8883 * syntax.c (find_defun_start): Update all cache variables if
8884 exiting early (Bug#9401).
8885
8886 2011-08-30 Eli Zaretskii <eliz@gnu.org>
8887
8888 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8889
8890 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
8891 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
8892 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
8893
8894 * term.c (tty_append_glyph): New function.
8895 (produce_stretch_glyph): Static function and its prototype deleted.
8896
8897 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
8898 Add prototypes.
8899
8900 2011-08-29 Paul Eggert <eggert@cs.ucla.edu>
8901
8902 * image.c (parse_image_spec): Check for nonnegative, not for positive,
8903 when checking :margin (Bug#9390).
8904 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
8905 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
8906 so that the name doesn't mislead. All uses changed.
8907
8908 2011-08-28 Johan Bockgård <bojohan@gnu.org>
8909
8910 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
8911 set_tty_hooks.
8912
8913 2011-08-27 Eli Zaretskii <eliz@gnu.org>
8914
8915 * xdisp.c (move_it_to): Don't bail out early when reaching
8916 position beyond to_charpos, if we are scanning backwards.
8917 (move_it_vertically_backward): When DY == 0, make sure we get to
8918 the first character in the line after the newline.
8919
8920 2011-08-27 Paul Eggert <eggert@cs.ucla.edu>
8921
8922 * ccl.c: Improve and simplify overflow checking (Bug#9196).
8923 (ccl_driver): Do not generate an out-of-range pointer.
8924 (Fccl_execute_on_string): Remove unnecessary check for
8925 integer overflow, noted by Stefan Monnier in
8926 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
8927 Remove a FIXME that didn't need fixing.
8928 Simplify the newly-introduced buffer reallocation code.
8929
8930 2011-08-27 Juanma Barranquero <lekktu@gmail.com>
8931
8932 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
8933
8934 2011-08-26 Paul Eggert <eggert@cs.ucla.edu>
8935
8936 Integer and memory overflow issues (Bug#9196).
8937
8938 * doc.c (get_doc_string): Rework so that
8939 get_doc_string_buffer_size is the actual buffer size, rather than
8940 being 1 less than the actual buffer size; this makes xpalloc more
8941 convenient.
8942
8943 * image.c (x_allocate_bitmap_record, cache_image):
8944 * xselect.c (Fx_register_dnd_atom):
8945 Simplify previous changes by using xpalloc.
8946
8947 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
8948 since either will do and ptrdiff_t is convenient with xpalloc.
8949
8950 * charset.c (charset_table_size)
8951 (struct charset_sort_data.priority): Now ptrdiff_t.
8952 (charset_compare): Don't overflow if priorities differ greatly.
8953 (Fsort_charsets): Don't assume list length fits in int.
8954 Check for size-calculation overflow when allocating sort data.
8955 (syms_of_charset): Allocate an initial charset table that is
8956 just under 64 KiB, to avoid problems with glibc malloc and mmap.
8957
8958 * cmds.c (internal_self_insert): Check for size-calculation overflow.
8959
8960 * composite.h (struct composition.glyph_len): Now int, not unsigned.
8961 The actual value is always <= INT_MAX, and leaving it unsigned made
8962 overflow checking harder.
8963
8964 * dispextern.h (struct glyph_matrix.rows_allocated)
8965 (struct face_cache.size): Now ptrdiff_t, for convenience in use
8966 with xpalloc. The values are still always <= INT_MAX.
8967
8968 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
8969
8970 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
8971 (SAFE_NALLOCA): New macro.
8972
8973 * region-cache.c (struct boundary.pos, find_cache_boundary)
8974 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
8975 (set_cache_region, invalidate_region_cache)
8976 (revalidate_region_cache, know_region_cache, region_cache_forward)
8977 (region_cache_backward, pp_cache):
8978 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
8979 so that ptrdiff_t * can be passed to xpalloc.
8980 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
8981 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
8982 (pp_cache): Don't assume cache_len fits in int.
8983 * region-cache.h: Adjust extern decls to match.
8984
8985 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
8986 EMACS_INT, since either will do, for xpalloc.
8987
8988 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
8989 (xnmalloc, xnrealloc, xpalloc): New functions.
8990
8991 * bidi.c (bidi_shelve_header_size): New constant.
8992 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
8993 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
8994
8995 * bidi.c (bidi_cache_shrink):
8996 * buffer.c (overlays_at, overlays_in, record_overlay_string)
8997 (overlay_strings):
8998 Don't update size of array until after memory allocation succeeds,
8999 because xmalloc/xrealloc may not return.
9000 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9001 now that we have proper integer overflow checking.
9002 (record_overlay_string, overlay_strings): Catch overflows when
9003 calculating size of overlay_str_buf.
9004
9005 * callproc.c (Fcall_process): Check for size overflow when
9006 calculating size of args2.
9007 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9008 Normally we prefer signed values, but sticking with ptrdiff_t would
9009 require adding more-complicated checks.
9010
9011 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9012 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9013 Redo buffer-overflow calculations to avoid integer overflow.
9014 Add a FIXME comment where memory seems to be over-allocated.
9015
9016 * character.c (Fstring): Check for size-calculation overflow.
9017
9018 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9019 unnecessary integer overflow. Check for size overflow.
9020 (encode_coding_object): Don't update size until xmalloc succeeds.
9021
9022 * composite.c (get_composition_id): Check for overflow in glyph
9023 length calculations.
9024
9025 Integer and memory overflow fixes for display code.
9026 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9027 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9028 (scrolling_window): Check for overflow in size calculations.
9029 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9030 Don't assume glyph table len fits in int.
9031 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9032 (row_table_size): Now ptrdiff_t, not int.
9033 (scrolling_window): Avoid overflow in size calculations.
9034 Don't update size until allocation succeeds.
9035 * fns.c (concat): Check for overflow in size calculations.
9036 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9037 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9038 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9039
9040 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9041 (get_doc_string): Check for size calculation overflow.
9042 Don't update size until allocation succeeds.
9043 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9044 EMACS_INT, where ptrdiff_t will do.
9045 (Fsubstitute_command_keys): Check for string overflow.
9046
9047 * editfns.c (set_time_zone_rule): Don't assume environment length
9048 fits in int.
9049 (message_length): Now ptrdiff_t, not int.
9050 (Fmessage_box): Don't update size until allocation succeeds.
9051 Don't assume message length fits in int.
9052 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9053
9054 * emacs.c (main): Do not reallocate argv, since there is a null at
9055 the end that can be overwritten, and this way there's no need to
9056 worry about size-calculation overflow.
9057 (sort_args): Check for size-calculation overflow.
9058
9059 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9060 alloc succeeds.
9061 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9062
9063 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9064 (x_set_scroll_bar_width, x_figure_window_size):
9065 Check for integer overflow.
9066 (x_set_alpha): Do not assume XINT fits in int.
9067
9068 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9069 This is for the members text_lines, text_cols, total_lines, total_cols,
9070 where the system imposes an 'int' limit.
9071
9072 * fringe.c (Fdefine_fringe_bitmap):
9073 Don't update size until alloc works.
9074
9075 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9076 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9077
9078 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9079 Check for size-calculation overflow.
9080 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9081 do, as we prefer signed integers.
9082 (id_to_widget.max_size, id_to_widget.used)
9083 (xg_store_widget_in_map, xg_remove_widget_from_map)
9084 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9085 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9086 Use and return ptrdiff_t, not int.
9087 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9088 * gtkutil.h: Change prototypes to match the above.
9089
9090 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9091 are duplicate now that they've been promoted to lisp.h.
9092 (x_allocate_bitmap_record, x_alloc_image_color)
9093 (make_image_cache, cache_image, xpm_load):
9094 Don't update size until alloc is done.
9095 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9096 (x_detect_edges):
9097 Check for size calculation overflow.
9098 (ct_colors_allocated_max): New constant.
9099 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9100 overflow.
9101
9102 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9103 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9104 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9105 Use ptrdiff_t, not int, to count maps.
9106 (read_char_minibuf_menu_prompt): Check for overflow in size
9107 calculations. Don't update size until allocation succeeds.
9108 Redo calculations to avoid overflow.
9109 * keyboard.h: Change prototypes to match the above.
9110
9111 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9112 to count maps.
9113 (current_minor_maps): Check for size calculation overflow.
9114 * keymap.h: Change prototypes to match the above.
9115
9116 * lread.c (read1, init_obarray): Don't update size until alloc done.
9117
9118 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9119 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9120
9121 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9122 Now ptrdiff_t, not int.
9123 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9124 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9125
9126 * process.c (Fnetwork_interface_list): Check for overflow
9127 in size calculation.
9128
9129 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9130
9131 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9132 overflow. Don't bother calling xmalloc when xrealloc will do.
9133
9134 * search.c (Freplace_match): Check for size calculation overflow.
9135 (Fset_match_data): Don't assume list lengths fit in 'int'.
9136
9137 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9138 for command line length. Do not attempt to address one before the
9139 beginning of an array, as that's not portable.
9140
9141 * term.c (max_frame_lines): Remove; unused.
9142 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9143 not int.
9144 (encode_terminal_code, calculate_costs): Check for size
9145 calculation overflow.
9146 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9147 table lengths and related sizes. Don't update size until alloc
9148 done. Redo calculations to avoid overflow.
9149 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9150
9151 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9152 subtracting pointers.
9153 (gobble_line): Check for overflow more carefully. Don't update size
9154 until alloc done.
9155
9156 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9157 Don't update size until alloc done.
9158 Redo size calculations to avoid overflow.
9159 Check for size calculation overflow.
9160 (main) [DEBUG]: Fix typo in invoking tparam1.
9161
9162 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9163 Use ptrdiff_t, not int, for sizes.
9164 (store_mode_line_noprop_char): Don't update size until alloc done.
9165
9166 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9167 Use ptrdiff_t, not int, for sizes.
9168 (Finternal_make_lisp_face, cache_face):
9169 Check for size calculation overflow.
9170 (cache_face): Treat size calculation overflows as if they were
9171 memory exhaustion (the usual treatment), rather than aborting.
9172
9173 * xfns.c (x_encode_text, x_set_name_internal)
9174 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9175 sizes, since they can exceed INT_MAX in size. Check for size
9176 calculation overflow.
9177
9178 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9179 (xg_select): Check for size calculation overflow.
9180 Don't update size until alloc done.
9181
9182 * xrdb.c (get_environ_db): Don't assume path length fits in int,
9183 as sprintf is limited to int lengths.
9184
9185 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9186 (X_LONG_MIN): New macros.
9187 Use them to make the following changes clearer.
9188 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9189 This change doesn't affect the value now, but it may help remind
9190 future maintainers not to raise the value too much later.
9191 (SELECTION_QUANTUM): Remove, replacing with ...
9192 (selection_quantum): ... new function, which avoids overflow.
9193 All uses changed.
9194 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9195 assumption that selection length fits in 'int'.
9196 (x_reply_selection_request, x_handle_selection_request)
9197 (x_get_window_property, receive_incremental_selection)
9198 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9199 (lisp_data_to_selection_data, clean_local_selection_data):
9200 Use ptrdiff_t, not int, to record length of selection.
9201 (x_reply_selection_request, x_get_window_property)
9202 (receive_incremental_selection, x_property_data_to_lisp):
9203 Redo calculations to avoid overflow.
9204 (x_reply_selection_request): When sending hint, ceiling it at
9205 X_LONG_MAX rather than relying on wraparound overflow to send
9206 something.
9207 (x_get_window_property, receive_incremental_selection)
9208 (lisp_data_to_selection_data, x_property_data_to_lisp):
9209 Check for size-calculation overflow.
9210 (x_get_window_property, receive_incremental_selection)
9211 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9212 Don't store size until memory allocation succeeds.
9213 (x_get_window_property): Plug memory leak on memory exhaustion.
9214 Don't double-block input; malloc is safe here. Don't assume 2**34
9215 - 4 fits in unsigned long. Add an xassert to check
9216 XGetWindowProperty overflow. Be more careful about overflow
9217 calculations, and distinguish size from memory overflow better.
9218 (receive_incremental_selection): When tracing, don't assume
9219 unsigned int is less than INT_MAX.
9220 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9221 harmful) conversions of unsigned short to int.
9222 (lisp_data_to_selection_data): Don't assume that integers
9223 in the range -65535 through -1 fit in an X unsigned short.
9224 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9225 result parameters unless successful. Rely on cons_to_unsigned
9226 to report problems with elements; the old code wasn't right anyway.
9227 (x_check_property_data): Check for int overflow; we cannot use
9228 a wider type due to X limits.
9229 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9230
9231 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
9232
9233 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9234 (x_term_init): Check for size calculation overflow.
9235 (x_color_cells): Don't store size until memory allocation succeeds.
9236 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
9237 Don't assume alloca size is less than MAX_ALLOCA.
9238 (x_term_init): Don't assume length fits in int (sprintf is limited
9239 to int size).
9240
9241 Use ptrdiff_t for composition IDs.
9242 * character.c (lisp_string_width):
9243 * composite.c (composition_table_size, n_compositions)
9244 (get_composition_id, composition_gstring_from_id):
9245 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9246 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9247 * window.c (Frecenter):
9248 Use ptrdiff_t, not int, for composition IDs.
9249 * composite.c (get_composition_id): Check for integer overflow.
9250 * composite.h: Adjust prototypes to match the above changes.
9251
9252 Use ptrdiff_t for hash table indexes.
9253 * category.c (hash_get_category_set):
9254 * ccl.c (ccl_driver):
9255 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9256 * coding.c (coding_system_charset_list, detect_coding_system):
9257 * coding.h (struct coding_system.id):
9258 * composite.c (get_composition_id, gstring_lookup_cache):
9259 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9260 * image.c (xpm_get_color_table_h):
9261 * lisp.h (hash_lookup, hash_put):
9262 * minibuf.c (Ftest_completion):
9263 Use ptrdiff_t for hash table indexes, not int (which is too
9264 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9265 32-bit --with-wide-int hosts).
9266
9267 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9268 Add a FIXME comment about memory leaks.
9269 (syms_of_charset): Don't assume xmalloc returns.
9270
9271 Don't assume that stated character widths fit in int.
9272 * character.c (Fchar_width, c_string_width, lisp_string_width):
9273 * character.h (CHAR_WIDTH):
9274 * indent.c (MULTIBYTE_BYTES_WIDTH):
9275 Use sanitize_char_width to avoid undefined and/or bad behavior
9276 with outlandish widths.
9277 * character.h (sanitize_tab_width): Rename from sanitize_width,
9278 now that we have two such functions. All uses changed.
9279 (sanitize_char_width): New inline function.
9280
9281 Don't assume that tab-width fits in int.
9282 * character.h (sanitize_width): New inline function.
9283 (SANE_TAB_WIDTH): New macro.
9284 (ASCII_CHAR_WIDTH): Use it.
9285 * indent.c (sane_tab_width): Remove. All uses replaced by
9286 SANE_TAB_WIDTH (current_buffer).
9287 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9288
9289 * fileio.c: Integer overflow issues with file modes.
9290 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9291
9292 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9293 Remove unreachable code.
9294 (read_hex, load_charset_map_from_file): Check for integer overflow.
9295
9296 * xterm.c: Don't go over XClientMessageEvent limit.
9297 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9298 (x_send_scroll_bar_event): Likewise. Check that the size does not
9299 exceed limits imposed by XClientMessageEvent, as well as the usual
9300 ptrdiff_t and size_t limits.
9301
9302 * keyboard.c: Overflow, signedness and related fixes.
9303 (make_lispy_movement): Use same integer type in forward decl
9304 that is used in the definition.
9305 (read_key_sequence, keyremap_step):
9306 Change bufsize argument back to int, undoing my 2011-03-30 change.
9307 We prefer signed types, and int is wide enough here.
9308 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9309 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9310 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9311 length, not size_t. Use ptrdiff_t for index, not int.
9312 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9313 possibility of integer overflow.
9314
9315 Overflow, signedness and related fixes for images.
9316
9317 * dispextern.h (struct it.stack[0].u.image.image_id)
9318 (struct_it.image_id, struct image.id, struct image_cache.size)
9319 (struct image_cache.used, struct image_cache.ref_count):
9320 * gtkutil.c (update_frame_tool_bar):
9321 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9322 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9323 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9324 * nsmenu.m (update_frame_tool_bar):
9325 * xdisp.c (calc_pixel_width_or_height):
9326 * xfns.c (image_cache_refcount):
9327 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9328 on typical 64-bit hosts.
9329
9330 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9331 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9332 Omit unnecessary casts to int.
9333 (parse_image_spec): Check that integers fall into 'int' range
9334 when the callers expect that.
9335 (image_ascent): Redo ascent calculation to avoid int overflow.
9336 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9337 (lookup_image): Remove unnecessary tests.
9338 (xbm_image_p): Locals are now of int, not EMACS_INT,
9339 since parse_image_check makes sure they fit into int.
9340 (png_load, gif_load, svg_load_image):
9341 Prefer int to unsigned where either will do.
9342 (tiff_handler): New function, combining the cores of the
9343 old tiff_error_handler and tiff_warning_handler.
9344 This function is rewritten to use vsnprintf and thereby avoid
9345 stack buffer overflows. It uses only the features of vsnprintf
9346 that are common to both POSIX and native Microsoft.
9347 (tiff_error_handler, tiff_warning_handler): Use it.
9348 (tiff_load, gif_load, imagemagick_load_image):
9349 Don't assume :index value fits in 'int'.
9350 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9351 (imagemagick_load_image): Check that crop parameters fit into
9352 the integer types that MagickCropImage accepts. Don't assume
9353 Vimagemagick_render_type has a nonnegative value. Don't assume
9354 size_t fits in 'long'.
9355 (gs_load): Use printmax_t to print the widest integers possible.
9356 Check for integer overflow when computing image height and width.
9357
9358 2011-08-26 Eli Zaretskii <eliz@gnu.org>
9359
9360 * xdisp.c (redisplay_window): Don't force window start if point
9361 will be invisible in the resulting window. (Bug#9324)
9362
9363 2011-08-25 Eli Zaretskii <eliz@gnu.org>
9364
9365 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9366 the display spec is of the form `(space ...)'.
9367 (handle_display_spec): Return the value returned by
9368 handle_single_display_spec, not just 1 or zero.
9369 (handle_single_display_spec): If the display spec is of the form
9370 `(space ...)', and specifies display in the text area, return 2
9371 rather than 1.
9372 (try_cursor_movement): Check for the need to scroll more
9373 accurately, and prefer exact match for point under bidi.
9374 Don't advance `row' beyond the last row of the window.
9375
9376 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9377 into disp_prop; all users changed.
9378
9379 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9380 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9381 for the text covered by the display property.
9382
9383 2011-08-25 Chong Yidong <cyd@stupidchicken.com>
9384
9385 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9386 Change return value to nil.
9387 (Frecord_buffer): Delete unused function.
9388
9389 2011-08-24 Eli Zaretskii <eliz@gnu.org>
9390
9391 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9392 buffers, return left-to-right.
9393 (set_cursor_from_row): Consider candidate row a win if its glyph
9394 represents a newline and point is on that newline. Fixes cursor
9395 positioning on the newline at EOL of R2L text within L2R
9396 paragraph, and vice versa.
9397 (try_cursor_movement): Check continued rows, in addition to
9398 continuation rows. Fixes unwarranted scroll when point enters a
9399 continued line of R2L text within an L2R paragraph, or vice versa.
9400 (cursor_row_p): Consider the case of point being equal to
9401 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9402 from the end of a short line to the beginning of a continued line
9403 of R2L text within L2R paragraph.
9404 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9405 composed characters.
9406
9407 * bidi.c (bidi_check_type): Use xassert.
9408 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9409 members.
9410
9411 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9412
9413 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9414 a character.
9415
9416 2011-08-23 Chong Yidong <cyd@stupidchicken.com>
9417
9418 * nsfont.m (ns_otf_to_script): Fix typo.
9419
9420 2011-08-22 Kenichi Handa <handa@m17n.org>
9421
9422 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9423 extra slot even if the purpose is char-code-property-table.
9424
9425 2011-08-23 Eli Zaretskii <eliz@gnu.org>
9426
9427 * xdisp.c (redisplay_window): When computing centering_position,
9428 account for the height of the header line. (Bug#8874)
9429
9430 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9431 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9432 candidate is selected by the mouse, and that candidate has a
9433 composed character under the mouse.
9434
9435 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9436 coordinates reported by pos-visible-in-window-p for a composed
9437 character in column zero.
9438
9439 2011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9440
9441 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9442
9443 2011-08-22 Eli Zaretskii <eliz@gnu.org>
9444
9445 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9446 consider it a hit if to_charpos is anywhere in the range of the
9447 composed buffer positions.
9448
9449 2011-08-22 Chong Yidong <cyd@stupidchicken.com>
9450
9451 * image.c (gif_load): Don't assume that each subimage has the same
9452 dimensions as the base image. Handle disposal method that is
9453 "undefined" by the gif spec (Bug#9335).
9454
9455 2011-08-20 Chong Yidong <cyd@stupidchicken.com>
9456
9457 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
9458 (Fcondition_case): Document `debug' symbol in error handler.
9459
9460 2011-08-19 Eli Zaretskii <eliz@gnu.org>
9461
9462 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9463 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9464 from an Org mode buffer to a Speedbar frame.
9465
9466 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9467 a composition, take its buffer position from IT->cmp_it.charpos.
9468 Fixes cursor positioning at the beginning of a line that begins
9469 with a composed character.
9470
9471 2011-08-18 Eli Zaretskii <eliz@gnu.org>
9472
9473 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9474 character bidirectional type, use STRONG_L instead. Fixes crashes
9475 in a buffer produced by `describe-categories'.
9476
9477 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9478 members before the level stack, so they would be saved and
9479 restored when copying iterator state. Fixes incorrect reordering
9480 around TABs covered by display properties.
9481
9482 2011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9483
9484 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
9485
9486 2011-08-17 Chong Yidong <cyd@stupidchicken.com>
9487
9488 * eval.c (internal_condition_case, internal_condition_case_1)
9489 (internal_condition_case_2, internal_condition_case_n):
9490 Remove unnecessary aborts (Bug#9081).
9491
9492 2011-08-17 Eli Zaretskii <eliz@gnu.org>
9493
9494 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9495 has no `load' handler, try opening the file locally. (Bug#9311)
9496
9497 2011-08-16 Ken Brown <kbrown@cornell.edu>
9498
9499 * gmalloc.c: Expand comment.
9500
9501 2011-08-16 Eli Zaretskii <eliz@gnu.org>
9502
9503 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9504 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9505
9506 2011-08-16 Ken Brown <kbrown@cornell.edu>
9507
9508 Fix memory allocation problems in Cygwin build (Bug#9273).
9509
9510 * unexcw.c ( __malloc_initialized): Declare external variable.
9511 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9512
9513 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9514 New variables.
9515 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9516 dumped emacs.
9517 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9518 in the static heap.
9519 [CYGWIN] (special_realloc): New function.
9520 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9521 requests to realloc storage in the static heap.
9522
9523 2011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9524
9525 * bidi.c (bidi_initialize): Remove unused local.
9526
9527 2011-08-15 Eli Zaretskii <eliz@gnu.org>
9528
9529 * bidimirror.h:
9530 * biditype.h: Remove file.
9531 * makefile.w32-in ($(BLD)/bidi.$(O)):
9532 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
9533
9534 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9535
9536 * chartab.c: Improve commentary for the uniprop_table API.
9537
9538 * bidi.c (bidi_paragraph_init): Support zero value of
9539 bidi_ignore_explicit_marks_for_paragraph_level.
9540 (bidi_initialize): Use uniprop_table instead of including
9541 biditype.h and bidimirror.h.
9542
9543 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9544 coordinates of the iterator when restoring from ppos_it.
9545 (Bug#9296)
9546
9547 2011-08-14 Kenichi Handa <handa@m17n.org>
9548
9549 * process.c (create_process): Call setup_process_coding_systems
9550 after the pid of the process is set to -1 (Bug#8162).
9551
9552 2011-08-14 Eli Zaretskii <eliz@gnu.org>
9553
9554 * xdisp.c (move_it_in_display_line_to): Don't invoke
9555 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9556 ppos_it. Fixes vertical cursor motion when line beginning is
9557 covered by an image. (Bug#9296)
9558
9559 2011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9560
9561 * nsterm.h (ns_run_ascript): Declare.
9562 (NSAPP_DATA2_RUNASSCRIPT): Define.
9563
9564 * nsfns.m (as_script, as_result, as_status): New static variables.
9565 (ns_run_ascript): New function.
9566 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
9567 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9568 the event loop. Get status from as_status (Bug#7276).
9569
9570 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9571 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9572 the event loop (Bug#7276).
9573
9574 2011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9575
9576 * gnutls.c (QCgnutls_bootprop_priority)
9577 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9578 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9579 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9580 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9581 (QCgnutls_bootprop_verify_hostname_error)
9582 (QCgnutls_bootprop_callbacks_verify): Rename from
9583 Qgnutls_bootprop_..., all uses changed.
9584
9585 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9586 uses changed.
9587
9588 2011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9589
9590 * xfaces.c (Qframe_set_background_mode): Now static.
9591 * dispextern.h (Qframe_set_background_mode): Remove decl.
9592
9593 * process.c (Fnetwork_interface_info): Declare local only if needed.
9594
9595 2011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9596
9597 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9598 (Fnetwork_interface_list): Allocate in increments of bytes instead
9599 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9600 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9601 sockaddr.
9602 (struct ifflag_def): notrailers is smart on OSX.
9603 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9604 Get hardware address with getifaddrs if available.
9605
9606 2011-08-12 Eli Zaretskii <eliz@gnu.org>
9607
9608 * xdisp.c (iterate_out_of_display_property): xassert that
9609 IT->position is set to within IT->object's boundaries. Break from
9610 the loop as soon as EOB is reached; avoids infloops in redisplay
9611 when IT->position is set up wrongly due to some bug.
9612 Set IT->current to match the bidi iterator unconditionally.
9613 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9614 entry. Force push_it to save on the stack the current
9615 buffer/string position, to be restored by pop_it. Fix flags in
9616 the iterator structure wrt the object coming from a display
9617 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9618 properties. (Bug#9284)
9619
9620 2011-08-09 Andreas Schwab <schwab@linux-m68k.org>
9621
9622 * fontset.c (fontset_get_font_group): Add proper type checks.
9623 (Bug#9172)
9624
9625 2011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
9626
9627 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9628 and LC_VERSION_MIN_MACOSX.
9629 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9630 (dump_it) [LC_FUNCTION_STARTS]: Use it.
9631
9632 2011-08-08 Eli Zaretskii <eliz@gnu.org>
9633
9634 * xdisp.c (forward_to_next_line_start): Allow to use the
9635 no-display-properties-and-no-overlays under bidi display.
9636 Set disp_pos in the bidi iterator to avoid searches for display
9637 properties and overlays.
9638
9639 2011-08-08 Chong Yidong <cyd@stupidchicken.com>
9640
9641 * editfns.c (Fset_time_zone_rule): Document relationship with the
9642 setenv function.
9643
9644 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9645 the font entity extracted from the cache (Bug#8109).
9646
9647 2011-08-07 Chong Yidong <cyd@stupidchicken.com>
9648
9649 * composite.c (autocmp_chars): Don't reset point. That is done by
9650 restore_point_unwind (Bug#5984).
9651
9652 2011-08-07 Juri Linkov <juri@jurta.org>
9653
9654 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9655 to show the arg `TIME' instead of `TIMEVAL'.
9656
9657 2011-08-06 Eli Zaretskii <eliz@gnu.org>
9658
9659 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9660 display property strides EOL and includes a newline, as in
9661 longlines-mode. (Bug#9254)
9662 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9663 word-wrap under bidirectional display. (Bug#9224)
9664
9665 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9666 is non-zero, even if the data buffer is NULL. Fixes a crash in
9667 vertical-motion with longlines-mode. (Bug#9254)
9668
9669 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9670
9671 * bidi.c <bidi_cache_total_alloc>: Now static.
9672 (bidi_initialize): Initialize bidi_cache_total_alloc.
9673
9674 * xdisp.c (display_line): Release buffer allocated for shelved bidi
9675 cache. (Bug#9221)
9676
9677 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9678 amount allocated this far in `bidi_cache_total_alloc'.
9679 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9680 non-zero, only free the data buffer without restoring the cache
9681 contents. All callers changed.
9682
9683 * dispextern.h (bidi_unshelve_cache): Update prototype.
9684
9685 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9686 (move_it_in_display_line, move_it_to)
9687 (move_it_vertically_backward, move_it_by_lines): Replace the call
9688 to xfree to an equivalent call to bidi_unshelve_cache.
9689 (move_it_in_display_line_to): Fix logic of returning
9690 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
9691
9692 2011-08-05 Eli Zaretskii <eliz@gnu.org>
9693
9694 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9695 came from a string character with a `cursor' property. (Bug#9229)
9696
9697 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9698
9699 * Makefile.in (LIB_PTHREAD): New variable.
9700 (LIBES): Add LIB_PTHREAD (Bug#9216).
9701
9702 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9703 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9704
9705 2011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9706
9707 * regex.c (re_iswctype): Remove some redundant boolean conversions.
9708
9709 2011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9710
9711 * xterm.c (x_find_topmost_parent): New function.
9712 (x_set_frame_alpha): Find topmost parent window with
9713 x_find_topmost_parent and set the property there also (bug#9181).
9714 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9715
9716 2011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9717
9718 * callproc.c (Fcall_process): Avoid vfork clobbering
9719 the local vars buffer, coding_systems, current_dir.
9720
9721 2011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9722
9723 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9724
9725 2011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9726
9727 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9728 so that it is not optimized away.
9729
9730 * xdisp.c (compute_display_string_pos): Remove unused local.
9731
9732 2011-08-02 Eli Zaretskii <eliz@gnu.org>
9733
9734 Fix slow cursor motion and scrolling in large buffers with
9735 selective display, like Org Mode buffers. (Bug#9218)
9736
9737 * dispextern.h (struct bidi_it): New member disp_prop_p.
9738
9739 * xdisp.c: Remove one-slot cache of display string positions.
9740 (compute_display_string_pos): Accept an additional argument
9741 DISP_PROP_P; callers changed. Scan at most 5K characters forward
9742 for a display string or property. If found, set DISP_PROP_P
9743 non-zero.
9744
9745 * bidi.c (bidi_fetch_char): Accept an additional argument
9746 DISP_PROP_P, and pass it to compute_display_string_pos.
9747 Only handle text covered by a display string if DISP_PROP_P is returned
9748 non-zero. All callers of bidi_fetch_char changed.
9749
9750 2011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9751
9752 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9753
9754 2010-12-03 Don March <don@ohspite.net>
9755
9756 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9757 last character M-[char] is translated to ESC [char] (bug#7541).
9758
9759 2011-08-02 Kenichi Handa <handa@m17n.org>
9760
9761 * lisp.h (uniprop_table): Extern it.
9762
9763 * chartab.c (uniprop_table): Make it non-static.
9764
9765 2011-08-01 Eli Zaretskii <eliz@gnu.org>
9766
9767 * xdisp.c (forward_to_next_line_start): Accept additional argument
9768 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9769 on the newline.
9770 (reseat_at_next_visible_line_start): Use the bidi iterator state
9771 returned by forward_to_next_line_start to restore the state of
9772 it->bidi_it after backing up to previous newline. (Bug#9212)
9773
9774 2011-07-30 Andreas Schwab <schwab@linux-m68k.org>
9775
9776 * regex.c (re_comp): Protoize.
9777 (re_exec): Fix return type.
9778 (regexec): Fix type of `ret'. (Bug#9203)
9779
9780 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9781
9782 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9783 This is needed if max-image-size is a floating-point number.
9784
9785 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9786
9787 * print.c (print_object): Print empty symbol as ##.
9788
9789 * lread.c (read1): Read ## as empty symbol.
9790
9791 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9792
9793 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9794 setting frame foreground color (Bug#9175).
9795 (x_set_background_color): Likewise.
9796
9797 * nsmenu.m (-setText): Size tooltip dimensions precisely to
9798 contents (Bug#9176).
9799 (EmacsTooltip -init): Remove bezels and add shadows to
9800 tooltip windows.
9801
9802 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9803 or scroll bar (Bug#8470).
9804
9805 * nsfont.m (nsfont_open): Remove assignment to voffset and
9806 unnecessary vars hshink, expand, hd, full_height, min_height.
9807 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9808
9809 * nsterm.h (nsfont_info): Remove voffset field.
9810
9811 2011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9812
9813 Implement strike-through and overline on NextStep (Bug#8863).
9814
9815 * nsfont.m (nsfont_open): Use underline position provided by font,
9816 instead of hard-coded value of 2.
9817 (nsfont_draw): Call ns_draw_text_decoration instead.
9818
9819 * nsterm.h: Add declaration for ns_draw_text_decoration.
9820
9821 * nsterm.m (ns_draw_text_decoration): New function for drawing
9822 underline, overline, and strike-through.
9823 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9824 ns_draw_text_decoration. Change treatment of cursor drawing to
9825 accommodate underlining, etc.
9826
9827 2011-07-28 Eli Zaretskii <eliz@gnu.org>
9828
9829 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
9830 default.
9831
9832 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9833
9834 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
9835 Without this fix, if a signal arrives just after memory fills up,
9836 'malloc' might be invoked reentrantly.
9837
9838 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
9839 In other words, assume that every image size is allowed, on non-X
9840 hosts. This assumption is probably wrong, but it lets Emacs compile.
9841
9842 2011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9843
9844 * regex.c (re_iswctype): Convert return values to boolean.
9845
9846 2011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
9847
9848 * xdisp.c (compute_display_string_pos): Don't use cached display
9849 string position if the buffer had its restriction changed.
9850 (Bug#9184)
9851
9852 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9853
9854 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9855
9856 2011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9857
9858 Integer signedness and overflow and related fixes. (Bug#9079)
9859
9860 * bidi.c: Integer size and overflow fixes.
9861 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9862 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9863 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9864 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9865 (bidi_find_other_level_edge):
9866 Use ptrdiff_t instead of EMACS_INT where either will do.
9867 This works better on 32-bit hosts configured --with-wide-int.
9868 (bidi_cache_ensure_space): Check for size-calculation overflow.
9869 Use % rather than repeated addition, for better worst-case speed.
9870 Don't set bidi_cache_size until after xrealloc returns, because it
9871 might not return.
9872 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
9873 (bidi_cache_ensure_space): Also check that the bidi cache size
9874 does not exceed that of the largest Lisp string or buffer. See Eli
9875 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
9876
9877 * alloc.c (__malloc_size_t): Remove.
9878 All uses replaced by size_t. See Andreas Schwab's note
9879 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9880
9881 * image.c: Improve checking for integer overflow.
9882 (check_image_size): Assume that f is nonnull, since
9883 it is always nonnull in practice. This is one less thing to
9884 worry about when checking for integer overflow later.
9885 (x_check_image_size): New function, which checks for integer
9886 overflow issues inside X.
9887 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9888 This removes the need for a memory_full check.
9889 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9890 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
9891 (xbm_read_bitmap_data): Change locals back to 'int', since
9892 their values must fit in 'int'.
9893 (xpm_load_image, png_load, tiff_load):
9894 Invoke x_create_x_image_and_pixmap earlier,
9895 to avoid much needless work if the image is too large.
9896 (tiff_load): Treat overly large images as if
9897 x_create_x_image_and_pixmap failed, not as malloc failures.
9898 (gs_load): Use x_check_image_size.
9899
9900 * gtkutil.c: Omit integer casts.
9901 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
9902 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
9903
9904 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
9905
9906 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
9907 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
9908 would wrongly return t on a 64-bit host.
9909
9910 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
9911 The plain *_OVERFLOW macros run afoul of GCC bug 49705
9912 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
9913 and therefore cause GCC to emit a bogus diagnostic in some cases.
9914
9915 * image.c: Integer signedness and overflow and related fixes.
9916 This is not an exhaustive set of fixes, but it's time to
9917 record what I've got.
9918 (lookup_pixel_color, check_image_size): Remove redundant decls.
9919 (check_image_size): Don't assume that arbitrary EMACS_INT values
9920 fit in 'int', or that arbitrary 'double' values fit in 'int'.
9921 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
9922 (tiff_load, imagemagick_load_image):
9923 Check for overflow in size calculations.
9924 (x_create_x_image_and_pixmap): Remove unnecessary test for
9925 xmalloc returning NULL; that can't happen.
9926 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
9927 (xpm_color_bucket): Use better integer hashing function.
9928 (xpm_cache_color): Don't possibly over-allocate memory.
9929 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
9930 (gif_memory_source):
9931 Use ptrdiff_t, not int or size_t, to record sizes.
9932 (png_load): Don't assume values greater than 2**31 fit in 'int'.
9933 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
9934 either works, as we prefer signed integers.
9935 (tiff_read_from_memory, tiff_write_from_memory):
9936 Return tsize_t, not size_t, since that's what the TIFF API wants.
9937 (tiff_read_from_memory): Don't fail simply because the read would
9938 go past EOF; instead, return a short read.
9939 (tiff_load): Omit no-longer-needed casts.
9940 (Fimagemagick_types): Don't assume size fits into 'int'.
9941
9942 Improve hashing quality when configured --with-wide-int.
9943 * fns.c (hash_string): New function, taken from sxhash_string.
9944 Do not discard information about ASCII character case; this
9945 discarding is no longer needed.
9946 (sxhash-string): Use it. Change sig to match it. Caller changed.
9947 * lisp.h: Declare it.
9948 * lread.c (hash_string): Remove, since we now use fns.c's version.
9949 The fns.c version returns a wider integer if --with-wide-int is
9950 specified, so this should help the quality of the hashing a bit.
9951
9952 * emacs.c: Integer overflow minor fix.
9953 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
9954 Define only if GNU_LINUX.
9955 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
9956
9957 * dispnew.c: Integer signedness and overflow fixes.
9958 Remove unnecessary forward decls, that were a maintenance hassle.
9959 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
9960 All uses changed.
9961 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
9962 (scrolling_window): Use ptrdiff_t, not int, for byte count.
9963 (prepare_desired_row, line_draw_cost):
9964 Use int, not unsigned, where either works.
9965 (save_current_matrix, restore_current_matrix):
9966 Use ptrdiff_t, not size_t, where either works.
9967 (init_display): Check for overflow more accurately, and without
9968 relying on undefined behavior.
9969
9970 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
9971 Remove, replacing with the new symbols in lisp.h. All uses changed.
9972 * fileio.c (make_temp_name):
9973 * filelock.c (lock_file_1, lock_file):
9974 * xdisp.c (message_dolog):
9975 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
9976 Use pMd etc. instead.
9977 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
9978 replacing the pWIDE etc. symbols removed from editfns.c.
9979
9980 * keyboard.h (num_input_events): Now uintmax_t.
9981 This is (very slightly) less likely to mess up due to wraparound.
9982 All uses changed.
9983
9984 * buffer.c: Integer signedness fixes.
9985 (alloc_buffer_text, enlarge_buffer_text):
9986 Use ptrdiff_t rather than size_t when either will do, as we prefer
9987 signed integers.
9988
9989 * alloc.c: Integer signedness and overflow fixes.
9990 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
9991 (__malloc_size_t): Default to size_t, not to int.
9992 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
9993 (Fgarbage_collect, mark_object_loop_halt, mark_object):
9994 Prefer ptrdiff_t to size_t when either would do, as we prefer
9995 signed integers.
9996 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
9997 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
9998 Now const. Initialize with values that are in range even if char
9999 is signed.
10000 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10001 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10002 These functions do the right thing with sizes > 2**32.
10003 (check_depth): Now ptrdiff_t, not int.
10004 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10005 Adjust to new way of storing sizes. Check for size overflow bugs
10006 in rest of code.
10007 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10008 slightly wrong anyway, as it missed one instance of
10009 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10010 (refill_memory_reserve): Omit needless cast to size_t.
10011 (mark_object_loop_halt): Mark as externally visible.
10012
10013 * xselect.c: Integer signedness and overflow fixes.
10014 (Fx_register_dnd_atom, x_handle_dnd_message):
10015 Use ptrdiff_t, not size_t, since we prefer signed.
10016 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10017 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10018 x_dnd_atoms_size and x_dnd_atoms_length.
10019
10020 * doprnt.c: Prefer signed to unsigned when either works.
10021 * eval.c (verror):
10022 * doprnt.c (doprnt):
10023 * lisp.h (doprnt):
10024 * xdisp.c (vmessage):
10025 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10026 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10027 prefer signed arithmetic to avoid comparison confusion.
10028 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10029 but is a bit tricky.
10030
10031 Assume freestanding C89 headers, string.h, stdlib.h.
10032 * data.c, doprnt.c, floatfns.c, print.c:
10033 Include float.h unconditionally.
10034 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10035 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10036 * regex.c: Likewise for stddef.h, string.h.
10037 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10038 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10039 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10040 (STDC_HEADERS): Remove obsolete defines.
10041 * sysdep.c: Include limits.h unconditionally.
10042
10043 Assume support for memcmp, memcpy, memmove, memset.
10044 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10045 * regex.c (memcmp, memcpy):
10046 Remove; we assume C89 now.
10047
10048 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10049 (__malloc_safe_bcopy): Remove; no longer needed.
10050
10051 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
10052 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10053 well either way, and we prefer signed to unsigned.
10054
10055 2011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10056
10057 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10058 closes the connection while we're reading (bug#9182).
10059
10060 2011-07-25 Jan Djärv <jan.h.d@swipnet.se>
10061
10062 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10063 are specified (Bug#9168).
10064
10065 2011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10066
10067 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10068 Found by GCC static checking and --with-wide-int on a 32-bit host.
10069
10070 2011-07-25 Eli Zaretskii <eliz@gnu.org>
10071
10072 * xdisp.c (compute_display_string_pos): Fix logic of caching
10073 previous display string position. Initialize cached_prev_pos to
10074 -1. Fixes slow-down at the beginning of a buffer.
10075
10076 2011-07-24 Eli Zaretskii <eliz@gnu.org>
10077
10078 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10079 for attrs[LFACE_FONTSET_INDEX].
10080
10081 2011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10082
10083 * xml.c (parse_region): Remove unused local
10084 that was recently introduced.
10085
10086 2011-07-23 Eli Zaretskii <eliz@gnu.org>
10087
10088 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10089 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10090
10091 * xdisp.c (move_it_in_display_line_to): Record the best matching
10092 position for TO_CHARPOS while scanning the line, and restore it on
10093 exit if none of the characters scanned was an exact match.
10094 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
10095 when exact match is impossible due to invisible text, and the
10096 lines are truncated.
10097
10098 2011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10099
10100 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10101 for OSX >= 10.7.
10102
10103 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10104
10105 Fix a significant slow-down of cursor motion with C-n, C-p,
10106 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10107 auto-repeat under bidi redisplay in fontified buffers.
10108 * xdisp.c (compute_stop_pos_backwards): New function.
10109 (next_element_from_buffer): Call compute_stop_pos_backwards to
10110 find a suitable prev_stop when we find ourselves before
10111 base_level_stop.
10112 (reseat): Don't look for prev_stop, as that could mean a very long
10113 run.
10114 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10115 <cached_disp_overlay_modiff>: Cache for last found display string
10116 position.
10117 (compute_display_string_pos): Return the cached position if asked
10118 about the same buffer in the same area of character positions, and
10119 the buffer wasn't changed since the time the display string
10120 position was cached.
10121
10122 2011-07-22 Eli Zaretskii <eliz@gnu.org>
10123
10124 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10125 is an integer, which is important for empty lines. (Bug#9149)
10126
10127 2011-07-22 Chong Yidong <cyd@stupidchicken.com>
10128
10129 * frame.c (Fmodify_frame_parameters): In tty case, update the
10130 default face if necessary (Bug#4238).
10131
10132 2011-07-21 Chong Yidong <cyd@stupidchicken.com>
10133
10134 * editfns.c (Fstring_to_char): No need to explain what a character
10135 is in the docstring (Bug#6576).
10136
10137 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10138
10139 * xml.c (parse_region): Make sure we always return a tree.
10140
10141 2011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10142
10143 * xml.c (parse_region): If a document contains only comments,
10144 return that, too.
10145
10146 2011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10147
10148 * xml.c (make_dom): Return comments, too.
10149
10150 2011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10151
10152 Port to OpenBSD.
10153 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10154 and the surrounding thread.
10155 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10156 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10157 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10158 timer goes off.
10159 * s/openbsd.h (BROKEN_SIGIO): Define.
10160 * unexelf.c (unexec) [__OpenBSD__]:
10161 Don't update the .mdebug section of the Alpha COFF symbol table.
10162
10163 2011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10164
10165 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10166 (bug#8460).
10167
10168 2011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10169
10170 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10171 This fixes some race conditions on the permissions of any newly
10172 created file.
10173
10174 * alloc.c (valid_pointer_p): Use pipe, not open.
10175 This fixes some permissions issues when debugging.
10176
10177 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10178 If fchown fails to set both uid and gid, try to set just gid,
10179 as that is sometimes allowed. Adjust the file's mode to eliminate
10180 setuid or setgid bits that are inappropriate if fchown fails.
10181
10182 2011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10183
10184 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10185 to compare Lisp_Objects.
10186 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10187 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10188 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10189
10190 2011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10191
10192 * lread.c (read_integer): Unread even EOF character.
10193 (read1): Likewise. Properly record start position of symbol.
10194
10195 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10196 symbol character follows.
10197
10198 2011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10199
10200 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10201 This works around a problem with the previous change to Fcopy_file.
10202 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10203 and without this change, GCC might complain about discarding
10204 fchown's return value.
10205
10206 2011-07-16 Juanma Barranquero <lekktu@gmail.com>
10207
10208 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10209
10210 2011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10211
10212 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10213
10214 2011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10215
10216 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10217 it's used from the C level.
10218
10219 * process.c: Use the same condition for POLL_FOR_INPUT in both
10220 keyboard.c and process.c (bug#1858).
10221
10222 2011-07-09 Lawrence Mitchell <wence@gmx.li>
10223
10224 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10225 (Fgnutls_boot): Use it.
10226
10227 2011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10228
10229 * doc.c (Fsubstitute_command_keys): Revert last change.
10230
10231 2011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10232
10233 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10234 quotes the next character, and doesn't affect other longer
10235 sequences (bug#8935).
10236
10237 * lread.c (syms_of_lread): Clarify that is isn't only
10238 `eval-buffer' and `eval-defun' that's affected by
10239 `lexical-binding' (bug#8460).
10240
10241 2011-07-15 Eli Zaretskii <eliz@gnu.org>
10242
10243 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
10244 bidi redisplay when a line includes both an image and is truncated.
10245
10246 2011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10247
10248 Fix minor problems found by static checking.
10249 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10250 (elsz): Now a signed constant, not a size_t var. We prefer signed
10251 types to unsigned, to avoid integer comparison confusion. Without
10252 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10253 "cannot optimize loop, the loop counter may overflow", a symptom
10254 of the confusion.
10255 * indent.c (Fvertical_motion): Mark locals as initialized.
10256 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10257
10258 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10259
10260 * search.c (Fre_search_backward): Mention `case-fold-search' in
10261 all the re_search_* functions (bug#8138).
10262
10263 * keyboard.c (Fopen_dribble_file): Document when the file is
10264 closed (bug#8056).
10265
10266 2011-07-14 Eli Zaretskii <eliz@gnu.org>
10267
10268 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10269 bidi_cache_idx.
10270
10271 Support bidi reordering of display and overlay strings.
10272 * xdisp.c (compute_display_string_pos)
10273 (compute_display_string_end): Accept additional argument STRING.
10274 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10275 (reseat_to_string): Initialize bidi_it->string.s and
10276 bidi_it->string.schars.
10277 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
10278 NULL (avoids a crash in bidi_paragraph_init).
10279 Initialize itb.string.lstring.
10280 (init_iterator): Call bidi_init_it only of a valid
10281 buffer position was specified. Initialize paragraph_embedding to
10282 L2R.
10283 (reseat_to_string): Initialize the bidi iterator.
10284 (display_string): If we need to ignore text properties of
10285 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10286 original value of -1 will not work with bidi.)
10287 (compute_display_string_pos): First arg is now struct
10288 `text_pos *'; all callers changed. Support display properties on
10289 Lisp strings.
10290 (compute_display_string_end): Support display properties on Lisp
10291 strings.
10292 (init_iterator, reseat_1, reseat_to_string): Initialize the
10293 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10294 when iterating on a string not from display properties).
10295 (compute_display_string_pos, compute_display_string_end):
10296 Fix calculation of the object to scan. Fixes an error when using
10297 arrow keys.
10298 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
10299 base_level_stop; instead, set base_level_stop to BEGV.
10300 Fixes crashes in vertical-motion.
10301 (next_element_from_buffer): Improve commentary for when
10302 the iterator is before prev_stop.
10303 (init_iterator): Initialize bidi_p from the default value of
10304 bidi-display-reordering, not from buffer-local value. Use the
10305 buffer-local value only if initializing for buffer iteration.
10306 (handle_invisible_prop): Support invisible properties on strings
10307 that are being bidi-reordered.
10308 (set_iterator_to_next): Support bidi reordering of C strings and
10309 Lisp strings.
10310 (next_element_from_string): Support bidi reordering of Lisp
10311 strings.
10312 (handle_stop_backwards): Support Lisp strings as well.
10313 (display_string): Support display of R2L glyph rows.
10314 Use IT_STRING_CHARPOS when displaying from a Lisp string.
10315 (init_iterator): Don't initialize it->bidi_p for strings
10316 here.
10317 (reseat_to_string): Initialize it->bidi_p for strings here.
10318 (next_element_from_string, next_element_from_c_string)
10319 (next_element_from_buffer): Add xassert's for correspondence
10320 between IT's object being iterated and it->bidi_it.string
10321 structure.
10322 (face_before_or_after_it_pos): Support bidi iteration.
10323 (next_element_from_c_string): Handle the case of the first string
10324 character that is not the first one in the visual order.
10325 (get_visually_first_element): New function, refactored from common
10326 parts of next_element_from_buffer, next_element_from_string, and
10327 next_element_from_c_string.
10328 (tool_bar_lines_needed, redisplay_tool_bar)
10329 (display_menu_bar): Force left-to-right direction. Add a FIXME
10330 comment for making that be controlled by a user option.
10331 (push_it, pop_it): Save and restore the state of the
10332 bidi iterator. Save and restore the bidi_p flag.
10333 (pop_it): Iterate out of display property for string iteration as
10334 well.
10335 (iterate_out_of_display_property): Support iteration over strings.
10336 (handle_single_display_spec): Set up it->bidi_it for iteration
10337 over a display string, and call bidi_init_it.
10338 (handle_single_display_spec, next_overlay_string)
10339 (get_overlay_strings_1, push_display_prop): Set up the bidi
10340 iterator for displaying display or overlay strings.
10341 (forward_to_next_line_start): Don't use the shortcut if
10342 bidi-iterating.
10343 (back_to_previous_visible_line_start): If handle_display_prop
10344 pushed the iterator stack, restore the internal state of the bidi
10345 iterator by calling bidi_pop_it same number of times.
10346 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10347 and we are bidi-iterating, don't decrement the iterator position;
10348 instead, set the first_elt flag in the bidi iterator, to produce
10349 the same effect.
10350 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10351 (push_display_prop): xassert that we are iterating a buffer.
10352 (push_it, pop_it): Save and restore paragraph_embedding member.
10353 (handle_single_display_spec, next_overlay_string)
10354 (get_overlay_strings_1, reseat_1, reseat_to_string)
10355 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10356 correctly. Don't assume unibyte strings are not bidi-reordered.
10357 (compute_display_string_pos)
10358 (compute_display_string_end): Fix handling the case of C string.
10359 (push_it, pop_it): Save and restore from_disp_prop_p.
10360 (handle_single_display_spec, push_display_prop): Set the
10361 from_disp_prop_p flag.
10362 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10363 (pop_it): Call iterate_out_of_display_property only if we are
10364 popping after iteration over a string that came from a display
10365 property. Fix a typo in popping stretch info. Add an assertion
10366 for verifying that the iterator position is in sync with the bidi
10367 iterator.
10368 (handle_single_display_spec, get_overlay_strings_1)
10369 (push_display_prop): Fix initialization of paragraph direction for
10370 string when that of the parent object is not yet determined.
10371 (reseat_1): Call bidi_init_it to resync the bidi
10372 iterator with IT's position. (Bug#7616)
10373 (find_row_edges): If ROW->start.pos gives position
10374 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10375 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10376 Reset the from_disp_prop_p flag.
10377 (SAVE_IT, RESTORE_IT): New macros.
10378 (pos_visible_p, face_before_or_after_it_pos)
10379 (back_to_previous_visible_line_start)
10380 (move_it_in_display_line_to, move_it_in_display_line)
10381 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10382 (try_scrolling, redisplay_window, display_line): Use them when
10383 saving a temporary copy of the iterator and restoring it back.
10384 (back_to_previous_visible_line_start, reseat_1)
10385 (init_iterator): Empty the bidi cache "stack".
10386 (move_it_in_display_line_to): If iterator ended up at
10387 EOL, but we never saw any buffer positions smaller than
10388 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10389 motion in bidi-reordered lines.
10390 (move_it_in_display_line_to): Record prev_method and prev_pos
10391 immediately before the call to set_iterator_to_next. Fixes cursor
10392 motion in bidi-reordered lines with stretch glyphs and strings
10393 displayed in margins. (Bug#8133) (Bug#8867)
10394 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10395 TO_CHARPOS.
10396 (pos_visible_p): Support positions in bidi-reordered lines.
10397 Save and restore bidi cache.
10398
10399 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10400 (bidi_paragraph_info): Delete unused struct.
10401 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10402 (bidi_cache_start): New variable.
10403 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10404 to zero.
10405 (bidi_cache_fetch_state, bidi_cache_search)
10406 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10407 (bidi_cache_find, bidi_peek_at_next_level)
10408 (bidi_level_of_next_char, bidi_find_other_level_edge)
10409 (bidi_move_to_visually_next): Compare cache index with
10410 bidi_cache_start rather than with zero.
10411 (bidi_fetch_char): Accept new argument STRING; all callers
10412 changed. Support iteration over a string. Support strings with
10413 display properties. Support unibyte strings. Fix the type of
10414 `len' according to what STRING_CHAR_AND_LENGTH expects.
10415 (bidi_paragraph_init, bidi_resolve_explicit_1)
10416 (bidi_resolve_explicit, bidi_resolve_weak)
10417 (bidi_level_of_next_char, bidi_move_to_visually_next):
10418 Support iteration over a string.
10419 (bidi_set_sor_type, bidi_resolve_explicit_1)
10420 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10421 can now be zero (for strings); special values 0 and -1 were
10422 changed to -1 and -2, respectively.
10423 (bidi_char_at_pos): New function.
10424 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10425 Call it instead of FETCH_MULTIBYTE_CHAR.
10426 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10427 initialized to valid values.
10428 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10429 values.
10430 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10431 the test for valid cached positions. Fix the logic for looking up
10432 the sentinel state in the cache. GCPRO the Lisp string we are
10433 iterating.
10434 (bidi_push_it, bidi_pop_it): New functions.
10435 (bidi_initialize): Initialize the bidi cache start stack pointer.
10436 (bidi_cache_ensure_space): New function, refactored from part of
10437 bidi_cache_iterator_state. Don't assume the required size is just
10438 one BIDI_CACHE_CHUNK away.
10439 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10440 (bidi_count_bytes, bidi_char_at_pos): New functions.
10441 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10442 always valid if bidi_cache_idx is valid.
10443 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10444 is valid if it's going to be used.
10445 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10446 (bidi_cache_fetch_state, bidi_cache_search)
10447 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10448 (bidi_cache_iterator_state, bidi_cache_find)
10449 (bidi_find_other_level_edge, bidi_cache_start_stack):
10450 All variables related to cache indices are now EMACS_INT.
10451
10452 * dispextern.h (struct bidi_string_data): New structure.
10453 (struct bidi_it): New member `string'. Make flag members be 1-bit
10454 fields, and put them last in the struct.
10455 (compute_display_string_pos, compute_display_string_end):
10456 Update prototypes.
10457 (bidi_push_it, bidi_pop_it): Add prototypes.
10458 (struct iterator_stack_entry): New members bidi_p,
10459 paragraph_embedding, and from_disp_prop_p.
10460 (struct it): Member bidi_p is now a bit field 1 bit wide.
10461 (bidi_shelve_cache, bidi_unshelve_cache):
10462 Declare prototypes.
10463
10464 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10465 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10466 and vector-like objects.
10467
10468 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10469 cache around display iteration.
10470
10471 * window.c (Fwindow_end, window_scroll_pixel_based)
10472 (displayed_window_lines, Frecenter): Save and restore the bidi
10473 cache around display iteration.
10474
10475 2011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10476
10477 * editfns.c (Fdelete_region): Clarify the use of the named
10478 parameters (bug#6788).
10479
10480 2011-07-14 Martin Rudalics <rudalics@gmx.at>
10481
10482 * indent.c (Fvertical_motion): Set and restore w->pointm when
10483 saving and restoring the window's buffer (Bug#9006).
10484
10485 2011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10486
10487 * editfns.c (Fstring_to_char): Clarify just what is returned
10488 (bug#6576). Text by Eli Zaretskii.
10489
10490 2011-07-13 Juanma Barranquero <lekktu@gmail.com>
10491
10492 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10493
10494 2011-07-13 Eli Zaretskii <eliz@gnu.org>
10495
10496 * buffer.c (mmap_find): Fix a typo.
10497
10498 2011-07-13 Johan Bockgård <bojohan@gnu.org>
10499
10500 Fix execution of x selection hooks.
10501 * xselect.c (Qx_lost_selection_functions)
10502 (Qx_sent_selection_functions): New vars.
10503 (syms_of_xselect): DEFSYM them.
10504 (x_handle_selection_request): Pass Qx_sent_selection_functions
10505 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10506 (x_handle_selection_clear,x_clear_frame_selections):
10507 Pass Qx_lost_selection_functions rather than
10508 Vx_lost_selection_functions to Frun_hook_with_args.
10509
10510 2011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10511
10512 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
10513 The old code sometimes used this field without initializing it.
10514
10515 * alloc.c (gc_sweep): Don't read past end of array.
10516 In theory, the old code could also have corrupted Emacs internals,
10517 though it'd be very unlikely.
10518
10519 2011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10520
10521 * character.c (Fcharacterp): Don't advertise optional ignored
10522 argument. (Bug#4026)
10523
10524 2011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10525
10526 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10527 key" (bug#4257).
10528
10529 * window.c (Fset_window_start): Doc fix (bug#4199).
10530 (Fset_window_hscroll): Ditto.
10531
10532 2011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10533
10534 Fix minor new problems caught by GCC 4.6.1.
10535 * term.c (init_tty): Remove unused local.
10536 * xsettings.c (store_monospaced_changed): Define this function only
10537 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
10538 not used otherwise.
10539
10540 2011-07-12 Chong Yidong <cyd@stupidchicken.com>
10541
10542 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10543
10544 2011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10545
10546 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10547 are the mini-buffer and the echo area (bug#3320).
10548
10549 * term.c (init_tty): Remove support for supdup, c10 and perq
10550 terminals, which are no longer supported (bug#1482).
10551
10552 2011-07-10 Johan Bockgård <bojohan@gnu.org>
10553
10554 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10555
10556 2011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10557
10558 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10559 for non-popups (Bug#3642).
10560
10561 2011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10562
10563 * alloc.c (reset_malloc_hooks): Protoize.
10564 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
10565 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10566 * cm.c (losecursor): Likewise.
10567 * data.c (fmod): Likewise.
10568 * dispnew.c (swap_glyphs_in_rows): Likewise.
10569 * emacs.c (memory_warning_signal): Likewise.
10570 * floatfns.c (float_error): Likewise.
10571 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10572 (otf_open, font_otf_capability, generate_otf_features)
10573 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10574 Likewise.
10575 * image.c (pbm_read_file): Likewise.
10576 * indent.c (string_display_width): Likewise.
10577 * intervals.c (check_for_interval, search_for_interval)
10578 (inc_interval_count, count_intervals, root_interval)
10579 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10580 * lread.c (defalias): Likewise.
10581 * ralloc.c (r_alloc_check): Likewise.
10582 * regex.c (set_image_of_range_1, set_image_of_range)
10583 (regex_grow_registers): Likewise.
10584 * sysdep.c (strerror): Likewise.
10585 * termcap.c (valid_filename_p, tprint, main): Likewise.
10586 * tparam.c (main): Likewise.
10587 * unexhp9k800.c (run_time_remap, save_data_space)
10588 (update_file_ptrs, read_header, write_header, calculate_checksum)
10589 (copy_file, copy_rest, display_header): Likewise.
10590 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10591 Likewise.
10592 * xdisp.c (check_it): Likewise.
10593 * xfaces.c (register_color, unregister_color, unregister_colors):
10594 Likewise.
10595 * xfns.c (print_fontset_result): Likewise.
10596 * xrdb.c (member, fatal, main): Likewise.
10597
10598 2011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10599
10600 Fix minor problems found by static checking (Bug#9031).
10601 * chartab.c (char_table_set_range, map_sub_char_table):
10602 Remove unused locals.
10603 (uniprop_table): Now static.
10604 * composite.c (_work_char): Remove unused static var.
10605
10606 2011-07-09 Juanma Barranquero <lekktu@gmail.com>
10607
10608 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10609
10610 2011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10611
10612 * gtkutil.c (qttip_cb): Remove code without function.
10613
10614 2011-07-09 Eli Zaretskii <eliz@gnu.org>
10615
10616 * w32.c (pthread_sigmask): New stub.
10617
10618 2011-07-08 Paul Eggert <eggert@cs.ucla.edu>
10619
10620 Use pthread_sigmask, not sigprocmask (Bug#9010).
10621 sigprocmask is portable only for single-threaded applications, and
10622 Emacs can be multi-threaded when it uses GTK.
10623 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10624 (LIBES): Use it.
10625 * callproc.c (Fcall_process):
10626 * process.c (create_process):
10627 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10628 Use pthread_sigmask, not sigprocmask.
10629
10630 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10631
10632 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10633 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10634 wrong (Bug#8591).
10635
10636 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10637
10638 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10639 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10640 (xg_hide_tooltip): Fix comment.
10641
10642 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10643 in registerServicesMenuSendTypes.
10644 (validRequestorForSendType): Don't check ns_return_types.
10645
10646 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10647 ns_return_type.
10648
10649 2011-07-08 Jason Rumney <jasonr@gnu.org>
10650
10651 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10652 SH_SHOW for hidden windows (Bug#5482).
10653
10654 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10655 frame struct members of non-existent frames (Bug#6284).
10656
10657 2011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10658
10659 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10660 variable firstTime not needed on OSX >= 10.6.
10661 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10662 >= 10.5. Use setKnobProportion, setDoubleValue.
10663
10664 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10665 (MAC_OS_X_VERSION_10_5): Define if not defined.
10666 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10667 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10668 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10669
10670 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
10671 cString and lossyCString on OSX >= 10.4.
10672
10673 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
10674 sizeToFit on OSX >= 10.2.
10675
10676 * nsimage.m (allocInitFromFile): Don't use deprecated method
10677 bestRepresentationForDevice on OSX >= 10.6.
10678
10679 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10680 to avoid warning.
10681
10682 * emacs.c: Declare unexec_init_emacs_zone.
10683
10684 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10685
10686 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10687
10688 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10689 on svcsMenu (Bug#8842).
10690
10691 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10692 ns_return_types.
10693 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10694
10695 * nsterm.m (QUTF8_STRING): Declare.
10696 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10697 (validRequestorForSendType): Return type is (id).
10698 Change indexOfObjectIdenticalTo to indexOfObject.
10699 Check if we have local selection before returning self (Bug#8842).
10700 (writeSelectionToPasteboard): Put local selection into paste board
10701 if we have a local selection (Bug#8842).
10702 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10703
10704 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10705 (ns_get_local_selection): Declare.
10706
10707 2011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10708
10709 * keymap.c (describe_map_tree): Don't insert a double newline at
10710 the end of the buffer (bug#1169) and return whether we inserted
10711 something.
10712
10713 * callint.c (Fcall_interactively): Change "reading args" to
10714 "providing args" to try to clarify what it does (bug#1010).
10715
10716 2011-07-07 Kenichi Handa <handa@m17n.org>
10717
10718 * composite.c (composition_compute_stop_pos): Ignore a static
10719 composition starting before CHARPOS (Bug#8915).
10720
10721 * xdisp.c (handle_composition_prop): Likewise.
10722
10723 2011-07-07 Eli Zaretskii <eliz@gnu.org>
10724
10725 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10726 (Bug#9015)
10727
10728 2011-07-07 Kenichi Handa <handa@m17n.org>
10729
10730 * character.h (unicode_category_t): New enum type.
10731
10732 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10733 (Qchar_code_property_table): New variable.
10734 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10735 (UNIPROP_COMPRESSED_FORM_P): New macros.
10736 (char_table_ascii): Uncompress the compressed values.
10737 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10738 Uncompress the compressed values.
10739 (sub_char_table_ref_and_range): Likewise.
10740 (char_table_ref_and_range): Uncompress the compressed values.
10741 (sub_char_table_set): New arg is_uniprop. Callers changed.
10742 Uncompress the compressed values.
10743 (sub_char_table_set_range): Args changed. Callers changed.
10744 (char_table_set_range): Adjuted for the above change.
10745 (map_sub_char_table): Delete args default_val and parent. Add arg
10746 top. Give decoded values to a Lisp function.
10747 (map_char_table): Adjust for the above change. Give decoded
10748 values to a Lisp function. Gcpro more variables.
10749 (uniprop_table_uncompress)
10750 (uniprop_decode_value_run_length): New functions.
10751 (uniprop_decoder, uniprop_decoder_count): New variables.
10752 (uniprop_get_decoder, uniprop_encode_value_character)
10753 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10754 New functions.
10755 (uniprop_encoder, uniprop_encoder_count): New variables.
10756 (uniprop_get_encoder, uniprop_table)
10757 (Funicode_property_table_internal, Fget_unicode_property_internal)
10758 (Fput_unicode_property_internal): New functions.
10759 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10760 Sunicode_property_table_internal, Sget_unicode_property_internal,
10761 and Sput_unicode_property_internal. Defvar_lisp
10762 char-code-property-alist.
10763
10764 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
10765 Vunicode_category_table.
10766
10767 * font.c (font_range): Adjust for the change of
10768 Vunicode_category_table.
10769
10770 2011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10771
10772 * m/iris4d.h: Remove file, move contents ...
10773 * s/irix6-5.h: ... here.
10774
10775 2011-07-06 Paul Eggert <eggert@cs.ucla.edu>
10776
10777 Remove unportable assumption about struct layout (Bug#8884).
10778 * alloc.c (mark_buffer):
10779 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10780 (clone_per_buffer_values): Don't assume that
10781 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10782 This isn't true in general, and it's particularly not true
10783 if Emacs is configured with --with-wide-int.
10784 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10785 New macros, used in the buffer.c change.
10786
10787 2011-07-05 Jan Djärv <jan.h.d@swipnet.se>
10788
10789 * xsettings.c: Use both GConf and GSettings if both are available.
10790 (store_config_changed_event): Add comment.
10791 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10792 (store_tool_bar_style_changed): New functions.
10793 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
10794 (struct xsettings): Move font inside HAVE_XFT.
10795 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
10796 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
10797 Move inside HAVE_XFT.
10798 (something_changed_gsettingsCB): Rename from something_changedCB.
10799 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10800 also.
10801 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
10802 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
10803 (something_changed_gconfCB): Rename from something_changedCB.
10804 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10805 (parse_settings): Move check for font inside HAVE_XFT.
10806 (read_settings, apply_xft_settings): Add comment.
10807 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
10808 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
10809 call store_font_name_changed.
10810 (xft_settings_event): Add comment.
10811 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
10812 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
10813 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
10814 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
10815 (xsettings_initialize): Call init_gsettings last.
10816 (xsettings_get_system_font, xsettings_get_system_normal_font):
10817 Add comment.
10818
10819 2011-07-05 Paul Eggert <eggert@cs.ucla.edu>
10820
10821 Random fixes. E.g., (random) never returned negative values.
10822 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10823 subseconds part to the entropy, as that's a bit more random.
10824 Prefer signed to unsigned, since the signedness doesn't matter and
10825 in general we prefer signed. When given a limit, use a
10826 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
10827 latter isn't right if USE_2_TAGS_FOR_INTS.
10828 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
10829 not 0..VALMASK. Don't discard "excess" bits that random () returns.
10830
10831 2011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10832
10833 * textprop.c (text_property_stickiness):
10834 Obey Vtext_property_default_nonsticky.
10835 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
10836 * w32fns.c (syms_of_w32fns):
10837 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
10838
10839 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10840
10841 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
10842 This is more efficient than Ffile_directory_p and avoids a minor race.
10843
10844 2011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
10845
10846 * buffer.c (Foverlay_put): Say what the return value is
10847 (bug#7835).
10848
10849 * fileio.c (barf_or_query_if_file_exists): Check first if the file
10850 is a directory before asking whether to use the file name
10851 (bug#7564).
10852 (barf_or_query_if_file_exists): Make the "File is a directory"
10853 error be more correct.
10854
10855 * fns.c (Frequire): Remove the mention of the .gz files, since
10856 that's installation-specific, but keep the mention of
10857 `get-load-suffixes'.
10858
10859 2011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10860
10861 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10862 Report string overflow if the output is too long.
10863
10864 2011-07-04 Juanma Barranquero <lekktu@gmail.com>
10865
10866 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10867 (syms_of_gnutls): Remove duplicate DEFSYM for
10868 Qgnutls_bootprop_verify_hostname_error, an error for
10869 Qgnutls_bootprop_verify_error (which is no longer used).
10870
10871 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10872 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
10873 Also (re)move comments that are misplaced or no longer relevant.
10874
10875 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10876
10877 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10878
10879 2011-07-03 Chong Yidong <cyd@stupidchicken.com>
10880
10881 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10882 and background color parameters if they have been changed.
10883
10884 2011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10885
10886 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10887
10888 2011-07-03 Paul Eggert <eggert@cs.ucla.edu>
10889
10890 * xsettings.c (SYSTEM_FONT): Define only when used.
10891 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
10892
10893 * keymap.c (access_keymap_1): Now static.
10894
10895 2011-07-02 Chong Yidong <cyd@stupidchicken.com>
10896
10897 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
10898 leave any prefix arg for the up event (Bug#1586).
10899
10900 2011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
10901
10902 * lread.c (syms_of_lread): Mention single symbols defined by
10903 `defvar' or `defconst' (bug#7154).
10904
10905 * fns.c (Frequire): Mention .el.gz files (bug#7314).
10906 (Frequire): Mention get-load-suffixes.
10907
10908 2011-07-02 Martin Rudalics <rudalics@gmx.at>
10909
10910 * window.h (window): Remove clone_number slot.
10911 * window.c (Fwindow_clone_number, Fset_window_clone_number):
10912 Remove.
10913 (make_parent_window, make_window, saved_window)
10914 (Fset_window_configuration, save_window_save): Don't deal with
10915 clone numbers.
10916 * buffer.c (Qclone_number): Remove declaration.
10917 (sort_overlays, overlay_strings): Don't deal with clone numbers.
10918
10919 2011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
10920
10921 Add multiple inheritance to keymaps.
10922 * keymap.c (Fmake_composed_keymap): New function.
10923 (Fset_keymap_parent): Simplify.
10924 (fix_submap_inheritance): Remove.
10925 (access_keymap_1): New function extracted from access_keymap to handle
10926 embedded parents and handle lists of maps.
10927 (access_keymap): Use it.
10928 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
10929 (Fcopy_keymap): Handle embedded parents.
10930 (Fcommand_remapping, define_as_prefix): Simplify.
10931 (Fkey_binding): Simplify.
10932 (syms_of_keymap): Move minibuffer-local-completion-map,
10933 minibuffer-local-filename-completion-map,
10934 minibuffer-local-must-match-map, and
10935 minibuffer-local-filename-must-match-map to Elisp.
10936 (syms_of_keymap): Defsubr make-composed-keymap.
10937 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
10938 (parse_menu_item): Trivial simplification.
10939
10940 2011-07-01 Glenn Morris <rgm@gnu.org>
10941
10942 * Makefile.in (SETTINGS_LIBS): Fix typo.
10943
10944 2011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
10945
10946 * coding.c (Fencode_coding_string): Record the last coding system
10947 used, as the function doc string says (bug#8738).
10948
10949 2011-07-01 Jan Djärv <jan.h.d@swipnet.se>
10950
10951 * xsettings.c (store_monospaced_changed): Take new font as arg and
10952 check for change against current_mono_font.
10953 (EMACS_TYPE_SETTINGS): Remove this and related defines.
10954 (emacs_settings_constructor, emacs_settings_get_property)
10955 (emacs_settings_set_property, emacs_settings_class_init)
10956 (emacs_settings_init, gsettings_obj): Remove.
10957 (something_changedCB): New function for HAVE_GSETTINGS.
10958 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
10959 with value as argument.
10960 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
10961 g_settings_new (Bug#8967). Do not create gsettings_obj.
10962 Remove calls to g_settings_bind. Connect something_changedCB to
10963 "changed".
10964
10965 * xgselect.c: Add defined (HAVE_GSETTINGS).
10966 (xgselect_initialize): Ditto.
10967
10968 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
10969 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
10970 xg_select.
10971
10972 2011-07-01 Paul Eggert <eggert@cs.ucla.edu>
10973
10974 * eval.c (struct backtrace): Simplify and port the data structure.
10975 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
10976 signed bit field, as this assumption is not portable and it makes
10977 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
10978 "char debug_on_exit : 1" as this is not portable either; instead,
10979 use the portable "unsigned int debug_on_exit : 1". Remove unused
10980 member evalargs. Remove obsolete comments about cc bombing out.
10981
10982 2011-06-30 Jan Djärv <jan.h.d@swipnet.se>
10983
10984 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
10985 Let HAVE_GSETTINGS override HAVE_GCONF.
10986 (store_monospaced_changed): New function.
10987 (EMACS_SETTINGS): A new type derived from GObject to handle
10988 GSettings notifications.
10989 (emacs_settings_constructor, emacs_settings_get_property)
10990 (emacs_settings_set_property, emacs_settings_class_init):
10991 New functions.
10992 (gsettings_client, gsettings_obj): New variables.
10993 (GSETTINGS_SCHEMA): New define.
10994 (something_changedCB): Call store_monospaced_changed.
10995 (init_gsettings): New function.
10996 (xsettings_initialize): Call init_gsettings.
10997 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
10998 to NULL.
10999
11000 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
11001 GCONF_CFLAGS/LIBS.
11002
11003 2011-06-29 Martin Rudalics <rudalics@gmx.at>
11004
11005 * window.c (resize_root_window, grow_mini_window)
11006 (shrink_mini_window): Rename Qresize_root_window to
11007 Qwindow_resize_root_window and Qresize_root_window_vertically to
11008 Qwindow_resize_root_window_vertically.
11009
11010 2011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11011
11012 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11013
11014 2011-06-27 Juanma Barranquero <lekktu@gmail.com>
11015
11016 * makefile.w32-in: Redesign dependencies so they reflect more
11017 clearly which files are directly included by each source file,
11018 and not through other includes.
11019
11020 2011-06-27 Martin Rudalics <rudalics@gmx.at>
11021
11022 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11023 (sort_overlays, overlay_strings): When an overlay's clone number
11024 matches the window's clone number process the overlay even if
11025 the overlay's window property doesn't match the current window.
11026
11027 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11028 (Fwindow_hchild): Rename to Fwindow_left_child.
11029 (Fwindow_next): Rename to Fwindow_next_sibling.
11030 (Fwindow_prev): Rename to Fwindow_prev_sibling.
11031 (resize_window_check): Rename to window_resize_check.
11032 (resize_window_apply): Rename to window_resize_apply.
11033 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11034 (Fdelete_other_windows_internal, resize_frame_windows)
11035 (Fsplit_window_internal, Fdelete_window_internal)
11036 (grow_mini_window, shrink_mini_window)
11037 (Fresize_mini_window_internal): Fix callers accordingly.
11038
11039 2011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11040
11041 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11042 (emacs_fixed_set_min_size): Remove.
11043 (emacs_fixed_new): Take frame as argument.
11044
11045 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11046 (_EmacsFixedPrivate): Remove minwidth/height.
11047 Add struct frame *f.
11048 (emacs_fixed_init): Initialize priv->f.
11049 (get_parent_class, emacs_fixed_set_min_size): Remove.
11050 (emacs_fixed_new): Set priv->f to argument.
11051 (emacs_fixed_get_preferred_width)
11052 (emacs_fixed_get_preferred_height): Use min_width/height from
11053 frames size_hint to set minimum and natural (Bug#8919).
11054 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11055 and use min_width/height from frames size_hint to set
11056 min_width/height (Bug#8919).
11057
11058 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
11059 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11060 Fix indentation.
11061
11062 2011-06-26 Eli Zaretskii <eliz@gnu.org>
11063
11064 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11065 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11066 called at ZV.
11067
11068 2011-06-26 Chong Yidong <cyd@stupidchicken.com>
11069
11070 * process.c (wait_reading_process_output): Bypass select if
11071 waiting for a cell while ignoring keyboard input, and input is
11072 pending. Suggested by Jan Djärv (Bug#8869).
11073
11074 2011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11075
11076 Use gnulib's dup2 module instead of rolling our own.
11077 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11078
11079 2011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
11080
11081 * dispnew.c (scrolling_window): Before scrolling, turn off a
11082 mouse-highlight in the window being scrolled.
11083
11084 2011-06-24 Juanma Barranquero <lekktu@gmail.com>
11085
11086 Move DEFSYM to lisp.h and use everywhere.
11087
11088 * character.h (DEFSYM): Move declaration...
11089 * lisp.h (DEFSYM): ...here.
11090
11091 * gnutls.c:
11092 * minibuf.c:
11093 * w32menu.c:
11094 * w32proc.c:
11095 * w32select.c: Don't include character.h.
11096
11097 * alloc.c (syms_of_alloc):
11098 * buffer.c (syms_of_buffer):
11099 * bytecode.c (syms_of_bytecode):
11100 * callint.c (syms_of_callint):
11101 * casefiddle.c (syms_of_casefiddle):
11102 * casetab.c (init_casetab_once):
11103 * category.c (init_category_once, syms_of_category):
11104 * ccl.c (syms_of_ccl):
11105 * cmds.c (syms_of_cmds):
11106 * composite.c (syms_of_composite):
11107 * dbusbind.c (syms_of_dbusbind):
11108 * dired.c (syms_of_dired):
11109 * dispnew.c (syms_of_display):
11110 * doc.c (syms_of_doc):
11111 * editfns.c (syms_of_editfns):
11112 * emacs.c (syms_of_emacs):
11113 * eval.c (syms_of_eval):
11114 * fileio.c (syms_of_fileio):
11115 * fns.c (syms_of_fns):
11116 * frame.c (syms_of_frame):
11117 * fringe.c (syms_of_fringe):
11118 * insdel.c (syms_of_insdel):
11119 * keymap.c (syms_of_keymap):
11120 * lread.c (init_obarray, syms_of_lread):
11121 * macros.c (syms_of_macros):
11122 * msdos.c (syms_of_msdos):
11123 * print.c (syms_of_print):
11124 * process.c (syms_of_process):
11125 * search.c (syms_of_search):
11126 * sound.c (syms_of_sound):
11127 * syntax.c (init_syntax_once, syms_of_syntax):
11128 * terminal.c (syms_of_terminal):
11129 * textprop.c (syms_of_textprop):
11130 * undo.c (syms_of_undo):
11131 * w32.c (globals_of_w32):
11132 * window.c (syms_of_window):
11133 * xdisp.c (syms_of_xdisp):
11134 * xfaces.c (syms_of_xfaces):
11135 * xfns.c (syms_of_xfns):
11136 * xmenu.c (syms_of_xmenu):
11137 * xsettings.c (syms_of_xsettings):
11138 * xterm.c (syms_of_xterm): Use DEFSYM.
11139
11140 2011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11141
11142 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
11143
11144 2011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11145
11146 Integer and buffer overflow fixes (Bug#8873).
11147
11148 * print.c (printchar, strout): Check for string overflow.
11149 (PRINTPREPARE, printchar, strout):
11150 Don't set size unless allocation succeeds.
11151
11152 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11153 for sizes. Check for string overflow more accurately.
11154 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11155
11156 * macros.c: Integer and buffer overflow fixes.
11157 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11158 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11159 Use ptrdiff_t, not int, for sizes.
11160 Don't increment bufsize until after realloc succeeds.
11161 Check for size-calculation overflow.
11162 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11163
11164 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11165
11166 * lread.c: Integer overflow fixes.
11167 (read_integer): Radix is now EMACS_INT, not int,
11168 to improve quality of diagnostics for out-of-range radices.
11169 Calculate buffer size correctly for out-of-range radices.
11170 (read1): Check for integer overflow in radices, and in
11171 read-circle numbers.
11172 (read_escape): Avoid int overflow.
11173 (Fload, openp, read_buffer_size, read1)
11174 (substitute_object_recurse, read_vector, read_list, map_obarray):
11175 Use ptrdiff_t, not int, for sizes.
11176 (read1): Use EMACS_INT, not int, for sizes.
11177 Check for size overflow.
11178
11179 * image.c (cache_image): Check for size arithmetic overflow.
11180
11181 * lread.c: Integer overflow issues.
11182 (saved_doc_string_size, saved_doc_string_length)
11183 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11184 Now ptrdiff_t, not int.
11185 (read1): Don't assume doc string length fits in int. Check for
11186 out-of-range doc string lengths.
11187 (read_list): Don't assume file position fits in int.
11188 (read_escape): Check for hex character overflow.
11189
11190 2011-06-22 Leo Liu <sdl.web@gmail.com>
11191
11192 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11193 Move to minibuffer.el.
11194
11195 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11196
11197 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
11198 The following patches are for when GLYPH_DEBUG && !XASSERT.
11199 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11200 * dispnew.c (flush_stdout):
11201 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11202 Mark as externally visible.
11203 * dispnew.c (check_window_matrix_pointers): Now static.
11204 * dispnew.c (window_to_frame_vpos):
11205 * xfns.c (unwind_create_frame):
11206 * xterm.c (x_check_font): Remove unused local.
11207 * scroll.c (CHECK_BOUNDS):
11208 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11209 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11210 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11211 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11212 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11213 Now static.
11214 (debug_method_add): Use va_list and vsprintf rather than relying
11215 on undefined behavior with wrong number of arguments.
11216 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11217 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11218 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11219 since we're not interested in debugging glyphs with old libraries.
11220 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11221 GCC 4.6.0's static checking.
11222
11223 2011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11224
11225 Integer overflow and signedness fixes (Bug#8873).
11226 A few related buffer overrun fixes, too.
11227
11228 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11229
11230 * dispextern.h (struct face.stipple):
11231 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11232 (x_bitmap_mask, x_allocate_bitmap_record)
11233 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11234 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11235 (x_create_bitmap_from_xpm_data):
11236 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11237 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11238 (.bitmaps_last):
11239 * xfaces.c (load_pixmap):
11240 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11241 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11242 (.bitmaps_last, struct x_output.icon_bitmap):
11243 Use ptrdiff_t, not int, for bitmap indexes.
11244 (x_allocate_bitmap_record): Check for size overflow.
11245 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11246
11247 Use ptrdiff_t, not int, for overlay counts.
11248 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11249 * editfns.c (overlays_around, get_pos_property):
11250 * textprop.c (get_char_property_and_overlay):
11251 * xdisp.c (next_overlay_change, note_mouse_highlight):
11252 * xfaces.c (face_at_buffer_position):
11253 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11254 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11255 (Fnext_overlay_change, Fprevious_overlay_change)
11256 (mouse_face_overlay_overlaps, Foverlays_in):
11257 Use ptrdiff_t, not int, for sizes.
11258 (overlays_at, overlays_in): Check for size-calculation overflow.
11259
11260 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11261
11262 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11263 (x_session_initialize): Do not assume string length fits in int.
11264
11265 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11266 This is unlikely, but can occur if DPI is outlandish.
11267
11268 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
11269 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11270
11271 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11272 * xrdb.c (magic_file_p, search_magic_path):
11273 Omit last arg SUFFIX; it was always 0. All callers changed.
11274 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11275
11276 * xfont.c (xfont_match): Avoid need for strlen.
11277
11278 * xfns.c: Don't assume strlen fits in int.
11279 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11280
11281 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11282 not unsigned long, as we prefer signed integers. All callers changed.
11283 Detect integer overflow in repeat count.
11284 (message_dolog): Don't assume print length fits in 39 bytes.
11285 (display_mode_element): Don't assume strlen fits in int.
11286
11287 * termcap.c: Don't assume sizes fit in int and never overflow.
11288 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11289 (gobble_line): Check for size-calculation overflow.
11290
11291 * minibuf.c (Fread_buffer):
11292 * lread.c (intern, intern_c_string):
11293 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11294 Don't assume string length fits in int.
11295
11296 * keyboard.c (parse_tool_bar_item):
11297 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11298
11299 * font.c: Don't assume string length fits in int.
11300 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11301 Use ptrdiff_t, not int.
11302 (font_intern_prop): Don't assume string length fits in int.
11303 Don't assume integer property fits in fixnum.
11304 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
11305
11306 * filelock.c: Fix some buffer overrun and integer overflow issues.
11307 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
11308 Reformulate so as not to need the command string.
11309 Invoke gzip -cd rather than gunzip, as it's more portable.
11310 (lock_info_type, lock_file_1, lock_file):
11311 Don't assume pid_t and time_t fit in unsigned long.
11312 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11313 (current_lock_owner): Prefer signed type for sizes.
11314 Use memcpy, not strncpy, where memcpy is what is really wanted.
11315 Don't assume (via atoi) that time_t and pid_t fit in int.
11316 Check for time_t and/or pid_t out of range, e.g., via a network share.
11317 Don't alloca where an auto var works fine.
11318
11319 * fileio.c: Fix some integer overflow issues.
11320 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11321 Don't assume string length fits in int.
11322 (directory_file_name): Don't assume string length fits in long.
11323 (make_temp_name): Don't assume pid fits in int, or that its print
11324 length is less than 20.
11325
11326 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11327
11328 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11329
11330 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11331
11332 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11333 We prefer signed integers, even for size calculations.
11334
11335 * emacs.c: Don't assume string length fits in 'int'.
11336 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11337 (main): Don't invoke strlen when not needed.
11338
11339 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11340 (XD_DEBUG_MESSAGE): Don't waste a byte.
11341
11342 * callproc.c (getenv_internal_1, getenv_internal)
11343 (Fgetenv_internal):
11344 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11345
11346 * lread.c (invalid_syntax): Omit length argument.
11347 All uses changed. This doesn't fix a bug, but it simplifies the
11348 code away from its former Hollerith-constant appearance, and it's
11349 one less 'int' to worry about when looking at integer-overflow issues.
11350 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
11351
11352 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11353 This didn't break anything, but it didn't help either.
11354 It's confusing to put a bogus integer in a place where the actual
11355 value does not matter.
11356 (LIST_END_P): Remove unused macro and its bogus comment.
11357 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
11358
11359 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11360 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11361 implementation.
11362 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11363 We prefer signed types, and the value cannot exceed the EMACS_INT
11364 range anyway (because otherwise the length would not be representable).
11365 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11366 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11367 This avoids a GCC warning when WIDE_EMACS_INT.
11368
11369 * indent.c (sane_tab_width): New function.
11370 (current_column, scan_for_column, Findent_to, position_indentation)
11371 (compute_motion): Use it. This is just for clarity.
11372 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
11373
11374 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
11375
11376 * lisp.h (lint_assume): New macro.
11377 * composite.c (composition_gstring_put_cache):
11378 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11379
11380 * editfns.c, insdel.c:
11381 Omit unnecessary forward decls, to simplify future changes.
11382
11383 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11384
11385 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11386
11387 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
11388 Use much-faster test for byte-length change.
11389 Don't assume string byte-length fits in 'int'.
11390 Check that character arg fits in 'int'.
11391 (mapcar1): Declare byte as byte, for clarity.
11392
11393 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11394
11395 * fns.c (concat): Catch string overflow earlier.
11396 Do not rely on integer wraparound.
11397
11398 * dispextern.h (struct it.overlay_strings_charpos)
11399 (struct it.selective): Now EMACS_INT, not int.
11400 * xdisp.c (forward_to_next_line_start)
11401 (back_to_previous_visible_line_start)
11402 (reseat_at_next_visible_line_start, next_element_from_buffer):
11403 Don't arbitrarily truncate the value of 'selective' to int.
11404
11405 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11406
11407 * composite.c: Don't truncate sizes to 'int'.
11408 (composition_gstring_p, composition_reseat_it)
11409 (composition_adjust_point): Use EMACS_INT, not int.
11410 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11411 not EMACS_UINT, for indexes.
11412
11413 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11414
11415 * buffer.c: Include <verify.h>.
11416 (struct sortvec.priority, struct sortstr.priority):
11417 Now EMACS_INT, not int.
11418 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
11419 (struct sortstr.size, record_overlay_string)
11420 (struct sortstrlist.size, struct sortlist.used):
11421 Don't truncate size to int.
11422 (record_overlay_string): Check for size-calculation overflow.
11423 (init_buffer_once): Check at compile-time, not run-time.
11424
11425 2011-06-22 Jim Meyering <meyering@redhat.com>
11426
11427 Don't leak an XBM-image-sized buffer
11428 * image.c (xbm_load): Free the image buffer after using it.
11429
11430 2011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11431
11432 Port to Sun C.
11433 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11434 that Sun C diagnosed.
11435 * fns.c (secure_hash): Fix pointer signedness issue.
11436 * intervals.c (static_offset_intervals): New function.
11437 (offset_intervals): Use it.
11438
11439 2011-06-21 Leo Liu <sdl.web@gmail.com>
11440
11441 * deps.mk (fns.o):
11442 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11443 sha512.h.
11444
11445 * fns.c (secure_hash): Rename from crypto_hash_function and change
11446 the first arg to accept symbols.
11447 (Fsecure_hash): New primitive.
11448 (syms_of_fns): New symbols.
11449
11450 2011-06-20 Deniz Dogan <deniz@dogan.se>
11451
11452 * process.c (Fset_process_buffer): Clarify return value in
11453 docstring.
11454
11455 2011-06-18 Chong Yidong <cyd@stupidchicken.com>
11456
11457 * dispnew.c (add_window_display_history): Use BVAR.
11458
11459 * xdisp.c (debug_method_add): Use BVAR.
11460 (check_window_end, dump_glyph_matrix, dump_glyph)
11461 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11462
11463 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11464 Likewise.
11465
11466 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11467 check till after the cache is created in init_frame_faces.
11468
11469 2011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11470
11471 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11472
11473 2011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11474
11475 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11476 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11477 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11478
11479 Improve buffer-overflow checking (Bug#8873).
11480 * fileio.c (Finsert_file_contents):
11481 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11482 Remove the old (too-loose) buffer overflow checks.
11483 They weren't needed, since make_gap checks for buffer overflow.
11484 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11485 The old code merely checked for Emacs fixnum overflow, and relied
11486 on undefined (wraparound) behavior. The new code avoids undefined
11487 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11488
11489 * editfns.c (Finsert_char): Don't dump core with very negative counts.
11490 Tune. Don't use wider integers than needed. Don't use alloca.
11491 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
11492
11493 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11494
11495 * insdel.c, lisp.h (buffer_overflow): New function.
11496 (insert_from_buffer_1, replace_range, replace_range_2):
11497 * insdel.c (make_gap_larger):
11498 * editfns.c (Finsert_char):
11499 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11500
11501 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11502
11503 2011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11504
11505 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
11506
11507 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11508 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11509
11510 * fileio.c: Don't assume EMACS_INT fits in off_t.
11511 (emacs_lseek): New static function.
11512 (Finsert_file_contents, Fwrite_region): Use it.
11513 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11514
11515 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11516
11517 * fns.c: Don't overflow int when computing a list length.
11518 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11519 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11520 truncation on 64-bit hosts. Check for QUIT every
11521 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11522 faster and is responsive enough.
11523 (Flength): Report an error instead of overflowing an integer.
11524 (Fsafe_length): Return a float if the value is not representable
11525 as a fixnum. This shouldn't happen except in contrived situations.
11526 (Fnthcdr, Fsort): Don't assume list length fits in int.
11527 (Fcopy_sequence): Don't assume vector length fits in int.
11528
11529 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11530 (header_size, word_size): New constants.
11531 (allocate_vectorlike): Don't check size overflow here.
11532 (allocate_vector): Check it here instead, since this is the only
11533 caller of allocate_vectorlike that could cause overflow.
11534 Check that the new vector's length is representable as a fixnum.
11535
11536 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11537 The previous code was bogus. For example, next_almost_prime (32)
11538 returned 39, which is undesirable as it is a multiple of 3; and
11539 next_almost_prime (24) returned 25, which is a multiple of 5 so
11540 why was the code bothering to check for multiples of 7?
11541
11542 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11543
11544 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11545
11546 Variadic C functions now count arguments with ptrdiff_t.
11547 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11548 Back then I didn't know that the Emacs coding style prefers signed int.
11549 Also, in the meantime I found a few more instances where arguments
11550 were being counted with int, which may truncate counts on 64-bit
11551 machines, or EMACS_INT, which may be unnecessarily wide.
11552 * lisp.h (struct Lisp_Subr.function.aMANY)
11553 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11554 Arg counts are now ptrdiff_t, not size_t.
11555 All variadic functions and their callers changed accordingly.
11556 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11557 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11558 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11559 * callint.c (Fcall_interactively): Check arg count for overflow,
11560 to avoid potential buffer overrun. Use signed char, not 'int',
11561 for 'varies' array, so that we needn't bother to check its size
11562 calculation for overflow.
11563 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11564 * eval.c (apply_lambda):
11565 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11566 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11567 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11568
11569 * callint.c (Fcall_interactively): Don't use index var as event count.
11570
11571 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11572 * mem-limits.h (SIZE): Remove; no longer used.
11573
11574 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
11575
11576 Remove unnecessary casts.
11577 * xterm.c (x_term_init):
11578 * xfns.c (x_set_border_pixel):
11579 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11580 These aren't needed now that we assume ANSI C.
11581
11582 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11583 It's more likely to cause problems (due to unsigned overflow)
11584 than to cure them.
11585
11586 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11587
11588 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11589
11590 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11591
11592 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11593
11594 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11595
11596 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11597
11598 GLYPH_CODE_FACE returns EMACS_INT, not int.
11599 * dispextern.h (merge_faces):
11600 * xfaces.c (merge_faces):
11601 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11602 Don't assume EMACS_INT fits in int.
11603
11604 * character.h (CHAR_VALID_P): Remove unused parameter.
11605 * fontset.c, lisp.h, xdisp.c: All uses changed.
11606
11607 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11608
11609 * fns.c (concat): Minor tuning based on overflow analysis.
11610 This doesn't fix any bugs. Use int to hold character, instead
11611 of constantly refetching from Emacs object. Use XFASTINT, not
11612 XINT, for value known to be a character. Don't bother comparing
11613 a single byte to 0400, as it's always less.
11614
11615 * floatfns.c (Fexpt):
11616 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11617
11618 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11619 for characters.
11620
11621 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11622
11623 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11624 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11625 incorrectly succeed when S was a string, because 4294967386 was
11626 truncated before it was used.
11627
11628 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11629 Otherwise, an out-of-range integer could cause undefined behavior
11630 on a 64-bit host.
11631
11632 * composite.c: Use int, not EMACS_INT, for characters.
11633 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11634 EMACS_INT, for values that are known to be in character range.
11635 This doesn't fix any bugs but is the usual style inside Emacs and
11636 may generate better code on 32-bit machines.
11637
11638 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11639 This is for reasons similar to the recent CHAR_STRING fix.
11640 * charset.c (Fencode_char): Check that character arg is actually
11641 a character. Pass an int to ENCODE_CHAR.
11642 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11643 wider than 'int', as a compile-time check to prevent future regressions
11644 in this area.
11645
11646 * character.c (char_string): Remove unnecessary casts.
11647
11648 Make sure a 64-bit char is never passed to CHAR_STRING.
11649 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11650 by silently ignoring the top 32 bits, allowing some values
11651 that were far too large to be valid characters.
11652 * character.h: Include <verify.h>.
11653 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11654 arguments are no wider than unsigned, as a compile-time check
11655 to prevent future regressions in this area.
11656 * data.c (Faset):
11657 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
11658 (Fsubst_char_in_region):
11659 * fns.c (concat):
11660 * xdisp.c (decode_mode_spec_coding):
11661 Adjust to CHAR_STRING's new requirement.
11662 * editfns.c (Finsert_char, Fsubst_char_in_region):
11663 * fns.c (concat): Check that character args are actually
11664 characters. Without this test, these functions did the wrong
11665 thing with wildly out-of-range values on 64-bit hosts.
11666
11667 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11668 These casts should not be needed on 32-bit hosts, either.
11669 * keyboard.c (read_char):
11670 * lread.c (Fload): Remove casts to unsigned.
11671
11672 * lisp.h (UNSIGNED_CMP): New macro.
11673 This fixes comparison bugs on 64-bit hosts.
11674 (ASCII_CHAR_P): Use it.
11675 * casefiddle.c (casify_object):
11676 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
11677 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11678 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11679 * dispextern.h (FACE_FROM_ID):
11680 * keyboard.c (read_char): Use UNSIGNED_CMP.
11681
11682 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11683 not to EMACS_INT, to avoid GCC warning.
11684
11685 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11686
11687 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11688 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11689 isn't needed on 32-bit machines.
11690
11691 * buffer.c (Fgenerate_new_buffer_name):
11692 Use EMACS_INT for count, not int.
11693 (advance_to_char_boundary): Return EMACS_INT, not int.
11694
11695 * data.c (Qcompiled_function): Now static.
11696
11697 * window.c (window_body_lines): Now static.
11698
11699 * image.c (gif_load): Rename local to avoid shadowing.
11700
11701 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11702 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11703 * alloc.c (make_save_value): Integer argument is now of type
11704 ptrdiff_t, not int.
11705 (mark_object): Use ptrdiff_t, not int.
11706 * lisp.h (pD): New macro.
11707 * print.c (print_object): Use it.
11708
11709 * alloc.c: Use EMACS_INT, not int, to count objects.
11710 (total_conses, total_markers, total_symbols, total_vector_size)
11711 (total_free_conses, total_free_markers, total_free_symbols)
11712 (total_free_floats, total_floats, total_free_intervals)
11713 (total_intervals, total_strings, total_free_strings):
11714 Now EMACS_INT, not int. All uses changed.
11715 (Fgarbage_collect): Compute overall total using a double, so that
11716 integer overflow is less likely to be a problem. Check for overflow
11717 when converting back to an integer.
11718 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11719 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11720 These were 'int' variables that could overflow on 64-bit hosts;
11721 they were never used, so remove them instead of repairing them.
11722 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
11723 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11724 Previously, this ceilinged at INT_MAX, but that doesn't work on
11725 64-bit machines.
11726 (allocate_pseudovector): Don't use EMACS_INT when int would do.
11727
11728 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
11729 (allocate_vectorlike): Check for ptrdiff_t overflow.
11730 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11731 when a (possibly-narrower) signed value would do just as well.
11732 We prefer using signed arithmetic, to avoid comparison confusion.
11733
11734 * alloc.c: Catch some string size overflows that we were missing.
11735 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11736 for convenience in STRING_BYTES_MAX.
11737 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11738 The definition here is exact; the one in lisp.h was approximate.
11739 (allocate_string_data): Check for string overflow. This catches
11740 some instances we weren't catching before. Also, it catches
11741 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11742 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11743 and ptrdiff_t and EMACS_INT are both 64 bits.
11744
11745 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11746 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
11747 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
11748
11749 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11750
11751 * alloc.c (Fmake_string): Check for out-of-range init.
11752
11753 2011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11754
11755 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11756
11757 2011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11758
11759 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11760 xg_get_default_scrollbar_width.
11761
11762 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11763 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11764 (style_changed_cb): Call update_theme_scrollbar_width and call
11765 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11766 all frames (Bug#8505).
11767 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11768 Call gtk_window_set_resizable if HAVE_GTK3.
11769 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11770 and height if HAVE_GTK3 (Bug#8505).
11771 (scroll_bar_width_for_theme): New variable.
11772 (update_theme_scrollbar_width): New function.
11773 (xg_get_default_scrollbar_width): Move code to
11774 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11775 (xg_initialize): Call update_theme_scrollbar_width.
11776
11777 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11778
11779 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11780
11781 2011-06-12 Martin Rudalics <rudalics@gmx.at>
11782
11783 * frame.c (make_frame): Call other_buffer_safely instead of
11784 other_buffer.
11785
11786 * window.c (temp_output_buffer_show): Call display_buffer with
11787 second argument Vtemp_buffer_show_specifiers and reset latter
11788 immediately after the call.
11789 (Vtemp_buffer_show_specifiers): New variable.
11790 (auto_window_vscroll_p, next_screen_context_lines)
11791 (Vscroll_preserve_screen_position): Remove leading asterisks from
11792 doc-strings.
11793
11794 2011-06-12 Paul Eggert <eggert@cs.ucla.edu>
11795
11796 Fix minor problems found by GCC 4.6.0 static checking.
11797 * buffer.c (Qclone_number): Remove for now, as it's unused.
11798 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11799 (record_buffer): Remove unused local.
11800 * frame.c (other_visible_frames, frame_buffer_list): Now static.
11801 (set_frame_buffer_list): Remove; unused.
11802 * frame.h (other_visible_frames): Remove decl.
11803 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11804 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11805 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11806 if HAVE_GPM.
11807 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11808 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11809 Define only if HAVE_GPM.
11810 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11811 (update_hints_inhibit): Remove; never set. All uses removed.
11812 * widgetprv.h (emacsFrameClassRec): Remove decl.
11813 * window.c (delete_deletable_window): Now returns void, since it
11814 wasn't returning anything.
11815 (compare_window_configurations): Remove unused locals.
11816 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11817 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
11818 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11819 the same widths as pointers. This follows up on the 2011-05-06 patch.
11820 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11821 * xterm.h: Likewise.
11822 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11823
11824 2011-06-12 Juanma Barranquero <lekktu@gmail.com>
11825
11826 * makefile.w32-in: Update dependencies.
11827 (LISP_H): Add lib/intprops.h.
11828
11829 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
11830
11831 * image.c (gif_load): Add animation frame delay to the metadata.
11832 (syms_of_image): Use DEFSYM. New symbol `delay'.
11833
11834 2011-06-11 Martin Rudalics <rudalics@gmx.at>
11835
11836 * window.c (delete_deletable_window): Re-add.
11837 (Fset_window_configuration): Rewrite to handle dead buffers and
11838 consequently deletable windows.
11839 (window_tree, Fwindow_tree): Remove. Supply functionality in
11840 window.el.
11841 (compare_window_configurations): Simplify code.
11842
11843 2011-06-11 Andreas Schwab <schwab@linux-m68k.org>
11844
11845 * image.c (imagemagick_load_image): Fix type mismatch.
11846 (Fimagemagick_types): Likewise.
11847
11848 * window.h (replace_buffer_in_windows): Declare.
11849
11850 2011-06-11 Martin Rudalics <rudalics@gmx.at>
11851
11852 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11853 Qclone_number. Remove external declaration of Qdelete_window.
11854 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
11855 code.
11856 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11857 Run Qbuffer_list_update_hook if allowed.
11858 (Fother_buffer): Rewrite doc-string. Major rewrite for new
11859 buffer list implementation.
11860 (other_buffer_safely): New function.
11861 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11862 calls to replace_buffer_in_windows and
11863 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
11864 if allowed.
11865 (record_buffer): Inhibit quitting and rewrite using quittable
11866 functions. Run Qbuffer_list_update_hook if allowed.
11867 (Frecord_buffer, Funrecord_buffer): New functions.
11868 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11869 Move switch-to-buffer to window.el.
11870 (bury-buffer): Move to window.el.
11871 (Vbuffer_list_update_hook): New variable.
11872
11873 * lisp.h (other_buffer_safely): Add prototype in buffer.c
11874 section.
11875
11876 * window.h (resize_frame_windows): Move up in code.
11877 (Fwindow_frame): Remove EXFUN.
11878 (replace_buffer_in_all_windows): Remove prototype.
11879 (replace_buffer_in_windows_safely): Add prototype.
11880
11881 * window.c: Declare Qdelete_window static again. Move down
11882 declaration of select_count.
11883 (Fnext_window, Fprevious_window): Rewrite doc-strings.
11884 (Fother_window): Move to window.el.
11885 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11886 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11887 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11888 window.el.
11889 (replace_buffer_in_windows): Implement by calling
11890 Qreplace_buffer_in_windows.
11891 (replace_buffer_in_all_windows): Remove with some functionality
11892 moved into replace_buffer_in_windows_safely.
11893 (replace_buffer_in_windows_safely): New function.
11894 (select_window_norecord, select_frame_norecord): Move in front
11895 of run_window_configuration_change_hook. Remove now obsolete
11896 declarations.
11897 (Fset_window_buffer): Rewrite doc-string.
11898 Call Qrecord_window_buffer.
11899 (keys_of_window): Move binding for other-window to window.el.
11900
11901 2011-06-11 Chong Yidong <cyd@stupidchicken.com>
11902
11903 * dispextern.h (struct image): Replace data member, whose int_val
11904 and ptr_val fields were not used by anything, with a single
11905 lisp_val object.
11906
11907 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
11908 (gif_clear_image, gif_load, imagemagick_load_image)
11909 (gs_clear_image, gs_load): Callers changed.
11910
11911 2011-06-10 Paul Eggert <eggert@cs.ucla.edu>
11912
11913 * buffer.h: Include <time.h>, for time_t.
11914 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
11915
11916 Fix minor problems found by static checking.
11917
11918 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
11919
11920 Make identifiers static if they are not used in other modules.
11921 * data.c (Qcompiled_function, Qframe, Qvector):
11922 * image.c (QimageMagick, Qsvg):
11923 * minibuf.c (Qmetadata):
11924 * window.c (resize_window_check, resize_root_window): Now static.
11925 * window.h (resize_window_check, resize_root_window): Remove decls.
11926
11927 * window.c (window_deletion_count, delete_deletable_window):
11928 Remove; unused.
11929 (window_body_lines): Now static.
11930 (Fdelete_other_windows_internal): Mark vars as initialized.
11931 Make sure 'resize_failed' is initialized.
11932 (run_window_configuration_change_hook): Rename local to avoid shadowing.
11933 (resize_window_apply): Remove unused local.
11934 * window.h (delete_deletable_window): Remove decl.
11935
11936 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
11937 (imagemagick_load_image): Fix pointer signedness problem by changing
11938 last arg from unsigned char * to char *. All uses changed.
11939 Also, fix a local for similar reasons.
11940 Remove unused locals. Remove locals to avoid shadowing.
11941 (fn_rsvg_handle_free): Remove; unused.
11942 (svg_load, svg_load_image): Fix pointer signedness problem.
11943 (imagemagick_load_image): Don't use garbage pointer image_wand.
11944
11945 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
11946
11947 2011-06-10 Chong Yidong <cyd@stupidchicken.com>
11948
11949 * image.c (gif_load): Fix omitted cast error introduced by
11950 2011-06-06 change.
11951
11952 2011-06-10 Martin Rudalics <rudalics@gmx.at>
11953
11954 * window.h (resize_proportionally, orig_total_lines)
11955 (orig_top_line): Remove from window structure.
11956 (set_window_height, set_window_width, change_window_heights)
11957 (Fdelete_window): Remove prototypes.
11958 (resize_frame_windows): Remove duplicate declaration.
11959
11960 2011-06-10 Eli Zaretskii <eliz@gnu.org>
11961
11962 * window.h (resize_frame_windows, resize_window_check)
11963 (delete_deletable_window, resize_root_window)
11964 (resize_frame_windows): Declare prototypes.
11965
11966 * window.c (resize_window_apply): Make definition be "static" to
11967 match the prototype.
11968
11969 2011-06-10 Martin Rudalics <rudalics@gmx.at>
11970
11971 * window.c: Remove declarations of Qwindow_size_fixed,
11972 window_min_size_1, window_min_size_2, window_min_size,
11973 size_window, window_fixed_size_p, enlarge_window, delete_window.
11974 Remove static from declaration of Qdelete_window, it's
11975 temporarily needed by Fbury_buffer.
11976 (replace_window): Don't assign orig_top_line and
11977 orig_total_lines.
11978 (Fdelete_window, delete_window): Remove. Window deletion is
11979 handled by window.el.
11980 (window_loop): Remove DELETE_OTHER_WINDOWS case.
11981 Replace Fdelete_window calls with calls to Qdelete_window.
11982 (Fdelete_other_windows): Remove. Deleting other windows is
11983 handled by window.el.
11984 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
11985 handled in window.el.
11986 (window_min_size_2, window_min_size_1, window_min_size): Remove.
11987 Window minimum sizes are handled in window.el.
11988 (shrink_windows, size_window, set_window_height)
11989 (set_window_width, change_window_heights, window_height)
11990 (window_width, CURBEG, CURSIZE, enlarge_window)
11991 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
11992 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
11993 handled in window.el.
11994 (make_dummy_parent): Rename to make_parent_window and give it a
11995 second argument horflag.
11996 (make_window): Don't set resize_proportionally any more.
11997 (Fsplit_window): Remove. Windows are split in window.el.
11998 (save_restore_action, save_restore_orig_size)
11999 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12000 Resize mini windows in window.el.
12001 (grow_mini_window, shrink_mini_window): Implement by calling
12002 Qresize_root_window_vertically, resize_window_check and
12003 resize_window_apply.
12004 (saved_window, Fset_window_configuration, save_window_save):
12005 Do not handle orig_top_line, orig_total_lines, and
12006 resize_proportionally.
12007 (window_min_height, window_min_width): Move to window.el.
12008 (keys_of_window): Move bindings for delete-other-windows,
12009 split-window, delete-window and enlarge-window to window.el.
12010
12011 * buffer.c: Temporarily extern Qdelete_window.
12012 (Fbury_buffer): Temporarily call Qdelete_window instead of
12013 Fdelete_window (Fbury_buffer will move to window.el soon).
12014
12015 * frame.c (set_menu_bar_lines_1): Remove code handling
12016 orig_top_line and orig_total_lines.
12017
12018 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12019 set_window_height but set heights directly.
12020 (change_frame_size_1): Use resize_frame_windows.
12021
12022 * xdisp.c (init_xdisp): Don't use set_window_height but set
12023 heights directly.
12024
12025 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12026 Use resize_frame_windows instead of change_window_heights and run
12027 run_window_configuration_change_hook.
12028
12029 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12030 instead of change_window_heights and run
12031 run_window_configuration_change_hook.
12032
12033 2011-06-09 Martin Rudalics <rudalics@gmx.at>
12034
12035 * window.c (replace_window): Rename second argument REPLACEMENT to
12036 NEW. New third argument SETFLAG. Rewrite.
12037 (delete_window, make_dummy_parent): Call replace_window with
12038 third argument 1.
12039 (window_list_1): Move down in code.
12040 (run_window_configuration_change_hook): Move set_buffer part
12041 before select_frame_norecord part in order to unwind correctly.
12042 Rename count1 to count.
12043 (recombine_windows, delete_deletable_window, resize_root_window)
12044 (Fdelete_other_windows_internal)
12045 (Frun_window_configuration_change_hook, make_parent_window)
12046 (resize_window_check, resize_window_apply, Fresize_window_apply)
12047 (resize_frame_windows, Fsplit_window_internal)
12048 (Fdelete_window_internal, Fresize_mini_window_internal):
12049 New functions.
12050 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12051
12052 2011-06-08 Martin Rudalics <rudalics@gmx.at>
12053
12054 * window.h (window): Add some new members to window structure -
12055 normal_lines, normal_cols, new_total, new_normal, clone_number,
12056 splits, nest, prev_buffers, next_buffers.
12057 (WINDOW_TOTAL_SIZE): Move here from window.c.
12058 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
12059
12060 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12061 Remove.
12062 (make_dummy_parent): Set new members of windows structure.
12063 (make_window): Move down in code. Handle new members of window
12064 structure.
12065 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12066 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12067 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12068 (Fset_window_prev_buffers, Fwindow_next_buffers)
12069 (Fset_window_next_buffers, Fset_window_clone_number):
12070 New functions.
12071 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12072 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12073 Doc-string fixes.
12074 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12075 Argument WINDOW can be now internal window too.
12076 (Fwindow_use_time): Move up in code.
12077 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12078 Rewrite doc-string.
12079 (Fset_window_configuration, saved_window)
12080 (Fcurrent_window_configuration, save_window_save): Handle new
12081 members of window structure.
12082 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12083 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12084 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12085 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12086 Qget_mru_window, Qresize_root_window,
12087 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12088 Qauto_buffer_name; staticpro them.
12089
12090 2011-06-07 Martin Rudalics <rudalics@gmx.at>
12091
12092 * window.c (Fwindow_total_size, Fwindow_left_column)
12093 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12094 (Fwindow_list_1): New functions.
12095 (window_box_text_cols): Replace with window_body_cols.
12096 (Fwindow_width, Fscroll_left, Fscroll_right):
12097 Use window_body_cols instead of window_box_text_cols.
12098 (delete_window, Fset_window_configuration):
12099 Call delete_all_subwindows with window as argument.
12100 (delete_all_subwindows): Take a window as argument and not a
12101 structure. Rewrite.
12102 (window_loop): Remove handling of GET_LRU_WINDOW and
12103 GET_LARGEST_WINDOW.
12104 (Fget_lru_window, Fget_largest_window): Move to window.el.
12105
12106 * window.h: Extern window_body_cols instead of
12107 window_box_text_cols. delete_all_subwindows now takes a
12108 Lisp_Object as argument.
12109
12110 * indent.c (compute_motion, Fcompute_motion):
12111 Use window_body_cols instead of window_box_text_cols.
12112
12113 * frame.c (delete_frame): Call delete_all_subwindows with root
12114 window as argument.
12115
12116 2011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12117
12118 * fns.c (Fputhash): Document return value.
12119
12120 2011-06-06 Chong Yidong <cyd@stupidchicken.com>
12121
12122 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12123
12124 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12125
12126 Cons<->int and similar integer overflow fixes (Bug#8794).
12127
12128 Check for overflow when converting integer to cons and back.
12129 * charset.c (Fdefine_charset_internal, Fdecode_char):
12130 Use cons_to_unsigned to catch overflow.
12131 (Fencode_char): Use INTEGER_TO_CONS.
12132 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12133 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12134 * data.c (long_to_cons, cons_to_long): Remove.
12135 (cons_to_unsigned, cons_to_signed): New functions.
12136 These signal an error for invalid or out-of-range values.
12137 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12138 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12139 * font.c (Ffont_variation_glyphs):
12140 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12141 * lisp.h: Include <intprops.h>.
12142 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12143 (cons_to_signed, cons_to_unsigned): New decls.
12144 (long_to_cons, cons_to_long): Remove decls.
12145 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12146 (Fprimitive_undo): Use CONS_TO_INTEGER.
12147 * xfns.c (Fx_window_property): Likewise.
12148 * xselect.c: Include <limits.h>.
12149 (x_own_selection, selection_data_to_lisp_data):
12150 Use INTEGER_TO_CONS.
12151 (x_handle_selection_request, x_handle_selection_clear)
12152 (x_get_foreign_selection, Fx_disown_selection_internal)
12153 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12154 (lisp_data_to_selection_data): Use cons_to_unsigned.
12155 (x_fill_property_data): Use cons_to_signed.
12156 Report values out of range.
12157
12158 Check for buffer and string overflow more precisely.
12159 * buffer.h (BUF_BYTES_MAX): New macro.
12160 * lisp.h (STRING_BYTES_MAX): New macro.
12161 * alloc.c (Fmake_string):
12162 * character.c (string_escape_byte8):
12163 * coding.c (coding_alloc_by_realloc):
12164 * doprnt.c (doprnt):
12165 * editfns.c (Fformat):
12166 * eval.c (verror):
12167 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12168 since they may not be the same number.
12169 * editfns.c (Finsert_char):
12170 * fileio.c (Finsert_file_contents):
12171 Likewise for BUF_BYTES_MAX.
12172
12173 * image.c: Use ptrdiff_t, not int, for sizes.
12174 (slurp_file): Switch from int to ptrdiff_t.
12175 All uses changed.
12176 (slurp_file): Check that file size fits in both size_t (for
12177 malloc) and ptrdiff_t (for sanity and safety).
12178
12179 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12180 if b->modtime has its maximal value.
12181
12182 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12183
12184 Don't assume time_t can fit into int.
12185 * buffer.h (struct buffer.modtime): Now time_t, not int.
12186 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12187 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12188
12189 Minor fixes for signed vs unsigned integers.
12190 * character.h (MAYBE_UNIFY_CHAR):
12191 * charset.c (maybe_unify_char):
12192 * keyboard.c (read_char, reorder_modifiers):
12193 XINT -> XFASTINT, since the integer must be nonnegative.
12194 * ftfont.c (ftfont_spec_pattern):
12195 * keymap.c (access_keymap, silly_event_symbol_error):
12196 XUINT -> XFASTINT, since the integer must be nonnegative.
12197 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12198 since it makes no difference and we prefer signed.
12199 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12200 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12201 nonnegative.
12202
12203 2011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12204
12205 * window.h (Fwindow_frame): Declare.
12206
12207 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12208
12209 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12210 (SPARE_MEMORY): Always define.
12211 (LARGE_REQUEST): Remove.
12212 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12213
12214 2011-06-06 Martin Rudalics <rudalics@gmx.at>
12215
12216 * lisp.h: Move EXFUNS for Fframe_root_window,
12217 Fframe_first_window and Fset_frame_selected_window to window.h.
12218
12219 * window.h: Move EXFUNS for Fframe_root_window,
12220 Fframe_first_window and Fset_frame_selected_window here from
12221 lisp.h.
12222
12223 * frame.c (Fwindow_frame, Fframe_first_window)
12224 (Fframe_root_window, Fframe_selected_window)
12225 (Fset_frame_selected_window): Move to window.c.
12226 (Factive_minibuffer_window): Move to minibuf.c.
12227 (Fother_visible_frames_p): New function.
12228
12229 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12230
12231 * window.c (decode_window, decode_any_window): Move up in code.
12232 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12233 (inhibit_frame_unsplittable): Remove unused variable.
12234 (Fwindow_buffer): Move up and rewrite doc-string.
12235 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12236 (Fwindow_prev): New functions.
12237 (Fwindow_frame): Move here from frame.c. Accept any window as
12238 argument.
12239 (Fframe_root_window, Fframe_first_window)
12240 (Fframe_selected_window): Move here from frame.c. Accept frame
12241 or arbitrary window as argument. Update doc-strings.
12242 (Fminibuffer_window): Move up in code.
12243 (Fwindow_minibuffer_p): Move up in code and simplify.
12244 (Fset_frame_selected_window): Move here from frame.c.
12245 Marginal rewrite.
12246 (Fselected_window, select_window, Fselect_window): Move up in
12247 code. Minor doc-string fixes.
12248
12249 2011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12250
12251 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12252 Do not assume that spare memory exists; that assumption is valid
12253 only if SYSTEM_MALLOC.
12254 (LARGE_REQUEST): New macro, so that the issue of large requests
12255 is separated from the issue of spare memory.
12256
12257 2011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12258
12259 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12260 format. (Bug#8806)
12261
12262 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12263
12264 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12265 before statements.
12266
12267 2011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12268
12269 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12270
12271 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12272
12273 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12274 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12275
12276 2011-06-05 Juanma Barranquero <lekktu@gmail.com>
12277
12278 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12279
12280 2011-06-04 Chong Yidong <cyd@stupidchicken.com>
12281
12282 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12283 (x_clipboard_manager_save): Add return value.
12284 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12285 New error handlers.
12286 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12287 Obey Vx_select_enable_clipboard_manager. Catch errors in
12288 x_clipboard_manager_save (Bug#8779).
12289 (Vx_select_enable_clipboard_manager): New variable.
12290 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
12291
12292 2011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
12293
12294 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12295
12296 2011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12297
12298 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12299 in the current matrix if keep_current_p is non-zero.
12300
12301 2011-06-04 Eli Zaretskii <eliz@gnu.org>
12302
12303 * bidi.c (bidi_level_of_next_char): Fix last change.
12304
12305 2011-06-03 Eli Zaretskii <eliz@gnu.org>
12306
12307 Support bidi reordering of text covered by display properties.
12308
12309 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12310 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12311 (bidi_cache_search, bidi_cache_iterator_state)
12312 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
12313 (bidi_level_of_next_char, bidi_move_to_visually_next):
12314 Support character positions inside a run of characters covered by a
12315 display string.
12316 (bidi_paragraph_init, bidi_resolve_explicit_1)
12317 (bidi_level_of_next_char): Call bidi_fetch_char and
12318 bidi_fetch_char_advance instead of FETCH_CHAR and
12319 FETCH_CHAR_ADVANCE.
12320 (bidi_init_it): Initialize new members.
12321 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12322 definitions.
12323 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12324 instead of using explicit *_CHAR codes.
12325 (bidi_resolve_explicit, bidi_resolve_weak):
12326 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
12327 bidirectional text is supported only in multibyte buffers.
12328 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12329 it to initialize the frame_window_p member of struct bidi_it.
12330 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12331 (bidi_resolve_explicit, bidi_resolve_weak)
12332 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12333 bidi_it->nchars is non-positive.
12334 (bidi_level_of_next_char): Don't try to lookup the cache for the
12335 next/previous character if nothing is cached there yet, or if we
12336 were just reseat()'ed to a new position.
12337
12338 * xdisp.c (set_cursor_from_row): Set start and stop points
12339 according to the row's direction when priming the loop that looks
12340 for the glyph on which to display cursor.
12341 (single_display_spec_intangible_p): Function deleted.
12342 (display_prop_intangible_p): Reimplement to call
12343 handle_display_spec instead of single_display_spec_intangible_p.
12344 Accept 3 additional arguments needed by handle_display_spec.
12345 This fixes incorrect cursor motion across display property with complex
12346 values: lists, `(when COND...)' forms, etc.
12347 (single_display_spec_string_p): Support property values that are
12348 lists with the argument STRING its top-level element.
12349 (display_prop_string_p): Fix the condition for processing a
12350 property that is a list to be consistent with handle_display_spec.
12351 (handle_display_spec): New function, refactored from the
12352 last portion of handle_display_prop.
12353 (compute_display_string_pos): Accept additional argument
12354 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12355 value of a `display' property is a "replacing spec".
12356 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12357 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12358 the display property, but just return a value indicating whether
12359 the display property will replace the characters it covers.
12360 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12361 frame_window_p members of struct bidi_it.
12362 (compute_display_string_pos, compute_display_string_end):
12363 New functions.
12364 (push_it): Accept second argument POSITION, where pop_it should
12365 jump to continue iteration.
12366 (reseat_1): Initialize bidi_it.disp_pos.
12367
12368 * keyboard.c (adjust_point_for_property): Adjust the call to
12369 display_prop_intangible_p to its new signature.
12370
12371 * dispextern.h (struct bidi_it): New member frame_window_p.
12372 (bidi_init_it): Update prototypes.
12373 (display_prop_intangible_p): Update prototype.
12374 (compute_display_string_pos, compute_display_string_end):
12375 Declare prototypes.
12376 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12377 EMACS_INT.
12378
12379 2011-06-02 Paul Eggert <eggert@cs.ucla.edu>
12380
12381 Malloc failure behavior now depends on size of allocation.
12382 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12383 * lisp.h: Change signatures accordingly.
12384 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12385 All callers changed. (Bug#8762)
12386
12387 * gnutls.c: Use Emacs's memory allocators.
12388 Without this change, the gnutls library would invoke malloc etc.
12389 directly, which causes problems on non-SYNC_INPUT hosts, and which
12390 runs afoul of improving memory_full behavior. (Bug#8761)
12391 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12392 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12393 xfree instead of the default malloc, realloc, free.
12394 (Fgnutls_boot): No need to check for memory allocation failure,
12395 since xmalloc does that for us.
12396
12397 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
12398 * category.c (hash_get_category_set):
12399 * ccl.c (ccl_driver):
12400 * charset.c (Fdefine_charset_internal):
12401 * charset.h (struct charset.hash_index):
12402 * composite.c (get_composition_id, gstring_lookup_cache)
12403 (composition_gstring_put_cache):
12404 * composite.h (struct composition.hash_index):
12405 * dispextern.h (struct image.hash):
12406 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12407 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12408 (hashfn_equal, hashfn_user_defined, make_hash_table)
12409 (maybe_resize_hash_table, hash_lookup, hash_put)
12410 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12411 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12412 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12413 * image.c (make_image, search_image_cache, lookup_image)
12414 (xpm_put_color_table_h):
12415 * lisp.h (struct Lisp_Hash_Table):
12416 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
12417 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
12418 for hashes and hash indexes, instead of 'unsigned' and 'int'.
12419 * alloc.c (allocate_vectorlike):
12420 Check for overflow in vector size calculations.
12421 * ccl.c (ccl_driver):
12422 Check for overflow when converting EMACS_INT to int.
12423 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12424 need to be updated by these changes.
12425 * fns.c (make_hash_table, maybe_resize_hash_table):
12426 Check for integer overflow with large hash tables.
12427 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12428 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12429 (SXHASH_REDUCE): New macro.
12430 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12431 Use it instead of discarding useful hash info with large hash values.
12432 (sxhash_float): New function.
12433 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12434 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
12435 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12436 Rewrite to use FIXNUM_BITS, as this simplifies things.
12437 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12438 Adjust signatures to match updated version of code.
12439 (consing_since_gc): Now EMACS_INT, since a single hash table can
12440 use more than INT_MAX bytes.
12441
12442 2011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12443
12444 Make it possible to build with GCC-4.6+ -O2 -flto.
12445
12446 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12447
12448 2011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12449
12450 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12451 Call minibuffer-inactive-mode.
12452
12453 2011-05-31 Juanma Barranquero <lekktu@gmail.com>
12454
12455 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12456 Update dependencies.
12457
12458 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12459
12460 * data.c (init_data): Remove code for UTS, this system is not
12461 supported anymore.
12462
12463 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12464
12465 Don't force ./temacs to start in terminal mode.
12466
12467 * frame.c (make_initial_frame): Initialize faces in all cases, not
12468 only when CANNOT_DUMP is defined.
12469 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12470
12471 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12472
12473 * dispnew.c (add_window_display_history): Use const for the string
12474 pointer. Remove declaration, not needed.
12475
12476 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12477
12478 Use 'inline', not 'INLINE'.
12479 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
12480 * alloc.c, fontset.c (INLINE): Remove.
12481 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12482 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12483 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12484 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12485 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12486
12487 2011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12488
12489 Make it possible to run ./temacs.
12490
12491 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12492 syms_of_callproc does the same thing. Remove test for
12493 "initialized", do it in the caller.
12494 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12495
12496 2011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12497
12498 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12499 (read_minibuf): Use get_minibuffer.
12500 (syms_of_minibuf): Use DEFSYM.
12501 (Qmetadata): New var.
12502 * data.c (Qbuffer): Don't make it static.
12503 (syms_of_data): Use DEFSYM.
12504
12505 2011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12506
12507 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12508 (CCL_CODE_MIN): New macro.
12509
12510 2011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12511
12512 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12513
12514 * eval.c (Qdebug): Now static.
12515 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12516 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12517 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12518
12519 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12520
12521 * image.c: Various fixes to ImageMagick code comments.
12522 (Fimagemagick_types): Doc fix.
12523
12524 2011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12525
12526 Minor fixes prompted by GCC 4.6.0 warnings.
12527
12528 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12529
12530 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12531 (x_clipboard_manager_save_all): Move extern decl to ...
12532 * xterm.h: ... here, so that it can be checked for consistency.
12533
12534 2011-05-29 Chong Yidong <cyd@stupidchicken.com>
12535
12536 * xselect.c (x_clipboard_manager_save_frame)
12537 (x_clipboard_manager_save_all): New functions.
12538 (Fx_clipboard_manager_save): Lisp function deleted.
12539
12540 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12541 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12542
12543 * xterm.h: Update prototype.
12544
12545 2011-05-28 William Xu <william.xwl@gmail.com>
12546
12547 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12548 exiting (Bug#8239).
12549
12550 2011-05-28 Jim Meyering <meyering@redhat.com>
12551
12552 Avoid a sign-extension bug in crypto_hash_function.
12553 * fns.c (to_uchar): Define.
12554 (crypto_hash_function): Use it to convert some newly-signed
12555 variables to unsigned, to avoid sign-extension bugs. For example,
12556 without this change, (md5 "truc") would evaluate to
12557 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12558 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
12559 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
12560
12561 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12562
12563 Integer overflow fixes.
12564
12565 * dbusbind.c: Serial number integer overflow fixes.
12566 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
12567 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12568 to hold a serial number that is too large for a fixnum.
12569 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12570 Check for serial numbers out of range. Decode any serial number
12571 that was so large that it became a float. (Bug#8722)
12572
12573 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12574 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12575 Use XFASTINT rather than XUINT when numbers are nonnegative.
12576 (xd_append_arg, Fdbus_method_return_internal):
12577 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12578 arguments, check that Lisp number is nonnegative, rather than
12579 silently wrapping negative numbers around. (Bug#8722)
12580 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
12581 (Bug#8722)
12582
12583 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12584
12585 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12586
12587 ccl: Add integer overflow checks.
12588 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12589 (IN_INT_RANGE): New macros.
12590 (ccl_driver): Use them to check for integer overflow when
12591 decoding a CCL program. Many of the new checks are whether XINT (x)
12592 fits in int; it doesn't always, on 64-bit hosts. The new version
12593 doesn't catch all possible integer overflows, but it's an
12594 improvement. (Bug#8719)
12595
12596 * alloc.c (make_event_array): Use XINT, not XUINT.
12597 There's no need for unsigned here.
12598
12599 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12600 This follows up to the 2011-05-06 change that substituted uintptr_t
12601 for EMACS_INT. This case wasn't caught back then.
12602
12603 Rework Fformat to avoid integer overflow issues.
12604 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12605 now (part of C89). Include <verify.h>.
12606 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12607 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12608 (Fformat): Avoid the prepass trying to compute sizes; it was only
12609 approximate and thus did not catch overflow reliably. Instead, walk
12610 through the format just once, formatting and computing sizes as we go,
12611 checking for integer overflow at every step, and allocating a larger
12612 buffer as needed. Keep track separately whether the format is
12613 multibyte. Keep only the most-recently calculated precision, rather
12614 than them all. Record whether each argument has been converted to
12615 string. Use EMACS_INT, not int, for byte and char and arg counts.
12616 Support field widths and precisions larger than INT_MAX. Avoid
12617 sprintf's undefined behavior with conversion specifications such as %#d
12618 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12619 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12620 formatting out-of-range floating point numbers with int
12621 formats. (Bug#8668)
12622
12623 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12624
12625 * data.c: Avoid integer truncation in expressions involving floats.
12626 * data.c: Include <intprops.h>.
12627 (arith_driver): When there's an integer overflow in an expression
12628 involving floating point, convert the integers to floating point
12629 so that the resulting value does not suffer from catastrophic
12630 integer truncation. For example, on a 64-bit host (* 4
12631 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12632 Do not rely on undefined behavior after integer overflow.
12633
12634 merge count_size_as_multibyte, parse_str_to_multibyte
12635 * character.c, character.h (count_size_as_multibyte):
12636 Rename from parse_str_to_multibyte; all uses changed.
12637 Check for integer overflow.
12638 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12639 since it's now a duplicate of the other. This is more of
12640 a character than a buffer op, so better that it's in character.c.
12641 * fns.c, print.c: Adjust to above changes.
12642
12643 2011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12644
12645 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12646
12647 2011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12648
12649 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12650 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12651 (x_clipboard_manager_save): Now static.
12652 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12653
12654 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12655 (crypto_hash_function): Now static.
12656 Fix pointer signedness problems. Avoid unnecessary initializations.
12657
12658 2011-05-27 Chong Yidong <cyd@stupidchicken.com>
12659
12660 * termhooks.h (Vselection_alist): Make it terminal-local.
12661
12662 * terminal.c (create_terminal): Initialize it.
12663
12664 * xselect.c: Support for clipboard managers.
12665 (Vselection_alist): Move to termhooks.h as terminal-local var.
12666 (LOCAL_SELECTION): New macro.
12667 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12668 (symbol_to_x_atom): Remove gratuitous arg.
12669 (x_handle_selection_request, lisp_data_to_selection_data)
12670 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
12671 (x_own_selection, x_get_local_selection, x_convert_selection):
12672 New arg, specifying work frame. Use terminal-local Vselection_alist.
12673 (some_frame_on_display): Delete unused function.
12674 (Fx_own_selection_internal, Fx_get_selection_internal)
12675 (Fx_disown_selection_internal, Fx_selection_owner_p)
12676 (Fx_selection_exists_p): New optional frame arg.
12677 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12678 (x_handle_selection_clear): Don't treat other terminals with the
12679 same keyboard specially. Use the terminal-local Vselection_alist.
12680 (x_clear_frame_selections): Use Frun_hook_with_args.
12681
12682 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12683
12684 * xterm.h: Add support for those atoms.
12685
12686 2011-05-26 Chong Yidong <cyd@stupidchicken.com>
12687
12688 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12689 (converted_selections, conversion_fail_tag): New global variables.
12690 (x_selection_request_lisp_error): Free the above.
12691 (x_get_local_selection): Remove unnecessary code.
12692 (x_reply_selection_request): Args changed; handle arbitrary array
12693 of converted selections stored in converted_selections.
12694 Separate the XChangeProperty and SelectionNotify steps.
12695 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12696 (x_convert_selection): New function.
12697 (x_handle_selection_event): Simplify.
12698 (x_get_foreign_selection): Don't ignore incoming requests while
12699 waiting for an answer; this will fail when we implement
12700 SAVE_TARGETS, and seems unnecessary anyway.
12701 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12702 (Vx_sent_selection_functions): Doc fix.
12703
12704 2011-05-26 Leo Liu <sdl.web@gmail.com>
12705
12706 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12707
12708 2011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12709
12710 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12711
12712 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12713 for fringe update if it has periodic bitmap.
12714 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
12715 and fringe_bitmap_periodic_p.
12716
12717 * fringe.c (get_fringe_bitmap_data): New function.
12718 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12719 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12720 row. Mark glyph row for fringe update if periodicity changed.
12721
12722 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12723 for fringe update unless it has periodic bitmap.
12724
12725 2011-05-25 Kenichi Handa <handa@m17n.org>
12726
12727 * xdisp.c (get_next_display_element): Set correct it->face_id for
12728 a static composition.
12729
12730 2011-05-24 Leo Liu <sdl.web@gmail.com>
12731
12732 * deps.mk (fns.o):
12733 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12734
12735 * fns.c (crypto_hash_function, Fsha1): New function.
12736 (Fmd5): Use crypto_hash_function.
12737 (syms_of_fns): Add Ssha1.
12738
12739 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12740
12741 * gnutls.c: Remove unused macros.
12742 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12743 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12744 Remove macros that are defined and never used.
12745 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12746
12747 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12748
12749 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12750 (Fx_get_selection_internal): Minor cleanup.
12751 (Fx_own_selection_internal): Rename arguments for consistency with
12752 select.el.
12753
12754 2011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12755
12756 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12757
12758 2011-05-22 Chong Yidong <cyd@stupidchicken.com>
12759
12760 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12761
12762 2011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12763
12764 * dispnew.c (scrolling_window): Don't exclude the case that the
12765 last enabled row in the desired matrix touches the bottom boundary.
12766
12767 2011-05-21 Glenn Morris <rgm@gnu.org>
12768
12769 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
12770 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12771 and add some more files.
12772
12773 2011-05-20 Eli Zaretskii <eliz@gnu.org>
12774
12775 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12776 report_file_error introduced by the change from 2011-05-07.
12777
12778 2011-05-20 Paul Eggert <eggert@cs.ucla.edu>
12779
12780 * systime.h (Time): Define only if emacs is defined.
12781 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12782 where the include path doesn't have X11/X.h by default. See
12783 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12784
12785 2011-05-20 Kenichi Handa <handa@m17n.org>
12786
12787 * composite.c (find_automatic_composition): Fix previous change.
12788
12789 2011-05-20 Glenn Morris <rgm@gnu.org>
12790
12791 * lisp.mk: New file, split from Makefile.in.
12792 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12793 (shortlisp): Remove.
12794 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12795
12796 2011-05-19 Glenn Morris <rgm@gnu.org>
12797
12798 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12799 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12800 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12801 (lisp): Set the order to that of loadup.el.
12802 (shortlisp): Make it a copy of $lisp.
12803 (SOME_MACHINE_LISP): Remove.
12804 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12805 Use just $shortlisp, not $SOME_MACHINE_LISP too.
12806
12807 2011-05-18 Kenichi Handa <handa@m17n.org>
12808
12809 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12810 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12811 (find_automatic_composition): Mostly rewrite for efficiency.
12812
12813 2011-05-18 Juanma Barranquero <lekktu@gmail.com>
12814
12815 * makefile.w32-in: Update dependencies.
12816
12817 2011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
12818
12819 * menu.c: Include limits.h (fixes the MS-Windows build broken by
12820 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
12821
12822 2011-05-18 Paul Eggert <eggert@cs.ucla.edu>
12823
12824 Fix some integer overflow issues, such as string length overflow.
12825
12826 * insdel.c (count_size_as_multibyte): Check for string overflow.
12827
12828 * character.c (lisp_string_width): Check for string overflow.
12829 Use EMACS_INT, not int, for string indexes and lengths; in
12830 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
12831 the resulting string length overflows an EMACS_INT; instead,
12832 report a string overflow if no precision given. When checking for
12833 precision exhaustion, use a check that cannot possibly have
12834 integer overflow. (Bug#8675)
12835 * character.h (lisp_string_width): Adjust to new signature.
12836
12837 * alloc.c (string_overflow): New function.
12838 (Fmake_string): Use it. This doesn't change behavior, but saves
12839 a few bytes and will simplify future changes.
12840 * character.c (string_escape_byte8): Likewise.
12841 * lisp.h (string_overflow): New decl.
12842
12843 Fixups, following up to the user-interface timestamp change.
12844 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12845 for UI timestamps, instead of unsigned long.
12846 * msdos.c (mouse_get_pos): Likewise.
12847 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
12848 * w32gui.h (Time): Define by including "systime.h" rather than by
12849 declaring it ourselves. (Bug#8664)
12850
12851 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12852 * image.c (clear_image_cache): Likewise.
12853
12854 * term.c (term_mouse_position): Don't assume time_t wraparound.
12855
12856 Be more systematic about user-interface timestamps.
12857 Before, the code sometimes used 'Time', sometimes 'unsigned long',
12858 and sometimes 'EMACS_UINT', to represent these timestamps.
12859 This change causes it to use 'Time' uniformly, as that's what X uses.
12860 This makes the code easier to follow, and makes it easier to catch
12861 integer overflow bugs such as Bug#8664.
12862 * frame.c (Fmouse_position, Fmouse_pixel_position):
12863 Use Time, not unsigned long, for user-interface timestamps.
12864 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12865 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12866 * keyboard.h (last_event_timestamp): Likewise.
12867 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12868 * menu.h (xmenu_show): Likewise.
12869 * term.c (term_mouse_position): Likewise.
12870 * termhooks.h (struct input_event.timestamp): Likewise.
12871 (struct terminal.mouse_position_hook): Likewise.
12872 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12873 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12874 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
12875 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12876 what it was before.
12877 * menu.h, termhooks.h: Include "systime.h", for Time.
12878
12879 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12880 Don't assume that the difference between two unsigned long values
12881 can fit into an integer. At this point, we know button_down_time
12882 <= event->timestamp, so the difference must be nonnegative, so
12883 there's no need to cast the result if double-click-time is
12884 nonnegative, as it should be; check that it's nonnegative, just in
12885 case. This bug is triggered when events are more than 2**31 ms
12886 apart (about 25 days). (Bug#8664)
12887
12888 * xselect.c (last_event_timestamp): Remove duplicate decl.
12889 (x_own_selection): Remove needless cast to unsigned long.
12890
12891 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
12892 that always fit in int. Use a sentinel instead of a counter, to
12893 avoid a temp and to allay GCC's concerns about possible int overflow.
12894 * frame.h (struct frame): Use int for menu_bar_items_used
12895 instead of EMACS_INT, since it always fits in int.
12896
12897 * menu.c (grow_menu_items): Check for int overflow.
12898
12899 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
12900
12901 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
12902 Before, the code was not consistent. These values cannot exceed
12903 2**31 - 1 so there's no need to make them unsigned.
12904 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
12905 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
12906 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
12907 as modifiers.
12908 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
12909
12910 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
12911 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
12912 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
12913 presumably because the widths might not match.
12914
12915 * window.c (size_window): Avoid needless test at loop start.
12916
12917 2011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
12918
12919 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
12920
12921 2011-05-12 Drew Adams <drew.adams@oracle.com>
12922
12923 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
12924
12925 2011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12926
12927 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
12928 `width' to `bar_area_x' and `bar_area_width', respectively.
12929 (x_scroll_run): Take account of fringe background extension.
12930
12931 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
12932 Rename local vars `left' and `width' to `bar_area_x' and
12933 `bar_area_width', respectively.
12934 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
12935 background extension.
12936
12937 2011-05-10 Jim Meyering <meyering@redhat.com>
12938
12939 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
12940
12941 2011-05-10 Juanma Barranquero <lekktu@gmail.com>
12942
12943 * image.c (Finit_image_library): Return t for built-in image types,
12944 like pbm and xbm. (Bug#8640)
12945
12946 2011-05-09 Andreas Schwab <schwab@linux-m68k.org>
12947
12948 * w32menu.c (set_frame_menubar): Fix submenu allocation.
12949
12950 2011-05-07 Eli Zaretskii <eliz@gnu.org>
12951
12952 * w32console.c (Fset_screen_color): Doc fix.
12953 (Fget_screen_color): New function.
12954 (syms_of_ntterm): Defsubr it.
12955
12956 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
12957 unlink the temporary file if Fcall_process didn't create it in the
12958 first place.
12959 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
12960 child process will be redirected to a file specified with `:file'.
12961 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
12962 cue to call_process_cleanup not to close that handle.
12963
12964 2011-05-07 Ben Key <bkey76@gmail.com>
12965
12966 * makefile.w32-in: The bootstrap-temacs rule now makes use of
12967 one of two shell specific rules, either bootstrap-temacs-CMD or
12968 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
12969 to the previous implementation of the bootstrap-temacs rule.
12970 The bootstrap-temacs-CMD rule is similar to the previous
12971 implementation of the bootstrap-temacs rule except that it
12972 makes use of the ESC_CFLAGS variable instead of the CFLAGS
12973 variable.
12974
12975 These changes, along with some changes to nt/configure.bat,
12976 nt/gmake.defs, and nt/nmake.defs, are required to extend my
12977 earlier fix to add support for --cflags and --ldflags options
12978 that include quotes so that it works whether make uses cmd or
12979 sh as the shell.
12980
12981 2011-05-06 Michael Albinus <michael.albinus@gmx.de>
12982
12983 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
12984 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
12985 is a constant.
12986 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
12987 a string. Handle both cases.
12988 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
12989 (Fdbus_register_method): Use Qinvalid_function.
12990
12991 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
12992
12993 * makefile.w32-in: Update dependencies.
12994 (LISP_H): Add inttypes.h and stdin.h.
12995 (PROCESS_H): Add unistd.h.
12996
12997 2011-05-06 Eli Zaretskii <eliz@gnu.org>
12998
12999 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13000 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13001
13002 2011-05-06 Paul Eggert <eggert@cs.ucla.edu>
13003
13004 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13005
13006 * term.c (vfatal): Remove stray call to va_end.
13007 It's not needed and the C Standard doesn't allow it here anyway.
13008
13009 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13010 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13011
13012 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13013 bytes.
13014
13015 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13016
13017 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13018
13019 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13020
13021 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13022
13023 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13024
13025 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13026 * charset.c (Fdefine_charset_internal): Don't initialize
13027 charset.code_space[15]. The value was garbage, on hosts with
13028 32-bit int (Bug#8600).
13029
13030 * lread.c (read_integer): Be more consistent with string-to-number.
13031 Use string_to_number to do the actual conversion; this avoids
13032 rounding errors and fixes some other screwups. Without this fix,
13033 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13034 (digit_to_number): Move earlier, for benefit of read_integer.
13035 Return -1 if the digit is out of range for the base, -2 if it is
13036 not a digit in any supported base. (Bug#8602)
13037
13038 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13039
13040 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13041 to match comment at start of function. This also removes a
13042 GCC warning about overflow in a 32+64-bit port.
13043
13044 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13045
13046 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13047 Reported by Stefan Monnier in
13048 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
13049 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13050 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
13051
13052 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13053 (EMACS_UINTPTR): Likewise, with uintptr_t.
13054
13055 * lisp.h: Prefer 64-bit EMACS_INT if available.
13056 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13057 on 32-bit hosts that have 64-bit int, so that they can access
13058 large files.
13059 However, temporarily disable this change unless the temporary
13060 symbol WIDE_EMACS_INT is defined.
13061
13062 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13063
13064 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13065 This removes an assumption that EMACS_INT and long are the same
13066 width as pointers. The assumption is true for Emacs porting targets
13067 now, but we want to make other targets possible.
13068 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13069 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13070 In the rest of the code, change types of integers that hold casted
13071 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13072 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13073 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13074 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13075 No need to cast type when ORing.
13076 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13077 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13078 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13079 assume EMACS_INT is the same width as char *.
13080 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13081 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13082 Remove no-longer-needed casts.
13083 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13084 (xg_tool_bar_help_callback, xg_make_tool_item):
13085 Use EMACS_INTPTR to hold an integer
13086 that will be cast to void *; this can avoid a GCC warning
13087 if EMACS_INT is not the same width as void *.
13088 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13089 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13090 (current_message_1, set_message_1):
13091 Use a local to convert to proper width without a cast.
13092 * xmenu.c (dialog_selection_callback): Likewise.
13093
13094 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13095 Also, don't assume VALBITS / RAND_BITS is less than 5,
13096 and don't rely on undefined behavior when shifting a 1 left into
13097 the sign bit.
13098 * lisp.h (get_random): Change signature to match.
13099
13100 * lread.c (hash_string): Use size_t, not int, for hash computation.
13101 Normally we prefer signed values; but hashing is special, because
13102 it's better to use unsigned division on hash table sizes so that
13103 the remainder is nonnegative. Also, size_t is the natural width
13104 for hashing into memory. The previous code used 'int', which doesn't
13105 retain enough info to hash well into very large tables.
13106 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13107
13108 * dbusbind.c: Don't possibly lose pointer info when converting.
13109 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13110 Use XPNTR rather than XHASH, so that the high-order bits of
13111 the pointer aren't lost when converting through void *.
13112
13113 * eval.c (Fautoload): Don't double-shift a pointer.
13114
13115 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13116
13117 2011-05-06 Juanma Barranquero <lekktu@gmail.com>
13118
13119 * gnutls.c (DEF_GNUTLS_FN):
13120 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13121
13122 2011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13123
13124 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13125 marker. (Bug#8610)
13126
13127 2011-05-05 Eli Zaretskii <eliz@gnu.org>
13128
13129 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13130 New version that can reserve upto 2GB of heap space.
13131
13132 2011-05-05 Chong Yidong <cyd@stupidchicken.com>
13133
13134 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13135
13136 2011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13137
13138 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13139 `gnutls_certificate_set_x509_key_file'.
13140
13141 2011-05-05 Juanma Barranquero <lekktu@gmail.com>
13142
13143 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13144 Update dependencies.
13145
13146 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13147
13148 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13149 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13150 Remove unused parameter `fildes'.
13151 * process.c (read_process_output, send_process): Don't pass it.
13152
13153 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13154
13155 Fix previous change: the library cache is defined in w32.c.
13156 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13157 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13158
13159 2011-05-04 Juanma Barranquero <lekktu@gmail.com>
13160
13161 Implement dynamic loading of GnuTLS on Windows.
13162
13163 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13164 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13165 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13166 Declare.
13167
13168 * gnutls.c (Qgnutls_dll): Define.
13169 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13170 (gnutls_*): Declare function pointers.
13171 (init_gnutls_functions): New function to initialize function pointers.
13172 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13173 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13174 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13175 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13176 (emacs_gnutls_write, emacs_gnutls_read)
13177 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13178 (Fgnutls_available_p): New function.
13179 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13180 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13181 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13182
13183 * image.c: Include w32.h.
13184 (Vimage_type_cache): Delete.
13185 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13186 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13187 (w32_delayed_load): Move to w32.c.
13188
13189 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13190
13191 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13192 (w32_delayed_load): Move from image.c. When loading a library, record
13193 its filename in the :loaded-from property of the library id.
13194 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13195 Initialize and staticpro them.
13196 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13197
13198 * process.c: Include lisp.h before w32.h, not after.
13199 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13200 instead of gnutls_record_check_pending.
13201
13202 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13203
13204 2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13205
13206 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13207 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13208 as passed in.
13209
13210 2011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13211
13212 * xterm.c (x_set_frame_alpha): Do not set property on anything
13213 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13214
13215 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13216
13217 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13218
13219 2011-05-02 Juanma Barranquero <lekktu@gmail.com>
13220
13221 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13222 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13223 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13224 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13225 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13226 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13227 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13228 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13229 (Qgnutls_bootprop_callbacks_verify): Make static.
13230
13231 2011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13232
13233 * callproc.c: Indentation fixup.
13234
13235 * sysdep.c (wait_for_termination_1): Make static.
13236 (wait_for_termination, interruptible_wait_for_termination):
13237 Move after wait_for_termination_1.
13238
13239 2011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13240
13241 * sysdep.c (interruptible_wait_for_termination): New function
13242 which is like wait_for_termination, but allows keyboard
13243 interruptions.
13244
13245 * callproc.c (Fcall_process): Add (:file "file") as an option for
13246 the STDOUT buffer.
13247 (Fcall_process_region): Ditto.
13248
13249 2011-04-30 Eli Zaretskii <eliz@gnu.org>
13250
13251 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13252 rather than `XVECTOR (FOO)->size'.
13253
13254 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13255 inttypes.h, as a gnulib replacement is used if it not available in
13256 system headers.
13257
13258 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13259
13260 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13261 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13262 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13263
13264 * coding.c (coding_alloc_by_realloc): Error out if destination
13265 will grow beyond MOST_POSITIVE_FIXNUM.
13266 (decode_coding_emacs_mule): Abort if there isn't enough place in
13267 charbuf for the composition carryover bytes. Reserve an extra
13268 space for up to 2 characters produced in a loop.
13269 (decode_coding_iso_2022): Abort if there isn't enough place in
13270 charbuf for the composition carryover bytes.
13271
13272 2011-04-21 Eli Zaretskii <eliz@gnu.org>
13273
13274 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13275 aborting when %lld or %lll format is passed.
13276 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13277 %llo or %llx format is passed. (Bug#8545)
13278
13279 * window.c (window_scroll_line_based): Use a marker instead of
13280 simple variables to record original value of point. (Bug#7952)
13281
13282 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13283 produced by %s or %c overflows available buffer space. (Bug#8545)
13284
13285 2011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13286
13287 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
13288 (SIZE_MAX): Move defn after all includes, as they might #define it.
13289
13290 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13291
13292 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13293
13294 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13295
13296 * keyboard.c (Qdelayed_warnings_hook): Define.
13297 (command_loop_1): Run `delayed-warnings-hook'
13298 if Vdelayed_warnings_list is non-nil.
13299 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13300 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13301
13302 2011-04-28 Eli Zaretskii <eliz@gnu.org>
13303
13304 * doprnt.c (doprnt): Don't return value smaller than the buffer
13305 size if the message was truncated. (Bug#8545).
13306
13307 2011-04-28 Juanma Barranquero <lekktu@gmail.com>
13308
13309 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13310 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13311
13312 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13313
13314 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13315
13316 2011-04-27 Juanma Barranquero <lekktu@gmail.com>
13317
13318 * makefile.w32-in: Update dependencies.
13319
13320 2011-04-27 Eli Zaretskii <eliz@gnu.org>
13321
13322 Improve `doprnt' and its usage. (Bug#8545)
13323 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13324 `format_end'. Remove support for %l as a conversion specifier.
13325 Don't use xrealloc. Improve diagnostics when the %l size modifier
13326 is used. Update the commentary.
13327
13328 * eval.c (verror): Simplify calculation of size_t.
13329
13330 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13331 messages.
13332
13333 2011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13334
13335 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13336 change.
13337
13338 2011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13339
13340 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13341 This makes this file independent of the recent pseudovector change.
13342
13343 2011-04-26 Paul Eggert <eggert@cs.ucla.edu>
13344
13345 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13346
13347 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
13348 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
13349 Remove unused local.
13350 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
13351
13352 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
13353 GCC 4.6.0 optimizes based on type-based alias analysis.
13354 For example, if b is of type struct buffer * and v of type struct
13355 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13356 != &v->size, and therefore "v->size = 1; b->size = 2; return
13357 v->size;" must therefore return 1. This assumption is incorrect
13358 for Emacs, since it type-puns struct Lisp_Vector * with many other
13359 types. To fix this problem, this patch adds a new type struct
13360 vectorlike_header that documents the constraints on layout of vectors
13361 and pseudovectors, and helps optimizing compilers not get fooled
13362 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13363 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
13364 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13365 the size member.
13366 (XSETPVECTYPE): Rewrite in terms of new macro.
13367 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13368 This is a bit clearer, and further avoids the possibility of
13369 undesirable aliasing.
13370 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
13371 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
13372 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13373 since Lisp_Subr is a special case (no "next" field).
13374 (ASIZE): Now uses header.size rather than size.
13375 All previous uses of XVECTOR (foo)->size replaced to use this macro,
13376 to avoid the hassle of writing XVECTOR (foo)->header.size.
13377 (struct vectorlike_header): New type.
13378 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13379 object, to help avoid aliasing.
13380 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13381 (SUBRP): Likewise, since Lisp_Subr is a special case.
13382 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13383 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13384 (struct Lisp_Hash_Table): Combine first two members into a single
13385 struct vectorlike_header member. All uses of "size" and "next" members
13386 changed to be "header.size" and "header.next".
13387 * buffer.h (struct buffer): Likewise.
13388 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13389 * frame.h (struct frame): Likewise.
13390 * process.h (struct Lisp_Process): Likewise.
13391 * termhooks.h (struct terminal): Likewise.
13392 * window.c (struct save_window_data, struct saved_window): Likewise.
13393 * window.h (struct window): Likewise.
13394 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13395 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13396 * buffer.c (init_buffer_once): Likewise.
13397 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13398 special case.
13399 * process.c (Fformat_network_address): Use local var for size,
13400 for brevity.
13401
13402 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13403
13404 Make the Lisp reader and string-to-float more consistent (Bug#8525)
13405 * data.c (atof): Remove decl; no longer used or needed.
13406 (digit_to_number): Move to lread.c.
13407 (Fstring_to_number): Use new string_to_number function, to be
13408 consistent with how the Lisp reader treats infinities and NaNs.
13409 Do not assume that floating-point numbers represent EMACS_INT
13410 without losing information; this is not true on most 64-bit hosts.
13411 Avoid double-rounding errors, by insisting on integers when
13412 parsing non-base-10 numbers, as the documentation specifies.
13413 * lisp.h (string_to_number): New decl, replacing ...
13414 (isfloat_string): Remove.
13415 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
13416 (read1): Do not accept +. and -. as integers; this
13417 appears to have been a coding error. Similarly, do not accept
13418 strings like +-1e0 as floating point numbers. Do not report
13419 overflow for integer overflows unless the base is not 10 which
13420 means we have no simple and reliable way to continue.
13421 Break out the floating-point parsing into a new
13422 function string_to_number, so that Fstring_to_number parses
13423 floating point numbers consistently with the Lisp reader.
13424 (digit_to_number): Move here from data.c. Make it static inline.
13425 (E_CHAR, EXP_INT): Remove, replacing with ...
13426 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13427 (string_to_number): New function, replacing isfloat_string.
13428 This function checks for valid syntax and produces the resulting
13429 Lisp float number too. Rework it so that string-to-number
13430 no longer mishandles examples like "1.0e+". Use strtoumax,
13431 so that overflow for non-base-10 numbers is reported only when
13432 there's no portable and simple way to convert to floating point.
13433
13434 * textprop.c (set_text_properties_1): Rewrite for clarity,
13435 and to avoid GCC warning about integer overflow.
13436
13437 * intervals.h (struct interval): Use EMACS_INT for members
13438 where EMACS_UINT might cause problems. See
13439 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13440 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13441 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13442 All uses changed.
13443 (offset_intervals): Tell GCC not to worry about length overflow
13444 when negating a negative length.
13445
13446 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13447 (overrun_check_free): Likewise.
13448
13449 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13450 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13451 word size.
13452
13453 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13454 (gnutls_make_error): Rename local to avoid shadowing.
13455 (gnutls_emacs_global_deinit): ifdef out; not used.
13456 (Fgnutls_boot): Use const for pointer to readonly storage.
13457 Comment out unused local. Fix pointer signedness problems.
13458
13459 * lread.c (openp): Don't stuff size_t into an 'int'.
13460 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13461 about possible signed overflow.
13462
13463 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13464 (GDK_KEY_g): Don't define if already defined.
13465 (xg_prepare_tooltip): Avoid pointer signedness problem.
13466 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13467
13468 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13469 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13470
13471 * xfns.c (Fx_window_property): Simplify a bit,
13472 to make a bit faster and to avoid GCC 4.6.0 warning.
13473 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13474
13475 * fns.c (internal_equal): Don't assume size_t fits in int.
13476
13477 * alloc.c (compact_small_strings): Tighten assertion a little.
13478
13479 Replace pEd with more-general pI, and fix some printf arg casts.
13480 * lisp.h (pI): New macro, generalizing old pEd macro to other
13481 conversion specifiers. For example, use "...%"pI"d..." rather
13482 than "...%"pEd"...".
13483 (pEd): Remove. All uses replaced with similar uses of pI.
13484 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
13485 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13486 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13487 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13488 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13489 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13490 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13491 64-bit hosts.
13492 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13493 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13494 * print.c (safe_debug_print, print_object): Likewise.
13495 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13496 to int.
13497 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13498 avoiding the 0 flag, which is not portable.
13499 * process.c (Fmake_network_process): Use pI to avoid cast.
13500 * region-cache.c (pp_cache): Likewise.
13501 * xdisp.c (decode_mode_spec): Likewise.
13502 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13503 behavior on 64-bit hosts with printf arg.
13504 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
13505 (x_stop_queuing_selection_requests): Likewise.
13506 (x_get_window_property): Don't truncate byte count to an 'int'
13507 when tracing.
13508
13509 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13510 here, since it parses constructs like leading '-' and spaces,
13511 which are not wanted; and it overflows with large numbers.
13512 Instead, simply match F[0-9]+, which is what is wanted anyway.
13513
13514 * alloc.c: Remove unportable assumptions about struct layout.
13515 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13516 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13517 (allocate_vectorlike, make_pure_vector): Use the new macros,
13518 plus offsetof, to remove unportable assumptions about struct layout.
13519 These assumptions hold on all porting targets that I know of, but
13520 they are not guaranteed, they're easy to remove, and removing them
13521 makes further changes easier.
13522
13523 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13524 This doesn't fix a bug but makes the code clearer.
13525 (string_overrun_cookie): Now const. Use initializers that
13526 don't formally overflow signed char, to avoid warnings.
13527 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13528 can cause Emacs to crash when string overrun checking is enabled.
13529 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13530 multiple of sizeof (EMACS_INT); it need not be, if
13531 alignof(EMACS_INT) < sizeof (EMACS_INT).
13532 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
13533
13534 2011-04-26 Juanma Barranquero <lekktu@gmail.com>
13535
13536 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13537
13538 2011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13539
13540 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
13541 supposed to be handshaking. (Bug#8556)
13542 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13543
13544 2011-04-26 Daniel Colascione <dan.colascione@gmail.com>
13545
13546 * lisp.h (Qdebug): List symbol.
13547 * eval.c (Qdebug): Restore global linkage.
13548 * keyboard.c (debug-on-event): New variable.
13549 (handle_user_signal): Break into debugger when debug-on-event
13550 matches the current signal symbol.
13551
13552 2011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13553
13554 * alloc.c (check_sblock, check_string_bytes)
13555 (check_string_free_list): Convert to standard C.
13556
13557 2011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13558
13559 * w32.c (emacs_gnutls_push): Fix typo.
13560
13561 2011-04-25 Eli Zaretskii <eliz@gnu.org>
13562
13563 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13564 "cast to pointer from integer of different size".
13565
13566 Improve doprnt and its use in verror. (Bug#8545)
13567 * doprnt.c (doprnt): Document the set of format control sequences
13568 supported by the function. Use SAFE_ALLOCA instead of always
13569 using `alloca'.
13570
13571 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13572 is one byte too soon. Don't use xrealloc; instead xfree and
13573 xmalloc anew.
13574
13575 2011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13576
13577 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13578 callbacks stage.
13579
13580 * gnutls.c: Renamed global_initialized to
13581 gnutls_global_initialized. Added internals for the
13582 :verify-hostname-error, :verify-error, and :verify-flags
13583 parameters of `gnutls-boot' and documented those parameters in the
13584 docstring. Start callback support.
13585 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13586 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13587 on error. Return error code.
13588 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13589 (emacs_gnutls_read): Likewise.
13590 (Fgnutls_boot): Return handshake error code.
13591 (emacs_gnutls_handle_error): New function.
13592 (wsaerror_to_errno): Likewise.
13593
13594 * w32.h (emacs_gnutls_pull): Add prototype.
13595 (emacs_gnutls_push): Likewise.
13596
13597 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13598 (emacs_gnutls_push): Likewise.
13599
13600 2011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13601
13602 * process.c (wait_reading_process_output): Check if GnuTLS
13603 buffered some data internally if no FDs are set for TLS
13604 connections.
13605
13606 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13607 (LIBS): Link to USER_LIBS.
13608 ($(BLD)/gnutls.$(0)): New target.
13609
13610 2011-04-24 Eli Zaretskii <eliz@gnu.org>
13611
13612 * xdisp.c (handle_single_display_spec): Rename the
13613 display_replaced_before_p argument into display_replaced_p, to
13614 make it consistent with the commentary. Fix typos in the
13615 commentary.
13616
13617 * textprop.c (syms_of_textprop): Remove dead code.
13618 (copy_text_properties): Delete obsolete commentary about an
13619 interface that was deleted long ago. Fix typos in the description
13620 of arguments.
13621
13622 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13623 to changes in oldXMenu/XMenu.h from 2011-04-16.
13624 <menu_help_message, prev_menu_help_message>: Constify.
13625 (IT_menu_make_room): menu->help_text is now `const char **';
13626 adjust.
13627
13628 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13629 to changes in oldXMenu/XMenu.h from 2011-04-16.
13630 (struct XMenu): Declare `help_text' `const char **'.
13631
13632 * xfaces.c <Qunspecified>: Make extern again.
13633
13634 * syntax.c: Include sys/types.h before including regex.h, as
13635 required by POSIX.
13636
13637 * doc.c (get_doc_string): Improve the format passed to `error'.
13638
13639 * doprnt.c (doprnt): Improve commentary.
13640
13641 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13642
13643 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13644 them with etags.
13645
13646 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13647 changes in globals.h immediately force recompilation.
13648 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13649 $(CURDIR)/s/ms-w32.h.
13650 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
13651
13652 * character.c (Fchar_direction): Function deleted.
13653 (syms_of_character): Don't defsubr it.
13654 <char-direction-table>: Deleted.
13655
13656 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13657
13658 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13659 * doprnt.c: Include limits.h.
13660 (SIZE_MAX): New macro.
13661 (doprnt): Return a size_t value. 2nd arg is now size_t.
13662 Many local variables are now size_t instead of int or unsigned.
13663 Improve overflow protection. Support `l' modifier for integer
13664 conversions. Support %l conversion. Don't assume an EMACS_INT
13665 argument for integer conversions and for %c.
13666
13667 * lisp.h (doprnt): Restore prototype.
13668
13669 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13670 $(SRC)/character.h.
13671
13672 * Makefile.in (base_obj): Add back doprnt.o.
13673
13674 * deps.mk (doprnt.o): Add back prerequisites.
13675 (callint.o): Depend on character.h.
13676
13677 * eval.c (internal_lisp_condition_case): Include the handler
13678 representation in the error message.
13679 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13680 when breaking from the loop.
13681
13682 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13683
13684 * callint.c (Fcall_interactively): When displaying error message
13685 about invalid control letter, pass the character's codepoint, not
13686 a pointer to its multibyte form. Improve display of the character
13687 in octal and display also its hex code.
13688
13689 * character.c (char_string): Use %x to display the (unsigned)
13690 codepoint of an invalid character, to avoid displaying a bogus
13691 negative value.
13692
13693 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13694 `error', not SYMBOL_NAME itself.
13695
13696 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13697 character arguments to `error'.
13698
13699 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13700 to `error' in error message about FINAL_CHAR argument. Make sure
13701 FINAL_CHAR is a character, and use %c when it is passed as
13702 argument to `error'.
13703
13704 2011-04-23 Eli Zaretskii <eliz@gnu.org>
13705
13706 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13707
13708 * w32.c: Include <time.h>.
13709 (sys_localtime): New function.
13710
13711 2011-04-23 Chong Yidong <cyd@stupidchicken.com>
13712
13713 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13714
13715 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
13716
13717 2011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
13718
13719 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13720 zombies (Bug#8467).
13721
13722 2011-04-19 Eli Zaretskii <eliz@gnu.org>
13723
13724 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13725 gl_state.e_property when gl_state.object is Qt.
13726
13727 * insdel.c (make_gap_larger): Remove limitation of buffer size
13728 to <= INT_MAX.
13729
13730 2011-04-18 Chong Yidong <cyd@stupidchicken.com>
13731
13732 * xdisp.c (lookup_glyphless_char_display)
13733 (produce_glyphless_glyph): Handle cons cell entry in
13734 glyphless-char-display.
13735 (Vglyphless_char_display): Document it.
13736
13737 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13738 glyphless-char-display.
13739
13740 2011-04-17 Chong Yidong <cyd@stupidchicken.com>
13741
13742 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13743
13744 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13745
13746 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13747 definition for no-X builds.
13748
13749 2011-04-16 Paul Eggert <eggert@cs.ucla.edu>
13750
13751 Static checks with GCC 4.6.0 and non-default toolkits.
13752
13753 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13754
13755 * process.c (keyboard_bit_set): Define only if SIGIO.
13756 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13757 (send_process): Repair possible setjmp clobbering.
13758
13759 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13760
13761 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13762
13763 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13764
13765 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13766 Define only if needed.
13767
13768 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13769 by pacifying GCC about it. Maybe it's time to retire it?
13770 * xfaces.c (USG, __TIMEVAL__): Likewise.
13771
13772 * dispextern.h (struct redisplay_interface): Rename param
13773 to avoid shadowing.
13774 * termhooks.h (struct terminal): Likewise.
13775 * xterm.c (xembed_send_message): Likewise.
13776
13777 * insdel.c (make_gap_smaller): Define only if
13778 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13779
13780 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13781 it.
13782
13783 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13784 so that we aren't warned about unused symbols.
13785
13786 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13787
13788 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
13789
13790 * xfns.c (x_real_positions): Mark locals as initialized.
13791
13792 * xmenu.c (xmenu_show): Don't use uninitialized vars.
13793
13794 * xterm.c: Fix problems found by static analysis with other toolkits.
13795 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
13796 (x_dispatch_event): Declare static if USE_GTK, and
13797 define if USE_GTK || USE_X_TOOLKIT.
13798 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
13799 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
13800 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13801 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
13802
13803 * xmenu.c (menu_help_callback): Pointer type fixes.
13804 Use const pointers when pointing at readonly data. Avoid pointer
13805 signedness clashes.
13806 (FALSE): Remove unused macro.
13807 (update_frame_menubar): Remove unused decl.
13808
13809 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13810
13811 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13812 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13813 (single_menu_item): Rename local to avoid shadowing.
13814
13815 * keyboard.c (make_lispy_event): Remove unused local var.
13816
13817 * frame.c, frame.h (x_get_resource_string): Bring this back, but
13818 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13819
13820 * bitmaps: Change bitmaps from unsigned char back to the X11
13821 compatible char. Avoid the old compiler warnings about
13822 out-of-range initializers by using, for example, '\xab' rather
13823 than 0xab.
13824
13825 * xgselect.c (xgselect_initialize): Check vs interface
13826 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
13827
13828 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
13829
13830 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
13831 to read-only memory.
13832
13833 * fns.c (vector): Remove; this old hack is no longer needed.
13834
13835 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
13836 Remove unused var.
13837 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
13838
13839 * xrdb.c (x_load_resources): Omit unused local.
13840
13841 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
13842 (x_window): Rename locals to avoid shadowing.
13843 (USG): Use the kludged USG macro, to pacify gcc.
13844
13845 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
13846 (x_term_init): Remove local to avoid shadowing.
13847
13848 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
13849
13850 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13851 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13852
13853 2011-04-16 Eli Zaretskii <eliz@gnu.org>
13854
13855 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13856
13857 Fix regex.c, syntax.c and friends for buffers > 2GB.
13858 * syntax.h (struct gl_state_s): Declare character position members
13859 EMACS_INT.
13860
13861 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13862
13863 * textprop.c (verify_interval_modification, interval_of):
13864 Declare arguments EMACS_INT.
13865
13866 * intervals.c (adjust_intervals_for_insertion): Declare arguments
13867 EMACS_INT.
13868
13869 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13870
13871 * indent.c (Fvertical_motion): Local variable it_start is now
13872 EMACS_INT.
13873
13874 * regex.c (re_match, re_match_2, re_match_2_internal)
13875 (bcmp_translate, regcomp, regexec, print_double_string)
13876 (group_in_compile_stack, re_search, re_search_2, regex_compile)
13877 (re_compile_pattern, re_exec): Declare arguments and local
13878 variables `size_t' and `ssize_t' and return values `regoff_t', as
13879 appropriate.
13880 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13881 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13882 <compile_stack_type>: `size' and `avail' are now `size_t'.
13883
13884 * regex.h <regoff_t>: Use ssize_t, not int.
13885 (re_search, re_search_2, re_match, re_match_2): Arguments that
13886 specify buffer/string position and length are now ssize_t and
13887 size_t. Return type is regoff_t.
13888
13889 2011-04-16 Ben Key <bkey76@gmail.com>
13890
13891 * nsfont.m: Fixed bugs in ns_get_family and
13892 ns_descriptor_to_entity that were caused by using free to
13893 deallocate memory blocks that were allocated by xmalloc (via
13894 xstrdup). This caused Emacs to crash when compiled with
13895 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
13896 --enable-checking=xmallocoverrun). xfree is now used to
13897 deallocate these memory blocks.
13898
13899 2011-04-15 Paul Eggert <eggert@cs.ucla.edu>
13900
13901 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
13902
13903 emacs_write: Accept and return EMACS_INT for sizes.
13904 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
13905 et seq.
13906 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
13907 Accept and return EMACS_INT.
13908 (emacs_gnutls_write): Return the number of bytes written on
13909 partial writes.
13910 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
13911 (emacs_read, emacs_write): Remove check for negative size, as the
13912 Emacs source code has been audited now.
13913 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
13914 (emacs_read, emacs_write): Use it.
13915 * process.c (send_process): Adjust to the new signatures of
13916 emacs_write and emacs_gnutls_write. Do not attempt to store
13917 a byte offset into an 'int'; it might overflow.
13918 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
13919
13920 * sound.c: Don't assume sizes fit in 'int'.
13921 (struct sound_device.period_size, alsa_period_size):
13922 Return EMACS_INT, not int.
13923 (struct sound_device.write, vox_write, alsa_write):
13924 Accept EMACS_INT, not int.
13925 (wav_play, au_play): Use EMACS_INT to store sizes and to
13926 record read return values.
13927
13928 2011-04-15 Ben Key <bkey76@gmail.com>
13929
13930 * keyboard.c (Qundefined): Don't declare static since it is used
13931 in nsfns.m.
13932 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
13933 static since they are used in nsfont.m.
13934
13935 2011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
13936
13937 * process.c (Qprocessp): Don't declare static.
13938 * lisp.h (Qprocessp): Declare again.
13939
13940 2011-04-15 Juanma Barranquero <lekktu@gmail.com>
13941
13942 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
13943
13944 2011-04-14 Paul Eggert <eggert@cs.ucla.edu>
13945
13946 Improve C-level modularity by making more things 'static'.
13947
13948 Don't publish debugger-only interfaces to other modules.
13949 * lisp.h (safe_debug_print, debug_output_compilation_hack):
13950 (verify_bytepos, count_markers): Move decls to the only modules
13951 that need them.
13952 * region-cache.h (pp_cache): Likewise.
13953 * window.h (check_all_windows): Likewise.
13954 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
13955
13956 * sysdep.c (croak): Now static, if
13957 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
13958 * syssignal.h (croak): Declare only if not static.
13959
13960 * alloc.c (refill_memory_reserve): Now static if
13961 !defined REL_ALLOC || defined SYSTEM_MALLOC.
13962 * lisp.h (refill_memory_reserve): Declare only if not static.
13963
13964 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
13965 Define only if USE_LUCID.
13966
13967 * xrdb.c (x_customization_string, x_rm_string): Now static.
13968
13969 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
13970 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
13971
13972 * xdisp.c (draw_row_with_mouse_face): Now static.
13973 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
13974
13975 * window.h (check_all_windows): Mark externally visible.
13976
13977 * window.c (window_deletion_count): Now static.
13978
13979 * undo.c: Make symbols static if they're not exported.
13980 (last_undo_buffer, last_boundary_position, pending_boundary):
13981 Now static.
13982
13983 * textprop.c (interval_insert_behind_hooks): Now static.
13984 (interval_insert_in_front_hooks): Likewise.
13985
13986 * term.c: Make symbols static if they're not exported.
13987 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
13988 (max_frame_lines, tty_set_terminal_modes):
13989 (tty_reset_terminal_modes, tty_turn_off_highlight):
13990 (get_tty_terminal): Now static.
13991 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
13992 * termhooks.h (term_mouse_moveto): Do not declare if
13993 HAVE_WINDOW_SYSTEM.
13994 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
13995 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
13996
13997 * sysdep.c: Make symbols static if they're not exported.
13998 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
13999 Now static.
14000 (sigprocmask_set, full_mask): Remove; unused.
14001 (wait_debugging): Mark as visible.
14002 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14003 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14004
14005 * syntax.c (syntax_temp): Define only if !__GNUC__.
14006
14007 * sound.c (current_sound_device, current_sound): Now static.
14008
14009 * search.c (searchbufs, searchbuf_head): Now static.
14010
14011 * scroll.c (scroll_cost): Remove; unused.
14012 * dispextern.h (scroll_cost): Remove decl.
14013
14014 * region-cache.h (pp_cache): Mark as externally visible.
14015
14016 * process.c: Make symbols static if they're not exported.
14017 (process_tick, update_tick, create_process, chan_process):
14018 (Vprocess_alist, proc_buffered_char, datagram_access):
14019 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14020 (deactivate_process): Mark defn as static, as well as decl.
14021 * lisp.h (create_process): Remove decl.
14022 * process.h (chan_process, Vprocess_alist): Remove decls.
14023
14024 * print.c: Make symbols static if they're not exported.
14025 (print_depth, new_backquote_output, being_printed, print_buffer):
14026 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14027 (print_interval, print_number_index, initial_stderr_stream):
14028 Now static.
14029 * lisp.h (Fprinc): Remove decl.
14030 (debug_output_compilation_hack): Mark as externally visible.
14031
14032 * sysdep.c (croak): Move decl from here to syssignal.h.
14033 * syssignal.h (croak): Put it here, so the API can be checked when
14034 'croak' is called from dissociate_if_controlling_tty.
14035
14036 * minibuf.c: Make symbols static if they're not exported.
14037 (minibuf_save_list, choose_minibuf_frame): Now static.
14038 * lisp.h (choose_minibuf_frame): Remove decl.
14039
14040 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14041
14042 * lread.c: Make symbols static if they're not exported.
14043 (read_objects, initial_obarray, oblookup_last_bucket_number):
14044 Now static.
14045 (make_symbol): Remove; unused.
14046 * lisp.h (initial_obarray, make_symbol): Remove decls.
14047
14048 * keyboard.c: Make symbols static if they're not exported.
14049 (single_kboard, recent_keys_index, total_keys, recent_keys):
14050 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14051 (this_single_command_key_start, echoing, last_auto_save):
14052 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14053 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14054 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14055 (Vlispy_mouse_stem, double_click_count):
14056 Now static.
14057 (force_auto_save_soon): Define only if SIGDANGER.
14058 (ignore_mouse_drag_p): Now static if
14059 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14060 (print_help): Remove; unused.
14061 (stop_character, last_timer_event): Mark as externally visible.
14062 * keyboard.h (ignore_mouse_drag_p): Declare only if
14063 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14064 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14065 * lisp.h (echoing): Remove decl.
14066 (force_auto_save_soon): Declare only if SIGDANGER.
14067 * xdisp.c (redisplay_window): Simplify code, to make it more
14068 obvious that ignore_mouse_drag_p is not accessed if !defined
14069 USE_GTK && !defined HAVE_NS.
14070
14071 * intervals.c: Make symbols static if they're not exported.
14072 (merge_properties_sticky, merge_interval_right, delete_interval):
14073 Now static.
14074 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14075
14076 * insdel.c: Make symbols static if they're not exported.
14077 However, leave prepare_to_modify_buffer alone. It's never
14078 called from outside this function, but that appears to be a bug.
14079 (combine_after_change_list, combine_after_change_buffer):
14080 (adjust_after_replace, signal_before_change): Now static.
14081 (adjust_after_replace_noundo): Remove; unused.
14082 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
14083 (signal_before_change): Remove decls.
14084
14085 * indent.c (val_compute_motion, val_vmotion): Now static.
14086
14087 * image.c: Make symbols static if they're not exported.
14088 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14089 if USE_GTK.
14090 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14091 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14092
14093 * fringe.c (standard_bitmaps): Now static.
14094 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14095
14096 * frame.c: Make symbols static if they're not exported.
14097 (x_report_frame_params, make_terminal_frame): Now static.
14098 (get_frame_param): Now static, unless HAVE_NS.
14099 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14100 (x_get_resource_string): Remove; not used.
14101 * frame.h (make_terminal_frame, x_report_frame_params):
14102 (x_get_resource_string); Remove decls.
14103 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14104 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14105
14106 * font.c, fontset.c: Make symbols static if they're not exported.
14107 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14108 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14109 * font.c (font_close_object): Now static.
14110 * font.h (font_close_object): Remove.
14111 * fontset.c (FONTSET_OBJLIST): Remove.
14112 (free_realized_fontset) #if-0 the body, which does nothing.
14113 (face_suitable_for_char_p): #if-0, as it's never called.
14114 * fontset.h (face_suitable_for_char_p): Remove decl.
14115 * xfaces.c (face_at_string_position):
14116 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
14117 since 0 is always ASCII.
14118
14119 * fns.c (weak_hash_tables): Now static.
14120
14121 * fileio.c: Make symbols static if they're not exported.
14122 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14123 (Vwrite_region_annotation_buffers): Now static.
14124
14125 * eval.c: Make symbols static if they're not exported.
14126 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14127 * lisp.h (backtrace_list): Remove decl.
14128
14129 * emacs.c: Make symbols static if they're not exported.
14130 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14131 (fatal_error_code, fatal_error_signal_hook, standard_args):
14132 Now static.
14133 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14134 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14135 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14136 * lisp.h (fatal_error_signal_hook): Remove decl.
14137 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14138
14139 * editfns.c: Move a (normally-unused) function to its only use.
14140 * editfns.c, lisp.h (get_operating_system_release): Remove.
14141 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14142 worth the hassle of breaking this out.
14143
14144 * xterm.c: Make symbols static if they're not exported.
14145 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14146 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14147 (x_destroy_window, x_delete_display):
14148 Now static.
14149 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14150 (x_mouse_leave): Remove; unused.
14151 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14152 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14153 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14154 Remove decls.
14155 (x_mouse_leave): Declare only if WINDOWSNT.
14156 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14157 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14158 USE_X_TOOLKIT.
14159
14160 * ftxfont.c: Make symbols static if they're not exported.
14161 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14162 HAVE_FREETYPE.
14163 * font.h (ftxfont_driver): Likewise.
14164
14165 * xfns.c: Make symbols static if they're not exported.
14166 (x_last_font_name, x_display_info_for_name):
14167 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14168 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14169 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14170 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14171 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14172 (last_show_tip_args): Now static.
14173 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14174 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14175 (x_screen_planes): Remove; unused.
14176 * dispextern.h (x_screen_planes): Remove decl.
14177
14178 * dispnew.c: Make symbols static if they're not exported.
14179 * dispextern.h (redraw_garbaged_frames, scrolling):
14180 (increment_row_positions): Remove.
14181 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14182 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14183 Now static.
14184 (redraw_garbaged_frames): Remove; unused.
14185
14186 * xfaces.c: Make symbols static if they're not exported.
14187 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14188 Remove decls.
14189 * xterm.h (defined_color): Remove decls.
14190 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14191 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14192 (menu_face_changed_default, defined_color, free_realized_face):
14193 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14194 (ascii_face_of_lisp_face): Remove; unused.
14195
14196 * xdisp.c: Make symbols static if they're not exported.
14197 * dispextern.h (scratch_glyph_row, window_box_edges):
14198 (glyph_to_pixel_coords, set_cursor_from_row):
14199 (get_next_display_element, set_iterator_to_next):
14200 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14201 (show_mouse_face): Remove decls
14202 * frame.h (message_buf_print): Likewise.
14203 * lisp.h (pop_message, set_message, check_point_in_composition):
14204 Likewise.
14205 * xterm.h (set_vertical_scroll_bar): Likewise.
14206 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14207 (message_buf_print, scratch_glyph_row, displayed_buffer):
14208 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14209 (get_next_display_element, show_mouse_face, window_box_edges):
14210 (frame_to_window_pixel_xy, check_point_in_composition):
14211 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14212 (glyph_to_pixel_coords): Remove; unused.
14213
14214 * dired.c (file_name_completion): Now static.
14215
14216 * dbusbind.c (xd_in_read_queued_messages): Now static.
14217
14218 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14219 * data.c (circular_list_error): Remove.
14220
14221 * commands.h (last_point_position, last_point_position_buffer):
14222 (last_point_position_window): Remove decls.
14223 * keyboard.c: Make these variables static.
14224
14225 * coding.h (coding, code_convert_region, encode_coding_gap):
14226 Remove decls.
14227 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14228 (iso_code_class, detect_coding, code_convert_region): Now static.
14229 (encode_coding_gap): Remove; unused.
14230
14231 * chartab.c (chartab_chars, chartab_bits): Now static.
14232
14233 * charset.h (charset_iso_8859_1): Remove decl.
14234 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14235 Now static.
14236
14237 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14238 * ccl.c (Vccl_program_table): Now static.
14239 (check_ccl_update): Remove; unused.
14240
14241 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14242 * category.h: ... from here.
14243 * category.c (check_category_table, set_category_set): Now static.
14244
14245 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14246 * lisp.h: Remove these decls.
14247
14248 * buffer.c (buffer_count): Remove unused var.
14249
14250 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14251 so that it's not optimized away.
14252 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14253 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14254 exported only to the debugger.
14255
14256 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
14257 * atimer.h (run_all_atimers): Remove; not exported.
14258
14259 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14260 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14261 was inaccessible from Lisp.
14262 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14263 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14264
14265 alloc.c: Import and export fewer symbols, and remove unused items.
14266 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14267 is defined.
14268 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14269 it's not optimized away by whole-program optimization.
14270 (message_enable_multibyte, free_misc): Remove.
14271 (catchlist, handlerlist, mark_backtrace):
14272 Declare only if BYTE_MARK_STACK.
14273 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14274 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14275 (message_enable_multibyte): Remove decl.
14276 (free_misc, interval_free_list, float_block, float_block_index):
14277 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14278 (cons_free_list, last_marked_index):
14279 Now static.
14280 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14281 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14282 (mark_backtrace): Define only if BYTE_MARK_STACK.
14283 * xdisp.c (message_enable_multibyte): Now static.
14284
14285 Declare Lisp_Object Q* variables to be 'static' if not exported.
14286 This makes it easier for human readers (and static analyzers)
14287 to see whether these variables are used from other modules.
14288 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14289 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14290 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14291 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14292 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14293 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14294 * xmenu.c, xselect.c:
14295 Declare Q* vars static if they are not used in other modules.
14296 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14297 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14298 Remove decls of unexported vars.
14299 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14300
14301 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14302
14303 Make Emacs functions such as Fatom 'static' by default.
14304 This makes it easier for human readers (and static analyzers)
14305 to see whether these functions can be called from other modules.
14306 DEFUN now defines a static function. To make the function external
14307 so that it can be used in other C modules, use the new macro DEFUE.
14308 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14309 (Finit_image_library):
14310 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14311 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14312 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14313 Remove decls, since these functions are now static.
14314 (Funintern, Fget_internal_run_time): New decls, since these functions
14315 were already external.
14316
14317 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14318 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14319 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14320 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14321 * keyboard.c, keymap.c, lread.c:
14322 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14323 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14324 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14325 Mark functions with DEFUE instead of DEFUN,
14326 if they are used in other modules.
14327 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14328 decls for now-static functions.
14329 * buffer.h (Fdelete_overlay): Remove decl.
14330 * callproc.c (Fgetenv_internal): Mark as internal.
14331 * composite.c (Fremove_list_of_text_properties): Remove decl.
14332 (Fcomposition_get_gstring): New forward static decl.
14333 * composite.h (Fcomposite_get_gstring): Remove decl.
14334 * dired.c (Ffile_attributes): New forward static decl.
14335 * doc.c (Fdocumntation_property): New forward static decl.
14336 * eval.c (Ffetch_bytecode): New forward static decl.
14337 (Funintern): Remove extern decl; now in .h file where it belongs.
14338 * fileio.c (Fmake_symbolic_link): New forward static decl.
14339 * image.c (Finit_image_library): New forward static decl.
14340 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14341 * intervals.h (Fprevious_property_change):
14342 (Fremove_list_of_text_properties): Remove decls.
14343 * keyboard.c (Fthis_command_keys): Remove decl.
14344 (Fcommand_execute): New forward static decl.
14345 * keymap.c (Flookup_key): New forward static decl.
14346 (Fcopy_keymap): Now static.
14347 * keymap.h (Flookup_key): Remove decl.
14348 * process.c (Fget_process): New forward static decl.
14349 (Fprocess_datagram_address): Mark as internal.
14350 * syntax.c (Fsyntax_table_p): New forward static decl.
14351 (skip_chars): Remove duplicate decl.
14352 * textprop.c (Fprevious_property_change): New forward static decl.
14353 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14354 Now internal.
14355 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14356 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14357
14358 * editfns.c (Fformat): Remove unreachable code.
14359
14360 2011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14361
14362 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14363 change. (Bug#8496)
14364
14365 2011-04-13 Eli Zaretskii <eliz@gnu.org>
14366
14367 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14368 when at ZV. (Bug#8487)
14369
14370 2011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14371
14372 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14373 (Bug#8437)
14374 * keyboard.c (parse_tool_bar_item): Likewise.
14375 * sound.c (sound_cleanup, alsa_close): Likewise.
14376 * termcap.c (tgetent): Likewise.
14377 * xfns.c (x_default_font_parameter): Likewise.
14378 * xsettings.c (read_and_apply_settings): Likewise.
14379
14380 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14381 (overrun_check_free): Protoize.
14382
14383 2011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14384
14385 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14386 since callers should never pass a negative size.
14387 Change the signature to match that of plain 'read' and 'write'; see
14388 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14389 * lisp.h: Update prototypes of emacs_write and emacs_read.
14390
14391 2011-04-11 Eli Zaretskii <eliz@gnu.org>
14392
14393 * xdisp.c (redisplay_window): Don't try to determine the character
14394 position of the scroll margin if the window start point w->startp
14395 is outside the buffer's accessible region. (Bug#8468)
14396
14397 2011-04-10 Eli Zaretskii <eliz@gnu.org>
14398
14399 Fix write-region and its subroutines for buffers > 2GB.
14400 * fileio.c (a_write, e_write): Modify declaration of arguments and
14401 local variables to support buffers larger than 2GB.
14402 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14403
14404 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14405 argument, local variables, and return value.
14406
14407 * lisp.h: Update prototypes of emacs_write and emacs_read.
14408
14409 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14410
14411 2011-04-10 Paul Eggert <eggert@cs.ucla.edu>
14412
14413 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14414
14415 Fix more problems found by GCC 4.6.0's static checks.
14416
14417 * xdisp.c (vmessage): Use a better test for character truncation.
14418
14419 * charset.c (load_charset_map): <, not <=, for optimization,
14420 and to avoid potential problems with integer overflow.
14421 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
14422 * casetab.c (set_identity, shuffle): Likewise.
14423 * editfns.c (Fformat): Likewise.
14424 * syntax.c (skip_chars): Likewise.
14425
14426 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14427 This also lets GCC 4.6.0 generate slightly better loop code.
14428
14429 * callint.c (Fcall_interactively): <, not <=, for optimization.
14430 (Fcall_interactively): Count the number of arguments produced,
14431 not the number of arguments given. This is simpler and lets GCC
14432 4.6.0 generate slightly better code.
14433
14434 * ftfont.c: Distingish more carefully between FcChar8 and char.
14435 The previous code passed unsigned char * to a functions like
14436 strlen and xstrcasecmp that expect char *, which does not
14437 conform to the C standard.
14438 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14439 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14440 char * when the C standard requires it.
14441
14442 * keyboard.c (read_char): Remove unused var.
14443
14444 * eval.c: Port to Windows vsnprintf (Bug#8435).
14445 Include <limits.h>.
14446 (SIZE_MAX): Define if the headers do not.
14447 (verror): Do not give up if vsnprintf returns a negative count.
14448 Instead, grow the buffer. This ports to Windows vsnprintf, which
14449 does not conform to C99. Problem reported by Eli Zaretskii.
14450 Also, simplify the allocation scheme, by avoiding the need for
14451 calling realloc, and removing the ALLOCATED variable.
14452
14453 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14454
14455 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14456 But keep the doprint source code for now, as we might revamp it
14457 and use it again (Bug#8435).
14458 * lisp.h (doprnt): Remove.
14459 * Makefile.in (base_obj): Remove doprnt.o.
14460 * deps.mk (doprnt.o): Remove.
14461
14462 error: Print 32- and 64-bit integers portably (Bug#8435).
14463 Without this change, on typical 64-bit hosts error ("...%d...", N)
14464 was used to print both 32- and 64-bit integers N, which relied on
14465 undefined behavior.
14466 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
14467 * lisp.h (error, verror): Mark as printf-like functions.
14468 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14469 Report overflow in size calculations when allocating printf buffer.
14470 Do not truncate output string at its first null byte.
14471 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14472 Truncate the output at a character boundary, since vsnprintf does not
14473 do that.
14474 * charset.c (check_iso_charset_parameter): Convert internal
14475 character to string before calling 'error', since %c now has the
14476 printf meaning.
14477 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14478 overflow when computing char to be passed to 'error'. Do not
14479 pass Lisp_Object to 'error'; pass the integer instead.
14480 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14481 formatted with plain %d.
14482
14483 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14484
14485 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14486
14487 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14488
14489 * xterm.c (x_catch_errors): Remove duplicate declaration.
14490
14491 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14492
14493 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14494
14495 2011-04-10 Jim Meyering <meyering@redhat.com>
14496
14497 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14498 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14499 return ssize_t not "int", and use size_t as the buffer length.
14500 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14501 * gnutls.h: Update declarations.
14502 * process.c (read_process_output): Use ssize_t, to match.
14503 (send_process): Likewise.
14504
14505 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14506
14507 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14508
14509 2011-04-09 Chong Yidong <cyd@stupidchicken.com>
14510
14511 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14512 Use unsigned char, to match FcChar8 type definition.
14513
14514 * xterm.c (handle_one_xevent):
14515 * xmenu.c (create_and_show_popup_menu):
14516 * xselect.c (x_decline_selection_request)
14517 (x_reply_selection_request): Avoid type-punned deref of X events.
14518
14519 2011-04-09 Eli Zaretskii <eliz@gnu.org>
14520
14521 Fix some uses of `int' instead of EMACS_INT.
14522 * search.c (string_match_1, fast_string_match)
14523 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14524 (scan_buffer, find_next_newline_no_quit)
14525 (find_before_next_newline, search_command, Freplace_match)
14526 (Fmatch_data): Make some `int' variables be EMACS_INT.
14527
14528 * xdisp.c (display_count_lines): 3rd argument and return value now
14529 EMACS_INT. All callers changed.
14530 (pint2hrstr): Last argument is now EMACS_INT.
14531
14532 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14533 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14534 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14535 (decode_coding_utf_16, decode_coding_emacs_mule)
14536 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14537 (decode_coding_ccl, decode_coding_charset)
14538 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14539 (decode_coding_iso_2022, decode_coding_emacs_mule)
14540 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14541 <char_offset, last_offset>: Declare EMACS_INT.
14542 (encode_coding_utf_8, encode_coding_utf_16)
14543 (encode_coding_emacs_mule, encode_invocation_designation)
14544 (encode_designation_at_bol, encode_coding_iso_2022)
14545 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14546 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14547 Declare EMACS_INT.
14548 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14549 (encode_invocation_designation): Last argument P_NCHARS is now
14550 EMACS_INT.
14551 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14552 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14553
14554 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14555 All users changed.
14556
14557 * ccl.c (Fccl_execute_on_string): Declare some variables
14558 EMACS_INT.
14559
14560 2011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
14561
14562 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14563
14564 2011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14565
14566 * process.c (Fformat_network_address): Doc fix.
14567
14568 2011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14569
14570 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
14571
14572 2011-04-08 Chong Yidong <cyd@stupidchicken.com>
14573
14574 * keyboard.c (read_char): Call Lisp function help-form-show,
14575 instead of using internal_with_output_to_temp_buffer.
14576 (Qhelp_form_show): New var.
14577 (syms_of_keyboard): Use DEFSYM macro.
14578
14579 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14580
14581 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14582
14583 2011-04-06 Chong Yidong <cyd@stupidchicken.com>
14584
14585 * process.c (Flist_processes): Remove to Lisp.
14586 (list_processes_1): Delete.
14587
14588 2011-04-06 Eli Zaretskii <eliz@gnu.org>
14589
14590 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14591
14592 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14593
14594 2011-04-06 Paul Eggert <eggert@cs.ucla.edu>
14595
14596 Fix more problems found by GCC 4.6.0's static checks.
14597
14598 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14599
14600 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14601
14602 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
14603
14604 * xdisp.c (vmessage): Mark as a printf-like function.
14605
14606 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14607
14608 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14609
14610 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14611 printf-like functions.
14612 (tiff_load): Add casts to remove these marks before passing them
14613 to system-supplied API.
14614
14615 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14616
14617 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14618 This avoids several warnings with gcc -Wstrict-overflow.
14619 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14620 directly, rather than having caller test rule sign. This avoids
14621 some unnecessary tests.
14622 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14623 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14624 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
14625
14626 * xfont.c (xfont_text_extents): Remove var that was set but not used.
14627 (xfont_open): Avoid unnecessary tests.
14628
14629 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14630
14631 * composite.h, composite.c (composition_gstring_put_cache):
14632 Use EMACS_INT, not int, for length.
14633
14634 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14635 breaking out part of COMPOSITION_DECODE_RULE.
14636 (COMPOSITION_DECODE_RULE): Use it.
14637 * composite.c (get_composition_id): Remove unused local vars,
14638 by using the new macro.
14639
14640 * textprop.c (set_text_properties_1): Change while to do-while,
14641 since the condition is always true at first.
14642
14643 * intervals.c (graft_intervals_into_buffer): Mark var as used.
14644 (interval_deletion_adjustment): Return unsigned value.
14645 All uses changed.
14646
14647 * process.c (list_processes_1, create_pty, read_process_output):
14648 (exec_sentinel): Remove vars that were set but not used.
14649 (create_pty): Remove unnecessary "volatile"s.
14650 (Fnetwork_interface_info): Avoid possibility of int overflow.
14651 (read_process_output): Do adaptive read buffering even if carryover.
14652 (read_process_output): Simplify nbytes computation if buffered.
14653
14654 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14655
14656 * syntax.c (scan_words): Remove var that was set but not used.
14657 (update_syntax_table): Use unsigned instead of int.
14658
14659 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
14660 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
14661 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
14662
14663 * print.c (print_error_message): Avoid int overflow.
14664
14665 * font.c (font_list_entities): Redo for clarity,
14666 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14667
14668 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
14669 (font_score): Avoid potential overflow in diff calculation.
14670
14671 * fns.c (substring_both): Remove var that is set but not used.
14672 (sxhash): Redo loop for clarity and to avoid wraparound warning.
14673
14674 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14675
14676 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14677 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14678 can always succeed if overflow has undefined behavior.
14679
14680 * search.c (boyer_moore, wordify): Remove vars set but not used.
14681 (wordify): Omit three unnecessary tests.
14682
14683 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14684 All callers changed. This avoids the need for an unused var.
14685
14686 * casefiddle.c (casify_region): Remove var that is set but not used.
14687
14688 * dired.c (file_name_completion): Remove var that is set but not used.
14689
14690 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14691
14692 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
14693 (Finsert_file_contents): Remove unnecessary code checking fd.
14694
14695 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14696 Check for integer overflow on size calculations.
14697
14698 * buffer.c (Fprevious_overlay_change): Remove var that is set
14699 but not used.
14700
14701 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14702 Remove vars that are set but not used.
14703 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
14704 (timer_check_2): Mark vars as initialized.
14705
14706 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14707
14708 * image.c (lookup_image): Remove var that is set but not used.
14709 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
14710
14711 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14712 that are set but not used.
14713
14714 * xfns.c (make_invisible_cursor): Don't return garbage
14715 if XCreateBitmapFromData fails (Bug#8410).
14716
14717 * xselect.c (x_get_local_selection, x_handle_property_notify):
14718 Remove vars that are set but not used.
14719
14720 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
14721 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
14722
14723 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14724 Remove var that is set but not used.
14725 (scroll_bar_windows_size): Now size_t, not int.
14726 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14727 Check for overflow.
14728
14729 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14730 (map_tty_color) [!defined MSDOS]: Likewise.
14731
14732 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14733
14734 * coding.c: Remove vars that are set but not used.
14735 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14736 All callers changed.
14737 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14738 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14739 (decode_coding_charset): Remove vars that are set but not used.
14740
14741 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14742 that is set but not used.
14743
14744 * print.c (print_object): Remove var that is set but not used.
14745
14746 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
14747 The gnulib version avoids calling malloc in the usual case,
14748 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14749 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14750 * filelock.c (current_lock_owner): Likewise.
14751 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14752 * sysdep.c: Include allocator.h, careadlinkat.h.
14753 (emacs_no_realloc_allocator): New static constant.
14754 (emacs_readlink): New function.
14755 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14756 ../lib/careadlinkat.h.
14757
14758 2011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14759
14760 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14761 first non-nil return value).
14762
14763 2011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14764
14765 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14766 if not defined (Bug#8403).
14767
14768 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
14769
14770 * xdisp.c (display_count_lines): Remove parameter `start',
14771 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14772 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14773 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14774 (fill_stretch_glyph_string): Remove parameters `row' and `area',
14775 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14776 and thereabouts. All callers changed.
14777 (get_per_char_metric): Remove parameter `f', unused since
14778 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14779
14780 2011-04-02 Jim Meyering <meyering@redhat.com>
14781
14782 do not dereference NULL upon failed strdup
14783 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14784 (ns_get_family): Likewise.
14785
14786 2011-04-02 Juanma Barranquero <lekktu@gmail.com>
14787
14788 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14789
14790 2011-04-02 Jan Djärv <jan.h.d@swipnet.se>
14791
14792 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14793 later (Bug#8403).
14794
14795 2011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
14796
14797 Add lexical binding.
14798
14799 * window.c (Ftemp_output_buffer_show): New fun.
14800 (Fsave_window_excursion):
14801 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14802
14803 * lread.c (lisp_file_lexically_bound_p): New function.
14804 (Fload): Bind Qlexical_binding.
14805 (readevalloop): Remove `evalfun' arg.
14806 Bind Qinternal_interpreter_environment.
14807 (Feval_buffer): Bind Qlexical_binding.
14808 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14809 Mark as dynamic.
14810 (syms_of_lread): Declare `lexical-binding'.
14811
14812 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14813
14814 * keyboard.c (eval_dyn): New fun.
14815 (menu_item_eval_property): Use it.
14816
14817 * image.c (parse_image_spec): Use Ffunctionp.
14818
14819 * fns.c (concat, mapcar1): Accept byte-code-functions.
14820
14821 * eval.c (Fsetq): Handle lexical vars.
14822 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14823 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14824 (FletX, Flet): Obey lexical binding.
14825 (Fcommandp): Handle closures.
14826 (Feval): New `lexical' arg.
14827 (eval_sub): New function extracted from Feval. Use it almost
14828 everywhere where Feval was used. Look up vars in lexical env.
14829 Handle closures.
14830 (Ffunctionp): Move from subr.el.
14831 (Ffuncall): Handle closures.
14832 (apply_lambda): Remove `eval_flags'.
14833 (funcall_lambda): Handle closures and new byte-code-functions.
14834 (Fspecial_variable_p): New function.
14835 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
14836 but without exporting it to Lisp.
14837
14838 * doc.c (Fdocumentation, store_function_docstring):
14839 * data.c (Finteractive_form): Handle closures.
14840
14841 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
14842 interactive spec.
14843
14844 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14845 New byte-codes.
14846 (exec_byte_code): New function extracted from Fbyte_code to handle new
14847 calling convention for byte-code-functions. Add new byte-codes.
14848
14849 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
14850
14851 * alloc.c (Fmake_symbol): Init new `declared_special' field.
14852
14853 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
14854
14855 * xdisp.c (redisplay_internal): Fix prototype.
14856
14857 2011-03-31 Eli Zaretskii <eliz@gnu.org>
14858
14859 * xdisp.c (SCROLL_LIMIT): New macro.
14860 (try_scrolling): Use it when setting scroll_limit.
14861 Limit scrolling to 100 screen lines.
14862 (redisplay_window): Even when falling back on "recentering",
14863 position point in the window according to scroll-conservatively,
14864 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
14865
14866 (try_scrolling): When point is above the window, allow searching
14867 as far as scroll_max, or one screenful, to compute vertical
14868 distance from PT to the scroll margin position. This prevents
14869 try_scrolling from unnecessarily failing when
14870 scroll-conservatively is set to a value slightly larger than the
14871 window height. Clean up the case of PT below the margin at bottom
14872 of window: scroll_max can no longer be INT_MAX. When aggressive
14873 scrolling is in use, don't let point enter the opposite scroll
14874 margin as result of the scroll.
14875 (syms_of_xdisp) <scroll-conservatively>: Document the
14876 threshold of 100 lines for never-recentering scrolling.
14877
14878 2011-03-31 Juanma Barranquero <lekktu@gmail.com>
14879
14880 * dispextern.h (move_it_by_lines):
14881 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14882 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
14883 (message_log_check_duplicate): Remove parameters `prev_bol' and
14884 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14885 (redisplay_internal): Remove parameter `preserve_echo_area',
14886 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
14887
14888 * indent.c (Fvertical_motion):
14889 * window.c (window_scroll_pixel_based, Frecenter):
14890 Don't pass `need_y_p' to `move_it_by_lines'.
14891
14892 2011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
14893
14894 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
14895 steal a few bits to be more compact.
14896 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
14897 Remove unneeded casts.
14898
14899 * bytecode.c (Fbyte_code): CAR and CDR can GC.
14900
14901 2011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
14902
14903 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
14904 binding" message (bug#7967).
14905
14906 2011-03-30 Paul Eggert <eggert@cs.ucla.edu>
14907
14908 Fix more problems found by GCC 4.6.0's static checks.
14909
14910 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
14911 Remove unused local var.
14912
14913 * editfns.c (Fmessage_box): Remove unused local var.
14914
14915 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
14916 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14917 Omit unused local vars.
14918 * window.c (shrink_windows): Omit unused local var.
14919 * menu.c (digest_single_submenu): Omit unused local var.
14920 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
14921 Omit unused local var.
14922
14923 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
14924 Don't assume string length fits in int.
14925 (keyremap_step, read_key_sequence): Use size_t for sizes.
14926 (read_key_sequence): Don't check last_real_key_start redundantly.
14927
14928 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
14929 instead of alloca (Bug#8344).
14930
14931 * eval.c (Fbacktrace): Don't assume nargs fits in int.
14932 (Fbacktrace_frame): Don't assume nframes fits in int.
14933
14934 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
14935
14936 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
14937 concerns.
14938
14939 * term.c (produce_glyphless_glyph): Remove unnecessary test.
14940
14941 * cm.c (calccost): Turn while-do into do-while, for clarity.
14942
14943 * keyboard.c (syms_of_keyboard): Use the same style as later
14944 in this function when indexing through an array. This also
14945 works around GCC bug 48267.
14946
14947 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
14948
14949 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
14950
14951 * chartab.c (sub_char_table_ref_and_range): Redo for slight
14952 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
14953
14954 * keyboard.c, keyboard.h (num_input_events): Now size_t.
14955 This avoids undefined behavior on integer overflow, and is a bit
14956 more convenient anyway since it is compared to a size_t variable.
14957
14958 Variadic C functions now count arguments with size_t, not int.
14959 This avoids an unnecessary limitation on 64-bit machines, which
14960 caused (substring ...) to crash on large vectors (Bug#8344).
14961 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
14962 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
14963 All variadic functions and their callers changed accordingly.
14964 (struct gcpro.nvars): Now size_t, not int. All uses changed.
14965 * data.c (arith_driver, float_arith_driver): Likewise.
14966 * editfns.c (general_insert_function): Likewise.
14967 * eval.c (struct backtrace.nargs, interactive_p)
14968 (internal_condition_case_n, run_hook_with_args, apply_lambda)
14969 (funcall_lambda, mark_backtrace): Likewise.
14970 * fns.c (concat): Likewise.
14971 * frame.c (x_set_frame_parameters): Likewise.
14972 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
14973 0 if not found, not -1. All callers changed.
14974
14975 * alloc.c (garbage_collect): Don't assume stack size fits in int.
14976 (stack_copy_size): Now size_t, not int.
14977 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
14978
14979 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
14980
14981 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
14982 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14983 All callers changed.
14984
14985 * lisp.h (multibyte_char_to_unibyte):
14986 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
14987 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14988 * character.h (CHAR_TO_BYTE8):
14989 * cmds.c (internal_self_insert):
14990 * editfns.c (general_insert_function):
14991 * keymap.c (push_key_description):
14992 * search.c (Freplace_match):
14993 * xdisp.c (message_dolog, set_message_1): All callers changed.
14994
14995 2011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14996
14997 * keyboard.c (safe_run_hook_funcall): New function.
14998 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
14999 don't set the hook to nil, but remove the offending function instead.
15000 (Qcommand_hook_internal): Remove, unused.
15001 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15002 Vcommand_hook_internal.
15003
15004 * eval.c (enum run_hooks_condition): Remove.
15005 (funcall_nil, funcall_not): New functions.
15006 (run_hook_with_args): Call each function through a `funcall' argument.
15007 Remove `cond' argument, now redundant.
15008 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15009 (Frun_hook_with_args_until_failure): Adjust accordingly.
15010 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15011
15012 2011-03-28 Juanma Barranquero <lekktu@gmail.com>
15013
15014 * dispextern.h (string_buffer_position): Remove declaration.
15015
15016 * print.c (strout): Remove parameter `multibyte', unused since
15017 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15018
15019 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15020 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15021 All callers changed.
15022
15023 * w32.c (_wsa_errlist): Use braces for struct initializers.
15024
15025 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15026 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15027 All callers changed.
15028 (string_buffer_position): Likewise. Also, make static (it's never
15029 used outside xdisp.c).
15030 (cursor_row_p): Remove parameter `w', unused since
15031 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15032 (decode_mode_spec): Remove parameter `precision', introduced during
15033 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15034 All callers changed.
15035
15036 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15037
15038 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15039
15040 2011-03-27 Anders Lindgren <andlind@gmail.com>
15041
15042 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15043 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15044 (ns_update_auto_hide_menu_bar): New functions.
15045 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15046 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15047 ns_constrain_all_frames.
15048 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15049 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15050
15051 2011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15052
15053 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15054
15055 2011-03-27 Glenn Morris <rgm@gnu.org>
15056
15057 * syssignal.h: Replace RETSIGTYPE with void.
15058 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15059 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15060 Replace SIGTYPE with void everywhere.
15061 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15062 * s/template.h (SIGTYPE): Remove commented out definition.
15063
15064 2011-03-26 Eli Zaretskii <eliz@gnu.org>
15065
15066 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15067 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15068
15069 2011-03-26 Juanma Barranquero <lekktu@gmail.com>
15070
15071 * w32.c (read_unc_volume): Use parameter `henum', instead of
15072 global variable `wget_enum_handle'.
15073
15074 * keymap.c (describe_vector): Remove parameters `indices' and
15075 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15076 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15077
15078 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15079
15080 * keyboard.c (timer_check): Remove parameter `do_it_now',
15081 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15082 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15083 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15084
15085 * keyboard.c (read_char):
15086 * w32menu.c (w32_menu_display_help):
15087 * xmenu.c (show_help_event, menu_help_callback):
15088 Adjust calls to `show_help_echo'.
15089
15090 * gtkutil.c (xg_maybe_add_timer):
15091 * keyboard.c (readable_events):
15092 * process.c (wait_reading_process_output):
15093 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15094
15095 * insdel.c (adjust_markers_gap_motion):
15096 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15097 (gap_left, gap_right): Don't call it.
15098
15099 2011-03-25 Chong Yidong <cyd@stupidchicken.com>
15100
15101 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15102 incurred during fontification.
15103
15104 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15105
15106 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15107 (DEFVAR_PER_BUFFER): Don't pass it.
15108
15109 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15110 (scrolling_window): Don't pass it.
15111
15112 2011-03-25 Juanma Barranquero <lekktu@gmail.com>
15113
15114 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15115
15116 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15117 and `suffix'.
15118 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15119 of variables specific to SELinux and computation of `encoded_absname'.
15120
15121 * image.c (XPutPixel): Remove unused variable `height'.
15122
15123 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15124
15125 * unexw32.c (get_section_info): Remove unused variable `section'.
15126
15127 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15128 (system_process_attributes): Remove unused variable `sess'.
15129 (sys_read): Remove unused variable `err'.
15130
15131 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15132 (w32_wnd_proc): Remove unused variable `isdead'.
15133 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15134 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15135 (x_create_tip_frame): Remove unused variable `tem'.
15136
15137 * w32inevt.c (w32_console_read_socket):
15138 Remove unused variable `no_events'.
15139
15140 * w32term.c (x_draw_composite_glyph_string_foreground):
15141 Remove unused variable `width'.
15142
15143 2011-03-24 Juanma Barranquero <lekktu@gmail.com>
15144
15145 * w32term.c (x_set_glyph_string_clipping):
15146 Don't pass uninitialized region to CombineRgn.
15147
15148 2011-03-23 Juanma Barranquero <lekktu@gmail.com>
15149
15150 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15151 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15152 (Fx_close_connection): Remove unused variable `i'.
15153
15154 * w32font.c (w32font_draw): Return number of glyphs.
15155 (w32font_open_internal): Remove unused variable `i'.
15156 (w32font_driver): Add missing initializer.
15157
15158 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15159 (fill_in_menu): Remove unused variable `items_added'.
15160
15161 * w32term.c (last_mouse_press_frame): Remove static global variable.
15162 (w32_clip_to_row): Remove unused variable `f'.
15163 (x_delete_terminal): Remove unused variable `i'.
15164
15165 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15166 (NOTHING): Remove unused static global variable.
15167 (uniscribe_check_otf): Remove unused variable `table'.
15168 (uniscribe_font_driver): Add missing initializers.
15169
15170 2011-03-23 Julien Danjou <julien@danjou.info>
15171
15172 * term.c (Fsuspend_tty, Fresume_tty):
15173 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15174 * window.c (temp_output_buffer_show):
15175 * insdel.c (signal_before_change):
15176 * frame.c (Fhandle_switch_frame):
15177 * fileio.c (Fdo_auto_save):
15178 * emacs.c (Fkill_emacs):
15179 * editfns.c (save_excursion_restore):
15180 * cmds.c (internal_self_insert):
15181 * callint.c (Fcall_interactively):
15182 * buffer.c (Fkill_all_local_variables):
15183 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15184 Use Frun_hooks.
15185 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
15186 unconditionally since it does the check itself.
15187
15188 2011-03-23 Paul Eggert <eggert@cs.ucla.edu>
15189
15190 Fix more problems found by GCC 4.5.2's static checks.
15191
15192 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15193 the first time through the loop, since we know p0 < p1 then.
15194 This also avoids a gcc -Wstrict-overflow warning.
15195
15196 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15197 leading to a memory leak, possible in functions like
15198 load_charset_map_from_file that can allocate an unbounded number
15199 of objects (Bug#8318).
15200
15201 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15202 that could (at least in theory) be that large.
15203
15204 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15205 This is less likely to overflow, and avoids undefined behavior if
15206 overflow does occur. All callers changed. Use strtoul to scan
15207 for the unsigned long integer.
15208 (pint2hrstr): Simplify and tune code slightly.
15209 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
15210
15211 * scroll.c (do_scrolling): Work around GCC bug 48228.
15212 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15213
15214 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15215 This also avoids a warning with gcc -Wstrict-overflow.
15216 (validate_x_resource_name): Simplify count usage.
15217 This also avoids a warning with gcc -Wstrict-overflow.
15218
15219 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15220 fail (Bug#8306).
15221
15222 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
15223
15224 * process.c (Fmake_network_process): Use socklen_t, not int,
15225 where POSIX says socklen_t is required in portable programs.
15226 This fixes a porting bug on hosts like 64-bit HP-UX, where
15227 socklen_t is wider than int (Bug#8277).
15228 (Fmake_network_process, server_accept_connection):
15229 (wait_reading_process_output, read_process_output):
15230 Likewise.
15231
15232 * process.c: Rename or move locals to avoid shadowing.
15233 (list_processes_1, Fmake_network_process):
15234 (read_process_output_error_handler, exec_sentinel_error_handler):
15235 Rename or move locals.
15236 (Fmake_network_process): Define label "retry_connect" only if needed.
15237 (Fnetwork_interface_info): Fix pointer signedness.
15238 (process_send_signal): Add cast to avoid pointer signedness problem.
15239 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
15240 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
15241
15242 Make tparam.h and terminfo.c consistent.
15243 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15244 Include tparam.h instead, since it declares them.
15245 * cm.h (PC): Remove extern decl; tparam.h now does this.
15246 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15247 * terminfo.c: Include tparam.h, to check interfaces.
15248 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15249 (tparam): Adjust signature to match interface in tparam.h;
15250 this removes some undefined behavior. Check that outstring and len
15251 are zero, which they always are with Emacs.
15252 * tparam.h (PC, BC, UP): New extern decls.
15253
15254 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
15255 (xftfont_open): Rename locals to avoid shadowing.
15256
15257 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
15258 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15259 (OTF_TAG_SYM): Omit macro if not needed.
15260 (ftfont_list): Remove unused local.
15261 (get_adstyle_property, ftfont_pattern_entity):
15262 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15263 Rename locals to avoid shadowing.
15264
15265 * xfont.c (xfont_list_family): Mark var as initialized.
15266
15267 * xml.c (make_dom): Now static.
15268
15269 * composite.c (composition_compute_stop_pos): Rename local to
15270 avoid shadowing.
15271 (composition_reseat_it): Remove unused locals.
15272 (find_automatic_composition, composition_adjust_point): Likewise.
15273 (composition_update_it): Mark var as initialized.
15274 (find_automatic_composition): Mark vars as initialized,
15275 with a FIXME (Bug#8290).
15276
15277 character.h: Rename locals to avoid shadowing.
15278 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15279 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15280 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15281 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15282 to avoid shadowing.
15283
15284 * textprop.c (property_change_between_p): Remove; unused.
15285
15286 * intervals.c (interval_start_pos): Now static.
15287
15288 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15289
15290 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15291 Rename locals to avoid shadowing.
15292
15293 * sound.c (wav_play, au_play, Fplay_sound_internal):
15294 Fix pointer signedness.
15295 (alsa_choose_format): Remove unused local var.
15296 (wav_play): Initialize a variable to 0, to prevent undefined
15297 behavior (Bug#8278).
15298
15299 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15300
15301 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15302
15303 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15304 clobbering (Bug#8298).
15305 * sysdep.c (sys_subshell): Likewise.
15306 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
15307
15308 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15309 This should get cleaned up, so that child_setup has the
15310 same signature on all platforms.
15311
15312 * callproc.c (call_process_cleanup): Now static.
15313 (relocate_fd): Rename locals to avoid shadowing.
15314
15315 2011-03-22 Chong Yidong <cyd@stupidchicken.com>
15316
15317 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15318 not to be necessary, and produces flickering.
15319
15320 2011-03-20 Glenn Morris <rgm@gnu.org>
15321
15322 * config.in: Remove file.
15323
15324 2011-03-20 Juanma Barranquero <lekktu@gmail.com>
15325
15326 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15327 are now in src/globals.h.
15328 (syms_of_minibuf): Remove spurious & from previous change.
15329
15330 2011-03-20 Leo Liu <sdl.web@gmail.com>
15331
15332 * minibuf.c (completing-read-function): New variable.
15333 (completing-read-default): Rename from completing-read.
15334 (completing-read): Call completing-read-function.
15335
15336 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15337
15338 * xfaces.c (Fx_load_color_file):
15339 Read color file from absolute filename (bug#8250).
15340
15341 2011-03-19 Juanma Barranquero <lekktu@gmail.com>
15342
15343 * makefile.w32-in: Update dependencies.
15344
15345 2011-03-17 Eli Zaretskii <eliz@gnu.org>
15346
15347 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15348
15349 2011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15350
15351 Fix more problems found by GCC 4.5.2's static checks.
15352
15353 * process.c (make_serial_process_unwind, send_process_trap):
15354 (sigchld_handler): Now static.
15355
15356 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15357 That way, the code declares only the vars that it needs.
15358 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15359 * s/cygwin.h (PTY_ITERATION): Likewise.
15360 * s/darwin.h (PTY_ITERATION): Likewise.
15361 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15362
15363 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15364 * process.c (allocate_pty): Don't declare stb unless it's needed.
15365
15366 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
15367 (CONSTANTLIM): Remove; unused.
15368 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15369 Define only if needed.
15370
15371 * unexelf.c (unexec): Name an expression,
15372 to avoid gcc -Wbad-function-cast warning.
15373 Use a different way to cause a compilation error if anyone uses
15374 n rather than nn, a way that does not involve shadowing.
15375 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
15376
15377 * deps.mk (unexalpha.o): Remove; unused.
15378
15379 New file unexec.h, the (simple) interface for unexec (Bug#8267).
15380 * unexec.h: New file.
15381 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15382 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15383 Depend on unexec.h.
15384 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15385 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15386 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
15387 Change as necessary to match prototype in unexec.h.
15388
15389 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15390 shadowing.
15391 (back_comment, skip_chars): Mark vars as initialized.
15392
15393 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15394 Rename locals to avoid shadowing.
15395
15396 * lread.c (read1): Rewrite so as not to use empty "else".
15397 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
15398
15399 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15400
15401 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15402 warning when compiling print.c.
15403
15404 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15405 instead of using an uninitialized var.
15406 (font_sort_entities): Mark var as initialized.
15407
15408 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15409
15410 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15411 pointers to constants.
15412 (font_parse_fcname): Remove unused vars.
15413 (font_delete_unmatched): Now static.
15414 (font_get_spec): Remove; unused.
15415 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15416 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15417 Rename or move locals to avoid shadowing.
15418
15419 * fns.c (require_nesting_list, require_unwind): Now static.
15420 (Ffillarray): Rename locals to avoid shadowing.
15421
15422 * floatfns.c (domain_error2): Define only if needed.
15423 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
15424
15425 * alloc.c (mark_backtrace): Move decl from here ...
15426 * lisp.h: ... to here, so that it can be checked.
15427
15428 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
15429 (Fdefvar): Rewrite so as not to use empty "else".
15430 (lisp_indirect_variable): Name an expression,
15431 to avoid gcc -Wbad-function-cast warning.
15432 (Fdefvar): Rename locals to avoid shadowing.
15433
15434 * callint.c (quotify_arg, quotify_args): Now static.
15435 (Fcall_interactively): Rename locals to avoid shadowing.
15436 Use const pointer when appropriate.
15437
15438 * lisp.h (get_system_name, get_operating_system_release):
15439 Move decls here, to check interfaces.
15440 * process.c (get_operating_system_release): Move decl to lisp.h.
15441 * xrdb.c (get_system_name): Likewise.
15442 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15443 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15444 some of which prompt warnings from gcc -Wbad-function-cast.
15445 (Fformat_time_string, Fencode_time, Finsert_char):
15446 (Ftranslate_region_internal, Fformat):
15447 Rename or remove local vars to avoid shadowing.
15448 (Ftranslate_region_internal): Mark var as initialized.
15449
15450 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15451 avoid shadowing.
15452
15453 * lisp.h (eassert): Check that the argument compiles, even if
15454 ENABLE_CHECKING is not defined.
15455
15456 * data.c (Findirect_variable): Name an expression, to avoid
15457 gcc -Wbad-function-cast warning.
15458 (default_value, arithcompare, arith_driver, arith_error): Now static.
15459 (store_symval_forwarding): Rename local to avoid shadowing.
15460 (Fmake_variable_buffer_local, Fmake_local_variable):
15461 Mark variables as initialized.
15462 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
15463
15464 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
15465 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15466 Rename locals to avoid shadowing.
15467 (mark_stack): Move local variables into the #ifdef region where
15468 they're used.
15469 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15470 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15471 needed otherwise.
15472 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15473 (GC_STRING_CHARS): Remove; not used.
15474 (Fmemory_limit): Cast sbrk's returned value to char *.
15475
15476 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15477 avoids undefined behavior in theory.
15478
15479 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15480
15481 Use functions, not macros, for up- and down-casing (Bug#8254).
15482 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15483 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15484 to use the following functions instead of these macros.
15485 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15486 EMACS_INT, since callers assume the returned value fits in int.
15487 (upcase1): Likewise, for UPCASE_TABLE.
15488 (uppercasep, lowercasep, upcase): New static inline functions.
15489 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
15490 the race-condition problem in the old DOWNCASE.
15491
15492 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15493 Rename locals to avoid shadowing.
15494 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
15495 (regex_compile, re_search_2, re_match_2_internal):
15496 Remove unused local vars.
15497 (FREE_VAR): Rewrite so as not to use empty "else",
15498 which gcc can warn about.
15499 (regex_compile, re_match_2_internal): Mark locals as initialized.
15500 (RETALLOC_IF): Define only if needed.
15501 (WORDCHAR_P): Likewise. This one is never needed, but is used
15502 only in a comment talking about a compiler bug, so put inside
15503 the #if 0 of that comment.
15504 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15505 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15506 Remove; unused.
15507
15508 * search.c (boyer_moore): Rename locals to avoid shadowing.
15509 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15510 (PREV_CHAR_BOUNDARY): Likewise.
15511
15512 * search.c (simple_search): Remove unused var.
15513
15514 * dired.c (compile_pattern): Move decl from here ...
15515 * lisp.h: ... to here, so that it can be checked.
15516 (struct re_registers): New forward decl.
15517
15518 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15519
15520 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15521 All uses changed.
15522 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15523 Rename locals to avoid shadowing.
15524 (Fvertical_motion): Mark locals as initialized.
15525
15526 * casefiddle.c (casify_object, casify_region): Now static.
15527 (casify_region): Mark local as initialized.
15528
15529 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15530
15531 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15532 New macros, so that the caller can use some names other than
15533 gcpro1, gcpro2, etc.
15534 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15535 of the new macros.
15536 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15537 argument, for consistency with GCPRO2_VAR, etc: it is now the
15538 prefix of the variable, not the variable itself. All uses
15539 changed.
15540 * dired.c (directory_files_internal, file_name_completion):
15541 Rename locals to avoid shadowing.
15542
15543 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15544 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15545 dired.c's scmp function, had undefined behavior.
15546 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15547 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15548 * buffer.h: ... to here, because these macros use current_buffer,
15549 and the new implementation with inline functions needs to have
15550 current_buffer in scope now, rather than later when the macros
15551 are used.
15552 (downcase, upcase1): New static inline functions.
15553 (DOWNCASE, UPCASE1): Reimplement using these functions.
15554 This avoids undefined behavior in expressions like
15555 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15556 from race conditions in accessing the global variables
15557 case_temp1 and case_temp2.
15558 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15559 * lisp.h (case_temp1, case_temp2): Remove their decls.
15560 * character.h (ASCII_CHAR_P): Move from here ...
15561 * lisp.h: ... to here, so that the inline functions mentioned
15562 above can use them.
15563
15564 * dired.c (directory_files_internal_unwind): Now static.
15565
15566 * fileio.c (file_name_as_directory, directory_file_name):
15567 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15568 Now static.
15569 (file_name_as_directory): Use const pointers when appropriate.
15570 (Fexpand_file_name): Likewise. In particular, newdir might
15571 point at constant storage, so make it a const pointer.
15572 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
15573 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15574 signedness issues.
15575 (Fset_file_times, Finsert_file_contents, auto_save_error):
15576 Rename locals to avoid shadowing.
15577
15578 * minibuf.c (choose_minibuf_frame_1): Now static.
15579 (Ftry_completion, Fall_completions): Rename or remove locals
15580 to avoid shadowing.
15581
15582 * marker.c (bytepos_to_charpos): Remove; unused.
15583
15584 * lisp.h (verify_bytepos, count_markers): New decls,
15585 so that gcc does not warn that these functions aren't declared.
15586
15587 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15588 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
15589 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
15590 (copy_text): Remove unused local var.
15591
15592 * filelock.c (within_one_second): Now static.
15593 (lock_file_1): Rename local to avoid shadowing.
15594
15595 * buffer.c (fix_overlays_before): Mark locals as initialized.
15596 (fix_start_end_in_overlays): Likewise. This function should be
15597 simplified by using pointers-to-pointers, but that's a different
15598 matter.
15599 (switch_to_buffer_1): Now static.
15600 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15601 (report_overlay_modification): Rename locals to avoid shadowing.
15602
15603 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
15604 Fix pointer signedness issue.
15605 (sys_subshell): Mark local as volatile if checking for lint,
15606 to suppress a gcc -Wclobbered warning that does not seem to be right.
15607 (MAXPATHLEN): Define only if needed.
15608
15609 * process.c (serial_open, serial_configure): Move decls from here ...
15610 * systty.h: ... to here, so that they can be checked.
15611
15612 * fns.c (get_random, seed_random): Move extern decls from here ...
15613 * lisp.h: ... to here, so that they can be checked.
15614
15615 * sysdep.c (reset_io): Now static.
15616 (wait_for_termination_signal): Remove; unused.
15617
15618 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15619 (copy_keymap_item, append_key, push_text_char_description):
15620 Now static.
15621 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
15622 (DENSE_TABLE_SIZE): Remove; unused.
15623 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15624 (describe_map_tree):
15625 Rename locals to avoid shadowing.
15626
15627 * keyboard.c: Declare functions static if they are not used elsewhere.
15628 (echo_char, echo_dash, cmd_error, top_level_2):
15629 (poll_for_input, handle_async_input): Now static.
15630 (read_char, kbd_buffer_get_event, make_lispy_position):
15631 (make_lispy_event, make_lispy_movement, apply_modifiers):
15632 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15633 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15634 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
15635 (read_key_sequence, read_char): Mark locals as initialized.
15636 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
15637
15638 * keyboard.h (make_ctrl_char): New decl.
15639 (mark_kboards): Move decl here ...
15640 * alloc.c (mark_kboards): ... from here.
15641
15642 * lisp.h (force_auto_save_soon): New decl.
15643
15644 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
15645 (DEFINE_DUMMY_FUNCTION): New macro.
15646 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15647 Use it.
15648 (main): Add casts to avoid warnings
15649 if GCC considers string literals to be constants.
15650
15651 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15652
15653 * dbusbind.c: Pointer signedness fixes.
15654 (xd_signature, xd_append_arg, xd_initialize):
15655 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15656 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15657 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15658 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15659
15660 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15661 if GCC considers string literals to be constants.
15662 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
15663
15664 2011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15665
15666 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15667 (print_preprocess, print_object): New macro to fix last change.
15668
15669 * print.c (print_preprocess): Don't forget font objects.
15670
15671 2011-03-16 Juanma Barranquero <lekktu@gmail.com>
15672
15673 * emacs.c (USAGE3): Doc fixes.
15674
15675 2011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15676
15677 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15678 structure.
15679
15680 2011-03-14 Juanma Barranquero <lekktu@gmail.com>
15681
15682 * lisp.h (VWindow_system, Qfile_name_history):
15683 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15684 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15685 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15686
15687 * w32select.c: Don't #include "keyboard.h".
15688 (run_protected): Add extern declaration for waiting_for_input.
15689
15690 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15691 * w32console.c (detect_input_pending, read_input_pending)
15692 (encode_terminal_code):
15693 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15694 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15695 (w32_system_caret_y, Qfile_name_history):
15696 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15697 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15698 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15699 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15700 * w32proc.c (Qlocal, report_file_error):
15701 * w32term.c (Vwindow_system, updating_frame):
15702 * w32uniscribe.c (initialized, uniscribe_font_driver):
15703 Remove unneeded extern declarations.
15704
15705 2011-03-14 Chong Yidong <cyd@stupidchicken.com>
15706
15707 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
15708
15709 2011-03-13 Chong Yidong <cyd@stupidchicken.com>
15710
15711 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15712 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15713 These macros can no longer be used for assignment.
15714
15715 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15716 Assign struct members directly, instead of using BUF_BEGV etc.
15717 (record_buffer_markers, fetch_buffer_markers): New functions for
15718 recording and fetching special buffer markers.
15719 (set_buffer_internal_1, set_buffer_temp): Use them.
15720
15721 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15722
15723 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15724
15725 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15726 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15727
15728 * xdisp.c (hscroll_window_tree):
15729 (reconsider_clip_changes): Use PT instead of BUF_PT.
15730
15731 2011-03-13 Eli Zaretskii <eliz@gnu.org>
15732
15733 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15734 $(EMACS_ROOT)/lib/intprops.h.
15735
15736 2011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15737
15738 Fix more problems found by GCC 4.5.2's static checks.
15739
15740 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15741 to unsigned char * to avoid compiler diagnostic.
15742 (xg_free_frame_widgets): Make it clear that a local variable is
15743 needed only if USE_GTK_TOOLTIP.
15744 (gdk_window_get_screen): Make it clear that this macro is needed
15745 only if USE_GTK_TOOLTIP.
15746 (int_gtk_range_get_value): New function, which avoids a diagnostic
15747 from gcc -Wbad-function-cast.
15748 (xg_set_toolkit_scroll_bar_thumb): Use it.
15749 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15750 diagnostic from gcc -Wbad-function-cast.
15751 (get_utf8_string, xg_get_file_with_chooser):
15752 Rename locals to avoid shadowing.
15753 (create_dialog): Move locals to avoid shadowing.
15754
15755 * xgselect.c (xg_select): Remove unused var.
15756
15757 * image.c (four_corners_best): Mark locals as initialized.
15758 (gif_load): Initialize transparent_p to zero (Bug#8238).
15759 Mark another local as initialized.
15760 (my_png_error, my_error_exit): Mark with NO_RETURN.
15761
15762 * image.c (clear_image_cache): Now static.
15763 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
15764 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
15765 (x_edge_detection): Remove unnecessary cast that
15766 gcc -Wbad-function-cast diagnoses.
15767 (gif_load): Fix pointer signedness.
15768 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15769 (jpeg_load, gif_load): Rename locals to avoid shadowing.
15770
15771 2011-03-12 Paul Eggert <eggert@cs.ucla.edu>
15772
15773 Improve quality of tests for time stamp overflow.
15774 For example, without this patch (encode-time 0 0 0 1 1
15775 1152921504606846976) returns the obviously-bogus value (-948597
15776 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
15777 reports time overflow. See
15778 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
15779 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15780 * editfns.c: Include limits.h and intprops.h.
15781 (TIME_T_MIN, TIME_T_MAX): New macros.
15782 (time_overflow): Move earlier, to before first use.
15783 (hi_time, lo_time): New functions, for an accurate test for
15784 out-of-range times.
15785 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15786 (Fget_internal_run_time): Don't assume time_t fits in int.
15787 (make_time): Use list2 instead of Fcons twice.
15788 (Fdecode_time): More accurate test for out-of-range times.
15789 (check_tm_member): New function.
15790 (Fencode_time): Use it, to test for out-of-range times.
15791 (lisp_time_argument): Don't rely on undefined left-shift and
15792 right-shift behavior when checking for time stamp overflow.
15793
15794 * editfns.c (time_overflow): New function, refactoring common code.
15795 (Fformat_time_string, Fdecode_time, Fencode_time):
15796 (Fcurrent_time_string): Use it.
15797
15798 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15799 * dired.c (make_time): Move to ...
15800 * editfns.c (make_time): ... here.
15801 * systime.h: Note the move.
15802
15803 2011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
15804
15805 * fringe.c (update_window_fringes): Remove unused variables.
15806
15807 * unexmacosx.c (copy_data_segment): Also copy __got section.
15808 (Bug#8223)
15809
15810 2011-03-12 Eli Zaretskii <eliz@gnu.org>
15811
15812 * termcap.c [MSDOS]: Include "msdos.h".
15813 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15814 Constify `char *' arguments and their references according to
15815 prototypes in tparam.h.
15816
15817 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
15818
15819 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15820 Adapt all references accordingly.
15821
15822 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15823
15824 2011-03-11 Tom Tromey <tromey@redhat.com>
15825
15826 * buffer.c (syms_of_buffer): Remove obsolete comment.
15827
15828 2011-03-11 Eli Zaretskii <eliz@gnu.org>
15829
15830 * termhooks.h (encode_terminal_code): Declare prototype.
15831
15832 * msdos.c (encode_terminal_code): Don't declare prototype.
15833
15834 * term.c (encode_terminal_code): Now external again, used by
15835 w32console.c and msdos.c.
15836
15837 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
15838 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
15839
15840 2011-03-11 Paul Eggert <eggert@cs.ucla.edu>
15841
15842 Fix some minor problems found by GCC 4.5.2's static checks.
15843
15844 * fringe.c (update_window_fringes): Mark locals as initialized
15845 (Bug#8227).
15846 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
15847
15848 * alloc.c (mark_fringe_data): Move decl from here ...
15849 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15850 to check its interface.
15851 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15852
15853 * fontset.c (free_realized_fontset): Now static.
15854 (Fset_fontset_font): Rename local to avoid shadowing.
15855 (fontset_font): Mark local as initialized.
15856 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
15857
15858 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15859
15860 * xselect.c (x_disown_buffer_selections): Remove; not used.
15861 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
15862 (x_own_selection, Fx_disown_selection_internal): Rename locals
15863 to avoid shadowing.
15864 (x_handle_dnd_message): Remove local to avoid shadowing.
15865
15866 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15867 so that the caller can use some name other than gcpro1.
15868 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
15869 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15870 (Fx_backspace_delete_keys_p):
15871 Use them to avoid shadowing, and rename vars to avoid shadowing.
15872 (x_decode_color, x_set_name, x_window): Now static.
15873 (Fx_create_frame): Add braces to silence GCC warning.
15874 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
15875 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15876 Remove unused locals.
15877 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15878 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15879 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15880 macros.
15881
15882 * xterm.h (x_mouse_leave): New decl.
15883
15884 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15885 Remove unused functions.
15886 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15887 (x_calc_absolute_position): Now static.
15888 (XTread_socket): Don't define label "out" unless it's used.
15889 Don't declare local "event" unless it's used.
15890 (x_iconify_frame, x_free_frame_resources): Don't declare locals
15891 unless they are used.
15892 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
15893 (x_fatal_error_signal): Remove; not used.
15894 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
15895 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
15896 (x_error_catcher, x_connection_closed, x_error_handler):
15897 (x_error_quitter, xembed_send_message, x_iconify_frame):
15898 (my_log_handler): Rename locals to avoid shadowing.
15899 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
15900 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
15901
15902 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
15903 Rename or move locals to avoid shadowing.
15904 (tty_defined_color, merge_face_heights): Now static.
15905 (free_realized_faces_for_fontset): Remove; not used.
15906 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
15907 does not deduce is never used uninitialized.
15908 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
15909 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
15910
15911 * terminal.c (store_terminal_param): Now static.
15912
15913 * xmenu.c (menu_highlight_callback): Now static.
15914 (set_frame_menubar): Remove unused local.
15915 (xmenu_show): Rename parameter to avoid shadowing.
15916 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
15917 since they might point to immutable storage.
15918 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
15919 since it's unused otherwise.
15920
15921 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
15922 Add a FIXME, since the code still doesn't look right. (Bug#8215)
15923 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
15924 avoids a gcc -Wuninitialized diagnostic.
15925 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
15926 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
15927 does not deduce are never used uninitialized.
15928
15929 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
15930
15931 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
15932 * window.c (window_loop, size_window):
15933 (run_window_configuration_change_hook, enlarge_window): Likewise.
15934
15935 * window.c (display_buffer): Now static.
15936 (size_window): Mark variables that gcc -Wuninitialized
15937 does not deduce are never used uninitialized.
15938 * window.h (check_all_windows): New decl, to forestall
15939 gcc -Wmissing-prototypes diagnostic.
15940 * dispextern.h (bidi_dump_cached_states): Likewise.
15941
15942 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
15943 shadowing.
15944 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
15945 Include <limits.h>.
15946 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
15947 and to avoid gcc -Wuninitialized warning.
15948 (load_charset_map): Mark variables that gcc -Wuninitialized
15949 does not deduce are never used uninitialized.
15950 (load_charset): Abort instead of using uninitialized var (Bug#8229).
15951
15952 * coding.c (coding_set_source, coding_set_destination):
15953 Use "else { /* comment */ }" rather than "else /* comment */;"
15954 for clarity, and to avoid gcc -Wempty-body warning.
15955 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
15956 a block, when the outer 'i' will do.
15957 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
15958 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
15959 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
15960 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
15961 (Fdecode_sjis_char, Fdefine_coding_system_internal):
15962 Rename locals to avoid shadowing.
15963 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
15964 * coding.c (emacs_mule_char, encode_invocation_designation):
15965 Now static, since they're not used elsewhere.
15966 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
15967 (decode_coding_object, encode_coding_object, detect_coding_system):
15968 (decode_coding_emacs_mule): Mark variables that gcc
15969 -Wuninitialized does not deduce are never used uninitialized.
15970 (detect_coding_iso_2022): Initialize a local variable that might
15971 be used uninitialized. Leave a FIXME because it's not clear that
15972 this initialization is needed. (Bug#8211)
15973 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
15974 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
15975 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
15976 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
15977 Remove unused macros.
15978
15979 * category.c (hash_get_category_set): Remove unused local var.
15980 (copy_category_table): Now static, since it's not used elsewhere.
15981 * character.c (string_count_byte8): Likewise.
15982
15983 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
15984 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
15985
15986 * chartab.c (copy_sub_char_table): Now static, since it's not used
15987 elsewhere.
15988 (sub_char_table_ref_and_range, char_table_ref_and_range):
15989 Rename locals to avoid shadowing.
15990 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
15991
15992 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
15993 (BIDI_BOB): Remove unused macro.
15994
15995 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
15996 deduce are never used uninitialized.
15997 * term.c (encode_terminal_code): Likewise.
15998
15999 * term.c (encode_terminal_code): Now static. Remove unused local.
16000
16001 * tparam.h: New file.
16002 * term.c, tparam.h: Include it.
16003 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16004 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16005 Move these decls to tparam.h, and make them agree with what
16006 is actually in tparam.c. The previous trick of using incompatible
16007 decls in different modules does not conform to the C standard.
16008 All callers of tparam changed to use tparam's actual API.
16009 * tparam.c (tparam1, tparam, tgoto):
16010 Use const pointers where appropriate.
16011
16012 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16013 * cm.h (struct cm): Likewise.
16014 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16015 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16016 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16017 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16018 (turn_on_face, init_tty): Likewise.
16019 * termchar.h (struct tty_display_info): Likewise.
16020
16021 * term.c (term_mouse_position): Rename local to avoid shadowing.
16022
16023 * alloc.c (mark_ttys): Move decl from here ...
16024 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16025
16026 2011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16027
16028 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16029
16030 2011-03-09 Juanma Barranquero <lekktu@gmail.com>
16031
16032 * search.c (compile_pattern_1): Remove argument regp, unused since
16033 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16034 (compile_pattern): Don't pass it.
16035
16036 2011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16037
16038 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16039 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16040 for ! HAVE_GTK3.
16041 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16042
16043 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16044
16045 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16046 gdk_window_get_screen, gdk_window_get_geometry,
16047 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16048 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16049 (xg_get_pixbuf_from_pixmap): New function.
16050 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16051 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16052 Call xg_get_pixbuf_from_pixmap instead of
16053 gdk_pixbuf_get_from_drawable.
16054 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16055 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16056 (xg_check_special_colors): Use GtkStyleContext and its functions
16057 for HAVE_GTK3.
16058 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16059 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16060 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
16061 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16062 Call gtk_widget_get_preferred_size.
16063 (xg_frame_resized): gdk_window_get_geometry only takes 5
16064 parameters.
16065 (xg_win_to_widget, xg_event_is_for_menubar):
16066 Call gdk_x11_window_lookup_for_display.
16067 (xg_set_widget_bg): New function.
16068 (delete_cb): New function.
16069 (xg_create_frame_widgets): Connect delete-event to delete_cb.
16070 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
16071 (xg_set_background_color): Call xg_set_widget_bg.
16072 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16073 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16074 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16075 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16076 if ! HAVE_GTK3.
16077 (update_frame_tool_bar): Call gtk_widget_hide.
16078 (xg_initialize): Use GDK_KEY_g.
16079
16080 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16081 if ! HAVE_GTK3
16082 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16083
16084 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16085 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16086 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16087
16088 2011-03-08 Juanma Barranquero <lekktu@gmail.com>
16089
16090 * w32xfns.c (select_palette): Check success of RealizePalette against
16091 GDI_ERROR, not zero.
16092
16093 See ChangeLog.11 for earlier changes.
16094
16095 ;; Local Variables:
16096 ;; coding: utf-8
16097 ;; End:
16098
16099 Copyright (C) 2011-2012 Free Software Foundation, Inc.
16100
16101 This file is part of GNU Emacs.
16102
16103 GNU Emacs is free software: you can redistribute it and/or modify
16104 it under the terms of the GNU General Public License as published by
16105 the Free Software Foundation, either version 3 of the License, or
16106 (at your option) any later version.
16107
16108 GNU Emacs is distributed in the hope that it will be useful,
16109 but WITHOUT ANY WARRANTY; without even the implied warranty of
16110 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16111 GNU General Public License for more details.
16112
16113 You should have received a copy of the GNU General Public License
16114 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.