* cmds.c, coding.c: Use bool for booleans.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
f10fe38f
PE
12012-08-27 Paul Eggert <eggert@cs.ucla.edu>
2
3 * cmds.c, coding.c: Use bool for booleans.
4 * cmds.c (move_point, Fself_insert_command):
5 * coding.h (struct composition status, struct coding_system):
6 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
7 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
8 (emacs_mule_char, decode_coding_emacs_mule)
9 (encode_coding_emacs_mule, detect_coding_iso_2022)
10 (decode_coding_iso_2022, encode_invocation_designation)
11 (encode_designation_at_bol, encode_coding_iso_2022)
12 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
13 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
14 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
15 (encode_coding_raw_text, detect_coding_charset)
16 (decode_coding_charset, encode_coding_charset, detect_eol)
17 (detect_coding, get_translation_table, produce_chars)
18 (consume_chars, reused_workbuf_in_use)
19 (make_conversion_work_buffer, code_conversion_save)
20 (decode_coding_object, encode_coding_object)
21 (detect_coding_system, char_encodable_p)
22 (Funencodable_char_position, code_convert_region)
23 (code_convert_string, code_convert_string_norecord)
24 (Fset_coding_system_priority):
25 * fileio.c (Finsert_file_contents):
26 Use bool for booleans.
27 * coding.h, lisp.h: Reflect above API changes.
28 * coding.c: Remove unnecessary static function decls.
29 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
30 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
31 not a boolean 'int', since callers never look at the return value.
32 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
33 * coding.h (decoding_buffer_size, encoding_buffer_size)
34 (emacs_mule_string_char): Remove unused extern decls.
35 (struct iso_2022_spec, struct coding_system):
36 Use 'unsigned int : 1' for boolean fields, since there's more than one.
37 (struct emacs_mule_spec): Remove unused field 'full_support'.
38 All initializations removed.
39 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
40
5474c384
DA
412012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
42
f10fe38f 43 Fix spare memory change (Bug#12286).
5474c384
DA
44 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
45 (valid_lisp_object_p): Likewise.
46
c4b6914d
MR
472012-08-27 Martin Rudalics <rudalics@gmx.at>
48
49 * window.c (Fset_window_configuration): Record any window's old
50 buffer if it's replaced (see Bug#8789). If the new current
51 buffer doesn't appear in the selected window, go to its old
52 point (Bug#12208).
53
35aaa1ea
DA
542012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
55
56 Special MEM_TYPE_SPARE to denote reserved memory.
57 * alloc.c (enum mem_type): New memory type.
58 (refill_memory_reserve): Use new type for spare memory.
59 This prevents live_cons_p and live_string_p from incorrect
60 detection of uninitialized objects from spare memory as live.
61
6af64513
PE
622012-08-26 Paul Eggert <eggert@cs.ucla.edu>
63
8b2e00a3
PE
64 Spelling fixes.
65 * Makefile.in (.PHONY): versioclean -> versionclean.
66
b52d6985
PE
67 Remove unused external symbols.
68 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
69 * window.c (Qwindow_valid_p, decode_valid_window):
70 Now static, not extern.
71 * data.c (Qinterval): Remove; unused.
72 (syms_of_data): Do not define 'interval'.
73 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
74 * window.h (decode_valid_window):
75 Remove decls.
76
d5172d4f
PE
77 * character.c, charset.c, chartab.c: Use bool for booleans.
78 * character.c (lisp_string_width, string_count_byte8)
79 (string_escape_byte8):
80 * charset.c (charset_map_loaded, load_charset_map, read_hex):
81 (load_charset_map_from_file, map_charset_chars)
82 (Fdefine_charset_internal, define_charset_internal)
83 (Fdeclare_equiv_charset, find_charsets_in_text)
84 (Ffind_charset_region, char_charset, Fiso_charset):
85 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
86 (sub_char_table_set, sub_char_table_set_range)
87 (char_table_set_range, optimize_sub_char_table)
88 (map_sub_char_table):
89 Use bool for boolean.
90 * character.c (str_to_unibyte): Omit last boolean argument; it was
91 always 0. All callers changed.
92 * character.h, charset.h: Adjust to match previous changes.
93 * character.h (char_printable_p): Remove decl of nonexistent function.
94 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
95 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
96 are all boolean, so make them single-bit bitfields.
97
6af64513
PE
98 * lisp.h (ASET): Remove attempt to detect side effects.
99 It was meant to be temporary and it often doesn't work,
100 because when IDX has side effects the behavior of IDX==IDX
101 is undefined. See Stefan Monnier in
102 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
103
e1f29348
BR
1042012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
105
106 * lisp.h (functionp): New function (extracted from Ffunctionp).
107 (FUNCTIONP): Use it.
108 * eval.c (Ffunctionp): Use it.
109
17c05d74
PE
1102012-08-25 Paul Eggert <eggert@cs.ucla.edu>
111
0f46bc75
PE
112 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
113 as that's faster and simpler than static storage. Don't bother
114 with the g_main_context_query overhead if g_main_context_pending
115 says no events are pending.
116 (gfds, gfds_size): Remove these static vars.
117 (xgselect_initialize): Remove; no longer needed.
118 All uses and decls removed.
119
ee4c0f69
PE
120 * emacs.c (fatal_error_signal_hook): Remove.
121 All uses removed. This leftover from old code was always 0.
122
17c05d74
PE
123 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
124 * casefiddle.c (casify_object, casify_region):
125 * casetab.c (set_case_table):
126 * category.c, category.h (word_boundary_p):
127 * category.h (CHAR_HAS_CATEGORY):
128 Use bool for booleans, instead of int.
129
391ceac5
EZ
1302012-08-25 Eli Zaretskii <eliz@gnu.org>
131
132 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
133
2f221583
PE
1342012-08-25 Paul Eggert <eggert@cs.ucla.edu>
135
f4a681b0
PE
136 On assertion failure, print backtrace if available.
137 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
138 (die) [ENABLE_CHECKING]: Print a backtrace if available.
139 * Makefile.in (LIB_EXECINFO): New macro.
140 (LIBES): Use it.
141
2f221583
PE
142 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
143 * bytecode.c (exec_byte_code):
144 * callint.c (check_mark, Fcall_interactively):
145 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
146 (getenv_internal, sync_process_alive, call_process_exited):
147 * lisp.h (USE_SAFE_ALLOCA):
148 Use bool for booleans, instead of int.
149 * lisp.h, process.h: Adjust prototypes to match above changes.
150 * callint.c (Fcall_interactively): Don't assume the mark's
151 offset fits in 'int'.
152
37ef52bb
PE
1532012-08-24 Paul Eggert <eggert@cs.ucla.edu>
154
155 * buffer.c, buffer.h: Use bool for boolean.
156 * buffer.c (reset_buffer_local_variables)
157 (buffer_lisp_local_variables, Fset_buffer_modified_p)
158 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
159 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
160 (overlay_touches_p, overlay_strings, Foverlay_put)
161 (report_overlay_modification, call_overlay_mod_hooks):
162 (mmap_enlarge, mmap_set_vars):
163 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
164 Use bool for booleans, instead of int.
165 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
166 since the 1-or-0 return value is always ignored anyway.
167 (mmap_initialized_p):
168 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
169 * buffer.h, lisp.h: Adjust prototypes to match above changes.
170
2cc21167
PE
1712012-08-23 Paul Eggert <eggert@cs.ucla.edu>
172
173 * bidi.c: Use bool for boolean.
174 This is a bit more readable, and makes the text segment of bidi.o
175 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
176 Presumably it's faster too.
177 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
178 Now bool.
179 (bidi_cache_find_level_change, bidi_cache_iterator_state)
180 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
181 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
182 (bidi_explicit_dir_char, bidi_level_of_next_char)
183 (bidi_find_other_level_edge, bidi_move_to_visually_next):
184 Use bool for booleans, instead of int.
185 * dispextern.h (bidi_init_it, bidi_paragraph_init)
186 (bidi_unshelve_cache): Adjust decls to match code.
187
7db4ddf4
MR
1882012-08-23 Martin Rudalics <rudalics@gmx.at>
189
190 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
191 argument.
192
b1bb8011
PE
1932012-08-23 Paul Eggert <eggert@cs.ucla.edu>
194
195 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
196 * atimer.h: Include <stdbool.h>.
197
ff687885
DN
1982012-08-22 Dan Nicolaescu <dann@gnu.org>
199
200 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
201 compile time tests instead of run time tests on systems that do
202 not use them.
203 (FRAME_MAC_P): Remove leftover from deleted code.
204 * frame.c (syms_of_frame): Remove leftover from deleted code.
205
4ce7a138
JD
2062012-08-22 Jan Djärv <jan.h.d@swipnet.se>
207
208 * nsterm.m (insertText:): Don't clear modifiers if code is space.
209
d733ec6d
PE
2102012-08-22 Paul Eggert <eggert@cs.ucla.edu>
211
212 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
213 Otherwise, the compiler complains about (A?B:C) where B is void
214 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
215 (fontset_add): Return void, for FONTSET_ADD.
216
d0d2d26f
PE
2172012-08-21 Paul Eggert <eggert@cs.ucla.edu>
218
fce31d69
PE
219 * alloc.c: Use bool for booleans.
220 (gc_in_progress, abort_on_gc)
221 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
222 (dont_register_blocks) [GC_MALLOC_CHECK]:
223 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
224 (check_string_bytes, make_specified_string, memory_full)
225 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
226 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
227 (mark_stack, valid_pointer_p, make_pure_string)
228 (Fgarbage_collect, survives_gc_p, gc_sweep):
229 Use bool for booleans, instead of int.
230 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
231 Remove unused local.
232 * alloc.c (PURE_POINTER_P):
233 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
234 * editfns.c (Fformat):
235 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
236 (Fdo_auto_save):
237 * fns.c (sweep_weak_table):
238 * lisp.h (suppress_checking, push_message, survives_gc_p)
239 (make_pure_string, gc_in_progress, abort_on_gc):
240 * lread.c (readchar, read1):
241 * print.c (Fprin1_to_string):
242 * xdisp.c (push_message):
243 Use bool for booleans affected directly or indirectly by
244 alloc.c's changes.
245
d0d2d26f
PE
246 Make recently-introduced setters macros.
247 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
248 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
249 (set_fontset_default, set_fontset_fallback): Rename from their
250 upper-case counterparts, and make them functions rather than macros.
251 This is more consistent with the other recently-introduced setters.
252 These don't need to be inline, since they're local.
253
d18e2bb6
JD
2542012-08-21 Jan Djärv <jan.h.d@swipnet.se>
255
256 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
257 the loop (Bug#12247).
258
1b9d9d16
PE
2592012-08-21 Paul Eggert <eggert@cs.ucla.edu>
260
261 * lisp.h (vcopy): Use memcpy rather than our own loop.
262 This fixes a performance regression introduced by the recent
263 addition of vcopy. This means 'vcopy' will need to be modified
264 for a copying collector, but that's OK. Also, tighten the
265 checking in the assertion.
266
b2f09701
EZ
2672012-08-21 Eli Zaretskii <eliz@gnu.org>
268
269 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
270 components for RTL text (Bug#11860). Adjust X-OFFSET of each
271 non-base glyph for the width of the base character, according to
e1f29348
BR
272 what x_draw_composite_glyph_string_foreground expects.
273 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
274 expectations, to produce correct width of the composed character.
275 Reverse the sign of the DU offset produced by ScriptPlace.
276
9b994fed
PE
2772012-08-21 Paul Eggert <eggert@cs.ucla.edu>
278
279 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
280
086ca913
DA
2812012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
282
283 Avoid direct writes to contents member of struct Lisp_Vector.
284 * lisp.h (vcopy): New function to copy data into vector.
285 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
286 * fns.c (Ffillarray): Use ASET.
287 * keyboard.c (timer_check_2): Use AREF and ASET.
288 (append_tool_bar_item, Frecent_keys): Use vcopy.
289 * lread.c (read_vector): Use ASET.
290 * msdos.c (Frecent_doskeys): Use vcopy.
291 * xface.c (Finternal_copy_lisp_face): Use vcopy.
292 (Finternal_merge_in_global_face): Use ASET and vcopy.
293 * xfont.c (xfont_list_pattern): Likewise.
294
5481664a
MR
2952012-08-21 Martin Rudalics <rudalics@gmx.at>
296
297 * window.c (Fwindow_point): For the selected window always return
298 the position of its buffer's point.
299 (Fset_window_point): For the selected window always go in its
300 buffer to the specified position.
301
6d470bdd
DA
3022012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
303
304 Setter macros for fontsets.
305 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
306 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
307 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
308 Adjust users.
309
24564fe1
GM
3102012-08-20 Glenn Morris <rgm@gnu.org>
311
312 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
313 Don't assume that `ln -f' works.
314
0a05a035
EZ
3152012-08-20 Eli Zaretskii <eliz@gnu.org>
316
317 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
318 and later about non-assignments with no effect. See discussion at
319 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
320 details.
321
e46f2325
DA
3222012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
323
324 Inline setter functions for Lisp_Objects slots of struct specbinding.
325 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
326 Adjust users.
327
734fbd86
MR
3282012-08-20 Martin Rudalics <rudalics@gmx.at>
329
330 * window.c (select_window): Always make selected window's buffer
331 current.
332
f1a95992
DA
3332012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
334
335 Use AREF and ASET for docstrings of category tables.
336 * category.h (CATEGORY_DOCSTRING): Use AREF.
337 (SET_CATEGORY_DOCSTRING): Use ASET.
338 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
339
e83064be
DA
3402012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
341
342 Inline setter functions for hash table members.
343 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
344 (set_hash_hash, set_hash_index): Rename with _slot suffix.
345 (set_hash_key_and_value, set_hash_index, set_hash_next)
346 (set_hash_hash): New functions.
347 * charset.c, fns.c: Adjust users.
348
4ce60d2e
DA
3492012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
350
351 Inline getter and setter functions for per-buffer values.
352 * buffer.h (per_buffer_default, set_per_buffer_default)
353 (per_buffer_value, set_per_buffer_value): New functions.
354 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
355 * buffer.c, data.c: Adjust users.
356
c06c9690
JB
3572012-08-20 Juanma Barranquero <lekktu@gmail.com>
358
359 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
360
32bd4250
PE
3612012-08-19 Paul Eggert <eggert@cs.ucla.edu>
362
bad03192 363 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
364 as gnulib does this if the system doesn't.
365 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
366 Remove declaration. MS-Windows declares it on stdlib.h which is
367 included by conf_post.h.
b69a6d22
PE
368 * emacs.c (environ) [DOUG_LEA_MALLOC]:
369 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
370 * vm-limit.c: Include <unistd.h>, for 'environ'.
371
22d7feb2
PE
372 * unexaix.c, unexcoff.c: Include "mem-limits.h".
373 (start_of_data): Remove decl; mem-limits.h provides it.
374
32bd4250
PE
375 * xdisp.c (handle_invisible_prop): Make it a bit faster
376 and avoid a gcc -Wmaybe-uninitialized diagnostic.
377
450809af
CY
3782012-08-19 Chong Yidong <cyd@gnu.org>
379
380 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
381 ends (Bug#3874).
382
9e677988
AS
3832012-08-19 Andreas Schwab <schwab@linux-m68k.org>
384
6b1319ce
AS
385 * .gdbinit: Use call instead of set when calling a function in the
386 inferior.
387
9e677988
AS
388 * data.c (set_internal): Don't use set_blv_found.
389 (Fkill_local_variable): Likewise.
390
d7191076
AA
3912012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
392
393 * nsfont.m (ns_ascii_average_width): Ensure the string
394 ascii_printable is initialized with a null-terminated character
395 array. Otherwise, it can contain undesired extra characters.
396
e757f1c6
PE
3972012-08-18 Paul Eggert <eggert@cs.ucla.edu>
398
399 port new setting code to Sun C 5.8 2005/10/13
400 * chartab.c, lisp.h (char_table_set, char_table_set_range):
401 Return void, not Lisp_Object. Otherwise, the compiler
402 complains about (A?B:C) where B is void and C is Lisp_Object
403 when compiling CHAR_TABLE_SET, due to the recent change to
404 the API of sub_char_table_set_contents.
405
a999ce26
CY
4062012-08-18 Chong Yidong <cyd@gnu.org>
407
408 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
409 for the string case (Bug#3874).
410
3f22b86f
PE
4112012-08-18 Paul Eggert <eggert@cs.ucla.edu>
412
39eb03f1
PE
413 * buffer.h (BSET): Remove (Bug#12215).
414 Replace all uses with calls to new setter functions.
415 (bset_bidi_paragraph_direction, bset_case_canon_table)
416 (bset_case_eqv_table, bset_directory, bset_display_count)
417 (bset_display_time, bset_downcase_table)
418 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
419 (bset_last_selected_window, bset_local_var_alist)
420 (bset_mark_active, bset_point_before_scroll, bset_read_only)
421 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
422 (bset_width_table):
423 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
424 (bset_auto_fill_function, bset_auto_save_file_format)
425 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
426 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
427 (bset_cache_long_line_scans, bset_case_fold_search)
428 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
429 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
430 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
431 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
432 (bset_header_line_format, bset_indicate_buffer_boundaries)
433 (bset_indicate_empty_lines, bset_invisibility_spec)
434 (bset_left_fringe_width, bset_major_mode, bset_mark)
435 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
436 (bset_name, bset_overwrite_mode, bset_pt_marker)
437 (bset_right_fringe_width, bset_save_length)
438 (bset_scroll_bar_width, bset_scroll_down_aggressively)
439 (bset_scroll_up_aggressively, bset_selective_display)
440 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
441 (bset_word_wrap, bset_zv_marker):
442 * category.c (bset_category_table):
443 * syntax.c (bset_syntax_table):
444 New setter functions.
445
6a09a33b
PE
446 * process.h (PSET): Remove (Bug#12215).
447 Replace all uses with calls to new setter functions.
448 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
449 (PROCESS_INLINE): New macro.
450 (pset_childp): New setter function.
451 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
452 * process.c (PROCESS_INLINE):
453 Define to EXTERN_INLINE, so that the corresponding functions
454 are compiled into code.
455 (pset_buffer, pset_command, pset_decode_coding_system)
456 (pset_decoding_buf, pset_encode_coding_system)
457 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
458 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
459 (pset_type, pset_write_queue): New setter functions.
460
e8c17b81
PE
461 * window.h (WSET): Remove (Bug#12215).
462 Replace all uses with calls to new setter functions.
463 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
464 (WINDOW_INLINE): New macro.
465 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
466 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
467 (wset_total_lines, wset_vertical_scroll_bar)
468 (wset_window_end_pos, wset_window_end_valid)
469 (wset_window_end_vpos): New setter functions.
470 * window.c (WINDOW_INLINE):
471 Define to EXTERN_INLINE, so that the corresponding functions
472 are compiled into code.
473 (wset_combination_limit, wset_dedicated, wset_display_table)
474 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
475 (wset_new_normal, wset_new_total, wset_next_buffers)
476 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
477 (wset_prev_buffers, wset_right_fringe_width)
478 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
479 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
480 (wset_window_parameters):
481 * xdisp.c (wset_base_line_number, wset_base_line_pos)
482 (wset_column_number_displayed, wset_region_showing):
483 New setter functions.
484
3f22b86f
PE
485 * termhooks.h (TSET): Remove (Bug#12215).
486 Replace all uses with calls to new setter functions.
487 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
488 (TERMHOOKS_INLINE): New macro.
489 (tset_charset_list, tset_selection_alist): New setter functions.
490 * terminal.c (TERMHOOKS_INLINE):
491 Define to EXTERN_INLINE, so that the corresponding functions
492 are compiled into code.
493 (tset_param_alist): New setter function.
494
742af32f
PE
4952012-08-17 Paul Eggert <eggert@cs.ucla.edu>
496
15dbb4d6
PE
497 * keyboard.h (KSET): Remove (Bug#12215).
498 Replace all uses with calls to new setter functions.
499 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
500 (KEYBOARD_INLINE): New macro.
501 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
502 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
503 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
504 New setter functions.
505 * keyboard.c (KEYBOARD_INLINE):
506 Define to EXTERN_INLINE, so that the corresponding functions
507 are compiled into code.
508 (kset_echo_string, kset_kbd_queue)
509 (kset_keyboard_translate_table, kset_last_prefix_arg)
510 (kset_last_repeatable_command, kset_local_function_key_map)
511 (kset_overriding_terminal_local_map, kset_real_last_command)
512 (kset_system_key_syms): New setter functions.
513
f00af5b1
PE
514 * frame.h (FSET): Remove (Bug#12215).
515 Replace all uses with calls to new setter functions.
516 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
517 (FRAME_INLINE): New macro.
518 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
519 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
520 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
521 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
522 (fset_param_alist, fset_root_window, fset_scroll_bars)
523 (fset_selected_window, fset_title, fset_tool_bar_items)
524 (fset_tool_bar_position, fset_tool_bar_window): New functions.
525 * frame.c (FRAME_INLINE):
526 Define to EXTERN_INLINE, so that the corresponding functions
527 are compiled into code.
528 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
529
0c94c8d6
PE
530 A few more naming-convention fixes for getters and setters.
531 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
532 and rename from buffer_overlays_set_before.
533 (set_buffer_overlays_after): Move here from buffer.h, and rename
534 from buffer_overlays_set_after.
535 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
536 All uses changed.
537 (set_buffer_intervals): Rename from buffer_set_intervals.
538 * intervals.c (set_interval_object): Move here from intervals.h,
539 and rename from interval_set_object.
540 (set_interval_left): Move here from intervals.h, and rename from
541 interval_set_left.
542 (set_interval_right): Move here from intervals.h, and rename from
543 interval_set_right.
544 (copy_interval_parent): Move here from intervals.h, and rename from
545 interval_copy_parent.
546 * intervals.h (set_interval_parent): Rename from interval_set_parent.
547 (set_interval_plist): Rename from interval_set_plist.
548 Return void, not Lisp_Object, since no caller uses the result.
549 * lisp.h (string_intervals): Rename from string_get_intervals.
550 (set_string_intervals): Rename from string_set_intervals.
551
34dabdb7
PE
552 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
553 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 554 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
555 All uses changed. See the end of
556 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
557
742af32f
PE
558 * lisp.h (CSET): Remove (Bug#12215).
559 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
560 (set_char_table_purpose): New functions,
561 replacing CSET. All uses changed. For example, replace
562 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 563 "set_char_table_parent (char_table, parent);".
742af32f
PE
564 The old version was confusing because it used the same name
565 'parent' for two different things.
566
a04e2c62
DA
5672012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
568
569 Functions to get and set Lisp_Object fields of buffer-local variables.
570 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
571 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
572 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
573 * data.c, eval.c, frame.c: Adjust users.
574
383dcbf9
CY
5752012-08-17 Chong Yidong <cyd@gnu.org>
576
577 * xfaces.c (merge_face_vectors): If the target font specfies a
578 font spec, make the font's attributes take precedence over
579 directly-specified attributes.
580 (merge_face_ref): Recognize :font.
581
44386687
DA
5822012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
583
584 Do not use memcpy for copying intervals.
585 * intervals.c (reproduce_interval): New function.
586 (reproduce_tree, reproduce_tree_obj): Use it.
587 (reproduce_tree_obj): Remove prototype.
588
927c7216
PE
5892012-08-17 Paul Eggert <eggert@cs.ucla.edu>
590
591 * lisp.h (duration_to_sec_usec): Remove unused decl.
592
93044f7b
AA
5932012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
594
595 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
596 to an allocated instance of NSString, not to the class itself.
597
9851e4a5
JB
5982012-08-17 Juanma Barranquero <lekktu@gmail.com>
599
600 * makefile.w32-in (C_CTYPE_H): New macro.
601 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
602 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
603 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
604
620f13b0
PE
6052012-08-16 Paul Eggert <eggert@cs.ucla.edu>
606
607 Use ASCII tests for character types.
608 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
609 * xfns.c, xterm.c:
610 Don't include <ctype.h>; was not needed.
611 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
612 * sysdep.c, xfaces.c:
613 Include <c-ctype.h> instead of <ctype.h>.
614 * nsterm.m: Include <c-ctype.h>.
615 * charset.c (read_hex):
616 * doc.c (Fsnarf_documentation):
617 * fileio.c (IS_DRIVE) [WINDOWSNT]:
618 (DRIVE_LETTER) [DOS_NT]:
619 (Ffile_name_directory, Fexpand_file_name)
620 (Fsubstitute_in_file_name):
621 * font.c (font_parse_xlfd, font_parse_fcname):
622 * frame.c (x_set_font_backend):
623 * gtkutil.c (xg_get_font):
624 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
625 * nsimage.m (hexchar):
626 * nsterm.m (ns_xlfd_to_fontname):
627 * sysdep.c (system_process_attributes):
628 * xfaces.c (hash_string_case_insensitive):
629 Use C-locale tests instead of locale-specific tests for character
630 types, since we want the ASCII interpretation here, not the
631 interpretation suitable for whatever happens to be the current locale.
632
52162052
MR
6332012-08-16 Martin Rudalics <rudalics@gmx.at>
634
635 Consistently check windows for validity/liveness
636 (Bug#11984, Bug#12025, Bug#12026).
637 * lisp.h (CHECK_VALID_WINDOW): New macro.
638 * window.c (decode_window): Rename to decode_live_window.
639 (decode_valid_window, Fwindow_valid_p): New functions.
640 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
641 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
642 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
643 (Fwindow_prev_sibling, Fwindow_combination_limit)
644 (Fset_window_combination_limit, Fwindow_use_time)
645 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
646 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
647 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
648 (Fwindow_hscroll, Fset_window_hscroll)
649 (Fwindow_redisplay_end_trigger)
650 (Fset_window_redisplay_end_trigger, Fwindow_edges)
651 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
652 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
653 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
654 (Fwindow_end, Fset_window_point, Fset_window_start)
655 (Fpos_visible_in_window_p, Fwindow_line_height)
656 (Fwindow_dedicated_p, Fset_window_dedicated_p)
657 (Fwindow_prev_buffers, Fset_window_prev_buffers)
658 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
659 (Fset_window_parameter, Fwindow_display_table)
660 (Fset_window_display_table, Fdelete_other_windows_internal)
661 (Fset_window_buffer, Fset_window_new_total)
662 (Fset_window_new_normal, Fdelete_window_internal)
663 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
664 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
665 (Fwindow_scroll_bars): Check whether argument window is a valid or
666 live window. Update doc-strings.
667 (syms_of_window): New symbol Qwindow_valid_p.
668 * keyboard.c (Fposn_at_x_y): Check whether argument
669 frame_or_window denotes a valid window.
670
2751c80f
DA
6712012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
672
673 Fix previous char table change.
674 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
675 * chartab.c (optimize_sub_char_table): Likewise.
676
032a42c8
CY
6772012-08-16 Chong Yidong <cyd@gnu.org>
678
a2d19368
CY
679 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
680
032a42c8
CY
681 * xfont.c (xfont_open):
682 * xftfont.c (xftfont_open): Set the font's max_width field.
683
684 * nsfont.m (nsfont_open): Similar to the Xft backend, set
685 min_width to space_width and average_width to the average over
686 printable ASCII characters.
687 (ns_char_width): Code cleanup.
688 (ns_ascii_average_width): New utility function.
689
690 * font.h (struct font): Update comments.
691
a098c930
DA
6922012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
693
032a42c8 694 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
695 * lisp.h (CSET): New macro.
696 (char_table_set_extras, char_table_set_contents)
697 (sub_char_table_set_contents): New function.
698 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
699 * syntax.c: Adjust users.
700
8be3a09c
SM
7012012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
702
703 * eval.c (eval_sub): Bind lexical-binding.
704 * lread.c (Qlexical_binding): Make non-static.
705
ac4845a6
JD
7062012-08-15 Jan Djärv <jan.h.d@swipnet.se>
707
ddee6515
JD
708 * nsmenu.m (popupSession): Remove.
709 (pop_down_menu): Remove endModalSession.
710 (timeout_handler:): New method.
711 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
712 Call runModalForWindow. Check timer_fired when it returns.
713 If not set, cancel timer and break out of loop.
714 Otherwise loop again, with a new timeout.
715
716 * nsterm.m: Include fcntl.h if present.
717 (fd_entry, t_readfds, inNsSelect): Remove.
718 (select_writefds, select_valid, select_timeout, selfds)
719 (select_mutex, apploopnr): Add.
720 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
721 Otherwise call kbd_buffer_store_event.
722 (ns_send_appdefined): Remove release of fd_entry.
723 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
724 Increment and decrement apploopnr.
725 (ns_select): If no file descriptors, just do a NSTimer.
726 Otherwise copy read/write masks and start select thread (fd_handler).
727 Start main loop and wait for application defined event.
728 Inform select thread to stop selecting after main loop is exited.
729 (ns_term_init): Create selfds pipe and set non-blocking.
730 Initialize select_mutex. Start the select thread (fd_handler).
731 (fd_handler:): Loop forever, wait for info from the main thread
732 to either start or stop selecting. When select returns, send
733 and appdefined event.
734 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
735 If not call kbd_buffer_store_event.
736
737 * nsterm.h (EmacsApp): fd_handler takes id argument.
738 (EmacsDialogPanel): Add timer_fired and timeout_handler.
739
ac4845a6
JD
740 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
741
eb424fe3
EZ
7422012-08-15 Eli Zaretskii <eliz@gnu.org>
743
744 * region-cache.c (move_cache_gap): Update gap_len using the actual
745 growth of the boundaries array. Do not change cache_len.
746 (Bug#12196)
747
4e6a86c6
DA
7482012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
749
750 Generalize and cleanup font subsystem checks.
751 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
752 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
753 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 754
5bf192ca
DA
7552012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
756
757 * gtkutil.c (xg_get_font): Use pango_units_to_double.
758
f2045622
CY
7592012-08-15 Chong Yidong <cyd@gnu.org>
760
8be3a09c
SM
761 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
762 When using the new font chooser, use gtk_font_chooser_get_font_desc to
763 extract the font descriptor instead of just the font name.
764 In that case, return a font spec instead of a string.
f2045622
CY
765 (x_last_font_name): Move to this file from xfns.c.
766
767 * xfns.c (Fx_select_font): The return value can also be a font
768 spec. Move x_last_font_name management to gtkutil.c.
769
770 * xfaces.c: Make font weight and style symbols non-static.
771
7f6feb56
SM
7722012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
773
774 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
775 (bug#12117).
776
fecbd8ff
SM
7772012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
778
779 * alloc.c (Fgarbage_collect): Use plural form consistently.
780
9b8d5165
EZ
7812012-08-14 Eli Zaretskii <eliz@gnu.org>
782
783 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
784 iteration through the command loop. Fixes a problem whereby mouse
785 movements are ignored until the first mouse click.
786
f5d9e83a
PE
7872012-08-14 Paul Eggert <eggert@cs.ucla.edu>
788
789 Use bool, not int, for Lisp booleans.
790 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
791 makes Emacs a bit smaller and presumably a bit faster.
792 * lisp.h: Include <stdbool.h>.
793 (struct Lisp_Boolfwd, defvar_bool):
794 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
795 * regex.c [!emacs]: Include <stdbool.h>.
796 (false, true): Remove; <stdbool.h> does this for us now.
797
55802e4a
CY
7982012-08-14 Chong Yidong <cyd@gnu.org>
799
4abcdac8
CY
800 * character.c (Fcharacterp): Doc fix (Bug#12076).
801
802 * data.c (Findirect_variable): Doc fix (Bug#11040).
803
55802e4a
CY
804 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
805
806 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 807 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 808
8e99d072
BR
8092012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
810
811 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
812 (bug#12022).
813
08908aca
MR
8142012-08-14 Martin Rudalics <rudalics@gmx.at>
815
816 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
817 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
818 * minibuf.c (choose_minibuf_frame, read_minibuf):
819 * w32fns.c (x_create_tip_frame):
820 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
821 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
822
56120d6f
PE
8232012-08-14 Paul Eggert <eggert@cs.ucla.edu>
824
825 * intervals.c (offset_intervals): Remove obsolete comment.
826
67b77c0b
AS
8272012-08-14 Andreas Schwab <schwab@linux-m68k.org>
828
829 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
830
f48b82fd
GR
8312012-08-14 Gergely Risko <gergely@risko.hu>
832
833 * coding.c (decode_coding): Record buffer modification before
834 disabling undo_list (Bug#11773).
835
fd318b54
DA
8362012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
837
838 Revert and cleanup some recent overlay changes.
839 * buffer.h (enum overlay_type): Remove.
840 (buffer_get_overlays, buffer_set_overlays): Likewise.
841 (buffer_set_overlays_before, buffer_set_overlays_after):
842 New function. Adjust users.
843 (unchain_both): Add eassert.
844
41a62dd9
DA
8452012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
846
847 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
848
5884c324
PE
8492012-08-14 Paul Eggert <eggert@cs.ucla.edu>
850
851 * gtkutil.c (xg_mark_data): Don't assume C99.
852
ca06f160
JD
8532012-08-13 Jan Djärv <jan.h.d@swipnet.se>
854
855 * gtkutil.c (xg_frame_tb_info): New struct.
856 (TB_INFO_KEY): New define.
857 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
858 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
859 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
860 if not present.
861 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
862 is up to date. Otherwise store new data.
863 (free_frame_tool_bar): Free xg_frame_tb_info if present.
864
7864a3f7
DA
8652012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
866
867 Use KSET for write access to Lisp_Object members of struct kboard.
868 * keyboard.h (KSET): New macro.
869 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
870 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
871 * xterm.c: Adjust users.
872
4c31be61
DA
8732012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
874
875 Use BSET for write access to Lisp_Object members of struct buffer.
876 * buffer.h (BSET): New macro.
877 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
878 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
879 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
880 * window.c, xdisp.c, xfns.c: Adjust users.
881
14ae4239
BT
8822012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
883
884 * lread.c (syms_of_lread): Initialize Vlexical_binding.
885
32bcadb4
JD
8862012-08-11 Jan Djärv <jan.h.d@swipnet.se>
887
3d29b2ce
JD
888 * nsterm.m (not_in_argv): New function.
889 (application:openFile, application:openTempFile:):
890 (application:openFileWithoutUI:, application:openFiles:): Open file
891 if not_in_argv returns non-zero (bug#12171).
892
32bcadb4 893 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
894 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
895 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
896 (xg_get_font_name): Use those functions/macros here.
897 Reported by Frans Oilinki <moilinki@gmail.com>.
898
9ff9402d 8992012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
900
901 * unexmacosx.c (copy_data_segment): Copy initialized data in
902 statically linked libraries from input file rather than memory.
903
db74a5fc
YM
904 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
905 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
906 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
907
25e65510
GM
9082012-08-10 Glenn Morris <rgm@gnu.org>
909
910 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
911 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
912
7961135c
DA
9132012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
914
915 Fix last change to allow compilation with low optimization levels.
916 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
917 Reported by Jan Djärv <jan.h.d@swipnet.se>.
918
42b3a444
DA
9192012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
920
921 Use common inline syntax in intervals.h.
922 * intervals.h (INTERVALS_INLINE): New macro.
923 Change all users from LISP_INLINE.
924
9fb0c957
DA
9252012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
926
927 Define Qnone once for all platforms.
928 * frame.c (Qnone): Define here.
929 (syms_of_frame): DEFSYM it.
930 * lisp.h (Qnone): New declaration.
931 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
932 * xfns.c: Remove duplication. Adjust users.
933
65e8ee52
DA
9342012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
935
936 Remove unused macros from intervals.h.
937 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
938 * intervals.c: Adjust comment.
939
9b855fd6
EZ
9402012-08-10 Eli Zaretskii <eliz@gnu.org>
941
942 * w32fns.c <w32_unicode_gui>: New static variable.
943 (globals_of_w32fns): Initialize it according to os_subtype.
944 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
945 testing os_subtype.
946
39cb9e56 9472012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
948 Eli Zaretskii <eliz@gnu.org>
949
950 Fix bug #10299 with Unicode characters sent by customized
951 keyboards created by MSKLC.
952 * w32fns.c (INIT_WINDOW_CLASS): New macro.
953 (w32_init_class): Use it to initialize the Emacs class with either
954 ANSI or Unicode API calls.
955 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
956 later.
957 (w32_wnd_proc): If the character code sent by WM_CHAR or
958 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
959 original message. Call DefWindowProcW on NT and later.
960
9374581a
GM
9612012-08-10 Glenn Morris <rgm@gnu.org>
962
4b94e8cf
GM
963 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
964
9374581a
GM
965 * lisp.h (DIRECTORY_SEP): Let configure set it.
966
a2752828
DA
9672012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
968
969 Use TSET for write access to Lisp_Object slots of struct terminal.
970 * termhooks.h (TSET): New macro.
971 * coding.c, terminal.c, xselect.c: Adjust users.
972
cc92c454
SM
9732012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
974
975 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
976 the failing expression, include them in the error message.
977 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
978 * lisp.h (internal_condition_case_n): Update declaration.
979
4cb3e6b3
DA
9802012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
981
982 Inline functions to examine and change buffer overlays.
983 * buffer.c (unchain_both): New function.
984 * buffer.h (buffer_get_overlays, buffer_set_overlays):
985 (buffer_has_overlays): New function.
986 (enum overlay_type): New enum.
987 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
988 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
989
8707c1e5
DA
9902012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
991
992 Inline functions to examine and change buffer intervals.
993 * alloc.c (mark_interval_tree): Remove.
994 (MARK_INTERVAL_TREE): Simplify.
995 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
996 * intervals.c (buffer_balance_intervals): New function.
997 (graft_intervals_into_buffer): Adjust indentation.
998 (set_intervals_multibyte): Simplify.
999 * buffer.h (BUF_INTERVALS): Remove.
1000 (buffer_get_intervals, buffer_set_intervals): New function.
1001 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1002 * intervals.c, textprop.c: Adjust users.
1003
ad8c997f
DA
10042012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1005
1006 Inline functions to examine and change string intervals.
1007 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1008 (string_get_intervals, string_set_intervals): New function.
1009 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1010 * lread.c, print.c, textprop.c: Adjust users.
1011
32ac3a6b
GM
10122012-08-08 Glenn Morris <rgm@gnu.org>
1013
1014 * lisp.mk (lisp): Remove language/persian.elc.
1015
77c7bcb1
DA
10162012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1017
1018 Cleanup intervals.
1019 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1020 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
1021 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1022 Adjust comment. Move under #if 0.
77c7bcb1
DA
1023 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1024 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1025
9c08a8d4
DA
10262012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1027
1028 Check total length of intervals with eassert.
1029 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1030 * intervals.c: Change all users to eassert.
1031
26d16b35
EZ
10322012-08-07 Eli Zaretskii <eliz@gnu.org>
1033
14ae4239
BT
1034 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1035 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
1036 INTERNAL_FIELD in Lisp_Cons.
1037
c644523b
DA
10382012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1039
1040 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1041 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1042 name since all xname users are fixed long time ago. Do not
1043 use INTERNAL_FIELD.
1044 (set_symbol_name, set_symbol_function, set_symbol_plist):
1045 (set_symbol_next, set_overlay_plist): New function.
1046 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1047 (struct Lisp_Overlay): Likewise.
1048 (CVAR, MVAR, SVAR): Remove.
1049 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1050 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1051 * xterm.c: Adjust users.
1052 * .gdbinit: Change to use name field of struct Lisp_Symbol
1053 where appropriate.
1054
6a3d20cc
DA
10552012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1056
1057 Basic functions to set Lisp_Object and pointer slots of intervals.
1058 * intervals.h (interval_set_parent, interval_set_object):
1059 (interval_set_left, interval_set_right, interval_set_plist):
1060 (interval_copy_parent): New function.
1061 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
1062 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1063 Adjust indentation.
6a3d20cc
DA
1064 (INTERVAL_SIZE): Remove. Adjust users.
1065 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1066
4d2b044c
DA
10672012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1068
1069 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1070 * process.h (PGET): Remove.
1071 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1072 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1073
d3d50620
DA
10742012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1075
1076 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1077 * window.h (WGET): Remove.
1078 (struct window): Do not use INTERNAL_FIELD.
1079 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1080 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1081 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1082 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1083 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1084 Adjust users.
1085
d10a51dc
CY
10862012-08-07 Chong Yidong <cyd@gnu.org>
1087
1088 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1089 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1090 (Fdelete_window_internal): Signal an error if the window is not on
1091 a live frame (Bug#12025).
1092
e69b0960
DA
10932012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1094
1095 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1096 * frame.h (FGET): Remove.
1097 (struct frame): Do not use INTERNAL_FIELD.
1098 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1099 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1100 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1101 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1102
25a20a3a
JB
11032012-08-06 Juanma Barranquero <lekktu@gmail.com>
1104
1105 * w32.c: Silence compiler warnings.
1106 (map_w32_filename): Remove unused variable `is_fat'.
1107 (chase_symlinks): Add parentheses around expression.
1108
1c6f11f4
GM
11092012-08-06 Glenn Morris <rgm@gnu.org>
1110
1db4583a
GM
1111 * sysdep.c: Respect BROKEN_GETWD.
1112
1c6f11f4
GM
1113 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1114 Let configure handle it.
1115 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1116
2b90362b
DA
11172012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1118
1119 Use GCALIGNMENT where appropriate.
1120 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1121 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1122 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1123
5f50daf2
EZ
11242012-08-06 Eli Zaretskii <eliz@gnu.org>
1125
14ae4239
BT
1126 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1127 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 1128
cbcc7007
SM
11292012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1130
1131 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1132 that should be sufficient for everyone.
1133
4d365fa4
JD
11342012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1135
1136 * keyboard.c (timer_check_2): Add break so timer_check returns next
1137 timeout.
1138
dd86bd82
DA
11392012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1140
1141 Fix Windows build errors introduced after converting to WGET and WSET.
1142 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1143 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1144
054e1668
JD
11452012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1146
1147 * nsterm.m (ns_frame_rehighlight): Use FSET.
1148
1149 * nsmenu.m (ns_update_menubar): Use FSET.
1150
21238f11
DA
11512012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1152
1153 Separate read and write access to Lisp_Object slots of Lisp_Process.
1154 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1155 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1156
077288cf
DA
11572012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1158
1159 Separate read and write access to Lisp_Object slots of struct window.
1160 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1161 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1162 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1163 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1164 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1165 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1166 Adjust users.
1167
71688bd7
DA
11682012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1169
1170 Fix Windows build errors introduced after converting to FGET and FSET.
1171 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1172 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1173 (w32_judge_scroll_bars): Change to use FSET.
1174 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1175
f99bac93
DA
11762012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1177
1178 Fix replacement typo.
1179 * window.c (replace_window): Set root_window instead of
1180 selected_window. This fixes a total window subsystem
1181 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1182
8c2a0f2d
GM
11832012-08-06 Glenn Morris <rgm@gnu.org>
1184
1185 * lisp.mk (lisp): Add language/persian.elc.
1186
edd74c35
DA
11872012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1188
1189 Separate read and write access to Lisp_Object slots of struct frame.
1190 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1191 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1192 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1193 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1194 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1195
8671676c
AS
11962012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1197
1198 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1199
663e2b3f
DA
12002012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1201
1202 Generalize common compile-time constants.
1203 * lisp.h (header_size, bool_header_size, word_size): Now here.
1204 (struct Lisp_Vector): Add comment.
1205 (struct Lisp_Bool_Vector): Move up to define handy constants.
1206 (VECSIZE, PSEUDOVECSIZE): Simplify.
1207 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1208 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1209 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1210 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1211 * xfont.c, xmenu.c: Use word_size where appropriate.
1212
d32e47af
LM
12132012-08-05 Lawrence Mitchell <wence@gmx.li>
1214
1215 * search.c (Freplace_match): Treat \? in the replacement text
1216 literally (Bug#8161).
1217
e5d9c0d1
CY
12182012-08-05 Chong Yidong <cyd@gnu.org>
1219
1220 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1221 * frame.c (Vdelete_frame_functions):
1222 * emacs.c (Vkill_emacs_hook): Doc fix.
1223
8da0576b
EZ
12242012-08-04 Eli Zaretskii <eliz@gnu.org>
1225
1226 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1227 --with-x-toolkit=no builds.
1228 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1229
02676e5d
CY
12302012-08-04 Chong Yidong <cyd@gnu.org>
1231
1232 * syntax.c (Fmodify_syntax_entry): Doc fix.
1233
97147da9
EZ
12342012-08-04 Eli Zaretskii <eliz@gnu.org>
1235
76151e2c
EZ
1236 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1237 * w32.c (init_environment): Change the default values of many
1238 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
1239 them into environment when they were not already defined.
1240 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 1241 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
1242 (check_windows_init_file): Now external, not static.
1243 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
1244 called when Vload_path is already set up.
1245
1246 * w32.h (check_windows_init_file): Add prototype.
1247
1248 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1249 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1250 compatibility with Posix platforms.
1251 (main): Move the call to check_windows_init_file to here from
1252 w32.c.
1253 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1254 any, in the DEFALT argument into the root of the Emacs build or
1255 installation tree, as appropriate.
1256
1257 * callproc.c (init_callproc_1): Call decode_env_path instead of
1258 doing its equivalent by hand.
1259 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1260 the code that sets Vexec_path run on MS-Windows.
1261
1262 * lread.c (init_lread): Add comments to #ifdef's.
1263
97147da9
EZ
1264 * msdos.c (dos_set_window_size, IT_update_begin)
1265 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1266 instead of direct references.
1267
185ee146
PE
12682012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1269
1270 Export DEFAULT_REHASH_* to GDB.
1271 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1272 Now constants, not macros.
1273
8834c57a
PE
12742012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1275
98c6f1e3
PE
1276 Remove unnecessary casts involving pointers.
1277 These casts are no longer needed now that we assume C89 or later,
1278 since they involve casting to or from void *.
1279 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1280 (make_pure_float, make_pure_vector):
1281 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1282 * macros.c (Fstart_kbd_macro):
1283 * menu.c (find_and_return_menu_selection):
1284 * minibuf.c (read_minibuf_noninteractive):
1285 * sysdep.c (closedir):
1286 * xdisp.c (x_produce_glyphs):
1287 * xfaces.c (compare_fonts_by_sort_order):
1288 * xfns.c (x_real_positions, select_visual):
1289 * xselect.c (x_stop_queuing_selection_requests)
1290 (x_get_window_property, x_get_window_property_as_lisp_data):
1291 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1292 Remove unnecessary pointer casts.
1293 * alloc.c (record_xmalloc): New function.
1294 * lisp.h (record_xmalloc): New decl.
1295 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1296 more like a function. This is because the pointer cast is not
1297 needed. All uses changed.
1298 * print.c (print_string, print_error_message): Avoid length recalc.
1299
8834c57a
PE
1300 Improve fix for macroexp crash with debugging (Bug#12118).
1301 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1302 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1303 not supposed to be invoked from the garbage collector.
1304 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1305 (gc_aset): New function, which is like ASET but can be
1306 used in the garbage collector.
1307 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1308 (set_hash_index): Use it instead of ASET.
1309
6dad7178
EZ
13102012-08-03 Eli Zaretskii <eliz@gnu.org>
1311
1312 Support symlinks on latest versions of MS-Windows.
1313 * w32.c: Include winioctl.h and aclapi.h.
1314 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1315 (revert_to_self): Forward declarations of static functions.
1316 <static BOOL g_b_init_get_security_info>:
1317 <g_b_init_create_symbolic_link>: New static flags.
1318 (globals_of_w32): Initialize them to zero.
1319 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1320 (map_w32_filename): Improve commentary. Simplify switch.
1321 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1322 headers (most versions of MinGW w32api don't).
1323 (get_security_info, create_symbolic_link)
1324 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1325 New functions.
1326 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1327 in the argument file name.
1328 (sys_access): Call unc_volume_file_attributes only if
1329 GetFileAttributes fails with network-related error codes.
1330 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1331 have the required privileges.
14ae4239 1332 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
1333 get_file_security_desc.
1334 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
1335 with addition of handling of symlinks and support for 'lstat'.
1336 If possible, get file's attributes and security information by
6dad7178
EZ
1337 handle, not by name. Produce S_IFLNK bit for symlinks, when
1338 called from 'lstat'.
1339 (stat, lstat): New functions, call 'stat_worker'.
1340 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1341 symlinks when the underlying filesystem supports them.
1342
f162bcc3
PE
13432012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1344
79ea6c20
PE
1345 Fix macroexp crash on Windows with debugging (Bug#12118).
1346 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1347 checking subscripts; problem introduced with the recent
1348 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1349 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1350 since it's used in non-static inline functions now.
1351
c0ce93fd
PE
1352 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1353 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 1354
f162bcc3
PE
1355 Use C99-style 'extern inline' if available.
1356 * buffer.h (BUFFER_INLINE):
1357 * category.h (CATEGORY_INLINE):
1358 * character.h (CHARACTER_INLINE):
1359 * charset.h (CHARSET_INLINE):
1360 * composite.h (COMPOSITE_INLINE):
1361 * dispextern.h (DISPEXTERN_INLINE):
1362 * lisp.h (LISP_INLINE):
1363 * systime.h (SYSTIME_INLINE):
1364 New macro, replacing 'static inline' in this header.
1365 * buffer.h, category.h, character.h, charset.h, composite.h:
1366 * dispextern.h, lisp.h, systime.h:
1367 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1368 * alloc.c (LISP_INLINE):
1369 * buffer.c (BUFFER_INLINE):
1370 * category.c (CATEGORY_INLINE):
1371 * character.c (CHARACTER_INLINE):
1372 * charset.c (CHARSET_INLINE):
1373 * composite.c (COMPOSITE_INLINE):
1374 * dispnew.c (DISPEXTERN_INLINE):
1375 * sysdep.c (SYSTIME_INLINE):
1376 Define to EXTERN_INLINE, so that the corresponding functions
1377 are compiled into code.
1378 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1379 (INLINE_HEADER_END): New macros.
1380 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1381 since it's used in non-static inline functions now.
a8333d03 1382 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 1383
837b365b
GM
13842012-08-02 Glenn Morris <rgm@gnu.org>
1385
d66b744d
GM
1386 * s/: Remove empty directory.
1387
837b365b
GM
1388 * s/ms-w32.h: Move to ../nt/inc.
1389 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1390 Update for new ms-w32.h location.
1391
13294f95
PE
13922012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1393
1394 Port to Solaris 8.
1395 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1396
90df0db3
GM
13972012-08-02 Glenn Morris <rgm@gnu.org>
1398
1399 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1400 hard-coding the path separator.
1401
4939150c
PE
14022012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1403
1404 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1405 This how ASET and AREF are supposed to work, and makes
1406 it easier to think about future improvements. See
1407 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1408 * charset.h (set_charset_attr): New function.
1409 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1410 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1411 (aref_addr): New function. All uses of &AREF(...) changed.
1412 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1413 (set_hash_index): New functions. All lvalue-style uses of
1414 HASH_KEY etc. changed.
1415 * keyboard.c (set_prop): New function. All lvalue-style uses
1416 of PROP changed.
1417
947b2afd
AA
14182012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1419
1420 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1421 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1422 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1423 * nsfns.m (ns_set_name_as_filename): Likewise.
1424 * nsmenu.m (ns_update_menubar): Likewise.
1425 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1426
4f5d0325
EZ
14272012-08-01 Eli Zaretskii <eliz@gnu.org>
1428
2008beae
EZ
1429 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1430 Adapt to latest changes in field names of the corresponding Lisp
288479f6 1431 objects.
2008beae 1432
4f5d0325
EZ
1433 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1434
fe3cc771
GM
14352012-08-01 Glenn Morris <rgm@gnu.org>
1436
1437 * s/msdos.h: Remove file.
1438 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1439 * Makefile.in (S_FILE): Remove.
1440 (config_h): Remove S_FILE.
1441
c90acc54
JB
14422012-08-01 Juanma Barranquero <lekktu@gmail.com>
1443
1444 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1445 Remove; moved to nt/config.nt.
1446
d8a05828
DA
14472012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1448
1449 Use INTERNAL_FIELD for conses and overlays.
1450 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1451 Remove obsolete comment.
1452 (MVAR): New macro.
1453 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1454 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1455
8271d590
DA
14562012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1457
1458 Use INTERNAL_FIELD for symbols.
1459 * lisp.h (SVAR): New macro. Adjust users.
1460 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1461 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1462
3193acd2
DA
14632012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1464
1465 Use INTERNAL_FIELD for processes.
1466 * process.h (PVAR): New macro. Adjust style.
1467 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1468 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1469
3a45383a
DA
14702012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1471
1472 Use INTERNAL_FIELD for windows.
1473 * window.h (WVAR): New macro.
1474 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1475 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1476 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1477 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1478 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1479 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1480
c1dbc63c
PE
14812012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1482
1483 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1484
5c0c0e8a
GM
14852012-08-01 Glenn Morris <rgm@gnu.org>
1486
1487 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1488 Move to configure.ac.
1489
552a99b4
JB
14902012-08-01 Juanma Barranquero <lekktu@gmail.com>
1491
1492 * makefile.w32-in (CONFIG_H): Update dependencies.
1493 (CONF_POST_H): New macro.
1494
1495 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1496
8d8e2dfe
GM
14972012-07-31 Glenn Morris <rgm@gnu.org>
1498
bc96620a
GM
1499 * Makefile.in (S_FILE): No longer set by configure.
1500
476b1b2d
GM
1501 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1502 is available.
1503 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1504
b2c7a106
GM
1505 * process.h (NULL_DEVICE):
1506 * emacs.c (SEPCHAR):
1507 * editfns.c (USER_FULL_NAME): Let configure set them.
1508
d53d062a
GM
1509 * s/README, s/template.h: Remove files.
1510
4515017f
GM
1511 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1512
8d8e2dfe
GM
1513 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1514 Move to configure.ac.
1515
5b20b3cc
EZ
15162012-07-31 Eli Zaretskii <eliz@gnu.org>
1517
1e0afd9a
EZ
1518 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1519 resulting renaming of 'struct frame' members.
1520
5b20b3cc
EZ
1521 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1522
1523 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1524 after introduction of FVAR.
1525
f1310128
JD
15262012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1527
79e721e0
JD
1528 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1529
1530 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1531 instead of compositeToPoint.
1532 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1533
8d7c7eed 1534 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 1535
e34f7f79
DA
15362012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1537
1538 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1539 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 1540 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
1541 (BVAR): Change to use INTERNAL_FIELD.
1542 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1543 (KVAR): Change to use INTERNAL_FIELD.
1544 * frame.h (FVAR): New macro.
1545 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
1546 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1547 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1548 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
1549 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1550
c09bfb2f
DA
15512012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1552
1553 Miscellaneous fixes for non-default X toolkits.
1554 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1555 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1556 Move under #ifdef USE_LUCID.
1557 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1558 definition and usage to avoid warnings.
1559
14c114ae
JD
15602012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1561
1562 * nsterm.m (openFiles): Fix previous checkin.
1563
3bd21e82
PE
15642012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1565
1566 * indent.c (compute_motion): Remove unused local.
1567
c1529ded
GM
15682012-07-31 Glenn Morris <rgm@gnu.org>
1569
400d5621
GM
1570 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1571
268e2432
GM
1572 * conf_post.h [USG5_4]:
1573 Move remaining contents of s/usg5-4-common.h here.
1574 * s/usg5-4-common.h: Remove file.
1575
7552f3ee
GM
1576 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1577 * s/irix6-5.h: Remove file.
1578
6a381852
GM
1579 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1580 * s/darwin.h: Remove file.
1581
c1529ded
GM
1582 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1583 * s/hpux10-20.h: Remove file, which is now empty.
1584
b429a4ee
GM
15852012-07-30 Glenn Morris <rgm@gnu.org>
1586
1587 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1588 * Makefile.in (config_h): Add conf_post.h.
1589 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1590
adff3182
JD
15912012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1592
1593 * nsterm.m (ns_do_open_file): New variable.
b9031d69 1594 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
1595 (openFile, openTempFile, openFileWithoutUI, openFiles):
1596 Open files only if ns_do_open_file.
adff3182 1597
c32af1e4
PE
15982012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1599
7393bcbb
PE
1600 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1601 This no-op macro hasn't been needed for many years.
1602 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1603
c32af1e4
PE
1604 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1605 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1606 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1607 gdb_make_enums_visible.
1608 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1609 (DIRECTORY_SEP): Now a constant, not a macro.
1610
302fc036
EZ
16112012-07-30 Eli Zaretskii <eliz@gnu.org>
1612
1613 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1614 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1615
1616 * w32term.c <w32_keyboard_codepage>: Renamed from
1617 keyboard_codepage and now external. All users changed.
1618
1619 * w32term.h: Add declaration of w32_keyboard_codepage.
1620
1621 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1622 the codepage to translate keys to Unicode. If this argument is
1623 -1, use the value returned by GetConsoleCP. All callers changed.
1624
88fb40b4
PE
16252012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1626
0aee6912
PE
1627 Update .PHONY listings in makefiles.
1628 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1629 bootstrap-clean, distclean, maintainer-clean, versioclean,
1630 extraclean, frc.
1631
88fb40b4
PE
1632 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1633 This is a bit clearer. Fix some commentary typos.
1634
0a763bd1
GM
16352012-07-30 Glenn Morris <rgm@gnu.org>
1636
32bac6d6
GM
1637 * s/netbsd.h: Let configure include signal.h if needed.
1638 Remove file, which is now empty.
1639
b65e7c46
GM
1640 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1641 Let configure set them.
1642 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1643 No more need to undefine.
0a763bd1 1644
169304bd
AS
16452012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1646
1647 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1648 non-single-byte char when adding meta modifier. (Bug#12090)
1649
6cd7a139
DA
16502012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1651
1652 Convert safe_call to use variable number of arguments.
1653 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1654 (safe_call2): Fix comment.
1655 * lisp.h (safe_call): Adjust prototype.
1656 * coding.c (encode_coding_object): Change to use safe_call2.
1657 * xfaces.c (merge_face_heights): Change to use safe_call1.
1658
d34d6ffc
GM
16592012-07-30 Glenn Morris <rgm@gnu.org>
1660
7b8a48e4 1661 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 1662 does that unconditionally. Remove file, which is now empty.
7b8a48e4 1663
d34d6ffc
GM
1664 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1665 Remove empty files.
1666
03a660a6
PE
16672012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1668
1669 Export to GDB most of lisp.h's remaining object-like macros.
1670 * lisp.h (min, max): Move earlier, because they're used earlier now.
1671 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1672 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1673 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1674 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1675 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1676 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1677 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1678 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1679 Now constants, for GDB. They need not be macros.
1680 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1681 Now constants, for GDB, as well as macros, for static initializers.
1682 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1683 Move to after the definition of struct Lisp_Char_Table,
1684 since the former now needs that type defined.
1685 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1686 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1687 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1688 New enums, for gdb_make_enums_visible.
1689 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 1690 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
1691 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1692 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1693 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1694 enum maxargs, enum MAX_ALLOCA.
1695 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1696 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1697 no longer needed, now that they are done in lisp.h.
1698
e499d0ee
DA
16992012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1700
1701 Cleanup string bytes checking.
1702 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1703 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1704 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1705 (check_sblock, compact_small_strings): Simplify.
1706
d5040d2d
PE
17072012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1708
1709 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1710 These macros are confusing and no longer need to be defined, as
1711 the enum values now suffice. All uses replaced with definiens.
1712 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1713
7f259ae6
JB
17142012-07-29 Juanma Barranquero <lekktu@gmail.com>
1715
1716 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1717 ($(BLD)/w32console.$(O)): Update dependencies.
1718
7e63e0c3
DA
17192012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1720
1721 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1722 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1723 time. Adjust users.
1724 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1725
ffd817eb
JD
17262012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1727
1728 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1729 setting sitelisp (Bug#12010).
1730
417a7a0e
EZ
17312012-07-29 Eli Zaretskii <eliz@gnu.org>
1732
14ae4239 1733 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
1734
1735 * w32heap.c (cache_system_info):
1736 * w32.c (sys_rename):
1737 * w32proc.c (find_child_console, sys_kill): All users changed.
1738
387d4d92
PE
17392012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1740
1741 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1742
55a6cca6
EZ
17432012-07-29 Eli Zaretskii <eliz@gnu.org>
1744
1745 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1746
dbcf001c
DA
17472012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1748
1749 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
1750 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1751 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 1752
e2688e4a
DA
17532012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1754
1755 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1756 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1757 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1758 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1759 (replace_range, replace_range_2, del_range_2): Change to eassert.
1760 * marker.c (byte_char_debug_check): Adjust style.
1761
b46a6a83
PE
17622012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1763
1764 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1765 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1766 long-ago-commented-out code that talks about "WIN32".
1767 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1768 All uses changed.
1769
e32a5799
PE
17702012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1771
1772 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1773 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1774 Simplify by using alignof.
1775 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1776 * lisp.h: Include <stdalign.h>.
1777 (GCALIGNMENT): New macro and constant.
1778 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1779 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1780 (stdalign): New macro, if not already defined.
1781
df81cd29
EZ
17822012-07-28 Eli Zaretskii <eliz@gnu.org>
1783
01bd1b0d
EZ
1784 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1785 * w32inevt.c: Include w32inevt.h.
1786 (w32_read_console_input): New inline function, calls either
1787 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1788 w32_console_unicode_input.
1789 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1790 (w32_kbd_patch_key, key_event): Use the codepage returned by
1791 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1792 (key_event): use uChar.UnicodeChar only if
1793 w32_console_unicode_input is non-zero.
1794
1795 * w32console.c: Include w32heap.h.
1796 <w32_console_unicode_input>: New global variable.
1797 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1798 family of Windows, zero otherwise.
1799
1800 * w32inevt.h: Declare w32_console_unicode_input.
1801
df81cd29
EZ
1802 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1803 --without-x. (Bug#11742)
1804
c20fdd9e
PE
18052012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1806
1807 Adjust GDB to reflect pvec_type changes (Bug#12036).
1808 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
1809 2012-07-04 changes to pseudovector representation.
1810 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 1811
32770973 18122012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
1813
1814 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1815 bus address.
1816 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1817
3438fe21
EZ
18182012-07-27 Eli Zaretskii <eliz@gnu.org>
1819
bcfbc9de
EZ
1820 * alloc.c (listn): Fix the order the arguments are consed onto the
1821 list.
1822
3438fe21
EZ
1823 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1824 enumeration constants, as PURE and HEAP are too general, and clash
1825 with other headers and sources, such as gmalloc.c and the
1826 MS-Windows system headers. All users changed.
1827
eeaea515
DA
18282012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1829
1830 Revert last save_excursion_save and save_excursion_restore changes.
1831 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1832 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1833
073c88c2
DA
18342012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1835
1836 Fix recently-introduced typos in Windows port.
1837 Reported by Martin Rudalics <rudalics@gmx.at>.
1838 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 1839 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 1840
4706125e
PE
18412012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1842
1843 Improve GDB symbol export (Bug#12036).
1844 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1845 arms of an 'if', not using conditional expressions; otherwise GDB
1846 complains about the types in the unevaluated arm when the argument
1847 is an integer literal.
1848 (xgetint): Simplify expression.
1849 * alloc.c (gdb_make_enums_visible): New constant. This ports to
1850 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
1851 Zaretskii in <http://bugs.gnu.org/12036#13>.
1852 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
1853 needed now that we have gdb_make_enums_visible.
1854 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1855 (enum enum_USE_LSB_TAG):
1856 New enum types, packaging up enums that need to be exported to GDB.
1857
694b6c97
DA
18582012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1859
1860 Utility function to make a list from specified amount of objects.
1861 * lisp.h (enum constype): New datatype.
1862 (listn): New prototype.
1863 * alloc.c (listn): New function.
1864 (Fmemory_use_count, syms_of_alloc): Use it.
1865 * buffer.c (syms_of_buffer): Likewise.
1866 * callint.c (syms_of_callint): Likewise.
1867 * charset.c (define_charset_internal): Likewise.
1868 * coding.c (syms_of_coding): Likewise.
1869 * keymap.c (syms_of_keymap): Likewise.
1870 * search.c (syms_of_search): Likewise.
1871 * syntax.c (syms_of_syntax): Likewise.
1872 * w32.c (init_environment): Likewise.
1873 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1874 * xdisp.c (syms_of_xdisp): Likewise.
1875 * xfns.c (syms_of_xfns): Likewise.
1876
6195f384
DA
18772012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1878
1879 Fast save_excursion_save and save_excursion_restore.
1880 * lisp.h (struct Lisp_Excursion): New data type.
1881 (PVEC_EXCURSION): New pseudovector type.
1882 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1883 to deal with it. Adjust comments.
1884 (init_marker, attach_marker): New prototype.
1885 (unchain_marker): Adjust prototype.
1886 * marker.c (attach_marker): Change to global.
1887 (init_marker): New function.
1888 * alloc.c (Fmake_marker, build_marker): Use it.
1889 (build_marker): More easserts.
1890 (mark_object): Handle struct Lisp_Excursion.
1891 * editfns.c (save_excursion_save, save_excursion_restore):
1892 Reimplement to use struct Lisp_Excursion. Add comments.
1893
5eceb8fb
PE
18942012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1895
1896 Fix export of symbols to GDB (Bug#12036).
1897 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1898 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
1899 emacs.c, as this is a more-suitable home. Had this been done earlier
1900 the fix for 12036 would have avoided some of the problems noted in
1901 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
1902 would have been more obvious.
562157c8
PE
1903 * emacs.c: Do not include <verify.h>; no longer needed.
1904 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
1905 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
1906 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1907 Remove; now done in lisp.h.
1908 * lisp.h (PUBLISH_TO_GDB): New macro.
1909 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
1910 (DATA_SEG_BITS): Use it.
1911 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
1912 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
1913 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
1914 not be usable in #if. This simplifies things.
1915
d6749401
JB
19162012-07-26 Juanma Barranquero <lekktu@gmail.com>
1917
1918 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
1919
1781b9e9
PE
19202012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1921
d89518db 1922 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
1923 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
1924 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
1925 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
1926 Adjust to changes in lisp.h and emacs.c, by using
1927 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
1928 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
1929 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
1930 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
1931 instead of gdb_valbits.
1932 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
1933 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
1934 instead of gdb_array_mark_flag.
1935 (xboolvector): Get size from $->size, not $->header.size.
1936 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
1937 (xreload, hook-run, hookpost-run): Remove.
1938 * emacs.c: Include <verify.h>.
1939 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
1940 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
1941 Remove.
1942 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
1943 (gdb_USE_LSB_TAG): New enum constants.
1944 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
1945 Also define these as enum constants, so they're visible to GDB.
1946 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
1947 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
1948 as constants, so they're visible to GDB.
1949 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
1950 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
1951 Now enum constants, not macros, so they're visible to GDB.
1952 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
1953 more convenient now. All uses changed.
1954 (VALMASK) [USE_LSB_TAG]: Also define in this case.
1955 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
1956
3628596a
DA
19572012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
1958
1959 Explicitly free restriction data that are not needed anymore.
1960 * editfns.c (save_restriction_restore): Free restriction data.
1961
7abaf5cc
SM
19622012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
1963
1964 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
1965 add argument, tune behavior, and adjust all callers.
1966
71f88e00
PE
19672012-07-25 Paul Eggert <eggert@cs.ucla.edu>
1968
1969 Use typedef for EMACS_INT, EMACS_UINT.
1970 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
1971 than macros. This simplifies debugging in the usual case, since
1972 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
1973 and it allows expressions involving EMACS_INT casts.
1974 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
1975
57ec3034
JD
19762012-07-25 Jan Djärv <jan.h.d@swipnet.se>
1977
1978 * nsterm.m (ns_read_socket): Return early if there is a modal
1979 window (Bug#12043).
1980
8137e7b3
MR
19812012-07-25 Martin Rudalics <rudalics@gmx.at>
1982
1983 * frame.c (Fredirect_frame_focus): In doc-string don't mention
1984 that FOCUS-FRAME can be omitted.
1985
04e9897c
DA
19862012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
1987
1988 Adjust buffer text indirection counters at the end of Fkill_buffer.
1989 * buffer.c (Fkill_buffer): Adjust indirection counters when the
1990 buffer is definitely dead. This should really fix an issue reported
1991 by Christoph Scholtes again. (Bug#12007).
1992 (init_buffer_once): Initialize indirection counters of
1993 buffer_defaults and buffer_local_symbols (for sanity and safety).
1994
8a0484e1
EZ
19952012-07-24 Eli Zaretskii <eliz@gnu.org>
1996
1997 * xdisp.c (init_iterator): Don't compute dimensions of truncation
1998 and continuation glyphs on tooltip frames, leave them at zero.
1999 Avoids continued lines in tooltips. (Bug#11832)
2000
fa691a83
DA
20012012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2002
2003 Simplify copy_overlay.
04e9897c 2004 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
2005 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2006
436bc8e0
EZ
20072012-07-23 Eli Zaretskii <eliz@gnu.org>
2008
2009 * print.c (print_object): Don't crash when a frame's name is nil
2010 or invalid. (Bug#12025)
2011
2012 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2013 it signals an error when a tooltip frame is being created.
2014
d7a7fda3
DA
20152012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2016
2017 Cleanup miscellaneous objects allocation and initialization.
2018 * alloc.c (allocate_misc): Change to static. Add argument to
2019 specify the subtype. Adjust comment and users.
2020 (build_overlay): New function.
2021 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2022 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2023 (allocate_misc): Remove prototype.
2024 (build_overlay): Add prototype.
2025
20262012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
2027
2028 Swap buffer text indirection counters in Fbuffer_swap_text.
2029 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2030 This avoids crash reported by Christoph Scholtes at
2031 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2032
9d7fa573
JD
20332012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2034
2035 * nsmenu.m (Popdown_data): New struct.
2036 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2037 free Popdown_data.
2038 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2039 (initWithContentRect): Make imgView and contentView non-static
2040 and autorelease them. Also autorelease img and matrix (Bug#12005).
2041 (dealloc): Remove (Bug#12005).
2042
0dd6d66d
DA
20432012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2044
2045 Adjust consing_since_gc when objects are explicitly freed.
2046 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2047 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2048 (free_cons, free_misc): Subtract object size from consing_since_gc.
2049
d36d71df
DA
20502012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2051
2052 Simplify and cleanup markers positioning code.
2053 * marker.c (attach_marker): More useful eassert.
2054 (live_buffer, set_marker_internal): New function.
2055 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2056 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2057
fb9ea40f
PE
20582012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2059
2060 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2061 as it's limited by the amount of memory, not by INT_MAX.
2062
2d5c5f7d
EZ
20632012-07-21 Eli Zaretskii <eliz@gnu.org>
2064
07fb592e
EZ
2065 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2066 in special-event-map. See the discussion at
2067 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2068 for the reasons.
2069
37a9eac8 2070 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
2071 info.dwItemData. Fixes crashes on 64-bit Windows.
2072 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 2073
c4328746
JD
20742012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2075
2076 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 2077 (conversationIdentifier): Return value is NSInteger.
784051c4 2078 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 2079
6e5d1c12
CY
20802012-07-21 Chong Yidong <cyd@gnu.org>
2081
2082 * window.c (decode_any_window): Signal an error if the window is
2083 on a dead frame (Bug#11984).
2084
9928463d
DA
20852012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2086
2087 Add indirection counting to speed up Fkill_buffer.
2088 * buffer.h (struct buffer): New member.
2089 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2090 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2091 base buffer indirection counter.
2092 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2093 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2094 through buffer list if indirection counter is 0.
2095
f8643a6b
DA
20962012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2097
2098 Extend the value returned by Fgarbage_collect with heap statistics.
2099 * alloc.c (Qheap): New symbol.
2100 (syms_of_alloc): DEFSYM it.
2101 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2102 (Fmemory_free): Remove.
2103 (syms_of_alloc): Don't defsubr it.
2104 * buffer.c (Fcompact_buffer): Remove.
2105 (syms_of_buffer): Don't defsubr it.
2106
dac616ff
DA
21072012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2108
2109 Make maybe_gc inline.
2110 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2111 * lisp.h (consing_since_gc, gc_relative_threshold)
2112 (memory_full_cons_threshold): Revert declaration.
2113 (maybe_gc): Remove prototype, define as inline.
2114 * alloc.c: Remove old commented-out code.
2115 (consing_since_gc, gc_relative_threshold)
2116 (memory_full_cons_threshold): Revert to global.
2117 (maybe_gc): Remove.
2118
d7ea76b4
DA
21192012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2120
2121 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2122 * lisp.h (build_unibyte_string): New function.
2123 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2124 * sysdep.c, w32fns.c, xfns.c: Use it.
2125 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2126 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2127 Adjust users accordingly.
2128 * font.h (font_open_by_name): Adjust prototype.
2129
765e61e3
DA
21302012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2131
2132 Cleanup calls to Fgarbage_collect.
2133 * lisp.h (maybe_gc): New prototype.
2134 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2135 Remove declarations.
2136 * alloc.c (maybe_gc): New function.
2137 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2138 Make them static.
2139 * bytecode.c (MAYBE_GC): Use maybe_gc.
2140 * eval.c (eval_sub, Ffuncall): Likewise.
2141 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2142 to avoid dependency from auto-save feature.
2143
52b852c7
PE
21442012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2145
2146 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2147 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2148 'for_each_per_buffer_object_at'.
2149 All uses changed. It's better to use upper-case for macros that
2150 cannot be implemented as functions, to give the reader a clue
2151 that they're special.
2152
5db81e33
SM
21532012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2154
2155 * alloc.c (Fgarbage_collect): Tweak docstring.
2156
5b835e1d
DA
21572012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2158
2159 Tweak the value returned from Fgarbage_collect again.
2160 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2161 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2162 Adjust documentation.
2163 (total_vector_bytes): Rename to total_vector_slots, adjust
2164 accounting.
2165 (total_free_vector_bytes): Rename to total_free_vector_slots,
2166 adjust accounting.
2167 (Qstring_bytes, Qvector_slots): New symbols.
2168 (syms_of_alloc): DEFSYM them.
2169
9cd47b72
DA
21702012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2171
2172 Buffer compaction primitive which may be used from Lisp.
2173 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2174 (syms_of_buffer): Register Fcompact_buffer.
2175 * alloc.c (Fgarbage_collect): Use compact_buffer.
2176 * buffer.h (compact_buffer): New prototype.
2177 (struct buffer_text): New member.
2178
d17337e5
DA
21792012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2180
2181 New macro to iterate over all buffers, miscellaneous cleanups.
2182 * lisp.h (all_buffers): Remove declaration.
2183 * buffer.h (all_buffers): Add declaration, with comment.
2184 (for_each_buffer): New macro.
2185 * alloc.c (Fgarbage_collect, mark_object): Use it.
2186 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2187 (init_buffer): Likewise.
2188 * data.c (Fset_default): Likewise.
2189 * coding.c (code_conversion_restore): Remove redundant check
2190 for dead buffer.
2191 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2192
60cfd278
AS
21932012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2194
2195 Fix bug that created negative-length intervals.
2196 * intervals.c (merge_interval_right, merge_interval_left):
2197 Do not zero out this interval if it is absorbed by its children,
2198 as this interval's total length doesn't change in that case. See
2199 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2200
d06714cb
PE
22012012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2202
83713154
PE
2203 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2204 when invoking (make-bool-vector N t) and N is a positive
2205 multiple of 8 -- the last 8 bits were mistakenly cleared.
2206
d06714cb
PE
2207 Remove some struct layout assumptions in bool vectors.
2208 * alloc.c (bool_header_size): New constant.
2209 (header_size, word_size): Move earlier, as they're now used earlier.
2210 Use 'word_size' in a few more places, where it's appropriate.
2211 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2212 padding before the data member of a bool vector.
2213 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2214 than doing the check by hand with an abort ().
2215
464d5a5e
SM
22162012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2217
5fbc0409
SM
2218 * eval.c (Fdefvar): Don't check constants since we only set the var if
2219 it's not yet defined anyway (bug#11904).
2220
464d5a5e
SM
2221 * lisp.h (last_undo_boundary): Declare new var.
2222 * keyboard.c (command_loop_1): Set it.
2223 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2224 were auto-added by the command loop (bug#11774).
2225
8dc2e44a
AS
22262012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2227
2228 * w32font.c (Qsymbol): Remove local definition.
2229 (syms_of_w32font): Don't DEFSYM it.
2230
169925ec
DA
22312012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2232
2233 Fix sweep_vectors to handle large bool vectors correctly.
2234 * alloc.c (sweep_vectors): Account total_vector_bytes for
2235 bool vectors larger than VBLOCK_BYTES_MAX.
2236
5fbfb018
CY
22372012-07-18 Chong Yidong <cyd@gnu.org>
2238
2239 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2240 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2241
3ab6e069
DA
22422012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2243
2244 Return more descriptive data from Fgarbage_collect.
2245 Suggested by Stefan Monnier in
2246 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2247 * alloc.c (bounded_number): New function.
2248 (total_buffers, total_vectors): New variable.
2249 (total_string_size): Rename to total_string_bytes, adjust users.
2250 (total_vector_size): Rename to total_vector_bytes, adjust users.
2251 (sweep_vectors): Account total_vectors and total_vector_bytes.
2252 (Fgarbage_collect): New return value. Adjust documentation.
2253 (gc_sweep): Account total_buffers.
2254 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2255 (VECTOR_SIZE): Remove.
2256 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2257 (Qinterval, Qmisc): New symbols.
2258 (syms_of_data): Initialize them.
2259 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2260 (Qcons, Qbuffer): New declarations.
2261
6d02fe5b
PE
22622012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2263
2264 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2265 Round up, not down. Improve doc.
2266
b7ffe040
DA
22672012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2268
2269 Restore old code in allocate_string_data to avoid Faset breakage.
2270 Reported by Julien Danjou <julien@danjou.info> in
2271 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2272 * alloc.c (allocate_string_data): Restore old code with minor
2273 adjustments, fix comment to explain this subtle issue.
2274
4dc7c8d5
SM
22752012-07-17 Eli Zaretskii <eliz@gnu.org>
2276
2277 Remove FILE_SYSTEM_CASE.
2278 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2279
2280 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2281 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2282 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2283 call-process-region passes it through expand-file-name.
2284
2285 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2286
22872012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2288
2289 Fix crash when creating indirect buffer (Bug#11917)
2290 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2291 Don't handle unbound variables specially if non-zero.
2292 (Fbuffer_local_variables): Pass zero.
2293 (clone_per_buffer_values): Pass non-zero.
2294
22952012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2296
2297 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2298 to make the loop interruptible.
2299
23002012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2301
2302 * gnutls.c (emacs_gnutls_handshake): Only retry if
2303 GNUTLS_E_INTERRUPTED.
2304
cce7fefc
DA
23052012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2306
2307 Cleanup and convert miscellaneous checks to eassert.
2308 * alloc.c (mark_interval): Fix comment, partially rephrase
2309 old comment from intervals.h (see below).
2310 * intervals.c (find_interval, adjust_intervals_for_insertion)
2311 (delete_interval, adjust_intervals_for_deletion)
2312 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2313 Convert to eassert.
2314 (adjust_intervals_for_insertion, make_new_interval):
2315 Remove obsolete and unused code.
2316 * intervals.h (struct interval): Remove obsolete comment.
2317 * textprotp.c (erase_properties): Remove unused code.
2318 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2319 (Fremove_list_of_text_properties): Convert to eassert.
2320
9ea10cc3
CY
23212012-07-17 Chong Yidong <cyd@gnu.org>
2322
2323 * editfns.c (Finsert_char): Doc fix.
2324
3900d5de
DA
23252012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2326
2327 Fix previous change to make Fmemory_free always accurate.
2328 * alloc.c (make_interval): Update total_free_intervals.
2329 (make_float): Likewise for total_free_floats.
2330 (free_cons, Fcons): Likewise for total_free_conses.
2331 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2332 Likewise for total_free_vector_bytes.
2333 (Fmake_symbol): Likewise for total_free_symbols.
2334 (bytes_free): Remove.
2335
7098646f
DA
23362012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2337
2338 Simple free memory accounting feature.
2339 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2340 (sweep_vectors): Accumulate size of free vectors.
2341 (Fgarbage_collect): Setup bytes_free.
2342 (Fmemory_free): New function.
2343 (syms_of_alloc): Register it.
2344
22657b40
DA
23452012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2346
2347 Cleanup overlays checking.
2348 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2349 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2350 eassert and OVERLAYP.
2351 (sort_overlays): Change to use OVERLAYP.
2352
ddfc8813
RK
23532012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2354
2355 * editfns.c (Finsert_char): Make it interactive, and make the
2356 second arg optional. Copy interactive spec and docstring from
2357 ucs-insert.
2358
7c26cf3c
PE
23592012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2360
2361 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2362 Unlike the other wrapped functions, fabs has an unspecified
2363 effect on errno.
2364
5d127af9
JD
23652012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2366
2367 * nsterm.m (keyDown): Interpret flags without left/right bits
2368 as the left key (Bug#11670).
2369
6a0dd1d7
DA
23702012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2371
2372 Remove empty and useless init functions.
2373 * lisp.h (init_character_once, init_fns, init_image)
2374 (init_filelock, init_sound): Remove prototype.
2375 * character.c (init_character_once): Remove.
2376 * filelock.c (init_filelock): Likewise.
2377 * fns.c (init_fns): Likewise.
2378 * image.c (init_image): Likewise.
2379 * sound.c (init_sound): Likewise.
2380 * emacs.c (main): Adjust accordingly.
2381
7a6136fd
DA
23822012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2383
2384 * gtkutil.h: Tiny cleanups.
2385 (use_old_gtk_file_dialog): Remove useless declaration.
2386 (xg_uses_old_file_dialog): Add suggested const attribute.
2387
ce811ad9
EZ
23882012-07-15 Eli Zaretskii <eliz@gnu.org>
2389
2390 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2391 (bidi_paragraph_init): Use it to limit search forward for a strong
2392 directional character in abnormally large paragraphs full of
2393 neutral or weak characters. (Bug#11943)
2394
c9adfeaa
SF
23952012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2396
2397 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2398 the toolbar (Bug#9451).
2399 (xg_make_tool_item): Give the widget event box a transparent
2400 background.
2401
fff62aa9
DA
24022012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2403
2404 Cleanup basic allocation variables and functions.
2405 * alloc.c (ignore_warnings, init_intervals, init_float)
2406 (init_cons, init_symbol, init_marker): Remove.
2407 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2408 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2409 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2410 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2411 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2412 (staticidx, init_alloc_once, init_strings, free_ablock):
2413 Remove redundant initialization.
2414 * fns.c (init_weak_hash_tables): Remove.
2415 * lisp.h (init_weak_hash_tables): Remove prototype.
2416
9730daca
DA
24172012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2418
2419 Use zero_vector where appropriate.
2420 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2421 accordingly.
2422 * lisp.h (zero_vector): New declaration.
2423 * font.c (null_vector): Remove.
2424 (syms_of_font): Remove initialization and staticpro.
2425 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2426 * keymap.c (Faccessible_keymaps): Likewise.
2427
2e2d2a13
LL
24282012-07-15 Leo Liu <sdl.web@gmail.com>
2429
2430 * fringe.c: Fix typo in comments.
2431
cd276f6e
LL
24322012-07-14 Leo Liu <sdl.web@gmail.com>
2433
2434 * fringe.c: Add a new bitmap exclamation-mark.
2435
5a1131d9
EZ
24362012-07-14 Eli Zaretskii <eliz@gnu.org>
2437
2438 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2439
2440 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2441 (HAVE_MENUS): Don't define, defined by editing config.in with
2442 msdos/sed2v2.inp.
2443 (GMALLOC_INHIBIT_VALLOC): Don't define.
2444 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2445
22e983b7
JB
24462012-07-14 Juanma Barranquero <lekktu@gmail.com>
2447
2448 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2449
5b3f250f
GM
24502012-07-14 Glenn Morris <rgm@gnu.org>
2451
2452 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2453 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2454 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2455
33d63ff4
GM
24562012-07-13 Glenn Morris <rgm@gnu.org>
2457
5b633342
GM
2458 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2459
33d63ff4
GM
2460 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2461 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2462
b55b9f85
JD
24632012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2464
0dc8cf50
JD
2465 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2466 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2467 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2468 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2469 where appropriate.
2470 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2471 as boolean expression.
2472 (x_set_window_size): Remove unused variable toolbar.
2473 (ns_get_color_default, ns_mod_to_lisp): Remove.
2474 (ns_mouse_position): Remove unused variables xchar and ychar.
2475 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2476 (ns_set_vertical_scroll_bar): Remove unused variable count.
2477 (ns_delete_terminal): Remove unused variable i.
2478 (ns_term_init): Remove unused variables r, g and b.
2479 (mouseDown): Remove unused variable window.
2480 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2481 (initFrameFromEmacs): Remove unused variable vbextra.
2482 (mouseEntered): Remove unused variables p and dpyinfo.
2483 (mouseExited): Remove unused variables p and r.
2484 (ns_define_frame_cursor, ns_clear_frame_area)
2485 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2486 (menuDown): Assign [sender tag] to variable and cast the variable.
2487
2488 * nsterm.h (menuDown): Add id as type to argument sender.
2489 (ns_display_info_for_name): Add Lisp_Object argument.
2490 (ns_term_init): Add Lisp_Object argument.
2491 (ns_map_event_to_object): Add void argument.
2492 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2493 prototype with arguments and only declare if __OBJC__.
2494 (nxatoms_of_nsselect): Add void argument.
2495 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2496 (ns_alloc_autorelease_pool): Add void argument.
2497 (ns_release_autorelease_pool): Add void* argument.
2498 (ns_get_defaults_value): Add const char* argument.
2499
2500 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2501 (initFromContents): Use SSDATA where appropriate.
2502 (ns_update_menubar): Add braces to ambigous if-else.
2503 (initWithTitle): Put () around assignment in if statement.
2504 (ns_menu_show): Remove unused variables window and keymap.
2505 (update_frame_tool_bar): Remove unused variable selected_p.
2506 (initWithContentRect): Remove unused variable this_cmd_name.
2507
2508 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2509 appropriate.
2510 (setXBMColor): Remove unused variable len.
2511 (setPixmapData): Put () around assignment in loop statement.
2512
2513 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2514 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2515 where appropriate.
2516 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2517 around assignment in loop statement.
2518 (nsfont_open): Remove unused variable i.
2519 (nsfont_open): Remove unused variable len.
2520 (nsfont_draw): Remove unused variable cs.
2521
2522 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2523 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2524 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2525 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2526 (Fns_font_name, Fns_perform_service)
2527 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2528 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2529 (ns_set_name): Remove unused variable view.
2530 (x_set_menu_bar_lines): Remove unused variable olines.
2531 (x_set_tool_bar_lines): Remove unused variable root_window.
2532 (Fns_list_colors): Put () around assignment in while statement.
2533 (Fns_perform_service): Remove unused variable len.
2534 (Fns_display_usable_bounds): Remove unused variable top.
2535 (syms_of_nsfns): Remove unused variable i.
2536
b55b9f85
JD
2537 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2538 memcpy (Bug#11907).
2539
ed9265fc 25402012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
2541
2542 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2543 and free it with DestroyExceptionInfo (Bug#11558).
2544
ef099b57
JB
25452012-07-13 Juanma Barranquero <lekktu@gmail.com>
2546
2547 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2548 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2549 Set here, not in nt/config.nt.
2550
ea814a5d
EZ
25512012-07-13 Eli Zaretskii <eliz@gnu.org>
2552
2553 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2554 cursor overflow into the last glyph on display line when the right
2555 fringe is off. (Bug#11832)
2556
1a952767
PE
25572012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2558
2559 * xdisp.c (produce_special_glyphs): Now static.
2560 * dispextern.h (produce_special_glyphs): Remove decl.
2561
983188fd
GM
25622012-07-13 Glenn Morris <rgm@gnu.org>
2563
8d7c7eed 2564 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
2565 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2566
983188fd
GM
2567 * s/usg5-4-common.h (USG, USG5):
2568 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2569 * s/sol2-6.h (SOLARIS2):
2570 * s/irix6-5.h (IRIX6_5):
2571 * s/hpux10-20.h (USG, USG5, HPUX):
2572 * s/gnu-linux.h (USG, GNU_LINUX):
2573 * s/freebsd.h (BSD_SYSTEM):
2574 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2575 * s/cygwin.h (CYGWIN):
2576 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2577 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2578
d1e68667 25792012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
2580
2581 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 2582
6de0e799
GM
25832012-07-13 Glenn Morris <rgm@gnu.org>
2584
739ae010
GM
2585 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2586
dbee5793
GM
2587 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2588
6de0e799
GM
2589 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2590 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2591
b82da769
GM
25922012-07-12 Glenn Morris <rgm@gnu.org>
2593
4fae5a7a 2594 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
2595
2596 * process.c (init_process_emacs): Rename from init_process.
2597 The old name is also the name of a Mach system call.
2598 * lisp.h, emacs.c: Update for this name change.
2599 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2600 longer needed.
2601
5a979817
EZ
26022012-07-12 Eli Zaretskii <eliz@gnu.org>
2603
2604 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2605 memmove call that removes glyphs covered by the left truncation
2606 glyph. Improve commentary.
2607 (display_line): Fix display of continuation glyphs on GUI frames
2608 when the right fringe is turned off and variable-size fonts are
2609 used in the window. Move the code that appends a stretch glyph to
2610 produce_special_glyphs, so that it could be used for truncation
2611 and continuation glyphs alike.
2612 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2613 glyph of a suitably computed width, to align the special glyphs at
2614 the window margin. Code moved from display_line. (Bug#11832)
2615
3e91a053
GM
26162012-07-12 Glenn Morris <rgm@gnu.org>
2617
ba9e4b84
GM
2618 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2619
2620 * s/gnu-linux.h, s/hpux10-20.h:
2621 Do not unconditionally define HAVE_XRMSETDATABASE.
2622
3e91a053
GM
2623 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2624
b300b1f4
PE
26252012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2626
2627 Fix typos that broke OS X build.
2628 Reported by Randal L. Schwartz in
2629 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2630 * nsterm.m (ns_timeout): Add missing local decl.
2631 (ns_get_color): snprintf -> sprintf, to fix typo.
2632
6e777848
GM
26332012-07-12 Glenn Morris <rgm@gnu.org>
2634
3f922c37
GM
2635 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2636 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2637 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2638 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2639
0ab7b23a
GM
2640 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2641 Move PTY_OPEN to configure.
2642
6e777848
GM
2643 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2644 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2645 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2646
4a7edc24
DA
26472012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2648
2649 Use empty_unibyte_string where applicable.
2650 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2651 * lread.c (read1): Likewise.
2652 * xsettings.c (syms_of_xsettings): Likewise.
2653
308aab79
GM
26542012-07-12 Glenn Morris <rgm@gnu.org>
2655
42bd1719
GM
2656 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2657 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
2658 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2659 * s/hpux10-20.h (RUN_TIME_REMAP):
2660 * s/bsd-common.h (TABDLY): Move to configure.
2661
2662 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2663
2664 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2665
ea0bbd17 2666 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 2667 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
2668
2669 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 2670
308aab79
GM
2671 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2672 * s/template.h: Move NARROWPROTO to configure.
2673
ee1cf5cf
GM
26742012-07-11 Glenn Morris <rgm@gnu.org>
2675
30fe9bf4
GM
2676 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2677 unused since 2011-01-17 change to systty.h.
2678
ee1cf5cf
GM
2679 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2680 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2681 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2682
63e47e07
PE
26832012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2684
2685 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2686
c43fb4c3
GM
26872012-07-11 Glenn Morris <rgm@gnu.org>
2688
2689 * s/darwin.h, s/gnu-linux.h, s/template.h:
2690 Move INTERRUPT_INPUT to configure.
2691
e8df9267
DA
26922012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2693
2694 Minor adjustments to interning code.
2695 * lisp.h (intern, intern_c_string): Redefine as static inline
2696 wrappers for intern_1 and intern_c_string_1, respectively.
2697 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
2698 * lread.c (intern_1, intern_c_string_1, oblookup):
2699 Simplify Vobarray checking.
e8df9267
DA
2700 * font.c (font_intern_prop): Likewise. Adjust comment.
2701 * w32font.c (intern_font_name): Likewise.
2702
34348bd4
AS
27032012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2704
d96a1e0c
AS
2705 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2706
34348bd4
AS
2707 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2708 of Fcar/Fcdr if possible.
2709 * font.c (check_otf_features): Likewise.
2710 * fontset.c (Fnew_fontset): Likewise.
2711 * gnutls.c (Fgnutls_boot): Likewise.
2712 * minibuf.c (read_minibuf): Likewise.
2713 * msdos.c (IT_set_frame_parameters): Likewise.
2714 * xmenu.c (Fx_popup_dialog): Likewise.
2715 * w32menu.c (Fx_popup_dialog): Likewise.
2716
c8add24e
GM
27172012-07-11 Glenn Morris <rgm@gnu.org>
2718
4b575b3c
GM
2719 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2720 since nothing has defined it on these platforms.
2721
09f4e3b0
GM
2722 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2723 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2724
172bedef
GM
2725 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2726 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2727 Move CLASH_DETECTION to configure.
2728
249685df
GM
2729 * s/gnu.h: Remove file, which is now empty.
2730
c8add24e
GM
2731 * s/gnu.h, s/gnu-linux.h:
2732 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2733
b41253a3
JW
27342012-07-11 John Wiegley <johnw@newartisans.com>
2735
2736 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2737 function attribute, so we only use it if it exists in the
2738 compiler.
2739
d923b542
DA
27402012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2741
2742 Avoid call to strlen in fast_c_string_match_ignore_case.
2743 * search.c (fast_c_string_match_ignore_case): Change to use
2744 length argument. Adjust users accordingly.
2745 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2746
5ebbef1d
PE
27472012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2748
bb352260
PE
2749 Assume mkdir, rmdir.
2750 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2751 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2752
57054ddd
PE
2753 Assume rename.
2754 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2755
b747d3f7
PE
2756 Assume perror.
2757 * s/hpux10-20.h (HAVE_PERROR): Remove.
2758 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2759 Remove dummy definition, as this problem was obsolete long ago.
2760
5ebbef1d
PE
2761 Assume strerror.
2762 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2763
984e7f30
DA
27642012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2765
2766 Avoid calls to strlen in font processing functions.
2767 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
2768 (font_open_by_name): Change to use length argument.
2769 Adjust users accordingly.
d923b542
DA
2770 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2771 Adjust prototypes.
2772 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2773 Change to return ptrdiff_t.
984e7f30
DA
2774 (xfont_list_pattern, xfont_match): Use length returned by
2775 xfont_decode_coding_xlfd.
2776 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2777
20e94fdd
GM
27782012-07-11 Glenn Morris <rgm@gnu.org>
2779
9d596af3
GM
2780 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2781 Move DONT_REOPEN_PTY to configure.
2782
20e94fdd
GM
2783 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2784 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2785
e99a530f
PE
27862012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2787
22ffb973
PE
2788 Remove "#define unix" that is no longer needed (Bug#11905).
2789 * s/aix4-2.h (unix): Remove; no longer needed.
2790
e9a9ae03
PE
2791 EMACS_TIME simplification (Bug#11875).
2792 This replaces macros (which typically do not work in GDB)
2793 with functions, typedefs and enums, making the code easier to debug.
2794 The functional style also makes code easier to read and maintain.
2795 * systime.h: Include <sys/time.h> on all hosts, not just if
2796 WINDOWSNT, since 'struct timeval' is needed in general.
2797 (EMACS_TIME): Now a typedef, not a macro.
2798 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2799 not macros.
2800 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2801 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2802 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2803 (EMACS_TIME_LE): Now functions, not macros.
2804 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2805 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2806 which are not functions. All uses rewritten to use:
2807 (make_emacs_time): New function.
2808 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2809 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2810 not functions. All uses rewritten to use the following, respectively:
2811 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2812 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 2813 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
2814 * fileio.c (Fcopy_file):
2815 * xterm.c (XTflash): Get the current time closer to when it's used.
2816 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2817
ffacb126
PE
2818 * bytecode.c (targets): Suppress -Woverride-init warnings.
2819
e99a530f
PE
2820 Simplify by avoiding confusing use of strncpy etc.
2821 * doc.c (Fsnarf_documentation):
2822 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2823 * frame.c (Fmake_terminal_frame):
2824 * gtkutil.c (get_utf8_string):
2825 * lread.c (openp):
2826 * nsmenu.m (ns_update_menubar):
2827 * regex.c (regerror):
2828 Prefer memcpy to strncpy and strncat when either will do.
2829 * fileio.c (Fsubstitute_in_file_name):
2830 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2831 (menu_separator_name_p):
2832 * nsmenu.m (ns_update_menubar):
2833 Prefer memcmp to strncmp when either will do.
2834 * nsterm.m: Include <ftoastr.h>.
2835 (ns_get_color):
2836 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2837 Prefer snprintf to strncpy.
2838 * nsterm.m (ns_term_init):
2839 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2840 * nsterm.m (ns_term_init):
2841 Avoid the need for strncpy, by using build_string or
2842 make_unibyte_string directly. Use dtoastr, not snprintf.
2843 * process.c (Fmake_network_process): Diagnose service names that
2844 are too long, rather than silently truncating them or creating
2845 non-null-terminated names.
2846 (Fnetwork_interface_info): Likewise, for interface names.
2847 * sysdep.c (system_process_attributes) [GNU_LINUX]:
2848 Prefer sprintf to strncat.
2849 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2850 Prefer vsnprintf to vsprintf + strncpy.
2851
c59592b3
GM
28522012-07-10 Glenn Morris <rgm@gnu.org>
2853
2854 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2855 Clarify fallback case.
2856
7d7bbefd
DA
28572012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2858
2859 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2860 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2861 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 2862 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
2863 where argument type is known to be a Lisp_Cons.
2864
3a4c8000
TT
28652012-07-10 Tom Tromey <tromey@redhat.com>
2866
2867 * bytecode.c (BYTE_CODE_THREADED): New macro.
2868 (BYTE_CODES): New macro. Replaces all old byte-code defines.
2869 (enum byte_code_op): New type.
2870 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2871 (exec_byte_code): Use them. Use token threading when applicable.
2872
2a0213a6
DA
28732012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2874
2875 Optimize pure C strings initialization.
2876 * lisp.h (make_pure_string): Fix prototype.
2877 (build_pure_c_string): New function, defined as static inline. This
2878 provides a better opportunity to optimize away calls to strlen when
2879 the function is called with compile-time constant argument.
2880 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
2881 argument, adjust users accordingly. Use build_pure_c_string where
2882 appropriate.
2883 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2884 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2885 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2886
cb1caeaf
DA
28872012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2888
2889 Avoid calls to strlen in miscellaneous functions.
2890 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2891 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
2892 * lread.c (openp): Likewise.
2893
c293e30c
DA
28942012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2895
2896 Avoid calls to strlen in path processing functions.
2897 * fileio.c (file_name_as_directory): Add comment. Change to add
2898 srclen argument and return the length of result. Adjust users
2899 accordingly.
2900 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
2901 swap 1st and 2nd arguments to obey the common convention.
2902 Adjust users accordingly.
c293e30c
DA
2903 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
2904
9e059e3f
GM
29052012-07-10 Glenn Morris <rgm@gnu.org>
2906
d02eb359
GM
2907 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
2908 Move PENDING_OUTPUT_COUNT definition to configure.
2909
882cf227
GM
2910 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
2911 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
2912 * s/gnu.h (DATA_START): Move definitions to configure.
2913
af6e839f
GM
2914 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
2915 We include usg5-4-common.h, which defines them both.
2916
40289a12
GM
2917 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
2918 O_RDONLY already includes it).
2919
9e059e3f
GM
2920 Stop ns builds setting the EMACSLOADPATH environment variable.
2921 * nsterm.m (ns_load_path): Rename from ns_init_paths.
2922 Now it does not set EMACSLOADPATH, just returns the load-path string.
2923 * nsterm.h: Update accordingly.
2924 * lread.c [HAVE_NS]: Include nsterm.h.
2925 (init_lread) [HAVE_NS]: Use ns_load_path.
2926 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
2927
7c4e8ec0
GM
29282012-07-09 Glenn Morris <rgm@gnu.org>
2929
d4f600ff
GM
2930 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
2931 since the included bsd-common.h does so.
2932
cbb31951
GM
2933 Stop ns builds setting the EMACSPATH environment variable.
2934 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
2935 (ns_init_paths): Do not set EMACSPATH.
2936 * nsterm.h (ns_exec_path): Add it.
2937 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
2938 Use ns_exec_path.
2939
7c4e8ec0
GM
2940 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2941
26bccfae
PE
29422012-07-09 Paul Eggert <eggert@cs.ucla.edu>
2943
a0bee46f
PE
2944 * process.c (wait_reading_process_output): 'waitchannels' was unset
2945 when read_kbd || !NILP (wait_for_cell); fix this.
2946
5994c183
PE
2947 Add GCC-style 'const' attribute to functions that can use it.
2948 * character.h (char_resolve_modifier_mask):
2949 * keyboard.h (make_ctrl_char):
2950 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
2951 (init_character_once, next_almost_prime, init_fns, init_image)
2952 (flush_pending_output, init_sound):
2953 * mem-limits.h (start_of_data):
2954 * menu.h (finish_menu_items):
2955 Add ATTRIBUTE_CONST.
2956 * emacs.c (DEFINE_DUMMY_FUNCTION):
2957 Declare the dummy function with ATTRIBUTE_CONST.
2958 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
2959 Add decls with ATTRIBUTE_CONST.
2960
26bccfae
PE
2961 Minor improvements to make_formatted_string.
2962 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
2963 where int is good enough, as vsprintf returns an int.
2964 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
2965
a8290ec3
DA
29662012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2967
2968 Use make_formatted_string to avoid double length calculation.
2969 * lisp.h (make_formatted_string): New prototype.
2970 * alloc.c (make_formatted_string): New function.
2971 * buffer.c (Fgenerate_new_buffer_name): Use it.
2972 * dbus.c (syms_of_dbusbind): Likewise.
2973 * editfns.c (Fcurrent_time_zone): Likewise.
2974 * filelock.c (get_boot_time): Likewise.
2975 * frame.c (make_terminal_frame, set_term_frame_name)
2976 (x_report_frame_params): Likewise.
2977 * image.c (gs_load): Likewise.
2978 * minibuf.c (get_minibuffer): Likewise.
2979 * msdos.c (dos_set_window_size): Likewise.
2980 * process.c (make_process): Likewise.
2981 * xdisp.c (ensure_echo_area_buffers): Likewise.
2982 * xsettings.c (apply_xft_settings): Likewise.
2983
d01ba2f1
GM
29842012-07-09 Glenn Morris <rgm@gnu.org>
2985
2986 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
2987 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
2988 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
2989 * nsterm.h (ns_etc_directory): Add it.
2990 * callproc.c [HAVE_NS]: Include nsterm.h.
2991 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
2992
f1f924b6
DA
29932012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
2994
2995 Move marker debugging code under MARKER_DEBUG.
2996 * marker.c (MARKER_DEBUG): Move marker debugging code under
2997 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
2998 for bootstrap with --enable-checking (~3x slowdown reported
2999 by Juanma Barranquero <lekktu@gmail.com>).
3000 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3001
ab531b66
PE
30022012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3003
3004 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3005 See <http://bugs.gnu.org/11825#29>.
3006
c4b3bc8a
EZ
30072012-07-08 Eli Zaretskii <eliz@gnu.org>
3008
3009 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3010 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
3011 (display_line): Add commentary about displaying truncation glyphs
3012 on GUI frames.
3013 (produce_special_glyphs): Move here from term.c.
3014
3015 * term.c (produce_special_glyphs): Move to xdisp.c.
3016
3017 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3018 section.
c4b3bc8a 3019
b676b881
AS
30202012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3021
f17c5273
AS
3022 * xdisp.c (display_line): Avoid warning about implicit declaration
3023 of FRAME_FONT.
3024
298819b9
AS
3025 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3026
b676b881
AS
3027 * lisp.h: Remove empty conditional.
3028
6045c4fd
PE
30292012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3030
b3350bf9
PE
3031 * lread.c (load_path_check): Now static.
3032
6045c4fd
PE
3033 Fix some minor --with-ns problems found by static checking.
3034 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3035 (x_set_font) [!HAVE_X_WINDOWS]:
3036 * image.c (xpm_load_image) [HAVE_NS]:
3037 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3038 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3039 Remove unused local.
3040 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3041 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3042 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3043 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3044 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3045 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3046 Fix pointer signedness problem.
3047 * xfaces.c (FRAME_X_FONT_TABLE):
3048 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3049
929e7845
GM
30502012-07-07 Glenn Morris <rgm@gnu.org>
3051
3052 * lread.c (load_path_check): New function, split from init_lread.
3053 (init_lread): Reorganize. Motivation:
3054 If EMACSLOADPATH is set, check/warn about that rather than the
3055 defaults, which we are not going to use. Hence we can remove
3056 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3057 Don't warn if site-lisp directories are missing.
3058 If not installed, start from a blank load-path, since
3059 PATH_LOADSEARCH refers to the eventual installation directories.
3060
58dd0aa4
EZ
30612012-07-07 Eli Zaretskii <eliz@gnu.org>
3062
3063 Support truncation and continuation glyphs on GUI frames, when
3064 fringes are disabled. (Bug#11832)
3065 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
3066 continuation glyphs even if on GUI frames.
3067 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
3068 or both, are absent.
3069 (start_display, move_it_in_display_line_to): Handle the case of a
3070 GUI frame without a fringe to display continuation or truncation
3071 glyphs.
3072 (insert_left_trunc_glyphs): Support GUI frames: make sure
3073 truncation glyphs overwrite enough glyphs from the current line to
3074 have sufficient space in pixels.
3075 (display_line): Support truncation and continuation glyphs on GUI
3076 frames. If some spare pixels are left on the line after inserting
3077 the truncation glyphs, fill that space with a stretch glyph of a
3078 suitably computed width.
3079
3080 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3081 produce_glyphs, to support GUI sessions.
3082
31571fd7
PE
30832012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3084
5a16b9bc
PE
3085 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3086
f3047c75
PE
3087 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3088
31571fd7
PE
3089 Do not require float-time's arg to fit in time_t (Bug#11825).
3090 This works better on hosts where time_t is unsigned, and where
3091 float-time is applied to the (negative) difference between two times.
3092 * editfns.c (decode_time_components): Last arg is now double *,
3093 not int *, and means to store all the result as a double, without
3094 worrying about whether the seconds part fits in time_t.
3095 All callers changed.
3096 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3097 All callers changed.
3098 (Ffloat_time): Do not fail merely because the specified time falls
3099 outside of time_t range.
3100
4516fbef
GM
31012012-07-07 Glenn Morris <rgm@gnu.org>
3102
3103 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3104 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3105 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3106
07adc2c6
JB
31072012-07-07 Juanma Barranquero <lekktu@gmail.com>
3108
3109 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3110 Update dependencies.
3111
3112 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3113
fd573f31
PE
31142012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3115
fee5959d
PE
3116 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3117 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3118 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3119 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3120 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3121 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3122
fd573f31
PE
3123 * xfont.c (compare_font_names): Redo to omit the need for casts.
3124
ddadbc0e
AS
31252012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3126
fca8d6b6
AS
3127 * xfns.c (Fx_change_window_property): Doc fix.
3128 * w32fns.c (Fx_change_window_property): Doc fix.
3129
ddadbc0e
AS
3130 * w32fns.c (Fx_window_property): Accept the same arguments as the
3131 X Windows version. Doc fix.
3132 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3133
ed9265fc 31342012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
3135 Eli Zaretskii <eliz@gnu.org>
3136
3137 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3138 Windows-specific code from nt/config.nt moved here.
3139 Obsolete settings removed.
3140
216ee680
PE
31412012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3142
3143 * process.c: Avoid unnecessary calls to gettime.
3144 (wait_reading_process_output): Don't get the time of day
3145 when gobbling data immediately and not waiting, as there's no need
3146 for it in that case. This removes a FIXME.
3147
bdd091e4
JD
31482012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3149
3150 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3151 is defined (Bug#11768).
3152
9d44f8ce
DA
31532012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3154
3155 Fix marker debugging code.
3156 * marker.c (byte_char_debug_check): Do not perform the check
3157 if buffer is not multibyte.
090bd7cb
JB
3158 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3159 Call byte_char_debug_check with correct arguments.
9d44f8ce 3160
90fc4786
DA
31612012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3162
3163 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
3164 * marker.c (byte_char_debug_check, count_markers):
3165 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
3166 (byte_debug_flag): Remove.
3167 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3168 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3169
7b7ae965
DA
31702012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3171
4e57b342
DA
3172 Avoid code repetition in marker-related functions.
3173 * marker.c (attach_marker): New function.
3174 (Fset_marker, set_marker_restricted, set_marker_both)
3175 (set_marker_restricted_both): Use it.
3176 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3177 Consistently rename charno to charpos.
3178 (marker_position): Add eassert.
3179 (marker_byte_position): Convert to eassert.
3180
31812012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3182
3183 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 3184 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 3185 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 3186
657924ff
DA
31872012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3188
3189 Introduce fast path for the widely used marker operation.
3190 * alloc.c (build_marker): New function.
3191 * lisp.h (build_marker): New prototype.
3192 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3193 * composite.c (autocmp_chars): Likewise.
3194 * editfns.c (buildmark): Remove.
3195 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3196 (save_restriction_save): Use build_marker.
3197 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3198 * window.c (save_window_save): Likewise.
3199
041a49a6
DA
32002012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3201
3202 Do not use Fdelete_overlay in delete_all_overlays
3203 to avoid redundant calls to unchain_overlay.
3204 * buffer.c (drop_overlay): New function.
3205 (delete_all_overlays, Fdelete_overlay): Use it.
3206 * minibuf.c (get_minibuffer): Fix comment.
3207
7dca65a4
PE
32082012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3209
3210 Port to OpenBSD 5.1 amd64.
3211 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3212 This is needed for OpenBSD, and should be harmless on all BSD systems.
3213 Also, include <sys/sysctl.h>, as it should be available on all
3214 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3215 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3216 use p_pid member, not kp_proc.pid.
3217
8eb876e2
GM
32182012-07-06 Glenn Morris <rgm@gnu.org>
3219
3220 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3221
38182d90
PE
32222012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3223
3224 More xmalloc and related cleanup.
3225 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3226 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3227 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3228 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3229 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3230 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3231 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3232 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3233 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3234 * xterm.c:
3235 Omit needless casts involving void * pointers and allocation.
3236 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3237 as the former is more robust if P's type is changed.
3238 Prefer xzalloc to xmalloc + memset 0.
3239 Simplify malloc-or-realloc to realloc.
3240 Don't worry about xmalloc returning a null pointer.
3241 Prefer xstrdup to xmalloc + strcpy.
3242 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3243 growing it.
3244 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3245 alloca of a constant.
3246
6dd5a677
EZ
32472012-07-05 Eli Zaretskii <eliz@gnu.org>
3248
3249 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3250 hscroll is larger than the line width. Fixes long and futile
3251 looping inside extend_face_to_end_of_line (on a TTY) producing
3252 glyphs that are not needed and thrown away.
3253
6b312f0f
DA
32542012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3255
3256 * marker.c (set_marker_restricted_both): Simplify by using
3257 clip_to_bounds.
3258
f520ef9b
PE
32592012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3260
3261 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3262
383b7c95
JD
32632012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3264
3265 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3266 not defined (Bug#11768).
3267 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3268 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3269 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3270 followed by gtk_box_set_homogeneous (Bug#11768).
3271 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
3272 (update_theme_scrollbar_width, xg_create_scroll_bar):
3273 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
3274 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3275 (is_box_type): New function (Bug#11768).
3276 (xg_tool_item_stale_p): Call is_box_type.
5293d758 3277 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
3278 with default display (Bug#11768).
3279
d6e7bf45
EZ
32802012-07-05 Eli Zaretskii <eliz@gnu.org>
3281
3282 * xdisp.c (window_hscroll_limited): New function.
3283 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3284 coordinates when window's hscroll is set to insanely large
3285 values. (Bug#11857)
3286
431391ec
JB
32872012-07-05 Juanma Barranquero <lekktu@gmail.com>
3288
3289 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3290 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3291
23f86fce
DA
32922012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3293
3294 Cleanup xmalloc.
3295 * lisp.h (xzalloc): New prototype. Omit needless casts.
3296 * alloc.c (xzalloc): New function. Omit needless casts.
3297 * charset.c: Omit needless casts. Convert all calls to
3298 xmalloc with following memset to xzalloc.
3299 * dispnew.c: Likewise.
3300 * fringe.c: Likewise.
3301 * image.c: Likewise.
3302 * sound.c: Likewise.
3303 * term.c: Likewise.
3304 * w32fns.c: Likewise.
3305 * w32font.c: Likewise.
3306 * w32term.c: Likewise.
3307 * xfaces.c: Likewise.
3308 * xfns.c: Likewise.
3309 * xterm.c: Likewise.
3310 * atimer.c: Omit needless casts.
3311 * buffer.c: Likewise.
3312 * callproc.c: Likewise.
3313 * ccl.c: Likewise.
3314 * coding.c: Likewise.
3315 * composite.c: Likewise.
3316 * doc.c: Likewise.
3317 * doprnt.c: Likewise.
3318 * editfns.c: Likewise.
3319 * emacs.c: Likewise.
3320 * eval.c: Likewise.
3321 * filelock.c: Likewise.
3322 * fns.c: Likewise.
3323 * gtkutil.c: Likewise.
3324 * keyboard.c: Likewise.
3325 * lisp.h: Likewise.
3326 * lread.c: Likewise.
3327 * minibuf.c: Likewise.
3328 * msdos.c: Likewise.
3329 * print.c: Likewise.
3330 * process.c: Likewise.
3331 * region-cache.c: Likewise.
3332 * search.c: Likewise.
3333 * sysdep.c: Likewise.
3334 * termcap.c: Likewise.
3335 * terminal.c: Likewise.
3336 * tparam.c: Likewise.
3337 * w16select.c: Likewise.
3338 * w32.c: Likewise.
3339 * w32reg.c: Likewise.
3340 * w32select.c: Likewise.
3341 * w32uniscribe.c: Likewise.
3342 * widget.c: Likewise.
3343 * xdisp.c: Likewise.
3344 * xmenu.c: Likewise.
3345 * xrdb.c: Likewise.
3346 * xselect.c: Likewise.
3347
0497dc44
PE
33482012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3349
3350 * fileio.c (time_error_value): Check the right error number.
3351 Problem reported by Troels Nielsen in
3352 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3353
356e7178
PE
33542012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3355
4e71fd89
PE
3356 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3357 This should be fixed in a better way; see Eli Zaretskii in
3358 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3359 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3360
f0941253
PE
3361 * fileio.c (time_error_value): Rename from special_mtime.
3362 The old name's problems were noted by Eli Zaretskii in
3363 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3364
065c9eb4
PE
3365 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3366 This variable's comment says Emacs needs at least one GDB-visible
3367 symbol of type enum pvec_type, to work around GDB problems.
3368 The symbol's value doesn't matter.
3369
356e7178
PE
3370 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3371 that causes compilation to fail on pre-C99 compilers.
3372
ed9265fc 33732012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
3374
3375 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3376 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3377
3884d954
DA
33782012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3379
d209e2fb 3380 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
3381 headers for buffer_defaults and buffer_local_symbols.
3382 Reported by Juanma Barranquero <lekktu@gmail.com>.
3383
ee28be33
SM
33842012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3385
3386 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3387 * lisp.h (enum pvec_type): Use fewer bits.
3388 (PSEUDOVECTOR_SIZE_BITS): New constant.
3389 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3390 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3391 change in pvec_type.
3392 (PSEUDOVECTOR_TYPEP): New macro.
3393 (TYPED_PSEUDOVECTORP): Use it.
3394 * fns.c (internal_equal): Adapt code to extract pvectype.
3395 * emacs.c (gdb_pvec_type): Update type.
3396 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3397 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3398 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3399 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3400 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3401 abusing vector->header.next.nbytes.
3402 (live_vector_p): Use PVEC_TYPE.
3403 (mark_object): Adapt code to extract pvectype. Use switch.
3404
c7f2cd7f
PE
34052012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3406
3407 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3408 Tighten new eassert a bit.
3409
8ce70ed2
DA
34102012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3411
3412 Fix compilation with --enable-gcc-warnings and -O1
3413 optimization level.
3414 * doprnt.c (doprnt): Change type of tem to int, initialize
3415 to avoid compiler warning. Add eassert.
3416 * search.c (simple_search): Initialize match_byte to avoid
3417 compiler warning. Add eassert.
3418
dea7f1e5
PE
34192012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3420
24a212eb
PE
3421 Avoid weird behavior with large horizontal scrolls.
3422 Without this change, for example, large hscroll values would
3423 mess up Emacs's display on Fedora 15 x86, presumably due to
3424 overflows in int calculations in the display code.
3425 Also, if buffers had long lines, Emacs would freeze.
3426 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3427 (set_window_hscroll): New function, containing the old guts of
3428 Fset_window_hscroll. Return the clipped value.
3429 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3430 This avoids the need to check against PTRDIFF_MAX.
3431
dea7f1e5
PE
3432 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3433
76046526
DA
34342012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3435
3436 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3437
39adff0d
PE
34382012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3439
63807d47
PE
3440 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3441 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3442 since GCC 4.4.6 issues a bogus warning for them.
3443
39adff0d
PE
3444 Fix bugs in file timestamp newness comparisons.
3445 * fileio.c (Ffile_newer_than_file_p):
3446 * lread.c (Fload): Use full timestamp resolution of files,
3447 not just the 1-second resolution, so that files that are only
3448 slightly newer still count as newer.
3449 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3450 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3451
dbeed9a6
PE
34522012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3453
3454 * fileio.c: Improve handling of file time marker. (Bug#11852)
3455 (special_mtime): New function.
3456 (Finsert_file_contents, Fverify_visited_file_modtime):
3457 Use it to set special mtime values consistently.
3458
636334d6
AS
34592012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3460
3461 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3462 marker for non-existing file. (Bug#11852)
3463
e2017fe2
GM
34642012-07-03 Glenn Morris <rgm@gnu.org>
3465
3466 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3467 and did not make it into globals.h).
3468
404dbd37
TT
34692012-07-03 Tom Tromey <tromey@redhat.com>
3470
3471 * window.c (Fset_window_margins, Fset_window_fringes)
3472 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3473 * textprop.c (Fprevious_property_change): No longer static.
3474 * syntax.c (Fsyntax_table_p): No longer static.
3475 * process.c (Fget_process, Fprocess_datagram_address): No longer
3476 static.
3477 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3478 * keyboard.c (Fcommand_execute): No longer static.
3479 Remove EXFUN.
3480 * insdel.c (Fcombine_after_change_execute): No longer static.
3481 * image.c (Finit_image_library): No longer static.
3482 * fileio.c (Fmake_symbolic_link): No longer static.
3483 * eval.c (Ffetch_bytecode): No longer static.
3484 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
3485 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3486 No longer static.
404dbd37
TT
3487 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3488 static.
3489 * dired.c (Ffile_attributes): No longer static.
3490 * composite.c (Fcomposition_get_gstring): No longer static.
3491 * callproc.c (Fgetenv_internal): No longer static.
3492
3493 * ccl.h: Remove EXFUNs.
3494 * buffer.h: Remove EXFUNs.
3495 * dispextern.h: Remove EXFUNs.
3496 * intervals.h: Remove EXFUNs.
3497 * fontset.h: Remove EXFUN.
3498 * font.h: Remove EXFUNs.
3499 * dosfns.c (system_process_attributes): Remove EXFUN.
3500 * keymap.h: Remove EXFUNs.
3501 * lisp.h: Remove EXFUNs.
3502 * w32term.h: Remove EXFUNs.
3503 * window.h: Remove EXFUNs.
3504 * xsettings.h: Remove EXFUN.
3505 * xterm.h: Remove EXFUN.
3506
8e4fd1e1
GM
35072012-07-03 Glenn Morris <rgm@gnu.org>
3508
3509 * lisp.h (Frandom): Make it visible to C.
3510 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3511 buffer for invisible buffers. (Bug#1229)
3512
ca95b3eb
DA
35132012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3514
3515 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3516 values which aren't power of 2.
14ae4239
BT
3517 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3518 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
3519 accordingly.
3520
7555c33f
SM
35212012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3522
3523 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3524
3525 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3526
d12e8f5a
DA
35272012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3528
3529 * alloc.c (allocate_vector_block): Remove redundant
3530 calls to mallopt if DOUG_LEA_MALLOC is defined.
3531 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3532 avoid calls to mallopt if zero_vector is returned.
3533
296094c3
DA
35342012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3535
3536 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3537 is enabled, avoid dereferencing NULL current_sblock if
3538 running undumped.
3539
36429c89
DA
35402012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3541
3542 Cleanup basic buffer management.
3543 * buffer.h (struct buffer): Change layout to use generic vector
3544 marking code. Fix some comments. Change type of 'clip_changed'
3545 to bitfield. Remove unused #ifndef old.
3546 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3547 (GET_OVERLAYS_AT): Fix indentation.
3548 (for_each_per_buffer_object_at): New macro.
3549 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3550 (Fbuffer_local_variables): Use it.
3551 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3552 * alloc.c (allocate_buffer): Adjust to match new layout of
3553 struct buffer. Fix comment.
3554 (mark_overlay): New function.
3555 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3556 Lisp area of struct buffer.
3557 (mark_object): Use it. Adjust marking of misc objects
3558 and related comments.
3559
3b3e4cac
PE
35602012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3561
3562 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3563 wrapper that is not needed because the wrapped code is a no-op (zero
3564 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3565 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3566
cf5c0175
DA
35672012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3568
3569 * alloc.c (mark_buffer): Simplify. Remove prototype.
3570 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 3571 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
3572 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3573 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 3574
ca26824c
GM
35752012-06-30 Glenn Morris <rgm@gnu.org>
3576
2e4c5312
GM
3577 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3578
ca26824c
GM
3579 * epaths.in (PATH_SITELOADSEARCH): New.
3580 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3581 This is rather than relying on --enable-locallisppath elements
3582 having "site-lisp" in their names. (Bug#10208#25, 11658)
3583
0d23c240
EZ
35842012-06-30 Eli Zaretskii <eliz@gnu.org>
3585
c9240d7a
EZ
3586 * w32proc.c (sys_select): Accept and ignore one more argument.
3587
3588 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3589
0d23c240 3590 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 3591 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
3592
3593 * sysdep.c: Don't include dos.h and dosfns.h.
3594
3595 * process.c (sys_select):
3596 * msdos.c (sys_select): Accept one more argument and ignore it.
3597
3598 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3599 adapt data types and code to that.
3600
3601 * dosfns.c:
3602 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3603 which clashes with the gnulib function of the same name.
3604
af5a5a98
AS
36052012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3606
c5e4379c
AS
3607 * font.c (font_style_to_value, font_style_symbolic)
3608 (font_prop_validate_style): Add type checks for values in
3609 font_style_table.
3610
af5a5a98
AS
3611 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3612 argument.
3613 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3614 uses.
3615
8d38f461
EZ
36162012-06-29 Eli Zaretskii <eliz@gnu.org>
3617
2e5a6631
EZ
3618 * xdisp.c (try_window_id): Undo last change.
3619
8d38f461
EZ
3620 * w32.c (getwd): Adjust commentary about startup_dir.
3621 (init_environment): Always call sys_access, even in non-MSVC
3622 builds. Don't chdir to the directory of the Emacs executable.
3623 This undoes code from 1997 which was justified by the need to
3624 "avoid conflicts when removing and renaming directories". But its
3625 downside was that every relative file name was being interpreted
3626 relative to the directory of the Emacs executable, which can never
3627 be TRT. In particular, it broke sys_access when called with
3628 relative file names.
3629 (sys_access): Map GetLastError to errno.
3630
2af3565e
DA
36312012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3632
3633 * window.h (struct window): Change type of 'fringes_outside_margins'
3634 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 3635 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
3636 Adjust comment.
3637 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3638 to ptrdiff_t.
3639
c8d3a25c 36402012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 3641
c8d3a25c
GM
3642 * gnutls.c (emacs_gnutls_handshake):
3643 Add QUIT to make the loop interruptible.
57570cd3 3644
c8d3a25c 36452012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 3646
c8d3a25c
GM
3647 * charset.c (init_charset): Make lack of etc/charsets fatal.
3648
3e984ee8
DA
36492012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3650
3651 * editfns.c (region_limit): Fix type mismatch.
3652
ef884f23
DA
36532012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3654
3655 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3656 undefined. Convert from xassert to eassert.
3657 * nsmenu.m: Convert from xassert to eassert.
3658 * nsterm.m: Likewise.
3659
7d7e0027
SM
36602012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3661
3662 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3663
aa754e6a
PE
36642012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3665
3666 Avoid integer overflow on scroll-left and scroll-right.
3667 * window.c (HSCROLL_MAX): New macro.
3668 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3669 overflow when requested scroll falls outside ptrdiff_t range.
3670
80b00b08
DA
36712012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3672
3673 * window.h (struct window): Change type of 'hscroll',
3674 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3675 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3676 Adjust users accordingly.
3677 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3678 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3679 from EMACS_INT to ptrdiff_t.
3680 (make_window): Omit redundant initialization.
3681
62b2bcf6
JB
36822012-06-28 Juanma Barranquero <lekktu@gmail.com>
3683
3684 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3685
45942c7d
DA
36862012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3687
3688 * window.h (struct window): Change type of 'use_time' and
3689 'sequence_number' from Lisp_Object to int.
3690 * frame.c (make_frame): Adjust users accordingly.
3691 * print.c (print_object): Likewise.
3692 * window.c (select_window, Fwindow_use_time, make_parent_window)
3693 (make_window): Likewise.
3694
e509cfa6
DA
36952012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3696
3697 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3698 enabled with --enable-checking=[all,glyphs] configure option.
3699 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3700 adjust comments accordingly.
3701 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3702 undefined, adjust comments accordingly.
3703 * image.c: Likewise.
3704 * scroll.c: Likewise.
3705 * w32fns.c: Likewise.
3706 * w32term.c: Likewise.
3707 * xdisp.c: Likewise.
3708 * xfaces.c: Likewise.
3709 * xfns.c: Likewise.
3710 * xterm.c: Likewise.
3711
a54e2c05
DA
37122012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3713
3714 Generalize run-time debugging checks.
3715 * dispextern.h (XASSERTS): Remove.
3716 * fontset.c (xassert): Remove.
3717 Convert from xassert to eassert.
3718 * alloc.c: Convert from xassert to eassert.
3719 * bidi.c: Likewise.
3720 * dispnew.c: Likewise.
3721 * fns.c: Likewise.
3722 * fringe.c: Likewise.
3723 * ftfont.c: Likewise.
3724 * gtkutil.c: Likewise.
3725 * image.c: Likewise.
3726 * keyboard.c: Likewise.
3727 * menu.c: Likewise.
3728 * process.c: Likewise.
3729 * scroll.c: Likewise.
3730 * sound.c: Likewise.
3731 * term.c: Likewise.
3732 * w32console.c: Likewise.
3733 * w32fns.c: Likewise.
3734 * w32term.c: Likewise.
3735 * window.c: Likewise.
3736 * xdisp.c: Likewise.
3737 * xfaces.c: Likewise.
3738 * xfns.c: Likewise.
3739 * xselect.c: Likewise.
3740 * xterm.c: Likewise.
3741
1ec4b7b2
SM
37422012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3743
3744 * fns.c (maybe_resize_hash_table): Output message when growing the
3745 purify-hashtable.
3746
2014308a
DA
37472012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3748
3749 * alloc.c (allocate_string_data): Remove dead code.
3750 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3751 avoid GCC warning about unused macro.
3752
246155eb
DA
37532012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3754
3755 * alloc.c (allocate_string): Omit intervals initialization.
3756 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3757 as in make_pure_string and make_pure_c_string.
3758
43184b7b
DA
37592012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3760
d209e2fb 3761 * alloc.c (allocate_string): Fix last change.
43184b7b 3762
3fe6dd74
DA
37632012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3764
d209e2fb 3765 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
3766 to memset, add explicit initialization where appropriate.
3767
1ba6038a
GM
37682012-06-27 Glenn Morris <rgm@gnu.org>
3769
3770 * lisp.mk (lisp): Remove paths.elc.
3771
c89926a5
CY
37722012-06-27 Chong Yidong <cyd@gnu.org>
3773
3774 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3775
ed6b3510
JW
37762012-06-26 John Wiegley <johnw@newartisans.com>
3777
1ec4b7b2 3778 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
3779 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3780
ed6b3510
JW
3781 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3782 when building with Clang.
3783
8edd4a2b
SM
37842012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3785
3786 * eval.c (Fapply): Allow calling it with a single argument.
3787
f6f62d1b
EZ
37882012-06-26 Eli Zaretskii <eliz@gnu.org>
3789
3790 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3791 _stricmp and _strnicmp.
3792 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3793
62efea5e
DA
37942012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3795
3796 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3797 allocated window.
3798 (allocate_process): Likewise for new process.
8edd4a2b 3799 (allocate_terminal): Change to use offsetof.
62efea5e
DA
3800 (allocate_frame): Likewise.
3801 * frame.c (make_frame): Omit redundant initialization.
3802 * window.c (make_parent_window): Use memset.
3803 (make_window): Omit redundant initialization.
3804 * process.c (make_process): Omit redundant initialization.
3805 * terminal.c (create_terminal): Likewise.
3806
42997f4d
DA
38072012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3808
3809 * term.c (delete_tty): Remove redundant call to memset.
3810
1130ecfc
DA
38112012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3812
3813 * alloc.c: Remove build_string.
3814 * lisp.h: Define build_string as static inline. This provides
3815 a better opportunity to optimize away calls to strlen when the
3816 function is called with compile-time constant argument.
3817 * image.c (imagemagick_error): Convert to build_string.
3818 * w32proc.c (sys_spawnve): Likewise.
3819 * xterm.c (x_term_init): Likewise.
3820
cf38a720
PE
38212012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3822
99027bdd
PE
3823 Use sprintf return value instead of invoking strlen on result.
3824 In the old days this wasn't portable, since some sprintf
3825 implementations returned char *. But they died out years ago and
3826 Emacs already assumes sprintf returns int.
3827 Similarly for float_to_string.
3828 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3829 * ccl.c (ccl_driver):
3830 * character.c (string_escape_byte8):
3831 * data.c (Fnumber_to_string):
3832 * doprnt.c (doprnt):
3833 * print.c (print_object):
3834 * xdisp.c (message_dolog):
3835 * xfns.c (syms_of_xfns):
3836 Use sprintf or float_to_string result to avoid need to call strlen.
3837 * data.c (Fnumber_to_string):
3838 Use make_unibyte_string, since the string must be ASCII.
3839 * lisp.h, print.c (float_to_string): Now returns int length.
3840 * term.c (produce_glyphless_glyph):
3841 Use sprintf result rather than recomputing it.
3842
cf38a720
PE
3843 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3844 * Makefile.in (ALL_CFLAGS):
3845 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3846 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3847
3511c784
DA
38482012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3849
0a08eb21 3850 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
3851 strcasecmp if available.
3852 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3853
fb7da12e
AS
38542012-06-25 Andreas Schwab <schwab@linux-m68k.org>
3855
3856 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3857 Avoid comma operator.
3858 * menu.c (push_submenu_start, push_submenu_end)
3859 (push_left_right_boundary, push_menu_pane): Likewise.
3860 * msdos.c (dos_rawgetc): Likewise.
3861
afa2ffd8
DA
38622012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3863
3864 * xfns.c (xic_create_fontsetname): Remove redundant calls
3865 to memset.
3866
b3b4476b
PE
38672012-06-25 Paul Eggert <eggert@cs.ucla.edu>
3868
4495ff38
PE
3869 * gtkutil.c (get_utf8_string): Remove redundant assignment.
3870 sprintf already null-terminates its output.
3871
b3b4476b
PE
3872 * xfns.c (x_window): Remove redundant cast.
3873
b00876c9
DA
38742012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3875
3876 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3877 `const char *' to `char *' to avoid compiler warning.
3878
d188e26b
PE
38792012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3880
885d1d74
PE
3881 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3882 instead of truncating it to 63 (admittedly a generous limit).
3883
d188e26b
PE
3884 * process.c: Fix spelling and caps in comments.
3885
e2f560b1
DN
38862012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
3887
e86db54b 3888 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
3889 * sysdep.c (setpgrp): Remove definition, not used in this file.
3890
7583a3a1
JB
38912012-06-24 Juanma Barranquero <lekktu@gmail.com>
3892
3893 * makefile.w32-in: Update dependencies.
3894
696056c2
EZ
38952012-06-24 Eli Zaretskii <eliz@gnu.org>
3896
3897 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3898 (SYSTIME_H): Add nt/inc/sys/time.h.
3899
3900 * systime.h [WINDOWSNT]: Include sys/time.h.
3901
3902 * s/ms-w32.h (struct timespec): Definition moved from
3903 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
3904
845ca893
PE
39052012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3906
3907 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
3908 * buffer.h (buffer_slot_type_mismatch):
3909 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3910 * eval.c (unwind_to_catch):
3911 * image.c (my_png_error, my_error_exit):
3912 * keyboard.c (quit_throw_to_read_char, user_error)
3913 (Fexit_recursive_edit, Fabort_recursive_edit):
3914 * lisp.h (die, args_out_of_range, args_out_of_range_3)
3915 (wrong_type_argument, buffer_overflow, __executable_start)
3916 (memory_full, buffer_memory_full, string_overflow, Fthrow)
3917 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
3918 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
3919 (fatal):
3920 (child_setup) [!DOS_NT]:
3921 * lread.c (end_of_file_error, invalid_syntax):
3922 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
3923 * puresize.h (pure_write_error):
3924 * search.c (matcher_overflow):
3925 * sound.c (sound_perror, alsa_sound_perror):
3926 * sysdep.c, syssignal.h (croak):
3927 * term.c (maybe_fatal, vfatal):
3928 * textprop.c (text_read_only):
3929 * undo.c (user_error):
3930 * unexmacosx.c (unexec_error):
3931 * xterm.c (x_ins_del_lines, x_delete_glyphs):
3932 Use _Noreturn rather than NO_RETURN.
3933 No need for separate decl merely because of _Noreturn.
3934 * sound.c (sound_warning, parse_sound):
3935 Remove unnecessary forward decls.
3936
f1dd8073
PE
39372012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3938
3939 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
3940 * lisp.h (WAIT_READING_MAX): New macro.
3941 * dispnew.c (Fsleep_for, sit_for):
3942 * keyboard.c (kbd_buffer_get_event):
3943 * process.c (Faccept_process_output):
3944 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
3945 This improves on the previous patch, which introduced a bug
3946 when time_t is unsigned and as wide as intmax_t.
3947 See <http://bugs.gnu.org/9000#51>.
3948
b82c1755
EZ
39492012-06-23 Eli Zaretskii <eliz@gnu.org>
3950
3951 * dispnew.c (sit_for, Fsleep_for):
3952 * keyboard.c (kbd_buffer_get_event):
3953 * process.c (Faccept_process_output): Avoid compiler warnings when
3954 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
3955
ca300656
JB
39562012-06-23 Juanma Barranquero <lekktu@gmail.com>
3957
049ec95b
JB
3958 * makefile.w32-in: Update dependencies.
3959
ca300656
JB
3960 * w32.c (ltime): Add return type and declare static.
3961 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
3962
db7b8d06
PE
39632012-06-23 Paul Eggert <eggert@cs.ucla.edu>
3964
3965 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
3966 Privately reported by Herbert J. Skuhra.
3967 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
3968 All uses changed.
3969 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
3970 not make_lisp_timeval, when the argument is of type EMACS_TIME.
3971
0bd8297f
EZ
39722012-06-23 Eli Zaretskii <eliz@gnu.org>
3973
96512555
EZ
3974 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
3975 last argument of make_unibyte_string.
3976
0bd8297f
EZ
3977 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
3978 language ID in the event parameters.
3979
3980 * w32term.c (w32_read_socket): Put the new keyboard codepage into
3981 event.code, not the obscure "character set ID".
3982
63def6b6
CY
39832012-06-23 Chong Yidong <cyd@gnu.org>
3984
3985 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
3986
e8a02204
EZ
39872012-06-23 Eli Zaretskii <eliz@gnu.org>
3988
388cdec0
EZ
3989 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
3990 * w32.c (fdutimens): New function.
3991
3992 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
3993
3994 * s/ms-w32.h (pselect): Redirect to sys_select.
3995
3996 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
3997
e8a02204
EZ
3998 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
3999 in the logic of incrementing and decrementing the value of
4000 use_relocatable_buffers.
4001
d054f3fb
PE
40022012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4003
4004 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4005 Privately reported by Herbert J. Skuhra.
4006 [__FreeBSD__]: Remove "*/" typo after "#include".
4007 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4008 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4009 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4010 Don't assume EMACS_TIME and struct timeval are the same type.
4011
d35af63c
PE
40122012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4013
4014 Support higher-resolution time stamps (Bug#9000).
4015 The time stamps are only nanosecond-resolution at the C level,
4016 since that's the best that any real-world system supports now.
4017 But they are picosecond-resolution at the Lisp level, as that's
4018 easy, and leaves room for future OS improvements.
4019
4020 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4021 (LIBES): Use it.
4022
4023 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4024 Don't get current time unless it's needed.
4025
4026 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4027 now provides it if it's absent.
4028 (start_atimer): Port to higher-res time stamps.
4029 Check for time stamp overflow. Don't get current time more
4030 often than is needed.
4031
4032 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4033 Include systime.h, not time.h.
4034 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4035
4036 * dired.c: Include stat-time.h.
4037 (Ffile-attributes): File times now have higher resolution.
4038
4039 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4040 (struct image): Timestamp now has higher resolution.
4041
4042 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4043 has at least microseconds now. All uses removed.
4044 (update_frame, update_single_window, update_window, update_frame_1)
4045 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 4046 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
4047
4048 * editfns.c (time_overflow): Now extern.
4049 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4050 (float-time, Fformat_time_string, Fcurrent_time_string)
4051 (Fcurrent_time_zone): Accept and generate higher-resolution
4052 time stamps.
4053 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4054 (decode_time_components, lisp_seconds_argument): New functions.
4055 (make_time): Now static.
4056 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4057 Report an error if the time is invalid, rather than having the caller
4058 do that.
4059
4060 * fileio.c: Include <stat-time.h>
4061 (Fcopy_file): Copy higher-resolution time stamps.
4062 Prefer to set the time stamp via a file descriptor if that works.
4063 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4064 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4065 (Fvisited_file_modtime, Fset_visited_file_modtime):
4066 Support higher-resolution time stamps.
4067
4068 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4069
4070 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4071
4072 * image.c (prepare_image_for_display, clear_image_cache)
4073 (lookup_image): Port to higer-resolution time stamps.
4074
4075 * keyboard.c (start_polling, bind_polling_period):
4076 Check for time stamp overflow.
4077 (read_char, kbd_buffer_get_event, timer_start_idle)
4078 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4079 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4080 Port to higher-resolution time stamps. Do not assume time_t is signed.
4081 (decode_timer): New function. Timers are now vectors of length 9,
4082 not 8, to accommodate the picosecond component.
4083 (timer_check_2): Use it.
4084
4085 * nsterm.m (select_timeout, timeval_subtract): Remove.
4086 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4087 as they're a bit more accurate and handle overflow better.
4088 (ns_select): Change prototype to be compatible with pselect.
4089 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4090 * nsterm.h (ns_select): Adjust prototype.
4091
4092 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4093 us-resolution time stamps.
4094 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4095
4096 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4097
4098 * lisp.h (time_overflow): New decl.
4099 (wait_reading_process_output): First arg is now intmax_t, not int,
4100 to accommodate larger waits.
4101
4102 * process.h (struct Lisp_Process.read_output_delay):
4103 Now counts nanoseconds, not microseconds.
4104 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4105 EMACS_HAS_USECS.
4106 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4107 (wait_reading_process_output):
4108 Port to ns-resolution time stamps.
4109 (Faccept_process_output, wait_reading_process_output):
4110 Check for time stamp overflow. Do not assume time_t is signed.
4111 (select_wrapper): Remove; we now use pselect.
4112 (Fprocess_attributes): Now generates ns-resolution time stamps.
4113
4114 * sysdep.c: Include utimens.h. Don't include utime.h
4115 or worry about struct utimbuf; gnulib does that for us now.
4116 (gettimeofday): Remove; gnulib provides a substitute.
4117 (make_timeval): New function.
4118 (set_file_times): Now sets ns-resolution time stamps.
4119 New arg FD; all uses changed.
4120 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4121 (system_process_attributes):
4122 Now returns ns-resolution time stamp. All uses changed.
4123 Check for time stamp overflow.
4124
4125 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4126 provides a substitute now.
4127
4128 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4129 since it guarantees struct timespec.
4130 (EMACS_TIME): Now struct timespec, so that we can support
4131 ns-resolution time stamps.
4132 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4133 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4134 (EMACS_USECS): Remove.
4135 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4136 so multiply the arg by 1000 before storing it.
4137 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4138 New macros.
4139 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4140 Port to ns-resolution time stamps.
4141 (EMACS_TIME_NEG_P): Remove; replaced by....
4142 (EMACS_TIME_SIGN): New macro.
4143 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4144 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4145 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4146 (make_timeval, make_lisp_time, decode_time_components): New decls.
4147 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4148 that it mishandled time_t overflow. You can't compare by subtracting!
4149 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4150 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4151
4152 * term.c: Include <sys/time.h>.
4153 (timeval_to_Time): New function, for proper overflow wraparound.
4154 (term_mouse_position, term_mouse_click): Use it.
4155
4156 * undo.c (record_first_change): Support higher-resolution time stamps
4157 in the undo buffer.
4158 (Fprimitive_undo): Use them when restoring time stamps.
4159
4160 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4161 (w32_get_internal_run_time):
4162 Port to higher-resolution Emacs time stamps.
4163 (ltime): Now accepts single 64-bit integer, as that's more convenient
4164 for callers.
4165
4166 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4167
4168 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4169 for compatibility with pselect. Support ns-resolution time stamps.
4170
4171 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4172
4173 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4174 Check for time stamp overflow, and support ns-resolution time stamps.
4175
4176 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4177 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4178 (timeval_subtract): Remove; no longer needed.
4179 (XTflash, XTring_bell, x_wait_for_event):
4180 Port to ns-resolution time stamps. Don't assume time_t is signed.
4181
b6a92dfe
CY
41822012-06-22 Chong Yidong <cyd@gnu.org>
4183
4184 * xdisp.c (x_consider_frame_title): Revert last change.
4185
d251c37c
EZ
41862012-06-22 Eli Zaretskii <eliz@gnu.org>
4187
4188 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4189 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4190 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4191 staticidx goes up to 1597 out of 1600 = 0x640.)
4192
f10deafb
PE
41932012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4194
4195 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4196 Otherwise, the umask might be mistakenly 0 while handling input signals.
4197
ec6de1e2
SM
41982012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4199
4200 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4201
28be1ada
DA
42022012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4203
4204 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4205 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4206 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4207 access to `contents' member of Lisp_Vector objects with AREF and ASET
4208 where appropriate.
4209
c6bf3022
CY
42102012-06-19 Chong Yidong <cyd@gnu.org>
4211
4212 * frame.c (delete_frame): When selecting a frame on a different
4213 text terminal, do not alter the terminal's top-frame.
4214
4215 * xdisp.c (format_mode_line_unwind_data): Record the target
4216 frame's selected window and its terminal's top-frame.
4217 (unwind_format_mode_line): Restore them.
4218 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4219 Callers changed.
4220 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4221 since tty frames can be explicitly named.
4222 (prepare_menu_bars): Likewise.
4223
4224 * term.c (Ftty_top_frame): New function.
4225
defd4196
PE
42262012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4227
4228 Port byte-code-meter to modern targets.
4229 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4230 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 4231 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
4232 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4233 (METER_1, METER_2): Simplify.
4234
1053a871
SM
42352012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4236
4237 * data.c (Fdefalias): Return `symbol' (bug#11686).
4238
b7e8d081
MR
42392012-06-18 Martin Rudalics <rudalics@gmx.at>
4240
4241 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
4242 gets killed during executing of this function (Bug#11665).
4243 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
4244 (Vkill_buffer_query_functions): In doc-string say that functions
4245 run by this hook should not change the current buffer.
4246
7ea2b339
PE
42472012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4248
4249 Fix recently-introduced process.c problems found by static checking.
4250 * process.c (write_queue_push, write_queue_pop, send_process):
4251 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4252 (write_queue_pop): Fix pointer signedness problem.
4253 (send_process): Remove unused local.
4254
96a313a1
CY
42552012-06-17 Chong Yidong <cyd@gnu.org>
4256
4257 * xdisp.c (redisplay_internal): No need to redisplay terminal
4258 frames that are not on top.
4259
20ca2e94
TN
42602012-06-17 Troels Nielsen <bn.troels@gmail.com>
4261
4262 * process.c (make_process): Initialize write_queue.
4263 (write_queue_push, write_queue_pop): New functions.
4264 (send_process): Use them to maintain correct ordering of process
4265 writes (Bug#10815).
4266
9a900ca9
PE
42672012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4268
310fbfa8
PE
4269 * lisp.h (eassert): Assume C89 or later.
4270 This removes the need for CHECK.
4271 (CHECK): Remove. Its comments about always evaluating its
4272 argument were confusing, as 'eassert' typically does not evaluate
4273 its argument.
4274
27bb1ca4
PE
4275 * coding.c (produce_chars): Use ptrdiff_t, not int.
4276
9a900ca9
PE
4277 * xterm.c (x_draw_underwave): Check for integer overflow.
4278 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4279
41b7f8bc 42802012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
4281
4282 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4283 referenced (Bug#11583).
4284
9b0e3eba
AA
42852012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4286
4287 Implement wave-style variant of underlining.
4288 * dispextern.h (face_underline_type): New enum.
4289 (face): Add field for underline type.
4290 * nsterm.m (ns_draw_underwave): New function.
4291 (ns_draw_text_decoration): Use it.
4292 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4293 New functions.
4294 (x_draw_glyph_string): Use them.
4295 * xfaces.c (Qline, Qwave): New Lisp objects.
4296 (check_lface_attrs, merge_face_ref)
1053a871
SM
4297 (Finternal_set_lisp_face_attribute, realize_x_face):
4298 Handle wave-style underline face attributes.
9b0e3eba
AA
4299 * xterm.c (x_draw_underwave): New function.
4300 (x_draw_glyph_string): Use it.
4301
0fb52f11
JB
43022012-06-16 Juanma Barranquero <lekktu@gmail.com>
4303
4304 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4305 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4306 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4307 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4308 ($(BLD)/w32select.$(O)): Update dependencies.
4309
e5560ff7
AS
43102012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4311
4312 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4313 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4314 * character.c (_fetch_multibyte_char_p): Remove.
4315 * alloc.c: Include "character.h" before "buffer.h".
4316 * bidi.c: Likewise.
4317 * buffer.c: Likewise.
4318 * bytecode.c: Likewise.
4319 * callint.c: Likewise.
4320 * callproc.c: Likewise.
4321 * casefiddle.c: Likewise.
4322 * casetab.c: Likewise.
4323 * category.c: Likewise.
4324 * cmds.c: Likewise.
4325 * coding.c: Likewise.
4326 * composite.c: Likewise.
4327 * dired.c: Likewise.
4328 * dispnew.c: Likewise.
4329 * doc.c: Likewise.
4330 * dosfns.c: Likewise.
4331 * editfns.c: Likewise.
4332 * emacs.c: Likewise.
4333 * fileio.c: Likewise.
4334 * filelock.c: Likewise.
4335 * font.c: Likewise.
4336 * fontset.c: Likewise.
4337 * fringe.c: Likewise.
4338 * indent.c: Likewise.
4339 * insdel.c: Likewise.
4340 * intervals.c: Likewise.
4341 * keyboard.c: Likewise.
4342 * keymap.c: Likewise.
4343 * lread.c: Likewise.
4344 * macros.c: Likewise.
4345 * marker.c: Likewise.
4346 * minibuf.c: Likewise.
4347 * nsfns.m: Likewise.
4348 * nsmenu.m: Likewise.
4349 * print.c: Likewise.
4350 * process.c: Likewise.
4351 * regex.c: Likewise.
4352 * region-cache.c: Likewise.
4353 * search.c: Likewise.
4354 * syntax.c: Likewise.
4355 * term.c: Likewise.
4356 * textprop.c: Likewise.
4357 * undo.c: Likewise.
4358 * unexsol.c: Likewise.
4359 * w16select.c: Likewise.
4360 * w32fns.c: Likewise.
4361 * w32menu.c: Likewise.
4362 * window.c: Likewise.
4363 * xdisp.c: Likewise.
4364 * xfns.c: Likewise.
4365 * xmenu.c: Likewise.
4366 * xml.c: Likewise.
4367 * xselect.c: Likewise.
4368
2f07e6af
EZ
43692012-06-16 Eli Zaretskii <eliz@gnu.org>
4370
1053a871
SM
4371 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4372 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 4373 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
4374 row.
4375 (handle_face_prop): Use chunk-relative overlay string index when
4376 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
4377 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4378 the rightmost. (Bug#11720)
2f07e6af 4379
29b83cec
AS
43802012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4381
4382 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4383 (CATEGORY_MEMBER): Enforce 1/0 value.
4384 * category.c (_temp_category_set): Remove.
4385
4c5501e9
EZ
43862012-06-16 Eli Zaretskii <eliz@gnu.org>
4387
4388 * window.c (Fdelete_other_windows_internal)
4389 (Fdelete_window_internal): Don't access frame's mouse highlight
4390 info of the initial frame. (Bug#11677)
4391
2b570124
PE
43922012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4393
e93864f9
PE
4394 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4395 Assume USE_2_TAGS_FOR_INTS.
4396 (xreload): Adjust $tagmask width to match recent lisp.h change.
4397
2b570124
PE
4398 Simplify lisp.h in minor ways that should not affect code.
4399 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4400 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4401 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4402 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4403 (INTTYPEBITS): New macro, for clarity.
4404 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
4405 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4406 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
4407 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4408 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4409
81755f69
JB
44102012-06-13 Juanma Barranquero <lekktu@gmail.com>
4411
4412 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4413
16192a57
GM
44142012-06-13 Glenn Morris <rgm@gnu.org>
4415
4416 * s/bsd-common.h (BSD4_3):
4417 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4418
646b5f55
AS
44192012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4420
4421 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4422 instead of union.
4423 (XLI, XIL): Define.
1053a871
SM
4424 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4425 Use them.
4426 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 4427 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 4428 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
4429 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4430 * frame.c (delete_frame): Remove outdated comment.
4431 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4432 USE_LISP_UNION_TYPE.
4433 (Fw32_unregister_hot_key): Likewise.
4434 (Fw32_toggle_lock_key): Likewise.
4435 * w32menu.c (add_menu_item): Likewise.
4436 (w32_menu_display_help): Use XIL instead of checking
4437 USE_LISP_UNION_TYPE.
4438 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4439 (init_heap): Likewise.
4440 * w32term.c (w32_read_socket): Update comment.
4441
1d3823c9
GM
44422012-06-13 Glenn Morris <rgm@gnu.org>
4443
c62ff706
GM
4444 * s/usg5-4-common.h, src/s/unixware.h:
4445 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4446
1d3823c9
GM
4447 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4448
bfe3e0a2
PE
44492012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4450
4451 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4452 * alloc.c (make_number) [!defined make_number]:
4453 Remove, as lisp.h always defines this now.
4454 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4455 (roundup_size): Verify that it is a power of 2.
4456 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4457 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4458 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4459 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4460 USE_LSB_TAG now is always defined to be either 0 or 1.
4461 All uses changed.
4462 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4463 code works fine either way, and efficiency is not a concern here,
4464 as the union type is for debugging, not for production.
4465 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4466 Use an inline function on all platforms when using the union type,
4467 since this is simpler and 'static inline' can be used portably
4468 within Emacs now.
4469 (LISP_INITIALLY_ZERO): New macro.
4470 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4471 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4472
45fa9c0f
GM
44732012-06-12 Glenn Morris <rgm@gnu.org>
4474
b4492cba
GM
4475 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4476
4477 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 4478
45fa9c0f
GM
4479 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4480 Move BROKEN_SIGIO to configure.
4481
4482 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4483 Move NO_TERMIO to configure.
4484
0e25d334
CY
44852012-06-12 Chong Yidong <cyd@gnu.org>
4486
4487 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4488 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4489 MagickExportImagePixels is undefined.
4490
43682bb6
PE
44912012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4492
4493 * image.c (imagemagick_load_image): Remove unused label.
4494
a9be7d2b
GM
44952012-06-11 Glenn Morris <rgm@gnu.org>
4496
4497 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4498 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4499 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4500 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4501
3017f87f
SM
45022012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4503
4504 * alloc.c (make_byte_code): New function.
4505 (Fmake_byte_code): Use it. Don't purify here.
4506 * lread.c (read1): Use it as well to avoid extra allocation.
4507
1b9b4cf4
CY
45082012-06-11 Chong Yidong <cyd@gnu.org>
4509
4510 * image.c (imagemagick_load_image): Implement transparency.
4511
95988fcf
AS
45122012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4513
4514 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4515 account for preceding backslashes. (Bug#11663)
4516
cd4eb164
CY
45172012-06-09 Chong Yidong <cyd@gnu.org>
4518
4519 * term.c: Support italics in capable terminals (Bug#9652).
4520 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4521 (turn_on_face): Output using TS_enter_italic_mode if available.
4522 Don't handle unused blinking and alt-charset cases.
4523 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4524 and tty_alt_charset_p cases.
4525 (tty_capable_p, init_tty): Support italics.
4526
4527 * termchar.h (struct tty_display_info): Add field for italics.
4528 Remove unused blink field.
4529
4530 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4531 Handle slant.
4532
4533 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4534 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4535 tty_alt_charset_p. Add tty_italic_p.
4536
ff88beb8
MA
45372012-06-09 Michael Albinus <michael.albinus@gmx.de>
4538
4539 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4540 dbus_type_is_basic if available.
4541 (xd_extract_signed, xd_extract_unsigned): Rename from
4542 extract_signed and extract_unsigned, respectively. Adapt callers.
4543
44286096
CY
45442012-06-09 Chong Yidong <cyd@gnu.org>
4545
1682701f
CY
4546 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4547
44286096
CY
4548 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4549 case (Bug#9752).
4550
d86feb17
PE
45512012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4552
4553 * xdisp.c (vmessage): Treat frame message as multibyte.
4554 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4555 would generate the diagnostic "Making \302\247 buffer-local while
4556 let-bound!".
4557
d5c20fe8
EZ
45582012-06-08 Eli Zaretskii <eliz@gnu.org>
4559
4560 * dispnew.c (showing_window_margins_p): Undo last change, which
4561 was done due to an inadvertent commit.
4562 (adjust_frame_glyphs_for_frame_redisplay): Do call
4563 showing_window_margins_p.
4564
513749ee
SM
45652012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4566
4567 * eval.c (Fmake_var_non_special): New primitive.
4568 (syms_of_eval): Defsubr it.
4569 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4570
d4a8f5c1
JB
45712012-06-08 Juanma Barranquero <lekktu@gmail.com>
4572
4573 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4574 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4575
8bbbc977
EZ
45762012-06-08 Eli Zaretskii <eliz@gnu.org>
4577
4578 * alloc.c (allocate_vectorlike): Fix last change.
4579
f3372c87
DA
45802012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4581
4582 Block-based vector allocation of small vectors.
4583 * lisp.h (struct vectorlike_header): New field `nbytes',
4584 adjust comment accordingly.
4585 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4586 to denote vector blocks. Adjust users (live_vector_p,
4587 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4588 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4589 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4590 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4591 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4592 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4593 (roundup_size): New constant.
4594 (struct vector_block): New data type.
4595 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 4596 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
4597 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4598 (sweep_vectors): New functions.
4599 (allocate_vectorlike): Return `zero_vector' as the only vector of
4600 0 items. Allocate new vector from block if vector size is less than
4601 or equal to VBLOCK_BYTES_MAX.
4602 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4603 (init_alloc_once): Add call to init_vectors.
4604
4f18a4ed
SM
46052012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4606
4607 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4608
86f158bc
PE
46092012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4610
4611 * doprnt.c (doprnt): Truncate multibyte char correctly.
4612 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4613 would mishandle a string argument "Xc" if X was a multibyte
4614 character of length 2: it would truncate after X's first byte
4615 rather than including all of X.
4616
c5cfcbe0
CY
46172012-06-06 Chong Yidong <cyd@gnu.org>
4618
4619 * buffer.c (word_wrap): Doc fix.
4620
c05cf390
PE
46212012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4622
4623 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4624
0c3461de
GM
46252012-06-03 Glenn Morris <rgm@gnu.org>
4626
4627 * xdisp.c (tool-bar-style): Doc fix.
4628
c71232db
UM
46292012-06-03 Ulrich Müller <ulm@gentoo.org>
4630
4631 * Makefile.in (PAXCTL): Define.
4632 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4633 binary via PaX flags if the paxctl utility is available.
4634 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4635 Restore PaX flags to their default. (Bug#11398)
4636
383f7350
CY
46372012-06-03 Chong Yidong <cyd@gnu.org>
4638
4639 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4640 buffer (Bug#11226).
4641
5f2c76c6
CY
46422012-06-03 Chong Yidong <cyd@gnu.org>
4643
4644 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4645 (note_mode_line_or_margin_highlight): If there is no help echo,
4646 use mode-line-default-help-echo. Handle the case where the mouse
4647 position is past the end of the mode line string.
4648
4649 * buffer.c (buffer_local_value_1): New function, split from
4650 Fbuffer_local_value; can return Qunbound.
4651 (Fbuffer_local_value): Use it.
4652 (Vmode_line_format): Docstring tweaks.
4653
773d47f6
PE
46542012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4655
4656 * sysdep.c (system_process_attributes): Improve comment.
4657
f2d6a3df
SM
46582012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4659
4660 * keyboard.c: Export real-this-command to Elisp.
4661 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4662 and DEFVAR it. Update all users.
4663
63810350
PE
46642012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4665
7bd5c1f4
PE
4666 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4667
63810350
PE
4668 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4669 Convert pctcpu and pctmem to Lisp float properly.
4670 Let the compiler fold better, as 100.0/0x8000 is exact.
4671
a2821611
AS
46722012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4673
4674 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4675 cons_block.
4676
5fceba1d
PE
46772012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4678
4679 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4680
c98ff5dd
DA
46812012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4682
4683 For a 'struct window', replace some Lisp_Object fields to
4684 bitfields where appropriate, remove unused fields.
4685 * window.h (struct window): Remove unused 'last_mark_x' and
4686 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4687 change it's type from Lisp_Object to bitfield.
4688 Change type of 'force_start', 'optional_new_start',
4689 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4690 fields from Lisp_Object to bitfield. Adjust users accordingly.
4691
ca34e0be
PE
46922012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4693
4694 Pacify gcc -Wdouble-precision when using Xaw.
4695 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4696 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4697 Use 'float' consistently, rather than 'float' in most places
4698 and 'double' in a couple of places.
4699
efc00ab1 47002012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
4701
4702 * xdisp.c (handle_stop): Detect whether we have overlay strings
4703 loaded by testing it->current.overlay_string_index to be
4704 non-negative, instead of checking whether n_overlay_strings is
4705 positive. (Bug#11587)
4706
efc00ab1 47072012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
4708
4709 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4710
4711 * doc.c (Fsubstitute_command_keys): Doc fix.
4712
efc00ab1 47132012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
4714
4715 * search.c (search_buffer): Remove calls to
4716 r_alloc_inhibit_buffer_relocation, as it is now called by
4717 maybe_unify_char, which was the cause of relocation of buffer text
4718 in bug#11519.
4719
efc00ab1 47202012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
4721
4722 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4723 for the duration of call to load_charset, to avoid problems with
4724 callers of maybe_unify_char that access buffer text through C
4725 pointers.
4726
4727 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4728 decrement the inhibition flag, instead of just setting or
4729 resetting it.
4730
ba93a187
PE
47312012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4732
4733 Remove obsolete '#define static' cruft.
4734 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4735 This #undef was "temporary" in 2000; it is no longer needed
4736 now that '#define static' has gone away.
4737 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4738 (gray_bitmap_bits): Remove; no longer needed.
4739 All uses replaced with definiens.
4740 * xterm.c: Include "bitmaps/gray.xbm".
4741
9e4bf381
PE
47422012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4743
4744 Clean up __executable_start, monstartup when --enable-profiling.
4745 The following changes affect the code only when profiling.
4746 * dispnew.c (__executable_start): Rename from safe_bcopy.
4747 Define only on platforms that need it.
4748 * emacs.c: Include <sys/gmon.h> when profiling.
4749 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4750 (__executable_start): Remove decl, since lisp.h does it now.
4751 (safe_bcopy): Remove decl; no longer has that name.
4752 (main): Coalesce #if into single bit of code, for simplicity.
4753 Cast pointers to uintptr_t, since standard libraries want integers
4754 and not pointers.
4755 * lisp.h (__executable_start): New decl.
4756
32d72c2f
GM
47572012-05-31 Glenn Morris <rgm@gnu.org>
4758
4759 * image.c (Fimagemagick_types): Doc fix.
4760
baac5bc7
JM
47612012-05-30 Jim Meyering <meyering@redhat.com>
4762
4763 * callproc.c (Fcall_process_region): Include directory component
4764 in mkstemp error message (Bug#11586).
4765
72cb32cf
PE
47662012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4767
4768 * alloc.c, lisp.h (make_pure_vector): Now static.
4769
61b108cc
SM
47702012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4771
4772 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4773 Move to byte-run.el.
4774 (Fautoload): Do the hash-doc more carefully.
4775 * data.c (Fdefalias): Purify definition, except for keymaps.
4776 (Qdefun): Move from eval.c.
4777 * lisp.h (Qdefun): Remove.
4778 * lread.c (read1): Tiny simplification.
4779
471fe23d
TN
47802012-05-29 Troels Nielsen <bn.troels@gmail.com>
4781
934f3f58 4782 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
4783 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4784 Bug#9642, but explicitly check that the buffer the overlay would
4785 be moved to is live and rearrange lines to make sure that errors
4786 will not put the overlay in an inconsistent state.
4787 (Fdelete_overlay): Cosmetics.
4788
85d0efd1
EZ
47892012-05-28 Eli Zaretskii <eliz@gnu.org>
4790
4791 * w32term.c (my_bring_window_to_top): New function.
4792 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
4793 could be different from the original one.
4794 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
4795 (Bug#11513)
4796
4797 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4798 by calling BringWindowToTop.
4799
4800 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4801 (WM_EMACS_END): Increase by one.
4802
da92a98c
PE
48032012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4804
4805 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4806 This avoids undefined behavior that might cause the eassert
4807 to not catch an out-of-range value.
4808
74d1f848
JB
48092012-05-28 Juanma Barranquero <lekktu@gmail.com>
4810
4811 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4812 Update dependencies.
4813
9e1a06fc
EZ
48142012-05-27 Eli Zaretskii <eliz@gnu.org>
4815
4816 * bidi.c (bidi_mirror_char): Fix last change.
4817
f3dd7312
AS
48182012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4819
4820 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4821 when referring to sectname field in printf format.
4822
81899c91
PE
48232012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4824
57b81a9f
PE
4825 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4826 Only r_alloc_inhibit_buffer_relocation needed to be added;
4827 the others were already declared.
4828
81899c91
PE
4829 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4830 before checking whether it's out of range. Put the check inside
4831 eassert. See
4832 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4833
33017faf 48342012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
4835
4836 * callproc.c (Fcall_process): Restore a line that was accidentally
4837 commented out in the 2011-02-13 change (bug#11547).
4838
33017faf 48392012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
4840
4841 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4842 defined on ralloc.c.
4843
4844 * buffer.c [REL_ALLOC]: Remove prototypes of
4845 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4846 they are now on lisp.h.
4847
4848 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4849
4850 * search.c (search_buffer): Use it to inhibit relocation of buffer
4851 text while re_search_2 is doing its job, because re_search_2 is
4852 passed C pointers to buffer text. (Bug#11519)
4853
23415acf
EZ
4854 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4855 Update value to 24.
4856
44e27368
EZ
4857 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4858 state after an additional call to move_it_in_display_line_to, keep
4859 the values of it->max_ascent and it->max_descent found for the
4860 entire line.
4861 (pos_visible_p): Revert the comparison against bottom_y to what it
4862 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4863 (Bug#11464)
4864
c1892f11
PE
48652012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4866
4867 Fix coding-related core dumps with gcc -ftrapv.
4868 The code was computing A - B, where A and B are pointers, and B is
4869 random garbage. This can lead to core dumps on platforms that
4870 have special pointer registers, and it also leads to core dumps on
4871 x86-64 when compiled with gcc -ftrapv. The fix is to compute
4872 A - B only when B is initialized properly.
4873 * coding.c (coding_set_source, coding_set_destination): Return void.
4874 (coding_change_source, coding_change_destinations): New functions,
4875 with the old behaviors of coding_set_source and coding_set_destination.
4876 All callers that need an offset changed to use these new functions.
4877
eb7afdad
GM
48782012-05-26 Glenn Morris <rgm@gnu.org>
4879
4880 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
4881
f12fdf02
EZ
48822012-05-26 Eli Zaretskii <eliz@gnu.org>
4883
53a63be6 4884 Extend mouse support on W32 text-mode console.
61b108cc
SM
4885 * xdisp.c (draw_row_with_mouse_face):
4886 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 4887
eb3f6f01 4888 * w32console.c: Include window.h.
61b108cc
SM
4889 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4890 New functions.
eb3f6f01
EZ
4891 (initialize_w32_display): Initialize mouse-highlight data.
4892
53a63be6
EZ
4893 * w32inevt.c: Include termchar.h and window.h.
4894 (do_mouse_event): Support mouse-autoselect-window. When the mouse
4895 moves, call note_mouse_highlight. If help_echo changed, call
4896 gen_help_event to produce help-echo message in the echo area.
4897 Call clear_mouse_face if mouse_face_hidden is set in the mouse
4898 highlight info.
4899
4cfd81f6
PE
49002012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4901
4902 * lread.c (read1): Simplify slightly to avoid an overflow warning
4903 with GCC 4.7.0 on x86-64.
4904
4446092a
EZ
49052012-05-26 Eli Zaretskii <eliz@gnu.org>
4906
4907 * bidi.c (bidi_mirror_char): Revert last change: an int is
4908 definitely wide enough here.
4909
42b2a986 49102012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 4911
42b2a986 4912 Fix integer width and related bugs (Bug#9874).
eb106a49 4913 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
4914 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
4915 (string_bytes, check_sblock, allocate_string_data):
4916 (compact_small_strings, Fmake_bool_vector, make_string)
4917 (make_unibyte_string, make_multibyte_string)
4918 (make_string_from_bytes, make_specified_string)
4919 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
4920 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
4921 (mark_vectorlike):
4922 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4923 (allocate_pseudovector):
4924 Use int, not EMACS_INT, where int is wide enough.
4925 (inhibit_garbage_collection, Fgarbage_collect):
4926 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4927 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
4928 int might not be wide enough.
4929 (bidi_cache_search, bidi_cache_find, bidi_init_it)
4930 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
4931 (bidi_at_paragraph_end, bidi_find_paragraph_start)
4932 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
4933 (bidi_level_of_next_char, bidi_move_to_visually_next):
4934 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4935 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
4936 (Fkill_buffer, Fset_buffer_major_mode)
4937 (advance_to_char_boundary, Fbuffer_swap_text)
4938 (Fset_buffer_multibyte, overlays_at, overlays_in)
4939 (overlay_touches_p, struct sortvec, record_overlay_string)
4940 (overlay_strings, recenter_overlay_lists)
4941 (adjust_overlays_for_insert, adjust_overlays_for_delete)
4942 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
4943 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
4944 (Foverlay_recenter, last_overlay_modification_hooks_used)
4945 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
4946 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
4947 (validate_region): Omit unnecessary test for b <= e,
4948 since that's guaranteed by the previous test.
d311d28c
PE
4949 (adjust_overlays_for_delete): Avoid pos + length overflow.
4950 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
4951 (report_overlay_modification):
4952 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4953 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
4954 Omit pointer cast, which isn't needed anyway, and doesn't work
4955 after the EMACS_INT -> ptrdiff_t change.
02481186 4956 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
4957 * buffer.h: Adjust decls to match defn changes elsewhere.
4958 (struct buffer_text, struct buffer):
4959 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4960 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
4961 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
4962 not int, to avoid needless 32-bit limit on 64-bit hosts.
4963 (exec_byte_code): Use tighter memory-full test, one that checks
4964 for alloca overflow. Don't compute the address of the object just
4965 before an array, as that's not portable. Use EMACS_INT, not
4966 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
4967 * callint.c (Fcall_interactively):
4968 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4969 * callproc.c (call_process_kill, Fcall_process):
4970 Don't assume pid_t fits into an Emacs fixnum.
4971 (call_process_cleanup, Fcall_process, child_setup):
4972 Don't assume pid_t fits into int.
4973 (call_process_cleanup, Fcall_process, delete_temp_file)
4974 (Fcall_process_region):
4975 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
4976 (Fcall_process): Simplify handling of volatile integers.
4977 Use int, not EMACS_INT, where int will do.
4978 * casefiddle.c (casify_object, casify_region, operate_on_word)
4979 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
4980 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4981 (casify_object): Avoid integer overflow when overallocating buffer.
4982 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 4983 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
4984 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
4985 * category.h (CATEGORYP): Don't assume arg is nonnegative.
4986 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
4987 integers are now checked earlier. All uses replaced with XINT.
4988 (ccl_driver):
4989 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
4990 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
4991 (ccl_driver, Fregister_code_conversion_map):
4992 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
4993 (resolve_symbol_ccl_program): Check that vector header is in range.
4994 Always copy the vector, so that we can check its contents reliably
4995 now rather than having to recheck each instruction as it's being
4996 executed. Check that vector words fit in 'int'.
4997 (ccl_get_compiled_code, Fregister_ccl_program)
4998 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
4999 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5000 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5001 contents are in range.
5002 (Fccl_execute_on_string): Check that status is in range.
5003 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5004 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5005 Accept and return EMACS_INT, not int, because callers can pass values
5006 out of 'int' range.
5007 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5008 (multibyte_chars_in_text, parse_str_as_multibyte)
5009 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5010 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5011 (string_escape_byte8, Fget_byte):
5012 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 5013 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
5014 avoid mishandling large integers.
5015 * character.h: Adjust decls to match defn changes elsewhere.
5016 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5017 (Ffind_charset_region):
5018 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5019 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5020 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 5021 Don't assume fixnum fits in int.
d311d28c
PE
5022 (load_charset_map_from_vector, Fmap_charset_chars):
5023 Remove now-unnecessary CHECK_NATNUMs.
5024 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
5025 Don't rely on undefined behavior with signed left shift overflow.
5026 Don't assume unsigned int fits into fixnum, or that fixnum fits
5027 into unsigned int. Don't require max_code to be a valid fixnum;
5028 that's not true for gb10830 4-byte on a 32-bit host. Allow
5029 invalid_code to be a cons, for the same reason. Require code_offset
5030 to be a character. Avoid int overflow if max_char is close
5031 to INT_MAX.
5032 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5033 this is intended anyway and avoids some undefined behavior.
5034 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5035 INDEX_TO_CODE_POINT, as that's what it expects.
5036 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
5037 * charset.h (DECODE_CHAR): Return int, not unsigned;
5038 this is what was intended anyway, and it avoids undefined behavior.
5039 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5040 integer-overflow issues.
5041 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5042 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5043 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
5044 * chartab.c (Fmake_char_table, Fset_char_table_range)
5045 (uniprop_get_decoder, uniprop_get_encoder):
5046 Don't assume fixnum fits in int.
5047 * cmds.c (move_point): New function, that does the gist of
5048 Fforward_char and Fbackward_char, but does so while checking
5049 for integer overflow more accurately.
c96e5d6a 5050 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
5051 (Fforward_line, Fend_of_line, internal_self_insert)
5052 (internal_self_insert):
5053 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5054 Fix a FIXME, by checking for integer overflow when calculating
5055 target_clm and actual_clm.
5056 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 5057 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
5058 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5059 (coding_alloc_by_making_gap, alloc_destination)
5060 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5061 (encode_coding_utf_16, detect_coding_emacs_mule)
5062 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5063 (detect_coding_iso_2022, decode_coding_iso_2022)
5064 (encode_invocation_designation, encode_designation_at_bol)
5065 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5066 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5067 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5068 (encode_coding_ccl, encode_coding_raw_text)
5069 (detect_coding_charset, decode_coding_charset)
5070 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5071 (produce_composition, produce_charset, produce_annotation)
5072 (decode_coding, handle_composition_annotation)
5073 (handle_charset_annotation, consume_chars, decode_coding_gap)
5074 (decode_coding_object, encode_coding_object, detect_coding_system)
5075 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5076 (code_convert_region, code_convert_string)
8f50130c
PE
5077 (Fdefine_coding_system_internal)
5078 (coding_set_source, coding_set_destination):
d311d28c
PE
5079 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5080 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5081 (Fdefine_coding_system_internal):
5082 Don't assume fixnums fit in int.
5083 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 5084 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
5085 (Funencodable_char_position, Fcheck_coding_systems_region)
5086 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 5087 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 5088 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 5089 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 5090 Don't access memory outside of the args array.
d311d28c 5091 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
5092 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5093 result of ENCODE_CHAR.
d311d28c
PE
5094 * coding.h: Adjust decls to match defn changes elsewhere.
5095 (struct coding_system):
5096 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5097 * composite.c (get_composition_id, find_composition)
5098 (run_composition_function, update_compositions)
5099 (compose_text, composition_gstring_put_cache)
5100 (composition_gstring_p, composition_gstring_width)
5101 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5102 (composition_compute_stop_pos, composition_reseat_it)
5103 (composition_update_it, struct position_record)
5104 (find_automatic_composition, composition_adjust_point)
5105 (Fcomposition_get_gstring, Ffind_composition_internal):
5106 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5107 (update_compositions):
5108 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5109 * composite.h: Adjust decls to match defn changes elsewhere.
5110 (struct composition):
5111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5112 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5113 Do not attempt to compute the address of the object just before a
5114 buffer; this is not portable.
5115 (Faref, Faset):
5116 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5117 (Faset): Use int, not EMACS_INT, where int is wide enough.
5118 (Fstring_to_number): Don't assume fixnums fit in int.
5119 (Frem): Don't assume arg is nonnegative.
5120 * dbusbind.c (xd_append_arg): Check for integers out of range.
5121 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 5122 (extract_signed, extract_unsigned): New functions.
243e0530
PE
5123 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5124 (xd_get_connection_references): Return ptrdiff_t, not int.
5125 All uses changed.
5126 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5127 (xd_read_message_1):
5128 Use int, not unsigned, where the dbus API uses int.
5129 (Fdbus_message_internal): Don't overflow mtype.
5130 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
5131 * dired.c (directory_files_internal, file_name_completion, scmp)
5132 (file_name_completion_stat):
5133 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5134 (file_name_completion): Don't overflow matchcount.
5135 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5136 * dispextern.h: Adjust decls to match defn changes elsewhere.
5137 (struct text_pos, struct glyph, struct bidi_saved_info)
5138 (struct bidi_string_data, struct bidi_it, struct composition_it)
5139 (struct it):
5140 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5141 (struct display_pos, struct composition_it, struct it):
5142 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5143 * dispnew.c (increment_matrix_positions)
5144 (increment_row_positions, mode_line_string)
5145 (marginal_area_string):
5146 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 5147 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
5148 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5149 (duration_to_sec_usec): New function, to check for overflow better.
5150 (Fsleep_for, sit_for): Use it.
5151 * doc.c (get_doc_string, store_function_docstring):
5152 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5153 (get_doc_string, Fsnarf_documentation):
5154 Use int, not EMACS_INT, where int is wide enough.
5155 (get_doc_string):
5156 Use SAFE_ALLOCA, not alloca.
5157 Check for overflow when converting EMACS_INT to off_t.
5158 * doprnt.c (doprnt):
5159 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5160 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5161 Don't assume uid_t fits into fixnum.
5162 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5163 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5164 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5165 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5166 (general_insert_function)
5167 (Finsert_char, make_buffer_string, make_buffer_string_both)
5168 (update_buffer_properties, Fbuffer_substring)
5169 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5170 (Fsubst_char_in_region, check_translation)
5171 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5172 (transpose_markers, Ftranspose_regions):
5173 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5174 (clip_to_bounds): Move to lisp.h as an inline function).
5175 (Fconstrain_to_field): Don't assume integers are nonnegative.
5176 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5177 (Fsubst_char_in_region, Fsave_restriction):
5178 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5179 (Femacs_pid): Don't assume pid_t fits into fixnum.
5180 (lo_time): Use int, not EMACS_INT, when int suffices.
5181 (lisp_time_argument): Check for usec out of range.
5182 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
5183 (Fuser_login_name, Fuser_full_name): Signal an error
5184 if a uid argument is out of range, rather than relying on
5185 undefined behavior.
c8d5c857
PE
5186 (Fformat_time_string): Remove now-unnecessary check.
5187 lisp_time_argument checks for out-of-range usec now.
243e0530 5188 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
5189 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5190 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5191 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5192 (init_cmdargs, Fdump_emacs):
5193 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5194 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5195 the bottom (typically) 32 bits of the fixnum.
5196 * eval.c (specpdl_size, call_debugger):
5197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5198 (when_entered_debugger, Fbacktrace_debug):
5199 Don't assume fixnum can fit in int.
5200 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5201 the object just before a buffer; this is not portable.
5202 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5203 (grow_specpdl, unbind_to):
5204 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5205 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5206 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 5207 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
5208 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5209 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5210 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5211 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5212 (a_write, e_write):
5213 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5214 (Fcopy_file, non_regular_nbytes, read_non_regular)
5215 (Finsert_file_contents):
5216 Use int, not EMACS_INT, where int is wide enough.
5217 (READ_BUF_SIZE): Verify that it fits in int.
5218 (Finsert_file_contents): Check that counts are in proper range,
5219 rather than assuming fixnums fit into ptrdiff_t etc.
5220 Don't assume fixnums fit into int.
125b3835 5221 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
5222 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5223 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
5224 (string_char_to_byte, string_byte_to_char)
5225 (string_make_multibyte, string_to_multibyte)
5226 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5227 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5228 (substring_both, Fdelete, internal_equal, Ffillarray)
5229 (Fclear_string, mapcar1)
5230 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5231 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5232 (larger_vector, make_hash_table, maybe_resize_hash_table)
5233 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5234 (Fmaphash, secure_hash):
5235 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5236 (concat): Check for string index and length overflow.
5237 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5238 (Frequire):
5239 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5240 (larger_vector): New API (vec, incr_min, size_max) replaces old
5241 one (vec, new_size, init). This catches size overflow.
5242 INIT was removed because it was always Qnil.
5243 All callers changed.
5244 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5245 the upper bound on a hash table index size.
5246 (make_hash_table, maybe_resize_hash_table): Use it.
5247 (secure_hash): Computer start_byte and end_byte only after
5248 they're known to be in ptrdiff_t range.
5249 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5250 (Ffont_get_glyphs, Ffont_at):
5251 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5252 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5253 (Flist_fonts, Fopen_font):
5254 Don't assume fixnum can fit in int.
5255 (check_gstring): Don't assume index can fit in int.
5256 (font_match_p): Check that fixnum is a character, not a nonnegative
5257 fixnum, since the later code needs to stuff it into an int.
5258 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5259 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5260 conversion overflow issues.
5261 (Fopen_font): Check for integer out of range.
5262 (Ffont_get_glyphs): Don't assume index can fit in int.
5263 * font.h: Adjust decls to match defn changes elsewhere.
5264 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5265 integer overflow.
5266 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5267 printmax_t, where ptrdiff_t is wide enough.
5268 (Finternal_char_font):
5269 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5270 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5271 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5272 (Fset_frame_position, x_set_frame_parameters)
5273 (x_set_line_spacing, x_set_border_width)
5274 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5275 Check that fixnums are in proper range for system types.
5276 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5277 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5278 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5279 Use SAFE_ALLOCA_LISP, not alloca.
5280 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5281 intptr_t is wide enough.
5282 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5283 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5284 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5285 Check for fixnum out of range.
5286 * ftfont.c (ftfont_list): Don't assume index fits in int.
5287 Check that fixnums are in proper range for system types.
5288 (ftfont_shape_by_flt):
5289 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
5290 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5291 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5292 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5293 Check that fixnums are in proper range for system types.
5294 * gnutls.h: Adjust decls to match defn changes elsewhere.
5295 * gtkutil.c (xg_dialog_run):
5296 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5297 (update_frame_tool_bar):
5298 Check that fixnums are in proper range for system types.
5299 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 5300 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
5301 * indent.c (last_known_column, last_known_column_point):
5302 (current_column_bol_cache):
5303 (skip_invisible, current_column, check_display_width):
5304 (check_display_width, scan_for_column, current_column_1)
5305 (Findent_to, Fcurrent_indentation, position_indentation)
5306 (indented_beyond_p, Fmove_to_column, compute_motion):
5307 (Fcompute_motion, Fvertical_motion):
5308 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5309 (last_known_column_modified): Use EMACS_INT, not int.
5310 (check_display_width):
5311 (Fcompute_motion):
5312 Check that fixnums and floats are in proper range for system types.
5313 (compute_motion): Don't assume index or fixnum fits in int.
5314 (compute_motion, Fcompute_motion):
5315 Use int, not EMACS_INT, when it is wide enough.
5316 (vmotion): Omit local var start_hpos that is always 0; that way
5317 we don't need to worry about overflow in expressions involving it.
5318 * indent.h: Adjust decls to match defn changes elsewhere.
5319 (struct position):
5320 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5321 Use int, not EMACS_INT, where int is wide enough.
5322 Remove unused members ovstring_chars_done and tab_offset;
5323 all uses removed.
5324 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5325 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5326 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5327 (make_gap, copy_text, insert, insert_and_inherit)
5328 (insert_before_markers, insert_before_markers_and_inherit)
5329 (insert_1, count_combining_before, count_combining_after)
5330 (insert_1_both, insert_from_string)
5331 (insert_from_string_before_markers, insert_from_string_1)
5332 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5333 (adjust_after_replace, adjust_after_insert, replace_range)
5334 (replace_range_2, del_range, del_range_1, del_range_byte)
5335 (del_range_both, del_range_2, modify_region)
5336 (prepare_to_modify_buffer, signal_before_change)
5337 (signal_after_change, Fcombine_after_change_execute):
5338 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5339 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5340 (balance_an_interval, split_interval_right, split_interval_left)
5341 (find_interval, next_interval, update_interval)
5342 (adjust_intervals_for_insertion, delete_node, delete_interval)
5343 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5344 (static_offset_intervals, offset_intervals)
5345 (merge_interval_right, merge_interval_left, make_new_interval)
5346 (graft_intervals_into_buffer, temp_set_point_both)
5347 (temp_set_point, set_point, adjust_for_invis_intang)
5348 (set_point_both, move_if_not_intangible, get_property_and_range)
5349 (get_local_map, copy_intervals, copy_intervals_to_string)
5350 (compare_string_intervals, set_intervals_multibyte_1):
5351 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5352 * intervals.h: Adjust decls to match defn changes elsewhere.
5353 (struct interval):
5354 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5355 * keyboard.c (this_command_key_count, this_single_command_key_start)
5356 (before_command_key_count, before_command_echo_length, echo_now)
5357 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5358 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5359 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5360 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5361 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5362 (last_non_minibuf_size, last_point_position, echo_truncate)
5363 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5364 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5365 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5366 (stuff_buffered_input):
5367 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5368 (last_auto_save, command_loop_1, read_char):
5369 Use EMACS_INT, not int, to avoid integer overflow.
5370 (record_char): Avoid overflow in total_keys computation.
5371 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5372 * keyboard.h: Adjust decls to match defn changes elsewhere.
5373 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5374 (Fkey_description, Fdescribe_vector, Flookup_key):
5375 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5376 (click_position): New function, to check that positions are in range.
5377 (Fcurrent_active_maps):
5378 (describe_command):
5379 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5380 (Faccessible_keymaps, Fkey_description):
5381 (preferred_sequence_p):
5382 Don't assume fixnum can fit into int.
5383 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5384 Check for integer overflow in size calculations.
5385 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5386 avoid mishandling large integers.
5387 * lisp.h: Adjust decls to match defn changes elsewhere.
5388 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5389 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5390 (struct Lisp_Marker):
5391 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5392 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
5393 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5394 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5395 All callers changed.
5396 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5397 Assume the arg has valid form, since it always does.
5398 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5399 unsigned integer system type.
5400 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5401 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5402 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5403 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5404 (duration_to_sec_usec): New decl.
5405 * lread.c (read_from_string_index, read_from_string_index_byte)
5406 (read_from_string_limit, readchar, unreadchar, openp)
5407 (read_internal_start, read1, oblookup):
5408 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5409 (Fload, readevalloop, Feval_buffer, Feval_region):
5410 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5411 (openp): Check for out-of-range argument to 'access'.
5412 (read1): Use int, not EMACS_INT, where int is wide enough.
5413 Don't assume fixnum fits into int.
6efdadfd 5414 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
5415 (read_filtered_event): Use duration_to_sec_usec
5416 to do proper overflow checking on durations.
d311d28c
PE
5417 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5418 in size calculation.
5419 (Fexecute_kbd_macro):
5420 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5421 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5422 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5423 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5424 (set_marker_both, set_marker_restricted_both, marker_position)
5425 (marker_byte_position, Fbuffer_has_markers_at):
5426 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5427 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 5428 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
5429 It now merely ensures that the menu is large enough, without
5430 necessarily growing it, as this avoids some integer overflow issues.
5431 All callers changed.
5432 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5433 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5434 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5435 Use SAFE_ALLOCA_LISP, not alloca.
5436 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5437 to EMACS_INT. Check that fixnums are in proper range for system types.
5438 * minibuf.c (minibuf_prompt_width, string_to_object)
5439 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5440 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5441 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5442 (get_minibuffer, read_minibuf_unwind):
5443 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5444 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5445 this simplifies overflow checking. All callers changed.
5446 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5447 (Ftest_completion):
5448 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5449 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5450 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5451 Check that fixnums are in proper range for system types.
5452 (Fx_create_frame, Fx_show_tip):
5453 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5454 * nsfont.m (ns_findfonts, nsfont_list_family):
5455 Don't assume fixnum fits in long.
5456 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5457 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5458 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5459 wide enough.
17fdb222 5460 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
5461 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5462 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5463 (PRINTDECLARE, PRINTPREPARE):
5464 (strout, print_string):
5465 (print, print_preprocess, print_check_string_charset_prop)
5466 (print_object):
5467 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5468 (PRINTDECLARE):
5469 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5470 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5471 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 5472 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 5473 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
5474 (print_error_message): Use SAFE_ALLOCA, not alloca.
5475 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
5476 (print_depth, new_backquote_output, print_number_index):
5477 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
5478 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5479 (Fset_process_window_size, Fformat_network_address)
5480 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 5481 (sigchld_handler):
d311d28c 5482 Check that fixnums are in proper range for system types.
d44287d4 5483 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
5484 Check for process-ids out of pid_t range rather than relying on
5485 undefined behavior.
e4d81efc 5486 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
5487 (Fformat_network_address, read_process_output, send_process)
5488 (Fprocess_send_region, status_notify):
5489 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5490 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5491 (wait_reading_process_output, read_process_output, exec_sentinel):
5492 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5493 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5494 (Faccept_process_output): Use duration_to_sec_usec to do proper
5495 overflow checking on durations.
dde14581
PE
5496 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5497 Don't assume pid_t fits in int.
02481186
PE
5498 * process.h (struct Lisp_Process): Members tick and update_tick
5499 are now of type EMACS_INT, not int.
b62b53e8
PE
5500 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5501 configured --with-wide-int.
d311d28c
PE
5502 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5503 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5504 * search.c (looking_at_1, string_match_1):
5505 (fast_string_match, fast_c_string_match_ignore_case)
5506 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5507 (scan_newline, find_before_next_newline, search_command)
5508 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5509 (set_search_regs, wordify):
5510 (Freplace_match):
5511 (Fmatch_data):
5512 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5513 (string_match_1, search_buffer, set_search_regs):
5514 (Fmatch_data):
5515 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5516 (wordify): Check for overflow in size calculation.
5517 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5518 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5519 Check that fixnums are in proper range for system types.
5520 * sound.c (struct sound_device)
5521 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5522 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5523 (Fplay_sound_internal):
5524 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 5525 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
5526 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5527 (Fparse_partial_sexp):
5528 Don't assume fixnums can fit in int.
5529 (struct lisp_parse_state, find_start_pos, find_start_value)
5530 (find_start_value_byte, find_start_begv)
5531 (update_syntax_table, char_quoted, dec_bytepos)
5532 (find_defun_start, prev_char_comend_first, back_comment):
5533 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5534 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5535 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5536 (Finternal_describe_syntax_value): Check that match_lisp is a
5537 character, not an integer, since the code stuffs it into int.
5538 (scan_words, scan_sexps_forward):
5539 Check that fixnums are in proper range for system types.
5540 (Fforward_word):
5541 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5542 (scan_sexps_forward):
5543 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5544 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5545 * syntax.h: Adjust decls to match defn changes elsewhere.
5546 (struct gl_state_s):
5547 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
5548 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5549 MOST_POSITIVE_FIXNUM.
d311d28c
PE
5550 * sysdep.c (wait_for_termination_1, wait_for_termination)
5551 (interruptible_wait_for_termination, mkdir):
5552 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5553 (emacs_read, emacs_write):
5554 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
5555 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5556 and double all fit in int.
d311d28c
PE
5557 * term.c (set_tty_color_mode):
5558 Check that fixnums are in proper range for system types.
5559 * termhooks.h (struct input_event):
5560 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5561 * textprop.c (validate_interval_range, interval_of)
5562 (Fadd_text_properties, set_text_properties_1)
5563 (Fremove_text_properties, Fremove_list_of_text_properties)
5564 (Ftext_property_any, Ftext_property_not_all)
5565 (copy_text_properties, text_property_list, extend_property_ranges)
5566 (verify_interval_modification):
5567 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5568 (Fnext_single_char_property_change)
5569 (Fprevious_single_char_property_change):
5570 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
5571 (copy_text_properties):
5572 Check for integer overflow in index calculation.
d311d28c
PE
5573 * undo.c (last_boundary_position, record_point, record_insert)
5574 (record_delete, record_marker_adjustment, record_change)
5575 (record_property_change):
5576 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5577 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5578 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5579 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5580 (Fx_hide_tip, Fx_file_dialog):
5581 * w32menu.c (set_frame_menubar):
5582 Use ptrdiff_t, not int, for consistency with rest of code.
5583 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5584 (select_window, Fdelete_other_windows_internal)
5585 (window_scroll_pixel_based, window_scroll_line_based)
5586 (Frecenter, Fset_window_configuration):
5587 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5588 (Fset_window_hscroll, run_window_configuration_change_hook)
5589 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 5590 (Fscroll_other_window, Frecenter):
d311d28c
PE
5591 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5592 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5593 Don't assume fixnum fits in int.
5594 (Fset_window_scroll_bars):
5595 Check that fixnums are in proper range for system types.
5596 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5597 (string_pos, c_string_pos, number_of_chars, init_iterator)
5598 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5599 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5600 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
5601 (face_before_or_after_it_pos, handle_invisible_prop)
5602 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
5603 (display_prop_intangible_p, string_buffer_position_lim)
5604 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5605 (get_overlay_strings_1, get_overlay_strings)
5606 (iterate_out_of_display_property, forward_to_next_line_start)
5607 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5608 (get_next_display_element, set_iterator_to_next)
5609 (get_visually_first_element, compute_stop_pos_backwards)
5610 (handle_stop_backwards, next_element_from_buffer)
5611 (move_it_in_display_line_to, move_it_in_display_line)
5612 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5613 (add_to_log, message_dolog, message_log_check_duplicate)
5614 (message2, message2_nolog, message3, message3_nolog
5615 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5616 (current_message_1, truncate_echo_area, truncate_message_1)
5617 (set_message, set_message_1, store_mode_line_noprop)
5618 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5619 (text_outside_line_unchanged_p, check_point_in_composition)
5620 (reconsider_clip_changes)
5621 (redisplay_internal, set_cursor_from_row, try_scrolling)
5622 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5623 (redisplay_window, find_last_unchanged_at_beg_row)
5624 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5625 (trailing_whitespace_p, find_row_edges, display_line)
5626 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5627 (display_mode_element, store_mode_line_string)
5628 (pint2str, pint2hrstr, decode_mode_spec)
5629 (display_count_lines, display_string, draw_glyphs)
5630 (x_produce_glyphs, x_insert_glyphs)
5631 (rows_from_pos_range, mouse_face_from_buffer_pos)
5632 (fast_find_string_pos, mouse_face_from_string_pos)
5633 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5634 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5635 (safe_call, init_from_display_pos, handle_fontified_prop)
5636 (handle_single_display_spec, load_overlay_strings)
5637 (with_echo_area_buffer, setup_echo_area_for_printing)
5638 (display_echo_area, echo_area_display)
5639 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5640 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
5641 (redisplay_window, dump_glyph_row, display_mode_line)
5642 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 5643 (handle_display_spec, display_prop_string_p):
d311d28c
PE
5644 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5645 (handle_single_display_spec, build_desired_tool_bar_string)
5646 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5647 (get_specified_cursor_type):
5648 Check that fixnums are in proper range for system types.
5649 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5650 (Flookup_image_map):
5651 Don't assume fixnums fit in int.
5652 (compare_overlay_entries):
5653 Avoid mishandling comparisons due to subtraction overflow.
5654 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5655 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5656 (handle_tool_bar_click):
5657 Use int, not unsigned, since we prefer signed and the signedness
5658 doesn't matter here.
5659 (get_next_display_element, next_element_from_display_vector):
5660 Use int, not EMACS_INT, when int is wide enough.
5661 (start_hourglass): Use duration_to_sec_usec to do proper
5662 overflow checking on durations.
5663 * xfaces.c (Fbitmap_spec_p):
5664 Check that fixnums are in proper range for system types.
5665 (compare_fonts_by_sort_order):
5666 Avoid mishandling comparisons due to subtraction overflow.
5667 (Fx_family_fonts, realize_basic_faces):
5668 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5669 (Fx_family_fonts):
5670 Don't assume fixnum fits in int.
5671 Use SAFE_ALLOCA_LISP, not alloca.
5672 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5673 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5674 (face_at_buffer_position, face_for_overlay_string)
5675 (face_at_string_position):
5676 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5677 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5678 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5679 (Fx_show_tip):
5680 Check that fixnums are in proper range for system types.
5681 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5682 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5683 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5684 (Fx_change_window_property): Don't assume fixnums fit in int.
5685 * xfont.c (xfont_chars_supported):
5686 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5687 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5688 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5689 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5690 * xml.c (parse_region):
5691 * xrdb.c (magic_file_p):
5692 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5693 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5694 (x_get_local_selection, x_reply_selection_request)
5695 (x_handle_selection_request, wait_for_property_change):
5696 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5697 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5698 short is wide enough.
5699 (x_send_client_event): Don't assume fixnum fits in int.
5700 * xterm.c (x_x_to_emacs_modifiers):
5701 Don't assume EMACS_INT overflows nicely into int.
5702 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5703 may come from Lisp.
5704 (handle_one_xevent): NATNUMP can eval its arg twice.
5705 (x_connection_closed):
5706 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5707 * xterm.h: Adjust decls to match defn changes elsewhere.
5708 (struct scroll_bar): Use struct vectorlike_header
5709 rather than rolling our own approximation.
5710 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5711
c6574eb5
GM
57122012-05-25 Glenn Morris <rgm@gnu.org>
5713
5714 * lisp.mk (lisp): Update for more files being compiled now.
5715
e8d32c7e
SM
57162012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5717
48def666
SM
5718 * lread.c: Remove `read_pure' which makes no difference.
5719 (read_pure): Remove var.
5720 (unreadpure): Remove function.
5721 (readevalloop): Don't call read_list with -1 flag.
5722 (read1, read_vector): Don't test read_pure any more.
5723 (read_list): Simplify.
5724
e8d32c7e
SM
5725 * fileio.c, character.h: Minor style tweaks.
5726
4b2addb7
DA
57272012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5728
5729 * window.h (clip_changed): Remove useless declaration.
5730
584461b2
JB
57312012-05-22 Juanma Barranquero <lekktu@gmail.com>
5732
5733 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5734 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5735
34374650
PE
57362012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5737
5738 Remove src/m/*.
5739 This directory predates autoconf and is no longer needed nowadays.
5740 Move its few remaining bits of functionality to where they're needed.
5741 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5742 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5743 * m/template.h: Remove.
5744 * Makefile.in (M_FILE): Remove. All uses removed.
5745 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5746 * lisp.h (USE_LSB_TAG):
5747 * mem-limits.h (EXCEEDS_LISP_PTR):
5748 Use VAL_MAX, not VALBITS, in #if.
5749 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5750 (EMACS_UINT): Define unconditionally now.
5751 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5752 (BITS_PER_EMACS_INT): New constants, replacing
5753 what used to be in config.h, but not useful in #if.
5754 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5755 define them any more.
5756 (VAL_MAX): New macro.
5757 (VALMASK): Use it.
5758 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5759 BITS_PER_EMACS_INT, in #if.
5760 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5761 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5762 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5763 * s/ms-w32.h (DATA_START):
5764 Move here from removed file m/intel386.h.
5765 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5766 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5767
261cb4bb
PE
57682012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5769
5770 Assume C89 or later.
5771 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5772 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5773 (xrealloc):
5774 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5775 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5776 * textprop.c, tparam.c (NULL): Remove.
5777 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5778 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5779 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5780 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5781 * xterm.c (input_signal_count): Assume volatile works.
5782
ff23cd9f
KB
57832012-05-21 Ken Brown <kbrown@cornell.edu>
5784
5785 * xgselect.c (xg_select): Fix first argument in call to 'select'
5786 (bug#11508).
5787
1b170bc6
KB
57882012-05-20 Ken Brown <kbrown@cornell.edu>
5789
5790 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 5791 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 5792
b2f4d39f
KB
57932012-05-19 Ken Brown <kbrown@cornell.edu>
5794
5795 * xfns.c (x_in_use): Remove `static' qualifier.
5796 * xterm.h (x_in_use): Declare.
5797 * xgselect.c: Include xterm.h.
5798 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5799 and `display_arg' (bug#9754).
5800
003fdae2
PE
58012012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5802
9232a6d9
PE
5803 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5804
003fdae2
PE
5805 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5806 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5807
784b56e2
EZ
58082012-05-18 Eli Zaretskii <eliz@gnu.org>
5809
5810 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5811
5812 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 5813 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
5814
5815 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5816 reference to image_cache->refcount.
5817 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5818
a0a79cde
JL
58192012-05-17 Juri Linkov <juri@jurta.org>
5820
5821 * search.c (Fword_search_regexp, Fword_search_backward)
5822 (Fword_search_forward, Fword_search_backward_lax)
5823 (Fword_search_forward_lax): Move functions to isearch.el
5824 (bug#10145, bug#11381).
5825
b0572523
PE
58262012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5827
5828 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5829
9660f5fc
SM
58302012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5831
5832 * lread.c (init_obarray): Declare Qt and Qnil as special.
5833
4374de83
GM
58342012-05-14 Glenn Morris <rgm@gnu.org>
5835
5836 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 5837 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 5838
dc44c39a
PE
58392012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5840
078c97cb
PE
5841 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5842
dc44c39a
PE
5843 * unexaix.c: Port to more-recent AIX compilers.
5844 (report_error, report_error_1, make_hdr, copy_sym)
5845 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5846 Make arguments const char *, not char *, to avoid violations of C
5847 standard and to fix some AIX warnings reported by Gilles Pion.
5848
e18afed7 58492012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
5850
5851 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5852 already have overlays loaded.
5853 (handle_single_display_spec): Before returning without displaying
5854 fringe bitmap, synchronize the bidi iterator with the main display
5855 iterator, by calling iterate_out_of_display_property.
5856 (iterate_out_of_display_property): Detect buffer iteration by
5857 testing that it->string is a Lisp string.
5858 (get_next_display_element): When the current object is exhausted,
5859 and there's something on it->stack, call set_iterator_to_next to
5860 proceed with what's on the stack, instead of returning zero.
5861 (set_iterator_to_next): If called at the end of a Lisp string,
5862 proceed to consider_string_end without incrementing string
5863 position. Don't increment display vector index past the end of
5864 the display vector. (Bug#11417)
c8fb9dc6
EZ
5865 (pos_visible_p): Don't report a position visible when move_it_to
5866 stopped at the last line of window, which happens to be scanned
5867 backwards by the bidi iteration. (Bug#11464)
ac268e67 5868
e18afed7 58692012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
5870
5871 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5872 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
5873 are on a TTY, and thus unable to display on the fringes.
5874 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
5875 so we need to signal to the caller that this is a "replacing"
5876 display spec. This fixes display when the spec is invalid or we
5877 are on a TTY.
5878
e18afed7 58792012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
5880
5881 * unexaix.c (make_hdr): Fix typo in prototype.
5882 This bug broke the build on AIX. Problem reported by Gilles Pion.
5883
9d0a235a
MA
58842012-05-14 Michael Albinus <michael.albinus@gmx.de>
5885
5886 * keyboard.c (kbd_buffer_get_event): Read special events also in
5887 batch mode. (Bug#11415)
5888
9e6b06ed
GM
58892012-05-12 Glenn Morris <rgm@gnu.org>
5890
5891 * ns.mk: Update for ns_appbindir no longer having trailing "/".
5892
c1a1d7a3
EZ
58932012-05-12 Eli Zaretskii <eliz@gnu.org>
5894
5895 * lisp.mk (lisp): Add newcomment.elc.
5896
3fe7cdc8
GM
58972012-05-12 Glenn Morris <rgm@gnu.org>
5898
5899 * Makefile.in (MKDIR_P): New, set by configure.
5900 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
5901
53f7d2c0
PE
59022012-05-11 Paul Eggert <eggert@cs.ucla.edu>
5903
5904 Remove unused function hourglass_started.
5905 * dispextern.h (hourglass_started):
5906 * w32fns.c (hourglass_started):
5907 * xdisp.c (hourglass_started): Remove.
5908
75aafb17
JB
59092012-05-10 Juanma Barranquero <lekktu@gmail.com>
5910
5911 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
5912 Update dependencies.
5913
12959e8e
PE
59142012-05-10 Paul Eggert <eggert@cs.ucla.edu>
5915
97107e2e
PE
5916 * xgselect.c (xg_select): Put maxfds+1 into a var.
5917 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
5918
12959e8e
PE
5919 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
5920
836d29b3
DA
59212012-05-10 Dave Abrahams <dave@boostpro.com>
5922
5923 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
5924 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
5925
5cb67954
MA
59262012-05-09 Michael Albinus <michael.albinus@gmx.de>
5927
5928 * dbusbind.c (xd_registered_buses): New internal Lisp object.
5929 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
5930 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
5931 Initialize xd_registered_buses.
5932
3478ec45
PE
59332012-05-09 Paul Eggert <eggert@cs.ucla.edu>
5934
b263a6b0
PE
5935 Untag more efficiently if USE_LSB_TAG.
5936 This is based on a proposal by YAMAMOTO Mitsuharu in
5937 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
5938 For an admittedly artificial (nth 8000 longlist) benchmark on
5939 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
5940 Emacs's overall text size by 1%.
5941 * lisp.h (XUNTAG): New macro.
5942 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
5943 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
5944 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
5945 * eval.c (Fautoload):
5946 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
5947 * frame.h (XFRAME): Use XUNTAG.
5948
3478ec45
PE
5949 Port recent dbusbind.c changes to 32-bit --with-wide-int.
5950 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
5951 Remove unportable assumptions about print widths of types like
5952 dbus_uint32_t.
5953 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
5954 intptr_t when converting between pointer and integer, to avoid GCC
5955 warnings about wrong width.
5956
666b903b 59572012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
5958
5959 * w32proc.c (new_child): Force Windows to reserve only 64KB of
5960 stack for each reader_thread, instead of defaulting to 8MB
5961 determined by the linker. This avoids failures in creating
5962 subprocesses on Windows 7, see the discussion in this thread:
5963 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
5964
b120cc17
JC
59652012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
5966
5967 Fix up display of the *Minibuf-0* buffer in the mini window.
5968 * keyboard.c (read_char): Don't clear the echo area if there's no
5969 message to clear.
5970 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 5971 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 5972
9a4b36f8
MA
59732012-05-07 Michael Albinus <michael.albinus@gmx.de>
5974
5975 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
5976 batch mode.
5977
e5f9458f
CY
59782012-05-06 Chong Yidong <cyd@gnu.org>
5979
5980 * lisp.mk (lisp): Update.
5981
eceeb5fc 59822012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
5983
5984 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
5985
71873e2b
SM
59862012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
5987
5988 * data.c (PUT_ERROR): New macro.
5989 (syms_of_data): Use it. Add new error type `user-error'.
5990 * undo.c (user_error): New function.
5991 (Fprimitive_undo): Use it.
5992 * print.c (print_error_message): Adjust print style for `user-error'.
5993 * keyboard.c (user_error): New function.
5994 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
5995
ab0fa4e4
PE
59962012-05-03 Paul Eggert <eggert@cs.ucla.edu>
5997
5998 Do not limit current-time-string to years 1000..9999.
5999 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6000 (Fcurrent_time_string): Support any year that is supported by the
6001 underlying localtime representation. Don't use asctime, as it
6002 has undefined behavior for years outside the range -999..9999.
6003
7ed806a7
PE
60042012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6005
6006 Fix race conditions involving setenv, gmtime, localtime, asctime.
6007 Without this fix, interrupts could mess up code that uses these
6008 nonreentrant functions, since setting TZ invalidates existing
6009 tm_zone or tzname values, and since most of these functions return
6010 pointers to static storage.
6011 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6012 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6013 Grow the critical sections to include not just invoking
6014 localtime/gmtime, but also accessing these functions' results
6015 including their tm_zone values if any, and any related TZ setting.
6016 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
6017 so that the struct tm is saved in the critical section.
6018 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
6019 motivated by the fact that memory allocation needs to be outside
6020 the critical section.
6021
0c16dfed
DA
60222012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6023
6024 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6025 with RESET_INTERVAL.
6026
6027 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6028 Remove duplicated buffer name initialization.
6029
3f83ace8
JM
60302012-05-02 Jim Meyering <jim@meyering.net>
6031
6032 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6033
c7b8541e
JM
6034 * xfns.c (x_window): Use xstrdup (Bug#11375).
6035
90207a15 60362012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
6037
6038 * xdisp.c (pos_visible_p): If already at a newline from the
6039 display string before the 'while' loop, don't walk back the glyphs
6040 from it3.glyph_row. Solves assertion violation when the display
6041 string begins with a newline (egg.el). (Bug#11367)
6042
b593d6a9
AH
60432012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6044
6045 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6046 Move to simple.el.
6047
4737362e
GM
60482012-05-01 Glenn Morris <rgm@gnu.org>
6049
99cf43f9
GM
6050 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6051 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6052 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6053 All were removed before 23.1.
6054
9311dcff
GM
6055 * dispnew.c: Remove HAVE_LIBNCURSES test;
6056 it is always true on relevant platforms.
6057
4d5c6349
GM
6058 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6059 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6060
4737362e
GM
6061 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6062
74dd3a6b
AS
60632012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6064
6065 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6066 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6067 Remove.
6068
13c379ee
PE
60692012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6070
6071 Do not avoid creating empty evaporating overlays (Bug#9642).
6072 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6073 That is, do not delete an evaporating overlay if it becomes
6074 empty after its bounds are adjusted to fit within its buffer.
6075 This fix caused other problems, and I'm reverting it until we get
6076 to the bottom of them.
6077
a8e7d6d7 60782012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
6079
6080 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6081
a8e7d6d7 60822012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
6083
6084 * xdisp.c (pos_visible_p): If the window start position is beyond
6085 ZV, start the display from buffer beginning. Prevents assertion
6086 violation in init_iterator when the minibuffer window is scrolled
6087 via the scroll bar.
6088
6089 * window.c (window_scroll_pixel_based): Likewise.
6090
a8e7d6d7 60912012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
6092
6093 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6094
a8e7d6d7 60952012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
6096
6097 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6098 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6099
a8e7d6d7 61002012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 6101
b593d6a9
AH
6102 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6103 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 6104
1c6900d9
EZ
61052012-04-26 Eli Zaretskii <eliz@gnu.org>
6106
4c3fa1d9
EZ
6107 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6108 display element, check also the underlying string or buffer
6109 character. (Bug#11341)
6110
1c6900d9
EZ
6111 * w32menu.c: Include w32heap.h.
6112 (add_menu_item): If the call to AppendMenuW (via
6113 unicode_append_menu) fails, disable Unicode menus only if we are
6114 running on Windows 9X/Me.
6115
42bf8205
AS
61162012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6117
6118 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6119 (xgetint): Add missing shift for LSB tags.
6120
b1bac16e
MR
61212012-04-24 Martin Rudalics <rudalics@gmx.at>
6122
6123 * keyboard.c (read_char): Don't wipe echo area for select window
6124 events: These might get delayed via `mouse-autoselect-window'
6125 (Bug#11304).
6126
d69621cc
JB
61272012-04-24 Juanma Barranquero <lekktu@gmail.com>
6128
6129 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6130 manipulation of :loaded-from data.
6131
02fd101b
JB
61322012-04-23 Juanma Barranquero <lekktu@gmail.com>
6133
6134 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6135 now a cons (bug#11311).
6136
888bec30
PE
61372012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6138
89a438bd
PE
6139 Do not create empty overlays with the evaporate property (Bug#9642).
6140 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6141 if it becomes empty after its bounds are adjusted to fit within
6142 its buffer. Without this fix, in a nonempty buffer (let ((o
6143 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6144 yields an empty overlay that has the evaporate property, which is
6145 not supposed to happen.
6146
1068fe4d
PE
6147 Fix minor GTK3 problems found by static checking.
6148 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6149 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6150 (struct _EmacsFixedClass, emacs_fixed_get_type):
6151 Move decls here from emacsgtkfixed.h, since they needn't be public.
6152 (emacs_fixed_get_type): Now static.
6153 (emacs_fixed_class_init): Omit unused local.
6154 (emacs_fixed_child_type): Remove; unused.
6155 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6156 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6157 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6158 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6159 (EMACS_FIXED_GET_CLASS): Remove; unused.
6160 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6161
888bec30
PE
6162 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6163 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6164
de85e130
PE
61652012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6166
d0baac98 6167 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 6168 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
6169 (__malloc_size_t, __malloc_ptrdiff_t):
6170 Remove. All uses removed, replaced by the definiens if needed,
6171 since we can assume C89 or better now.
6172 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6173 (protect_malloc_state, align, get_contiguous_space)
6174 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6175 (malloc_atfork_handler_child, malloc_enable_thread)
6176 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6177 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6178 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6179 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6180 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6181 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6182 Define using prototypes, not old style.
6183 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6184 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6185 (align): Don't assume that signed integer overflow wraps around.
6186 Omit unused local var.
6187 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6188 (_free_internal_nolock, memalign, mallochook, reallochook):
6189 Omit no-longer-needed casts.
6190 (valloc): Use getpagesize, not __getpagesize.
6191 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6192 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6193
de85e130
PE
6194 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6195
dcbf5805
MA
61962012-04-22 Michael Albinus <michael.albinus@gmx.de>
6197
6198 Move functions from C to Lisp. Make non-blocking method calls
6199 the default. Implement further D-Bus standard interfaces.
6200
6201 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6202 (QCdbus_request_name_allow_replacement)
6203 (QCdbus_request_name_replace_existing)
6204 (QCdbus_request_name_do_not_queue)
6205 (QCdbus_request_name_reply_primary_owner)
6206 (QCdbus_request_name_reply_in_queue)
6207 (QCdbus_request_name_reply_exists)
6208 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6209 (QCdbus_registered_serial, QCdbus_registered_method)
6210 (QCdbus_registered_signal): New Lisp objects.
6211 (XD_DEBUG_MESSAGE): Use sizeof.
6212 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6213 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6214 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6215 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6216 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6217 (xd_signature, xd_append_arg): Allow float for integer types.
6218 (xd_get_connection_references): New function.
b593d6a9
AH
6219 (xd_get_connection_address): Rename from xd_initialize.
6220 Return cached address.
dcbf5805
MA
6221 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6222 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6223 level.
6224 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 6225 Return number of refcounts.
dcbf5805
MA
6226 (Fdbus_get_unique_name): Make stronger parameter check.
6227 (Fdbus_message_internal): New defun.
6228 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6229 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6230 (Fdbus_send_signal, Fdbus_register_service)
6231 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6232 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6233 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6234 (Vdbus_compiled_version, Vdbus_runtime_version)
6235 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6236 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6237 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
6238 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6239 Adapt docstring.
dcbf5805 6240
52828e02
PE
62412012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6242
da05bc4c
PE
6243 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6244 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6245 Do not assume ptrdiff_t is the same width as 'int'.
6246
52828e02
PE
6247 * alloc.c: Handle unusual debugging option combinations.
6248 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6249 since the two debugging options are incompatible.
6250 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6251 is defined.
6252 (mem_init, mem_insert, mem_insert_fixup):
6253 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6254 (NEED_MEM_INSERT): Remove; no longer needed.
6255
f01769f9
LL
62562012-04-22 Leo Liu <sdl.web@gmail.com>
6257
6258 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6259
5790543d
PE
62602012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6261
6262 * sysdep.c [__FreeBSD__]: Minor cleanups.
6263 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6264 Use Emacs indenting style more consistently. Avoid some casts.
6265 Use 'double' consistently rather than mixing 'float' and 'double'.
6266
b91b7e4d
EW
62672012-04-21 Eduard Wiebe <usenet@pusto.de>
6268
b593d6a9
AH
6269 * sysdep.c (list_system_processes, system_process_attributes):
6270 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 6271
6114eb15
AS
62722012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6273
6274 * lisp.mk (lisp): Update.
6275
2f38dff7
PE
62762012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6277
6278 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6279 It is never used otherwise.
6280
4ae29f89
SM
62812012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6282
6283 * print.c (print_preprocess): Only check print_depth if print-circle
6284 is nil.
6285 (print_object): Check for cycles even when print-circle is nil and
6286 print-gensym is t, but only check print_depth if print-circle is nil.
6287
f30d612a
CY
62882012-04-20 Chong Yidong <cyd@gnu.org>
6289
6290 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6291 set the status to "failed" and ensure that sentinel is run.
6292
c07a4c0b 62932012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
6294
6295 * process.c (Fset_process_inherit_coding_system_flag)
6296 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 6297 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 6298
c07a4c0b 62992012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
6300
6301 * xdisp.c (string_buffer_position_lim): Limit starting position to
6302 BEGV.
6303 (set_cursor_from_row): If called for a mode-line or header-line
6304 row, return zero immediately.
6305 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
6306 farther than the first row after the header line, if any.
6307 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
6308 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6309
c07a4c0b 63102012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6311
4ae29f89
SM
6312 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6313 (bug#11238).
ad3a2b41 6314
c07a4c0b 63152012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 63162012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
6317
6318 configure: new option --enable-gcc-warnings (Bug#11207)
6319 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6320 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6321 (ALL_CFLAGS): Use new macros rather than old.
6322 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6323 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6324 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6325 -Wunused-result, -Wunused-variable. This should go away once
6326 the Emacs and Gnulib regex code is merged.
6327 (xmalloc, xrealloc): Now static.
6328
aba027e8
PE
63292012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6330
6331 * dired.c (Fsystem_groups): Remove unused local.
6332
e5a36063
GM
63332012-04-17 Glenn Morris <rgm@gnu.org>
6334
6335 * dired.c (Fsystem_users): Doc fix.
6336
316411f0
DA
63372012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6338
6339 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6340 (syms_of_dired): Add them.
6341
9426aba4
PE
63422012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6343
b62a57be
PE
6344 Fix minor alloc.c problems found by static checking.
6345 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6346 New extern decls, to avoid calling undeclared functions.
6347 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6348 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6349 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6350 (NEED_MEM_INSERT): New macro.
6351 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 6352 Remove one incorrect comment and fix another.
b62a57be 6353
3539f31f
PE
6354 Fix minor ralloc.c problems found by static checking.
6355 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6356 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6357 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6358 (r_alloc_sbrk): Now static.
6359
a041960a
PE
6360 Improve ralloc.c interface checking.
6361 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6362 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6363 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6364 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6365 [REL_ALLOC]: ... to here, to check interface.
6366 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6367 Remove decls. This fixes an "It stinks!".
6368
9426aba4
PE
6369 * alloc.c (which_symbols): Fix alignment issue / type clash.
6370
d55c12ed
AS
63712012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6372
6373 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6374 (struct Lisp_Misc_Any): Likewise.
6375 (struct Lisp_Free): Likewise.
6376 * alloc.c (union aligned_Lisp_Symbol): Define.
6377 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6378 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6379 (union aligned_Lisp_Misc): Define.
6380 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6381 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 6382 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 6383
b948ce8b
PE
63842012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6385
6386 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6387 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6388 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6389 * s/netbsd.h, s/sol2-6.h:
6390 Remove definition of GC_MARK_STACK, since the default now works.
6391 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6392 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6393 no longer the default.
6394 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6395
35dc09a1 63962012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6397
35dc09a1
GM
6398 * lread.c (lisp_file_lexically_bound_p):
6399 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 6400
35dc09a1
GM
64012012-04-14 Eli Zaretskii <eliz@gnu.org>
6402
6403 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6404 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6405
64062012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6407
6408 * nsterm.m (constrainFrameRect): Always constrain when there is only
6409 one screen (Bug#10962).
6410
bcd86815
KB
64112012-04-13 Ken Brown <kbrown@cornell.edu>
6412
6413 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6414
c25df26e
RT
64152012-04-13 Reuben Thomas <rrt@sc3d.org>
6416
6417 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6418
0fc59f1e
DC
64192012-04-11 Daniel Colascione <dancol@dancol.org>
6420
6421 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6422 against is gone. It's better to use vfork now so that when Cygwin
6423 gains a new, working vfork, we use it automatically (bug#10398).
6424
de8c03dc
SM
64252012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6426
6427 * window.c (save_window_save): Obey window-point-insertion-type.
6428
2f097256
GM
64292012-04-11 Glenn Morris <rgm@gnu.org>
6430
6431 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6432
453b951e
SM
64332012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6434
6435 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6436
75f1671a 64372012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
6438
6439 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6440 (force_quit_count): New var.
6441 (handle_interrupt): Use it.
6442
2a8ce227
JB
64432012-04-10 Juanma Barranquero <lekktu@gmail.com>
6444
6445 * w32.c (w32_delayed_load): Record the full path of the library
6446 being loaded (bug#10424).
6447
935396c0
GM
64482012-04-09 Glenn Morris <rgm@gnu.org>
6449
05920a43
GM
6450 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6451 not just in the obarray, before snarfing them. (Bug#11036)
6452
935396c0
GM
6453 * Makefile.in ($(leimdir)/leim-list.el):
6454 Pass EMACS rather than BUILT_EMACS.
6455
a18ecafa
TZ
64562012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6457
6458 * process.c (make_process):
6459 * process.h: Add integer `gnutls_handshakes_tried' member to
6460 process struct.
6461
6bbef4e5
JC
6462 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6463 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
6464
6465 * gnutls.c (gnutls_log_function2i): Convenience log function.
6466 (emacs_gnutls_read): Use new log functions,
6467 `gnutls_handshakes_tried' process member, and
6468 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6469 attempts per process (connection).
6470
b4d3bc10
CY
64712012-04-09 Chong Yidong <cyd@gnu.org>
6472
6473 * eval.c (Fuser_variable_p, user_variable_p_eh)
6474 (lisp_indirect_variable): Functions deleted.
6475 (Fdefvar): Caller changed.
6476
6477 * callint.c (Finteractive, Fcall_interactively):
6478 * minibuf.c (Fread_variable): Callers changed.
6479
70f4d973
EZ
64802012-04-09 Eli Zaretskii <eliz@gnu.org>
6481
6482 * xdisp.c (set_cursor_from_row): If the display string appears in
6483 the buffer at position that is closer to point than the position
6484 after the display string, display the cursor on the first glyph of
6485 the display string. Fixes cursor display when a 'display' text
6486 property immediately follows invisible text. (Bug#11094)
6487
cb3c2e3e
PE
64882012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6489
6490 composite.c: use 'double' consistently
6491 * composite.c (get_composition_id): Use 'double' consistently
6492 instead of converting 'float' to 'double' and vice versa; this is
6493 easier to understand and avoids a GCC warning.
6494
fd06db5d
GM
64952012-04-09 Glenn Morris <rgm@gnu.org>
6496
50fe702a
GM
6497 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6498 preparation for dumping it with emacs. (Bug#4789)
6499 (leimdir): New variable.
6500 ($(leimdir)/leim-list.el): New rule.
6501 (emacs$(EXEEXT)): Depend on leim-list.el.
6502
fd06db5d
GM
6503 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6504 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6505 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6506
55c131ee
AS
65072012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6508
6509 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6510 proper alignment.
6511
9209588f
JB
65122012-04-07 Juanma Barranquero <lekktu@gmail.com>
6513
6514 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6515 Remove unused local variable.
6516
e3fb2efb
PE
65172012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6518
6519 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6520 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6521 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6522 objects, as mark_maybe_pointer will catch them otherwise.
6523 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6524 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6525
b5385551
PE
65262012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6527
6528 Fix typo that broke non-Windows builds.
6529 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6530
9078ead6
EZ
65312012-04-07 Eli Zaretskii <eliz@gnu.org>
6532
6533 Support building on MS-Windows with libxml2.
6534
6535 * makefile.w32-in (OBJ2): Add xml.$(O).
6536 (GLOBAL_SOURCES): Add xml.c.
6537 ($(BLD)/xml.$(O)): New dependency list.
6538
6539 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6540 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6541 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6542 [!WINDOWSNT]: New macros.
6543 (init_libxml2_functions, libxml2_loaded_p): New functions.
6544 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6545 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6546 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6547 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6548 linked in).
6bbef4e5
JC
6549 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6550 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
6551 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6552
6553 * emacs.c: Don't include libxml/parser.h.
6554 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6555 xmlCleanupParser directly.
6556
6557 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6558
3811fdf3
EZ
65592012-04-07 Eli Zaretskii <eliz@gnu.org>
6560
6561 * indent.c (Fvertical_motion): If there is a display string at
6562 point, use it.vpos to compute how many lines to backtrack after
6563 move_it_to point. (Bug#11133)
6564
2f8e16b2
EZ
65652012-04-06 Eli Zaretskii <eliz@gnu.org>
6566
6567 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6568 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6569 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6570 macros related to unification of CJK characters. For the details,
6571 see the discussion following the message here:
6572 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6573
3d439cd1
CY
65742012-04-04 Chong Yidong <cyd@gnu.org>
6575
6576 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6577
8bc53d00
EZ
65782012-04-01 Eli Zaretskii <eliz@gnu.org>
6579
6580 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6581 instead of alloca. (Bug#11138)
6582
3b0512a3
AS
65832012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6584
6585 * w32menu.c (is_simple_dialog): Properly check lisp types.
6586 (Bug#11141)
6587
8427ddd2
EZ
65882012-03-31 Eli Zaretskii <eliz@gnu.org>
6589
979022ef
EZ
6590 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6591 position we get to after a call to move_it_to fails the
6592 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6593 only if we wind up in a string from display property. (Bug#11063)
6594
a6b1c7cc
EZ
6595 * window.c (Fdelete_other_windows_internal): Invalidate the row
6596 and column information about mouse highlight, so that redisplay
6597 restores it after reallocating the glyph matrices. (Bug#7464)
6598
8427ddd2
EZ
6599 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6600 string comes from a `display' text property, use the buffer
6601 position of that property as if we actually saw that position in
6602 the row's glyphs.
697ba24b
EZ
6603 (move_it_by_lines): Remove the assertion that
6604 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6605 violated when there's a before-string at the beginning of a line.
6606 (Bug#11063)
8427ddd2 6607
65a0a738
EZ
66082012-03-30 Eli Zaretskii <eliz@gnu.org>
6609
6610 * xdisp.c (append_space_for_newline): If the default face was
6611 remapped, use the remapped face for the appended newline.
6612 (extend_face_to_end_of_line): Use the remapped default face for
6613 extending the face to the end of the line.
6614 (display_line): Call extend_face_to_end_of_line when the default
6615 face was remapped. (Bug#11068)
6616
581355cc
EZ
66172012-03-29 Eli Zaretskii <eliz@gnu.org>
6618
6619 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6620
e8fc049f
SM
66212012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6622
6623 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6624
4fb9a543
GM
66252012-03-27 Glenn Morris <rgm@gnu.org>
6626
6627 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6628 Doc fixes.
6629
679910f1
KH
66302012-03-26 Kenichi Handa <handa@m17n.org>
6631
6632 * dispextern.h (struct glyph): Fix previous change. Change the
6633 bit length of glyphless.ch to 25 (Bug#11082).
6634
90d49b7f
CY
66352012-03-26 Chong Yidong <cyd@gnu.org>
6636
6637 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6638 (command_loop_1): Use it; inhibit selection update for
6639 handle-select-window too (Bug#8996).
6640
f514f6f0
FP
66412012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6642
e8fc049f 6643 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 6644
bf43fa51
KH
66452012-03-25 Kenichi Handa <handa@m17n.org>
6646
6647 * dispextern.h (struct glyph): Change the bit length of
6648 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6649
8a0c01dd
EZ
66502012-03-24 Eli Zaretskii <eliz@gnu.org>
6651
6652 * s/ms-w32.h (tzname): Include time.h before redirecting to
6653 _tzname. Fixes the MSVC build. (Bug#9960)
6654
7d1c3a76
AS
66552012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6656
8ed79523
AS
6657 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6658 characters.
6659
7d1c3a76
AS
6660 * xterm.c (XTread_socket): Only modify handling_signal if
6661 !SYNC_INPUT. (Bug#11080)
6662
e99a9b8b
EZ
66632012-03-23 Eli Zaretskii <eliz@gnu.org>
6664
6665 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6666 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6667 when fetching a multibyte character consumes more bytes than
6668 CHAR_BYTES returns, due to unification of CJK characters in
6669 string_char. (Bug#11073)
6670
5063c0e1
TN
66712012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6672
6673 * process.c (wait_reading_process_output): Handle pty disconnect
6674 by refraining from sending oneself a SIGCHLD (bug#10933).
6675
9f851fbd
CY
66762012-03-22 Chong Yidong <cyd@gnu.org>
6677
6678 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6679
5063c0e1 6680 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
6681 Mark string as coming from a prefix property.
6682 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6683 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6684
fb5b8aca
CY
66852012-03-21 Chong Yidong <cyd@gnu.org>
6686
6687 * xfaces.c (Vface_remapping_alist): Doc fix.
6688
62356a1b
EZ
66892012-03-20 Eli Zaretskii <eliz@gnu.org>
6690
6691 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
6692 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6693 Doc fixes.
62356a1b 6694
025de85b
CY
66952012-03-20 Chong Yidong <cyd@gnu.org>
6696
6697 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6698 to reflect default non-nil value of redisplay-dont-pause.
6699
4827f94e
KH
67002012-03-19 Kenichi Handa <handa@m17n.org>
6701
6702 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6703 it fit in a valid range (Bug#11003).
6704
e50a24a2
EZ
67052012-03-18 Eli Zaretskii <eliz@gnu.org>
6706
6707 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6708 that is not from display property, accept the row as a "cursor
6709 row" if one of the string's character has a non-nil `cursor'
6710 property. Fixes cursor positioning when there are newlines in
6711 overlay strings, e.g. in icomplete.el. (Bug#11035)
6712
9af5ed87
PE
67132012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6714
6715 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6716
d1f55f16
CY
67172012-03-12 Chong Yidong <cyd@gnu.org>
6718
6719 * eval.c (inhibit_lisp_code): Rename from
6720 inhibit_window_configuration_change_hook; move from window.c.
6721
6722 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6723 * window.c (run_window_configuration_change_hook)
6724 (syms_of_window): Callers changed.
6725
66c5eebd
CY
67262012-03-11 Chong Yidong <cyd@gnu.org>
6727
413df973
CY
6728 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6729
66c5eebd
CY
6730 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6731
1de11f56
CY
67322012-03-10 Chong Yidong <cyd@gnu.org>
6733
6734 * frame.c (other_visible_frames): Don't assume the selected frame
6735 is visible (Bug#10955).
6736
cae07000
SM
67372012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6738
6739 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6740
89c94350
JD
67412012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6742
6743 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6744 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6745 zero (Bug#10954).
6746
999dd333
GM
67472012-03-03 Glenn Morris <rgm@gnu.org>
6748
01a6dcc8 6749 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 6750
de0100f2
EZ
67512012-03-02 Eli Zaretskii <eliz@gnu.org>
6752
6753 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6754 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
6755 (redisplay_window, next_element_from_string): Fix typos in
6756 comments.
3e441275
EZ
6757 (redisplay_window): Pass to move_it_vertically the margin in
6758 pixels, not in screen lines.
de0100f2 6759
96a72ee9
GM
67602012-03-02 Glenn Morris <rgm@gnu.org>
6761
6762 * buffer.c (buffer-list-update-hook): Doc fix.
6763
312508d7
EZ
67642012-02-29 Eli Zaretskii <eliz@gnu.org>
6765
6766 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6767 push_it before setting up the iterator for the first overlay
6768 string, even if we have an empty string loaded.
6769 (next_overlay_string): If there's an empty string on the iterator
6770 stack, pop the stack. (Bug#10903)
6771
27f3c637
PE
67722012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6773
6774 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6775 Suggested by Stefan Monnier in
6776 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6777 * alloc.c (widen_to_Lisp_Object): New static function.
6778 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6779 and widening them to Lisp_Objects. This would work even if
6780 USE_LSB_TAG is defined and wide integers are used, which might
6781 happen in a future version of Emacs.
6782
3c9dfce6
CY
67832012-02-25 Chong Yidong <cyd@gnu.org>
6784
fa74b241
CY
6785 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6786 Doc fix.
6787
3c9dfce6
CY
6788 * xselect.c (Fx_selection_exists_p): Doc fix.
6789 (x_clipboard_manager_save_all): Print an informative message
6790 before saving to clipboard manager.
6791
9486df08
CY
67922012-02-24 Chong Yidong <cyd@gnu.org>
6793
6794 * keyboard.c (process_special_events): Handle all X selection
6795 requests in kbd_buffer, not just the next one (Bug#8869).
6796
f01d3321
CY
67972012-02-23 Chong Yidong <cyd@gnu.org>
6798
6799 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6800 call when setting menu-bar-lines and tool-bar-lines parameters.
6801 (unwind_create_frame_1): New helper function.
6802
6803 * window.c (inhibit_window_configuration_change_hook): New var.
6804 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 6805 (syms_of_window): Initialize it.
f01d3321 6806
86b847b6
CY
68072012-02-22 Chong Yidong <cyd@gnu.org>
6808
6809 * xterm.c (x_draw_image_relief): Add missing type check for
6810 Vtool_bar_button_margin (Bug#10743).
6811
a59225b1
CY
68122012-02-21 Chong Yidong <cyd@gnu.org>
6813
6814 * fileio.c (Vfile_name_handler_alist): Doc fix.
6815
6816 * buffer.c (Fget_file_buffer): Protect against invalid file
6817 handler return value.
6818
310f5bd4
PE
68192012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6820
cb3a28cc
PE
6821 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6822 when computing $valmask.
6823
310f5bd4
PE
6824 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6825 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6826 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6827 It's useless in that case, and it can cause problems on hosts
6828 that allocate halves of EMACS_INT values separately.
6829 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6830 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6831 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6832 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6833 it avoids undefined behavior on hosts where shifting right by more
6834 than the word width has undefined behavior.
6835
2375c96a
CY
68362012-02-19 Chong Yidong <cyd@gnu.org>
6837
6838 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6839 (Funhandled_file_name_directory, Ffile_name_as_directory)
6840 (Fdirectory_file_name, Fexpand_file_name)
6841 (Fsubstitute_in_file_name): Protect against invalid file handler
6842 return values (Bug#10845).
6843
3eb49e71
EZ
68442012-02-18 Eli Zaretskii <eliz@gnu.org>
6845
6846 * .gdbinit (pitx): Fix incorrect references to fields of the
6847 iterator stack.
6848
7b926f3f
CY
68492012-02-17 Chong Yidong <cyd@gnu.org>
6850
6851 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6852
11273115
PE
68532012-02-15 Paul Eggert <eggert@cs.ucla.edu>
6854
6855 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6856 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6857
c3a70e2b
CY
68582012-02-15 Chong Yidong <cyd@gnu.org>
6859
6860 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6861 marked as special. Also, starting docstrings with * is obsolete.
6862
0ca43699
AS
68632012-02-13 Andreas Schwab <schwab@linux-m68k.org>
6864
6865 * gnutls.c (emacs_gnutls_write): Fix last change.
6866
2e8f3c56
LI
68672012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
6868
6869 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6870 send_process.
6871
af70074f
SM
68722012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
6873
6874 * keymap.c (Fsingle_key_description): Handle char ranges.
6875
95986d52
CY
68762012-02-12 Chong Yidong <cyd@gnu.org>
6877
afd83bd1
CY
6878 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6879 as that creates a dangerous corner case.
6880
95986d52
CY
6881 * window.c (Fdelete_window_internal): Invalidate the mouse
6882 highlight (Bug#9904).
6883
bd7da63e
GM
68842012-02-12 Glenn Morris <rgm@gnu.org>
6885
6886 * xselect.c (Fx_own_selection_internal)
6887 (Fx_get_selection_internal, Fx_disown_selection_internal)
6888 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6889 * nsselect.m (Fx_own_selection_internal)
6890 (Fx_disown_selection_internal, Fx_selection_exists_p)
6891 (Fx_selection_owner_p, Fx_get_selection_internal):
6892 Sync docs and argument specs with the xselect.c versions.
6893
77abcbc2
LI
68942012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
6895
6896 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6897
90b671e2
EZ
68982012-02-11 Eli Zaretskii <eliz@gnu.org>
6899
1c0ca0b7
EZ
6900 * w32select.c (Fx_selection_exists_p): Sync doc string and
6901 argument list with xselect.c. (Bug#10783)
6902
6903 * w16select.c (Fx_selection_exists_p): Sync doc string and
6904 argument list with xselect.c. (Bug#10783)
90b671e2 6905
49241268
GM
69062012-02-10 Glenn Morris <rgm@gnu.org>
6907
6908 * fns.c (Fsecure_hash): Doc fix.
6909
f998bbe7 69102012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
6911
6912 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
6913
0992bd9c
CY
69142012-02-07 Chong Yidong <cyd@gnu.org>
6915
6916 * buffer.c (Fbuffer_local_variables)
6917 (buffer_lisp_local_variables): Handle unbound vars correctly;
6918 don't let Qunbound leak into Lisp.
6919
af008560
GM
69202012-02-07 Glenn Morris <rgm@gnu.org>
6921
dd605cc4
GM
6922 * image.c (Fimagemagick_types): Doc fix.
6923
af008560
GM
6924 * image.c (imagemagick-render-type): Change it from a lisp object
6925 to an integer. Move the doc here from the lisp manual.
6926 Treat all values not equal to 0 the same.
6927
1449fa1d
CY
69282012-02-06 Chong Yidong <cyd@gnu.org>
6929
6930 * doc.c (store_function_docstring): Avoid applying docstring of
6931 alias to base function (Bug#2603).
6932
3723ec07
AS
69332012-02-04 Andreas Schwab <schwab@linux-m68k.org>
6934
6935 * .gdbinit (pp1, pv1): Remove redundant defines.
6936 (pr): Use pp.
6937
79c1cc1e
CY
69382012-02-04 Chong Yidong <cyd@gnu.org>
6939
6940 * nsterm.m: Declare a global (Bug#10694).
6941
d7f29f8e
EZ
69422012-02-04 Eli Zaretskii <eliz@gnu.org>
6943
cae07000
SM
6944 * w32.c (get_emacs_configuration_options):
6945 Include --enable-checking, if specified, in the return value.
d7f29f8e 6946
3b95a6f9
MR
69472012-02-04 Martin Rudalics <rudalics@gmx.at>
6948
6949 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
6950 after rounding frame sizes. (Bug#9723)
6951
d6fa96a6
EZ
69522012-02-04 Eli Zaretskii <eliz@gnu.org>
6953
6954 * keyboard.c (adjust_point_for_property): Don't position point
6955 before BEGV. (Bug#10696)
6956
df0b2940
PE
69572012-02-03 Paul Eggert <eggert@cs.ucla.edu>
6958
6959 Handle overflow when computing char display width (Bug#9496).
6960 * character.c (char_width): Return EMACS_INT, not int.
6961 (char_width, c_string_width): Check for overflow when
6962 computing the width; this is possible now that individual
6963 characters can have unbounded width. Problem introduced
6964 by merge from Emacs 23 on 2012-01-19.
6965
6bee44d6
MA
69662012-02-02 Michael Albinus <michael.albinus@gmx.de>
6967
6968 * dbusbind.c (Fdbus_register_method): Mention the return value
6969 :ignore in the docstring.
6970
44f92739
GM
69712012-02-02 Glenn Morris <rgm@gnu.org>
6972
1b9f60cc
GM
6973 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
6974
44f92739
GM
6975 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6976 Unconditionally set to t. (Bug#10673)
6977 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
6978 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
6979 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
6980
c5d3843c
KH
69812012-02-02 Kenichi Handa <handa@m17n.org>
6982
6983 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
6984 0, do not call append_composite_glyph.
6985
159462d4 69862012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
6987
6988 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
6989 NULL (Bug#6988).
6990 (x_produce_glyphs): If the component of a composition is a null
6991 string, set it->pixel_width to 1 to avoid zero-width glyph.
6992
78cef877
EZ
69932012-02-01 Eli Zaretskii <eliz@gnu.org>
6994
6995 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
6996 first 2 arguments are identical. This makes inserting large
6997 output from a subprocess an order of magnitude faster on
6998 MS-Windows, where all sbrk'ed memory is always contiguous.
6999
97897668
GM
70002012-01-31 Glenn Morris <rgm@gnu.org>
7001
7002 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 7003 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
7004 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7005
31fd3586
GM
70062012-01-29 Glenn Morris <rgm@gnu.org>
7007
7008 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7009
0e24a8b2
CY
70102012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7011
7012 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7013
cc0adcb0
CY
70142012-01-28 Chong Yidong <cyd@gnu.org>
7015
7016 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7017
acc28cb9
CY
70182012-01-26 Chong Yidong <cyd@gnu.org>
7019
9c69cfb7
CY
7020 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7021
acc28cb9
CY
7022 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7023 repeat counts (Bug#10507).
7024
48da7392
GM
70252012-01-26 Glenn Morris <rgm@gnu.org>
7026
7027 * lread.c (syms_of_lread): Doc fix.
7028
14af5f7f
CY
70292012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7030
7031 * coding.c (encode_designation_at_bol): Change return value to
7032 EMACS_INT.
7033
0b21c100
CY
70342012-01-25 Chong Yidong <cyd@gnu.org>
7035
7036 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7037
3c2907f7
CY
70382012-01-21 Chong Yidong <cyd@gnu.org>
7039
7040 * floatfns.c (Fcopysign): Make the second argument non-optional,
7041 since nil is not allowed anyway.
7042
959ad23f
AS
70432012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7044
7045 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7046 (send_process): Likewise.
7047
34a02f46
MR
70482012-01-19 Martin Rudalics <rudalics@gmx.at>
7049
7050 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
7051 (Vwindow_persistent_parameters): Do not use Qstate.
7052 Rewrite doc-strings.
34a02f46 7053
1259009a 70542012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
7055
7056 * character.c (char_width): New function.
70d4fdf6
GM
7057 (Fchar_width, c_string_width, lisp_string_width):
7058 Use char_width (Bug#9496).
25ed9e61 7059
6a6ee00d
MR
70602012-01-16 Martin Rudalics <rudalics@gmx.at>
7061
7062 * window.c (Vwindow_persistent_parameters): New variable.
7063 (Fset_window_configuration, save_window_save): Handle persistent
7064 window parameters.
7065
c85efaf7
EZ
70662012-01-14 Eli Zaretskii <eliz@gnu.org>
7067
7068 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7069 thrashing the stack of the thread. (Bug#9087)
7070
5944709e
PE
70712012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7072
7073 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7074
e71f5d99
EZ
70752012-01-11 Eli Zaretskii <eliz@gnu.org>
7076
7077 * xdisp.c (rows_from_pos_range): Handle the case where the
7078 highlight ends on a newline. (Bug#10464)
7079 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7080 he end column for display of highlight that ends on a newline
7081 before a R2L line.
7082
ce316182
GM
70832012-01-11 Glenn Morris <rgm@gnu.org>
7084
7085 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7086 from load-path also when installation-directory is nil. (Bug#10208)
7087
5b43da69
GM
70882012-01-10 Glenn Morris <rgm@gnu.org>
7089
74cc8ff9
GM
7090 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7091
7d8d6e4e
GM
7092 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7093 Update template values to be closer to their typical values these days.
5b43da69 7094
a0db8d43
EZ
70952012-01-09 Eli Zaretskii <eliz@gnu.org>
7096
7097 * xdisp.c (rows_from_pos_range): Accept additional argument
7098 DISP_STRING, and accept any glyph in a row whose object is that
7099 string as eligible for mouse highlight. Fixes mouse highlight of
7100 display strings from overlays. (Bug#10464)
7101
9a0115ab 71022012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 7103
b9110d6a 7104 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
7105 * fileio.c (auto_saving_dir_umask): New static var.
7106 (Fmake_directory_internal): Use it.
7107 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7108 creating the directory. The old code temporarily assigns
7109 too-generous permissions to the directory.
7110 (do_auto_save_eh): Clear it.
b9110d6a 7111 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
7112 that the var is always cleared.
7113
6c1bd3f3
EZ
71142012-01-07 Eli Zaretskii <eliz@gnu.org>
7115
7116 * search.c (scan_buffer): Pass character positions to
7117 know_region_cache, not byte positions. (Bug#6540)
7118
069d2b50
L
71192012-01-07 LynX <_LynX@bk.ru> (tiny change)
7120
7121 * w32.c (sys_rename): Report EXDEV when rename of a directory
7122 fails because the target is on another logical disk. (Bug#10284)
7123
75bf0d33
DB
71242012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7125
7126 * xterm.c (x_embed_request_focus): New function.
7127
7128 * xterm.h: Add prototype.
7129
7130 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7131
1c6e5a32
GM
71322012-01-05 Glenn Morris <rgm@gnu.org>
7133
7134 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7135
651e947e
EZ
71362012-01-01 Eli Zaretskii <eliz@gnu.org>
7137
7138 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7139 Load gnutls_transport_set_lowat only if GnuTLS version is below
7140 2.11.1.
7141 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7142 GnuTLS versions below 2.11.1.
7143
3778cdd8
AL
71442011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7145
7146 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7147 to the doc string advising against its use for altering the way
7148 windows are scrolled.
7149
0e5317f7
KH
71502011-12-28 Kenichi Handa <handa@m17n.org>
7151
7152 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7153 coding-system ASCII compatible only when it does not produce BOM
7154 on encoding (Bug#10383).
7155
93d5ca1f
JD
71562011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7157
7158 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7159 can scroll.
7160 (create_and_show_popup_menu): Always use menu_position_func for
7161 Gtk3 (Bug#10361).
7162
ca22b785
AS
71632011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7164
7165 * callint.c (Fcall_interactively): Don't truncate prompt string.
7166
d048e1e6
EZ
71672011-12-23 Eli Zaretskii <eliz@gnu.org>
7168
7169 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7170 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 7171 resumed from there (after widening). (Bug#10360)
d048e1e6 7172
5ccaba1f
JD
71732011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7174
7175 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7176
204ee57f
JD
71772011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7178
b81d40f0
JB
7179 * nsterm.m (x_free_frame_resources):
7180 Release f->output_data.ns->miniimage.
204ee57f
JD
7181 (ns_index_color): Fix indentation. Do not retain
7182 color_table->colors[i].
7183
7184 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7185 before returning.
7186
7187 * nsfns.m (x_set_background_color): Assign return value from
7188 ns_index_color to face-background instead of NSColor*.
7189 (ns_implicitly_set_icon_type): Fix indentation.
7190 Change assignment in for loop to comparison.
7191
7192 * emacs.c (ns_pool): New variable.
7193 (main): Assign ns_pool.
7194 (Fkill_emacs): Call ns_release_autorelease_pool.
7195
7196 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7197 autorelease fdesc, release fdAttrs and tdict.
7198 (ns_get_covering_families): Release charset.
7199 (ns_findfonts): Release NSFontDescriptor created with new.
7200 (ns_uni_to_glyphs): Fix indentation.
7201 (setString): Release attrStr before assigning new value.
7202
c803b2b7
JD
72032011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7204
678f4426
JD
7205 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7206 and NS_IMPL_COCOA.
7207 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7208 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7209
cd394be1 72102011-12-18 David Reitter <reitter@cmu.edu>
678f4426 7211
5fecd5fc
JD
7212 * nsterm.m (ns_term_init): Subscribe for notifications
7213 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7214 to method trackingNotification in EmacsMenu.
7215
7216 * nsmenu.m (trackingMenu): New variable.
3771cb17 7217 (trackingNotification): New method (from Aquamacs).
5fecd5fc 7218 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 7219 from Aquamacs (Bug#7030).
678f4426
JD
7220
72212011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 7222
c803b2b7
JD
7223 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7224 (symbol_to_nsstring): Fix indentation.
7225 (ns_symbol_to_pb): New function.
cae07000
SM
7226 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7227 (Fns_rotate_cut_buffers_internal): Remove.
7228 (Fns_store_selection_internal): Rename from
c803b2b7
JD
7229 Fns_store_cut_buffer_internal.
7230 (ns_get_foreign_selection, Fx_own_selection_internal)
7231 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
7232 (Fns_get_selection_internal, Fns_store_selection_internal):
7233 Use ns_symbol_to_pb and check if return value is nil.
7234 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7235 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
7236 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7237 renamed to Sns_store_selection_internal.
7238 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7239 and remove this function.
7240 (ns_handle_selection_clear): Remove, never used.
7241 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7242 here.
7243
e1b01a3a
KB
72442011-12-17 Ken Brown <kbrown@cornell.edu>
7245
7246 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7247 GID is unknown (Bug#10257).
7248
2adb6e85
PE
72492011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7250
7251 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7252 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7253 which caused a build failure on GNU/Linux IA-64. This problem was
7254 introduced by my 2011-10-07 patch.
7255
d1d7b339
JL
72562011-12-15 Juri Linkov <juri@jurta.org>
7257
7258 * image.c (imagemagick_error): New function. (Bug#10112)
7259 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7260 Use `imagemagick_error' where ImageMagick functions return
7261 `MagickFalse'.
7262 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7263 proper order.
7264
100d5755
KH
72652011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7266
7267 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7268 fill background (Bug#8992).
7269
454592a6
MR
72702011-12-13 Martin Rudalics <rudalics@gmx.at>
7271
7272 * window.c (Vwindow_combination_resize)
7273 (Vwindow_combination_limit): Use t instead of non-nil in
7274 doc-strings.
61d4b438
MR
7275 (Vrecenter_redisplay): Add first sentence of doc-string on
7276 separate line.
53524d93 7277 (Frecenter): Fix doc-string typo.
454592a6 7278
3633e3aa
KH
72792011-12-11 Kenichi Handa <handa@m17n.org>
7280
7281 * coding.c (Funencodable_char_position): Pay attention to the
7282 buffer text relocation (Bug#9389).
7283
7b9d523a 72842011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 7285
7b9d523a
JD
7286 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7287 gtk_init (Bug#10100).
7288
b73189c6
EZ
72892011-12-10 Eli Zaretskii <eliz@gnu.org>
7290
7291 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7292 IT->string is nil. (Bug#10263)
7293
f7dfe5d6
JD
72942011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7295
83faebb4
JD
7296 * nsterm.h (x_free_frame_resources): Declare.
7297
f7dfe5d6
JD
7298 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7299 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7300
7301 * nsterm.h (ns_get_defaults_value): Declare.
7302
7303 * nsterm.m (ns_default): Call ns_get_defaults_value.
7304
7cd4e72c
EZ
73052011-12-09 Eli Zaretskii <eliz@gnu.org>
7306
7307 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7308 (Bug#10170)
7309
b34d7317
YM
73102011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7311
7312 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7313 that where the value of an _OBJC_* symbol points to is in the .bss
7314 section (Bug#10240).
7315
76470ad1
KH
73162011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7317
7318 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 7319 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 7320
745fff94
KH
73212011-12-08 Kenichi Handa <handa@m17n.org>
7322
7323 * ftfont.c (get_adstyle_property): Fix previous change
7324 (Bug#10233).
7325
6e44397c
JB
73262011-12-07 Juanma Barranquero <lekktu@gmail.com>
7327
7328 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7329 dirs from the default value of EMACSLOADPATH (bug#10208).
7330
7efa6272
GM
73312011-12-07 Glenn Morris <rgm@gnu.org>
7332
7333 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7334 installation and source directories as well. (Bug#10208)
7335
f6fc4d87
CY
73362011-12-06 Chong Yidong <cyd@gnu.org>
7337
7338 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7339
2bf26180
GM
73402011-12-06 Glenn Morris <rgm@gnu.org>
7341
7342 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7343 as an error, not just -1. (Bug#10217)
7344
3a6ad4f0
CY
73452011-12-05 Chong Yidong <cyd@gnu.org>
7346
7347 * keyboard.c (process_special_events): New function.
7348 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7349
75a3b399
PE
73502011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7351
7352 * coding.c (encode_designation_at_bol): Don't use uninitialized
7353 local variable (Bug#9318).
7354
c3c9e25e
KH
73552011-12-05 Kenichi Handa <handa@m17n.org>
7356
7357 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7358 return Qnil (Bug#8046, Bug#10193).
7359
5eb05ea3
KH
73602011-12-05 Kenichi Handa <handa@m17n.org>
7361
7362 * coding.c (encode_designation_at_bol): New args charbuf_end and
7363 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
7364 (coding_set_source): Return how many bytes coding->source was
7365 relocated.
7366 (coding_set_destination): Return how many bytes
7367 coding->destination was relocated.
7368 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 7369 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
7370
73712011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7372
7373 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7374 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7375 macro (Bug#9318).
7376
73772011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7378
7379 The following changes are to fix Bug#9318.
7380
a79703f5 7381 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
7382 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7383 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 7384 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 7385
7dbda6df
JB
73862011-12-05 Juanma Barranquero <lekktu@gmail.com>
7387
7388 * lisp.h (process_quit_flag): Fix external declaration.
7389
6d5eb5b0
SM
73902011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7391
7392 Don't macro-inline non-performance-critical code.
7393 * eval.c (process_quit_flag): New function.
7394 * lisp.h (QUIT): Use it.
7395
a0c3fad0
JD
73962011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7397
7398 * nsfns.m (get_geometry_from_preferences): New function.
7399 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7400
6c07aac2
AS
74012011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7402
7403 * emacs.c (Qkill_emacs): Define.
7404 (syms_of_emacs): Initialize it.
7405 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7406 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
7407 (quit_throw_to_read_char): Add parameter `from_signal'.
7408 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
7409 * lisp.h (QUIT): Call Fkill_emacs if requested.
7410
c052ead4
JD
74112011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7412
7413 * widget.c (update_wm_hints): Return if wmshell is null.
7414 (widget_update_wm_size_hints): New function.
7415
7416 * widget.h (widget_update_wm_size_hints): Declare.
7417
7418 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7419 widget_update_wm_size_hints (Bug#10104).
7420
9e49252b
EZ
74212011-12-03 Eli Zaretskii <eliz@gnu.org>
7422
7423 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7424 before a newline, prepare the bidi iterator for consuming the
7425 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 7426 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 7427
02b16839
JL
74282011-12-02 Juri Linkov <juri@jurta.org>
7429
7430 * search.c (Fword_search_regexp): New Lisp function created from
7431 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7432 (Fword_search_backward, Fword_search_forward)
7433 (Fword_search_backward_lax, Fword_search_forward_lax):
7434 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7435 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7436
0068070e
SM
74372011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7438
7439 * fileio.c (Finsert_file_contents): Move after-change-function call
7440 to before the "handled:" label, since all "goto handled" appear in
7441 cases where the *-change-functions have already been properly called
7442 (bug#10117).
7443
3360a3fc
AS
74442011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7445
7446 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7447 waiting for input. (Bug#10169)
7448
73d6c093
EZ
74492011-11-30 Eli Zaretskii <eliz@gnu.org>
7450
7451 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7452 verifies glyph row's hash code--we have just reallocated the
7453 glyphs, so their contents can be complete garbage. (Bug#10164)
7454
febe6bea
JB
74552011-11-30 Juanma Barranquero <lekktu@gmail.com>
7456
7457 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7458
801a4313
EZ
74592011-11-30 Eli Zaretskii <eliz@gnu.org>
7460
7461 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7462 attributes are tested _before_ calling verify_row_hash, to protect
7463 against GCC re-ordering of the tests. (Bug#10164)
7464
2b56b87e
JD
74652011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7466
7467 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7468
7469 * xterm.c (handle_one_xevent): Only set async_visible and friends
7470 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 7471 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
7472 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7473
dbf31225
PE
74742011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7475
7476 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7477 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7478 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7479 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7480 All uses changed to use GCPRO1 etc.
7481 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7482 Revert to old implementation (i.e., before 2011-03-11).
7483
1305621b
YM
74842011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7485
7486 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7487 of scroll runs so as to avoid assigning disabled bogus rows and
7488 unnecessary graphics copy operations.
7489
8c9afb46
EZ
74902011-11-27 Eli Zaretskii <eliz@gnu.org>
7491
7492 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7493 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7494 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7495 (malloc, free, realloc, calloc): Redirect to e_* only when
7496 compiling Emacs.
7497
7498 * lisp.h (GCTYPEBITS): Move before first use.
7499 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7500 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7501 this macro definition.
7502
7503 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7504 _MSC_VER.
7505
54e9e3bf
JD
75062011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7507
6d5eb5b0
SM
7508 * gtkutil.c (xg_create_frame_widgets):
7509 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
7510 present with Gtk+ 2.0.
7511
83aca1cb
PE
75122011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7513
7514 * fileio.c (Finsert_file_contents): Undo previous change; see
7515 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7516
5b76caa4
PE
75172011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7518
7519 Rename locals to avoid shadowing.
7520 * fileio.c (Finsert_file_contents):
7521 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7522 * process.c (wait_reading_process_output):
7523 Rename inner 'proc' to 'p' to avoid shadowing.
7524 Indent for consistency with usual Emacs style.
7525
8c535114
EZ
75262011-11-25 Eli Zaretskii <eliz@gnu.org>
7527
7528 * xdisp.c (redisplay_window): If cursor row is not fully visible
7529 after recentering, and scroll-conservatively is set to a large
7530 number, scroll window by a few more lines to make the cursor fully
7531 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
7532 (start_display): Don't move to the next line if the display should
7533 start at a newline that is part of a display vector or an overlay
7534 string. (Bug#10119)
8c535114 7535
fa4fdb5c
JL
75362011-11-24 Juri Linkov <juri@jurta.org>
7537
7538 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7539 after the `MagickPingImage' call. (Bug#10112)
7540
90ec88df
CY
75412011-11-23 Chong Yidong <cyd@gnu.org>
7542
7543 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7544
56e2e794
MR
75452011-11-23 Martin Rudalics <rudalics@gmx.at>
7546
7547 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7548 making another buffer current. (Bug#10114)
7549
b6e64c41
GM
75502011-11-23 Glenn Morris <rgm@gnu.org>
7551
7552 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7553
6b21de18
CY
75542011-11-23 Chong Yidong <cyd@gnu.org>
7555
7556 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7557 using it (Bug#5984).
7558
b12cd789
EZ
75592011-11-22 Eli Zaretskii <eliz@gnu.org>
7560
7561 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7562 and header-lines, as they don't have one computed for them.
7563 (Bug#10098)
7564
7565 * .gdbinit (prow): Make displayed values more self-explaining.
7566 Add row's hash code.
7567
261b6fd4
LMI
75682011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7569
7570 * process.c (wait_reading_process_output): Fix asynchrounous
7571 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 7572 (wait_reading_process_output): Add comment and URL.
261b6fd4 7573
e7cfd277
JD
75742011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7575
7576 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7577
a9b9b7f5
CY
75782011-11-21 Chong Yidong <cyd@gnu.org>
7579
7580 * window.c (Fnext_window, Fprevious_window): Doc fix.
7581
b0d15b4f
SM
75822011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7583
7584 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7585
fe7a3057
JB
75862011-11-20 Juanma Barranquero <lekktu@gmail.com>
7587
7588 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7589
d2999b1a
MR
75902011-11-20 Martin Rudalics <rudalics@gmx.at>
7591
7592 * window.c (Fset_window_combination_limit): Rename argument
7593 STATUS to LIMIT.
7594 (Vwindow_combination_limit): Remove "status" from doc-string.
7595
d5ff9cd0
AS
75962011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7597
7598 * m/ibms390.h: Remove.
7599 * m/ibms390x.h: Don't include "ibms390.h".
7600
a5bb9bd3
SM
76012011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7602
7603 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7604 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7605
cd1181db
JB
76062011-11-20 Juanma Barranquero <lekktu@gmail.com>
7607
7608 * casetab.c (Fset_case_table):
7609 * charset.c (Fcharset_after): Fix typos.
7610
615a3b8d 76112011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 7612
17e845af
PE
7613 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7614 Otherwise, valgrind does not work on some platforms.
7615 Problem reported by Andreas Schwab in
6a0bf43d
PE
7616 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7617 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7618 is set, removing the need for VIRT_ADDRESS_VARIES.
7619 (PURE_P): Use a more-efficient implementation that needs just one
7620 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7621 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7622 to 4 (xorl, subq, cmpq, setbe).
7623 * alloc.c (pure): Always extern now, since that's the
7624 VIRT_ADDR_VARIES behavior.
7625 (PURE_POINTER_P): Use a single comparison, not two, for
7626 consistency with the new puresize.h.
7627 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7628 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7629 Remove VIRT_ADDR_VARIES no longer needed.
7630
f8fe6f96
EZ
76312011-11-19 Eli Zaretskii <eliz@gnu.org>
7632
7633 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7634 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7635 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7636 behave as if the cursor position were at the window margin.
7637
7638 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7639 and the cursor position is out of bounds, behave as if the cursor
7640 position were at the window margin. (Bug#10075)
7641
df05a53c
CY
76422011-11-18 Chong Yidong <cyd@gnu.org>
7643
7644 * window.c (Fwindow_combination_limit): Make first argument
7645 non-optional, since it is meaningless for live windows like the
7646 selected window.
61ccba97 7647
2071918e
DA
76482011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7649
7650 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7651
b50a28de
SM
76522011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7653
7654 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7655 (graft_intervals_into_buffer): Simplify.
7656
015137db
EZ
76572011-11-18 Eli Zaretskii <eliz@gnu.org>
7658
7659 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7660 hash values of the two rows.
7661 (copy_row_except_pointers): Preserve the used[] arrays and the
7662 hash values of the two rows. (Bug#10035)
68c95424 7663 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
7664
7665 * xdisp.c (row_hash): New function, body extracted from
7666 compute_line_metrics.
7667 (compute_line_metrics): Call row_hash, instead of computing the
7668 hash code inline.
7669
7670 * dispnew.c (verify_row_hash): Call row_hash for computing the
7671 hash code of a row, instead of duplicating code from xdisp.c.
7672
7673 * dispextern.h (row_hash): Add prototype.
7674
a2addb04
TH
76752011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7676
7677 * frame.c (delete_frame): Don't delete the terminal when the last
7678 X frame is closed if emacs is built with GTK toolkit.
7679
df85d315
JB
76802011-11-17 Juanma Barranquero <lekktu@gmail.com>
7681
7682 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7683
a0c2d0ae
MR
76842011-11-17 Martin Rudalics <rudalics@gmx.at>
7685
7686 * window.c (Vwindow_splits): Rename to
7687 Vwindow_combination_resize. Suggested by Juri Linkov.
7688 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7689 of Vwindow_splits.
7690
58179cce
JB
76912011-11-16 Juanma Barranquero <lekktu@gmail.com>
7692
7877f373
JB
7693 * nsfns.m (Fns_font_name):
7694 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 7695
b6f67890
MR
76962011-11-16 Martin Rudalics <rudalics@gmx.at>
7697
7698 * window.h (window): Rename slot "nest" to "combination_limit".
7699 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7700 (Fset_window_nest): Rename to Fset_window_combination_limit.
7701 (Vwindow_nest): Rename to Vwindow_combination_limit.
7702 (recombine_windows, make_parent_window, make_window)
7703 (Fsplit_window_internal, saved_window)
7704 (Fset_window_configuration, save_window_save): Rename all
7705 occurrences of window_nest to window_combination_limit.
7706
c7015153
JB
77072011-11-15 Juanma Barranquero <lekktu@gmail.com>
7708
7709 * image.c (imagemagick_load_image): Fix typo.
7710
322ad6ec
EZ
77112011-11-14 Eli Zaretskii <eliz@gnu.org>
7712
7713 * xdisp.c (display_line): Move the call to
7714 highlight_trailing_whitespace before the call to
7715 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
7716 faces of all the glyphs to compute ROW's hash value.
7717 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 7718
f067b8ec
JB
77192011-11-14 Juanma Barranquero <lekktu@gmail.com>
7720
7721 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7722 just return (bug#10044).
7723
1e5b2111
EZ
77242011-11-12 Eli Zaretskii <eliz@gnu.org>
7725
7ef3cbd5
EZ
7726 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7727 with user-defined heap size. Bump the default size of the temacs
7728 heap to 27MB, to avoid memory warning when running temacs.
7729 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7730
1e5b2111
EZ
7731 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7732 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
7733 (verify_row_hash) [XASSERTS]: New function.
7734 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7735 that the hash value of glyph rows is correct.
1e5b2111 7736
89d61221
MR
77372011-11-12 Martin Rudalics <rudalics@gmx.at>
7738
7739 * window.h (window): Remove splits slot.
7740 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7741 (Fdelete_other_windows_internal, make_parent_window)
7742 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7743 (Fset_window_configuration, save_window_save): Don't deal with
7744 split status of windows.
7745 (saved_window): Remove splits slot.
7746 (Vwindow_splits): Rewrite doc-string.
7747
97f18cc8
JD
77482011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7749
7750 * xfns.c (unwind_create_frame):
7751 * nsfns.m (unwind_create_frame):
7752 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7753 Vframe_list (Bug#9999).
7754
22a648b4
DA
77552011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7756
0b381c7e 7757 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 7758
659afede
KH
77592011-11-11 Kenichi Handa <handa@m17n.org>
7760
7761 * callproc.c (Fcall_process): Set the member dst_multibyte of
7762 process_coding.
7763
9ac0394b
KH
77642011-11-11 Johan Bockgård <bojohan@gnu.org>
7765
7766 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7767 avoid a crash (bug#9496).
7768
2fbdc249
CY
77692011-11-09 Chong Yidong <cyd@gnu.org>
7770
7771 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7772 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7773
ac6b1f81
PE
77742011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7775
7776 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7777
09db192c
PE
77782011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7779
7780 Avoid some portability problems by eschewing 'extern inline' functions.
7781 The trivial performance wins aren't worth the portability hassles; see
7782 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7783 et seq.
7784 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7785 (window_box_width, window_box_left, window_box_left_offset)
7786 (window_box_right, window_box_right_offset): Undo previous change,
7787 by removing the "extern"s.
7788 * intervals.c (adjust_intervals_for_insertion)
7789 (adjust_intervals_for_deletion): Undo previous change,
7790 making these static again.
7791 (offset_intervals, temp_set_point_both, temp_set_point)
7792 (copy_intervals_to_string): No longer inline.
7793 * xdisp.c (window_text_bottom_y, window_box_width)
7794 (window_box_height, window_box_left_offset)
7795 (window_box_right_offset, window_box_left, window_box_right)
7796 (window_box): No longer inline.
7797
105216ed
CY
77982011-11-08 Chong Yidong <cyd@gnu.org>
7799
7800 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
7801 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7802 Signal an error if not a live window.
105216ed
CY
7803 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7804 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7805
ae9e237f
JB
78062011-11-07 Juanma Barranquero <lekktu@gmail.com>
7807
7808 * lisp.h (syms_of_abbrev): Remove declaration.
7809 Reported by CHENG Gao <chenggao@royau.me>.
7810
c7aa8333
EZ
78112011-11-07 Eli Zaretskii <eliz@gnu.org>
7812
7813 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7814 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7815 of temacs in GUI mode.
7816
be7f5545
MR
78172011-11-07 Martin Rudalics <rudalics@gmx.at>
7818
7819 * window.h: Declare delete_all_child_windows instead of
7820 delete_all_subwindows.
7821 * window.c (Fwindow_nest, Fset_window_nest)
7822 (Fset_window_new_total, Fset_window_new_normal)
7823 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7824 (delete_all_subwindows): Rename to delete_all_child_windows.
7825 (Fdelete_other_windows_internal, Fset_window_configuration):
7826 Call delete_all_child_windows instead of delete_all_subwindows.
7827 * frame.c (delete_frame): Call delete_all_child_windows instead
7828 of delete_all_subwindows.
7829
ca78dc43
PE
78302011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7831
7832 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7833 This is also needed for porting to any host where GC_MARK_STACK is
7834 not GC_MAKE_GCPROS_NOOPS.
7835 (which_symbols): Use it.
7836
a0241d01
KH
78372011-11-07 Kenichi Handa <handa@m17n.org>
7838
7839 * coding.c (coding_set_destination): Check coding->src_pos only
7840 when coding->src_object is a buffer (bug#9910).
7841
7842 * process.c (send_process): Set the member src_multibyte of coding
7843 to 0 (bug#9911) when sending a unibyte text.
7844
7845 * callproc.c (Fcall_process): Set the member src_multibyte of
7846 process_coding to 0 (bug#9912).
7847
a64bfdfa 78482011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
7849
7850 * xmenu.c (cleanup_widget_value_tree): New function.
7851 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7852 calling free_menubar_widget_value_tree directly (Bug#9830).
7853
cb41b32a
PE
78542011-11-06 Paul Eggert <eggert@cs.ucla.edu>
7855
7856 Fix some portability problems with 'inline'.
7857 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7858 (window_box_width, window_box_left, window_box_left_offset)
7859 (window_box_right, window_box_right_offset): Declare extern.
7860 Otherwise, these inline functions do not conform to C99 and
7861 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
7862 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7863 * intervals.c (adjust_intervals_for_insertion)
7864 (adjust_intervals_for_deletion): Now extern, because otherwise the
7865 extern inline functions 'offset_intervals' couldn't refer to it.
7866 (static_offset_intervals): Remove.
7867 (offset_intervals): Rewrite using the old contents of
7868 static_offset_intervals. The old version didn't conform to C99
7869 because an extern inline function contained a reference to an
7870 identifier with static linkage.
7871
b7041366
AS
78722011-11-06 Andreas Schwab <schwab@linux-m68k.org>
7873
7874 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7875 GC.
7876
88a37c4d
EZ
78772011-11-06 Eli Zaretskii <eliz@gnu.org>
7878
7879 * xdisp.c (init_iterator, reseat_to_string): Don't set the
7880 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
7881 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7882 return Qleft_to_right.
7883
49745b39
CY
78842011-11-06 Chong Yidong <cyd@gnu.org>
7885
7886 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7887 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7888 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7889 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7890 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7891 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7892 (Fwindow_vscroll): Doc fix.
7893 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7894 argument, since it makes no sense to pass a live window and for
7895 consistency with window-child.
7896
1f05cd82
CS
78972011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
7898
7899 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
7900 support MSVC.
7901
22610910
JR
79022011-11-05 Jason Rumney <jasonr@gnu.org>
7903
7904 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
7905 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
7906 fonts (Bug#6029).
7907 (add_font_entity_to_list): Fix logic errors in mixed boolean and
7908 bitwise arithmetic preventing use of unicode-sip and non-truetype
7909 opentype fonts.
7910
a06776b2
EZ
79112011-11-05 Eli Zaretskii <eliz@gnu.org>
7912
3ad924ba
EZ
7913 * s/ms-w32.h (fstat, stat, utime): Move redirections to
7914 "emacs"-only part.
7915
a06776b2
EZ
7916 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
7917 initialization code to keep similarity to xfns.c after changes
7918 from 2011-11-05.
7919
c9e7db78
JD
79202011-11-05 Jan Djärv <jan.h.d@swipnet.se>
7921
a97f8f3f
JD
7922 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
7923 (unwind_create_frame): New function (Bug#9943).
7924 (Fx_create_frame): Restructure code to be more similar to the one in
7925 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
7926 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
7927 Move terminal->reference_count++ just before making the frame official
7928 (Bug#9943).
7929
7930 * nsterm.m (x_free_frame_resources): New function.
7931 (x_destroy_window): Move code to x_free_frame_resources.
7932
c9e7db78 7933 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
7934 (Fx_create_frame, x_create_tip_frame):
7935 Move terminal->reference_count++ just before making the frame
75f1671a 7936 official. Move initialization of image_cache_refcount and
c9e7db78
JD
7937 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
7938
a6fc3b5c
EZ
79392011-11-05 Eli Zaretskii <eliz@gnu.org>
7940
7941 Support MSVC build with newer versions of Visual Studio.
7942 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
7943 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
7944 nt/gmake.defs.
7945
7946 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
7947 which are not supported by MSVC.
7948 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
7949 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
7950 bitfields.
7951 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
7952 types in bitfields.
7953 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
7954
7955 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
7956
58179cce 79572011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
7958
7959 Support MSVC build with newer versions of Visual Studio.
7960 * w32.c: Don't include w32api.h for MSVC.
7961 (init_environment) [_MSC_VER]: Call sys_access, not _access.
7962
7963 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
7964 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
7965 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
7966 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
7967 e_* cousins.
7968 (alloca) [_MSC_VER]: Define to _alloca.
7969
7970 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
7971
7972 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
7973
a58c13ed
EZ
79742011-11-04 Eli Zaretskii <eliz@gnu.org>
7975
7976 * xdisp.c (note_mouse_highlight): If either of
7977 previous/next-single-property-change returns nil, treat that as
7978 the beginning or the end of the buffer. (Bug#9955)
7979
fe0b6370
JD
79802011-11-04 Jan Djärv <jan.h.d@swipnet.se>
7981
a58c13ed 7982 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
7983 label is not null (Bug#9951).
7984 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
7985 may be NULL.
7986
89bd5ee1
EZ
79872011-11-04 Eli Zaretskii <eliz@gnu.org>
7988
7989 * window.c (Fwindow_body_size): Mention in the doc string that the
7990 return value is in frame's canonical units. (Bug#9949)
7991
84c3edb9
EZ
79922011-11-03 Eli Zaretskii <eliz@gnu.org>
7993
4e2fb5c7
EZ
7994 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
7995
84c3edb9 7996 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 7997 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 7998 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 7999
bc17a887
EZ
80002011-11-01 Eli Zaretskii <eliz@gnu.org>
8001
8002 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8003 Don't stop backward scan on the continuation glyph, even though
8004 its CHARPOS is positive.
6d5eb5b0
SM
8005 (mouse_face_from_buffer_pos, note_mouse_highlight):
8006 Rename cover_string to disp_string.
bc17a887 8007
4ee88440
MR
80082011-11-01 Martin Rudalics <rudalics@gmx.at>
8009
8010 * window.c (temp_output_buffer_show): Don't use
8011 Vtemp_buffer_show_specifiers.
8012 (Vtemp_buffer_show_specifiers): Remove unused variable.
8013
c2ff3c02
EZ
80142011-10-30 Eli Zaretskii <eliz@gnu.org>
8015
8016 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8017 past the beginning of the current glyph matrix.
8018
58179cce 80192011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
8020
8021 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8022 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8023 HAVE_GTK3 (Bug#9869).
b77a6a7f 8024
3b574623
JD
8025 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8026 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8027
b77a6a7f
JD
8028 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8029
8030 * xterm.c: Declare x_handle_net_wm_state to return int.
8031 (handle_one_xevent): Check if we are iconified but don't have
8032 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8033 (get_current_wm_state): Return non-zero if not hidden,
8034 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8035 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8036 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8037 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8038
196e41e4
PE
80392011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8040
8041 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8042 so that this new function doesn't get optimized away by a
8043 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8044
021f2e1a
AS
80452011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8046
8047 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8048
8b058d44
EZ
80492011-10-29 Eli Zaretskii <eliz@gnu.org>
8050
8051 Fix the `xbytecode' command.
8052 * .gdbinit (xprintbytestr): New command.
b50a28de 8053 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
8054 (xbytecode): Print the byte-code string as well.
8055
4452fb80
EZ
80562011-10-29 Kim Storm <storm@cua.dk>
8057
8b058d44
EZ
8058 * alloc.c (which_symbols): New function.
8059
21b72067
AS
80602011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8061
8062 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8063 line. (Bug#9903)
8064
83ed7b5c
GM
80652011-10-29 Glenn Morris <rgm@gnu.org>
8066
8067 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8068 Not clear what it was for, and it causes various bugs. (Bug#9839)
8069
5a7a728b
EZ
80702011-10-28 Eli Zaretskii <eliz@gnu.org>
8071
8072 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8073 possible random value that matches one of those tested as
8074 condition to clear the mouse face.
8075
d3d0842f
CY
80762011-10-28 Chong Yidong <cyd@gnu.org>
8077
8078 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8079
31b39d13
DN
80802011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8081
8082 * window.c (make_window): Initialize phys_cursor_on_p.
8083
9aba6043
SM
80842011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8085
8086 * lisp.h (struct Lisp_Symbol): Update comments.
8087
c20992f4
JB
80882011-10-28 Juanma Barranquero <lekktu@gmail.com>
8089
8090 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8091
db4f02f2
EZ
80922011-10-28 Eli Zaretskii <eliz@gnu.org>
8093
8094 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8095 <oslsachem@gmail.com> for helping to debug this.
8096
8097 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8098 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8099 (g_b_init_get_glyph_outline_w): New static variables.
8100 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8101 (GetGlyphOutlineW_Proc): New typedefs.
8102 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
8103 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8104 New functions.
8105 (w32font_open_internal, compute_metrics):
8106 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
8107 instead of calling the "wide" APIs directly.
8108
8109 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8110
8111 * w32.h (syms_of_w32font): Add prototype.
8112
87e68db4
JB
81132011-10-27 Juanma Barranquero <lekktu@gmail.com>
8114
8115 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8116 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8117 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8118 (Fmove_to_window_line): Doc fix.
8119
435c1d67
CY
81202011-10-27 Chong Yidong <cyd@gnu.org>
8121
8122 * process.c (make_process): Set gnutls_state to NULL.
8123
8124 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8125 non-NULL, regardless of GNUTLS_INITSTAGE.
8126 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8127 an error. Set process slots as soon as we allocate them.
8128
8129 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8130
9c6c6f49
CY
81312011-10-27 Chong Yidong <cyd@gnu.org>
8132
9aba6043
SM
8133 * gnutls.c (emacs_gnutls_deinit): New function.
8134 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
8135 (Fgnutls_deinit, Fgnutls_boot): Use it.
8136
8137 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8138 (deactivate_process): Call emacs_gnutls_deinit.
8139
657d08d3
JB
81402011-10-27 Juanma Barranquero <lekktu@gmail.com>
8141
8142 * image.c (x_create_x_image_and_pixmap):
8143 * w32.c (sys_rename, w32_delayed_load):
8144 * w32font.c (fill_in_logfont):
8145 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8146
5430d399
JB
81472011-10-26 Juanma Barranquero <lekktu@gmail.com>
8148
8149 * w32fns.c (w32_default_color_map): New function,
8150 extracted from Fw32_default_color_map.
a7ef684b 8151 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 8152
fe0055fa
PE
81532011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8154
8155 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8156
e6346438
SM
81572011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8158
8159 * keyboard.c (test_undefined): New function (bug#9751).
8160 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8161
e112cc37
ET
81622011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8163
8164 * sysdep.c (init_sys_modes): Fix the check for the controlling
8165 terminal (Bug#6649).
8166
7b5d6677
EZ
81672011-10-20 Eli Zaretskii <eliz@gnu.org>
8168
8169 * dispextern.h (struct bidi_it): New member next_en_type.
8170
8171 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8172 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8173 current character, check also for next_en_type being WEAK_EN.
8174 (bidi_resolve_weak): Don't enter the expensive loop if the current
8175 position is before next_en_pos. Record the bidi type of the first
8176 non-ET, non-BN character we find, in addition to its position.
8177 (bidi_level_of_next_char): Invalidate next_en_type when
8178 next_en_pos is over-stepped.
8179
7da0b018
PE
81802011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8181
8182 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8183 * editfns.c: Rewrite current-time-zone so that it invokes
8184 the equivalent of (format-time-string "%Z") to get the time zone name.
8185 This fixes a bug when the time zone name contains characters that
8186 need converting from the system time locale to Emacs internal format.
8187 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8188 that patch fixed format-time-string to do the conversion, but
8189 I forgot to fix current-time-zone.
8190 (format_time_string): New function, containing most of
8191 what Fformat_time_string used to contain.
8192 (Fformat_time_string): Rewrite in terms of format_time_string.
8193 This doesn't change this function's behavior.
8194 (current-time-zone): Rewrite to use format_time_string.
8195 This fixes the bug reported by Michael Schierl in
8196 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8197 Jason Rumney's 2007-06-07 change worked around this bug, but
8198 didn't fix it.
8199 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8200
8547b010
EZ
82012011-10-19 Eli Zaretskii <eliz@gnu.org>
8202
8203 * xdisp.c (start_display): If the character at POS is displayed
8204 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
8205 (try_window_reusing_current_matrix): If a line ends in a display
8206 vector or the next line starts in a display vector, continue
8207 redrawing the window even though the character position of
8208 start_row was reached.
8547b010
EZ
8209 (Bug#9771, part 2)
8210
4e948d15
CY
82112011-10-18 Chong Yidong <cyd@gnu.org>
8212
8213 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8214 with nobreak-char-display too.
8215
4787455f
EZ
82162011-10-18 Eli Zaretskii <eliz@gnu.org>
8217
8218 Fix part 3 of bug#9771.
8219 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8220 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8221 non-neutral characters if the current character is a paragraph
8222 separator (a.k.a. Newline). This avoids running the same
8223 expensive loop twice, once when we consume the preceding newline
8224 and the other time when the line actually needs to be displayed.
8225 Avoid the loop when we see neutrals on the base embedding level
8226 following a character whose directionality is the same as the
8227 paragraph's. This avoids running the expensive loop when a line
8228 ends in a long sequence of neutrals, like control characters.
8229 Add assertion against STRONG_AL type. Slightly rearrange code
8230 that determines the type of a neutral given the first non-neutral
8231 that follows it.
8232 (bidi_level_of_next_char): Set next_en_pos to zero when
8233 invalidating its info.
8234
2c91f553
EZ
82352011-10-17 Eli Zaretskii <eliz@gnu.org>
8236
8237 * xdisp.c (push_display_prop): Determine whether to record string
8238 or buffer position by IT->string, not by IT->method. Allow
8239 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
8240 (move_it_vertically_backward): Don't look for character position
8241 immediately after the newline when in a continuation line.
8242 (Bug#9771, part 1)
2c91f553 8243
c7b08b0d
MR
82442011-10-15 Martin Rudalics <rudalics@gmx.at>
8245
8246 * window.c (coordinates_in_window): Rewrite and delabelize
8247 vertical border check. (Bug#5357) (Bug#9618)
8248
6b02f655
SM
82492011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8250
8251 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8252 errors in XSetWindowBorder (bug#9310).
8253
81d40c92
DA
82542011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8255
8256 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8257 avoid crash when xmalloc overrun checking is enabled.
8258
d4172c3b
EZ
82592011-10-13 Eli Zaretskii <eliz@gnu.org>
8260
8261 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8262 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8263 cursor motion with <left> and <right> arrow keys.
8264
8265 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8266 some callers set that themselves.
8267
b00eea75
EZ
82682011-10-12 Eli Zaretskii <eliz@gnu.org>
8269
8270 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8271 display string and the previous row comes from the same string and
8272 is empty. (Bug#9739) (Bug#9738)
8273
8fe012c4
SM
82742011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8275
8276 * doc.c (get_doc_string): Encode file name (bug#9735).
8277
0074aef2
EZ
82782011-10-12 Eli Zaretskii <eliz@gnu.org>
8279
79beb178
EZ
8280 * bidi.c (bidi_level_of_next_char):
8281 * xdisp.c (get_visually_first_element): Remove old incorrect
8282 comments regarding the Unicode Line Separator character.
8283
0074aef2
EZ
8284 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8285
6e4b3fbe
DA
82862011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8287
8288 * alloc.c (Fgc_status): Do not access beyond zombies array
8289 boundary if nzombies > MAX_ZOMBIES.
8290 * alloc.c (dump_zombies): Add missing format specifier.
8291
0324f3af
PE
82922011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8293
b5525cac
PE
8294 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8295 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8296
0324f3af
PE
8297 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8298 Some packages use them to denote characters with modifiers.
8299
e9b5f888
AS
83002011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8301
8302 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8303 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8304 matching a pp-number. Rename parameter var to var1.
8305
127827c0
SM
83062011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8307
8308 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8309
c8fd3bd0
GM
83102011-10-08 Glenn Morris <rgm@gnu.org>
8311
8312 * callint.c (Fcall_interactively): Give a more explicit error for the
8313 'c' case with a non-character input. (Bug#8479)
8314
352ec8ff
EZ
83152011-10-08 Eli Zaretskii <eliz@gnu.org>
8316
03669ccb
EZ
8317 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8318 lines.
7061c986
EZ
8319 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8320 lines that are hscrolled on the left.
03669ccb 8321
352ec8ff
EZ
8322 * dispnew.c (buffer_posn_from_coords): Account for a possible
8323 presence of header-line. (Bug#4426)
8324
a66cfb1c
SM
83252011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8326
6b02f655
SM
8327 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8328 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 8329
7c5ee88e
PE
83302011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8333 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8334 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8335 this makes Emacs dump core during garbage collection on rare
8336 occasions. sizeof is obviously inferior to offsetof here, so
8337 stick with offsetof.
8338 (GC_POINTER_ALIGNMENT): New macro.
8339 (mark_memory): Omit 3rd (offset) arg; caller changed.
8340 Don't assume EMACS_INT alignment is the same as pointer alignment.
8341
df1bbe5b
SM
83422011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8343
8344 * keyboard.c (read_key_sequence_remapped): New var.
8345 (read_key_sequence): Compute remapping in the right buffer.
8346 (command_loop_1): Use read_key_sequence's remapping directly.
8347
51553db6
SM
83482011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8349
32c1fffd
SM
8350 * dired.c (file_name_completion): Don't expand file name.
8351 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8352 before checking file name handler.
8353
51553db6
SM
8354 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8355 they've been requested explicitly (bug#9591).
8356
b6bd1599 83572011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
8358
8359 * keymap.c (Fsingle_key_description): Use make_specified_string
8360 instead of build_string to build string from push_key_description.
8361 (Bug#5193)
8362
f701dc2a
PE
83632011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8364
4222c55d
PE
8365 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8366 This fixes a Y2038 bug on 64-bit hosts.
8367 * buffer.c (reset_buffer):
8368 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8369 (Fclear_buffer_auto_save_failure):
8370 Use 0, not -1, to represent an unset failure time, since time_t
8371 might not be signed.
8372
f701dc2a
PE
8373 Remove dependency on glibc malloc internals.
8374 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8375 Move back here from lisp.h, but with their new implementations.
8376 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8377 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8378 * charset.c (charset_table_init): New static var.
8379 (syms_of_charset): Use it instead of xmalloc. This removes a
8380 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8381 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8382 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8383 Move back to alloc.c.
8384 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8385 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8386
9ceebf39
JD
83872011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8388
8389 * nsterm.m (windowDidResize): Call x_set_window_size only when
8390 ns_in_resize is true. Otherwise set pixelwidth/height and
8391 call change_frame_size (Bug#9628).
8392
cb993c58
PE
83932011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8394
3930c88b
PE
8395 Port --enable-checking=all to Fedora 14 x86-64.
8396 * charset.c (syms_of_charset): Also account for glibc malloc's
8397 internal overhead when calculating the initial malloc maximum.
8398
cb993c58
PE
8399 Port --enable-checking=all to Fedora 14 x86.
8400 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8401 Move to lisp.h.
8402 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8403 (overrun_check_realloc, overrun_check_free):
8404 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8405 That way, xmalloc returns a properly-aligned pointer even if
8406 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8407 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8408 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8409 into account when calculating the initial malloc maximum.
8410 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8411 Move here from alloc.c, so that charset.c can use it too.
8412 Properly align; the old code wasn't right for common 32-bit hosts
8413 when configured with --enable-checking=all.
8414 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8415 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8416
31bed486
EZ
84172011-09-29 Eli Zaretskii <eliz@gnu.org>
8418
04c70788 8419 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
8420 use EDOM.
8421
fbcaa2f3
EZ
84222011-09-28 Eli Zaretskii <eliz@gnu.org>
8423
8424 * xdisp.c (compute_display_string_end): If there's no display
8425 string at CHARPOS, return -1.
8426
8427 * bidi.c (bidi_fetch_char): When compute_display_string_end
8428 returns a negative value, treat the character as a normal
8429 character not covered by a display string. (Bug#9624)
8430
a239d4e9
JB
84312011-09-28 Juanma Barranquero <lekktu@gmail.com>
8432
8433 * lread.c (Fread_from_string): Fix typo in docstring.
8434
88652fd5
EZ
84352011-09-27 Eli Zaretskii <eliz@gnu.org>
8436
8437 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8438 newline, reseat the iterator instead of bidi-iterating there one
8439 character at a time. (Bug#9610)
32c1fffd
SM
8440 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8441 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 8442
ed497dd4
AS
84432011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8444
8445 * lread.c (readevalloop): Use correct code for NBSP.
8446 (read1): Likewise. (Bug#9608)
8447
b2bf61aa
MA
84482011-09-25 Michael Albinus <michael.albinus@gmx.de>
8449
8450 * dbusbind.c (Fdbus_register_signal): When service is not
8451 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8452
32bbb17c
GM
84532011-09-25 Glenn Morris <rgm@gnu.org>
8454
8455 * buffer.c (truncate-lines): Doc fix.
8456
94e0933e
CY
84572011-09-24 Chong Yidong <cyd@stupidchicken.com>
8458
8459 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8460 (Fset_window_next_buffers): Doc fix.
8461
cddde921
GM
84622011-09-24 Glenn Morris <rgm@gnu.org>
8463
8464 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8465
1260aef1
PE
84662011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8467
25b4bfa0
PE
8468 Fix minor problems found by static checking.
8469 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
8470 * indent.c (Fvertical_motion): Fix == vs = typo.
8471
e3cbd34b
EZ
84722011-09-24 Eli Zaretskii <eliz@gnu.org>
8473
a66cfb1c
SM
8474 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8475 Default value is now t. Doc fix.
6bf7006f 8476
e3cbd34b 8477 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 8478 logic when moving up, not only when moving down. Fix the
e3cbd34b 8479 confusing name and values of the it_overshoot_expected variable;
32c1fffd 8480 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
8481
8482 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8483 CHARPOS is covered by a display string which includes newlines.
8484 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8485 is covered by a display string with embedded newlines.
8486
a3de0cbd
MA
84872011-09-24 Michael Albinus <michael.albinus@gmx.de>
8488
8489 * dbusbind.c (Fdbus_register_signal): Add match rule to
8490 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
8491 (Fdbus_register_method, Vdbus_registered_objects_table):
8492 Fix docstring.
a3de0cbd 8493
b260039d
JM
84942011-09-24 Jim Meyering <meyering@redhat.com>
8495
32c1fffd 8496 do not ignore write error for any output size
b260039d
JM
8497 The previous change was incomplete.
8498 While it makes emacs --batch detect the vast majority of stdout
8499 write failures, errors were still ignored whenever the output size is
8500 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8501 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8502 && echo FAIL: ignored write error
8503 FAIL: ignored write error
8504 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8505 && echo FAIL: ignored write error
8506 FAIL: ignored write error
8507 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8508
8eca8a7c
AS
85092011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8510
8511 * emacs.c (Fkill_emacs): In noninteractive mode exit
8512 non-successfully if a write error occurred on stdout. (Bug#9574)
8513
3341db62
EZ
85142011-09-21 Eli Zaretskii <eliz@gnu.org>
8515
8516 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8517 the xassert test.
8518
8519 * dispextern.h (struct it): Update the comment documenting what
8520 can it->OBJECT be.
8521
8c203dbf
EZ
85222011-09-20 Eli Zaretskii <eliz@gnu.org>
8523
8524 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8525 a display string, extend search for cursor position to end of row.
8526 (find_row_edges): If the row ends in a newline from a display
8527 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8528 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
8529 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8530 non-empty line. Fixes confusing cursor motion with arrow keys at
8531 the beginning of a line that starts with whitespace.
8c203dbf 8532
a4824228
LMI
85332011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8534
8535 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8536 (bug#9493).
8537
33ed493b
CY
85382011-09-18 Chong Yidong <cyd@stupidchicken.com>
8539
8540 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8541 boolean (Bug#9154).
8542
56cd55c8
EZ
85432011-09-18 Eli Zaretskii <eliz@gnu.org>
8544
8545 * xdisp.c (display_line): Record maximum and minimum buffer
8546 positions even if no glyphs were produced (e.g., by a zero-width
8547 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8548 buffer positions that will be removed from the glyph row because
8549 they don't fit.
c02dcedf
EZ
8550 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8551 column is beyond frame width: don't subtract 1 "pixel" when
8552 computing width of the stretch.
3e62b7e0
EZ
8553 (reseat_at_next_visible_line_start): Undo the change made on
8554 2011-09-17 that saved paragraph information and restored it after
8555 the call to `reseat'. (Bug#9545)
56cd55c8 8556
5ed99d36 85572011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
8558
8559 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8560 and turn window cursor on if cleared (Bug#9415).
8561
5ed99d36 85622011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
8563
8564 * search.c (boyer_moore): Take unibyte characters from pattern
8565 literally. (Bug#9458)
8566
9bade7b2
EZ
85672011-09-18 Eli Zaretskii <eliz@gnu.org>
8568
8569 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8570
e5e9d610
PE
85712011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8572
87e4427a
PE
8573 Fix minor problem found by static checking.
8574 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8575 initialized, to pacify gcc -Wuninitialized.
8576
e5e9d610
PE
8577 * fileio.c: Report proper errno when syscall falls.
8578 (Finsert_file_contents): Save and restore errno,
8579 so that report_file_error outputs the correct diagnostic.
8580 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8581
a1674f0b
EZ
85822011-09-18 Eli Zaretskii <eliz@gnu.org>
8583
8584 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8585
fbfb6dd4
EZ
85862011-09-17 Eli Zaretskii <eliz@gnu.org>
8587
8588 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8589 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8590
bb187662
EZ
85912011-09-17 Eli Zaretskii <eliz@gnu.org>
8592
1137e8b8 8593 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 8594 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
8595
8596 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8597 (bidi_find_paragraph_start): Search back for paragraph beginning
8598 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8599 (bidi_move_to_visually_next): Only trigger paragraph-related
8600 computations when the last character is a newline or at EOB, not
8601 just any NEUTRAL_B. (Bug#9470)
8602
bb187662
EZ
8603 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8604 truncated lines if point is covered by a display string. (Bug#9524)
8605
2e621251
PE
86062011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8607
8608 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8609 (cons_to_x_long): New function.
8610 (lisp_data_to_selection_data): Use it. Correct the test for
8611 short-versus-long data; it was negated. Break out of vector
8612 loop, for efficiency, when a long datum is discovered.
8613
91a15bc6
SM
86142011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8615
8616 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8617
b41c3a35
EZ
86182011-09-16 Eli Zaretskii <eliz@gnu.org>
8619
8620 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8621 GCC PR/17406) by declaring this function with external scope.
8622
7812ba2d
PE
86232011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8624
8625 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8626 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8627
cf7edc2a
AS
86282011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8629
8630 * editfns.c (Fformat): Correctly handle text properties on "%%".
8631
bd01620e
EZ
86322011-09-15 Eli Zaretskii <eliz@gnu.org>
8633
8634 * xterm.c (x_draw_composite_glyph_string_foreground):
8635 * w32term.c (x_draw_composite_glyph_string_foreground):
8636 * term.c (encode_terminal_code):
8637 * composite.c (composition_update_it, get_composition_id):
8638 * xdisp.c (get_next_display_element)
8639 (fill_composite_glyph_string): Add comments about special meaning
8640 of TAB characters in a composition.
8641
a02719a3
PE
86422011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8643
8644 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
8645 This occurs when processing a multibyte format.
8646 Problem reported by Wolfgang Jenker.
a02719a3 8647
72589a3c
JB
86482011-09-15 Johan Bockgård <bojohan@gnu.org>
8649
8650 * xdisp.c (try_cursor_movement): Only check for exact match if
8651 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8652
1c14176c
PE
86532011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8654
8655 Remove unused external symbols.
8656 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8657 * xdisp.c (calc_pixel_width_or_height): Now static.
8658 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8659 * indent.c (check_display_width):
8660 * w32term.c: Fix comment to match code.
8661 * xterm.c, xterm.h (x_catching_errors): Remove.
8662
d2eea5b5
PE
86632011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8664
8665 * xselect.c: Use signed conversions more consistently (Bug#9498).
8666 (selection_data_to_lisp_data): Assume incoming selection data are
8667 signed integers, not unsigned. This is to be consistent with
8668 outgoing selection data, which was modified to use signed integers
8669 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8670 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8671 expects long, not unsigned long.
8672
46888499
EZ
86732011-09-14 Eli Zaretskii <eliz@gnu.org>
8674
8675 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8676 computation of loop end. Reported by Johan Bockgård
8677 <bojohan@gnu.org>.
8678
ef8ef9fb
CY
86792011-09-13 Chong Yidong <cyd@stupidchicken.com>
8680
8681 * frame.c (Fother_visible_frames_p): Function deleted.
8682
fa819fed
EZ
86832011-09-12 Eli Zaretskii <eliz@gnu.org>
8684
8685 * indent.c (compute_motion): Process display vector front to back
8686 rather than the other way around. (Bug#2496)
8687
2ba8e008
SM
86882011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8689
8690 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8691
20f53c69
CY
86922011-09-11 Chong Yidong <cyd@stupidchicken.com>
8693
8694 * minibuf.c (Fread_from_minibuffer): Doc fix.
8695
d562d7a4
EZ
86962011-09-11 Eli Zaretskii <eliz@gnu.org>
8697
8698 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8699 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8700
1c4d7f3d
LMI
87012011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8702
8703 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8704 value for non-existent files.
8705
b885bf36
EZ
87062011-09-11 Eli Zaretskii <eliz@gnu.org>
8707
8708 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8709 set its "size" to -1. This will set the modtime_size field of
8710 the corresponding buffer to -1, which is what
8711 verify-visited-file-modtime expects for files that do not exist.
8712 (Bug#9139)
8713
6612f0bf
PE
87142011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8715
8716 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8717 here ...
8718 * lisp.h: ... from here. push_key_description is no longer
8719 defined in keyboard.c, so its declaration should not be in
8720 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8721 logically belongs with push_key_description.
8722
dfb3f755
PE
87232011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8724
8725 * buffer.h: Include <sys/types.h> instead of <time.h>.
8726 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8727 Problem reported by Herbert J. Skuhra.
8728
3134906c
LMI
87292011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8730
8731 * xml.c (parse_region): Make the parsing work for
8732 non-comment-starting XML files again (bug#9144).
8733
8d903f4e
AS
87342011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8735
8736 * image.c (gif_load): Fix calculation of bottom and right corner.
8737 (Bug#9468)
8738
80ad64f4
EZ
87392011-09-10 Eli Zaretskii <eliz@gnu.org>
8740
8741 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8742 redisplay in small windows.
8743
208a048d
EZ
87442011-09-09 Eli Zaretskii <eliz@gnu.org>
8745
8746 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8747
9b1c252e
MR
87482011-09-08 Martin Rudalics <rudalics@gmx.at>
8749
8750 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8751 Operate on live windows only.
8752
2949f33b
JB
87532011-09-08 Juanma Barranquero <lekktu@gmail.com>
8754
8755 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8756
e08dcafd
EZ
87572011-09-07 Eli Zaretskii <eliz@gnu.org>
8758
8759 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8760 only under bidi iteration.
8761
115b96bd
JD
87622011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8763
8764 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8765
c8199d0f
PE
87662011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8767
8768 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8769 Without this fix, the command to link temacs failed due to an
8770 undefined symbol __builtin_isnan. This is because
8771 /usr/include/iso/math_c99.h #defines isnan(x) to
8772 __builtin_isnan(x), but the bundled gcc, which identifies itself
8773 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8774 a __builtin_isnan.
8775 * floatfns.c (isnan): #undef, and then #define to a clone of
8776 what's in data.c.
8777 (Fisnan): Always define, since it's always available now.
8778 (syms_of_floatfns): Always define isnan at the Lisp level.
8779
e39b275c 87802011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
8781
8782 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8783
b2db44d9 87842011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 8785
f4af5137 8786 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
8787 The previous code assumed that file offsets (off_t values) fit in
8788 EMACS_INT variables, which is not true on typical 32-bit hosts.
8789 The code messed up by falsely reporting buffer overflow in cases
8790 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8791 when "big" contains more than 2**29 bytes, even though this
8792 inserts just one byte and does not overflow the buffer.
8793 (Finsert_file_contents): Store file offsets as off_t
8794 values, not as EMACS_INT values. Check for overflow when
8795 converting between EMACS_INT and off_t. When checking for
8796 buffer overflow or for overlap, take the offsets into account.
8797 Don't use EMACS_INT for small values where int suffices.
8798 When checking for overlap, fix a typo: ZV was used where
8799 ZV_BYTE was intended.
8800 (Fwrite_region): Don't assume off_t fits into 'long'.
8801 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8802
ecfc0a49
MA
88032011-09-05 Michael Albinus <michael.albinus@gmx.de>
8804
8805 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8806
6511acf2 88072011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 8808
0999621a 8809 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
8810
8811 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 8812 (esprintf, exprintf, evxprintf): New functions.
62f19c19 8813 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 8814 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
8815 (modify_event_symbol): Do not assume that the length of
8816 name_alist_or_stem is safe to alloca and fits in int.
8817 (Fexecute_extended_command): Likewise for function name and binding.
8818 (Frecursion_depth): Wrap around reliably on integer overflow.
8819 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8820 since some callers pass EMACS_INT values.
8821 (Fsingle_key_description): Don't crash if symbol name contains more
8822 than MAX_ALLOCA bytes.
8823 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8824 (get_minibuffer): Arg is now EMACS_INT, not int.
8825 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 8826 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
8827 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8828
2be7d702
PE
8829 * dbusbind.c (signature_cat): New function.
8830 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
8831 Do not overrun buffer; instead, report string overflow.
8832
9d1df220
PE
8833 * dispnew.c (add_window_display_history): Don't overrun buffer.
8834 Truncate instead; this is OK since it's just a log.
8835
33ef5c64
PE
8836 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8837 even if the time zone offset is outlandishly large.
8838 Don't mishandle offset == INT_MIN.
8839
66c6fdd5
PE
8840 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8841 when creating daemon; the previous buffer-overflow check was incorrect.
8842
d749b01b
PE
8843 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8844 which has the guts of the old verror function.
8845
b5cd1905
PE
8846 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8847 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
8848
6e1a67fb
PE
8849 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8850 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 8851 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 8852 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
8853 length of string rather than counting it via multiple sprintfs;
8854 that's simpler and more reliable.
c21721cc
PE
8855 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8856 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8857 sprintf, in case result does not fit in int.
8858
c57b67fc
PE
8859 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8860 (fontset_from_font): Print it.
8861
8a401434
PE
8862 * frame.c (tty_frame_count): Now printmax_t, not int.
8863 (make_terminal_frame, set_term_frame_name): Print it.
8864 (x_report_frame_params): In X, window IDs are unsigned long,
8865 not signed long, so print them as unsigned.
8866 (validate_x_resource_name): Check for implausibly long names,
8867 and don't assume name length fits in 'int'.
8868 (x_get_resource_string): Don't blindly alloca invocation name;
8869 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
8870 not fit in int.
8871
6e1a67fb
PE
8872 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8873 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
8874 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8875
0df02bf3
PE
8876 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8877 Use esprintf, not sprintf, in case result does not fit in int.
8878
48e30793
PE
8879 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8880 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8881 it as a large positive number.
8882 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8883 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8884
a66ff6d8
PE
8885 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8886 in case result does not fit in int.
8887
aca216ff
PE
8888 * print.c (float_to_string): Detect width overflow more reliably.
8889 (print_object): Make sprintf buffer a bit bigger, to avoid potential
8890 buffer overrun. Don't assume list length fits in 'int'. Treat
8891 print length of 0 as 0, not as infinity; to be consistent with other
8892 uses of print length in this function. Don't overflow print length
8893 index. Don't assume hash table size fits in 'long', or that
8894 vectorlike size fits in 'unsigned long'.
8895
31c286f7
PE
8896 * process.c (make_process): Use printmax_t, not int, to format
8897 process-name gensyms.
8898
55e5faa1
PE
8899 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
8900
80f2e268
PE
8901 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
8902 to avoid potential buffer overrun.
8903
670741ab
PE
8904 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
8905 if X resource line is longer than 512 bytes.
8906
b7163a50
PE
8907 * xfns.c (x_window): Make sprintf buffer a bit bigger
8908 to avoid potential buffer overrun.
8909
ae58ff1f
PE
8910 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
8911
c43c8a6a
PE
8912 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
8913
3f8236f4
PE
89142011-09-04 Paul Eggert <eggert@cs.ucla.edu>
8915
53e9fe90 8916 Integer overflow fixes for scrolling, etc.
6511acf2
PE
8917 Without these, Emacs silently mishandles large integers sometimes.
8918 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
8919 it were "C-u 1 M-x recenter" on a typical 64-bit host.
8920
6511acf2
PE
8921 * xdisp.c (try_window_id): Check Emacs fixnum range before
8922 converting to 'int'.
806add1d 8923
6511acf2 8924 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
8925 Check that an Emacs fixnum is in range before assigning it to 'int'.
8926 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
8927 values converted from Emacs fixnums.
8928 (Frecenter): Don't wrap around a line count if it is out of 'int'
8929 range; instead, treat it as an extreme value.
8930 (Fset_window_configuration, compare_window_configurations):
8931 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
8932
6511acf2
PE
8933 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
8934 that can exceed INT_MAX. Check that EMACS_INT value is in range
8935 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
8936 (match_limit): Don't assume that a fixnum can fit in 'int'.
8937
6511acf2 8938 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
8939 exceed INT_MAX.
8940
6511acf2 8941 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
8942 (Fvertical_motion): Don't wrap around LINES values that don't fit
8943 in 'int'. Instead, treat them as extreme values. This is good
8944 enough for windows, which can't have more than INT_MAX lines anyway.
8945
fcb901a7
LMI
89462011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
8947
0f2f6b6d
LMI
8948 * Require libxml/parser.h to avoid compilation warning.
8949
fcb901a7
LMI
8950 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
8951
8952 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
8953 since this reportedly can destroy thread storage.
8954
6e20a0d4
CY
89552011-08-30 Chong Yidong <cyd@stupidchicken.com>
8956
8957 * syntax.c (find_defun_start): Update all cache variables if
8958 exiting early (Bug#9401).
8959
148ae00e
EZ
89602011-08-30 Eli Zaretskii <eliz@gnu.org>
8961
f6cfbd8f
EZ
8962 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
8963
148ae00e
EZ
8964 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
8965 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
8966 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
8967
8968 * term.c (tty_append_glyph): New function.
8969 (produce_stretch_glyph): Static function and its prototype deleted.
8970
a66cfb1c
SM
8971 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
8972 Add prototypes.
148ae00e 8973
c4a07a4c
PE
89742011-08-29 Paul Eggert <eggert@cs.ucla.edu>
8975
8976 * image.c (parse_image_spec): Check for nonnegative, not for positive,
8977 when checking :margin (Bug#9390).
8978 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 8979 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
8980 so that the name doesn't mislead. All uses changed.
8981
6bc8cd65
JB
89822011-08-28 Johan Bockgård <bojohan@gnu.org>
8983
8984 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
8985 set_tty_hooks.
8986
dca4927e
EZ
89872011-08-27 Eli Zaretskii <eliz@gnu.org>
8988
8989 * xdisp.c (move_it_to): Don't bail out early when reaching
8990 position beyond to_charpos, if we are scanning backwards.
8991 (move_it_vertically_backward): When DY == 0, make sure we get to
8992 the first character in the line after the newline.
8993
f2cad773
PE
89942011-08-27 Paul Eggert <eggert@cs.ucla.edu>
8995
8996 * ccl.c: Improve and simplify overflow checking (Bug#9196).
8997 (ccl_driver): Do not generate an out-of-range pointer.
8998 (Fccl_execute_on_string): Remove unnecessary check for
8999 integer overflow, noted by Stefan Monnier in
9000 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9001 Remove a FIXME that didn't need fixing.
9002 Simplify the newly-introduced buffer reallocation code.
9003
0cae2cdb
JB
90042011-08-27 Juanma Barranquero <lekktu@gmail.com>
9005
9006 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9007
5fc295a4 90082011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 9009
70c60eb2 9010 Integer and memory overflow issues (Bug#9196).
726e0ab1 9011
d31850da
PE
9012 * doc.c (get_doc_string): Rework so that
9013 get_doc_string_buffer_size is the actual buffer size, rather than
9014 being 1 less than the actual buffer size; this makes xpalloc more
9015 convenient.
9016
a69fbedb
PE
9017 * image.c (x_allocate_bitmap_record, cache_image):
9018 * xselect.c (Fx_register_dnd_atom):
9019 Simplify previous changes by using xpalloc.
9020
fe5c5d37
PE
9021 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9022 since either will do and ptrdiff_t is convenient with xpalloc.
9023
0065d054
PE
9024 * charset.c (charset_table_size)
9025 (struct charset_sort_data.priority): Now ptrdiff_t.
9026 (charset_compare): Don't overflow if priorities differ greatly.
9027 (Fsort_charsets): Don't assume list length fits in int.
9028 Check for size-calculation overflow when allocating sort data.
9029 (syms_of_charset): Allocate an initial charset table that is
9030 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9031
9032 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9033
9034 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9035 The actual value is always <= INT_MAX, and leaving it unsigned made
9036 overflow checking harder.
9037
9038 * dispextern.h (struct glyph_matrix.rows_allocated)
9039 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9040 with xpalloc. The values are still always <= INT_MAX.
9041
9042 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9043
9044 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9045 (SAFE_NALLOCA): New macro.
9046
9047 * region-cache.c (struct boundary.pos, find_cache_boundary)
9048 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9049 (set_cache_region, invalidate_region_cache)
9050 (revalidate_region_cache, know_region_cache, region_cache_forward)
9051 (region_cache_backward, pp_cache):
9052 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9053 so that ptrdiff_t * can be passed to xpalloc.
9054 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9055 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9056 (pp_cache): Don't assume cache_len fits in int.
9057 * region-cache.h: Adjust extern decls to match.
9058
9059 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9060 EMACS_INT, since either will do, for xpalloc.
9061
9062 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9063 (xnmalloc, xnrealloc, xpalloc): New functions.
9064
726e0ab1
PE
9065 * bidi.c (bidi_shelve_header_size): New constant.
9066 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9067 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9068
51f30bc5 9069 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
9070 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9071 (overlay_strings):
9072 Don't update size of array until after memory allocation succeeds,
9073 because xmalloc/xrealloc may not return.
0065d054
PE
9074 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9075 now that we have proper integer overflow checking.
9076 (record_overlay_string, overlay_strings): Catch overflows when
9077 calculating size of overlay_str_buf.
726e0ab1 9078
0065d054
PE
9079 * callproc.c (Fcall_process): Check for size overflow when
9080 calculating size of args2.
9081 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9082 Normally we prefer signed values, but sticking with ptrdiff_t would
9083 require adding more-complicated checks.
726e0ab1
PE
9084
9085 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9086 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9087 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 9088 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
9089
9090 * character.c (Fstring): Check for size-calculation overflow.
9091
9092 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9093 unnecessary integer overflow. Check for size overflow.
9094 (encode_coding_object): Don't update size until xmalloc succeeds.
9095
9096 * composite.c (get_composition_id): Check for overflow in glyph
9097 length calculations.
9098
9099 Integer and memory overflow fixes for display code.
9100 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9101 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9102 (scrolling_window): Check for overflow in size calculations.
9103 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9104 Don't assume glyph table len fits in int.
9105 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9106 (row_table_size): Now ptrdiff_t, not int.
9107 (scrolling_window): Avoid overflow in size calculations.
9108 Don't update size until allocation succeeds.
9109 * fns.c (concat): Check for overflow in size calculations.
9110 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9111 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9112 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9113
9114 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9115 (get_doc_string): Check for size calculation overflow.
9116 Don't update size until allocation succeeds.
9117 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9118 EMACS_INT, where ptrdiff_t will do.
9119 (Fsubstitute_command_keys): Check for string overflow.
9120
9121 * editfns.c (set_time_zone_rule): Don't assume environment length
9122 fits in int.
9123 (message_length): Now ptrdiff_t, not int.
9124 (Fmessage_box): Don't update size until allocation succeeds.
9125 Don't assume message length fits in int.
9126 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9127
0065d054
PE
9128 * emacs.c (main): Do not reallocate argv, since there is a null at
9129 the end that can be overwritten, and this way there's no need to
9130 worry about size-calculation overflow.
9131 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
9132
9133 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9134 alloc succeeds.
9135 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9136
9137 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9138 (x_set_scroll_bar_width, x_figure_window_size):
9139 Check for integer overflow.
9140 (x_set_alpha): Do not assume XINT fits in int.
9141
9142 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9143 This is for the members text_lines, text_cols, total_lines, total_cols,
9144 where the system imposes an 'int' limit.
9145
9146 * fringe.c (Fdefine_fringe_bitmap):
9147 Don't update size until alloc works.
9148
9149 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9150 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9151
9152 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9153 Check for size-calculation overflow.
9154 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9155 do, as we prefer signed integers.
9156 (id_to_widget.max_size, id_to_widget.used)
9157 (xg_store_widget_in_map, xg_remove_widget_from_map)
9158 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9159 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9160 Use and return ptrdiff_t, not int.
9161 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9162 * gtkutil.h: Change prototypes to match the above.
9163
9164 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9165 are duplicate now that they've been promoted to lisp.h.
9166 (x_allocate_bitmap_record, x_alloc_image_color)
9167 (make_image_cache, cache_image, xpm_load):
9168 Don't update size until alloc is done.
9169 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9170 (x_detect_edges):
3256efce 9171 Check for size calculation overflow.
726e0ab1
PE
9172 (ct_colors_allocated_max): New constant.
9173 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9174 overflow.
3256efce 9175
726e0ab1
PE
9176 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9177 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9178 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9179 Use ptrdiff_t, not int, to count maps.
9180 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
9181 calculations. Don't update size until allocation succeeds.
9182 Redo calculations to avoid overflow.
726e0ab1
PE
9183 * keyboard.h: Change prototypes to match the above.
9184
9185 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9186 to count maps.
9187 (current_minor_maps): Check for size calculation overflow.
9188 * keymap.h: Change prototypes to match the above.
9189
9190 * lread.c (read1, init_obarray): Don't update size until alloc done.
9191
9192 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9193 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9194
726e0ab1
PE
9195 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9196 Now ptrdiff_t, not int.
9197 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9198 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9199
9200 * process.c (Fnetwork_interface_list): Check for overflow
9201 in size calculation.
9202
9203 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9204
9205 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9206 overflow. Don't bother calling xmalloc when xrealloc will do.
9207
9208 * search.c (Freplace_match): Check for size calculation overflow.
9209 (Fset_match_data): Don't assume list lengths fit in 'int'.
9210
9211 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9212 for command line length. Do not attempt to address one before the
9213 beginning of an array, as that's not portable.
9214
9215 * term.c (max_frame_lines): Remove; unused.
9216 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9217 not int.
9218 (encode_terminal_code, calculate_costs): Check for size
9219 calculation overflow.
9220 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9221 table lengths and related sizes. Don't update size until alloc
9222 done. Redo calculations to avoid overflow.
9223 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9224
9225 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9226 subtracting pointers.
9227 (gobble_line): Check for overflow more carefully. Don't update size
9228 until alloc done.
9229
9230 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9231 Don't update size until alloc done.
9232 Redo size calculations to avoid overflow.
9233 Check for size calculation overflow.
0065d054 9234 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
9235
9236 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9237 Use ptrdiff_t, not int, for sizes.
9238 (store_mode_line_noprop_char): Don't update size until alloc done.
9239
0065d054
PE
9240 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9241 Use ptrdiff_t, not int, for sizes.
9242 (Finternal_make_lisp_face, cache_face):
9243 Check for size calculation overflow.
9244 (cache_face): Treat size calculation overflows as if they were
9245 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
9246
9247 * xfns.c (x_encode_text, x_set_name_internal)
9248 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9249 sizes, since they can exceed INT_MAX in size. Check for size
9250 calculation overflow.
9251
0065d054
PE
9252 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9253 (xg_select): Check for size calculation overflow.
726e0ab1
PE
9254 Don't update size until alloc done.
9255
0065d054 9256 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 9257 as sprintf is limited to int lengths.
1d526e2f 9258
252c5ee1
PE
9259 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9260 (X_LONG_MIN): New macros.
864d7ce7
PE
9261 Use them to make the following changes clearer.
9262 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9263 This change doesn't affect the value now, but it may help remind
9264 future maintainers not to raise the value too much later.
9265 (SELECTION_QUANTUM): Remove, replacing with ...
9266 (selection_quantum): ... new function, which avoids overflow.
9267 All uses changed.
9268 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9269 assumption that selection length fits in 'int'.
9270 (x_reply_selection_request, x_handle_selection_request)
9271 (x_get_window_property, receive_incremental_selection)
9272 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9273 (lisp_data_to_selection_data, clean_local_selection_data):
9274 Use ptrdiff_t, not int, to record length of selection.
9275 (x_reply_selection_request, x_get_window_property)
9276 (receive_incremental_selection, x_property_data_to_lisp):
9277 Redo calculations to avoid overflow.
9278 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 9279 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
9280 something.
9281 (x_get_window_property, receive_incremental_selection)
9282 (lisp_data_to_selection_data, x_property_data_to_lisp):
9283 Check for size-calculation overflow.
9284 (x_get_window_property, receive_incremental_selection)
9285 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9286 Don't store size until memory allocation succeeds.
9287 (x_get_window_property): Plug memory leak on memory exhaustion.
9288 Don't double-block input; malloc is safe here. Don't assume 2**34
9289 - 4 fits in unsigned long. Add an xassert to check
9290 XGetWindowProperty overflow. Be more careful about overflow
9291 calculations, and distinguish size from memory overflow better.
9292 (receive_incremental_selection): When tracing, don't assume
9293 unsigned int is less than INT_MAX.
9294 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9295 harmful) conversions of unsigned short to int.
9296 (lisp_data_to_selection_data): Don't assume that integers
9297 in the range -65535 through -1 fit in an X unsigned short.
9298 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9299 result parameters unless successful. Rely on cons_to_unsigned
9300 to report problems with elements; the old code wasn't right anyway.
9301 (x_check_property_data): Check for int overflow; we cannot use
9302 a wider type due to X limits.
9303 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9304
726e0ab1 9305 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 9306
0065d054
PE
9307 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9308 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
9309 (x_color_cells): Don't store size until memory allocation succeeds.
9310 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 9311 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
9312 (x_term_init): Don't assume length fits in int (sprintf is limited
9313 to int size).
bc18e09d 9314
ebfa62c0
PE
9315 Use ptrdiff_t for composition IDs.
9316 * character.c (lisp_string_width):
9317 * composite.c (composition_table_size, n_compositions)
9318 (get_composition_id, composition_gstring_from_id):
9319 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9320 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9321 * window.c (Frecenter):
9322 Use ptrdiff_t, not int, for composition IDs.
9323 * composite.c (get_composition_id): Check for integer overflow.
9324 * composite.h: Adjust prototypes to match the above changes.
9325
d3411f89
PE
9326 Use ptrdiff_t for hash table indexes.
9327 * category.c (hash_get_category_set):
9328 * ccl.c (ccl_driver):
9329 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9330 * coding.c (coding_system_charset_list, detect_coding_system):
9331 * coding.h (struct coding_system.id):
9332 * composite.c (get_composition_id, gstring_lookup_cache):
9333 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9334 * image.c (xpm_get_color_table_h):
9335 * lisp.h (hash_lookup, hash_put):
9336 * minibuf.c (Ftest_completion):
9337 Use ptrdiff_t for hash table indexes, not int (which is too
9338 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9339 32-bit --with-wide-int hosts).
9340
e097a6fa
PE
9341 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9342 Add a FIXME comment about memory leaks.
9343 (syms_of_charset): Don't assume xmalloc returns.
9344
5637687f
PE
9345 Don't assume that stated character widths fit in int.
9346 * character.c (Fchar_width, c_string_width, lisp_string_width):
9347 * character.h (CHAR_WIDTH):
9348 * indent.c (MULTIBYTE_BYTES_WIDTH):
9349 Use sanitize_char_width to avoid undefined and/or bad behavior
9350 with outlandish widths.
a66cfb1c 9351 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
9352 now that we have two such functions. All uses changed.
9353 (sanitize_char_width): New inline function.
9354
a2271ba2
PE
9355 Don't assume that tab-width fits in int.
9356 * character.h (sanitize_width): New inline function.
9357 (SANE_TAB_WIDTH): New macro.
9358 (ASCII_CHAR_WIDTH): Use it.
9359 * indent.c (sane_tab_width): Remove. All uses replaced by
9360 SANE_TAB_WIDTH (current_buffer).
9361 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9362
18c52557
PE
9363 * fileio.c: Integer overflow issues with file modes.
9364 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9365
caeeedc1
PE
9366 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9367 Remove unreachable code.
9368 (read_hex, load_charset_map_from_file): Check for integer overflow.
9369
6df6ae42 9370 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
9371 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9372 (x_send_scroll_bar_event): Likewise. Check that the size does not
9373 exceed limits imposed by XClientMessageEvent, as well as the usual
9374 ptrdiff_t and size_t limits.
9375
b13995db
PE
9376 * keyboard.c: Overflow, signedness and related fixes.
9377 (make_lispy_movement): Use same integer type in forward decl
9378 that is used in the definition.
9379 (read_key_sequence, keyremap_step):
9380 Change bufsize argument back to int, undoing my 2011-03-30 change.
9381 We prefer signed types, and int is wide enough here.
9382 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9383 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9384 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9385 length, not size_t. Use ptrdiff_t for index, not int.
9386 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9387 possibility of integer overflow.
9388
13464394
PE
9389 Overflow, signedness and related fixes for images.
9390
9391 * dispextern.h (struct it.stack[0].u.image.image_id)
9392 (struct_it.image_id, struct image.id, struct image_cache.size)
9393 (struct image_cache.used, struct image_cache.ref_count):
9394 * gtkutil.c (update_frame_tool_bar):
9395 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9396 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9397 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9398 * nsmenu.m (update_frame_tool_bar):
9399 * xdisp.c (calc_pixel_width_or_height):
9400 * xfns.c (image_cache_refcount):
9401 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9402 on typical 64-bit hosts.
9403
9404 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9405 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9406 Omit unnecessary casts to int.
9407 (parse_image_spec): Check that integers fall into 'int' range
9408 when the callers expect that.
9409 (image_ascent): Redo ascent calculation to avoid int overflow.
9410 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9411 (lookup_image): Remove unnecessary tests.
9412 (xbm_image_p): Locals are now of int, not EMACS_INT,
9413 since parse_image_check makes sure they fit into int.
9414 (png_load, gif_load, svg_load_image):
9415 Prefer int to unsigned where either will do.
9416 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
9417 old tiff_error_handler and tiff_warning_handler.
9418 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
9419 stack buffer overflows. It uses only the features of vsnprintf
9420 that are common to both POSIX and native Microsoft.
9421 (tiff_error_handler, tiff_warning_handler): Use it.
9422 (tiff_load, gif_load, imagemagick_load_image):
9423 Don't assume :index value fits in 'int'.
9424 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9425 (imagemagick_load_image): Check that crop parameters fit into
9426 the integer types that MagickCropImage accepts. Don't assume
9427 Vimagemagick_render_type has a nonnegative value. Don't assume
9428 size_t fits in 'long'.
9429 (gs_load): Use printmax_t to print the widest integers possible.
9430 Check for integer overflow when computing image height and width.
9431
c11821d4
EZ
94322011-08-26 Eli Zaretskii <eliz@gnu.org>
9433
9434 * xdisp.c (redisplay_window): Don't force window start if point
9435 will be invisible in the resulting window. (Bug#9324)
9436
0c95fcf7
EZ
94372011-08-25 Eli Zaretskii <eliz@gnu.org>
9438
9439 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9440 the display spec is of the form `(space ...)'.
9441 (handle_display_spec): Return the value returned by
9442 handle_single_display_spec, not just 1 or zero.
9443 (handle_single_display_spec): If the display spec is of the form
9444 `(space ...)', and specifies display in the text area, return 2
9445 rather than 1.
fee65a97 9446 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
9447 accurately, and prefer exact match for point under bidi.
9448 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
9449
9450 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9451 into disp_prop; all users changed.
9452
9453 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9454 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9455 for the text covered by the display property.
9456
e4ed06f1
CY
94572011-08-25 Chong Yidong <cyd@stupidchicken.com>
9458
9459 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9460 Change return value to nil.
9461 (Frecord_buffer): Delete unused function.
9462
f67cdd7f
EZ
94632011-08-24 Eli Zaretskii <eliz@gnu.org>
9464
5980d4c6
EZ
9465 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9466 buffers, return left-to-right.
8610fe8b
EZ
9467 (set_cursor_from_row): Consider candidate row a win if its glyph
9468 represents a newline and point is on that newline. Fixes cursor
9469 positioning on the newline at EOL of R2L text within L2R
9470 paragraph, and vice versa.
9471 (try_cursor_movement): Check continued rows, in addition to
9472 continuation rows. Fixes unwarranted scroll when point enters a
9473 continued line of R2L text within an L2R paragraph, or vice versa.
9474 (cursor_row_p): Consider the case of point being equal to
9475 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9476 from the end of a short line to the beginning of a continued line
9477 of R2L text within L2R paragraph.
9478 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9479 composed characters.
5980d4c6 9480
f67cdd7f
EZ
9481 * bidi.c (bidi_check_type): Use xassert.
9482 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9483 members.
9484
bca633fb
EZ
94852011-08-23 Eli Zaretskii <eliz@gnu.org>
9486
9487 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9488 a character.
9489
4a5885a7
CY
94902011-08-23 Chong Yidong <cyd@stupidchicken.com>
9491
9492 * nsfont.m (ns_otf_to_script): Fix typo.
9493
0902a04e
KH
94942011-08-22 Kenichi Handa <handa@m17n.org>
9495
9496 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9497 extra slot even if the purpose is char-code-property-table.
9498
1a2e6670
EZ
94992011-08-23 Eli Zaretskii <eliz@gnu.org>
9500
8ddde651
EZ
9501 * xdisp.c (redisplay_window): When computing centering_position,
9502 account for the height of the header line. (Bug#8874)
9503
425cc014
EZ
9504 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9505 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9506 candidate is selected by the mouse, and that candidate has a
9507 composed character under the mouse.
9508
1a2e6670
EZ
9509 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9510 coordinates reported by pos-visible-in-window-p for a composed
9511 character in column zero.
9512
8b76d6f8
SM
95132011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9514
9515 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9516
dac347dd
EZ
95172011-08-22 Eli Zaretskii <eliz@gnu.org>
9518
9519 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9520 consider it a hit if to_charpos is anywhere in the range of the
9521 composed buffer positions.
9522
e013fb34
CY
95232011-08-22 Chong Yidong <cyd@stupidchicken.com>
9524
9525 * image.c (gif_load): Don't assume that each subimage has the same
9526 dimensions as the base image. Handle disposal method that is
9527 "undefined" by the gif spec (Bug#9335).
9528
bd1ba3e8
CY
95292011-08-20 Chong Yidong <cyd@stupidchicken.com>
9530
9531 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 9532 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 9533
54a1215b
EZ
95342011-08-19 Eli Zaretskii <eliz@gnu.org>
9535
823564e5
EZ
9536 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9537 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9538 from an Org mode buffer to a Speedbar frame.
9539
54a1215b
EZ
9540 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9541 a composition, take its buffer position from IT->cmp_it.charpos.
9542 Fixes cursor positioning at the beginning of a line that begins
9543 with a composed character.
9544
9778ebcc
EZ
95452011-08-18 Eli Zaretskii <eliz@gnu.org>
9546
0be6ee06
EZ
9547 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9548 character bidirectional type, use STRONG_L instead. Fixes crashes
9549 in a buffer produced by `describe-categories'.
9550
9778ebcc
EZ
9551 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9552 members before the level stack, so they would be saved and
9553 restored when copying iterator state. Fixes incorrect reordering
9554 around TABs covered by display properties.
9555
156bffbe
AS
95562011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9557
6b02f655 9558 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 9559
72ad093b
CY
95602011-08-17 Chong Yidong <cyd@stupidchicken.com>
9561
9562 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
9563 (internal_condition_case_2, internal_condition_case_n):
9564 Remove unnecessary aborts (Bug#9081).
72ad093b 9565
35774242
EZ
95662011-08-17 Eli Zaretskii <eliz@gnu.org>
9567
9568 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9569 has no `load' handler, try opening the file locally. (Bug#9311)
9570
db76dd85
KB
95712011-08-16 Ken Brown <kbrown@cornell.edu>
9572
9573 * gmalloc.c: Expand comment.
9574
b215eee5
EZ
95752011-08-16 Eli Zaretskii <eliz@gnu.org>
9576
9577 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9578 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9579
a4579d33
KB
95802011-08-16 Ken Brown <kbrown@cornell.edu>
9581
9582 Fix memory allocation problems in Cygwin build (Bug#9273).
9583
9584 * unexcw.c ( __malloc_initialized): Declare external variable.
9585 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9586
8b76d6f8
SM
9587 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9588 New variables.
a4579d33
KB
9589 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9590 dumped emacs.
9591 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9592 in the static heap.
9593 [CYGWIN] (special_realloc): New function.
9594 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9595 requests to realloc storage in the static heap.
9596
3ebec551
PE
95972011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9598
9599 * bidi.c (bidi_initialize): Remove unused local.
9600
9fd8be00
EZ
96012011-08-15 Eli Zaretskii <eliz@gnu.org>
9602
6b02f655
SM
9603 * bidimirror.h:
9604 * biditype.h: Remove file.
9605 * makefile.w32-in ($(BLD)/bidi.$(O)):
9606 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
9607
9608 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9609
9610 * chartab.c: Improve commentary for the uniprop_table API.
9611
32413314
EZ
9612 * bidi.c (bidi_paragraph_init): Support zero value of
9613 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
9614 (bidi_initialize): Use uniprop_table instead of including
9615 biditype.h and bidimirror.h.
32413314 9616
9fd8be00
EZ
9617 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9618 coordinates of the iterator when restoring from ppos_it.
9619 (Bug#9296)
9620
5cf2b69b
KH
96212011-08-14 Kenichi Handa <handa@m17n.org>
9622
9623 * process.c (create_process): Call setup_process_coding_systems
72ad093b 9624 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 9625
daf17d00
EZ
96262011-08-14 Eli Zaretskii <eliz@gnu.org>
9627
9628 * xdisp.c (move_it_in_display_line_to): Don't invoke
9629 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9630 ppos_it. Fixes vertical cursor motion when line beginning is
9631 covered by an image. (Bug#9296)
9632
08e3161a
JD
96332011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9634
9635 * nsterm.h (ns_run_ascript): Declare.
9636 (NSAPP_DATA2_RUNASSCRIPT): Define.
9637
9638 * nsfns.m (as_script, as_result, as_status): New static variables.
9639 (ns_run_ascript): New function.
5e617bc2 9640 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
9641 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9642 the event loop. Get status from as_status (Bug#7276).
9643
9644 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9645 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9646 the event loop (Bug#7276).
9647
a3720aa2
AS
96482011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9649
9650 * gnutls.c (QCgnutls_bootprop_priority)
9651 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9652 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9653 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9654 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9655 (QCgnutls_bootprop_verify_hostname_error)
9656 (QCgnutls_bootprop_callbacks_verify): Rename from
9657 Qgnutls_bootprop_..., all uses changed.
9658
9659 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9660 uses changed.
9661
0a0d27fb
PE
96622011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9663
19d5c50c
PE
9664 * xfaces.c (Qframe_set_background_mode): Now static.
9665 * dispextern.h (Qframe_set_background_mode): Remove decl.
9666
0a0d27fb
PE
9667 * process.c (Fnetwork_interface_info): Declare local only if needed.
9668
377538cb
JD
96692011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9670
9671 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9672 (Fnetwork_interface_list): Allocate in increments of bytes instead
9673 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9674 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9675 sockaddr.
9676 (struct ifflag_def): notrailers is smart on OSX.
9677 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9678 Get hardware address with getifaddrs if available.
9679
08fff70c
EZ
96802011-08-12 Eli Zaretskii <eliz@gnu.org>
9681
9682 * xdisp.c (iterate_out_of_display_property): xassert that
9683 IT->position is set to within IT->object's boundaries. Break from
9684 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
9685 when IT->position is set up wrongly due to some bug.
9686 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
9687 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9688 entry. Force push_it to save on the stack the current
9689 buffer/string position, to be restored by pop_it. Fix flags in
9690 the iterator structure wrt the object coming from a display
9691 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9692 properties. (Bug#9284)
9693
7be1c708 96942011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 9695
7be1c708
CY
9696 * fontset.c (fontset_get_font_group): Add proper type checks.
9697 (Bug#9172)
aac0c6e3 9698
7be1c708 96992011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 9700
7be1c708
CY
9701 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9702 and LC_VERSION_MIN_MACOSX.
9703 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9704 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 9705
97bb72a6
EZ
97062011-08-08 Eli Zaretskii <eliz@gnu.org>
9707
9708 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
9709 no-display-properties-and-no-overlays under bidi display.
9710 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 9711 properties and overlays.
97bb72a6 9712
d5617611
CY
97132011-08-08 Chong Yidong <cyd@stupidchicken.com>
9714
37e11a63
CY
9715 * editfns.c (Fset_time_zone_rule): Document relationship with the
9716 setenv function.
9717
d5617611
CY
9718 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9719 the font entity extracted from the cache (Bug#8109).
9720
58872834
CY
97212011-08-07 Chong Yidong <cyd@stupidchicken.com>
9722
9723 * composite.c (autocmp_chars): Don't reset point. That is done by
9724 restore_point_unwind (Bug#5984).
9725
75bfc667
JL
97262011-08-07 Juri Linkov <juri@jurta.org>
9727
9728 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9729 to show the arg `TIME' instead of `TIMEVAL'.
9730
d1410150
EZ
97312011-08-06 Eli Zaretskii <eliz@gnu.org>
9732
9733 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9734 display property strides EOL and includes a newline, as in
9735 longlines-mode. (Bug#9254)
75b771e4
EZ
9736 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9737 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
9738
9739 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9740 is non-zero, even if the data buffer is NULL. Fixes a crash in
9741 vertical-motion with longlines-mode. (Bug#9254)
9742
35928349
EZ
97432011-08-05 Eli Zaretskii <eliz@gnu.org>
9744
ec7cc85b
EZ
9745 * bidi.c <bidi_cache_total_alloc>: Now static.
9746 (bidi_initialize): Initialize bidi_cache_total_alloc.
9747
8b76d6f8 9748 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
9749 cache. (Bug#9221)
9750
9751 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9752 amount allocated this far in `bidi_cache_total_alloc'.
9753 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9754 non-zero, only free the data buffer without restoring the cache
9755 contents. All callers changed.
9756
9757 * dispextern.h (bidi_unshelve_cache): Update prototype.
9758
9759 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9760 (move_it_in_display_line, move_it_to)
9761 (move_it_vertically_backward, move_it_by_lines): Replace the call
9762 to xfree to an equivalent call to bidi_unshelve_cache.
9763 (move_it_in_display_line_to): Fix logic of returning
412b6358 9764 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 9765
e2e2423b
EZ
97662011-08-05 Eli Zaretskii <eliz@gnu.org>
9767
9768 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9769 came from a string character with a `cursor' property. (Bug#9229)
9770
ae9e757a
JD
97712011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9772
9773 * Makefile.in (LIB_PTHREAD): New variable.
9774 (LIBES): Add LIB_PTHREAD (Bug#9216).
9775
9776 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9777 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9778
213bd7f2
AS
97792011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9780
6b02f655 9781 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 9782
99aaf75f
JD
97832011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9784
9785 * xterm.c (x_find_topmost_parent): New function.
9786 (x_set_frame_alpha): Find topmost parent window with
9787 x_find_topmost_parent and set the property there also (bug#9181).
9788 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9789
c74e9d86
PE
97902011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9791
9792 * callproc.c (Fcall_process): Avoid vfork clobbering
9793 the local vars buffer, coding_systems, current_dir.
9794
640c8776
SM
97952011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9796
9797 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9798
f26d0e4c
PE
97992011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9800
8a10d76c
PE
9801 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9802 so that it is not optimized away.
9803
f26d0e4c
PE
9804 * xdisp.c (compute_display_string_pos): Remove unused local.
9805
55439c61
EZ
98062011-08-02 Eli Zaretskii <eliz@gnu.org>
9807
9808 Fix slow cursor motion and scrolling in large buffers with
9809 selective display, like Org Mode buffers. (Bug#9218)
9810
9811 * dispextern.h (struct bidi_it): New member disp_prop_p.
9812
9813 * xdisp.c: Remove one-slot cache of display string positions.
9814 (compute_display_string_pos): Accept an additional argument
5e617bc2 9815 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
9816 for a display string or property. If found, set DISP_PROP_P
9817 non-zero.
9818
9819 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
9820 DISP_PROP_P, and pass it to compute_display_string_pos.
9821 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
9822 non-zero. All callers of bidi_fetch_char changed.
9823
fb33fa43
SM
98242011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9825
9826 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9827
b099e063
DM
98282010-12-03 Don March <don@ohspite.net>
9829
9830 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9831 last character M-[char] is translated to ESC [char] (bug#7541).
9832
5cc7f7af
KH
98332011-08-02 Kenichi Handa <handa@m17n.org>
9834
d0fffa3f 9835 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
9836
9837 * chartab.c (uniprop_table): Make it non-static.
9838
525d5e6e
EZ
98392011-08-01 Eli Zaretskii <eliz@gnu.org>
9840
9841 * xdisp.c (forward_to_next_line_start): Accept additional argument
9842 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9843 on the newline.
9844 (reseat_at_next_visible_line_start): Use the bidi iterator state
9845 returned by forward_to_next_line_start to restore the state of
9846 it->bidi_it after backing up to previous newline. (Bug#9212)
9847
31011111
AS
98482011-07-30 Andreas Schwab <schwab@linux-m68k.org>
9849
9850 * regex.c (re_comp): Protoize.
9851 (re_exec): Fix return type.
9852 (regexec): Fix type of `ret'. (Bug#9203)
9853
476371c4
PE
98542011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9855
e5d76069
PE
9856 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9857 This is needed if max-image-size is a floating-point number.
9858
9a79b20c
AS
98592011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9860
9861 * print.c (print_object): Print empty symbol as ##.
9862
9863 * lread.c (read1): Read ## as empty symbol.
9864
d8c2fa78
AA
98652011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9866
9867 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9868 setting frame foreground color (Bug#9175).
9869 (x_set_background_color): Likewise.
9870
ffe57a7a
AA
9871 * nsmenu.m (-setText): Size tooltip dimensions precisely to
9872 contents (Bug#9176).
9873 (EmacsTooltip -init): Remove bezels and add shadows to
9874 tooltip windows.
9875
bf3492a5
AA
9876 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9877 or scroll bar (Bug#8470).
9878
d55e9c53
AA
9879 * nsfont.m (nsfont_open): Remove assignment to voffset and
9880 unnecessary vars hshink, expand, hd, full_height, min_height.
9881 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9882
9883 * nsterm.h (nsfont_info): Remove voffset field.
9884
d8c2fa78 98852011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
9886
9887 Implement strike-through and overline on NextStep (Bug#8863).
9888
9889 * nsfont.m (nsfont_open): Use underline position provided by font,
9890 instead of hard-coded value of 2.
9891 (nsfont_draw): Call ns_draw_text_decoration instead.
9892
9893 * nsterm.h: Add declaration for ns_draw_text_decoration.
9894
9895 * nsterm.m (ns_draw_text_decoration): New function for drawing
9896 underline, overline, and strike-through.
9897 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9898 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 9899 accommodate underlining, etc.
4843aac3 9900
4cc60b9b
EZ
99012011-07-28 Eli Zaretskii <eliz@gnu.org>
9902
bc7ece87
EZ
9903 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
9904 default.
4cc60b9b 9905
476371c4
PE
99062011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9907
66606eea
PE
9908 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
9909 Without this fix, if a signal arrives just after memory fills up,
9910 'malloc' might be invoked reentrantly.
9911
476371c4
PE
9912 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
9913 In other words, assume that every image size is allowed, on non-X
9914 hosts. This assumption is probably wrong, but it lets Emacs compile.
9915
f3fcc40d
AS
99162011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9917
9918 * regex.c (re_iswctype): Convert return values to boolean.
9919
350c992f
EZ
99202011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
9921
9922 * xdisp.c (compute_display_string_pos): Don't use cached display
9923 string position if the buffer had its restriction changed.
9924 (Bug#9184)
9925
5266b4bb
PE
99262011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9927
9928 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
9929
2573a837 99302011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 9931
41f55ccd 9932 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 9933
39e378da
PE
9934 * bidi.c: Integer size and overflow fixes.
9935 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
9936 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
9937 (bidi_cache_find_level_change, bidi_cache_ensure_space)
9938 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
9939 (bidi_find_other_level_edge):
9940 Use ptrdiff_t instead of EMACS_INT where either will do.
9941 This works better on 32-bit hosts configured --with-wide-int.
9942 (bidi_cache_ensure_space): Check for size-calculation overflow.
9943 Use % rather than repeated addition, for better worst-case speed.
9944 Don't set bidi_cache_size until after xrealloc returns, because it
9945 might not return.
9946 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
9947 (bidi_cache_ensure_space): Also check that the bidi cache size
9948 does not exceed that of the largest Lisp string or buffer. See Eli
9949 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 9950
5e927815
PE
9951 * alloc.c (__malloc_size_t): Remove.
9952 All uses replaced by size_t. See Andreas Schwab's note
9953 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
9954
ca4aa935
PE
9955 * image.c: Improve checking for integer overflow.
9956 (check_image_size): Assume that f is nonnull, since
9957 it is always nonnull in practice. This is one less thing to
9958 worry about when checking for integer overflow later.
9959 (x_check_image_size): New function, which checks for integer
9960 overflow issues inside X.
9961 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
9962 This removes the need for a memory_full check.
9963 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
9964 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
9965 (xbm_read_bitmap_data): Change locals back to 'int', since
9966 their values must fit in 'int'.
9967 (xpm_load_image, png_load, tiff_load):
9968 Invoke x_create_x_image_and_pixmap earlier,
9969 to avoid much needless work if the image is too large.
9970 (tiff_load): Treat overly large images as if
9971 x_create_x_image_and_pixmap failed, not as malloc failures.
9972 (gs_load): Use x_check_image_size.
9973
5f8f9cc2
PE
9974 * gtkutil.c: Omit integer casts.
9975 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
9976 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
9977
5adf60bc
PE
9978 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
9979
c8907a93
PE
9980 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
9981 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
9982 would wrongly return t on a 64-bit host.
9983
e3c25c68
PE
9984 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
9985 The plain *_OVERFLOW macros run afoul of GCC bug 49705
9986 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
9987 and therefore cause GCC to emit a bogus diagnostic in some cases.
9988
3f791afe
PE
9989 * image.c: Integer signedness and overflow and related fixes.
9990 This is not an exhaustive set of fixes, but it's time to
9991 record what I've got.
9992 (lookup_pixel_color, check_image_size): Remove redundant decls.
9993 (check_image_size): Don't assume that arbitrary EMACS_INT values
9994 fit in 'int', or that arbitrary 'double' values fit in 'int'.
9995 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
9996 (tiff_load, imagemagick_load_image):
9997 Check for overflow in size calculations.
9998 (x_create_x_image_and_pixmap): Remove unnecessary test for
9999 xmalloc returning NULL; that can't happen.
10000 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10001 (xpm_color_bucket): Use better integer hashing function.
10002 (xpm_cache_color): Don't possibly over-allocate memory.
10003 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10004 (gif_memory_source):
10005 Use ptrdiff_t, not int or size_t, to record sizes.
10006 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10007 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10008 either works, as we prefer signed integers.
10009 (tiff_read_from_memory, tiff_write_from_memory):
10010 Return tsize_t, not size_t, since that's what the TIFF API wants.
10011 (tiff_read_from_memory): Don't fail simply because the read would
10012 go past EOF; instead, return a short read.
10013 (tiff_load): Omit no-longer-needed casts.
10014 (Fimagemagick_types): Don't assume size fits into 'int'.
10015
3cc5a532
PE
10016 Improve hashing quality when configured --with-wide-int.
10017 * fns.c (hash_string): New function, taken from sxhash_string.
10018 Do not discard information about ASCII character case; this
10019 discarding is no longer needed.
10020 (sxhash-string): Use it. Change sig to match it. Caller changed.
10021 * lisp.h: Declare it.
10022 * lread.c (hash_string): Remove, since we now use fns.c's version.
10023 The fns.c version returns a wider integer if --with-wide-int is
10024 specified, so this should help the quality of the hashing a bit.
10025
b312a492
PE
10026 * emacs.c: Integer overflow minor fix.
10027 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10028 Define only if GNU_LINUX.
10029 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10030
dfd153ae
PE
10031 * dispnew.c: Integer signedness and overflow fixes.
10032 Remove unnecessary forward decls, that were a maintenance hassle.
10033 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10034 All uses changed.
10035 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10036 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10037 (prepare_desired_row, line_draw_cost):
10038 Use int, not unsigned, where either works.
10039 (save_current_matrix, restore_current_matrix):
10040 Use ptrdiff_t, not size_t, where either works.
10041 (init_display): Check for overflow more accurately, and without
10042 relying on undefined behavior.
10043
a81d11a3
PE
10044 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10045 Remove, replacing with the new symbols in lisp.h. All uses changed.
10046 * fileio.c (make_temp_name):
10047 * filelock.c (lock_file_1, lock_file):
10048 * xdisp.c (message_dolog):
10049 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10050 Use pMd etc. instead.
10051 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10052 replacing the pWIDE etc. symbols removed from editfns.c.
10053
3300e6fd
PE
10054 * keyboard.h (num_input_events): Now uintmax_t.
10055 This is (very slightly) less likely to mess up due to wraparound.
10056 All uses changed.
10057
fd05c7e9
PE
10058 * buffer.c: Integer signedness fixes.
10059 (alloc_buffer_text, enlarge_buffer_text):
10060 Use ptrdiff_t rather than size_t when either will do, as we prefer
10061 signed integers.
10062
903fe15d
PE
10063 * alloc.c: Integer signedness and overflow fixes.
10064 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10065 (__malloc_size_t): Default to size_t, not to int.
10066 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10067 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10068 Prefer ptrdiff_t to size_t when either would do, as we prefer
10069 signed integers.
10070 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10071 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10072 Now const. Initialize with values that are in range even if char
10073 is signed.
10074 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10075 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10076 These functions do the right thing with sizes > 2**32.
10077 (check_depth): Now ptrdiff_t, not int.
10078 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10079 Adjust to new way of storing sizes. Check for size overflow bugs
10080 in rest of code.
10081 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10082 slightly wrong anyway, as it missed one instance of
10083 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10084 (refill_memory_reserve): Omit needless cast to size_t.
10085 (mark_object_loop_halt): Mark as externally visible.
10086
ac82cc6a
PE
10087 * xselect.c: Integer signedness and overflow fixes.
10088 (Fx_register_dnd_atom, x_handle_dnd_message):
10089 Use ptrdiff_t, not size_t, since we prefer signed.
10090 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10091 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10092 x_dnd_atoms_size and x_dnd_atoms_length.
10093
c2d1e36d
PE
10094 * doprnt.c: Prefer signed to unsigned when either works.
10095 * eval.c (verror):
10096 * doprnt.c (doprnt):
10097 * lisp.h (doprnt):
10098 * xdisp.c (vmessage):
10099 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10100 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10101 prefer signed arithmetic to avoid comparison confusion.
10102 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10103 but is a bit tricky.
10104
0e926e56
PE
10105 Assume freestanding C89 headers, string.h, stdlib.h.
10106 * data.c, doprnt.c, floatfns.c, print.c:
10107 Include float.h unconditionally.
10108 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10109 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10110 * regex.c: Likewise for stddef.h, string.h.
10111 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10112 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10113 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10114 (STDC_HEADERS): Remove obsolete defines.
10115 * sysdep.c: Include limits.h unconditionally.
10116
9cfdb3ec
PE
10117 Assume support for memcmp, memcpy, memmove, memset.
10118 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10119 * regex.c (memcmp, memcpy):
10120 Remove; we assume C89 now.
10121
10122 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10123 (__malloc_safe_bcopy): Remove; no longer needed.
10124
cf950e6b 10125 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
10126 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10127 well either way, and we prefer signed to unsigned.
10128
dbf38e02
LMI
101292011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10130
10131 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10132 closes the connection while we're reading (bug#9182).
10133
d6f0886c 101342011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 10135
d6f0886c
JD
10136 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10137 are specified (Bug#9168).
24e0f6b1 10138
2eb1f9e6
PE
101392011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10140
10141 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10142 Found by GCC static checking and --with-wide-int on a 32-bit host.
10143
22381272 101442011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
10145
10146 * xdisp.c (compute_display_string_pos): Fix logic of caching
10147 previous display string position. Initialize cached_prev_pos to
10148 -1. Fixes slow-down at the beginning of a buffer.
10149
f25e39b4
EZ
101502011-07-24 Eli Zaretskii <eliz@gnu.org>
10151
10152 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10153 for attrs[LFACE_FONTSET_INDEX].
10154
04c4b52e
PE
101552011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10156
10157 * xml.c (parse_region): Remove unused local
10158 that was recently introduced.
10159
c1734fbd
EZ
101602011-07-23 Eli Zaretskii <eliz@gnu.org>
10161
be18c5a5
EZ
10162 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10163 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10164
c1734fbd
EZ
10165 * xdisp.c (move_it_in_display_line_to): Record the best matching
10166 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
10167 exit if none of the characters scanned was an exact match.
10168 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
10169 when exact match is impossible due to invisible text, and the
10170 lines are truncated.
10171
a258d627
JD
101722011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10173
10174 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10175 for OSX >= 10.7.
10176
b6d5a689
EZ
101772011-07-22 Eli Zaretskii <eliz@gnu.org>
10178
0f74f785
EZ
10179 Fix a significant slow-down of cursor motion with C-n, C-p,
10180 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10181 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 10182 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
10183 (next_element_from_buffer): Call compute_stop_pos_backwards to
10184 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
10185 base_level_stop.
10186 (reseat): Don't look for prev_stop, as that could mean a very long
10187 run.
10188 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10189 <cached_disp_overlay_modiff>: Cache for last found display string
10190 position.
551918c1 10191 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
10192 about the same buffer in the same area of character positions, and
10193 the buffer wasn't changed since the time the display string
10194 position was cached.
551918c1 10195
b2d0c91a
EZ
101962011-07-22 Eli Zaretskii <eliz@gnu.org>
10197
10198 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10199 is an integer, which is important for empty lines. (Bug#9149)
10200
043604ee
CY
102012011-07-22 Chong Yidong <cyd@stupidchicken.com>
10202
10203 * frame.c (Fmodify_frame_parameters): In tty case, update the
10204 default face if necessary (Bug#4238).
10205
da4adb04
CY
102062011-07-21 Chong Yidong <cyd@stupidchicken.com>
10207
10208 * editfns.c (Fstring_to_char): No need to explain what a character
10209 is in the docstring (Bug#6576).
10210
9abd0532
LMI
102112011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10212
10213 * xml.c (parse_region): Make sure we always return a tree.
10214
36881d16
HK
102152011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10216
10217 * xml.c (parse_region): If a document contains only comments,
10218 return that, too.
10219
1e98674d
LMI
102202011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10221
10222 * xml.c (make_dom): Return comments, too.
10223
590bd467
PE
102242011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10225
10226 Port to OpenBSD.
10227 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10228 and the surrounding thread.
10229 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10230 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10231 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10232 timer goes off.
10233 * s/openbsd.h (BROKEN_SIGIO): Define.
10234 * unexelf.c (unexec) [__OpenBSD__]:
10235 Don't update the .mdebug section of the Alpha COFF symbol table.
10236
f41628b2
LMI
102372011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10238
10239 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10240 (bug#8460).
10241
b59b67c5
PE
102422011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10243
15e3a074
PE
10244 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10245 This fixes some race conditions on the permissions of any newly
10246 created file.
10247
41bed37d
PE
10248 * alloc.c (valid_pointer_p): Use pipe, not open.
10249 This fixes some permissions issues when debugging.
10250
b59b67c5
PE
10251 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10252 If fchown fails to set both uid and gid, try to set just gid,
10253 as that is sometimes allowed. Adjust the file's mode to eliminate
10254 setuid or setgid bits that are inappropriate if fchown fails.
10255
925a6be7
SM
102562011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10257
10258 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10259 to compare Lisp_Objects.
10260 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10261 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10262 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10263
52968808
AS
102642011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10265
0a6a104b
AS
10266 * lread.c (read_integer): Unread even EOF character.
10267 (read1): Likewise. Properly record start position of symbol.
10268
52968808
AS
10269 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10270 symbol character follows.
10271
9e381cdd
PE
102722011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10273
10274 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10275 This works around a problem with the previous change to Fcopy_file.
10276 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10277 and without this change, GCC might complain about discarding
10278 fchown's return value.
10279
b5641435
JB
102802011-07-16 Juanma Barranquero <lekktu@gmail.com>
10281
10282 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10283
a8031457
PE
102842011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10285
10286 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10287
dd889327
LMI
102882011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10289
750c33f7
LMI
10290 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10291 it's used from the C level.
10292
dd889327
LMI
10293 * process.c: Use the same condition for POLL_FOR_INPUT in both
10294 keyboard.c and process.c (bug#1858).
10295
87e86684
LM
102962011-07-09 Lawrence Mitchell <wence@gmx.li>
10297
10298 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10299 (Fgnutls_boot): Use it.
10300
64348f40
AS
103012011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10302
10303 * doc.c (Fsubstitute_command_keys): Revert last change.
10304
1d698799
LMI
103052011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10306
f863868c
LMI
10307 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10308 quotes the next character, and doesn't affect other longer
10309 sequences (bug#8935).
10310
1d698799
LMI
10311 * lread.c (syms_of_lread): Clarify that is isn't only
10312 `eval-buffer' and `eval-defun' that's affected by
10313 `lexical-binding' (bug#8460).
10314
aa4b6df6
EZ
103152011-07-15 Eli Zaretskii <eliz@gnu.org>
10316
10317 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 10318 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 10319
5d856da6
PE
103202011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10321
ad6042bb
PE
10322 Fix minor problems found by static checking.
10323 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10324 (elsz): Now a signed constant, not a size_t var. We prefer signed
10325 types to unsigned, to avoid integer comparison confusion. Without
10326 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10327 "cannot optimize loop, the loop counter may overflow", a symptom
10328 of the confusion.
f00bbb22 10329 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
10330 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10331
6468f31c
LMI
103322011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10333
49080b10
LMI
10334 * search.c (Fre_search_backward): Mention `case-fold-search' in
10335 all the re_search_* functions (bug#8138).
10336
6468f31c
LMI
10337 * keyboard.c (Fopen_dribble_file): Document when the file is
10338 closed (bug#8056).
10339
c965adc5
EZ
103402011-07-14 Eli Zaretskii <eliz@gnu.org>
10341
df9733bf
EZ
10342 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10343 bidi_cache_idx.
10344
0bb23927
EZ
10345 Support bidi reordering of display and overlay strings.
10346 * xdisp.c (compute_display_string_pos)
10347 (compute_display_string_end): Accept additional argument STRING.
10348 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10349 (reseat_to_string): Initialize bidi_it->string.s and
10350 bidi_it->string.schars.
10351 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
10352 NULL (avoids a crash in bidi_paragraph_init).
10353 Initialize itb.string.lstring.
0bb23927
EZ
10354 (init_iterator): Call bidi_init_it only of a valid
10355 buffer position was specified. Initialize paragraph_embedding to
10356 L2R.
10357 (reseat_to_string): Initialize the bidi iterator.
10358 (display_string): If we need to ignore text properties of
10359 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10360 original value of -1 will not work with bidi.)
10361 (compute_display_string_pos): First arg is now struct
10362 `text_pos *'; all callers changed. Support display properties on
10363 Lisp strings.
10364 (compute_display_string_end): Support display properties on Lisp
10365 strings.
10366 (init_iterator, reseat_1, reseat_to_string): Initialize the
10367 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10368 when iterating on a string not from display properties).
640c8776
SM
10369 (compute_display_string_pos, compute_display_string_end):
10370 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
10371 arrow keys.
10372 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
10373 base_level_stop; instead, set base_level_stop to BEGV.
10374 Fixes crashes in vertical-motion.
0bb23927
EZ
10375 (next_element_from_buffer): Improve commentary for when
10376 the iterator is before prev_stop.
10377 (init_iterator): Initialize bidi_p from the default value of
10378 bidi-display-reordering, not from buffer-local value. Use the
10379 buffer-local value only if initializing for buffer iteration.
10380 (handle_invisible_prop): Support invisible properties on strings
10381 that are being bidi-reordered.
10382 (set_iterator_to_next): Support bidi reordering of C strings and
10383 Lisp strings.
10384 (next_element_from_string): Support bidi reordering of Lisp
10385 strings.
10386 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
10387 (display_string): Support display of R2L glyph rows.
10388 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
10389 (init_iterator): Don't initialize it->bidi_p for strings
10390 here.
10391 (reseat_to_string): Initialize it->bidi_p for strings here.
10392 (next_element_from_string, next_element_from_c_string)
10393 (next_element_from_buffer): Add xassert's for correspondence
10394 between IT's object being iterated and it->bidi_it.string
10395 structure.
10396 (face_before_or_after_it_pos): Support bidi iteration.
10397 (next_element_from_c_string): Handle the case of the first string
10398 character that is not the first one in the visual order.
10399 (get_visually_first_element): New function, refactored from common
10400 parts of next_element_from_buffer, next_element_from_string, and
10401 next_element_from_c_string.
10402 (tool_bar_lines_needed, redisplay_tool_bar)
10403 (display_menu_bar): Force left-to-right direction. Add a FIXME
10404 comment for making that be controlled by a user option.
10405 (push_it, pop_it): Save and restore the state of the
10406 bidi iterator. Save and restore the bidi_p flag.
10407 (pop_it): Iterate out of display property for string iteration as
10408 well.
10409 (iterate_out_of_display_property): Support iteration over strings.
10410 (handle_single_display_spec): Set up it->bidi_it for iteration
10411 over a display string, and call bidi_init_it.
10412 (handle_single_display_spec, next_overlay_string)
10413 (get_overlay_strings_1, push_display_prop): Set up the bidi
10414 iterator for displaying display or overlay strings.
10415 (forward_to_next_line_start): Don't use the shortcut if
10416 bidi-iterating.
10417 (back_to_previous_visible_line_start): If handle_display_prop
10418 pushed the iterator stack, restore the internal state of the bidi
10419 iterator by calling bidi_pop_it same number of times.
10420 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10421 and we are bidi-iterating, don't decrement the iterator position;
10422 instead, set the first_elt flag in the bidi iterator, to produce
10423 the same effect.
10424 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10425 (push_display_prop): xassert that we are iterating a buffer.
10426 (push_it, pop_it): Save and restore paragraph_embedding member.
10427 (handle_single_display_spec, next_overlay_string)
10428 (get_overlay_strings_1, reseat_1, reseat_to_string)
10429 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10430 correctly. Don't assume unibyte strings are not bidi-reordered.
10431 (compute_display_string_pos)
10432 (compute_display_string_end): Fix handling the case of C string.
10433 (push_it, pop_it): Save and restore from_disp_prop_p.
10434 (handle_single_display_spec, push_display_prop): Set the
10435 from_disp_prop_p flag.
10436 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10437 (pop_it): Call iterate_out_of_display_property only if we are
10438 popping after iteration over a string that came from a display
10439 property. Fix a typo in popping stretch info. Add an assertion
10440 for verifying that the iterator position is in sync with the bidi
10441 iterator.
10442 (handle_single_display_spec, get_overlay_strings_1)
10443 (push_display_prop): Fix initialization of paragraph direction for
10444 string when that of the parent object is not yet determined.
10445 (reseat_1): Call bidi_init_it to resync the bidi
10446 iterator with IT's position. (Bug#7616)
10447 (find_row_edges): If ROW->start.pos gives position
10448 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10449 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10450 Reset the from_disp_prop_p flag.
10451 (SAVE_IT, RESTORE_IT): New macros.
10452 (pos_visible_p, face_before_or_after_it_pos)
10453 (back_to_previous_visible_line_start)
10454 (move_it_in_display_line_to, move_it_in_display_line)
10455 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10456 (try_scrolling, redisplay_window, display_line): Use them when
10457 saving a temporary copy of the iterator and restoring it back.
10458 (back_to_previous_visible_line_start, reseat_1)
10459 (init_iterator): Empty the bidi cache "stack".
10460 (move_it_in_display_line_to): If iterator ended up at
10461 EOL, but we never saw any buffer positions smaller than
10462 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10463 motion in bidi-reordered lines.
10464 (move_it_in_display_line_to): Record prev_method and prev_pos
10465 immediately before the call to set_iterator_to_next. Fixes cursor
10466 motion in bidi-reordered lines with stretch glyphs and strings
10467 displayed in margins. (Bug#8133) (Bug#8867)
10468 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10469 TO_CHARPOS.
640c8776
SM
10470 (pos_visible_p): Support positions in bidi-reordered lines.
10471 Save and restore bidi cache.
0bb23927
EZ
10472
10473 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10474 (bidi_paragraph_info): Delete unused struct.
10475 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10476 (bidi_cache_start): New variable.
10477 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10478 to zero.
10479 (bidi_cache_fetch_state, bidi_cache_search)
10480 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10481 (bidi_cache_find, bidi_peek_at_next_level)
10482 (bidi_level_of_next_char, bidi_find_other_level_edge)
10483 (bidi_move_to_visually_next): Compare cache index with
10484 bidi_cache_start rather than with zero.
10485 (bidi_fetch_char): Accept new argument STRING; all callers
10486 changed. Support iteration over a string. Support strings with
10487 display properties. Support unibyte strings. Fix the type of
10488 `len' according to what STRING_CHAR_AND_LENGTH expects.
10489 (bidi_paragraph_init, bidi_resolve_explicit_1)
10490 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
10491 (bidi_level_of_next_char, bidi_move_to_visually_next):
10492 Support iteration over a string.
0bb23927
EZ
10493 (bidi_set_sor_type, bidi_resolve_explicit_1)
10494 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10495 can now be zero (for strings); special values 0 and -1 were
10496 changed to -1 and -2, respectively.
10497 (bidi_char_at_pos): New function.
10498 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10499 Call it instead of FETCH_MULTIBYTE_CHAR.
10500 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10501 initialized to valid values.
10502 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10503 values.
10504 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10505 the test for valid cached positions. Fix the logic for looking up
10506 the sentinel state in the cache. GCPRO the Lisp string we are
10507 iterating.
10508 (bidi_push_it, bidi_pop_it): New functions.
10509 (bidi_initialize): Initialize the bidi cache start stack pointer.
10510 (bidi_cache_ensure_space): New function, refactored from part of
10511 bidi_cache_iterator_state. Don't assume the required size is just
10512 one BIDI_CACHE_CHUNK away.
10513 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10514 (bidi_count_bytes, bidi_char_at_pos): New functions.
10515 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10516 always valid if bidi_cache_idx is valid.
10517 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10518 is valid if it's going to be used.
10519 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10520 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
10521 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10522 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
10523 (bidi_find_other_level_edge, bidi_cache_start_stack):
10524 All variables related to cache indices are now EMACS_INT.
c965adc5 10525
0bb23927
EZ
10526 * dispextern.h (struct bidi_string_data): New structure.
10527 (struct bidi_it): New member `string'. Make flag members be 1-bit
10528 fields, and put them last in the struct.
640c8776
SM
10529 (compute_display_string_pos, compute_display_string_end):
10530 Update prototypes.
0bb23927
EZ
10531 (bidi_push_it, bidi_pop_it): Add prototypes.
10532 (struct iterator_stack_entry): New members bidi_p,
10533 paragraph_embedding, and from_disp_prop_p.
10534 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
10535 (bidi_shelve_cache, bidi_unshelve_cache):
10536 Declare prototypes.
0bb23927
EZ
10537
10538 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10539 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10540 and vector-like objects.
10541
10542 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10543 cache around display iteration.
10544
10545 * window.c (Fwindow_end, window_scroll_pixel_based)
10546 (displayed_window_lines, Frecenter): Save and restore the bidi
10547 cache around display iteration.
10548
3bbd2265
LMI
105492011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10550
10551 * editfns.c (Fdelete_region): Clarify the use of the named
10552 parameters (bug#6788).
10553
adc47434
MR
105542011-07-14 Martin Rudalics <rudalics@gmx.at>
10555
10556 * indent.c (Fvertical_motion): Set and restore w->pointm when
10557 saving and restoring the window's buffer (Bug#9006).
10558
837c31f8
LMI
105592011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10560
10561 * editfns.c (Fstring_to_char): Clarify just what is returned
10562 (bug#6576). Text by Eli Zaretskii.
10563
ac389d0c
JB
105642011-07-13 Juanma Barranquero <lekktu@gmail.com>
10565
10566 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10567
0be0ce47
EZ
105682011-07-13 Eli Zaretskii <eliz@gnu.org>
10569
10570 * buffer.c (mmap_find): Fix a typo.
10571
cd18e7e3
JB
105722011-07-13 Johan Bockgård <bojohan@gnu.org>
10573
10574 Fix execution of x selection hooks.
10575 * xselect.c (Qx_lost_selection_functions)
10576 (Qx_sent_selection_functions): New vars.
10577 (syms_of_xselect): DEFSYM them.
10578 (x_handle_selection_request): Pass Qx_sent_selection_functions
10579 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10580 (x_handle_selection_clear,x_clear_frame_selections):
10581 Pass Qx_lost_selection_functions rather than
10582 Vx_lost_selection_functions to Frun_hook_with_args.
10583
47ea7f44
PE
105842011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10585
ac389d0c 10586 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
10587 The old code sometimes used this field without initializing it.
10588
47ea7f44
PE
10589 * alloc.c (gc_sweep): Don't read past end of array.
10590 In theory, the old code could also have corrupted Emacs internals,
10591 though it'd be very unlikely.
10592
bc985c87
AS
105932011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10594
10595 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 10596 argument. (Bug#4026)
bc985c87 10597
0cf34688
LMI
105982011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10599
b3dadd76
LMI
10600 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10601 key" (bug#4257).
10602
0cf34688
LMI
10603 * window.c (Fset_window_start): Doc fix (bug#4199).
10604 (Fset_window_hscroll): Ditto.
10605
270768cd
PE
106062011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10607
077e3dda 10608 Fix minor new problems caught by GCC 4.6.1.
270768cd 10609 * term.c (init_tty): Remove unused local.
490011a6 10610 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 10611 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 10612 not used otherwise.
270768cd 10613
b1f58454
CY
106142011-07-12 Chong Yidong <cyd@stupidchicken.com>
10615
10616 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10617
22b9578d
LMI
106182011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10619
6e70ab07
LMI
10620 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10621 are the mini-buffer and the echo area (bug#3320).
10622
22b9578d
LMI
10623 * term.c (init_tty): Remove support for supdup, c10 and perq
10624 terminals, which are no longer supported (bug#1482).
10625
8974cc9f
JB
106262011-07-10 Johan Bockgård <bojohan@gnu.org>
10627
10628 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10629
a560d974
JD
106302011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10631
10632 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10633 for non-popups (Bug#3642).
10634
1dae0f0a
AS
106352011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10636
268c2c36 10637 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 10638 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
10639 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10640 * cm.c (losecursor): Likewise.
1dae0f0a
AS
10641 * data.c (fmod): Likewise.
10642 * dispnew.c (swap_glyphs_in_rows): Likewise.
10643 * emacs.c (memory_warning_signal): Likewise.
10644 * floatfns.c (float_error): Likewise.
10645 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10646 (otf_open, font_otf_capability, generate_otf_features)
10647 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10648 Likewise.
10649 * image.c (pbm_read_file): Likewise.
10650 * indent.c (string_display_width): Likewise.
10651 * intervals.c (check_for_interval, search_for_interval)
10652 (inc_interval_count, count_intervals, root_interval)
10653 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10654 * lread.c (defalias): Likewise.
268c2c36 10655 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
10656 * regex.c (set_image_of_range_1, set_image_of_range)
10657 (regex_grow_registers): Likewise.
10658 * sysdep.c (strerror): Likewise.
10659 * termcap.c (valid_filename_p, tprint, main): Likewise.
10660 * tparam.c (main): Likewise.
10661 * unexhp9k800.c (run_time_remap, save_data_space)
10662 (update_file_ptrs, read_header, write_header, calculate_checksum)
10663 (copy_file, copy_rest, display_header): Likewise.
10664 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10665 Likewise.
10666 * xdisp.c (check_it): Likewise.
10667 * xfaces.c (register_color, unregister_color, unregister_colors):
10668 Likewise.
10669 * xfns.c (print_fontset_result): Likewise.
10670 * xrdb.c (member, fatal, main): Likewise.
10671
99033785
PE
106722011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10673
10674 Fix minor problems found by static checking (Bug#9031).
10675 * chartab.c (char_table_set_range, map_sub_char_table):
10676 Remove unused locals.
10677 (uniprop_table): Now static.
10678 * composite.c (_work_char): Remove unused static var.
10679
9cb2ac56
JB
106802011-07-09 Juanma Barranquero <lekktu@gmail.com>
10681
10682 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10683
f25661f0
JD
106842011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10685
10686 * gtkutil.c (qttip_cb): Remove code without function.
10687
8278c4fe
EZ
106882011-07-09 Eli Zaretskii <eliz@gnu.org>
10689
10690 * w32.c (pthread_sigmask): New stub.
10691
1692ae2d 106922011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 10693
8a6ebd58 10694 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
10695 sigprocmask is portable only for single-threaded applications, and
10696 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
10697 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10698 (LIBES): Use it.
10699 * callproc.c (Fcall_process):
10700 * process.c (create_process):
10701 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10702 Use pthread_sigmask, not sigprocmask.
123403e4 10703
1b854618
JD
107042011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10705
10706 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10707 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10708 wrong (Bug#8591).
10709
3fe4b549
JD
107102011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10711
0ce7e563
JD
10712 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10713 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10714 (xg_hide_tooltip): Fix comment.
10715
3fe4b549
JD
10716 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10717 in registerServicesMenuSendTypes.
10718 (validRequestorForSendType): Don't check ns_return_types.
10719
10720 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10721 ns_return_type.
10722
5df75e47
JR
107232011-07-08 Jason Rumney <jasonr@gnu.org>
10724
22610910
JR
10725 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10726 SH_SHOW for hidden windows (Bug#5482).
10727
5df75e47
JR
10728 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10729 frame struct members of non-existent frames (Bug#6284).
10730
699c10bd
JD
107312011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10732
4393663b
JD
10733 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10734 variable firstTime not needed on OSX >= 10.6.
10735 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10736 >= 10.5. Use setKnobProportion, setDoubleValue.
10737
10738 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10739 (MAC_OS_X_VERSION_10_5): Define if not defined.
10740 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10741 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10742 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10743
10744 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 10745 cString and lossyCString on OSX >= 10.4.
4393663b 10746
58179cce 10747 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
10748 sizeToFit on OSX >= 10.2.
10749
10750 * nsimage.m (allocInitFromFile): Don't use deprecated method
10751 bestRepresentationForDevice on OSX >= 10.6.
10752
10753 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10754 to avoid warning.
10755
10756 * emacs.c: Declare unexec_init_emacs_zone.
10757
a63e0781
JD
10758 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10759
699c10bd
JD
10760 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10761
10762 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10763 on svcsMenu (Bug#8842).
10764
10765 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10766 ns_return_types.
10767 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10768
10769 * nsterm.m (QUTF8_STRING): Declare.
10770 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10771 (validRequestorForSendType): Return type is (id).
10772 Change indexOfObjectIdenticalTo to indexOfObject.
10773 Check if we have local selection before returning self (Bug#8842).
10774 (writeSelectionToPasteboard): Put local selection into paste board
10775 if we have a local selection (Bug#8842).
10776 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10777
10778 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10779 (ns_get_local_selection): Declare.
10780
54e10184
LMI
107812011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10782
9888ff71
LMI
10783 * keymap.c (describe_map_tree): Don't insert a double newline at
10784 the end of the buffer (bug#1169) and return whether we inserted
10785 something.
10786
54e10184
LMI
10787 * callint.c (Fcall_interactively): Change "reading args" to
10788 "providing args" to try to clarify what it does (bug#1010).
10789
15fa4783
KH
107902011-07-07 Kenichi Handa <handa@m17n.org>
10791
10792 * composite.c (composition_compute_stop_pos): Ignore a static
10793 composition starting before CHARPOS (Bug#8915).
10794
10795 * xdisp.c (handle_composition_prop): Likewise.
10796
a8815b00
EZ
107972011-07-07 Eli Zaretskii <eliz@gnu.org>
10798
10799 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10800 (Bug#9015)
10801
ef7b981d 108022011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
10803
10804 * character.h (unicode_category_t): New enum type.
10805
10806 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10807 (Qchar_code_property_table): New variable.
10808 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10809 (UNIPROP_COMPRESSED_FORM_P): New macros.
10810 (char_table_ascii): Uncompress the compressed values.
10811 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10812 Uncompress the compressed values.
ac389d0c 10813 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
10814 (char_table_ref_and_range): Uncompress the compressed values.
10815 (sub_char_table_set): New arg is_uniprop. Callers changed.
10816 Uncompress the compressed values.
10817 (sub_char_table_set_range): Args changed. Callers changed.
10818 (char_table_set_range): Adjuted for the above change.
10819 (map_sub_char_table): Delete args default_val and parent. Add arg
10820 top. Give decoded values to a Lisp function.
640c8776 10821 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
10822 values to a Lisp function. Gcpro more variables.
10823 (uniprop_table_uncompress)
10824 (uniprop_decode_value_run_length): New functions.
10825 (uniprop_decoder, uniprop_decoder_count): New variables.
10826 (uniprop_get_decoder, uniprop_encode_value_character)
10827 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10828 New functions.
10829 (uniprop_encoder, uniprop_encoder_count): New variables.
10830 (uniprop_get_encoder, uniprop_table)
10831 (Funicode_property_table_internal, Fget_unicode_property_internal)
10832 (Fput_unicode_property_internal): New functions.
10833 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10834 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 10835 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
10836 char-code-property-alist.
10837
640c8776 10838 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
10839 Vunicode_category_table.
10840
640c8776 10841 * font.c (font_range): Adjust for the change of
c805dec0
KH
10842 Vunicode_category_table.
10843
76b397fb
DN
108442011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10845
10846 * m/iris4d.h: Remove file, move contents ...
10847 * s/irix6-5.h: ... here.
10848
22b4128e
PE
108492011-07-06 Paul Eggert <eggert@cs.ucla.edu>
10850
10851 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
10852 * alloc.c (mark_buffer):
10853 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10854 (clone_per_buffer_values): Don't assume that
22b4128e
PE
10855 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10856 This isn't true in general, and it's particularly not true
10857 if Emacs is configured with --with-wide-int.
10858 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10859 New macros, used in the buffer.c change.
10860
869795d6
JD
108612011-07-05 Jan Djärv <jan.h.d@swipnet.se>
10862
10863 * xsettings.c: Use both GConf and GSettings if both are available.
10864 (store_config_changed_event): Add comment.
10865 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10866 (store_tool_bar_style_changed): New functions.
5e617bc2 10867 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
10868 (struct xsettings): Move font inside HAVE_XFT.
10869 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 10870 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 10871 Move inside HAVE_XFT.
640c8776 10872 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
10873 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10874 also.
10875 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 10876 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 10877 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
10878 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10879 (parse_settings): Move check for font inside HAVE_XFT.
10880 (read_settings, apply_xft_settings): Add comment.
10881 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
10882 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
10883 call store_font_name_changed.
10884 (xft_settings_event): Add comment.
10885 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
10886 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
10887 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
10888 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
10889 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
10890 (xsettings_get_system_font, xsettings_get_system_normal_font):
10891 Add comment.
869795d6 10892
d8ed26bd
PE
108932011-07-05 Paul Eggert <eggert@cs.ucla.edu>
10894
10895 Random fixes. E.g., (random) never returned negative values.
10896 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10897 subseconds part to the entropy, as that's a bit more random.
10898 Prefer signed to unsigned, since the signedness doesn't matter and
10899 in general we prefer signed. When given a limit, use a
10900 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
10901 latter isn't right if USE_2_TAGS_FOR_INTS.
10902 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
10903 not 0..VALMASK. Don't discard "excess" bits that random () returns.
10904
cabf1cac
SM
109052011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
10906
10907 * textprop.c (text_property_stickiness):
10908 Obey Vtext_property_default_nonsticky.
10909 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
10910 * w32fns.c (syms_of_w32fns):
10911 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
10912
6e9b2be9
PE
109132011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10914
10915 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
10916 This is more efficient than Ffile_directory_p and avoids a minor race.
10917
90186c68
LMI
109182011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
10919
7c301272
LMI
10920 * buffer.c (Foverlay_put): Say what the return value is
10921 (bug#7835).
10922
c4f2d8d4
LMI
10923 * fileio.c (barf_or_query_if_file_exists): Check first if the file
10924 is a directory before asking whether to use the file name
10925 (bug#7564).
ad637907
LMI
10926 (barf_or_query_if_file_exists): Make the "File is a directory"
10927 error be more correct.
c4f2d8d4 10928
90186c68
LMI
10929 * fns.c (Frequire): Remove the mention of the .gz files, since
10930 that's installation-specific, but keep the mention of
10931 `get-load-suffixes'.
10932
da64016e
PE
109332011-07-04 Paul Eggert <eggert@cs.ucla.edu>
10934
10935 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
10936 Report string overflow if the output is too long.
10937
7d47b580
JB
109382011-07-04 Juanma Barranquero <lekktu@gmail.com>
10939
a555cb87
JB
10940 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
10941 (syms_of_gnutls): Remove duplicate DEFSYM for
10942 Qgnutls_bootprop_verify_hostname_error, an error for
10943 Qgnutls_bootprop_verify_error (which is no longer used).
10944
7d47b580
JB
10945 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
10946 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
10947 Also (re)move comments that are misplaced or no longer relevant.
10948
1e49bfab
LMI
109492011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10950
10951 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
10952
1485f4c0
CY
109532011-07-03 Chong Yidong <cyd@stupidchicken.com>
10954
10955 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
10956 and background color parameters if they have been changed.
10957
a9ab721e
LMI
109582011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
10959
10960 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
10961
cf7cff57
PE
109622011-07-03 Paul Eggert <eggert@cs.ucla.edu>
10963
2e13213d
PE
10964 * xsettings.c (SYSTEM_FONT): Define only when used.
10965 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
10966
cf7cff57
PE
10967 * keymap.c (access_keymap_1): Now static.
10968
7a8e04f7
CY
109692011-07-02 Chong Yidong <cyd@stupidchicken.com>
10970
10971 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
10972 leave any prefix arg for the up event (Bug#1586).
10973
61352f62
LMI
109742011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
10975
69bb1ef7
LMI
10976 * lread.c (syms_of_lread): Mention single symbols defined by
10977 `defvar' or `defconst' (bug#7154).
10978
61352f62 10979 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 10980 (Frequire): Mention get-load-suffixes.
61352f62 10981
28545e04
MR
109822011-07-02 Martin Rudalics <rudalics@gmx.at>
10983
10984 * window.h (window): Remove clone_number slot.
10985 * window.c (Fwindow_clone_number, Fset_window_clone_number):
10986 Remove.
10987 (make_parent_window, make_window, saved_window)
10988 (Fset_window_configuration, save_window_save): Don't deal with
10989 clone numbers.
10990 * buffer.c (Qclone_number): Remove declaration.
10991 (sort_overlays, overlay_strings): Don't deal with clone numbers.
10992
3349e122
SM
109932011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
10994
10995 Add multiple inheritance to keymaps.
10996 * keymap.c (Fmake_composed_keymap): New function.
10997 (Fset_keymap_parent): Simplify.
10998 (fix_submap_inheritance): Remove.
10999 (access_keymap_1): New function extracted from access_keymap to handle
11000 embedded parents and handle lists of maps.
11001 (access_keymap): Use it.
11002 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11003 (Fcopy_keymap): Handle embedded parents.
11004 (Fcommand_remapping, define_as_prefix): Simplify.
11005 (Fkey_binding): Simplify.
11006 (syms_of_keymap): Move minibuffer-local-completion-map,
11007 minibuffer-local-filename-completion-map,
11008 minibuffer-local-must-match-map, and
11009 minibuffer-local-filename-must-match-map to Elisp.
11010 (syms_of_keymap): Defsubr make-composed-keymap.
11011 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11012 (parse_menu_item): Trivial simplification.
11013
3279eb87
GM
110142011-07-01 Glenn Morris <rgm@gnu.org>
11015
11016 * Makefile.in (SETTINGS_LIBS): Fix typo.
11017
39cb9e56 110182011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
11019
11020 * coding.c (Fencode_coding_string): Record the last coding system
11021 used, as the function doc string says (bug#8738).
11022
0949d2b6
JD
110232011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11024
11025 * xsettings.c (store_monospaced_changed): Take new font as arg and
11026 check for change against current_mono_font.
11027 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11028 (emacs_settings_constructor, emacs_settings_get_property)
11029 (emacs_settings_set_property, emacs_settings_class_init)
11030 (emacs_settings_init, gsettings_obj): Remove.
11031 (something_changedCB): New function for HAVE_GSETTINGS.
11032 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11033 with value as argument.
11034 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11035 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 11036 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
11037 "changed".
11038
11039 * xgselect.c: Add defined (HAVE_GSETTINGS).
11040 (xgselect_initialize): Ditto.
11041
11042 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11043 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11044 xg_select.
11045
bbc6b304
PE
110462011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11047
11048 * eval.c (struct backtrace): Simplify and port the data structure.
11049 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11050 signed bit field, as this assumption is not portable and it makes
11051 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11052 "char debug_on_exit : 1" as this is not portable either; instead,
11053 use the portable "unsigned int debug_on_exit : 1". Remove unused
11054 member evalargs. Remove obsolete comments about cc bombing out.
11055
9851bfc5
JD
110562011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11057
51bb811f 11058 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
11059 Let HAVE_GSETTINGS override HAVE_GCONF.
11060 (store_monospaced_changed): New function.
11061 (EMACS_SETTINGS): A new type derived from GObject to handle
11062 GSettings notifications.
11063 (emacs_settings_constructor, emacs_settings_get_property)
11064 (emacs_settings_set_property, emacs_settings_class_init):
11065 New functions.
11066 (gsettings_client, gsettings_obj): New variables.
11067 (GSETTINGS_SCHEMA): New define.
11068 (something_changedCB): Call store_monospaced_changed.
11069 (init_gsettings): New function.
11070 (xsettings_initialize): Call init_gsettings.
11071 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11072 to NULL.
11073
640c8776 11074 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
11075 GCONF_CFLAGS/LIBS.
11076
5386012d
MR
110772011-06-29 Martin Rudalics <rudalics@gmx.at>
11078
11079 * window.c (resize_root_window, grow_mini_window)
11080 (shrink_mini_window): Rename Qresize_root_window to
11081 Qwindow_resize_root_window and Qresize_root_window_vertically to
11082 Qwindow_resize_root_window_vertically.
11083
f13e0b08
PE
110842011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11085
11086 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11087
94515237
JB
110882011-06-27 Juanma Barranquero <lekktu@gmail.com>
11089
11090 * makefile.w32-in: Redesign dependencies so they reflect more
11091 clearly which files are directly included by each source file,
11092 and not through other includes.
11093
e43b6e43
MR
110942011-06-27 Martin Rudalics <rudalics@gmx.at>
11095
11096 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11097 (sort_overlays, overlay_strings): When an overlay's clone number
11098 matches the window's clone number process the overlay even if
11099 the overlay's window property doesn't match the current window.
11100
d68443dc
MR
11101 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11102 (Fwindow_hchild): Rename to Fwindow_left_child.
11103 (Fwindow_next): Rename to Fwindow_next_sibling.
11104 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
11105 (resize_window_check): Rename to window_resize_check.
11106 (resize_window_apply): Rename to window_resize_apply.
11107 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11108 (Fdelete_other_windows_internal, resize_frame_windows)
11109 (Fsplit_window_internal, Fdelete_window_internal)
11110 (grow_mini_window, shrink_mini_window)
11111 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 11112
c7e73be5
JD
111132011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11114
11115 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11116 (emacs_fixed_set_min_size): Remove.
11117 (emacs_fixed_new): Take frame as argument.
11118
11119 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11120 (_EmacsFixedPrivate): Remove minwidth/height.
11121 Add struct frame *f.
11122 (emacs_fixed_init): Initialize priv->f.
11123 (get_parent_class, emacs_fixed_set_min_size): Remove.
11124 (emacs_fixed_new): Set priv->f to argument.
11125 (emacs_fixed_get_preferred_width)
11126 (emacs_fixed_get_preferred_height): Use min_width/height from
11127 frames size_hint to set minimum and natural (Bug#8919).
11128 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11129 and use min_width/height from frames size_hint to set
11130 min_width/height (Bug#8919).
11131
11132 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
11133 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11134 Fix indentation.
c7e73be5 11135
cf99dcf8
EZ
111362011-06-26 Eli Zaretskii <eliz@gnu.org>
11137
11138 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11139 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11140 called at ZV.
11141
029529ac
CY
111422011-06-26 Chong Yidong <cyd@stupidchicken.com>
11143
11144 * process.c (wait_reading_process_output): Bypass select if
11145 waiting for a cell while ignoring keyboard input, and input is
11146 pending. Suggested by Jan Djärv (Bug#8869).
11147
7a7ef429
PE
111482011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11149
11150 Use gnulib's dup2 module instead of rolling our own.
11151 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11152
11fdef7d 111532011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
11154
11155 * dispnew.c (scrolling_window): Before scrolling, turn off a
11156 mouse-highlight in the window being scrolled.
11157
cd3520a4
JB
111582011-06-24 Juanma Barranquero <lekktu@gmail.com>
11159
11160 Move DEFSYM to lisp.h and use everywhere.
11161
11162 * character.h (DEFSYM): Move declaration...
11163 * lisp.h (DEFSYM): ...here.
11164
11165 * gnutls.c:
11166 * minibuf.c:
11167 * w32menu.c:
11168 * w32proc.c:
11169 * w32select.c: Don't include character.h.
11170
11171 * alloc.c (syms_of_alloc):
11172 * buffer.c (syms_of_buffer):
11173 * bytecode.c (syms_of_bytecode):
11174 * callint.c (syms_of_callint):
11175 * casefiddle.c (syms_of_casefiddle):
11176 * casetab.c (init_casetab_once):
11177 * category.c (init_category_once, syms_of_category):
11178 * ccl.c (syms_of_ccl):
11179 * cmds.c (syms_of_cmds):
11180 * composite.c (syms_of_composite):
11181 * dbusbind.c (syms_of_dbusbind):
11182 * dired.c (syms_of_dired):
11183 * dispnew.c (syms_of_display):
11184 * doc.c (syms_of_doc):
11185 * editfns.c (syms_of_editfns):
11186 * emacs.c (syms_of_emacs):
11187 * eval.c (syms_of_eval):
11188 * fileio.c (syms_of_fileio):
11189 * fns.c (syms_of_fns):
11190 * frame.c (syms_of_frame):
11191 * fringe.c (syms_of_fringe):
11192 * insdel.c (syms_of_insdel):
11193 * keymap.c (syms_of_keymap):
11194 * lread.c (init_obarray, syms_of_lread):
11195 * macros.c (syms_of_macros):
11196 * msdos.c (syms_of_msdos):
11197 * print.c (syms_of_print):
11198 * process.c (syms_of_process):
11199 * search.c (syms_of_search):
11200 * sound.c (syms_of_sound):
11201 * syntax.c (init_syntax_once, syms_of_syntax):
11202 * terminal.c (syms_of_terminal):
11203 * textprop.c (syms_of_textprop):
11204 * undo.c (syms_of_undo):
11205 * w32.c (globals_of_w32):
11206 * window.c (syms_of_window):
11207 * xdisp.c (syms_of_xdisp):
11208 * xfaces.c (syms_of_xfaces):
11209 * xfns.c (syms_of_xfns):
11210 * xmenu.c (syms_of_xmenu):
11211 * xsettings.c (syms_of_xsettings):
11212 * xterm.c (syms_of_xterm): Use DEFSYM.
11213
4228cf16
TZ
112142011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11215
cd3520a4 11216 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 11217
7fcccf1e
PE
112182011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11219
7efb4e0e
PE
11220 Integer and buffer overflow fixes (Bug#8873).
11221
ff5844ad
PE
11222 * print.c (printchar, strout): Check for string overflow.
11223 (PRINTPREPARE, printchar, strout):
11224 Don't set size unless allocation succeeds.
11225
90532f02
PE
11226 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11227 for sizes. Check for string overflow more accurately.
11228 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11229
6d84508d
PE
11230 * macros.c: Integer and buffer overflow fixes.
11231 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11232 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11233 Use ptrdiff_t, not int, for sizes.
11234 Don't increment bufsize until after realloc succeeds.
11235 Check for size-calculation overflow.
11236 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11237
437b2cb4
PE
11238 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11239
8b9ac8b4
PE
11240 * lread.c: Integer overflow fixes.
11241 (read_integer): Radix is now EMACS_INT, not int,
11242 to improve quality of diagnostics for out-of-range radices.
11243 Calculate buffer size correctly for out-of-range radices.
11244 (read1): Check for integer overflow in radices, and in
11245 read-circle numbers.
82cb60d3
PE
11246 (read_escape): Avoid int overflow.
11247 (Fload, openp, read_buffer_size, read1)
11248 (substitute_object_recurse, read_vector, read_list, map_obarray):
11249 Use ptrdiff_t, not int, for sizes.
11250 (read1): Use EMACS_INT, not int, for sizes.
20270765 11251 Check for size overflow.
8b9ac8b4 11252
7fcccf1e
PE
11253 * image.c (cache_image): Check for size arithmetic overflow.
11254
bfbbd7e7
PE
11255 * lread.c: Integer overflow issues.
11256 (saved_doc_string_size, saved_doc_string_length)
11257 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11258 Now ptrdiff_t, not int.
11259 (read1): Don't assume doc string length fits in int. Check for
11260 out-of-range doc string lengths.
11261 (read_list): Don't assume file position fits in int.
39019e54 11262 (read_escape): Check for hex character overflow.
bfbbd7e7 11263
4e323265
LL
112642011-06-22 Leo Liu <sdl.web@gmail.com>
11265
11266 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11267 Move to minibuffer.el.
11268
85fece3e
PE
112692011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11270
20b84ce9 11271 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
11272 The following patches are for when GLYPH_DEBUG && !XASSERT.
11273 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11274 * dispnew.c (flush_stdout):
11275 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11276 Mark as externally visible.
11277 * dispnew.c (check_window_matrix_pointers): Now static.
11278 * dispnew.c (window_to_frame_vpos):
11279 * xfns.c (unwind_create_frame):
11280 * xterm.c (x_check_font): Remove unused local.
11281 * scroll.c (CHECK_BOUNDS):
11282 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11283 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11284 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11285 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11286 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11287 Now static.
11288 (debug_method_add): Use va_list and vsprintf rather than relying
11289 on undefined behavior with wrong number of arguments.
11290 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11291 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11292 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11293 since we're not interested in debugging glyphs with old libraries.
11294 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11295 GCC 4.6.0's static checking.
11296
0766b489
PE
112972011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11298
31fd4b32
PE
11299 Integer overflow and signedness fixes (Bug#8873).
11300 A few related buffer overrun fixes, too.
11301
b79e8648
PE
11302 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11303
0766b489
PE
11304 * dispextern.h (struct face.stipple):
11305 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11306 (x_bitmap_mask, x_allocate_bitmap_record)
11307 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11308 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11309 (x_create_bitmap_from_xpm_data):
11310 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11311 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11312 (.bitmaps_last):
11313 * xfaces.c (load_pixmap):
11314 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11315 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11316 (.bitmaps_last, struct x_output.icon_bitmap):
11317 Use ptrdiff_t, not int, for bitmap indexes.
11318 (x_allocate_bitmap_record): Check for size overflow.
11319 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11320
b081724f
PE
11321 Use ptrdiff_t, not int, for overlay counts.
11322 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11323 * editfns.c (overlays_around, get_pos_property):
11324 * textprop.c (get_char_property_and_overlay):
11325 * xdisp.c (next_overlay_change, note_mouse_highlight):
11326 * xfaces.c (face_at_buffer_position):
21514da7
PE
11327 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11328 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11329 (Fnext_overlay_change, Fprevious_overlay_change)
11330 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 11331 Use ptrdiff_t, not int, for sizes.
21514da7 11332 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 11333
3de73e5e
PE
11334 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11335
2606c57b
PE
11336 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11337 (x_session_initialize): Do not assume string length fits in int.
11338
aaafe47a
PE
11339 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11340 This is unlikely, but can occur if DPI is outlandish.
11341
2674ddc8 11342 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
11343 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11344
28154962
PE
11345 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11346 * xrdb.c (magic_file_p, search_magic_path):
11347 Omit last arg SUFFIX; it was always 0. All callers changed.
11348 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11349
7de51af5
PE
11350 * xfont.c (xfont_match): Avoid need for strlen.
11351
25ed6cc3
PE
11352 * xfns.c: Don't assume strlen fits in int.
11353 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11354
4eab31dd
PE
11355 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11356 not unsigned long, as we prefer signed integers. All callers changed.
11357 Detect integer overflow in repeat count.
11358 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 11359 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 11360
171e2a58
PE
11361 * termcap.c: Don't assume sizes fit in int and never overflow.
11362 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11363 (gobble_line): Check for size-calculation overflow.
11364
ad39faca 11365 * minibuf.c (Fread_buffer):
6e5bb2dc 11366 * lread.c (intern, intern_c_string):
74ca2eb3
PE
11367 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11368 Don't assume string length fits in int.
11369
52c61c22 11370 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
11371 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11372
b5b8c9e5
PE
11373 * font.c: Don't assume string length fits in int.
11374 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11375 Use ptrdiff_t, not int.
ccd6111c
PE
11376 (font_intern_prop): Don't assume string length fits in int.
11377 Don't assume integer property fits in fixnum.
11378 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 11379
882f0d81 11380 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 11381 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
11382 Reformulate so as not to need the command string.
11383 Invoke gzip -cd rather than gunzip, as it's more portable.
11384 (lock_info_type, lock_file_1, lock_file):
11385 Don't assume pid_t and time_t fit in unsigned long.
11386 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11387 (current_lock_owner): Prefer signed type for sizes.
11388 Use memcpy, not strncpy, where memcpy is what is really wanted.
11389 Don't assume (via atoi) that time_t and pid_t fit in int.
11390 Check for time_t and/or pid_t out of range, e.g., via a network share.
11391 Don't alloca where an auto var works fine.
11392
93f4cf88
PE
11393 * fileio.c: Fix some integer overflow issues.
11394 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11395 Don't assume string length fits in int.
11396 (directory_file_name): Don't assume string length fits in long.
11397 (make_temp_name): Don't assume pid fits in int, or that its print
11398 length is less than 20.
11399
f3e92b69
PE
11400 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11401
1bfdaf10
PE
11402 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11403
35016e9a
PE
11404 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11405
3d1e65a1
PE
11406 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11407 We prefer signed integers, even for size calculations.
11408
0b963a93
PE
11409 * emacs.c: Don't assume string length fits in 'int'.
11410 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11411 (main): Don't invoke strlen when not needed.
11412
573f4b54
PE
11413 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11414 (XD_DEBUG_MESSAGE): Don't waste a byte.
11415
989f33ba
PE
11416 * callproc.c (getenv_internal_1, getenv_internal)
11417 (Fgetenv_internal):
965d34eb
PE
11418 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11419
e4d29b33
PE
11420 * lread.c (invalid_syntax): Omit length argument.
11421 All uses changed. This doesn't fix a bug, but it simplifies the
11422 code away from its former Hollerith-constant appearance, and it's
11423 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 11424 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 11425
eb49b136
PE
11426 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11427 This didn't break anything, but it didn't help either.
11428 It's confusing to put a bogus integer in a place where the actual
11429 value does not matter.
9f62aeb1 11430 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 11431 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 11432
15375a22
PE
11433 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11434 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11435 implementation.
b61cc01c
PE
11436 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11437 We prefer signed types, and the value cannot exceed the EMACS_INT
11438 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
11439 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11440 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11441 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 11442
53b2623d
PE
11443 * indent.c (sane_tab_width): New function.
11444 (current_column, scan_for_column, Findent_to, position_indentation)
11445 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 11446 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 11447
51cab52b 11448 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 11449
f2ed8a70
PE
11450 * lisp.h (lint_assume): New macro.
11451 * composite.c (composition_gstring_put_cache):
11452 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11453
abe80cc6
PE
11454 * editfns.c, insdel.c:
11455 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 11456
b02c740e
PE
11457 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11458
ebc96716
PE
11459 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11460
b4e50fa0 11461 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 11462 Use much-faster test for byte-length change.
311d5d7c 11463 Don't assume string byte-length fits in 'int'.
a4cf38e4 11464 Check that character arg fits in 'int'.
85461888 11465 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 11466
c0c1ee9f
PE
11467 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11468
a498d7f4
PE
11469 * fns.c (concat): Catch string overflow earlier.
11470 Do not rely on integer wraparound.
11471
51cab52b
PE
11472 * dispextern.h (struct it.overlay_strings_charpos)
11473 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
11474 * xdisp.c (forward_to_next_line_start)
11475 (back_to_previous_visible_line_start)
11476 (reseat_at_next_visible_line_start, next_element_from_buffer):
11477 Don't arbitrarily truncate the value of 'selective' to int.
11478
76031fad
PE
11479 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11480
5eb55db9
PE
11481 * composite.c: Don't truncate sizes to 'int'.
11482 (composition_gstring_p, composition_reseat_it)
11483 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
11484 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11485 not EMACS_UINT, for indexes.
5eb55db9 11486
0703a717
PE
11487 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11488
d6202519
PE
11489 * buffer.c: Include <verify.h>.
11490 (struct sortvec.priority, struct sortstr.priority):
8961a454 11491 Now EMACS_INT, not int.
c20998a7 11492 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
11493 (struct sortstr.size, record_overlay_string)
11494 (struct sortstrlist.size, struct sortlist.used):
11495 Don't truncate size to int.
11496 (record_overlay_string): Check for size-calculation overflow.
d6202519 11497 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 11498
d5a19415
JM
114992011-06-22 Jim Meyering <meyering@redhat.com>
11500
029529ac 11501 Don't leak an XBM-image-sized buffer
d5a19415
JM
11502 * image.c (xbm_load): Free the image buffer after using it.
11503
a9041e6c
PE
115042011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11505
11506 Port to Sun C.
11507 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11508 that Sun C diagnosed.
11509 * fns.c (secure_hash): Fix pointer signedness issue.
11510 * intervals.c (static_offset_intervals): New function.
11511 (offset_intervals): Use it.
11512
7f3f739f
LL
115132011-06-21 Leo Liu <sdl.web@gmail.com>
11514
11515 * deps.mk (fns.o):
11516 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11517 sha512.h.
11518
11519 * fns.c (secure_hash): Rename from crypto_hash_function and change
11520 the first arg to accept symbols.
5b66d427 11521 (Fsecure_hash): New primitive.
7f3f739f
LL
11522 (syms_of_fns): New symbols.
11523
76147d94
DD
115242011-06-20 Deniz Dogan <deniz@dogan.se>
11525
11526 * process.c (Fset_process_buffer): Clarify return value in
11527 docstring.
11528
7d7d0045
CY
115292011-06-18 Chong Yidong <cyd@stupidchicken.com>
11530
11531 * dispnew.c (add_window_display_history): Use BVAR.
11532
11533 * xdisp.c (debug_method_add): Use BVAR.
11534 (check_window_end, dump_glyph_matrix, dump_glyph)
11535 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11536
11537 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11538 Likewise.
11539
11540 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11541 check till after the cache is created in init_frame_faces.
11542
ff2bc410
SM
115432011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11544
11545 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11546
28177add
PE
115472011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11548
dd3482fe
PE
11549 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11550 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11551 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11552
393d71f3 11553 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
11554 * fileio.c (Finsert_file_contents):
11555 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11556 Remove the old (too-loose) buffer overflow checks.
11557 They weren't needed, since make_gap checks for buffer overflow.
11558 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11559 The old code merely checked for Emacs fixnum overflow, and relied
11560 on undefined (wraparound) behavior. The new code avoids undefined
11561 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11562
2e6813b0 11563 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
11564 Tune. Don't use wider integers than needed. Don't use alloca.
11565 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 11566
599a9e4f
PE
11567 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11568
99561444
PE
11569 * insdel.c, lisp.h (buffer_overflow): New function.
11570 (insert_from_buffer_1, replace_range, replace_range_2):
11571 * insdel.c (make_gap_larger):
11572 * editfns.c (Finsert_char):
11573 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11574
28177add
PE
11575 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11576
e69dafad
PE
115772011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11578
4baa020d 11579 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 11580
b1c46f02
PE
11581 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11582 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11583
e69dafad
PE
11584 * fileio.c: Don't assume EMACS_INT fits in off_t.
11585 (emacs_lseek): New static function.
11586 (Finsert_file_contents, Fwrite_region): Use it.
11587 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11588
566684ea
PE
11589 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11590
e6966cd6
PE
11591 * fns.c: Don't overflow int when computing a list length.
11592 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11593 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11594 truncation on 64-bit hosts. Check for QUIT every
11595 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11596 faster and is responsive enough.
11597 (Flength): Report an error instead of overflowing an integer.
11598 (Fsafe_length): Return a float if the value is not representable
11599 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 11600 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 11601 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 11602
dd0b0efb
PE
11603 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11604 (header_size, word_size): New constants.
11605 (allocate_vectorlike): Don't check size overflow here.
11606 (allocate_vector): Check it here instead, since this is the only
11607 caller of allocate_vectorlike that could cause overflow.
11608 Check that the new vector's length is representable as a fixnum.
11609
86fe5cfe
PE
11610 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11611 The previous code was bogus. For example, next_almost_prime (32)
11612 returned 39, which is undesirable as it is a multiple of 3; and
11613 next_almost_prime (24) returned 25, which is a multiple of 5 so
11614 why was the code bothering to check for multiples of 7?
11615
80e88859
PE
11616 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11617
4a2f0ad6
PE
11618 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11619
f66c7cf8
PE
11620 Variadic C functions now count arguments with ptrdiff_t.
11621 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11622 Back then I didn't know that the Emacs coding style prefers signed int.
11623 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
11624 were being counted with int, which may truncate counts on 64-bit
11625 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
11626 * lisp.h (struct Lisp_Subr.function.aMANY)
11627 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11628 Arg counts are now ptrdiff_t, not size_t.
11629 All variadic functions and their callers changed accordingly.
11630 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11631 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11632 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11633 * callint.c (Fcall_interactively): Check arg count for overflow,
11634 to avoid potential buffer overrun. Use signed char, not 'int',
11635 for 'varies' array, so that we needn't bother to check its size
11636 calculation for overflow.
11637 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11638 * eval.c (apply_lambda):
11639 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11640 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11641 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11642
a1759b76
PE
11643 * callint.c (Fcall_interactively): Don't use index var as event count.
11644
d96be9fc
PE
11645 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11646 * mem-limits.h (SIZE): Remove; no longer used.
11647
a690a978 11648 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 11649
578c21e6
PE
11650 Remove unnecessary casts.
11651 * xterm.c (x_term_init):
11652 * xfns.c (x_set_border_pixel):
11653 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11654 These aren't needed now that we assume ANSI C.
11655
96f53c6c
PE
11656 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11657 It's more likely to cause problems (due to unsigned overflow)
11658 than to cure them.
11659
83c77d31
PE
11660 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11661
ee2079f1
PE
11662 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11663
6da65536
PE
11664 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11665
7147c4a4
PE
11666 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11667
193e32d9
PE
11668 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11669
e5533da6
PE
11670 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11671
9910e595
PE
11672 GLYPH_CODE_FACE returns EMACS_INT, not int.
11673 * dispextern.h (merge_faces):
11674 * xfaces.c (merge_faces):
01103c44
PE
11675 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11676 Don't assume EMACS_INT fits in int.
9910e595 11677
2638320e
PE
11678 * character.h (CHAR_VALID_P): Remove unused parameter.
11679 * fontset.c, lisp.h, xdisp.c: All uses changed.
11680
045eb8d9
PE
11681 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11682
c1f134b5
PE
11683 * fns.c (concat): Minor tuning based on overflow analysis.
11684 This doesn't fix any bugs. Use int to hold character, instead
11685 of constantly refetching from Emacs object. Use XFASTINT, not
11686 XINT, for value known to be a character. Don't bother comparing
11687 a single byte to 0400, as it's always less.
11688
395fcb93 11689 * floatfns.c (Fexpt):
327eeec8
PE
11690 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11691
abbd3d23
PE
11692 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11693 for characters.
11694
684a03ef
PE
11695 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11696
0fed43f3
PE
11697 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11698 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11699 incorrectly succeed when S was a string, because 4294967386 was
11700 truncated before it was used.
11701
8fd02eb7
PE
11702 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11703 Otherwise, an out-of-range integer could cause undefined behavior
11704 on a 64-bit host.
11705
f8c86b69
PE
11706 * composite.c: Use int, not EMACS_INT, for characters.
11707 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11708 EMACS_INT, for values that are known to be in character range.
11709 This doesn't fix any bugs but is the usual style inside Emacs and
11710 may generate better code on 32-bit machines.
11711
34206dd2
PE
11712 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11713 This is for reasons similar to the recent CHAR_STRING fix.
11714 * charset.c (Fencode_char): Check that character arg is actually
11715 a character. Pass an int to ENCODE_CHAR.
11716 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11717 wider than 'int', as a compile-time check to prevent future regressions
11718 in this area.
11719
c5958d4c 11720 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
11721
11722 Make sure a 64-bit char is never passed to CHAR_STRING.
11723 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11724 by silently ignoring the top 32 bits, allowing some values
11725 that were far too large to be valid characters.
11726 * character.h: Include <verify.h>.
11727 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11728 arguments are no wider than unsigned, as a compile-time check
11729 to prevent future regressions in this area.
11730 * data.c (Faset):
01103c44 11731 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
11732 (Fsubst_char_in_region):
11733 * fns.c (concat):
11734 * xdisp.c (decode_mode_spec_coding):
11735 Adjust to CHAR_STRING's new requirement.
11736 * editfns.c (Finsert_char, Fsubst_char_in_region):
11737 * fns.c (concat): Check that character args are actually
11738 characters. Without this test, these functions did the wrong
11739 thing with wildly out-of-range values on 64-bit hosts.
11740
d37ca623
PE
11741 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11742 These casts should not be needed on 32-bit hosts, either.
11743 * keyboard.c (read_char):
11744 * lread.c (Fload): Remove casts to unsigned.
11745
ea204efb
PE
11746 * lisp.h (UNSIGNED_CMP): New macro.
11747 This fixes comparison bugs on 64-bit hosts.
11748 (ASCII_CHAR_P): Use it.
11749 * casefiddle.c (casify_object):
01103c44 11750 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
11751 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11752 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11753 * dispextern.h (FACE_FROM_ID):
11754 * keyboard.c (read_char): Use UNSIGNED_CMP.
11755
41cb286c
PE
11756 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11757 not to EMACS_INT, to avoid GCC warning.
11758
4a1b9832
PE
11759 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11760
55daad71
PE
11761 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11762 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11763 isn't needed on 32-bit machines.
8f95c75c 11764
01103c44
PE
11765 * buffer.c (Fgenerate_new_buffer_name):
11766 Use EMACS_INT for count, not int.
0ceccced 11767 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
11768
11769 * data.c (Qcompiled_function): Now static.
11770
c6f072e7
PE
11771 * window.c (window_body_lines): Now static.
11772
20ce5912
PE
11773 * image.c (gif_load): Rename local to avoid shadowing.
11774
9c4c5f81
PE
11775 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11776 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11777 * alloc.c (make_save_value): Integer argument is now of type
11778 ptrdiff_t, not int.
11779 (mark_object): Use ptrdiff_t, not int.
11780 * lisp.h (pD): New macro.
11781 * print.c (print_object): Use it.
11782
c0c5c8ae
PE
11783 * alloc.c: Use EMACS_INT, not int, to count objects.
11784 (total_conses, total_markers, total_symbols, total_vector_size)
11785 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
11786 (total_free_floats, total_floats, total_free_intervals)
11787 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
11788 Now EMACS_INT, not int. All uses changed.
11789 (Fgarbage_collect): Compute overall total using a double, so that
11790 integer overflow is less likely to be a problem. Check for overflow
11791 when converting back to an integer.
5a25e253
PE
11792 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11793 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11794 These were 'int' variables that could overflow on 64-bit hosts;
11795 they were never used, so remove them instead of repairing them.
211a0b2a 11796 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
11797 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11798 Previously, this ceilinged at INT_MAX, but that doesn't work on
11799 64-bit machines.
e46bb31a 11800 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 11801
c78baabf 11802 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 11803 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
11804 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11805 when a (possibly-narrower) signed value would do just as well.
11806 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 11807
c9d624c6
PE
11808 * alloc.c: Catch some string size overflows that we were missing.
11809 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11810 for convenience in STRING_BYTES_MAX.
11811 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11812 The definition here is exact; the one in lisp.h was approximate.
11813 (allocate_string_data): Check for string overflow. This catches
11814 some instances we weren't catching before. Also, it catches
11815 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11816 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11817 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 11818
c9d624c6
PE
11819 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11820 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 11821 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 11822
353032ce
PE
11823 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11824
2bccce07
PE
11825 * alloc.c (Fmake_string): Check for out-of-range init.
11826
0ac30604
SM
118272011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11828
11829 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11830
c195f2de
JD
118312011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11832
11833 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11834 xg_get_default_scrollbar_width.
11835
11836 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11837 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11838 (style_changed_cb): Call update_theme_scrollbar_width and call
11839 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11840 all frames (Bug#8505).
11841 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11842 Call gtk_window_set_resizable if HAVE_GTK3.
11843 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11844 and height if HAVE_GTK3 (Bug#8505).
11845 (scroll_bar_width_for_theme): New variable.
11846 (update_theme_scrollbar_width): New function.
11847 (xg_get_default_scrollbar_width): Move code to
11848 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11849 (xg_initialize): Call update_theme_scrollbar_width.
11850
11851 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11852
11853 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11854
e10ac9f1
MR
118552011-06-12 Martin Rudalics <rudalics@gmx.at>
11856
11857 * frame.c (make_frame): Call other_buffer_safely instead of
11858 other_buffer.
11859
11860 * window.c (temp_output_buffer_show): Call display_buffer with
11861 second argument Vtemp_buffer_show_specifiers and reset latter
11862 immediately after the call.
11863 (Vtemp_buffer_show_specifiers): New variable.
11864 (auto_window_vscroll_p, next_screen_context_lines)
11865 (Vscroll_preserve_screen_position): Remove leading asterisks from
11866 doc-strings.
11867
2d3c217e 118682011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 11869
7b7f97e8 11870 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
11871 * buffer.c (Qclone_number): Remove for now, as it's unused.
11872 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11873 (record_buffer): Remove unused local.
11874 * frame.c (other_visible_frames, frame_buffer_list): Now static.
11875 (set_frame_buffer_list): Remove; unused.
11876 * frame.h (other_visible_frames): Remove decl.
11877 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11878 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11879 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11880 if HAVE_GPM.
11881 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11882 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11883 Define only if HAVE_GPM.
11884 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11885 (update_hints_inhibit): Remove; never set. All uses removed.
11886 * widgetprv.h (emacsFrameClassRec): Remove decl.
11887 * window.c (delete_deletable_window): Now returns void, since it
11888 wasn't returning anything.
11889 (compare_window_configurations): Remove unused locals.
11890 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11891 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
11892 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11893 the same widths as pointers. This follows up on the 2011-05-06 patch.
11894 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11895 * xterm.h: Likewise.
11896 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11897
1384b89e
JB
118982011-06-12 Juanma Barranquero <lekktu@gmail.com>
11899
11900 * makefile.w32-in: Update dependencies.
11901 (LISP_H): Add lib/intprops.h.
11902
1100a63c
CY
119032011-06-11 Chong Yidong <cyd@stupidchicken.com>
11904
11905 * image.c (gif_load): Add animation frame delay to the metadata.
11906 (syms_of_image): Use DEFSYM. New symbol `delay'.
11907
6198ccd0
MR
119082011-06-11 Martin Rudalics <rudalics@gmx.at>
11909
11910 * window.c (delete_deletable_window): Re-add.
11911 (Fset_window_configuration): Rewrite to handle dead buffers and
11912 consequently deletable windows.
11913 (window_tree, Fwindow_tree): Remove. Supply functionality in
11914 window.el.
11915 (compare_window_configurations): Simplify code.
11916
b6e3633c
AS
119172011-06-11 Andreas Schwab <schwab@linux-m68k.org>
11918
1ab0dee5
AS
11919 * image.c (imagemagick_load_image): Fix type mismatch.
11920 (Fimagemagick_types): Likewise.
11921
b6e3633c
AS
11922 * window.h (replace_buffer_in_windows): Declare.
11923
9397e56f
MR
119242011-06-11 Martin Rudalics <rudalics@gmx.at>
11925
11926 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
11927 Qclone_number. Remove external declaration of Qdelete_window.
11928 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
11929 code.
640c8776
SM
11930 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
11931 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
11932 (Fother_buffer): Rewrite doc-string. Major rewrite for new
11933 buffer list implementation.
11934 (other_buffer_safely): New function.
11935 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
11936 calls to replace_buffer_in_windows and
11937 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
11938 if allowed.
11939 (record_buffer): Inhibit quitting and rewrite using quittable
11940 functions. Run Qbuffer_list_update_hook if allowed.
11941 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
11942 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
11943 Move switch-to-buffer to window.el.
9397e56f
MR
11944 (bury-buffer): Move to window.el.
11945 (Vbuffer_list_update_hook): New variable.
11946
11947 * lisp.h (other_buffer_safely): Add prototype in buffer.c
11948 section.
11949
11950 * window.h (resize_frame_windows): Move up in code.
11951 (Fwindow_frame): Remove EXFUN.
11952 (replace_buffer_in_all_windows): Remove prototype.
11953 (replace_buffer_in_windows_safely): Add prototype.
11954
11955 * window.c: Declare Qdelete_window static again. Move down
11956 declaration of select_count.
11957 (Fnext_window, Fprevious_window): Rewrite doc-strings.
11958 (Fother_window): Move to window.el.
11959 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
11960 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
11961 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
11962 window.el.
11963 (replace_buffer_in_windows): Implement by calling
11964 Qreplace_buffer_in_windows.
11965 (replace_buffer_in_all_windows): Remove with some functionality
11966 moved into replace_buffer_in_windows_safely.
11967 (replace_buffer_in_windows_safely): New function.
11968 (select_window_norecord, select_frame_norecord): Move in front
11969 of run_window_configuration_change_hook. Remove now obsolete
11970 declarations.
640c8776
SM
11971 (Fset_window_buffer): Rewrite doc-string.
11972 Call Qrecord_window_buffer.
9397e56f
MR
11973 (keys_of_window): Move binding for other-window to window.el.
11974
b50691aa
CY
119752011-06-11 Chong Yidong <cyd@stupidchicken.com>
11976
11977 * dispextern.h (struct image): Replace data member, whose int_val
11978 and ptr_val fields were not used by anything, with a single
11979 lisp_val object.
11980
11981 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
11982 (gif_clear_image, gif_load, imagemagick_load_image)
11983 (gs_clear_image, gs_load): Callers changed.
11984
3f754b86
PE
119852011-06-10 Paul Eggert <eggert@cs.ucla.edu>
11986
cca69397
PE
11987 * buffer.h: Include <time.h>, for time_t.
11988 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
11989
109e28d0
PE
11990 Fix minor problems found by static checking.
11991
60737f02
PE
11992 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
11993
4b66faf3
PE
11994 Make identifiers static if they are not used in other modules.
11995 * data.c (Qcompiled_function, Qframe, Qvector):
11996 * image.c (QimageMagick, Qsvg):
11997 * minibuf.c (Qmetadata):
11998 * window.c (resize_window_check, resize_root_window): Now static.
11999 * window.h (resize_window_check, resize_root_window): Remove decls.
12000
109e28d0
PE
12001 * window.c (window_deletion_count, delete_deletable_window):
12002 Remove; unused.
46a4ce9e
PE
12003 (window_body_lines): Now static.
12004 (Fdelete_other_windows_internal): Mark vars as initialized.
12005 Make sure 'resize_failed' is initialized.
12006 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12007 (resize_window_apply): Remove unused local.
12008 * window.h (delete_deletable_window): Remove decl.
12009
109e28d0 12010 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
12011 (imagemagick_load_image): Fix pointer signedness problem by changing
12012 last arg from unsigned char * to char *. All uses changed.
12013 Also, fix a local for similar reasons.
12014 Remove unused locals. Remove locals to avoid shadowing.
12015 (fn_rsvg_handle_free): Remove; unused.
12016 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 12017 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 12018
3f754b86
PE
12019 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12020
2547adb1
CY
120212011-06-10 Chong Yidong <cyd@stupidchicken.com>
12022
12023 * image.c (gif_load): Fix omitted cast error introduced by
12024 2011-06-06 change.
12025
2c8e37d4
MR
120262011-06-10 Martin Rudalics <rudalics@gmx.at>
12027
12028 * window.h (resize_proportionally, orig_total_lines)
12029 (orig_top_line): Remove from window structure.
12030 (set_window_height, set_window_width, change_window_heights)
12031 (Fdelete_window): Remove prototypes.
12032 (resize_frame_windows): Remove duplicate declaration.
12033
440a42e3
EZ
120342011-06-10 Eli Zaretskii <eliz@gnu.org>
12035
12036 * window.h (resize_frame_windows, resize_window_check)
12037 (delete_deletable_window, resize_root_window)
12038 (resize_frame_windows): Declare prototypes.
12039
12040 * window.c (resize_window_apply): Make definition be "static" to
12041 match the prototype.
12042
562dd5e9
MR
120432011-06-10 Martin Rudalics <rudalics@gmx.at>
12044
12045 * window.c: Remove declarations of Qwindow_size_fixed,
12046 window_min_size_1, window_min_size_2, window_min_size,
12047 size_window, window_fixed_size_p, enlarge_window, delete_window.
12048 Remove static from declaration of Qdelete_window, it's
12049 temporarily needed by Fbury_buffer.
12050 (replace_window): Don't assign orig_top_line and
12051 orig_total_lines.
12052 (Fdelete_window, delete_window): Remove. Window deletion is
12053 handled by window.el.
640c8776
SM
12054 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12055 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
12056 (Fdelete_other_windows): Remove. Deleting other windows is
12057 handled by window.el.
12058 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12059 handled in window.el.
12060 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12061 Window minimum sizes are handled in window.el.
12062 (shrink_windows, size_window, set_window_height)
12063 (set_window_width, change_window_heights, window_height)
12064 (window_width, CURBEG, CURSIZE, enlarge_window)
12065 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12066 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12067 handled in window.el.
12068 (make_dummy_parent): Rename to make_parent_window and give it a
12069 second argument horflag.
12070 (make_window): Don't set resize_proportionally any more.
12071 (Fsplit_window): Remove. Windows are split in window.el.
12072 (save_restore_action, save_restore_orig_size)
12073 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12074 Resize mini windows in window.el.
12075 (grow_mini_window, shrink_mini_window): Implement by calling
12076 Qresize_root_window_vertically, resize_window_check and
12077 resize_window_apply.
640c8776
SM
12078 (saved_window, Fset_window_configuration, save_window_save):
12079 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
12080 resize_proportionally.
12081 (window_min_height, window_min_width): Move to window.el.
12082 (keys_of_window): Move bindings for delete-other-windows,
12083 split-window, delete-window and enlarge-window to window.el.
12084
12085 * buffer.c: Temporarily extern Qdelete_window.
12086 (Fbury_buffer): Temporarily call Qdelete_window instead of
12087 Fdelete_window (Fbury_buffer will move to window.el soon).
12088
12089 * frame.c (set_menu_bar_lines_1): Remove code handling
12090 orig_top_line and orig_total_lines.
12091
12092 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12093 set_window_height but set heights directly.
12094 (change_frame_size_1): Use resize_frame_windows.
12095
12096 * xdisp.c (init_xdisp): Don't use set_window_height but set
12097 heights directly.
12098
640c8776
SM
12099 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12100 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
12101 run_window_configuration_change_hook.
12102
12103 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12104 instead of change_window_heights and run
12105 run_window_configuration_change_hook.
12106
1a13852e
MR
121072011-06-09 Martin Rudalics <rudalics@gmx.at>
12108
12109 * window.c (replace_window): Rename second argument REPLACEMENT to
12110 NEW. New third argument SETFLAG. Rewrite.
12111 (delete_window, make_dummy_parent): Call replace_window with
12112 third argument 1.
12113 (window_list_1): Move down in code.
12114 (run_window_configuration_change_hook): Move set_buffer part
12115 before select_frame_norecord part in order to unwind correctly.
12116 Rename count1 to count.
12117 (recombine_windows, delete_deletable_window, resize_root_window)
12118 (Fdelete_other_windows_internal)
12119 (Frun_window_configuration_change_hook, make_parent_window)
12120 (resize_window_check, resize_window_apply, Fresize_window_apply)
12121 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
12122 (Fdelete_window_internal, Fresize_mini_window_internal):
12123 New functions.
1a13852e
MR
12124 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12125
f3d1777e
MR
121262011-06-08 Martin Rudalics <rudalics@gmx.at>
12127
496e208e
MR
12128 * window.h (window): Add some new members to window structure -
12129 normal_lines, normal_cols, new_total, new_normal, clone_number,
12130 splits, nest, prev_buffers, next_buffers.
12131 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 12132 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 12133
f3d1777e
MR
12134 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12135 Remove.
496e208e
MR
12136 (make_dummy_parent): Set new members of windows structure.
12137 (make_window): Move down in code. Handle new members of window
12138 structure.
12139 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12140 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12141 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12142 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
12143 (Fset_window_next_buffers, Fset_window_clone_number):
12144 New functions.
496e208e
MR
12145 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12146 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12147 Doc-string fixes.
12148 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12149 Argument WINDOW can be now internal window too.
12150 (Fwindow_use_time): Move up in code.
12151 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12152 Rewrite doc-string.
12153 (Fset_window_configuration, saved_window)
12154 (Fcurrent_window_configuration, save_window_save): Handle new
12155 members of window structure.
b9e809c2
MR
12156 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12157 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12158 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12159 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12160 Qget_mru_window, Qresize_root_window,
12161 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12162 Qauto_buffer_name; staticpro them.
f3d1777e 12163
abde8f8c
MR
121642011-06-07 Martin Rudalics <rudalics@gmx.at>
12165
12166 * window.c (Fwindow_total_size, Fwindow_left_column)
12167 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12168 (Fwindow_list_1): New functions.
12169 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
12170 (Fwindow_width, Fscroll_left, Fscroll_right):
12171 Use window_body_cols instead of window_box_text_cols.
12172 (delete_window, Fset_window_configuration):
12173 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
12174 (delete_all_subwindows): Take a window as argument and not a
12175 structure. Rewrite.
190b47e6
MR
12176 (window_loop): Remove handling of GET_LRU_WINDOW and
12177 GET_LARGEST_WINDOW.
12178 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
12179
12180 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
12181 window_box_text_cols. delete_all_subwindows now takes a
12182 Lisp_Object as argument.
abde8f8c 12183
640c8776
SM
12184 * indent.c (compute_motion, Fcompute_motion):
12185 Use window_body_cols instead of window_box_text_cols.
abde8f8c 12186
fa8a67e6
MR
12187 * frame.c (delete_frame): Call delete_all_subwindows with root
12188 window as argument.
12189
a54e3482
DC
121902011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12191
12192 * fns.c (Fputhash): Document return value.
12193
60002bf5
CY
121942011-06-06 Chong Yidong <cyd@stupidchicken.com>
12195
12196 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12197
0c671da6 121982011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 12199
b862a52a 12200 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 12201
be44ca6c
PE
12202 Check for overflow when converting integer to cons and back.
12203 * charset.c (Fdefine_charset_internal, Fdecode_char):
12204 Use cons_to_unsigned to catch overflow.
12205 (Fencode_char): Use INTEGER_TO_CONS.
12206 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12207 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12208 * data.c (long_to_cons, cons_to_long): Remove.
12209 (cons_to_unsigned, cons_to_signed): New functions.
12210 These signal an error for invalid or out-of-range values.
12211 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12212 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12213 * font.c (Ffont_variation_glyphs):
12214 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12215 * lisp.h: Include <intprops.h>.
12216 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12217 (cons_to_signed, cons_to_unsigned): New decls.
12218 (long_to_cons, cons_to_long): Remove decls.
12219 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12220 (Fprimitive_undo): Use CONS_TO_INTEGER.
12221 * xfns.c (Fx_window_property): Likewise.
12222 * xselect.c: Include <limits.h>.
12223 (x_own_selection, selection_data_to_lisp_data):
12224 Use INTEGER_TO_CONS.
12225 (x_handle_selection_request, x_handle_selection_clear)
12226 (x_get_foreign_selection, Fx_disown_selection_internal)
12227 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12228 (lisp_data_to_selection_data): Use cons_to_unsigned.
12229 (x_fill_property_data): Use cons_to_signed.
12230 Report values out of range.
12231
d1f3d2af
PE
12232 Check for buffer and string overflow more precisely.
12233 * buffer.h (BUF_BYTES_MAX): New macro.
12234 * lisp.h (STRING_BYTES_MAX): New macro.
12235 * alloc.c (Fmake_string):
12236 * character.c (string_escape_byte8):
12237 * coding.c (coding_alloc_by_realloc):
12238 * doprnt.c (doprnt):
12239 * editfns.c (Fformat):
12240 * eval.c (verror):
12241 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12242 since they may not be the same number.
12243 * editfns.c (Finsert_char):
12244 * fileio.c (Finsert_file_contents):
12245 Likewise for BUF_BYTES_MAX.
12246
dd52fcea
PE
12247 * image.c: Use ptrdiff_t, not int, for sizes.
12248 (slurp_file): Switch from int to ptrdiff_t.
12249 All uses changed.
12250 (slurp_file): Check that file size fits in both size_t (for
12251 malloc) and ptrdiff_t (for sanity and safety).
12252
7f9bbdbb
PE
12253 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12254 if b->modtime has its maximal value.
12255
dfe18f82
PE
12256 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12257
84acfcf0
PE
12258 Don't assume time_t can fit into int.
12259 * buffer.h (struct buffer.modtime): Now time_t, not int.
12260 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12261 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12262
ccd9a01a
PE
12263 Minor fixes for signed vs unsigned integers.
12264 * character.h (MAYBE_UNIFY_CHAR):
12265 * charset.c (maybe_unify_char):
12266 * keyboard.c (read_char, reorder_modifiers):
12267 XINT -> XFASTINT, since the integer must be nonnegative.
12268 * ftfont.c (ftfont_spec_pattern):
12269 * keymap.c (access_keymap, silly_event_symbol_error):
12270 XUINT -> XFASTINT, since the integer must be nonnegative.
12271 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12272 since it makes no difference and we prefer signed.
12273 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12274 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12275 nonnegative.
12276
d6d100dd
SM
122772011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12278
12279 * window.h (Fwindow_frame): Declare.
12280
2b6148e4
PE
122812011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12282
12283 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12284 (SPARE_MEMORY): Always define.
12285 (LARGE_REQUEST): Remove.
12286 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12287
f230ecc9
MR
122882011-06-06 Martin Rudalics <rudalics@gmx.at>
12289
727e958e
MR
12290 * lisp.h: Move EXFUNS for Fframe_root_window,
12291 Fframe_first_window and Fset_frame_selected_window to window.h.
12292
12293 * window.h: Move EXFUNS for Fframe_root_window,
12294 Fframe_first_window and Fset_frame_selected_window here from
12295 lisp.h.
12296
12297 * frame.c (Fwindow_frame, Fframe_first_window)
12298 (Fframe_root_window, Fframe_selected_window)
12299 (Fset_frame_selected_window): Move to window.c.
12300 (Factive_minibuffer_window): Move to minibuf.c.
12301 (Fother_visible_frames_p): New function.
12302
12303 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12304
f230ecc9
MR
12305 * window.c (decode_window, decode_any_window): Move up in code.
12306 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12307 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
12308 (Fwindow_buffer): Move up and rewrite doc-string.
12309 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12310 (Fwindow_prev): New functions.
727e958e
MR
12311 (Fwindow_frame): Move here from frame.c. Accept any window as
12312 argument.
12313 (Fframe_root_window, Fframe_first_window)
12314 (Fframe_selected_window): Move here from frame.c. Accept frame
12315 or arbitrary window as argument. Update doc-strings.
12316 (Fminibuffer_window): Move up in code.
12317 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
12318 (Fset_frame_selected_window): Move here from frame.c.
12319 Marginal rewrite.
727e958e
MR
12320 (Fselected_window, select_window, Fselect_window): Move up in
12321 code. Minor doc-string fixes.
f230ecc9 12322
4d09bcf6
PE
123232011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12324
12325 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12326 Do not assume that spare memory exists; that assumption is valid
12327 only if SYSTEM_MALLOC.
12328 (LARGE_REQUEST): New macro, so that the issue of large requests
12329 is separated from the issue of spare memory.
12330
810928a2
AS
123312011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12332
172418ad
AS
12333 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12334 format. (Bug#8806)
12335
43f862f7
AS
12336 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12337
810928a2
AS
12338 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12339 before statements.
12340
a059fe24
JD
123412011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12342
12343 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12344
12345 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12346
12347 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12348 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12349
989bf368
JB
123502011-06-05 Juanma Barranquero <lekktu@gmail.com>
12351
12352 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12353
4b80f674
CY
123542011-06-04 Chong Yidong <cyd@stupidchicken.com>
12355
12356 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12357 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
12358 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12359 New error handlers.
4b80f674
CY
12360 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12361 Obey Vx_select_enable_clipboard_manager. Catch errors in
12362 x_clipboard_manager_save (Bug#8779).
12363 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 12364 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 12365
99a33b77 123662011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
12367
12368 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12369
99a33b77 123702011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
12371
12372 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12373 in the current matrix if keep_current_p is non-zero.
12374
8264569d
EZ
123752011-06-04 Eli Zaretskii <eliz@gnu.org>
12376
12377 * bidi.c (bidi_level_of_next_char): Fix last change.
12378
57f97249
EZ
123792011-06-03 Eli Zaretskii <eliz@gnu.org>
12380
fec2107c 12381 Support bidi reordering of text covered by display properties.
57f97249 12382
fec2107c
EZ
12383 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12384 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12385 (bidi_cache_search, bidi_cache_iterator_state)
12386 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
12387 (bidi_level_of_next_char, bidi_move_to_visually_next):
12388 Support character positions inside a run of characters covered by a
fec2107c
EZ
12389 display string.
12390 (bidi_paragraph_init, bidi_resolve_explicit_1)
12391 (bidi_level_of_next_char): Call bidi_fetch_char and
12392 bidi_fetch_char_advance instead of FETCH_CHAR and
12393 FETCH_CHAR_ADVANCE.
12394 (bidi_init_it): Initialize new members.
12395 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12396 definitions.
12397 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12398 instead of using explicit *_CHAR codes.
d6d100dd
SM
12399 (bidi_resolve_explicit, bidi_resolve_weak):
12400 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
12401 bidirectional text is supported only in multibyte buffers.
12402 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12403 it to initialize the frame_window_p member of struct bidi_it.
12404 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12405 (bidi_resolve_explicit, bidi_resolve_weak)
12406 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12407 bidi_it->nchars is non-positive.
12408 (bidi_level_of_next_char): Don't try to lookup the cache for the
12409 next/previous character if nothing is cached there yet, or if we
12410 were just reseat()'ed to a new position.
c40e2fb2 12411
0e14fe90
EZ
12412 * xdisp.c (set_cursor_from_row): Set start and stop points
12413 according to the row's direction when priming the loop that looks
12414 for the glyph on which to display cursor.
12415 (single_display_spec_intangible_p): Function deleted.
12416 (display_prop_intangible_p): Reimplement to call
12417 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
12418 Accept 3 additional arguments needed by handle_display_spec.
12419 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
12420 values: lists, `(when COND...)' forms, etc.
12421 (single_display_spec_string_p): Support property values that are
12422 lists with the argument STRING its top-level element.
12423 (display_prop_string_p): Fix the condition for processing a
12424 property that is a list to be consistent with handle_display_spec.
fec2107c 12425 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
12426 last portion of handle_display_prop.
12427 (compute_display_string_pos): Accept additional argument
12428 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12429 value of a `display' property is a "replacing spec".
12430 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12431 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12432 the display property, but just return a value indicating whether
12433 the display property will replace the characters it covers.
12434 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12435 frame_window_p members of struct bidi_it.
d6d100dd
SM
12436 (compute_display_string_pos, compute_display_string_end):
12437 New functions.
fec2107c
EZ
12438 (push_it): Accept second argument POSITION, where pop_it should
12439 jump to continue iteration.
12440 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 12441
fec2107c
EZ
12442 * keyboard.c (adjust_point_for_property): Adjust the call to
12443 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
12444
12445 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
12446 (bidi_init_it): Update prototypes.
12447 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
12448 (compute_display_string_pos, compute_display_string_end):
12449 Declare prototypes.
fec2107c
EZ
12450 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12451 EMACS_INT.
fc6f18ce 12452
40087514 124532011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 12454
57f53182
PE
12455 Malloc failure behavior now depends on size of allocation.
12456 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12457 * lisp.h: Change signatures accordingly.
12458 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12459 All callers changed. (Bug#8762)
12460
12461 * gnutls.c: Use Emacs's memory allocators.
12462 Without this change, the gnutls library would invoke malloc etc.
12463 directly, which causes problems on non-SYNC_INPUT hosts, and which
12464 runs afoul of improving memory_full behavior. (Bug#8761)
12465 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12466 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12467 xfree instead of the default malloc, realloc, free.
12468 (Fgnutls_boot): No need to check for memory allocation failure,
12469 since xmalloc does that for us.
12470
ac32cd99 12471 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
12472 * category.c (hash_get_category_set):
12473 * ccl.c (ccl_driver):
12474 * charset.c (Fdefine_charset_internal):
12475 * charset.h (struct charset.hash_index):
12476 * composite.c (get_composition_id, gstring_lookup_cache)
12477 (composition_gstring_put_cache):
12478 * composite.h (struct composition.hash_index):
12479 * dispextern.h (struct image.hash):
12480 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12481 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12482 (hashfn_equal, hashfn_user_defined, make_hash_table)
12483 (maybe_resize_hash_table, hash_lookup, hash_put)
12484 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12485 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12486 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12487 * image.c (make_image, search_image_cache, lookup_image)
12488 (xpm_put_color_table_h):
12489 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 12490 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 12491 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 12492 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
12493 * alloc.c (allocate_vectorlike):
12494 Check for overflow in vector size calculations.
12495 * ccl.c (ccl_driver):
12496 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
12497 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12498 need to be updated by these changes.
40087514
PE
12499 * fns.c (make_hash_table, maybe_resize_hash_table):
12500 Check for integer overflow with large hash tables.
0de4bb68
PE
12501 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12502 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12503 (SXHASH_REDUCE): New macro.
12504 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12505 Use it instead of discarding useful hash info with large hash values.
12506 (sxhash_float): New function.
12507 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12508 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
12509 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12510 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
12511 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12512 Adjust signatures to match updated version of code.
12513 (consing_since_gc): Now EMACS_INT, since a single hash table can
12514 use more than INT_MAX bytes.
12515
698d32e2
DN
125162011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12517
12518 Make it possible to build with GCC-4.6+ -O2 -flto.
12519
12520 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12521
fd6fa53f
SM
125222011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12523
12524 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12525 Call minibuffer-inactive-mode.
12526
864db017
JB
125272011-05-31 Juanma Barranquero <lekktu@gmail.com>
12528
12529 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12530 Update dependencies.
12531
2ad0baf4
DN
125322011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12533
12534 * data.c (init_data): Remove code for UTS, this system is not
12535 supported anymore.
12536
4fcc2638
DN
125372011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12538
12539 Don't force ./temacs to start in terminal mode.
12540
12541 * frame.c (make_initial_frame): Initialize faces in all cases, not
12542 only when CANNOT_DUMP is defined.
12543 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12544
c56e0fd5
DN
125452011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12546
12547 * dispnew.c (add_window_display_history): Use const for the string
12548 pointer. Remove declaration, not needed.
12549
333d54da 125502011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 12551
55d4c1b2 12552 Use 'inline', not 'INLINE'.
333d54da 12553 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
12554 * alloc.c, fontset.c (INLINE): Remove.
12555 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12556 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12557 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12558 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12559 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12560
738db178
DN
125612011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12562
12563 Make it possible to run ./temacs.
12564
12565 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12566 syms_of_callproc does the same thing. Remove test for
12567 "initialized", do it in the caller.
12568 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12569
620c53a6
SM
125702011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12571
12572 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12573 (read_minibuf): Use get_minibuffer.
12574 (syms_of_minibuf): Use DEFSYM.
12575 (Qmetadata): New var.
12576 * data.c (Qbuffer): Don't make it static.
12577 (syms_of_data): Use DEFSYM.
12578
e003a292
PE
125792011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12580
12581 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12582 (CCL_CODE_MIN): New macro.
12583
ed008a6d
PE
125842011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12585
3687c2ef
PE
12586 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12587
ed008a6d
PE
12588 * eval.c (Qdebug): Now static.
12589 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12590 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12591 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12592
d66c4c7c
CY
125932011-05-29 Chong Yidong <cyd@stupidchicken.com>
12594
12595 * image.c: Various fixes to ImageMagick code comments.
12596 (Fimagemagick_types): Doc fix.
12597
5fbc2025
PE
125982011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12599
0196f88a
PE
12600 Minor fixes prompted by GCC 4.6.0 warnings.
12601
12602 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12603
5fbc2025
PE
12604 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12605 (x_clipboard_manager_save_all): Move extern decl to ...
12606 * xterm.h: ... here, so that it can be checked for consistency.
12607
1dd3c2d9
CY
126082011-05-29 Chong Yidong <cyd@stupidchicken.com>
12609
12610 * xselect.c (x_clipboard_manager_save_frame)
12611 (x_clipboard_manager_save_all): New functions.
12612 (Fx_clipboard_manager_save): Lisp function deleted.
12613
12614 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12615 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12616
12617 * xterm.h: Update prototype.
12618
5ba6571d
WX
126192011-05-28 William Xu <william.xwl@gmail.com>
12620
12621 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12622 exiting (Bug#8239).
12623
3eaff834
JM
126242011-05-28 Jim Meyering <meyering@redhat.com>
12625
e1900994 12626 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
12627 * fns.c (to_uchar): Define.
12628 (crypto_hash_function): Use it to convert some newly-signed
12629 variables to unsigned, to avoid sign-extension bugs. For example,
12630 without this change, (md5 "truc") would evaluate to
12631 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12632 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 12633 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 12634
0f6990a7
PE
126352011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12636
12637 Integer overflow fixes.
c8a9ca5a 12638
08686060
PE
12639 * dbusbind.c: Serial number integer overflow fixes.
12640 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
12641 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12642 to hold a serial number that is too large for a fixnum.
12643 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12644 Check for serial numbers out of range. Decode any serial number
59568bf0 12645 that was so large that it became a float. (Bug#8722)
08686060 12646
2d1fc3c7
PE
12647 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12648 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12649 Use XFASTINT rather than XUINT when numbers are nonnegative.
12650 (xd_append_arg, Fdbus_method_return_internal):
12651 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12652 arguments, check that Lisp number is nonnegative, rather than
59568bf0 12653 silently wrapping negative numbers around. (Bug#8722)
30217ff0 12654 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 12655 (Bug#8722)
2d1fc3c7 12656
c8a9ca5a
PE
12657 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12658
519e1d69
PE
12659 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12660
6df6ae42 12661 ccl: Add integer overflow checks.
30569699
PE
12662 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12663 (IN_INT_RANGE): New macros.
12664 (ccl_driver): Use them to check for integer overflow when
12665 decoding a CCL program. Many of the new checks are whether XINT (x)
12666 fits in int; it doesn't always, on 64-bit hosts. The new version
12667 doesn't catch all possible integer overflows, but it's an
847044ea 12668 improvement. (Bug#8719)
30569699 12669
c11285dc
PE
12670 * alloc.c (make_event_array): Use XINT, not XUINT.
12671 There's no need for unsigned here.
12672
fdccd48e
PE
12673 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12674 This follows up to the 2011-05-06 change that substituted uintptr_t
12675 for EMACS_INT. This case wasn't caught back then.
12676
37910ab2
PE
12677 Rework Fformat to avoid integer overflow issues.
12678 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12679 now (part of C89). Include <verify.h>.
12680 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12681 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12682 (Fformat): Avoid the prepass trying to compute sizes; it was only
12683 approximate and thus did not catch overflow reliably. Instead, walk
12684 through the format just once, formatting and computing sizes as we go,
12685 checking for integer overflow at every step, and allocating a larger
12686 buffer as needed. Keep track separately whether the format is
12687 multibyte. Keep only the most-recently calculated precision, rather
12688 than them all. Record whether each argument has been converted to
12689 string. Use EMACS_INT, not int, for byte and char and arg counts.
12690 Support field widths and precisions larger than INT_MAX. Avoid
12691 sprintf's undefined behavior with conversion specifications such as %#d
12692 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12693 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12694 formatting out-of-range floating point numbers with int
9173deec 12695 formats. (Bug#8668)
37910ab2 12696
2e6578fb
PE
12697 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12698
0ae6bdee
PE
12699 * data.c: Avoid integer truncation in expressions involving floats.
12700 * data.c: Include <intprops.h>.
12701 (arith_driver): When there's an integer overflow in an expression
12702 involving floating point, convert the integers to floating point
12703 so that the resulting value does not suffer from catastrophic
12704 integer truncation. For example, on a 64-bit host (* 4
12705 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12706 Do not rely on undefined behavior after integer overflow.
12707
de883a70
PE
12708 merge count_size_as_multibyte, parse_str_to_multibyte
12709 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 12710 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
12711 Check for integer overflow.
12712 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12713 since it's now a duplicate of the other. This is more of
12714 a character than a buffer op, so better that it's in character.c.
12715 * fns.c, print.c: Adjust to above changes.
12716
2ff916cb
PE
127172011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12718
12719 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12720
f1b54466
PE
127212011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12722
fb1ac845
PE
12723 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12724 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12725 (x_clipboard_manager_save): Now static.
12726 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12727
f1b54466
PE
12728 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12729 (crypto_hash_function): Now static.
12730 Fix pointer signedness problems. Avoid unnecessary initializations.
12731
a9f737ee
CY
127322011-05-27 Chong Yidong <cyd@stupidchicken.com>
12733
12734 * termhooks.h (Vselection_alist): Make it terminal-local.
12735
12736 * terminal.c (create_terminal): Initialize it.
12737
12738 * xselect.c: Support for clipboard managers.
12739 (Vselection_alist): Move to termhooks.h as terminal-local var.
12740 (LOCAL_SELECTION): New macro.
12741 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12742 (symbol_to_x_atom): Remove gratuitous arg.
12743 (x_handle_selection_request, lisp_data_to_selection_data)
12744 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
12745 (x_own_selection, x_get_local_selection, x_convert_selection):
12746 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
12747 (some_frame_on_display): Delete unused function.
12748 (Fx_own_selection_internal, Fx_get_selection_internal)
12749 (Fx_disown_selection_internal, Fx_selection_owner_p)
12750 (Fx_selection_exists_p): New optional frame arg.
12751 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12752 (x_handle_selection_clear): Don't treat other terminals with the
12753 same keyboard specially. Use the terminal-local Vselection_alist.
12754 (x_clear_frame_selections): Use Frun_hook_with_args.
12755
12756 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12757
12758 * xterm.h: Add support for those atoms.
12759
e067f0c1
CY
127602011-05-26 Chong Yidong <cyd@stupidchicken.com>
12761
12762 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12763 (converted_selections, conversion_fail_tag): New global variables.
12764 (x_selection_request_lisp_error): Free the above.
12765 (x_get_local_selection): Remove unnecessary code.
12766 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
12767 of converted selections stored in converted_selections.
12768 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
12769 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12770 (x_convert_selection): New function.
12771 (x_handle_selection_event): Simplify.
12772 (x_get_foreign_selection): Don't ignore incoming requests while
12773 waiting for an answer; this will fail when we implement
12774 SAVE_TARGETS, and seems unnecessary anyway.
12775 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12776 (Vx_sent_selection_functions): Doc fix.
12777
0f4aebc0
LL
127782011-05-26 Leo Liu <sdl.web@gmail.com>
12779
12780 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12781
e61124cd
YM
127822011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12783
12784 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12785
12786 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12787 for fringe update if it has periodic bitmap.
ac389d0c 12788 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
12789 and fringe_bitmap_periodic_p.
12790
12791 * fringe.c (get_fringe_bitmap_data): New function.
12792 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12793 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12794 row. Mark glyph row for fringe update if periodicity changed.
12795
12796 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12797 for fringe update unless it has periodic bitmap.
12798
f16d9837
KH
127992011-05-25 Kenichi Handa <handa@m17n.org>
12800
12801 * xdisp.c (get_next_display_element): Set correct it->face_id for
12802 a static composition.
12803
e1b90ef6
LL
128042011-05-24 Leo Liu <sdl.web@gmail.com>
12805
12806 * deps.mk (fns.o):
12807 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12808
12809 * fns.c (crypto_hash_function, Fsha1): New function.
12810 (Fmd5): Use crypto_hash_function.
12811 (syms_of_fns): Add Ssha1.
12812
7400048f
PE
128132011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12814
12815 * gnutls.c: Remove unused macros.
12816 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12817 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12818 Remove macros that are defined and never used.
12819 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12820
abb71cf4
CY
128212011-05-22 Chong Yidong <cyd@stupidchicken.com>
12822
12823 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12824 (Fx_get_selection_internal): Minor cleanup.
12825 (Fx_own_selection_internal): Rename arguments for consistency with
12826 select.el.
12827
6307db39
PE
128282011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12829
12830 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12831
f3d4e0a4
CY
128322011-05-22 Chong Yidong <cyd@stupidchicken.com>
12833
12834 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12835
4d8ade89
YM
128362011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12837
12838 * dispnew.c (scrolling_window): Don't exclude the case that the
12839 last enabled row in the desired matrix touches the bottom boundary.
12840
32078c8d
GM
128412011-05-21 Glenn Morris <rgm@gnu.org>
12842
12843 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
12844 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12845 and add some more files.
32078c8d 12846
7285dc67
EZ
128472011-05-20 Eli Zaretskii <eliz@gnu.org>
12848
12849 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12850 report_file_error introduced by the change from 2011-05-07.
12851
89d1bd22
PE
128522011-05-20 Paul Eggert <eggert@cs.ucla.edu>
12853
12854 * systime.h (Time): Define only if emacs is defined.
12855 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12856 where the include path doesn't have X11/X.h by default. See
12857 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12858
cd394be1 128592011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
12860
12861 * composite.c (find_automatic_composition): Fix previous change.
12862
b9704ad9
GM
128632011-05-20 Glenn Morris <rgm@gnu.org>
12864
12865 * lisp.mk: New file, split from Makefile.in.
12866 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12867 (shortlisp): Remove.
12868 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12869
4a720484
GM
128702011-05-19 Glenn Morris <rgm@gnu.org>
12871
12872 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12873 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12874 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12875 (lisp): Set the order to that of loadup.el.
12876 (shortlisp): Make it a copy of $lisp.
12877 (SOME_MACHINE_LISP): Remove.
12878 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12879 Use just $shortlisp, not $SOME_MACHINE_LISP too.
12880
a28d4396
KH
128812011-05-18 Kenichi Handa <handa@m17n.org>
12882
12883 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12884 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12885 (find_automatic_composition): Mostly rewrite for efficiency.
12886
a2b1fa8e
JB
128872011-05-18 Juanma Barranquero <lekktu@gmail.com>
12888
12889 * makefile.w32-in: Update dependencies.
12890
8e1f5610
CS
128912011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
12892
12893 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 12894 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 12895
7025ee00 128962011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 12897
cdfa6eab
PE
12898 Fix some integer overflow issues, such as string length overflow.
12899
06d6db33
PE
12900 * insdel.c (count_size_as_multibyte): Check for string overflow.
12901
2b4560a8
PE
12902 * character.c (lisp_string_width): Check for string overflow.
12903 Use EMACS_INT, not int, for string indexes and lengths; in
12904 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
12905 the resulting string length overflows an EMACS_INT; instead,
12906 report a string overflow if no precision given. When checking for
12907 precision exhaustion, use a check that cannot possibly have
12908 integer overflow. (Bug#8675)
12909 * character.h (lisp_string_width): Adjust to new signature.
12910
cb93f9be
PE
12911 * alloc.c (string_overflow): New function.
12912 (Fmake_string): Use it. This doesn't change behavior, but saves
12913 a few bytes and will simplify future changes.
12914 * character.c (string_escape_byte8): Likewise.
12915 * lisp.h (string_overflow): New decl.
12916
1a1f3366
PE
12917 Fixups, following up to the user-interface timestamp change.
12918 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
12919 for UI timestamps, instead of unsigned long.
9fbd6841
PE
12920 * msdos.c (mouse_get_pos): Likewise.
12921 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
12922 * w32gui.h (Time): Define by including "systime.h" rather than by
12923 declaring it ourselves. (Bug#8664)
12924
d4e3e4d3
PE
12925 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
12926 * image.c (clear_image_cache): Likewise.
12927
f6a24d19
PE
12928 * term.c (term_mouse_position): Don't assume time_t wraparound.
12929
08dc5ae6
PE
12930 Be more systematic about user-interface timestamps.
12931 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
12932 and sometimes 'EMACS_UINT', to represent these timestamps.
12933 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
12934 This makes the code easier to follow, and makes it easier to catch
12935 integer overflow bugs such as Bug#8664.
12936 * frame.c (Fmouse_position, Fmouse_pixel_position):
12937 Use Time, not unsigned long, for user-interface timestamps.
12938 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
12939 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
12940 * keyboard.h (last_event_timestamp): Likewise.
12941 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
12942 * menu.h (xmenu_show): Likewise.
12943 * term.c (term_mouse_position): Likewise.
12944 * termhooks.h (struct input_event.timestamp): Likewise.
12945 (struct terminal.mouse_position_hook): Likewise.
12946 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
12947 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
12948 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
12949 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
12950 what it was before.
12951 * menu.h, termhooks.h: Include "systime.h", for Time.
12952
8e55734a
PE
12953 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
12954 Don't assume that the difference between two unsigned long values
12955 can fit into an integer. At this point, we know button_down_time
12956 <= event->timestamp, so the difference must be nonnegative, so
12957 there's no need to cast the result if double-click-time is
12958 nonnegative, as it should be; check that it's nonnegative, just in
12959 case. This bug is triggered when events are more than 2**31 ms
86db42d2 12960 apart (about 25 days). (Bug#8664)
8e55734a 12961
841f1b75 12962 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 12963 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 12964
3e26f69c
PE
12965 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
12966 that always fit in int. Use a sentinel instead of a counter, to
12967 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
12968 * frame.h (struct frame): Use int for menu_bar_items_used
12969 instead of EMACS_INT, since it always fits in int.
3e26f69c 12970
5cc152c0
PE
12971 * menu.c (grow_menu_items): Check for int overflow.
12972
d89eb65e
PE
12973 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
12974
5235bd3e
PE
12975 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
12976 Before, the code was not consistent. These values cannot exceed
12977 2**31 - 1 so there's no need to make them unsigned.
12978 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
12979 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
12980 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
12981 as modifiers.
12982 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
12983
bc827e23
PE
12984 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
12985 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
12986 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
12987 presumably because the widths might not match.
12988
78eb494e
PE
12989 * window.c (size_window): Avoid needless test at loop start.
12990
04f2d78b
CB
129912011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
12992
12993 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
12994
d2fc7e3d 129952011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
12996
12997 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
12998
d2fc7e3d 129992011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
13000
13001 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13002 `width' to `bar_area_x' and `bar_area_width', respectively.
13003 (x_scroll_run): Take account of fringe background extension.
13004
04f2d78b
CB
13005 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13006 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
13007 `bar_area_width', respectively.
13008 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13009 background extension.
13010
79b70037
GM
130112011-05-10 Jim Meyering <meyering@redhat.com>
13012
13013 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13014
2f142cc5
JB
130152011-05-10 Juanma Barranquero <lekktu@gmail.com>
13016
13017 * image.c (Finit_image_library): Return t for built-in image types,
13018 like pbm and xbm. (Bug#8640)
13019
57679c86
AS
130202011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13021
13022 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13023
888c9e86
EZ
130242011-05-07 Eli Zaretskii <eliz@gnu.org>
13025
b0512a1d
EZ
13026 * w32console.c (Fset_screen_color): Doc fix.
13027 (Fget_screen_color): New function.
13028 (syms_of_ntterm): Defsubr it.
13029
7285dc67
EZ
13030 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13031 unlink the temporary file if Fcall_process didn't create it in the
13032 first place.
13033 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13034 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
13035 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13036 cue to call_process_cleanup not to close that handle.
13037
4d3fcc8e
BK
130382011-05-07 Ben Key <bkey76@gmail.com>
13039
13040 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13041 one of two shell specific rules, either bootstrap-temacs-CMD or
13042 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13043 to the previous implementation of the bootstrap-temacs rule.
13044 The bootstrap-temacs-CMD rule is similar to the previous
13045 implementation of the bootstrap-temacs rule except that it
13046 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13047 variable.
13048
13049 These changes, along with some changes to nt/configure.bat,
13050 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13051 earlier fix to add support for --cflags and --ldflags options
13052 that include quotes so that it works whether make uses cmd or
13053 sh as the shell.
13054
b4289b64
MA
130552011-05-06 Michael Albinus <michael.albinus@gmx.de>
13056
13057 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13058 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13059 is a constant.
13060 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13061 a string. Handle both cases.
13062 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13063 (Fdbus_register_method): Use Qinvalid_function.
13064
af4c0e28
JB
130652011-05-06 Juanma Barranquero <lekktu@gmail.com>
13066
13067 * makefile.w32-in: Update dependencies.
13068 (LISP_H): Add inttypes.h and stdin.h.
13069 (PROCESS_H): Add unistd.h.
13070
c51453d9
EZ
130712011-05-06 Eli Zaretskii <eliz@gnu.org>
13072
13073 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13074 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13075
8ff0ac3c 130762011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 13077
4c4b566b
PE
13078 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13079
aab2b9b5
PE
13080 * term.c (vfatal): Remove stray call to va_end.
13081 It's not needed and the C Standard doesn't allow it here anyway.
13082
c378da0b
PE
13083 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13084 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13085
288b08c7
PE
13086 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13087 bytes.
13088
e3601888
PE
13089 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13090
db6c0e74
PE
13091 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13092
dd5963ea
PE
13093 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13094
88c9450f
PE
13095 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13096
2f9442b8
PE
13097 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13098
c032b5f8
PE
13099 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13100 * charset.c (Fdefine_charset_internal): Don't initialize
13101 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 13102 32-bit int (Bug#8600).
a108c10b
PE
13103
13104 * lread.c (read_integer): Be more consistent with string-to-number.
13105 Use string_to_number to do the actual conversion; this avoids
13106 rounding errors and fixes some other screwups. Without this fix,
13107 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13108 (digit_to_number): Move earlier, for benefit of read_integer.
13109 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 13110 not a digit in any supported base. (Bug#8602)
a108c10b 13111
ad5f9eea
PE
13112 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13113
aec1708a
PE
13114 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13115 to match comment at start of function. This also removes a
13116 GCC warning about overflow in a 32+64-bit port.
13117
47be4ab5
PE
13118 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13119
371cac43
PE
13120 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13121 Reported by Stefan Monnier in
13122 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
13123 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13124 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 13125
d01a7826
PE
13126 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13127 (EMACS_UINTPTR): Likewise, with uintptr_t.
13128
7fd47d5c
PE
13129 * lisp.h: Prefer 64-bit EMACS_INT if available.
13130 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13131 on 32-bit hosts that have 64-bit int, so that they can access
13132 large files.
122b0c86
PE
13133 However, temporarily disable this change unless the temporary
13134 symbol WIDE_EMACS_INT is defined.
7fd47d5c 13135
8727937b
PE
13136 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13137
8ac068ac
PE
13138 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13139 This removes an assumption that EMACS_INT and long are the same
13140 width as pointers. The assumption is true for Emacs porting targets
13141 now, but we want to make other targets possible.
13142 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13143 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13144 In the rest of the code, change types of integers that hold casted
13145 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13146 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13147 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13148 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13149 No need to cast type when ORing.
13150 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13151 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13152 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13153 assume EMACS_INT is the same width as char *.
13154 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13155 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13156 Remove no-longer-needed casts.
13157 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13158 (xg_tool_bar_help_callback, xg_make_tool_item):
13159 Use EMACS_INTPTR to hold an integer
13160 that will be cast to void *; this can avoid a GCC warning
13161 if EMACS_INT is not the same width as void *.
13162 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13163 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13164 (current_message_1, set_message_1):
13165 Use a local to convert to proper width without a cast.
13166 * xmenu.c (dialog_selection_callback): Likewise.
13167
ede49d71
PE
13168 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13169 Also, don't assume VALBITS / RAND_BITS is less than 5,
13170 and don't rely on undefined behavior when shifting a 1 left into
13171 the sign bit.
13172 * lisp.h (get_random): Change signature to match.
13173
2f30ecd0
PE
13174 * lread.c (hash_string): Use size_t, not int, for hash computation.
13175 Normally we prefer signed values; but hashing is special, because
13176 it's better to use unsigned division on hash table sizes so that
13177 the remainder is nonnegative. Also, size_t is the natural width
13178 for hashing into memory. The previous code used 'int', which doesn't
13179 retain enough info to hash well into very large tables.
13180 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13181
2a866e7b
PE
13182 * dbusbind.c: Don't possibly lose pointer info when converting.
13183 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13184 Use XPNTR rather than XHASH, so that the high-order bits of
13185 the pointer aren't lost when converting through void *.
13186
51639eac
PE
13187 * eval.c (Fautoload): Don't double-shift a pointer.
13188
92394119
PE
13189 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13190
dbdb9a7c
JB
131912011-05-06 Juanma Barranquero <lekktu@gmail.com>
13192
13193 * gnutls.c (DEF_GNUTLS_FN):
13194 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13195
db7a0b4f
AS
131962011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13197
13198 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13199 marker. (Bug#8610)
13200
cd394be1 132012011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
13202
13203 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13204 New version that can reserve upto 2GB of heap space.
13205
f7ff1b0f 132062011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
13207
13208 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13209
639c109b
TZ
132102011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13211
13212 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13213 `gnutls_certificate_set_x509_key_file'.
13214
d2127135
JB
132152011-05-05 Juanma Barranquero <lekktu@gmail.com>
13216
13217 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13218 Update dependencies.
13219
e968f4f3
JB
132202011-05-04 Juanma Barranquero <lekktu@gmail.com>
13221
13222 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13223 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13224 Remove unused parameter `fildes'.
13225 * process.c (read_process_output, send_process): Don't pass it.
13226
84d358f0
JB
132272011-05-04 Juanma Barranquero <lekktu@gmail.com>
13228
13229 Fix previous change: the library cache is defined in w32.c.
13230 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13231 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13232
0898ca10
JB
132332011-05-04 Juanma Barranquero <lekktu@gmail.com>
13234
13235 Implement dynamic loading of GnuTLS on Windows.
13236
13237 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13238 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13239 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13240 Declare.
13241
13242 * gnutls.c (Qgnutls_dll): Define.
13243 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13244 (gnutls_*): Declare function pointers.
13245 (init_gnutls_functions): New function to initialize function pointers.
13246 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13247 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13248 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13249 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13250 (emacs_gnutls_write, emacs_gnutls_read)
13251 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13252 (Fgnutls_available_p): New function.
13253 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13254 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13255 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13256
13257 * image.c: Include w32.h.
13258 (Vimage_type_cache): Delete.
13259 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13260 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13261 (w32_delayed_load): Move to w32.c.
13262
13263 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13264
13265 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13266 (w32_delayed_load): Move from image.c. When loading a library, record
13267 its filename in the :loaded-from property of the library id.
13268 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13269 Initialize and staticpro them.
13270 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13271
13272 * process.c: Include lisp.h before w32.h, not after.
13273 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13274 instead of gnutls_record_check_pending.
13275
13276 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13277
ff4de4aa
TZ
132782011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13279
13280 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13281 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13282 as passed in.
13283
abe95abb
JD
132842011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13285
13286 * xterm.c (x_set_frame_alpha): Do not set property on anything
13287 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13288
e16e55d4
JB
132892011-05-02 Juanma Barranquero <lekktu@gmail.com>
13290
13291 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13292
bafcf6a5
JB
132932011-05-02 Juanma Barranquero <lekktu@gmail.com>
13294
13295 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13296 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13297 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13298 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13299 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13300 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13301 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13302 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13303 (Qgnutls_bootprop_callbacks_verify): Make static.
13304
e7a6747f
AS
133052011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13306
19ed11ba
AS
13307 * callproc.c: Indentation fixup.
13308
e7a6747f 13309 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
13310 (wait_for_termination, interruptible_wait_for_termination):
13311 Move after wait_for_termination_1.
e7a6747f 13312
1ef14cb4
LMI
133132011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13314
13315 * sysdep.c (interruptible_wait_for_termination): New function
13316 which is like wait_for_termination, but allows keyboard
13317 interruptions.
13318
13319 * callproc.c (Fcall_process): Add (:file "file") as an option for
13320 the STDOUT buffer.
13321 (Fcall_process_region): Ditto.
13322
330d880c
EZ
133232011-04-30 Eli Zaretskii <eliz@gnu.org>
13324
8db90b73
EZ
13325 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13326 rather than `XVECTOR (FOO)->size'.
13327
330d880c
EZ
13328 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13329 inttypes.h, as a gnulib replacement is used if it not available in
13330 system headers.
13331
15cbd324
EZ
133322011-04-21 Eli Zaretskii <eliz@gnu.org>
13333
13334 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13335 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13336 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13337
13338 * coding.c (coding_alloc_by_realloc): Error out if destination
13339 will grow beyond MOST_POSITIVE_FIXNUM.
13340 (decode_coding_emacs_mule): Abort if there isn't enough place in
13341 charbuf for the composition carryover bytes. Reserve an extra
13342 space for up to 2 characters produced in a loop.
13343 (decode_coding_iso_2022): Abort if there isn't enough place in
13344 charbuf for the composition carryover bytes.
13345
133462011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 13347
ae940cca
EZ
13348 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13349 aborting when %lld or %lll format is passed.
13350 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13351 %llo or %llx format is passed. (Bug#8545)
13352
03ab8921
EZ
13353 * window.c (window_scroll_line_based): Use a marker instead of
13354 simple variables to record original value of point. (Bug#7952)
13355
afda1437
EZ
13356 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13357 produced by %s or %c overflows available buffer space. (Bug#8545)
13358
f76dee0c
PE
133592011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13360
13361 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 13362 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 13363
fdc5744d
JB
133642011-04-28 Juanma Barranquero <lekktu@gmail.com>
13365
13366 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13367
638f053a
JB
133682011-04-28 Juanma Barranquero <lekktu@gmail.com>
13369
13370 * keyboard.c (Qdelayed_warnings_hook): Define.
13371 (command_loop_1): Run `delayed-warnings-hook'
13372 if Vdelayed_warnings_list is non-nil.
13373 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13374 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13375
d178f871
EZ
133762011-04-28 Eli Zaretskii <eliz@gnu.org>
13377
13378 * doprnt.c (doprnt): Don't return value smaller than the buffer
13379 size if the message was truncated. (Bug#8545).
13380
b124fd93
JB
133812011-04-28 Juanma Barranquero <lekktu@gmail.com>
13382
13383 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13384 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13385
e810457d
PE
133862011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13387
13388 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13389
ea51cceb
JB
133902011-04-27 Juanma Barranquero <lekktu@gmail.com>
13391
13392 * makefile.w32-in: Update dependencies.
13393
94dcfacf
EZ
133942011-04-27 Eli Zaretskii <eliz@gnu.org>
13395
13396 Improve `doprnt' and its usage. (Bug#8545)
13397 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13398 `format_end'. Remove support for %l as a conversion specifier.
13399 Don't use xrealloc. Improve diagnostics when the %l size modifier
13400 is used. Update the commentary.
13401
13402 * eval.c (verror): Simplify calculation of size_t.
13403
13404 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13405 messages.
13406
f61f41d7
PE
134072011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13408
13409 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13410 change.
13411
96fb4434
PE
134122011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13413
13414 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13415 This makes this file independent of the recent pseudovector change.
13416
671875da 134172011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 13418
69e9b5a3
PE
13419 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13420
b5f869a7 13421 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 13422 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 13423 Remove unused local.
c8926152 13424 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 13425
841a1577 13426 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
13427 GCC 4.6.0 optimizes based on type-based alias analysis.
13428 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
13429 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13430 != &v->size, and therefore "v->size = 1; b->size = 2; return
13431 v->size;" must therefore return 1. This assumption is incorrect
13432 for Emacs, since it type-puns struct Lisp_Vector * with many other
13433 types. To fix this problem, this patch adds a new type struct
f904488f 13434 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
13435 and pseudovectors, and helps optimizing compilers not get fooled
13436 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13437 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
13438 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13439 the size member.
eab3844f
PE
13440 (XSETPVECTYPE): Rewrite in terms of new macro.
13441 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13442 This is a bit clearer, and further avoids the possibility of
13443 undesirable aliasing.
13444 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 13445 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
13446 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13447 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
13448 (ASIZE): Now uses header.size rather than size.
13449 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
13450 to avoid the hassle of writing XVECTOR (foo)->header.size.
13451 (struct vectorlike_header): New type.
eab3844f
PE
13452 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13453 object, to help avoid aliasing.
13454 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13455 (SUBRP): Likewise, since Lisp_Subr is a special case.
13456 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13457 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13458 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 13459 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
13460 changed to be "header.size" and "header.next".
13461 * buffer.h (struct buffer): Likewise.
13462 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13463 * frame.h (struct frame): Likewise.
13464 * process.h (struct Lisp_Process): Likewise.
13465 * termhooks.h (struct terminal): Likewise.
13466 * window.c (struct save_window_data, struct saved_window): Likewise.
13467 * window.h (struct window): Likewise.
13468 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13469 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13470 * buffer.c (init_buffer_once): Likewise.
13471 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13472 special case.
13473 * process.c (Fformat_network_address): Use local var for size,
13474 for brevity.
13475
0df1eac5
PE
13476 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13477
847ab9d1 13478 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
13479 * data.c (atof): Remove decl; no longer used or needed.
13480 (digit_to_number): Move to lread.c.
13481 (Fstring_to_number): Use new string_to_number function, to be
13482 consistent with how the Lisp reader treats infinities and NaNs.
13483 Do not assume that floating-point numbers represent EMACS_INT
13484 without losing information; this is not true on most 64-bit hosts.
13485 Avoid double-rounding errors, by insisting on integers when
13486 parsing non-base-10 numbers, as the documentation specifies.
13487 * lisp.h (string_to_number): New decl, replacing ...
13488 (isfloat_string): Remove.
bc0a5c13 13489 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 13490 (read1): Do not accept +. and -. as integers; this
452f4150
PE
13491 appears to have been a coding error. Similarly, do not accept
13492 strings like +-1e0 as floating point numbers. Do not report
13493 overflow for integer overflows unless the base is not 10 which
13494 means we have no simple and reliable way to continue.
13495 Break out the floating-point parsing into a new
13496 function string_to_number, so that Fstring_to_number parses
13497 floating point numbers consistently with the Lisp reader.
04f2d78b 13498 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
13499 (E_CHAR, EXP_INT): Remove, replacing with ...
13500 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13501 (string_to_number): New function, replacing isfloat_string.
13502 This function checks for valid syntax and produces the resulting
13503 Lisp float number too. Rework it so that string-to-number
bc0a5c13 13504 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
13505 so that overflow for non-base-10 numbers is reported only when
13506 there's no portable and simple way to convert to floating point.
452f4150 13507
67769ffc
PE
13508 * textprop.c (set_text_properties_1): Rewrite for clarity,
13509 and to avoid GCC warning about integer overflow.
13510
c20db43f
PE
13511 * intervals.h (struct interval): Use EMACS_INT for members
13512 where EMACS_UINT might cause problems. See
13513 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13514 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13515 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13516 All uses changed.
37aa2f85
PE
13517 (offset_intervals): Tell GCC not to worry about length overflow
13518 when negating a negative length.
c20db43f 13519
2538aa2f
PE
13520 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13521 (overrun_check_free): Likewise.
13522
f2d3008d
PE
13523 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13524 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13525 word size.
13526
ec8df744
PE
13527 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13528 (gnutls_make_error): Rename local to avoid shadowing.
13529 (gnutls_emacs_global_deinit): ifdef out; not used.
13530 (Fgnutls_boot): Use const for pointer to readonly storage.
13531 Comment out unused local. Fix pointer signedness problems.
13532
640ee02d
PE
13533 * lread.c (openp): Don't stuff size_t into an 'int'.
13534 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13535 about possible signed overflow.
13536
6048fb2a
PE
13537 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13538 (GDK_KEY_g): Don't define if already defined.
13539 (xg_prepare_tooltip): Avoid pointer signedness problem.
13540 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13541
fa3c87e1
PE
13542 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13543 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13544
2172544b
PE
13545 * xfns.c (Fx_window_property): Simplify a bit,
13546 to make a bit faster and to avoid GCC 4.6.0 warning.
13547 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13548
9b821a21
PE
13549 * fns.c (internal_equal): Don't assume size_t fits in int.
13550
3c616cfa
PE
13551 * alloc.c (compact_small_strings): Tighten assertion a little.
13552
c2982e87
PE
13553 Replace pEd with more-general pI, and fix some printf arg casts.
13554 * lisp.h (pI): New macro, generalizing old pEd macro to other
13555 conversion specifiers. For example, use "...%"pI"d..." rather
13556 than "...%"pEd"...".
13557 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 13558 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
13559 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13560 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13561 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13562 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13563 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13564 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13565 64-bit hosts.
13566 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13567 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13568 * print.c (safe_debug_print, print_object): Likewise.
13569 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13570 to int.
6f04d126
PE
13571 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13572 avoiding the 0 flag, which is not portable.
c2982e87
PE
13573 * process.c (Fmake_network_process): Use pI to avoid cast.
13574 * region-cache.c (pp_cache): Likewise.
13575 * xdisp.c (decode_mode_spec): Likewise.
13576 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13577 behavior on 64-bit hosts with printf arg.
6f04d126 13578 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
13579 (x_stop_queuing_selection_requests): Likewise.
13580 (x_get_window_property): Don't truncate byte count to an 'int'
13581 when tracing.
0b432f21 13582
5e073ec7
PE
13583 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13584 here, since it parses constructs like leading '-' and spaces,
13585 which are not wanted; and it overflows with large numbers.
13586 Instead, simply match F[0-9]+, which is what is wanted anyway.
13587
36372bf9
PE
13588 * alloc.c: Remove unportable assumptions about struct layout.
13589 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13590 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13591 (allocate_vectorlike, make_pure_vector): Use the new macros,
13592 plus offsetof, to remove unportable assumptions about struct layout.
13593 These assumptions hold on all porting targets that I know of, but
13594 they are not guaranteed, they're easy to remove, and removing them
13595 makes further changes easier.
13596
0b432f21
PE
13597 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13598 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
13599 (string_overrun_cookie): Now const. Use initializers that
13600 don't formally overflow signed char, to avoid warnings.
000098c1
PE
13601 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13602 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
13603 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13604 multiple of sizeof (EMACS_INT); it need not be, if
13605 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 13606 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 13607
895009e1
JB
136082011-04-26 Juanma Barranquero <lekktu@gmail.com>
13609
13610 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13611
6a7a1b0b
TZ
136122011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13613
13614 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 13615 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
13616 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13617
841a1577 136182011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
13619
13620 * lisp.h (Qdebug): List symbol.
895009e1 13621 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
13622 * keyboard.c (debug-on-event): New variable.
13623 (handle_user_signal): Break into debugger when debug-on-event
13624 matches the current signal symbol.
13625
f2d3ba6f
DN
136262011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13627
13628 * alloc.c (check_sblock, check_string_bytes)
13629 (check_string_free_list): Convert to standard C.
13630
42ce4c63
TZ
136312011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13632
13633 * w32.c (emacs_gnutls_push): Fix typo.
13634
825cd63c
EZ
136352011-04-25 Eli Zaretskii <eliz@gnu.org>
13636
fb11d64d
EZ
13637 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13638 "cast to pointer from integer of different size".
13639
825cd63c
EZ
13640 Improve doprnt and its use in verror. (Bug#8545)
13641 * doprnt.c (doprnt): Document the set of format control sequences
13642 supported by the function. Use SAFE_ALLOCA instead of always
13643 using `alloca'.
13644
13645 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13646 is one byte too soon. Don't use xrealloc; instead xfree and
13647 xmalloc anew.
13648
e061a11b
TZ
136492011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13650
13651 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13652 callbacks stage.
13653
13654 * gnutls.c: Renamed global_initialized to
13655 gnutls_global_initialized. Added internals for the
13656 :verify-hostname-error, :verify-error, and :verify-flags
13657 parameters of `gnutls-boot' and documented those parameters in the
13658 docstring. Start callback support.
9173deec
JB
13659 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13660 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13661 on error. Return error code.
e061a11b
TZ
13662 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13663 (emacs_gnutls_read): Likewise.
13664 (Fgnutls_boot): Return handshake error code.
13665 (emacs_gnutls_handle_error): New function.
13666 (wsaerror_to_errno): Likewise.
13667
13668 * w32.h (emacs_gnutls_pull): Add prototype.
13669 (emacs_gnutls_push): Likewise.
13670
13671 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13672 (emacs_gnutls_push): Likewise.
13673
136742011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13675
13676 * process.c (wait_reading_process_output): Check if GnuTLS
13677 buffered some data internally if no FDs are set for TLS
13678 connections.
13679
13680 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13681 (LIBS): Link to USER_LIBS.
13682 ($(BLD)/gnutls.$(0)): New target.
13683
fa6996bc
EZ
136842011-04-24 Eli Zaretskii <eliz@gnu.org>
13685
eb35682e
EZ
13686 * xdisp.c (handle_single_display_spec): Rename the
13687 display_replaced_before_p argument into display_replaced_p, to
13688 make it consistent with the commentary. Fix typos in the
13689 commentary.
13690
e2ad650c
EZ
13691 * textprop.c (syms_of_textprop): Remove dead code.
13692 (copy_text_properties): Delete obsolete commentary about an
13693 interface that was deleted long ago. Fix typos in the description
13694 of arguments.
13695
1b2de274
EZ
13696 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13697 to changes in oldXMenu/XMenu.h from 2011-04-16.
13698 <menu_help_message, prev_menu_help_message>: Constify.
13699 (IT_menu_make_room): menu->help_text is now `const char **';
13700 adjust.
13701
13702 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13703 to changes in oldXMenu/XMenu.h from 2011-04-16.
13704 (struct XMenu): Declare `help_text' `const char **'.
13705
13706 * xfaces.c <Qunspecified>: Make extern again.
13707
13708 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 13709 required by POSIX.
1b2de274 13710
762b15be
EZ
13711 * doc.c (get_doc_string): Improve the format passed to `error'.
13712
13713 * doprnt.c (doprnt): Improve commentary.
13714
13715 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13716
13717 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13718 them with etags.
13719
f1052e5d
EZ
13720 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13721 changes in globals.h immediately force recompilation.
762b15be
EZ
13722 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13723 $(CURDIR)/s/ms-w32.h.
13724 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 13725
fa6996bc
EZ
13726 * character.c (Fchar_direction): Function deleted.
13727 (syms_of_character): Don't defsubr it.
13728 <char-direction-table>: Deleted.
13729
e6c3da20
EZ
137302011-04-23 Eli Zaretskii <eliz@gnu.org>
13731
13732 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13733 * doprnt.c: Include limits.h.
13734 (SIZE_MAX): New macro.
04f2d78b
CB
13735 (doprnt): Return a size_t value. 2nd arg is now size_t.
13736 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
13737 Improve overflow protection. Support `l' modifier for integer
13738 conversions. Support %l conversion. Don't assume an EMACS_INT
13739 argument for integer conversions and for %c.
13740
13741 * lisp.h (doprnt): Restore prototype.
13742
13743 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13744 $(SRC)/character.h.
13745
13746 * Makefile.in (base_obj): Add back doprnt.o.
13747
13748 * deps.mk (doprnt.o): Add back prerequisites.
13749 (callint.o): Depend on character.h.
13750
13751 * eval.c (internal_lisp_condition_case): Include the handler
13752 representation in the error message.
13753 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13754 when breaking from the loop.
13755
13756 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13757
13758 * callint.c (Fcall_interactively): When displaying error message
13759 about invalid control letter, pass the character's codepoint, not
13760 a pointer to its multibyte form. Improve display of the character
13761 in octal and display also its hex code.
13762
13763 * character.c (char_string): Use %x to display the (unsigned)
13764 codepoint of an invalid character, to avoid displaying a bogus
13765 negative value.
13766
13767 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13768 `error', not SYMBOL_NAME itself.
13769
13770 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13771 character arguments to `error'.
13772
13773 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13774 to `error' in error message about FINAL_CHAR argument. Make sure
13775 FINAL_CHAR is a character, and use %c when it is passed as
13776 argument to `error'.
13777
4ffd0d6b 137782011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
13779
13780 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13781
13782 * w32.c: Include <time.h>.
13783 (sys_localtime): New function.
13784
4ffd0d6b 137852011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
13786
13787 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13788
4ffd0d6b 13789 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 13790
4ffd0d6b 137912011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 13792
4ffd0d6b
GM
13793 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13794 zombies (Bug#8467).
aac0c6e3 13795
04c56954
EZ
137962011-04-19 Eli Zaretskii <eliz@gnu.org>
13797
13798 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13799 gl_state.e_property when gl_state.object is Qt.
13800
13801 * insdel.c (make_gap_larger): Remove limitation of buffer size
13802 to <= INT_MAX.
13803
16a43933
CY
138042011-04-18 Chong Yidong <cyd@stupidchicken.com>
13805
13806 * xdisp.c (lookup_glyphless_char_display)
13807 (produce_glyphless_glyph): Handle cons cell entry in
13808 glyphless-char-display.
13809 (Vglyphless_char_display): Document it.
13810
13811 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13812 glyphless-char-display.
13813
4581706e
CY
138142011-04-17 Chong Yidong <cyd@stupidchicken.com>
13815
13816 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13817
13818 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13819
13820 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13821 definition for no-X builds.
13822
4887c6e2 138232011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 13824
fd35b6f9
PE
13825 Static checks with GCC 4.6.0 and non-default toolkits.
13826
5c1ccb01
PE
13827 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13828
006c5daa
PE
13829 * process.c (keyboard_bit_set): Define only if SIGIO.
13830 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13831 (send_process): Repair possible setjmp clobbering.
13832
efc736d3
PE
13833 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13834
4e2fe2e6
PE
13835 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13836
f97334a2
PE
13837 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13838
4e75f29d
PE
13839 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13840 Define only if needed.
13841
90efadd1
PE
13842 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13843 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 13844 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 13845
3c647824
PE
13846 * dispextern.h (struct redisplay_interface): Rename param
13847 to avoid shadowing.
e264f262 13848 * termhooks.h (struct terminal): Likewise.
761383f4 13849 * xterm.c (xembed_send_message): Likewise.
3c647824 13850
b58c5c4a
PE
13851 * insdel.c (make_gap_smaller): Define only if
13852 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13853
cad59032
PE
13854 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13855 it.
13856
c339dc2e
PE
13857 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13858 so that we aren't warned about unused symbols.
13859
91a3e27b
PE
13860 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13861
399c71d3 13862 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 13863
8ffc96f5
PE
13864 * xfns.c (x_real_positions): Mark locals as initialized.
13865
eef9bc79
PE
13866 * xmenu.c (xmenu_show): Don't use uninitialized vars.
13867
098db9dd
PE
13868 * xterm.c: Fix problems found by static analysis with other toolkits.
13869 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
13870 (x_dispatch_event): Declare static if USE_GTK, and
13871 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 13872 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 13873 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
13874 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13875 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 13876
eb18f6cc
PE
13877 * xmenu.c (menu_help_callback): Pointer type fixes.
13878 Use const pointers when pointing at readonly data. Avoid pointer
13879 signedness clashes.
13880 (FALSE): Remove unused macro.
13881 (update_frame_menubar): Remove unused decl.
13882
1fe72bf8
PE
13883 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13884
60d9e1db
PE
13885 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13886 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13887 (single_menu_item): Rename local to avoid shadowing.
13888
39261c26
PE
13889 * keyboard.c (make_lispy_event): Remove unused local var.
13890
018c5e19
PE
13891 * frame.c, frame.h (x_get_resource_string): Bring this back, but
13892 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13893
63d2b86e
PE
13894 * bitmaps: Change bitmaps from unsigned char back to the X11
13895 compatible char. Avoid the old compiler warnings about
13896 out-of-range initializers by using, for example, '\xab' rather
13897 than 0xab.
13898
aefd87e1
PE
13899 * xgselect.c (xgselect_initialize): Check vs interface
13900 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
13901
bf501fb9
PE
13902 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
13903
e9829fdf
PE
13904 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
13905 to read-only memory.
13906
1086c095
PE
13907 * fns.c (vector): Remove; this old hack is no longer needed.
13908
2baccd04 13909 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 13910 Remove unused var.
dde42981 13911 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 13912
72391843 13913 * xrdb.c (x_load_resources): Omit unused local.
3565b346 13914
436c16df 13915 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 13916 (x_window): Rename locals to avoid shadowing.
dc5ddd85 13917 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 13918
92bb796d 13919 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 13920 (x_term_init): Remove local to avoid shadowing.
92bb796d 13921
764430a3 13922 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
13923
13924 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
13925 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
13926
d1dfb56c
EZ
139272011-04-16 Eli Zaretskii <eliz@gnu.org>
13928
c4354cb4
EZ
13929 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
13930
d1dfb56c
EZ
13931 Fix regex.c, syntax.c and friends for buffers > 2GB.
13932 * syntax.h (struct gl_state_s): Declare character position members
13933 EMACS_INT.
13934
13935 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
13936
04f2d78b
CB
13937 * textprop.c (verify_interval_modification, interval_of):
13938 Declare arguments EMACS_INT.
d1dfb56c
EZ
13939
13940 * intervals.c (adjust_intervals_for_insertion): Declare arguments
13941 EMACS_INT.
13942
13943 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
13944
13945 * indent.c (Fvertical_motion): Local variable it_start is now
13946 EMACS_INT.
13947
13948 * regex.c (re_match, re_match_2, re_match_2_internal)
13949 (bcmp_translate, regcomp, regexec, print_double_string)
13950 (group_in_compile_stack, re_search, re_search_2, regex_compile)
13951 (re_compile_pattern, re_exec): Declare arguments and local
13952 variables `size_t' and `ssize_t' and return values `regoff_t', as
13953 appropriate.
13954 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
13955 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
13956 <compile_stack_type>: `size' and `avail' are now `size_t'.
13957
13958 * regex.h <regoff_t>: Use ssize_t, not int.
13959 (re_search, re_search_2, re_match, re_match_2): Arguments that
13960 specify buffer/string position and length are now ssize_t and
13961 size_t. Return type is regoff_t.
13962
613052cd
BK
139632011-04-16 Ben Key <bkey76@gmail.com>
13964
13965 * nsfont.m: Fixed bugs in ns_get_family and
13966 ns_descriptor_to_entity that were caused by using free to
13967 deallocate memory blocks that were allocated by xmalloc (via
13968 xstrdup). This caused Emacs to crash when compiled with
13969 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
13970 --enable-checking=xmallocoverrun). xfree is now used to
13971 deallocate these memory blocks.
13972
4170f62f 139732011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 13974
71b41406
PE
13975 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
13976
9587a89d
PE
13977 emacs_write: Accept and return EMACS_INT for sizes.
13978 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
13979 et seq.
13980 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
13981 Accept and return EMACS_INT.
13982 (emacs_gnutls_write): Return the number of bytes written on
13983 partial writes.
13984 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
13985 (emacs_read, emacs_write): Remove check for negative size, as the
13986 Emacs source code has been audited now.
9587a89d
PE
13987 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
13988 (emacs_read, emacs_write): Use it.
273a5f82
PE
13989 * process.c (send_process): Adjust to the new signatures of
13990 emacs_write and emacs_gnutls_write. Do not attempt to store
13991 a byte offset into an 'int'; it might overflow.
9587a89d 13992 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 13993
3e047f51
PE
13994 * sound.c: Don't assume sizes fit in 'int'.
13995 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 13996 Return EMACS_INT, not int.
3e047f51 13997 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
13998 Accept EMACS_INT, not int.
13999 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
14000 record read return values.
14001
cc39a9db
BK
140022011-04-15 Ben Key <bkey76@gmail.com>
14003
c9d0ec6d
JB
14004 * keyboard.c (Qundefined): Don't declare static since it is used
14005 in nsfns.m.
14006 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14007 static since they are used in nsfont.m.
cc39a9db 14008
6c60eb9f
SM
140092011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14010
14011 * process.c (Qprocessp): Don't declare static.
14012 * lisp.h (Qprocessp): Declare again.
14013
7990b61a
JB
140142011-04-15 Juanma Barranquero <lekktu@gmail.com>
14015
14016 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14017
5d4cb038
PE
140182011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14019
8bd7b830 14020 Improve C-level modularity by making more things 'static'.
cd64ea1d 14021
e3b27b31
PE
14022 Don't publish debugger-only interfaces to other modules.
14023 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14024 (verify_bytepos, count_markers): Move decls to the only modules
14025 that need them.
14026 * region-cache.h (pp_cache): Likewise.
14027 * window.h (check_all_windows): Likewise.
14028 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14029
5d4cb038
PE
14030 * sysdep.c (croak): Now static, if
14031 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14032 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
14033
14034 * alloc.c (refill_memory_reserve): Now static if
14035 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14036 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 14037
e87b6180
PE
14038 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14039 Define only if USE_LUCID.
14040
ac64929e
PE
14041 * xrdb.c (x_customization_string, x_rm_string): Now static.
14042
6f37259d
PE
14043 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14044 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14045
1683e3ab
PE
14046 * xdisp.c (draw_row_with_mouse_face): Now static.
14047 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14048
de9c2632
PE
14049 * window.h (check_all_windows): Mark externally visible.
14050
2b96acb7
PE
14051 * window.c (window_deletion_count): Now static.
14052
14053 * undo.c: Make symbols static if they're not exported.
14054 (last_undo_buffer, last_boundary_position, pending_boundary):
14055 Now static.
14056
50436f33
PE
14057 * textprop.c (interval_insert_behind_hooks): Now static.
14058 (interval_insert_in_front_hooks): Likewise.
14059
64520e5c
PE
14060 * term.c: Make symbols static if they're not exported.
14061 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14062 (max_frame_lines, tty_set_terminal_modes):
14063 (tty_reset_terminal_modes, tty_turn_off_highlight):
14064 (get_tty_terminal): Now static.
14065 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14066 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 14067 HAVE_WINDOW_SYSTEM.
64520e5c
PE
14068 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14069 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14070
1fa53021
PE
14071 * sysdep.c: Make symbols static if they're not exported.
14072 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14073 Now static.
14074 (sigprocmask_set, full_mask): Remove; unused.
14075 (wait_debugging): Mark as visible.
14076 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14077 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14078
d4b43b22
PE
14079 * syntax.c (syntax_temp): Define only if !__GNUC__.
14080
b7c513d0
PE
14081 * sound.c (current_sound_device, current_sound): Now static.
14082
989b29ad
PE
14083 * search.c (searchbufs, searchbuf_head): Now static.
14084
13a55a78
PE
14085 * scroll.c (scroll_cost): Remove; unused.
14086 * dispextern.h (scroll_cost): Remove decl.
14087
de68a1fc
PE
14088 * region-cache.h (pp_cache): Mark as externally visible.
14089
40ccffa6
PE
14090 * process.c: Make symbols static if they're not exported.
14091 (process_tick, update_tick, create_process, chan_process):
14092 (Vprocess_alist, proc_buffered_char, datagram_access):
14093 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14094 (deactivate_process): Mark defn as static, as well as decl.
14095 * lisp.h (create_process): Remove decl.
14096 * process.h (chan_process, Vprocess_alist): Remove decls.
14097
ad64fc97
PE
14098 * print.c: Make symbols static if they're not exported.
14099 (print_depth, new_backquote_output, being_printed, print_buffer):
14100 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14101 (print_interval, print_number_index, initial_stderr_stream):
14102 Now static.
14103 * lisp.h (Fprinc): Remove decl.
14104 (debug_output_compilation_hack): Mark as externally visible.
14105
adddb265
PE
14106 * sysdep.c (croak): Move decl from here to syssignal.h.
14107 * syssignal.h (croak): Put it here, so the API can be checked when
14108 'croak' is called from dissociate_if_controlling_tty.
14109
1717ede2
PE
14110 * minibuf.c: Make symbols static if they're not exported.
14111 (minibuf_save_list, choose_minibuf_frame): Now static.
14112 * lisp.h (choose_minibuf_frame): Remove decl.
14113
fa5fb2bc
PE
14114 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14115
1e3890d1
PE
14116 * lread.c: Make symbols static if they're not exported.
14117 (read_objects, initial_obarray, oblookup_last_bucket_number):
14118 Now static.
14119 (make_symbol): Remove; unused.
14120 * lisp.h (initial_obarray, make_symbol): Remove decls.
14121
8a1414fa
PE
14122 * keyboard.c: Make symbols static if they're not exported.
14123 (single_kboard, recent_keys_index, total_keys, recent_keys):
14124 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14125 (this_single_command_key_start, echoing, last_auto_save):
14126 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14127 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14128 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14129 (Vlispy_mouse_stem, double_click_count):
14130 Now static.
14131 (force_auto_save_soon): Define only if SIGDANGER.
14132 (ignore_mouse_drag_p): Now static if
14133 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14134 (print_help): Remove; unused.
14135 (stop_character, last_timer_event): Mark as externally visible.
14136 * keyboard.h (ignore_mouse_drag_p): Declare only if
14137 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14138 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14139 * lisp.h (echoing): Remove decl.
14140 (force_auto_save_soon): Declare only if SIGDANGER.
14141 * xdisp.c (redisplay_window): Simplify code, to make it more
14142 obvious that ignore_mouse_drag_p is not accessed if !defined
14143 USE_GTK && !defined HAVE_NS.
14144
93ea6e8f
PE
14145 * intervals.c: Make symbols static if they're not exported.
14146 (merge_properties_sticky, merge_interval_right, delete_interval):
14147 Now static.
14148 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14149
77382fcc
PE
14150 * insdel.c: Make symbols static if they're not exported.
14151 However, leave prepare_to_modify_buffer alone. It's never
14152 called from outside this function, but that appears to be a bug.
14153 (combine_after_change_list, combine_after_change_buffer):
4889fc82 14154 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
14155 (adjust_after_replace_noundo): Remove; unused.
14156 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 14157 (signal_before_change): Remove decls.
77382fcc 14158
9306c32e
PE
14159 * indent.c (val_compute_motion, val_vmotion): Now static.
14160
cd44d2eb
PE
14161 * image.c: Make symbols static if they're not exported.
14162 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14163 if USE_GTK.
14164 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14165 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14166
ad9a7a06
PE
14167 * fringe.c (standard_bitmaps): Now static.
14168 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14169
81626931
PE
14170 * frame.c: Make symbols static if they're not exported.
14171 (x_report_frame_params, make_terminal_frame): Now static.
14172 (get_frame_param): Now static, unless HAVE_NS.
14173 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14174 (x_get_resource_string): Remove; not used.
14175 * frame.h (make_terminal_frame, x_report_frame_params):
14176 (x_get_resource_string); Remove decls.
14177 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14178 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14179
239f9db9
PE
14180 * font.c, fontset.c: Make symbols static if they're not exported.
14181 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14182 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14183 * font.c (font_close_object): Now static.
14184 * font.h (font_close_object): Remove.
14185 * fontset.c (FONTSET_OBJLIST): Remove.
14186 (free_realized_fontset) #if-0 the body, which does nothing.
14187 (face_suitable_for_char_p): #if-0, as it's never called.
14188 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
14189 * xfaces.c (face_at_string_position):
14190 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
14191 since 0 is always ASCII.
14192
dfcf3579
PE
14193 * fns.c (weak_hash_tables): Now static.
14194
5045092b
PE
14195 * fileio.c: Make symbols static if they're not exported.
14196 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14197 (Vwrite_region_annotation_buffers): Now static.
14198
57a96f5c
PE
14199 * eval.c: Make symbols static if they're not exported.
14200 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14201 * lisp.h (backtrace_list): Remove decl.
14202
35f08c38
PE
14203 * emacs.c: Make symbols static if they're not exported.
14204 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14205 (fatal_error_code, fatal_error_signal_hook, standard_args):
14206 Now static.
14207 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14208 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14209 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14210 * lisp.h (fatal_error_signal_hook): Remove decl.
14211 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14212
f44bd759
PE
14213 * editfns.c: Move a (normally-unused) function to its only use.
14214 * editfns.c, lisp.h (get_operating_system_release): Remove.
14215 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14216 worth the hassle of breaking this out.
14217
b532497d
PE
14218 * xterm.c: Make symbols static if they're not exported.
14219 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14220 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14221 (x_destroy_window, x_delete_display):
14222 Now static.
14223 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14224 (x_mouse_leave): Remove; unused.
14225 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14226 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14227 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14228 Remove decls.
14229 (x_mouse_leave): Declare only if WINDOWSNT.
14230 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14231 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14232 USE_X_TOOLKIT.
14233
1675728f
PE
14234 * ftxfont.c: Make symbols static if they're not exported.
14235 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14236 HAVE_FREETYPE.
14237 * font.h (ftxfont_driver): Likewise.
14238
e4cebfca
PE
14239 * xfns.c: Make symbols static if they're not exported.
14240 (x_last_font_name, x_display_info_for_name):
14241 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14242 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14243 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14244 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14245 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14246 (last_show_tip_args): Now static.
14247 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14248 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14249 (x_screen_planes): Remove; unused.
14250 * dispextern.h (x_screen_planes): Remove decl.
14251
5bf46f05
PE
14252 * dispnew.c: Make symbols static if they're not exported.
14253 * dispextern.h (redraw_garbaged_frames, scrolling):
14254 (increment_row_positions): Remove.
14255 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14256 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14257 Now static.
14258 (redraw_garbaged_frames): Remove; unused.
14259
435f4c28
PE
14260 * xfaces.c: Make symbols static if they're not exported.
14261 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14262 Remove decls.
14263 * xterm.h (defined_color): Remove decls.
14264 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14265 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14266 (menu_face_changed_default, defined_color, free_realized_face):
14267 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14268 (ascii_face_of_lisp_face): Remove; unused.
14269
8524aef3
PE
14270 * xdisp.c: Make symbols static if they're not exported.
14271 * dispextern.h (scratch_glyph_row, window_box_edges):
14272 (glyph_to_pixel_coords, set_cursor_from_row):
14273 (get_next_display_element, set_iterator_to_next):
14274 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14275 (show_mouse_face): Remove decls
14276 * frame.h (message_buf_print): Likewise.
14277 * lisp.h (pop_message, set_message, check_point_in_composition):
14278 Likewise.
14279 * xterm.h (set_vertical_scroll_bar): Likewise.
14280 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14281 (message_buf_print, scratch_glyph_row, displayed_buffer):
14282 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14283 (get_next_display_element, show_mouse_face, window_box_edges):
14284 (frame_to_window_pixel_xy, check_point_in_composition):
14285 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14286 (glyph_to_pixel_coords): Remove; unused.
14287
16390cd2
PE
14288 * dired.c (file_name_completion): Now static.
14289
14290 * dbusbind.c (xd_in_read_queued_messages): Now static.
14291
a25f4dfa
PE
14292 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14293 * data.c (circular_list_error): Remove.
14294
14a9c8df
PE
14295 * commands.h (last_point_position, last_point_position_buffer):
14296 (last_point_position_window): Remove decls.
14297 * keyboard.c: Make these variables static.
14298
04f2d78b
CB
14299 * coding.h (coding, code_convert_region, encode_coding_gap):
14300 Remove decls.
74ab6df5
PE
14301 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14302 (iso_code_class, detect_coding, code_convert_region): Now static.
14303 (encode_coding_gap): Remove; unused.
14304
38dfbee1
PE
14305 * chartab.c (chartab_chars, chartab_bits): Now static.
14306
a2cb4e63
PE
14307 * charset.h (charset_iso_8859_1): Remove decl.
14308 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14309 Now static.
14310
127198fd
PE
14311 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14312 * ccl.c (Vccl_program_table): Now static.
14313 (check_ccl_update): Remove; unused.
14314
d85b608f
PE
14315 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14316 * category.h: ... from here.
14317 * category.c (check_category_table, set_category_set): Now static.
14318
31cd66f3
PE
14319 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14320 * lisp.h: Remove these decls.
14321
c358e587
PE
14322 * buffer.c (buffer_count): Remove unused var.
14323
e78aecca
PE
14324 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14325 so that it's not optimized away.
14326 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14327 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14328 exported only to the debugger.
14329
e192d7d3 14330 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 14331 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 14332
92470028
PE
14333 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14334 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14335 was inaccessible from Lisp.
14336 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14337 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14338
244ed907
PE
14339 alloc.c: Import and export fewer symbols, and remove unused items.
14340 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14341 is defined.
14342 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14343 it's not optimized away by whole-program optimization.
14344 (message_enable_multibyte, free_misc): Remove.
14345 (catchlist, handlerlist, mark_backtrace):
14346 Declare only if BYTE_MARK_STACK.
14347 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14348 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14349 (message_enable_multibyte): Remove decl.
14350 (free_misc, interval_free_list, float_block, float_block_index):
14351 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14352 (cons_free_list, last_marked_index):
14353 Now static.
14354 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14355 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14356 (mark_backtrace): Define only if BYTE_MARK_STACK.
14357 * xdisp.c (message_enable_multibyte): Now static.
14358
61c2b50e 14359 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
14360 This makes it easier for human readers (and static analyzers)
14361 to see whether these variables are used from other modules.
14362 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14363 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14364 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14365 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14366 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14367 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14368 * xmenu.c, xselect.c:
14369 Declare Q* vars static if they are not used in other modules.
14370 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14371 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14372 Remove decls of unexported vars.
14373 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14374
95c82688
PE
14375 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14376
16a97296
PE
14377 Make Emacs functions such as Fatom 'static' by default.
14378 This makes it easier for human readers (and static analyzers)
14379 to see whether these functions can be called from other modules.
14380 DEFUN now defines a static function. To make the function external
14381 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
14382 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14383 (Finit_image_library):
16a97296
PE
14384 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14385 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14386 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14387 Remove decls, since these functions are now static.
14388 (Funintern, Fget_internal_run_time): New decls, since these functions
14389 were already external.
95c82688 14390
16a97296
PE
14391 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14392 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14393 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14394 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14395 * keyboard.c, keymap.c, lread.c:
14396 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14397 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14398 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14399 Mark functions with DEFUE instead of DEFUN,
14400 if they are used in other modules.
14401 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14402 decls for now-static functions.
14403 * buffer.h (Fdelete_overlay): Remove decl.
14404 * callproc.c (Fgetenv_internal): Mark as internal.
14405 * composite.c (Fremove_list_of_text_properties): Remove decl.
14406 (Fcomposition_get_gstring): New forward static decl.
14407 * composite.h (Fcomposite_get_gstring): Remove decl.
14408 * dired.c (Ffile_attributes): New forward static decl.
14409 * doc.c (Fdocumntation_property): New forward static decl.
14410 * eval.c (Ffetch_bytecode): New forward static decl.
14411 (Funintern): Remove extern decl; now in .h file where it belongs.
14412 * fileio.c (Fmake_symbolic_link): New forward static decl.
14413 * image.c (Finit_image_library): New forward static decl.
14414 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14415 * intervals.h (Fprevious_property_change):
14416 (Fremove_list_of_text_properties): Remove decls.
14417 * keyboard.c (Fthis_command_keys): Remove decl.
14418 (Fcommand_execute): New forward static decl.
14419 * keymap.c (Flookup_key): New forward static decl.
14420 (Fcopy_keymap): Now static.
14421 * keymap.h (Flookup_key): Remove decl.
14422 * process.c (Fget_process): New forward static decl.
14423 (Fprocess_datagram_address): Mark as internal.
14424 * syntax.c (Fsyntax_table_p): New forward static decl.
14425 (skip_chars): Remove duplicate decl.
14426 * textprop.c (Fprevious_property_change): New forward static decl.
14427 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14428 Now internal.
14429 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14430 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14431
785bbd42
PE
14432 * editfns.c (Fformat): Remove unreachable code.
14433
8b913b57
AS
144342011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14435
14436 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14437 change. (Bug#8496)
14438
a6744a35
EZ
144392011-04-13 Eli Zaretskii <eliz@gnu.org>
14440
14441 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14442 when at ZV. (Bug#8487)
14443
e7974947
AS
144442011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14445
baad03f0
AS
14446 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14447 (Bug#8437)
14448 * keyboard.c (parse_tool_bar_item): Likewise.
14449 * sound.c (sound_cleanup, alsa_close): Likewise.
14450 * termcap.c (tgetent): Likewise.
14451 * xfns.c (x_default_font_parameter): Likewise.
14452 * xsettings.c (read_and_apply_settings): Likewise.
14453
e7974947
AS
14454 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14455 (overrun_check_free): Protoize.
14456
28272684
PE
144572011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14458
14459 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14460 since callers should never pass a negative size.
14461 Change the signature to match that of plain 'read' and 'write'; see
14462 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14463 * lisp.h: Update prototypes of emacs_write and emacs_read.
14464
11997c76
EZ
144652011-04-11 Eli Zaretskii <eliz@gnu.org>
14466
14467 * xdisp.c (redisplay_window): Don't try to determine the character
14468 position of the scroll margin if the window start point w->startp
e896f03c 14469 is outside the buffer's accessible region. (Bug#8468)
11997c76 14470
8a2cbd72
EZ
144712011-04-10 Eli Zaretskii <eliz@gnu.org>
14472
14473 Fix write-region and its subroutines for buffers > 2GB.
14474 * fileio.c (a_write, e_write): Modify declaration of arguments and
14475 local variables to support buffers larger than 2GB.
14476 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14477
14478 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14479 argument, local variables, and return value.
14480
14481 * lisp.h: Update prototypes of emacs_write and emacs_read.
14482
14483 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14484
4073e537 144852011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 14486
1ebfdcb6
PE
14487 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14488
b2ded58d
PE
14489 Fix more problems found by GCC 4.6.0's static checks.
14490
7d66342c
PE
14491 * xdisp.c (vmessage): Use a better test for character truncation.
14492
bbf47d44
PE
14493 * charset.c (load_charset_map): <, not <=, for optimization,
14494 and to avoid potential problems with integer overflow.
9248994d 14495 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 14496 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 14497 * editfns.c (Fformat): Likewise.
1e69125e 14498 * syntax.c (skip_chars): Likewise.
3befa583 14499
e3019616
PE
14500 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14501 This also lets GCC 4.6.0 generate slightly better loop code.
14502
becfa255
PE
14503 * callint.c (Fcall_interactively): <, not <=, for optimization.
14504 (Fcall_interactively): Count the number of arguments produced,
14505 not the number of arguments given. This is simpler and lets GCC
14506 4.6.0 generate slightly better code.
14507
dae0cd48
PE
14508 * ftfont.c: Distingish more carefully between FcChar8 and char.
14509 The previous code passed unsigned char * to a functions like
14510 strlen and xstrcasecmp that expect char *, which does not
14511 conform to the C standard.
14512 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14513 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14514 char * when the C standard requires it.
14515
76032d70
PE
14516 * keyboard.c (read_char): Remove unused var.
14517
eb3f1cc8
PE
14518 * eval.c: Port to Windows vsnprintf (Bug#8435).
14519 Include <limits.h>.
14520 (SIZE_MAX): Define if the headers do not.
14521 (verror): Do not give up if vsnprintf returns a negative count.
14522 Instead, grow the buffer. This ports to Windows vsnprintf, which
14523 does not conform to C99. Problem reported by Eli Zaretskii.
14524 Also, simplify the allocation scheme, by avoiding the need for
14525 calling realloc, and removing the ALLOCATED variable.
14526
70476b54
PE
14527 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14528
12020a9e
PE
14529 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14530 But keep the doprint source code for now, as we might revamp it
14531 and use it again (Bug#8435).
ea6c7ae6
PE
14532 * lisp.h (doprnt): Remove.
14533 * Makefile.in (base_obj): Remove doprnt.o.
14534 * deps.mk (doprnt.o): Remove.
14535
5fdb398c
PE
14536 error: Print 32- and 64-bit integers portably (Bug#8435).
14537 Without this change, on typical 64-bit hosts error ("...%d...", N)
14538 was used to print both 32- and 64-bit integers N, which relied on
14539 undefined behavior.
61bdb816 14540 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
14541 * lisp.h (error, verror): Mark as printf-like functions.
14542 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14543 Report overflow in size calculations when allocating printf buffer.
14544 Do not truncate output string at its first null byte.
14545 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14546 Truncate the output at a character boundary, since vsnprintf does not
14547 do that.
14548 * charset.c (check_iso_charset_parameter): Convert internal
14549 character to string before calling 'error', since %c now has the
14550 printf meaning.
14551 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14552 overflow when computing char to be passed to 'error'. Do not
14553 pass Lisp_Object to 'error'; pass the integer instead.
14554 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14555 formatted with plain %d.
14556
b189fa66
PE
14557 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14558
bff87ef0
PE
14559 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14560
7e2cac20
PE
14561 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14562
ce4d90b5
PE
14563 * xterm.c (x_catch_errors): Remove duplicate declaration.
14564
266c9547
PE
14565 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14566
79c49ad2
PE
14567 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14568
368f4090
JM
145692011-04-10 Jim Meyering <meyering@redhat.com>
14570
14571 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14572 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14573 return ssize_t not "int", and use size_t as the buffer length.
14574 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14575 * gnutls.h: Update declarations.
14576 * process.c (read_process_output): Use ssize_t, to match.
14577 (send_process): Likewise.
14578
a32d4040
CY
145792011-04-09 Chong Yidong <cyd@stupidchicken.com>
14580
14581 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14582
8546720e 145832011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 14584
04f2d78b
CB
14585 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14586 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 14587
8546720e
GM
14588 * xterm.c (handle_one_xevent):
14589 * xmenu.c (create_and_show_popup_menu):
14590 * xselect.c (x_decline_selection_request)
14591 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 14592
0a2f5c1a 145932011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
14594
14595 Fix some uses of `int' instead of EMACS_INT.
14596 * search.c (string_match_1, fast_string_match)
14597 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14598 (scan_buffer, find_next_newline_no_quit)
14599 (find_before_next_newline, search_command, Freplace_match)
14600 (Fmatch_data): Make some `int' variables be EMACS_INT.
14601
14602 * xdisp.c (display_count_lines): 3rd argument and return value now
14603 EMACS_INT. All callers changed.
14604 (pint2hrstr): Last argument is now EMACS_INT.
14605
14606 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14607 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14608 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14609 (decode_coding_utf_16, decode_coding_emacs_mule)
14610 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14611 (decode_coding_ccl, decode_coding_charset)
14612 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14613 (decode_coding_iso_2022, decode_coding_emacs_mule)
14614 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14615 <char_offset, last_offset>: Declare EMACS_INT.
14616 (encode_coding_utf_8, encode_coding_utf_16)
14617 (encode_coding_emacs_mule, encode_invocation_designation)
14618 (encode_designation_at_bol, encode_coding_iso_2022)
14619 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14620 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14621 Declare EMACS_INT.
14622 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14623 (encode_invocation_designation): Last argument P_NCHARS is now
14624 EMACS_INT.
14625 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14626 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14627
14628 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14629 All users changed.
14630
14631 * ccl.c (Fccl_execute_on_string): Declare some variables
14632 EMACS_INT.
14633
8546720e 146342011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
14635
14636 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14637
4e19a977
CS
146382011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14639
14640 * process.c (Fformat_network_address): Doc fix.
14641
87302331
R
146422011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14643
ee7683eb 14644 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 14645
cbb59342
CY
146462011-04-08 Chong Yidong <cyd@stupidchicken.com>
14647
14648 * keyboard.c (read_char): Call Lisp function help-form-show,
14649 instead of using internal_with_output_to_temp_buffer.
14650 (Qhelp_form_show): New var.
e0d38eeb 14651 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
14652
14653 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14654
14655 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14656
e67a13ab
CY
146572011-04-06 Chong Yidong <cyd@stupidchicken.com>
14658
04f2d78b
CB
14659 * process.c (Flist_processes): Remove to Lisp.
14660 (list_processes_1): Delete.
e67a13ab 14661
973f782d
EZ
146622011-04-06 Eli Zaretskii <eliz@gnu.org>
14663
7c106b1e
EZ
14664 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14665
973f782d
EZ
14666 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14667
41cf7d1a 146682011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 14669
ca23cc88
PE
14670 Fix more problems found by GCC 4.6.0's static checks.
14671
f390e2d5
PE
14672 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14673
42eea0d0
PE
14674 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14675
b69769da 14676 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 14677
f9541e84
PE
14678 * xdisp.c (vmessage): Mark as a printf-like function.
14679
13841b55
PE
14680 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14681
c136c10f
PE
14682 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14683
5e2d4a30
PE
14684 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14685 printf-like functions.
14686 (tiff_load): Add casts to remove these marks before passing them
14687 to system-supplied API.
14688
583f48b9
PE
14689 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14690
b25d760e
PE
14691 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14692 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
14693 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14694 directly, rather than having caller test rule sign. This avoids
14695 some unnecessary tests.
14696 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14697 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14698 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 14699
bc7b6697 14700 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 14701 (xfont_open): Avoid unnecessary tests.
bc7b6697 14702
27ccc379
PE
14703 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14704
dcd5c89a
PE
14705 * composite.h, composite.c (composition_gstring_put_cache):
14706 Use EMACS_INT, not int, for length.
14707
b13a45c6
PE
14708 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14709 breaking out part of COMPOSITION_DECODE_RULE.
14710 (COMPOSITION_DECODE_RULE): Use it.
14711 * composite.c (get_composition_id): Remove unused local vars,
14712 by using the new macro.
14713
1e792e4d
PE
14714 * textprop.c (set_text_properties_1): Change while to do-while,
14715 since the condition is always true at first.
14716
dc6c6455 14717 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
14718 (interval_deletion_adjustment): Return unsigned value.
14719 All uses changed.
dc6c6455 14720
aba7731a
PE
14721 * process.c (list_processes_1, create_pty, read_process_output):
14722 (exec_sentinel): Remove vars that were set but not used.
afd4052b 14723 (create_pty): Remove unnecessary "volatile"s.
bc57d757 14724 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 14725 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 14726 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 14727
fdfc4bf3
PE
14728 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14729
fca8fe46 14730 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 14731 (update_syntax_table): Use unsigned instead of int.
fca8fe46 14732
06a0259a 14733 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 14734 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 14735 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 14736
e7b9e80f
PE
14737 * print.c (print_error_message): Avoid int overflow.
14738
56201685
PE
14739 * font.c (font_list_entities): Redo for clarity,
14740 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14741
78834453 14742 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 14743 (font_score): Avoid potential overflow in diff calculation.
78834453 14744
0bc0b309 14745 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 14746 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 14747
e610eaca
PE
14748 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14749
b895abce
PE
14750 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14751 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14752 can always succeed if overflow has undefined behavior.
14753
1f1d9321 14754 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 14755 (wordify): Omit three unnecessary tests.
1f1d9321 14756
c59478bc
PE
14757 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14758 All callers changed. This avoids the need for an unused var.
14759
79b73827
PE
14760 * casefiddle.c (casify_region): Remove var that is set but not used.
14761
a4db5dfe
PE
14762 * dired.c (file_name_completion): Remove var that is set but not used.
14763
43aae36e
PE
14764 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14765
2a47c44d 14766 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 14767 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 14768
a37c69bf
PE
14769 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14770 Check for integer overflow on size calculations.
14771
328ab8e7
PE
14772 * buffer.c (Fprevious_overlay_change): Remove var that is set
14773 but not used.
14774
e5a2a5cb
PE
14775 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14776 Remove vars that are set but not used.
8d84a6eb 14777 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 14778 (timer_check_2): Mark vars as initialized.
e5a2a5cb 14779
a60e5f68
PE
14780 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14781
f661cb61 14782 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 14783 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 14784
f0397f5a
PE
14785 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14786 that are set but not used.
14787
8664db06 14788 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 14789 if XCreateBitmapFromData fails (Bug#8410).
8664db06 14790
6abdaa4a
PE
14791 * xselect.c (x_get_local_selection, x_handle_property_notify):
14792 Remove vars that are set but not used.
14793
0ce7538d 14794 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 14795 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 14796
9ae848fc
PE
14797 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14798 Remove var that is set but not used.
0b918413
PE
14799 (scroll_bar_windows_size): Now size_t, not int.
14800 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14801 Check for overflow.
9ae848fc 14802
a5a62657
PE
14803 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14804 (map_tty_color) [!defined MSDOS]: Likewise.
14805
5c5cdd39
PE
14806 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14807
66ebf983
PE
14808 * coding.c: Remove vars that are set but not used.
14809 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14810 All callers changed.
14811 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14812 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14813 (decode_coding_charset): Remove vars that are set but not used.
14814
1be4d761
PE
14815 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14816 that is set but not used.
14817
47553fa8
PE
14818 * print.c (print_object): Remove var that is set but not used.
14819
1f7196bf 14820 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
14821 The gnulib version avoids calling malloc in the usual case,
14822 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14823 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14824 * filelock.c (current_lock_owner): Likewise.
14825 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14826 * sysdep.c: Include allocator.h, careadlinkat.h.
14827 (emacs_no_realloc_allocator): New static constant.
14828 (emacs_readlink): New function.
fdb61804
PE
14829 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14830 ../lib/careadlinkat.h.
d1fdcab7 14831
f84c17c7
SM
148322011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14833
14834 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14835 first non-nil return value).
14836
ef3862ad
JD
148372011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14838
14839 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14840 if not defined (Bug#8403).
14841
376a7006
JB
148422011-04-02 Juanma Barranquero <lekktu@gmail.com>
14843
14844 * xdisp.c (display_count_lines): Remove parameter `start',
14845 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14846 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14847 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14848 (fill_stretch_glyph_string): Remove parameters `row' and `area',
14849 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14850 and thereabouts. All callers changed.
14851 (get_per_char_metric): Remove parameter `f', unused since
14852 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14853
6ca3801d
JM
148542011-04-02 Jim Meyering <meyering@redhat.com>
14855
14856 do not dereference NULL upon failed strdup
14857 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14858 (ns_get_family): Likewise.
14859
d8e2b5ba
JB
148602011-04-02 Juanma Barranquero <lekktu@gmail.com>
14861
14862 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14863
8c74fcbd
JD
148642011-04-02 Jan Djärv <jan.h.d@swipnet.se>
14865
14866 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14867 later (Bug#8403).
14868
7200d79c
SM
148692011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
14870
03408648 14871 Add lexical binding.
7200d79c 14872
03408648
SM
14873 * window.c (Ftemp_output_buffer_show): New fun.
14874 (Fsave_window_excursion):
14875 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14876
14877 * lread.c (lisp_file_lexically_bound_p): New function.
14878 (Fload): Bind Qlexical_binding.
14879 (readevalloop): Remove `evalfun' arg.
14880 Bind Qinternal_interpreter_environment.
14881 (Feval_buffer): Bind Qlexical_binding.
14882 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14883 Mark as dynamic.
14884 (syms_of_lread): Declare `lexical-binding'.
14885
14886 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14887
14888 * keyboard.c (eval_dyn): New fun.
14889 (menu_item_eval_property): Use it.
ca105506
SM
14890
14891 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 14892
03408648
SM
14893 * fns.c (concat, mapcar1): Accept byte-code-functions.
14894
14895 * eval.c (Fsetq): Handle lexical vars.
14896 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14897 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14898 (FletX, Flet): Obey lexical binding.
14899 (Fcommandp): Handle closures.
14900 (Feval): New `lexical' arg.
14901 (eval_sub): New function extracted from Feval. Use it almost
14902 everywhere where Feval was used. Look up vars in lexical env.
14903 Handle closures.
14904 (Ffunctionp): Move from subr.el.
14905 (Ffuncall): Handle closures.
14906 (apply_lambda): Remove `eval_flags'.
14907 (funcall_lambda): Handle closures and new byte-code-functions.
14908 (Fspecial_variable_p): New function.
14909 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
14910 but without exporting it to Lisp.
23aba0ea 14911
23aba0ea 14912 * doc.c (Fdocumentation, store_function_docstring):
03408648 14913 * data.c (Finteractive_form): Handle closures.
23aba0ea 14914
03408648
SM
14915 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
14916 interactive spec.
ba83908c 14917
04f2d78b
CB
14918 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
14919 New byte-codes.
03408648
SM
14920 (exec_byte_code): New function extracted from Fbyte_code to handle new
14921 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 14922
03408648 14923 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 14924
03408648 14925 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 14926
e2abce01
JB
149272011-03-31 Juanma Barranquero <lekktu@gmail.com>
14928
14929 * xdisp.c (redisplay_internal): Fix prototype.
14930
63696a73 149312011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 14932
63696a73 14933 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
14934 (try_scrolling): Use it when setting scroll_limit.
14935 Limit scrolling to 100 screen lines.
63696a73
EZ
14936 (redisplay_window): Even when falling back on "recentering",
14937 position point in the window according to scroll-conservatively,
14938 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
14939
14940 (try_scrolling): When point is above the window, allow searching
14941 as far as scroll_max, or one screenful, to compute vertical
14942 distance from PT to the scroll margin position. This prevents
14943 try_scrolling from unnecessarily failing when
14944 scroll-conservatively is set to a value slightly larger than the
14945 window height. Clean up the case of PT below the margin at bottom
14946 of window: scroll_max can no longer be INT_MAX. When aggressive
14947 scrolling is in use, don't let point enter the opposite scroll
14948 margin as result of the scroll.
14949 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
14950 threshold of 100 lines for never-recentering scrolling.
14951
e4cc2dfc
JB
149522011-03-31 Juanma Barranquero <lekktu@gmail.com>
14953
14954 * dispextern.h (move_it_by_lines):
14955 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
14956 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
14957 (message_log_check_duplicate): Remove parameters `prev_bol' and
14958 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14959 (redisplay_internal): Remove parameter `preserve_echo_area',
14960 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
14961
14962 * indent.c (Fvertical_motion):
14963 * window.c (window_scroll_pixel_based, Frecenter):
14964 Don't pass `need_y_p' to `move_it_by_lines'.
14965
1c470562
SM
149662011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
14967
44f230aa
SM
14968 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
14969 steal a few bits to be more compact.
14970 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
14971 Remove unneeded casts.
14972
1c470562
SM
14973 * bytecode.c (Fbyte_code): CAR and CDR can GC.
14974
888adce9
ZK
149752011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
14976
14977 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
14978 binding" message (bug#7967).
14979
f838ed7b
PE
149802011-03-30 Paul Eggert <eggert@cs.ucla.edu>
14981
77861b95
PE
14982 Fix more problems found by GCC 4.6.0's static checks.
14983
de6dbc14
PE
14984 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
14985 Remove unused local var.
14986
f838ed7b
PE
14987 * editfns.c (Fmessage_box): Remove unused local var.
14988
792c7b2b
PE
14989 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
14990 (note_mode_line_or_margin_highlight, note_mouse_highlight):
14991 Omit unused local vars.
c499e557 14992 * window.c (shrink_windows): Omit unused local var.
b01a1c29 14993 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
14994 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
14995 Omit unused local var.
14996
ba0165e1
PE
14997 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
14998 Don't assume string length fits in int.
32ad8845 14999 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 15000 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 15001
3c59b4c9
PE
15002 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15003 instead of alloca (Bug#8344).
15004
a3eed478 15005 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 15006 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 15007
eb4d412d
PE
15008 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15009
1658b401
PE
15010 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15011 concerns.
15012
15013 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15014
15015 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 15016
9a2c6e05
PE
15017 * keyboard.c (syms_of_keyboard): Use the same style as later
15018 in this function when indexing through an array. This also
15019 works around GCC bug 48267.
15020
03d0a109
PE
15021 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15022
44f730c8
PE
15023 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15024
fe75f926
PE
15025 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15026 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15027
ffa8c828
PE
15028 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15029 This avoids undefined behavior on integer overflow, and is a bit
15030 more convenient anyway since it is compared to a size_t variable.
15031
c5101a77
PE
15032 Variadic C functions now count arguments with size_t, not int.
15033 This avoids an unnecessary limitation on 64-bit machines, which
15034 caused (substring ...) to crash on large vectors (Bug#8344).
15035 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15036 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 15037 All variadic functions and their callers changed accordingly.
c5101a77
PE
15038 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15039 * data.c (arith_driver, float_arith_driver): Likewise.
15040 * editfns.c (general_insert_function): Likewise.
15041 * eval.c (struct backtrace.nargs, interactive_p)
15042 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15043 (funcall_lambda, mark_backtrace): Likewise.
15044 * fns.c (concat): Likewise.
15045 * frame.c (x_set_frame_parameters): Likewise.
15046 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15047 0 if not found, not -1. All callers changed.
15048
dd3f25f7
PE
15049 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15050 (stack_copy_size): Now size_t, not int.
15051 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15052
461c2ab9
JB
150532011-03-28 Juanma Barranquero <lekktu@gmail.com>
15054
15055 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15056 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15057 All callers changed.
15058
15059 * lisp.h (multibyte_char_to_unibyte):
15060 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15061 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15062 * character.h (CHAR_TO_BYTE8):
15063 * cmds.c (internal_self_insert):
15064 * editfns.c (general_insert_function):
15065 * keymap.c (push_key_description):
15066 * search.c (Freplace_match):
15067 * xdisp.c (message_dolog, set_message_1): All callers changed.
15068
f6d62986
SM
150692011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15070
15071 * keyboard.c (safe_run_hook_funcall): New function.
15072 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15073 don't set the hook to nil, but remove the offending function instead.
15074 (Qcommand_hook_internal): Remove, unused.
15075 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15076 Vcommand_hook_internal.
15077
15078 * eval.c (enum run_hooks_condition): Remove.
15079 (funcall_nil, funcall_not): New functions.
15080 (run_hook_with_args): Call each function through a `funcall' argument.
15081 Remove `cond' argument, now redundant.
15082 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15083 (Frun_hook_with_args_until_failure): Adjust accordingly.
15084 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15085
1db5b1ad
JB
150862011-03-28 Juanma Barranquero <lekktu@gmail.com>
15087
15088 * dispextern.h (string_buffer_position): Remove declaration.
15089
15090 * print.c (strout): Remove parameter `multibyte', unused since
15091 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15092
15093 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15094 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15095 All callers changed.
15096
15097 * w32.c (_wsa_errlist): Use braces for struct initializers.
15098
15099 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15100 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15101 All callers changed.
15102 (string_buffer_position): Likewise. Also, make static (it's never
15103 used outside xdisp.c).
15104 (cursor_row_p): Remove parameter `w', unused since
15105 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15106 (decode_mode_spec): Remove parameter `precision', introduced during
15107 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15108 All callers changed.
15109
5ffb62aa
JD
151102011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15111
15112 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15113
461c2ab9 151142011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
15115
15116 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15117 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15118 (ns_update_auto_hide_menu_bar): New functions.
15119 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15120 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15121 ns_constrain_all_frames.
15122 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15123 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15124
5c380ffb
JD
151252011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15126
15127 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15128
9af30bdf
GM
151292011-03-27 Glenn Morris <rgm@gnu.org>
15130
15131 * syssignal.h: Replace RETSIGTYPE with void.
15132 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15133 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15134 Replace SIGTYPE with void everywhere.
15135 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15136 * s/template.h (SIGTYPE): Remove commented out definition.
15137
e2abce01
JB
151382011-03-26 Eli Zaretskii <eliz@gnu.org>
15139
15140 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15141 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15142
f868cd8a
JB
151432011-03-26 Juanma Barranquero <lekktu@gmail.com>
15144
59eb0929
JB
15145 * w32.c (read_unc_volume): Use parameter `henum', instead of
15146 global variable `wget_enum_handle'.
15147
15148 * keymap.c (describe_vector): Remove parameters `indices' and
15149 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15150 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15151
f868cd8a
JB
15152 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15153
15154 * keyboard.c (timer_check): Remove parameter `do_it_now',
15155 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15156 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15157 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15158
15159 * keyboard.c (read_char):
15160 * w32menu.c (w32_menu_display_help):
15161 * xmenu.c (show_help_event, menu_help_callback):
15162 Adjust calls to `show_help_echo'.
15163
15164 * gtkutil.c (xg_maybe_add_timer):
15165 * keyboard.c (readable_events):
15166 * process.c (wait_reading_process_output):
15167 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15168
15169 * insdel.c (adjust_markers_gap_motion):
15170 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15171 (gap_left, gap_right): Don't call it.
15172
2ecf6fdb
CY
151732011-03-25 Chong Yidong <cyd@stupidchicken.com>
15174
15175 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15176 incurred during fontification.
15177
6b1f9ba4
JB
151782011-03-25 Juanma Barranquero <lekktu@gmail.com>
15179
15180 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15181 (DEFVAR_PER_BUFFER): Don't pass it.
15182
15183 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15184 (scrolling_window): Don't pass it.
15185
0f4a96b5
JB
151862011-03-25 Juanma Barranquero <lekktu@gmail.com>
15187
15188 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15189
15190 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15191 and `suffix'.
15192 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15193 of variables specific to SELinux and computation of `encoded_absname'.
15194
15195 * image.c (XPutPixel): Remove unused variable `height'.
15196
15197 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15198
15199 * unexw32.c (get_section_info): Remove unused variable `section'.
15200
15201 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15202 (system_process_attributes): Remove unused variable `sess'.
15203 (sys_read): Remove unused variable `err'.
15204
15205 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15206 (w32_wnd_proc): Remove unused variable `isdead'.
15207 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15208 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15209 (x_create_tip_frame): Remove unused variable `tem'.
15210
15211 * w32inevt.c (w32_console_read_socket):
15212 Remove unused variable `no_events'.
15213
15214 * w32term.c (x_draw_composite_glyph_string_foreground):
15215 Remove unused variable `width'.
15216
1149507c
JB
152172011-03-24 Juanma Barranquero <lekktu@gmail.com>
15218
15219 * w32term.c (x_set_glyph_string_clipping):
15220 Don't pass uninitialized region to CombineRgn.
15221
9c88f339
JB
152222011-03-23 Juanma Barranquero <lekktu@gmail.com>
15223
15224 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15225 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15226 (Fx_close_connection): Remove unused variable `i'.
15227
15228 * w32font.c (w32font_draw): Return number of glyphs.
15229 (w32font_open_internal): Remove unused variable `i'.
15230 (w32font_driver): Add missing initializer.
15231
15232 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15233 (fill_in_menu): Remove unused variable `items_added'.
15234
15235 * w32term.c (last_mouse_press_frame): Remove static global variable.
15236 (w32_clip_to_row): Remove unused variable `f'.
15237 (x_delete_terminal): Remove unused variable `i'.
15238
15239 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15240 (NOTHING): Remove unused static global variable.
15241 (uniscribe_check_otf): Remove unused variable `table'.
15242 (uniscribe_font_driver): Add missing initializers.
15243
dee091a3
JD
152442011-03-23 Julien Danjou <julien@danjou.info>
15245
15246 * term.c (Fsuspend_tty, Fresume_tty):
15247 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15248 * window.c (temp_output_buffer_show):
15249 * insdel.c (signal_before_change):
15250 * frame.c (Fhandle_switch_frame):
15251 * fileio.c (Fdo_auto_save):
15252 * emacs.c (Fkill_emacs):
15253 * editfns.c (save_excursion_restore):
15254 * cmds.c (internal_self_insert):
15255 * callint.c (Fcall_interactively):
15256 * buffer.c (Fkill_all_local_variables):
15257 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15258 Use Frun_hooks.
0f4a96b5 15259 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 15260 unconditionally since it does the check itself.
dee091a3 15261
2c520ab5 152622011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 15263
c9c49752
PE
15264 Fix more problems found by GCC 4.5.2's static checks.
15265
8abc3f12
PE
15266 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15267 the first time through the loop, since we know p0 < p1 then.
15268 This also avoids a gcc -Wstrict-overflow warning.
15269
a2d26660
PE
15270 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15271 leading to a memory leak, possible in functions like
15272 load_charset_map_from_file that can allocate an unbounded number
b12ef411 15273 of objects (Bug#8318).
a2d26660 15274
916c72e9
PE
15275 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15276 that could (at least in theory) be that large.
15277
19ab8a18
PE
15278 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15279 This is less likely to overflow, and avoids undefined behavior if
15280 overflow does occur. All callers changed. Use strtoul to scan
15281 for the unsigned long integer.
b7cbbd6f
PE
15282 (pint2hrstr): Simplify and tune code slightly.
15283 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 15284
f0641eff
PE
15285 * scroll.c (do_scrolling): Work around GCC bug 48228.
15286 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15287
7f650bb9
PE
15288 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15289 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
15290 (validate_x_resource_name): Simplify count usage.
15291 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 15292
37dd57d1
PE
15293 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15294 fail (Bug#8306).
81e56e61 15295
699979fc 15296 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 15297
401bf9b4
PE
15298 * process.c (Fmake_network_process): Use socklen_t, not int,
15299 where POSIX says socklen_t is required in portable programs.
15300 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 15301 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
15302 (Fmake_network_process, server_accept_connection):
15303 (wait_reading_process_output, read_process_output):
15304 Likewise.
15305
b93aacde
PE
15306 * process.c: Rename or move locals to avoid shadowing.
15307 (list_processes_1, Fmake_network_process):
15308 (read_process_output_error_handler, exec_sentinel_error_handler):
15309 Rename or move locals.
4dc343ee 15310 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 15311 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 15312 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 15313 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 15314 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 15315
af8a867c 15316 Make tparam.h and terminfo.c consistent.
44f230aa
SM
15317 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15318 Include tparam.h instead, since it declares them.
af8a867c
PE
15319 * cm.h (PC): Remove extern decl; tparam.h now does this.
15320 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15321 * terminfo.c: Include tparam.h, to check interfaces.
15322 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15323 (tparam): Adjust signature to match interface in tparam.h;
15324 this removes some undefined behavior. Check that outstring and len
15325 are zero, which they always are with Emacs.
15326 * tparam.h (PC, BC, UP): New extern decls.
15327
0248044d 15328 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 15329 (xftfont_open): Rename locals to avoid shadowing.
0248044d 15330
8ff096c1 15331 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
15332 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15333 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 15334 (ftfont_list): Remove unused local.
49eaafba
PE
15335 (get_adstyle_property, ftfont_pattern_entity):
15336 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15337 Rename locals to avoid shadowing.
8ff096c1 15338
e2be39f6
PE
15339 * xfont.c (xfont_list_family): Mark var as initialized.
15340
c9735e30
PE
15341 * xml.c (make_dom): Now static.
15342
8f5201ae
PE
15343 * composite.c (composition_compute_stop_pos): Rename local to
15344 avoid shadowing.
b246f932
PE
15345 (composition_reseat_it): Remove unused locals.
15346 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 15347 (composition_update_it): Mark var as initialized.
11b61122
PE
15348 (find_automatic_composition): Mark vars as initialized,
15349 with a FIXME (Bug#8290).
8f5201ae 15350
760fbc2c
PE
15351 character.h: Rename locals to avoid shadowing.
15352 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15353 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15354 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15355 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15356 to avoid shadowing.
15357
ff08eb85
PE
15358 * textprop.c (property_change_between_p): Remove; unused.
15359
fc7bf025
PE
15360 * intervals.c (interval_start_pos): Now static.
15361
235d7abc
PE
15362 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15363
44f230aa
SM
15364 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15365 Rename locals to avoid shadowing.
3e7d6594 15366
50060332
PE
15367 * sound.c (wav_play, au_play, Fplay_sound_internal):
15368 Fix pointer signedness.
d01f234b 15369 (alsa_choose_format): Remove unused local var.
c83b8872
PE
15370 (wav_play): Initialize a variable to 0, to prevent undefined
15371 behavior (Bug#8278).
50060332 15372
c4fc4e30
PE
15373 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15374
918436ed
PE
15375 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15376
c939f91b
PE
15377 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15378 clobbering (Bug#8298).
b9c7f648
PE
15379 * sysdep.c (sys_subshell): Likewise.
15380 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 15381
6bd8c144
PE
15382 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15383 This should get cleaned up, so that child_setup has the
15384 same signature on all platforms.
15385
7710357c 15386 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 15387 (relocate_fd): Rename locals to avoid shadowing.
7710357c 15388
c59da222
CY
153892011-03-22 Chong Yidong <cyd@stupidchicken.com>
15390
15391 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15392 not to be necessary, and produces flickering.
15393
66b87493
GM
153942011-03-20 Glenn Morris <rgm@gnu.org>
15395
15396 * config.in: Remove file.
15397
45b6f6d5
JB
153982011-03-20 Juanma Barranquero <lekktu@gmail.com>
15399
15400 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15401 are now in src/globals.h.
15402 (syms_of_minibuf): Remove spurious & from previous change.
15403
cd394be1 154042011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
15405
15406 * minibuf.c (completing-read-function): New variable.
15407 (completing-read-default): Rename from completing-read.
15408 (completing-read): Call completing-read-function.
15409
b14e3e21
CY
154102011-03-19 Juanma Barranquero <lekktu@gmail.com>
15411
15412 * xfaces.c (Fx_load_color_file):
15413 Read color file from absolute filename (bug#8250).
15414
f2b726e6
JB
154152011-03-19 Juanma Barranquero <lekktu@gmail.com>
15416
15417 * makefile.w32-in: Update dependencies.
15418
09f6ff02
EZ
154192011-03-17 Eli Zaretskii <eliz@gnu.org>
15420
15421 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15422
29a6015a
PE
154232011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15424
a3a6c54e
PE
15425 Fix more problems found by GCC 4.5.2's static checks.
15426
b766f867
PE
15427 * process.c (make_serial_process_unwind, send_process_trap):
15428 (sigchld_handler): Now static.
15429
be02381c
PE
15430 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15431 That way, the code declares only the vars that it needs.
15432 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15433 * s/cygwin.h (PTY_ITERATION): Likewise.
15434 * s/darwin.h (PTY_ITERATION): Likewise.
15435 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15436
57048744
PE
15437 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15438 * process.c (allocate_pty): Don't declare stb unless it's needed.
15439
7914961c 15440 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
15441 (CONSTANTLIM): Remove; unused.
15442 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15443 Define only if needed.
7914961c 15444
b3967b18
PE
15445 * unexelf.c (unexec): Name an expression,
15446 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
15447 Use a different way to cause a compilation error if anyone uses
15448 n rather than nn, a way that does not involve shadowing.
73366a00 15449 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 15450
29a6015a
PE
15451 * deps.mk (unexalpha.o): Remove; unused.
15452
43cfc33e 15453 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 15454 * unexec.h: New file.
ce701a33
PE
15455 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15456 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15457 Depend on unexec.h.
15458 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15459 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15460 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 15461 Change as necessary to match prototype in unexec.h.
ce701a33 15462
01f44d5a
PE
15463 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15464 shadowing.
4f63c6bb 15465 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 15466
a6670b0b
PE
15467 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15468 Rename locals to avoid shadowing.
15469
cef2010d 15470 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 15471 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 15472
d4d7173a
PE
15473 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15474
f08b802a
PE
15475 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15476 warning when compiling print.c.
15477
3ddb0639
PE
15478 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15479 instead of using an uninitialized var.
5ad03b97 15480 (font_sort_entities): Mark var as initialized.
3ddb0639 15481
170a2692
PE
15482 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15483
e663c700
PE
15484 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15485 pointers to constants.
89bc529a 15486 (font_parse_fcname): Remove unused vars.
7b81e2d0 15487 (font_delete_unmatched): Now static.
ea838e10 15488 (font_get_spec): Remove; unused.
13a547c6
PE
15489 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15490 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15491 Rename or move locals to avoid shadowing.
e663c700 15492
2a80c887 15493 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 15494 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 15495
1384fa33 15496 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 15497 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 15498
8b2c52e9
PE
15499 * alloc.c (mark_backtrace): Move decl from here ...
15500 * lisp.h: ... to here, so that it can be checked.
15501
475545b5 15502 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 15503 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
15504 (lisp_indirect_variable): Name an expression,
15505 to avoid gcc -Wbad-function-cast warning.
1faed8ae 15506 (Fdefvar): Rename locals to avoid shadowing.
475545b5 15507
b1349114 15508 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 15509 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 15510 Use const pointer when appropriate.
b1349114 15511
a2928364
PE
15512 * lisp.h (get_system_name, get_operating_system_release):
15513 Move decls here, to check interfaces.
15514 * process.c (get_operating_system_release): Move decl to lisp.h.
15515 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
15516 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15517 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15518 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
15519 (Fformat_time_string, Fencode_time, Finsert_char):
15520 (Ftranslate_region_internal, Fformat):
15521 Rename or remove local vars to avoid shadowing.
9710023e 15522 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 15523
a415e694
PE
15524 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15525 avoid shadowing.
15526
8ef4622d
PE
15527 * lisp.h (eassert): Check that the argument compiles, even if
15528 ENABLE_CHECKING is not defined.
15529
946f9a5b
PE
15530 * data.c (Findirect_variable): Name an expression, to avoid
15531 gcc -Wbad-function-cast warning.
112396d6 15532 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 15533 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
15534 (Fmake_variable_buffer_local, Fmake_local_variable):
15535 Mark variables as initialized.
52746918 15536 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 15537
e5aab7e7 15538 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
15539 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15540 Rename locals to avoid shadowing.
dff45157
PE
15541 (mark_stack): Move local variables into the #ifdef region where
15542 they're used.
7bc26fdb
PE
15543 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15544 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15545 needed otherwise.
15546 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15547 (GC_STRING_CHARS): Remove; not used.
d40d4be1 15548 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 15549
e5aab7e7
PE
15550 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15551 avoids undefined behavior in theory.
15552
4da60324
PE
15553 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15554
88043301
PE
15555 Use functions, not macros, for up- and down-casing (Bug#8254).
15556 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15557 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15558 to use the following functions instead of these macros.
15559 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15560 EMACS_INT, since callers assume the returned value fits in int.
15561 (upcase1): Likewise, for UPCASE_TABLE.
15562 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 15563 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 15564 the race-condition problem in the old DOWNCASE.
88043301 15565
19ed5445
PE
15566 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15567 Rename locals to avoid shadowing.
15568 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
15569 (regex_compile, re_search_2, re_match_2_internal):
15570 Remove unused local vars.
952db0d7
PE
15571 (FREE_VAR): Rewrite so as not to use empty "else",
15572 which gcc can warn about.
da053e48 15573 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
15574 (RETALLOC_IF): Define only if needed.
15575 (WORDCHAR_P): Likewise. This one is never needed, but is used
15576 only in a comment talking about a compiler bug, so put inside
15577 the #if 0 of that comment.
15578 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15579 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15580 Remove; unused.
19ed5445 15581
1f3561e4 15582 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
15583 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15584 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 15585
ded6f8f7
PE
15586 * search.c (simple_search): Remove unused var.
15587
dbd37a95
PE
15588 * dired.c (compile_pattern): Move decl from here ...
15589 * lisp.h: ... to here, so that it can be checked.
15590 (struct re_registers): New forward decl.
15591
7e47afad
PE
15592 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15593
85f24f61
PE
15594 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15595 All uses changed.
15596 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15597 Rename locals to avoid shadowing.
5671df8f 15598 (Fvertical_motion): Mark locals as initialized.
85f24f61 15599
181aa2be 15600 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 15601 (casify_region): Mark local as initialized.
181aa2be 15602
930d429c
PE
15603 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15604
7082eac6
PE
15605 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15606 New macros, so that the caller can use some names other than
15607 gcpro1, gcpro2, etc.
15608 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15609 of the new macros.
15610 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15611 argument, for consistency with GCPRO2_VAR, etc: it is now the
15612 prefix of the variable, not the variable itself. All uses
15613 changed.
38b2c076
PE
15614 * dired.c (directory_files_internal, file_name_completion):
15615 Rename locals to avoid shadowing.
15616
15206ed9
PE
15617 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15618 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15619 dired.c's scmp function, had undefined behavior.
15620 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15621 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15622 * buffer.h: ... to here, because these macros use current_buffer,
15623 and the new implementation with inline functions needs to have
15624 current_buffer in scope now, rather than later when the macros
15625 are used.
15626 (downcase, upcase1): New static inline functions.
15627 (DOWNCASE, UPCASE1): Reimplement using these functions.
15628 This avoids undefined behavior in expressions like
15629 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15630 from race conditions in accessing the global variables
15631 case_temp1 and case_temp2.
15632 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15633 * lisp.h (case_temp1, case_temp2): Remove their decls.
15634 * character.h (ASCII_CHAR_P): Move from here ...
15635 * lisp.h: ... to here, so that the inline functions mentioned
15636 above can use them.
15637
4a6bea26
PE
15638 * dired.c (directory_files_internal_unwind): Now static.
15639
f14b7e14
PE
15640 * fileio.c (file_name_as_directory, directory_file_name):
15641 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15642 Now static.
2893f146
PE
15643 (file_name_as_directory): Use const pointers when appropriate.
15644 (Fexpand_file_name): Likewise. In particular, newdir might
15645 point at constant storage, so make it a const pointer.
fd4ead52 15646 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
15647 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15648 signedness issues.
f839df0c
PE
15649 (Fset_file_times, Finsert_file_contents, auto_save_error):
15650 Rename locals to avoid shadowing.
f14b7e14 15651
5716756e 15652 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
15653 (Ftry_completion, Fall_completions): Rename or remove locals
15654 to avoid shadowing.
5716756e 15655
b4c3046a
PE
15656 * marker.c (bytepos_to_charpos): Remove; unused.
15657
b45db522
PE
15658 * lisp.h (verify_bytepos, count_markers): New decls,
15659 so that gcc does not warn that these functions aren't declared.
15660
85876d07
PE
15661 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15662 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 15663 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 15664 (copy_text): Remove unused local var.
85876d07 15665
03d78a21 15666 * filelock.c (within_one_second): Now static.
b3dd38ab 15667 (lock_file_1): Rename local to avoid shadowing.
03d78a21 15668
5df8f01b
PE
15669 * buffer.c (fix_overlays_before): Mark locals as initialized.
15670 (fix_start_end_in_overlays): Likewise. This function should be
15671 simplified by using pointers-to-pointers, but that's a different
15672 matter.
b1d876f1 15673 (switch_to_buffer_1): Now static.
8f54f30a
PE
15674 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15675 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 15676
a70072c9 15677 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 15678 Fix pointer signedness issue.
edced198
PE
15679 (sys_subshell): Mark local as volatile if checking for lint,
15680 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 15681 (MAXPATHLEN): Define only if needed.
a70072c9 15682
a0977c44
PE
15683 * process.c (serial_open, serial_configure): Move decls from here ...
15684 * systty.h: ... to here, so that they can be checked.
15685
a884fdcc
PE
15686 * fns.c (get_random, seed_random): Move extern decls from here ...
15687 * lisp.h: ... to here, so that they can be checked.
15688
604efe86 15689 * sysdep.c (reset_io): Now static.
b8950c94 15690 (wait_for_termination_signal): Remove; unused.
604efe86 15691
38fc62d9
PE
15692 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15693 (copy_keymap_item, append_key, push_text_char_description):
15694 Now static.
1004a21a 15695 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 15696 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
15697 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15698 (describe_map_tree):
15699 Rename locals to avoid shadowing.
38fc62d9 15700
2f2650da
PE
15701 * keyboard.c: Declare functions static if they are not used elsewhere.
15702 (echo_char, echo_dash, cmd_error, top_level_2):
15703 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
15704 (read_char, kbd_buffer_get_event, make_lispy_position):
15705 (make_lispy_event, make_lispy_movement, apply_modifiers):
15706 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15707 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15708 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 15709 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 15710 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 15711
a053e86c 15712 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
15713 (mark_kboards): Move decl here ...
15714 * alloc.c (mark_kboards): ... from here.
a053e86c 15715
4752793e
PE
15716 * lisp.h (force_auto_save_soon): New decl.
15717
74f10ca7 15718 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
15719 (DEFINE_DUMMY_FUNCTION): New macro.
15720 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15721 Use it.
c03cd23f
PE
15722 (main): Add casts to avoid warnings
15723 if GCC considers string literals to be constants.
74f10ca7 15724
022e70d4
PE
15725 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15726
59d6fe83
PE
15727 * dbusbind.c: Pointer signedness fixes.
15728 (xd_signature, xd_append_arg, xd_initialize):
15729 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15730 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15731 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15732 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15733
78320123
PE
15734 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15735 if GCC considers string literals to be constants.
49cebcca 15736 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 15737
35ac2a97
SM
157382011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15739
fb103ca9
SM
15740 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15741 (print_preprocess, print_object): New macro to fix last change.
15742
35ac2a97
SM
15743 * print.c (print_preprocess): Don't forget font objects.
15744
62973b41
JB
157452011-03-16 Juanma Barranquero <lekktu@gmail.com>
15746
15747 * emacs.c (USAGE3): Doc fixes.
15748
0e48bb22
AS
157492011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15750
15751 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15752 structure.
15753
7684e57b
JB
157542011-03-14 Juanma Barranquero <lekktu@gmail.com>
15755
15756 * lisp.h (VWindow_system, Qfile_name_history):
15757 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15758 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15759 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15760
15761 * w32select.c: Don't #include "keyboard.h".
c96bbc66 15762 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
15763
15764 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15765 * w32console.c (detect_input_pending, read_input_pending)
15766 (encode_terminal_code):
15767 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15768 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15769 (w32_system_caret_y, Qfile_name_history):
15770 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15771 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15772 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15773 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15774 * w32proc.c (Qlocal, report_file_error):
15775 * w32term.c (Vwindow_system, updating_frame):
15776 * w32uniscribe.c (initialized, uniscribe_font_driver):
15777 Remove unneeded extern declarations.
15778
2aa46d6c
CY
157792011-03-14 Chong Yidong <cyd@stupidchicken.com>
15780
c96bbc66 15781 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 15782
cffc6f3b
CY
157832011-03-13 Chong Yidong <cyd@stupidchicken.com>
15784
15785 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15786 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15787 These macros can no longer be used for assignment.
15788
44f230aa
SM
15789 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15790 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
15791 (record_buffer_markers, fetch_buffer_markers): New functions for
15792 recording and fetching special buffer markers.
15793 (set_buffer_internal_1, set_buffer_temp): Use them.
15794
15795 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15796
15797 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15798
15799 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15800 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15801
15802 * xdisp.c (hscroll_window_tree):
15803 (reconsider_clip_changes): Use PT instead of BUF_PT.
15804
d251f04b
EZ
158052011-03-13 Eli Zaretskii <eliz@gnu.org>
15806
15807 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15808 $(EMACS_ROOT)/lib/intprops.h.
15809
f0c77cd1
PE
158102011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15811
3eca4629
PE
15812 Fix more problems found by GCC 4.5.2's static checks.
15813
7c86ee98
PE
15814 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15815 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
15816 (xg_free_frame_widgets): Make it clear that a local variable is
15817 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
15818 (gdk_window_get_screen): Make it clear that this macro is needed
15819 only if USE_GTK_TOOLTIP.
1e5524e7
PE
15820 (int_gtk_range_get_value): New function, which avoids a diagnostic
15821 from gcc -Wbad-function-cast.
15822 (xg_set_toolkit_scroll_bar_thumb): Use it.
15823 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15824 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
15825 (get_utf8_string, xg_get_file_with_chooser):
15826 Rename locals to avoid shadowing.
15827 (create_dialog): Move locals to avoid shadowing.
7c86ee98 15828
41729b81
PE
15829 * xgselect.c (xg_select): Remove unused var.
15830
f0c77cd1
PE
15831 * image.c (four_corners_best): Mark locals as initialized.
15832 (gif_load): Initialize transparent_p to zero (Bug#8238).
15833 Mark another local as initialized.
ec6cf4c6 15834 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 15835
ce0ad53d 15836 * image.c (clear_image_cache): Now static.
d5d5a617 15837 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 15838 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
15839 (x_edge_detection): Remove unnecessary cast that
15840 gcc -Wbad-function-cast diagnoses.
2037898d 15841 (gif_load): Fix pointer signedness.
6ae141d6
PE
15842 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15843 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 15844
33383987 158452011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 15846
d32df629
PE
15847 Improve quality of tests for time stamp overflow.
15848 For example, without this patch (encode-time 0 0 0 1 1
15849 1152921504606846976) returns the obviously-bogus value (-948597
15850 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
15851 reports time overflow. See
15852 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
15853 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15854 * editfns.c: Include limits.h and intprops.h.
15855 (TIME_T_MIN, TIME_T_MAX): New macros.
15856 (time_overflow): Move earlier, to before first use.
15857 (hi_time, lo_time): New functions, for an accurate test for
15858 out-of-range times.
15859 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15860 (Fget_internal_run_time): Don't assume time_t fits in int.
15861 (make_time): Use list2 instead of Fcons twice.
15862 (Fdecode_time): More accurate test for out-of-range times.
15863 (check_tm_member): New function.
15864 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
15865 (lisp_time_argument): Don't rely on undefined left-shift and
15866 right-shift behavior when checking for time stamp overflow.
8be6f318 15867
fe31d94c
PE
15868 * editfns.c (time_overflow): New function, refactoring common code.
15869 (Fformat_time_string, Fdecode_time, Fencode_time):
15870 (Fcurrent_time_string): Use it.
15871
8be6f318
PE
15872 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15873 * dired.c (make_time): Move to ...
15874 * editfns.c (make_time): ... here.
15875 * systime.h: Note the move.
15876
09d9db2c 158772011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 15878
126bc0dc
YM
15879 * fringe.c (update_window_fringes): Remove unused variables.
15880
c47cbdfd
YM
15881 * unexmacosx.c (copy_data_segment): Also copy __got section.
15882 (Bug#8223)
15883
7ac80be9
EZ
158842011-03-12 Eli Zaretskii <eliz@gnu.org>
15885
c96bbc66 15886 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
15887 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15888 Constify `char *' arguments and their references according to
15889 prototypes in tparam.h.
15890
ecb0f94d 15891 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 15892
7ac80be9
EZ
15893 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15894 Adapt all references accordingly.
15895
15896 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15897
ef1fd07e
TT
158982011-03-11 Tom Tromey <tromey@redhat.com>
15899
15900 * buffer.c (syms_of_buffer): Remove obsolete comment.
15901
7ef4b50c
EZ
159022011-03-11 Eli Zaretskii <eliz@gnu.org>
15903
15904 * termhooks.h (encode_terminal_code): Declare prototype.
15905
15906 * msdos.c (encode_terminal_code): Don't declare prototype.
15907
15908 * term.c (encode_terminal_code): Now external again, used by
15909 w32console.c and msdos.c.
15910
44f230aa
SM
15911 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
15912 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 15913
4b1ec863 159142011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 15915
1714f52b 15916 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 15917
4b1ec863
PE
15918 * fringe.c (update_window_fringes): Mark locals as initialized
15919 (Bug#8227).
15920 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 15921
524c7aa6
PE
15922 * alloc.c (mark_fringe_data): Move decl from here ...
15923 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
15924 to check its interface.
15925 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
15926
a5c0af81 15927 * fontset.c (free_realized_fontset): Now static.
7519b8cd 15928 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 15929 (fontset_font): Mark local as initialized.
a9a06e0b 15930 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 15931
b4716021
PE
15932 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
15933
811e9bac 15934 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 15935 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
15936 (x_own_selection, Fx_disown_selection_internal): Rename locals
15937 to avoid shadowing.
15938 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 15939
7e3ab302
PE
15940 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
15941 so that the caller can use some name other than gcpro1.
15942 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
15943 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15944 (Fx_backspace_delete_keys_p):
15945 Use them to avoid shadowing, and rename vars to avoid shadowing.
15946 (x_decode_color, x_set_name, x_window): Now static.
6b437900 15947 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 15948 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
15949 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
15950 Remove unused locals.
7e3ab302
PE
15951 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
15952 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
15953 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
15954 macros.
f78faa98 15955
e2b13473
PE
15956 * xterm.h (x_mouse_leave): New decl.
15957
77f23912
PE
15958 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
15959 Remove unused functions.
cdf4ba58
PE
15960 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
15961 (x_calc_absolute_position): Now static.
7411c686 15962 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 15963 Don't declare local "event" unless it's used.
ed7bf3a5
PE
15964 (x_iconify_frame, x_free_frame_resources): Don't declare locals
15965 unless they are used.
38d0b34a
PE
15966 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
15967 (x_fatal_error_signal): Remove; not used.
a6067996
PE
15968 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
15969 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
15970 (x_error_catcher, x_connection_closed, x_error_handler):
15971 (x_error_quitter, xembed_send_message, x_iconify_frame):
15972 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 15973 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 15974 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 15975
44f230aa
SM
15976 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
15977 Rename or move locals to avoid shadowing.
6b463e58 15978 (tty_defined_color, merge_face_heights): Now static.
5967d051 15979 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
15980 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
15981 does not deduce is never used uninitialized.
73719eba
PE
15982 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
15983 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 15984
426994c3 15985 * terminal.c (store_terminal_param): Now static.
5489860b 15986
032f1620 15987 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 15988 (set_frame_menubar): Remove unused local.
d4323972 15989 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
15990 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
15991 since they might point to immutable storage.
281585b0
PE
15992 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
15993 since it's unused otherwise.
032f1620 15994
367c19e5 15995 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 15996 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
15997 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
15998 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 15999 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
16000 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16001 does not deduce are never used uninitialized.
70739cbe 16002
07b48fa9
PE
16003 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16004
8868a238 16005 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
16006 * window.c (window_loop, size_window):
16007 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 16008
7e5cf297 16009 * window.c (display_buffer): Now static.
d6550a9f
PE
16010 (size_window): Mark variables that gcc -Wuninitialized
16011 does not deduce are never used uninitialized.
a586633d
PE
16012 * window.h (check_all_windows): New decl, to forestall
16013 gcc -Wmissing-prototypes diagnostic.
5b555da1 16014 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 16015
f6095868
PE
16016 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16017 shadowing.
16018 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
16019 Include <limits.h>.
16020 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16021 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
16022 (load_charset_map): Mark variables that gcc -Wuninitialized
16023 does not deduce are never used uninitialized.
53df7c11 16024 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 16025
f38b440c
PE
16026 * coding.c (coding_set_source, coding_set_destination):
16027 Use "else { /* comment */ }" rather than "else /* comment */;"
16028 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
16029 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16030 a block, when the outer 'i' will do.
16031 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16032 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16033 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16034 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16035 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16036 Rename locals to avoid shadowing.
16037 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
16038 * coding.c (emacs_mule_char, encode_invocation_designation):
16039 Now static, since they're not used elsewhere.
413bb2db 16040 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 16041 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
16042 (decode_coding_emacs_mule): Mark variables that gcc
16043 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
16044 (detect_coding_iso_2022): Initialize a local variable that might
16045 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 16046 this initialization is needed. (Bug#8211)
5f58e762
PE
16047 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16048 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16049 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16050 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16051 Remove unused macros.
f38b440c 16052
232b38b9 16053 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 16054 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 16055 * character.c (string_count_byte8): Likewise.
232b38b9 16056
fb90da1b
PE
16057 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16058 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16059
fb93dbc2
PE
16060 * chartab.c (copy_sub_char_table): Now static, since it's not used
16061 elsewhere.
5c156ace
PE
16062 (sub_char_table_ref_and_range, char_table_ref_and_range):
16063 Rename locals to avoid shadowing.
bbcd0949 16064 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 16065
7d3b3862 16066 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 16067 (BIDI_BOB): Remove unused macro.
7d3b3862 16068
6be7d3da
PE
16069 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16070 deduce are never used uninitialized.
c2ed9c8b 16071 * term.c (encode_terminal_code): Likewise.
6be7d3da 16072
75f8807f 16073 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 16074
50938595
PE
16075 * tparam.h: New file.
16076 * term.c, tparam.h: Include it.
16077 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16078 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16079 Move these decls to tparam.h, and make them agree with what
16080 is actually in tparam.c. The previous trick of using incompatible
16081 decls in different modules does not conform to the C standard.
16082 All callers of tparam changed to use tparam's actual API.
16083 * tparam.c (tparam1, tparam, tgoto):
16084 Use const pointers where appropriate.
16085
fbceeba2
PE
16086 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16087 * cm.h (struct cm): Likewise.
16088 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16089 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16090 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16091 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16092 (turn_on_face, init_tty): Likewise.
16093 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 16094
7f3f1250
PE
16095 * term.c (term_mouse_position): Rename local to avoid shadowing.
16096
e6ca6543
PE
16097 * alloc.c (mark_ttys): Move decl from here ...
16098 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16099
c40f8d15
AS
161002011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16101
16102 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16103
cfe0661d
JB
161042011-03-09 Juanma Barranquero <lekktu@gmail.com>
16105
16106 * search.c (compile_pattern_1): Remove argument regp, unused since
16107 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16108 (compile_pattern): Don't pass it.
16109
0afb4571
J
161102011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16111
16112 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16113 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16114 for ! HAVE_GTK3.
16115 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16116
16117 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16118
16119 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16120 gdk_window_get_screen, gdk_window_get_geometry,
16121 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16122 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16123 (xg_get_pixbuf_from_pixmap): New function.
16124 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16125 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16126 Call xg_get_pixbuf_from_pixmap instead of
16127 gdk_pixbuf_get_from_drawable.
16128 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16129 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16130 (xg_check_special_colors): Use GtkStyleContext and its functions
16131 for HAVE_GTK3.
16132 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16133 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16134 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
16135 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16136 Call gtk_widget_get_preferred_size.
0afb4571
J
16137 (xg_frame_resized): gdk_window_get_geometry only takes 5
16138 parameters.
44f230aa
SM
16139 (xg_win_to_widget, xg_event_is_for_menubar):
16140 Call gdk_x11_window_lookup_for_display.
0afb4571
J
16141 (xg_set_widget_bg): New function.
16142 (delete_cb): New function.
895009e1 16143 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 16144 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
16145 (xg_set_background_color): Call xg_set_widget_bg.
16146 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16147 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16148 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16149 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16150 if ! HAVE_GTK3.
16151 (update_frame_tool_bar): Call gtk_widget_hide.
16152 (xg_initialize): Use GDK_KEY_g.
16153
16154 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16155 if ! HAVE_GTK3
16156 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16157
16158 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16159 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16160 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16161
1c2cc4ef
JB
161622011-03-08 Juanma Barranquero <lekktu@gmail.com>
16163
16164 * w32xfns.c (select_palette): Check success of RealizePalette against
16165 GDI_ERROR, not zero.
16166
33383987 16167See ChangeLog.11 for earlier changes.
aac0c6e3
MR
16168
16169;; Local Variables:
16170;; coding: utf-8
aac0c6e3
MR
16171;; End:
16172
2f097256 16173 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
16174
16175 This file is part of GNU Emacs.
16176
16177 GNU Emacs is free software: you can redistribute it and/or modify
16178 it under the terms of the GNU General Public License as published by
16179 the Free Software Foundation, either version 3 of the License, or
16180 (at your option) any later version.
16181
16182 GNU Emacs is distributed in the hope that it will be useful,
16183 but WITHOUT ANY WARRANTY; without even the implied warranty of
16184 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16185 GNU General Public License for more details.
16186
16187 You should have received a copy of the GNU General Public License
16188 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.