In Fset_window_configuration install revison of reverted fix.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
457294dd
MR
12012-08-28 Martin Rudalics <rudalics@gmx.at>
2
3 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
4 auto-buffer-name window parameter. Install revision of reverted
5 fix.
457294dd 6
4f2daf31
DA
72012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
8
9 Do not allow to set major mode for a dead buffer.
10 * buffer.c (Fset_buffer_major_mode): Signal an error
11 if the buffer is dead.
12 (Fother_buffer, other_buffer_safely): Remove redundant
13 nested declaration.
14
66322887
DA
152012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
16
17 Always use set_buffer_if_live to restore original buffer at unwind.
18 * buffer.h (record_unwind_current_buffer): New function.
19 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
20 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
21 * undo.c, window.c: Adjust users.
22 * buffer.c (set_buffer_if_live): Fix comment.
23
a3d794a1
DA
242012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
25
26 Fix usage of set_buffer_internal.
27 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
28 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
29 * coding.c (decode_coding): Omit redundant test.
30 * fileio.c (decide_coding_unwind): Likewise.
31 * fns.c (secure_hash): Likewise.
32 * insdel.c (modify_region): Likewise.
33 * keyboard.c (command_loop_1): Likewise.
34 * print.c (PRINTFINISH): Likewise.
35 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
36
59ea14cd
PE
372012-08-27 Paul Eggert <eggert@cs.ucla.edu>
38
39 * dispnew.c: Use bool for boolean.
40 (frame_garbaged, display_completed, delayed_size_change)
41 (fonts_changed_p, add_window_display_history)
42 (add_frame_display_history, verify_row_hash)
43 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
44 (row_equal_p, realloc_glyph_pool)
45 (allocate_matrices_for_frame_redisplay)
46 (showing_window_margins_p)
47 (adjust_frame_glyphs_for_frame_redisplay)
48 (build_frame_matrix_from_leaf_window, make_current)
49 (mirrored_line_dance, mirror_line_dance, update_frame)
50 (update_window_tree, update_single_window)
51 (check_current_matrix_flags, update_window, update_text_area)
52 (update_window_line, set_window_update_flags, scrolling_window)
53 (update_frame_1, scrolling, buffer_posn_from_coords)
54 (do_pending_window_change, change_frame_size)
55 (change_frame_size_1, sit_for):
56 Use bool for boolean.
57 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
58 and remove last int (actually boolean) argument, which was always 0.
59 All callers changed.
60 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
61 * dispextern.h (struct composition_it): Use bool for boolean.
62 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
63 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
64 * dired.c (file_name_completion):
65 Use bool for boolean. (This was missed in an earlier change.)
66
95072a94
MR
672012-08-27 Martin Rudalics <rudalics@gmx.at>
68
69 * window.c (Fset_window_configuration): Revert first part of
70 last change.
71
0f19feff
JD
722012-08-27 Jan Djärv <jan.h.d@swipnet.se>
73
74 * nsterm.h (NSPanel): New class variable dialog_return.
75
76 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
77 dialog_return.
78 (windowShouldClose:): Use stop instead of stopModalWithCode.
79 (clicked:): Ditto, and also set dialog_return (Bug#12258).
80 (timeout_handler:): Use stop instead of abortModal. Send a dummy
81 event.
82 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
83 modal loop returns.
84
f10fe38f
PE
852012-08-27 Paul Eggert <eggert@cs.ucla.edu>
86
de1339b0
PE
87 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
88 * composite.c (find_composition, composition_gstring_p)
89 (composition_reseat_it, find_automatic_composition):
90 * data.c (let_shadows_buffer_binding_p)
91 (let_shadows_global_binding_p, set_internal, make_blv)
92 (Fmake_variable_buffer_local, Fmake_local_variable)
93 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
94 (cons_to_signed, arith_driver):
95 * dbusbind.c (xd_in_read_queued_messages):
96 * dired.c (directory_files_internal, file_name_completion):
97 Use bool for booleans.
98 * dired.c (file_name_completion):
99 * process.h (fd_callback):
100 Omit int (actually boolean) argument. It wasn't being used.
101 All uses changed.
102 * composite.h, lisp.h: Reflect above API changes.
103
f10fe38f
PE
104 * cmds.c, coding.c: Use bool for booleans.
105 * cmds.c (move_point, Fself_insert_command):
106 * coding.h (struct composition status, struct coding_system):
107 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
108 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
109 (emacs_mule_char, decode_coding_emacs_mule)
110 (encode_coding_emacs_mule, detect_coding_iso_2022)
111 (decode_coding_iso_2022, encode_invocation_designation)
112 (encode_designation_at_bol, encode_coding_iso_2022)
113 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
114 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
115 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
116 (encode_coding_raw_text, detect_coding_charset)
117 (decode_coding_charset, encode_coding_charset, detect_eol)
118 (detect_coding, get_translation_table, produce_chars)
119 (consume_chars, reused_workbuf_in_use)
120 (make_conversion_work_buffer, code_conversion_save)
121 (decode_coding_object, encode_coding_object)
122 (detect_coding_system, char_encodable_p)
123 (Funencodable_char_position, code_convert_region)
124 (code_convert_string, code_convert_string_norecord)
125 (Fset_coding_system_priority):
126 * fileio.c (Finsert_file_contents):
127 Use bool for booleans.
128 * coding.h, lisp.h: Reflect above API changes.
129 * coding.c: Remove unnecessary static function decls.
130 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
131 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
132 not a boolean 'int', since callers never look at the return value.
133 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
134 * coding.h (decoding_buffer_size, encoding_buffer_size)
135 (emacs_mule_string_char): Remove unused extern decls.
136 (struct iso_2022_spec, struct coding_system):
137 Use 'unsigned int : 1' for boolean fields, since there's more than one.
138 (struct emacs_mule_spec): Remove unused field 'full_support'.
139 All initializations removed.
140 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
141
5474c384
DA
1422012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
143
f10fe38f 144 Fix spare memory change (Bug#12286).
5474c384
DA
145 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
146 (valid_lisp_object_p): Likewise.
147
c4b6914d
MR
1482012-08-27 Martin Rudalics <rudalics@gmx.at>
149
150 * window.c (Fset_window_configuration): Record any window's old
151 buffer if it's replaced (see Bug#8789). If the new current
152 buffer doesn't appear in the selected window, go to its old
153 point (Bug#12208).
154
35aaa1ea
DA
1552012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
156
157 Special MEM_TYPE_SPARE to denote reserved memory.
158 * alloc.c (enum mem_type): New memory type.
159 (refill_memory_reserve): Use new type for spare memory.
160 This prevents live_cons_p and live_string_p from incorrect
161 detection of uninitialized objects from spare memory as live.
162
6af64513
PE
1632012-08-26 Paul Eggert <eggert@cs.ucla.edu>
164
8b2e00a3
PE
165 Spelling fixes.
166 * Makefile.in (.PHONY): versioclean -> versionclean.
167
b52d6985
PE
168 Remove unused external symbols.
169 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
170 * window.c (Qwindow_valid_p, decode_valid_window):
171 Now static, not extern.
172 * data.c (Qinterval): Remove; unused.
173 (syms_of_data): Do not define 'interval'.
174 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
175 * window.h (decode_valid_window):
176 Remove decls.
177
d5172d4f
PE
178 * character.c, charset.c, chartab.c: Use bool for booleans.
179 * character.c (lisp_string_width, string_count_byte8)
180 (string_escape_byte8):
181 * charset.c (charset_map_loaded, load_charset_map, read_hex):
182 (load_charset_map_from_file, map_charset_chars)
183 (Fdefine_charset_internal, define_charset_internal)
184 (Fdeclare_equiv_charset, find_charsets_in_text)
185 (Ffind_charset_region, char_charset, Fiso_charset):
186 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
187 (sub_char_table_set, sub_char_table_set_range)
188 (char_table_set_range, optimize_sub_char_table)
189 (map_sub_char_table):
190 Use bool for boolean.
191 * character.c (str_to_unibyte): Omit last boolean argument; it was
192 always 0. All callers changed.
193 * character.h, charset.h: Adjust to match previous changes.
194 * character.h (char_printable_p): Remove decl of nonexistent function.
195 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
196 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
197 are all boolean, so make them single-bit bitfields.
198
6af64513
PE
199 * lisp.h (ASET): Remove attempt to detect side effects.
200 It was meant to be temporary and it often doesn't work,
201 because when IDX has side effects the behavior of IDX==IDX
202 is undefined. See Stefan Monnier in
203 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
204
e1f29348
BR
2052012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
206
207 * lisp.h (functionp): New function (extracted from Ffunctionp).
208 (FUNCTIONP): Use it.
209 * eval.c (Ffunctionp): Use it.
210
17c05d74
PE
2112012-08-25 Paul Eggert <eggert@cs.ucla.edu>
212
0f46bc75
PE
213 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
214 as that's faster and simpler than static storage. Don't bother
215 with the g_main_context_query overhead if g_main_context_pending
216 says no events are pending.
217 (gfds, gfds_size): Remove these static vars.
218 (xgselect_initialize): Remove; no longer needed.
219 All uses and decls removed.
220
ee4c0f69
PE
221 * emacs.c (fatal_error_signal_hook): Remove.
222 All uses removed. This leftover from old code was always 0.
223
17c05d74
PE
224 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
225 * casefiddle.c (casify_object, casify_region):
226 * casetab.c (set_case_table):
227 * category.c, category.h (word_boundary_p):
228 * category.h (CHAR_HAS_CATEGORY):
229 Use bool for booleans, instead of int.
230
391ceac5
EZ
2312012-08-25 Eli Zaretskii <eliz@gnu.org>
232
233 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
234
2f221583
PE
2352012-08-25 Paul Eggert <eggert@cs.ucla.edu>
236
f4a681b0
PE
237 On assertion failure, print backtrace if available.
238 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
239 (die) [ENABLE_CHECKING]: Print a backtrace if available.
240 * Makefile.in (LIB_EXECINFO): New macro.
241 (LIBES): Use it.
242
2f221583
PE
243 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
244 * bytecode.c (exec_byte_code):
245 * callint.c (check_mark, Fcall_interactively):
246 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
247 (getenv_internal, sync_process_alive, call_process_exited):
248 * lisp.h (USE_SAFE_ALLOCA):
249 Use bool for booleans, instead of int.
250 * lisp.h, process.h: Adjust prototypes to match above changes.
251 * callint.c (Fcall_interactively): Don't assume the mark's
252 offset fits in 'int'.
253
37ef52bb
PE
2542012-08-24 Paul Eggert <eggert@cs.ucla.edu>
255
256 * buffer.c, buffer.h: Use bool for boolean.
257 * buffer.c (reset_buffer_local_variables)
258 (buffer_lisp_local_variables, Fset_buffer_modified_p)
259 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
260 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
261 (overlay_touches_p, overlay_strings, Foverlay_put)
262 (report_overlay_modification, call_overlay_mod_hooks):
263 (mmap_enlarge, mmap_set_vars):
264 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
265 Use bool for booleans, instead of int.
266 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
267 since the 1-or-0 return value is always ignored anyway.
268 (mmap_initialized_p):
269 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
270 * buffer.h, lisp.h: Adjust prototypes to match above changes.
271
2cc21167
PE
2722012-08-23 Paul Eggert <eggert@cs.ucla.edu>
273
274 * bidi.c: Use bool for boolean.
275 This is a bit more readable, and makes the text segment of bidi.o
276 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
277 Presumably it's faster too.
278 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
279 Now bool.
280 (bidi_cache_find_level_change, bidi_cache_iterator_state)
281 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
282 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
283 (bidi_explicit_dir_char, bidi_level_of_next_char)
284 (bidi_find_other_level_edge, bidi_move_to_visually_next):
285 Use bool for booleans, instead of int.
286 * dispextern.h (bidi_init_it, bidi_paragraph_init)
287 (bidi_unshelve_cache): Adjust decls to match code.
288
7db4ddf4
MR
2892012-08-23 Martin Rudalics <rudalics@gmx.at>
290
291 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
292 argument.
293
b1bb8011
PE
2942012-08-23 Paul Eggert <eggert@cs.ucla.edu>
295
296 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
297 * atimer.h: Include <stdbool.h>.
298
ff687885
DN
2992012-08-22 Dan Nicolaescu <dann@gnu.org>
300
301 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
302 compile time tests instead of run time tests on systems that do
303 not use them.
304 (FRAME_MAC_P): Remove leftover from deleted code.
305 * frame.c (syms_of_frame): Remove leftover from deleted code.
306
4ce7a138
JD
3072012-08-22 Jan Djärv <jan.h.d@swipnet.se>
308
309 * nsterm.m (insertText:): Don't clear modifiers if code is space.
310
d733ec6d
PE
3112012-08-22 Paul Eggert <eggert@cs.ucla.edu>
312
313 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
314 Otherwise, the compiler complains about (A?B:C) where B is void
315 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
316 (fontset_add): Return void, for FONTSET_ADD.
317
d0d2d26f
PE
3182012-08-21 Paul Eggert <eggert@cs.ucla.edu>
319
fce31d69
PE
320 * alloc.c: Use bool for booleans.
321 (gc_in_progress, abort_on_gc)
322 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
323 (dont_register_blocks) [GC_MALLOC_CHECK]:
324 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
325 (check_string_bytes, make_specified_string, memory_full)
326 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
327 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
328 (mark_stack, valid_pointer_p, make_pure_string)
329 (Fgarbage_collect, survives_gc_p, gc_sweep):
330 Use bool for booleans, instead of int.
331 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
332 Remove unused local.
333 * alloc.c (PURE_POINTER_P):
334 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
335 * editfns.c (Fformat):
336 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
337 (Fdo_auto_save):
338 * fns.c (sweep_weak_table):
339 * lisp.h (suppress_checking, push_message, survives_gc_p)
340 (make_pure_string, gc_in_progress, abort_on_gc):
341 * lread.c (readchar, read1):
342 * print.c (Fprin1_to_string):
343 * xdisp.c (push_message):
344 Use bool for booleans affected directly or indirectly by
345 alloc.c's changes.
346
d0d2d26f
PE
347 Make recently-introduced setters macros.
348 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
349 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
350 (set_fontset_default, set_fontset_fallback): Rename from their
351 upper-case counterparts, and make them functions rather than macros.
352 This is more consistent with the other recently-introduced setters.
353 These don't need to be inline, since they're local.
354
d18e2bb6
JD
3552012-08-21 Jan Djärv <jan.h.d@swipnet.se>
356
357 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
358 the loop (Bug#12247).
359
1b9d9d16
PE
3602012-08-21 Paul Eggert <eggert@cs.ucla.edu>
361
362 * lisp.h (vcopy): Use memcpy rather than our own loop.
363 This fixes a performance regression introduced by the recent
364 addition of vcopy. This means 'vcopy' will need to be modified
365 for a copying collector, but that's OK. Also, tighten the
366 checking in the assertion.
367
b2f09701
EZ
3682012-08-21 Eli Zaretskii <eliz@gnu.org>
369
370 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
371 components for RTL text (Bug#11860). Adjust X-OFFSET of each
372 non-base glyph for the width of the base character, according to
e1f29348
BR
373 what x_draw_composite_glyph_string_foreground expects.
374 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
375 expectations, to produce correct width of the composed character.
376 Reverse the sign of the DU offset produced by ScriptPlace.
377
9b994fed
PE
3782012-08-21 Paul Eggert <eggert@cs.ucla.edu>
379
380 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
381
086ca913
DA
3822012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
383
384 Avoid direct writes to contents member of struct Lisp_Vector.
385 * lisp.h (vcopy): New function to copy data into vector.
386 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
387 * fns.c (Ffillarray): Use ASET.
388 * keyboard.c (timer_check_2): Use AREF and ASET.
389 (append_tool_bar_item, Frecent_keys): Use vcopy.
390 * lread.c (read_vector): Use ASET.
391 * msdos.c (Frecent_doskeys): Use vcopy.
392 * xface.c (Finternal_copy_lisp_face): Use vcopy.
393 (Finternal_merge_in_global_face): Use ASET and vcopy.
394 * xfont.c (xfont_list_pattern): Likewise.
395
5481664a
MR
3962012-08-21 Martin Rudalics <rudalics@gmx.at>
397
398 * window.c (Fwindow_point): For the selected window always return
399 the position of its buffer's point.
400 (Fset_window_point): For the selected window always go in its
401 buffer to the specified position.
402
6d470bdd
DA
4032012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
404
405 Setter macros for fontsets.
406 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
407 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
408 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
409 Adjust users.
410
24564fe1
GM
4112012-08-20 Glenn Morris <rgm@gnu.org>
412
413 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
414 Don't assume that `ln -f' works.
415
0a05a035
EZ
4162012-08-20 Eli Zaretskii <eliz@gnu.org>
417
418 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
419 and later about non-assignments with no effect. See discussion at
420 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
421 details.
422
e46f2325
DA
4232012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
424
425 Inline setter functions for Lisp_Objects slots of struct specbinding.
426 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
427 Adjust users.
428
734fbd86
MR
4292012-08-20 Martin Rudalics <rudalics@gmx.at>
430
431 * window.c (select_window): Always make selected window's buffer
432 current.
433
f1a95992
DA
4342012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
435
436 Use AREF and ASET for docstrings of category tables.
437 * category.h (CATEGORY_DOCSTRING): Use AREF.
438 (SET_CATEGORY_DOCSTRING): Use ASET.
439 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
440
e83064be
DA
4412012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
442
443 Inline setter functions for hash table members.
444 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
445 (set_hash_hash, set_hash_index): Rename with _slot suffix.
446 (set_hash_key_and_value, set_hash_index, set_hash_next)
447 (set_hash_hash): New functions.
448 * charset.c, fns.c: Adjust users.
449
4ce60d2e
DA
4502012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
451
452 Inline getter and setter functions for per-buffer values.
453 * buffer.h (per_buffer_default, set_per_buffer_default)
454 (per_buffer_value, set_per_buffer_value): New functions.
455 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
456 * buffer.c, data.c: Adjust users.
457
c06c9690
JB
4582012-08-20 Juanma Barranquero <lekktu@gmail.com>
459
460 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
461
32bd4250
PE
4622012-08-19 Paul Eggert <eggert@cs.ucla.edu>
463
bad03192 464 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
465 as gnulib does this if the system doesn't.
466 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
467 Remove declaration. MS-Windows declares it on stdlib.h which is
468 included by conf_post.h.
b69a6d22
PE
469 * emacs.c (environ) [DOUG_LEA_MALLOC]:
470 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
471 * vm-limit.c: Include <unistd.h>, for 'environ'.
472
22d7feb2
PE
473 * unexaix.c, unexcoff.c: Include "mem-limits.h".
474 (start_of_data): Remove decl; mem-limits.h provides it.
475
32bd4250
PE
476 * xdisp.c (handle_invisible_prop): Make it a bit faster
477 and avoid a gcc -Wmaybe-uninitialized diagnostic.
478
450809af
CY
4792012-08-19 Chong Yidong <cyd@gnu.org>
480
481 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
482 ends (Bug#3874).
483
9e677988
AS
4842012-08-19 Andreas Schwab <schwab@linux-m68k.org>
485
6b1319ce
AS
486 * .gdbinit: Use call instead of set when calling a function in the
487 inferior.
488
9e677988
AS
489 * data.c (set_internal): Don't use set_blv_found.
490 (Fkill_local_variable): Likewise.
491
d7191076
AA
4922012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
493
494 * nsfont.m (ns_ascii_average_width): Ensure the string
495 ascii_printable is initialized with a null-terminated character
496 array. Otherwise, it can contain undesired extra characters.
497
e757f1c6
PE
4982012-08-18 Paul Eggert <eggert@cs.ucla.edu>
499
500 port new setting code to Sun C 5.8 2005/10/13
501 * chartab.c, lisp.h (char_table_set, char_table_set_range):
502 Return void, not Lisp_Object. Otherwise, the compiler
503 complains about (A?B:C) where B is void and C is Lisp_Object
504 when compiling CHAR_TABLE_SET, due to the recent change to
505 the API of sub_char_table_set_contents.
506
a999ce26
CY
5072012-08-18 Chong Yidong <cyd@gnu.org>
508
509 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
510 for the string case (Bug#3874).
511
3f22b86f
PE
5122012-08-18 Paul Eggert <eggert@cs.ucla.edu>
513
39eb03f1
PE
514 * buffer.h (BSET): Remove (Bug#12215).
515 Replace all uses with calls to new setter functions.
516 (bset_bidi_paragraph_direction, bset_case_canon_table)
517 (bset_case_eqv_table, bset_directory, bset_display_count)
518 (bset_display_time, bset_downcase_table)
519 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
520 (bset_last_selected_window, bset_local_var_alist)
521 (bset_mark_active, bset_point_before_scroll, bset_read_only)
522 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
523 (bset_width_table):
524 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
525 (bset_auto_fill_function, bset_auto_save_file_format)
526 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
527 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
528 (bset_cache_long_line_scans, bset_case_fold_search)
529 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
530 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
531 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
532 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
533 (bset_header_line_format, bset_indicate_buffer_boundaries)
534 (bset_indicate_empty_lines, bset_invisibility_spec)
535 (bset_left_fringe_width, bset_major_mode, bset_mark)
536 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
537 (bset_name, bset_overwrite_mode, bset_pt_marker)
538 (bset_right_fringe_width, bset_save_length)
539 (bset_scroll_bar_width, bset_scroll_down_aggressively)
540 (bset_scroll_up_aggressively, bset_selective_display)
541 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
542 (bset_word_wrap, bset_zv_marker):
543 * category.c (bset_category_table):
544 * syntax.c (bset_syntax_table):
545 New setter functions.
546
6a09a33b
PE
547 * process.h (PSET): Remove (Bug#12215).
548 Replace all uses with calls to new setter functions.
549 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
550 (PROCESS_INLINE): New macro.
551 (pset_childp): New setter function.
552 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
553 * process.c (PROCESS_INLINE):
554 Define to EXTERN_INLINE, so that the corresponding functions
555 are compiled into code.
556 (pset_buffer, pset_command, pset_decode_coding_system)
557 (pset_decoding_buf, pset_encode_coding_system)
558 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
559 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
560 (pset_type, pset_write_queue): New setter functions.
561
e8c17b81
PE
562 * window.h (WSET): Remove (Bug#12215).
563 Replace all uses with calls to new setter functions.
564 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
565 (WINDOW_INLINE): New macro.
566 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
567 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
568 (wset_total_lines, wset_vertical_scroll_bar)
569 (wset_window_end_pos, wset_window_end_valid)
570 (wset_window_end_vpos): New setter functions.
571 * window.c (WINDOW_INLINE):
572 Define to EXTERN_INLINE, so that the corresponding functions
573 are compiled into code.
574 (wset_combination_limit, wset_dedicated, wset_display_table)
575 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
576 (wset_new_normal, wset_new_total, wset_next_buffers)
577 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
578 (wset_prev_buffers, wset_right_fringe_width)
579 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
580 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
581 (wset_window_parameters):
582 * xdisp.c (wset_base_line_number, wset_base_line_pos)
583 (wset_column_number_displayed, wset_region_showing):
584 New setter functions.
585
3f22b86f
PE
586 * termhooks.h (TSET): Remove (Bug#12215).
587 Replace all uses with calls to new setter functions.
588 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
589 (TERMHOOKS_INLINE): New macro.
590 (tset_charset_list, tset_selection_alist): New setter functions.
591 * terminal.c (TERMHOOKS_INLINE):
592 Define to EXTERN_INLINE, so that the corresponding functions
593 are compiled into code.
594 (tset_param_alist): New setter function.
595
742af32f
PE
5962012-08-17 Paul Eggert <eggert@cs.ucla.edu>
597
15dbb4d6
PE
598 * keyboard.h (KSET): Remove (Bug#12215).
599 Replace all uses with calls to new setter functions.
600 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
601 (KEYBOARD_INLINE): New macro.
602 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
603 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
604 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
605 New setter functions.
606 * keyboard.c (KEYBOARD_INLINE):
607 Define to EXTERN_INLINE, so that the corresponding functions
608 are compiled into code.
609 (kset_echo_string, kset_kbd_queue)
610 (kset_keyboard_translate_table, kset_last_prefix_arg)
611 (kset_last_repeatable_command, kset_local_function_key_map)
612 (kset_overriding_terminal_local_map, kset_real_last_command)
613 (kset_system_key_syms): New setter functions.
614
f00af5b1
PE
615 * frame.h (FSET): Remove (Bug#12215).
616 Replace all uses with calls to new setter functions.
617 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
618 (FRAME_INLINE): New macro.
619 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
620 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
621 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
622 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
623 (fset_param_alist, fset_root_window, fset_scroll_bars)
624 (fset_selected_window, fset_title, fset_tool_bar_items)
625 (fset_tool_bar_position, fset_tool_bar_window): New functions.
626 * frame.c (FRAME_INLINE):
627 Define to EXTERN_INLINE, so that the corresponding functions
628 are compiled into code.
629 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
630
0c94c8d6
PE
631 A few more naming-convention fixes for getters and setters.
632 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
633 and rename from buffer_overlays_set_before.
634 (set_buffer_overlays_after): Move here from buffer.h, and rename
635 from buffer_overlays_set_after.
636 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
637 All uses changed.
638 (set_buffer_intervals): Rename from buffer_set_intervals.
639 * intervals.c (set_interval_object): Move here from intervals.h,
640 and rename from interval_set_object.
641 (set_interval_left): Move here from intervals.h, and rename from
642 interval_set_left.
643 (set_interval_right): Move here from intervals.h, and rename from
644 interval_set_right.
645 (copy_interval_parent): Move here from intervals.h, and rename from
646 interval_copy_parent.
647 * intervals.h (set_interval_parent): Rename from interval_set_parent.
648 (set_interval_plist): Rename from interval_set_plist.
649 Return void, not Lisp_Object, since no caller uses the result.
650 * lisp.h (string_intervals): Rename from string_get_intervals.
651 (set_string_intervals): Rename from string_set_intervals.
652
34dabdb7
PE
653 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
654 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 655 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
656 All uses changed. See the end of
657 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
658
742af32f
PE
659 * lisp.h (CSET): Remove (Bug#12215).
660 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
661 (set_char_table_purpose): New functions,
662 replacing CSET. All uses changed. For example, replace
663 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 664 "set_char_table_parent (char_table, parent);".
742af32f
PE
665 The old version was confusing because it used the same name
666 'parent' for two different things.
667
a04e2c62
DA
6682012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
669
670 Functions to get and set Lisp_Object fields of buffer-local variables.
671 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
672 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
673 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
674 * data.c, eval.c, frame.c: Adjust users.
675
383dcbf9
CY
6762012-08-17 Chong Yidong <cyd@gnu.org>
677
678 * xfaces.c (merge_face_vectors): If the target font specfies a
679 font spec, make the font's attributes take precedence over
680 directly-specified attributes.
681 (merge_face_ref): Recognize :font.
682
44386687
DA
6832012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
684
685 Do not use memcpy for copying intervals.
686 * intervals.c (reproduce_interval): New function.
687 (reproduce_tree, reproduce_tree_obj): Use it.
688 (reproduce_tree_obj): Remove prototype.
689
927c7216
PE
6902012-08-17 Paul Eggert <eggert@cs.ucla.edu>
691
692 * lisp.h (duration_to_sec_usec): Remove unused decl.
693
93044f7b
AA
6942012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
695
696 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
697 to an allocated instance of NSString, not to the class itself.
698
9851e4a5
JB
6992012-08-17 Juanma Barranquero <lekktu@gmail.com>
700
701 * makefile.w32-in (C_CTYPE_H): New macro.
702 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
703 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
704 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
705
620f13b0
PE
7062012-08-16 Paul Eggert <eggert@cs.ucla.edu>
707
708 Use ASCII tests for character types.
709 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
710 * xfns.c, xterm.c:
711 Don't include <ctype.h>; was not needed.
712 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
713 * sysdep.c, xfaces.c:
714 Include <c-ctype.h> instead of <ctype.h>.
715 * nsterm.m: Include <c-ctype.h>.
716 * charset.c (read_hex):
717 * doc.c (Fsnarf_documentation):
718 * fileio.c (IS_DRIVE) [WINDOWSNT]:
719 (DRIVE_LETTER) [DOS_NT]:
720 (Ffile_name_directory, Fexpand_file_name)
721 (Fsubstitute_in_file_name):
722 * font.c (font_parse_xlfd, font_parse_fcname):
723 * frame.c (x_set_font_backend):
724 * gtkutil.c (xg_get_font):
725 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
726 * nsimage.m (hexchar):
727 * nsterm.m (ns_xlfd_to_fontname):
728 * sysdep.c (system_process_attributes):
729 * xfaces.c (hash_string_case_insensitive):
730 Use C-locale tests instead of locale-specific tests for character
731 types, since we want the ASCII interpretation here, not the
732 interpretation suitable for whatever happens to be the current locale.
733
52162052
MR
7342012-08-16 Martin Rudalics <rudalics@gmx.at>
735
736 Consistently check windows for validity/liveness
737 (Bug#11984, Bug#12025, Bug#12026).
738 * lisp.h (CHECK_VALID_WINDOW): New macro.
739 * window.c (decode_window): Rename to decode_live_window.
740 (decode_valid_window, Fwindow_valid_p): New functions.
741 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
742 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
743 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
744 (Fwindow_prev_sibling, Fwindow_combination_limit)
745 (Fset_window_combination_limit, Fwindow_use_time)
746 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
747 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
748 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
749 (Fwindow_hscroll, Fset_window_hscroll)
750 (Fwindow_redisplay_end_trigger)
751 (Fset_window_redisplay_end_trigger, Fwindow_edges)
752 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
753 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
754 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
755 (Fwindow_end, Fset_window_point, Fset_window_start)
756 (Fpos_visible_in_window_p, Fwindow_line_height)
757 (Fwindow_dedicated_p, Fset_window_dedicated_p)
758 (Fwindow_prev_buffers, Fset_window_prev_buffers)
759 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
760 (Fset_window_parameter, Fwindow_display_table)
761 (Fset_window_display_table, Fdelete_other_windows_internal)
762 (Fset_window_buffer, Fset_window_new_total)
763 (Fset_window_new_normal, Fdelete_window_internal)
764 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
765 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
766 (Fwindow_scroll_bars): Check whether argument window is a valid or
767 live window. Update doc-strings.
768 (syms_of_window): New symbol Qwindow_valid_p.
769 * keyboard.c (Fposn_at_x_y): Check whether argument
770 frame_or_window denotes a valid window.
771
2751c80f
DA
7722012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
773
774 Fix previous char table change.
775 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
776 * chartab.c (optimize_sub_char_table): Likewise.
777
032a42c8
CY
7782012-08-16 Chong Yidong <cyd@gnu.org>
779
a2d19368
CY
780 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
781
032a42c8
CY
782 * xfont.c (xfont_open):
783 * xftfont.c (xftfont_open): Set the font's max_width field.
784
785 * nsfont.m (nsfont_open): Similar to the Xft backend, set
786 min_width to space_width and average_width to the average over
787 printable ASCII characters.
788 (ns_char_width): Code cleanup.
789 (ns_ascii_average_width): New utility function.
790
791 * font.h (struct font): Update comments.
792
a098c930
DA
7932012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
794
032a42c8 795 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
796 * lisp.h (CSET): New macro.
797 (char_table_set_extras, char_table_set_contents)
798 (sub_char_table_set_contents): New function.
799 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
800 * syntax.c: Adjust users.
801
8be3a09c
SM
8022012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
803
804 * eval.c (eval_sub): Bind lexical-binding.
805 * lread.c (Qlexical_binding): Make non-static.
806
ac4845a6
JD
8072012-08-15 Jan Djärv <jan.h.d@swipnet.se>
808
ddee6515
JD
809 * nsmenu.m (popupSession): Remove.
810 (pop_down_menu): Remove endModalSession.
811 (timeout_handler:): New method.
812 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
813 Call runModalForWindow. Check timer_fired when it returns.
814 If not set, cancel timer and break out of loop.
815 Otherwise loop again, with a new timeout.
816
817 * nsterm.m: Include fcntl.h if present.
818 (fd_entry, t_readfds, inNsSelect): Remove.
819 (select_writefds, select_valid, select_timeout, selfds)
820 (select_mutex, apploopnr): Add.
821 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
822 Otherwise call kbd_buffer_store_event.
823 (ns_send_appdefined): Remove release of fd_entry.
824 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
825 Increment and decrement apploopnr.
826 (ns_select): If no file descriptors, just do a NSTimer.
827 Otherwise copy read/write masks and start select thread (fd_handler).
828 Start main loop and wait for application defined event.
829 Inform select thread to stop selecting after main loop is exited.
830 (ns_term_init): Create selfds pipe and set non-blocking.
831 Initialize select_mutex. Start the select thread (fd_handler).
832 (fd_handler:): Loop forever, wait for info from the main thread
833 to either start or stop selecting. When select returns, send
834 and appdefined event.
835 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
836 If not call kbd_buffer_store_event.
837
838 * nsterm.h (EmacsApp): fd_handler takes id argument.
839 (EmacsDialogPanel): Add timer_fired and timeout_handler.
840
ac4845a6
JD
841 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
842
eb424fe3
EZ
8432012-08-15 Eli Zaretskii <eliz@gnu.org>
844
845 * region-cache.c (move_cache_gap): Update gap_len using the actual
846 growth of the boundaries array. Do not change cache_len.
847 (Bug#12196)
848
4e6a86c6
DA
8492012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
850
851 Generalize and cleanup font subsystem checks.
852 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
853 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
854 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 855
5bf192ca
DA
8562012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
857
858 * gtkutil.c (xg_get_font): Use pango_units_to_double.
859
f2045622
CY
8602012-08-15 Chong Yidong <cyd@gnu.org>
861
8be3a09c
SM
862 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
863 When using the new font chooser, use gtk_font_chooser_get_font_desc to
864 extract the font descriptor instead of just the font name.
865 In that case, return a font spec instead of a string.
f2045622
CY
866 (x_last_font_name): Move to this file from xfns.c.
867
868 * xfns.c (Fx_select_font): The return value can also be a font
869 spec. Move x_last_font_name management to gtkutil.c.
870
871 * xfaces.c: Make font weight and style symbols non-static.
872
7f6feb56
SM
8732012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
874
875 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
876 (bug#12117).
877
fecbd8ff
SM
8782012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
879
880 * alloc.c (Fgarbage_collect): Use plural form consistently.
881
9b8d5165
EZ
8822012-08-14 Eli Zaretskii <eliz@gnu.org>
883
884 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
885 iteration through the command loop. Fixes a problem whereby mouse
886 movements are ignored until the first mouse click.
887
f5d9e83a
PE
8882012-08-14 Paul Eggert <eggert@cs.ucla.edu>
889
890 Use bool, not int, for Lisp booleans.
891 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
892 makes Emacs a bit smaller and presumably a bit faster.
893 * lisp.h: Include <stdbool.h>.
894 (struct Lisp_Boolfwd, defvar_bool):
895 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
896 * regex.c [!emacs]: Include <stdbool.h>.
897 (false, true): Remove; <stdbool.h> does this for us now.
898
55802e4a
CY
8992012-08-14 Chong Yidong <cyd@gnu.org>
900
4abcdac8
CY
901 * character.c (Fcharacterp): Doc fix (Bug#12076).
902
903 * data.c (Findirect_variable): Doc fix (Bug#11040).
904
55802e4a
CY
905 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
906
907 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 908 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 909
8e99d072
BR
9102012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
911
912 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
913 (bug#12022).
914
08908aca
MR
9152012-08-14 Martin Rudalics <rudalics@gmx.at>
916
917 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
918 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
919 * minibuf.c (choose_minibuf_frame, read_minibuf):
920 * w32fns.c (x_create_tip_frame):
921 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
922 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
923
56120d6f
PE
9242012-08-14 Paul Eggert <eggert@cs.ucla.edu>
925
926 * intervals.c (offset_intervals): Remove obsolete comment.
927
67b77c0b
AS
9282012-08-14 Andreas Schwab <schwab@linux-m68k.org>
929
930 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
931
f48b82fd
GR
9322012-08-14 Gergely Risko <gergely@risko.hu>
933
934 * coding.c (decode_coding): Record buffer modification before
935 disabling undo_list (Bug#11773).
936
fd318b54
DA
9372012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
938
939 Revert and cleanup some recent overlay changes.
940 * buffer.h (enum overlay_type): Remove.
941 (buffer_get_overlays, buffer_set_overlays): Likewise.
942 (buffer_set_overlays_before, buffer_set_overlays_after):
943 New function. Adjust users.
944 (unchain_both): Add eassert.
945
41a62dd9
DA
9462012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
947
948 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
949
5884c324
PE
9502012-08-14 Paul Eggert <eggert@cs.ucla.edu>
951
952 * gtkutil.c (xg_mark_data): Don't assume C99.
953
ca06f160
JD
9542012-08-13 Jan Djärv <jan.h.d@swipnet.se>
955
956 * gtkutil.c (xg_frame_tb_info): New struct.
957 (TB_INFO_KEY): New define.
958 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
959 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
960 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
961 if not present.
962 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
963 is up to date. Otherwise store new data.
964 (free_frame_tool_bar): Free xg_frame_tb_info if present.
965
7864a3f7
DA
9662012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
967
968 Use KSET for write access to Lisp_Object members of struct kboard.
969 * keyboard.h (KSET): New macro.
970 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
971 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
972 * xterm.c: Adjust users.
973
4c31be61
DA
9742012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
975
976 Use BSET for write access to Lisp_Object members of struct buffer.
977 * buffer.h (BSET): New macro.
978 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
979 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
980 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
981 * window.c, xdisp.c, xfns.c: Adjust users.
982
14ae4239
BT
9832012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
984
985 * lread.c (syms_of_lread): Initialize Vlexical_binding.
986
32bcadb4
JD
9872012-08-11 Jan Djärv <jan.h.d@swipnet.se>
988
3d29b2ce
JD
989 * nsterm.m (not_in_argv): New function.
990 (application:openFile, application:openTempFile:):
991 (application:openFileWithoutUI:, application:openFiles:): Open file
992 if not_in_argv returns non-zero (bug#12171).
993
32bcadb4 994 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
995 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
996 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
997 (xg_get_font_name): Use those functions/macros here.
998 Reported by Frans Oilinki <moilinki@gmail.com>.
999
9ff9402d 10002012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
1001
1002 * unexmacosx.c (copy_data_segment): Copy initialized data in
1003 statically linked libraries from input file rather than memory.
1004
db74a5fc
YM
1005 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1006 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1007 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1008
25e65510
GM
10092012-08-10 Glenn Morris <rgm@gnu.org>
1010
1011 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1012 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1013
7961135c
DA
10142012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1015
1016 Fix last change to allow compilation with low optimization levels.
1017 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1018 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1019
42b3a444
DA
10202012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1021
1022 Use common inline syntax in intervals.h.
1023 * intervals.h (INTERVALS_INLINE): New macro.
1024 Change all users from LISP_INLINE.
1025
9fb0c957
DA
10262012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1027
1028 Define Qnone once for all platforms.
1029 * frame.c (Qnone): Define here.
1030 (syms_of_frame): DEFSYM it.
1031 * lisp.h (Qnone): New declaration.
1032 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1033 * xfns.c: Remove duplication. Adjust users.
1034
65e8ee52
DA
10352012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1036
1037 Remove unused macros from intervals.h.
1038 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1039 * intervals.c: Adjust comment.
1040
9b855fd6
EZ
10412012-08-10 Eli Zaretskii <eliz@gnu.org>
1042
1043 * w32fns.c <w32_unicode_gui>: New static variable.
1044 (globals_of_w32fns): Initialize it according to os_subtype.
1045 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1046 testing os_subtype.
1047
39cb9e56 10482012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
1049 Eli Zaretskii <eliz@gnu.org>
1050
1051 Fix bug #10299 with Unicode characters sent by customized
1052 keyboards created by MSKLC.
1053 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1054 (w32_init_class): Use it to initialize the Emacs class with either
1055 ANSI or Unicode API calls.
1056 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1057 later.
1058 (w32_wnd_proc): If the character code sent by WM_CHAR or
1059 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1060 original message. Call DefWindowProcW on NT and later.
1061
9374581a
GM
10622012-08-10 Glenn Morris <rgm@gnu.org>
1063
4b94e8cf
GM
1064 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1065
9374581a
GM
1066 * lisp.h (DIRECTORY_SEP): Let configure set it.
1067
a2752828
DA
10682012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1069
1070 Use TSET for write access to Lisp_Object slots of struct terminal.
1071 * termhooks.h (TSET): New macro.
1072 * coding.c, terminal.c, xselect.c: Adjust users.
1073
cc92c454
SM
10742012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1075
1076 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1077 the failing expression, include them in the error message.
1078 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1079 * lisp.h (internal_condition_case_n): Update declaration.
1080
4cb3e6b3
DA
10812012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1082
1083 Inline functions to examine and change buffer overlays.
1084 * buffer.c (unchain_both): New function.
1085 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1086 (buffer_has_overlays): New function.
1087 (enum overlay_type): New enum.
1088 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1089 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1090
8707c1e5
DA
10912012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1092
1093 Inline functions to examine and change buffer intervals.
1094 * alloc.c (mark_interval_tree): Remove.
1095 (MARK_INTERVAL_TREE): Simplify.
1096 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1097 * intervals.c (buffer_balance_intervals): New function.
1098 (graft_intervals_into_buffer): Adjust indentation.
1099 (set_intervals_multibyte): Simplify.
1100 * buffer.h (BUF_INTERVALS): Remove.
1101 (buffer_get_intervals, buffer_set_intervals): New function.
1102 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1103 * intervals.c, textprop.c: Adjust users.
1104
ad8c997f
DA
11052012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1106
1107 Inline functions to examine and change string intervals.
1108 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1109 (string_get_intervals, string_set_intervals): New function.
1110 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1111 * lread.c, print.c, textprop.c: Adjust users.
1112
32ac3a6b
GM
11132012-08-08 Glenn Morris <rgm@gnu.org>
1114
1115 * lisp.mk (lisp): Remove language/persian.elc.
1116
77c7bcb1
DA
11172012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1118
1119 Cleanup intervals.
1120 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1121 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
1122 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1123 Adjust comment. Move under #if 0.
77c7bcb1
DA
1124 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1125 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1126
9c08a8d4
DA
11272012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1128
1129 Check total length of intervals with eassert.
1130 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1131 * intervals.c: Change all users to eassert.
1132
26d16b35
EZ
11332012-08-07 Eli Zaretskii <eliz@gnu.org>
1134
14ae4239
BT
1135 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1136 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
1137 INTERNAL_FIELD in Lisp_Cons.
1138
c644523b
DA
11392012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1140
1141 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1142 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1143 name since all xname users are fixed long time ago. Do not
1144 use INTERNAL_FIELD.
1145 (set_symbol_name, set_symbol_function, set_symbol_plist):
1146 (set_symbol_next, set_overlay_plist): New function.
1147 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1148 (struct Lisp_Overlay): Likewise.
1149 (CVAR, MVAR, SVAR): Remove.
1150 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1151 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1152 * xterm.c: Adjust users.
1153 * .gdbinit: Change to use name field of struct Lisp_Symbol
1154 where appropriate.
1155
6a3d20cc
DA
11562012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1157
1158 Basic functions to set Lisp_Object and pointer slots of intervals.
1159 * intervals.h (interval_set_parent, interval_set_object):
1160 (interval_set_left, interval_set_right, interval_set_plist):
1161 (interval_copy_parent): New function.
1162 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
1163 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1164 Adjust indentation.
6a3d20cc
DA
1165 (INTERVAL_SIZE): Remove. Adjust users.
1166 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1167
4d2b044c
DA
11682012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1169
1170 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1171 * process.h (PGET): Remove.
1172 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1173 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1174
d3d50620
DA
11752012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1176
1177 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1178 * window.h (WGET): Remove.
1179 (struct window): Do not use INTERNAL_FIELD.
1180 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1181 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1182 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1183 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1184 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1185 Adjust users.
1186
d10a51dc
CY
11872012-08-07 Chong Yidong <cyd@gnu.org>
1188
1189 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1190 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1191 (Fdelete_window_internal): Signal an error if the window is not on
1192 a live frame (Bug#12025).
1193
e69b0960
DA
11942012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1195
1196 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1197 * frame.h (FGET): Remove.
1198 (struct frame): Do not use INTERNAL_FIELD.
1199 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1200 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1201 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1202 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1203
25a20a3a
JB
12042012-08-06 Juanma Barranquero <lekktu@gmail.com>
1205
1206 * w32.c: Silence compiler warnings.
1207 (map_w32_filename): Remove unused variable `is_fat'.
1208 (chase_symlinks): Add parentheses around expression.
1209
1c6f11f4
GM
12102012-08-06 Glenn Morris <rgm@gnu.org>
1211
1db4583a
GM
1212 * sysdep.c: Respect BROKEN_GETWD.
1213
1c6f11f4
GM
1214 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1215 Let configure handle it.
1216 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1217
2b90362b
DA
12182012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1219
1220 Use GCALIGNMENT where appropriate.
1221 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1222 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1223 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1224
5f50daf2
EZ
12252012-08-06 Eli Zaretskii <eliz@gnu.org>
1226
14ae4239
BT
1227 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1228 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 1229
cbcc7007
SM
12302012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1231
1232 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1233 that should be sufficient for everyone.
1234
4d365fa4
JD
12352012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1236
1237 * keyboard.c (timer_check_2): Add break so timer_check returns next
1238 timeout.
1239
dd86bd82
DA
12402012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1241
1242 Fix Windows build errors introduced after converting to WGET and WSET.
1243 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1244 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1245
054e1668
JD
12462012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1247
1248 * nsterm.m (ns_frame_rehighlight): Use FSET.
1249
1250 * nsmenu.m (ns_update_menubar): Use FSET.
1251
21238f11
DA
12522012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1253
1254 Separate read and write access to Lisp_Object slots of Lisp_Process.
1255 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1256 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1257
077288cf
DA
12582012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1259
1260 Separate read and write access to Lisp_Object slots of struct window.
1261 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1262 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1263 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1264 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1265 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1266 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1267 Adjust users.
1268
71688bd7
DA
12692012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1270
1271 Fix Windows build errors introduced after converting to FGET and FSET.
1272 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1273 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1274 (w32_judge_scroll_bars): Change to use FSET.
1275 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1276
f99bac93
DA
12772012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1278
1279 Fix replacement typo.
1280 * window.c (replace_window): Set root_window instead of
1281 selected_window. This fixes a total window subsystem
1282 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1283
8c2a0f2d
GM
12842012-08-06 Glenn Morris <rgm@gnu.org>
1285
1286 * lisp.mk (lisp): Add language/persian.elc.
1287
edd74c35
DA
12882012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1289
1290 Separate read and write access to Lisp_Object slots of struct frame.
1291 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1292 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1293 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1294 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1295 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1296
8671676c
AS
12972012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1298
1299 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1300
663e2b3f
DA
13012012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1302
1303 Generalize common compile-time constants.
1304 * lisp.h (header_size, bool_header_size, word_size): Now here.
1305 (struct Lisp_Vector): Add comment.
1306 (struct Lisp_Bool_Vector): Move up to define handy constants.
1307 (VECSIZE, PSEUDOVECSIZE): Simplify.
1308 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1309 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1310 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1311 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1312 * xfont.c, xmenu.c: Use word_size where appropriate.
1313
d32e47af
LM
13142012-08-05 Lawrence Mitchell <wence@gmx.li>
1315
1316 * search.c (Freplace_match): Treat \? in the replacement text
1317 literally (Bug#8161).
1318
e5d9c0d1
CY
13192012-08-05 Chong Yidong <cyd@gnu.org>
1320
1321 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1322 * frame.c (Vdelete_frame_functions):
1323 * emacs.c (Vkill_emacs_hook): Doc fix.
1324
8da0576b
EZ
13252012-08-04 Eli Zaretskii <eliz@gnu.org>
1326
1327 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1328 --with-x-toolkit=no builds.
1329 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1330
02676e5d
CY
13312012-08-04 Chong Yidong <cyd@gnu.org>
1332
1333 * syntax.c (Fmodify_syntax_entry): Doc fix.
1334
97147da9
EZ
13352012-08-04 Eli Zaretskii <eliz@gnu.org>
1336
76151e2c
EZ
1337 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1338 * w32.c (init_environment): Change the default values of many
1339 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
1340 them into environment when they were not already defined.
1341 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 1342 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
1343 (check_windows_init_file): Now external, not static.
1344 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
1345 called when Vload_path is already set up.
1346
1347 * w32.h (check_windows_init_file): Add prototype.
1348
1349 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1350 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1351 compatibility with Posix platforms.
1352 (main): Move the call to check_windows_init_file to here from
1353 w32.c.
1354 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1355 any, in the DEFALT argument into the root of the Emacs build or
1356 installation tree, as appropriate.
1357
1358 * callproc.c (init_callproc_1): Call decode_env_path instead of
1359 doing its equivalent by hand.
1360 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1361 the code that sets Vexec_path run on MS-Windows.
1362
1363 * lread.c (init_lread): Add comments to #ifdef's.
1364
97147da9
EZ
1365 * msdos.c (dos_set_window_size, IT_update_begin)
1366 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1367 instead of direct references.
1368
185ee146
PE
13692012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1370
1371 Export DEFAULT_REHASH_* to GDB.
1372 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1373 Now constants, not macros.
1374
8834c57a
PE
13752012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1376
98c6f1e3
PE
1377 Remove unnecessary casts involving pointers.
1378 These casts are no longer needed now that we assume C89 or later,
1379 since they involve casting to or from void *.
1380 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1381 (make_pure_float, make_pure_vector):
1382 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1383 * macros.c (Fstart_kbd_macro):
1384 * menu.c (find_and_return_menu_selection):
1385 * minibuf.c (read_minibuf_noninteractive):
1386 * sysdep.c (closedir):
1387 * xdisp.c (x_produce_glyphs):
1388 * xfaces.c (compare_fonts_by_sort_order):
1389 * xfns.c (x_real_positions, select_visual):
1390 * xselect.c (x_stop_queuing_selection_requests)
1391 (x_get_window_property, x_get_window_property_as_lisp_data):
1392 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1393 Remove unnecessary pointer casts.
1394 * alloc.c (record_xmalloc): New function.
1395 * lisp.h (record_xmalloc): New decl.
1396 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1397 more like a function. This is because the pointer cast is not
1398 needed. All uses changed.
1399 * print.c (print_string, print_error_message): Avoid length recalc.
1400
8834c57a
PE
1401 Improve fix for macroexp crash with debugging (Bug#12118).
1402 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1403 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1404 not supposed to be invoked from the garbage collector.
1405 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1406 (gc_aset): New function, which is like ASET but can be
1407 used in the garbage collector.
1408 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1409 (set_hash_index): Use it instead of ASET.
1410
6dad7178
EZ
14112012-08-03 Eli Zaretskii <eliz@gnu.org>
1412
1413 Support symlinks on latest versions of MS-Windows.
1414 * w32.c: Include winioctl.h and aclapi.h.
1415 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1416 (revert_to_self): Forward declarations of static functions.
1417 <static BOOL g_b_init_get_security_info>:
1418 <g_b_init_create_symbolic_link>: New static flags.
1419 (globals_of_w32): Initialize them to zero.
1420 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1421 (map_w32_filename): Improve commentary. Simplify switch.
1422 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1423 headers (most versions of MinGW w32api don't).
1424 (get_security_info, create_symbolic_link)
1425 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1426 New functions.
1427 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1428 in the argument file name.
1429 (sys_access): Call unc_volume_file_attributes only if
1430 GetFileAttributes fails with network-related error codes.
1431 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1432 have the required privileges.
14ae4239 1433 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
1434 get_file_security_desc.
1435 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
1436 with addition of handling of symlinks and support for 'lstat'.
1437 If possible, get file's attributes and security information by
6dad7178
EZ
1438 handle, not by name. Produce S_IFLNK bit for symlinks, when
1439 called from 'lstat'.
1440 (stat, lstat): New functions, call 'stat_worker'.
1441 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1442 symlinks when the underlying filesystem supports them.
1443
f162bcc3
PE
14442012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1445
79ea6c20
PE
1446 Fix macroexp crash on Windows with debugging (Bug#12118).
1447 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1448 checking subscripts; problem introduced with the recent
1449 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1450 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1451 since it's used in non-static inline functions now.
1452
c0ce93fd
PE
1453 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1454 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 1455
f162bcc3
PE
1456 Use C99-style 'extern inline' if available.
1457 * buffer.h (BUFFER_INLINE):
1458 * category.h (CATEGORY_INLINE):
1459 * character.h (CHARACTER_INLINE):
1460 * charset.h (CHARSET_INLINE):
1461 * composite.h (COMPOSITE_INLINE):
1462 * dispextern.h (DISPEXTERN_INLINE):
1463 * lisp.h (LISP_INLINE):
1464 * systime.h (SYSTIME_INLINE):
1465 New macro, replacing 'static inline' in this header.
1466 * buffer.h, category.h, character.h, charset.h, composite.h:
1467 * dispextern.h, lisp.h, systime.h:
1468 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1469 * alloc.c (LISP_INLINE):
1470 * buffer.c (BUFFER_INLINE):
1471 * category.c (CATEGORY_INLINE):
1472 * character.c (CHARACTER_INLINE):
1473 * charset.c (CHARSET_INLINE):
1474 * composite.c (COMPOSITE_INLINE):
1475 * dispnew.c (DISPEXTERN_INLINE):
1476 * sysdep.c (SYSTIME_INLINE):
1477 Define to EXTERN_INLINE, so that the corresponding functions
1478 are compiled into code.
1479 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1480 (INLINE_HEADER_END): New macros.
1481 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1482 since it's used in non-static inline functions now.
a8333d03 1483 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 1484
837b365b
GM
14852012-08-02 Glenn Morris <rgm@gnu.org>
1486
d66b744d
GM
1487 * s/: Remove empty directory.
1488
837b365b
GM
1489 * s/ms-w32.h: Move to ../nt/inc.
1490 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1491 Update for new ms-w32.h location.
1492
13294f95
PE
14932012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1494
1495 Port to Solaris 8.
1496 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1497
90df0db3
GM
14982012-08-02 Glenn Morris <rgm@gnu.org>
1499
1500 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1501 hard-coding the path separator.
1502
4939150c
PE
15032012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1504
1505 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1506 This how ASET and AREF are supposed to work, and makes
1507 it easier to think about future improvements. See
1508 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1509 * charset.h (set_charset_attr): New function.
1510 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1511 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1512 (aref_addr): New function. All uses of &AREF(...) changed.
1513 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1514 (set_hash_index): New functions. All lvalue-style uses of
1515 HASH_KEY etc. changed.
1516 * keyboard.c (set_prop): New function. All lvalue-style uses
1517 of PROP changed.
1518
947b2afd
AA
15192012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1520
1521 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1522 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1523 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1524 * nsfns.m (ns_set_name_as_filename): Likewise.
1525 * nsmenu.m (ns_update_menubar): Likewise.
1526 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1527
4f5d0325
EZ
15282012-08-01 Eli Zaretskii <eliz@gnu.org>
1529
2008beae
EZ
1530 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1531 Adapt to latest changes in field names of the corresponding Lisp
288479f6 1532 objects.
2008beae 1533
4f5d0325
EZ
1534 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1535
fe3cc771
GM
15362012-08-01 Glenn Morris <rgm@gnu.org>
1537
1538 * s/msdos.h: Remove file.
1539 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1540 * Makefile.in (S_FILE): Remove.
1541 (config_h): Remove S_FILE.
1542
c90acc54
JB
15432012-08-01 Juanma Barranquero <lekktu@gmail.com>
1544
1545 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1546 Remove; moved to nt/config.nt.
1547
d8a05828
DA
15482012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1549
1550 Use INTERNAL_FIELD for conses and overlays.
1551 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1552 Remove obsolete comment.
1553 (MVAR): New macro.
1554 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1555 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1556
8271d590
DA
15572012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1558
1559 Use INTERNAL_FIELD for symbols.
1560 * lisp.h (SVAR): New macro. Adjust users.
1561 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1562 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1563
3193acd2
DA
15642012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1565
1566 Use INTERNAL_FIELD for processes.
1567 * process.h (PVAR): New macro. Adjust style.
1568 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1569 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1570
3a45383a
DA
15712012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1572
1573 Use INTERNAL_FIELD for windows.
1574 * window.h (WVAR): New macro.
1575 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1576 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1577 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1578 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1579 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1580 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1581
c1dbc63c
PE
15822012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1583
1584 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1585
5c0c0e8a
GM
15862012-08-01 Glenn Morris <rgm@gnu.org>
1587
1588 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1589 Move to configure.ac.
1590
552a99b4
JB
15912012-08-01 Juanma Barranquero <lekktu@gmail.com>
1592
1593 * makefile.w32-in (CONFIG_H): Update dependencies.
1594 (CONF_POST_H): New macro.
1595
1596 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1597
8d8e2dfe
GM
15982012-07-31 Glenn Morris <rgm@gnu.org>
1599
bc96620a
GM
1600 * Makefile.in (S_FILE): No longer set by configure.
1601
476b1b2d
GM
1602 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1603 is available.
1604 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1605
b2c7a106
GM
1606 * process.h (NULL_DEVICE):
1607 * emacs.c (SEPCHAR):
1608 * editfns.c (USER_FULL_NAME): Let configure set them.
1609
d53d062a
GM
1610 * s/README, s/template.h: Remove files.
1611
4515017f
GM
1612 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1613
8d8e2dfe
GM
1614 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1615 Move to configure.ac.
1616
5b20b3cc
EZ
16172012-07-31 Eli Zaretskii <eliz@gnu.org>
1618
1e0afd9a
EZ
1619 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1620 resulting renaming of 'struct frame' members.
1621
5b20b3cc
EZ
1622 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1623
1624 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1625 after introduction of FVAR.
1626
f1310128
JD
16272012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1628
79e721e0
JD
1629 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1630
1631 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1632 instead of compositeToPoint.
1633 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1634
8d7c7eed 1635 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 1636
e34f7f79
DA
16372012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1638
1639 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1640 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 1641 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
1642 (BVAR): Change to use INTERNAL_FIELD.
1643 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1644 (KVAR): Change to use INTERNAL_FIELD.
1645 * frame.h (FVAR): New macro.
1646 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
1647 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1648 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1649 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
1650 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1651
c09bfb2f
DA
16522012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1653
1654 Miscellaneous fixes for non-default X toolkits.
1655 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1656 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1657 Move under #ifdef USE_LUCID.
1658 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1659 definition and usage to avoid warnings.
1660
14c114ae
JD
16612012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1662
1663 * nsterm.m (openFiles): Fix previous checkin.
1664
3bd21e82
PE
16652012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1666
1667 * indent.c (compute_motion): Remove unused local.
1668
c1529ded
GM
16692012-07-31 Glenn Morris <rgm@gnu.org>
1670
400d5621
GM
1671 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1672
268e2432
GM
1673 * conf_post.h [USG5_4]:
1674 Move remaining contents of s/usg5-4-common.h here.
1675 * s/usg5-4-common.h: Remove file.
1676
7552f3ee
GM
1677 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1678 * s/irix6-5.h: Remove file.
1679
6a381852
GM
1680 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1681 * s/darwin.h: Remove file.
1682
c1529ded
GM
1683 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1684 * s/hpux10-20.h: Remove file, which is now empty.
1685
b429a4ee
GM
16862012-07-30 Glenn Morris <rgm@gnu.org>
1687
1688 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1689 * Makefile.in (config_h): Add conf_post.h.
1690 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1691
adff3182
JD
16922012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1693
1694 * nsterm.m (ns_do_open_file): New variable.
b9031d69 1695 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
1696 (openFile, openTempFile, openFileWithoutUI, openFiles):
1697 Open files only if ns_do_open_file.
adff3182 1698
c32af1e4
PE
16992012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1700
7393bcbb
PE
1701 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1702 This no-op macro hasn't been needed for many years.
1703 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1704
c32af1e4
PE
1705 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1706 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1707 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1708 gdb_make_enums_visible.
1709 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1710 (DIRECTORY_SEP): Now a constant, not a macro.
1711
302fc036
EZ
17122012-07-30 Eli Zaretskii <eliz@gnu.org>
1713
1714 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1715 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1716
1717 * w32term.c <w32_keyboard_codepage>: Renamed from
1718 keyboard_codepage and now external. All users changed.
1719
1720 * w32term.h: Add declaration of w32_keyboard_codepage.
1721
1722 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1723 the codepage to translate keys to Unicode. If this argument is
1724 -1, use the value returned by GetConsoleCP. All callers changed.
1725
88fb40b4
PE
17262012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1727
0aee6912
PE
1728 Update .PHONY listings in makefiles.
1729 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1730 bootstrap-clean, distclean, maintainer-clean, versioclean,
1731 extraclean, frc.
1732
88fb40b4
PE
1733 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1734 This is a bit clearer. Fix some commentary typos.
1735
0a763bd1
GM
17362012-07-30 Glenn Morris <rgm@gnu.org>
1737
32bac6d6
GM
1738 * s/netbsd.h: Let configure include signal.h if needed.
1739 Remove file, which is now empty.
1740
b65e7c46
GM
1741 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1742 Let configure set them.
1743 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1744 No more need to undefine.
0a763bd1 1745
169304bd
AS
17462012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1747
1748 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1749 non-single-byte char when adding meta modifier. (Bug#12090)
1750
6cd7a139
DA
17512012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1752
1753 Convert safe_call to use variable number of arguments.
1754 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1755 (safe_call2): Fix comment.
1756 * lisp.h (safe_call): Adjust prototype.
1757 * coding.c (encode_coding_object): Change to use safe_call2.
1758 * xfaces.c (merge_face_heights): Change to use safe_call1.
1759
d34d6ffc
GM
17602012-07-30 Glenn Morris <rgm@gnu.org>
1761
7b8a48e4 1762 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 1763 does that unconditionally. Remove file, which is now empty.
7b8a48e4 1764
d34d6ffc
GM
1765 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1766 Remove empty files.
1767
03a660a6
PE
17682012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1769
1770 Export to GDB most of lisp.h's remaining object-like macros.
1771 * lisp.h (min, max): Move earlier, because they're used earlier now.
1772 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1773 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1774 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1775 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1776 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1777 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1778 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1779 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1780 Now constants, for GDB. They need not be macros.
1781 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1782 Now constants, for GDB, as well as macros, for static initializers.
1783 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1784 Move to after the definition of struct Lisp_Char_Table,
1785 since the former now needs that type defined.
1786 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1787 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1788 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1789 New enums, for gdb_make_enums_visible.
1790 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 1791 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
1792 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1793 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1794 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1795 enum maxargs, enum MAX_ALLOCA.
1796 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1797 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1798 no longer needed, now that they are done in lisp.h.
1799
e499d0ee
DA
18002012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1801
1802 Cleanup string bytes checking.
1803 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1804 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1805 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1806 (check_sblock, compact_small_strings): Simplify.
1807
d5040d2d
PE
18082012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1809
1810 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1811 These macros are confusing and no longer need to be defined, as
1812 the enum values now suffice. All uses replaced with definiens.
1813 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1814
7f259ae6
JB
18152012-07-29 Juanma Barranquero <lekktu@gmail.com>
1816
1817 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1818 ($(BLD)/w32console.$(O)): Update dependencies.
1819
7e63e0c3
DA
18202012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1821
1822 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1823 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1824 time. Adjust users.
1825 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1826
ffd817eb
JD
18272012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1828
1829 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1830 setting sitelisp (Bug#12010).
1831
417a7a0e
EZ
18322012-07-29 Eli Zaretskii <eliz@gnu.org>
1833
14ae4239 1834 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
1835
1836 * w32heap.c (cache_system_info):
1837 * w32.c (sys_rename):
1838 * w32proc.c (find_child_console, sys_kill): All users changed.
1839
387d4d92
PE
18402012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1841
1842 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1843
55a6cca6
EZ
18442012-07-29 Eli Zaretskii <eliz@gnu.org>
1845
1846 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1847
dbcf001c
DA
18482012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1849
1850 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
1851 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1852 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 1853
e2688e4a
DA
18542012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1855
1856 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1857 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1858 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1859 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1860 (replace_range, replace_range_2, del_range_2): Change to eassert.
1861 * marker.c (byte_char_debug_check): Adjust style.
1862
b46a6a83
PE
18632012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1864
1865 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1866 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1867 long-ago-commented-out code that talks about "WIN32".
1868 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1869 All uses changed.
1870
e32a5799
PE
18712012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1872
1873 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1874 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1875 Simplify by using alignof.
1876 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1877 * lisp.h: Include <stdalign.h>.
1878 (GCALIGNMENT): New macro and constant.
1879 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1880 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1881 (stdalign): New macro, if not already defined.
1882
df81cd29
EZ
18832012-07-28 Eli Zaretskii <eliz@gnu.org>
1884
01bd1b0d
EZ
1885 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1886 * w32inevt.c: Include w32inevt.h.
1887 (w32_read_console_input): New inline function, calls either
1888 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1889 w32_console_unicode_input.
1890 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1891 (w32_kbd_patch_key, key_event): Use the codepage returned by
1892 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1893 (key_event): use uChar.UnicodeChar only if
1894 w32_console_unicode_input is non-zero.
1895
1896 * w32console.c: Include w32heap.h.
1897 <w32_console_unicode_input>: New global variable.
1898 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1899 family of Windows, zero otherwise.
1900
1901 * w32inevt.h: Declare w32_console_unicode_input.
1902
df81cd29
EZ
1903 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1904 --without-x. (Bug#11742)
1905
c20fdd9e
PE
19062012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1907
1908 Adjust GDB to reflect pvec_type changes (Bug#12036).
1909 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
1910 2012-07-04 changes to pseudovector representation.
1911 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 1912
32770973 19132012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
1914
1915 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1916 bus address.
1917 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1918
3438fe21
EZ
19192012-07-27 Eli Zaretskii <eliz@gnu.org>
1920
bcfbc9de
EZ
1921 * alloc.c (listn): Fix the order the arguments are consed onto the
1922 list.
1923
3438fe21
EZ
1924 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
1925 enumeration constants, as PURE and HEAP are too general, and clash
1926 with other headers and sources, such as gmalloc.c and the
1927 MS-Windows system headers. All users changed.
1928
eeaea515
DA
19292012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1930
1931 Revert last save_excursion_save and save_excursion_restore changes.
1932 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
1933 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
1934
073c88c2
DA
19352012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1936
1937 Fix recently-introduced typos in Windows port.
1938 Reported by Martin Rudalics <rudalics@gmx.at>.
1939 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 1940 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 1941
4706125e
PE
19422012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1943
1944 Improve GDB symbol export (Bug#12036).
1945 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
1946 arms of an 'if', not using conditional expressions; otherwise GDB
1947 complains about the types in the unevaluated arm when the argument
1948 is an integer literal.
1949 (xgetint): Simplify expression.
1950 * alloc.c (gdb_make_enums_visible): New constant. This ports to
1951 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
1952 Zaretskii in <http://bugs.gnu.org/12036#13>.
1953 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
1954 needed now that we have gdb_make_enums_visible.
1955 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
1956 (enum enum_USE_LSB_TAG):
1957 New enum types, packaging up enums that need to be exported to GDB.
1958
694b6c97
DA
19592012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1960
1961 Utility function to make a list from specified amount of objects.
1962 * lisp.h (enum constype): New datatype.
1963 (listn): New prototype.
1964 * alloc.c (listn): New function.
1965 (Fmemory_use_count, syms_of_alloc): Use it.
1966 * buffer.c (syms_of_buffer): Likewise.
1967 * callint.c (syms_of_callint): Likewise.
1968 * charset.c (define_charset_internal): Likewise.
1969 * coding.c (syms_of_coding): Likewise.
1970 * keymap.c (syms_of_keymap): Likewise.
1971 * search.c (syms_of_search): Likewise.
1972 * syntax.c (syms_of_syntax): Likewise.
1973 * w32.c (init_environment): Likewise.
1974 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
1975 * xdisp.c (syms_of_xdisp): Likewise.
1976 * xfns.c (syms_of_xfns): Likewise.
1977
6195f384
DA
19782012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
1979
1980 Fast save_excursion_save and save_excursion_restore.
1981 * lisp.h (struct Lisp_Excursion): New data type.
1982 (PVEC_EXCURSION): New pseudovector type.
1983 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
1984 to deal with it. Adjust comments.
1985 (init_marker, attach_marker): New prototype.
1986 (unchain_marker): Adjust prototype.
1987 * marker.c (attach_marker): Change to global.
1988 (init_marker): New function.
1989 * alloc.c (Fmake_marker, build_marker): Use it.
1990 (build_marker): More easserts.
1991 (mark_object): Handle struct Lisp_Excursion.
1992 * editfns.c (save_excursion_save, save_excursion_restore):
1993 Reimplement to use struct Lisp_Excursion. Add comments.
1994
5eceb8fb
PE
19952012-07-26 Paul Eggert <eggert@cs.ucla.edu>
1996
1997 Fix export of symbols to GDB (Bug#12036).
1998 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
1999 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2000 emacs.c, as this is a more-suitable home. Had this been done earlier
2001 the fix for 12036 would have avoided some of the problems noted in
2002 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2003 would have been more obvious.
562157c8
PE
2004 * emacs.c: Do not include <verify.h>; no longer needed.
2005 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
2006 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2007 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2008 Remove; now done in lisp.h.
2009 * lisp.h (PUBLISH_TO_GDB): New macro.
2010 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2011 (DATA_SEG_BITS): Use it.
2012 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2013 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2014 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2015 not be usable in #if. This simplifies things.
2016
d6749401
JB
20172012-07-26 Juanma Barranquero <lekktu@gmail.com>
2018
2019 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2020
1781b9e9
PE
20212012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2022
d89518db 2023 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
2024 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2025 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2026 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2027 Adjust to changes in lisp.h and emacs.c, by using
2028 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2029 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2030 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2031 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2032 instead of gdb_valbits.
2033 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2034 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2035 instead of gdb_array_mark_flag.
2036 (xboolvector): Get size from $->size, not $->header.size.
2037 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2038 (xreload, hook-run, hookpost-run): Remove.
2039 * emacs.c: Include <verify.h>.
2040 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2041 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2042 Remove.
2043 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2044 (gdb_USE_LSB_TAG): New enum constants.
2045 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2046 Also define these as enum constants, so they're visible to GDB.
2047 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2048 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2049 as constants, so they're visible to GDB.
2050 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2051 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2052 Now enum constants, not macros, so they're visible to GDB.
2053 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2054 more convenient now. All uses changed.
2055 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2056 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2057
3628596a
DA
20582012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2059
2060 Explicitly free restriction data that are not needed anymore.
2061 * editfns.c (save_restriction_restore): Free restriction data.
2062
7abaf5cc
SM
20632012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2064
2065 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2066 add argument, tune behavior, and adjust all callers.
2067
71f88e00
PE
20682012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2069
2070 Use typedef for EMACS_INT, EMACS_UINT.
2071 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2072 than macros. This simplifies debugging in the usual case, since
2073 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2074 and it allows expressions involving EMACS_INT casts.
2075 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2076
57ec3034
JD
20772012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2078
2079 * nsterm.m (ns_read_socket): Return early if there is a modal
2080 window (Bug#12043).
2081
8137e7b3
MR
20822012-07-25 Martin Rudalics <rudalics@gmx.at>
2083
2084 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2085 that FOCUS-FRAME can be omitted.
2086
04e9897c
DA
20872012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2088
2089 Adjust buffer text indirection counters at the end of Fkill_buffer.
2090 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2091 buffer is definitely dead. This should really fix an issue reported
2092 by Christoph Scholtes again. (Bug#12007).
2093 (init_buffer_once): Initialize indirection counters of
2094 buffer_defaults and buffer_local_symbols (for sanity and safety).
2095
8a0484e1
EZ
20962012-07-24 Eli Zaretskii <eliz@gnu.org>
2097
2098 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2099 and continuation glyphs on tooltip frames, leave them at zero.
2100 Avoids continued lines in tooltips. (Bug#11832)
2101
fa691a83
DA
21022012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2103
2104 Simplify copy_overlay.
04e9897c 2105 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
2106 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2107
436bc8e0
EZ
21082012-07-23 Eli Zaretskii <eliz@gnu.org>
2109
2110 * print.c (print_object): Don't crash when a frame's name is nil
2111 or invalid. (Bug#12025)
2112
2113 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2114 it signals an error when a tooltip frame is being created.
2115
d7a7fda3
DA
21162012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2117
2118 Cleanup miscellaneous objects allocation and initialization.
2119 * alloc.c (allocate_misc): Change to static. Add argument to
2120 specify the subtype. Adjust comment and users.
2121 (build_overlay): New function.
2122 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2123 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2124 (allocate_misc): Remove prototype.
2125 (build_overlay): Add prototype.
2126
21272012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
2128
2129 Swap buffer text indirection counters in Fbuffer_swap_text.
2130 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2131 This avoids crash reported by Christoph Scholtes at
2132 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2133
9d7fa573
JD
21342012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2135
2136 * nsmenu.m (Popdown_data): New struct.
2137 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2138 free Popdown_data.
2139 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2140 (initWithContentRect): Make imgView and contentView non-static
2141 and autorelease them. Also autorelease img and matrix (Bug#12005).
2142 (dealloc): Remove (Bug#12005).
2143
0dd6d66d
DA
21442012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2145
2146 Adjust consing_since_gc when objects are explicitly freed.
2147 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2148 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2149 (free_cons, free_misc): Subtract object size from consing_since_gc.
2150
d36d71df
DA
21512012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2152
2153 Simplify and cleanup markers positioning code.
2154 * marker.c (attach_marker): More useful eassert.
2155 (live_buffer, set_marker_internal): New function.
2156 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2157 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2158
fb9ea40f
PE
21592012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2160
2161 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2162 as it's limited by the amount of memory, not by INT_MAX.
2163
2d5c5f7d
EZ
21642012-07-21 Eli Zaretskii <eliz@gnu.org>
2165
07fb592e
EZ
2166 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2167 in special-event-map. See the discussion at
2168 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2169 for the reasons.
2170
37a9eac8 2171 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
2172 info.dwItemData. Fixes crashes on 64-bit Windows.
2173 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 2174
c4328746
JD
21752012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2176
2177 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 2178 (conversationIdentifier): Return value is NSInteger.
784051c4 2179 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 2180
6e5d1c12
CY
21812012-07-21 Chong Yidong <cyd@gnu.org>
2182
2183 * window.c (decode_any_window): Signal an error if the window is
2184 on a dead frame (Bug#11984).
2185
9928463d
DA
21862012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2187
2188 Add indirection counting to speed up Fkill_buffer.
2189 * buffer.h (struct buffer): New member.
2190 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2191 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2192 base buffer indirection counter.
2193 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2194 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2195 through buffer list if indirection counter is 0.
2196
f8643a6b
DA
21972012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2198
2199 Extend the value returned by Fgarbage_collect with heap statistics.
2200 * alloc.c (Qheap): New symbol.
2201 (syms_of_alloc): DEFSYM it.
2202 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2203 (Fmemory_free): Remove.
2204 (syms_of_alloc): Don't defsubr it.
2205 * buffer.c (Fcompact_buffer): Remove.
2206 (syms_of_buffer): Don't defsubr it.
2207
dac616ff
DA
22082012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2209
2210 Make maybe_gc inline.
2211 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2212 * lisp.h (consing_since_gc, gc_relative_threshold)
2213 (memory_full_cons_threshold): Revert declaration.
2214 (maybe_gc): Remove prototype, define as inline.
2215 * alloc.c: Remove old commented-out code.
2216 (consing_since_gc, gc_relative_threshold)
2217 (memory_full_cons_threshold): Revert to global.
2218 (maybe_gc): Remove.
2219
d7ea76b4
DA
22202012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2221
2222 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2223 * lisp.h (build_unibyte_string): New function.
2224 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2225 * sysdep.c, w32fns.c, xfns.c: Use it.
2226 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2227 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2228 Adjust users accordingly.
2229 * font.h (font_open_by_name): Adjust prototype.
2230
765e61e3
DA
22312012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2232
2233 Cleanup calls to Fgarbage_collect.
2234 * lisp.h (maybe_gc): New prototype.
2235 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2236 Remove declarations.
2237 * alloc.c (maybe_gc): New function.
2238 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2239 Make them static.
2240 * bytecode.c (MAYBE_GC): Use maybe_gc.
2241 * eval.c (eval_sub, Ffuncall): Likewise.
2242 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2243 to avoid dependency from auto-save feature.
2244
52b852c7
PE
22452012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2246
2247 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2248 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2249 'for_each_per_buffer_object_at'.
2250 All uses changed. It's better to use upper-case for macros that
2251 cannot be implemented as functions, to give the reader a clue
2252 that they're special.
2253
5db81e33
SM
22542012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2255
2256 * alloc.c (Fgarbage_collect): Tweak docstring.
2257
5b835e1d
DA
22582012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2259
2260 Tweak the value returned from Fgarbage_collect again.
2261 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2262 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2263 Adjust documentation.
2264 (total_vector_bytes): Rename to total_vector_slots, adjust
2265 accounting.
2266 (total_free_vector_bytes): Rename to total_free_vector_slots,
2267 adjust accounting.
2268 (Qstring_bytes, Qvector_slots): New symbols.
2269 (syms_of_alloc): DEFSYM them.
2270
9cd47b72
DA
22712012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2272
2273 Buffer compaction primitive which may be used from Lisp.
2274 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2275 (syms_of_buffer): Register Fcompact_buffer.
2276 * alloc.c (Fgarbage_collect): Use compact_buffer.
2277 * buffer.h (compact_buffer): New prototype.
2278 (struct buffer_text): New member.
2279
d17337e5
DA
22802012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2281
2282 New macro to iterate over all buffers, miscellaneous cleanups.
2283 * lisp.h (all_buffers): Remove declaration.
2284 * buffer.h (all_buffers): Add declaration, with comment.
2285 (for_each_buffer): New macro.
2286 * alloc.c (Fgarbage_collect, mark_object): Use it.
2287 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2288 (init_buffer): Likewise.
2289 * data.c (Fset_default): Likewise.
2290 * coding.c (code_conversion_restore): Remove redundant check
2291 for dead buffer.
2292 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2293
60cfd278
AS
22942012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2295
2296 Fix bug that created negative-length intervals.
2297 * intervals.c (merge_interval_right, merge_interval_left):
2298 Do not zero out this interval if it is absorbed by its children,
2299 as this interval's total length doesn't change in that case. See
2300 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2301
d06714cb
PE
23022012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2303
83713154
PE
2304 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2305 when invoking (make-bool-vector N t) and N is a positive
2306 multiple of 8 -- the last 8 bits were mistakenly cleared.
2307
d06714cb
PE
2308 Remove some struct layout assumptions in bool vectors.
2309 * alloc.c (bool_header_size): New constant.
2310 (header_size, word_size): Move earlier, as they're now used earlier.
2311 Use 'word_size' in a few more places, where it's appropriate.
2312 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2313 padding before the data member of a bool vector.
2314 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2315 than doing the check by hand with an abort ().
2316
464d5a5e
SM
23172012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2318
5fbc0409
SM
2319 * eval.c (Fdefvar): Don't check constants since we only set the var if
2320 it's not yet defined anyway (bug#11904).
2321
464d5a5e
SM
2322 * lisp.h (last_undo_boundary): Declare new var.
2323 * keyboard.c (command_loop_1): Set it.
2324 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2325 were auto-added by the command loop (bug#11774).
2326
8dc2e44a
AS
23272012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2328
2329 * w32font.c (Qsymbol): Remove local definition.
2330 (syms_of_w32font): Don't DEFSYM it.
2331
169925ec
DA
23322012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2333
2334 Fix sweep_vectors to handle large bool vectors correctly.
2335 * alloc.c (sweep_vectors): Account total_vector_bytes for
2336 bool vectors larger than VBLOCK_BYTES_MAX.
2337
5fbfb018
CY
23382012-07-18 Chong Yidong <cyd@gnu.org>
2339
2340 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2341 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2342
3ab6e069
DA
23432012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2344
2345 Return more descriptive data from Fgarbage_collect.
2346 Suggested by Stefan Monnier in
2347 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2348 * alloc.c (bounded_number): New function.
2349 (total_buffers, total_vectors): New variable.
2350 (total_string_size): Rename to total_string_bytes, adjust users.
2351 (total_vector_size): Rename to total_vector_bytes, adjust users.
2352 (sweep_vectors): Account total_vectors and total_vector_bytes.
2353 (Fgarbage_collect): New return value. Adjust documentation.
2354 (gc_sweep): Account total_buffers.
2355 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2356 (VECTOR_SIZE): Remove.
2357 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2358 (Qinterval, Qmisc): New symbols.
2359 (syms_of_data): Initialize them.
2360 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2361 (Qcons, Qbuffer): New declarations.
2362
6d02fe5b
PE
23632012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2364
2365 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2366 Round up, not down. Improve doc.
2367
b7ffe040
DA
23682012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2369
2370 Restore old code in allocate_string_data to avoid Faset breakage.
2371 Reported by Julien Danjou <julien@danjou.info> in
2372 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2373 * alloc.c (allocate_string_data): Restore old code with minor
2374 adjustments, fix comment to explain this subtle issue.
2375
4dc7c8d5
SM
23762012-07-17 Eli Zaretskii <eliz@gnu.org>
2377
2378 Remove FILE_SYSTEM_CASE.
2379 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2380
2381 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2382 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2383 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2384 call-process-region passes it through expand-file-name.
2385
2386 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2387
23882012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2389
2390 Fix crash when creating indirect buffer (Bug#11917)
2391 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2392 Don't handle unbound variables specially if non-zero.
2393 (Fbuffer_local_variables): Pass zero.
2394 (clone_per_buffer_values): Pass non-zero.
2395
23962012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2397
2398 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2399 to make the loop interruptible.
2400
24012012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2402
2403 * gnutls.c (emacs_gnutls_handshake): Only retry if
2404 GNUTLS_E_INTERRUPTED.
2405
cce7fefc
DA
24062012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2407
2408 Cleanup and convert miscellaneous checks to eassert.
2409 * alloc.c (mark_interval): Fix comment, partially rephrase
2410 old comment from intervals.h (see below).
2411 * intervals.c (find_interval, adjust_intervals_for_insertion)
2412 (delete_interval, adjust_intervals_for_deletion)
2413 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2414 Convert to eassert.
2415 (adjust_intervals_for_insertion, make_new_interval):
2416 Remove obsolete and unused code.
2417 * intervals.h (struct interval): Remove obsolete comment.
2418 * textprotp.c (erase_properties): Remove unused code.
2419 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2420 (Fremove_list_of_text_properties): Convert to eassert.
2421
9ea10cc3
CY
24222012-07-17 Chong Yidong <cyd@gnu.org>
2423
2424 * editfns.c (Finsert_char): Doc fix.
2425
3900d5de
DA
24262012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2427
2428 Fix previous change to make Fmemory_free always accurate.
2429 * alloc.c (make_interval): Update total_free_intervals.
2430 (make_float): Likewise for total_free_floats.
2431 (free_cons, Fcons): Likewise for total_free_conses.
2432 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2433 Likewise for total_free_vector_bytes.
2434 (Fmake_symbol): Likewise for total_free_symbols.
2435 (bytes_free): Remove.
2436
7098646f
DA
24372012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2438
2439 Simple free memory accounting feature.
2440 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2441 (sweep_vectors): Accumulate size of free vectors.
2442 (Fgarbage_collect): Setup bytes_free.
2443 (Fmemory_free): New function.
2444 (syms_of_alloc): Register it.
2445
22657b40
DA
24462012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2447
2448 Cleanup overlays checking.
2449 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2450 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2451 eassert and OVERLAYP.
2452 (sort_overlays): Change to use OVERLAYP.
2453
ddfc8813
RK
24542012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2455
2456 * editfns.c (Finsert_char): Make it interactive, and make the
2457 second arg optional. Copy interactive spec and docstring from
2458 ucs-insert.
2459
7c26cf3c
PE
24602012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2461
2462 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2463 Unlike the other wrapped functions, fabs has an unspecified
2464 effect on errno.
2465
5d127af9
JD
24662012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2467
2468 * nsterm.m (keyDown): Interpret flags without left/right bits
2469 as the left key (Bug#11670).
2470
6a0dd1d7
DA
24712012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2472
2473 Remove empty and useless init functions.
2474 * lisp.h (init_character_once, init_fns, init_image)
2475 (init_filelock, init_sound): Remove prototype.
2476 * character.c (init_character_once): Remove.
2477 * filelock.c (init_filelock): Likewise.
2478 * fns.c (init_fns): Likewise.
2479 * image.c (init_image): Likewise.
2480 * sound.c (init_sound): Likewise.
2481 * emacs.c (main): Adjust accordingly.
2482
7a6136fd
DA
24832012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2484
2485 * gtkutil.h: Tiny cleanups.
2486 (use_old_gtk_file_dialog): Remove useless declaration.
2487 (xg_uses_old_file_dialog): Add suggested const attribute.
2488
ce811ad9
EZ
24892012-07-15 Eli Zaretskii <eliz@gnu.org>
2490
2491 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2492 (bidi_paragraph_init): Use it to limit search forward for a strong
2493 directional character in abnormally large paragraphs full of
2494 neutral or weak characters. (Bug#11943)
2495
c9adfeaa
SF
24962012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2497
2498 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2499 the toolbar (Bug#9451).
2500 (xg_make_tool_item): Give the widget event box a transparent
2501 background.
2502
fff62aa9
DA
25032012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2504
2505 Cleanup basic allocation variables and functions.
2506 * alloc.c (ignore_warnings, init_intervals, init_float)
2507 (init_cons, init_symbol, init_marker): Remove.
2508 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2509 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2510 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2511 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2512 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2513 (staticidx, init_alloc_once, init_strings, free_ablock):
2514 Remove redundant initialization.
2515 * fns.c (init_weak_hash_tables): Remove.
2516 * lisp.h (init_weak_hash_tables): Remove prototype.
2517
9730daca
DA
25182012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2519
2520 Use zero_vector where appropriate.
2521 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2522 accordingly.
2523 * lisp.h (zero_vector): New declaration.
2524 * font.c (null_vector): Remove.
2525 (syms_of_font): Remove initialization and staticpro.
2526 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2527 * keymap.c (Faccessible_keymaps): Likewise.
2528
2e2d2a13
LL
25292012-07-15 Leo Liu <sdl.web@gmail.com>
2530
2531 * fringe.c: Fix typo in comments.
2532
cd276f6e
LL
25332012-07-14 Leo Liu <sdl.web@gmail.com>
2534
2535 * fringe.c: Add a new bitmap exclamation-mark.
2536
5a1131d9
EZ
25372012-07-14 Eli Zaretskii <eliz@gnu.org>
2538
2539 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2540
2541 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2542 (HAVE_MENUS): Don't define, defined by editing config.in with
2543 msdos/sed2v2.inp.
2544 (GMALLOC_INHIBIT_VALLOC): Don't define.
2545 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2546
22e983b7
JB
25472012-07-14 Juanma Barranquero <lekktu@gmail.com>
2548
2549 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2550
5b3f250f
GM
25512012-07-14 Glenn Morris <rgm@gnu.org>
2552
2553 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2554 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2555 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2556
33d63ff4
GM
25572012-07-13 Glenn Morris <rgm@gnu.org>
2558
5b633342
GM
2559 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2560
33d63ff4
GM
2561 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2562 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2563
b55b9f85
JD
25642012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2565
0dc8cf50
JD
2566 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2567 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2568 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2569 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2570 where appropriate.
2571 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2572 as boolean expression.
2573 (x_set_window_size): Remove unused variable toolbar.
2574 (ns_get_color_default, ns_mod_to_lisp): Remove.
2575 (ns_mouse_position): Remove unused variables xchar and ychar.
2576 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2577 (ns_set_vertical_scroll_bar): Remove unused variable count.
2578 (ns_delete_terminal): Remove unused variable i.
2579 (ns_term_init): Remove unused variables r, g and b.
2580 (mouseDown): Remove unused variable window.
2581 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2582 (initFrameFromEmacs): Remove unused variable vbextra.
2583 (mouseEntered): Remove unused variables p and dpyinfo.
2584 (mouseExited): Remove unused variables p and r.
2585 (ns_define_frame_cursor, ns_clear_frame_area)
2586 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2587 (menuDown): Assign [sender tag] to variable and cast the variable.
2588
2589 * nsterm.h (menuDown): Add id as type to argument sender.
2590 (ns_display_info_for_name): Add Lisp_Object argument.
2591 (ns_term_init): Add Lisp_Object argument.
2592 (ns_map_event_to_object): Add void argument.
2593 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2594 prototype with arguments and only declare if __OBJC__.
2595 (nxatoms_of_nsselect): Add void argument.
2596 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2597 (ns_alloc_autorelease_pool): Add void argument.
2598 (ns_release_autorelease_pool): Add void* argument.
2599 (ns_get_defaults_value): Add const char* argument.
2600
2601 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2602 (initFromContents): Use SSDATA where appropriate.
2603 (ns_update_menubar): Add braces to ambigous if-else.
2604 (initWithTitle): Put () around assignment in if statement.
2605 (ns_menu_show): Remove unused variables window and keymap.
2606 (update_frame_tool_bar): Remove unused variable selected_p.
2607 (initWithContentRect): Remove unused variable this_cmd_name.
2608
2609 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2610 appropriate.
2611 (setXBMColor): Remove unused variable len.
2612 (setPixmapData): Put () around assignment in loop statement.
2613
2614 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2615 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2616 where appropriate.
2617 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2618 around assignment in loop statement.
2619 (nsfont_open): Remove unused variable i.
2620 (nsfont_open): Remove unused variable len.
2621 (nsfont_draw): Remove unused variable cs.
2622
2623 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2624 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2625 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2626 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2627 (Fns_font_name, Fns_perform_service)
2628 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2629 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2630 (ns_set_name): Remove unused variable view.
2631 (x_set_menu_bar_lines): Remove unused variable olines.
2632 (x_set_tool_bar_lines): Remove unused variable root_window.
2633 (Fns_list_colors): Put () around assignment in while statement.
2634 (Fns_perform_service): Remove unused variable len.
2635 (Fns_display_usable_bounds): Remove unused variable top.
2636 (syms_of_nsfns): Remove unused variable i.
2637
b55b9f85
JD
2638 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2639 memcpy (Bug#11907).
2640
ed9265fc 26412012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
2642
2643 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2644 and free it with DestroyExceptionInfo (Bug#11558).
2645
ef099b57
JB
26462012-07-13 Juanma Barranquero <lekktu@gmail.com>
2647
2648 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2649 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2650 Set here, not in nt/config.nt.
2651
ea814a5d
EZ
26522012-07-13 Eli Zaretskii <eliz@gnu.org>
2653
2654 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2655 cursor overflow into the last glyph on display line when the right
2656 fringe is off. (Bug#11832)
2657
1a952767
PE
26582012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2659
2660 * xdisp.c (produce_special_glyphs): Now static.
2661 * dispextern.h (produce_special_glyphs): Remove decl.
2662
983188fd
GM
26632012-07-13 Glenn Morris <rgm@gnu.org>
2664
8d7c7eed 2665 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
2666 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2667
983188fd
GM
2668 * s/usg5-4-common.h (USG, USG5):
2669 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2670 * s/sol2-6.h (SOLARIS2):
2671 * s/irix6-5.h (IRIX6_5):
2672 * s/hpux10-20.h (USG, USG5, HPUX):
2673 * s/gnu-linux.h (USG, GNU_LINUX):
2674 * s/freebsd.h (BSD_SYSTEM):
2675 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2676 * s/cygwin.h (CYGWIN):
2677 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2678 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2679
d1e68667 26802012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
2681
2682 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 2683
6de0e799
GM
26842012-07-13 Glenn Morris <rgm@gnu.org>
2685
739ae010
GM
2686 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2687
dbee5793
GM
2688 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2689
6de0e799
GM
2690 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2691 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2692
b82da769
GM
26932012-07-12 Glenn Morris <rgm@gnu.org>
2694
4fae5a7a 2695 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
2696
2697 * process.c (init_process_emacs): Rename from init_process.
2698 The old name is also the name of a Mach system call.
2699 * lisp.h, emacs.c: Update for this name change.
2700 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2701 longer needed.
2702
5a979817
EZ
27032012-07-12 Eli Zaretskii <eliz@gnu.org>
2704
2705 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2706 memmove call that removes glyphs covered by the left truncation
2707 glyph. Improve commentary.
2708 (display_line): Fix display of continuation glyphs on GUI frames
2709 when the right fringe is turned off and variable-size fonts are
2710 used in the window. Move the code that appends a stretch glyph to
2711 produce_special_glyphs, so that it could be used for truncation
2712 and continuation glyphs alike.
2713 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2714 glyph of a suitably computed width, to align the special glyphs at
2715 the window margin. Code moved from display_line. (Bug#11832)
2716
3e91a053
GM
27172012-07-12 Glenn Morris <rgm@gnu.org>
2718
ba9e4b84
GM
2719 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2720
2721 * s/gnu-linux.h, s/hpux10-20.h:
2722 Do not unconditionally define HAVE_XRMSETDATABASE.
2723
3e91a053
GM
2724 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2725
b300b1f4
PE
27262012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2727
2728 Fix typos that broke OS X build.
2729 Reported by Randal L. Schwartz in
2730 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2731 * nsterm.m (ns_timeout): Add missing local decl.
2732 (ns_get_color): snprintf -> sprintf, to fix typo.
2733
6e777848
GM
27342012-07-12 Glenn Morris <rgm@gnu.org>
2735
3f922c37
GM
2736 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2737 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2738 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2739 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2740
0ab7b23a
GM
2741 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2742 Move PTY_OPEN to configure.
2743
6e777848
GM
2744 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2745 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2746 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2747
4a7edc24
DA
27482012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2749
2750 Use empty_unibyte_string where applicable.
2751 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2752 * lread.c (read1): Likewise.
2753 * xsettings.c (syms_of_xsettings): Likewise.
2754
308aab79
GM
27552012-07-12 Glenn Morris <rgm@gnu.org>
2756
42bd1719
GM
2757 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2758 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
2759 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2760 * s/hpux10-20.h (RUN_TIME_REMAP):
2761 * s/bsd-common.h (TABDLY): Move to configure.
2762
2763 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2764
2765 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2766
ea0bbd17 2767 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 2768 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
2769
2770 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 2771
308aab79
GM
2772 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2773 * s/template.h: Move NARROWPROTO to configure.
2774
ee1cf5cf
GM
27752012-07-11 Glenn Morris <rgm@gnu.org>
2776
30fe9bf4
GM
2777 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2778 unused since 2011-01-17 change to systty.h.
2779
ee1cf5cf
GM
2780 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2781 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2782 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2783
63e47e07
PE
27842012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2785
2786 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2787
c43fb4c3
GM
27882012-07-11 Glenn Morris <rgm@gnu.org>
2789
2790 * s/darwin.h, s/gnu-linux.h, s/template.h:
2791 Move INTERRUPT_INPUT to configure.
2792
e8df9267
DA
27932012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2794
2795 Minor adjustments to interning code.
2796 * lisp.h (intern, intern_c_string): Redefine as static inline
2797 wrappers for intern_1 and intern_c_string_1, respectively.
2798 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
2799 * lread.c (intern_1, intern_c_string_1, oblookup):
2800 Simplify Vobarray checking.
e8df9267
DA
2801 * font.c (font_intern_prop): Likewise. Adjust comment.
2802 * w32font.c (intern_font_name): Likewise.
2803
34348bd4
AS
28042012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2805
d96a1e0c
AS
2806 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2807
34348bd4
AS
2808 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2809 of Fcar/Fcdr if possible.
2810 * font.c (check_otf_features): Likewise.
2811 * fontset.c (Fnew_fontset): Likewise.
2812 * gnutls.c (Fgnutls_boot): Likewise.
2813 * minibuf.c (read_minibuf): Likewise.
2814 * msdos.c (IT_set_frame_parameters): Likewise.
2815 * xmenu.c (Fx_popup_dialog): Likewise.
2816 * w32menu.c (Fx_popup_dialog): Likewise.
2817
c8add24e
GM
28182012-07-11 Glenn Morris <rgm@gnu.org>
2819
4b575b3c
GM
2820 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2821 since nothing has defined it on these platforms.
2822
09f4e3b0
GM
2823 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2824 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2825
172bedef
GM
2826 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2827 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2828 Move CLASH_DETECTION to configure.
2829
249685df
GM
2830 * s/gnu.h: Remove file, which is now empty.
2831
c8add24e
GM
2832 * s/gnu.h, s/gnu-linux.h:
2833 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2834
b41253a3
JW
28352012-07-11 John Wiegley <johnw@newartisans.com>
2836
2837 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2838 function attribute, so we only use it if it exists in the
2839 compiler.
2840
d923b542
DA
28412012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2842
2843 Avoid call to strlen in fast_c_string_match_ignore_case.
2844 * search.c (fast_c_string_match_ignore_case): Change to use
2845 length argument. Adjust users accordingly.
2846 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2847
5ebbef1d
PE
28482012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2849
bb352260
PE
2850 Assume mkdir, rmdir.
2851 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2852 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2853
57054ddd
PE
2854 Assume rename.
2855 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2856
b747d3f7
PE
2857 Assume perror.
2858 * s/hpux10-20.h (HAVE_PERROR): Remove.
2859 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2860 Remove dummy definition, as this problem was obsolete long ago.
2861
5ebbef1d
PE
2862 Assume strerror.
2863 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2864
984e7f30
DA
28652012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2866
2867 Avoid calls to strlen in font processing functions.
2868 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
2869 (font_open_by_name): Change to use length argument.
2870 Adjust users accordingly.
d923b542
DA
2871 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2872 Adjust prototypes.
2873 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2874 Change to return ptrdiff_t.
984e7f30
DA
2875 (xfont_list_pattern, xfont_match): Use length returned by
2876 xfont_decode_coding_xlfd.
2877 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2878
20e94fdd
GM
28792012-07-11 Glenn Morris <rgm@gnu.org>
2880
9d596af3
GM
2881 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2882 Move DONT_REOPEN_PTY to configure.
2883
20e94fdd
GM
2884 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2885 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2886
e99a530f
PE
28872012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2888
22ffb973
PE
2889 Remove "#define unix" that is no longer needed (Bug#11905).
2890 * s/aix4-2.h (unix): Remove; no longer needed.
2891
e9a9ae03
PE
2892 EMACS_TIME simplification (Bug#11875).
2893 This replaces macros (which typically do not work in GDB)
2894 with functions, typedefs and enums, making the code easier to debug.
2895 The functional style also makes code easier to read and maintain.
2896 * systime.h: Include <sys/time.h> on all hosts, not just if
2897 WINDOWSNT, since 'struct timeval' is needed in general.
2898 (EMACS_TIME): Now a typedef, not a macro.
2899 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2900 not macros.
2901 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2902 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2903 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2904 (EMACS_TIME_LE): Now functions, not macros.
2905 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2906 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2907 which are not functions. All uses rewritten to use:
2908 (make_emacs_time): New function.
2909 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2910 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2911 not functions. All uses rewritten to use the following, respectively:
2912 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2913 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 2914 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
2915 * fileio.c (Fcopy_file):
2916 * xterm.c (XTflash): Get the current time closer to when it's used.
2917 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2918
ffacb126
PE
2919 * bytecode.c (targets): Suppress -Woverride-init warnings.
2920
e99a530f
PE
2921 Simplify by avoiding confusing use of strncpy etc.
2922 * doc.c (Fsnarf_documentation):
2923 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
2924 * frame.c (Fmake_terminal_frame):
2925 * gtkutil.c (get_utf8_string):
2926 * lread.c (openp):
2927 * nsmenu.m (ns_update_menubar):
2928 * regex.c (regerror):
2929 Prefer memcpy to strncpy and strncat when either will do.
2930 * fileio.c (Fsubstitute_in_file_name):
2931 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
2932 (menu_separator_name_p):
2933 * nsmenu.m (ns_update_menubar):
2934 Prefer memcmp to strncmp when either will do.
2935 * nsterm.m: Include <ftoastr.h>.
2936 (ns_get_color):
2937 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
2938 Prefer snprintf to strncpy.
2939 * nsterm.m (ns_term_init):
2940 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
2941 * nsterm.m (ns_term_init):
2942 Avoid the need for strncpy, by using build_string or
2943 make_unibyte_string directly. Use dtoastr, not snprintf.
2944 * process.c (Fmake_network_process): Diagnose service names that
2945 are too long, rather than silently truncating them or creating
2946 non-null-terminated names.
2947 (Fnetwork_interface_info): Likewise, for interface names.
2948 * sysdep.c (system_process_attributes) [GNU_LINUX]:
2949 Prefer sprintf to strncat.
2950 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
2951 Prefer vsnprintf to vsprintf + strncpy.
2952
c59592b3
GM
29532012-07-10 Glenn Morris <rgm@gnu.org>
2954
2955 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
2956 Clarify fallback case.
2957
7d7bbefd
DA
29582012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2959
2960 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
2961 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
2962 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 2963 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
2964 where argument type is known to be a Lisp_Cons.
2965
3a4c8000
TT
29662012-07-10 Tom Tromey <tromey@redhat.com>
2967
2968 * bytecode.c (BYTE_CODE_THREADED): New macro.
2969 (BYTE_CODES): New macro. Replaces all old byte-code defines.
2970 (enum byte_code_op): New type.
2971 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
2972 (exec_byte_code): Use them. Use token threading when applicable.
2973
2a0213a6
DA
29742012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2975
2976 Optimize pure C strings initialization.
2977 * lisp.h (make_pure_string): Fix prototype.
2978 (build_pure_c_string): New function, defined as static inline. This
2979 provides a better opportunity to optimize away calls to strlen when
2980 the function is called with compile-time constant argument.
2981 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
2982 argument, adjust users accordingly. Use build_pure_c_string where
2983 appropriate.
2984 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
2985 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
2986 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
2987
cb1caeaf
DA
29882012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2989
2990 Avoid calls to strlen in miscellaneous functions.
2991 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
2992 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
2993 * lread.c (openp): Likewise.
2994
c293e30c
DA
29952012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
2996
2997 Avoid calls to strlen in path processing functions.
2998 * fileio.c (file_name_as_directory): Add comment. Change to add
2999 srclen argument and return the length of result. Adjust users
3000 accordingly.
3001 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
3002 swap 1st and 2nd arguments to obey the common convention.
3003 Adjust users accordingly.
c293e30c
DA
3004 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3005
9e059e3f
GM
30062012-07-10 Glenn Morris <rgm@gnu.org>
3007
d02eb359
GM
3008 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3009 Move PENDING_OUTPUT_COUNT definition to configure.
3010
882cf227
GM
3011 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3012 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3013 * s/gnu.h (DATA_START): Move definitions to configure.
3014
af6e839f
GM
3015 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3016 We include usg5-4-common.h, which defines them both.
3017
40289a12
GM
3018 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3019 O_RDONLY already includes it).
3020
9e059e3f
GM
3021 Stop ns builds setting the EMACSLOADPATH environment variable.
3022 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3023 Now it does not set EMACSLOADPATH, just returns the load-path string.
3024 * nsterm.h: Update accordingly.
3025 * lread.c [HAVE_NS]: Include nsterm.h.
3026 (init_lread) [HAVE_NS]: Use ns_load_path.
3027 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3028
7c4e8ec0
GM
30292012-07-09 Glenn Morris <rgm@gnu.org>
3030
d4f600ff
GM
3031 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3032 since the included bsd-common.h does so.
3033
cbb31951
GM
3034 Stop ns builds setting the EMACSPATH environment variable.
3035 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3036 (ns_init_paths): Do not set EMACSPATH.
3037 * nsterm.h (ns_exec_path): Add it.
3038 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3039 Use ns_exec_path.
3040
7c4e8ec0
GM
3041 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3042
26bccfae
PE
30432012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3044
a0bee46f
PE
3045 * process.c (wait_reading_process_output): 'waitchannels' was unset
3046 when read_kbd || !NILP (wait_for_cell); fix this.
3047
5994c183
PE
3048 Add GCC-style 'const' attribute to functions that can use it.
3049 * character.h (char_resolve_modifier_mask):
3050 * keyboard.h (make_ctrl_char):
3051 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3052 (init_character_once, next_almost_prime, init_fns, init_image)
3053 (flush_pending_output, init_sound):
3054 * mem-limits.h (start_of_data):
3055 * menu.h (finish_menu_items):
3056 Add ATTRIBUTE_CONST.
3057 * emacs.c (DEFINE_DUMMY_FUNCTION):
3058 Declare the dummy function with ATTRIBUTE_CONST.
3059 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3060 Add decls with ATTRIBUTE_CONST.
3061
26bccfae
PE
3062 Minor improvements to make_formatted_string.
3063 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3064 where int is good enough, as vsprintf returns an int.
3065 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3066
a8290ec3
DA
30672012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3068
3069 Use make_formatted_string to avoid double length calculation.
3070 * lisp.h (make_formatted_string): New prototype.
3071 * alloc.c (make_formatted_string): New function.
3072 * buffer.c (Fgenerate_new_buffer_name): Use it.
3073 * dbus.c (syms_of_dbusbind): Likewise.
3074 * editfns.c (Fcurrent_time_zone): Likewise.
3075 * filelock.c (get_boot_time): Likewise.
3076 * frame.c (make_terminal_frame, set_term_frame_name)
3077 (x_report_frame_params): Likewise.
3078 * image.c (gs_load): Likewise.
3079 * minibuf.c (get_minibuffer): Likewise.
3080 * msdos.c (dos_set_window_size): Likewise.
3081 * process.c (make_process): Likewise.
3082 * xdisp.c (ensure_echo_area_buffers): Likewise.
3083 * xsettings.c (apply_xft_settings): Likewise.
3084
d01ba2f1
GM
30852012-07-09 Glenn Morris <rgm@gnu.org>
3086
3087 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3088 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3089 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3090 * nsterm.h (ns_etc_directory): Add it.
3091 * callproc.c [HAVE_NS]: Include nsterm.h.
3092 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3093
f1f924b6
DA
30942012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3095
3096 Move marker debugging code under MARKER_DEBUG.
3097 * marker.c (MARKER_DEBUG): Move marker debugging code under
3098 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3099 for bootstrap with --enable-checking (~3x slowdown reported
3100 by Juanma Barranquero <lekktu@gmail.com>).
3101 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3102
ab531b66
PE
31032012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3104
3105 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3106 See <http://bugs.gnu.org/11825#29>.
3107
c4b3bc8a
EZ
31082012-07-08 Eli Zaretskii <eliz@gnu.org>
3109
3110 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3111 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
3112 (display_line): Add commentary about displaying truncation glyphs
3113 on GUI frames.
3114 (produce_special_glyphs): Move here from term.c.
3115
3116 * term.c (produce_special_glyphs): Move to xdisp.c.
3117
3118 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3119 section.
c4b3bc8a 3120
b676b881
AS
31212012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3122
f17c5273
AS
3123 * xdisp.c (display_line): Avoid warning about implicit declaration
3124 of FRAME_FONT.
3125
298819b9
AS
3126 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3127
b676b881
AS
3128 * lisp.h: Remove empty conditional.
3129
6045c4fd
PE
31302012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3131
b3350bf9
PE
3132 * lread.c (load_path_check): Now static.
3133
6045c4fd
PE
3134 Fix some minor --with-ns problems found by static checking.
3135 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3136 (x_set_font) [!HAVE_X_WINDOWS]:
3137 * image.c (xpm_load_image) [HAVE_NS]:
3138 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3139 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3140 Remove unused local.
3141 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3142 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3143 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3144 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3145 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3146 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3147 Fix pointer signedness problem.
3148 * xfaces.c (FRAME_X_FONT_TABLE):
3149 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3150
929e7845
GM
31512012-07-07 Glenn Morris <rgm@gnu.org>
3152
3153 * lread.c (load_path_check): New function, split from init_lread.
3154 (init_lread): Reorganize. Motivation:
3155 If EMACSLOADPATH is set, check/warn about that rather than the
3156 defaults, which we are not going to use. Hence we can remove
3157 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3158 Don't warn if site-lisp directories are missing.
3159 If not installed, start from a blank load-path, since
3160 PATH_LOADSEARCH refers to the eventual installation directories.
3161
58dd0aa4
EZ
31622012-07-07 Eli Zaretskii <eliz@gnu.org>
3163
3164 Support truncation and continuation glyphs on GUI frames, when
3165 fringes are disabled. (Bug#11832)
3166 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
3167 continuation glyphs even if on GUI frames.
3168 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
3169 or both, are absent.
3170 (start_display, move_it_in_display_line_to): Handle the case of a
3171 GUI frame without a fringe to display continuation or truncation
3172 glyphs.
3173 (insert_left_trunc_glyphs): Support GUI frames: make sure
3174 truncation glyphs overwrite enough glyphs from the current line to
3175 have sufficient space in pixels.
3176 (display_line): Support truncation and continuation glyphs on GUI
3177 frames. If some spare pixels are left on the line after inserting
3178 the truncation glyphs, fill that space with a stretch glyph of a
3179 suitably computed width.
3180
3181 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3182 produce_glyphs, to support GUI sessions.
3183
31571fd7
PE
31842012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3185
5a16b9bc
PE
3186 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3187
f3047c75
PE
3188 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3189
31571fd7
PE
3190 Do not require float-time's arg to fit in time_t (Bug#11825).
3191 This works better on hosts where time_t is unsigned, and where
3192 float-time is applied to the (negative) difference between two times.
3193 * editfns.c (decode_time_components): Last arg is now double *,
3194 not int *, and means to store all the result as a double, without
3195 worrying about whether the seconds part fits in time_t.
3196 All callers changed.
3197 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3198 All callers changed.
3199 (Ffloat_time): Do not fail merely because the specified time falls
3200 outside of time_t range.
3201
4516fbef
GM
32022012-07-07 Glenn Morris <rgm@gnu.org>
3203
3204 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3205 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3206 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3207
07adc2c6
JB
32082012-07-07 Juanma Barranquero <lekktu@gmail.com>
3209
3210 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3211 Update dependencies.
3212
3213 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3214
fd573f31
PE
32152012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3216
fee5959d
PE
3217 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3218 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3219 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3220 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3221 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3222 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3223
fd573f31
PE
3224 * xfont.c (compare_font_names): Redo to omit the need for casts.
3225
ddadbc0e
AS
32262012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3227
fca8d6b6
AS
3228 * xfns.c (Fx_change_window_property): Doc fix.
3229 * w32fns.c (Fx_change_window_property): Doc fix.
3230
ddadbc0e
AS
3231 * w32fns.c (Fx_window_property): Accept the same arguments as the
3232 X Windows version. Doc fix.
3233 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3234
ed9265fc 32352012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
3236 Eli Zaretskii <eliz@gnu.org>
3237
3238 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3239 Windows-specific code from nt/config.nt moved here.
3240 Obsolete settings removed.
3241
216ee680
PE
32422012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3243
3244 * process.c: Avoid unnecessary calls to gettime.
3245 (wait_reading_process_output): Don't get the time of day
3246 when gobbling data immediately and not waiting, as there's no need
3247 for it in that case. This removes a FIXME.
3248
bdd091e4
JD
32492012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3250
3251 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3252 is defined (Bug#11768).
3253
9d44f8ce
DA
32542012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3255
3256 Fix marker debugging code.
3257 * marker.c (byte_char_debug_check): Do not perform the check
3258 if buffer is not multibyte.
090bd7cb
JB
3259 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3260 Call byte_char_debug_check with correct arguments.
9d44f8ce 3261
90fc4786
DA
32622012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3263
3264 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
3265 * marker.c (byte_char_debug_check, count_markers):
3266 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
3267 (byte_debug_flag): Remove.
3268 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3269 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3270
7b7ae965
DA
32712012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3272
4e57b342
DA
3273 Avoid code repetition in marker-related functions.
3274 * marker.c (attach_marker): New function.
3275 (Fset_marker, set_marker_restricted, set_marker_both)
3276 (set_marker_restricted_both): Use it.
3277 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3278 Consistently rename charno to charpos.
3279 (marker_position): Add eassert.
3280 (marker_byte_position): Convert to eassert.
3281
32822012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3283
3284 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 3285 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 3286 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 3287
657924ff
DA
32882012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3289
3290 Introduce fast path for the widely used marker operation.
3291 * alloc.c (build_marker): New function.
3292 * lisp.h (build_marker): New prototype.
3293 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3294 * composite.c (autocmp_chars): Likewise.
3295 * editfns.c (buildmark): Remove.
3296 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3297 (save_restriction_save): Use build_marker.
3298 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3299 * window.c (save_window_save): Likewise.
3300
041a49a6
DA
33012012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3302
3303 Do not use Fdelete_overlay in delete_all_overlays
3304 to avoid redundant calls to unchain_overlay.
3305 * buffer.c (drop_overlay): New function.
3306 (delete_all_overlays, Fdelete_overlay): Use it.
3307 * minibuf.c (get_minibuffer): Fix comment.
3308
7dca65a4
PE
33092012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3310
3311 Port to OpenBSD 5.1 amd64.
3312 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3313 This is needed for OpenBSD, and should be harmless on all BSD systems.
3314 Also, include <sys/sysctl.h>, as it should be available on all
3315 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3316 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3317 use p_pid member, not kp_proc.pid.
3318
8eb876e2
GM
33192012-07-06 Glenn Morris <rgm@gnu.org>
3320
3321 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3322
38182d90
PE
33232012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3324
3325 More xmalloc and related cleanup.
3326 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3327 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3328 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3329 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3330 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3331 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3332 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3333 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3334 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3335 * xterm.c:
3336 Omit needless casts involving void * pointers and allocation.
3337 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3338 as the former is more robust if P's type is changed.
3339 Prefer xzalloc to xmalloc + memset 0.
3340 Simplify malloc-or-realloc to realloc.
3341 Don't worry about xmalloc returning a null pointer.
3342 Prefer xstrdup to xmalloc + strcpy.
3343 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3344 growing it.
3345 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3346 alloca of a constant.
3347
6dd5a677
EZ
33482012-07-05 Eli Zaretskii <eliz@gnu.org>
3349
3350 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3351 hscroll is larger than the line width. Fixes long and futile
3352 looping inside extend_face_to_end_of_line (on a TTY) producing
3353 glyphs that are not needed and thrown away.
3354
6b312f0f
DA
33552012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3356
3357 * marker.c (set_marker_restricted_both): Simplify by using
3358 clip_to_bounds.
3359
f520ef9b
PE
33602012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3361
3362 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3363
383b7c95
JD
33642012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3365
3366 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3367 not defined (Bug#11768).
3368 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3369 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3370 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3371 followed by gtk_box_set_homogeneous (Bug#11768).
3372 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
3373 (update_theme_scrollbar_width, xg_create_scroll_bar):
3374 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
3375 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3376 (is_box_type): New function (Bug#11768).
3377 (xg_tool_item_stale_p): Call is_box_type.
5293d758 3378 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
3379 with default display (Bug#11768).
3380
d6e7bf45
EZ
33812012-07-05 Eli Zaretskii <eliz@gnu.org>
3382
3383 * xdisp.c (window_hscroll_limited): New function.
3384 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3385 coordinates when window's hscroll is set to insanely large
3386 values. (Bug#11857)
3387
431391ec
JB
33882012-07-05 Juanma Barranquero <lekktu@gmail.com>
3389
3390 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3391 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3392
23f86fce
DA
33932012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3394
3395 Cleanup xmalloc.
3396 * lisp.h (xzalloc): New prototype. Omit needless casts.
3397 * alloc.c (xzalloc): New function. Omit needless casts.
3398 * charset.c: Omit needless casts. Convert all calls to
3399 xmalloc with following memset to xzalloc.
3400 * dispnew.c: Likewise.
3401 * fringe.c: Likewise.
3402 * image.c: Likewise.
3403 * sound.c: Likewise.
3404 * term.c: Likewise.
3405 * w32fns.c: Likewise.
3406 * w32font.c: Likewise.
3407 * w32term.c: Likewise.
3408 * xfaces.c: Likewise.
3409 * xfns.c: Likewise.
3410 * xterm.c: Likewise.
3411 * atimer.c: Omit needless casts.
3412 * buffer.c: Likewise.
3413 * callproc.c: Likewise.
3414 * ccl.c: Likewise.
3415 * coding.c: Likewise.
3416 * composite.c: Likewise.
3417 * doc.c: Likewise.
3418 * doprnt.c: Likewise.
3419 * editfns.c: Likewise.
3420 * emacs.c: Likewise.
3421 * eval.c: Likewise.
3422 * filelock.c: Likewise.
3423 * fns.c: Likewise.
3424 * gtkutil.c: Likewise.
3425 * keyboard.c: Likewise.
3426 * lisp.h: Likewise.
3427 * lread.c: Likewise.
3428 * minibuf.c: Likewise.
3429 * msdos.c: Likewise.
3430 * print.c: Likewise.
3431 * process.c: Likewise.
3432 * region-cache.c: Likewise.
3433 * search.c: Likewise.
3434 * sysdep.c: Likewise.
3435 * termcap.c: Likewise.
3436 * terminal.c: Likewise.
3437 * tparam.c: Likewise.
3438 * w16select.c: Likewise.
3439 * w32.c: Likewise.
3440 * w32reg.c: Likewise.
3441 * w32select.c: Likewise.
3442 * w32uniscribe.c: Likewise.
3443 * widget.c: Likewise.
3444 * xdisp.c: Likewise.
3445 * xmenu.c: Likewise.
3446 * xrdb.c: Likewise.
3447 * xselect.c: Likewise.
3448
0497dc44
PE
34492012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3450
3451 * fileio.c (time_error_value): Check the right error number.
3452 Problem reported by Troels Nielsen in
3453 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3454
356e7178
PE
34552012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3456
4e71fd89
PE
3457 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3458 This should be fixed in a better way; see Eli Zaretskii in
3459 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3460 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3461
f0941253
PE
3462 * fileio.c (time_error_value): Rename from special_mtime.
3463 The old name's problems were noted by Eli Zaretskii in
3464 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3465
065c9eb4
PE
3466 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3467 This variable's comment says Emacs needs at least one GDB-visible
3468 symbol of type enum pvec_type, to work around GDB problems.
3469 The symbol's value doesn't matter.
3470
356e7178
PE
3471 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3472 that causes compilation to fail on pre-C99 compilers.
3473
ed9265fc 34742012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
3475
3476 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3477 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3478
3884d954
DA
34792012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3480
d209e2fb 3481 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
3482 headers for buffer_defaults and buffer_local_symbols.
3483 Reported by Juanma Barranquero <lekktu@gmail.com>.
3484
ee28be33
SM
34852012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3486
3487 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3488 * lisp.h (enum pvec_type): Use fewer bits.
3489 (PSEUDOVECTOR_SIZE_BITS): New constant.
3490 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3491 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3492 change in pvec_type.
3493 (PSEUDOVECTOR_TYPEP): New macro.
3494 (TYPED_PSEUDOVECTORP): Use it.
3495 * fns.c (internal_equal): Adapt code to extract pvectype.
3496 * emacs.c (gdb_pvec_type): Update type.
3497 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3498 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3499 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3500 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3501 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3502 abusing vector->header.next.nbytes.
3503 (live_vector_p): Use PVEC_TYPE.
3504 (mark_object): Adapt code to extract pvectype. Use switch.
3505
c7f2cd7f
PE
35062012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3507
3508 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3509 Tighten new eassert a bit.
3510
8ce70ed2
DA
35112012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3512
3513 Fix compilation with --enable-gcc-warnings and -O1
3514 optimization level.
3515 * doprnt.c (doprnt): Change type of tem to int, initialize
3516 to avoid compiler warning. Add eassert.
3517 * search.c (simple_search): Initialize match_byte to avoid
3518 compiler warning. Add eassert.
3519
dea7f1e5
PE
35202012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3521
24a212eb
PE
3522 Avoid weird behavior with large horizontal scrolls.
3523 Without this change, for example, large hscroll values would
3524 mess up Emacs's display on Fedora 15 x86, presumably due to
3525 overflows in int calculations in the display code.
3526 Also, if buffers had long lines, Emacs would freeze.
3527 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3528 (set_window_hscroll): New function, containing the old guts of
3529 Fset_window_hscroll. Return the clipped value.
3530 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3531 This avoids the need to check against PTRDIFF_MAX.
3532
dea7f1e5
PE
3533 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3534
76046526
DA
35352012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3536
3537 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3538
39adff0d
PE
35392012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3540
63807d47
PE
3541 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3542 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3543 since GCC 4.4.6 issues a bogus warning for them.
3544
39adff0d
PE
3545 Fix bugs in file timestamp newness comparisons.
3546 * fileio.c (Ffile_newer_than_file_p):
3547 * lread.c (Fload): Use full timestamp resolution of files,
3548 not just the 1-second resolution, so that files that are only
3549 slightly newer still count as newer.
3550 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3551 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3552
dbeed9a6
PE
35532012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3554
3555 * fileio.c: Improve handling of file time marker. (Bug#11852)
3556 (special_mtime): New function.
3557 (Finsert_file_contents, Fverify_visited_file_modtime):
3558 Use it to set special mtime values consistently.
3559
636334d6
AS
35602012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3561
3562 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3563 marker for non-existing file. (Bug#11852)
3564
e2017fe2
GM
35652012-07-03 Glenn Morris <rgm@gnu.org>
3566
3567 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3568 and did not make it into globals.h).
3569
404dbd37
TT
35702012-07-03 Tom Tromey <tromey@redhat.com>
3571
3572 * window.c (Fset_window_margins, Fset_window_fringes)
3573 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3574 * textprop.c (Fprevious_property_change): No longer static.
3575 * syntax.c (Fsyntax_table_p): No longer static.
3576 * process.c (Fget_process, Fprocess_datagram_address): No longer
3577 static.
3578 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3579 * keyboard.c (Fcommand_execute): No longer static.
3580 Remove EXFUN.
3581 * insdel.c (Fcombine_after_change_execute): No longer static.
3582 * image.c (Finit_image_library): No longer static.
3583 * fileio.c (Fmake_symbolic_link): No longer static.
3584 * eval.c (Ffetch_bytecode): No longer static.
3585 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
3586 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3587 No longer static.
404dbd37
TT
3588 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3589 static.
3590 * dired.c (Ffile_attributes): No longer static.
3591 * composite.c (Fcomposition_get_gstring): No longer static.
3592 * callproc.c (Fgetenv_internal): No longer static.
3593
3594 * ccl.h: Remove EXFUNs.
3595 * buffer.h: Remove EXFUNs.
3596 * dispextern.h: Remove EXFUNs.
3597 * intervals.h: Remove EXFUNs.
3598 * fontset.h: Remove EXFUN.
3599 * font.h: Remove EXFUNs.
3600 * dosfns.c (system_process_attributes): Remove EXFUN.
3601 * keymap.h: Remove EXFUNs.
3602 * lisp.h: Remove EXFUNs.
3603 * w32term.h: Remove EXFUNs.
3604 * window.h: Remove EXFUNs.
3605 * xsettings.h: Remove EXFUN.
3606 * xterm.h: Remove EXFUN.
3607
8e4fd1e1
GM
36082012-07-03 Glenn Morris <rgm@gnu.org>
3609
3610 * lisp.h (Frandom): Make it visible to C.
3611 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3612 buffer for invisible buffers. (Bug#1229)
3613
ca95b3eb
DA
36142012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3615
3616 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3617 values which aren't power of 2.
14ae4239
BT
3618 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3619 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
3620 accordingly.
3621
7555c33f
SM
36222012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3623
3624 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3625
3626 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3627
d12e8f5a
DA
36282012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3629
3630 * alloc.c (allocate_vector_block): Remove redundant
3631 calls to mallopt if DOUG_LEA_MALLOC is defined.
3632 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3633 avoid calls to mallopt if zero_vector is returned.
3634
296094c3
DA
36352012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3636
3637 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3638 is enabled, avoid dereferencing NULL current_sblock if
3639 running undumped.
3640
36429c89
DA
36412012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3642
3643 Cleanup basic buffer management.
3644 * buffer.h (struct buffer): Change layout to use generic vector
3645 marking code. Fix some comments. Change type of 'clip_changed'
3646 to bitfield. Remove unused #ifndef old.
3647 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3648 (GET_OVERLAYS_AT): Fix indentation.
3649 (for_each_per_buffer_object_at): New macro.
3650 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3651 (Fbuffer_local_variables): Use it.
3652 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3653 * alloc.c (allocate_buffer): Adjust to match new layout of
3654 struct buffer. Fix comment.
3655 (mark_overlay): New function.
3656 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3657 Lisp area of struct buffer.
3658 (mark_object): Use it. Adjust marking of misc objects
3659 and related comments.
3660
3b3e4cac
PE
36612012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3662
3663 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3664 wrapper that is not needed because the wrapped code is a no-op (zero
3665 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3666 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3667
cf5c0175
DA
36682012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3669
3670 * alloc.c (mark_buffer): Simplify. Remove prototype.
3671 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 3672 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
3673 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3674 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 3675
ca26824c
GM
36762012-06-30 Glenn Morris <rgm@gnu.org>
3677
2e4c5312
GM
3678 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3679
ca26824c
GM
3680 * epaths.in (PATH_SITELOADSEARCH): New.
3681 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3682 This is rather than relying on --enable-locallisppath elements
3683 having "site-lisp" in their names. (Bug#10208#25, 11658)
3684
0d23c240
EZ
36852012-06-30 Eli Zaretskii <eliz@gnu.org>
3686
c9240d7a
EZ
3687 * w32proc.c (sys_select): Accept and ignore one more argument.
3688
3689 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3690
0d23c240 3691 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 3692 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
3693
3694 * sysdep.c: Don't include dos.h and dosfns.h.
3695
3696 * process.c (sys_select):
3697 * msdos.c (sys_select): Accept one more argument and ignore it.
3698
3699 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3700 adapt data types and code to that.
3701
3702 * dosfns.c:
3703 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3704 which clashes with the gnulib function of the same name.
3705
af5a5a98
AS
37062012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3707
c5e4379c
AS
3708 * font.c (font_style_to_value, font_style_symbolic)
3709 (font_prop_validate_style): Add type checks for values in
3710 font_style_table.
3711
af5a5a98
AS
3712 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3713 argument.
3714 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3715 uses.
3716
8d38f461
EZ
37172012-06-29 Eli Zaretskii <eliz@gnu.org>
3718
2e5a6631
EZ
3719 * xdisp.c (try_window_id): Undo last change.
3720
8d38f461
EZ
3721 * w32.c (getwd): Adjust commentary about startup_dir.
3722 (init_environment): Always call sys_access, even in non-MSVC
3723 builds. Don't chdir to the directory of the Emacs executable.
3724 This undoes code from 1997 which was justified by the need to
3725 "avoid conflicts when removing and renaming directories". But its
3726 downside was that every relative file name was being interpreted
3727 relative to the directory of the Emacs executable, which can never
3728 be TRT. In particular, it broke sys_access when called with
3729 relative file names.
3730 (sys_access): Map GetLastError to errno.
3731
2af3565e
DA
37322012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3733
3734 * window.h (struct window): Change type of 'fringes_outside_margins'
3735 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 3736 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
3737 Adjust comment.
3738 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3739 to ptrdiff_t.
3740
c8d3a25c 37412012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 3742
c8d3a25c
GM
3743 * gnutls.c (emacs_gnutls_handshake):
3744 Add QUIT to make the loop interruptible.
57570cd3 3745
c8d3a25c 37462012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 3747
c8d3a25c
GM
3748 * charset.c (init_charset): Make lack of etc/charsets fatal.
3749
3e984ee8
DA
37502012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3751
3752 * editfns.c (region_limit): Fix type mismatch.
3753
ef884f23
DA
37542012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3755
3756 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3757 undefined. Convert from xassert to eassert.
3758 * nsmenu.m: Convert from xassert to eassert.
3759 * nsterm.m: Likewise.
3760
7d7e0027
SM
37612012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3762
3763 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3764
aa754e6a
PE
37652012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3766
3767 Avoid integer overflow on scroll-left and scroll-right.
3768 * window.c (HSCROLL_MAX): New macro.
3769 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3770 overflow when requested scroll falls outside ptrdiff_t range.
3771
80b00b08
DA
37722012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3773
3774 * window.h (struct window): Change type of 'hscroll',
3775 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3776 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3777 Adjust users accordingly.
3778 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3779 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3780 from EMACS_INT to ptrdiff_t.
3781 (make_window): Omit redundant initialization.
3782
62b2bcf6
JB
37832012-06-28 Juanma Barranquero <lekktu@gmail.com>
3784
3785 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3786
45942c7d
DA
37872012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3788
3789 * window.h (struct window): Change type of 'use_time' and
3790 'sequence_number' from Lisp_Object to int.
3791 * frame.c (make_frame): Adjust users accordingly.
3792 * print.c (print_object): Likewise.
3793 * window.c (select_window, Fwindow_use_time, make_parent_window)
3794 (make_window): Likewise.
3795
e509cfa6
DA
37962012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3797
3798 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3799 enabled with --enable-checking=[all,glyphs] configure option.
3800 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3801 adjust comments accordingly.
3802 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3803 undefined, adjust comments accordingly.
3804 * image.c: Likewise.
3805 * scroll.c: Likewise.
3806 * w32fns.c: Likewise.
3807 * w32term.c: Likewise.
3808 * xdisp.c: Likewise.
3809 * xfaces.c: Likewise.
3810 * xfns.c: Likewise.
3811 * xterm.c: Likewise.
3812
a54e2c05
DA
38132012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3814
3815 Generalize run-time debugging checks.
3816 * dispextern.h (XASSERTS): Remove.
3817 * fontset.c (xassert): Remove.
3818 Convert from xassert to eassert.
3819 * alloc.c: Convert from xassert to eassert.
3820 * bidi.c: Likewise.
3821 * dispnew.c: Likewise.
3822 * fns.c: Likewise.
3823 * fringe.c: Likewise.
3824 * ftfont.c: Likewise.
3825 * gtkutil.c: Likewise.
3826 * image.c: Likewise.
3827 * keyboard.c: Likewise.
3828 * menu.c: Likewise.
3829 * process.c: Likewise.
3830 * scroll.c: Likewise.
3831 * sound.c: Likewise.
3832 * term.c: Likewise.
3833 * w32console.c: Likewise.
3834 * w32fns.c: Likewise.
3835 * w32term.c: Likewise.
3836 * window.c: Likewise.
3837 * xdisp.c: Likewise.
3838 * xfaces.c: Likewise.
3839 * xfns.c: Likewise.
3840 * xselect.c: Likewise.
3841 * xterm.c: Likewise.
3842
1ec4b7b2
SM
38432012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3844
3845 * fns.c (maybe_resize_hash_table): Output message when growing the
3846 purify-hashtable.
3847
2014308a
DA
38482012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3849
3850 * alloc.c (allocate_string_data): Remove dead code.
3851 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3852 avoid GCC warning about unused macro.
3853
246155eb
DA
38542012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3855
3856 * alloc.c (allocate_string): Omit intervals initialization.
3857 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3858 as in make_pure_string and make_pure_c_string.
3859
43184b7b
DA
38602012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3861
d209e2fb 3862 * alloc.c (allocate_string): Fix last change.
43184b7b 3863
3fe6dd74
DA
38642012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3865
d209e2fb 3866 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
3867 to memset, add explicit initialization where appropriate.
3868
1ba6038a
GM
38692012-06-27 Glenn Morris <rgm@gnu.org>
3870
3871 * lisp.mk (lisp): Remove paths.elc.
3872
c89926a5
CY
38732012-06-27 Chong Yidong <cyd@gnu.org>
3874
3875 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3876
ed6b3510
JW
38772012-06-26 John Wiegley <johnw@newartisans.com>
3878
1ec4b7b2 3879 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
3880 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3881
ed6b3510
JW
3882 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3883 when building with Clang.
3884
8edd4a2b
SM
38852012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3886
3887 * eval.c (Fapply): Allow calling it with a single argument.
3888
f6f62d1b
EZ
38892012-06-26 Eli Zaretskii <eliz@gnu.org>
3890
3891 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3892 _stricmp and _strnicmp.
3893 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3894
62efea5e
DA
38952012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3896
3897 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3898 allocated window.
3899 (allocate_process): Likewise for new process.
8edd4a2b 3900 (allocate_terminal): Change to use offsetof.
62efea5e
DA
3901 (allocate_frame): Likewise.
3902 * frame.c (make_frame): Omit redundant initialization.
3903 * window.c (make_parent_window): Use memset.
3904 (make_window): Omit redundant initialization.
3905 * process.c (make_process): Omit redundant initialization.
3906 * terminal.c (create_terminal): Likewise.
3907
42997f4d
DA
39082012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3909
3910 * term.c (delete_tty): Remove redundant call to memset.
3911
1130ecfc
DA
39122012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3913
3914 * alloc.c: Remove build_string.
3915 * lisp.h: Define build_string as static inline. This provides
3916 a better opportunity to optimize away calls to strlen when the
3917 function is called with compile-time constant argument.
3918 * image.c (imagemagick_error): Convert to build_string.
3919 * w32proc.c (sys_spawnve): Likewise.
3920 * xterm.c (x_term_init): Likewise.
3921
cf38a720
PE
39222012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3923
99027bdd
PE
3924 Use sprintf return value instead of invoking strlen on result.
3925 In the old days this wasn't portable, since some sprintf
3926 implementations returned char *. But they died out years ago and
3927 Emacs already assumes sprintf returns int.
3928 Similarly for float_to_string.
3929 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
3930 * ccl.c (ccl_driver):
3931 * character.c (string_escape_byte8):
3932 * data.c (Fnumber_to_string):
3933 * doprnt.c (doprnt):
3934 * print.c (print_object):
3935 * xdisp.c (message_dolog):
3936 * xfns.c (syms_of_xfns):
3937 Use sprintf or float_to_string result to avoid need to call strlen.
3938 * data.c (Fnumber_to_string):
3939 Use make_unibyte_string, since the string must be ASCII.
3940 * lisp.h, print.c (float_to_string): Now returns int length.
3941 * term.c (produce_glyphless_glyph):
3942 Use sprintf result rather than recomputing it.
3943
cf38a720
PE
3944 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
3945 * Makefile.in (ALL_CFLAGS):
3946 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
3947 * gmalloc.c, regex.c: Include <config.h> unconditionally.
3948
3511c784
DA
39492012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3950
0a08eb21 3951 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
3952 strcasecmp if available.
3953 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
3954
fb7da12e
AS
39552012-06-25 Andreas Schwab <schwab@linux-m68k.org>
3956
3957 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
3958 Avoid comma operator.
3959 * menu.c (push_submenu_start, push_submenu_end)
3960 (push_left_right_boundary, push_menu_pane): Likewise.
3961 * msdos.c (dos_rawgetc): Likewise.
3962
afa2ffd8
DA
39632012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3964
3965 * xfns.c (xic_create_fontsetname): Remove redundant calls
3966 to memset.
3967
b3b4476b
PE
39682012-06-25 Paul Eggert <eggert@cs.ucla.edu>
3969
4495ff38
PE
3970 * gtkutil.c (get_utf8_string): Remove redundant assignment.
3971 sprintf already null-terminates its output.
3972
b3b4476b
PE
3973 * xfns.c (x_window): Remove redundant cast.
3974
b00876c9
DA
39752012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
3976
3977 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
3978 `const char *' to `char *' to avoid compiler warning.
3979
d188e26b
PE
39802012-06-24 Paul Eggert <eggert@cs.ucla.edu>
3981
885d1d74
PE
3982 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
3983 instead of truncating it to 63 (admittedly a generous limit).
3984
d188e26b
PE
3985 * process.c: Fix spelling and caps in comments.
3986
e2f560b1
DN
39872012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
3988
e86db54b 3989 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
3990 * sysdep.c (setpgrp): Remove definition, not used in this file.
3991
7583a3a1
JB
39922012-06-24 Juanma Barranquero <lekktu@gmail.com>
3993
3994 * makefile.w32-in: Update dependencies.
3995
696056c2
EZ
39962012-06-24 Eli Zaretskii <eliz@gnu.org>
3997
3998 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
3999 (SYSTIME_H): Add nt/inc/sys/time.h.
4000
4001 * systime.h [WINDOWSNT]: Include sys/time.h.
4002
4003 * s/ms-w32.h (struct timespec): Definition moved from
4004 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4005
845ca893
PE
40062012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4007
4008 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4009 * buffer.h (buffer_slot_type_mismatch):
4010 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4011 * eval.c (unwind_to_catch):
4012 * image.c (my_png_error, my_error_exit):
4013 * keyboard.c (quit_throw_to_read_char, user_error)
4014 (Fexit_recursive_edit, Fabort_recursive_edit):
4015 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4016 (wrong_type_argument, buffer_overflow, __executable_start)
4017 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4018 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4019 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4020 (fatal):
4021 (child_setup) [!DOS_NT]:
4022 * lread.c (end_of_file_error, invalid_syntax):
4023 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4024 * puresize.h (pure_write_error):
4025 * search.c (matcher_overflow):
4026 * sound.c (sound_perror, alsa_sound_perror):
4027 * sysdep.c, syssignal.h (croak):
4028 * term.c (maybe_fatal, vfatal):
4029 * textprop.c (text_read_only):
4030 * undo.c (user_error):
4031 * unexmacosx.c (unexec_error):
4032 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4033 Use _Noreturn rather than NO_RETURN.
4034 No need for separate decl merely because of _Noreturn.
4035 * sound.c (sound_warning, parse_sound):
4036 Remove unnecessary forward decls.
4037
f1dd8073
PE
40382012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4039
4040 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4041 * lisp.h (WAIT_READING_MAX): New macro.
4042 * dispnew.c (Fsleep_for, sit_for):
4043 * keyboard.c (kbd_buffer_get_event):
4044 * process.c (Faccept_process_output):
4045 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4046 This improves on the previous patch, which introduced a bug
4047 when time_t is unsigned and as wide as intmax_t.
4048 See <http://bugs.gnu.org/9000#51>.
4049
b82c1755
EZ
40502012-06-23 Eli Zaretskii <eliz@gnu.org>
4051
4052 * dispnew.c (sit_for, Fsleep_for):
4053 * keyboard.c (kbd_buffer_get_event):
4054 * process.c (Faccept_process_output): Avoid compiler warnings when
4055 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4056
ca300656
JB
40572012-06-23 Juanma Barranquero <lekktu@gmail.com>
4058
049ec95b
JB
4059 * makefile.w32-in: Update dependencies.
4060
ca300656
JB
4061 * w32.c (ltime): Add return type and declare static.
4062 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4063
db7b8d06
PE
40642012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4065
4066 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4067 Privately reported by Herbert J. Skuhra.
4068 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4069 All uses changed.
4070 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4071 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4072
0bd8297f
EZ
40732012-06-23 Eli Zaretskii <eliz@gnu.org>
4074
96512555
EZ
4075 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4076 last argument of make_unibyte_string.
4077
0bd8297f
EZ
4078 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4079 language ID in the event parameters.
4080
4081 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4082 event.code, not the obscure "character set ID".
4083
63def6b6
CY
40842012-06-23 Chong Yidong <cyd@gnu.org>
4085
4086 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4087
e8a02204
EZ
40882012-06-23 Eli Zaretskii <eliz@gnu.org>
4089
388cdec0
EZ
4090 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4091 * w32.c (fdutimens): New function.
4092
4093 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4094
4095 * s/ms-w32.h (pselect): Redirect to sys_select.
4096
4097 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4098
e8a02204
EZ
4099 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4100 in the logic of incrementing and decrementing the value of
4101 use_relocatable_buffers.
4102
d054f3fb
PE
41032012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4104
4105 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4106 Privately reported by Herbert J. Skuhra.
4107 [__FreeBSD__]: Remove "*/" typo after "#include".
4108 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4109 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4110 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4111 Don't assume EMACS_TIME and struct timeval are the same type.
4112
d35af63c
PE
41132012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4114
4115 Support higher-resolution time stamps (Bug#9000).
4116 The time stamps are only nanosecond-resolution at the C level,
4117 since that's the best that any real-world system supports now.
4118 But they are picosecond-resolution at the Lisp level, as that's
4119 easy, and leaves room for future OS improvements.
4120
4121 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4122 (LIBES): Use it.
4123
4124 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4125 Don't get current time unless it's needed.
4126
4127 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4128 now provides it if it's absent.
4129 (start_atimer): Port to higher-res time stamps.
4130 Check for time stamp overflow. Don't get current time more
4131 often than is needed.
4132
4133 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4134 Include systime.h, not time.h.
4135 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4136
4137 * dired.c: Include stat-time.h.
4138 (Ffile-attributes): File times now have higher resolution.
4139
4140 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4141 (struct image): Timestamp now has higher resolution.
4142
4143 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4144 has at least microseconds now. All uses removed.
4145 (update_frame, update_single_window, update_window, update_frame_1)
4146 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 4147 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
4148
4149 * editfns.c (time_overflow): Now extern.
4150 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4151 (float-time, Fformat_time_string, Fcurrent_time_string)
4152 (Fcurrent_time_zone): Accept and generate higher-resolution
4153 time stamps.
4154 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4155 (decode_time_components, lisp_seconds_argument): New functions.
4156 (make_time): Now static.
4157 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4158 Report an error if the time is invalid, rather than having the caller
4159 do that.
4160
4161 * fileio.c: Include <stat-time.h>
4162 (Fcopy_file): Copy higher-resolution time stamps.
4163 Prefer to set the time stamp via a file descriptor if that works.
4164 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4165 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4166 (Fvisited_file_modtime, Fset_visited_file_modtime):
4167 Support higher-resolution time stamps.
4168
4169 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4170
4171 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4172
4173 * image.c (prepare_image_for_display, clear_image_cache)
4174 (lookup_image): Port to higer-resolution time stamps.
4175
4176 * keyboard.c (start_polling, bind_polling_period):
4177 Check for time stamp overflow.
4178 (read_char, kbd_buffer_get_event, timer_start_idle)
4179 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4180 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4181 Port to higher-resolution time stamps. Do not assume time_t is signed.
4182 (decode_timer): New function. Timers are now vectors of length 9,
4183 not 8, to accommodate the picosecond component.
4184 (timer_check_2): Use it.
4185
4186 * nsterm.m (select_timeout, timeval_subtract): Remove.
4187 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4188 as they're a bit more accurate and handle overflow better.
4189 (ns_select): Change prototype to be compatible with pselect.
4190 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4191 * nsterm.h (ns_select): Adjust prototype.
4192
4193 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4194 us-resolution time stamps.
4195 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4196
4197 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4198
4199 * lisp.h (time_overflow): New decl.
4200 (wait_reading_process_output): First arg is now intmax_t, not int,
4201 to accommodate larger waits.
4202
4203 * process.h (struct Lisp_Process.read_output_delay):
4204 Now counts nanoseconds, not microseconds.
4205 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4206 EMACS_HAS_USECS.
4207 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4208 (wait_reading_process_output):
4209 Port to ns-resolution time stamps.
4210 (Faccept_process_output, wait_reading_process_output):
4211 Check for time stamp overflow. Do not assume time_t is signed.
4212 (select_wrapper): Remove; we now use pselect.
4213 (Fprocess_attributes): Now generates ns-resolution time stamps.
4214
4215 * sysdep.c: Include utimens.h. Don't include utime.h
4216 or worry about struct utimbuf; gnulib does that for us now.
4217 (gettimeofday): Remove; gnulib provides a substitute.
4218 (make_timeval): New function.
4219 (set_file_times): Now sets ns-resolution time stamps.
4220 New arg FD; all uses changed.
4221 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4222 (system_process_attributes):
4223 Now returns ns-resolution time stamp. All uses changed.
4224 Check for time stamp overflow.
4225
4226 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4227 provides a substitute now.
4228
4229 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4230 since it guarantees struct timespec.
4231 (EMACS_TIME): Now struct timespec, so that we can support
4232 ns-resolution time stamps.
4233 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4234 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4235 (EMACS_USECS): Remove.
4236 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4237 so multiply the arg by 1000 before storing it.
4238 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4239 New macros.
4240 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4241 Port to ns-resolution time stamps.
4242 (EMACS_TIME_NEG_P): Remove; replaced by....
4243 (EMACS_TIME_SIGN): New macro.
4244 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4245 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4246 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4247 (make_timeval, make_lisp_time, decode_time_components): New decls.
4248 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4249 that it mishandled time_t overflow. You can't compare by subtracting!
4250 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4251 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4252
4253 * term.c: Include <sys/time.h>.
4254 (timeval_to_Time): New function, for proper overflow wraparound.
4255 (term_mouse_position, term_mouse_click): Use it.
4256
4257 * undo.c (record_first_change): Support higher-resolution time stamps
4258 in the undo buffer.
4259 (Fprimitive_undo): Use them when restoring time stamps.
4260
4261 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4262 (w32_get_internal_run_time):
4263 Port to higher-resolution Emacs time stamps.
4264 (ltime): Now accepts single 64-bit integer, as that's more convenient
4265 for callers.
4266
4267 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4268
4269 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4270 for compatibility with pselect. Support ns-resolution time stamps.
4271
4272 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4273
4274 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4275 Check for time stamp overflow, and support ns-resolution time stamps.
4276
4277 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4278 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4279 (timeval_subtract): Remove; no longer needed.
4280 (XTflash, XTring_bell, x_wait_for_event):
4281 Port to ns-resolution time stamps. Don't assume time_t is signed.
4282
b6a92dfe
CY
42832012-06-22 Chong Yidong <cyd@gnu.org>
4284
4285 * xdisp.c (x_consider_frame_title): Revert last change.
4286
d251c37c
EZ
42872012-06-22 Eli Zaretskii <eliz@gnu.org>
4288
4289 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4290 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4291 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4292 staticidx goes up to 1597 out of 1600 = 0x640.)
4293
f10deafb
PE
42942012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4295
4296 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4297 Otherwise, the umask might be mistakenly 0 while handling input signals.
4298
ec6de1e2
SM
42992012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4300
4301 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4302
28be1ada
DA
43032012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4304
4305 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4306 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4307 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4308 access to `contents' member of Lisp_Vector objects with AREF and ASET
4309 where appropriate.
4310
c6bf3022
CY
43112012-06-19 Chong Yidong <cyd@gnu.org>
4312
4313 * frame.c (delete_frame): When selecting a frame on a different
4314 text terminal, do not alter the terminal's top-frame.
4315
4316 * xdisp.c (format_mode_line_unwind_data): Record the target
4317 frame's selected window and its terminal's top-frame.
4318 (unwind_format_mode_line): Restore them.
4319 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4320 Callers changed.
4321 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4322 since tty frames can be explicitly named.
4323 (prepare_menu_bars): Likewise.
4324
4325 * term.c (Ftty_top_frame): New function.
4326
defd4196
PE
43272012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4328
4329 Port byte-code-meter to modern targets.
4330 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4331 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 4332 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
4333 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4334 (METER_1, METER_2): Simplify.
4335
1053a871
SM
43362012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4337
4338 * data.c (Fdefalias): Return `symbol' (bug#11686).
4339
b7e8d081
MR
43402012-06-18 Martin Rudalics <rudalics@gmx.at>
4341
4342 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
4343 gets killed during executing of this function (Bug#11665).
4344 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
4345 (Vkill_buffer_query_functions): In doc-string say that functions
4346 run by this hook should not change the current buffer.
4347
7ea2b339
PE
43482012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4349
4350 Fix recently-introduced process.c problems found by static checking.
4351 * process.c (write_queue_push, write_queue_pop, send_process):
4352 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4353 (write_queue_pop): Fix pointer signedness problem.
4354 (send_process): Remove unused local.
4355
96a313a1
CY
43562012-06-17 Chong Yidong <cyd@gnu.org>
4357
4358 * xdisp.c (redisplay_internal): No need to redisplay terminal
4359 frames that are not on top.
4360
20ca2e94
TN
43612012-06-17 Troels Nielsen <bn.troels@gmail.com>
4362
4363 * process.c (make_process): Initialize write_queue.
4364 (write_queue_push, write_queue_pop): New functions.
4365 (send_process): Use them to maintain correct ordering of process
4366 writes (Bug#10815).
4367
9a900ca9
PE
43682012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4369
310fbfa8
PE
4370 * lisp.h (eassert): Assume C89 or later.
4371 This removes the need for CHECK.
4372 (CHECK): Remove. Its comments about always evaluating its
4373 argument were confusing, as 'eassert' typically does not evaluate
4374 its argument.
4375
27bb1ca4
PE
4376 * coding.c (produce_chars): Use ptrdiff_t, not int.
4377
9a900ca9
PE
4378 * xterm.c (x_draw_underwave): Check for integer overflow.
4379 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4380
41b7f8bc 43812012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
4382
4383 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4384 referenced (Bug#11583).
4385
9b0e3eba
AA
43862012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4387
4388 Implement wave-style variant of underlining.
4389 * dispextern.h (face_underline_type): New enum.
4390 (face): Add field for underline type.
4391 * nsterm.m (ns_draw_underwave): New function.
4392 (ns_draw_text_decoration): Use it.
4393 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4394 New functions.
4395 (x_draw_glyph_string): Use them.
4396 * xfaces.c (Qline, Qwave): New Lisp objects.
4397 (check_lface_attrs, merge_face_ref)
1053a871
SM
4398 (Finternal_set_lisp_face_attribute, realize_x_face):
4399 Handle wave-style underline face attributes.
9b0e3eba
AA
4400 * xterm.c (x_draw_underwave): New function.
4401 (x_draw_glyph_string): Use it.
4402
0fb52f11
JB
44032012-06-16 Juanma Barranquero <lekktu@gmail.com>
4404
4405 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4406 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4407 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4408 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4409 ($(BLD)/w32select.$(O)): Update dependencies.
4410
e5560ff7
AS
44112012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4412
4413 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4414 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4415 * character.c (_fetch_multibyte_char_p): Remove.
4416 * alloc.c: Include "character.h" before "buffer.h".
4417 * bidi.c: Likewise.
4418 * buffer.c: Likewise.
4419 * bytecode.c: Likewise.
4420 * callint.c: Likewise.
4421 * callproc.c: Likewise.
4422 * casefiddle.c: Likewise.
4423 * casetab.c: Likewise.
4424 * category.c: Likewise.
4425 * cmds.c: Likewise.
4426 * coding.c: Likewise.
4427 * composite.c: Likewise.
4428 * dired.c: Likewise.
4429 * dispnew.c: Likewise.
4430 * doc.c: Likewise.
4431 * dosfns.c: Likewise.
4432 * editfns.c: Likewise.
4433 * emacs.c: Likewise.
4434 * fileio.c: Likewise.
4435 * filelock.c: Likewise.
4436 * font.c: Likewise.
4437 * fontset.c: Likewise.
4438 * fringe.c: Likewise.
4439 * indent.c: Likewise.
4440 * insdel.c: Likewise.
4441 * intervals.c: Likewise.
4442 * keyboard.c: Likewise.
4443 * keymap.c: Likewise.
4444 * lread.c: Likewise.
4445 * macros.c: Likewise.
4446 * marker.c: Likewise.
4447 * minibuf.c: Likewise.
4448 * nsfns.m: Likewise.
4449 * nsmenu.m: Likewise.
4450 * print.c: Likewise.
4451 * process.c: Likewise.
4452 * regex.c: Likewise.
4453 * region-cache.c: Likewise.
4454 * search.c: Likewise.
4455 * syntax.c: Likewise.
4456 * term.c: Likewise.
4457 * textprop.c: Likewise.
4458 * undo.c: Likewise.
4459 * unexsol.c: Likewise.
4460 * w16select.c: Likewise.
4461 * w32fns.c: Likewise.
4462 * w32menu.c: Likewise.
4463 * window.c: Likewise.
4464 * xdisp.c: Likewise.
4465 * xfns.c: Likewise.
4466 * xmenu.c: Likewise.
4467 * xml.c: Likewise.
4468 * xselect.c: Likewise.
4469
2f07e6af
EZ
44702012-06-16 Eli Zaretskii <eliz@gnu.org>
4471
1053a871
SM
4472 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4473 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 4474 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
4475 row.
4476 (handle_face_prop): Use chunk-relative overlay string index when
4477 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
4478 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4479 the rightmost. (Bug#11720)
2f07e6af 4480
29b83cec
AS
44812012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4482
4483 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4484 (CATEGORY_MEMBER): Enforce 1/0 value.
4485 * category.c (_temp_category_set): Remove.
4486
4c5501e9
EZ
44872012-06-16 Eli Zaretskii <eliz@gnu.org>
4488
4489 * window.c (Fdelete_other_windows_internal)
4490 (Fdelete_window_internal): Don't access frame's mouse highlight
4491 info of the initial frame. (Bug#11677)
4492
2b570124
PE
44932012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4494
e93864f9
PE
4495 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4496 Assume USE_2_TAGS_FOR_INTS.
4497 (xreload): Adjust $tagmask width to match recent lisp.h change.
4498
2b570124
PE
4499 Simplify lisp.h in minor ways that should not affect code.
4500 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4501 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4502 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4503 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4504 (INTTYPEBITS): New macro, for clarity.
4505 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
4506 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4507 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
4508 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4509 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4510
81755f69
JB
45112012-06-13 Juanma Barranquero <lekktu@gmail.com>
4512
4513 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4514
16192a57
GM
45152012-06-13 Glenn Morris <rgm@gnu.org>
4516
4517 * s/bsd-common.h (BSD4_3):
4518 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4519
646b5f55
AS
45202012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4521
4522 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4523 instead of union.
4524 (XLI, XIL): Define.
1053a871
SM
4525 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4526 Use them.
4527 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 4528 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 4529 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
4530 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4531 * frame.c (delete_frame): Remove outdated comment.
4532 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4533 USE_LISP_UNION_TYPE.
4534 (Fw32_unregister_hot_key): Likewise.
4535 (Fw32_toggle_lock_key): Likewise.
4536 * w32menu.c (add_menu_item): Likewise.
4537 (w32_menu_display_help): Use XIL instead of checking
4538 USE_LISP_UNION_TYPE.
4539 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4540 (init_heap): Likewise.
4541 * w32term.c (w32_read_socket): Update comment.
4542
1d3823c9
GM
45432012-06-13 Glenn Morris <rgm@gnu.org>
4544
c62ff706
GM
4545 * s/usg5-4-common.h, src/s/unixware.h:
4546 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4547
1d3823c9
GM
4548 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4549
bfe3e0a2
PE
45502012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4551
4552 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4553 * alloc.c (make_number) [!defined make_number]:
4554 Remove, as lisp.h always defines this now.
4555 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4556 (roundup_size): Verify that it is a power of 2.
4557 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4558 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4559 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4560 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4561 USE_LSB_TAG now is always defined to be either 0 or 1.
4562 All uses changed.
4563 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4564 code works fine either way, and efficiency is not a concern here,
4565 as the union type is for debugging, not for production.
4566 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4567 Use an inline function on all platforms when using the union type,
4568 since this is simpler and 'static inline' can be used portably
4569 within Emacs now.
4570 (LISP_INITIALLY_ZERO): New macro.
4571 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4572 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4573
45fa9c0f
GM
45742012-06-12 Glenn Morris <rgm@gnu.org>
4575
b4492cba
GM
4576 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4577
4578 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 4579
45fa9c0f
GM
4580 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4581 Move BROKEN_SIGIO to configure.
4582
4583 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4584 Move NO_TERMIO to configure.
4585
0e25d334
CY
45862012-06-12 Chong Yidong <cyd@gnu.org>
4587
4588 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4589 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4590 MagickExportImagePixels is undefined.
4591
43682bb6
PE
45922012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4593
4594 * image.c (imagemagick_load_image): Remove unused label.
4595
a9be7d2b
GM
45962012-06-11 Glenn Morris <rgm@gnu.org>
4597
4598 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4599 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4600 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4601 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4602
3017f87f
SM
46032012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4604
4605 * alloc.c (make_byte_code): New function.
4606 (Fmake_byte_code): Use it. Don't purify here.
4607 * lread.c (read1): Use it as well to avoid extra allocation.
4608
1b9b4cf4
CY
46092012-06-11 Chong Yidong <cyd@gnu.org>
4610
4611 * image.c (imagemagick_load_image): Implement transparency.
4612
95988fcf
AS
46132012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4614
4615 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4616 account for preceding backslashes. (Bug#11663)
4617
cd4eb164
CY
46182012-06-09 Chong Yidong <cyd@gnu.org>
4619
4620 * term.c: Support italics in capable terminals (Bug#9652).
4621 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4622 (turn_on_face): Output using TS_enter_italic_mode if available.
4623 Don't handle unused blinking and alt-charset cases.
4624 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4625 and tty_alt_charset_p cases.
4626 (tty_capable_p, init_tty): Support italics.
4627
4628 * termchar.h (struct tty_display_info): Add field for italics.
4629 Remove unused blink field.
4630
4631 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4632 Handle slant.
4633
4634 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4635 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4636 tty_alt_charset_p. Add tty_italic_p.
4637
ff88beb8
MA
46382012-06-09 Michael Albinus <michael.albinus@gmx.de>
4639
4640 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4641 dbus_type_is_basic if available.
4642 (xd_extract_signed, xd_extract_unsigned): Rename from
4643 extract_signed and extract_unsigned, respectively. Adapt callers.
4644
44286096
CY
46452012-06-09 Chong Yidong <cyd@gnu.org>
4646
1682701f
CY
4647 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4648
44286096
CY
4649 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4650 case (Bug#9752).
4651
d86feb17
PE
46522012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4653
4654 * xdisp.c (vmessage): Treat frame message as multibyte.
4655 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4656 would generate the diagnostic "Making \302\247 buffer-local while
4657 let-bound!".
4658
d5c20fe8
EZ
46592012-06-08 Eli Zaretskii <eliz@gnu.org>
4660
4661 * dispnew.c (showing_window_margins_p): Undo last change, which
4662 was done due to an inadvertent commit.
4663 (adjust_frame_glyphs_for_frame_redisplay): Do call
4664 showing_window_margins_p.
4665
513749ee
SM
46662012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4667
4668 * eval.c (Fmake_var_non_special): New primitive.
4669 (syms_of_eval): Defsubr it.
4670 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4671
d4a8f5c1
JB
46722012-06-08 Juanma Barranquero <lekktu@gmail.com>
4673
4674 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4675 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4676
8bbbc977
EZ
46772012-06-08 Eli Zaretskii <eliz@gnu.org>
4678
4679 * alloc.c (allocate_vectorlike): Fix last change.
4680
f3372c87
DA
46812012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4682
4683 Block-based vector allocation of small vectors.
4684 * lisp.h (struct vectorlike_header): New field `nbytes',
4685 adjust comment accordingly.
4686 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4687 to denote vector blocks. Adjust users (live_vector_p,
4688 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4689 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4690 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4691 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4692 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4693 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4694 (roundup_size): New constant.
4695 (struct vector_block): New data type.
4696 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 4697 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
4698 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4699 (sweep_vectors): New functions.
4700 (allocate_vectorlike): Return `zero_vector' as the only vector of
4701 0 items. Allocate new vector from block if vector size is less than
4702 or equal to VBLOCK_BYTES_MAX.
4703 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4704 (init_alloc_once): Add call to init_vectors.
4705
4f18a4ed
SM
47062012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4707
4708 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4709
86f158bc
PE
47102012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4711
4712 * doprnt.c (doprnt): Truncate multibyte char correctly.
4713 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4714 would mishandle a string argument "Xc" if X was a multibyte
4715 character of length 2: it would truncate after X's first byte
4716 rather than including all of X.
4717
c5cfcbe0
CY
47182012-06-06 Chong Yidong <cyd@gnu.org>
4719
4720 * buffer.c (word_wrap): Doc fix.
4721
c05cf390
PE
47222012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4723
4724 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4725
0c3461de
GM
47262012-06-03 Glenn Morris <rgm@gnu.org>
4727
4728 * xdisp.c (tool-bar-style): Doc fix.
4729
c71232db
UM
47302012-06-03 Ulrich Müller <ulm@gentoo.org>
4731
4732 * Makefile.in (PAXCTL): Define.
4733 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4734 binary via PaX flags if the paxctl utility is available.
4735 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4736 Restore PaX flags to their default. (Bug#11398)
4737
383f7350
CY
47382012-06-03 Chong Yidong <cyd@gnu.org>
4739
4740 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4741 buffer (Bug#11226).
4742
5f2c76c6
CY
47432012-06-03 Chong Yidong <cyd@gnu.org>
4744
4745 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4746 (note_mode_line_or_margin_highlight): If there is no help echo,
4747 use mode-line-default-help-echo. Handle the case where the mouse
4748 position is past the end of the mode line string.
4749
4750 * buffer.c (buffer_local_value_1): New function, split from
4751 Fbuffer_local_value; can return Qunbound.
4752 (Fbuffer_local_value): Use it.
4753 (Vmode_line_format): Docstring tweaks.
4754
773d47f6
PE
47552012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4756
4757 * sysdep.c (system_process_attributes): Improve comment.
4758
f2d6a3df
SM
47592012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4760
4761 * keyboard.c: Export real-this-command to Elisp.
4762 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4763 and DEFVAR it. Update all users.
4764
63810350
PE
47652012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4766
7bd5c1f4
PE
4767 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4768
63810350
PE
4769 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4770 Convert pctcpu and pctmem to Lisp float properly.
4771 Let the compiler fold better, as 100.0/0x8000 is exact.
4772
a2821611
AS
47732012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4774
4775 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4776 cons_block.
4777
5fceba1d
PE
47782012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4779
4780 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4781
c98ff5dd
DA
47822012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4783
4784 For a 'struct window', replace some Lisp_Object fields to
4785 bitfields where appropriate, remove unused fields.
4786 * window.h (struct window): Remove unused 'last_mark_x' and
4787 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4788 change it's type from Lisp_Object to bitfield.
4789 Change type of 'force_start', 'optional_new_start',
4790 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4791 fields from Lisp_Object to bitfield. Adjust users accordingly.
4792
ca34e0be
PE
47932012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4794
4795 Pacify gcc -Wdouble-precision when using Xaw.
4796 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4797 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4798 Use 'float' consistently, rather than 'float' in most places
4799 and 'double' in a couple of places.
4800
efc00ab1 48012012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
4802
4803 * xdisp.c (handle_stop): Detect whether we have overlay strings
4804 loaded by testing it->current.overlay_string_index to be
4805 non-negative, instead of checking whether n_overlay_strings is
4806 positive. (Bug#11587)
4807
efc00ab1 48082012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
4809
4810 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4811
4812 * doc.c (Fsubstitute_command_keys): Doc fix.
4813
efc00ab1 48142012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
4815
4816 * search.c (search_buffer): Remove calls to
4817 r_alloc_inhibit_buffer_relocation, as it is now called by
4818 maybe_unify_char, which was the cause of relocation of buffer text
4819 in bug#11519.
4820
efc00ab1 48212012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
4822
4823 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4824 for the duration of call to load_charset, to avoid problems with
4825 callers of maybe_unify_char that access buffer text through C
4826 pointers.
4827
4828 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4829 decrement the inhibition flag, instead of just setting or
4830 resetting it.
4831
ba93a187
PE
48322012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4833
4834 Remove obsolete '#define static' cruft.
4835 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4836 This #undef was "temporary" in 2000; it is no longer needed
4837 now that '#define static' has gone away.
4838 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4839 (gray_bitmap_bits): Remove; no longer needed.
4840 All uses replaced with definiens.
4841 * xterm.c: Include "bitmaps/gray.xbm".
4842
9e4bf381
PE
48432012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4844
4845 Clean up __executable_start, monstartup when --enable-profiling.
4846 The following changes affect the code only when profiling.
4847 * dispnew.c (__executable_start): Rename from safe_bcopy.
4848 Define only on platforms that need it.
4849 * emacs.c: Include <sys/gmon.h> when profiling.
4850 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4851 (__executable_start): Remove decl, since lisp.h does it now.
4852 (safe_bcopy): Remove decl; no longer has that name.
4853 (main): Coalesce #if into single bit of code, for simplicity.
4854 Cast pointers to uintptr_t, since standard libraries want integers
4855 and not pointers.
4856 * lisp.h (__executable_start): New decl.
4857
32d72c2f
GM
48582012-05-31 Glenn Morris <rgm@gnu.org>
4859
4860 * image.c (Fimagemagick_types): Doc fix.
4861
baac5bc7
JM
48622012-05-30 Jim Meyering <meyering@redhat.com>
4863
4864 * callproc.c (Fcall_process_region): Include directory component
4865 in mkstemp error message (Bug#11586).
4866
72cb32cf
PE
48672012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4868
4869 * alloc.c, lisp.h (make_pure_vector): Now static.
4870
61b108cc
SM
48712012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4872
4873 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4874 Move to byte-run.el.
4875 (Fautoload): Do the hash-doc more carefully.
4876 * data.c (Fdefalias): Purify definition, except for keymaps.
4877 (Qdefun): Move from eval.c.
4878 * lisp.h (Qdefun): Remove.
4879 * lread.c (read1): Tiny simplification.
4880
471fe23d
TN
48812012-05-29 Troels Nielsen <bn.troels@gmail.com>
4882
934f3f58 4883 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
4884 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4885 Bug#9642, but explicitly check that the buffer the overlay would
4886 be moved to is live and rearrange lines to make sure that errors
4887 will not put the overlay in an inconsistent state.
4888 (Fdelete_overlay): Cosmetics.
4889
85d0efd1
EZ
48902012-05-28 Eli Zaretskii <eliz@gnu.org>
4891
4892 * w32term.c (my_bring_window_to_top): New function.
4893 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
4894 could be different from the original one.
4895 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
4896 (Bug#11513)
4897
4898 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4899 by calling BringWindowToTop.
4900
4901 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4902 (WM_EMACS_END): Increase by one.
4903
da92a98c
PE
49042012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4905
4906 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4907 This avoids undefined behavior that might cause the eassert
4908 to not catch an out-of-range value.
4909
74d1f848
JB
49102012-05-28 Juanma Barranquero <lekktu@gmail.com>
4911
4912 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4913 Update dependencies.
4914
9e1a06fc
EZ
49152012-05-27 Eli Zaretskii <eliz@gnu.org>
4916
4917 * bidi.c (bidi_mirror_char): Fix last change.
4918
f3dd7312
AS
49192012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4920
4921 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4922 when referring to sectname field in printf format.
4923
81899c91
PE
49242012-05-27 Paul Eggert <eggert@cs.ucla.edu>
4925
57b81a9f
PE
4926 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
4927 Only r_alloc_inhibit_buffer_relocation needed to be added;
4928 the others were already declared.
4929
81899c91
PE
4930 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
4931 before checking whether it's out of range. Put the check inside
4932 eassert. See
4933 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
4934
33017faf 49352012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
4936
4937 * callproc.c (Fcall_process): Restore a line that was accidentally
4938 commented out in the 2011-02-13 change (bug#11547).
4939
33017faf 49402012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
4941
4942 * lisp.h [REL_ALLOC]: Add prototypes for external functions
4943 defined on ralloc.c.
4944
4945 * buffer.c [REL_ALLOC]: Remove prototypes of
4946 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
4947 they are now on lisp.h.
4948
4949 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
4950
4951 * search.c (search_buffer): Use it to inhibit relocation of buffer
4952 text while re_search_2 is doing its job, because re_search_2 is
4953 passed C pointers to buffer text. (Bug#11519)
4954
23415acf
EZ
4955 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
4956 Update value to 24.
4957
44e27368
EZ
4958 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
4959 state after an additional call to move_it_in_display_line_to, keep
4960 the values of it->max_ascent and it->max_descent found for the
4961 entire line.
4962 (pos_visible_p): Revert the comparison against bottom_y to what it
4963 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
4964 (Bug#11464)
4965
c1892f11
PE
49662012-05-26 Paul Eggert <eggert@cs.ucla.edu>
4967
4968 Fix coding-related core dumps with gcc -ftrapv.
4969 The code was computing A - B, where A and B are pointers, and B is
4970 random garbage. This can lead to core dumps on platforms that
4971 have special pointer registers, and it also leads to core dumps on
4972 x86-64 when compiled with gcc -ftrapv. The fix is to compute
4973 A - B only when B is initialized properly.
4974 * coding.c (coding_set_source, coding_set_destination): Return void.
4975 (coding_change_source, coding_change_destinations): New functions,
4976 with the old behaviors of coding_set_source and coding_set_destination.
4977 All callers that need an offset changed to use these new functions.
4978
eb7afdad
GM
49792012-05-26 Glenn Morris <rgm@gnu.org>
4980
4981 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
4982
f12fdf02
EZ
49832012-05-26 Eli Zaretskii <eliz@gnu.org>
4984
53a63be6 4985 Extend mouse support on W32 text-mode console.
61b108cc
SM
4986 * xdisp.c (draw_row_with_mouse_face):
4987 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 4988
eb3f6f01 4989 * w32console.c: Include window.h.
61b108cc
SM
4990 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
4991 New functions.
eb3f6f01
EZ
4992 (initialize_w32_display): Initialize mouse-highlight data.
4993
53a63be6
EZ
4994 * w32inevt.c: Include termchar.h and window.h.
4995 (do_mouse_event): Support mouse-autoselect-window. When the mouse
4996 moves, call note_mouse_highlight. If help_echo changed, call
4997 gen_help_event to produce help-echo message in the echo area.
4998 Call clear_mouse_face if mouse_face_hidden is set in the mouse
4999 highlight info.
5000
4cfd81f6
PE
50012012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5002
5003 * lread.c (read1): Simplify slightly to avoid an overflow warning
5004 with GCC 4.7.0 on x86-64.
5005
4446092a
EZ
50062012-05-26 Eli Zaretskii <eliz@gnu.org>
5007
5008 * bidi.c (bidi_mirror_char): Revert last change: an int is
5009 definitely wide enough here.
5010
42b2a986 50112012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 5012
42b2a986 5013 Fix integer width and related bugs (Bug#9874).
eb106a49 5014 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
5015 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5016 (string_bytes, check_sblock, allocate_string_data):
5017 (compact_small_strings, Fmake_bool_vector, make_string)
5018 (make_unibyte_string, make_multibyte_string)
5019 (make_string_from_bytes, make_specified_string)
5020 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5021 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5022 (mark_vectorlike):
5023 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5024 (allocate_pseudovector):
5025 Use int, not EMACS_INT, where int is wide enough.
5026 (inhibit_garbage_collection, Fgarbage_collect):
5027 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5028 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5029 int might not be wide enough.
5030 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5031 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5032 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5033 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5034 (bidi_level_of_next_char, bidi_move_to_visually_next):
5035 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5036 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5037 (Fkill_buffer, Fset_buffer_major_mode)
5038 (advance_to_char_boundary, Fbuffer_swap_text)
5039 (Fset_buffer_multibyte, overlays_at, overlays_in)
5040 (overlay_touches_p, struct sortvec, record_overlay_string)
5041 (overlay_strings, recenter_overlay_lists)
5042 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5043 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5044 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5045 (Foverlay_recenter, last_overlay_modification_hooks_used)
5046 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5047 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
5048 (validate_region): Omit unnecessary test for b <= e,
5049 since that's guaranteed by the previous test.
d311d28c
PE
5050 (adjust_overlays_for_delete): Avoid pos + length overflow.
5051 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5052 (report_overlay_modification):
5053 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5054 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5055 Omit pointer cast, which isn't needed anyway, and doesn't work
5056 after the EMACS_INT -> ptrdiff_t change.
02481186 5057 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
5058 * buffer.h: Adjust decls to match defn changes elsewhere.
5059 (struct buffer_text, struct buffer):
5060 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5061 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
5062 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5063 not int, to avoid needless 32-bit limit on 64-bit hosts.
5064 (exec_byte_code): Use tighter memory-full test, one that checks
5065 for alloca overflow. Don't compute the address of the object just
5066 before an array, as that's not portable. Use EMACS_INT, not
5067 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
5068 * callint.c (Fcall_interactively):
5069 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5070 * callproc.c (call_process_kill, Fcall_process):
5071 Don't assume pid_t fits into an Emacs fixnum.
5072 (call_process_cleanup, Fcall_process, child_setup):
5073 Don't assume pid_t fits into int.
5074 (call_process_cleanup, Fcall_process, delete_temp_file)
5075 (Fcall_process_region):
5076 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5077 (Fcall_process): Simplify handling of volatile integers.
5078 Use int, not EMACS_INT, where int will do.
5079 * casefiddle.c (casify_object, casify_region, operate_on_word)
5080 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5081 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5082 (casify_object): Avoid integer overflow when overallocating buffer.
5083 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 5084 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
5085 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5086 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5087 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5088 integers are now checked earlier. All uses replaced with XINT.
5089 (ccl_driver):
5090 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5091 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
5092 (ccl_driver, Fregister_code_conversion_map):
5093 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
5094 (resolve_symbol_ccl_program): Check that vector header is in range.
5095 Always copy the vector, so that we can check its contents reliably
5096 now rather than having to recheck each instruction as it's being
5097 executed. Check that vector words fit in 'int'.
5098 (ccl_get_compiled_code, Fregister_ccl_program)
5099 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5100 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5101 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5102 contents are in range.
5103 (Fccl_execute_on_string): Check that status is in range.
5104 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5105 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5106 Accept and return EMACS_INT, not int, because callers can pass values
5107 out of 'int' range.
5108 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5109 (multibyte_chars_in_text, parse_str_as_multibyte)
5110 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5111 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5112 (string_escape_byte8, Fget_byte):
5113 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 5114 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
5115 avoid mishandling large integers.
5116 * character.h: Adjust decls to match defn changes elsewhere.
5117 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5118 (Ffind_charset_region):
5119 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5120 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5121 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 5122 Don't assume fixnum fits in int.
d311d28c
PE
5123 (load_charset_map_from_vector, Fmap_charset_chars):
5124 Remove now-unnecessary CHECK_NATNUMs.
5125 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
5126 Don't rely on undefined behavior with signed left shift overflow.
5127 Don't assume unsigned int fits into fixnum, or that fixnum fits
5128 into unsigned int. Don't require max_code to be a valid fixnum;
5129 that's not true for gb10830 4-byte on a 32-bit host. Allow
5130 invalid_code to be a cons, for the same reason. Require code_offset
5131 to be a character. Avoid int overflow if max_char is close
5132 to INT_MAX.
5133 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5134 this is intended anyway and avoids some undefined behavior.
5135 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5136 INDEX_TO_CODE_POINT, as that's what it expects.
5137 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
5138 * charset.h (DECODE_CHAR): Return int, not unsigned;
5139 this is what was intended anyway, and it avoids undefined behavior.
5140 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5141 integer-overflow issues.
5142 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5143 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5144 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
5145 * chartab.c (Fmake_char_table, Fset_char_table_range)
5146 (uniprop_get_decoder, uniprop_get_encoder):
5147 Don't assume fixnum fits in int.
5148 * cmds.c (move_point): New function, that does the gist of
5149 Fforward_char and Fbackward_char, but does so while checking
5150 for integer overflow more accurately.
c96e5d6a 5151 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
5152 (Fforward_line, Fend_of_line, internal_self_insert)
5153 (internal_self_insert):
5154 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5155 Fix a FIXME, by checking for integer overflow when calculating
5156 target_clm and actual_clm.
5157 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 5158 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
5159 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5160 (coding_alloc_by_making_gap, alloc_destination)
5161 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5162 (encode_coding_utf_16, detect_coding_emacs_mule)
5163 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5164 (detect_coding_iso_2022, decode_coding_iso_2022)
5165 (encode_invocation_designation, encode_designation_at_bol)
5166 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5167 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5168 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5169 (encode_coding_ccl, encode_coding_raw_text)
5170 (detect_coding_charset, decode_coding_charset)
5171 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5172 (produce_composition, produce_charset, produce_annotation)
5173 (decode_coding, handle_composition_annotation)
5174 (handle_charset_annotation, consume_chars, decode_coding_gap)
5175 (decode_coding_object, encode_coding_object, detect_coding_system)
5176 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5177 (code_convert_region, code_convert_string)
8f50130c
PE
5178 (Fdefine_coding_system_internal)
5179 (coding_set_source, coding_set_destination):
d311d28c
PE
5180 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5181 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5182 (Fdefine_coding_system_internal):
5183 Don't assume fixnums fit in int.
5184 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 5185 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
5186 (Funencodable_char_position, Fcheck_coding_systems_region)
5187 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 5188 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 5189 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 5190 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 5191 Don't access memory outside of the args array.
d311d28c 5192 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
5193 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5194 result of ENCODE_CHAR.
d311d28c
PE
5195 * coding.h: Adjust decls to match defn changes elsewhere.
5196 (struct coding_system):
5197 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5198 * composite.c (get_composition_id, find_composition)
5199 (run_composition_function, update_compositions)
5200 (compose_text, composition_gstring_put_cache)
5201 (composition_gstring_p, composition_gstring_width)
5202 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5203 (composition_compute_stop_pos, composition_reseat_it)
5204 (composition_update_it, struct position_record)
5205 (find_automatic_composition, composition_adjust_point)
5206 (Fcomposition_get_gstring, Ffind_composition_internal):
5207 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5208 (update_compositions):
5209 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5210 * composite.h: Adjust decls to match defn changes elsewhere.
5211 (struct composition):
5212 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5213 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5214 Do not attempt to compute the address of the object just before a
5215 buffer; this is not portable.
5216 (Faref, Faset):
5217 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5218 (Faset): Use int, not EMACS_INT, where int is wide enough.
5219 (Fstring_to_number): Don't assume fixnums fit in int.
5220 (Frem): Don't assume arg is nonnegative.
5221 * dbusbind.c (xd_append_arg): Check for integers out of range.
5222 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 5223 (extract_signed, extract_unsigned): New functions.
243e0530
PE
5224 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5225 (xd_get_connection_references): Return ptrdiff_t, not int.
5226 All uses changed.
5227 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5228 (xd_read_message_1):
5229 Use int, not unsigned, where the dbus API uses int.
5230 (Fdbus_message_internal): Don't overflow mtype.
5231 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
5232 * dired.c (directory_files_internal, file_name_completion, scmp)
5233 (file_name_completion_stat):
5234 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5235 (file_name_completion): Don't overflow matchcount.
5236 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5237 * dispextern.h: Adjust decls to match defn changes elsewhere.
5238 (struct text_pos, struct glyph, struct bidi_saved_info)
5239 (struct bidi_string_data, struct bidi_it, struct composition_it)
5240 (struct it):
5241 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5242 (struct display_pos, struct composition_it, struct it):
5243 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5244 * dispnew.c (increment_matrix_positions)
5245 (increment_row_positions, mode_line_string)
5246 (marginal_area_string):
5247 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 5248 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
5249 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5250 (duration_to_sec_usec): New function, to check for overflow better.
5251 (Fsleep_for, sit_for): Use it.
5252 * doc.c (get_doc_string, store_function_docstring):
5253 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5254 (get_doc_string, Fsnarf_documentation):
5255 Use int, not EMACS_INT, where int is wide enough.
5256 (get_doc_string):
5257 Use SAFE_ALLOCA, not alloca.
5258 Check for overflow when converting EMACS_INT to off_t.
5259 * doprnt.c (doprnt):
5260 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5261 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5262 Don't assume uid_t fits into fixnum.
5263 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5264 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5265 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5266 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5267 (general_insert_function)
5268 (Finsert_char, make_buffer_string, make_buffer_string_both)
5269 (update_buffer_properties, Fbuffer_substring)
5270 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5271 (Fsubst_char_in_region, check_translation)
5272 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5273 (transpose_markers, Ftranspose_regions):
5274 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5275 (clip_to_bounds): Move to lisp.h as an inline function).
5276 (Fconstrain_to_field): Don't assume integers are nonnegative.
5277 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5278 (Fsubst_char_in_region, Fsave_restriction):
5279 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5280 (Femacs_pid): Don't assume pid_t fits into fixnum.
5281 (lo_time): Use int, not EMACS_INT, when int suffices.
5282 (lisp_time_argument): Check for usec out of range.
5283 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
5284 (Fuser_login_name, Fuser_full_name): Signal an error
5285 if a uid argument is out of range, rather than relying on
5286 undefined behavior.
c8d5c857
PE
5287 (Fformat_time_string): Remove now-unnecessary check.
5288 lisp_time_argument checks for out-of-range usec now.
243e0530 5289 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
5290 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5291 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5292 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5293 (init_cmdargs, Fdump_emacs):
5294 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5295 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5296 the bottom (typically) 32 bits of the fixnum.
5297 * eval.c (specpdl_size, call_debugger):
5298 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5299 (when_entered_debugger, Fbacktrace_debug):
5300 Don't assume fixnum can fit in int.
5301 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5302 the object just before a buffer; this is not portable.
5303 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5304 (grow_specpdl, unbind_to):
5305 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5306 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5307 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 5308 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
5309 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5310 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5311 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5312 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5313 (a_write, e_write):
5314 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5315 (Fcopy_file, non_regular_nbytes, read_non_regular)
5316 (Finsert_file_contents):
5317 Use int, not EMACS_INT, where int is wide enough.
5318 (READ_BUF_SIZE): Verify that it fits in int.
5319 (Finsert_file_contents): Check that counts are in proper range,
5320 rather than assuming fixnums fit into ptrdiff_t etc.
5321 Don't assume fixnums fit into int.
125b3835 5322 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
5323 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5324 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
5325 (string_char_to_byte, string_byte_to_char)
5326 (string_make_multibyte, string_to_multibyte)
5327 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5328 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5329 (substring_both, Fdelete, internal_equal, Ffillarray)
5330 (Fclear_string, mapcar1)
5331 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5332 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5333 (larger_vector, make_hash_table, maybe_resize_hash_table)
5334 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5335 (Fmaphash, secure_hash):
5336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5337 (concat): Check for string index and length overflow.
5338 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5339 (Frequire):
5340 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5341 (larger_vector): New API (vec, incr_min, size_max) replaces old
5342 one (vec, new_size, init). This catches size overflow.
5343 INIT was removed because it was always Qnil.
5344 All callers changed.
5345 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5346 the upper bound on a hash table index size.
5347 (make_hash_table, maybe_resize_hash_table): Use it.
5348 (secure_hash): Computer start_byte and end_byte only after
5349 they're known to be in ptrdiff_t range.
5350 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5351 (Ffont_get_glyphs, Ffont_at):
5352 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5353 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5354 (Flist_fonts, Fopen_font):
5355 Don't assume fixnum can fit in int.
5356 (check_gstring): Don't assume index can fit in int.
5357 (font_match_p): Check that fixnum is a character, not a nonnegative
5358 fixnum, since the later code needs to stuff it into an int.
5359 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5360 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5361 conversion overflow issues.
5362 (Fopen_font): Check for integer out of range.
5363 (Ffont_get_glyphs): Don't assume index can fit in int.
5364 * font.h: Adjust decls to match defn changes elsewhere.
5365 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5366 integer overflow.
5367 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5368 printmax_t, where ptrdiff_t is wide enough.
5369 (Finternal_char_font):
5370 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5371 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5372 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5373 (Fset_frame_position, x_set_frame_parameters)
5374 (x_set_line_spacing, x_set_border_width)
5375 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5376 Check that fixnums are in proper range for system types.
5377 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5378 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5379 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5380 Use SAFE_ALLOCA_LISP, not alloca.
5381 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5382 intptr_t is wide enough.
5383 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5384 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5385 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5386 Check for fixnum out of range.
5387 * ftfont.c (ftfont_list): Don't assume index fits in int.
5388 Check that fixnums are in proper range for system types.
5389 (ftfont_shape_by_flt):
5390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
5391 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5392 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5393 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5394 Check that fixnums are in proper range for system types.
5395 * gnutls.h: Adjust decls to match defn changes elsewhere.
5396 * gtkutil.c (xg_dialog_run):
5397 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5398 (update_frame_tool_bar):
5399 Check that fixnums are in proper range for system types.
5400 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 5401 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
5402 * indent.c (last_known_column, last_known_column_point):
5403 (current_column_bol_cache):
5404 (skip_invisible, current_column, check_display_width):
5405 (check_display_width, scan_for_column, current_column_1)
5406 (Findent_to, Fcurrent_indentation, position_indentation)
5407 (indented_beyond_p, Fmove_to_column, compute_motion):
5408 (Fcompute_motion, Fvertical_motion):
5409 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5410 (last_known_column_modified): Use EMACS_INT, not int.
5411 (check_display_width):
5412 (Fcompute_motion):
5413 Check that fixnums and floats are in proper range for system types.
5414 (compute_motion): Don't assume index or fixnum fits in int.
5415 (compute_motion, Fcompute_motion):
5416 Use int, not EMACS_INT, when it is wide enough.
5417 (vmotion): Omit local var start_hpos that is always 0; that way
5418 we don't need to worry about overflow in expressions involving it.
5419 * indent.h: Adjust decls to match defn changes elsewhere.
5420 (struct position):
5421 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5422 Use int, not EMACS_INT, where int is wide enough.
5423 Remove unused members ovstring_chars_done and tab_offset;
5424 all uses removed.
5425 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5426 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5427 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5428 (make_gap, copy_text, insert, insert_and_inherit)
5429 (insert_before_markers, insert_before_markers_and_inherit)
5430 (insert_1, count_combining_before, count_combining_after)
5431 (insert_1_both, insert_from_string)
5432 (insert_from_string_before_markers, insert_from_string_1)
5433 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5434 (adjust_after_replace, adjust_after_insert, replace_range)
5435 (replace_range_2, del_range, del_range_1, del_range_byte)
5436 (del_range_both, del_range_2, modify_region)
5437 (prepare_to_modify_buffer, signal_before_change)
5438 (signal_after_change, Fcombine_after_change_execute):
5439 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5440 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5441 (balance_an_interval, split_interval_right, split_interval_left)
5442 (find_interval, next_interval, update_interval)
5443 (adjust_intervals_for_insertion, delete_node, delete_interval)
5444 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5445 (static_offset_intervals, offset_intervals)
5446 (merge_interval_right, merge_interval_left, make_new_interval)
5447 (graft_intervals_into_buffer, temp_set_point_both)
5448 (temp_set_point, set_point, adjust_for_invis_intang)
5449 (set_point_both, move_if_not_intangible, get_property_and_range)
5450 (get_local_map, copy_intervals, copy_intervals_to_string)
5451 (compare_string_intervals, set_intervals_multibyte_1):
5452 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5453 * intervals.h: Adjust decls to match defn changes elsewhere.
5454 (struct interval):
5455 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5456 * keyboard.c (this_command_key_count, this_single_command_key_start)
5457 (before_command_key_count, before_command_echo_length, echo_now)
5458 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5459 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5460 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5461 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5462 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5463 (last_non_minibuf_size, last_point_position, echo_truncate)
5464 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5465 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5466 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5467 (stuff_buffered_input):
5468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5469 (last_auto_save, command_loop_1, read_char):
5470 Use EMACS_INT, not int, to avoid integer overflow.
5471 (record_char): Avoid overflow in total_keys computation.
5472 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5473 * keyboard.h: Adjust decls to match defn changes elsewhere.
5474 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5475 (Fkey_description, Fdescribe_vector, Flookup_key):
5476 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5477 (click_position): New function, to check that positions are in range.
5478 (Fcurrent_active_maps):
5479 (describe_command):
5480 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5481 (Faccessible_keymaps, Fkey_description):
5482 (preferred_sequence_p):
5483 Don't assume fixnum can fit into int.
5484 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5485 Check for integer overflow in size calculations.
5486 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5487 avoid mishandling large integers.
5488 * lisp.h: Adjust decls to match defn changes elsewhere.
5489 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5490 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5491 (struct Lisp_Marker):
5492 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5493 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
5494 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5495 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5496 All callers changed.
5497 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5498 Assume the arg has valid form, since it always does.
5499 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5500 unsigned integer system type.
5501 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5502 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5503 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5504 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5505 (duration_to_sec_usec): New decl.
5506 * lread.c (read_from_string_index, read_from_string_index_byte)
5507 (read_from_string_limit, readchar, unreadchar, openp)
5508 (read_internal_start, read1, oblookup):
5509 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5510 (Fload, readevalloop, Feval_buffer, Feval_region):
5511 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5512 (openp): Check for out-of-range argument to 'access'.
5513 (read1): Use int, not EMACS_INT, where int is wide enough.
5514 Don't assume fixnum fits into int.
6efdadfd 5515 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
5516 (read_filtered_event): Use duration_to_sec_usec
5517 to do proper overflow checking on durations.
d311d28c
PE
5518 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5519 in size calculation.
5520 (Fexecute_kbd_macro):
5521 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5522 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5523 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5524 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5525 (set_marker_both, set_marker_restricted_both, marker_position)
5526 (marker_byte_position, Fbuffer_has_markers_at):
5527 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5528 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 5529 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
5530 It now merely ensures that the menu is large enough, without
5531 necessarily growing it, as this avoids some integer overflow issues.
5532 All callers changed.
5533 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5534 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5535 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5536 Use SAFE_ALLOCA_LISP, not alloca.
5537 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5538 to EMACS_INT. Check that fixnums are in proper range for system types.
5539 * minibuf.c (minibuf_prompt_width, string_to_object)
5540 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5541 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5542 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5543 (get_minibuffer, read_minibuf_unwind):
5544 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5545 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5546 this simplifies overflow checking. All callers changed.
5547 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5548 (Ftest_completion):
5549 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5550 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5551 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5552 Check that fixnums are in proper range for system types.
5553 (Fx_create_frame, Fx_show_tip):
5554 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5555 * nsfont.m (ns_findfonts, nsfont_list_family):
5556 Don't assume fixnum fits in long.
5557 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5558 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5559 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5560 wide enough.
17fdb222 5561 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
5562 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5563 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5564 (PRINTDECLARE, PRINTPREPARE):
5565 (strout, print_string):
5566 (print, print_preprocess, print_check_string_charset_prop)
5567 (print_object):
5568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5569 (PRINTDECLARE):
5570 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5571 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5572 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 5573 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 5574 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
5575 (print_error_message): Use SAFE_ALLOCA, not alloca.
5576 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
5577 (print_depth, new_backquote_output, print_number_index):
5578 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
5579 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5580 (Fset_process_window_size, Fformat_network_address)
5581 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 5582 (sigchld_handler):
d311d28c 5583 Check that fixnums are in proper range for system types.
d44287d4 5584 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
5585 Check for process-ids out of pid_t range rather than relying on
5586 undefined behavior.
e4d81efc 5587 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
5588 (Fformat_network_address, read_process_output, send_process)
5589 (Fprocess_send_region, status_notify):
5590 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5591 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5592 (wait_reading_process_output, read_process_output, exec_sentinel):
5593 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5594 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5595 (Faccept_process_output): Use duration_to_sec_usec to do proper
5596 overflow checking on durations.
dde14581
PE
5597 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5598 Don't assume pid_t fits in int.
02481186
PE
5599 * process.h (struct Lisp_Process): Members tick and update_tick
5600 are now of type EMACS_INT, not int.
b62b53e8
PE
5601 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5602 configured --with-wide-int.
d311d28c
PE
5603 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5604 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5605 * search.c (looking_at_1, string_match_1):
5606 (fast_string_match, fast_c_string_match_ignore_case)
5607 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5608 (scan_newline, find_before_next_newline, search_command)
5609 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5610 (set_search_regs, wordify):
5611 (Freplace_match):
5612 (Fmatch_data):
5613 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5614 (string_match_1, search_buffer, set_search_regs):
5615 (Fmatch_data):
5616 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5617 (wordify): Check for overflow in size calculation.
5618 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5619 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5620 Check that fixnums are in proper range for system types.
5621 * sound.c (struct sound_device)
5622 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5623 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5624 (Fplay_sound_internal):
5625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 5626 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
5627 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5628 (Fparse_partial_sexp):
5629 Don't assume fixnums can fit in int.
5630 (struct lisp_parse_state, find_start_pos, find_start_value)
5631 (find_start_value_byte, find_start_begv)
5632 (update_syntax_table, char_quoted, dec_bytepos)
5633 (find_defun_start, prev_char_comend_first, back_comment):
5634 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5635 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5636 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5637 (Finternal_describe_syntax_value): Check that match_lisp is a
5638 character, not an integer, since the code stuffs it into int.
5639 (scan_words, scan_sexps_forward):
5640 Check that fixnums are in proper range for system types.
5641 (Fforward_word):
5642 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5643 (scan_sexps_forward):
5644 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5645 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5646 * syntax.h: Adjust decls to match defn changes elsewhere.
5647 (struct gl_state_s):
5648 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
5649 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5650 MOST_POSITIVE_FIXNUM.
d311d28c
PE
5651 * sysdep.c (wait_for_termination_1, wait_for_termination)
5652 (interruptible_wait_for_termination, mkdir):
5653 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5654 (emacs_read, emacs_write):
5655 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
5656 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5657 and double all fit in int.
d311d28c
PE
5658 * term.c (set_tty_color_mode):
5659 Check that fixnums are in proper range for system types.
5660 * termhooks.h (struct input_event):
5661 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5662 * textprop.c (validate_interval_range, interval_of)
5663 (Fadd_text_properties, set_text_properties_1)
5664 (Fremove_text_properties, Fremove_list_of_text_properties)
5665 (Ftext_property_any, Ftext_property_not_all)
5666 (copy_text_properties, text_property_list, extend_property_ranges)
5667 (verify_interval_modification):
5668 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5669 (Fnext_single_char_property_change)
5670 (Fprevious_single_char_property_change):
5671 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
5672 (copy_text_properties):
5673 Check for integer overflow in index calculation.
d311d28c
PE
5674 * undo.c (last_boundary_position, record_point, record_insert)
5675 (record_delete, record_marker_adjustment, record_change)
5676 (record_property_change):
5677 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5678 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5679 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5680 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5681 (Fx_hide_tip, Fx_file_dialog):
5682 * w32menu.c (set_frame_menubar):
5683 Use ptrdiff_t, not int, for consistency with rest of code.
5684 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5685 (select_window, Fdelete_other_windows_internal)
5686 (window_scroll_pixel_based, window_scroll_line_based)
5687 (Frecenter, Fset_window_configuration):
5688 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5689 (Fset_window_hscroll, run_window_configuration_change_hook)
5690 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 5691 (Fscroll_other_window, Frecenter):
d311d28c
PE
5692 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5693 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5694 Don't assume fixnum fits in int.
5695 (Fset_window_scroll_bars):
5696 Check that fixnums are in proper range for system types.
5697 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5698 (string_pos, c_string_pos, number_of_chars, init_iterator)
5699 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5700 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5701 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
5702 (face_before_or_after_it_pos, handle_invisible_prop)
5703 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
5704 (display_prop_intangible_p, string_buffer_position_lim)
5705 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5706 (get_overlay_strings_1, get_overlay_strings)
5707 (iterate_out_of_display_property, forward_to_next_line_start)
5708 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5709 (get_next_display_element, set_iterator_to_next)
5710 (get_visually_first_element, compute_stop_pos_backwards)
5711 (handle_stop_backwards, next_element_from_buffer)
5712 (move_it_in_display_line_to, move_it_in_display_line)
5713 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5714 (add_to_log, message_dolog, message_log_check_duplicate)
5715 (message2, message2_nolog, message3, message3_nolog
5716 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5717 (current_message_1, truncate_echo_area, truncate_message_1)
5718 (set_message, set_message_1, store_mode_line_noprop)
5719 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5720 (text_outside_line_unchanged_p, check_point_in_composition)
5721 (reconsider_clip_changes)
5722 (redisplay_internal, set_cursor_from_row, try_scrolling)
5723 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5724 (redisplay_window, find_last_unchanged_at_beg_row)
5725 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5726 (trailing_whitespace_p, find_row_edges, display_line)
5727 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5728 (display_mode_element, store_mode_line_string)
5729 (pint2str, pint2hrstr, decode_mode_spec)
5730 (display_count_lines, display_string, draw_glyphs)
5731 (x_produce_glyphs, x_insert_glyphs)
5732 (rows_from_pos_range, mouse_face_from_buffer_pos)
5733 (fast_find_string_pos, mouse_face_from_string_pos)
5734 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5735 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5736 (safe_call, init_from_display_pos, handle_fontified_prop)
5737 (handle_single_display_spec, load_overlay_strings)
5738 (with_echo_area_buffer, setup_echo_area_for_printing)
5739 (display_echo_area, echo_area_display)
5740 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5741 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
5742 (redisplay_window, dump_glyph_row, display_mode_line)
5743 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 5744 (handle_display_spec, display_prop_string_p):
d311d28c
PE
5745 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5746 (handle_single_display_spec, build_desired_tool_bar_string)
5747 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5748 (get_specified_cursor_type):
5749 Check that fixnums are in proper range for system types.
5750 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5751 (Flookup_image_map):
5752 Don't assume fixnums fit in int.
5753 (compare_overlay_entries):
5754 Avoid mishandling comparisons due to subtraction overflow.
5755 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5756 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5757 (handle_tool_bar_click):
5758 Use int, not unsigned, since we prefer signed and the signedness
5759 doesn't matter here.
5760 (get_next_display_element, next_element_from_display_vector):
5761 Use int, not EMACS_INT, when int is wide enough.
5762 (start_hourglass): Use duration_to_sec_usec to do proper
5763 overflow checking on durations.
5764 * xfaces.c (Fbitmap_spec_p):
5765 Check that fixnums are in proper range for system types.
5766 (compare_fonts_by_sort_order):
5767 Avoid mishandling comparisons due to subtraction overflow.
5768 (Fx_family_fonts, realize_basic_faces):
5769 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5770 (Fx_family_fonts):
5771 Don't assume fixnum fits in int.
5772 Use SAFE_ALLOCA_LISP, not alloca.
5773 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5774 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5775 (face_at_buffer_position, face_for_overlay_string)
5776 (face_at_string_position):
5777 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5778 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5779 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5780 (Fx_show_tip):
5781 Check that fixnums are in proper range for system types.
5782 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5783 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5784 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5785 (Fx_change_window_property): Don't assume fixnums fit in int.
5786 * xfont.c (xfont_chars_supported):
5787 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5788 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5789 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5790 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5791 * xml.c (parse_region):
5792 * xrdb.c (magic_file_p):
5793 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5794 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5795 (x_get_local_selection, x_reply_selection_request)
5796 (x_handle_selection_request, wait_for_property_change):
5797 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5798 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5799 short is wide enough.
5800 (x_send_client_event): Don't assume fixnum fits in int.
5801 * xterm.c (x_x_to_emacs_modifiers):
5802 Don't assume EMACS_INT overflows nicely into int.
5803 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5804 may come from Lisp.
5805 (handle_one_xevent): NATNUMP can eval its arg twice.
5806 (x_connection_closed):
5807 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5808 * xterm.h: Adjust decls to match defn changes elsewhere.
5809 (struct scroll_bar): Use struct vectorlike_header
5810 rather than rolling our own approximation.
5811 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5812
c6574eb5
GM
58132012-05-25 Glenn Morris <rgm@gnu.org>
5814
5815 * lisp.mk (lisp): Update for more files being compiled now.
5816
e8d32c7e
SM
58172012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5818
48def666
SM
5819 * lread.c: Remove `read_pure' which makes no difference.
5820 (read_pure): Remove var.
5821 (unreadpure): Remove function.
5822 (readevalloop): Don't call read_list with -1 flag.
5823 (read1, read_vector): Don't test read_pure any more.
5824 (read_list): Simplify.
5825
e8d32c7e
SM
5826 * fileio.c, character.h: Minor style tweaks.
5827
4b2addb7
DA
58282012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5829
5830 * window.h (clip_changed): Remove useless declaration.
5831
584461b2
JB
58322012-05-22 Juanma Barranquero <lekktu@gmail.com>
5833
5834 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5835 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5836
34374650
PE
58372012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5838
5839 Remove src/m/*.
5840 This directory predates autoconf and is no longer needed nowadays.
5841 Move its few remaining bits of functionality to where they're needed.
5842 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5843 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5844 * m/template.h: Remove.
5845 * Makefile.in (M_FILE): Remove. All uses removed.
5846 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5847 * lisp.h (USE_LSB_TAG):
5848 * mem-limits.h (EXCEEDS_LISP_PTR):
5849 Use VAL_MAX, not VALBITS, in #if.
5850 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5851 (EMACS_UINT): Define unconditionally now.
5852 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5853 (BITS_PER_EMACS_INT): New constants, replacing
5854 what used to be in config.h, but not useful in #if.
5855 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5856 define them any more.
5857 (VAL_MAX): New macro.
5858 (VALMASK): Use it.
5859 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5860 BITS_PER_EMACS_INT, in #if.
5861 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5862 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5863 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5864 * s/ms-w32.h (DATA_START):
5865 Move here from removed file m/intel386.h.
5866 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5867 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5868
261cb4bb
PE
58692012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5870
5871 Assume C89 or later.
5872 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5873 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5874 (xrealloc):
5875 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5876 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5877 * textprop.c, tparam.c (NULL): Remove.
5878 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5879 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5880 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5881 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5882 * xterm.c (input_signal_count): Assume volatile works.
5883
ff23cd9f
KB
58842012-05-21 Ken Brown <kbrown@cornell.edu>
5885
5886 * xgselect.c (xg_select): Fix first argument in call to 'select'
5887 (bug#11508).
5888
1b170bc6
KB
58892012-05-20 Ken Brown <kbrown@cornell.edu>
5890
5891 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 5892 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 5893
b2f4d39f
KB
58942012-05-19 Ken Brown <kbrown@cornell.edu>
5895
5896 * xfns.c (x_in_use): Remove `static' qualifier.
5897 * xterm.h (x_in_use): Declare.
5898 * xgselect.c: Include xterm.h.
5899 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5900 and `display_arg' (bug#9754).
5901
003fdae2
PE
59022012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5903
9232a6d9
PE
5904 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5905
003fdae2
PE
5906 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5907 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5908
784b56e2
EZ
59092012-05-18 Eli Zaretskii <eliz@gnu.org>
5910
5911 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5912
5913 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 5914 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
5915
5916 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5917 reference to image_cache->refcount.
5918 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5919
a0a79cde
JL
59202012-05-17 Juri Linkov <juri@jurta.org>
5921
5922 * search.c (Fword_search_regexp, Fword_search_backward)
5923 (Fword_search_forward, Fword_search_backward_lax)
5924 (Fword_search_forward_lax): Move functions to isearch.el
5925 (bug#10145, bug#11381).
5926
b0572523
PE
59272012-05-16 Paul Eggert <eggert@cs.ucla.edu>
5928
5929 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
5930
9660f5fc
SM
59312012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
5932
5933 * lread.c (init_obarray): Declare Qt and Qnil as special.
5934
4374de83
GM
59352012-05-14 Glenn Morris <rgm@gnu.org>
5936
5937 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 5938 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 5939
dc44c39a
PE
59402012-05-14 Paul Eggert <eggert@cs.ucla.edu>
5941
078c97cb
PE
5942 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
5943
dc44c39a
PE
5944 * unexaix.c: Port to more-recent AIX compilers.
5945 (report_error, report_error_1, make_hdr, copy_sym)
5946 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
5947 Make arguments const char *, not char *, to avoid violations of C
5948 standard and to fix some AIX warnings reported by Gilles Pion.
5949
e18afed7 59502012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
5951
5952 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
5953 already have overlays loaded.
5954 (handle_single_display_spec): Before returning without displaying
5955 fringe bitmap, synchronize the bidi iterator with the main display
5956 iterator, by calling iterate_out_of_display_property.
5957 (iterate_out_of_display_property): Detect buffer iteration by
5958 testing that it->string is a Lisp string.
5959 (get_next_display_element): When the current object is exhausted,
5960 and there's something on it->stack, call set_iterator_to_next to
5961 proceed with what's on the stack, instead of returning zero.
5962 (set_iterator_to_next): If called at the end of a Lisp string,
5963 proceed to consider_string_end without incrementing string
5964 position. Don't increment display vector index past the end of
5965 the display vector. (Bug#11417)
c8fb9dc6
EZ
5966 (pos_visible_p): Don't report a position visible when move_it_to
5967 stopped at the last line of window, which happens to be scanned
5968 backwards by the bidi iteration. (Bug#11464)
ac268e67 5969
e18afed7 59702012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
5971
5972 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
5973 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
5974 are on a TTY, and thus unable to display on the fringes.
5975 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
5976 so we need to signal to the caller that this is a "replacing"
5977 display spec. This fixes display when the spec is invalid or we
5978 are on a TTY.
5979
e18afed7 59802012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
5981
5982 * unexaix.c (make_hdr): Fix typo in prototype.
5983 This bug broke the build on AIX. Problem reported by Gilles Pion.
5984
9d0a235a
MA
59852012-05-14 Michael Albinus <michael.albinus@gmx.de>
5986
5987 * keyboard.c (kbd_buffer_get_event): Read special events also in
5988 batch mode. (Bug#11415)
5989
9e6b06ed
GM
59902012-05-12 Glenn Morris <rgm@gnu.org>
5991
5992 * ns.mk: Update for ns_appbindir no longer having trailing "/".
5993
c1a1d7a3
EZ
59942012-05-12 Eli Zaretskii <eliz@gnu.org>
5995
5996 * lisp.mk (lisp): Add newcomment.elc.
5997
3fe7cdc8
GM
59982012-05-12 Glenn Morris <rgm@gnu.org>
5999
6000 * Makefile.in (MKDIR_P): New, set by configure.
6001 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6002
53f7d2c0
PE
60032012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 Remove unused function hourglass_started.
6006 * dispextern.h (hourglass_started):
6007 * w32fns.c (hourglass_started):
6008 * xdisp.c (hourglass_started): Remove.
6009
75aafb17
JB
60102012-05-10 Juanma Barranquero <lekktu@gmail.com>
6011
6012 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6013 Update dependencies.
6014
12959e8e
PE
60152012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6016
97107e2e
PE
6017 * xgselect.c (xg_select): Put maxfds+1 into a var.
6018 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6019
12959e8e
PE
6020 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6021
836d29b3
DA
60222012-05-10 Dave Abrahams <dave@boostpro.com>
6023
6024 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6025 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6026
5cb67954
MA
60272012-05-09 Michael Albinus <michael.albinus@gmx.de>
6028
6029 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6030 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6031 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6032 Initialize xd_registered_buses.
6033
3478ec45
PE
60342012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6035
b263a6b0
PE
6036 Untag more efficiently if USE_LSB_TAG.
6037 This is based on a proposal by YAMAMOTO Mitsuharu in
6038 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6039 For an admittedly artificial (nth 8000 longlist) benchmark on
6040 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6041 Emacs's overall text size by 1%.
6042 * lisp.h (XUNTAG): New macro.
6043 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6044 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6045 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6046 * eval.c (Fautoload):
6047 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6048 * frame.h (XFRAME): Use XUNTAG.
6049
3478ec45
PE
6050 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6051 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6052 Remove unportable assumptions about print widths of types like
6053 dbus_uint32_t.
6054 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6055 intptr_t when converting between pointer and integer, to avoid GCC
6056 warnings about wrong width.
6057
666b903b 60582012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
6059
6060 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6061 stack for each reader_thread, instead of defaulting to 8MB
6062 determined by the linker. This avoids failures in creating
6063 subprocesses on Windows 7, see the discussion in this thread:
6064 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6065
b120cc17
JC
60662012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6067
6068 Fix up display of the *Minibuf-0* buffer in the mini window.
6069 * keyboard.c (read_char): Don't clear the echo area if there's no
6070 message to clear.
6071 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 6072 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 6073
9a4b36f8
MA
60742012-05-07 Michael Albinus <michael.albinus@gmx.de>
6075
6076 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6077 batch mode.
6078
e5f9458f
CY
60792012-05-06 Chong Yidong <cyd@gnu.org>
6080
6081 * lisp.mk (lisp): Update.
6082
eceeb5fc 60832012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
6084
6085 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6086
71873e2b
SM
60872012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6088
6089 * data.c (PUT_ERROR): New macro.
6090 (syms_of_data): Use it. Add new error type `user-error'.
6091 * undo.c (user_error): New function.
6092 (Fprimitive_undo): Use it.
6093 * print.c (print_error_message): Adjust print style for `user-error'.
6094 * keyboard.c (user_error): New function.
6095 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6096
ab0fa4e4
PE
60972012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6098
6099 Do not limit current-time-string to years 1000..9999.
6100 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6101 (Fcurrent_time_string): Support any year that is supported by the
6102 underlying localtime representation. Don't use asctime, as it
6103 has undefined behavior for years outside the range -999..9999.
6104
7ed806a7
PE
61052012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6106
6107 Fix race conditions involving setenv, gmtime, localtime, asctime.
6108 Without this fix, interrupts could mess up code that uses these
6109 nonreentrant functions, since setting TZ invalidates existing
6110 tm_zone or tzname values, and since most of these functions return
6111 pointers to static storage.
6112 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6113 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6114 Grow the critical sections to include not just invoking
6115 localtime/gmtime, but also accessing these functions' results
6116 including their tm_zone values if any, and any related TZ setting.
6117 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
6118 so that the struct tm is saved in the critical section.
6119 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
6120 motivated by the fact that memory allocation needs to be outside
6121 the critical section.
6122
0c16dfed
DA
61232012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6124
6125 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6126 with RESET_INTERVAL.
6127
6128 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6129 Remove duplicated buffer name initialization.
6130
3f83ace8
JM
61312012-05-02 Jim Meyering <jim@meyering.net>
6132
6133 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6134
c7b8541e
JM
6135 * xfns.c (x_window): Use xstrdup (Bug#11375).
6136
90207a15 61372012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
6138
6139 * xdisp.c (pos_visible_p): If already at a newline from the
6140 display string before the 'while' loop, don't walk back the glyphs
6141 from it3.glyph_row. Solves assertion violation when the display
6142 string begins with a newline (egg.el). (Bug#11367)
6143
b593d6a9
AH
61442012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6145
6146 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6147 Move to simple.el.
6148
4737362e
GM
61492012-05-01 Glenn Morris <rgm@gnu.org>
6150
99cf43f9
GM
6151 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6152 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6153 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6154 All were removed before 23.1.
6155
9311dcff
GM
6156 * dispnew.c: Remove HAVE_LIBNCURSES test;
6157 it is always true on relevant platforms.
6158
4d5c6349
GM
6159 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6160 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6161
4737362e
GM
6162 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6163
74dd3a6b
AS
61642012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6165
6166 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6167 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6168 Remove.
6169
13c379ee
PE
61702012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6171
6172 Do not avoid creating empty evaporating overlays (Bug#9642).
6173 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6174 That is, do not delete an evaporating overlay if it becomes
6175 empty after its bounds are adjusted to fit within its buffer.
6176 This fix caused other problems, and I'm reverting it until we get
6177 to the bottom of them.
6178
a8e7d6d7 61792012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
6180
6181 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6182
a8e7d6d7 61832012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
6184
6185 * xdisp.c (pos_visible_p): If the window start position is beyond
6186 ZV, start the display from buffer beginning. Prevents assertion
6187 violation in init_iterator when the minibuffer window is scrolled
6188 via the scroll bar.
6189
6190 * window.c (window_scroll_pixel_based): Likewise.
6191
a8e7d6d7 61922012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
6193
6194 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6195
a8e7d6d7 61962012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
6197
6198 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6199 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6200
a8e7d6d7 62012012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 6202
b593d6a9
AH
6203 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6204 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 6205
1c6900d9
EZ
62062012-04-26 Eli Zaretskii <eliz@gnu.org>
6207
4c3fa1d9
EZ
6208 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6209 display element, check also the underlying string or buffer
6210 character. (Bug#11341)
6211
1c6900d9
EZ
6212 * w32menu.c: Include w32heap.h.
6213 (add_menu_item): If the call to AppendMenuW (via
6214 unicode_append_menu) fails, disable Unicode menus only if we are
6215 running on Windows 9X/Me.
6216
42bf8205
AS
62172012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6218
6219 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6220 (xgetint): Add missing shift for LSB tags.
6221
b1bac16e
MR
62222012-04-24 Martin Rudalics <rudalics@gmx.at>
6223
6224 * keyboard.c (read_char): Don't wipe echo area for select window
6225 events: These might get delayed via `mouse-autoselect-window'
6226 (Bug#11304).
6227
d69621cc
JB
62282012-04-24 Juanma Barranquero <lekktu@gmail.com>
6229
6230 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6231 manipulation of :loaded-from data.
6232
02fd101b
JB
62332012-04-23 Juanma Barranquero <lekktu@gmail.com>
6234
6235 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6236 now a cons (bug#11311).
6237
888bec30
PE
62382012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6239
89a438bd
PE
6240 Do not create empty overlays with the evaporate property (Bug#9642).
6241 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6242 if it becomes empty after its bounds are adjusted to fit within
6243 its buffer. Without this fix, in a nonempty buffer (let ((o
6244 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6245 yields an empty overlay that has the evaporate property, which is
6246 not supposed to happen.
6247
1068fe4d
PE
6248 Fix minor GTK3 problems found by static checking.
6249 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6250 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6251 (struct _EmacsFixedClass, emacs_fixed_get_type):
6252 Move decls here from emacsgtkfixed.h, since they needn't be public.
6253 (emacs_fixed_get_type): Now static.
6254 (emacs_fixed_class_init): Omit unused local.
6255 (emacs_fixed_child_type): Remove; unused.
6256 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6257 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6258 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6259 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6260 (EMACS_FIXED_GET_CLASS): Remove; unused.
6261 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6262
888bec30
PE
6263 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6264 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6265
de85e130
PE
62662012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6267
d0baac98 6268 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 6269 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
6270 (__malloc_size_t, __malloc_ptrdiff_t):
6271 Remove. All uses removed, replaced by the definiens if needed,
6272 since we can assume C89 or better now.
6273 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6274 (protect_malloc_state, align, get_contiguous_space)
6275 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6276 (malloc_atfork_handler_child, malloc_enable_thread)
6277 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6278 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6279 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6280 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6281 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6282 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6283 Define using prototypes, not old style.
6284 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6285 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6286 (align): Don't assume that signed integer overflow wraps around.
6287 Omit unused local var.
6288 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6289 (_free_internal_nolock, memalign, mallochook, reallochook):
6290 Omit no-longer-needed casts.
6291 (valloc): Use getpagesize, not __getpagesize.
6292 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6293 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6294
de85e130
PE
6295 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6296
dcbf5805
MA
62972012-04-22 Michael Albinus <michael.albinus@gmx.de>
6298
6299 Move functions from C to Lisp. Make non-blocking method calls
6300 the default. Implement further D-Bus standard interfaces.
6301
6302 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6303 (QCdbus_request_name_allow_replacement)
6304 (QCdbus_request_name_replace_existing)
6305 (QCdbus_request_name_do_not_queue)
6306 (QCdbus_request_name_reply_primary_owner)
6307 (QCdbus_request_name_reply_in_queue)
6308 (QCdbus_request_name_reply_exists)
6309 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6310 (QCdbus_registered_serial, QCdbus_registered_method)
6311 (QCdbus_registered_signal): New Lisp objects.
6312 (XD_DEBUG_MESSAGE): Use sizeof.
6313 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6314 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6315 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6316 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6317 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6318 (xd_signature, xd_append_arg): Allow float for integer types.
6319 (xd_get_connection_references): New function.
b593d6a9
AH
6320 (xd_get_connection_address): Rename from xd_initialize.
6321 Return cached address.
dcbf5805
MA
6322 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6323 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6324 level.
6325 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 6326 Return number of refcounts.
dcbf5805
MA
6327 (Fdbus_get_unique_name): Make stronger parameter check.
6328 (Fdbus_message_internal): New defun.
6329 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6330 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6331 (Fdbus_send_signal, Fdbus_register_service)
6332 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6333 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6334 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6335 (Vdbus_compiled_version, Vdbus_runtime_version)
6336 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6337 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6338 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
6339 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6340 Adapt docstring.
dcbf5805 6341
52828e02
PE
63422012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6343
da05bc4c
PE
6344 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6345 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6346 Do not assume ptrdiff_t is the same width as 'int'.
6347
52828e02
PE
6348 * alloc.c: Handle unusual debugging option combinations.
6349 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6350 since the two debugging options are incompatible.
6351 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6352 is defined.
6353 (mem_init, mem_insert, mem_insert_fixup):
6354 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6355 (NEED_MEM_INSERT): Remove; no longer needed.
6356
f01769f9
LL
63572012-04-22 Leo Liu <sdl.web@gmail.com>
6358
6359 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6360
5790543d
PE
63612012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6362
6363 * sysdep.c [__FreeBSD__]: Minor cleanups.
6364 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6365 Use Emacs indenting style more consistently. Avoid some casts.
6366 Use 'double' consistently rather than mixing 'float' and 'double'.
6367
b91b7e4d
EW
63682012-04-21 Eduard Wiebe <usenet@pusto.de>
6369
b593d6a9
AH
6370 * sysdep.c (list_system_processes, system_process_attributes):
6371 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 6372
6114eb15
AS
63732012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6374
6375 * lisp.mk (lisp): Update.
6376
2f38dff7
PE
63772012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6378
6379 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6380 It is never used otherwise.
6381
4ae29f89
SM
63822012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6383
6384 * print.c (print_preprocess): Only check print_depth if print-circle
6385 is nil.
6386 (print_object): Check for cycles even when print-circle is nil and
6387 print-gensym is t, but only check print_depth if print-circle is nil.
6388
f30d612a
CY
63892012-04-20 Chong Yidong <cyd@gnu.org>
6390
6391 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6392 set the status to "failed" and ensure that sentinel is run.
6393
c07a4c0b 63942012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
6395
6396 * process.c (Fset_process_inherit_coding_system_flag)
6397 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 6398 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 6399
c07a4c0b 64002012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
6401
6402 * xdisp.c (string_buffer_position_lim): Limit starting position to
6403 BEGV.
6404 (set_cursor_from_row): If called for a mode-line or header-line
6405 row, return zero immediately.
6406 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
6407 farther than the first row after the header line, if any.
6408 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
6409 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6410
c07a4c0b 64112012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6412
4ae29f89
SM
6413 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6414 (bug#11238).
ad3a2b41 6415
c07a4c0b 64162012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 64172012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
6418
6419 configure: new option --enable-gcc-warnings (Bug#11207)
6420 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6421 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6422 (ALL_CFLAGS): Use new macros rather than old.
6423 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6424 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6425 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6426 -Wunused-result, -Wunused-variable. This should go away once
6427 the Emacs and Gnulib regex code is merged.
6428 (xmalloc, xrealloc): Now static.
6429
aba027e8
PE
64302012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6431
6432 * dired.c (Fsystem_groups): Remove unused local.
6433
e5a36063
GM
64342012-04-17 Glenn Morris <rgm@gnu.org>
6435
6436 * dired.c (Fsystem_users): Doc fix.
6437
316411f0
DA
64382012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6439
6440 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6441 (syms_of_dired): Add them.
6442
9426aba4
PE
64432012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6444
b62a57be
PE
6445 Fix minor alloc.c problems found by static checking.
6446 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6447 New extern decls, to avoid calling undeclared functions.
6448 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6449 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6450 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6451 (NEED_MEM_INSERT): New macro.
6452 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 6453 Remove one incorrect comment and fix another.
b62a57be 6454
3539f31f
PE
6455 Fix minor ralloc.c problems found by static checking.
6456 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6457 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6458 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6459 (r_alloc_sbrk): Now static.
6460
a041960a
PE
6461 Improve ralloc.c interface checking.
6462 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6463 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6464 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6465 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6466 [REL_ALLOC]: ... to here, to check interface.
6467 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6468 Remove decls. This fixes an "It stinks!".
6469
9426aba4
PE
6470 * alloc.c (which_symbols): Fix alignment issue / type clash.
6471
d55c12ed
AS
64722012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6473
6474 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6475 (struct Lisp_Misc_Any): Likewise.
6476 (struct Lisp_Free): Likewise.
6477 * alloc.c (union aligned_Lisp_Symbol): Define.
6478 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6479 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6480 (union aligned_Lisp_Misc): Define.
6481 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6482 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 6483 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 6484
b948ce8b
PE
64852012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6486
6487 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6488 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6489 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6490 * s/netbsd.h, s/sol2-6.h:
6491 Remove definition of GC_MARK_STACK, since the default now works.
6492 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6493 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6494 no longer the default.
6495 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6496
35dc09a1 64972012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6498
35dc09a1
GM
6499 * lread.c (lisp_file_lexically_bound_p):
6500 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 6501
35dc09a1
GM
65022012-04-14 Eli Zaretskii <eliz@gnu.org>
6503
6504 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6505 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6506
65072012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6508
6509 * nsterm.m (constrainFrameRect): Always constrain when there is only
6510 one screen (Bug#10962).
6511
bcd86815
KB
65122012-04-13 Ken Brown <kbrown@cornell.edu>
6513
6514 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6515
c25df26e
RT
65162012-04-13 Reuben Thomas <rrt@sc3d.org>
6517
6518 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6519
0fc59f1e
DC
65202012-04-11 Daniel Colascione <dancol@dancol.org>
6521
6522 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6523 against is gone. It's better to use vfork now so that when Cygwin
6524 gains a new, working vfork, we use it automatically (bug#10398).
6525
de8c03dc
SM
65262012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6527
6528 * window.c (save_window_save): Obey window-point-insertion-type.
6529
2f097256
GM
65302012-04-11 Glenn Morris <rgm@gnu.org>
6531
6532 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6533
453b951e
SM
65342012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6535
6536 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6537
75f1671a 65382012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
6539
6540 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6541 (force_quit_count): New var.
6542 (handle_interrupt): Use it.
6543
2a8ce227
JB
65442012-04-10 Juanma Barranquero <lekktu@gmail.com>
6545
6546 * w32.c (w32_delayed_load): Record the full path of the library
6547 being loaded (bug#10424).
6548
935396c0
GM
65492012-04-09 Glenn Morris <rgm@gnu.org>
6550
05920a43
GM
6551 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6552 not just in the obarray, before snarfing them. (Bug#11036)
6553
935396c0
GM
6554 * Makefile.in ($(leimdir)/leim-list.el):
6555 Pass EMACS rather than BUILT_EMACS.
6556
a18ecafa
TZ
65572012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6558
6559 * process.c (make_process):
6560 * process.h: Add integer `gnutls_handshakes_tried' member to
6561 process struct.
6562
6bbef4e5
JC
6563 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6564 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
6565
6566 * gnutls.c (gnutls_log_function2i): Convenience log function.
6567 (emacs_gnutls_read): Use new log functions,
6568 `gnutls_handshakes_tried' process member, and
6569 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6570 attempts per process (connection).
6571
b4d3bc10
CY
65722012-04-09 Chong Yidong <cyd@gnu.org>
6573
6574 * eval.c (Fuser_variable_p, user_variable_p_eh)
6575 (lisp_indirect_variable): Functions deleted.
6576 (Fdefvar): Caller changed.
6577
6578 * callint.c (Finteractive, Fcall_interactively):
6579 * minibuf.c (Fread_variable): Callers changed.
6580
70f4d973
EZ
65812012-04-09 Eli Zaretskii <eliz@gnu.org>
6582
6583 * xdisp.c (set_cursor_from_row): If the display string appears in
6584 the buffer at position that is closer to point than the position
6585 after the display string, display the cursor on the first glyph of
6586 the display string. Fixes cursor display when a 'display' text
6587 property immediately follows invisible text. (Bug#11094)
6588
cb3c2e3e
PE
65892012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6590
6591 composite.c: use 'double' consistently
6592 * composite.c (get_composition_id): Use 'double' consistently
6593 instead of converting 'float' to 'double' and vice versa; this is
6594 easier to understand and avoids a GCC warning.
6595
fd06db5d
GM
65962012-04-09 Glenn Morris <rgm@gnu.org>
6597
50fe702a
GM
6598 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6599 preparation for dumping it with emacs. (Bug#4789)
6600 (leimdir): New variable.
6601 ($(leimdir)/leim-list.el): New rule.
6602 (emacs$(EXEEXT)): Depend on leim-list.el.
6603
fd06db5d
GM
6604 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6605 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6606 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6607
55c131ee
AS
66082012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6609
6610 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6611 proper alignment.
6612
9209588f
JB
66132012-04-07 Juanma Barranquero <lekktu@gmail.com>
6614
6615 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6616 Remove unused local variable.
6617
e3fb2efb
PE
66182012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6619
6620 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6621 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6622 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6623 objects, as mark_maybe_pointer will catch them otherwise.
6624 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6625 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6626
b5385551
PE
66272012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6628
6629 Fix typo that broke non-Windows builds.
6630 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6631
9078ead6
EZ
66322012-04-07 Eli Zaretskii <eliz@gnu.org>
6633
6634 Support building on MS-Windows with libxml2.
6635
6636 * makefile.w32-in (OBJ2): Add xml.$(O).
6637 (GLOBAL_SOURCES): Add xml.c.
6638 ($(BLD)/xml.$(O)): New dependency list.
6639
6640 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6641 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6642 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6643 [!WINDOWSNT]: New macros.
6644 (init_libxml2_functions, libxml2_loaded_p): New functions.
6645 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6646 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6647 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6648 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6649 linked in).
6bbef4e5
JC
6650 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6651 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
6652 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6653
6654 * emacs.c: Don't include libxml/parser.h.
6655 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6656 xmlCleanupParser directly.
6657
6658 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6659
3811fdf3
EZ
66602012-04-07 Eli Zaretskii <eliz@gnu.org>
6661
6662 * indent.c (Fvertical_motion): If there is a display string at
6663 point, use it.vpos to compute how many lines to backtrack after
6664 move_it_to point. (Bug#11133)
6665
2f8e16b2
EZ
66662012-04-06 Eli Zaretskii <eliz@gnu.org>
6667
6668 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6669 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6670 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6671 macros related to unification of CJK characters. For the details,
6672 see the discussion following the message here:
6673 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6674
3d439cd1
CY
66752012-04-04 Chong Yidong <cyd@gnu.org>
6676
6677 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6678
8bc53d00
EZ
66792012-04-01 Eli Zaretskii <eliz@gnu.org>
6680
6681 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6682 instead of alloca. (Bug#11138)
6683
3b0512a3
AS
66842012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6685
6686 * w32menu.c (is_simple_dialog): Properly check lisp types.
6687 (Bug#11141)
6688
8427ddd2
EZ
66892012-03-31 Eli Zaretskii <eliz@gnu.org>
6690
979022ef
EZ
6691 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6692 position we get to after a call to move_it_to fails the
6693 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6694 only if we wind up in a string from display property. (Bug#11063)
6695
a6b1c7cc
EZ
6696 * window.c (Fdelete_other_windows_internal): Invalidate the row
6697 and column information about mouse highlight, so that redisplay
6698 restores it after reallocating the glyph matrices. (Bug#7464)
6699
8427ddd2
EZ
6700 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6701 string comes from a `display' text property, use the buffer
6702 position of that property as if we actually saw that position in
6703 the row's glyphs.
697ba24b
EZ
6704 (move_it_by_lines): Remove the assertion that
6705 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6706 violated when there's a before-string at the beginning of a line.
6707 (Bug#11063)
8427ddd2 6708
65a0a738
EZ
67092012-03-30 Eli Zaretskii <eliz@gnu.org>
6710
6711 * xdisp.c (append_space_for_newline): If the default face was
6712 remapped, use the remapped face for the appended newline.
6713 (extend_face_to_end_of_line): Use the remapped default face for
6714 extending the face to the end of the line.
6715 (display_line): Call extend_face_to_end_of_line when the default
6716 face was remapped. (Bug#11068)
6717
581355cc
EZ
67182012-03-29 Eli Zaretskii <eliz@gnu.org>
6719
6720 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6721
e8fc049f
SM
67222012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6723
6724 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6725
4fb9a543
GM
67262012-03-27 Glenn Morris <rgm@gnu.org>
6727
6728 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6729 Doc fixes.
6730
679910f1
KH
67312012-03-26 Kenichi Handa <handa@m17n.org>
6732
6733 * dispextern.h (struct glyph): Fix previous change. Change the
6734 bit length of glyphless.ch to 25 (Bug#11082).
6735
90d49b7f
CY
67362012-03-26 Chong Yidong <cyd@gnu.org>
6737
6738 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6739 (command_loop_1): Use it; inhibit selection update for
6740 handle-select-window too (Bug#8996).
6741
f514f6f0
FP
67422012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6743
e8fc049f 6744 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 6745
bf43fa51
KH
67462012-03-25 Kenichi Handa <handa@m17n.org>
6747
6748 * dispextern.h (struct glyph): Change the bit length of
6749 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6750
8a0c01dd
EZ
67512012-03-24 Eli Zaretskii <eliz@gnu.org>
6752
6753 * s/ms-w32.h (tzname): Include time.h before redirecting to
6754 _tzname. Fixes the MSVC build. (Bug#9960)
6755
7d1c3a76
AS
67562012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6757
8ed79523
AS
6758 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6759 characters.
6760
7d1c3a76
AS
6761 * xterm.c (XTread_socket): Only modify handling_signal if
6762 !SYNC_INPUT. (Bug#11080)
6763
e99a9b8b
EZ
67642012-03-23 Eli Zaretskii <eliz@gnu.org>
6765
6766 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6767 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6768 when fetching a multibyte character consumes more bytes than
6769 CHAR_BYTES returns, due to unification of CJK characters in
6770 string_char. (Bug#11073)
6771
5063c0e1
TN
67722012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6773
6774 * process.c (wait_reading_process_output): Handle pty disconnect
6775 by refraining from sending oneself a SIGCHLD (bug#10933).
6776
9f851fbd
CY
67772012-03-22 Chong Yidong <cyd@gnu.org>
6778
6779 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6780
5063c0e1 6781 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
6782 Mark string as coming from a prefix property.
6783 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6784 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6785
fb5b8aca
CY
67862012-03-21 Chong Yidong <cyd@gnu.org>
6787
6788 * xfaces.c (Vface_remapping_alist): Doc fix.
6789
62356a1b
EZ
67902012-03-20 Eli Zaretskii <eliz@gnu.org>
6791
6792 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
6793 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6794 Doc fixes.
62356a1b 6795
025de85b
CY
67962012-03-20 Chong Yidong <cyd@gnu.org>
6797
6798 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6799 to reflect default non-nil value of redisplay-dont-pause.
6800
4827f94e
KH
68012012-03-19 Kenichi Handa <handa@m17n.org>
6802
6803 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6804 it fit in a valid range (Bug#11003).
6805
e50a24a2
EZ
68062012-03-18 Eli Zaretskii <eliz@gnu.org>
6807
6808 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6809 that is not from display property, accept the row as a "cursor
6810 row" if one of the string's character has a non-nil `cursor'
6811 property. Fixes cursor positioning when there are newlines in
6812 overlay strings, e.g. in icomplete.el. (Bug#11035)
6813
9af5ed87
PE
68142012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6815
6816 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6817
d1f55f16
CY
68182012-03-12 Chong Yidong <cyd@gnu.org>
6819
6820 * eval.c (inhibit_lisp_code): Rename from
6821 inhibit_window_configuration_change_hook; move from window.c.
6822
6823 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6824 * window.c (run_window_configuration_change_hook)
6825 (syms_of_window): Callers changed.
6826
66c5eebd
CY
68272012-03-11 Chong Yidong <cyd@gnu.org>
6828
413df973
CY
6829 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6830
66c5eebd
CY
6831 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6832
1de11f56
CY
68332012-03-10 Chong Yidong <cyd@gnu.org>
6834
6835 * frame.c (other_visible_frames): Don't assume the selected frame
6836 is visible (Bug#10955).
6837
cae07000
SM
68382012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6839
6840 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6841
89c94350
JD
68422012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6843
6844 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6845 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6846 zero (Bug#10954).
6847
999dd333
GM
68482012-03-03 Glenn Morris <rgm@gnu.org>
6849
01a6dcc8 6850 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 6851
de0100f2
EZ
68522012-03-02 Eli Zaretskii <eliz@gnu.org>
6853
6854 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6855 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
6856 (redisplay_window, next_element_from_string): Fix typos in
6857 comments.
3e441275
EZ
6858 (redisplay_window): Pass to move_it_vertically the margin in
6859 pixels, not in screen lines.
de0100f2 6860
96a72ee9
GM
68612012-03-02 Glenn Morris <rgm@gnu.org>
6862
6863 * buffer.c (buffer-list-update-hook): Doc fix.
6864
312508d7
EZ
68652012-02-29 Eli Zaretskii <eliz@gnu.org>
6866
6867 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6868 push_it before setting up the iterator for the first overlay
6869 string, even if we have an empty string loaded.
6870 (next_overlay_string): If there's an empty string on the iterator
6871 stack, pop the stack. (Bug#10903)
6872
27f3c637
PE
68732012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6874
6875 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6876 Suggested by Stefan Monnier in
6877 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6878 * alloc.c (widen_to_Lisp_Object): New static function.
6879 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6880 and widening them to Lisp_Objects. This would work even if
6881 USE_LSB_TAG is defined and wide integers are used, which might
6882 happen in a future version of Emacs.
6883
3c9dfce6
CY
68842012-02-25 Chong Yidong <cyd@gnu.org>
6885
fa74b241
CY
6886 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6887 Doc fix.
6888
3c9dfce6
CY
6889 * xselect.c (Fx_selection_exists_p): Doc fix.
6890 (x_clipboard_manager_save_all): Print an informative message
6891 before saving to clipboard manager.
6892
9486df08
CY
68932012-02-24 Chong Yidong <cyd@gnu.org>
6894
6895 * keyboard.c (process_special_events): Handle all X selection
6896 requests in kbd_buffer, not just the next one (Bug#8869).
6897
f01d3321
CY
68982012-02-23 Chong Yidong <cyd@gnu.org>
6899
6900 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6901 call when setting menu-bar-lines and tool-bar-lines parameters.
6902 (unwind_create_frame_1): New helper function.
6903
6904 * window.c (inhibit_window_configuration_change_hook): New var.
6905 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 6906 (syms_of_window): Initialize it.
f01d3321 6907
86b847b6
CY
69082012-02-22 Chong Yidong <cyd@gnu.org>
6909
6910 * xterm.c (x_draw_image_relief): Add missing type check for
6911 Vtool_bar_button_margin (Bug#10743).
6912
a59225b1
CY
69132012-02-21 Chong Yidong <cyd@gnu.org>
6914
6915 * fileio.c (Vfile_name_handler_alist): Doc fix.
6916
6917 * buffer.c (Fget_file_buffer): Protect against invalid file
6918 handler return value.
6919
310f5bd4
PE
69202012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6921
cb3a28cc
PE
6922 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6923 when computing $valmask.
6924
310f5bd4
PE
6925 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
6926 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
6927 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
6928 It's useless in that case, and it can cause problems on hosts
6929 that allocate halves of EMACS_INT values separately.
6930 Reported by Dan Horák. Diagnosed by Andreas Schwab in
6931 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
6932 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
6933 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
6934 it avoids undefined behavior on hosts where shifting right by more
6935 than the word width has undefined behavior.
6936
2375c96a
CY
69372012-02-19 Chong Yidong <cyd@gnu.org>
6938
6939 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
6940 (Funhandled_file_name_directory, Ffile_name_as_directory)
6941 (Fdirectory_file_name, Fexpand_file_name)
6942 (Fsubstitute_in_file_name): Protect against invalid file handler
6943 return values (Bug#10845).
6944
3eb49e71
EZ
69452012-02-18 Eli Zaretskii <eliz@gnu.org>
6946
6947 * .gdbinit (pitx): Fix incorrect references to fields of the
6948 iterator stack.
6949
7b926f3f
CY
69502012-02-17 Chong Yidong <cyd@gnu.org>
6951
6952 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
6953
11273115
PE
69542012-02-15 Paul Eggert <eggert@cs.ucla.edu>
6955
6956 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
6957 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
6958
c3a70e2b
CY
69592012-02-15 Chong Yidong <cyd@gnu.org>
6960
6961 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
6962 marked as special. Also, starting docstrings with * is obsolete.
6963
0ca43699
AS
69642012-02-13 Andreas Schwab <schwab@linux-m68k.org>
6965
6966 * gnutls.c (emacs_gnutls_write): Fix last change.
6967
2e8f3c56
LI
69682012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
6969
6970 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
6971 send_process.
6972
af70074f
SM
69732012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
6974
6975 * keymap.c (Fsingle_key_description): Handle char ranges.
6976
95986d52
CY
69772012-02-12 Chong Yidong <cyd@gnu.org>
6978
afd83bd1
CY
6979 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
6980 as that creates a dangerous corner case.
6981
95986d52
CY
6982 * window.c (Fdelete_window_internal): Invalidate the mouse
6983 highlight (Bug#9904).
6984
bd7da63e
GM
69852012-02-12 Glenn Morris <rgm@gnu.org>
6986
6987 * xselect.c (Fx_own_selection_internal)
6988 (Fx_get_selection_internal, Fx_disown_selection_internal)
6989 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
6990 * nsselect.m (Fx_own_selection_internal)
6991 (Fx_disown_selection_internal, Fx_selection_exists_p)
6992 (Fx_selection_owner_p, Fx_get_selection_internal):
6993 Sync docs and argument specs with the xselect.c versions.
6994
77abcbc2
LI
69952012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
6996
6997 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
6998
90b671e2
EZ
69992012-02-11 Eli Zaretskii <eliz@gnu.org>
7000
1c0ca0b7
EZ
7001 * w32select.c (Fx_selection_exists_p): Sync doc string and
7002 argument list with xselect.c. (Bug#10783)
7003
7004 * w16select.c (Fx_selection_exists_p): Sync doc string and
7005 argument list with xselect.c. (Bug#10783)
90b671e2 7006
49241268
GM
70072012-02-10 Glenn Morris <rgm@gnu.org>
7008
7009 * fns.c (Fsecure_hash): Doc fix.
7010
f998bbe7 70112012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
7012
7013 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7014
0992bd9c
CY
70152012-02-07 Chong Yidong <cyd@gnu.org>
7016
7017 * buffer.c (Fbuffer_local_variables)
7018 (buffer_lisp_local_variables): Handle unbound vars correctly;
7019 don't let Qunbound leak into Lisp.
7020
af008560
GM
70212012-02-07 Glenn Morris <rgm@gnu.org>
7022
dd605cc4
GM
7023 * image.c (Fimagemagick_types): Doc fix.
7024
af008560
GM
7025 * image.c (imagemagick-render-type): Change it from a lisp object
7026 to an integer. Move the doc here from the lisp manual.
7027 Treat all values not equal to 0 the same.
7028
1449fa1d
CY
70292012-02-06 Chong Yidong <cyd@gnu.org>
7030
7031 * doc.c (store_function_docstring): Avoid applying docstring of
7032 alias to base function (Bug#2603).
7033
3723ec07
AS
70342012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7035
7036 * .gdbinit (pp1, pv1): Remove redundant defines.
7037 (pr): Use pp.
7038
79c1cc1e
CY
70392012-02-04 Chong Yidong <cyd@gnu.org>
7040
7041 * nsterm.m: Declare a global (Bug#10694).
7042
d7f29f8e
EZ
70432012-02-04 Eli Zaretskii <eliz@gnu.org>
7044
cae07000
SM
7045 * w32.c (get_emacs_configuration_options):
7046 Include --enable-checking, if specified, in the return value.
d7f29f8e 7047
3b95a6f9
MR
70482012-02-04 Martin Rudalics <rudalics@gmx.at>
7049
7050 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7051 after rounding frame sizes. (Bug#9723)
7052
d6fa96a6
EZ
70532012-02-04 Eli Zaretskii <eliz@gnu.org>
7054
7055 * keyboard.c (adjust_point_for_property): Don't position point
7056 before BEGV. (Bug#10696)
7057
df0b2940
PE
70582012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7059
7060 Handle overflow when computing char display width (Bug#9496).
7061 * character.c (char_width): Return EMACS_INT, not int.
7062 (char_width, c_string_width): Check for overflow when
7063 computing the width; this is possible now that individual
7064 characters can have unbounded width. Problem introduced
7065 by merge from Emacs 23 on 2012-01-19.
7066
6bee44d6
MA
70672012-02-02 Michael Albinus <michael.albinus@gmx.de>
7068
7069 * dbusbind.c (Fdbus_register_method): Mention the return value
7070 :ignore in the docstring.
7071
44f92739
GM
70722012-02-02 Glenn Morris <rgm@gnu.org>
7073
1b9f60cc
GM
7074 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7075
44f92739
GM
7076 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7077 Unconditionally set to t. (Bug#10673)
7078 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7079 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7080 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7081
c5d3843c
KH
70822012-02-02 Kenichi Handa <handa@m17n.org>
7083
7084 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7085 0, do not call append_composite_glyph.
7086
159462d4 70872012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
7088
7089 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7090 NULL (Bug#6988).
7091 (x_produce_glyphs): If the component of a composition is a null
7092 string, set it->pixel_width to 1 to avoid zero-width glyph.
7093
78cef877
EZ
70942012-02-01 Eli Zaretskii <eliz@gnu.org>
7095
7096 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7097 first 2 arguments are identical. This makes inserting large
7098 output from a subprocess an order of magnitude faster on
7099 MS-Windows, where all sbrk'ed memory is always contiguous.
7100
97897668
GM
71012012-01-31 Glenn Morris <rgm@gnu.org>
7102
7103 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 7104 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
7105 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7106
31fd3586
GM
71072012-01-29 Glenn Morris <rgm@gnu.org>
7108
7109 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7110
0e24a8b2
CY
71112012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7112
7113 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7114
cc0adcb0
CY
71152012-01-28 Chong Yidong <cyd@gnu.org>
7116
7117 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7118
acc28cb9
CY
71192012-01-26 Chong Yidong <cyd@gnu.org>
7120
9c69cfb7
CY
7121 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7122
acc28cb9
CY
7123 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7124 repeat counts (Bug#10507).
7125
48da7392
GM
71262012-01-26 Glenn Morris <rgm@gnu.org>
7127
7128 * lread.c (syms_of_lread): Doc fix.
7129
14af5f7f
CY
71302012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7131
7132 * coding.c (encode_designation_at_bol): Change return value to
7133 EMACS_INT.
7134
0b21c100
CY
71352012-01-25 Chong Yidong <cyd@gnu.org>
7136
7137 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7138
3c2907f7
CY
71392012-01-21 Chong Yidong <cyd@gnu.org>
7140
7141 * floatfns.c (Fcopysign): Make the second argument non-optional,
7142 since nil is not allowed anyway.
7143
959ad23f
AS
71442012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7145
7146 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7147 (send_process): Likewise.
7148
34a02f46
MR
71492012-01-19 Martin Rudalics <rudalics@gmx.at>
7150
7151 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
7152 (Vwindow_persistent_parameters): Do not use Qstate.
7153 Rewrite doc-strings.
34a02f46 7154
1259009a 71552012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
7156
7157 * character.c (char_width): New function.
70d4fdf6
GM
7158 (Fchar_width, c_string_width, lisp_string_width):
7159 Use char_width (Bug#9496).
25ed9e61 7160
6a6ee00d
MR
71612012-01-16 Martin Rudalics <rudalics@gmx.at>
7162
7163 * window.c (Vwindow_persistent_parameters): New variable.
7164 (Fset_window_configuration, save_window_save): Handle persistent
7165 window parameters.
7166
c85efaf7
EZ
71672012-01-14 Eli Zaretskii <eliz@gnu.org>
7168
7169 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7170 thrashing the stack of the thread. (Bug#9087)
7171
5944709e
PE
71722012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7173
7174 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7175
e71f5d99
EZ
71762012-01-11 Eli Zaretskii <eliz@gnu.org>
7177
7178 * xdisp.c (rows_from_pos_range): Handle the case where the
7179 highlight ends on a newline. (Bug#10464)
7180 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7181 he end column for display of highlight that ends on a newline
7182 before a R2L line.
7183
ce316182
GM
71842012-01-11 Glenn Morris <rgm@gnu.org>
7185
7186 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7187 from load-path also when installation-directory is nil. (Bug#10208)
7188
5b43da69
GM
71892012-01-10 Glenn Morris <rgm@gnu.org>
7190
74cc8ff9
GM
7191 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7192
7d8d6e4e
GM
7193 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7194 Update template values to be closer to their typical values these days.
5b43da69 7195
a0db8d43
EZ
71962012-01-09 Eli Zaretskii <eliz@gnu.org>
7197
7198 * xdisp.c (rows_from_pos_range): Accept additional argument
7199 DISP_STRING, and accept any glyph in a row whose object is that
7200 string as eligible for mouse highlight. Fixes mouse highlight of
7201 display strings from overlays. (Bug#10464)
7202
9a0115ab 72032012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 7204
b9110d6a 7205 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
7206 * fileio.c (auto_saving_dir_umask): New static var.
7207 (Fmake_directory_internal): Use it.
7208 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7209 creating the directory. The old code temporarily assigns
7210 too-generous permissions to the directory.
7211 (do_auto_save_eh): Clear it.
b9110d6a 7212 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
7213 that the var is always cleared.
7214
6c1bd3f3
EZ
72152012-01-07 Eli Zaretskii <eliz@gnu.org>
7216
7217 * search.c (scan_buffer): Pass character positions to
7218 know_region_cache, not byte positions. (Bug#6540)
7219
069d2b50
L
72202012-01-07 LynX <_LynX@bk.ru> (tiny change)
7221
7222 * w32.c (sys_rename): Report EXDEV when rename of a directory
7223 fails because the target is on another logical disk. (Bug#10284)
7224
75bf0d33
DB
72252012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7226
7227 * xterm.c (x_embed_request_focus): New function.
7228
7229 * xterm.h: Add prototype.
7230
7231 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7232
1c6e5a32
GM
72332012-01-05 Glenn Morris <rgm@gnu.org>
7234
7235 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7236
651e947e
EZ
72372012-01-01 Eli Zaretskii <eliz@gnu.org>
7238
7239 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7240 Load gnutls_transport_set_lowat only if GnuTLS version is below
7241 2.11.1.
7242 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7243 GnuTLS versions below 2.11.1.
7244
3778cdd8
AL
72452011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7246
7247 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7248 to the doc string advising against its use for altering the way
7249 windows are scrolled.
7250
0e5317f7
KH
72512011-12-28 Kenichi Handa <handa@m17n.org>
7252
7253 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7254 coding-system ASCII compatible only when it does not produce BOM
7255 on encoding (Bug#10383).
7256
93d5ca1f
JD
72572011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7258
7259 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7260 can scroll.
7261 (create_and_show_popup_menu): Always use menu_position_func for
7262 Gtk3 (Bug#10361).
7263
ca22b785
AS
72642011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7265
7266 * callint.c (Fcall_interactively): Don't truncate prompt string.
7267
d048e1e6
EZ
72682011-12-23 Eli Zaretskii <eliz@gnu.org>
7269
7270 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7271 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 7272 resumed from there (after widening). (Bug#10360)
d048e1e6 7273
5ccaba1f
JD
72742011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7275
7276 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7277
204ee57f
JD
72782011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7279
b81d40f0
JB
7280 * nsterm.m (x_free_frame_resources):
7281 Release f->output_data.ns->miniimage.
204ee57f
JD
7282 (ns_index_color): Fix indentation. Do not retain
7283 color_table->colors[i].
7284
7285 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7286 before returning.
7287
7288 * nsfns.m (x_set_background_color): Assign return value from
7289 ns_index_color to face-background instead of NSColor*.
7290 (ns_implicitly_set_icon_type): Fix indentation.
7291 Change assignment in for loop to comparison.
7292
7293 * emacs.c (ns_pool): New variable.
7294 (main): Assign ns_pool.
7295 (Fkill_emacs): Call ns_release_autorelease_pool.
7296
7297 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7298 autorelease fdesc, release fdAttrs and tdict.
7299 (ns_get_covering_families): Release charset.
7300 (ns_findfonts): Release NSFontDescriptor created with new.
7301 (ns_uni_to_glyphs): Fix indentation.
7302 (setString): Release attrStr before assigning new value.
7303
c803b2b7
JD
73042011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7305
678f4426
JD
7306 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7307 and NS_IMPL_COCOA.
7308 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7309 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7310
cd394be1 73112011-12-18 David Reitter <reitter@cmu.edu>
678f4426 7312
5fecd5fc
JD
7313 * nsterm.m (ns_term_init): Subscribe for notifications
7314 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7315 to method trackingNotification in EmacsMenu.
7316
7317 * nsmenu.m (trackingMenu): New variable.
3771cb17 7318 (trackingNotification): New method (from Aquamacs).
5fecd5fc 7319 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 7320 from Aquamacs (Bug#7030).
678f4426
JD
7321
73222011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 7323
c803b2b7
JD
7324 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7325 (symbol_to_nsstring): Fix indentation.
7326 (ns_symbol_to_pb): New function.
cae07000
SM
7327 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7328 (Fns_rotate_cut_buffers_internal): Remove.
7329 (Fns_store_selection_internal): Rename from
c803b2b7
JD
7330 Fns_store_cut_buffer_internal.
7331 (ns_get_foreign_selection, Fx_own_selection_internal)
7332 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
7333 (Fns_get_selection_internal, Fns_store_selection_internal):
7334 Use ns_symbol_to_pb and check if return value is nil.
7335 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7336 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
7337 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7338 renamed to Sns_store_selection_internal.
7339 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7340 and remove this function.
7341 (ns_handle_selection_clear): Remove, never used.
7342 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7343 here.
7344
e1b01a3a
KB
73452011-12-17 Ken Brown <kbrown@cornell.edu>
7346
7347 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7348 GID is unknown (Bug#10257).
7349
2adb6e85
PE
73502011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7351
7352 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7353 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7354 which caused a build failure on GNU/Linux IA-64. This problem was
7355 introduced by my 2011-10-07 patch.
7356
d1d7b339
JL
73572011-12-15 Juri Linkov <juri@jurta.org>
7358
7359 * image.c (imagemagick_error): New function. (Bug#10112)
7360 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7361 Use `imagemagick_error' where ImageMagick functions return
7362 `MagickFalse'.
7363 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7364 proper order.
7365
100d5755
KH
73662011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7367
7368 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7369 fill background (Bug#8992).
7370
454592a6
MR
73712011-12-13 Martin Rudalics <rudalics@gmx.at>
7372
7373 * window.c (Vwindow_combination_resize)
7374 (Vwindow_combination_limit): Use t instead of non-nil in
7375 doc-strings.
61d4b438
MR
7376 (Vrecenter_redisplay): Add first sentence of doc-string on
7377 separate line.
53524d93 7378 (Frecenter): Fix doc-string typo.
454592a6 7379
3633e3aa
KH
73802011-12-11 Kenichi Handa <handa@m17n.org>
7381
7382 * coding.c (Funencodable_char_position): Pay attention to the
7383 buffer text relocation (Bug#9389).
7384
7b9d523a 73852011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 7386
7b9d523a
JD
7387 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7388 gtk_init (Bug#10100).
7389
b73189c6
EZ
73902011-12-10 Eli Zaretskii <eliz@gnu.org>
7391
7392 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7393 IT->string is nil. (Bug#10263)
7394
f7dfe5d6
JD
73952011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7396
83faebb4
JD
7397 * nsterm.h (x_free_frame_resources): Declare.
7398
f7dfe5d6
JD
7399 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7400 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7401
7402 * nsterm.h (ns_get_defaults_value): Declare.
7403
7404 * nsterm.m (ns_default): Call ns_get_defaults_value.
7405
7cd4e72c
EZ
74062011-12-09 Eli Zaretskii <eliz@gnu.org>
7407
7408 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7409 (Bug#10170)
7410
b34d7317
YM
74112011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7412
7413 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7414 that where the value of an _OBJC_* symbol points to is in the .bss
7415 section (Bug#10240).
7416
76470ad1
KH
74172011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7418
7419 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 7420 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 7421
745fff94
KH
74222011-12-08 Kenichi Handa <handa@m17n.org>
7423
7424 * ftfont.c (get_adstyle_property): Fix previous change
7425 (Bug#10233).
7426
6e44397c
JB
74272011-12-07 Juanma Barranquero <lekktu@gmail.com>
7428
7429 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7430 dirs from the default value of EMACSLOADPATH (bug#10208).
7431
7efa6272
GM
74322011-12-07 Glenn Morris <rgm@gnu.org>
7433
7434 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7435 installation and source directories as well. (Bug#10208)
7436
f6fc4d87
CY
74372011-12-06 Chong Yidong <cyd@gnu.org>
7438
7439 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7440
2bf26180
GM
74412011-12-06 Glenn Morris <rgm@gnu.org>
7442
7443 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7444 as an error, not just -1. (Bug#10217)
7445
3a6ad4f0
CY
74462011-12-05 Chong Yidong <cyd@gnu.org>
7447
7448 * keyboard.c (process_special_events): New function.
7449 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7450
75a3b399
PE
74512011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7452
7453 * coding.c (encode_designation_at_bol): Don't use uninitialized
7454 local variable (Bug#9318).
7455
c3c9e25e
KH
74562011-12-05 Kenichi Handa <handa@m17n.org>
7457
7458 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7459 return Qnil (Bug#8046, Bug#10193).
7460
5eb05ea3
KH
74612011-12-05 Kenichi Handa <handa@m17n.org>
7462
7463 * coding.c (encode_designation_at_bol): New args charbuf_end and
7464 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
7465 (coding_set_source): Return how many bytes coding->source was
7466 relocated.
7467 (coding_set_destination): Return how many bytes
7468 coding->destination was relocated.
7469 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 7470 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
7471
74722011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7473
7474 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7475 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7476 macro (Bug#9318).
7477
74782011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7479
7480 The following changes are to fix Bug#9318.
7481
a79703f5 7482 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
7483 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7484 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 7485 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 7486
7dbda6df
JB
74872011-12-05 Juanma Barranquero <lekktu@gmail.com>
7488
7489 * lisp.h (process_quit_flag): Fix external declaration.
7490
6d5eb5b0
SM
74912011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7492
7493 Don't macro-inline non-performance-critical code.
7494 * eval.c (process_quit_flag): New function.
7495 * lisp.h (QUIT): Use it.
7496
a0c3fad0
JD
74972011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7498
7499 * nsfns.m (get_geometry_from_preferences): New function.
7500 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7501
6c07aac2
AS
75022011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7503
7504 * emacs.c (Qkill_emacs): Define.
7505 (syms_of_emacs): Initialize it.
7506 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7507 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
7508 (quit_throw_to_read_char): Add parameter `from_signal'.
7509 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
7510 * lisp.h (QUIT): Call Fkill_emacs if requested.
7511
c052ead4
JD
75122011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7513
7514 * widget.c (update_wm_hints): Return if wmshell is null.
7515 (widget_update_wm_size_hints): New function.
7516
7517 * widget.h (widget_update_wm_size_hints): Declare.
7518
7519 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7520 widget_update_wm_size_hints (Bug#10104).
7521
9e49252b
EZ
75222011-12-03 Eli Zaretskii <eliz@gnu.org>
7523
7524 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7525 before a newline, prepare the bidi iterator for consuming the
7526 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 7527 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 7528
02b16839
JL
75292011-12-02 Juri Linkov <juri@jurta.org>
7530
7531 * search.c (Fword_search_regexp): New Lisp function created from
7532 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7533 (Fword_search_backward, Fword_search_forward)
7534 (Fword_search_backward_lax, Fword_search_forward_lax):
7535 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7536 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7537
0068070e
SM
75382011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7539
7540 * fileio.c (Finsert_file_contents): Move after-change-function call
7541 to before the "handled:" label, since all "goto handled" appear in
7542 cases where the *-change-functions have already been properly called
7543 (bug#10117).
7544
3360a3fc
AS
75452011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7546
7547 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7548 waiting for input. (Bug#10169)
7549
73d6c093
EZ
75502011-11-30 Eli Zaretskii <eliz@gnu.org>
7551
7552 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7553 verifies glyph row's hash code--we have just reallocated the
7554 glyphs, so their contents can be complete garbage. (Bug#10164)
7555
febe6bea
JB
75562011-11-30 Juanma Barranquero <lekktu@gmail.com>
7557
7558 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7559
801a4313
EZ
75602011-11-30 Eli Zaretskii <eliz@gnu.org>
7561
7562 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7563 attributes are tested _before_ calling verify_row_hash, to protect
7564 against GCC re-ordering of the tests. (Bug#10164)
7565
2b56b87e
JD
75662011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7567
7568 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7569
7570 * xterm.c (handle_one_xevent): Only set async_visible and friends
7571 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 7572 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
7573 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7574
dbf31225
PE
75752011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7576
7577 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7578 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7579 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7580 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7581 All uses changed to use GCPRO1 etc.
7582 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7583 Revert to old implementation (i.e., before 2011-03-11).
7584
1305621b
YM
75852011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7586
7587 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7588 of scroll runs so as to avoid assigning disabled bogus rows and
7589 unnecessary graphics copy operations.
7590
8c9afb46
EZ
75912011-11-27 Eli Zaretskii <eliz@gnu.org>
7592
7593 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7594 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7595 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7596 (malloc, free, realloc, calloc): Redirect to e_* only when
7597 compiling Emacs.
7598
7599 * lisp.h (GCTYPEBITS): Move before first use.
7600 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7601 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7602 this macro definition.
7603
7604 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7605 _MSC_VER.
7606
54e9e3bf
JD
76072011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7608
6d5eb5b0
SM
7609 * gtkutil.c (xg_create_frame_widgets):
7610 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
7611 present with Gtk+ 2.0.
7612
83aca1cb
PE
76132011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7614
7615 * fileio.c (Finsert_file_contents): Undo previous change; see
7616 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7617
5b76caa4
PE
76182011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7619
7620 Rename locals to avoid shadowing.
7621 * fileio.c (Finsert_file_contents):
7622 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7623 * process.c (wait_reading_process_output):
7624 Rename inner 'proc' to 'p' to avoid shadowing.
7625 Indent for consistency with usual Emacs style.
7626
8c535114
EZ
76272011-11-25 Eli Zaretskii <eliz@gnu.org>
7628
7629 * xdisp.c (redisplay_window): If cursor row is not fully visible
7630 after recentering, and scroll-conservatively is set to a large
7631 number, scroll window by a few more lines to make the cursor fully
7632 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
7633 (start_display): Don't move to the next line if the display should
7634 start at a newline that is part of a display vector or an overlay
7635 string. (Bug#10119)
8c535114 7636
fa4fdb5c
JL
76372011-11-24 Juri Linkov <juri@jurta.org>
7638
7639 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7640 after the `MagickPingImage' call. (Bug#10112)
7641
90ec88df
CY
76422011-11-23 Chong Yidong <cyd@gnu.org>
7643
7644 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7645
56e2e794
MR
76462011-11-23 Martin Rudalics <rudalics@gmx.at>
7647
7648 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7649 making another buffer current. (Bug#10114)
7650
b6e64c41
GM
76512011-11-23 Glenn Morris <rgm@gnu.org>
7652
7653 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7654
6b21de18
CY
76552011-11-23 Chong Yidong <cyd@gnu.org>
7656
7657 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7658 using it (Bug#5984).
7659
b12cd789
EZ
76602011-11-22 Eli Zaretskii <eliz@gnu.org>
7661
7662 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7663 and header-lines, as they don't have one computed for them.
7664 (Bug#10098)
7665
7666 * .gdbinit (prow): Make displayed values more self-explaining.
7667 Add row's hash code.
7668
261b6fd4
LMI
76692011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7670
7671 * process.c (wait_reading_process_output): Fix asynchrounous
7672 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 7673 (wait_reading_process_output): Add comment and URL.
261b6fd4 7674
e7cfd277
JD
76752011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7676
7677 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7678
a9b9b7f5
CY
76792011-11-21 Chong Yidong <cyd@gnu.org>
7680
7681 * window.c (Fnext_window, Fprevious_window): Doc fix.
7682
b0d15b4f
SM
76832011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7684
7685 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7686
fe7a3057
JB
76872011-11-20 Juanma Barranquero <lekktu@gmail.com>
7688
7689 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7690
d2999b1a
MR
76912011-11-20 Martin Rudalics <rudalics@gmx.at>
7692
7693 * window.c (Fset_window_combination_limit): Rename argument
7694 STATUS to LIMIT.
7695 (Vwindow_combination_limit): Remove "status" from doc-string.
7696
d5ff9cd0
AS
76972011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7698
7699 * m/ibms390.h: Remove.
7700 * m/ibms390x.h: Don't include "ibms390.h".
7701
a5bb9bd3
SM
77022011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7703
7704 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7705 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7706
cd1181db
JB
77072011-11-20 Juanma Barranquero <lekktu@gmail.com>
7708
7709 * casetab.c (Fset_case_table):
7710 * charset.c (Fcharset_after): Fix typos.
7711
615a3b8d 77122011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 7713
17e845af
PE
7714 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7715 Otherwise, valgrind does not work on some platforms.
7716 Problem reported by Andreas Schwab in
6a0bf43d
PE
7717 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7718 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7719 is set, removing the need for VIRT_ADDRESS_VARIES.
7720 (PURE_P): Use a more-efficient implementation that needs just one
7721 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7722 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7723 to 4 (xorl, subq, cmpq, setbe).
7724 * alloc.c (pure): Always extern now, since that's the
7725 VIRT_ADDR_VARIES behavior.
7726 (PURE_POINTER_P): Use a single comparison, not two, for
7727 consistency with the new puresize.h.
7728 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7729 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7730 Remove VIRT_ADDR_VARIES no longer needed.
7731
f8fe6f96
EZ
77322011-11-19 Eli Zaretskii <eliz@gnu.org>
7733
7734 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7735 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7736 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7737 behave as if the cursor position were at the window margin.
7738
7739 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7740 and the cursor position is out of bounds, behave as if the cursor
7741 position were at the window margin. (Bug#10075)
7742
df05a53c
CY
77432011-11-18 Chong Yidong <cyd@gnu.org>
7744
7745 * window.c (Fwindow_combination_limit): Make first argument
7746 non-optional, since it is meaningless for live windows like the
7747 selected window.
61ccba97 7748
2071918e
DA
77492011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7750
7751 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7752
b50a28de
SM
77532011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7754
7755 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7756 (graft_intervals_into_buffer): Simplify.
7757
015137db
EZ
77582011-11-18 Eli Zaretskii <eliz@gnu.org>
7759
7760 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7761 hash values of the two rows.
7762 (copy_row_except_pointers): Preserve the used[] arrays and the
7763 hash values of the two rows. (Bug#10035)
68c95424 7764 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
7765
7766 * xdisp.c (row_hash): New function, body extracted from
7767 compute_line_metrics.
7768 (compute_line_metrics): Call row_hash, instead of computing the
7769 hash code inline.
7770
7771 * dispnew.c (verify_row_hash): Call row_hash for computing the
7772 hash code of a row, instead of duplicating code from xdisp.c.
7773
7774 * dispextern.h (row_hash): Add prototype.
7775
a2addb04
TH
77762011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7777
7778 * frame.c (delete_frame): Don't delete the terminal when the last
7779 X frame is closed if emacs is built with GTK toolkit.
7780
df85d315
JB
77812011-11-17 Juanma Barranquero <lekktu@gmail.com>
7782
7783 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7784
a0c2d0ae
MR
77852011-11-17 Martin Rudalics <rudalics@gmx.at>
7786
7787 * window.c (Vwindow_splits): Rename to
7788 Vwindow_combination_resize. Suggested by Juri Linkov.
7789 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7790 of Vwindow_splits.
7791
58179cce
JB
77922011-11-16 Juanma Barranquero <lekktu@gmail.com>
7793
7877f373
JB
7794 * nsfns.m (Fns_font_name):
7795 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 7796
b6f67890
MR
77972011-11-16 Martin Rudalics <rudalics@gmx.at>
7798
7799 * window.h (window): Rename slot "nest" to "combination_limit".
7800 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7801 (Fset_window_nest): Rename to Fset_window_combination_limit.
7802 (Vwindow_nest): Rename to Vwindow_combination_limit.
7803 (recombine_windows, make_parent_window, make_window)
7804 (Fsplit_window_internal, saved_window)
7805 (Fset_window_configuration, save_window_save): Rename all
7806 occurrences of window_nest to window_combination_limit.
7807
c7015153
JB
78082011-11-15 Juanma Barranquero <lekktu@gmail.com>
7809
7810 * image.c (imagemagick_load_image): Fix typo.
7811
322ad6ec
EZ
78122011-11-14 Eli Zaretskii <eliz@gnu.org>
7813
7814 * xdisp.c (display_line): Move the call to
7815 highlight_trailing_whitespace before the call to
7816 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
7817 faces of all the glyphs to compute ROW's hash value.
7818 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 7819
f067b8ec
JB
78202011-11-14 Juanma Barranquero <lekktu@gmail.com>
7821
7822 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7823 just return (bug#10044).
7824
1e5b2111
EZ
78252011-11-12 Eli Zaretskii <eliz@gnu.org>
7826
7ef3cbd5
EZ
7827 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7828 with user-defined heap size. Bump the default size of the temacs
7829 heap to 27MB, to avoid memory warning when running temacs.
7830 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7831
1e5b2111
EZ
7832 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7833 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
7834 (verify_row_hash) [XASSERTS]: New function.
7835 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7836 that the hash value of glyph rows is correct.
1e5b2111 7837
89d61221
MR
78382011-11-12 Martin Rudalics <rudalics@gmx.at>
7839
7840 * window.h (window): Remove splits slot.
7841 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7842 (Fdelete_other_windows_internal, make_parent_window)
7843 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7844 (Fset_window_configuration, save_window_save): Don't deal with
7845 split status of windows.
7846 (saved_window): Remove splits slot.
7847 (Vwindow_splits): Rewrite doc-string.
7848
97f18cc8
JD
78492011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7850
7851 * xfns.c (unwind_create_frame):
7852 * nsfns.m (unwind_create_frame):
7853 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7854 Vframe_list (Bug#9999).
7855
22a648b4
DA
78562011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7857
0b381c7e 7858 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 7859
659afede
KH
78602011-11-11 Kenichi Handa <handa@m17n.org>
7861
7862 * callproc.c (Fcall_process): Set the member dst_multibyte of
7863 process_coding.
7864
9ac0394b
KH
78652011-11-11 Johan Bockgård <bojohan@gnu.org>
7866
7867 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7868 avoid a crash (bug#9496).
7869
2fbdc249
CY
78702011-11-09 Chong Yidong <cyd@gnu.org>
7871
7872 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7873 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7874
ac6b1f81
PE
78752011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7876
7877 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7878
09db192c
PE
78792011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7880
7881 Avoid some portability problems by eschewing 'extern inline' functions.
7882 The trivial performance wins aren't worth the portability hassles; see
7883 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7884 et seq.
7885 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7886 (window_box_width, window_box_left, window_box_left_offset)
7887 (window_box_right, window_box_right_offset): Undo previous change,
7888 by removing the "extern"s.
7889 * intervals.c (adjust_intervals_for_insertion)
7890 (adjust_intervals_for_deletion): Undo previous change,
7891 making these static again.
7892 (offset_intervals, temp_set_point_both, temp_set_point)
7893 (copy_intervals_to_string): No longer inline.
7894 * xdisp.c (window_text_bottom_y, window_box_width)
7895 (window_box_height, window_box_left_offset)
7896 (window_box_right_offset, window_box_left, window_box_right)
7897 (window_box): No longer inline.
7898
105216ed
CY
78992011-11-08 Chong Yidong <cyd@gnu.org>
7900
7901 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
7902 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7903 Signal an error if not a live window.
105216ed
CY
7904 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7905 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7906
ae9e237f
JB
79072011-11-07 Juanma Barranquero <lekktu@gmail.com>
7908
7909 * lisp.h (syms_of_abbrev): Remove declaration.
7910 Reported by CHENG Gao <chenggao@royau.me>.
7911
c7aa8333
EZ
79122011-11-07 Eli Zaretskii <eliz@gnu.org>
7913
7914 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7915 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7916 of temacs in GUI mode.
7917
be7f5545
MR
79182011-11-07 Martin Rudalics <rudalics@gmx.at>
7919
7920 * window.h: Declare delete_all_child_windows instead of
7921 delete_all_subwindows.
7922 * window.c (Fwindow_nest, Fset_window_nest)
7923 (Fset_window_new_total, Fset_window_new_normal)
7924 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
7925 (delete_all_subwindows): Rename to delete_all_child_windows.
7926 (Fdelete_other_windows_internal, Fset_window_configuration):
7927 Call delete_all_child_windows instead of delete_all_subwindows.
7928 * frame.c (delete_frame): Call delete_all_child_windows instead
7929 of delete_all_subwindows.
7930
ca78dc43
PE
79312011-11-07 Paul Eggert <eggert@cs.ucla.edu>
7932
7933 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
7934 This is also needed for porting to any host where GC_MARK_STACK is
7935 not GC_MAKE_GCPROS_NOOPS.
7936 (which_symbols): Use it.
7937
a0241d01
KH
79382011-11-07 Kenichi Handa <handa@m17n.org>
7939
7940 * coding.c (coding_set_destination): Check coding->src_pos only
7941 when coding->src_object is a buffer (bug#9910).
7942
7943 * process.c (send_process): Set the member src_multibyte of coding
7944 to 0 (bug#9911) when sending a unibyte text.
7945
7946 * callproc.c (Fcall_process): Set the member src_multibyte of
7947 process_coding to 0 (bug#9912).
7948
a64bfdfa 79492011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
7950
7951 * xmenu.c (cleanup_widget_value_tree): New function.
7952 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
7953 calling free_menubar_widget_value_tree directly (Bug#9830).
7954
cb41b32a
PE
79552011-11-06 Paul Eggert <eggert@cs.ucla.edu>
7956
7957 Fix some portability problems with 'inline'.
7958 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7959 (window_box_width, window_box_left, window_box_left_offset)
7960 (window_box_right, window_box_right_offset): Declare extern.
7961 Otherwise, these inline functions do not conform to C99 and
7962 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
7963 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
7964 * intervals.c (adjust_intervals_for_insertion)
7965 (adjust_intervals_for_deletion): Now extern, because otherwise the
7966 extern inline functions 'offset_intervals' couldn't refer to it.
7967 (static_offset_intervals): Remove.
7968 (offset_intervals): Rewrite using the old contents of
7969 static_offset_intervals. The old version didn't conform to C99
7970 because an extern inline function contained a reference to an
7971 identifier with static linkage.
7972
b7041366
AS
79732011-11-06 Andreas Schwab <schwab@linux-m68k.org>
7974
7975 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
7976 GC.
7977
88a37c4d
EZ
79782011-11-06 Eli Zaretskii <eliz@gnu.org>
7979
7980 * xdisp.c (init_iterator, reseat_to_string): Don't set the
7981 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
7982 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
7983 return Qleft_to_right.
7984
49745b39
CY
79852011-11-06 Chong Yidong <cyd@gnu.org>
7986
7987 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
7988 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
7989 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
7990 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
7991 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
7992 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
7993 (Fwindow_vscroll): Doc fix.
7994 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
7995 argument, since it makes no sense to pass a live window and for
7996 consistency with window-child.
7997
1f05cd82
CS
79982011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
7999
8000 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8001 support MSVC.
8002
22610910
JR
80032011-11-05 Jason Rumney <jasonr@gnu.org>
8004
8005 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8006 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8007 fonts (Bug#6029).
8008 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8009 bitwise arithmetic preventing use of unicode-sip and non-truetype
8010 opentype fonts.
8011
a06776b2
EZ
80122011-11-05 Eli Zaretskii <eliz@gnu.org>
8013
3ad924ba
EZ
8014 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8015 "emacs"-only part.
8016
a06776b2
EZ
8017 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8018 initialization code to keep similarity to xfns.c after changes
8019 from 2011-11-05.
8020
c9e7db78
JD
80212011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8022
a97f8f3f
JD
8023 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8024 (unwind_create_frame): New function (Bug#9943).
8025 (Fx_create_frame): Restructure code to be more similar to the one in
8026 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8027 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8028 Move terminal->reference_count++ just before making the frame official
8029 (Bug#9943).
8030
8031 * nsterm.m (x_free_frame_resources): New function.
8032 (x_destroy_window): Move code to x_free_frame_resources.
8033
c9e7db78 8034 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
8035 (Fx_create_frame, x_create_tip_frame):
8036 Move terminal->reference_count++ just before making the frame
75f1671a 8037 official. Move initialization of image_cache_refcount and
c9e7db78
JD
8038 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8039
a6fc3b5c
EZ
80402011-11-05 Eli Zaretskii <eliz@gnu.org>
8041
8042 Support MSVC build with newer versions of Visual Studio.
8043 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8044 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8045 nt/gmake.defs.
8046
8047 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8048 which are not supported by MSVC.
8049 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8050 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8051 bitfields.
8052 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8053 types in bitfields.
8054 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8055
8056 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8057
58179cce 80582011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
8059
8060 Support MSVC build with newer versions of Visual Studio.
8061 * w32.c: Don't include w32api.h for MSVC.
8062 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8063
8064 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8065 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8066 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8067 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8068 e_* cousins.
8069 (alloca) [_MSC_VER]: Define to _alloca.
8070
8071 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8072
8073 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8074
a58c13ed
EZ
80752011-11-04 Eli Zaretskii <eliz@gnu.org>
8076
8077 * xdisp.c (note_mouse_highlight): If either of
8078 previous/next-single-property-change returns nil, treat that as
8079 the beginning or the end of the buffer. (Bug#9955)
8080
fe0b6370
JD
80812011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8082
a58c13ed 8083 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
8084 label is not null (Bug#9951).
8085 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8086 may be NULL.
8087
89bd5ee1
EZ
80882011-11-04 Eli Zaretskii <eliz@gnu.org>
8089
8090 * window.c (Fwindow_body_size): Mention in the doc string that the
8091 return value is in frame's canonical units. (Bug#9949)
8092
84c3edb9
EZ
80932011-11-03 Eli Zaretskii <eliz@gnu.org>
8094
4e2fb5c7
EZ
8095 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8096
84c3edb9 8097 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 8098 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 8099 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 8100
bc17a887
EZ
81012011-11-01 Eli Zaretskii <eliz@gnu.org>
8102
8103 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8104 Don't stop backward scan on the continuation glyph, even though
8105 its CHARPOS is positive.
6d5eb5b0
SM
8106 (mouse_face_from_buffer_pos, note_mouse_highlight):
8107 Rename cover_string to disp_string.
bc17a887 8108
4ee88440
MR
81092011-11-01 Martin Rudalics <rudalics@gmx.at>
8110
8111 * window.c (temp_output_buffer_show): Don't use
8112 Vtemp_buffer_show_specifiers.
8113 (Vtemp_buffer_show_specifiers): Remove unused variable.
8114
c2ff3c02
EZ
81152011-10-30 Eli Zaretskii <eliz@gnu.org>
8116
8117 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8118 past the beginning of the current glyph matrix.
8119
58179cce 81202011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
8121
8122 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8123 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8124 HAVE_GTK3 (Bug#9869).
b77a6a7f 8125
3b574623
JD
8126 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8127 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8128
b77a6a7f
JD
8129 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8130
8131 * xterm.c: Declare x_handle_net_wm_state to return int.
8132 (handle_one_xevent): Check if we are iconified but don't have
8133 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8134 (get_current_wm_state): Return non-zero if not hidden,
8135 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8136 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8137 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8138 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8139
196e41e4
PE
81402011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8141
8142 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8143 so that this new function doesn't get optimized away by a
8144 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8145
021f2e1a
AS
81462011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8147
8148 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8149
8b058d44
EZ
81502011-10-29 Eli Zaretskii <eliz@gnu.org>
8151
8152 Fix the `xbytecode' command.
8153 * .gdbinit (xprintbytestr): New command.
b50a28de 8154 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
8155 (xbytecode): Print the byte-code string as well.
8156
4452fb80
EZ
81572011-10-29 Kim Storm <storm@cua.dk>
8158
8b058d44
EZ
8159 * alloc.c (which_symbols): New function.
8160
21b72067
AS
81612011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8162
8163 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8164 line. (Bug#9903)
8165
83ed7b5c
GM
81662011-10-29 Glenn Morris <rgm@gnu.org>
8167
8168 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8169 Not clear what it was for, and it causes various bugs. (Bug#9839)
8170
5a7a728b
EZ
81712011-10-28 Eli Zaretskii <eliz@gnu.org>
8172
8173 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8174 possible random value that matches one of those tested as
8175 condition to clear the mouse face.
8176
d3d0842f
CY
81772011-10-28 Chong Yidong <cyd@gnu.org>
8178
8179 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8180
31b39d13
DN
81812011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8182
8183 * window.c (make_window): Initialize phys_cursor_on_p.
8184
9aba6043
SM
81852011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8186
8187 * lisp.h (struct Lisp_Symbol): Update comments.
8188
c20992f4
JB
81892011-10-28 Juanma Barranquero <lekktu@gmail.com>
8190
8191 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8192
db4f02f2
EZ
81932011-10-28 Eli Zaretskii <eliz@gnu.org>
8194
8195 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8196 <oslsachem@gmail.com> for helping to debug this.
8197
8198 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8199 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8200 (g_b_init_get_glyph_outline_w): New static variables.
8201 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8202 (GetGlyphOutlineW_Proc): New typedefs.
8203 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
8204 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8205 New functions.
8206 (w32font_open_internal, compute_metrics):
8207 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
8208 instead of calling the "wide" APIs directly.
8209
8210 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8211
8212 * w32.h (syms_of_w32font): Add prototype.
8213
87e68db4
JB
82142011-10-27 Juanma Barranquero <lekktu@gmail.com>
8215
8216 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8217 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8218 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8219 (Fmove_to_window_line): Doc fix.
8220
435c1d67
CY
82212011-10-27 Chong Yidong <cyd@gnu.org>
8222
8223 * process.c (make_process): Set gnutls_state to NULL.
8224
8225 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8226 non-NULL, regardless of GNUTLS_INITSTAGE.
8227 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8228 an error. Set process slots as soon as we allocate them.
8229
8230 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8231
9c6c6f49
CY
82322011-10-27 Chong Yidong <cyd@gnu.org>
8233
9aba6043
SM
8234 * gnutls.c (emacs_gnutls_deinit): New function.
8235 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
8236 (Fgnutls_deinit, Fgnutls_boot): Use it.
8237
8238 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8239 (deactivate_process): Call emacs_gnutls_deinit.
8240
657d08d3
JB
82412011-10-27 Juanma Barranquero <lekktu@gmail.com>
8242
8243 * image.c (x_create_x_image_and_pixmap):
8244 * w32.c (sys_rename, w32_delayed_load):
8245 * w32font.c (fill_in_logfont):
8246 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8247
5430d399
JB
82482011-10-26 Juanma Barranquero <lekktu@gmail.com>
8249
8250 * w32fns.c (w32_default_color_map): New function,
8251 extracted from Fw32_default_color_map.
a7ef684b 8252 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 8253
fe0055fa
PE
82542011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8255
8256 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8257
e6346438
SM
82582011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8259
8260 * keyboard.c (test_undefined): New function (bug#9751).
8261 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8262
e112cc37
ET
82632011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8264
8265 * sysdep.c (init_sys_modes): Fix the check for the controlling
8266 terminal (Bug#6649).
8267
7b5d6677
EZ
82682011-10-20 Eli Zaretskii <eliz@gnu.org>
8269
8270 * dispextern.h (struct bidi_it): New member next_en_type.
8271
8272 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8273 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8274 current character, check also for next_en_type being WEAK_EN.
8275 (bidi_resolve_weak): Don't enter the expensive loop if the current
8276 position is before next_en_pos. Record the bidi type of the first
8277 non-ET, non-BN character we find, in addition to its position.
8278 (bidi_level_of_next_char): Invalidate next_en_type when
8279 next_en_pos is over-stepped.
8280
7da0b018
PE
82812011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8282
8283 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8284 * editfns.c: Rewrite current-time-zone so that it invokes
8285 the equivalent of (format-time-string "%Z") to get the time zone name.
8286 This fixes a bug when the time zone name contains characters that
8287 need converting from the system time locale to Emacs internal format.
8288 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8289 that patch fixed format-time-string to do the conversion, but
8290 I forgot to fix current-time-zone.
8291 (format_time_string): New function, containing most of
8292 what Fformat_time_string used to contain.
8293 (Fformat_time_string): Rewrite in terms of format_time_string.
8294 This doesn't change this function's behavior.
8295 (current-time-zone): Rewrite to use format_time_string.
8296 This fixes the bug reported by Michael Schierl in
8297 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8298 Jason Rumney's 2007-06-07 change worked around this bug, but
8299 didn't fix it.
8300 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8301
8547b010
EZ
83022011-10-19 Eli Zaretskii <eliz@gnu.org>
8303
8304 * xdisp.c (start_display): If the character at POS is displayed
8305 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
8306 (try_window_reusing_current_matrix): If a line ends in a display
8307 vector or the next line starts in a display vector, continue
8308 redrawing the window even though the character position of
8309 start_row was reached.
8547b010
EZ
8310 (Bug#9771, part 2)
8311
4e948d15
CY
83122011-10-18 Chong Yidong <cyd@gnu.org>
8313
8314 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8315 with nobreak-char-display too.
8316
4787455f
EZ
83172011-10-18 Eli Zaretskii <eliz@gnu.org>
8318
8319 Fix part 3 of bug#9771.
8320 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8321 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8322 non-neutral characters if the current character is a paragraph
8323 separator (a.k.a. Newline). This avoids running the same
8324 expensive loop twice, once when we consume the preceding newline
8325 and the other time when the line actually needs to be displayed.
8326 Avoid the loop when we see neutrals on the base embedding level
8327 following a character whose directionality is the same as the
8328 paragraph's. This avoids running the expensive loop when a line
8329 ends in a long sequence of neutrals, like control characters.
8330 Add assertion against STRONG_AL type. Slightly rearrange code
8331 that determines the type of a neutral given the first non-neutral
8332 that follows it.
8333 (bidi_level_of_next_char): Set next_en_pos to zero when
8334 invalidating its info.
8335
2c91f553
EZ
83362011-10-17 Eli Zaretskii <eliz@gnu.org>
8337
8338 * xdisp.c (push_display_prop): Determine whether to record string
8339 or buffer position by IT->string, not by IT->method. Allow
8340 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
8341 (move_it_vertically_backward): Don't look for character position
8342 immediately after the newline when in a continuation line.
8343 (Bug#9771, part 1)
2c91f553 8344
c7b08b0d
MR
83452011-10-15 Martin Rudalics <rudalics@gmx.at>
8346
8347 * window.c (coordinates_in_window): Rewrite and delabelize
8348 vertical border check. (Bug#5357) (Bug#9618)
8349
6b02f655
SM
83502011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8351
8352 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8353 errors in XSetWindowBorder (bug#9310).
8354
81d40c92
DA
83552011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8356
8357 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8358 avoid crash when xmalloc overrun checking is enabled.
8359
d4172c3b
EZ
83602011-10-13 Eli Zaretskii <eliz@gnu.org>
8361
8362 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8363 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8364 cursor motion with <left> and <right> arrow keys.
8365
8366 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8367 some callers set that themselves.
8368
b00eea75
EZ
83692011-10-12 Eli Zaretskii <eliz@gnu.org>
8370
8371 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8372 display string and the previous row comes from the same string and
8373 is empty. (Bug#9739) (Bug#9738)
8374
8fe012c4
SM
83752011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8376
8377 * doc.c (get_doc_string): Encode file name (bug#9735).
8378
0074aef2
EZ
83792011-10-12 Eli Zaretskii <eliz@gnu.org>
8380
79beb178
EZ
8381 * bidi.c (bidi_level_of_next_char):
8382 * xdisp.c (get_visually_first_element): Remove old incorrect
8383 comments regarding the Unicode Line Separator character.
8384
0074aef2
EZ
8385 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8386
6e4b3fbe
DA
83872011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8388
8389 * alloc.c (Fgc_status): Do not access beyond zombies array
8390 boundary if nzombies > MAX_ZOMBIES.
8391 * alloc.c (dump_zombies): Add missing format specifier.
8392
0324f3af
PE
83932011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8394
b5525cac
PE
8395 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8396 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8397
0324f3af
PE
8398 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8399 Some packages use them to denote characters with modifiers.
8400
e9b5f888
AS
84012011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8402
8403 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8404 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8405 matching a pp-number. Rename parameter var to var1.
8406
127827c0
SM
84072011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8408
8409 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8410
c8fd3bd0
GM
84112011-10-08 Glenn Morris <rgm@gnu.org>
8412
8413 * callint.c (Fcall_interactively): Give a more explicit error for the
8414 'c' case with a non-character input. (Bug#8479)
8415
352ec8ff
EZ
84162011-10-08 Eli Zaretskii <eliz@gnu.org>
8417
03669ccb
EZ
8418 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8419 lines.
7061c986
EZ
8420 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8421 lines that are hscrolled on the left.
03669ccb 8422
352ec8ff
EZ
8423 * dispnew.c (buffer_posn_from_coords): Account for a possible
8424 presence of header-line. (Bug#4426)
8425
a66cfb1c
SM
84262011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8427
6b02f655
SM
8428 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8429 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 8430
7c5ee88e
PE
84312011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8432
8433 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8434 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8435 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8436 this makes Emacs dump core during garbage collection on rare
8437 occasions. sizeof is obviously inferior to offsetof here, so
8438 stick with offsetof.
8439 (GC_POINTER_ALIGNMENT): New macro.
8440 (mark_memory): Omit 3rd (offset) arg; caller changed.
8441 Don't assume EMACS_INT alignment is the same as pointer alignment.
8442
df1bbe5b
SM
84432011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8444
8445 * keyboard.c (read_key_sequence_remapped): New var.
8446 (read_key_sequence): Compute remapping in the right buffer.
8447 (command_loop_1): Use read_key_sequence's remapping directly.
8448
51553db6
SM
84492011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8450
32c1fffd
SM
8451 * dired.c (file_name_completion): Don't expand file name.
8452 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8453 before checking file name handler.
8454
51553db6
SM
8455 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8456 they've been requested explicitly (bug#9591).
8457
b6bd1599 84582011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
8459
8460 * keymap.c (Fsingle_key_description): Use make_specified_string
8461 instead of build_string to build string from push_key_description.
8462 (Bug#5193)
8463
f701dc2a
PE
84642011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8465
4222c55d
PE
8466 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8467 This fixes a Y2038 bug on 64-bit hosts.
8468 * buffer.c (reset_buffer):
8469 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8470 (Fclear_buffer_auto_save_failure):
8471 Use 0, not -1, to represent an unset failure time, since time_t
8472 might not be signed.
8473
f701dc2a
PE
8474 Remove dependency on glibc malloc internals.
8475 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8476 Move back here from lisp.h, but with their new implementations.
8477 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8478 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8479 * charset.c (charset_table_init): New static var.
8480 (syms_of_charset): Use it instead of xmalloc. This removes a
8481 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8482 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8483 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8484 Move back to alloc.c.
8485 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8486 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8487
9ceebf39
JD
84882011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8489
8490 * nsterm.m (windowDidResize): Call x_set_window_size only when
8491 ns_in_resize is true. Otherwise set pixelwidth/height and
8492 call change_frame_size (Bug#9628).
8493
cb993c58
PE
84942011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8495
3930c88b
PE
8496 Port --enable-checking=all to Fedora 14 x86-64.
8497 * charset.c (syms_of_charset): Also account for glibc malloc's
8498 internal overhead when calculating the initial malloc maximum.
8499
cb993c58
PE
8500 Port --enable-checking=all to Fedora 14 x86.
8501 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8502 Move to lisp.h.
8503 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8504 (overrun_check_realloc, overrun_check_free):
8505 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8506 That way, xmalloc returns a properly-aligned pointer even if
8507 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8508 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8509 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8510 into account when calculating the initial malloc maximum.
8511 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8512 Move here from alloc.c, so that charset.c can use it too.
8513 Properly align; the old code wasn't right for common 32-bit hosts
8514 when configured with --enable-checking=all.
8515 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8516 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8517
31bed486
EZ
85182011-09-29 Eli Zaretskii <eliz@gnu.org>
8519
04c70788 8520 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
8521 use EDOM.
8522
fbcaa2f3
EZ
85232011-09-28 Eli Zaretskii <eliz@gnu.org>
8524
8525 * xdisp.c (compute_display_string_end): If there's no display
8526 string at CHARPOS, return -1.
8527
8528 * bidi.c (bidi_fetch_char): When compute_display_string_end
8529 returns a negative value, treat the character as a normal
8530 character not covered by a display string. (Bug#9624)
8531
a239d4e9
JB
85322011-09-28 Juanma Barranquero <lekktu@gmail.com>
8533
8534 * lread.c (Fread_from_string): Fix typo in docstring.
8535
88652fd5
EZ
85362011-09-27 Eli Zaretskii <eliz@gnu.org>
8537
8538 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8539 newline, reseat the iterator instead of bidi-iterating there one
8540 character at a time. (Bug#9610)
32c1fffd
SM
8541 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8542 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 8543
ed497dd4
AS
85442011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8545
8546 * lread.c (readevalloop): Use correct code for NBSP.
8547 (read1): Likewise. (Bug#9608)
8548
b2bf61aa
MA
85492011-09-25 Michael Albinus <michael.albinus@gmx.de>
8550
8551 * dbusbind.c (Fdbus_register_signal): When service is not
8552 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8553
32bbb17c
GM
85542011-09-25 Glenn Morris <rgm@gnu.org>
8555
8556 * buffer.c (truncate-lines): Doc fix.
8557
94e0933e
CY
85582011-09-24 Chong Yidong <cyd@stupidchicken.com>
8559
8560 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8561 (Fset_window_next_buffers): Doc fix.
8562
cddde921
GM
85632011-09-24 Glenn Morris <rgm@gnu.org>
8564
8565 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8566
1260aef1
PE
85672011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8568
25b4bfa0
PE
8569 Fix minor problems found by static checking.
8570 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
8571 * indent.c (Fvertical_motion): Fix == vs = typo.
8572
e3cbd34b
EZ
85732011-09-24 Eli Zaretskii <eliz@gnu.org>
8574
a66cfb1c
SM
8575 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8576 Default value is now t. Doc fix.
6bf7006f 8577
e3cbd34b 8578 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 8579 logic when moving up, not only when moving down. Fix the
e3cbd34b 8580 confusing name and values of the it_overshoot_expected variable;
32c1fffd 8581 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
8582
8583 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8584 CHARPOS is covered by a display string which includes newlines.
8585 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8586 is covered by a display string with embedded newlines.
8587
a3de0cbd
MA
85882011-09-24 Michael Albinus <michael.albinus@gmx.de>
8589
8590 * dbusbind.c (Fdbus_register_signal): Add match rule to
8591 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
8592 (Fdbus_register_method, Vdbus_registered_objects_table):
8593 Fix docstring.
a3de0cbd 8594
b260039d
JM
85952011-09-24 Jim Meyering <meyering@redhat.com>
8596
32c1fffd 8597 do not ignore write error for any output size
b260039d
JM
8598 The previous change was incomplete.
8599 While it makes emacs --batch detect the vast majority of stdout
8600 write failures, errors were still ignored whenever the output size is
8601 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8602 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8603 && echo FAIL: ignored write error
8604 FAIL: ignored write error
8605 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8606 && echo FAIL: ignored write error
8607 FAIL: ignored write error
8608 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8609
8eca8a7c
AS
86102011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8611
8612 * emacs.c (Fkill_emacs): In noninteractive mode exit
8613 non-successfully if a write error occurred on stdout. (Bug#9574)
8614
3341db62
EZ
86152011-09-21 Eli Zaretskii <eliz@gnu.org>
8616
8617 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8618 the xassert test.
8619
8620 * dispextern.h (struct it): Update the comment documenting what
8621 can it->OBJECT be.
8622
8c203dbf
EZ
86232011-09-20 Eli Zaretskii <eliz@gnu.org>
8624
8625 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8626 a display string, extend search for cursor position to end of row.
8627 (find_row_edges): If the row ends in a newline from a display
8628 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8629 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
8630 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8631 non-empty line. Fixes confusing cursor motion with arrow keys at
8632 the beginning of a line that starts with whitespace.
8c203dbf 8633
a4824228
LMI
86342011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8635
8636 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8637 (bug#9493).
8638
33ed493b
CY
86392011-09-18 Chong Yidong <cyd@stupidchicken.com>
8640
8641 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8642 boolean (Bug#9154).
8643
56cd55c8
EZ
86442011-09-18 Eli Zaretskii <eliz@gnu.org>
8645
8646 * xdisp.c (display_line): Record maximum and minimum buffer
8647 positions even if no glyphs were produced (e.g., by a zero-width
8648 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8649 buffer positions that will be removed from the glyph row because
8650 they don't fit.
c02dcedf
EZ
8651 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8652 column is beyond frame width: don't subtract 1 "pixel" when
8653 computing width of the stretch.
3e62b7e0
EZ
8654 (reseat_at_next_visible_line_start): Undo the change made on
8655 2011-09-17 that saved paragraph information and restored it after
8656 the call to `reseat'. (Bug#9545)
56cd55c8 8657
5ed99d36 86582011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
8659
8660 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8661 and turn window cursor on if cleared (Bug#9415).
8662
5ed99d36 86632011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
8664
8665 * search.c (boyer_moore): Take unibyte characters from pattern
8666 literally. (Bug#9458)
8667
9bade7b2
EZ
86682011-09-18 Eli Zaretskii <eliz@gnu.org>
8669
8670 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8671
e5e9d610
PE
86722011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8673
87e4427a
PE
8674 Fix minor problem found by static checking.
8675 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8676 initialized, to pacify gcc -Wuninitialized.
8677
e5e9d610
PE
8678 * fileio.c: Report proper errno when syscall falls.
8679 (Finsert_file_contents): Save and restore errno,
8680 so that report_file_error outputs the correct diagnostic.
8681 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8682
a1674f0b
EZ
86832011-09-18 Eli Zaretskii <eliz@gnu.org>
8684
8685 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8686
fbfb6dd4
EZ
86872011-09-17 Eli Zaretskii <eliz@gnu.org>
8688
8689 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8690 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8691
bb187662
EZ
86922011-09-17 Eli Zaretskii <eliz@gnu.org>
8693
1137e8b8 8694 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 8695 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
8696
8697 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8698 (bidi_find_paragraph_start): Search back for paragraph beginning
8699 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8700 (bidi_move_to_visually_next): Only trigger paragraph-related
8701 computations when the last character is a newline or at EOB, not
8702 just any NEUTRAL_B. (Bug#9470)
8703
bb187662
EZ
8704 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8705 truncated lines if point is covered by a display string. (Bug#9524)
8706
2e621251
PE
87072011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8708
8709 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8710 (cons_to_x_long): New function.
8711 (lisp_data_to_selection_data): Use it. Correct the test for
8712 short-versus-long data; it was negated. Break out of vector
8713 loop, for efficiency, when a long datum is discovered.
8714
91a15bc6
SM
87152011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8716
8717 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8718
b41c3a35
EZ
87192011-09-16 Eli Zaretskii <eliz@gnu.org>
8720
8721 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8722 GCC PR/17406) by declaring this function with external scope.
8723
7812ba2d
PE
87242011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8725
8726 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8727 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8728
cf7edc2a
AS
87292011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8730
8731 * editfns.c (Fformat): Correctly handle text properties on "%%".
8732
bd01620e
EZ
87332011-09-15 Eli Zaretskii <eliz@gnu.org>
8734
8735 * xterm.c (x_draw_composite_glyph_string_foreground):
8736 * w32term.c (x_draw_composite_glyph_string_foreground):
8737 * term.c (encode_terminal_code):
8738 * composite.c (composition_update_it, get_composition_id):
8739 * xdisp.c (get_next_display_element)
8740 (fill_composite_glyph_string): Add comments about special meaning
8741 of TAB characters in a composition.
8742
a02719a3
PE
87432011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8744
8745 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
8746 This occurs when processing a multibyte format.
8747 Problem reported by Wolfgang Jenker.
a02719a3 8748
72589a3c
JB
87492011-09-15 Johan Bockgård <bojohan@gnu.org>
8750
8751 * xdisp.c (try_cursor_movement): Only check for exact match if
8752 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8753
1c14176c
PE
87542011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8755
8756 Remove unused external symbols.
8757 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8758 * xdisp.c (calc_pixel_width_or_height): Now static.
8759 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8760 * indent.c (check_display_width):
8761 * w32term.c: Fix comment to match code.
8762 * xterm.c, xterm.h (x_catching_errors): Remove.
8763
d2eea5b5
PE
87642011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8765
8766 * xselect.c: Use signed conversions more consistently (Bug#9498).
8767 (selection_data_to_lisp_data): Assume incoming selection data are
8768 signed integers, not unsigned. This is to be consistent with
8769 outgoing selection data, which was modified to use signed integers
8770 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8771 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8772 expects long, not unsigned long.
8773
46888499
EZ
87742011-09-14 Eli Zaretskii <eliz@gnu.org>
8775
8776 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8777 computation of loop end. Reported by Johan Bockgård
8778 <bojohan@gnu.org>.
8779
ef8ef9fb
CY
87802011-09-13 Chong Yidong <cyd@stupidchicken.com>
8781
8782 * frame.c (Fother_visible_frames_p): Function deleted.
8783
fa819fed
EZ
87842011-09-12 Eli Zaretskii <eliz@gnu.org>
8785
8786 * indent.c (compute_motion): Process display vector front to back
8787 rather than the other way around. (Bug#2496)
8788
2ba8e008
SM
87892011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8790
8791 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8792
20f53c69
CY
87932011-09-11 Chong Yidong <cyd@stupidchicken.com>
8794
8795 * minibuf.c (Fread_from_minibuffer): Doc fix.
8796
d562d7a4
EZ
87972011-09-11 Eli Zaretskii <eliz@gnu.org>
8798
8799 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8800 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8801
1c4d7f3d
LMI
88022011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8803
8804 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8805 value for non-existent files.
8806
b885bf36
EZ
88072011-09-11 Eli Zaretskii <eliz@gnu.org>
8808
8809 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8810 set its "size" to -1. This will set the modtime_size field of
8811 the corresponding buffer to -1, which is what
8812 verify-visited-file-modtime expects for files that do not exist.
8813 (Bug#9139)
8814
6612f0bf
PE
88152011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8816
8817 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8818 here ...
8819 * lisp.h: ... from here. push_key_description is no longer
8820 defined in keyboard.c, so its declaration should not be in
8821 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8822 logically belongs with push_key_description.
8823
dfb3f755
PE
88242011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8825
8826 * buffer.h: Include <sys/types.h> instead of <time.h>.
8827 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8828 Problem reported by Herbert J. Skuhra.
8829
3134906c
LMI
88302011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8831
8832 * xml.c (parse_region): Make the parsing work for
8833 non-comment-starting XML files again (bug#9144).
8834
8d903f4e
AS
88352011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8836
8837 * image.c (gif_load): Fix calculation of bottom and right corner.
8838 (Bug#9468)
8839
80ad64f4
EZ
88402011-09-10 Eli Zaretskii <eliz@gnu.org>
8841
8842 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8843 redisplay in small windows.
8844
208a048d
EZ
88452011-09-09 Eli Zaretskii <eliz@gnu.org>
8846
8847 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8848
9b1c252e
MR
88492011-09-08 Martin Rudalics <rudalics@gmx.at>
8850
8851 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8852 Operate on live windows only.
8853
2949f33b
JB
88542011-09-08 Juanma Barranquero <lekktu@gmail.com>
8855
8856 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8857
e08dcafd
EZ
88582011-09-07 Eli Zaretskii <eliz@gnu.org>
8859
8860 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8861 only under bidi iteration.
8862
115b96bd
JD
88632011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8864
8865 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8866
c8199d0f
PE
88672011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8868
8869 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8870 Without this fix, the command to link temacs failed due to an
8871 undefined symbol __builtin_isnan. This is because
8872 /usr/include/iso/math_c99.h #defines isnan(x) to
8873 __builtin_isnan(x), but the bundled gcc, which identifies itself
8874 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8875 a __builtin_isnan.
8876 * floatfns.c (isnan): #undef, and then #define to a clone of
8877 what's in data.c.
8878 (Fisnan): Always define, since it's always available now.
8879 (syms_of_floatfns): Always define isnan at the Lisp level.
8880
e39b275c 88812011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
8882
8883 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8884
b2db44d9 88852011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 8886
f4af5137 8887 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
8888 The previous code assumed that file offsets (off_t values) fit in
8889 EMACS_INT variables, which is not true on typical 32-bit hosts.
8890 The code messed up by falsely reporting buffer overflow in cases
8891 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8892 when "big" contains more than 2**29 bytes, even though this
8893 inserts just one byte and does not overflow the buffer.
8894 (Finsert_file_contents): Store file offsets as off_t
8895 values, not as EMACS_INT values. Check for overflow when
8896 converting between EMACS_INT and off_t. When checking for
8897 buffer overflow or for overlap, take the offsets into account.
8898 Don't use EMACS_INT for small values where int suffices.
8899 When checking for overlap, fix a typo: ZV was used where
8900 ZV_BYTE was intended.
8901 (Fwrite_region): Don't assume off_t fits into 'long'.
8902 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8903
ecfc0a49
MA
89042011-09-05 Michael Albinus <michael.albinus@gmx.de>
8905
8906 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8907
6511acf2 89082011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 8909
0999621a 8910 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
8911
8912 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 8913 (esprintf, exprintf, evxprintf): New functions.
62f19c19 8914 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 8915 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
8916 (modify_event_symbol): Do not assume that the length of
8917 name_alist_or_stem is safe to alloca and fits in int.
8918 (Fexecute_extended_command): Likewise for function name and binding.
8919 (Frecursion_depth): Wrap around reliably on integer overflow.
8920 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8921 since some callers pass EMACS_INT values.
8922 (Fsingle_key_description): Don't crash if symbol name contains more
8923 than MAX_ALLOCA bytes.
8924 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
8925 (get_minibuffer): Arg is now EMACS_INT, not int.
8926 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 8927 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
8928 * window.h (command_loop_level, minibuf_level): Reflect API changes.
8929
2be7d702
PE
8930 * dbusbind.c (signature_cat): New function.
8931 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
8932 Do not overrun buffer; instead, report string overflow.
8933
9d1df220
PE
8934 * dispnew.c (add_window_display_history): Don't overrun buffer.
8935 Truncate instead; this is OK since it's just a log.
8936
33ef5c64
PE
8937 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
8938 even if the time zone offset is outlandishly large.
8939 Don't mishandle offset == INT_MIN.
8940
66c6fdd5
PE
8941 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
8942 when creating daemon; the previous buffer-overflow check was incorrect.
8943
d749b01b
PE
8944 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
8945 which has the guts of the old verror function.
8946
b5cd1905
PE
8947 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
8948 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
8949
6e1a67fb
PE
8950 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
8951 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 8952 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 8953 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
8954 length of string rather than counting it via multiple sprintfs;
8955 that's simpler and more reliable.
c21721cc
PE
8956 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
8957 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
8958 sprintf, in case result does not fit in int.
8959
c57b67fc
PE
8960 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
8961 (fontset_from_font): Print it.
8962
8a401434
PE
8963 * frame.c (tty_frame_count): Now printmax_t, not int.
8964 (make_terminal_frame, set_term_frame_name): Print it.
8965 (x_report_frame_params): In X, window IDs are unsigned long,
8966 not signed long, so print them as unsigned.
8967 (validate_x_resource_name): Check for implausibly long names,
8968 and don't assume name length fits in 'int'.
8969 (x_get_resource_string): Don't blindly alloca invocation name;
8970 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
8971 not fit in int.
8972
6e1a67fb
PE
8973 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
8974 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
8975 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
8976
0df02bf3
PE
8977 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
8978 Use esprintf, not sprintf, in case result does not fit in int.
8979
48e30793
PE
8980 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8981 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
8982 it as a large positive number.
8983 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
8984 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
8985
a66ff6d8
PE
8986 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
8987 in case result does not fit in int.
8988
aca216ff
PE
8989 * print.c (float_to_string): Detect width overflow more reliably.
8990 (print_object): Make sprintf buffer a bit bigger, to avoid potential
8991 buffer overrun. Don't assume list length fits in 'int'. Treat
8992 print length of 0 as 0, not as infinity; to be consistent with other
8993 uses of print length in this function. Don't overflow print length
8994 index. Don't assume hash table size fits in 'long', or that
8995 vectorlike size fits in 'unsigned long'.
8996
31c286f7
PE
8997 * process.c (make_process): Use printmax_t, not int, to format
8998 process-name gensyms.
8999
55e5faa1
PE
9000 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9001
80f2e268
PE
9002 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9003 to avoid potential buffer overrun.
9004
670741ab
PE
9005 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9006 if X resource line is longer than 512 bytes.
9007
b7163a50
PE
9008 * xfns.c (x_window): Make sprintf buffer a bit bigger
9009 to avoid potential buffer overrun.
9010
ae58ff1f
PE
9011 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9012
c43c8a6a
PE
9013 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9014
3f8236f4
PE
90152011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9016
53e9fe90 9017 Integer overflow fixes for scrolling, etc.
6511acf2
PE
9018 Without these, Emacs silently mishandles large integers sometimes.
9019 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
9020 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9021
6511acf2
PE
9022 * xdisp.c (try_window_id): Check Emacs fixnum range before
9023 converting to 'int'.
806add1d 9024
6511acf2 9025 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
9026 Check that an Emacs fixnum is in range before assigning it to 'int'.
9027 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9028 values converted from Emacs fixnums.
9029 (Frecenter): Don't wrap around a line count if it is out of 'int'
9030 range; instead, treat it as an extreme value.
9031 (Fset_window_configuration, compare_window_configurations):
9032 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9033
6511acf2
PE
9034 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9035 that can exceed INT_MAX. Check that EMACS_INT value is in range
9036 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
9037 (match_limit): Don't assume that a fixnum can fit in 'int'.
9038
6511acf2 9039 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
9040 exceed INT_MAX.
9041
6511acf2 9042 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
9043 (Fvertical_motion): Don't wrap around LINES values that don't fit
9044 in 'int'. Instead, treat them as extreme values. This is good
9045 enough for windows, which can't have more than INT_MAX lines anyway.
9046
fcb901a7
LMI
90472011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9048
0f2f6b6d
LMI
9049 * Require libxml/parser.h to avoid compilation warning.
9050
fcb901a7
LMI
9051 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9052
9053 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9054 since this reportedly can destroy thread storage.
9055
6e20a0d4
CY
90562011-08-30 Chong Yidong <cyd@stupidchicken.com>
9057
9058 * syntax.c (find_defun_start): Update all cache variables if
9059 exiting early (Bug#9401).
9060
148ae00e
EZ
90612011-08-30 Eli Zaretskii <eliz@gnu.org>
9062
f6cfbd8f
EZ
9063 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9064
148ae00e
EZ
9065 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9066 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9067 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9068
9069 * term.c (tty_append_glyph): New function.
9070 (produce_stretch_glyph): Static function and its prototype deleted.
9071
a66cfb1c
SM
9072 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9073 Add prototypes.
148ae00e 9074
c4a07a4c
PE
90752011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9076
9077 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9078 when checking :margin (Bug#9390).
9079 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 9080 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
9081 so that the name doesn't mislead. All uses changed.
9082
6bc8cd65
JB
90832011-08-28 Johan Bockgård <bojohan@gnu.org>
9084
9085 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9086 set_tty_hooks.
9087
dca4927e
EZ
90882011-08-27 Eli Zaretskii <eliz@gnu.org>
9089
9090 * xdisp.c (move_it_to): Don't bail out early when reaching
9091 position beyond to_charpos, if we are scanning backwards.
9092 (move_it_vertically_backward): When DY == 0, make sure we get to
9093 the first character in the line after the newline.
9094
f2cad773
PE
90952011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9096
9097 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9098 (ccl_driver): Do not generate an out-of-range pointer.
9099 (Fccl_execute_on_string): Remove unnecessary check for
9100 integer overflow, noted by Stefan Monnier in
9101 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9102 Remove a FIXME that didn't need fixing.
9103 Simplify the newly-introduced buffer reallocation code.
9104
0cae2cdb
JB
91052011-08-27 Juanma Barranquero <lekktu@gmail.com>
9106
9107 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9108
5fc295a4 91092011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 9110
70c60eb2 9111 Integer and memory overflow issues (Bug#9196).
726e0ab1 9112
d31850da
PE
9113 * doc.c (get_doc_string): Rework so that
9114 get_doc_string_buffer_size is the actual buffer size, rather than
9115 being 1 less than the actual buffer size; this makes xpalloc more
9116 convenient.
9117
a69fbedb
PE
9118 * image.c (x_allocate_bitmap_record, cache_image):
9119 * xselect.c (Fx_register_dnd_atom):
9120 Simplify previous changes by using xpalloc.
9121
fe5c5d37
PE
9122 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9123 since either will do and ptrdiff_t is convenient with xpalloc.
9124
0065d054
PE
9125 * charset.c (charset_table_size)
9126 (struct charset_sort_data.priority): Now ptrdiff_t.
9127 (charset_compare): Don't overflow if priorities differ greatly.
9128 (Fsort_charsets): Don't assume list length fits in int.
9129 Check for size-calculation overflow when allocating sort data.
9130 (syms_of_charset): Allocate an initial charset table that is
9131 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9132
9133 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9134
9135 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9136 The actual value is always <= INT_MAX, and leaving it unsigned made
9137 overflow checking harder.
9138
9139 * dispextern.h (struct glyph_matrix.rows_allocated)
9140 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9141 with xpalloc. The values are still always <= INT_MAX.
9142
9143 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9144
9145 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9146 (SAFE_NALLOCA): New macro.
9147
9148 * region-cache.c (struct boundary.pos, find_cache_boundary)
9149 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9150 (set_cache_region, invalidate_region_cache)
9151 (revalidate_region_cache, know_region_cache, region_cache_forward)
9152 (region_cache_backward, pp_cache):
9153 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9154 so that ptrdiff_t * can be passed to xpalloc.
9155 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9156 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9157 (pp_cache): Don't assume cache_len fits in int.
9158 * region-cache.h: Adjust extern decls to match.
9159
9160 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9161 EMACS_INT, since either will do, for xpalloc.
9162
9163 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9164 (xnmalloc, xnrealloc, xpalloc): New functions.
9165
726e0ab1
PE
9166 * bidi.c (bidi_shelve_header_size): New constant.
9167 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9168 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9169
51f30bc5 9170 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
9171 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9172 (overlay_strings):
9173 Don't update size of array until after memory allocation succeeds,
9174 because xmalloc/xrealloc may not return.
0065d054
PE
9175 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9176 now that we have proper integer overflow checking.
9177 (record_overlay_string, overlay_strings): Catch overflows when
9178 calculating size of overlay_str_buf.
726e0ab1 9179
0065d054
PE
9180 * callproc.c (Fcall_process): Check for size overflow when
9181 calculating size of args2.
9182 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9183 Normally we prefer signed values, but sticking with ptrdiff_t would
9184 require adding more-complicated checks.
726e0ab1
PE
9185
9186 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9187 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9188 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 9189 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
9190
9191 * character.c (Fstring): Check for size-calculation overflow.
9192
9193 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9194 unnecessary integer overflow. Check for size overflow.
9195 (encode_coding_object): Don't update size until xmalloc succeeds.
9196
9197 * composite.c (get_composition_id): Check for overflow in glyph
9198 length calculations.
9199
9200 Integer and memory overflow fixes for display code.
9201 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9202 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9203 (scrolling_window): Check for overflow in size calculations.
9204 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9205 Don't assume glyph table len fits in int.
9206 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9207 (row_table_size): Now ptrdiff_t, not int.
9208 (scrolling_window): Avoid overflow in size calculations.
9209 Don't update size until allocation succeeds.
9210 * fns.c (concat): Check for overflow in size calculations.
9211 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9212 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9213 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9214
9215 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9216 (get_doc_string): Check for size calculation overflow.
9217 Don't update size until allocation succeeds.
9218 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9219 EMACS_INT, where ptrdiff_t will do.
9220 (Fsubstitute_command_keys): Check for string overflow.
9221
9222 * editfns.c (set_time_zone_rule): Don't assume environment length
9223 fits in int.
9224 (message_length): Now ptrdiff_t, not int.
9225 (Fmessage_box): Don't update size until allocation succeeds.
9226 Don't assume message length fits in int.
9227 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9228
0065d054
PE
9229 * emacs.c (main): Do not reallocate argv, since there is a null at
9230 the end that can be overwritten, and this way there's no need to
9231 worry about size-calculation overflow.
9232 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
9233
9234 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9235 alloc succeeds.
9236 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9237
9238 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9239 (x_set_scroll_bar_width, x_figure_window_size):
9240 Check for integer overflow.
9241 (x_set_alpha): Do not assume XINT fits in int.
9242
9243 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9244 This is for the members text_lines, text_cols, total_lines, total_cols,
9245 where the system imposes an 'int' limit.
9246
9247 * fringe.c (Fdefine_fringe_bitmap):
9248 Don't update size until alloc works.
9249
9250 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9251 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9252
9253 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9254 Check for size-calculation overflow.
9255 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9256 do, as we prefer signed integers.
9257 (id_to_widget.max_size, id_to_widget.used)
9258 (xg_store_widget_in_map, xg_remove_widget_from_map)
9259 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9260 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9261 Use and return ptrdiff_t, not int.
9262 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9263 * gtkutil.h: Change prototypes to match the above.
9264
9265 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9266 are duplicate now that they've been promoted to lisp.h.
9267 (x_allocate_bitmap_record, x_alloc_image_color)
9268 (make_image_cache, cache_image, xpm_load):
9269 Don't update size until alloc is done.
9270 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9271 (x_detect_edges):
3256efce 9272 Check for size calculation overflow.
726e0ab1
PE
9273 (ct_colors_allocated_max): New constant.
9274 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9275 overflow.
3256efce 9276
726e0ab1
PE
9277 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9278 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9279 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9280 Use ptrdiff_t, not int, to count maps.
9281 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
9282 calculations. Don't update size until allocation succeeds.
9283 Redo calculations to avoid overflow.
726e0ab1
PE
9284 * keyboard.h: Change prototypes to match the above.
9285
9286 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9287 to count maps.
9288 (current_minor_maps): Check for size calculation overflow.
9289 * keymap.h: Change prototypes to match the above.
9290
9291 * lread.c (read1, init_obarray): Don't update size until alloc done.
9292
9293 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9294 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9295
726e0ab1
PE
9296 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9297 Now ptrdiff_t, not int.
9298 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9299 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9300
9301 * process.c (Fnetwork_interface_list): Check for overflow
9302 in size calculation.
9303
9304 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9305
9306 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9307 overflow. Don't bother calling xmalloc when xrealloc will do.
9308
9309 * search.c (Freplace_match): Check for size calculation overflow.
9310 (Fset_match_data): Don't assume list lengths fit in 'int'.
9311
9312 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9313 for command line length. Do not attempt to address one before the
9314 beginning of an array, as that's not portable.
9315
9316 * term.c (max_frame_lines): Remove; unused.
9317 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9318 not int.
9319 (encode_terminal_code, calculate_costs): Check for size
9320 calculation overflow.
9321 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9322 table lengths and related sizes. Don't update size until alloc
9323 done. Redo calculations to avoid overflow.
9324 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9325
9326 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9327 subtracting pointers.
9328 (gobble_line): Check for overflow more carefully. Don't update size
9329 until alloc done.
9330
9331 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9332 Don't update size until alloc done.
9333 Redo size calculations to avoid overflow.
9334 Check for size calculation overflow.
0065d054 9335 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
9336
9337 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9338 Use ptrdiff_t, not int, for sizes.
9339 (store_mode_line_noprop_char): Don't update size until alloc done.
9340
0065d054
PE
9341 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9342 Use ptrdiff_t, not int, for sizes.
9343 (Finternal_make_lisp_face, cache_face):
9344 Check for size calculation overflow.
9345 (cache_face): Treat size calculation overflows as if they were
9346 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
9347
9348 * xfns.c (x_encode_text, x_set_name_internal)
9349 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9350 sizes, since they can exceed INT_MAX in size. Check for size
9351 calculation overflow.
9352
0065d054
PE
9353 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9354 (xg_select): Check for size calculation overflow.
726e0ab1
PE
9355 Don't update size until alloc done.
9356
0065d054 9357 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 9358 as sprintf is limited to int lengths.
1d526e2f 9359
252c5ee1
PE
9360 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9361 (X_LONG_MIN): New macros.
864d7ce7
PE
9362 Use them to make the following changes clearer.
9363 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9364 This change doesn't affect the value now, but it may help remind
9365 future maintainers not to raise the value too much later.
9366 (SELECTION_QUANTUM): Remove, replacing with ...
9367 (selection_quantum): ... new function, which avoids overflow.
9368 All uses changed.
9369 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9370 assumption that selection length fits in 'int'.
9371 (x_reply_selection_request, x_handle_selection_request)
9372 (x_get_window_property, receive_incremental_selection)
9373 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9374 (lisp_data_to_selection_data, clean_local_selection_data):
9375 Use ptrdiff_t, not int, to record length of selection.
9376 (x_reply_selection_request, x_get_window_property)
9377 (receive_incremental_selection, x_property_data_to_lisp):
9378 Redo calculations to avoid overflow.
9379 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 9380 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
9381 something.
9382 (x_get_window_property, receive_incremental_selection)
9383 (lisp_data_to_selection_data, x_property_data_to_lisp):
9384 Check for size-calculation overflow.
9385 (x_get_window_property, receive_incremental_selection)
9386 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9387 Don't store size until memory allocation succeeds.
9388 (x_get_window_property): Plug memory leak on memory exhaustion.
9389 Don't double-block input; malloc is safe here. Don't assume 2**34
9390 - 4 fits in unsigned long. Add an xassert to check
9391 XGetWindowProperty overflow. Be more careful about overflow
9392 calculations, and distinguish size from memory overflow better.
9393 (receive_incremental_selection): When tracing, don't assume
9394 unsigned int is less than INT_MAX.
9395 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9396 harmful) conversions of unsigned short to int.
9397 (lisp_data_to_selection_data): Don't assume that integers
9398 in the range -65535 through -1 fit in an X unsigned short.
9399 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9400 result parameters unless successful. Rely on cons_to_unsigned
9401 to report problems with elements; the old code wasn't right anyway.
9402 (x_check_property_data): Check for int overflow; we cannot use
9403 a wider type due to X limits.
9404 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9405
726e0ab1 9406 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 9407
0065d054
PE
9408 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9409 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
9410 (x_color_cells): Don't store size until memory allocation succeeds.
9411 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 9412 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
9413 (x_term_init): Don't assume length fits in int (sprintf is limited
9414 to int size).
bc18e09d 9415
ebfa62c0
PE
9416 Use ptrdiff_t for composition IDs.
9417 * character.c (lisp_string_width):
9418 * composite.c (composition_table_size, n_compositions)
9419 (get_composition_id, composition_gstring_from_id):
9420 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9421 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9422 * window.c (Frecenter):
9423 Use ptrdiff_t, not int, for composition IDs.
9424 * composite.c (get_composition_id): Check for integer overflow.
9425 * composite.h: Adjust prototypes to match the above changes.
9426
d3411f89
PE
9427 Use ptrdiff_t for hash table indexes.
9428 * category.c (hash_get_category_set):
9429 * ccl.c (ccl_driver):
9430 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9431 * coding.c (coding_system_charset_list, detect_coding_system):
9432 * coding.h (struct coding_system.id):
9433 * composite.c (get_composition_id, gstring_lookup_cache):
9434 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9435 * image.c (xpm_get_color_table_h):
9436 * lisp.h (hash_lookup, hash_put):
9437 * minibuf.c (Ftest_completion):
9438 Use ptrdiff_t for hash table indexes, not int (which is too
9439 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9440 32-bit --with-wide-int hosts).
9441
e097a6fa
PE
9442 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9443 Add a FIXME comment about memory leaks.
9444 (syms_of_charset): Don't assume xmalloc returns.
9445
5637687f
PE
9446 Don't assume that stated character widths fit in int.
9447 * character.c (Fchar_width, c_string_width, lisp_string_width):
9448 * character.h (CHAR_WIDTH):
9449 * indent.c (MULTIBYTE_BYTES_WIDTH):
9450 Use sanitize_char_width to avoid undefined and/or bad behavior
9451 with outlandish widths.
a66cfb1c 9452 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
9453 now that we have two such functions. All uses changed.
9454 (sanitize_char_width): New inline function.
9455
a2271ba2
PE
9456 Don't assume that tab-width fits in int.
9457 * character.h (sanitize_width): New inline function.
9458 (SANE_TAB_WIDTH): New macro.
9459 (ASCII_CHAR_WIDTH): Use it.
9460 * indent.c (sane_tab_width): Remove. All uses replaced by
9461 SANE_TAB_WIDTH (current_buffer).
9462 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9463
18c52557
PE
9464 * fileio.c: Integer overflow issues with file modes.
9465 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9466
caeeedc1
PE
9467 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9468 Remove unreachable code.
9469 (read_hex, load_charset_map_from_file): Check for integer overflow.
9470
6df6ae42 9471 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
9472 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9473 (x_send_scroll_bar_event): Likewise. Check that the size does not
9474 exceed limits imposed by XClientMessageEvent, as well as the usual
9475 ptrdiff_t and size_t limits.
9476
b13995db
PE
9477 * keyboard.c: Overflow, signedness and related fixes.
9478 (make_lispy_movement): Use same integer type in forward decl
9479 that is used in the definition.
9480 (read_key_sequence, keyremap_step):
9481 Change bufsize argument back to int, undoing my 2011-03-30 change.
9482 We prefer signed types, and int is wide enough here.
9483 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9484 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9485 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9486 length, not size_t. Use ptrdiff_t for index, not int.
9487 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9488 possibility of integer overflow.
9489
13464394
PE
9490 Overflow, signedness and related fixes for images.
9491
9492 * dispextern.h (struct it.stack[0].u.image.image_id)
9493 (struct_it.image_id, struct image.id, struct image_cache.size)
9494 (struct image_cache.used, struct image_cache.ref_count):
9495 * gtkutil.c (update_frame_tool_bar):
9496 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9497 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9498 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9499 * nsmenu.m (update_frame_tool_bar):
9500 * xdisp.c (calc_pixel_width_or_height):
9501 * xfns.c (image_cache_refcount):
9502 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9503 on typical 64-bit hosts.
9504
9505 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9506 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9507 Omit unnecessary casts to int.
9508 (parse_image_spec): Check that integers fall into 'int' range
9509 when the callers expect that.
9510 (image_ascent): Redo ascent calculation to avoid int overflow.
9511 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9512 (lookup_image): Remove unnecessary tests.
9513 (xbm_image_p): Locals are now of int, not EMACS_INT,
9514 since parse_image_check makes sure they fit into int.
9515 (png_load, gif_load, svg_load_image):
9516 Prefer int to unsigned where either will do.
9517 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
9518 old tiff_error_handler and tiff_warning_handler.
9519 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
9520 stack buffer overflows. It uses only the features of vsnprintf
9521 that are common to both POSIX and native Microsoft.
9522 (tiff_error_handler, tiff_warning_handler): Use it.
9523 (tiff_load, gif_load, imagemagick_load_image):
9524 Don't assume :index value fits in 'int'.
9525 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9526 (imagemagick_load_image): Check that crop parameters fit into
9527 the integer types that MagickCropImage accepts. Don't assume
9528 Vimagemagick_render_type has a nonnegative value. Don't assume
9529 size_t fits in 'long'.
9530 (gs_load): Use printmax_t to print the widest integers possible.
9531 Check for integer overflow when computing image height and width.
9532
c11821d4
EZ
95332011-08-26 Eli Zaretskii <eliz@gnu.org>
9534
9535 * xdisp.c (redisplay_window): Don't force window start if point
9536 will be invisible in the resulting window. (Bug#9324)
9537
0c95fcf7
EZ
95382011-08-25 Eli Zaretskii <eliz@gnu.org>
9539
9540 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9541 the display spec is of the form `(space ...)'.
9542 (handle_display_spec): Return the value returned by
9543 handle_single_display_spec, not just 1 or zero.
9544 (handle_single_display_spec): If the display spec is of the form
9545 `(space ...)', and specifies display in the text area, return 2
9546 rather than 1.
fee65a97 9547 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
9548 accurately, and prefer exact match for point under bidi.
9549 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
9550
9551 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9552 into disp_prop; all users changed.
9553
9554 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9555 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9556 for the text covered by the display property.
9557
e4ed06f1
CY
95582011-08-25 Chong Yidong <cyd@stupidchicken.com>
9559
9560 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9561 Change return value to nil.
9562 (Frecord_buffer): Delete unused function.
9563
f67cdd7f
EZ
95642011-08-24 Eli Zaretskii <eliz@gnu.org>
9565
5980d4c6
EZ
9566 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9567 buffers, return left-to-right.
8610fe8b
EZ
9568 (set_cursor_from_row): Consider candidate row a win if its glyph
9569 represents a newline and point is on that newline. Fixes cursor
9570 positioning on the newline at EOL of R2L text within L2R
9571 paragraph, and vice versa.
9572 (try_cursor_movement): Check continued rows, in addition to
9573 continuation rows. Fixes unwarranted scroll when point enters a
9574 continued line of R2L text within an L2R paragraph, or vice versa.
9575 (cursor_row_p): Consider the case of point being equal to
9576 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9577 from the end of a short line to the beginning of a continued line
9578 of R2L text within L2R paragraph.
9579 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9580 composed characters.
5980d4c6 9581
f67cdd7f
EZ
9582 * bidi.c (bidi_check_type): Use xassert.
9583 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9584 members.
9585
bca633fb
EZ
95862011-08-23 Eli Zaretskii <eliz@gnu.org>
9587
9588 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9589 a character.
9590
4a5885a7
CY
95912011-08-23 Chong Yidong <cyd@stupidchicken.com>
9592
9593 * nsfont.m (ns_otf_to_script): Fix typo.
9594
0902a04e
KH
95952011-08-22 Kenichi Handa <handa@m17n.org>
9596
9597 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9598 extra slot even if the purpose is char-code-property-table.
9599
1a2e6670
EZ
96002011-08-23 Eli Zaretskii <eliz@gnu.org>
9601
8ddde651
EZ
9602 * xdisp.c (redisplay_window): When computing centering_position,
9603 account for the height of the header line. (Bug#8874)
9604
425cc014
EZ
9605 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9606 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9607 candidate is selected by the mouse, and that candidate has a
9608 composed character under the mouse.
9609
1a2e6670
EZ
9610 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9611 coordinates reported by pos-visible-in-window-p for a composed
9612 character in column zero.
9613
8b76d6f8
SM
96142011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9615
9616 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9617
dac347dd
EZ
96182011-08-22 Eli Zaretskii <eliz@gnu.org>
9619
9620 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9621 consider it a hit if to_charpos is anywhere in the range of the
9622 composed buffer positions.
9623
e013fb34
CY
96242011-08-22 Chong Yidong <cyd@stupidchicken.com>
9625
9626 * image.c (gif_load): Don't assume that each subimage has the same
9627 dimensions as the base image. Handle disposal method that is
9628 "undefined" by the gif spec (Bug#9335).
9629
bd1ba3e8
CY
96302011-08-20 Chong Yidong <cyd@stupidchicken.com>
9631
9632 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 9633 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 9634
54a1215b
EZ
96352011-08-19 Eli Zaretskii <eliz@gnu.org>
9636
823564e5
EZ
9637 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9638 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9639 from an Org mode buffer to a Speedbar frame.
9640
54a1215b
EZ
9641 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9642 a composition, take its buffer position from IT->cmp_it.charpos.
9643 Fixes cursor positioning at the beginning of a line that begins
9644 with a composed character.
9645
9778ebcc
EZ
96462011-08-18 Eli Zaretskii <eliz@gnu.org>
9647
0be6ee06
EZ
9648 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9649 character bidirectional type, use STRONG_L instead. Fixes crashes
9650 in a buffer produced by `describe-categories'.
9651
9778ebcc
EZ
9652 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9653 members before the level stack, so they would be saved and
9654 restored when copying iterator state. Fixes incorrect reordering
9655 around TABs covered by display properties.
9656
156bffbe
AS
96572011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9658
6b02f655 9659 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 9660
72ad093b
CY
96612011-08-17 Chong Yidong <cyd@stupidchicken.com>
9662
9663 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
9664 (internal_condition_case_2, internal_condition_case_n):
9665 Remove unnecessary aborts (Bug#9081).
72ad093b 9666
35774242
EZ
96672011-08-17 Eli Zaretskii <eliz@gnu.org>
9668
9669 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9670 has no `load' handler, try opening the file locally. (Bug#9311)
9671
db76dd85
KB
96722011-08-16 Ken Brown <kbrown@cornell.edu>
9673
9674 * gmalloc.c: Expand comment.
9675
b215eee5
EZ
96762011-08-16 Eli Zaretskii <eliz@gnu.org>
9677
9678 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9679 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9680
a4579d33
KB
96812011-08-16 Ken Brown <kbrown@cornell.edu>
9682
9683 Fix memory allocation problems in Cygwin build (Bug#9273).
9684
9685 * unexcw.c ( __malloc_initialized): Declare external variable.
9686 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9687
8b76d6f8
SM
9688 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9689 New variables.
a4579d33
KB
9690 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9691 dumped emacs.
9692 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9693 in the static heap.
9694 [CYGWIN] (special_realloc): New function.
9695 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9696 requests to realloc storage in the static heap.
9697
3ebec551
PE
96982011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9699
9700 * bidi.c (bidi_initialize): Remove unused local.
9701
9fd8be00
EZ
97022011-08-15 Eli Zaretskii <eliz@gnu.org>
9703
6b02f655
SM
9704 * bidimirror.h:
9705 * biditype.h: Remove file.
9706 * makefile.w32-in ($(BLD)/bidi.$(O)):
9707 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
9708
9709 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9710
9711 * chartab.c: Improve commentary for the uniprop_table API.
9712
32413314
EZ
9713 * bidi.c (bidi_paragraph_init): Support zero value of
9714 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
9715 (bidi_initialize): Use uniprop_table instead of including
9716 biditype.h and bidimirror.h.
32413314 9717
9fd8be00
EZ
9718 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9719 coordinates of the iterator when restoring from ppos_it.
9720 (Bug#9296)
9721
5cf2b69b
KH
97222011-08-14 Kenichi Handa <handa@m17n.org>
9723
9724 * process.c (create_process): Call setup_process_coding_systems
72ad093b 9725 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 9726
daf17d00
EZ
97272011-08-14 Eli Zaretskii <eliz@gnu.org>
9728
9729 * xdisp.c (move_it_in_display_line_to): Don't invoke
9730 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9731 ppos_it. Fixes vertical cursor motion when line beginning is
9732 covered by an image. (Bug#9296)
9733
08e3161a
JD
97342011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9735
9736 * nsterm.h (ns_run_ascript): Declare.
9737 (NSAPP_DATA2_RUNASSCRIPT): Define.
9738
9739 * nsfns.m (as_script, as_result, as_status): New static variables.
9740 (ns_run_ascript): New function.
5e617bc2 9741 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
9742 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9743 the event loop. Get status from as_status (Bug#7276).
9744
9745 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9746 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9747 the event loop (Bug#7276).
9748
a3720aa2
AS
97492011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9750
9751 * gnutls.c (QCgnutls_bootprop_priority)
9752 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9753 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9754 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9755 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9756 (QCgnutls_bootprop_verify_hostname_error)
9757 (QCgnutls_bootprop_callbacks_verify): Rename from
9758 Qgnutls_bootprop_..., all uses changed.
9759
9760 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9761 uses changed.
9762
0a0d27fb
PE
97632011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9764
19d5c50c
PE
9765 * xfaces.c (Qframe_set_background_mode): Now static.
9766 * dispextern.h (Qframe_set_background_mode): Remove decl.
9767
0a0d27fb
PE
9768 * process.c (Fnetwork_interface_info): Declare local only if needed.
9769
377538cb
JD
97702011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9771
9772 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9773 (Fnetwork_interface_list): Allocate in increments of bytes instead
9774 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9775 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9776 sockaddr.
9777 (struct ifflag_def): notrailers is smart on OSX.
9778 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9779 Get hardware address with getifaddrs if available.
9780
08fff70c
EZ
97812011-08-12 Eli Zaretskii <eliz@gnu.org>
9782
9783 * xdisp.c (iterate_out_of_display_property): xassert that
9784 IT->position is set to within IT->object's boundaries. Break from
9785 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
9786 when IT->position is set up wrongly due to some bug.
9787 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
9788 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9789 entry. Force push_it to save on the stack the current
9790 buffer/string position, to be restored by pop_it. Fix flags in
9791 the iterator structure wrt the object coming from a display
9792 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9793 properties. (Bug#9284)
9794
7be1c708 97952011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 9796
7be1c708
CY
9797 * fontset.c (fontset_get_font_group): Add proper type checks.
9798 (Bug#9172)
aac0c6e3 9799
7be1c708 98002011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 9801
7be1c708
CY
9802 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9803 and LC_VERSION_MIN_MACOSX.
9804 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9805 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 9806
97bb72a6
EZ
98072011-08-08 Eli Zaretskii <eliz@gnu.org>
9808
9809 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
9810 no-display-properties-and-no-overlays under bidi display.
9811 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 9812 properties and overlays.
97bb72a6 9813
d5617611
CY
98142011-08-08 Chong Yidong <cyd@stupidchicken.com>
9815
37e11a63
CY
9816 * editfns.c (Fset_time_zone_rule): Document relationship with the
9817 setenv function.
9818
d5617611
CY
9819 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9820 the font entity extracted from the cache (Bug#8109).
9821
58872834
CY
98222011-08-07 Chong Yidong <cyd@stupidchicken.com>
9823
9824 * composite.c (autocmp_chars): Don't reset point. That is done by
9825 restore_point_unwind (Bug#5984).
9826
75bfc667
JL
98272011-08-07 Juri Linkov <juri@jurta.org>
9828
9829 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9830 to show the arg `TIME' instead of `TIMEVAL'.
9831
d1410150
EZ
98322011-08-06 Eli Zaretskii <eliz@gnu.org>
9833
9834 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9835 display property strides EOL and includes a newline, as in
9836 longlines-mode. (Bug#9254)
75b771e4
EZ
9837 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9838 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
9839
9840 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9841 is non-zero, even if the data buffer is NULL. Fixes a crash in
9842 vertical-motion with longlines-mode. (Bug#9254)
9843
35928349
EZ
98442011-08-05 Eli Zaretskii <eliz@gnu.org>
9845
ec7cc85b
EZ
9846 * bidi.c <bidi_cache_total_alloc>: Now static.
9847 (bidi_initialize): Initialize bidi_cache_total_alloc.
9848
8b76d6f8 9849 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
9850 cache. (Bug#9221)
9851
9852 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9853 amount allocated this far in `bidi_cache_total_alloc'.
9854 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9855 non-zero, only free the data buffer without restoring the cache
9856 contents. All callers changed.
9857
9858 * dispextern.h (bidi_unshelve_cache): Update prototype.
9859
9860 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9861 (move_it_in_display_line, move_it_to)
9862 (move_it_vertically_backward, move_it_by_lines): Replace the call
9863 to xfree to an equivalent call to bidi_unshelve_cache.
9864 (move_it_in_display_line_to): Fix logic of returning
412b6358 9865 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 9866
e2e2423b
EZ
98672011-08-05 Eli Zaretskii <eliz@gnu.org>
9868
9869 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9870 came from a string character with a `cursor' property. (Bug#9229)
9871
ae9e757a
JD
98722011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9873
9874 * Makefile.in (LIB_PTHREAD): New variable.
9875 (LIBES): Add LIB_PTHREAD (Bug#9216).
9876
9877 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9878 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9879
213bd7f2
AS
98802011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9881
6b02f655 9882 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 9883
99aaf75f
JD
98842011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9885
9886 * xterm.c (x_find_topmost_parent): New function.
9887 (x_set_frame_alpha): Find topmost parent window with
9888 x_find_topmost_parent and set the property there also (bug#9181).
9889 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9890
c74e9d86
PE
98912011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9892
9893 * callproc.c (Fcall_process): Avoid vfork clobbering
9894 the local vars buffer, coding_systems, current_dir.
9895
640c8776
SM
98962011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9897
9898 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9899
f26d0e4c
PE
99002011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9901
8a10d76c
PE
9902 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9903 so that it is not optimized away.
9904
f26d0e4c
PE
9905 * xdisp.c (compute_display_string_pos): Remove unused local.
9906
55439c61
EZ
99072011-08-02 Eli Zaretskii <eliz@gnu.org>
9908
9909 Fix slow cursor motion and scrolling in large buffers with
9910 selective display, like Org Mode buffers. (Bug#9218)
9911
9912 * dispextern.h (struct bidi_it): New member disp_prop_p.
9913
9914 * xdisp.c: Remove one-slot cache of display string positions.
9915 (compute_display_string_pos): Accept an additional argument
5e617bc2 9916 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
9917 for a display string or property. If found, set DISP_PROP_P
9918 non-zero.
9919
9920 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
9921 DISP_PROP_P, and pass it to compute_display_string_pos.
9922 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
9923 non-zero. All callers of bidi_fetch_char changed.
9924
fb33fa43
SM
99252011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
9926
9927 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
9928
b099e063
DM
99292010-12-03 Don March <don@ohspite.net>
9930
9931 * keymap.c (Fdefine_key): Fix non-prefix key error message when
9932 last character M-[char] is translated to ESC [char] (bug#7541).
9933
5cc7f7af
KH
99342011-08-02 Kenichi Handa <handa@m17n.org>
9935
d0fffa3f 9936 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
9937
9938 * chartab.c (uniprop_table): Make it non-static.
9939
525d5e6e
EZ
99402011-08-01 Eli Zaretskii <eliz@gnu.org>
9941
9942 * xdisp.c (forward_to_next_line_start): Accept additional argument
9943 BIDI_IT_PREV, and store into it the state of the bidi iterator had
9944 on the newline.
9945 (reseat_at_next_visible_line_start): Use the bidi iterator state
9946 returned by forward_to_next_line_start to restore the state of
9947 it->bidi_it after backing up to previous newline. (Bug#9212)
9948
31011111
AS
99492011-07-30 Andreas Schwab <schwab@linux-m68k.org>
9950
9951 * regex.c (re_comp): Protoize.
9952 (re_exec): Fix return type.
9953 (regexec): Fix type of `ret'. (Bug#9203)
9954
476371c4
PE
99552011-07-28 Paul Eggert <eggert@cs.ucla.edu>
9956
e5d76069
PE
9957 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
9958 This is needed if max-image-size is a floating-point number.
9959
9a79b20c
AS
99602011-07-28 Andreas Schwab <schwab@linux-m68k.org>
9961
9962 * print.c (print_object): Print empty symbol as ##.
9963
9964 * lread.c (read1): Read ## as empty symbol.
9965
d8c2fa78
AA
99662011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
9967
9968 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
9969 setting frame foreground color (Bug#9175).
9970 (x_set_background_color): Likewise.
9971
ffe57a7a
AA
9972 * nsmenu.m (-setText): Size tooltip dimensions precisely to
9973 contents (Bug#9176).
9974 (EmacsTooltip -init): Remove bezels and add shadows to
9975 tooltip windows.
9976
bf3492a5
AA
9977 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
9978 or scroll bar (Bug#8470).
9979
d55e9c53
AA
9980 * nsfont.m (nsfont_open): Remove assignment to voffset and
9981 unnecessary vars hshink, expand, hd, full_height, min_height.
9982 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
9983
9984 * nsterm.h (nsfont_info): Remove voffset field.
9985
d8c2fa78 99862011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
9987
9988 Implement strike-through and overline on NextStep (Bug#8863).
9989
9990 * nsfont.m (nsfont_open): Use underline position provided by font,
9991 instead of hard-coded value of 2.
9992 (nsfont_draw): Call ns_draw_text_decoration instead.
9993
9994 * nsterm.h: Add declaration for ns_draw_text_decoration.
9995
9996 * nsterm.m (ns_draw_text_decoration): New function for drawing
9997 underline, overline, and strike-through.
9998 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
9999 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 10000 accommodate underlining, etc.
4843aac3 10001
4cc60b9b
EZ
100022011-07-28 Eli Zaretskii <eliz@gnu.org>
10003
bc7ece87
EZ
10004 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10005 default.
4cc60b9b 10006
476371c4
PE
100072011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10008
66606eea
PE
10009 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10010 Without this fix, if a signal arrives just after memory fills up,
10011 'malloc' might be invoked reentrantly.
10012
476371c4
PE
10013 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10014 In other words, assume that every image size is allowed, on non-X
10015 hosts. This assumption is probably wrong, but it lets Emacs compile.
10016
f3fcc40d
AS
100172011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10018
10019 * regex.c (re_iswctype): Convert return values to boolean.
10020
350c992f
EZ
100212011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10022
10023 * xdisp.c (compute_display_string_pos): Don't use cached display
10024 string position if the buffer had its restriction changed.
10025 (Bug#9184)
10026
5266b4bb
PE
100272011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10028
10029 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10030
2573a837 100312011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 10032
41f55ccd 10033 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 10034
39e378da
PE
10035 * bidi.c: Integer size and overflow fixes.
10036 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10037 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10038 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10039 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10040 (bidi_find_other_level_edge):
10041 Use ptrdiff_t instead of EMACS_INT where either will do.
10042 This works better on 32-bit hosts configured --with-wide-int.
10043 (bidi_cache_ensure_space): Check for size-calculation overflow.
10044 Use % rather than repeated addition, for better worst-case speed.
10045 Don't set bidi_cache_size until after xrealloc returns, because it
10046 might not return.
10047 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
10048 (bidi_cache_ensure_space): Also check that the bidi cache size
10049 does not exceed that of the largest Lisp string or buffer. See Eli
10050 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 10051
5e927815
PE
10052 * alloc.c (__malloc_size_t): Remove.
10053 All uses replaced by size_t. See Andreas Schwab's note
10054 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10055
ca4aa935
PE
10056 * image.c: Improve checking for integer overflow.
10057 (check_image_size): Assume that f is nonnull, since
10058 it is always nonnull in practice. This is one less thing to
10059 worry about when checking for integer overflow later.
10060 (x_check_image_size): New function, which checks for integer
10061 overflow issues inside X.
10062 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10063 This removes the need for a memory_full check.
10064 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10065 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10066 (xbm_read_bitmap_data): Change locals back to 'int', since
10067 their values must fit in 'int'.
10068 (xpm_load_image, png_load, tiff_load):
10069 Invoke x_create_x_image_and_pixmap earlier,
10070 to avoid much needless work if the image is too large.
10071 (tiff_load): Treat overly large images as if
10072 x_create_x_image_and_pixmap failed, not as malloc failures.
10073 (gs_load): Use x_check_image_size.
10074
5f8f9cc2
PE
10075 * gtkutil.c: Omit integer casts.
10076 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10077 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10078
5adf60bc
PE
10079 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10080
c8907a93
PE
10081 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10082 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10083 would wrongly return t on a 64-bit host.
10084
e3c25c68
PE
10085 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10086 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10087 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10088 and therefore cause GCC to emit a bogus diagnostic in some cases.
10089
3f791afe
PE
10090 * image.c: Integer signedness and overflow and related fixes.
10091 This is not an exhaustive set of fixes, but it's time to
10092 record what I've got.
10093 (lookup_pixel_color, check_image_size): Remove redundant decls.
10094 (check_image_size): Don't assume that arbitrary EMACS_INT values
10095 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10096 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10097 (tiff_load, imagemagick_load_image):
10098 Check for overflow in size calculations.
10099 (x_create_x_image_and_pixmap): Remove unnecessary test for
10100 xmalloc returning NULL; that can't happen.
10101 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10102 (xpm_color_bucket): Use better integer hashing function.
10103 (xpm_cache_color): Don't possibly over-allocate memory.
10104 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10105 (gif_memory_source):
10106 Use ptrdiff_t, not int or size_t, to record sizes.
10107 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10108 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10109 either works, as we prefer signed integers.
10110 (tiff_read_from_memory, tiff_write_from_memory):
10111 Return tsize_t, not size_t, since that's what the TIFF API wants.
10112 (tiff_read_from_memory): Don't fail simply because the read would
10113 go past EOF; instead, return a short read.
10114 (tiff_load): Omit no-longer-needed casts.
10115 (Fimagemagick_types): Don't assume size fits into 'int'.
10116
3cc5a532
PE
10117 Improve hashing quality when configured --with-wide-int.
10118 * fns.c (hash_string): New function, taken from sxhash_string.
10119 Do not discard information about ASCII character case; this
10120 discarding is no longer needed.
10121 (sxhash-string): Use it. Change sig to match it. Caller changed.
10122 * lisp.h: Declare it.
10123 * lread.c (hash_string): Remove, since we now use fns.c's version.
10124 The fns.c version returns a wider integer if --with-wide-int is
10125 specified, so this should help the quality of the hashing a bit.
10126
b312a492
PE
10127 * emacs.c: Integer overflow minor fix.
10128 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10129 Define only if GNU_LINUX.
10130 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10131
dfd153ae
PE
10132 * dispnew.c: Integer signedness and overflow fixes.
10133 Remove unnecessary forward decls, that were a maintenance hassle.
10134 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10135 All uses changed.
10136 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10137 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10138 (prepare_desired_row, line_draw_cost):
10139 Use int, not unsigned, where either works.
10140 (save_current_matrix, restore_current_matrix):
10141 Use ptrdiff_t, not size_t, where either works.
10142 (init_display): Check for overflow more accurately, and without
10143 relying on undefined behavior.
10144
a81d11a3
PE
10145 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10146 Remove, replacing with the new symbols in lisp.h. All uses changed.
10147 * fileio.c (make_temp_name):
10148 * filelock.c (lock_file_1, lock_file):
10149 * xdisp.c (message_dolog):
10150 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10151 Use pMd etc. instead.
10152 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10153 replacing the pWIDE etc. symbols removed from editfns.c.
10154
3300e6fd
PE
10155 * keyboard.h (num_input_events): Now uintmax_t.
10156 This is (very slightly) less likely to mess up due to wraparound.
10157 All uses changed.
10158
fd05c7e9
PE
10159 * buffer.c: Integer signedness fixes.
10160 (alloc_buffer_text, enlarge_buffer_text):
10161 Use ptrdiff_t rather than size_t when either will do, as we prefer
10162 signed integers.
10163
903fe15d
PE
10164 * alloc.c: Integer signedness and overflow fixes.
10165 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10166 (__malloc_size_t): Default to size_t, not to int.
10167 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10168 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10169 Prefer ptrdiff_t to size_t when either would do, as we prefer
10170 signed integers.
10171 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10172 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10173 Now const. Initialize with values that are in range even if char
10174 is signed.
10175 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10176 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10177 These functions do the right thing with sizes > 2**32.
10178 (check_depth): Now ptrdiff_t, not int.
10179 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10180 Adjust to new way of storing sizes. Check for size overflow bugs
10181 in rest of code.
10182 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10183 slightly wrong anyway, as it missed one instance of
10184 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10185 (refill_memory_reserve): Omit needless cast to size_t.
10186 (mark_object_loop_halt): Mark as externally visible.
10187
ac82cc6a
PE
10188 * xselect.c: Integer signedness and overflow fixes.
10189 (Fx_register_dnd_atom, x_handle_dnd_message):
10190 Use ptrdiff_t, not size_t, since we prefer signed.
10191 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10192 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10193 x_dnd_atoms_size and x_dnd_atoms_length.
10194
c2d1e36d
PE
10195 * doprnt.c: Prefer signed to unsigned when either works.
10196 * eval.c (verror):
10197 * doprnt.c (doprnt):
10198 * lisp.h (doprnt):
10199 * xdisp.c (vmessage):
10200 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10201 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10202 prefer signed arithmetic to avoid comparison confusion.
10203 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10204 but is a bit tricky.
10205
0e926e56
PE
10206 Assume freestanding C89 headers, string.h, stdlib.h.
10207 * data.c, doprnt.c, floatfns.c, print.c:
10208 Include float.h unconditionally.
10209 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10210 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10211 * regex.c: Likewise for stddef.h, string.h.
10212 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10213 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10214 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10215 (STDC_HEADERS): Remove obsolete defines.
10216 * sysdep.c: Include limits.h unconditionally.
10217
9cfdb3ec
PE
10218 Assume support for memcmp, memcpy, memmove, memset.
10219 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10220 * regex.c (memcmp, memcpy):
10221 Remove; we assume C89 now.
10222
10223 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10224 (__malloc_safe_bcopy): Remove; no longer needed.
10225
cf950e6b 10226 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
10227 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10228 well either way, and we prefer signed to unsigned.
10229
dbf38e02
LMI
102302011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10231
10232 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10233 closes the connection while we're reading (bug#9182).
10234
d6f0886c 102352011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 10236
d6f0886c
JD
10237 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10238 are specified (Bug#9168).
24e0f6b1 10239
2eb1f9e6
PE
102402011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10241
10242 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10243 Found by GCC static checking and --with-wide-int on a 32-bit host.
10244
22381272 102452011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
10246
10247 * xdisp.c (compute_display_string_pos): Fix logic of caching
10248 previous display string position. Initialize cached_prev_pos to
10249 -1. Fixes slow-down at the beginning of a buffer.
10250
f25e39b4
EZ
102512011-07-24 Eli Zaretskii <eliz@gnu.org>
10252
10253 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10254 for attrs[LFACE_FONTSET_INDEX].
10255
04c4b52e
PE
102562011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10257
10258 * xml.c (parse_region): Remove unused local
10259 that was recently introduced.
10260
c1734fbd
EZ
102612011-07-23 Eli Zaretskii <eliz@gnu.org>
10262
be18c5a5
EZ
10263 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10264 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10265
c1734fbd
EZ
10266 * xdisp.c (move_it_in_display_line_to): Record the best matching
10267 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
10268 exit if none of the characters scanned was an exact match.
10269 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
10270 when exact match is impossible due to invisible text, and the
10271 lines are truncated.
10272
a258d627
JD
102732011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10274
10275 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10276 for OSX >= 10.7.
10277
b6d5a689
EZ
102782011-07-22 Eli Zaretskii <eliz@gnu.org>
10279
0f74f785
EZ
10280 Fix a significant slow-down of cursor motion with C-n, C-p,
10281 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10282 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 10283 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
10284 (next_element_from_buffer): Call compute_stop_pos_backwards to
10285 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
10286 base_level_stop.
10287 (reseat): Don't look for prev_stop, as that could mean a very long
10288 run.
10289 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10290 <cached_disp_overlay_modiff>: Cache for last found display string
10291 position.
551918c1 10292 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
10293 about the same buffer in the same area of character positions, and
10294 the buffer wasn't changed since the time the display string
10295 position was cached.
551918c1 10296
b2d0c91a
EZ
102972011-07-22 Eli Zaretskii <eliz@gnu.org>
10298
10299 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10300 is an integer, which is important for empty lines. (Bug#9149)
10301
043604ee
CY
103022011-07-22 Chong Yidong <cyd@stupidchicken.com>
10303
10304 * frame.c (Fmodify_frame_parameters): In tty case, update the
10305 default face if necessary (Bug#4238).
10306
da4adb04
CY
103072011-07-21 Chong Yidong <cyd@stupidchicken.com>
10308
10309 * editfns.c (Fstring_to_char): No need to explain what a character
10310 is in the docstring (Bug#6576).
10311
9abd0532
LMI
103122011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10313
10314 * xml.c (parse_region): Make sure we always return a tree.
10315
36881d16
HK
103162011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10317
10318 * xml.c (parse_region): If a document contains only comments,
10319 return that, too.
10320
1e98674d
LMI
103212011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10322
10323 * xml.c (make_dom): Return comments, too.
10324
590bd467
PE
103252011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10326
10327 Port to OpenBSD.
10328 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10329 and the surrounding thread.
10330 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10331 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10332 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10333 timer goes off.
10334 * s/openbsd.h (BROKEN_SIGIO): Define.
10335 * unexelf.c (unexec) [__OpenBSD__]:
10336 Don't update the .mdebug section of the Alpha COFF symbol table.
10337
f41628b2
LMI
103382011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10339
10340 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10341 (bug#8460).
10342
b59b67c5
PE
103432011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10344
15e3a074
PE
10345 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10346 This fixes some race conditions on the permissions of any newly
10347 created file.
10348
41bed37d
PE
10349 * alloc.c (valid_pointer_p): Use pipe, not open.
10350 This fixes some permissions issues when debugging.
10351
b59b67c5
PE
10352 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10353 If fchown fails to set both uid and gid, try to set just gid,
10354 as that is sometimes allowed. Adjust the file's mode to eliminate
10355 setuid or setgid bits that are inappropriate if fchown fails.
10356
925a6be7
SM
103572011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10358
10359 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10360 to compare Lisp_Objects.
10361 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10362 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10363 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10364
52968808
AS
103652011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10366
0a6a104b
AS
10367 * lread.c (read_integer): Unread even EOF character.
10368 (read1): Likewise. Properly record start position of symbol.
10369
52968808
AS
10370 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10371 symbol character follows.
10372
9e381cdd
PE
103732011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10374
10375 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10376 This works around a problem with the previous change to Fcopy_file.
10377 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10378 and without this change, GCC might complain about discarding
10379 fchown's return value.
10380
b5641435
JB
103812011-07-16 Juanma Barranquero <lekktu@gmail.com>
10382
10383 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10384
a8031457
PE
103852011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10386
10387 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10388
dd889327
LMI
103892011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10390
750c33f7
LMI
10391 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10392 it's used from the C level.
10393
dd889327
LMI
10394 * process.c: Use the same condition for POLL_FOR_INPUT in both
10395 keyboard.c and process.c (bug#1858).
10396
87e86684
LM
103972011-07-09 Lawrence Mitchell <wence@gmx.li>
10398
10399 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10400 (Fgnutls_boot): Use it.
10401
64348f40
AS
104022011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10403
10404 * doc.c (Fsubstitute_command_keys): Revert last change.
10405
1d698799
LMI
104062011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10407
f863868c
LMI
10408 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10409 quotes the next character, and doesn't affect other longer
10410 sequences (bug#8935).
10411
1d698799
LMI
10412 * lread.c (syms_of_lread): Clarify that is isn't only
10413 `eval-buffer' and `eval-defun' that's affected by
10414 `lexical-binding' (bug#8460).
10415
aa4b6df6
EZ
104162011-07-15 Eli Zaretskii <eliz@gnu.org>
10417
10418 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 10419 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 10420
5d856da6
PE
104212011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10422
ad6042bb
PE
10423 Fix minor problems found by static checking.
10424 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10425 (elsz): Now a signed constant, not a size_t var. We prefer signed
10426 types to unsigned, to avoid integer comparison confusion. Without
10427 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10428 "cannot optimize loop, the loop counter may overflow", a symptom
10429 of the confusion.
f00bbb22 10430 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
10431 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10432
6468f31c
LMI
104332011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10434
49080b10
LMI
10435 * search.c (Fre_search_backward): Mention `case-fold-search' in
10436 all the re_search_* functions (bug#8138).
10437
6468f31c
LMI
10438 * keyboard.c (Fopen_dribble_file): Document when the file is
10439 closed (bug#8056).
10440
c965adc5
EZ
104412011-07-14 Eli Zaretskii <eliz@gnu.org>
10442
df9733bf
EZ
10443 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10444 bidi_cache_idx.
10445
0bb23927
EZ
10446 Support bidi reordering of display and overlay strings.
10447 * xdisp.c (compute_display_string_pos)
10448 (compute_display_string_end): Accept additional argument STRING.
10449 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10450 (reseat_to_string): Initialize bidi_it->string.s and
10451 bidi_it->string.schars.
10452 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
10453 NULL (avoids a crash in bidi_paragraph_init).
10454 Initialize itb.string.lstring.
0bb23927
EZ
10455 (init_iterator): Call bidi_init_it only of a valid
10456 buffer position was specified. Initialize paragraph_embedding to
10457 L2R.
10458 (reseat_to_string): Initialize the bidi iterator.
10459 (display_string): If we need to ignore text properties of
10460 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10461 original value of -1 will not work with bidi.)
10462 (compute_display_string_pos): First arg is now struct
10463 `text_pos *'; all callers changed. Support display properties on
10464 Lisp strings.
10465 (compute_display_string_end): Support display properties on Lisp
10466 strings.
10467 (init_iterator, reseat_1, reseat_to_string): Initialize the
10468 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10469 when iterating on a string not from display properties).
640c8776
SM
10470 (compute_display_string_pos, compute_display_string_end):
10471 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
10472 arrow keys.
10473 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
10474 base_level_stop; instead, set base_level_stop to BEGV.
10475 Fixes crashes in vertical-motion.
0bb23927
EZ
10476 (next_element_from_buffer): Improve commentary for when
10477 the iterator is before prev_stop.
10478 (init_iterator): Initialize bidi_p from the default value of
10479 bidi-display-reordering, not from buffer-local value. Use the
10480 buffer-local value only if initializing for buffer iteration.
10481 (handle_invisible_prop): Support invisible properties on strings
10482 that are being bidi-reordered.
10483 (set_iterator_to_next): Support bidi reordering of C strings and
10484 Lisp strings.
10485 (next_element_from_string): Support bidi reordering of Lisp
10486 strings.
10487 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
10488 (display_string): Support display of R2L glyph rows.
10489 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
10490 (init_iterator): Don't initialize it->bidi_p for strings
10491 here.
10492 (reseat_to_string): Initialize it->bidi_p for strings here.
10493 (next_element_from_string, next_element_from_c_string)
10494 (next_element_from_buffer): Add xassert's for correspondence
10495 between IT's object being iterated and it->bidi_it.string
10496 structure.
10497 (face_before_or_after_it_pos): Support bidi iteration.
10498 (next_element_from_c_string): Handle the case of the first string
10499 character that is not the first one in the visual order.
10500 (get_visually_first_element): New function, refactored from common
10501 parts of next_element_from_buffer, next_element_from_string, and
10502 next_element_from_c_string.
10503 (tool_bar_lines_needed, redisplay_tool_bar)
10504 (display_menu_bar): Force left-to-right direction. Add a FIXME
10505 comment for making that be controlled by a user option.
10506 (push_it, pop_it): Save and restore the state of the
10507 bidi iterator. Save and restore the bidi_p flag.
10508 (pop_it): Iterate out of display property for string iteration as
10509 well.
10510 (iterate_out_of_display_property): Support iteration over strings.
10511 (handle_single_display_spec): Set up it->bidi_it for iteration
10512 over a display string, and call bidi_init_it.
10513 (handle_single_display_spec, next_overlay_string)
10514 (get_overlay_strings_1, push_display_prop): Set up the bidi
10515 iterator for displaying display or overlay strings.
10516 (forward_to_next_line_start): Don't use the shortcut if
10517 bidi-iterating.
10518 (back_to_previous_visible_line_start): If handle_display_prop
10519 pushed the iterator stack, restore the internal state of the bidi
10520 iterator by calling bidi_pop_it same number of times.
10521 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10522 and we are bidi-iterating, don't decrement the iterator position;
10523 instead, set the first_elt flag in the bidi iterator, to produce
10524 the same effect.
10525 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10526 (push_display_prop): xassert that we are iterating a buffer.
10527 (push_it, pop_it): Save and restore paragraph_embedding member.
10528 (handle_single_display_spec, next_overlay_string)
10529 (get_overlay_strings_1, reseat_1, reseat_to_string)
10530 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10531 correctly. Don't assume unibyte strings are not bidi-reordered.
10532 (compute_display_string_pos)
10533 (compute_display_string_end): Fix handling the case of C string.
10534 (push_it, pop_it): Save and restore from_disp_prop_p.
10535 (handle_single_display_spec, push_display_prop): Set the
10536 from_disp_prop_p flag.
10537 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10538 (pop_it): Call iterate_out_of_display_property only if we are
10539 popping after iteration over a string that came from a display
10540 property. Fix a typo in popping stretch info. Add an assertion
10541 for verifying that the iterator position is in sync with the bidi
10542 iterator.
10543 (handle_single_display_spec, get_overlay_strings_1)
10544 (push_display_prop): Fix initialization of paragraph direction for
10545 string when that of the parent object is not yet determined.
10546 (reseat_1): Call bidi_init_it to resync the bidi
10547 iterator with IT's position. (Bug#7616)
10548 (find_row_edges): If ROW->start.pos gives position
10549 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10550 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10551 Reset the from_disp_prop_p flag.
10552 (SAVE_IT, RESTORE_IT): New macros.
10553 (pos_visible_p, face_before_or_after_it_pos)
10554 (back_to_previous_visible_line_start)
10555 (move_it_in_display_line_to, move_it_in_display_line)
10556 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10557 (try_scrolling, redisplay_window, display_line): Use them when
10558 saving a temporary copy of the iterator and restoring it back.
10559 (back_to_previous_visible_line_start, reseat_1)
10560 (init_iterator): Empty the bidi cache "stack".
10561 (move_it_in_display_line_to): If iterator ended up at
10562 EOL, but we never saw any buffer positions smaller than
10563 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10564 motion in bidi-reordered lines.
10565 (move_it_in_display_line_to): Record prev_method and prev_pos
10566 immediately before the call to set_iterator_to_next. Fixes cursor
10567 motion in bidi-reordered lines with stretch glyphs and strings
10568 displayed in margins. (Bug#8133) (Bug#8867)
10569 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10570 TO_CHARPOS.
640c8776
SM
10571 (pos_visible_p): Support positions in bidi-reordered lines.
10572 Save and restore bidi cache.
0bb23927
EZ
10573
10574 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10575 (bidi_paragraph_info): Delete unused struct.
10576 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10577 (bidi_cache_start): New variable.
10578 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10579 to zero.
10580 (bidi_cache_fetch_state, bidi_cache_search)
10581 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10582 (bidi_cache_find, bidi_peek_at_next_level)
10583 (bidi_level_of_next_char, bidi_find_other_level_edge)
10584 (bidi_move_to_visually_next): Compare cache index with
10585 bidi_cache_start rather than with zero.
10586 (bidi_fetch_char): Accept new argument STRING; all callers
10587 changed. Support iteration over a string. Support strings with
10588 display properties. Support unibyte strings. Fix the type of
10589 `len' according to what STRING_CHAR_AND_LENGTH expects.
10590 (bidi_paragraph_init, bidi_resolve_explicit_1)
10591 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
10592 (bidi_level_of_next_char, bidi_move_to_visually_next):
10593 Support iteration over a string.
0bb23927
EZ
10594 (bidi_set_sor_type, bidi_resolve_explicit_1)
10595 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10596 can now be zero (for strings); special values 0 and -1 were
10597 changed to -1 and -2, respectively.
10598 (bidi_char_at_pos): New function.
10599 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10600 Call it instead of FETCH_MULTIBYTE_CHAR.
10601 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10602 initialized to valid values.
10603 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10604 values.
10605 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10606 the test for valid cached positions. Fix the logic for looking up
10607 the sentinel state in the cache. GCPRO the Lisp string we are
10608 iterating.
10609 (bidi_push_it, bidi_pop_it): New functions.
10610 (bidi_initialize): Initialize the bidi cache start stack pointer.
10611 (bidi_cache_ensure_space): New function, refactored from part of
10612 bidi_cache_iterator_state. Don't assume the required size is just
10613 one BIDI_CACHE_CHUNK away.
10614 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10615 (bidi_count_bytes, bidi_char_at_pos): New functions.
10616 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10617 always valid if bidi_cache_idx is valid.
10618 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10619 is valid if it's going to be used.
10620 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10621 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
10622 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10623 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
10624 (bidi_find_other_level_edge, bidi_cache_start_stack):
10625 All variables related to cache indices are now EMACS_INT.
c965adc5 10626
0bb23927
EZ
10627 * dispextern.h (struct bidi_string_data): New structure.
10628 (struct bidi_it): New member `string'. Make flag members be 1-bit
10629 fields, and put them last in the struct.
640c8776
SM
10630 (compute_display_string_pos, compute_display_string_end):
10631 Update prototypes.
0bb23927
EZ
10632 (bidi_push_it, bidi_pop_it): Add prototypes.
10633 (struct iterator_stack_entry): New members bidi_p,
10634 paragraph_embedding, and from_disp_prop_p.
10635 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
10636 (bidi_shelve_cache, bidi_unshelve_cache):
10637 Declare prototypes.
0bb23927
EZ
10638
10639 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10640 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10641 and vector-like objects.
10642
10643 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10644 cache around display iteration.
10645
10646 * window.c (Fwindow_end, window_scroll_pixel_based)
10647 (displayed_window_lines, Frecenter): Save and restore the bidi
10648 cache around display iteration.
10649
3bbd2265
LMI
106502011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10651
10652 * editfns.c (Fdelete_region): Clarify the use of the named
10653 parameters (bug#6788).
10654
adc47434
MR
106552011-07-14 Martin Rudalics <rudalics@gmx.at>
10656
10657 * indent.c (Fvertical_motion): Set and restore w->pointm when
10658 saving and restoring the window's buffer (Bug#9006).
10659
837c31f8
LMI
106602011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10661
10662 * editfns.c (Fstring_to_char): Clarify just what is returned
10663 (bug#6576). Text by Eli Zaretskii.
10664
ac389d0c
JB
106652011-07-13 Juanma Barranquero <lekktu@gmail.com>
10666
10667 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10668
0be0ce47
EZ
106692011-07-13 Eli Zaretskii <eliz@gnu.org>
10670
10671 * buffer.c (mmap_find): Fix a typo.
10672
cd18e7e3
JB
106732011-07-13 Johan Bockgård <bojohan@gnu.org>
10674
10675 Fix execution of x selection hooks.
10676 * xselect.c (Qx_lost_selection_functions)
10677 (Qx_sent_selection_functions): New vars.
10678 (syms_of_xselect): DEFSYM them.
10679 (x_handle_selection_request): Pass Qx_sent_selection_functions
10680 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10681 (x_handle_selection_clear,x_clear_frame_selections):
10682 Pass Qx_lost_selection_functions rather than
10683 Vx_lost_selection_functions to Frun_hook_with_args.
10684
47ea7f44
PE
106852011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10686
ac389d0c 10687 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
10688 The old code sometimes used this field without initializing it.
10689
47ea7f44
PE
10690 * alloc.c (gc_sweep): Don't read past end of array.
10691 In theory, the old code could also have corrupted Emacs internals,
10692 though it'd be very unlikely.
10693
bc985c87
AS
106942011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10695
10696 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 10697 argument. (Bug#4026)
bc985c87 10698
0cf34688
LMI
106992011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10700
b3dadd76
LMI
10701 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10702 key" (bug#4257).
10703
0cf34688
LMI
10704 * window.c (Fset_window_start): Doc fix (bug#4199).
10705 (Fset_window_hscroll): Ditto.
10706
270768cd
PE
107072011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10708
077e3dda 10709 Fix minor new problems caught by GCC 4.6.1.
270768cd 10710 * term.c (init_tty): Remove unused local.
490011a6 10711 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 10712 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 10713 not used otherwise.
270768cd 10714
b1f58454
CY
107152011-07-12 Chong Yidong <cyd@stupidchicken.com>
10716
10717 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10718
22b9578d
LMI
107192011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10720
6e70ab07
LMI
10721 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10722 are the mini-buffer and the echo area (bug#3320).
10723
22b9578d
LMI
10724 * term.c (init_tty): Remove support for supdup, c10 and perq
10725 terminals, which are no longer supported (bug#1482).
10726
8974cc9f
JB
107272011-07-10 Johan Bockgård <bojohan@gnu.org>
10728
10729 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10730
a560d974
JD
107312011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10732
10733 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10734 for non-popups (Bug#3642).
10735
1dae0f0a
AS
107362011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10737
268c2c36 10738 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 10739 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
10740 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10741 * cm.c (losecursor): Likewise.
1dae0f0a
AS
10742 * data.c (fmod): Likewise.
10743 * dispnew.c (swap_glyphs_in_rows): Likewise.
10744 * emacs.c (memory_warning_signal): Likewise.
10745 * floatfns.c (float_error): Likewise.
10746 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10747 (otf_open, font_otf_capability, generate_otf_features)
10748 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10749 Likewise.
10750 * image.c (pbm_read_file): Likewise.
10751 * indent.c (string_display_width): Likewise.
10752 * intervals.c (check_for_interval, search_for_interval)
10753 (inc_interval_count, count_intervals, root_interval)
10754 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10755 * lread.c (defalias): Likewise.
268c2c36 10756 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
10757 * regex.c (set_image_of_range_1, set_image_of_range)
10758 (regex_grow_registers): Likewise.
10759 * sysdep.c (strerror): Likewise.
10760 * termcap.c (valid_filename_p, tprint, main): Likewise.
10761 * tparam.c (main): Likewise.
10762 * unexhp9k800.c (run_time_remap, save_data_space)
10763 (update_file_ptrs, read_header, write_header, calculate_checksum)
10764 (copy_file, copy_rest, display_header): Likewise.
10765 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10766 Likewise.
10767 * xdisp.c (check_it): Likewise.
10768 * xfaces.c (register_color, unregister_color, unregister_colors):
10769 Likewise.
10770 * xfns.c (print_fontset_result): Likewise.
10771 * xrdb.c (member, fatal, main): Likewise.
10772
99033785
PE
107732011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10774
10775 Fix minor problems found by static checking (Bug#9031).
10776 * chartab.c (char_table_set_range, map_sub_char_table):
10777 Remove unused locals.
10778 (uniprop_table): Now static.
10779 * composite.c (_work_char): Remove unused static var.
10780
9cb2ac56
JB
107812011-07-09 Juanma Barranquero <lekktu@gmail.com>
10782
10783 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10784
f25661f0
JD
107852011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10786
10787 * gtkutil.c (qttip_cb): Remove code without function.
10788
8278c4fe
EZ
107892011-07-09 Eli Zaretskii <eliz@gnu.org>
10790
10791 * w32.c (pthread_sigmask): New stub.
10792
1692ae2d 107932011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 10794
8a6ebd58 10795 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
10796 sigprocmask is portable only for single-threaded applications, and
10797 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
10798 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10799 (LIBES): Use it.
10800 * callproc.c (Fcall_process):
10801 * process.c (create_process):
10802 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10803 Use pthread_sigmask, not sigprocmask.
123403e4 10804
1b854618
JD
108052011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10806
10807 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10808 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10809 wrong (Bug#8591).
10810
3fe4b549
JD
108112011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10812
0ce7e563
JD
10813 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10814 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10815 (xg_hide_tooltip): Fix comment.
10816
3fe4b549
JD
10817 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10818 in registerServicesMenuSendTypes.
10819 (validRequestorForSendType): Don't check ns_return_types.
10820
10821 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10822 ns_return_type.
10823
5df75e47
JR
108242011-07-08 Jason Rumney <jasonr@gnu.org>
10825
22610910
JR
10826 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10827 SH_SHOW for hidden windows (Bug#5482).
10828
5df75e47
JR
10829 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10830 frame struct members of non-existent frames (Bug#6284).
10831
699c10bd
JD
108322011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10833
4393663b
JD
10834 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10835 variable firstTime not needed on OSX >= 10.6.
10836 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10837 >= 10.5. Use setKnobProportion, setDoubleValue.
10838
10839 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10840 (MAC_OS_X_VERSION_10_5): Define if not defined.
10841 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10842 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10843 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10844
10845 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 10846 cString and lossyCString on OSX >= 10.4.
4393663b 10847
58179cce 10848 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
10849 sizeToFit on OSX >= 10.2.
10850
10851 * nsimage.m (allocInitFromFile): Don't use deprecated method
10852 bestRepresentationForDevice on OSX >= 10.6.
10853
10854 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10855 to avoid warning.
10856
10857 * emacs.c: Declare unexec_init_emacs_zone.
10858
a63e0781
JD
10859 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10860
699c10bd
JD
10861 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10862
10863 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10864 on svcsMenu (Bug#8842).
10865
10866 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10867 ns_return_types.
10868 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10869
10870 * nsterm.m (QUTF8_STRING): Declare.
10871 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10872 (validRequestorForSendType): Return type is (id).
10873 Change indexOfObjectIdenticalTo to indexOfObject.
10874 Check if we have local selection before returning self (Bug#8842).
10875 (writeSelectionToPasteboard): Put local selection into paste board
10876 if we have a local selection (Bug#8842).
10877 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10878
10879 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10880 (ns_get_local_selection): Declare.
10881
54e10184
LMI
108822011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10883
9888ff71
LMI
10884 * keymap.c (describe_map_tree): Don't insert a double newline at
10885 the end of the buffer (bug#1169) and return whether we inserted
10886 something.
10887
54e10184
LMI
10888 * callint.c (Fcall_interactively): Change "reading args" to
10889 "providing args" to try to clarify what it does (bug#1010).
10890
15fa4783
KH
108912011-07-07 Kenichi Handa <handa@m17n.org>
10892
10893 * composite.c (composition_compute_stop_pos): Ignore a static
10894 composition starting before CHARPOS (Bug#8915).
10895
10896 * xdisp.c (handle_composition_prop): Likewise.
10897
a8815b00
EZ
108982011-07-07 Eli Zaretskii <eliz@gnu.org>
10899
10900 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10901 (Bug#9015)
10902
ef7b981d 109032011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
10904
10905 * character.h (unicode_category_t): New enum type.
10906
10907 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10908 (Qchar_code_property_table): New variable.
10909 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10910 (UNIPROP_COMPRESSED_FORM_P): New macros.
10911 (char_table_ascii): Uncompress the compressed values.
10912 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10913 Uncompress the compressed values.
ac389d0c 10914 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
10915 (char_table_ref_and_range): Uncompress the compressed values.
10916 (sub_char_table_set): New arg is_uniprop. Callers changed.
10917 Uncompress the compressed values.
10918 (sub_char_table_set_range): Args changed. Callers changed.
10919 (char_table_set_range): Adjuted for the above change.
10920 (map_sub_char_table): Delete args default_val and parent. Add arg
10921 top. Give decoded values to a Lisp function.
640c8776 10922 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
10923 values to a Lisp function. Gcpro more variables.
10924 (uniprop_table_uncompress)
10925 (uniprop_decode_value_run_length): New functions.
10926 (uniprop_decoder, uniprop_decoder_count): New variables.
10927 (uniprop_get_decoder, uniprop_encode_value_character)
10928 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
10929 New functions.
10930 (uniprop_encoder, uniprop_encoder_count): New variables.
10931 (uniprop_get_encoder, uniprop_table)
10932 (Funicode_property_table_internal, Fget_unicode_property_internal)
10933 (Fput_unicode_property_internal): New functions.
10934 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
10935 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 10936 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
10937 char-code-property-alist.
10938
640c8776 10939 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
10940 Vunicode_category_table.
10941
640c8776 10942 * font.c (font_range): Adjust for the change of
c805dec0
KH
10943 Vunicode_category_table.
10944
76b397fb
DN
109452011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
10946
10947 * m/iris4d.h: Remove file, move contents ...
10948 * s/irix6-5.h: ... here.
10949
22b4128e
PE
109502011-07-06 Paul Eggert <eggert@cs.ucla.edu>
10951
10952 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
10953 * alloc.c (mark_buffer):
10954 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
10955 (clone_per_buffer_values): Don't assume that
22b4128e
PE
10956 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
10957 This isn't true in general, and it's particularly not true
10958 if Emacs is configured with --with-wide-int.
10959 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
10960 New macros, used in the buffer.c change.
10961
869795d6
JD
109622011-07-05 Jan Djärv <jan.h.d@swipnet.se>
10963
10964 * xsettings.c: Use both GConf and GSettings if both are available.
10965 (store_config_changed_event): Add comment.
10966 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
10967 (store_tool_bar_style_changed): New functions.
5e617bc2 10968 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
10969 (struct xsettings): Move font inside HAVE_XFT.
10970 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 10971 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 10972 Move inside HAVE_XFT.
640c8776 10973 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
10974 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
10975 also.
10976 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 10977 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 10978 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
10979 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
10980 (parse_settings): Move check for font inside HAVE_XFT.
10981 (read_settings, apply_xft_settings): Add comment.
10982 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
10983 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
10984 call store_font_name_changed.
10985 (xft_settings_event): Add comment.
10986 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
10987 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
10988 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
10989 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
10990 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
10991 (xsettings_get_system_font, xsettings_get_system_normal_font):
10992 Add comment.
869795d6 10993
d8ed26bd
PE
109942011-07-05 Paul Eggert <eggert@cs.ucla.edu>
10995
10996 Random fixes. E.g., (random) never returned negative values.
10997 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
10998 subseconds part to the entropy, as that's a bit more random.
10999 Prefer signed to unsigned, since the signedness doesn't matter and
11000 in general we prefer signed. When given a limit, use a
11001 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11002 latter isn't right if USE_2_TAGS_FOR_INTS.
11003 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11004 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11005
cabf1cac
SM
110062011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11007
11008 * textprop.c (text_property_stickiness):
11009 Obey Vtext_property_default_nonsticky.
11010 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11011 * w32fns.c (syms_of_w32fns):
11012 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11013
6e9b2be9
PE
110142011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11015
11016 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11017 This is more efficient than Ffile_directory_p and avoids a minor race.
11018
90186c68
LMI
110192011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11020
7c301272
LMI
11021 * buffer.c (Foverlay_put): Say what the return value is
11022 (bug#7835).
11023
c4f2d8d4
LMI
11024 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11025 is a directory before asking whether to use the file name
11026 (bug#7564).
ad637907
LMI
11027 (barf_or_query_if_file_exists): Make the "File is a directory"
11028 error be more correct.
c4f2d8d4 11029
90186c68
LMI
11030 * fns.c (Frequire): Remove the mention of the .gz files, since
11031 that's installation-specific, but keep the mention of
11032 `get-load-suffixes'.
11033
da64016e
PE
110342011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11035
11036 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11037 Report string overflow if the output is too long.
11038
7d47b580
JB
110392011-07-04 Juanma Barranquero <lekktu@gmail.com>
11040
a555cb87
JB
11041 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11042 (syms_of_gnutls): Remove duplicate DEFSYM for
11043 Qgnutls_bootprop_verify_hostname_error, an error for
11044 Qgnutls_bootprop_verify_error (which is no longer used).
11045
7d47b580
JB
11046 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11047 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11048 Also (re)move comments that are misplaced or no longer relevant.
11049
1e49bfab
LMI
110502011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11051
11052 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11053
1485f4c0
CY
110542011-07-03 Chong Yidong <cyd@stupidchicken.com>
11055
11056 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11057 and background color parameters if they have been changed.
11058
a9ab721e
LMI
110592011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11060
11061 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11062
cf7cff57
PE
110632011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11064
2e13213d
PE
11065 * xsettings.c (SYSTEM_FONT): Define only when used.
11066 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11067
cf7cff57
PE
11068 * keymap.c (access_keymap_1): Now static.
11069
7a8e04f7
CY
110702011-07-02 Chong Yidong <cyd@stupidchicken.com>
11071
11072 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11073 leave any prefix arg for the up event (Bug#1586).
11074
61352f62
LMI
110752011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11076
69bb1ef7
LMI
11077 * lread.c (syms_of_lread): Mention single symbols defined by
11078 `defvar' or `defconst' (bug#7154).
11079
61352f62 11080 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 11081 (Frequire): Mention get-load-suffixes.
61352f62 11082
28545e04
MR
110832011-07-02 Martin Rudalics <rudalics@gmx.at>
11084
11085 * window.h (window): Remove clone_number slot.
11086 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11087 Remove.
11088 (make_parent_window, make_window, saved_window)
11089 (Fset_window_configuration, save_window_save): Don't deal with
11090 clone numbers.
11091 * buffer.c (Qclone_number): Remove declaration.
11092 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11093
3349e122
SM
110942011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11095
11096 Add multiple inheritance to keymaps.
11097 * keymap.c (Fmake_composed_keymap): New function.
11098 (Fset_keymap_parent): Simplify.
11099 (fix_submap_inheritance): Remove.
11100 (access_keymap_1): New function extracted from access_keymap to handle
11101 embedded parents and handle lists of maps.
11102 (access_keymap): Use it.
11103 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11104 (Fcopy_keymap): Handle embedded parents.
11105 (Fcommand_remapping, define_as_prefix): Simplify.
11106 (Fkey_binding): Simplify.
11107 (syms_of_keymap): Move minibuffer-local-completion-map,
11108 minibuffer-local-filename-completion-map,
11109 minibuffer-local-must-match-map, and
11110 minibuffer-local-filename-must-match-map to Elisp.
11111 (syms_of_keymap): Defsubr make-composed-keymap.
11112 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11113 (parse_menu_item): Trivial simplification.
11114
3279eb87
GM
111152011-07-01 Glenn Morris <rgm@gnu.org>
11116
11117 * Makefile.in (SETTINGS_LIBS): Fix typo.
11118
39cb9e56 111192011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
11120
11121 * coding.c (Fencode_coding_string): Record the last coding system
11122 used, as the function doc string says (bug#8738).
11123
0949d2b6
JD
111242011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11125
11126 * xsettings.c (store_monospaced_changed): Take new font as arg and
11127 check for change against current_mono_font.
11128 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11129 (emacs_settings_constructor, emacs_settings_get_property)
11130 (emacs_settings_set_property, emacs_settings_class_init)
11131 (emacs_settings_init, gsettings_obj): Remove.
11132 (something_changedCB): New function for HAVE_GSETTINGS.
11133 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11134 with value as argument.
11135 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11136 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 11137 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
11138 "changed".
11139
11140 * xgselect.c: Add defined (HAVE_GSETTINGS).
11141 (xgselect_initialize): Ditto.
11142
11143 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11144 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11145 xg_select.
11146
bbc6b304
PE
111472011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11148
11149 * eval.c (struct backtrace): Simplify and port the data structure.
11150 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11151 signed bit field, as this assumption is not portable and it makes
11152 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11153 "char debug_on_exit : 1" as this is not portable either; instead,
11154 use the portable "unsigned int debug_on_exit : 1". Remove unused
11155 member evalargs. Remove obsolete comments about cc bombing out.
11156
9851bfc5
JD
111572011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11158
51bb811f 11159 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
11160 Let HAVE_GSETTINGS override HAVE_GCONF.
11161 (store_monospaced_changed): New function.
11162 (EMACS_SETTINGS): A new type derived from GObject to handle
11163 GSettings notifications.
11164 (emacs_settings_constructor, emacs_settings_get_property)
11165 (emacs_settings_set_property, emacs_settings_class_init):
11166 New functions.
11167 (gsettings_client, gsettings_obj): New variables.
11168 (GSETTINGS_SCHEMA): New define.
11169 (something_changedCB): Call store_monospaced_changed.
11170 (init_gsettings): New function.
11171 (xsettings_initialize): Call init_gsettings.
11172 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11173 to NULL.
11174
640c8776 11175 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
11176 GCONF_CFLAGS/LIBS.
11177
5386012d
MR
111782011-06-29 Martin Rudalics <rudalics@gmx.at>
11179
11180 * window.c (resize_root_window, grow_mini_window)
11181 (shrink_mini_window): Rename Qresize_root_window to
11182 Qwindow_resize_root_window and Qresize_root_window_vertically to
11183 Qwindow_resize_root_window_vertically.
11184
f13e0b08
PE
111852011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11186
11187 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11188
94515237
JB
111892011-06-27 Juanma Barranquero <lekktu@gmail.com>
11190
11191 * makefile.w32-in: Redesign dependencies so they reflect more
11192 clearly which files are directly included by each source file,
11193 and not through other includes.
11194
e43b6e43
MR
111952011-06-27 Martin Rudalics <rudalics@gmx.at>
11196
11197 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11198 (sort_overlays, overlay_strings): When an overlay's clone number
11199 matches the window's clone number process the overlay even if
11200 the overlay's window property doesn't match the current window.
11201
d68443dc
MR
11202 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11203 (Fwindow_hchild): Rename to Fwindow_left_child.
11204 (Fwindow_next): Rename to Fwindow_next_sibling.
11205 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
11206 (resize_window_check): Rename to window_resize_check.
11207 (resize_window_apply): Rename to window_resize_apply.
11208 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11209 (Fdelete_other_windows_internal, resize_frame_windows)
11210 (Fsplit_window_internal, Fdelete_window_internal)
11211 (grow_mini_window, shrink_mini_window)
11212 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 11213
c7e73be5
JD
112142011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11215
11216 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11217 (emacs_fixed_set_min_size): Remove.
11218 (emacs_fixed_new): Take frame as argument.
11219
11220 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11221 (_EmacsFixedPrivate): Remove minwidth/height.
11222 Add struct frame *f.
11223 (emacs_fixed_init): Initialize priv->f.
11224 (get_parent_class, emacs_fixed_set_min_size): Remove.
11225 (emacs_fixed_new): Set priv->f to argument.
11226 (emacs_fixed_get_preferred_width)
11227 (emacs_fixed_get_preferred_height): Use min_width/height from
11228 frames size_hint to set minimum and natural (Bug#8919).
11229 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11230 and use min_width/height from frames size_hint to set
11231 min_width/height (Bug#8919).
11232
11233 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
11234 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11235 Fix indentation.
c7e73be5 11236
cf99dcf8
EZ
112372011-06-26 Eli Zaretskii <eliz@gnu.org>
11238
11239 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11240 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11241 called at ZV.
11242
029529ac
CY
112432011-06-26 Chong Yidong <cyd@stupidchicken.com>
11244
11245 * process.c (wait_reading_process_output): Bypass select if
11246 waiting for a cell while ignoring keyboard input, and input is
11247 pending. Suggested by Jan Djärv (Bug#8869).
11248
7a7ef429
PE
112492011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11250
11251 Use gnulib's dup2 module instead of rolling our own.
11252 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11253
11fdef7d 112542011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
11255
11256 * dispnew.c (scrolling_window): Before scrolling, turn off a
11257 mouse-highlight in the window being scrolled.
11258
cd3520a4
JB
112592011-06-24 Juanma Barranquero <lekktu@gmail.com>
11260
11261 Move DEFSYM to lisp.h and use everywhere.
11262
11263 * character.h (DEFSYM): Move declaration...
11264 * lisp.h (DEFSYM): ...here.
11265
11266 * gnutls.c:
11267 * minibuf.c:
11268 * w32menu.c:
11269 * w32proc.c:
11270 * w32select.c: Don't include character.h.
11271
11272 * alloc.c (syms_of_alloc):
11273 * buffer.c (syms_of_buffer):
11274 * bytecode.c (syms_of_bytecode):
11275 * callint.c (syms_of_callint):
11276 * casefiddle.c (syms_of_casefiddle):
11277 * casetab.c (init_casetab_once):
11278 * category.c (init_category_once, syms_of_category):
11279 * ccl.c (syms_of_ccl):
11280 * cmds.c (syms_of_cmds):
11281 * composite.c (syms_of_composite):
11282 * dbusbind.c (syms_of_dbusbind):
11283 * dired.c (syms_of_dired):
11284 * dispnew.c (syms_of_display):
11285 * doc.c (syms_of_doc):
11286 * editfns.c (syms_of_editfns):
11287 * emacs.c (syms_of_emacs):
11288 * eval.c (syms_of_eval):
11289 * fileio.c (syms_of_fileio):
11290 * fns.c (syms_of_fns):
11291 * frame.c (syms_of_frame):
11292 * fringe.c (syms_of_fringe):
11293 * insdel.c (syms_of_insdel):
11294 * keymap.c (syms_of_keymap):
11295 * lread.c (init_obarray, syms_of_lread):
11296 * macros.c (syms_of_macros):
11297 * msdos.c (syms_of_msdos):
11298 * print.c (syms_of_print):
11299 * process.c (syms_of_process):
11300 * search.c (syms_of_search):
11301 * sound.c (syms_of_sound):
11302 * syntax.c (init_syntax_once, syms_of_syntax):
11303 * terminal.c (syms_of_terminal):
11304 * textprop.c (syms_of_textprop):
11305 * undo.c (syms_of_undo):
11306 * w32.c (globals_of_w32):
11307 * window.c (syms_of_window):
11308 * xdisp.c (syms_of_xdisp):
11309 * xfaces.c (syms_of_xfaces):
11310 * xfns.c (syms_of_xfns):
11311 * xmenu.c (syms_of_xmenu):
11312 * xsettings.c (syms_of_xsettings):
11313 * xterm.c (syms_of_xterm): Use DEFSYM.
11314
4228cf16
TZ
113152011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11316
cd3520a4 11317 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 11318
7fcccf1e
PE
113192011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11320
7efb4e0e
PE
11321 Integer and buffer overflow fixes (Bug#8873).
11322
ff5844ad
PE
11323 * print.c (printchar, strout): Check for string overflow.
11324 (PRINTPREPARE, printchar, strout):
11325 Don't set size unless allocation succeeds.
11326
90532f02
PE
11327 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11328 for sizes. Check for string overflow more accurately.
11329 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11330
6d84508d
PE
11331 * macros.c: Integer and buffer overflow fixes.
11332 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11333 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11334 Use ptrdiff_t, not int, for sizes.
11335 Don't increment bufsize until after realloc succeeds.
11336 Check for size-calculation overflow.
11337 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11338
437b2cb4
PE
11339 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11340
8b9ac8b4
PE
11341 * lread.c: Integer overflow fixes.
11342 (read_integer): Radix is now EMACS_INT, not int,
11343 to improve quality of diagnostics for out-of-range radices.
11344 Calculate buffer size correctly for out-of-range radices.
11345 (read1): Check for integer overflow in radices, and in
11346 read-circle numbers.
82cb60d3
PE
11347 (read_escape): Avoid int overflow.
11348 (Fload, openp, read_buffer_size, read1)
11349 (substitute_object_recurse, read_vector, read_list, map_obarray):
11350 Use ptrdiff_t, not int, for sizes.
11351 (read1): Use EMACS_INT, not int, for sizes.
20270765 11352 Check for size overflow.
8b9ac8b4 11353
7fcccf1e
PE
11354 * image.c (cache_image): Check for size arithmetic overflow.
11355
bfbbd7e7
PE
11356 * lread.c: Integer overflow issues.
11357 (saved_doc_string_size, saved_doc_string_length)
11358 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11359 Now ptrdiff_t, not int.
11360 (read1): Don't assume doc string length fits in int. Check for
11361 out-of-range doc string lengths.
11362 (read_list): Don't assume file position fits in int.
39019e54 11363 (read_escape): Check for hex character overflow.
bfbbd7e7 11364
4e323265
LL
113652011-06-22 Leo Liu <sdl.web@gmail.com>
11366
11367 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11368 Move to minibuffer.el.
11369
85fece3e
PE
113702011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11371
20b84ce9 11372 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
11373 The following patches are for when GLYPH_DEBUG && !XASSERT.
11374 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11375 * dispnew.c (flush_stdout):
11376 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11377 Mark as externally visible.
11378 * dispnew.c (check_window_matrix_pointers): Now static.
11379 * dispnew.c (window_to_frame_vpos):
11380 * xfns.c (unwind_create_frame):
11381 * xterm.c (x_check_font): Remove unused local.
11382 * scroll.c (CHECK_BOUNDS):
11383 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11384 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11385 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11386 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11387 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11388 Now static.
11389 (debug_method_add): Use va_list and vsprintf rather than relying
11390 on undefined behavior with wrong number of arguments.
11391 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11392 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11393 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11394 since we're not interested in debugging glyphs with old libraries.
11395 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11396 GCC 4.6.0's static checking.
11397
0766b489
PE
113982011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11399
31fd4b32
PE
11400 Integer overflow and signedness fixes (Bug#8873).
11401 A few related buffer overrun fixes, too.
11402
b79e8648
PE
11403 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11404
0766b489
PE
11405 * dispextern.h (struct face.stipple):
11406 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11407 (x_bitmap_mask, x_allocate_bitmap_record)
11408 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11409 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11410 (x_create_bitmap_from_xpm_data):
11411 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11412 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11413 (.bitmaps_last):
11414 * xfaces.c (load_pixmap):
11415 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11416 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11417 (.bitmaps_last, struct x_output.icon_bitmap):
11418 Use ptrdiff_t, not int, for bitmap indexes.
11419 (x_allocate_bitmap_record): Check for size overflow.
11420 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11421
b081724f
PE
11422 Use ptrdiff_t, not int, for overlay counts.
11423 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11424 * editfns.c (overlays_around, get_pos_property):
11425 * textprop.c (get_char_property_and_overlay):
11426 * xdisp.c (next_overlay_change, note_mouse_highlight):
11427 * xfaces.c (face_at_buffer_position):
21514da7
PE
11428 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11429 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11430 (Fnext_overlay_change, Fprevious_overlay_change)
11431 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 11432 Use ptrdiff_t, not int, for sizes.
21514da7 11433 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 11434
3de73e5e
PE
11435 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11436
2606c57b
PE
11437 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11438 (x_session_initialize): Do not assume string length fits in int.
11439
aaafe47a
PE
11440 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11441 This is unlikely, but can occur if DPI is outlandish.
11442
2674ddc8 11443 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
11444 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11445
28154962
PE
11446 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11447 * xrdb.c (magic_file_p, search_magic_path):
11448 Omit last arg SUFFIX; it was always 0. All callers changed.
11449 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11450
7de51af5
PE
11451 * xfont.c (xfont_match): Avoid need for strlen.
11452
25ed6cc3
PE
11453 * xfns.c: Don't assume strlen fits in int.
11454 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11455
4eab31dd
PE
11456 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11457 not unsigned long, as we prefer signed integers. All callers changed.
11458 Detect integer overflow in repeat count.
11459 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 11460 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 11461
171e2a58
PE
11462 * termcap.c: Don't assume sizes fit in int and never overflow.
11463 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11464 (gobble_line): Check for size-calculation overflow.
11465
ad39faca 11466 * minibuf.c (Fread_buffer):
6e5bb2dc 11467 * lread.c (intern, intern_c_string):
74ca2eb3
PE
11468 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11469 Don't assume string length fits in int.
11470
52c61c22 11471 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
11472 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11473
b5b8c9e5
PE
11474 * font.c: Don't assume string length fits in int.
11475 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11476 Use ptrdiff_t, not int.
ccd6111c
PE
11477 (font_intern_prop): Don't assume string length fits in int.
11478 Don't assume integer property fits in fixnum.
11479 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 11480
882f0d81 11481 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 11482 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
11483 Reformulate so as not to need the command string.
11484 Invoke gzip -cd rather than gunzip, as it's more portable.
11485 (lock_info_type, lock_file_1, lock_file):
11486 Don't assume pid_t and time_t fit in unsigned long.
11487 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11488 (current_lock_owner): Prefer signed type for sizes.
11489 Use memcpy, not strncpy, where memcpy is what is really wanted.
11490 Don't assume (via atoi) that time_t and pid_t fit in int.
11491 Check for time_t and/or pid_t out of range, e.g., via a network share.
11492 Don't alloca where an auto var works fine.
11493
93f4cf88
PE
11494 * fileio.c: Fix some integer overflow issues.
11495 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11496 Don't assume string length fits in int.
11497 (directory_file_name): Don't assume string length fits in long.
11498 (make_temp_name): Don't assume pid fits in int, or that its print
11499 length is less than 20.
11500
f3e92b69
PE
11501 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11502
1bfdaf10
PE
11503 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11504
35016e9a
PE
11505 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11506
3d1e65a1
PE
11507 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11508 We prefer signed integers, even for size calculations.
11509
0b963a93
PE
11510 * emacs.c: Don't assume string length fits in 'int'.
11511 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11512 (main): Don't invoke strlen when not needed.
11513
573f4b54
PE
11514 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11515 (XD_DEBUG_MESSAGE): Don't waste a byte.
11516
989f33ba
PE
11517 * callproc.c (getenv_internal_1, getenv_internal)
11518 (Fgetenv_internal):
965d34eb
PE
11519 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11520
e4d29b33
PE
11521 * lread.c (invalid_syntax): Omit length argument.
11522 All uses changed. This doesn't fix a bug, but it simplifies the
11523 code away from its former Hollerith-constant appearance, and it's
11524 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 11525 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 11526
eb49b136
PE
11527 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11528 This didn't break anything, but it didn't help either.
11529 It's confusing to put a bogus integer in a place where the actual
11530 value does not matter.
9f62aeb1 11531 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 11532 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 11533
15375a22
PE
11534 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11535 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11536 implementation.
b61cc01c
PE
11537 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11538 We prefer signed types, and the value cannot exceed the EMACS_INT
11539 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
11540 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11541 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11542 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 11543
53b2623d
PE
11544 * indent.c (sane_tab_width): New function.
11545 (current_column, scan_for_column, Findent_to, position_indentation)
11546 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 11547 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 11548
51cab52b 11549 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 11550
f2ed8a70
PE
11551 * lisp.h (lint_assume): New macro.
11552 * composite.c (composition_gstring_put_cache):
11553 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11554
abe80cc6
PE
11555 * editfns.c, insdel.c:
11556 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 11557
b02c740e
PE
11558 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11559
ebc96716
PE
11560 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11561
b4e50fa0 11562 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 11563 Use much-faster test for byte-length change.
311d5d7c 11564 Don't assume string byte-length fits in 'int'.
a4cf38e4 11565 Check that character arg fits in 'int'.
85461888 11566 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 11567
c0c1ee9f
PE
11568 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11569
a498d7f4
PE
11570 * fns.c (concat): Catch string overflow earlier.
11571 Do not rely on integer wraparound.
11572
51cab52b
PE
11573 * dispextern.h (struct it.overlay_strings_charpos)
11574 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
11575 * xdisp.c (forward_to_next_line_start)
11576 (back_to_previous_visible_line_start)
11577 (reseat_at_next_visible_line_start, next_element_from_buffer):
11578 Don't arbitrarily truncate the value of 'selective' to int.
11579
76031fad
PE
11580 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11581
5eb55db9
PE
11582 * composite.c: Don't truncate sizes to 'int'.
11583 (composition_gstring_p, composition_reseat_it)
11584 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
11585 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11586 not EMACS_UINT, for indexes.
5eb55db9 11587
0703a717
PE
11588 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11589
d6202519
PE
11590 * buffer.c: Include <verify.h>.
11591 (struct sortvec.priority, struct sortstr.priority):
8961a454 11592 Now EMACS_INT, not int.
c20998a7 11593 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
11594 (struct sortstr.size, record_overlay_string)
11595 (struct sortstrlist.size, struct sortlist.used):
11596 Don't truncate size to int.
11597 (record_overlay_string): Check for size-calculation overflow.
d6202519 11598 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 11599
d5a19415
JM
116002011-06-22 Jim Meyering <meyering@redhat.com>
11601
029529ac 11602 Don't leak an XBM-image-sized buffer
d5a19415
JM
11603 * image.c (xbm_load): Free the image buffer after using it.
11604
a9041e6c
PE
116052011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11606
11607 Port to Sun C.
11608 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11609 that Sun C diagnosed.
11610 * fns.c (secure_hash): Fix pointer signedness issue.
11611 * intervals.c (static_offset_intervals): New function.
11612 (offset_intervals): Use it.
11613
7f3f739f
LL
116142011-06-21 Leo Liu <sdl.web@gmail.com>
11615
11616 * deps.mk (fns.o):
11617 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11618 sha512.h.
11619
11620 * fns.c (secure_hash): Rename from crypto_hash_function and change
11621 the first arg to accept symbols.
5b66d427 11622 (Fsecure_hash): New primitive.
7f3f739f
LL
11623 (syms_of_fns): New symbols.
11624
76147d94
DD
116252011-06-20 Deniz Dogan <deniz@dogan.se>
11626
11627 * process.c (Fset_process_buffer): Clarify return value in
11628 docstring.
11629
7d7d0045
CY
116302011-06-18 Chong Yidong <cyd@stupidchicken.com>
11631
11632 * dispnew.c (add_window_display_history): Use BVAR.
11633
11634 * xdisp.c (debug_method_add): Use BVAR.
11635 (check_window_end, dump_glyph_matrix, dump_glyph)
11636 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11637
11638 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11639 Likewise.
11640
11641 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11642 check till after the cache is created in init_frame_faces.
11643
ff2bc410
SM
116442011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11645
11646 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11647
28177add
PE
116482011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11649
dd3482fe
PE
11650 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11651 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11652 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11653
393d71f3 11654 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
11655 * fileio.c (Finsert_file_contents):
11656 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11657 Remove the old (too-loose) buffer overflow checks.
11658 They weren't needed, since make_gap checks for buffer overflow.
11659 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11660 The old code merely checked for Emacs fixnum overflow, and relied
11661 on undefined (wraparound) behavior. The new code avoids undefined
11662 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11663
2e6813b0 11664 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
11665 Tune. Don't use wider integers than needed. Don't use alloca.
11666 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 11667
599a9e4f
PE
11668 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11669
99561444
PE
11670 * insdel.c, lisp.h (buffer_overflow): New function.
11671 (insert_from_buffer_1, replace_range, replace_range_2):
11672 * insdel.c (make_gap_larger):
11673 * editfns.c (Finsert_char):
11674 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11675
28177add
PE
11676 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11677
e69dafad
PE
116782011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11679
4baa020d 11680 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 11681
b1c46f02
PE
11682 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11683 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11684
e69dafad
PE
11685 * fileio.c: Don't assume EMACS_INT fits in off_t.
11686 (emacs_lseek): New static function.
11687 (Finsert_file_contents, Fwrite_region): Use it.
11688 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11689
566684ea
PE
11690 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11691
e6966cd6
PE
11692 * fns.c: Don't overflow int when computing a list length.
11693 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11694 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11695 truncation on 64-bit hosts. Check for QUIT every
11696 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11697 faster and is responsive enough.
11698 (Flength): Report an error instead of overflowing an integer.
11699 (Fsafe_length): Return a float if the value is not representable
11700 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 11701 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 11702 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 11703
dd0b0efb
PE
11704 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11705 (header_size, word_size): New constants.
11706 (allocate_vectorlike): Don't check size overflow here.
11707 (allocate_vector): Check it here instead, since this is the only
11708 caller of allocate_vectorlike that could cause overflow.
11709 Check that the new vector's length is representable as a fixnum.
11710
86fe5cfe
PE
11711 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11712 The previous code was bogus. For example, next_almost_prime (32)
11713 returned 39, which is undesirable as it is a multiple of 3; and
11714 next_almost_prime (24) returned 25, which is a multiple of 5 so
11715 why was the code bothering to check for multiples of 7?
11716
80e88859
PE
11717 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11718
4a2f0ad6
PE
11719 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11720
f66c7cf8
PE
11721 Variadic C functions now count arguments with ptrdiff_t.
11722 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11723 Back then I didn't know that the Emacs coding style prefers signed int.
11724 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
11725 were being counted with int, which may truncate counts on 64-bit
11726 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
11727 * lisp.h (struct Lisp_Subr.function.aMANY)
11728 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11729 Arg counts are now ptrdiff_t, not size_t.
11730 All variadic functions and their callers changed accordingly.
11731 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11732 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11733 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11734 * callint.c (Fcall_interactively): Check arg count for overflow,
11735 to avoid potential buffer overrun. Use signed char, not 'int',
11736 for 'varies' array, so that we needn't bother to check its size
11737 calculation for overflow.
11738 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11739 * eval.c (apply_lambda):
11740 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11741 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11742 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11743
a1759b76
PE
11744 * callint.c (Fcall_interactively): Don't use index var as event count.
11745
d96be9fc
PE
11746 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11747 * mem-limits.h (SIZE): Remove; no longer used.
11748
a690a978 11749 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 11750
578c21e6
PE
11751 Remove unnecessary casts.
11752 * xterm.c (x_term_init):
11753 * xfns.c (x_set_border_pixel):
11754 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11755 These aren't needed now that we assume ANSI C.
11756
96f53c6c
PE
11757 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11758 It's more likely to cause problems (due to unsigned overflow)
11759 than to cure them.
11760
83c77d31
PE
11761 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11762
ee2079f1
PE
11763 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11764
6da65536
PE
11765 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11766
7147c4a4
PE
11767 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11768
193e32d9
PE
11769 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11770
e5533da6
PE
11771 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11772
9910e595
PE
11773 GLYPH_CODE_FACE returns EMACS_INT, not int.
11774 * dispextern.h (merge_faces):
11775 * xfaces.c (merge_faces):
01103c44
PE
11776 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11777 Don't assume EMACS_INT fits in int.
9910e595 11778
2638320e
PE
11779 * character.h (CHAR_VALID_P): Remove unused parameter.
11780 * fontset.c, lisp.h, xdisp.c: All uses changed.
11781
045eb8d9
PE
11782 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11783
c1f134b5
PE
11784 * fns.c (concat): Minor tuning based on overflow analysis.
11785 This doesn't fix any bugs. Use int to hold character, instead
11786 of constantly refetching from Emacs object. Use XFASTINT, not
11787 XINT, for value known to be a character. Don't bother comparing
11788 a single byte to 0400, as it's always less.
11789
395fcb93 11790 * floatfns.c (Fexpt):
327eeec8
PE
11791 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11792
abbd3d23
PE
11793 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11794 for characters.
11795
684a03ef
PE
11796 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11797
0fed43f3
PE
11798 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11799 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11800 incorrectly succeed when S was a string, because 4294967386 was
11801 truncated before it was used.
11802
8fd02eb7
PE
11803 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11804 Otherwise, an out-of-range integer could cause undefined behavior
11805 on a 64-bit host.
11806
f8c86b69
PE
11807 * composite.c: Use int, not EMACS_INT, for characters.
11808 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11809 EMACS_INT, for values that are known to be in character range.
11810 This doesn't fix any bugs but is the usual style inside Emacs and
11811 may generate better code on 32-bit machines.
11812
34206dd2
PE
11813 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11814 This is for reasons similar to the recent CHAR_STRING fix.
11815 * charset.c (Fencode_char): Check that character arg is actually
11816 a character. Pass an int to ENCODE_CHAR.
11817 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11818 wider than 'int', as a compile-time check to prevent future regressions
11819 in this area.
11820
c5958d4c 11821 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
11822
11823 Make sure a 64-bit char is never passed to CHAR_STRING.
11824 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11825 by silently ignoring the top 32 bits, allowing some values
11826 that were far too large to be valid characters.
11827 * character.h: Include <verify.h>.
11828 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11829 arguments are no wider than unsigned, as a compile-time check
11830 to prevent future regressions in this area.
11831 * data.c (Faset):
01103c44 11832 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
11833 (Fsubst_char_in_region):
11834 * fns.c (concat):
11835 * xdisp.c (decode_mode_spec_coding):
11836 Adjust to CHAR_STRING's new requirement.
11837 * editfns.c (Finsert_char, Fsubst_char_in_region):
11838 * fns.c (concat): Check that character args are actually
11839 characters. Without this test, these functions did the wrong
11840 thing with wildly out-of-range values on 64-bit hosts.
11841
d37ca623
PE
11842 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11843 These casts should not be needed on 32-bit hosts, either.
11844 * keyboard.c (read_char):
11845 * lread.c (Fload): Remove casts to unsigned.
11846
ea204efb
PE
11847 * lisp.h (UNSIGNED_CMP): New macro.
11848 This fixes comparison bugs on 64-bit hosts.
11849 (ASCII_CHAR_P): Use it.
11850 * casefiddle.c (casify_object):
01103c44 11851 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
11852 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11853 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11854 * dispextern.h (FACE_FROM_ID):
11855 * keyboard.c (read_char): Use UNSIGNED_CMP.
11856
41cb286c
PE
11857 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11858 not to EMACS_INT, to avoid GCC warning.
11859
4a1b9832
PE
11860 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11861
55daad71
PE
11862 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11863 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11864 isn't needed on 32-bit machines.
8f95c75c 11865
01103c44
PE
11866 * buffer.c (Fgenerate_new_buffer_name):
11867 Use EMACS_INT for count, not int.
0ceccced 11868 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
11869
11870 * data.c (Qcompiled_function): Now static.
11871
c6f072e7
PE
11872 * window.c (window_body_lines): Now static.
11873
20ce5912
PE
11874 * image.c (gif_load): Rename local to avoid shadowing.
11875
9c4c5f81
PE
11876 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11877 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11878 * alloc.c (make_save_value): Integer argument is now of type
11879 ptrdiff_t, not int.
11880 (mark_object): Use ptrdiff_t, not int.
11881 * lisp.h (pD): New macro.
11882 * print.c (print_object): Use it.
11883
c0c5c8ae
PE
11884 * alloc.c: Use EMACS_INT, not int, to count objects.
11885 (total_conses, total_markers, total_symbols, total_vector_size)
11886 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
11887 (total_free_floats, total_floats, total_free_intervals)
11888 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
11889 Now EMACS_INT, not int. All uses changed.
11890 (Fgarbage_collect): Compute overall total using a double, so that
11891 integer overflow is less likely to be a problem. Check for overflow
11892 when converting back to an integer.
5a25e253
PE
11893 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11894 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11895 These were 'int' variables that could overflow on 64-bit hosts;
11896 they were never used, so remove them instead of repairing them.
211a0b2a 11897 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
11898 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11899 Previously, this ceilinged at INT_MAX, but that doesn't work on
11900 64-bit machines.
e46bb31a 11901 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 11902
c78baabf 11903 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 11904 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
11905 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11906 when a (possibly-narrower) signed value would do just as well.
11907 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 11908
c9d624c6
PE
11909 * alloc.c: Catch some string size overflows that we were missing.
11910 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11911 for convenience in STRING_BYTES_MAX.
11912 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11913 The definition here is exact; the one in lisp.h was approximate.
11914 (allocate_string_data): Check for string overflow. This catches
11915 some instances we weren't catching before. Also, it catches
11916 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11917 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11918 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 11919
c9d624c6
PE
11920 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11921 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 11922 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 11923
353032ce
PE
11924 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
11925
2bccce07
PE
11926 * alloc.c (Fmake_string): Check for out-of-range init.
11927
0ac30604
SM
119282011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
11929
11930 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
11931
c195f2de
JD
119322011-06-14 Jan Djärv <jan.h.d@swipnet.se>
11933
11934 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
11935 xg_get_default_scrollbar_width.
11936
11937 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
11938 (int_gtk_range_get_value): Move to the scroll bar part of the file.
11939 (style_changed_cb): Call update_theme_scrollbar_width and call
11940 x_set_scroll_bar_default_width and xg_frame_set_char_size for
11941 all frames (Bug#8505).
11942 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
11943 Call gtk_window_set_resizable if HAVE_GTK3.
11944 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
11945 and height if HAVE_GTK3 (Bug#8505).
11946 (scroll_bar_width_for_theme): New variable.
11947 (update_theme_scrollbar_width): New function.
11948 (xg_get_default_scrollbar_width): Move code to
11949 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
11950 (xg_initialize): Call update_theme_scrollbar_width.
11951
11952 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
11953
11954 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
11955
e10ac9f1
MR
119562011-06-12 Martin Rudalics <rudalics@gmx.at>
11957
11958 * frame.c (make_frame): Call other_buffer_safely instead of
11959 other_buffer.
11960
11961 * window.c (temp_output_buffer_show): Call display_buffer with
11962 second argument Vtemp_buffer_show_specifiers and reset latter
11963 immediately after the call.
11964 (Vtemp_buffer_show_specifiers): New variable.
11965 (auto_window_vscroll_p, next_screen_context_lines)
11966 (Vscroll_preserve_screen_position): Remove leading asterisks from
11967 doc-strings.
11968
2d3c217e 119692011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 11970
7b7f97e8 11971 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
11972 * buffer.c (Qclone_number): Remove for now, as it's unused.
11973 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
11974 (record_buffer): Remove unused local.
11975 * frame.c (other_visible_frames, frame_buffer_list): Now static.
11976 (set_frame_buffer_list): Remove; unused.
11977 * frame.h (other_visible_frames): Remove decl.
11978 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
11979 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
11980 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
11981 if HAVE_GPM.
11982 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
11983 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
11984 Define only if HAVE_GPM.
11985 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
11986 (update_hints_inhibit): Remove; never set. All uses removed.
11987 * widgetprv.h (emacsFrameClassRec): Remove decl.
11988 * window.c (delete_deletable_window): Now returns void, since it
11989 wasn't returning anything.
11990 (compare_window_configurations): Remove unused locals.
11991 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
11992 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
11993 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
11994 the same widths as pointers. This follows up on the 2011-05-06 patch.
11995 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
11996 * xterm.h: Likewise.
11997 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
11998
1384b89e
JB
119992011-06-12 Juanma Barranquero <lekktu@gmail.com>
12000
12001 * makefile.w32-in: Update dependencies.
12002 (LISP_H): Add lib/intprops.h.
12003
1100a63c
CY
120042011-06-11 Chong Yidong <cyd@stupidchicken.com>
12005
12006 * image.c (gif_load): Add animation frame delay to the metadata.
12007 (syms_of_image): Use DEFSYM. New symbol `delay'.
12008
6198ccd0
MR
120092011-06-11 Martin Rudalics <rudalics@gmx.at>
12010
12011 * window.c (delete_deletable_window): Re-add.
12012 (Fset_window_configuration): Rewrite to handle dead buffers and
12013 consequently deletable windows.
12014 (window_tree, Fwindow_tree): Remove. Supply functionality in
12015 window.el.
12016 (compare_window_configurations): Simplify code.
12017
b6e3633c
AS
120182011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12019
1ab0dee5
AS
12020 * image.c (imagemagick_load_image): Fix type mismatch.
12021 (Fimagemagick_types): Likewise.
12022
b6e3633c
AS
12023 * window.h (replace_buffer_in_windows): Declare.
12024
9397e56f
MR
120252011-06-11 Martin Rudalics <rudalics@gmx.at>
12026
12027 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12028 Qclone_number. Remove external declaration of Qdelete_window.
12029 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12030 code.
640c8776
SM
12031 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12032 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
12033 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12034 buffer list implementation.
12035 (other_buffer_safely): New function.
12036 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12037 calls to replace_buffer_in_windows and
12038 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12039 if allowed.
12040 (record_buffer): Inhibit quitting and rewrite using quittable
12041 functions. Run Qbuffer_list_update_hook if allowed.
12042 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
12043 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12044 Move switch-to-buffer to window.el.
9397e56f
MR
12045 (bury-buffer): Move to window.el.
12046 (Vbuffer_list_update_hook): New variable.
12047
12048 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12049 section.
12050
12051 * window.h (resize_frame_windows): Move up in code.
12052 (Fwindow_frame): Remove EXFUN.
12053 (replace_buffer_in_all_windows): Remove prototype.
12054 (replace_buffer_in_windows_safely): Add prototype.
12055
12056 * window.c: Declare Qdelete_window static again. Move down
12057 declaration of select_count.
12058 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12059 (Fother_window): Move to window.el.
12060 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12061 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12062 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12063 window.el.
12064 (replace_buffer_in_windows): Implement by calling
12065 Qreplace_buffer_in_windows.
12066 (replace_buffer_in_all_windows): Remove with some functionality
12067 moved into replace_buffer_in_windows_safely.
12068 (replace_buffer_in_windows_safely): New function.
12069 (select_window_norecord, select_frame_norecord): Move in front
12070 of run_window_configuration_change_hook. Remove now obsolete
12071 declarations.
640c8776
SM
12072 (Fset_window_buffer): Rewrite doc-string.
12073 Call Qrecord_window_buffer.
9397e56f
MR
12074 (keys_of_window): Move binding for other-window to window.el.
12075
b50691aa
CY
120762011-06-11 Chong Yidong <cyd@stupidchicken.com>
12077
12078 * dispextern.h (struct image): Replace data member, whose int_val
12079 and ptr_val fields were not used by anything, with a single
12080 lisp_val object.
12081
12082 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12083 (gif_clear_image, gif_load, imagemagick_load_image)
12084 (gs_clear_image, gs_load): Callers changed.
12085
3f754b86
PE
120862011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12087
cca69397
PE
12088 * buffer.h: Include <time.h>, for time_t.
12089 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12090
109e28d0
PE
12091 Fix minor problems found by static checking.
12092
60737f02
PE
12093 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12094
4b66faf3
PE
12095 Make identifiers static if they are not used in other modules.
12096 * data.c (Qcompiled_function, Qframe, Qvector):
12097 * image.c (QimageMagick, Qsvg):
12098 * minibuf.c (Qmetadata):
12099 * window.c (resize_window_check, resize_root_window): Now static.
12100 * window.h (resize_window_check, resize_root_window): Remove decls.
12101
109e28d0
PE
12102 * window.c (window_deletion_count, delete_deletable_window):
12103 Remove; unused.
46a4ce9e
PE
12104 (window_body_lines): Now static.
12105 (Fdelete_other_windows_internal): Mark vars as initialized.
12106 Make sure 'resize_failed' is initialized.
12107 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12108 (resize_window_apply): Remove unused local.
12109 * window.h (delete_deletable_window): Remove decl.
12110
109e28d0 12111 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
12112 (imagemagick_load_image): Fix pointer signedness problem by changing
12113 last arg from unsigned char * to char *. All uses changed.
12114 Also, fix a local for similar reasons.
12115 Remove unused locals. Remove locals to avoid shadowing.
12116 (fn_rsvg_handle_free): Remove; unused.
12117 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 12118 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 12119
3f754b86
PE
12120 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12121
2547adb1
CY
121222011-06-10 Chong Yidong <cyd@stupidchicken.com>
12123
12124 * image.c (gif_load): Fix omitted cast error introduced by
12125 2011-06-06 change.
12126
2c8e37d4
MR
121272011-06-10 Martin Rudalics <rudalics@gmx.at>
12128
12129 * window.h (resize_proportionally, orig_total_lines)
12130 (orig_top_line): Remove from window structure.
12131 (set_window_height, set_window_width, change_window_heights)
12132 (Fdelete_window): Remove prototypes.
12133 (resize_frame_windows): Remove duplicate declaration.
12134
440a42e3
EZ
121352011-06-10 Eli Zaretskii <eliz@gnu.org>
12136
12137 * window.h (resize_frame_windows, resize_window_check)
12138 (delete_deletable_window, resize_root_window)
12139 (resize_frame_windows): Declare prototypes.
12140
12141 * window.c (resize_window_apply): Make definition be "static" to
12142 match the prototype.
12143
562dd5e9
MR
121442011-06-10 Martin Rudalics <rudalics@gmx.at>
12145
12146 * window.c: Remove declarations of Qwindow_size_fixed,
12147 window_min_size_1, window_min_size_2, window_min_size,
12148 size_window, window_fixed_size_p, enlarge_window, delete_window.
12149 Remove static from declaration of Qdelete_window, it's
12150 temporarily needed by Fbury_buffer.
12151 (replace_window): Don't assign orig_top_line and
12152 orig_total_lines.
12153 (Fdelete_window, delete_window): Remove. Window deletion is
12154 handled by window.el.
640c8776
SM
12155 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12156 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
12157 (Fdelete_other_windows): Remove. Deleting other windows is
12158 handled by window.el.
12159 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12160 handled in window.el.
12161 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12162 Window minimum sizes are handled in window.el.
12163 (shrink_windows, size_window, set_window_height)
12164 (set_window_width, change_window_heights, window_height)
12165 (window_width, CURBEG, CURSIZE, enlarge_window)
12166 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12167 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12168 handled in window.el.
12169 (make_dummy_parent): Rename to make_parent_window and give it a
12170 second argument horflag.
12171 (make_window): Don't set resize_proportionally any more.
12172 (Fsplit_window): Remove. Windows are split in window.el.
12173 (save_restore_action, save_restore_orig_size)
12174 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12175 Resize mini windows in window.el.
12176 (grow_mini_window, shrink_mini_window): Implement by calling
12177 Qresize_root_window_vertically, resize_window_check and
12178 resize_window_apply.
640c8776
SM
12179 (saved_window, Fset_window_configuration, save_window_save):
12180 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
12181 resize_proportionally.
12182 (window_min_height, window_min_width): Move to window.el.
12183 (keys_of_window): Move bindings for delete-other-windows,
12184 split-window, delete-window and enlarge-window to window.el.
12185
12186 * buffer.c: Temporarily extern Qdelete_window.
12187 (Fbury_buffer): Temporarily call Qdelete_window instead of
12188 Fdelete_window (Fbury_buffer will move to window.el soon).
12189
12190 * frame.c (set_menu_bar_lines_1): Remove code handling
12191 orig_top_line and orig_total_lines.
12192
12193 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12194 set_window_height but set heights directly.
12195 (change_frame_size_1): Use resize_frame_windows.
12196
12197 * xdisp.c (init_xdisp): Don't use set_window_height but set
12198 heights directly.
12199
640c8776
SM
12200 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12201 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
12202 run_window_configuration_change_hook.
12203
12204 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12205 instead of change_window_heights and run
12206 run_window_configuration_change_hook.
12207
1a13852e
MR
122082011-06-09 Martin Rudalics <rudalics@gmx.at>
12209
12210 * window.c (replace_window): Rename second argument REPLACEMENT to
12211 NEW. New third argument SETFLAG. Rewrite.
12212 (delete_window, make_dummy_parent): Call replace_window with
12213 third argument 1.
12214 (window_list_1): Move down in code.
12215 (run_window_configuration_change_hook): Move set_buffer part
12216 before select_frame_norecord part in order to unwind correctly.
12217 Rename count1 to count.
12218 (recombine_windows, delete_deletable_window, resize_root_window)
12219 (Fdelete_other_windows_internal)
12220 (Frun_window_configuration_change_hook, make_parent_window)
12221 (resize_window_check, resize_window_apply, Fresize_window_apply)
12222 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
12223 (Fdelete_window_internal, Fresize_mini_window_internal):
12224 New functions.
1a13852e
MR
12225 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12226
f3d1777e
MR
122272011-06-08 Martin Rudalics <rudalics@gmx.at>
12228
496e208e
MR
12229 * window.h (window): Add some new members to window structure -
12230 normal_lines, normal_cols, new_total, new_normal, clone_number,
12231 splits, nest, prev_buffers, next_buffers.
12232 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 12233 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 12234
f3d1777e
MR
12235 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12236 Remove.
496e208e
MR
12237 (make_dummy_parent): Set new members of windows structure.
12238 (make_window): Move down in code. Handle new members of window
12239 structure.
12240 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12241 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12242 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12243 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
12244 (Fset_window_next_buffers, Fset_window_clone_number):
12245 New functions.
496e208e
MR
12246 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12247 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12248 Doc-string fixes.
12249 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12250 Argument WINDOW can be now internal window too.
12251 (Fwindow_use_time): Move up in code.
12252 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12253 Rewrite doc-string.
12254 (Fset_window_configuration, saved_window)
12255 (Fcurrent_window_configuration, save_window_save): Handle new
12256 members of window structure.
b9e809c2
MR
12257 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12258 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12259 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12260 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12261 Qget_mru_window, Qresize_root_window,
12262 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12263 Qauto_buffer_name; staticpro them.
f3d1777e 12264
abde8f8c
MR
122652011-06-07 Martin Rudalics <rudalics@gmx.at>
12266
12267 * window.c (Fwindow_total_size, Fwindow_left_column)
12268 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12269 (Fwindow_list_1): New functions.
12270 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
12271 (Fwindow_width, Fscroll_left, Fscroll_right):
12272 Use window_body_cols instead of window_box_text_cols.
12273 (delete_window, Fset_window_configuration):
12274 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
12275 (delete_all_subwindows): Take a window as argument and not a
12276 structure. Rewrite.
190b47e6
MR
12277 (window_loop): Remove handling of GET_LRU_WINDOW and
12278 GET_LARGEST_WINDOW.
12279 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
12280
12281 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
12282 window_box_text_cols. delete_all_subwindows now takes a
12283 Lisp_Object as argument.
abde8f8c 12284
640c8776
SM
12285 * indent.c (compute_motion, Fcompute_motion):
12286 Use window_body_cols instead of window_box_text_cols.
abde8f8c 12287
fa8a67e6
MR
12288 * frame.c (delete_frame): Call delete_all_subwindows with root
12289 window as argument.
12290
a54e3482
DC
122912011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12292
12293 * fns.c (Fputhash): Document return value.
12294
60002bf5
CY
122952011-06-06 Chong Yidong <cyd@stupidchicken.com>
12296
12297 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12298
0c671da6 122992011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 12300
b862a52a 12301 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 12302
be44ca6c
PE
12303 Check for overflow when converting integer to cons and back.
12304 * charset.c (Fdefine_charset_internal, Fdecode_char):
12305 Use cons_to_unsigned to catch overflow.
12306 (Fencode_char): Use INTEGER_TO_CONS.
12307 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12308 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12309 * data.c (long_to_cons, cons_to_long): Remove.
12310 (cons_to_unsigned, cons_to_signed): New functions.
12311 These signal an error for invalid or out-of-range values.
12312 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12313 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12314 * font.c (Ffont_variation_glyphs):
12315 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12316 * lisp.h: Include <intprops.h>.
12317 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12318 (cons_to_signed, cons_to_unsigned): New decls.
12319 (long_to_cons, cons_to_long): Remove decls.
12320 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12321 (Fprimitive_undo): Use CONS_TO_INTEGER.
12322 * xfns.c (Fx_window_property): Likewise.
12323 * xselect.c: Include <limits.h>.
12324 (x_own_selection, selection_data_to_lisp_data):
12325 Use INTEGER_TO_CONS.
12326 (x_handle_selection_request, x_handle_selection_clear)
12327 (x_get_foreign_selection, Fx_disown_selection_internal)
12328 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12329 (lisp_data_to_selection_data): Use cons_to_unsigned.
12330 (x_fill_property_data): Use cons_to_signed.
12331 Report values out of range.
12332
d1f3d2af
PE
12333 Check for buffer and string overflow more precisely.
12334 * buffer.h (BUF_BYTES_MAX): New macro.
12335 * lisp.h (STRING_BYTES_MAX): New macro.
12336 * alloc.c (Fmake_string):
12337 * character.c (string_escape_byte8):
12338 * coding.c (coding_alloc_by_realloc):
12339 * doprnt.c (doprnt):
12340 * editfns.c (Fformat):
12341 * eval.c (verror):
12342 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12343 since they may not be the same number.
12344 * editfns.c (Finsert_char):
12345 * fileio.c (Finsert_file_contents):
12346 Likewise for BUF_BYTES_MAX.
12347
dd52fcea
PE
12348 * image.c: Use ptrdiff_t, not int, for sizes.
12349 (slurp_file): Switch from int to ptrdiff_t.
12350 All uses changed.
12351 (slurp_file): Check that file size fits in both size_t (for
12352 malloc) and ptrdiff_t (for sanity and safety).
12353
7f9bbdbb
PE
12354 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12355 if b->modtime has its maximal value.
12356
dfe18f82
PE
12357 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12358
84acfcf0
PE
12359 Don't assume time_t can fit into int.
12360 * buffer.h (struct buffer.modtime): Now time_t, not int.
12361 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12362 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12363
ccd9a01a
PE
12364 Minor fixes for signed vs unsigned integers.
12365 * character.h (MAYBE_UNIFY_CHAR):
12366 * charset.c (maybe_unify_char):
12367 * keyboard.c (read_char, reorder_modifiers):
12368 XINT -> XFASTINT, since the integer must be nonnegative.
12369 * ftfont.c (ftfont_spec_pattern):
12370 * keymap.c (access_keymap, silly_event_symbol_error):
12371 XUINT -> XFASTINT, since the integer must be nonnegative.
12372 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12373 since it makes no difference and we prefer signed.
12374 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12375 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12376 nonnegative.
12377
d6d100dd
SM
123782011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12379
12380 * window.h (Fwindow_frame): Declare.
12381
2b6148e4
PE
123822011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12383
12384 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12385 (SPARE_MEMORY): Always define.
12386 (LARGE_REQUEST): Remove.
12387 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12388
f230ecc9
MR
123892011-06-06 Martin Rudalics <rudalics@gmx.at>
12390
727e958e
MR
12391 * lisp.h: Move EXFUNS for Fframe_root_window,
12392 Fframe_first_window and Fset_frame_selected_window to window.h.
12393
12394 * window.h: Move EXFUNS for Fframe_root_window,
12395 Fframe_first_window and Fset_frame_selected_window here from
12396 lisp.h.
12397
12398 * frame.c (Fwindow_frame, Fframe_first_window)
12399 (Fframe_root_window, Fframe_selected_window)
12400 (Fset_frame_selected_window): Move to window.c.
12401 (Factive_minibuffer_window): Move to minibuf.c.
12402 (Fother_visible_frames_p): New function.
12403
12404 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12405
f230ecc9
MR
12406 * window.c (decode_window, decode_any_window): Move up in code.
12407 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12408 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
12409 (Fwindow_buffer): Move up and rewrite doc-string.
12410 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12411 (Fwindow_prev): New functions.
727e958e
MR
12412 (Fwindow_frame): Move here from frame.c. Accept any window as
12413 argument.
12414 (Fframe_root_window, Fframe_first_window)
12415 (Fframe_selected_window): Move here from frame.c. Accept frame
12416 or arbitrary window as argument. Update doc-strings.
12417 (Fminibuffer_window): Move up in code.
12418 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
12419 (Fset_frame_selected_window): Move here from frame.c.
12420 Marginal rewrite.
727e958e
MR
12421 (Fselected_window, select_window, Fselect_window): Move up in
12422 code. Minor doc-string fixes.
f230ecc9 12423
4d09bcf6
PE
124242011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12425
12426 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12427 Do not assume that spare memory exists; that assumption is valid
12428 only if SYSTEM_MALLOC.
12429 (LARGE_REQUEST): New macro, so that the issue of large requests
12430 is separated from the issue of spare memory.
12431
810928a2
AS
124322011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12433
172418ad
AS
12434 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12435 format. (Bug#8806)
12436
43f862f7
AS
12437 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12438
810928a2
AS
12439 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12440 before statements.
12441
a059fe24
JD
124422011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12443
12444 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12445
12446 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12447
12448 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12449 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12450
989bf368
JB
124512011-06-05 Juanma Barranquero <lekktu@gmail.com>
12452
12453 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12454
4b80f674
CY
124552011-06-04 Chong Yidong <cyd@stupidchicken.com>
12456
12457 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12458 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
12459 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12460 New error handlers.
4b80f674
CY
12461 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12462 Obey Vx_select_enable_clipboard_manager. Catch errors in
12463 x_clipboard_manager_save (Bug#8779).
12464 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 12465 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 12466
99a33b77 124672011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
12468
12469 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12470
99a33b77 124712011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
12472
12473 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12474 in the current matrix if keep_current_p is non-zero.
12475
8264569d
EZ
124762011-06-04 Eli Zaretskii <eliz@gnu.org>
12477
12478 * bidi.c (bidi_level_of_next_char): Fix last change.
12479
57f97249
EZ
124802011-06-03 Eli Zaretskii <eliz@gnu.org>
12481
fec2107c 12482 Support bidi reordering of text covered by display properties.
57f97249 12483
fec2107c
EZ
12484 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12485 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12486 (bidi_cache_search, bidi_cache_iterator_state)
12487 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
12488 (bidi_level_of_next_char, bidi_move_to_visually_next):
12489 Support character positions inside a run of characters covered by a
fec2107c
EZ
12490 display string.
12491 (bidi_paragraph_init, bidi_resolve_explicit_1)
12492 (bidi_level_of_next_char): Call bidi_fetch_char and
12493 bidi_fetch_char_advance instead of FETCH_CHAR and
12494 FETCH_CHAR_ADVANCE.
12495 (bidi_init_it): Initialize new members.
12496 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12497 definitions.
12498 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12499 instead of using explicit *_CHAR codes.
d6d100dd
SM
12500 (bidi_resolve_explicit, bidi_resolve_weak):
12501 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
12502 bidirectional text is supported only in multibyte buffers.
12503 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12504 it to initialize the frame_window_p member of struct bidi_it.
12505 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12506 (bidi_resolve_explicit, bidi_resolve_weak)
12507 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12508 bidi_it->nchars is non-positive.
12509 (bidi_level_of_next_char): Don't try to lookup the cache for the
12510 next/previous character if nothing is cached there yet, or if we
12511 were just reseat()'ed to a new position.
c40e2fb2 12512
0e14fe90
EZ
12513 * xdisp.c (set_cursor_from_row): Set start and stop points
12514 according to the row's direction when priming the loop that looks
12515 for the glyph on which to display cursor.
12516 (single_display_spec_intangible_p): Function deleted.
12517 (display_prop_intangible_p): Reimplement to call
12518 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
12519 Accept 3 additional arguments needed by handle_display_spec.
12520 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
12521 values: lists, `(when COND...)' forms, etc.
12522 (single_display_spec_string_p): Support property values that are
12523 lists with the argument STRING its top-level element.
12524 (display_prop_string_p): Fix the condition for processing a
12525 property that is a list to be consistent with handle_display_spec.
fec2107c 12526 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
12527 last portion of handle_display_prop.
12528 (compute_display_string_pos): Accept additional argument
12529 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12530 value of a `display' property is a "replacing spec".
12531 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12532 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12533 the display property, but just return a value indicating whether
12534 the display property will replace the characters it covers.
12535 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12536 frame_window_p members of struct bidi_it.
d6d100dd
SM
12537 (compute_display_string_pos, compute_display_string_end):
12538 New functions.
fec2107c
EZ
12539 (push_it): Accept second argument POSITION, where pop_it should
12540 jump to continue iteration.
12541 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 12542
fec2107c
EZ
12543 * keyboard.c (adjust_point_for_property): Adjust the call to
12544 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
12545
12546 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
12547 (bidi_init_it): Update prototypes.
12548 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
12549 (compute_display_string_pos, compute_display_string_end):
12550 Declare prototypes.
fec2107c
EZ
12551 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12552 EMACS_INT.
fc6f18ce 12553
40087514 125542011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 12555
57f53182
PE
12556 Malloc failure behavior now depends on size of allocation.
12557 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12558 * lisp.h: Change signatures accordingly.
12559 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12560 All callers changed. (Bug#8762)
12561
12562 * gnutls.c: Use Emacs's memory allocators.
12563 Without this change, the gnutls library would invoke malloc etc.
12564 directly, which causes problems on non-SYNC_INPUT hosts, and which
12565 runs afoul of improving memory_full behavior. (Bug#8761)
12566 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12567 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12568 xfree instead of the default malloc, realloc, free.
12569 (Fgnutls_boot): No need to check for memory allocation failure,
12570 since xmalloc does that for us.
12571
ac32cd99 12572 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
12573 * category.c (hash_get_category_set):
12574 * ccl.c (ccl_driver):
12575 * charset.c (Fdefine_charset_internal):
12576 * charset.h (struct charset.hash_index):
12577 * composite.c (get_composition_id, gstring_lookup_cache)
12578 (composition_gstring_put_cache):
12579 * composite.h (struct composition.hash_index):
12580 * dispextern.h (struct image.hash):
12581 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12582 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12583 (hashfn_equal, hashfn_user_defined, make_hash_table)
12584 (maybe_resize_hash_table, hash_lookup, hash_put)
12585 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12586 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12587 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12588 * image.c (make_image, search_image_cache, lookup_image)
12589 (xpm_put_color_table_h):
12590 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 12591 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 12592 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 12593 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
12594 * alloc.c (allocate_vectorlike):
12595 Check for overflow in vector size calculations.
12596 * ccl.c (ccl_driver):
12597 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
12598 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12599 need to be updated by these changes.
40087514
PE
12600 * fns.c (make_hash_table, maybe_resize_hash_table):
12601 Check for integer overflow with large hash tables.
0de4bb68
PE
12602 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12603 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12604 (SXHASH_REDUCE): New macro.
12605 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12606 Use it instead of discarding useful hash info with large hash values.
12607 (sxhash_float): New function.
12608 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12609 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
12610 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12611 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
12612 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12613 Adjust signatures to match updated version of code.
12614 (consing_since_gc): Now EMACS_INT, since a single hash table can
12615 use more than INT_MAX bytes.
12616
698d32e2
DN
126172011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12618
12619 Make it possible to build with GCC-4.6+ -O2 -flto.
12620
12621 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12622
fd6fa53f
SM
126232011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12624
12625 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12626 Call minibuffer-inactive-mode.
12627
864db017
JB
126282011-05-31 Juanma Barranquero <lekktu@gmail.com>
12629
12630 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12631 Update dependencies.
12632
2ad0baf4
DN
126332011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12634
12635 * data.c (init_data): Remove code for UTS, this system is not
12636 supported anymore.
12637
4fcc2638
DN
126382011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12639
12640 Don't force ./temacs to start in terminal mode.
12641
12642 * frame.c (make_initial_frame): Initialize faces in all cases, not
12643 only when CANNOT_DUMP is defined.
12644 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12645
c56e0fd5
DN
126462011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12647
12648 * dispnew.c (add_window_display_history): Use const for the string
12649 pointer. Remove declaration, not needed.
12650
333d54da 126512011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 12652
55d4c1b2 12653 Use 'inline', not 'INLINE'.
333d54da 12654 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
12655 * alloc.c, fontset.c (INLINE): Remove.
12656 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12657 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12658 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12659 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12660 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12661
738db178
DN
126622011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12663
12664 Make it possible to run ./temacs.
12665
12666 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12667 syms_of_callproc does the same thing. Remove test for
12668 "initialized", do it in the caller.
12669 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12670
620c53a6
SM
126712011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12672
12673 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12674 (read_minibuf): Use get_minibuffer.
12675 (syms_of_minibuf): Use DEFSYM.
12676 (Qmetadata): New var.
12677 * data.c (Qbuffer): Don't make it static.
12678 (syms_of_data): Use DEFSYM.
12679
e003a292
PE
126802011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12681
12682 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12683 (CCL_CODE_MIN): New macro.
12684
ed008a6d
PE
126852011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12686
3687c2ef
PE
12687 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12688
ed008a6d
PE
12689 * eval.c (Qdebug): Now static.
12690 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12691 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12692 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12693
d66c4c7c
CY
126942011-05-29 Chong Yidong <cyd@stupidchicken.com>
12695
12696 * image.c: Various fixes to ImageMagick code comments.
12697 (Fimagemagick_types): Doc fix.
12698
5fbc2025
PE
126992011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12700
0196f88a
PE
12701 Minor fixes prompted by GCC 4.6.0 warnings.
12702
12703 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12704
5fbc2025
PE
12705 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12706 (x_clipboard_manager_save_all): Move extern decl to ...
12707 * xterm.h: ... here, so that it can be checked for consistency.
12708
1dd3c2d9
CY
127092011-05-29 Chong Yidong <cyd@stupidchicken.com>
12710
12711 * xselect.c (x_clipboard_manager_save_frame)
12712 (x_clipboard_manager_save_all): New functions.
12713 (Fx_clipboard_manager_save): Lisp function deleted.
12714
12715 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12716 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12717
12718 * xterm.h: Update prototype.
12719
5ba6571d
WX
127202011-05-28 William Xu <william.xwl@gmail.com>
12721
12722 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12723 exiting (Bug#8239).
12724
3eaff834
JM
127252011-05-28 Jim Meyering <meyering@redhat.com>
12726
e1900994 12727 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
12728 * fns.c (to_uchar): Define.
12729 (crypto_hash_function): Use it to convert some newly-signed
12730 variables to unsigned, to avoid sign-extension bugs. For example,
12731 without this change, (md5 "truc") would evaluate to
12732 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12733 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 12734 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 12735
0f6990a7
PE
127362011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12737
12738 Integer overflow fixes.
c8a9ca5a 12739
08686060
PE
12740 * dbusbind.c: Serial number integer overflow fixes.
12741 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
12742 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12743 to hold a serial number that is too large for a fixnum.
12744 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12745 Check for serial numbers out of range. Decode any serial number
59568bf0 12746 that was so large that it became a float. (Bug#8722)
08686060 12747
2d1fc3c7
PE
12748 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12749 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12750 Use XFASTINT rather than XUINT when numbers are nonnegative.
12751 (xd_append_arg, Fdbus_method_return_internal):
12752 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12753 arguments, check that Lisp number is nonnegative, rather than
59568bf0 12754 silently wrapping negative numbers around. (Bug#8722)
30217ff0 12755 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 12756 (Bug#8722)
2d1fc3c7 12757
c8a9ca5a
PE
12758 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12759
519e1d69
PE
12760 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12761
6df6ae42 12762 ccl: Add integer overflow checks.
30569699
PE
12763 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12764 (IN_INT_RANGE): New macros.
12765 (ccl_driver): Use them to check for integer overflow when
12766 decoding a CCL program. Many of the new checks are whether XINT (x)
12767 fits in int; it doesn't always, on 64-bit hosts. The new version
12768 doesn't catch all possible integer overflows, but it's an
847044ea 12769 improvement. (Bug#8719)
30569699 12770
c11285dc
PE
12771 * alloc.c (make_event_array): Use XINT, not XUINT.
12772 There's no need for unsigned here.
12773
fdccd48e
PE
12774 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12775 This follows up to the 2011-05-06 change that substituted uintptr_t
12776 for EMACS_INT. This case wasn't caught back then.
12777
37910ab2
PE
12778 Rework Fformat to avoid integer overflow issues.
12779 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12780 now (part of C89). Include <verify.h>.
12781 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12782 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12783 (Fformat): Avoid the prepass trying to compute sizes; it was only
12784 approximate and thus did not catch overflow reliably. Instead, walk
12785 through the format just once, formatting and computing sizes as we go,
12786 checking for integer overflow at every step, and allocating a larger
12787 buffer as needed. Keep track separately whether the format is
12788 multibyte. Keep only the most-recently calculated precision, rather
12789 than them all. Record whether each argument has been converted to
12790 string. Use EMACS_INT, not int, for byte and char and arg counts.
12791 Support field widths and precisions larger than INT_MAX. Avoid
12792 sprintf's undefined behavior with conversion specifications such as %#d
12793 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12794 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12795 formatting out-of-range floating point numbers with int
9173deec 12796 formats. (Bug#8668)
37910ab2 12797
2e6578fb
PE
12798 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12799
0ae6bdee
PE
12800 * data.c: Avoid integer truncation in expressions involving floats.
12801 * data.c: Include <intprops.h>.
12802 (arith_driver): When there's an integer overflow in an expression
12803 involving floating point, convert the integers to floating point
12804 so that the resulting value does not suffer from catastrophic
12805 integer truncation. For example, on a 64-bit host (* 4
12806 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12807 Do not rely on undefined behavior after integer overflow.
12808
de883a70
PE
12809 merge count_size_as_multibyte, parse_str_to_multibyte
12810 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 12811 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
12812 Check for integer overflow.
12813 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12814 since it's now a duplicate of the other. This is more of
12815 a character than a buffer op, so better that it's in character.c.
12816 * fns.c, print.c: Adjust to above changes.
12817
2ff916cb
PE
128182011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12819
12820 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12821
f1b54466
PE
128222011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12823
fb1ac845
PE
12824 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12825 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12826 (x_clipboard_manager_save): Now static.
12827 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12828
f1b54466
PE
12829 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12830 (crypto_hash_function): Now static.
12831 Fix pointer signedness problems. Avoid unnecessary initializations.
12832
a9f737ee
CY
128332011-05-27 Chong Yidong <cyd@stupidchicken.com>
12834
12835 * termhooks.h (Vselection_alist): Make it terminal-local.
12836
12837 * terminal.c (create_terminal): Initialize it.
12838
12839 * xselect.c: Support for clipboard managers.
12840 (Vselection_alist): Move to termhooks.h as terminal-local var.
12841 (LOCAL_SELECTION): New macro.
12842 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12843 (symbol_to_x_atom): Remove gratuitous arg.
12844 (x_handle_selection_request, lisp_data_to_selection_data)
12845 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
12846 (x_own_selection, x_get_local_selection, x_convert_selection):
12847 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
12848 (some_frame_on_display): Delete unused function.
12849 (Fx_own_selection_internal, Fx_get_selection_internal)
12850 (Fx_disown_selection_internal, Fx_selection_owner_p)
12851 (Fx_selection_exists_p): New optional frame arg.
12852 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12853 (x_handle_selection_clear): Don't treat other terminals with the
12854 same keyboard specially. Use the terminal-local Vselection_alist.
12855 (x_clear_frame_selections): Use Frun_hook_with_args.
12856
12857 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12858
12859 * xterm.h: Add support for those atoms.
12860
e067f0c1
CY
128612011-05-26 Chong Yidong <cyd@stupidchicken.com>
12862
12863 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12864 (converted_selections, conversion_fail_tag): New global variables.
12865 (x_selection_request_lisp_error): Free the above.
12866 (x_get_local_selection): Remove unnecessary code.
12867 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
12868 of converted selections stored in converted_selections.
12869 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
12870 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12871 (x_convert_selection): New function.
12872 (x_handle_selection_event): Simplify.
12873 (x_get_foreign_selection): Don't ignore incoming requests while
12874 waiting for an answer; this will fail when we implement
12875 SAVE_TARGETS, and seems unnecessary anyway.
12876 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12877 (Vx_sent_selection_functions): Doc fix.
12878
0f4aebc0
LL
128792011-05-26 Leo Liu <sdl.web@gmail.com>
12880
12881 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12882
e61124cd
YM
128832011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12884
12885 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12886
12887 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12888 for fringe update if it has periodic bitmap.
ac389d0c 12889 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
12890 and fringe_bitmap_periodic_p.
12891
12892 * fringe.c (get_fringe_bitmap_data): New function.
12893 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12894 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12895 row. Mark glyph row for fringe update if periodicity changed.
12896
12897 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12898 for fringe update unless it has periodic bitmap.
12899
f16d9837
KH
129002011-05-25 Kenichi Handa <handa@m17n.org>
12901
12902 * xdisp.c (get_next_display_element): Set correct it->face_id for
12903 a static composition.
12904
e1b90ef6
LL
129052011-05-24 Leo Liu <sdl.web@gmail.com>
12906
12907 * deps.mk (fns.o):
12908 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12909
12910 * fns.c (crypto_hash_function, Fsha1): New function.
12911 (Fmd5): Use crypto_hash_function.
12912 (syms_of_fns): Add Ssha1.
12913
7400048f
PE
129142011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12915
12916 * gnutls.c: Remove unused macros.
12917 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12918 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12919 Remove macros that are defined and never used.
12920 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12921
abb71cf4
CY
129222011-05-22 Chong Yidong <cyd@stupidchicken.com>
12923
12924 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
12925 (Fx_get_selection_internal): Minor cleanup.
12926 (Fx_own_selection_internal): Rename arguments for consistency with
12927 select.el.
12928
6307db39
PE
129292011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12930
12931 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
12932
f3d4e0a4
CY
129332011-05-22 Chong Yidong <cyd@stupidchicken.com>
12934
12935 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
12936
4d8ade89
YM
129372011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12938
12939 * dispnew.c (scrolling_window): Don't exclude the case that the
12940 last enabled row in the desired matrix touches the bottom boundary.
12941
32078c8d
GM
129422011-05-21 Glenn Morris <rgm@gnu.org>
12943
12944 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
12945 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
12946 and add some more files.
32078c8d 12947
7285dc67
EZ
129482011-05-20 Eli Zaretskii <eliz@gnu.org>
12949
12950 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
12951 report_file_error introduced by the change from 2011-05-07.
12952
89d1bd22
PE
129532011-05-20 Paul Eggert <eggert@cs.ucla.edu>
12954
12955 * systime.h (Time): Define only if emacs is defined.
12956 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
12957 where the include path doesn't have X11/X.h by default. See
12958 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
12959
cd394be1 129602011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
12961
12962 * composite.c (find_automatic_composition): Fix previous change.
12963
b9704ad9
GM
129642011-05-20 Glenn Morris <rgm@gnu.org>
12965
12966 * lisp.mk: New file, split from Makefile.in.
12967 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
12968 (shortlisp): Remove.
12969 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
12970
4a720484
GM
129712011-05-19 Glenn Morris <rgm@gnu.org>
12972
12973 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
12974 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
12975 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
12976 (lisp): Set the order to that of loadup.el.
12977 (shortlisp): Make it a copy of $lisp.
12978 (SOME_MACHINE_LISP): Remove.
12979 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
12980 Use just $shortlisp, not $SOME_MACHINE_LISP too.
12981
a28d4396
KH
129822011-05-18 Kenichi Handa <handa@m17n.org>
12983
12984 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
12985 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
12986 (find_automatic_composition): Mostly rewrite for efficiency.
12987
a2b1fa8e
JB
129882011-05-18 Juanma Barranquero <lekktu@gmail.com>
12989
12990 * makefile.w32-in: Update dependencies.
12991
8e1f5610
CS
129922011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
12993
12994 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 12995 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 12996
7025ee00 129972011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 12998
cdfa6eab
PE
12999 Fix some integer overflow issues, such as string length overflow.
13000
06d6db33
PE
13001 * insdel.c (count_size_as_multibyte): Check for string overflow.
13002
2b4560a8
PE
13003 * character.c (lisp_string_width): Check for string overflow.
13004 Use EMACS_INT, not int, for string indexes and lengths; in
13005 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13006 the resulting string length overflows an EMACS_INT; instead,
13007 report a string overflow if no precision given. When checking for
13008 precision exhaustion, use a check that cannot possibly have
13009 integer overflow. (Bug#8675)
13010 * character.h (lisp_string_width): Adjust to new signature.
13011
cb93f9be
PE
13012 * alloc.c (string_overflow): New function.
13013 (Fmake_string): Use it. This doesn't change behavior, but saves
13014 a few bytes and will simplify future changes.
13015 * character.c (string_escape_byte8): Likewise.
13016 * lisp.h (string_overflow): New decl.
13017
1a1f3366
PE
13018 Fixups, following up to the user-interface timestamp change.
13019 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13020 for UI timestamps, instead of unsigned long.
9fbd6841
PE
13021 * msdos.c (mouse_get_pos): Likewise.
13022 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
13023 * w32gui.h (Time): Define by including "systime.h" rather than by
13024 declaring it ourselves. (Bug#8664)
13025
d4e3e4d3
PE
13026 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13027 * image.c (clear_image_cache): Likewise.
13028
f6a24d19
PE
13029 * term.c (term_mouse_position): Don't assume time_t wraparound.
13030
08dc5ae6
PE
13031 Be more systematic about user-interface timestamps.
13032 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
13033 and sometimes 'EMACS_UINT', to represent these timestamps.
13034 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
13035 This makes the code easier to follow, and makes it easier to catch
13036 integer overflow bugs such as Bug#8664.
13037 * frame.c (Fmouse_position, Fmouse_pixel_position):
13038 Use Time, not unsigned long, for user-interface timestamps.
13039 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13040 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13041 * keyboard.h (last_event_timestamp): Likewise.
13042 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13043 * menu.h (xmenu_show): Likewise.
13044 * term.c (term_mouse_position): Likewise.
13045 * termhooks.h (struct input_event.timestamp): Likewise.
13046 (struct terminal.mouse_position_hook): Likewise.
13047 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13048 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13049 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13050 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13051 what it was before.
13052 * menu.h, termhooks.h: Include "systime.h", for Time.
13053
8e55734a
PE
13054 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13055 Don't assume that the difference between two unsigned long values
13056 can fit into an integer. At this point, we know button_down_time
13057 <= event->timestamp, so the difference must be nonnegative, so
13058 there's no need to cast the result if double-click-time is
13059 nonnegative, as it should be; check that it's nonnegative, just in
13060 case. This bug is triggered when events are more than 2**31 ms
86db42d2 13061 apart (about 25 days). (Bug#8664)
8e55734a 13062
841f1b75 13063 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 13064 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 13065
3e26f69c
PE
13066 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13067 that always fit in int. Use a sentinel instead of a counter, to
13068 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
13069 * frame.h (struct frame): Use int for menu_bar_items_used
13070 instead of EMACS_INT, since it always fits in int.
3e26f69c 13071
5cc152c0
PE
13072 * menu.c (grow_menu_items): Check for int overflow.
13073
d89eb65e
PE
13074 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13075
5235bd3e
PE
13076 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13077 Before, the code was not consistent. These values cannot exceed
13078 2**31 - 1 so there's no need to make them unsigned.
13079 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13080 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13081 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13082 as modifiers.
13083 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13084
bc827e23
PE
13085 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13086 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13087 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13088 presumably because the widths might not match.
13089
78eb494e
PE
13090 * window.c (size_window): Avoid needless test at loop start.
13091
04f2d78b
CB
130922011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13093
13094 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13095
d2fc7e3d 130962011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
13097
13098 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13099
d2fc7e3d 131002011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
13101
13102 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13103 `width' to `bar_area_x' and `bar_area_width', respectively.
13104 (x_scroll_run): Take account of fringe background extension.
13105
04f2d78b
CB
13106 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13107 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
13108 `bar_area_width', respectively.
13109 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13110 background extension.
13111
79b70037
GM
131122011-05-10 Jim Meyering <meyering@redhat.com>
13113
13114 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13115
2f142cc5
JB
131162011-05-10 Juanma Barranquero <lekktu@gmail.com>
13117
13118 * image.c (Finit_image_library): Return t for built-in image types,
13119 like pbm and xbm. (Bug#8640)
13120
57679c86
AS
131212011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13122
13123 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13124
888c9e86
EZ
131252011-05-07 Eli Zaretskii <eliz@gnu.org>
13126
b0512a1d
EZ
13127 * w32console.c (Fset_screen_color): Doc fix.
13128 (Fget_screen_color): New function.
13129 (syms_of_ntterm): Defsubr it.
13130
7285dc67
EZ
13131 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13132 unlink the temporary file if Fcall_process didn't create it in the
13133 first place.
13134 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13135 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
13136 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13137 cue to call_process_cleanup not to close that handle.
13138
4d3fcc8e
BK
131392011-05-07 Ben Key <bkey76@gmail.com>
13140
13141 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13142 one of two shell specific rules, either bootstrap-temacs-CMD or
13143 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13144 to the previous implementation of the bootstrap-temacs rule.
13145 The bootstrap-temacs-CMD rule is similar to the previous
13146 implementation of the bootstrap-temacs rule except that it
13147 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13148 variable.
13149
13150 These changes, along with some changes to nt/configure.bat,
13151 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13152 earlier fix to add support for --cflags and --ldflags options
13153 that include quotes so that it works whether make uses cmd or
13154 sh as the shell.
13155
b4289b64
MA
131562011-05-06 Michael Albinus <michael.albinus@gmx.de>
13157
13158 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13159 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13160 is a constant.
13161 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13162 a string. Handle both cases.
13163 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13164 (Fdbus_register_method): Use Qinvalid_function.
13165
af4c0e28
JB
131662011-05-06 Juanma Barranquero <lekktu@gmail.com>
13167
13168 * makefile.w32-in: Update dependencies.
13169 (LISP_H): Add inttypes.h and stdin.h.
13170 (PROCESS_H): Add unistd.h.
13171
c51453d9
EZ
131722011-05-06 Eli Zaretskii <eliz@gnu.org>
13173
13174 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13175 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13176
8ff0ac3c 131772011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 13178
4c4b566b
PE
13179 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13180
aab2b9b5
PE
13181 * term.c (vfatal): Remove stray call to va_end.
13182 It's not needed and the C Standard doesn't allow it here anyway.
13183
c378da0b
PE
13184 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13185 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13186
288b08c7
PE
13187 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13188 bytes.
13189
e3601888
PE
13190 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13191
db6c0e74
PE
13192 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13193
dd5963ea
PE
13194 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13195
88c9450f
PE
13196 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13197
2f9442b8
PE
13198 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13199
c032b5f8
PE
13200 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13201 * charset.c (Fdefine_charset_internal): Don't initialize
13202 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 13203 32-bit int (Bug#8600).
a108c10b
PE
13204
13205 * lread.c (read_integer): Be more consistent with string-to-number.
13206 Use string_to_number to do the actual conversion; this avoids
13207 rounding errors and fixes some other screwups. Without this fix,
13208 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13209 (digit_to_number): Move earlier, for benefit of read_integer.
13210 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 13211 not a digit in any supported base. (Bug#8602)
a108c10b 13212
ad5f9eea
PE
13213 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13214
aec1708a
PE
13215 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13216 to match comment at start of function. This also removes a
13217 GCC warning about overflow in a 32+64-bit port.
13218
47be4ab5
PE
13219 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13220
371cac43
PE
13221 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13222 Reported by Stefan Monnier in
13223 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
13224 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13225 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 13226
d01a7826
PE
13227 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13228 (EMACS_UINTPTR): Likewise, with uintptr_t.
13229
7fd47d5c
PE
13230 * lisp.h: Prefer 64-bit EMACS_INT if available.
13231 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13232 on 32-bit hosts that have 64-bit int, so that they can access
13233 large files.
122b0c86
PE
13234 However, temporarily disable this change unless the temporary
13235 symbol WIDE_EMACS_INT is defined.
7fd47d5c 13236
8727937b
PE
13237 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13238
8ac068ac
PE
13239 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13240 This removes an assumption that EMACS_INT and long are the same
13241 width as pointers. The assumption is true for Emacs porting targets
13242 now, but we want to make other targets possible.
13243 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13244 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13245 In the rest of the code, change types of integers that hold casted
13246 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13247 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13248 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13249 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13250 No need to cast type when ORing.
13251 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13252 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13253 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13254 assume EMACS_INT is the same width as char *.
13255 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13256 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13257 Remove no-longer-needed casts.
13258 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13259 (xg_tool_bar_help_callback, xg_make_tool_item):
13260 Use EMACS_INTPTR to hold an integer
13261 that will be cast to void *; this can avoid a GCC warning
13262 if EMACS_INT is not the same width as void *.
13263 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13264 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13265 (current_message_1, set_message_1):
13266 Use a local to convert to proper width without a cast.
13267 * xmenu.c (dialog_selection_callback): Likewise.
13268
ede49d71
PE
13269 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13270 Also, don't assume VALBITS / RAND_BITS is less than 5,
13271 and don't rely on undefined behavior when shifting a 1 left into
13272 the sign bit.
13273 * lisp.h (get_random): Change signature to match.
13274
2f30ecd0
PE
13275 * lread.c (hash_string): Use size_t, not int, for hash computation.
13276 Normally we prefer signed values; but hashing is special, because
13277 it's better to use unsigned division on hash table sizes so that
13278 the remainder is nonnegative. Also, size_t is the natural width
13279 for hashing into memory. The previous code used 'int', which doesn't
13280 retain enough info to hash well into very large tables.
13281 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13282
2a866e7b
PE
13283 * dbusbind.c: Don't possibly lose pointer info when converting.
13284 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13285 Use XPNTR rather than XHASH, so that the high-order bits of
13286 the pointer aren't lost when converting through void *.
13287
51639eac
PE
13288 * eval.c (Fautoload): Don't double-shift a pointer.
13289
92394119
PE
13290 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13291
dbdb9a7c
JB
132922011-05-06 Juanma Barranquero <lekktu@gmail.com>
13293
13294 * gnutls.c (DEF_GNUTLS_FN):
13295 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13296
db7a0b4f
AS
132972011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13298
13299 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13300 marker. (Bug#8610)
13301
cd394be1 133022011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
13303
13304 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13305 New version that can reserve upto 2GB of heap space.
13306
f7ff1b0f 133072011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
13308
13309 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13310
639c109b
TZ
133112011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13312
13313 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13314 `gnutls_certificate_set_x509_key_file'.
13315
d2127135
JB
133162011-05-05 Juanma Barranquero <lekktu@gmail.com>
13317
13318 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13319 Update dependencies.
13320
e968f4f3
JB
133212011-05-04 Juanma Barranquero <lekktu@gmail.com>
13322
13323 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13324 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13325 Remove unused parameter `fildes'.
13326 * process.c (read_process_output, send_process): Don't pass it.
13327
84d358f0
JB
133282011-05-04 Juanma Barranquero <lekktu@gmail.com>
13329
13330 Fix previous change: the library cache is defined in w32.c.
13331 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13332 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13333
0898ca10
JB
133342011-05-04 Juanma Barranquero <lekktu@gmail.com>
13335
13336 Implement dynamic loading of GnuTLS on Windows.
13337
13338 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13339 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13340 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13341 Declare.
13342
13343 * gnutls.c (Qgnutls_dll): Define.
13344 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13345 (gnutls_*): Declare function pointers.
13346 (init_gnutls_functions): New function to initialize function pointers.
13347 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13348 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13349 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13350 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13351 (emacs_gnutls_write, emacs_gnutls_read)
13352 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13353 (Fgnutls_available_p): New function.
13354 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13355 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13356 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13357
13358 * image.c: Include w32.h.
13359 (Vimage_type_cache): Delete.
13360 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13361 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13362 (w32_delayed_load): Move to w32.c.
13363
13364 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13365
13366 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13367 (w32_delayed_load): Move from image.c. When loading a library, record
13368 its filename in the :loaded-from property of the library id.
13369 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13370 Initialize and staticpro them.
13371 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13372
13373 * process.c: Include lisp.h before w32.h, not after.
13374 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13375 instead of gnutls_record_check_pending.
13376
13377 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13378
ff4de4aa
TZ
133792011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13380
13381 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13382 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13383 as passed in.
13384
abe95abb
JD
133852011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13386
13387 * xterm.c (x_set_frame_alpha): Do not set property on anything
13388 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13389
e16e55d4
JB
133902011-05-02 Juanma Barranquero <lekktu@gmail.com>
13391
13392 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13393
bafcf6a5
JB
133942011-05-02 Juanma Barranquero <lekktu@gmail.com>
13395
13396 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13397 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13398 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13399 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13400 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13401 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13402 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13403 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13404 (Qgnutls_bootprop_callbacks_verify): Make static.
13405
e7a6747f
AS
134062011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13407
19ed11ba
AS
13408 * callproc.c: Indentation fixup.
13409
e7a6747f 13410 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
13411 (wait_for_termination, interruptible_wait_for_termination):
13412 Move after wait_for_termination_1.
e7a6747f 13413
1ef14cb4
LMI
134142011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13415
13416 * sysdep.c (interruptible_wait_for_termination): New function
13417 which is like wait_for_termination, but allows keyboard
13418 interruptions.
13419
13420 * callproc.c (Fcall_process): Add (:file "file") as an option for
13421 the STDOUT buffer.
13422 (Fcall_process_region): Ditto.
13423
330d880c
EZ
134242011-04-30 Eli Zaretskii <eliz@gnu.org>
13425
8db90b73
EZ
13426 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13427 rather than `XVECTOR (FOO)->size'.
13428
330d880c
EZ
13429 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13430 inttypes.h, as a gnulib replacement is used if it not available in
13431 system headers.
13432
15cbd324
EZ
134332011-04-21 Eli Zaretskii <eliz@gnu.org>
13434
13435 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13436 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13437 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13438
13439 * coding.c (coding_alloc_by_realloc): Error out if destination
13440 will grow beyond MOST_POSITIVE_FIXNUM.
13441 (decode_coding_emacs_mule): Abort if there isn't enough place in
13442 charbuf for the composition carryover bytes. Reserve an extra
13443 space for up to 2 characters produced in a loop.
13444 (decode_coding_iso_2022): Abort if there isn't enough place in
13445 charbuf for the composition carryover bytes.
13446
134472011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 13448
ae940cca
EZ
13449 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13450 aborting when %lld or %lll format is passed.
13451 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13452 %llo or %llx format is passed. (Bug#8545)
13453
03ab8921
EZ
13454 * window.c (window_scroll_line_based): Use a marker instead of
13455 simple variables to record original value of point. (Bug#7952)
13456
afda1437
EZ
13457 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13458 produced by %s or %c overflows available buffer space. (Bug#8545)
13459
f76dee0c
PE
134602011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13461
13462 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 13463 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 13464
fdc5744d
JB
134652011-04-28 Juanma Barranquero <lekktu@gmail.com>
13466
13467 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13468
638f053a
JB
134692011-04-28 Juanma Barranquero <lekktu@gmail.com>
13470
13471 * keyboard.c (Qdelayed_warnings_hook): Define.
13472 (command_loop_1): Run `delayed-warnings-hook'
13473 if Vdelayed_warnings_list is non-nil.
13474 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13475 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13476
d178f871
EZ
134772011-04-28 Eli Zaretskii <eliz@gnu.org>
13478
13479 * doprnt.c (doprnt): Don't return value smaller than the buffer
13480 size if the message was truncated. (Bug#8545).
13481
b124fd93
JB
134822011-04-28 Juanma Barranquero <lekktu@gmail.com>
13483
13484 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13485 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13486
e810457d
PE
134872011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13488
13489 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13490
ea51cceb
JB
134912011-04-27 Juanma Barranquero <lekktu@gmail.com>
13492
13493 * makefile.w32-in: Update dependencies.
13494
94dcfacf
EZ
134952011-04-27 Eli Zaretskii <eliz@gnu.org>
13496
13497 Improve `doprnt' and its usage. (Bug#8545)
13498 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13499 `format_end'. Remove support for %l as a conversion specifier.
13500 Don't use xrealloc. Improve diagnostics when the %l size modifier
13501 is used. Update the commentary.
13502
13503 * eval.c (verror): Simplify calculation of size_t.
13504
13505 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13506 messages.
13507
f61f41d7
PE
135082011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13509
13510 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13511 change.
13512
96fb4434
PE
135132011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13514
13515 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13516 This makes this file independent of the recent pseudovector change.
13517
671875da 135182011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 13519
69e9b5a3
PE
13520 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13521
b5f869a7 13522 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 13523 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 13524 Remove unused local.
c8926152 13525 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 13526
841a1577 13527 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
13528 GCC 4.6.0 optimizes based on type-based alias analysis.
13529 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
13530 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13531 != &v->size, and therefore "v->size = 1; b->size = 2; return
13532 v->size;" must therefore return 1. This assumption is incorrect
13533 for Emacs, since it type-puns struct Lisp_Vector * with many other
13534 types. To fix this problem, this patch adds a new type struct
f904488f 13535 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
13536 and pseudovectors, and helps optimizing compilers not get fooled
13537 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13538 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
13539 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13540 the size member.
eab3844f
PE
13541 (XSETPVECTYPE): Rewrite in terms of new macro.
13542 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13543 This is a bit clearer, and further avoids the possibility of
13544 undesirable aliasing.
13545 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 13546 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
13547 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13548 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
13549 (ASIZE): Now uses header.size rather than size.
13550 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
13551 to avoid the hassle of writing XVECTOR (foo)->header.size.
13552 (struct vectorlike_header): New type.
eab3844f
PE
13553 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13554 object, to help avoid aliasing.
13555 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13556 (SUBRP): Likewise, since Lisp_Subr is a special case.
13557 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13558 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13559 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 13560 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
13561 changed to be "header.size" and "header.next".
13562 * buffer.h (struct buffer): Likewise.
13563 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13564 * frame.h (struct frame): Likewise.
13565 * process.h (struct Lisp_Process): Likewise.
13566 * termhooks.h (struct terminal): Likewise.
13567 * window.c (struct save_window_data, struct saved_window): Likewise.
13568 * window.h (struct window): Likewise.
13569 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13570 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13571 * buffer.c (init_buffer_once): Likewise.
13572 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13573 special case.
13574 * process.c (Fformat_network_address): Use local var for size,
13575 for brevity.
13576
0df1eac5
PE
13577 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13578
847ab9d1 13579 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
13580 * data.c (atof): Remove decl; no longer used or needed.
13581 (digit_to_number): Move to lread.c.
13582 (Fstring_to_number): Use new string_to_number function, to be
13583 consistent with how the Lisp reader treats infinities and NaNs.
13584 Do not assume that floating-point numbers represent EMACS_INT
13585 without losing information; this is not true on most 64-bit hosts.
13586 Avoid double-rounding errors, by insisting on integers when
13587 parsing non-base-10 numbers, as the documentation specifies.
13588 * lisp.h (string_to_number): New decl, replacing ...
13589 (isfloat_string): Remove.
bc0a5c13 13590 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 13591 (read1): Do not accept +. and -. as integers; this
452f4150
PE
13592 appears to have been a coding error. Similarly, do not accept
13593 strings like +-1e0 as floating point numbers. Do not report
13594 overflow for integer overflows unless the base is not 10 which
13595 means we have no simple and reliable way to continue.
13596 Break out the floating-point parsing into a new
13597 function string_to_number, so that Fstring_to_number parses
13598 floating point numbers consistently with the Lisp reader.
04f2d78b 13599 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
13600 (E_CHAR, EXP_INT): Remove, replacing with ...
13601 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13602 (string_to_number): New function, replacing isfloat_string.
13603 This function checks for valid syntax and produces the resulting
13604 Lisp float number too. Rework it so that string-to-number
bc0a5c13 13605 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
13606 so that overflow for non-base-10 numbers is reported only when
13607 there's no portable and simple way to convert to floating point.
452f4150 13608
67769ffc
PE
13609 * textprop.c (set_text_properties_1): Rewrite for clarity,
13610 and to avoid GCC warning about integer overflow.
13611
c20db43f
PE
13612 * intervals.h (struct interval): Use EMACS_INT for members
13613 where EMACS_UINT might cause problems. See
13614 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13615 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13616 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13617 All uses changed.
37aa2f85
PE
13618 (offset_intervals): Tell GCC not to worry about length overflow
13619 when negating a negative length.
c20db43f 13620
2538aa2f
PE
13621 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13622 (overrun_check_free): Likewise.
13623
f2d3008d
PE
13624 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13625 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13626 word size.
13627
ec8df744
PE
13628 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13629 (gnutls_make_error): Rename local to avoid shadowing.
13630 (gnutls_emacs_global_deinit): ifdef out; not used.
13631 (Fgnutls_boot): Use const for pointer to readonly storage.
13632 Comment out unused local. Fix pointer signedness problems.
13633
640ee02d
PE
13634 * lread.c (openp): Don't stuff size_t into an 'int'.
13635 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13636 about possible signed overflow.
13637
6048fb2a
PE
13638 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13639 (GDK_KEY_g): Don't define if already defined.
13640 (xg_prepare_tooltip): Avoid pointer signedness problem.
13641 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13642
fa3c87e1
PE
13643 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13644 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13645
2172544b
PE
13646 * xfns.c (Fx_window_property): Simplify a bit,
13647 to make a bit faster and to avoid GCC 4.6.0 warning.
13648 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13649
9b821a21
PE
13650 * fns.c (internal_equal): Don't assume size_t fits in int.
13651
3c616cfa
PE
13652 * alloc.c (compact_small_strings): Tighten assertion a little.
13653
c2982e87
PE
13654 Replace pEd with more-general pI, and fix some printf arg casts.
13655 * lisp.h (pI): New macro, generalizing old pEd macro to other
13656 conversion specifiers. For example, use "...%"pI"d..." rather
13657 than "...%"pEd"...".
13658 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 13659 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
13660 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13661 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13662 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13663 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13664 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13665 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13666 64-bit hosts.
13667 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13668 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13669 * print.c (safe_debug_print, print_object): Likewise.
13670 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13671 to int.
6f04d126
PE
13672 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13673 avoiding the 0 flag, which is not portable.
c2982e87
PE
13674 * process.c (Fmake_network_process): Use pI to avoid cast.
13675 * region-cache.c (pp_cache): Likewise.
13676 * xdisp.c (decode_mode_spec): Likewise.
13677 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13678 behavior on 64-bit hosts with printf arg.
6f04d126 13679 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
13680 (x_stop_queuing_selection_requests): Likewise.
13681 (x_get_window_property): Don't truncate byte count to an 'int'
13682 when tracing.
0b432f21 13683
5e073ec7
PE
13684 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13685 here, since it parses constructs like leading '-' and spaces,
13686 which are not wanted; and it overflows with large numbers.
13687 Instead, simply match F[0-9]+, which is what is wanted anyway.
13688
36372bf9
PE
13689 * alloc.c: Remove unportable assumptions about struct layout.
13690 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13691 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13692 (allocate_vectorlike, make_pure_vector): Use the new macros,
13693 plus offsetof, to remove unportable assumptions about struct layout.
13694 These assumptions hold on all porting targets that I know of, but
13695 they are not guaranteed, they're easy to remove, and removing them
13696 makes further changes easier.
13697
0b432f21
PE
13698 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13699 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
13700 (string_overrun_cookie): Now const. Use initializers that
13701 don't formally overflow signed char, to avoid warnings.
000098c1
PE
13702 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13703 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
13704 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13705 multiple of sizeof (EMACS_INT); it need not be, if
13706 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 13707 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 13708
895009e1
JB
137092011-04-26 Juanma Barranquero <lekktu@gmail.com>
13710
13711 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13712
6a7a1b0b
TZ
137132011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13714
13715 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 13716 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
13717 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13718
841a1577 137192011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
13720
13721 * lisp.h (Qdebug): List symbol.
895009e1 13722 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
13723 * keyboard.c (debug-on-event): New variable.
13724 (handle_user_signal): Break into debugger when debug-on-event
13725 matches the current signal symbol.
13726
f2d3ba6f
DN
137272011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13728
13729 * alloc.c (check_sblock, check_string_bytes)
13730 (check_string_free_list): Convert to standard C.
13731
42ce4c63
TZ
137322011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13733
13734 * w32.c (emacs_gnutls_push): Fix typo.
13735
825cd63c
EZ
137362011-04-25 Eli Zaretskii <eliz@gnu.org>
13737
fb11d64d
EZ
13738 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13739 "cast to pointer from integer of different size".
13740
825cd63c
EZ
13741 Improve doprnt and its use in verror. (Bug#8545)
13742 * doprnt.c (doprnt): Document the set of format control sequences
13743 supported by the function. Use SAFE_ALLOCA instead of always
13744 using `alloca'.
13745
13746 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13747 is one byte too soon. Don't use xrealloc; instead xfree and
13748 xmalloc anew.
13749
e061a11b
TZ
137502011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13751
13752 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13753 callbacks stage.
13754
13755 * gnutls.c: Renamed global_initialized to
13756 gnutls_global_initialized. Added internals for the
13757 :verify-hostname-error, :verify-error, and :verify-flags
13758 parameters of `gnutls-boot' and documented those parameters in the
13759 docstring. Start callback support.
9173deec
JB
13760 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13761 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13762 on error. Return error code.
e061a11b
TZ
13763 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13764 (emacs_gnutls_read): Likewise.
13765 (Fgnutls_boot): Return handshake error code.
13766 (emacs_gnutls_handle_error): New function.
13767 (wsaerror_to_errno): Likewise.
13768
13769 * w32.h (emacs_gnutls_pull): Add prototype.
13770 (emacs_gnutls_push): Likewise.
13771
13772 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13773 (emacs_gnutls_push): Likewise.
13774
137752011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13776
13777 * process.c (wait_reading_process_output): Check if GnuTLS
13778 buffered some data internally if no FDs are set for TLS
13779 connections.
13780
13781 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13782 (LIBS): Link to USER_LIBS.
13783 ($(BLD)/gnutls.$(0)): New target.
13784
fa6996bc
EZ
137852011-04-24 Eli Zaretskii <eliz@gnu.org>
13786
eb35682e
EZ
13787 * xdisp.c (handle_single_display_spec): Rename the
13788 display_replaced_before_p argument into display_replaced_p, to
13789 make it consistent with the commentary. Fix typos in the
13790 commentary.
13791
e2ad650c
EZ
13792 * textprop.c (syms_of_textprop): Remove dead code.
13793 (copy_text_properties): Delete obsolete commentary about an
13794 interface that was deleted long ago. Fix typos in the description
13795 of arguments.
13796
1b2de274
EZ
13797 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13798 to changes in oldXMenu/XMenu.h from 2011-04-16.
13799 <menu_help_message, prev_menu_help_message>: Constify.
13800 (IT_menu_make_room): menu->help_text is now `const char **';
13801 adjust.
13802
13803 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13804 to changes in oldXMenu/XMenu.h from 2011-04-16.
13805 (struct XMenu): Declare `help_text' `const char **'.
13806
13807 * xfaces.c <Qunspecified>: Make extern again.
13808
13809 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 13810 required by POSIX.
1b2de274 13811
762b15be
EZ
13812 * doc.c (get_doc_string): Improve the format passed to `error'.
13813
13814 * doprnt.c (doprnt): Improve commentary.
13815
13816 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13817
13818 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13819 them with etags.
13820
f1052e5d
EZ
13821 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13822 changes in globals.h immediately force recompilation.
762b15be
EZ
13823 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13824 $(CURDIR)/s/ms-w32.h.
13825 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 13826
fa6996bc
EZ
13827 * character.c (Fchar_direction): Function deleted.
13828 (syms_of_character): Don't defsubr it.
13829 <char-direction-table>: Deleted.
13830
e6c3da20
EZ
138312011-04-23 Eli Zaretskii <eliz@gnu.org>
13832
13833 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13834 * doprnt.c: Include limits.h.
13835 (SIZE_MAX): New macro.
04f2d78b
CB
13836 (doprnt): Return a size_t value. 2nd arg is now size_t.
13837 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
13838 Improve overflow protection. Support `l' modifier for integer
13839 conversions. Support %l conversion. Don't assume an EMACS_INT
13840 argument for integer conversions and for %c.
13841
13842 * lisp.h (doprnt): Restore prototype.
13843
13844 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13845 $(SRC)/character.h.
13846
13847 * Makefile.in (base_obj): Add back doprnt.o.
13848
13849 * deps.mk (doprnt.o): Add back prerequisites.
13850 (callint.o): Depend on character.h.
13851
13852 * eval.c (internal_lisp_condition_case): Include the handler
13853 representation in the error message.
13854 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13855 when breaking from the loop.
13856
13857 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13858
13859 * callint.c (Fcall_interactively): When displaying error message
13860 about invalid control letter, pass the character's codepoint, not
13861 a pointer to its multibyte form. Improve display of the character
13862 in octal and display also its hex code.
13863
13864 * character.c (char_string): Use %x to display the (unsigned)
13865 codepoint of an invalid character, to avoid displaying a bogus
13866 negative value.
13867
13868 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13869 `error', not SYMBOL_NAME itself.
13870
13871 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13872 character arguments to `error'.
13873
13874 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13875 to `error' in error message about FINAL_CHAR argument. Make sure
13876 FINAL_CHAR is a character, and use %c when it is passed as
13877 argument to `error'.
13878
4ffd0d6b 138792011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
13880
13881 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13882
13883 * w32.c: Include <time.h>.
13884 (sys_localtime): New function.
13885
4ffd0d6b 138862011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
13887
13888 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13889
4ffd0d6b 13890 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 13891
4ffd0d6b 138922011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 13893
4ffd0d6b
GM
13894 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13895 zombies (Bug#8467).
aac0c6e3 13896
04c56954
EZ
138972011-04-19 Eli Zaretskii <eliz@gnu.org>
13898
13899 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13900 gl_state.e_property when gl_state.object is Qt.
13901
13902 * insdel.c (make_gap_larger): Remove limitation of buffer size
13903 to <= INT_MAX.
13904
16a43933
CY
139052011-04-18 Chong Yidong <cyd@stupidchicken.com>
13906
13907 * xdisp.c (lookup_glyphless_char_display)
13908 (produce_glyphless_glyph): Handle cons cell entry in
13909 glyphless-char-display.
13910 (Vglyphless_char_display): Document it.
13911
13912 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13913 glyphless-char-display.
13914
4581706e
CY
139152011-04-17 Chong Yidong <cyd@stupidchicken.com>
13916
13917 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13918
13919 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13920
13921 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13922 definition for no-X builds.
13923
4887c6e2 139242011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 13925
fd35b6f9
PE
13926 Static checks with GCC 4.6.0 and non-default toolkits.
13927
5c1ccb01
PE
13928 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
13929
006c5daa
PE
13930 * process.c (keyboard_bit_set): Define only if SIGIO.
13931 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
13932 (send_process): Repair possible setjmp clobbering.
13933
efc736d3
PE
13934 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
13935
4e2fe2e6
PE
13936 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
13937
f97334a2
PE
13938 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
13939
4e75f29d
PE
13940 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
13941 Define only if needed.
13942
90efadd1
PE
13943 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
13944 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 13945 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 13946
3c647824
PE
13947 * dispextern.h (struct redisplay_interface): Rename param
13948 to avoid shadowing.
e264f262 13949 * termhooks.h (struct terminal): Likewise.
761383f4 13950 * xterm.c (xembed_send_message): Likewise.
3c647824 13951
b58c5c4a
PE
13952 * insdel.c (make_gap_smaller): Define only if
13953 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
13954
cad59032
PE
13955 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
13956 it.
13957
c339dc2e
PE
13958 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
13959 so that we aren't warned about unused symbols.
13960
91a3e27b
PE
13961 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
13962
399c71d3 13963 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 13964
8ffc96f5
PE
13965 * xfns.c (x_real_positions): Mark locals as initialized.
13966
eef9bc79
PE
13967 * xmenu.c (xmenu_show): Don't use uninitialized vars.
13968
098db9dd
PE
13969 * xterm.c: Fix problems found by static analysis with other toolkits.
13970 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
13971 (x_dispatch_event): Declare static if USE_GTK, and
13972 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 13973 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 13974 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
13975 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
13976 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 13977
eb18f6cc
PE
13978 * xmenu.c (menu_help_callback): Pointer type fixes.
13979 Use const pointers when pointing at readonly data. Avoid pointer
13980 signedness clashes.
13981 (FALSE): Remove unused macro.
13982 (update_frame_menubar): Remove unused decl.
13983
1fe72bf8
PE
13984 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
13985
60d9e1db
PE
13986 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
13987 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
13988 (single_menu_item): Rename local to avoid shadowing.
13989
39261c26
PE
13990 * keyboard.c (make_lispy_event): Remove unused local var.
13991
018c5e19
PE
13992 * frame.c, frame.h (x_get_resource_string): Bring this back, but
13993 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
13994
63d2b86e
PE
13995 * bitmaps: Change bitmaps from unsigned char back to the X11
13996 compatible char. Avoid the old compiler warnings about
13997 out-of-range initializers by using, for example, '\xab' rather
13998 than 0xab.
13999
aefd87e1
PE
14000 * xgselect.c (xgselect_initialize): Check vs interface
14001 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14002
bf501fb9
PE
14003 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14004
e9829fdf
PE
14005 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14006 to read-only memory.
14007
1086c095
PE
14008 * fns.c (vector): Remove; this old hack is no longer needed.
14009
2baccd04 14010 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 14011 Remove unused var.
dde42981 14012 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 14013
72391843 14014 * xrdb.c (x_load_resources): Omit unused local.
3565b346 14015
436c16df 14016 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 14017 (x_window): Rename locals to avoid shadowing.
dc5ddd85 14018 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 14019
92bb796d 14020 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 14021 (x_term_init): Remove local to avoid shadowing.
92bb796d 14022
764430a3 14023 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
14024
14025 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14026 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14027
d1dfb56c
EZ
140282011-04-16 Eli Zaretskii <eliz@gnu.org>
14029
c4354cb4
EZ
14030 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14031
d1dfb56c
EZ
14032 Fix regex.c, syntax.c and friends for buffers > 2GB.
14033 * syntax.h (struct gl_state_s): Declare character position members
14034 EMACS_INT.
14035
14036 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14037
04f2d78b
CB
14038 * textprop.c (verify_interval_modification, interval_of):
14039 Declare arguments EMACS_INT.
d1dfb56c
EZ
14040
14041 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14042 EMACS_INT.
14043
14044 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14045
14046 * indent.c (Fvertical_motion): Local variable it_start is now
14047 EMACS_INT.
14048
14049 * regex.c (re_match, re_match_2, re_match_2_internal)
14050 (bcmp_translate, regcomp, regexec, print_double_string)
14051 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14052 (re_compile_pattern, re_exec): Declare arguments and local
14053 variables `size_t' and `ssize_t' and return values `regoff_t', as
14054 appropriate.
14055 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14056 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14057 <compile_stack_type>: `size' and `avail' are now `size_t'.
14058
14059 * regex.h <regoff_t>: Use ssize_t, not int.
14060 (re_search, re_search_2, re_match, re_match_2): Arguments that
14061 specify buffer/string position and length are now ssize_t and
14062 size_t. Return type is regoff_t.
14063
613052cd
BK
140642011-04-16 Ben Key <bkey76@gmail.com>
14065
14066 * nsfont.m: Fixed bugs in ns_get_family and
14067 ns_descriptor_to_entity that were caused by using free to
14068 deallocate memory blocks that were allocated by xmalloc (via
14069 xstrdup). This caused Emacs to crash when compiled with
14070 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14071 --enable-checking=xmallocoverrun). xfree is now used to
14072 deallocate these memory blocks.
14073
4170f62f 140742011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 14075
71b41406
PE
14076 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14077
9587a89d
PE
14078 emacs_write: Accept and return EMACS_INT for sizes.
14079 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14080 et seq.
14081 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14082 Accept and return EMACS_INT.
14083 (emacs_gnutls_write): Return the number of bytes written on
14084 partial writes.
14085 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
14086 (emacs_read, emacs_write): Remove check for negative size, as the
14087 Emacs source code has been audited now.
9587a89d
PE
14088 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14089 (emacs_read, emacs_write): Use it.
273a5f82
PE
14090 * process.c (send_process): Adjust to the new signatures of
14091 emacs_write and emacs_gnutls_write. Do not attempt to store
14092 a byte offset into an 'int'; it might overflow.
9587a89d 14093 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 14094
3e047f51
PE
14095 * sound.c: Don't assume sizes fit in 'int'.
14096 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 14097 Return EMACS_INT, not int.
3e047f51 14098 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
14099 Accept EMACS_INT, not int.
14100 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
14101 record read return values.
14102
cc39a9db
BK
141032011-04-15 Ben Key <bkey76@gmail.com>
14104
c9d0ec6d
JB
14105 * keyboard.c (Qundefined): Don't declare static since it is used
14106 in nsfns.m.
14107 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14108 static since they are used in nsfont.m.
cc39a9db 14109
6c60eb9f
SM
141102011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14111
14112 * process.c (Qprocessp): Don't declare static.
14113 * lisp.h (Qprocessp): Declare again.
14114
7990b61a
JB
141152011-04-15 Juanma Barranquero <lekktu@gmail.com>
14116
14117 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14118
5d4cb038
PE
141192011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14120
8bd7b830 14121 Improve C-level modularity by making more things 'static'.
cd64ea1d 14122
e3b27b31
PE
14123 Don't publish debugger-only interfaces to other modules.
14124 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14125 (verify_bytepos, count_markers): Move decls to the only modules
14126 that need them.
14127 * region-cache.h (pp_cache): Likewise.
14128 * window.h (check_all_windows): Likewise.
14129 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14130
5d4cb038
PE
14131 * sysdep.c (croak): Now static, if
14132 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14133 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
14134
14135 * alloc.c (refill_memory_reserve): Now static if
14136 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14137 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 14138
e87b6180
PE
14139 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14140 Define only if USE_LUCID.
14141
ac64929e
PE
14142 * xrdb.c (x_customization_string, x_rm_string): Now static.
14143
6f37259d
PE
14144 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14145 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14146
1683e3ab
PE
14147 * xdisp.c (draw_row_with_mouse_face): Now static.
14148 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14149
de9c2632
PE
14150 * window.h (check_all_windows): Mark externally visible.
14151
2b96acb7
PE
14152 * window.c (window_deletion_count): Now static.
14153
14154 * undo.c: Make symbols static if they're not exported.
14155 (last_undo_buffer, last_boundary_position, pending_boundary):
14156 Now static.
14157
50436f33
PE
14158 * textprop.c (interval_insert_behind_hooks): Now static.
14159 (interval_insert_in_front_hooks): Likewise.
14160
64520e5c
PE
14161 * term.c: Make symbols static if they're not exported.
14162 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14163 (max_frame_lines, tty_set_terminal_modes):
14164 (tty_reset_terminal_modes, tty_turn_off_highlight):
14165 (get_tty_terminal): Now static.
14166 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14167 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 14168 HAVE_WINDOW_SYSTEM.
64520e5c
PE
14169 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14170 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14171
1fa53021
PE
14172 * sysdep.c: Make symbols static if they're not exported.
14173 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14174 Now static.
14175 (sigprocmask_set, full_mask): Remove; unused.
14176 (wait_debugging): Mark as visible.
14177 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14178 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14179
d4b43b22
PE
14180 * syntax.c (syntax_temp): Define only if !__GNUC__.
14181
b7c513d0
PE
14182 * sound.c (current_sound_device, current_sound): Now static.
14183
989b29ad
PE
14184 * search.c (searchbufs, searchbuf_head): Now static.
14185
13a55a78
PE
14186 * scroll.c (scroll_cost): Remove; unused.
14187 * dispextern.h (scroll_cost): Remove decl.
14188
de68a1fc
PE
14189 * region-cache.h (pp_cache): Mark as externally visible.
14190
40ccffa6
PE
14191 * process.c: Make symbols static if they're not exported.
14192 (process_tick, update_tick, create_process, chan_process):
14193 (Vprocess_alist, proc_buffered_char, datagram_access):
14194 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14195 (deactivate_process): Mark defn as static, as well as decl.
14196 * lisp.h (create_process): Remove decl.
14197 * process.h (chan_process, Vprocess_alist): Remove decls.
14198
ad64fc97
PE
14199 * print.c: Make symbols static if they're not exported.
14200 (print_depth, new_backquote_output, being_printed, print_buffer):
14201 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14202 (print_interval, print_number_index, initial_stderr_stream):
14203 Now static.
14204 * lisp.h (Fprinc): Remove decl.
14205 (debug_output_compilation_hack): Mark as externally visible.
14206
adddb265
PE
14207 * sysdep.c (croak): Move decl from here to syssignal.h.
14208 * syssignal.h (croak): Put it here, so the API can be checked when
14209 'croak' is called from dissociate_if_controlling_tty.
14210
1717ede2
PE
14211 * minibuf.c: Make symbols static if they're not exported.
14212 (minibuf_save_list, choose_minibuf_frame): Now static.
14213 * lisp.h (choose_minibuf_frame): Remove decl.
14214
fa5fb2bc
PE
14215 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14216
1e3890d1
PE
14217 * lread.c: Make symbols static if they're not exported.
14218 (read_objects, initial_obarray, oblookup_last_bucket_number):
14219 Now static.
14220 (make_symbol): Remove; unused.
14221 * lisp.h (initial_obarray, make_symbol): Remove decls.
14222
8a1414fa
PE
14223 * keyboard.c: Make symbols static if they're not exported.
14224 (single_kboard, recent_keys_index, total_keys, recent_keys):
14225 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14226 (this_single_command_key_start, echoing, last_auto_save):
14227 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14228 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14229 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14230 (Vlispy_mouse_stem, double_click_count):
14231 Now static.
14232 (force_auto_save_soon): Define only if SIGDANGER.
14233 (ignore_mouse_drag_p): Now static if
14234 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14235 (print_help): Remove; unused.
14236 (stop_character, last_timer_event): Mark as externally visible.
14237 * keyboard.h (ignore_mouse_drag_p): Declare only if
14238 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14239 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14240 * lisp.h (echoing): Remove decl.
14241 (force_auto_save_soon): Declare only if SIGDANGER.
14242 * xdisp.c (redisplay_window): Simplify code, to make it more
14243 obvious that ignore_mouse_drag_p is not accessed if !defined
14244 USE_GTK && !defined HAVE_NS.
14245
93ea6e8f
PE
14246 * intervals.c: Make symbols static if they're not exported.
14247 (merge_properties_sticky, merge_interval_right, delete_interval):
14248 Now static.
14249 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14250
77382fcc
PE
14251 * insdel.c: Make symbols static if they're not exported.
14252 However, leave prepare_to_modify_buffer alone. It's never
14253 called from outside this function, but that appears to be a bug.
14254 (combine_after_change_list, combine_after_change_buffer):
4889fc82 14255 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
14256 (adjust_after_replace_noundo): Remove; unused.
14257 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 14258 (signal_before_change): Remove decls.
77382fcc 14259
9306c32e
PE
14260 * indent.c (val_compute_motion, val_vmotion): Now static.
14261
cd44d2eb
PE
14262 * image.c: Make symbols static if they're not exported.
14263 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14264 if USE_GTK.
14265 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14266 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14267
ad9a7a06
PE
14268 * fringe.c (standard_bitmaps): Now static.
14269 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14270
81626931
PE
14271 * frame.c: Make symbols static if they're not exported.
14272 (x_report_frame_params, make_terminal_frame): Now static.
14273 (get_frame_param): Now static, unless HAVE_NS.
14274 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14275 (x_get_resource_string): Remove; not used.
14276 * frame.h (make_terminal_frame, x_report_frame_params):
14277 (x_get_resource_string); Remove decls.
14278 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14279 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14280
239f9db9
PE
14281 * font.c, fontset.c: Make symbols static if they're not exported.
14282 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14283 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14284 * font.c (font_close_object): Now static.
14285 * font.h (font_close_object): Remove.
14286 * fontset.c (FONTSET_OBJLIST): Remove.
14287 (free_realized_fontset) #if-0 the body, which does nothing.
14288 (face_suitable_for_char_p): #if-0, as it's never called.
14289 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
14290 * xfaces.c (face_at_string_position):
14291 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
14292 since 0 is always ASCII.
14293
dfcf3579
PE
14294 * fns.c (weak_hash_tables): Now static.
14295
5045092b
PE
14296 * fileio.c: Make symbols static if they're not exported.
14297 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14298 (Vwrite_region_annotation_buffers): Now static.
14299
57a96f5c
PE
14300 * eval.c: Make symbols static if they're not exported.
14301 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14302 * lisp.h (backtrace_list): Remove decl.
14303
35f08c38
PE
14304 * emacs.c: Make symbols static if they're not exported.
14305 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14306 (fatal_error_code, fatal_error_signal_hook, standard_args):
14307 Now static.
14308 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14309 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14310 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14311 * lisp.h (fatal_error_signal_hook): Remove decl.
14312 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14313
f44bd759
PE
14314 * editfns.c: Move a (normally-unused) function to its only use.
14315 * editfns.c, lisp.h (get_operating_system_release): Remove.
14316 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14317 worth the hassle of breaking this out.
14318
b532497d
PE
14319 * xterm.c: Make symbols static if they're not exported.
14320 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14321 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14322 (x_destroy_window, x_delete_display):
14323 Now static.
14324 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14325 (x_mouse_leave): Remove; unused.
14326 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14327 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14328 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14329 Remove decls.
14330 (x_mouse_leave): Declare only if WINDOWSNT.
14331 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14332 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14333 USE_X_TOOLKIT.
14334
1675728f
PE
14335 * ftxfont.c: Make symbols static if they're not exported.
14336 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14337 HAVE_FREETYPE.
14338 * font.h (ftxfont_driver): Likewise.
14339
e4cebfca
PE
14340 * xfns.c: Make symbols static if they're not exported.
14341 (x_last_font_name, x_display_info_for_name):
14342 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14343 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14344 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14345 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14346 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14347 (last_show_tip_args): Now static.
14348 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14349 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14350 (x_screen_planes): Remove; unused.
14351 * dispextern.h (x_screen_planes): Remove decl.
14352
5bf46f05
PE
14353 * dispnew.c: Make symbols static if they're not exported.
14354 * dispextern.h (redraw_garbaged_frames, scrolling):
14355 (increment_row_positions): Remove.
14356 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14357 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14358 Now static.
14359 (redraw_garbaged_frames): Remove; unused.
14360
435f4c28
PE
14361 * xfaces.c: Make symbols static if they're not exported.
14362 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14363 Remove decls.
14364 * xterm.h (defined_color): Remove decls.
14365 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14366 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14367 (menu_face_changed_default, defined_color, free_realized_face):
14368 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14369 (ascii_face_of_lisp_face): Remove; unused.
14370
8524aef3
PE
14371 * xdisp.c: Make symbols static if they're not exported.
14372 * dispextern.h (scratch_glyph_row, window_box_edges):
14373 (glyph_to_pixel_coords, set_cursor_from_row):
14374 (get_next_display_element, set_iterator_to_next):
14375 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14376 (show_mouse_face): Remove decls
14377 * frame.h (message_buf_print): Likewise.
14378 * lisp.h (pop_message, set_message, check_point_in_composition):
14379 Likewise.
14380 * xterm.h (set_vertical_scroll_bar): Likewise.
14381 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14382 (message_buf_print, scratch_glyph_row, displayed_buffer):
14383 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14384 (get_next_display_element, show_mouse_face, window_box_edges):
14385 (frame_to_window_pixel_xy, check_point_in_composition):
14386 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14387 (glyph_to_pixel_coords): Remove; unused.
14388
16390cd2
PE
14389 * dired.c (file_name_completion): Now static.
14390
14391 * dbusbind.c (xd_in_read_queued_messages): Now static.
14392
a25f4dfa
PE
14393 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14394 * data.c (circular_list_error): Remove.
14395
14a9c8df
PE
14396 * commands.h (last_point_position, last_point_position_buffer):
14397 (last_point_position_window): Remove decls.
14398 * keyboard.c: Make these variables static.
14399
04f2d78b
CB
14400 * coding.h (coding, code_convert_region, encode_coding_gap):
14401 Remove decls.
74ab6df5
PE
14402 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14403 (iso_code_class, detect_coding, code_convert_region): Now static.
14404 (encode_coding_gap): Remove; unused.
14405
38dfbee1
PE
14406 * chartab.c (chartab_chars, chartab_bits): Now static.
14407
a2cb4e63
PE
14408 * charset.h (charset_iso_8859_1): Remove decl.
14409 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14410 Now static.
14411
127198fd
PE
14412 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14413 * ccl.c (Vccl_program_table): Now static.
14414 (check_ccl_update): Remove; unused.
14415
d85b608f
PE
14416 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14417 * category.h: ... from here.
14418 * category.c (check_category_table, set_category_set): Now static.
14419
31cd66f3
PE
14420 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14421 * lisp.h: Remove these decls.
14422
c358e587
PE
14423 * buffer.c (buffer_count): Remove unused var.
14424
e78aecca
PE
14425 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14426 so that it's not optimized away.
14427 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14428 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14429 exported only to the debugger.
14430
e192d7d3 14431 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 14432 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 14433
92470028
PE
14434 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14435 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14436 was inaccessible from Lisp.
14437 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14438 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14439
244ed907
PE
14440 alloc.c: Import and export fewer symbols, and remove unused items.
14441 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14442 is defined.
14443 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14444 it's not optimized away by whole-program optimization.
14445 (message_enable_multibyte, free_misc): Remove.
14446 (catchlist, handlerlist, mark_backtrace):
14447 Declare only if BYTE_MARK_STACK.
14448 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14449 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14450 (message_enable_multibyte): Remove decl.
14451 (free_misc, interval_free_list, float_block, float_block_index):
14452 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14453 (cons_free_list, last_marked_index):
14454 Now static.
14455 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14456 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14457 (mark_backtrace): Define only if BYTE_MARK_STACK.
14458 * xdisp.c (message_enable_multibyte): Now static.
14459
61c2b50e 14460 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
14461 This makes it easier for human readers (and static analyzers)
14462 to see whether these variables are used from other modules.
14463 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14464 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14465 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14466 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14467 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14468 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14469 * xmenu.c, xselect.c:
14470 Declare Q* vars static if they are not used in other modules.
14471 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14472 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14473 Remove decls of unexported vars.
14474 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14475
95c82688
PE
14476 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14477
16a97296
PE
14478 Make Emacs functions such as Fatom 'static' by default.
14479 This makes it easier for human readers (and static analyzers)
14480 to see whether these functions can be called from other modules.
14481 DEFUN now defines a static function. To make the function external
14482 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
14483 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14484 (Finit_image_library):
16a97296
PE
14485 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14486 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14487 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14488 Remove decls, since these functions are now static.
14489 (Funintern, Fget_internal_run_time): New decls, since these functions
14490 were already external.
95c82688 14491
16a97296
PE
14492 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14493 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14494 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14495 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14496 * keyboard.c, keymap.c, lread.c:
14497 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14498 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14499 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14500 Mark functions with DEFUE instead of DEFUN,
14501 if they are used in other modules.
14502 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14503 decls for now-static functions.
14504 * buffer.h (Fdelete_overlay): Remove decl.
14505 * callproc.c (Fgetenv_internal): Mark as internal.
14506 * composite.c (Fremove_list_of_text_properties): Remove decl.
14507 (Fcomposition_get_gstring): New forward static decl.
14508 * composite.h (Fcomposite_get_gstring): Remove decl.
14509 * dired.c (Ffile_attributes): New forward static decl.
14510 * doc.c (Fdocumntation_property): New forward static decl.
14511 * eval.c (Ffetch_bytecode): New forward static decl.
14512 (Funintern): Remove extern decl; now in .h file where it belongs.
14513 * fileio.c (Fmake_symbolic_link): New forward static decl.
14514 * image.c (Finit_image_library): New forward static decl.
14515 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14516 * intervals.h (Fprevious_property_change):
14517 (Fremove_list_of_text_properties): Remove decls.
14518 * keyboard.c (Fthis_command_keys): Remove decl.
14519 (Fcommand_execute): New forward static decl.
14520 * keymap.c (Flookup_key): New forward static decl.
14521 (Fcopy_keymap): Now static.
14522 * keymap.h (Flookup_key): Remove decl.
14523 * process.c (Fget_process): New forward static decl.
14524 (Fprocess_datagram_address): Mark as internal.
14525 * syntax.c (Fsyntax_table_p): New forward static decl.
14526 (skip_chars): Remove duplicate decl.
14527 * textprop.c (Fprevious_property_change): New forward static decl.
14528 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14529 Now internal.
14530 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14531 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14532
785bbd42
PE
14533 * editfns.c (Fformat): Remove unreachable code.
14534
8b913b57
AS
145352011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14536
14537 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14538 change. (Bug#8496)
14539
a6744a35
EZ
145402011-04-13 Eli Zaretskii <eliz@gnu.org>
14541
14542 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14543 when at ZV. (Bug#8487)
14544
e7974947
AS
145452011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14546
baad03f0
AS
14547 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14548 (Bug#8437)
14549 * keyboard.c (parse_tool_bar_item): Likewise.
14550 * sound.c (sound_cleanup, alsa_close): Likewise.
14551 * termcap.c (tgetent): Likewise.
14552 * xfns.c (x_default_font_parameter): Likewise.
14553 * xsettings.c (read_and_apply_settings): Likewise.
14554
e7974947
AS
14555 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14556 (overrun_check_free): Protoize.
14557
28272684
PE
145582011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14559
14560 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14561 since callers should never pass a negative size.
14562 Change the signature to match that of plain 'read' and 'write'; see
14563 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14564 * lisp.h: Update prototypes of emacs_write and emacs_read.
14565
11997c76
EZ
145662011-04-11 Eli Zaretskii <eliz@gnu.org>
14567
14568 * xdisp.c (redisplay_window): Don't try to determine the character
14569 position of the scroll margin if the window start point w->startp
e896f03c 14570 is outside the buffer's accessible region. (Bug#8468)
11997c76 14571
8a2cbd72
EZ
145722011-04-10 Eli Zaretskii <eliz@gnu.org>
14573
14574 Fix write-region and its subroutines for buffers > 2GB.
14575 * fileio.c (a_write, e_write): Modify declaration of arguments and
14576 local variables to support buffers larger than 2GB.
14577 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14578
14579 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14580 argument, local variables, and return value.
14581
14582 * lisp.h: Update prototypes of emacs_write and emacs_read.
14583
14584 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14585
4073e537 145862011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 14587
1ebfdcb6
PE
14588 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14589
b2ded58d
PE
14590 Fix more problems found by GCC 4.6.0's static checks.
14591
7d66342c
PE
14592 * xdisp.c (vmessage): Use a better test for character truncation.
14593
bbf47d44
PE
14594 * charset.c (load_charset_map): <, not <=, for optimization,
14595 and to avoid potential problems with integer overflow.
9248994d 14596 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 14597 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 14598 * editfns.c (Fformat): Likewise.
1e69125e 14599 * syntax.c (skip_chars): Likewise.
3befa583 14600
e3019616
PE
14601 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14602 This also lets GCC 4.6.0 generate slightly better loop code.
14603
becfa255
PE
14604 * callint.c (Fcall_interactively): <, not <=, for optimization.
14605 (Fcall_interactively): Count the number of arguments produced,
14606 not the number of arguments given. This is simpler and lets GCC
14607 4.6.0 generate slightly better code.
14608
dae0cd48
PE
14609 * ftfont.c: Distingish more carefully between FcChar8 and char.
14610 The previous code passed unsigned char * to a functions like
14611 strlen and xstrcasecmp that expect char *, which does not
14612 conform to the C standard.
14613 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14614 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14615 char * when the C standard requires it.
14616
76032d70
PE
14617 * keyboard.c (read_char): Remove unused var.
14618
eb3f1cc8
PE
14619 * eval.c: Port to Windows vsnprintf (Bug#8435).
14620 Include <limits.h>.
14621 (SIZE_MAX): Define if the headers do not.
14622 (verror): Do not give up if vsnprintf returns a negative count.
14623 Instead, grow the buffer. This ports to Windows vsnprintf, which
14624 does not conform to C99. Problem reported by Eli Zaretskii.
14625 Also, simplify the allocation scheme, by avoiding the need for
14626 calling realloc, and removing the ALLOCATED variable.
14627
70476b54
PE
14628 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14629
12020a9e
PE
14630 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14631 But keep the doprint source code for now, as we might revamp it
14632 and use it again (Bug#8435).
ea6c7ae6
PE
14633 * lisp.h (doprnt): Remove.
14634 * Makefile.in (base_obj): Remove doprnt.o.
14635 * deps.mk (doprnt.o): Remove.
14636
5fdb398c
PE
14637 error: Print 32- and 64-bit integers portably (Bug#8435).
14638 Without this change, on typical 64-bit hosts error ("...%d...", N)
14639 was used to print both 32- and 64-bit integers N, which relied on
14640 undefined behavior.
61bdb816 14641 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
14642 * lisp.h (error, verror): Mark as printf-like functions.
14643 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14644 Report overflow in size calculations when allocating printf buffer.
14645 Do not truncate output string at its first null byte.
14646 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14647 Truncate the output at a character boundary, since vsnprintf does not
14648 do that.
14649 * charset.c (check_iso_charset_parameter): Convert internal
14650 character to string before calling 'error', since %c now has the
14651 printf meaning.
14652 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14653 overflow when computing char to be passed to 'error'. Do not
14654 pass Lisp_Object to 'error'; pass the integer instead.
14655 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14656 formatted with plain %d.
14657
b189fa66
PE
14658 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14659
bff87ef0
PE
14660 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14661
7e2cac20
PE
14662 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14663
ce4d90b5
PE
14664 * xterm.c (x_catch_errors): Remove duplicate declaration.
14665
266c9547
PE
14666 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14667
79c49ad2
PE
14668 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14669
368f4090
JM
146702011-04-10 Jim Meyering <meyering@redhat.com>
14671
14672 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14673 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14674 return ssize_t not "int", and use size_t as the buffer length.
14675 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14676 * gnutls.h: Update declarations.
14677 * process.c (read_process_output): Use ssize_t, to match.
14678 (send_process): Likewise.
14679
a32d4040
CY
146802011-04-09 Chong Yidong <cyd@stupidchicken.com>
14681
14682 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14683
8546720e 146842011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 14685
04f2d78b
CB
14686 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14687 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 14688
8546720e
GM
14689 * xterm.c (handle_one_xevent):
14690 * xmenu.c (create_and_show_popup_menu):
14691 * xselect.c (x_decline_selection_request)
14692 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 14693
0a2f5c1a 146942011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
14695
14696 Fix some uses of `int' instead of EMACS_INT.
14697 * search.c (string_match_1, fast_string_match)
14698 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14699 (scan_buffer, find_next_newline_no_quit)
14700 (find_before_next_newline, search_command, Freplace_match)
14701 (Fmatch_data): Make some `int' variables be EMACS_INT.
14702
14703 * xdisp.c (display_count_lines): 3rd argument and return value now
14704 EMACS_INT. All callers changed.
14705 (pint2hrstr): Last argument is now EMACS_INT.
14706
14707 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14708 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14709 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14710 (decode_coding_utf_16, decode_coding_emacs_mule)
14711 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14712 (decode_coding_ccl, decode_coding_charset)
14713 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14714 (decode_coding_iso_2022, decode_coding_emacs_mule)
14715 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14716 <char_offset, last_offset>: Declare EMACS_INT.
14717 (encode_coding_utf_8, encode_coding_utf_16)
14718 (encode_coding_emacs_mule, encode_invocation_designation)
14719 (encode_designation_at_bol, encode_coding_iso_2022)
14720 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14721 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14722 Declare EMACS_INT.
14723 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14724 (encode_invocation_designation): Last argument P_NCHARS is now
14725 EMACS_INT.
14726 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14727 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14728
14729 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14730 All users changed.
14731
14732 * ccl.c (Fccl_execute_on_string): Declare some variables
14733 EMACS_INT.
14734
8546720e 147352011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
14736
14737 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14738
4e19a977
CS
147392011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14740
14741 * process.c (Fformat_network_address): Doc fix.
14742
87302331
R
147432011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14744
ee7683eb 14745 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 14746
cbb59342
CY
147472011-04-08 Chong Yidong <cyd@stupidchicken.com>
14748
14749 * keyboard.c (read_char): Call Lisp function help-form-show,
14750 instead of using internal_with_output_to_temp_buffer.
14751 (Qhelp_form_show): New var.
e0d38eeb 14752 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
14753
14754 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14755
14756 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14757
e67a13ab
CY
147582011-04-06 Chong Yidong <cyd@stupidchicken.com>
14759
04f2d78b
CB
14760 * process.c (Flist_processes): Remove to Lisp.
14761 (list_processes_1): Delete.
e67a13ab 14762
973f782d
EZ
147632011-04-06 Eli Zaretskii <eliz@gnu.org>
14764
7c106b1e
EZ
14765 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14766
973f782d
EZ
14767 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14768
41cf7d1a 147692011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 14770
ca23cc88
PE
14771 Fix more problems found by GCC 4.6.0's static checks.
14772
f390e2d5
PE
14773 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14774
42eea0d0
PE
14775 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14776
b69769da 14777 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 14778
f9541e84
PE
14779 * xdisp.c (vmessage): Mark as a printf-like function.
14780
13841b55
PE
14781 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14782
c136c10f
PE
14783 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14784
5e2d4a30
PE
14785 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14786 printf-like functions.
14787 (tiff_load): Add casts to remove these marks before passing them
14788 to system-supplied API.
14789
583f48b9
PE
14790 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14791
b25d760e
PE
14792 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14793 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
14794 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14795 directly, rather than having caller test rule sign. This avoids
14796 some unnecessary tests.
14797 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14798 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14799 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 14800
bc7b6697 14801 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 14802 (xfont_open): Avoid unnecessary tests.
bc7b6697 14803
27ccc379
PE
14804 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14805
dcd5c89a
PE
14806 * composite.h, composite.c (composition_gstring_put_cache):
14807 Use EMACS_INT, not int, for length.
14808
b13a45c6
PE
14809 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14810 breaking out part of COMPOSITION_DECODE_RULE.
14811 (COMPOSITION_DECODE_RULE): Use it.
14812 * composite.c (get_composition_id): Remove unused local vars,
14813 by using the new macro.
14814
1e792e4d
PE
14815 * textprop.c (set_text_properties_1): Change while to do-while,
14816 since the condition is always true at first.
14817
dc6c6455 14818 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
14819 (interval_deletion_adjustment): Return unsigned value.
14820 All uses changed.
dc6c6455 14821
aba7731a
PE
14822 * process.c (list_processes_1, create_pty, read_process_output):
14823 (exec_sentinel): Remove vars that were set but not used.
afd4052b 14824 (create_pty): Remove unnecessary "volatile"s.
bc57d757 14825 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 14826 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 14827 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 14828
fdfc4bf3
PE
14829 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14830
fca8fe46 14831 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 14832 (update_syntax_table): Use unsigned instead of int.
fca8fe46 14833
06a0259a 14834 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 14835 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 14836 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 14837
e7b9e80f
PE
14838 * print.c (print_error_message): Avoid int overflow.
14839
56201685
PE
14840 * font.c (font_list_entities): Redo for clarity,
14841 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14842
78834453 14843 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 14844 (font_score): Avoid potential overflow in diff calculation.
78834453 14845
0bc0b309 14846 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 14847 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 14848
e610eaca
PE
14849 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14850
b895abce
PE
14851 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14852 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14853 can always succeed if overflow has undefined behavior.
14854
1f1d9321 14855 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 14856 (wordify): Omit three unnecessary tests.
1f1d9321 14857
c59478bc
PE
14858 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14859 All callers changed. This avoids the need for an unused var.
14860
79b73827
PE
14861 * casefiddle.c (casify_region): Remove var that is set but not used.
14862
a4db5dfe
PE
14863 * dired.c (file_name_completion): Remove var that is set but not used.
14864
43aae36e
PE
14865 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14866
2a47c44d 14867 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 14868 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 14869
a37c69bf
PE
14870 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14871 Check for integer overflow on size calculations.
14872
328ab8e7
PE
14873 * buffer.c (Fprevious_overlay_change): Remove var that is set
14874 but not used.
14875
e5a2a5cb
PE
14876 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14877 Remove vars that are set but not used.
8d84a6eb 14878 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 14879 (timer_check_2): Mark vars as initialized.
e5a2a5cb 14880
a60e5f68
PE
14881 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14882
f661cb61 14883 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 14884 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 14885
f0397f5a
PE
14886 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14887 that are set but not used.
14888
8664db06 14889 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 14890 if XCreateBitmapFromData fails (Bug#8410).
8664db06 14891
6abdaa4a
PE
14892 * xselect.c (x_get_local_selection, x_handle_property_notify):
14893 Remove vars that are set but not used.
14894
0ce7538d 14895 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 14896 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 14897
9ae848fc
PE
14898 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14899 Remove var that is set but not used.
0b918413
PE
14900 (scroll_bar_windows_size): Now size_t, not int.
14901 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14902 Check for overflow.
9ae848fc 14903
a5a62657
PE
14904 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14905 (map_tty_color) [!defined MSDOS]: Likewise.
14906
5c5cdd39
PE
14907 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14908
66ebf983
PE
14909 * coding.c: Remove vars that are set but not used.
14910 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14911 All callers changed.
14912 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14913 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14914 (decode_coding_charset): Remove vars that are set but not used.
14915
1be4d761
PE
14916 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14917 that is set but not used.
14918
47553fa8
PE
14919 * print.c (print_object): Remove var that is set but not used.
14920
1f7196bf 14921 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
14922 The gnulib version avoids calling malloc in the usual case,
14923 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
14924 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
14925 * filelock.c (current_lock_owner): Likewise.
14926 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
14927 * sysdep.c: Include allocator.h, careadlinkat.h.
14928 (emacs_no_realloc_allocator): New static constant.
14929 (emacs_readlink): New function.
fdb61804
PE
14930 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
14931 ../lib/careadlinkat.h.
d1fdcab7 14932
f84c17c7
SM
149332011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
14934
14935 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
14936 first non-nil return value).
14937
ef3862ad
JD
149382011-04-03 Jan Djärv <jan.h.d@swipnet.se>
14939
14940 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
14941 if not defined (Bug#8403).
14942
376a7006
JB
149432011-04-02 Juanma Barranquero <lekktu@gmail.com>
14944
14945 * xdisp.c (display_count_lines): Remove parameter `start',
14946 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
14947 (get_char_face_and_encoding): Remove parameter `multibyte_p',
14948 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14949 (fill_stretch_glyph_string): Remove parameters `row' and `area',
14950 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
14951 and thereabouts. All callers changed.
14952 (get_per_char_metric): Remove parameter `f', unused since
14953 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
14954
6ca3801d
JM
149552011-04-02 Jim Meyering <meyering@redhat.com>
14956
14957 do not dereference NULL upon failed strdup
14958 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
14959 (ns_get_family): Likewise.
14960
d8e2b5ba
JB
149612011-04-02 Juanma Barranquero <lekktu@gmail.com>
14962
14963 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
14964
8c74fcbd
JD
149652011-04-02 Jan Djärv <jan.h.d@swipnet.se>
14966
14967 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
14968 later (Bug#8403).
14969
7200d79c
SM
149702011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
14971
03408648 14972 Add lexical binding.
7200d79c 14973
03408648
SM
14974 * window.c (Ftemp_output_buffer_show): New fun.
14975 (Fsave_window_excursion):
14976 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
14977
14978 * lread.c (lisp_file_lexically_bound_p): New function.
14979 (Fload): Bind Qlexical_binding.
14980 (readevalloop): Remove `evalfun' arg.
14981 Bind Qinternal_interpreter_environment.
14982 (Feval_buffer): Bind Qlexical_binding.
14983 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
14984 Mark as dynamic.
14985 (syms_of_lread): Declare `lexical-binding'.
14986
14987 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
14988
14989 * keyboard.c (eval_dyn): New fun.
14990 (menu_item_eval_property): Use it.
ca105506
SM
14991
14992 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 14993
03408648
SM
14994 * fns.c (concat, mapcar1): Accept byte-code-functions.
14995
14996 * eval.c (Fsetq): Handle lexical vars.
14997 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
14998 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
14999 (FletX, Flet): Obey lexical binding.
15000 (Fcommandp): Handle closures.
15001 (Feval): New `lexical' arg.
15002 (eval_sub): New function extracted from Feval. Use it almost
15003 everywhere where Feval was used. Look up vars in lexical env.
15004 Handle closures.
15005 (Ffunctionp): Move from subr.el.
15006 (Ffuncall): Handle closures.
15007 (apply_lambda): Remove `eval_flags'.
15008 (funcall_lambda): Handle closures and new byte-code-functions.
15009 (Fspecial_variable_p): New function.
15010 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15011 but without exporting it to Lisp.
23aba0ea 15012
23aba0ea 15013 * doc.c (Fdocumentation, store_function_docstring):
03408648 15014 * data.c (Finteractive_form): Handle closures.
23aba0ea 15015
03408648
SM
15016 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15017 interactive spec.
ba83908c 15018
04f2d78b
CB
15019 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15020 New byte-codes.
03408648
SM
15021 (exec_byte_code): New function extracted from Fbyte_code to handle new
15022 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 15023
03408648 15024 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 15025
03408648 15026 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 15027
e2abce01
JB
150282011-03-31 Juanma Barranquero <lekktu@gmail.com>
15029
15030 * xdisp.c (redisplay_internal): Fix prototype.
15031
63696a73 150322011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 15033
63696a73 15034 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
15035 (try_scrolling): Use it when setting scroll_limit.
15036 Limit scrolling to 100 screen lines.
63696a73
EZ
15037 (redisplay_window): Even when falling back on "recentering",
15038 position point in the window according to scroll-conservatively,
15039 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15040
15041 (try_scrolling): When point is above the window, allow searching
15042 as far as scroll_max, or one screenful, to compute vertical
15043 distance from PT to the scroll margin position. This prevents
15044 try_scrolling from unnecessarily failing when
15045 scroll-conservatively is set to a value slightly larger than the
15046 window height. Clean up the case of PT below the margin at bottom
15047 of window: scroll_max can no longer be INT_MAX. When aggressive
15048 scrolling is in use, don't let point enter the opposite scroll
15049 margin as result of the scroll.
15050 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
15051 threshold of 100 lines for never-recentering scrolling.
15052
e4cc2dfc
JB
150532011-03-31 Juanma Barranquero <lekktu@gmail.com>
15054
15055 * dispextern.h (move_it_by_lines):
15056 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15057 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15058 (message_log_check_duplicate): Remove parameters `prev_bol' and
15059 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15060 (redisplay_internal): Remove parameter `preserve_echo_area',
15061 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15062
15063 * indent.c (Fvertical_motion):
15064 * window.c (window_scroll_pixel_based, Frecenter):
15065 Don't pass `need_y_p' to `move_it_by_lines'.
15066
1c470562
SM
150672011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15068
44f230aa
SM
15069 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15070 steal a few bits to be more compact.
15071 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15072 Remove unneeded casts.
15073
1c470562
SM
15074 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15075
888adce9
ZK
150762011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15077
15078 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15079 binding" message (bug#7967).
15080
f838ed7b
PE
150812011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15082
77861b95
PE
15083 Fix more problems found by GCC 4.6.0's static checks.
15084
de6dbc14
PE
15085 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15086 Remove unused local var.
15087
f838ed7b
PE
15088 * editfns.c (Fmessage_box): Remove unused local var.
15089
792c7b2b
PE
15090 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15091 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15092 Omit unused local vars.
c499e557 15093 * window.c (shrink_windows): Omit unused local var.
b01a1c29 15094 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
15095 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15096 Omit unused local var.
15097
ba0165e1
PE
15098 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15099 Don't assume string length fits in int.
32ad8845 15100 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 15101 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 15102
3c59b4c9
PE
15103 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15104 instead of alloca (Bug#8344).
15105
a3eed478 15106 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 15107 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 15108
eb4d412d
PE
15109 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15110
1658b401
PE
15111 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15112 concerns.
15113
15114 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15115
15116 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 15117
9a2c6e05
PE
15118 * keyboard.c (syms_of_keyboard): Use the same style as later
15119 in this function when indexing through an array. This also
15120 works around GCC bug 48267.
15121
03d0a109
PE
15122 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15123
44f730c8
PE
15124 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15125
fe75f926
PE
15126 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15127 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15128
ffa8c828
PE
15129 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15130 This avoids undefined behavior on integer overflow, and is a bit
15131 more convenient anyway since it is compared to a size_t variable.
15132
c5101a77
PE
15133 Variadic C functions now count arguments with size_t, not int.
15134 This avoids an unnecessary limitation on 64-bit machines, which
15135 caused (substring ...) to crash on large vectors (Bug#8344).
15136 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15137 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 15138 All variadic functions and their callers changed accordingly.
c5101a77
PE
15139 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15140 * data.c (arith_driver, float_arith_driver): Likewise.
15141 * editfns.c (general_insert_function): Likewise.
15142 * eval.c (struct backtrace.nargs, interactive_p)
15143 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15144 (funcall_lambda, mark_backtrace): Likewise.
15145 * fns.c (concat): Likewise.
15146 * frame.c (x_set_frame_parameters): Likewise.
15147 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15148 0 if not found, not -1. All callers changed.
15149
dd3f25f7
PE
15150 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15151 (stack_copy_size): Now size_t, not int.
15152 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15153
461c2ab9
JB
151542011-03-28 Juanma Barranquero <lekktu@gmail.com>
15155
15156 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15157 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15158 All callers changed.
15159
15160 * lisp.h (multibyte_char_to_unibyte):
15161 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15162 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15163 * character.h (CHAR_TO_BYTE8):
15164 * cmds.c (internal_self_insert):
15165 * editfns.c (general_insert_function):
15166 * keymap.c (push_key_description):
15167 * search.c (Freplace_match):
15168 * xdisp.c (message_dolog, set_message_1): All callers changed.
15169
f6d62986
SM
151702011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15171
15172 * keyboard.c (safe_run_hook_funcall): New function.
15173 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15174 don't set the hook to nil, but remove the offending function instead.
15175 (Qcommand_hook_internal): Remove, unused.
15176 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15177 Vcommand_hook_internal.
15178
15179 * eval.c (enum run_hooks_condition): Remove.
15180 (funcall_nil, funcall_not): New functions.
15181 (run_hook_with_args): Call each function through a `funcall' argument.
15182 Remove `cond' argument, now redundant.
15183 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15184 (Frun_hook_with_args_until_failure): Adjust accordingly.
15185 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15186
1db5b1ad
JB
151872011-03-28 Juanma Barranquero <lekktu@gmail.com>
15188
15189 * dispextern.h (string_buffer_position): Remove declaration.
15190
15191 * print.c (strout): Remove parameter `multibyte', unused since
15192 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15193
15194 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15195 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15196 All callers changed.
15197
15198 * w32.c (_wsa_errlist): Use braces for struct initializers.
15199
15200 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15201 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15202 All callers changed.
15203 (string_buffer_position): Likewise. Also, make static (it's never
15204 used outside xdisp.c).
15205 (cursor_row_p): Remove parameter `w', unused since
15206 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15207 (decode_mode_spec): Remove parameter `precision', introduced during
15208 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15209 All callers changed.
15210
5ffb62aa
JD
152112011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15212
15213 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15214
461c2ab9 152152011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
15216
15217 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15218 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15219 (ns_update_auto_hide_menu_bar): New functions.
15220 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15221 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15222 ns_constrain_all_frames.
15223 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15224 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15225
5c380ffb
JD
152262011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15227
15228 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15229
9af30bdf
GM
152302011-03-27 Glenn Morris <rgm@gnu.org>
15231
15232 * syssignal.h: Replace RETSIGTYPE with void.
15233 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15234 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15235 Replace SIGTYPE with void everywhere.
15236 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15237 * s/template.h (SIGTYPE): Remove commented out definition.
15238
e2abce01
JB
152392011-03-26 Eli Zaretskii <eliz@gnu.org>
15240
15241 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15242 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15243
f868cd8a
JB
152442011-03-26 Juanma Barranquero <lekktu@gmail.com>
15245
59eb0929
JB
15246 * w32.c (read_unc_volume): Use parameter `henum', instead of
15247 global variable `wget_enum_handle'.
15248
15249 * keymap.c (describe_vector): Remove parameters `indices' and
15250 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15251 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15252
f868cd8a
JB
15253 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15254
15255 * keyboard.c (timer_check): Remove parameter `do_it_now',
15256 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15257 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15258 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15259
15260 * keyboard.c (read_char):
15261 * w32menu.c (w32_menu_display_help):
15262 * xmenu.c (show_help_event, menu_help_callback):
15263 Adjust calls to `show_help_echo'.
15264
15265 * gtkutil.c (xg_maybe_add_timer):
15266 * keyboard.c (readable_events):
15267 * process.c (wait_reading_process_output):
15268 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15269
15270 * insdel.c (adjust_markers_gap_motion):
15271 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15272 (gap_left, gap_right): Don't call it.
15273
2ecf6fdb
CY
152742011-03-25 Chong Yidong <cyd@stupidchicken.com>
15275
15276 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15277 incurred during fontification.
15278
6b1f9ba4
JB
152792011-03-25 Juanma Barranquero <lekktu@gmail.com>
15280
15281 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15282 (DEFVAR_PER_BUFFER): Don't pass it.
15283
15284 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15285 (scrolling_window): Don't pass it.
15286
0f4a96b5
JB
152872011-03-25 Juanma Barranquero <lekktu@gmail.com>
15288
15289 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15290
15291 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15292 and `suffix'.
15293 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15294 of variables specific to SELinux and computation of `encoded_absname'.
15295
15296 * image.c (XPutPixel): Remove unused variable `height'.
15297
15298 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15299
15300 * unexw32.c (get_section_info): Remove unused variable `section'.
15301
15302 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15303 (system_process_attributes): Remove unused variable `sess'.
15304 (sys_read): Remove unused variable `err'.
15305
15306 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15307 (w32_wnd_proc): Remove unused variable `isdead'.
15308 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15309 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15310 (x_create_tip_frame): Remove unused variable `tem'.
15311
15312 * w32inevt.c (w32_console_read_socket):
15313 Remove unused variable `no_events'.
15314
15315 * w32term.c (x_draw_composite_glyph_string_foreground):
15316 Remove unused variable `width'.
15317
1149507c
JB
153182011-03-24 Juanma Barranquero <lekktu@gmail.com>
15319
15320 * w32term.c (x_set_glyph_string_clipping):
15321 Don't pass uninitialized region to CombineRgn.
15322
9c88f339
JB
153232011-03-23 Juanma Barranquero <lekktu@gmail.com>
15324
15325 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15326 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15327 (Fx_close_connection): Remove unused variable `i'.
15328
15329 * w32font.c (w32font_draw): Return number of glyphs.
15330 (w32font_open_internal): Remove unused variable `i'.
15331 (w32font_driver): Add missing initializer.
15332
15333 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15334 (fill_in_menu): Remove unused variable `items_added'.
15335
15336 * w32term.c (last_mouse_press_frame): Remove static global variable.
15337 (w32_clip_to_row): Remove unused variable `f'.
15338 (x_delete_terminal): Remove unused variable `i'.
15339
15340 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15341 (NOTHING): Remove unused static global variable.
15342 (uniscribe_check_otf): Remove unused variable `table'.
15343 (uniscribe_font_driver): Add missing initializers.
15344
dee091a3
JD
153452011-03-23 Julien Danjou <julien@danjou.info>
15346
15347 * term.c (Fsuspend_tty, Fresume_tty):
15348 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15349 * window.c (temp_output_buffer_show):
15350 * insdel.c (signal_before_change):
15351 * frame.c (Fhandle_switch_frame):
15352 * fileio.c (Fdo_auto_save):
15353 * emacs.c (Fkill_emacs):
15354 * editfns.c (save_excursion_restore):
15355 * cmds.c (internal_self_insert):
15356 * callint.c (Fcall_interactively):
15357 * buffer.c (Fkill_all_local_variables):
15358 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15359 Use Frun_hooks.
0f4a96b5 15360 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 15361 unconditionally since it does the check itself.
dee091a3 15362
2c520ab5 153632011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 15364
c9c49752
PE
15365 Fix more problems found by GCC 4.5.2's static checks.
15366
8abc3f12
PE
15367 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15368 the first time through the loop, since we know p0 < p1 then.
15369 This also avoids a gcc -Wstrict-overflow warning.
15370
a2d26660
PE
15371 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15372 leading to a memory leak, possible in functions like
15373 load_charset_map_from_file that can allocate an unbounded number
b12ef411 15374 of objects (Bug#8318).
a2d26660 15375
916c72e9
PE
15376 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15377 that could (at least in theory) be that large.
15378
19ab8a18
PE
15379 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15380 This is less likely to overflow, and avoids undefined behavior if
15381 overflow does occur. All callers changed. Use strtoul to scan
15382 for the unsigned long integer.
b7cbbd6f
PE
15383 (pint2hrstr): Simplify and tune code slightly.
15384 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 15385
f0641eff
PE
15386 * scroll.c (do_scrolling): Work around GCC bug 48228.
15387 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15388
7f650bb9
PE
15389 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15390 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
15391 (validate_x_resource_name): Simplify count usage.
15392 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 15393
37dd57d1
PE
15394 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15395 fail (Bug#8306).
81e56e61 15396
699979fc 15397 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 15398
401bf9b4
PE
15399 * process.c (Fmake_network_process): Use socklen_t, not int,
15400 where POSIX says socklen_t is required in portable programs.
15401 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 15402 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
15403 (Fmake_network_process, server_accept_connection):
15404 (wait_reading_process_output, read_process_output):
15405 Likewise.
15406
b93aacde
PE
15407 * process.c: Rename or move locals to avoid shadowing.
15408 (list_processes_1, Fmake_network_process):
15409 (read_process_output_error_handler, exec_sentinel_error_handler):
15410 Rename or move locals.
4dc343ee 15411 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 15412 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 15413 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 15414 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 15415 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 15416
af8a867c 15417 Make tparam.h and terminfo.c consistent.
44f230aa
SM
15418 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15419 Include tparam.h instead, since it declares them.
af8a867c
PE
15420 * cm.h (PC): Remove extern decl; tparam.h now does this.
15421 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15422 * terminfo.c: Include tparam.h, to check interfaces.
15423 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15424 (tparam): Adjust signature to match interface in tparam.h;
15425 this removes some undefined behavior. Check that outstring and len
15426 are zero, which they always are with Emacs.
15427 * tparam.h (PC, BC, UP): New extern decls.
15428
0248044d 15429 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 15430 (xftfont_open): Rename locals to avoid shadowing.
0248044d 15431
8ff096c1 15432 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
15433 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15434 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 15435 (ftfont_list): Remove unused local.
49eaafba
PE
15436 (get_adstyle_property, ftfont_pattern_entity):
15437 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15438 Rename locals to avoid shadowing.
8ff096c1 15439
e2be39f6
PE
15440 * xfont.c (xfont_list_family): Mark var as initialized.
15441
c9735e30
PE
15442 * xml.c (make_dom): Now static.
15443
8f5201ae
PE
15444 * composite.c (composition_compute_stop_pos): Rename local to
15445 avoid shadowing.
b246f932
PE
15446 (composition_reseat_it): Remove unused locals.
15447 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 15448 (composition_update_it): Mark var as initialized.
11b61122
PE
15449 (find_automatic_composition): Mark vars as initialized,
15450 with a FIXME (Bug#8290).
8f5201ae 15451
760fbc2c
PE
15452 character.h: Rename locals to avoid shadowing.
15453 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15454 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15455 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15456 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15457 to avoid shadowing.
15458
ff08eb85
PE
15459 * textprop.c (property_change_between_p): Remove; unused.
15460
fc7bf025
PE
15461 * intervals.c (interval_start_pos): Now static.
15462
235d7abc
PE
15463 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15464
44f230aa
SM
15465 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15466 Rename locals to avoid shadowing.
3e7d6594 15467
50060332
PE
15468 * sound.c (wav_play, au_play, Fplay_sound_internal):
15469 Fix pointer signedness.
d01f234b 15470 (alsa_choose_format): Remove unused local var.
c83b8872
PE
15471 (wav_play): Initialize a variable to 0, to prevent undefined
15472 behavior (Bug#8278).
50060332 15473
c4fc4e30
PE
15474 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15475
918436ed
PE
15476 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15477
c939f91b
PE
15478 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15479 clobbering (Bug#8298).
b9c7f648
PE
15480 * sysdep.c (sys_subshell): Likewise.
15481 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 15482
6bd8c144
PE
15483 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15484 This should get cleaned up, so that child_setup has the
15485 same signature on all platforms.
15486
7710357c 15487 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 15488 (relocate_fd): Rename locals to avoid shadowing.
7710357c 15489
c59da222
CY
154902011-03-22 Chong Yidong <cyd@stupidchicken.com>
15491
15492 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15493 not to be necessary, and produces flickering.
15494
66b87493
GM
154952011-03-20 Glenn Morris <rgm@gnu.org>
15496
15497 * config.in: Remove file.
15498
45b6f6d5
JB
154992011-03-20 Juanma Barranquero <lekktu@gmail.com>
15500
15501 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15502 are now in src/globals.h.
15503 (syms_of_minibuf): Remove spurious & from previous change.
15504
cd394be1 155052011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
15506
15507 * minibuf.c (completing-read-function): New variable.
15508 (completing-read-default): Rename from completing-read.
15509 (completing-read): Call completing-read-function.
15510
b14e3e21
CY
155112011-03-19 Juanma Barranquero <lekktu@gmail.com>
15512
15513 * xfaces.c (Fx_load_color_file):
15514 Read color file from absolute filename (bug#8250).
15515
f2b726e6
JB
155162011-03-19 Juanma Barranquero <lekktu@gmail.com>
15517
15518 * makefile.w32-in: Update dependencies.
15519
09f6ff02
EZ
155202011-03-17 Eli Zaretskii <eliz@gnu.org>
15521
15522 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15523
29a6015a
PE
155242011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15525
a3a6c54e
PE
15526 Fix more problems found by GCC 4.5.2's static checks.
15527
b766f867
PE
15528 * process.c (make_serial_process_unwind, send_process_trap):
15529 (sigchld_handler): Now static.
15530
be02381c
PE
15531 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15532 That way, the code declares only the vars that it needs.
15533 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15534 * s/cygwin.h (PTY_ITERATION): Likewise.
15535 * s/darwin.h (PTY_ITERATION): Likewise.
15536 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15537
57048744
PE
15538 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15539 * process.c (allocate_pty): Don't declare stb unless it's needed.
15540
7914961c 15541 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
15542 (CONSTANTLIM): Remove; unused.
15543 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15544 Define only if needed.
7914961c 15545
b3967b18
PE
15546 * unexelf.c (unexec): Name an expression,
15547 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
15548 Use a different way to cause a compilation error if anyone uses
15549 n rather than nn, a way that does not involve shadowing.
73366a00 15550 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 15551
29a6015a
PE
15552 * deps.mk (unexalpha.o): Remove; unused.
15553
43cfc33e 15554 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 15555 * unexec.h: New file.
ce701a33
PE
15556 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15557 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15558 Depend on unexec.h.
15559 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15560 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15561 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 15562 Change as necessary to match prototype in unexec.h.
ce701a33 15563
01f44d5a
PE
15564 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15565 shadowing.
4f63c6bb 15566 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 15567
a6670b0b
PE
15568 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15569 Rename locals to avoid shadowing.
15570
cef2010d 15571 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 15572 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 15573
d4d7173a
PE
15574 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15575
f08b802a
PE
15576 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15577 warning when compiling print.c.
15578
3ddb0639
PE
15579 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15580 instead of using an uninitialized var.
5ad03b97 15581 (font_sort_entities): Mark var as initialized.
3ddb0639 15582
170a2692
PE
15583 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15584
e663c700
PE
15585 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15586 pointers to constants.
89bc529a 15587 (font_parse_fcname): Remove unused vars.
7b81e2d0 15588 (font_delete_unmatched): Now static.
ea838e10 15589 (font_get_spec): Remove; unused.
13a547c6
PE
15590 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15591 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15592 Rename or move locals to avoid shadowing.
e663c700 15593
2a80c887 15594 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 15595 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 15596
1384fa33 15597 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 15598 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 15599
8b2c52e9
PE
15600 * alloc.c (mark_backtrace): Move decl from here ...
15601 * lisp.h: ... to here, so that it can be checked.
15602
475545b5 15603 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 15604 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
15605 (lisp_indirect_variable): Name an expression,
15606 to avoid gcc -Wbad-function-cast warning.
1faed8ae 15607 (Fdefvar): Rename locals to avoid shadowing.
475545b5 15608
b1349114 15609 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 15610 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 15611 Use const pointer when appropriate.
b1349114 15612
a2928364
PE
15613 * lisp.h (get_system_name, get_operating_system_release):
15614 Move decls here, to check interfaces.
15615 * process.c (get_operating_system_release): Move decl to lisp.h.
15616 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
15617 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15618 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15619 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
15620 (Fformat_time_string, Fencode_time, Finsert_char):
15621 (Ftranslate_region_internal, Fformat):
15622 Rename or remove local vars to avoid shadowing.
9710023e 15623 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 15624
a415e694
PE
15625 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15626 avoid shadowing.
15627
8ef4622d
PE
15628 * lisp.h (eassert): Check that the argument compiles, even if
15629 ENABLE_CHECKING is not defined.
15630
946f9a5b
PE
15631 * data.c (Findirect_variable): Name an expression, to avoid
15632 gcc -Wbad-function-cast warning.
112396d6 15633 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 15634 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
15635 (Fmake_variable_buffer_local, Fmake_local_variable):
15636 Mark variables as initialized.
52746918 15637 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 15638
e5aab7e7 15639 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
15640 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15641 Rename locals to avoid shadowing.
dff45157
PE
15642 (mark_stack): Move local variables into the #ifdef region where
15643 they're used.
7bc26fdb
PE
15644 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15645 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15646 needed otherwise.
15647 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15648 (GC_STRING_CHARS): Remove; not used.
d40d4be1 15649 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 15650
e5aab7e7
PE
15651 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15652 avoids undefined behavior in theory.
15653
4da60324
PE
15654 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15655
88043301
PE
15656 Use functions, not macros, for up- and down-casing (Bug#8254).
15657 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15658 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15659 to use the following functions instead of these macros.
15660 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15661 EMACS_INT, since callers assume the returned value fits in int.
15662 (upcase1): Likewise, for UPCASE_TABLE.
15663 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 15664 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 15665 the race-condition problem in the old DOWNCASE.
88043301 15666
19ed5445
PE
15667 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15668 Rename locals to avoid shadowing.
15669 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
15670 (regex_compile, re_search_2, re_match_2_internal):
15671 Remove unused local vars.
952db0d7
PE
15672 (FREE_VAR): Rewrite so as not to use empty "else",
15673 which gcc can warn about.
da053e48 15674 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
15675 (RETALLOC_IF): Define only if needed.
15676 (WORDCHAR_P): Likewise. This one is never needed, but is used
15677 only in a comment talking about a compiler bug, so put inside
15678 the #if 0 of that comment.
15679 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15680 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15681 Remove; unused.
19ed5445 15682
1f3561e4 15683 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
15684 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15685 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 15686
ded6f8f7
PE
15687 * search.c (simple_search): Remove unused var.
15688
dbd37a95
PE
15689 * dired.c (compile_pattern): Move decl from here ...
15690 * lisp.h: ... to here, so that it can be checked.
15691 (struct re_registers): New forward decl.
15692
7e47afad
PE
15693 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15694
85f24f61
PE
15695 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15696 All uses changed.
15697 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15698 Rename locals to avoid shadowing.
5671df8f 15699 (Fvertical_motion): Mark locals as initialized.
85f24f61 15700
181aa2be 15701 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 15702 (casify_region): Mark local as initialized.
181aa2be 15703
930d429c
PE
15704 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15705
7082eac6
PE
15706 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15707 New macros, so that the caller can use some names other than
15708 gcpro1, gcpro2, etc.
15709 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15710 of the new macros.
15711 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15712 argument, for consistency with GCPRO2_VAR, etc: it is now the
15713 prefix of the variable, not the variable itself. All uses
15714 changed.
38b2c076
PE
15715 * dired.c (directory_files_internal, file_name_completion):
15716 Rename locals to avoid shadowing.
15717
15206ed9
PE
15718 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15719 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15720 dired.c's scmp function, had undefined behavior.
15721 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15722 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15723 * buffer.h: ... to here, because these macros use current_buffer,
15724 and the new implementation with inline functions needs to have
15725 current_buffer in scope now, rather than later when the macros
15726 are used.
15727 (downcase, upcase1): New static inline functions.
15728 (DOWNCASE, UPCASE1): Reimplement using these functions.
15729 This avoids undefined behavior in expressions like
15730 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15731 from race conditions in accessing the global variables
15732 case_temp1 and case_temp2.
15733 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15734 * lisp.h (case_temp1, case_temp2): Remove their decls.
15735 * character.h (ASCII_CHAR_P): Move from here ...
15736 * lisp.h: ... to here, so that the inline functions mentioned
15737 above can use them.
15738
4a6bea26
PE
15739 * dired.c (directory_files_internal_unwind): Now static.
15740
f14b7e14
PE
15741 * fileio.c (file_name_as_directory, directory_file_name):
15742 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15743 Now static.
2893f146
PE
15744 (file_name_as_directory): Use const pointers when appropriate.
15745 (Fexpand_file_name): Likewise. In particular, newdir might
15746 point at constant storage, so make it a const pointer.
fd4ead52 15747 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
15748 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15749 signedness issues.
f839df0c
PE
15750 (Fset_file_times, Finsert_file_contents, auto_save_error):
15751 Rename locals to avoid shadowing.
f14b7e14 15752
5716756e 15753 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
15754 (Ftry_completion, Fall_completions): Rename or remove locals
15755 to avoid shadowing.
5716756e 15756
b4c3046a
PE
15757 * marker.c (bytepos_to_charpos): Remove; unused.
15758
b45db522
PE
15759 * lisp.h (verify_bytepos, count_markers): New decls,
15760 so that gcc does not warn that these functions aren't declared.
15761
85876d07
PE
15762 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15763 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 15764 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 15765 (copy_text): Remove unused local var.
85876d07 15766
03d78a21 15767 * filelock.c (within_one_second): Now static.
b3dd38ab 15768 (lock_file_1): Rename local to avoid shadowing.
03d78a21 15769
5df8f01b
PE
15770 * buffer.c (fix_overlays_before): Mark locals as initialized.
15771 (fix_start_end_in_overlays): Likewise. This function should be
15772 simplified by using pointers-to-pointers, but that's a different
15773 matter.
b1d876f1 15774 (switch_to_buffer_1): Now static.
8f54f30a
PE
15775 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15776 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 15777
a70072c9 15778 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 15779 Fix pointer signedness issue.
edced198
PE
15780 (sys_subshell): Mark local as volatile if checking for lint,
15781 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 15782 (MAXPATHLEN): Define only if needed.
a70072c9 15783
a0977c44
PE
15784 * process.c (serial_open, serial_configure): Move decls from here ...
15785 * systty.h: ... to here, so that they can be checked.
15786
a884fdcc
PE
15787 * fns.c (get_random, seed_random): Move extern decls from here ...
15788 * lisp.h: ... to here, so that they can be checked.
15789
604efe86 15790 * sysdep.c (reset_io): Now static.
b8950c94 15791 (wait_for_termination_signal): Remove; unused.
604efe86 15792
38fc62d9
PE
15793 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15794 (copy_keymap_item, append_key, push_text_char_description):
15795 Now static.
1004a21a 15796 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 15797 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
15798 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15799 (describe_map_tree):
15800 Rename locals to avoid shadowing.
38fc62d9 15801
2f2650da
PE
15802 * keyboard.c: Declare functions static if they are not used elsewhere.
15803 (echo_char, echo_dash, cmd_error, top_level_2):
15804 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
15805 (read_char, kbd_buffer_get_event, make_lispy_position):
15806 (make_lispy_event, make_lispy_movement, apply_modifiers):
15807 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15808 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15809 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 15810 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 15811 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 15812
a053e86c 15813 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
15814 (mark_kboards): Move decl here ...
15815 * alloc.c (mark_kboards): ... from here.
a053e86c 15816
4752793e
PE
15817 * lisp.h (force_auto_save_soon): New decl.
15818
74f10ca7 15819 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
15820 (DEFINE_DUMMY_FUNCTION): New macro.
15821 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15822 Use it.
c03cd23f
PE
15823 (main): Add casts to avoid warnings
15824 if GCC considers string literals to be constants.
74f10ca7 15825
022e70d4
PE
15826 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15827
59d6fe83
PE
15828 * dbusbind.c: Pointer signedness fixes.
15829 (xd_signature, xd_append_arg, xd_initialize):
15830 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15831 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15832 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15833 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15834
78320123
PE
15835 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15836 if GCC considers string literals to be constants.
49cebcca 15837 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 15838
35ac2a97
SM
158392011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15840
fb103ca9
SM
15841 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15842 (print_preprocess, print_object): New macro to fix last change.
15843
35ac2a97
SM
15844 * print.c (print_preprocess): Don't forget font objects.
15845
62973b41
JB
158462011-03-16 Juanma Barranquero <lekktu@gmail.com>
15847
15848 * emacs.c (USAGE3): Doc fixes.
15849
0e48bb22
AS
158502011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15851
15852 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15853 structure.
15854
7684e57b
JB
158552011-03-14 Juanma Barranquero <lekktu@gmail.com>
15856
15857 * lisp.h (VWindow_system, Qfile_name_history):
15858 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15859 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15860 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15861
15862 * w32select.c: Don't #include "keyboard.h".
c96bbc66 15863 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
15864
15865 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15866 * w32console.c (detect_input_pending, read_input_pending)
15867 (encode_terminal_code):
15868 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15869 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15870 (w32_system_caret_y, Qfile_name_history):
15871 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15872 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15873 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15874 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15875 * w32proc.c (Qlocal, report_file_error):
15876 * w32term.c (Vwindow_system, updating_frame):
15877 * w32uniscribe.c (initialized, uniscribe_font_driver):
15878 Remove unneeded extern declarations.
15879
2aa46d6c
CY
158802011-03-14 Chong Yidong <cyd@stupidchicken.com>
15881
c96bbc66 15882 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 15883
cffc6f3b
CY
158842011-03-13 Chong Yidong <cyd@stupidchicken.com>
15885
15886 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15887 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15888 These macros can no longer be used for assignment.
15889
44f230aa
SM
15890 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15891 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
15892 (record_buffer_markers, fetch_buffer_markers): New functions for
15893 recording and fetching special buffer markers.
15894 (set_buffer_internal_1, set_buffer_temp): Use them.
15895
15896 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15897
15898 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15899
15900 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15901 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15902
15903 * xdisp.c (hscroll_window_tree):
15904 (reconsider_clip_changes): Use PT instead of BUF_PT.
15905
d251f04b
EZ
159062011-03-13 Eli Zaretskii <eliz@gnu.org>
15907
15908 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15909 $(EMACS_ROOT)/lib/intprops.h.
15910
f0c77cd1
PE
159112011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15912
3eca4629
PE
15913 Fix more problems found by GCC 4.5.2's static checks.
15914
7c86ee98
PE
15915 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15916 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
15917 (xg_free_frame_widgets): Make it clear that a local variable is
15918 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
15919 (gdk_window_get_screen): Make it clear that this macro is needed
15920 only if USE_GTK_TOOLTIP.
1e5524e7
PE
15921 (int_gtk_range_get_value): New function, which avoids a diagnostic
15922 from gcc -Wbad-function-cast.
15923 (xg_set_toolkit_scroll_bar_thumb): Use it.
15924 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
15925 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
15926 (get_utf8_string, xg_get_file_with_chooser):
15927 Rename locals to avoid shadowing.
15928 (create_dialog): Move locals to avoid shadowing.
7c86ee98 15929
41729b81
PE
15930 * xgselect.c (xg_select): Remove unused var.
15931
f0c77cd1
PE
15932 * image.c (four_corners_best): Mark locals as initialized.
15933 (gif_load): Initialize transparent_p to zero (Bug#8238).
15934 Mark another local as initialized.
ec6cf4c6 15935 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 15936
ce0ad53d 15937 * image.c (clear_image_cache): Now static.
d5d5a617 15938 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 15939 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
15940 (x_edge_detection): Remove unnecessary cast that
15941 gcc -Wbad-function-cast diagnoses.
2037898d 15942 (gif_load): Fix pointer signedness.
6ae141d6
PE
15943 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
15944 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 15945
33383987 159462011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 15947
d32df629
PE
15948 Improve quality of tests for time stamp overflow.
15949 For example, without this patch (encode-time 0 0 0 1 1
15950 1152921504606846976) returns the obviously-bogus value (-948597
15951 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
15952 reports time overflow. See
15953 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
15954 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
15955 * editfns.c: Include limits.h and intprops.h.
15956 (TIME_T_MIN, TIME_T_MAX): New macros.
15957 (time_overflow): Move earlier, to before first use.
15958 (hi_time, lo_time): New functions, for an accurate test for
15959 out-of-range times.
15960 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
15961 (Fget_internal_run_time): Don't assume time_t fits in int.
15962 (make_time): Use list2 instead of Fcons twice.
15963 (Fdecode_time): More accurate test for out-of-range times.
15964 (check_tm_member): New function.
15965 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
15966 (lisp_time_argument): Don't rely on undefined left-shift and
15967 right-shift behavior when checking for time stamp overflow.
8be6f318 15968
fe31d94c
PE
15969 * editfns.c (time_overflow): New function, refactoring common code.
15970 (Fformat_time_string, Fdecode_time, Fencode_time):
15971 (Fcurrent_time_string): Use it.
15972
8be6f318
PE
15973 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
15974 * dired.c (make_time): Move to ...
15975 * editfns.c (make_time): ... here.
15976 * systime.h: Note the move.
15977
09d9db2c 159782011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 15979
126bc0dc
YM
15980 * fringe.c (update_window_fringes): Remove unused variables.
15981
c47cbdfd
YM
15982 * unexmacosx.c (copy_data_segment): Also copy __got section.
15983 (Bug#8223)
15984
7ac80be9
EZ
159852011-03-12 Eli Zaretskii <eliz@gnu.org>
15986
c96bbc66 15987 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
15988 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
15989 Constify `char *' arguments and their references according to
15990 prototypes in tparam.h.
15991
ecb0f94d 15992 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 15993
7ac80be9
EZ
15994 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
15995 Adapt all references accordingly.
15996
15997 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
15998
ef1fd07e
TT
159992011-03-11 Tom Tromey <tromey@redhat.com>
16000
16001 * buffer.c (syms_of_buffer): Remove obsolete comment.
16002
7ef4b50c
EZ
160032011-03-11 Eli Zaretskii <eliz@gnu.org>
16004
16005 * termhooks.h (encode_terminal_code): Declare prototype.
16006
16007 * msdos.c (encode_terminal_code): Don't declare prototype.
16008
16009 * term.c (encode_terminal_code): Now external again, used by
16010 w32console.c and msdos.c.
16011
44f230aa
SM
16012 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16013 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 16014
4b1ec863 160152011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 16016
1714f52b 16017 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 16018
4b1ec863
PE
16019 * fringe.c (update_window_fringes): Mark locals as initialized
16020 (Bug#8227).
16021 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 16022
524c7aa6
PE
16023 * alloc.c (mark_fringe_data): Move decl from here ...
16024 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16025 to check its interface.
16026 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16027
a5c0af81 16028 * fontset.c (free_realized_fontset): Now static.
7519b8cd 16029 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 16030 (fontset_font): Mark local as initialized.
a9a06e0b 16031 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 16032
b4716021
PE
16033 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16034
811e9bac 16035 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 16036 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
16037 (x_own_selection, Fx_disown_selection_internal): Rename locals
16038 to avoid shadowing.
16039 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 16040
7e3ab302
PE
16041 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16042 so that the caller can use some name other than gcpro1.
16043 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
16044 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16045 (Fx_backspace_delete_keys_p):
16046 Use them to avoid shadowing, and rename vars to avoid shadowing.
16047 (x_decode_color, x_set_name, x_window): Now static.
6b437900 16048 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 16049 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
16050 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16051 Remove unused locals.
7e3ab302
PE
16052 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16053 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16054 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16055 macros.
f78faa98 16056
e2b13473
PE
16057 * xterm.h (x_mouse_leave): New decl.
16058
77f23912
PE
16059 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16060 Remove unused functions.
cdf4ba58
PE
16061 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16062 (x_calc_absolute_position): Now static.
7411c686 16063 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 16064 Don't declare local "event" unless it's used.
ed7bf3a5
PE
16065 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16066 unless they are used.
38d0b34a
PE
16067 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16068 (x_fatal_error_signal): Remove; not used.
a6067996
PE
16069 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16070 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16071 (x_error_catcher, x_connection_closed, x_error_handler):
16072 (x_error_quitter, xembed_send_message, x_iconify_frame):
16073 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 16074 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 16075 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 16076
44f230aa
SM
16077 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16078 Rename or move locals to avoid shadowing.
6b463e58 16079 (tty_defined_color, merge_face_heights): Now static.
5967d051 16080 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
16081 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16082 does not deduce is never used uninitialized.
73719eba
PE
16083 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16084 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 16085
426994c3 16086 * terminal.c (store_terminal_param): Now static.
5489860b 16087
032f1620 16088 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 16089 (set_frame_menubar): Remove unused local.
d4323972 16090 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
16091 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16092 since they might point to immutable storage.
281585b0
PE
16093 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16094 since it's unused otherwise.
032f1620 16095
367c19e5 16096 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 16097 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
16098 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16099 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 16100 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
16101 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16102 does not deduce are never used uninitialized.
70739cbe 16103
07b48fa9
PE
16104 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16105
8868a238 16106 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
16107 * window.c (window_loop, size_window):
16108 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 16109
7e5cf297 16110 * window.c (display_buffer): Now static.
d6550a9f
PE
16111 (size_window): Mark variables that gcc -Wuninitialized
16112 does not deduce are never used uninitialized.
a586633d
PE
16113 * window.h (check_all_windows): New decl, to forestall
16114 gcc -Wmissing-prototypes diagnostic.
5b555da1 16115 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 16116
f6095868
PE
16117 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16118 shadowing.
16119 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
16120 Include <limits.h>.
16121 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16122 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
16123 (load_charset_map): Mark variables that gcc -Wuninitialized
16124 does not deduce are never used uninitialized.
53df7c11 16125 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 16126
f38b440c
PE
16127 * coding.c (coding_set_source, coding_set_destination):
16128 Use "else { /* comment */ }" rather than "else /* comment */;"
16129 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
16130 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16131 a block, when the outer 'i' will do.
16132 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16133 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16134 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16135 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16136 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16137 Rename locals to avoid shadowing.
16138 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
16139 * coding.c (emacs_mule_char, encode_invocation_designation):
16140 Now static, since they're not used elsewhere.
413bb2db 16141 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 16142 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
16143 (decode_coding_emacs_mule): Mark variables that gcc
16144 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
16145 (detect_coding_iso_2022): Initialize a local variable that might
16146 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 16147 this initialization is needed. (Bug#8211)
5f58e762
PE
16148 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16149 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16150 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16151 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16152 Remove unused macros.
f38b440c 16153
232b38b9 16154 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 16155 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 16156 * character.c (string_count_byte8): Likewise.
232b38b9 16157
fb90da1b
PE
16158 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16159 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16160
fb93dbc2
PE
16161 * chartab.c (copy_sub_char_table): Now static, since it's not used
16162 elsewhere.
5c156ace
PE
16163 (sub_char_table_ref_and_range, char_table_ref_and_range):
16164 Rename locals to avoid shadowing.
bbcd0949 16165 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 16166
7d3b3862 16167 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 16168 (BIDI_BOB): Remove unused macro.
7d3b3862 16169
6be7d3da
PE
16170 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16171 deduce are never used uninitialized.
c2ed9c8b 16172 * term.c (encode_terminal_code): Likewise.
6be7d3da 16173
75f8807f 16174 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 16175
50938595
PE
16176 * tparam.h: New file.
16177 * term.c, tparam.h: Include it.
16178 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16179 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16180 Move these decls to tparam.h, and make them agree with what
16181 is actually in tparam.c. The previous trick of using incompatible
16182 decls in different modules does not conform to the C standard.
16183 All callers of tparam changed to use tparam's actual API.
16184 * tparam.c (tparam1, tparam, tgoto):
16185 Use const pointers where appropriate.
16186
fbceeba2
PE
16187 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16188 * cm.h (struct cm): Likewise.
16189 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16190 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16191 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16192 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16193 (turn_on_face, init_tty): Likewise.
16194 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 16195
7f3f1250
PE
16196 * term.c (term_mouse_position): Rename local to avoid shadowing.
16197
e6ca6543
PE
16198 * alloc.c (mark_ttys): Move decl from here ...
16199 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16200
c40f8d15
AS
162012011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16202
16203 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16204
cfe0661d
JB
162052011-03-09 Juanma Barranquero <lekktu@gmail.com>
16206
16207 * search.c (compile_pattern_1): Remove argument regp, unused since
16208 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16209 (compile_pattern): Don't pass it.
16210
0afb4571
J
162112011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16212
16213 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16214 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16215 for ! HAVE_GTK3.
16216 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16217
16218 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16219
16220 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16221 gdk_window_get_screen, gdk_window_get_geometry,
16222 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16223 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16224 (xg_get_pixbuf_from_pixmap): New function.
16225 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16226 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16227 Call xg_get_pixbuf_from_pixmap instead of
16228 gdk_pixbuf_get_from_drawable.
16229 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16230 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16231 (xg_check_special_colors): Use GtkStyleContext and its functions
16232 for HAVE_GTK3.
16233 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16234 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16235 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
16236 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16237 Call gtk_widget_get_preferred_size.
0afb4571
J
16238 (xg_frame_resized): gdk_window_get_geometry only takes 5
16239 parameters.
44f230aa
SM
16240 (xg_win_to_widget, xg_event_is_for_menubar):
16241 Call gdk_x11_window_lookup_for_display.
0afb4571
J
16242 (xg_set_widget_bg): New function.
16243 (delete_cb): New function.
895009e1 16244 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 16245 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
16246 (xg_set_background_color): Call xg_set_widget_bg.
16247 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16248 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16249 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16250 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16251 if ! HAVE_GTK3.
16252 (update_frame_tool_bar): Call gtk_widget_hide.
16253 (xg_initialize): Use GDK_KEY_g.
16254
16255 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16256 if ! HAVE_GTK3
16257 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16258
16259 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16260 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16261 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16262
1c2cc4ef
JB
162632011-03-08 Juanma Barranquero <lekktu@gmail.com>
16264
16265 * w32xfns.c (select_palette): Check success of RealizePalette against
16266 GDI_ERROR, not zero.
16267
33383987 16268See ChangeLog.11 for earlier changes.
aac0c6e3
MR
16269
16270;; Local Variables:
16271;; coding: utf-8
aac0c6e3
MR
16272;; End:
16273
2f097256 16274 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
16275
16276 This file is part of GNU Emacs.
16277
16278 GNU Emacs is free software: you can redistribute it and/or modify
16279 it under the terms of the GNU General Public License as published by
16280 the Free Software Foundation, either version 3 of the License, or
16281 (at your option) any later version.
16282
16283 GNU Emacs is distributed in the hope that it will be useful,
16284 but WITHOUT ANY WARRANTY; without even the implied warranty of
16285 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16286 GNU General Public License for more details.
16287
16288 You should have received a copy of the GNU General Public License
16289 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.