* lisp.h (ASET): Remove attempt to detect side effects.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
6af64513
PE
12012-08-26 Paul Eggert <eggert@cs.ucla.edu>
2
3 * lisp.h (ASET): Remove attempt to detect side effects.
4 It was meant to be temporary and it often doesn't work,
5 because when IDX has side effects the behavior of IDX==IDX
6 is undefined. See Stefan Monnier in
7 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
8
e1f29348
BR
92012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
10
11 * lisp.h (functionp): New function (extracted from Ffunctionp).
12 (FUNCTIONP): Use it.
13 * eval.c (Ffunctionp): Use it.
14
17c05d74
PE
152012-08-25 Paul Eggert <eggert@cs.ucla.edu>
16
0f46bc75
PE
17 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
18 as that's faster and simpler than static storage. Don't bother
19 with the g_main_context_query overhead if g_main_context_pending
20 says no events are pending.
21 (gfds, gfds_size): Remove these static vars.
22 (xgselect_initialize): Remove; no longer needed.
23 All uses and decls removed.
24
ee4c0f69
PE
25 * emacs.c (fatal_error_signal_hook): Remove.
26 All uses removed. This leftover from old code was always 0.
27
17c05d74
PE
28 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
29 * casefiddle.c (casify_object, casify_region):
30 * casetab.c (set_case_table):
31 * category.c, category.h (word_boundary_p):
32 * category.h (CHAR_HAS_CATEGORY):
33 Use bool for booleans, instead of int.
34
391ceac5
EZ
352012-08-25 Eli Zaretskii <eliz@gnu.org>
36
37 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
38
2f221583
PE
392012-08-25 Paul Eggert <eggert@cs.ucla.edu>
40
f4a681b0
PE
41 On assertion failure, print backtrace if available.
42 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
43 (die) [ENABLE_CHECKING]: Print a backtrace if available.
44 * Makefile.in (LIB_EXECINFO): New macro.
45 (LIBES): Use it.
46
2f221583
PE
47 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
48 * bytecode.c (exec_byte_code):
49 * callint.c (check_mark, Fcall_interactively):
50 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
51 (getenv_internal, sync_process_alive, call_process_exited):
52 * lisp.h (USE_SAFE_ALLOCA):
53 Use bool for booleans, instead of int.
54 * lisp.h, process.h: Adjust prototypes to match above changes.
55 * callint.c (Fcall_interactively): Don't assume the mark's
56 offset fits in 'int'.
57
37ef52bb
PE
582012-08-24 Paul Eggert <eggert@cs.ucla.edu>
59
60 * buffer.c, buffer.h: Use bool for boolean.
61 * buffer.c (reset_buffer_local_variables)
62 (buffer_lisp_local_variables, Fset_buffer_modified_p)
63 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
64 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
65 (overlay_touches_p, overlay_strings, Foverlay_put)
66 (report_overlay_modification, call_overlay_mod_hooks):
67 (mmap_enlarge, mmap_set_vars):
68 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
69 Use bool for booleans, instead of int.
70 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
71 since the 1-or-0 return value is always ignored anyway.
72 (mmap_initialized_p):
73 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
74 * buffer.h, lisp.h: Adjust prototypes to match above changes.
75
2cc21167
PE
762012-08-23 Paul Eggert <eggert@cs.ucla.edu>
77
78 * bidi.c: Use bool for boolean.
79 This is a bit more readable, and makes the text segment of bidi.o
80 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
81 Presumably it's faster too.
82 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
83 Now bool.
84 (bidi_cache_find_level_change, bidi_cache_iterator_state)
85 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
86 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
87 (bidi_explicit_dir_char, bidi_level_of_next_char)
88 (bidi_find_other_level_edge, bidi_move_to_visually_next):
89 Use bool for booleans, instead of int.
90 * dispextern.h (bidi_init_it, bidi_paragraph_init)
91 (bidi_unshelve_cache): Adjust decls to match code.
92
7db4ddf4
MR
932012-08-23 Martin Rudalics <rudalics@gmx.at>
94
95 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
96 argument.
97
b1bb8011
PE
982012-08-23 Paul Eggert <eggert@cs.ucla.edu>
99
100 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
101 * atimer.h: Include <stdbool.h>.
102
ff687885
DN
1032012-08-22 Dan Nicolaescu <dann@gnu.org>
104
105 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
106 compile time tests instead of run time tests on systems that do
107 not use them.
108 (FRAME_MAC_P): Remove leftover from deleted code.
109 * frame.c (syms_of_frame): Remove leftover from deleted code.
110
4ce7a138
JD
1112012-08-22 Jan Djärv <jan.h.d@swipnet.se>
112
113 * nsterm.m (insertText:): Don't clear modifiers if code is space.
114
d733ec6d
PE
1152012-08-22 Paul Eggert <eggert@cs.ucla.edu>
116
117 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
118 Otherwise, the compiler complains about (A?B:C) where B is void
119 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
120 (fontset_add): Return void, for FONTSET_ADD.
121
d0d2d26f
PE
1222012-08-21 Paul Eggert <eggert@cs.ucla.edu>
123
fce31d69
PE
124 * alloc.c: Use bool for booleans.
125 (gc_in_progress, abort_on_gc)
126 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
127 (dont_register_blocks) [GC_MALLOC_CHECK]:
128 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
129 (check_string_bytes, make_specified_string, memory_full)
130 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
131 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
132 (mark_stack, valid_pointer_p, make_pure_string)
133 (Fgarbage_collect, survives_gc_p, gc_sweep):
134 Use bool for booleans, instead of int.
135 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
136 Remove unused local.
137 * alloc.c (PURE_POINTER_P):
138 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
139 * editfns.c (Fformat):
140 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
141 (Fdo_auto_save):
142 * fns.c (sweep_weak_table):
143 * lisp.h (suppress_checking, push_message, survives_gc_p)
144 (make_pure_string, gc_in_progress, abort_on_gc):
145 * lread.c (readchar, read1):
146 * print.c (Fprin1_to_string):
147 * xdisp.c (push_message):
148 Use bool for booleans affected directly or indirectly by
149 alloc.c's changes.
150
d0d2d26f
PE
151 Make recently-introduced setters macros.
152 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
153 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
154 (set_fontset_default, set_fontset_fallback): Rename from their
155 upper-case counterparts, and make them functions rather than macros.
156 This is more consistent with the other recently-introduced setters.
157 These don't need to be inline, since they're local.
158
d18e2bb6
JD
1592012-08-21 Jan Djärv <jan.h.d@swipnet.se>
160
161 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
162 the loop (Bug#12247).
163
1b9d9d16
PE
1642012-08-21 Paul Eggert <eggert@cs.ucla.edu>
165
166 * lisp.h (vcopy): Use memcpy rather than our own loop.
167 This fixes a performance regression introduced by the recent
168 addition of vcopy. This means 'vcopy' will need to be modified
169 for a copying collector, but that's OK. Also, tighten the
170 checking in the assertion.
171
b2f09701
EZ
1722012-08-21 Eli Zaretskii <eliz@gnu.org>
173
174 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
175 components for RTL text (Bug#11860). Adjust X-OFFSET of each
176 non-base glyph for the width of the base character, according to
e1f29348
BR
177 what x_draw_composite_glyph_string_foreground expects.
178 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
179 expectations, to produce correct width of the composed character.
180 Reverse the sign of the DU offset produced by ScriptPlace.
181
9b994fed
PE
1822012-08-21 Paul Eggert <eggert@cs.ucla.edu>
183
184 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
185
086ca913
DA
1862012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
187
188 Avoid direct writes to contents member of struct Lisp_Vector.
189 * lisp.h (vcopy): New function to copy data into vector.
190 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
191 * fns.c (Ffillarray): Use ASET.
192 * keyboard.c (timer_check_2): Use AREF and ASET.
193 (append_tool_bar_item, Frecent_keys): Use vcopy.
194 * lread.c (read_vector): Use ASET.
195 * msdos.c (Frecent_doskeys): Use vcopy.
196 * xface.c (Finternal_copy_lisp_face): Use vcopy.
197 (Finternal_merge_in_global_face): Use ASET and vcopy.
198 * xfont.c (xfont_list_pattern): Likewise.
199
5481664a
MR
2002012-08-21 Martin Rudalics <rudalics@gmx.at>
201
202 * window.c (Fwindow_point): For the selected window always return
203 the position of its buffer's point.
204 (Fset_window_point): For the selected window always go in its
205 buffer to the specified position.
206
6d470bdd
DA
2072012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
208
209 Setter macros for fontsets.
210 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
211 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
212 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
213 Adjust users.
214
24564fe1
GM
2152012-08-20 Glenn Morris <rgm@gnu.org>
216
217 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
218 Don't assume that `ln -f' works.
219
0a05a035
EZ
2202012-08-20 Eli Zaretskii <eliz@gnu.org>
221
222 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
223 and later about non-assignments with no effect. See discussion at
224 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
225 details.
226
e46f2325
DA
2272012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
228
229 Inline setter functions for Lisp_Objects slots of struct specbinding.
230 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
231 Adjust users.
232
734fbd86
MR
2332012-08-20 Martin Rudalics <rudalics@gmx.at>
234
235 * window.c (select_window): Always make selected window's buffer
236 current.
237
f1a95992
DA
2382012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
239
240 Use AREF and ASET for docstrings of category tables.
241 * category.h (CATEGORY_DOCSTRING): Use AREF.
242 (SET_CATEGORY_DOCSTRING): Use ASET.
243 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
244
e83064be
DA
2452012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
246
247 Inline setter functions for hash table members.
248 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
249 (set_hash_hash, set_hash_index): Rename with _slot suffix.
250 (set_hash_key_and_value, set_hash_index, set_hash_next)
251 (set_hash_hash): New functions.
252 * charset.c, fns.c: Adjust users.
253
4ce60d2e
DA
2542012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
255
256 Inline getter and setter functions for per-buffer values.
257 * buffer.h (per_buffer_default, set_per_buffer_default)
258 (per_buffer_value, set_per_buffer_value): New functions.
259 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
260 * buffer.c, data.c: Adjust users.
261
c06c9690
JB
2622012-08-20 Juanma Barranquero <lekktu@gmail.com>
263
264 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
265
32bd4250
PE
2662012-08-19 Paul Eggert <eggert@cs.ucla.edu>
267
bad03192 268 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
269 as gnulib does this if the system doesn't.
270 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
271 Remove declaration. MS-Windows declares it on stdlib.h which is
272 included by conf_post.h.
b69a6d22
PE
273 * emacs.c (environ) [DOUG_LEA_MALLOC]:
274 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
275 * vm-limit.c: Include <unistd.h>, for 'environ'.
276
22d7feb2
PE
277 * unexaix.c, unexcoff.c: Include "mem-limits.h".
278 (start_of_data): Remove decl; mem-limits.h provides it.
279
32bd4250
PE
280 * xdisp.c (handle_invisible_prop): Make it a bit faster
281 and avoid a gcc -Wmaybe-uninitialized diagnostic.
282
450809af
CY
2832012-08-19 Chong Yidong <cyd@gnu.org>
284
285 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
286 ends (Bug#3874).
287
9e677988
AS
2882012-08-19 Andreas Schwab <schwab@linux-m68k.org>
289
6b1319ce
AS
290 * .gdbinit: Use call instead of set when calling a function in the
291 inferior.
292
9e677988
AS
293 * data.c (set_internal): Don't use set_blv_found.
294 (Fkill_local_variable): Likewise.
295
d7191076
AA
2962012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
297
298 * nsfont.m (ns_ascii_average_width): Ensure the string
299 ascii_printable is initialized with a null-terminated character
300 array. Otherwise, it can contain undesired extra characters.
301
e757f1c6
PE
3022012-08-18 Paul Eggert <eggert@cs.ucla.edu>
303
304 port new setting code to Sun C 5.8 2005/10/13
305 * chartab.c, lisp.h (char_table_set, char_table_set_range):
306 Return void, not Lisp_Object. Otherwise, the compiler
307 complains about (A?B:C) where B is void and C is Lisp_Object
308 when compiling CHAR_TABLE_SET, due to the recent change to
309 the API of sub_char_table_set_contents.
310
a999ce26
CY
3112012-08-18 Chong Yidong <cyd@gnu.org>
312
313 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
314 for the string case (Bug#3874).
315
3f22b86f
PE
3162012-08-18 Paul Eggert <eggert@cs.ucla.edu>
317
39eb03f1
PE
318 * buffer.h (BSET): Remove (Bug#12215).
319 Replace all uses with calls to new setter functions.
320 (bset_bidi_paragraph_direction, bset_case_canon_table)
321 (bset_case_eqv_table, bset_directory, bset_display_count)
322 (bset_display_time, bset_downcase_table)
323 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
324 (bset_last_selected_window, bset_local_var_alist)
325 (bset_mark_active, bset_point_before_scroll, bset_read_only)
326 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
327 (bset_width_table):
328 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
329 (bset_auto_fill_function, bset_auto_save_file_format)
330 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
331 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
332 (bset_cache_long_line_scans, bset_case_fold_search)
333 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
334 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
335 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
336 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
337 (bset_header_line_format, bset_indicate_buffer_boundaries)
338 (bset_indicate_empty_lines, bset_invisibility_spec)
339 (bset_left_fringe_width, bset_major_mode, bset_mark)
340 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
341 (bset_name, bset_overwrite_mode, bset_pt_marker)
342 (bset_right_fringe_width, bset_save_length)
343 (bset_scroll_bar_width, bset_scroll_down_aggressively)
344 (bset_scroll_up_aggressively, bset_selective_display)
345 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
346 (bset_word_wrap, bset_zv_marker):
347 * category.c (bset_category_table):
348 * syntax.c (bset_syntax_table):
349 New setter functions.
350
6a09a33b
PE
351 * process.h (PSET): Remove (Bug#12215).
352 Replace all uses with calls to new setter functions.
353 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
354 (PROCESS_INLINE): New macro.
355 (pset_childp): New setter function.
356 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
357 * process.c (PROCESS_INLINE):
358 Define to EXTERN_INLINE, so that the corresponding functions
359 are compiled into code.
360 (pset_buffer, pset_command, pset_decode_coding_system)
361 (pset_decoding_buf, pset_encode_coding_system)
362 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
363 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
364 (pset_type, pset_write_queue): New setter functions.
365
e8c17b81
PE
366 * window.h (WSET): Remove (Bug#12215).
367 Replace all uses with calls to new setter functions.
368 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
369 (WINDOW_INLINE): New macro.
370 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
371 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
372 (wset_total_lines, wset_vertical_scroll_bar)
373 (wset_window_end_pos, wset_window_end_valid)
374 (wset_window_end_vpos): New setter functions.
375 * window.c (WINDOW_INLINE):
376 Define to EXTERN_INLINE, so that the corresponding functions
377 are compiled into code.
378 (wset_combination_limit, wset_dedicated, wset_display_table)
379 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
380 (wset_new_normal, wset_new_total, wset_next_buffers)
381 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
382 (wset_prev_buffers, wset_right_fringe_width)
383 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
384 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
385 (wset_window_parameters):
386 * xdisp.c (wset_base_line_number, wset_base_line_pos)
387 (wset_column_number_displayed, wset_region_showing):
388 New setter functions.
389
3f22b86f
PE
390 * termhooks.h (TSET): Remove (Bug#12215).
391 Replace all uses with calls to new setter functions.
392 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
393 (TERMHOOKS_INLINE): New macro.
394 (tset_charset_list, tset_selection_alist): New setter functions.
395 * terminal.c (TERMHOOKS_INLINE):
396 Define to EXTERN_INLINE, so that the corresponding functions
397 are compiled into code.
398 (tset_param_alist): New setter function.
399
742af32f
PE
4002012-08-17 Paul Eggert <eggert@cs.ucla.edu>
401
15dbb4d6
PE
402 * keyboard.h (KSET): Remove (Bug#12215).
403 Replace all uses with calls to new setter functions.
404 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
405 (KEYBOARD_INLINE): New macro.
406 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
407 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
408 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
409 New setter functions.
410 * keyboard.c (KEYBOARD_INLINE):
411 Define to EXTERN_INLINE, so that the corresponding functions
412 are compiled into code.
413 (kset_echo_string, kset_kbd_queue)
414 (kset_keyboard_translate_table, kset_last_prefix_arg)
415 (kset_last_repeatable_command, kset_local_function_key_map)
416 (kset_overriding_terminal_local_map, kset_real_last_command)
417 (kset_system_key_syms): New setter functions.
418
f00af5b1
PE
419 * frame.h (FSET): Remove (Bug#12215).
420 Replace all uses with calls to new setter functions.
421 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
422 (FRAME_INLINE): New macro.
423 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
424 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
425 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
426 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
427 (fset_param_alist, fset_root_window, fset_scroll_bars)
428 (fset_selected_window, fset_title, fset_tool_bar_items)
429 (fset_tool_bar_position, fset_tool_bar_window): New functions.
430 * frame.c (FRAME_INLINE):
431 Define to EXTERN_INLINE, so that the corresponding functions
432 are compiled into code.
433 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
434
0c94c8d6
PE
435 A few more naming-convention fixes for getters and setters.
436 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
437 and rename from buffer_overlays_set_before.
438 (set_buffer_overlays_after): Move here from buffer.h, and rename
439 from buffer_overlays_set_after.
440 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
441 All uses changed.
442 (set_buffer_intervals): Rename from buffer_set_intervals.
443 * intervals.c (set_interval_object): Move here from intervals.h,
444 and rename from interval_set_object.
445 (set_interval_left): Move here from intervals.h, and rename from
446 interval_set_left.
447 (set_interval_right): Move here from intervals.h, and rename from
448 interval_set_right.
449 (copy_interval_parent): Move here from intervals.h, and rename from
450 interval_copy_parent.
451 * intervals.h (set_interval_parent): Rename from interval_set_parent.
452 (set_interval_plist): Rename from interval_set_plist.
453 Return void, not Lisp_Object, since no caller uses the result.
454 * lisp.h (string_intervals): Rename from string_get_intervals.
455 (set_string_intervals): Rename from string_set_intervals.
456
34dabdb7
PE
457 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
458 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 459 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
460 All uses changed. See the end of
461 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
462
742af32f
PE
463 * lisp.h (CSET): Remove (Bug#12215).
464 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
465 (set_char_table_purpose): New functions,
466 replacing CSET. All uses changed. For example, replace
467 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 468 "set_char_table_parent (char_table, parent);".
742af32f
PE
469 The old version was confusing because it used the same name
470 'parent' for two different things.
471
a04e2c62
DA
4722012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
473
474 Functions to get and set Lisp_Object fields of buffer-local variables.
475 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
476 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
477 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
478 * data.c, eval.c, frame.c: Adjust users.
479
383dcbf9
CY
4802012-08-17 Chong Yidong <cyd@gnu.org>
481
482 * xfaces.c (merge_face_vectors): If the target font specfies a
483 font spec, make the font's attributes take precedence over
484 directly-specified attributes.
485 (merge_face_ref): Recognize :font.
486
44386687
DA
4872012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
488
489 Do not use memcpy for copying intervals.
490 * intervals.c (reproduce_interval): New function.
491 (reproduce_tree, reproduce_tree_obj): Use it.
492 (reproduce_tree_obj): Remove prototype.
493
927c7216
PE
4942012-08-17 Paul Eggert <eggert@cs.ucla.edu>
495
496 * lisp.h (duration_to_sec_usec): Remove unused decl.
497
93044f7b
AA
4982012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
499
500 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
501 to an allocated instance of NSString, not to the class itself.
502
9851e4a5
JB
5032012-08-17 Juanma Barranquero <lekktu@gmail.com>
504
505 * makefile.w32-in (C_CTYPE_H): New macro.
506 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
507 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
508 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
509
620f13b0
PE
5102012-08-16 Paul Eggert <eggert@cs.ucla.edu>
511
512 Use ASCII tests for character types.
513 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
514 * xfns.c, xterm.c:
515 Don't include <ctype.h>; was not needed.
516 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
517 * sysdep.c, xfaces.c:
518 Include <c-ctype.h> instead of <ctype.h>.
519 * nsterm.m: Include <c-ctype.h>.
520 * charset.c (read_hex):
521 * doc.c (Fsnarf_documentation):
522 * fileio.c (IS_DRIVE) [WINDOWSNT]:
523 (DRIVE_LETTER) [DOS_NT]:
524 (Ffile_name_directory, Fexpand_file_name)
525 (Fsubstitute_in_file_name):
526 * font.c (font_parse_xlfd, font_parse_fcname):
527 * frame.c (x_set_font_backend):
528 * gtkutil.c (xg_get_font):
529 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
530 * nsimage.m (hexchar):
531 * nsterm.m (ns_xlfd_to_fontname):
532 * sysdep.c (system_process_attributes):
533 * xfaces.c (hash_string_case_insensitive):
534 Use C-locale tests instead of locale-specific tests for character
535 types, since we want the ASCII interpretation here, not the
536 interpretation suitable for whatever happens to be the current locale.
537
52162052
MR
5382012-08-16 Martin Rudalics <rudalics@gmx.at>
539
540 Consistently check windows for validity/liveness
541 (Bug#11984, Bug#12025, Bug#12026).
542 * lisp.h (CHECK_VALID_WINDOW): New macro.
543 * window.c (decode_window): Rename to decode_live_window.
544 (decode_valid_window, Fwindow_valid_p): New functions.
545 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
546 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
547 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
548 (Fwindow_prev_sibling, Fwindow_combination_limit)
549 (Fset_window_combination_limit, Fwindow_use_time)
550 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
551 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
552 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
553 (Fwindow_hscroll, Fset_window_hscroll)
554 (Fwindow_redisplay_end_trigger)
555 (Fset_window_redisplay_end_trigger, Fwindow_edges)
556 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
557 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
558 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
559 (Fwindow_end, Fset_window_point, Fset_window_start)
560 (Fpos_visible_in_window_p, Fwindow_line_height)
561 (Fwindow_dedicated_p, Fset_window_dedicated_p)
562 (Fwindow_prev_buffers, Fset_window_prev_buffers)
563 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
564 (Fset_window_parameter, Fwindow_display_table)
565 (Fset_window_display_table, Fdelete_other_windows_internal)
566 (Fset_window_buffer, Fset_window_new_total)
567 (Fset_window_new_normal, Fdelete_window_internal)
568 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
569 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
570 (Fwindow_scroll_bars): Check whether argument window is a valid or
571 live window. Update doc-strings.
572 (syms_of_window): New symbol Qwindow_valid_p.
573 * keyboard.c (Fposn_at_x_y): Check whether argument
574 frame_or_window denotes a valid window.
575
2751c80f
DA
5762012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
577
578 Fix previous char table change.
579 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
580 * chartab.c (optimize_sub_char_table): Likewise.
581
032a42c8
CY
5822012-08-16 Chong Yidong <cyd@gnu.org>
583
a2d19368
CY
584 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
585
032a42c8
CY
586 * xfont.c (xfont_open):
587 * xftfont.c (xftfont_open): Set the font's max_width field.
588
589 * nsfont.m (nsfont_open): Similar to the Xft backend, set
590 min_width to space_width and average_width to the average over
591 printable ASCII characters.
592 (ns_char_width): Code cleanup.
593 (ns_ascii_average_width): New utility function.
594
595 * font.h (struct font): Update comments.
596
a098c930
DA
5972012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
598
032a42c8 599 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
600 * lisp.h (CSET): New macro.
601 (char_table_set_extras, char_table_set_contents)
602 (sub_char_table_set_contents): New function.
603 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
604 * syntax.c: Adjust users.
605
8be3a09c
SM
6062012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
607
608 * eval.c (eval_sub): Bind lexical-binding.
609 * lread.c (Qlexical_binding): Make non-static.
610
ac4845a6
JD
6112012-08-15 Jan Djärv <jan.h.d@swipnet.se>
612
ddee6515
JD
613 * nsmenu.m (popupSession): Remove.
614 (pop_down_menu): Remove endModalSession.
615 (timeout_handler:): New method.
616 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
617 Call runModalForWindow. Check timer_fired when it returns.
618 If not set, cancel timer and break out of loop.
619 Otherwise loop again, with a new timeout.
620
621 * nsterm.m: Include fcntl.h if present.
622 (fd_entry, t_readfds, inNsSelect): Remove.
623 (select_writefds, select_valid, select_timeout, selfds)
624 (select_mutex, apploopnr): Add.
625 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
626 Otherwise call kbd_buffer_store_event.
627 (ns_send_appdefined): Remove release of fd_entry.
628 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
629 Increment and decrement apploopnr.
630 (ns_select): If no file descriptors, just do a NSTimer.
631 Otherwise copy read/write masks and start select thread (fd_handler).
632 Start main loop and wait for application defined event.
633 Inform select thread to stop selecting after main loop is exited.
634 (ns_term_init): Create selfds pipe and set non-blocking.
635 Initialize select_mutex. Start the select thread (fd_handler).
636 (fd_handler:): Loop forever, wait for info from the main thread
637 to either start or stop selecting. When select returns, send
638 and appdefined event.
639 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
640 If not call kbd_buffer_store_event.
641
642 * nsterm.h (EmacsApp): fd_handler takes id argument.
643 (EmacsDialogPanel): Add timer_fired and timeout_handler.
644
ac4845a6
JD
645 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
646
eb424fe3
EZ
6472012-08-15 Eli Zaretskii <eliz@gnu.org>
648
649 * region-cache.c (move_cache_gap): Update gap_len using the actual
650 growth of the boundaries array. Do not change cache_len.
651 (Bug#12196)
652
4e6a86c6
DA
6532012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
654
655 Generalize and cleanup font subsystem checks.
656 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
657 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
658 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 659
5bf192ca
DA
6602012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
661
662 * gtkutil.c (xg_get_font): Use pango_units_to_double.
663
f2045622
CY
6642012-08-15 Chong Yidong <cyd@gnu.org>
665
8be3a09c
SM
666 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
667 When using the new font chooser, use gtk_font_chooser_get_font_desc to
668 extract the font descriptor instead of just the font name.
669 In that case, return a font spec instead of a string.
f2045622
CY
670 (x_last_font_name): Move to this file from xfns.c.
671
672 * xfns.c (Fx_select_font): The return value can also be a font
673 spec. Move x_last_font_name management to gtkutil.c.
674
675 * xfaces.c: Make font weight and style symbols non-static.
676
7f6feb56
SM
6772012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
678
679 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
680 (bug#12117).
681
fecbd8ff
SM
6822012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
683
684 * alloc.c (Fgarbage_collect): Use plural form consistently.
685
9b8d5165
EZ
6862012-08-14 Eli Zaretskii <eliz@gnu.org>
687
688 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
689 iteration through the command loop. Fixes a problem whereby mouse
690 movements are ignored until the first mouse click.
691
f5d9e83a
PE
6922012-08-14 Paul Eggert <eggert@cs.ucla.edu>
693
694 Use bool, not int, for Lisp booleans.
695 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
696 makes Emacs a bit smaller and presumably a bit faster.
697 * lisp.h: Include <stdbool.h>.
698 (struct Lisp_Boolfwd, defvar_bool):
699 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
700 * regex.c [!emacs]: Include <stdbool.h>.
701 (false, true): Remove; <stdbool.h> does this for us now.
702
55802e4a
CY
7032012-08-14 Chong Yidong <cyd@gnu.org>
704
4abcdac8
CY
705 * character.c (Fcharacterp): Doc fix (Bug#12076).
706
707 * data.c (Findirect_variable): Doc fix (Bug#11040).
708
55802e4a
CY
709 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
710
711 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 712 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 713
8e99d072
BR
7142012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
715
716 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
717 (bug#12022).
718
08908aca
MR
7192012-08-14 Martin Rudalics <rudalics@gmx.at>
720
721 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
722 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
723 * minibuf.c (choose_minibuf_frame, read_minibuf):
724 * w32fns.c (x_create_tip_frame):
725 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
726 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
727
56120d6f
PE
7282012-08-14 Paul Eggert <eggert@cs.ucla.edu>
729
730 * intervals.c (offset_intervals): Remove obsolete comment.
731
67b77c0b
AS
7322012-08-14 Andreas Schwab <schwab@linux-m68k.org>
733
734 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
735
f48b82fd
GR
7362012-08-14 Gergely Risko <gergely@risko.hu>
737
738 * coding.c (decode_coding): Record buffer modification before
739 disabling undo_list (Bug#11773).
740
fd318b54
DA
7412012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
742
743 Revert and cleanup some recent overlay changes.
744 * buffer.h (enum overlay_type): Remove.
745 (buffer_get_overlays, buffer_set_overlays): Likewise.
746 (buffer_set_overlays_before, buffer_set_overlays_after):
747 New function. Adjust users.
748 (unchain_both): Add eassert.
749
41a62dd9
DA
7502012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
751
752 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
753
5884c324
PE
7542012-08-14 Paul Eggert <eggert@cs.ucla.edu>
755
756 * gtkutil.c (xg_mark_data): Don't assume C99.
757
ca06f160
JD
7582012-08-13 Jan Djärv <jan.h.d@swipnet.se>
759
760 * gtkutil.c (xg_frame_tb_info): New struct.
761 (TB_INFO_KEY): New define.
762 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
763 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
764 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
765 if not present.
766 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
767 is up to date. Otherwise store new data.
768 (free_frame_tool_bar): Free xg_frame_tb_info if present.
769
7864a3f7
DA
7702012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
771
772 Use KSET for write access to Lisp_Object members of struct kboard.
773 * keyboard.h (KSET): New macro.
774 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
775 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
776 * xterm.c: Adjust users.
777
4c31be61
DA
7782012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
779
780 Use BSET for write access to Lisp_Object members of struct buffer.
781 * buffer.h (BSET): New macro.
782 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
783 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
784 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
785 * window.c, xdisp.c, xfns.c: Adjust users.
786
14ae4239
BT
7872012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
788
789 * lread.c (syms_of_lread): Initialize Vlexical_binding.
790
32bcadb4
JD
7912012-08-11 Jan Djärv <jan.h.d@swipnet.se>
792
3d29b2ce
JD
793 * nsterm.m (not_in_argv): New function.
794 (application:openFile, application:openTempFile:):
795 (application:openFileWithoutUI:, application:openFiles:): Open file
796 if not_in_argv returns non-zero (bug#12171).
797
32bcadb4 798 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
799 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
800 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
801 (xg_get_font_name): Use those functions/macros here.
802 Reported by Frans Oilinki <moilinki@gmail.com>.
803
9ff9402d 8042012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
805
806 * unexmacosx.c (copy_data_segment): Copy initialized data in
807 statically linked libraries from input file rather than memory.
808
db74a5fc
YM
809 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
810 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
811 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
812
25e65510
GM
8132012-08-10 Glenn Morris <rgm@gnu.org>
814
815 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
816 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
817
7961135c
DA
8182012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
819
820 Fix last change to allow compilation with low optimization levels.
821 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
822 Reported by Jan Djärv <jan.h.d@swipnet.se>.
823
42b3a444
DA
8242012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
825
826 Use common inline syntax in intervals.h.
827 * intervals.h (INTERVALS_INLINE): New macro.
828 Change all users from LISP_INLINE.
829
9fb0c957
DA
8302012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
831
832 Define Qnone once for all platforms.
833 * frame.c (Qnone): Define here.
834 (syms_of_frame): DEFSYM it.
835 * lisp.h (Qnone): New declaration.
836 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
837 * xfns.c: Remove duplication. Adjust users.
838
65e8ee52
DA
8392012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
840
841 Remove unused macros from intervals.h.
842 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
843 * intervals.c: Adjust comment.
844
9b855fd6
EZ
8452012-08-10 Eli Zaretskii <eliz@gnu.org>
846
847 * w32fns.c <w32_unicode_gui>: New static variable.
848 (globals_of_w32fns): Initialize it according to os_subtype.
849 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
850 testing os_subtype.
851
39cb9e56 8522012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
853 Eli Zaretskii <eliz@gnu.org>
854
855 Fix bug #10299 with Unicode characters sent by customized
856 keyboards created by MSKLC.
857 * w32fns.c (INIT_WINDOW_CLASS): New macro.
858 (w32_init_class): Use it to initialize the Emacs class with either
859 ANSI or Unicode API calls.
860 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
861 later.
862 (w32_wnd_proc): If the character code sent by WM_CHAR or
863 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
864 original message. Call DefWindowProcW on NT and later.
865
9374581a
GM
8662012-08-10 Glenn Morris <rgm@gnu.org>
867
4b94e8cf
GM
868 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
869
9374581a
GM
870 * lisp.h (DIRECTORY_SEP): Let configure set it.
871
a2752828
DA
8722012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
873
874 Use TSET for write access to Lisp_Object slots of struct terminal.
875 * termhooks.h (TSET): New macro.
876 * coding.c, terminal.c, xselect.c: Adjust users.
877
cc92c454
SM
8782012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
879
880 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
881 the failing expression, include them in the error message.
882 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
883 * lisp.h (internal_condition_case_n): Update declaration.
884
4cb3e6b3
DA
8852012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
886
887 Inline functions to examine and change buffer overlays.
888 * buffer.c (unchain_both): New function.
889 * buffer.h (buffer_get_overlays, buffer_set_overlays):
890 (buffer_has_overlays): New function.
891 (enum overlay_type): New enum.
892 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
893 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
894
8707c1e5
DA
8952012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
896
897 Inline functions to examine and change buffer intervals.
898 * alloc.c (mark_interval_tree): Remove.
899 (MARK_INTERVAL_TREE): Simplify.
900 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
901 * intervals.c (buffer_balance_intervals): New function.
902 (graft_intervals_into_buffer): Adjust indentation.
903 (set_intervals_multibyte): Simplify.
904 * buffer.h (BUF_INTERVALS): Remove.
905 (buffer_get_intervals, buffer_set_intervals): New function.
906 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
907 * intervals.c, textprop.c: Adjust users.
908
ad8c997f
DA
9092012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
910
911 Inline functions to examine and change string intervals.
912 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
913 (string_get_intervals, string_set_intervals): New function.
914 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
915 * lread.c, print.c, textprop.c: Adjust users.
916
32ac3a6b
GM
9172012-08-08 Glenn Morris <rgm@gnu.org>
918
919 * lisp.mk (lisp): Remove language/persian.elc.
920
77c7bcb1
DA
9212012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
922
923 Cleanup intervals.
924 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
925 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
926 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
927 Adjust comment. Move under #if 0.
77c7bcb1
DA
928 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
929 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
930
9c08a8d4
DA
9312012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
932
933 Check total length of intervals with eassert.
934 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
935 * intervals.c: Change all users to eassert.
936
26d16b35
EZ
9372012-08-07 Eli Zaretskii <eliz@gnu.org>
938
14ae4239
BT
939 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
940 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
941 INTERNAL_FIELD in Lisp_Cons.
942
c644523b
DA
9432012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
944
945 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
946 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
947 name since all xname users are fixed long time ago. Do not
948 use INTERNAL_FIELD.
949 (set_symbol_name, set_symbol_function, set_symbol_plist):
950 (set_symbol_next, set_overlay_plist): New function.
951 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
952 (struct Lisp_Overlay): Likewise.
953 (CVAR, MVAR, SVAR): Remove.
954 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
955 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
956 * xterm.c: Adjust users.
957 * .gdbinit: Change to use name field of struct Lisp_Symbol
958 where appropriate.
959
6a3d20cc
DA
9602012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
961
962 Basic functions to set Lisp_Object and pointer slots of intervals.
963 * intervals.h (interval_set_parent, interval_set_object):
964 (interval_set_left, interval_set_right, interval_set_plist):
965 (interval_copy_parent): New function.
966 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
967 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
968 Adjust indentation.
6a3d20cc
DA
969 (INTERVAL_SIZE): Remove. Adjust users.
970 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
971
4d2b044c
DA
9722012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
973
974 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
975 * process.h (PGET): Remove.
976 (struct Lisp_Process): Do not use INTERNAL_FIELD.
977 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
978
d3d50620
DA
9792012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
980
981 Drop WGET and revert read access to Lisp_Objects slots of struct window.
982 * window.h (WGET): Remove.
983 (struct window): Do not use INTERNAL_FIELD.
984 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
985 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
986 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
987 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
988 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
989 Adjust users.
990
d10a51dc
CY
9912012-08-07 Chong Yidong <cyd@gnu.org>
992
993 * window.c (Fwindow_edges, Fwindow_pixel_edges)
994 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
995 (Fdelete_window_internal): Signal an error if the window is not on
996 a live frame (Bug#12025).
997
e69b0960
DA
9982012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
999
1000 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1001 * frame.h (FGET): Remove.
1002 (struct frame): Do not use INTERNAL_FIELD.
1003 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1004 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1005 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1006 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1007
25a20a3a
JB
10082012-08-06 Juanma Barranquero <lekktu@gmail.com>
1009
1010 * w32.c: Silence compiler warnings.
1011 (map_w32_filename): Remove unused variable `is_fat'.
1012 (chase_symlinks): Add parentheses around expression.
1013
1c6f11f4
GM
10142012-08-06 Glenn Morris <rgm@gnu.org>
1015
1db4583a
GM
1016 * sysdep.c: Respect BROKEN_GETWD.
1017
1c6f11f4
GM
1018 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1019 Let configure handle it.
1020 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1021
2b90362b
DA
10222012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1023
1024 Use GCALIGNMENT where appropriate.
1025 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1026 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1027 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1028
5f50daf2
EZ
10292012-08-06 Eli Zaretskii <eliz@gnu.org>
1030
14ae4239
BT
1031 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1032 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 1033
cbcc7007
SM
10342012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1035
1036 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1037 that should be sufficient for everyone.
1038
4d365fa4
JD
10392012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1040
1041 * keyboard.c (timer_check_2): Add break so timer_check returns next
1042 timeout.
1043
dd86bd82
DA
10442012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1045
1046 Fix Windows build errors introduced after converting to WGET and WSET.
1047 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1048 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1049
054e1668
JD
10502012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1051
1052 * nsterm.m (ns_frame_rehighlight): Use FSET.
1053
1054 * nsmenu.m (ns_update_menubar): Use FSET.
1055
21238f11
DA
10562012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1057
1058 Separate read and write access to Lisp_Object slots of Lisp_Process.
1059 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1060 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1061
077288cf
DA
10622012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1063
1064 Separate read and write access to Lisp_Object slots of struct window.
1065 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1066 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1067 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1068 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1069 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1070 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1071 Adjust users.
1072
71688bd7
DA
10732012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1074
1075 Fix Windows build errors introduced after converting to FGET and FSET.
1076 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1077 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1078 (w32_judge_scroll_bars): Change to use FSET.
1079 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1080
f99bac93
DA
10812012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1082
1083 Fix replacement typo.
1084 * window.c (replace_window): Set root_window instead of
1085 selected_window. This fixes a total window subsystem
1086 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1087
8c2a0f2d
GM
10882012-08-06 Glenn Morris <rgm@gnu.org>
1089
1090 * lisp.mk (lisp): Add language/persian.elc.
1091
edd74c35
DA
10922012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1093
1094 Separate read and write access to Lisp_Object slots of struct frame.
1095 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1096 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1097 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1098 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1099 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1100
8671676c
AS
11012012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1102
1103 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1104
663e2b3f
DA
11052012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1106
1107 Generalize common compile-time constants.
1108 * lisp.h (header_size, bool_header_size, word_size): Now here.
1109 (struct Lisp_Vector): Add comment.
1110 (struct Lisp_Bool_Vector): Move up to define handy constants.
1111 (VECSIZE, PSEUDOVECSIZE): Simplify.
1112 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1113 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1114 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1115 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1116 * xfont.c, xmenu.c: Use word_size where appropriate.
1117
d32e47af
LM
11182012-08-05 Lawrence Mitchell <wence@gmx.li>
1119
1120 * search.c (Freplace_match): Treat \? in the replacement text
1121 literally (Bug#8161).
1122
e5d9c0d1
CY
11232012-08-05 Chong Yidong <cyd@gnu.org>
1124
1125 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1126 * frame.c (Vdelete_frame_functions):
1127 * emacs.c (Vkill_emacs_hook): Doc fix.
1128
8da0576b
EZ
11292012-08-04 Eli Zaretskii <eliz@gnu.org>
1130
1131 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1132 --with-x-toolkit=no builds.
1133 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1134
02676e5d
CY
11352012-08-04 Chong Yidong <cyd@gnu.org>
1136
1137 * syntax.c (Fmodify_syntax_entry): Doc fix.
1138
97147da9
EZ
11392012-08-04 Eli Zaretskii <eliz@gnu.org>
1140
76151e2c
EZ
1141 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1142 * w32.c (init_environment): Change the default values of many
1143 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
1144 them into environment when they were not already defined.
1145 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 1146 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
1147 (check_windows_init_file): Now external, not static.
1148 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
1149 called when Vload_path is already set up.
1150
1151 * w32.h (check_windows_init_file): Add prototype.
1152
1153 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1154 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1155 compatibility with Posix platforms.
1156 (main): Move the call to check_windows_init_file to here from
1157 w32.c.
1158 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1159 any, in the DEFALT argument into the root of the Emacs build or
1160 installation tree, as appropriate.
1161
1162 * callproc.c (init_callproc_1): Call decode_env_path instead of
1163 doing its equivalent by hand.
1164 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1165 the code that sets Vexec_path run on MS-Windows.
1166
1167 * lread.c (init_lread): Add comments to #ifdef's.
1168
97147da9
EZ
1169 * msdos.c (dos_set_window_size, IT_update_begin)
1170 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1171 instead of direct references.
1172
185ee146
PE
11732012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1174
1175 Export DEFAULT_REHASH_* to GDB.
1176 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1177 Now constants, not macros.
1178
8834c57a
PE
11792012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1180
98c6f1e3
PE
1181 Remove unnecessary casts involving pointers.
1182 These casts are no longer needed now that we assume C89 or later,
1183 since they involve casting to or from void *.
1184 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1185 (make_pure_float, make_pure_vector):
1186 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1187 * macros.c (Fstart_kbd_macro):
1188 * menu.c (find_and_return_menu_selection):
1189 * minibuf.c (read_minibuf_noninteractive):
1190 * sysdep.c (closedir):
1191 * xdisp.c (x_produce_glyphs):
1192 * xfaces.c (compare_fonts_by_sort_order):
1193 * xfns.c (x_real_positions, select_visual):
1194 * xselect.c (x_stop_queuing_selection_requests)
1195 (x_get_window_property, x_get_window_property_as_lisp_data):
1196 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1197 Remove unnecessary pointer casts.
1198 * alloc.c (record_xmalloc): New function.
1199 * lisp.h (record_xmalloc): New decl.
1200 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1201 more like a function. This is because the pointer cast is not
1202 needed. All uses changed.
1203 * print.c (print_string, print_error_message): Avoid length recalc.
1204
8834c57a
PE
1205 Improve fix for macroexp crash with debugging (Bug#12118).
1206 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1207 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1208 not supposed to be invoked from the garbage collector.
1209 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1210 (gc_aset): New function, which is like ASET but can be
1211 used in the garbage collector.
1212 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1213 (set_hash_index): Use it instead of ASET.
1214
6dad7178
EZ
12152012-08-03 Eli Zaretskii <eliz@gnu.org>
1216
1217 Support symlinks on latest versions of MS-Windows.
1218 * w32.c: Include winioctl.h and aclapi.h.
1219 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1220 (revert_to_self): Forward declarations of static functions.
1221 <static BOOL g_b_init_get_security_info>:
1222 <g_b_init_create_symbolic_link>: New static flags.
1223 (globals_of_w32): Initialize them to zero.
1224 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1225 (map_w32_filename): Improve commentary. Simplify switch.
1226 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1227 headers (most versions of MinGW w32api don't).
1228 (get_security_info, create_symbolic_link)
1229 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1230 New functions.
1231 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1232 in the argument file name.
1233 (sys_access): Call unc_volume_file_attributes only if
1234 GetFileAttributes fails with network-related error codes.
1235 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1236 have the required privileges.
14ae4239 1237 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
1238 get_file_security_desc.
1239 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
1240 with addition of handling of symlinks and support for 'lstat'.
1241 If possible, get file's attributes and security information by
6dad7178
EZ
1242 handle, not by name. Produce S_IFLNK bit for symlinks, when
1243 called from 'lstat'.
1244 (stat, lstat): New functions, call 'stat_worker'.
1245 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1246 symlinks when the underlying filesystem supports them.
1247
f162bcc3
PE
12482012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1249
79ea6c20
PE
1250 Fix macroexp crash on Windows with debugging (Bug#12118).
1251 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1252 checking subscripts; problem introduced with the recent
1253 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1254 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1255 since it's used in non-static inline functions now.
1256
c0ce93fd
PE
1257 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1258 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 1259
f162bcc3
PE
1260 Use C99-style 'extern inline' if available.
1261 * buffer.h (BUFFER_INLINE):
1262 * category.h (CATEGORY_INLINE):
1263 * character.h (CHARACTER_INLINE):
1264 * charset.h (CHARSET_INLINE):
1265 * composite.h (COMPOSITE_INLINE):
1266 * dispextern.h (DISPEXTERN_INLINE):
1267 * lisp.h (LISP_INLINE):
1268 * systime.h (SYSTIME_INLINE):
1269 New macro, replacing 'static inline' in this header.
1270 * buffer.h, category.h, character.h, charset.h, composite.h:
1271 * dispextern.h, lisp.h, systime.h:
1272 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1273 * alloc.c (LISP_INLINE):
1274 * buffer.c (BUFFER_INLINE):
1275 * category.c (CATEGORY_INLINE):
1276 * character.c (CHARACTER_INLINE):
1277 * charset.c (CHARSET_INLINE):
1278 * composite.c (COMPOSITE_INLINE):
1279 * dispnew.c (DISPEXTERN_INLINE):
1280 * sysdep.c (SYSTIME_INLINE):
1281 Define to EXTERN_INLINE, so that the corresponding functions
1282 are compiled into code.
1283 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1284 (INLINE_HEADER_END): New macros.
1285 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1286 since it's used in non-static inline functions now.
a8333d03 1287 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 1288
837b365b
GM
12892012-08-02 Glenn Morris <rgm@gnu.org>
1290
d66b744d
GM
1291 * s/: Remove empty directory.
1292
837b365b
GM
1293 * s/ms-w32.h: Move to ../nt/inc.
1294 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1295 Update for new ms-w32.h location.
1296
13294f95
PE
12972012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1298
1299 Port to Solaris 8.
1300 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1301
90df0db3
GM
13022012-08-02 Glenn Morris <rgm@gnu.org>
1303
1304 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1305 hard-coding the path separator.
1306
4939150c
PE
13072012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1308
1309 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1310 This how ASET and AREF are supposed to work, and makes
1311 it easier to think about future improvements. See
1312 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1313 * charset.h (set_charset_attr): New function.
1314 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1315 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1316 (aref_addr): New function. All uses of &AREF(...) changed.
1317 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1318 (set_hash_index): New functions. All lvalue-style uses of
1319 HASH_KEY etc. changed.
1320 * keyboard.c (set_prop): New function. All lvalue-style uses
1321 of PROP changed.
1322
947b2afd
AA
13232012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1324
1325 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1326 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1327 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1328 * nsfns.m (ns_set_name_as_filename): Likewise.
1329 * nsmenu.m (ns_update_menubar): Likewise.
1330 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1331
4f5d0325
EZ
13322012-08-01 Eli Zaretskii <eliz@gnu.org>
1333
2008beae
EZ
1334 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1335 Adapt to latest changes in field names of the corresponding Lisp
288479f6 1336 objects.
2008beae 1337
4f5d0325
EZ
1338 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1339
fe3cc771
GM
13402012-08-01 Glenn Morris <rgm@gnu.org>
1341
1342 * s/msdos.h: Remove file.
1343 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1344 * Makefile.in (S_FILE): Remove.
1345 (config_h): Remove S_FILE.
1346
c90acc54
JB
13472012-08-01 Juanma Barranquero <lekktu@gmail.com>
1348
1349 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1350 Remove; moved to nt/config.nt.
1351
d8a05828
DA
13522012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1353
1354 Use INTERNAL_FIELD for conses and overlays.
1355 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1356 Remove obsolete comment.
1357 (MVAR): New macro.
1358 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1359 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1360
8271d590
DA
13612012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1362
1363 Use INTERNAL_FIELD for symbols.
1364 * lisp.h (SVAR): New macro. Adjust users.
1365 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1366 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1367
3193acd2
DA
13682012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1369
1370 Use INTERNAL_FIELD for processes.
1371 * process.h (PVAR): New macro. Adjust style.
1372 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1373 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1374
3a45383a
DA
13752012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1376
1377 Use INTERNAL_FIELD for windows.
1378 * window.h (WVAR): New macro.
1379 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1380 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1381 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1382 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1383 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1384 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1385
c1dbc63c
PE
13862012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1387
1388 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1389
5c0c0e8a
GM
13902012-08-01 Glenn Morris <rgm@gnu.org>
1391
1392 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1393 Move to configure.ac.
1394
552a99b4
JB
13952012-08-01 Juanma Barranquero <lekktu@gmail.com>
1396
1397 * makefile.w32-in (CONFIG_H): Update dependencies.
1398 (CONF_POST_H): New macro.
1399
1400 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1401
8d8e2dfe
GM
14022012-07-31 Glenn Morris <rgm@gnu.org>
1403
bc96620a
GM
1404 * Makefile.in (S_FILE): No longer set by configure.
1405
476b1b2d
GM
1406 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1407 is available.
1408 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1409
b2c7a106
GM
1410 * process.h (NULL_DEVICE):
1411 * emacs.c (SEPCHAR):
1412 * editfns.c (USER_FULL_NAME): Let configure set them.
1413
d53d062a
GM
1414 * s/README, s/template.h: Remove files.
1415
4515017f
GM
1416 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1417
8d8e2dfe
GM
1418 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1419 Move to configure.ac.
1420
5b20b3cc
EZ
14212012-07-31 Eli Zaretskii <eliz@gnu.org>
1422
1e0afd9a
EZ
1423 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1424 resulting renaming of 'struct frame' members.
1425
5b20b3cc
EZ
1426 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1427
1428 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1429 after introduction of FVAR.
1430
f1310128
JD
14312012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1432
79e721e0
JD
1433 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1434
1435 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1436 instead of compositeToPoint.
1437 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1438
8d7c7eed 1439 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 1440
e34f7f79
DA
14412012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1442
1443 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1444 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 1445 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
1446 (BVAR): Change to use INTERNAL_FIELD.
1447 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1448 (KVAR): Change to use INTERNAL_FIELD.
1449 * frame.h (FVAR): New macro.
1450 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
1451 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1452 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1453 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
1454 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1455
c09bfb2f
DA
14562012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1457
1458 Miscellaneous fixes for non-default X toolkits.
1459 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1460 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1461 Move under #ifdef USE_LUCID.
1462 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1463 definition and usage to avoid warnings.
1464
14c114ae
JD
14652012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1466
1467 * nsterm.m (openFiles): Fix previous checkin.
1468
3bd21e82
PE
14692012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1470
1471 * indent.c (compute_motion): Remove unused local.
1472
c1529ded
GM
14732012-07-31 Glenn Morris <rgm@gnu.org>
1474
400d5621
GM
1475 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1476
268e2432
GM
1477 * conf_post.h [USG5_4]:
1478 Move remaining contents of s/usg5-4-common.h here.
1479 * s/usg5-4-common.h: Remove file.
1480
7552f3ee
GM
1481 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1482 * s/irix6-5.h: Remove file.
1483
6a381852
GM
1484 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1485 * s/darwin.h: Remove file.
1486
c1529ded
GM
1487 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1488 * s/hpux10-20.h: Remove file, which is now empty.
1489
b429a4ee
GM
14902012-07-30 Glenn Morris <rgm@gnu.org>
1491
1492 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1493 * Makefile.in (config_h): Add conf_post.h.
1494 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1495
adff3182
JD
14962012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1497
1498 * nsterm.m (ns_do_open_file): New variable.
b9031d69 1499 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
1500 (openFile, openTempFile, openFileWithoutUI, openFiles):
1501 Open files only if ns_do_open_file.
adff3182 1502
c32af1e4
PE
15032012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1504
7393bcbb
PE
1505 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1506 This no-op macro hasn't been needed for many years.
1507 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1508
c32af1e4
PE
1509 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1510 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1511 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1512 gdb_make_enums_visible.
1513 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1514 (DIRECTORY_SEP): Now a constant, not a macro.
1515
302fc036
EZ
15162012-07-30 Eli Zaretskii <eliz@gnu.org>
1517
1518 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1519 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1520
1521 * w32term.c <w32_keyboard_codepage>: Renamed from
1522 keyboard_codepage and now external. All users changed.
1523
1524 * w32term.h: Add declaration of w32_keyboard_codepage.
1525
1526 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1527 the codepage to translate keys to Unicode. If this argument is
1528 -1, use the value returned by GetConsoleCP. All callers changed.
1529
88fb40b4
PE
15302012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1531
0aee6912
PE
1532 Update .PHONY listings in makefiles.
1533 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1534 bootstrap-clean, distclean, maintainer-clean, versioclean,
1535 extraclean, frc.
1536
88fb40b4
PE
1537 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1538 This is a bit clearer. Fix some commentary typos.
1539
0a763bd1
GM
15402012-07-30 Glenn Morris <rgm@gnu.org>
1541
32bac6d6
GM
1542 * s/netbsd.h: Let configure include signal.h if needed.
1543 Remove file, which is now empty.
1544
b65e7c46
GM
1545 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1546 Let configure set them.
1547 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1548 No more need to undefine.
0a763bd1 1549
169304bd
AS
15502012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1551
1552 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1553 non-single-byte char when adding meta modifier. (Bug#12090)
1554
6cd7a139
DA
15552012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1556
1557 Convert safe_call to use variable number of arguments.
1558 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1559 (safe_call2): Fix comment.
1560 * lisp.h (safe_call): Adjust prototype.
1561 * coding.c (encode_coding_object): Change to use safe_call2.
1562 * xfaces.c (merge_face_heights): Change to use safe_call1.
1563
d34d6ffc
GM
15642012-07-30 Glenn Morris <rgm@gnu.org>
1565
7b8a48e4 1566 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 1567 does that unconditionally. Remove file, which is now empty.
7b8a48e4 1568
d34d6ffc
GM
1569 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1570 Remove empty files.
1571
03a660a6
PE
15722012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1573
1574 Export to GDB most of lisp.h's remaining object-like macros.
1575 * lisp.h (min, max): Move earlier, because they're used earlier now.
1576 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1577 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1578 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1579 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1580 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1581 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1582 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1583 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1584 Now constants, for GDB. They need not be macros.
1585 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1586 Now constants, for GDB, as well as macros, for static initializers.
1587 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1588 Move to after the definition of struct Lisp_Char_Table,
1589 since the former now needs that type defined.
1590 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1591 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1592 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1593 New enums, for gdb_make_enums_visible.
1594 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 1595 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
1596 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1597 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1598 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1599 enum maxargs, enum MAX_ALLOCA.
1600 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1601 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1602 no longer needed, now that they are done in lisp.h.
1603
e499d0ee
DA
16042012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1605
1606 Cleanup string bytes checking.
1607 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1608 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1609 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1610 (check_sblock, compact_small_strings): Simplify.
1611
d5040d2d
PE
16122012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1613
1614 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1615 These macros are confusing and no longer need to be defined, as
1616 the enum values now suffice. All uses replaced with definiens.
1617 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1618
7f259ae6
JB
16192012-07-29 Juanma Barranquero <lekktu@gmail.com>
1620
1621 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1622 ($(BLD)/w32console.$(O)): Update dependencies.
1623
7e63e0c3
DA
16242012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1625
1626 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1627 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1628 time. Adjust users.
1629 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1630
ffd817eb
JD
16312012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1632
1633 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1634 setting sitelisp (Bug#12010).
1635
417a7a0e
EZ
16362012-07-29 Eli Zaretskii <eliz@gnu.org>
1637
14ae4239 1638 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
1639
1640 * w32heap.c (cache_system_info):
1641 * w32.c (sys_rename):
1642 * w32proc.c (find_child_console, sys_kill): All users changed.
1643
387d4d92
PE
16442012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1645
1646 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1647
55a6cca6
EZ
16482012-07-29 Eli Zaretskii <eliz@gnu.org>
1649
1650 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1651
dbcf001c
DA
16522012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1653
1654 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
1655 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1656 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 1657
e2688e4a
DA
16582012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1659
1660 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1661 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1662 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1663 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1664 (replace_range, replace_range_2, del_range_2): Change to eassert.
1665 * marker.c (byte_char_debug_check): Adjust style.
1666
b46a6a83
PE
16672012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1668
1669 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1670 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1671 long-ago-commented-out code that talks about "WIN32".
1672 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1673 All uses changed.
1674
e32a5799
PE
16752012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1676
1677 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1678 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1679 Simplify by using alignof.
1680 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1681 * lisp.h: Include <stdalign.h>.
1682 (GCALIGNMENT): New macro and constant.
1683 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1684 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1685 (stdalign): New macro, if not already defined.
1686
df81cd29
EZ
16872012-07-28 Eli Zaretskii <eliz@gnu.org>
1688
01bd1b0d
EZ
1689 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1690 * w32inevt.c: Include w32inevt.h.
1691 (w32_read_console_input): New inline function, calls either
1692 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1693 w32_console_unicode_input.
1694 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1695 (w32_kbd_patch_key, key_event): Use the codepage returned by
1696 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1697 (key_event): use uChar.UnicodeChar only if
1698 w32_console_unicode_input is non-zero.
1699
1700 * w32console.c: Include w32heap.h.
1701 <w32_console_unicode_input>: New global variable.
1702 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1703 family of Windows, zero otherwise.
1704
1705 * w32inevt.h: Declare w32_console_unicode_input.
1706
df81cd29
EZ
1707 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1708 --without-x. (Bug#11742)
1709
c20fdd9e
PE
17102012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1711
1712 Adjust GDB to reflect pvec_type changes (Bug#12036).
1713 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
1714 2012-07-04 changes to pseudovector representation.
1715 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 1716
32770973 17172012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
1718
1719 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1720 bus address.
1721 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1722
3438fe21
EZ
17232012-07-27 Eli Zaretskii <eliz@gnu.org>
1724
bcfbc9de
EZ
1725 * alloc.c (listn): Fix the order the arguments are consed onto the
1726 list.
1727
3438fe21
EZ
1728 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1729 enumeration constants, as PURE and HEAP are too general, and clash
1730 with other headers and sources, such as gmalloc.c and the
1731 MS-Windows system headers. All users changed.
1732
eeaea515
DA
17332012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1734
1735 Revert last save_excursion_save and save_excursion_restore changes.
1736 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1737 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1738
073c88c2
DA
17392012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1740
1741 Fix recently-introduced typos in Windows port.
1742 Reported by Martin Rudalics <rudalics@gmx.at>.
1743 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 1744 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 1745
4706125e
PE
17462012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1747
1748 Improve GDB symbol export (Bug#12036).
1749 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1750 arms of an 'if', not using conditional expressions; otherwise GDB
1751 complains about the types in the unevaluated arm when the argument
1752 is an integer literal.
1753 (xgetint): Simplify expression.
1754 * alloc.c (gdb_make_enums_visible): New constant. This ports to
1755 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
1756 Zaretskii in <http://bugs.gnu.org/12036#13>.
1757 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
1758 needed now that we have gdb_make_enums_visible.
1759 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1760 (enum enum_USE_LSB_TAG):
1761 New enum types, packaging up enums that need to be exported to GDB.
1762
694b6c97
DA
17632012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1764
1765 Utility function to make a list from specified amount of objects.
1766 * lisp.h (enum constype): New datatype.
1767 (listn): New prototype.
1768 * alloc.c (listn): New function.
1769 (Fmemory_use_count, syms_of_alloc): Use it.
1770 * buffer.c (syms_of_buffer): Likewise.
1771 * callint.c (syms_of_callint): Likewise.
1772 * charset.c (define_charset_internal): Likewise.
1773 * coding.c (syms_of_coding): Likewise.
1774 * keymap.c (syms_of_keymap): Likewise.
1775 * search.c (syms_of_search): Likewise.
1776 * syntax.c (syms_of_syntax): Likewise.
1777 * w32.c (init_environment): Likewise.
1778 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1779 * xdisp.c (syms_of_xdisp): Likewise.
1780 * xfns.c (syms_of_xfns): Likewise.
1781
6195f384
DA
17822012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1783
1784 Fast save_excursion_save and save_excursion_restore.
1785 * lisp.h (struct Lisp_Excursion): New data type.
1786 (PVEC_EXCURSION): New pseudovector type.
1787 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1788 to deal with it. Adjust comments.
1789 (init_marker, attach_marker): New prototype.
1790 (unchain_marker): Adjust prototype.
1791 * marker.c (attach_marker): Change to global.
1792 (init_marker): New function.
1793 * alloc.c (Fmake_marker, build_marker): Use it.
1794 (build_marker): More easserts.
1795 (mark_object): Handle struct Lisp_Excursion.
1796 * editfns.c (save_excursion_save, save_excursion_restore):
1797 Reimplement to use struct Lisp_Excursion. Add comments.
1798
5eceb8fb
PE
17992012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1800
1801 Fix export of symbols to GDB (Bug#12036).
1802 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1803 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
1804 emacs.c, as this is a more-suitable home. Had this been done earlier
1805 the fix for 12036 would have avoided some of the problems noted in
1806 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
1807 would have been more obvious.
562157c8
PE
1808 * emacs.c: Do not include <verify.h>; no longer needed.
1809 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
1810 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
1811 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1812 Remove; now done in lisp.h.
1813 * lisp.h (PUBLISH_TO_GDB): New macro.
1814 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
1815 (DATA_SEG_BITS): Use it.
1816 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
1817 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
1818 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
1819 not be usable in #if. This simplifies things.
1820
d6749401
JB
18212012-07-26 Juanma Barranquero <lekktu@gmail.com>
1822
1823 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1824
1781b9e9
PE
18252012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1826
d89518db 1827 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
1828 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1829 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1830 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1831 Adjust to changes in lisp.h and emacs.c, by using
1832 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1833 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1834 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1835 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1836 instead of gdb_valbits.
1837 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1838 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1839 instead of gdb_array_mark_flag.
1840 (xboolvector): Get size from $->size, not $->header.size.
1841 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1842 (xreload, hook-run, hookpost-run): Remove.
1843 * emacs.c: Include <verify.h>.
1844 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1845 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1846 Remove.
1847 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1848 (gdb_USE_LSB_TAG): New enum constants.
1849 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1850 Also define these as enum constants, so they're visible to GDB.
1851 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1852 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1853 as constants, so they're visible to GDB.
1854 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1855 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1856 Now enum constants, not macros, so they're visible to GDB.
1857 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1858 more convenient now. All uses changed.
1859 (VALMASK) [USE_LSB_TAG]: Also define in this case.
1860 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1861
3628596a
DA
18622012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
1863
1864 Explicitly free restriction data that are not needed anymore.
1865 * editfns.c (save_restriction_restore): Free restriction data.
1866
7abaf5cc
SM
18672012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
1868
1869 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
1870 add argument, tune behavior, and adjust all callers.
1871
71f88e00
PE
18722012-07-25 Paul Eggert <eggert@cs.ucla.edu>
1873
1874 Use typedef for EMACS_INT, EMACS_UINT.
1875 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
1876 than macros. This simplifies debugging in the usual case, since
1877 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
1878 and it allows expressions involving EMACS_INT casts.
1879 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
1880
57ec3034
JD
18812012-07-25 Jan Djärv <jan.h.d@swipnet.se>
1882
1883 * nsterm.m (ns_read_socket): Return early if there is a modal
1884 window (Bug#12043).
1885
8137e7b3
MR
18862012-07-25 Martin Rudalics <rudalics@gmx.at>
1887
1888 * frame.c (Fredirect_frame_focus): In doc-string don't mention
1889 that FOCUS-FRAME can be omitted.
1890
04e9897c
DA
18912012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
1892
1893 Adjust buffer text indirection counters at the end of Fkill_buffer.
1894 * buffer.c (Fkill_buffer): Adjust indirection counters when the
1895 buffer is definitely dead. This should really fix an issue reported
1896 by Christoph Scholtes again. (Bug#12007).
1897 (init_buffer_once): Initialize indirection counters of
1898 buffer_defaults and buffer_local_symbols (for sanity and safety).
1899
8a0484e1
EZ
19002012-07-24 Eli Zaretskii <eliz@gnu.org>
1901
1902 * xdisp.c (init_iterator): Don't compute dimensions of truncation
1903 and continuation glyphs on tooltip frames, leave them at zero.
1904 Avoids continued lines in tooltips. (Bug#11832)
1905
fa691a83
DA
19062012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
1907
1908 Simplify copy_overlay.
04e9897c 1909 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
1910 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
1911
436bc8e0
EZ
19122012-07-23 Eli Zaretskii <eliz@gnu.org>
1913
1914 * print.c (print_object): Don't crash when a frame's name is nil
1915 or invalid. (Bug#12025)
1916
1917 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
1918 it signals an error when a tooltip frame is being created.
1919
d7a7fda3
DA
19202012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
1921
1922 Cleanup miscellaneous objects allocation and initialization.
1923 * alloc.c (allocate_misc): Change to static. Add argument to
1924 specify the subtype. Adjust comment and users.
1925 (build_overlay): New function.
1926 * buffer.c (copy_overlays, Fmake_overlay): Use it.
1927 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
1928 (allocate_misc): Remove prototype.
1929 (build_overlay): Add prototype.
1930
19312012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
1932
1933 Swap buffer text indirection counters in Fbuffer_swap_text.
1934 * buffer.c (Fbuffer_swap_text): Swap indirections too.
1935 This avoids crash reported by Christoph Scholtes at
1936 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
1937
9d7fa573
JD
19382012-07-22 Jan Djärv <jan.h.d@swipnet.se>
1939
1940 * nsmenu.m (Popdown_data): New struct.
1941 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
1942 free Popdown_data.
1943 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
1944 (initWithContentRect): Make imgView and contentView non-static
1945 and autorelease them. Also autorelease img and matrix (Bug#12005).
1946 (dealloc): Remove (Bug#12005).
1947
0dd6d66d
DA
19482012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1949
1950 Adjust consing_since_gc when objects are explicitly freed.
1951 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
1952 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
1953 (free_cons, free_misc): Subtract object size from consing_since_gc.
1954
d36d71df
DA
19552012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
1956
1957 Simplify and cleanup markers positioning code.
1958 * marker.c (attach_marker): More useful eassert.
1959 (live_buffer, set_marker_internal): New function.
1960 (Fset_marker, set_marker_restricted): Use set_marker_internal.
1961 (set_marker_both, set_marker_restricted_both): Use live_buffer.
1962
fb9ea40f
PE
19632012-07-22 Paul Eggert <eggert@cs.ucla.edu>
1964
1965 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
1966 as it's limited by the amount of memory, not by INT_MAX.
1967
2d5c5f7d
EZ
19682012-07-21 Eli Zaretskii <eliz@gnu.org>
1969
07fb592e
EZ
1970 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
1971 in special-event-map. See the discussion at
1972 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
1973 for the reasons.
1974
37a9eac8 1975 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
1976 info.dwItemData. Fixes crashes on 64-bit Windows.
1977 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 1978
c4328746
JD
19792012-07-21 Jan Djärv <jan.h.d@swipnet.se>
1980
1981 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 1982 (conversationIdentifier): Return value is NSInteger.
784051c4 1983 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 1984
6e5d1c12
CY
19852012-07-21 Chong Yidong <cyd@gnu.org>
1986
1987 * window.c (decode_any_window): Signal an error if the window is
1988 on a dead frame (Bug#11984).
1989
9928463d
DA
19902012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
1991
1992 Add indirection counting to speed up Fkill_buffer.
1993 * buffer.h (struct buffer): New member.
1994 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
1995 (Fmake_indirect_buffer): Set indirection counter to -1, increment
1996 base buffer indirection counter.
1997 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
1998 (Fkill_buffer): Adjust indirection counters as needed, don't walk
1999 through buffer list if indirection counter is 0.
2000
f8643a6b
DA
20012012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2002
2003 Extend the value returned by Fgarbage_collect with heap statistics.
2004 * alloc.c (Qheap): New symbol.
2005 (syms_of_alloc): DEFSYM it.
2006 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2007 (Fmemory_free): Remove.
2008 (syms_of_alloc): Don't defsubr it.
2009 * buffer.c (Fcompact_buffer): Remove.
2010 (syms_of_buffer): Don't defsubr it.
2011
dac616ff
DA
20122012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2013
2014 Make maybe_gc inline.
2015 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2016 * lisp.h (consing_since_gc, gc_relative_threshold)
2017 (memory_full_cons_threshold): Revert declaration.
2018 (maybe_gc): Remove prototype, define as inline.
2019 * alloc.c: Remove old commented-out code.
2020 (consing_since_gc, gc_relative_threshold)
2021 (memory_full_cons_threshold): Revert to global.
2022 (maybe_gc): Remove.
2023
d7ea76b4
DA
20242012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2025
2026 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2027 * lisp.h (build_unibyte_string): New function.
2028 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2029 * sysdep.c, w32fns.c, xfns.c: Use it.
2030 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2031 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2032 Adjust users accordingly.
2033 * font.h (font_open_by_name): Adjust prototype.
2034
765e61e3
DA
20352012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2036
2037 Cleanup calls to Fgarbage_collect.
2038 * lisp.h (maybe_gc): New prototype.
2039 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2040 Remove declarations.
2041 * alloc.c (maybe_gc): New function.
2042 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2043 Make them static.
2044 * bytecode.c (MAYBE_GC): Use maybe_gc.
2045 * eval.c (eval_sub, Ffuncall): Likewise.
2046 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2047 to avoid dependency from auto-save feature.
2048
52b852c7
PE
20492012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2050
2051 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2052 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2053 'for_each_per_buffer_object_at'.
2054 All uses changed. It's better to use upper-case for macros that
2055 cannot be implemented as functions, to give the reader a clue
2056 that they're special.
2057
5db81e33
SM
20582012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2059
2060 * alloc.c (Fgarbage_collect): Tweak docstring.
2061
5b835e1d
DA
20622012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2063
2064 Tweak the value returned from Fgarbage_collect again.
2065 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2066 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2067 Adjust documentation.
2068 (total_vector_bytes): Rename to total_vector_slots, adjust
2069 accounting.
2070 (total_free_vector_bytes): Rename to total_free_vector_slots,
2071 adjust accounting.
2072 (Qstring_bytes, Qvector_slots): New symbols.
2073 (syms_of_alloc): DEFSYM them.
2074
9cd47b72
DA
20752012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2076
2077 Buffer compaction primitive which may be used from Lisp.
2078 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2079 (syms_of_buffer): Register Fcompact_buffer.
2080 * alloc.c (Fgarbage_collect): Use compact_buffer.
2081 * buffer.h (compact_buffer): New prototype.
2082 (struct buffer_text): New member.
2083
d17337e5
DA
20842012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2085
2086 New macro to iterate over all buffers, miscellaneous cleanups.
2087 * lisp.h (all_buffers): Remove declaration.
2088 * buffer.h (all_buffers): Add declaration, with comment.
2089 (for_each_buffer): New macro.
2090 * alloc.c (Fgarbage_collect, mark_object): Use it.
2091 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2092 (init_buffer): Likewise.
2093 * data.c (Fset_default): Likewise.
2094 * coding.c (code_conversion_restore): Remove redundant check
2095 for dead buffer.
2096 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2097
60cfd278
AS
20982012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2099
2100 Fix bug that created negative-length intervals.
2101 * intervals.c (merge_interval_right, merge_interval_left):
2102 Do not zero out this interval if it is absorbed by its children,
2103 as this interval's total length doesn't change in that case. See
2104 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2105
d06714cb
PE
21062012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2107
83713154
PE
2108 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2109 when invoking (make-bool-vector N t) and N is a positive
2110 multiple of 8 -- the last 8 bits were mistakenly cleared.
2111
d06714cb
PE
2112 Remove some struct layout assumptions in bool vectors.
2113 * alloc.c (bool_header_size): New constant.
2114 (header_size, word_size): Move earlier, as they're now used earlier.
2115 Use 'word_size' in a few more places, where it's appropriate.
2116 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2117 padding before the data member of a bool vector.
2118 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2119 than doing the check by hand with an abort ().
2120
464d5a5e
SM
21212012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2122
5fbc0409
SM
2123 * eval.c (Fdefvar): Don't check constants since we only set the var if
2124 it's not yet defined anyway (bug#11904).
2125
464d5a5e
SM
2126 * lisp.h (last_undo_boundary): Declare new var.
2127 * keyboard.c (command_loop_1): Set it.
2128 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2129 were auto-added by the command loop (bug#11774).
2130
8dc2e44a
AS
21312012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2132
2133 * w32font.c (Qsymbol): Remove local definition.
2134 (syms_of_w32font): Don't DEFSYM it.
2135
169925ec
DA
21362012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2137
2138 Fix sweep_vectors to handle large bool vectors correctly.
2139 * alloc.c (sweep_vectors): Account total_vector_bytes for
2140 bool vectors larger than VBLOCK_BYTES_MAX.
2141
5fbfb018
CY
21422012-07-18 Chong Yidong <cyd@gnu.org>
2143
2144 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2145 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2146
3ab6e069
DA
21472012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2148
2149 Return more descriptive data from Fgarbage_collect.
2150 Suggested by Stefan Monnier in
2151 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2152 * alloc.c (bounded_number): New function.
2153 (total_buffers, total_vectors): New variable.
2154 (total_string_size): Rename to total_string_bytes, adjust users.
2155 (total_vector_size): Rename to total_vector_bytes, adjust users.
2156 (sweep_vectors): Account total_vectors and total_vector_bytes.
2157 (Fgarbage_collect): New return value. Adjust documentation.
2158 (gc_sweep): Account total_buffers.
2159 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2160 (VECTOR_SIZE): Remove.
2161 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2162 (Qinterval, Qmisc): New symbols.
2163 (syms_of_data): Initialize them.
2164 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2165 (Qcons, Qbuffer): New declarations.
2166
6d02fe5b
PE
21672012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2168
2169 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2170 Round up, not down. Improve doc.
2171
b7ffe040
DA
21722012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2173
2174 Restore old code in allocate_string_data to avoid Faset breakage.
2175 Reported by Julien Danjou <julien@danjou.info> in
2176 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2177 * alloc.c (allocate_string_data): Restore old code with minor
2178 adjustments, fix comment to explain this subtle issue.
2179
4dc7c8d5
SM
21802012-07-17 Eli Zaretskii <eliz@gnu.org>
2181
2182 Remove FILE_SYSTEM_CASE.
2183 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2184
2185 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2186 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2187 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2188 call-process-region passes it through expand-file-name.
2189
2190 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2191
21922012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2193
2194 Fix crash when creating indirect buffer (Bug#11917)
2195 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2196 Don't handle unbound variables specially if non-zero.
2197 (Fbuffer_local_variables): Pass zero.
2198 (clone_per_buffer_values): Pass non-zero.
2199
22002012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2201
2202 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2203 to make the loop interruptible.
2204
22052012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2206
2207 * gnutls.c (emacs_gnutls_handshake): Only retry if
2208 GNUTLS_E_INTERRUPTED.
2209
cce7fefc
DA
22102012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2211
2212 Cleanup and convert miscellaneous checks to eassert.
2213 * alloc.c (mark_interval): Fix comment, partially rephrase
2214 old comment from intervals.h (see below).
2215 * intervals.c (find_interval, adjust_intervals_for_insertion)
2216 (delete_interval, adjust_intervals_for_deletion)
2217 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2218 Convert to eassert.
2219 (adjust_intervals_for_insertion, make_new_interval):
2220 Remove obsolete and unused code.
2221 * intervals.h (struct interval): Remove obsolete comment.
2222 * textprotp.c (erase_properties): Remove unused code.
2223 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2224 (Fremove_list_of_text_properties): Convert to eassert.
2225
9ea10cc3
CY
22262012-07-17 Chong Yidong <cyd@gnu.org>
2227
2228 * editfns.c (Finsert_char): Doc fix.
2229
3900d5de
DA
22302012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2231
2232 Fix previous change to make Fmemory_free always accurate.
2233 * alloc.c (make_interval): Update total_free_intervals.
2234 (make_float): Likewise for total_free_floats.
2235 (free_cons, Fcons): Likewise for total_free_conses.
2236 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2237 Likewise for total_free_vector_bytes.
2238 (Fmake_symbol): Likewise for total_free_symbols.
2239 (bytes_free): Remove.
2240
7098646f
DA
22412012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2242
2243 Simple free memory accounting feature.
2244 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2245 (sweep_vectors): Accumulate size of free vectors.
2246 (Fgarbage_collect): Setup bytes_free.
2247 (Fmemory_free): New function.
2248 (syms_of_alloc): Register it.
2249
22657b40
DA
22502012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2251
2252 Cleanup overlays checking.
2253 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2254 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2255 eassert and OVERLAYP.
2256 (sort_overlays): Change to use OVERLAYP.
2257
ddfc8813
RK
22582012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2259
2260 * editfns.c (Finsert_char): Make it interactive, and make the
2261 second arg optional. Copy interactive spec and docstring from
2262 ucs-insert.
2263
7c26cf3c
PE
22642012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2265
2266 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2267 Unlike the other wrapped functions, fabs has an unspecified
2268 effect on errno.
2269
5d127af9
JD
22702012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2271
2272 * nsterm.m (keyDown): Interpret flags without left/right bits
2273 as the left key (Bug#11670).
2274
6a0dd1d7
DA
22752012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2276
2277 Remove empty and useless init functions.
2278 * lisp.h (init_character_once, init_fns, init_image)
2279 (init_filelock, init_sound): Remove prototype.
2280 * character.c (init_character_once): Remove.
2281 * filelock.c (init_filelock): Likewise.
2282 * fns.c (init_fns): Likewise.
2283 * image.c (init_image): Likewise.
2284 * sound.c (init_sound): Likewise.
2285 * emacs.c (main): Adjust accordingly.
2286
7a6136fd
DA
22872012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2288
2289 * gtkutil.h: Tiny cleanups.
2290 (use_old_gtk_file_dialog): Remove useless declaration.
2291 (xg_uses_old_file_dialog): Add suggested const attribute.
2292
ce811ad9
EZ
22932012-07-15 Eli Zaretskii <eliz@gnu.org>
2294
2295 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2296 (bidi_paragraph_init): Use it to limit search forward for a strong
2297 directional character in abnormally large paragraphs full of
2298 neutral or weak characters. (Bug#11943)
2299
c9adfeaa
SF
23002012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2301
2302 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2303 the toolbar (Bug#9451).
2304 (xg_make_tool_item): Give the widget event box a transparent
2305 background.
2306
fff62aa9
DA
23072012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2308
2309 Cleanup basic allocation variables and functions.
2310 * alloc.c (ignore_warnings, init_intervals, init_float)
2311 (init_cons, init_symbol, init_marker): Remove.
2312 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2313 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2314 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2315 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2316 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2317 (staticidx, init_alloc_once, init_strings, free_ablock):
2318 Remove redundant initialization.
2319 * fns.c (init_weak_hash_tables): Remove.
2320 * lisp.h (init_weak_hash_tables): Remove prototype.
2321
9730daca
DA
23222012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2323
2324 Use zero_vector where appropriate.
2325 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2326 accordingly.
2327 * lisp.h (zero_vector): New declaration.
2328 * font.c (null_vector): Remove.
2329 (syms_of_font): Remove initialization and staticpro.
2330 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2331 * keymap.c (Faccessible_keymaps): Likewise.
2332
2e2d2a13
LL
23332012-07-15 Leo Liu <sdl.web@gmail.com>
2334
2335 * fringe.c: Fix typo in comments.
2336
cd276f6e
LL
23372012-07-14 Leo Liu <sdl.web@gmail.com>
2338
2339 * fringe.c: Add a new bitmap exclamation-mark.
2340
5a1131d9
EZ
23412012-07-14 Eli Zaretskii <eliz@gnu.org>
2342
2343 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2344
2345 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2346 (HAVE_MENUS): Don't define, defined by editing config.in with
2347 msdos/sed2v2.inp.
2348 (GMALLOC_INHIBIT_VALLOC): Don't define.
2349 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2350
22e983b7
JB
23512012-07-14 Juanma Barranquero <lekktu@gmail.com>
2352
2353 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2354
5b3f250f
GM
23552012-07-14 Glenn Morris <rgm@gnu.org>
2356
2357 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2358 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2359 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2360
33d63ff4
GM
23612012-07-13 Glenn Morris <rgm@gnu.org>
2362
5b633342
GM
2363 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2364
33d63ff4
GM
2365 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2366 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2367
b55b9f85
JD
23682012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2369
0dc8cf50
JD
2370 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2371 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2372 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2373 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2374 where appropriate.
2375 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2376 as boolean expression.
2377 (x_set_window_size): Remove unused variable toolbar.
2378 (ns_get_color_default, ns_mod_to_lisp): Remove.
2379 (ns_mouse_position): Remove unused variables xchar and ychar.
2380 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2381 (ns_set_vertical_scroll_bar): Remove unused variable count.
2382 (ns_delete_terminal): Remove unused variable i.
2383 (ns_term_init): Remove unused variables r, g and b.
2384 (mouseDown): Remove unused variable window.
2385 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2386 (initFrameFromEmacs): Remove unused variable vbextra.
2387 (mouseEntered): Remove unused variables p and dpyinfo.
2388 (mouseExited): Remove unused variables p and r.
2389 (ns_define_frame_cursor, ns_clear_frame_area)
2390 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2391 (menuDown): Assign [sender tag] to variable and cast the variable.
2392
2393 * nsterm.h (menuDown): Add id as type to argument sender.
2394 (ns_display_info_for_name): Add Lisp_Object argument.
2395 (ns_term_init): Add Lisp_Object argument.
2396 (ns_map_event_to_object): Add void argument.
2397 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2398 prototype with arguments and only declare if __OBJC__.
2399 (nxatoms_of_nsselect): Add void argument.
2400 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2401 (ns_alloc_autorelease_pool): Add void argument.
2402 (ns_release_autorelease_pool): Add void* argument.
2403 (ns_get_defaults_value): Add const char* argument.
2404
2405 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2406 (initFromContents): Use SSDATA where appropriate.
2407 (ns_update_menubar): Add braces to ambigous if-else.
2408 (initWithTitle): Put () around assignment in if statement.
2409 (ns_menu_show): Remove unused variables window and keymap.
2410 (update_frame_tool_bar): Remove unused variable selected_p.
2411 (initWithContentRect): Remove unused variable this_cmd_name.
2412
2413 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2414 appropriate.
2415 (setXBMColor): Remove unused variable len.
2416 (setPixmapData): Put () around assignment in loop statement.
2417
2418 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2419 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2420 where appropriate.
2421 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2422 around assignment in loop statement.
2423 (nsfont_open): Remove unused variable i.
2424 (nsfont_open): Remove unused variable len.
2425 (nsfont_draw): Remove unused variable cs.
2426
2427 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2428 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2429 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2430 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2431 (Fns_font_name, Fns_perform_service)
2432 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2433 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2434 (ns_set_name): Remove unused variable view.
2435 (x_set_menu_bar_lines): Remove unused variable olines.
2436 (x_set_tool_bar_lines): Remove unused variable root_window.
2437 (Fns_list_colors): Put () around assignment in while statement.
2438 (Fns_perform_service): Remove unused variable len.
2439 (Fns_display_usable_bounds): Remove unused variable top.
2440 (syms_of_nsfns): Remove unused variable i.
2441
b55b9f85
JD
2442 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2443 memcpy (Bug#11907).
2444
ed9265fc 24452012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
2446
2447 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2448 and free it with DestroyExceptionInfo (Bug#11558).
2449
ef099b57
JB
24502012-07-13 Juanma Barranquero <lekktu@gmail.com>
2451
2452 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2453 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2454 Set here, not in nt/config.nt.
2455
ea814a5d
EZ
24562012-07-13 Eli Zaretskii <eliz@gnu.org>
2457
2458 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2459 cursor overflow into the last glyph on display line when the right
2460 fringe is off. (Bug#11832)
2461
1a952767
PE
24622012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2463
2464 * xdisp.c (produce_special_glyphs): Now static.
2465 * dispextern.h (produce_special_glyphs): Remove decl.
2466
983188fd
GM
24672012-07-13 Glenn Morris <rgm@gnu.org>
2468
8d7c7eed 2469 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
2470 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2471
983188fd
GM
2472 * s/usg5-4-common.h (USG, USG5):
2473 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2474 * s/sol2-6.h (SOLARIS2):
2475 * s/irix6-5.h (IRIX6_5):
2476 * s/hpux10-20.h (USG, USG5, HPUX):
2477 * s/gnu-linux.h (USG, GNU_LINUX):
2478 * s/freebsd.h (BSD_SYSTEM):
2479 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2480 * s/cygwin.h (CYGWIN):
2481 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2482 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2483
d1e68667 24842012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
2485
2486 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 2487
6de0e799
GM
24882012-07-13 Glenn Morris <rgm@gnu.org>
2489
739ae010
GM
2490 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2491
dbee5793
GM
2492 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2493
6de0e799
GM
2494 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2495 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2496
b82da769
GM
24972012-07-12 Glenn Morris <rgm@gnu.org>
2498
4fae5a7a 2499 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
2500
2501 * process.c (init_process_emacs): Rename from init_process.
2502 The old name is also the name of a Mach system call.
2503 * lisp.h, emacs.c: Update for this name change.
2504 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2505 longer needed.
2506
5a979817
EZ
25072012-07-12 Eli Zaretskii <eliz@gnu.org>
2508
2509 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2510 memmove call that removes glyphs covered by the left truncation
2511 glyph. Improve commentary.
2512 (display_line): Fix display of continuation glyphs on GUI frames
2513 when the right fringe is turned off and variable-size fonts are
2514 used in the window. Move the code that appends a stretch glyph to
2515 produce_special_glyphs, so that it could be used for truncation
2516 and continuation glyphs alike.
2517 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2518 glyph of a suitably computed width, to align the special glyphs at
2519 the window margin. Code moved from display_line. (Bug#11832)
2520
3e91a053
GM
25212012-07-12 Glenn Morris <rgm@gnu.org>
2522
ba9e4b84
GM
2523 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2524
2525 * s/gnu-linux.h, s/hpux10-20.h:
2526 Do not unconditionally define HAVE_XRMSETDATABASE.
2527
3e91a053
GM
2528 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2529
b300b1f4
PE
25302012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2531
2532 Fix typos that broke OS X build.
2533 Reported by Randal L. Schwartz in
2534 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2535 * nsterm.m (ns_timeout): Add missing local decl.
2536 (ns_get_color): snprintf -> sprintf, to fix typo.
2537
6e777848
GM
25382012-07-12 Glenn Morris <rgm@gnu.org>
2539
3f922c37
GM
2540 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2541 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2542 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2543 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2544
0ab7b23a
GM
2545 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2546 Move PTY_OPEN to configure.
2547
6e777848
GM
2548 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2549 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2550 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2551
4a7edc24
DA
25522012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2553
2554 Use empty_unibyte_string where applicable.
2555 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2556 * lread.c (read1): Likewise.
2557 * xsettings.c (syms_of_xsettings): Likewise.
2558
308aab79
GM
25592012-07-12 Glenn Morris <rgm@gnu.org>
2560
42bd1719
GM
2561 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2562 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
2563 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2564 * s/hpux10-20.h (RUN_TIME_REMAP):
2565 * s/bsd-common.h (TABDLY): Move to configure.
2566
2567 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2568
2569 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2570
ea0bbd17 2571 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 2572 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
2573
2574 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 2575
308aab79
GM
2576 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2577 * s/template.h: Move NARROWPROTO to configure.
2578
ee1cf5cf
GM
25792012-07-11 Glenn Morris <rgm@gnu.org>
2580
30fe9bf4
GM
2581 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2582 unused since 2011-01-17 change to systty.h.
2583
ee1cf5cf
GM
2584 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2585 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2586 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2587
63e47e07
PE
25882012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2589
2590 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2591
c43fb4c3
GM
25922012-07-11 Glenn Morris <rgm@gnu.org>
2593
2594 * s/darwin.h, s/gnu-linux.h, s/template.h:
2595 Move INTERRUPT_INPUT to configure.
2596
e8df9267
DA
25972012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2598
2599 Minor adjustments to interning code.
2600 * lisp.h (intern, intern_c_string): Redefine as static inline
2601 wrappers for intern_1 and intern_c_string_1, respectively.
2602 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
2603 * lread.c (intern_1, intern_c_string_1, oblookup):
2604 Simplify Vobarray checking.
e8df9267
DA
2605 * font.c (font_intern_prop): Likewise. Adjust comment.
2606 * w32font.c (intern_font_name): Likewise.
2607
34348bd4
AS
26082012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2609
d96a1e0c
AS
2610 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2611
34348bd4
AS
2612 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2613 of Fcar/Fcdr if possible.
2614 * font.c (check_otf_features): Likewise.
2615 * fontset.c (Fnew_fontset): Likewise.
2616 * gnutls.c (Fgnutls_boot): Likewise.
2617 * minibuf.c (read_minibuf): Likewise.
2618 * msdos.c (IT_set_frame_parameters): Likewise.
2619 * xmenu.c (Fx_popup_dialog): Likewise.
2620 * w32menu.c (Fx_popup_dialog): Likewise.
2621
c8add24e
GM
26222012-07-11 Glenn Morris <rgm@gnu.org>
2623
4b575b3c
GM
2624 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2625 since nothing has defined it on these platforms.
2626
09f4e3b0
GM
2627 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2628 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2629
172bedef
GM
2630 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2631 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2632 Move CLASH_DETECTION to configure.
2633
249685df
GM
2634 * s/gnu.h: Remove file, which is now empty.
2635
c8add24e
GM
2636 * s/gnu.h, s/gnu-linux.h:
2637 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2638
b41253a3
JW
26392012-07-11 John Wiegley <johnw@newartisans.com>
2640
2641 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2642 function attribute, so we only use it if it exists in the
2643 compiler.
2644
d923b542
DA
26452012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2646
2647 Avoid call to strlen in fast_c_string_match_ignore_case.
2648 * search.c (fast_c_string_match_ignore_case): Change to use
2649 length argument. Adjust users accordingly.
2650 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2651
5ebbef1d
PE
26522012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2653
bb352260
PE
2654 Assume mkdir, rmdir.
2655 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2656 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2657
57054ddd
PE
2658 Assume rename.
2659 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2660
b747d3f7
PE
2661 Assume perror.
2662 * s/hpux10-20.h (HAVE_PERROR): Remove.
2663 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2664 Remove dummy definition, as this problem was obsolete long ago.
2665
5ebbef1d
PE
2666 Assume strerror.
2667 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2668
984e7f30
DA
26692012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2670
2671 Avoid calls to strlen in font processing functions.
2672 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
2673 (font_open_by_name): Change to use length argument.
2674 Adjust users accordingly.
d923b542
DA
2675 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2676 Adjust prototypes.
2677 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2678 Change to return ptrdiff_t.
984e7f30
DA
2679 (xfont_list_pattern, xfont_match): Use length returned by
2680 xfont_decode_coding_xlfd.
2681 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2682
20e94fdd
GM
26832012-07-11 Glenn Morris <rgm@gnu.org>
2684
9d596af3
GM
2685 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2686 Move DONT_REOPEN_PTY to configure.
2687
20e94fdd
GM
2688 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2689 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2690
e99a530f
PE
26912012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2692
22ffb973
PE
2693 Remove "#define unix" that is no longer needed (Bug#11905).
2694 * s/aix4-2.h (unix): Remove; no longer needed.
2695
e9a9ae03
PE
2696 EMACS_TIME simplification (Bug#11875).
2697 This replaces macros (which typically do not work in GDB)
2698 with functions, typedefs and enums, making the code easier to debug.
2699 The functional style also makes code easier to read and maintain.
2700 * systime.h: Include <sys/time.h> on all hosts, not just if
2701 WINDOWSNT, since 'struct timeval' is needed in general.
2702 (EMACS_TIME): Now a typedef, not a macro.
2703 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2704 not macros.
2705 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2706 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2707 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2708 (EMACS_TIME_LE): Now functions, not macros.
2709 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2710 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2711 which are not functions. All uses rewritten to use:
2712 (make_emacs_time): New function.
2713 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2714 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2715 not functions. All uses rewritten to use the following, respectively:
2716 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2717 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 2718 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
2719 * fileio.c (Fcopy_file):
2720 * xterm.c (XTflash): Get the current time closer to when it's used.
2721 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2722
ffacb126
PE
2723 * bytecode.c (targets): Suppress -Woverride-init warnings.
2724
e99a530f
PE
2725 Simplify by avoiding confusing use of strncpy etc.
2726 * doc.c (Fsnarf_documentation):
2727 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2728 * frame.c (Fmake_terminal_frame):
2729 * gtkutil.c (get_utf8_string):
2730 * lread.c (openp):
2731 * nsmenu.m (ns_update_menubar):
2732 * regex.c (regerror):
2733 Prefer memcpy to strncpy and strncat when either will do.
2734 * fileio.c (Fsubstitute_in_file_name):
2735 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2736 (menu_separator_name_p):
2737 * nsmenu.m (ns_update_menubar):
2738 Prefer memcmp to strncmp when either will do.
2739 * nsterm.m: Include <ftoastr.h>.
2740 (ns_get_color):
2741 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2742 Prefer snprintf to strncpy.
2743 * nsterm.m (ns_term_init):
2744 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2745 * nsterm.m (ns_term_init):
2746 Avoid the need for strncpy, by using build_string or
2747 make_unibyte_string directly. Use dtoastr, not snprintf.
2748 * process.c (Fmake_network_process): Diagnose service names that
2749 are too long, rather than silently truncating them or creating
2750 non-null-terminated names.
2751 (Fnetwork_interface_info): Likewise, for interface names.
2752 * sysdep.c (system_process_attributes) [GNU_LINUX]:
2753 Prefer sprintf to strncat.
2754 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2755 Prefer vsnprintf to vsprintf + strncpy.
2756
c59592b3
GM
27572012-07-10 Glenn Morris <rgm@gnu.org>
2758
2759 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2760 Clarify fallback case.
2761
7d7bbefd
DA
27622012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2763
2764 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2765 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2766 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 2767 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
2768 where argument type is known to be a Lisp_Cons.
2769
3a4c8000
TT
27702012-07-10 Tom Tromey <tromey@redhat.com>
2771
2772 * bytecode.c (BYTE_CODE_THREADED): New macro.
2773 (BYTE_CODES): New macro. Replaces all old byte-code defines.
2774 (enum byte_code_op): New type.
2775 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2776 (exec_byte_code): Use them. Use token threading when applicable.
2777
2a0213a6
DA
27782012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2779
2780 Optimize pure C strings initialization.
2781 * lisp.h (make_pure_string): Fix prototype.
2782 (build_pure_c_string): New function, defined as static inline. This
2783 provides a better opportunity to optimize away calls to strlen when
2784 the function is called with compile-time constant argument.
2785 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
2786 argument, adjust users accordingly. Use build_pure_c_string where
2787 appropriate.
2788 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2789 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2790 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2791
cb1caeaf
DA
27922012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2793
2794 Avoid calls to strlen in miscellaneous functions.
2795 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2796 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
2797 * lread.c (openp): Likewise.
2798
c293e30c
DA
27992012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2800
2801 Avoid calls to strlen in path processing functions.
2802 * fileio.c (file_name_as_directory): Add comment. Change to add
2803 srclen argument and return the length of result. Adjust users
2804 accordingly.
2805 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
2806 swap 1st and 2nd arguments to obey the common convention.
2807 Adjust users accordingly.
c293e30c
DA
2808 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
2809
9e059e3f
GM
28102012-07-10 Glenn Morris <rgm@gnu.org>
2811
d02eb359
GM
2812 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
2813 Move PENDING_OUTPUT_COUNT definition to configure.
2814
882cf227
GM
2815 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
2816 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
2817 * s/gnu.h (DATA_START): Move definitions to configure.
2818
af6e839f
GM
2819 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
2820 We include usg5-4-common.h, which defines them both.
2821
40289a12
GM
2822 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2823 O_RDONLY already includes it).
2824
9e059e3f
GM
2825 Stop ns builds setting the EMACSLOADPATH environment variable.
2826 * nsterm.m (ns_load_path): Rename from ns_init_paths.
2827 Now it does not set EMACSLOADPATH, just returns the load-path string.
2828 * nsterm.h: Update accordingly.
2829 * lread.c [HAVE_NS]: Include nsterm.h.
2830 (init_lread) [HAVE_NS]: Use ns_load_path.
2831 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2832
7c4e8ec0
GM
28332012-07-09 Glenn Morris <rgm@gnu.org>
2834
d4f600ff
GM
2835 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2836 since the included bsd-common.h does so.
2837
cbb31951
GM
2838 Stop ns builds setting the EMACSPATH environment variable.
2839 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2840 (ns_init_paths): Do not set EMACSPATH.
2841 * nsterm.h (ns_exec_path): Add it.
2842 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2843 Use ns_exec_path.
2844
7c4e8ec0
GM
2845 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2846
26bccfae
PE
28472012-07-09 Paul Eggert <eggert@cs.ucla.edu>
2848
a0bee46f
PE
2849 * process.c (wait_reading_process_output): 'waitchannels' was unset
2850 when read_kbd || !NILP (wait_for_cell); fix this.
2851
5994c183
PE
2852 Add GCC-style 'const' attribute to functions that can use it.
2853 * character.h (char_resolve_modifier_mask):
2854 * keyboard.h (make_ctrl_char):
2855 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2856 (init_character_once, next_almost_prime, init_fns, init_image)
2857 (flush_pending_output, init_sound):
2858 * mem-limits.h (start_of_data):
2859 * menu.h (finish_menu_items):
2860 Add ATTRIBUTE_CONST.
2861 * emacs.c (DEFINE_DUMMY_FUNCTION):
2862 Declare the dummy function with ATTRIBUTE_CONST.
2863 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2864 Add decls with ATTRIBUTE_CONST.
2865
26bccfae
PE
2866 Minor improvements to make_formatted_string.
2867 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2868 where int is good enough, as vsprintf returns an int.
2869 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
2870
a8290ec3
DA
28712012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2872
2873 Use make_formatted_string to avoid double length calculation.
2874 * lisp.h (make_formatted_string): New prototype.
2875 * alloc.c (make_formatted_string): New function.
2876 * buffer.c (Fgenerate_new_buffer_name): Use it.
2877 * dbus.c (syms_of_dbusbind): Likewise.
2878 * editfns.c (Fcurrent_time_zone): Likewise.
2879 * filelock.c (get_boot_time): Likewise.
2880 * frame.c (make_terminal_frame, set_term_frame_name)
2881 (x_report_frame_params): Likewise.
2882 * image.c (gs_load): Likewise.
2883 * minibuf.c (get_minibuffer): Likewise.
2884 * msdos.c (dos_set_window_size): Likewise.
2885 * process.c (make_process): Likewise.
2886 * xdisp.c (ensure_echo_area_buffers): Likewise.
2887 * xsettings.c (apply_xft_settings): Likewise.
2888
d01ba2f1
GM
28892012-07-09 Glenn Morris <rgm@gnu.org>
2890
2891 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
2892 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
2893 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
2894 * nsterm.h (ns_etc_directory): Add it.
2895 * callproc.c [HAVE_NS]: Include nsterm.h.
2896 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
2897
f1f924b6
DA
28982012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2899
2900 Move marker debugging code under MARKER_DEBUG.
2901 * marker.c (MARKER_DEBUG): Move marker debugging code under
2902 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
2903 for bootstrap with --enable-checking (~3x slowdown reported
2904 by Juanma Barranquero <lekktu@gmail.com>).
2905 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
2906
ab531b66
PE
29072012-07-08 Paul Eggert <eggert@cs.ucla.edu>
2908
2909 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
2910 See <http://bugs.gnu.org/11825#29>.
2911
c4b3bc8a
EZ
29122012-07-08 Eli Zaretskii <eliz@gnu.org>
2913
2914 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
2915 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
2916 (display_line): Add commentary about displaying truncation glyphs
2917 on GUI frames.
2918 (produce_special_glyphs): Move here from term.c.
2919
2920 * term.c (produce_special_glyphs): Move to xdisp.c.
2921
2922 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
2923 section.
c4b3bc8a 2924
b676b881
AS
29252012-07-07 Andreas Schwab <schwab@linux-m68k.org>
2926
f17c5273
AS
2927 * xdisp.c (display_line): Avoid warning about implicit declaration
2928 of FRAME_FONT.
2929
298819b9
AS
2930 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
2931
b676b881
AS
2932 * lisp.h: Remove empty conditional.
2933
6045c4fd
PE
29342012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2935
b3350bf9
PE
2936 * lread.c (load_path_check): Now static.
2937
6045c4fd
PE
2938 Fix some minor --with-ns problems found by static checking.
2939 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
2940 (x_set_font) [!HAVE_X_WINDOWS]:
2941 * image.c (xpm_load_image) [HAVE_NS]:
2942 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
2943 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
2944 Remove unused local.
2945 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
2946 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
2947 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
2948 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
2949 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
2950 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
2951 Fix pointer signedness problem.
2952 * xfaces.c (FRAME_X_FONT_TABLE):
2953 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
2954
929e7845
GM
29552012-07-07 Glenn Morris <rgm@gnu.org>
2956
2957 * lread.c (load_path_check): New function, split from init_lread.
2958 (init_lread): Reorganize. Motivation:
2959 If EMACSLOADPATH is set, check/warn about that rather than the
2960 defaults, which we are not going to use. Hence we can remove
2961 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
2962 Don't warn if site-lisp directories are missing.
2963 If not installed, start from a blank load-path, since
2964 PATH_LOADSEARCH refers to the eventual installation directories.
2965
58dd0aa4
EZ
29662012-07-07 Eli Zaretskii <eliz@gnu.org>
2967
2968 Support truncation and continuation glyphs on GUI frames, when
2969 fringes are disabled. (Bug#11832)
2970 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
2971 continuation glyphs even if on GUI frames.
2972 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
2973 or both, are absent.
2974 (start_display, move_it_in_display_line_to): Handle the case of a
2975 GUI frame without a fringe to display continuation or truncation
2976 glyphs.
2977 (insert_left_trunc_glyphs): Support GUI frames: make sure
2978 truncation glyphs overwrite enough glyphs from the current line to
2979 have sufficient space in pixels.
2980 (display_line): Support truncation and continuation glyphs on GUI
2981 frames. If some spare pixels are left on the line after inserting
2982 the truncation glyphs, fill that space with a stretch glyph of a
2983 suitably computed width.
2984
2985 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
2986 produce_glyphs, to support GUI sessions.
2987
31571fd7
PE
29882012-07-07 Paul Eggert <eggert@cs.ucla.edu>
2989
5a16b9bc
PE
2990 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
2991
f3047c75
PE
2992 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
2993
31571fd7
PE
2994 Do not require float-time's arg to fit in time_t (Bug#11825).
2995 This works better on hosts where time_t is unsigned, and where
2996 float-time is applied to the (negative) difference between two times.
2997 * editfns.c (decode_time_components): Last arg is now double *,
2998 not int *, and means to store all the result as a double, without
2999 worrying about whether the seconds part fits in time_t.
3000 All callers changed.
3001 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3002 All callers changed.
3003 (Ffloat_time): Do not fail merely because the specified time falls
3004 outside of time_t range.
3005
4516fbef
GM
30062012-07-07 Glenn Morris <rgm@gnu.org>
3007
3008 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3009 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3010 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3011
07adc2c6
JB
30122012-07-07 Juanma Barranquero <lekktu@gmail.com>
3013
3014 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3015 Update dependencies.
3016
3017 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3018
fd573f31
PE
30192012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3020
fee5959d
PE
3021 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3022 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3023 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3024 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3025 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3026 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3027
fd573f31
PE
3028 * xfont.c (compare_font_names): Redo to omit the need for casts.
3029
ddadbc0e
AS
30302012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3031
fca8d6b6
AS
3032 * xfns.c (Fx_change_window_property): Doc fix.
3033 * w32fns.c (Fx_change_window_property): Doc fix.
3034
ddadbc0e
AS
3035 * w32fns.c (Fx_window_property): Accept the same arguments as the
3036 X Windows version. Doc fix.
3037 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3038
ed9265fc 30392012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
3040 Eli Zaretskii <eliz@gnu.org>
3041
3042 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3043 Windows-specific code from nt/config.nt moved here.
3044 Obsolete settings removed.
3045
216ee680
PE
30462012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3047
3048 * process.c: Avoid unnecessary calls to gettime.
3049 (wait_reading_process_output): Don't get the time of day
3050 when gobbling data immediately and not waiting, as there's no need
3051 for it in that case. This removes a FIXME.
3052
bdd091e4
JD
30532012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3054
3055 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3056 is defined (Bug#11768).
3057
9d44f8ce
DA
30582012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3059
3060 Fix marker debugging code.
3061 * marker.c (byte_char_debug_check): Do not perform the check
3062 if buffer is not multibyte.
090bd7cb
JB
3063 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3064 Call byte_char_debug_check with correct arguments.
9d44f8ce 3065
90fc4786
DA
30662012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3067
3068 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
3069 * marker.c (byte_char_debug_check, count_markers):
3070 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
3071 (byte_debug_flag): Remove.
3072 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3073 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3074
7b7ae965
DA
30752012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3076
4e57b342
DA
3077 Avoid code repetition in marker-related functions.
3078 * marker.c (attach_marker): New function.
3079 (Fset_marker, set_marker_restricted, set_marker_both)
3080 (set_marker_restricted_both): Use it.
3081 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3082 Consistently rename charno to charpos.
3083 (marker_position): Add eassert.
3084 (marker_byte_position): Convert to eassert.
3085
30862012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3087
3088 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 3089 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 3090 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 3091
657924ff
DA
30922012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3093
3094 Introduce fast path for the widely used marker operation.
3095 * alloc.c (build_marker): New function.
3096 * lisp.h (build_marker): New prototype.
3097 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3098 * composite.c (autocmp_chars): Likewise.
3099 * editfns.c (buildmark): Remove.
3100 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3101 (save_restriction_save): Use build_marker.
3102 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3103 * window.c (save_window_save): Likewise.
3104
041a49a6
DA
31052012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3106
3107 Do not use Fdelete_overlay in delete_all_overlays
3108 to avoid redundant calls to unchain_overlay.
3109 * buffer.c (drop_overlay): New function.
3110 (delete_all_overlays, Fdelete_overlay): Use it.
3111 * minibuf.c (get_minibuffer): Fix comment.
3112
7dca65a4
PE
31132012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3114
3115 Port to OpenBSD 5.1 amd64.
3116 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3117 This is needed for OpenBSD, and should be harmless on all BSD systems.
3118 Also, include <sys/sysctl.h>, as it should be available on all
3119 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3120 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3121 use p_pid member, not kp_proc.pid.
3122
8eb876e2
GM
31232012-07-06 Glenn Morris <rgm@gnu.org>
3124
3125 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3126
38182d90
PE
31272012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3128
3129 More xmalloc and related cleanup.
3130 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3131 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3132 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3133 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3134 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3135 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3136 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3137 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3138 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3139 * xterm.c:
3140 Omit needless casts involving void * pointers and allocation.
3141 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3142 as the former is more robust if P's type is changed.
3143 Prefer xzalloc to xmalloc + memset 0.
3144 Simplify malloc-or-realloc to realloc.
3145 Don't worry about xmalloc returning a null pointer.
3146 Prefer xstrdup to xmalloc + strcpy.
3147 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3148 growing it.
3149 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3150 alloca of a constant.
3151
6dd5a677
EZ
31522012-07-05 Eli Zaretskii <eliz@gnu.org>
3153
3154 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3155 hscroll is larger than the line width. Fixes long and futile
3156 looping inside extend_face_to_end_of_line (on a TTY) producing
3157 glyphs that are not needed and thrown away.
3158
6b312f0f
DA
31592012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3160
3161 * marker.c (set_marker_restricted_both): Simplify by using
3162 clip_to_bounds.
3163
f520ef9b
PE
31642012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3165
3166 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3167
383b7c95
JD
31682012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3169
3170 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3171 not defined (Bug#11768).
3172 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3173 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3174 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3175 followed by gtk_box_set_homogeneous (Bug#11768).
3176 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
3177 (update_theme_scrollbar_width, xg_create_scroll_bar):
3178 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
3179 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3180 (is_box_type): New function (Bug#11768).
3181 (xg_tool_item_stale_p): Call is_box_type.
5293d758 3182 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
3183 with default display (Bug#11768).
3184
d6e7bf45
EZ
31852012-07-05 Eli Zaretskii <eliz@gnu.org>
3186
3187 * xdisp.c (window_hscroll_limited): New function.
3188 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3189 coordinates when window's hscroll is set to insanely large
3190 values. (Bug#11857)
3191
431391ec
JB
31922012-07-05 Juanma Barranquero <lekktu@gmail.com>
3193
3194 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3195 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3196
23f86fce
DA
31972012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3198
3199 Cleanup xmalloc.
3200 * lisp.h (xzalloc): New prototype. Omit needless casts.
3201 * alloc.c (xzalloc): New function. Omit needless casts.
3202 * charset.c: Omit needless casts. Convert all calls to
3203 xmalloc with following memset to xzalloc.
3204 * dispnew.c: Likewise.
3205 * fringe.c: Likewise.
3206 * image.c: Likewise.
3207 * sound.c: Likewise.
3208 * term.c: Likewise.
3209 * w32fns.c: Likewise.
3210 * w32font.c: Likewise.
3211 * w32term.c: Likewise.
3212 * xfaces.c: Likewise.
3213 * xfns.c: Likewise.
3214 * xterm.c: Likewise.
3215 * atimer.c: Omit needless casts.
3216 * buffer.c: Likewise.
3217 * callproc.c: Likewise.
3218 * ccl.c: Likewise.
3219 * coding.c: Likewise.
3220 * composite.c: Likewise.
3221 * doc.c: Likewise.
3222 * doprnt.c: Likewise.
3223 * editfns.c: Likewise.
3224 * emacs.c: Likewise.
3225 * eval.c: Likewise.
3226 * filelock.c: Likewise.
3227 * fns.c: Likewise.
3228 * gtkutil.c: Likewise.
3229 * keyboard.c: Likewise.
3230 * lisp.h: Likewise.
3231 * lread.c: Likewise.
3232 * minibuf.c: Likewise.
3233 * msdos.c: Likewise.
3234 * print.c: Likewise.
3235 * process.c: Likewise.
3236 * region-cache.c: Likewise.
3237 * search.c: Likewise.
3238 * sysdep.c: Likewise.
3239 * termcap.c: Likewise.
3240 * terminal.c: Likewise.
3241 * tparam.c: Likewise.
3242 * w16select.c: Likewise.
3243 * w32.c: Likewise.
3244 * w32reg.c: Likewise.
3245 * w32select.c: Likewise.
3246 * w32uniscribe.c: Likewise.
3247 * widget.c: Likewise.
3248 * xdisp.c: Likewise.
3249 * xmenu.c: Likewise.
3250 * xrdb.c: Likewise.
3251 * xselect.c: Likewise.
3252
0497dc44
PE
32532012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3254
3255 * fileio.c (time_error_value): Check the right error number.
3256 Problem reported by Troels Nielsen in
3257 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3258
356e7178
PE
32592012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3260
4e71fd89
PE
3261 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3262 This should be fixed in a better way; see Eli Zaretskii in
3263 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3264 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3265
f0941253
PE
3266 * fileio.c (time_error_value): Rename from special_mtime.
3267 The old name's problems were noted by Eli Zaretskii in
3268 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3269
065c9eb4
PE
3270 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3271 This variable's comment says Emacs needs at least one GDB-visible
3272 symbol of type enum pvec_type, to work around GDB problems.
3273 The symbol's value doesn't matter.
3274
356e7178
PE
3275 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3276 that causes compilation to fail on pre-C99 compilers.
3277
ed9265fc 32782012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
3279
3280 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3281 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3282
3884d954
DA
32832012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3284
d209e2fb 3285 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
3286 headers for buffer_defaults and buffer_local_symbols.
3287 Reported by Juanma Barranquero <lekktu@gmail.com>.
3288
ee28be33
SM
32892012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3290
3291 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3292 * lisp.h (enum pvec_type): Use fewer bits.
3293 (PSEUDOVECTOR_SIZE_BITS): New constant.
3294 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3295 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3296 change in pvec_type.
3297 (PSEUDOVECTOR_TYPEP): New macro.
3298 (TYPED_PSEUDOVECTORP): Use it.
3299 * fns.c (internal_equal): Adapt code to extract pvectype.
3300 * emacs.c (gdb_pvec_type): Update type.
3301 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3302 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3303 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3304 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3305 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3306 abusing vector->header.next.nbytes.
3307 (live_vector_p): Use PVEC_TYPE.
3308 (mark_object): Adapt code to extract pvectype. Use switch.
3309
c7f2cd7f
PE
33102012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3311
3312 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3313 Tighten new eassert a bit.
3314
8ce70ed2
DA
33152012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3316
3317 Fix compilation with --enable-gcc-warnings and -O1
3318 optimization level.
3319 * doprnt.c (doprnt): Change type of tem to int, initialize
3320 to avoid compiler warning. Add eassert.
3321 * search.c (simple_search): Initialize match_byte to avoid
3322 compiler warning. Add eassert.
3323
dea7f1e5
PE
33242012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3325
24a212eb
PE
3326 Avoid weird behavior with large horizontal scrolls.
3327 Without this change, for example, large hscroll values would
3328 mess up Emacs's display on Fedora 15 x86, presumably due to
3329 overflows in int calculations in the display code.
3330 Also, if buffers had long lines, Emacs would freeze.
3331 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3332 (set_window_hscroll): New function, containing the old guts of
3333 Fset_window_hscroll. Return the clipped value.
3334 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3335 This avoids the need to check against PTRDIFF_MAX.
3336
dea7f1e5
PE
3337 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3338
76046526
DA
33392012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3340
3341 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3342
39adff0d
PE
33432012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3344
63807d47
PE
3345 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3346 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3347 since GCC 4.4.6 issues a bogus warning for them.
3348
39adff0d
PE
3349 Fix bugs in file timestamp newness comparisons.
3350 * fileio.c (Ffile_newer_than_file_p):
3351 * lread.c (Fload): Use full timestamp resolution of files,
3352 not just the 1-second resolution, so that files that are only
3353 slightly newer still count as newer.
3354 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3355 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3356
dbeed9a6
PE
33572012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3358
3359 * fileio.c: Improve handling of file time marker. (Bug#11852)
3360 (special_mtime): New function.
3361 (Finsert_file_contents, Fverify_visited_file_modtime):
3362 Use it to set special mtime values consistently.
3363
636334d6
AS
33642012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3365
3366 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3367 marker for non-existing file. (Bug#11852)
3368
e2017fe2
GM
33692012-07-03 Glenn Morris <rgm@gnu.org>
3370
3371 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3372 and did not make it into globals.h).
3373
404dbd37
TT
33742012-07-03 Tom Tromey <tromey@redhat.com>
3375
3376 * window.c (Fset_window_margins, Fset_window_fringes)
3377 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3378 * textprop.c (Fprevious_property_change): No longer static.
3379 * syntax.c (Fsyntax_table_p): No longer static.
3380 * process.c (Fget_process, Fprocess_datagram_address): No longer
3381 static.
3382 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3383 * keyboard.c (Fcommand_execute): No longer static.
3384 Remove EXFUN.
3385 * insdel.c (Fcombine_after_change_execute): No longer static.
3386 * image.c (Finit_image_library): No longer static.
3387 * fileio.c (Fmake_symbolic_link): No longer static.
3388 * eval.c (Ffetch_bytecode): No longer static.
3389 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
3390 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3391 No longer static.
404dbd37
TT
3392 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3393 static.
3394 * dired.c (Ffile_attributes): No longer static.
3395 * composite.c (Fcomposition_get_gstring): No longer static.
3396 * callproc.c (Fgetenv_internal): No longer static.
3397
3398 * ccl.h: Remove EXFUNs.
3399 * buffer.h: Remove EXFUNs.
3400 * dispextern.h: Remove EXFUNs.
3401 * intervals.h: Remove EXFUNs.
3402 * fontset.h: Remove EXFUN.
3403 * font.h: Remove EXFUNs.
3404 * dosfns.c (system_process_attributes): Remove EXFUN.
3405 * keymap.h: Remove EXFUNs.
3406 * lisp.h: Remove EXFUNs.
3407 * w32term.h: Remove EXFUNs.
3408 * window.h: Remove EXFUNs.
3409 * xsettings.h: Remove EXFUN.
3410 * xterm.h: Remove EXFUN.
3411
8e4fd1e1
GM
34122012-07-03 Glenn Morris <rgm@gnu.org>
3413
3414 * lisp.h (Frandom): Make it visible to C.
3415 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3416 buffer for invisible buffers. (Bug#1229)
3417
ca95b3eb
DA
34182012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3419
3420 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3421 values which aren't power of 2.
14ae4239
BT
3422 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3423 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
3424 accordingly.
3425
7555c33f
SM
34262012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3427
3428 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3429
3430 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3431
d12e8f5a
DA
34322012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3433
3434 * alloc.c (allocate_vector_block): Remove redundant
3435 calls to mallopt if DOUG_LEA_MALLOC is defined.
3436 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3437 avoid calls to mallopt if zero_vector is returned.
3438
296094c3
DA
34392012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3440
3441 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3442 is enabled, avoid dereferencing NULL current_sblock if
3443 running undumped.
3444
36429c89
DA
34452012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3446
3447 Cleanup basic buffer management.
3448 * buffer.h (struct buffer): Change layout to use generic vector
3449 marking code. Fix some comments. Change type of 'clip_changed'
3450 to bitfield. Remove unused #ifndef old.
3451 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3452 (GET_OVERLAYS_AT): Fix indentation.
3453 (for_each_per_buffer_object_at): New macro.
3454 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3455 (Fbuffer_local_variables): Use it.
3456 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3457 * alloc.c (allocate_buffer): Adjust to match new layout of
3458 struct buffer. Fix comment.
3459 (mark_overlay): New function.
3460 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3461 Lisp area of struct buffer.
3462 (mark_object): Use it. Adjust marking of misc objects
3463 and related comments.
3464
3b3e4cac
PE
34652012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3466
3467 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3468 wrapper that is not needed because the wrapped code is a no-op (zero
3469 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3470 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3471
cf5c0175
DA
34722012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3473
3474 * alloc.c (mark_buffer): Simplify. Remove prototype.
3475 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 3476 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
3477 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3478 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 3479
ca26824c
GM
34802012-06-30 Glenn Morris <rgm@gnu.org>
3481
2e4c5312
GM
3482 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3483
ca26824c
GM
3484 * epaths.in (PATH_SITELOADSEARCH): New.
3485 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3486 This is rather than relying on --enable-locallisppath elements
3487 having "site-lisp" in their names. (Bug#10208#25, 11658)
3488
0d23c240
EZ
34892012-06-30 Eli Zaretskii <eliz@gnu.org>
3490
c9240d7a
EZ
3491 * w32proc.c (sys_select): Accept and ignore one more argument.
3492
3493 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3494
0d23c240 3495 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 3496 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
3497
3498 * sysdep.c: Don't include dos.h and dosfns.h.
3499
3500 * process.c (sys_select):
3501 * msdos.c (sys_select): Accept one more argument and ignore it.
3502
3503 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3504 adapt data types and code to that.
3505
3506 * dosfns.c:
3507 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3508 which clashes with the gnulib function of the same name.
3509
af5a5a98
AS
35102012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3511
c5e4379c
AS
3512 * font.c (font_style_to_value, font_style_symbolic)
3513 (font_prop_validate_style): Add type checks for values in
3514 font_style_table.
3515
af5a5a98
AS
3516 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3517 argument.
3518 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3519 uses.
3520
8d38f461
EZ
35212012-06-29 Eli Zaretskii <eliz@gnu.org>
3522
2e5a6631
EZ
3523 * xdisp.c (try_window_id): Undo last change.
3524
8d38f461
EZ
3525 * w32.c (getwd): Adjust commentary about startup_dir.
3526 (init_environment): Always call sys_access, even in non-MSVC
3527 builds. Don't chdir to the directory of the Emacs executable.
3528 This undoes code from 1997 which was justified by the need to
3529 "avoid conflicts when removing and renaming directories". But its
3530 downside was that every relative file name was being interpreted
3531 relative to the directory of the Emacs executable, which can never
3532 be TRT. In particular, it broke sys_access when called with
3533 relative file names.
3534 (sys_access): Map GetLastError to errno.
3535
2af3565e
DA
35362012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3537
3538 * window.h (struct window): Change type of 'fringes_outside_margins'
3539 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 3540 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
3541 Adjust comment.
3542 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3543 to ptrdiff_t.
3544
c8d3a25c 35452012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 3546
c8d3a25c
GM
3547 * gnutls.c (emacs_gnutls_handshake):
3548 Add QUIT to make the loop interruptible.
57570cd3 3549
c8d3a25c 35502012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 3551
c8d3a25c
GM
3552 * charset.c (init_charset): Make lack of etc/charsets fatal.
3553
3e984ee8
DA
35542012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3555
3556 * editfns.c (region_limit): Fix type mismatch.
3557
ef884f23
DA
35582012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3559
3560 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3561 undefined. Convert from xassert to eassert.
3562 * nsmenu.m: Convert from xassert to eassert.
3563 * nsterm.m: Likewise.
3564
7d7e0027
SM
35652012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3566
3567 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3568
aa754e6a
PE
35692012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3570
3571 Avoid integer overflow on scroll-left and scroll-right.
3572 * window.c (HSCROLL_MAX): New macro.
3573 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3574 overflow when requested scroll falls outside ptrdiff_t range.
3575
80b00b08
DA
35762012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3577
3578 * window.h (struct window): Change type of 'hscroll',
3579 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3580 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3581 Adjust users accordingly.
3582 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3583 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3584 from EMACS_INT to ptrdiff_t.
3585 (make_window): Omit redundant initialization.
3586
62b2bcf6
JB
35872012-06-28 Juanma Barranquero <lekktu@gmail.com>
3588
3589 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3590
45942c7d
DA
35912012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3592
3593 * window.h (struct window): Change type of 'use_time' and
3594 'sequence_number' from Lisp_Object to int.
3595 * frame.c (make_frame): Adjust users accordingly.
3596 * print.c (print_object): Likewise.
3597 * window.c (select_window, Fwindow_use_time, make_parent_window)
3598 (make_window): Likewise.
3599
e509cfa6
DA
36002012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3601
3602 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3603 enabled with --enable-checking=[all,glyphs] configure option.
3604 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3605 adjust comments accordingly.
3606 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3607 undefined, adjust comments accordingly.
3608 * image.c: Likewise.
3609 * scroll.c: Likewise.
3610 * w32fns.c: Likewise.
3611 * w32term.c: Likewise.
3612 * xdisp.c: Likewise.
3613 * xfaces.c: Likewise.
3614 * xfns.c: Likewise.
3615 * xterm.c: Likewise.
3616
a54e2c05
DA
36172012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3618
3619 Generalize run-time debugging checks.
3620 * dispextern.h (XASSERTS): Remove.
3621 * fontset.c (xassert): Remove.
3622 Convert from xassert to eassert.
3623 * alloc.c: Convert from xassert to eassert.
3624 * bidi.c: Likewise.
3625 * dispnew.c: Likewise.
3626 * fns.c: Likewise.
3627 * fringe.c: Likewise.
3628 * ftfont.c: Likewise.
3629 * gtkutil.c: Likewise.
3630 * image.c: Likewise.
3631 * keyboard.c: Likewise.
3632 * menu.c: Likewise.
3633 * process.c: Likewise.
3634 * scroll.c: Likewise.
3635 * sound.c: Likewise.
3636 * term.c: Likewise.
3637 * w32console.c: Likewise.
3638 * w32fns.c: Likewise.
3639 * w32term.c: Likewise.
3640 * window.c: Likewise.
3641 * xdisp.c: Likewise.
3642 * xfaces.c: Likewise.
3643 * xfns.c: Likewise.
3644 * xselect.c: Likewise.
3645 * xterm.c: Likewise.
3646
1ec4b7b2
SM
36472012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3648
3649 * fns.c (maybe_resize_hash_table): Output message when growing the
3650 purify-hashtable.
3651
2014308a
DA
36522012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3653
3654 * alloc.c (allocate_string_data): Remove dead code.
3655 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3656 avoid GCC warning about unused macro.
3657
246155eb
DA
36582012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3659
3660 * alloc.c (allocate_string): Omit intervals initialization.
3661 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3662 as in make_pure_string and make_pure_c_string.
3663
43184b7b
DA
36642012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3665
d209e2fb 3666 * alloc.c (allocate_string): Fix last change.
43184b7b 3667
3fe6dd74
DA
36682012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3669
d209e2fb 3670 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
3671 to memset, add explicit initialization where appropriate.
3672
1ba6038a
GM
36732012-06-27 Glenn Morris <rgm@gnu.org>
3674
3675 * lisp.mk (lisp): Remove paths.elc.
3676
c89926a5
CY
36772012-06-27 Chong Yidong <cyd@gnu.org>
3678
3679 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3680
ed6b3510
JW
36812012-06-26 John Wiegley <johnw@newartisans.com>
3682
1ec4b7b2 3683 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
3684 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3685
ed6b3510
JW
3686 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3687 when building with Clang.
3688
8edd4a2b
SM
36892012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3690
3691 * eval.c (Fapply): Allow calling it with a single argument.
3692
f6f62d1b
EZ
36932012-06-26 Eli Zaretskii <eliz@gnu.org>
3694
3695 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3696 _stricmp and _strnicmp.
3697 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3698
62efea5e
DA
36992012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3700
3701 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3702 allocated window.
3703 (allocate_process): Likewise for new process.
8edd4a2b 3704 (allocate_terminal): Change to use offsetof.
62efea5e
DA
3705 (allocate_frame): Likewise.
3706 * frame.c (make_frame): Omit redundant initialization.
3707 * window.c (make_parent_window): Use memset.
3708 (make_window): Omit redundant initialization.
3709 * process.c (make_process): Omit redundant initialization.
3710 * terminal.c (create_terminal): Likewise.
3711
42997f4d
DA
37122012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3713
3714 * term.c (delete_tty): Remove redundant call to memset.
3715
1130ecfc
DA
37162012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3717
3718 * alloc.c: Remove build_string.
3719 * lisp.h: Define build_string as static inline. This provides
3720 a better opportunity to optimize away calls to strlen when the
3721 function is called with compile-time constant argument.
3722 * image.c (imagemagick_error): Convert to build_string.
3723 * w32proc.c (sys_spawnve): Likewise.
3724 * xterm.c (x_term_init): Likewise.
3725
cf38a720
PE
37262012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3727
99027bdd
PE
3728 Use sprintf return value instead of invoking strlen on result.
3729 In the old days this wasn't portable, since some sprintf
3730 implementations returned char *. But they died out years ago and
3731 Emacs already assumes sprintf returns int.
3732 Similarly for float_to_string.
3733 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3734 * ccl.c (ccl_driver):
3735 * character.c (string_escape_byte8):
3736 * data.c (Fnumber_to_string):
3737 * doprnt.c (doprnt):
3738 * print.c (print_object):
3739 * xdisp.c (message_dolog):
3740 * xfns.c (syms_of_xfns):
3741 Use sprintf or float_to_string result to avoid need to call strlen.
3742 * data.c (Fnumber_to_string):
3743 Use make_unibyte_string, since the string must be ASCII.
3744 * lisp.h, print.c (float_to_string): Now returns int length.
3745 * term.c (produce_glyphless_glyph):
3746 Use sprintf result rather than recomputing it.
3747
cf38a720
PE
3748 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3749 * Makefile.in (ALL_CFLAGS):
3750 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3751 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3752
3511c784
DA
37532012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3754
0a08eb21 3755 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
3756 strcasecmp if available.
3757 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3758
fb7da12e
AS
37592012-06-25 Andreas Schwab <schwab@linux-m68k.org>
3760
3761 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3762 Avoid comma operator.
3763 * menu.c (push_submenu_start, push_submenu_end)
3764 (push_left_right_boundary, push_menu_pane): Likewise.
3765 * msdos.c (dos_rawgetc): Likewise.
3766
afa2ffd8
DA
37672012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3768
3769 * xfns.c (xic_create_fontsetname): Remove redundant calls
3770 to memset.
3771
b3b4476b
PE
37722012-06-25 Paul Eggert <eggert@cs.ucla.edu>
3773
4495ff38
PE
3774 * gtkutil.c (get_utf8_string): Remove redundant assignment.
3775 sprintf already null-terminates its output.
3776
b3b4476b
PE
3777 * xfns.c (x_window): Remove redundant cast.
3778
b00876c9
DA
37792012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3780
3781 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3782 `const char *' to `char *' to avoid compiler warning.
3783
d188e26b
PE
37842012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3785
885d1d74
PE
3786 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3787 instead of truncating it to 63 (admittedly a generous limit).
3788
d188e26b
PE
3789 * process.c: Fix spelling and caps in comments.
3790
e2f560b1
DN
37912012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
3792
e86db54b 3793 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
3794 * sysdep.c (setpgrp): Remove definition, not used in this file.
3795
7583a3a1
JB
37962012-06-24 Juanma Barranquero <lekktu@gmail.com>
3797
3798 * makefile.w32-in: Update dependencies.
3799
696056c2
EZ
38002012-06-24 Eli Zaretskii <eliz@gnu.org>
3801
3802 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3803 (SYSTIME_H): Add nt/inc/sys/time.h.
3804
3805 * systime.h [WINDOWSNT]: Include sys/time.h.
3806
3807 * s/ms-w32.h (struct timespec): Definition moved from
3808 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3809
845ca893
PE
38102012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3811
3812 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
3813 * buffer.h (buffer_slot_type_mismatch):
3814 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3815 * eval.c (unwind_to_catch):
3816 * image.c (my_png_error, my_error_exit):
3817 * keyboard.c (quit_throw_to_read_char, user_error)
3818 (Fexit_recursive_edit, Fabort_recursive_edit):
3819 * lisp.h (die, args_out_of_range, args_out_of_range_3)
3820 (wrong_type_argument, buffer_overflow, __executable_start)
3821 (memory_full, buffer_memory_full, string_overflow, Fthrow)
3822 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3823 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3824 (fatal):
3825 (child_setup) [!DOS_NT]:
3826 * lread.c (end_of_file_error, invalid_syntax):
3827 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3828 * puresize.h (pure_write_error):
3829 * search.c (matcher_overflow):
3830 * sound.c (sound_perror, alsa_sound_perror):
3831 * sysdep.c, syssignal.h (croak):
3832 * term.c (maybe_fatal, vfatal):
3833 * textprop.c (text_read_only):
3834 * undo.c (user_error):
3835 * unexmacosx.c (unexec_error):
3836 * xterm.c (x_ins_del_lines, x_delete_glyphs):
3837 Use _Noreturn rather than NO_RETURN.
3838 No need for separate decl merely because of _Noreturn.
3839 * sound.c (sound_warning, parse_sound):
3840 Remove unnecessary forward decls.
3841
f1dd8073
PE
38422012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3843
3844 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3845 * lisp.h (WAIT_READING_MAX): New macro.
3846 * dispnew.c (Fsleep_for, sit_for):
3847 * keyboard.c (kbd_buffer_get_event):
3848 * process.c (Faccept_process_output):
3849 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3850 This improves on the previous patch, which introduced a bug
3851 when time_t is unsigned and as wide as intmax_t.
3852 See <http://bugs.gnu.org/9000#51>.
3853
b82c1755
EZ
38542012-06-23 Eli Zaretskii <eliz@gnu.org>
3855
3856 * dispnew.c (sit_for, Fsleep_for):
3857 * keyboard.c (kbd_buffer_get_event):
3858 * process.c (Faccept_process_output): Avoid compiler warnings when
3859 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3860
ca300656
JB
38612012-06-23 Juanma Barranquero <lekktu@gmail.com>
3862
049ec95b
JB
3863 * makefile.w32-in: Update dependencies.
3864
ca300656
JB
3865 * w32.c (ltime): Add return type and declare static.
3866 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3867
db7b8d06
PE
38682012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3869
3870 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
3871 Privately reported by Herbert J. Skuhra.
3872 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
3873 All uses changed.
3874 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
3875 not make_lisp_timeval, when the argument is of type EMACS_TIME.
3876
0bd8297f
EZ
38772012-06-23 Eli Zaretskii <eliz@gnu.org>
3878
96512555
EZ
3879 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
3880 last argument of make_unibyte_string.
3881
0bd8297f
EZ
3882 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
3883 language ID in the event parameters.
3884
3885 * w32term.c (w32_read_socket): Put the new keyboard codepage into
3886 event.code, not the obscure "character set ID".
3887
63def6b6
CY
38882012-06-23 Chong Yidong <cyd@gnu.org>
3889
3890 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
3891
e8a02204
EZ
38922012-06-23 Eli Zaretskii <eliz@gnu.org>
3893
388cdec0
EZ
3894 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
3895 * w32.c (fdutimens): New function.
3896
3897 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
3898
3899 * s/ms-w32.h (pselect): Redirect to sys_select.
3900
3901 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
3902
e8a02204
EZ
3903 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
3904 in the logic of incrementing and decrementing the value of
3905 use_relocatable_buffers.
3906
d054f3fb
PE
39072012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3908
3909 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
3910 Privately reported by Herbert J. Skuhra.
3911 [__FreeBSD__]: Remove "*/" typo after "#include".
3912 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
3913 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
3914 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
3915 Don't assume EMACS_TIME and struct timeval are the same type.
3916
d35af63c
PE
39172012-06-22 Paul Eggert <eggert@cs.ucla.edu>
3918
3919 Support higher-resolution time stamps (Bug#9000).
3920 The time stamps are only nanosecond-resolution at the C level,
3921 since that's the best that any real-world system supports now.
3922 But they are picosecond-resolution at the Lisp level, as that's
3923 easy, and leaves room for future OS improvements.
3924
3925 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
3926 (LIBES): Use it.
3927
3928 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
3929 Don't get current time unless it's needed.
3930
3931 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
3932 now provides it if it's absent.
3933 (start_atimer): Port to higher-res time stamps.
3934 Check for time stamp overflow. Don't get current time more
3935 often than is needed.
3936
3937 * buffer.h (struct buffer): Buffer modtime now has high resolution.
3938 Include systime.h, not time.h.
3939 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
3940
3941 * dired.c: Include stat-time.h.
3942 (Ffile-attributes): File times now have higher resolution.
3943
3944 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
3945 (struct image): Timestamp now has higher resolution.
3946
3947 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
3948 has at least microseconds now. All uses removed.
3949 (update_frame, update_single_window, update_window, update_frame_1)
3950 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 3951 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
3952
3953 * editfns.c (time_overflow): Now extern.
3954 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
3955 (float-time, Fformat_time_string, Fcurrent_time_string)
3956 (Fcurrent_time_zone): Accept and generate higher-resolution
3957 time stamps.
3958 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
3959 (decode_time_components, lisp_seconds_argument): New functions.
3960 (make_time): Now static.
3961 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
3962 Report an error if the time is invalid, rather than having the caller
3963 do that.
3964
3965 * fileio.c: Include <stat-time.h>
3966 (Fcopy_file): Copy higher-resolution time stamps.
3967 Prefer to set the time stamp via a file descriptor if that works.
3968 (Fset_file_times, Finsert_file_contents, Fwrite_region)
3969 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
3970 (Fvisited_file_modtime, Fset_visited_file_modtime):
3971 Support higher-resolution time stamps.
3972
3973 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
3974
3975 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
3976
3977 * image.c (prepare_image_for_display, clear_image_cache)
3978 (lookup_image): Port to higer-resolution time stamps.
3979
3980 * keyboard.c (start_polling, bind_polling_period):
3981 Check for time stamp overflow.
3982 (read_char, kbd_buffer_get_event, timer_start_idle)
3983 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
3984 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
3985 Port to higher-resolution time stamps. Do not assume time_t is signed.
3986 (decode_timer): New function. Timers are now vectors of length 9,
3987 not 8, to accommodate the picosecond component.
3988 (timer_check_2): Use it.
3989
3990 * nsterm.m (select_timeout, timeval_subtract): Remove.
3991 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
3992 as they're a bit more accurate and handle overflow better.
3993 (ns_select): Change prototype to be compatible with pselect.
3994 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
3995 * nsterm.h (ns_select): Adjust prototype.
3996
3997 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
3998 us-resolution time stamps.
3999 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4000
4001 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4002
4003 * lisp.h (time_overflow): New decl.
4004 (wait_reading_process_output): First arg is now intmax_t, not int,
4005 to accommodate larger waits.
4006
4007 * process.h (struct Lisp_Process.read_output_delay):
4008 Now counts nanoseconds, not microseconds.
4009 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4010 EMACS_HAS_USECS.
4011 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4012 (wait_reading_process_output):
4013 Port to ns-resolution time stamps.
4014 (Faccept_process_output, wait_reading_process_output):
4015 Check for time stamp overflow. Do not assume time_t is signed.
4016 (select_wrapper): Remove; we now use pselect.
4017 (Fprocess_attributes): Now generates ns-resolution time stamps.
4018
4019 * sysdep.c: Include utimens.h. Don't include utime.h
4020 or worry about struct utimbuf; gnulib does that for us now.
4021 (gettimeofday): Remove; gnulib provides a substitute.
4022 (make_timeval): New function.
4023 (set_file_times): Now sets ns-resolution time stamps.
4024 New arg FD; all uses changed.
4025 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4026 (system_process_attributes):
4027 Now returns ns-resolution time stamp. All uses changed.
4028 Check for time stamp overflow.
4029
4030 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4031 provides a substitute now.
4032
4033 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4034 since it guarantees struct timespec.
4035 (EMACS_TIME): Now struct timespec, so that we can support
4036 ns-resolution time stamps.
4037 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4038 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4039 (EMACS_USECS): Remove.
4040 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4041 so multiply the arg by 1000 before storing it.
4042 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4043 New macros.
4044 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4045 Port to ns-resolution time stamps.
4046 (EMACS_TIME_NEG_P): Remove; replaced by....
4047 (EMACS_TIME_SIGN): New macro.
4048 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4049 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4050 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4051 (make_timeval, make_lisp_time, decode_time_components): New decls.
4052 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4053 that it mishandled time_t overflow. You can't compare by subtracting!
4054 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4055 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4056
4057 * term.c: Include <sys/time.h>.
4058 (timeval_to_Time): New function, for proper overflow wraparound.
4059 (term_mouse_position, term_mouse_click): Use it.
4060
4061 * undo.c (record_first_change): Support higher-resolution time stamps
4062 in the undo buffer.
4063 (Fprimitive_undo): Use them when restoring time stamps.
4064
4065 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4066 (w32_get_internal_run_time):
4067 Port to higher-resolution Emacs time stamps.
4068 (ltime): Now accepts single 64-bit integer, as that's more convenient
4069 for callers.
4070
4071 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4072
4073 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4074 for compatibility with pselect. Support ns-resolution time stamps.
4075
4076 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4077
4078 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4079 Check for time stamp overflow, and support ns-resolution time stamps.
4080
4081 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4082 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4083 (timeval_subtract): Remove; no longer needed.
4084 (XTflash, XTring_bell, x_wait_for_event):
4085 Port to ns-resolution time stamps. Don't assume time_t is signed.
4086
b6a92dfe
CY
40872012-06-22 Chong Yidong <cyd@gnu.org>
4088
4089 * xdisp.c (x_consider_frame_title): Revert last change.
4090
d251c37c
EZ
40912012-06-22 Eli Zaretskii <eliz@gnu.org>
4092
4093 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4094 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4095 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4096 staticidx goes up to 1597 out of 1600 = 0x640.)
4097
f10deafb
PE
40982012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4099
4100 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4101 Otherwise, the umask might be mistakenly 0 while handling input signals.
4102
ec6de1e2
SM
41032012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4104
4105 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4106
28be1ada
DA
41072012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4108
4109 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4110 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4111 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4112 access to `contents' member of Lisp_Vector objects with AREF and ASET
4113 where appropriate.
4114
c6bf3022
CY
41152012-06-19 Chong Yidong <cyd@gnu.org>
4116
4117 * frame.c (delete_frame): When selecting a frame on a different
4118 text terminal, do not alter the terminal's top-frame.
4119
4120 * xdisp.c (format_mode_line_unwind_data): Record the target
4121 frame's selected window and its terminal's top-frame.
4122 (unwind_format_mode_line): Restore them.
4123 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4124 Callers changed.
4125 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4126 since tty frames can be explicitly named.
4127 (prepare_menu_bars): Likewise.
4128
4129 * term.c (Ftty_top_frame): New function.
4130
defd4196
PE
41312012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4132
4133 Port byte-code-meter to modern targets.
4134 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4135 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 4136 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
4137 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4138 (METER_1, METER_2): Simplify.
4139
1053a871
SM
41402012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4141
4142 * data.c (Fdefalias): Return `symbol' (bug#11686).
4143
b7e8d081
MR
41442012-06-18 Martin Rudalics <rudalics@gmx.at>
4145
4146 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
4147 gets killed during executing of this function (Bug#11665).
4148 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
4149 (Vkill_buffer_query_functions): In doc-string say that functions
4150 run by this hook should not change the current buffer.
4151
7ea2b339
PE
41522012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4153
4154 Fix recently-introduced process.c problems found by static checking.
4155 * process.c (write_queue_push, write_queue_pop, send_process):
4156 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4157 (write_queue_pop): Fix pointer signedness problem.
4158 (send_process): Remove unused local.
4159
96a313a1
CY
41602012-06-17 Chong Yidong <cyd@gnu.org>
4161
4162 * xdisp.c (redisplay_internal): No need to redisplay terminal
4163 frames that are not on top.
4164
20ca2e94
TN
41652012-06-17 Troels Nielsen <bn.troels@gmail.com>
4166
4167 * process.c (make_process): Initialize write_queue.
4168 (write_queue_push, write_queue_pop): New functions.
4169 (send_process): Use them to maintain correct ordering of process
4170 writes (Bug#10815).
4171
9a900ca9
PE
41722012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4173
310fbfa8
PE
4174 * lisp.h (eassert): Assume C89 or later.
4175 This removes the need for CHECK.
4176 (CHECK): Remove. Its comments about always evaluating its
4177 argument were confusing, as 'eassert' typically does not evaluate
4178 its argument.
4179
27bb1ca4
PE
4180 * coding.c (produce_chars): Use ptrdiff_t, not int.
4181
9a900ca9
PE
4182 * xterm.c (x_draw_underwave): Check for integer overflow.
4183 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4184
41b7f8bc 41852012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
4186
4187 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4188 referenced (Bug#11583).
4189
9b0e3eba
AA
41902012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4191
4192 Implement wave-style variant of underlining.
4193 * dispextern.h (face_underline_type): New enum.
4194 (face): Add field for underline type.
4195 * nsterm.m (ns_draw_underwave): New function.
4196 (ns_draw_text_decoration): Use it.
4197 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4198 New functions.
4199 (x_draw_glyph_string): Use them.
4200 * xfaces.c (Qline, Qwave): New Lisp objects.
4201 (check_lface_attrs, merge_face_ref)
1053a871
SM
4202 (Finternal_set_lisp_face_attribute, realize_x_face):
4203 Handle wave-style underline face attributes.
9b0e3eba
AA
4204 * xterm.c (x_draw_underwave): New function.
4205 (x_draw_glyph_string): Use it.
4206
0fb52f11
JB
42072012-06-16 Juanma Barranquero <lekktu@gmail.com>
4208
4209 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4210 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4211 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4212 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4213 ($(BLD)/w32select.$(O)): Update dependencies.
4214
e5560ff7
AS
42152012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4216
4217 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4218 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4219 * character.c (_fetch_multibyte_char_p): Remove.
4220 * alloc.c: Include "character.h" before "buffer.h".
4221 * bidi.c: Likewise.
4222 * buffer.c: Likewise.
4223 * bytecode.c: Likewise.
4224 * callint.c: Likewise.
4225 * callproc.c: Likewise.
4226 * casefiddle.c: Likewise.
4227 * casetab.c: Likewise.
4228 * category.c: Likewise.
4229 * cmds.c: Likewise.
4230 * coding.c: Likewise.
4231 * composite.c: Likewise.
4232 * dired.c: Likewise.
4233 * dispnew.c: Likewise.
4234 * doc.c: Likewise.
4235 * dosfns.c: Likewise.
4236 * editfns.c: Likewise.
4237 * emacs.c: Likewise.
4238 * fileio.c: Likewise.
4239 * filelock.c: Likewise.
4240 * font.c: Likewise.
4241 * fontset.c: Likewise.
4242 * fringe.c: Likewise.
4243 * indent.c: Likewise.
4244 * insdel.c: Likewise.
4245 * intervals.c: Likewise.
4246 * keyboard.c: Likewise.
4247 * keymap.c: Likewise.
4248 * lread.c: Likewise.
4249 * macros.c: Likewise.
4250 * marker.c: Likewise.
4251 * minibuf.c: Likewise.
4252 * nsfns.m: Likewise.
4253 * nsmenu.m: Likewise.
4254 * print.c: Likewise.
4255 * process.c: Likewise.
4256 * regex.c: Likewise.
4257 * region-cache.c: Likewise.
4258 * search.c: Likewise.
4259 * syntax.c: Likewise.
4260 * term.c: Likewise.
4261 * textprop.c: Likewise.
4262 * undo.c: Likewise.
4263 * unexsol.c: Likewise.
4264 * w16select.c: Likewise.
4265 * w32fns.c: Likewise.
4266 * w32menu.c: Likewise.
4267 * window.c: Likewise.
4268 * xdisp.c: Likewise.
4269 * xfns.c: Likewise.
4270 * xmenu.c: Likewise.
4271 * xml.c: Likewise.
4272 * xselect.c: Likewise.
4273
2f07e6af
EZ
42742012-06-16 Eli Zaretskii <eliz@gnu.org>
4275
1053a871
SM
4276 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4277 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 4278 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
4279 row.
4280 (handle_face_prop): Use chunk-relative overlay string index when
4281 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
4282 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4283 the rightmost. (Bug#11720)
2f07e6af 4284
29b83cec
AS
42852012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4286
4287 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4288 (CATEGORY_MEMBER): Enforce 1/0 value.
4289 * category.c (_temp_category_set): Remove.
4290
4c5501e9
EZ
42912012-06-16 Eli Zaretskii <eliz@gnu.org>
4292
4293 * window.c (Fdelete_other_windows_internal)
4294 (Fdelete_window_internal): Don't access frame's mouse highlight
4295 info of the initial frame. (Bug#11677)
4296
2b570124
PE
42972012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4298
e93864f9
PE
4299 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4300 Assume USE_2_TAGS_FOR_INTS.
4301 (xreload): Adjust $tagmask width to match recent lisp.h change.
4302
2b570124
PE
4303 Simplify lisp.h in minor ways that should not affect code.
4304 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4305 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4306 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4307 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4308 (INTTYPEBITS): New macro, for clarity.
4309 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
4310 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4311 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
4312 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4313 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4314
81755f69
JB
43152012-06-13 Juanma Barranquero <lekktu@gmail.com>
4316
4317 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4318
16192a57
GM
43192012-06-13 Glenn Morris <rgm@gnu.org>
4320
4321 * s/bsd-common.h (BSD4_3):
4322 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4323
646b5f55
AS
43242012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4325
4326 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4327 instead of union.
4328 (XLI, XIL): Define.
1053a871
SM
4329 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4330 Use them.
4331 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 4332 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 4333 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
4334 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4335 * frame.c (delete_frame): Remove outdated comment.
4336 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4337 USE_LISP_UNION_TYPE.
4338 (Fw32_unregister_hot_key): Likewise.
4339 (Fw32_toggle_lock_key): Likewise.
4340 * w32menu.c (add_menu_item): Likewise.
4341 (w32_menu_display_help): Use XIL instead of checking
4342 USE_LISP_UNION_TYPE.
4343 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4344 (init_heap): Likewise.
4345 * w32term.c (w32_read_socket): Update comment.
4346
1d3823c9
GM
43472012-06-13 Glenn Morris <rgm@gnu.org>
4348
c62ff706
GM
4349 * s/usg5-4-common.h, src/s/unixware.h:
4350 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4351
1d3823c9
GM
4352 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4353
bfe3e0a2
PE
43542012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4355
4356 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4357 * alloc.c (make_number) [!defined make_number]:
4358 Remove, as lisp.h always defines this now.
4359 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4360 (roundup_size): Verify that it is a power of 2.
4361 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4362 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4363 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4364 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4365 USE_LSB_TAG now is always defined to be either 0 or 1.
4366 All uses changed.
4367 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4368 code works fine either way, and efficiency is not a concern here,
4369 as the union type is for debugging, not for production.
4370 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4371 Use an inline function on all platforms when using the union type,
4372 since this is simpler and 'static inline' can be used portably
4373 within Emacs now.
4374 (LISP_INITIALLY_ZERO): New macro.
4375 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4376 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4377
45fa9c0f
GM
43782012-06-12 Glenn Morris <rgm@gnu.org>
4379
b4492cba
GM
4380 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4381
4382 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 4383
45fa9c0f
GM
4384 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4385 Move BROKEN_SIGIO to configure.
4386
4387 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4388 Move NO_TERMIO to configure.
4389
0e25d334
CY
43902012-06-12 Chong Yidong <cyd@gnu.org>
4391
4392 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4393 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4394 MagickExportImagePixels is undefined.
4395
43682bb6
PE
43962012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4397
4398 * image.c (imagemagick_load_image): Remove unused label.
4399
a9be7d2b
GM
44002012-06-11 Glenn Morris <rgm@gnu.org>
4401
4402 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4403 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4404 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4405 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4406
3017f87f
SM
44072012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4408
4409 * alloc.c (make_byte_code): New function.
4410 (Fmake_byte_code): Use it. Don't purify here.
4411 * lread.c (read1): Use it as well to avoid extra allocation.
4412
1b9b4cf4
CY
44132012-06-11 Chong Yidong <cyd@gnu.org>
4414
4415 * image.c (imagemagick_load_image): Implement transparency.
4416
95988fcf
AS
44172012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4418
4419 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4420 account for preceding backslashes. (Bug#11663)
4421
cd4eb164
CY
44222012-06-09 Chong Yidong <cyd@gnu.org>
4423
4424 * term.c: Support italics in capable terminals (Bug#9652).
4425 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4426 (turn_on_face): Output using TS_enter_italic_mode if available.
4427 Don't handle unused blinking and alt-charset cases.
4428 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4429 and tty_alt_charset_p cases.
4430 (tty_capable_p, init_tty): Support italics.
4431
4432 * termchar.h (struct tty_display_info): Add field for italics.
4433 Remove unused blink field.
4434
4435 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4436 Handle slant.
4437
4438 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4439 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4440 tty_alt_charset_p. Add tty_italic_p.
4441
ff88beb8
MA
44422012-06-09 Michael Albinus <michael.albinus@gmx.de>
4443
4444 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4445 dbus_type_is_basic if available.
4446 (xd_extract_signed, xd_extract_unsigned): Rename from
4447 extract_signed and extract_unsigned, respectively. Adapt callers.
4448
44286096
CY
44492012-06-09 Chong Yidong <cyd@gnu.org>
4450
1682701f
CY
4451 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4452
44286096
CY
4453 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4454 case (Bug#9752).
4455
d86feb17
PE
44562012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4457
4458 * xdisp.c (vmessage): Treat frame message as multibyte.
4459 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4460 would generate the diagnostic "Making \302\247 buffer-local while
4461 let-bound!".
4462
d5c20fe8
EZ
44632012-06-08 Eli Zaretskii <eliz@gnu.org>
4464
4465 * dispnew.c (showing_window_margins_p): Undo last change, which
4466 was done due to an inadvertent commit.
4467 (adjust_frame_glyphs_for_frame_redisplay): Do call
4468 showing_window_margins_p.
4469
513749ee
SM
44702012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4471
4472 * eval.c (Fmake_var_non_special): New primitive.
4473 (syms_of_eval): Defsubr it.
4474 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4475
d4a8f5c1
JB
44762012-06-08 Juanma Barranquero <lekktu@gmail.com>
4477
4478 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4479 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4480
8bbbc977
EZ
44812012-06-08 Eli Zaretskii <eliz@gnu.org>
4482
4483 * alloc.c (allocate_vectorlike): Fix last change.
4484
f3372c87
DA
44852012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4486
4487 Block-based vector allocation of small vectors.
4488 * lisp.h (struct vectorlike_header): New field `nbytes',
4489 adjust comment accordingly.
4490 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4491 to denote vector blocks. Adjust users (live_vector_p,
4492 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4493 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4494 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4495 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4496 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4497 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4498 (roundup_size): New constant.
4499 (struct vector_block): New data type.
4500 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 4501 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
4502 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4503 (sweep_vectors): New functions.
4504 (allocate_vectorlike): Return `zero_vector' as the only vector of
4505 0 items. Allocate new vector from block if vector size is less than
4506 or equal to VBLOCK_BYTES_MAX.
4507 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4508 (init_alloc_once): Add call to init_vectors.
4509
4f18a4ed
SM
45102012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4511
4512 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4513
86f158bc
PE
45142012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4515
4516 * doprnt.c (doprnt): Truncate multibyte char correctly.
4517 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4518 would mishandle a string argument "Xc" if X was a multibyte
4519 character of length 2: it would truncate after X's first byte
4520 rather than including all of X.
4521
c5cfcbe0
CY
45222012-06-06 Chong Yidong <cyd@gnu.org>
4523
4524 * buffer.c (word_wrap): Doc fix.
4525
c05cf390
PE
45262012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4527
4528 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4529
0c3461de
GM
45302012-06-03 Glenn Morris <rgm@gnu.org>
4531
4532 * xdisp.c (tool-bar-style): Doc fix.
4533
c71232db
UM
45342012-06-03 Ulrich Müller <ulm@gentoo.org>
4535
4536 * Makefile.in (PAXCTL): Define.
4537 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4538 binary via PaX flags if the paxctl utility is available.
4539 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4540 Restore PaX flags to their default. (Bug#11398)
4541
383f7350
CY
45422012-06-03 Chong Yidong <cyd@gnu.org>
4543
4544 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4545 buffer (Bug#11226).
4546
5f2c76c6
CY
45472012-06-03 Chong Yidong <cyd@gnu.org>
4548
4549 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4550 (note_mode_line_or_margin_highlight): If there is no help echo,
4551 use mode-line-default-help-echo. Handle the case where the mouse
4552 position is past the end of the mode line string.
4553
4554 * buffer.c (buffer_local_value_1): New function, split from
4555 Fbuffer_local_value; can return Qunbound.
4556 (Fbuffer_local_value): Use it.
4557 (Vmode_line_format): Docstring tweaks.
4558
773d47f6
PE
45592012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4560
4561 * sysdep.c (system_process_attributes): Improve comment.
4562
f2d6a3df
SM
45632012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4564
4565 * keyboard.c: Export real-this-command to Elisp.
4566 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4567 and DEFVAR it. Update all users.
4568
63810350
PE
45692012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4570
7bd5c1f4
PE
4571 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4572
63810350
PE
4573 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4574 Convert pctcpu and pctmem to Lisp float properly.
4575 Let the compiler fold better, as 100.0/0x8000 is exact.
4576
a2821611
AS
45772012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4578
4579 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4580 cons_block.
4581
5fceba1d
PE
45822012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4583
4584 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4585
c98ff5dd
DA
45862012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4587
4588 For a 'struct window', replace some Lisp_Object fields to
4589 bitfields where appropriate, remove unused fields.
4590 * window.h (struct window): Remove unused 'last_mark_x' and
4591 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4592 change it's type from Lisp_Object to bitfield.
4593 Change type of 'force_start', 'optional_new_start',
4594 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4595 fields from Lisp_Object to bitfield. Adjust users accordingly.
4596
ca34e0be
PE
45972012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4598
4599 Pacify gcc -Wdouble-precision when using Xaw.
4600 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4601 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4602 Use 'float' consistently, rather than 'float' in most places
4603 and 'double' in a couple of places.
4604
efc00ab1 46052012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
4606
4607 * xdisp.c (handle_stop): Detect whether we have overlay strings
4608 loaded by testing it->current.overlay_string_index to be
4609 non-negative, instead of checking whether n_overlay_strings is
4610 positive. (Bug#11587)
4611
efc00ab1 46122012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
4613
4614 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4615
4616 * doc.c (Fsubstitute_command_keys): Doc fix.
4617
efc00ab1 46182012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
4619
4620 * search.c (search_buffer): Remove calls to
4621 r_alloc_inhibit_buffer_relocation, as it is now called by
4622 maybe_unify_char, which was the cause of relocation of buffer text
4623 in bug#11519.
4624
efc00ab1 46252012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
4626
4627 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4628 for the duration of call to load_charset, to avoid problems with
4629 callers of maybe_unify_char that access buffer text through C
4630 pointers.
4631
4632 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4633 decrement the inhibition flag, instead of just setting or
4634 resetting it.
4635
ba93a187
PE
46362012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4637
4638 Remove obsolete '#define static' cruft.
4639 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4640 This #undef was "temporary" in 2000; it is no longer needed
4641 now that '#define static' has gone away.
4642 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4643 (gray_bitmap_bits): Remove; no longer needed.
4644 All uses replaced with definiens.
4645 * xterm.c: Include "bitmaps/gray.xbm".
4646
9e4bf381
PE
46472012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4648
4649 Clean up __executable_start, monstartup when --enable-profiling.
4650 The following changes affect the code only when profiling.
4651 * dispnew.c (__executable_start): Rename from safe_bcopy.
4652 Define only on platforms that need it.
4653 * emacs.c: Include <sys/gmon.h> when profiling.
4654 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4655 (__executable_start): Remove decl, since lisp.h does it now.
4656 (safe_bcopy): Remove decl; no longer has that name.
4657 (main): Coalesce #if into single bit of code, for simplicity.
4658 Cast pointers to uintptr_t, since standard libraries want integers
4659 and not pointers.
4660 * lisp.h (__executable_start): New decl.
4661
32d72c2f
GM
46622012-05-31 Glenn Morris <rgm@gnu.org>
4663
4664 * image.c (Fimagemagick_types): Doc fix.
4665
baac5bc7
JM
46662012-05-30 Jim Meyering <meyering@redhat.com>
4667
4668 * callproc.c (Fcall_process_region): Include directory component
4669 in mkstemp error message (Bug#11586).
4670
72cb32cf
PE
46712012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4672
4673 * alloc.c, lisp.h (make_pure_vector): Now static.
4674
61b108cc
SM
46752012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4676
4677 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4678 Move to byte-run.el.
4679 (Fautoload): Do the hash-doc more carefully.
4680 * data.c (Fdefalias): Purify definition, except for keymaps.
4681 (Qdefun): Move from eval.c.
4682 * lisp.h (Qdefun): Remove.
4683 * lread.c (read1): Tiny simplification.
4684
471fe23d
TN
46852012-05-29 Troels Nielsen <bn.troels@gmail.com>
4686
934f3f58 4687 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
4688 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4689 Bug#9642, but explicitly check that the buffer the overlay would
4690 be moved to is live and rearrange lines to make sure that errors
4691 will not put the overlay in an inconsistent state.
4692 (Fdelete_overlay): Cosmetics.
4693
85d0efd1
EZ
46942012-05-28 Eli Zaretskii <eliz@gnu.org>
4695
4696 * w32term.c (my_bring_window_to_top): New function.
4697 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
4698 could be different from the original one.
4699 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
4700 (Bug#11513)
4701
4702 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4703 by calling BringWindowToTop.
4704
4705 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4706 (WM_EMACS_END): Increase by one.
4707
da92a98c
PE
47082012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4709
4710 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4711 This avoids undefined behavior that might cause the eassert
4712 to not catch an out-of-range value.
4713
74d1f848
JB
47142012-05-28 Juanma Barranquero <lekktu@gmail.com>
4715
4716 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4717 Update dependencies.
4718
9e1a06fc
EZ
47192012-05-27 Eli Zaretskii <eliz@gnu.org>
4720
4721 * bidi.c (bidi_mirror_char): Fix last change.
4722
f3dd7312
AS
47232012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4724
4725 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4726 when referring to sectname field in printf format.
4727
81899c91
PE
47282012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4729
57b81a9f
PE
4730 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4731 Only r_alloc_inhibit_buffer_relocation needed to be added;
4732 the others were already declared.
4733
81899c91
PE
4734 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4735 before checking whether it's out of range. Put the check inside
4736 eassert. See
4737 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4738
33017faf 47392012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
4740
4741 * callproc.c (Fcall_process): Restore a line that was accidentally
4742 commented out in the 2011-02-13 change (bug#11547).
4743
33017faf 47442012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
4745
4746 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4747 defined on ralloc.c.
4748
4749 * buffer.c [REL_ALLOC]: Remove prototypes of
4750 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4751 they are now on lisp.h.
4752
4753 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4754
4755 * search.c (search_buffer): Use it to inhibit relocation of buffer
4756 text while re_search_2 is doing its job, because re_search_2 is
4757 passed C pointers to buffer text. (Bug#11519)
4758
23415acf
EZ
4759 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4760 Update value to 24.
4761
44e27368
EZ
4762 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4763 state after an additional call to move_it_in_display_line_to, keep
4764 the values of it->max_ascent and it->max_descent found for the
4765 entire line.
4766 (pos_visible_p): Revert the comparison against bottom_y to what it
4767 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4768 (Bug#11464)
4769
c1892f11
PE
47702012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4771
4772 Fix coding-related core dumps with gcc -ftrapv.
4773 The code was computing A - B, where A and B are pointers, and B is
4774 random garbage. This can lead to core dumps on platforms that
4775 have special pointer registers, and it also leads to core dumps on
4776 x86-64 when compiled with gcc -ftrapv. The fix is to compute
4777 A - B only when B is initialized properly.
4778 * coding.c (coding_set_source, coding_set_destination): Return void.
4779 (coding_change_source, coding_change_destinations): New functions,
4780 with the old behaviors of coding_set_source and coding_set_destination.
4781 All callers that need an offset changed to use these new functions.
4782
eb7afdad
GM
47832012-05-26 Glenn Morris <rgm@gnu.org>
4784
4785 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
4786
f12fdf02
EZ
47872012-05-26 Eli Zaretskii <eliz@gnu.org>
4788
53a63be6 4789 Extend mouse support on W32 text-mode console.
61b108cc
SM
4790 * xdisp.c (draw_row_with_mouse_face):
4791 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 4792
eb3f6f01 4793 * w32console.c: Include window.h.
61b108cc
SM
4794 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4795 New functions.
eb3f6f01
EZ
4796 (initialize_w32_display): Initialize mouse-highlight data.
4797
53a63be6
EZ
4798 * w32inevt.c: Include termchar.h and window.h.
4799 (do_mouse_event): Support mouse-autoselect-window. When the mouse
4800 moves, call note_mouse_highlight. If help_echo changed, call
4801 gen_help_event to produce help-echo message in the echo area.
4802 Call clear_mouse_face if mouse_face_hidden is set in the mouse
4803 highlight info.
4804
4cfd81f6
PE
48052012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4806
4807 * lread.c (read1): Simplify slightly to avoid an overflow warning
4808 with GCC 4.7.0 on x86-64.
4809
4446092a
EZ
48102012-05-26 Eli Zaretskii <eliz@gnu.org>
4811
4812 * bidi.c (bidi_mirror_char): Revert last change: an int is
4813 definitely wide enough here.
4814
42b2a986 48152012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 4816
42b2a986 4817 Fix integer width and related bugs (Bug#9874).
eb106a49 4818 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
4819 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
4820 (string_bytes, check_sblock, allocate_string_data):
4821 (compact_small_strings, Fmake_bool_vector, make_string)
4822 (make_unibyte_string, make_multibyte_string)
4823 (make_string_from_bytes, make_specified_string)
4824 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4825 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4826 (mark_vectorlike):
4827 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4828 (allocate_pseudovector):
4829 Use int, not EMACS_INT, where int is wide enough.
4830 (inhibit_garbage_collection, Fgarbage_collect):
4831 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4832 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4833 int might not be wide enough.
4834 (bidi_cache_search, bidi_cache_find, bidi_init_it)
4835 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4836 (bidi_at_paragraph_end, bidi_find_paragraph_start)
4837 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4838 (bidi_level_of_next_char, bidi_move_to_visually_next):
4839 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4840 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4841 (Fkill_buffer, Fset_buffer_major_mode)
4842 (advance_to_char_boundary, Fbuffer_swap_text)
4843 (Fset_buffer_multibyte, overlays_at, overlays_in)
4844 (overlay_touches_p, struct sortvec, record_overlay_string)
4845 (overlay_strings, recenter_overlay_lists)
4846 (adjust_overlays_for_insert, adjust_overlays_for_delete)
4847 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4848 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4849 (Foverlay_recenter, last_overlay_modification_hooks_used)
4850 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4851 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
4852 (validate_region): Omit unnecessary test for b <= e,
4853 since that's guaranteed by the previous test.
d311d28c
PE
4854 (adjust_overlays_for_delete): Avoid pos + length overflow.
4855 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4856 (report_overlay_modification):
4857 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4858 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4859 Omit pointer cast, which isn't needed anyway, and doesn't work
4860 after the EMACS_INT -> ptrdiff_t change.
02481186 4861 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
4862 * buffer.h: Adjust decls to match defn changes elsewhere.
4863 (struct buffer_text, struct buffer):
4864 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4865 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
4866 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4867 not int, to avoid needless 32-bit limit on 64-bit hosts.
4868 (exec_byte_code): Use tighter memory-full test, one that checks
4869 for alloca overflow. Don't compute the address of the object just
4870 before an array, as that's not portable. Use EMACS_INT, not
4871 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
4872 * callint.c (Fcall_interactively):
4873 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4874 * callproc.c (call_process_kill, Fcall_process):
4875 Don't assume pid_t fits into an Emacs fixnum.
4876 (call_process_cleanup, Fcall_process, child_setup):
4877 Don't assume pid_t fits into int.
4878 (call_process_cleanup, Fcall_process, delete_temp_file)
4879 (Fcall_process_region):
4880 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4881 (Fcall_process): Simplify handling of volatile integers.
4882 Use int, not EMACS_INT, where int will do.
4883 * casefiddle.c (casify_object, casify_region, operate_on_word)
4884 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4885 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4886 (casify_object): Avoid integer overflow when overallocating buffer.
4887 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 4888 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
4889 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
4890 * category.h (CATEGORYP): Don't assume arg is nonnegative.
4891 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
4892 integers are now checked earlier. All uses replaced with XINT.
4893 (ccl_driver):
4894 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4895 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
4896 (ccl_driver, Fregister_code_conversion_map):
4897 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
4898 (resolve_symbol_ccl_program): Check that vector header is in range.
4899 Always copy the vector, so that we can check its contents reliably
4900 now rather than having to recheck each instruction as it's being
4901 executed. Check that vector words fit in 'int'.
4902 (ccl_get_compiled_code, Fregister_ccl_program)
4903 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
4904 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
4905 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
4906 contents are in range.
4907 (Fccl_execute_on_string): Check that status is in range.
4908 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
4909 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
4910 Accept and return EMACS_INT, not int, because callers can pass values
4911 out of 'int' range.
4912 (c_string_width, strwidth, lisp_string_width, chars_in_text)
4913 (multibyte_chars_in_text, parse_str_as_multibyte)
4914 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
4915 (str_as_unibyte, str_to_unibyte, string_count_byte8)
4916 (string_escape_byte8, Fget_byte):
4917 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 4918 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
4919 avoid mishandling large integers.
4920 * character.h: Adjust decls to match defn changes elsewhere.
4921 * charset.c (load_charset_map_from_file, find_charsets_in_text)
4922 (Ffind_charset_region):
4923 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4924 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
4925 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 4926 Don't assume fixnum fits in int.
d311d28c
PE
4927 (load_charset_map_from_vector, Fmap_charset_chars):
4928 Remove now-unnecessary CHECK_NATNUMs.
4929 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
4930 Don't rely on undefined behavior with signed left shift overflow.
4931 Don't assume unsigned int fits into fixnum, or that fixnum fits
4932 into unsigned int. Don't require max_code to be a valid fixnum;
4933 that's not true for gb10830 4-byte on a 32-bit host. Allow
4934 invalid_code to be a cons, for the same reason. Require code_offset
4935 to be a character. Avoid int overflow if max_char is close
4936 to INT_MAX.
4937 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
4938 this is intended anyway and avoids some undefined behavior.
4939 (load_charset_map): Pass unsigned, not int, as 2nd arg of
4940 INDEX_TO_CODE_POINT, as that's what it expects.
4941 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
4942 * charset.h (DECODE_CHAR): Return int, not unsigned;
4943 this is what was intended anyway, and it avoids undefined behavior.
4944 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
4945 integer-overflow issues.
4946 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
4947 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
4948 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
4949 * chartab.c (Fmake_char_table, Fset_char_table_range)
4950 (uniprop_get_decoder, uniprop_get_encoder):
4951 Don't assume fixnum fits in int.
4952 * cmds.c (move_point): New function, that does the gist of
4953 Fforward_char and Fbackward_char, but does so while checking
4954 for integer overflow more accurately.
c96e5d6a 4955 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
4956 (Fforward_line, Fend_of_line, internal_self_insert)
4957 (internal_self_insert):
4958 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4959 Fix a FIXME, by checking for integer overflow when calculating
4960 target_clm and actual_clm.
4961 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 4962 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
4963 (ASSURE_DESTINATION, coding_alloc_by_realloc)
4964 (coding_alloc_by_making_gap, alloc_destination)
4965 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
4966 (encode_coding_utf_16, detect_coding_emacs_mule)
4967 (decode_coding_emacs_mule, encode_coding_emacs_mule)
4968 (detect_coding_iso_2022, decode_coding_iso_2022)
4969 (encode_invocation_designation, encode_designation_at_bol)
4970 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
4971 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
4972 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
4973 (encode_coding_ccl, encode_coding_raw_text)
4974 (detect_coding_charset, decode_coding_charset)
4975 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
4976 (produce_composition, produce_charset, produce_annotation)
4977 (decode_coding, handle_composition_annotation)
4978 (handle_charset_annotation, consume_chars, decode_coding_gap)
4979 (decode_coding_object, encode_coding_object, detect_coding_system)
4980 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
4981 (code_convert_region, code_convert_string)
8f50130c
PE
4982 (Fdefine_coding_system_internal)
4983 (coding_set_source, coding_set_destination):
d311d28c
PE
4984 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4985 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
4986 (Fdefine_coding_system_internal):
4987 Don't assume fixnums fit in int.
4988 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 4989 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
4990 (Funencodable_char_position, Fcheck_coding_systems_region)
4991 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 4992 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 4993 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 4994 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 4995 Don't access memory outside of the args array.
d311d28c 4996 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
4997 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
4998 result of ENCODE_CHAR.
d311d28c
PE
4999 * coding.h: Adjust decls to match defn changes elsewhere.
5000 (struct coding_system):
5001 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5002 * composite.c (get_composition_id, find_composition)
5003 (run_composition_function, update_compositions)
5004 (compose_text, composition_gstring_put_cache)
5005 (composition_gstring_p, composition_gstring_width)
5006 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5007 (composition_compute_stop_pos, composition_reseat_it)
5008 (composition_update_it, struct position_record)
5009 (find_automatic_composition, composition_adjust_point)
5010 (Fcomposition_get_gstring, Ffind_composition_internal):
5011 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5012 (update_compositions):
5013 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5014 * composite.h: Adjust decls to match defn changes elsewhere.
5015 (struct composition):
5016 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5017 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5018 Do not attempt to compute the address of the object just before a
5019 buffer; this is not portable.
5020 (Faref, Faset):
5021 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5022 (Faset): Use int, not EMACS_INT, where int is wide enough.
5023 (Fstring_to_number): Don't assume fixnums fit in int.
5024 (Frem): Don't assume arg is nonnegative.
5025 * dbusbind.c (xd_append_arg): Check for integers out of range.
5026 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 5027 (extract_signed, extract_unsigned): New functions.
243e0530
PE
5028 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5029 (xd_get_connection_references): Return ptrdiff_t, not int.
5030 All uses changed.
5031 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5032 (xd_read_message_1):
5033 Use int, not unsigned, where the dbus API uses int.
5034 (Fdbus_message_internal): Don't overflow mtype.
5035 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
5036 * dired.c (directory_files_internal, file_name_completion, scmp)
5037 (file_name_completion_stat):
5038 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5039 (file_name_completion): Don't overflow matchcount.
5040 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5041 * dispextern.h: Adjust decls to match defn changes elsewhere.
5042 (struct text_pos, struct glyph, struct bidi_saved_info)
5043 (struct bidi_string_data, struct bidi_it, struct composition_it)
5044 (struct it):
5045 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5046 (struct display_pos, struct composition_it, struct it):
5047 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5048 * dispnew.c (increment_matrix_positions)
5049 (increment_row_positions, mode_line_string)
5050 (marginal_area_string):
5051 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 5052 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
5053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5054 (duration_to_sec_usec): New function, to check for overflow better.
5055 (Fsleep_for, sit_for): Use it.
5056 * doc.c (get_doc_string, store_function_docstring):
5057 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5058 (get_doc_string, Fsnarf_documentation):
5059 Use int, not EMACS_INT, where int is wide enough.
5060 (get_doc_string):
5061 Use SAFE_ALLOCA, not alloca.
5062 Check for overflow when converting EMACS_INT to off_t.
5063 * doprnt.c (doprnt):
5064 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5065 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5066 Don't assume uid_t fits into fixnum.
5067 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5068 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5069 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5070 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5071 (general_insert_function)
5072 (Finsert_char, make_buffer_string, make_buffer_string_both)
5073 (update_buffer_properties, Fbuffer_substring)
5074 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5075 (Fsubst_char_in_region, check_translation)
5076 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5077 (transpose_markers, Ftranspose_regions):
5078 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5079 (clip_to_bounds): Move to lisp.h as an inline function).
5080 (Fconstrain_to_field): Don't assume integers are nonnegative.
5081 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5082 (Fsubst_char_in_region, Fsave_restriction):
5083 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5084 (Femacs_pid): Don't assume pid_t fits into fixnum.
5085 (lo_time): Use int, not EMACS_INT, when int suffices.
5086 (lisp_time_argument): Check for usec out of range.
5087 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
5088 (Fuser_login_name, Fuser_full_name): Signal an error
5089 if a uid argument is out of range, rather than relying on
5090 undefined behavior.
c8d5c857
PE
5091 (Fformat_time_string): Remove now-unnecessary check.
5092 lisp_time_argument checks for out-of-range usec now.
243e0530 5093 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
5094 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5095 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5096 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5097 (init_cmdargs, Fdump_emacs):
5098 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5099 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5100 the bottom (typically) 32 bits of the fixnum.
5101 * eval.c (specpdl_size, call_debugger):
5102 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5103 (when_entered_debugger, Fbacktrace_debug):
5104 Don't assume fixnum can fit in int.
5105 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5106 the object just before a buffer; this is not portable.
5107 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5108 (grow_specpdl, unbind_to):
5109 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5110 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5111 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 5112 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
5113 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5114 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5115 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5116 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5117 (a_write, e_write):
5118 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5119 (Fcopy_file, non_regular_nbytes, read_non_regular)
5120 (Finsert_file_contents):
5121 Use int, not EMACS_INT, where int is wide enough.
5122 (READ_BUF_SIZE): Verify that it fits in int.
5123 (Finsert_file_contents): Check that counts are in proper range,
5124 rather than assuming fixnums fit into ptrdiff_t etc.
5125 Don't assume fixnums fit into int.
125b3835 5126 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
5127 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5128 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
5129 (string_char_to_byte, string_byte_to_char)
5130 (string_make_multibyte, string_to_multibyte)
5131 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5132 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5133 (substring_both, Fdelete, internal_equal, Ffillarray)
5134 (Fclear_string, mapcar1)
5135 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5136 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5137 (larger_vector, make_hash_table, maybe_resize_hash_table)
5138 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5139 (Fmaphash, secure_hash):
5140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5141 (concat): Check for string index and length overflow.
5142 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5143 (Frequire):
5144 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5145 (larger_vector): New API (vec, incr_min, size_max) replaces old
5146 one (vec, new_size, init). This catches size overflow.
5147 INIT was removed because it was always Qnil.
5148 All callers changed.
5149 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5150 the upper bound on a hash table index size.
5151 (make_hash_table, maybe_resize_hash_table): Use it.
5152 (secure_hash): Computer start_byte and end_byte only after
5153 they're known to be in ptrdiff_t range.
5154 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5155 (Ffont_get_glyphs, Ffont_at):
5156 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5157 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5158 (Flist_fonts, Fopen_font):
5159 Don't assume fixnum can fit in int.
5160 (check_gstring): Don't assume index can fit in int.
5161 (font_match_p): Check that fixnum is a character, not a nonnegative
5162 fixnum, since the later code needs to stuff it into an int.
5163 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5164 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5165 conversion overflow issues.
5166 (Fopen_font): Check for integer out of range.
5167 (Ffont_get_glyphs): Don't assume index can fit in int.
5168 * font.h: Adjust decls to match defn changes elsewhere.
5169 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5170 integer overflow.
5171 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5172 printmax_t, where ptrdiff_t is wide enough.
5173 (Finternal_char_font):
5174 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5175 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5176 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5177 (Fset_frame_position, x_set_frame_parameters)
5178 (x_set_line_spacing, x_set_border_width)
5179 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5180 Check that fixnums are in proper range for system types.
5181 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5182 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5183 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5184 Use SAFE_ALLOCA_LISP, not alloca.
5185 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5186 intptr_t is wide enough.
5187 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5188 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5189 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5190 Check for fixnum out of range.
5191 * ftfont.c (ftfont_list): Don't assume index fits in int.
5192 Check that fixnums are in proper range for system types.
5193 (ftfont_shape_by_flt):
5194 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
5195 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5196 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5197 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5198 Check that fixnums are in proper range for system types.
5199 * gnutls.h: Adjust decls to match defn changes elsewhere.
5200 * gtkutil.c (xg_dialog_run):
5201 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5202 (update_frame_tool_bar):
5203 Check that fixnums are in proper range for system types.
5204 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 5205 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
5206 * indent.c (last_known_column, last_known_column_point):
5207 (current_column_bol_cache):
5208 (skip_invisible, current_column, check_display_width):
5209 (check_display_width, scan_for_column, current_column_1)
5210 (Findent_to, Fcurrent_indentation, position_indentation)
5211 (indented_beyond_p, Fmove_to_column, compute_motion):
5212 (Fcompute_motion, Fvertical_motion):
5213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5214 (last_known_column_modified): Use EMACS_INT, not int.
5215 (check_display_width):
5216 (Fcompute_motion):
5217 Check that fixnums and floats are in proper range for system types.
5218 (compute_motion): Don't assume index or fixnum fits in int.
5219 (compute_motion, Fcompute_motion):
5220 Use int, not EMACS_INT, when it is wide enough.
5221 (vmotion): Omit local var start_hpos that is always 0; that way
5222 we don't need to worry about overflow in expressions involving it.
5223 * indent.h: Adjust decls to match defn changes elsewhere.
5224 (struct position):
5225 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5226 Use int, not EMACS_INT, where int is wide enough.
5227 Remove unused members ovstring_chars_done and tab_offset;
5228 all uses removed.
5229 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5230 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5231 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5232 (make_gap, copy_text, insert, insert_and_inherit)
5233 (insert_before_markers, insert_before_markers_and_inherit)
5234 (insert_1, count_combining_before, count_combining_after)
5235 (insert_1_both, insert_from_string)
5236 (insert_from_string_before_markers, insert_from_string_1)
5237 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5238 (adjust_after_replace, adjust_after_insert, replace_range)
5239 (replace_range_2, del_range, del_range_1, del_range_byte)
5240 (del_range_both, del_range_2, modify_region)
5241 (prepare_to_modify_buffer, signal_before_change)
5242 (signal_after_change, Fcombine_after_change_execute):
5243 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5244 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5245 (balance_an_interval, split_interval_right, split_interval_left)
5246 (find_interval, next_interval, update_interval)
5247 (adjust_intervals_for_insertion, delete_node, delete_interval)
5248 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5249 (static_offset_intervals, offset_intervals)
5250 (merge_interval_right, merge_interval_left, make_new_interval)
5251 (graft_intervals_into_buffer, temp_set_point_both)
5252 (temp_set_point, set_point, adjust_for_invis_intang)
5253 (set_point_both, move_if_not_intangible, get_property_and_range)
5254 (get_local_map, copy_intervals, copy_intervals_to_string)
5255 (compare_string_intervals, set_intervals_multibyte_1):
5256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5257 * intervals.h: Adjust decls to match defn changes elsewhere.
5258 (struct interval):
5259 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5260 * keyboard.c (this_command_key_count, this_single_command_key_start)
5261 (before_command_key_count, before_command_echo_length, echo_now)
5262 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5263 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5264 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5265 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5266 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5267 (last_non_minibuf_size, last_point_position, echo_truncate)
5268 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5269 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5270 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5271 (stuff_buffered_input):
5272 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5273 (last_auto_save, command_loop_1, read_char):
5274 Use EMACS_INT, not int, to avoid integer overflow.
5275 (record_char): Avoid overflow in total_keys computation.
5276 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5277 * keyboard.h: Adjust decls to match defn changes elsewhere.
5278 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5279 (Fkey_description, Fdescribe_vector, Flookup_key):
5280 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5281 (click_position): New function, to check that positions are in range.
5282 (Fcurrent_active_maps):
5283 (describe_command):
5284 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5285 (Faccessible_keymaps, Fkey_description):
5286 (preferred_sequence_p):
5287 Don't assume fixnum can fit into int.
5288 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5289 Check for integer overflow in size calculations.
5290 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5291 avoid mishandling large integers.
5292 * lisp.h: Adjust decls to match defn changes elsewhere.
5293 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5294 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5295 (struct Lisp_Marker):
5296 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5297 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
5298 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5299 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5300 All callers changed.
5301 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5302 Assume the arg has valid form, since it always does.
5303 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5304 unsigned integer system type.
5305 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5306 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5307 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5308 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5309 (duration_to_sec_usec): New decl.
5310 * lread.c (read_from_string_index, read_from_string_index_byte)
5311 (read_from_string_limit, readchar, unreadchar, openp)
5312 (read_internal_start, read1, oblookup):
5313 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5314 (Fload, readevalloop, Feval_buffer, Feval_region):
5315 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5316 (openp): Check for out-of-range argument to 'access'.
5317 (read1): Use int, not EMACS_INT, where int is wide enough.
5318 Don't assume fixnum fits into int.
6efdadfd 5319 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
5320 (read_filtered_event): Use duration_to_sec_usec
5321 to do proper overflow checking on durations.
d311d28c
PE
5322 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5323 in size calculation.
5324 (Fexecute_kbd_macro):
5325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5326 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5327 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5328 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5329 (set_marker_both, set_marker_restricted_both, marker_position)
5330 (marker_byte_position, Fbuffer_has_markers_at):
5331 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5332 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 5333 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
5334 It now merely ensures that the menu is large enough, without
5335 necessarily growing it, as this avoids some integer overflow issues.
5336 All callers changed.
5337 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5338 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5339 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5340 Use SAFE_ALLOCA_LISP, not alloca.
5341 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5342 to EMACS_INT. Check that fixnums are in proper range for system types.
5343 * minibuf.c (minibuf_prompt_width, string_to_object)
5344 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5345 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5346 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5347 (get_minibuffer, read_minibuf_unwind):
5348 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5349 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5350 this simplifies overflow checking. All callers changed.
5351 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5352 (Ftest_completion):
5353 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5354 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5355 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5356 Check that fixnums are in proper range for system types.
5357 (Fx_create_frame, Fx_show_tip):
5358 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5359 * nsfont.m (ns_findfonts, nsfont_list_family):
5360 Don't assume fixnum fits in long.
5361 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5362 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5363 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5364 wide enough.
17fdb222 5365 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
5366 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5367 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5368 (PRINTDECLARE, PRINTPREPARE):
5369 (strout, print_string):
5370 (print, print_preprocess, print_check_string_charset_prop)
5371 (print_object):
5372 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5373 (PRINTDECLARE):
5374 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5376 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 5377 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 5378 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
5379 (print_error_message): Use SAFE_ALLOCA, not alloca.
5380 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
5381 (print_depth, new_backquote_output, print_number_index):
5382 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
5383 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5384 (Fset_process_window_size, Fformat_network_address)
5385 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 5386 (sigchld_handler):
d311d28c 5387 Check that fixnums are in proper range for system types.
d44287d4 5388 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
5389 Check for process-ids out of pid_t range rather than relying on
5390 undefined behavior.
e4d81efc 5391 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
5392 (Fformat_network_address, read_process_output, send_process)
5393 (Fprocess_send_region, status_notify):
5394 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5395 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5396 (wait_reading_process_output, read_process_output, exec_sentinel):
5397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5398 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5399 (Faccept_process_output): Use duration_to_sec_usec to do proper
5400 overflow checking on durations.
dde14581
PE
5401 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5402 Don't assume pid_t fits in int.
02481186
PE
5403 * process.h (struct Lisp_Process): Members tick and update_tick
5404 are now of type EMACS_INT, not int.
b62b53e8
PE
5405 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5406 configured --with-wide-int.
d311d28c
PE
5407 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5408 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5409 * search.c (looking_at_1, string_match_1):
5410 (fast_string_match, fast_c_string_match_ignore_case)
5411 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5412 (scan_newline, find_before_next_newline, search_command)
5413 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5414 (set_search_regs, wordify):
5415 (Freplace_match):
5416 (Fmatch_data):
5417 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5418 (string_match_1, search_buffer, set_search_regs):
5419 (Fmatch_data):
5420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5421 (wordify): Check for overflow in size calculation.
5422 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5423 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5424 Check that fixnums are in proper range for system types.
5425 * sound.c (struct sound_device)
5426 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5427 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5428 (Fplay_sound_internal):
5429 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 5430 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
5431 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5432 (Fparse_partial_sexp):
5433 Don't assume fixnums can fit in int.
5434 (struct lisp_parse_state, find_start_pos, find_start_value)
5435 (find_start_value_byte, find_start_begv)
5436 (update_syntax_table, char_quoted, dec_bytepos)
5437 (find_defun_start, prev_char_comend_first, back_comment):
5438 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5439 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5440 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5441 (Finternal_describe_syntax_value): Check that match_lisp is a
5442 character, not an integer, since the code stuffs it into int.
5443 (scan_words, scan_sexps_forward):
5444 Check that fixnums are in proper range for system types.
5445 (Fforward_word):
5446 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5447 (scan_sexps_forward):
5448 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5449 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5450 * syntax.h: Adjust decls to match defn changes elsewhere.
5451 (struct gl_state_s):
5452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
5453 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5454 MOST_POSITIVE_FIXNUM.
d311d28c
PE
5455 * sysdep.c (wait_for_termination_1, wait_for_termination)
5456 (interruptible_wait_for_termination, mkdir):
5457 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5458 (emacs_read, emacs_write):
5459 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
5460 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5461 and double all fit in int.
d311d28c
PE
5462 * term.c (set_tty_color_mode):
5463 Check that fixnums are in proper range for system types.
5464 * termhooks.h (struct input_event):
5465 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5466 * textprop.c (validate_interval_range, interval_of)
5467 (Fadd_text_properties, set_text_properties_1)
5468 (Fremove_text_properties, Fremove_list_of_text_properties)
5469 (Ftext_property_any, Ftext_property_not_all)
5470 (copy_text_properties, text_property_list, extend_property_ranges)
5471 (verify_interval_modification):
5472 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5473 (Fnext_single_char_property_change)
5474 (Fprevious_single_char_property_change):
5475 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
5476 (copy_text_properties):
5477 Check for integer overflow in index calculation.
d311d28c
PE
5478 * undo.c (last_boundary_position, record_point, record_insert)
5479 (record_delete, record_marker_adjustment, record_change)
5480 (record_property_change):
5481 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5482 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5483 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5484 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5485 (Fx_hide_tip, Fx_file_dialog):
5486 * w32menu.c (set_frame_menubar):
5487 Use ptrdiff_t, not int, for consistency with rest of code.
5488 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5489 (select_window, Fdelete_other_windows_internal)
5490 (window_scroll_pixel_based, window_scroll_line_based)
5491 (Frecenter, Fset_window_configuration):
5492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5493 (Fset_window_hscroll, run_window_configuration_change_hook)
5494 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 5495 (Fscroll_other_window, Frecenter):
d311d28c
PE
5496 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5497 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5498 Don't assume fixnum fits in int.
5499 (Fset_window_scroll_bars):
5500 Check that fixnums are in proper range for system types.
5501 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5502 (string_pos, c_string_pos, number_of_chars, init_iterator)
5503 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5504 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5505 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
5506 (face_before_or_after_it_pos, handle_invisible_prop)
5507 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
5508 (display_prop_intangible_p, string_buffer_position_lim)
5509 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5510 (get_overlay_strings_1, get_overlay_strings)
5511 (iterate_out_of_display_property, forward_to_next_line_start)
5512 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5513 (get_next_display_element, set_iterator_to_next)
5514 (get_visually_first_element, compute_stop_pos_backwards)
5515 (handle_stop_backwards, next_element_from_buffer)
5516 (move_it_in_display_line_to, move_it_in_display_line)
5517 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5518 (add_to_log, message_dolog, message_log_check_duplicate)
5519 (message2, message2_nolog, message3, message3_nolog
5520 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5521 (current_message_1, truncate_echo_area, truncate_message_1)
5522 (set_message, set_message_1, store_mode_line_noprop)
5523 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5524 (text_outside_line_unchanged_p, check_point_in_composition)
5525 (reconsider_clip_changes)
5526 (redisplay_internal, set_cursor_from_row, try_scrolling)
5527 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5528 (redisplay_window, find_last_unchanged_at_beg_row)
5529 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5530 (trailing_whitespace_p, find_row_edges, display_line)
5531 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5532 (display_mode_element, store_mode_line_string)
5533 (pint2str, pint2hrstr, decode_mode_spec)
5534 (display_count_lines, display_string, draw_glyphs)
5535 (x_produce_glyphs, x_insert_glyphs)
5536 (rows_from_pos_range, mouse_face_from_buffer_pos)
5537 (fast_find_string_pos, mouse_face_from_string_pos)
5538 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5539 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5540 (safe_call, init_from_display_pos, handle_fontified_prop)
5541 (handle_single_display_spec, load_overlay_strings)
5542 (with_echo_area_buffer, setup_echo_area_for_printing)
5543 (display_echo_area, echo_area_display)
5544 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5545 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
5546 (redisplay_window, dump_glyph_row, display_mode_line)
5547 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 5548 (handle_display_spec, display_prop_string_p):
d311d28c
PE
5549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5550 (handle_single_display_spec, build_desired_tool_bar_string)
5551 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5552 (get_specified_cursor_type):
5553 Check that fixnums are in proper range for system types.
5554 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5555 (Flookup_image_map):
5556 Don't assume fixnums fit in int.
5557 (compare_overlay_entries):
5558 Avoid mishandling comparisons due to subtraction overflow.
5559 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5560 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5561 (handle_tool_bar_click):
5562 Use int, not unsigned, since we prefer signed and the signedness
5563 doesn't matter here.
5564 (get_next_display_element, next_element_from_display_vector):
5565 Use int, not EMACS_INT, when int is wide enough.
5566 (start_hourglass): Use duration_to_sec_usec to do proper
5567 overflow checking on durations.
5568 * xfaces.c (Fbitmap_spec_p):
5569 Check that fixnums are in proper range for system types.
5570 (compare_fonts_by_sort_order):
5571 Avoid mishandling comparisons due to subtraction overflow.
5572 (Fx_family_fonts, realize_basic_faces):
5573 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5574 (Fx_family_fonts):
5575 Don't assume fixnum fits in int.
5576 Use SAFE_ALLOCA_LISP, not alloca.
5577 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5578 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5579 (face_at_buffer_position, face_for_overlay_string)
5580 (face_at_string_position):
5581 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5582 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5583 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5584 (Fx_show_tip):
5585 Check that fixnums are in proper range for system types.
5586 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5587 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5588 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5589 (Fx_change_window_property): Don't assume fixnums fit in int.
5590 * xfont.c (xfont_chars_supported):
5591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5592 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5593 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5594 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5595 * xml.c (parse_region):
5596 * xrdb.c (magic_file_p):
5597 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5598 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5599 (x_get_local_selection, x_reply_selection_request)
5600 (x_handle_selection_request, wait_for_property_change):
5601 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5602 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5603 short is wide enough.
5604 (x_send_client_event): Don't assume fixnum fits in int.
5605 * xterm.c (x_x_to_emacs_modifiers):
5606 Don't assume EMACS_INT overflows nicely into int.
5607 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5608 may come from Lisp.
5609 (handle_one_xevent): NATNUMP can eval its arg twice.
5610 (x_connection_closed):
5611 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5612 * xterm.h: Adjust decls to match defn changes elsewhere.
5613 (struct scroll_bar): Use struct vectorlike_header
5614 rather than rolling our own approximation.
5615 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5616
c6574eb5
GM
56172012-05-25 Glenn Morris <rgm@gnu.org>
5618
5619 * lisp.mk (lisp): Update for more files being compiled now.
5620
e8d32c7e
SM
56212012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5622
48def666
SM
5623 * lread.c: Remove `read_pure' which makes no difference.
5624 (read_pure): Remove var.
5625 (unreadpure): Remove function.
5626 (readevalloop): Don't call read_list with -1 flag.
5627 (read1, read_vector): Don't test read_pure any more.
5628 (read_list): Simplify.
5629
e8d32c7e
SM
5630 * fileio.c, character.h: Minor style tweaks.
5631
4b2addb7
DA
56322012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5633
5634 * window.h (clip_changed): Remove useless declaration.
5635
584461b2
JB
56362012-05-22 Juanma Barranquero <lekktu@gmail.com>
5637
5638 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5639 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5640
34374650
PE
56412012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5642
5643 Remove src/m/*.
5644 This directory predates autoconf and is no longer needed nowadays.
5645 Move its few remaining bits of functionality to where they're needed.
5646 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5647 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5648 * m/template.h: Remove.
5649 * Makefile.in (M_FILE): Remove. All uses removed.
5650 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5651 * lisp.h (USE_LSB_TAG):
5652 * mem-limits.h (EXCEEDS_LISP_PTR):
5653 Use VAL_MAX, not VALBITS, in #if.
5654 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5655 (EMACS_UINT): Define unconditionally now.
5656 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5657 (BITS_PER_EMACS_INT): New constants, replacing
5658 what used to be in config.h, but not useful in #if.
5659 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5660 define them any more.
5661 (VAL_MAX): New macro.
5662 (VALMASK): Use it.
5663 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5664 BITS_PER_EMACS_INT, in #if.
5665 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5666 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5667 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5668 * s/ms-w32.h (DATA_START):
5669 Move here from removed file m/intel386.h.
5670 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5671 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5672
261cb4bb
PE
56732012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5674
5675 Assume C89 or later.
5676 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5677 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5678 (xrealloc):
5679 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5680 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5681 * textprop.c, tparam.c (NULL): Remove.
5682 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5683 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5684 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5685 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5686 * xterm.c (input_signal_count): Assume volatile works.
5687
ff23cd9f
KB
56882012-05-21 Ken Brown <kbrown@cornell.edu>
5689
5690 * xgselect.c (xg_select): Fix first argument in call to 'select'
5691 (bug#11508).
5692
1b170bc6
KB
56932012-05-20 Ken Brown <kbrown@cornell.edu>
5694
5695 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 5696 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 5697
b2f4d39f
KB
56982012-05-19 Ken Brown <kbrown@cornell.edu>
5699
5700 * xfns.c (x_in_use): Remove `static' qualifier.
5701 * xterm.h (x_in_use): Declare.
5702 * xgselect.c: Include xterm.h.
5703 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5704 and `display_arg' (bug#9754).
5705
003fdae2
PE
57062012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5707
9232a6d9
PE
5708 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5709
003fdae2
PE
5710 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5711 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5712
784b56e2
EZ
57132012-05-18 Eli Zaretskii <eliz@gnu.org>
5714
5715 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5716
5717 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 5718 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
5719
5720 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5721 reference to image_cache->refcount.
5722 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5723
a0a79cde
JL
57242012-05-17 Juri Linkov <juri@jurta.org>
5725
5726 * search.c (Fword_search_regexp, Fword_search_backward)
5727 (Fword_search_forward, Fword_search_backward_lax)
5728 (Fword_search_forward_lax): Move functions to isearch.el
5729 (bug#10145, bug#11381).
5730
b0572523
PE
57312012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5732
5733 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5734
9660f5fc
SM
57352012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5736
5737 * lread.c (init_obarray): Declare Qt and Qnil as special.
5738
4374de83
GM
57392012-05-14 Glenn Morris <rgm@gnu.org>
5740
5741 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 5742 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 5743
dc44c39a
PE
57442012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5745
078c97cb
PE
5746 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5747
dc44c39a
PE
5748 * unexaix.c: Port to more-recent AIX compilers.
5749 (report_error, report_error_1, make_hdr, copy_sym)
5750 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5751 Make arguments const char *, not char *, to avoid violations of C
5752 standard and to fix some AIX warnings reported by Gilles Pion.
5753
e18afed7 57542012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
5755
5756 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5757 already have overlays loaded.
5758 (handle_single_display_spec): Before returning without displaying
5759 fringe bitmap, synchronize the bidi iterator with the main display
5760 iterator, by calling iterate_out_of_display_property.
5761 (iterate_out_of_display_property): Detect buffer iteration by
5762 testing that it->string is a Lisp string.
5763 (get_next_display_element): When the current object is exhausted,
5764 and there's something on it->stack, call set_iterator_to_next to
5765 proceed with what's on the stack, instead of returning zero.
5766 (set_iterator_to_next): If called at the end of a Lisp string,
5767 proceed to consider_string_end without incrementing string
5768 position. Don't increment display vector index past the end of
5769 the display vector. (Bug#11417)
c8fb9dc6
EZ
5770 (pos_visible_p): Don't report a position visible when move_it_to
5771 stopped at the last line of window, which happens to be scanned
5772 backwards by the bidi iteration. (Bug#11464)
ac268e67 5773
e18afed7 57742012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
5775
5776 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5777 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
5778 are on a TTY, and thus unable to display on the fringes.
5779 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
5780 so we need to signal to the caller that this is a "replacing"
5781 display spec. This fixes display when the spec is invalid or we
5782 are on a TTY.
5783
e18afed7 57842012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
5785
5786 * unexaix.c (make_hdr): Fix typo in prototype.
5787 This bug broke the build on AIX. Problem reported by Gilles Pion.
5788
9d0a235a
MA
57892012-05-14 Michael Albinus <michael.albinus@gmx.de>
5790
5791 * keyboard.c (kbd_buffer_get_event): Read special events also in
5792 batch mode. (Bug#11415)
5793
9e6b06ed
GM
57942012-05-12 Glenn Morris <rgm@gnu.org>
5795
5796 * ns.mk: Update for ns_appbindir no longer having trailing "/".
5797
c1a1d7a3
EZ
57982012-05-12 Eli Zaretskii <eliz@gnu.org>
5799
5800 * lisp.mk (lisp): Add newcomment.elc.
5801
3fe7cdc8
GM
58022012-05-12 Glenn Morris <rgm@gnu.org>
5803
5804 * Makefile.in (MKDIR_P): New, set by configure.
5805 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
5806
53f7d2c0
PE
58072012-05-11 Paul Eggert <eggert@cs.ucla.edu>
5808
5809 Remove unused function hourglass_started.
5810 * dispextern.h (hourglass_started):
5811 * w32fns.c (hourglass_started):
5812 * xdisp.c (hourglass_started): Remove.
5813
75aafb17
JB
58142012-05-10 Juanma Barranquero <lekktu@gmail.com>
5815
5816 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
5817 Update dependencies.
5818
12959e8e
PE
58192012-05-10 Paul Eggert <eggert@cs.ucla.edu>
5820
97107e2e
PE
5821 * xgselect.c (xg_select): Put maxfds+1 into a var.
5822 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5823
12959e8e
PE
5824 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5825
836d29b3
DA
58262012-05-10 Dave Abrahams <dave@boostpro.com>
5827
5828 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5829 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
5830
5cb67954
MA
58312012-05-09 Michael Albinus <michael.albinus@gmx.de>
5832
5833 * dbusbind.c (xd_registered_buses): New internal Lisp object.
5834 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5835 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5836 Initialize xd_registered_buses.
5837
3478ec45
PE
58382012-05-09 Paul Eggert <eggert@cs.ucla.edu>
5839
b263a6b0
PE
5840 Untag more efficiently if USE_LSB_TAG.
5841 This is based on a proposal by YAMAMOTO Mitsuharu in
5842 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5843 For an admittedly artificial (nth 8000 longlist) benchmark on
5844 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
5845 Emacs's overall text size by 1%.
5846 * lisp.h (XUNTAG): New macro.
5847 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5848 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5849 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5850 * eval.c (Fautoload):
5851 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5852 * frame.h (XFRAME): Use XUNTAG.
5853
3478ec45
PE
5854 Port recent dbusbind.c changes to 32-bit --with-wide-int.
5855 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5856 Remove unportable assumptions about print widths of types like
5857 dbus_uint32_t.
5858 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5859 intptr_t when converting between pointer and integer, to avoid GCC
5860 warnings about wrong width.
5861
666b903b 58622012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
5863
5864 * w32proc.c (new_child): Force Windows to reserve only 64KB of
5865 stack for each reader_thread, instead of defaulting to 8MB
5866 determined by the linker. This avoids failures in creating
5867 subprocesses on Windows 7, see the discussion in this thread:
5868 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5869
b120cc17
JC
58702012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
5871
5872 Fix up display of the *Minibuf-0* buffer in the mini window.
5873 * keyboard.c (read_char): Don't clear the echo area if there's no
5874 message to clear.
5875 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 5876 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 5877
9a4b36f8
MA
58782012-05-07 Michael Albinus <michael.albinus@gmx.de>
5879
5880 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
5881 batch mode.
5882
e5f9458f
CY
58832012-05-06 Chong Yidong <cyd@gnu.org>
5884
5885 * lisp.mk (lisp): Update.
5886
eceeb5fc 58872012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
5888
5889 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
5890
71873e2b
SM
58912012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
5892
5893 * data.c (PUT_ERROR): New macro.
5894 (syms_of_data): Use it. Add new error type `user-error'.
5895 * undo.c (user_error): New function.
5896 (Fprimitive_undo): Use it.
5897 * print.c (print_error_message): Adjust print style for `user-error'.
5898 * keyboard.c (user_error): New function.
5899 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
5900
ab0fa4e4
PE
59012012-05-03 Paul Eggert <eggert@cs.ucla.edu>
5902
5903 Do not limit current-time-string to years 1000..9999.
5904 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
5905 (Fcurrent_time_string): Support any year that is supported by the
5906 underlying localtime representation. Don't use asctime, as it
5907 has undefined behavior for years outside the range -999..9999.
5908
7ed806a7
PE
59092012-05-02 Paul Eggert <eggert@cs.ucla.edu>
5910
5911 Fix race conditions involving setenv, gmtime, localtime, asctime.
5912 Without this fix, interrupts could mess up code that uses these
5913 nonreentrant functions, since setting TZ invalidates existing
5914 tm_zone or tzname values, and since most of these functions return
5915 pointers to static storage.
5916 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
5917 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
5918 Grow the critical sections to include not just invoking
5919 localtime/gmtime, but also accessing these functions' results
5920 including their tm_zone values if any, and any related TZ setting.
5921 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
5922 so that the struct tm is saved in the critical section.
5923 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
5924 motivated by the fact that memory allocation needs to be outside
5925 the critical section.
5926
0c16dfed
DA
59272012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
5928
5929 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
5930 with RESET_INTERVAL.
5931
5932 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
5933 Remove duplicated buffer name initialization.
5934
3f83ace8
JM
59352012-05-02 Jim Meyering <jim@meyering.net>
5936
5937 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
5938
c7b8541e
JM
5939 * xfns.c (x_window): Use xstrdup (Bug#11375).
5940
90207a15 59412012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
5942
5943 * xdisp.c (pos_visible_p): If already at a newline from the
5944 display string before the 'while' loop, don't walk back the glyphs
5945 from it3.glyph_row. Solves assertion violation when the display
5946 string begins with a newline (egg.el). (Bug#11367)
5947
b593d6a9
AH
59482012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
5949
5950 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
5951 Move to simple.el.
5952
4737362e
GM
59532012-05-01 Glenn Morris <rgm@gnu.org>
5954
99cf43f9
GM
5955 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
5956 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
5957 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
5958 All were removed before 23.1.
5959
9311dcff
GM
5960 * dispnew.c: Remove HAVE_LIBNCURSES test;
5961 it is always true on relevant platforms.
5962
4d5c6349
GM
5963 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
5964 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
5965
4737362e
GM
5966 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
5967
74dd3a6b
AS
59682012-04-30 Andreas Schwab <schwab@linux-m68k.org>
5969
5970 * .gdbinit (xpr): Remove checks for no longer existing misc types.
5971 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
5972 Remove.
5973
13c379ee
PE
59742012-04-28 Paul Eggert <eggert@cs.ucla.edu>
5975
5976 Do not avoid creating empty evaporating overlays (Bug#9642).
5977 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
5978 That is, do not delete an evaporating overlay if it becomes
5979 empty after its bounds are adjusted to fit within its buffer.
5980 This fix caused other problems, and I'm reverting it until we get
5981 to the bottom of them.
5982
a8e7d6d7 59832012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
5984
5985 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
5986
a8e7d6d7 59872012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
5988
5989 * xdisp.c (pos_visible_p): If the window start position is beyond
5990 ZV, start the display from buffer beginning. Prevents assertion
5991 violation in init_iterator when the minibuffer window is scrolled
5992 via the scroll bar.
5993
5994 * window.c (window_scroll_pixel_based): Likewise.
5995
a8e7d6d7 59962012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
5997
5998 * keymap.c (where_is_internal): Doc fix (Bug#10872).
5999
a8e7d6d7 60002012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
6001
6002 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6003 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6004
a8e7d6d7 60052012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 6006
b593d6a9
AH
6007 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6008 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 6009
1c6900d9
EZ
60102012-04-26 Eli Zaretskii <eliz@gnu.org>
6011
4c3fa1d9
EZ
6012 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6013 display element, check also the underlying string or buffer
6014 character. (Bug#11341)
6015
1c6900d9
EZ
6016 * w32menu.c: Include w32heap.h.
6017 (add_menu_item): If the call to AppendMenuW (via
6018 unicode_append_menu) fails, disable Unicode menus only if we are
6019 running on Windows 9X/Me.
6020
42bf8205
AS
60212012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6022
6023 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6024 (xgetint): Add missing shift for LSB tags.
6025
b1bac16e
MR
60262012-04-24 Martin Rudalics <rudalics@gmx.at>
6027
6028 * keyboard.c (read_char): Don't wipe echo area for select window
6029 events: These might get delayed via `mouse-autoselect-window'
6030 (Bug#11304).
6031
d69621cc
JB
60322012-04-24 Juanma Barranquero <lekktu@gmail.com>
6033
6034 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6035 manipulation of :loaded-from data.
6036
02fd101b
JB
60372012-04-23 Juanma Barranquero <lekktu@gmail.com>
6038
6039 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6040 now a cons (bug#11311).
6041
888bec30
PE
60422012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6043
89a438bd
PE
6044 Do not create empty overlays with the evaporate property (Bug#9642).
6045 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6046 if it becomes empty after its bounds are adjusted to fit within
6047 its buffer. Without this fix, in a nonempty buffer (let ((o
6048 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6049 yields an empty overlay that has the evaporate property, which is
6050 not supposed to happen.
6051
1068fe4d
PE
6052 Fix minor GTK3 problems found by static checking.
6053 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6054 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6055 (struct _EmacsFixedClass, emacs_fixed_get_type):
6056 Move decls here from emacsgtkfixed.h, since they needn't be public.
6057 (emacs_fixed_get_type): Now static.
6058 (emacs_fixed_class_init): Omit unused local.
6059 (emacs_fixed_child_type): Remove; unused.
6060 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6061 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6062 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6063 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6064 (EMACS_FIXED_GET_CLASS): Remove; unused.
6065 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6066
888bec30
PE
6067 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6068 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6069
de85e130
PE
60702012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6071
d0baac98 6072 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 6073 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
6074 (__malloc_size_t, __malloc_ptrdiff_t):
6075 Remove. All uses removed, replaced by the definiens if needed,
6076 since we can assume C89 or better now.
6077 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6078 (protect_malloc_state, align, get_contiguous_space)
6079 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6080 (malloc_atfork_handler_child, malloc_enable_thread)
6081 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6082 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6083 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6084 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6085 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6086 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6087 Define using prototypes, not old style.
6088 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6089 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6090 (align): Don't assume that signed integer overflow wraps around.
6091 Omit unused local var.
6092 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6093 (_free_internal_nolock, memalign, mallochook, reallochook):
6094 Omit no-longer-needed casts.
6095 (valloc): Use getpagesize, not __getpagesize.
6096 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6097 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6098
de85e130
PE
6099 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6100
dcbf5805
MA
61012012-04-22 Michael Albinus <michael.albinus@gmx.de>
6102
6103 Move functions from C to Lisp. Make non-blocking method calls
6104 the default. Implement further D-Bus standard interfaces.
6105
6106 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6107 (QCdbus_request_name_allow_replacement)
6108 (QCdbus_request_name_replace_existing)
6109 (QCdbus_request_name_do_not_queue)
6110 (QCdbus_request_name_reply_primary_owner)
6111 (QCdbus_request_name_reply_in_queue)
6112 (QCdbus_request_name_reply_exists)
6113 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6114 (QCdbus_registered_serial, QCdbus_registered_method)
6115 (QCdbus_registered_signal): New Lisp objects.
6116 (XD_DEBUG_MESSAGE): Use sizeof.
6117 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6118 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6119 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6120 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6121 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6122 (xd_signature, xd_append_arg): Allow float for integer types.
6123 (xd_get_connection_references): New function.
b593d6a9
AH
6124 (xd_get_connection_address): Rename from xd_initialize.
6125 Return cached address.
dcbf5805
MA
6126 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6127 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6128 level.
6129 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 6130 Return number of refcounts.
dcbf5805
MA
6131 (Fdbus_get_unique_name): Make stronger parameter check.
6132 (Fdbus_message_internal): New defun.
6133 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6134 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6135 (Fdbus_send_signal, Fdbus_register_service)
6136 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6137 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6138 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6139 (Vdbus_compiled_version, Vdbus_runtime_version)
6140 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6141 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6142 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
6143 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6144 Adapt docstring.
dcbf5805 6145
52828e02
PE
61462012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6147
da05bc4c
PE
6148 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6149 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6150 Do not assume ptrdiff_t is the same width as 'int'.
6151
52828e02
PE
6152 * alloc.c: Handle unusual debugging option combinations.
6153 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6154 since the two debugging options are incompatible.
6155 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6156 is defined.
6157 (mem_init, mem_insert, mem_insert_fixup):
6158 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6159 (NEED_MEM_INSERT): Remove; no longer needed.
6160
f01769f9
LL
61612012-04-22 Leo Liu <sdl.web@gmail.com>
6162
6163 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6164
5790543d
PE
61652012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6166
6167 * sysdep.c [__FreeBSD__]: Minor cleanups.
6168 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6169 Use Emacs indenting style more consistently. Avoid some casts.
6170 Use 'double' consistently rather than mixing 'float' and 'double'.
6171
b91b7e4d
EW
61722012-04-21 Eduard Wiebe <usenet@pusto.de>
6173
b593d6a9
AH
6174 * sysdep.c (list_system_processes, system_process_attributes):
6175 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 6176
6114eb15
AS
61772012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6178
6179 * lisp.mk (lisp): Update.
6180
2f38dff7
PE
61812012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6182
6183 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6184 It is never used otherwise.
6185
4ae29f89
SM
61862012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6187
6188 * print.c (print_preprocess): Only check print_depth if print-circle
6189 is nil.
6190 (print_object): Check for cycles even when print-circle is nil and
6191 print-gensym is t, but only check print_depth if print-circle is nil.
6192
f30d612a
CY
61932012-04-20 Chong Yidong <cyd@gnu.org>
6194
6195 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6196 set the status to "failed" and ensure that sentinel is run.
6197
c07a4c0b 61982012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
6199
6200 * process.c (Fset_process_inherit_coding_system_flag)
6201 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 6202 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 6203
c07a4c0b 62042012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
6205
6206 * xdisp.c (string_buffer_position_lim): Limit starting position to
6207 BEGV.
6208 (set_cursor_from_row): If called for a mode-line or header-line
6209 row, return zero immediately.
6210 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
6211 farther than the first row after the header line, if any.
6212 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
6213 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6214
c07a4c0b 62152012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6216
4ae29f89
SM
6217 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6218 (bug#11238).
ad3a2b41 6219
c07a4c0b 62202012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 62212012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
6222
6223 configure: new option --enable-gcc-warnings (Bug#11207)
6224 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6225 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6226 (ALL_CFLAGS): Use new macros rather than old.
6227 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6228 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6229 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6230 -Wunused-result, -Wunused-variable. This should go away once
6231 the Emacs and Gnulib regex code is merged.
6232 (xmalloc, xrealloc): Now static.
6233
aba027e8
PE
62342012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6235
6236 * dired.c (Fsystem_groups): Remove unused local.
6237
e5a36063
GM
62382012-04-17 Glenn Morris <rgm@gnu.org>
6239
6240 * dired.c (Fsystem_users): Doc fix.
6241
316411f0
DA
62422012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6243
6244 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6245 (syms_of_dired): Add them.
6246
9426aba4
PE
62472012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6248
b62a57be
PE
6249 Fix minor alloc.c problems found by static checking.
6250 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6251 New extern decls, to avoid calling undeclared functions.
6252 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6253 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6254 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6255 (NEED_MEM_INSERT): New macro.
6256 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 6257 Remove one incorrect comment and fix another.
b62a57be 6258
3539f31f
PE
6259 Fix minor ralloc.c problems found by static checking.
6260 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6261 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6262 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6263 (r_alloc_sbrk): Now static.
6264
a041960a
PE
6265 Improve ralloc.c interface checking.
6266 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6267 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6268 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6269 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6270 [REL_ALLOC]: ... to here, to check interface.
6271 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6272 Remove decls. This fixes an "It stinks!".
6273
9426aba4
PE
6274 * alloc.c (which_symbols): Fix alignment issue / type clash.
6275
d55c12ed
AS
62762012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6277
6278 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6279 (struct Lisp_Misc_Any): Likewise.
6280 (struct Lisp_Free): Likewise.
6281 * alloc.c (union aligned_Lisp_Symbol): Define.
6282 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6283 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6284 (union aligned_Lisp_Misc): Define.
6285 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6286 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 6287 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 6288
b948ce8b
PE
62892012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6290
6291 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6292 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6293 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6294 * s/netbsd.h, s/sol2-6.h:
6295 Remove definition of GC_MARK_STACK, since the default now works.
6296 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6297 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6298 no longer the default.
6299 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6300
35dc09a1 63012012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6302
35dc09a1
GM
6303 * lread.c (lisp_file_lexically_bound_p):
6304 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 6305
35dc09a1
GM
63062012-04-14 Eli Zaretskii <eliz@gnu.org>
6307
6308 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6309 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6310
63112012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6312
6313 * nsterm.m (constrainFrameRect): Always constrain when there is only
6314 one screen (Bug#10962).
6315
bcd86815
KB
63162012-04-13 Ken Brown <kbrown@cornell.edu>
6317
6318 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6319
c25df26e
RT
63202012-04-13 Reuben Thomas <rrt@sc3d.org>
6321
6322 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6323
0fc59f1e
DC
63242012-04-11 Daniel Colascione <dancol@dancol.org>
6325
6326 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6327 against is gone. It's better to use vfork now so that when Cygwin
6328 gains a new, working vfork, we use it automatically (bug#10398).
6329
de8c03dc
SM
63302012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6331
6332 * window.c (save_window_save): Obey window-point-insertion-type.
6333
2f097256
GM
63342012-04-11 Glenn Morris <rgm@gnu.org>
6335
6336 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6337
453b951e
SM
63382012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6339
6340 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6341
75f1671a 63422012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
6343
6344 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6345 (force_quit_count): New var.
6346 (handle_interrupt): Use it.
6347
2a8ce227
JB
63482012-04-10 Juanma Barranquero <lekktu@gmail.com>
6349
6350 * w32.c (w32_delayed_load): Record the full path of the library
6351 being loaded (bug#10424).
6352
935396c0
GM
63532012-04-09 Glenn Morris <rgm@gnu.org>
6354
05920a43
GM
6355 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6356 not just in the obarray, before snarfing them. (Bug#11036)
6357
935396c0
GM
6358 * Makefile.in ($(leimdir)/leim-list.el):
6359 Pass EMACS rather than BUILT_EMACS.
6360
a18ecafa
TZ
63612012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6362
6363 * process.c (make_process):
6364 * process.h: Add integer `gnutls_handshakes_tried' member to
6365 process struct.
6366
6bbef4e5
JC
6367 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6368 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
6369
6370 * gnutls.c (gnutls_log_function2i): Convenience log function.
6371 (emacs_gnutls_read): Use new log functions,
6372 `gnutls_handshakes_tried' process member, and
6373 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6374 attempts per process (connection).
6375
b4d3bc10
CY
63762012-04-09 Chong Yidong <cyd@gnu.org>
6377
6378 * eval.c (Fuser_variable_p, user_variable_p_eh)
6379 (lisp_indirect_variable): Functions deleted.
6380 (Fdefvar): Caller changed.
6381
6382 * callint.c (Finteractive, Fcall_interactively):
6383 * minibuf.c (Fread_variable): Callers changed.
6384
70f4d973
EZ
63852012-04-09 Eli Zaretskii <eliz@gnu.org>
6386
6387 * xdisp.c (set_cursor_from_row): If the display string appears in
6388 the buffer at position that is closer to point than the position
6389 after the display string, display the cursor on the first glyph of
6390 the display string. Fixes cursor display when a 'display' text
6391 property immediately follows invisible text. (Bug#11094)
6392
cb3c2e3e
PE
63932012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6394
6395 composite.c: use 'double' consistently
6396 * composite.c (get_composition_id): Use 'double' consistently
6397 instead of converting 'float' to 'double' and vice versa; this is
6398 easier to understand and avoids a GCC warning.
6399
fd06db5d
GM
64002012-04-09 Glenn Morris <rgm@gnu.org>
6401
50fe702a
GM
6402 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6403 preparation for dumping it with emacs. (Bug#4789)
6404 (leimdir): New variable.
6405 ($(leimdir)/leim-list.el): New rule.
6406 (emacs$(EXEEXT)): Depend on leim-list.el.
6407
fd06db5d
GM
6408 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6409 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6410 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6411
55c131ee
AS
64122012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6413
6414 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6415 proper alignment.
6416
9209588f
JB
64172012-04-07 Juanma Barranquero <lekktu@gmail.com>
6418
6419 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6420 Remove unused local variable.
6421
e3fb2efb
PE
64222012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6423
6424 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6425 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6426 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6427 objects, as mark_maybe_pointer will catch them otherwise.
6428 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6429 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6430
b5385551
PE
64312012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6432
6433 Fix typo that broke non-Windows builds.
6434 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6435
9078ead6
EZ
64362012-04-07 Eli Zaretskii <eliz@gnu.org>
6437
6438 Support building on MS-Windows with libxml2.
6439
6440 * makefile.w32-in (OBJ2): Add xml.$(O).
6441 (GLOBAL_SOURCES): Add xml.c.
6442 ($(BLD)/xml.$(O)): New dependency list.
6443
6444 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6445 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6446 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6447 [!WINDOWSNT]: New macros.
6448 (init_libxml2_functions, libxml2_loaded_p): New functions.
6449 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6450 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6451 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6452 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6453 linked in).
6bbef4e5
JC
6454 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6455 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
6456 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6457
6458 * emacs.c: Don't include libxml/parser.h.
6459 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6460 xmlCleanupParser directly.
6461
6462 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6463
3811fdf3
EZ
64642012-04-07 Eli Zaretskii <eliz@gnu.org>
6465
6466 * indent.c (Fvertical_motion): If there is a display string at
6467 point, use it.vpos to compute how many lines to backtrack after
6468 move_it_to point. (Bug#11133)
6469
2f8e16b2
EZ
64702012-04-06 Eli Zaretskii <eliz@gnu.org>
6471
6472 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6473 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6474 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6475 macros related to unification of CJK characters. For the details,
6476 see the discussion following the message here:
6477 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6478
3d439cd1
CY
64792012-04-04 Chong Yidong <cyd@gnu.org>
6480
6481 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6482
8bc53d00
EZ
64832012-04-01 Eli Zaretskii <eliz@gnu.org>
6484
6485 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6486 instead of alloca. (Bug#11138)
6487
3b0512a3
AS
64882012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6489
6490 * w32menu.c (is_simple_dialog): Properly check lisp types.
6491 (Bug#11141)
6492
8427ddd2
EZ
64932012-03-31 Eli Zaretskii <eliz@gnu.org>
6494
979022ef
EZ
6495 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6496 position we get to after a call to move_it_to fails the
6497 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6498 only if we wind up in a string from display property. (Bug#11063)
6499
a6b1c7cc
EZ
6500 * window.c (Fdelete_other_windows_internal): Invalidate the row
6501 and column information about mouse highlight, so that redisplay
6502 restores it after reallocating the glyph matrices. (Bug#7464)
6503
8427ddd2
EZ
6504 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6505 string comes from a `display' text property, use the buffer
6506 position of that property as if we actually saw that position in
6507 the row's glyphs.
697ba24b
EZ
6508 (move_it_by_lines): Remove the assertion that
6509 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6510 violated when there's a before-string at the beginning of a line.
6511 (Bug#11063)
8427ddd2 6512
65a0a738
EZ
65132012-03-30 Eli Zaretskii <eliz@gnu.org>
6514
6515 * xdisp.c (append_space_for_newline): If the default face was
6516 remapped, use the remapped face for the appended newline.
6517 (extend_face_to_end_of_line): Use the remapped default face for
6518 extending the face to the end of the line.
6519 (display_line): Call extend_face_to_end_of_line when the default
6520 face was remapped. (Bug#11068)
6521
581355cc
EZ
65222012-03-29 Eli Zaretskii <eliz@gnu.org>
6523
6524 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6525
e8fc049f
SM
65262012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6527
6528 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6529
4fb9a543
GM
65302012-03-27 Glenn Morris <rgm@gnu.org>
6531
6532 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6533 Doc fixes.
6534
679910f1
KH
65352012-03-26 Kenichi Handa <handa@m17n.org>
6536
6537 * dispextern.h (struct glyph): Fix previous change. Change the
6538 bit length of glyphless.ch to 25 (Bug#11082).
6539
90d49b7f
CY
65402012-03-26 Chong Yidong <cyd@gnu.org>
6541
6542 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6543 (command_loop_1): Use it; inhibit selection update for
6544 handle-select-window too (Bug#8996).
6545
f514f6f0
FP
65462012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6547
e8fc049f 6548 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 6549
bf43fa51
KH
65502012-03-25 Kenichi Handa <handa@m17n.org>
6551
6552 * dispextern.h (struct glyph): Change the bit length of
6553 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6554
8a0c01dd
EZ
65552012-03-24 Eli Zaretskii <eliz@gnu.org>
6556
6557 * s/ms-w32.h (tzname): Include time.h before redirecting to
6558 _tzname. Fixes the MSVC build. (Bug#9960)
6559
7d1c3a76
AS
65602012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6561
8ed79523
AS
6562 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6563 characters.
6564
7d1c3a76
AS
6565 * xterm.c (XTread_socket): Only modify handling_signal if
6566 !SYNC_INPUT. (Bug#11080)
6567
e99a9b8b
EZ
65682012-03-23 Eli Zaretskii <eliz@gnu.org>
6569
6570 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6571 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6572 when fetching a multibyte character consumes more bytes than
6573 CHAR_BYTES returns, due to unification of CJK characters in
6574 string_char. (Bug#11073)
6575
5063c0e1
TN
65762012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6577
6578 * process.c (wait_reading_process_output): Handle pty disconnect
6579 by refraining from sending oneself a SIGCHLD (bug#10933).
6580
9f851fbd
CY
65812012-03-22 Chong Yidong <cyd@gnu.org>
6582
6583 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6584
5063c0e1 6585 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
6586 Mark string as coming from a prefix property.
6587 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6588 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6589
fb5b8aca
CY
65902012-03-21 Chong Yidong <cyd@gnu.org>
6591
6592 * xfaces.c (Vface_remapping_alist): Doc fix.
6593
62356a1b
EZ
65942012-03-20 Eli Zaretskii <eliz@gnu.org>
6595
6596 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
6597 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6598 Doc fixes.
62356a1b 6599
025de85b
CY
66002012-03-20 Chong Yidong <cyd@gnu.org>
6601
6602 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6603 to reflect default non-nil value of redisplay-dont-pause.
6604
4827f94e
KH
66052012-03-19 Kenichi Handa <handa@m17n.org>
6606
6607 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6608 it fit in a valid range (Bug#11003).
6609
e50a24a2
EZ
66102012-03-18 Eli Zaretskii <eliz@gnu.org>
6611
6612 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6613 that is not from display property, accept the row as a "cursor
6614 row" if one of the string's character has a non-nil `cursor'
6615 property. Fixes cursor positioning when there are newlines in
6616 overlay strings, e.g. in icomplete.el. (Bug#11035)
6617
9af5ed87
PE
66182012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6619
6620 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6621
d1f55f16
CY
66222012-03-12 Chong Yidong <cyd@gnu.org>
6623
6624 * eval.c (inhibit_lisp_code): Rename from
6625 inhibit_window_configuration_change_hook; move from window.c.
6626
6627 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6628 * window.c (run_window_configuration_change_hook)
6629 (syms_of_window): Callers changed.
6630
66c5eebd
CY
66312012-03-11 Chong Yidong <cyd@gnu.org>
6632
413df973
CY
6633 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6634
66c5eebd
CY
6635 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6636
1de11f56
CY
66372012-03-10 Chong Yidong <cyd@gnu.org>
6638
6639 * frame.c (other_visible_frames): Don't assume the selected frame
6640 is visible (Bug#10955).
6641
cae07000
SM
66422012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6643
6644 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6645
89c94350
JD
66462012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6647
6648 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6649 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6650 zero (Bug#10954).
6651
999dd333
GM
66522012-03-03 Glenn Morris <rgm@gnu.org>
6653
01a6dcc8 6654 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 6655
de0100f2
EZ
66562012-03-02 Eli Zaretskii <eliz@gnu.org>
6657
6658 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6659 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
6660 (redisplay_window, next_element_from_string): Fix typos in
6661 comments.
3e441275
EZ
6662 (redisplay_window): Pass to move_it_vertically the margin in
6663 pixels, not in screen lines.
de0100f2 6664
96a72ee9
GM
66652012-03-02 Glenn Morris <rgm@gnu.org>
6666
6667 * buffer.c (buffer-list-update-hook): Doc fix.
6668
312508d7
EZ
66692012-02-29 Eli Zaretskii <eliz@gnu.org>
6670
6671 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6672 push_it before setting up the iterator for the first overlay
6673 string, even if we have an empty string loaded.
6674 (next_overlay_string): If there's an empty string on the iterator
6675 stack, pop the stack. (Bug#10903)
6676
27f3c637
PE
66772012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6678
6679 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6680 Suggested by Stefan Monnier in
6681 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6682 * alloc.c (widen_to_Lisp_Object): New static function.
6683 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6684 and widening them to Lisp_Objects. This would work even if
6685 USE_LSB_TAG is defined and wide integers are used, which might
6686 happen in a future version of Emacs.
6687
3c9dfce6
CY
66882012-02-25 Chong Yidong <cyd@gnu.org>
6689
fa74b241
CY
6690 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6691 Doc fix.
6692
3c9dfce6
CY
6693 * xselect.c (Fx_selection_exists_p): Doc fix.
6694 (x_clipboard_manager_save_all): Print an informative message
6695 before saving to clipboard manager.
6696
9486df08
CY
66972012-02-24 Chong Yidong <cyd@gnu.org>
6698
6699 * keyboard.c (process_special_events): Handle all X selection
6700 requests in kbd_buffer, not just the next one (Bug#8869).
6701
f01d3321
CY
67022012-02-23 Chong Yidong <cyd@gnu.org>
6703
6704 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6705 call when setting menu-bar-lines and tool-bar-lines parameters.
6706 (unwind_create_frame_1): New helper function.
6707
6708 * window.c (inhibit_window_configuration_change_hook): New var.
6709 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 6710 (syms_of_window): Initialize it.
f01d3321 6711
86b847b6
CY
67122012-02-22 Chong Yidong <cyd@gnu.org>
6713
6714 * xterm.c (x_draw_image_relief): Add missing type check for
6715 Vtool_bar_button_margin (Bug#10743).
6716
a59225b1
CY
67172012-02-21 Chong Yidong <cyd@gnu.org>
6718
6719 * fileio.c (Vfile_name_handler_alist): Doc fix.
6720
6721 * buffer.c (Fget_file_buffer): Protect against invalid file
6722 handler return value.
6723
310f5bd4
PE
67242012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6725
cb3a28cc
PE
6726 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6727 when computing $valmask.
6728
310f5bd4
PE
6729 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6730 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6731 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6732 It's useless in that case, and it can cause problems on hosts
6733 that allocate halves of EMACS_INT values separately.
6734 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6735 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6736 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6737 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6738 it avoids undefined behavior on hosts where shifting right by more
6739 than the word width has undefined behavior.
6740
2375c96a
CY
67412012-02-19 Chong Yidong <cyd@gnu.org>
6742
6743 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6744 (Funhandled_file_name_directory, Ffile_name_as_directory)
6745 (Fdirectory_file_name, Fexpand_file_name)
6746 (Fsubstitute_in_file_name): Protect against invalid file handler
6747 return values (Bug#10845).
6748
3eb49e71
EZ
67492012-02-18 Eli Zaretskii <eliz@gnu.org>
6750
6751 * .gdbinit (pitx): Fix incorrect references to fields of the
6752 iterator stack.
6753
7b926f3f
CY
67542012-02-17 Chong Yidong <cyd@gnu.org>
6755
6756 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6757
11273115
PE
67582012-02-15 Paul Eggert <eggert@cs.ucla.edu>
6759
6760 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6761 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6762
c3a70e2b
CY
67632012-02-15 Chong Yidong <cyd@gnu.org>
6764
6765 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6766 marked as special. Also, starting docstrings with * is obsolete.
6767
0ca43699
AS
67682012-02-13 Andreas Schwab <schwab@linux-m68k.org>
6769
6770 * gnutls.c (emacs_gnutls_write): Fix last change.
6771
2e8f3c56
LI
67722012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
6773
6774 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6775 send_process.
6776
af70074f
SM
67772012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
6778
6779 * keymap.c (Fsingle_key_description): Handle char ranges.
6780
95986d52
CY
67812012-02-12 Chong Yidong <cyd@gnu.org>
6782
afd83bd1
CY
6783 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6784 as that creates a dangerous corner case.
6785
95986d52
CY
6786 * window.c (Fdelete_window_internal): Invalidate the mouse
6787 highlight (Bug#9904).
6788
bd7da63e
GM
67892012-02-12 Glenn Morris <rgm@gnu.org>
6790
6791 * xselect.c (Fx_own_selection_internal)
6792 (Fx_get_selection_internal, Fx_disown_selection_internal)
6793 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6794 * nsselect.m (Fx_own_selection_internal)
6795 (Fx_disown_selection_internal, Fx_selection_exists_p)
6796 (Fx_selection_owner_p, Fx_get_selection_internal):
6797 Sync docs and argument specs with the xselect.c versions.
6798
77abcbc2
LI
67992012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
6800
6801 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6802
90b671e2
EZ
68032012-02-11 Eli Zaretskii <eliz@gnu.org>
6804
1c0ca0b7
EZ
6805 * w32select.c (Fx_selection_exists_p): Sync doc string and
6806 argument list with xselect.c. (Bug#10783)
6807
6808 * w16select.c (Fx_selection_exists_p): Sync doc string and
6809 argument list with xselect.c. (Bug#10783)
90b671e2 6810
49241268
GM
68112012-02-10 Glenn Morris <rgm@gnu.org>
6812
6813 * fns.c (Fsecure_hash): Doc fix.
6814
f998bbe7 68152012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
6816
6817 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
6818
0992bd9c
CY
68192012-02-07 Chong Yidong <cyd@gnu.org>
6820
6821 * buffer.c (Fbuffer_local_variables)
6822 (buffer_lisp_local_variables): Handle unbound vars correctly;
6823 don't let Qunbound leak into Lisp.
6824
af008560
GM
68252012-02-07 Glenn Morris <rgm@gnu.org>
6826
dd605cc4
GM
6827 * image.c (Fimagemagick_types): Doc fix.
6828
af008560
GM
6829 * image.c (imagemagick-render-type): Change it from a lisp object
6830 to an integer. Move the doc here from the lisp manual.
6831 Treat all values not equal to 0 the same.
6832
1449fa1d
CY
68332012-02-06 Chong Yidong <cyd@gnu.org>
6834
6835 * doc.c (store_function_docstring): Avoid applying docstring of
6836 alias to base function (Bug#2603).
6837
3723ec07
AS
68382012-02-04 Andreas Schwab <schwab@linux-m68k.org>
6839
6840 * .gdbinit (pp1, pv1): Remove redundant defines.
6841 (pr): Use pp.
6842
79c1cc1e
CY
68432012-02-04 Chong Yidong <cyd@gnu.org>
6844
6845 * nsterm.m: Declare a global (Bug#10694).
6846
d7f29f8e
EZ
68472012-02-04 Eli Zaretskii <eliz@gnu.org>
6848
cae07000
SM
6849 * w32.c (get_emacs_configuration_options):
6850 Include --enable-checking, if specified, in the return value.
d7f29f8e 6851
3b95a6f9
MR
68522012-02-04 Martin Rudalics <rudalics@gmx.at>
6853
6854 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6855 after rounding frame sizes. (Bug#9723)
6856
d6fa96a6
EZ
68572012-02-04 Eli Zaretskii <eliz@gnu.org>
6858
6859 * keyboard.c (adjust_point_for_property): Don't position point
6860 before BEGV. (Bug#10696)
6861
df0b2940
PE
68622012-02-03 Paul Eggert <eggert@cs.ucla.edu>
6863
6864 Handle overflow when computing char display width (Bug#9496).
6865 * character.c (char_width): Return EMACS_INT, not int.
6866 (char_width, c_string_width): Check for overflow when
6867 computing the width; this is possible now that individual
6868 characters can have unbounded width. Problem introduced
6869 by merge from Emacs 23 on 2012-01-19.
6870
6bee44d6
MA
68712012-02-02 Michael Albinus <michael.albinus@gmx.de>
6872
6873 * dbusbind.c (Fdbus_register_method): Mention the return value
6874 :ignore in the docstring.
6875
44f92739
GM
68762012-02-02 Glenn Morris <rgm@gnu.org>
6877
1b9f60cc
GM
6878 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
6879
44f92739
GM
6880 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6881 Unconditionally set to t. (Bug#10673)
6882 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6883 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6884 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
6885
c5d3843c
KH
68862012-02-02 Kenichi Handa <handa@m17n.org>
6887
6888 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
6889 0, do not call append_composite_glyph.
6890
159462d4 68912012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
6892
6893 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
6894 NULL (Bug#6988).
6895 (x_produce_glyphs): If the component of a composition is a null
6896 string, set it->pixel_width to 1 to avoid zero-width glyph.
6897
78cef877
EZ
68982012-02-01 Eli Zaretskii <eliz@gnu.org>
6899
6900 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
6901 first 2 arguments are identical. This makes inserting large
6902 output from a subprocess an order of magnitude faster on
6903 MS-Windows, where all sbrk'ed memory is always contiguous.
6904
97897668
GM
69052012-01-31 Glenn Morris <rgm@gnu.org>
6906
6907 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 6908 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
6909 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
6910
31fd3586
GM
69112012-01-29 Glenn Morris <rgm@gnu.org>
6912
6913 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
6914
0e24a8b2
CY
69152012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
6916
6917 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
6918
cc0adcb0
CY
69192012-01-28 Chong Yidong <cyd@gnu.org>
6920
6921 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
6922
acc28cb9
CY
69232012-01-26 Chong Yidong <cyd@gnu.org>
6924
9c69cfb7
CY
6925 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
6926
acc28cb9
CY
6927 * search.c (Fsearch_forward, Fsearch_backward): Document negative
6928 repeat counts (Bug#10507).
6929
48da7392
GM
69302012-01-26 Glenn Morris <rgm@gnu.org>
6931
6932 * lread.c (syms_of_lread): Doc fix.
6933
14af5f7f
CY
69342012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
6935
6936 * coding.c (encode_designation_at_bol): Change return value to
6937 EMACS_INT.
6938
0b21c100
CY
69392012-01-25 Chong Yidong <cyd@gnu.org>
6940
6941 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
6942
3c2907f7
CY
69432012-01-21 Chong Yidong <cyd@gnu.org>
6944
6945 * floatfns.c (Fcopysign): Make the second argument non-optional,
6946 since nil is not allowed anyway.
6947
959ad23f
AS
69482012-01-21 Andreas Schwab <schwab@linux-m68k.org>
6949
6950 * process.c (read_process_output): Use p instead of XPROCESS (proc).
6951 (send_process): Likewise.
6952
34a02f46
MR
69532012-01-19 Martin Rudalics <rudalics@gmx.at>
6954
6955 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
6956 (Vwindow_persistent_parameters): Do not use Qstate.
6957 Rewrite doc-strings.
34a02f46 6958
1259009a 69592012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
6960
6961 * character.c (char_width): New function.
70d4fdf6
GM
6962 (Fchar_width, c_string_width, lisp_string_width):
6963 Use char_width (Bug#9496).
25ed9e61 6964
6a6ee00d
MR
69652012-01-16 Martin Rudalics <rudalics@gmx.at>
6966
6967 * window.c (Vwindow_persistent_parameters): New variable.
6968 (Fset_window_configuration, save_window_save): Handle persistent
6969 window parameters.
6970
c85efaf7
EZ
69712012-01-14 Eli Zaretskii <eliz@gnu.org>
6972
6973 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
6974 thrashing the stack of the thread. (Bug#9087)
6975
5944709e
PE
69762012-01-12 Paul Eggert <eggert@cs.ucla.edu>
6977
6978 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
6979
e71f5d99
EZ
69802012-01-11 Eli Zaretskii <eliz@gnu.org>
6981
6982 * xdisp.c (rows_from_pos_range): Handle the case where the
6983 highlight ends on a newline. (Bug#10464)
6984 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
6985 he end column for display of highlight that ends on a newline
6986 before a R2L line.
6987
ce316182
GM
69882012-01-11 Glenn Morris <rgm@gnu.org>
6989
6990 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
6991 from load-path also when installation-directory is nil. (Bug#10208)
6992
5b43da69
GM
69932012-01-10 Glenn Morris <rgm@gnu.org>
6994
74cc8ff9
GM
6995 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
6996
7d8d6e4e
GM
6997 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
6998 Update template values to be closer to their typical values these days.
5b43da69 6999
a0db8d43
EZ
70002012-01-09 Eli Zaretskii <eliz@gnu.org>
7001
7002 * xdisp.c (rows_from_pos_range): Accept additional argument
7003 DISP_STRING, and accept any glyph in a row whose object is that
7004 string as eligible for mouse highlight. Fixes mouse highlight of
7005 display strings from overlays. (Bug#10464)
7006
9a0115ab 70072012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 7008
b9110d6a 7009 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
7010 * fileio.c (auto_saving_dir_umask): New static var.
7011 (Fmake_directory_internal): Use it.
7012 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7013 creating the directory. The old code temporarily assigns
7014 too-generous permissions to the directory.
7015 (do_auto_save_eh): Clear it.
b9110d6a 7016 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
7017 that the var is always cleared.
7018
6c1bd3f3
EZ
70192012-01-07 Eli Zaretskii <eliz@gnu.org>
7020
7021 * search.c (scan_buffer): Pass character positions to
7022 know_region_cache, not byte positions. (Bug#6540)
7023
069d2b50
L
70242012-01-07 LynX <_LynX@bk.ru> (tiny change)
7025
7026 * w32.c (sys_rename): Report EXDEV when rename of a directory
7027 fails because the target is on another logical disk. (Bug#10284)
7028
75bf0d33
DB
70292012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7030
7031 * xterm.c (x_embed_request_focus): New function.
7032
7033 * xterm.h: Add prototype.
7034
7035 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7036
1c6e5a32
GM
70372012-01-05 Glenn Morris <rgm@gnu.org>
7038
7039 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7040
651e947e
EZ
70412012-01-01 Eli Zaretskii <eliz@gnu.org>
7042
7043 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7044 Load gnutls_transport_set_lowat only if GnuTLS version is below
7045 2.11.1.
7046 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7047 GnuTLS versions below 2.11.1.
7048
3778cdd8
AL
70492011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7050
7051 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7052 to the doc string advising against its use for altering the way
7053 windows are scrolled.
7054
0e5317f7
KH
70552011-12-28 Kenichi Handa <handa@m17n.org>
7056
7057 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7058 coding-system ASCII compatible only when it does not produce BOM
7059 on encoding (Bug#10383).
7060
93d5ca1f
JD
70612011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7062
7063 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7064 can scroll.
7065 (create_and_show_popup_menu): Always use menu_position_func for
7066 Gtk3 (Bug#10361).
7067
ca22b785
AS
70682011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7069
7070 * callint.c (Fcall_interactively): Don't truncate prompt string.
7071
d048e1e6
EZ
70722011-12-23 Eli Zaretskii <eliz@gnu.org>
7073
7074 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7075 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 7076 resumed from there (after widening). (Bug#10360)
d048e1e6 7077
5ccaba1f
JD
70782011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7079
7080 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7081
204ee57f
JD
70822011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7083
b81d40f0
JB
7084 * nsterm.m (x_free_frame_resources):
7085 Release f->output_data.ns->miniimage.
204ee57f
JD
7086 (ns_index_color): Fix indentation. Do not retain
7087 color_table->colors[i].
7088
7089 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7090 before returning.
7091
7092 * nsfns.m (x_set_background_color): Assign return value from
7093 ns_index_color to face-background instead of NSColor*.
7094 (ns_implicitly_set_icon_type): Fix indentation.
7095 Change assignment in for loop to comparison.
7096
7097 * emacs.c (ns_pool): New variable.
7098 (main): Assign ns_pool.
7099 (Fkill_emacs): Call ns_release_autorelease_pool.
7100
7101 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7102 autorelease fdesc, release fdAttrs and tdict.
7103 (ns_get_covering_families): Release charset.
7104 (ns_findfonts): Release NSFontDescriptor created with new.
7105 (ns_uni_to_glyphs): Fix indentation.
7106 (setString): Release attrStr before assigning new value.
7107
c803b2b7
JD
71082011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7109
678f4426
JD
7110 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7111 and NS_IMPL_COCOA.
7112 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7113 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7114
cd394be1 71152011-12-18 David Reitter <reitter@cmu.edu>
678f4426 7116
5fecd5fc
JD
7117 * nsterm.m (ns_term_init): Subscribe for notifications
7118 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7119 to method trackingNotification in EmacsMenu.
7120
7121 * nsmenu.m (trackingMenu): New variable.
3771cb17 7122 (trackingNotification): New method (from Aquamacs).
5fecd5fc 7123 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 7124 from Aquamacs (Bug#7030).
678f4426
JD
7125
71262011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 7127
c803b2b7
JD
7128 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7129 (symbol_to_nsstring): Fix indentation.
7130 (ns_symbol_to_pb): New function.
cae07000
SM
7131 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7132 (Fns_rotate_cut_buffers_internal): Remove.
7133 (Fns_store_selection_internal): Rename from
c803b2b7
JD
7134 Fns_store_cut_buffer_internal.
7135 (ns_get_foreign_selection, Fx_own_selection_internal)
7136 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
7137 (Fns_get_selection_internal, Fns_store_selection_internal):
7138 Use ns_symbol_to_pb and check if return value is nil.
7139 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7140 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
7141 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7142 renamed to Sns_store_selection_internal.
7143 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7144 and remove this function.
7145 (ns_handle_selection_clear): Remove, never used.
7146 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7147 here.
7148
e1b01a3a
KB
71492011-12-17 Ken Brown <kbrown@cornell.edu>
7150
7151 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7152 GID is unknown (Bug#10257).
7153
2adb6e85
PE
71542011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7155
7156 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7157 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7158 which caused a build failure on GNU/Linux IA-64. This problem was
7159 introduced by my 2011-10-07 patch.
7160
d1d7b339
JL
71612011-12-15 Juri Linkov <juri@jurta.org>
7162
7163 * image.c (imagemagick_error): New function. (Bug#10112)
7164 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7165 Use `imagemagick_error' where ImageMagick functions return
7166 `MagickFalse'.
7167 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7168 proper order.
7169
100d5755
KH
71702011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7171
7172 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7173 fill background (Bug#8992).
7174
454592a6
MR
71752011-12-13 Martin Rudalics <rudalics@gmx.at>
7176
7177 * window.c (Vwindow_combination_resize)
7178 (Vwindow_combination_limit): Use t instead of non-nil in
7179 doc-strings.
61d4b438
MR
7180 (Vrecenter_redisplay): Add first sentence of doc-string on
7181 separate line.
53524d93 7182 (Frecenter): Fix doc-string typo.
454592a6 7183
3633e3aa
KH
71842011-12-11 Kenichi Handa <handa@m17n.org>
7185
7186 * coding.c (Funencodable_char_position): Pay attention to the
7187 buffer text relocation (Bug#9389).
7188
7b9d523a 71892011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 7190
7b9d523a
JD
7191 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7192 gtk_init (Bug#10100).
7193
b73189c6
EZ
71942011-12-10 Eli Zaretskii <eliz@gnu.org>
7195
7196 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7197 IT->string is nil. (Bug#10263)
7198
f7dfe5d6
JD
71992011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7200
83faebb4
JD
7201 * nsterm.h (x_free_frame_resources): Declare.
7202
f7dfe5d6
JD
7203 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7204 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7205
7206 * nsterm.h (ns_get_defaults_value): Declare.
7207
7208 * nsterm.m (ns_default): Call ns_get_defaults_value.
7209
7cd4e72c
EZ
72102011-12-09 Eli Zaretskii <eliz@gnu.org>
7211
7212 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7213 (Bug#10170)
7214
b34d7317
YM
72152011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7216
7217 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7218 that where the value of an _OBJC_* symbol points to is in the .bss
7219 section (Bug#10240).
7220
76470ad1
KH
72212011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7222
7223 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 7224 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 7225
745fff94
KH
72262011-12-08 Kenichi Handa <handa@m17n.org>
7227
7228 * ftfont.c (get_adstyle_property): Fix previous change
7229 (Bug#10233).
7230
6e44397c
JB
72312011-12-07 Juanma Barranquero <lekktu@gmail.com>
7232
7233 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7234 dirs from the default value of EMACSLOADPATH (bug#10208).
7235
7efa6272
GM
72362011-12-07 Glenn Morris <rgm@gnu.org>
7237
7238 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7239 installation and source directories as well. (Bug#10208)
7240
f6fc4d87
CY
72412011-12-06 Chong Yidong <cyd@gnu.org>
7242
7243 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7244
2bf26180
GM
72452011-12-06 Glenn Morris <rgm@gnu.org>
7246
7247 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7248 as an error, not just -1. (Bug#10217)
7249
3a6ad4f0
CY
72502011-12-05 Chong Yidong <cyd@gnu.org>
7251
7252 * keyboard.c (process_special_events): New function.
7253 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7254
75a3b399
PE
72552011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7256
7257 * coding.c (encode_designation_at_bol): Don't use uninitialized
7258 local variable (Bug#9318).
7259
c3c9e25e
KH
72602011-12-05 Kenichi Handa <handa@m17n.org>
7261
7262 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7263 return Qnil (Bug#8046, Bug#10193).
7264
5eb05ea3
KH
72652011-12-05 Kenichi Handa <handa@m17n.org>
7266
7267 * coding.c (encode_designation_at_bol): New args charbuf_end and
7268 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
7269 (coding_set_source): Return how many bytes coding->source was
7270 relocated.
7271 (coding_set_destination): Return how many bytes
7272 coding->destination was relocated.
7273 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 7274 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
7275
72762011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7277
7278 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7279 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7280 macro (Bug#9318).
7281
72822011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7283
7284 The following changes are to fix Bug#9318.
7285
a79703f5 7286 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
7287 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7288 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 7289 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 7290
7dbda6df
JB
72912011-12-05 Juanma Barranquero <lekktu@gmail.com>
7292
7293 * lisp.h (process_quit_flag): Fix external declaration.
7294
6d5eb5b0
SM
72952011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7296
7297 Don't macro-inline non-performance-critical code.
7298 * eval.c (process_quit_flag): New function.
7299 * lisp.h (QUIT): Use it.
7300
a0c3fad0
JD
73012011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7302
7303 * nsfns.m (get_geometry_from_preferences): New function.
7304 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7305
6c07aac2
AS
73062011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7307
7308 * emacs.c (Qkill_emacs): Define.
7309 (syms_of_emacs): Initialize it.
7310 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7311 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
7312 (quit_throw_to_read_char): Add parameter `from_signal'.
7313 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
7314 * lisp.h (QUIT): Call Fkill_emacs if requested.
7315
c052ead4
JD
73162011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7317
7318 * widget.c (update_wm_hints): Return if wmshell is null.
7319 (widget_update_wm_size_hints): New function.
7320
7321 * widget.h (widget_update_wm_size_hints): Declare.
7322
7323 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7324 widget_update_wm_size_hints (Bug#10104).
7325
9e49252b
EZ
73262011-12-03 Eli Zaretskii <eliz@gnu.org>
7327
7328 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7329 before a newline, prepare the bidi iterator for consuming the
7330 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 7331 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 7332
02b16839
JL
73332011-12-02 Juri Linkov <juri@jurta.org>
7334
7335 * search.c (Fword_search_regexp): New Lisp function created from
7336 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7337 (Fword_search_backward, Fword_search_forward)
7338 (Fword_search_backward_lax, Fword_search_forward_lax):
7339 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7340 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7341
0068070e
SM
73422011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7343
7344 * fileio.c (Finsert_file_contents): Move after-change-function call
7345 to before the "handled:" label, since all "goto handled" appear in
7346 cases where the *-change-functions have already been properly called
7347 (bug#10117).
7348
3360a3fc
AS
73492011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7350
7351 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7352 waiting for input. (Bug#10169)
7353
73d6c093
EZ
73542011-11-30 Eli Zaretskii <eliz@gnu.org>
7355
7356 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7357 verifies glyph row's hash code--we have just reallocated the
7358 glyphs, so their contents can be complete garbage. (Bug#10164)
7359
febe6bea
JB
73602011-11-30 Juanma Barranquero <lekktu@gmail.com>
7361
7362 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7363
801a4313
EZ
73642011-11-30 Eli Zaretskii <eliz@gnu.org>
7365
7366 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7367 attributes are tested _before_ calling verify_row_hash, to protect
7368 against GCC re-ordering of the tests. (Bug#10164)
7369
2b56b87e
JD
73702011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7371
7372 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7373
7374 * xterm.c (handle_one_xevent): Only set async_visible and friends
7375 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 7376 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
7377 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7378
dbf31225
PE
73792011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7380
7381 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7382 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7383 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7384 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7385 All uses changed to use GCPRO1 etc.
7386 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7387 Revert to old implementation (i.e., before 2011-03-11).
7388
1305621b
YM
73892011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7390
7391 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7392 of scroll runs so as to avoid assigning disabled bogus rows and
7393 unnecessary graphics copy operations.
7394
8c9afb46
EZ
73952011-11-27 Eli Zaretskii <eliz@gnu.org>
7396
7397 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7398 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7399 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7400 (malloc, free, realloc, calloc): Redirect to e_* only when
7401 compiling Emacs.
7402
7403 * lisp.h (GCTYPEBITS): Move before first use.
7404 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7405 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7406 this macro definition.
7407
7408 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7409 _MSC_VER.
7410
54e9e3bf
JD
74112011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7412
6d5eb5b0
SM
7413 * gtkutil.c (xg_create_frame_widgets):
7414 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
7415 present with Gtk+ 2.0.
7416
83aca1cb
PE
74172011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7418
7419 * fileio.c (Finsert_file_contents): Undo previous change; see
7420 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7421
5b76caa4
PE
74222011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7423
7424 Rename locals to avoid shadowing.
7425 * fileio.c (Finsert_file_contents):
7426 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7427 * process.c (wait_reading_process_output):
7428 Rename inner 'proc' to 'p' to avoid shadowing.
7429 Indent for consistency with usual Emacs style.
7430
8c535114
EZ
74312011-11-25 Eli Zaretskii <eliz@gnu.org>
7432
7433 * xdisp.c (redisplay_window): If cursor row is not fully visible
7434 after recentering, and scroll-conservatively is set to a large
7435 number, scroll window by a few more lines to make the cursor fully
7436 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
7437 (start_display): Don't move to the next line if the display should
7438 start at a newline that is part of a display vector or an overlay
7439 string. (Bug#10119)
8c535114 7440
fa4fdb5c
JL
74412011-11-24 Juri Linkov <juri@jurta.org>
7442
7443 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7444 after the `MagickPingImage' call. (Bug#10112)
7445
90ec88df
CY
74462011-11-23 Chong Yidong <cyd@gnu.org>
7447
7448 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7449
56e2e794
MR
74502011-11-23 Martin Rudalics <rudalics@gmx.at>
7451
7452 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7453 making another buffer current. (Bug#10114)
7454
b6e64c41
GM
74552011-11-23 Glenn Morris <rgm@gnu.org>
7456
7457 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7458
6b21de18
CY
74592011-11-23 Chong Yidong <cyd@gnu.org>
7460
7461 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7462 using it (Bug#5984).
7463
b12cd789
EZ
74642011-11-22 Eli Zaretskii <eliz@gnu.org>
7465
7466 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7467 and header-lines, as they don't have one computed for them.
7468 (Bug#10098)
7469
7470 * .gdbinit (prow): Make displayed values more self-explaining.
7471 Add row's hash code.
7472
261b6fd4
LMI
74732011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7474
7475 * process.c (wait_reading_process_output): Fix asynchrounous
7476 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 7477 (wait_reading_process_output): Add comment and URL.
261b6fd4 7478
e7cfd277
JD
74792011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7480
7481 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7482
a9b9b7f5
CY
74832011-11-21 Chong Yidong <cyd@gnu.org>
7484
7485 * window.c (Fnext_window, Fprevious_window): Doc fix.
7486
b0d15b4f
SM
74872011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7488
7489 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7490
fe7a3057
JB
74912011-11-20 Juanma Barranquero <lekktu@gmail.com>
7492
7493 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7494
d2999b1a
MR
74952011-11-20 Martin Rudalics <rudalics@gmx.at>
7496
7497 * window.c (Fset_window_combination_limit): Rename argument
7498 STATUS to LIMIT.
7499 (Vwindow_combination_limit): Remove "status" from doc-string.
7500
d5ff9cd0
AS
75012011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7502
7503 * m/ibms390.h: Remove.
7504 * m/ibms390x.h: Don't include "ibms390.h".
7505
a5bb9bd3
SM
75062011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7507
7508 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7509 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7510
cd1181db
JB
75112011-11-20 Juanma Barranquero <lekktu@gmail.com>
7512
7513 * casetab.c (Fset_case_table):
7514 * charset.c (Fcharset_after): Fix typos.
7515
615a3b8d 75162011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 7517
17e845af
PE
7518 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7519 Otherwise, valgrind does not work on some platforms.
7520 Problem reported by Andreas Schwab in
6a0bf43d
PE
7521 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7522 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7523 is set, removing the need for VIRT_ADDRESS_VARIES.
7524 (PURE_P): Use a more-efficient implementation that needs just one
7525 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7526 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7527 to 4 (xorl, subq, cmpq, setbe).
7528 * alloc.c (pure): Always extern now, since that's the
7529 VIRT_ADDR_VARIES behavior.
7530 (PURE_POINTER_P): Use a single comparison, not two, for
7531 consistency with the new puresize.h.
7532 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7533 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7534 Remove VIRT_ADDR_VARIES no longer needed.
7535
f8fe6f96
EZ
75362011-11-19 Eli Zaretskii <eliz@gnu.org>
7537
7538 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7539 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7540 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7541 behave as if the cursor position were at the window margin.
7542
7543 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7544 and the cursor position is out of bounds, behave as if the cursor
7545 position were at the window margin. (Bug#10075)
7546
df05a53c
CY
75472011-11-18 Chong Yidong <cyd@gnu.org>
7548
7549 * window.c (Fwindow_combination_limit): Make first argument
7550 non-optional, since it is meaningless for live windows like the
7551 selected window.
61ccba97 7552
2071918e
DA
75532011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7554
7555 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7556
b50a28de
SM
75572011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7558
7559 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7560 (graft_intervals_into_buffer): Simplify.
7561
015137db
EZ
75622011-11-18 Eli Zaretskii <eliz@gnu.org>
7563
7564 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7565 hash values of the two rows.
7566 (copy_row_except_pointers): Preserve the used[] arrays and the
7567 hash values of the two rows. (Bug#10035)
68c95424 7568 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
7569
7570 * xdisp.c (row_hash): New function, body extracted from
7571 compute_line_metrics.
7572 (compute_line_metrics): Call row_hash, instead of computing the
7573 hash code inline.
7574
7575 * dispnew.c (verify_row_hash): Call row_hash for computing the
7576 hash code of a row, instead of duplicating code from xdisp.c.
7577
7578 * dispextern.h (row_hash): Add prototype.
7579
a2addb04
TH
75802011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7581
7582 * frame.c (delete_frame): Don't delete the terminal when the last
7583 X frame is closed if emacs is built with GTK toolkit.
7584
df85d315
JB
75852011-11-17 Juanma Barranquero <lekktu@gmail.com>
7586
7587 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7588
a0c2d0ae
MR
75892011-11-17 Martin Rudalics <rudalics@gmx.at>
7590
7591 * window.c (Vwindow_splits): Rename to
7592 Vwindow_combination_resize. Suggested by Juri Linkov.
7593 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7594 of Vwindow_splits.
7595
58179cce
JB
75962011-11-16 Juanma Barranquero <lekktu@gmail.com>
7597
7877f373
JB
7598 * nsfns.m (Fns_font_name):
7599 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 7600
b6f67890
MR
76012011-11-16 Martin Rudalics <rudalics@gmx.at>
7602
7603 * window.h (window): Rename slot "nest" to "combination_limit".
7604 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7605 (Fset_window_nest): Rename to Fset_window_combination_limit.
7606 (Vwindow_nest): Rename to Vwindow_combination_limit.
7607 (recombine_windows, make_parent_window, make_window)
7608 (Fsplit_window_internal, saved_window)
7609 (Fset_window_configuration, save_window_save): Rename all
7610 occurrences of window_nest to window_combination_limit.
7611
c7015153
JB
76122011-11-15 Juanma Barranquero <lekktu@gmail.com>
7613
7614 * image.c (imagemagick_load_image): Fix typo.
7615
322ad6ec
EZ
76162011-11-14 Eli Zaretskii <eliz@gnu.org>
7617
7618 * xdisp.c (display_line): Move the call to
7619 highlight_trailing_whitespace before the call to
7620 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
7621 faces of all the glyphs to compute ROW's hash value.
7622 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 7623
f067b8ec
JB
76242011-11-14 Juanma Barranquero <lekktu@gmail.com>
7625
7626 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7627 just return (bug#10044).
7628
1e5b2111
EZ
76292011-11-12 Eli Zaretskii <eliz@gnu.org>
7630
7ef3cbd5
EZ
7631 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7632 with user-defined heap size. Bump the default size of the temacs
7633 heap to 27MB, to avoid memory warning when running temacs.
7634 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7635
1e5b2111
EZ
7636 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7637 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
7638 (verify_row_hash) [XASSERTS]: New function.
7639 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7640 that the hash value of glyph rows is correct.
1e5b2111 7641
89d61221
MR
76422011-11-12 Martin Rudalics <rudalics@gmx.at>
7643
7644 * window.h (window): Remove splits slot.
7645 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7646 (Fdelete_other_windows_internal, make_parent_window)
7647 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7648 (Fset_window_configuration, save_window_save): Don't deal with
7649 split status of windows.
7650 (saved_window): Remove splits slot.
7651 (Vwindow_splits): Rewrite doc-string.
7652
97f18cc8
JD
76532011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7654
7655 * xfns.c (unwind_create_frame):
7656 * nsfns.m (unwind_create_frame):
7657 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7658 Vframe_list (Bug#9999).
7659
22a648b4
DA
76602011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7661
0b381c7e 7662 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 7663
659afede
KH
76642011-11-11 Kenichi Handa <handa@m17n.org>
7665
7666 * callproc.c (Fcall_process): Set the member dst_multibyte of
7667 process_coding.
7668
9ac0394b
KH
76692011-11-11 Johan Bockgård <bojohan@gnu.org>
7670
7671 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7672 avoid a crash (bug#9496).
7673
2fbdc249
CY
76742011-11-09 Chong Yidong <cyd@gnu.org>
7675
7676 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7677 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7678
ac6b1f81
PE
76792011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7680
7681 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7682
09db192c
PE
76832011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7684
7685 Avoid some portability problems by eschewing 'extern inline' functions.
7686 The trivial performance wins aren't worth the portability hassles; see
7687 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7688 et seq.
7689 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7690 (window_box_width, window_box_left, window_box_left_offset)
7691 (window_box_right, window_box_right_offset): Undo previous change,
7692 by removing the "extern"s.
7693 * intervals.c (adjust_intervals_for_insertion)
7694 (adjust_intervals_for_deletion): Undo previous change,
7695 making these static again.
7696 (offset_intervals, temp_set_point_both, temp_set_point)
7697 (copy_intervals_to_string): No longer inline.
7698 * xdisp.c (window_text_bottom_y, window_box_width)
7699 (window_box_height, window_box_left_offset)
7700 (window_box_right_offset, window_box_left, window_box_right)
7701 (window_box): No longer inline.
7702
105216ed
CY
77032011-11-08 Chong Yidong <cyd@gnu.org>
7704
7705 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
7706 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7707 Signal an error if not a live window.
105216ed
CY
7708 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7709 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7710
ae9e237f
JB
77112011-11-07 Juanma Barranquero <lekktu@gmail.com>
7712
7713 * lisp.h (syms_of_abbrev): Remove declaration.
7714 Reported by CHENG Gao <chenggao@royau.me>.
7715
c7aa8333
EZ
77162011-11-07 Eli Zaretskii <eliz@gnu.org>
7717
7718 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7719 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7720 of temacs in GUI mode.
7721
be7f5545
MR
77222011-11-07 Martin Rudalics <rudalics@gmx.at>
7723
7724 * window.h: Declare delete_all_child_windows instead of
7725 delete_all_subwindows.
7726 * window.c (Fwindow_nest, Fset_window_nest)
7727 (Fset_window_new_total, Fset_window_new_normal)
7728 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7729 (delete_all_subwindows): Rename to delete_all_child_windows.
7730 (Fdelete_other_windows_internal, Fset_window_configuration):
7731 Call delete_all_child_windows instead of delete_all_subwindows.
7732 * frame.c (delete_frame): Call delete_all_child_windows instead
7733 of delete_all_subwindows.
7734
ca78dc43
PE
77352011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7736
7737 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7738 This is also needed for porting to any host where GC_MARK_STACK is
7739 not GC_MAKE_GCPROS_NOOPS.
7740 (which_symbols): Use it.
7741
a0241d01
KH
77422011-11-07 Kenichi Handa <handa@m17n.org>
7743
7744 * coding.c (coding_set_destination): Check coding->src_pos only
7745 when coding->src_object is a buffer (bug#9910).
7746
7747 * process.c (send_process): Set the member src_multibyte of coding
7748 to 0 (bug#9911) when sending a unibyte text.
7749
7750 * callproc.c (Fcall_process): Set the member src_multibyte of
7751 process_coding to 0 (bug#9912).
7752
a64bfdfa 77532011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
7754
7755 * xmenu.c (cleanup_widget_value_tree): New function.
7756 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7757 calling free_menubar_widget_value_tree directly (Bug#9830).
7758
cb41b32a
PE
77592011-11-06 Paul Eggert <eggert@cs.ucla.edu>
7760
7761 Fix some portability problems with 'inline'.
7762 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7763 (window_box_width, window_box_left, window_box_left_offset)
7764 (window_box_right, window_box_right_offset): Declare extern.
7765 Otherwise, these inline functions do not conform to C99 and
7766 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
7767 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7768 * intervals.c (adjust_intervals_for_insertion)
7769 (adjust_intervals_for_deletion): Now extern, because otherwise the
7770 extern inline functions 'offset_intervals' couldn't refer to it.
7771 (static_offset_intervals): Remove.
7772 (offset_intervals): Rewrite using the old contents of
7773 static_offset_intervals. The old version didn't conform to C99
7774 because an extern inline function contained a reference to an
7775 identifier with static linkage.
7776
b7041366
AS
77772011-11-06 Andreas Schwab <schwab@linux-m68k.org>
7778
7779 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7780 GC.
7781
88a37c4d
EZ
77822011-11-06 Eli Zaretskii <eliz@gnu.org>
7783
7784 * xdisp.c (init_iterator, reseat_to_string): Don't set the
7785 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
7786 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7787 return Qleft_to_right.
7788
49745b39
CY
77892011-11-06 Chong Yidong <cyd@gnu.org>
7790
7791 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7792 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7793 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7794 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7795 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7796 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7797 (Fwindow_vscroll): Doc fix.
7798 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7799 argument, since it makes no sense to pass a live window and for
7800 consistency with window-child.
7801
1f05cd82
CS
78022011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
7803
7804 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
7805 support MSVC.
7806
22610910
JR
78072011-11-05 Jason Rumney <jasonr@gnu.org>
7808
7809 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
7810 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
7811 fonts (Bug#6029).
7812 (add_font_entity_to_list): Fix logic errors in mixed boolean and
7813 bitwise arithmetic preventing use of unicode-sip and non-truetype
7814 opentype fonts.
7815
a06776b2
EZ
78162011-11-05 Eli Zaretskii <eliz@gnu.org>
7817
3ad924ba
EZ
7818 * s/ms-w32.h (fstat, stat, utime): Move redirections to
7819 "emacs"-only part.
7820
a06776b2
EZ
7821 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
7822 initialization code to keep similarity to xfns.c after changes
7823 from 2011-11-05.
7824
c9e7db78
JD
78252011-11-05 Jan Djärv <jan.h.d@swipnet.se>
7826
a97f8f3f
JD
7827 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7828 (unwind_create_frame): New function (Bug#9943).
7829 (Fx_create_frame): Restructure code to be more similar to the one in
7830 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
7831 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7832 Move terminal->reference_count++ just before making the frame official
7833 (Bug#9943).
7834
7835 * nsterm.m (x_free_frame_resources): New function.
7836 (x_destroy_window): Move code to x_free_frame_resources.
7837
c9e7db78 7838 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
7839 (Fx_create_frame, x_create_tip_frame):
7840 Move terminal->reference_count++ just before making the frame
75f1671a 7841 official. Move initialization of image_cache_refcount and
c9e7db78
JD
7842 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7843
a6fc3b5c
EZ
78442011-11-05 Eli Zaretskii <eliz@gnu.org>
7845
7846 Support MSVC build with newer versions of Visual Studio.
7847 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7848 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
7849 nt/gmake.defs.
7850
7851 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7852 which are not supported by MSVC.
7853 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7854 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7855 bitfields.
7856 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7857 types in bitfields.
7858 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7859
7860 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7861
58179cce 78622011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
7863
7864 Support MSVC build with newer versions of Visual Studio.
7865 * w32.c: Don't include w32api.h for MSVC.
7866 (init_environment) [_MSC_VER]: Call sys_access, not _access.
7867
7868 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7869 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
7870 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
7871 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
7872 e_* cousins.
7873 (alloca) [_MSC_VER]: Define to _alloca.
7874
7875 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
7876
7877 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
7878
a58c13ed
EZ
78792011-11-04 Eli Zaretskii <eliz@gnu.org>
7880
7881 * xdisp.c (note_mouse_highlight): If either of
7882 previous/next-single-property-change returns nil, treat that as
7883 the beginning or the end of the buffer. (Bug#9955)
7884
fe0b6370
JD
78852011-11-04 Jan Djärv <jan.h.d@swipnet.se>
7886
a58c13ed 7887 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
7888 label is not null (Bug#9951).
7889 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
7890 may be NULL.
7891
89bd5ee1
EZ
78922011-11-04 Eli Zaretskii <eliz@gnu.org>
7893
7894 * window.c (Fwindow_body_size): Mention in the doc string that the
7895 return value is in frame's canonical units. (Bug#9949)
7896
84c3edb9
EZ
78972011-11-03 Eli Zaretskii <eliz@gnu.org>
7898
4e2fb5c7
EZ
7899 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
7900
84c3edb9 7901 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 7902 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 7903 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 7904
bc17a887
EZ
79052011-11-01 Eli Zaretskii <eliz@gnu.org>
7906
7907 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
7908 Don't stop backward scan on the continuation glyph, even though
7909 its CHARPOS is positive.
6d5eb5b0
SM
7910 (mouse_face_from_buffer_pos, note_mouse_highlight):
7911 Rename cover_string to disp_string.
bc17a887 7912
4ee88440
MR
79132011-11-01 Martin Rudalics <rudalics@gmx.at>
7914
7915 * window.c (temp_output_buffer_show): Don't use
7916 Vtemp_buffer_show_specifiers.
7917 (Vtemp_buffer_show_specifiers): Remove unused variable.
7918
c2ff3c02
EZ
79192011-10-30 Eli Zaretskii <eliz@gnu.org>
7920
7921 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
7922 past the beginning of the current glyph matrix.
7923
58179cce 79242011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
7925
7926 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
7927 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
7928 HAVE_GTK3 (Bug#9869).
b77a6a7f 7929
3b574623
JD
7930 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
7931 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
7932
b77a6a7f
JD
7933 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
7934
7935 * xterm.c: Declare x_handle_net_wm_state to return int.
7936 (handle_one_xevent): Check if we are iconified but don't have
7937 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
7938 (get_current_wm_state): Return non-zero if not hidden,
7939 check for _NET_WM_STATE_HIDDEN (Bug#9893).
7940 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
7941 (x_handle_net_wm_state): Return what get_current_wm_state returns.
7942 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
7943
196e41e4
PE
79442011-10-29 Paul Eggert <eggert@cs.ucla.edu>
7945
7946 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
7947 so that this new function doesn't get optimized away by a
7948 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
7949
021f2e1a
AS
79502011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7951
7952 * frame.h (MOUSE_HL_INFO): Remove excess parens.
7953
8b058d44
EZ
79542011-10-29 Eli Zaretskii <eliz@gnu.org>
7955
7956 Fix the `xbytecode' command.
7957 * .gdbinit (xprintbytestr): New command.
b50a28de 7958 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
7959 (xbytecode): Print the byte-code string as well.
7960
4452fb80
EZ
79612011-10-29 Kim Storm <storm@cua.dk>
7962
8b058d44
EZ
7963 * alloc.c (which_symbols): New function.
7964
21b72067
AS
79652011-10-29 Andreas Schwab <schwab@linux-m68k.org>
7966
7967 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
7968 line. (Bug#9903)
7969
83ed7b5c
GM
79702011-10-29 Glenn Morris <rgm@gnu.org>
7971
7972 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
7973 Not clear what it was for, and it causes various bugs. (Bug#9839)
7974
5a7a728b
EZ
79752011-10-28 Eli Zaretskii <eliz@gnu.org>
7976
7977 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
7978 possible random value that matches one of those tested as
7979 condition to clear the mouse face.
7980
d3d0842f
CY
79812011-10-28 Chong Yidong <cyd@gnu.org>
7982
7983 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
7984
31b39d13
DN
79852011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
7986
7987 * window.c (make_window): Initialize phys_cursor_on_p.
7988
9aba6043
SM
79892011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
7990
7991 * lisp.h (struct Lisp_Symbol): Update comments.
7992
c20992f4
JB
79932011-10-28 Juanma Barranquero <lekktu@gmail.com>
7994
7995 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
7996
db4f02f2
EZ
79972011-10-28 Eli Zaretskii <eliz@gnu.org>
7998
7999 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8000 <oslsachem@gmail.com> for helping to debug this.
8001
8002 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8003 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8004 (g_b_init_get_glyph_outline_w): New static variables.
8005 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8006 (GetGlyphOutlineW_Proc): New typedefs.
8007 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
8008 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8009 New functions.
8010 (w32font_open_internal, compute_metrics):
8011 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
8012 instead of calling the "wide" APIs directly.
8013
8014 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8015
8016 * w32.h (syms_of_w32font): Add prototype.
8017
87e68db4
JB
80182011-10-27 Juanma Barranquero <lekktu@gmail.com>
8019
8020 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8021 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8022 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8023 (Fmove_to_window_line): Doc fix.
8024
435c1d67
CY
80252011-10-27 Chong Yidong <cyd@gnu.org>
8026
8027 * process.c (make_process): Set gnutls_state to NULL.
8028
8029 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8030 non-NULL, regardless of GNUTLS_INITSTAGE.
8031 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8032 an error. Set process slots as soon as we allocate them.
8033
8034 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8035
9c6c6f49
CY
80362011-10-27 Chong Yidong <cyd@gnu.org>
8037
9aba6043
SM
8038 * gnutls.c (emacs_gnutls_deinit): New function.
8039 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
8040 (Fgnutls_deinit, Fgnutls_boot): Use it.
8041
8042 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8043 (deactivate_process): Call emacs_gnutls_deinit.
8044
657d08d3
JB
80452011-10-27 Juanma Barranquero <lekktu@gmail.com>
8046
8047 * image.c (x_create_x_image_and_pixmap):
8048 * w32.c (sys_rename, w32_delayed_load):
8049 * w32font.c (fill_in_logfont):
8050 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8051
5430d399
JB
80522011-10-26 Juanma Barranquero <lekktu@gmail.com>
8053
8054 * w32fns.c (w32_default_color_map): New function,
8055 extracted from Fw32_default_color_map.
a7ef684b 8056 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 8057
fe0055fa
PE
80582011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8059
8060 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8061
e6346438
SM
80622011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8063
8064 * keyboard.c (test_undefined): New function (bug#9751).
8065 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8066
e112cc37
ET
80672011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8068
8069 * sysdep.c (init_sys_modes): Fix the check for the controlling
8070 terminal (Bug#6649).
8071
7b5d6677
EZ
80722011-10-20 Eli Zaretskii <eliz@gnu.org>
8073
8074 * dispextern.h (struct bidi_it): New member next_en_type.
8075
8076 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8077 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8078 current character, check also for next_en_type being WEAK_EN.
8079 (bidi_resolve_weak): Don't enter the expensive loop if the current
8080 position is before next_en_pos. Record the bidi type of the first
8081 non-ET, non-BN character we find, in addition to its position.
8082 (bidi_level_of_next_char): Invalidate next_en_type when
8083 next_en_pos is over-stepped.
8084
7da0b018
PE
80852011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8086
8087 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8088 * editfns.c: Rewrite current-time-zone so that it invokes
8089 the equivalent of (format-time-string "%Z") to get the time zone name.
8090 This fixes a bug when the time zone name contains characters that
8091 need converting from the system time locale to Emacs internal format.
8092 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8093 that patch fixed format-time-string to do the conversion, but
8094 I forgot to fix current-time-zone.
8095 (format_time_string): New function, containing most of
8096 what Fformat_time_string used to contain.
8097 (Fformat_time_string): Rewrite in terms of format_time_string.
8098 This doesn't change this function's behavior.
8099 (current-time-zone): Rewrite to use format_time_string.
8100 This fixes the bug reported by Michael Schierl in
8101 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8102 Jason Rumney's 2007-06-07 change worked around this bug, but
8103 didn't fix it.
8104 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8105
8547b010
EZ
81062011-10-19 Eli Zaretskii <eliz@gnu.org>
8107
8108 * xdisp.c (start_display): If the character at POS is displayed
8109 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
8110 (try_window_reusing_current_matrix): If a line ends in a display
8111 vector or the next line starts in a display vector, continue
8112 redrawing the window even though the character position of
8113 start_row was reached.
8547b010
EZ
8114 (Bug#9771, part 2)
8115
4e948d15
CY
81162011-10-18 Chong Yidong <cyd@gnu.org>
8117
8118 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8119 with nobreak-char-display too.
8120
4787455f
EZ
81212011-10-18 Eli Zaretskii <eliz@gnu.org>
8122
8123 Fix part 3 of bug#9771.
8124 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8125 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8126 non-neutral characters if the current character is a paragraph
8127 separator (a.k.a. Newline). This avoids running the same
8128 expensive loop twice, once when we consume the preceding newline
8129 and the other time when the line actually needs to be displayed.
8130 Avoid the loop when we see neutrals on the base embedding level
8131 following a character whose directionality is the same as the
8132 paragraph's. This avoids running the expensive loop when a line
8133 ends in a long sequence of neutrals, like control characters.
8134 Add assertion against STRONG_AL type. Slightly rearrange code
8135 that determines the type of a neutral given the first non-neutral
8136 that follows it.
8137 (bidi_level_of_next_char): Set next_en_pos to zero when
8138 invalidating its info.
8139
2c91f553
EZ
81402011-10-17 Eli Zaretskii <eliz@gnu.org>
8141
8142 * xdisp.c (push_display_prop): Determine whether to record string
8143 or buffer position by IT->string, not by IT->method. Allow
8144 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
8145 (move_it_vertically_backward): Don't look for character position
8146 immediately after the newline when in a continuation line.
8147 (Bug#9771, part 1)
2c91f553 8148
c7b08b0d
MR
81492011-10-15 Martin Rudalics <rudalics@gmx.at>
8150
8151 * window.c (coordinates_in_window): Rewrite and delabelize
8152 vertical border check. (Bug#5357) (Bug#9618)
8153
6b02f655
SM
81542011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8155
8156 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8157 errors in XSetWindowBorder (bug#9310).
8158
81d40c92
DA
81592011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8160
8161 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8162 avoid crash when xmalloc overrun checking is enabled.
8163
d4172c3b
EZ
81642011-10-13 Eli Zaretskii <eliz@gnu.org>
8165
8166 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8167 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8168 cursor motion with <left> and <right> arrow keys.
8169
8170 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8171 some callers set that themselves.
8172
b00eea75
EZ
81732011-10-12 Eli Zaretskii <eliz@gnu.org>
8174
8175 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8176 display string and the previous row comes from the same string and
8177 is empty. (Bug#9739) (Bug#9738)
8178
8fe012c4
SM
81792011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8180
8181 * doc.c (get_doc_string): Encode file name (bug#9735).
8182
0074aef2
EZ
81832011-10-12 Eli Zaretskii <eliz@gnu.org>
8184
79beb178
EZ
8185 * bidi.c (bidi_level_of_next_char):
8186 * xdisp.c (get_visually_first_element): Remove old incorrect
8187 comments regarding the Unicode Line Separator character.
8188
0074aef2
EZ
8189 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8190
6e4b3fbe
DA
81912011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8192
8193 * alloc.c (Fgc_status): Do not access beyond zombies array
8194 boundary if nzombies > MAX_ZOMBIES.
8195 * alloc.c (dump_zombies): Add missing format specifier.
8196
0324f3af
PE
81972011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8198
b5525cac
PE
8199 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8200 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8201
0324f3af
PE
8202 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8203 Some packages use them to denote characters with modifiers.
8204
e9b5f888
AS
82052011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8206
8207 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8208 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8209 matching a pp-number. Rename parameter var to var1.
8210
127827c0
SM
82112011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8212
8213 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8214
c8fd3bd0
GM
82152011-10-08 Glenn Morris <rgm@gnu.org>
8216
8217 * callint.c (Fcall_interactively): Give a more explicit error for the
8218 'c' case with a non-character input. (Bug#8479)
8219
352ec8ff
EZ
82202011-10-08 Eli Zaretskii <eliz@gnu.org>
8221
03669ccb
EZ
8222 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8223 lines.
7061c986
EZ
8224 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8225 lines that are hscrolled on the left.
03669ccb 8226
352ec8ff
EZ
8227 * dispnew.c (buffer_posn_from_coords): Account for a possible
8228 presence of header-line. (Bug#4426)
8229
a66cfb1c
SM
82302011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8231
6b02f655
SM
8232 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8233 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 8234
7c5ee88e
PE
82352011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8236
8237 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8238 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8239 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8240 this makes Emacs dump core during garbage collection on rare
8241 occasions. sizeof is obviously inferior to offsetof here, so
8242 stick with offsetof.
8243 (GC_POINTER_ALIGNMENT): New macro.
8244 (mark_memory): Omit 3rd (offset) arg; caller changed.
8245 Don't assume EMACS_INT alignment is the same as pointer alignment.
8246
df1bbe5b
SM
82472011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8248
8249 * keyboard.c (read_key_sequence_remapped): New var.
8250 (read_key_sequence): Compute remapping in the right buffer.
8251 (command_loop_1): Use read_key_sequence's remapping directly.
8252
51553db6
SM
82532011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8254
32c1fffd
SM
8255 * dired.c (file_name_completion): Don't expand file name.
8256 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8257 before checking file name handler.
8258
51553db6
SM
8259 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8260 they've been requested explicitly (bug#9591).
8261
b6bd1599 82622011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
8263
8264 * keymap.c (Fsingle_key_description): Use make_specified_string
8265 instead of build_string to build string from push_key_description.
8266 (Bug#5193)
8267
f701dc2a
PE
82682011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8269
4222c55d
PE
8270 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8271 This fixes a Y2038 bug on 64-bit hosts.
8272 * buffer.c (reset_buffer):
8273 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8274 (Fclear_buffer_auto_save_failure):
8275 Use 0, not -1, to represent an unset failure time, since time_t
8276 might not be signed.
8277
f701dc2a
PE
8278 Remove dependency on glibc malloc internals.
8279 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8280 Move back here from lisp.h, but with their new implementations.
8281 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8282 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8283 * charset.c (charset_table_init): New static var.
8284 (syms_of_charset): Use it instead of xmalloc. This removes a
8285 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8286 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8287 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8288 Move back to alloc.c.
8289 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8290 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8291
9ceebf39
JD
82922011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8293
8294 * nsterm.m (windowDidResize): Call x_set_window_size only when
8295 ns_in_resize is true. Otherwise set pixelwidth/height and
8296 call change_frame_size (Bug#9628).
8297
cb993c58
PE
82982011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8299
3930c88b
PE
8300 Port --enable-checking=all to Fedora 14 x86-64.
8301 * charset.c (syms_of_charset): Also account for glibc malloc's
8302 internal overhead when calculating the initial malloc maximum.
8303
cb993c58
PE
8304 Port --enable-checking=all to Fedora 14 x86.
8305 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8306 Move to lisp.h.
8307 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8308 (overrun_check_realloc, overrun_check_free):
8309 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8310 That way, xmalloc returns a properly-aligned pointer even if
8311 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8312 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8313 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8314 into account when calculating the initial malloc maximum.
8315 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8316 Move here from alloc.c, so that charset.c can use it too.
8317 Properly align; the old code wasn't right for common 32-bit hosts
8318 when configured with --enable-checking=all.
8319 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8320 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8321
31bed486
EZ
83222011-09-29 Eli Zaretskii <eliz@gnu.org>
8323
04c70788 8324 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
8325 use EDOM.
8326
fbcaa2f3
EZ
83272011-09-28 Eli Zaretskii <eliz@gnu.org>
8328
8329 * xdisp.c (compute_display_string_end): If there's no display
8330 string at CHARPOS, return -1.
8331
8332 * bidi.c (bidi_fetch_char): When compute_display_string_end
8333 returns a negative value, treat the character as a normal
8334 character not covered by a display string. (Bug#9624)
8335
a239d4e9
JB
83362011-09-28 Juanma Barranquero <lekktu@gmail.com>
8337
8338 * lread.c (Fread_from_string): Fix typo in docstring.
8339
88652fd5
EZ
83402011-09-27 Eli Zaretskii <eliz@gnu.org>
8341
8342 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8343 newline, reseat the iterator instead of bidi-iterating there one
8344 character at a time. (Bug#9610)
32c1fffd
SM
8345 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8346 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 8347
ed497dd4
AS
83482011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8349
8350 * lread.c (readevalloop): Use correct code for NBSP.
8351 (read1): Likewise. (Bug#9608)
8352
b2bf61aa
MA
83532011-09-25 Michael Albinus <michael.albinus@gmx.de>
8354
8355 * dbusbind.c (Fdbus_register_signal): When service is not
8356 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8357
32bbb17c
GM
83582011-09-25 Glenn Morris <rgm@gnu.org>
8359
8360 * buffer.c (truncate-lines): Doc fix.
8361
94e0933e
CY
83622011-09-24 Chong Yidong <cyd@stupidchicken.com>
8363
8364 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8365 (Fset_window_next_buffers): Doc fix.
8366
cddde921
GM
83672011-09-24 Glenn Morris <rgm@gnu.org>
8368
8369 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8370
1260aef1
PE
83712011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8372
25b4bfa0
PE
8373 Fix minor problems found by static checking.
8374 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
8375 * indent.c (Fvertical_motion): Fix == vs = typo.
8376
e3cbd34b
EZ
83772011-09-24 Eli Zaretskii <eliz@gnu.org>
8378
a66cfb1c
SM
8379 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8380 Default value is now t. Doc fix.
6bf7006f 8381
e3cbd34b 8382 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 8383 logic when moving up, not only when moving down. Fix the
e3cbd34b 8384 confusing name and values of the it_overshoot_expected variable;
32c1fffd 8385 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
8386
8387 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8388 CHARPOS is covered by a display string which includes newlines.
8389 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8390 is covered by a display string with embedded newlines.
8391
a3de0cbd
MA
83922011-09-24 Michael Albinus <michael.albinus@gmx.de>
8393
8394 * dbusbind.c (Fdbus_register_signal): Add match rule to
8395 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
8396 (Fdbus_register_method, Vdbus_registered_objects_table):
8397 Fix docstring.
a3de0cbd 8398
b260039d
JM
83992011-09-24 Jim Meyering <meyering@redhat.com>
8400
32c1fffd 8401 do not ignore write error for any output size
b260039d
JM
8402 The previous change was incomplete.
8403 While it makes emacs --batch detect the vast majority of stdout
8404 write failures, errors were still ignored whenever the output size is
8405 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8406 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8407 && echo FAIL: ignored write error
8408 FAIL: ignored write error
8409 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8410 && echo FAIL: ignored write error
8411 FAIL: ignored write error
8412 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8413
8eca8a7c
AS
84142011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8415
8416 * emacs.c (Fkill_emacs): In noninteractive mode exit
8417 non-successfully if a write error occurred on stdout. (Bug#9574)
8418
3341db62
EZ
84192011-09-21 Eli Zaretskii <eliz@gnu.org>
8420
8421 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8422 the xassert test.
8423
8424 * dispextern.h (struct it): Update the comment documenting what
8425 can it->OBJECT be.
8426
8c203dbf
EZ
84272011-09-20 Eli Zaretskii <eliz@gnu.org>
8428
8429 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8430 a display string, extend search for cursor position to end of row.
8431 (find_row_edges): If the row ends in a newline from a display
8432 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8433 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
8434 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8435 non-empty line. Fixes confusing cursor motion with arrow keys at
8436 the beginning of a line that starts with whitespace.
8c203dbf 8437
a4824228
LMI
84382011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8439
8440 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8441 (bug#9493).
8442
33ed493b
CY
84432011-09-18 Chong Yidong <cyd@stupidchicken.com>
8444
8445 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8446 boolean (Bug#9154).
8447
56cd55c8
EZ
84482011-09-18 Eli Zaretskii <eliz@gnu.org>
8449
8450 * xdisp.c (display_line): Record maximum and minimum buffer
8451 positions even if no glyphs were produced (e.g., by a zero-width
8452 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8453 buffer positions that will be removed from the glyph row because
8454 they don't fit.
c02dcedf
EZ
8455 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8456 column is beyond frame width: don't subtract 1 "pixel" when
8457 computing width of the stretch.
3e62b7e0
EZ
8458 (reseat_at_next_visible_line_start): Undo the change made on
8459 2011-09-17 that saved paragraph information and restored it after
8460 the call to `reseat'. (Bug#9545)
56cd55c8 8461
5ed99d36 84622011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
8463
8464 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8465 and turn window cursor on if cleared (Bug#9415).
8466
5ed99d36 84672011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
8468
8469 * search.c (boyer_moore): Take unibyte characters from pattern
8470 literally. (Bug#9458)
8471
9bade7b2
EZ
84722011-09-18 Eli Zaretskii <eliz@gnu.org>
8473
8474 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8475
e5e9d610
PE
84762011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8477
87e4427a
PE
8478 Fix minor problem found by static checking.
8479 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8480 initialized, to pacify gcc -Wuninitialized.
8481
e5e9d610
PE
8482 * fileio.c: Report proper errno when syscall falls.
8483 (Finsert_file_contents): Save and restore errno,
8484 so that report_file_error outputs the correct diagnostic.
8485 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8486
a1674f0b
EZ
84872011-09-18 Eli Zaretskii <eliz@gnu.org>
8488
8489 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8490
fbfb6dd4
EZ
84912011-09-17 Eli Zaretskii <eliz@gnu.org>
8492
8493 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8494 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8495
bb187662
EZ
84962011-09-17 Eli Zaretskii <eliz@gnu.org>
8497
1137e8b8 8498 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 8499 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
8500
8501 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8502 (bidi_find_paragraph_start): Search back for paragraph beginning
8503 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8504 (bidi_move_to_visually_next): Only trigger paragraph-related
8505 computations when the last character is a newline or at EOB, not
8506 just any NEUTRAL_B. (Bug#9470)
8507
bb187662
EZ
8508 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8509 truncated lines if point is covered by a display string. (Bug#9524)
8510
2e621251
PE
85112011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8512
8513 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8514 (cons_to_x_long): New function.
8515 (lisp_data_to_selection_data): Use it. Correct the test for
8516 short-versus-long data; it was negated. Break out of vector
8517 loop, for efficiency, when a long datum is discovered.
8518
91a15bc6
SM
85192011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8520
8521 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8522
b41c3a35
EZ
85232011-09-16 Eli Zaretskii <eliz@gnu.org>
8524
8525 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8526 GCC PR/17406) by declaring this function with external scope.
8527
7812ba2d
PE
85282011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8529
8530 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8531 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8532
cf7edc2a
AS
85332011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8534
8535 * editfns.c (Fformat): Correctly handle text properties on "%%".
8536
bd01620e
EZ
85372011-09-15 Eli Zaretskii <eliz@gnu.org>
8538
8539 * xterm.c (x_draw_composite_glyph_string_foreground):
8540 * w32term.c (x_draw_composite_glyph_string_foreground):
8541 * term.c (encode_terminal_code):
8542 * composite.c (composition_update_it, get_composition_id):
8543 * xdisp.c (get_next_display_element)
8544 (fill_composite_glyph_string): Add comments about special meaning
8545 of TAB characters in a composition.
8546
a02719a3
PE
85472011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8548
8549 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
8550 This occurs when processing a multibyte format.
8551 Problem reported by Wolfgang Jenker.
a02719a3 8552
72589a3c
JB
85532011-09-15 Johan Bockgård <bojohan@gnu.org>
8554
8555 * xdisp.c (try_cursor_movement): Only check for exact match if
8556 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8557
1c14176c
PE
85582011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8559
8560 Remove unused external symbols.
8561 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8562 * xdisp.c (calc_pixel_width_or_height): Now static.
8563 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8564 * indent.c (check_display_width):
8565 * w32term.c: Fix comment to match code.
8566 * xterm.c, xterm.h (x_catching_errors): Remove.
8567
d2eea5b5
PE
85682011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8569
8570 * xselect.c: Use signed conversions more consistently (Bug#9498).
8571 (selection_data_to_lisp_data): Assume incoming selection data are
8572 signed integers, not unsigned. This is to be consistent with
8573 outgoing selection data, which was modified to use signed integers
8574 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8575 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8576 expects long, not unsigned long.
8577
46888499
EZ
85782011-09-14 Eli Zaretskii <eliz@gnu.org>
8579
8580 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8581 computation of loop end. Reported by Johan Bockgård
8582 <bojohan@gnu.org>.
8583
ef8ef9fb
CY
85842011-09-13 Chong Yidong <cyd@stupidchicken.com>
8585
8586 * frame.c (Fother_visible_frames_p): Function deleted.
8587
fa819fed
EZ
85882011-09-12 Eli Zaretskii <eliz@gnu.org>
8589
8590 * indent.c (compute_motion): Process display vector front to back
8591 rather than the other way around. (Bug#2496)
8592
2ba8e008
SM
85932011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8594
8595 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8596
20f53c69
CY
85972011-09-11 Chong Yidong <cyd@stupidchicken.com>
8598
8599 * minibuf.c (Fread_from_minibuffer): Doc fix.
8600
d562d7a4
EZ
86012011-09-11 Eli Zaretskii <eliz@gnu.org>
8602
8603 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8604 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8605
1c4d7f3d
LMI
86062011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8607
8608 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8609 value for non-existent files.
8610
b885bf36
EZ
86112011-09-11 Eli Zaretskii <eliz@gnu.org>
8612
8613 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8614 set its "size" to -1. This will set the modtime_size field of
8615 the corresponding buffer to -1, which is what
8616 verify-visited-file-modtime expects for files that do not exist.
8617 (Bug#9139)
8618
6612f0bf
PE
86192011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8620
8621 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8622 here ...
8623 * lisp.h: ... from here. push_key_description is no longer
8624 defined in keyboard.c, so its declaration should not be in
8625 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8626 logically belongs with push_key_description.
8627
dfb3f755
PE
86282011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8629
8630 * buffer.h: Include <sys/types.h> instead of <time.h>.
8631 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8632 Problem reported by Herbert J. Skuhra.
8633
3134906c
LMI
86342011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8635
8636 * xml.c (parse_region): Make the parsing work for
8637 non-comment-starting XML files again (bug#9144).
8638
8d903f4e
AS
86392011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8640
8641 * image.c (gif_load): Fix calculation of bottom and right corner.
8642 (Bug#9468)
8643
80ad64f4
EZ
86442011-09-10 Eli Zaretskii <eliz@gnu.org>
8645
8646 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8647 redisplay in small windows.
8648
208a048d
EZ
86492011-09-09 Eli Zaretskii <eliz@gnu.org>
8650
8651 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8652
9b1c252e
MR
86532011-09-08 Martin Rudalics <rudalics@gmx.at>
8654
8655 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8656 Operate on live windows only.
8657
2949f33b
JB
86582011-09-08 Juanma Barranquero <lekktu@gmail.com>
8659
8660 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8661
e08dcafd
EZ
86622011-09-07 Eli Zaretskii <eliz@gnu.org>
8663
8664 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8665 only under bidi iteration.
8666
115b96bd
JD
86672011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8668
8669 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8670
c8199d0f
PE
86712011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8672
8673 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8674 Without this fix, the command to link temacs failed due to an
8675 undefined symbol __builtin_isnan. This is because
8676 /usr/include/iso/math_c99.h #defines isnan(x) to
8677 __builtin_isnan(x), but the bundled gcc, which identifies itself
8678 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8679 a __builtin_isnan.
8680 * floatfns.c (isnan): #undef, and then #define to a clone of
8681 what's in data.c.
8682 (Fisnan): Always define, since it's always available now.
8683 (syms_of_floatfns): Always define isnan at the Lisp level.
8684
e39b275c 86852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
8686
8687 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8688
b2db44d9 86892011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 8690
f4af5137 8691 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
8692 The previous code assumed that file offsets (off_t values) fit in
8693 EMACS_INT variables, which is not true on typical 32-bit hosts.
8694 The code messed up by falsely reporting buffer overflow in cases
8695 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8696 when "big" contains more than 2**29 bytes, even though this
8697 inserts just one byte and does not overflow the buffer.
8698 (Finsert_file_contents): Store file offsets as off_t
8699 values, not as EMACS_INT values. Check for overflow when
8700 converting between EMACS_INT and off_t. When checking for
8701 buffer overflow or for overlap, take the offsets into account.
8702 Don't use EMACS_INT for small values where int suffices.
8703 When checking for overlap, fix a typo: ZV was used where
8704 ZV_BYTE was intended.
8705 (Fwrite_region): Don't assume off_t fits into 'long'.
8706 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8707
ecfc0a49
MA
87082011-09-05 Michael Albinus <michael.albinus@gmx.de>
8709
8710 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8711
6511acf2 87122011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 8713
0999621a 8714 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
8715
8716 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 8717 (esprintf, exprintf, evxprintf): New functions.
62f19c19 8718 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 8719 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
8720 (modify_event_symbol): Do not assume that the length of
8721 name_alist_or_stem is safe to alloca and fits in int.
8722 (Fexecute_extended_command): Likewise for function name and binding.
8723 (Frecursion_depth): Wrap around reliably on integer overflow.
8724 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8725 since some callers pass EMACS_INT values.
8726 (Fsingle_key_description): Don't crash if symbol name contains more
8727 than MAX_ALLOCA bytes.
8728 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8729 (get_minibuffer): Arg is now EMACS_INT, not int.
8730 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 8731 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
8732 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8733
2be7d702
PE
8734 * dbusbind.c (signature_cat): New function.
8735 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
8736 Do not overrun buffer; instead, report string overflow.
8737
9d1df220
PE
8738 * dispnew.c (add_window_display_history): Don't overrun buffer.
8739 Truncate instead; this is OK since it's just a log.
8740
33ef5c64
PE
8741 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8742 even if the time zone offset is outlandishly large.
8743 Don't mishandle offset == INT_MIN.
8744
66c6fdd5
PE
8745 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8746 when creating daemon; the previous buffer-overflow check was incorrect.
8747
d749b01b
PE
8748 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8749 which has the guts of the old verror function.
8750
b5cd1905
PE
8751 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8752 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
8753
6e1a67fb
PE
8754 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8755 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 8756 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 8757 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
8758 length of string rather than counting it via multiple sprintfs;
8759 that's simpler and more reliable.
c21721cc
PE
8760 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8761 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8762 sprintf, in case result does not fit in int.
8763
c57b67fc
PE
8764 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8765 (fontset_from_font): Print it.
8766
8a401434
PE
8767 * frame.c (tty_frame_count): Now printmax_t, not int.
8768 (make_terminal_frame, set_term_frame_name): Print it.
8769 (x_report_frame_params): In X, window IDs are unsigned long,
8770 not signed long, so print them as unsigned.
8771 (validate_x_resource_name): Check for implausibly long names,
8772 and don't assume name length fits in 'int'.
8773 (x_get_resource_string): Don't blindly alloca invocation name;
8774 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
8775 not fit in int.
8776
6e1a67fb
PE
8777 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8778 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
8779 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8780
0df02bf3
PE
8781 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8782 Use esprintf, not sprintf, in case result does not fit in int.
8783
48e30793
PE
8784 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8785 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8786 it as a large positive number.
8787 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8788 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8789
a66ff6d8
PE
8790 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8791 in case result does not fit in int.
8792
aca216ff
PE
8793 * print.c (float_to_string): Detect width overflow more reliably.
8794 (print_object): Make sprintf buffer a bit bigger, to avoid potential
8795 buffer overrun. Don't assume list length fits in 'int'. Treat
8796 print length of 0 as 0, not as infinity; to be consistent with other
8797 uses of print length in this function. Don't overflow print length
8798 index. Don't assume hash table size fits in 'long', or that
8799 vectorlike size fits in 'unsigned long'.
8800
31c286f7
PE
8801 * process.c (make_process): Use printmax_t, not int, to format
8802 process-name gensyms.
8803
55e5faa1
PE
8804 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
8805
80f2e268
PE
8806 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
8807 to avoid potential buffer overrun.
8808
670741ab
PE
8809 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
8810 if X resource line is longer than 512 bytes.
8811
b7163a50
PE
8812 * xfns.c (x_window): Make sprintf buffer a bit bigger
8813 to avoid potential buffer overrun.
8814
ae58ff1f
PE
8815 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
8816
c43c8a6a
PE
8817 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
8818
3f8236f4
PE
88192011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8820
53e9fe90 8821 Integer overflow fixes for scrolling, etc.
6511acf2
PE
8822 Without these, Emacs silently mishandles large integers sometimes.
8823 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
8824 it were "C-u 1 M-x recenter" on a typical 64-bit host.
8825
6511acf2
PE
8826 * xdisp.c (try_window_id): Check Emacs fixnum range before
8827 converting to 'int'.
806add1d 8828
6511acf2 8829 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
8830 Check that an Emacs fixnum is in range before assigning it to 'int'.
8831 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8832 values converted from Emacs fixnums.
8833 (Frecenter): Don't wrap around a line count if it is out of 'int'
8834 range; instead, treat it as an extreme value.
8835 (Fset_window_configuration, compare_window_configurations):
8836 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8837
6511acf2
PE
8838 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8839 that can exceed INT_MAX. Check that EMACS_INT value is in range
8840 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
8841 (match_limit): Don't assume that a fixnum can fit in 'int'.
8842
6511acf2 8843 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
8844 exceed INT_MAX.
8845
6511acf2 8846 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
8847 (Fvertical_motion): Don't wrap around LINES values that don't fit
8848 in 'int'. Instead, treat them as extreme values. This is good
8849 enough for windows, which can't have more than INT_MAX lines anyway.
8850
fcb901a7
LMI
88512011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8852
0f2f6b6d
LMI
8853 * Require libxml/parser.h to avoid compilation warning.
8854
fcb901a7
LMI
8855 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8856
8857 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8858 since this reportedly can destroy thread storage.
8859
6e20a0d4
CY
88602011-08-30 Chong Yidong <cyd@stupidchicken.com>
8861
8862 * syntax.c (find_defun_start): Update all cache variables if
8863 exiting early (Bug#9401).
8864
148ae00e
EZ
88652011-08-30 Eli Zaretskii <eliz@gnu.org>
8866
f6cfbd8f
EZ
8867 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8868
148ae00e
EZ
8869 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
8870 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
8871 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
8872
8873 * term.c (tty_append_glyph): New function.
8874 (produce_stretch_glyph): Static function and its prototype deleted.
8875
a66cfb1c
SM
8876 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
8877 Add prototypes.
148ae00e 8878
c4a07a4c
PE
88792011-08-29 Paul Eggert <eggert@cs.ucla.edu>
8880
8881 * image.c (parse_image_spec): Check for nonnegative, not for positive,
8882 when checking :margin (Bug#9390).
8883 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 8884 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
8885 so that the name doesn't mislead. All uses changed.
8886
6bc8cd65
JB
88872011-08-28 Johan Bockgård <bojohan@gnu.org>
8888
8889 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
8890 set_tty_hooks.
8891
dca4927e
EZ
88922011-08-27 Eli Zaretskii <eliz@gnu.org>
8893
8894 * xdisp.c (move_it_to): Don't bail out early when reaching
8895 position beyond to_charpos, if we are scanning backwards.
8896 (move_it_vertically_backward): When DY == 0, make sure we get to
8897 the first character in the line after the newline.
8898
f2cad773
PE
88992011-08-27 Paul Eggert <eggert@cs.ucla.edu>
8900
8901 * ccl.c: Improve and simplify overflow checking (Bug#9196).
8902 (ccl_driver): Do not generate an out-of-range pointer.
8903 (Fccl_execute_on_string): Remove unnecessary check for
8904 integer overflow, noted by Stefan Monnier in
8905 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
8906 Remove a FIXME that didn't need fixing.
8907 Simplify the newly-introduced buffer reallocation code.
8908
0cae2cdb
JB
89092011-08-27 Juanma Barranquero <lekktu@gmail.com>
8910
8911 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
8912
5fc295a4 89132011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 8914
70c60eb2 8915 Integer and memory overflow issues (Bug#9196).
726e0ab1 8916
d31850da
PE
8917 * doc.c (get_doc_string): Rework so that
8918 get_doc_string_buffer_size is the actual buffer size, rather than
8919 being 1 less than the actual buffer size; this makes xpalloc more
8920 convenient.
8921
a69fbedb
PE
8922 * image.c (x_allocate_bitmap_record, cache_image):
8923 * xselect.c (Fx_register_dnd_atom):
8924 Simplify previous changes by using xpalloc.
8925
fe5c5d37
PE
8926 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
8927 since either will do and ptrdiff_t is convenient with xpalloc.
8928
0065d054
PE
8929 * charset.c (charset_table_size)
8930 (struct charset_sort_data.priority): Now ptrdiff_t.
8931 (charset_compare): Don't overflow if priorities differ greatly.
8932 (Fsort_charsets): Don't assume list length fits in int.
8933 Check for size-calculation overflow when allocating sort data.
8934 (syms_of_charset): Allocate an initial charset table that is
8935 just under 64 KiB, to avoid problems with glibc malloc and mmap.
8936
8937 * cmds.c (internal_self_insert): Check for size-calculation overflow.
8938
8939 * composite.h (struct composition.glyph_len): Now int, not unsigned.
8940 The actual value is always <= INT_MAX, and leaving it unsigned made
8941 overflow checking harder.
8942
8943 * dispextern.h (struct glyph_matrix.rows_allocated)
8944 (struct face_cache.size): Now ptrdiff_t, for convenience in use
8945 with xpalloc. The values are still always <= INT_MAX.
8946
8947 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
8948
8949 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
8950 (SAFE_NALLOCA): New macro.
8951
8952 * region-cache.c (struct boundary.pos, find_cache_boundary)
8953 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
8954 (set_cache_region, invalidate_region_cache)
8955 (revalidate_region_cache, know_region_cache, region_cache_forward)
8956 (region_cache_backward, pp_cache):
8957 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
8958 so that ptrdiff_t * can be passed to xpalloc.
8959 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
8960 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
8961 (pp_cache): Don't assume cache_len fits in int.
8962 * region-cache.h: Adjust extern decls to match.
8963
8964 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
8965 EMACS_INT, since either will do, for xpalloc.
8966
8967 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
8968 (xnmalloc, xnrealloc, xpalloc): New functions.
8969
726e0ab1
PE
8970 * bidi.c (bidi_shelve_header_size): New constant.
8971 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
8972 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
8973
51f30bc5 8974 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
8975 * buffer.c (overlays_at, overlays_in, record_overlay_string)
8976 (overlay_strings):
8977 Don't update size of array until after memory allocation succeeds,
8978 because xmalloc/xrealloc may not return.
0065d054
PE
8979 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
8980 now that we have proper integer overflow checking.
8981 (record_overlay_string, overlay_strings): Catch overflows when
8982 calculating size of overlay_str_buf.
726e0ab1 8983
0065d054
PE
8984 * callproc.c (Fcall_process): Check for size overflow when
8985 calculating size of args2.
8986 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
8987 Normally we prefer signed values, but sticking with ptrdiff_t would
8988 require adding more-complicated checks.
726e0ab1
PE
8989
8990 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
8991 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
8992 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 8993 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
8994
8995 * character.c (Fstring): Check for size-calculation overflow.
8996
8997 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
8998 unnecessary integer overflow. Check for size overflow.
8999 (encode_coding_object): Don't update size until xmalloc succeeds.
9000
9001 * composite.c (get_composition_id): Check for overflow in glyph
9002 length calculations.
9003
9004 Integer and memory overflow fixes for display code.
9005 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9006 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9007 (scrolling_window): Check for overflow in size calculations.
9008 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9009 Don't assume glyph table len fits in int.
9010 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9011 (row_table_size): Now ptrdiff_t, not int.
9012 (scrolling_window): Avoid overflow in size calculations.
9013 Don't update size until allocation succeeds.
9014 * fns.c (concat): Check for overflow in size calculations.
9015 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9016 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9017 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9018
9019 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9020 (get_doc_string): Check for size calculation overflow.
9021 Don't update size until allocation succeeds.
9022 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9023 EMACS_INT, where ptrdiff_t will do.
9024 (Fsubstitute_command_keys): Check for string overflow.
9025
9026 * editfns.c (set_time_zone_rule): Don't assume environment length
9027 fits in int.
9028 (message_length): Now ptrdiff_t, not int.
9029 (Fmessage_box): Don't update size until allocation succeeds.
9030 Don't assume message length fits in int.
9031 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9032
0065d054
PE
9033 * emacs.c (main): Do not reallocate argv, since there is a null at
9034 the end that can be overwritten, and this way there's no need to
9035 worry about size-calculation overflow.
9036 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
9037
9038 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9039 alloc succeeds.
9040 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9041
9042 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9043 (x_set_scroll_bar_width, x_figure_window_size):
9044 Check for integer overflow.
9045 (x_set_alpha): Do not assume XINT fits in int.
9046
9047 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9048 This is for the members text_lines, text_cols, total_lines, total_cols,
9049 where the system imposes an 'int' limit.
9050
9051 * fringe.c (Fdefine_fringe_bitmap):
9052 Don't update size until alloc works.
9053
9054 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9055 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9056
9057 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9058 Check for size-calculation overflow.
9059 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9060 do, as we prefer signed integers.
9061 (id_to_widget.max_size, id_to_widget.used)
9062 (xg_store_widget_in_map, xg_remove_widget_from_map)
9063 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9064 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9065 Use and return ptrdiff_t, not int.
9066 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9067 * gtkutil.h: Change prototypes to match the above.
9068
9069 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9070 are duplicate now that they've been promoted to lisp.h.
9071 (x_allocate_bitmap_record, x_alloc_image_color)
9072 (make_image_cache, cache_image, xpm_load):
9073 Don't update size until alloc is done.
9074 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9075 (x_detect_edges):
3256efce 9076 Check for size calculation overflow.
726e0ab1
PE
9077 (ct_colors_allocated_max): New constant.
9078 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9079 overflow.
3256efce 9080
726e0ab1
PE
9081 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9082 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9083 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9084 Use ptrdiff_t, not int, to count maps.
9085 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
9086 calculations. Don't update size until allocation succeeds.
9087 Redo calculations to avoid overflow.
726e0ab1
PE
9088 * keyboard.h: Change prototypes to match the above.
9089
9090 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9091 to count maps.
9092 (current_minor_maps): Check for size calculation overflow.
9093 * keymap.h: Change prototypes to match the above.
9094
9095 * lread.c (read1, init_obarray): Don't update size until alloc done.
9096
9097 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9098 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9099
726e0ab1
PE
9100 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9101 Now ptrdiff_t, not int.
9102 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9103 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9104
9105 * process.c (Fnetwork_interface_list): Check for overflow
9106 in size calculation.
9107
9108 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9109
9110 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9111 overflow. Don't bother calling xmalloc when xrealloc will do.
9112
9113 * search.c (Freplace_match): Check for size calculation overflow.
9114 (Fset_match_data): Don't assume list lengths fit in 'int'.
9115
9116 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9117 for command line length. Do not attempt to address one before the
9118 beginning of an array, as that's not portable.
9119
9120 * term.c (max_frame_lines): Remove; unused.
9121 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9122 not int.
9123 (encode_terminal_code, calculate_costs): Check for size
9124 calculation overflow.
9125 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9126 table lengths and related sizes. Don't update size until alloc
9127 done. Redo calculations to avoid overflow.
9128 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9129
9130 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9131 subtracting pointers.
9132 (gobble_line): Check for overflow more carefully. Don't update size
9133 until alloc done.
9134
9135 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9136 Don't update size until alloc done.
9137 Redo size calculations to avoid overflow.
9138 Check for size calculation overflow.
0065d054 9139 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
9140
9141 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9142 Use ptrdiff_t, not int, for sizes.
9143 (store_mode_line_noprop_char): Don't update size until alloc done.
9144
0065d054
PE
9145 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9146 Use ptrdiff_t, not int, for sizes.
9147 (Finternal_make_lisp_face, cache_face):
9148 Check for size calculation overflow.
9149 (cache_face): Treat size calculation overflows as if they were
9150 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
9151
9152 * xfns.c (x_encode_text, x_set_name_internal)
9153 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9154 sizes, since they can exceed INT_MAX in size. Check for size
9155 calculation overflow.
9156
0065d054
PE
9157 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9158 (xg_select): Check for size calculation overflow.
726e0ab1
PE
9159 Don't update size until alloc done.
9160
0065d054 9161 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 9162 as sprintf is limited to int lengths.
1d526e2f 9163
252c5ee1
PE
9164 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9165 (X_LONG_MIN): New macros.
864d7ce7
PE
9166 Use them to make the following changes clearer.
9167 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9168 This change doesn't affect the value now, but it may help remind
9169 future maintainers not to raise the value too much later.
9170 (SELECTION_QUANTUM): Remove, replacing with ...
9171 (selection_quantum): ... new function, which avoids overflow.
9172 All uses changed.
9173 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9174 assumption that selection length fits in 'int'.
9175 (x_reply_selection_request, x_handle_selection_request)
9176 (x_get_window_property, receive_incremental_selection)
9177 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9178 (lisp_data_to_selection_data, clean_local_selection_data):
9179 Use ptrdiff_t, not int, to record length of selection.
9180 (x_reply_selection_request, x_get_window_property)
9181 (receive_incremental_selection, x_property_data_to_lisp):
9182 Redo calculations to avoid overflow.
9183 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 9184 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
9185 something.
9186 (x_get_window_property, receive_incremental_selection)
9187 (lisp_data_to_selection_data, x_property_data_to_lisp):
9188 Check for size-calculation overflow.
9189 (x_get_window_property, receive_incremental_selection)
9190 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9191 Don't store size until memory allocation succeeds.
9192 (x_get_window_property): Plug memory leak on memory exhaustion.
9193 Don't double-block input; malloc is safe here. Don't assume 2**34
9194 - 4 fits in unsigned long. Add an xassert to check
9195 XGetWindowProperty overflow. Be more careful about overflow
9196 calculations, and distinguish size from memory overflow better.
9197 (receive_incremental_selection): When tracing, don't assume
9198 unsigned int is less than INT_MAX.
9199 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9200 harmful) conversions of unsigned short to int.
9201 (lisp_data_to_selection_data): Don't assume that integers
9202 in the range -65535 through -1 fit in an X unsigned short.
9203 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9204 result parameters unless successful. Rely on cons_to_unsigned
9205 to report problems with elements; the old code wasn't right anyway.
9206 (x_check_property_data): Check for int overflow; we cannot use
9207 a wider type due to X limits.
9208 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9209
726e0ab1 9210 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 9211
0065d054
PE
9212 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9213 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
9214 (x_color_cells): Don't store size until memory allocation succeeds.
9215 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 9216 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
9217 (x_term_init): Don't assume length fits in int (sprintf is limited
9218 to int size).
bc18e09d 9219
ebfa62c0
PE
9220 Use ptrdiff_t for composition IDs.
9221 * character.c (lisp_string_width):
9222 * composite.c (composition_table_size, n_compositions)
9223 (get_composition_id, composition_gstring_from_id):
9224 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9225 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9226 * window.c (Frecenter):
9227 Use ptrdiff_t, not int, for composition IDs.
9228 * composite.c (get_composition_id): Check for integer overflow.
9229 * composite.h: Adjust prototypes to match the above changes.
9230
d3411f89
PE
9231 Use ptrdiff_t for hash table indexes.
9232 * category.c (hash_get_category_set):
9233 * ccl.c (ccl_driver):
9234 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9235 * coding.c (coding_system_charset_list, detect_coding_system):
9236 * coding.h (struct coding_system.id):
9237 * composite.c (get_composition_id, gstring_lookup_cache):
9238 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9239 * image.c (xpm_get_color_table_h):
9240 * lisp.h (hash_lookup, hash_put):
9241 * minibuf.c (Ftest_completion):
9242 Use ptrdiff_t for hash table indexes, not int (which is too
9243 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9244 32-bit --with-wide-int hosts).
9245
e097a6fa
PE
9246 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9247 Add a FIXME comment about memory leaks.
9248 (syms_of_charset): Don't assume xmalloc returns.
9249
5637687f
PE
9250 Don't assume that stated character widths fit in int.
9251 * character.c (Fchar_width, c_string_width, lisp_string_width):
9252 * character.h (CHAR_WIDTH):
9253 * indent.c (MULTIBYTE_BYTES_WIDTH):
9254 Use sanitize_char_width to avoid undefined and/or bad behavior
9255 with outlandish widths.
a66cfb1c 9256 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
9257 now that we have two such functions. All uses changed.
9258 (sanitize_char_width): New inline function.
9259
a2271ba2
PE
9260 Don't assume that tab-width fits in int.
9261 * character.h (sanitize_width): New inline function.
9262 (SANE_TAB_WIDTH): New macro.
9263 (ASCII_CHAR_WIDTH): Use it.
9264 * indent.c (sane_tab_width): Remove. All uses replaced by
9265 SANE_TAB_WIDTH (current_buffer).
9266 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9267
18c52557
PE
9268 * fileio.c: Integer overflow issues with file modes.
9269 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9270
caeeedc1
PE
9271 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9272 Remove unreachable code.
9273 (read_hex, load_charset_map_from_file): Check for integer overflow.
9274
6df6ae42 9275 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
9276 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9277 (x_send_scroll_bar_event): Likewise. Check that the size does not
9278 exceed limits imposed by XClientMessageEvent, as well as the usual
9279 ptrdiff_t and size_t limits.
9280
b13995db
PE
9281 * keyboard.c: Overflow, signedness and related fixes.
9282 (make_lispy_movement): Use same integer type in forward decl
9283 that is used in the definition.
9284 (read_key_sequence, keyremap_step):
9285 Change bufsize argument back to int, undoing my 2011-03-30 change.
9286 We prefer signed types, and int is wide enough here.
9287 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9288 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9289 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9290 length, not size_t. Use ptrdiff_t for index, not int.
9291 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9292 possibility of integer overflow.
9293
13464394
PE
9294 Overflow, signedness and related fixes for images.
9295
9296 * dispextern.h (struct it.stack[0].u.image.image_id)
9297 (struct_it.image_id, struct image.id, struct image_cache.size)
9298 (struct image_cache.used, struct image_cache.ref_count):
9299 * gtkutil.c (update_frame_tool_bar):
9300 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9301 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9302 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9303 * nsmenu.m (update_frame_tool_bar):
9304 * xdisp.c (calc_pixel_width_or_height):
9305 * xfns.c (image_cache_refcount):
9306 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9307 on typical 64-bit hosts.
9308
9309 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9310 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9311 Omit unnecessary casts to int.
9312 (parse_image_spec): Check that integers fall into 'int' range
9313 when the callers expect that.
9314 (image_ascent): Redo ascent calculation to avoid int overflow.
9315 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9316 (lookup_image): Remove unnecessary tests.
9317 (xbm_image_p): Locals are now of int, not EMACS_INT,
9318 since parse_image_check makes sure they fit into int.
9319 (png_load, gif_load, svg_load_image):
9320 Prefer int to unsigned where either will do.
9321 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
9322 old tiff_error_handler and tiff_warning_handler.
9323 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
9324 stack buffer overflows. It uses only the features of vsnprintf
9325 that are common to both POSIX and native Microsoft.
9326 (tiff_error_handler, tiff_warning_handler): Use it.
9327 (tiff_load, gif_load, imagemagick_load_image):
9328 Don't assume :index value fits in 'int'.
9329 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9330 (imagemagick_load_image): Check that crop parameters fit into
9331 the integer types that MagickCropImage accepts. Don't assume
9332 Vimagemagick_render_type has a nonnegative value. Don't assume
9333 size_t fits in 'long'.
9334 (gs_load): Use printmax_t to print the widest integers possible.
9335 Check for integer overflow when computing image height and width.
9336
c11821d4
EZ
93372011-08-26 Eli Zaretskii <eliz@gnu.org>
9338
9339 * xdisp.c (redisplay_window): Don't force window start if point
9340 will be invisible in the resulting window. (Bug#9324)
9341
0c95fcf7
EZ
93422011-08-25 Eli Zaretskii <eliz@gnu.org>
9343
9344 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9345 the display spec is of the form `(space ...)'.
9346 (handle_display_spec): Return the value returned by
9347 handle_single_display_spec, not just 1 or zero.
9348 (handle_single_display_spec): If the display spec is of the form
9349 `(space ...)', and specifies display in the text area, return 2
9350 rather than 1.
fee65a97 9351 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
9352 accurately, and prefer exact match for point under bidi.
9353 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
9354
9355 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9356 into disp_prop; all users changed.
9357
9358 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9359 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9360 for the text covered by the display property.
9361
e4ed06f1
CY
93622011-08-25 Chong Yidong <cyd@stupidchicken.com>
9363
9364 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9365 Change return value to nil.
9366 (Frecord_buffer): Delete unused function.
9367
f67cdd7f
EZ
93682011-08-24 Eli Zaretskii <eliz@gnu.org>
9369
5980d4c6
EZ
9370 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9371 buffers, return left-to-right.
8610fe8b
EZ
9372 (set_cursor_from_row): Consider candidate row a win if its glyph
9373 represents a newline and point is on that newline. Fixes cursor
9374 positioning on the newline at EOL of R2L text within L2R
9375 paragraph, and vice versa.
9376 (try_cursor_movement): Check continued rows, in addition to
9377 continuation rows. Fixes unwarranted scroll when point enters a
9378 continued line of R2L text within an L2R paragraph, or vice versa.
9379 (cursor_row_p): Consider the case of point being equal to
9380 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9381 from the end of a short line to the beginning of a continued line
9382 of R2L text within L2R paragraph.
9383 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9384 composed characters.
5980d4c6 9385
f67cdd7f
EZ
9386 * bidi.c (bidi_check_type): Use xassert.
9387 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9388 members.
9389
bca633fb
EZ
93902011-08-23 Eli Zaretskii <eliz@gnu.org>
9391
9392 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9393 a character.
9394
4a5885a7
CY
93952011-08-23 Chong Yidong <cyd@stupidchicken.com>
9396
9397 * nsfont.m (ns_otf_to_script): Fix typo.
9398
0902a04e
KH
93992011-08-22 Kenichi Handa <handa@m17n.org>
9400
9401 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9402 extra slot even if the purpose is char-code-property-table.
9403
1a2e6670
EZ
94042011-08-23 Eli Zaretskii <eliz@gnu.org>
9405
8ddde651
EZ
9406 * xdisp.c (redisplay_window): When computing centering_position,
9407 account for the height of the header line. (Bug#8874)
9408
425cc014
EZ
9409 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9410 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9411 candidate is selected by the mouse, and that candidate has a
9412 composed character under the mouse.
9413
1a2e6670
EZ
9414 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9415 coordinates reported by pos-visible-in-window-p for a composed
9416 character in column zero.
9417
8b76d6f8
SM
94182011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9419
9420 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9421
dac347dd
EZ
94222011-08-22 Eli Zaretskii <eliz@gnu.org>
9423
9424 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9425 consider it a hit if to_charpos is anywhere in the range of the
9426 composed buffer positions.
9427
e013fb34
CY
94282011-08-22 Chong Yidong <cyd@stupidchicken.com>
9429
9430 * image.c (gif_load): Don't assume that each subimage has the same
9431 dimensions as the base image. Handle disposal method that is
9432 "undefined" by the gif spec (Bug#9335).
9433
bd1ba3e8
CY
94342011-08-20 Chong Yidong <cyd@stupidchicken.com>
9435
9436 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 9437 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 9438
54a1215b
EZ
94392011-08-19 Eli Zaretskii <eliz@gnu.org>
9440
823564e5
EZ
9441 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9442 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9443 from an Org mode buffer to a Speedbar frame.
9444
54a1215b
EZ
9445 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9446 a composition, take its buffer position from IT->cmp_it.charpos.
9447 Fixes cursor positioning at the beginning of a line that begins
9448 with a composed character.
9449
9778ebcc
EZ
94502011-08-18 Eli Zaretskii <eliz@gnu.org>
9451
0be6ee06
EZ
9452 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9453 character bidirectional type, use STRONG_L instead. Fixes crashes
9454 in a buffer produced by `describe-categories'.
9455
9778ebcc
EZ
9456 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9457 members before the level stack, so they would be saved and
9458 restored when copying iterator state. Fixes incorrect reordering
9459 around TABs covered by display properties.
9460
156bffbe
AS
94612011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9462
6b02f655 9463 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 9464
72ad093b
CY
94652011-08-17 Chong Yidong <cyd@stupidchicken.com>
9466
9467 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
9468 (internal_condition_case_2, internal_condition_case_n):
9469 Remove unnecessary aborts (Bug#9081).
72ad093b 9470
35774242
EZ
94712011-08-17 Eli Zaretskii <eliz@gnu.org>
9472
9473 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9474 has no `load' handler, try opening the file locally. (Bug#9311)
9475
db76dd85
KB
94762011-08-16 Ken Brown <kbrown@cornell.edu>
9477
9478 * gmalloc.c: Expand comment.
9479
b215eee5
EZ
94802011-08-16 Eli Zaretskii <eliz@gnu.org>
9481
9482 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9483 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9484
a4579d33
KB
94852011-08-16 Ken Brown <kbrown@cornell.edu>
9486
9487 Fix memory allocation problems in Cygwin build (Bug#9273).
9488
9489 * unexcw.c ( __malloc_initialized): Declare external variable.
9490 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9491
8b76d6f8
SM
9492 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9493 New variables.
a4579d33
KB
9494 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9495 dumped emacs.
9496 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9497 in the static heap.
9498 [CYGWIN] (special_realloc): New function.
9499 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9500 requests to realloc storage in the static heap.
9501
3ebec551
PE
95022011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9503
9504 * bidi.c (bidi_initialize): Remove unused local.
9505
9fd8be00
EZ
95062011-08-15 Eli Zaretskii <eliz@gnu.org>
9507
6b02f655
SM
9508 * bidimirror.h:
9509 * biditype.h: Remove file.
9510 * makefile.w32-in ($(BLD)/bidi.$(O)):
9511 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
9512
9513 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9514
9515 * chartab.c: Improve commentary for the uniprop_table API.
9516
32413314
EZ
9517 * bidi.c (bidi_paragraph_init): Support zero value of
9518 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
9519 (bidi_initialize): Use uniprop_table instead of including
9520 biditype.h and bidimirror.h.
32413314 9521
9fd8be00
EZ
9522 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9523 coordinates of the iterator when restoring from ppos_it.
9524 (Bug#9296)
9525
5cf2b69b
KH
95262011-08-14 Kenichi Handa <handa@m17n.org>
9527
9528 * process.c (create_process): Call setup_process_coding_systems
72ad093b 9529 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 9530
daf17d00
EZ
95312011-08-14 Eli Zaretskii <eliz@gnu.org>
9532
9533 * xdisp.c (move_it_in_display_line_to): Don't invoke
9534 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9535 ppos_it. Fixes vertical cursor motion when line beginning is
9536 covered by an image. (Bug#9296)
9537
08e3161a
JD
95382011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9539
9540 * nsterm.h (ns_run_ascript): Declare.
9541 (NSAPP_DATA2_RUNASSCRIPT): Define.
9542
9543 * nsfns.m (as_script, as_result, as_status): New static variables.
9544 (ns_run_ascript): New function.
5e617bc2 9545 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
9546 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9547 the event loop. Get status from as_status (Bug#7276).
9548
9549 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9550 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9551 the event loop (Bug#7276).
9552
a3720aa2
AS
95532011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9554
9555 * gnutls.c (QCgnutls_bootprop_priority)
9556 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9557 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9558 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9559 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9560 (QCgnutls_bootprop_verify_hostname_error)
9561 (QCgnutls_bootprop_callbacks_verify): Rename from
9562 Qgnutls_bootprop_..., all uses changed.
9563
9564 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9565 uses changed.
9566
0a0d27fb
PE
95672011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9568
19d5c50c
PE
9569 * xfaces.c (Qframe_set_background_mode): Now static.
9570 * dispextern.h (Qframe_set_background_mode): Remove decl.
9571
0a0d27fb
PE
9572 * process.c (Fnetwork_interface_info): Declare local only if needed.
9573
377538cb
JD
95742011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9575
9576 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9577 (Fnetwork_interface_list): Allocate in increments of bytes instead
9578 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9579 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9580 sockaddr.
9581 (struct ifflag_def): notrailers is smart on OSX.
9582 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9583 Get hardware address with getifaddrs if available.
9584
08fff70c
EZ
95852011-08-12 Eli Zaretskii <eliz@gnu.org>
9586
9587 * xdisp.c (iterate_out_of_display_property): xassert that
9588 IT->position is set to within IT->object's boundaries. Break from
9589 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
9590 when IT->position is set up wrongly due to some bug.
9591 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
9592 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9593 entry. Force push_it to save on the stack the current
9594 buffer/string position, to be restored by pop_it. Fix flags in
9595 the iterator structure wrt the object coming from a display
9596 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9597 properties. (Bug#9284)
9598
7be1c708 95992011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 9600
7be1c708
CY
9601 * fontset.c (fontset_get_font_group): Add proper type checks.
9602 (Bug#9172)
aac0c6e3 9603
7be1c708 96042011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 9605
7be1c708
CY
9606 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9607 and LC_VERSION_MIN_MACOSX.
9608 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9609 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 9610
97bb72a6
EZ
96112011-08-08 Eli Zaretskii <eliz@gnu.org>
9612
9613 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
9614 no-display-properties-and-no-overlays under bidi display.
9615 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 9616 properties and overlays.
97bb72a6 9617
d5617611
CY
96182011-08-08 Chong Yidong <cyd@stupidchicken.com>
9619
37e11a63
CY
9620 * editfns.c (Fset_time_zone_rule): Document relationship with the
9621 setenv function.
9622
d5617611
CY
9623 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9624 the font entity extracted from the cache (Bug#8109).
9625
58872834
CY
96262011-08-07 Chong Yidong <cyd@stupidchicken.com>
9627
9628 * composite.c (autocmp_chars): Don't reset point. That is done by
9629 restore_point_unwind (Bug#5984).
9630
75bfc667
JL
96312011-08-07 Juri Linkov <juri@jurta.org>
9632
9633 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9634 to show the arg `TIME' instead of `TIMEVAL'.
9635
d1410150
EZ
96362011-08-06 Eli Zaretskii <eliz@gnu.org>
9637
9638 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9639 display property strides EOL and includes a newline, as in
9640 longlines-mode. (Bug#9254)
75b771e4
EZ
9641 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9642 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
9643
9644 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9645 is non-zero, even if the data buffer is NULL. Fixes a crash in
9646 vertical-motion with longlines-mode. (Bug#9254)
9647
35928349
EZ
96482011-08-05 Eli Zaretskii <eliz@gnu.org>
9649
ec7cc85b
EZ
9650 * bidi.c <bidi_cache_total_alloc>: Now static.
9651 (bidi_initialize): Initialize bidi_cache_total_alloc.
9652
8b76d6f8 9653 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
9654 cache. (Bug#9221)
9655
9656 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9657 amount allocated this far in `bidi_cache_total_alloc'.
9658 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9659 non-zero, only free the data buffer without restoring the cache
9660 contents. All callers changed.
9661
9662 * dispextern.h (bidi_unshelve_cache): Update prototype.
9663
9664 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9665 (move_it_in_display_line, move_it_to)
9666 (move_it_vertically_backward, move_it_by_lines): Replace the call
9667 to xfree to an equivalent call to bidi_unshelve_cache.
9668 (move_it_in_display_line_to): Fix logic of returning
412b6358 9669 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 9670
e2e2423b
EZ
96712011-08-05 Eli Zaretskii <eliz@gnu.org>
9672
9673 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9674 came from a string character with a `cursor' property. (Bug#9229)
9675
ae9e757a
JD
96762011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9677
9678 * Makefile.in (LIB_PTHREAD): New variable.
9679 (LIBES): Add LIB_PTHREAD (Bug#9216).
9680
9681 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9682 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9683
213bd7f2
AS
96842011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9685
6b02f655 9686 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 9687
99aaf75f
JD
96882011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9689
9690 * xterm.c (x_find_topmost_parent): New function.
9691 (x_set_frame_alpha): Find topmost parent window with
9692 x_find_topmost_parent and set the property there also (bug#9181).
9693 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9694
c74e9d86
PE
96952011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9696
9697 * callproc.c (Fcall_process): Avoid vfork clobbering
9698 the local vars buffer, coding_systems, current_dir.
9699
640c8776
SM
97002011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9701
9702 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9703
f26d0e4c
PE
97042011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9705
8a10d76c
PE
9706 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9707 so that it is not optimized away.
9708
f26d0e4c
PE
9709 * xdisp.c (compute_display_string_pos): Remove unused local.
9710
55439c61
EZ
97112011-08-02 Eli Zaretskii <eliz@gnu.org>
9712
9713 Fix slow cursor motion and scrolling in large buffers with
9714 selective display, like Org Mode buffers. (Bug#9218)
9715
9716 * dispextern.h (struct bidi_it): New member disp_prop_p.
9717
9718 * xdisp.c: Remove one-slot cache of display string positions.
9719 (compute_display_string_pos): Accept an additional argument
5e617bc2 9720 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
9721 for a display string or property. If found, set DISP_PROP_P
9722 non-zero.
9723
9724 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
9725 DISP_PROP_P, and pass it to compute_display_string_pos.
9726 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
9727 non-zero. All callers of bidi_fetch_char changed.
9728
fb33fa43
SM
97292011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9730
9731 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9732
b099e063
DM
97332010-12-03 Don March <don@ohspite.net>
9734
9735 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9736 last character M-[char] is translated to ESC [char] (bug#7541).
9737
5cc7f7af
KH
97382011-08-02 Kenichi Handa <handa@m17n.org>
9739
d0fffa3f 9740 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
9741
9742 * chartab.c (uniprop_table): Make it non-static.
9743
525d5e6e
EZ
97442011-08-01 Eli Zaretskii <eliz@gnu.org>
9745
9746 * xdisp.c (forward_to_next_line_start): Accept additional argument
9747 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9748 on the newline.
9749 (reseat_at_next_visible_line_start): Use the bidi iterator state
9750 returned by forward_to_next_line_start to restore the state of
9751 it->bidi_it after backing up to previous newline. (Bug#9212)
9752
31011111
AS
97532011-07-30 Andreas Schwab <schwab@linux-m68k.org>
9754
9755 * regex.c (re_comp): Protoize.
9756 (re_exec): Fix return type.
9757 (regexec): Fix type of `ret'. (Bug#9203)
9758
476371c4
PE
97592011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9760
e5d76069
PE
9761 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9762 This is needed if max-image-size is a floating-point number.
9763
9a79b20c
AS
97642011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9765
9766 * print.c (print_object): Print empty symbol as ##.
9767
9768 * lread.c (read1): Read ## as empty symbol.
9769
d8c2fa78
AA
97702011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9771
9772 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9773 setting frame foreground color (Bug#9175).
9774 (x_set_background_color): Likewise.
9775
ffe57a7a
AA
9776 * nsmenu.m (-setText): Size tooltip dimensions precisely to
9777 contents (Bug#9176).
9778 (EmacsTooltip -init): Remove bezels and add shadows to
9779 tooltip windows.
9780
bf3492a5
AA
9781 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9782 or scroll bar (Bug#8470).
9783
d55e9c53
AA
9784 * nsfont.m (nsfont_open): Remove assignment to voffset and
9785 unnecessary vars hshink, expand, hd, full_height, min_height.
9786 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9787
9788 * nsterm.h (nsfont_info): Remove voffset field.
9789
d8c2fa78 97902011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
9791
9792 Implement strike-through and overline on NextStep (Bug#8863).
9793
9794 * nsfont.m (nsfont_open): Use underline position provided by font,
9795 instead of hard-coded value of 2.
9796 (nsfont_draw): Call ns_draw_text_decoration instead.
9797
9798 * nsterm.h: Add declaration for ns_draw_text_decoration.
9799
9800 * nsterm.m (ns_draw_text_decoration): New function for drawing
9801 underline, overline, and strike-through.
9802 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9803 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 9804 accommodate underlining, etc.
4843aac3 9805
4cc60b9b
EZ
98062011-07-28 Eli Zaretskii <eliz@gnu.org>
9807
bc7ece87
EZ
9808 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
9809 default.
4cc60b9b 9810
476371c4
PE
98112011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9812
66606eea
PE
9813 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
9814 Without this fix, if a signal arrives just after memory fills up,
9815 'malloc' might be invoked reentrantly.
9816
476371c4
PE
9817 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
9818 In other words, assume that every image size is allowed, on non-X
9819 hosts. This assumption is probably wrong, but it lets Emacs compile.
9820
f3fcc40d
AS
98212011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9822
9823 * regex.c (re_iswctype): Convert return values to boolean.
9824
350c992f
EZ
98252011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
9826
9827 * xdisp.c (compute_display_string_pos): Don't use cached display
9828 string position if the buffer had its restriction changed.
9829 (Bug#9184)
9830
5266b4bb
PE
98312011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9832
9833 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9834
2573a837 98352011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 9836
41f55ccd 9837 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 9838
39e378da
PE
9839 * bidi.c: Integer size and overflow fixes.
9840 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9841 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9842 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9843 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9844 (bidi_find_other_level_edge):
9845 Use ptrdiff_t instead of EMACS_INT where either will do.
9846 This works better on 32-bit hosts configured --with-wide-int.
9847 (bidi_cache_ensure_space): Check for size-calculation overflow.
9848 Use % rather than repeated addition, for better worst-case speed.
9849 Don't set bidi_cache_size until after xrealloc returns, because it
9850 might not return.
9851 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
9852 (bidi_cache_ensure_space): Also check that the bidi cache size
9853 does not exceed that of the largest Lisp string or buffer. See Eli
9854 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 9855
5e927815
PE
9856 * alloc.c (__malloc_size_t): Remove.
9857 All uses replaced by size_t. See Andreas Schwab's note
9858 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9859
ca4aa935
PE
9860 * image.c: Improve checking for integer overflow.
9861 (check_image_size): Assume that f is nonnull, since
9862 it is always nonnull in practice. This is one less thing to
9863 worry about when checking for integer overflow later.
9864 (x_check_image_size): New function, which checks for integer
9865 overflow issues inside X.
9866 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9867 This removes the need for a memory_full check.
9868 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9869 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
9870 (xbm_read_bitmap_data): Change locals back to 'int', since
9871 their values must fit in 'int'.
9872 (xpm_load_image, png_load, tiff_load):
9873 Invoke x_create_x_image_and_pixmap earlier,
9874 to avoid much needless work if the image is too large.
9875 (tiff_load): Treat overly large images as if
9876 x_create_x_image_and_pixmap failed, not as malloc failures.
9877 (gs_load): Use x_check_image_size.
9878
5f8f9cc2
PE
9879 * gtkutil.c: Omit integer casts.
9880 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
9881 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
9882
5adf60bc
PE
9883 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
9884
c8907a93
PE
9885 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
9886 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
9887 would wrongly return t on a 64-bit host.
9888
e3c25c68
PE
9889 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
9890 The plain *_OVERFLOW macros run afoul of GCC bug 49705
9891 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
9892 and therefore cause GCC to emit a bogus diagnostic in some cases.
9893
3f791afe
PE
9894 * image.c: Integer signedness and overflow and related fixes.
9895 This is not an exhaustive set of fixes, but it's time to
9896 record what I've got.
9897 (lookup_pixel_color, check_image_size): Remove redundant decls.
9898 (check_image_size): Don't assume that arbitrary EMACS_INT values
9899 fit in 'int', or that arbitrary 'double' values fit in 'int'.
9900 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
9901 (tiff_load, imagemagick_load_image):
9902 Check for overflow in size calculations.
9903 (x_create_x_image_and_pixmap): Remove unnecessary test for
9904 xmalloc returning NULL; that can't happen.
9905 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
9906 (xpm_color_bucket): Use better integer hashing function.
9907 (xpm_cache_color): Don't possibly over-allocate memory.
9908 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
9909 (gif_memory_source):
9910 Use ptrdiff_t, not int or size_t, to record sizes.
9911 (png_load): Don't assume values greater than 2**31 fit in 'int'.
9912 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
9913 either works, as we prefer signed integers.
9914 (tiff_read_from_memory, tiff_write_from_memory):
9915 Return tsize_t, not size_t, since that's what the TIFF API wants.
9916 (tiff_read_from_memory): Don't fail simply because the read would
9917 go past EOF; instead, return a short read.
9918 (tiff_load): Omit no-longer-needed casts.
9919 (Fimagemagick_types): Don't assume size fits into 'int'.
9920
3cc5a532
PE
9921 Improve hashing quality when configured --with-wide-int.
9922 * fns.c (hash_string): New function, taken from sxhash_string.
9923 Do not discard information about ASCII character case; this
9924 discarding is no longer needed.
9925 (sxhash-string): Use it. Change sig to match it. Caller changed.
9926 * lisp.h: Declare it.
9927 * lread.c (hash_string): Remove, since we now use fns.c's version.
9928 The fns.c version returns a wider integer if --with-wide-int is
9929 specified, so this should help the quality of the hashing a bit.
9930
b312a492
PE
9931 * emacs.c: Integer overflow minor fix.
9932 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
9933 Define only if GNU_LINUX.
9934 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
9935
dfd153ae
PE
9936 * dispnew.c: Integer signedness and overflow fixes.
9937 Remove unnecessary forward decls, that were a maintenance hassle.
9938 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
9939 All uses changed.
9940 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
9941 (scrolling_window): Use ptrdiff_t, not int, for byte count.
9942 (prepare_desired_row, line_draw_cost):
9943 Use int, not unsigned, where either works.
9944 (save_current_matrix, restore_current_matrix):
9945 Use ptrdiff_t, not size_t, where either works.
9946 (init_display): Check for overflow more accurately, and without
9947 relying on undefined behavior.
9948
a81d11a3
PE
9949 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
9950 Remove, replacing with the new symbols in lisp.h. All uses changed.
9951 * fileio.c (make_temp_name):
9952 * filelock.c (lock_file_1, lock_file):
9953 * xdisp.c (message_dolog):
9954 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
9955 Use pMd etc. instead.
9956 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
9957 replacing the pWIDE etc. symbols removed from editfns.c.
9958
3300e6fd
PE
9959 * keyboard.h (num_input_events): Now uintmax_t.
9960 This is (very slightly) less likely to mess up due to wraparound.
9961 All uses changed.
9962
fd05c7e9
PE
9963 * buffer.c: Integer signedness fixes.
9964 (alloc_buffer_text, enlarge_buffer_text):
9965 Use ptrdiff_t rather than size_t when either will do, as we prefer
9966 signed integers.
9967
903fe15d
PE
9968 * alloc.c: Integer signedness and overflow fixes.
9969 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
9970 (__malloc_size_t): Default to size_t, not to int.
9971 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
9972 (Fgarbage_collect, mark_object_loop_halt, mark_object):
9973 Prefer ptrdiff_t to size_t when either would do, as we prefer
9974 signed integers.
9975 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
9976 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
9977 Now const. Initialize with values that are in range even if char
9978 is signed.
9979 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
9980 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
9981 These functions do the right thing with sizes > 2**32.
9982 (check_depth): Now ptrdiff_t, not int.
9983 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
9984 Adjust to new way of storing sizes. Check for size overflow bugs
9985 in rest of code.
9986 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
9987 slightly wrong anyway, as it missed one instance of
9988 XMALLOC_OVERRUN_CHECK_OVERHEAD.
9989 (refill_memory_reserve): Omit needless cast to size_t.
9990 (mark_object_loop_halt): Mark as externally visible.
9991
ac82cc6a
PE
9992 * xselect.c: Integer signedness and overflow fixes.
9993 (Fx_register_dnd_atom, x_handle_dnd_message):
9994 Use ptrdiff_t, not size_t, since we prefer signed.
9995 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
9996 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
9997 x_dnd_atoms_size and x_dnd_atoms_length.
9998
c2d1e36d
PE
9999 * doprnt.c: Prefer signed to unsigned when either works.
10000 * eval.c (verror):
10001 * doprnt.c (doprnt):
10002 * lisp.h (doprnt):
10003 * xdisp.c (vmessage):
10004 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10005 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10006 prefer signed arithmetic to avoid comparison confusion.
10007 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10008 but is a bit tricky.
10009
0e926e56
PE
10010 Assume freestanding C89 headers, string.h, stdlib.h.
10011 * data.c, doprnt.c, floatfns.c, print.c:
10012 Include float.h unconditionally.
10013 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10014 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10015 * regex.c: Likewise for stddef.h, string.h.
10016 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10017 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10018 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10019 (STDC_HEADERS): Remove obsolete defines.
10020 * sysdep.c: Include limits.h unconditionally.
10021
9cfdb3ec
PE
10022 Assume support for memcmp, memcpy, memmove, memset.
10023 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10024 * regex.c (memcmp, memcpy):
10025 Remove; we assume C89 now.
10026
10027 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10028 (__malloc_safe_bcopy): Remove; no longer needed.
10029
cf950e6b 10030 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
10031 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10032 well either way, and we prefer signed to unsigned.
10033
dbf38e02
LMI
100342011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10035
10036 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10037 closes the connection while we're reading (bug#9182).
10038
d6f0886c 100392011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 10040
d6f0886c
JD
10041 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10042 are specified (Bug#9168).
24e0f6b1 10043
2eb1f9e6
PE
100442011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10045
10046 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10047 Found by GCC static checking and --with-wide-int on a 32-bit host.
10048
22381272 100492011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
10050
10051 * xdisp.c (compute_display_string_pos): Fix logic of caching
10052 previous display string position. Initialize cached_prev_pos to
10053 -1. Fixes slow-down at the beginning of a buffer.
10054
f25e39b4
EZ
100552011-07-24 Eli Zaretskii <eliz@gnu.org>
10056
10057 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10058 for attrs[LFACE_FONTSET_INDEX].
10059
04c4b52e
PE
100602011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10061
10062 * xml.c (parse_region): Remove unused local
10063 that was recently introduced.
10064
c1734fbd
EZ
100652011-07-23 Eli Zaretskii <eliz@gnu.org>
10066
be18c5a5
EZ
10067 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10068 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10069
c1734fbd
EZ
10070 * xdisp.c (move_it_in_display_line_to): Record the best matching
10071 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
10072 exit if none of the characters scanned was an exact match.
10073 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
10074 when exact match is impossible due to invisible text, and the
10075 lines are truncated.
10076
a258d627
JD
100772011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10078
10079 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10080 for OSX >= 10.7.
10081
b6d5a689
EZ
100822011-07-22 Eli Zaretskii <eliz@gnu.org>
10083
0f74f785
EZ
10084 Fix a significant slow-down of cursor motion with C-n, C-p,
10085 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10086 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 10087 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
10088 (next_element_from_buffer): Call compute_stop_pos_backwards to
10089 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
10090 base_level_stop.
10091 (reseat): Don't look for prev_stop, as that could mean a very long
10092 run.
10093 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10094 <cached_disp_overlay_modiff>: Cache for last found display string
10095 position.
551918c1 10096 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
10097 about the same buffer in the same area of character positions, and
10098 the buffer wasn't changed since the time the display string
10099 position was cached.
551918c1 10100
b2d0c91a
EZ
101012011-07-22 Eli Zaretskii <eliz@gnu.org>
10102
10103 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10104 is an integer, which is important for empty lines. (Bug#9149)
10105
043604ee
CY
101062011-07-22 Chong Yidong <cyd@stupidchicken.com>
10107
10108 * frame.c (Fmodify_frame_parameters): In tty case, update the
10109 default face if necessary (Bug#4238).
10110
da4adb04
CY
101112011-07-21 Chong Yidong <cyd@stupidchicken.com>
10112
10113 * editfns.c (Fstring_to_char): No need to explain what a character
10114 is in the docstring (Bug#6576).
10115
9abd0532
LMI
101162011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10117
10118 * xml.c (parse_region): Make sure we always return a tree.
10119
36881d16
HK
101202011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10121
10122 * xml.c (parse_region): If a document contains only comments,
10123 return that, too.
10124
1e98674d
LMI
101252011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10126
10127 * xml.c (make_dom): Return comments, too.
10128
590bd467
PE
101292011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10130
10131 Port to OpenBSD.
10132 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10133 and the surrounding thread.
10134 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10135 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10136 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10137 timer goes off.
10138 * s/openbsd.h (BROKEN_SIGIO): Define.
10139 * unexelf.c (unexec) [__OpenBSD__]:
10140 Don't update the .mdebug section of the Alpha COFF symbol table.
10141
f41628b2
LMI
101422011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10143
10144 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10145 (bug#8460).
10146
b59b67c5
PE
101472011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10148
15e3a074
PE
10149 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10150 This fixes some race conditions on the permissions of any newly
10151 created file.
10152
41bed37d
PE
10153 * alloc.c (valid_pointer_p): Use pipe, not open.
10154 This fixes some permissions issues when debugging.
10155
b59b67c5
PE
10156 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10157 If fchown fails to set both uid and gid, try to set just gid,
10158 as that is sometimes allowed. Adjust the file's mode to eliminate
10159 setuid or setgid bits that are inappropriate if fchown fails.
10160
925a6be7
SM
101612011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10162
10163 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10164 to compare Lisp_Objects.
10165 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10166 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10167 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10168
52968808
AS
101692011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10170
0a6a104b
AS
10171 * lread.c (read_integer): Unread even EOF character.
10172 (read1): Likewise. Properly record start position of symbol.
10173
52968808
AS
10174 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10175 symbol character follows.
10176
9e381cdd
PE
101772011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10178
10179 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10180 This works around a problem with the previous change to Fcopy_file.
10181 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10182 and without this change, GCC might complain about discarding
10183 fchown's return value.
10184
b5641435
JB
101852011-07-16 Juanma Barranquero <lekktu@gmail.com>
10186
10187 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10188
a8031457
PE
101892011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10190
10191 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10192
dd889327
LMI
101932011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10194
750c33f7
LMI
10195 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10196 it's used from the C level.
10197
dd889327
LMI
10198 * process.c: Use the same condition for POLL_FOR_INPUT in both
10199 keyboard.c and process.c (bug#1858).
10200
87e86684
LM
102012011-07-09 Lawrence Mitchell <wence@gmx.li>
10202
10203 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10204 (Fgnutls_boot): Use it.
10205
64348f40
AS
102062011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10207
10208 * doc.c (Fsubstitute_command_keys): Revert last change.
10209
1d698799
LMI
102102011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10211
f863868c
LMI
10212 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10213 quotes the next character, and doesn't affect other longer
10214 sequences (bug#8935).
10215
1d698799
LMI
10216 * lread.c (syms_of_lread): Clarify that is isn't only
10217 `eval-buffer' and `eval-defun' that's affected by
10218 `lexical-binding' (bug#8460).
10219
aa4b6df6
EZ
102202011-07-15 Eli Zaretskii <eliz@gnu.org>
10221
10222 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 10223 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 10224
5d856da6
PE
102252011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10226
ad6042bb
PE
10227 Fix minor problems found by static checking.
10228 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10229 (elsz): Now a signed constant, not a size_t var. We prefer signed
10230 types to unsigned, to avoid integer comparison confusion. Without
10231 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10232 "cannot optimize loop, the loop counter may overflow", a symptom
10233 of the confusion.
f00bbb22 10234 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
10235 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10236
6468f31c
LMI
102372011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10238
49080b10
LMI
10239 * search.c (Fre_search_backward): Mention `case-fold-search' in
10240 all the re_search_* functions (bug#8138).
10241
6468f31c
LMI
10242 * keyboard.c (Fopen_dribble_file): Document when the file is
10243 closed (bug#8056).
10244
c965adc5
EZ
102452011-07-14 Eli Zaretskii <eliz@gnu.org>
10246
df9733bf
EZ
10247 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10248 bidi_cache_idx.
10249
0bb23927
EZ
10250 Support bidi reordering of display and overlay strings.
10251 * xdisp.c (compute_display_string_pos)
10252 (compute_display_string_end): Accept additional argument STRING.
10253 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10254 (reseat_to_string): Initialize bidi_it->string.s and
10255 bidi_it->string.schars.
10256 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
10257 NULL (avoids a crash in bidi_paragraph_init).
10258 Initialize itb.string.lstring.
0bb23927
EZ
10259 (init_iterator): Call bidi_init_it only of a valid
10260 buffer position was specified. Initialize paragraph_embedding to
10261 L2R.
10262 (reseat_to_string): Initialize the bidi iterator.
10263 (display_string): If we need to ignore text properties of
10264 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10265 original value of -1 will not work with bidi.)
10266 (compute_display_string_pos): First arg is now struct
10267 `text_pos *'; all callers changed. Support display properties on
10268 Lisp strings.
10269 (compute_display_string_end): Support display properties on Lisp
10270 strings.
10271 (init_iterator, reseat_1, reseat_to_string): Initialize the
10272 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10273 when iterating on a string not from display properties).
640c8776
SM
10274 (compute_display_string_pos, compute_display_string_end):
10275 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
10276 arrow keys.
10277 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
10278 base_level_stop; instead, set base_level_stop to BEGV.
10279 Fixes crashes in vertical-motion.
0bb23927
EZ
10280 (next_element_from_buffer): Improve commentary for when
10281 the iterator is before prev_stop.
10282 (init_iterator): Initialize bidi_p from the default value of
10283 bidi-display-reordering, not from buffer-local value. Use the
10284 buffer-local value only if initializing for buffer iteration.
10285 (handle_invisible_prop): Support invisible properties on strings
10286 that are being bidi-reordered.
10287 (set_iterator_to_next): Support bidi reordering of C strings and
10288 Lisp strings.
10289 (next_element_from_string): Support bidi reordering of Lisp
10290 strings.
10291 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
10292 (display_string): Support display of R2L glyph rows.
10293 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
10294 (init_iterator): Don't initialize it->bidi_p for strings
10295 here.
10296 (reseat_to_string): Initialize it->bidi_p for strings here.
10297 (next_element_from_string, next_element_from_c_string)
10298 (next_element_from_buffer): Add xassert's for correspondence
10299 between IT's object being iterated and it->bidi_it.string
10300 structure.
10301 (face_before_or_after_it_pos): Support bidi iteration.
10302 (next_element_from_c_string): Handle the case of the first string
10303 character that is not the first one in the visual order.
10304 (get_visually_first_element): New function, refactored from common
10305 parts of next_element_from_buffer, next_element_from_string, and
10306 next_element_from_c_string.
10307 (tool_bar_lines_needed, redisplay_tool_bar)
10308 (display_menu_bar): Force left-to-right direction. Add a FIXME
10309 comment for making that be controlled by a user option.
10310 (push_it, pop_it): Save and restore the state of the
10311 bidi iterator. Save and restore the bidi_p flag.
10312 (pop_it): Iterate out of display property for string iteration as
10313 well.
10314 (iterate_out_of_display_property): Support iteration over strings.
10315 (handle_single_display_spec): Set up it->bidi_it for iteration
10316 over a display string, and call bidi_init_it.
10317 (handle_single_display_spec, next_overlay_string)
10318 (get_overlay_strings_1, push_display_prop): Set up the bidi
10319 iterator for displaying display or overlay strings.
10320 (forward_to_next_line_start): Don't use the shortcut if
10321 bidi-iterating.
10322 (back_to_previous_visible_line_start): If handle_display_prop
10323 pushed the iterator stack, restore the internal state of the bidi
10324 iterator by calling bidi_pop_it same number of times.
10325 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10326 and we are bidi-iterating, don't decrement the iterator position;
10327 instead, set the first_elt flag in the bidi iterator, to produce
10328 the same effect.
10329 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10330 (push_display_prop): xassert that we are iterating a buffer.
10331 (push_it, pop_it): Save and restore paragraph_embedding member.
10332 (handle_single_display_spec, next_overlay_string)
10333 (get_overlay_strings_1, reseat_1, reseat_to_string)
10334 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10335 correctly. Don't assume unibyte strings are not bidi-reordered.
10336 (compute_display_string_pos)
10337 (compute_display_string_end): Fix handling the case of C string.
10338 (push_it, pop_it): Save and restore from_disp_prop_p.
10339 (handle_single_display_spec, push_display_prop): Set the
10340 from_disp_prop_p flag.
10341 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10342 (pop_it): Call iterate_out_of_display_property only if we are
10343 popping after iteration over a string that came from a display
10344 property. Fix a typo in popping stretch info. Add an assertion
10345 for verifying that the iterator position is in sync with the bidi
10346 iterator.
10347 (handle_single_display_spec, get_overlay_strings_1)
10348 (push_display_prop): Fix initialization of paragraph direction for
10349 string when that of the parent object is not yet determined.
10350 (reseat_1): Call bidi_init_it to resync the bidi
10351 iterator with IT's position. (Bug#7616)
10352 (find_row_edges): If ROW->start.pos gives position
10353 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10354 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10355 Reset the from_disp_prop_p flag.
10356 (SAVE_IT, RESTORE_IT): New macros.
10357 (pos_visible_p, face_before_or_after_it_pos)
10358 (back_to_previous_visible_line_start)
10359 (move_it_in_display_line_to, move_it_in_display_line)
10360 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10361 (try_scrolling, redisplay_window, display_line): Use them when
10362 saving a temporary copy of the iterator and restoring it back.
10363 (back_to_previous_visible_line_start, reseat_1)
10364 (init_iterator): Empty the bidi cache "stack".
10365 (move_it_in_display_line_to): If iterator ended up at
10366 EOL, but we never saw any buffer positions smaller than
10367 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10368 motion in bidi-reordered lines.
10369 (move_it_in_display_line_to): Record prev_method and prev_pos
10370 immediately before the call to set_iterator_to_next. Fixes cursor
10371 motion in bidi-reordered lines with stretch glyphs and strings
10372 displayed in margins. (Bug#8133) (Bug#8867)
10373 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10374 TO_CHARPOS.
640c8776
SM
10375 (pos_visible_p): Support positions in bidi-reordered lines.
10376 Save and restore bidi cache.
0bb23927
EZ
10377
10378 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10379 (bidi_paragraph_info): Delete unused struct.
10380 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10381 (bidi_cache_start): New variable.
10382 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10383 to zero.
10384 (bidi_cache_fetch_state, bidi_cache_search)
10385 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10386 (bidi_cache_find, bidi_peek_at_next_level)
10387 (bidi_level_of_next_char, bidi_find_other_level_edge)
10388 (bidi_move_to_visually_next): Compare cache index with
10389 bidi_cache_start rather than with zero.
10390 (bidi_fetch_char): Accept new argument STRING; all callers
10391 changed. Support iteration over a string. Support strings with
10392 display properties. Support unibyte strings. Fix the type of
10393 `len' according to what STRING_CHAR_AND_LENGTH expects.
10394 (bidi_paragraph_init, bidi_resolve_explicit_1)
10395 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
10396 (bidi_level_of_next_char, bidi_move_to_visually_next):
10397 Support iteration over a string.
0bb23927
EZ
10398 (bidi_set_sor_type, bidi_resolve_explicit_1)
10399 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10400 can now be zero (for strings); special values 0 and -1 were
10401 changed to -1 and -2, respectively.
10402 (bidi_char_at_pos): New function.
10403 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10404 Call it instead of FETCH_MULTIBYTE_CHAR.
10405 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10406 initialized to valid values.
10407 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10408 values.
10409 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10410 the test for valid cached positions. Fix the logic for looking up
10411 the sentinel state in the cache. GCPRO the Lisp string we are
10412 iterating.
10413 (bidi_push_it, bidi_pop_it): New functions.
10414 (bidi_initialize): Initialize the bidi cache start stack pointer.
10415 (bidi_cache_ensure_space): New function, refactored from part of
10416 bidi_cache_iterator_state. Don't assume the required size is just
10417 one BIDI_CACHE_CHUNK away.
10418 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10419 (bidi_count_bytes, bidi_char_at_pos): New functions.
10420 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10421 always valid if bidi_cache_idx is valid.
10422 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10423 is valid if it's going to be used.
10424 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10425 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
10426 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10427 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
10428 (bidi_find_other_level_edge, bidi_cache_start_stack):
10429 All variables related to cache indices are now EMACS_INT.
c965adc5 10430
0bb23927
EZ
10431 * dispextern.h (struct bidi_string_data): New structure.
10432 (struct bidi_it): New member `string'. Make flag members be 1-bit
10433 fields, and put them last in the struct.
640c8776
SM
10434 (compute_display_string_pos, compute_display_string_end):
10435 Update prototypes.
0bb23927
EZ
10436 (bidi_push_it, bidi_pop_it): Add prototypes.
10437 (struct iterator_stack_entry): New members bidi_p,
10438 paragraph_embedding, and from_disp_prop_p.
10439 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
10440 (bidi_shelve_cache, bidi_unshelve_cache):
10441 Declare prototypes.
0bb23927
EZ
10442
10443 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10444 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10445 and vector-like objects.
10446
10447 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10448 cache around display iteration.
10449
10450 * window.c (Fwindow_end, window_scroll_pixel_based)
10451 (displayed_window_lines, Frecenter): Save and restore the bidi
10452 cache around display iteration.
10453
3bbd2265
LMI
104542011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10455
10456 * editfns.c (Fdelete_region): Clarify the use of the named
10457 parameters (bug#6788).
10458
adc47434
MR
104592011-07-14 Martin Rudalics <rudalics@gmx.at>
10460
10461 * indent.c (Fvertical_motion): Set and restore w->pointm when
10462 saving and restoring the window's buffer (Bug#9006).
10463
837c31f8
LMI
104642011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10465
10466 * editfns.c (Fstring_to_char): Clarify just what is returned
10467 (bug#6576). Text by Eli Zaretskii.
10468
ac389d0c
JB
104692011-07-13 Juanma Barranquero <lekktu@gmail.com>
10470
10471 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10472
0be0ce47
EZ
104732011-07-13 Eli Zaretskii <eliz@gnu.org>
10474
10475 * buffer.c (mmap_find): Fix a typo.
10476
cd18e7e3
JB
104772011-07-13 Johan Bockgård <bojohan@gnu.org>
10478
10479 Fix execution of x selection hooks.
10480 * xselect.c (Qx_lost_selection_functions)
10481 (Qx_sent_selection_functions): New vars.
10482 (syms_of_xselect): DEFSYM them.
10483 (x_handle_selection_request): Pass Qx_sent_selection_functions
10484 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10485 (x_handle_selection_clear,x_clear_frame_selections):
10486 Pass Qx_lost_selection_functions rather than
10487 Vx_lost_selection_functions to Frun_hook_with_args.
10488
47ea7f44
PE
104892011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10490
ac389d0c 10491 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
10492 The old code sometimes used this field without initializing it.
10493
47ea7f44
PE
10494 * alloc.c (gc_sweep): Don't read past end of array.
10495 In theory, the old code could also have corrupted Emacs internals,
10496 though it'd be very unlikely.
10497
bc985c87
AS
104982011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10499
10500 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 10501 argument. (Bug#4026)
bc985c87 10502
0cf34688
LMI
105032011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10504
b3dadd76
LMI
10505 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10506 key" (bug#4257).
10507
0cf34688
LMI
10508 * window.c (Fset_window_start): Doc fix (bug#4199).
10509 (Fset_window_hscroll): Ditto.
10510
270768cd
PE
105112011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10512
077e3dda 10513 Fix minor new problems caught by GCC 4.6.1.
270768cd 10514 * term.c (init_tty): Remove unused local.
490011a6 10515 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 10516 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 10517 not used otherwise.
270768cd 10518
b1f58454
CY
105192011-07-12 Chong Yidong <cyd@stupidchicken.com>
10520
10521 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10522
22b9578d
LMI
105232011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10524
6e70ab07
LMI
10525 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10526 are the mini-buffer and the echo area (bug#3320).
10527
22b9578d
LMI
10528 * term.c (init_tty): Remove support for supdup, c10 and perq
10529 terminals, which are no longer supported (bug#1482).
10530
8974cc9f
JB
105312011-07-10 Johan Bockgård <bojohan@gnu.org>
10532
10533 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10534
a560d974
JD
105352011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10536
10537 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10538 for non-popups (Bug#3642).
10539
1dae0f0a
AS
105402011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10541
268c2c36 10542 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 10543 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
10544 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10545 * cm.c (losecursor): Likewise.
1dae0f0a
AS
10546 * data.c (fmod): Likewise.
10547 * dispnew.c (swap_glyphs_in_rows): Likewise.
10548 * emacs.c (memory_warning_signal): Likewise.
10549 * floatfns.c (float_error): Likewise.
10550 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10551 (otf_open, font_otf_capability, generate_otf_features)
10552 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10553 Likewise.
10554 * image.c (pbm_read_file): Likewise.
10555 * indent.c (string_display_width): Likewise.
10556 * intervals.c (check_for_interval, search_for_interval)
10557 (inc_interval_count, count_intervals, root_interval)
10558 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10559 * lread.c (defalias): Likewise.
268c2c36 10560 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
10561 * regex.c (set_image_of_range_1, set_image_of_range)
10562 (regex_grow_registers): Likewise.
10563 * sysdep.c (strerror): Likewise.
10564 * termcap.c (valid_filename_p, tprint, main): Likewise.
10565 * tparam.c (main): Likewise.
10566 * unexhp9k800.c (run_time_remap, save_data_space)
10567 (update_file_ptrs, read_header, write_header, calculate_checksum)
10568 (copy_file, copy_rest, display_header): Likewise.
10569 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10570 Likewise.
10571 * xdisp.c (check_it): Likewise.
10572 * xfaces.c (register_color, unregister_color, unregister_colors):
10573 Likewise.
10574 * xfns.c (print_fontset_result): Likewise.
10575 * xrdb.c (member, fatal, main): Likewise.
10576
99033785
PE
105772011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10578
10579 Fix minor problems found by static checking (Bug#9031).
10580 * chartab.c (char_table_set_range, map_sub_char_table):
10581 Remove unused locals.
10582 (uniprop_table): Now static.
10583 * composite.c (_work_char): Remove unused static var.
10584
9cb2ac56
JB
105852011-07-09 Juanma Barranquero <lekktu@gmail.com>
10586
10587 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10588
f25661f0
JD
105892011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10590
10591 * gtkutil.c (qttip_cb): Remove code without function.
10592
8278c4fe
EZ
105932011-07-09 Eli Zaretskii <eliz@gnu.org>
10594
10595 * w32.c (pthread_sigmask): New stub.
10596
1692ae2d 105972011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 10598
8a6ebd58 10599 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
10600 sigprocmask is portable only for single-threaded applications, and
10601 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
10602 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10603 (LIBES): Use it.
10604 * callproc.c (Fcall_process):
10605 * process.c (create_process):
10606 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10607 Use pthread_sigmask, not sigprocmask.
123403e4 10608
1b854618
JD
106092011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10610
10611 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10612 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10613 wrong (Bug#8591).
10614
3fe4b549
JD
106152011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10616
0ce7e563
JD
10617 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10618 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10619 (xg_hide_tooltip): Fix comment.
10620
3fe4b549
JD
10621 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10622 in registerServicesMenuSendTypes.
10623 (validRequestorForSendType): Don't check ns_return_types.
10624
10625 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10626 ns_return_type.
10627
5df75e47
JR
106282011-07-08 Jason Rumney <jasonr@gnu.org>
10629
22610910
JR
10630 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10631 SH_SHOW for hidden windows (Bug#5482).
10632
5df75e47
JR
10633 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10634 frame struct members of non-existent frames (Bug#6284).
10635
699c10bd
JD
106362011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10637
4393663b
JD
10638 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10639 variable firstTime not needed on OSX >= 10.6.
10640 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10641 >= 10.5. Use setKnobProportion, setDoubleValue.
10642
10643 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10644 (MAC_OS_X_VERSION_10_5): Define if not defined.
10645 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10646 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10647 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10648
10649 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 10650 cString and lossyCString on OSX >= 10.4.
4393663b 10651
58179cce 10652 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
10653 sizeToFit on OSX >= 10.2.
10654
10655 * nsimage.m (allocInitFromFile): Don't use deprecated method
10656 bestRepresentationForDevice on OSX >= 10.6.
10657
10658 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10659 to avoid warning.
10660
10661 * emacs.c: Declare unexec_init_emacs_zone.
10662
a63e0781
JD
10663 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10664
699c10bd
JD
10665 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10666
10667 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10668 on svcsMenu (Bug#8842).
10669
10670 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10671 ns_return_types.
10672 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10673
10674 * nsterm.m (QUTF8_STRING): Declare.
10675 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10676 (validRequestorForSendType): Return type is (id).
10677 Change indexOfObjectIdenticalTo to indexOfObject.
10678 Check if we have local selection before returning self (Bug#8842).
10679 (writeSelectionToPasteboard): Put local selection into paste board
10680 if we have a local selection (Bug#8842).
10681 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10682
10683 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10684 (ns_get_local_selection): Declare.
10685
54e10184
LMI
106862011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10687
9888ff71
LMI
10688 * keymap.c (describe_map_tree): Don't insert a double newline at
10689 the end of the buffer (bug#1169) and return whether we inserted
10690 something.
10691
54e10184
LMI
10692 * callint.c (Fcall_interactively): Change "reading args" to
10693 "providing args" to try to clarify what it does (bug#1010).
10694
15fa4783
KH
106952011-07-07 Kenichi Handa <handa@m17n.org>
10696
10697 * composite.c (composition_compute_stop_pos): Ignore a static
10698 composition starting before CHARPOS (Bug#8915).
10699
10700 * xdisp.c (handle_composition_prop): Likewise.
10701
a8815b00
EZ
107022011-07-07 Eli Zaretskii <eliz@gnu.org>
10703
10704 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10705 (Bug#9015)
10706
ef7b981d 107072011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
10708
10709 * character.h (unicode_category_t): New enum type.
10710
10711 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10712 (Qchar_code_property_table): New variable.
10713 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10714 (UNIPROP_COMPRESSED_FORM_P): New macros.
10715 (char_table_ascii): Uncompress the compressed values.
10716 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10717 Uncompress the compressed values.
ac389d0c 10718 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
10719 (char_table_ref_and_range): Uncompress the compressed values.
10720 (sub_char_table_set): New arg is_uniprop. Callers changed.
10721 Uncompress the compressed values.
10722 (sub_char_table_set_range): Args changed. Callers changed.
10723 (char_table_set_range): Adjuted for the above change.
10724 (map_sub_char_table): Delete args default_val and parent. Add arg
10725 top. Give decoded values to a Lisp function.
640c8776 10726 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
10727 values to a Lisp function. Gcpro more variables.
10728 (uniprop_table_uncompress)
10729 (uniprop_decode_value_run_length): New functions.
10730 (uniprop_decoder, uniprop_decoder_count): New variables.
10731 (uniprop_get_decoder, uniprop_encode_value_character)
10732 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10733 New functions.
10734 (uniprop_encoder, uniprop_encoder_count): New variables.
10735 (uniprop_get_encoder, uniprop_table)
10736 (Funicode_property_table_internal, Fget_unicode_property_internal)
10737 (Fput_unicode_property_internal): New functions.
10738 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10739 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 10740 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
10741 char-code-property-alist.
10742
640c8776 10743 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
10744 Vunicode_category_table.
10745
640c8776 10746 * font.c (font_range): Adjust for the change of
c805dec0
KH
10747 Vunicode_category_table.
10748
76b397fb
DN
107492011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10750
10751 * m/iris4d.h: Remove file, move contents ...
10752 * s/irix6-5.h: ... here.
10753
22b4128e
PE
107542011-07-06 Paul Eggert <eggert@cs.ucla.edu>
10755
10756 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
10757 * alloc.c (mark_buffer):
10758 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10759 (clone_per_buffer_values): Don't assume that
22b4128e
PE
10760 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10761 This isn't true in general, and it's particularly not true
10762 if Emacs is configured with --with-wide-int.
10763 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10764 New macros, used in the buffer.c change.
10765
869795d6
JD
107662011-07-05 Jan Djärv <jan.h.d@swipnet.se>
10767
10768 * xsettings.c: Use both GConf and GSettings if both are available.
10769 (store_config_changed_event): Add comment.
10770 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10771 (store_tool_bar_style_changed): New functions.
5e617bc2 10772 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
10773 (struct xsettings): Move font inside HAVE_XFT.
10774 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 10775 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 10776 Move inside HAVE_XFT.
640c8776 10777 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
10778 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10779 also.
10780 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 10781 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 10782 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
10783 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10784 (parse_settings): Move check for font inside HAVE_XFT.
10785 (read_settings, apply_xft_settings): Add comment.
10786 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
10787 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
10788 call store_font_name_changed.
10789 (xft_settings_event): Add comment.
10790 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
10791 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
10792 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
10793 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
10794 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
10795 (xsettings_get_system_font, xsettings_get_system_normal_font):
10796 Add comment.
869795d6 10797
d8ed26bd
PE
107982011-07-05 Paul Eggert <eggert@cs.ucla.edu>
10799
10800 Random fixes. E.g., (random) never returned negative values.
10801 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10802 subseconds part to the entropy, as that's a bit more random.
10803 Prefer signed to unsigned, since the signedness doesn't matter and
10804 in general we prefer signed. When given a limit, use a
10805 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
10806 latter isn't right if USE_2_TAGS_FOR_INTS.
10807 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
10808 not 0..VALMASK. Don't discard "excess" bits that random () returns.
10809
cabf1cac
SM
108102011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10811
10812 * textprop.c (text_property_stickiness):
10813 Obey Vtext_property_default_nonsticky.
10814 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
10815 * w32fns.c (syms_of_w32fns):
10816 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
10817
6e9b2be9
PE
108182011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10819
10820 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
10821 This is more efficient than Ffile_directory_p and avoids a minor race.
10822
90186c68
LMI
108232011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
10824
7c301272
LMI
10825 * buffer.c (Foverlay_put): Say what the return value is
10826 (bug#7835).
10827
c4f2d8d4
LMI
10828 * fileio.c (barf_or_query_if_file_exists): Check first if the file
10829 is a directory before asking whether to use the file name
10830 (bug#7564).
ad637907
LMI
10831 (barf_or_query_if_file_exists): Make the "File is a directory"
10832 error be more correct.
c4f2d8d4 10833
90186c68
LMI
10834 * fns.c (Frequire): Remove the mention of the .gz files, since
10835 that's installation-specific, but keep the mention of
10836 `get-load-suffixes'.
10837
da64016e
PE
108382011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10839
10840 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10841 Report string overflow if the output is too long.
10842
7d47b580
JB
108432011-07-04 Juanma Barranquero <lekktu@gmail.com>
10844
a555cb87
JB
10845 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10846 (syms_of_gnutls): Remove duplicate DEFSYM for
10847 Qgnutls_bootprop_verify_hostname_error, an error for
10848 Qgnutls_bootprop_verify_error (which is no longer used).
10849
7d47b580
JB
10850 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10851 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
10852 Also (re)move comments that are misplaced or no longer relevant.
10853
1e49bfab
LMI
108542011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10855
10856 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10857
1485f4c0
CY
108582011-07-03 Chong Yidong <cyd@stupidchicken.com>
10859
10860 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10861 and background color parameters if they have been changed.
10862
a9ab721e
LMI
108632011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10864
10865 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10866
cf7cff57
PE
108672011-07-03 Paul Eggert <eggert@cs.ucla.edu>
10868
2e13213d
PE
10869 * xsettings.c (SYSTEM_FONT): Define only when used.
10870 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
10871
cf7cff57
PE
10872 * keymap.c (access_keymap_1): Now static.
10873
7a8e04f7
CY
108742011-07-02 Chong Yidong <cyd@stupidchicken.com>
10875
10876 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
10877 leave any prefix arg for the up event (Bug#1586).
10878
61352f62
LMI
108792011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
10880
69bb1ef7
LMI
10881 * lread.c (syms_of_lread): Mention single symbols defined by
10882 `defvar' or `defconst' (bug#7154).
10883
61352f62 10884 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 10885 (Frequire): Mention get-load-suffixes.
61352f62 10886
28545e04
MR
108872011-07-02 Martin Rudalics <rudalics@gmx.at>
10888
10889 * window.h (window): Remove clone_number slot.
10890 * window.c (Fwindow_clone_number, Fset_window_clone_number):
10891 Remove.
10892 (make_parent_window, make_window, saved_window)
10893 (Fset_window_configuration, save_window_save): Don't deal with
10894 clone numbers.
10895 * buffer.c (Qclone_number): Remove declaration.
10896 (sort_overlays, overlay_strings): Don't deal with clone numbers.
10897
3349e122
SM
108982011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
10899
10900 Add multiple inheritance to keymaps.
10901 * keymap.c (Fmake_composed_keymap): New function.
10902 (Fset_keymap_parent): Simplify.
10903 (fix_submap_inheritance): Remove.
10904 (access_keymap_1): New function extracted from access_keymap to handle
10905 embedded parents and handle lists of maps.
10906 (access_keymap): Use it.
10907 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
10908 (Fcopy_keymap): Handle embedded parents.
10909 (Fcommand_remapping, define_as_prefix): Simplify.
10910 (Fkey_binding): Simplify.
10911 (syms_of_keymap): Move minibuffer-local-completion-map,
10912 minibuffer-local-filename-completion-map,
10913 minibuffer-local-must-match-map, and
10914 minibuffer-local-filename-must-match-map to Elisp.
10915 (syms_of_keymap): Defsubr make-composed-keymap.
10916 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
10917 (parse_menu_item): Trivial simplification.
10918
3279eb87
GM
109192011-07-01 Glenn Morris <rgm@gnu.org>
10920
10921 * Makefile.in (SETTINGS_LIBS): Fix typo.
10922
39cb9e56 109232011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
10924
10925 * coding.c (Fencode_coding_string): Record the last coding system
10926 used, as the function doc string says (bug#8738).
10927
0949d2b6
JD
109282011-07-01 Jan Djärv <jan.h.d@swipnet.se>
10929
10930 * xsettings.c (store_monospaced_changed): Take new font as arg and
10931 check for change against current_mono_font.
10932 (EMACS_TYPE_SETTINGS): Remove this and related defines.
10933 (emacs_settings_constructor, emacs_settings_get_property)
10934 (emacs_settings_set_property, emacs_settings_class_init)
10935 (emacs_settings_init, gsettings_obj): Remove.
10936 (something_changedCB): New function for HAVE_GSETTINGS.
10937 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
10938 with value as argument.
10939 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
10940 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 10941 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
10942 "changed".
10943
10944 * xgselect.c: Add defined (HAVE_GSETTINGS).
10945 (xgselect_initialize): Ditto.
10946
10947 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
10948 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
10949 xg_select.
10950
bbc6b304
PE
109512011-07-01 Paul Eggert <eggert@cs.ucla.edu>
10952
10953 * eval.c (struct backtrace): Simplify and port the data structure.
10954 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
10955 signed bit field, as this assumption is not portable and it makes
10956 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
10957 "char debug_on_exit : 1" as this is not portable either; instead,
10958 use the portable "unsigned int debug_on_exit : 1". Remove unused
10959 member evalargs. Remove obsolete comments about cc bombing out.
10960
9851bfc5
JD
109612011-06-30 Jan Djärv <jan.h.d@swipnet.se>
10962
51bb811f 10963 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
10964 Let HAVE_GSETTINGS override HAVE_GCONF.
10965 (store_monospaced_changed): New function.
10966 (EMACS_SETTINGS): A new type derived from GObject to handle
10967 GSettings notifications.
10968 (emacs_settings_constructor, emacs_settings_get_property)
10969 (emacs_settings_set_property, emacs_settings_class_init):
10970 New functions.
10971 (gsettings_client, gsettings_obj): New variables.
10972 (GSETTINGS_SCHEMA): New define.
10973 (something_changedCB): Call store_monospaced_changed.
10974 (init_gsettings): New function.
10975 (xsettings_initialize): Call init_gsettings.
10976 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
10977 to NULL.
10978
640c8776 10979 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
10980 GCONF_CFLAGS/LIBS.
10981
5386012d
MR
109822011-06-29 Martin Rudalics <rudalics@gmx.at>
10983
10984 * window.c (resize_root_window, grow_mini_window)
10985 (shrink_mini_window): Rename Qresize_root_window to
10986 Qwindow_resize_root_window and Qresize_root_window_vertically to
10987 Qwindow_resize_root_window_vertically.
10988
f13e0b08
PE
109892011-06-28 Paul Eggert <eggert@cs.ucla.edu>
10990
10991 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
10992
94515237
JB
109932011-06-27 Juanma Barranquero <lekktu@gmail.com>
10994
10995 * makefile.w32-in: Redesign dependencies so they reflect more
10996 clearly which files are directly included by each source file,
10997 and not through other includes.
10998
e43b6e43
MR
109992011-06-27 Martin Rudalics <rudalics@gmx.at>
11000
11001 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11002 (sort_overlays, overlay_strings): When an overlay's clone number
11003 matches the window's clone number process the overlay even if
11004 the overlay's window property doesn't match the current window.
11005
d68443dc
MR
11006 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11007 (Fwindow_hchild): Rename to Fwindow_left_child.
11008 (Fwindow_next): Rename to Fwindow_next_sibling.
11009 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
11010 (resize_window_check): Rename to window_resize_check.
11011 (resize_window_apply): Rename to window_resize_apply.
11012 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11013 (Fdelete_other_windows_internal, resize_frame_windows)
11014 (Fsplit_window_internal, Fdelete_window_internal)
11015 (grow_mini_window, shrink_mini_window)
11016 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 11017
c7e73be5
JD
110182011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11019
11020 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11021 (emacs_fixed_set_min_size): Remove.
11022 (emacs_fixed_new): Take frame as argument.
11023
11024 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11025 (_EmacsFixedPrivate): Remove minwidth/height.
11026 Add struct frame *f.
11027 (emacs_fixed_init): Initialize priv->f.
11028 (get_parent_class, emacs_fixed_set_min_size): Remove.
11029 (emacs_fixed_new): Set priv->f to argument.
11030 (emacs_fixed_get_preferred_width)
11031 (emacs_fixed_get_preferred_height): Use min_width/height from
11032 frames size_hint to set minimum and natural (Bug#8919).
11033 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11034 and use min_width/height from frames size_hint to set
11035 min_width/height (Bug#8919).
11036
11037 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
11038 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11039 Fix indentation.
c7e73be5 11040
cf99dcf8
EZ
110412011-06-26 Eli Zaretskii <eliz@gnu.org>
11042
11043 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11044 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11045 called at ZV.
11046
029529ac
CY
110472011-06-26 Chong Yidong <cyd@stupidchicken.com>
11048
11049 * process.c (wait_reading_process_output): Bypass select if
11050 waiting for a cell while ignoring keyboard input, and input is
11051 pending. Suggested by Jan Djärv (Bug#8869).
11052
7a7ef429
PE
110532011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11054
11055 Use gnulib's dup2 module instead of rolling our own.
11056 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11057
11fdef7d 110582011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
11059
11060 * dispnew.c (scrolling_window): Before scrolling, turn off a
11061 mouse-highlight in the window being scrolled.
11062
cd3520a4
JB
110632011-06-24 Juanma Barranquero <lekktu@gmail.com>
11064
11065 Move DEFSYM to lisp.h and use everywhere.
11066
11067 * character.h (DEFSYM): Move declaration...
11068 * lisp.h (DEFSYM): ...here.
11069
11070 * gnutls.c:
11071 * minibuf.c:
11072 * w32menu.c:
11073 * w32proc.c:
11074 * w32select.c: Don't include character.h.
11075
11076 * alloc.c (syms_of_alloc):
11077 * buffer.c (syms_of_buffer):
11078 * bytecode.c (syms_of_bytecode):
11079 * callint.c (syms_of_callint):
11080 * casefiddle.c (syms_of_casefiddle):
11081 * casetab.c (init_casetab_once):
11082 * category.c (init_category_once, syms_of_category):
11083 * ccl.c (syms_of_ccl):
11084 * cmds.c (syms_of_cmds):
11085 * composite.c (syms_of_composite):
11086 * dbusbind.c (syms_of_dbusbind):
11087 * dired.c (syms_of_dired):
11088 * dispnew.c (syms_of_display):
11089 * doc.c (syms_of_doc):
11090 * editfns.c (syms_of_editfns):
11091 * emacs.c (syms_of_emacs):
11092 * eval.c (syms_of_eval):
11093 * fileio.c (syms_of_fileio):
11094 * fns.c (syms_of_fns):
11095 * frame.c (syms_of_frame):
11096 * fringe.c (syms_of_fringe):
11097 * insdel.c (syms_of_insdel):
11098 * keymap.c (syms_of_keymap):
11099 * lread.c (init_obarray, syms_of_lread):
11100 * macros.c (syms_of_macros):
11101 * msdos.c (syms_of_msdos):
11102 * print.c (syms_of_print):
11103 * process.c (syms_of_process):
11104 * search.c (syms_of_search):
11105 * sound.c (syms_of_sound):
11106 * syntax.c (init_syntax_once, syms_of_syntax):
11107 * terminal.c (syms_of_terminal):
11108 * textprop.c (syms_of_textprop):
11109 * undo.c (syms_of_undo):
11110 * w32.c (globals_of_w32):
11111 * window.c (syms_of_window):
11112 * xdisp.c (syms_of_xdisp):
11113 * xfaces.c (syms_of_xfaces):
11114 * xfns.c (syms_of_xfns):
11115 * xmenu.c (syms_of_xmenu):
11116 * xsettings.c (syms_of_xsettings):
11117 * xterm.c (syms_of_xterm): Use DEFSYM.
11118
4228cf16
TZ
111192011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11120
cd3520a4 11121 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 11122
7fcccf1e
PE
111232011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11124
7efb4e0e
PE
11125 Integer and buffer overflow fixes (Bug#8873).
11126
ff5844ad
PE
11127 * print.c (printchar, strout): Check for string overflow.
11128 (PRINTPREPARE, printchar, strout):
11129 Don't set size unless allocation succeeds.
11130
90532f02
PE
11131 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11132 for sizes. Check for string overflow more accurately.
11133 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11134
6d84508d
PE
11135 * macros.c: Integer and buffer overflow fixes.
11136 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11137 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11138 Use ptrdiff_t, not int, for sizes.
11139 Don't increment bufsize until after realloc succeeds.
11140 Check for size-calculation overflow.
11141 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11142
437b2cb4
PE
11143 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11144
8b9ac8b4
PE
11145 * lread.c: Integer overflow fixes.
11146 (read_integer): Radix is now EMACS_INT, not int,
11147 to improve quality of diagnostics for out-of-range radices.
11148 Calculate buffer size correctly for out-of-range radices.
11149 (read1): Check for integer overflow in radices, and in
11150 read-circle numbers.
82cb60d3
PE
11151 (read_escape): Avoid int overflow.
11152 (Fload, openp, read_buffer_size, read1)
11153 (substitute_object_recurse, read_vector, read_list, map_obarray):
11154 Use ptrdiff_t, not int, for sizes.
11155 (read1): Use EMACS_INT, not int, for sizes.
20270765 11156 Check for size overflow.
8b9ac8b4 11157
7fcccf1e
PE
11158 * image.c (cache_image): Check for size arithmetic overflow.
11159
bfbbd7e7
PE
11160 * lread.c: Integer overflow issues.
11161 (saved_doc_string_size, saved_doc_string_length)
11162 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11163 Now ptrdiff_t, not int.
11164 (read1): Don't assume doc string length fits in int. Check for
11165 out-of-range doc string lengths.
11166 (read_list): Don't assume file position fits in int.
39019e54 11167 (read_escape): Check for hex character overflow.
bfbbd7e7 11168
4e323265
LL
111692011-06-22 Leo Liu <sdl.web@gmail.com>
11170
11171 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11172 Move to minibuffer.el.
11173
85fece3e
PE
111742011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11175
20b84ce9 11176 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
11177 The following patches are for when GLYPH_DEBUG && !XASSERT.
11178 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11179 * dispnew.c (flush_stdout):
11180 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11181 Mark as externally visible.
11182 * dispnew.c (check_window_matrix_pointers): Now static.
11183 * dispnew.c (window_to_frame_vpos):
11184 * xfns.c (unwind_create_frame):
11185 * xterm.c (x_check_font): Remove unused local.
11186 * scroll.c (CHECK_BOUNDS):
11187 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11188 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11189 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11190 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11191 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11192 Now static.
11193 (debug_method_add): Use va_list and vsprintf rather than relying
11194 on undefined behavior with wrong number of arguments.
11195 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11196 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11197 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11198 since we're not interested in debugging glyphs with old libraries.
11199 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11200 GCC 4.6.0's static checking.
11201
0766b489
PE
112022011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11203
31fd4b32
PE
11204 Integer overflow and signedness fixes (Bug#8873).
11205 A few related buffer overrun fixes, too.
11206
b79e8648
PE
11207 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11208
0766b489
PE
11209 * dispextern.h (struct face.stipple):
11210 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11211 (x_bitmap_mask, x_allocate_bitmap_record)
11212 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11213 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11214 (x_create_bitmap_from_xpm_data):
11215 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11216 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11217 (.bitmaps_last):
11218 * xfaces.c (load_pixmap):
11219 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11220 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11221 (.bitmaps_last, struct x_output.icon_bitmap):
11222 Use ptrdiff_t, not int, for bitmap indexes.
11223 (x_allocate_bitmap_record): Check for size overflow.
11224 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11225
b081724f
PE
11226 Use ptrdiff_t, not int, for overlay counts.
11227 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11228 * editfns.c (overlays_around, get_pos_property):
11229 * textprop.c (get_char_property_and_overlay):
11230 * xdisp.c (next_overlay_change, note_mouse_highlight):
11231 * xfaces.c (face_at_buffer_position):
21514da7
PE
11232 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11233 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11234 (Fnext_overlay_change, Fprevious_overlay_change)
11235 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 11236 Use ptrdiff_t, not int, for sizes.
21514da7 11237 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 11238
3de73e5e
PE
11239 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11240
2606c57b
PE
11241 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11242 (x_session_initialize): Do not assume string length fits in int.
11243
aaafe47a
PE
11244 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11245 This is unlikely, but can occur if DPI is outlandish.
11246
2674ddc8 11247 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
11248 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11249
28154962
PE
11250 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11251 * xrdb.c (magic_file_p, search_magic_path):
11252 Omit last arg SUFFIX; it was always 0. All callers changed.
11253 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11254
7de51af5
PE
11255 * xfont.c (xfont_match): Avoid need for strlen.
11256
25ed6cc3
PE
11257 * xfns.c: Don't assume strlen fits in int.
11258 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11259
4eab31dd
PE
11260 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11261 not unsigned long, as we prefer signed integers. All callers changed.
11262 Detect integer overflow in repeat count.
11263 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 11264 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 11265
171e2a58
PE
11266 * termcap.c: Don't assume sizes fit in int and never overflow.
11267 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11268 (gobble_line): Check for size-calculation overflow.
11269
ad39faca 11270 * minibuf.c (Fread_buffer):
6e5bb2dc 11271 * lread.c (intern, intern_c_string):
74ca2eb3
PE
11272 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11273 Don't assume string length fits in int.
11274
52c61c22 11275 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
11276 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11277
b5b8c9e5
PE
11278 * font.c: Don't assume string length fits in int.
11279 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11280 Use ptrdiff_t, not int.
ccd6111c
PE
11281 (font_intern_prop): Don't assume string length fits in int.
11282 Don't assume integer property fits in fixnum.
11283 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 11284
882f0d81 11285 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 11286 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
11287 Reformulate so as not to need the command string.
11288 Invoke gzip -cd rather than gunzip, as it's more portable.
11289 (lock_info_type, lock_file_1, lock_file):
11290 Don't assume pid_t and time_t fit in unsigned long.
11291 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11292 (current_lock_owner): Prefer signed type for sizes.
11293 Use memcpy, not strncpy, where memcpy is what is really wanted.
11294 Don't assume (via atoi) that time_t and pid_t fit in int.
11295 Check for time_t and/or pid_t out of range, e.g., via a network share.
11296 Don't alloca where an auto var works fine.
11297
93f4cf88
PE
11298 * fileio.c: Fix some integer overflow issues.
11299 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11300 Don't assume string length fits in int.
11301 (directory_file_name): Don't assume string length fits in long.
11302 (make_temp_name): Don't assume pid fits in int, or that its print
11303 length is less than 20.
11304
f3e92b69
PE
11305 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11306
1bfdaf10
PE
11307 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11308
35016e9a
PE
11309 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11310
3d1e65a1
PE
11311 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11312 We prefer signed integers, even for size calculations.
11313
0b963a93
PE
11314 * emacs.c: Don't assume string length fits in 'int'.
11315 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11316 (main): Don't invoke strlen when not needed.
11317
573f4b54
PE
11318 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11319 (XD_DEBUG_MESSAGE): Don't waste a byte.
11320
989f33ba
PE
11321 * callproc.c (getenv_internal_1, getenv_internal)
11322 (Fgetenv_internal):
965d34eb
PE
11323 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11324
e4d29b33
PE
11325 * lread.c (invalid_syntax): Omit length argument.
11326 All uses changed. This doesn't fix a bug, but it simplifies the
11327 code away from its former Hollerith-constant appearance, and it's
11328 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 11329 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 11330
eb49b136
PE
11331 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11332 This didn't break anything, but it didn't help either.
11333 It's confusing to put a bogus integer in a place where the actual
11334 value does not matter.
9f62aeb1 11335 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 11336 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 11337
15375a22
PE
11338 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11339 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11340 implementation.
b61cc01c
PE
11341 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11342 We prefer signed types, and the value cannot exceed the EMACS_INT
11343 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
11344 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11345 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11346 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 11347
53b2623d
PE
11348 * indent.c (sane_tab_width): New function.
11349 (current_column, scan_for_column, Findent_to, position_indentation)
11350 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 11351 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 11352
51cab52b 11353 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 11354
f2ed8a70
PE
11355 * lisp.h (lint_assume): New macro.
11356 * composite.c (composition_gstring_put_cache):
11357 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11358
abe80cc6
PE
11359 * editfns.c, insdel.c:
11360 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 11361
b02c740e
PE
11362 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11363
ebc96716
PE
11364 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11365
b4e50fa0 11366 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 11367 Use much-faster test for byte-length change.
311d5d7c 11368 Don't assume string byte-length fits in 'int'.
a4cf38e4 11369 Check that character arg fits in 'int'.
85461888 11370 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 11371
c0c1ee9f
PE
11372 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11373
a498d7f4
PE
11374 * fns.c (concat): Catch string overflow earlier.
11375 Do not rely on integer wraparound.
11376
51cab52b
PE
11377 * dispextern.h (struct it.overlay_strings_charpos)
11378 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
11379 * xdisp.c (forward_to_next_line_start)
11380 (back_to_previous_visible_line_start)
11381 (reseat_at_next_visible_line_start, next_element_from_buffer):
11382 Don't arbitrarily truncate the value of 'selective' to int.
11383
76031fad
PE
11384 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11385
5eb55db9
PE
11386 * composite.c: Don't truncate sizes to 'int'.
11387 (composition_gstring_p, composition_reseat_it)
11388 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
11389 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11390 not EMACS_UINT, for indexes.
5eb55db9 11391
0703a717
PE
11392 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11393
d6202519
PE
11394 * buffer.c: Include <verify.h>.
11395 (struct sortvec.priority, struct sortstr.priority):
8961a454 11396 Now EMACS_INT, not int.
c20998a7 11397 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
11398 (struct sortstr.size, record_overlay_string)
11399 (struct sortstrlist.size, struct sortlist.used):
11400 Don't truncate size to int.
11401 (record_overlay_string): Check for size-calculation overflow.
d6202519 11402 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 11403
d5a19415
JM
114042011-06-22 Jim Meyering <meyering@redhat.com>
11405
029529ac 11406 Don't leak an XBM-image-sized buffer
d5a19415
JM
11407 * image.c (xbm_load): Free the image buffer after using it.
11408
a9041e6c
PE
114092011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11410
11411 Port to Sun C.
11412 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11413 that Sun C diagnosed.
11414 * fns.c (secure_hash): Fix pointer signedness issue.
11415 * intervals.c (static_offset_intervals): New function.
11416 (offset_intervals): Use it.
11417
7f3f739f
LL
114182011-06-21 Leo Liu <sdl.web@gmail.com>
11419
11420 * deps.mk (fns.o):
11421 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11422 sha512.h.
11423
11424 * fns.c (secure_hash): Rename from crypto_hash_function and change
11425 the first arg to accept symbols.
5b66d427 11426 (Fsecure_hash): New primitive.
7f3f739f
LL
11427 (syms_of_fns): New symbols.
11428
76147d94
DD
114292011-06-20 Deniz Dogan <deniz@dogan.se>
11430
11431 * process.c (Fset_process_buffer): Clarify return value in
11432 docstring.
11433
7d7d0045
CY
114342011-06-18 Chong Yidong <cyd@stupidchicken.com>
11435
11436 * dispnew.c (add_window_display_history): Use BVAR.
11437
11438 * xdisp.c (debug_method_add): Use BVAR.
11439 (check_window_end, dump_glyph_matrix, dump_glyph)
11440 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11441
11442 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11443 Likewise.
11444
11445 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11446 check till after the cache is created in init_frame_faces.
11447
ff2bc410
SM
114482011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11449
11450 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11451
28177add
PE
114522011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11453
dd3482fe
PE
11454 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11455 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11456 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11457
393d71f3 11458 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
11459 * fileio.c (Finsert_file_contents):
11460 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11461 Remove the old (too-loose) buffer overflow checks.
11462 They weren't needed, since make_gap checks for buffer overflow.
11463 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11464 The old code merely checked for Emacs fixnum overflow, and relied
11465 on undefined (wraparound) behavior. The new code avoids undefined
11466 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11467
2e6813b0 11468 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
11469 Tune. Don't use wider integers than needed. Don't use alloca.
11470 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 11471
599a9e4f
PE
11472 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11473
99561444
PE
11474 * insdel.c, lisp.h (buffer_overflow): New function.
11475 (insert_from_buffer_1, replace_range, replace_range_2):
11476 * insdel.c (make_gap_larger):
11477 * editfns.c (Finsert_char):
11478 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11479
28177add
PE
11480 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11481
e69dafad
PE
114822011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11483
4baa020d 11484 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 11485
b1c46f02
PE
11486 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11487 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11488
e69dafad
PE
11489 * fileio.c: Don't assume EMACS_INT fits in off_t.
11490 (emacs_lseek): New static function.
11491 (Finsert_file_contents, Fwrite_region): Use it.
11492 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11493
566684ea
PE
11494 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11495
e6966cd6
PE
11496 * fns.c: Don't overflow int when computing a list length.
11497 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11498 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11499 truncation on 64-bit hosts. Check for QUIT every
11500 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11501 faster and is responsive enough.
11502 (Flength): Report an error instead of overflowing an integer.
11503 (Fsafe_length): Return a float if the value is not representable
11504 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 11505 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 11506 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 11507
dd0b0efb
PE
11508 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11509 (header_size, word_size): New constants.
11510 (allocate_vectorlike): Don't check size overflow here.
11511 (allocate_vector): Check it here instead, since this is the only
11512 caller of allocate_vectorlike that could cause overflow.
11513 Check that the new vector's length is representable as a fixnum.
11514
86fe5cfe
PE
11515 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11516 The previous code was bogus. For example, next_almost_prime (32)
11517 returned 39, which is undesirable as it is a multiple of 3; and
11518 next_almost_prime (24) returned 25, which is a multiple of 5 so
11519 why was the code bothering to check for multiples of 7?
11520
80e88859
PE
11521 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11522
4a2f0ad6
PE
11523 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11524
f66c7cf8
PE
11525 Variadic C functions now count arguments with ptrdiff_t.
11526 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11527 Back then I didn't know that the Emacs coding style prefers signed int.
11528 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
11529 were being counted with int, which may truncate counts on 64-bit
11530 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
11531 * lisp.h (struct Lisp_Subr.function.aMANY)
11532 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11533 Arg counts are now ptrdiff_t, not size_t.
11534 All variadic functions and their callers changed accordingly.
11535 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11536 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11537 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11538 * callint.c (Fcall_interactively): Check arg count for overflow,
11539 to avoid potential buffer overrun. Use signed char, not 'int',
11540 for 'varies' array, so that we needn't bother to check its size
11541 calculation for overflow.
11542 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11543 * eval.c (apply_lambda):
11544 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11545 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11546 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11547
a1759b76
PE
11548 * callint.c (Fcall_interactively): Don't use index var as event count.
11549
d96be9fc
PE
11550 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11551 * mem-limits.h (SIZE): Remove; no longer used.
11552
a690a978 11553 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 11554
578c21e6
PE
11555 Remove unnecessary casts.
11556 * xterm.c (x_term_init):
11557 * xfns.c (x_set_border_pixel):
11558 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11559 These aren't needed now that we assume ANSI C.
11560
96f53c6c
PE
11561 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11562 It's more likely to cause problems (due to unsigned overflow)
11563 than to cure them.
11564
83c77d31
PE
11565 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11566
ee2079f1
PE
11567 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11568
6da65536
PE
11569 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11570
7147c4a4
PE
11571 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11572
193e32d9
PE
11573 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11574
e5533da6
PE
11575 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11576
9910e595
PE
11577 GLYPH_CODE_FACE returns EMACS_INT, not int.
11578 * dispextern.h (merge_faces):
11579 * xfaces.c (merge_faces):
01103c44
PE
11580 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11581 Don't assume EMACS_INT fits in int.
9910e595 11582
2638320e
PE
11583 * character.h (CHAR_VALID_P): Remove unused parameter.
11584 * fontset.c, lisp.h, xdisp.c: All uses changed.
11585
045eb8d9
PE
11586 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11587
c1f134b5
PE
11588 * fns.c (concat): Minor tuning based on overflow analysis.
11589 This doesn't fix any bugs. Use int to hold character, instead
11590 of constantly refetching from Emacs object. Use XFASTINT, not
11591 XINT, for value known to be a character. Don't bother comparing
11592 a single byte to 0400, as it's always less.
11593
395fcb93 11594 * floatfns.c (Fexpt):
327eeec8
PE
11595 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11596
abbd3d23
PE
11597 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11598 for characters.
11599
684a03ef
PE
11600 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11601
0fed43f3
PE
11602 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11603 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11604 incorrectly succeed when S was a string, because 4294967386 was
11605 truncated before it was used.
11606
8fd02eb7
PE
11607 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11608 Otherwise, an out-of-range integer could cause undefined behavior
11609 on a 64-bit host.
11610
f8c86b69
PE
11611 * composite.c: Use int, not EMACS_INT, for characters.
11612 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11613 EMACS_INT, for values that are known to be in character range.
11614 This doesn't fix any bugs but is the usual style inside Emacs and
11615 may generate better code on 32-bit machines.
11616
34206dd2
PE
11617 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11618 This is for reasons similar to the recent CHAR_STRING fix.
11619 * charset.c (Fencode_char): Check that character arg is actually
11620 a character. Pass an int to ENCODE_CHAR.
11621 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11622 wider than 'int', as a compile-time check to prevent future regressions
11623 in this area.
11624
c5958d4c 11625 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
11626
11627 Make sure a 64-bit char is never passed to CHAR_STRING.
11628 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11629 by silently ignoring the top 32 bits, allowing some values
11630 that were far too large to be valid characters.
11631 * character.h: Include <verify.h>.
11632 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11633 arguments are no wider than unsigned, as a compile-time check
11634 to prevent future regressions in this area.
11635 * data.c (Faset):
01103c44 11636 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
11637 (Fsubst_char_in_region):
11638 * fns.c (concat):
11639 * xdisp.c (decode_mode_spec_coding):
11640 Adjust to CHAR_STRING's new requirement.
11641 * editfns.c (Finsert_char, Fsubst_char_in_region):
11642 * fns.c (concat): Check that character args are actually
11643 characters. Without this test, these functions did the wrong
11644 thing with wildly out-of-range values on 64-bit hosts.
11645
d37ca623
PE
11646 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11647 These casts should not be needed on 32-bit hosts, either.
11648 * keyboard.c (read_char):
11649 * lread.c (Fload): Remove casts to unsigned.
11650
ea204efb
PE
11651 * lisp.h (UNSIGNED_CMP): New macro.
11652 This fixes comparison bugs on 64-bit hosts.
11653 (ASCII_CHAR_P): Use it.
11654 * casefiddle.c (casify_object):
01103c44 11655 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
11656 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11657 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11658 * dispextern.h (FACE_FROM_ID):
11659 * keyboard.c (read_char): Use UNSIGNED_CMP.
11660
41cb286c
PE
11661 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11662 not to EMACS_INT, to avoid GCC warning.
11663
4a1b9832
PE
11664 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11665
55daad71
PE
11666 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11667 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11668 isn't needed on 32-bit machines.
8f95c75c 11669
01103c44
PE
11670 * buffer.c (Fgenerate_new_buffer_name):
11671 Use EMACS_INT for count, not int.
0ceccced 11672 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
11673
11674 * data.c (Qcompiled_function): Now static.
11675
c6f072e7
PE
11676 * window.c (window_body_lines): Now static.
11677
20ce5912
PE
11678 * image.c (gif_load): Rename local to avoid shadowing.
11679
9c4c5f81
PE
11680 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11681 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11682 * alloc.c (make_save_value): Integer argument is now of type
11683 ptrdiff_t, not int.
11684 (mark_object): Use ptrdiff_t, not int.
11685 * lisp.h (pD): New macro.
11686 * print.c (print_object): Use it.
11687
c0c5c8ae
PE
11688 * alloc.c: Use EMACS_INT, not int, to count objects.
11689 (total_conses, total_markers, total_symbols, total_vector_size)
11690 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
11691 (total_free_floats, total_floats, total_free_intervals)
11692 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
11693 Now EMACS_INT, not int. All uses changed.
11694 (Fgarbage_collect): Compute overall total using a double, so that
11695 integer overflow is less likely to be a problem. Check for overflow
11696 when converting back to an integer.
5a25e253
PE
11697 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11698 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11699 These were 'int' variables that could overflow on 64-bit hosts;
11700 they were never used, so remove them instead of repairing them.
211a0b2a 11701 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
11702 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11703 Previously, this ceilinged at INT_MAX, but that doesn't work on
11704 64-bit machines.
e46bb31a 11705 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 11706
c78baabf 11707 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 11708 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
11709 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11710 when a (possibly-narrower) signed value would do just as well.
11711 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 11712
c9d624c6
PE
11713 * alloc.c: Catch some string size overflows that we were missing.
11714 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11715 for convenience in STRING_BYTES_MAX.
11716 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11717 The definition here is exact; the one in lisp.h was approximate.
11718 (allocate_string_data): Check for string overflow. This catches
11719 some instances we weren't catching before. Also, it catches
11720 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11721 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11722 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 11723
c9d624c6
PE
11724 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11725 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 11726 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 11727
353032ce
PE
11728 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11729
2bccce07
PE
11730 * alloc.c (Fmake_string): Check for out-of-range init.
11731
0ac30604
SM
117322011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11733
11734 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11735
c195f2de
JD
117362011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11737
11738 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11739 xg_get_default_scrollbar_width.
11740
11741 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11742 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11743 (style_changed_cb): Call update_theme_scrollbar_width and call
11744 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11745 all frames (Bug#8505).
11746 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11747 Call gtk_window_set_resizable if HAVE_GTK3.
11748 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11749 and height if HAVE_GTK3 (Bug#8505).
11750 (scroll_bar_width_for_theme): New variable.
11751 (update_theme_scrollbar_width): New function.
11752 (xg_get_default_scrollbar_width): Move code to
11753 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11754 (xg_initialize): Call update_theme_scrollbar_width.
11755
11756 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11757
11758 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11759
e10ac9f1
MR
117602011-06-12 Martin Rudalics <rudalics@gmx.at>
11761
11762 * frame.c (make_frame): Call other_buffer_safely instead of
11763 other_buffer.
11764
11765 * window.c (temp_output_buffer_show): Call display_buffer with
11766 second argument Vtemp_buffer_show_specifiers and reset latter
11767 immediately after the call.
11768 (Vtemp_buffer_show_specifiers): New variable.
11769 (auto_window_vscroll_p, next_screen_context_lines)
11770 (Vscroll_preserve_screen_position): Remove leading asterisks from
11771 doc-strings.
11772
2d3c217e 117732011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 11774
7b7f97e8 11775 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
11776 * buffer.c (Qclone_number): Remove for now, as it's unused.
11777 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11778 (record_buffer): Remove unused local.
11779 * frame.c (other_visible_frames, frame_buffer_list): Now static.
11780 (set_frame_buffer_list): Remove; unused.
11781 * frame.h (other_visible_frames): Remove decl.
11782 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11783 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11784 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11785 if HAVE_GPM.
11786 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11787 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11788 Define only if HAVE_GPM.
11789 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11790 (update_hints_inhibit): Remove; never set. All uses removed.
11791 * widgetprv.h (emacsFrameClassRec): Remove decl.
11792 * window.c (delete_deletable_window): Now returns void, since it
11793 wasn't returning anything.
11794 (compare_window_configurations): Remove unused locals.
11795 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11796 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
11797 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11798 the same widths as pointers. This follows up on the 2011-05-06 patch.
11799 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11800 * xterm.h: Likewise.
11801 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11802
1384b89e
JB
118032011-06-12 Juanma Barranquero <lekktu@gmail.com>
11804
11805 * makefile.w32-in: Update dependencies.
11806 (LISP_H): Add lib/intprops.h.
11807
1100a63c
CY
118082011-06-11 Chong Yidong <cyd@stupidchicken.com>
11809
11810 * image.c (gif_load): Add animation frame delay to the metadata.
11811 (syms_of_image): Use DEFSYM. New symbol `delay'.
11812
6198ccd0
MR
118132011-06-11 Martin Rudalics <rudalics@gmx.at>
11814
11815 * window.c (delete_deletable_window): Re-add.
11816 (Fset_window_configuration): Rewrite to handle dead buffers and
11817 consequently deletable windows.
11818 (window_tree, Fwindow_tree): Remove. Supply functionality in
11819 window.el.
11820 (compare_window_configurations): Simplify code.
11821
b6e3633c
AS
118222011-06-11 Andreas Schwab <schwab@linux-m68k.org>
11823
1ab0dee5
AS
11824 * image.c (imagemagick_load_image): Fix type mismatch.
11825 (Fimagemagick_types): Likewise.
11826
b6e3633c
AS
11827 * window.h (replace_buffer_in_windows): Declare.
11828
9397e56f
MR
118292011-06-11 Martin Rudalics <rudalics@gmx.at>
11830
11831 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11832 Qclone_number. Remove external declaration of Qdelete_window.
11833 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
11834 code.
640c8776
SM
11835 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11836 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
11837 (Fother_buffer): Rewrite doc-string. Major rewrite for new
11838 buffer list implementation.
11839 (other_buffer_safely): New function.
11840 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11841 calls to replace_buffer_in_windows and
11842 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
11843 if allowed.
11844 (record_buffer): Inhibit quitting and rewrite using quittable
11845 functions. Run Qbuffer_list_update_hook if allowed.
11846 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
11847 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11848 Move switch-to-buffer to window.el.
9397e56f
MR
11849 (bury-buffer): Move to window.el.
11850 (Vbuffer_list_update_hook): New variable.
11851
11852 * lisp.h (other_buffer_safely): Add prototype in buffer.c
11853 section.
11854
11855 * window.h (resize_frame_windows): Move up in code.
11856 (Fwindow_frame): Remove EXFUN.
11857 (replace_buffer_in_all_windows): Remove prototype.
11858 (replace_buffer_in_windows_safely): Add prototype.
11859
11860 * window.c: Declare Qdelete_window static again. Move down
11861 declaration of select_count.
11862 (Fnext_window, Fprevious_window): Rewrite doc-strings.
11863 (Fother_window): Move to window.el.
11864 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11865 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11866 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11867 window.el.
11868 (replace_buffer_in_windows): Implement by calling
11869 Qreplace_buffer_in_windows.
11870 (replace_buffer_in_all_windows): Remove with some functionality
11871 moved into replace_buffer_in_windows_safely.
11872 (replace_buffer_in_windows_safely): New function.
11873 (select_window_norecord, select_frame_norecord): Move in front
11874 of run_window_configuration_change_hook. Remove now obsolete
11875 declarations.
640c8776
SM
11876 (Fset_window_buffer): Rewrite doc-string.
11877 Call Qrecord_window_buffer.
9397e56f
MR
11878 (keys_of_window): Move binding for other-window to window.el.
11879
b50691aa
CY
118802011-06-11 Chong Yidong <cyd@stupidchicken.com>
11881
11882 * dispextern.h (struct image): Replace data member, whose int_val
11883 and ptr_val fields were not used by anything, with a single
11884 lisp_val object.
11885
11886 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
11887 (gif_clear_image, gif_load, imagemagick_load_image)
11888 (gs_clear_image, gs_load): Callers changed.
11889
3f754b86
PE
118902011-06-10 Paul Eggert <eggert@cs.ucla.edu>
11891
cca69397
PE
11892 * buffer.h: Include <time.h>, for time_t.
11893 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
11894
109e28d0
PE
11895 Fix minor problems found by static checking.
11896
60737f02
PE
11897 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
11898
4b66faf3
PE
11899 Make identifiers static if they are not used in other modules.
11900 * data.c (Qcompiled_function, Qframe, Qvector):
11901 * image.c (QimageMagick, Qsvg):
11902 * minibuf.c (Qmetadata):
11903 * window.c (resize_window_check, resize_root_window): Now static.
11904 * window.h (resize_window_check, resize_root_window): Remove decls.
11905
109e28d0
PE
11906 * window.c (window_deletion_count, delete_deletable_window):
11907 Remove; unused.
46a4ce9e
PE
11908 (window_body_lines): Now static.
11909 (Fdelete_other_windows_internal): Mark vars as initialized.
11910 Make sure 'resize_failed' is initialized.
11911 (run_window_configuration_change_hook): Rename local to avoid shadowing.
11912 (resize_window_apply): Remove unused local.
11913 * window.h (delete_deletable_window): Remove decl.
11914
109e28d0 11915 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
11916 (imagemagick_load_image): Fix pointer signedness problem by changing
11917 last arg from unsigned char * to char *. All uses changed.
11918 Also, fix a local for similar reasons.
11919 Remove unused locals. Remove locals to avoid shadowing.
11920 (fn_rsvg_handle_free): Remove; unused.
11921 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 11922 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 11923
3f754b86
PE
11924 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
11925
2547adb1
CY
119262011-06-10 Chong Yidong <cyd@stupidchicken.com>
11927
11928 * image.c (gif_load): Fix omitted cast error introduced by
11929 2011-06-06 change.
11930
2c8e37d4
MR
119312011-06-10 Martin Rudalics <rudalics@gmx.at>
11932
11933 * window.h (resize_proportionally, orig_total_lines)
11934 (orig_top_line): Remove from window structure.
11935 (set_window_height, set_window_width, change_window_heights)
11936 (Fdelete_window): Remove prototypes.
11937 (resize_frame_windows): Remove duplicate declaration.
11938
440a42e3
EZ
119392011-06-10 Eli Zaretskii <eliz@gnu.org>
11940
11941 * window.h (resize_frame_windows, resize_window_check)
11942 (delete_deletable_window, resize_root_window)
11943 (resize_frame_windows): Declare prototypes.
11944
11945 * window.c (resize_window_apply): Make definition be "static" to
11946 match the prototype.
11947
562dd5e9
MR
119482011-06-10 Martin Rudalics <rudalics@gmx.at>
11949
11950 * window.c: Remove declarations of Qwindow_size_fixed,
11951 window_min_size_1, window_min_size_2, window_min_size,
11952 size_window, window_fixed_size_p, enlarge_window, delete_window.
11953 Remove static from declaration of Qdelete_window, it's
11954 temporarily needed by Fbury_buffer.
11955 (replace_window): Don't assign orig_top_line and
11956 orig_total_lines.
11957 (Fdelete_window, delete_window): Remove. Window deletion is
11958 handled by window.el.
640c8776
SM
11959 (window_loop): Remove DELETE_OTHER_WINDOWS case.
11960 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
11961 (Fdelete_other_windows): Remove. Deleting other windows is
11962 handled by window.el.
11963 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
11964 handled in window.el.
11965 (window_min_size_2, window_min_size_1, window_min_size): Remove.
11966 Window minimum sizes are handled in window.el.
11967 (shrink_windows, size_window, set_window_height)
11968 (set_window_width, change_window_heights, window_height)
11969 (window_width, CURBEG, CURSIZE, enlarge_window)
11970 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
11971 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
11972 handled in window.el.
11973 (make_dummy_parent): Rename to make_parent_window and give it a
11974 second argument horflag.
11975 (make_window): Don't set resize_proportionally any more.
11976 (Fsplit_window): Remove. Windows are split in window.el.
11977 (save_restore_action, save_restore_orig_size)
11978 (shrink_window_lowest_first, save_restore_orig_size): Remove.
11979 Resize mini windows in window.el.
11980 (grow_mini_window, shrink_mini_window): Implement by calling
11981 Qresize_root_window_vertically, resize_window_check and
11982 resize_window_apply.
640c8776
SM
11983 (saved_window, Fset_window_configuration, save_window_save):
11984 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
11985 resize_proportionally.
11986 (window_min_height, window_min_width): Move to window.el.
11987 (keys_of_window): Move bindings for delete-other-windows,
11988 split-window, delete-window and enlarge-window to window.el.
11989
11990 * buffer.c: Temporarily extern Qdelete_window.
11991 (Fbury_buffer): Temporarily call Qdelete_window instead of
11992 Fdelete_window (Fbury_buffer will move to window.el soon).
11993
11994 * frame.c (set_menu_bar_lines_1): Remove code handling
11995 orig_top_line and orig_total_lines.
11996
11997 * dispnew.c (adjust_frame_glyphs_initially): Don't use
11998 set_window_height but set heights directly.
11999 (change_frame_size_1): Use resize_frame_windows.
12000
12001 * xdisp.c (init_xdisp): Don't use set_window_height but set
12002 heights directly.
12003
640c8776
SM
12004 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12005 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
12006 run_window_configuration_change_hook.
12007
12008 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12009 instead of change_window_heights and run
12010 run_window_configuration_change_hook.
12011
1a13852e
MR
120122011-06-09 Martin Rudalics <rudalics@gmx.at>
12013
12014 * window.c (replace_window): Rename second argument REPLACEMENT to
12015 NEW. New third argument SETFLAG. Rewrite.
12016 (delete_window, make_dummy_parent): Call replace_window with
12017 third argument 1.
12018 (window_list_1): Move down in code.
12019 (run_window_configuration_change_hook): Move set_buffer part
12020 before select_frame_norecord part in order to unwind correctly.
12021 Rename count1 to count.
12022 (recombine_windows, delete_deletable_window, resize_root_window)
12023 (Fdelete_other_windows_internal)
12024 (Frun_window_configuration_change_hook, make_parent_window)
12025 (resize_window_check, resize_window_apply, Fresize_window_apply)
12026 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
12027 (Fdelete_window_internal, Fresize_mini_window_internal):
12028 New functions.
1a13852e
MR
12029 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12030
f3d1777e
MR
120312011-06-08 Martin Rudalics <rudalics@gmx.at>
12032
496e208e
MR
12033 * window.h (window): Add some new members to window structure -
12034 normal_lines, normal_cols, new_total, new_normal, clone_number,
12035 splits, nest, prev_buffers, next_buffers.
12036 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 12037 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 12038
f3d1777e
MR
12039 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12040 Remove.
496e208e
MR
12041 (make_dummy_parent): Set new members of windows structure.
12042 (make_window): Move down in code. Handle new members of window
12043 structure.
12044 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12045 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12046 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12047 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
12048 (Fset_window_next_buffers, Fset_window_clone_number):
12049 New functions.
496e208e
MR
12050 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12051 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12052 Doc-string fixes.
12053 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12054 Argument WINDOW can be now internal window too.
12055 (Fwindow_use_time): Move up in code.
12056 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12057 Rewrite doc-string.
12058 (Fset_window_configuration, saved_window)
12059 (Fcurrent_window_configuration, save_window_save): Handle new
12060 members of window structure.
b9e809c2
MR
12061 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12062 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12063 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12064 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12065 Qget_mru_window, Qresize_root_window,
12066 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12067 Qauto_buffer_name; staticpro them.
f3d1777e 12068
abde8f8c
MR
120692011-06-07 Martin Rudalics <rudalics@gmx.at>
12070
12071 * window.c (Fwindow_total_size, Fwindow_left_column)
12072 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12073 (Fwindow_list_1): New functions.
12074 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
12075 (Fwindow_width, Fscroll_left, Fscroll_right):
12076 Use window_body_cols instead of window_box_text_cols.
12077 (delete_window, Fset_window_configuration):
12078 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
12079 (delete_all_subwindows): Take a window as argument and not a
12080 structure. Rewrite.
190b47e6
MR
12081 (window_loop): Remove handling of GET_LRU_WINDOW and
12082 GET_LARGEST_WINDOW.
12083 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
12084
12085 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
12086 window_box_text_cols. delete_all_subwindows now takes a
12087 Lisp_Object as argument.
abde8f8c 12088
640c8776
SM
12089 * indent.c (compute_motion, Fcompute_motion):
12090 Use window_body_cols instead of window_box_text_cols.
abde8f8c 12091
fa8a67e6
MR
12092 * frame.c (delete_frame): Call delete_all_subwindows with root
12093 window as argument.
12094
a54e3482
DC
120952011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12096
12097 * fns.c (Fputhash): Document return value.
12098
60002bf5
CY
120992011-06-06 Chong Yidong <cyd@stupidchicken.com>
12100
12101 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12102
0c671da6 121032011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 12104
b862a52a 12105 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 12106
be44ca6c
PE
12107 Check for overflow when converting integer to cons and back.
12108 * charset.c (Fdefine_charset_internal, Fdecode_char):
12109 Use cons_to_unsigned to catch overflow.
12110 (Fencode_char): Use INTEGER_TO_CONS.
12111 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12112 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12113 * data.c (long_to_cons, cons_to_long): Remove.
12114 (cons_to_unsigned, cons_to_signed): New functions.
12115 These signal an error for invalid or out-of-range values.
12116 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12117 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12118 * font.c (Ffont_variation_glyphs):
12119 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12120 * lisp.h: Include <intprops.h>.
12121 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12122 (cons_to_signed, cons_to_unsigned): New decls.
12123 (long_to_cons, cons_to_long): Remove decls.
12124 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12125 (Fprimitive_undo): Use CONS_TO_INTEGER.
12126 * xfns.c (Fx_window_property): Likewise.
12127 * xselect.c: Include <limits.h>.
12128 (x_own_selection, selection_data_to_lisp_data):
12129 Use INTEGER_TO_CONS.
12130 (x_handle_selection_request, x_handle_selection_clear)
12131 (x_get_foreign_selection, Fx_disown_selection_internal)
12132 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12133 (lisp_data_to_selection_data): Use cons_to_unsigned.
12134 (x_fill_property_data): Use cons_to_signed.
12135 Report values out of range.
12136
d1f3d2af
PE
12137 Check for buffer and string overflow more precisely.
12138 * buffer.h (BUF_BYTES_MAX): New macro.
12139 * lisp.h (STRING_BYTES_MAX): New macro.
12140 * alloc.c (Fmake_string):
12141 * character.c (string_escape_byte8):
12142 * coding.c (coding_alloc_by_realloc):
12143 * doprnt.c (doprnt):
12144 * editfns.c (Fformat):
12145 * eval.c (verror):
12146 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12147 since they may not be the same number.
12148 * editfns.c (Finsert_char):
12149 * fileio.c (Finsert_file_contents):
12150 Likewise for BUF_BYTES_MAX.
12151
dd52fcea
PE
12152 * image.c: Use ptrdiff_t, not int, for sizes.
12153 (slurp_file): Switch from int to ptrdiff_t.
12154 All uses changed.
12155 (slurp_file): Check that file size fits in both size_t (for
12156 malloc) and ptrdiff_t (for sanity and safety).
12157
7f9bbdbb
PE
12158 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12159 if b->modtime has its maximal value.
12160
dfe18f82
PE
12161 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12162
84acfcf0
PE
12163 Don't assume time_t can fit into int.
12164 * buffer.h (struct buffer.modtime): Now time_t, not int.
12165 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12166 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12167
ccd9a01a
PE
12168 Minor fixes for signed vs unsigned integers.
12169 * character.h (MAYBE_UNIFY_CHAR):
12170 * charset.c (maybe_unify_char):
12171 * keyboard.c (read_char, reorder_modifiers):
12172 XINT -> XFASTINT, since the integer must be nonnegative.
12173 * ftfont.c (ftfont_spec_pattern):
12174 * keymap.c (access_keymap, silly_event_symbol_error):
12175 XUINT -> XFASTINT, since the integer must be nonnegative.
12176 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12177 since it makes no difference and we prefer signed.
12178 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12179 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12180 nonnegative.
12181
d6d100dd
SM
121822011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12183
12184 * window.h (Fwindow_frame): Declare.
12185
2b6148e4
PE
121862011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12187
12188 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12189 (SPARE_MEMORY): Always define.
12190 (LARGE_REQUEST): Remove.
12191 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12192
f230ecc9
MR
121932011-06-06 Martin Rudalics <rudalics@gmx.at>
12194
727e958e
MR
12195 * lisp.h: Move EXFUNS for Fframe_root_window,
12196 Fframe_first_window and Fset_frame_selected_window to window.h.
12197
12198 * window.h: Move EXFUNS for Fframe_root_window,
12199 Fframe_first_window and Fset_frame_selected_window here from
12200 lisp.h.
12201
12202 * frame.c (Fwindow_frame, Fframe_first_window)
12203 (Fframe_root_window, Fframe_selected_window)
12204 (Fset_frame_selected_window): Move to window.c.
12205 (Factive_minibuffer_window): Move to minibuf.c.
12206 (Fother_visible_frames_p): New function.
12207
12208 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12209
f230ecc9
MR
12210 * window.c (decode_window, decode_any_window): Move up in code.
12211 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12212 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
12213 (Fwindow_buffer): Move up and rewrite doc-string.
12214 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12215 (Fwindow_prev): New functions.
727e958e
MR
12216 (Fwindow_frame): Move here from frame.c. Accept any window as
12217 argument.
12218 (Fframe_root_window, Fframe_first_window)
12219 (Fframe_selected_window): Move here from frame.c. Accept frame
12220 or arbitrary window as argument. Update doc-strings.
12221 (Fminibuffer_window): Move up in code.
12222 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
12223 (Fset_frame_selected_window): Move here from frame.c.
12224 Marginal rewrite.
727e958e
MR
12225 (Fselected_window, select_window, Fselect_window): Move up in
12226 code. Minor doc-string fixes.
f230ecc9 12227
4d09bcf6
PE
122282011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12229
12230 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12231 Do not assume that spare memory exists; that assumption is valid
12232 only if SYSTEM_MALLOC.
12233 (LARGE_REQUEST): New macro, so that the issue of large requests
12234 is separated from the issue of spare memory.
12235
810928a2
AS
122362011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12237
172418ad
AS
12238 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12239 format. (Bug#8806)
12240
43f862f7
AS
12241 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12242
810928a2
AS
12243 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12244 before statements.
12245
a059fe24
JD
122462011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12247
12248 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12249
12250 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12251
12252 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12253 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12254
989bf368
JB
122552011-06-05 Juanma Barranquero <lekktu@gmail.com>
12256
12257 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12258
4b80f674
CY
122592011-06-04 Chong Yidong <cyd@stupidchicken.com>
12260
12261 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12262 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
12263 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12264 New error handlers.
4b80f674
CY
12265 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12266 Obey Vx_select_enable_clipboard_manager. Catch errors in
12267 x_clipboard_manager_save (Bug#8779).
12268 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 12269 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 12270
99a33b77 122712011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
12272
12273 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12274
99a33b77 122752011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
12276
12277 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12278 in the current matrix if keep_current_p is non-zero.
12279
8264569d
EZ
122802011-06-04 Eli Zaretskii <eliz@gnu.org>
12281
12282 * bidi.c (bidi_level_of_next_char): Fix last change.
12283
57f97249
EZ
122842011-06-03 Eli Zaretskii <eliz@gnu.org>
12285
fec2107c 12286 Support bidi reordering of text covered by display properties.
57f97249 12287
fec2107c
EZ
12288 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12289 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12290 (bidi_cache_search, bidi_cache_iterator_state)
12291 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
12292 (bidi_level_of_next_char, bidi_move_to_visually_next):
12293 Support character positions inside a run of characters covered by a
fec2107c
EZ
12294 display string.
12295 (bidi_paragraph_init, bidi_resolve_explicit_1)
12296 (bidi_level_of_next_char): Call bidi_fetch_char and
12297 bidi_fetch_char_advance instead of FETCH_CHAR and
12298 FETCH_CHAR_ADVANCE.
12299 (bidi_init_it): Initialize new members.
12300 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12301 definitions.
12302 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12303 instead of using explicit *_CHAR codes.
d6d100dd
SM
12304 (bidi_resolve_explicit, bidi_resolve_weak):
12305 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
12306 bidirectional text is supported only in multibyte buffers.
12307 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12308 it to initialize the frame_window_p member of struct bidi_it.
12309 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12310 (bidi_resolve_explicit, bidi_resolve_weak)
12311 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12312 bidi_it->nchars is non-positive.
12313 (bidi_level_of_next_char): Don't try to lookup the cache for the
12314 next/previous character if nothing is cached there yet, or if we
12315 were just reseat()'ed to a new position.
c40e2fb2 12316
0e14fe90
EZ
12317 * xdisp.c (set_cursor_from_row): Set start and stop points
12318 according to the row's direction when priming the loop that looks
12319 for the glyph on which to display cursor.
12320 (single_display_spec_intangible_p): Function deleted.
12321 (display_prop_intangible_p): Reimplement to call
12322 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
12323 Accept 3 additional arguments needed by handle_display_spec.
12324 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
12325 values: lists, `(when COND...)' forms, etc.
12326 (single_display_spec_string_p): Support property values that are
12327 lists with the argument STRING its top-level element.
12328 (display_prop_string_p): Fix the condition for processing a
12329 property that is a list to be consistent with handle_display_spec.
fec2107c 12330 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
12331 last portion of handle_display_prop.
12332 (compute_display_string_pos): Accept additional argument
12333 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12334 value of a `display' property is a "replacing spec".
12335 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12336 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12337 the display property, but just return a value indicating whether
12338 the display property will replace the characters it covers.
12339 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12340 frame_window_p members of struct bidi_it.
d6d100dd
SM
12341 (compute_display_string_pos, compute_display_string_end):
12342 New functions.
fec2107c
EZ
12343 (push_it): Accept second argument POSITION, where pop_it should
12344 jump to continue iteration.
12345 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 12346
fec2107c
EZ
12347 * keyboard.c (adjust_point_for_property): Adjust the call to
12348 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
12349
12350 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
12351 (bidi_init_it): Update prototypes.
12352 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
12353 (compute_display_string_pos, compute_display_string_end):
12354 Declare prototypes.
fec2107c
EZ
12355 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12356 EMACS_INT.
fc6f18ce 12357
40087514 123582011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 12359
57f53182
PE
12360 Malloc failure behavior now depends on size of allocation.
12361 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12362 * lisp.h: Change signatures accordingly.
12363 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12364 All callers changed. (Bug#8762)
12365
12366 * gnutls.c: Use Emacs's memory allocators.
12367 Without this change, the gnutls library would invoke malloc etc.
12368 directly, which causes problems on non-SYNC_INPUT hosts, and which
12369 runs afoul of improving memory_full behavior. (Bug#8761)
12370 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12371 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12372 xfree instead of the default malloc, realloc, free.
12373 (Fgnutls_boot): No need to check for memory allocation failure,
12374 since xmalloc does that for us.
12375
ac32cd99 12376 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
12377 * category.c (hash_get_category_set):
12378 * ccl.c (ccl_driver):
12379 * charset.c (Fdefine_charset_internal):
12380 * charset.h (struct charset.hash_index):
12381 * composite.c (get_composition_id, gstring_lookup_cache)
12382 (composition_gstring_put_cache):
12383 * composite.h (struct composition.hash_index):
12384 * dispextern.h (struct image.hash):
12385 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12386 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12387 (hashfn_equal, hashfn_user_defined, make_hash_table)
12388 (maybe_resize_hash_table, hash_lookup, hash_put)
12389 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12390 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12391 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12392 * image.c (make_image, search_image_cache, lookup_image)
12393 (xpm_put_color_table_h):
12394 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 12395 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 12396 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 12397 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
12398 * alloc.c (allocate_vectorlike):
12399 Check for overflow in vector size calculations.
12400 * ccl.c (ccl_driver):
12401 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
12402 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12403 need to be updated by these changes.
40087514
PE
12404 * fns.c (make_hash_table, maybe_resize_hash_table):
12405 Check for integer overflow with large hash tables.
0de4bb68
PE
12406 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12407 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12408 (SXHASH_REDUCE): New macro.
12409 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12410 Use it instead of discarding useful hash info with large hash values.
12411 (sxhash_float): New function.
12412 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12413 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
12414 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12415 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
12416 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12417 Adjust signatures to match updated version of code.
12418 (consing_since_gc): Now EMACS_INT, since a single hash table can
12419 use more than INT_MAX bytes.
12420
698d32e2
DN
124212011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12422
12423 Make it possible to build with GCC-4.6+ -O2 -flto.
12424
12425 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12426
fd6fa53f
SM
124272011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12428
12429 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12430 Call minibuffer-inactive-mode.
12431
864db017
JB
124322011-05-31 Juanma Barranquero <lekktu@gmail.com>
12433
12434 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12435 Update dependencies.
12436
2ad0baf4
DN
124372011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12438
12439 * data.c (init_data): Remove code for UTS, this system is not
12440 supported anymore.
12441
4fcc2638
DN
124422011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12443
12444 Don't force ./temacs to start in terminal mode.
12445
12446 * frame.c (make_initial_frame): Initialize faces in all cases, not
12447 only when CANNOT_DUMP is defined.
12448 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12449
c56e0fd5
DN
124502011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12451
12452 * dispnew.c (add_window_display_history): Use const for the string
12453 pointer. Remove declaration, not needed.
12454
333d54da 124552011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 12456
55d4c1b2 12457 Use 'inline', not 'INLINE'.
333d54da 12458 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
12459 * alloc.c, fontset.c (INLINE): Remove.
12460 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12461 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12462 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12463 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12464 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12465
738db178
DN
124662011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12467
12468 Make it possible to run ./temacs.
12469
12470 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12471 syms_of_callproc does the same thing. Remove test for
12472 "initialized", do it in the caller.
12473 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12474
620c53a6
SM
124752011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12476
12477 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12478 (read_minibuf): Use get_minibuffer.
12479 (syms_of_minibuf): Use DEFSYM.
12480 (Qmetadata): New var.
12481 * data.c (Qbuffer): Don't make it static.
12482 (syms_of_data): Use DEFSYM.
12483
e003a292
PE
124842011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12485
12486 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12487 (CCL_CODE_MIN): New macro.
12488
ed008a6d
PE
124892011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12490
3687c2ef
PE
12491 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12492
ed008a6d
PE
12493 * eval.c (Qdebug): Now static.
12494 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12495 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12496 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12497
d66c4c7c
CY
124982011-05-29 Chong Yidong <cyd@stupidchicken.com>
12499
12500 * image.c: Various fixes to ImageMagick code comments.
12501 (Fimagemagick_types): Doc fix.
12502
5fbc2025
PE
125032011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12504
0196f88a
PE
12505 Minor fixes prompted by GCC 4.6.0 warnings.
12506
12507 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12508
5fbc2025
PE
12509 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12510 (x_clipboard_manager_save_all): Move extern decl to ...
12511 * xterm.h: ... here, so that it can be checked for consistency.
12512
1dd3c2d9
CY
125132011-05-29 Chong Yidong <cyd@stupidchicken.com>
12514
12515 * xselect.c (x_clipboard_manager_save_frame)
12516 (x_clipboard_manager_save_all): New functions.
12517 (Fx_clipboard_manager_save): Lisp function deleted.
12518
12519 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12520 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12521
12522 * xterm.h: Update prototype.
12523
5ba6571d
WX
125242011-05-28 William Xu <william.xwl@gmail.com>
12525
12526 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12527 exiting (Bug#8239).
12528
3eaff834
JM
125292011-05-28 Jim Meyering <meyering@redhat.com>
12530
e1900994 12531 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
12532 * fns.c (to_uchar): Define.
12533 (crypto_hash_function): Use it to convert some newly-signed
12534 variables to unsigned, to avoid sign-extension bugs. For example,
12535 without this change, (md5 "truc") would evaluate to
12536 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12537 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 12538 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 12539
0f6990a7
PE
125402011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12541
12542 Integer overflow fixes.
c8a9ca5a 12543
08686060
PE
12544 * dbusbind.c: Serial number integer overflow fixes.
12545 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
12546 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12547 to hold a serial number that is too large for a fixnum.
12548 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12549 Check for serial numbers out of range. Decode any serial number
59568bf0 12550 that was so large that it became a float. (Bug#8722)
08686060 12551
2d1fc3c7
PE
12552 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12553 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12554 Use XFASTINT rather than XUINT when numbers are nonnegative.
12555 (xd_append_arg, Fdbus_method_return_internal):
12556 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12557 arguments, check that Lisp number is nonnegative, rather than
59568bf0 12558 silently wrapping negative numbers around. (Bug#8722)
30217ff0 12559 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 12560 (Bug#8722)
2d1fc3c7 12561
c8a9ca5a
PE
12562 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12563
519e1d69
PE
12564 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12565
6df6ae42 12566 ccl: Add integer overflow checks.
30569699
PE
12567 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12568 (IN_INT_RANGE): New macros.
12569 (ccl_driver): Use them to check for integer overflow when
12570 decoding a CCL program. Many of the new checks are whether XINT (x)
12571 fits in int; it doesn't always, on 64-bit hosts. The new version
12572 doesn't catch all possible integer overflows, but it's an
847044ea 12573 improvement. (Bug#8719)
30569699 12574
c11285dc
PE
12575 * alloc.c (make_event_array): Use XINT, not XUINT.
12576 There's no need for unsigned here.
12577
fdccd48e
PE
12578 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12579 This follows up to the 2011-05-06 change that substituted uintptr_t
12580 for EMACS_INT. This case wasn't caught back then.
12581
37910ab2
PE
12582 Rework Fformat to avoid integer overflow issues.
12583 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12584 now (part of C89). Include <verify.h>.
12585 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12586 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12587 (Fformat): Avoid the prepass trying to compute sizes; it was only
12588 approximate and thus did not catch overflow reliably. Instead, walk
12589 through the format just once, formatting and computing sizes as we go,
12590 checking for integer overflow at every step, and allocating a larger
12591 buffer as needed. Keep track separately whether the format is
12592 multibyte. Keep only the most-recently calculated precision, rather
12593 than them all. Record whether each argument has been converted to
12594 string. Use EMACS_INT, not int, for byte and char and arg counts.
12595 Support field widths and precisions larger than INT_MAX. Avoid
12596 sprintf's undefined behavior with conversion specifications such as %#d
12597 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12598 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12599 formatting out-of-range floating point numbers with int
9173deec 12600 formats. (Bug#8668)
37910ab2 12601
2e6578fb
PE
12602 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12603
0ae6bdee
PE
12604 * data.c: Avoid integer truncation in expressions involving floats.
12605 * data.c: Include <intprops.h>.
12606 (arith_driver): When there's an integer overflow in an expression
12607 involving floating point, convert the integers to floating point
12608 so that the resulting value does not suffer from catastrophic
12609 integer truncation. For example, on a 64-bit host (* 4
12610 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12611 Do not rely on undefined behavior after integer overflow.
12612
de883a70
PE
12613 merge count_size_as_multibyte, parse_str_to_multibyte
12614 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 12615 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
12616 Check for integer overflow.
12617 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12618 since it's now a duplicate of the other. This is more of
12619 a character than a buffer op, so better that it's in character.c.
12620 * fns.c, print.c: Adjust to above changes.
12621
2ff916cb
PE
126222011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12623
12624 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12625
f1b54466
PE
126262011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12627
fb1ac845
PE
12628 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12629 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12630 (x_clipboard_manager_save): Now static.
12631 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12632
f1b54466
PE
12633 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12634 (crypto_hash_function): Now static.
12635 Fix pointer signedness problems. Avoid unnecessary initializations.
12636
a9f737ee
CY
126372011-05-27 Chong Yidong <cyd@stupidchicken.com>
12638
12639 * termhooks.h (Vselection_alist): Make it terminal-local.
12640
12641 * terminal.c (create_terminal): Initialize it.
12642
12643 * xselect.c: Support for clipboard managers.
12644 (Vselection_alist): Move to termhooks.h as terminal-local var.
12645 (LOCAL_SELECTION): New macro.
12646 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12647 (symbol_to_x_atom): Remove gratuitous arg.
12648 (x_handle_selection_request, lisp_data_to_selection_data)
12649 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
12650 (x_own_selection, x_get_local_selection, x_convert_selection):
12651 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
12652 (some_frame_on_display): Delete unused function.
12653 (Fx_own_selection_internal, Fx_get_selection_internal)
12654 (Fx_disown_selection_internal, Fx_selection_owner_p)
12655 (Fx_selection_exists_p): New optional frame arg.
12656 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12657 (x_handle_selection_clear): Don't treat other terminals with the
12658 same keyboard specially. Use the terminal-local Vselection_alist.
12659 (x_clear_frame_selections): Use Frun_hook_with_args.
12660
12661 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12662
12663 * xterm.h: Add support for those atoms.
12664
e067f0c1
CY
126652011-05-26 Chong Yidong <cyd@stupidchicken.com>
12666
12667 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12668 (converted_selections, conversion_fail_tag): New global variables.
12669 (x_selection_request_lisp_error): Free the above.
12670 (x_get_local_selection): Remove unnecessary code.
12671 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
12672 of converted selections stored in converted_selections.
12673 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
12674 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12675 (x_convert_selection): New function.
12676 (x_handle_selection_event): Simplify.
12677 (x_get_foreign_selection): Don't ignore incoming requests while
12678 waiting for an answer; this will fail when we implement
12679 SAVE_TARGETS, and seems unnecessary anyway.
12680 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12681 (Vx_sent_selection_functions): Doc fix.
12682
0f4aebc0
LL
126832011-05-26 Leo Liu <sdl.web@gmail.com>
12684
12685 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12686
e61124cd
YM
126872011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12688
12689 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12690
12691 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12692 for fringe update if it has periodic bitmap.
ac389d0c 12693 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
12694 and fringe_bitmap_periodic_p.
12695
12696 * fringe.c (get_fringe_bitmap_data): New function.
12697 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12698 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12699 row. Mark glyph row for fringe update if periodicity changed.
12700
12701 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12702 for fringe update unless it has periodic bitmap.
12703
f16d9837
KH
127042011-05-25 Kenichi Handa <handa@m17n.org>
12705
12706 * xdisp.c (get_next_display_element): Set correct it->face_id for
12707 a static composition.
12708
e1b90ef6
LL
127092011-05-24 Leo Liu <sdl.web@gmail.com>
12710
12711 * deps.mk (fns.o):
12712 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12713
12714 * fns.c (crypto_hash_function, Fsha1): New function.
12715 (Fmd5): Use crypto_hash_function.
12716 (syms_of_fns): Add Ssha1.
12717
7400048f
PE
127182011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12719
12720 * gnutls.c: Remove unused macros.
12721 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12722 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12723 Remove macros that are defined and never used.
12724 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12725
abb71cf4
CY
127262011-05-22 Chong Yidong <cyd@stupidchicken.com>
12727
12728 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12729 (Fx_get_selection_internal): Minor cleanup.
12730 (Fx_own_selection_internal): Rename arguments for consistency with
12731 select.el.
12732
6307db39
PE
127332011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12734
12735 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12736
f3d4e0a4
CY
127372011-05-22 Chong Yidong <cyd@stupidchicken.com>
12738
12739 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12740
4d8ade89
YM
127412011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12742
12743 * dispnew.c (scrolling_window): Don't exclude the case that the
12744 last enabled row in the desired matrix touches the bottom boundary.
12745
32078c8d
GM
127462011-05-21 Glenn Morris <rgm@gnu.org>
12747
12748 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
12749 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12750 and add some more files.
32078c8d 12751
7285dc67
EZ
127522011-05-20 Eli Zaretskii <eliz@gnu.org>
12753
12754 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12755 report_file_error introduced by the change from 2011-05-07.
12756
89d1bd22
PE
127572011-05-20 Paul Eggert <eggert@cs.ucla.edu>
12758
12759 * systime.h (Time): Define only if emacs is defined.
12760 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12761 where the include path doesn't have X11/X.h by default. See
12762 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12763
cd394be1 127642011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
12765
12766 * composite.c (find_automatic_composition): Fix previous change.
12767
b9704ad9
GM
127682011-05-20 Glenn Morris <rgm@gnu.org>
12769
12770 * lisp.mk: New file, split from Makefile.in.
12771 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12772 (shortlisp): Remove.
12773 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12774
4a720484
GM
127752011-05-19 Glenn Morris <rgm@gnu.org>
12776
12777 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12778 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12779 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12780 (lisp): Set the order to that of loadup.el.
12781 (shortlisp): Make it a copy of $lisp.
12782 (SOME_MACHINE_LISP): Remove.
12783 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12784 Use just $shortlisp, not $SOME_MACHINE_LISP too.
12785
a28d4396
KH
127862011-05-18 Kenichi Handa <handa@m17n.org>
12787
12788 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12789 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12790 (find_automatic_composition): Mostly rewrite for efficiency.
12791
a2b1fa8e
JB
127922011-05-18 Juanma Barranquero <lekktu@gmail.com>
12793
12794 * makefile.w32-in: Update dependencies.
12795
8e1f5610
CS
127962011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
12797
12798 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 12799 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 12800
7025ee00 128012011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 12802
cdfa6eab
PE
12803 Fix some integer overflow issues, such as string length overflow.
12804
06d6db33
PE
12805 * insdel.c (count_size_as_multibyte): Check for string overflow.
12806
2b4560a8
PE
12807 * character.c (lisp_string_width): Check for string overflow.
12808 Use EMACS_INT, not int, for string indexes and lengths; in
12809 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
12810 the resulting string length overflows an EMACS_INT; instead,
12811 report a string overflow if no precision given. When checking for
12812 precision exhaustion, use a check that cannot possibly have
12813 integer overflow. (Bug#8675)
12814 * character.h (lisp_string_width): Adjust to new signature.
12815
cb93f9be
PE
12816 * alloc.c (string_overflow): New function.
12817 (Fmake_string): Use it. This doesn't change behavior, but saves
12818 a few bytes and will simplify future changes.
12819 * character.c (string_escape_byte8): Likewise.
12820 * lisp.h (string_overflow): New decl.
12821
1a1f3366
PE
12822 Fixups, following up to the user-interface timestamp change.
12823 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12824 for UI timestamps, instead of unsigned long.
9fbd6841
PE
12825 * msdos.c (mouse_get_pos): Likewise.
12826 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
12827 * w32gui.h (Time): Define by including "systime.h" rather than by
12828 declaring it ourselves. (Bug#8664)
12829
d4e3e4d3
PE
12830 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12831 * image.c (clear_image_cache): Likewise.
12832
f6a24d19
PE
12833 * term.c (term_mouse_position): Don't assume time_t wraparound.
12834
08dc5ae6
PE
12835 Be more systematic about user-interface timestamps.
12836 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
12837 and sometimes 'EMACS_UINT', to represent these timestamps.
12838 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
12839 This makes the code easier to follow, and makes it easier to catch
12840 integer overflow bugs such as Bug#8664.
12841 * frame.c (Fmouse_position, Fmouse_pixel_position):
12842 Use Time, not unsigned long, for user-interface timestamps.
12843 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12844 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12845 * keyboard.h (last_event_timestamp): Likewise.
12846 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12847 * menu.h (xmenu_show): Likewise.
12848 * term.c (term_mouse_position): Likewise.
12849 * termhooks.h (struct input_event.timestamp): Likewise.
12850 (struct terminal.mouse_position_hook): Likewise.
12851 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12852 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12853 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
12854 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12855 what it was before.
12856 * menu.h, termhooks.h: Include "systime.h", for Time.
12857
8e55734a
PE
12858 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12859 Don't assume that the difference between two unsigned long values
12860 can fit into an integer. At this point, we know button_down_time
12861 <= event->timestamp, so the difference must be nonnegative, so
12862 there's no need to cast the result if double-click-time is
12863 nonnegative, as it should be; check that it's nonnegative, just in
12864 case. This bug is triggered when events are more than 2**31 ms
86db42d2 12865 apart (about 25 days). (Bug#8664)
8e55734a 12866
841f1b75 12867 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 12868 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 12869
3e26f69c
PE
12870 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
12871 that always fit in int. Use a sentinel instead of a counter, to
12872 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
12873 * frame.h (struct frame): Use int for menu_bar_items_used
12874 instead of EMACS_INT, since it always fits in int.
3e26f69c 12875
5cc152c0
PE
12876 * menu.c (grow_menu_items): Check for int overflow.
12877
d89eb65e
PE
12878 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
12879
5235bd3e
PE
12880 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
12881 Before, the code was not consistent. These values cannot exceed
12882 2**31 - 1 so there's no need to make them unsigned.
12883 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
12884 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
12885 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
12886 as modifiers.
12887 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
12888
bc827e23
PE
12889 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
12890 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
12891 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
12892 presumably because the widths might not match.
12893
78eb494e
PE
12894 * window.c (size_window): Avoid needless test at loop start.
12895
04f2d78b
CB
128962011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
12897
12898 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
12899
d2fc7e3d 129002011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
12901
12902 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
12903
d2fc7e3d 129042011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
12905
12906 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
12907 `width' to `bar_area_x' and `bar_area_width', respectively.
12908 (x_scroll_run): Take account of fringe background extension.
12909
04f2d78b
CB
12910 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
12911 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
12912 `bar_area_width', respectively.
12913 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
12914 background extension.
12915
79b70037
GM
129162011-05-10 Jim Meyering <meyering@redhat.com>
12917
12918 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
12919
2f142cc5
JB
129202011-05-10 Juanma Barranquero <lekktu@gmail.com>
12921
12922 * image.c (Finit_image_library): Return t for built-in image types,
12923 like pbm and xbm. (Bug#8640)
12924
57679c86
AS
129252011-05-09 Andreas Schwab <schwab@linux-m68k.org>
12926
12927 * w32menu.c (set_frame_menubar): Fix submenu allocation.
12928
888c9e86
EZ
129292011-05-07 Eli Zaretskii <eliz@gnu.org>
12930
b0512a1d
EZ
12931 * w32console.c (Fset_screen_color): Doc fix.
12932 (Fget_screen_color): New function.
12933 (syms_of_ntterm): Defsubr it.
12934
7285dc67
EZ
12935 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
12936 unlink the temporary file if Fcall_process didn't create it in the
12937 first place.
12938 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
12939 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
12940 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
12941 cue to call_process_cleanup not to close that handle.
12942
4d3fcc8e
BK
129432011-05-07 Ben Key <bkey76@gmail.com>
12944
12945 * makefile.w32-in: The bootstrap-temacs rule now makes use of
12946 one of two shell specific rules, either bootstrap-temacs-CMD or
12947 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
12948 to the previous implementation of the bootstrap-temacs rule.
12949 The bootstrap-temacs-CMD rule is similar to the previous
12950 implementation of the bootstrap-temacs rule except that it
12951 makes use of the ESC_CFLAGS variable instead of the CFLAGS
12952 variable.
12953
12954 These changes, along with some changes to nt/configure.bat,
12955 nt/gmake.defs, and nt/nmake.defs, are required to extend my
12956 earlier fix to add support for --cflags and --ldflags options
12957 that include quotes so that it works whether make uses cmd or
12958 sh as the shell.
12959
b4289b64
MA
129602011-05-06 Michael Albinus <michael.albinus@gmx.de>
12961
12962 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
12963 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
12964 is a constant.
12965 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
12966 a string. Handle both cases.
12967 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
12968 (Fdbus_register_method): Use Qinvalid_function.
12969
af4c0e28
JB
129702011-05-06 Juanma Barranquero <lekktu@gmail.com>
12971
12972 * makefile.w32-in: Update dependencies.
12973 (LISP_H): Add inttypes.h and stdin.h.
12974 (PROCESS_H): Add unistd.h.
12975
c51453d9
EZ
129762011-05-06 Eli Zaretskii <eliz@gnu.org>
12977
12978 * lread.c: Include limits.h (fixes the MS-Windows build broken by
12979 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
12980
8ff0ac3c 129812011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 12982
4c4b566b
PE
12983 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
12984
aab2b9b5
PE
12985 * term.c (vfatal): Remove stray call to va_end.
12986 It's not needed and the C Standard doesn't allow it here anyway.
12987
c378da0b
PE
12988 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
12989 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
12990
288b08c7
PE
12991 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
12992 bytes.
12993
e3601888
PE
12994 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
12995
db6c0e74
PE
12996 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
12997
dd5963ea
PE
12998 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
12999
88c9450f
PE
13000 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13001
2f9442b8
PE
13002 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13003
c032b5f8
PE
13004 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13005 * charset.c (Fdefine_charset_internal): Don't initialize
13006 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 13007 32-bit int (Bug#8600).
a108c10b
PE
13008
13009 * lread.c (read_integer): Be more consistent with string-to-number.
13010 Use string_to_number to do the actual conversion; this avoids
13011 rounding errors and fixes some other screwups. Without this fix,
13012 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13013 (digit_to_number): Move earlier, for benefit of read_integer.
13014 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 13015 not a digit in any supported base. (Bug#8602)
a108c10b 13016
ad5f9eea
PE
13017 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13018
aec1708a
PE
13019 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13020 to match comment at start of function. This also removes a
13021 GCC warning about overflow in a 32+64-bit port.
13022
47be4ab5
PE
13023 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13024
371cac43
PE
13025 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13026 Reported by Stefan Monnier in
13027 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
13028 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13029 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 13030
d01a7826
PE
13031 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13032 (EMACS_UINTPTR): Likewise, with uintptr_t.
13033
7fd47d5c
PE
13034 * lisp.h: Prefer 64-bit EMACS_INT if available.
13035 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13036 on 32-bit hosts that have 64-bit int, so that they can access
13037 large files.
122b0c86
PE
13038 However, temporarily disable this change unless the temporary
13039 symbol WIDE_EMACS_INT is defined.
7fd47d5c 13040
8727937b
PE
13041 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13042
8ac068ac
PE
13043 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13044 This removes an assumption that EMACS_INT and long are the same
13045 width as pointers. The assumption is true for Emacs porting targets
13046 now, but we want to make other targets possible.
13047 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13048 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13049 In the rest of the code, change types of integers that hold casted
13050 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13051 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13052 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13053 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13054 No need to cast type when ORing.
13055 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13056 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13057 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13058 assume EMACS_INT is the same width as char *.
13059 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13060 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13061 Remove no-longer-needed casts.
13062 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13063 (xg_tool_bar_help_callback, xg_make_tool_item):
13064 Use EMACS_INTPTR to hold an integer
13065 that will be cast to void *; this can avoid a GCC warning
13066 if EMACS_INT is not the same width as void *.
13067 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13068 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13069 (current_message_1, set_message_1):
13070 Use a local to convert to proper width without a cast.
13071 * xmenu.c (dialog_selection_callback): Likewise.
13072
ede49d71
PE
13073 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13074 Also, don't assume VALBITS / RAND_BITS is less than 5,
13075 and don't rely on undefined behavior when shifting a 1 left into
13076 the sign bit.
13077 * lisp.h (get_random): Change signature to match.
13078
2f30ecd0
PE
13079 * lread.c (hash_string): Use size_t, not int, for hash computation.
13080 Normally we prefer signed values; but hashing is special, because
13081 it's better to use unsigned division on hash table sizes so that
13082 the remainder is nonnegative. Also, size_t is the natural width
13083 for hashing into memory. The previous code used 'int', which doesn't
13084 retain enough info to hash well into very large tables.
13085 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13086
2a866e7b
PE
13087 * dbusbind.c: Don't possibly lose pointer info when converting.
13088 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13089 Use XPNTR rather than XHASH, so that the high-order bits of
13090 the pointer aren't lost when converting through void *.
13091
51639eac
PE
13092 * eval.c (Fautoload): Don't double-shift a pointer.
13093
92394119
PE
13094 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13095
dbdb9a7c
JB
130962011-05-06 Juanma Barranquero <lekktu@gmail.com>
13097
13098 * gnutls.c (DEF_GNUTLS_FN):
13099 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13100
db7a0b4f
AS
131012011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13102
13103 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13104 marker. (Bug#8610)
13105
cd394be1 131062011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
13107
13108 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13109 New version that can reserve upto 2GB of heap space.
13110
f7ff1b0f 131112011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
13112
13113 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13114
639c109b
TZ
131152011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13116
13117 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13118 `gnutls_certificate_set_x509_key_file'.
13119
d2127135
JB
131202011-05-05 Juanma Barranquero <lekktu@gmail.com>
13121
13122 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13123 Update dependencies.
13124
e968f4f3
JB
131252011-05-04 Juanma Barranquero <lekktu@gmail.com>
13126
13127 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13128 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13129 Remove unused parameter `fildes'.
13130 * process.c (read_process_output, send_process): Don't pass it.
13131
84d358f0
JB
131322011-05-04 Juanma Barranquero <lekktu@gmail.com>
13133
13134 Fix previous change: the library cache is defined in w32.c.
13135 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13136 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13137
0898ca10
JB
131382011-05-04 Juanma Barranquero <lekktu@gmail.com>
13139
13140 Implement dynamic loading of GnuTLS on Windows.
13141
13142 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13143 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13144 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13145 Declare.
13146
13147 * gnutls.c (Qgnutls_dll): Define.
13148 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13149 (gnutls_*): Declare function pointers.
13150 (init_gnutls_functions): New function to initialize function pointers.
13151 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13152 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13153 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13154 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13155 (emacs_gnutls_write, emacs_gnutls_read)
13156 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13157 (Fgnutls_available_p): New function.
13158 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13159 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13160 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13161
13162 * image.c: Include w32.h.
13163 (Vimage_type_cache): Delete.
13164 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13165 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13166 (w32_delayed_load): Move to w32.c.
13167
13168 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13169
13170 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13171 (w32_delayed_load): Move from image.c. When loading a library, record
13172 its filename in the :loaded-from property of the library id.
13173 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13174 Initialize and staticpro them.
13175 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13176
13177 * process.c: Include lisp.h before w32.h, not after.
13178 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13179 instead of gnutls_record_check_pending.
13180
13181 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13182
ff4de4aa
TZ
131832011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13184
13185 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13186 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13187 as passed in.
13188
abe95abb
JD
131892011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13190
13191 * xterm.c (x_set_frame_alpha): Do not set property on anything
13192 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13193
e16e55d4
JB
131942011-05-02 Juanma Barranquero <lekktu@gmail.com>
13195
13196 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13197
bafcf6a5
JB
131982011-05-02 Juanma Barranquero <lekktu@gmail.com>
13199
13200 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13201 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13202 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13203 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13204 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13205 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13206 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13207 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13208 (Qgnutls_bootprop_callbacks_verify): Make static.
13209
e7a6747f
AS
132102011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13211
19ed11ba
AS
13212 * callproc.c: Indentation fixup.
13213
e7a6747f 13214 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
13215 (wait_for_termination, interruptible_wait_for_termination):
13216 Move after wait_for_termination_1.
e7a6747f 13217
1ef14cb4
LMI
132182011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13219
13220 * sysdep.c (interruptible_wait_for_termination): New function
13221 which is like wait_for_termination, but allows keyboard
13222 interruptions.
13223
13224 * callproc.c (Fcall_process): Add (:file "file") as an option for
13225 the STDOUT buffer.
13226 (Fcall_process_region): Ditto.
13227
330d880c
EZ
132282011-04-30 Eli Zaretskii <eliz@gnu.org>
13229
8db90b73
EZ
13230 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13231 rather than `XVECTOR (FOO)->size'.
13232
330d880c
EZ
13233 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13234 inttypes.h, as a gnulib replacement is used if it not available in
13235 system headers.
13236
15cbd324
EZ
132372011-04-21 Eli Zaretskii <eliz@gnu.org>
13238
13239 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13240 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13241 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13242
13243 * coding.c (coding_alloc_by_realloc): Error out if destination
13244 will grow beyond MOST_POSITIVE_FIXNUM.
13245 (decode_coding_emacs_mule): Abort if there isn't enough place in
13246 charbuf for the composition carryover bytes. Reserve an extra
13247 space for up to 2 characters produced in a loop.
13248 (decode_coding_iso_2022): Abort if there isn't enough place in
13249 charbuf for the composition carryover bytes.
13250
132512011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 13252
ae940cca
EZ
13253 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13254 aborting when %lld or %lll format is passed.
13255 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13256 %llo or %llx format is passed. (Bug#8545)
13257
03ab8921
EZ
13258 * window.c (window_scroll_line_based): Use a marker instead of
13259 simple variables to record original value of point. (Bug#7952)
13260
afda1437
EZ
13261 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13262 produced by %s or %c overflows available buffer space. (Bug#8545)
13263
f76dee0c
PE
132642011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13265
13266 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 13267 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 13268
fdc5744d
JB
132692011-04-28 Juanma Barranquero <lekktu@gmail.com>
13270
13271 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13272
638f053a
JB
132732011-04-28 Juanma Barranquero <lekktu@gmail.com>
13274
13275 * keyboard.c (Qdelayed_warnings_hook): Define.
13276 (command_loop_1): Run `delayed-warnings-hook'
13277 if Vdelayed_warnings_list is non-nil.
13278 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13279 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13280
d178f871
EZ
132812011-04-28 Eli Zaretskii <eliz@gnu.org>
13282
13283 * doprnt.c (doprnt): Don't return value smaller than the buffer
13284 size if the message was truncated. (Bug#8545).
13285
b124fd93
JB
132862011-04-28 Juanma Barranquero <lekktu@gmail.com>
13287
13288 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13289 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13290
e810457d
PE
132912011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13292
13293 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13294
ea51cceb
JB
132952011-04-27 Juanma Barranquero <lekktu@gmail.com>
13296
13297 * makefile.w32-in: Update dependencies.
13298
94dcfacf
EZ
132992011-04-27 Eli Zaretskii <eliz@gnu.org>
13300
13301 Improve `doprnt' and its usage. (Bug#8545)
13302 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13303 `format_end'. Remove support for %l as a conversion specifier.
13304 Don't use xrealloc. Improve diagnostics when the %l size modifier
13305 is used. Update the commentary.
13306
13307 * eval.c (verror): Simplify calculation of size_t.
13308
13309 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13310 messages.
13311
f61f41d7
PE
133122011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13313
13314 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13315 change.
13316
96fb4434
PE
133172011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13318
13319 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13320 This makes this file independent of the recent pseudovector change.
13321
671875da 133222011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 13323
69e9b5a3
PE
13324 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13325
b5f869a7 13326 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 13327 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 13328 Remove unused local.
c8926152 13329 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 13330
841a1577 13331 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
13332 GCC 4.6.0 optimizes based on type-based alias analysis.
13333 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
13334 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13335 != &v->size, and therefore "v->size = 1; b->size = 2; return
13336 v->size;" must therefore return 1. This assumption is incorrect
13337 for Emacs, since it type-puns struct Lisp_Vector * with many other
13338 types. To fix this problem, this patch adds a new type struct
f904488f 13339 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
13340 and pseudovectors, and helps optimizing compilers not get fooled
13341 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13342 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
13343 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13344 the size member.
eab3844f
PE
13345 (XSETPVECTYPE): Rewrite in terms of new macro.
13346 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13347 This is a bit clearer, and further avoids the possibility of
13348 undesirable aliasing.
13349 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 13350 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
13351 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13352 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
13353 (ASIZE): Now uses header.size rather than size.
13354 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
13355 to avoid the hassle of writing XVECTOR (foo)->header.size.
13356 (struct vectorlike_header): New type.
eab3844f
PE
13357 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13358 object, to help avoid aliasing.
13359 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13360 (SUBRP): Likewise, since Lisp_Subr is a special case.
13361 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13362 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13363 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 13364 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
13365 changed to be "header.size" and "header.next".
13366 * buffer.h (struct buffer): Likewise.
13367 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13368 * frame.h (struct frame): Likewise.
13369 * process.h (struct Lisp_Process): Likewise.
13370 * termhooks.h (struct terminal): Likewise.
13371 * window.c (struct save_window_data, struct saved_window): Likewise.
13372 * window.h (struct window): Likewise.
13373 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13374 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13375 * buffer.c (init_buffer_once): Likewise.
13376 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13377 special case.
13378 * process.c (Fformat_network_address): Use local var for size,
13379 for brevity.
13380
0df1eac5
PE
13381 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13382
847ab9d1 13383 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
13384 * data.c (atof): Remove decl; no longer used or needed.
13385 (digit_to_number): Move to lread.c.
13386 (Fstring_to_number): Use new string_to_number function, to be
13387 consistent with how the Lisp reader treats infinities and NaNs.
13388 Do not assume that floating-point numbers represent EMACS_INT
13389 without losing information; this is not true on most 64-bit hosts.
13390 Avoid double-rounding errors, by insisting on integers when
13391 parsing non-base-10 numbers, as the documentation specifies.
13392 * lisp.h (string_to_number): New decl, replacing ...
13393 (isfloat_string): Remove.
bc0a5c13 13394 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 13395 (read1): Do not accept +. and -. as integers; this
452f4150
PE
13396 appears to have been a coding error. Similarly, do not accept
13397 strings like +-1e0 as floating point numbers. Do not report
13398 overflow for integer overflows unless the base is not 10 which
13399 means we have no simple and reliable way to continue.
13400 Break out the floating-point parsing into a new
13401 function string_to_number, so that Fstring_to_number parses
13402 floating point numbers consistently with the Lisp reader.
04f2d78b 13403 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
13404 (E_CHAR, EXP_INT): Remove, replacing with ...
13405 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13406 (string_to_number): New function, replacing isfloat_string.
13407 This function checks for valid syntax and produces the resulting
13408 Lisp float number too. Rework it so that string-to-number
bc0a5c13 13409 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
13410 so that overflow for non-base-10 numbers is reported only when
13411 there's no portable and simple way to convert to floating point.
452f4150 13412
67769ffc
PE
13413 * textprop.c (set_text_properties_1): Rewrite for clarity,
13414 and to avoid GCC warning about integer overflow.
13415
c20db43f
PE
13416 * intervals.h (struct interval): Use EMACS_INT for members
13417 where EMACS_UINT might cause problems. See
13418 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13419 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13420 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13421 All uses changed.
37aa2f85
PE
13422 (offset_intervals): Tell GCC not to worry about length overflow
13423 when negating a negative length.
c20db43f 13424
2538aa2f
PE
13425 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13426 (overrun_check_free): Likewise.
13427
f2d3008d
PE
13428 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13429 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13430 word size.
13431
ec8df744
PE
13432 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13433 (gnutls_make_error): Rename local to avoid shadowing.
13434 (gnutls_emacs_global_deinit): ifdef out; not used.
13435 (Fgnutls_boot): Use const for pointer to readonly storage.
13436 Comment out unused local. Fix pointer signedness problems.
13437
640ee02d
PE
13438 * lread.c (openp): Don't stuff size_t into an 'int'.
13439 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13440 about possible signed overflow.
13441
6048fb2a
PE
13442 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13443 (GDK_KEY_g): Don't define if already defined.
13444 (xg_prepare_tooltip): Avoid pointer signedness problem.
13445 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13446
fa3c87e1
PE
13447 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13448 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13449
2172544b
PE
13450 * xfns.c (Fx_window_property): Simplify a bit,
13451 to make a bit faster and to avoid GCC 4.6.0 warning.
13452 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13453
9b821a21
PE
13454 * fns.c (internal_equal): Don't assume size_t fits in int.
13455
3c616cfa
PE
13456 * alloc.c (compact_small_strings): Tighten assertion a little.
13457
c2982e87
PE
13458 Replace pEd with more-general pI, and fix some printf arg casts.
13459 * lisp.h (pI): New macro, generalizing old pEd macro to other
13460 conversion specifiers. For example, use "...%"pI"d..." rather
13461 than "...%"pEd"...".
13462 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 13463 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
13464 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13465 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13466 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13467 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13468 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13469 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13470 64-bit hosts.
13471 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13472 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13473 * print.c (safe_debug_print, print_object): Likewise.
13474 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13475 to int.
6f04d126
PE
13476 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13477 avoiding the 0 flag, which is not portable.
c2982e87
PE
13478 * process.c (Fmake_network_process): Use pI to avoid cast.
13479 * region-cache.c (pp_cache): Likewise.
13480 * xdisp.c (decode_mode_spec): Likewise.
13481 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13482 behavior on 64-bit hosts with printf arg.
6f04d126 13483 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
13484 (x_stop_queuing_selection_requests): Likewise.
13485 (x_get_window_property): Don't truncate byte count to an 'int'
13486 when tracing.
0b432f21 13487
5e073ec7
PE
13488 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13489 here, since it parses constructs like leading '-' and spaces,
13490 which are not wanted; and it overflows with large numbers.
13491 Instead, simply match F[0-9]+, which is what is wanted anyway.
13492
36372bf9
PE
13493 * alloc.c: Remove unportable assumptions about struct layout.
13494 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13495 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13496 (allocate_vectorlike, make_pure_vector): Use the new macros,
13497 plus offsetof, to remove unportable assumptions about struct layout.
13498 These assumptions hold on all porting targets that I know of, but
13499 they are not guaranteed, they're easy to remove, and removing them
13500 makes further changes easier.
13501
0b432f21
PE
13502 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13503 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
13504 (string_overrun_cookie): Now const. Use initializers that
13505 don't formally overflow signed char, to avoid warnings.
000098c1
PE
13506 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13507 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
13508 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13509 multiple of sizeof (EMACS_INT); it need not be, if
13510 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 13511 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 13512
895009e1
JB
135132011-04-26 Juanma Barranquero <lekktu@gmail.com>
13514
13515 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13516
6a7a1b0b
TZ
135172011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13518
13519 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 13520 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
13521 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13522
841a1577 135232011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
13524
13525 * lisp.h (Qdebug): List symbol.
895009e1 13526 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
13527 * keyboard.c (debug-on-event): New variable.
13528 (handle_user_signal): Break into debugger when debug-on-event
13529 matches the current signal symbol.
13530
f2d3ba6f
DN
135312011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13532
13533 * alloc.c (check_sblock, check_string_bytes)
13534 (check_string_free_list): Convert to standard C.
13535
42ce4c63
TZ
135362011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13537
13538 * w32.c (emacs_gnutls_push): Fix typo.
13539
825cd63c
EZ
135402011-04-25 Eli Zaretskii <eliz@gnu.org>
13541
fb11d64d
EZ
13542 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13543 "cast to pointer from integer of different size".
13544
825cd63c
EZ
13545 Improve doprnt and its use in verror. (Bug#8545)
13546 * doprnt.c (doprnt): Document the set of format control sequences
13547 supported by the function. Use SAFE_ALLOCA instead of always
13548 using `alloca'.
13549
13550 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13551 is one byte too soon. Don't use xrealloc; instead xfree and
13552 xmalloc anew.
13553
e061a11b
TZ
135542011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13555
13556 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13557 callbacks stage.
13558
13559 * gnutls.c: Renamed global_initialized to
13560 gnutls_global_initialized. Added internals for the
13561 :verify-hostname-error, :verify-error, and :verify-flags
13562 parameters of `gnutls-boot' and documented those parameters in the
13563 docstring. Start callback support.
9173deec
JB
13564 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13565 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13566 on error. Return error code.
e061a11b
TZ
13567 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13568 (emacs_gnutls_read): Likewise.
13569 (Fgnutls_boot): Return handshake error code.
13570 (emacs_gnutls_handle_error): New function.
13571 (wsaerror_to_errno): Likewise.
13572
13573 * w32.h (emacs_gnutls_pull): Add prototype.
13574 (emacs_gnutls_push): Likewise.
13575
13576 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13577 (emacs_gnutls_push): Likewise.
13578
135792011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13580
13581 * process.c (wait_reading_process_output): Check if GnuTLS
13582 buffered some data internally if no FDs are set for TLS
13583 connections.
13584
13585 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13586 (LIBS): Link to USER_LIBS.
13587 ($(BLD)/gnutls.$(0)): New target.
13588
fa6996bc
EZ
135892011-04-24 Eli Zaretskii <eliz@gnu.org>
13590
eb35682e
EZ
13591 * xdisp.c (handle_single_display_spec): Rename the
13592 display_replaced_before_p argument into display_replaced_p, to
13593 make it consistent with the commentary. Fix typos in the
13594 commentary.
13595
e2ad650c
EZ
13596 * textprop.c (syms_of_textprop): Remove dead code.
13597 (copy_text_properties): Delete obsolete commentary about an
13598 interface that was deleted long ago. Fix typos in the description
13599 of arguments.
13600
1b2de274
EZ
13601 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13602 to changes in oldXMenu/XMenu.h from 2011-04-16.
13603 <menu_help_message, prev_menu_help_message>: Constify.
13604 (IT_menu_make_room): menu->help_text is now `const char **';
13605 adjust.
13606
13607 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13608 to changes in oldXMenu/XMenu.h from 2011-04-16.
13609 (struct XMenu): Declare `help_text' `const char **'.
13610
13611 * xfaces.c <Qunspecified>: Make extern again.
13612
13613 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 13614 required by POSIX.
1b2de274 13615
762b15be
EZ
13616 * doc.c (get_doc_string): Improve the format passed to `error'.
13617
13618 * doprnt.c (doprnt): Improve commentary.
13619
13620 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13621
13622 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13623 them with etags.
13624
f1052e5d
EZ
13625 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13626 changes in globals.h immediately force recompilation.
762b15be
EZ
13627 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13628 $(CURDIR)/s/ms-w32.h.
13629 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 13630
fa6996bc
EZ
13631 * character.c (Fchar_direction): Function deleted.
13632 (syms_of_character): Don't defsubr it.
13633 <char-direction-table>: Deleted.
13634
e6c3da20
EZ
136352011-04-23 Eli Zaretskii <eliz@gnu.org>
13636
13637 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13638 * doprnt.c: Include limits.h.
13639 (SIZE_MAX): New macro.
04f2d78b
CB
13640 (doprnt): Return a size_t value. 2nd arg is now size_t.
13641 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
13642 Improve overflow protection. Support `l' modifier for integer
13643 conversions. Support %l conversion. Don't assume an EMACS_INT
13644 argument for integer conversions and for %c.
13645
13646 * lisp.h (doprnt): Restore prototype.
13647
13648 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13649 $(SRC)/character.h.
13650
13651 * Makefile.in (base_obj): Add back doprnt.o.
13652
13653 * deps.mk (doprnt.o): Add back prerequisites.
13654 (callint.o): Depend on character.h.
13655
13656 * eval.c (internal_lisp_condition_case): Include the handler
13657 representation in the error message.
13658 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13659 when breaking from the loop.
13660
13661 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13662
13663 * callint.c (Fcall_interactively): When displaying error message
13664 about invalid control letter, pass the character's codepoint, not
13665 a pointer to its multibyte form. Improve display of the character
13666 in octal and display also its hex code.
13667
13668 * character.c (char_string): Use %x to display the (unsigned)
13669 codepoint of an invalid character, to avoid displaying a bogus
13670 negative value.
13671
13672 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13673 `error', not SYMBOL_NAME itself.
13674
13675 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13676 character arguments to `error'.
13677
13678 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13679 to `error' in error message about FINAL_CHAR argument. Make sure
13680 FINAL_CHAR is a character, and use %c when it is passed as
13681 argument to `error'.
13682
4ffd0d6b 136832011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
13684
13685 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13686
13687 * w32.c: Include <time.h>.
13688 (sys_localtime): New function.
13689
4ffd0d6b 136902011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
13691
13692 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13693
4ffd0d6b 13694 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 13695
4ffd0d6b 136962011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 13697
4ffd0d6b
GM
13698 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13699 zombies (Bug#8467).
aac0c6e3 13700
04c56954
EZ
137012011-04-19 Eli Zaretskii <eliz@gnu.org>
13702
13703 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13704 gl_state.e_property when gl_state.object is Qt.
13705
13706 * insdel.c (make_gap_larger): Remove limitation of buffer size
13707 to <= INT_MAX.
13708
16a43933
CY
137092011-04-18 Chong Yidong <cyd@stupidchicken.com>
13710
13711 * xdisp.c (lookup_glyphless_char_display)
13712 (produce_glyphless_glyph): Handle cons cell entry in
13713 glyphless-char-display.
13714 (Vglyphless_char_display): Document it.
13715
13716 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13717 glyphless-char-display.
13718
4581706e
CY
137192011-04-17 Chong Yidong <cyd@stupidchicken.com>
13720
13721 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13722
13723 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13724
13725 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13726 definition for no-X builds.
13727
4887c6e2 137282011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 13729
fd35b6f9
PE
13730 Static checks with GCC 4.6.0 and non-default toolkits.
13731
5c1ccb01
PE
13732 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13733
006c5daa
PE
13734 * process.c (keyboard_bit_set): Define only if SIGIO.
13735 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13736 (send_process): Repair possible setjmp clobbering.
13737
efc736d3
PE
13738 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13739
4e2fe2e6
PE
13740 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13741
f97334a2
PE
13742 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13743
4e75f29d
PE
13744 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13745 Define only if needed.
13746
90efadd1
PE
13747 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13748 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 13749 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 13750
3c647824
PE
13751 * dispextern.h (struct redisplay_interface): Rename param
13752 to avoid shadowing.
e264f262 13753 * termhooks.h (struct terminal): Likewise.
761383f4 13754 * xterm.c (xembed_send_message): Likewise.
3c647824 13755
b58c5c4a
PE
13756 * insdel.c (make_gap_smaller): Define only if
13757 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13758
cad59032
PE
13759 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13760 it.
13761
c339dc2e
PE
13762 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13763 so that we aren't warned about unused symbols.
13764
91a3e27b
PE
13765 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13766
399c71d3 13767 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 13768
8ffc96f5
PE
13769 * xfns.c (x_real_positions): Mark locals as initialized.
13770
eef9bc79
PE
13771 * xmenu.c (xmenu_show): Don't use uninitialized vars.
13772
098db9dd
PE
13773 * xterm.c: Fix problems found by static analysis with other toolkits.
13774 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
13775 (x_dispatch_event): Declare static if USE_GTK, and
13776 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 13777 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 13778 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
13779 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13780 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 13781
eb18f6cc
PE
13782 * xmenu.c (menu_help_callback): Pointer type fixes.
13783 Use const pointers when pointing at readonly data. Avoid pointer
13784 signedness clashes.
13785 (FALSE): Remove unused macro.
13786 (update_frame_menubar): Remove unused decl.
13787
1fe72bf8
PE
13788 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13789
60d9e1db
PE
13790 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13791 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13792 (single_menu_item): Rename local to avoid shadowing.
13793
39261c26
PE
13794 * keyboard.c (make_lispy_event): Remove unused local var.
13795
018c5e19
PE
13796 * frame.c, frame.h (x_get_resource_string): Bring this back, but
13797 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13798
63d2b86e
PE
13799 * bitmaps: Change bitmaps from unsigned char back to the X11
13800 compatible char. Avoid the old compiler warnings about
13801 out-of-range initializers by using, for example, '\xab' rather
13802 than 0xab.
13803
aefd87e1
PE
13804 * xgselect.c (xgselect_initialize): Check vs interface
13805 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
13806
bf501fb9
PE
13807 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
13808
e9829fdf
PE
13809 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
13810 to read-only memory.
13811
1086c095
PE
13812 * fns.c (vector): Remove; this old hack is no longer needed.
13813
2baccd04 13814 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 13815 Remove unused var.
dde42981 13816 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 13817
72391843 13818 * xrdb.c (x_load_resources): Omit unused local.
3565b346 13819
436c16df 13820 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 13821 (x_window): Rename locals to avoid shadowing.
dc5ddd85 13822 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 13823
92bb796d 13824 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 13825 (x_term_init): Remove local to avoid shadowing.
92bb796d 13826
764430a3 13827 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
13828
13829 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13830 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13831
d1dfb56c
EZ
138322011-04-16 Eli Zaretskii <eliz@gnu.org>
13833
c4354cb4
EZ
13834 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13835
d1dfb56c
EZ
13836 Fix regex.c, syntax.c and friends for buffers > 2GB.
13837 * syntax.h (struct gl_state_s): Declare character position members
13838 EMACS_INT.
13839
13840 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13841
04f2d78b
CB
13842 * textprop.c (verify_interval_modification, interval_of):
13843 Declare arguments EMACS_INT.
d1dfb56c
EZ
13844
13845 * intervals.c (adjust_intervals_for_insertion): Declare arguments
13846 EMACS_INT.
13847
13848 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13849
13850 * indent.c (Fvertical_motion): Local variable it_start is now
13851 EMACS_INT.
13852
13853 * regex.c (re_match, re_match_2, re_match_2_internal)
13854 (bcmp_translate, regcomp, regexec, print_double_string)
13855 (group_in_compile_stack, re_search, re_search_2, regex_compile)
13856 (re_compile_pattern, re_exec): Declare arguments and local
13857 variables `size_t' and `ssize_t' and return values `regoff_t', as
13858 appropriate.
13859 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13860 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13861 <compile_stack_type>: `size' and `avail' are now `size_t'.
13862
13863 * regex.h <regoff_t>: Use ssize_t, not int.
13864 (re_search, re_search_2, re_match, re_match_2): Arguments that
13865 specify buffer/string position and length are now ssize_t and
13866 size_t. Return type is regoff_t.
13867
613052cd
BK
138682011-04-16 Ben Key <bkey76@gmail.com>
13869
13870 * nsfont.m: Fixed bugs in ns_get_family and
13871 ns_descriptor_to_entity that were caused by using free to
13872 deallocate memory blocks that were allocated by xmalloc (via
13873 xstrdup). This caused Emacs to crash when compiled with
13874 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
13875 --enable-checking=xmallocoverrun). xfree is now used to
13876 deallocate these memory blocks.
13877
4170f62f 138782011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 13879
71b41406
PE
13880 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
13881
9587a89d
PE
13882 emacs_write: Accept and return EMACS_INT for sizes.
13883 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
13884 et seq.
13885 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
13886 Accept and return EMACS_INT.
13887 (emacs_gnutls_write): Return the number of bytes written on
13888 partial writes.
13889 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
13890 (emacs_read, emacs_write): Remove check for negative size, as the
13891 Emacs source code has been audited now.
9587a89d
PE
13892 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
13893 (emacs_read, emacs_write): Use it.
273a5f82
PE
13894 * process.c (send_process): Adjust to the new signatures of
13895 emacs_write and emacs_gnutls_write. Do not attempt to store
13896 a byte offset into an 'int'; it might overflow.
9587a89d 13897 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 13898
3e047f51
PE
13899 * sound.c: Don't assume sizes fit in 'int'.
13900 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 13901 Return EMACS_INT, not int.
3e047f51 13902 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
13903 Accept EMACS_INT, not int.
13904 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
13905 record read return values.
13906
cc39a9db
BK
139072011-04-15 Ben Key <bkey76@gmail.com>
13908
c9d0ec6d
JB
13909 * keyboard.c (Qundefined): Don't declare static since it is used
13910 in nsfns.m.
13911 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
13912 static since they are used in nsfont.m.
cc39a9db 13913
6c60eb9f
SM
139142011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
13915
13916 * process.c (Qprocessp): Don't declare static.
13917 * lisp.h (Qprocessp): Declare again.
13918
7990b61a
JB
139192011-04-15 Juanma Barranquero <lekktu@gmail.com>
13920
13921 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
13922
5d4cb038
PE
139232011-04-14 Paul Eggert <eggert@cs.ucla.edu>
13924
8bd7b830 13925 Improve C-level modularity by making more things 'static'.
cd64ea1d 13926
e3b27b31
PE
13927 Don't publish debugger-only interfaces to other modules.
13928 * lisp.h (safe_debug_print, debug_output_compilation_hack):
13929 (verify_bytepos, count_markers): Move decls to the only modules
13930 that need them.
13931 * region-cache.h (pp_cache): Likewise.
13932 * window.h (check_all_windows): Likewise.
13933 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
13934
5d4cb038
PE
13935 * sysdep.c (croak): Now static, if
13936 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
13937 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
13938
13939 * alloc.c (refill_memory_reserve): Now static if
13940 !defined REL_ALLOC || defined SYSTEM_MALLOC.
13941 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 13942
e87b6180
PE
13943 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
13944 Define only if USE_LUCID.
13945
ac64929e
PE
13946 * xrdb.c (x_customization_string, x_rm_string): Now static.
13947
6f37259d
PE
13948 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
13949 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
13950
1683e3ab
PE
13951 * xdisp.c (draw_row_with_mouse_face): Now static.
13952 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
13953
de9c2632
PE
13954 * window.h (check_all_windows): Mark externally visible.
13955
2b96acb7
PE
13956 * window.c (window_deletion_count): Now static.
13957
13958 * undo.c: Make symbols static if they're not exported.
13959 (last_undo_buffer, last_boundary_position, pending_boundary):
13960 Now static.
13961
50436f33
PE
13962 * textprop.c (interval_insert_behind_hooks): Now static.
13963 (interval_insert_in_front_hooks): Likewise.
13964
64520e5c
PE
13965 * term.c: Make symbols static if they're not exported.
13966 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
13967 (max_frame_lines, tty_set_terminal_modes):
13968 (tty_reset_terminal_modes, tty_turn_off_highlight):
13969 (get_tty_terminal): Now static.
13970 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
13971 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 13972 HAVE_WINDOW_SYSTEM.
64520e5c
PE
13973 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
13974 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
13975
1fa53021
PE
13976 * sysdep.c: Make symbols static if they're not exported.
13977 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
13978 Now static.
13979 (sigprocmask_set, full_mask): Remove; unused.
13980 (wait_debugging): Mark as visible.
13981 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
13982 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
13983
d4b43b22
PE
13984 * syntax.c (syntax_temp): Define only if !__GNUC__.
13985
b7c513d0
PE
13986 * sound.c (current_sound_device, current_sound): Now static.
13987
989b29ad
PE
13988 * search.c (searchbufs, searchbuf_head): Now static.
13989
13a55a78
PE
13990 * scroll.c (scroll_cost): Remove; unused.
13991 * dispextern.h (scroll_cost): Remove decl.
13992
de68a1fc
PE
13993 * region-cache.h (pp_cache): Mark as externally visible.
13994
40ccffa6
PE
13995 * process.c: Make symbols static if they're not exported.
13996 (process_tick, update_tick, create_process, chan_process):
13997 (Vprocess_alist, proc_buffered_char, datagram_access):
13998 (fd_callback_data, send_process_frame, process_sent_to): Now static.
13999 (deactivate_process): Mark defn as static, as well as decl.
14000 * lisp.h (create_process): Remove decl.
14001 * process.h (chan_process, Vprocess_alist): Remove decls.
14002
ad64fc97
PE
14003 * print.c: Make symbols static if they're not exported.
14004 (print_depth, new_backquote_output, being_printed, print_buffer):
14005 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14006 (print_interval, print_number_index, initial_stderr_stream):
14007 Now static.
14008 * lisp.h (Fprinc): Remove decl.
14009 (debug_output_compilation_hack): Mark as externally visible.
14010
adddb265
PE
14011 * sysdep.c (croak): Move decl from here to syssignal.h.
14012 * syssignal.h (croak): Put it here, so the API can be checked when
14013 'croak' is called from dissociate_if_controlling_tty.
14014
1717ede2
PE
14015 * minibuf.c: Make symbols static if they're not exported.
14016 (minibuf_save_list, choose_minibuf_frame): Now static.
14017 * lisp.h (choose_minibuf_frame): Remove decl.
14018
fa5fb2bc
PE
14019 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14020
1e3890d1
PE
14021 * lread.c: Make symbols static if they're not exported.
14022 (read_objects, initial_obarray, oblookup_last_bucket_number):
14023 Now static.
14024 (make_symbol): Remove; unused.
14025 * lisp.h (initial_obarray, make_symbol): Remove decls.
14026
8a1414fa
PE
14027 * keyboard.c: Make symbols static if they're not exported.
14028 (single_kboard, recent_keys_index, total_keys, recent_keys):
14029 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14030 (this_single_command_key_start, echoing, last_auto_save):
14031 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14032 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14033 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14034 (Vlispy_mouse_stem, double_click_count):
14035 Now static.
14036 (force_auto_save_soon): Define only if SIGDANGER.
14037 (ignore_mouse_drag_p): Now static if
14038 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14039 (print_help): Remove; unused.
14040 (stop_character, last_timer_event): Mark as externally visible.
14041 * keyboard.h (ignore_mouse_drag_p): Declare only if
14042 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14043 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14044 * lisp.h (echoing): Remove decl.
14045 (force_auto_save_soon): Declare only if SIGDANGER.
14046 * xdisp.c (redisplay_window): Simplify code, to make it more
14047 obvious that ignore_mouse_drag_p is not accessed if !defined
14048 USE_GTK && !defined HAVE_NS.
14049
93ea6e8f
PE
14050 * intervals.c: Make symbols static if they're not exported.
14051 (merge_properties_sticky, merge_interval_right, delete_interval):
14052 Now static.
14053 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14054
77382fcc
PE
14055 * insdel.c: Make symbols static if they're not exported.
14056 However, leave prepare_to_modify_buffer alone. It's never
14057 called from outside this function, but that appears to be a bug.
14058 (combine_after_change_list, combine_after_change_buffer):
4889fc82 14059 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
14060 (adjust_after_replace_noundo): Remove; unused.
14061 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 14062 (signal_before_change): Remove decls.
77382fcc 14063
9306c32e
PE
14064 * indent.c (val_compute_motion, val_vmotion): Now static.
14065
cd44d2eb
PE
14066 * image.c: Make symbols static if they're not exported.
14067 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14068 if USE_GTK.
14069 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14070 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14071
ad9a7a06
PE
14072 * fringe.c (standard_bitmaps): Now static.
14073 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14074
81626931
PE
14075 * frame.c: Make symbols static if they're not exported.
14076 (x_report_frame_params, make_terminal_frame): Now static.
14077 (get_frame_param): Now static, unless HAVE_NS.
14078 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14079 (x_get_resource_string): Remove; not used.
14080 * frame.h (make_terminal_frame, x_report_frame_params):
14081 (x_get_resource_string); Remove decls.
14082 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14083 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14084
239f9db9
PE
14085 * font.c, fontset.c: Make symbols static if they're not exported.
14086 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14087 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14088 * font.c (font_close_object): Now static.
14089 * font.h (font_close_object): Remove.
14090 * fontset.c (FONTSET_OBJLIST): Remove.
14091 (free_realized_fontset) #if-0 the body, which does nothing.
14092 (face_suitable_for_char_p): #if-0, as it's never called.
14093 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
14094 * xfaces.c (face_at_string_position):
14095 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
14096 since 0 is always ASCII.
14097
dfcf3579
PE
14098 * fns.c (weak_hash_tables): Now static.
14099
5045092b
PE
14100 * fileio.c: Make symbols static if they're not exported.
14101 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14102 (Vwrite_region_annotation_buffers): Now static.
14103
57a96f5c
PE
14104 * eval.c: Make symbols static if they're not exported.
14105 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14106 * lisp.h (backtrace_list): Remove decl.
14107
35f08c38
PE
14108 * emacs.c: Make symbols static if they're not exported.
14109 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14110 (fatal_error_code, fatal_error_signal_hook, standard_args):
14111 Now static.
14112 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14113 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14114 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14115 * lisp.h (fatal_error_signal_hook): Remove decl.
14116 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14117
f44bd759
PE
14118 * editfns.c: Move a (normally-unused) function to its only use.
14119 * editfns.c, lisp.h (get_operating_system_release): Remove.
14120 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14121 worth the hassle of breaking this out.
14122
b532497d
PE
14123 * xterm.c: Make symbols static if they're not exported.
14124 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14125 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14126 (x_destroy_window, x_delete_display):
14127 Now static.
14128 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14129 (x_mouse_leave): Remove; unused.
14130 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14131 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14132 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14133 Remove decls.
14134 (x_mouse_leave): Declare only if WINDOWSNT.
14135 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14136 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14137 USE_X_TOOLKIT.
14138
1675728f
PE
14139 * ftxfont.c: Make symbols static if they're not exported.
14140 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14141 HAVE_FREETYPE.
14142 * font.h (ftxfont_driver): Likewise.
14143
e4cebfca
PE
14144 * xfns.c: Make symbols static if they're not exported.
14145 (x_last_font_name, x_display_info_for_name):
14146 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14147 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14148 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14149 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14150 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14151 (last_show_tip_args): Now static.
14152 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14153 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14154 (x_screen_planes): Remove; unused.
14155 * dispextern.h (x_screen_planes): Remove decl.
14156
5bf46f05
PE
14157 * dispnew.c: Make symbols static if they're not exported.
14158 * dispextern.h (redraw_garbaged_frames, scrolling):
14159 (increment_row_positions): Remove.
14160 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14161 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14162 Now static.
14163 (redraw_garbaged_frames): Remove; unused.
14164
435f4c28
PE
14165 * xfaces.c: Make symbols static if they're not exported.
14166 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14167 Remove decls.
14168 * xterm.h (defined_color): Remove decls.
14169 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14170 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14171 (menu_face_changed_default, defined_color, free_realized_face):
14172 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14173 (ascii_face_of_lisp_face): Remove; unused.
14174
8524aef3
PE
14175 * xdisp.c: Make symbols static if they're not exported.
14176 * dispextern.h (scratch_glyph_row, window_box_edges):
14177 (glyph_to_pixel_coords, set_cursor_from_row):
14178 (get_next_display_element, set_iterator_to_next):
14179 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14180 (show_mouse_face): Remove decls
14181 * frame.h (message_buf_print): Likewise.
14182 * lisp.h (pop_message, set_message, check_point_in_composition):
14183 Likewise.
14184 * xterm.h (set_vertical_scroll_bar): Likewise.
14185 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14186 (message_buf_print, scratch_glyph_row, displayed_buffer):
14187 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14188 (get_next_display_element, show_mouse_face, window_box_edges):
14189 (frame_to_window_pixel_xy, check_point_in_composition):
14190 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14191 (glyph_to_pixel_coords): Remove; unused.
14192
16390cd2
PE
14193 * dired.c (file_name_completion): Now static.
14194
14195 * dbusbind.c (xd_in_read_queued_messages): Now static.
14196
a25f4dfa
PE
14197 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14198 * data.c (circular_list_error): Remove.
14199
14a9c8df
PE
14200 * commands.h (last_point_position, last_point_position_buffer):
14201 (last_point_position_window): Remove decls.
14202 * keyboard.c: Make these variables static.
14203
04f2d78b
CB
14204 * coding.h (coding, code_convert_region, encode_coding_gap):
14205 Remove decls.
74ab6df5
PE
14206 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14207 (iso_code_class, detect_coding, code_convert_region): Now static.
14208 (encode_coding_gap): Remove; unused.
14209
38dfbee1
PE
14210 * chartab.c (chartab_chars, chartab_bits): Now static.
14211
a2cb4e63
PE
14212 * charset.h (charset_iso_8859_1): Remove decl.
14213 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14214 Now static.
14215
127198fd
PE
14216 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14217 * ccl.c (Vccl_program_table): Now static.
14218 (check_ccl_update): Remove; unused.
14219
d85b608f
PE
14220 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14221 * category.h: ... from here.
14222 * category.c (check_category_table, set_category_set): Now static.
14223
31cd66f3
PE
14224 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14225 * lisp.h: Remove these decls.
14226
c358e587
PE
14227 * buffer.c (buffer_count): Remove unused var.
14228
e78aecca
PE
14229 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14230 so that it's not optimized away.
14231 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14232 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14233 exported only to the debugger.
14234
e192d7d3 14235 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 14236 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 14237
92470028
PE
14238 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14239 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14240 was inaccessible from Lisp.
14241 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14242 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14243
244ed907
PE
14244 alloc.c: Import and export fewer symbols, and remove unused items.
14245 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14246 is defined.
14247 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14248 it's not optimized away by whole-program optimization.
14249 (message_enable_multibyte, free_misc): Remove.
14250 (catchlist, handlerlist, mark_backtrace):
14251 Declare only if BYTE_MARK_STACK.
14252 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14253 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14254 (message_enable_multibyte): Remove decl.
14255 (free_misc, interval_free_list, float_block, float_block_index):
14256 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14257 (cons_free_list, last_marked_index):
14258 Now static.
14259 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14260 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14261 (mark_backtrace): Define only if BYTE_MARK_STACK.
14262 * xdisp.c (message_enable_multibyte): Now static.
14263
61c2b50e 14264 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
14265 This makes it easier for human readers (and static analyzers)
14266 to see whether these variables are used from other modules.
14267 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14268 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14269 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14270 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14271 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14272 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14273 * xmenu.c, xselect.c:
14274 Declare Q* vars static if they are not used in other modules.
14275 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14276 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14277 Remove decls of unexported vars.
14278 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14279
95c82688
PE
14280 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14281
16a97296
PE
14282 Make Emacs functions such as Fatom 'static' by default.
14283 This makes it easier for human readers (and static analyzers)
14284 to see whether these functions can be called from other modules.
14285 DEFUN now defines a static function. To make the function external
14286 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
14287 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14288 (Finit_image_library):
16a97296
PE
14289 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14290 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14291 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14292 Remove decls, since these functions are now static.
14293 (Funintern, Fget_internal_run_time): New decls, since these functions
14294 were already external.
95c82688 14295
16a97296
PE
14296 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14297 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14298 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14299 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14300 * keyboard.c, keymap.c, lread.c:
14301 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14302 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14303 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14304 Mark functions with DEFUE instead of DEFUN,
14305 if they are used in other modules.
14306 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14307 decls for now-static functions.
14308 * buffer.h (Fdelete_overlay): Remove decl.
14309 * callproc.c (Fgetenv_internal): Mark as internal.
14310 * composite.c (Fremove_list_of_text_properties): Remove decl.
14311 (Fcomposition_get_gstring): New forward static decl.
14312 * composite.h (Fcomposite_get_gstring): Remove decl.
14313 * dired.c (Ffile_attributes): New forward static decl.
14314 * doc.c (Fdocumntation_property): New forward static decl.
14315 * eval.c (Ffetch_bytecode): New forward static decl.
14316 (Funintern): Remove extern decl; now in .h file where it belongs.
14317 * fileio.c (Fmake_symbolic_link): New forward static decl.
14318 * image.c (Finit_image_library): New forward static decl.
14319 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14320 * intervals.h (Fprevious_property_change):
14321 (Fremove_list_of_text_properties): Remove decls.
14322 * keyboard.c (Fthis_command_keys): Remove decl.
14323 (Fcommand_execute): New forward static decl.
14324 * keymap.c (Flookup_key): New forward static decl.
14325 (Fcopy_keymap): Now static.
14326 * keymap.h (Flookup_key): Remove decl.
14327 * process.c (Fget_process): New forward static decl.
14328 (Fprocess_datagram_address): Mark as internal.
14329 * syntax.c (Fsyntax_table_p): New forward static decl.
14330 (skip_chars): Remove duplicate decl.
14331 * textprop.c (Fprevious_property_change): New forward static decl.
14332 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14333 Now internal.
14334 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14335 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14336
785bbd42
PE
14337 * editfns.c (Fformat): Remove unreachable code.
14338
8b913b57
AS
143392011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14340
14341 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14342 change. (Bug#8496)
14343
a6744a35
EZ
143442011-04-13 Eli Zaretskii <eliz@gnu.org>
14345
14346 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14347 when at ZV. (Bug#8487)
14348
e7974947
AS
143492011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14350
baad03f0
AS
14351 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14352 (Bug#8437)
14353 * keyboard.c (parse_tool_bar_item): Likewise.
14354 * sound.c (sound_cleanup, alsa_close): Likewise.
14355 * termcap.c (tgetent): Likewise.
14356 * xfns.c (x_default_font_parameter): Likewise.
14357 * xsettings.c (read_and_apply_settings): Likewise.
14358
e7974947
AS
14359 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14360 (overrun_check_free): Protoize.
14361
28272684
PE
143622011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14363
14364 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14365 since callers should never pass a negative size.
14366 Change the signature to match that of plain 'read' and 'write'; see
14367 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14368 * lisp.h: Update prototypes of emacs_write and emacs_read.
14369
11997c76
EZ
143702011-04-11 Eli Zaretskii <eliz@gnu.org>
14371
14372 * xdisp.c (redisplay_window): Don't try to determine the character
14373 position of the scroll margin if the window start point w->startp
e896f03c 14374 is outside the buffer's accessible region. (Bug#8468)
11997c76 14375
8a2cbd72
EZ
143762011-04-10 Eli Zaretskii <eliz@gnu.org>
14377
14378 Fix write-region and its subroutines for buffers > 2GB.
14379 * fileio.c (a_write, e_write): Modify declaration of arguments and
14380 local variables to support buffers larger than 2GB.
14381 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14382
14383 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14384 argument, local variables, and return value.
14385
14386 * lisp.h: Update prototypes of emacs_write and emacs_read.
14387
14388 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14389
4073e537 143902011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 14391
1ebfdcb6
PE
14392 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14393
b2ded58d
PE
14394 Fix more problems found by GCC 4.6.0's static checks.
14395
7d66342c
PE
14396 * xdisp.c (vmessage): Use a better test for character truncation.
14397
bbf47d44
PE
14398 * charset.c (load_charset_map): <, not <=, for optimization,
14399 and to avoid potential problems with integer overflow.
9248994d 14400 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 14401 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 14402 * editfns.c (Fformat): Likewise.
1e69125e 14403 * syntax.c (skip_chars): Likewise.
3befa583 14404
e3019616
PE
14405 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14406 This also lets GCC 4.6.0 generate slightly better loop code.
14407
becfa255
PE
14408 * callint.c (Fcall_interactively): <, not <=, for optimization.
14409 (Fcall_interactively): Count the number of arguments produced,
14410 not the number of arguments given. This is simpler and lets GCC
14411 4.6.0 generate slightly better code.
14412
dae0cd48
PE
14413 * ftfont.c: Distingish more carefully between FcChar8 and char.
14414 The previous code passed unsigned char * to a functions like
14415 strlen and xstrcasecmp that expect char *, which does not
14416 conform to the C standard.
14417 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14418 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14419 char * when the C standard requires it.
14420
76032d70
PE
14421 * keyboard.c (read_char): Remove unused var.
14422
eb3f1cc8
PE
14423 * eval.c: Port to Windows vsnprintf (Bug#8435).
14424 Include <limits.h>.
14425 (SIZE_MAX): Define if the headers do not.
14426 (verror): Do not give up if vsnprintf returns a negative count.
14427 Instead, grow the buffer. This ports to Windows vsnprintf, which
14428 does not conform to C99. Problem reported by Eli Zaretskii.
14429 Also, simplify the allocation scheme, by avoiding the need for
14430 calling realloc, and removing the ALLOCATED variable.
14431
70476b54
PE
14432 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14433
12020a9e
PE
14434 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14435 But keep the doprint source code for now, as we might revamp it
14436 and use it again (Bug#8435).
ea6c7ae6
PE
14437 * lisp.h (doprnt): Remove.
14438 * Makefile.in (base_obj): Remove doprnt.o.
14439 * deps.mk (doprnt.o): Remove.
14440
5fdb398c
PE
14441 error: Print 32- and 64-bit integers portably (Bug#8435).
14442 Without this change, on typical 64-bit hosts error ("...%d...", N)
14443 was used to print both 32- and 64-bit integers N, which relied on
14444 undefined behavior.
61bdb816 14445 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
14446 * lisp.h (error, verror): Mark as printf-like functions.
14447 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14448 Report overflow in size calculations when allocating printf buffer.
14449 Do not truncate output string at its first null byte.
14450 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14451 Truncate the output at a character boundary, since vsnprintf does not
14452 do that.
14453 * charset.c (check_iso_charset_parameter): Convert internal
14454 character to string before calling 'error', since %c now has the
14455 printf meaning.
14456 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14457 overflow when computing char to be passed to 'error'. Do not
14458 pass Lisp_Object to 'error'; pass the integer instead.
14459 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14460 formatted with plain %d.
14461
b189fa66
PE
14462 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14463
bff87ef0
PE
14464 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14465
7e2cac20
PE
14466 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14467
ce4d90b5
PE
14468 * xterm.c (x_catch_errors): Remove duplicate declaration.
14469
266c9547
PE
14470 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14471
79c49ad2
PE
14472 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14473
368f4090
JM
144742011-04-10 Jim Meyering <meyering@redhat.com>
14475
14476 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14477 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14478 return ssize_t not "int", and use size_t as the buffer length.
14479 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14480 * gnutls.h: Update declarations.
14481 * process.c (read_process_output): Use ssize_t, to match.
14482 (send_process): Likewise.
14483
a32d4040
CY
144842011-04-09 Chong Yidong <cyd@stupidchicken.com>
14485
14486 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14487
8546720e 144882011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 14489
04f2d78b
CB
14490 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14491 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 14492
8546720e
GM
14493 * xterm.c (handle_one_xevent):
14494 * xmenu.c (create_and_show_popup_menu):
14495 * xselect.c (x_decline_selection_request)
14496 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 14497
0a2f5c1a 144982011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
14499
14500 Fix some uses of `int' instead of EMACS_INT.
14501 * search.c (string_match_1, fast_string_match)
14502 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14503 (scan_buffer, find_next_newline_no_quit)
14504 (find_before_next_newline, search_command, Freplace_match)
14505 (Fmatch_data): Make some `int' variables be EMACS_INT.
14506
14507 * xdisp.c (display_count_lines): 3rd argument and return value now
14508 EMACS_INT. All callers changed.
14509 (pint2hrstr): Last argument is now EMACS_INT.
14510
14511 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14512 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14513 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14514 (decode_coding_utf_16, decode_coding_emacs_mule)
14515 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14516 (decode_coding_ccl, decode_coding_charset)
14517 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14518 (decode_coding_iso_2022, decode_coding_emacs_mule)
14519 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14520 <char_offset, last_offset>: Declare EMACS_INT.
14521 (encode_coding_utf_8, encode_coding_utf_16)
14522 (encode_coding_emacs_mule, encode_invocation_designation)
14523 (encode_designation_at_bol, encode_coding_iso_2022)
14524 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14525 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14526 Declare EMACS_INT.
14527 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14528 (encode_invocation_designation): Last argument P_NCHARS is now
14529 EMACS_INT.
14530 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14531 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14532
14533 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14534 All users changed.
14535
14536 * ccl.c (Fccl_execute_on_string): Declare some variables
14537 EMACS_INT.
14538
8546720e 145392011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
14540
14541 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14542
4e19a977
CS
145432011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14544
14545 * process.c (Fformat_network_address): Doc fix.
14546
87302331
R
145472011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14548
ee7683eb 14549 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 14550
cbb59342
CY
145512011-04-08 Chong Yidong <cyd@stupidchicken.com>
14552
14553 * keyboard.c (read_char): Call Lisp function help-form-show,
14554 instead of using internal_with_output_to_temp_buffer.
14555 (Qhelp_form_show): New var.
e0d38eeb 14556 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
14557
14558 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14559
14560 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14561
e67a13ab
CY
145622011-04-06 Chong Yidong <cyd@stupidchicken.com>
14563
04f2d78b
CB
14564 * process.c (Flist_processes): Remove to Lisp.
14565 (list_processes_1): Delete.
e67a13ab 14566
973f782d
EZ
145672011-04-06 Eli Zaretskii <eliz@gnu.org>
14568
7c106b1e
EZ
14569 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14570
973f782d
EZ
14571 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14572
41cf7d1a 145732011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 14574
ca23cc88
PE
14575 Fix more problems found by GCC 4.6.0's static checks.
14576
f390e2d5
PE
14577 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14578
42eea0d0
PE
14579 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14580
b69769da 14581 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 14582
f9541e84
PE
14583 * xdisp.c (vmessage): Mark as a printf-like function.
14584
13841b55
PE
14585 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14586
c136c10f
PE
14587 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14588
5e2d4a30
PE
14589 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14590 printf-like functions.
14591 (tiff_load): Add casts to remove these marks before passing them
14592 to system-supplied API.
14593
583f48b9
PE
14594 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14595
b25d760e
PE
14596 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14597 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
14598 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14599 directly, rather than having caller test rule sign. This avoids
14600 some unnecessary tests.
14601 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14602 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14603 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 14604
bc7b6697 14605 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 14606 (xfont_open): Avoid unnecessary tests.
bc7b6697 14607
27ccc379
PE
14608 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14609
dcd5c89a
PE
14610 * composite.h, composite.c (composition_gstring_put_cache):
14611 Use EMACS_INT, not int, for length.
14612
b13a45c6
PE
14613 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14614 breaking out part of COMPOSITION_DECODE_RULE.
14615 (COMPOSITION_DECODE_RULE): Use it.
14616 * composite.c (get_composition_id): Remove unused local vars,
14617 by using the new macro.
14618
1e792e4d
PE
14619 * textprop.c (set_text_properties_1): Change while to do-while,
14620 since the condition is always true at first.
14621
dc6c6455 14622 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
14623 (interval_deletion_adjustment): Return unsigned value.
14624 All uses changed.
dc6c6455 14625
aba7731a
PE
14626 * process.c (list_processes_1, create_pty, read_process_output):
14627 (exec_sentinel): Remove vars that were set but not used.
afd4052b 14628 (create_pty): Remove unnecessary "volatile"s.
bc57d757 14629 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 14630 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 14631 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 14632
fdfc4bf3
PE
14633 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14634
fca8fe46 14635 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 14636 (update_syntax_table): Use unsigned instead of int.
fca8fe46 14637
06a0259a 14638 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 14639 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 14640 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 14641
e7b9e80f
PE
14642 * print.c (print_error_message): Avoid int overflow.
14643
56201685
PE
14644 * font.c (font_list_entities): Redo for clarity,
14645 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14646
78834453 14647 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 14648 (font_score): Avoid potential overflow in diff calculation.
78834453 14649
0bc0b309 14650 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 14651 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 14652
e610eaca
PE
14653 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14654
b895abce
PE
14655 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14656 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14657 can always succeed if overflow has undefined behavior.
14658
1f1d9321 14659 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 14660 (wordify): Omit three unnecessary tests.
1f1d9321 14661
c59478bc
PE
14662 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14663 All callers changed. This avoids the need for an unused var.
14664
79b73827
PE
14665 * casefiddle.c (casify_region): Remove var that is set but not used.
14666
a4db5dfe
PE
14667 * dired.c (file_name_completion): Remove var that is set but not used.
14668
43aae36e
PE
14669 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14670
2a47c44d 14671 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 14672 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 14673
a37c69bf
PE
14674 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14675 Check for integer overflow on size calculations.
14676
328ab8e7
PE
14677 * buffer.c (Fprevious_overlay_change): Remove var that is set
14678 but not used.
14679
e5a2a5cb
PE
14680 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14681 Remove vars that are set but not used.
8d84a6eb 14682 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 14683 (timer_check_2): Mark vars as initialized.
e5a2a5cb 14684
a60e5f68
PE
14685 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14686
f661cb61 14687 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 14688 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 14689
f0397f5a
PE
14690 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14691 that are set but not used.
14692
8664db06 14693 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 14694 if XCreateBitmapFromData fails (Bug#8410).
8664db06 14695
6abdaa4a
PE
14696 * xselect.c (x_get_local_selection, x_handle_property_notify):
14697 Remove vars that are set but not used.
14698
0ce7538d 14699 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 14700 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 14701
9ae848fc
PE
14702 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14703 Remove var that is set but not used.
0b918413
PE
14704 (scroll_bar_windows_size): Now size_t, not int.
14705 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14706 Check for overflow.
9ae848fc 14707
a5a62657
PE
14708 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14709 (map_tty_color) [!defined MSDOS]: Likewise.
14710
5c5cdd39
PE
14711 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14712
66ebf983
PE
14713 * coding.c: Remove vars that are set but not used.
14714 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14715 All callers changed.
14716 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14717 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14718 (decode_coding_charset): Remove vars that are set but not used.
14719
1be4d761
PE
14720 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14721 that is set but not used.
14722
47553fa8
PE
14723 * print.c (print_object): Remove var that is set but not used.
14724
1f7196bf 14725 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
14726 The gnulib version avoids calling malloc in the usual case,
14727 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14728 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14729 * filelock.c (current_lock_owner): Likewise.
14730 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14731 * sysdep.c: Include allocator.h, careadlinkat.h.
14732 (emacs_no_realloc_allocator): New static constant.
14733 (emacs_readlink): New function.
fdb61804
PE
14734 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14735 ../lib/careadlinkat.h.
d1fdcab7 14736
f84c17c7
SM
147372011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14738
14739 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14740 first non-nil return value).
14741
ef3862ad
JD
147422011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14743
14744 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14745 if not defined (Bug#8403).
14746
376a7006
JB
147472011-04-02 Juanma Barranquero <lekktu@gmail.com>
14748
14749 * xdisp.c (display_count_lines): Remove parameter `start',
14750 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14751 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14752 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14753 (fill_stretch_glyph_string): Remove parameters `row' and `area',
14754 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14755 and thereabouts. All callers changed.
14756 (get_per_char_metric): Remove parameter `f', unused since
14757 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14758
6ca3801d
JM
147592011-04-02 Jim Meyering <meyering@redhat.com>
14760
14761 do not dereference NULL upon failed strdup
14762 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14763 (ns_get_family): Likewise.
14764
d8e2b5ba
JB
147652011-04-02 Juanma Barranquero <lekktu@gmail.com>
14766
14767 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14768
8c74fcbd
JD
147692011-04-02 Jan Djärv <jan.h.d@swipnet.se>
14770
14771 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14772 later (Bug#8403).
14773
7200d79c
SM
147742011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
14775
03408648 14776 Add lexical binding.
7200d79c 14777
03408648
SM
14778 * window.c (Ftemp_output_buffer_show): New fun.
14779 (Fsave_window_excursion):
14780 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14781
14782 * lread.c (lisp_file_lexically_bound_p): New function.
14783 (Fload): Bind Qlexical_binding.
14784 (readevalloop): Remove `evalfun' arg.
14785 Bind Qinternal_interpreter_environment.
14786 (Feval_buffer): Bind Qlexical_binding.
14787 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14788 Mark as dynamic.
14789 (syms_of_lread): Declare `lexical-binding'.
14790
14791 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14792
14793 * keyboard.c (eval_dyn): New fun.
14794 (menu_item_eval_property): Use it.
ca105506
SM
14795
14796 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 14797
03408648
SM
14798 * fns.c (concat, mapcar1): Accept byte-code-functions.
14799
14800 * eval.c (Fsetq): Handle lexical vars.
14801 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14802 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14803 (FletX, Flet): Obey lexical binding.
14804 (Fcommandp): Handle closures.
14805 (Feval): New `lexical' arg.
14806 (eval_sub): New function extracted from Feval. Use it almost
14807 everywhere where Feval was used. Look up vars in lexical env.
14808 Handle closures.
14809 (Ffunctionp): Move from subr.el.
14810 (Ffuncall): Handle closures.
14811 (apply_lambda): Remove `eval_flags'.
14812 (funcall_lambda): Handle closures and new byte-code-functions.
14813 (Fspecial_variable_p): New function.
14814 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
14815 but without exporting it to Lisp.
23aba0ea 14816
23aba0ea 14817 * doc.c (Fdocumentation, store_function_docstring):
03408648 14818 * data.c (Finteractive_form): Handle closures.
23aba0ea 14819
03408648
SM
14820 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
14821 interactive spec.
ba83908c 14822
04f2d78b
CB
14823 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14824 New byte-codes.
03408648
SM
14825 (exec_byte_code): New function extracted from Fbyte_code to handle new
14826 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 14827
03408648 14828 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 14829
03408648 14830 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 14831
e2abce01
JB
148322011-03-31 Juanma Barranquero <lekktu@gmail.com>
14833
14834 * xdisp.c (redisplay_internal): Fix prototype.
14835
63696a73 148362011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 14837
63696a73 14838 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
14839 (try_scrolling): Use it when setting scroll_limit.
14840 Limit scrolling to 100 screen lines.
63696a73
EZ
14841 (redisplay_window): Even when falling back on "recentering",
14842 position point in the window according to scroll-conservatively,
14843 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
14844
14845 (try_scrolling): When point is above the window, allow searching
14846 as far as scroll_max, or one screenful, to compute vertical
14847 distance from PT to the scroll margin position. This prevents
14848 try_scrolling from unnecessarily failing when
14849 scroll-conservatively is set to a value slightly larger than the
14850 window height. Clean up the case of PT below the margin at bottom
14851 of window: scroll_max can no longer be INT_MAX. When aggressive
14852 scrolling is in use, don't let point enter the opposite scroll
14853 margin as result of the scroll.
14854 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
14855 threshold of 100 lines for never-recentering scrolling.
14856
e4cc2dfc
JB
148572011-03-31 Juanma Barranquero <lekktu@gmail.com>
14858
14859 * dispextern.h (move_it_by_lines):
14860 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14861 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
14862 (message_log_check_duplicate): Remove parameters `prev_bol' and
14863 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14864 (redisplay_internal): Remove parameter `preserve_echo_area',
14865 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
14866
14867 * indent.c (Fvertical_motion):
14868 * window.c (window_scroll_pixel_based, Frecenter):
14869 Don't pass `need_y_p' to `move_it_by_lines'.
14870
1c470562
SM
148712011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
14872
44f230aa
SM
14873 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
14874 steal a few bits to be more compact.
14875 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
14876 Remove unneeded casts.
14877
1c470562
SM
14878 * bytecode.c (Fbyte_code): CAR and CDR can GC.
14879
888adce9
ZK
148802011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
14881
14882 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
14883 binding" message (bug#7967).
14884
f838ed7b
PE
148852011-03-30 Paul Eggert <eggert@cs.ucla.edu>
14886
77861b95
PE
14887 Fix more problems found by GCC 4.6.0's static checks.
14888
de6dbc14
PE
14889 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
14890 Remove unused local var.
14891
f838ed7b
PE
14892 * editfns.c (Fmessage_box): Remove unused local var.
14893
792c7b2b
PE
14894 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
14895 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14896 Omit unused local vars.
c499e557 14897 * window.c (shrink_windows): Omit unused local var.
b01a1c29 14898 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
14899 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
14900 Omit unused local var.
14901
ba0165e1
PE
14902 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
14903 Don't assume string length fits in int.
32ad8845 14904 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 14905 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 14906
3c59b4c9
PE
14907 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
14908 instead of alloca (Bug#8344).
14909
a3eed478 14910 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 14911 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 14912
eb4d412d
PE
14913 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
14914
1658b401
PE
14915 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
14916 concerns.
14917
14918 * term.c (produce_glyphless_glyph): Remove unnecessary test.
14919
14920 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 14921
9a2c6e05
PE
14922 * keyboard.c (syms_of_keyboard): Use the same style as later
14923 in this function when indexing through an array. This also
14924 works around GCC bug 48267.
14925
03d0a109
PE
14926 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
14927
44f730c8
PE
14928 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
14929
fe75f926
PE
14930 * chartab.c (sub_char_table_ref_and_range): Redo for slight
14931 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
14932
ffa8c828
PE
14933 * keyboard.c, keyboard.h (num_input_events): Now size_t.
14934 This avoids undefined behavior on integer overflow, and is a bit
14935 more convenient anyway since it is compared to a size_t variable.
14936
c5101a77
PE
14937 Variadic C functions now count arguments with size_t, not int.
14938 This avoids an unnecessary limitation on 64-bit machines, which
14939 caused (substring ...) to crash on large vectors (Bug#8344).
14940 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
14941 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 14942 All variadic functions and their callers changed accordingly.
c5101a77
PE
14943 (struct gcpro.nvars): Now size_t, not int. All uses changed.
14944 * data.c (arith_driver, float_arith_driver): Likewise.
14945 * editfns.c (general_insert_function): Likewise.
14946 * eval.c (struct backtrace.nargs, interactive_p)
14947 (internal_condition_case_n, run_hook_with_args, apply_lambda)
14948 (funcall_lambda, mark_backtrace): Likewise.
14949 * fns.c (concat): Likewise.
14950 * frame.c (x_set_frame_parameters): Likewise.
14951 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
14952 0 if not found, not -1. All callers changed.
14953
dd3f25f7
PE
14954 * alloc.c (garbage_collect): Don't assume stack size fits in int.
14955 (stack_copy_size): Now size_t, not int.
14956 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
14957
461c2ab9
JB
149582011-03-28 Juanma Barranquero <lekktu@gmail.com>
14959
14960 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
14961 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14962 All callers changed.
14963
14964 * lisp.h (multibyte_char_to_unibyte):
14965 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
14966 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
14967 * character.h (CHAR_TO_BYTE8):
14968 * cmds.c (internal_self_insert):
14969 * editfns.c (general_insert_function):
14970 * keymap.c (push_key_description):
14971 * search.c (Freplace_match):
14972 * xdisp.c (message_dolog, set_message_1): All callers changed.
14973
f6d62986
SM
149742011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
14975
14976 * keyboard.c (safe_run_hook_funcall): New function.
14977 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
14978 don't set the hook to nil, but remove the offending function instead.
14979 (Qcommand_hook_internal): Remove, unused.
14980 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
14981 Vcommand_hook_internal.
14982
14983 * eval.c (enum run_hooks_condition): Remove.
14984 (funcall_nil, funcall_not): New functions.
14985 (run_hook_with_args): Call each function through a `funcall' argument.
14986 Remove `cond' argument, now redundant.
14987 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
14988 (Frun_hook_with_args_until_failure): Adjust accordingly.
14989 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
14990
1db5b1ad
JB
149912011-03-28 Juanma Barranquero <lekktu@gmail.com>
14992
14993 * dispextern.h (string_buffer_position): Remove declaration.
14994
14995 * print.c (strout): Remove parameter `multibyte', unused since
14996 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
14997
14998 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
14999 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15000 All callers changed.
15001
15002 * w32.c (_wsa_errlist): Use braces for struct initializers.
15003
15004 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15005 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15006 All callers changed.
15007 (string_buffer_position): Likewise. Also, make static (it's never
15008 used outside xdisp.c).
15009 (cursor_row_p): Remove parameter `w', unused since
15010 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15011 (decode_mode_spec): Remove parameter `precision', introduced during
15012 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15013 All callers changed.
15014
5ffb62aa
JD
150152011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15016
15017 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15018
461c2ab9 150192011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
15020
15021 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15022 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15023 (ns_update_auto_hide_menu_bar): New functions.
15024 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15025 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15026 ns_constrain_all_frames.
15027 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15028 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15029
5c380ffb
JD
150302011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15031
15032 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15033
9af30bdf
GM
150342011-03-27 Glenn Morris <rgm@gnu.org>
15035
15036 * syssignal.h: Replace RETSIGTYPE with void.
15037 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15038 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15039 Replace SIGTYPE with void everywhere.
15040 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15041 * s/template.h (SIGTYPE): Remove commented out definition.
15042
e2abce01
JB
150432011-03-26 Eli Zaretskii <eliz@gnu.org>
15044
15045 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15046 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15047
f868cd8a
JB
150482011-03-26 Juanma Barranquero <lekktu@gmail.com>
15049
59eb0929
JB
15050 * w32.c (read_unc_volume): Use parameter `henum', instead of
15051 global variable `wget_enum_handle'.
15052
15053 * keymap.c (describe_vector): Remove parameters `indices' and
15054 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15055 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15056
f868cd8a
JB
15057 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15058
15059 * keyboard.c (timer_check): Remove parameter `do_it_now',
15060 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15061 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15062 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15063
15064 * keyboard.c (read_char):
15065 * w32menu.c (w32_menu_display_help):
15066 * xmenu.c (show_help_event, menu_help_callback):
15067 Adjust calls to `show_help_echo'.
15068
15069 * gtkutil.c (xg_maybe_add_timer):
15070 * keyboard.c (readable_events):
15071 * process.c (wait_reading_process_output):
15072 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15073
15074 * insdel.c (adjust_markers_gap_motion):
15075 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15076 (gap_left, gap_right): Don't call it.
15077
2ecf6fdb
CY
150782011-03-25 Chong Yidong <cyd@stupidchicken.com>
15079
15080 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15081 incurred during fontification.
15082
6b1f9ba4
JB
150832011-03-25 Juanma Barranquero <lekktu@gmail.com>
15084
15085 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15086 (DEFVAR_PER_BUFFER): Don't pass it.
15087
15088 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15089 (scrolling_window): Don't pass it.
15090
0f4a96b5
JB
150912011-03-25 Juanma Barranquero <lekktu@gmail.com>
15092
15093 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15094
15095 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15096 and `suffix'.
15097 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15098 of variables specific to SELinux and computation of `encoded_absname'.
15099
15100 * image.c (XPutPixel): Remove unused variable `height'.
15101
15102 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15103
15104 * unexw32.c (get_section_info): Remove unused variable `section'.
15105
15106 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15107 (system_process_attributes): Remove unused variable `sess'.
15108 (sys_read): Remove unused variable `err'.
15109
15110 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15111 (w32_wnd_proc): Remove unused variable `isdead'.
15112 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15113 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15114 (x_create_tip_frame): Remove unused variable `tem'.
15115
15116 * w32inevt.c (w32_console_read_socket):
15117 Remove unused variable `no_events'.
15118
15119 * w32term.c (x_draw_composite_glyph_string_foreground):
15120 Remove unused variable `width'.
15121
1149507c
JB
151222011-03-24 Juanma Barranquero <lekktu@gmail.com>
15123
15124 * w32term.c (x_set_glyph_string_clipping):
15125 Don't pass uninitialized region to CombineRgn.
15126
9c88f339
JB
151272011-03-23 Juanma Barranquero <lekktu@gmail.com>
15128
15129 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15130 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15131 (Fx_close_connection): Remove unused variable `i'.
15132
15133 * w32font.c (w32font_draw): Return number of glyphs.
15134 (w32font_open_internal): Remove unused variable `i'.
15135 (w32font_driver): Add missing initializer.
15136
15137 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15138 (fill_in_menu): Remove unused variable `items_added'.
15139
15140 * w32term.c (last_mouse_press_frame): Remove static global variable.
15141 (w32_clip_to_row): Remove unused variable `f'.
15142 (x_delete_terminal): Remove unused variable `i'.
15143
15144 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15145 (NOTHING): Remove unused static global variable.
15146 (uniscribe_check_otf): Remove unused variable `table'.
15147 (uniscribe_font_driver): Add missing initializers.
15148
dee091a3
JD
151492011-03-23 Julien Danjou <julien@danjou.info>
15150
15151 * term.c (Fsuspend_tty, Fresume_tty):
15152 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15153 * window.c (temp_output_buffer_show):
15154 * insdel.c (signal_before_change):
15155 * frame.c (Fhandle_switch_frame):
15156 * fileio.c (Fdo_auto_save):
15157 * emacs.c (Fkill_emacs):
15158 * editfns.c (save_excursion_restore):
15159 * cmds.c (internal_self_insert):
15160 * callint.c (Fcall_interactively):
15161 * buffer.c (Fkill_all_local_variables):
15162 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15163 Use Frun_hooks.
0f4a96b5 15164 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 15165 unconditionally since it does the check itself.
dee091a3 15166
2c520ab5 151672011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 15168
c9c49752
PE
15169 Fix more problems found by GCC 4.5.2's static checks.
15170
8abc3f12
PE
15171 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15172 the first time through the loop, since we know p0 < p1 then.
15173 This also avoids a gcc -Wstrict-overflow warning.
15174
a2d26660
PE
15175 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15176 leading to a memory leak, possible in functions like
15177 load_charset_map_from_file that can allocate an unbounded number
b12ef411 15178 of objects (Bug#8318).
a2d26660 15179
916c72e9
PE
15180 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15181 that could (at least in theory) be that large.
15182
19ab8a18
PE
15183 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15184 This is less likely to overflow, and avoids undefined behavior if
15185 overflow does occur. All callers changed. Use strtoul to scan
15186 for the unsigned long integer.
b7cbbd6f
PE
15187 (pint2hrstr): Simplify and tune code slightly.
15188 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 15189
f0641eff
PE
15190 * scroll.c (do_scrolling): Work around GCC bug 48228.
15191 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15192
7f650bb9
PE
15193 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15194 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
15195 (validate_x_resource_name): Simplify count usage.
15196 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 15197
37dd57d1
PE
15198 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15199 fail (Bug#8306).
81e56e61 15200
699979fc 15201 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 15202
401bf9b4
PE
15203 * process.c (Fmake_network_process): Use socklen_t, not int,
15204 where POSIX says socklen_t is required in portable programs.
15205 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 15206 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
15207 (Fmake_network_process, server_accept_connection):
15208 (wait_reading_process_output, read_process_output):
15209 Likewise.
15210
b93aacde
PE
15211 * process.c: Rename or move locals to avoid shadowing.
15212 (list_processes_1, Fmake_network_process):
15213 (read_process_output_error_handler, exec_sentinel_error_handler):
15214 Rename or move locals.
4dc343ee 15215 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 15216 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 15217 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 15218 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 15219 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 15220
af8a867c 15221 Make tparam.h and terminfo.c consistent.
44f230aa
SM
15222 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15223 Include tparam.h instead, since it declares them.
af8a867c
PE
15224 * cm.h (PC): Remove extern decl; tparam.h now does this.
15225 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15226 * terminfo.c: Include tparam.h, to check interfaces.
15227 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15228 (tparam): Adjust signature to match interface in tparam.h;
15229 this removes some undefined behavior. Check that outstring and len
15230 are zero, which they always are with Emacs.
15231 * tparam.h (PC, BC, UP): New extern decls.
15232
0248044d 15233 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 15234 (xftfont_open): Rename locals to avoid shadowing.
0248044d 15235
8ff096c1 15236 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
15237 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15238 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 15239 (ftfont_list): Remove unused local.
49eaafba
PE
15240 (get_adstyle_property, ftfont_pattern_entity):
15241 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15242 Rename locals to avoid shadowing.
8ff096c1 15243
e2be39f6
PE
15244 * xfont.c (xfont_list_family): Mark var as initialized.
15245
c9735e30
PE
15246 * xml.c (make_dom): Now static.
15247
8f5201ae
PE
15248 * composite.c (composition_compute_stop_pos): Rename local to
15249 avoid shadowing.
b246f932
PE
15250 (composition_reseat_it): Remove unused locals.
15251 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 15252 (composition_update_it): Mark var as initialized.
11b61122
PE
15253 (find_automatic_composition): Mark vars as initialized,
15254 with a FIXME (Bug#8290).
8f5201ae 15255
760fbc2c
PE
15256 character.h: Rename locals to avoid shadowing.
15257 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15258 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15259 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15260 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15261 to avoid shadowing.
15262
ff08eb85
PE
15263 * textprop.c (property_change_between_p): Remove; unused.
15264
fc7bf025
PE
15265 * intervals.c (interval_start_pos): Now static.
15266
235d7abc
PE
15267 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15268
44f230aa
SM
15269 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15270 Rename locals to avoid shadowing.
3e7d6594 15271
50060332
PE
15272 * sound.c (wav_play, au_play, Fplay_sound_internal):
15273 Fix pointer signedness.
d01f234b 15274 (alsa_choose_format): Remove unused local var.
c83b8872
PE
15275 (wav_play): Initialize a variable to 0, to prevent undefined
15276 behavior (Bug#8278).
50060332 15277
c4fc4e30
PE
15278 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15279
918436ed
PE
15280 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15281
c939f91b
PE
15282 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15283 clobbering (Bug#8298).
b9c7f648
PE
15284 * sysdep.c (sys_subshell): Likewise.
15285 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 15286
6bd8c144
PE
15287 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15288 This should get cleaned up, so that child_setup has the
15289 same signature on all platforms.
15290
7710357c 15291 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 15292 (relocate_fd): Rename locals to avoid shadowing.
7710357c 15293
c59da222
CY
152942011-03-22 Chong Yidong <cyd@stupidchicken.com>
15295
15296 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15297 not to be necessary, and produces flickering.
15298
66b87493
GM
152992011-03-20 Glenn Morris <rgm@gnu.org>
15300
15301 * config.in: Remove file.
15302
45b6f6d5
JB
153032011-03-20 Juanma Barranquero <lekktu@gmail.com>
15304
15305 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15306 are now in src/globals.h.
15307 (syms_of_minibuf): Remove spurious & from previous change.
15308
cd394be1 153092011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
15310
15311 * minibuf.c (completing-read-function): New variable.
15312 (completing-read-default): Rename from completing-read.
15313 (completing-read): Call completing-read-function.
15314
b14e3e21
CY
153152011-03-19 Juanma Barranquero <lekktu@gmail.com>
15316
15317 * xfaces.c (Fx_load_color_file):
15318 Read color file from absolute filename (bug#8250).
15319
f2b726e6
JB
153202011-03-19 Juanma Barranquero <lekktu@gmail.com>
15321
15322 * makefile.w32-in: Update dependencies.
15323
09f6ff02
EZ
153242011-03-17 Eli Zaretskii <eliz@gnu.org>
15325
15326 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15327
29a6015a
PE
153282011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15329
a3a6c54e
PE
15330 Fix more problems found by GCC 4.5.2's static checks.
15331
b766f867
PE
15332 * process.c (make_serial_process_unwind, send_process_trap):
15333 (sigchld_handler): Now static.
15334
be02381c
PE
15335 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15336 That way, the code declares only the vars that it needs.
15337 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15338 * s/cygwin.h (PTY_ITERATION): Likewise.
15339 * s/darwin.h (PTY_ITERATION): Likewise.
15340 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15341
57048744
PE
15342 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15343 * process.c (allocate_pty): Don't declare stb unless it's needed.
15344
7914961c 15345 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
15346 (CONSTANTLIM): Remove; unused.
15347 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15348 Define only if needed.
7914961c 15349
b3967b18
PE
15350 * unexelf.c (unexec): Name an expression,
15351 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
15352 Use a different way to cause a compilation error if anyone uses
15353 n rather than nn, a way that does not involve shadowing.
73366a00 15354 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 15355
29a6015a
PE
15356 * deps.mk (unexalpha.o): Remove; unused.
15357
43cfc33e 15358 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 15359 * unexec.h: New file.
ce701a33
PE
15360 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15361 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15362 Depend on unexec.h.
15363 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15364 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15365 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 15366 Change as necessary to match prototype in unexec.h.
ce701a33 15367
01f44d5a
PE
15368 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15369 shadowing.
4f63c6bb 15370 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 15371
a6670b0b
PE
15372 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15373 Rename locals to avoid shadowing.
15374
cef2010d 15375 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 15376 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 15377
d4d7173a
PE
15378 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15379
f08b802a
PE
15380 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15381 warning when compiling print.c.
15382
3ddb0639
PE
15383 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15384 instead of using an uninitialized var.
5ad03b97 15385 (font_sort_entities): Mark var as initialized.
3ddb0639 15386
170a2692
PE
15387 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15388
e663c700
PE
15389 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15390 pointers to constants.
89bc529a 15391 (font_parse_fcname): Remove unused vars.
7b81e2d0 15392 (font_delete_unmatched): Now static.
ea838e10 15393 (font_get_spec): Remove; unused.
13a547c6
PE
15394 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15395 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15396 Rename or move locals to avoid shadowing.
e663c700 15397
2a80c887 15398 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 15399 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 15400
1384fa33 15401 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 15402 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 15403
8b2c52e9
PE
15404 * alloc.c (mark_backtrace): Move decl from here ...
15405 * lisp.h: ... to here, so that it can be checked.
15406
475545b5 15407 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 15408 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
15409 (lisp_indirect_variable): Name an expression,
15410 to avoid gcc -Wbad-function-cast warning.
1faed8ae 15411 (Fdefvar): Rename locals to avoid shadowing.
475545b5 15412
b1349114 15413 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 15414 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 15415 Use const pointer when appropriate.
b1349114 15416
a2928364
PE
15417 * lisp.h (get_system_name, get_operating_system_release):
15418 Move decls here, to check interfaces.
15419 * process.c (get_operating_system_release): Move decl to lisp.h.
15420 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
15421 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15422 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15423 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
15424 (Fformat_time_string, Fencode_time, Finsert_char):
15425 (Ftranslate_region_internal, Fformat):
15426 Rename or remove local vars to avoid shadowing.
9710023e 15427 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 15428
a415e694
PE
15429 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15430 avoid shadowing.
15431
8ef4622d
PE
15432 * lisp.h (eassert): Check that the argument compiles, even if
15433 ENABLE_CHECKING is not defined.
15434
946f9a5b
PE
15435 * data.c (Findirect_variable): Name an expression, to avoid
15436 gcc -Wbad-function-cast warning.
112396d6 15437 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 15438 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
15439 (Fmake_variable_buffer_local, Fmake_local_variable):
15440 Mark variables as initialized.
52746918 15441 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 15442
e5aab7e7 15443 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
15444 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15445 Rename locals to avoid shadowing.
dff45157
PE
15446 (mark_stack): Move local variables into the #ifdef region where
15447 they're used.
7bc26fdb
PE
15448 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15449 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15450 needed otherwise.
15451 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15452 (GC_STRING_CHARS): Remove; not used.
d40d4be1 15453 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 15454
e5aab7e7
PE
15455 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15456 avoids undefined behavior in theory.
15457
4da60324
PE
15458 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15459
88043301
PE
15460 Use functions, not macros, for up- and down-casing (Bug#8254).
15461 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15462 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15463 to use the following functions instead of these macros.
15464 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15465 EMACS_INT, since callers assume the returned value fits in int.
15466 (upcase1): Likewise, for UPCASE_TABLE.
15467 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 15468 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 15469 the race-condition problem in the old DOWNCASE.
88043301 15470
19ed5445
PE
15471 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15472 Rename locals to avoid shadowing.
15473 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
15474 (regex_compile, re_search_2, re_match_2_internal):
15475 Remove unused local vars.
952db0d7
PE
15476 (FREE_VAR): Rewrite so as not to use empty "else",
15477 which gcc can warn about.
da053e48 15478 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
15479 (RETALLOC_IF): Define only if needed.
15480 (WORDCHAR_P): Likewise. This one is never needed, but is used
15481 only in a comment talking about a compiler bug, so put inside
15482 the #if 0 of that comment.
15483 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15484 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15485 Remove; unused.
19ed5445 15486
1f3561e4 15487 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
15488 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15489 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 15490
ded6f8f7
PE
15491 * search.c (simple_search): Remove unused var.
15492
dbd37a95
PE
15493 * dired.c (compile_pattern): Move decl from here ...
15494 * lisp.h: ... to here, so that it can be checked.
15495 (struct re_registers): New forward decl.
15496
7e47afad
PE
15497 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15498
85f24f61
PE
15499 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15500 All uses changed.
15501 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15502 Rename locals to avoid shadowing.
5671df8f 15503 (Fvertical_motion): Mark locals as initialized.
85f24f61 15504
181aa2be 15505 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 15506 (casify_region): Mark local as initialized.
181aa2be 15507
930d429c
PE
15508 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15509
7082eac6
PE
15510 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15511 New macros, so that the caller can use some names other than
15512 gcpro1, gcpro2, etc.
15513 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15514 of the new macros.
15515 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15516 argument, for consistency with GCPRO2_VAR, etc: it is now the
15517 prefix of the variable, not the variable itself. All uses
15518 changed.
38b2c076
PE
15519 * dired.c (directory_files_internal, file_name_completion):
15520 Rename locals to avoid shadowing.
15521
15206ed9
PE
15522 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15523 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15524 dired.c's scmp function, had undefined behavior.
15525 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15526 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15527 * buffer.h: ... to here, because these macros use current_buffer,
15528 and the new implementation with inline functions needs to have
15529 current_buffer in scope now, rather than later when the macros
15530 are used.
15531 (downcase, upcase1): New static inline functions.
15532 (DOWNCASE, UPCASE1): Reimplement using these functions.
15533 This avoids undefined behavior in expressions like
15534 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15535 from race conditions in accessing the global variables
15536 case_temp1 and case_temp2.
15537 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15538 * lisp.h (case_temp1, case_temp2): Remove their decls.
15539 * character.h (ASCII_CHAR_P): Move from here ...
15540 * lisp.h: ... to here, so that the inline functions mentioned
15541 above can use them.
15542
4a6bea26
PE
15543 * dired.c (directory_files_internal_unwind): Now static.
15544
f14b7e14
PE
15545 * fileio.c (file_name_as_directory, directory_file_name):
15546 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15547 Now static.
2893f146
PE
15548 (file_name_as_directory): Use const pointers when appropriate.
15549 (Fexpand_file_name): Likewise. In particular, newdir might
15550 point at constant storage, so make it a const pointer.
fd4ead52 15551 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
15552 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15553 signedness issues.
f839df0c
PE
15554 (Fset_file_times, Finsert_file_contents, auto_save_error):
15555 Rename locals to avoid shadowing.
f14b7e14 15556
5716756e 15557 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
15558 (Ftry_completion, Fall_completions): Rename or remove locals
15559 to avoid shadowing.
5716756e 15560
b4c3046a
PE
15561 * marker.c (bytepos_to_charpos): Remove; unused.
15562
b45db522
PE
15563 * lisp.h (verify_bytepos, count_markers): New decls,
15564 so that gcc does not warn that these functions aren't declared.
15565
85876d07
PE
15566 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15567 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 15568 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 15569 (copy_text): Remove unused local var.
85876d07 15570
03d78a21 15571 * filelock.c (within_one_second): Now static.
b3dd38ab 15572 (lock_file_1): Rename local to avoid shadowing.
03d78a21 15573
5df8f01b
PE
15574 * buffer.c (fix_overlays_before): Mark locals as initialized.
15575 (fix_start_end_in_overlays): Likewise. This function should be
15576 simplified by using pointers-to-pointers, but that's a different
15577 matter.
b1d876f1 15578 (switch_to_buffer_1): Now static.
8f54f30a
PE
15579 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15580 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 15581
a70072c9 15582 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 15583 Fix pointer signedness issue.
edced198
PE
15584 (sys_subshell): Mark local as volatile if checking for lint,
15585 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 15586 (MAXPATHLEN): Define only if needed.
a70072c9 15587
a0977c44
PE
15588 * process.c (serial_open, serial_configure): Move decls from here ...
15589 * systty.h: ... to here, so that they can be checked.
15590
a884fdcc
PE
15591 * fns.c (get_random, seed_random): Move extern decls from here ...
15592 * lisp.h: ... to here, so that they can be checked.
15593
604efe86 15594 * sysdep.c (reset_io): Now static.
b8950c94 15595 (wait_for_termination_signal): Remove; unused.
604efe86 15596
38fc62d9
PE
15597 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15598 (copy_keymap_item, append_key, push_text_char_description):
15599 Now static.
1004a21a 15600 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 15601 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
15602 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15603 (describe_map_tree):
15604 Rename locals to avoid shadowing.
38fc62d9 15605
2f2650da
PE
15606 * keyboard.c: Declare functions static if they are not used elsewhere.
15607 (echo_char, echo_dash, cmd_error, top_level_2):
15608 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
15609 (read_char, kbd_buffer_get_event, make_lispy_position):
15610 (make_lispy_event, make_lispy_movement, apply_modifiers):
15611 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15612 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15613 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 15614 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 15615 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 15616
a053e86c 15617 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
15618 (mark_kboards): Move decl here ...
15619 * alloc.c (mark_kboards): ... from here.
a053e86c 15620
4752793e
PE
15621 * lisp.h (force_auto_save_soon): New decl.
15622
74f10ca7 15623 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
15624 (DEFINE_DUMMY_FUNCTION): New macro.
15625 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15626 Use it.
c03cd23f
PE
15627 (main): Add casts to avoid warnings
15628 if GCC considers string literals to be constants.
74f10ca7 15629
022e70d4
PE
15630 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15631
59d6fe83
PE
15632 * dbusbind.c: Pointer signedness fixes.
15633 (xd_signature, xd_append_arg, xd_initialize):
15634 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15635 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15636 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15637 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15638
78320123
PE
15639 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15640 if GCC considers string literals to be constants.
49cebcca 15641 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 15642
35ac2a97
SM
156432011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15644
fb103ca9
SM
15645 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15646 (print_preprocess, print_object): New macro to fix last change.
15647
35ac2a97
SM
15648 * print.c (print_preprocess): Don't forget font objects.
15649
62973b41
JB
156502011-03-16 Juanma Barranquero <lekktu@gmail.com>
15651
15652 * emacs.c (USAGE3): Doc fixes.
15653
0e48bb22
AS
156542011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15655
15656 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15657 structure.
15658
7684e57b
JB
156592011-03-14 Juanma Barranquero <lekktu@gmail.com>
15660
15661 * lisp.h (VWindow_system, Qfile_name_history):
15662 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15663 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15664 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15665
15666 * w32select.c: Don't #include "keyboard.h".
c96bbc66 15667 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
15668
15669 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15670 * w32console.c (detect_input_pending, read_input_pending)
15671 (encode_terminal_code):
15672 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15673 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15674 (w32_system_caret_y, Qfile_name_history):
15675 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15676 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15677 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15678 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15679 * w32proc.c (Qlocal, report_file_error):
15680 * w32term.c (Vwindow_system, updating_frame):
15681 * w32uniscribe.c (initialized, uniscribe_font_driver):
15682 Remove unneeded extern declarations.
15683
2aa46d6c
CY
156842011-03-14 Chong Yidong <cyd@stupidchicken.com>
15685
c96bbc66 15686 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 15687
cffc6f3b
CY
156882011-03-13 Chong Yidong <cyd@stupidchicken.com>
15689
15690 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15691 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15692 These macros can no longer be used for assignment.
15693
44f230aa
SM
15694 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15695 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
15696 (record_buffer_markers, fetch_buffer_markers): New functions for
15697 recording and fetching special buffer markers.
15698 (set_buffer_internal_1, set_buffer_temp): Use them.
15699
15700 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15701
15702 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15703
15704 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15705 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15706
15707 * xdisp.c (hscroll_window_tree):
15708 (reconsider_clip_changes): Use PT instead of BUF_PT.
15709
d251f04b
EZ
157102011-03-13 Eli Zaretskii <eliz@gnu.org>
15711
15712 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15713 $(EMACS_ROOT)/lib/intprops.h.
15714
f0c77cd1
PE
157152011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15716
3eca4629
PE
15717 Fix more problems found by GCC 4.5.2's static checks.
15718
7c86ee98
PE
15719 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15720 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
15721 (xg_free_frame_widgets): Make it clear that a local variable is
15722 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
15723 (gdk_window_get_screen): Make it clear that this macro is needed
15724 only if USE_GTK_TOOLTIP.
1e5524e7
PE
15725 (int_gtk_range_get_value): New function, which avoids a diagnostic
15726 from gcc -Wbad-function-cast.
15727 (xg_set_toolkit_scroll_bar_thumb): Use it.
15728 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15729 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
15730 (get_utf8_string, xg_get_file_with_chooser):
15731 Rename locals to avoid shadowing.
15732 (create_dialog): Move locals to avoid shadowing.
7c86ee98 15733
41729b81
PE
15734 * xgselect.c (xg_select): Remove unused var.
15735
f0c77cd1
PE
15736 * image.c (four_corners_best): Mark locals as initialized.
15737 (gif_load): Initialize transparent_p to zero (Bug#8238).
15738 Mark another local as initialized.
ec6cf4c6 15739 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 15740
ce0ad53d 15741 * image.c (clear_image_cache): Now static.
d5d5a617 15742 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 15743 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
15744 (x_edge_detection): Remove unnecessary cast that
15745 gcc -Wbad-function-cast diagnoses.
2037898d 15746 (gif_load): Fix pointer signedness.
6ae141d6
PE
15747 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15748 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 15749
33383987 157502011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 15751
d32df629
PE
15752 Improve quality of tests for time stamp overflow.
15753 For example, without this patch (encode-time 0 0 0 1 1
15754 1152921504606846976) returns the obviously-bogus value (-948597
15755 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
15756 reports time overflow. See
15757 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
15758 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15759 * editfns.c: Include limits.h and intprops.h.
15760 (TIME_T_MIN, TIME_T_MAX): New macros.
15761 (time_overflow): Move earlier, to before first use.
15762 (hi_time, lo_time): New functions, for an accurate test for
15763 out-of-range times.
15764 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15765 (Fget_internal_run_time): Don't assume time_t fits in int.
15766 (make_time): Use list2 instead of Fcons twice.
15767 (Fdecode_time): More accurate test for out-of-range times.
15768 (check_tm_member): New function.
15769 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
15770 (lisp_time_argument): Don't rely on undefined left-shift and
15771 right-shift behavior when checking for time stamp overflow.
8be6f318 15772
fe31d94c
PE
15773 * editfns.c (time_overflow): New function, refactoring common code.
15774 (Fformat_time_string, Fdecode_time, Fencode_time):
15775 (Fcurrent_time_string): Use it.
15776
8be6f318
PE
15777 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15778 * dired.c (make_time): Move to ...
15779 * editfns.c (make_time): ... here.
15780 * systime.h: Note the move.
15781
09d9db2c 157822011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 15783
126bc0dc
YM
15784 * fringe.c (update_window_fringes): Remove unused variables.
15785
c47cbdfd
YM
15786 * unexmacosx.c (copy_data_segment): Also copy __got section.
15787 (Bug#8223)
15788
7ac80be9
EZ
157892011-03-12 Eli Zaretskii <eliz@gnu.org>
15790
c96bbc66 15791 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
15792 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15793 Constify `char *' arguments and their references according to
15794 prototypes in tparam.h.
15795
ecb0f94d 15796 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 15797
7ac80be9
EZ
15798 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15799 Adapt all references accordingly.
15800
15801 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15802
ef1fd07e
TT
158032011-03-11 Tom Tromey <tromey@redhat.com>
15804
15805 * buffer.c (syms_of_buffer): Remove obsolete comment.
15806
7ef4b50c
EZ
158072011-03-11 Eli Zaretskii <eliz@gnu.org>
15808
15809 * termhooks.h (encode_terminal_code): Declare prototype.
15810
15811 * msdos.c (encode_terminal_code): Don't declare prototype.
15812
15813 * term.c (encode_terminal_code): Now external again, used by
15814 w32console.c and msdos.c.
15815
44f230aa
SM
15816 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
15817 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 15818
4b1ec863 158192011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 15820
1714f52b 15821 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 15822
4b1ec863
PE
15823 * fringe.c (update_window_fringes): Mark locals as initialized
15824 (Bug#8227).
15825 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 15826
524c7aa6
PE
15827 * alloc.c (mark_fringe_data): Move decl from here ...
15828 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15829 to check its interface.
15830 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15831
a5c0af81 15832 * fontset.c (free_realized_fontset): Now static.
7519b8cd 15833 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 15834 (fontset_font): Mark local as initialized.
a9a06e0b 15835 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 15836
b4716021
PE
15837 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15838
811e9bac 15839 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 15840 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
15841 (x_own_selection, Fx_disown_selection_internal): Rename locals
15842 to avoid shadowing.
15843 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 15844
7e3ab302
PE
15845 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15846 so that the caller can use some name other than gcpro1.
15847 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
15848 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15849 (Fx_backspace_delete_keys_p):
15850 Use them to avoid shadowing, and rename vars to avoid shadowing.
15851 (x_decode_color, x_set_name, x_window): Now static.
6b437900 15852 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 15853 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
15854 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15855 Remove unused locals.
7e3ab302
PE
15856 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15857 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15858 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15859 macros.
f78faa98 15860
e2b13473
PE
15861 * xterm.h (x_mouse_leave): New decl.
15862
77f23912
PE
15863 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15864 Remove unused functions.
cdf4ba58
PE
15865 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15866 (x_calc_absolute_position): Now static.
7411c686 15867 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 15868 Don't declare local "event" unless it's used.
ed7bf3a5
PE
15869 (x_iconify_frame, x_free_frame_resources): Don't declare locals
15870 unless they are used.
38d0b34a
PE
15871 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
15872 (x_fatal_error_signal): Remove; not used.
a6067996
PE
15873 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
15874 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
15875 (x_error_catcher, x_connection_closed, x_error_handler):
15876 (x_error_quitter, xembed_send_message, x_iconify_frame):
15877 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 15878 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 15879 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 15880
44f230aa
SM
15881 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
15882 Rename or move locals to avoid shadowing.
6b463e58 15883 (tty_defined_color, merge_face_heights): Now static.
5967d051 15884 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
15885 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
15886 does not deduce is never used uninitialized.
73719eba
PE
15887 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
15888 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 15889
426994c3 15890 * terminal.c (store_terminal_param): Now static.
5489860b 15891
032f1620 15892 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 15893 (set_frame_menubar): Remove unused local.
d4323972 15894 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
15895 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
15896 since they might point to immutable storage.
281585b0
PE
15897 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
15898 since it's unused otherwise.
032f1620 15899
367c19e5 15900 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 15901 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
15902 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
15903 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 15904 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
15905 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
15906 does not deduce are never used uninitialized.
70739cbe 15907
07b48fa9
PE
15908 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
15909
8868a238 15910 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
15911 * window.c (window_loop, size_window):
15912 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 15913
7e5cf297 15914 * window.c (display_buffer): Now static.
d6550a9f
PE
15915 (size_window): Mark variables that gcc -Wuninitialized
15916 does not deduce are never used uninitialized.
a586633d
PE
15917 * window.h (check_all_windows): New decl, to forestall
15918 gcc -Wmissing-prototypes diagnostic.
5b555da1 15919 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 15920
f6095868
PE
15921 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
15922 shadowing.
15923 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
15924 Include <limits.h>.
15925 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
15926 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
15927 (load_charset_map): Mark variables that gcc -Wuninitialized
15928 does not deduce are never used uninitialized.
53df7c11 15929 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 15930
f38b440c
PE
15931 * coding.c (coding_set_source, coding_set_destination):
15932 Use "else { /* comment */ }" rather than "else /* comment */;"
15933 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
15934 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
15935 a block, when the outer 'i' will do.
15936 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
15937 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
15938 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
15939 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
15940 (Fdecode_sjis_char, Fdefine_coding_system_internal):
15941 Rename locals to avoid shadowing.
15942 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
15943 * coding.c (emacs_mule_char, encode_invocation_designation):
15944 Now static, since they're not used elsewhere.
413bb2db 15945 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 15946 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
15947 (decode_coding_emacs_mule): Mark variables that gcc
15948 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
15949 (detect_coding_iso_2022): Initialize a local variable that might
15950 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 15951 this initialization is needed. (Bug#8211)
5f58e762
PE
15952 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
15953 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
15954 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
15955 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
15956 Remove unused macros.
f38b440c 15957
232b38b9 15958 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 15959 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 15960 * character.c (string_count_byte8): Likewise.
232b38b9 15961
fb90da1b
PE
15962 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
15963 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
15964
fb93dbc2
PE
15965 * chartab.c (copy_sub_char_table): Now static, since it's not used
15966 elsewhere.
5c156ace
PE
15967 (sub_char_table_ref_and_range, char_table_ref_and_range):
15968 Rename locals to avoid shadowing.
bbcd0949 15969 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 15970
7d3b3862 15971 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 15972 (BIDI_BOB): Remove unused macro.
7d3b3862 15973
6be7d3da
PE
15974 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
15975 deduce are never used uninitialized.
c2ed9c8b 15976 * term.c (encode_terminal_code): Likewise.
6be7d3da 15977
75f8807f 15978 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 15979
50938595
PE
15980 * tparam.h: New file.
15981 * term.c, tparam.h: Include it.
15982 * deps.mk (term.o, tparam.o): Depend on tparam.h.
15983 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
15984 Move these decls to tparam.h, and make them agree with what
15985 is actually in tparam.c. The previous trick of using incompatible
15986 decls in different modules does not conform to the C standard.
15987 All callers of tparam changed to use tparam's actual API.
15988 * tparam.c (tparam1, tparam, tgoto):
15989 Use const pointers where appropriate.
15990
fbceeba2
PE
15991 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
15992 * cm.h (struct cm): Likewise.
15993 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
15994 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
15995 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
15996 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
15997 (turn_on_face, init_tty): Likewise.
15998 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 15999
7f3f1250
PE
16000 * term.c (term_mouse_position): Rename local to avoid shadowing.
16001
e6ca6543
PE
16002 * alloc.c (mark_ttys): Move decl from here ...
16003 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16004
c40f8d15
AS
160052011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16006
16007 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16008
cfe0661d
JB
160092011-03-09 Juanma Barranquero <lekktu@gmail.com>
16010
16011 * search.c (compile_pattern_1): Remove argument regp, unused since
16012 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16013 (compile_pattern): Don't pass it.
16014
0afb4571
J
160152011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16016
16017 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16018 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16019 for ! HAVE_GTK3.
16020 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16021
16022 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16023
16024 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16025 gdk_window_get_screen, gdk_window_get_geometry,
16026 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16027 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16028 (xg_get_pixbuf_from_pixmap): New function.
16029 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16030 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16031 Call xg_get_pixbuf_from_pixmap instead of
16032 gdk_pixbuf_get_from_drawable.
16033 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16034 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16035 (xg_check_special_colors): Use GtkStyleContext and its functions
16036 for HAVE_GTK3.
16037 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16038 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16039 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
16040 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16041 Call gtk_widget_get_preferred_size.
0afb4571
J
16042 (xg_frame_resized): gdk_window_get_geometry only takes 5
16043 parameters.
44f230aa
SM
16044 (xg_win_to_widget, xg_event_is_for_menubar):
16045 Call gdk_x11_window_lookup_for_display.
0afb4571
J
16046 (xg_set_widget_bg): New function.
16047 (delete_cb): New function.
895009e1 16048 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 16049 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
16050 (xg_set_background_color): Call xg_set_widget_bg.
16051 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16052 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16053 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16054 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16055 if ! HAVE_GTK3.
16056 (update_frame_tool_bar): Call gtk_widget_hide.
16057 (xg_initialize): Use GDK_KEY_g.
16058
16059 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16060 if ! HAVE_GTK3
16061 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16062
16063 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16064 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16065 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16066
1c2cc4ef
JB
160672011-03-08 Juanma Barranquero <lekktu@gmail.com>
16068
16069 * w32xfns.c (select_palette): Check success of RealizePalette against
16070 GDI_ERROR, not zero.
16071
33383987 16072See ChangeLog.11 for earlier changes.
aac0c6e3
MR
16073
16074;; Local Variables:
16075;; coding: utf-8
aac0c6e3
MR
16076;; End:
16077
2f097256 16078 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
16079
16080 This file is part of GNU Emacs.
16081
16082 GNU Emacs is free software: you can redistribute it and/or modify
16083 it under the terms of the GNU General Public License as published by
16084 the Free Software Foundation, either version 3 of the License, or
16085 (at your option) any later version.
16086
16087 GNU Emacs is distributed in the hope that it will be useful,
16088 but WITHOUT ANY WARRANTY; without even the implied warranty of
16089 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16090 GNU General Public License for more details.
16091
16092 You should have received a copy of the GNU General Public License
16093 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.