Remove mark_ttys function and fix tty_display_info initialization.
[bpt/emacs.git] / src / ChangeLog
CommitLineData
c650a5de
DA
12012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
2
3 Remove mark_ttys function and fix tty_display_info initialization.
4 * lisp.h (mark_ttys): Remove prototype.
5 * alloc.c (Fgarbage_collect): Remove redundant (and the only) call
6 to mark_ttys because all possible values of 'top_frame' slot are
7 the frames which are reachable from Vframe_list.
8 * term.c (mark_ttys): Remove.
9 (init_tty): Safely initialize 'top_frame' slot with Qnil.
10
4e0f6479
DA
112012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
12
13 Change struct frame bitfields from unsigned char to unsigned.
14 * frame.h (struct frame): Change type of 'display_preempted',
15 'visible', 'iconified', 'has_minibuffer', 'wants_modeline',
16 'auto_raise', 'auto_lower', 'no_split', 'explicit_name',
17 'window_sizes_changed', 'mouse_moved' and 'pointer_invisible'
18 bitfields from unsigned char to unsigned.
19
8b96a52c
DA
202012-08-31 Dmitry Antipov <dmantipov@yandex.ru>
21
22 Remove unused member of struct x_output and struct w32_output.
23 * xterm.h (struct x_output): Remove unused field 'needs_exposure'.
24 * w32term.h (struct w32_output): Likewise.
25
b4444c8a
JD
262012-08-30 Jan Djärv <jan.h.d@swipnet.se>
27
28 * gtkutil.c (x_wm_set_size_hint): Use 1 col for base_width so it
29 does not become zero (Bug#12234).
30
b98521db
PE
312012-08-30 Paul Eggert <eggert@cs.ucla.edu>
32
33 * dispnew.c (update_frame_1): Pacify gcc -Wstrict-overflow
34 for GCC 4.7.1 x86-64.
35
31d02438
GM
362012-08-30 Glenn Morris <rgm@gnu.org>
37
38 * lread.c (init_lread): For out-of-tree builds, only add the
39 source directory's site-lisp dir to the load-path if it exists,
40 consistent with in-tree builds. (Bug#12302)
41
7f8941d8
JD
422012-08-28 Jan Djärv <jan.h.d@swipnet.se>
43
44 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
45 button_values to NULL. Call setStykeMask so dialogs get a close button.
46 (windowShouldClose:): Set window_closed.
47 (dealloc): New member, free button_values.
48 (process_dialog:): Make member function. Remove window argument,
49 replace window with self. Count buttons and allocate and store values
50 in button_values.
51 (addButton:value:row:): value is int with the name tag. Call setTag
52 with tag. Remove return self, declare return value as void.
53 (addString:row:): Remove return self, declare return value as void.
54 (addSplit): Remove return self, declare return value as void.
55 (clicked:): Remove return self, declare return value as void.
56 Set dialog_return to button_values[seltag]. Code formatting change.
57 (initFromContents:isQuestion:): Adjust call to process_dialog.
58 Code formatting change.
59 (timeout_handler:): Set timer_fired to YES.
60 (runDialogAt:): Set timer_fired to NO.
61 Handle click on close button as quit.
62
63 * nsterm.h (EmacsDialogPanel): Make timer_fired BOOL.
64 Add window_closed and button_values. Add void as return value for
65 add(Button|String|Split). addButton takes int instead of Lisp_Object.
66 Add process_dialog as new member.
67
eada0861 682012-08-28 Eli Zaretskii <eliz@gnu.org>
19c17fc1 69
eada0861
GM
70 * ralloc.c (free_bloc): Don't dereference a 'heap' structure if it
71 is not one of the heaps we manage. (Bug#12242)
72
732012-08-28 Glenn Morris <rgm@gnu.org>
74
75 * eval.c (Fcalled_interactively_p): Doc fix. (Bug#11747)
76
457294dd
MR
772012-08-28 Martin Rudalics <rudalics@gmx.at>
78
79 * window.c (Fset_window_configuration): Remove handling of
37b9743e
MR
80 auto-buffer-name window parameter. Install revision of reverted
81 fix.
457294dd 82
4f2daf31
DA
832012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
84
85 Do not allow to set major mode for a dead buffer.
86 * buffer.c (Fset_buffer_major_mode): Signal an error
87 if the buffer is dead.
88 (Fother_buffer, other_buffer_safely): Remove redundant
89 nested declaration.
90
66322887
DA
912012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
92
93 Always use set_buffer_if_live to restore original buffer at unwind.
94 * buffer.h (record_unwind_current_buffer): New function.
95 * bytecode.c, dispnew.c, editfns.c, fileio.c, fns.c, insdel.c:
96 * keyboard.c, keymap.c, minibuf.c, print.c, process.c, textprop.c:
97 * undo.c, window.c: Adjust users.
98 * buffer.c (set_buffer_if_live): Fix comment.
99
a3d794a1
DA
1002012-08-28 Dmitry Antipov <dmantipov@yandex.ru>
101
102 Fix usage of set_buffer_internal.
103 * buffer.h (set_buffer_internal): Make it BUFFER_INLINE.
104 * buffer.c (set_buffer_if_live): Use set_buffer_internal.
105 * coding.c (decode_coding): Omit redundant test.
106 * fileio.c (decide_coding_unwind): Likewise.
107 * fns.c (secure_hash): Likewise.
108 * insdel.c (modify_region): Likewise.
109 * keyboard.c (command_loop_1): Likewise.
110 * print.c (PRINTFINISH): Likewise.
111 * xdisp.c (run_window_scroll_functions): Use set_buffer_internal.
112
59ea14cd
PE
1132012-08-27 Paul Eggert <eggert@cs.ucla.edu>
114
115 * dispnew.c: Use bool for boolean.
116 (frame_garbaged, display_completed, delayed_size_change)
117 (fonts_changed_p, add_window_display_history)
118 (add_frame_display_history, verify_row_hash)
119 (adjust_glyph_matrix, clear_window_matrices, glyph_row_slice_p)
120 (row_equal_p, realloc_glyph_pool)
121 (allocate_matrices_for_frame_redisplay)
122 (showing_window_margins_p)
123 (adjust_frame_glyphs_for_frame_redisplay)
124 (build_frame_matrix_from_leaf_window, make_current)
125 (mirrored_line_dance, mirror_line_dance, update_frame)
126 (update_window_tree, update_single_window)
127 (check_current_matrix_flags, update_window, update_text_area)
128 (update_window_line, set_window_update_flags, scrolling_window)
129 (update_frame_1, scrolling, buffer_posn_from_coords)
130 (do_pending_window_change, change_frame_size)
131 (change_frame_size_1, sit_for):
132 Use bool for boolean.
133 (clear_glyph_matrix_rows): Rename from enable_glyph_matrix_rows,
134 and remove last int (actually boolean) argument, which was always 0.
135 All callers changed.
136 * dispextern.h, frame.h, lisp.h: Reflect above API changes.
137 * dispextern.h (struct composition_it): Use bool for boolean.
138 (struct glyph_matrix): Don't assume buffer sizes can fit in 'int'.
139 (struct bidi_it): Use unsigned:1, not int, for boolean prev_was_pdf.
140 * dired.c (file_name_completion):
141 Use bool for boolean. (This was missed in an earlier change.)
142
95072a94
MR
1432012-08-27 Martin Rudalics <rudalics@gmx.at>
144
145 * window.c (Fset_window_configuration): Revert first part of
146 last change.
147
0f19feff
JD
1482012-08-27 Jan Djärv <jan.h.d@swipnet.se>
149
150 * nsterm.h (NSPanel): New class variable dialog_return.
151
152 * nsmenu.m (initWithContentRect:styleMask:backing:defer:): Initialize
153 dialog_return.
154 (windowShouldClose:): Use stop instead of stopModalWithCode.
155 (clicked:): Ditto, and also set dialog_return (Bug#12258).
156 (timeout_handler:): Use stop instead of abortModal. Send a dummy
157 event.
158 (runDialogAt:): Make ret Lisp_Object. Set it from dialog_return when
159 modal loop returns.
160
f10fe38f
PE
1612012-08-27 Paul Eggert <eggert@cs.ucla.edu>
162
de1339b0
PE
163 * composite.c, data.c, dbusbind.c, dired.c: Use bool for booleans.
164 * composite.c (find_composition, composition_gstring_p)
165 (composition_reseat_it, find_automatic_composition):
166 * data.c (let_shadows_buffer_binding_p)
167 (let_shadows_global_binding_p, set_internal, make_blv)
168 (Fmake_variable_buffer_local, Fmake_local_variable)
169 (Fmake_variable_frame_local, arithcompare, cons_to_unsigned)
170 (cons_to_signed, arith_driver):
171 * dbusbind.c (xd_in_read_queued_messages):
172 * dired.c (directory_files_internal, file_name_completion):
173 Use bool for booleans.
174 * dired.c (file_name_completion):
175 * process.h (fd_callback):
176 Omit int (actually boolean) argument. It wasn't being used.
177 All uses changed.
178 * composite.h, lisp.h: Reflect above API changes.
179
f10fe38f
PE
180 * cmds.c, coding.c: Use bool for booleans.
181 * cmds.c (move_point, Fself_insert_command):
182 * coding.h (struct composition status, struct coding_system):
183 * coding.c (detect_coding_utf_8, encode_coding_utf_8)
184 (detect_coding_utf_16, encode_coding_utf_16, detect_coding_emacs_mule)
185 (emacs_mule_char, decode_coding_emacs_mule)
186 (encode_coding_emacs_mule, detect_coding_iso_2022)
187 (decode_coding_iso_2022, encode_invocation_designation)
188 (encode_designation_at_bol, encode_coding_iso_2022)
189 (detect_coding_sjis, detect_coding_big5, decode_coding_sjis)
190 (decode_coding_big5, encode_coding_sjis, encode_coding_big5)
191 (detect_coding_ccl, encode_coding_ccl, decode_coding_raw_text)
192 (encode_coding_raw_text, detect_coding_charset)
193 (decode_coding_charset, encode_coding_charset, detect_eol)
194 (detect_coding, get_translation_table, produce_chars)
195 (consume_chars, reused_workbuf_in_use)
196 (make_conversion_work_buffer, code_conversion_save)
197 (decode_coding_object, encode_coding_object)
198 (detect_coding_system, char_encodable_p)
199 (Funencodable_char_position, code_convert_region)
200 (code_convert_string, code_convert_string_norecord)
201 (Fset_coding_system_priority):
202 * fileio.c (Finsert_file_contents):
203 Use bool for booleans.
204 * coding.h, lisp.h: Reflect above API changes.
205 * coding.c: Remove unnecessary static function decls.
206 (detect_coding): Use unsigned, not signed, to copy an unsigned field.
207 (decode_coding, encode_coding, decode_coding_gap): Return 'void',
208 not a boolean 'int', since callers never look at the return value.
209 (ALLOC_CONVERSION_WORK_AREA): Assume caller returns 'void', not 'int'.
210 * coding.h (decoding_buffer_size, encoding_buffer_size)
211 (emacs_mule_string_char): Remove unused extern decls.
212 (struct iso_2022_spec, struct coding_system):
213 Use 'unsigned int : 1' for boolean fields, since there's more than one.
214 (struct emacs_mule_spec): Remove unused field 'full_support'.
215 All initializations removed.
216 * cmds.c (internal_self_insert): Don't assume EMACS_INT fits in 'int'.
217
5474c384
DA
2182012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
219
f10fe38f 220 Fix spare memory change (Bug#12286).
5474c384
DA
221 * alloc.c (mark_maybe_pointer): Handle MEM_TYPE_SPARE.
222 (valid_lisp_object_p): Likewise.
223
c4b6914d
MR
2242012-08-27 Martin Rudalics <rudalics@gmx.at>
225
226 * window.c (Fset_window_configuration): Record any window's old
227 buffer if it's replaced (see Bug#8789). If the new current
228 buffer doesn't appear in the selected window, go to its old
229 point (Bug#12208).
230
35aaa1ea
DA
2312012-08-27 Dmitry Antipov <dmantipov@yandex.ru>
232
233 Special MEM_TYPE_SPARE to denote reserved memory.
234 * alloc.c (enum mem_type): New memory type.
235 (refill_memory_reserve): Use new type for spare memory.
236 This prevents live_cons_p and live_string_p from incorrect
237 detection of uninitialized objects from spare memory as live.
238
6af64513
PE
2392012-08-26 Paul Eggert <eggert@cs.ucla.edu>
240
8b2e00a3
PE
241 Spelling fixes.
242 * Makefile.in (.PHONY): versioclean -> versionclean.
243
b52d6985
PE
244 Remove unused external symbols.
245 * data.c (Qcons, Qfloat, Qmisc, Qstring, Qvector):
246 * window.c (Qwindow_valid_p, decode_valid_window):
247 Now static, not extern.
248 * data.c (Qinterval): Remove; unused.
249 (syms_of_data): Do not define 'interval'.
250 * lisp.h (Qinteger, Qstring, Qmisc, Qvector, Qfloat, Qcons):
251 * window.h (decode_valid_window):
252 Remove decls.
253
d5172d4f
PE
254 * character.c, charset.c, chartab.c: Use bool for booleans.
255 * character.c (lisp_string_width, string_count_byte8)
256 (string_escape_byte8):
257 * charset.c (charset_map_loaded, load_charset_map, read_hex):
258 (load_charset_map_from_file, map_charset_chars)
259 (Fdefine_charset_internal, define_charset_internal)
260 (Fdeclare_equiv_charset, find_charsets_in_text)
261 (Ffind_charset_region, char_charset, Fiso_charset):
262 * chartab.c (sub_char_table_ref, sub_char_table_ref_and_range)
263 (sub_char_table_set, sub_char_table_set_range)
264 (char_table_set_range, optimize_sub_char_table)
265 (map_sub_char_table):
266 Use bool for boolean.
267 * character.c (str_to_unibyte): Omit last boolean argument; it was
268 always 0. All callers changed.
269 * character.h, charset.h: Adjust to match previous changes.
270 * character.h (char_printable_p): Remove decl of nonexistent function.
271 * charset.h (struct charset): Members code_linear_p, iso_chars_96,
272 ascii_compatible_p, supplementary_p, compact_codes_p, unified_p
273 are all boolean, so make them single-bit bitfields.
274
6af64513
PE
275 * lisp.h (ASET): Remove attempt to detect side effects.
276 It was meant to be temporary and it often doesn't work,
277 because when IDX has side effects the behavior of IDX==IDX
278 is undefined. See Stefan Monnier in
279 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
280
e1f29348
BR
2812012-08-26 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
282
283 * lisp.h (functionp): New function (extracted from Ffunctionp).
284 (FUNCTIONP): Use it.
285 * eval.c (Ffunctionp): Use it.
286
17c05d74
PE
2872012-08-25 Paul Eggert <eggert@cs.ucla.edu>
288
0f46bc75
PE
289 * xgselect.c (xg_select): Use auto storage for the GPollFD buffer
290 as that's faster and simpler than static storage. Don't bother
291 with the g_main_context_query overhead if g_main_context_pending
292 says no events are pending.
293 (gfds, gfds_size): Remove these static vars.
294 (xgselect_initialize): Remove; no longer needed.
295 All uses and decls removed.
296
ee4c0f69
PE
297 * emacs.c (fatal_error_signal_hook): Remove.
298 All uses removed. This leftover from old code was always 0.
299
17c05d74
PE
300 * casefiddle.c, casetab.c, category.c: Use bool for boolean.
301 * casefiddle.c (casify_object, casify_region):
302 * casetab.c (set_case_table):
303 * category.c, category.h (word_boundary_p):
304 * category.h (CHAR_HAS_CATEGORY):
305 Use bool for booleans, instead of int.
306
391ceac5
EZ
3072012-08-25 Eli Zaretskii <eliz@gnu.org>
308
309 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on $(GNU_LIB)/execinfo.h.
310
2f221583
PE
3112012-08-25 Paul Eggert <eggert@cs.ucla.edu>
312
f4a681b0
PE
313 On assertion failure, print backtrace if available.
314 * alloc.c [ENABLE_CHECKING]: Include <execinfo.h>.
315 (die) [ENABLE_CHECKING]: Print a backtrace if available.
316 * Makefile.in (LIB_EXECINFO): New macro.
317 (LIBES): Use it.
318
2f221583
PE
319 * bytecode.c, callint.c, callproc.c: Use bool for boolean.
320 * bytecode.c (exec_byte_code):
321 * callint.c (check_mark, Fcall_interactively):
322 * callproc.c (Fcall_process, add_env, child_setup, getenv_internal_1)
323 (getenv_internal, sync_process_alive, call_process_exited):
324 * lisp.h (USE_SAFE_ALLOCA):
325 Use bool for booleans, instead of int.
326 * lisp.h, process.h: Adjust prototypes to match above changes.
327 * callint.c (Fcall_interactively): Don't assume the mark's
328 offset fits in 'int'.
329
37ef52bb
PE
3302012-08-24 Paul Eggert <eggert@cs.ucla.edu>
331
332 * buffer.c, buffer.h: Use bool for boolean.
333 * buffer.c (reset_buffer_local_variables)
334 (buffer_lisp_local_variables, Fset_buffer_modified_p)
335 (Frestore_buffer_modified_p, Fset_buffer_multibyte):
336 (overlays_at, overlays_in, mouse_face_overlay_overlaps)
337 (overlay_touches_p, overlay_strings, Foverlay_put)
338 (report_overlay_modification, call_overlay_mod_hooks):
339 (mmap_enlarge, mmap_set_vars):
340 * buffer.h (buffer_has_overlays, uppercasep, lowercasep):
341 Use bool for booleans, instead of int.
342 * buffer.c (compact_buffer, mmap_free_1): Return void, not int,
343 since the 1-or-0 return value is always ignored anyway.
344 (mmap_initialized_p):
345 * buffer.h (struct buffer_text.inhibit_shrinking): Now bool, not int.
346 * buffer.h, lisp.h: Adjust prototypes to match above changes.
347
2cc21167
PE
3482012-08-23 Paul Eggert <eggert@cs.ucla.edu>
349
350 * bidi.c: Use bool for boolean.
351 This is a bit more readable, and makes the text segment of bidi.o
352 0.4% smaller on my platform (GCC 4.7.1 x86-64, Fedora 15).
353 Presumably it's faster too.
354 (bidi_initialized, bidi_ignore_explicit_marks_for_paragraph_level):
355 Now bool.
356 (bidi_cache_find_level_change, bidi_cache_iterator_state)
357 (bidi_unshelve_cache, bidi_init_it, bidi_count_bytes)
358 (bidi_char_at_pos, bidi_fetch_char, bidi_paragraph_init)
359 (bidi_explicit_dir_char, bidi_level_of_next_char)
360 (bidi_find_other_level_edge, bidi_move_to_visually_next):
361 Use bool for booleans, instead of int.
362 * dispextern.h (bidi_init_it, bidi_paragraph_init)
363 (bidi_unshelve_cache): Adjust decls to match code.
364
7db4ddf4
MR
3652012-08-23 Martin Rudalics <rudalics@gmx.at>
366
367 * keyboard.c (Fposn_at_x_y): Do not allow internal window as
368 argument.
369
b1bb8011
PE
3702012-08-23 Paul Eggert <eggert@cs.ucla.edu>
371
372 * atimer.c, atimer.h (turn_on_atimers): Use bool for boolean.
373 * atimer.h: Include <stdbool.h>.
374
ff687885
DN
3752012-08-22 Dan Nicolaescu <dann@gnu.org>
376
377 * frame.h (FRAME_W32_P, FRAME_MSDOS_P, FRAME_NS_P): Change to
378 compile time tests instead of run time tests on systems that do
379 not use them.
380 (FRAME_MAC_P): Remove leftover from deleted code.
381 * frame.c (syms_of_frame): Remove leftover from deleted code.
382
4ce7a138
JD
3832012-08-22 Jan Djärv <jan.h.d@swipnet.se>
384
385 * nsterm.m (insertText:): Don't clear modifiers if code is space.
386
d733ec6d
PE
3872012-08-22 Paul Eggert <eggert@cs.ucla.edu>
388
389 * fontset.c (FONTSET_ADD): Return void, not Lisp_Object.
390 Otherwise, the compiler complains about (A?B:C) where B is void
391 and C is Lisp_Object. This fixes an incompatibility with Sun C 5.12.
392 (fontset_add): Return void, for FONTSET_ADD.
393
d0d2d26f
PE
3942012-08-21 Paul Eggert <eggert@cs.ucla.edu>
395
fce31d69
PE
396 * alloc.c: Use bool for booleans.
397 (gc_in_progress, abort_on_gc)
398 (setjmp_tested_p) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
399 (dont_register_blocks) [GC_MALLOC_CHECK]:
400 (suppress_checking) [ENABLE_CHECKING]: Now bool, not int.
401 (check_string_bytes, make_specified_string, memory_full)
402 (live_string_p, live_cons_p, live_symbol_p, live_float_p)
403 (live_misc_p, live_vector_p, live_buffer_p, mark_maybe_object)
404 (mark_stack, valid_pointer_p, make_pure_string)
405 (Fgarbage_collect, survives_gc_p, gc_sweep):
406 Use bool for booleans, instead of int.
407 (test_setjmp) [!GC_SAVE_REGISTERS_ON_STACK && !GC_SETJMP_WORKS]:
408 Remove unused local.
409 * alloc.c (PURE_POINTER_P):
410 * lisp.h (STRING_MULTIBYTE): Document that it returns a boolean.
411 * editfns.c (Fformat):
412 * fileio.c (Fexpand_file_name, Fsubstitute_in_file_name)
413 (Fdo_auto_save):
414 * fns.c (sweep_weak_table):
415 * lisp.h (suppress_checking, push_message, survives_gc_p)
416 (make_pure_string, gc_in_progress, abort_on_gc):
417 * lread.c (readchar, read1):
418 * print.c (Fprin1_to_string):
419 * xdisp.c (push_message):
420 Use bool for booleans affected directly or indirectly by
421 alloc.c's changes.
422
d0d2d26f
PE
423 Make recently-introduced setters macros.
424 * fontset.c (set_fontset_id, set_fontset_name, set_fontset_ascii)
425 (set_fontset_base, set_fontset_frame, set_fontset_nofont_face)
426 (set_fontset_default, set_fontset_fallback): Rename from their
427 upper-case counterparts, and make them functions rather than macros.
428 This is more consistent with the other recently-introduced setters.
429 These don't need to be inline, since they're local.
430
d18e2bb6
JD
4312012-08-21 Jan Djärv <jan.h.d@swipnet.se>
432
433 * nsterm.m (fd_handler:): Alloc and release a NSAutoreleasePool in
434 the loop (Bug#12247).
435
1b9d9d16
PE
4362012-08-21 Paul Eggert <eggert@cs.ucla.edu>
437
438 * lisp.h (vcopy): Use memcpy rather than our own loop.
439 This fixes a performance regression introduced by the recent
440 addition of vcopy. This means 'vcopy' will need to be modified
441 for a copying collector, but that's OK. Also, tighten the
442 checking in the assertion.
443
b2f09701
EZ
4442012-08-21 Eli Zaretskii <eliz@gnu.org>
445
446 * w32uniscribe.c (uniscribe_shape): Fix producing gstring
447 components for RTL text (Bug#11860). Adjust X-OFFSET of each
448 non-base glyph for the width of the base character, according to
e1f29348
BR
449 what x_draw_composite_glyph_string_foreground expects.
450 Generate WADJUST value according to composition_gstring_width's
b2f09701
EZ
451 expectations, to produce correct width of the composed character.
452 Reverse the sign of the DU offset produced by ScriptPlace.
453
9b994fed
PE
4542012-08-21 Paul Eggert <eggert@cs.ucla.edu>
455
456 * dbusbind.c (xd_remove_watch): Do not assume C99 comments.
457
086ca913
DA
4582012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
459
460 Avoid direct writes to contents member of struct Lisp_Vector.
461 * lisp.h (vcopy): New function to copy data into vector.
462 * dispnew.c (Fframe_or_buffer_changed_p): Use AREF and ASET.
463 * fns.c (Ffillarray): Use ASET.
464 * keyboard.c (timer_check_2): Use AREF and ASET.
465 (append_tool_bar_item, Frecent_keys): Use vcopy.
466 * lread.c (read_vector): Use ASET.
467 * msdos.c (Frecent_doskeys): Use vcopy.
468 * xface.c (Finternal_copy_lisp_face): Use vcopy.
469 (Finternal_merge_in_global_face): Use ASET and vcopy.
470 * xfont.c (xfont_list_pattern): Likewise.
471
5481664a
MR
4722012-08-21 Martin Rudalics <rudalics@gmx.at>
473
474 * window.c (Fwindow_point): For the selected window always return
475 the position of its buffer's point.
476 (Fset_window_point): For the selected window always go in its
477 buffer to the specified position.
478
6d470bdd
DA
4792012-08-21 Dmitry Antipov <dmantipov@yandex.ru>
480
481 Setter macros for fontsets.
482 * fontset.c (SET_FONTSET_ID, SET_FONTSET_NAME, SET_FONTSET_ASCII)
483 (SET_FONTSET_BASE, SET_FONTSET_FRAME, SET_FONTSET_NOFONT_FACE)
484 (SET_FONTSET_DEFAULT, SET_FONTSET_FALLBACK): New macros.
485 Adjust users.
486
24564fe1
GM
4872012-08-20 Glenn Morris <rgm@gnu.org>
488
489 * Makefile.in (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
490 Don't assume that `ln -f' works.
491
0a05a035
EZ
4922012-08-20 Eli Zaretskii <eliz@gnu.org>
493
494 * .gdbinit: Use "set $dummy = ..." to avoid warnings from GDB 7.5
495 and later about non-assignments with no effect. See discussion at
496 http://sourceware.org/ml/gdb-patches/2012-08/msg00518.html for
497 details.
498
e46f2325
DA
4992012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
500
501 Inline setter functions for Lisp_Objects slots of struct specbinding.
502 * eval.c (set_specpdl_symbol, set_specpdl_old_value): New functions.
503 Adjust users.
504
734fbd86
MR
5052012-08-20 Martin Rudalics <rudalics@gmx.at>
506
507 * window.c (select_window): Always make selected window's buffer
508 current.
509
f1a95992
DA
5102012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
511
512 Use AREF and ASET for docstrings of category tables.
513 * category.h (CATEGORY_DOCSTRING): Use AREF.
514 (SET_CATEGORY_DOCSTRING): Use ASET.
515 * category.c (Fdefine_category): Use SET_CATEGORY_DOCSTRING.
516
e83064be
DA
5172012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
518
519 Inline setter functions for hash table members.
520 * lisp.h (set_hash_key, set_hash_value, set_hash_next)
521 (set_hash_hash, set_hash_index): Rename with _slot suffix.
522 (set_hash_key_and_value, set_hash_index, set_hash_next)
523 (set_hash_hash): New functions.
524 * charset.c, fns.c: Adjust users.
525
4ce60d2e
DA
5262012-08-20 Dmitry Antipov <dmantipov@yandex.ru>
527
528 Inline getter and setter functions for per-buffer values.
529 * buffer.h (per_buffer_default, set_per_buffer_default)
530 (per_buffer_value, set_per_buffer_value): New functions.
531 (PER_BUFFER_VALUE, PER_BUFFER_DEFAULT): Remove.
532 * buffer.c, data.c: Adjust users.
533
c06c9690
JB
5342012-08-20 Juanma Barranquero <lekktu@gmail.com>
535
536 * makefile.w32-in ($(BLD)/vm-limit.$(O)): Update dependencies.
537
32bd4250
PE
5382012-08-19 Paul Eggert <eggert@cs.ucla.edu>
539
bad03192 540 Rely on <config.h> + <unistd.h> to declare 'environ',
b69a6d22
PE
541 as gnulib does this if the system doesn't.
542 * callproc.c, editfns.c, process.c (environ) [!USE_CRT_DLL]:
72279493
EZ
543 Remove declaration. MS-Windows declares it on stdlib.h which is
544 included by conf_post.h.
b69a6d22
PE
545 * emacs.c (environ) [DOUG_LEA_MALLOC]:
546 * vm-limit.c (environ) [ORDINARY_LINK]: Remove decl.
547 * vm-limit.c: Include <unistd.h>, for 'environ'.
548
22d7feb2
PE
549 * unexaix.c, unexcoff.c: Include "mem-limits.h".
550 (start_of_data): Remove decl; mem-limits.h provides it.
551
32bd4250
PE
552 * xdisp.c (handle_invisible_prop): Make it a bit faster
553 and avoid a gcc -Wmaybe-uninitialized diagnostic.
554
450809af
CY
5552012-08-19 Chong Yidong <cyd@gnu.org>
556
557 * xdisp.c (handle_invisible_prop): Fix ellipses at overlay string
558 ends (Bug#3874).
559
9e677988
AS
5602012-08-19 Andreas Schwab <schwab@linux-m68k.org>
561
6b1319ce
AS
562 * .gdbinit: Use call instead of set when calling a function in the
563 inferior.
564
9e677988
AS
565 * data.c (set_internal): Don't use set_blv_found.
566 (Fkill_local_variable): Likewise.
567
d7191076
AA
5682012-08-18 Alp Aker <alp.tekin.aker@gmail.com>
569
570 * nsfont.m (ns_ascii_average_width): Ensure the string
571 ascii_printable is initialized with a null-terminated character
572 array. Otherwise, it can contain undesired extra characters.
573
e757f1c6
PE
5742012-08-18 Paul Eggert <eggert@cs.ucla.edu>
575
576 port new setting code to Sun C 5.8 2005/10/13
577 * chartab.c, lisp.h (char_table_set, char_table_set_range):
578 Return void, not Lisp_Object. Otherwise, the compiler
579 complains about (A?B:C) where B is void and C is Lisp_Object
580 when compiling CHAR_TABLE_SET, due to the recent change to
581 the API of sub_char_table_set_contents.
582
a999ce26
CY
5832012-08-18 Chong Yidong <cyd@gnu.org>
584
585 * xdisp.c (handle_invisible_prop): Obey TEXT_PROP_MEANS_INVISIBLE
586 for the string case (Bug#3874).
587
3f22b86f
PE
5882012-08-18 Paul Eggert <eggert@cs.ucla.edu>
589
39eb03f1
PE
590 * buffer.h (BSET): Remove (Bug#12215).
591 Replace all uses with calls to new setter functions.
592 (bset_bidi_paragraph_direction, bset_case_canon_table)
593 (bset_case_eqv_table, bset_directory, bset_display_count)
594 (bset_display_time, bset_downcase_table)
595 (bset_enable_multibyte_characters, bset_filename, bset_keymap)
596 (bset_last_selected_window, bset_local_var_alist)
597 (bset_mark_active, bset_point_before_scroll, bset_read_only)
598 (bset_truncate_lines, bset_undo_list, bset_upcase_table)
599 (bset_width_table):
600 * buffer.c (bset_abbrev_mode, bset_abbrev_table)
601 (bset_auto_fill_function, bset_auto_save_file_format)
602 (bset_auto_save_file_name, bset_backed_up, bset_begv_marker)
603 (bset_bidi_display_reordering, bset_buffer_file_coding_system)
604 (bset_cache_long_line_scans, bset_case_fold_search)
605 (bset_ctl_arrow, bset_cursor_in_non_selected_windows)
606 (bset_cursor_type, bset_display_table, bset_extra_line_spacing)
607 (bset_file_format, bset_file_truename, bset_fringe_cursor_alist)
608 (bset_fringe_indicator_alist, bset_fringes_outside_margins)
609 (bset_header_line_format, bset_indicate_buffer_boundaries)
610 (bset_indicate_empty_lines, bset_invisibility_spec)
611 (bset_left_fringe_width, bset_major_mode, bset_mark)
612 (bset_minor_modes, bset_mode_line_format, bset_mode_name)
613 (bset_name, bset_overwrite_mode, bset_pt_marker)
614 (bset_right_fringe_width, bset_save_length)
615 (bset_scroll_bar_width, bset_scroll_down_aggressively)
616 (bset_scroll_up_aggressively, bset_selective_display)
617 (bset_selective_display_ellipses, bset_vertical_scroll_bar_type)
618 (bset_word_wrap, bset_zv_marker):
619 * category.c (bset_category_table):
620 * syntax.c (bset_syntax_table):
621 New setter functions.
622
6a09a33b
PE
623 * process.h (PSET): Remove (Bug#12215).
624 Replace all uses with calls to new setter functions.
625 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
626 (PROCESS_INLINE): New macro.
627 (pset_childp): New setter function.
628 (pset_gnutls_cred_type) [HAVE_GNUTLS]: New setter function.
629 * process.c (PROCESS_INLINE):
630 Define to EXTERN_INLINE, so that the corresponding functions
631 are compiled into code.
632 (pset_buffer, pset_command, pset_decode_coding_system)
633 (pset_decoding_buf, pset_encode_coding_system)
634 (pset_encoding_buf, pset_filter, pset_log, pset_mark, pset_name)
635 (pset_plist, pset_sentinel, pset_status, pset_tty_name)
636 (pset_type, pset_write_queue): New setter functions.
637
e8c17b81
PE
638 * window.h (WSET): Remove (Bug#12215).
639 Replace all uses with calls to new setter functions.
640 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
641 (WINDOW_INLINE): New macro.
642 (wset_buffer, wset_frame, wset_left_col, wset_next, wset_prev)
643 (wset_redisplay_end_trigger, wset_top_line, wset_total_cols)
644 (wset_total_lines, wset_vertical_scroll_bar)
645 (wset_window_end_pos, wset_window_end_valid)
646 (wset_window_end_vpos): New setter functions.
647 * window.c (WINDOW_INLINE):
648 Define to EXTERN_INLINE, so that the corresponding functions
649 are compiled into code.
650 (wset_combination_limit, wset_dedicated, wset_display_table)
651 (wset_hchild, wset_left_fringe_width, wset_left_margin_cols)
652 (wset_new_normal, wset_new_total, wset_next_buffers)
653 (wset_normal_cols, wset_normal_lines, wset_parent, wset_pointm)
654 (wset_prev_buffers, wset_right_fringe_width)
655 (wset_right_margin_cols, wset_scroll_bar_width, wset_start)
656 (wset_temslot, wset_vchild, wset_vertical_scroll_bar_type)
657 (wset_window_parameters):
658 * xdisp.c (wset_base_line_number, wset_base_line_pos)
659 (wset_column_number_displayed, wset_region_showing):
660 New setter functions.
661
3f22b86f
PE
662 * termhooks.h (TSET): Remove (Bug#12215).
663 Replace all uses with calls to new setter functions.
664 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
665 (TERMHOOKS_INLINE): New macro.
666 (tset_charset_list, tset_selection_alist): New setter functions.
667 * terminal.c (TERMHOOKS_INLINE):
668 Define to EXTERN_INLINE, so that the corresponding functions
669 are compiled into code.
670 (tset_param_alist): New setter function.
671
742af32f
PE
6722012-08-17 Paul Eggert <eggert@cs.ucla.edu>
673
15dbb4d6
PE
674 * keyboard.h (KSET): Remove (Bug#12215).
675 Replace all uses with calls to new setter functions.
676 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
677 (KEYBOARD_INLINE): New macro.
678 (kset_default_minibuffer_frame, kset_defining_kbd_macro)
679 (kset_input_decode_map, kset_last_command, kset_last_kbd_macro)
680 (kset_prefix_arg, kset_system_key_alist, kset_window_system):
681 New setter functions.
682 * keyboard.c (KEYBOARD_INLINE):
683 Define to EXTERN_INLINE, so that the corresponding functions
684 are compiled into code.
685 (kset_echo_string, kset_kbd_queue)
686 (kset_keyboard_translate_table, kset_last_prefix_arg)
687 (kset_last_repeatable_command, kset_local_function_key_map)
688 (kset_overriding_terminal_local_map, kset_real_last_command)
689 (kset_system_key_syms): New setter functions.
690
f00af5b1
PE
691 * frame.h (FSET): Remove (Bug#12215).
692 Replace all uses with calls to new setter functions.
693 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
694 (FRAME_INLINE): New macro.
695 (fset_buffer_list, fset_buried_buffer_list, fset_condemned_scroll_bars)
696 (fset_current_tool_bar_string, fset_desired_tool_bar_string)
697 (fset_face_alist, fset_focus_frame, fset_icon_name, fset_menu_bar_items)
698 (fset_menu_bar_vector, fset_menu_bar_window, fset_name)
699 (fset_param_alist, fset_root_window, fset_scroll_bars)
700 (fset_selected_window, fset_title, fset_tool_bar_items)
701 (fset_tool_bar_position, fset_tool_bar_window): New functions.
702 * frame.c (FRAME_INLINE):
703 Define to EXTERN_INLINE, so that the corresponding functions
704 are compiled into code.
705 (fset_buffer_predicate, fset_minibuffer_window): New setter functions.
706
0c94c8d6
PE
707 A few more naming-convention fixes for getters and setters.
708 * buffer.c (set_buffer_overlays_before): Move here from buffer.h,
709 and rename from buffer_overlays_set_before.
710 (set_buffer_overlays_after): Move here from buffer.h, and rename
711 from buffer_overlays_set_after.
712 * buffer.h (buffer_intervals): Rename from buffer_get_intervals.
713 All uses changed.
714 (set_buffer_intervals): Rename from buffer_set_intervals.
715 * intervals.c (set_interval_object): Move here from intervals.h,
716 and rename from interval_set_object.
717 (set_interval_left): Move here from intervals.h, and rename from
718 interval_set_left.
719 (set_interval_right): Move here from intervals.h, and rename from
720 interval_set_right.
721 (copy_interval_parent): Move here from intervals.h, and rename from
722 interval_copy_parent.
723 * intervals.h (set_interval_parent): Rename from interval_set_parent.
724 (set_interval_plist): Rename from interval_set_plist.
725 Return void, not Lisp_Object, since no caller uses the result.
726 * lisp.h (string_intervals): Rename from string_get_intervals.
727 (set_string_intervals): Rename from string_set_intervals.
728
34dabdb7
PE
729 * lisp.h (set_char_table_extras): Rename from char_table_set_extras.
730 (set_char_table_contents): Rename from char_table_set_contents.
0b390a9d 731 (set_sub_char_table_contents): Rename from sub_char_table_set_contents.
34dabdb7
PE
732 All uses changed. See the end of
733 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00549.html>.
734
742af32f
PE
735 * lisp.h (CSET): Remove (Bug#12215).
736 (set_char_table_ascii, set_char_table_defalt, set_char_table_parent)
737 (set_char_table_purpose): New functions,
738 replacing CSET. All uses changed. For example, replace
739 "CSET (XCHAR_TABLE (char_table), parent, parent);" with
c24eb18a 740 "set_char_table_parent (char_table, parent);".
742af32f
PE
741 The old version was confusing because it used the same name
742 'parent' for two different things.
743
a04e2c62
DA
7442012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
745
746 Functions to get and set Lisp_Object fields of buffer-local variables.
747 * lisp.h (blv_found, set_blv_found, blv_value, set_blv_value)
748 (set_blv_where, set_blv_defcell, set_blv_valcell): New functions.
749 (BLV_FOUND, SET_BLV_FOUND, BLV_VALUE, SET_BLV_VALUE): Remove.
750 * data.c, eval.c, frame.c: Adjust users.
751
383dcbf9
CY
7522012-08-17 Chong Yidong <cyd@gnu.org>
753
754 * xfaces.c (merge_face_vectors): If the target font specfies a
755 font spec, make the font's attributes take precedence over
756 directly-specified attributes.
757 (merge_face_ref): Recognize :font.
758
44386687
DA
7592012-08-17 Dmitry Antipov <dmantipov@yandex.ru>
760
761 Do not use memcpy for copying intervals.
762 * intervals.c (reproduce_interval): New function.
763 (reproduce_tree, reproduce_tree_obj): Use it.
764 (reproduce_tree_obj): Remove prototype.
765
927c7216
PE
7662012-08-17 Paul Eggert <eggert@cs.ucla.edu>
767
768 * lisp.h (duration_to_sec_usec): Remove unused decl.
769
93044f7b
AA
7702012-08-17 Alp Aker <alp.tekin.aker@gmail.com>
771
772 * nsfont.m (ns_ascii_average_width): Send initWithFormat selector
773 to an allocated instance of NSString, not to the class itself.
774
9851e4a5
JB
7752012-08-17 Juanma Barranquero <lekktu@gmail.com>
776
777 * makefile.w32-in (C_CTYPE_H): New macro.
778 (LISP_H, $(BLD)/ccl.$(O), $(BLD)/doc.$(O), $(BLD)/w32console.$(O)):
779 ($(BLD)/fontset.$(O), $(BLD)/frame.$(O), $(BLD)/composite.$(O)):
780 ($(BLD)/sysdep.$(O), $(BLD)/w32uniscribe.$(O)): Update dependencies.
781
620f13b0
PE
7822012-08-16 Paul Eggert <eggert@cs.ucla.edu>
783
784 Use ASCII tests for character types.
785 * category.c, dispnew.c, doprnt.c, editfns.c, syntax.c, term.c:
786 * xfns.c, xterm.c:
787 Don't include <ctype.h>; was not needed.
788 * charset.c, doc.c, fileio.c, font.c, frame.c, gtkutil.c, image.c:
789 * sysdep.c, xfaces.c:
790 Include <c-ctype.h> instead of <ctype.h>.
791 * nsterm.m: Include <c-ctype.h>.
792 * charset.c (read_hex):
793 * doc.c (Fsnarf_documentation):
794 * fileio.c (IS_DRIVE) [WINDOWSNT]:
795 (DRIVE_LETTER) [DOS_NT]:
796 (Ffile_name_directory, Fexpand_file_name)
797 (Fsubstitute_in_file_name):
798 * font.c (font_parse_xlfd, font_parse_fcname):
799 * frame.c (x_set_font_backend):
800 * gtkutil.c (xg_get_font):
801 * image.c (xbm_scan, xpm_scan, pbm_scan_number):
802 * nsimage.m (hexchar):
803 * nsterm.m (ns_xlfd_to_fontname):
804 * sysdep.c (system_process_attributes):
805 * xfaces.c (hash_string_case_insensitive):
806 Use C-locale tests instead of locale-specific tests for character
807 types, since we want the ASCII interpretation here, not the
808 interpretation suitable for whatever happens to be the current locale.
809
52162052
MR
8102012-08-16 Martin Rudalics <rudalics@gmx.at>
811
812 Consistently check windows for validity/liveness
813 (Bug#11984, Bug#12025, Bug#12026).
814 * lisp.h (CHECK_VALID_WINDOW): New macro.
815 * window.c (decode_window): Rename to decode_live_window.
816 (decode_valid_window, Fwindow_valid_p): New functions.
817 (Fwindow_frame, Fframe_root_window, Fwindow_minibuffer_p)
818 (Fframe_first_window, Fframe_selected_window, Fwindow_parent)
819 (Fwindow_top_child, Fwindow_left_child, Fwindow_next_sibling)
820 (Fwindow_prev_sibling, Fwindow_combination_limit)
821 (Fset_window_combination_limit, Fwindow_use_time)
822 (Fwindow_total_height, Fwindow_total_width, Fwindow_new_total)
823 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_left_column)
824 (Fwindow_top_line, Fwindow_body_height, Fwindow_body_width)
825 (Fwindow_hscroll, Fset_window_hscroll)
826 (Fwindow_redisplay_end_trigger)
827 (Fset_window_redisplay_end_trigger, Fwindow_edges)
828 (Fwindow_pixel_edges, Fwindow_absolute_pixel_edges)
829 (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
830 (Fcoordinates_in_window_p, Fwindow_point, Fwindow_start)
831 (Fwindow_end, Fset_window_point, Fset_window_start)
832 (Fpos_visible_in_window_p, Fwindow_line_height)
833 (Fwindow_dedicated_p, Fset_window_dedicated_p)
834 (Fwindow_prev_buffers, Fset_window_prev_buffers)
835 (Fwindow_next_buffers, Fwindow_parameters, Fwindow_parameter)
836 (Fset_window_parameter, Fwindow_display_table)
837 (Fset_window_display_table, Fdelete_other_windows_internal)
838 (Fset_window_buffer, Fset_window_new_total)
839 (Fset_window_new_normal, Fdelete_window_internal)
840 (Fwindow_text_height, Fset_window_margins, Fwindow_margins)
841 (Fset_window_fringes, Fwindow_fringes, Fset_window_scroll_bars)
842 (Fwindow_scroll_bars): Check whether argument window is a valid or
843 live window. Update doc-strings.
844 (syms_of_window): New symbol Qwindow_valid_p.
845 * keyboard.c (Fposn_at_x_y): Check whether argument
846 frame_or_window denotes a valid window.
847
2751c80f
DA
8482012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
849
850 Fix previous char table change.
851 * lisp.h (CHAR_TABLE_SET): Use sub_char_table_set_contents.
852 * chartab.c (optimize_sub_char_table): Likewise.
853
032a42c8
CY
8542012-08-16 Chong Yidong <cyd@gnu.org>
855
a2d19368
CY
856 * gtkutil.c (xg_get_font): Demand an Xft font (Bug#3228).
857
032a42c8
CY
858 * xfont.c (xfont_open):
859 * xftfont.c (xftfont_open): Set the font's max_width field.
860
861 * nsfont.m (nsfont_open): Similar to the Xft backend, set
862 min_width to space_width and average_width to the average over
863 printable ASCII characters.
864 (ns_char_width): Code cleanup.
865 (ns_ascii_average_width): New utility function.
866
867 * font.h (struct font): Update comments.
868
a098c930
DA
8692012-08-16 Dmitry Antipov <dmantipov@yandex.ru>
870
032a42c8 871 Simple interface to set Lisp_Object fields of character tables.
a098c930
DA
872 * lisp.h (CSET): New macro.
873 (char_table_set_extras, char_table_set_contents)
874 (sub_char_table_set_contents): New function.
875 * casetab.c, category.c, chartab.c, fns.c, fontset.c, search.c:
876 * syntax.c: Adjust users.
877
8be3a09c
SM
8782012-08-16 Stefan Monnier <monnier@iro.umontreal.ca>
879
880 * eval.c (eval_sub): Bind lexical-binding.
881 * lread.c (Qlexical_binding): Make non-static.
882
ac4845a6
JD
8832012-08-15 Jan Djärv <jan.h.d@swipnet.se>
884
ddee6515
JD
885 * nsmenu.m (popupSession): Remove.
886 (pop_down_menu): Remove endModalSession.
887 (timeout_handler:): New method.
888 (runDialogAt:): Get next timeout. Start a NSTimer with that timeout.
889 Call runModalForWindow. Check timer_fired when it returns.
890 If not set, cancel timer and break out of loop.
891 Otherwise loop again, with a new timeout.
892
893 * nsterm.m: Include fcntl.h if present.
894 (fd_entry, t_readfds, inNsSelect): Remove.
895 (select_writefds, select_valid, select_timeout, selfds)
896 (select_mutex, apploopnr): Add.
897 (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr.
898 Otherwise call kbd_buffer_store_event.
899 (ns_send_appdefined): Remove release of fd_entry.
900 (ns_read_socket): Always send appdefined. Remove inNsSelect check.
901 Increment and decrement apploopnr.
902 (ns_select): If no file descriptors, just do a NSTimer.
903 Otherwise copy read/write masks and start select thread (fd_handler).
904 Start main loop and wait for application defined event.
905 Inform select thread to stop selecting after main loop is exited.
906 (ns_term_init): Create selfds pipe and set non-blocking.
907 Initialize select_mutex. Start the select thread (fd_handler).
908 (fd_handler:): Loop forever, wait for info from the main thread
909 to either start or stop selecting. When select returns, send
910 and appdefined event.
911 (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set.
912 If not call kbd_buffer_store_event.
913
914 * nsterm.h (EmacsApp): fd_handler takes id argument.
915 (EmacsDialogPanel): Add timer_fired and timeout_handler.
916
ac4845a6
JD
917 * gtkutil.c (xg_mark_data): Use FRAME_X_P.
918
eb424fe3
EZ
9192012-08-15 Eli Zaretskii <eliz@gnu.org>
920
921 * region-cache.c (move_cache_gap): Update gap_len using the actual
922 growth of the boundaries array. Do not change cache_len.
923 (Bug#12196)
924
4e6a86c6
DA
9252012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
926
927 Generalize and cleanup font subsystem checks.
928 * font.h (FONT_DEBUG, font_assert): Remove.
8be3a09c
SM
929 * font.c, fontset.c, w32font.c, xfont.c, xftfont.c:
930 Change font_assert to eassert. Use eassert where appropriate.
4e6a86c6 931
5bf192ca
DA
9322012-08-15 Dmitry Antipov <dmantipov@yandex.ru>
933
934 * gtkutil.c (xg_get_font): Use pango_units_to_double.
935
f2045622
CY
9362012-08-15 Chong Yidong <cyd@gnu.org>
937
8be3a09c
SM
938 * gtkutil.c (xg_get_font): Rename from xg_get_font_name.
939 When using the new font chooser, use gtk_font_chooser_get_font_desc to
940 extract the font descriptor instead of just the font name.
941 In that case, return a font spec instead of a string.
f2045622
CY
942 (x_last_font_name): Move to this file from xfns.c.
943
944 * xfns.c (Fx_select_font): The return value can also be a font
945 spec. Move x_last_font_name management to gtkutil.c.
946
947 * xfaces.c: Make font weight and style symbols non-static.
948
7f6feb56
SM
9492012-08-15 Stefan Monnier <monnier@iro.umontreal.ca>
950
951 * minibuf.c (read_minibuf): Ignore caller's inhibit-read-only
952 (bug#12117).
953
fecbd8ff
SM
9542012-08-14 Stefan Monnier <monnier@iro.umontreal.ca>
955
956 * alloc.c (Fgarbage_collect): Use plural form consistently.
957
9b8d5165
EZ
9582012-08-14 Eli Zaretskii <eliz@gnu.org>
959
960 * keyboard.c (command_loop_1): Reset ignore_mouse_drag_p flag each
961 iteration through the command loop. Fixes a problem whereby mouse
962 movements are ignored until the first mouse click.
963
f5d9e83a
PE
9642012-08-14 Paul Eggert <eggert@cs.ucla.edu>
965
966 Use bool, not int, for Lisp booleans.
967 This is more natural, and on my platform (GCC 4.7.1 x86-64) it
968 makes Emacs a bit smaller and presumably a bit faster.
969 * lisp.h: Include <stdbool.h>.
970 (struct Lisp_Boolfwd, defvar_bool):
971 * lread.c (defvar_bool): Use bool, not int, for Lisp booleans.
972 * regex.c [!emacs]: Include <stdbool.h>.
973 (false, true): Remove; <stdbool.h> does this for us now.
974
55802e4a
CY
9752012-08-14 Chong Yidong <cyd@gnu.org>
976
4abcdac8
CY
977 * character.c (Fcharacterp): Doc fix (Bug#12076).
978
979 * data.c (Findirect_variable): Doc fix (Bug#11040).
980
55802e4a
CY
981 * chartab.c (Fmap_char_table): Doc fix (Bug#12061).
982
983 * editfns.c (Fformat): Doc fix (Bug#12059).
4abcdac8 984 (Fsave_current_buffer): Doc fix (Bug#11542).
55802e4a 985
8e99d072
BR
9862012-08-14 Barry OReilly <gundaetiapo@gmail.com> (tiny change)
987
988 * keyboard.c (access_keymap_keyremap): Accept anonymous functions
989 (bug#12022).
990
08908aca
MR
9912012-08-14 Martin Rudalics <rudalics@gmx.at>
992
993 * frame.c (make_frame_without_minibuffer, make_minibuffer_frame)
994 (delete_frame, Fmake_frame_invisible, Ficonify_frame):
995 * minibuf.c (choose_minibuf_frame, read_minibuf):
996 * w32fns.c (x_create_tip_frame):
997 * xfns.c (x_create_tip_frame): Call set_window_buffer instead of
998 Fset_window_buffer (Bug#11984, Bug#12025, Bug#12026).
999
56120d6f
PE
10002012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1001
1002 * intervals.c (offset_intervals): Remove obsolete comment.
1003
67b77c0b
AS
10042012-08-14 Andreas Schwab <schwab@linux-m68k.org>
1005
1006 * gtkutil.c (find_rtl_image, update_frame_tool_bar): Use NILP.
1007
f48b82fd
GR
10082012-08-14 Gergely Risko <gergely@risko.hu>
1009
1010 * coding.c (decode_coding): Record buffer modification before
1011 disabling undo_list (Bug#11773).
1012
fd318b54
DA
10132012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1014
1015 Revert and cleanup some recent overlay changes.
1016 * buffer.h (enum overlay_type): Remove.
1017 (buffer_get_overlays, buffer_set_overlays): Likewise.
1018 (buffer_set_overlays_before, buffer_set_overlays_after):
1019 New function. Adjust users.
1020 (unchain_both): Add eassert.
1021
41a62dd9
DA
10222012-08-14 Dmitry Antipov <dmantipov@yandex.ru>
1023
1024 * gtkutil.c (update_frame_tool_bar): Use EQ where appropriate.
1025
5884c324
PE
10262012-08-14 Paul Eggert <eggert@cs.ucla.edu>
1027
1028 * gtkutil.c (xg_mark_data): Don't assume C99.
1029
ca06f160
JD
10302012-08-13 Jan Djärv <jan.h.d@swipnet.se>
1031
1032 * gtkutil.c (xg_frame_tb_info): New struct.
1033 (TB_INFO_KEY): New define.
1034 (xg_free_frame_widgets): Free xg_frame_tb_info for frame if present.
1035 (xg_mark_data): Mark Lisp_Objects in xg_frame_tb_info.
1036 (xg_create_tool_bar): Allocate and initialize a xg_frame_tb_info
1037 if not present.
1038 (update_frame_tool_bar): Return early if data in xg_frame_tb_info
1039 is up to date. Otherwise store new data.
1040 (free_frame_tool_bar): Free xg_frame_tb_info if present.
1041
7864a3f7
DA
10422012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1043
1044 Use KSET for write access to Lisp_Object members of struct kboard.
1045 * keyboard.h (KSET): New macro.
1046 * callint.c, category.c, frame.c, keyboard.c, keyboard.h, macros.c:
1047 * msdos.c, nsfns.m, nsterm.m, term.c, w32fns.c, w32term.c, xfns.c:
1048 * xterm.c: Adjust users.
1049
4c31be61
DA
10502012-08-13 Dmitry Antipov <dmantipov@yandex.ru>
1051
1052 Use BSET for write access to Lisp_Object members of struct buffer.
1053 * buffer.h (BSET): New macro.
1054 * buffer.c, casetab.c, cmds.c, coding.c, data.c, editfns.c:
1055 * fileio.c, frame.c, indent.c, insdel.c, intervals.c, keymap.c:
1056 * minibuf.c, print.c, process.c, syntax.c, undo.c, w32fns.c:
1057 * window.c, xdisp.c, xfns.c: Adjust users.
1058
14ae4239
BT
10592012-08-11 BT Templeton <bpt@hcoop.net> (tiny change)
1060
1061 * lread.c (syms_of_lread): Initialize Vlexical_binding.
1062
32bcadb4
JD
10632012-08-11 Jan Djärv <jan.h.d@swipnet.se>
1064
3d29b2ce
JD
1065 * nsterm.m (not_in_argv): New function.
1066 (application:openFile, application:openTempFile:):
1067 (application:openFileWithoutUI:, application:openFiles:): Open file
1068 if not_in_argv returns non-zero (bug#12171).
1069
32bcadb4 1070 * gtkutil.c (gtk_font_chooser_dialog_new, GTK_FONT_CHOOSER)
14ae4239
BT
1071 (gtk_font_chooser_set_font, gtk_font_chooser_get_font):
1072 Define for Gtk+ versions less than 3.2.
32bcadb4
JD
1073 (xg_get_font_name): Use those functions/macros here.
1074 Reported by Frans Oilinki <moilinki@gmail.com>.
1075
9ff9402d 10762012-08-11 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
8ccd072a
YM
1077
1078 * unexmacosx.c (copy_data_segment): Copy initialized data in
1079 statically linked libraries from input file rather than memory.
1080
db74a5fc
YM
1081 * unexmacosx.c (print_load_command_name): Add cases LC_MAIN,
1082 LC_SOURCE_VERSION, and LC_DYLIB_CODE_SIGN_DRS.
1083 (dump_it) [LC_DYLIB_CODE_SIGN_DRS]: Call copy_linkedit_data.
1084
25e65510
GM
10852012-08-10 Glenn Morris <rgm@gnu.org>
1086
1087 * conf_post.h (IF_LINT, lint_assume): Move here from lisp.h.
1088 * lisp.h (IF_LINT, lint_assume): Move to conf_post.h.
1089
7961135c
DA
10902012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1091
1092 Fix last change to allow compilation with low optimization levels.
1093 * intervals.c (INTERVALS_INLINE): Define to EXTERN_INLINE.
1094 Reported by Jan Djärv <jan.h.d@swipnet.se>.
1095
42b3a444
DA
10962012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1097
1098 Use common inline syntax in intervals.h.
1099 * intervals.h (INTERVALS_INLINE): New macro.
1100 Change all users from LISP_INLINE.
1101
9fb0c957
DA
11022012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1103
1104 Define Qnone once for all platforms.
1105 * frame.c (Qnone): Define here.
1106 (syms_of_frame): DEFSYM it.
1107 * lisp.h (Qnone): New declaration.
1108 * nsfns.m, nsterm.h, nsterm.m, w32fns.c, w32font.c:
1109 * xfns.c: Remove duplication. Adjust users.
1110
65e8ee52
DA
11112012-08-10 Dmitry Antipov <dmantipov@yandex.ru>
1112
1113 Remove unused macros from intervals.h.
1114 * intervals.h (MERGE_INSERTIONS, DISPLAY_INVISIBLE_GLYPH): Remove.
1115 * intervals.c: Adjust comment.
1116
9b855fd6
EZ
11172012-08-10 Eli Zaretskii <eliz@gnu.org>
1118
1119 * w32fns.c <w32_unicode_gui>: New static variable.
1120 (globals_of_w32fns): Initialize it according to os_subtype.
1121 (w32_init_class, w32_msg_pump, w32_wnd_proc): Use it instead of
1122 testing os_subtype.
1123
39cb9e56 11242012-08-10 Joakim Hårsman <joakim.harsman@gmail.com> (tiny change)
d30be705
EZ
1125 Eli Zaretskii <eliz@gnu.org>
1126
1127 Fix bug #10299 with Unicode characters sent by customized
1128 keyboards created by MSKLC.
1129 * w32fns.c (INIT_WINDOW_CLASS): New macro.
1130 (w32_init_class): Use it to initialize the Emacs class with either
1131 ANSI or Unicode API calls.
1132 (w32_msg_pump): Call GetMessageW and DispatchMessageW on NT and
1133 later.
1134 (w32_wnd_proc): If the character code sent by WM_CHAR or
1135 WM_SYSCHAR is above 255, post a WM_UNICHAR message, not the
1136 original message. Call DefWindowProcW on NT and later.
1137
9374581a
GM
11382012-08-10 Glenn Morris <rgm@gnu.org>
1139
4b94e8cf
GM
1140 * Makefile.in (config_h): Fix conf_post.h out-of-tree build location.
1141
9374581a
GM
1142 * lisp.h (DIRECTORY_SEP): Let configure set it.
1143
a2752828
DA
11442012-08-09 Dmitry Antipov <dmantipov@yandex.ru>
1145
1146 Use TSET for write access to Lisp_Object slots of struct terminal.
1147 * termhooks.h (TSET): New macro.
1148 * coding.c, terminal.c, xselect.c: Adjust users.
1149
cc92c454
SM
11502012-08-08 Stefan Monnier <monnier@iro.umontreal.ca>
1151
1152 * xdisp.c (safe_eval_handler): Remove prototype. Receive args describing
1153 the failing expression, include them in the error message.
1154 * eval.c (internal_condition_case_n): Pass nargs and args to hfun.
1155 * lisp.h (internal_condition_case_n): Update declaration.
1156
4cb3e6b3
DA
11572012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1158
1159 Inline functions to examine and change buffer overlays.
1160 * buffer.c (unchain_both): New function.
1161 * buffer.h (buffer_get_overlays, buffer_set_overlays):
1162 (buffer_has_overlays): New function.
1163 (enum overlay_type): New enum.
1164 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c:
1165 * insdel.c, intervals.c, print.c, xdisp.c: Adjust users.
1166
8707c1e5
DA
11672012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1168
1169 Inline functions to examine and change buffer intervals.
1170 * alloc.c (mark_interval_tree): Remove.
1171 (MARK_INTERVAL_TREE): Simplify.
1172 (UNMARK_BALANCE_INTERVALS): Remove. Adjust users.
1173 * intervals.c (buffer_balance_intervals): New function.
1174 (graft_intervals_into_buffer): Adjust indentation.
1175 (set_intervals_multibyte): Simplify.
1176 * buffer.h (BUF_INTERVALS): Remove.
1177 (buffer_get_intervals, buffer_set_intervals): New function.
1178 * alloc.c, buffer.c, editfns.c, fileio.c, indent.c, insdel.c:
1179 * intervals.c, textprop.c: Adjust users.
1180
ad8c997f
DA
11812012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1182
1183 Inline functions to examine and change string intervals.
1184 * lisp.h (STRING_INTERVALS, STRING_SET_INTERVALS): Remove.
1185 (string_get_intervals, string_set_intervals): New function.
1186 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1187 * lread.c, print.c, textprop.c: Adjust users.
1188
32ac3a6b
GM
11892012-08-08 Glenn Morris <rgm@gnu.org>
1190
1191 * lisp.mk (lisp): Remove language/persian.elc.
1192
77c7bcb1
DA
11932012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1194
1195 Cleanup intervals.
1196 * intervals.h (NULL_INTERVAL, DEFAULT_INTERVAL): Remove.
1197 (NULL_INTERVAL_P): Likewise. Adjust users.
14ae4239
BT
1198 (FRONT_STICKY_P, END_NONSTICKY_P, FRONT_NONSTICKY_P):
1199 Adjust comment. Move under #if 0.
77c7bcb1
DA
1200 * alloc.c, buffer.c, editfns.c, fns.c, insdel.c, intervals.c:
1201 * print.c, syntax.c, textprop.c, xdisp.c: Adjust users.
1202
9c08a8d4
DA
12032012-08-08 Dmitry Antipov <dmantipov@yandex.ru>
1204
1205 Check total length of intervals with eassert.
1206 * intervals.h (CHECK_TOTAL_LENGTH): Remove.
1207 * intervals.c: Change all users to eassert.
1208
26d16b35
EZ
12092012-08-07 Eli Zaretskii <eliz@gnu.org>
1210
14ae4239
BT
1211 * .gdbinit (xframe, xwindow, nextcons, xcar, xcdr, xlist):
1212 Rename fields to match removal of FGET and WGET and disuse of
26d16b35
EZ
1213 INTERNAL_FIELD in Lisp_Cons.
1214
c644523b
DA
12152012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1216
1217 Revert and cleanup Lisp_Cons, Lisp_Misc and Lisp_Symbol things.
1218 * lisp.h (struct Lisp_Symbol): Change xname to meaningful
1219 name since all xname users are fixed long time ago. Do not
1220 use INTERNAL_FIELD.
1221 (set_symbol_name, set_symbol_function, set_symbol_plist):
1222 (set_symbol_next, set_overlay_plist): New function.
1223 (struct Lisp_Cons): Do not use INTERNAL_FIELD.
1224 (struct Lisp_Overlay): Likewise.
1225 (CVAR, MVAR, SVAR): Remove.
1226 * alloc.c, buffer.c, buffer.h, bytecode.c, cmds.c, data.c:
1227 * doc.c, eval.c, fns.c, keyboard.c, lread.c, nsselect.m:
1228 * xterm.c: Adjust users.
1229 * .gdbinit: Change to use name field of struct Lisp_Symbol
1230 where appropriate.
1231
6a3d20cc
DA
12322012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1233
1234 Basic functions to set Lisp_Object and pointer slots of intervals.
1235 * intervals.h (interval_set_parent, interval_set_object):
1236 (interval_set_left, interval_set_right, interval_set_plist):
1237 (interval_copy_parent): New function.
1238 (SET_INTERVAL_OBJECT, SET_INTERVAL_PARENT, INTERVAL_PTR_SIZE): Remove.
14ae4239
BT
1239 (RESET_INTERVAL, COPY_INTERVAL_CACHE, MERGE_INTERVAL_CACHE):
1240 Adjust indentation.
6a3d20cc
DA
1241 (INTERVAL_SIZE): Remove. Adjust users.
1242 * alloc.c, intervals.c, lread.c, textprop.c: Use new functions.
1243
4d2b044c
DA
12442012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1245
1246 Drop PGET and revert read access to Lisp_Objects slots of Lisp_Process.
1247 * process.h (PGET): Remove.
1248 (struct Lisp_Process): Do not use INTERNAL_FIELD.
1249 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1250
d3d50620
DA
12512012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1252
1253 Drop WGET and revert read access to Lisp_Objects slots of struct window.
1254 * window.h (WGET): Remove.
1255 (struct window): Do not use INTERNAL_FIELD.
1256 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1257 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1258 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1259 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1260 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1261 Adjust users.
1262
d10a51dc
CY
12632012-08-07 Chong Yidong <cyd@gnu.org>
1264
1265 * window.c (Fwindow_edges, Fwindow_pixel_edges)
1266 (Fwindow_absolute_pixel_edges, Fdelete_other_windows_internal)
1267 (Fdelete_window_internal): Signal an error if the window is not on
1268 a live frame (Bug#12025).
1269
e69b0960
DA
12702012-08-07 Dmitry Antipov <dmantipov@yandex.ru>
1271
1272 Drop FGET and revert read access to Lisp_Objects slots of struct frame.
1273 * frame.h (FGET): Remove.
1274 (struct frame): Do not use INTERNAL_FIELD.
1275 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1276 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1277 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1278 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1279
25a20a3a
JB
12802012-08-06 Juanma Barranquero <lekktu@gmail.com>
1281
1282 * w32.c: Silence compiler warnings.
1283 (map_w32_filename): Remove unused variable `is_fat'.
1284 (chase_symlinks): Add parentheses around expression.
1285
1c6f11f4
GM
12862012-08-06 Glenn Morris <rgm@gnu.org>
1287
1db4583a
GM
1288 * sysdep.c: Respect BROKEN_GETWD.
1289
1c6f11f4
GM
1290 * dispnew.c (GNU_LIBRARY_PENDING_OUTPUT_COUNT, PENDING_OUTPUT_COUNT):
1291 Let configure handle it.
1292 (stdio_ext.h) [DISPNEW_NEEDS_STDIO_EXT]: Include it.
1293
2b90362b
DA
12942012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1295
1296 Use GCALIGNMENT where appropriate.
1297 * alloc.c (XMALLOC_HEADER_ALIGNMENT, roundup_size):
1298 (union aligned_Lisp_Symbol, union aligned_Lisp_Misc):
1299 (mark_maybe_pointer, pure_alloc): Change to use GCALIGNMENT.
1300
5f50daf2
EZ
13012012-08-06 Eli Zaretskii <eliz@gnu.org>
1302
14ae4239
BT
1303 * w32menu.c (set_frame_menubar, initialize_frame_menubar):
1304 Don't use FRAME_MENU_BAR_ITEMS as an lvalue.
5f50daf2 1305
cbcc7007
SM
13062012-08-06 Stefan Monnier <monnier@iro.umontreal.ca>
1307
1308 * buffer.h (struct buffer): Revert `indirections' to a simple int;
1309 that should be sufficient for everyone.
1310
4d365fa4
JD
13112012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1312
1313 * keyboard.c (timer_check_2): Add break so timer_check returns next
1314 timeout.
1315
dd86bd82
DA
13162012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1317
1318 Fix Windows build errors introduced after converting to WGET and WSET.
1319 * w32term.c (w32_set_vertical_scroll_bar): Change to use WSET.
1320 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1321
054e1668
JD
13222012-08-06 Jan Djärv <jan.h.d@swipnet.se>
1323
1324 * nsterm.m (ns_frame_rehighlight): Use FSET.
1325
1326 * nsmenu.m (ns_update_menubar): Use FSET.
1327
21238f11
DA
13282012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1329
1330 Separate read and write access to Lisp_Object slots of Lisp_Process.
1331 * process.h (PGET, PSET): New macros similar to AREF and ASET.
1332 * gnutls.c, print.c, process.c, sysdep.c, w32.c, xdisp.c: Adjust users.
1333
077288cf
DA
13342012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1335
1336 Separate read and write access to Lisp_Object slots of struct window.
1337 * window.h (WGET, WSET): New macros similar to AREF and ASET.
1338 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1339 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1340 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, msdos.c, nsfns.m:
1341 * nsmenu.m, nsterm.m, print.c, textprop.c, w32fns.c, w32menu.c:
1342 * w32term.c, window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c:
1343 Adjust users.
1344
71688bd7
DA
13452012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1346
1347 Fix Windows build errors introduced after converting to FGET and FSET.
1348 * w32term.c (x_frame_rehighlight, x_scroll_bar_create):
1349 (w32_condemn_scroll_bars, w32_redeem_scroll_bar):
1350 (w32_judge_scroll_bars): Change to use FSET.
1351 Reported by Andy Moreton <andrewjmoreton@gmail.com>.
1352
f99bac93
DA
13532012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1354
1355 Fix replacement typo.
1356 * window.c (replace_window): Set root_window instead of
1357 selected_window. This fixes a total window subsystem
1358 malfunction reported by Bastien Guerry <bzg@gnu.org>.
1359
8c2a0f2d
GM
13602012-08-06 Glenn Morris <rgm@gnu.org>
1361
1362 * lisp.mk (lisp): Add language/persian.elc.
1363
edd74c35
DA
13642012-08-06 Dmitry Antipov <dmantipov@yandex.ru>
1365
1366 Separate read and write access to Lisp_Object slots of struct frame.
1367 * frame.h (FGET, FSET): New macros similar to AREF and ASET.
1368 * buffer.c, data.c, dispnew.c, dosfns.c, eval.c, fontset.c, frame.c:
1369 * fringe.c, gtkutil.c, minibuf.c, msdos.c, nsfns.m, nsmenu.m, nsterm.m:
1370 * print.c, term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
1371 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Adjust users.
1372
8671676c
AS
13732012-08-05 Andreas Schwab <schwab@linux-m68k.org>
1374
1375 * emacs.c (decode_env_path): Only use defaulted if WINDOWSNT.
1376
663e2b3f
DA
13772012-08-05 Dmitry Antipov <dmantipov@yandex.ru>
1378
1379 Generalize common compile-time constants.
1380 * lisp.h (header_size, bool_header_size, word_size): Now here.
1381 (struct Lisp_Vector): Add comment.
1382 (struct Lisp_Bool_Vector): Move up to define handy constants.
1383 (VECSIZE, PSEUDOVECSIZE): Simplify.
1384 (SAFE_ALLOCA_LISP): Use new constant. Adjust indentation.
1385 * buffer.c, buffer.h, bytecode.c, callint.c, eval.c, fns.c:
1386 * font.c, fontset.c, keyboard.c, keymap.c, macros.c, menu.c:
1387 * msdos.c, w32menu.c, w32term.h, window.c, xdisp.c, xfaces.c:
1388 * xfont.c, xmenu.c: Use word_size where appropriate.
1389
d32e47af
LM
13902012-08-05 Lawrence Mitchell <wence@gmx.li>
1391
1392 * search.c (Freplace_match): Treat \? in the replacement text
1393 literally (Bug#8161).
1394
e5d9c0d1
CY
13952012-08-05 Chong Yidong <cyd@gnu.org>
1396
1397 * term.c (Vsuspend_tty_functions, Vresume_tty_functions):
1398 * frame.c (Vdelete_frame_functions):
1399 * emacs.c (Vkill_emacs_hook): Doc fix.
1400
8da0576b
EZ
14012012-08-04 Eli Zaretskii <eliz@gnu.org>
1402
1403 * xfns.c (x_set_menu_bar_lines): Fix compilation error in
1404 --with-x-toolkit=no builds.
1405 Reported by Carsten Mattner <carstenmattner@gmail.com>.
1406
02676e5d
CY
14072012-08-04 Chong Yidong <cyd@gnu.org>
1408
1409 * syntax.c (Fmodify_syntax_entry): Doc fix.
1410
97147da9
EZ
14112012-08-04 Eli Zaretskii <eliz@gnu.org>
1412
76151e2c
EZ
1413 Fix startup warnings about ../site-lisp on MS-Windows. (Bug#11959)
1414 * w32.c (init_environment): Change the default values of many
1415 environment variables in dflt_envvars[] to NULL, to avoid pushing
14ae4239
BT
1416 them into environment when they were not already defined.
1417 Remove the code that deletes site-lisp subdirectories from the default
76151e2c 1418 value of EMACSLOADPATH, as it is no longer needed.
14ae4239
BT
1419 (check_windows_init_file): Now external, not static.
1420 Use Vload_path as is, without adding anything, as this function is now
76151e2c
EZ
1421 called when Vload_path is already set up.
1422
1423 * w32.h (check_windows_init_file): Add prototype.
1424
1425 * emacs.c (init_cmdargs) [WINDOWSNT]: When running from the build
1426 directory, ignore the /*/i386/ tail in Vinvocation_directory, for
1427 compatibility with Posix platforms.
1428 (main): Move the call to check_windows_init_file to here from
1429 w32.c.
1430 (decode_env_path) [WINDOWSNT]: Expand the %emacs_dir%/ prefix, if
1431 any, in the DEFALT argument into the root of the Emacs build or
1432 installation tree, as appropriate.
1433
1434 * callproc.c (init_callproc_1): Call decode_env_path instead of
1435 doing its equivalent by hand.
1436 (init_callproc): Replace DOS_NT condition with MSDOS, thus letting
1437 the code that sets Vexec_path run on MS-Windows.
1438
1439 * lread.c (init_lread): Add comments to #ifdef's.
1440
97147da9
EZ
1441 * msdos.c (dos_set_window_size, IT_update_begin)
1442 (IT_frame_up_to_date, IT_set_frame_parameters): Use FVAR and WVAR
1443 instead of direct references.
1444
185ee146
PE
14452012-08-04 Paul Eggert <eggert@cs.ucla.edu>
1446
1447 Export DEFAULT_REHASH_* to GDB.
1448 * lisp.h (DEFAULT_REHASH_THRESHOLD, DEFAULT_REHASH_SIZE):
1449 Now constants, not macros.
1450
8834c57a
PE
14512012-08-03 Paul Eggert <eggert@cs.ucla.edu>
1452
98c6f1e3
PE
1453 Remove unnecessary casts involving pointers.
1454 These casts are no longer needed now that we assume C89 or later,
1455 since they involve casting to or from void *.
1456 * alloc.c (make_pure_string, make_pure_c_string, pure_cons)
1457 (make_pure_float, make_pure_vector):
1458 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP):
1459 * macros.c (Fstart_kbd_macro):
1460 * menu.c (find_and_return_menu_selection):
1461 * minibuf.c (read_minibuf_noninteractive):
1462 * sysdep.c (closedir):
1463 * xdisp.c (x_produce_glyphs):
1464 * xfaces.c (compare_fonts_by_sort_order):
1465 * xfns.c (x_real_positions, select_visual):
1466 * xselect.c (x_stop_queuing_selection_requests)
1467 (x_get_window_property, x_get_window_property_as_lisp_data):
1468 * xterm.c (x_set_frame_alpha, x_find_modifier_meanings):
1469 Remove unnecessary pointer casts.
1470 * alloc.c (record_xmalloc): New function.
1471 * lisp.h (record_xmalloc): New decl.
1472 (SAFE_ALLOCA): Now takes just one arg -- the size -- and acts
1473 more like a function. This is because the pointer cast is not
1474 needed. All uses changed.
1475 * print.c (print_string, print_error_message): Avoid length recalc.
1476
8834c57a
PE
1477 Improve fix for macroexp crash with debugging (Bug#12118).
1478 * lisp.h (ASET) [ENABLE_CHECKING]: Pay attention to
1479 ARRAY_MARK_FLAG when checking subscripts, because ASET is
1480 not supposed to be invoked from the garbage collector.
1481 See Andreas Schwab in <http://bugs.gnu.org/12118#25>.
1482 (gc_aset): New function, which is like ASET but can be
1483 used in the garbage collector.
1484 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1485 (set_hash_index): Use it instead of ASET.
1486
6dad7178
EZ
14872012-08-03 Eli Zaretskii <eliz@gnu.org>
1488
1489 Support symlinks on latest versions of MS-Windows.
1490 * w32.c: Include winioctl.h and aclapi.h.
1491 (is_symlink, chase_symlinks, enable_privilege, restore_privilege)
1492 (revert_to_self): Forward declarations of static functions.
1493 <static BOOL g_b_init_get_security_info>:
1494 <g_b_init_create_symbolic_link>: New static flags.
1495 (globals_of_w32): Initialize them to zero.
1496 (GetSecurityInfo_Proc, CreateSymbolicLink_Proc): New typedefs.
1497 (map_w32_filename): Improve commentary. Simplify switch.
1498 (SYMBOLIC_LINK_FLAG_DIRECTORY): Define if not defined in system
1499 headers (most versions of MinGW w32api don't).
1500 (get_security_info, create_symbolic_link)
1501 (get_file_security_desc_by_handle, is_symlink, chase_symlinks):
1502 New functions.
1503 (sys_access, sys_chmod): Call 'chase_symlinks' to resolve symlinks
1504 in the argument file name.
1505 (sys_access): Call unc_volume_file_attributes only if
1506 GetFileAttributes fails with network-related error codes.
1507 (sys_rename): Diagnose renaming of a symlink when the user doesn't
1508 have the required privileges.
14ae4239 1509 (get_file_security_desc_by_name): Rename from
6dad7178
EZ
1510 get_file_security_desc.
1511 (stat_worker): New function, with most of the guts of 'stat', and
14ae4239
BT
1512 with addition of handling of symlinks and support for 'lstat'.
1513 If possible, get file's attributes and security information by
6dad7178
EZ
1514 handle, not by name. Produce S_IFLNK bit for symlinks, when
1515 called from 'lstat'.
1516 (stat, lstat): New functions, call 'stat_worker'.
1517 (symlink, readlink, careadlinkat): Rewritten to create and resolve
1518 symlinks when the underlying filesystem supports them.
1519
f162bcc3
PE
15202012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1521
79ea6c20
PE
1522 Fix macroexp crash on Windows with debugging (Bug#12118).
1523 * lisp.h (ASET) [ENABLE_CHECKING]: Ignore ARRAY_MARK_FLAG when
1524 checking subscripts; problem introduced with the recent
1525 "ASET (a, i, v)" rather than "AREF (a, i) = v" patch.
1526 (ARRAY_MARK_FLAG): Now a macro as well as a constant,
1527 since it's used in non-static inline functions now.
1528
c0ce93fd
PE
1529 * xfaces.c (face_at_buffer_position, face_for_overlay_string):
1530 Don't assume buffer size fits in 'int'. Remove unused local.
c71f5156 1531
f162bcc3
PE
1532 Use C99-style 'extern inline' if available.
1533 * buffer.h (BUFFER_INLINE):
1534 * category.h (CATEGORY_INLINE):
1535 * character.h (CHARACTER_INLINE):
1536 * charset.h (CHARSET_INLINE):
1537 * composite.h (COMPOSITE_INLINE):
1538 * dispextern.h (DISPEXTERN_INLINE):
1539 * lisp.h (LISP_INLINE):
1540 * systime.h (SYSTIME_INLINE):
1541 New macro, replacing 'static inline' in this header.
1542 * buffer.h, category.h, character.h, charset.h, composite.h:
1543 * dispextern.h, lisp.h, systime.h:
1544 Use INLINE_HEADER_BEGIN, INLINE_HEADER_END.
1545 * alloc.c (LISP_INLINE):
1546 * buffer.c (BUFFER_INLINE):
1547 * category.c (CATEGORY_INLINE):
1548 * character.c (CHARACTER_INLINE):
1549 * charset.c (CHARSET_INLINE):
1550 * composite.c (COMPOSITE_INLINE):
1551 * dispnew.c (DISPEXTERN_INLINE):
1552 * sysdep.c (SYSTIME_INLINE):
1553 Define to EXTERN_INLINE, so that the corresponding functions
1554 are compiled into code.
1555 * conf_post.h (INLINE, EXTERN_INLINE, INLINE_HEADER_BEGIN)
1556 (INLINE_HEADER_END): New macros.
1557 * lisp.h (PSEUDOVECTOR_FLAG): Now a macro as well as a constant,
1558 since it's used in non-static inline functions now.
a8333d03 1559 (VALMASK) [!USE_LSB_TAG]: Likewise.
f162bcc3 1560
837b365b
GM
15612012-08-02 Glenn Morris <rgm@gnu.org>
1562
d66b744d
GM
1563 * s/: Remove empty directory.
1564
837b365b
GM
1565 * s/ms-w32.h: Move to ../nt/inc.
1566 * makefile.w32-in (TAGS, TAGS-gmake, MS_W32_H):
1567 Update for new ms-w32.h location.
1568
13294f95
PE
15692012-08-02 Paul Eggert <eggert@cs.ucla.edu>
1570
1571 Port to Solaris 8.
1572 * syswait.h (WRETCODE): Remove, consistently with ../configure.ac.
1573
90df0db3
GM
15742012-08-02 Glenn Morris <rgm@gnu.org>
1575
1576 * nsterm.m (ns_exec_path, ns_load_path): Use SEPCHAR rather than
1577 hard-coding the path separator.
1578
4939150c
PE
15792012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1580
1581 Use "ASET (a, i, v)" rather than "AREF (a, i) = v".
1582 This how ASET and AREF are supposed to work, and makes
1583 it easier to think about future improvements. See
1584 <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00026.html>.
1585 * charset.h (set_charset_attr): New function.
1586 All lvalue-style uses of CHARSET_DECODER etc. changed to use it.
1587 * lisp.h (ASET): Rewrite so as not to use AREF in an lvalue style.
1588 (aref_addr): New function. All uses of &AREF(...) changed.
1589 (set_hash_key, set_hash_value, set_hash_next, set_hash_hash)
1590 (set_hash_index): New functions. All lvalue-style uses of
1591 HASH_KEY etc. changed.
1592 * keyboard.c (set_prop): New function. All lvalue-style uses
1593 of PROP changed.
1594
947b2afd
AA
15952012-08-01 Alp Aker <alp.tekin.aker@gmail.com>
1596
1597 * nsterm.m (ns_set_vertical_scroll_bar, ns_redeem_scroll_bar)
1598 (EmacsWindow-accessibilityAttributeValue, EmacsScroller-initFrame:)
1599 (EmacsScroller-dealloc): Adjust to use WVAR. (Bug#12114)
1600 * nsfns.m (ns_set_name_as_filename): Likewise.
1601 * nsmenu.m (ns_update_menubar): Likewise.
1602 * nsselect.m (symbol_to_nsstring): Adjust to use SVAR.
1603
4f5d0325
EZ
16042012-08-01 Eli Zaretskii <eliz@gnu.org>
1605
2008beae
EZ
1606 * .gdbinit (xcar, xcdr, xlist, xwindow, nextcons, xprintsym):
1607 Adapt to latest changes in field names of the corresponding Lisp
288479f6 1608 objects.
2008beae 1609
4f5d0325
EZ
1610 * xdisp.c (try_window_id): Use WVAR in IF_DEBUG code.
1611
fe3cc771
GM
16122012-08-01 Glenn Morris <rgm@gnu.org>
1613
1614 * s/msdos.h: Remove file.
1615 * conf_post.h [MSDOS]: New section, moved from s/msdos.h.
1616 * Makefile.in (S_FILE): Remove.
1617 (config_h): Remove S_FILE.
1618
c90acc54
JB
16192012-08-01 Juanma Barranquero <lekktu@gmail.com>
1620
1621 * s/ms-w32.h (DEVICE_SEP, IS_DIRECTORY_SEP, IS_ANY_SEP):
1622 Remove; moved to nt/config.nt.
1623
d8a05828
DA
16242012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1625
1626 Use INTERNAL_FIELD for conses and overlays.
1627 * lisp.h (struct Lisp_Cons): Use INTERNAL_FIELD.
1628 Remove obsolete comment.
1629 (MVAR): New macro.
1630 (struct Lisp_Overlay): Use INTERNAL_FIELD.
1631 * alloc.c, buffer.c, buffer.h, fns.c: Adjust users.
1632
8271d590
DA
16332012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1634
1635 Use INTERNAL_FIELD for symbols.
1636 * lisp.h (SVAR): New macro. Adjust users.
1637 * alloc.c, bytecode.c, cmds.c, data.c, doc.c, eval.c:
1638 * fns.c, keyboard.c, lread.c, xterm.c: Users changed.
1639
3193acd2
DA
16402012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1641
1642 Use INTERNAL_FIELD for processes.
1643 * process.h (PVAR): New macro. Adjust style.
1644 (struct Lisp_Process): Change Lisp_Object members to INTERNAL_FIELD.
1645 * print.c, process.c, sysdep.c, w32.c, xdisp.c: Users changed.
1646
3a45383a
DA
16472012-08-01 Dmitry Antipov <dmantipov@yandex.ru>
1648
1649 Use INTERNAL_FIELD for windows.
1650 * window.h (WVAR): New macro.
1651 (struct window): Change Lisp_Object members to INTERNAL_FIELD.
1652 * alloc.c, buffer.c, composite.c, dispextern.h, dispnew.c, editfns.c:
1653 * fileio.c, font.c, fontset.c, frame.c, frame.h, fringe.c, indent.c:
1654 * insdel.c, keyboard.c, keymap.c, lisp.h, minibuf.c, nsterm.m, print.c:
1655 * textprop.c, w32fns.c, w32menu.c, w32term.c, window.c, xdisp.c:
1656 * xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1657
c1dbc63c
PE
16582012-08-01 Paul Eggert <eggert@cs.ucla.edu>
1659
1660 * coding.h (CODING_ATTR_FLUSHING): Remove; unused and wouldn't work.
1661
5c0c0e8a
GM
16622012-08-01 Glenn Morris <rgm@gnu.org>
1663
1664 * lisp.h (IS_DIRECTORY_SEP, IS_DEVICE_SEP, IS_ANY_SEP):
1665 Move to configure.ac.
1666
552a99b4
JB
16672012-08-01 Juanma Barranquero <lekktu@gmail.com>
1668
1669 * makefile.w32-in (CONFIG_H): Update dependencies.
1670 (CONF_POST_H): New macro.
1671
1672 * s/ms-w32.h (SEPCHAR, NULL_DEVICE): Remove; moved to nt/config.nt.
1673
8d8e2dfe
GM
16742012-07-31 Glenn Morris <rgm@gnu.org>
1675
bc96620a
GM
1676 * Makefile.in (S_FILE): No longer set by configure.
1677
476b1b2d
GM
1678 * conf_post.h (config_opsysfile): Move earlier, so that WINDOWSNT
1679 is available.
1680 (alloca.h) [WINDOWSNT]: Don't include it on MS Windows.
1681
b2c7a106
GM
1682 * process.h (NULL_DEVICE):
1683 * emacs.c (SEPCHAR):
1684 * editfns.c (USER_FULL_NAME): Let configure set them.
1685
d53d062a
GM
1686 * s/README, s/template.h: Remove files.
1687
4515017f
GM
1688 * conf_post.h [HPUX]: Undefine HAVE_RANDOM and HAVE_RINT.
1689
8d8e2dfe
GM
1690 * conf_post.h (AMPERSAND_FULL_NAME, subprocesses):
1691 Move to configure.ac.
1692
5b20b3cc
EZ
16932012-07-31 Eli Zaretskii <eliz@gnu.org>
1694
1e0afd9a
EZ
1695 * .gdbinit (xframe): Adapt to introduction of FVAR and the
1696 resulting renaming of 'struct frame' members.
1697
5b20b3cc
EZ
1698 * w32menu.c (w32_menu_show): Revert bogus introduction of FVAR.
1699
1700 * fontset.c (dump_fontset): Fix compilation with ENABLE_CHECKING
1701 after introduction of FVAR.
1702
f1310128
JD
17032012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1704
79e721e0
JD
1705 * nsmenu.m (update_frame_tool_bar): Change key from NSObject* to id.
1706
1707 * nsterm.m (ns_draw_fringe_bitmap, ns_dumpglyphs_image): Use drawInRect
1708 instead of compositeToPoint.
1709 (applicationShouldTerminate): Pass NS String literal to NSRunAlertPanel.
1710
8d7c7eed 1711 * nsfns.m, nsmenu.m, nsterm.m: Adopt to struct frame/FVAR changes.
f1310128 1712
e34f7f79
DA
17132012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1714
1715 Generalize INTERNAL_FIELD between buffers, keyboards and frames.
1716 * lisp.h (INTERNAL_FIELD): New macro.
14ae4239 1717 * buffer.h (BUFFER_INTERNAL_FIELD): Remove.
e34f7f79
DA
1718 (BVAR): Change to use INTERNAL_FIELD.
1719 * keyboard.h (KBOARD_INTERNAL_FIELD): Likewise.
1720 (KVAR): Change to use INTERNAL_FIELD.
1721 * frame.h (FVAR): New macro.
1722 (struct frame): Use INTERNAL_FIELD for all Lisp_Object fields.
3a45383a
DA
1723 * alloc.c, buffer.c, data.c, dispnew.c, dosfns.c, eval.c, frame.c:
1724 * fringe.c, gtkutil.c, minibuf.c, nsfns.m, nsterm.m, print.c:
1725 * term.c, w32fns.c, w32menu.c, w32term.c, window.c, window.h:
e34f7f79
DA
1726 * xdisp.c, xfaces.c, xfns.c, xmenu.c, xterm.c: Users changed.
1727
c09bfb2f
DA
17282012-07-31 Dmitry Antipov <dmantipov@yandex.ru>
1729
1730 Miscellaneous fixes for non-default X toolkits.
1731 * xfns.c (Fx_file_dialog): Change to SSDATA to avoid warnings.
1732 * xterm.c (x_frame_of_widget): Remove redundant prototype.
1733 Move under #ifdef USE_LUCID.
1734 (x_create_toolkit_scroll_bar): Adjust scroll_bar_name
1735 definition and usage to avoid warnings.
1736
14c114ae
JD
17372012-07-31 Jan Djärv <jan.h.d@swipnet.se>
1738
1739 * nsterm.m (openFiles): Fix previous checkin.
1740
3bd21e82
PE
17412012-07-31 Paul Eggert <eggert@cs.ucla.edu>
1742
1743 * indent.c (compute_motion): Remove unused local.
1744
c1529ded
GM
17452012-07-31 Glenn Morris <rgm@gnu.org>
1746
400d5621
GM
1747 * s/usg5-4-common.h (wait3, WRETCODE): Let configure set them.
1748
268e2432
GM
1749 * conf_post.h [USG5_4]:
1750 Move remaining contents of s/usg5-4-common.h here.
1751 * s/usg5-4-common.h: Remove file.
1752
7552f3ee
GM
1753 * conf_post.h [IRIX6_5]: Move remaining contents of s/irix6-5.h here.
1754 * s/irix6-5.h: Remove file.
1755
6a381852
GM
1756 * conf_post.h [DARWIN_OS]: Move remaining contents of s/darwin.h here.
1757 * s/darwin.h: Remove file.
1758
c1529ded
GM
1759 * conf_post.h [HPUX]: Move random, srandom here from s/hpux10-20.h.
1760 * s/hpux10-20.h: Remove file, which is now empty.
1761
b429a4ee
GM
17622012-07-30 Glenn Morris <rgm@gnu.org>
1763
1764 * conf_post.h: New, split from configure.ac's AH_BOTTOM.
1765 * Makefile.in (config_h): Add conf_post.h.
1766 * makefile.w32-in (CONFIG_H): Add conf_post.h.
1767
adff3182
JD
17682012-07-30 Jan Djärv <jan.h.d@swipnet.se>
1769
1770 * nsterm.m (ns_do_open_file): New variable.
b9031d69 1771 (ns_term_init): Set ns_do_open_file to YES after run returns.
14ae4239
BT
1772 (openFile, openTempFile, openFileWithoutUI, openFiles):
1773 Open files only if ns_do_open_file.
adff3182 1774
c32af1e4
PE
17752012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1776
7393bcbb
PE
1777 * lisp.h (SWITCH_ENUM_CAST): Remove. All uses removed.
1778 This no-op macro hasn't been needed for many years.
1779 * src/regex.c (SWITCH_ENUM_CAST) [!emacs]: Likewise.
1780
c32af1e4
PE
1781 Export DIRECTORY_SEP, TYPEMASK, VALMASK to GDB.
1782 * alloc.c (gdb_make_enums_visible) [USE_LSB_TAG]: Add lsb_bits.
1783 * lisp.h (enum lsb_bits) [USE_LSB_TAG]: New enum, for
1784 gdb_make_enums_visible.
1785 (TYPEMASK, VALMASK) [USE_LSB_TAGS]: Now enum constants, not macros.
1786 (DIRECTORY_SEP): Now a constant, not a macro.
1787
302fc036
EZ
17882012-07-30 Eli Zaretskii <eliz@gnu.org>
1789
1790 * w32fns.c (w32_wnd_proc): Pass w32_keyboard_codepage to
1791 w32_kbd_patch_key as the 2nd arg. (Bug#12082)
1792
1793 * w32term.c <w32_keyboard_codepage>: Renamed from
1794 keyboard_codepage and now external. All users changed.
1795
1796 * w32term.h: Add declaration of w32_keyboard_codepage.
1797
1798 * w32inevt.c (w32_kbd_patch_key): Accept an additional argument --
1799 the codepage to translate keys to Unicode. If this argument is
1800 -1, use the value returned by GetConsoleCP. All callers changed.
1801
88fb40b4
PE
18022012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1803
0aee6912
PE
1804 Update .PHONY listings in makefiles.
1805 * Makefile.in (.PHONY): Add all, mostlyclean, clean,
1806 bootstrap-clean, distclean, maintainer-clean, versioclean,
1807 extraclean, frc.
1808
88fb40b4
PE
1809 * lisp.h (STRING_BYTES_BOUND): Cast entire result to ptrdiff_t.
1810 This is a bit clearer. Fix some commentary typos.
1811
0a763bd1
GM
18122012-07-30 Glenn Morris <rgm@gnu.org>
1813
32bac6d6
GM
1814 * s/netbsd.h: Let configure include signal.h if needed.
1815 Remove file, which is now empty.
1816
b65e7c46
GM
1817 * s/usg5-4-common.h (_longjmp, _setjmp, TIOCSIGSEND):
1818 Let configure set them.
1819 * s/irix6-5.h (_longjmp, _setjmp, TIOCSIGSEND):
1820 No more need to undefine.
0a763bd1 1821
169304bd
AS
18222012-07-30 Andreas Schwab <schwab@linux-m68k.org>
1823
1824 * keymap.c (Fkey_description): Don't remove 0x80 bit from
1825 non-single-byte char when adding meta modifier. (Bug#12090)
1826
6cd7a139
DA
18272012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1828
1829 Convert safe_call to use variable number of arguments.
1830 * xdisp.c (safe_call): Convert to use varargs. Adjust users.
1831 (safe_call2): Fix comment.
1832 * lisp.h (safe_call): Adjust prototype.
1833 * coding.c (encode_coding_object): Change to use safe_call2.
1834 * xfaces.c (merge_face_heights): Change to use safe_call1.
1835
d34d6ffc
GM
18362012-07-30 Glenn Morris <rgm@gnu.org>
1837
7b8a48e4 1838 * s/aix4-2.h (sigmask): No need to undefine it, since syssignal.h
227f5bd0 1839 does that unconditionally. Remove file, which is now empty.
7b8a48e4 1840
d34d6ffc
GM
1841 * s/freebsd.h, s/gnu-linux.h, s/sol2-6.h, s/unixware.h:
1842 Remove empty files.
1843
03a660a6
PE
18442012-07-30 Paul Eggert <eggert@cs.ucla.edu>
1845
1846 Export to GDB most of lisp.h's remaining object-like macros.
1847 * lisp.h (min, max): Move earlier, because they're used earlier now.
1848 (INTMASK, ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK)
1849 (CHAR_TABLE_STANDARD_SLOTS, CHARTAB_SIZE_BITS_0)
1850 (CHARTAB_SIZE_BITS_1, CHARTAB_SIZE_BITS_2, CHARTAB_SIZE_BITS_3)
1851 (DEFAULT_HASH_SIZE, COMPILED_ARGLIST, COMPILED_BYTECODE)
1852 (COMPILED_CONSTANTS, COMPILED_STACK_DEPTH, COMPILED_DOC_STRING)
1853 (COMPILED_INTERACTIVE, CHAR_ALT, CHAR_SUPER, CHAR_HYPER, CHAR_SHIFT)
1854 (CHAR_CTL, CHAR_META, CHAR_MODIFIER_MASK, CHARACTERBITS)
1855 (MANY, UNEVALLED, FLOAT_TO_STRING_BUFSIZE, MAX_ALLOCA):
1856 Now constants, for GDB. They need not be macros.
1857 (MOST_POSITIVE_FIXNUM, MOST_NEGATIVE_FIXNUM, STRING_BYTES_BOUND):
1858 Now constants, for GDB, as well as macros, for static initializers.
1859 (CHAR_TABLE_STANDARD_SLOTS, CHAR_TABLE_EXTRA_SLOTS):
1860 Move to after the definition of struct Lisp_Char_Table,
1861 since the former now needs that type defined.
1862 (enum CHARTAB_SIZE_BITS, enum CHAR_TABLE_STANDARD_SLOTS)
1863 (enum DEFAULT_HASH_SIZE, enum Lisp_Compiled, enum char_bits)
1864 (enum maxargs, enum FLOAT_TO_STRING_BUFSIZE, enum MAX_ALLOCA):
1865 New enums, for gdb_make_enums_visible.
1866 (GLYPH_MODE_LINE_FACE): Remove; unused.
88fb40b4 1867 * alloc.c (STRING_BYTES_MAX): Now a constant, not a macro.
03a660a6
PE
1868 (gdb_make_enums_visible): Add enum CHARTAB_SIZE_BITS, enum
1869 CHAR_TABLE_STANDARD_SLOTS, enum char_bits, enum DEFAULT_HASH_SIZE,
1870 enum FLOAT_TO_STRING_BUFSIZE, enum Lisp_Bits, enum Lisp_Compiled,
1871 enum maxargs, enum MAX_ALLOCA.
1872 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): Remove.
1873 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Remove;
1874 no longer needed, now that they are done in lisp.h.
1875
e499d0ee
DA
18762012-07-30 Dmitry Antipov <dmantipov@yandex.ru>
1877
1878 Cleanup string bytes checking.
1879 * alloc.c (GC_STRING_BYTES, CHECK_STRING_BYTES): Remove. Convert
1880 all users to STRING_BYTES or string_bytes if GC_CHECK_STRING_BYTES.
1881 (check_string_bytes): Define to empty if not GC_CHECK_STRING_BYTES.
1882 (check_sblock, compact_small_strings): Simplify.
1883
d5040d2d
PE
18842012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1885
1886 * lisp.h (LISP_INT_TAG, LISP_INT1_TAG, LISP_STRING_TAG): Remove.
1887 These macros are confusing and no longer need to be defined, as
1888 the enum values now suffice. All uses replaced with definiens.
1889 (Lisp_Int1, Lisp_String): Define directly; this is clearer.
1890
7f259ae6
JB
18912012-07-29 Juanma Barranquero <lekktu@gmail.com>
1892
1893 * makefile.w32-in (LISP_H, $(BLD)/emacs.$(O), $(BLD)/w32inevt.$(O))
1894 ($(BLD)/w32console.$(O)): Update dependencies.
1895
7e63e0c3
DA
18962012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1897
1898 Remove HIDE_LISP_IMPLEMENTATION and cleanup cons free list check.
1899 * lisp.h (HIDE_LISP_IMPLEMENTATION): Remove as useless for a long
1900 time. Adjust users.
1901 (CHECK_CONS_LIST): Remove. Convert all users to check_cons_list.
1902
ffd817eb
JD
19032012-07-29 Jan Djärv <jan.h.d@swipnet.se>
1904
1905 * lread.c (init_lread): Remove if-statement in ifdef HAVE_NS before
1906 setting sitelisp (Bug#12010).
1907
417a7a0e
EZ
19082012-07-29 Eli Zaretskii <eliz@gnu.org>
1909
14ae4239 1910 * w32heap.h (OS_9X): Rename from OS_WINDOWS_95.
417a7a0e
EZ
1911
1912 * w32heap.c (cache_system_info):
1913 * w32.c (sys_rename):
1914 * w32proc.c (find_child_console, sys_kill): All users changed.
1915
387d4d92
PE
19162012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1917
1918 * alloc.c (Fgarbage_collect): Indent as per usual Emacs style.
1919
55a6cca6
EZ
19202012-07-29 Eli Zaretskii <eliz@gnu.org>
1921
1922 * makefile.w32-in (LISP_H): Add $(NT_INC)/stdalign.h.
1923
dbcf001c
DA
19242012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1925
1926 Cleanup statistics calculation in Fgarbage_collect.
14ae4239
BT
1927 * alloc.c (Fgarbage_collect): Rename t1 to meaningful start.
1928 Fix zombies percentage calculation. Simplify elapsed time calculation.
dbcf001c 1929
e2688e4a
DA
19302012-07-29 Dmitry Antipov <dmantipov@yandex.ru>
1931
1932 Generalize marker debugging code under MARKER_DEBUG and use eassert.
1933 * insdel.c (CHECK_MARKERS, check_markers_debug_flag): Remove.
1934 (gap_left, gap_right, adjust_markers_for_delete, insert_1_both)
1935 (insert_from_string_1, insert_from_gap, insert_from_buffer_1)
1936 (replace_range, replace_range_2, del_range_2): Change to eassert.
1937 * marker.c (byte_char_debug_check): Adjust style.
1938
b46a6a83
PE
19392012-07-29 Paul Eggert <eggert@cs.ucla.edu>
1940
1941 Don't use the abbreviation "win" to refer to Windows (Bug#10421).
1942 * regex.c (MAX_BUF_SIZE): Remove some incorrect and
1943 long-ago-commented-out code that talks about "WIN32".
1944 * w32heap.h (OS_WINDOWS_95): Rename from OS_WIN95.
1945 All uses changed.
1946
e32a5799
PE
19472012-07-28 Paul Eggert <eggert@cs.ucla.edu>
1948
1949 Use Gnulib stdalign module (Bug#9772, Bug#9960).
1950 * alloc.c (XMALLOC_BASE_ALIGNMENT, GC_POINTER_ALIGNMENT, pure_alloc):
1951 Simplify by using alignof.
1952 (pure_alloc) [! USE_LSB_TAG]: Don't over-align EMACS_INT values.
1953 * lisp.h: Include <stdalign.h>.
1954 (GCALIGNMENT): New macro and constant.
1955 (DECL_ALIGN): Remove. All uses replaced by alignas (GCALIGNMENT).
1956 (USE_LSB_TAG): ifdef on alignas, not on DECL_ALIGN.
1957 (stdalign): New macro, if not already defined.
1958
df81cd29
EZ
19592012-07-28 Eli Zaretskii <eliz@gnu.org>
1960
01bd1b0d
EZ
1961 Fix non-ASCII input in non-GUI frames on MS-Windows. (Bug#12055)
1962 * w32inevt.c: Include w32inevt.h.
1963 (w32_read_console_input): New inline function, calls either
1964 ReadConsoleInputA or ReadConsoleInputW, depending on the value of
1965 w32_console_unicode_input.
1966 (fill_queue): Call w32_read_console_input instead of ReadConsoleInput.
1967 (w32_kbd_patch_key, key_event): Use the codepage returned by
1968 GetConsoleCP, rather than the ANSI codepage returned by GetLocaleInfo.
1969 (key_event): use uChar.UnicodeChar only if
1970 w32_console_unicode_input is non-zero.
1971
1972 * w32console.c: Include w32heap.h.
1973 <w32_console_unicode_input>: New global variable.
1974 (initialize_w32_display): Set w32_console_unicode_input to 1 on NT
1975 family of Windows, zero otherwise.
1976
1977 * w32inevt.h: Declare w32_console_unicode_input.
1978
df81cd29
EZ
1979 * xdisp.c (init_iterator): Don't reference tip_frame in a build
1980 --without-x. (Bug#11742)
1981
c20fdd9e
PE
19822012-07-27 Paul Eggert <eggert@cs.ucla.edu>
1983
1984 Adjust GDB to reflect pvec_type changes (Bug#12036).
1985 * .gdbinit (xvectype, xpr, xbacktrace): Adjust to reflect the
14ae4239
BT
1986 2012-07-04 changes to pseudovector representation.
1987 Problem reported by Eli Zaretskii in <http://bugs.gnu.org/12036#30>.
c20fdd9e 1988
32770973 19892012-07-27 Michael Albinus <michael.albinus@gmx.de>
e518bc71
MA
1990
1991 * dbusbind.c (XD_DBUS_VALIDATE_BUS_ADDRESS): Canonicalize session
1992 bus address.
1993 (xd_close_bus, Fdbus_init_bus): Handle reference counter properly.
1994
3438fe21
EZ
19952012-07-27 Eli Zaretskii <eliz@gnu.org>
1996
bcfbc9de
EZ
1997 * alloc.c (listn): Fix the order the arguments are consed onto the
1998 list.
1999
3438fe21
EZ
2000 * lisp.h (enum constype): Use CONSTYPE_HEAP and CONSTYPE_PURE for
2001 enumeration constants, as PURE and HEAP are too general, and clash
2002 with other headers and sources, such as gmalloc.c and the
2003 MS-Windows system headers. All users changed.
2004
eeaea515
DA
20052012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2006
2007 Revert last save_excursion_save and save_excursion_restore changes.
2008 * alloc.c, editfns.c, marker.c, lisp.h: Revert.
2009 Lots of crashes reported by Chong Yidong <cyd@gnu.org>.
2010
073c88c2
DA
20112012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2012
2013 Fix recently-introduced typos in Windows port.
2014 Reported by Martin Rudalics <rudalics@gmx.at>.
2015 * w32.c (init_environment): Replace comma with semicolon.
eeaea515 2016 * w32fns.c (syms_of_w32fns): Add missing parenthesis.
073c88c2 2017
4706125e
PE
20182012-07-27 Paul Eggert <eggert@cs.ucla.edu>
2019
2020 Improve GDB symbol export (Bug#12036).
2021 * .gdbinit (xgetptr, xgetint, xgettype): Set $bugfix in different
2022 arms of an 'if', not using conditional expressions; otherwise GDB
2023 complains about the types in the unevaluated arm when the argument
2024 is an integer literal.
2025 (xgetint): Simplify expression.
2026 * alloc.c (gdb_make_enums_visible): New constant. This ports to
2027 GCC 3.4.2 the export of symbols to GDB. Problem reported by Eli
2028 Zaretskii in <http://bugs.gnu.org/12036#13>.
2029 * lisp.h (PUBLISH_TO_GDB): Remove. All uses removed. No longer
2030 needed now that we have gdb_make_enums_visible.
2031 (enum CHECK_LISP_OBJECT_TYPE, enum Lisp_Bits, enum More_Lisp_Bits)
2032 (enum enum_USE_LSB_TAG):
2033 New enum types, packaging up enums that need to be exported to GDB.
2034
694b6c97
DA
20352012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2036
2037 Utility function to make a list from specified amount of objects.
2038 * lisp.h (enum constype): New datatype.
2039 (listn): New prototype.
2040 * alloc.c (listn): New function.
2041 (Fmemory_use_count, syms_of_alloc): Use it.
2042 * buffer.c (syms_of_buffer): Likewise.
2043 * callint.c (syms_of_callint): Likewise.
2044 * charset.c (define_charset_internal): Likewise.
2045 * coding.c (syms_of_coding): Likewise.
2046 * keymap.c (syms_of_keymap): Likewise.
2047 * search.c (syms_of_search): Likewise.
2048 * syntax.c (syms_of_syntax): Likewise.
2049 * w32.c (init_environment): Likewise.
2050 * w32fns.c (Fw32_battery_status, syms_of_w32fns): Likewise.
2051 * xdisp.c (syms_of_xdisp): Likewise.
2052 * xfns.c (syms_of_xfns): Likewise.
2053
6195f384
DA
20542012-07-27 Dmitry Antipov <dmantipov@yandex.ru>
2055
2056 Fast save_excursion_save and save_excursion_restore.
2057 * lisp.h (struct Lisp_Excursion): New data type.
2058 (PVEC_EXCURSION): New pseudovector type.
2059 (XEXCURSION, XSETEXCURSION, EXCURSIONP): Convenient macros
2060 to deal with it. Adjust comments.
2061 (init_marker, attach_marker): New prototype.
2062 (unchain_marker): Adjust prototype.
2063 * marker.c (attach_marker): Change to global.
2064 (init_marker): New function.
2065 * alloc.c (Fmake_marker, build_marker): Use it.
2066 (build_marker): More easserts.
2067 (mark_object): Handle struct Lisp_Excursion.
2068 * editfns.c (save_excursion_save, save_excursion_restore):
2069 Reimplement to use struct Lisp_Excursion. Add comments.
2070
5eceb8fb
PE
20712012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2072
2073 Fix export of symbols to GDB (Bug#12036).
2074 * alloc.c (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL)
2075 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Move these here from
2076 emacs.c, as this is a more-suitable home. Had this been done earlier
2077 the fix for 12036 would have avoided some of the problems noted in
2078 <http://bugs.gnu.org/12036#13> by Eli Zaretskii, as the scope problems
2079 would have been more obvious.
562157c8
PE
2080 * emacs.c: Do not include <verify.h>; no longer needed.
2081 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS)
5eceb8fb
PE
2082 (gdb_GCTYPEBITS, gdb_USE_LSB_TAG)
2083 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2084 Remove; now done in lisp.h.
2085 * lisp.h (PUBLISH_TO_GDB): New macro.
2086 (GCTYPEBITS, USE_LSB_TAG, CHECK_LISP_OBJECT_TYPE, enum pvec_type)
2087 (DATA_SEG_BITS): Use it.
2088 (GCTYPEBITS, USE_LSB_TAG): Now also an enum, for GDB.
2089 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Now just an enum, for GDB.
2090 * mem-limits.h (EXCEEDS_LISP_PTR): Redo so that DATA_SEG_BITS need
2091 not be usable in #if. This simplifies things.
2092
d6749401
JB
20932012-07-26 Juanma Barranquero <lekktu@gmail.com>
2094
2095 * makefile.w32-in ($(BLD)/emacs.$(O)): Update dependencies.
2096
1781b9e9
PE
20972012-07-26 Paul Eggert <eggert@cs.ucla.edu>
2098
d89518db 2099 Simplify export of symbols to GDB (Bug#12036).
1781b9e9
PE
2100 * .gdbinit (xgetptr, xgetint, xgettype): Don't use "set $bugfix =
2101 $bugfix.i", as this doesn't work (with GDB 7.4.1, anyway).
2102 (xgetptr, xgetint, xgettype, xcoding, xcharset, xprintbytestr):
2103 Adjust to changes in lisp.h and emacs.c, by using
2104 CHECK_LISP_OBJECT_TYPE rather than gdb_use_struct, VALMASK instead
2105 of $valmask, DATA_SEG_BITS instead of gdb_data_seg_bits,
2106 INTTYPEBITS instead of gdb_gctypebits - 1, USE_LSB_TAG instead of
2107 gdb_use_lsb, (1 << GCTYPEBITS) - 1 instead of $tagmask, VALBITS
2108 instead of gdb_valbits.
2109 (xvectype, xvector, xpr, xprintstr, xbacktrace): Similarly, use
2110 PSEUDOVECTOR_FLAG instead of PVEC_FLAG, and ARRAY_MARK_FLAG
2111 instead of gdb_array_mark_flag.
2112 (xboolvector): Get size from $->size, not $->header.size.
2113 Use BOOL_VECTOR_BITS_PER_CHAR rather than mystery constants.
2114 (xreload, hook-run, hookpost-run): Remove.
2115 * emacs.c: Include <verify.h>.
2116 (gdb_use_lsb, gdb_use_struct, gdb_valbits, gdb_gctypebits)
2117 (gdb_data_seg_bits, PVEC_FLAG, gdb_array_mark_flag, gdb_pvec_type):
2118 Remove.
2119 (gdb_CHECK_LISP_OBJECT_TYPE, gdb_DATA_SEG_BITS, gdb_GCTYPEBITS)
2120 (gdb_USE_LSB_TAG): New enum constants.
2121 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS, GCTYPEBITS, USE_LSB_TAG):
2122 Also define these as enum constants, so they're visible to GDB.
2123 (ARRAY_MARK_FLAG_VAL, PSEUDOVECTOR_FLAG_VAL, VALMASK_VAL): New macros.
2124 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, VALMASK): Also define these
2125 as constants, so they're visible to GDB.
2126 * lisp.h (VALBITS, INTTYPEBITS, FIXNUM_BITS, PSEUDOVECTOR_SIZE_BITS)
2127 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK, BOOL_VECTOR_BITS_PER_CHAR):
2128 Now enum constants, not macros, so they're visible to GDB.
2129 (CHECK_LISP_OBJECT_TYPE, DATA_SEG_BITS): Default to 0, as this is
2130 more convenient now. All uses changed.
2131 (VALMASK) [USE_LSB_TAG]: Also define in this case.
2132 * mem-limits.h (EXCEEDS_LISP_PTR): Adjust to DATA_SEG_BITS change.
2133
3628596a
DA
21342012-07-26 Dmitry Antipov <dmantipov@yandex.ru>
2135
2136 Explicitly free restriction data that are not needed anymore.
2137 * editfns.c (save_restriction_restore): Free restriction data.
2138
7abaf5cc
SM
21392012-07-26 Stefan Monnier <monnier@iro.umontreal.ca>
2140
2141 * eval.c (Fautoload_do_load): Rename from do_autoload, export to Lisp,
2142 add argument, tune behavior, and adjust all callers.
2143
71f88e00
PE
21442012-07-25 Paul Eggert <eggert@cs.ucla.edu>
2145
2146 Use typedef for EMACS_INT, EMACS_UINT.
2147 * lisp.h, s/ms-w32.h (EMACS_INT, EMACS_UINT): Use typedefs rather
2148 than macros. This simplifies debugging in the usual case, since
2149 it lets GDB show addresses as 'EMACS_INT *' rather than 'long int *'
2150 and it allows expressions involving EMACS_INT casts.
2151 * .gdbinit (xreload): Simplify by using EMACS_INT cast.
2152
57ec3034
JD
21532012-07-25 Jan Djärv <jan.h.d@swipnet.se>
2154
2155 * nsterm.m (ns_read_socket): Return early if there is a modal
2156 window (Bug#12043).
2157
8137e7b3
MR
21582012-07-25 Martin Rudalics <rudalics@gmx.at>
2159
2160 * frame.c (Fredirect_frame_focus): In doc-string don't mention
2161 that FOCUS-FRAME can be omitted.
2162
04e9897c
DA
21632012-07-25 Dmitry Antipov <dmantipov@yandex.ru>
2164
2165 Adjust buffer text indirection counters at the end of Fkill_buffer.
2166 * buffer.c (Fkill_buffer): Adjust indirection counters when the
2167 buffer is definitely dead. This should really fix an issue reported
2168 by Christoph Scholtes again. (Bug#12007).
2169 (init_buffer_once): Initialize indirection counters of
2170 buffer_defaults and buffer_local_symbols (for sanity and safety).
2171
8a0484e1
EZ
21722012-07-24 Eli Zaretskii <eliz@gnu.org>
2173
2174 * xdisp.c (init_iterator): Don't compute dimensions of truncation
2175 and continuation glyphs on tooltip frames, leave them at zero.
2176 Avoids continued lines in tooltips. (Bug#11832)
2177
fa691a83
DA
21782012-07-24 Dmitry Antipov <dmantipov@yandex.ru>
2179
2180 Simplify copy_overlay.
04e9897c 2181 * buffer.c (copy_overlay): Simplify. Use build_marker.
fa691a83
DA
2182 * lisp.h (struct Lisp_Overlay): Restore comment with minor tweaks.
2183
436bc8e0
EZ
21842012-07-23 Eli Zaretskii <eliz@gnu.org>
2185
2186 * print.c (print_object): Don't crash when a frame's name is nil
2187 or invalid. (Bug#12025)
2188
2189 * window.c (decode_any_window): Disable CHECK_LIVE_FRAME test, as
2190 it signals an error when a tooltip frame is being created.
2191
d7a7fda3
DA
21922012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
2193
2194 Cleanup miscellaneous objects allocation and initialization.
2195 * alloc.c (allocate_misc): Change to static. Add argument to
2196 specify the subtype. Adjust comment and users.
2197 (build_overlay): New function.
2198 * buffer.c (copy_overlays, Fmake_overlay): Use it.
2199 * lisp.h (struct Lisp_Overlay): Remove obsolete comment.
2200 (allocate_misc): Remove prototype.
2201 (build_overlay): Add prototype.
2202
22032012-07-23 Dmitry Antipov <dmantipov@yandex.ru>
372f8ffc
DA
2204
2205 Swap buffer text indirection counters in Fbuffer_swap_text.
2206 * buffer.c (Fbuffer_swap_text): Swap indirections too.
2207 This avoids crash reported by Christoph Scholtes at
2208 http://lists.gnu.org/archive/html/bug-gnu-emacs/2012-07/msg00785.html.
2209
9d7fa573
JD
22102012-07-22 Jan Djärv <jan.h.d@swipnet.se>
2211
2212 * nsmenu.m (Popdown_data): New struct.
2213 (pop_down_menu): p->pointer is Popdown_data. Release the pool and
2214 free Popdown_data.
2215 (ns_popup_dialog): Use NSAutoreleasePool and pass it to pop_down_menu.
2216 (initWithContentRect): Make imgView and contentView non-static
2217 and autorelease them. Also autorelease img and matrix (Bug#12005).
2218 (dealloc): Remove (Bug#12005).
2219
0dd6d66d
DA
22202012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2221
2222 Adjust consing_since_gc when objects are explicitly freed.
2223 * alloc.c (GC_DEFAULT_THRESHOLD): New macro.
2224 (Fgarbage_collect): Use it. Change minimum to 1/10 of default.
2225 (free_cons, free_misc): Subtract object size from consing_since_gc.
2226
d36d71df
DA
22272012-07-22 Dmitry Antipov <dmantipov@yandex.ru>
2228
2229 Simplify and cleanup markers positioning code.
2230 * marker.c (attach_marker): More useful eassert.
2231 (live_buffer, set_marker_internal): New function.
2232 (Fset_marker, set_marker_restricted): Use set_marker_internal.
2233 (set_marker_both, set_marker_restricted_both): Use live_buffer.
2234
fb9ea40f
PE
22352012-07-22 Paul Eggert <eggert@cs.ucla.edu>
2236
2237 * buffer.h (struct buffer.indirections): Now ptrdiff_t, not int,
2238 as it's limited by the amount of memory, not by INT_MAX.
2239
2d5c5f7d
EZ
22402012-07-21 Eli Zaretskii <eliz@gnu.org>
2241
07fb592e
EZ
2242 * keyboard.c (keys_of_keyboard): Bind language-change to 'ignore'
2243 in special-event-map. See the discussion at
2244 http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00417.html
2245 for the reasons.
2246
37a9eac8 2247 * w32menu.c (add_menu_item): Cast to ULONG_PTR when assigning
14ae4239
BT
2248 info.dwItemData. Fixes crashes on 64-bit Windows.
2249 Suggested by Fabrice Popineau <fabrice.popineau@supelec.fr>.
2d5c5f7d 2250
c4328746
JD
22512012-07-21 Jan Djärv <jan.h.d@swipnet.se>
2252
2253 * nsterm.m (accessibilityAttributeValue): New function. (Bug#11134).
4b17afa7 2254 (conversationIdentifier): Return value is NSInteger.
784051c4 2255 * nsterm.m (accessibilityAttributeValue): Surround with NS_IMPL_COCOA.
c4328746 2256
6e5d1c12
CY
22572012-07-21 Chong Yidong <cyd@gnu.org>
2258
2259 * window.c (decode_any_window): Signal an error if the window is
2260 on a dead frame (Bug#11984).
2261
9928463d
DA
22622012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2263
2264 Add indirection counting to speed up Fkill_buffer.
2265 * buffer.h (struct buffer): New member.
2266 * buffer.c (Fget_buffer_create): Set indirection counter to 0.
2267 (Fmake_indirect_buffer): Set indirection counter to -1, increment
2268 base buffer indirection counter.
2269 (compact_buffer): If ENABLE_CHECKING, verify indirection counters.
2270 (Fkill_buffer): Adjust indirection counters as needed, don't walk
2271 through buffer list if indirection counter is 0.
2272
f8643a6b
DA
22732012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2274
2275 Extend the value returned by Fgarbage_collect with heap statistics.
2276 * alloc.c (Qheap): New symbol.
2277 (syms_of_alloc): DEFSYM it.
2278 (Fgarbage_collect): If DOUG_LEA_MALLOC, add mallinfo data.
2279 (Fmemory_free): Remove.
2280 (syms_of_alloc): Don't defsubr it.
2281 * buffer.c (Fcompact_buffer): Remove.
2282 (syms_of_buffer): Don't defsubr it.
2283
dac616ff
DA
22842012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2285
2286 Make maybe_gc inline.
2287 Verify that inlining is always possible (GCC 4.7.1, -O3 -Winline).
2288 * lisp.h (consing_since_gc, gc_relative_threshold)
2289 (memory_full_cons_threshold): Revert declaration.
2290 (maybe_gc): Remove prototype, define as inline.
2291 * alloc.c: Remove old commented-out code.
2292 (consing_since_gc, gc_relative_threshold)
2293 (memory_full_cons_threshold): Revert to global.
2294 (maybe_gc): Remove.
2295
d7ea76b4
DA
22962012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2297
2298 Simple wrapper for make_unibyte_string, adjust font_open_by_name.
2299 * lisp.h (build_unibyte_string): New function.
2300 * dosfns.c, fileio.c, fns.c, ftfont.c, process.c:
2301 * sysdep.c, w32fns.c, xfns.c: Use it.
2302 * font.c (font_open_by_name): Change 2nd and 3rd args to the only arg
2303 of type Lisp_Object to avoid redundant calls to make_unibyte_string.
2304 Adjust users accordingly.
2305 * font.h (font_open_by_name): Adjust prototype.
2306
765e61e3
DA
23072012-07-20 Dmitry Antipov <dmantipov@yandex.ru>
2308
2309 Cleanup calls to Fgarbage_collect.
2310 * lisp.h (maybe_gc): New prototype.
2311 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2312 Remove declarations.
2313 * alloc.c (maybe_gc): New function.
2314 (consing_since_gc, gc_relative_threshold, memory_full_cons_threshold):
2315 Make them static.
2316 * bytecode.c (MAYBE_GC): Use maybe_gc.
2317 * eval.c (eval_sub, Ffuncall): Likewise.
2318 * keyboard.c (read_char): Likewise. Adjust call to maybe_gc
2319 to avoid dependency from auto-save feature.
2320
52b852c7
PE
23212012-07-19 Paul Eggert <eggert@cs.ucla.edu>
2322
2323 * buffer.h (FOR_EACH_BUFFER): Rename from 'for_each_buffer'.
2324 (FOR_EACH_PER_BUFFER_OBJECT_AT): Rename from
2325 'for_each_per_buffer_object_at'.
2326 All uses changed. It's better to use upper-case for macros that
2327 cannot be implemented as functions, to give the reader a clue
2328 that they're special.
2329
5db81e33
SM
23302012-07-19 Stefan Monnier <monnier@iro.umontreal.ca>
2331
2332 * alloc.c (Fgarbage_collect): Tweak docstring.
2333
5b835e1d
DA
23342012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2335
2336 Tweak the value returned from Fgarbage_collect again.
2337 * alloc.c (Fgarbage_collect): New return value, as confirmed in
2338 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00418.html.
2339 Adjust documentation.
2340 (total_vector_bytes): Rename to total_vector_slots, adjust
2341 accounting.
2342 (total_free_vector_bytes): Rename to total_free_vector_slots,
2343 adjust accounting.
2344 (Qstring_bytes, Qvector_slots): New symbols.
2345 (syms_of_alloc): DEFSYM them.
2346
9cd47b72
DA
23472012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2348
2349 Buffer compaction primitive which may be used from Lisp.
2350 * buffer.c (compact_buffer, Fcompact_buffer): New function.
2351 (syms_of_buffer): Register Fcompact_buffer.
2352 * alloc.c (Fgarbage_collect): Use compact_buffer.
2353 * buffer.h (compact_buffer): New prototype.
2354 (struct buffer_text): New member.
2355
d17337e5
DA
23562012-07-19 Dmitry Antipov <dmantipov@yandex.ru>
2357
2358 New macro to iterate over all buffers, miscellaneous cleanups.
2359 * lisp.h (all_buffers): Remove declaration.
2360 * buffer.h (all_buffers): Add declaration, with comment.
2361 (for_each_buffer): New macro.
2362 * alloc.c (Fgarbage_collect, mark_object): Use it.
2363 * buffer.c (Fkill_buffer, Fbuffer_swap_text, Fset_buffer_multibyte)
2364 (init_buffer): Likewise.
2365 * data.c (Fset_default): Likewise.
2366 * coding.c (code_conversion_restore): Remove redundant check
2367 for dead buffer.
2368 * buffer.c (Fkill_buffer): Likewise. Remove obsolete comment.
2369
60cfd278
AS
23702012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2371
2372 Fix bug that created negative-length intervals.
2373 * intervals.c (merge_interval_right, merge_interval_left):
2374 Do not zero out this interval if it is absorbed by its children,
2375 as this interval's total length doesn't change in that case. See
2376 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00403.html>.
2377
d06714cb
PE
23782012-07-18 Paul Eggert <eggert@cs.ucla.edu>
2379
83713154
PE
2380 * alloc.c (Fmake_bool_vector): Fix off-by-8 bug
2381 when invoking (make-bool-vector N t) and N is a positive
2382 multiple of 8 -- the last 8 bits were mistakenly cleared.
2383
d06714cb
PE
2384 Remove some struct layout assumptions in bool vectors.
2385 * alloc.c (bool_header_size): New constant.
2386 (header_size, word_size): Move earlier, as they're now used earlier.
2387 Use 'word_size' in a few more places, where it's appropriate.
2388 (Fmake_bool_vector, sweep_vectors): Don't assume that there is no
2389 padding before the data member of a bool vector.
2390 (sweep_vectors): Use PSEUDOVECTOR_TYPEP, in an eassert, rather
2391 than doing the check by hand with an abort ().
2392
464d5a5e
SM
23932012-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
2394
5fbc0409
SM
2395 * eval.c (Fdefvar): Don't check constants since we only set the var if
2396 it's not yet defined anyway (bug#11904).
2397
464d5a5e
SM
2398 * lisp.h (last_undo_boundary): Declare new var.
2399 * keyboard.c (command_loop_1): Set it.
2400 * cmds.c (Fself_insert_command): Use it to only remove boundaries that
2401 were auto-added by the command loop (bug#11774).
2402
8dc2e44a
AS
24032012-07-18 Andreas Schwab <schwab@linux-m68k.org>
2404
2405 * w32font.c (Qsymbol): Remove local definition.
2406 (syms_of_w32font): Don't DEFSYM it.
2407
169925ec
DA
24082012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2409
2410 Fix sweep_vectors to handle large bool vectors correctly.
2411 * alloc.c (sweep_vectors): Account total_vector_bytes for
2412 bool vectors larger than VBLOCK_BYTES_MAX.
2413
5fbfb018
CY
24142012-07-18 Chong Yidong <cyd@gnu.org>
2415
2416 * frame.c (x_set_frame_parameters): Revert bogus change introduced
2417 in 2012-05-25 commit by Paul Eggert (Bug#11738).
2418
3ab6e069
DA
24192012-07-18 Dmitry Antipov <dmantipov@yandex.ru>
2420
2421 Return more descriptive data from Fgarbage_collect.
2422 Suggested by Stefan Monnier in
2423 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00369.html.
2424 * alloc.c (bounded_number): New function.
2425 (total_buffers, total_vectors): New variable.
2426 (total_string_size): Rename to total_string_bytes, adjust users.
2427 (total_vector_size): Rename to total_vector_bytes, adjust users.
2428 (sweep_vectors): Account total_vectors and total_vector_bytes.
2429 (Fgarbage_collect): New return value. Adjust documentation.
2430 (gc_sweep): Account total_buffers.
2431 (Fmemory_free, Fmemory_use_counts): Use bounded_number.
2432 (VECTOR_SIZE): Remove.
2433 * data.c (Qfloat, Qvector, Qsymbol, Qstring, Qcons): Make global.
2434 (Qinterval, Qmisc): New symbols.
2435 (syms_of_data): Initialize them.
2436 * lisp.h (Qinterval, Qsymbol, Qstring, Qmisc, Qvector, Qfloat)
2437 (Qcons, Qbuffer): New declarations.
2438
6d02fe5b
PE
24392012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2440
2441 * alloc.c (Fmemory_free): Account for memory-free's own storage.
2442 Round up, not down. Improve doc.
2443
b7ffe040
DA
24442012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2445
2446 Restore old code in allocate_string_data to avoid Faset breakage.
2447 Reported by Julien Danjou <julien@danjou.info> in
2448 http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00371.html.
2449 * alloc.c (allocate_string_data): Restore old code with minor
2450 adjustments, fix comment to explain this subtle issue.
2451
4dc7c8d5
SM
24522012-07-17 Eli Zaretskii <eliz@gnu.org>
2453
2454 Remove FILE_SYSTEM_CASE.
2455 * s/msdos.h (FILE_SYSTEM_CASE): Don't define.
2456
2457 * fileio.c (FILE_SYSTEM_CASE): Don't define.
2458 (Ffile_name_directory, Fexpand_file_name): Don't use FILE_SYSTEM_CASE.
2459 Fixes problems on MS-DOS with Vtemp_file_name_pattern when
2460 call-process-region passes it through expand-file-name.
2461
2462 * dired.c (file_name_completion): Don't use FILE_SYSTEM_CASE.
2463
24642012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2465
2466 Fix crash when creating indirect buffer (Bug#11917)
2467 * buffer.c (buffer_lisp_local_variables): Add argument CLONE.
2468 Don't handle unbound variables specially if non-zero.
2469 (Fbuffer_local_variables): Pass zero.
2470 (clone_per_buffer_values): Pass non-zero.
2471
24722012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2473
2474 * gnutls.c (emacs_gnutls_handshake): Revert last change. Add QUIT
2475 to make the loop interruptible.
2476
24772012-07-17 Andreas Schwab <schwab@linux-m68k.org>
2478
2479 * gnutls.c (emacs_gnutls_handshake): Only retry if
2480 GNUTLS_E_INTERRUPTED.
2481
cce7fefc
DA
24822012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2483
2484 Cleanup and convert miscellaneous checks to eassert.
2485 * alloc.c (mark_interval): Fix comment, partially rephrase
2486 old comment from intervals.h (see below).
2487 * intervals.c (find_interval, adjust_intervals_for_insertion)
2488 (delete_interval, adjust_intervals_for_deletion)
2489 (graft_intervals_into_buffer, temp_set_point_both, copy_intervals):
2490 Convert to eassert.
2491 (adjust_intervals_for_insertion, make_new_interval):
2492 Remove obsolete and unused code.
2493 * intervals.h (struct interval): Remove obsolete comment.
2494 * textprotp.c (erase_properties): Remove unused code.
2495 (Fadd_text_properties, set_text_properties_1, Fremove_text_properties)
2496 (Fremove_list_of_text_properties): Convert to eassert.
2497
9ea10cc3
CY
24982012-07-17 Chong Yidong <cyd@gnu.org>
2499
2500 * editfns.c (Finsert_char): Doc fix.
2501
3900d5de
DA
25022012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2503
2504 Fix previous change to make Fmemory_free always accurate.
2505 * alloc.c (make_interval): Update total_free_intervals.
2506 (make_float): Likewise for total_free_floats.
2507 (free_cons, Fcons): Likewise for total_free_conses.
2508 (SETUP_ON_FREE_LIST, allocate_vector_from_block):
2509 Likewise for total_free_vector_bytes.
2510 (Fmake_symbol): Likewise for total_free_symbols.
2511 (bytes_free): Remove.
2512
7098646f
DA
25132012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2514
2515 Simple free memory accounting feature.
2516 * alloc.c (bytes_free, total_free_vector_bytes): New variable.
2517 (sweep_vectors): Accumulate size of free vectors.
2518 (Fgarbage_collect): Setup bytes_free.
2519 (Fmemory_free): New function.
2520 (syms_of_alloc): Register it.
2521
22657b40
DA
25222012-07-17 Dmitry Antipov <dmantipov@yandex.ru>
2523
2524 Cleanup overlays checking.
2525 * buffer.h (OVERLAY_VALID): Remove as useless synonym of OVERLAYP.
2526 * buffer.c (overlay_touches_p, recenter_overlay_lists): Change to
2527 eassert and OVERLAYP.
2528 (sort_overlays): Change to use OVERLAYP.
2529
ddfc8813
RK
25302012-07-16 René Kyllingstad <Rene@Kyllingstad.com> (tiny change)
2531
2532 * editfns.c (Finsert_char): Make it interactive, and make the
2533 second arg optional. Copy interactive spec and docstring from
2534 ucs-insert.
2535
7c26cf3c
PE
25362012-07-17 Paul Eggert <eggert@cs.ucla.edu>
2537
2538 * floatfns.c (Fabs): Do not wrap fabs inside IN_FLOAT (Bug#11913).
2539 Unlike the other wrapped functions, fabs has an unspecified
2540 effect on errno.
2541
5d127af9
JD
25422012-07-16 Jan Djärv <jan.h.d@swipnet.se>
2543
2544 * nsterm.m (keyDown): Interpret flags without left/right bits
2545 as the left key (Bug#11670).
2546
6a0dd1d7
DA
25472012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2548
2549 Remove empty and useless init functions.
2550 * lisp.h (init_character_once, init_fns, init_image)
2551 (init_filelock, init_sound): Remove prototype.
2552 * character.c (init_character_once): Remove.
2553 * filelock.c (init_filelock): Likewise.
2554 * fns.c (init_fns): Likewise.
2555 * image.c (init_image): Likewise.
2556 * sound.c (init_sound): Likewise.
2557 * emacs.c (main): Adjust accordingly.
2558
7a6136fd
DA
25592012-07-16 Dmitry Antipov <dmantipov@yandex.ru>
2560
2561 * gtkutil.h: Tiny cleanups.
2562 (use_old_gtk_file_dialog): Remove useless declaration.
2563 (xg_uses_old_file_dialog): Add suggested const attribute.
2564
ce811ad9
EZ
25652012-07-15 Eli Zaretskii <eliz@gnu.org>
2566
2567 * bidi.c (MAX_STRONG_CHAR_SEARCH): New macro.
2568 (bidi_paragraph_init): Use it to limit search forward for a strong
2569 directional character in abnormally large paragraphs full of
2570 neutral or weak characters. (Bug#11943)
2571
c9adfeaa
SF
25722012-07-15 Stefano Facchini <stefano.facchini@gmail.com> (tiny change)
2573
2574 * gtkutil.c (xg_create_tool_bar): Apply "primary-toolbar" style to
2575 the toolbar (Bug#9451).
2576 (xg_make_tool_item): Give the widget event box a transparent
2577 background.
2578
fff62aa9
DA
25792012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2580
2581 Cleanup basic allocation variables and functions.
2582 * alloc.c (ignore_warnings, init_intervals, init_float)
2583 (init_cons, init_symbol, init_marker): Remove.
2584 (interval_block_index): Initialize to INTERVAL_BLOCK_SIZE.
2585 (float_block_index): Initialize to FLOAT_BLOCK_SIZE.
2586 (cons_block_index): Initialize to CONS_BLOCK_SIZE.
2587 (symbol_block_size): Initialize to SYMBOL_BLOCK_SIZE.
2588 (marker_block_index): Initialize to MARKER_BLOCK_SIZE.
2589 (staticidx, init_alloc_once, init_strings, free_ablock):
2590 Remove redundant initialization.
2591 * fns.c (init_weak_hash_tables): Remove.
2592 * lisp.h (init_weak_hash_tables): Remove prototype.
2593
9730daca
DA
25942012-07-15 Dmitry Antipov <dmantipov@yandex.ru>
2595
2596 Use zero_vector where appropriate.
2597 * alloc.c (zero_vector): Define as Lisp_Object. Adjust users
2598 accordingly.
2599 * lisp.h (zero_vector): New declaration.
2600 * font.c (null_vector): Remove.
2601 (syms_of_font): Remove initialization and staticpro.
2602 (font_list_entities, font_find_for_lface): Change to use zero_vector.
2603 * keymap.c (Faccessible_keymaps): Likewise.
2604
2e2d2a13
LL
26052012-07-15 Leo Liu <sdl.web@gmail.com>
2606
2607 * fringe.c: Fix typo in comments.
2608
cd276f6e
LL
26092012-07-14 Leo Liu <sdl.web@gmail.com>
2610
2611 * fringe.c: Add a new bitmap exclamation-mark.
2612
5a1131d9
EZ
26132012-07-14 Eli Zaretskii <eliz@gnu.org>
2614
2615 * gmalloc.c (GMALLOC_INHIBIT_VALLOC): Don't reference.
2616
2617 * s/msdos.h (BSD_SYSTEM, DATA_START, GC_SETJMP_WORKS, HAVE_MOUSE)
2618 (HAVE_MENUS): Don't define, defined by editing config.in with
2619 msdos/sed2v2.inp.
2620 (GMALLOC_INHIBIT_VALLOC): Don't define.
2621 (MODE_LINE_BINARY_TEXT): Remove, not used anymore.
2622
22e983b7
JB
26232012-07-14 Juanma Barranquero <lekktu@gmail.com>
2624
2625 * s/ms-w32.h (GC_SETJMP_WORKS, GC_MARK_STACK): Set in nt/config.nt.
2626
5b3f250f
GM
26272012-07-14 Glenn Morris <rgm@gnu.org>
2628
2629 * s/aix4-2.h, s/freebsd.h, s/gnu-linux.h, s/hpux10-20.h:
2630 * s/irix6-5.h, s/netbsd.h, s/sol2-6.h, s/unixware.h:
2631 Let configure set GC_SETJMP_WORKS, GC_MARK_STACK.
2632
33d63ff4
GM
26332012-07-13 Glenn Morris <rgm@gnu.org>
2634
5b633342
GM
2635 * s/gnu-linux.h (GC_MARK_SECONDARY_STACK): Let configure set it.
2636
33d63ff4
GM
2637 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Let configure set it.
2638 * s/irix6-5.h (SETUP_SLAVE_PTY): No more need to unset it.
2639
b55b9f85
JD
26402012-07-13 Jan Djärv <jan.h.d@swipnet.se>
2641
0dc8cf50
JD
2642 * nsterm.m (uRect): Only define if NS_IMPL_GNUSTEP.
2643 (x_free_frame_resources): Pass x_free_frame_resources to NSTRACE.
2644 (ns_lisp_to_color, ns_string_to_lispmod, ns_term_init)
2645 (ns_term_shutdown, requestService, initFrameFromEmacs): Use SSDATA
2646 where appropriate.
2647 (ns_exec_path, ns_load_path, changeFont): Put () around assignment used
2648 as boolean expression.
2649 (x_set_window_size): Remove unused variable toolbar.
2650 (ns_get_color_default, ns_mod_to_lisp): Remove.
2651 (ns_mouse_position): Remove unused variables xchar and ychar.
2652 (ns_compute_glyph_string_overhangs): Remove unused variable face.
2653 (ns_set_vertical_scroll_bar): Remove unused variable count.
2654 (ns_delete_terminal): Remove unused variable i.
2655 (ns_term_init): Remove unused variables r, g and b.
2656 (mouseDown): Remove unused variable window.
2657 (windowDidResize): Move definition of theWindow inside NS_IMPL_GNUSTEP.
2658 (initFrameFromEmacs): Remove unused variable vbextra.
2659 (mouseEntered): Remove unused variables p and dpyinfo.
2660 (mouseExited): Remove unused variables p and r.
2661 (ns_define_frame_cursor, ns_clear_frame_area)
2662 (ns_draw_window_cursor, ns_initialize_display_info): Make static.
2663 (menuDown): Assign [sender tag] to variable and cast the variable.
2664
2665 * nsterm.h (menuDown): Add id as type to argument sender.
2666 (ns_display_info_for_name): Add Lisp_Object argument.
2667 (ns_term_init): Add Lisp_Object argument.
2668 (ns_map_event_to_object): Add void argument.
2669 (ns_string_from_pasteboard, ns_string_to_pasteboard): Add correct
2670 prototype with arguments and only declare if __OBJC__.
2671 (nxatoms_of_nsselect): Add void argument.
2672 (ns_lisp_to_cursor_type): Add Lisp_Object argument.
2673 (ns_alloc_autorelease_pool): Add void argument.
2674 (ns_release_autorelease_pool): Add void* argument.
2675 (ns_get_defaults_value): Add const char* argument.
2676
2677 * nsmenu.m (ns_update_menubar, ns_menu_show, process_dialog)
2678 (initFromContents): Use SSDATA where appropriate.
2679 (ns_update_menubar): Add braces to ambigous if-else.
2680 (initWithTitle): Put () around assignment in if statement.
2681 (ns_menu_show): Remove unused variables window and keymap.
2682 (update_frame_tool_bar): Remove unused variable selected_p.
2683 (initWithContentRect): Remove unused variable this_cmd_name.
2684
2685 * nsimage.m (ns_load_image, allocInitFromFile): Use SSDATA where
2686 appropriate.
2687 (setXBMColor): Remove unused variable len.
2688 (setPixmapData): Put () around assignment in loop statement.
2689
2690 * nsfont.m (ns_get_family, ns_lang_to_script, ns_otf_to_script)
2691 (ns_registry_to_script, ns_get_req_script, nsfont_open): Use SSDATA
2692 where appropriate.
2693 (ns_get_covering_families, ns_findfonts, nsfont_list_family): Put ()
2694 around assignment in loop statement.
2695 (nsfont_open): Remove unused variable i.
2696 (nsfont_open): Remove unused variable len.
2697 (nsfont_draw): Remove unused variable cs.
2698
2699 * nsfns.m (x_set_icon_name, ns_set_name_internal)
2700 (ns_set_name_as_filename, ns_implicitly_set_icon_type)
2701 (x_set_icon_type, ns_lisp_to_cursor_type, Fns_read_file_name)
2702 (Fns_get_resource, Fns_set_resource, Fx_open_connection)
2703 (Fns_font_name, Fns_perform_service)
2704 (Fns_convert_utf8_nfd_to_nfc, ns_do_applescript)
2705 (Fns_do_applescript, Fx_show_tip): Use SSDATA where appropriate.
2706 (ns_set_name): Remove unused variable view.
2707 (x_set_menu_bar_lines): Remove unused variable olines.
2708 (x_set_tool_bar_lines): Remove unused variable root_window.
2709 (Fns_list_colors): Put () around assignment in while statement.
2710 (Fns_perform_service): Remove unused variable len.
2711 (Fns_display_usable_bounds): Remove unused variable top.
2712 (syms_of_nsfns): Remove unused variable i.
2713
b55b9f85
JD
2714 * nsmenu.m (ns_update_menubar): Exchange place of argument 2 and 3 to
2715 memcpy (Bug#11907).
2716
ed9265fc 27172012-07-13 Kalle Kankare <kalle.kankare@iki.fi> (tiny change)
2277de02
JD
2718
2719 * image.c (Fimagemagick_types): Initialize ex with GetExceptionInfo
2720 and free it with DestroyExceptionInfo (Bug#11558).
2721
ef099b57
JB
27222012-07-13 Juanma Barranquero <lekktu@gmail.com>
2723
2724 * s/ms-w32.h (FIRST_PTY_LETTER, HAVE_SOCKETS): Move to nt/config.nt.
2725 (HAVE_ATTRIBUTE_ALIGNED, HAVE_C99_STRTOLD, HAVE___BUILTIN_UNWIND_INIT):
2726 Set here, not in nt/config.nt.
2727
ea814a5d
EZ
27282012-07-13 Eli Zaretskii <eliz@gnu.org>
2729
2730 * xdisp.c (move_it_in_display_line_to): On GUI terminals, allow
2731 cursor overflow into the last glyph on display line when the right
2732 fringe is off. (Bug#11832)
2733
1a952767
PE
27342012-07-13 Paul Eggert <eggert@cs.ucla.edu>
2735
2736 * xdisp.c (produce_special_glyphs): Now static.
2737 * dispextern.h (produce_special_glyphs): Remove decl.
2738
983188fd
GM
27392012-07-13 Glenn Morris <rgm@gnu.org>
2740
8d7c7eed 2741 * s/bsd-common.h, s/cygwin.h: Remove empty files.
32fb4bb6
GM
2742 * s/freebsd.h, s/netbsd.h: Do not include bsd-common.h.
2743
983188fd
GM
2744 * s/usg5-4-common.h (USG, USG5):
2745 * s/template.h (USG5, USG, HPUX, BSD4_2, BSD_SYSTEM):
2746 * s/sol2-6.h (SOLARIS2):
2747 * s/irix6-5.h (IRIX6_5):
2748 * s/hpux10-20.h (USG, USG5, HPUX):
2749 * s/gnu-linux.h (USG, GNU_LINUX):
2750 * s/freebsd.h (BSD_SYSTEM):
2751 * s/darwin.h (BSD4_2, BSD_SYSTEM, DARWIN_OS):
2752 * s/cygwin.h (CYGWIN):
2753 * s/bsd-common.h (BSD_SYSTEM, BSD4_2):
2754 * s/aix4-2.h (USG, USG5, _AIX): Move "system type" macros to configure.
2755
d1e68667 27562012-07-13 BT Templeton <bpt@hcoop.net> (tiny change)
24ef80ae
PE
2757
2758 * nsfont.m (ns_charset_covers): Don't abort if no bitmap (Bug#11853).
24ef80ae 2759
6de0e799
GM
27602012-07-13 Glenn Morris <rgm@gnu.org>
2761
739ae010
GM
2762 * s/usg5-4-common.h (NSIG_MINIMUM): Let configure set it.
2763
dbee5793
GM
2764 * s/gnu-linux.h, s/irix6-5.h: Let configure set ULIMIT_BREAK_VALUE.
2765
6de0e799
GM
2766 * process.c (init_process_emacs): Replace MIN_PTY_KERNEL_VERSION.
2767 * s/darwin.h (MIN_PTY_KERNEL_VERSION): Remove single-use macro.
2768
b82da769
GM
27692012-07-12 Glenn Morris <rgm@gnu.org>
2770
4fae5a7a 2771 * s/darwin.h (SYSTEM_PURESIZE_EXTRA): Move to configure.
b82da769
GM
2772
2773 * process.c (init_process_emacs): Rename from init_process.
2774 The old name is also the name of a Mach system call.
2775 * lisp.h, emacs.c: Update for this name change.
2776 * nsgui.h, sysselect.h, s/darwin.h: Remove workaround that is no
2777 longer needed.
2778
5a979817
EZ
27792012-07-12 Eli Zaretskii <eliz@gnu.org>
2780
2781 * xdisp.c (insert_left_trunc_glyphs): Fix incorrect size in
2782 memmove call that removes glyphs covered by the left truncation
2783 glyph. Improve commentary.
2784 (display_line): Fix display of continuation glyphs on GUI frames
2785 when the right fringe is turned off and variable-size fonts are
2786 used in the window. Move the code that appends a stretch glyph to
2787 produce_special_glyphs, so that it could be used for truncation
2788 and continuation glyphs alike.
2789 (produce_special_glyphs) [HAVE_WINDOW_SYSTEM]: Produce a stretch
2790 glyph of a suitably computed width, to align the special glyphs at
2791 the window margin. Code moved from display_line. (Bug#11832)
2792
3e91a053
GM
27932012-07-12 Glenn Morris <rgm@gnu.org>
2794
ba9e4b84
GM
2795 * s/aix4-2.h, s/hpux10-20.h: Let configure set NO_EDITRES.
2796
2797 * s/gnu-linux.h, s/hpux10-20.h:
2798 Do not unconditionally define HAVE_XRMSETDATABASE.
2799
3e91a053
GM
2800 * s/gnu-linux.h (UNIX98_PTYS): Let configure set it.
2801
b300b1f4
PE
28022012-07-12 Paul Eggert <eggert@cs.ucla.edu>
2803
2804 Fix typos that broke OS X build.
2805 Reported by Randal L. Schwartz in
2806 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00225.html>.
2807 * nsterm.m (ns_timeout): Add missing local decl.
2808 (ns_get_color): snprintf -> sprintf, to fix typo.
2809
6e777848
GM
28102012-07-12 Glenn Morris <rgm@gnu.org>
2811
3f922c37
GM
2812 * src/s/aix4-2.h, src/s/cygwin.h, src/s/darwin.h:
2813 * src/s/gnu-linux.h, src/s/hpux10-20.h, src/s/irix6-5.h:
2814 * src/s/sol2-6.h, src/s/unixware.h, src/s/usg5-4-common.h:
2815 Move PTY_NAME_SPRINTF, PTY_TTY_NAME_SPRINTF to configure.
2816
0ab7b23a
GM
2817 * s/cygwin.h, s/darwin.h, s/gnu-linux.h, s/irix6-5.h:
2818 Move PTY_OPEN to configure.
2819
6e777848
GM
2820 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2821 * s/gnu-linux.h, s/hpux10-20.h, s/irix6-5.h, s/template.h:
2822 * s/usg5-4-common.h: Move FIRST_PTY_LETTER, PTY_ITERATION to configure.
2823
4a7edc24
DA
28242012-07-12 Dmitry Antipov <dmantipov@yandex.ru>
2825
2826 Use empty_unibyte_string where applicable.
2827 * keyboard.c (parse_tool_bar_item): Use empty_unibyte_string.
2828 * lread.c (read1): Likewise.
2829 * xsettings.c (syms_of_xsettings): Likewise.
2830
308aab79
GM
28312012-07-12 Glenn Morris <rgm@gnu.org>
2832
42bd1719
GM
2833 * s/cygwin.h (G_SLICE_ALWAYS_MALLOC):
2834 * s/freebsd.h (BROKEN_PTY_READ_AFTER_EAGAIN):
7ccad002
GM
2835 * s/irix6-5.h (SETPGRP_RELEASES_CTTY, PREFER_VSUSP):
2836 * s/hpux10-20.h (RUN_TIME_REMAP):
2837 * s/bsd-common.h (TABDLY): Move to configure.
2838
2839 * s/hpux10-20.h, s/sol2-6.h: Move XOS_NEEDS_TIME_H to configure.
2840
2841 * s/bsd-common.h, s/darwin.h: Move TAB3 to configure.
2842
ea0bbd17 2843 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
42bd1719 2844 (BROKEN_SIGPOLL, BROKEN_GET_CURRENT_DIR_NAME): Let configure set them.
ea0bbd17
GM
2845
2846 * s/darwin.h (NO_ABORT, NO_MATHERR): Let configure set them.
51c3b9b4 2847
308aab79
GM
2848 * s/bsd-common.h, s/cygwin.h, s/gnu-linux.h, s/irix6-5.h:
2849 * s/template.h: Move NARROWPROTO to configure.
2850
ee1cf5cf
GM
28512012-07-11 Glenn Morris <rgm@gnu.org>
2852
30fe9bf4
GM
2853 * s/gnu-linux.h, s/sol2-6.h: No longer define POSIX,
2854 unused since 2011-01-17 change to systty.h.
2855
ee1cf5cf
GM
2856 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h, s/gnu-linux.h:
2857 * s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2858 Move HAVE_PTYS and HAVE_SOCKETS to configure.
2859
63e47e07
PE
28602012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2861
2862 * s/sol2-6.h (HAVE_LIBKSTAT): Remove. (Bug#11914)
2863
c43fb4c3
GM
28642012-07-11 Glenn Morris <rgm@gnu.org>
2865
2866 * s/darwin.h, s/gnu-linux.h, s/template.h:
2867 Move INTERRUPT_INPUT to configure.
2868
e8df9267
DA
28692012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2870
2871 Minor adjustments to interning code.
2872 * lisp.h (intern, intern_c_string): Redefine as static inline
2873 wrappers for intern_1 and intern_c_string_1, respectively.
2874 (intern_1, intern_c_string_1): Rename prototypes.
14ae4239
BT
2875 * lread.c (intern_1, intern_c_string_1, oblookup):
2876 Simplify Vobarray checking.
e8df9267
DA
2877 * font.c (font_intern_prop): Likewise. Adjust comment.
2878 * w32font.c (intern_font_name): Likewise.
2879
34348bd4
AS
28802012-07-11 Andreas Schwab <schwab@linux-m68k.org>
2881
d96a1e0c
AS
2882 * gnutls.c (Fgnutls_boot): Properly parse :keylist argument.
2883
34348bd4
AS
2884 * coding.c (Fdefine_coding_system_internal): Use XCAR/XCDR instead
2885 of Fcar/Fcdr if possible.
2886 * font.c (check_otf_features): Likewise.
2887 * fontset.c (Fnew_fontset): Likewise.
2888 * gnutls.c (Fgnutls_boot): Likewise.
2889 * minibuf.c (read_minibuf): Likewise.
2890 * msdos.c (IT_set_frame_parameters): Likewise.
2891 * xmenu.c (Fx_popup_dialog): Likewise.
2892 * w32menu.c (Fx_popup_dialog): Likewise.
2893
c8add24e
GM
28942012-07-11 Glenn Morris <rgm@gnu.org>
2895
4b575b3c
GM
2896 * s/bsd-common.h, s/cygwin.h: No need to undefine INTERRUPT_INPUT,
2897 since nothing has defined it on these platforms.
2898
09f4e3b0
GM
2899 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/gnu-linux.h:
2900 * s/irix6-5.h: Move SIGNALS_VIA_CHARACTERS to configure.
2901
172bedef
GM
2902 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
2903 * s/gnu-linux.h, s/hpux10-20.h, s/template.h, s/usg5-4-common.h:
2904 Move CLASH_DETECTION to configure.
2905
249685df
GM
2906 * s/gnu.h: Remove file, which is now empty.
2907
c8add24e
GM
2908 * s/gnu.h, s/gnu-linux.h:
2909 Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
2910
b41253a3
JW
29112012-07-11 John Wiegley <johnw@newartisans.com>
2912
2913 * alloc.c (mark_memory): Guard the "no_address_safety_analysis"
2914 function attribute, so we only use it if it exists in the
2915 compiler.
2916
d923b542
DA
29172012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2918
2919 Avoid call to strlen in fast_c_string_match_ignore_case.
2920 * search.c (fast_c_string_match_ignore_case): Change to use
2921 length argument. Adjust users accordingly.
2922 * lisp.h (fast_c_string_match_ignore_case): Adjust prototype.
2923
5ebbef1d
PE
29242012-07-11 Paul Eggert <eggert@cs.ucla.edu>
2925
bb352260
PE
2926 Assume mkdir, rmdir.
2927 * sysdep.c (mkdir) [!HAVE_MKDIR]: Remove.
2928 * sysdep.c (rmdir) [!HAVE_RMDIR]: Remove.
2929
57054ddd
PE
2930 Assume rename.
2931 * sysdep.c (rename) [!HAVE_RENAME]: Remove.
2932
b747d3f7
PE
2933 Assume perror.
2934 * s/hpux10-20.h (HAVE_PERROR): Remove.
2935 * sysdep.c (perror) [HPUX && !HAVE_PERROR]:
2936 Remove dummy definition, as this problem was obsolete long ago.
2937
5ebbef1d
PE
2938 Assume strerror.
2939 * sysdep.c (strerror) [!HAVE_STRERROR && !WINDOWSNT]: Remove.
2940
984e7f30
DA
29412012-07-11 Dmitry Antipov <dmantipov@yandex.ru>
2942
2943 Avoid calls to strlen in font processing functions.
2944 * font.c (font_parse_name, font_parse_xlfd, font_parse_fcname)
14ae4239
BT
2945 (font_open_by_name): Change to use length argument.
2946 Adjust users accordingly.
d923b542
DA
2947 * font.h (font_open_by_name, font_parse_xlfd, font_unparse_xlfd):
2948 Adjust prototypes.
2949 * xfont.c (xfont_decode_coding_xlfd, font_unparse_xlfd):
2950 Change to return ptrdiff_t.
984e7f30
DA
2951 (xfont_list_pattern, xfont_match): Use length returned by
2952 xfont_decode_coding_xlfd.
2953 * xfns.c (x_default_font_parameter): Omit useless xstrdup.
2954
20e94fdd
GM
29552012-07-11 Glenn Morris <rgm@gnu.org>
2956
9d596af3
GM
2957 * s/darwin.h, s/freebsd.h, s/netbsd.h:
2958 Move DONT_REOPEN_PTY to configure.
2959
20e94fdd
GM
2960 * sound.c (DEFAULT_SOUND_DEVICE) [!WINDOWSNT]:
2961 * s/netbsd.h (DEFAULT_SOUND_DEVICE): Let configure set it.
2962
e99a530f
PE
29632012-07-10 Paul Eggert <eggert@cs.ucla.edu>
2964
22ffb973
PE
2965 Remove "#define unix" that is no longer needed (Bug#11905).
2966 * s/aix4-2.h (unix): Remove; no longer needed.
2967
e9a9ae03
PE
2968 EMACS_TIME simplification (Bug#11875).
2969 This replaces macros (which typically do not work in GDB)
2970 with functions, typedefs and enums, making the code easier to debug.
2971 The functional style also makes code easier to read and maintain.
2972 * systime.h: Include <sys/time.h> on all hosts, not just if
2973 WINDOWSNT, since 'struct timeval' is needed in general.
2974 (EMACS_TIME): Now a typedef, not a macro.
2975 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): Now constants,
2976 not macros.
2977 (EMACS_SECS, EMACS_NSECS, EMACS_TIME_SIGN, EMACS_TIME_VALID_P)
2978 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE, EMACS_TIME_EQ)
2979 (EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE, EMACS_TIME_LT)
2980 (EMACS_TIME_LE): Now functions, not macros.
2981 (EMACS_SET_SECS, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS)
2982 (EMACS_SET_USECS, EMACS_SET_SECS_USECS): Remove these macros,
2983 which are not functions. All uses rewritten to use:
2984 (make_emacs_time): New function.
2985 (EMACS_SECS_ADDR, EMACS_SET_INVALID_TIME, EMACS_GET_TIME)
2986 (EMACS_ADD_TIME, EMACS_SUB_TIME): Remove these macros, which are
2987 not functions. All uses rewritten to use the following, respectively:
2988 (emacs_secs_addr, invalid_emacs_time, get_emacs_time)
2989 (add_emacs_time, sub_emacs_time): New functions.
ed9265fc 2990 * atimer.c: Don't include <sys/time.h>, as "systime.h" does this.
e9a9ae03
PE
2991 * fileio.c (Fcopy_file):
2992 * xterm.c (XTflash): Get the current time closer to when it's used.
2993 * makefile.w32-in ($(BLD)/atimer.$(O)): Update dependencies.
2994
ffacb126
PE
2995 * bytecode.c (targets): Suppress -Woverride-init warnings.
2996
e99a530f
PE
2997 Simplify by avoiding confusing use of strncpy etc.
2998 * doc.c (Fsnarf_documentation):
2999 * fileio.c (Ffile_name_directory, Fsubstitute_in_file_name):
3000 * frame.c (Fmake_terminal_frame):
3001 * gtkutil.c (get_utf8_string):
3002 * lread.c (openp):
3003 * nsmenu.m (ns_update_menubar):
3004 * regex.c (regerror):
3005 Prefer memcpy to strncpy and strncat when either will do.
3006 * fileio.c (Fsubstitute_in_file_name):
3007 * keyboard.c (MULTI_LETTER_MOD, parse_modifiers_uncached)
3008 (menu_separator_name_p):
3009 * nsmenu.m (ns_update_menubar):
3010 Prefer memcmp to strncmp when either will do.
3011 * nsterm.m: Include <ftoastr.h>.
3012 (ns_get_color):
3013 * s/gnu-linux.h, s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF):
3014 Prefer snprintf to strncpy.
3015 * nsterm.m (ns_term_init):
3016 * widget.c (set_frame_size) [0]: Prefer xstrdup to xmalloc + strncpy.
3017 * nsterm.m (ns_term_init):
3018 Avoid the need for strncpy, by using build_string or
3019 make_unibyte_string directly. Use dtoastr, not snprintf.
3020 * process.c (Fmake_network_process): Diagnose service names that
3021 are too long, rather than silently truncating them or creating
3022 non-null-terminated names.
3023 (Fnetwork_interface_info): Likewise, for interface names.
3024 * sysdep.c (system_process_attributes) [GNU_LINUX]:
3025 Prefer sprintf to strncat.
3026 * xdisp.c (debug_method_add) [GLYPH_DEBUG]:
3027 Prefer vsnprintf to vsprintf + strncpy.
3028
c59592b3
GM
30292012-07-10 Glenn Morris <rgm@gnu.org>
3030
3031 * dispnew.c (PENDING_OUTPUT_COUNT) [!__GNU_LIBRARY__]:
3032 Clarify fallback case.
3033
7d7bbefd
DA
30342012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3035
3036 Use XCAR and XCDR instead of Fcar and Fcdr where possible.
3037 * callint.c, coding.c, doc.c, editfns.c, eval.c, font.c, fontset.c,
3038 * frame.c, gnutls.c, minibuf.c, msdos.c, textprop.c, w32fns.c,
d923b542 3039 * w32menu.c, window.c, xmenu.c: Change to use XCAR and XCDR
7d7bbefd
DA
3040 where argument type is known to be a Lisp_Cons.
3041
3a4c8000
TT
30422012-07-10 Tom Tromey <tromey@redhat.com>
3043
3044 * bytecode.c (BYTE_CODE_THREADED): New macro.
3045 (BYTE_CODES): New macro. Replaces all old byte-code defines.
3046 (enum byte_code_op): New type.
3047 (CASE, NEXT, FIRST, CASE_DEFAULT, CASE_ABORT): New macros.
3048 (exec_byte_code): Use them. Use token threading when applicable.
3049
2a0213a6
DA
30502012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3051
3052 Optimize pure C strings initialization.
3053 * lisp.h (make_pure_string): Fix prototype.
3054 (build_pure_c_string): New function, defined as static inline. This
3055 provides a better opportunity to optimize away calls to strlen when
3056 the function is called with compile-time constant argument.
3057 * alloc.c (make_pure_c_string): Fix comment. Change to add nchars
3058 argument, adjust users accordingly. Use build_pure_c_string where
3059 appropriate.
3060 * buffer.c, coding.c, data.c, dbusbind.c, fileio.c, fontset.c, frame.c,
3061 * keyboard.c, keymap.c, lread.c, search.c, syntax.c, w32fns.c, xdisp.c,
3062 * xfaces.c, xfns.c, xterm.c: Use build_pure_c_string where appropriate.
3063
cb1caeaf
DA
30642012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3065
3066 Avoid calls to strlen in miscellaneous functions.
3067 * buffer.c (init_buffer): Use precalculated len, adjust if needed.
3068 * font.c (Ffont_xlfd_name): Likewise. Change to call make_string.
3069 * lread.c (openp): Likewise.
3070
c293e30c
DA
30712012-07-10 Dmitry Antipov <dmantipov@yandex.ru>
3072
3073 Avoid calls to strlen in path processing functions.
3074 * fileio.c (file_name_as_directory): Add comment. Change to add
3075 srclen argument and return the length of result. Adjust users
3076 accordingly.
3077 (directory_file_name): Fix comment. Change to add srclen argument,
14ae4239
BT
3078 swap 1st and 2nd arguments to obey the common convention.
3079 Adjust users accordingly.
c293e30c
DA
3080 * filelock.c (fill_in_lock_file_name): Avoid calls to strlen.
3081
9e059e3f
GM
30822012-07-10 Glenn Morris <rgm@gnu.org>
3083
d02eb359
GM
3084 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/netbsd.h, s/unixware.h:
3085 Move PENDING_OUTPUT_COUNT definition to configure.
3086
882cf227
GM
3087 * s/irix6-5.h (DATA_START, DATA_SEG_BITS):
3088 * s/hpux10-20.h (DATA_SEG_BITS, DATA_START):
3089 * s/gnu.h (DATA_START): Move definitions to configure.
3090
af6e839f
GM
3091 * s/irix6-5.h (SETUP_SLAVE_PTY, PTY_NAME_SPRINTF): Drop ifdef guards.
3092 We include usg5-4-common.h, which defines them both.
3093
40289a12
GM
3094 * s/gnu.h: Don't include fcntl.h (every file in Emacs that uses
3095 O_RDONLY already includes it).
3096
9e059e3f
GM
3097 Stop ns builds setting the EMACSLOADPATH environment variable.
3098 * nsterm.m (ns_load_path): Rename from ns_init_paths.
3099 Now it does not set EMACSLOADPATH, just returns the load-path string.
3100 * nsterm.h: Update accordingly.
3101 * lread.c [HAVE_NS]: Include nsterm.h.
3102 (init_lread) [HAVE_NS]: Use ns_load_path.
3103 * emacs.c (main) [HAVE_NS]: No longer call ns_init_paths.
3104
7c4e8ec0
GM
31052012-07-09 Glenn Morris <rgm@gnu.org>
3106
d4f600ff
GM
3107 * s/gnu.h (SIGNALS_VIA_CHARACTERS): No need to define it here,
3108 since the included bsd-common.h does so.
3109
cbb31951
GM
3110 Stop ns builds setting the EMACSPATH environment variable.
3111 * nsterm.m (ns_exec_path): New function, split from ns_init_paths.
3112 (ns_init_paths): Do not set EMACSPATH.
3113 * nsterm.h (ns_exec_path): Add it.
3114 * callproc.c (init_callproc_1, init_callproc) [HAVE_NS]:
3115 Use ns_exec_path.
3116
7c4e8ec0
GM
3117 * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
3118
26bccfae
PE
31192012-07-09 Paul Eggert <eggert@cs.ucla.edu>
3120
a0bee46f
PE
3121 * process.c (wait_reading_process_output): 'waitchannels' was unset
3122 when read_kbd || !NILP (wait_for_cell); fix this.
3123
5994c183
PE
3124 Add GCC-style 'const' attribute to functions that can use it.
3125 * character.h (char_resolve_modifier_mask):
3126 * keyboard.h (make_ctrl_char):
3127 * lisp.h (multibyte_char_to_unibyte, multibyte_char_to_unibyte_safe)
3128 (init_character_once, next_almost_prime, init_fns, init_image)
3129 (flush_pending_output, init_sound):
3130 * mem-limits.h (start_of_data):
3131 * menu.h (finish_menu_items):
3132 Add ATTRIBUTE_CONST.
3133 * emacs.c (DEFINE_DUMMY_FUNCTION):
3134 Declare the dummy function with ATTRIBUTE_CONST.
3135 * lisp.h (Fbyteorder, Fmax_char, Fidentity):
3136 Add decls with ATTRIBUTE_CONST.
3137
26bccfae
PE
3138 Minor improvements to make_formatted_string.
3139 * alloc.c (make_formatted_string): Prefer int to ptrdiff_t
3140 where int is good enough, as vsprintf returns an int.
3141 * lisp.h (make_formatted_string): Add ATTRIBUTE_FORMAT_PRINTF.
3142
a8290ec3
DA
31432012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3144
3145 Use make_formatted_string to avoid double length calculation.
3146 * lisp.h (make_formatted_string): New prototype.
3147 * alloc.c (make_formatted_string): New function.
3148 * buffer.c (Fgenerate_new_buffer_name): Use it.
3149 * dbus.c (syms_of_dbusbind): Likewise.
3150 * editfns.c (Fcurrent_time_zone): Likewise.
3151 * filelock.c (get_boot_time): Likewise.
3152 * frame.c (make_terminal_frame, set_term_frame_name)
3153 (x_report_frame_params): Likewise.
3154 * image.c (gs_load): Likewise.
3155 * minibuf.c (get_minibuffer): Likewise.
3156 * msdos.c (dos_set_window_size): Likewise.
3157 * process.c (make_process): Likewise.
3158 * xdisp.c (ensure_echo_area_buffers): Likewise.
3159 * xsettings.c (apply_xft_settings): Likewise.
3160
d01ba2f1
GM
31612012-07-09 Glenn Morris <rgm@gnu.org>
3162
3163 Stop ns builds polluting the environment with EMACSDATA, EMACSDOC.
3164 * nsterm.m (ns_etc_directory): New function, split from ns_init_paths.
3165 (ns_init_paths): Do not set EMACSDATA, EMACSDOC.
3166 * nsterm.h (ns_etc_directory): Add it.
3167 * callproc.c [HAVE_NS]: Include nsterm.h.
3168 (init_callproc_1, init_callproc) [HAVE_NS]: Use ns_etc_directory.
3169
f1f924b6
DA
31702012-07-09 Dmitry Antipov <dmantipov@yandex.ru>
3171
3172 Move marker debugging code under MARKER_DEBUG.
3173 * marker.c (MARKER_DEBUG): Move marker debugging code under
3174 #ifdef MARKER_DEBUG because byte_char_debug_check is too slow
3175 for bootstrap with --enable-checking (~3x slowdown reported
3176 by Juanma Barranquero <lekktu@gmail.com>).
3177 (verify_bytepos): Move under #ifdef MARKER_DEBUG.
3178
ab531b66
PE
31792012-07-08 Paul Eggert <eggert@cs.ucla.edu>
3180
3181 * systime.h (EMACS_SUB_TIME): Clarify behavior with unsigned time_t.
3182 See <http://bugs.gnu.org/11825#29>.
3183
c4b3bc8a
EZ
31842012-07-08 Eli Zaretskii <eliz@gnu.org>
3185
3186 * xdisp.c (fill_glyphless_glyph_string): If the face of the glyph
3187 has no font, use the frame's font. (Bug#11813)
3434fe8a
EZ
3188 (display_line): Add commentary about displaying truncation glyphs
3189 on GUI frames.
3190 (produce_special_glyphs): Move here from term.c.
3191
3192 * term.c (produce_special_glyphs): Move to xdisp.c.
3193
3194 * dispextern.h (produce_special_glyphs): Move prototype to xdisp.c
3195 section.
c4b3bc8a 3196
b676b881
AS
31972012-07-07 Andreas Schwab <schwab@linux-m68k.org>
3198
f17c5273
AS
3199 * xdisp.c (display_line): Avoid warning about implicit declaration
3200 of FRAME_FONT.
3201
298819b9
AS
3202 * frame.c (get_frame_param): Define only if HAVE_WINDOW_SYSTEM.
3203
b676b881
AS
3204 * lisp.h: Remove empty conditional.
3205
6045c4fd
PE
32062012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3207
b3350bf9
PE
3208 * lread.c (load_path_check): Now static.
3209
6045c4fd
PE
3210 Fix some minor --with-ns problems found by static checking.
3211 * frame.c (Ftool_bar_pixel_width) [!FRAME_TOOLBAR_WIDTH]:
3212 (x_set_font) [!HAVE_X_WINDOWS]:
3213 * image.c (xpm_load_image) [HAVE_NS]:
3214 (x_to_xcolors) [!HAVE_X_WINDOWS && !HAVE_NTGUI]:
3215 (x_disable_image) [!HAVE_NS && !HAVE_NTGUI]:
3216 Remove unused local.
3217 (Fx_parse_geometry) [HAVE_NS]: Don't return garbage.
3218 (xpm_load_image) [HAVE_NS && !HAVE_XPM]: Remove unused label.
3219 * image.c (x_create_bitmap_from_file) [HAVE_NS]:
3220 (xpm_load_image, xpm_load) [HAVE_NS && !HAVE_XPM]:
3221 * nsselect.m (symbol_to_nsstring, ns_string_to_pasteboard_internal):
3222 * xfaces.c (Fx_load_color_file) [!HAVE_X_WINDOWS]:
3223 Fix pointer signedness problem.
3224 * xfaces.c (FRAME_X_FONT_TABLE):
3225 * xterm.h (FRAME_X_FONT_TABLE): Remove unused, incompatible macros.
3226
929e7845
GM
32272012-07-07 Glenn Morris <rgm@gnu.org>
3228
3229 * lread.c (load_path_check): New function, split from init_lread.
3230 (init_lread): Reorganize. Motivation:
3231 If EMACSLOADPATH is set, check/warn about that rather than the
3232 defaults, which we are not going to use. Hence we can remove
3233 the turn_off_warning and WINDOWSNT || HAVE_NS tests.
3234 Don't warn if site-lisp directories are missing.
3235 If not installed, start from a blank load-path, since
3236 PATH_LOADSEARCH refers to the eventual installation directories.
3237
58dd0aa4
EZ
32382012-07-07 Eli Zaretskii <eliz@gnu.org>
3239
3240 Support truncation and continuation glyphs on GUI frames, when
3241 fringes are disabled. (Bug#11832)
3242 * xdisp.c (init_iterator): Get dimensions of truncation and
14ae4239
BT
3243 continuation glyphs even if on GUI frames.
3244 Adjust it->last_visible_x on GUI frames when the left or right fringes,
58dd0aa4
EZ
3245 or both, are absent.
3246 (start_display, move_it_in_display_line_to): Handle the case of a
3247 GUI frame without a fringe to display continuation or truncation
3248 glyphs.
3249 (insert_left_trunc_glyphs): Support GUI frames: make sure
3250 truncation glyphs overwrite enough glyphs from the current line to
3251 have sufficient space in pixels.
3252 (display_line): Support truncation and continuation glyphs on GUI
3253 frames. If some spare pixels are left on the line after inserting
3254 the truncation glyphs, fill that space with a stretch glyph of a
3255 suitably computed width.
3256
3257 * term.c (produce_special_glyphs): Call PRODUCE_GLYPHS, not
3258 produce_glyphs, to support GUI sessions.
3259
31571fd7
PE
32602012-07-07 Paul Eggert <eggert@cs.ucla.edu>
3261
5a16b9bc
PE
3262 * sysdep.c (ULLONG_MAX): Define if not already defined (Bug#11781).
3263
f3047c75
PE
3264 * sysdep.c (list_system_processes): Port to NetBSD-current (Bug#11797).
3265
31571fd7
PE
3266 Do not require float-time's arg to fit in time_t (Bug#11825).
3267 This works better on hosts where time_t is unsigned, and where
3268 float-time is applied to the (negative) difference between two times.
3269 * editfns.c (decode_time_components): Last arg is now double *,
3270 not int *, and means to store all the result as a double, without
3271 worrying about whether the seconds part fits in time_t.
3272 All callers changed.
3273 (lisp_time_argument): Remove last int * arg, as it's no longer needed.
3274 All callers changed.
3275 (Ffloat_time): Do not fail merely because the specified time falls
3276 outside of time_t range.
3277
4516fbef
GM
32782012-07-07 Glenn Morris <rgm@gnu.org>
3279
3280 * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
3281 * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
3282 * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
3283
07adc2c6
JB
32842012-07-07 Juanma Barranquero <lekktu@gmail.com>
3285
3286 * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
3287 Update dependencies.
3288
3289 * s/ms-w32.h [_MSC_VER]: Remove strcasecmp, strncasecmp.
3290
fd573f31
PE
32912012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3292
fee5959d
PE
3293 Use c_strcasecmp for ASCII case-insensitive comparison (Bug#11786).
3294 * dispextern.h, nsfns.m, nsterm.m: Include <c-strcase.h>.
3295 * dispextern.h (xstrcasecmp): Rewrite using c_strcasecmp.
3296 * nsfns.m (x_get_string_resource): Use c_strncasecmp, not strncasecmp.
3297 * nsterm.m (ns_default): Use c_strcasecmp, not strcasecmp.
3298 * xfaces.c (xstrcasecmp) [!HAVE_STRCASECMP]: Remove.
3299
fd573f31
PE
3300 * xfont.c (compare_font_names): Redo to omit the need for casts.
3301
ddadbc0e
AS
33022012-07-06 Andreas Schwab <schwab@linux-m68k.org>
3303
fca8d6b6
AS
3304 * xfns.c (Fx_change_window_property): Doc fix.
3305 * w32fns.c (Fx_change_window_property): Doc fix.
3306
ddadbc0e
AS
3307 * w32fns.c (Fx_window_property): Accept the same arguments as the
3308 X Windows version. Doc fix.
3309 * xfns.c (Fx_window_property): Doc fix. (Bug#11870)
3310
ed9265fc 33112012-07-06 Juanma Barranquero <lekktu@gmail.com>
f247498e
JB
3312 Eli Zaretskii <eliz@gnu.org>
3313
3314 * s/ms-w32.h: Settings not specific to Windows moved to nt/config.nt.
3315 Windows-specific code from nt/config.nt moved here.
3316 Obsolete settings removed.
3317
216ee680
PE
33182012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3319
3320 * process.c: Avoid unnecessary calls to gettime.
3321 (wait_reading_process_output): Don't get the time of day
3322 when gobbling data immediately and not waiting, as there's no need
3323 for it in that case. This removes a FIXME.
3324
bdd091e4
JD
33252012-07-06 Jan Djärv <jan.h.d@swipnet.se>
3326
3327 * gtkutil.c (xg_event_is_for_scrollbar): Assign gwin when HAVE_GTK3
3328 is defined (Bug#11768).
3329
9d44f8ce
DA
33302012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3331
3332 Fix marker debugging code.
3333 * marker.c (byte_char_debug_check): Do not perform the check
3334 if buffer is not multibyte.
090bd7cb
JB
3335 (buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3336 Call byte_char_debug_check with correct arguments.
9d44f8ce 3337
90fc4786
DA
33382012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3339
3340 Compile marker debugging code only if ENABLE_CHECKING is defined.
090bd7cb
JB
3341 * marker.c (byte_char_debug_check, count_markers):
3342 Use only if ENABLE_CHECKING is defined.
90fc4786
DA
3343 (byte_debug_flag): Remove.
3344 (CONSIDER, buf_charpos_to_bytepos, buf_bytepos_to_charpos):
3345 Always call byte_char_debug_check if ENABLE_CHECKING is defined.
3346
7b7ae965
DA
33472012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3348
4e57b342
DA
3349 Avoid code repetition in marker-related functions.
3350 * marker.c (attach_marker): New function.
3351 (Fset_marker, set_marker_restricted, set_marker_both)
3352 (set_marker_restricted_both): Use it.
3353 (Fset_marker, set_marker_restricted, Fbuffer_has_markers_at):
3354 Consistently rename charno to charpos.
3355 (marker_position): Add eassert.
3356 (marker_byte_position): Convert to eassert.
3357
33582012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3359
3360 Simplify list operations in unchain_overlay and unchain_marker.
7b7ae965 3361 * buffer.c (unchain_overlay): Simplify. Add comment.
4e57b342 3362 * marker.c (unchain_marker): Simplify. Fix comments.
7b7ae965 3363
657924ff
DA
33642012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3365
3366 Introduce fast path for the widely used marker operation.
3367 * alloc.c (build_marker): New function.
3368 * lisp.h (build_marker): New prototype.
3369 * buffer.c (clone_per_buffer_values, Fmake_indirect_buffer): Use it.
3370 * composite.c (autocmp_chars): Likewise.
3371 * editfns.c (buildmark): Remove.
3372 (Fpoint_marker, Fpoint_min_marker, Fpoint_max_marker)
3373 (save_restriction_save): Use build_marker.
3374 * marker.c (buf_charpos_to_bytepos, buf_bytepos_to_charpos): Likewise.
3375 * window.c (save_window_save): Likewise.
3376
041a49a6
DA
33772012-07-06 Dmitry Antipov <dmantipov@yandex.ru>
3378
3379 Do not use Fdelete_overlay in delete_all_overlays
3380 to avoid redundant calls to unchain_overlay.
3381 * buffer.c (drop_overlay): New function.
3382 (delete_all_overlays, Fdelete_overlay): Use it.
3383 * minibuf.c (get_minibuffer): Fix comment.
3384
7dca65a4
PE
33852012-07-06 Paul Eggert <eggert@cs.ucla.edu>
3386
3387 Port to OpenBSD 5.1 amd64.
3388 * sysdep.c [BSD_SYSTEM]: Include <sys/param.h> before <sys/sysctl.h>.
3389 This is needed for OpenBSD, and should be harmless on all BSD systems.
3390 Also, include <sys/sysctl.h>, as it should be available on all
3391 BSD_SYSTEM hosts given that we're already calling sysctl in that case.
3392 (list_system_processes) [__OpenBSD__]: Use DARWIN_OS style mib, but
3393 use p_pid member, not kp_proc.pid.
3394
8eb876e2
GM
33952012-07-06 Glenn Morris <rgm@gnu.org>
3396
3397 * Makefile.in (emacs$(EXEEXT)): Don't check for load-path shadows.
3398
38182d90
PE
33992012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3400
3401 More xmalloc and related cleanup.
3402 * alloc.c, bidi.c, buffer.c, buffer.h, bytecode.c, callint.c:
3403 * callproc.c, charset.c, coding.c, composite.c, data.c, dispnew.c:
3404 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, fns.c:
3405 * font.c, fontset.c, frame.c, fringe.c, ftfont.c, ftxfont.c, gmalloc.c:
3406 * gtkutil.c, image.c, keyboard.c, keymap.c, lread.c, macros.c, menu.c:
3407 * nsfns.m, nsfont.m, nsmenu.m, nsterm.m, print.c, process.c, ralloc.c:
3408 * regex.c, region-cache.c, scroll.c, search.c, sound.c, syntax.c:
3409 * sysdep.c, term.c, termcap.c, unexmacosx.c, window.c, xdisp.c:
3410 * xfaces.c, xfns.c, xftfont.c, xgselect.c, xmenu.c, xrdb.c, xselect.c:
3411 * xterm.c:
3412 Omit needless casts involving void * pointers and allocation.
3413 Prefer "P = xmalloc (sizeof *P)" to "P = xmalloc (sizeof (TYPE_OF_P))",
3414 as the former is more robust if P's type is changed.
3415 Prefer xzalloc to xmalloc + memset 0.
3416 Simplify malloc-or-realloc to realloc.
3417 Don't worry about xmalloc returning a null pointer.
3418 Prefer xstrdup to xmalloc + strcpy.
3419 * editfns.c (Fmessage_box): Grow message_text by at least 80 when
3420 growing it.
3421 * keyboard.c (apply_modifiers_uncached): Prefer local array to
3422 alloca of a constant.
3423
6dd5a677
EZ
34242012-07-05 Eli Zaretskii <eliz@gnu.org>
3425
3426 * xdisp.c (display_line): Fix horizontal pixel coordinates when
3427 hscroll is larger than the line width. Fixes long and futile
3428 looping inside extend_face_to_end_of_line (on a TTY) producing
3429 glyphs that are not needed and thrown away.
3430
6b312f0f
DA
34312012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3432
3433 * marker.c (set_marker_restricted_both): Simplify by using
3434 clip_to_bounds.
3435
f520ef9b
PE
34362012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3437
3438 * editfns.c (region_limit): Simplify by using clip_to_bounds.
3439
383b7c95
JD
34402012-07-05 Jan Djärv <jan.h.d@swipnet.se>
3441
3442 * gtkutil.c (gtk_scrollbar_new, gtk_box_new): Define when HAVE_GTK3 is
3443 not defined (Bug#11768).
3444 (xg_create_frame_widgets): Use gtk_plug_new_for_display (Bug#11768).
3445 (xg_create_frame_widgets, create_dialog, xg_get_file_with_chooser)
3446 (make_widget_for_menu_item, xg_make_tool_item): Use gtk_box_new
3447 followed by gtk_box_set_homogeneous (Bug#11768).
3448 (xg_update_menu_item): Use GTK_IS_BOX (Bug#11768).
090bd7cb
JB
3449 (update_theme_scrollbar_width, xg_create_scroll_bar):
3450 Use gtk_scrollbar_new (Bug#11768).
383b7c95
JD
3451 (xg_event_is_for_scrollbar): Use Gdk Device functions for HAVE_GTK3.
3452 (is_box_type): New function (Bug#11768).
3453 (xg_tool_item_stale_p): Call is_box_type.
5293d758 3454 (xg_initialize): Get settings by calling gtk_settings_get_for_screen
383b7c95
JD
3455 with default display (Bug#11768).
3456
d6e7bf45
EZ
34572012-07-05 Eli Zaretskii <eliz@gnu.org>
3458
3459 * xdisp.c (window_hscroll_limited): New function.
3460 (pos_visible_p, init_iterator): Use it to avoid overflow of pixel
3461 coordinates when window's hscroll is set to insanely large
3462 values. (Bug#11857)
3463
431391ec
JB
34642012-07-05 Juanma Barranquero <lekktu@gmail.com>
3465
3466 * makefile.w32-in ($(BLD)/dired.$(O), $(BLD)/fileio.$(O)): Fix typo.
3467 ($(BLD)/terminal.$(O), $(BLD)/syntax.$(O)): Update dependencies.
3468
23f86fce
DA
34692012-07-05 Dmitry Antipov <dmantipov@yandex.ru>
3470
3471 Cleanup xmalloc.
3472 * lisp.h (xzalloc): New prototype. Omit needless casts.
3473 * alloc.c (xzalloc): New function. Omit needless casts.
3474 * charset.c: Omit needless casts. Convert all calls to
3475 xmalloc with following memset to xzalloc.
3476 * dispnew.c: Likewise.
3477 * fringe.c: Likewise.
3478 * image.c: Likewise.
3479 * sound.c: Likewise.
3480 * term.c: Likewise.
3481 * w32fns.c: Likewise.
3482 * w32font.c: Likewise.
3483 * w32term.c: Likewise.
3484 * xfaces.c: Likewise.
3485 * xfns.c: Likewise.
3486 * xterm.c: Likewise.
3487 * atimer.c: Omit needless casts.
3488 * buffer.c: Likewise.
3489 * callproc.c: Likewise.
3490 * ccl.c: Likewise.
3491 * coding.c: Likewise.
3492 * composite.c: Likewise.
3493 * doc.c: Likewise.
3494 * doprnt.c: Likewise.
3495 * editfns.c: Likewise.
3496 * emacs.c: Likewise.
3497 * eval.c: Likewise.
3498 * filelock.c: Likewise.
3499 * fns.c: Likewise.
3500 * gtkutil.c: Likewise.
3501 * keyboard.c: Likewise.
3502 * lisp.h: Likewise.
3503 * lread.c: Likewise.
3504 * minibuf.c: Likewise.
3505 * msdos.c: Likewise.
3506 * print.c: Likewise.
3507 * process.c: Likewise.
3508 * region-cache.c: Likewise.
3509 * search.c: Likewise.
3510 * sysdep.c: Likewise.
3511 * termcap.c: Likewise.
3512 * terminal.c: Likewise.
3513 * tparam.c: Likewise.
3514 * w16select.c: Likewise.
3515 * w32.c: Likewise.
3516 * w32reg.c: Likewise.
3517 * w32select.c: Likewise.
3518 * w32uniscribe.c: Likewise.
3519 * widget.c: Likewise.
3520 * xdisp.c: Likewise.
3521 * xmenu.c: Likewise.
3522 * xrdb.c: Likewise.
3523 * xselect.c: Likewise.
3524
0497dc44
PE
35252012-07-05 Paul Eggert <eggert@cs.ucla.edu>
3526
3527 * fileio.c (time_error_value): Check the right error number.
3528 Problem reported by Troels Nielsen in
3529 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00095.html>.
3530
356e7178
PE
35312012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3532
4e71fd89
PE
3533 * window.c (set_window_hscroll): Revert the 100000 hscroll limit.
3534 This should be fixed in a better way; see Eli Zaretskii in
3535 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00088.html>.
3536 (HSCROLL_MAX): Remove; this is now internal to set_window_hscroll.
3537
f0941253
PE
3538 * fileio.c (time_error_value): Rename from special_mtime.
3539 The old name's problems were noted by Eli Zaretskii in
3540 <http://lists.gnu.org/archive/html/emacs-devel/2012-07/msg00087.html>.
3541
065c9eb4
PE
3542 * emacs.c (gdb_pvec_type): Change it back to enum pvec_type.
3543 This variable's comment says Emacs needs at least one GDB-visible
3544 symbol of type enum pvec_type, to work around GDB problems.
3545 The symbol's value doesn't matter.
3546
356e7178
PE
3547 * alloc.c (PSEUDOVECTOR_NBYTES): Remove stray ';'
3548 that causes compilation to fail on pre-C99 compilers.
3549
ed9265fc 35502012-07-04 Juanma Barranquero <lekktu@gmail.com>
95f61aa2
JB
3551
3552 * s/ms-w32.h (LISP_FLOAT_TYPE, HAVE_MEMCMP, HAVE_MEMCPY)
3553 (HAVE_MEMMOVE, HAVE_MEMSET): Don't set, obsolete.
3554
3884d954
DA
35552012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3556
d209e2fb 3557 * buffer.c (init_buffer_once): Fix initialization of
3884d954
DA
3558 headers for buffer_defaults and buffer_local_symbols.
3559 Reported by Juanma Barranquero <lekktu@gmail.com>.
3560
ee28be33
SM
35612012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
3562
3563 Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
3564 * lisp.h (enum pvec_type): Use fewer bits.
3565 (PSEUDOVECTOR_SIZE_BITS): New constant.
3566 (PSEUDOVECTOR_SIZE_MASK, PVEC_TYPE_MASK): Use it.
3567 (XSETPVECTYPESIZE, XSETTYPED_PSEUDOVECTOR, DEFUN): Adapt code to
3568 change in pvec_type.
3569 (PSEUDOVECTOR_TYPEP): New macro.
3570 (TYPED_PSEUDOVECTORP): Use it.
3571 * fns.c (internal_equal): Adapt code to extract pvectype.
3572 * emacs.c (gdb_pvec_type): Update type.
3573 * alloc.c (PSEUDOVECTOR_NBYTES): New macro.
3574 (VECTOR_FREE_LIST_SIZE_MASK): Remove (=> PSEUDOVECTOR_SIZE_MASK).
3575 (VECTOR_FREE_LIST_FLAG): Remove (=> PVEC_FREE).
3576 (SETUP_ON_FREE_LIST): Use XSETPVECTYPESIZE.
3577 (sweep_vectors): Use it. Use local var `total_bytes' instead of
3578 abusing vector->header.next.nbytes.
3579 (live_vector_p): Use PVEC_TYPE.
3580 (mark_object): Adapt code to extract pvectype. Use switch.
3581
c7f2cd7f
PE
35822012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3583
3584 * doprnt.c (doprnt): Don't assume string length fits in 'int'.
3585 Tighten new eassert a bit.
3586
8ce70ed2
DA
35872012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3588
3589 Fix compilation with --enable-gcc-warnings and -O1
3590 optimization level.
3591 * doprnt.c (doprnt): Change type of tem to int, initialize
3592 to avoid compiler warning. Add eassert.
3593 * search.c (simple_search): Initialize match_byte to avoid
3594 compiler warning. Add eassert.
3595
dea7f1e5
PE
35962012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3597
24a212eb
PE
3598 Avoid weird behavior with large horizontal scrolls.
3599 Without this change, for example, large hscroll values would
3600 mess up Emacs's display on Fedora 15 x86, presumably due to
3601 overflows in int calculations in the display code.
3602 Also, if buffers had long lines, Emacs would freeze.
3603 * window.c (HSCROLL_MAX): Reduce to 100000, and make it visible to GDB.
3604 (set_window_hscroll): New function, containing the old guts of
3605 Fset_window_hscroll. Return the clipped value.
3606 (Fset_window_hscroll, Fscroll_left, Fscroll_right): Use it.
3607 This avoids the need to check against PTRDIFF_MAX.
3608
dea7f1e5
PE
3609 * buffer.c (Fgenerate_new_buffer_name): Fix sprintf format mismatch.
3610
76046526
DA
36112012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
3612
3613 * buffer.c (Fgenerate_new_buffer_name): Fix type mismatch.
3614
39adff0d
PE
36152012-07-04 Paul Eggert <eggert@cs.ucla.edu>
3616
63807d47
PE
3617 * regex.c: Suppress GCC warning on RHEL 6. (Bug#11207)
3618 Conditionalize the pragmas on GCC 4.5 or later, not GCC 4.3 or later,
3619 since GCC 4.4.6 issues a bogus warning for them.
3620
39adff0d
PE
3621 Fix bugs in file timestamp newness comparisons.
3622 * fileio.c (Ffile_newer_than_file_p):
3623 * lread.c (Fload): Use full timestamp resolution of files,
3624 not just the 1-second resolution, so that files that are only
3625 slightly newer still count as newer.
3626 * fileio.c (Ffile_newer_than_file_p): Don't assume file
3627 timestamps fit in 'int'; this fixes a Y2038 bug on most hosts.
3628
dbeed9a6
PE
36292012-07-03 Paul Eggert <eggert@cs.ucla.edu>
3630
3631 * fileio.c: Improve handling of file time marker. (Bug#11852)
3632 (special_mtime): New function.
3633 (Finsert_file_contents, Fverify_visited_file_modtime):
3634 Use it to set special mtime values consistently.
3635
636334d6
AS
36362012-07-03 Andreas Schwab <schwab@linux-m68k.org>
3637
3638 * fileio.c (Finsert_file_contents): Properly handle st_mtime
3639 marker for non-existing file. (Bug#11852)
3640
e2017fe2
GM
36412012-07-03 Glenn Morris <rgm@gnu.org>
3642
3643 * lisp.h (Fread_file_name): Restore EXFUN (it's not a normal DEFUN
3644 and did not make it into globals.h).
3645
404dbd37
TT
36462012-07-03 Tom Tromey <tromey@redhat.com>
3647
3648 * window.c (Fset_window_margins, Fset_window_fringes)
3649 (Fset_window_scroll_bars, Fset_window_vscroll): No longer static.
3650 * textprop.c (Fprevious_property_change): No longer static.
3651 * syntax.c (Fsyntax_table_p): No longer static.
3652 * process.c (Fget_process, Fprocess_datagram_address): No longer
3653 static.
3654 * keymap.c (Flookup_key, Fcopy_keymap): No longer static.
3655 * keyboard.c (Fcommand_execute): No longer static.
3656 Remove EXFUN.
3657 * insdel.c (Fcombine_after_change_execute): No longer static.
3658 * image.c (Finit_image_library): No longer static.
3659 * fileio.c (Fmake_symbolic_link): No longer static.
3660 * eval.c (Ffetch_bytecode): No longer static.
3661 * editfns.c (Fuser_full_name): No longer static.
d209e2fb
JB
3662 * doc.c (Fdocumentation_property, Fsnarf_documentation):
3663 No longer static.
404dbd37
TT
3664 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): No longer
3665 static.
3666 * dired.c (Ffile_attributes): No longer static.
3667 * composite.c (Fcomposition_get_gstring): No longer static.
3668 * callproc.c (Fgetenv_internal): No longer static.
3669
3670 * ccl.h: Remove EXFUNs.
3671 * buffer.h: Remove EXFUNs.
3672 * dispextern.h: Remove EXFUNs.
3673 * intervals.h: Remove EXFUNs.
3674 * fontset.h: Remove EXFUN.
3675 * font.h: Remove EXFUNs.
3676 * dosfns.c (system_process_attributes): Remove EXFUN.
3677 * keymap.h: Remove EXFUNs.
3678 * lisp.h: Remove EXFUNs.
3679 * w32term.h: Remove EXFUNs.
3680 * window.h: Remove EXFUNs.
3681 * xsettings.h: Remove EXFUN.
3682 * xterm.h: Remove EXFUN.
3683
8e4fd1e1
GM
36842012-07-03 Glenn Morris <rgm@gnu.org>
3685
3686 * lisp.h (Frandom): Make it visible to C.
3687 * buffer.c (Fgenerate_new_buffer_name): Speed up finding a new
3688 buffer for invisible buffers. (Bug#1229)
3689
ca95b3eb
DA
36902012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3691
3692 Fix block vector allocation code to allow VECTOR_BLOCK_SIZE
3693 values which aren't power of 2.
14ae4239
BT
3694 * alloc.c (VECTOR_FREE_LIST_SIZE_MASK): New macro.
3695 Verify it's value and the value of VECTOR_BLOCK_SIZE. Adjust users
ca95b3eb
DA
3696 accordingly.
3697
7555c33f
SM
36982012-07-03 Stefan Monnier <monnier@iro.umontreal.ca>
3699
3700 * lisp.h (Lisp_Misc, Lisp_Fwd): Move around to group better.
3701
3702 * alloc.c (mark_object): Revert part of last patch to use `switch'.
3703
d12e8f5a
DA
37042012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3705
3706 * alloc.c (allocate_vector_block): Remove redundant
3707 calls to mallopt if DOUG_LEA_MALLOC is defined.
3708 (allocate_vectorlike): If DOUG_LEA_MALLOC is defined,
3709 avoid calls to mallopt if zero_vector is returned.
3710
296094c3
DA
37112012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3712
3713 * alloc.c (check_string_bytes): If GC_CHECK_STRING_BYTES
3714 is enabled, avoid dereferencing NULL current_sblock if
3715 running undumped.
3716
36429c89
DA
37172012-07-03 Dmitry Antipov <dmantipov@yandex.ru>
3718
3719 Cleanup basic buffer management.
3720 * buffer.h (struct buffer): Change layout to use generic vector
3721 marking code. Fix some comments. Change type of 'clip_changed'
3722 to bitfield. Remove unused #ifndef old.
3723 (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER): Remove.
3724 (GET_OVERLAYS_AT): Fix indentation.
3725 (for_each_per_buffer_object_at): New macro.
3726 * buffer.c (clone_per_buffer_values, reset_buffer_local_variables)
3727 (Fbuffer_local_variables): Use it.
3728 (init_buffer_once, syms_of_buffer): Remove unused #ifndef old.
3729 * alloc.c (allocate_buffer): Adjust to match new layout of
3730 struct buffer. Fix comment.
3731 (mark_overlay): New function.
3732 (mark_buffer): Use it. Use mark_vectorlike to mark normal
3733 Lisp area of struct buffer.
3734 (mark_object): Use it. Adjust marking of misc objects
3735 and related comments.
3736
3b3e4cac
PE
37372012-07-02 Paul Eggert <eggert@cs.ucla.edu>
3738
3739 * alloc.c (mark_object): Remove "#ifdef GC_CHECK_MARKED_OBJECTS"
3740 wrapper that is not needed because the wrapped code is a no-op (zero
3741 machine instructions) when GC_CHECK_MARKED_OBJECTS is not defined.
3742 This avoids a -Wunused-macros diagnostic with GCC 4.7.1 x86-64.
3743
cf5c0175
DA
37442012-07-02 Dmitry Antipov <dmantipov@yandex.ru>
3745
3746 * alloc.c (mark_buffer): Simplify. Remove prototype.
3747 (mark_object): Add comment. Reorganize marking of vector-like
faf611c7 3748 objects. Use CHECK_LIVE for all vector-like objects except buffers
14ae4239
BT
3749 and subroutines when GC_CHECK_MARKED_OBJECTS is defined.
3750 Avoid redundant calls to mark_vectorlike for bool vectors.
cf5c0175 3751
ca26824c
GM
37522012-06-30 Glenn Morris <rgm@gnu.org>
3753
2e4c5312
GM
3754 * nsterm.m (ns_init_paths): Ignore site-lisp if --no-site-lisp.
3755
ca26824c
GM
3756 * epaths.in (PATH_SITELOADSEARCH): New.
3757 * lread.c (init_lread): Use PATH_SITELOADSEARCH.
3758 This is rather than relying on --enable-locallisppath elements
3759 having "site-lisp" in their names. (Bug#10208#25, 11658)
3760
0d23c240
EZ
37612012-06-30 Eli Zaretskii <eliz@gnu.org>
3762
c9240d7a
EZ
3763 * w32proc.c (sys_select): Accept and ignore one more argument.
3764
3765 * w32.c (emacs_gnutls_pull): Call select with one more argument.
3766
0d23c240 3767 * sysselect.h [DOS_NT]: Don't include sys/select.h.
9ff8f76b 3768 (pselect) [!MS_DOS]: Redirect to sys_select.
0d23c240
EZ
3769
3770 * sysdep.c: Don't include dos.h and dosfns.h.
3771
3772 * process.c (sys_select):
3773 * msdos.c (sys_select): Accept one more argument and ignore it.
3774
3775 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
3776 adapt data types and code to that.
3777
3778 * dosfns.c:
3779 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
3780 which clashes with the gnulib function of the same name.
3781
af5a5a98
AS
37822012-06-30 Andreas Schwab <schwab@linux-m68k.org>
3783
c5e4379c
AS
3784 * font.c (font_style_to_value, font_style_symbolic)
3785 (font_prop_validate_style): Add type checks for values in
3786 font_style_table.
3787
af5a5a98
AS
3788 * lisp.h (CHECK_RANGED_INTEGER): Make value to check the first
3789 argument.
3790 * character.c, charset.c, menu.c, process.c, window.c: Adjust all
3791 uses.
3792
8d38f461
EZ
37932012-06-29 Eli Zaretskii <eliz@gnu.org>
3794
2e5a6631
EZ
3795 * xdisp.c (try_window_id): Undo last change.
3796
8d38f461
EZ
3797 * w32.c (getwd): Adjust commentary about startup_dir.
3798 (init_environment): Always call sys_access, even in non-MSVC
3799 builds. Don't chdir to the directory of the Emacs executable.
3800 This undoes code from 1997 which was justified by the need to
3801 "avoid conflicts when removing and renaming directories". But its
3802 downside was that every relative file name was being interpreted
3803 relative to the directory of the Emacs executable, which can never
3804 be TRT. In particular, it broke sys_access when called with
3805 relative file names.
3806 (sys_access): Map GetLastError to errno.
3807
2af3565e
DA
38082012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3809
3810 * window.h (struct window): Change type of 'fringes_outside_margins'
3811 to bitfield. Fix comment. Adjust users accordingly.
cf5c0175 3812 (struct window): Change type of 'window_end_bytepos' to ptrdiff_t.
2af3565e
DA
3813 Adjust comment.
3814 * xdisp.c (try_window_id): Change type of 'first_vpos' and 'vpos'
3815 to ptrdiff_t.
3816
c8d3a25c 38172012-06-29 Andreas Schwab <schwab@linux-m68k.org>
57570cd3 3818
c8d3a25c
GM
3819 * gnutls.c (emacs_gnutls_handshake):
3820 Add QUIT to make the loop interruptible.
57570cd3 3821
c8d3a25c 38222012-06-29 Glenn Morris <rgm@gnu.org>
d01fd55f 3823
c8d3a25c
GM
3824 * charset.c (init_charset): Make lack of etc/charsets fatal.
3825
3e984ee8
DA
38262012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3827
3828 * editfns.c (region_limit): Fix type mismatch.
3829
ef884f23
DA
38302012-06-29 Dmitry Antipov <dmantipov@yandex.ru>
3831
3832 * nsfns.m: Fix GLYPH_DEBUG usage assuming that it may be
3833 undefined. Convert from xassert to eassert.
3834 * nsmenu.m: Convert from xassert to eassert.
3835 * nsterm.m: Likewise.
3836
7d7e0027
SM
38372012-06-28 Stefan Monnier <monnier@iro.umontreal.ca>
3838
3839 * editfns.c (region_limit): Clip to narrowing (bug#11770).
3840
aa754e6a
PE
38412012-06-28 Paul Eggert <eggert@cs.ucla.edu>
3842
3843 Avoid integer overflow on scroll-left and scroll-right.
3844 * window.c (HSCROLL_MAX): New macro.
3845 (Fscroll_left, Fscroll_right): Avoid undefined behavior on integer
3846 overflow when requested scroll falls outside ptrdiff_t range.
3847
80b00b08
DA
38482012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3849
3850 * window.h (struct window): Change type of 'hscroll',
3851 'min_hscroll' and 'last_point' from Lisp_Object to ptrdiff_t,
3852 'last_modified' and 'last_overlay_modified' to EMACS_INT.
3853 Adjust users accordingly.
3854 * xdisp.c (try_cursor_movement): Replace type check with eassert.
3855 * window.c (Fscroll_left, Fscroll_right): Change type of 'hscroll'
3856 from EMACS_INT to ptrdiff_t.
3857 (make_window): Omit redundant initialization.
3858
62b2bcf6
JB
38592012-06-28 Juanma Barranquero <lekktu@gmail.com>
3860
3861 * makefile.w32-in ($(BLD)/regex.$(O)): Update dependencies.
3862
45942c7d
DA
38632012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3864
3865 * window.h (struct window): Change type of 'use_time' and
3866 'sequence_number' from Lisp_Object to int.
3867 * frame.c (make_frame): Adjust users accordingly.
3868 * print.c (print_object): Likewise.
3869 * window.c (select_window, Fwindow_use_time, make_parent_window)
3870 (make_window): Likewise.
3871
e509cfa6
DA
38722012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3873
3874 * dispextern.h (GLYPH_DEBUG): Now defined in config.h if
3875 enabled with --enable-checking=[all,glyphs] configure option.
3876 Fix GLYPH_DEBUG usage assuming that it may be undefined,
3877 adjust comments accordingly.
3878 * dispnew.c: Fix GLYPH_DEBUG usage assuming that it may be
3879 undefined, adjust comments accordingly.
3880 * image.c: Likewise.
3881 * scroll.c: Likewise.
3882 * w32fns.c: Likewise.
3883 * w32term.c: Likewise.
3884 * xdisp.c: Likewise.
3885 * xfaces.c: Likewise.
3886 * xfns.c: Likewise.
3887 * xterm.c: Likewise.
3888
a54e2c05
DA
38892012-06-28 Dmitry Antipov <dmantipov@yandex.ru>
3890
3891 Generalize run-time debugging checks.
3892 * dispextern.h (XASSERTS): Remove.
3893 * fontset.c (xassert): Remove.
3894 Convert from xassert to eassert.
3895 * alloc.c: Convert from xassert to eassert.
3896 * bidi.c: Likewise.
3897 * dispnew.c: Likewise.
3898 * fns.c: Likewise.
3899 * fringe.c: Likewise.
3900 * ftfont.c: Likewise.
3901 * gtkutil.c: Likewise.
3902 * image.c: Likewise.
3903 * keyboard.c: Likewise.
3904 * menu.c: Likewise.
3905 * process.c: Likewise.
3906 * scroll.c: Likewise.
3907 * sound.c: Likewise.
3908 * term.c: Likewise.
3909 * w32console.c: Likewise.
3910 * w32fns.c: Likewise.
3911 * w32term.c: Likewise.
3912 * window.c: Likewise.
3913 * xdisp.c: Likewise.
3914 * xfaces.c: Likewise.
3915 * xfns.c: Likewise.
3916 * xselect.c: Likewise.
3917 * xterm.c: Likewise.
3918
1ec4b7b2
SM
39192012-06-27 Stefan Monnier <monnier@iro.umontreal.ca>
3920
3921 * fns.c (maybe_resize_hash_table): Output message when growing the
3922 purify-hashtable.
3923
2014308a
DA
39242012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3925
3926 * alloc.c (allocate_string_data): Remove dead code.
3927 * xsettings.c (XSETTINGS_FONT_NAME): Move under HAVE_XFT to
3928 avoid GCC warning about unused macro.
3929
246155eb
DA
39302012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3931
3932 * alloc.c (allocate_string): Omit intervals initialization.
3933 * alloc.c (make_uninit_multibyte_string): Initialize intervals
3934 as in make_pure_string and make_pure_c_string.
3935
43184b7b
DA
39362012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3937
d209e2fb 3938 * alloc.c (allocate_string): Fix last change.
43184b7b 3939
3fe6dd74
DA
39402012-06-27 Dmitry Antipov <dmantipov@yandex.ru>
3941
d209e2fb 3942 * alloc.c (allocate_string): Remove two redundant calls
3fe6dd74
DA
3943 to memset, add explicit initialization where appropriate.
3944
1ba6038a
GM
39452012-06-27 Glenn Morris <rgm@gnu.org>
3946
3947 * lisp.mk (lisp): Remove paths.elc.
3948
c89926a5
CY
39492012-06-27 Chong Yidong <cyd@gnu.org>
3950
3951 * doc.c (Fsubstitute_command_keys): Fix punctuation.
3952
ed6b3510
JW
39532012-06-26 John Wiegley <johnw@newartisans.com>
3954
1ec4b7b2 3955 * unexmacosx.c (copy_data_segment): Add two section names used
157e99e4
JW
3956 on Mac OS X Lion: __mod_init_func and __mod_term_func.
3957
ed6b3510
JW
3958 * alloc.c (mark_memory): Do not check with -faddress-sanitizer
3959 when building with Clang.
3960
8edd4a2b
SM
39612012-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
3962
3963 * eval.c (Fapply): Allow calling it with a single argument.
3964
f6f62d1b
EZ
39652012-06-26 Eli Zaretskii <eliz@gnu.org>
3966
3967 * s/ms-w32.h (strcasecmp, strncasecmp) [_MSC_VER]: Redirect to
3968 _stricmp and _strnicmp.
3969 (HAVE_STRCASECMP, HAVE_STRNCASECMP): Define to 1.
3970
62efea5e
DA
39712012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3972
3973 * alloc.c (allocate_window): Zero out non-Lisp part of newly
3974 allocated window.
3975 (allocate_process): Likewise for new process.
8edd4a2b 3976 (allocate_terminal): Change to use offsetof.
62efea5e
DA
3977 (allocate_frame): Likewise.
3978 * frame.c (make_frame): Omit redundant initialization.
3979 * window.c (make_parent_window): Use memset.
3980 (make_window): Omit redundant initialization.
3981 * process.c (make_process): Omit redundant initialization.
3982 * terminal.c (create_terminal): Likewise.
3983
42997f4d
DA
39842012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3985
3986 * term.c (delete_tty): Remove redundant call to memset.
3987
1130ecfc
DA
39882012-06-26 Dmitry Antipov <dmantipov@yandex.ru>
3989
3990 * alloc.c: Remove build_string.
3991 * lisp.h: Define build_string as static inline. This provides
3992 a better opportunity to optimize away calls to strlen when the
3993 function is called with compile-time constant argument.
3994 * image.c (imagemagick_error): Convert to build_string.
3995 * w32proc.c (sys_spawnve): Likewise.
3996 * xterm.c (x_term_init): Likewise.
3997
cf38a720
PE
39982012-06-26 Paul Eggert <eggert@cs.ucla.edu>
3999
99027bdd
PE
4000 Use sprintf return value instead of invoking strlen on result.
4001 In the old days this wasn't portable, since some sprintf
4002 implementations returned char *. But they died out years ago and
4003 Emacs already assumes sprintf returns int.
4004 Similarly for float_to_string.
4005 This patch speeds up (number-to-string 1000) by 3% on Fedora 15 x86-64.
4006 * ccl.c (ccl_driver):
4007 * character.c (string_escape_byte8):
4008 * data.c (Fnumber_to_string):
4009 * doprnt.c (doprnt):
4010 * print.c (print_object):
4011 * xdisp.c (message_dolog):
4012 * xfns.c (syms_of_xfns):
4013 Use sprintf or float_to_string result to avoid need to call strlen.
4014 * data.c (Fnumber_to_string):
4015 Use make_unibyte_string, since the string must be ASCII.
4016 * lisp.h, print.c (float_to_string): Now returns int length.
4017 * term.c (produce_glyphless_glyph):
4018 Use sprintf result rather than recomputing it.
4019
cf38a720
PE
4020 Clean out last vestiges of the old HAVE_CONFIG_H stuff.
4021 * Makefile.in (ALL_CFLAGS):
4022 * makefile.w32-in (LOCAL_FLAGS): Remove -DHAVE_CONFIG_H.
4023 * gmalloc.c, regex.c: Include <config.h> unconditionally.
4024
3511c784
DA
40252012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4026
0a08eb21 4027 * dispextern.h (xstrcasecmp): Define to library function
3511c784
DA
4028 strcasecmp if available.
4029 * xfaces.c: Do not use xstrcasecmp if strcasecmp is available.
4030
fb7da12e
AS
40312012-06-25 Andreas Schwab <schwab@linux-m68k.org>
4032
4033 * keyboard.c (menu_bar_items, menu_bar_item, read_key_sequence):
4034 Avoid comma operator.
4035 * menu.c (push_submenu_start, push_submenu_end)
4036 (push_left_right_boundary, push_menu_pane): Likewise.
4037 * msdos.c (dos_rawgetc): Likewise.
4038
afa2ffd8
DA
40392012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4040
4041 * xfns.c (xic_create_fontsetname): Remove redundant calls
4042 to memset.
4043
b3b4476b
PE
40442012-06-25 Paul Eggert <eggert@cs.ucla.edu>
4045
4495ff38
PE
4046 * gtkutil.c (get_utf8_string): Remove redundant assignment.
4047 sprintf already null-terminates its output.
4048
b3b4476b
PE
4049 * xfns.c (x_window): Remove redundant cast.
4050
b00876c9
DA
40512012-06-25 Dmitry Antipov <dmantipov@yandex.ru>
4052
4053 * xmenu.c (xmenu_show, xdialog_show): Explicit cast from
4054 `const char *' to `char *' to avoid compiler warning.
4055
d188e26b
PE
40562012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4057
885d1d74
PE
4058 * xterm.c (x_term_init): Build proper-sized _XSETTINGS_Snnn string
4059 instead of truncating it to 63 (admittedly a generous limit).
4060
d188e26b
PE
4061 * process.c: Fix spelling and caps in comments.
4062
e2f560b1
DN
40632012-06-24 Dan Nicolaescu <dann@ics.uci.edu>
4064
e86db54b 4065 * emacs.c (setpgrp): Remove definition, unused.
e2f560b1
DN
4066 * sysdep.c (setpgrp): Remove definition, not used in this file.
4067
7583a3a1
JB
40682012-06-24 Juanma Barranquero <lekktu@gmail.com>
4069
4070 * makefile.w32-in: Update dependencies.
4071
696056c2
EZ
40722012-06-24 Eli Zaretskii <eliz@gnu.org>
4073
4074 * makefile.w32-in (TIMESPEC_H): Remove nt/inc/sys/time.h.
4075 (SYSTIME_H): Add nt/inc/sys/time.h.
4076
4077 * systime.h [WINDOWSNT]: Include sys/time.h.
4078
4079 * s/ms-w32.h (struct timespec): Definition moved from
4080 nt/inc/sys/time.h. Suggested by Paul Eggert <eggert@cs.ucla.edu>.
4081
845ca893
PE
40822012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4083
4084 Switch from NO_RETURN to C11's _Noreturn (Bug#11750).
4085 * buffer.h (buffer_slot_type_mismatch):
4086 * data.c (arith_error) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4087 * eval.c (unwind_to_catch):
4088 * image.c (my_png_error, my_error_exit):
4089 * keyboard.c (quit_throw_to_read_char, user_error)
4090 (Fexit_recursive_edit, Fabort_recursive_edit):
4091 * lisp.h (die, args_out_of_range, args_out_of_range_3)
4092 (wrong_type_argument, buffer_overflow, __executable_start)
4093 (memory_full, buffer_memory_full, string_overflow, Fthrow)
4094 (xsignal, xsignal0, xsignal1, xsignal2, xsignal3, signal_error)
4095 (error, verror, nsberror, report_file_error, Ftop_level, Fkill_emacs)
4096 (fatal):
4097 (child_setup) [!DOS_NT]:
4098 * lread.c (end_of_file_error, invalid_syntax):
4099 * process.c (send_process_trap) [!FORWARD_SIGNAL_TO_MAIN_THREAD]:
4100 * puresize.h (pure_write_error):
4101 * search.c (matcher_overflow):
4102 * sound.c (sound_perror, alsa_sound_perror):
4103 * sysdep.c, syssignal.h (croak):
4104 * term.c (maybe_fatal, vfatal):
4105 * textprop.c (text_read_only):
4106 * undo.c (user_error):
4107 * unexmacosx.c (unexec_error):
4108 * xterm.c (x_ins_del_lines, x_delete_glyphs):
4109 Use _Noreturn rather than NO_RETURN.
4110 No need for separate decl merely because of _Noreturn.
4111 * sound.c (sound_warning, parse_sound):
4112 Remove unnecessary forward decls.
4113
f1dd8073
PE
41142012-06-24 Paul Eggert <eggert@cs.ucla.edu>
4115
4116 Fix bug when time_t is unsigned and as wide as intmax_t (Bug#9000).
4117 * lisp.h (WAIT_READING_MAX): New macro.
4118 * dispnew.c (Fsleep_for, sit_for):
4119 * keyboard.c (kbd_buffer_get_event):
4120 * process.c (Faccept_process_output):
4121 Use it to avoid bogus compiler warnings with obsolescent GCC versions.
4122 This improves on the previous patch, which introduced a bug
4123 when time_t is unsigned and as wide as intmax_t.
4124 See <http://bugs.gnu.org/9000#51>.
4125
b82c1755
EZ
41262012-06-23 Eli Zaretskii <eliz@gnu.org>
4127
4128 * dispnew.c (sit_for, Fsleep_for):
4129 * keyboard.c (kbd_buffer_get_event):
4130 * process.c (Faccept_process_output): Avoid compiler warnings when
4131 comparing a 32-bit time_t with a 64-bit INTMAX_MAX.
4132
ca300656
JB
41332012-06-23 Juanma Barranquero <lekktu@gmail.com>
4134
049ec95b
JB
4135 * makefile.w32-in: Update dependencies.
4136
ca300656
JB
4137 * w32.c (ltime): Add return type and declare static.
4138 (w32_get_internal_run_time): Remove usused variable `time_100ns'.
4139
db7b8d06
PE
41402012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4141
4142 * sysdep.c [__FreeBSD__]: Fix more recently-introduced typos.
4143 Privately reported by Herbert J. Skuhra.
4144 (make_lisp_timeval) [__FreeBSD__]: Rename from TIMELIST.
4145 All uses changed.
4146 (system_process_attributes) [__FreeBSD__]: Invoke make_lisp_time,
4147 not make_lisp_timeval, when the argument is of type EMACS_TIME.
4148
0bd8297f
EZ
41492012-06-23 Eli Zaretskii <eliz@gnu.org>
4150
96512555
EZ
4151 * w32proc.c (Fw32_get_locale_info): Fix an off-by-one error in
4152 last argument of make_unibyte_string.
4153
0bd8297f
EZ
4154 * keyboard.c (kbd_buffer_get_event): Include the codepage and the
4155 language ID in the event parameters.
4156
4157 * w32term.c (w32_read_socket): Put the new keyboard codepage into
4158 event.code, not the obscure "character set ID".
4159
63def6b6
CY
41602012-06-23 Chong Yidong <cyd@gnu.org>
4161
4162 * xmenu.c (x_menu_wait_for_event): Adapt GTK3 to new xg_select.
4163
e8a02204
EZ
41642012-06-23 Eli Zaretskii <eliz@gnu.org>
4165
388cdec0
EZ
4166 Fix the MS-Windows build broken by 2012-06-22T21:17:42Z!eggert@cs.ucla.edu.
4167 * w32.c (fdutimens): New function.
4168
4169 * w32proc.c (sys_select): Adapt to change in the EMACS_TIME type.
4170
4171 * s/ms-w32.h (pselect): Redirect to sys_select.
4172
4173 * sysselect.h [WINDOWSNT]: Don't include sys/select.h.
4174
e8a02204
EZ
4175 * ralloc.c (r_alloc_inhibit_buffer_relocation): Fix stupid thinko
4176 in the logic of incrementing and decrementing the value of
4177 use_relocatable_buffers.
4178
d054f3fb
PE
41792012-06-23 Paul Eggert <eggert@cs.ucla.edu>
4180
4181 * sysdep.c [__FreeBSD__]: Fix recently-introduced typos.
4182 Privately reported by Herbert J. Skuhra.
4183 [__FreeBSD__]: Remove "*/" typo after "#include".
4184 (timeval_to_EMACS_TIME) [__FreeBSD__]: New static function.
4185 (TIMEVAL) [__FreeBSD__]: Now a static function rather than a macro.
4186 (TIMEVAL, system_process_attributes) [__FreeBSD__]:
4187 Don't assume EMACS_TIME and struct timeval are the same type.
4188
d35af63c
PE
41892012-06-22 Paul Eggert <eggert@cs.ucla.edu>
4190
4191 Support higher-resolution time stamps (Bug#9000).
4192 The time stamps are only nanosecond-resolution at the C level,
4193 since that's the best that any real-world system supports now.
4194 But they are picosecond-resolution at the Lisp level, as that's
4195 easy, and leaves room for future OS improvements.
4196
4197 * Makefile.in (LIB_CLOCK_GETTIME): New macro.
4198 (LIBES): Use it.
4199
4200 * alloc.c (Fgarbage_collect): Port to higher-res time stamps.
4201 Don't get current time unless it's needed.
4202
4203 * atimer.c: Include <sys/time.h> unconditionally, since gnulib
4204 now provides it if it's absent.
4205 (start_atimer): Port to higher-res time stamps.
4206 Check for time stamp overflow. Don't get current time more
4207 often than is needed.
4208
4209 * buffer.h (struct buffer): Buffer modtime now has high resolution.
4210 Include systime.h, not time.h.
4211 (NONEXISTENT_MODTIME_NSECS, UNKNOWN_MODTIME_NSECS): New macros.
4212
4213 * dired.c: Include stat-time.h.
4214 (Ffile-attributes): File times now have higher resolution.
4215
4216 * dispextern.h [HAVE_WINDOW_SYSTEM]: Include systime.h.
4217 (struct image): Timestamp now has higher resolution.
4218
4219 * dispnew.c (PERIODIC_PREEMPTION_CHECKING): Remove, as Emacs always
4220 has at least microseconds now. All uses removed.
4221 (update_frame, update_single_window, update_window, update_frame_1)
4222 (Fsleep_for, sit_for): Port to higher-resolution time stamps.
927c7216 4223 (duration_to_sec_usec): Remove; no longer needed.
d35af63c
PE
4224
4225 * editfns.c (time_overflow): Now extern.
4226 (Fcurrent_time, Fget_internal_run_time, make_time, lisp_time_argument)
4227 (float-time, Fformat_time_string, Fcurrent_time_string)
4228 (Fcurrent_time_zone): Accept and generate higher-resolution
4229 time stamps.
4230 (make_time_tail, make_lisp_time, dissassemble_lisp_time)
4231 (decode_time_components, lisp_seconds_argument): New functions.
4232 (make_time): Now static.
4233 (lisp_time_argument): Now returns EMACS_TIME. New arg ppsec.
4234 Report an error if the time is invalid, rather than having the caller
4235 do that.
4236
4237 * fileio.c: Include <stat-time.h>
4238 (Fcopy_file): Copy higher-resolution time stamps.
4239 Prefer to set the time stamp via a file descriptor if that works.
4240 (Fset_file_times, Finsert_file_contents, Fwrite_region)
4241 (Fverify_visited_file_modtime, Fclear_visited_file_modtime)
4242 (Fvisited_file_modtime, Fset_visited_file_modtime):
4243 Support higher-resolution time stamps.
4244
4245 * fns.c (Frandom): Use nanoseconds, not microseconds, for seed.
4246
4247 * gtkutil.c (xg_maybe_add_timer): Port to higher-res time stamps.
4248
4249 * image.c (prepare_image_for_display, clear_image_cache)
4250 (lookup_image): Port to higer-resolution time stamps.
4251
4252 * keyboard.c (start_polling, bind_polling_period):
4253 Check for time stamp overflow.
4254 (read_char, kbd_buffer_get_event, timer_start_idle)
4255 (timer_stop_idle, timer_resume_idle, timer_check_2, timer_check)
4256 (Fcurrent_idle_time, init_keyboard, set_waiting_for_input):
4257 Port to higher-resolution time stamps. Do not assume time_t is signed.
4258 (decode_timer): New function. Timers are now vectors of length 9,
4259 not 8, to accommodate the picosecond component.
4260 (timer_check_2): Use it.
4261
4262 * nsterm.m (select_timeout, timeval_subtract): Remove.
4263 (ns_timeout): Use Emacs's facilities for time stamp arithmetic,
4264 as they're a bit more accurate and handle overflow better.
4265 (ns_select): Change prototype to be compatible with pselect.
4266 (ns_select, ns_term_shutdown): Port to ns-resolution time stamps.
4267 * nsterm.h (ns_select): Adjust prototype.
4268
4269 * msdos.c (EMACS_TIME_ZERO_OR_NEG_P): Remove, as it assumes
4270 us-resolution time stamps.
4271 (sys_select): Use the new EMACS_TIME_SIGN macro instead.
4272
4273 * lread.c (read_filtered_event): Port to ns-resolution time stamps.
4274
4275 * lisp.h (time_overflow): New decl.
4276 (wait_reading_process_output): First arg is now intmax_t, not int,
4277 to accommodate larger waits.
4278
4279 * process.h (struct Lisp_Process.read_output_delay):
4280 Now counts nanoseconds, not microseconds.
4281 * process.c (ADAPTIVE_READ_BUFFERING): Don't worry about
4282 EMACS_HAS_USECS.
4283 (READ_OUTPUT_DELAY_INCREMENT, Faccept_process_output)
4284 (wait_reading_process_output):
4285 Port to ns-resolution time stamps.
4286 (Faccept_process_output, wait_reading_process_output):
4287 Check for time stamp overflow. Do not assume time_t is signed.
4288 (select_wrapper): Remove; we now use pselect.
4289 (Fprocess_attributes): Now generates ns-resolution time stamps.
4290
4291 * sysdep.c: Include utimens.h. Don't include utime.h
4292 or worry about struct utimbuf; gnulib does that for us now.
4293 (gettimeofday): Remove; gnulib provides a substitute.
4294 (make_timeval): New function.
4295 (set_file_times): Now sets ns-resolution time stamps.
4296 New arg FD; all uses changed.
4297 (time_from_jiffies, ltime_from_jiffies, get_up_time)
4298 (system_process_attributes):
4299 Now returns ns-resolution time stamp. All uses changed.
4300 Check for time stamp overflow.
4301
4302 * sysselect.h: Don't depend on HAVE_SYS_SELECT_H; gnulib
4303 provides a substitute now.
4304
4305 * systime.h: Include timespec.h rather than sys/time.h and time.h,
4306 since it guarantees struct timespec.
4307 (EMACS_TIME): Now struct timespec, so that we can support
4308 ns-resolution time stamps.
4309 (EMACS_TIME_RESOLUTION, LOG10_EMACS_TIME_RESOLUTION): New macros.
4310 (EMACS_HAS_USECS): Remove; Emacs always has sub-second time stamps now.
4311 (EMACS_USECS): Remove.
4312 (EMACS_SET_USECS): The underlying time stamp now has ns resolution,
4313 so multiply the arg by 1000 before storing it.
4314 (EMACS_NSECS, EMACS_SECS_ADDR, EMACS_SET_NSECS, EMACS_SET_SECS_NSECS):
4315 New macros.
4316 (EMACS_GET_TIME, EMACS_ADD_TIME, EMACS_SUB_TIME):
4317 Port to ns-resolution time stamps.
4318 (EMACS_TIME_NEG_P): Remove; replaced by....
4319 (EMACS_TIME_SIGN): New macro.
4320 (EMACS_SET_INVALID_TIME, EMACS_TIME_VALID_P)
4321 (EMACS_TIME_FROM_DOUBLE, EMACS_TIME_TO_DOUBLE): New macros.
4322 (set_file_times, make_time, lisp_time_argument): Adjust signature.
4323 (make_timeval, make_lisp_time, decode_time_components): New decls.
4324 (EMACS_TIME_CMP): Remove; no longer used. Plus, it was buggy, in
4325 that it mishandled time_t overflow. You can't compare by subtracting!
4326 (EMACS_TIME_EQ, EMACS_TIME_NE, EMACS_TIME_GT, EMACS_TIME_GE)
4327 (EMACS_TIME_LT, EMACS_TIME_LE): Rewrite in terms of timespec_cmp.
4328
4329 * term.c: Include <sys/time.h>.
4330 (timeval_to_Time): New function, for proper overflow wraparound.
4331 (term_mouse_position, term_mouse_click): Use it.
4332
4333 * undo.c (record_first_change): Support higher-resolution time stamps
4334 in the undo buffer.
4335 (Fprimitive_undo): Use them when restoring time stamps.
4336
4337 * w32.c (ltime, U64_TO_LISP_TIME, process_times, emacs_gnutls_pull)
4338 (w32_get_internal_run_time):
4339 Port to higher-resolution Emacs time stamps.
4340 (ltime): Now accepts single 64-bit integer, as that's more convenient
4341 for callers.
4342
4343 * xdisp.c (start_hourglass): Port to ns-resolution time stamps.
4344
4345 * xgselect.c, xgselect.h (xg_select): Add sigmask argument,
4346 for compatibility with pselect. Support ns-resolution time stamps.
4347
4348 * xmenu.c (x_menu_wait_for_event): Support ns-resolution time stamps.
4349
4350 * xselect.c (wait_for_property_change, x_get_foreign_selection):
4351 Check for time stamp overflow, and support ns-resolution time stamps.
4352
4353 * xterm.c: Don't include sys/time.h; gnulib does that for us now.
4354 Don't worry about whether HAVE_TIMEVAL and HAVE_SELECT are set.
4355 (timeval_subtract): Remove; no longer needed.
4356 (XTflash, XTring_bell, x_wait_for_event):
4357 Port to ns-resolution time stamps. Don't assume time_t is signed.
4358
b6a92dfe
CY
43592012-06-22 Chong Yidong <cyd@gnu.org>
4360
4361 * xdisp.c (x_consider_frame_title): Revert last change.
4362
d251c37c
EZ
43632012-06-22 Eli Zaretskii <eliz@gnu.org>
4364
4365 * alloc.c (NSTATICS): Enlarge to 0x650. Otherwise, Emacs compiled
4366 with -DENABLE_CHECKING -DXASSERTS -DGLYPH_DEBUG=1 -DBYTE_CODE_METER
4367 aborts in staticpro during startup. (Without -DBYTE_CODE_METER,
4368 staticidx goes up to 1597 out of 1600 = 0x640.)
4369
f10deafb
PE
43702012-06-20 Paul Eggert <eggert@cs.ucla.edu>
4371
4372 * fileio.c (Fdefault_file_modes): Block input while fiddling with umask.
4373 Otherwise, the umask might be mistakenly 0 while handling input signals.
4374
ec6de1e2
SM
43752012-06-19 Stefan Monnier <monnier@iro.umontreal.ca>
4376
4377 * minibuf.c (Fread_string): Bind minibuffer-completion-table.
4378
28be1ada
DA
43792012-06-19 Dmitry Antipov <dmantipov@yandex.ru>
4380
4381 * alloc.c, bytecode.c, ccl.c, coding.c, composite.c, data.c, dosfns.c:
4382 * font.c, image.c, keyboard.c, lread.c, menu.c, minibuf.c, msdos.c:
4383 * print.c, syntax.c, window.c, xmenu.c, xselect.c: Replace direct
4384 access to `contents' member of Lisp_Vector objects with AREF and ASET
4385 where appropriate.
4386
c6bf3022
CY
43872012-06-19 Chong Yidong <cyd@gnu.org>
4388
4389 * frame.c (delete_frame): When selecting a frame on a different
4390 text terminal, do not alter the terminal's top-frame.
4391
4392 * xdisp.c (format_mode_line_unwind_data): Record the target
4393 frame's selected window and its terminal's top-frame.
4394 (unwind_format_mode_line): Restore them.
4395 (x_consider_frame_title, display_mode_line, Fformat_mode_line):
4396 Callers changed.
4397 (x_consider_frame_title): Do not condition on HAVE_WINDOW_SYSTEM,
4398 since tty frames can be explicitly named.
4399 (prepare_menu_bars): Likewise.
4400
4401 * term.c (Ftty_top_frame): New function.
4402
defd4196
PE
44032012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4404
4405 Port byte-code-meter to modern targets.
4406 * bytecode.c (METER_CODE) [BYTE_CODE_METER]: Don't assume
4407 !CHECK_LISP_OBJECT_TYPE && !USE_LSB_TAG. Problem with
8b5257e1 4408 CHECK_LISP_OBJECT_TYPE reported by Dmitry Antipov in
defd4196
PE
4409 <http://lists.gnu.org/archive/html/emacs-devel/2012-06/msg00282.html>.
4410 (METER_1, METER_2): Simplify.
4411
1053a871
SM
44122012-06-18 Stefan Monnier <monnier@iro.umontreal.ca>
4413
4414 * data.c (Fdefalias): Return `symbol' (bug#11686).
4415
b7e8d081
MR
44162012-06-18 Martin Rudalics <rudalics@gmx.at>
4417
4418 * buffer.c (Fkill_buffer): Don't throw an error when the buffer
1053a871
SM
4419 gets killed during executing of this function (Bug#11665).
4420 Try to always return Qt when the buffer has been actually killed.
b7e8d081
MR
4421 (Vkill_buffer_query_functions): In doc-string say that functions
4422 run by this hook should not change the current buffer.
4423
7ea2b339
PE
44242012-06-18 Paul Eggert <eggert@cs.ucla.edu>
4425
4426 Fix recently-introduced process.c problems found by static checking.
4427 * process.c (write_queue_push, write_queue_pop, send_process):
4428 Use ptrdiff_t, not int or EMACS_INT, for buffer lengths and offsets.
4429 (write_queue_pop): Fix pointer signedness problem.
4430 (send_process): Remove unused local.
4431
96a313a1
CY
44322012-06-17 Chong Yidong <cyd@gnu.org>
4433
4434 * xdisp.c (redisplay_internal): No need to redisplay terminal
4435 frames that are not on top.
4436
20ca2e94
TN
44372012-06-17 Troels Nielsen <bn.troels@gmail.com>
4438
4439 * process.c (make_process): Initialize write_queue.
4440 (write_queue_push, write_queue_pop): New functions.
4441 (send_process): Use them to maintain correct ordering of process
4442 writes (Bug#10815).
4443
9a900ca9
PE
44442012-06-17 Paul Eggert <eggert@cs.ucla.edu>
4445
310fbfa8
PE
4446 * lisp.h (eassert): Assume C89 or later.
4447 This removes the need for CHECK.
4448 (CHECK): Remove. Its comments about always evaluating its
4449 argument were confusing, as 'eassert' typically does not evaluate
4450 its argument.
4451
27bb1ca4
PE
4452 * coding.c (produce_chars): Use ptrdiff_t, not int.
4453
9a900ca9
PE
4454 * xterm.c (x_draw_underwave): Check for integer overflow.
4455 This pacifies gcc 4.7.0 -Wunsafe-loop-optimizations on x86-64.
4456
41b7f8bc 44572012-06-17 Jan Djärv <jan.h.d@swipnet.se>
50a93863
JD
4458
4459 * nsterm.m (x_free_frame_resources): Move xfree so freed memory isn't
4460 referenced (Bug#11583).
4461
9b0e3eba
AA
44622012-06-16 Aurelien Aptel <aurelien.aptel@gmail.com>
4463
4464 Implement wave-style variant of underlining.
4465 * dispextern.h (face_underline_type): New enum.
4466 (face): Add field for underline type.
4467 * nsterm.m (ns_draw_underwave): New function.
4468 (ns_draw_text_decoration): Use it.
4469 * w32term.c (w32_restore_glyph_string_clip, w32_draw_underwave):
4470 New functions.
4471 (x_draw_glyph_string): Use them.
4472 * xfaces.c (Qline, Qwave): New Lisp objects.
4473 (check_lface_attrs, merge_face_ref)
1053a871
SM
4474 (Finternal_set_lisp_face_attribute, realize_x_face):
4475 Handle wave-style underline face attributes.
9b0e3eba
AA
4476 * xterm.c (x_draw_underwave): New function.
4477 (x_draw_glyph_string): Use it.
4478
0fb52f11
JB
44792012-06-16 Juanma Barranquero <lekktu@gmail.com>
4480
4481 * makefile.w32-in ($(BLD)/emacs.$(O), $(BLD)/fringe.$(O))
4482 ($(BLD)/xml.$(O), $(BLD)/intervals.$(O), $(BLD)/macros.$(O))
4483 ($(BLD)/minibuf.$(O), $(BLD)/regex.$(O), $(BLD)/region-cache.$(O))
4484 ($(BLD)/textprop.$(O), $(BLD)/undo.$(O), $(BLD)/window.$(O))
4485 ($(BLD)/w32select.$(O)): Update dependencies.
4486
e5560ff7
AS
44872012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4488
4489 * buffer.h (FETCH_MULTIBYTE_CHAR): Define as inline.
4490 (BUF_FETCH_MULTIBYTE_CHAR): Likewise.
4491 * character.c (_fetch_multibyte_char_p): Remove.
4492 * alloc.c: Include "character.h" before "buffer.h".
4493 * bidi.c: Likewise.
4494 * buffer.c: Likewise.
4495 * bytecode.c: Likewise.
4496 * callint.c: Likewise.
4497 * callproc.c: Likewise.
4498 * casefiddle.c: Likewise.
4499 * casetab.c: Likewise.
4500 * category.c: Likewise.
4501 * cmds.c: Likewise.
4502 * coding.c: Likewise.
4503 * composite.c: Likewise.
4504 * dired.c: Likewise.
4505 * dispnew.c: Likewise.
4506 * doc.c: Likewise.
4507 * dosfns.c: Likewise.
4508 * editfns.c: Likewise.
4509 * emacs.c: Likewise.
4510 * fileio.c: Likewise.
4511 * filelock.c: Likewise.
4512 * font.c: Likewise.
4513 * fontset.c: Likewise.
4514 * fringe.c: Likewise.
4515 * indent.c: Likewise.
4516 * insdel.c: Likewise.
4517 * intervals.c: Likewise.
4518 * keyboard.c: Likewise.
4519 * keymap.c: Likewise.
4520 * lread.c: Likewise.
4521 * macros.c: Likewise.
4522 * marker.c: Likewise.
4523 * minibuf.c: Likewise.
4524 * nsfns.m: Likewise.
4525 * nsmenu.m: Likewise.
4526 * print.c: Likewise.
4527 * process.c: Likewise.
4528 * regex.c: Likewise.
4529 * region-cache.c: Likewise.
4530 * search.c: Likewise.
4531 * syntax.c: Likewise.
4532 * term.c: Likewise.
4533 * textprop.c: Likewise.
4534 * undo.c: Likewise.
4535 * unexsol.c: Likewise.
4536 * w16select.c: Likewise.
4537 * w32fns.c: Likewise.
4538 * w32menu.c: Likewise.
4539 * window.c: Likewise.
4540 * xdisp.c: Likewise.
4541 * xfns.c: Likewise.
4542 * xmenu.c: Likewise.
4543 * xml.c: Likewise.
4544 * xselect.c: Likewise.
4545
2f07e6af
EZ
45462012-06-16 Eli Zaretskii <eliz@gnu.org>
4547
1053a871
SM
4548 * xdisp.c (set_cursor_from_row): Don't dereference glyphs_end.
4549 If all the glyphs of the glyph row came from strings, and we have no
2f07e6af 4550 cursor positioning clues, put the cursor on the first glyph of the
1097afe4
EZ
4551 row.
4552 (handle_face_prop): Use chunk-relative overlay string index when
4553 indexing into it->string_overlays array. (Bug#11653)
946fdb73
EZ
4554 (set_cursor_from_row): Use the leftmost glyph as GLYPH_BEFORE, not
4555 the rightmost. (Bug#11720)
2f07e6af 4556
29b83cec
AS
45572012-06-16 Andreas Schwab <schwab@linux-m68k.org>
4558
4559 * category.h (CHAR_HAS_CATEGORY): Define as inline.
4560 (CATEGORY_MEMBER): Enforce 1/0 value.
4561 * category.c (_temp_category_set): Remove.
4562
4c5501e9
EZ
45632012-06-16 Eli Zaretskii <eliz@gnu.org>
4564
4565 * window.c (Fdelete_other_windows_internal)
4566 (Fdelete_window_internal): Don't access frame's mouse highlight
4567 info of the initial frame. (Bug#11677)
4568
2b570124
PE
45692012-06-14 Paul Eggert <eggert@cs.ucla.edu>
4570
e93864f9
PE
4571 * .gdbinit (xgetint): Fix recently-introduced paren typo.
4572 Assume USE_2_TAGS_FOR_INTS.
4573 (xreload): Adjust $tagmask width to match recent lisp.h change.
4574
2b570124
PE
4575 Simplify lisp.h in minor ways that should not affect code.
4576 * lisp.h (USE_2_TAGS_FOR_INTS): Remove, as it was always defined.
4577 (LISP_INT_TAG, case_Lisp_Int, LISP_STRING_TAG, LISP_INT_TAG_P)
4578 (LISP_INT1_TAG, enum Lisp_Type, XINT, XUINT, make_number):
4579 Simplify under the assumption that USE_2_TAGS_FOR_INTS is defined.
4580 (INTTYPEBITS): New macro, for clarity.
4581 (INTMASK, MOST_POSITIVE_FIXNUM): Use it.
1053a871
SM
4582 (LISP_INT1_TAG, LISP_STRING_TAG, LISP_INT_TAG_P):
4583 Simplify now that USE_LSB_TAG is always defined.
2b570124
PE
4584 (TYPEMASK, XINT) [USE_LSB_TAG]: Remove unnecessary cast.
4585 (make_number) [!USE_LSB_TAG]: Use INTMASK; that's simpler.
4586
81755f69
JB
45872012-06-13 Juanma Barranquero <lekktu@gmail.com>
4588
4589 * makefile.w32-in ($(BLD)/data.$(O)): Update dependencies.
4590
16192a57
GM
45912012-06-13 Glenn Morris <rgm@gnu.org>
4592
4593 * s/bsd-common.h (BSD4_3):
4594 * s/usg5-4-common.h (USG5_4): No longer define; unused.
4595
646b5f55
AS
45962012-06-13 Andreas Schwab <schwab@linux-m68k.org>
4597
4598 * lisp.h (Lisp_Object) [CHECK_LISP_OBJECT_TYPE]: Define as struct
4599 instead of union.
4600 (XLI, XIL): Define.
1053a871
SM
4601 (XHASH, XTYPE, XINT, XUINT, make_number, XSET, XPNTR, XUNTAG):
4602 Use them.
4603 * emacs.c (gdb_use_struct): Rename from gdb_use_union.
646b5f55 4604 * .gdbinit: Check gdb_use_struct instead of gdb_use_union.
1053a871 4605 * alloc.c (widen_to_Lisp_Object): Remove.
646b5f55
AS
4606 (mark_memory): Use XIL instead of widen_to_Lisp_Object.
4607 * frame.c (delete_frame): Remove outdated comment.
4608 * w32fns.c (Fw32_register_hot_key): Use XLI instead of checking
4609 USE_LISP_UNION_TYPE.
4610 (Fw32_unregister_hot_key): Likewise.
4611 (Fw32_toggle_lock_key): Likewise.
4612 * w32menu.c (add_menu_item): Likewise.
4613 (w32_menu_display_help): Use XIL instead of checking
4614 USE_LISP_UNION_TYPE.
4615 * w32heap.c (allocate_heap): Don't check USE_LISP_UNION_TYPE.
4616 (init_heap): Likewise.
4617 * w32term.c (w32_read_socket): Update comment.
4618
1d3823c9
GM
46192012-06-13 Glenn Morris <rgm@gnu.org>
4620
c62ff706
GM
4621 * s/usg5-4-common.h, src/s/unixware.h:
4622 Remove define/undef of HAVE_SYSV_SIGPAUSE (not used since 2010-05-04).
4623
1d3823c9
GM
4624 * s/gnu.h (POSIX_SIGNALS): Remove (not used since 2010-05-04).
4625
bfe3e0a2
PE
46262012-06-13 Paul Eggert <eggert@cs.ucla.edu>
4627
4628 USE_LISP_UNION_TYPE + USE_LSB_TAG cleanup (Bug#11604)
4629 * alloc.c (make_number) [!defined make_number]:
4630 Remove, as lisp.h always defines this now.
4631 (mark_maybe_pointer): Simplify since USE_LSB_TAG is always defined now.
4632 (roundup_size): Verify that it is a power of 2.
4633 * data.c (Fmake_variable_buffer_local, Fmake_local_variable):
4634 * ftfont.c (ftfont_driver): Use LISP_INITIALLY_ZERO.
4635 * lisp.h (USE_LSB_TAG): Allow the builder to compile with
4636 -DUSE_LSB_TAG=0, to override the automatically-selected default.
4637 USE_LSB_TAG now is always defined to be either 0 or 1.
4638 All uses changed.
4639 (union Lisp_Object): Don't worry about WORDS_BIGENDIAN; the
4640 code works fine either way, and efficiency is not a concern here,
4641 as the union type is for debugging, not for production.
4642 (LISP_MAKE_RVALUE, make_number) [USE_LISP_UNION_TYPE]:
4643 Use an inline function on all platforms when using the union type,
4644 since this is simpler and 'static inline' can be used portably
4645 within Emacs now.
4646 (LISP_INITIALLY_ZERO): New macro.
4647 (XFASTINT, XSETFASTINT) [USE_LISP_UNION_TYPE]: Remove.
4648 (XSET) [USE_LISP_UNION_TYPE]: Don't overparenthesize.
4649
45fa9c0f
GM
46502012-06-12 Glenn Morris <rgm@gnu.org>
4651
b4492cba
GM
4652 * s/gnu-kfreebsd.h, s/hpux11.h, s/openbsd.h, s/sol2-10.h: Remove files.
4653
4654 * s/gnu-linux.h (HAVE_PROCFS): Move to configure.
0d369729 4655
45fa9c0f
GM
4656 * s/hpux10-20.h, s/openbsd.h, s/usg5-4-common.h:
4657 Move BROKEN_SIGIO to configure.
4658
4659 * s/bsd-common.h, s/darwin.h, s/gnu-kfreebsd.h, s/hpux10-20.h:
4660 Move NO_TERMIO to configure.
4661
0e25d334
CY
46622012-06-12 Chong Yidong <cyd@gnu.org>
4663
4664 * image.c (imagemagick_load_image): Use MagickFlattenImage if
4665 MagickMergeImageLayers is undefined. Use pixel pusher loop if
4666 MagickExportImagePixels is undefined.
4667
43682bb6
PE
46682012-06-12 Paul Eggert <eggert@cs.ucla.edu>
4669
4670 * image.c (imagemagick_load_image): Remove unused label.
4671
a9be7d2b
GM
46722012-06-11 Glenn Morris <rgm@gnu.org>
4673
4674 * s/aix4-2.h, s/bsd-common.h, s/cygwin.h, s/darwin.h:
4675 * s/gnu-kfreebsd.h, s/gnu-linux.h, s/gnu.h, s/hpux10-20.h:
4676 * s/irix6-5.h, s/ms-w32.h, s/msdos.h, s/template.h:
4677 * s/usg5-4-common.h: Move SYSTEM_TYPE to configure.
4678
3017f87f
SM
46792012-06-11 Stefan Monnier <monnier@iro.umontreal.ca>
4680
4681 * alloc.c (make_byte_code): New function.
4682 (Fmake_byte_code): Use it. Don't purify here.
4683 * lread.c (read1): Use it as well to avoid extra allocation.
4684
1b9b4cf4
CY
46852012-06-11 Chong Yidong <cyd@gnu.org>
4686
4687 * image.c (imagemagick_load_image): Implement transparency.
4688
95988fcf
AS
46892012-06-10 Andreas Schwab <schwab@linux-m68k.org>
4690
4691 * regex.c (at_begline_loc_p): Also recognize `(?N:' and correctly
4692 account for preceding backslashes. (Bug#11663)
4693
cd4eb164
CY
46942012-06-09 Chong Yidong <cyd@gnu.org>
4695
4696 * term.c: Support italics in capable terminals (Bug#9652).
4697 (no_color_bit): Replace unused NC_BLINK with NC_ITALIC.
4698 (turn_on_face): Output using TS_enter_italic_mode if available.
4699 Don't handle unused blinking and alt-charset cases.
4700 (turn_off_face): Handle italic case; discard unused tty_blinking_p
4701 and tty_alt_charset_p cases.
4702 (tty_capable_p, init_tty): Support italics.
4703
4704 * termchar.h (struct tty_display_info): Add field for italics.
4705 Remove unused blink field.
4706
4707 * xfaces.c (tty_supports_face_attributes_p, realize_tty_face):
4708 Handle slant.
4709
4710 * dispextern.h: Replace unused TTY_CAP_BLINK with TTY_CAP_ITALIC.
4711 (struct face): Remove unused fields tty_dim_p, tty_blinking_p, and
4712 tty_alt_charset_p. Add tty_italic_p.
4713
ff88beb8
MA
47142012-06-09 Michael Albinus <michael.albinus@gmx.de>
4715
4716 * dbusbind.c (XD_BASIC_DBUS_TYPE): Use dbus_type_is_valid and
4717 dbus_type_is_basic if available.
4718 (xd_extract_signed, xd_extract_unsigned): Rename from
4719 extract_signed and extract_unsigned, respectively. Adapt callers.
4720
44286096
CY
47212012-06-09 Chong Yidong <cyd@gnu.org>
4722
1682701f
CY
4723 * xfaces.c (face_for_overlay_string): Handle face remapping (Bug#2066).
4724
44286096
CY
4725 * fringe.c (Fset_fringe_bitmap_face): Handle the noninteractive
4726 case (Bug#9752).
4727
d86feb17
PE
47282012-06-08 Paul Eggert <eggert@cs.ucla.edu>
4729
4730 * xdisp.c (vmessage): Treat frame message as multibyte.
4731 Without this change, (let ((§ 1)) (make-variable-buffer-local '§))
4732 would generate the diagnostic "Making \302\247 buffer-local while
4733 let-bound!".
4734
d5c20fe8
EZ
47352012-06-08 Eli Zaretskii <eliz@gnu.org>
4736
4737 * dispnew.c (showing_window_margins_p): Undo last change, which
4738 was done due to an inadvertent commit.
4739 (adjust_frame_glyphs_for_frame_redisplay): Do call
4740 showing_window_margins_p.
4741
513749ee
SM
47422012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4743
4744 * eval.c (Fmake_var_non_special): New primitive.
4745 (syms_of_eval): Defsubr it.
4746 * lread.c (syms_of_lread): Mark `values' as lexically scoped.
4747
d4a8f5c1
JB
47482012-06-08 Juanma Barranquero <lekktu@gmail.com>
4749
4750 * dispnew.c (showing_window_margins_p): Wrap in #if 0 to prevent unused
4751 function warning (the only call is inside #if 0 since 2012-06-08T08:44:45Z!eliz@gnu.org).
4752
8bbbc977
EZ
47532012-06-08 Eli Zaretskii <eliz@gnu.org>
4754
4755 * alloc.c (allocate_vectorlike): Fix last change.
4756
f3372c87
DA
47572012-06-08 Dmitry Antipov <dmantipov@yandex.ru>
4758
4759 Block-based vector allocation of small vectors.
4760 * lisp.h (struct vectorlike_header): New field `nbytes',
4761 adjust comment accordingly.
4762 * alloc.c (enum mem_type): New type `MEM_TYPE_VECTOR_BLOCK'
4763 to denote vector blocks. Adjust users (live_vector_p,
4764 mark_maybe_pointer, valid_lisp_object_p) accordingly.
4765 (COMMON_MULTIPLE): Move outside #if USE_LSB_TAG.
4766 (VECTOR_BLOCK_SIZE, vroundup, VECTOR_BLOCK_BYTES),
4767 (VBLOCK_BYTES_MIN, VBLOCK_BYTES_MAX, VECTOR_MAX_FREE_LIST_INDEX),
4768 (VECTOR_FREE_LIST_FLAG, ADVANCE, VINDEX, SETUP_ON_FREE_LIST),
4769 (VECTOR_SIZE, VECTOR_IN_BLOCK): New macros.
4770 (roundup_size): New constant.
4771 (struct vector_block): New data type.
4772 (vector_blocks, vector_free_lists, zero_vector): New variables.
513749ee 4773 (all_vectors): Rename to `large_vectors'.
f3372c87
DA
4774 (allocate_vector_from_block, init_vectors, allocate_vector_from_block)
4775 (sweep_vectors): New functions.
4776 (allocate_vectorlike): Return `zero_vector' as the only vector of
4777 0 items. Allocate new vector from block if vector size is less than
4778 or equal to VBLOCK_BYTES_MAX.
4779 (Fgarbage_collect): Move all vector sweeping code to sweep_vectors.
4780 (init_alloc_once): Add call to init_vectors.
4781
4f18a4ed
SM
47822012-06-08 Stefan Monnier <monnier@iro.umontreal.ca>
4783
4784 * eval.c (Fmacroexpand): Stop if the macro returns the same form.
4785
86f158bc
PE
47862012-06-07 Paul Eggert <eggert@cs.ucla.edu>
4787
4788 * doprnt.c (doprnt): Truncate multibyte char correctly.
4789 Without this change, doprnt (buf, 2, "%s", FORMAT_END, AP)
4790 would mishandle a string argument "Xc" if X was a multibyte
4791 character of length 2: it would truncate after X's first byte
4792 rather than including all of X.
4793
c5cfcbe0
CY
47942012-06-06 Chong Yidong <cyd@gnu.org>
4795
4796 * buffer.c (word_wrap): Doc fix.
4797
c05cf390
PE
47982012-06-04 Paul Eggert <eggert@cs.ucla.edu>
4799
4800 * xdisp.c (note_mode_line_or_margin_highlight): Pacify gcc -Wall.
4801
0c3461de
GM
48022012-06-03 Glenn Morris <rgm@gnu.org>
4803
4804 * xdisp.c (tool-bar-style): Doc fix.
4805
c71232db
UM
48062012-06-03 Ulrich Müller <ulm@gentoo.org>
4807
4808 * Makefile.in (PAXCTL): Define.
4809 (temacs$(EXEEXT)): Disable memory randomization for the temacs
4810 binary via PaX flags if the paxctl utility is available.
4811 (emacs$(EXEEXT), bootstrap-emacs$(EXEEXT)):
4812 Restore PaX flags to their default. (Bug#11398)
4813
383f7350
CY
48142012-06-03 Chong Yidong <cyd@gnu.org>
4815
4816 * xdisp.c (decode_mode_spec_coding): Display a space for a unibyte
4817 buffer (Bug#11226).
4818
5f2c76c6
CY
48192012-06-03 Chong Yidong <cyd@gnu.org>
4820
4821 * xdisp.c (calc_pixel_width_or_height): Use Fbuffer_local_value.
4822 (note_mode_line_or_margin_highlight): If there is no help echo,
4823 use mode-line-default-help-echo. Handle the case where the mouse
4824 position is past the end of the mode line string.
4825
4826 * buffer.c (buffer_local_value_1): New function, split from
4827 Fbuffer_local_value; can return Qunbound.
4828 (Fbuffer_local_value): Use it.
4829 (Vmode_line_format): Docstring tweaks.
4830
773d47f6
PE
48312012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4832
4833 * sysdep.c (system_process_attributes): Improve comment.
4834
f2d6a3df
SM
48352012-06-02 Stefan Monnier <monnier@iro.umontreal.ca>
4836
4837 * keyboard.c: Export real-this-command to Elisp.
4838 (syms_of_keyboard): Rename real_this_command to Vreal_this_command
4839 and DEFVAR it. Update all users.
4840
63810350
PE
48412012-06-02 Paul Eggert <eggert@cs.ucla.edu>
4842
7bd5c1f4
PE
4843 * minibuf.c (Fassoc_string): Remove duplicate declaration.
4844
63810350
PE
4845 * sysdep.c (system_process_attributes) [SOLARIS2 && HAVE_PROCFS]:
4846 Convert pctcpu and pctmem to Lisp float properly.
4847 Let the compiler fold better, as 100.0/0x8000 is exact.
4848
a2821611
AS
48492012-06-02 Andreas Schwab <schwab@linux-m68k.org>
4850
4851 * alloc.c (CONS_BLOCK_SIZE): Account for padding at the end of
4852 cons_block.
4853
5fceba1d
PE
48542012-06-01 Paul Eggert <eggert@cs.ucla.edu>
4855
4856 * xfns.c (x_set_tool_bar_lines) [USE_GTK]: Adjust to bitfield change.
4857
c98ff5dd
DA
48582012-06-01 Dmitry Antipov <dmantipov@yandex.ru>
4859
4860 For a 'struct window', replace some Lisp_Object fields to
4861 bitfields where appropriate, remove unused fields.
4862 * window.h (struct window): Remove unused 'last_mark_x' and
4863 'last_mark_y' fields. Rename 'mini_p' field to 'mini',
4864 change it's type from Lisp_Object to bitfield.
4865 Change type of 'force_start', 'optional_new_start',
4866 'last_had_star', 'update_mode_line' and 'start_at_line_beg'
4867 fields from Lisp_Object to bitfield. Adjust users accordingly.
4868
ca34e0be
PE
48692012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4870
4871 Pacify gcc -Wdouble-precision when using Xaw.
4872 * xterm.c (xaw_jump_callback, x_set_toolkit_scroll_bar_thumb)
4873 [HAVE_X_WINDOWS && USE_TOOLKIT_SCROLL_BARS && !USE_MOTIF && !USE_GTK]:
4874 Use 'float' consistently, rather than 'float' in most places
4875 and 'double' in a couple of places.
4876
efc00ab1 48772012-05-31 Eli Zaretskii <eliz@gnu.org>
d5fd2c54
EZ
4878
4879 * xdisp.c (handle_stop): Detect whether we have overlay strings
4880 loaded by testing it->current.overlay_string_index to be
4881 non-negative, instead of checking whether n_overlay_strings is
4882 positive. (Bug#11587)
4883
efc00ab1 48842012-05-31 Chong Yidong <cyd@gnu.org>
353c87f6
CY
4885
4886 * keymap.c (describe_map_tree): Revert 2011-07-07 change (Bug#1169).
4887
4888 * doc.c (Fsubstitute_command_keys): Doc fix.
4889
efc00ab1 48902012-05-31 Eli Zaretskii <eliz@gnu.org>
a02ae4e5
EZ
4891
4892 * search.c (search_buffer): Remove calls to
4893 r_alloc_inhibit_buffer_relocation, as it is now called by
4894 maybe_unify_char, which was the cause of relocation of buffer text
4895 in bug#11519.
4896
efc00ab1 48972012-05-31 Eli Zaretskii <eliz@gnu.org>
291d430f
EZ
4898
4899 * charset.c (maybe_unify_char): Inhibit relocation of buffer text
4900 for the duration of call to load_charset, to avoid problems with
4901 callers of maybe_unify_char that access buffer text through C
4902 pointers.
4903
4904 * ralloc.c (r_alloc_inhibit_buffer_relocation): Increment and
4905 decrement the inhibition flag, instead of just setting or
4906 resetting it.
4907
ba93a187
PE
49082012-05-31 Paul Eggert <eggert@cs.ucla.edu>
4909
4910 Remove obsolete '#define static' cruft.
4911 * s/hpux10-20.h (_FILE_OFFSET_BITS): Don't #undef.
4912 This #undef was "temporary" in 2000; it is no longer needed
4913 now that '#define static' has gone away.
4914 * xfns.c, xterm.h (gray_bitmap_width, gray_bitmap_height)
4915 (gray_bitmap_bits): Remove; no longer needed.
4916 All uses replaced with definiens.
4917 * xterm.c: Include "bitmaps/gray.xbm".
4918
9e4bf381
PE
49192012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4920
4921 Clean up __executable_start, monstartup when --enable-profiling.
4922 The following changes affect the code only when profiling.
4923 * dispnew.c (__executable_start): Rename from safe_bcopy.
4924 Define only on platforms that need it.
4925 * emacs.c: Include <sys/gmon.h> when profiling.
4926 (_mcleanup): Remove decl, since <sys/gmon.h> does it now.
4927 (__executable_start): Remove decl, since lisp.h does it now.
4928 (safe_bcopy): Remove decl; no longer has that name.
4929 (main): Coalesce #if into single bit of code, for simplicity.
4930 Cast pointers to uintptr_t, since standard libraries want integers
4931 and not pointers.
4932 * lisp.h (__executable_start): New decl.
4933
32d72c2f
GM
49342012-05-31 Glenn Morris <rgm@gnu.org>
4935
4936 * image.c (Fimagemagick_types): Doc fix.
4937
baac5bc7
JM
49382012-05-30 Jim Meyering <meyering@redhat.com>
4939
4940 * callproc.c (Fcall_process_region): Include directory component
4941 in mkstemp error message (Bug#11586).
4942
72cb32cf
PE
49432012-05-30 Paul Eggert <eggert@cs.ucla.edu>
4944
4945 * alloc.c, lisp.h (make_pure_vector): Now static.
4946
61b108cc
SM
49472012-05-30 Stefan Monnier <monnier@iro.umontreal.ca>
4948
4949 * eval.c (Fdefun, Fdefmacro, Vmacro_declaration_function):
4950 Move to byte-run.el.
4951 (Fautoload): Do the hash-doc more carefully.
4952 * data.c (Fdefalias): Purify definition, except for keymaps.
4953 (Qdefun): Move from eval.c.
4954 * lisp.h (Qdefun): Remove.
4955 * lread.c (read1): Tiny simplification.
4956
471fe23d
TN
49572012-05-29 Troels Nielsen <bn.troels@gmail.com>
4958
934f3f58 4959 Do not create empty overlays with the evaporate property (Bug#9642).
471fe23d
TN
4960 * buffer.c (Fmove_overlay): Reinstate the earlier fix for
4961 Bug#9642, but explicitly check that the buffer the overlay would
4962 be moved to is live and rearrange lines to make sure that errors
4963 will not put the overlay in an inconsistent state.
4964 (Fdelete_overlay): Cosmetics.
4965
85d0efd1
EZ
49662012-05-28 Eli Zaretskii <eliz@gnu.org>
4967
4968 * w32term.c (my_bring_window_to_top): New function.
4969 (x_raise_frame): Use handle returned by DeferWindowPos, which
61b108cc
SM
4970 could be different from the original one.
4971 Call my_bring_window_to_top instead of my_set_foreground_window.
85d0efd1
EZ
4972 (Bug#11513)
4973
4974 * w32fns.c (w32_wnd_proc): Accept and process WM_EMACS_BRINGTOTOP
4975 by calling BringWindowToTop.
4976
4977 * w32term.h (WM_EMACS_BRINGTOTOP): New message.
4978 (WM_EMACS_END): Increase by one.
4979
da92a98c
PE
49802012-05-28 Paul Eggert <eggert@cs.ucla.edu>
4981
4982 * bidi.c (bidi_mirror_char): Put eassert before conversion to int.
4983 This avoids undefined behavior that might cause the eassert
4984 to not catch an out-of-range value.
4985
74d1f848
JB
49862012-05-28 Juanma Barranquero <lekktu@gmail.com>
4987
4988 * makefile.w32-in ($(BLD)/w32inevt.$(O), $(BLD)/w32console.$(O)):
4989 Update dependencies.
4990
9e1a06fc
EZ
49912012-05-27 Eli Zaretskii <eliz@gnu.org>
4992
4993 * bidi.c (bidi_mirror_char): Fix last change.
4994
f3dd7312
AS
49952012-05-27 Andreas Schwab <schwab@linux-m68k.org>
4996
4997 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
4998 when referring to sectname field in printf format.
4999
81899c91
PE
50002012-05-27 Paul Eggert <eggert@cs.ucla.edu>
5001
57b81a9f
PE
5002 * lisp.h [REL_ALLOC]: Omit duplicate prototypes.
5003 Only r_alloc_inhibit_buffer_relocation needed to be added;
5004 the others were already declared.
5005
81899c91
PE
5006 * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
5007 before checking whether it's out of range. Put the check inside
5008 eassert. See
5009 <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
5010
33017faf 50112012-05-27 Ken Brown <kbrown@cornell.edu>
2f9b9adb
KB
5012
5013 * callproc.c (Fcall_process): Restore a line that was accidentally
5014 commented out in the 2011-02-13 change (bug#11547).
5015
33017faf 50162012-05-27 Eli Zaretskii <eliz@gnu.org>
52c55cc7
EZ
5017
5018 * lisp.h [REL_ALLOC]: Add prototypes for external functions
5019 defined on ralloc.c.
5020
5021 * buffer.c [REL_ALLOC]: Remove prototypes of
5022 r_alloc_reset_variable, r_alloc, r_re_alloc, and r_alloc_free,
5023 they are now on lisp.h.
5024
5025 * ralloc.c (r_alloc_inhibit_buffer_relocation): New function.
5026
5027 * search.c (search_buffer): Use it to inhibit relocation of buffer
5028 text while re_search_2 is doing its job, because re_search_2 is
5029 passed C pointers to buffer text. (Bug#11519)
5030
23415acf
EZ
5031 * msdos.c (internal_terminal_init) <Vwindow_system_version>:
5032 Update value to 24.
5033
44e27368
EZ
5034 * xdisp.c (move_it_to): Under MOVE_TO_Y, when restoring iterator
5035 state after an additional call to move_it_in_display_line_to, keep
5036 the values of it->max_ascent and it->max_descent found for the
5037 entire line.
5038 (pos_visible_p): Revert the comparison against bottom_y to what it
5039 was in revid eliz@gnu.org-20120513182235-4p6386j761ld0nwb.
5040 (Bug#11464)
5041
c1892f11
PE
50422012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5043
5044 Fix coding-related core dumps with gcc -ftrapv.
5045 The code was computing A - B, where A and B are pointers, and B is
5046 random garbage. This can lead to core dumps on platforms that
5047 have special pointer registers, and it also leads to core dumps on
5048 x86-64 when compiled with gcc -ftrapv. The fix is to compute
5049 A - B only when B is initialized properly.
5050 * coding.c (coding_set_source, coding_set_destination): Return void.
5051 (coding_change_source, coding_change_destinations): New functions,
5052 with the old behaviors of coding_set_source and coding_set_destination.
5053 All callers that need an offset changed to use these new functions.
5054
eb7afdad
GM
50552012-05-26 Glenn Morris <rgm@gnu.org>
5056
5057 * nsterm.m (ns_init_paths): Don't mess with INFOPATH. (Bug#2791)
5058
f12fdf02
EZ
50592012-05-26 Eli Zaretskii <eliz@gnu.org>
5060
53a63be6 5061 Extend mouse support on W32 text-mode console.
61b108cc
SM
5062 * xdisp.c (draw_row_with_mouse_face):
5063 Call tty_draw_row_with_mouse_face for WINDOWSNT as well.
eb3f6f01 5064
eb3f6f01 5065 * w32console.c: Include window.h.
61b108cc
SM
5066 (w32con_write_glyphs_with_face, tty_draw_row_with_mouse_face):
5067 New functions.
eb3f6f01
EZ
5068 (initialize_w32_display): Initialize mouse-highlight data.
5069
53a63be6
EZ
5070 * w32inevt.c: Include termchar.h and window.h.
5071 (do_mouse_event): Support mouse-autoselect-window. When the mouse
5072 moves, call note_mouse_highlight. If help_echo changed, call
5073 gen_help_event to produce help-echo message in the echo area.
5074 Call clear_mouse_face if mouse_face_hidden is set in the mouse
5075 highlight info.
5076
4cfd81f6
PE
50772012-05-26 Paul Eggert <eggert@cs.ucla.edu>
5078
5079 * lread.c (read1): Simplify slightly to avoid an overflow warning
5080 with GCC 4.7.0 on x86-64.
5081
4446092a
EZ
50822012-05-26 Eli Zaretskii <eliz@gnu.org>
5083
5084 * bidi.c (bidi_mirror_char): Revert last change: an int is
5085 definitely wide enough here.
5086
42b2a986 50872012-05-25 Paul Eggert <eggert@cs.ucla.edu>
3164aeac 5088
42b2a986 5089 Fix integer width and related bugs (Bug#9874).
eb106a49 5090 * alloc.c (pure_bytes_used_lisp, pure_bytes_used_non_lisp):
d311d28c
PE
5091 (allocate_vectorlike, buffer_memory_full, struct sdata, SDATA_SIZE)
5092 (string_bytes, check_sblock, allocate_string_data):
5093 (compact_small_strings, Fmake_bool_vector, make_string)
5094 (make_unibyte_string, make_multibyte_string)
5095 (make_string_from_bytes, make_specified_string)
5096 (allocate_vectorlike, Fmake_vector, find_string_data_in_pure)
5097 (make_pure_string, make_pure_c_string, make_pure_vector, Fpurecopy)
5098 (mark_vectorlike):
5099 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5100 (allocate_pseudovector):
5101 Use int, not EMACS_INT, where int is wide enough.
5102 (inhibit_garbage_collection, Fgarbage_collect):
5103 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5104 * bidi.c (bidi_mirror_char): Use EMACS_INT, not int, where
5105 int might not be wide enough.
5106 (bidi_cache_search, bidi_cache_find, bidi_init_it)
5107 (bidi_count_bytes, bidi_char_at_pos, bidi_fetch_char)
5108 (bidi_at_paragraph_end, bidi_find_paragraph_start)
5109 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
5110 (bidi_level_of_next_char, bidi_move_to_visually_next):
5111 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5112 * buffer.c (copy_overlays, Fgenerate_new_buffer_name)
5113 (Fkill_buffer, Fset_buffer_major_mode)
5114 (advance_to_char_boundary, Fbuffer_swap_text)
5115 (Fset_buffer_multibyte, overlays_at, overlays_in)
5116 (overlay_touches_p, struct sortvec, record_overlay_string)
5117 (overlay_strings, recenter_overlay_lists)
5118 (adjust_overlays_for_insert, adjust_overlays_for_delete)
5119 (fix_start_end_in_overlays, fix_overlays_before, modify_overlay)
5120 (Fmove_overlay, Fnext_overlay_change, Fprevious_overlay_change)
5121 (Foverlay_recenter, last_overlay_modification_hooks_used)
5122 (report_overlay_modification, evaporate_overlays, enlarge_buffer_text):
5123 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
977b0e45
PE
5124 (validate_region): Omit unnecessary test for b <= e,
5125 since that's guaranteed by the previous test.
d311d28c
PE
5126 (adjust_overlays_for_delete): Avoid pos + length overflow.
5127 (Fmove_overlay, Fdelete_overlay, add_overlay_mod_hooklist)
5128 (report_overlay_modification):
5129 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5130 (Foverlays_at, Fnext_overlay_change, Fprevious_overlay_change):
5131 Omit pointer cast, which isn't needed anyway, and doesn't work
5132 after the EMACS_INT -> ptrdiff_t change.
02481186 5133 (Fmove_overlay): Clip BEG and END to ptrdiff_t to avoid overflow.
d311d28c
PE
5134 * buffer.h: Adjust decls to match defn changes elsewhere.
5135 (struct buffer_text, struct buffer):
5136 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5137 Use EMACS_INT, not int, where int might not be wide enough.
39b5db3b
PE
5138 * bytecode.c (unmark_byte_stack, exec_byte_code): Use ptrdiff_t,
5139 not int, to avoid needless 32-bit limit on 64-bit hosts.
5140 (exec_byte_code): Use tighter memory-full test, one that checks
5141 for alloca overflow. Don't compute the address of the object just
5142 before an array, as that's not portable. Use EMACS_INT, not
5143 ptrdiff_t or int, where ptrdiff_t or int might not be wide enough.
d311d28c
PE
5144 * callint.c (Fcall_interactively):
5145 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5146 * callproc.c (call_process_kill, Fcall_process):
5147 Don't assume pid_t fits into an Emacs fixnum.
5148 (call_process_cleanup, Fcall_process, child_setup):
5149 Don't assume pid_t fits into int.
5150 (call_process_cleanup, Fcall_process, delete_temp_file)
5151 (Fcall_process_region):
5152 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5153 (Fcall_process): Simplify handling of volatile integers.
5154 Use int, not EMACS_INT, where int will do.
5155 * casefiddle.c (casify_object, casify_region, operate_on_word)
5156 (Fupcase_word, Fdowncase_word, Fcapitalize_word):
5157 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5158 (casify_object): Avoid integer overflow when overallocating buffer.
5159 * casetab.c (set_identity, shuffle): Prefer int to unsigned when
45c2afd6 5160 either works. Use lint_assume to convince GCC 4.6.1 that it's OK.
d311d28c
PE
5161 * category.c (Fchar_category_set): Don't assume fixnum fits in int.
5162 * category.h (CATEGORYP): Don't assume arg is nonnegative.
5163 * ccl.c (GET_CCL_INT): Remove; no longer needed, since the
5164 integers are now checked earlier. All uses replaced with XINT.
5165 (ccl_driver):
5166 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5167 For CCL_MapSingle, check that content and value are in int range.
c801946a
PE
5168 (ccl_driver, Fregister_code_conversion_map):
5169 Check that Vcode_version_map_vector is a vector.
d311d28c
PE
5170 (resolve_symbol_ccl_program): Check that vector header is in range.
5171 Always copy the vector, so that we can check its contents reliably
5172 now rather than having to recheck each instruction as it's being
5173 executed. Check that vector words fit in 'int'.
5174 (ccl_get_compiled_code, Fregister_ccl_program)
5175 (Fregister_code_conversion_map): Use ptrdiff_t, not int, for
5176 program indexes, to avoid needless 32-bit limit on 64-bit hosts.
5177 (Fccl_execute, Fccl_execute_on_string): Check that initial reg
5178 contents are in range.
5179 (Fccl_execute_on_string): Check that status is in range.
5180 * ccl.h (struct ccl_program.idx): Now ptrdiff_t, not int.
5181 * character.c (char_resolve_modifier_mask, Fchar_resolve_modifiers):
5182 Accept and return EMACS_INT, not int, because callers can pass values
5183 out of 'int' range.
5184 (c_string_width, strwidth, lisp_string_width, chars_in_text)
5185 (multibyte_chars_in_text, parse_str_as_multibyte)
5186 (str_as_multibyte, count_size_as_multibyte, str_to_multibyte)
5187 (str_as_unibyte, str_to_unibyte, string_count_byte8)
5188 (string_escape_byte8, Fget_byte):
5189 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
a14e1568 5190 (Funibyte_string): Use CHECK_RANGED_INTEGER, not CHECK_NATNUM, to
d311d28c
PE
5191 avoid mishandling large integers.
5192 * character.h: Adjust decls to match defn changes elsewhere.
5193 * charset.c (load_charset_map_from_file, find_charsets_in_text)
5194 (Ffind_charset_region):
5195 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5196 (load_charset_map_from_file): Redo idx calculation to avoid overflow.
5197 (load_charset_map_from_vector, Fdefine_charset_internal):
3c7649c1 5198 Don't assume fixnum fits in int.
d311d28c
PE
5199 (load_charset_map_from_vector, Fmap_charset_chars):
5200 Remove now-unnecessary CHECK_NATNUMs.
5201 (Fdefine_charset_internal): Check ranges here, more carefully.
3c7649c1
PE
5202 Don't rely on undefined behavior with signed left shift overflow.
5203 Don't assume unsigned int fits into fixnum, or that fixnum fits
5204 into unsigned int. Don't require max_code to be a valid fixnum;
5205 that's not true for gb10830 4-byte on a 32-bit host. Allow
5206 invalid_code to be a cons, for the same reason. Require code_offset
5207 to be a character. Avoid int overflow if max_char is close
5208 to INT_MAX.
5209 (CODE_POINT_TO_INDEX): On 32-bit hosts, return int, not unsigned;
5210 this is intended anyway and avoids some undefined behavior.
5211 (load_charset_map): Pass unsigned, not int, as 2nd arg of
5212 INDEX_TO_CODE_POINT, as that's what it expects.
5213 (Funify_charset, encode_char): Don't stuff unsigned vals into int vars.
60ad3eab
PE
5214 * charset.h (DECODE_CHAR): Return int, not unsigned;
5215 this is what was intended anyway, and it avoids undefined behavior.
5216 (CHARSET_OFFSET): Remove unused macro, instead of fixing its
5217 integer-overflow issues.
5218 (ENCODE_CHAR): Return unsigned on all hosts, not just on 32-bit hosts.
5219 Formerly, it returned EMACS_INT on 64-bit hosts in the common case
5220 where the argument is EMACS_INT, and this behavior is not intended.
d311d28c
PE
5221 * chartab.c (Fmake_char_table, Fset_char_table_range)
5222 (uniprop_get_decoder, uniprop_get_encoder):
5223 Don't assume fixnum fits in int.
5224 * cmds.c (move_point): New function, that does the gist of
5225 Fforward_char and Fbackward_char, but does so while checking
5226 for integer overflow more accurately.
c96e5d6a 5227 (Fforward_char, Fbackward_char): Use it.
d311d28c
PE
5228 (Fforward_line, Fend_of_line, internal_self_insert)
5229 (internal_self_insert):
5230 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5231 Fix a FIXME, by checking for integer overflow when calculating
5232 target_clm and actual_clm.
5233 * coding.c (detect_coding_XXX, encode_coding_XXX, CODING_DECODE_CHAR)
8f50130c 5234 (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET, CODING_CHAR_CHARSET_P)
d311d28c
PE
5235 (ASSURE_DESTINATION, coding_alloc_by_realloc)
5236 (coding_alloc_by_making_gap, alloc_destination)
5237 (detect_coding_utf_8, encode_coding_utf_8, decode_coding_utf_16)
5238 (encode_coding_utf_16, detect_coding_emacs_mule)
5239 (decode_coding_emacs_mule, encode_coding_emacs_mule)
5240 (detect_coding_iso_2022, decode_coding_iso_2022)
5241 (encode_invocation_designation, encode_designation_at_bol)
5242 (encode_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
5243 (decode_coding_sjis, decode_coding_big5, encode_coding_sjis)
5244 (encode_coding_big5, detect_coding_ccl, decode_coding_ccl)
5245 (encode_coding_ccl, encode_coding_raw_text)
5246 (detect_coding_charset, decode_coding_charset)
5247 (encode_coding_charset, detect_eol, decode_eol, produce_chars)
5248 (produce_composition, produce_charset, produce_annotation)
5249 (decode_coding, handle_composition_annotation)
5250 (handle_charset_annotation, consume_chars, decode_coding_gap)
5251 (decode_coding_object, encode_coding_object, detect_coding_system)
5252 (Ffind_coding_systems_region_internal, Fcheck_coding_systems_region)
5253 (code_convert_region, code_convert_string)
8f50130c
PE
5254 (Fdefine_coding_system_internal)
5255 (coding_set_source, coding_set_destination):
d311d28c
PE
5256 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5257 (setup_iso_safe_charsets, consume_chars, Funencodable_char_position)
5258 (Fdefine_coding_system_internal):
5259 Don't assume fixnums fit in int.
5260 (decode_coding_gap, decode_coding_object, encode_coding_object)
5895d7b9 5261 (Fread_coding_system, Fdetect_coding_region)
2c6a9faa
PE
5262 (Funencodable_char_position, Fcheck_coding_systems_region)
5263 (get_translation, handle_composition_annotation, consume_chars):
d311d28c 5264 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
977b0e45 5265 (consume_chars): Rewrite to not calculate an address outside buffer.
d311d28c 5266 (Ffind_operation_coding_system): NATNUMP can eval its arg twice.
7b09a37a 5267 Don't access memory outside of the args array.
d311d28c 5268 (Fdefine_coding_system_internal): Check for charset-id overflow.
47664caa
PE
5269 (ENCODE_ISO_CHARACTER): Use unsigned, not int, to store the unsigned
5270 result of ENCODE_CHAR.
d311d28c
PE
5271 * coding.h: Adjust decls to match defn changes elsewhere.
5272 (struct coding_system):
5273 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5274 * composite.c (get_composition_id, find_composition)
5275 (run_composition_function, update_compositions)
5276 (compose_text, composition_gstring_put_cache)
5277 (composition_gstring_p, composition_gstring_width)
5278 (fill_gstring_header, fill_gstring_body, autocmp_chars)
5279 (composition_compute_stop_pos, composition_reseat_it)
5280 (composition_update_it, struct position_record)
5281 (find_automatic_composition, composition_adjust_point)
5282 (Fcomposition_get_gstring, Ffind_composition_internal):
5283 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5284 (update_compositions):
5285 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5286 * composite.h: Adjust decls to match defn changes elsewhere.
5287 (struct composition):
5288 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5289 * data.c (let_shadows_buffer_binding_p, let_shadows_global_binding_p):
5290 Do not attempt to compute the address of the object just before a
5291 buffer; this is not portable.
5292 (Faref, Faset):
5293 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5294 (Faset): Use int, not EMACS_INT, where int is wide enough.
5295 (Fstring_to_number): Don't assume fixnums fit in int.
5296 (Frem): Don't assume arg is nonnegative.
5297 * dbusbind.c (xd_append_arg): Check for integers out of range.
5298 (Fdbus_call_method): Don't overflow the timeout int.
42b2a986 5299 (extract_signed, extract_unsigned): New functions.
243e0530
PE
5300 (XD_CHECK_DBUS_SERIAL): Remove; superseded by extract_unsigned.
5301 (xd_get_connection_references): Return ptrdiff_t, not int.
5302 All uses changed.
5303 (xd_signature, xd_append_arg, xd_retrieve_arg, Fdbus_message_internal)
5304 (xd_read_message_1):
5305 Use int, not unsigned, where the dbus API uses int.
5306 (Fdbus_message_internal): Don't overflow mtype.
5307 (syms_of_dbusbind): Allocate right-sized buffer for integers.
d311d28c
PE
5308 * dired.c (directory_files_internal, file_name_completion, scmp)
5309 (file_name_completion_stat):
5310 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5311 (file_name_completion): Don't overflow matchcount.
5312 (file_name_completion_stat): Use SAFE_ALLOCA, not alloca.
5313 * dispextern.h: Adjust decls to match defn changes elsewhere.
5314 (struct text_pos, struct glyph, struct bidi_saved_info)
5315 (struct bidi_string_data, struct bidi_it, struct composition_it)
5316 (struct it):
5317 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5318 (struct display_pos, struct composition_it, struct it):
5319 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5320 * dispnew.c (increment_matrix_positions)
5321 (increment_row_positions, mode_line_string)
5322 (marginal_area_string):
5323 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
54e1617f 5324 (change_frame_size_1, Fredisplay, Fframe_or_buffer_changed_p):
d311d28c
PE
5325 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5326 (duration_to_sec_usec): New function, to check for overflow better.
5327 (Fsleep_for, sit_for): Use it.
5328 * doc.c (get_doc_string, store_function_docstring):
5329 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5330 (get_doc_string, Fsnarf_documentation):
5331 Use int, not EMACS_INT, where int is wide enough.
5332 (get_doc_string):
5333 Use SAFE_ALLOCA, not alloca.
5334 Check for overflow when converting EMACS_INT to off_t.
5335 * doprnt.c (doprnt):
5336 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5337 * editfns.c (init_editfns, Fuser_uid, Fuser_real_uid):
5338 Don't assume uid_t fits into fixnum.
5339 (buildmark, Fgoto_char, overlays_around, find_field, Fdelete_field)
5340 (Ffield_string, Ffield_string_no_properties, Ffield_beginning)
5341 (Ffield_end, Fconstrain_to_field, Fline_beginning_position)
5342 (Fline_end_position, Fprevious_char, Fchar_after, Fchar_before)
5343 (general_insert_function)
5344 (Finsert_char, make_buffer_string, make_buffer_string_both)
5345 (update_buffer_properties, Fbuffer_substring)
5346 (Fbuffer_substring_no_properties, Fcompare_buffer_substrings)
5347 (Fsubst_char_in_region, check_translation)
5348 (Ftranslate_region_internal, save_restriction_restore, Fformat)
5349 (transpose_markers, Ftranspose_regions):
5350 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5351 (clip_to_bounds): Move to lisp.h as an inline function).
5352 (Fconstrain_to_field): Don't assume integers are nonnegative.
5353 (Fline_beginning_position, Fsave_excursion, Fsave_current_buffer):
5354 (Fsubst_char_in_region, Fsave_restriction):
5355 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5356 (Femacs_pid): Don't assume pid_t fits into fixnum.
5357 (lo_time): Use int, not EMACS_INT, when int suffices.
5358 (lisp_time_argument): Check for usec out of range.
5359 (Fencode_time): Don't assume fixnum fits in int.
3f4eabd1
PE
5360 (Fuser_login_name, Fuser_full_name): Signal an error
5361 if a uid argument is out of range, rather than relying on
5362 undefined behavior.
c8d5c857
PE
5363 (Fformat_time_string): Remove now-unnecessary check.
5364 lisp_time_argument checks for out-of-range usec now.
243e0530 5365 Use ptrdiff_t, not size_t, where ptrdiff_t will do.
d311d28c
PE
5366 * emacs.c (gdb_valbits, gdb_gctypebits): Now int, not EMACS_INT.
5367 (gdb_data_seg_bits): Now uintptr_t, not EMACS_INT.
5368 (PVEC_FLAG, gdb_array_mark_flag): Now ptrdiff_t, not EMACS_INT.
5369 (init_cmdargs, Fdump_emacs):
5370 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5371 (Fkill_emacs): Don't assume fixnum fits in int; instead, take just
5372 the bottom (typically) 32 bits of the fixnum.
5373 * eval.c (specpdl_size, call_debugger):
5374 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5375 (when_entered_debugger, Fbacktrace_debug):
5376 Don't assume fixnum can fit in int.
5377 (Fdefvaralias, Fdefvar): Do not attempt to compute the address of
5378 the object just before a buffer; this is not portable.
5379 (FletX, Flet, Funwind_protect, do_autoload, Feval, funcall_lambda)
5380 (grow_specpdl, unbind_to):
5381 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5382 (Fapply, apply_lambda): Don't assume ptrdiff_t can hold fixnum.
5383 (grow_specpdl): Simplify allocation by using xpalloc.
856bbc81 5384 (Fprog1, Fprog2): Don't assume list length fits in int. Simplify.
d311d28c
PE
5385 * fileio.c (Ffind_file_name_handler, Fcopy_file, Frename_file)
5386 (Finsert_file_contents, Fwrite_region, Fdo_auto_save):
5387 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5388 (Ffind_file_name_handler, non_regular_inserted, Finsert_file_contents)
5389 (a_write, e_write):
5390 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5391 (Fcopy_file, non_regular_nbytes, read_non_regular)
5392 (Finsert_file_contents):
5393 Use int, not EMACS_INT, where int is wide enough.
5394 (READ_BUF_SIZE): Verify that it fits in int.
5395 (Finsert_file_contents): Check that counts are in proper range,
5396 rather than assuming fixnums fit into ptrdiff_t etc.
5397 Don't assume fixnums fit into int.
125b3835 5398 * floatfns.c (Fexpt): Avoid undefined signed * signed overflow.
5895d7b9
PE
5399 * fns.c (Fcompare_strings, Fstring_lessp, struct textprop_rec, concat)
5400 (string_char_byte_cache_charpos, string_char_byte_cache_bytepos)
d311d28c
PE
5401 (string_char_to_byte, string_byte_to_char)
5402 (string_make_multibyte, string_to_multibyte)
5403 (string_make_unibyte, Fstring_as_unibyte, Fstring_as_multibyte)
5404 (Fstring_to_unibyte, Fsubstring, Fsubstring_no_properties)
5405 (substring_both, Fdelete, internal_equal, Ffillarray)
5406 (Fclear_string, mapcar1)
5407 (Fbase64_encode_region, Fbase64_encode_string, base64_encode_1)
5408 (Fbase64_decode_region, Fbase64_decode_string, base64_decode_1)
5409 (larger_vector, make_hash_table, maybe_resize_hash_table)
5410 (hash_lookup, hash_remove_from_table, hash_clear, sweep_weak_table)
5411 (Fmaphash, secure_hash):
5412 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5413 (concat): Check for string index and length overflow.
5414 (Fmapconcat): Don't assume fixnums fit into ptrdiff_t.
5415 (Frequire):
5416 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5417 (larger_vector): New API (vec, incr_min, size_max) replaces old
5418 one (vec, new_size, init). This catches size overflow.
5419 INIT was removed because it was always Qnil.
5420 All callers changed.
5421 (INDEX_SIZE_BOUND): New macro, which calculates more precisely
5422 the upper bound on a hash table index size.
5423 (make_hash_table, maybe_resize_hash_table): Use it.
5424 (secure_hash): Computer start_byte and end_byte only after
5425 they're known to be in ptrdiff_t range.
5426 * font.c (font_intern_prop, font_at, font_range, Ffont_shape_gstring)
5427 (Ffont_get_glyphs, Ffont_at):
5428 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5429 (font_style_to_value, font_prop_validate_style, font_expand_wildcards)
5430 (Flist_fonts, Fopen_font):
5431 Don't assume fixnum can fit in int.
5432 (check_gstring): Don't assume index can fit in int.
5433 (font_match_p): Check that fixnum is a character, not a nonnegative
5434 fixnum, since the later code needs to stuff it into an int.
5435 (font_find_for_lface): Use SAFE_ALLOCA_LISP, not alloca.
5436 (font_fill_lglyph_metrics): Use unsigned, not EMACS_INT, to avoid
5437 conversion overflow issues.
5438 (Fopen_font): Check for integer out of range.
5439 (Ffont_get_glyphs): Don't assume index can fit in int.
5440 * font.h: Adjust decls to match defn changes elsewhere.
5441 * fontset.c (reorder_font_vector): Redo score calculation to avoid
5442 integer overflow.
5443 (num_auto_fontsets, fontset_from_font): Use ptrdiff_t, not
5444 printmax_t, where ptrdiff_t is wide enough.
5445 (Finternal_char_font):
5446 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5447 * frame.c (Fset_mouse_position, Fset_mouse_pixel_position)
5448 (Fset_frame_height, Fset_frame_width, Fset_frame_size)
5449 (Fset_frame_position, x_set_frame_parameters)
5450 (x_set_line_spacing, x_set_border_width)
5451 (x_set_internal_border_width, x_set_alpha, x_figure_window_size):
5452 Check that fixnums are in proper range for system types.
5453 (frame_name_fnn_p, Fframe_parameter, Fmodify_frame_parameters):
5454 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5455 (Fmodify_frame_parameters): Don't assume fixnum fits in int.
5456 Use SAFE_ALLOCA_LISP, not alloca.
5457 * frame.h (struct frame): Use intptr_t, not EMACS_INT, where
5458 intptr_t is wide enough.
5459 * fringe.c (lookup_fringe_bitmap, get_logical_fringe_bitmap)
5460 (Fdefine_fringe_bitmap): Don't assume fixnum fits in int.
5461 (Ffringe_bitmaps_at_pos): Don't assume index fits in int.
5462 Check for fixnum out of range.
5463 * ftfont.c (ftfont_list): Don't assume index fits in int.
5464 Check that fixnums are in proper range for system types.
5465 (ftfont_shape_by_flt):
5466 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
d311d28c
PE
5467 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
5468 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5469 (Fgnutls_error_fatalp, Fgnutls_error_string, Fgnutls_boot):
5470 Check that fixnums are in proper range for system types.
5471 * gnutls.h: Adjust decls to match defn changes elsewhere.
5472 * gtkutil.c (xg_dialog_run):
5473 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5474 (update_frame_tool_bar):
5475 Check that fixnums are in proper range for system types.
5476 * image.c (parse_image_spec): Redo count calculation to avoid overflow.
5895d7b9 5477 (lookup_image): Check that fixnums are in range for system types.
d311d28c
PE
5478 * indent.c (last_known_column, last_known_column_point):
5479 (current_column_bol_cache):
5480 (skip_invisible, current_column, check_display_width):
5481 (check_display_width, scan_for_column, current_column_1)
5482 (Findent_to, Fcurrent_indentation, position_indentation)
5483 (indented_beyond_p, Fmove_to_column, compute_motion):
5484 (Fcompute_motion, Fvertical_motion):
5485 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5486 (last_known_column_modified): Use EMACS_INT, not int.
5487 (check_display_width):
5488 (Fcompute_motion):
5489 Check that fixnums and floats are in proper range for system types.
5490 (compute_motion): Don't assume index or fixnum fits in int.
5491 (compute_motion, Fcompute_motion):
5492 Use int, not EMACS_INT, when it is wide enough.
5493 (vmotion): Omit local var start_hpos that is always 0; that way
5494 we don't need to worry about overflow in expressions involving it.
5495 * indent.h: Adjust decls to match defn changes elsewhere.
5496 (struct position):
5497 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5498 Use int, not EMACS_INT, where int is wide enough.
5499 Remove unused members ovstring_chars_done and tab_offset;
5500 all uses removed.
5501 * insdel.c (move_gap, move_gap_both, gap_left, gap_right)
5502 (adjust_markers_for_delete, adjust_markers_for_insert, adjust_point)
5503 (adjust_markers_for_replace, make_gap_larger, make_gap_smaller)
5504 (make_gap, copy_text, insert, insert_and_inherit)
5505 (insert_before_markers, insert_before_markers_and_inherit)
5506 (insert_1, count_combining_before, count_combining_after)
5507 (insert_1_both, insert_from_string)
5508 (insert_from_string_before_markers, insert_from_string_1)
5509 (insert_from_gap, insert_from_buffer, insert_from_buffer_1)
5510 (adjust_after_replace, adjust_after_insert, replace_range)
5511 (replace_range_2, del_range, del_range_1, del_range_byte)
5512 (del_range_both, del_range_2, modify_region)
5513 (prepare_to_modify_buffer, signal_before_change)
5514 (signal_after_change, Fcombine_after_change_execute):
5515 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5516 * intervals.c (traverse_intervals, rotate_right, rotate_left)
5517 (balance_an_interval, split_interval_right, split_interval_left)
5518 (find_interval, next_interval, update_interval)
5519 (adjust_intervals_for_insertion, delete_node, delete_interval)
5520 (interval_deletion_adjustment, adjust_intervals_for_deletion)
5521 (static_offset_intervals, offset_intervals)
5522 (merge_interval_right, merge_interval_left, make_new_interval)
5523 (graft_intervals_into_buffer, temp_set_point_both)
5524 (temp_set_point, set_point, adjust_for_invis_intang)
5525 (set_point_both, move_if_not_intangible, get_property_and_range)
5526 (get_local_map, copy_intervals, copy_intervals_to_string)
5527 (compare_string_intervals, set_intervals_multibyte_1):
5528 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5529 * intervals.h: Adjust decls to match defn changes elsewhere.
5530 (struct interval):
5531 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5532 * keyboard.c (this_command_key_count, this_single_command_key_start)
5533 (before_command_key_count, before_command_echo_length, echo_now)
5534 (echo_length, recursive_edit_1, Frecursive_edit, Ftrack_mouse)
5535 (command_loop_1, safe_run_hooks, read_char, timer_check_2)
5536 (menu_item_eval_property, read_key_sequence, Fread_key_sequence)
5537 (Fread_key_sequence_vector, Fexecute_extended_command, Fsuspend_emacs):
5538 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5539 (last_non_minibuf_size, last_point_position, echo_truncate)
5540 (command_loop_1, adjust_point_for_property, read_char, gen_help_event)
5541 (make_lispy_position, make_lispy_event, parse_modifiers_uncached)
5542 (parse_modifiers, modify_event_symbol, Fexecute_extended_command)
5543 (stuff_buffered_input):
5544 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5545 (last_auto_save, command_loop_1, read_char):
5546 Use EMACS_INT, not int, to avoid integer overflow.
5547 (record_char): Avoid overflow in total_keys computation.
5548 (parse_modifiers_uncached): Redo index calculation to avoid overflow.
5549 * keyboard.h: Adjust decls to match defn changes elsewhere.
5550 * keymap.c (Fdefine_key, Fcurrent_active_maps, accessible_keymaps_1)
5551 (Fkey_description, Fdescribe_vector, Flookup_key):
5552 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5553 (click_position): New function, to check that positions are in range.
5554 (Fcurrent_active_maps):
5555 (describe_command):
5556 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5557 (Faccessible_keymaps, Fkey_description):
5558 (preferred_sequence_p):
5559 Don't assume fixnum can fit into int.
5560 (Fkey_description): Use SAFE_ALLOCA_LISP, not alloca.
5561 Check for integer overflow in size calculations.
5562 (Ftext_char_description): Use CHECK_CHARACTER, not CHECK_NUMBER, to
5563 avoid mishandling large integers.
5564 * lisp.h: Adjust decls to match defn changes elsewhere.
5565 (ARRAY_MARK_FLAG, PSEUDOVECTOR_FLAG, struct Lisp_String)
5566 (struct vectorlike_header, struct Lisp_Subr, struct Lisp_Hash_Table)
5567 (struct Lisp_Marker):
5568 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5569 (clip_to_bounds): Now an inline function, moved here from editfns.c.
d311d28c
PE
5570 (GLYPH_CODE_P): Check for overflow in system types, subsuming the
5571 need for GLYPH_CODE_CHAR_VALID_P and doing proper checking ourselves.
5572 All callers changed.
5573 (GLYPH_CODE_CHAR, GLYPH_CODE_FACE):
5574 Assume the arg has valid form, since it always does.
5575 (TYPE_RANGED_INTEGERP): Avoid bug when checking against a wide
5576 unsigned integer system type.
5577 (CHECK_RANGED_INTEGER, CHECK_TYPE_RANGED_INTEGER): New macros.
5578 (struct catchtag, specpdl_size, SPECPDL_INDEX, USE_SAFE_ALLOCA):
5579 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5580 (struct catchtag): Use EMACS_INT, not int, since it may be a fixnum.
5581 (duration_to_sec_usec): New decl.
5582 * lread.c (read_from_string_index, read_from_string_index_byte)
5583 (read_from_string_limit, readchar, unreadchar, openp)
5584 (read_internal_start, read1, oblookup):
5585 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5586 (Fload, readevalloop, Feval_buffer, Feval_region):
5587 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5588 (openp): Check for out-of-range argument to 'access'.
5589 (read1): Use int, not EMACS_INT, where int is wide enough.
5590 Don't assume fixnum fits into int.
6efdadfd 5591 Fix off-by-one error that can read outside a buffer.
1ab7b8ac
PE
5592 (read_filtered_event): Use duration_to_sec_usec
5593 to do proper overflow checking on durations.
d311d28c
PE
5594 * macros.c (Fstart_kbd_macro): Use xpalloc to check for overflow
5595 in size calculation.
5596 (Fexecute_kbd_macro):
5597 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5598 * marker.c (cached_charpos, cached_bytepos, CONSIDER)
5599 (byte_char_debug_check, buf_charpos_to_bytepos, verify_bytepos)
5600 (buf_bytepos_to_charpos, Fset_marker, set_marker_restricted)
5601 (set_marker_both, set_marker_restricted_both, marker_position)
5602 (marker_byte_position, Fbuffer_has_markers_at):
5603 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5604 (Fset_marker, set_marker_restricted): Don't assume fixnum fits in int.
61b108cc 5605 * menu.c (ensure_menu_items): Rename from grow_menu_items.
d311d28c
PE
5606 It now merely ensures that the menu is large enough, without
5607 necessarily growing it, as this avoids some integer overflow issues.
5608 All callers changed.
5609 (keymap_panes, parse_single_submenu, Fx_popup_menu):
5610 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5611 (parse_single_submenu, Fx_popup_menu): Don't assume fixnum fits in int.
5612 Use SAFE_ALLOCA_LISP, not alloca.
5613 (find_and_return_menu_selection): Avoid unnecessary casts of pointers
5614 to EMACS_INT. Check that fixnums are in proper range for system types.
5615 * minibuf.c (minibuf_prompt_width, string_to_object)
5616 (Fminibuffer_contents, Fminibuffer_contents_no_properties)
5617 (Fminibuffer_completion_contents, Ftry_completion, Fall_completions):
5618 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5619 (get_minibuffer, read_minibuf_unwind):
5620 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5621 (read_minibuf): Omit unnecessary arg BACKUP_N, which is always nil;
5622 this simplifies overflow checking. All callers changed.
5623 (read_minibuf, Fread_buffer, Ftry_completion, Fall_completions)
5624 (Ftest_completion):
5625 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5626 * nsfns.m (check_ns_display_info): Don't assume fixnum fits in long.
5627 (x_set_menu_bar_lines, x_set_tool_bar_lines, Fx_create_frame):
5628 Check that fixnums are in proper range for system types.
5629 (Fx_create_frame, Fx_show_tip):
5630 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5631 * nsfont.m (ns_findfonts, nsfont_list_family):
5632 Don't assume fixnum fits in long.
5633 * nsmenu.m (ns_update_menubar, ns_menu_show, ns_popup_dialog):
5634 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5635 (ns_update_menubar): Use intptr_t, not EMACS_INT, when intptr_t is
5636 wide enough.
17fdb222 5637 * nsselect.m (ns_get_local_selection, clean_local_selection_data):
d311d28c
PE
5638 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5639 * print.c (print_buffer_size, print_buffer_pos, print_buffer_pos_byte)
5640 (PRINTDECLARE, PRINTPREPARE):
5641 (strout, print_string):
5642 (print, print_preprocess, print_check_string_charset_prop)
5643 (print_object):
5644 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5645 (PRINTDECLARE):
5646 (temp_output_buffer_setup, Fprin1_to_string, print_object):
5647 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5648 (PRINTPREPARE): Use int, not ptrdiff_t, where int is wide enough.
d311d28c 5649 (printchar, strout): Use xpalloc to catch size calculation overflow.
0fd11aa5 5650 (Fexternal_debugging_output): Don't overflow EMACS_INT->int conversion.
d311d28c
PE
5651 (print_error_message): Use SAFE_ALLOCA, not alloca.
5652 (print_object): Use int, not EMACS_INT, where int is wide enough.
a8b7caa3
PE
5653 (print_depth, new_backquote_output, print_number_index):
5654 Use ptrdiff_t, not int, where int might not be wide enough.
d311d28c
PE
5655 * process.c (Fdelete_process): Don't assume pid fits into EMACS_INT.
5656 (Fset_process_window_size, Fformat_network_address)
5657 (get_lisp_to_sockaddr_size, set_socket_option, Fmake_network_process)
d44287d4 5658 (sigchld_handler):
d311d28c 5659 Check that fixnums are in proper range for system types.
d44287d4 5660 (Fsignal_process): Simplify by avoiding a goto.
d83cf4cc
PE
5661 Check for process-ids out of pid_t range rather than relying on
5662 undefined behavior.
e4d81efc 5663 (process_tick, update_tick): Use EMACS_INT, not int.
d311d28c
PE
5664 (Fformat_network_address, read_process_output, send_process)
5665 (Fprocess_send_region, status_notify):
5666 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5667 (Fformat_network_address, Fmake_serial_process, Fmake_network_process)
5668 (wait_reading_process_output, read_process_output, exec_sentinel):
5669 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5670 (conv_lisp_to_sockaddr): Don't assume fixnums fit into int.
5671 (Faccept_process_output): Use duration_to_sec_usec to do proper
5672 overflow checking on durations.
dde14581
PE
5673 (emacs_get_tty_pgrp, Fprocess_running_child_p, process_send_signal):
5674 Don't assume pid_t fits in int.
02481186
PE
5675 * process.h (struct Lisp_Process): Members tick and update_tick
5676 are now of type EMACS_INT, not int.
b62b53e8
PE
5677 * puresize.h (PURESIZE_RATIO): Shrink this to 8/6 on 32-bit hosts
5678 configured --with-wide-int.
d311d28c
PE
5679 * scroll.c (calculate_scrolling, calculate_direct_scrolling)
5680 (line_ins_del): Use int, not EMACS_INT, where int is wide enough.
5681 * search.c (looking_at_1, string_match_1):
5682 (fast_string_match, fast_c_string_match_ignore_case)
5683 (fast_string_match_ignore_case, fast_looking_at, scan_buffer)
5684 (scan_newline, find_before_next_newline, search_command)
5685 (trivial_regexp_p, search_buffer, simple_search, boyer_moore)
5686 (set_search_regs, wordify):
5687 (Freplace_match):
5688 (Fmatch_data):
5689 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5690 (string_match_1, search_buffer, set_search_regs):
5691 (Fmatch_data):
5692 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5693 (wordify): Check for overflow in size calculation.
5694 (Freplace_match): Avoid potential buffer overflow in search_regs.start.
5695 (Fset_match_data): Don't assume fixnum fits in ptrdiff_t.
5696 Check that fixnums are in proper range for system types.
5697 * sound.c (struct sound_device)
5698 (wav_play, au_play, vox_write, alsa_period_size, alsa_write):
5699 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5700 (Fplay_sound_internal):
5701 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
eacd378d 5702 * syntax.c (struct lisp_parse_state, find_start_modiff)
d311d28c
PE
5703 (Finternal_describe_syntax_value, scan_lists, scan_sexps_forward):
5704 (Fparse_partial_sexp):
5705 Don't assume fixnums can fit in int.
5706 (struct lisp_parse_state, find_start_pos, find_start_value)
5707 (find_start_value_byte, find_start_begv)
5708 (update_syntax_table, char_quoted, dec_bytepos)
5709 (find_defun_start, prev_char_comend_first, back_comment):
5710 (scan_words, skip_chars, skip_syntaxes, forw_comment, Fforward_comment)
5711 (scan_lists, Fbackward_prefix_chars, scan_sexps_forward):
5712 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5713 (Finternal_describe_syntax_value): Check that match_lisp is a
5714 character, not an integer, since the code stuffs it into int.
5715 (scan_words, scan_sexps_forward):
5716 Check that fixnums are in proper range for system types.
5717 (Fforward_word):
5718 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5719 (scan_sexps_forward):
5720 Use CHARACTERP, not INTEGERP, since the value must fit into int.
5721 (Fparse_partial_sexp): Fix doc; element 8 is not ignored.
5722 * syntax.h: Adjust decls to match defn changes elsewhere.
5723 (struct gl_state_s):
5724 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
e4ecdc9c
PE
5725 (SETUP_SYNTAX_TABLE_FOR_OBJECT): Use PTRDIFF_MAX, not
5726 MOST_POSITIVE_FIXNUM.
d311d28c
PE
5727 * sysdep.c (wait_for_termination_1, wait_for_termination)
5728 (interruptible_wait_for_termination, mkdir):
5729 Don't assume pid_t fits in int; on 64-bit AIX pid_t is 64-bit.
5730 (emacs_read, emacs_write):
5731 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
225a2cff
PE
5732 (system_process_attributes): Don't assume uid_t, gid_t, EMACS_INT,
5733 and double all fit in int.
d311d28c
PE
5734 * term.c (set_tty_color_mode):
5735 Check that fixnums are in proper range for system types.
5736 * termhooks.h (struct input_event):
5737 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5738 * textprop.c (validate_interval_range, interval_of)
5739 (Fadd_text_properties, set_text_properties_1)
5740 (Fremove_text_properties, Fremove_list_of_text_properties)
5741 (Ftext_property_any, Ftext_property_not_all)
5742 (copy_text_properties, text_property_list, extend_property_ranges)
5743 (verify_interval_modification):
5744 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5745 (Fnext_single_char_property_change)
5746 (Fprevious_single_char_property_change):
5747 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5895d7b9
PE
5748 (copy_text_properties):
5749 Check for integer overflow in index calculation.
d311d28c
PE
5750 * undo.c (last_boundary_position, record_point, record_insert)
5751 (record_delete, record_marker_adjustment, record_change)
5752 (record_property_change):
5753 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5754 (truncate_undo_list, Fprimitive_undo): Don't assume fixnum fits in int.
5755 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5756 * w32fns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5757 (Fx_hide_tip, Fx_file_dialog):
5758 * w32menu.c (set_frame_menubar):
5759 Use ptrdiff_t, not int, for consistency with rest of code.
5760 * window.c (window_scroll_preserve_hpos, window_scroll_preserve_vpos)
5761 (select_window, Fdelete_other_windows_internal)
5762 (window_scroll_pixel_based, window_scroll_line_based)
5763 (Frecenter, Fset_window_configuration):
5764 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5765 (Fset_window_hscroll, run_window_configuration_change_hook)
5766 (set_window_buffer, temp_output_buffer_show, scroll_command)
5895d7b9 5767 (Fscroll_other_window, Frecenter):
d311d28c
PE
5768 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5769 (Fwindow_line_height, window_scroll, Fscroll_left, Fscroll_right):
5770 Don't assume fixnum fits in int.
5771 (Fset_window_scroll_bars):
5772 Check that fixnums are in proper range for system types.
5773 * xdisp.c (help_echo_pos, pos_visible_p, string_pos_nchars_ahead)
5774 (string_pos, c_string_pos, number_of_chars, init_iterator)
5775 (in_ellipses_for_invisible_text_p, init_from_display_pos)
5776 (compute_stop_pos, next_overlay_change, compute_display_string_pos)
5777 (compute_display_string_end, handle_face_prop)
5895d7b9
PE
5778 (face_before_or_after_it_pos, handle_invisible_prop)
5779 (handle_display_prop, handle_display_spec, handle_single_display_spec)
d311d28c
PE
5780 (display_prop_intangible_p, string_buffer_position_lim)
5781 (string_buffer_position, handle_composition_prop, load_overlay_strings)
5782 (get_overlay_strings_1, get_overlay_strings)
5783 (iterate_out_of_display_property, forward_to_next_line_start)
5784 (back_to_previous_visible_line_start, reseat, reseat_to_string)
5785 (get_next_display_element, set_iterator_to_next)
5786 (get_visually_first_element, compute_stop_pos_backwards)
5787 (handle_stop_backwards, next_element_from_buffer)
5788 (move_it_in_display_line_to, move_it_in_display_line)
5789 (move_it_to, move_it_vertically_backward, move_it_by_lines)
5790 (add_to_log, message_dolog, message_log_check_duplicate)
5791 (message2, message2_nolog, message3, message3_nolog
5792 (with_echo_area_buffer, display_echo_area_1, resize_mini_window_1)
5793 (current_message_1, truncate_echo_area, truncate_message_1)
5794 (set_message, set_message_1, store_mode_line_noprop)
5795 (hscroll_window_tree, debug_delta, debug_delta_bytes, debug_end_vpos)
5796 (text_outside_line_unchanged_p, check_point_in_composition)
5797 (reconsider_clip_changes)
5798 (redisplay_internal, set_cursor_from_row, try_scrolling)
5799 (try_cursor_movement, set_vertical_scroll_bar, redisplay_window)
5800 (redisplay_window, find_last_unchanged_at_beg_row)
5801 (find_first_unchanged_at_end_row, row_containing_pos, try_window_id)
5802 (trailing_whitespace_p, find_row_edges, display_line)
5803 (RECORD_MAX_MIN_POS, Fcurrent_bidi_paragraph_direction)
5804 (display_mode_element, store_mode_line_string)
5805 (pint2str, pint2hrstr, decode_mode_spec)
5806 (display_count_lines, display_string, draw_glyphs)
5807 (x_produce_glyphs, x_insert_glyphs)
5808 (rows_from_pos_range, mouse_face_from_buffer_pos)
5809 (fast_find_string_pos, mouse_face_from_string_pos)
5810 (note_mode_line_or_margin_highlight, note_mouse_highlight):
5811 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5812 (safe_call, init_from_display_pos, handle_fontified_prop)
5813 (handle_single_display_spec, load_overlay_strings)
5814 (with_echo_area_buffer, setup_echo_area_for_printing)
5815 (display_echo_area, echo_area_display)
5816 (x_consider_frame_title, prepare_menu_bars, update_menu_bar)
5817 (update_tool_bar, hscroll_window_tree, redisplay_internal)
5895d7b9
PE
5818 (redisplay_window, dump_glyph_row, display_mode_line)
5819 (Fformat_mode_line, decode_mode_spec, on_hot_spot_p):
43ad2e9a 5820 (handle_display_spec, display_prop_string_p):
d311d28c
PE
5821 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5822 (handle_single_display_spec, build_desired_tool_bar_string)
5823 (redisplay_tool_bar, scroll_window_tree, Fdump_glyph_matrix)
5824 (get_specified_cursor_type):
5825 Check that fixnums are in proper range for system types.
5826 (struct overlay_entry, resize_mini_window, Fdump_glyph_row)
5827 (Flookup_image_map):
5828 Don't assume fixnums fit in int.
5829 (compare_overlay_entries):
5830 Avoid mishandling comparisons due to subtraction overflow.
5831 (load_overlay_strings): Use SAFE_NALLOCA, not alloca.
5832 (last_escape_glyph_face_id, last_glyphless_glyph_face_id):
5833 (handle_tool_bar_click):
5834 Use int, not unsigned, since we prefer signed and the signedness
5835 doesn't matter here.
5836 (get_next_display_element, next_element_from_display_vector):
5837 Use int, not EMACS_INT, when int is wide enough.
5838 (start_hourglass): Use duration_to_sec_usec to do proper
5839 overflow checking on durations.
5840 * xfaces.c (Fbitmap_spec_p):
5841 Check that fixnums are in proper range for system types.
5842 (compare_fonts_by_sort_order):
5843 Avoid mishandling comparisons due to subtraction overflow.
5844 (Fx_family_fonts, realize_basic_faces):
5845 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5846 (Fx_family_fonts):
5847 Don't assume fixnum fits in int.
5848 Use SAFE_ALLOCA_LISP, not alloca.
5849 (merge_face_heights): Remove unnecessary cast to EMACS_INT.
5850 (Finternal_make_lisp_face): Don't allocate more than MAX_FACE_ID.
5851 (face_at_buffer_position, face_for_overlay_string)
5852 (face_at_string_position):
5853 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5854 (merge_faces): Use int, not EMACS_INT, where int is wide enough.
5855 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines, x_icon_verify)
5856 (Fx_show_tip):
5857 Check that fixnums are in proper range for system types.
5858 (Fx_create_frame, x_create_tip_frame, Fx_show_tip)
5859 (Fx_hide_tip, Fx_file_dialog, Fx_select_font):
5860 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5861 (Fx_change_window_property): Don't assume fixnums fit in int.
5862 * xfont.c (xfont_chars_supported):
5863 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5864 * xmenu.c (Fx_popup_dialog, set_frame_menubar)
5865 (create_and_show_popup_menu, create_and_show_dialog, xmenu_show):
5866 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5867 * xml.c (parse_region):
5868 * xrdb.c (magic_file_p):
5869 Use ptrdiff_t, not EMACS_INT, where ptrdiff_t is wide enough.
5870 * xselect.c (TRACE1): Don't assume pid_t promotes to int.
5871 (x_get_local_selection, x_reply_selection_request)
5872 (x_handle_selection_request, wait_for_property_change):
5873 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5874 (selection_data_to_lisp_data): Use short, not EMACS_INT, where
5875 short is wide enough.
5876 (x_send_client_event): Don't assume fixnum fits in int.
5877 * xterm.c (x_x_to_emacs_modifiers):
5878 Don't assume EMACS_INT overflows nicely into int.
5879 (x_emacs_to_x_modifiers): Use EMACS_INT, not int, because values
5880 may come from Lisp.
5881 (handle_one_xevent): NATNUMP can eval its arg twice.
5882 (x_connection_closed):
5883 Use ptrdiff_t, not int, to avoid needless 32-bit limit on 64-bit hosts.
5884 * xterm.h: Adjust decls to match defn changes elsewhere.
5885 (struct scroll_bar): Use struct vectorlike_header
5886 rather than rolling our own approximation.
5887 (SCROLL_BAR_VEC_SIZE): Remove; not used.
5888
c6574eb5
GM
58892012-05-25 Glenn Morris <rgm@gnu.org>
5890
5891 * lisp.mk (lisp): Update for more files being compiled now.
5892
e8d32c7e
SM
58932012-05-25 Stefan Monnier <monnier@iro.umontreal.ca>
5894
48def666
SM
5895 * lread.c: Remove `read_pure' which makes no difference.
5896 (read_pure): Remove var.
5897 (unreadpure): Remove function.
5898 (readevalloop): Don't call read_list with -1 flag.
5899 (read1, read_vector): Don't test read_pure any more.
5900 (read_list): Simplify.
5901
e8d32c7e
SM
5902 * fileio.c, character.h: Minor style tweaks.
5903
4b2addb7
DA
59042012-05-24 Dmitry Antipov <dmantipov@yandex.ru>
5905
5906 * window.h (clip_changed): Remove useless declaration.
5907
584461b2
JB
59082012-05-22 Juanma Barranquero <lekktu@gmail.com>
5909
5910 * makefile.w32-in: Follow-up to 2012-05-22T16:20:27Z!eggert@cs.ucla.edu.
5911 (TAGS, TAGS-gmake, CONFIG_H): Remove further references to m/intel386.h.
5912
34374650
PE
59132012-05-22 Paul Eggert <eggert@cs.ucla.edu>
5914
5915 Remove src/m/*.
5916 This directory predates autoconf and is no longer needed nowadays.
5917 Move its few remaining bits of functionality to where they're needed.
5918 * m/README, m/alpha.h, m/amdx86-64.h, m/ia64.h, m/ibmrs6000.h:
5919 * m/ibms390x.h, m/intel386.h, m/m68k.h, m/macppc.h, m/sparc.h:
5920 * m/template.h: Remove.
5921 * Makefile.in (M_FILE): Remove. All uses removed.
5922 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS):
5923 * lisp.h (USE_LSB_TAG):
5924 * mem-limits.h (EXCEEDS_LISP_PTR):
5925 Use VAL_MAX, not VALBITS, in #if.
5926 * lisp.h (EMACS_INT_MAX): New macro, useful in #if.
5927 (EMACS_UINT): Define unconditionally now.
5928 (BITS_PER_CHAR, BITS_PER_SHORT, BITS_PER_INT, BITS_PER_LONG)
5929 (BITS_PER_EMACS_INT): New constants, replacing
5930 what used to be in config.h, but not useful in #if.
5931 (GCTYPEBITS, VALBITS): Define unconditionally, since m/* files don't
5932 define them any more.
5933 (VAL_MAX): New macro.
5934 (VALMASK): Use it.
5935 * puresize.h (PURESIZE_RATIO): Use EMACS_INT_MAX, not
5936 BITS_PER_EMACS_INT, in #if.
5937 * s/aix4-2.h (BROKEN_FIONREAD, BROKEN_SIGAIO, BROKEN_SIGPTY)
5938 (BROKEN_SIGPOLL): Move here from m/ibmrs6000.h, which was removed.
5939 * s/gnu-linux.h (ULIMIT_BREAK_VALUE) [__i386__]:
5940 * s/ms-w32.h (DATA_START):
5941 Move here from removed file m/intel386.h.
5942 * s/gnu.h (NLIST_STRUCT): Remove undef; 'configure' does this.
5943 * s/irix6-5.h (_LP64): Remove; lisp.h no longer needs this.
5944
261cb4bb
PE
59452012-05-21 Paul Eggert <eggert@cs.ucla.edu>
5946
5947 Assume C89 or later.
5948 * alloc.c, buffer.c, lisp.h: Replace POINTER_TYPE with void.
5949 * alloc.c (overrun_check_malloc, overrun_check_realloc, xmalloc)
5950 (xrealloc):
5951 * buffer.c (mmap_free_1, mmap_enlarge): Omit needless casts.
5952 * editfns.c, fns.c, gmalloc.c, insdel.c, sysdep.c, termcap.c (NULL):
5953 * textprop.c, tparam.c (NULL): Remove.
5954 * ralloc.c, vm-limit.c (POINTER): Assume void * works.
5955 * regex.c (SIGN_EXTEND_CHAR): Assume signed char works.
5956 * regex.h (_RE_ARGS): Remove. All uses rewritten to use prototypes.
5957 * unexelf.c (ElfBitsW): Assume c89 preprocessor or better.
5958 * xterm.c (input_signal_count): Assume volatile works.
5959
ff23cd9f
KB
59602012-05-21 Ken Brown <kbrown@cornell.edu>
5961
5962 * xgselect.c (xg_select): Fix first argument in call to 'select'
5963 (bug#11508).
5964
1b170bc6
KB
59652012-05-20 Ken Brown <kbrown@cornell.edu>
5966
5967 * gmalloc.c (_free_internal_nolock, _realloc_internal_nolock)
bd7239f5 5968 [CYGWIN]: Cast ptr to (char *) before comparing to _heapbase.
1b170bc6 5969
b2f4d39f
KB
59702012-05-19 Ken Brown <kbrown@cornell.edu>
5971
5972 * xfns.c (x_in_use): Remove `static' qualifier.
5973 * xterm.h (x_in_use): Declare.
5974 * xgselect.c: Include xterm.h.
5975 (xg_select): Test `x_in_use' instead of `inhibit_window_system'
5976 and `display_arg' (bug#9754).
5977
003fdae2
PE
59782012-05-19 Paul Eggert <eggert@cs.ucla.edu>
5979
9232a6d9
PE
5980 * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed.
5981
003fdae2
PE
5982 * m/vax.h: Remove; no longer needed since HAVE_FTIME is being removed.
5983 * s/ms-w32.h (HAVE_FTIME): Remove; not needed.
5984
784b56e2
EZ
59852012-05-18 Eli Zaretskii <eliz@gnu.org>
5986
5987 Fix compilation with -DGLYPH_DEBUG=1 on MS-Windows.
5988
5989 * w32term.c [GLYPH_DEBUG]: Add prototype for x_check_font.
090bd7cb 5990 (x_check_font) [GLYPH_DEBUG]: New function, copied from xterm.c.
784b56e2
EZ
5991
5992 * w32fns.c (unwind_create_frame) [GLYPH_DEBUG]: Fix broken
5993 reference to image_cache->refcount.
5994 (x_create_tip_frame): Fix broken use of FRAME_IMAGE_CACHE.
5995
a0a79cde
JL
59962012-05-17 Juri Linkov <juri@jurta.org>
5997
5998 * search.c (Fword_search_regexp, Fword_search_backward)
5999 (Fword_search_forward, Fword_search_backward_lax)
6000 (Fword_search_forward_lax): Move functions to isearch.el
6001 (bug#10145, bug#11381).
6002
b0572523
PE
60032012-05-16 Paul Eggert <eggert@cs.ucla.edu>
6004
6005 * xgselect.c (xg_select): Just invoke 'select' if -nw (Bug#9754).
6006
9660f5fc
SM
60072012-05-15 Stefan Monnier <monnier@iro.umontreal.ca>
6008
6009 * lread.c (init_obarray): Declare Qt and Qnil as special.
6010
4374de83
GM
60112012-05-14 Glenn Morris <rgm@gnu.org>
6012
6013 * nsterm.m (ns_init_paths): Fix typo ("libexec" not "lib-exec").
985584ae 6014 Put "libexec" before "bin", for the sake of init_callproc_1.
4374de83 6015
dc44c39a
PE
60162012-05-14 Paul Eggert <eggert@cs.ucla.edu>
6017
078c97cb
PE
6018 * keyboard.c (kbd_buffer_get_event) [!HAVE_DBUS]: Omit unused local.
6019
dc44c39a
PE
6020 * unexaix.c: Port to more-recent AIX compilers.
6021 (report_error, report_error_1, make_hdr, copy_sym)
6022 (mark_x, adjust_lnnoptrs, unrelocate_symbols):
6023 Make arguments const char *, not char *, to avoid violations of C
6024 standard and to fix some AIX warnings reported by Gilles Pion.
6025
e18afed7 60262012-05-14 Eli Zaretskii <eliz@gnu.org>
ac268e67
EZ
6027
6028 * xdisp.c (handle_stop): Don't call get_overlay_strings_1 if we
6029 already have overlays loaded.
6030 (handle_single_display_spec): Before returning without displaying
6031 fringe bitmap, synchronize the bidi iterator with the main display
6032 iterator, by calling iterate_out_of_display_property.
6033 (iterate_out_of_display_property): Detect buffer iteration by
6034 testing that it->string is a Lisp string.
6035 (get_next_display_element): When the current object is exhausted,
6036 and there's something on it->stack, call set_iterator_to_next to
6037 proceed with what's on the stack, instead of returning zero.
6038 (set_iterator_to_next): If called at the end of a Lisp string,
6039 proceed to consider_string_end without incrementing string
6040 position. Don't increment display vector index past the end of
6041 the display vector. (Bug#11417)
c8fb9dc6
EZ
6042 (pos_visible_p): Don't report a position visible when move_it_to
6043 stopped at the last line of window, which happens to be scanned
6044 backwards by the bidi iteration. (Bug#11464)
ac268e67 6045
e18afed7 60462012-05-14 Eli Zaretskii <eliz@gnu.org>
82f9b393
EZ
6047
6048 * xdisp.c (handle_single_display_spec): Return 1 for left-margin
6049 and right-margin display specs even if the spec is invalid or we
61b108cc
SM
6050 are on a TTY, and thus unable to display on the fringes.
6051 That's because the text with the property will not be displayed anyway,
82f9b393
EZ
6052 so we need to signal to the caller that this is a "replacing"
6053 display spec. This fixes display when the spec is invalid or we
6054 are on a TTY.
6055
e18afed7 60562012-05-14 Paul Eggert <eggert@cs.ucla.edu>
297834cd
PE
6057
6058 * unexaix.c (make_hdr): Fix typo in prototype.
6059 This bug broke the build on AIX. Problem reported by Gilles Pion.
6060
9d0a235a
MA
60612012-05-14 Michael Albinus <michael.albinus@gmx.de>
6062
6063 * keyboard.c (kbd_buffer_get_event): Read special events also in
6064 batch mode. (Bug#11415)
6065
9e6b06ed
GM
60662012-05-12 Glenn Morris <rgm@gnu.org>
6067
6068 * ns.mk: Update for ns_appbindir no longer having trailing "/".
6069
c1a1d7a3
EZ
60702012-05-12 Eli Zaretskii <eliz@gnu.org>
6071
6072 * lisp.mk (lisp): Add newcomment.elc.
6073
3fe7cdc8
GM
60742012-05-12 Glenn Morris <rgm@gnu.org>
6075
6076 * Makefile.in (MKDIR_P): New, set by configure.
6077 * ns.mk (${ns_appdir}, ${ns_appbindir}Emacs): Use $MKDIR_P.
6078
53f7d2c0
PE
60792012-05-11 Paul Eggert <eggert@cs.ucla.edu>
6080
6081 Remove unused function hourglass_started.
6082 * dispextern.h (hourglass_started):
6083 * w32fns.c (hourglass_started):
6084 * xdisp.c (hourglass_started): Remove.
6085
75aafb17
JB
60862012-05-10 Juanma Barranquero <lekktu@gmail.com>
6087
6088 * makefile.w32-in ($(BLD)/gmalloc.$(O), $(BLD)/w32menu.$(O)):
6089 Update dependencies.
6090
12959e8e
PE
60912012-05-10 Paul Eggert <eggert@cs.ucla.edu>
6092
97107e2e
PE
6093 * xgselect.c (xg_select): Put maxfds+1 into a var.
6094 This is slightly clearer, and pacifies Ubuntu 12.04 gcc.
6095
12959e8e
PE
6096 * sound.c (DEFAULT_ALSA_SOUND_DEVICE): Define only if HAVE_ALSA.
6097
836d29b3
DA
60982012-05-10 Dave Abrahams <dave@boostpro.com>
6099
6100 * filelock.c (syms_of_filelock): New boolean create-lockfiles.
6101 (lock_file): If create_lockfiles is 0, do nothing. (Bug#11227)
6102
5cb67954
MA
61032012-05-09 Michael Albinus <michael.albinus@gmx.de>
6104
6105 * dbusbind.c (xd_registered_buses): New internal Lisp object.
6106 Rename all occurences of Vdbus_registered_buses to xd_registered_buses.
6107 (syms_of_dbusbind): Remove declaration of Vdbus_registered_buses.
6108 Initialize xd_registered_buses.
6109
3478ec45
PE
61102012-05-09 Paul Eggert <eggert@cs.ucla.edu>
6111
b263a6b0
PE
6112 Untag more efficiently if USE_LSB_TAG.
6113 This is based on a proposal by YAMAMOTO Mitsuharu in
6114 <http://lists.gnu.org/archive/html/emacs-devel/2008-01/msg01876.html>.
6115 For an admittedly artificial (nth 8000 longlist) benchmark on
6116 Fedora 15 x86-64, this yields a 25% CPU speedup. Also, it shrinks
6117 Emacs's overall text size by 1%.
6118 * lisp.h (XUNTAG): New macro.
6119 (XCONS, XVECTOR, XSTRING, XSYMBOL, XFLOAT, XMISC, XPROCESS, XWINDOW)
6120 (XTERMINAL, XSUBR, XBUFFER, XCHAR_TABLE, XSUB_CHAR_TABLE, XBOOL_VECTOR)
6121 (XSETTYPED_PSEUDOVECTOR, XHASH_TABLE, TYPED_PSEUDOVECTORP): Use it.
6122 * eval.c (Fautoload):
6123 * font.h (XFONT_SPEC, XFONT_ENTITY, XFONT_OBJECT):
6124 * frame.h (XFRAME): Use XUNTAG.
6125
3478ec45
PE
6126 Port recent dbusbind.c changes to 32-bit --with-wide-int.
6127 * dbusbind.c (xd_append_arg, xd_retrieve_arg, Fdbus_message_internal):
6128 Remove unportable assumptions about print widths of types like
6129 dbus_uint32_t.
6130 (xd_get_connection_address, Fdbus_init_bus): Cast Emacs integer to
6131 intptr_t when converting between pointer and integer, to avoid GCC
6132 warnings about wrong width.
6133
666b903b 61342012-05-09 Eli Zaretskii <eliz@gnu.org>
0d887c7d
EZ
6135
6136 * w32proc.c (new_child): Force Windows to reserve only 64KB of
6137 stack for each reader_thread, instead of defaulting to 8MB
6138 determined by the linker. This avoids failures in creating
6139 subprocesses on Windows 7, see the discussion in this thread:
6140 http://lists.gnu.org/archive/html/emacs-devel/2012-03/msg00119.html.
6141
b120cc17
JC
61422012-05-07 Jérémy Compostella <jeremy.compostella@gmail.com>
6143
6144 Fix up display of the *Minibuf-0* buffer in the mini window.
6145 * keyboard.c (read_char): Don't clear the echo area if there's no
6146 message to clear.
6147 * xdisp.c (redisplay_internal): Redisplay the mini window (with the
2fed2689 6148 contents of *Minibuf-0*) if there's no message displayed in its stead.
b120cc17 6149
9a4b36f8
MA
61502012-05-07 Michael Albinus <michael.albinus@gmx.de>
6151
6152 * dbusbind.c (XD_DEBUG_MESSAGE): Don't print message twice in
6153 batch mode.
6154
e5f9458f
CY
61552012-05-06 Chong Yidong <cyd@gnu.org>
6156
6157 * lisp.mk (lisp): Update.
6158
eceeb5fc 61592012-05-05 Jim Meyering <meyering@redhat.com>
bf98199c
JM
6160
6161 * w32font.c (fill_in_logfont): NUL-terminate a string (Bug#11372).
6162
71873e2b
SM
61632012-05-04 Stefan Monnier <monnier@iro.umontreal.ca>
6164
6165 * data.c (PUT_ERROR): New macro.
6166 (syms_of_data): Use it. Add new error type `user-error'.
6167 * undo.c (user_error): New function.
6168 (Fprimitive_undo): Use it.
6169 * print.c (print_error_message): Adjust print style for `user-error'.
6170 * keyboard.c (user_error): New function.
6171 (Fexit_recursive_edit, Fabort_recursive_edit): Use it.
6172
ab0fa4e4
PE
61732012-05-03 Paul Eggert <eggert@cs.ucla.edu>
6174
6175 Do not limit current-time-string to years 1000..9999.
6176 * editfns.c (TM_YEAR_IN_ASCTIME_RANGE): Remove.
6177 (Fcurrent_time_string): Support any year that is supported by the
6178 underlying localtime representation. Don't use asctime, as it
6179 has undefined behavior for years outside the range -999..9999.
6180
7ed806a7
PE
61812012-05-02 Paul Eggert <eggert@cs.ucla.edu>
6182
6183 Fix race conditions involving setenv, gmtime, localtime, asctime.
6184 Without this fix, interrupts could mess up code that uses these
6185 nonreentrant functions, since setting TZ invalidates existing
6186 tm_zone or tzname values, and since most of these functions return
6187 pointers to static storage.
6188 * editfns.c (format_time_string, Fdecode_time, Fencode_time)
6189 (Fcurrent_time_string, Fcurrent_time_zone, Fset_time_zone_rule):
6190 Grow the critical sections to include not just invoking
6191 localtime/gmtime, but also accessing these functions' results
6192 including their tm_zone values if any, and any related TZ setting.
6193 (format_time_string): Last arg is now struct tm *, not struct tm **,
71873e2b
SM
6194 so that the struct tm is saved in the critical section.
6195 All callers changed. Simplify allocation of initial buffer, partly
7ed806a7
PE
6196 motivated by the fact that memory allocation needs to be outside
6197 the critical section.
6198
0c16dfed
DA
61992012-05-02 Dmitry Antipov <dmantipov@yandex.ru>
6200
6201 * intervals.c (adjust_intervals_for_insertion): Initialize `newi'
6202 with RESET_INTERVAL.
6203
6204 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
6205 Remove duplicated buffer name initialization.
6206
3f83ace8
JM
62072012-05-02 Jim Meyering <jim@meyering.net>
6208
6209 * xterm.c (x_term_init): Use memcpy instead of strncpy (Bug#11373).
6210
c7b8541e
JM
6211 * xfns.c (x_window): Use xstrdup (Bug#11375).
6212
90207a15 62132012-05-02 Eli Zaretskii <eliz@gnu.org>
2fa85638
EZ
6214
6215 * xdisp.c (pos_visible_p): If already at a newline from the
6216 display string before the 'while' loop, don't walk back the glyphs
6217 from it3.glyph_row. Solves assertion violation when the display
6218 string begins with a newline (egg.el). (Bug#11367)
6219
b593d6a9
AH
62202012-05-01 Stefan Monnier <monnier@iro.umontreal.ca>
6221
6222 * keyboard.c (Fexecute_extended_command, Vsuggest_key_bindings):
6223 Move to simple.el.
6224
4737362e
GM
62252012-05-01 Glenn Morris <rgm@gnu.org>
6226
99cf43f9
GM
6227 * syssignal.h: Remove reference to BROKEN_SIGINFO (last used in
6228 s/ptx4.h), BROKEN_SIGTSTP (last used in m/ustation.h, m/dpx2.h),
6229 and BROKEN_SIGURG (was in s/gnu-linux.h prior to 2008-02-10).
6230 All were removed before 23.1.
6231
9311dcff
GM
6232 * dispnew.c: Remove HAVE_LIBNCURSES test;
6233 it is always true on relevant platforms.
6234
4d5c6349
GM
6235 * Makefile.in (LD_SWITCH_X_SITE_RPATH):
6236 Rename from LD_SWITCH_X_SITE_AUX_RPATH.
6237
4737362e
GM
6238 * Makefile.in (LD_SWITCH_X_SITE_AUX): Remove; no longer used.
6239
74dd3a6b
AS
62402012-04-30 Andreas Schwab <schwab@linux-m68k.org>
6241
6242 * .gdbinit (xpr): Remove checks for no longer existing misc types.
6243 (xintfwd, xboolfwd, xobjfwd, xbufobjfwd, xkbobjfwd, xbuflocal):
6244 Remove.
6245
13c379ee
PE
62462012-04-28 Paul Eggert <eggert@cs.ucla.edu>
6247
6248 Do not avoid creating empty evaporating overlays (Bug#9642).
6249 * buffer.c (Fmove_overlay): Revert the change of 2012-04-23.
6250 That is, do not delete an evaporating overlay if it becomes
6251 empty after its bounds are adjusted to fit within its buffer.
6252 This fix caused other problems, and I'm reverting it until we get
6253 to the bottom of them.
6254
a8e7d6d7 62552012-04-27 Chong Yidong <cyd@gnu.org>
9be2fd9b
CY
6256
6257 * xselect.c (x_convert_selection): Initialize a pointer (Bug#11315).
6258
a8e7d6d7 62592012-04-27 Eli Zaretskii <eliz@gnu.org>
f0ee99a0
EZ
6260
6261 * xdisp.c (pos_visible_p): If the window start position is beyond
6262 ZV, start the display from buffer beginning. Prevents assertion
6263 violation in init_iterator when the minibuffer window is scrolled
6264 via the scroll bar.
6265
6266 * window.c (window_scroll_pixel_based): Likewise.
6267
a8e7d6d7 62682012-04-27 Chong Yidong <cyd@gnu.org>
9ec7751f
CY
6269
6270 * keymap.c (where_is_internal): Doc fix (Bug#10872).
6271
a8e7d6d7 62722012-04-27 Glenn Morris <rgm@gnu.org>
24c51a09
GM
6273
6274 * fileio.c (Fcopy_file, Fset_file_selinux_context):
6275 Ignore ENOTSUP failures from setfilecon functions. (Bug#11245)
6276
a8e7d6d7 62772012-04-27 Eli Zaretskii <eliz@gnu.org>
73055685 6278
b593d6a9
AH
6279 * dispnew.c (swap_glyph_pointers, copy_row_except_pointers):
6280 Don't overrun array limits of glyph row's used[] array. (Bug#11288)
73055685 6281
1c6900d9
EZ
62822012-04-26 Eli Zaretskii <eliz@gnu.org>
6283
4c3fa1d9
EZ
6284 * xdisp.c (IT_DISPLAYING_WHITESPACE): In addition to the loaded
6285 display element, check also the underlying string or buffer
6286 character. (Bug#11341)
6287
1c6900d9
EZ
6288 * w32menu.c: Include w32heap.h.
6289 (add_menu_item): If the call to AppendMenuW (via
6290 unicode_append_menu) fails, disable Unicode menus only if we are
6291 running on Windows 9X/Me.
6292
42bf8205
AS
62932012-04-24 Andreas Schwab <schwab@linux-m68k.org>
6294
6295 * .gdbinit (xpr): Handle USE_2_TAGS_FOR_INTS.
6296 (xgetint): Add missing shift for LSB tags.
6297
b1bac16e
MR
62982012-04-24 Martin Rudalics <rudalics@gmx.at>
6299
6300 * keyboard.c (read_char): Don't wipe echo area for select window
6301 events: These might get delayed via `mouse-autoselect-window'
6302 (Bug#11304).
6303
d69621cc
JB
63042012-04-24 Juanma Barranquero <lekktu@gmail.com>
6305
6306 * gnutls.c (init_gnutls_functions): Protect against (unlikely)
6307 manipulation of :loaded-from data.
6308
02fd101b
JB
63092012-04-23 Juanma Barranquero <lekktu@gmail.com>
6310
6311 * gnutls.c (init_gnutls_functions): The value of :loaded-from is
6312 now a cons (bug#11311).
6313
888bec30
PE
63142012-04-23 Paul Eggert <eggert@cs.ucla.edu>
6315
89a438bd
PE
6316 Do not create empty overlays with the evaporate property (Bug#9642).
6317 * buffer.c (Fmove_overlay): Delete an evaporating overlay
6318 if it becomes empty after its bounds are adjusted to fit within
6319 its buffer. Without this fix, in a nonempty buffer (let ((o
6320 (make-overlay 1 2))) (overlay-put o 'evaporate t) (move-overlay o 0 1))
6321 yields an empty overlay that has the evaporate property, which is
6322 not supposed to happen.
6323
1068fe4d
PE
6324 Fix minor GTK3 problems found by static checking.
6325 * emacsgtkfixed.c (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6326 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6327 (struct _EmacsFixedClass, emacs_fixed_get_type):
6328 Move decls here from emacsgtkfixed.h, since they needn't be public.
6329 (emacs_fixed_get_type): Now static.
6330 (emacs_fixed_class_init): Omit unused local.
6331 (emacs_fixed_child_type): Remove; unused.
6332 * emacsgtkfixed.h (EMACS_TYPE_FIXED, EMACS_FIXED, EmacsFixed)
6333 (EmacsFixedPrivate, EmacsFixedClass, struct _EmacsFixed)
6334 (struct _EmacsFixedClass): Move to emacsgtkfixed.c.
6335 (EMACS_FIXED_CLASS, EMACS_IS_FIXED, EMACS_IS_FIXED_CLASS)
6336 (EMACS_FIXED_GET_CLASS): Remove; unused.
6337 * gtkutil.c (xg_create_frame_widgets) [!HAVE_GTK3]: Omit unused local.
6338
888bec30
PE
6339 * keyboard.c (handle_async_input): Define only if SYNC_INPUT || SIGIO.
6340 Problem reported by Juanma Barranquero for Windows -Wunused-function.
6341
de85e130
PE
63422012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6343
d0baac98 6344 Modernize and clean up gmalloc.c to assume C89 (Bug#9119).
bd7239f5 6345 * gmalloc.c (_MALLOC_INTERNAL, _MALLOC_H, _PP, __ptr_t)
d0baac98
PE
6346 (__malloc_size_t, __malloc_ptrdiff_t):
6347 Remove. All uses removed, replaced by the definiens if needed,
6348 since we can assume C89 or better now.
6349 Include <stdint.h>, for PTRDIFF_MAX, uintptr_t.
6350 (protect_malloc_state, align, get_contiguous_space)
6351 (malloc_atfork_handler_prepare, malloc_atfork_handler_parent)
6352 (malloc_atfork_handler_child, malloc_enable_thread)
6353 (malloc_initialize_1, __malloc_initialize, morecore_nolock)
6354 (_malloc_internal_nolock, _malloc_internal, malloc, _malloc)
6355 (_free, _realloc, _free_internal_nolock, _free_internal, free, cfree)
6356 (special_realloc, _realloc_internal_nolock, _realloc_internal)
6357 (realloc, calloc, __default_morecore, memalign, valloc, checkhdr)
6358 (freehook, mallochook, reallochook, mabort, mcheck, mprobe):
6359 Define using prototypes, not old style.
6360 (align, _malloc_internal_nolock, _free_internal_nolock, memalign):
6361 Don't assume ptrdiff_t and uintptr_t are no wider than unsigned long.
6362 (align): Don't assume that signed integer overflow wraps around.
6363 Omit unused local var.
6364 (malloc_initialize_1, morecore_nolock, _malloc_internal_nolock)
6365 (_free_internal_nolock, memalign, mallochook, reallochook):
6366 Omit no-longer-needed casts.
6367 (valloc): Use getpagesize, not __getpagesize.
6368 (MAGICWORD, MAGICFREE): Now randomish size_t values, not 32-bit.
6369 (struct hdr): The 'magic' member is now size_t, not unsigned long.
6370
de85e130
PE
6371 * dbusbind.c (XD_DBUS_VALIDATE_OBJECT): Define only if needed.
6372
dcbf5805
MA
63732012-04-22 Michael Albinus <michael.albinus@gmx.de>
6374
6375 Move functions from C to Lisp. Make non-blocking method calls
6376 the default. Implement further D-Bus standard interfaces.
6377
6378 * dbusbind.c (DBUS_NUM_MESSAGE_TYPES): Declare.
6379 (QCdbus_request_name_allow_replacement)
6380 (QCdbus_request_name_replace_existing)
6381 (QCdbus_request_name_do_not_queue)
6382 (QCdbus_request_name_reply_primary_owner)
6383 (QCdbus_request_name_reply_in_queue)
6384 (QCdbus_request_name_reply_exists)
6385 (QCdbus_request_name_reply_already_owner): Move to dbus.el.
6386 (QCdbus_registered_serial, QCdbus_registered_method)
6387 (QCdbus_registered_signal): New Lisp objects.
6388 (XD_DEBUG_MESSAGE): Use sizeof.
6389 (XD_MESSAGE_TYPE_TO_STRING, XD_OBJECT_TO_STRING)
6390 (XD_DBUS_VALIDATE_BUS_ADDRESS, XD_DBUS_VALIDATE_OBJECT)
6391 (XD_DBUS_VALIDATE_BUS_NAME, XD_DBUS_VALIDATE_PATH)
6392 (XD_DBUS_VALIDATE_INTERFACE, XD_DBUS_VALIDATE_MEMBER): New macros.
6393 (XD_CHECK_DBUS_SERIAL): Rename from CHECK_DBUS_SERIAL_GET_SERIAL.
6394 (xd_signature, xd_append_arg): Allow float for integer types.
6395 (xd_get_connection_references): New function.
b593d6a9
AH
6396 (xd_get_connection_address): Rename from xd_initialize.
6397 Return cached address.
dcbf5805
MA
6398 (xd_remove_watch): Do not unset $DBUS_SESSION_BUS_ADDRESS.
6399 (xd_close_bus): Rename from Fdbus_close_bus. Not needed on Lisp
6400 level.
6401 (Fdbus_init_bus): New optional arg PRIVATE. Cache address.
9a4b36f8 6402 Return number of refcounts.
dcbf5805
MA
6403 (Fdbus_get_unique_name): Make stronger parameter check.
6404 (Fdbus_message_internal): New defun.
6405 (Fdbus_call_method, Fdbus_call_method_asynchronously)
6406 (Fdbus_method_return_internal, Fdbus_method_error_internal)
6407 (Fdbus_send_signal, Fdbus_register_service)
6408 (Fdbus_register_signal, Fdbus_register_method): Move to dbus.el.
6409 (xd_read_message_1): Obey new structure of Vdbus_registered_objects.
6410 (xd_read_queued_messages): Obey new structure of Vdbus_registered_buses.
6411 (Vdbus_compiled_version, Vdbus_runtime_version)
6412 (Vdbus_message_type_invalid, Vdbus_message_type_method_call)
6413 (Vdbus_message_type_method_return, Vdbus_message_type_error)
6414 (Vdbus_message_type_signal): New defvars.
b593d6a9
AH
6415 (Vdbus_registered_buses, Vdbus_registered_objects_table):
6416 Adapt docstring.
dcbf5805 6417
52828e02
PE
64182012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6419
da05bc4c
PE
6420 Fix GC_MALLOC_CHECK debugging output on 64-bit hosts.
6421 * alloc.c (emacs_blocked_malloc) [GC_MALLOC_CHECK]:
6422 Do not assume ptrdiff_t is the same width as 'int'.
6423
52828e02
PE
6424 * alloc.c: Handle unusual debugging option combinations.
6425 (GC_CHECK_MARKED_OBJECTS): Undef if ! GC_MARK_STACK,
6426 since the two debugging options are incompatible.
6427 (GC_MALLOC_CHECK): Similarly, undef if GC_CHECK_MARKED_OBJECTS
6428 is defined.
6429 (mem_init, mem_insert, mem_insert_fixup):
6430 Define if GC_MARK_STACK || GC_MALLOC_CHECK.
6431 (NEED_MEM_INSERT): Remove; no longer needed.
6432
f01769f9
LL
64332012-04-22 Leo Liu <sdl.web@gmail.com>
6434
6435 * sysdep.c (list_system_processes): Support Darwin (Bug#5725).
6436
5790543d
PE
64372012-04-22 Paul Eggert <eggert@cs.ucla.edu>
6438
6439 * sysdep.c [__FreeBSD__]: Minor cleanups.
6440 (list_system_processes, system_process_attributes) [__FreeBSD__]:
6441 Use Emacs indenting style more consistently. Avoid some casts.
6442 Use 'double' consistently rather than mixing 'float' and 'double'.
6443
b91b7e4d
EW
64442012-04-21 Eduard Wiebe <usenet@pusto.de>
6445
b593d6a9
AH
6446 * sysdep.c (list_system_processes, system_process_attributes):
6447 Add implementation for FreeBSD (Bug#5243).
b91b7e4d 6448
6114eb15
AS
64492012-04-21 Andreas Schwab <schwab@linux-m68k.org>
6450
6451 * lisp.mk (lisp): Update.
6452
2f38dff7
PE
64532012-04-20 Paul Eggert <eggert@cs.ucla.edu>
6454
6455 * keyboard.c (process_pending_signals): Define only if SYNC_INPUT.
6456 It is never used otherwise.
6457
4ae29f89
SM
64582012-04-20 Stefan Monnier <monnier@iro.umontreal.ca>
6459
6460 * print.c (print_preprocess): Only check print_depth if print-circle
6461 is nil.
6462 (print_object): Check for cycles even when print-circle is nil and
6463 print-gensym is t, but only check print_depth if print-circle is nil.
6464
f30d612a
CY
64652012-04-20 Chong Yidong <cyd@gnu.org>
6466
6467 * process.c (wait_reading_process_output): If EIO occurs on a pty,
6468 set the status to "failed" and ensure that sentinel is run.
6469
c07a4c0b 64702012-04-20 Glenn Morris <rgm@gnu.org>
016a35df
GM
6471
6472 * process.c (Fset_process_inherit_coding_system_flag)
6473 (Fset_process_query_on_exit_flag): Doc fix (mention return value).
4373fd43 6474 (Fmake_network_process, Fmake_serial_process): Doc fix.
016a35df 6475
c07a4c0b 64762012-04-20 Eli Zaretskii <eliz@gnu.org>
20a68157
EZ
6477
6478 * xdisp.c (string_buffer_position_lim): Limit starting position to
6479 BEGV.
6480 (set_cursor_from_row): If called for a mode-line or header-line
6481 row, return zero immediately.
6482 (try_cursor_movement): If inside continuation line, don't back up
4ae29f89
SM
6483 farther than the first row after the header line, if any.
6484 Don't consider the header-line row as "partially visible", even if
20a68157
EZ
6485 MATRIX_ROW_PARTIALLY_VISIBLE_P returns non-zero. (Bug#11261)
6486
c07a4c0b 64872012-04-20 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6488
4ae29f89
SM
6489 * lread.c (lisp_file_lexically_bound_p): Fix hang at ";-*-\n"
6490 (bug#11238).
ad3a2b41 6491
c07a4c0b 64922012-04-20 Teodor Zlatanov <tzz@lifelogs.com>
6c94c34f 64932012-04-18 Paul Eggert <eggert@cs.ucla.edu>
ae6e112d
PE
6494
6495 configure: new option --enable-gcc-warnings (Bug#11207)
6496 * Makefile.in (C_WARNINGS_SWITCH): Remove.
6497 (WARN_CFLAGS, WERROR_CFLAGS): New macros.
6498 (ALL_CFLAGS): Use new macros rather than old.
6499 * process.c: Ignore -Wstrict-overflow to work around GCC bug 52904.
6500 * regex.c: Ignore -Wstrict-overflow. If !emacs, also ignore
6501 -Wunused-but-set-variable, -Wunused-function, -Wunused-macros,
6502 -Wunused-result, -Wunused-variable. This should go away once
6503 the Emacs and Gnulib regex code is merged.
6504 (xmalloc, xrealloc): Now static.
6505
aba027e8
PE
65062012-04-17 Paul Eggert <eggert@cs.ucla.edu>
6507
6508 * dired.c (Fsystem_groups): Remove unused local.
6509
e5a36063
GM
65102012-04-17 Glenn Morris <rgm@gnu.org>
6511
6512 * dired.c (Fsystem_users): Doc fix.
6513
316411f0
DA
65142012-04-17 Dmitry Antipov <dmantipov@yandex.ru>
6515
6516 * dired.c (Fsystem_users, Fsystem_groups): New functions. (Bug#7900)
6517 (syms_of_dired): Add them.
6518
9426aba4
PE
65192012-04-16 Paul Eggert <eggert@cs.ucla.edu>
6520
b62a57be
PE
6521 Fix minor alloc.c problems found by static checking.
6522 * alloc.c (_malloc_internal, _free_internal) [!DOUG_LEA_MALLOC]:
6523 New extern decls, to avoid calling undeclared functions.
6524 (dont_register_blocks): Define if ((!SYSTEM_MALLOC && !SYNC_INPUT)
6525 && GC_MALLOC_CHECK), not if ((GC_MARK_STACK || defined
6526 GC_MALLOC_CHECK) && GC_MALLOC_CHECK), to match when it's used.
6527 (NEED_MEM_INSERT): New macro.
6528 (mem_insert, mem_insert_fixup) [!NEED_MEM_INSERT]: Remove; unused.
4b5afbb0 6529 Remove one incorrect comment and fix another.
b62a57be 6530
3539f31f
PE
6531 Fix minor ralloc.c problems found by static checking.
6532 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6533 * ralloc.c (ALIGNED, ROUND_TO_PAGE, HEAP_PTR_SIZE)
6534 (r_alloc_size_in_use, r_alloc_freeze, r_alloc_thaw): Remove; unused.
6535 (r_alloc_sbrk): Now static.
6536
a041960a
PE
6537 Improve ralloc.c interface checking.
6538 See http://lists.gnu.org/archive/html/emacs-devel/2011-12/msg00720.html
6539 * buffer.c (ralloc_reset_variable, r_alloc, r_re_alloc)
6540 (r_alloc_free) [REL_ALLOC]: Move decls from here ...
6541 * lisp.h (r_alloc, r_alloc_free, r_re_alloc, r_alloc_reset_variable)
6542 [REL_ALLOC]: ... to here, to check interface.
6543 * m/ia64.h (r_alloc, r_alloc_free) [REL_ALLOC && !_MALLOC_INTERNAL]:
6544 Remove decls. This fixes an "It stinks!".
6545
9426aba4
PE
6546 * alloc.c (which_symbols): Fix alignment issue / type clash.
6547
d55c12ed
AS
65482012-04-15 Andreas Schwab <schwab@linux-m68k.org>
6549
6550 * lisp.h (struct Lisp_Symbol): Remove explicit padding.
6551 (struct Lisp_Misc_Any): Likewise.
6552 (struct Lisp_Free): Likewise.
6553 * alloc.c (union aligned_Lisp_Symbol): Define.
6554 (SYMBOL_BLOCK_SIZE, struct symbol_block): Use union
6555 aligned_Lisp_Symbol instead of struct Lisp_Symbol.
6556 (union aligned_Lisp_Misc): Define.
6557 (MARKER_BLOCK_SIZE, struct marker_block): Use union
6558 aligned_Lisp_Misc instead of union Lisp_Misc.
4ae29f89 6559 (Fmake_symbol, allocate_misc, gc_sweep): Adjust.
d55c12ed 6560
b948ce8b
PE
65612012-04-14 Paul Eggert <eggert@cs.ucla.edu>
6562
6563 Make GC_MAKE_GCPROS_NOOPS the default (Bug#9926).
6564 * lisp.h (GC_MARK_STACK): Default to GC_MAKE_GCPROS_NOOPS.
6565 * s/cygwin.h, s/darwin.h, s/freebsd.h, s/gnu.h, s/irix6-5.h, s/msdos.h:
6566 * s/netbsd.h, s/sol2-6.h:
6567 Remove definition of GC_MARK_STACK, since the default now works.
6568 * s/aix4-2.h, s/hpux10-20.h, s/unixware.h:
6569 Define GC_MARK_STACK to GC_USE_GCPROS_AS_BEFORE, since that's
6570 no longer the default.
6571 * s/gnu-linux.h (GC_MARK_STACK): Adjust to change in default.
6572
35dc09a1 65732012-04-14 Atsuo Ohki <ohki@gssm.otsuka.tsukuba.ac.jp> (tiny change)
ad3a2b41 6574
35dc09a1
GM
6575 * lread.c (lisp_file_lexically_bound_p):
6576 Fix hang at ";-*-\n" (bug#11238).
ad3a2b41 6577
35dc09a1
GM
65782012-04-14 Eli Zaretskii <eliz@gnu.org>
6579
6580 * xdisp.c (find_last_unchanged_at_beg_row): Don't consider a row
6581 "unchanged" if its end.pos is beyond ZV. (Bug#11199)
6582
65832012-04-14 Jan Djärv <jan.h.d@swipnet.se>
6584
6585 * nsterm.m (constrainFrameRect): Always constrain when there is only
6586 one screen (Bug#10962).
6587
bcd86815
KB
65882012-04-13 Ken Brown <kbrown@cornell.edu>
6589
6590 * s/cygwin.h (PTY_OPEN): Don't try to close a bogus file descriptor.
6591
c25df26e
RT
65922012-04-13 Reuben Thomas <rrt@sc3d.org>
6593
6594 * indent.c (Fmove_to_column): Change interactive spec (Bug#739).
6595
0fc59f1e
DC
65962012-04-11 Daniel Colascione <dancol@dancol.org>
6597
6598 * s/cygwin.h: The vfork the #define in cygwin.h was protecting
6599 against is gone. It's better to use vfork now so that when Cygwin
6600 gains a new, working vfork, we use it automatically (bug#10398).
6601
de8c03dc
SM
66022012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6603
6604 * window.c (save_window_save): Obey window-point-insertion-type.
6605
2f097256
GM
66062012-04-11 Glenn Morris <rgm@gnu.org>
6607
6608 * Makefile.in (GNUSTEP_CFLAGS): Rename from C_SWITCH_X_SYSTEM.
6609
453b951e
SM
66102012-04-11 Stefan Monnier <monnier@iro.umontreal.ca>
6611
6612 * alloc.c (lisp_align_malloc): Remove unneeded prototype.
6613
75f1671a 66142012-04-10 Jason S. Cornez <jcornez@ravenpack.com> (tiny change)
6bbef4e5
JC
6615
6616 * keyboard.c: Override inhibit-quit after the third C-g (bug#6585).
6617 (force_quit_count): New var.
6618 (handle_interrupt): Use it.
6619
2a8ce227
JB
66202012-04-10 Juanma Barranquero <lekktu@gmail.com>
6621
6622 * w32.c (w32_delayed_load): Record the full path of the library
6623 being loaded (bug#10424).
6624
935396c0
GM
66252012-04-09 Glenn Morris <rgm@gnu.org>
6626
05920a43
GM
6627 * doc.c (Fsnarf_documentation): Check variables, functions are bound,
6628 not just in the obarray, before snarfing them. (Bug#11036)
6629
935396c0
GM
6630 * Makefile.in ($(leimdir)/leim-list.el):
6631 Pass EMACS rather than BUILT_EMACS.
6632
a18ecafa
TZ
66332012-04-09 Teodor Zlatanov <tzz@lifelogs.com>
6634
6635 * process.c (make_process):
6636 * process.h: Add integer `gnutls_handshakes_tried' member to
6637 process struct.
6638
6bbef4e5
JC
6639 * gnutls.h: Add `GNUTLS_EMACS_HANDSHAKES_LIMIT' upper limit.
6640 Add convenience `GNUTLS_LOG2i' macro.
a18ecafa
TZ
6641
6642 * gnutls.c (gnutls_log_function2i): Convenience log function.
6643 (emacs_gnutls_read): Use new log functions,
6644 `gnutls_handshakes_tried' process member, and
6645 `GNUTLS_EMACS_HANDSHAKES_LIMIT' to limit the number of handshake
6646 attempts per process (connection).
6647
b4d3bc10
CY
66482012-04-09 Chong Yidong <cyd@gnu.org>
6649
6650 * eval.c (Fuser_variable_p, user_variable_p_eh)
6651 (lisp_indirect_variable): Functions deleted.
6652 (Fdefvar): Caller changed.
6653
6654 * callint.c (Finteractive, Fcall_interactively):
6655 * minibuf.c (Fread_variable): Callers changed.
6656
70f4d973
EZ
66572012-04-09 Eli Zaretskii <eliz@gnu.org>
6658
6659 * xdisp.c (set_cursor_from_row): If the display string appears in
6660 the buffer at position that is closer to point than the position
6661 after the display string, display the cursor on the first glyph of
6662 the display string. Fixes cursor display when a 'display' text
6663 property immediately follows invisible text. (Bug#11094)
6664
cb3c2e3e
PE
66652012-04-09 Paul Eggert <eggert@cs.ucla.edu>
6666
6667 composite.c: use 'double' consistently
6668 * composite.c (get_composition_id): Use 'double' consistently
6669 instead of converting 'float' to 'double' and vice versa; this is
6670 easier to understand and avoids a GCC warning.
6671
fd06db5d
GM
66722012-04-09 Glenn Morris <rgm@gnu.org>
6673
50fe702a
GM
6674 * Makefile.in: Generate leim-list with bootstrap-emacs, in
6675 preparation for dumping it with emacs. (Bug#4789)
6676 (leimdir): New variable.
6677 ($(leimdir)/leim-list.el): New rule.
6678 (emacs$(EXEEXT)): Depend on leim-list.el.
6679
fd06db5d
GM
6680 * buffer.c (Qucs_set_table_for_input): Remove. (Bug#9821)
6681 (Fget_buffer_create): Don't call Qucs_set_table_for_input.
6682 (init_buffer_once, syms_of_buffer): Remove Qucs_set_table_for_input.
6683
55c131ee
AS
66842012-04-08 Andreas Schwab <schwab@linux-m68k.org>
6685
6686 * lisp.h (struct Lisp_Symbol): Add explicit padding to ensure
6687 proper alignment.
6688
9209588f
JB
66892012-04-07 Juanma Barranquero <lekktu@gmail.com>
6690
6691 * xml.c (init_libxml2_functions) [WINDOWSNT]:
6692 Remove unused local variable.
6693
e3fb2efb
PE
66942012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6695
6696 Avoid unnecessary pointer scanning in garbage collection (Bug#10780).
6697 * alloc.c (POINTERS_MIGHT_HIDE_IN_OBJECTS): New macro.
6698 (mark_memory): Mark Lisp_Objects only if pointers might hide in
6699 objects, as mark_maybe_pointer will catch them otherwise.
6700 (GC_LISP_OBJECT_ALIGNMENT): Remove; no longer needed.
6701 * s/gnu-linux.h (GC_LISP_OBJECT_ALIGNMENT) [__mc68000__]: Likewise.
6702
b5385551
PE
67032012-04-07 Paul Eggert <eggert@cs.ucla.edu>
6704
6705 Fix typo that broke non-Windows builds.
6706 * xml.c (libxml2_loaded_p) [!!WINDOWSNT]: 'inine' -> 'inline'.
6707
9078ead6
EZ
67082012-04-07 Eli Zaretskii <eliz@gnu.org>
6709
6710 Support building on MS-Windows with libxml2.
6711
6712 * makefile.w32-in (OBJ2): Add xml.$(O).
6713 (GLOBAL_SOURCES): Add xml.c.
6714 ($(BLD)/xml.$(O)): New dependency list.
6715
6716 * xml.c (DEF_XML2_FN, LOAD_XML2_FN) [WINDOWSNT]: New macros.
6717 (fn_htmlReadMemory, fn_xmlReadMemory, fn_xmlDocGetRootElement)
6718 (fn_xmlFreeDoc, fn_xmlCleanupParser, fn_xmlCheckVersion)
6719 [!WINDOWSNT]: New macros.
6720 (init_libxml2_functions, libxml2_loaded_p): New functions.
6721 (parse_region): Call fn_xmlCheckVersion instead of using the macro
6722 LIBXML_TEST_VERSION. Call libxml2 functions via the fn_* macros.
6723 (xml_cleanup_parser): New function, export for fn_xmlCleanupParser.
6724 Calls xmlCleanupParser only if libxml2 was loaded (or statically
6725 linked in).
6bbef4e5
JC
6726 (Flibxml_parse_html_region, Flibxml_parse_xml_region):
6727 Call init_libxml2_functions before calling libxml2 functions.
9078ead6
EZ
6728 (syms_of_xml) <Qlibxml2_dll>: DEFSYM it.
6729
6730 * emacs.c: Don't include libxml/parser.h.
6731 (shut_down_emacs): Call xml_cleanup_parser, instead of calling
6732 xmlCleanupParser directly.
6733
6734 * lisp.h [HAVE_LIBXML2]: Add prototype for xml_cleanup_parser.
6735
3811fdf3
EZ
67362012-04-07 Eli Zaretskii <eliz@gnu.org>
6737
6738 * indent.c (Fvertical_motion): If there is a display string at
6739 point, use it.vpos to compute how many lines to backtrack after
6740 move_it_to point. (Bug#11133)
6741
2f8e16b2
EZ
67422012-04-06 Eli Zaretskii <eliz@gnu.org>
6743
6744 * buffer.h (FETCH_CHAR, FETCH_MULTIBYTE_CHAR):
6745 * character.h (STRING_CHAR, STRING_CHAR_AND_LENGTH): Add comments
6746 about subtle differences between FETCH_CHAR* and STRING_CHAR*
6747 macros related to unification of CJK characters. For the details,
6748 see the discussion following the message here:
6749 http://debbugs.gnu.org/cgi/bugreport.cgi?bug=11073#14.
6750
3d439cd1
CY
67512012-04-04 Chong Yidong <cyd@gnu.org>
6752
6753 * keyboard.c (Vdelayed_warnings_list): Doc fix.
6754
8bc53d00
EZ
67552012-04-01 Eli Zaretskii <eliz@gnu.org>
6756
6757 * w32menu.c (simple_dialog_show, add_menu_item): Use SAFE_ALLOCA
6758 instead of alloca. (Bug#11138)
6759
3b0512a3
AS
67602012-04-01 Andreas Schwab <schwab@linux-m68k.org>
6761
6762 * w32menu.c (is_simple_dialog): Properly check lisp types.
6763 (Bug#11141)
6764
8427ddd2
EZ
67652012-03-31 Eli Zaretskii <eliz@gnu.org>
6766
979022ef
EZ
6767 * xdisp.c (move_it_by_lines): When DVPOS is positive, and the
6768 position we get to after a call to move_it_to fails the
6769 IS_POS_VALID_AFTER_MOVE_P test, move to the next buffer position
6770 only if we wind up in a string from display property. (Bug#11063)
6771
a6b1c7cc
EZ
6772 * window.c (Fdelete_other_windows_internal): Invalidate the row
6773 and column information about mouse highlight, so that redisplay
6774 restores it after reallocating the glyph matrices. (Bug#7464)
6775
8427ddd2
EZ
6776 * xdisp.c (set_cursor_from_row): If `cursor' property on a display
6777 string comes from a `display' text property, use the buffer
6778 position of that property as if we actually saw that position in
6779 the row's glyphs.
697ba24b
EZ
6780 (move_it_by_lines): Remove the assertion that
6781 "it->current_x == 0 && it->hpos == 0" which can be legitimately
6782 violated when there's a before-string at the beginning of a line.
6783 (Bug#11063)
8427ddd2 6784
65a0a738
EZ
67852012-03-30 Eli Zaretskii <eliz@gnu.org>
6786
6787 * xdisp.c (append_space_for_newline): If the default face was
6788 remapped, use the remapped face for the appended newline.
6789 (extend_face_to_end_of_line): Use the remapped default face for
6790 extending the face to the end of the line.
6791 (display_line): Call extend_face_to_end_of_line when the default
6792 face was remapped. (Bug#11068)
6793
581355cc
EZ
67942012-03-29 Eli Zaretskii <eliz@gnu.org>
6795
6796 * s/ms-w32.h: Discourage from defining HAVE_GETCWD.
6797
e8fc049f
SM
67982012-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
6799
6800 * keyboard.c (safe_run_hooks_error): Don't unquote strings.
6801
4fb9a543
GM
68022012-03-27 Glenn Morris <rgm@gnu.org>
6803
6804 * search.c (Fword_search_backward_lax, Fword_search_forward_lax):
6805 Doc fixes.
6806
679910f1
KH
68072012-03-26 Kenichi Handa <handa@m17n.org>
6808
6809 * dispextern.h (struct glyph): Fix previous change. Change the
6810 bit length of glyphless.ch to 25 (Bug#11082).
6811
90d49b7f
CY
68122012-03-26 Chong Yidong <cyd@gnu.org>
6813
6814 * keyboard.c (Vselection_inhibit_update_commands): New variable.
6815 (command_loop_1): Use it; inhibit selection update for
6816 handle-select-window too (Bug#8996).
6817
f514f6f0
FP
68182012-03-25 Fabrice Popineau <fabrice.popineau@supelec.fr>
6819
e8fc049f 6820 * w32heap.c (_heap_init, _heap_term): Remove dead MSVC-specific code.
f514f6f0 6821
bf43fa51
KH
68222012-03-25 Kenichi Handa <handa@m17n.org>
6823
6824 * dispextern.h (struct glyph): Change the bit length of
6825 glyphless.ch to 22 to make the member glyphless fit in 32 bits.
6826
8a0c01dd
EZ
68272012-03-24 Eli Zaretskii <eliz@gnu.org>
6828
6829 * s/ms-w32.h (tzname): Include time.h before redirecting to
6830 _tzname. Fixes the MSVC build. (Bug#9960)
6831
7d1c3a76
AS
68322012-03-24 Andreas Schwab <schwab@linux-m68k.org>
6833
8ed79523
AS
6834 * xdisp.c (produce_glyphless_glyph): Limit length of acronym to 6
6835 characters.
6836
7d1c3a76
AS
6837 * xterm.c (XTread_socket): Only modify handling_signal if
6838 !SYNC_INPUT. (Bug#11080)
6839
e99a9b8b
EZ
68402012-03-23 Eli Zaretskii <eliz@gnu.org>
6841
6842 * bidi.c (bidi_fetch_char): Use STRING_CHAR_AND_LENGTH instead of
6843 FETCH_MULTIBYTE_CHAR followed by CHAR_BYTES. Prevents crashes
6844 when fetching a multibyte character consumes more bytes than
6845 CHAR_BYTES returns, due to unification of CJK characters in
6846 string_char. (Bug#11073)
6847
5063c0e1
TN
68482012-03-23 Troels Nielsen <bn.troels@gmail.com> (tiny change)
6849
6850 * process.c (wait_reading_process_output): Handle pty disconnect
6851 by refraining from sending oneself a SIGCHLD (bug#10933).
6852
9f851fbd
CY
68532012-03-22 Chong Yidong <cyd@gnu.org>
6854
6855 * dispextern.h (struct it): New member string_from_prefix_prop_p.
6856
5063c0e1 6857 * xdisp.c (push_prefix_prop): Rename from push_display_prop.
9f851fbd
CY
6858 Mark string as coming from a prefix property.
6859 (handle_face_prop): Use default face for prefix strings (Bug#4281).
6860 (pop_it, reseat_1): Save and restore string_from_prefix_prop_p.
6861
fb5b8aca
CY
68622012-03-21 Chong Yidong <cyd@gnu.org>
6863
6864 * xfaces.c (Vface_remapping_alist): Doc fix.
6865
62356a1b
EZ
68662012-03-20 Eli Zaretskii <eliz@gnu.org>
6867
6868 * w32proc.c (Fw32_set_console_codepage)
5063c0e1
TN
6869 (Fw32_set_console_output_codepage, Fw32_get_codepage_charset):
6870 Doc fixes.
62356a1b 6871
025de85b
CY
68722012-03-20 Chong Yidong <cyd@gnu.org>
6873
6874 * dispnew.c (Fredisplay, Vredisplay_preemption_period): Update doc
6875 to reflect default non-nil value of redisplay-dont-pause.
6876
4827f94e
KH
68772012-03-19 Kenichi Handa <handa@m17n.org>
6878
6879 * ftfont.c (ftfont_drive_otf): Mask bits of character code to make
6880 it fit in a valid range (Bug#11003).
6881
e50a24a2
EZ
68822012-03-18 Eli Zaretskii <eliz@gnu.org>
6883
6884 * xdisp.c (cursor_row_p): Even if the glyph row ends in a string
6885 that is not from display property, accept the row as a "cursor
6886 row" if one of the string's character has a non-nil `cursor'
6887 property. Fixes cursor positioning when there are newlines in
6888 overlay strings, e.g. in icomplete.el. (Bug#11035)
6889
9af5ed87
PE
68902012-03-12 Paul Eggert <eggert@cs.ucla.edu>
6891
6892 * buffer.c (compare_overlays): Don't assume args differ (Bug#6830).
6893
d1f55f16
CY
68942012-03-12 Chong Yidong <cyd@gnu.org>
6895
6896 * eval.c (inhibit_lisp_code): Rename from
6897 inhibit_window_configuration_change_hook; move from window.c.
6898
6899 * xfns.c (unwind_create_frame_1, Fx_create_frame):
6900 * window.c (run_window_configuration_change_hook)
6901 (syms_of_window): Callers changed.
6902
66c5eebd
CY
69032012-03-11 Chong Yidong <cyd@gnu.org>
6904
413df973
CY
6905 * keymap.c (Fkey_description): Doc fix (Bug#9700).
6906
66c5eebd
CY
6907 * editfns.c (Fconstrain_to_field): Doc fix (Bug#9452).
6908
1de11f56
CY
69092012-03-10 Chong Yidong <cyd@gnu.org>
6910
6911 * frame.c (other_visible_frames): Don't assume the selected frame
6912 is visible (Bug#10955).
6913
cae07000
SM
69142012-03-09 Stefan Monnier <monnier@iro.umontreal.ca>
6915
6916 * buffer.c (compare_overlays): Avoid qsort's instability (bug#6830).
6917
89c94350
JD
69182012-03-08 Jan Djärv <jan.h.d@swipnet.se>
6919
6920 * gtkutil.c (x_wm_set_size_hint): Use one row in call to
6921 FRAME_TEXT_LINES_TO_PIXEL_HEIGHT so base_height is greater than
6922 zero (Bug#10954).
6923
999dd333
GM
69242012-03-03 Glenn Morris <rgm@gnu.org>
6925
01a6dcc8 6926 * alloc.c (Fgarbage_collect, misc-objects-consed): Doc fixes.
999dd333 6927
de0100f2
EZ
69282012-03-02 Eli Zaretskii <eliz@gnu.org>
6929
6930 * xdisp.c (try_window_reusing_current_matrix): Don't move cursor
6931 position past the first glyph_row that ends at ZV. (Bug#10902)
b8456c5c
EZ
6932 (redisplay_window, next_element_from_string): Fix typos in
6933 comments.
3e441275
EZ
6934 (redisplay_window): Pass to move_it_vertically the margin in
6935 pixels, not in screen lines.
de0100f2 6936
96a72ee9
GM
69372012-03-02 Glenn Morris <rgm@gnu.org>
6938
6939 * buffer.c (buffer-list-update-hook): Doc fix.
6940
312508d7
EZ
69412012-02-29 Eli Zaretskii <eliz@gnu.org>
6942
6943 * xdisp.c (get_overlay_strings_1): Under bidi redisplay, call
6944 push_it before setting up the iterator for the first overlay
6945 string, even if we have an empty string loaded.
6946 (next_overlay_string): If there's an empty string on the iterator
6947 stack, pop the stack. (Bug#10903)
6948
27f3c637
PE
69492012-02-25 Paul Eggert <eggert@cs.ucla.edu>
6950
6951 Generalize fix for crash due to non-contiguous EMACS_INT (Bug#10780).
6952 Suggested by Stefan Monnier in
6953 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00692.html>.
6954 * alloc.c (widen_to_Lisp_Object): New static function.
6955 (mark_memory): Also mark Lisp_Objects by fetching pointer words
6956 and widening them to Lisp_Objects. This would work even if
6957 USE_LSB_TAG is defined and wide integers are used, which might
6958 happen in a future version of Emacs.
6959
3c9dfce6
CY
69602012-02-25 Chong Yidong <cyd@gnu.org>
6961
fa74b241
CY
6962 * fileio.c (Ffile_selinux_context, Fset_file_selinux_context):
6963 Doc fix.
6964
3c9dfce6
CY
6965 * xselect.c (Fx_selection_exists_p): Doc fix.
6966 (x_clipboard_manager_save_all): Print an informative message
6967 before saving to clipboard manager.
6968
9486df08
CY
69692012-02-24 Chong Yidong <cyd@gnu.org>
6970
6971 * keyboard.c (process_special_events): Handle all X selection
6972 requests in kbd_buffer, not just the next one (Bug#8869).
6973
f01d3321
CY
69742012-02-23 Chong Yidong <cyd@gnu.org>
6975
6976 * xfns.c (Fx_create_frame): Avoid window-configuration-change-hook
6977 call when setting menu-bar-lines and tool-bar-lines parameters.
6978 (unwind_create_frame_1): New helper function.
6979
6980 * window.c (inhibit_window_configuration_change_hook): New var.
6981 (run_window_configuration_change_hook): Obey it.
b2e4ca7d 6982 (syms_of_window): Initialize it.
f01d3321 6983
86b847b6
CY
69842012-02-22 Chong Yidong <cyd@gnu.org>
6985
6986 * xterm.c (x_draw_image_relief): Add missing type check for
6987 Vtool_bar_button_margin (Bug#10743).
6988
a59225b1
CY
69892012-02-21 Chong Yidong <cyd@gnu.org>
6990
6991 * fileio.c (Vfile_name_handler_alist): Doc fix.
6992
6993 * buffer.c (Fget_file_buffer): Protect against invalid file
6994 handler return value.
6995
310f5bd4
PE
69962012-02-20 Paul Eggert <eggert@cs.ucla.edu>
6997
cb3a28cc
PE
6998 * .gdbinit (xreload): Don't assume EMACS_INT fits in 'long'
6999 when computing $valmask.
7000
310f5bd4
PE
7001 Fix crash due to non-contiguous EMACS_INT (Bug#10780).
7002 * lisp.h (VALBITS): Move definition up, so that USE_LSB_TAG can use it.
7003 (USE_LSB_TAG): Do not define if UINTPTR_MAX >> VALBITS == 0.
7004 It's useless in that case, and it can cause problems on hosts
7005 that allocate halves of EMACS_INT values separately.
7006 Reported by Dan Horák. Diagnosed by Andreas Schwab in
7007 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=10780#30>.
7008 * mem-limits.h (EXCEEDS_LISP_PTR): Define to 0 on hosts where
7009 UINTPTR_MAX >> VALBITS == 0. This is required by the above change;
7010 it avoids undefined behavior on hosts where shifting right by more
7011 than the word width has undefined behavior.
7012
2375c96a
CY
70132012-02-19 Chong Yidong <cyd@gnu.org>
7014
7015 * fileio.c (Ffile_name_directory, Ffile_name_nondirectory)
7016 (Funhandled_file_name_directory, Ffile_name_as_directory)
7017 (Fdirectory_file_name, Fexpand_file_name)
7018 (Fsubstitute_in_file_name): Protect against invalid file handler
7019 return values (Bug#10845).
7020
3eb49e71
EZ
70212012-02-18 Eli Zaretskii <eliz@gnu.org>
7022
7023 * .gdbinit (pitx): Fix incorrect references to fields of the
7024 iterator stack.
7025
7b926f3f
CY
70262012-02-17 Chong Yidong <cyd@gnu.org>
7027
7028 * syntax.c (Fscan_lists): Doc fix (Bug#10833).
7029
11273115
PE
70302012-02-15 Paul Eggert <eggert@cs.ucla.edu>
7031
7032 * image.c (MAX_IMAGE_SIZE): Increase from 6.0 to 10.0; see
7033 <http://lists.gnu.org/archive/html/emacs-devel/2012-02/msg00540.html>.
7034
c3a70e2b
CY
70352012-02-15 Chong Yidong <cyd@gnu.org>
7036
7037 * eval.c (Fdefvar, Fdefconst): Doc fix; note that the variable is
7038 marked as special. Also, starting docstrings with * is obsolete.
7039
0ca43699
AS
70402012-02-13 Andreas Schwab <schwab@linux-m68k.org>
7041
7042 * gnutls.c (emacs_gnutls_write): Fix last change.
7043
2e8f3c56
LI
70442012-02-13 Lars Ingebrigtsen <larsi@gnus.org>
7045
7046 * gnutls.c (emacs_gnutls_write): Set errno appropriately for
7047 send_process.
7048
af70074f
SM
70492012-02-13 Stefan Monnier <monnier@iro.umontreal.ca>
7050
7051 * keymap.c (Fsingle_key_description): Handle char ranges.
7052
95986d52
CY
70532012-02-12 Chong Yidong <cyd@gnu.org>
7054
afd83bd1
CY
7055 * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
7056 as that creates a dangerous corner case.
7057
95986d52
CY
7058 * window.c (Fdelete_window_internal): Invalidate the mouse
7059 highlight (Bug#9904).
7060
bd7da63e
GM
70612012-02-12 Glenn Morris <rgm@gnu.org>
7062
7063 * xselect.c (Fx_own_selection_internal)
7064 (Fx_get_selection_internal, Fx_disown_selection_internal)
7065 (Fx_selection_owner_p, Fx_selection_exists_p): Doc fixes.
7066 * nsselect.m (Fx_own_selection_internal)
7067 (Fx_disown_selection_internal, Fx_selection_exists_p)
7068 (Fx_selection_owner_p, Fx_get_selection_internal):
7069 Sync docs and argument specs with the xselect.c versions.
7070
77abcbc2
LI
70712012-02-11 Lars Ingebrigtsen <larsi@gnus.org>
7072
7073 * gnutls.c (emacs_gnutls_write): Don't infloop if sendto fails.
7074
90b671e2
EZ
70752012-02-11 Eli Zaretskii <eliz@gnu.org>
7076
1c0ca0b7
EZ
7077 * w32select.c (Fx_selection_exists_p): Sync doc string and
7078 argument list with xselect.c. (Bug#10783)
7079
7080 * w16select.c (Fx_selection_exists_p): Sync doc string and
7081 argument list with xselect.c. (Bug#10783)
90b671e2 7082
49241268
GM
70832012-02-10 Glenn Morris <rgm@gnu.org>
7084
7085 * fns.c (Fsecure_hash): Doc fix.
7086
f998bbe7 70872012-02-09 Kenichi Handa <handa@m17n.org>
5c1ca13d
KH
7088
7089 * coding.c (produce_chars): Fix updating of src_end (Bug#10701).
7090
0992bd9c
CY
70912012-02-07 Chong Yidong <cyd@gnu.org>
7092
7093 * buffer.c (Fbuffer_local_variables)
7094 (buffer_lisp_local_variables): Handle unbound vars correctly;
7095 don't let Qunbound leak into Lisp.
7096
af008560
GM
70972012-02-07 Glenn Morris <rgm@gnu.org>
7098
dd605cc4
GM
7099 * image.c (Fimagemagick_types): Doc fix.
7100
af008560
GM
7101 * image.c (imagemagick-render-type): Change it from a lisp object
7102 to an integer. Move the doc here from the lisp manual.
7103 Treat all values not equal to 0 the same.
7104
1449fa1d
CY
71052012-02-06 Chong Yidong <cyd@gnu.org>
7106
7107 * doc.c (store_function_docstring): Avoid applying docstring of
7108 alias to base function (Bug#2603).
7109
3723ec07
AS
71102012-02-04 Andreas Schwab <schwab@linux-m68k.org>
7111
7112 * .gdbinit (pp1, pv1): Remove redundant defines.
7113 (pr): Use pp.
7114
79c1cc1e
CY
71152012-02-04 Chong Yidong <cyd@gnu.org>
7116
7117 * nsterm.m: Declare a global (Bug#10694).
7118
d7f29f8e
EZ
71192012-02-04 Eli Zaretskii <eliz@gnu.org>
7120
cae07000
SM
7121 * w32.c (get_emacs_configuration_options):
7122 Include --enable-checking, if specified, in the return value.
d7f29f8e 7123
3b95a6f9
MR
71242012-02-04 Martin Rudalics <rudalics@gmx.at>
7125
7126 * dispnew.c (change_frame_size_1): Calculate new_frame_total_cols
7127 after rounding frame sizes. (Bug#9723)
7128
d6fa96a6
EZ
71292012-02-04 Eli Zaretskii <eliz@gnu.org>
7130
7131 * keyboard.c (adjust_point_for_property): Don't position point
7132 before BEGV. (Bug#10696)
7133
df0b2940
PE
71342012-02-03 Paul Eggert <eggert@cs.ucla.edu>
7135
7136 Handle overflow when computing char display width (Bug#9496).
7137 * character.c (char_width): Return EMACS_INT, not int.
7138 (char_width, c_string_width): Check for overflow when
7139 computing the width; this is possible now that individual
7140 characters can have unbounded width. Problem introduced
7141 by merge from Emacs 23 on 2012-01-19.
7142
6bee44d6
MA
71432012-02-02 Michael Albinus <michael.albinus@gmx.de>
7144
7145 * dbusbind.c (Fdbus_register_method): Mention the return value
7146 :ignore in the docstring.
7147
44f92739
GM
71482012-02-02 Glenn Morris <rgm@gnu.org>
7149
1b9f60cc
GM
7150 * callproc.c (Fcall_process, Fcall_process_region): Doc fix.
7151
44f92739
GM
7152 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7153 Unconditionally set to t. (Bug#10673)
7154 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
7155 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
7156 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Doc fix.
7157
c5d3843c
KH
71582012-02-02 Kenichi Handa <handa@m17n.org>
7159
7160 (x_produce_glyphs): Cancel previous change. If cmp->glyph_len is
7161 0, do not call append_composite_glyph.
7162
159462d4 71632012-02-02 Kenichi Handa <handa@m17n.org>
d2a51fd7
KH
7164
7165 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING): Initialize first_s to
7166 NULL (Bug#6988).
7167 (x_produce_glyphs): If the component of a composition is a null
7168 string, set it->pixel_width to 1 to avoid zero-width glyph.
7169
78cef877
EZ
71702012-02-01 Eli Zaretskii <eliz@gnu.org>
7171
7172 * ralloc.c (resize_bloc, r_alloc_sbrk): Don't call memmove if its
7173 first 2 arguments are identical. This makes inserting large
7174 output from a subprocess an order of magnitude faster on
7175 MS-Windows, where all sbrk'ed memory is always contiguous.
7176
97897668
GM
71772012-01-31 Glenn Morris <rgm@gnu.org>
7178
7179 * nsterm.m (syms_of_nsterm) <x-toolkit-scroll-bars>:
c78c6e0b 7180 * w32term.c (syms_of_w32term) <x-toolkit-scroll-bars>:
97897668
GM
7181 * xterm.c (syms_of_xterm) <x-toolkit-scroll-bars>: Sync docs.
7182
31fd3586
GM
71832012-01-29 Glenn Morris <rgm@gnu.org>
7184
7185 * gnutls.c (syms_of_gnutls): More doc (from etc/NEWS).
7186
0e24a8b2
CY
71872012-01-28 Samuel Thibault <sthibault@debian.org> (tiny change)
7188
7189 * s/gnu.h: Define POSIX_SIGNALS (Bug#10552).
7190
cc0adcb0
CY
71912012-01-28 Chong Yidong <cyd@gnu.org>
7192
7193 * minibuf.c (syms_of_minibuf): Doc fix (Bug#10550).
7194
acc28cb9
CY
71952012-01-26 Chong Yidong <cyd@gnu.org>
7196
9c69cfb7
CY
7197 * keyboard.c (Vecho_keystrokes): Document zero value (Bug#10503).
7198
acc28cb9
CY
7199 * search.c (Fsearch_forward, Fsearch_backward): Document negative
7200 repeat counts (Bug#10507).
7201
48da7392
GM
72022012-01-26 Glenn Morris <rgm@gnu.org>
7203
7204 * lread.c (syms_of_lread): Doc fix.
7205
14af5f7f
CY
72062012-01-25 HIROSHI OOTA <nil@mad.dog.cx> (tiny change)
7207
7208 * coding.c (encode_designation_at_bol): Change return value to
7209 EMACS_INT.
7210
0b21c100
CY
72112012-01-25 Chong Yidong <cyd@gnu.org>
7212
7213 * eval.c (Fuser_variable_p): Doc fix; mention custom-variable-p.
7214
3c2907f7
CY
72152012-01-21 Chong Yidong <cyd@gnu.org>
7216
7217 * floatfns.c (Fcopysign): Make the second argument non-optional,
7218 since nil is not allowed anyway.
7219
959ad23f
AS
72202012-01-21 Andreas Schwab <schwab@linux-m68k.org>
7221
7222 * process.c (read_process_output): Use p instead of XPROCESS (proc).
7223 (send_process): Likewise.
7224
34a02f46
MR
72252012-01-19 Martin Rudalics <rudalics@gmx.at>
7226
7227 * window.c (save_window_save, Fcurrent_window_configuration)
cae07000
SM
7228 (Vwindow_persistent_parameters): Do not use Qstate.
7229 Rewrite doc-strings.
34a02f46 7230
1259009a 72312012-01-19 Kenichi Handa <handa@m17n.org>
25ed9e61
KH
7232
7233 * character.c (char_width): New function.
70d4fdf6
GM
7234 (Fchar_width, c_string_width, lisp_string_width):
7235 Use char_width (Bug#9496).
25ed9e61 7236
6a6ee00d
MR
72372012-01-16 Martin Rudalics <rudalics@gmx.at>
7238
7239 * window.c (Vwindow_persistent_parameters): New variable.
7240 (Fset_window_configuration, save_window_save): Handle persistent
7241 window parameters.
7242
c85efaf7
EZ
72432012-01-14 Eli Zaretskii <eliz@gnu.org>
7244
7245 * w32fns.c (signal_user_input): Don't do a QUIT, to avoid
7246 thrashing the stack of the thread. (Bug#9087)
7247
5944709e
PE
72482012-01-12 Paul Eggert <eggert@cs.ucla.edu>
7249
7250 * xdisp.c (rows_from_pos_range): Add parens as per gcc -Wparentheses.
7251
e71f5d99
EZ
72522012-01-11 Eli Zaretskii <eliz@gnu.org>
7253
7254 * xdisp.c (rows_from_pos_range): Handle the case where the
7255 highlight ends on a newline. (Bug#10464)
7256 (mouse_face_from_buffer_pos): Fix off-by-one error in calculating
7257 he end column for display of highlight that ends on a newline
7258 before a R2L line.
7259
ce316182
GM
72602012-01-11 Glenn Morris <rgm@gnu.org>
7261
7262 * lread.c (init_lread): If no-site-lisp, remove site-lisp dirs
7263 from load-path also when installation-directory is nil. (Bug#10208)
7264
5b43da69
GM
72652012-01-10 Glenn Morris <rgm@gnu.org>
7266
74cc8ff9
GM
7267 * emacs.c (syms_of_emacs) <installation-directory>: Doc fix.
7268
7d8d6e4e
GM
7269 * epaths.in (PATH_LOADSEARCH, PATH_EXEC, PATH_DATA, PATH_DOC):
7270 Update template values to be closer to their typical values these days.
5b43da69 7271
a0db8d43
EZ
72722012-01-09 Eli Zaretskii <eliz@gnu.org>
7273
7274 * xdisp.c (rows_from_pos_range): Accept additional argument
7275 DISP_STRING, and accept any glyph in a row whose object is that
7276 string as eligible for mouse highlight. Fixes mouse highlight of
7277 display strings from overlays. (Bug#10464)
7278
9a0115ab 72792012-01-07 Paul Eggert <eggert@cs.ucla.edu>
09450bae 7280
b9110d6a 7281 emacs: fix an auto-save permissions race condition (Bug#10400)
09450bae
PE
7282 * fileio.c (auto_saving_dir_umask): New static var.
7283 (Fmake_directory_internal): Use it.
7284 (do_auto_save_make_dir): Set it, instead of invoking chmod after
7285 creating the directory. The old code temporarily assigns
7286 too-generous permissions to the directory.
7287 (do_auto_save_eh): Clear it.
b9110d6a 7288 (Fdo_auto_save): Catch all errors, not just file errors, so
09450bae
PE
7289 that the var is always cleared.
7290
6c1bd3f3
EZ
72912012-01-07 Eli Zaretskii <eliz@gnu.org>
7292
7293 * search.c (scan_buffer): Pass character positions to
7294 know_region_cache, not byte positions. (Bug#6540)
7295
069d2b50
L
72962012-01-07 LynX <_LynX@bk.ru> (tiny change)
7297
7298 * w32.c (sys_rename): Report EXDEV when rename of a directory
7299 fails because the target is on another logical disk. (Bug#10284)
7300
75bf0d33
DB
73012012-01-07 David Benjamin <davidben@mit.edu> (tiny change)
7302
7303 * xterm.c (x_embed_request_focus): New function.
7304
7305 * xterm.h: Add prototype.
7306
7307 * xfns.c (Fx_focus_frame): Use it for embedded frames (Bug#9977).
7308
1c6e5a32
GM
73092012-01-05 Glenn Morris <rgm@gnu.org>
7310
7311 * emacs.c (emacs_copyright): Update short copyright year to 2012.
7312
651e947e
EZ
73132012-01-01 Eli Zaretskii <eliz@gnu.org>
7314
7315 * gnutls.c (init_gnutls_functions): Load gnutls_check_version.
7316 Load gnutls_transport_set_lowat only if GnuTLS version is below
7317 2.11.1.
7318 (emacs_gnutls_handshake): Call gnutls_transport_set_lowat only for
7319 GnuTLS versions below 2.11.1.
7320
3778cdd8
AL
73212011-12-31 Antoine Levitt <antoine.levitt@gmail.com>
7322
7323 * xdisp.c (syms_of_xdisp) <window-scroll-functions>: Add warning
7324 to the doc string advising against its use for altering the way
7325 windows are scrolled.
7326
0e5317f7
KH
73272011-12-28 Kenichi Handa <handa@m17n.org>
7328
7329 * coding.c (Fdefine_coding_system_internal): Make an utf-8 base
7330 coding-system ASCII compatible only when it does not produce BOM
7331 on encoding (Bug#10383).
7332
93d5ca1f
JD
73332011-12-26 Jan Djärv <jan.h.d@swipnet.se>
7334
7335 * xmenu.c (x_menu_wait_for_event): Use xg_select for Gtk3 so menus
7336 can scroll.
7337 (create_and_show_popup_menu): Always use menu_position_func for
7338 Gtk3 (Bug#10361).
7339
ca22b785
AS
73402011-12-24 Andreas Schwab <schwab@linux-m68k.org>
7341
7342 * callint.c (Fcall_interactively): Don't truncate prompt string.
7343
d048e1e6
EZ
73442011-12-23 Eli Zaretskii <eliz@gnu.org>
7345
7346 * xdisp.c (handle_invisible_prop): Handle correctly an invisible
7347 property that ends at ZV, so that the bidi iteration could be
3ba1a2ad 7348 resumed from there (after widening). (Bug#10360)
d048e1e6 7349
5ccaba1f
JD
73502011-12-22 Jan Djärv <jan.h.d@swipnet.se>
7351
7352 * nsfont.m (ns_spec_to_descriptor): Do not autorelease fdesc.
7353
204ee57f
JD
73542011-12-21 Jan Djärv <jan.h.d@swipnet.se>
7355
b81d40f0
JB
7356 * nsterm.m (x_free_frame_resources):
7357 Release f->output_data.ns->miniimage.
204ee57f
JD
7358 (ns_index_color): Fix indentation. Do not retain
7359 color_table->colors[i].
7360
7361 * nsmenu.m (ns_update_menubar): Call free_menubar_widget_value_tree
7362 before returning.
7363
7364 * nsfns.m (x_set_background_color): Assign return value from
7365 ns_index_color to face-background instead of NSColor*.
7366 (ns_implicitly_set_icon_type): Fix indentation.
7367 Change assignment in for loop to comparison.
7368
7369 * emacs.c (ns_pool): New variable.
7370 (main): Assign ns_pool.
7371 (Fkill_emacs): Call ns_release_autorelease_pool.
7372
7373 * nsfont.m (ns_spec_to_descriptor): Fix indentation,
7374 autorelease fdesc, release fdAttrs and tdict.
7375 (ns_get_covering_families): Release charset.
7376 (ns_findfonts): Release NSFontDescriptor created with new.
7377 (ns_uni_to_glyphs): Fix indentation.
7378 (setString): Release attrStr before assigning new value.
7379
c803b2b7
JD
73802011-12-18 Jan Djärv <jan.h.d@swipnet.se>
7381
678f4426
JD
7382 * nsmenu.m (NSMenuDidBeginTrackingNotification): Declare if OSX < 10.5
7383 and NS_IMPL_COCOA.
7384 (trackingNotification): Surround with ifdef NS_IMPL_COCOA.
7385 (syms_of_nsmenu): Set trackingMenu to 1 if not NS_IMPL_COCOA.
7386
cd394be1 73872011-12-18 David Reitter <reitter@cmu.edu>
678f4426 7388
5fecd5fc
JD
7389 * nsterm.m (ns_term_init): Subscribe for notifications
7390 NSMenuDidBeginTrackingNotification and NSMenuDidEndTrackingNotification
7391 to method trackingNotification in EmacsMenu.
7392
7393 * nsmenu.m (trackingMenu): New variable.
3771cb17 7394 (trackingNotification): New method (from Aquamacs).
5fecd5fc 7395 (menuNeedsUpdate): Expand comment and return if trackingMenu is 0,
3771cb17 7396 from Aquamacs (Bug#7030).
678f4426
JD
7397
73982011-12-18 Jan Djärv <jan.h.d@swipnet.se>
5fecd5fc 7399
c803b2b7
JD
7400 * nsselect.m (CUT_BUFFER_SUPPORT): Remove define.
7401 (symbol_to_nsstring): Fix indentation.
7402 (ns_symbol_to_pb): New function.
cae07000
SM
7403 (Fns_get_selection_internal): Rename from Fns_get_cut_buffer_internal.
7404 (Fns_rotate_cut_buffers_internal): Remove.
7405 (Fns_store_selection_internal): Rename from
c803b2b7
JD
7406 Fns_store_cut_buffer_internal.
7407 (ns_get_foreign_selection, Fx_own_selection_internal)
7408 (Fx_disown_selection_internal, Fx_selection_exists_p)
b81d40f0
JB
7409 (Fns_get_selection_internal, Fns_store_selection_internal):
7410 Use ns_symbol_to_pb and check if return value is nil.
7411 (syms_of_nsselect): Remove ifdef CUT_BUFFER_SUPPORT. Remove defsubr
7412 Sns_rotate_cut_buffers_internal. Sns_get_cut_buffer_internal
c803b2b7
JD
7413 renamed to Sns_get_selection_internal, Sns_store_cut_buffer_internal
7414 renamed to Sns_store_selection_internal.
7415 (ns_handle_selection_request): Move code to Fx_own_selection_internal
7416 and remove this function.
7417 (ns_handle_selection_clear): Remove, never used.
7418 (Fx_own_selection_internal): Move code from ns_handle_selection_request
7419 here.
7420
e1b01a3a
KB
74212011-12-17 Ken Brown <kbrown@cornell.edu>
7422
7423 * fileio.c (check_writable) [CYGWIN]: Return non-zero if UID or
7424 GID is unknown (Bug#10257).
7425
2adb6e85
PE
74262011-12-17 Paul Eggert <eggert@cs.ucla.edu>
7427
7428 * s/gnu-linux.h: Fix mark_memory typo (Bug#10286).
7429 (GC_MARK_SECONDARY_STACK): Omit removed 3rd arg to mark_memory,
7430 which caused a build failure on GNU/Linux IA-64. This problem was
7431 introduced by my 2011-10-07 patch.
7432
d1d7b339
JL
74332011-12-15 Juri Linkov <juri@jurta.org>
7434
7435 * image.c (imagemagick_error): New function. (Bug#10112)
7436 (imagemagick_load_image): Comment out `MagickSetResolution' call.
7437 Use `imagemagick_error' where ImageMagick functions return
7438 `MagickFalse'.
7439 (Fimagemagick_types): Add `Fnreverse' to return the list in the
7440 proper order.
7441
100d5755
KH
74422011-12-15 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7443
7444 * xftfont.c (xftfont_draw): Use the font metrics of s->font to
7445 fill background (Bug#8992).
7446
454592a6
MR
74472011-12-13 Martin Rudalics <rudalics@gmx.at>
7448
7449 * window.c (Vwindow_combination_resize)
7450 (Vwindow_combination_limit): Use t instead of non-nil in
7451 doc-strings.
61d4b438
MR
7452 (Vrecenter_redisplay): Add first sentence of doc-string on
7453 separate line.
53524d93 7454 (Frecenter): Fix doc-string typo.
454592a6 7455
3633e3aa
KH
74562011-12-11 Kenichi Handa <handa@m17n.org>
7457
7458 * coding.c (Funencodable_char_position): Pay attention to the
7459 buffer text relocation (Bug#9389).
7460
7b9d523a 74612011-12-10 Jan Djärv <jan.h.d@swipnet.se>
61ccba97 7462
7b9d523a
JD
7463 * xterm.c (x_term_init): Move call to gdk_window_add_filter before
7464 gtk_init (Bug#10100).
7465
b73189c6
EZ
74662011-12-10 Eli Zaretskii <eliz@gnu.org>
7467
7468 * xdisp.c (RECORD_MAX_MIN_POS): Use IT->cmp_it.charpos only if
7469 IT->string is nil. (Bug#10263)
7470
f7dfe5d6
JD
74712011-12-10 Jan Djärv <jan.h.d@swipnet.se>
7472
83faebb4
JD
7473 * nsterm.h (x_free_frame_resources): Declare.
7474
f7dfe5d6
JD
7475 * nsfns.m (ns_get_defaults_value): New function (Bug#10103).
7476 (Fns_get_resource, x_get_string_resource): Call ns_get_defaults_value.
7477
7478 * nsterm.h (ns_get_defaults_value): Declare.
7479
7480 * nsterm.m (ns_default): Call ns_get_defaults_value.
7481
7cd4e72c
EZ
74822011-12-09 Eli Zaretskii <eliz@gnu.org>
7483
7484 * xdisp.c (try_scrolling): Don't set scroll_down_p if dy is zero.
7485 (Bug#10170)
7486
b34d7317
YM
74872011-12-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7488
7489 * unexelf.c (unexec) [NS_IMPL_GNUSTEP]: Take account of the case
7490 that where the value of an _OBJC_* symbol points to is in the .bss
7491 section (Bug#10240).
7492
76470ad1
KH
74932011-12-08 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7494
7495 * coding.c (encode_coding_ccl): Check (charbuf < charbuf_end)
2fac8180 7496 after the loop to call ccl_driver at least once (Bug#8619).
76470ad1 7497
745fff94
KH
74982011-12-08 Kenichi Handa <handa@m17n.org>
7499
7500 * ftfont.c (get_adstyle_property): Fix previous change
7501 (Bug#10233).
7502
6e44397c
JB
75032011-12-07 Juanma Barranquero <lekktu@gmail.com>
7504
7505 * w32.c (init_environment): If no_site_lisp, remove site-lisp
7506 dirs from the default value of EMACSLOADPATH (bug#10208).
7507
7efa6272
GM
75082011-12-07 Glenn Morris <rgm@gnu.org>
7509
7510 * lread.c (init_lread): If no_site_lisp, exclude site-lisp/ in
7511 installation and source directories as well. (Bug#10208)
7512
f6fc4d87
CY
75132011-12-06 Chong Yidong <cyd@gnu.org>
7514
7515 * minibuf.c (Fread_from_minibuffer): Doc fix (Bug#10228).
7516
2bf26180
GM
75172011-12-06 Glenn Morris <rgm@gnu.org>
7518
7519 * process.c (start_process_unwind): Treat any pid <= 0, except -2,
7520 as an error, not just -1. (Bug#10217)
7521
3a6ad4f0
CY
75222011-12-05 Chong Yidong <cyd@gnu.org>
7523
7524 * keyboard.c (process_special_events): New function.
7525 (swallow_events, Finput_pending_p): Use it (Bug#10195).
7526
75a3b399
PE
75272011-12-05 Paul Eggert <eggert@cs.ucla.edu>
7528
7529 * coding.c (encode_designation_at_bol): Don't use uninitialized
7530 local variable (Bug#9318).
7531
c3c9e25e
KH
75322011-12-05 Kenichi Handa <handa@m17n.org>
7533
7534 * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
7535 return Qnil (Bug#8046, Bug#10193).
7536
5eb05ea3
KH
75372011-12-05 Kenichi Handa <handa@m17n.org>
7538
7539 * coding.c (encode_designation_at_bol): New args charbuf_end and
7540 dst. Return the number of produced bytes. Callers changed.
a79703f5
KH
7541 (coding_set_source): Return how many bytes coding->source was
7542 relocated.
7543 (coding_set_destination): Return how many bytes
7544 coding->destination was relocated.
7545 (CODING_DECODE_CHAR, CODING_ENCODE_CHAR, CODING_CHAR_CHARSET)
cae07000 7546 (CODING_CHAR_CHARSET_P): Adjust for the avove changes.
5eb05ea3
KH
7547
75482011-12-05 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
7549
7550 * coding.c (CODING_CHAR_CHARSET_P): New macro.
7551 (encode_coding_emacs_mule, encode_coding_iso_2022): Use the above
7552 macro (Bug#9318).
7553
75542011-12-05 Andreas Schwab <schwab@linux-m68k.org>
7555
7556 The following changes are to fix Bug#9318.
7557
a79703f5 7558 * coding.c (CODING_ENCODE_CHAR, CODING_CHAR_CHARSET): New macros.
5eb05ea3
KH
7559 (encode_coding_emacs_mule, ENCODE_ISO_CHARACTER)
7560 (encode_coding_iso_2022, encode_coding_sjis)
a79703f5 7561 (encode_coding_big5, encode_coding_charset): Use the above macros.
5eb05ea3 7562
7dbda6df
JB
75632011-12-05 Juanma Barranquero <lekktu@gmail.com>
7564
7565 * lisp.h (process_quit_flag): Fix external declaration.
7566
6d5eb5b0
SM
75672011-12-04 Stefan Monnier <monnier@iro.umontreal.ca>
7568
7569 Don't macro-inline non-performance-critical code.
7570 * eval.c (process_quit_flag): New function.
7571 * lisp.h (QUIT): Use it.
7572
a0c3fad0
JD
75732011-12-04 Jan Djärv <jan.h.d@swipnet.se>
7574
7575 * nsfns.m (get_geometry_from_preferences): New function.
7576 (Fx_create_frame): Call get_geometry_from_preferences (Bug#10103).
7577
6c07aac2
AS
75782011-12-04 Andreas Schwab <schwab@linux-m68k.org>
7579
7580 * emacs.c (Qkill_emacs): Define.
7581 (syms_of_emacs): Initialize it.
7582 * keyboard.c (interrupt_signal): Don't call Fkill_emacs here, set
7583 Qquit_flag to `kill-emacs' instead.
6d5eb5b0
SM
7584 (quit_throw_to_read_char): Add parameter `from_signal'.
7585 All callers changed. Call Fkill_emacs if requested and safe.
6c07aac2
AS
7586 * lisp.h (QUIT): Call Fkill_emacs if requested.
7587
c052ead4
JD
75882011-12-03 Jan Djärv <jan.h.d@swipnet.se>
7589
7590 * widget.c (update_wm_hints): Return if wmshell is null.
7591 (widget_update_wm_size_hints): New function.
7592
7593 * widget.h (widget_update_wm_size_hints): Declare.
7594
7595 * xterm.c (x_wm_set_size_hint): If USE_X_TOOLKIT, call
7596 widget_update_wm_size_hints (Bug#10104).
7597
9e49252b
EZ
75982011-12-03 Eli Zaretskii <eliz@gnu.org>
7599
7600 * xdisp.c (handle_invisible_prop): If the invisible text ends just
7601 before a newline, prepare the bidi iterator for consuming the
7602 newline, and keep the current paragraph direction. (Bug#10183)
e9a49426 7603 (redisplay_window): Don't let `margin' become negative. (Bug#10192)
9e49252b 7604
02b16839
JL
76052011-12-02 Juri Linkov <juri@jurta.org>
7606
7607 * search.c (Fword_search_regexp): New Lisp function created from
7608 `wordify'. Change type of arg `lax' from `int' to `Lisp_Object'.
7609 (Fword_search_backward, Fword_search_forward)
7610 (Fword_search_backward_lax, Fword_search_forward_lax):
7611 Use `Fword_search_regexp' instead of `wordify'. Doc fix.
7612 (syms_of_search): Define `Sword_search_regexp'. (Bug#10145)
7613
0068070e
SM
76142011-12-01 Stefan Monnier <monnier@iro.umontreal.ca>
7615
7616 * fileio.c (Finsert_file_contents): Move after-change-function call
7617 to before the "handled:" label, since all "goto handled" appear in
7618 cases where the *-change-functions have already been properly called
7619 (bug#10117).
7620
3360a3fc
AS
76212011-12-01 Andreas Schwab <schwab@linux-m68k.org>
7622
7623 * keyboard.c (interrupt_signal): Don't call kill-emacs when
7624 waiting for input. (Bug#10169)
7625
73d6c093
EZ
76262011-11-30 Eli Zaretskii <eliz@gnu.org>
7627
7628 * dispnew.c (adjust_glyph_matrix): Remove the assertion that
7629 verifies glyph row's hash code--we have just reallocated the
7630 glyphs, so their contents can be complete garbage. (Bug#10164)
7631
febe6bea
JB
76322011-11-30 Juanma Barranquero <lekktu@gmail.com>
7633
7634 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Add missing check.
7635
801a4313
EZ
76362011-11-30 Eli Zaretskii <eliz@gnu.org>
7637
7638 * dispnew.c (adjust_glyph_matrix) [XASSERTS]: Ensure ROW's
7639 attributes are tested _before_ calling verify_row_hash, to protect
7640 against GCC re-ordering of the tests. (Bug#10164)
7641
2b56b87e
JD
76422011-11-29 Jan Djärv <jan.h.d@swipnet.se>
7643
7644 * xterm.h (struct x_output): net_wm_state_hidden_seen is new.
7645
7646 * xterm.c (handle_one_xevent): Only set async_visible and friends
7647 if net_wm_state_hidden_seen is non-zero (Bug#10002)
7dbda6df 7648 (get_current_wm_state): Set net_wm_state_hidden_seen to 1 if
2b56b87e
JD
7649 _NET_WM_STATE_HIDDEN is in NET_WM_STATE.
7650
dbf31225
PE
76512011-11-28 Paul Eggert <eggert@cs.ucla.edu>
7652
7653 Remove GCPRO-related macros that exist only to avoid shadowing locals.
7654 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR)
7655 (GCPRO6_VAR, UNGCPRO_VAR): Remove. See
7656 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7657 All uses changed to use GCPRO1 etc.
7658 (GCPRO1, GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6, UNGCPRO):
7659 Revert to old implementation (i.e., before 2011-03-11).
7660
1305621b
YM
76612011-11-28 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7662
7663 * dispnew.c (scrolling_window): Truncate overlaps in copy destination
7664 of scroll runs so as to avoid assigning disabled bogus rows and
7665 unnecessary graphics copy operations.
7666
8c9afb46
EZ
76672011-11-27 Eli Zaretskii <eliz@gnu.org>
7668
7669 * s/ms-w32.h (utimbuf) [_MSC_VER]: Don't define.
7670 (snprintf) [_MSC_VER]: Redirect to _snprintf.
7671 (strtoll) [_MSC_VER]: Redirect to _strtoi64.
7672 (malloc, free, realloc, calloc): Redirect to e_* only when
7673 compiling Emacs.
7674
7675 * lisp.h (GCTYPEBITS): Move before first use.
7676 (ALIGN_GCTYPEBITS) [_MSC_VER]: Define.
7677 (DECL_ALIGN) [_MSC_VER]: Use it, as MSVC doesn't like bit ops in
7678 this macro definition.
7679
7680 * s/ms-w32.h (tzname): Redirect to _tzname for all values of
7681 _MSC_VER.
7682
54e9e3bf
JD
76832011-11-27 Jan Djärv <jan.h.d@swipnet.se>
7684
6d5eb5b0
SM
7685 * gtkutil.c (xg_create_frame_widgets):
7686 Call gtk_window_set_has_resize_grip (FALSE) if that function is
54e9e3bf
JD
7687 present with Gtk+ 2.0.
7688
83aca1cb
PE
76892011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7690
7691 * fileio.c (Finsert_file_contents): Undo previous change; see
7692 <http://lists.gnu.org/archive/html/emacs-diffs/2011-11/msg00265.html>.
7693
5b76caa4
PE
76942011-11-26 Paul Eggert <eggert@cs.ucla.edu>
7695
7696 Rename locals to avoid shadowing.
7697 * fileio.c (Finsert_file_contents):
7698 Rename inner 'gcpro1' to 'inner_gcpro1' to avoid shadowing.
7699 * process.c (wait_reading_process_output):
7700 Rename inner 'proc' to 'p' to avoid shadowing.
7701 Indent for consistency with usual Emacs style.
7702
8c535114
EZ
77032011-11-25 Eli Zaretskii <eliz@gnu.org>
7704
7705 * xdisp.c (redisplay_window): If cursor row is not fully visible
7706 after recentering, and scroll-conservatively is set to a large
7707 number, scroll window by a few more lines to make the cursor fully
7708 visible and out of scroll-margin. (Bug#10105)
91b4a718
EZ
7709 (start_display): Don't move to the next line if the display should
7710 start at a newline that is part of a display vector or an overlay
7711 string. (Bug#10119)
8c535114 7712
fa4fdb5c
JL
77132011-11-24 Juri Linkov <juri@jurta.org>
7714
7715 * image.c (imagemagick_load_image): Move `MagickSetResolution' down
7716 after the `MagickPingImage' call. (Bug#10112)
7717
90ec88df
CY
77182011-11-23 Chong Yidong <cyd@gnu.org>
7719
7720 * window.c (Fcoordinates_in_window_p): Accept only live windows.
7721
56e2e794
MR
77222011-11-23 Martin Rudalics <rudalics@gmx.at>
7723
7724 * buffer.c (Fkill_buffer): Run replace_buffer_in_windows before
7725 making another buffer current. (Bug#10114)
7726
b6e64c41
GM
77272011-11-23 Glenn Morris <rgm@gnu.org>
7728
7729 * font.c (font_find_for_lface) [HAVE_NS]: Ignore case. (Bug#2526)
7730
6b21de18
CY
77312011-11-23 Chong Yidong <cyd@gnu.org>
7732
7733 * xdisp.c (compute_stop_pos): Check validity of end_charpos before
7734 using it (Bug#5984).
7735
b12cd789
EZ
77362011-11-22 Eli Zaretskii <eliz@gnu.org>
7737
7738 * dispnew.c (adjust_glyph_matrix): Don't verify hash code of mode-
7739 and header-lines, as they don't have one computed for them.
7740 (Bug#10098)
7741
7742 * .gdbinit (prow): Make displayed values more self-explaining.
7743 Add row's hash code.
7744
261b6fd4
LMI
77452011-11-21 Lars Magne Ingebrigtsen <larsi@gnus.org>
7746
7747 * process.c (wait_reading_process_output): Fix asynchrounous
7748 GnuTLS socket handling on some versions of the GnuTLS library.
16c1ad08 7749 (wait_reading_process_output): Add comment and URL.
261b6fd4 7750
e7cfd277
JD
77512011-11-21 Jan Djärv <jan.h.d@swipnet.se>
7752
7753 * xterm.c (x_clear_frame): Reinstate the XClearWindow call.
7754
a9b9b7f5
CY
77552011-11-21 Chong Yidong <cyd@gnu.org>
7756
7757 * window.c (Fnext_window, Fprevious_window): Doc fix.
7758
b0d15b4f
SM
77592011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7760
7761 * window.c (get_phys_cursor_glyph): Fix Lisp_Object/int mixup.
7762
fe7a3057
JB
77632011-11-20 Juanma Barranquero <lekktu@gmail.com>
7764
7765 * nsfont.m (syms_of_nsfont) <ns-reg-to-script>: Fix typo.
7766
d2999b1a
MR
77672011-11-20 Martin Rudalics <rudalics@gmx.at>
7768
7769 * window.c (Fset_window_combination_limit): Rename argument
7770 STATUS to LIMIT.
7771 (Vwindow_combination_limit): Remove "status" from doc-string.
7772
d5ff9cd0
AS
77732011-11-20 Andreas Schwab <schwab@linux-m68k.org>
7774
7775 * m/ibms390.h: Remove.
7776 * m/ibms390x.h: Don't include "ibms390.h".
7777
a5bb9bd3
SM
77782011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
7779
7780 * fileio.c (Finsert_file_contents): Add missing gcpro1 variable.
7781 Suggested by Dmitry Antipov <dmantipov@yandex.ru>.
7782
cd1181db
JB
77832011-11-20 Juanma Barranquero <lekktu@gmail.com>
7784
7785 * casetab.c (Fset_case_table):
7786 * charset.c (Fcharset_after): Fix typos.
7787
615a3b8d 77882011-11-20 Paul Eggert <eggert@cs.ucla.edu>
6a0bf43d 7789
17e845af
PE
7790 Standardize on VIRT_ADDR_VARIES behavior (Bug#10042).
7791 Otherwise, valgrind does not work on some platforms.
7792 Problem reported by Andreas Schwab in
6a0bf43d
PE
7793 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00081.html>.
7794 * puresize.h (pure, PURE_P): Always behave as if VIRT_ADDR_VARIES
7795 is set, removing the need for VIRT_ADDRESS_VARIES.
7796 (PURE_P): Use a more-efficient implementation that needs just one
7797 comparison, not two: on x86-64 with GCC 4.6.2, this cut down the
7798 number of instructions from 6 (xorl, cmpq, jge, xorl, cmpq, setge)
7799 to 4 (xorl, subq, cmpq, setbe).
7800 * alloc.c (pure): Always extern now, since that's the
7801 VIRT_ADDR_VARIES behavior.
7802 (PURE_POINTER_P): Use a single comparison, not two, for
7803 consistency with the new puresize.h.
7804 * lisp.h (PNTR_COMPARISON_TYPE): Remove; no longer needed.
7805 * m/ibms390.h, m/intel386.h, m/template.h, s/cygwin.h, s/hpux10-20.h:
7806 Remove VIRT_ADDR_VARIES no longer needed.
7807
f8fe6f96
EZ
78082011-11-19 Eli Zaretskii <eliz@gnu.org>
7809
7810 * xdisp.c (x_write_glyphs, draw_phys_cursor_glyph)
7811 (erase_phys_cursor, update_window_cursor, show_mouse_face)
7812 (cursor_in_mouse_face_p): If the cursor position is out of bounds,
7813 behave as if the cursor position were at the window margin.
7814
7815 * window.c (get_phys_cursor_glyph): If the window is hscrolled,
7816 and the cursor position is out of bounds, behave as if the cursor
7817 position were at the window margin. (Bug#10075)
7818
df05a53c
CY
78192011-11-18 Chong Yidong <cyd@gnu.org>
7820
7821 * window.c (Fwindow_combination_limit): Make first argument
7822 non-optional, since it is meaningless for live windows like the
7823 selected window.
61ccba97 7824
2071918e
DA
78252011-11-18 Dmitry Antipov <dmantipov@yandex.ru>
7826
7827 * keymap.c (Fwhere_is_internal): Add missing RETURN_UNGCPROs.
7828
b50a28de
SM
78292011-11-18 Stefan Monnier <monnier@iro.umontreal.ca>
7830
7831 * intervals.c: Fix grafting over the whole buffer (bug#10071).
7832 (graft_intervals_into_buffer): Simplify.
7833
015137db
EZ
78342011-11-18 Eli Zaretskii <eliz@gnu.org>
7835
7836 * dispnew.c (swap_glyph_pointers): Swap the used[] arrays and the
7837 hash values of the two rows.
7838 (copy_row_except_pointers): Preserve the used[] arrays and the
7839 hash values of the two rows. (Bug#10035)
68c95424 7840 (add_row_entry): Add xassert to verify that ROW's hash code is valid.
015137db
EZ
7841
7842 * xdisp.c (row_hash): New function, body extracted from
7843 compute_line_metrics.
7844 (compute_line_metrics): Call row_hash, instead of computing the
7845 hash code inline.
7846
7847 * dispnew.c (verify_row_hash): Call row_hash for computing the
7848 hash code of a row, instead of duplicating code from xdisp.c.
7849
7850 * dispextern.h (row_hash): Add prototype.
7851
a2addb04
TH
78522011-11-18 Tassilo Horn <tassilo@member.fsf.org>
7853
7854 * frame.c (delete_frame): Don't delete the terminal when the last
7855 X frame is closed if emacs is built with GTK toolkit.
7856
df85d315
JB
78572011-11-17 Juanma Barranquero <lekktu@gmail.com>
7858
7859 * window.c (syms_of_window) <window-combination-resize>: Fix typo.
7860
a0c2d0ae
MR
78612011-11-17 Martin Rudalics <rudalics@gmx.at>
7862
7863 * window.c (Vwindow_splits): Rename to
7864 Vwindow_combination_resize. Suggested by Juri Linkov.
7865 (Fsplit_window_internal): Use Vwindow_combination_resize instead
7866 of Vwindow_splits.
7867
58179cce
JB
78682011-11-16 Juanma Barranquero <lekktu@gmail.com>
7869
7877f373
JB
7870 * nsfns.m (Fns_font_name):
7871 * window.c (syms_of_window) <window-combination-limit>: Fix typos.
58179cce 7872
b6f67890
MR
78732011-11-16 Martin Rudalics <rudalics@gmx.at>
7874
7875 * window.h (window): Rename slot "nest" to "combination_limit".
7876 * window.c (Fwindow_nest): Rename to Fwindow_combination_limit.
7877 (Fset_window_nest): Rename to Fset_window_combination_limit.
7878 (Vwindow_nest): Rename to Vwindow_combination_limit.
7879 (recombine_windows, make_parent_window, make_window)
7880 (Fsplit_window_internal, saved_window)
7881 (Fset_window_configuration, save_window_save): Rename all
7882 occurrences of window_nest to window_combination_limit.
7883
c7015153
JB
78842011-11-15 Juanma Barranquero <lekktu@gmail.com>
7885
7886 * image.c (imagemagick_load_image): Fix typo.
7887
322ad6ec
EZ
78882011-11-14 Eli Zaretskii <eliz@gnu.org>
7889
7890 * xdisp.c (display_line): Move the call to
7891 highlight_trailing_whitespace before the call to
7892 compute_line_metrics, since the latter needs to see the final
6d5eb5b0
SM
7893 faces of all the glyphs to compute ROW's hash value.
7894 Fixes assertion violations in row_equal_p. (Bug#10035)
322ad6ec 7895
f067b8ec
JB
78962011-11-14 Juanma Barranquero <lekktu@gmail.com>
7897
7898 * w32proc.c (reader_thread): Don't check pending input if cp->fd < 0,
7899 just return (bug#10044).
7900
1e5b2111
EZ
79012011-11-12 Eli Zaretskii <eliz@gnu.org>
7902
7ef3cbd5
EZ
7903 * makefile.w32-in (HEAPSIZE): New variable, allows to build temacs
7904 with user-defined heap size. Bump the default size of the temacs
7905 heap to 27MB, to avoid memory warning when running temacs.
7906 ($(TEMACS)): Use HEAPSIZE instead of a hardcoded value.
7907
1e5b2111
EZ
7908 * dispnew.c (scrolling_window): Fix incorrect indices in accessing
7909 current_matrix and desired_matrix. (Bug#9990)
7a7270dd
EZ
7910 (verify_row_hash) [XASSERTS]: New function.
7911 (adjust_glyph_matrix, row_equal_p): Use it in xassert to verify
7912 that the hash value of glyph rows is correct.
1e5b2111 7913
89d61221
MR
79142011-11-12 Martin Rudalics <rudalics@gmx.at>
7915
7916 * window.h (window): Remove splits slot.
7917 * window.c (Fwindow_splits, Fset_window_splits): Remove.
7918 (Fdelete_other_windows_internal, make_parent_window)
7919 (make_window, Fsplit_window_internal, Fdelete_window_internal)
7920 (Fset_window_configuration, save_window_save): Don't deal with
7921 split status of windows.
7922 (saved_window): Remove splits slot.
7923 (Vwindow_splits): Rewrite doc-string.
7924
97f18cc8
JD
79252011-11-11 Jan Djärv <jan.h.d@swipnet.se>
7926
7927 * xfns.c (unwind_create_frame):
7928 * nsfns.m (unwind_create_frame):
7929 * w32fns.c (unwind_create_frame): Use Fmemq to check if frame is in
7930 Vframe_list (Bug#9999).
7931
22a648b4
DA
79322011-11-11 Dmitry Antipov <dmantipov@yandex.ru>
7933
0b381c7e 7934 * xdisp.c (syms_of_xdisp): Remove duplicated definition of Qtext.
22a648b4 7935
659afede
KH
79362011-11-11 Kenichi Handa <handa@m17n.org>
7937
7938 * callproc.c (Fcall_process): Set the member dst_multibyte of
7939 process_coding.
7940
9ac0394b
KH
79412011-11-11 Johan Bockgård <bojohan@gnu.org>
7942
7943 * xdisp.c (fill_composite_glyph_string): Always set s->face, to
7944 avoid a crash (bug#9496).
7945
2fbdc249
CY
79462011-11-09 Chong Yidong <cyd@gnu.org>
7947
7948 * window.c (Fwindow_inside_edges, Fwindow_inside_pixel_edges)
7949 (Fwindow_inside_absolute_pixel_edges): Only allow live windows.
7950
ac6b1f81
PE
79512011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7952
7953 * s/gnu.h (GC_MARK_STACK): Define to GC_MAKE_GCPROS_NOOPS (Bug#9926).
7954
09db192c
PE
79552011-11-08 Paul Eggert <eggert@cs.ucla.edu>
7956
7957 Avoid some portability problems by eschewing 'extern inline' functions.
7958 The trivial performance wins aren't worth the portability hassles; see
7959 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>
7960 et seq.
7961 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
7962 (window_box_width, window_box_left, window_box_left_offset)
7963 (window_box_right, window_box_right_offset): Undo previous change,
7964 by removing the "extern"s.
7965 * intervals.c (adjust_intervals_for_insertion)
7966 (adjust_intervals_for_deletion): Undo previous change,
7967 making these static again.
7968 (offset_intervals, temp_set_point_both, temp_set_point)
7969 (copy_intervals_to_string): No longer inline.
7970 * xdisp.c (window_text_bottom_y, window_box_width)
7971 (window_box_height, window_box_left_offset)
7972 (window_box_right_offset, window_box_left, window_box_right)
7973 (window_box): No longer inline.
7974
105216ed
CY
79752011-11-08 Chong Yidong <cyd@gnu.org>
7976
7977 * window.c (Fwindow_left_column, Fwindow_top_line): Doc fix.
6d5eb5b0
SM
7978 (Fwindow_body_height, Fwindow_body_width): Move from Lisp.
7979 Signal an error if not a live window.
105216ed
CY
7980 (Fwindow_total_width, Fwindow_total_height): Move from Lisp.
7981 (Fwindow_total_size, Fwindow_body_size): Move to Lisp.
7982
ae9e237f
JB
79832011-11-07 Juanma Barranquero <lekktu@gmail.com>
7984
7985 * lisp.h (syms_of_abbrev): Remove declaration.
7986 Reported by CHENG Gao <chenggao@royau.me>.
7987
c7aa8333
EZ
79882011-11-07 Eli Zaretskii <eliz@gnu.org>
7989
7990 * w32.c (check_windows_init_file): Don't look for term/w32-win.el
7991 if Vpurify_flag is non-nil. Fixes a crash when running w32 build
7992 of temacs in GUI mode.
7993
be7f5545
MR
79942011-11-07 Martin Rudalics <rudalics@gmx.at>
7995
7996 * window.h: Declare delete_all_child_windows instead of
7997 delete_all_subwindows.
7998 * window.c (Fwindow_nest, Fset_window_nest)
7999 (Fset_window_new_total, Fset_window_new_normal)
8000 (Fwindow_resize_apply): Don't use term subwindow in doc-strings.
8001 (delete_all_subwindows): Rename to delete_all_child_windows.
8002 (Fdelete_other_windows_internal, Fset_window_configuration):
8003 Call delete_all_child_windows instead of delete_all_subwindows.
8004 * frame.c (delete_frame): Call delete_all_child_windows instead
8005 of delete_all_subwindows.
8006
ca78dc43
PE
80072011-11-07 Paul Eggert <eggert@cs.ucla.edu>
8008
8009 * alloc.c (DEADP): New macro, for porting to GNU/Hurd (Bug#9926).
8010 This is also needed for porting to any host where GC_MARK_STACK is
8011 not GC_MAKE_GCPROS_NOOPS.
8012 (which_symbols): Use it.
8013
a0241d01
KH
80142011-11-07 Kenichi Handa <handa@m17n.org>
8015
8016 * coding.c (coding_set_destination): Check coding->src_pos only
8017 when coding->src_object is a buffer (bug#9910).
8018
8019 * process.c (send_process): Set the member src_multibyte of coding
8020 to 0 (bug#9911) when sending a unibyte text.
8021
8022 * callproc.c (Fcall_process): Set the member src_multibyte of
8023 process_coding to 0 (bug#9912).
8024
a64bfdfa 80252011-11-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
ba24cea2
YM
8026
8027 * xmenu.c (cleanup_widget_value_tree): New function.
8028 (xmenu_show, xdialog_show): Use it in record_unwind_protect instead of
8029 calling free_menubar_widget_value_tree directly (Bug#9830).
8030
cb41b32a
PE
80312011-11-06 Paul Eggert <eggert@cs.ucla.edu>
8032
8033 Fix some portability problems with 'inline'.
8034 * dispextern.h (window_box, window_box_height, window_text_bottom_y)
8035 (window_box_width, window_box_left, window_box_left_offset)
8036 (window_box_right, window_box_right_offset): Declare extern.
8037 Otherwise, these inline functions do not conform to C99 and
8038 are miscompiled by Microsoft compilers. Reported by Eli Zaretskii in
8039 <http://lists.gnu.org/archive/html/emacs-devel/2011-11/msg00084.html>.
8040 * intervals.c (adjust_intervals_for_insertion)
8041 (adjust_intervals_for_deletion): Now extern, because otherwise the
8042 extern inline functions 'offset_intervals' couldn't refer to it.
8043 (static_offset_intervals): Remove.
8044 (offset_intervals): Rewrite using the old contents of
8045 static_offset_intervals. The old version didn't conform to C99
8046 because an extern inline function contained a reference to an
8047 identifier with static linkage.
8048
b7041366
AS
80492011-11-06 Andreas Schwab <schwab@linux-m68k.org>
8050
8051 * keyboard.c (interrupt_signal): Don't call kill-emacs while in
8052 GC.
8053
88a37c4d
EZ
80542011-11-06 Eli Zaretskii <eliz@gnu.org>
8055
8056 * xdisp.c (init_iterator, reseat_to_string): Don't set the
8057 iterator's bidi_p flag if Vpurify_flag is non-nil. (Bug#9963)
8058 (Fcurrent_bidi_paragraph_direction): If Vpurify_flag is non-nil,
8059 return Qleft_to_right.
8060
49745b39
CY
80612011-11-06 Chong Yidong <cyd@gnu.org>
8062
8063 * window.c (Fwindow_live_p, Fwindow_frame, Fframe_root_window)
8064 (Fminibuffer_window, Fwindow_buffer, Fwindow_splits)
8065 (Fset_window_splits, Fwindow_nest, Fset_window_nest)
8066 (Fwindow_use_time, Fwindow_total_size, Fwindow_normal_size)
8067 (Fwindow_new_normal, Fwindow_left_column, Fwindow_top_line)
8068 (Fwindow_margins, Fwindow_fringes, Fwindow_scroll_bars)
8069 (Fwindow_vscroll): Doc fix.
8070 (Fwindow_top_child, Fwindow_left_child): Eliminate a nil default
8071 argument, since it makes no sense to pass a live window and for
8072 consistency with window-child.
8073
1f05cd82
CS
80742011-11-05 Christoph Scholtes <cschol2112@googlemail.com>
8075
8076 * makefile.w32-in ($(TEMACS), (gl-stamp)): Use $(THISDIR) to
8077 support MSVC.
8078
22610910
JR
80792011-11-05 Jason Rumney <jasonr@gnu.org>
8080
8081 * w32font.c (font_matches_spec): Filter out non-Japanese kana fonts.
8082 (add_font_entity_to_list): Filter out non-Japanese Shift-JIS
8083 fonts (Bug#6029).
8084 (add_font_entity_to_list): Fix logic errors in mixed boolean and
8085 bitwise arithmetic preventing use of unicode-sip and non-truetype
8086 opentype fonts.
8087
a06776b2
EZ
80882011-11-05 Eli Zaretskii <eliz@gnu.org>
8089
3ad924ba
EZ
8090 * s/ms-w32.h (fstat, stat, utime): Move redirections to
8091 "emacs"-only part.
8092
a06776b2
EZ
8093 * w32fns.c (x_create_tip_frame, Fx_create_frame): Rearrange
8094 initialization code to keep similarity to xfns.c after changes
8095 from 2011-11-05.
8096
c9e7db78
JD
80972011-11-05 Jan Djärv <jan.h.d@swipnet.se>
8098
a97f8f3f
JD
8099 * nsfns.m: Declare image_cache_refcount if GLYPH_DEBUG.
8100 (unwind_create_frame): New function (Bug#9943).
8101 (Fx_create_frame): Restructure code to be more similar to the one in
8102 xfns.c. Call record_unwind_protect with unwind_create_frame (Bug#9943).
8103 Initialize image_cache_refcount if GLYPH_DEBUG (Bug#9943).
8104 Move terminal->reference_count++ just before making the frame official
8105 (Bug#9943).
8106
8107 * nsterm.m (x_free_frame_resources): New function.
8108 (x_destroy_window): Move code to x_free_frame_resources.
8109
c9e7db78 8110 * xfns.c (unwind_create_frame): Fix comment.
6d5eb5b0
SM
8111 (Fx_create_frame, x_create_tip_frame):
8112 Move terminal->reference_count++ just before making the frame
75f1671a 8113 official. Move initialization of image_cache_refcount and
c9e7db78
JD
8114 dpyinfo_refcount before calling init_frame_faces (Bug#9943).
8115
a6fc3b5c
EZ
81162011-11-05 Eli Zaretskii <eliz@gnu.org>
8117
8118 Support MSVC build with newer versions of Visual Studio.
8119 * makefile.w32-in (TAGS-gmake): Don't use $(patsubst ...), as
8120 Nmake barfs on that. Use $(OBJ*_c) variables instead, defined on
8121 nt/gmake.defs.
8122
8123 * lisp.h (ENUM_BF): New macro, for enumerated types in bitfields,
8124 which are not supported by MSVC.
8125 (Lisp_Symbol, Lisp_Misc_Any, Lisp_Marker, Lisp_Misc_Overlay)
8126 (Lisp_Save_Value, Lisp_Free): Use ENUM_BF for enumerated types in
8127 bitfields.
8128 (Lisp_Object) [USE_LISP_UNION_TYPE]: Use ENUM_BF for enumerated
8129 types in bitfields.
8130 (DEFUN) [_MSC_VER]: Define in a different way for MSVC.
8131
8132 * w32fns.c [_MSC_VER]: DECLARE_HANDLE for any MSVC version.
8133
58179cce 81342011-11-05 Fabrice Popineau <fabrice.popineau@supelec.fr> (tiny change)
a6fc3b5c
EZ
8135
8136 Support MSVC build with newer versions of Visual Studio.
8137 * w32.c: Don't include w32api.h for MSVC.
8138 (init_environment) [_MSC_VER]: Call sys_access, not _access.
8139
8140 * s/ms-w32.h <sigset_t, ssize_t> [_MSC_VER]: Typedefs for MSVC.
8141 [_MSC_VER]: Include sys/timeb.h, sys/stat.h, and signal.h.
8142 (fstat, stat, utime) [_MSC_VER]: Redirect to their sys_* cousins.
8143 (malloc, free, realloc, calloc) [_MSC_VER]: Always redirect to the
8144 e_* cousins.
8145 (alloca) [_MSC_VER]: Define to _alloca.
8146
8147 * lisp.h (DECL_ALIGN) [_MSC_VER]: Define for MSVC.
8148
8149 * regex.c <re_char> [_MSC_VER]: A separate definition for MSVC.
8150
a58c13ed
EZ
81512011-11-04 Eli Zaretskii <eliz@gnu.org>
8152
8153 * xdisp.c (note_mouse_highlight): If either of
8154 previous/next-single-property-change returns nil, treat that as
8155 the beginning or the end of the buffer. (Bug#9955)
8156
fe0b6370
JD
81572011-11-04 Jan Djärv <jan.h.d@swipnet.se>
8158
a58c13ed 8159 * gtkutil.c (xg_make_tool_item): Add callbacks if one of wimage or
fe0b6370
JD
8160 label is not null (Bug#9951).
8161 (xg_tool_item_stale_p): Handle the fact that wimage and/or wlbl
8162 may be NULL.
8163
89bd5ee1
EZ
81642011-11-04 Eli Zaretskii <eliz@gnu.org>
8165
8166 * window.c (Fwindow_body_size): Mention in the doc string that the
8167 return value is in frame's canonical units. (Bug#9949)
8168
84c3edb9
EZ
81692011-11-03 Eli Zaretskii <eliz@gnu.org>
8170
4e2fb5c7
EZ
8171 * xdisp.c (note_mouse_highlight): Initialize `area'. (Bug#9947)
8172
84c3edb9 8173 * w32fns.c (unwind_create_frame): If needed, free the glyph
3ab15fd6 8174 matrices of the partially constructed frame. (Bug#9943)
2a58bbc1 8175 * xfns.c (unwind_create_frame): Likewise.
84c3edb9 8176
bc17a887
EZ
81772011-11-01 Eli Zaretskii <eliz@gnu.org>
8178
8179 * xdisp.c (mouse_face_from_buffer_pos): Fix a typo in a comment.
8180 Don't stop backward scan on the continuation glyph, even though
8181 its CHARPOS is positive.
6d5eb5b0
SM
8182 (mouse_face_from_buffer_pos, note_mouse_highlight):
8183 Rename cover_string to disp_string.
bc17a887 8184
4ee88440
MR
81852011-11-01 Martin Rudalics <rudalics@gmx.at>
8186
8187 * window.c (temp_output_buffer_show): Don't use
8188 Vtemp_buffer_show_specifiers.
8189 (Vtemp_buffer_show_specifiers): Remove unused variable.
8190
c2ff3c02
EZ
81912011-10-30 Eli Zaretskii <eliz@gnu.org>
8192
8193 * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
8194 past the beginning of the current glyph matrix.
8195
58179cce 81962011-10-30 Adam Sjøgren <asjo@koldfront.dk> (tiny change)
6e56383b
JD
8197
8198 * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
8199 (x_error_handler): Ignore BadMatch for X_SetInputFocus for
8200 HAVE_GTK3 (Bug#9869).
b77a6a7f 8201
3b574623
JD
8202 * gtkutil.c (xg_win_to_widget, xg_event_is_for_menubar): Initialize
8203 type to GDK_NOTHING so valgrind does not complain (Bug#9901).
8204
b77a6a7f
JD
8205 * xterm.h (x_display_info): Add Xatom_net_wm_state_hidden (Bug#9893).
8206
8207 * xterm.c: Declare x_handle_net_wm_state to return int.
8208 (handle_one_xevent): Check if we are iconified but don't have
8209 _NET_WM_STATE_HIDDEN. If do, treat as deiconify (Bug#9893).
8210 (get_current_wm_state): Return non-zero if not hidden,
8211 check for _NET_WM_STATE_HIDDEN (Bug#9893).
8212 (do_ewmh_fullscreen): Ignore return value from get_current_wm_state.
8213 (x_handle_net_wm_state): Return what get_current_wm_state returns.
8214 (x_term_init): Initialize dpyinfo->Xatom_net_wm_state_hidden.
8215
196e41e4
PE
82162011-10-29 Paul Eggert <eggert@cs.ucla.edu>
8217
8218 * alloc.c (which_symbols): Declare EXTERNALLY_VISIBLE,
8219 so that this new function doesn't get optimized away by a
8220 whole-program optimizer. Make the 2nd arg EMACS_INT, not int.
8221
021f2e1a
AS
82222011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8223
8224 * frame.h (MOUSE_HL_INFO): Remove excess parens.
8225
8b058d44
EZ
82262011-10-29 Eli Zaretskii <eliz@gnu.org>
8227
8228 Fix the `xbytecode' command.
8229 * .gdbinit (xprintbytestr): New command.
b50a28de 8230 (xwhichsymbols): Rename from `which'; all callers changed.
8b058d44
EZ
8231 (xbytecode): Print the byte-code string as well.
8232
4452fb80
EZ
82332011-10-29 Kim Storm <storm@cua.dk>
8234
8b058d44
EZ
8235 * alloc.c (which_symbols): New function.
8236
21b72067
AS
82372011-10-29 Andreas Schwab <schwab@linux-m68k.org>
8238
8239 * minibuf.c (read_minibuf_noninteractive): Allow reading empty
8240 line. (Bug#9903)
8241
83ed7b5c
GM
82422011-10-29 Glenn Morris <rgm@gnu.org>
8243
8244 * process.c (wait_reading_process_output): Revert 2009-08-30 change.
8245 Not clear what it was for, and it causes various bugs. (Bug#9839)
8246
5a7a728b
EZ
82472011-10-28 Eli Zaretskii <eliz@gnu.org>
8248
8249 * xdisp.c (note_mouse_highlight): Initialize `part', to avoid a
8250 possible random value that matches one of those tested as
8251 condition to clear the mouse face.
8252
d3d0842f
CY
82532011-10-28 Chong Yidong <cyd@gnu.org>
8254
8255 * xdisp.c (note_mouse_highlight): Fix use of uninitialized var.
8256
31b39d13
DN
82572011-10-28 Dan Nicolaescu <dann@ics.uci.edu>
8258
8259 * window.c (make_window): Initialize phys_cursor_on_p.
8260
9aba6043
SM
82612011-10-28 Stefan Monnier <monnier@iro.umontreal.ca>
8262
8263 * lisp.h (struct Lisp_Symbol): Update comments.
8264
c20992f4
JB
82652011-10-28 Juanma Barranquero <lekktu@gmail.com>
8266
8267 * w32font.c (w32_load_unicows_or_gdi32): Add missing return.
8268
db4f02f2
EZ
82692011-10-28 Eli Zaretskii <eliz@gnu.org>
8270
8271 Fix Emacs on Windows 9X (bug#8562). Thanks to oslsachem
8272 <oslsachem@gmail.com> for helping to debug this.
8273
8274 * w32font.c (g_b_init_is_w9x, g_b_init_get_outline_metrics_w)
8275 (g_b_init_get_text_metrics_w, g_b_init_get_glyph_outline_w)
8276 (g_b_init_get_glyph_outline_w): New static variables.
8277 (GetOutlineTextMetricsW_Proc, GetTextMetricsW_Proc)
8278 (GetGlyphOutlineW_Proc): New typedefs.
8279 (w32_load_unicows_or_gdi32, get_outline_metrics_w)
9aba6043
SM
8280 (get_text_metrics_w, get_glyph_outline_w, globals_of_w32font):
8281 New functions.
8282 (w32font_open_internal, compute_metrics):
8283 Call get_outline_metrics_w, get_text_metrics_w, and get_glyph_outline_w
db4f02f2
EZ
8284 instead of calling the "wide" APIs directly.
8285
8286 * emacs.c (main) [HAVE_NTGUI]: Call globals_of_w32font.
8287
8288 * w32.h (syms_of_w32font): Add prototype.
8289
87e68db4
JB
82902011-10-27 Juanma Barranquero <lekktu@gmail.com>
8291
8292 * window.c (Fframe_root_window, Fframe_first_window, Fwindow_end)
8293 (Fframe_selected_window, Ftemp_output_buffer_show, Fnext_window)
8294 (Fdelete_window_internal, Fwindow_parameters): Fix typos in docstrings.
8295 (Fmove_to_window_line): Doc fix.
8296
435c1d67
CY
82972011-10-27 Chong Yidong <cyd@gnu.org>
8298
8299 * process.c (make_process): Set gnutls_state to NULL.
8300
8301 * gnutls.c (emacs_gnutls_deinit): Deinit the gnutls_state if it is
8302 non-NULL, regardless of GNUTLS_INITSTAGE.
8303 (Fgnutls_boot): Cleanups. Call emacs_gnutls_deinit if we signal
8304 an error. Set process slots as soon as we allocate them.
8305
8306 * gnutls.h (GNUTLS_LOG, GNUTLS_LOG2): Fix macros.
8307
9c6c6f49
CY
83082011-10-27 Chong Yidong <cyd@gnu.org>
8309
9aba6043
SM
8310 * gnutls.c (emacs_gnutls_deinit): New function.
8311 Deallocate credentials structures as well as calling gnutls_deinit.
9c6c6f49
CY
8312 (Fgnutls_deinit, Fgnutls_boot): Use it.
8313
8314 * process.c (make_process): Initialize GnuTLS credentials to NULL.
8315 (deactivate_process): Call emacs_gnutls_deinit.
8316
657d08d3
JB
83172011-10-27 Juanma Barranquero <lekktu@gmail.com>
8318
8319 * image.c (x_create_x_image_and_pixmap):
8320 * w32.c (sys_rename, w32_delayed_load):
8321 * w32font.c (fill_in_logfont):
8322 * w32reg.c (x_get_string_resource): Silence compiler warnings.
8323
5430d399
JB
83242011-10-26 Juanma Barranquero <lekktu@gmail.com>
8325
8326 * w32fns.c (w32_default_color_map): New function,
8327 extracted from Fw32_default_color_map.
a7ef684b 8328 (Fw32_default_color_map, Fx_open_connection): Use it. (Bug#9785)
5430d399 8329
fe0055fa
PE
83302011-10-25 Paul Eggert <eggert@cs.ucla.edu>
8331
8332 * dispextern.h (Fcontrolling_tty_p): New decl (Bug#6649 part 2).
8333
e6346438
SM
83342011-10-25 Stefan Monnier <monnier@iro.umontreal.ca>
8335
8336 * keyboard.c (test_undefined): New function (bug#9751).
8337 (read_key_sequence): Use it to detect when a key is bound to `undefined'.
8338
e112cc37
ET
83392011-10-25 Enami Tsugutomo <tsugutomo.enami@jp.sony.com>
8340
8341 * sysdep.c (init_sys_modes): Fix the check for the controlling
8342 terminal (Bug#6649).
8343
7b5d6677
EZ
83442011-10-20 Eli Zaretskii <eliz@gnu.org>
8345
8346 * dispextern.h (struct bidi_it): New member next_en_type.
8347
8348 * bidi.c (bidi_line_init): Initialize the next_en_type member.
8349 (bidi_resolve_explicit_1): When next_en_pos is valid for the
8350 current character, check also for next_en_type being WEAK_EN.
8351 (bidi_resolve_weak): Don't enter the expensive loop if the current
8352 position is before next_en_pos. Record the bidi type of the first
8353 non-ET, non-BN character we find, in addition to its position.
8354 (bidi_level_of_next_char): Invalidate next_en_type when
8355 next_en_pos is over-stepped.
8356
7da0b018
PE
83572011-10-20 Paul Eggert <eggert@cs.ucla.edu>
8358
8359 Time zone name fixes for non-ASCII locales (Bug#641, Bug#9794)
8360 * editfns.c: Rewrite current-time-zone so that it invokes
8361 the equivalent of (format-time-string "%Z") to get the time zone name.
8362 This fixes a bug when the time zone name contains characters that
8363 need converting from the system time locale to Emacs internal format.
8364 This fixes a shortcoming that I introduced in my 1999-10-19 patch:
8365 that patch fixed format-time-string to do the conversion, but
8366 I forgot to fix current-time-zone.
8367 (format_time_string): New function, containing most of
8368 what Fformat_time_string used to contain.
8369 (Fformat_time_string): Rewrite in terms of format_time_string.
8370 This doesn't change this function's behavior.
8371 (current-time-zone): Rewrite to use format_time_string.
8372 This fixes the bug reported by Michael Schierl in
8373 <http://lists.gnu.org/archive/html/emacs-devel/2007-06/msg00334.html>.
8374 Jason Rumney's 2007-06-07 change worked around this bug, but
8375 didn't fix it.
8376 * systime.h (tzname, timezone): Remove no-longer-used declarations.
8377
8547b010
EZ
83782011-10-19 Eli Zaretskii <eliz@gnu.org>
8379
8380 * xdisp.c (start_display): If the character at POS is displayed
8381 via a display vector, reset IT->current.dpvec_index to zero.
12b32963
EZ
8382 (try_window_reusing_current_matrix): If a line ends in a display
8383 vector or the next line starts in a display vector, continue
8384 redrawing the window even though the character position of
8385 start_row was reached.
8547b010
EZ
8386 (Bug#9771, part 2)
8387
4e948d15
CY
83882011-10-18 Chong Yidong <cyd@gnu.org>
8389
8390 * xdisp.c (get_next_display_element): Handle U+2010 and U+2011
8391 with nobreak-char-display too.
8392
4787455f
EZ
83932011-10-18 Eli Zaretskii <eliz@gnu.org>
8394
8395 Fix part 3 of bug#9771.
8396 * bidi.c (bidi_line_init): Initialize next_en_pos to zero, not -1.
8397 (bidi_resolve_neutral): Don't enter the expensive loop looking for
8398 non-neutral characters if the current character is a paragraph
8399 separator (a.k.a. Newline). This avoids running the same
8400 expensive loop twice, once when we consume the preceding newline
8401 and the other time when the line actually needs to be displayed.
8402 Avoid the loop when we see neutrals on the base embedding level
8403 following a character whose directionality is the same as the
8404 paragraph's. This avoids running the expensive loop when a line
8405 ends in a long sequence of neutrals, like control characters.
8406 Add assertion against STRONG_AL type. Slightly rearrange code
8407 that determines the type of a neutral given the first non-neutral
8408 that follows it.
8409 (bidi_level_of_next_char): Set next_en_pos to zero when
8410 invalidating its info.
8411
2c91f553
EZ
84122011-10-17 Eli Zaretskii <eliz@gnu.org>
8413
8414 * xdisp.c (push_display_prop): Determine whether to record string
8415 or buffer position by IT->string, not by IT->method. Allow
8416 GET_FROM_DISPLAY_VECTOR as IT->method on entry. (Bug#9771, part 4)
f2ff9e88
EZ
8417 (move_it_vertically_backward): Don't look for character position
8418 immediately after the newline when in a continuation line.
8419 (Bug#9771, part 1)
2c91f553 8420
c7b08b0d
MR
84212011-10-15 Martin Rudalics <rudalics@gmx.at>
8422
8423 * window.c (coordinates_in_window): Rewrite and delabelize
8424 vertical border check. (Bug#5357) (Bug#9618)
8425
6b02f655
SM
84262011-10-14 Stefan Monnier <monnier@iro.umontreal.ca>
8427
8428 * xterm.c (frame_highlight, frame_unhighlight): Ignore unexplained
8429 errors in XSetWindowBorder (bug#9310).
8430
81d40c92
DA
84312011-10-13 Dmitry Antipov <dmantipov@yandex.ru>
8432
8433 * editfns.c (Fset_time_zone_rule): Replace free with xfree to
8434 avoid crash when xmalloc overrun checking is enabled.
8435
d4172c3b
EZ
84362011-10-13 Eli Zaretskii <eliz@gnu.org>
8437
8438 * xdisp.c (Fcurrent_bidi_paragraph_direction): Initialize
8439 itb.paragraph_dir to NEUTRAL_DIR. Fixes an occasional incorrect
8440 cursor motion with <left> and <right> arrow keys.
8441
8442 * bidi.c (bidi_init_it): Don't initialize paragraph_dir here, as
8443 some callers set that themselves.
8444
b00eea75
EZ
84452011-10-12 Eli Zaretskii <eliz@gnu.org>
8446
8447 * xdisp.c (find_row_edges): Handle the case where ROW comes from a
8448 display string and the previous row comes from the same string and
8449 is empty. (Bug#9739) (Bug#9738)
8450
8fe012c4
SM
84512011-10-12 Stefan Monnier <monnier@iro.umontreal.ca>
8452
8453 * doc.c (get_doc_string): Encode file name (bug#9735).
8454
0074aef2
EZ
84552011-10-12 Eli Zaretskii <eliz@gnu.org>
8456
79beb178
EZ
8457 * bidi.c (bidi_level_of_next_char):
8458 * xdisp.c (get_visually_first_element): Remove old incorrect
8459 comments regarding the Unicode Line Separator character.
8460
0074aef2
EZ
8461 * bidi.c (bidi_init_it): Initialize paragraph_dir to NEUTRAL_DIR.
8462
6e4b3fbe
DA
84632011-10-12 Dmitry Antipov <dmantipov@yandex.ru>
8464
8465 * alloc.c (Fgc_status): Do not access beyond zombies array
8466 boundary if nzombies > MAX_ZOMBIES.
8467 * alloc.c (dump_zombies): Add missing format specifier.
8468
0324f3af
PE
84692011-10-12 Paul Eggert <eggert@cs.ucla.edu>
8470
b5525cac
PE
8471 * xdisp.c (set_cursor_from_row): Simplify conditionals,
8472 to pacify GCC 4.6.1 x86-64 with -O2 -Wstrict-overflow.
8473
0324f3af
PE
8474 * lread.c (read_escape): Allow hex escapes as large as ?\xfffffff.
8475 Some packages use them to denote characters with modifiers.
8476
e9b5f888
AS
84772011-10-11 Andreas Schwab <schwab@linux-m68k.org>
8478
8479 * lisp.h (GCPRO1_VAR, GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR)
8480 (GCPRO5_VAR, GCPRO6_VAR, UNGCPRO_VAR): Add whitespace to avoid
8481 matching a pp-number. Rename parameter var to var1.
8482
127827c0
SM
84832011-10-11 Stefan Monnier <monnier@iro.umontreal.ca>
8484
8485 * minibuf.c (Finternal_complete_buffer): Fix last change (bug#9709).
8486
c8fd3bd0
GM
84872011-10-08 Glenn Morris <rgm@gnu.org>
8488
8489 * callint.c (Fcall_interactively): Give a more explicit error for the
8490 'c' case with a non-character input. (Bug#8479)
8491
352ec8ff
EZ
84922011-10-08 Eli Zaretskii <eliz@gnu.org>
8493
03669ccb
EZ
8494 * xdisp.c (hscroll_window_tree): Support hscroll in right-to-left
8495 lines.
7061c986
EZ
8496 (set_cursor_from_row): Fix cursor positioning in mixed L2R+R2L
8497 lines that are hscrolled on the left.
03669ccb 8498
352ec8ff
EZ
8499 * dispnew.c (buffer_posn_from_coords): Account for a possible
8500 presence of header-line. (Bug#4426)
8501
a66cfb1c
SM
85022011-10-07 Stefan Monnier <monnier@iro.umontreal.ca>
8503
6b02f655
SM
8504 * buffer.c (syms_of_buffer) <enable-multibyte-characters>:
8505 Don't advertise functionality which we discourage or doesn't work.
a66cfb1c 8506
7c5ee88e
PE
85072011-10-07 Paul Eggert <eggert@cs.ucla.edu>
8508
8509 * alloc.c (GC_LISP_OBJECT_ALIGNMENT): Use offsetof, not __alignof__
8510 or sizeof. __alignof__ gives the wrong answer on Fedora x86-64
8511 with GCC 4.6.1 when configured with CC='gcc -m32' --with-wide-int;
8512 this makes Emacs dump core during garbage collection on rare
8513 occasions. sizeof is obviously inferior to offsetof here, so
8514 stick with offsetof.
8515 (GC_POINTER_ALIGNMENT): New macro.
8516 (mark_memory): Omit 3rd (offset) arg; caller changed.
8517 Don't assume EMACS_INT alignment is the same as pointer alignment.
8518
df1bbe5b
SM
85192011-10-03 Stefan Monnier <monnier@iro.umontreal.ca>
8520
8521 * keyboard.c (read_key_sequence_remapped): New var.
8522 (read_key_sequence): Compute remapping in the right buffer.
8523 (command_loop_1): Use read_key_sequence's remapping directly.
8524
51553db6
SM
85252011-10-02 Stefan Monnier <monnier@iro.umontreal.ca>
8526
32c1fffd
SM
8527 * dired.c (file_name_completion): Don't expand file name.
8528 (Ffile_name_completion, Ffile_name_all_completions): Expand file name
8529 before checking file name handler.
8530
51553db6
SM
8531 * minibuf.c (Finternal_complete_buffer): Only show internal buffers if
8532 they've been requested explicitly (bug#9591).
8533
b6bd1599 85342011-10-01 Andreas Schwab <schwab@linux-m68k.org>
fa2ec41f
AS
8535
8536 * keymap.c (Fsingle_key_description): Use make_specified_string
8537 instead of build_string to build string from push_key_description.
8538 (Bug#5193)
8539
f701dc2a
PE
85402011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8541
4222c55d
PE
8542 * buffer.h (struct buffer): Use time_t, not int, for a time stamp.
8543 This fixes a Y2038 bug on 64-bit hosts.
8544 * buffer.c (reset_buffer):
8545 * fileio.c (Fdo_auto_save, Fset_buffer_auto_saved)
8546 (Fclear_buffer_auto_save_failure):
8547 Use 0, not -1, to represent an unset failure time, since time_t
8548 might not be signed.
8549
f701dc2a
PE
8550 Remove dependency on glibc malloc internals.
8551 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8552 Move back here from lisp.h, but with their new implementations.
8553 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8554 (XMALLOC_OVERRUN_SIZE_SIZE): Move these new lisp.h macros here.
8555 * charset.c (charset_table_init): New static var.
8556 (syms_of_charset): Use it instead of xmalloc. This removes a
8557 dependency on glibc malloc internals. See Eli Zaretskii's comment in
8558 <http://lists.gnu.org/archive/html/emacs-devel/2011-09/msg00815.html>.
8559 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8560 Move back to alloc.c.
8561 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8562 (XMALLOC_OVERRUN_SIZE_SIZE): Move to alloc.c.
8563
9ceebf39
JD
85642011-09-30 Jan Djärv <jan.h.d@swipnet.se>
8565
8566 * nsterm.m (windowDidResize): Call x_set_window_size only when
8567 ns_in_resize is true. Otherwise set pixelwidth/height and
8568 call change_frame_size (Bug#9628).
8569
cb993c58
PE
85702011-09-30 Paul Eggert <eggert@cs.ucla.edu>
8571
3930c88b
PE
8572 Port --enable-checking=all to Fedora 14 x86-64.
8573 * charset.c (syms_of_charset): Also account for glibc malloc's
8574 internal overhead when calculating the initial malloc maximum.
8575
cb993c58
PE
8576 Port --enable-checking=all to Fedora 14 x86.
8577 * alloc.c (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8578 Move to lisp.h.
8579 (xmalloc_put_size, xmalloc_get_size, overrun_check_malloc)
8580 (overrun_check_realloc, overrun_check_free):
8581 Use XMALLOC_OVERRUN_SIZE_SIZE, not sizeof (size_t).
8582 That way, xmalloc returns a properly-aligned pointer even if
8583 XMALLOC_OVERRUN_CHECK is defined. The old debugging code happened
8584 to align OK on typical 64-bit hosts, but not on Fedora 14 x86.
8585 * charset.c (syms_of_charset): Take XMALLOC_OVERRUN_CHECK_OVERHEAD
8586 into account when calculating the initial malloc maximum.
8587 * lisp.h (XMALLOC_OVERRUN_CHECK_OVERHEAD, XMALLOC_OVERRUN_CHECK_SIZE):
8588 Move here from alloc.c, so that charset.c can use it too.
8589 Properly align; the old code wasn't right for common 32-bit hosts
8590 when configured with --enable-checking=all.
8591 (XMALLOC_BASE_ALIGNMENT, COMMON_MULTIPLE, XMALLOC_HEADER_ALIGNMENT)
8592 (XMALLOC_OVERRUN_SIZE_SIZE): New macros.
8593
31bed486
EZ
85942011-09-29 Eli Zaretskii <eliz@gnu.org>
8595
04c70788 8596 * sysdep.c (snprintf) [!EOVERFLOW]: If EOVERFLOW is not defined,
31bed486
EZ
8597 use EDOM.
8598
fbcaa2f3
EZ
85992011-09-28 Eli Zaretskii <eliz@gnu.org>
8600
8601 * xdisp.c (compute_display_string_end): If there's no display
8602 string at CHARPOS, return -1.
8603
8604 * bidi.c (bidi_fetch_char): When compute_display_string_end
8605 returns a negative value, treat the character as a normal
8606 character not covered by a display string. (Bug#9624)
8607
a239d4e9
JB
86082011-09-28 Juanma Barranquero <lekktu@gmail.com>
8609
8610 * lread.c (Fread_from_string): Fix typo in docstring.
8611
88652fd5
EZ
86122011-09-27 Eli Zaretskii <eliz@gnu.org>
8613
8614 * xdisp.c (handle_invisible_prop): If invisible text ends on a
8615 newline, reseat the iterator instead of bidi-iterating there one
8616 character at a time. (Bug#9610)
32c1fffd
SM
8617 (BUFFER_POS_REACHED_P, move_it_in_display_line_to): Bail when past
8618 TO_CHARPOS if the bidi iterator is at base embedding level.
88652fd5 8619
ed497dd4
AS
86202011-09-27 Andreas Schwab <schwab@linux-m68k.org>
8621
8622 * lread.c (readevalloop): Use correct code for NBSP.
8623 (read1): Likewise. (Bug#9608)
8624
b2bf61aa
MA
86252011-09-25 Michael Albinus <michael.albinus@gmx.de>
8626
8627 * dbusbind.c (Fdbus_register_signal): When service is not
8628 registered, use nil in Vdbus_registered_objects_table. (Bug#9581)
8629
32bbb17c
GM
86302011-09-25 Glenn Morris <rgm@gnu.org>
8631
8632 * buffer.c (truncate-lines): Doc fix.
8633
94e0933e
CY
86342011-09-24 Chong Yidong <cyd@stupidchicken.com>
8635
8636 * window.c (Fwindow_prev_buffers, Fset_window_prev_buffers)
8637 (Fset_window_next_buffers): Doc fix.
8638
cddde921
GM
86392011-09-24 Glenn Morris <rgm@gnu.org>
8640
8641 * minibuf.c (read_minibuf): Disable line truncation. (Bug#5715)
8642
1260aef1
PE
86432011-09-24 Paul Eggert <eggert@cs.ucla.edu>
8644
25b4bfa0
PE
8645 Fix minor problems found by static checking.
8646 * xdisp.c (string_from_display_spec): Don't assume vecsize fits in int.
1260aef1
PE
8647 * indent.c (Fvertical_motion): Fix == vs = typo.
8648
e3cbd34b
EZ
86492011-09-24 Eli Zaretskii <eliz@gnu.org>
8650
a66cfb1c
SM
8651 * dispnew.c (syms_of_display) <redisplay-dont-pause>:
8652 Default value is now t. Doc fix.
6bf7006f 8653
e3cbd34b 8654 * indent.c (Fvertical_motion): Compute and apply the overshoot
32c1fffd 8655 logic when moving up, not only when moving down. Fix the
e3cbd34b 8656 confusing name and values of the it_overshoot_expected variable;
32c1fffd 8657 logic changes accordingly. (Bug#9254) (Bug#9549)
e3cbd34b
EZ
8658
8659 * xdisp.c (pos_visible_p): Produce correct pixel coordinates when
8660 CHARPOS is covered by a display string which includes newlines.
8661 (move_it_vertically_backward): Avoid inflooping when START_CHARPOS
8662 is covered by a display string with embedded newlines.
8663
a3de0cbd
MA
86642011-09-24 Michael Albinus <michael.albinus@gmx.de>
8665
8666 * dbusbind.c (Fdbus_register_signal): Add match rule to
8667 Vdbus_registered_objects_table. (Bug#9581)
a66cfb1c
SM
8668 (Fdbus_register_method, Vdbus_registered_objects_table):
8669 Fix docstring.
a3de0cbd 8670
b260039d
JM
86712011-09-24 Jim Meyering <meyering@redhat.com>
8672
32c1fffd 8673 do not ignore write error for any output size
b260039d
JM
8674 The previous change was incomplete.
8675 While it makes emacs --batch detect the vast majority of stdout
8676 write failures, errors were still ignored whenever the output size is
8677 k * (BUFSIZ+1) - 4. E.g., on a system with BUFSIZ of 4096,
8678 $ emacs --batch --eval '(print (format "%4093d" 0))' > /dev/full \
8679 && echo FAIL: ignored write error
8680 FAIL: ignored write error
8681 $ emacs --batch --eval '(print (format "%20481d" 0))' > /dev/full \
8682 && echo FAIL: ignored write error
8683 FAIL: ignored write error
8684 * emacs.c (Fkill_emacs): Also test ferror. (Bug#9574)
8685
8eca8a7c
AS
86862011-09-23 Andreas Schwab <schwab@linux-m68k.org>
8687
8688 * emacs.c (Fkill_emacs): In noninteractive mode exit
8689 non-successfully if a write error occurred on stdout. (Bug#9574)
8690
3341db62
EZ
86912011-09-21 Eli Zaretskii <eliz@gnu.org>
8692
8693 * xdisp.c (pop_it): Allow it->object that is a cons cell to pass
8694 the xassert test.
8695
8696 * dispextern.h (struct it): Update the comment documenting what
8697 can it->OBJECT be.
8698
8c203dbf
EZ
86992011-09-20 Eli Zaretskii <eliz@gnu.org>
8700
8701 * xdisp.c (set_cursor_from_row): If the row ends in a newline from
8702 a display string, extend search for cursor position to end of row.
8703 (find_row_edges): If the row ends in a newline from a display
8704 string, increment its MATRIX_ROW_END_CHARPOS by one. (Bug#9549)
8705 Handle the case of a display string with multiple newlines.
fd317ddf
EZ
8706 (Fcurrent_bidi_paragraph_direction): Fix search for previous
8707 non-empty line. Fixes confusing cursor motion with arrow keys at
8708 the beginning of a line that starts with whitespace.
8c203dbf 8709
a4824228
LMI
87102011-09-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
8711
8712 * lread.c (Fread_from_string): Document what FINAL-STRING-INDEX is
8713 (bug#9493).
8714
33ed493b
CY
87152011-09-18 Chong Yidong <cyd@stupidchicken.com>
8716
8717 * xfns.c (Fx_create_frame): Handle the bitmapIcon resource as
8718 boolean (Bug#9154).
8719
56cd55c8
EZ
87202011-09-18 Eli Zaretskii <eliz@gnu.org>
8721
8722 * xdisp.c (display_line): Record maximum and minimum buffer
8723 positions even if no glyphs were produced (e.g., by a zero-width
8724 stretch). Fixes bug#9530 on a TTY. Under word-wrap, don't record
8725 buffer positions that will be removed from the glyph row because
8726 they don't fit.
c02dcedf
EZ
8727 (produce_stretch_glyph): Fix a bug in :align-to on a TTY when the
8728 column is beyond frame width: don't subtract 1 "pixel" when
8729 computing width of the stretch.
3e62b7e0
EZ
8730 (reseat_at_next_visible_line_start): Undo the change made on
8731 2011-09-17 that saved paragraph information and restored it after
8732 the call to `reseat'. (Bug#9545)
56cd55c8 8733
5ed99d36 87342011-09-18 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
3390454c
YM
8735
8736 * xdisp.c (expose_window): Save original value of phys_cursor_on_p
8737 and turn window cursor on if cleared (Bug#9415).
8738
5ed99d36 87392011-09-18 Andreas Schwab <schwab@linux-m68k.org>
edb7b4dc
AS
8740
8741 * search.c (boyer_moore): Take unibyte characters from pattern
8742 literally. (Bug#9458)
8743
9bade7b2
EZ
87442011-09-18 Eli Zaretskii <eliz@gnu.org>
8745
8746 * xdisp.c (reseat_at_next_visible_line_start): Fix last change.
8747
e5e9d610
PE
87482011-09-18 Paul Eggert <eggert@cs.ucla.edu>
8749
87e4427a
PE
8750 Fix minor problem found by static checking.
8751 * xdisp.c (reseat_at_next_visible_line_start): Mark locals as
8752 initialized, to pacify gcc -Wuninitialized.
8753
e5e9d610
PE
8754 * fileio.c: Report proper errno when syscall falls.
8755 (Finsert_file_contents): Save and restore errno,
8756 so that report_file_error outputs the correct diagnostic.
8757 (Fwrite_region) [CLASH_DETECTION]: Likewise.
8758
a1674f0b
EZ
87592011-09-18 Eli Zaretskii <eliz@gnu.org>
8760
8761 * .gdbinit (pgx): Fix references to fields of `struct glyph'.
8762
fbfb6dd4
EZ
87632011-09-17 Eli Zaretskii <eliz@gnu.org>
8764
8765 * xdisp.c (produce_stretch_glyph): Another fix for changes made on
8766 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9530)
8767
bb187662
EZ
87682011-09-17 Eli Zaretskii <eliz@gnu.org>
8769
1137e8b8 8770 * xdisp.c (reseat_at_next_visible_line_start): Keep information
6b02f655 8771 about the current paragraph and restore it after the call to reseat.
1137e8b8
EZ
8772
8773 * bidi.c (MAX_PARAGRAPH_SEARCH): New macro.
8774 (bidi_find_paragraph_start): Search back for paragraph beginning
8775 at most MAX_PARAGRAPH_SEARCH lines; if not found, return BEGV_BYTE.
8776 (bidi_move_to_visually_next): Only trigger paragraph-related
8777 computations when the last character is a newline or at EOB, not
8778 just any NEUTRAL_B. (Bug#9470)
8779
bb187662
EZ
8780 * xdisp.c (set_cursor_from_row): Don't invoke special treatment of
8781 truncated lines if point is covered by a display string. (Bug#9524)
8782
2e621251
PE
87832011-09-16 Paul Eggert <eggert@cs.ucla.edu>
8784
8785 * xselect.c: Relax test for outgoing X longs (Bug#9498).
8786 (cons_to_x_long): New function.
8787 (lisp_data_to_selection_data): Use it. Correct the test for
8788 short-versus-long data; it was negated. Break out of vector
8789 loop, for efficiency, when a long datum is discovered.
8790
91a15bc6
SM
87912011-09-16 Stefan Monnier <monnier@iro.umontreal.ca>
8792
8793 * eval.c (Fquote): Document its non-consing behavior (bug#9482).
8794
b41c3a35
EZ
87952011-09-16 Eli Zaretskii <eliz@gnu.org>
8796
8797 * image.c (tiff_handler): Work around a bug in MinGW GCC 3.x (see
8798 GCC PR/17406) by declaring this function with external scope.
8799
7812ba2d
PE
88002011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8801
8802 * editfns.c (Fformat): Fix bug in text-property fix (Bug#9514).
8803 Don't mishandle (length (format "%%")) and (format "%4000s%%" "").
8804
cf7edc2a
AS
88052011-09-15 Andreas Schwab <schwab@linux-m68k.org>
8806
8807 * editfns.c (Fformat): Correctly handle text properties on "%%".
8808
bd01620e
EZ
88092011-09-15 Eli Zaretskii <eliz@gnu.org>
8810
8811 * xterm.c (x_draw_composite_glyph_string_foreground):
8812 * w32term.c (x_draw_composite_glyph_string_foreground):
8813 * term.c (encode_terminal_code):
8814 * composite.c (composition_update_it, get_composition_id):
8815 * xdisp.c (get_next_display_element)
8816 (fill_composite_glyph_string): Add comments about special meaning
8817 of TAB characters in a composition.
8818
a02719a3
PE
88192011-09-15 Paul Eggert <eggert@cs.ucla.edu>
8820
8821 * editfns.c (Fformat): Fix off-by-1 bug for "%%b" (Bug#9514).
4c122725
PE
8822 This occurs when processing a multibyte format.
8823 Problem reported by Wolfgang Jenker.
a02719a3 8824
72589a3c
JB
88252011-09-15 Johan Bockgård <bojohan@gnu.org>
8826
8827 * xdisp.c (try_cursor_movement): Only check for exact match if
8828 cursor hpos found by set_cursor_from_row is valid. (Bug#9495)
8829
1c14176c
PE
88302011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8831
8832 Remove unused external symbols.
8833 * dispextern.h (calc_pixel_width_or_height): Remove decl.
8834 * xdisp.c (calc_pixel_width_or_height): Now static.
8835 * doprnt.c (exprintf) [! (HAVE_X_WINDOWS && USE_X_TOOLKIT)]: Remove.
8836 * indent.c (check_display_width):
8837 * w32term.c: Fix comment to match code.
8838 * xterm.c, xterm.h (x_catching_errors): Remove.
8839
d2eea5b5
PE
88402011-09-14 Paul Eggert <eggert@cs.ucla.edu>
8841
8842 * xselect.c: Use signed conversions more consistently (Bug#9498).
8843 (selection_data_to_lisp_data): Assume incoming selection data are
8844 signed integers, not unsigned. This is to be consistent with
8845 outgoing selection data, which was modified to use signed integers
8846 in as part of the fix to Bug#9196 in response to Jan D.'s comment
8847 in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9196#32> that X11
8848 expects long, not unsigned long.
8849
46888499
EZ
88502011-09-14 Eli Zaretskii <eliz@gnu.org>
8851
8852 * xdisp.c (try_window_reusing_current_matrix): Fix incorrect
8853 computation of loop end. Reported by Johan Bockgård
8854 <bojohan@gnu.org>.
8855
ef8ef9fb
CY
88562011-09-13 Chong Yidong <cyd@stupidchicken.com>
8857
8858 * frame.c (Fother_visible_frames_p): Function deleted.
8859
fa819fed
EZ
88602011-09-12 Eli Zaretskii <eliz@gnu.org>
8861
8862 * indent.c (compute_motion): Process display vector front to back
8863 rather than the other way around. (Bug#2496)
8864
2ba8e008
SM
88652011-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
8866
8867 * fileio.c (Finsert_file_contents): Don't assume beg_offset is 0.
8868
20f53c69
CY
88692011-09-11 Chong Yidong <cyd@stupidchicken.com>
8870
8871 * minibuf.c (Fread_from_minibuffer): Doc fix.
8872
d562d7a4
EZ
88732011-09-11 Eli Zaretskii <eliz@gnu.org>
8874
8875 * xdisp.c (produce_stretch_glyph): Fix a typo made in changes from
8876 2011-08-30T17:32:44Z!eliz@gnu.org. (Bug#9475)
8877
1c4d7f3d
LMI
88782011-09-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
8879
8880 * fileio.c (Fvisited_file_modtime): Document `(-1 65535)' as a
8881 value for non-existent files.
8882
b885bf36
EZ
88832011-09-11 Eli Zaretskii <eliz@gnu.org>
8884
8885 * fileio.c (Finsert_file_contents): If the file cannot be opened,
8886 set its "size" to -1. This will set the modtime_size field of
8887 the corresponding buffer to -1, which is what
8888 verify-visited-file-modtime expects for files that do not exist.
8889 (Bug#9139)
8890
6612f0bf
PE
88912011-09-11 Paul Eggert <eggert@cs.ucla.edu>
8892
8893 * keymap.h (KEY_DESCRIPTION_SIZE, push_key_description): Move decls
8894 here ...
8895 * lisp.h: ... from here. push_key_description is no longer
8896 defined in keyboard.c, so its declaration should not be in
8897 lisp.h's "Defined in keyboard.c" section, and KEY_DESCRIPTION_SIZE
8898 logically belongs with push_key_description.
8899
dfb3f755
PE
89002011-09-10 Paul Eggert <eggert@cs.ucla.edu>
8901
8902 * buffer.h: Include <sys/types.h> instead of <time.h>.
8903 Otherwise, off_t wasn't defined on FreeBSD 9.0-BETA2 i386.
8904 Problem reported by Herbert J. Skuhra.
8905
3134906c
LMI
89062011-09-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
8907
8908 * xml.c (parse_region): Make the parsing work for
8909 non-comment-starting XML files again (bug#9144).
8910
8d903f4e
AS
89112011-09-10 Andreas Schwab <schwab@linux-m68k.org>
8912
8913 * image.c (gif_load): Fix calculation of bottom and right corner.
8914 (Bug#9468)
8915
80ad64f4
EZ
89162011-09-10 Eli Zaretskii <eliz@gnu.org>
8917
8918 * xdisp.c (MAX_DISP_SCAN): Decrease to 250. Prevents sluggish
8919 redisplay in small windows.
8920
208a048d
EZ
89212011-09-09 Eli Zaretskii <eliz@gnu.org>
8922
8923 * frame.c (x_report_frame_params): Cast to avoid compiler warnings.
8924
9b1c252e
MR
89252011-09-08 Martin Rudalics <rudalics@gmx.at>
8926
8927 * window.c (Fset_window_prev_buffers, Fset_window_next_buffers):
8928 Operate on live windows only.
8929
2949f33b
JB
89302011-09-08 Juanma Barranquero <lekktu@gmail.com>
8931
8932 * emacs.c (my_heap_start): #ifdef to avoid warnings when unused.
8933
e08dcafd
EZ
89342011-09-07 Eli Zaretskii <eliz@gnu.org>
8935
8936 * xdisp.c (move_it_in_display_line_to): Call RESTORE_IT on ppos_it
8937 only under bidi iteration.
8938
115b96bd
JD
89392011-09-07 Jan Djärv <jan.h.d@swipnet.se>
8940
8941 * gtkutil.c (xg_make_tool_item): Insert comment about eventbox.
8942
c8199d0f
PE
89432011-09-06 Paul Eggert <eggert@cs.ucla.edu>
8944
8945 isnan: Fix porting problem to Solaris 10 with bundled gcc.
8946 Without this fix, the command to link temacs failed due to an
8947 undefined symbol __builtin_isnan. This is because
8948 /usr/include/iso/math_c99.h #defines isnan(x) to
8949 __builtin_isnan(x), but the bundled gcc, which identifies itself
8950 as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have
8951 a __builtin_isnan.
8952 * floatfns.c (isnan): #undef, and then #define to a clone of
8953 what's in data.c.
8954 (Fisnan): Always define, since it's always available now.
8955 (syms_of_floatfns): Always define isnan at the Lisp level.
8956
e39b275c 89572011-09-06 Paul Eggert <eggert@cs.ucla.edu>
1c262cae
PE
8958
8959 * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169).
8960
b2db44d9 89612011-09-06 Paul Eggert <eggert@cs.ucla.edu>
728f8f0a 8962
f4af5137 8963 * fileio.c: Fix bugs with large file offsets (Bug#9428).
728f8f0a
PE
8964 The previous code assumed that file offsets (off_t values) fit in
8965 EMACS_INT variables, which is not true on typical 32-bit hosts.
8966 The code messed up by falsely reporting buffer overflow in cases
8967 such as (insert-file-contents "big" nil 1 2) into an empty buffer
8968 when "big" contains more than 2**29 bytes, even though this
8969 inserts just one byte and does not overflow the buffer.
8970 (Finsert_file_contents): Store file offsets as off_t
8971 values, not as EMACS_INT values. Check for overflow when
8972 converting between EMACS_INT and off_t. When checking for
8973 buffer overflow or for overlap, take the offsets into account.
8974 Don't use EMACS_INT for small values where int suffices.
8975 When checking for overlap, fix a typo: ZV was used where
8976 ZV_BYTE was intended.
8977 (Fwrite_region): Don't assume off_t fits into 'long'.
8978 * buffer.h (struct buffer.modtime_size): Now off_t, not EMACS_INT.
8979
ecfc0a49
MA
89802011-09-05 Michael Albinus <michael.albinus@gmx.de>
8981
8982 * dbusbind.c (xd_signature_cat): Rename from signature_cat.
8983
6511acf2 89842011-09-04 Paul Eggert <eggert@cs.ucla.edu>
61bfeeb7 8985
0999621a 8986 sprintf-related integer and memory overflow issues (Bug#9412).
62f19c19
PE
8987
8988 * doprnt.c (doprnt): Support printing ptrdiff_t and intmax_t values.
8666506e 8989 (esprintf, exprintf, evxprintf): New functions.
62f19c19 8990 * keyboard.c (command_loop_level): Now EMACS_INT, not int.
6b02f655 8991 (cmd_error): Kbd macro iterations count is now EMACS_INT, not int.
62f19c19
PE
8992 (modify_event_symbol): Do not assume that the length of
8993 name_alist_or_stem is safe to alloca and fits in int.
8994 (Fexecute_extended_command): Likewise for function name and binding.
8995 (Frecursion_depth): Wrap around reliably on integer overflow.
8996 * keymap.c (push_key_description): First arg is now EMACS_INT, not int,
8997 since some callers pass EMACS_INT values.
8998 (Fsingle_key_description): Don't crash if symbol name contains more
8999 than MAX_ALLOCA bytes.
9000 * minibuf.c (minibuf_level): Now EMACS_INT, not int.
9001 (get_minibuffer): Arg is now EMACS_INT, not int.
9002 * lisp.h (get_minibuffer, push_key_description): Reflect API changes.
8666506e 9003 (esprintf, exprintf, evxprintf): New decls.
62f19c19
PE
9004 * window.h (command_loop_level, minibuf_level): Reflect API changes.
9005
2be7d702
PE
9006 * dbusbind.c (signature_cat): New function.
9007 (xd_signature, Fdbus_register_signal):
2ea16b89
PE
9008 Do not overrun buffer; instead, report string overflow.
9009
9d1df220
PE
9010 * dispnew.c (add_window_display_history): Don't overrun buffer.
9011 Truncate instead; this is OK since it's just a log.
9012
33ef5c64
PE
9013 * editfns.c (Fcurrent_time_zone): Don't overrun buffer
9014 even if the time zone offset is outlandishly large.
9015 Don't mishandle offset == INT_MIN.
9016
66c6fdd5
PE
9017 * emacs.c (main) [NS_IMPL_COCOA]: Don't overrun buffer
9018 when creating daemon; the previous buffer-overflow check was incorrect.
9019
d749b01b
PE
9020 * eval.c (verror): Simplify by rewriting in terms of evxprintf,
9021 which has the guts of the old verror function.
9022
b5cd1905
PE
9023 * filelock.c (lock_file_1, lock_file): Don't blindly alloca long name;
9024 use SAFE_ALLOCA instead. Use esprintf to avoid int-overflow issues.
9025
6e1a67fb
PE
9026 * font.c: Include <float.h>, for DBL_MAX_10_EXP.
9027 (font_unparse_xlfd): Don't blindly alloca long strings.
c21721cc 9028 Don't assume XINT result fits in int, or that XFLOAT_DATA * 10
8666506e 9029 fits in int, when using sprintf. Use single snprintf to count
c21721cc
PE
9030 length of string rather than counting it via multiple sprintfs;
9031 that's simpler and more reliable.
c21721cc
PE
9032 (font_unparse_fcname): Use it to avoid sprintf buffer overrun.
9033 (generate_otf_features) [0 && HAVE_LIBOTF]: Use esprintf, not
9034 sprintf, in case result does not fit in int.
9035
c57b67fc
PE
9036 * fontset.c (num_auto_fontsets): Now printmax_t, not int.
9037 (fontset_from_font): Print it.
9038
8a401434
PE
9039 * frame.c (tty_frame_count): Now printmax_t, not int.
9040 (make_terminal_frame, set_term_frame_name): Print it.
9041 (x_report_frame_params): In X, window IDs are unsigned long,
9042 not signed long, so print them as unsigned.
9043 (validate_x_resource_name): Check for implausibly long names,
9044 and don't assume name length fits in 'int'.
9045 (x_get_resource_string): Don't blindly alloca invocation name;
9046 use SAFE_ALLOCA. Use esprintf, not sprintf, in case result does
9047 not fit in int.
9048
6e1a67fb
PE
9049 * gtkutil.c: Include <float.h>, for DBL_MAX_10_EXP.
9050 (xg_check_special_colors, xg_set_geometry):
84722b3d
PE
9051 Make sprintf buffers a bit bigger, to avoid potential buffer overrun.
9052
0df02bf3
PE
9053 * lread.c (dir_warning): Don't blindly alloca buffer; use SAFE_ALLOCA.
9054 Use esprintf, not sprintf, in case result does not fit in int.
9055
48e30793
PE
9056 * macros.c (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9057 (Fend_kbd_macro): Don't mishandle MOST_NEGATIVE_FIXNUM by treating
9058 it as a large positive number.
9059 (Fexecute_kbd_macro): Don't assume repeat count fits in int.
9060 * macros.h (executing_kbd_macro_iterations): Now EMACS_INT, not int.
9061
a66ff6d8
PE
9062 * nsterm.m ((NSSize)windowWillResize): Use esprintf, not sprintf,
9063 in case result does not fit in int.
9064
aca216ff
PE
9065 * print.c (float_to_string): Detect width overflow more reliably.
9066 (print_object): Make sprintf buffer a bit bigger, to avoid potential
9067 buffer overrun. Don't assume list length fits in 'int'. Treat
9068 print length of 0 as 0, not as infinity; to be consistent with other
9069 uses of print length in this function. Don't overflow print length
9070 index. Don't assume hash table size fits in 'long', or that
9071 vectorlike size fits in 'unsigned long'.
9072
31c286f7
PE
9073 * process.c (make_process): Use printmax_t, not int, to format
9074 process-name gensyms.
9075
55e5faa1
PE
9076 * sysdep.c (snprintf) [! HAVE_SNPRINTF]: New function.
9077
80f2e268
PE
9078 * term.c (produce_glyphless_glyph): Make sprintf buffer a bit bigger
9079 to avoid potential buffer overrun.
9080
670741ab
PE
9081 * xfaces.c (x_update_menu_appearance): Don't overrun buffer
9082 if X resource line is longer than 512 bytes.
9083
b7163a50
PE
9084 * xfns.c (x_window): Make sprintf buffer a bit bigger
9085 to avoid potential buffer overrun.
9086
ae58ff1f
PE
9087 * xterm.c (x_io_error_quitter): Don't overrun sprintf buffer.
9088
c43c8a6a
PE
9089 * xterm.h (x_check_errors): Add ATTRIBUTE_FORMAT_PRINTF.
9090
3f8236f4
PE
90912011-09-04 Paul Eggert <eggert@cs.ucla.edu>
9092
53e9fe90 9093 Integer overflow fixes for scrolling, etc.
6511acf2
PE
9094 Without these, Emacs silently mishandles large integers sometimes.
9095 For example, "C-u 4294967297 M-x recenter" was treated as if
53e9fe90
PE
9096 it were "C-u 1 M-x recenter" on a typical 64-bit host.
9097
6511acf2
PE
9098 * xdisp.c (try_window_id): Check Emacs fixnum range before
9099 converting to 'int'.
806add1d 9100
6511acf2 9101 * window.c (window_scroll_line_based, Frecenter):
71f02bc5
PE
9102 Check that an Emacs fixnum is in range before assigning it to 'int'.
9103 (Frecenter, Fmove_to_window_line): Use EMACS_INT, not int, for
9104 values converted from Emacs fixnums.
9105 (Frecenter): Don't wrap around a line count if it is out of 'int'
9106 range; instead, treat it as an extreme value.
9107 (Fset_window_configuration, compare_window_configurations):
9108 Use ptrdiff_t, not int, for index that might exceed 2 GiB.
9109
6511acf2
PE
9110 * search.c (Freplace_match): Use ptrdiff_t, not int, for indexes
9111 that can exceed INT_MAX. Check that EMACS_INT value is in range
9112 before assigning it to the (possibly-narrower) index.
a0efffc8
PE
9113 (match_limit): Don't assume that a fixnum can fit in 'int'.
9114
6511acf2 9115 * print.c (print_object): Use ptrdiff_t, not int, for index that can
29ebea3b
PE
9116 exceed INT_MAX.
9117
6511acf2 9118 * indent.c (position_indentation): Now takes ptrdiff_t, not int.
3f8236f4
PE
9119 (Fvertical_motion): Don't wrap around LINES values that don't fit
9120 in 'int'. Instead, treat them as extreme values. This is good
9121 enough for windows, which can't have more than INT_MAX lines anyway.
9122
fcb901a7
LMI
91232011-09-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
9124
0f2f6b6d
LMI
9125 * Require libxml/parser.h to avoid compilation warning.
9126
fcb901a7
LMI
9127 * emacs.c (shut_down_emacs): Call xmlCleanupParser on shutdown.
9128
9129 * xml.c (parse_region): Don't call xmlCleanupParser after parsing,
9130 since this reportedly can destroy thread storage.
9131
6e20a0d4
CY
91322011-08-30 Chong Yidong <cyd@stupidchicken.com>
9133
9134 * syntax.c (find_defun_start): Update all cache variables if
9135 exiting early (Bug#9401).
9136
148ae00e
EZ
91372011-08-30 Eli Zaretskii <eliz@gnu.org>
9138
f6cfbd8f
EZ
9139 * image.c (x_bitmap_pixmap): Cast to int to avoid compiler warnings.
9140
148ae00e
EZ
9141 * xdisp.c (produce_stretch_glyph): No longer static, compiled also
9142 when HAVE_WINDOW_SYSTEM is not defined. Support both GUI and TTY
9143 frames. Call tty_append_glyph in the TTY case. (Bug#9402)
9144
9145 * term.c (tty_append_glyph): New function.
9146 (produce_stretch_glyph): Static function and its prototype deleted.
9147
a66cfb1c
SM
9148 * dispextern.h (produce_stretch_glyph, tty_append_glyph):
9149 Add prototypes.
148ae00e 9150
c4a07a4c
PE
91512011-08-29 Paul Eggert <eggert@cs.ucla.edu>
9152
9153 * image.c (parse_image_spec): Check for nonnegative, not for positive,
9154 when checking :margin (Bug#9390).
9155 (IMAGE_NON_NEGATIVE_INTEGER_VALUE_OR_PAIR):
a66cfb1c 9156 Rename from IMAGE_POSITIVE_INTEGER_VALUE_OR_PAIR,
c4a07a4c
PE
9157 so that the name doesn't mislead. All uses changed.
9158
6bc8cd65
JB
91592011-08-28 Johan Bockgård <bojohan@gnu.org>
9160
9161 * term.c (init_tty) [HAVE_GPM]: Move mouse settings after
9162 set_tty_hooks.
9163
dca4927e
EZ
91642011-08-27 Eli Zaretskii <eliz@gnu.org>
9165
9166 * xdisp.c (move_it_to): Don't bail out early when reaching
9167 position beyond to_charpos, if we are scanning backwards.
9168 (move_it_vertically_backward): When DY == 0, make sure we get to
9169 the first character in the line after the newline.
9170
f2cad773
PE
91712011-08-27 Paul Eggert <eggert@cs.ucla.edu>
9172
9173 * ccl.c: Improve and simplify overflow checking (Bug#9196).
9174 (ccl_driver): Do not generate an out-of-range pointer.
9175 (Fccl_execute_on_string): Remove unnecessary check for
9176 integer overflow, noted by Stefan Monnier in
9177 <http://lists.gnu.org/archive/html/emacs-devel/2011-08/msg00979.html>.
9178 Remove a FIXME that didn't need fixing.
9179 Simplify the newly-introduced buffer reallocation code.
9180
0cae2cdb
JB
91812011-08-27 Juanma Barranquero <lekktu@gmail.com>
9182
9183 * makefile.w32-in ($(BLD)/alloc.$(O)): Depend on lib/verify.h.
9184
5fc295a4 91852011-08-26 Paul Eggert <eggert@cs.ucla.edu>
ddff3151 9186
70c60eb2 9187 Integer and memory overflow issues (Bug#9196).
726e0ab1 9188
d31850da
PE
9189 * doc.c (get_doc_string): Rework so that
9190 get_doc_string_buffer_size is the actual buffer size, rather than
9191 being 1 less than the actual buffer size; this makes xpalloc more
9192 convenient.
9193
a69fbedb
PE
9194 * image.c (x_allocate_bitmap_record, cache_image):
9195 * xselect.c (Fx_register_dnd_atom):
9196 Simplify previous changes by using xpalloc.
9197
fe5c5d37
PE
9198 * buffer.c (overlay_str_len): Now ptrdiff_t, not EMACS_INT,
9199 since either will do and ptrdiff_t is convenient with xpalloc.
9200
0065d054
PE
9201 * charset.c (charset_table_size)
9202 (struct charset_sort_data.priority): Now ptrdiff_t.
9203 (charset_compare): Don't overflow if priorities differ greatly.
9204 (Fsort_charsets): Don't assume list length fits in int.
9205 Check for size-calculation overflow when allocating sort data.
9206 (syms_of_charset): Allocate an initial charset table that is
9207 just under 64 KiB, to avoid problems with glibc malloc and mmap.
9208
9209 * cmds.c (internal_self_insert): Check for size-calculation overflow.
9210
9211 * composite.h (struct composition.glyph_len): Now int, not unsigned.
9212 The actual value is always <= INT_MAX, and leaving it unsigned made
9213 overflow checking harder.
9214
9215 * dispextern.h (struct glyph_matrix.rows_allocated)
9216 (struct face_cache.size): Now ptrdiff_t, for convenience in use
9217 with xpalloc. The values are still always <= INT_MAX.
9218
9219 * indent.c (compute_motion): Adjust to region_cache_forward sig change.
9220
9221 * lisp.h (xnmalloc, xnrealloc, xpalloc): New decls.
9222 (SAFE_NALLOCA): New macro.
9223
9224 * region-cache.c (struct boundary.pos, find_cache_boundary)
9225 (move_cache_gap, insert_cache_boundary, delete_cache_boundaries)
9226 (set_cache_region, invalidate_region_cache)
9227 (revalidate_region_cache, know_region_cache, region_cache_forward)
9228 (region_cache_backward, pp_cache):
9229 Use ptrdiff_t, not EMACS_INT, since either will do. This is needed
9230 so that ptrdiff_t * can be passed to xpalloc.
9231 (struct region_cache): Similarly, for gap_start, gap_len, cache_len,
9232 beg_unchanged, end_unchanged, buffer_beg, buffer_end members.
9233 (pp_cache): Don't assume cache_len fits in int.
9234 * region-cache.h: Adjust extern decls to match.
9235
9236 * search.c (scan_buffer, Freplace_match): Use ptrdiff_t, not
9237 EMACS_INT, since either will do, for xpalloc.
9238
9239 * alloc.c: Include verify.h, and check that int fits in ptrdiff_t.
9240 (xnmalloc, xnrealloc, xpalloc): New functions.
9241
726e0ab1
PE
9242 * bidi.c (bidi_shelve_header_size): New constant.
9243 (bidi_cache_ensure_space, bidi_shelve_cache): Use it.
9244 (bidi_cache_ensure_space): Avoid integer overflow when allocating.
9245
51f30bc5 9246 * bidi.c (bidi_cache_shrink):
726e0ab1
PE
9247 * buffer.c (overlays_at, overlays_in, record_overlay_string)
9248 (overlay_strings):
9249 Don't update size of array until after memory allocation succeeds,
9250 because xmalloc/xrealloc may not return.
0065d054
PE
9251 (struct sortstrlist.bytes): Now ptrdiff_t, as EMACS_INT doesn't help
9252 now that we have proper integer overflow checking.
9253 (record_overlay_string, overlay_strings): Catch overflows when
9254 calculating size of overlay_str_buf.
726e0ab1 9255
0065d054
PE
9256 * callproc.c (Fcall_process): Check for size overflow when
9257 calculating size of args2.
9258 (child_setup): Avoid overflow by using size_t rather than ptrdiff_t.
9259 Normally we prefer signed values, but sticking with ptrdiff_t would
9260 require adding more-complicated checks.
726e0ab1
PE
9261
9262 * ccl.c (Fccl_execute_on_string): Check for memory overflow.
9263 Use ptrdiff_t rather than EMACS_INT where ptrdiff_t will do.
9264 Redo buffer-overflow calculations to avoid integer overflow.
0065d054 9265 Add a FIXME comment where memory seems to be over-allocated.
726e0ab1
PE
9266
9267 * character.c (Fstring): Check for size-calculation overflow.
9268
9269 * coding.c (produce_chars): Redo buffer-overflow calculations to avoid
9270 unnecessary integer overflow. Check for size overflow.
9271 (encode_coding_object): Don't update size until xmalloc succeeds.
9272
9273 * composite.c (get_composition_id): Check for overflow in glyph
9274 length calculations.
9275
9276 Integer and memory overflow fixes for display code.
9277 * dispextern.h (struct glyph_pool.nglyphs): Now ptrdiff_t, not int.
9278 * dispnew.c (adjust_glyph_matrix, realloc_glyph_pool)
9279 (scrolling_window): Check for overflow in size calculations.
9280 (line_draw_cost, realloc_glyph_pool, add_row_entry):
9281 Don't assume glyph table len fits in int.
9282 (struct row_entry.bucket, row_entry_pool_size, row_entry_idx)
9283 (row_table_size): Now ptrdiff_t, not int.
9284 (scrolling_window): Avoid overflow in size calculations.
9285 Don't update size until allocation succeeds.
9286 * fns.c (concat): Check for overflow in size calculations.
9287 (next_almost_prime): Verify NEXT_ALMOST_PRIME_LIMIT.
9288 * lisp.h (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9289 (NEXT_ALMOST_PRIME_LIMIT): New constant.
9290
9291 * doc.c (get_doc_string_buffer_size): Now ptrdiff_t, not int.
9292 (get_doc_string): Check for size calculation overflow.
9293 Don't update size until allocation succeeds.
9294 (get_doc_string, Fsubstitute_command_keys): Use ptrdiff_t, not
9295 EMACS_INT, where ptrdiff_t will do.
9296 (Fsubstitute_command_keys): Check for string overflow.
9297
9298 * editfns.c (set_time_zone_rule): Don't assume environment length
9299 fits in int.
9300 (message_length): Now ptrdiff_t, not int.
9301 (Fmessage_box): Don't update size until allocation succeeds.
9302 Don't assume message length fits in int.
9303 (Fformat): Use ptrdiff_t, not EMACS_INT, where ptrdiff_t will do.
9304
0065d054
PE
9305 * emacs.c (main): Do not reallocate argv, since there is a null at
9306 the end that can be overwritten, and this way there's no need to
9307 worry about size-calculation overflow.
9308 (sort_args): Check for size-calculation overflow.
726e0ab1
PE
9309
9310 * eval.c (init_eval_once, grow_specpdl): Don't update size until
9311 alloc succeeds.
9312 (call_debugger, grow_specpdl): Redo calculations to avoid overflow.
9313
9314 * frame.c (set_menu_bar_lines, x_set_frame_parameters)
9315 (x_set_scroll_bar_width, x_figure_window_size):
9316 Check for integer overflow.
9317 (x_set_alpha): Do not assume XINT fits in int.
9318
9319 * frame.h (struct frame): Use int, not EMACS_INT, where int works.
9320 This is for the members text_lines, text_cols, total_lines, total_cols,
9321 where the system imposes an 'int' limit.
9322
9323 * fringe.c (Fdefine_fringe_bitmap):
9324 Don't update size until alloc works.
9325
9326 * ftfont.c (ftfont_get_open_type_spec, setup_otf_gstring)
9327 (ftfont_shape_by_flt): Check for integer overflow in size calculations.
9328
9329 * gtkutil.c (get_utf8_string, xg_store_widget_in_map):
9330 Check for size-calculation overflow.
9331 (get_utf8_string): Use ptrdiff_t, not size_t, where either will
9332 do, as we prefer signed integers.
9333 (id_to_widget.max_size, id_to_widget.used)
9334 (xg_store_widget_in_map, xg_remove_widget_from_map)
9335 (xg_get_widget_from_map, xg_get_scroll_id_for_window)
9336 (xg_remove_scroll_bar, xg_update_scrollbar_pos):
9337 Use and return ptrdiff_t, not int.
9338 (xg_gtk_scroll_destroy): Don't assume ptrdiff_t fits in int.
9339 * gtkutil.h: Change prototypes to match the above.
9340
9341 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): Remove; these
9342 are duplicate now that they've been promoted to lisp.h.
9343 (x_allocate_bitmap_record, x_alloc_image_color)
9344 (make_image_cache, cache_image, xpm_load):
9345 Don't update size until alloc is done.
9346 (xpm_load, lookup_rgb_color, lookup_pixel_color, x_to_xcolors)
9347 (x_detect_edges):
3256efce 9348 Check for size calculation overflow.
726e0ab1
PE
9349 (ct_colors_allocated_max): New constant.
9350 (x_to_xcolors, x_detect_edges): Reorder multiplicands to avoid
9351 overflow.
3256efce 9352
726e0ab1
PE
9353 * keyboard.c (read_char, menu_bar_items, tool_bar_items)
9354 (read_char_x_menu_prompt, read_char_minibuf_menu_width)
9355 (read_char_minibuf_menu_prompt, follow_key, read_key_sequence):
9356 Use ptrdiff_t, not int, to count maps.
9357 (read_char_minibuf_menu_prompt): Check for overflow in size
a66cfb1c
SM
9358 calculations. Don't update size until allocation succeeds.
9359 Redo calculations to avoid overflow.
726e0ab1
PE
9360 * keyboard.h: Change prototypes to match the above.
9361
9362 * keymap.c (cmm_size, current_minor_maps): Use ptrdiff_t, not int,
9363 to count maps.
9364 (current_minor_maps): Check for size calculation overflow.
9365 * keymap.h: Change prototypes to match the above.
9366
9367 * lread.c (read1, init_obarray): Don't update size until alloc done.
9368
9369 * macros.c (Fstart_kbd_macro): Don't update size until alloc done.
9370 (store_kbd_macro_char): Reorder multiplicands to avoid overflow.
9371
726e0ab1
PE
9372 * nsterm.h (struct ns_color_table.size, struct ns_color_table.avail):
9373 Now ptrdiff_t, not int.
9374 * nsterm.m (ns_index_color): Use ptrdiff_t, not int, for table indexes.
9375 (ns_draw_fringe_bitmap): Rewrite to avoid overflow.
9376
9377 * process.c (Fnetwork_interface_list): Check for overflow
9378 in size calculation.
9379
9380 * region-cache.c (move_cache_gap): Check for size calculation overflow.
9381
9382 * scroll.c (do_line_insertion_deletion_costs): Check for size calc
9383 overflow. Don't bother calling xmalloc when xrealloc will do.
9384
9385 * search.c (Freplace_match): Check for size calculation overflow.
9386 (Fset_match_data): Don't assume list lengths fit in 'int'.
9387
9388 * sysdep.c (system_process_attributes): Use ptrdiff_t, not int,
9389 for command line length. Do not attempt to address one before the
9390 beginning of an array, as that's not portable.
9391
9392 * term.c (max_frame_lines): Remove; unused.
9393 (encode_terminal_src_size, encode_terminal_dst_size): Now ptrdiff_t,
9394 not int.
9395 (encode_terminal_code, calculate_costs): Check for size
9396 calculation overflow.
9397 (encode_terminal_code): Use ptrdiff_t, not int, to record glyph
9398 table lengths and related sizes. Don't update size until alloc
9399 done. Redo calculations to avoid overflow.
9400 (calculate_costs): Don't bother calling xmalloc when xrealloc will do.
9401
9402 * termcap.c (tgetent): Use ptrdiff_t, not int, to record results of
9403 subtracting pointers.
9404 (gobble_line): Check for overflow more carefully. Don't update size
9405 until alloc done.
9406
9407 * tparam.c (tparam1): Use ptrdiff_t, not int, for sizes.
9408 Don't update size until alloc done.
9409 Redo size calculations to avoid overflow.
9410 Check for size calculation overflow.
0065d054 9411 (main) [DEBUG]: Fix typo in invoking tparam1.
726e0ab1
PE
9412
9413 * xdisp.c (store_mode_line_noprop_char, x_consider_frame_title):
9414 Use ptrdiff_t, not int, for sizes.
9415 (store_mode_line_noprop_char): Don't update size until alloc done.
9416
0065d054
PE
9417 * xfaces.c (lface_id_to_name_size, Finternal_make_lisp_face):
9418 Use ptrdiff_t, not int, for sizes.
9419 (Finternal_make_lisp_face, cache_face):
9420 Check for size calculation overflow.
9421 (cache_face): Treat size calculation overflows as if they were
9422 memory exhaustion (the usual treatment), rather than aborting.
726e0ab1
PE
9423
9424 * xfns.c (x_encode_text, x_set_name_internal)
9425 (Fx_change_window_property): Use ptrdiff_t, not int, to count
9426 sizes, since they can exceed INT_MAX in size. Check for size
9427 calculation overflow.
9428
0065d054
PE
9429 * xgselect.c (gfds_size): Now ptrdiff_t, for convenience with xpalloc.
9430 (xg_select): Check for size calculation overflow.
726e0ab1
PE
9431 Don't update size until alloc done.
9432
0065d054 9433 * xrdb.c (get_environ_db): Don't assume path length fits in int,
726e0ab1 9434 as sprintf is limited to int lengths.
1d526e2f 9435
252c5ee1
PE
9436 * xselect.c (X_LONG_SIZE, X_SHRT_MAX, X_SHRT_MIN, X_LONG_MAX)
9437 (X_LONG_MIN): New macros.
864d7ce7
PE
9438 Use them to make the following changes clearer.
9439 (MAX_SELECTION_QUANTUM): Make the other bounds on this value clearer.
9440 This change doesn't affect the value now, but it may help remind
9441 future maintainers not to raise the value too much later.
9442 (SELECTION_QUANTUM): Remove, replacing with ...
9443 (selection_quantum): ... new function, which avoids overflow.
9444 All uses changed.
9445 (struct selection_data.size): Now ptrdiff_t, not int, to avoid
9446 assumption that selection length fits in 'int'.
9447 (x_reply_selection_request, x_handle_selection_request)
9448 (x_get_window_property, receive_incremental_selection)
9449 (x_get_window_property_as_lisp_data, selection_data_to_lisp_data)
9450 (lisp_data_to_selection_data, clean_local_selection_data):
9451 Use ptrdiff_t, not int, to record length of selection.
9452 (x_reply_selection_request, x_get_window_property)
9453 (receive_incremental_selection, x_property_data_to_lisp):
9454 Redo calculations to avoid overflow.
9455 (x_reply_selection_request): When sending hint, ceiling it at
252c5ee1 9456 X_LONG_MAX rather than relying on wraparound overflow to send
864d7ce7
PE
9457 something.
9458 (x_get_window_property, receive_incremental_selection)
9459 (lisp_data_to_selection_data, x_property_data_to_lisp):
9460 Check for size-calculation overflow.
9461 (x_get_window_property, receive_incremental_selection)
9462 (lisp_data_to_selection_data, Fx_register_dnd_atom):
9463 Don't store size until memory allocation succeeds.
9464 (x_get_window_property): Plug memory leak on memory exhaustion.
9465 Don't double-block input; malloc is safe here. Don't assume 2**34
9466 - 4 fits in unsigned long. Add an xassert to check
9467 XGetWindowProperty overflow. Be more careful about overflow
9468 calculations, and distinguish size from memory overflow better.
9469 (receive_incremental_selection): When tracing, don't assume
9470 unsigned int is less than INT_MAX.
9471 (x_selection_data_to_lisp_data): Remove unnecessary (and in theory
9472 harmful) conversions of unsigned short to int.
9473 (lisp_data_to_selection_data): Don't assume that integers
9474 in the range -65535 through -1 fit in an X unsigned short.
9475 Don't assume that ULONG_MAX == X_ULONG_MAX. Don't store into
9476 result parameters unless successful. Rely on cons_to_unsigned
9477 to report problems with elements; the old code wasn't right anyway.
9478 (x_check_property_data): Check for int overflow; we cannot use
9479 a wider type due to X limits.
9480 (x_handle_dnd_message): Use unsigned int, to avoid int overflow.
9481
726e0ab1 9482 * xsmfns.c (smc_save_yourself_CB): Check for size calc overflow.
34db673b 9483
0065d054
PE
9484 * xterm.c (x_color_cells, x_send_scrollbar_event, handle_one_xevent)
9485 (x_term_init): Check for size calculation overflow.
726e0ab1
PE
9486 (x_color_cells): Don't store size until memory allocation succeeds.
9487 (handle_one_xevent): Use ptrdiff_t, not int, for byte counts.
0065d054 9488 Don't assume alloca size is less than MAX_ALLOCA.
726e0ab1
PE
9489 (x_term_init): Don't assume length fits in int (sprintf is limited
9490 to int size).
bc18e09d 9491
ebfa62c0
PE
9492 Use ptrdiff_t for composition IDs.
9493 * character.c (lisp_string_width):
9494 * composite.c (composition_table_size, n_compositions)
9495 (get_composition_id, composition_gstring_from_id):
9496 * dispextern.h (struct glyph_string.cmp_id, struct composition_it.id):
9497 * xdisp.c (BUILD_COMPOSITE_GLYPH_STRING):
9498 * window.c (Frecenter):
9499 Use ptrdiff_t, not int, for composition IDs.
9500 * composite.c (get_composition_id): Check for integer overflow.
9501 * composite.h: Adjust prototypes to match the above changes.
9502
d3411f89
PE
9503 Use ptrdiff_t for hash table indexes.
9504 * category.c (hash_get_category_set):
9505 * ccl.c (ccl_driver):
9506 * charset.h (struct charset.hash_index, CHECK_CHARSET_GET_ID):
9507 * coding.c (coding_system_charset_list, detect_coding_system):
9508 * coding.h (struct coding_system.id):
9509 * composite.c (get_composition_id, gstring_lookup_cache):
9510 * fns.c (hash_lookup, hash_put, Fgethash, Fputhash):
9511 * image.c (xpm_get_color_table_h):
9512 * lisp.h (hash_lookup, hash_put):
9513 * minibuf.c (Ftest_completion):
9514 Use ptrdiff_t for hash table indexes, not int (which is too
9515 narrow, on 64-bit hosts) or EMACS_INT (which is too wide, on
9516 32-bit --with-wide-int hosts).
9517
e097a6fa
PE
9518 * charset.c (Fdefine_charset_internal): Check for integer overflow.
9519 Add a FIXME comment about memory leaks.
9520 (syms_of_charset): Don't assume xmalloc returns.
9521
5637687f
PE
9522 Don't assume that stated character widths fit in int.
9523 * character.c (Fchar_width, c_string_width, lisp_string_width):
9524 * character.h (CHAR_WIDTH):
9525 * indent.c (MULTIBYTE_BYTES_WIDTH):
9526 Use sanitize_char_width to avoid undefined and/or bad behavior
9527 with outlandish widths.
a66cfb1c 9528 * character.h (sanitize_tab_width): Rename from sanitize_width,
5637687f
PE
9529 now that we have two such functions. All uses changed.
9530 (sanitize_char_width): New inline function.
9531
a2271ba2
PE
9532 Don't assume that tab-width fits in int.
9533 * character.h (sanitize_width): New inline function.
9534 (SANE_TAB_WIDTH): New macro.
9535 (ASCII_CHAR_WIDTH): Use it.
9536 * indent.c (sane_tab_width): Remove. All uses replaced by
9537 SANE_TAB_WIDTH (current_buffer).
9538 * xdisp.c (init_iterator): Use SANE_TAB_WIDTH.
9539
18c52557
PE
9540 * fileio.c: Integer overflow issues with file modes.
9541 (Fset_file_modes, auto_save_1): Don't assume EMACS_INT fits in int.
9542
caeeedc1
PE
9543 * charset.c (read_hex): New arg OVERFLOW. All uses changed.
9544 Remove unreachable code.
9545 (read_hex, load_charset_map_from_file): Check for integer overflow.
9546
6df6ae42 9547 * xterm.c: Don't go over XClientMessageEvent limit.
50849c52
PE
9548 (scroll_bar_windows_size): Now ptrdiff_t, as we prefer signed.
9549 (x_send_scroll_bar_event): Likewise. Check that the size does not
9550 exceed limits imposed by XClientMessageEvent, as well as the usual
9551 ptrdiff_t and size_t limits.
9552
b13995db
PE
9553 * keyboard.c: Overflow, signedness and related fixes.
9554 (make_lispy_movement): Use same integer type in forward decl
9555 that is used in the definition.
9556 (read_key_sequence, keyremap_step):
9557 Change bufsize argument back to int, undoing my 2011-03-30 change.
9558 We prefer signed types, and int is wide enough here.
9559 (parse_tool_bar_item): Don't assume tool_bar_max_label_size is less
9560 than TYPE_MAXIMUM (EMACS_INT) / 2. Don't let the label size grow
9561 larger than STRING_BYTES_BOUND. Use ptrdiff_t for Emacs string
9562 length, not size_t. Use ptrdiff_t for index, not int.
9563 (keyremap_step, read_key_sequence): Redo bufsize check to avoid
9564 possibility of integer overflow.
9565
13464394
PE
9566 Overflow, signedness and related fixes for images.
9567
9568 * dispextern.h (struct it.stack[0].u.image.image_id)
9569 (struct_it.image_id, struct image.id, struct image_cache.size)
9570 (struct image_cache.used, struct image_cache.ref_count):
9571 * gtkutil.c (update_frame_tool_bar):
9572 * image.c (x_reference_bitmap, Fimage_size, Fimage_mask_p)
9573 (Fimage_metadata, free_image_cache, clear_image_cache, lookup_image)
9574 (cache_image, mark_image_cache, x_kill_gs_process, Flookup_image):
9575 * nsmenu.m (update_frame_tool_bar):
9576 * xdisp.c (calc_pixel_width_or_height):
9577 * xfns.c (image_cache_refcount):
9578 Image IDs are now ptrdiff_t, not int, to avoid arbitrary limits
9579 on typical 64-bit hosts.
9580
9581 * image.c (RANGED_INTEGERP, TYPE_RANGED_INTEGERP): New macros.
9582 (x_bitmap_pixmap, x_create_x_image_and_pixmap):
9583 Omit unnecessary casts to int.
9584 (parse_image_spec): Check that integers fall into 'int' range
9585 when the callers expect that.
9586 (image_ascent): Redo ascent calculation to avoid int overflow.
9587 (clear_image_cache): Avoid overflow when sqrt (INT_MAX) < nimages.
9588 (lookup_image): Remove unnecessary tests.
9589 (xbm_image_p): Locals are now of int, not EMACS_INT,
9590 since parse_image_check makes sure they fit into int.
9591 (png_load, gif_load, svg_load_image):
9592 Prefer int to unsigned where either will do.
9593 (tiff_handler): New function, combining the cores of the
a66cfb1c
SM
9594 old tiff_error_handler and tiff_warning_handler.
9595 This function is rewritten to use vsnprintf and thereby avoid
13464394
PE
9596 stack buffer overflows. It uses only the features of vsnprintf
9597 that are common to both POSIX and native Microsoft.
9598 (tiff_error_handler, tiff_warning_handler): Use it.
9599 (tiff_load, gif_load, imagemagick_load_image):
9600 Don't assume :index value fits in 'int'.
9601 (gif_load): Omit unnecessary cast to double, and avoid double-rounding.
9602 (imagemagick_load_image): Check that crop parameters fit into
9603 the integer types that MagickCropImage accepts. Don't assume
9604 Vimagemagick_render_type has a nonnegative value. Don't assume
9605 size_t fits in 'long'.
9606 (gs_load): Use printmax_t to print the widest integers possible.
9607 Check for integer overflow when computing image height and width.
9608
c11821d4
EZ
96092011-08-26 Eli Zaretskii <eliz@gnu.org>
9610
9611 * xdisp.c (redisplay_window): Don't force window start if point
9612 will be invisible in the resulting window. (Bug#9324)
9613
0c95fcf7
EZ
96142011-08-25 Eli Zaretskii <eliz@gnu.org>
9615
9616 * xdisp.c (compute_display_string_pos): Return 2 in DISP_PROP when
9617 the display spec is of the form `(space ...)'.
9618 (handle_display_spec): Return the value returned by
9619 handle_single_display_spec, not just 1 or zero.
9620 (handle_single_display_spec): If the display spec is of the form
9621 `(space ...)', and specifies display in the text area, return 2
9622 rather than 1.
fee65a97 9623 (try_cursor_movement): Check for the need to scroll more
a66cfb1c
SM
9624 accurately, and prefer exact match for point under bidi.
9625 Don't advance `row' beyond the last row of the window.
0c95fcf7
EZ
9626
9627 * dispextern.h (struct bidi_it): Rename the disp_prop_p member
9628 into disp_prop; all users changed.
9629
9630 * bidi.c (bidi_fetch_char): If compute_display_string_pos returns
9631 DISP_PROP = 2, substitute the u+2029 PARAGRAPH SEPARATOR character
9632 for the text covered by the display property.
9633
e4ed06f1
CY
96342011-08-25 Chong Yidong <cyd@stupidchicken.com>
9635
9636 * buffer.c (Fbury_buffer_internal): Rename from Funrecord_buffer.
9637 Change return value to nil.
9638 (Frecord_buffer): Delete unused function.
9639
f67cdd7f
EZ
96402011-08-24 Eli Zaretskii <eliz@gnu.org>
9641
5980d4c6
EZ
9642 * xdisp.c (Fcurrent_bidi_paragraph_direction): For unibyte
9643 buffers, return left-to-right.
8610fe8b
EZ
9644 (set_cursor_from_row): Consider candidate row a win if its glyph
9645 represents a newline and point is on that newline. Fixes cursor
9646 positioning on the newline at EOL of R2L text within L2R
9647 paragraph, and vice versa.
9648 (try_cursor_movement): Check continued rows, in addition to
9649 continuation rows. Fixes unwarranted scroll when point enters a
9650 continued line of R2L text within an L2R paragraph, or vice versa.
9651 (cursor_row_p): Consider the case of point being equal to
9652 MATRIX_ROW_END_CHARPOS. Prevents cursor being stuck when moving
9653 from the end of a short line to the beginning of a continued line
9654 of R2L text within L2R paragraph.
9655 (RECORD_MAX_MIN_POS): For max_pos, use IT_CHARPOS even for
9656 composed characters.
5980d4c6 9657
f67cdd7f
EZ
9658 * bidi.c (bidi_check_type): Use xassert.
9659 (bidi_cache_iterator_state): Update the disp_pos and disp_prop_p
9660 members.
9661
bca633fb
EZ
96622011-08-23 Eli Zaretskii <eliz@gnu.org>
9663
9664 * bidi.c (bidi_get_type): Abort if we get zero as the bidi type of
9665 a character.
9666
4a5885a7
CY
96672011-08-23 Chong Yidong <cyd@stupidchicken.com>
9668
9669 * nsfont.m (ns_otf_to_script): Fix typo.
9670
0902a04e
KH
96712011-08-22 Kenichi Handa <handa@m17n.org>
9672
9673 * chartab.c (Fset_char_table_extra_slot): Do not inhibit setting a
9674 extra slot even if the purpose is char-code-property-table.
9675
1a2e6670
EZ
96762011-08-23 Eli Zaretskii <eliz@gnu.org>
9677
8ddde651
EZ
9678 * xdisp.c (redisplay_window): When computing centering_position,
9679 account for the height of the header line. (Bug#8874)
9680
425cc014
EZ
9681 * dispnew.c (buffer_posn_from_coords): Use buf_charpos_to_bytepos
9682 instead of CHAR_TO_BYTE. Fixes a crash when a completion
9683 candidate is selected by the mouse, and that candidate has a
9684 composed character under the mouse.
9685
1a2e6670
EZ
9686 * xdisp.c (x_produce_glyphs): Set it->nglyphs to 1. Fixes pixel
9687 coordinates reported by pos-visible-in-window-p for a composed
9688 character in column zero.
9689
8b76d6f8
SM
96902011-08-23 Stefan Monnier <monnier@iro.umontreal.ca>
9691
9692 * cmds.c (Fself_insert_command): Mention post-self-insert-hook.
9693
dac347dd
EZ
96942011-08-22 Eli Zaretskii <eliz@gnu.org>
9695
9696 * xdisp.c (BUFFER_POS_REACHED_P): If this is a composition,
9697 consider it a hit if to_charpos is anywhere in the range of the
9698 composed buffer positions.
9699
e013fb34
CY
97002011-08-22 Chong Yidong <cyd@stupidchicken.com>
9701
9702 * image.c (gif_load): Don't assume that each subimage has the same
9703 dimensions as the base image. Handle disposal method that is
9704 "undefined" by the gif spec (Bug#9335).
9705
bd1ba3e8
CY
97062011-08-20 Chong Yidong <cyd@stupidchicken.com>
9707
9708 * eval.c (Fsignal): Handle `debug' symbol in error handler (Bug#9329).
024a2d76 9709 (Fcondition_case): Document `debug' symbol in error handler.
bd1ba3e8 9710
54a1215b
EZ
97112011-08-19 Eli Zaretskii <eliz@gnu.org>
9712
823564e5
EZ
9713 * xfaces.c (face_at_buffer_position): Avoid repeated evaluation of
9714 face ID by FACE_FROM_ID, and avoid a crash when mouse is moved
9715 from an Org mode buffer to a Speedbar frame.
9716
54a1215b
EZ
9717 * xdisp.c (RECORD_MAX_MIN_POS): If the display element comes from
9718 a composition, take its buffer position from IT->cmp_it.charpos.
9719 Fixes cursor positioning at the beginning of a line that begins
9720 with a composed character.
9721
9778ebcc
EZ
97222011-08-18 Eli Zaretskii <eliz@gnu.org>
9723
0be6ee06
EZ
9724 * bidi.c (bidi_get_type): If bidi_type_table reports zero as the
9725 character bidirectional type, use STRONG_L instead. Fixes crashes
9726 in a buffer produced by `describe-categories'.
9727
9778ebcc
EZ
9728 * dispextern.h (struct bidi_it): Move disp_pos and disp_prop_p
9729 members before the level stack, so they would be saved and
9730 restored when copying iterator state. Fixes incorrect reordering
9731 around TABs covered by display properties.
9732
156bffbe
AS
97332011-08-18 Andreas Schwab <schwab@linux-m68k.org>
9734
6b02f655 9735 * process.c (Fnetwork_interface_list): Correctly determine buffer size.
156bffbe 9736
72ad093b
CY
97372011-08-17 Chong Yidong <cyd@stupidchicken.com>
9738
9739 * eval.c (internal_condition_case, internal_condition_case_1)
8b76d6f8
SM
9740 (internal_condition_case_2, internal_condition_case_n):
9741 Remove unnecessary aborts (Bug#9081).
72ad093b 9742
35774242
EZ
97432011-08-17 Eli Zaretskii <eliz@gnu.org>
9744
9745 * lread.c (Fload) [DOS_NT]: If `openp' returns -2, but the file
9746 has no `load' handler, try opening the file locally. (Bug#9311)
9747
db76dd85
KB
97482011-08-16 Ken Brown <kbrown@cornell.edu>
9749
9750 * gmalloc.c: Expand comment.
9751
b215eee5
EZ
97522011-08-16 Eli Zaretskii <eliz@gnu.org>
9753
9754 * xdisp.c (set_cursor_from_row): Don't accept a previous candidate
9755 if it fails the cursor_row_p test. Fixes cursor positioning at ZV.
9756
a4579d33
KB
97572011-08-16 Ken Brown <kbrown@cornell.edu>
9758
9759 Fix memory allocation problems in Cygwin build (Bug#9273).
9760
9761 * unexcw.c ( __malloc_initialized): Declare external variable.
9762 (fixup_executable): Force the dumped emacs to reinitialize malloc.
9763
8b76d6f8
SM
9764 * gmalloc.c [CYGWIN] (bss_sbrk_heapbase, bss_sbrk_heapinfo):
9765 New variables.
a4579d33
KB
9766 (malloc_initialize_1) [CYGWIN]: Prepare for reinitializing the
9767 dumped emacs.
9768 (_free_internal_nolock) [CYGWIN]: Ignore requests to free storage
9769 in the static heap.
9770 [CYGWIN] (special_realloc): New function.
9771 (_realloc_internal_nolock) [CYGWIN]: Use the new function on
9772 requests to realloc storage in the static heap.
9773
3ebec551
PE
97742011-08-15 Paul Eggert <eggert@cs.ucla.edu>
9775
9776 * bidi.c (bidi_initialize): Remove unused local.
9777
9fd8be00
EZ
97782011-08-15 Eli Zaretskii <eliz@gnu.org>
9779
6b02f655
SM
9780 * bidimirror.h:
9781 * biditype.h: Remove file.
9782 * makefile.w32-in ($(BLD)/bidi.$(O)):
9783 * deps.mk (bidi.o): Remove biditype.h and bidimirror.h.
474a8465
EZ
9784
9785 * dispextern.h: Fix a typo in the comment to bidi_type_t.
9786
9787 * chartab.c: Improve commentary for the uniprop_table API.
9788
32413314
EZ
9789 * bidi.c (bidi_paragraph_init): Support zero value of
9790 bidi_ignore_explicit_marks_for_paragraph_level.
474a8465
EZ
9791 (bidi_initialize): Use uniprop_table instead of including
9792 biditype.h and bidimirror.h.
32413314 9793
9fd8be00
EZ
9794 * xdisp.c (move_it_in_display_line_to): Don't reset pixel
9795 coordinates of the iterator when restoring from ppos_it.
9796 (Bug#9296)
9797
5cf2b69b
KH
97982011-08-14 Kenichi Handa <handa@m17n.org>
9799
9800 * process.c (create_process): Call setup_process_coding_systems
72ad093b 9801 after the pid of the process is set to -1 (Bug#8162).
5cf2b69b 9802
daf17d00
EZ
98032011-08-14 Eli Zaretskii <eliz@gnu.org>
9804
9805 * xdisp.c (move_it_in_display_line_to): Don't invoke
9806 IT_RESET_X_ASCENT_DESCENT when iterator position was restored from
9807 ppos_it. Fixes vertical cursor motion when line beginning is
9808 covered by an image. (Bug#9296)
9809
08e3161a
JD
98102011-08-14 Jan Djärv <jan.h.d@swipnet.se>
9811
9812 * nsterm.h (ns_run_ascript): Declare.
9813 (NSAPP_DATA2_RUNASSCRIPT): Define.
9814
9815 * nsfns.m (as_script, as_result, as_status): New static variables.
9816 (ns_run_ascript): New function.
5e617bc2 9817 (Fns_do_applescript): Set variables as_*. Make an NSApplicationDefined
08e3161a
JD
9818 event with data2 set to NSAPP_DATA2_RUNASSCRIPT, post it and then start
9819 the event loop. Get status from as_status (Bug#7276).
9820
9821 * nsterm.m (sendEvent): If event is NSApplicationDefined and
9822 data2 is NSAPP_DATA2_RUNASSCRIPT, call ns_run_ascript and then exit
9823 the event loop (Bug#7276).
9824
a3720aa2
AS
98252011-08-14 Andreas Schwab <schwab@linux-m68k.org>
9826
9827 * gnutls.c (QCgnutls_bootprop_priority)
9828 (QCgnutls_bootprop_trustfiles, QCgnutls_bootprop_keylist)
9829 (QCgnutls_bootprop_crlfiles, QCgnutls_bootprop_callbacks)
9830 (QCgnutls_bootprop_loglevel, QCgnutls_bootprop_hostname)
9831 (QCgnutls_bootprop_min_prime_bits, QCgnutls_bootprop_verify_flags)
9832 (QCgnutls_bootprop_verify_hostname_error)
9833 (QCgnutls_bootprop_callbacks_verify): Rename from
9834 Qgnutls_bootprop_..., all uses changed.
9835
9836 * xfaces.c (QCignore_defface): Rename from Qignore_defface, all
9837 uses changed.
9838
0a0d27fb
PE
98392011-08-14 Paul Eggert <eggert@cs.ucla.edu>
9840
19d5c50c
PE
9841 * xfaces.c (Qframe_set_background_mode): Now static.
9842 * dispextern.h (Qframe_set_background_mode): Remove decl.
9843
0a0d27fb
PE
9844 * process.c (Fnetwork_interface_info): Declare local only if needed.
9845
377538cb
JD
98462011-08-13 Jan Djärv <jan.h.d@swipnet.se>
9847
9848 * process.c: Include ifaddrs.h and net/if_dl.h if available (Bug#8477).
9849 (Fnetwork_interface_list): Allocate in increments of bytes instead
9850 of sizeof (struct ifreq). Iterate over ifconf.ifc_req by counting
9851 bytes (Bug#8477). Count bytes correctly when ifr_addr is a struct
9852 sockaddr.
9853 (struct ifflag_def): notrailers is smart on OSX.
9854 (Fnetwork_interface_info): Handle case when ifr_flags is negative.
9855 Get hardware address with getifaddrs if available.
9856
08fff70c
EZ
98572011-08-12 Eli Zaretskii <eliz@gnu.org>
9858
9859 * xdisp.c (iterate_out_of_display_property): xassert that
9860 IT->position is set to within IT->object's boundaries. Break from
9861 the loop as soon as EOB is reached; avoids infloops in redisplay
8b76d6f8
SM
9862 when IT->position is set up wrongly due to some bug.
9863 Set IT->current to match the bidi iterator unconditionally.
08fff70c
EZ
9864 (push_display_prop): Allow GET_FROM_STRING as IT->method on
9865 entry. Force push_it to save on the stack the current
9866 buffer/string position, to be restored by pop_it. Fix flags in
9867 the iterator structure wrt the object coming from a display
9868 property, as `line-prefix' and `wrap-prefix' are not ``replacing''
9869 properties. (Bug#9284)
9870
7be1c708 98712011-08-09 Andreas Schwab <schwab@linux-m68k.org>
aac0c6e3 9872
7be1c708
CY
9873 * fontset.c (fontset_get_font_group): Add proper type checks.
9874 (Bug#9172)
aac0c6e3 9875
7be1c708 98762011-08-09 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
aac0c6e3 9877
7be1c708
CY
9878 * unexmacosx.c (print_load_command_name): Add cases LC_FUNCTION_STARTS
9879 and LC_VERSION_MIN_MACOSX.
9880 (copy_linkedit_data) [LC_FUNCTION_STARTS]: New function.
9881 (dump_it) [LC_FUNCTION_STARTS]: Use it.
aac0c6e3 9882
97bb72a6
EZ
98832011-08-08 Eli Zaretskii <eliz@gnu.org>
9884
9885 * xdisp.c (forward_to_next_line_start): Allow to use the
8b76d6f8
SM
9886 no-display-properties-and-no-overlays under bidi display.
9887 Set disp_pos in the bidi iterator to avoid searches for display
757664a4 9888 properties and overlays.
97bb72a6 9889
d5617611
CY
98902011-08-08 Chong Yidong <cyd@stupidchicken.com>
9891
37e11a63
CY
9892 * editfns.c (Fset_time_zone_rule): Document relationship with the
9893 setenv function.
9894
d5617611
CY
9895 * ftfont.c (ftfont_pattern_entity): Copy the extras argument to
9896 the font entity extracted from the cache (Bug#8109).
9897
58872834
CY
98982011-08-07 Chong Yidong <cyd@stupidchicken.com>
9899
9900 * composite.c (autocmp_chars): Don't reset point. That is done by
9901 restore_point_unwind (Bug#5984).
9902
75bfc667
JL
99032011-08-07 Juri Linkov <juri@jurta.org>
9904
9905 * editfns.c (Fformat_time_string): Doc fix, add tag `usage:'
9906 to show the arg `TIME' instead of `TIMEVAL'.
9907
d1410150
EZ
99082011-08-06 Eli Zaretskii <eliz@gnu.org>
9909
9910 * xdisp.c (set_cursor_from_row): Fix cursor positioning when a
9911 display property strides EOL and includes a newline, as in
9912 longlines-mode. (Bug#9254)
75b771e4
EZ
9913 (move_it_in_display_line_to): Fix vertical-motion in a buffer with
9914 word-wrap under bidirectional display. (Bug#9224)
d1410150
EZ
9915
9916 * bidi.c (bidi_unshelve_cache): Don't reset the cache if JUST_FREE
9917 is non-zero, even if the data buffer is NULL. Fixes a crash in
9918 vertical-motion with longlines-mode. (Bug#9254)
9919
35928349
EZ
99202011-08-05 Eli Zaretskii <eliz@gnu.org>
9921
ec7cc85b
EZ
9922 * bidi.c <bidi_cache_total_alloc>: Now static.
9923 (bidi_initialize): Initialize bidi_cache_total_alloc.
9924
8b76d6f8 9925 * xdisp.c (display_line): Release buffer allocated for shelved bidi
35928349
EZ
9926 cache. (Bug#9221)
9927
9928 * bidi.c (bidi_shelve_cache, bidi_unshelve_cache): Track total
9929 amount allocated this far in `bidi_cache_total_alloc'.
9930 (bidi_unshelve_cache): Accept an additional argument JUST_FREE; if
9931 non-zero, only free the data buffer without restoring the cache
9932 contents. All callers changed.
9933
9934 * dispextern.h (bidi_unshelve_cache): Update prototype.
9935
9936 * xdisp.c (SAVE_IT, pos_visible_p, move_it_in_display_line_to)
9937 (move_it_in_display_line, move_it_to)
9938 (move_it_vertically_backward, move_it_by_lines): Replace the call
9939 to xfree to an equivalent call to bidi_unshelve_cache.
9940 (move_it_in_display_line_to): Fix logic of returning
412b6358 9941 MOVE_POS_MATCH_OR_ZV in the bidi case. (Bug#9224)
35928349 9942
e2e2423b
EZ
99432011-08-05 Eli Zaretskii <eliz@gnu.org>
9944
9945 * xdisp.c (set_cursor_from_row): Prefer the candidate glyph that
9946 came from a string character with a `cursor' property. (Bug#9229)
9947
ae9e757a
JD
99482011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9949
9950 * Makefile.in (LIB_PTHREAD): New variable.
9951 (LIBES): Add LIB_PTHREAD (Bug#9216).
9952
9953 * alloc.c, emacs.c, gmalloc.c, gtkutil.c, keyboard.c, syssignal.h:
9954 Rename HAVE_GTK_AND_PTHREAD to HAVE_PTHREAD (Bug#9216).
9955
213bd7f2
AS
99562011-08-04 Andreas Schwab <schwab@linux-m68k.org>
9957
6b02f655 9958 * regex.c (re_iswctype): Remove some redundant boolean conversions.
213bd7f2 9959
99aaf75f
JD
99602011-08-04 Jan Djärv <jan.h.d@swipnet.se>
9961
9962 * xterm.c (x_find_topmost_parent): New function.
9963 (x_set_frame_alpha): Find topmost parent window with
9964 x_find_topmost_parent and set the property there also (bug#9181).
9965 (handle_one_xevent): Call x_set_frame_alpha on ReparentNotify.
9966
c74e9d86
PE
99672011-08-04 Paul Eggert <eggert@cs.ucla.edu>
9968
9969 * callproc.c (Fcall_process): Avoid vfork clobbering
9970 the local vars buffer, coding_systems, current_dir.
9971
640c8776
SM
99722011-08-03 Stefan Monnier <monnier@iro.umontreal.ca>
9973
9974 * keymap.c (Fmake_composed_keymap): Move to subr.el.
9975
f26d0e4c
PE
99762011-08-03 Paul Eggert <eggert@cs.ucla.edu>
9977
8a10d76c
PE
9978 * fontset.c (dump_fontset) [FONTSET_DEBUG]: Declare EXTERNALLY_VISIBLE
9979 so that it is not optimized away.
9980
f26d0e4c
PE
9981 * xdisp.c (compute_display_string_pos): Remove unused local.
9982
55439c61
EZ
99832011-08-02 Eli Zaretskii <eliz@gnu.org>
9984
9985 Fix slow cursor motion and scrolling in large buffers with
9986 selective display, like Org Mode buffers. (Bug#9218)
9987
9988 * dispextern.h (struct bidi_it): New member disp_prop_p.
9989
9990 * xdisp.c: Remove one-slot cache of display string positions.
9991 (compute_display_string_pos): Accept an additional argument
5e617bc2 9992 DISP_PROP_P; callers changed. Scan at most 5K characters forward
55439c61
EZ
9993 for a display string or property. If found, set DISP_PROP_P
9994 non-zero.
9995
9996 * bidi.c (bidi_fetch_char): Accept an additional argument
640c8776
SM
9997 DISP_PROP_P, and pass it to compute_display_string_pos.
9998 Only handle text covered by a display string if DISP_PROP_P is returned
55439c61
EZ
9999 non-zero. All callers of bidi_fetch_char changed.
10000
fb33fa43
SM
100012011-08-02 Stefan Monnier <monnier@iro.umontreal.ca>
10002
10003 * keymap.c (Fdefine_key): Fix Lisp_Object/int mixup; apply some CSE.
10004
b099e063
DM
100052010-12-03 Don March <don@ohspite.net>
10006
10007 * keymap.c (Fdefine_key): Fix non-prefix key error message when
10008 last character M-[char] is translated to ESC [char] (bug#7541).
10009
5cc7f7af
KH
100102011-08-02 Kenichi Handa <handa@m17n.org>
10011
d0fffa3f 10012 * lisp.h (uniprop_table): Extern it.
5cc7f7af
KH
10013
10014 * chartab.c (uniprop_table): Make it non-static.
10015
525d5e6e
EZ
100162011-08-01 Eli Zaretskii <eliz@gnu.org>
10017
10018 * xdisp.c (forward_to_next_line_start): Accept additional argument
10019 BIDI_IT_PREV, and store into it the state of the bidi iterator had
10020 on the newline.
10021 (reseat_at_next_visible_line_start): Use the bidi iterator state
10022 returned by forward_to_next_line_start to restore the state of
10023 it->bidi_it after backing up to previous newline. (Bug#9212)
10024
31011111
AS
100252011-07-30 Andreas Schwab <schwab@linux-m68k.org>
10026
10027 * regex.c (re_comp): Protoize.
10028 (re_exec): Fix return type.
10029 (regexec): Fix type of `ret'. (Bug#9203)
10030
476371c4
PE
100312011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10032
e5d76069
PE
10033 * image.c (check_image_size): Use 1024x1024 if unknown frame (Bug#9189).
10034 This is needed if max-image-size is a floating-point number.
10035
9a79b20c
AS
100362011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10037
10038 * print.c (print_object): Print empty symbol as ##.
10039
10040 * lread.c (read1): Read ## as empty symbol.
10041
d8c2fa78
AA
100422011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
10043
10044 * nsfns.m (x_set_foreground_color): Set f->foreground_pixel when
10045 setting frame foreground color (Bug#9175).
10046 (x_set_background_color): Likewise.
10047
ffe57a7a
AA
10048 * nsmenu.m (-setText): Size tooltip dimensions precisely to
10049 contents (Bug#9176).
10050 (EmacsTooltip -init): Remove bezels and add shadows to
10051 tooltip windows.
10052
bf3492a5
AA
10053 * nsterm.m (ns_dumpglyphs_stretch): Avoid overwriting left fringe
10054 or scroll bar (Bug#8470).
10055
d55e9c53
AA
10056 * nsfont.m (nsfont_open): Remove assignment to voffset and
10057 unnecessary vars hshink, expand, hd, full_height, min_height.
10058 (nsfont_draw): Use s->ybase as baseline for glyph drawing (Bug#8913).
10059
10060 * nsterm.h (nsfont_info): Remove voffset field.
10061
d8c2fa78 100622011-07-28 Alp Aker <alp.tekin.aker@gmail.com>
4843aac3
AA
10063
10064 Implement strike-through and overline on NextStep (Bug#8863).
10065
10066 * nsfont.m (nsfont_open): Use underline position provided by font,
10067 instead of hard-coded value of 2.
10068 (nsfont_draw): Call ns_draw_text_decoration instead.
10069
10070 * nsterm.h: Add declaration for ns_draw_text_decoration.
10071
10072 * nsterm.m (ns_draw_text_decoration): New function for drawing
10073 underline, overline, and strike-through.
10074 (ns_dumpglyphs_image, ns_dumpglyphs_stretch): Add call to
10075 ns_draw_text_decoration. Change treatment of cursor drawing to
8d5ed899 10076 accommodate underlining, etc.
4843aac3 10077
4cc60b9b
EZ
100782011-07-28 Eli Zaretskii <eliz@gnu.org>
10079
bc7ece87
EZ
10080 * buffer.c (init_buffer_once): Set bidi-display-reordering to t by
10081 default.
4cc60b9b 10082
476371c4
PE
100832011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10084
66606eea
PE
10085 * alloc.c (memory_full) [!SYNC_INPUT]: Fix signal-related race.
10086 Without this fix, if a signal arrives just after memory fills up,
10087 'malloc' might be invoked reentrantly.
10088
476371c4
PE
10089 * image.c (x_check_image_size) [!HAVE_X_WINDOWS]: Return 1.
10090 In other words, assume that every image size is allowed, on non-X
10091 hosts. This assumption is probably wrong, but it lets Emacs compile.
10092
f3fcc40d
AS
100932011-07-28 Andreas Schwab <schwab@linux-m68k.org>
10094
10095 * regex.c (re_iswctype): Convert return values to boolean.
10096
350c992f
EZ
100972011-07-28 Eli Zaretskii <eliz@fencepost.gnu.org>
10098
10099 * xdisp.c (compute_display_string_pos): Don't use cached display
10100 string position if the buffer had its restriction changed.
10101 (Bug#9184)
10102
5266b4bb
PE
101032011-07-28 Paul Eggert <eggert@cs.ucla.edu>
10104
10105 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
10106
2573a837 101072011-07-28 Paul Eggert <eggert@cs.ucla.edu>
ca4aa935 10108
41f55ccd 10109 Integer signedness and overflow and related fixes. (Bug#9079)
cf950e6b 10110
39e378da
PE
10111 * bidi.c: Integer size and overflow fixes.
10112 (bidi_cache_size, bidi_cache_idx, bidi_cache_last_idx)
10113 (bidi_cache_start, bidi_cache_fetch_state, bidi_cache_search)
10114 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10115 (bidi_cache_iterator_state, bidi_cache_find, bidi_cache_start_stack)
10116 (bidi_find_other_level_edge):
10117 Use ptrdiff_t instead of EMACS_INT where either will do.
10118 This works better on 32-bit hosts configured --with-wide-int.
10119 (bidi_cache_ensure_space): Check for size-calculation overflow.
10120 Use % rather than repeated addition, for better worst-case speed.
10121 Don't set bidi_cache_size until after xrealloc returns, because it
10122 might not return.
10123 (bidi_dump_cached_states): Use ptrdiff_t, not int, to avoid overflow.
f0eb61e9
PE
10124 (bidi_cache_ensure_space): Also check that the bidi cache size
10125 does not exceed that of the largest Lisp string or buffer. See Eli
10126 Zaretskii in <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#29>.
39e378da 10127
5e927815
PE
10128 * alloc.c (__malloc_size_t): Remove.
10129 All uses replaced by size_t. See Andreas Schwab's note
10130 <http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9079#8>.
10131
ca4aa935
PE
10132 * image.c: Improve checking for integer overflow.
10133 (check_image_size): Assume that f is nonnull, since
10134 it is always nonnull in practice. This is one less thing to
10135 worry about when checking for integer overflow later.
10136 (x_check_image_size): New function, which checks for integer
10137 overflow issues inside X.
10138 (x_create_x_image_and_pixmap, xbm_read_bitmap_data): Use it.
10139 This removes the need for a memory_full check.
10140 (xbm_image_p): Rewrite to avoid integer multiplication overflow.
10141 (Create_Pixmap_From_Bitmap_Data, xbm_load): Use x_check_image_size.
10142 (xbm_read_bitmap_data): Change locals back to 'int', since
10143 their values must fit in 'int'.
10144 (xpm_load_image, png_load, tiff_load):
10145 Invoke x_create_x_image_and_pixmap earlier,
10146 to avoid much needless work if the image is too large.
10147 (tiff_load): Treat overly large images as if
10148 x_create_x_image_and_pixmap failed, not as malloc failures.
10149 (gs_load): Use x_check_image_size.
10150
5f8f9cc2
PE
10151 * gtkutil.c: Omit integer casts.
10152 (xg_get_pixbuf_from_pixmap): Remove unnecessary cast.
10153 (xg_set_toolkit_scroll_bar_thumb): Rewrite to avoid need for cast.
10154
5adf60bc
PE
10155 * image.c (png_load): Don't assume height * row_bytes fits in 'int'.
10156
c8907a93
PE
10157 * xfaces.c (Fbitmap_spec_p): Fix integer overflow bug.
10158 Without this fix, (bitmap-spec-p '(34359738368 1 "x"))
10159 would wrongly return t on a 64-bit host.
10160
e3c25c68
PE
10161 * dispnew.c (init_display): Use *_RANGE_OVERFLOW macros.
10162 The plain *_OVERFLOW macros run afoul of GCC bug 49705
10163 <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49705>
10164 and therefore cause GCC to emit a bogus diagnostic in some cases.
10165
3f791afe
PE
10166 * image.c: Integer signedness and overflow and related fixes.
10167 This is not an exhaustive set of fixes, but it's time to
10168 record what I've got.
10169 (lookup_pixel_color, check_image_size): Remove redundant decls.
10170 (check_image_size): Don't assume that arbitrary EMACS_INT values
10171 fit in 'int', or that arbitrary 'double' values fit in 'int'.
10172 (x_alloc_image_color, x_create_x_image_and_pixmap, png_load)
10173 (tiff_load, imagemagick_load_image):
10174 Check for overflow in size calculations.
10175 (x_create_x_image_and_pixmap): Remove unnecessary test for
10176 xmalloc returning NULL; that can't happen.
10177 (xbm_read_bitmap_data): Don't assume sizes fit into 'int'.
10178 (xpm_color_bucket): Use better integer hashing function.
10179 (xpm_cache_color): Don't possibly over-allocate memory.
10180 (struct png_memory_storage, tiff_memory_source, tiff_seek_in_memory)
10181 (gif_memory_source):
10182 Use ptrdiff_t, not int or size_t, to record sizes.
10183 (png_load): Don't assume values greater than 2**31 fit in 'int'.
10184 (our_stdio_fill_input_buffer): Prefer ptrdiff_t to size_t when
10185 either works, as we prefer signed integers.
10186 (tiff_read_from_memory, tiff_write_from_memory):
10187 Return tsize_t, not size_t, since that's what the TIFF API wants.
10188 (tiff_read_from_memory): Don't fail simply because the read would
10189 go past EOF; instead, return a short read.
10190 (tiff_load): Omit no-longer-needed casts.
10191 (Fimagemagick_types): Don't assume size fits into 'int'.
10192
3cc5a532
PE
10193 Improve hashing quality when configured --with-wide-int.
10194 * fns.c (hash_string): New function, taken from sxhash_string.
10195 Do not discard information about ASCII character case; this
10196 discarding is no longer needed.
10197 (sxhash-string): Use it. Change sig to match it. Caller changed.
10198 * lisp.h: Declare it.
10199 * lread.c (hash_string): Remove, since we now use fns.c's version.
10200 The fns.c version returns a wider integer if --with-wide-int is
10201 specified, so this should help the quality of the hashing a bit.
10202
b312a492
PE
10203 * emacs.c: Integer overflow minor fix.
10204 (heap_bss_diff): Now uprintmax_t, not unsigned long. All used changed.
10205 Define only if GNU_LINUX.
10206 (main, Fdump_emacs): Set and use heap_bss_diff only if GNU_LINUX.
10207
dfd153ae
PE
10208 * dispnew.c: Integer signedness and overflow fixes.
10209 Remove unnecessary forward decls, that were a maintenance hassle.
10210 (history_tick): Now uprintmax_t, so it's more likely to avoid overflow.
10211 All uses changed.
10212 (adjust_glyph_matrix, realloc_glyph_pool, adjust_frame_message_buffer)
10213 (scrolling_window): Use ptrdiff_t, not int, for byte count.
10214 (prepare_desired_row, line_draw_cost):
10215 Use int, not unsigned, where either works.
10216 (save_current_matrix, restore_current_matrix):
10217 Use ptrdiff_t, not size_t, where either works.
10218 (init_display): Check for overflow more accurately, and without
10219 relying on undefined behavior.
10220
a81d11a3
PE
10221 * editfns.c (pWIDE, pWIDElen, signed_wide, unsigned_wide):
10222 Remove, replacing with the new symbols in lisp.h. All uses changed.
10223 * fileio.c (make_temp_name):
10224 * filelock.c (lock_file_1, lock_file):
10225 * xdisp.c (message_dolog):
10226 Don't assume PRIdMAX etc. works; this isn't portable to pre-C99 hosts.
10227 Use pMd etc. instead.
10228 * lisp.h (printmax_t, uprintmax_t, pMd, pMu): New types and macros,
10229 replacing the pWIDE etc. symbols removed from editfns.c.
10230
3300e6fd
PE
10231 * keyboard.h (num_input_events): Now uintmax_t.
10232 This is (very slightly) less likely to mess up due to wraparound.
10233 All uses changed.
10234
fd05c7e9
PE
10235 * buffer.c: Integer signedness fixes.
10236 (alloc_buffer_text, enlarge_buffer_text):
10237 Use ptrdiff_t rather than size_t when either will do, as we prefer
10238 signed integers.
10239
903fe15d
PE
10240 * alloc.c: Integer signedness and overflow fixes.
10241 Do not impose an arbitrary 32-bit limit on malloc sizes when debugging.
10242 (__malloc_size_t): Default to size_t, not to int.
10243 (pure_size, pure_bytes_used_before_overflow, stack_copy_size)
10244 (Fgarbage_collect, mark_object_loop_halt, mark_object):
10245 Prefer ptrdiff_t to size_t when either would do, as we prefer
10246 signed integers.
10247 (XMALLOC_OVERRUN_CHECK_OVERHEAD): New macro.
10248 (xmalloc_overrun_check_header, xmalloc_overrun_check_trailer):
10249 Now const. Initialize with values that are in range even if char
10250 is signed.
10251 (XMALLOC_PUT_SIZE, XMALLOC_GET_SIZE): Remove, replacing with ...
10252 (xmalloc_put_size, xmalloc_get_size): New functions. All uses changed.
10253 These functions do the right thing with sizes > 2**32.
10254 (check_depth): Now ptrdiff_t, not int.
10255 (overrun_check_malloc, overrun_check_realloc, overrun_check_free):
10256 Adjust to new way of storing sizes. Check for size overflow bugs
10257 in rest of code.
10258 (STRING_BYTES_MAX): Adjust to new overheads. The old code was
10259 slightly wrong anyway, as it missed one instance of
10260 XMALLOC_OVERRUN_CHECK_OVERHEAD.
10261 (refill_memory_reserve): Omit needless cast to size_t.
10262 (mark_object_loop_halt): Mark as externally visible.
10263
ac82cc6a
PE
10264 * xselect.c: Integer signedness and overflow fixes.
10265 (Fx_register_dnd_atom, x_handle_dnd_message):
10266 Use ptrdiff_t, not size_t, since we prefer signed.
10267 (Fx_register_dnd_atom): Check for ptrdiff_t (and size_t) overflow.
10268 * xterm.h (struct x_display_info): Use ptrdiff_t, not size_t, for
10269 x_dnd_atoms_size and x_dnd_atoms_length.
10270
c2d1e36d
PE
10271 * doprnt.c: Prefer signed to unsigned when either works.
10272 * eval.c (verror):
10273 * doprnt.c (doprnt):
10274 * lisp.h (doprnt):
10275 * xdisp.c (vmessage):
10276 Use ptrdiff_t, not size_t, when using or implementing doprnt,
10277 since the sizes cannot exceed ptrdiff_t bounds anyway, and we
10278 prefer signed arithmetic to avoid comparison confusion.
10279 * doprnt.c (doprnt): Avoid a "+ 1" that can't overflow,
10280 but is a bit tricky.
10281
0e926e56
PE
10282 Assume freestanding C89 headers, string.h, stdlib.h.
10283 * data.c, doprnt.c, floatfns.c, print.c:
10284 Include float.h unconditionally.
10285 * gmalloc.c: Assume C89-at-least behavior for preprocessor,
10286 limits.h, stddef.h, string.h. Use memset instead of 'flood'.
10287 * regex.c: Likewise for stddef.h, string.h.
10288 (ISASCII): Remove; can assume it returns 1 now. All uses removed.
10289 * s/aix4-2.h (HAVE_STRING_H): Remove obsolete undef.
10290 * s/ms-w32.h (HAVE_LIMITS_H, HAVE_STRING_H, HAVE_STDLIB_H)
10291 (STDC_HEADERS): Remove obsolete defines.
10292 * sysdep.c: Include limits.h unconditionally.
10293
9cfdb3ec
PE
10294 Assume support for memcmp, memcpy, memmove, memset.
10295 * lisp.h, sysdep.c (memcmp, memcpy, memmove, memset):
10296 * regex.c (memcmp, memcpy):
10297 Remove; we assume C89 now.
10298
10299 * gmalloc.c (memcpy, memset, memmove): Remove; we assume C89 now.
10300 (__malloc_safe_bcopy): Remove; no longer needed.
10301
cf950e6b 10302 * lisp.h (struct vectorlike_header, struct Lisp_Subr): Signed sizes.
6089c567
PE
10303 Use EMACS_INT, not EMACS_UINT, for sizes. The code works equally
10304 well either way, and we prefer signed to unsigned.
10305
dbf38e02
LMI
103062011-07-27 Lars Magne Ingebrigtsen <larsi@gnus.org>
10307
10308 * gnutls.c (emacs_gnutls_read): Don't message anything if the peer
10309 closes the connection while we're reading (bug#9182).
10310
d6f0886c 103112011-07-25 Jan Djärv <jan.h.d@swipnet.se>
24e0f6b1 10312
d6f0886c
JD
10313 * nsmenu.m (ns_popup_dialog): Add an "ok" button if no buttons
10314 are specified (Bug#9168).
24e0f6b1 10315
2eb1f9e6
PE
103162011-07-25 Paul Eggert <eggert@cs.ucla.edu>
10317
10318 * bidi.c (bidi_dump_cached_states): Fix printf format mismatch.
10319 Found by GCC static checking and --with-wide-int on a 32-bit host.
10320
22381272 103212011-07-25 Eli Zaretskii <eliz@gnu.org>
7daee910
EZ
10322
10323 * xdisp.c (compute_display_string_pos): Fix logic of caching
10324 previous display string position. Initialize cached_prev_pos to
10325 -1. Fixes slow-down at the beginning of a buffer.
10326
f25e39b4
EZ
103272011-07-24 Eli Zaretskii <eliz@gnu.org>
10328
10329 * xfaces.c (check_lface_attrs) [HAVE_WINDOW_SYSTEM]: Allow `nil'
10330 for attrs[LFACE_FONTSET_INDEX].
10331
04c4b52e
PE
103322011-07-23 Paul Eggert <eggert@cs.ucla.edu>
10333
10334 * xml.c (parse_region): Remove unused local
10335 that was recently introduced.
10336
c1734fbd
EZ
103372011-07-23 Eli Zaretskii <eliz@gnu.org>
10338
be18c5a5
EZ
10339 * xfns.c (unwind_create_frame) [GLYPH_DEBUG]: Adapt to changes in
10340 2008-02-22T17:42:09Z!monnier@iro.umontreal.ca.
10341
c1734fbd
EZ
10342 * xdisp.c (move_it_in_display_line_to): Record the best matching
10343 position for TO_CHARPOS while scanning the line, and restore it on
640c8776
SM
10344 exit if none of the characters scanned was an exact match.
10345 Fixes vertical-motion and pos-visible-in-window-p under bidi redisplay
a9269c18
EZ
10346 when exact match is impossible due to invisible text, and the
10347 lines are truncated.
10348
a258d627
JD
103492011-07-23 Jan Djärv <jan.h.d@swipnet.se>
10350
10351 * nsterm.m (initFrameFromEmacs): Set NSTitledWindowMask in styleMask
10352 for OSX >= 10.7.
10353
b6d5a689
EZ
103542011-07-22 Eli Zaretskii <eliz@gnu.org>
10355
0f74f785
EZ
10356 Fix a significant slow-down of cursor motion with C-n, C-p,
10357 C-f/C-b, and C-v/M-v that couldn't keep up with keyboard
10358 auto-repeat under bidi redisplay in fontified buffers.
b6d5a689 10359 * xdisp.c (compute_stop_pos_backwards): New function.
b6d5a689
EZ
10360 (next_element_from_buffer): Call compute_stop_pos_backwards to
10361 find a suitable prev_stop when we find ourselves before
0f74f785
EZ
10362 base_level_stop.
10363 (reseat): Don't look for prev_stop, as that could mean a very long
10364 run.
10365 <cached_disp_pos, cached_disp_buffer, cached_disp_modiff>
10366 <cached_disp_overlay_modiff>: Cache for last found display string
10367 position.
551918c1 10368 (compute_display_string_pos): Return the cached position if asked
0f74f785
EZ
10369 about the same buffer in the same area of character positions, and
10370 the buffer wasn't changed since the time the display string
10371 position was cached.
551918c1 10372
b2d0c91a
EZ
103732011-07-22 Eli Zaretskii <eliz@gnu.org>
10374
10375 * xdisp.c (rows_from_pos_range): Don't ignore glyphs whose object
10376 is an integer, which is important for empty lines. (Bug#9149)
10377
043604ee
CY
103782011-07-22 Chong Yidong <cyd@stupidchicken.com>
10379
10380 * frame.c (Fmodify_frame_parameters): In tty case, update the
10381 default face if necessary (Bug#4238).
10382
da4adb04
CY
103832011-07-21 Chong Yidong <cyd@stupidchicken.com>
10384
10385 * editfns.c (Fstring_to_char): No need to explain what a character
10386 is in the docstring (Bug#6576).
10387
9abd0532
LMI
103882011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10389
10390 * xml.c (parse_region): Make sure we always return a tree.
10391
36881d16
HK
103922011-07-20 HAMANO Kiyoto <khiker.mail@gmail.com>
10393
10394 * xml.c (parse_region): If a document contains only comments,
10395 return that, too.
10396
1e98674d
LMI
103972011-07-20 Lars Magne Ingebrigtsen <larsi@gnus.org>
10398
10399 * xml.c (make_dom): Return comments, too.
10400
590bd467
PE
104012011-07-19 Paul Eggert <eggert@cs.ucla.edu>
10402
10403 Port to OpenBSD.
10404 See http://lists.gnu.org/archive/html/emacs-devel/2011-07/msg00688.html
10405 and the surrounding thread.
10406 * minibuf.c (read_minibuf_noninteractive): Rewrite to use getchar
10407 rather than fgets, and retry after EINTR. Otherwise, 'emacs
10408 --batch -f byte-compile-file' fails on OpenBSD if an inactivity
10409 timer goes off.
10410 * s/openbsd.h (BROKEN_SIGIO): Define.
10411 * unexelf.c (unexec) [__OpenBSD__]:
10412 Don't update the .mdebug section of the Alpha COFF symbol table.
10413
f41628b2
LMI
104142011-07-19 Lars Magne Ingebrigtsen <larsi@gnus.org>
10415
10416 * lread.c (syms_of_lread): Clarify when `lexical-binding' is used
10417 (bug#8460).
10418
b59b67c5
PE
104192011-07-18 Paul Eggert <eggert@cs.ucla.edu>
10420
15e3a074
PE
10421 * fileio.c (Fcopy_file) [!MSDOS]: Tighten created file's mask.
10422 This fixes some race conditions on the permissions of any newly
10423 created file.
10424
41bed37d
PE
10425 * alloc.c (valid_pointer_p): Use pipe, not open.
10426 This fixes some permissions issues when debugging.
10427
b59b67c5
PE
10428 * fileio.c (Fcopy_file): Adjust mode if fchown fails. (Bug#9002)
10429 If fchown fails to set both uid and gid, try to set just gid,
10430 as that is sometimes allowed. Adjust the file's mode to eliminate
10431 setuid or setgid bits that are inappropriate if fchown fails.
10432
925a6be7
SM
104332011-07-18 Stefan Monnier <monnier@iro.umontreal.ca>
10434
10435 * xdisp.c (next_element_from_string, next_element_from_buffer): Use EQ
10436 to compare Lisp_Objects.
10437 * gnutls.c (syms_of_gnutls): Rename Vgnutls_log_level to
10438 global_gnutls_log_level, don't mistake it for a Lisp_Object.
10439 (init_gnutls_functions, emacs_gnutls_handle_error): Fix up uses.
10440
52968808
AS
104412011-07-17 Andreas Schwab <schwab@linux-m68k.org>
10442
0a6a104b
AS
10443 * lread.c (read_integer): Unread even EOF character.
10444 (read1): Likewise. Properly record start position of symbol.
10445
52968808
AS
10446 * lread.c (read1): Read `#:' as empty uninterned symbol if no
10447 symbol character follows.
10448
9e381cdd
PE
104492011-07-17 Paul Eggert <eggert@cs.ucla.edu>
10450
10451 * fileio.c (Fcopy_file): Pacify gcc re fchown. (Bug#9002)
10452 This works around a problem with the previous change to Fcopy_file.
10453 Recent glibc declares fchown with __attribute__((warn_unused_result)),
10454 and without this change, GCC might complain about discarding
10455 fchown's return value.
10456
b5641435
JB
104572011-07-16 Juanma Barranquero <lekktu@gmail.com>
10458
10459 * makefile.w32-in (GLOBAL_SOURCES): Add gnutls.c (followup to bug#9059).
10460
a8031457
PE
104612011-07-16 Paul Eggert <eggert@cs.ucla.edu>
10462
10463 * fileio.c (Fcopy_file): Don't diagnose fchown failures. (Bug#9002)
10464
dd889327
LMI
104652011-07-16 Lars Magne Ingebrigtsen <larsi@gnus.org>
10466
750c33f7
LMI
10467 * gnutls.c (syms_of_gnutls): Define `gnutls-log-level' here, since
10468 it's used from the C level.
10469
dd889327
LMI
10470 * process.c: Use the same condition for POLL_FOR_INPUT in both
10471 keyboard.c and process.c (bug#1858).
10472
87e86684
LM
104732011-07-09 Lawrence Mitchell <wence@gmx.li>
10474
10475 * gnutls.c (Qgnutls_bootprop_min_prime_bits): New variable.
10476 (Fgnutls_boot): Use it.
10477
64348f40
AS
104782011-07-15 Andreas Schwab <schwab@linux-m68k.org>
10479
10480 * doc.c (Fsubstitute_command_keys): Revert last change.
10481
1d698799
LMI
104822011-07-15 Lars Magne Ingebrigtsen <larsi@gnus.org>
10483
f863868c
LMI
10484 * doc.c (Fsubstitute_command_keys): Clarify that \= really only
10485 quotes the next character, and doesn't affect other longer
10486 sequences (bug#8935).
10487
1d698799
LMI
10488 * lread.c (syms_of_lread): Clarify that is isn't only
10489 `eval-buffer' and `eval-defun' that's affected by
10490 `lexical-binding' (bug#8460).
10491
aa4b6df6
EZ
104922011-07-15 Eli Zaretskii <eliz@gnu.org>
10493
10494 * xdisp.c (move_it_in_display_line_to): Fix vertical motion with
6b02f655 10495 bidi redisplay when a line includes both an image and is truncated.
aa4b6df6 10496
5d856da6
PE
104972011-07-14 Paul Eggert <eggert@cs.ucla.edu>
10498
ad6042bb
PE
10499 Fix minor problems found by static checking.
10500 * bidi.c (bidi_cache_size): Now EMACS_INT, not size_t.
10501 (elsz): Now a signed constant, not a size_t var. We prefer signed
10502 types to unsigned, to avoid integer comparison confusion. Without
10503 this change, GCC 4.6.1 with -Wunsafe-loop-optimizations complains
10504 "cannot optimize loop, the loop counter may overflow", a symptom
10505 of the confusion.
f00bbb22 10506 * indent.c (Fvertical_motion): Mark locals as initialized.
5d856da6
PE
10507 * xdisp.c (reseat_to_string): Fix pointer signedness issue.
10508
6468f31c
LMI
105092011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10510
49080b10
LMI
10511 * search.c (Fre_search_backward): Mention `case-fold-search' in
10512 all the re_search_* functions (bug#8138).
10513
6468f31c
LMI
10514 * keyboard.c (Fopen_dribble_file): Document when the file is
10515 closed (bug#8056).
10516
c965adc5
EZ
105172011-07-14 Eli Zaretskii <eliz@gnu.org>
10518
df9733bf
EZ
10519 * bidi.c (bidi_dump_cached_states): Fix format of displaying
10520 bidi_cache_idx.
10521
0bb23927
EZ
10522 Support bidi reordering of display and overlay strings.
10523 * xdisp.c (compute_display_string_pos)
10524 (compute_display_string_end): Accept additional argument STRING.
10525 (init_iterator, reseat_1): Initialize bidi_it->string.s to NULL.
10526 (reseat_to_string): Initialize bidi_it->string.s and
10527 bidi_it->string.schars.
10528 (Fcurrent_bidi_paragraph_direction): Initialize itb.string.s to
640c8776
SM
10529 NULL (avoids a crash in bidi_paragraph_init).
10530 Initialize itb.string.lstring.
0bb23927
EZ
10531 (init_iterator): Call bidi_init_it only of a valid
10532 buffer position was specified. Initialize paragraph_embedding to
10533 L2R.
10534 (reseat_to_string): Initialize the bidi iterator.
10535 (display_string): If we need to ignore text properties of
10536 LISP_STRING, set IT->stop_charpos to IT->end_charpos. (The
10537 original value of -1 will not work with bidi.)
10538 (compute_display_string_pos): First arg is now struct
10539 `text_pos *'; all callers changed. Support display properties on
10540 Lisp strings.
10541 (compute_display_string_end): Support display properties on Lisp
10542 strings.
10543 (init_iterator, reseat_1, reseat_to_string): Initialize the
10544 string.bufpos member to 0 (zero, for compatibility with IT_CHARPOS
10545 when iterating on a string not from display properties).
640c8776
SM
10546 (compute_display_string_pos, compute_display_string_end):
10547 Fix calculation of the object to scan. Fixes an error when using
0bb23927
EZ
10548 arrow keys.
10549 (next_element_from_buffer): Don't abort when IT_CHARPOS is before
640c8776
SM
10550 base_level_stop; instead, set base_level_stop to BEGV.
10551 Fixes crashes in vertical-motion.
0bb23927
EZ
10552 (next_element_from_buffer): Improve commentary for when
10553 the iterator is before prev_stop.
10554 (init_iterator): Initialize bidi_p from the default value of
10555 bidi-display-reordering, not from buffer-local value. Use the
10556 buffer-local value only if initializing for buffer iteration.
10557 (handle_invisible_prop): Support invisible properties on strings
10558 that are being bidi-reordered.
10559 (set_iterator_to_next): Support bidi reordering of C strings and
10560 Lisp strings.
10561 (next_element_from_string): Support bidi reordering of Lisp
10562 strings.
10563 (handle_stop_backwards): Support Lisp strings as well.
640c8776
SM
10564 (display_string): Support display of R2L glyph rows.
10565 Use IT_STRING_CHARPOS when displaying from a Lisp string.
0bb23927
EZ
10566 (init_iterator): Don't initialize it->bidi_p for strings
10567 here.
10568 (reseat_to_string): Initialize it->bidi_p for strings here.
10569 (next_element_from_string, next_element_from_c_string)
10570 (next_element_from_buffer): Add xassert's for correspondence
10571 between IT's object being iterated and it->bidi_it.string
10572 structure.
10573 (face_before_or_after_it_pos): Support bidi iteration.
10574 (next_element_from_c_string): Handle the case of the first string
10575 character that is not the first one in the visual order.
10576 (get_visually_first_element): New function, refactored from common
10577 parts of next_element_from_buffer, next_element_from_string, and
10578 next_element_from_c_string.
10579 (tool_bar_lines_needed, redisplay_tool_bar)
10580 (display_menu_bar): Force left-to-right direction. Add a FIXME
10581 comment for making that be controlled by a user option.
10582 (push_it, pop_it): Save and restore the state of the
10583 bidi iterator. Save and restore the bidi_p flag.
10584 (pop_it): Iterate out of display property for string iteration as
10585 well.
10586 (iterate_out_of_display_property): Support iteration over strings.
10587 (handle_single_display_spec): Set up it->bidi_it for iteration
10588 over a display string, and call bidi_init_it.
10589 (handle_single_display_spec, next_overlay_string)
10590 (get_overlay_strings_1, push_display_prop): Set up the bidi
10591 iterator for displaying display or overlay strings.
10592 (forward_to_next_line_start): Don't use the shortcut if
10593 bidi-iterating.
10594 (back_to_previous_visible_line_start): If handle_display_prop
10595 pushed the iterator stack, restore the internal state of the bidi
10596 iterator by calling bidi_pop_it same number of times.
10597 (reseat_at_next_visible_line_start): If ON_NEWLINE_P is non-zero,
10598 and we are bidi-iterating, don't decrement the iterator position;
10599 instead, set the first_elt flag in the bidi iterator, to produce
10600 the same effect.
10601 (reseat_1): Remove redundant setting of string_from_display_prop_p.
10602 (push_display_prop): xassert that we are iterating a buffer.
10603 (push_it, pop_it): Save and restore paragraph_embedding member.
10604 (handle_single_display_spec, next_overlay_string)
10605 (get_overlay_strings_1, reseat_1, reseat_to_string)
10606 (push_display_prop): Set up the `unibyte' member of bidi_it.string
10607 correctly. Don't assume unibyte strings are not bidi-reordered.
10608 (compute_display_string_pos)
10609 (compute_display_string_end): Fix handling the case of C string.
10610 (push_it, pop_it): Save and restore from_disp_prop_p.
10611 (handle_single_display_spec, push_display_prop): Set the
10612 from_disp_prop_p flag.
10613 (get_overlay_strings_1): Reset the from_disp_prop_p flag.
10614 (pop_it): Call iterate_out_of_display_property only if we are
10615 popping after iteration over a string that came from a display
10616 property. Fix a typo in popping stretch info. Add an assertion
10617 for verifying that the iterator position is in sync with the bidi
10618 iterator.
10619 (handle_single_display_spec, get_overlay_strings_1)
10620 (push_display_prop): Fix initialization of paragraph direction for
10621 string when that of the parent object is not yet determined.
10622 (reseat_1): Call bidi_init_it to resync the bidi
10623 iterator with IT's position. (Bug#7616)
10624 (find_row_edges): If ROW->start.pos gives position
10625 smaller than min_pos, use it as ROW->minpos. (Bug#7616)
10626 (handle_stop, back_to_previous_visible_line_start, reseat_1):
10627 Reset the from_disp_prop_p flag.
10628 (SAVE_IT, RESTORE_IT): New macros.
10629 (pos_visible_p, face_before_or_after_it_pos)
10630 (back_to_previous_visible_line_start)
10631 (move_it_in_display_line_to, move_it_in_display_line)
10632 (move_it_to, move_it_vertically_backward, move_it_by_lines)
10633 (try_scrolling, redisplay_window, display_line): Use them when
10634 saving a temporary copy of the iterator and restoring it back.
10635 (back_to_previous_visible_line_start, reseat_1)
10636 (init_iterator): Empty the bidi cache "stack".
10637 (move_it_in_display_line_to): If iterator ended up at
10638 EOL, but we never saw any buffer positions smaller than
10639 to_charpos, return MOVE_POS_MATCH_OR_ZV. Fixes vertical cursor
10640 motion in bidi-reordered lines.
10641 (move_it_in_display_line_to): Record prev_method and prev_pos
10642 immediately before the call to set_iterator_to_next. Fixes cursor
10643 motion in bidi-reordered lines with stretch glyphs and strings
10644 displayed in margins. (Bug#8133) (Bug#8867)
10645 Return MOVE_POS_MATCH_OR_ZV only if iterator position is past
10646 TO_CHARPOS.
640c8776
SM
10647 (pos_visible_p): Support positions in bidi-reordered lines.
10648 Save and restore bidi cache.
0bb23927
EZ
10649
10650 * bidi.c (bidi_level_of_next_char): clen should be EMACS_NT, not int.
10651 (bidi_paragraph_info): Delete unused struct.
10652 (bidi_cache_idx, bidi_cache_last_idx): Declare EMACS_INT.
10653 (bidi_cache_start): New variable.
10654 (bidi_cache_reset): Reset bidi_cache_idx to bidi_cache_start, not
10655 to zero.
10656 (bidi_cache_fetch_state, bidi_cache_search)
10657 (bidi_cache_find_level_change, bidi_cache_iterator_state)
10658 (bidi_cache_find, bidi_peek_at_next_level)
10659 (bidi_level_of_next_char, bidi_find_other_level_edge)
10660 (bidi_move_to_visually_next): Compare cache index with
10661 bidi_cache_start rather than with zero.
10662 (bidi_fetch_char): Accept new argument STRING; all callers
10663 changed. Support iteration over a string. Support strings with
10664 display properties. Support unibyte strings. Fix the type of
10665 `len' according to what STRING_CHAR_AND_LENGTH expects.
10666 (bidi_paragraph_init, bidi_resolve_explicit_1)
10667 (bidi_resolve_explicit, bidi_resolve_weak)
640c8776
SM
10668 (bidi_level_of_next_char, bidi_move_to_visually_next):
10669 Support iteration over a string.
0bb23927
EZ
10670 (bidi_set_sor_type, bidi_resolve_explicit_1)
10671 (bidi_resolve_explicit, bidi_type_of_next_char): ignore_bn_limit
10672 can now be zero (for strings); special values 0 and -1 were
10673 changed to -1 and -2, respectively.
10674 (bidi_char_at_pos): New function.
10675 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak):
10676 Call it instead of FETCH_MULTIBYTE_CHAR.
10677 (bidi_move_to_visually_next): Abort if charpos or bytepos were not
10678 initialized to valid values.
10679 (bidi_init_it): Don't initialize charpos and bytepos with invalid
10680 values.
10681 (bidi_level_of_next_char): Allow the sentinel "position" to pass
10682 the test for valid cached positions. Fix the logic for looking up
10683 the sentinel state in the cache. GCPRO the Lisp string we are
10684 iterating.
10685 (bidi_push_it, bidi_pop_it): New functions.
10686 (bidi_initialize): Initialize the bidi cache start stack pointer.
10687 (bidi_cache_ensure_space): New function, refactored from part of
10688 bidi_cache_iterator_state. Don't assume the required size is just
10689 one BIDI_CACHE_CHUNK away.
10690 (bidi_cache_start_stack, bidi_push_it): Use IT_STACK_SIZE.
10691 (bidi_count_bytes, bidi_char_at_pos): New functions.
10692 (bidi_cache_search): Don't assume bidi_cache_last_idx is
10693 always valid if bidi_cache_idx is valid.
10694 (bidi_cache_find_level_change): xassert that bidi_cache_last_idx
10695 is valid if it's going to be used.
10696 (bidi_shelve_cache, bidi_unshelve_cache): New functions.
10697 (bidi_cache_fetch_state, bidi_cache_search)
c965adc5
EZ
10698 (bidi_cache_find_level_change, bidi_cache_ensure_space)
10699 (bidi_cache_iterator_state, bidi_cache_find)
640c8776
SM
10700 (bidi_find_other_level_edge, bidi_cache_start_stack):
10701 All variables related to cache indices are now EMACS_INT.
c965adc5 10702
0bb23927
EZ
10703 * dispextern.h (struct bidi_string_data): New structure.
10704 (struct bidi_it): New member `string'. Make flag members be 1-bit
10705 fields, and put them last in the struct.
640c8776
SM
10706 (compute_display_string_pos, compute_display_string_end):
10707 Update prototypes.
0bb23927
EZ
10708 (bidi_push_it, bidi_pop_it): Add prototypes.
10709 (struct iterator_stack_entry): New members bidi_p,
10710 paragraph_embedding, and from_disp_prop_p.
10711 (struct it): Member bidi_p is now a bit field 1 bit wide.
640c8776
SM
10712 (bidi_shelve_cache, bidi_unshelve_cache):
10713 Declare prototypes.
0bb23927
EZ
10714
10715 * .gdbinit (xvectype, xvector, xcompiled, xchartable, xboolvector)
10716 (xpr, xfont, xbacktrace): Use "header.size" when accessing vectors
10717 and vector-like objects.
10718
10719 * dispnew.c (buffer_posn_from_coords): Save and restore the bidi
10720 cache around display iteration.
10721
10722 * window.c (Fwindow_end, window_scroll_pixel_based)
10723 (displayed_window_lines, Frecenter): Save and restore the bidi
10724 cache around display iteration.
10725
3bbd2265
LMI
107262011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
10727
10728 * editfns.c (Fdelete_region): Clarify the use of the named
10729 parameters (bug#6788).
10730
adc47434
MR
107312011-07-14 Martin Rudalics <rudalics@gmx.at>
10732
10733 * indent.c (Fvertical_motion): Set and restore w->pointm when
10734 saving and restoring the window's buffer (Bug#9006).
10735
837c31f8
LMI
107362011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
10737
10738 * editfns.c (Fstring_to_char): Clarify just what is returned
10739 (bug#6576). Text by Eli Zaretskii.
10740
ac389d0c
JB
107412011-07-13 Juanma Barranquero <lekktu@gmail.com>
10742
10743 * gnutls.c (init_gnutls_functions): Honor gnutls_log_level (bug#9059).
10744
0be0ce47
EZ
107452011-07-13 Eli Zaretskii <eliz@gnu.org>
10746
10747 * buffer.c (mmap_find): Fix a typo.
10748
cd18e7e3
JB
107492011-07-13 Johan Bockgård <bojohan@gnu.org>
10750
10751 Fix execution of x selection hooks.
10752 * xselect.c (Qx_lost_selection_functions)
10753 (Qx_sent_selection_functions): New vars.
10754 (syms_of_xselect): DEFSYM them.
10755 (x_handle_selection_request): Pass Qx_sent_selection_functions
10756 rather than Vx_sent_selection_functions to Frun_hook_with_args.
10757 (x_handle_selection_clear,x_clear_frame_selections):
10758 Pass Qx_lost_selection_functions rather than
10759 Vx_lost_selection_functions to Frun_hook_with_args.
10760
47ea7f44
PE
107612011-07-13 Paul Eggert <eggert@cs.ucla.edu>
10762
ac389d0c 10763 * buffer.c (Fget_buffer_create): Initialize inhibit_shrinking.
2941c447
PE
10764 The old code sometimes used this field without initializing it.
10765
47ea7f44
PE
10766 * alloc.c (gc_sweep): Don't read past end of array.
10767 In theory, the old code could also have corrupted Emacs internals,
10768 though it'd be very unlikely.
10769
bc985c87
AS
107702011-07-12 Andreas Schwab <schwab@linux-m68k.org>
10771
10772 * character.c (Fcharacterp): Don't advertise optional ignored
ac389d0c 10773 argument. (Bug#4026)
bc985c87 10774
0cf34688
LMI
107752011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
10776
b3dadd76
LMI
10777 * keymap.c (syms_of_keymap): Clarify that "modifier" is "modifier
10778 key" (bug#4257).
10779
0cf34688
LMI
10780 * window.c (Fset_window_start): Doc fix (bug#4199).
10781 (Fset_window_hscroll): Ditto.
10782
270768cd
PE
107832011-07-12 Paul Eggert <eggert@cs.ucla.edu>
10784
077e3dda 10785 Fix minor new problems caught by GCC 4.6.1.
270768cd 10786 * term.c (init_tty): Remove unused local.
490011a6 10787 * xsettings.c (store_monospaced_changed): Define this function only
077e3dda 10788 if (defined HAVE_GSETTINGS || defined HAVE_GCONF), as it's
490011a6 10789 not used otherwise.
270768cd 10790
b1f58454
CY
107912011-07-12 Chong Yidong <cyd@stupidchicken.com>
10792
10793 * xdisp.c (Vresize_mini_windows): Minor doc fix (Bug#3300).
10794
22b9578d
LMI
107952011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
10796
6e70ab07
LMI
10797 * xdisp.c (syms_of_xdisp): Make it explicit that the mini-windows
10798 are the mini-buffer and the echo area (bug#3320).
10799
22b9578d
LMI
10800 * term.c (init_tty): Remove support for supdup, c10 and perq
10801 terminals, which are no longer supported (bug#1482).
10802
8974cc9f
JB
108032011-07-10 Johan Bockgård <bojohan@gnu.org>
10804
10805 * xdisp.c (Ftool_bar_lines_needed): Fix WINDOWP check.
10806
a560d974
JD
108072011-07-10 Jan Djärv <jan.h.d@swipnet.se>
10808
10809 * xmenu.c (menu_highlight_callback): Only pass frame to show_help_event
10810 for non-popups (Bug#3642).
10811
1dae0f0a
AS
108122011-07-10 Andreas Schwab <schwab@linux-m68k.org>
10813
268c2c36 10814 * alloc.c (reset_malloc_hooks): Protoize.
1dae0f0a 10815 * buffer.c (mmap_init, mmap_find, mmap_free_1, mmap_enlarge)
268c2c36
AS
10816 (mmap_set_vars, mmap_alloc, mmap_free, mmap_realloc): Likewise.
10817 * cm.c (losecursor): Likewise.
1dae0f0a
AS
10818 * data.c (fmod): Likewise.
10819 * dispnew.c (swap_glyphs_in_rows): Likewise.
10820 * emacs.c (memory_warning_signal): Likewise.
10821 * floatfns.c (float_error): Likewise.
10822 * font.c (check_gstring, check_otf_features, otf_tag_symbol)
10823 (otf_open, font_otf_capability, generate_otf_features)
10824 (font_otf_DeviceTable, font_otf_ValueRecord, font_otf_Anchor):
10825 Likewise.
10826 * image.c (pbm_read_file): Likewise.
10827 * indent.c (string_display_width): Likewise.
10828 * intervals.c (check_for_interval, search_for_interval)
10829 (inc_interval_count, count_intervals, root_interval)
10830 (adjust_intervals_for_insertion, make_new_interval): Likewise.
10831 * lread.c (defalias): Likewise.
268c2c36 10832 * ralloc.c (r_alloc_check): Likewise.
1dae0f0a
AS
10833 * regex.c (set_image_of_range_1, set_image_of_range)
10834 (regex_grow_registers): Likewise.
10835 * sysdep.c (strerror): Likewise.
10836 * termcap.c (valid_filename_p, tprint, main): Likewise.
10837 * tparam.c (main): Likewise.
10838 * unexhp9k800.c (run_time_remap, save_data_space)
10839 (update_file_ptrs, read_header, write_header, calculate_checksum)
10840 (copy_file, copy_rest, display_header): Likewise.
10841 * widget.c (mark_shell_size_user_specified, create_frame_gcs):
10842 Likewise.
10843 * xdisp.c (check_it): Likewise.
10844 * xfaces.c (register_color, unregister_color, unregister_colors):
10845 Likewise.
10846 * xfns.c (print_fontset_result): Likewise.
10847 * xrdb.c (member, fatal, main): Likewise.
10848
99033785
PE
108492011-07-10 Paul Eggert <eggert@cs.ucla.edu>
10850
10851 Fix minor problems found by static checking (Bug#9031).
10852 * chartab.c (char_table_set_range, map_sub_char_table):
10853 Remove unused locals.
10854 (uniprop_table): Now static.
10855 * composite.c (_work_char): Remove unused static var.
10856
9cb2ac56
JB
108572011-07-09 Juanma Barranquero <lekktu@gmail.com>
10858
10859 * chartab.c (uniprop_table_uncompress): Remove unused local variable.
10860
f25661f0
JD
108612011-07-09 Jan Djärv <jan.h.d@swipnet.se>
10862
10863 * gtkutil.c (qttip_cb): Remove code without function.
10864
8278c4fe
EZ
108652011-07-09 Eli Zaretskii <eliz@gnu.org>
10866
10867 * w32.c (pthread_sigmask): New stub.
10868
1692ae2d 108692011-07-08 Paul Eggert <eggert@cs.ucla.edu>
123403e4 10870
8a6ebd58 10871 Use pthread_sigmask, not sigprocmask (Bug#9010).
123403e4
PE
10872 sigprocmask is portable only for single-threaded applications, and
10873 Emacs can be multi-threaded when it uses GTK.
1301ac26
PE
10874 * Makefile.in (LIB_PTHREAD_SIGMASK): New macro.
10875 (LIBES): Use it.
10876 * callproc.c (Fcall_process):
10877 * process.c (create_process):
10878 * sysdep.c (sys_sigblock, sys_sigunblock, sys_sigsetmask):
10879 Use pthread_sigmask, not sigprocmask.
123403e4 10880
1b854618
JD
108812011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10882
10883 * gtkutil.c (qttip_cb): Set line wrap to FALSE for tooltip widget.
10884 (xg_prepare_tooltip): Revert text in x->ttip_lbl, margins was
10885 wrong (Bug#8591).
10886
3fe4b549
JD
108872011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10888
0ce7e563
JD
10889 * gtkutil.c (xg_prepare_tooltip): Fix indentation and comment.
10890 Put text in x->ttip_lbl instead of gtk_tooltip_set_text (Bug#8591).
10891 (xg_hide_tooltip): Fix comment.
10892
3fe4b549
JD
10893 * nsterm.m (initFrameFromEmacs): Don't use ns_return_types
10894 in registerServicesMenuSendTypes.
10895 (validRequestorForSendType): Don't check ns_return_types.
10896
10897 * nsfns.m (Fx_open_connection): Put NSStringPboardType into
10898 ns_return_type.
10899
5df75e47
JR
109002011-07-08 Jason Rumney <jasonr@gnu.org>
10901
22610910
JR
10902 * w32term.c (x_make_frame_visible): Use SH_SHOWNORMAL rather than
10903 SH_SHOW for hidden windows (Bug#5482).
10904
5df75e47
JR
10905 * w32fns.c (w32_wnd_proc) [WM_TIMER, WM_SET_CURSOR]: Avoid using
10906 frame struct members of non-existent frames (Bug#6284).
10907
699c10bd
JD
109082011-07-08 Jan Djärv <jan.h.d@swipnet.se>
10909
4393663b
JD
10910 * nsterm.m (keyDown): Call to wantsToDelayTextChangeNotifications and
10911 variable firstTime not needed on OSX >= 10.6.
10912 (setPosition): setFloatValue:knobProportion: is deprecated on OSX
10913 >= 10.5. Use setKnobProportion, setDoubleValue.
10914
10915 * nsterm.h (MAC_OS_X_VERSION_10_3, MAC_OS_X_VERSION_10_4)
10916 (MAC_OS_X_VERSION_10_5): Define if not defined.
10917 (EmacsView, EmacsTooltip): Implements NSWindowDelegate on OSX >= 10.6.
10918 (EmacsMenu): Implements NSMenuDelegate on OSX >= 10.6.
10919 (EmacsToolbar): Implements NSToolbarDelegate on OSX >= 10.6.
10920
10921 * nsselect.m (ns_string_from_pasteboard): Don't use deprecated methods
090bd7cb 10922 cString and lossyCString on OSX >= 10.4.
4393663b 10923
58179cce 10924 * nsmenu.m (fillWithWidgetValue): Don't use deprecated method
4393663b
JD
10925 sizeToFit on OSX >= 10.2.
10926
10927 * nsimage.m (allocInitFromFile): Don't use deprecated method
10928 bestRepresentationForDevice on OSX >= 10.6.
10929
10930 * nsfns.m (check_ns_display_info): Cast to long and use %ld in error
10931 to avoid warning.
10932
10933 * emacs.c: Declare unexec_init_emacs_zone.
10934
a63e0781
JD
10935 * nsgui.h: Fix compiler warning about gnulib redefining verify.
10936
699c10bd
JD
10937 * nsselect.m (ns_get_local_selection): Change to extern (Bug#8842).
10938
10939 * nsmenu.m (ns_update_menubar): Remove useless setDelegate call
10940 on svcsMenu (Bug#8842).
10941
10942 * nsfns.m (Fx_open_connection): Remove NSStringPboardType from
10943 ns_return_types.
10944 (Fns_list_services): Just return Qnil on 10.6, code not working there.
10945
10946 * nsterm.m (QUTF8_STRING): Declare.
10947 (initFrameFromEmacs): Call registerServicesMenuSendTypes.
10948 (validRequestorForSendType): Return type is (id).
10949 Change indexOfObjectIdenticalTo to indexOfObject.
10950 Check if we have local selection before returning self (Bug#8842).
10951 (writeSelectionToPasteboard): Put local selection into paste board
10952 if we have a local selection (Bug#8842).
10953 (syms_of_nsterm): DEFSYM QUTF8_STRING.
10954
10955 * nsterm.h (MAC_OS_X_VERSION_10_6): Define here instead of nsterm.m.
10956 (ns_get_local_selection): Declare.
10957
54e10184
LMI
109582011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
10959
9888ff71
LMI
10960 * keymap.c (describe_map_tree): Don't insert a double newline at
10961 the end of the buffer (bug#1169) and return whether we inserted
10962 something.
10963
54e10184
LMI
10964 * callint.c (Fcall_interactively): Change "reading args" to
10965 "providing args" to try to clarify what it does (bug#1010).
10966
15fa4783
KH
109672011-07-07 Kenichi Handa <handa@m17n.org>
10968
10969 * composite.c (composition_compute_stop_pos): Ignore a static
10970 composition starting before CHARPOS (Bug#8915).
10971
10972 * xdisp.c (handle_composition_prop): Likewise.
10973
a8815b00
EZ
109742011-07-07 Eli Zaretskii <eliz@gnu.org>
10975
10976 * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
10977 (Bug#9015)
10978
ef7b981d 109792011-07-07 Kenichi Handa <handa@m17n.org>
c805dec0
KH
10980
10981 * character.h (unicode_category_t): New enum type.
10982
10983 * chartab.c (uniprop_decoder_t, uniprop_encoder_t): New types.
10984 (Qchar_code_property_table): New variable.
10985 (UNIPROP_TABLE_P, UNIPROP_GET_DECODER)
10986 (UNIPROP_COMPRESSED_FORM_P): New macros.
10987 (char_table_ascii): Uncompress the compressed values.
10988 (sub_char_table_ref): New arg is_uniprop. Callers changed.
10989 Uncompress the compressed values.
ac389d0c 10990 (sub_char_table_ref_and_range): Likewise.
c805dec0
KH
10991 (char_table_ref_and_range): Uncompress the compressed values.
10992 (sub_char_table_set): New arg is_uniprop. Callers changed.
10993 Uncompress the compressed values.
10994 (sub_char_table_set_range): Args changed. Callers changed.
10995 (char_table_set_range): Adjuted for the above change.
10996 (map_sub_char_table): Delete args default_val and parent. Add arg
10997 top. Give decoded values to a Lisp function.
640c8776 10998 (map_char_table): Adjust for the above change. Give decoded
c805dec0
KH
10999 values to a Lisp function. Gcpro more variables.
11000 (uniprop_table_uncompress)
11001 (uniprop_decode_value_run_length): New functions.
11002 (uniprop_decoder, uniprop_decoder_count): New variables.
11003 (uniprop_get_decoder, uniprop_encode_value_character)
11004 (uniprop_encode_value_run_length, uniprop_encode_value_numeric):
11005 New functions.
11006 (uniprop_encoder, uniprop_encoder_count): New variables.
11007 (uniprop_get_encoder, uniprop_table)
11008 (Funicode_property_table_internal, Fget_unicode_property_internal)
11009 (Fput_unicode_property_internal): New functions.
11010 (syms_of_chartab): DEFSYM Qchar_code_property_table, defsubr
11011 Sunicode_property_table_internal, Sget_unicode_property_internal,
5e617bc2 11012 and Sput_unicode_property_internal. Defvar_lisp
c805dec0
KH
11013 char-code-property-alist.
11014
640c8776 11015 * composite.c (CHAR_COMPOSABLE_P): Adjust for the change of
c805dec0
KH
11016 Vunicode_category_table.
11017
640c8776 11018 * font.c (font_range): Adjust for the change of
c805dec0
KH
11019 Vunicode_category_table.
11020
76b397fb
DN
110212011-07-07 Dan Nicolaescu <dann@ics.uci.edu>
11022
11023 * m/iris4d.h: Remove file, move contents ...
11024 * s/irix6-5.h: ... here.
11025
22b4128e
PE
110262011-07-06 Paul Eggert <eggert@cs.ucla.edu>
11027
11028 Remove unportable assumption about struct layout (Bug#8884).
8a5c77bb
PE
11029 * alloc.c (mark_buffer):
11030 * buffer.c (reset_buffer_local_variables, Fbuffer_local_variables)
11031 (clone_per_buffer_values): Don't assume that
22b4128e
PE
11032 sizeof (struct buffer) is a multiple of sizeof (Lisp_Object).
11033 This isn't true in general, and it's particularly not true
11034 if Emacs is configured with --with-wide-int.
11035 * buffer.h (FIRST_FIELD_PER_BUFFER, LAST_FIELD_PER_BUFFER):
11036 New macros, used in the buffer.c change.
11037
869795d6
JD
110382011-07-05 Jan Djärv <jan.h.d@swipnet.se>
11039
11040 * xsettings.c: Use both GConf and GSettings if both are available.
11041 (store_config_changed_event): Add comment.
11042 (dpyinfo_valid, store_font_name_changed, map_tool_bar_style)
11043 (store_tool_bar_style_changed): New functions.
5e617bc2 11044 (store_monospaced_changed): Add comment. Call dpyinfo_valid.
869795d6
JD
11045 (struct xsettings): Move font inside HAVE_XFT.
11046 (GSETTINGS_TOOL_BAR_STYLE, GSETTINGS_FONT_NAME): New defines.
640c8776 11047 (GSETTINGS_MONO_FONT): Rename from SYSTEM_MONO_FONT.
869795d6 11048 Move inside HAVE_XFT.
640c8776 11049 (something_changed_gsettingsCB): Rename from something_changedCB.
869795d6
JD
11050 Check for changes in GSETTINGS_TOOL_BAR_STYLE and GSETTINGS_FONT_NAME
11051 also.
11052 (GCONF_TOOL_BAR_STYLE, GCONF_FONT_NAME): New defines.
5e617bc2 11053 (GCONF_MONO_FONT): Rename from SYSTEM_MONO_FONT. Move inside HAVE_XFT.
640c8776 11054 (something_changed_gconfCB): Rename from something_changedCB.
869795d6
JD
11055 Check for changes in GCONF_TOOL_BAR_STYLE and GCONF_FONT_NAME also.
11056 (parse_settings): Move check for font inside HAVE_XFT.
11057 (read_settings, apply_xft_settings): Add comment.
11058 (read_and_apply_settings): Add comment. Call map_tool_bar_style and
11059 store_tool_bar_style_changed. Move check for font inside HAVE_XFT and
11060 call store_font_name_changed.
11061 (xft_settings_event): Add comment.
11062 (init_gsettings): Add comment. Get values for GSETTINGS_TOOL_BAR_STYLE
11063 and GSETTINGS_FONT_NAME. Move check for fonts within HAVE_XFT.
11064 (init_gconf): Add comment. Get values for GCONF_TOOL_BAR_STYLE
11065 and GCONF_FONT_NAME. Move check for fonts within HAVE_XFT.
11066 (xsettings_initialize): Call init_gsettings last.
640c8776
SM
11067 (xsettings_get_system_font, xsettings_get_system_normal_font):
11068 Add comment.
869795d6 11069
d8ed26bd
PE
110702011-07-05 Paul Eggert <eggert@cs.ucla.edu>
11071
11072 Random fixes. E.g., (random) never returned negative values.
11073 * fns.c (Frandom): Use GET_EMACS_TIME for random seed, and add the
11074 subseconds part to the entropy, as that's a bit more random.
11075 Prefer signed to unsigned, since the signedness doesn't matter and
11076 in general we prefer signed. When given a limit, use a
11077 denominator equal to INTMASK + 1, not to VALMASK + 1, because the
11078 latter isn't right if USE_2_TAGS_FOR_INTS.
11079 * sysdep.c (get_random): Return a value in the range 0..INTMASK,
11080 not 0..VALMASK. Don't discard "excess" bits that random () returns.
11081
cabf1cac
SM
110822011-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
11083
11084 * textprop.c (text_property_stickiness):
11085 Obey Vtext_property_default_nonsticky.
11086 (syms_of_textprop): Add `display' to Vtext_property_default_nonsticky.
11087 * w32fns.c (syms_of_w32fns):
11088 * xfns.c (syms_of_xfns): Don't Add `display' since it's there by default.
11089
6e9b2be9
PE
110902011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11091
11092 * fileio.c (barf_or_query_if_file_exists): Use S_ISDIR.
11093 This is more efficient than Ffile_directory_p and avoids a minor race.
11094
90186c68
LMI
110952011-07-04 Lars Magne Ingebrigtsen <larsi@gnus.org>
11096
7c301272
LMI
11097 * buffer.c (Foverlay_put): Say what the return value is
11098 (bug#7835).
11099
c4f2d8d4
LMI
11100 * fileio.c (barf_or_query_if_file_exists): Check first if the file
11101 is a directory before asking whether to use the file name
11102 (bug#7564).
ad637907
LMI
11103 (barf_or_query_if_file_exists): Make the "File is a directory"
11104 error be more correct.
c4f2d8d4 11105
90186c68
LMI
11106 * fns.c (Frequire): Remove the mention of the .gz files, since
11107 that's installation-specific, but keep the mention of
11108 `get-load-suffixes'.
11109
da64016e
PE
111102011-07-04 Paul Eggert <eggert@cs.ucla.edu>
11111
11112 * editfns.c (Fformat_time_string): Don't assume strlen fits in int.
11113 Report string overflow if the output is too long.
11114
7d47b580
JB
111152011-07-04 Juanma Barranquero <lekktu@gmail.com>
11116
a555cb87
JB
11117 * gnutls.c (Fgnutls_boot): Don't mention :verify-error.
11118 (syms_of_gnutls): Remove duplicate DEFSYM for
11119 Qgnutls_bootprop_verify_hostname_error, an error for
11120 Qgnutls_bootprop_verify_error (which is no longer used).
11121
7d47b580
JB
11122 * eval.c (find_handler_clause): Remove parameters `sig' and `data',
11123 unused since 2011-01-26T20:02:07Z!monnier@iro.umontreal.ca. All callers changed.
11124 Also (re)move comments that are misplaced or no longer relevant.
11125
1e49bfab
LMI
111262011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11127
11128 * callint.c (Finteractive): Clarify the meaning of "@" (bug#8813).
11129
1485f4c0
CY
111302011-07-03 Chong Yidong <cyd@stupidchicken.com>
11131
11132 * xfaces.c (Finternal_merge_in_global_face): Modify the foreground
11133 and background color parameters if they have been changed.
11134
a9ab721e
LMI
111352011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
11136
11137 * editfns.c (Fformat): Clarify the - and 0 flags (bug#6659).
11138
cf7cff57
PE
111392011-07-03 Paul Eggert <eggert@cs.ucla.edu>
11140
2e13213d
PE
11141 * xsettings.c (SYSTEM_FONT): Define only when used.
11142 No need to define when HAVE_GSETTINGS || !HAVE_XFT.
11143
cf7cff57
PE
11144 * keymap.c (access_keymap_1): Now static.
11145
7a8e04f7
CY
111462011-07-02 Chong Yidong <cyd@stupidchicken.com>
11147
11148 * keyboard.c (command_loop_1): If a down-mouse event is unbound,
11149 leave any prefix arg for the up event (Bug#1586).
11150
61352f62
LMI
111512011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
11152
69bb1ef7
LMI
11153 * lread.c (syms_of_lread): Mention single symbols defined by
11154 `defvar' or `defconst' (bug#7154).
11155
61352f62 11156 * fns.c (Frequire): Mention .el.gz files (bug#7314).
7b3747f9 11157 (Frequire): Mention get-load-suffixes.
61352f62 11158
28545e04
MR
111592011-07-02 Martin Rudalics <rudalics@gmx.at>
11160
11161 * window.h (window): Remove clone_number slot.
11162 * window.c (Fwindow_clone_number, Fset_window_clone_number):
11163 Remove.
11164 (make_parent_window, make_window, saved_window)
11165 (Fset_window_configuration, save_window_save): Don't deal with
11166 clone numbers.
11167 * buffer.c (Qclone_number): Remove declaration.
11168 (sort_overlays, overlay_strings): Don't deal with clone numbers.
11169
3349e122
SM
111702011-07-02 Stefan Monnier <monnier@iro.umontreal.ca>
11171
11172 Add multiple inheritance to keymaps.
11173 * keymap.c (Fmake_composed_keymap): New function.
11174 (Fset_keymap_parent): Simplify.
11175 (fix_submap_inheritance): Remove.
11176 (access_keymap_1): New function extracted from access_keymap to handle
11177 embedded parents and handle lists of maps.
11178 (access_keymap): Use it.
11179 (Fkeymap_prompt, map_keymap_internal, map_keymap, store_in_keymap)
11180 (Fcopy_keymap): Handle embedded parents.
11181 (Fcommand_remapping, define_as_prefix): Simplify.
11182 (Fkey_binding): Simplify.
11183 (syms_of_keymap): Move minibuffer-local-completion-map,
11184 minibuffer-local-filename-completion-map,
11185 minibuffer-local-must-match-map, and
11186 minibuffer-local-filename-must-match-map to Elisp.
11187 (syms_of_keymap): Defsubr make-composed-keymap.
11188 * keyboard.c (menu_bar_items): Use map_keymap_canonical.
11189 (parse_menu_item): Trivial simplification.
11190
3279eb87
GM
111912011-07-01 Glenn Morris <rgm@gnu.org>
11192
11193 * Makefile.in (SETTINGS_LIBS): Fix typo.
11194
39cb9e56 111952011-07-01 Kazuhiro Ito <kzhr@d1.dion.ne.jp> (tiny change)
4550efdf
KI
11196
11197 * coding.c (Fencode_coding_string): Record the last coding system
11198 used, as the function doc string says (bug#8738).
11199
0949d2b6
JD
112002011-07-01 Jan Djärv <jan.h.d@swipnet.se>
11201
11202 * xsettings.c (store_monospaced_changed): Take new font as arg and
11203 check for change against current_mono_font.
11204 (EMACS_TYPE_SETTINGS): Remove this and related defines.
11205 (emacs_settings_constructor, emacs_settings_get_property)
11206 (emacs_settings_set_property, emacs_settings_class_init)
11207 (emacs_settings_init, gsettings_obj): Remove.
11208 (something_changedCB): New function for HAVE_GSETTINGS.
11209 (something_changedCB): HAVE_GCONF: Call store_monospaced_changed
11210 with value as argument.
11211 (init_gsettings): Check that GSETTINGS_SCHEMA exists before calling
11212 g_settings_new (Bug#8967). Do not create gsettings_obj.
9173deec 11213 Remove calls to g_settings_bind. Connect something_changedCB to
0949d2b6
JD
11214 "changed".
11215
11216 * xgselect.c: Add defined (HAVE_GSETTINGS).
11217 (xgselect_initialize): Ditto.
11218
11219 * process.c: Add defined (HAVE_GSETTINGS) for xgselect.h
11220 (wait_reading_process_output): Add defined (HAVE_GSETTINGS) for
11221 xg_select.
11222
bbc6b304
PE
112232011-07-01 Paul Eggert <eggert@cs.ucla.edu>
11224
11225 * eval.c (struct backtrace): Simplify and port the data structure.
11226 Do not assume that "int nargs : BITS_PER_INT - 2;" produces a
11227 signed bit field, as this assumption is not portable and it makes
11228 Emacs crash when compiled with Sun C 5.8 on sparc. Do not use
11229 "char debug_on_exit : 1" as this is not portable either; instead,
11230 use the portable "unsigned int debug_on_exit : 1". Remove unused
11231 member evalargs. Remove obsolete comments about cc bombing out.
11232
9851bfc5
JD
112332011-06-30 Jan Djärv <jan.h.d@swipnet.se>
11234
51bb811f 11235 * xsettings.c: Include glib-object.h, gio/gio.h if HAVE_GSETTINGS.
9851bfc5
JD
11236 Let HAVE_GSETTINGS override HAVE_GCONF.
11237 (store_monospaced_changed): New function.
11238 (EMACS_SETTINGS): A new type derived from GObject to handle
11239 GSettings notifications.
11240 (emacs_settings_constructor, emacs_settings_get_property)
11241 (emacs_settings_set_property, emacs_settings_class_init):
11242 New functions.
11243 (gsettings_client, gsettings_obj): New variables.
11244 (GSETTINGS_SCHEMA): New define.
11245 (something_changedCB): Call store_monospaced_changed.
11246 (init_gsettings): New function.
11247 (xsettings_initialize): Call init_gsettings.
11248 (syms_of_xsettings): Initialize gsettings_client, gsettings_obj
11249 to NULL.
11250
640c8776 11251 * Makefile.in (SETTINGS_CFLAGS, SETTINGS_LIBS): Rename from
9851bfc5
JD
11252 GCONF_CFLAGS/LIBS.
11253
5386012d
MR
112542011-06-29 Martin Rudalics <rudalics@gmx.at>
11255
11256 * window.c (resize_root_window, grow_mini_window)
11257 (shrink_mini_window): Rename Qresize_root_window to
11258 Qwindow_resize_root_window and Qresize_root_window_vertically to
11259 Qwindow_resize_root_window_vertically.
11260
f13e0b08
PE
112612011-06-28 Paul Eggert <eggert@cs.ucla.edu>
11262
11263 * gnutls.c (Qgnutls_bootprop_verify_error): Remove unused var.
11264
94515237
JB
112652011-06-27 Juanma Barranquero <lekktu@gmail.com>
11266
11267 * makefile.w32-in: Redesign dependencies so they reflect more
11268 clearly which files are directly included by each source file,
11269 and not through other includes.
11270
e43b6e43
MR
112712011-06-27 Martin Rudalics <rudalics@gmx.at>
11272
11273 * buffer.c (Qclone_number): Declare static and DEFSYM it.
11274 (sort_overlays, overlay_strings): When an overlay's clone number
11275 matches the window's clone number process the overlay even if
11276 the overlay's window property doesn't match the current window.
11277
d68443dc
MR
11278 * window.c (Fwindow_vchild): Rename to Fwindow_top_child.
11279 (Fwindow_hchild): Rename to Fwindow_left_child.
11280 (Fwindow_next): Rename to Fwindow_next_sibling.
11281 (Fwindow_prev): Rename to Fwindow_prev_sibling.
d615d6d2
MR
11282 (resize_window_check): Rename to window_resize_check.
11283 (resize_window_apply): Rename to window_resize_apply.
11284 (Fresize_window_apply): Rename to Fwindow_resize_apply.
11285 (Fdelete_other_windows_internal, resize_frame_windows)
11286 (Fsplit_window_internal, Fdelete_window_internal)
11287 (grow_mini_window, shrink_mini_window)
11288 (Fresize_mini_window_internal): Fix callers accordingly.
d68443dc 11289
c7e73be5
JD
112902011-06-26 Jan Djärv <jan.h.d@swipnet.se>
11291
11292 * emacsgtkfixed.h: State that this is only used with Gtk+3.
11293 (emacs_fixed_set_min_size): Remove.
11294 (emacs_fixed_new): Take frame as argument.
11295
11296 * emacsgtkfixed.c: State that this is only used with Gtk+3.
11297 (_EmacsFixedPrivate): Remove minwidth/height.
11298 Add struct frame *f.
11299 (emacs_fixed_init): Initialize priv->f.
11300 (get_parent_class, emacs_fixed_set_min_size): Remove.
11301 (emacs_fixed_new): Set priv->f to argument.
11302 (emacs_fixed_get_preferred_width)
11303 (emacs_fixed_get_preferred_height): Use min_width/height from
11304 frames size_hint to set minimum and natural (Bug#8919).
11305 (XSetWMSizeHints, XSetWMNormalHints): Override these functions
11306 and use min_width/height from frames size_hint to set
11307 min_width/height (Bug#8919).
11308
11309 * gtkutil.c (xg_create_frame_widgets): Pass f to emacs_fixed_new.
9173deec
JB
11310 (x_wm_set_size_hint): Remove call to emacs_fixed_set_min_size.
11311 Fix indentation.
c7e73be5 11312
cf99dcf8
EZ
113132011-06-26 Eli Zaretskii <eliz@gnu.org>
11314
11315 * bidi.c (bidi_paragraph_init): Test for ZV_BYTE before calling
11316 bidi_at_paragraph_end, since fast_looking_at doesn't like to be
11317 called at ZV.
11318
029529ac
CY
113192011-06-26 Chong Yidong <cyd@stupidchicken.com>
11320
11321 * process.c (wait_reading_process_output): Bypass select if
11322 waiting for a cell while ignoring keyboard input, and input is
11323 pending. Suggested by Jan Djärv (Bug#8869).
11324
7a7ef429
PE
113252011-06-25 Paul Eggert <eggert@cs.ucla.edu>
11326
11327 Use gnulib's dup2 module instead of rolling our own.
11328 * sysdep.c (dup2) [!HAVE_DUP2]: Remove; gnulib now does this.
11329
11fdef7d 113302011-06-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
989b42d2
YM
11331
11332 * dispnew.c (scrolling_window): Before scrolling, turn off a
11333 mouse-highlight in the window being scrolled.
11334
cd3520a4
JB
113352011-06-24 Juanma Barranquero <lekktu@gmail.com>
11336
11337 Move DEFSYM to lisp.h and use everywhere.
11338
11339 * character.h (DEFSYM): Move declaration...
11340 * lisp.h (DEFSYM): ...here.
11341
11342 * gnutls.c:
11343 * minibuf.c:
11344 * w32menu.c:
11345 * w32proc.c:
11346 * w32select.c: Don't include character.h.
11347
11348 * alloc.c (syms_of_alloc):
11349 * buffer.c (syms_of_buffer):
11350 * bytecode.c (syms_of_bytecode):
11351 * callint.c (syms_of_callint):
11352 * casefiddle.c (syms_of_casefiddle):
11353 * casetab.c (init_casetab_once):
11354 * category.c (init_category_once, syms_of_category):
11355 * ccl.c (syms_of_ccl):
11356 * cmds.c (syms_of_cmds):
11357 * composite.c (syms_of_composite):
11358 * dbusbind.c (syms_of_dbusbind):
11359 * dired.c (syms_of_dired):
11360 * dispnew.c (syms_of_display):
11361 * doc.c (syms_of_doc):
11362 * editfns.c (syms_of_editfns):
11363 * emacs.c (syms_of_emacs):
11364 * eval.c (syms_of_eval):
11365 * fileio.c (syms_of_fileio):
11366 * fns.c (syms_of_fns):
11367 * frame.c (syms_of_frame):
11368 * fringe.c (syms_of_fringe):
11369 * insdel.c (syms_of_insdel):
11370 * keymap.c (syms_of_keymap):
11371 * lread.c (init_obarray, syms_of_lread):
11372 * macros.c (syms_of_macros):
11373 * msdos.c (syms_of_msdos):
11374 * print.c (syms_of_print):
11375 * process.c (syms_of_process):
11376 * search.c (syms_of_search):
11377 * sound.c (syms_of_sound):
11378 * syntax.c (init_syntax_once, syms_of_syntax):
11379 * terminal.c (syms_of_terminal):
11380 * textprop.c (syms_of_textprop):
11381 * undo.c (syms_of_undo):
11382 * w32.c (globals_of_w32):
11383 * window.c (syms_of_window):
11384 * xdisp.c (syms_of_xdisp):
11385 * xfaces.c (syms_of_xfaces):
11386 * xfns.c (syms_of_xfns):
11387 * xmenu.c (syms_of_xmenu):
11388 * xsettings.c (syms_of_xsettings):
11389 * xterm.c (syms_of_xterm): Use DEFSYM.
11390
4228cf16
TZ
113912011-06-24 Teodor Zlatanov <tzz@lifelogs.com>
11392
cd3520a4 11393 * gnutls.c (syms_of_gnutls): Use the DEFSYM macro from character.h.
4228cf16 11394
7fcccf1e
PE
113952011-06-23 Paul Eggert <eggert@cs.ucla.edu>
11396
7efb4e0e
PE
11397 Integer and buffer overflow fixes (Bug#8873).
11398
ff5844ad
PE
11399 * print.c (printchar, strout): Check for string overflow.
11400 (PRINTPREPARE, printchar, strout):
11401 Don't set size unless allocation succeeds.
11402
90532f02
PE
11403 * minibuf.c (read_minibuf_noninteractive): Use ptrdiff_t, not int,
11404 for sizes. Check for string overflow more accurately.
11405 Simplify newline removal at end; this suppresses a GCC 4.6.0 warning.
11406
6d84508d
PE
11407 * macros.c: Integer and buffer overflow fixes.
11408 * keyboard.h (struct keyboard.kbd_macro_bufsize):
11409 * macros.c (Fstart_kbd_macro, store_kbd_macro_char):
11410 Use ptrdiff_t, not int, for sizes.
11411 Don't increment bufsize until after realloc succeeds.
11412 Check for size-calculation overflow.
11413 (Fstart_kbd_macro): Use EMACS_INT, not int, for XINT result.
11414
437b2cb4
PE
11415 * lisp.h (DEFVAR_KBOARD): Use offsetof instead of char * finagling.
11416
8b9ac8b4
PE
11417 * lread.c: Integer overflow fixes.
11418 (read_integer): Radix is now EMACS_INT, not int,
11419 to improve quality of diagnostics for out-of-range radices.
11420 Calculate buffer size correctly for out-of-range radices.
11421 (read1): Check for integer overflow in radices, and in
11422 read-circle numbers.
82cb60d3
PE
11423 (read_escape): Avoid int overflow.
11424 (Fload, openp, read_buffer_size, read1)
11425 (substitute_object_recurse, read_vector, read_list, map_obarray):
11426 Use ptrdiff_t, not int, for sizes.
11427 (read1): Use EMACS_INT, not int, for sizes.
20270765 11428 Check for size overflow.
8b9ac8b4 11429
7fcccf1e
PE
11430 * image.c (cache_image): Check for size arithmetic overflow.
11431
bfbbd7e7
PE
11432 * lread.c: Integer overflow issues.
11433 (saved_doc_string_size, saved_doc_string_length)
11434 (prev_saved_doc_string_size, prev_saved_doc_string_length):
11435 Now ptrdiff_t, not int.
11436 (read1): Don't assume doc string length fits in int. Check for
11437 out-of-range doc string lengths.
11438 (read_list): Don't assume file position fits in int.
39019e54 11439 (read_escape): Check for hex character overflow.
bfbbd7e7 11440
4e323265
LL
114412011-06-22 Leo Liu <sdl.web@gmail.com>
11442
11443 * minibuf.c (Fcompleting_read_default, Vcompleting_read_function):
11444 Move to minibuffer.el.
11445
85fece3e
PE
114462011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11447
20b84ce9 11448 Fixes for GLYPH_DEBUG found by GCC 4.6.0 static checking.
85fece3e
PE
11449 The following patches are for when GLYPH_DEBUG && !XASSERT.
11450 * dispextern.h (trace_redisplay_p, dump_glyph_string):
11451 * dispnew.c (flush_stdout):
11452 * xdisp.c (dump_glyph_row, dump_glyph_matrix, dump_glyph):
11453 Mark as externally visible.
11454 * dispnew.c (check_window_matrix_pointers): Now static.
11455 * dispnew.c (window_to_frame_vpos):
11456 * xfns.c (unwind_create_frame):
11457 * xterm.c (x_check_font): Remove unused local.
11458 * scroll.c (CHECK_BOUNDS):
11459 * xfaces.c (cache_fache): Rename local to avoid shadowing.
11460 * xfns.c, w32fns.c (image_cache_refcount, dpyinfo_refcount): Now static.
11461 * xdisp.c (check_window_end): Now a no-op if !XASSERTS.
11462 (debug_first_unchanged_at_end_vpos, debug_last_unchanged_at_beg_vpos)
11463 (debug_dvpos, debug_dy, debug_delta, debug_delta_bytes, debug_end_vpos):
11464 Now static.
11465 (debug_method_add): Use va_list and vsprintf rather than relying
11466 on undefined behavior with wrong number of arguments.
11467 (dump_glyph, dump_glyph_row, Fdump_glyph_matrix):
11468 Don't assume ptrdiff_t and EMACS_INT are the same width as int.
11469 In this code, it's OK to assume C99 behavior for ptrdiff_t formats
11470 since we're not interested in debugging glyphs with old libraries.
11471 * xfaces.c (cache_face): Move debugging code earlier; this pacifies
11472 GCC 4.6.0's static checking.
11473
0766b489
PE
114742011-06-22 Paul Eggert <eggert@cs.ucla.edu>
11475
31fd4b32
PE
11476 Integer overflow and signedness fixes (Bug#8873).
11477 A few related buffer overrun fixes, too.
11478
b79e8648
PE
11479 * font.c (font_score): Use EMACS_INT, not int, to store XINT value.
11480
0766b489
PE
11481 * dispextern.h (struct face.stipple):
11482 * image.c (x_bitmap_height, x_bitmap_width, x_bitmap_pixmap)
11483 (x_bitmap_mask, x_allocate_bitmap_record)
11484 (x_create_bitmap_from_data, x_create_bitmap_from_file)
11485 (x_destroy_bitmap, x_destroy_all_bitmaps, x_create_bitmap_mask)
11486 (x_create_bitmap_from_xpm_data):
11487 * nsterm.h (struct ns_display_info.bitmaps_size, .bitmaps_last):
11488 * w32term.h (struct w32_display_info.icon_bitmap_id, .bitmaps_size)
11489 (.bitmaps_last):
11490 * xfaces.c (load_pixmap):
11491 * xterm.c (x_bitmap_icon, x_wm_set_icon_pixmap):
11492 * xterm.h (struct x_display_info.icon_bitmap_id, .bitmaps_size)
11493 (.bitmaps_last, struct x_output.icon_bitmap):
11494 Use ptrdiff_t, not int, for bitmap indexes.
11495 (x_allocate_bitmap_record): Check for size overflow.
11496 * dispextern.h, lisp.h: Adjust to API changes elsewhere.
11497
b081724f
PE
11498 Use ptrdiff_t, not int, for overlay counts.
11499 * buffer.h (overlays_at, sort_overlays, GET_OVERLAYS_AT):
11500 * editfns.c (overlays_around, get_pos_property):
11501 * textprop.c (get_char_property_and_overlay):
11502 * xdisp.c (next_overlay_change, note_mouse_highlight):
11503 * xfaces.c (face_at_buffer_position):
21514da7
PE
11504 * buffer.c (OVERLAY_COUNT_MAX): New macro.
11505 (overlays_at, overlays_in, sort_overlays, Foverlays_at)
11506 (Fnext_overlay_change, Fprevious_overlay_change)
11507 (mouse_face_overlay_overlaps, Foverlays_in):
b081724f 11508 Use ptrdiff_t, not int, for sizes.
21514da7 11509 (overlays_at, overlays_in): Check for size-calculation overflow.
b081724f 11510
3de73e5e
PE
11511 * xterm.c (xim_initialize, same_x_server): Strlen may not fit in int.
11512
2606c57b
PE
11513 * xsmfns.c (smc_save_yourself_CB, x_session_initialize): Avoid strlen.
11514 (x_session_initialize): Do not assume string length fits in int.
11515
aaafe47a
PE
11516 * xsettings.c (apply_xft_settings): Fix potential buffer overrun.
11517 This is unlikely, but can occur if DPI is outlandish.
11518
2674ddc8 11519 * xsettings.c (Ffont_get_system_normal_font, Ffont_get_system_font):
3a5077c5
PE
11520 * xselect.c (Fx_get_atom_name): Avoid need for strlen.
11521
28154962
PE
11522 * xrdb.c: Don't assume strlen fits in int; avoid some strlens.
11523 * xrdb.c (magic_file_p, search_magic_path):
11524 Omit last arg SUFFIX; it was always 0. All callers changed.
11525 (magic_file_p): Use ptrdiff_t, not int. Check for size overflow.
11526
7de51af5
PE
11527 * xfont.c (xfont_match): Avoid need for strlen.
11528
25ed6cc3
PE
11529 * xfns.c: Don't assume strlen fits in int.
11530 (xic_create_fontsetname, x_window): Use ptrdiff_t, not int.
11531
4eab31dd
PE
11532 * xdisp.c (message_log_check_duplicate): Return intmax_t,
11533 not unsigned long, as we prefer signed integers. All callers changed.
11534 Detect integer overflow in repeat count.
11535 (message_dolog): Don't assume print length fits in 39 bytes.
df1f27af 11536 (display_mode_element): Don't assume strlen fits in int.
4eab31dd 11537
171e2a58
PE
11538 * termcap.c: Don't assume sizes fit in int and never overflow.
11539 (struct termcap_buffer, tgetent): Use ptrdiff_t, not int, for sizes.
11540 (gobble_line): Check for size-calculation overflow.
11541
ad39faca 11542 * minibuf.c (Fread_buffer):
6e5bb2dc 11543 * lread.c (intern, intern_c_string):
74ca2eb3
PE
11544 * image.c (xpm_scan) [HAVE_NS && !HAVE_XPM]:
11545 Don't assume string length fits in int.
11546
52c61c22 11547 * keyboard.c (parse_tool_bar_item):
9bda3520
PE
11548 * gtkutil.c (style_changed_cb): Avoid need for strlen.
11549
b5b8c9e5
PE
11550 * font.c: Don't assume string length fits in int.
11551 (font_parse_xlfd, font_parse_fcname, font_unparse_fcname):
11552 Use ptrdiff_t, not int.
ccd6111c
PE
11553 (font_intern_prop): Don't assume string length fits in int.
11554 Don't assume integer property fits in fixnum.
11555 * font.h (font_intern_prop): 2nd arg is now ptrdiff_t, not int.
b5b8c9e5 11556
882f0d81 11557 * filelock.c: Fix some buffer overrun and integer overflow issues.
51cab52b 11558 (get_boot_time): Don't assume gzip command string fits in 100 bytes.
882f0d81
PE
11559 Reformulate so as not to need the command string.
11560 Invoke gzip -cd rather than gunzip, as it's more portable.
11561 (lock_info_type, lock_file_1, lock_file):
11562 Don't assume pid_t and time_t fit in unsigned long.
11563 (LOCK_PID_MAX): Remove; we now use more-reliable bounds.
11564 (current_lock_owner): Prefer signed type for sizes.
11565 Use memcpy, not strncpy, where memcpy is what is really wanted.
11566 Don't assume (via atoi) that time_t and pid_t fit in int.
11567 Check for time_t and/or pid_t out of range, e.g., via a network share.
11568 Don't alloca where an auto var works fine.
11569
93f4cf88
PE
11570 * fileio.c: Fix some integer overflow issues.
11571 (file_name_as_directory, Fexpand_file_name, Fsubstitute_in_file_name):
11572 Don't assume string length fits in int.
11573 (directory_file_name): Don't assume string length fits in long.
11574 (make_temp_name): Don't assume pid fits in int, or that its print
11575 length is less than 20.
11576
f3e92b69
PE
11577 * data.c (Fsubr_name): Rewrite to avoid a strlen call.
11578
1bfdaf10
PE
11579 * coding.c (make_subsidiaries): Don't assume string length fits in int.
11580
35016e9a
PE
11581 * callproc.c (child_setup): Rewrite to avoid two strlen calls.
11582
3d1e65a1
PE
11583 * process.c (Fformat_network_address): Use EMACS_INT, not EMACS_UINT.
11584 We prefer signed integers, even for size calculations.
11585
0b963a93
PE
11586 * emacs.c: Don't assume string length fits in 'int'.
11587 (DEFINE_DUMMY_FUNCTION, sort_args): Use ptrdiff_t, not int.
11588 (main): Don't invoke strlen when not needed.
11589
573f4b54
PE
11590 * dbusbind.c (XD_ERROR): Don't arbitrarily truncate string.
11591 (XD_DEBUG_MESSAGE): Don't waste a byte.
11592
989f33ba
PE
11593 * callproc.c (getenv_internal_1, getenv_internal)
11594 (Fgetenv_internal):
965d34eb
PE
11595 * buffer.c (init_buffer): Don't assume string length fits in 'int'.
11596
e4d29b33
PE
11597 * lread.c (invalid_syntax): Omit length argument.
11598 All uses changed. This doesn't fix a bug, but it simplifies the
11599 code away from its former Hollerith-constant appearance, and it's
11600 one less 'int' to worry about when looking at integer-overflow issues.
51cab52b 11601 (string_to_number): Simplify 2011-04-26 change by invoking xsignal1.
e4d29b33 11602
eb49b136
PE
11603 * lisp.h (DEFUN): Remove bogus use of sizeof (struct Lisp_Subr).
11604 This didn't break anything, but it didn't help either.
11605 It's confusing to put a bogus integer in a place where the actual
11606 value does not matter.
9f62aeb1 11607 (LIST_END_P): Remove unused macro and its bogus comment.
cbeff735 11608 (make_fixnum_or_float): Remove unnecessary cast to EMACS_INT.
eb49b136 11609
15375a22
PE
11610 * lisp.h (union Lisp_Object.i): EMACS_INT, not EMACS_UINT.
11611 This is for consistency with the ordinary, non-USE_LISP_UNION_TYPE,
11612 implementation.
b61cc01c
PE
11613 (struct Lisp_Bool_Vector.size): EMACS_INT, not EMACS_UINT.
11614 We prefer signed types, and the value cannot exceed the EMACS_INT
11615 range anyway (because otherwise the length would not be representable).
9a8e8d9b
PE
11616 (XSET) [USE_LISP_UNION_TYPE]: Use uintptr_t and intptr_t,
11617 not EMACS_UINT and EMACS_INT, when converting pointer to integer.
11618 This avoids a GCC warning when WIDE_EMACS_INT.
15375a22 11619
53b2623d
PE
11620 * indent.c (sane_tab_width): New function.
11621 (current_column, scan_for_column, Findent_to, position_indentation)
11622 (compute_motion): Use it. This is just for clarity.
8fcaf9cc 11623 (Fcompute_motion): Don't assume hscroll and tab offset fit in int.
53b2623d 11624
51cab52b 11625 * image.c (xbm_image_p): Don't assume stated width, height fit in int.
45aebb64 11626
f2ed8a70
PE
11627 * lisp.h (lint_assume): New macro.
11628 * composite.c (composition_gstring_put_cache):
11629 * ftfont.c (ftfont_shape_by_flt): Use it to pacify GCC 4.6.0.
11630
abe80cc6
PE
11631 * editfns.c, insdel.c:
11632 Omit unnecessary forward decls, to simplify future changes.
a9e860e1 11633
b02c740e
PE
11634 * ftfont.c (ftfont_shape_by_flt): Use signed integers for lengths.
11635
ebc96716
PE
11636 * font.c (Ffont_shape_gstring): Don't assume glyph len fits in 'int'.
11637
b4e50fa0 11638 * fns.c (Ffillarray): Don't assume bool vector size fits in 'int'.
f03dc6ef 11639 Use much-faster test for byte-length change.
311d5d7c 11640 Don't assume string byte-length fits in 'int'.
a4cf38e4 11641 Check that character arg fits in 'int'.
85461888 11642 (mapcar1): Declare byte as byte, for clarity.
b4e50fa0 11643
c0c1ee9f
PE
11644 * alloc.c (Fmake_bool_vector): Avoid unnecessary multiplication.
11645
a498d7f4
PE
11646 * fns.c (concat): Catch string overflow earlier.
11647 Do not rely on integer wraparound.
11648
51cab52b
PE
11649 * dispextern.h (struct it.overlay_strings_charpos)
11650 (struct it.selective): Now EMACS_INT, not int.
87830974
PE
11651 * xdisp.c (forward_to_next_line_start)
11652 (back_to_previous_visible_line_start)
11653 (reseat_at_next_visible_line_start, next_element_from_buffer):
11654 Don't arbitrarily truncate the value of 'selective' to int.
11655
76031fad
PE
11656 * xdisp.c (init_iterator): Use XINT, not XFASTINT; it might be < 0.
11657
5eb55db9
PE
11658 * composite.c: Don't truncate sizes to 'int'.
11659 (composition_gstring_p, composition_reseat_it)
11660 (composition_adjust_point): Use EMACS_INT, not int.
7d100a81
PE
11661 (get_composition_id, composition_gstring_put_cache): Use EMACS_INT,
11662 not EMACS_UINT, for indexes.
5eb55db9 11663
0703a717
PE
11664 * category.h (CATEGORY_SET_P): Remove unnecessary cast to EMACS_INT.
11665
d6202519
PE
11666 * buffer.c: Include <verify.h>.
11667 (struct sortvec.priority, struct sortstr.priority):
8961a454 11668 Now EMACS_INT, not int.
c20998a7 11669 (compare_overlays, cmp_for_strings): Avoid subtraction overflow.
67c36fce
PE
11670 (struct sortstr.size, record_overlay_string)
11671 (struct sortstrlist.size, struct sortlist.used):
11672 Don't truncate size to int.
11673 (record_overlay_string): Check for size-calculation overflow.
d6202519 11674 (init_buffer_once): Check at compile-time, not run-time.
fadf4e30 11675
d5a19415
JM
116762011-06-22 Jim Meyering <meyering@redhat.com>
11677
029529ac 11678 Don't leak an XBM-image-sized buffer
d5a19415
JM
11679 * image.c (xbm_load): Free the image buffer after using it.
11680
a9041e6c
PE
116812011-06-21 Paul Eggert <eggert@cs.ucla.edu>
11682
11683 Port to Sun C.
11684 * composite.c (find_automatic_composition): Omit needless 'return 0;'
11685 that Sun C diagnosed.
11686 * fns.c (secure_hash): Fix pointer signedness issue.
11687 * intervals.c (static_offset_intervals): New function.
11688 (offset_intervals): Use it.
11689
7f3f739f
LL
116902011-06-21 Leo Liu <sdl.web@gmail.com>
11691
11692 * deps.mk (fns.o):
11693 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha256.h and
11694 sha512.h.
11695
11696 * fns.c (secure_hash): Rename from crypto_hash_function and change
11697 the first arg to accept symbols.
5b66d427 11698 (Fsecure_hash): New primitive.
7f3f739f
LL
11699 (syms_of_fns): New symbols.
11700
76147d94
DD
117012011-06-20 Deniz Dogan <deniz@dogan.se>
11702
11703 * process.c (Fset_process_buffer): Clarify return value in
11704 docstring.
11705
7d7d0045
CY
117062011-06-18 Chong Yidong <cyd@stupidchicken.com>
11707
11708 * dispnew.c (add_window_display_history): Use BVAR.
11709
11710 * xdisp.c (debug_method_add): Use BVAR.
11711 (check_window_end, dump_glyph_matrix, dump_glyph)
11712 (dump_glyph_row, dump_glyph_string): Convert arglist to ANSI C.
11713
11714 * xfaces.c (check_lface_attrs, check_lface, dump_realized_face):
11715 Likewise.
11716
11717 * xfns.c (Fx_create_frame, x_create_tip_frame): Delay image cache
11718 check till after the cache is created in init_frame_faces.
11719
ff2bc410
SM
117202011-06-17 Stefan Monnier <monnier@iro.umontreal.ca>
11721
11722 * fns.c (Fsafe_length): Yet another int/Lisp_Object mixup.
11723
28177add
PE
117242011-06-16 Paul Eggert <eggert@cs.ucla.edu>
11725
dd3482fe
PE
11726 * lisp.h: Include <limits.h>, for INT_MAX, LONG_MAX, LLONG_MAX.
11727 Without this, prin1 mishandles Lisp_Misc_Save_Value printing on
11728 hosts with pre-C99 libraries, because pD is wrongly defined to "t".
11729
393d71f3 11730 Improve buffer-overflow checking (Bug#8873).
1c8e352f
PE
11731 * fileio.c (Finsert_file_contents):
11732 * insdel.c (insert_from_buffer_1, replace_range, replace_range_2):
11733 Remove the old (too-loose) buffer overflow checks.
11734 They weren't needed, since make_gap checks for buffer overflow.
11735 * insdel.c (make_gap_larger): Catch buffer overflows that were missed.
11736 The old code merely checked for Emacs fixnum overflow, and relied
11737 on undefined (wraparound) behavior. The new code avoids undefined
11738 behavior, and also checks for ptrdiff_t and/or size_t overflow.
11739
2e6813b0 11740 * editfns.c (Finsert_char): Don't dump core with very negative counts.
21d890a4
PE
11741 Tune. Don't use wider integers than needed. Don't use alloca.
11742 Use a bigger 'string' buffer. Rewrite to avoid 'n > 0' test.
2e6813b0 11743
599a9e4f
PE
11744 * insdel.c (replace_range): Fix buf overflow when insbytes < outgoing.
11745
99561444
PE
11746 * insdel.c, lisp.h (buffer_overflow): New function.
11747 (insert_from_buffer_1, replace_range, replace_range_2):
11748 * insdel.c (make_gap_larger):
11749 * editfns.c (Finsert_char):
11750 * fileio.c (Finsert_file_contents): Use it, to normalize wording.
11751
28177add
PE
11752 * buffer.h (BUF_BYTES_MAX): Cast to ptrdiff_t so that it's signed.
11753
e69dafad
PE
117542011-06-15 Paul Eggert <eggert@cs.ucla.edu>
11755
4baa020d 11756 Integer overflow and signedness fixes (Bug#8873, Bug#8828).
ff672d2c 11757
b1c46f02
PE
11758 * ccl.c (ASCENDING_ORDER): New macro, to work around GCC bug 43772.
11759 (GET_CCL_RANGE, IN_INT_RANGE): Use it.
11760
e69dafad
PE
11761 * fileio.c: Don't assume EMACS_INT fits in off_t.
11762 (emacs_lseek): New static function.
11763 (Finsert_file_contents, Fwrite_region): Use it.
11764 Use SEEK_SET, SEEK_CUR, SEEK_END as appropriate.
11765
566684ea
PE
11766 * fns.c (Fload_average): Don't assume 100 * load average fits in int.
11767
e6966cd6
PE
11768 * fns.c: Don't overflow int when computing a list length.
11769 * fns.c (QUIT_COUNT_HEURISTIC): New constant.
11770 (Flength, Fsafe_length): Use EMACS_INT, not int, to avoid unwanted
11771 truncation on 64-bit hosts. Check for QUIT every
11772 QUIT_COUNT_HEURISTIC entries rather than every other entry; that's
11773 faster and is responsive enough.
11774 (Flength): Report an error instead of overflowing an integer.
11775 (Fsafe_length): Return a float if the value is not representable
11776 as a fixnum. This shouldn't happen except in contrived situations.
6346d301 11777 (Fnthcdr, Fsort): Don't assume list length fits in int.
de41a810 11778 (Fcopy_sequence): Don't assume vector length fits in int.
00c604f2 11779
dd0b0efb
PE
11780 * alloc.c: Check that resized vectors' lengths fit in fixnums.
11781 (header_size, word_size): New constants.
11782 (allocate_vectorlike): Don't check size overflow here.
11783 (allocate_vector): Check it here instead, since this is the only
11784 caller of allocate_vectorlike that could cause overflow.
11785 Check that the new vector's length is representable as a fixnum.
11786
86fe5cfe
PE
11787 * fns.c (next_almost_prime): Don't return a multiple of 3 or 5.
11788 The previous code was bogus. For example, next_almost_prime (32)
11789 returned 39, which is undesirable as it is a multiple of 3; and
11790 next_almost_prime (24) returned 25, which is a multiple of 5 so
11791 why was the code bothering to check for multiples of 7?
11792
80e88859
PE
11793 * bytecode.c (exec_byte_code): Use ptrdiff_t, not int, for vector length.
11794
4a2f0ad6
PE
11795 * eval.c, doprnt.c (SIZE_MAX): Remove; inttypes.h defines this now.
11796
f66c7cf8
PE
11797 Variadic C functions now count arguments with ptrdiff_t.
11798 This partly undoes my 2011-03-30 change, which replaced int with size_t.
11799 Back then I didn't know that the Emacs coding style prefers signed int.
11800 Also, in the meantime I found a few more instances where arguments
4a2f0ad6
PE
11801 were being counted with int, which may truncate counts on 64-bit
11802 machines, or EMACS_INT, which may be unnecessarily wide.
f66c7cf8
PE
11803 * lisp.h (struct Lisp_Subr.function.aMANY)
11804 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call):
11805 Arg counts are now ptrdiff_t, not size_t.
11806 All variadic functions and their callers changed accordingly.
11807 (struct gcpro.nvars): Now size_t, not size_t. All uses changed.
11808 * bytecode.c (exec_byte_code): Check maxdepth for overflow,
11809 to avoid potential buffer overrun. Don't assume arg counts fit in 'int'.
11810 * callint.c (Fcall_interactively): Check arg count for overflow,
11811 to avoid potential buffer overrun. Use signed char, not 'int',
11812 for 'varies' array, so that we needn't bother to check its size
11813 calculation for overflow.
11814 * editfns.c (Fformat): Use ptrdiff_t, not EMACS_INT, to count args.
11815 * eval.c (apply_lambda):
11816 * fns.c (Fmapconcat): Use XFASTINT, not XINT, to get args length.
11817 (struct textprop_rec.argnum): Now ptrdiff_t, not int. All uses changed.
11818 (mapconcat): Use ptrdiff_t, not int and EMACS_INT, to count args.
11819
a1759b76
PE
11820 * callint.c (Fcall_interactively): Don't use index var as event count.
11821
d96be9fc
PE
11822 * vm-limit.c (check_memory_limits): Fix incorrect extern function decls.
11823 * mem-limits.h (SIZE): Remove; no longer used.
11824
a690a978 11825 * xterm.c (x_alloc_nearest_color_1): Prefer int to long when int works.
5efd304b 11826
578c21e6
PE
11827 Remove unnecessary casts.
11828 * xterm.c (x_term_init):
11829 * xfns.c (x_set_border_pixel):
11830 * widget.c (create_frame_gcs): Remove casts to unsigned long etc.
11831 These aren't needed now that we assume ANSI C.
11832
96f53c6c
PE
11833 * sound.c (Fplay_sound_internal): Remove cast to unsigned long.
11834 It's more likely to cause problems (due to unsigned overflow)
11835 than to cure them.
11836
83c77d31
PE
11837 * dired.c (Ffile_attributes): Don't use 32-bit hack on 64-bit hosts.
11838
ee2079f1
PE
11839 * unexelf.c (unexec): Don't assume BSS addr fits in unsigned.
11840
6da65536
PE
11841 * xterm.c (handle_one_xevent): Omit unnecessary casts to unsigned.
11842
7147c4a4
PE
11843 * keyboard.c (modify_event_symbol): Don't limit alist len to UINT_MAX.
11844
193e32d9
PE
11845 * lisp.h (CHAR_TABLE_SET): Omit now-redundant test.
11846
e5533da6
PE
11847 * lread.c (Fload): Don't compare a possibly-garbage time_t value.
11848
9910e595
PE
11849 GLYPH_CODE_FACE returns EMACS_INT, not int.
11850 * dispextern.h (merge_faces):
11851 * xfaces.c (merge_faces):
01103c44
PE
11852 * xdisp.c (get_next_display_element, next_element_from_display_vector):
11853 Don't assume EMACS_INT fits in int.
9910e595 11854
2638320e
PE
11855 * character.h (CHAR_VALID_P): Remove unused parameter.
11856 * fontset.c, lisp.h, xdisp.c: All uses changed.
11857
045eb8d9
PE
11858 * editfns.c (Ftranslate_region_internal): Omit redundant test.
11859
c1f134b5
PE
11860 * fns.c (concat): Minor tuning based on overflow analysis.
11861 This doesn't fix any bugs. Use int to hold character, instead
11862 of constantly refetching from Emacs object. Use XFASTINT, not
11863 XINT, for value known to be a character. Don't bother comparing
11864 a single byte to 0400, as it's always less.
11865
395fcb93 11866 * floatfns.c (Fexpt):
327eeec8
PE
11867 * fileio.c (make_temp_name): Omit unnecessary cast to unsigned.
11868
abbd3d23
PE
11869 * editfns.c (Ftranslate_region_internal): Use int, not EMACS_INT
11870 for characters.
11871
684a03ef
PE
11872 * doc.c (get_doc_string): Omit (unsigned)c that mishandled negatives.
11873
0fed43f3
PE
11874 * data.c (Faset): If ARRAY is a string, check that NEWELT is a char.
11875 Without this fix, on a 64-bit host (aset S 0 4294967386) would
11876 incorrectly succeed when S was a string, because 4294967386 was
11877 truncated before it was used.
11878
8fd02eb7
PE
11879 * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
11880 Otherwise, an out-of-range integer could cause undefined behavior
11881 on a 64-bit host.
11882
f8c86b69
PE
11883 * composite.c: Use int, not EMACS_INT, for characters.
11884 (fill_gstring_body, composition_compute_stop_pos): Use int, not
11885 EMACS_INT, for values that are known to be in character range.
11886 This doesn't fix any bugs but is the usual style inside Emacs and
11887 may generate better code on 32-bit machines.
11888
34206dd2
PE
11889 Make sure a 64-bit char is never passed to ENCODE_CHAR.
11890 This is for reasons similar to the recent CHAR_STRING fix.
11891 * charset.c (Fencode_char): Check that character arg is actually
11892 a character. Pass an int to ENCODE_CHAR.
11893 * charset.h (ENCODE_CHAR): Verify that the character argument is no
11894 wider than 'int', as a compile-time check to prevent future regressions
11895 in this area.
11896
c5958d4c 11897 * character.c (char_string): Remove unnecessary casts.
13bdea59
PE
11898
11899 Make sure a 64-bit char is never passed to CHAR_STRING.
11900 Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
11901 by silently ignoring the top 32 bits, allowing some values
11902 that were far too large to be valid characters.
11903 * character.h: Include <verify.h>.
11904 (CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
11905 arguments are no wider than unsigned, as a compile-time check
11906 to prevent future regressions in this area.
11907 * data.c (Faset):
01103c44 11908 * editfns.c (Fchar_to_string, general_insert_function, Finsert_char)
13bdea59
PE
11909 (Fsubst_char_in_region):
11910 * fns.c (concat):
11911 * xdisp.c (decode_mode_spec_coding):
11912 Adjust to CHAR_STRING's new requirement.
11913 * editfns.c (Finsert_char, Fsubst_char_in_region):
11914 * fns.c (concat): Check that character args are actually
11915 characters. Without this test, these functions did the wrong
11916 thing with wildly out-of-range values on 64-bit hosts.
11917
d37ca623
PE
11918 Remove incorrect casts to 'unsigned' that lose info on 64-bit hosts.
11919 These casts should not be needed on 32-bit hosts, either.
11920 * keyboard.c (read_char):
11921 * lread.c (Fload): Remove casts to unsigned.
11922
ea204efb
PE
11923 * lisp.h (UNSIGNED_CMP): New macro.
11924 This fixes comparison bugs on 64-bit hosts.
11925 (ASCII_CHAR_P): Use it.
11926 * casefiddle.c (casify_object):
01103c44 11927 * character.h (ASCII_BYTE_P, CHAR_VALID_P)
ea204efb
PE
11928 (SINGLE_BYTE_CHAR_P, CHAR_STRING):
11929 * composite.h (COMPOSITION_ENCODE_RULE_VALID):
11930 * dispextern.h (FACE_FROM_ID):
11931 * keyboard.c (read_char): Use UNSIGNED_CMP.
11932
41cb286c
PE
11933 * xmenu.c (dialog_selection_callback) [!USE_GTK]: Cast to intptr_t,
11934 not to EMACS_INT, to avoid GCC warning.
11935
4a1b9832
PE
11936 * xfns.c (x_set_scroll_bar_default_width): Remove unused 'int' locals.
11937
55daad71
PE
11938 * buffer.h (PTR_BYTE_POS, BUF_PTR_BYTE_POS): Remove harmful cast.
11939 The cast incorrectly truncated 64-bit byte offsets to 32 bits, and
11940 isn't needed on 32-bit machines.
8f95c75c 11941
01103c44
PE
11942 * buffer.c (Fgenerate_new_buffer_name):
11943 Use EMACS_INT for count, not int.
0ceccced 11944 (advance_to_char_boundary): Return EMACS_INT, not int.
e762cafe
PE
11945
11946 * data.c (Qcompiled_function): Now static.
11947
c6f072e7
PE
11948 * window.c (window_body_lines): Now static.
11949
20ce5912
PE
11950 * image.c (gif_load): Rename local to avoid shadowing.
11951
9c4c5f81
PE
11952 * lisp.h (SAFE_ALLOCA_LISP): Check for integer overflow.
11953 (struct Lisp_Save_Value): Use ptrdiff_t, not int, for 'integer' member.
11954 * alloc.c (make_save_value): Integer argument is now of type
11955 ptrdiff_t, not int.
11956 (mark_object): Use ptrdiff_t, not int.
11957 * lisp.h (pD): New macro.
11958 * print.c (print_object): Use it.
11959
c0c5c8ae
PE
11960 * alloc.c: Use EMACS_INT, not int, to count objects.
11961 (total_conses, total_markers, total_symbols, total_vector_size)
11962 (total_free_conses, total_free_markers, total_free_symbols)
01103c44
PE
11963 (total_free_floats, total_floats, total_free_intervals)
11964 (total_intervals, total_strings, total_free_strings):
c0c5c8ae
PE
11965 Now EMACS_INT, not int. All uses changed.
11966 (Fgarbage_collect): Compute overall total using a double, so that
11967 integer overflow is less likely to be a problem. Check for overflow
11968 when converting back to an integer.
5a25e253
PE
11969 (n_interval_blocks, n_string_blocks, n_float_blocks, n_cons_blocks)
11970 (n_vectors, n_symbol_blocks, n_marker_blocks): Remove.
11971 These were 'int' variables that could overflow on 64-bit hosts;
11972 they were never used, so remove them instead of repairing them.
211a0b2a 11973 (nzombies, ngcs, max_live, max_zombies): Now EMACS_INT, not 'int'.
6349ae4d
PE
11974 (inhibit_garbage_collection): Set gc_cons_threshold to max value.
11975 Previously, this ceilinged at INT_MAX, but that doesn't work on
11976 64-bit machines.
e46bb31a 11977 (allocate_pseudovector): Don't use EMACS_INT when int would do.
c0c5c8ae 11978
c78baabf 11979 * alloc.c (Fmake_bool_vector): Don't assume vector size fits in int.
86f61a15 11980 (allocate_vectorlike): Check for ptrdiff_t overflow.
b6439961
PE
11981 (mark_vectorlike, mark_char_table, mark_object): Avoid EMACS_UINT
11982 when a (possibly-narrower) signed value would do just as well.
11983 We prefer using signed arithmetic, to avoid comparison confusion.
c78baabf 11984
c9d624c6
PE
11985 * alloc.c: Catch some string size overflows that we were missing.
11986 (XMALLOC_OVERRUN_CHECK_SIZE) [!XMALLOC_OVERRUN_CHECK]: Define to 0,
11987 for convenience in STRING_BYTES_MAX.
11988 (STRING_BYTES_MAX): New macro, superseding the old one in lisp.h.
11989 The definition here is exact; the one in lisp.h was approximate.
11990 (allocate_string_data): Check for string overflow. This catches
11991 some instances we weren't catching before. Also, it catches
11992 size_t overflow on (unusual) hosts where SIZE_MAX <= min
11993 (PTRDIFF_MAX, MOST_POSITIVE_FIXNUM), e.g., when size_t is 32 bits
11994 and ptrdiff_t and EMACS_INT are both 64 bits.
c78baabf 11995
c9d624c6
PE
11996 * character.c, coding.c, doprnt.c, editfns.c, eval.c:
11997 All uses of STRING_BYTES_MAX replaced by STRING_BYTES_BOUND.
640c8776 11998 * lisp.h (STRING_BYTES_BOUND): Rename from STRING_BYTES_MAX.
c9d624c6 11999
353032ce
PE
12000 * character.c (string_escape_byte8): Fix nbytes/nchars typo.
12001
2bccce07
PE
12002 * alloc.c (Fmake_string): Check for out-of-range init.
12003
0ac30604
SM
120042011-06-15 Stefan Monnier <monnier@iro.umontreal.ca>
12005
12006 * eval.c (Fdefvaralias): Also mark the target as variable-special-p.
12007
c195f2de
JD
120082011-06-14 Jan Djärv <jan.h.d@swipnet.se>
12009
12010 * xfns.c (x_set_scroll_bar_default_width): Remove argument to
12011 xg_get_default_scrollbar_width.
12012
12013 * gtkutil.c: Include emacsgtkfixed.h if HAVE_GTK3.
12014 (int_gtk_range_get_value): Move to the scroll bar part of the file.
12015 (style_changed_cb): Call update_theme_scrollbar_width and call
12016 x_set_scroll_bar_default_width and xg_frame_set_char_size for
12017 all frames (Bug#8505).
12018 (xg_create_frame_widgets): Call emacs_fixed_new if HAVE_GTK3 (Bug#8505).
12019 Call gtk_window_set_resizable if HAVE_GTK3.
12020 (x_wm_set_size_hint): Call emacs_fixed_set_min_size with min width
12021 and height if HAVE_GTK3 (Bug#8505).
12022 (scroll_bar_width_for_theme): New variable.
12023 (update_theme_scrollbar_width): New function.
12024 (xg_get_default_scrollbar_width): Move code to
12025 update_theme_scrollbar_width, just return scroll_bar_width_for_theme.
12026 (xg_initialize): Call update_theme_scrollbar_width.
12027
12028 * gtkutil.h (xg_get_default_scrollbar_width): Remove argument.
12029
12030 * emacsgtkfixed.c, emacsgtkfixed.h: New files.
12031
e10ac9f1
MR
120322011-06-12 Martin Rudalics <rudalics@gmx.at>
12033
12034 * frame.c (make_frame): Call other_buffer_safely instead of
12035 other_buffer.
12036
12037 * window.c (temp_output_buffer_show): Call display_buffer with
12038 second argument Vtemp_buffer_show_specifiers and reset latter
12039 immediately after the call.
12040 (Vtemp_buffer_show_specifiers): New variable.
12041 (auto_window_vscroll_p, next_screen_context_lines)
12042 (Vscroll_preserve_screen_position): Remove leading asterisks from
12043 doc-strings.
12044
2d3c217e 120452011-06-12 Paul Eggert <eggert@cs.ucla.edu>
4475bec4 12046
7b7f97e8 12047 Fix minor problems found by GCC 4.6.0 static checking.
4475bec4
PE
12048 * buffer.c (Qclone_number): Remove for now, as it's unused.
12049 (record_buffer, Funrecord_buffer): Rename local to avoid shadowing.
12050 (record_buffer): Remove unused local.
12051 * frame.c (other_visible_frames, frame_buffer_list): Now static.
12052 (set_frame_buffer_list): Remove; unused.
12053 * frame.h (other_visible_frames): Remove decl.
12054 * keyboard.h (menu_items_inuse): Declare only if USE_GTK || USE_MOTIF.
12055 * lisp.h (frame_buffer_list, set_frame_buffer_list): Remove decls.
12056 (add_gpm_wait_descriptor, delete_gpm_wait_descriptor): Declare only
12057 if HAVE_GPM.
12058 * menu.c (menu_items_inuse): Now static unless USE_GTK || USE_MOTIF.
12059 * process.c (add_gpm_wait_descriptor, delete_gpm_wait_descriptor):
12060 Define only if HAVE_GPM.
12061 * widget.c (EmacsFrameResize, emacsFrameClassRec): Now static.
12062 (update_hints_inhibit): Remove; never set. All uses removed.
12063 * widgetprv.h (emacsFrameClassRec): Remove decl.
12064 * window.c (delete_deletable_window): Now returns void, since it
12065 wasn't returning anything.
12066 (compare_window_configurations): Remove unused locals.
12067 * xfns.c (x_set_scroll_bar_default_width): Remove unused locals.
12068 * xmenu.c (x_menu_set_in_use): Define only if USE_GTK || USE_MOTIF.
4475bec4
PE
12069 (dialog_selection_callback) [!USE_GTK]: Prefer intptr_t for integers
12070 the same widths as pointers. This follows up on the 2011-05-06 patch.
12071 * xterm.c (x_alloc_lighter_color_for_widget): Define only if USE_LUCID.
12072 * xterm.h: Likewise.
12073 (x_menu_set_in_use): Declare only if USE_GTK || USE_MOTIF.
12074
1384b89e
JB
120752011-06-12 Juanma Barranquero <lekktu@gmail.com>
12076
12077 * makefile.w32-in: Update dependencies.
12078 (LISP_H): Add lib/intprops.h.
12079
1100a63c
CY
120802011-06-11 Chong Yidong <cyd@stupidchicken.com>
12081
12082 * image.c (gif_load): Add animation frame delay to the metadata.
12083 (syms_of_image): Use DEFSYM. New symbol `delay'.
12084
6198ccd0
MR
120852011-06-11 Martin Rudalics <rudalics@gmx.at>
12086
12087 * window.c (delete_deletable_window): Re-add.
12088 (Fset_window_configuration): Rewrite to handle dead buffers and
12089 consequently deletable windows.
12090 (window_tree, Fwindow_tree): Remove. Supply functionality in
12091 window.el.
12092 (compare_window_configurations): Simplify code.
12093
b6e3633c
AS
120942011-06-11 Andreas Schwab <schwab@linux-m68k.org>
12095
1ab0dee5
AS
12096 * image.c (imagemagick_load_image): Fix type mismatch.
12097 (Fimagemagick_types): Likewise.
12098
b6e3633c
AS
12099 * window.h (replace_buffer_in_windows): Declare.
12100
9397e56f
MR
121012011-06-11 Martin Rudalics <rudalics@gmx.at>
12102
12103 * buffer.c: New Lisp objects Qbuffer_list_update_hook and
12104 Qclone_number. Remove external declaration of Qdelete_window.
12105 (Fbuffer_list): Rewrite doc-string. Minor restructuring of
12106 code.
640c8776
SM
12107 (Fget_buffer_create, Fmake_indirect_buffer, Frename_buffer):
12108 Run Qbuffer_list_update_hook if allowed.
9397e56f
MR
12109 (Fother_buffer): Rewrite doc-string. Major rewrite for new
12110 buffer list implementation.
12111 (other_buffer_safely): New function.
12112 (Fkill_buffer): Replace call to replace_buffer_in_all_windows by
12113 calls to replace_buffer_in_windows and
12114 replace_buffer_in_windows_safely. Run Qbuffer_list_update_hook
12115 if allowed.
12116 (record_buffer): Inhibit quitting and rewrite using quittable
12117 functions. Run Qbuffer_list_update_hook if allowed.
12118 (Frecord_buffer, Funrecord_buffer): New functions.
640c8776
SM
12119 (switch_to_buffer_1, Fswitch_to_buffer): Remove.
12120 Move switch-to-buffer to window.el.
9397e56f
MR
12121 (bury-buffer): Move to window.el.
12122 (Vbuffer_list_update_hook): New variable.
12123
12124 * lisp.h (other_buffer_safely): Add prototype in buffer.c
12125 section.
12126
12127 * window.h (resize_frame_windows): Move up in code.
12128 (Fwindow_frame): Remove EXFUN.
12129 (replace_buffer_in_all_windows): Remove prototype.
12130 (replace_buffer_in_windows_safely): Add prototype.
12131
12132 * window.c: Declare Qdelete_window static again. Move down
12133 declaration of select_count.
12134 (Fnext_window, Fprevious_window): Rewrite doc-strings.
12135 (Fother_window): Move to window.el.
12136 (window_loop): Remove DELETE_BUFFER_WINDOWS and UNSHOW_BUFFER
12137 cases. Add REPLACE_BUFFER_IN_WINDOWS_SAFELY case.
12138 (Fdelete_windows_on, Freplace_buffer_in_windows): Move to
12139 window.el.
12140 (replace_buffer_in_windows): Implement by calling
12141 Qreplace_buffer_in_windows.
12142 (replace_buffer_in_all_windows): Remove with some functionality
12143 moved into replace_buffer_in_windows_safely.
12144 (replace_buffer_in_windows_safely): New function.
12145 (select_window_norecord, select_frame_norecord): Move in front
12146 of run_window_configuration_change_hook. Remove now obsolete
12147 declarations.
640c8776
SM
12148 (Fset_window_buffer): Rewrite doc-string.
12149 Call Qrecord_window_buffer.
9397e56f
MR
12150 (keys_of_window): Move binding for other-window to window.el.
12151
b50691aa
CY
121522011-06-11 Chong Yidong <cyd@stupidchicken.com>
12153
12154 * dispextern.h (struct image): Replace data member, whose int_val
12155 and ptr_val fields were not used by anything, with a single
12156 lisp_val object.
12157
12158 * image.c (Fimage_metadata, make_image, mark_image, tiff_load)
12159 (gif_clear_image, gif_load, imagemagick_load_image)
12160 (gs_clear_image, gs_load): Callers changed.
12161
3f754b86
PE
121622011-06-10 Paul Eggert <eggert@cs.ucla.edu>
12163
cca69397
PE
12164 * buffer.h: Include <time.h>, for time_t.
12165 Needed to build on FreeBSD 8.2. Problem reported by Herbert J. Skuhra.
12166
109e28d0
PE
12167 Fix minor problems found by static checking.
12168
60737f02
PE
12169 * image.c (PixelGetMagickColor): Declare if ImageMagick headers don't.
12170
4b66faf3
PE
12171 Make identifiers static if they are not used in other modules.
12172 * data.c (Qcompiled_function, Qframe, Qvector):
12173 * image.c (QimageMagick, Qsvg):
12174 * minibuf.c (Qmetadata):
12175 * window.c (resize_window_check, resize_root_window): Now static.
12176 * window.h (resize_window_check, resize_root_window): Remove decls.
12177
109e28d0
PE
12178 * window.c (window_deletion_count, delete_deletable_window):
12179 Remove; unused.
46a4ce9e
PE
12180 (window_body_lines): Now static.
12181 (Fdelete_other_windows_internal): Mark vars as initialized.
12182 Make sure 'resize_failed' is initialized.
12183 (run_window_configuration_change_hook): Rename local to avoid shadowing.
12184 (resize_window_apply): Remove unused local.
12185 * window.h (delete_deletable_window): Remove decl.
12186
109e28d0 12187 * image.c (gif_load, svg_load_image): Rename locals to avoid shadowing.
33290528
PE
12188 (imagemagick_load_image): Fix pointer signedness problem by changing
12189 last arg from unsigned char * to char *. All uses changed.
12190 Also, fix a local for similar reasons.
12191 Remove unused locals. Remove locals to avoid shadowing.
12192 (fn_rsvg_handle_free): Remove; unused.
12193 (svg_load, svg_load_image): Fix pointer signedness problem.
f7e13da3 12194 (imagemagick_load_image): Don't use garbage pointer image_wand.
33290528 12195
3f754b86
PE
12196 * ftfont.c (ftfont_get_metrics, ftfont_drive_otf): Remove unused locals.
12197
2547adb1
CY
121982011-06-10 Chong Yidong <cyd@stupidchicken.com>
12199
12200 * image.c (gif_load): Fix omitted cast error introduced by
12201 2011-06-06 change.
12202
2c8e37d4
MR
122032011-06-10 Martin Rudalics <rudalics@gmx.at>
12204
12205 * window.h (resize_proportionally, orig_total_lines)
12206 (orig_top_line): Remove from window structure.
12207 (set_window_height, set_window_width, change_window_heights)
12208 (Fdelete_window): Remove prototypes.
12209 (resize_frame_windows): Remove duplicate declaration.
12210
440a42e3
EZ
122112011-06-10 Eli Zaretskii <eliz@gnu.org>
12212
12213 * window.h (resize_frame_windows, resize_window_check)
12214 (delete_deletable_window, resize_root_window)
12215 (resize_frame_windows): Declare prototypes.
12216
12217 * window.c (resize_window_apply): Make definition be "static" to
12218 match the prototype.
12219
562dd5e9
MR
122202011-06-10 Martin Rudalics <rudalics@gmx.at>
12221
12222 * window.c: Remove declarations of Qwindow_size_fixed,
12223 window_min_size_1, window_min_size_2, window_min_size,
12224 size_window, window_fixed_size_p, enlarge_window, delete_window.
12225 Remove static from declaration of Qdelete_window, it's
12226 temporarily needed by Fbury_buffer.
12227 (replace_window): Don't assign orig_top_line and
12228 orig_total_lines.
12229 (Fdelete_window, delete_window): Remove. Window deletion is
12230 handled by window.el.
640c8776
SM
12231 (window_loop): Remove DELETE_OTHER_WINDOWS case.
12232 Replace Fdelete_window calls with calls to Qdelete_window.
562dd5e9
MR
12233 (Fdelete_other_windows): Remove. Deleting other windows is
12234 handled by window.el.
12235 (window_fixed_size_p): Remove. Fixed-sizeness of windows is
12236 handled in window.el.
12237 (window_min_size_2, window_min_size_1, window_min_size): Remove.
12238 Window minimum sizes are handled in window.el.
12239 (shrink_windows, size_window, set_window_height)
12240 (set_window_width, change_window_heights, window_height)
12241 (window_width, CURBEG, CURSIZE, enlarge_window)
12242 (adjust_window_trailing_edge, Fadjust_window_trailing_edge)
12243 (Fenlarge_window, Fshrink_window): Remove. Window resizing is
12244 handled in window.el.
12245 (make_dummy_parent): Rename to make_parent_window and give it a
12246 second argument horflag.
12247 (make_window): Don't set resize_proportionally any more.
12248 (Fsplit_window): Remove. Windows are split in window.el.
12249 (save_restore_action, save_restore_orig_size)
12250 (shrink_window_lowest_first, save_restore_orig_size): Remove.
12251 Resize mini windows in window.el.
12252 (grow_mini_window, shrink_mini_window): Implement by calling
12253 Qresize_root_window_vertically, resize_window_check and
12254 resize_window_apply.
640c8776
SM
12255 (saved_window, Fset_window_configuration, save_window_save):
12256 Do not handle orig_top_line, orig_total_lines, and
562dd5e9
MR
12257 resize_proportionally.
12258 (window_min_height, window_min_width): Move to window.el.
12259 (keys_of_window): Move bindings for delete-other-windows,
12260 split-window, delete-window and enlarge-window to window.el.
12261
12262 * buffer.c: Temporarily extern Qdelete_window.
12263 (Fbury_buffer): Temporarily call Qdelete_window instead of
12264 Fdelete_window (Fbury_buffer will move to window.el soon).
12265
12266 * frame.c (set_menu_bar_lines_1): Remove code handling
12267 orig_top_line and orig_total_lines.
12268
12269 * dispnew.c (adjust_frame_glyphs_initially): Don't use
12270 set_window_height but set heights directly.
12271 (change_frame_size_1): Use resize_frame_windows.
12272
12273 * xdisp.c (init_xdisp): Don't use set_window_height but set
12274 heights directly.
12275
640c8776
SM
12276 * xfns.c (x_set_menu_bar_lines, x_set_tool_bar_lines):
12277 Use resize_frame_windows instead of change_window_heights and run
562dd5e9
MR
12278 run_window_configuration_change_hook.
12279
12280 * w32fns.c (x_set_tool_bar_lines): Use resize_frame_windows
12281 instead of change_window_heights and run
12282 run_window_configuration_change_hook.
12283
1a13852e
MR
122842011-06-09 Martin Rudalics <rudalics@gmx.at>
12285
12286 * window.c (replace_window): Rename second argument REPLACEMENT to
12287 NEW. New third argument SETFLAG. Rewrite.
12288 (delete_window, make_dummy_parent): Call replace_window with
12289 third argument 1.
12290 (window_list_1): Move down in code.
12291 (run_window_configuration_change_hook): Move set_buffer part
12292 before select_frame_norecord part in order to unwind correctly.
12293 Rename count1 to count.
12294 (recombine_windows, delete_deletable_window, resize_root_window)
12295 (Fdelete_other_windows_internal)
12296 (Frun_window_configuration_change_hook, make_parent_window)
12297 (resize_window_check, resize_window_apply, Fresize_window_apply)
12298 (resize_frame_windows, Fsplit_window_internal)
640c8776
SM
12299 (Fdelete_window_internal, Fresize_mini_window_internal):
12300 New functions.
1a13852e
MR
12301 (syms_of_window): New variables Vwindow_splits and Vwindow_nest.
12302
f3d1777e
MR
123032011-06-08 Martin Rudalics <rudalics@gmx.at>
12304
496e208e
MR
12305 * window.h (window): Add some new members to window structure -
12306 normal_lines, normal_cols, new_total, new_normal, clone_number,
12307 splits, nest, prev_buffers, next_buffers.
12308 (WINDOW_TOTAL_SIZE): Move here from window.c.
b9e809c2 12309 (MIN_SAFE_WINDOW_WIDTH, MIN_SAFE_WINDOW_HEIGHT): Define here.
496e208e 12310
f3d1777e
MR
12311 * window.c (Fwindow_height, Fwindow_width, Fwindow_full_width_p):
12312 Remove.
496e208e
MR
12313 (make_dummy_parent): Set new members of windows structure.
12314 (make_window): Move down in code. Handle new members of window
12315 structure.
12316 (Fwindow_clone_number, Fwindow_splits, Fset_window_splits)
12317 (Fwindow_nest, Fset_window_nest, Fwindow_new_total)
12318 (Fwindow_normal_size, Fwindow_new_normal, Fwindow_prev_buffers)
12319 (Fset_window_prev_buffers, Fwindow_next_buffers)
640c8776
SM
12320 (Fset_window_next_buffers, Fset_window_clone_number):
12321 New functions.
496e208e
MR
12322 (Fwindow_hscroll, Fwindow_at, Fwindow_point, Fwindow_start)
12323 (Fwindow_end, Fwindow_line_height, Fset_window_dedicated_p):
12324 Doc-string fixes.
12325 (Fwindow_parameters, Fwindow_parameter, Fset_window_parameter):
12326 Argument WINDOW can be now internal window too.
12327 (Fwindow_use_time): Move up in code.
12328 (Fget_buffer_window): Rename argument FRAME to ALL-FRAMES.
12329 Rewrite doc-string.
12330 (Fset_window_configuration, saved_window)
12331 (Fcurrent_window_configuration, save_window_save): Handle new
12332 members of window structure.
b9e809c2
MR
12333 (WINDOW_TOTAL_SIZE, MIN_SAFE_WINDOW_WIDTH)
12334 (MIN_SAFE_WINDOW_HEIGHT): Move to window.h.
12335 (syms_of_window): New Lisp objects Qrecord_window_buffer,
12336 Qwindow_deletable_p, Qdelete_window, Qreplace_buffer_in_windows,
12337 Qget_mru_window, Qresize_root_window,
12338 Qresize_root_window_vertically, Qsafe, Qabove, Qbelow,
12339 Qauto_buffer_name; staticpro them.
f3d1777e 12340
abde8f8c
MR
123412011-06-07 Martin Rudalics <rudalics@gmx.at>
12342
12343 * window.c (Fwindow_total_size, Fwindow_left_column)
12344 (Fwindow_top_line, window_body_lines, Fwindow_body_size)
12345 (Fwindow_list_1): New functions.
12346 (window_box_text_cols): Replace with window_body_cols.
640c8776
SM
12347 (Fwindow_width, Fscroll_left, Fscroll_right):
12348 Use window_body_cols instead of window_box_text_cols.
12349 (delete_window, Fset_window_configuration):
12350 Call delete_all_subwindows with window as argument.
fa8a67e6
MR
12351 (delete_all_subwindows): Take a window as argument and not a
12352 structure. Rewrite.
190b47e6
MR
12353 (window_loop): Remove handling of GET_LRU_WINDOW and
12354 GET_LARGEST_WINDOW.
12355 (Fget_lru_window, Fget_largest_window): Move to window.el.
abde8f8c
MR
12356
12357 * window.h: Extern window_body_cols instead of
fa8a67e6
MR
12358 window_box_text_cols. delete_all_subwindows now takes a
12359 Lisp_Object as argument.
abde8f8c 12360
640c8776
SM
12361 * indent.c (compute_motion, Fcompute_motion):
12362 Use window_body_cols instead of window_box_text_cols.
abde8f8c 12363
fa8a67e6
MR
12364 * frame.c (delete_frame): Call delete_all_subwindows with root
12365 window as argument.
12366
a54e3482
DC
123672011-06-07 Daniel Colascione <dan.colascione@gmail.com>
12368
12369 * fns.c (Fputhash): Document return value.
12370
60002bf5
CY
123712011-06-06 Chong Yidong <cyd@stupidchicken.com>
12372
12373 * image.c (gif_load): Implement gif89a spec "no disposal" method.
12374
0c671da6 123752011-06-06 Paul Eggert <eggert@cs.ucla.edu>
ccd9a01a 12376
b862a52a 12377 Cons<->int and similar integer overflow fixes (Bug#8794).
77984278 12378
be44ca6c
PE
12379 Check for overflow when converting integer to cons and back.
12380 * charset.c (Fdefine_charset_internal, Fdecode_char):
12381 Use cons_to_unsigned to catch overflow.
12382 (Fencode_char): Use INTEGER_TO_CONS.
12383 * composite.h (LGLYPH_CODE): Use cons_to_unsigned.
12384 (LGLYPH_SET_CODE): Use INTEGER_TO_CONS.
12385 * data.c (long_to_cons, cons_to_long): Remove.
12386 (cons_to_unsigned, cons_to_signed): New functions.
12387 These signal an error for invalid or out-of-range values.
12388 * dired.c (Ffile_attributes): Use INTEGER_TO_CONS.
12389 * fileio.c (Fset_visited_file_modtime): Use CONS_TO_INTEGER.
12390 * font.c (Ffont_variation_glyphs):
12391 * fontset.c (Finternal_char_font): Use INTEGER_TO_CONS.
12392 * lisp.h: Include <intprops.h>.
12393 (INTEGER_TO_CONS, CONS_TO_INTEGER): New macros.
12394 (cons_to_signed, cons_to_unsigned): New decls.
12395 (long_to_cons, cons_to_long): Remove decls.
12396 * undo.c (record_first_change): Use INTEGER_TO_CONS.
12397 (Fprimitive_undo): Use CONS_TO_INTEGER.
12398 * xfns.c (Fx_window_property): Likewise.
12399 * xselect.c: Include <limits.h>.
12400 (x_own_selection, selection_data_to_lisp_data):
12401 Use INTEGER_TO_CONS.
12402 (x_handle_selection_request, x_handle_selection_clear)
12403 (x_get_foreign_selection, Fx_disown_selection_internal)
12404 (Fx_get_atom_name, x_send_client_event): Use CONS_TO_INTEGER.
12405 (lisp_data_to_selection_data): Use cons_to_unsigned.
12406 (x_fill_property_data): Use cons_to_signed.
12407 Report values out of range.
12408
d1f3d2af
PE
12409 Check for buffer and string overflow more precisely.
12410 * buffer.h (BUF_BYTES_MAX): New macro.
12411 * lisp.h (STRING_BYTES_MAX): New macro.
12412 * alloc.c (Fmake_string):
12413 * character.c (string_escape_byte8):
12414 * coding.c (coding_alloc_by_realloc):
12415 * doprnt.c (doprnt):
12416 * editfns.c (Fformat):
12417 * eval.c (verror):
12418 Use STRING_BYTES_MAX, not MOST_POSITIVE_FIXNUM,
12419 since they may not be the same number.
12420 * editfns.c (Finsert_char):
12421 * fileio.c (Finsert_file_contents):
12422 Likewise for BUF_BYTES_MAX.
12423
dd52fcea
PE
12424 * image.c: Use ptrdiff_t, not int, for sizes.
12425 (slurp_file): Switch from int to ptrdiff_t.
12426 All uses changed.
12427 (slurp_file): Check that file size fits in both size_t (for
12428 malloc) and ptrdiff_t (for sanity and safety).
12429
7f9bbdbb
PE
12430 * fileio.c (Fverify_visited_file_modtime): Avoid time overflow
12431 if b->modtime has its maximal value.
12432
dfe18f82
PE
12433 * dired.c (Ffile_attributes): Don't assume EMACS_INT has >32 bits.
12434
84acfcf0
PE
12435 Don't assume time_t can fit into int.
12436 * buffer.h (struct buffer.modtime): Now time_t, not int.
12437 * fileio.c (Fvisited_file_modtime): No need for time_t cast now.
12438 * undo.c (Fprimitive_undo): Use time_t, not int, for time_t value.
12439
ccd9a01a
PE
12440 Minor fixes for signed vs unsigned integers.
12441 * character.h (MAYBE_UNIFY_CHAR):
12442 * charset.c (maybe_unify_char):
12443 * keyboard.c (read_char, reorder_modifiers):
12444 XINT -> XFASTINT, since the integer must be nonnegative.
12445 * ftfont.c (ftfont_spec_pattern):
12446 * keymap.c (access_keymap, silly_event_symbol_error):
12447 XUINT -> XFASTINT, since the integer must be nonnegative.
12448 (Fsingle_key_description, preferred_sequence_p): XUINT -> XINT,
12449 since it makes no difference and we prefer signed.
12450 * keyboard.c (record_char): Use XUINT when all the neighbors do.
12451 (access_keymap): NATNUMP -> INTEGERP, since the integer must be
12452 nonnegative.
12453
d6d100dd
SM
124542011-06-06 Stefan Monnier <monnier@iro.umontreal.ca>
12455
12456 * window.h (Fwindow_frame): Declare.
12457
2b6148e4
PE
124582011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12459
12460 * alloc.c: Simplify handling of large-request failures (Bug#8800).
12461 (SPARE_MEMORY): Always define.
12462 (LARGE_REQUEST): Remove.
12463 (memory_full): Use SPARE_MEMORY rather than LARGE_REQUEST.
12464
f230ecc9
MR
124652011-06-06 Martin Rudalics <rudalics@gmx.at>
12466
727e958e
MR
12467 * lisp.h: Move EXFUNS for Fframe_root_window,
12468 Fframe_first_window and Fset_frame_selected_window to window.h.
12469
12470 * window.h: Move EXFUNS for Fframe_root_window,
12471 Fframe_first_window and Fset_frame_selected_window here from
12472 lisp.h.
12473
12474 * frame.c (Fwindow_frame, Fframe_first_window)
12475 (Fframe_root_window, Fframe_selected_window)
12476 (Fset_frame_selected_window): Move to window.c.
12477 (Factive_minibuffer_window): Move to minibuf.c.
12478 (Fother_visible_frames_p): New function.
12479
12480 * minibuf.c (Factive_minibuffer_window): Move here from frame.c.
12481
f230ecc9
MR
12482 * window.c (decode_window, decode_any_window): Move up in code.
12483 (Fwindowp, Fwindow_live_p): Rewrite doc-strings.
12484 (inhibit_frame_unsplittable): Remove unused variable.
bf60a96b
MR
12485 (Fwindow_buffer): Move up and rewrite doc-string.
12486 (Fwindow_parent, Fwindow_vchild, Fwindow_hchild, Fwindow_next)
12487 (Fwindow_prev): New functions.
727e958e
MR
12488 (Fwindow_frame): Move here from frame.c. Accept any window as
12489 argument.
12490 (Fframe_root_window, Fframe_first_window)
12491 (Fframe_selected_window): Move here from frame.c. Accept frame
12492 or arbitrary window as argument. Update doc-strings.
12493 (Fminibuffer_window): Move up in code.
12494 (Fwindow_minibuffer_p): Move up in code and simplify.
d6d100dd
SM
12495 (Fset_frame_selected_window): Move here from frame.c.
12496 Marginal rewrite.
727e958e
MR
12497 (Fselected_window, select_window, Fselect_window): Move up in
12498 code. Minor doc-string fixes.
f230ecc9 12499
4d09bcf6
PE
125002011-06-06 Paul Eggert <eggert@cs.ucla.edu>
12501
12502 * alloc.c (memory_full) [SYSTEM_MALLOC]: Port to MacOS (Bug#8800).
12503 Do not assume that spare memory exists; that assumption is valid
12504 only if SYSTEM_MALLOC.
12505 (LARGE_REQUEST): New macro, so that the issue of large requests
12506 is separated from the issue of spare memory.
12507
810928a2
AS
125082011-06-05 Andreas Schwab <schwab@linux-m68k.org>
12509
172418ad
AS
12510 * editfns.c (Fformat): Correctly handle zero flag with hexadecimal
12511 format. (Bug#8806)
12512
43f862f7
AS
12513 * gtkutil.c (xg_get_default_scrollbar_width): Avoid warning.
12514
810928a2
AS
12515 * xfns.c (x_set_scroll_bar_default_width): Move declarations
12516 before statements.
12517
a059fe24
JD
125182011-06-05 Jan Djärv <jan.h.d@swipnet.se>
12519
12520 * gtkutil.c (xg_get_default_scrollbar_width): New function.
12521
12522 * gtkutil.h: Declare xg_get_default_scrollbar_width.
12523
12524 * xfns.c (x_set_scroll_bar_default_width): If USE_GTK, get
12525 min width by calling x_set_scroll_bar_default_width (Bug#8505).
12526
989bf368
JB
125272011-06-05 Juanma Barranquero <lekktu@gmail.com>
12528
12529 * xdisp.c (single_display_spec_intangible_p): Remove declaration.
12530
4b80f674
CY
125312011-06-04 Chong Yidong <cyd@stupidchicken.com>
12532
12533 * xselect.c (x_clipboard_manager_save): Remove redundant arg.
12534 (x_clipboard_manager_save): Add return value.
d6d100dd
SM
12535 (x_clipboard_manager_error_1, x_clipboard_manager_error_2):
12536 New error handlers.
4b80f674
CY
12537 (x_clipboard_manager_save_frame, x_clipboard_manager_save_all):
12538 Obey Vx_select_enable_clipboard_manager. Catch errors in
12539 x_clipboard_manager_save (Bug#8779).
12540 (Vx_select_enable_clipboard_manager): New variable.
de65b42c 12541 (x_get_foreign_selection): Reduce scope of x_catch_errors (Bug#8790).
4b80f674 12542
99a33b77 125432011-06-04 Dan Nicolaescu <dann@ics.uci.edu>
8b3115e7
DN
12544
12545 * emacs.c (main): Warn when starting a GTK emacs in daemon mode.
12546
99a33b77 125472011-06-04 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
14eca62f
YM
12548
12549 * fringe.c (update_window_fringes): Don't update overlay arrow bitmap
12550 in the current matrix if keep_current_p is non-zero.
12551
8264569d
EZ
125522011-06-04 Eli Zaretskii <eliz@gnu.org>
12553
12554 * bidi.c (bidi_level_of_next_char): Fix last change.
12555
57f97249
EZ
125562011-06-03 Eli Zaretskii <eliz@gnu.org>
12557
fec2107c 12558 Support bidi reordering of text covered by display properties.
57f97249 12559
fec2107c
EZ
12560 * bidi.c (bidi_copy_it): Use offsetof instead of emulating it.
12561 (bidi_fetch_char, bidi_fetch_char_advance): New functions.
12562 (bidi_cache_search, bidi_cache_iterator_state)
12563 (bidi_paragraph_init, bidi_resolve_explicit, bidi_resolve_weak)
d6d100dd
SM
12564 (bidi_level_of_next_char, bidi_move_to_visually_next):
12565 Support character positions inside a run of characters covered by a
fec2107c
EZ
12566 display string.
12567 (bidi_paragraph_init, bidi_resolve_explicit_1)
12568 (bidi_level_of_next_char): Call bidi_fetch_char and
12569 bidi_fetch_char_advance instead of FETCH_CHAR and
12570 FETCH_CHAR_ADVANCE.
12571 (bidi_init_it): Initialize new members.
12572 (LRE_CHAR, RLE_CHAR, PDF_CHAR, LRO_CHAR, RLO_CHAR): Remove macro
12573 definitions.
12574 (bidi_explicit_dir_char): Lookup character type in bidi_type_table,
12575 instead of using explicit *_CHAR codes.
d6d100dd
SM
12576 (bidi_resolve_explicit, bidi_resolve_weak):
12577 Use FETCH_MULTIBYTE_CHAR instead of FETCH_CHAR, as reordering of
fec2107c
EZ
12578 bidirectional text is supported only in multibyte buffers.
12579 (bidi_init_it): Accept additional argument FRAME_WINDOW_P and use
12580 it to initialize the frame_window_p member of struct bidi_it.
12581 (bidi_cache_iterator_state, bidi_resolve_explicit_1)
12582 (bidi_resolve_explicit, bidi_resolve_weak)
12583 (bidi_level_of_next_char, bidi_move_to_visually_next): Abort if
12584 bidi_it->nchars is non-positive.
12585 (bidi_level_of_next_char): Don't try to lookup the cache for the
12586 next/previous character if nothing is cached there yet, or if we
12587 were just reseat()'ed to a new position.
c40e2fb2 12588
0e14fe90
EZ
12589 * xdisp.c (set_cursor_from_row): Set start and stop points
12590 according to the row's direction when priming the loop that looks
12591 for the glyph on which to display cursor.
12592 (single_display_spec_intangible_p): Function deleted.
12593 (display_prop_intangible_p): Reimplement to call
12594 handle_display_spec instead of single_display_spec_intangible_p.
d6d100dd
SM
12595 Accept 3 additional arguments needed by handle_display_spec.
12596 This fixes incorrect cursor motion across display property with complex
0e14fe90
EZ
12597 values: lists, `(when COND...)' forms, etc.
12598 (single_display_spec_string_p): Support property values that are
12599 lists with the argument STRING its top-level element.
12600 (display_prop_string_p): Fix the condition for processing a
12601 property that is a list to be consistent with handle_display_spec.
fec2107c 12602 (handle_display_spec): New function, refactored from the
fc6f18ce
EZ
12603 last portion of handle_display_prop.
12604 (compute_display_string_pos): Accept additional argument
12605 FRAME_WINDOW_P. Call handle_display_spec to determine whether the
12606 value of a `display' property is a "replacing spec".
12607 (handle_single_display_spec): Accept 2 additional arguments BUFPOS
12608 and FRAME_WINDOW_P. If IT is NULL, don't set up the iterator from
12609 the display property, but just return a value indicating whether
12610 the display property will replace the characters it covers.
12611 (Fcurrent_bidi_paragraph_direction): Initialize the nchars and
12612 frame_window_p members of struct bidi_it.
d6d100dd
SM
12613 (compute_display_string_pos, compute_display_string_end):
12614 New functions.
fec2107c
EZ
12615 (push_it): Accept second argument POSITION, where pop_it should
12616 jump to continue iteration.
12617 (reseat_1): Initialize bidi_it.disp_pos.
fc6f18ce 12618
fec2107c
EZ
12619 * keyboard.c (adjust_point_for_property): Adjust the call to
12620 display_prop_intangible_p to its new signature.
fc6f18ce
EZ
12621
12622 * dispextern.h (struct bidi_it): New member frame_window_p.
fec2107c
EZ
12623 (bidi_init_it): Update prototypes.
12624 (display_prop_intangible_p): Update prototype.
d6d100dd
SM
12625 (compute_display_string_pos, compute_display_string_end):
12626 Declare prototypes.
fec2107c
EZ
12627 (struct bidi_it): New members nchars and disp_pos. ch_len is now
12628 EMACS_INT.
fc6f18ce 12629
40087514 126302011-06-02 Paul Eggert <eggert@cs.ucla.edu>
0de4bb68 12631
57f53182
PE
12632 Malloc failure behavior now depends on size of allocation.
12633 * alloc.c (buffer_memory_full, memory_full): New arg NBYTES.
12634 * lisp.h: Change signatures accordingly.
12635 * alloc.c, buffer.c, editfns.c, menu.c, minibuf.c, xterm.c:
12636 All callers changed. (Bug#8762)
12637
12638 * gnutls.c: Use Emacs's memory allocators.
12639 Without this change, the gnutls library would invoke malloc etc.
12640 directly, which causes problems on non-SYNC_INPUT hosts, and which
12641 runs afoul of improving memory_full behavior. (Bug#8761)
12642 (fn_gnutls_global_set_mem_functions): New macro or function pointer.
12643 (emacs_gnutls_global_init): Use it to specify xmalloc, xrealloc,
12644 xfree instead of the default malloc, realloc, free.
12645 (Fgnutls_boot): No need to check for memory allocation failure,
12646 since xmalloc does that for us.
12647
ac32cd99 12648 Remove arbitrary limit of 2**31 entries in hash tables. (Bug#8771)
3870d916
PE
12649 * category.c (hash_get_category_set):
12650 * ccl.c (ccl_driver):
12651 * charset.c (Fdefine_charset_internal):
12652 * charset.h (struct charset.hash_index):
12653 * composite.c (get_composition_id, gstring_lookup_cache)
12654 (composition_gstring_put_cache):
12655 * composite.h (struct composition.hash_index):
12656 * dispextern.h (struct image.hash):
12657 * fns.c (next_almost_prime, larger_vector, cmpfn_eql)
12658 (cmpfn_equal, cmpfn_user_defined, hashfn_eq, hashfn_eql)
12659 (hashfn_equal, hashfn_user_defined, make_hash_table)
12660 (maybe_resize_hash_table, hash_lookup, hash_put)
12661 (hash_remove_from_table, hash_clear, sweep_weak_table, SXHASH_COMBINE)
12662 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector)
12663 (Fsxhash, Fgethash, Fputhash, Fmaphash):
12664 * image.c (make_image, search_image_cache, lookup_image)
12665 (xpm_put_color_table_h):
12666 * lisp.h (struct Lisp_Hash_Table):
0de4bb68 12667 * minibuf.c (Ftry_completion, Fall_completions, Ftest_completion):
ac389d0c 12668 * print.c (print): Use 'EMACS_UINT' and 'EMACS_INT'
3870d916 12669 for hashes and hash indexes, instead of 'unsigned' and 'int'.
40087514
PE
12670 * alloc.c (allocate_vectorlike):
12671 Check for overflow in vector size calculations.
12672 * ccl.c (ccl_driver):
12673 Check for overflow when converting EMACS_INT to int.
0de4bb68
PE
12674 * fns.c, image.c: Remove unnecessary static decls that would otherwise
12675 need to be updated by these changes.
40087514
PE
12676 * fns.c (make_hash_table, maybe_resize_hash_table):
12677 Check for integer overflow with large hash tables.
0de4bb68
PE
12678 (make_hash_table, maybe_resize_hash_table, Fmake_hash_table):
12679 Prefer the faster XFLOAT_DATA to XFLOATINT where either will do.
12680 (SXHASH_REDUCE): New macro.
12681 (sxhash_string, sxhash_list, sxhash_vector, sxhash_bool_vector):
12682 Use it instead of discarding useful hash info with large hash values.
12683 (sxhash_float): New function.
12684 (sxhash): Use it. No more need for "& INTMASK" due to above changes.
12685 * lisp.h (FIXNUM_BITS): New macro, useful for SXHASH_REDUCE etc.
40087514
PE
12686 (MOST_NEGATIVE_FIXNUM, MOST_POSITIVE_FIXNUM, INTMASK):
12687 Rewrite to use FIXNUM_BITS, as this simplifies things.
0de4bb68
PE
12688 (next_almost_prime, larger_vector, sxhash, hash_lookup, hash_put):
12689 Adjust signatures to match updated version of code.
12690 (consing_since_gc): Now EMACS_INT, since a single hash table can
12691 use more than INT_MAX bytes.
12692
698d32e2
DN
126932011-06-01 Dan Nicolaescu <dann@ics.uci.edu>
12694
12695 Make it possible to build with GCC-4.6+ -O2 -flto.
12696
12697 * emacs.c (__malloc_initialize_hook): Mark as EXTERNALLY_VISIBLE.
12698
fd6fa53f
SM
126992011-06-01 Stefan Monnier <monnier@iro.umontreal.ca>
12700
12701 * minibuf.c (get_minibuffer, read_minibuf_unwind):
12702 Call minibuffer-inactive-mode.
12703
864db017
JB
127042011-05-31 Juanma Barranquero <lekktu@gmail.com>
12705
12706 * makefile.w32-in ($(BLD)/data.$(O), $(BLD)/editfns.$(O)):
12707 Update dependencies.
12708
2ad0baf4
DN
127092011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12710
12711 * data.c (init_data): Remove code for UTS, this system is not
12712 supported anymore.
12713
4fcc2638
DN
127142011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12715
12716 Don't force ./temacs to start in terminal mode.
12717
12718 * frame.c (make_initial_frame): Initialize faces in all cases, not
12719 only when CANNOT_DUMP is defined.
12720 * dispnew.c (init_display): Remove CANNOT_DUMP condition.
12721
c56e0fd5
DN
127222011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12723
12724 * dispnew.c (add_window_display_history): Use const for the string
12725 pointer. Remove declaration, not needed.
12726
333d54da 127272011-05-31 Paul Eggert <eggert@cs.ucla.edu>
9cf9f756 12728
55d4c1b2 12729 Use 'inline', not 'INLINE'.
333d54da 12730 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00914.html>
55d4c1b2
PE
12731 * alloc.c, fontset.c (INLINE): Remove.
12732 * alloc.c, bidi.c, charset.c, coding.c, dispnew.c, fns.c, image.c:
12733 * intervals.c, keyboard.c, process.c, syntax.c, textprop.c, w32term.c:
12734 * xdisp.c, xfaces.c, xterm.c: Replace all uses of INLINE with inline.
12735 * gmalloc.c (register_heapinfo): Use inline unconditionally.
12736 * lisp.h (LISP_MAKE_RVALUE): Use inline, not __inline__.
12737
738db178
DN
127382011-05-31 Dan Nicolaescu <dann@ics.uci.edu>
12739
12740 Make it possible to run ./temacs.
12741
12742 * callproc.c (set_initial_environment): Remove CANNOT_DUMP code,
12743 syms_of_callproc does the same thing. Remove test for
12744 "initialized", do it in the caller.
12745 * emacs.c (main): Avoid calling set_initial_environment when dumping.
12746
620c53a6
SM
127472011-05-31 Stefan Monnier <monnier@iro.umontreal.ca>
12748
12749 * minibuf.c (Finternal_complete_buffer): Return `category' metadata.
12750 (read_minibuf): Use get_minibuffer.
12751 (syms_of_minibuf): Use DEFSYM.
12752 (Qmetadata): New var.
12753 * data.c (Qbuffer): Don't make it static.
12754 (syms_of_data): Use DEFSYM.
12755
e003a292
PE
127562011-05-31 Paul Eggert <eggert@cs.ucla.edu>
12757
12758 * ccl.c (CCL_CODE_RANGE): Allow negative numbers. (Bug#8751)
12759 (CCL_CODE_MIN): New macro.
12760
ed008a6d
PE
127612011-05-30 Paul Eggert <eggert@cs.ucla.edu>
12762
3687c2ef
PE
12763 * alloc.c (lisp_align_malloc): Omit unnecessary val==NULL tests.
12764
ed008a6d
PE
12765 * eval.c (Qdebug): Now static.
12766 * lisp.h (Qdebug): Remove decl. This reverts a part of the
12767 2011-04-26T11:26:05Z!dan.colascione@gmail.com that inadvertently undid part of
12768 2011-04-14T06:48:41Z!eggert@cs.ucla.edu.
12769
d66c4c7c
CY
127702011-05-29 Chong Yidong <cyd@stupidchicken.com>
12771
12772 * image.c: Various fixes to ImageMagick code comments.
12773 (Fimagemagick_types): Doc fix.
12774
5fbc2025
PE
127752011-05-29 Paul Eggert <eggert@cs.ucla.edu>
12776
0196f88a
PE
12777 Minor fixes prompted by GCC 4.6.0 warnings.
12778
12779 * xselect.c (converted_selections, conversion_fail_tag): Now static.
12780
5fbc2025
PE
12781 * emacs.c [HAVE_X_WINDOWS]: Include "xterm.h".
12782 (x_clipboard_manager_save_all): Move extern decl to ...
12783 * xterm.h: ... here, so that it can be checked for consistency.
12784
1dd3c2d9
CY
127852011-05-29 Chong Yidong <cyd@stupidchicken.com>
12786
12787 * xselect.c (x_clipboard_manager_save_frame)
12788 (x_clipboard_manager_save_all): New functions.
12789 (Fx_clipboard_manager_save): Lisp function deleted.
12790
12791 * emacs.c (Fkill_emacs): Call x_clipboard_manager_save_all.
12792 * frame.c (delete_frame): Call x_clipboard_manager_save_frame.
12793
12794 * xterm.h: Update prototype.
12795
5ba6571d
WX
127962011-05-28 William Xu <william.xwl@gmail.com>
12797
12798 * nsterm.m (ns_term_shutdown): Synchronize user defaults before
12799 exiting (Bug#8239).
12800
3eaff834
JM
128012011-05-28 Jim Meyering <meyering@redhat.com>
12802
e1900994 12803 Avoid a sign-extension bug in crypto_hash_function.
3eaff834
JM
12804 * fns.c (to_uchar): Define.
12805 (crypto_hash_function): Use it to convert some newly-signed
12806 variables to unsigned, to avoid sign-extension bugs. For example,
12807 without this change, (md5 "truc") would evaluate to
12808 45723a2aff78ff4fff7fff1114760e62 rather than the expected
12809 45723a2af3788c4ff17f8d1114760e62. Reported by Antoine Levitt in
e1900994 12810 https://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00883.html.
3eaff834 12811
0f6990a7
PE
128122011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12813
12814 Integer overflow fixes.
c8a9ca5a 12815
08686060
PE
12816 * dbusbind.c: Serial number integer overflow fixes.
12817 (CHECK_DBUS_SERIAL_GET_SERIAL): New macro.
08686060
PE
12818 (Fdbus_call_method_asynchronously, xd_read_message_1): Use a float
12819 to hold a serial number that is too large for a fixnum.
12820 (Fdbus_method_return_internal, Fdbus_method_error_internal):
12821 Check for serial numbers out of range. Decode any serial number
59568bf0 12822 that was so large that it became a float. (Bug#8722)
08686060 12823
2d1fc3c7
PE
12824 * dbusbind.c: Use XFASTINT rather than XUINT, and check for nonneg.
12825 (Fdbus_call_method, Fdbus_call_method_asynchronously):
12826 Use XFASTINT rather than XUINT when numbers are nonnegative.
12827 (xd_append_arg, Fdbus_method_return_internal):
12828 (Fdbus_method_error_internal): Likewise. Also, for unsigned
12829 arguments, check that Lisp number is nonnegative, rather than
59568bf0 12830 silently wrapping negative numbers around. (Bug#8722)
30217ff0 12831 (xd_read_message_1): Don't assume dbus_uint32_t can fit in int.
59568bf0 12832 (Bug#8722)
2d1fc3c7 12833
c8a9ca5a
PE
12834 * data.c (arith_driver, Flsh): Avoid unnecessary casts to EMACS_UINT.
12835
519e1d69
PE
12836 * ccl.c (ccl_driver): Redo slightly to avoid the need for 'unsigned'.
12837
6df6ae42 12838 ccl: Add integer overflow checks.
30569699
PE
12839 * ccl.c (CCL_CODE_MAX, GET_CCL_RANGE, GET_CCL_CODE, GET_CCL_INT):
12840 (IN_INT_RANGE): New macros.
12841 (ccl_driver): Use them to check for integer overflow when
12842 decoding a CCL program. Many of the new checks are whether XINT (x)
12843 fits in int; it doesn't always, on 64-bit hosts. The new version
12844 doesn't catch all possible integer overflows, but it's an
847044ea 12845 improvement. (Bug#8719)
30569699 12846
c11285dc
PE
12847 * alloc.c (make_event_array): Use XINT, not XUINT.
12848 There's no need for unsigned here.
12849
fdccd48e
PE
12850 * mem-limits.h (EXCEEDS_LISP_PTR) [!USE_LSB_TAG]: EMACS_UINT -> uintptr_t
12851 This follows up to the 2011-05-06 change that substituted uintptr_t
12852 for EMACS_INT. This case wasn't caught back then.
12853
37910ab2
PE
12854 Rework Fformat to avoid integer overflow issues.
12855 * editfns.c: Include <float.h> unconditionally, as it's everywhere
12856 now (part of C89). Include <verify.h>.
12857 (MAX_10_EXP, CONVERTED_BYTE_SIZE): Remove; no longer needed.
12858 (pWIDE, pWIDElen, signed_wide, unsigned_wide): New defns.
12859 (Fformat): Avoid the prepass trying to compute sizes; it was only
12860 approximate and thus did not catch overflow reliably. Instead, walk
12861 through the format just once, formatting and computing sizes as we go,
12862 checking for integer overflow at every step, and allocating a larger
12863 buffer as needed. Keep track separately whether the format is
12864 multibyte. Keep only the most-recently calculated precision, rather
12865 than them all. Record whether each argument has been converted to
12866 string. Use EMACS_INT, not int, for byte and char and arg counts.
12867 Support field widths and precisions larger than INT_MAX. Avoid
12868 sprintf's undefined behavior with conversion specifications such as %#d
12869 and %.0c. Fix bug with strchr succeeding on '\0' when looking for
12870 flags. Fix bug with (format "%c" 256.0). Avoid integer overflow when
12871 formatting out-of-range floating point numbers with int
9173deec 12872 formats. (Bug#8668)
37910ab2 12873
2e6578fb
PE
12874 * lisp.h (FIXNUM_OVERFLOW_P): Work even if arg is a NaN.
12875
0ae6bdee
PE
12876 * data.c: Avoid integer truncation in expressions involving floats.
12877 * data.c: Include <intprops.h>.
12878 (arith_driver): When there's an integer overflow in an expression
12879 involving floating point, convert the integers to floating point
12880 so that the resulting value does not suffer from catastrophic
12881 integer truncation. For example, on a 64-bit host (* 4
12882 most-negative-fixnum 0.5) should yield about -4.6e+18, not zero.
12883 Do not rely on undefined behavior after integer overflow.
12884
de883a70
PE
12885 merge count_size_as_multibyte, parse_str_to_multibyte
12886 * character.c, character.h (count_size_as_multibyte):
fd6fa53f 12887 Rename from parse_str_to_multibyte; all uses changed.
de883a70
PE
12888 Check for integer overflow.
12889 * insdel.c, lisp.h (count_size_as_multibyte): Remove,
12890 since it's now a duplicate of the other. This is more of
12891 a character than a buffer op, so better that it's in character.c.
12892 * fns.c, print.c: Adjust to above changes.
12893
2ff916cb
PE
128942011-05-27 Stefan Monnier <monnier@iro.umontreal.ca>
12895
12896 * xselect.c (x_convert_selection): Yet another int/Lisp_Object mixup.
12897
f1b54466
PE
128982011-05-27 Paul Eggert <eggert@cs.ucla.edu>
12899
fb1ac845
PE
12900 * xselect.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12901 (x_handle_selection_request, frame_for_x_selection): Remove unused vars.
12902 (x_clipboard_manager_save): Now static.
12903 (Fx_clipboard_manager_save): Rename local to avoid shadowing.
12904
f1b54466
PE
12905 * fns.c: Fix minor problems prompted by GCC 4.6.0 warnings.
12906 (crypto_hash_function): Now static.
12907 Fix pointer signedness problems. Avoid unnecessary initializations.
12908
a9f737ee
CY
129092011-05-27 Chong Yidong <cyd@stupidchicken.com>
12910
12911 * termhooks.h (Vselection_alist): Make it terminal-local.
12912
12913 * terminal.c (create_terminal): Initialize it.
12914
12915 * xselect.c: Support for clipboard managers.
12916 (Vselection_alist): Move to termhooks.h as terminal-local var.
12917 (LOCAL_SELECTION): New macro.
12918 (x_atom_to_symbol): Handle x_display_info_for_display fail case.
12919 (symbol_to_x_atom): Remove gratuitous arg.
12920 (x_handle_selection_request, lisp_data_to_selection_data)
12921 (x_get_foreign_selection, Fx_register_dnd_atom): Callers changed.
620c53a6
SM
12922 (x_own_selection, x_get_local_selection, x_convert_selection):
12923 New arg, specifying work frame. Use terminal-local Vselection_alist.
a9f737ee
CY
12924 (some_frame_on_display): Delete unused function.
12925 (Fx_own_selection_internal, Fx_get_selection_internal)
12926 (Fx_disown_selection_internal, Fx_selection_owner_p)
12927 (Fx_selection_exists_p): New optional frame arg.
12928 (frame_for_x_selection, Fx_clipboard_manager_save): New functions.
12929 (x_handle_selection_clear): Don't treat other terminals with the
12930 same keyboard specially. Use the terminal-local Vselection_alist.
12931 (x_clear_frame_selections): Use Frun_hook_with_args.
12932
12933 * xterm.c (x_term_init): Intern ATOM and CLIPBOARD_MANAGER atoms.
12934
12935 * xterm.h: Add support for those atoms.
12936
e067f0c1
CY
129372011-05-26 Chong Yidong <cyd@stupidchicken.com>
12938
12939 * xselect.c: ICCCM-compliant handling of MULTIPLE targets.
12940 (converted_selections, conversion_fail_tag): New global variables.
12941 (x_selection_request_lisp_error): Free the above.
12942 (x_get_local_selection): Remove unnecessary code.
12943 (x_reply_selection_request): Args changed; handle arbitrary array
620c53a6
SM
12944 of converted selections stored in converted_selections.
12945 Separate the XChangeProperty and SelectionNotify steps.
e067f0c1
CY
12946 (x_handle_selection_request): Rewrite to handle MULTIPLE target.
12947 (x_convert_selection): New function.
12948 (x_handle_selection_event): Simplify.
12949 (x_get_foreign_selection): Don't ignore incoming requests while
12950 waiting for an answer; this will fail when we implement
12951 SAVE_TARGETS, and seems unnecessary anyway.
12952 (selection_data_to_lisp_data): Recognize ATOM_PAIR type.
12953 (Vx_sent_selection_functions): Doc fix.
12954
0f4aebc0
LL
129552011-05-26 Leo Liu <sdl.web@gmail.com>
12956
12957 * editfns.c (Ftranspose_regions): Allow empty regions. (Bug#8699)
12958
e61124cd
YM
129592011-05-25 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
12960
12961 * dispextern.h (struct glyph_row): New member fringe_bitmap_periodic_p.
12962
12963 * dispnew.c (shift_glyph_matrix, scrolling_window): Mark scrolled row
12964 for fringe update if it has periodic bitmap.
ac389d0c 12965 (row_equal_p): Also compare left_fringe_offset, right_fringe_offset,
e61124cd
YM
12966 and fringe_bitmap_periodic_p.
12967
12968 * fringe.c (get_fringe_bitmap_data): New function.
12969 (draw_fringe_bitmap_1, update_window_fringes): Use it.
12970 (update_window_fringes): Record periodicity of fringe bitmap in glyph
12971 row. Mark glyph row for fringe update if periodicity changed.
12972
12973 * xdisp.c (try_window_reusing_current_matrix): Don't mark scrolled row
12974 for fringe update unless it has periodic bitmap.
12975
f16d9837
KH
129762011-05-25 Kenichi Handa <handa@m17n.org>
12977
12978 * xdisp.c (get_next_display_element): Set correct it->face_id for
12979 a static composition.
12980
e1b90ef6
LL
129812011-05-24 Leo Liu <sdl.web@gmail.com>
12982
12983 * deps.mk (fns.o):
12984 * makefile.w32-in ($(BLD)/fns.$(O)): Include sha1.h.
12985
12986 * fns.c (crypto_hash_function, Fsha1): New function.
12987 (Fmd5): Use crypto_hash_function.
12988 (syms_of_fns): Add Ssha1.
12989
7400048f
PE
129902011-05-22 Paul Eggert <eggert@cs.ucla.edu>
12991
12992 * gnutls.c: Remove unused macros.
12993 (fn_gnutls_transport_set_lowat, fn_gnutls_transport_set_pull_function):
12994 (fn_gnutls_transport_set_push_function) [!WINDOWSNT]:
12995 Remove macros that are defined and never used.
12996 Caught by gcc -Wunused-macros (GCC 4.6.0, Fedora 14).
12997
abb71cf4
CY
129982011-05-22 Chong Yidong <cyd@stupidchicken.com>
12999
13000 * xselect.c (syms_of_xselect): Remove unused symbol SAVE_TARGETS.
13001 (Fx_get_selection_internal): Minor cleanup.
13002 (Fx_own_selection_internal): Rename arguments for consistency with
13003 select.el.
13004
6307db39
PE
130052011-05-22 Paul Eggert <eggert@cs.ucla.edu>
13006
13007 * xselect.c (QSAVE_TARGETS): New static var, to fix build failure.
13008
f3d4e0a4
CY
130092011-05-22 Chong Yidong <cyd@stupidchicken.com>
13010
13011 * xselect.c (syms_of_xselect): Include character.h; use DEFSYM.
13012
4d8ade89
YM
130132011-05-21 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
13014
13015 * dispnew.c (scrolling_window): Don't exclude the case that the
13016 last enabled row in the desired matrix touches the bottom boundary.
13017
32078c8d
GM
130182011-05-21 Glenn Morris <rgm@gnu.org>
13019
13020 * Makefile.in ($(etc)/DOC): Make second command line even shorter.
33cf345f
GM
13021 (SOME_MACHINE_OBJECTS): Replace FONT_OBJ by its maximal expansion,
13022 and add some more files.
32078c8d 13023
7285dc67
EZ
130242011-05-20 Eli Zaretskii <eliz@gnu.org>
13025
13026 * callproc.c (Fcall_process) [MSDOS]: Fix arguments to
13027 report_file_error introduced by the change from 2011-05-07.
13028
89d1bd22
PE
130292011-05-20 Paul Eggert <eggert@cs.ucla.edu>
13030
13031 * systime.h (Time): Define only if emacs is defined.
13032 This is to allow ../lib-src/profile.c to be compiled on FreeBSD,
13033 where the include path doesn't have X11/X.h by default. See
13034 <http://lists.gnu.org/archive/html/emacs-devel/2011-05/msg00561.html>.
13035
cd394be1 130362011-05-20 Kenichi Handa <handa@m17n.org>
31bfc35c
KH
13037
13038 * composite.c (find_automatic_composition): Fix previous change.
13039
b9704ad9
GM
130402011-05-20 Glenn Morris <rgm@gnu.org>
13041
13042 * lisp.mk: New file, split from Makefile.in.
13043 * Makefile.in (lisp): Move to separate file, inserted by @lisp_frag@.
13044 (shortlisp): Remove.
13045 ($(etc)/DOC): Edit lisp.mk rather than using $shortlisp.
13046
4a720484
GM
130472011-05-19 Glenn Morris <rgm@gnu.org>
13048
13049 * Makefile.in (MSDOS_SUPPORT_REAL, MSDOS_SUPPORT, NS_SUPPORT)
13050 (REAL_MOUSE_SUPPORT, GPM_MOUSE_SUPPORT, MOUSE_SUPPORT, TOOLTIP_SUPPORT)
13051 (BASE_WINDOW_SUPPORT, X_WINDOW_SUPPORT, WINDOW_SUPPORT): Remove.
13052 (lisp): Set the order to that of loadup.el.
13053 (shortlisp): Make it a copy of $lisp.
13054 (SOME_MACHINE_LISP): Remove.
13055 ($(etc)/DOC): Depend just on $lisp, not $SOME_MACHINE_LISP too.
13056 Use just $shortlisp, not $SOME_MACHINE_LISP too.
13057
a28d4396
KH
130582011-05-18 Kenichi Handa <handa@m17n.org>
13059
13060 * composite.c (CHAR_COMPOSABLE_P): Add more check for efficiency.
13061 (BACKWARD_CHAR): Wrap the arg STOP by parenthesis.
13062 (find_automatic_composition): Mostly rewrite for efficiency.
13063
a2b1fa8e
JB
130642011-05-18 Juanma Barranquero <lekktu@gmail.com>
13065
13066 * makefile.w32-in: Update dependencies.
13067
8e1f5610
CS
130682011-05-18 Christoph Scholtes <cschol2112@googlemail.com>
13069
13070 * menu.c: Include limits.h (fixes the MS-Windows build broken by
7d7d0045 13071 2011-06-18T18:49:19Z!cyd@stupidchicken.com).
8e1f5610 13072
7025ee00 130732011-05-18 Paul Eggert <eggert@cs.ucla.edu>
cb93f9be 13074
cdfa6eab
PE
13075 Fix some integer overflow issues, such as string length overflow.
13076
06d6db33
PE
13077 * insdel.c (count_size_as_multibyte): Check for string overflow.
13078
2b4560a8
PE
13079 * character.c (lisp_string_width): Check for string overflow.
13080 Use EMACS_INT, not int, for string indexes and lengths; in
13081 particular, 2nd arg is now EMACS_INT, not int. Do not crash if
13082 the resulting string length overflows an EMACS_INT; instead,
13083 report a string overflow if no precision given. When checking for
13084 precision exhaustion, use a check that cannot possibly have
13085 integer overflow. (Bug#8675)
13086 * character.h (lisp_string_width): Adjust to new signature.
13087
cb93f9be
PE
13088 * alloc.c (string_overflow): New function.
13089 (Fmake_string): Use it. This doesn't change behavior, but saves
13090 a few bytes and will simplify future changes.
13091 * character.c (string_escape_byte8): Likewise.
13092 * lisp.h (string_overflow): New decl.
13093
1a1f3366
PE
13094 Fixups, following up to the user-interface timestamp change.
13095 * nsterm.m (last_mouse_movement_time, ns_mouse_position): Use Time
13096 for UI timestamps, instead of unsigned long.
9fbd6841
PE
13097 * msdos.c (mouse_get_pos): Likewise.
13098 * w32inevt.c (movement_time, w32_console_mouse_position): Likewise.
1a1f3366
PE
13099 * w32gui.h (Time): Define by including "systime.h" rather than by
13100 declaring it ourselves. (Bug#8664)
13101
d4e3e4d3
PE
13102 * dispextern.h (struct image): Don't assume time_t <= unsigned long.
13103 * image.c (clear_image_cache): Likewise.
13104
f6a24d19
PE
13105 * term.c (term_mouse_position): Don't assume time_t wraparound.
13106
08dc5ae6
PE
13107 Be more systematic about user-interface timestamps.
13108 Before, the code sometimes used 'Time', sometimes 'unsigned long',
620c53a6
SM
13109 and sometimes 'EMACS_UINT', to represent these timestamps.
13110 This change causes it to use 'Time' uniformly, as that's what X uses.
08dc5ae6
PE
13111 This makes the code easier to follow, and makes it easier to catch
13112 integer overflow bugs such as Bug#8664.
13113 * frame.c (Fmouse_position, Fmouse_pixel_position):
13114 Use Time, not unsigned long, for user-interface timestamps.
13115 * keyboard.c (last_event_timestamp, kbd_buffer_get_event): Likewise.
13116 (button_down_time, make_lispy_position, make_lispy_movement): Likewise.
13117 * keyboard.h (last_event_timestamp): Likewise.
13118 * menu.c (Fx_popup_menu) [!HAVE_X_WINDOWS]: Likewise.
13119 * menu.h (xmenu_show): Likewise.
13120 * term.c (term_mouse_position): Likewise.
13121 * termhooks.h (struct input_event.timestamp): Likewise.
13122 (struct terminal.mouse_position_hook): Likewise.
13123 * xmenu.c (create_and_show_popup_menu, xmenu_show): Likewise.
13124 * xterm.c (XTmouse_position, x_scroll_bar_report_motion): Likewise.
13125 * systime.h (Time): New decl. Pull it in from <X11/X.h> if
13126 HAVE_X_WINDOWS, otherwise define it as unsigned long, which is
13127 what it was before.
13128 * menu.h, termhooks.h: Include "systime.h", for Time.
13129
8e55734a
PE
13130 * keyboard.c (make_lispy_event): Fix problem in integer overflow.
13131 Don't assume that the difference between two unsigned long values
13132 can fit into an integer. At this point, we know button_down_time
13133 <= event->timestamp, so the difference must be nonnegative, so
13134 there's no need to cast the result if double-click-time is
13135 nonnegative, as it should be; check that it's nonnegative, just in
13136 case. This bug is triggered when events are more than 2**31 ms
86db42d2 13137 apart (about 25 days). (Bug#8664)
8e55734a 13138
841f1b75 13139 * xselect.c (last_event_timestamp): Remove duplicate decl.
6434756c 13140 (x_own_selection): Remove needless cast to unsigned long.
841f1b75 13141
3e26f69c
PE
13142 * xmenu.c (set_frame_menubar): Use int, not EMACS_UINT, for indexes
13143 that always fit in int. Use a sentinel instead of a counter, to
13144 avoid a temp and to allay GCC's concerns about possible int overflow.
d230cb74
PE
13145 * frame.h (struct frame): Use int for menu_bar_items_used
13146 instead of EMACS_INT, since it always fits in int.
3e26f69c 13147
5cc152c0
PE
13148 * menu.c (grow_menu_items): Check for int overflow.
13149
d89eb65e
PE
13150 * xmenu.c (set_frame_menubar): Don't mishandle vectors with no nils.
13151
5235bd3e
PE
13152 * xterm.c: Use EMACS_INT for Emacs modifiers, and int for X modifiers.
13153 Before, the code was not consistent. These values cannot exceed
13154 2**31 - 1 so there's no need to make them unsigned.
13155 (x_x_to_emacs_modifiers): Accept int and return EMACS_INT.
13156 (x_emacs_to_x_modifiers): Accept EMACS_INT and return int.
13157 (x_x_to_emacs_modifiers, x_emacs_to_x_modifiers): Reject non-integers
13158 as modifiers.
13159 * xterm.h (x_x_to_emacs_modifiers): Adjust to signature change.
13160
bc827e23
PE
13161 * lisp.h (XINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_INT.
13162 (XUINT) [USE_LISP_UNION_TYPE]: Cast to EMACS_UINT.
13163 Otherwise, GCC 4.6.0 warns about printf (pI, XINT (...)),
13164 presumably because the widths might not match.
13165
78eb494e
PE
13166 * window.c (size_window): Avoid needless test at loop start.
13167
04f2d78b
CB
131682011-05-18 Courtney Bane <emacs-bugs-7626@cbane.org> (tiny change)
13169
13170 * term.c (Fresume_tty): Restore hooks before reinitializing (bug#8687).
13171
d2fc7e3d 131722011-05-12 Drew Adams <drew.adams@oracle.com>
e531bdff
DA
13173
13174 * textprop.c (Fprevious_single_char_property_change): Doc fix (bug#8655).
13175
d2fc7e3d 131762011-05-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
7db47798
YM
13177
13178 * w32term.c (w32_draw_fringe_bitmap): Rename local vars `left' and
13179 `width' to `bar_area_x' and `bar_area_width', respectively.
13180 (x_scroll_run): Take account of fringe background extension.
13181
04f2d78b
CB
13182 * xterm.c (x_draw_fringe_bitmap) [USE_TOOLKIT_SCROLL_BARS]:
13183 Rename local vars `left' and `width' to `bar_area_x' and
7db47798
YM
13184 `bar_area_width', respectively.
13185 (x_scroll_run) [USE_TOOLKIT_SCROLL_BARS]: Take account of fringe
13186 background extension.
13187
79b70037
GM
131882011-05-10 Jim Meyering <meyering@redhat.com>
13189
13190 * xdisp.c (x_intersect_rectangles): Fix typo "the the -> the".
13191
2f142cc5
JB
131922011-05-10 Juanma Barranquero <lekktu@gmail.com>
13193
13194 * image.c (Finit_image_library): Return t for built-in image types,
13195 like pbm and xbm. (Bug#8640)
13196
57679c86
AS
131972011-05-09 Andreas Schwab <schwab@linux-m68k.org>
13198
13199 * w32menu.c (set_frame_menubar): Fix submenu allocation.
13200
888c9e86
EZ
132012011-05-07 Eli Zaretskii <eliz@gnu.org>
13202
b0512a1d
EZ
13203 * w32console.c (Fset_screen_color): Doc fix.
13204 (Fget_screen_color): New function.
13205 (syms_of_ntterm): Defsubr it.
13206
7285dc67
EZ
13207 * callproc.c (call_process_cleanup) [MSDOS]: Don't close and
13208 unlink the temporary file if Fcall_process didn't create it in the
13209 first place.
13210 (Fcall_process) [MSDOS]: Don't create tempfile if stdout of the
13211 child process will be redirected to a file specified with `:file'.
888c9e86
EZ
13212 Don't try to re-open tempfile in that case, and set fd[0] to -1 as
13213 cue to call_process_cleanup not to close that handle.
13214
4d3fcc8e
BK
132152011-05-07 Ben Key <bkey76@gmail.com>
13216
13217 * makefile.w32-in: The bootstrap-temacs rule now makes use of
13218 one of two shell specific rules, either bootstrap-temacs-CMD or
13219 bootstrap-temacs-SH. The bootstrap-temacs-SH rule is identical
13220 to the previous implementation of the bootstrap-temacs rule.
13221 The bootstrap-temacs-CMD rule is similar to the previous
13222 implementation of the bootstrap-temacs rule except that it
13223 makes use of the ESC_CFLAGS variable instead of the CFLAGS
13224 variable.
13225
13226 These changes, along with some changes to nt/configure.bat,
13227 nt/gmake.defs, and nt/nmake.defs, are required to extend my
13228 earlier fix to add support for --cflags and --ldflags options
13229 that include quotes so that it works whether make uses cmd or
13230 sh as the shell.
13231
b4289b64
MA
132322011-05-06 Michael Albinus <michael.albinus@gmx.de>
13233
13234 * dbusbind.c (QCdbus_type_unix_fd): Declare static.
13235 (xd_remove_watch): Don't check QCdbus_type_unix_fd for SYMBOLP, it
13236 is a constant.
13237 (Fdbus_init_bus, xd_read_queued_messages): Bus can be a symbol or
13238 a string. Handle both cases.
13239 (Fdbus_call_method_asynchronously, Fdbus_register_signal)
13240 (Fdbus_register_method): Use Qinvalid_function.
13241
af4c0e28
JB
132422011-05-06 Juanma Barranquero <lekktu@gmail.com>
13243
13244 * makefile.w32-in: Update dependencies.
13245 (LISP_H): Add inttypes.h and stdin.h.
13246 (PROCESS_H): Add unistd.h.
13247
c51453d9
EZ
132482011-05-06 Eli Zaretskii <eliz@gnu.org>
13249
13250 * lread.c: Include limits.h (fixes the MS-Windows build broken by
13251 2011-05-06T07:13:19Z!eggert@cs.ucla.edu).
13252
8ff0ac3c 132532011-05-06 Paul Eggert <eggert@cs.ucla.edu>
c032b5f8 13254
4c4b566b
PE
13255 * image.c (Finit_image_library) [!HAVE_NTGUI]: Omit unused local.
13256
aab2b9b5
PE
13257 * term.c (vfatal): Remove stray call to va_end.
13258 It's not needed and the C Standard doesn't allow it here anyway.
13259
c378da0b
PE
13260 Use C99's va_copy to avoid undefined behavior on x86-64 GNU/Linux.
13261 * eval.c (verror): doprnt a copy of ap, not the original. (Bug#8545)
13262
288b08c7
PE
13263 * eval.c (verror): OK to create a string of up to MOST_POSITIVE_FIXNUM
13264 bytes.
13265
e3601888
PE
13266 * term.c: Don't include <stdarg.h>, as <lisp.h> does that.
13267
db6c0e74
PE
13268 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork clobbering.
13269
dd5963ea
PE
13270 * process.c (Fformat_network_address): Fix typo: args2 -> *args2.
13271
88c9450f
PE
13272 * xmenu.c (set_frame_menubar): Fix typo: int * -> int (3 times).
13273
2f9442b8
PE
13274 * coding.c (detect_coding_charset): Fix typo: * 2 -> *4 (Bug#8601).
13275
c032b5f8
PE
13276 * charset.h (struct charset.code_space): Now has 15 elements, not 16.
13277 * charset.c (Fdefine_charset_internal): Don't initialize
13278 charset.code_space[15]. The value was garbage, on hosts with
2d38271b 13279 32-bit int (Bug#8600).
a108c10b
PE
13280
13281 * lread.c (read_integer): Be more consistent with string-to-number.
13282 Use string_to_number to do the actual conversion; this avoids
13283 rounding errors and fixes some other screwups. Without this fix,
13284 for example, #x1fffffffffffffff was misread as -2305843009213693952.
13285 (digit_to_number): Move earlier, for benefit of read_integer.
13286 Return -1 if the digit is out of range for the base, -2 if it is
48e400f0 13287 not a digit in any supported base. (Bug#8602)
a108c10b 13288
ad5f9eea
PE
13289 * doprnt.c (doprnt): Support arbitrary pI values, such as "I64".
13290
aec1708a
PE
13291 * dispnew.c (scrolling_window): Return 1 if we scrolled,
13292 to match comment at start of function. This also removes a
13293 GCC warning about overflow in a 32+64-bit port.
13294
47be4ab5
PE
13295 * lisp.h (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Simplify.
13296
371cac43
PE
13297 * dbusbind.c: Do not use XPNTR on a value that may be an integer.
13298 Reported by Stefan Monnier in
13299 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00919.html>.
04f2d78b
CB
13300 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13301 Use SYMBOLP-guarded XSYMBOL, not XPNTR.
371cac43 13302
d01a7826
PE
13303 * lisp.h (EMACS_INTPTR): Remove. All uses changed to intptr_t.
13304 (EMACS_UINTPTR): Likewise, with uintptr_t.
13305
7fd47d5c
PE
13306 * lisp.h: Prefer 64-bit EMACS_INT if available.
13307 (EMACS_INT, EMACS_UINT, BITS_PER_EMACS_INT, pI): Define to 64-bit
13308 on 32-bit hosts that have 64-bit int, so that they can access
13309 large files.
122b0c86
PE
13310 However, temporarily disable this change unless the temporary
13311 symbol WIDE_EMACS_INT is defined.
7fd47d5c 13312
8727937b
PE
13313 * lread.c, process.c: Do not include <inttypes.h>; lisp.h does it now.
13314
8ac068ac
PE
13315 Prefer intptr_t/uintptr_t for integers the same widths as pointers.
13316 This removes an assumption that EMACS_INT and long are the same
13317 width as pointers. The assumption is true for Emacs porting targets
13318 now, but we want to make other targets possible.
13319 * lisp.h: Include <inttypes.h>, for INTPTR_MAX, UINTPTR_MAX.
13320 (EMACS_INTPTR, EMACS_UINTPTR): New macros.
13321 In the rest of the code, change types of integers that hold casted
13322 pointers to EMACS_INTPTR and EMACS_UINTPTR, systematically
13323 replacing EMACS_INT, long, EMACS_UINT, and unsigned long.
13324 (XTYPE): Don't cast arg to EMACS_UINT; normally is not needed.
13325 (XSET): Cast type of XTYPE arg to EMACS_INTPTR; it is needed here.
13326 No need to cast type when ORing.
13327 (XPNTR): Return a value of type EMACS_INTPTR or EMACS_UINTPTR.
13328 * alloc.c (lisp_align_malloc): Remove a no-longer-needed cast.
13329 * doc.c (store_function_docstring): Use EMACS_INTPTR, so as not to
13330 assume EMACS_INT is the same width as char *.
13331 * gtkutil.c (xg_gtk_scroll_destroy, xg_tool_bar_button_cb):
13332 (xg_tool_bar_callback, xg_tool_bar_help_callback, xg_make_tool_item):
13333 Remove no-longer-needed casts.
13334 (xg_create_scroll_bar, xg_tool_bar_button_cb, xg_tool_bar_callback):
13335 (xg_tool_bar_help_callback, xg_make_tool_item):
13336 Use EMACS_INTPTR to hold an integer
13337 that will be cast to void *; this can avoid a GCC warning
13338 if EMACS_INT is not the same width as void *.
13339 * menu.c (find_and_call_menu_selection): Remove no-longer-needed cast.
13340 * xdisp.c (display_echo_area_1, resize_mini_window_1):
13341 (current_message_1, set_message_1):
13342 Use a local to convert to proper width without a cast.
13343 * xmenu.c (dialog_selection_callback): Likewise.
13344
ede49d71
PE
13345 * sysdep.c (get_random): Don't assume EMACS_INT is no wider than long.
13346 Also, don't assume VALBITS / RAND_BITS is less than 5,
13347 and don't rely on undefined behavior when shifting a 1 left into
13348 the sign bit.
13349 * lisp.h (get_random): Change signature to match.
13350
2f30ecd0
PE
13351 * lread.c (hash_string): Use size_t, not int, for hash computation.
13352 Normally we prefer signed values; but hashing is special, because
13353 it's better to use unsigned division on hash table sizes so that
13354 the remainder is nonnegative. Also, size_t is the natural width
13355 for hashing into memory. The previous code used 'int', which doesn't
13356 retain enough info to hash well into very large tables.
13357 (oblookup, oblookup_last_bucket_number, Funintern): Likewise.
13358
2a866e7b
PE
13359 * dbusbind.c: Don't possibly lose pointer info when converting.
13360 (xd_remove_watch, Fdbus_init_bus, xd_read_queued_messages):
13361 Use XPNTR rather than XHASH, so that the high-order bits of
13362 the pointer aren't lost when converting through void *.
13363
51639eac
PE
13364 * eval.c (Fautoload): Don't double-shift a pointer.
13365
92394119
PE
13366 * fns.c (Frandom): Let EMACS_UINT be wider than unsigned long.
13367
dbdb9a7c
JB
133682011-05-06 Juanma Barranquero <lekktu@gmail.com>
13369
13370 * gnutls.c (DEF_GNUTLS_FN):
13371 * image.c (DEF_IMGLIB_FN): Make function pointers static.
13372
db7a0b4f
AS
133732011-05-05 Andreas Schwab <schwab@linux-m68k.org>
13374
13375 * lread.c (lisp_file_lexically_bound_p): Stop scanning at end
13376 marker. (Bug#8610)
13377
cd394be1 133782011-05-05 Eli Zaretskii <eliz@gnu.org>
fab624aa
EZ
13379
13380 * w32heap.c (allocate_heap) [USE_LISP_UNION_TYPE || USE_LSB_TAG]:
13381 New version that can reserve upto 2GB of heap space.
13382
f7ff1b0f 133832011-05-05 Chong Yidong <cyd@stupidchicken.com>
45cb8994
CY
13384
13385 * nsfns.m (Fns_read_file_name): Doc fix (Bug#8534).
13386
639c109b
TZ
133872011-05-05 Teodor Zlatanov <tzz@lifelogs.com>
13388
13389 * gnutls.c (fn_gnutls_certificate_set_x509_key_file): Add alias to
13390 `gnutls_certificate_set_x509_key_file'.
13391
d2127135
JB
133922011-05-05 Juanma Barranquero <lekktu@gmail.com>
13393
13394 * makefile.w32-in ($(BLD)/image.$(O), $(BLD)/process.$(O)):
13395 Update dependencies.
13396
e968f4f3
JB
133972011-05-04 Juanma Barranquero <lekktu@gmail.com>
13398
13399 * gnutls.h (emacs_gnutls_write, emacs_gnutls_read):
13400 * gnutls.c (emacs_gnutls_write, emacs_gnutls_read):
13401 Remove unused parameter `fildes'.
13402 * process.c (read_process_output, send_process): Don't pass it.
13403
84d358f0
JB
134042011-05-04 Juanma Barranquero <lekktu@gmail.com>
13405
13406 Fix previous change: the library cache is defined in w32.c.
13407 * image.c (CACHE_IMAGE_TYPE) [!HAVE_NTGUI]: Define to noop.
13408 (Finit_image_library): Wrap Vlibrary_cache on "#ifdef HAVE_NTGUI".
13409
0898ca10
JB
134102011-05-04 Juanma Barranquero <lekktu@gmail.com>
13411
13412 Implement dynamic loading of GnuTLS on Windows.
13413
13414 * gnutls.h (GNUTLS_EMACS_ERROR_NOT_LOADED): New macro.
13415 (emacs_gnutls_write, emacs_gnutls_read): Mark as extern.
13416 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13417 Declare.
13418
13419 * gnutls.c (Qgnutls_dll): Define.
13420 (DEF_GNUTLS_FN, LOAD_GNUTLS_FN): New macros.
13421 (gnutls_*): Declare function pointers.
13422 (init_gnutls_functions): New function to initialize function pointers.
13423 (emacs_gnutls_handshake, Fgnutls_error_string, Fgnutls_deinit)
13424 (emacs_gnutls_global_init, Fgnutls_bye): Use function pointers.
13425 (emacs_gnutls_record_check_pending, emacs_gnutls_transport_set_errno):
13426 Wrappers for gnutls_record_check_pending and gnutls_transport_set_errno.
13427 (emacs_gnutls_write, emacs_gnutls_read)
13428 (emacs_gnutls_handle_error, Fgnutls_error_fatalp)
13429 (Fgnutls_available_p): New function.
13430 (Fgnutls_boot): Call Fgnutls_available_p. Use function pointers.
13431 (syms_of_gnutls) <Qgnutls_dll>: Initialize and staticpro it.
13432 (syms_of_gnutls) <Sgnutls_available_p>: defsubr it.
13433
13434 * image.c: Include w32.h.
13435 (Vimage_type_cache): Delete.
13436 (syms_of_image) <Vimage_type_cache>: Don't initialize and staticpro it.
13437 (CACHE_IMAGE_TYPE, Finit_image_library): Use Vlibrary_cache instead.
13438 (w32_delayed_load): Move to w32.c.
13439
13440 * w32.h (VlibraryCache, QCloaded_from, w32_delayed_load): Declare.
13441
13442 * w32.c (QCloaded_from, Vlibrary_cache): Define.
13443 (w32_delayed_load): Move from image.c. When loading a library, record
13444 its filename in the :loaded-from property of the library id.
13445 (globals_of_w32) <QCloaded_from, Vlibrary_cache>:
13446 Initialize and staticpro them.
13447 (emacs_gnutls_pull, emacs_gnutls_push): Call emacs_gnutls_* functions.
13448
13449 * process.c: Include lisp.h before w32.h, not after.
13450 (wait_reading_process_output): Call emacs_gnutls_record_check_pending
13451 instead of gnutls_record_check_pending.
13452
13453 * callproc.c, emacs.c: Include lisp.h before w32.h, not after.
13454
ff4de4aa
TZ
134552011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
13456
13457 * gnutls.c (Fgnutls_boot): Support :keylist and :crlfiles options
13458 instead of :keyfiles. Give GnuTLS the keylist and the CRL lists
13459 as passed in.
13460
abe95abb
JD
134612011-05-03 Jan Djärv <jan.h.d@swipnet.se>
13462
13463 * xterm.c (x_set_frame_alpha): Do not set property on anything
13464 else than FRAME_X_OUTER_WINDOW (Bug#8608).
13465
e16e55d4
JB
134662011-05-02 Juanma Barranquero <lekktu@gmail.com>
13467
13468 * sysdep.c (get_tty_size) [WINDOWSNT]: Implement. (Bug#8596)
13469
bafcf6a5
JB
134702011-05-02 Juanma Barranquero <lekktu@gmail.com>
13471
13472 * gnutls.c (Qgnutls_log_level, Qgnutls_code, Qgnutls_anon)
13473 (Qgnutls_x509pki, Qgnutls_e_interrupted, Qgnutls_e_again)
13474 (Qgnutls_e_invalid_session, Qgnutls_e_not_ready_for_handshake)
13475 (gnutls_global_initialized, Qgnutls_bootprop_priority)
13476 (Qgnutls_bootprop_trustfiles, Qgnutls_bootprop_keyfiles)
13477 (Qgnutls_bootprop_callbacks, Qgnutls_bootprop_loglevel)
13478 (Qgnutls_bootprop_hostname, Qgnutls_bootprop_verify_flags)
13479 (Qgnutls_bootprop_verify_error, Qgnutls_bootprop_verify_hostname_error)
13480 (Qgnutls_bootprop_callbacks_verify): Make static.
13481
e7a6747f
AS
134822011-05-01 Andreas Schwab <schwab@linux-m68k.org>
13483
19ed11ba
AS
13484 * callproc.c: Indentation fixup.
13485
e7a6747f 13486 * sysdep.c (wait_for_termination_1): Make static.
04f2d78b
CB
13487 (wait_for_termination, interruptible_wait_for_termination):
13488 Move after wait_for_termination_1.
e7a6747f 13489
1ef14cb4
LMI
134902011-05-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
13491
13492 * sysdep.c (interruptible_wait_for_termination): New function
13493 which is like wait_for_termination, but allows keyboard
13494 interruptions.
13495
13496 * callproc.c (Fcall_process): Add (:file "file") as an option for
13497 the STDOUT buffer.
13498 (Fcall_process_region): Ditto.
13499
330d880c
EZ
135002011-04-30 Eli Zaretskii <eliz@gnu.org>
13501
8db90b73
EZ
13502 * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)'
13503 rather than `XVECTOR (FOO)->size'.
13504
330d880c
EZ
13505 * process.c: Remove HAVE_INTTYPES_H condition from inclusion of
13506 inttypes.h, as a gnulib replacement is used if it not available in
13507 system headers.
13508
15cbd324
EZ
135092011-04-21 Eli Zaretskii <eliz@gnu.org>
13510
13511 Lift the MOST_POSITIVE_FIXNUM/4 limitation on visited files.
13512 * fileio.c (Finsert_file_contents): Don't limit file size to 1/4
13513 of MOST_POSITIVE_FIXNUM. (Bug#8528)
13514
13515 * coding.c (coding_alloc_by_realloc): Error out if destination
13516 will grow beyond MOST_POSITIVE_FIXNUM.
13517 (decode_coding_emacs_mule): Abort if there isn't enough place in
13518 charbuf for the composition carryover bytes. Reserve an extra
13519 space for up to 2 characters produced in a loop.
13520 (decode_coding_iso_2022): Abort if there isn't enough place in
13521 charbuf for the composition carryover bytes.
13522
135232011-04-21 Eli Zaretskii <eliz@gnu.org>
afda1437 13524
ae940cca
EZ
13525 * doprnt.c (doprnt) [!HAVE_LONG_LONG_INT]: Error out instead of
13526 aborting when %lld or %lll format is passed.
13527 [!HAVE_UNSIGNED_LONG_LONG_INT]: Error out instead of aborting when
13528 %llo or %llx format is passed. (Bug#8545)
13529
03ab8921
EZ
13530 * window.c (window_scroll_line_based): Use a marker instead of
13531 simple variables to record original value of point. (Bug#7952)
13532
afda1437
EZ
13533 * doprnt.c (doprnt): Fix the case where a multibyte sequence
13534 produced by %s or %c overflows available buffer space. (Bug#8545)
13535
f76dee0c
PE
135362011-04-28 Paul Eggert <eggert@cs.ucla.edu>
13537
13538 * doprnt.c (doprnt): Omit useless test; int overflow check (Bug#8545).
283cdbef 13539 (SIZE_MAX): Move defn after all includes, as they might #define it.
f76dee0c 13540
fdc5744d
JB
135412011-04-28 Juanma Barranquero <lekktu@gmail.com>
13542
13543 * w32.c (init_environment): Warn about defaulting HOME to C:\.
13544
638f053a
JB
135452011-04-28 Juanma Barranquero <lekktu@gmail.com>
13546
13547 * keyboard.c (Qdelayed_warnings_hook): Define.
13548 (command_loop_1): Run `delayed-warnings-hook'
13549 if Vdelayed_warnings_list is non-nil.
13550 (syms_of_keyboard) <delayed-warnings-hook>: DEFSYM it.
13551 (syms_of_keyboard) <delayed-warnings-list>: DEFVAR_LISP it.
13552
d178f871
EZ
135532011-04-28 Eli Zaretskii <eliz@gnu.org>
13554
13555 * doprnt.c (doprnt): Don't return value smaller than the buffer
13556 size if the message was truncated. (Bug#8545).
13557
b124fd93
JB
135582011-04-28 Juanma Barranquero <lekktu@gmail.com>
13559
13560 * w32fns.c (Fx_change_window_property, Fx_delete_window_property)
13561 (Fx_window_property): #if-0 the whole functions, not just the bodies.
13562
e810457d
PE
135632011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13564
13565 * doprnt.c (doprnt): Support "ll" length modifier, for long long.
13566
ea51cceb
JB
135672011-04-27 Juanma Barranquero <lekktu@gmail.com>
13568
13569 * makefile.w32-in: Update dependencies.
13570
94dcfacf
EZ
135712011-04-27 Eli Zaretskii <eliz@gnu.org>
13572
13573 Improve `doprnt' and its usage. (Bug#8545)
13574 * doprnt.c (doprnt): Make sure `format' is never accessed beyond
13575 `format_end'. Remove support for %l as a conversion specifier.
13576 Don't use xrealloc. Improve diagnostics when the %l size modifier
13577 is used. Update the commentary.
13578
13579 * eval.c (verror): Simplify calculation of size_t.
13580
13581 * coding.c (Ffind_operation_coding_system): Fix diagnostic error
13582 messages.
13583
f61f41d7
PE
135842011-04-27 Yoshiaki Kasahara <kasahara@nc.kyushu-u.ac.jp> (tiny change)
13585
13586 * buffer.c (init_buffer) [USE_MMAP_FOR_BUFFERS]: Adjust to aliasing
13587 change.
13588
96fb4434
PE
135892011-04-27 Paul Eggert <eggert@cs.ucla.edu>
13590
13591 * nsmenu.m: Replace all uses of XVECTOR with ASIZE and AREF.
13592 This makes this file independent of the recent pseudovector change.
13593
671875da 135942011-04-26 Paul Eggert <eggert@cs.ucla.edu>
eab3844f 13595
69e9b5a3
PE
13596 * keyboard.c (handle_user_signal): Fix pointer signedness problem.
13597
b5f869a7 13598 * gnutls.c (emacs_gnutls_handle_error): Remove unused local.
7754e151 13599 (Fgnutls_boot): gnutls_certificate_verify_peers2 wants unsigned *.
8d4c3955 13600 Remove unused local.
c8926152 13601 (emacs_gnutls_write): Don't use uninitialized rtnval if nbyte <= 0.
080e5a8d 13602
841a1577 13603 * lisp.h: Fix a problem with aliasing and vector headers. (Bug#8546)
04f2d78b
CB
13604 GCC 4.6.0 optimizes based on type-based alias analysis.
13605 For example, if b is of type struct buffer * and v of type struct
eab3844f
PE
13606 Lisp_Vector *, then gcc -O2 was incorrectly assuming that &b->size
13607 != &v->size, and therefore "v->size = 1; b->size = 2; return
13608 v->size;" must therefore return 1. This assumption is incorrect
13609 for Emacs, since it type-puns struct Lisp_Vector * with many other
13610 types. To fix this problem, this patch adds a new type struct
f904488f 13611 vectorlike_header that documents the constraints on layout of vectors
eab3844f
PE
13612 and pseudovectors, and helps optimizing compilers not get fooled
13613 by Emacs's type punning. It also adds the macros XSETTYPED_PVECTYPE
13614 XSETTYPED_PSEUDOVECTOR, TYPED_PSEUDOVECTORP, for similar reasons.
f904488f
PE
13615 * lisp.h (XSETTYPED_PVECTYPE): New macro, specifying the name of
13616 the size member.
eab3844f
PE
13617 (XSETPVECTYPE): Rewrite in terms of new macro.
13618 (XSETPVECTYPESIZE): New macro, specifying both type and size.
13619 This is a bit clearer, and further avoids the possibility of
13620 undesirable aliasing.
13621 (XSETTYPED_PSEUDOVECTOR): New macro, specifying the size.
f904488f 13622 (XSETPSEUDOVECTOR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR.
eab3844f
PE
13623 (XSETSUBR): Rewrite in terms of XSETTYPED_PSEUDOVECTOR and XSIZE,
13624 since Lisp_Subr is a special case (no "next" field).
04f2d78b
CB
13625 (ASIZE): Now uses header.size rather than size.
13626 All previous uses of XVECTOR (foo)->size replaced to use this macro,
f904488f
PE
13627 to avoid the hassle of writing XVECTOR (foo)->header.size.
13628 (struct vectorlike_header): New type.
eab3844f
PE
13629 (TYPED_PSEUDOVECTORP): New macro, also specifying the C type of the
13630 object, to help avoid aliasing.
13631 (PSEUDOVECTORP): Rewrite in terms of TYPED_PSEUDOVECTORP.
13632 (SUBRP): Likewise, since Lisp_Subr is a special case.
13633 * lisp.h (struct Lisp_Vector, struct Lisp_Char_Table):
13634 (struct Lisp_Sub_Char_Table, struct Lisp_Bool_Vector):
13635 (struct Lisp_Hash_Table): Combine first two members into a single
f904488f 13636 struct vectorlike_header member. All uses of "size" and "next" members
eab3844f
PE
13637 changed to be "header.size" and "header.next".
13638 * buffer.h (struct buffer): Likewise.
13639 * font.h (struct font_spec, struct font_entity, struct font): Likewise.
13640 * frame.h (struct frame): Likewise.
13641 * process.h (struct Lisp_Process): Likewise.
13642 * termhooks.h (struct terminal): Likewise.
13643 * window.c (struct save_window_data, struct saved_window): Likewise.
13644 * window.h (struct window): Likewise.
13645 * alloc.c (allocate_buffer, Fmake_bool_vector, allocate_pseudovector):
13646 Use XSETPVECTYPESIZE, not XSETPVECTYPE, to avoid aliasing problems.
13647 * buffer.c (init_buffer_once): Likewise.
13648 * lread.c (defsubr): Use XSETTYPED_PVECTYPE, since Lisp_Subr is a
13649 special case.
13650 * process.c (Fformat_network_address): Use local var for size,
13651 for brevity.
13652
0df1eac5
PE
13653 * bytecode.c (exec_byte_code): Don't use XVECTOR before CHECK_VECTOR.
13654
847ab9d1 13655 Make the Lisp reader and string-to-float more consistent (Bug#8525)
452f4150
PE
13656 * data.c (atof): Remove decl; no longer used or needed.
13657 (digit_to_number): Move to lread.c.
13658 (Fstring_to_number): Use new string_to_number function, to be
13659 consistent with how the Lisp reader treats infinities and NaNs.
13660 Do not assume that floating-point numbers represent EMACS_INT
13661 without losing information; this is not true on most 64-bit hosts.
13662 Avoid double-rounding errors, by insisting on integers when
13663 parsing non-base-10 numbers, as the documentation specifies.
13664 * lisp.h (string_to_number): New decl, replacing ...
13665 (isfloat_string): Remove.
bc0a5c13 13666 * lread.c: Include <inttypes.h>, for uintmax_t and strtoumax.
d78050d6 13667 (read1): Do not accept +. and -. as integers; this
452f4150
PE
13668 appears to have been a coding error. Similarly, do not accept
13669 strings like +-1e0 as floating point numbers. Do not report
13670 overflow for integer overflows unless the base is not 10 which
13671 means we have no simple and reliable way to continue.
13672 Break out the floating-point parsing into a new
13673 function string_to_number, so that Fstring_to_number parses
13674 floating point numbers consistently with the Lisp reader.
04f2d78b 13675 (digit_to_number): Move here from data.c. Make it static inline.
452f4150
PE
13676 (E_CHAR, EXP_INT): Remove, replacing with ...
13677 (E_EXP): New macro, to solve the "1.0e+" problem mentioned below.
13678 (string_to_number): New function, replacing isfloat_string.
13679 This function checks for valid syntax and produces the resulting
13680 Lisp float number too. Rework it so that string-to-number
bc0a5c13 13681 no longer mishandles examples like "1.0e+". Use strtoumax,
d78050d6
PE
13682 so that overflow for non-base-10 numbers is reported only when
13683 there's no portable and simple way to convert to floating point.
452f4150 13684
67769ffc
PE
13685 * textprop.c (set_text_properties_1): Rewrite for clarity,
13686 and to avoid GCC warning about integer overflow.
13687
c20db43f
PE
13688 * intervals.h (struct interval): Use EMACS_INT for members
13689 where EMACS_UINT might cause problems. See
13690 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html>.
13691 (CHECK_TOTAL_LENGTH): Remove cast to EMACS_INT; no longer needed.
13692 * intervals.c (interval_deletion_adjustment): Now returns EMACS_INT.
13693 All uses changed.
37aa2f85
PE
13694 (offset_intervals): Tell GCC not to worry about length overflow
13695 when negating a negative length.
c20db43f 13696
2538aa2f
PE
13697 * alloc.c (overrun_check_malloc, overrun_check_realloc): Now static.
13698 (overrun_check_free): Likewise.
13699
f2d3008d
PE
13700 * alloc.c (SDATA_SIZE) [!GC_CHECK_STRING_BYTES]: Avoid runtime check
13701 in the common case where SDATA_DATA_OFFSET is a multiple of Emacs
13702 word size.
13703
ec8df744
PE
13704 * gnutls.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13705 (gnutls_make_error): Rename local to avoid shadowing.
13706 (gnutls_emacs_global_deinit): ifdef out; not used.
13707 (Fgnutls_boot): Use const for pointer to readonly storage.
13708 Comment out unused local. Fix pointer signedness problems.
13709
640ee02d
PE
13710 * lread.c (openp): Don't stuff size_t into an 'int'.
13711 Use <= on length, not < on length + 1, to avoid GCC 4.6.0 warning
13712 about possible signed overflow.
13713
6048fb2a
PE
13714 * gtkutil.c: Fix problems found by GCC 4.6.0 on Ubuntu 10.10.
13715 (GDK_KEY_g): Don't define if already defined.
13716 (xg_prepare_tooltip): Avoid pointer signedness problem.
13717 (xg_set_toolkit_scroll_bar_thumb): Redo to avoid two casts.
13718
fa3c87e1
PE
13719 * process.c (Fnetwork_interface_info): Avoid left-shift undefined
13720 behavior with 1 << 31. GCC 4.6.0 warns about this on 32-bit hosts.
13721
2172544b
PE
13722 * xfns.c (Fx_window_property): Simplify a bit,
13723 to make a bit faster and to avoid GCC 4.6.0 warning.
13724 * xselect.c (x_get_window_property, x_handle_dnd_message): Likewise.
13725
9b821a21
PE
13726 * fns.c (internal_equal): Don't assume size_t fits in int.
13727
3c616cfa
PE
13728 * alloc.c (compact_small_strings): Tighten assertion a little.
13729
c2982e87
PE
13730 Replace pEd with more-general pI, and fix some printf arg casts.
13731 * lisp.h (pI): New macro, generalizing old pEd macro to other
13732 conversion specifiers. For example, use "...%"pI"d..." rather
13733 than "...%"pEd"...".
13734 (pEd): Remove. All uses replaced with similar uses of pI.
61bdb816 13735 * m/amdx86-64.h, m/ia64.h, m/ibms390x.h: Likewise.
c2982e87
PE
13736 * alloc.c (check_pure_size): Don't overflow by converting size to int.
13737 * bidi.c (bidi_dump_cached_states): Use pI to avoid cast.
13738 * data.c (Fnumber_to_string): Use pI instead of if-then-else-abort.
13739 * dbusbind.c (xd_append_arg): Use pI to avoid cast.
13740 (Fdbus_method_return_internal, Fdbus_method_error_internal): Likewise.
13741 * font.c (font_unparse_xlfd): Avoid potential buffer overrun on
13742 64-bit hosts.
13743 (font_unparse_xlfd, font_unparse_fcname): Use pI to avoid casts.
13744 * keyboard.c (record_char, modify_event_symbol): Use pI to avoid casts.
13745 * print.c (safe_debug_print, print_object): Likewise.
13746 (print_object): Don't overflow by converting EMACS_INT or EMACS_UINT
13747 to int.
6f04d126
PE
13748 Use pI instead of if-then-else-abort. Use %p to avoid casts,
13749 avoiding the 0 flag, which is not portable.
c2982e87
PE
13750 * process.c (Fmake_network_process): Use pI to avoid cast.
13751 * region-cache.c (pp_cache): Likewise.
13752 * xdisp.c (decode_mode_spec): Likewise.
13753 * xrdb.c (x_load_resources) [USE_MOTIF]: Use pI to avoid undefined
13754 behavior on 64-bit hosts with printf arg.
6f04d126 13755 * xselect.c (x_queue_event): Use %p to avoid casts, avoiding 0 flag.
c2982e87
PE
13756 (x_stop_queuing_selection_requests): Likewise.
13757 (x_get_window_property): Don't truncate byte count to an 'int'
13758 when tracing.
0b432f21 13759
5e073ec7
PE
13760 * frame.c (frame_name_fnn_p): Get rid of strtol, which isn't right
13761 here, since it parses constructs like leading '-' and spaces,
13762 which are not wanted; and it overflows with large numbers.
13763 Instead, simply match F[0-9]+, which is what is wanted anyway.
13764
36372bf9
PE
13765 * alloc.c: Remove unportable assumptions about struct layout.
13766 (SDATA_SELECTOR, SDATA_DATA_OFFSET): New macros.
13767 (SDATA_OF_STRING, SDATA_SIZE, allocate_string_data):
13768 (allocate_vectorlike, make_pure_vector): Use the new macros,
13769 plus offsetof, to remove unportable assumptions about struct layout.
13770 These assumptions hold on all porting targets that I know of, but
13771 they are not guaranteed, they're easy to remove, and removing them
13772 makes further changes easier.
13773
0b432f21
PE
13774 * alloc.c (BLOCK BYTES): Fix typo by changing "ablock" to "ablocks".
13775 This doesn't fix a bug but makes the code clearer.
bfd1c781
PE
13776 (string_overrun_cookie): Now const. Use initializers that
13777 don't formally overflow signed char, to avoid warnings.
000098c1
PE
13778 (allocate_string_data) [GC_CHECK_STRING_OVERRUN]: Fix typo that
13779 can cause Emacs to crash when string overrun checking is enabled.
c7bda33c
PE
13780 (allocate_buffer): Don't assume sizeof (struct buffer) is a
13781 multiple of sizeof (EMACS_INT); it need not be, if
13782 alignof(EMACS_INT) < sizeof (EMACS_INT).
d0f4e1f5 13783 (check_sblock, check_string_bytes, check_string_free_list): Protoize.
0b432f21 13784
895009e1
JB
137852011-04-26 Juanma Barranquero <lekktu@gmail.com>
13786
13787 * keyboard.c (QCrtl): Rename from Qrtl. All uses changed.
13788
6a7a1b0b
TZ
137892011-04-26 Teodor Zlatanov <tzz@lifelogs.com>
13790
13791 * gnutls.c (emacs_gnutls_handshake): Return an error if we're not
b5f869a7 13792 supposed to be handshaking. (Bug#8556)
6a7a1b0b
TZ
13793 Reported by Paul Eggert <eggert@cs.ucla.edu>.
13794
841a1577 137952011-04-26 Daniel Colascione <dan.colascione@gmail.com>
0438ce91
DC
13796
13797 * lisp.h (Qdebug): List symbol.
895009e1 13798 * eval.c (Qdebug): Restore global linkage.
0438ce91
DC
13799 * keyboard.c (debug-on-event): New variable.
13800 (handle_user_signal): Break into debugger when debug-on-event
13801 matches the current signal symbol.
13802
f2d3ba6f
DN
138032011-04-25 Dan Nicolaescu <dann@ics.uci.edu>
13804
13805 * alloc.c (check_sblock, check_string_bytes)
13806 (check_string_free_list): Convert to standard C.
13807
42ce4c63
TZ
138082011-04-25 Teodor Zlatanov <tzz@lifelogs.com>
13809
13810 * w32.c (emacs_gnutls_push): Fix typo.
13811
825cd63c
EZ
138122011-04-25 Eli Zaretskii <eliz@gnu.org>
13813
fb11d64d
EZ
13814 * gnutls.c (emacs_gnutls_handshake): Avoid compiler warnings about
13815 "cast to pointer from integer of different size".
13816
825cd63c
EZ
13817 Improve doprnt and its use in verror. (Bug#8545)
13818 * doprnt.c (doprnt): Document the set of format control sequences
13819 supported by the function. Use SAFE_ALLOCA instead of always
13820 using `alloca'.
13821
13822 * eval.c (verror): Don't limit the buffer size at size_max-1, that
13823 is one byte too soon. Don't use xrealloc; instead xfree and
13824 xmalloc anew.
13825
e061a11b
TZ
138262011-04-24 Teodor Zlatanov <tzz@lifelogs.com>
13827
13828 * gnutls.h: Add GNUTLS_STAGE_CALLBACKS enum to denote we're in the
13829 callbacks stage.
13830
13831 * gnutls.c: Renamed global_initialized to
13832 gnutls_global_initialized. Added internals for the
13833 :verify-hostname-error, :verify-error, and :verify-flags
13834 parameters of `gnutls-boot' and documented those parameters in the
13835 docstring. Start callback support.
9173deec
JB
13836 (emacs_gnutls_handshake): Add Woe32 support. Retry handshake
13837 unless a fatal error occurred. Call gnutls_alert_send_appropriate
13838 on error. Return error code.
e061a11b
TZ
13839 (emacs_gnutls_write): Call emacs_gnutls_handle_error.
13840 (emacs_gnutls_read): Likewise.
13841 (Fgnutls_boot): Return handshake error code.
13842 (emacs_gnutls_handle_error): New function.
13843 (wsaerror_to_errno): Likewise.
13844
13845 * w32.h (emacs_gnutls_pull): Add prototype.
13846 (emacs_gnutls_push): Likewise.
13847
13848 * w32.c (emacs_gnutls_pull): New function for GnuTLS on Woe32.
13849 (emacs_gnutls_push): Likewise.
13850
138512011-04-24 Claudio Bley <claudio.bley@gmail.com> (tiny change)
13852
13853 * process.c (wait_reading_process_output): Check if GnuTLS
13854 buffered some data internally if no FDs are set for TLS
13855 connections.
13856
13857 * makefile.w32-in (OBJ2): Add gnutls.$(O).
13858 (LIBS): Link to USER_LIBS.
13859 ($(BLD)/gnutls.$(0)): New target.
13860
fa6996bc
EZ
138612011-04-24 Eli Zaretskii <eliz@gnu.org>
13862
eb35682e
EZ
13863 * xdisp.c (handle_single_display_spec): Rename the
13864 display_replaced_before_p argument into display_replaced_p, to
13865 make it consistent with the commentary. Fix typos in the
13866 commentary.
13867
e2ad650c
EZ
13868 * textprop.c (syms_of_textprop): Remove dead code.
13869 (copy_text_properties): Delete obsolete commentary about an
13870 interface that was deleted long ago. Fix typos in the description
13871 of arguments.
13872
1b2de274
EZ
13873 * msdos.c (XMenuActivate, XMenuAddSelection): Adjust argument list
13874 to changes in oldXMenu/XMenu.h from 2011-04-16.
13875 <menu_help_message, prev_menu_help_message>: Constify.
13876 (IT_menu_make_room): menu->help_text is now `const char **';
13877 adjust.
13878
13879 * msdos.h (XMenuActivate, XMenuAddSelection): Adjust prototypes
13880 to changes in oldXMenu/XMenu.h from 2011-04-16.
13881 (struct XMenu): Declare `help_text' `const char **'.
13882
13883 * xfaces.c <Qunspecified>: Make extern again.
13884
13885 * syntax.c: Include sys/types.h before including regex.h, as
75f1671a 13886 required by POSIX.
1b2de274 13887
762b15be
EZ
13888 * doc.c (get_doc_string): Improve the format passed to `error'.
13889
13890 * doprnt.c (doprnt): Improve commentary.
13891
13892 * term.c (init_tty) [MSDOS]: Fix 1st argument to maybe_fatal.
13893
13894 * Makefile.in (TAGS): Depend on $(M_FILE) and $(S_FILE), and scan
13895 them with etags.
13896
f1052e5d
EZ
13897 * makefile.w32-in (globals.h): Add a dummy recipe, to make any
13898 changes in globals.h immediately force recompilation.
762b15be
EZ
13899 (TAGS): Depend on $(CURDIR)/m/intel386.h and
13900 $(CURDIR)/s/ms-w32.h.
13901 (TAGS-gmake): Scan $(CURDIR)/m/intel386.h and $(CURDIR)/s/ms-w32.h.
f1052e5d 13902
fa6996bc
EZ
13903 * character.c (Fchar_direction): Function deleted.
13904 (syms_of_character): Don't defsubr it.
13905 <char-direction-table>: Deleted.
13906
e6c3da20
EZ
139072011-04-23 Eli Zaretskii <eliz@gnu.org>
13908
13909 Fix doprnt so it could be used again safely in `verror'. (Bug#8435)
13910 * doprnt.c: Include limits.h.
13911 (SIZE_MAX): New macro.
04f2d78b
CB
13912 (doprnt): Return a size_t value. 2nd arg is now size_t.
13913 Many local variables are now size_t instead of int or unsigned.
e6c3da20
EZ
13914 Improve overflow protection. Support `l' modifier for integer
13915 conversions. Support %l conversion. Don't assume an EMACS_INT
13916 argument for integer conversions and for %c.
13917
13918 * lisp.h (doprnt): Restore prototype.
13919
13920 * makefile.w32-in ($(BLD)/callint.$(O)): Depend on
13921 $(SRC)/character.h.
13922
13923 * Makefile.in (base_obj): Add back doprnt.o.
13924
13925 * deps.mk (doprnt.o): Add back prerequisites.
13926 (callint.o): Depend on character.h.
13927
13928 * eval.c (internal_lisp_condition_case): Include the handler
13929 representation in the error message.
13930 (verror): Call doprnt instead of vsnprintf. Fix an off-by-one bug
13931 when breaking from the loop.
13932
13933 * xdisp.c (vmessage): Call doprnt instead of vsnprintf.
13934
13935 * callint.c (Fcall_interactively): When displaying error message
13936 about invalid control letter, pass the character's codepoint, not
13937 a pointer to its multibyte form. Improve display of the character
13938 in octal and display also its hex code.
13939
13940 * character.c (char_string): Use %x to display the (unsigned)
13941 codepoint of an invalid character, to avoid displaying a bogus
13942 negative value.
13943
13944 * font.c (check_otf_features): Pass SDATA of SYMBOL_NAME to
13945 `error', not SYMBOL_NAME itself.
13946
13947 * coding.c (Fencode_sjis_char, Fencode_big5_char): Use %c for
13948 character arguments to `error'.
13949
13950 * charset.c (check_iso_charset_parameter): Fix incorrect argument
13951 to `error' in error message about FINAL_CHAR argument. Make sure
13952 FINAL_CHAR is a character, and use %c when it is passed as
13953 argument to `error'.
13954
4ffd0d6b 139552011-04-23 Eli Zaretskii <eliz@gnu.org>
97a93095
EZ
13956
13957 * s/ms-w32.h (localtime): Redirect to sys_localtime.
13958
13959 * w32.c: Include <time.h>.
13960 (sys_localtime): New function.
13961
4ffd0d6b 139622011-04-23 Chong Yidong <cyd@stupidchicken.com>
c17819f4
CY
13963
13964 * xdisp.c (init_xdisp): Initialize echo_area_window (Bug#6451).
13965
4ffd0d6b 13966 * buffer.c (syms_of_buffer): Doc fix (Bug#6902).
aac0c6e3 13967
4ffd0d6b 139682011-04-23 Samuel Thibault <sthibault@debian.org> (tiny change)
aac0c6e3 13969
4ffd0d6b
GM
13970 * sysdep.c (wait_for_termination): On GNU Hurd, kill returns -1 on
13971 zombies (Bug#8467).
aac0c6e3 13972
04c56954
EZ
139732011-04-19 Eli Zaretskii <eliz@gnu.org>
13974
13975 * syntax.h (SETUP_SYNTAX_TABLE_FOR_OBJECT): Fix setting of
13976 gl_state.e_property when gl_state.object is Qt.
13977
13978 * insdel.c (make_gap_larger): Remove limitation of buffer size
13979 to <= INT_MAX.
13980
16a43933
CY
139812011-04-18 Chong Yidong <cyd@stupidchicken.com>
13982
13983 * xdisp.c (lookup_glyphless_char_display)
13984 (produce_glyphless_glyph): Handle cons cell entry in
13985 glyphless-char-display.
13986 (Vglyphless_char_display): Document it.
13987
13988 * term.c (produce_glyphless_glyph): Handle cons cell entry in
13989 glyphless-char-display.
13990
4581706e
CY
139912011-04-17 Chong Yidong <cyd@stupidchicken.com>
13992
13993 * xdisp.c (get_next_display_element): Remove unnecessary ifdefs.
13994
13995 * termhooks.h (FRAME_WINDOW_P): Remove duplicated definitions.
13996
13997 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): Add missing
13998 definition for no-X builds.
13999
4887c6e2 140002011-04-16 Paul Eggert <eggert@cs.ucla.edu>
764430a3 14001
fd35b6f9
PE
14002 Static checks with GCC 4.6.0 and non-default toolkits.
14003
5c1ccb01
PE
14004 * s/sol2-6.h, s/unixware.h (PTY_TTY_NAME_SPRINTF): Protoize decl.
14005
006c5daa
PE
14006 * process.c (keyboard_bit_set): Define only if SIGIO.
14007 (send_process_trap): Mark it with NO_RETURN if it doesn't return.
14008 (send_process): Repair possible setjmp clobbering.
14009
efc736d3
PE
14010 * s/usg5-4-common.h (SETUP_SLAVE_PTY): Don't pass extra arg to 'fatal'.
14011
4e2fe2e6
PE
14012 * eval.c: Include <stdio.h>, for vsnprintf on non-GNU/Linux hosts.
14013
f97334a2
PE
14014 * data.c (arith_error): Mark with NO_RETURN if it doesn't return.
14015
4e75f29d
PE
14016 * alloc.c (bytes_used_when_full, SPARE_MEMORY, BYTES_USED):
14017 Define only if needed.
14018
90efadd1
PE
14019 * sysdep.c (_FILE_OFFSET_BITS): Make this hack even uglier
14020 by pacifying GCC about it. Maybe it's time to retire it?
875975e9 14021 * xfaces.c (USG, __TIMEVAL__): Likewise.
90efadd1 14022
3c647824
PE
14023 * dispextern.h (struct redisplay_interface): Rename param
14024 to avoid shadowing.
e264f262 14025 * termhooks.h (struct terminal): Likewise.
761383f4 14026 * xterm.c (xembed_send_message): Likewise.
3c647824 14027
b58c5c4a
PE
14028 * insdel.c (make_gap_smaller): Define only if
14029 USE_MMAP_FOR_BUFFERS || REL_ALLOC || DOUG_LEA_MALLOC.
14030
cad59032
PE
14031 * keyboard.c (read_char): Make a var volatile so longjmp won't clobber
14032 it.
14033
c339dc2e
PE
14034 * emacs.c (MAX_HEAP_BSS_DIFF, my_edata): Move to where they're used,
14035 so that we aren't warned about unused symbols.
14036
91a3e27b
PE
14037 * xfns.c (Fx_file_dialog): Rename local to avoid shadowing.
14038
399c71d3 14039 * xdisp.c (x_produce_glyphs): Mark var as initialized (Bug#8512).
7a3fb125 14040
8ffc96f5
PE
14041 * xfns.c (x_real_positions): Mark locals as initialized.
14042
eef9bc79
PE
14043 * xmenu.c (xmenu_show): Don't use uninitialized vars.
14044
098db9dd
PE
14045 * xterm.c: Fix problems found by static analysis with other toolkits.
14046 (toolkit_scroll_bar_interaction): Define and use only if USE_X_TOOLKIT.
dda3aedd
PE
14047 (x_dispatch_event): Declare static if USE_GTK, and
14048 define if USE_GTK || USE_X_TOOLKIT.
098db9dd 14049 (SET_SAVED_BUTTON_EVENT): Define only if USE_X_TOOLKIT || USE_GTK.
dda3aedd 14050 * xterm.h (x_dispatch_event): Extern only if USE_X_TOOLKIT.
841a1577
JB
14051 * xterm.c, xterm.h (x_mouse_leave): Bring this function back, but only
14052 if defined HAVE_MENUS && !defined USE_X_TOOLKIT && !defined USE_GTK.
098db9dd 14053
eb18f6cc
PE
14054 * xmenu.c (menu_help_callback): Pointer type fixes.
14055 Use const pointers when pointing at readonly data. Avoid pointer
14056 signedness clashes.
14057 (FALSE): Remove unused macro.
14058 (update_frame_menubar): Remove unused decl.
14059
1fe72bf8
PE
14060 * xfns.c (Fx_hide_tip): Move locals to avoid shadowing.
14061
60d9e1db
PE
14062 * menu.c (push_submenu_start, push_submenu_end): Do not define unless
14063 USE_X_TOOLKIT || USE_GTK || HAVE_NS || defined HAVE_NTGUI.
14064 (single_menu_item): Rename local to avoid shadowing.
14065
39261c26
PE
14066 * keyboard.c (make_lispy_event): Remove unused local var.
14067
018c5e19
PE
14068 * frame.c, frame.h (x_get_resource_string): Bring this back, but
14069 only if HAVE_X_WINDOWS && !USE_X_TOOLKIT.
14070
63d2b86e
PE
14071 * bitmaps: Change bitmaps from unsigned char back to the X11
14072 compatible char. Avoid the old compiler warnings about
14073 out-of-range initializers by using, for example, '\xab' rather
14074 than 0xab.
14075
aefd87e1
PE
14076 * xgselect.c (xgselect_initialize): Check vs interface
14077 even if ! (defined (USE_GTK) || defined (HAVE_GCONF)).
14078
bf501fb9
PE
14079 * xmenu.c (xmenu_show): Rename parm to avoid shadowing.
14080
e9829fdf
PE
14081 * xterm.c (x_create_toolkit_scroll_bar): Use const * for pointers
14082 to read-only memory.
14083
1086c095
PE
14084 * fns.c (vector): Remove; this old hack is no longer needed.
14085
2baccd04 14086 * xsmfns.c (create_client_leader_window): Rename shadowing arg.
401f10cb 14087 Remove unused var.
dde42981 14088 (gdk_x11_set_sm_client_id) [!USE_GTK]: Don't define.
2baccd04 14089
72391843 14090 * xrdb.c (x_load_resources): Omit unused local.
3565b346 14091
436c16df 14092 * xfns.c (free_frame_menubar, atof): Remove duplicate decls.
8a94ea33 14093 (x_window): Rename locals to avoid shadowing.
dc5ddd85 14094 (USG): Use the kludged USG macro, to pacify gcc.
436c16df 14095
92bb796d 14096 * xterm.c (x_alloc_nearest_color_for_widget): Remove; unused.
bbbef9e1 14097 (x_term_init): Remove local to avoid shadowing.
92bb796d 14098
764430a3 14099 * xfns.c, xterm.c (_XEditResCheckMessages): Protoize decl.
4887c6e2
PE
14100
14101 * xdisp.c, dispextern.h (set_vertical_scroll_bar): Now extern if
14102 USE_TOOLKIT_SCROLL_BARS && !USE_GTK, as xterm.c needs it then.
14103
d1dfb56c
EZ
141042011-04-16 Eli Zaretskii <eliz@gnu.org>
14105
c4354cb4
EZ
14106 * gnutls.c (Fgnutls_boot): Don't pass Lisp_Object to `error'.
14107
d1dfb56c
EZ
14108 Fix regex.c, syntax.c and friends for buffers > 2GB.
14109 * syntax.h (struct gl_state_s): Declare character position members
14110 EMACS_INT.
14111
14112 * syntax.c (update_syntax_table): Declare 2nd argument EMACS_INT.
14113
04f2d78b
CB
14114 * textprop.c (verify_interval_modification, interval_of):
14115 Declare arguments EMACS_INT.
d1dfb56c
EZ
14116
14117 * intervals.c (adjust_intervals_for_insertion): Declare arguments
14118 EMACS_INT.
14119
14120 * intervals.h (CHECK_TOTAL_LENGTH): Cast to EMACS_INT, not `int'.
14121
14122 * indent.c (Fvertical_motion): Local variable it_start is now
14123 EMACS_INT.
14124
14125 * regex.c (re_match, re_match_2, re_match_2_internal)
14126 (bcmp_translate, regcomp, regexec, print_double_string)
14127 (group_in_compile_stack, re_search, re_search_2, regex_compile)
14128 (re_compile_pattern, re_exec): Declare arguments and local
14129 variables `size_t' and `ssize_t' and return values `regoff_t', as
14130 appropriate.
14131 (POP_FAILURE_REG_OR_COUNT) <pfreg>: Declare `long'.
14132 (CHECK_INFINITE_LOOP) <failure>: Declare `ssize_t'.
14133 <compile_stack_type>: `size' and `avail' are now `size_t'.
14134
14135 * regex.h <regoff_t>: Use ssize_t, not int.
14136 (re_search, re_search_2, re_match, re_match_2): Arguments that
14137 specify buffer/string position and length are now ssize_t and
14138 size_t. Return type is regoff_t.
14139
613052cd
BK
141402011-04-16 Ben Key <bkey76@gmail.com>
14141
14142 * nsfont.m: Fixed bugs in ns_get_family and
14143 ns_descriptor_to_entity that were caused by using free to
14144 deallocate memory blocks that were allocated by xmalloc (via
14145 xstrdup). This caused Emacs to crash when compiled with
14146 XMALLOC_OVERRUN_CHECK defined (when Emacs was configured with
14147 --enable-checking=xmallocoverrun). xfree is now used to
14148 deallocate these memory blocks.
14149
4170f62f 141502011-04-15 Paul Eggert <eggert@cs.ucla.edu>
3e047f51 14151
71b41406
PE
14152 * sysdep.c (emacs_read): Remove unnecessary check vs MAX_RW_COUNT.
14153
9587a89d
PE
14154 emacs_write: Accept and return EMACS_INT for sizes.
14155 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00514.html
14156 et seq.
14157 * gnutls.c, gnutls.h (emacs_gnutls_read, emacs_gnutls_write):
14158 Accept and return EMACS_INT.
14159 (emacs_gnutls_write): Return the number of bytes written on
14160 partial writes.
14161 * sysdep.c, lisp.h (emacs_read, emacs_write): Likewise.
273a5f82
PE
14162 (emacs_read, emacs_write): Remove check for negative size, as the
14163 Emacs source code has been audited now.
9587a89d
PE
14164 * sysdep.c (MAX_RW_COUNT): New macro, to work around kernel bugs.
14165 (emacs_read, emacs_write): Use it.
273a5f82
PE
14166 * process.c (send_process): Adjust to the new signatures of
14167 emacs_write and emacs_gnutls_write. Do not attempt to store
14168 a byte offset into an 'int'; it might overflow.
9587a89d 14169 See http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00483.html
273a5f82 14170
3e047f51
PE
14171 * sound.c: Don't assume sizes fit in 'int'.
14172 (struct sound_device.period_size, alsa_period_size):
9c3c56a7 14173 Return EMACS_INT, not int.
3e047f51 14174 (struct sound_device.write, vox_write, alsa_write):
9c3c56a7
PE
14175 Accept EMACS_INT, not int.
14176 (wav_play, au_play): Use EMACS_INT to store sizes and to
3e047f51
PE
14177 record read return values.
14178
cc39a9db
BK
141792011-04-15 Ben Key <bkey76@gmail.com>
14180
c9d0ec6d
JB
14181 * keyboard.c (Qundefined): Don't declare static since it is used
14182 in nsfns.m.
14183 * xfaces.c (Qbold, Qexpanded, Qitalic, Qcondensed): Don't declare
14184 static since they are used in nsfont.m.
cc39a9db 14185
6c60eb9f
SM
141862011-04-15 Stefan Monnier <monnier@iro.umontreal.ca>
14187
14188 * process.c (Qprocessp): Don't declare static.
14189 * lisp.h (Qprocessp): Declare again.
14190
7990b61a
JB
141912011-04-15 Juanma Barranquero <lekktu@gmail.com>
14192
14193 * font.c (Qopentype): Don't make static (used from w32uniscribe.c).
14194
5d4cb038
PE
141952011-04-14 Paul Eggert <eggert@cs.ucla.edu>
14196
8bd7b830 14197 Improve C-level modularity by making more things 'static'.
cd64ea1d 14198
e3b27b31
PE
14199 Don't publish debugger-only interfaces to other modules.
14200 * lisp.h (safe_debug_print, debug_output_compilation_hack):
14201 (verify_bytepos, count_markers): Move decls to the only modules
14202 that need them.
14203 * region-cache.h (pp_cache): Likewise.
14204 * window.h (check_all_windows): Likewise.
14205 * marker.c, print.c, region-cache.c, window.c: Decls moved here.
14206
5d4cb038
PE
14207 * sysdep.c (croak): Now static, if
14208 defined TIOCNOTTY || defined USG5 || defined CYGWIN.
14209 * syssignal.h (croak): Declare only if not static.
69003fd8
PE
14210
14211 * alloc.c (refill_memory_reserve): Now static if
14212 !defined REL_ALLOC || defined SYSTEM_MALLOC.
14213 * lisp.h (refill_memory_reserve): Declare only if not static.
93ea6e8f 14214
e87b6180
PE
14215 * xsettings.c, xsettings.h (xsettings_get_system_normal_font):
14216 Define only if USE_LUCID.
14217
ac64929e
PE
14218 * xrdb.c (x_customization_string, x_rm_string): Now static.
14219
6f37259d
PE
14220 * xmenu.c (x_menu_wait_for_event): Export only if USE_MOTIF.
14221 * xterm.h (x_menu_wait_for_event): Declare only if USE_MOTIF.
14222
1683e3ab
PE
14223 * xdisp.c (draw_row_with_mouse_face): Now static.
14224 * dispextern.h (draw_row_with_mouse_fave): Remove decl.
14225
de9c2632
PE
14226 * window.h (check_all_windows): Mark externally visible.
14227
2b96acb7
PE
14228 * window.c (window_deletion_count): Now static.
14229
14230 * undo.c: Make symbols static if they're not exported.
14231 (last_undo_buffer, last_boundary_position, pending_boundary):
14232 Now static.
14233
50436f33
PE
14234 * textprop.c (interval_insert_behind_hooks): Now static.
14235 (interval_insert_in_front_hooks): Likewise.
14236
64520e5c
PE
14237 * term.c: Make symbols static if they're not exported.
14238 (tty_turn_off_highlight, get_tty_terminal, max_frame_cols):
14239 (max_frame_lines, tty_set_terminal_modes):
14240 (tty_reset_terminal_modes, tty_turn_off_highlight):
14241 (get_tty_terminal): Now static.
14242 (term_mouse_moveto): Do not define if HAVE_WINDOW_SYSTEM.
14243 * termhooks.h (term_mouse_moveto): Do not declare if
8bd7b830 14244 HAVE_WINDOW_SYSTEM.
64520e5c
PE
14245 * dispextern.h (tty_set_terminal_modes, tty_reset_terminal_modes):
14246 (tty_turn_off_highlight, get_tty_terminal): Remove decls.
14247
1fa53021
PE
14248 * sysdep.c: Make symbols static if they're not exported.
14249 (emacs_get_tty, emacs_set_tty, old_fcntl_flags, old_fcntl_owner):
14250 Now static.
14251 (sigprocmask_set, full_mask): Remove; unused.
14252 (wait_debugging): Mark as visible.
14253 * syssignal.h (SIGFULLMASK, full_mask): Remove decls.
14254 * systty.h (emacs_get_tty, emacs_set_tty): Remove decls.
14255
d4b43b22
PE
14256 * syntax.c (syntax_temp): Define only if !__GNUC__.
14257
b7c513d0
PE
14258 * sound.c (current_sound_device, current_sound): Now static.
14259
989b29ad
PE
14260 * search.c (searchbufs, searchbuf_head): Now static.
14261
13a55a78
PE
14262 * scroll.c (scroll_cost): Remove; unused.
14263 * dispextern.h (scroll_cost): Remove decl.
14264
de68a1fc
PE
14265 * region-cache.h (pp_cache): Mark as externally visible.
14266
40ccffa6
PE
14267 * process.c: Make symbols static if they're not exported.
14268 (process_tick, update_tick, create_process, chan_process):
14269 (Vprocess_alist, proc_buffered_char, datagram_access):
14270 (fd_callback_data, send_process_frame, process_sent_to): Now static.
14271 (deactivate_process): Mark defn as static, as well as decl.
14272 * lisp.h (create_process): Remove decl.
14273 * process.h (chan_process, Vprocess_alist): Remove decls.
14274
ad64fc97
PE
14275 * print.c: Make symbols static if they're not exported.
14276 (print_depth, new_backquote_output, being_printed, print_buffer):
14277 (print_buffer_size, print_buffer_pos, print_buffer_pos_byte):
14278 (print_interval, print_number_index, initial_stderr_stream):
14279 Now static.
14280 * lisp.h (Fprinc): Remove decl.
14281 (debug_output_compilation_hack): Mark as externally visible.
14282
adddb265
PE
14283 * sysdep.c (croak): Move decl from here to syssignal.h.
14284 * syssignal.h (croak): Put it here, so the API can be checked when
14285 'croak' is called from dissociate_if_controlling_tty.
14286
1717ede2
PE
14287 * minibuf.c: Make symbols static if they're not exported.
14288 (minibuf_save_list, choose_minibuf_frame): Now static.
14289 * lisp.h (choose_minibuf_frame): Remove decl.
14290
fa5fb2bc
PE
14291 * lisp.h (verify_bytepos, count_markers): Mark as externally visible.
14292
1e3890d1
PE
14293 * lread.c: Make symbols static if they're not exported.
14294 (read_objects, initial_obarray, oblookup_last_bucket_number):
14295 Now static.
14296 (make_symbol): Remove; unused.
14297 * lisp.h (initial_obarray, make_symbol): Remove decls.
14298
8a1414fa
PE
14299 * keyboard.c: Make symbols static if they're not exported.
14300 (single_kboard, recent_keys_index, total_keys, recent_keys):
14301 (this_command_key_count_reset, raw_keybuf, raw_keybuf_count):
14302 (this_single_command_key_start, echoing, last_auto_save):
14303 (read_key_sequence_cmd, dribble, recursive_edit_unwind):
14304 (command_loop, echo_now, keyboard_init_hook, help_char_p):
14305 (quit_throw_to_read_char, command_loop_2, top_level_1, poll_timer):
14306 (Vlispy_mouse_stem, double_click_count):
14307 Now static.
14308 (force_auto_save_soon): Define only if SIGDANGER.
14309 (ignore_mouse_drag_p): Now static if
14310 !defined HAVE_WINDOW_SYSTEM || defined USE_GTK || defined HAVE_NS.
14311 (print_help): Remove; unused.
14312 (stop_character, last_timer_event): Mark as externally visible.
14313 * keyboard.h (ignore_mouse_drag_p): Declare only if
14314 defined HAVE_WINDOW_SYSTEM && !defined USE_GTK && !defined HAVE_NS.
14315 (echo_now, help_char_p, quit_throw_to_read_char): Remove decls.
14316 * lisp.h (echoing): Remove decl.
14317 (force_auto_save_soon): Declare only if SIGDANGER.
14318 * xdisp.c (redisplay_window): Simplify code, to make it more
14319 obvious that ignore_mouse_drag_p is not accessed if !defined
14320 USE_GTK && !defined HAVE_NS.
14321
93ea6e8f
PE
14322 * intervals.c: Make symbols static if they're not exported.
14323 (merge_properties_sticky, merge_interval_right, delete_interval):
14324 Now static.
14325 * intervals.h (merge_interval_right, delete_interval): Remove decls.
14326
77382fcc
PE
14327 * insdel.c: Make symbols static if they're not exported.
14328 However, leave prepare_to_modify_buffer alone. It's never
14329 called from outside this function, but that appears to be a bug.
14330 (combine_after_change_list, combine_after_change_buffer):
4889fc82 14331 (adjust_after_replace, signal_before_change): Now static.
77382fcc
PE
14332 (adjust_after_replace_noundo): Remove; unused.
14333 * lisp.h (adjust_after_replace, adjust_after_replace_noundo):
4889fc82 14334 (signal_before_change): Remove decls.
77382fcc 14335
9306c32e
PE
14336 * indent.c (val_compute_motion, val_vmotion): Now static.
14337
cd44d2eb
PE
14338 * image.c: Make symbols static if they're not exported.
14339 * dispextern.h (x_create_bitmap_from_xpm_data): Do not declare
14340 if USE_GTK.
14341 * image.c (x_create_bitmap_from_xpm_data): Do not define if USE_GTK.
14342 (xpm_color_cache, ct_table, ct_colors_allocated): Now static.
14343
ad9a7a06
PE
14344 * fringe.c (standard_bitmaps): Now static.
14345 (max_used_fringe_bitmap): Now static, unless HAVE_NS.
14346
81626931
PE
14347 * frame.c: Make symbols static if they're not exported.
14348 (x_report_frame_params, make_terminal_frame): Now static.
14349 (get_frame_param): Now static, unless HAVE_NS.
14350 (x_fullscreen_adjust): Define if WINDOWSNT, not if HAVE_WINDOW_SYSTEM.
14351 (x_get_resource_string): Remove; not used.
14352 * frame.h (make_terminal_frame, x_report_frame_params):
14353 (x_get_resource_string); Remove decls.
14354 (x_fullscreen_adjust): Declare only if WINDOWSNT.
14355 * lisp.h (get_frame_param): Declare only if HAVE_NS.
14356
239f9db9
PE
14357 * font.c, fontset.c: Make symbols static if they're not exported.
14358 * dispextern.h (FACE_SUITABLE_FOR_ASCII_CHAR_P): New macro.
14359 (FACE_SUITABLE_FOR_CHAR_P): Use it.
14360 * font.c (font_close_object): Now static.
14361 * font.h (font_close_object): Remove.
14362 * fontset.c (FONTSET_OBJLIST): Remove.
14363 (free_realized_fontset) #if-0 the body, which does nothing.
14364 (face_suitable_for_char_p): #if-0, as it's never called.
14365 * fontset.h (face_suitable_for_char_p): Remove decl.
04f2d78b
CB
14366 * xfaces.c (face_at_string_position):
14367 Use FACE_SUITABLE_FOR_ASCII_CHAR_P, not FACE_SUITABLE_FOR_CHAR_P,
239f9db9
PE
14368 since 0 is always ASCII.
14369
dfcf3579
PE
14370 * fns.c (weak_hash_tables): Now static.
14371
5045092b
PE
14372 * fileio.c: Make symbols static if they're not exported.
14373 (auto_saving, auto_save_mode_bits, auto_save_error_occurred):
14374 (Vwrite_region_annotation_buffers): Now static.
14375
57a96f5c
PE
14376 * eval.c: Make symbols static if they're not exported.
14377 (backtrace_list, lisp_eval_depth, when_entered_debugger): Now static.
14378 * lisp.h (backtrace_list): Remove decl.
14379
35f08c38
PE
14380 * emacs.c: Make symbols static if they're not exported.
14381 (malloc_state_ptr, malloc_using_checking, syms_of_emacs):
14382 (fatal_error_code, fatal_error_signal_hook, standard_args):
14383 Now static.
14384 (fatal_error_signal): Now static, unless FLOAT_CATCH_SIGKILL.
14385 (DEFINE_DUMMY_FUNCTION): Mark function as externally visible.
14386 (__CTOR_LIST__, __DTOR_LIST__): Now externally visible.
14387 * lisp.h (fatal_error_signal_hook): Remove decl.
14388 (fatal_error_signal): Declare only if FLOAT_CATCH_SIGKILL.
14389
f44bd759
PE
14390 * editfns.c: Move a (normally-unused) function to its only use.
14391 * editfns.c, lisp.h (get_operating_system_release): Remove.
14392 * process.c (init_process) [DARWIN_OS]: Do it inline, as it is not
14393 worth the hassle of breaking this out.
14394
b532497d
PE
14395 * xterm.c: Make symbols static if they're not exported.
14396 (x_raise_frame, x_lower_frame, x_wm_set_window_state):
14397 (x_wm_set_icon_pixmap, x_initialize, XTread_socket_fake_io_error):
14398 (x_destroy_window, x_delete_display):
14399 Now static.
14400 (x_dispatch_event): Now static if ! (USE_MOTIF || USE_X_TOOLKIT).
14401 (x_mouse_leave): Remove; unused.
14402 * xterm.h (x_display_info_for_name, x_raise_frame, x_lower_frame):
14403 (x_destroy_window, x_wm_set_window_state, x_wm_set_icon_pixmap):
14404 (x_delete_display, x_initialize, x_set_border_pixel, x_screen_planes):
14405 Remove decls.
14406 (x_mouse_leave): Declare only if WINDOWSNT.
14407 (x_dispatch_event): Declare only if USE_MOTIF or USE_X_TOOLKIT.
14408 (xic_create_fontsetname): Declare only if HAVE_X_WINDOWS &&
14409 USE_X_TOOLKIT.
14410
1675728f
PE
14411 * ftxfont.c: Make symbols static if they're not exported.
14412 (ftxfont_driver): Export only if !defined HAVE_XFT && def8ined
14413 HAVE_FREETYPE.
14414 * font.h (ftxfont_driver): Likewise.
14415
e4cebfca
PE
14416 * xfns.c: Make symbols static if they're not exported.
14417 (x_last_font_name, x_display_info_for_name):
14418 (x_set_foreground_color, x_set_background_color, x_set_mouse_color):
14419 (x_set_cursor_color, x_set_border_pixel, x_set_border_color):
14420 (x_set_cursor_type, x_set_icon_type, x_set_icon_name):
14421 (x_set_scroll_bar_foreground, x_set_scroll_bar_background):
14422 (x_explicitly_set_name, x_set_title, xic_defaut_fontset, tip_timer):
14423 (last_show_tip_args): Now static.
14424 (xic_defaut_fontset, xic_create_fontsetname): Define only if
14425 defined HAVE_X_WINDOWS && defined USE_X_TOOLKIT
14426 (x_screen_planes): Remove; unused.
14427 * dispextern.h (x_screen_planes): Remove decl.
14428
5bf46f05
PE
14429 * dispnew.c: Make symbols static if they're not exported.
14430 * dispextern.h (redraw_garbaged_frames, scrolling):
14431 (increment_row_positions): Remove.
14432 * dispnew.c (new_glyph_matrix, increment_row_positions, scrolling):
14433 (delayed_size_change, glyph_matrix_count, glyph_pool_count):
14434 Now static.
14435 (redraw_garbaged_frames): Remove; unused.
14436
435f4c28
PE
14437 * xfaces.c: Make symbols static if they're not exported.
14438 * dispextern.h (ascii_face_of_lisp_face, free_realized_face):
14439 Remove decls.
14440 * xterm.h (defined_color): Remove decls.
14441 (x_free_dpy_colors): Declare only if USE_X_TOOLKIT.
14442 * xfaces.c (tty_suppress_bold_inverse_default_colors_p):
14443 (menu_face_changed_default, defined_color, free_realized_face):
14444 (x_free_dpy_colors): Define only if USE_X_TOOLKIT.
14445 (ascii_face_of_lisp_face): Remove; unused.
14446
8524aef3
PE
14447 * xdisp.c: Make symbols static if they're not exported.
14448 * dispextern.h (scratch_glyph_row, window_box_edges):
14449 (glyph_to_pixel_coords, set_cursor_from_row):
14450 (get_next_display_element, set_iterator_to_next):
14451 (highlight_trailing_whitespace, frame_to_window_pixel_xy):
14452 (show_mouse_face): Remove decls
14453 * frame.h (message_buf_print): Likewise.
14454 * lisp.h (pop_message, set_message, check_point_in_composition):
14455 Likewise.
14456 * xterm.h (set_vertical_scroll_bar): Likewise.
14457 * xdisp.c (list_of_error, Vmessage_stack, line_number_displayed):
14458 (message_buf_print, scratch_glyph_row, displayed_buffer):
14459 (set_iterator_to_next, pop_message, set_message, set_cursor_from_row):
14460 (get_next_display_element, show_mouse_face, window_box_edges):
14461 (frame_to_window_pixel_xy, check_point_in_composition):
14462 (set_vertical_scroll_bar, highlight_trailing_whitespace): Now static.
14463 (glyph_to_pixel_coords): Remove; unused.
14464
16390cd2
PE
14465 * dired.c (file_name_completion): Now static.
14466
14467 * dbusbind.c (xd_in_read_queued_messages): Now static.
14468
a25f4dfa
PE
14469 * lisp.h (circular_list_error, FOREACH): Remove; unused.
14470 * data.c (circular_list_error): Remove.
14471
14a9c8df
PE
14472 * commands.h (last_point_position, last_point_position_buffer):
14473 (last_point_position_window): Remove decls.
14474 * keyboard.c: Make these variables static.
14475
04f2d78b
CB
14476 * coding.h (coding, code_convert_region, encode_coding_gap):
14477 Remove decls.
74ab6df5
PE
14478 * coding.c (Vsjis_coding_system, Vbig5_coding_system):
14479 (iso_code_class, detect_coding, code_convert_region): Now static.
14480 (encode_coding_gap): Remove; unused.
14481
38dfbee1
PE
14482 * chartab.c (chartab_chars, chartab_bits): Now static.
14483
a2cb4e63
PE
14484 * charset.h (charset_iso_8859_1): Remove decl.
14485 * charset.c (charset_iso_8859_1, charset_emacs, map_charset_for_dump):
14486 Now static.
14487
127198fd
PE
14488 * ccl.h (check_ccl_update, Vccl_program_table): Remove decls.
14489 * ccl.c (Vccl_program_table): Now static.
14490 (check_ccl_update): Remove; unused.
14491
d85b608f
PE
14492 * category.c (SET_CATEGORY_SET, set_category_set): Move here.
14493 * category.h: ... from here.
14494 * category.c (check_category_table, set_category_set): Now static.
14495
31cd66f3
PE
14496 * casetab.c (Vascii_upcase_table, Vascii_eqv_table): Now static.
14497 * lisp.h: Remove these decls.
14498
c358e587
PE
14499 * buffer.c (buffer_count): Remove unused var.
14500
e78aecca
PE
14501 * bidi.c (bidi_dump_cached_states): Mark as externally visible,
14502 so that it's not optimized away.
14503 (bidi_ignore_explicit_marks_for_paragraph_level): Likewise.
14504 * dispextern.h (bidi_dump_cached_states): Remove, since it's
14505 exported only to the debugger.
14506
e192d7d3 14507 * atimer.c (alarm_signal_handler, run_all_atimers): Now static.
04f2d78b 14508 * atimer.h (run_all_atimers): Remove; not exported.
e192d7d3 14509
92470028
PE
14510 font.c: Make copy_font_spec and merge_font_spec ordinary C functions.
14511 * font.c (copy_font_spec): Rename from Fcopy_font_spec, since it
14512 was inaccessible from Lisp.
14513 (merge_font_spec): Likewise, renaming from Fmerge_font_spec.
14514 * font.c, font.h, fontset.c, xfaces.c, xfont.c: Change all uses.
14515
244ed907
PE
14516 alloc.c: Import and export fewer symbols, and remove unused items.
14517 * lisp.h (suppress_checking, die): Declare only if ENABLE_CHECKING
14518 is defined.
14519 (suppress_checking): Add EXTERNALLY_VISIBLE attribute, so that
14520 it's not optimized away by whole-program optimization.
14521 (message_enable_multibyte, free_misc): Remove.
14522 (catchlist, handlerlist, mark_backtrace):
14523 Declare only if BYTE_MARK_STACK.
14524 (mark_byte_stack): Likewise, fixing a ifdef-vs-if typo.
14525 * alloc.c (pure): Export only if VIRT_ADDR_VARIES is defined.
14526 (message_enable_multibyte): Remove decl.
14527 (free_misc, interval_free_list, float_block, float_block_index):
14528 (n_float_blocks, float_free_list, cons_block, cons_block_index):
14529 (cons_free_list, last_marked_index):
14530 Now static.
14531 (suppress_checking, die): Define only if ENABLE_CHECKING is defined.
14532 * eval.c (catchlist, handlerlist): Export only if BYTE_MARK_STACK.
14533 (mark_backtrace): Define only if BYTE_MARK_STACK.
14534 * xdisp.c (message_enable_multibyte): Now static.
14535
61c2b50e 14536 Declare Lisp_Object Q* variables to be 'static' if not exported.
955cbe7b
PE
14537 This makes it easier for human readers (and static analyzers)
14538 to see whether these variables are used from other modules.
14539 * alloc.c, buffer.c, bytecode.c, callint.c, casetab.c, category.c:
14540 * ccl.c, character.c, charset.c, cmds.c, coding.c, composite.c:
14541 * data.c, dbusbind.c, dired.c, editfns.c, eval.c, fileio.c, fns.c:
14542 * font.c, frame.c, fringe.c, ftfont.c, image.c, keyboard.c, keymap.c:
14543 * lread.c, macros.c, minibuf.c, print.c, process.c, search.c:
14544 * sound.c, syntax.c, textprop.c, window.c, xdisp.c, xfaces.c, xfns.c:
14545 * xmenu.c, xselect.c:
14546 Declare Q* vars static if they are not used in other modules.
14547 * ccl.h, character.h, charset.h, coding.h, composite.h, font.h:
14548 * frame.h, intervals.h, keyboard.h, lisp.h, process.h, syntax.h:
14549 Remove decls of unexported vars.
14550 * keyboard.h (EVENT_HEAD_UNMODIFIED): Remove now-unused macro.
14551
95c82688
PE
14552 * lisp.h (DEFINE_FUNC): Make sname 'static'.
14553
16a97296
PE
14554 Make Emacs functions such as Fatom 'static' by default.
14555 This makes it easier for human readers (and static analyzers)
14556 to see whether these functions can be called from other modules.
14557 DEFUN now defines a static function. To make the function external
14558 so that it can be used in other C modules, use the new macro DEFUE.
8bd7b830
PE
14559 * lisp.h (Funibyte_char_to_multibyte, Fsyntax_table_p):
14560 (Finit_image_library):
16a97296
PE
14561 (Feval_region, Fbacktrace, Ffetch_bytecode, Fswitch_to_buffer):
14562 (Ffile_executable_p, Fmake_symbolic_link, Fcommand_execute):
14563 (Fget_process, Fdocumentation_property, Fbyte_code, Ffile_attributes):
14564 Remove decls, since these functions are now static.
14565 (Funintern, Fget_internal_run_time): New decls, since these functions
14566 were already external.
95c82688 14567
16a97296
PE
14568 * alloc.c, buffer.c, callint.c, callproc.c, casefiddle.c, casetab.c:
14569 * ccl.c, character.c, chartab.c, cmds.c, coding.c, data.c, dispnew.c:
14570 * doc.c, editfns.c, emacs.c, eval.c, fileio.c, filelock.c, floatfns.c:
14571 * fns.c, font.c, fontset.c, frame.c, image.c, indent.c:
14572 * keyboard.c, keymap.c, lread.c:
14573 * macros.c, marker.c, menu.c, minibuf.c, print.c, process.c, search.c:
14574 * syntax.c, term.c, terminal.c, textprop.c, undo.c:
14575 * window.c, xdisp.c, xfaces.c, xfns.c, xmenu.c, xsettings.c:
14576 Mark functions with DEFUE instead of DEFUN,
14577 if they are used in other modules.
14578 * buffer.c (Fset_buffer_major_mode, Fdelete_overlay): New forward
14579 decls for now-static functions.
14580 * buffer.h (Fdelete_overlay): Remove decl.
14581 * callproc.c (Fgetenv_internal): Mark as internal.
14582 * composite.c (Fremove_list_of_text_properties): Remove decl.
14583 (Fcomposition_get_gstring): New forward static decl.
14584 * composite.h (Fcomposite_get_gstring): Remove decl.
14585 * dired.c (Ffile_attributes): New forward static decl.
14586 * doc.c (Fdocumntation_property): New forward static decl.
14587 * eval.c (Ffetch_bytecode): New forward static decl.
14588 (Funintern): Remove extern decl; now in .h file where it belongs.
14589 * fileio.c (Fmake_symbolic_link): New forward static decl.
14590 * image.c (Finit_image_library): New forward static decl.
14591 * insdel.c (Fcombine_after_change_execute): Make forward decl static.
14592 * intervals.h (Fprevious_property_change):
14593 (Fremove_list_of_text_properties): Remove decls.
14594 * keyboard.c (Fthis_command_keys): Remove decl.
14595 (Fcommand_execute): New forward static decl.
14596 * keymap.c (Flookup_key): New forward static decl.
14597 (Fcopy_keymap): Now static.
14598 * keymap.h (Flookup_key): Remove decl.
14599 * process.c (Fget_process): New forward static decl.
14600 (Fprocess_datagram_address): Mark as internal.
14601 * syntax.c (Fsyntax_table_p): New forward static decl.
14602 (skip_chars): Remove duplicate decl.
14603 * textprop.c (Fprevious_property_change): New forward static decl.
14604 * window.c (Fset_window_fringes, Fset_window_scroll_bars):
14605 Now internal.
14606 (Fset_window_margins, Fset_window_vscroll): New forward static decls.
14607 * window.h (Fset_window_vscroll, Fset_window_margins): Remove decls.
14608
785bbd42
PE
14609 * editfns.c (Fformat): Remove unreachable code.
14610
8b913b57
AS
146112011-04-14 Andreas Schwab <schwab@linux-m68k.org>
14612
14613 * fileio.c (Finsert_file_contents): Fix typo in 2005-05-13
14614 change. (Bug#8496)
14615
a6744a35
EZ
146162011-04-13 Eli Zaretskii <eliz@gnu.org>
14617
14618 * xdisp.c (handle_invisible_prop): Don't call bidi_paragraph_init
14619 when at ZV. (Bug#8487)
14620
e7974947
AS
146212011-04-12 Andreas Schwab <schwab@linux-m68k.org>
14622
baad03f0
AS
14623 * charset.c (Fclear_charset_maps): Use xfree instead of free.
14624 (Bug#8437)
14625 * keyboard.c (parse_tool_bar_item): Likewise.
14626 * sound.c (sound_cleanup, alsa_close): Likewise.
14627 * termcap.c (tgetent): Likewise.
14628 * xfns.c (x_default_font_parameter): Likewise.
14629 * xsettings.c (read_and_apply_settings): Likewise.
14630
e7974947
AS
14631 * alloc.c (overrun_check_malloc, overrun_check_realloc)
14632 (overrun_check_free): Protoize.
14633
28272684
PE
146342011-04-12 Paul Eggert <eggert@cs.ucla.edu>
14635
14636 * sysdep.c (emacs_read, emacs_write): Check for negative sizes
14637 since callers should never pass a negative size.
14638 Change the signature to match that of plain 'read' and 'write'; see
14639 <http://lists.gnu.org/archive/html/emacs-devel/2011-04/msg00397.html>.
14640 * lisp.h: Update prototypes of emacs_write and emacs_read.
14641
11997c76
EZ
146422011-04-11 Eli Zaretskii <eliz@gnu.org>
14643
14644 * xdisp.c (redisplay_window): Don't try to determine the character
14645 position of the scroll margin if the window start point w->startp
e896f03c 14646 is outside the buffer's accessible region. (Bug#8468)
11997c76 14647
8a2cbd72
EZ
146482011-04-10 Eli Zaretskii <eliz@gnu.org>
14649
14650 Fix write-region and its subroutines for buffers > 2GB.
14651 * fileio.c (a_write, e_write): Modify declaration of arguments and
14652 local variables to support buffers larger than 2GB.
14653 (Fcopy_file): Use EMACS_INT for return value of emacs_read.
14654
14655 * sysdep.c (emacs_write, emacs_read): Use ssize_t for last
14656 argument, local variables, and return value.
14657
14658 * lisp.h: Update prototypes of emacs_write and emacs_read.
14659
14660 * sound.c (vox_write): Use ssize_t for return value of emacs_write.
14661
4073e537 146622011-04-10 Paul Eggert <eggert@cs.ucla.edu>
eb3f1cc8 14663
1ebfdcb6
PE
14664 * xdisp.c (vmessage): Use memchr, not strnlen, which some hosts lack.
14665
b2ded58d
PE
14666 Fix more problems found by GCC 4.6.0's static checks.
14667
7d66342c
PE
14668 * xdisp.c (vmessage): Use a better test for character truncation.
14669
bbf47d44
PE
14670 * charset.c (load_charset_map): <, not <=, for optimization,
14671 and to avoid potential problems with integer overflow.
9248994d 14672 * chartab.c (sub_char_table_set_range, char_table_set_range): Likewise.
f9a68bc5 14673 * casetab.c (set_identity, shuffle): Likewise.
3ab1c7ce 14674 * editfns.c (Fformat): Likewise.
1e69125e 14675 * syntax.c (skip_chars): Likewise.
3befa583 14676
e3019616
PE
14677 * xmenu.c (set_frame_menubar): Allocate smaller local vectors.
14678 This also lets GCC 4.6.0 generate slightly better loop code.
14679
becfa255
PE
14680 * callint.c (Fcall_interactively): <, not <=, for optimization.
14681 (Fcall_interactively): Count the number of arguments produced,
14682 not the number of arguments given. This is simpler and lets GCC
14683 4.6.0 generate slightly better code.
14684
dae0cd48
PE
14685 * ftfont.c: Distingish more carefully between FcChar8 and char.
14686 The previous code passed unsigned char * to a functions like
14687 strlen and xstrcasecmp that expect char *, which does not
14688 conform to the C standard.
14689 (get_adstyle_property, ftfont_pattern_entity): Use FcChar8 for
14690 arguments to FcPatternGetString, and explicitly cast FcChar8 * to
14691 char * when the C standard requires it.
14692
76032d70
PE
14693 * keyboard.c (read_char): Remove unused var.
14694
eb3f1cc8
PE
14695 * eval.c: Port to Windows vsnprintf (Bug#8435).
14696 Include <limits.h>.
14697 (SIZE_MAX): Define if the headers do not.
14698 (verror): Do not give up if vsnprintf returns a negative count.
14699 Instead, grow the buffer. This ports to Windows vsnprintf, which
14700 does not conform to C99. Problem reported by Eli Zaretskii.
14701 Also, simplify the allocation scheme, by avoiding the need for
14702 calling realloc, and removing the ALLOCATED variable.
14703
70476b54
PE
14704 * eval.c (verror): Initial buffer size is 4000 (not 200) bytes.
14705
12020a9e
PE
14706 Remove invocations of doprnt, as Emacs now uses vsnprintf.
14707 But keep the doprint source code for now, as we might revamp it
14708 and use it again (Bug#8435).
ea6c7ae6
PE
14709 * lisp.h (doprnt): Remove.
14710 * Makefile.in (base_obj): Remove doprnt.o.
14711 * deps.mk (doprnt.o): Remove.
14712
5fdb398c
PE
14713 error: Print 32- and 64-bit integers portably (Bug#8435).
14714 Without this change, on typical 64-bit hosts error ("...%d...", N)
14715 was used to print both 32- and 64-bit integers N, which relied on
14716 undefined behavior.
61bdb816 14717 * lisp.h, m/amdx86-64.h, m/ia64.h, m/ibms390x.h (pEd): New macro.
5fdb398c
PE
14718 * lisp.h (error, verror): Mark as printf-like functions.
14719 * eval.c (verror): Use vsnprintf, not doprnt, to do the real work.
14720 Report overflow in size calculations when allocating printf buffer.
14721 Do not truncate output string at its first null byte.
14722 * xdisp.c (vmessage): Use vsnprintf, not doprnt, to do the real work.
14723 Truncate the output at a character boundary, since vsnprintf does not
14724 do that.
14725 * charset.c (check_iso_charset_parameter): Convert internal
14726 character to string before calling 'error', since %c now has the
14727 printf meaning.
14728 * coding.c (Fdecode_sjis_char, Fdecode_big5_char): Avoid int
14729 overflow when computing char to be passed to 'error'. Do not
14730 pass Lisp_Object to 'error'; pass the integer instead.
14731 * nsfns.m (Fns_do_applescript): Use int, not long, since it's
14732 formatted with plain %d.
14733
b189fa66
PE
14734 * eval.c (internal_lisp_condition_case): Don't pass spurious arg.
14735
bff87ef0
PE
14736 * keyboard.c (access_keymap_keyremap): Print func name, not garbage.
14737
7e2cac20
PE
14738 * coding.c (Fdecode_sjis_char): Don't assume CODE fits in int.
14739
ce4d90b5
PE
14740 * xterm.c (x_catch_errors): Remove duplicate declaration.
14741
266c9547
PE
14742 * term.c (maybe_fatal): Mark its 3rd arg as a printf format, too.
14743
79c49ad2
PE
14744 * xdisp.c, lisp.h (message_nolog): Remove; unused.
14745
368f4090
JM
147462011-04-10 Jim Meyering <meyering@redhat.com>
14747
14748 use ssize_t and size_t for read- and write-like emacs_gnutls_* functions
14749 * gnutls.c (emacs_gnutls_read): Adjust signature to be more read-like:
14750 return ssize_t not "int", and use size_t as the buffer length.
14751 (emacs_gnutls_write): Likewise, and make the buffer pointer "const".
14752 * gnutls.h: Update declarations.
14753 * process.c (read_process_output): Use ssize_t, to match.
14754 (send_process): Likewise.
14755
a32d4040
CY
147562011-04-09 Chong Yidong <cyd@stupidchicken.com>
14757
14758 * image.c (Fimagemagick_types): Doc fix, and comment cleanup.
14759
8546720e 147602011-04-09 Chong Yidong <cyd@stupidchicken.com>
aac0c6e3 14761
04f2d78b
CB
14762 * ftfont.c (get_adstyle_property, ftfont_pattern_entity):
14763 Use unsigned char, to match FcChar8 type definition.
aac0c6e3 14764
8546720e
GM
14765 * xterm.c (handle_one_xevent):
14766 * xmenu.c (create_and_show_popup_menu):
14767 * xselect.c (x_decline_selection_request)
14768 (x_reply_selection_request): Avoid type-punned deref of X events.
aac0c6e3 14769
0a2f5c1a 147702011-04-09 Eli Zaretskii <eliz@gnu.org>
a53e2e89
EZ
14771
14772 Fix some uses of `int' instead of EMACS_INT.
14773 * search.c (string_match_1, fast_string_match)
14774 (fast_c_string_match_ignore_case, fast_string_match_ignore_case)
14775 (scan_buffer, find_next_newline_no_quit)
14776 (find_before_next_newline, search_command, Freplace_match)
14777 (Fmatch_data): Make some `int' variables be EMACS_INT.
14778
14779 * xdisp.c (display_count_lines): 3rd argument and return value now
14780 EMACS_INT. All callers changed.
14781 (pint2hrstr): Last argument is now EMACS_INT.
14782
14783 * coding.c (detect_coding_utf_8, detect_coding_emacs_mule)
14784 (detect_coding_iso_2022, detect_coding_sjis, detect_coding_big5)
14785 (detect_coding_ccl, detect_coding_charset, decode_coding_utf_8)
14786 (decode_coding_utf_16, decode_coding_emacs_mule)
14787 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5)
14788 (decode_coding_ccl, decode_coding_charset)
14789 <consumed_chars, consumed_chars_base>: Declare EMACS_INT.
14790 (decode_coding_iso_2022, decode_coding_emacs_mule)
14791 (decode_coding_sjis, decode_coding_big5, decode_coding_charset)
14792 <char_offset, last_offset>: Declare EMACS_INT.
14793 (encode_coding_utf_8, encode_coding_utf_16)
14794 (encode_coding_emacs_mule, encode_invocation_designation)
14795 (encode_designation_at_bol, encode_coding_iso_2022)
14796 (encode_coding_sjis, encode_coding_big5, encode_coding_ccl)
14797 (encode_coding_raw_text, encode_coding_charset) <produced_chars>:
14798 Declare EMACS_INT.
14799 (ASSURE_DESTINATION): Declare more_bytes EMACS_INT.
14800 (encode_invocation_designation): Last argument P_NCHARS is now
14801 EMACS_INT.
14802 (decode_eol): Declare pos_byte, pos, and pos_end EMACS_INT.
14803 (produce_chars): from_nchars and to_nchars are now EMACS_INT.
14804
14805 * coding.h (struct coding_system) <head_ascii>: Declare EMACS_INT.
14806 All users changed.
14807
14808 * ccl.c (Fccl_execute_on_string): Declare some variables
14809 EMACS_INT.
14810
8546720e 148112011-04-08 Samuel Thibault <sthibault@debian.org> (tiny change)
0080dc6b
SS
14812
14813 * term.c (init_tty): Fix incorrect ifdef placement (Bug#8450).
14814
4e19a977
CS
148152011-03-19 Christoph Scholtes <cschol2112@googlemail.com>
14816
14817 * process.c (Fformat_network_address): Doc fix.
14818
87302331
R
148192011-04-08 T.V. Raman <tv.raman.tv@gmail.com> (tiny change)
14820
ee7683eb 14821 * xml.c (parse_region): Avoid creating spurious whitespace nodes.
87302331 14822
cbb59342
CY
148232011-04-08 Chong Yidong <cyd@stupidchicken.com>
14824
14825 * keyboard.c (read_char): Call Lisp function help-form-show,
14826 instead of using internal_with_output_to_temp_buffer.
14827 (Qhelp_form_show): New var.
e0d38eeb 14828 (syms_of_keyboard): Use DEFSYM macro.
cbb59342
CY
14829
14830 * print.c (internal_with_output_to_temp_buffer): Function deleted.
14831
14832 * lisp.h (internal_with_output_to_temp_buffer): Remove prototype.
14833
e67a13ab
CY
148342011-04-06 Chong Yidong <cyd@stupidchicken.com>
14835
04f2d78b
CB
14836 * process.c (Flist_processes): Remove to Lisp.
14837 (list_processes_1): Delete.
e67a13ab 14838
973f782d
EZ
148392011-04-06 Eli Zaretskii <eliz@gnu.org>
14840
7c106b1e
EZ
14841 * msdos.c (careadlinkat, careadlinkatcwd): MS-DOS replacements.
14842
973f782d
EZ
14843 * w32.c (careadlinkat, careadlinkatcwd): New always-fail stubs.
14844
41cf7d1a 148452011-04-06 Paul Eggert <eggert@cs.ucla.edu>
27ccc379 14846
ca23cc88
PE
14847 Fix more problems found by GCC 4.6.0's static checks.
14848
f390e2d5
PE
14849 * xmenu.c (Fx_popup_dialog): Don't assume string is free of formats.
14850
42eea0d0
PE
14851 * menu.c (Fx_popup_menu): Don't assume error_name lacks printf formats.
14852
b69769da 14853 * lisp.h (message, message_nolog, fatal): Mark as printf-like.
1e973bc7 14854
f9541e84
PE
14855 * xdisp.c (vmessage): Mark as a printf-like function.
14856
13841b55
PE
14857 * term.c (vfatal, maybe_fatal): Mark as printf-like functions.
14858
c136c10f
PE
14859 * sound.c (sound_warning): Don't crash if arg contains a printf format.
14860
5e2d4a30
PE
14861 * image.c (tiff_error_handler, tiff_warning_handler): Mark as
14862 printf-like functions.
14863 (tiff_load): Add casts to remove these marks before passing them
14864 to system-supplied API.
14865
583f48b9
PE
14866 * eval.c (Fsignal): Remove excess argument to 'fatal'.
14867
b25d760e
PE
14868 * coding.c (EMIT_ONE_BYTE, EMIT_TWO_BYTES): Use unsigned, not int.
14869 This avoids several warnings with gcc -Wstrict-overflow.
d5efd1d1
PE
14870 (DECODE_COMPOSITION_RULE): If the rule is invalid, goto invalid_code
14871 directly, rather than having caller test rule sign. This avoids
14872 some unnecessary tests.
14873 * composite.h (COMPOSITION_ENCODE_RULE_VALID): New macro.
14874 (COMPOSITION_ENCODE_RULE): Arguments now must be valid. This
14875 affects only one use, in DECODE_COMPOSITION_RULE, which is changed.
b25d760e 14876
bc7b6697 14877 * xfont.c (xfont_text_extents): Remove var that was set but not used.
625a3eb1 14878 (xfont_open): Avoid unnecessary tests.
bc7b6697 14879
27ccc379
PE
14880 * composite.c (composition_gstring_put_cache): Use unsigned integer.
14881
dcd5c89a
PE
14882 * composite.h, composite.c (composition_gstring_put_cache):
14883 Use EMACS_INT, not int, for length.
14884
b13a45c6
PE
14885 * composite.h (COMPOSITION_DECODE_REFS): New macro,
14886 breaking out part of COMPOSITION_DECODE_RULE.
14887 (COMPOSITION_DECODE_RULE): Use it.
14888 * composite.c (get_composition_id): Remove unused local vars,
14889 by using the new macro.
14890
1e792e4d
PE
14891 * textprop.c (set_text_properties_1): Change while to do-while,
14892 since the condition is always true at first.
14893
dc6c6455 14894 * intervals.c (graft_intervals_into_buffer): Mark var as used.
aa86731f
PE
14895 (interval_deletion_adjustment): Return unsigned value.
14896 All uses changed.
dc6c6455 14897
aba7731a
PE
14898 * process.c (list_processes_1, create_pty, read_process_output):
14899 (exec_sentinel): Remove vars that were set but not used.
afd4052b 14900 (create_pty): Remove unnecessary "volatile"s.
bc57d757 14901 (Fnetwork_interface_info): Avoid possibility of int overflow.
82eaa333 14902 (read_process_output): Do adaptive read buffering even if carryover.
fe07cdfa 14903 (read_process_output): Simplify nbytes computation if buffered.
aba7731a 14904
fdfc4bf3
PE
14905 * bytecode.c (exec_byte_code): Rename local to avoid shadowing.
14906
fca8fe46 14907 * syntax.c (scan_words): Remove var that was set but not used.
12cbf13f 14908 (update_syntax_table): Use unsigned instead of int.
fca8fe46 14909
06a0259a 14910 * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
3c346cc3 14911 (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
e6eb4e9e 14912 (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
06a0259a 14913
e7b9e80f
PE
14914 * print.c (print_error_message): Avoid int overflow.
14915
56201685
PE
14916 * font.c (font_list_entities): Redo for clarity,
14917 so that reader need not know FONT_DPI_INDEX + 1 == FONT_SPACING_INDEX.
14918
78834453 14919 * font.c (font_find_for_lface, Ffont_get_glyphs): Remove unused vars.
790771b1 14920 (font_score): Avoid potential overflow in diff calculation.
78834453 14921
0bc0b309 14922 * fns.c (substring_both): Remove var that is set but not used.
8cd55cb4 14923 (sxhash): Redo loop for clarity and to avoid wraparound warning.
0bc0b309 14924
e610eaca
PE
14925 * eval.c (funcall_lambda): Rename local to avoid shadowing.
14926
b895abce
PE
14927 * alloc.c (mark_object_loop_halt, mark_object): Use size_t, not int.
14928 Otherwise, GCC 4.6.0 optimizes the loop check away since the check
14929 can always succeed if overflow has undefined behavior.
14930
1f1d9321 14931 * search.c (boyer_moore, wordify): Remove vars set but not used.
6f076cc7 14932 (wordify): Omit three unnecessary tests.
1f1d9321 14933
c59478bc
PE
14934 * indent.c (MULTIBYTE_BYTES_WIDTH): Don't compute wide_column.
14935 All callers changed. This avoids the need for an unused var.
14936
79b73827
PE
14937 * casefiddle.c (casify_region): Remove var that is set but not used.
14938
a4db5dfe
PE
14939 * dired.c (file_name_completion): Remove var that is set but not used.
14940
43aae36e
PE
14941 * fileio.c (Finsert_file_contents): Make EOF condition clearer.
14942
2a47c44d 14943 * fileio.c (Finsert_file_contents): Avoid signed integer overflow.
163c5f32 14944 (Finsert_file_contents): Remove unnecessary code checking fd.
2a47c44d 14945
a37c69bf
PE
14946 * minibuf.c (read_minibuf_noninteractive): Use size_t for sizes.
14947 Check for integer overflow on size calculations.
14948
328ab8e7
PE
14949 * buffer.c (Fprevious_overlay_change): Remove var that is set
14950 but not used.
14951
e5a2a5cb
PE
14952 * keyboard.c (menu_bar_items, read_char_minibuf_menu_prompt):
14953 Remove vars that are set but not used.
8d84a6eb 14954 (timer_check_2): Don't assume timer-list and idle-timer-list are lists.
6b043475 14955 (timer_check_2): Mark vars as initialized.
e5a2a5cb 14956
a60e5f68
PE
14957 * gtkutil.c (xg_get_file_with_chooser): Mark var as initialized.
14958
f661cb61 14959 * image.c (lookup_image): Remove var that is set but not used.
35fa624f 14960 (xbm_load): Use parse_p, for gcc -Werror=unused-but-set-variable.
f661cb61 14961
f0397f5a
PE
14962 * fontset.c (Finternal_char_font, Ffontset_info): Remove vars
14963 that are set but not used.
14964
8664db06 14965 * xfns.c (make_invisible_cursor): Don't return garbage
03733ee7 14966 if XCreateBitmapFromData fails (Bug#8410).
8664db06 14967
6abdaa4a
PE
14968 * xselect.c (x_get_local_selection, x_handle_property_notify):
14969 Remove vars that are set but not used.
14970
0ce7538d 14971 * xfns.c (x_create_tip_frame): Remove var that is set but not used.
6abdaa4a 14972 (make_invisible_cursor): Initialize a possibly-uninitialized variable.
0ce7538d 14973
9ae848fc
PE
14974 * xterm.c (x_scroll_bar_to_input_event) [!USE_GTK]:
14975 Remove var that is set but not used.
0b918413
PE
14976 (scroll_bar_windows_size): Now size_t, not int.
14977 (x_send_scroll_bar_event): Use size_t, not int, for sizes.
14978 Check for overflow.
9ae848fc 14979
a5a62657
PE
14980 * xfaces.c (realize_named_face): Remove vars that are set but not used.
14981 (map_tty_color) [!defined MSDOS]: Likewise.
14982
5c5cdd39
PE
14983 * term.c (tty_write_glyphs): Use size_t; this avoids overflow warning.
14984
66ebf983
PE
14985 * coding.c: Remove vars that are set but not used.
14986 (DECODE_COMPOSITION_RULE): Remove 2nd arg, which is unused.
14987 All callers changed.
14988 (decode_coding_utf_8, decode_coding_utf_16 decode_coding_emacs_mule):
14989 (decode_coding_iso_2022, encode_coding_sjis, encode_coding_big5):
14990 (decode_coding_charset): Remove vars that are set but not used.
14991
1be4d761
PE
14992 * bytecode.c (Fbyte_code) [!defined BYTE_CODE_SAFE]: Remove var
14993 that is set but not used.
14994
47553fa8
PE
14995 * print.c (print_object): Remove var that is set but not used.
14996
1f7196bf 14997 Replace 2 copies of readlink code with 1 gnulib version (Bug#8401).
d1fdcab7
PE
14998 The gnulib version avoids calling malloc in the usual case,
14999 and on 64-bit hosts doesn't have some arbitrary 32-bit limits.
15000 * fileio.c (Ffile_symlink_p): Use emacs_readlink.
15001 * filelock.c (current_lock_owner): Likewise.
15002 * lisp.h (READLINK_BUFSIZE, emacs_readlink): New function.
15003 * sysdep.c: Include allocator.h, careadlinkat.h.
15004 (emacs_no_realloc_allocator): New static constant.
15005 (emacs_readlink): New function.
fdb61804
PE
15006 * deps.mk (sysdep.o): Depend on ../lib/allocator.h and on
15007 ../lib/careadlinkat.h.
d1fdcab7 15008
f84c17c7
SM
150092011-04-04 Stefan Monnier <monnier@iro.umontreal.ca>
15010
15011 * keyboard.c (safe_run_hook_funcall): Fix last change (don't stop at the
15012 first non-nil return value).
15013
ef3862ad
JD
150142011-04-03 Jan Djärv <jan.h.d@swipnet.se>
15015
15016 * nsterm.m (ns_update_auto_hide_menu_bar): Define MAC_OS_X_VERSION_10_6
15017 if not defined (Bug#8403).
15018
376a7006
JB
150192011-04-02 Juanma Barranquero <lekktu@gmail.com>
15020
15021 * xdisp.c (display_count_lines): Remove parameter `start',
15022 unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15023 (get_char_face_and_encoding): Remove parameter `multibyte_p',
15024 unused since 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15025 (fill_stretch_glyph_string): Remove parameters `row' and `area',
15026 unused at least since Kim's GUI unification at 2003-03-16T20:45:46Z!storm@cua.dk
15027 and thereabouts. All callers changed.
15028 (get_per_char_metric): Remove parameter `f', unused since
15029 2008-05-14T01:40:23Z!handa@m17n.org. All callers changed.
15030
6ca3801d
JM
150312011-04-02 Jim Meyering <meyering@redhat.com>
15032
15033 do not dereference NULL upon failed strdup
15034 * nsfont.m (ns_descriptor_to_entity): Use xstrdup, not strdup.
15035 (ns_get_family): Likewise.
15036
d8e2b5ba
JB
150372011-04-02 Juanma Barranquero <lekktu@gmail.com>
15038
15039 * eval.c (unwind_to_catch) [DEBUG_GCPRO]: Remove redundant assignment.
15040
8c74fcbd
JD
150412011-04-02 Jan Djärv <jan.h.d@swipnet.se>
15042
15043 * nsterm.m (ns_update_auto_hide_menu_bar): Only for OSX 10.6 or
15044 later (Bug#8403).
15045
7200d79c
SM
150462011-04-01 Stefan Monnier <monnier@iro.umontreal.ca>
15047
03408648 15048 Add lexical binding.
7200d79c 15049
03408648
SM
15050 * window.c (Ftemp_output_buffer_show): New fun.
15051 (Fsave_window_excursion):
15052 * print.c (Fwith_output_to_temp_buffer): Move to subr.el.
15053
15054 * lread.c (lisp_file_lexically_bound_p): New function.
15055 (Fload): Bind Qlexical_binding.
15056 (readevalloop): Remove `evalfun' arg.
15057 Bind Qinternal_interpreter_environment.
15058 (Feval_buffer): Bind Qlexical_binding.
15059 (defvar_int, defvar_bool, defvar_lisp_nopro, defvar_kboard):
15060 Mark as dynamic.
15061 (syms_of_lread): Declare `lexical-binding'.
15062
15063 * lisp.h (struct Lisp_Symbol): New field `declared_special'.
15064
15065 * keyboard.c (eval_dyn): New fun.
15066 (menu_item_eval_property): Use it.
ca105506
SM
15067
15068 * image.c (parse_image_spec): Use Ffunctionp.
ca105506 15069
03408648
SM
15070 * fns.c (concat, mapcar1): Accept byte-code-functions.
15071
15072 * eval.c (Fsetq): Handle lexical vars.
15073 (Fdefun, Fdefmacro, Ffunction): Make closures when needed.
15074 (Fdefconst, Fdefvaralias, Fdefvar): Mark as dynamic.
15075 (FletX, Flet): Obey lexical binding.
15076 (Fcommandp): Handle closures.
15077 (Feval): New `lexical' arg.
15078 (eval_sub): New function extracted from Feval. Use it almost
15079 everywhere where Feval was used. Look up vars in lexical env.
15080 Handle closures.
15081 (Ffunctionp): Move from subr.el.
15082 (Ffuncall): Handle closures.
15083 (apply_lambda): Remove `eval_flags'.
15084 (funcall_lambda): Handle closures and new byte-code-functions.
15085 (Fspecial_variable_p): New function.
15086 (syms_of_eval): Initialize the Vinternal_interpreter_environment var,
15087 but without exporting it to Lisp.
23aba0ea 15088
23aba0ea 15089 * doc.c (Fdocumentation, store_function_docstring):
03408648 15090 * data.c (Finteractive_form): Handle closures.
23aba0ea 15091
03408648
SM
15092 * callint.c (Fcall_interactively): Preserve lexical-binding mode for
15093 interactive spec.
ba83908c 15094
04f2d78b
CB
15095 * bytecode.c (Bstack_ref, Bstack_set, Bstack_set2, BdiscardN):
15096 New byte-codes.
03408648
SM
15097 (exec_byte_code): New function extracted from Fbyte_code to handle new
15098 calling convention for byte-code-functions. Add new byte-codes.
ba83908c 15099
03408648 15100 * buffer.c (defvar_per_buffer): Set new `declared_special' field.
e2abe5a1 15101
03408648 15102 * alloc.c (Fmake_symbol): Init new `declared_special' field.
e2abe5a1 15103
e2abce01
JB
151042011-03-31 Juanma Barranquero <lekktu@gmail.com>
15105
15106 * xdisp.c (redisplay_internal): Fix prototype.
15107
63696a73 151082011-03-31 Eli Zaretskii <eliz@gnu.org>
09725d26 15109
63696a73 15110 * xdisp.c (SCROLL_LIMIT): New macro.
04f2d78b
CB
15111 (try_scrolling): Use it when setting scroll_limit.
15112 Limit scrolling to 100 screen lines.
63696a73
EZ
15113 (redisplay_window): Even when falling back on "recentering",
15114 position point in the window according to scroll-conservatively,
15115 scroll-margin, and scroll-*-aggressively variables. (Bug#6671)
15116
15117 (try_scrolling): When point is above the window, allow searching
15118 as far as scroll_max, or one screenful, to compute vertical
15119 distance from PT to the scroll margin position. This prevents
15120 try_scrolling from unnecessarily failing when
15121 scroll-conservatively is set to a value slightly larger than the
15122 window height. Clean up the case of PT below the margin at bottom
15123 of window: scroll_max can no longer be INT_MAX. When aggressive
15124 scrolling is in use, don't let point enter the opposite scroll
15125 margin as result of the scroll.
15126 (syms_of_xdisp) <scroll-conservatively>: Document the
09725d26
EZ
15127 threshold of 100 lines for never-recentering scrolling.
15128
e4cc2dfc
JB
151292011-03-31 Juanma Barranquero <lekktu@gmail.com>
15130
15131 * dispextern.h (move_it_by_lines):
15132 * xdisp.c (move_it_by_lines): Remove parameter `need_y_p', unused
15133 since 2000-12-29T14:24:09Z!gerd@gnu.org. All callers changed.
15134 (message_log_check_duplicate): Remove parameters `prev_bol' and
15135 `this_bol', unused since 1998-01-01T02:27:27Z!rms@gnu.org. All callers changed.
15136 (redisplay_internal): Remove parameter `preserve_echo_area',
15137 unused since 1999-07-21T21:43:52Z!gerd@gnu.org. All callers changed.
15138
15139 * indent.c (Fvertical_motion):
15140 * window.c (window_scroll_pixel_based, Frecenter):
15141 Don't pass `need_y_p' to `move_it_by_lines'.
15142
1c470562
SM
151432011-03-30 Stefan Monnier <monnier@iro.umontreal.ca>
15144
44f230aa
SM
15145 * eval.c (struct backtrace): Don't cheat with negative numbers, but do
15146 steal a few bits to be more compact.
15147 (interactive_p, Fbacktrace, Fbacktrace_frame, mark_backtrace):
15148 Remove unneeded casts.
15149
1c470562
SM
15150 * bytecode.c (Fbyte_code): CAR and CDR can GC.
15151
888adce9
ZK
151522011-03-30 Zachary Kanfer <zkanfer@gmail.com> (tiny change)
15153
15154 * keyboard.c (Fexecute_extended_command): Do log the "suggest key
15155 binding" message (bug#7967).
15156
f838ed7b
PE
151572011-03-30 Paul Eggert <eggert@cs.ucla.edu>
15158
77861b95
PE
15159 Fix more problems found by GCC 4.6.0's static checks.
15160
de6dbc14
PE
15161 * unexelf.c (unexec) [! (defined _SYSTYPE_SYSV || defined __sgi)]:
15162 Remove unused local var.
15163
f838ed7b
PE
15164 * editfns.c (Fmessage_box): Remove unused local var.
15165
792c7b2b
PE
15166 * xdisp.c (try_window_reusing_current_matrix, x_produce_glyphs):
15167 (note_mode_line_or_margin_highlight, note_mouse_highlight):
15168 Omit unused local vars.
c499e557 15169 * window.c (shrink_windows): Omit unused local var.
b01a1c29 15170 * menu.c (digest_single_submenu): Omit unused local var.
0bc32927
PE
15171 * dispnew.c (update_window) [PERIODIC_PREEMPTION_CHECKING]:
15172 Omit unused local var.
15173
ba0165e1
PE
15174 * keyboard.c (parse_modifiers_uncached, parse_modifiers):
15175 Don't assume string length fits in int.
32ad8845 15176 (keyremap_step, read_key_sequence): Use size_t for sizes.
48011560 15177 (read_key_sequence): Don't check last_real_key_start redundantly.
ba0165e1 15178
3c59b4c9
PE
15179 * callproc.c (Fcall_process, Fcall_process_region): Use SAFE_ALLOCA
15180 instead of alloca (Bug#8344).
15181
a3eed478 15182 * eval.c (Fbacktrace): Don't assume nargs fits in int.
5d5d959d 15183 (Fbacktrace_frame): Don't assume nframes fits in int.
a3eed478 15184
eb4d412d
PE
15185 * syntax.c (scan_sexps_forward): Avoid pointer wraparound.
15186
1658b401
PE
15187 * xterm.c (x_make_frame_visible, same_x_server): Redo to avoid overflow
15188 concerns.
15189
15190 * term.c (produce_glyphless_glyph): Remove unnecessary test.
15191
15192 * cm.c (calccost): Turn while-do into do-while, for clarity.
44f730c8 15193
9a2c6e05
PE
15194 * keyboard.c (syms_of_keyboard): Use the same style as later
15195 in this function when indexing through an array. This also
15196 works around GCC bug 48267.
15197
03d0a109
PE
15198 * image.c (tiff_load): Fix off-by-one image count (Bug#8336).
15199
44f730c8
PE
15200 * xselect.c (x_check_property_data): Return correct size (Bug#8335).
15201
fe75f926
PE
15202 * chartab.c (sub_char_table_ref_and_range): Redo for slight
15203 efficiency gain, and to bypass a gcc -Wstrict-overflow warning.
15204
ffa8c828
PE
15205 * keyboard.c, keyboard.h (num_input_events): Now size_t.
15206 This avoids undefined behavior on integer overflow, and is a bit
15207 more convenient anyway since it is compared to a size_t variable.
15208
c5101a77
PE
15209 Variadic C functions now count arguments with size_t, not int.
15210 This avoids an unnecessary limitation on 64-bit machines, which
15211 caused (substring ...) to crash on large vectors (Bug#8344).
15212 * lisp.h (struct Lisp_Subr.function.aMANY): Now takes size_t, not int.
15213 (DEFUN_ARGS_MANY, internal_condition_case_n, safe_call): Likewise.
77861b95 15214 All variadic functions and their callers changed accordingly.
c5101a77
PE
15215 (struct gcpro.nvars): Now size_t, not int. All uses changed.
15216 * data.c (arith_driver, float_arith_driver): Likewise.
15217 * editfns.c (general_insert_function): Likewise.
15218 * eval.c (struct backtrace.nargs, interactive_p)
15219 (internal_condition_case_n, run_hook_with_args, apply_lambda)
15220 (funcall_lambda, mark_backtrace): Likewise.
15221 * fns.c (concat): Likewise.
15222 * frame.c (x_set_frame_parameters): Likewise.
15223 * fns.c (get_key_arg): Now accepts and returns size_t, and returns
15224 0 if not found, not -1. All callers changed.
15225
dd3f25f7
PE
15226 * alloc.c (garbage_collect): Don't assume stack size fits in int.
15227 (stack_copy_size): Now size_t, not int.
15228 (stack_copy, stack_copy_size): Define only if MAX_SAVE_STACK > 0.
15229
461c2ab9
JB
152302011-03-28 Juanma Barranquero <lekktu@gmail.com>
15231
15232 * coding.c (encode_designation_at_bol): Remove parameter `charbuf_end',
15233 unused since 2002-03-01T01:17:24Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15234 All callers changed.
15235
15236 * lisp.h (multibyte_char_to_unibyte):
15237 * character.c (multibyte_char_to_unibyte): Remove parameter `rev_tbl',
15238 unused since 2002-03-01T01:16:34Z!handa@m17n.org and 2008-02-01T16:01:31Z!miles@gnu.org.
15239 * character.h (CHAR_TO_BYTE8):
15240 * cmds.c (internal_self_insert):
15241 * editfns.c (general_insert_function):
15242 * keymap.c (push_key_description):
15243 * search.c (Freplace_match):
15244 * xdisp.c (message_dolog, set_message_1): All callers changed.
15245
f6d62986
SM
152462011-03-28 Stefan Monnier <monnier@iro.umontreal.ca>
15247
15248 * keyboard.c (safe_run_hook_funcall): New function.
15249 (safe_run_hooks_1, safe_run_hooks_error, safe_run_hooks): On error,
15250 don't set the hook to nil, but remove the offending function instead.
15251 (Qcommand_hook_internal): Remove, unused.
15252 (syms_of_keyboard): Don't initialize Qcommand_hook_internal nor define
15253 Vcommand_hook_internal.
15254
15255 * eval.c (enum run_hooks_condition): Remove.
15256 (funcall_nil, funcall_not): New functions.
15257 (run_hook_with_args): Call each function through a `funcall' argument.
15258 Remove `cond' argument, now redundant.
15259 (Frun_hooks, Frun_hook_with_args, Frun_hook_with_args_until_success)
15260 (Frun_hook_with_args_until_failure): Adjust accordingly.
15261 (run_hook_wrapped_funcall, Frun_hook_wrapped): New functions.
15262
1db5b1ad
JB
152632011-03-28 Juanma Barranquero <lekktu@gmail.com>
15264
15265 * dispextern.h (string_buffer_position): Remove declaration.
15266
15267 * print.c (strout): Remove parameter `multibyte', unused since
15268 1999-08-21T19:30:21Z!gerd@gnu.org. All callers changed.
15269
15270 * search.c (boyer_moore): Remove parameters `len', `pos' and `lim',
15271 never used since function introduction in 1998-02-08T21:33:56Z!rms@gnu.org.
15272 All callers changed.
15273
15274 * w32.c (_wsa_errlist): Use braces for struct initializers.
15275
15276 * xdisp.c (string_buffer_position_lim): Remove parameter `w',
15277 never used since function introduction in 2001-03-09T18:41:50Z!gerd@gnu.org.
15278 All callers changed.
15279 (string_buffer_position): Likewise. Also, make static (it's never
15280 used outside xdisp.c).
15281 (cursor_row_p): Remove parameter `w', unused since
15282 2000-10-17T16:08:57Z!gerd@gnu.org. All callers changed.
15283 (decode_mode_spec): Remove parameter `precision', introduced during
15284 Gerd Moellmann's rewrite at 1999-07-21T21:43:52Z!gerd@gnu.org, but never used.
15285 All callers changed.
15286
5ffb62aa
JD
152872011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15288
15289 * nsterm.m (syms_of_nsterm): Use doc: for ns-auto-hide-menu-bar.
15290
461c2ab9 152912011-03-27 Anders Lindgren <andlind@gmail.com>
f0a1382a
JD
15292
15293 * nsterm.m (ns_menu_bar_is_hidden): New variable.
15294 (ns_constrain_all_frames, ns_menu_bar_should_be_hidden)
15295 (ns_update_auto_hide_menu_bar): New functions.
15296 (ns_update_begin): Call ns_update_auto_hide_menu_bar.
15297 (applicationDidBecomeActive): Call ns_update_auto_hide_menu_bar and
15298 ns_constrain_all_frames.
15299 (constrainFrameRect): Return at once if ns_menu_bar_should_be_hidden.
15300 (syms_of_nsterm): DEFVAR ns-auto-hide-menu-bar, init to Qnil.
15301
5c380ffb
JD
153022011-03-27 Jan Djärv <jan.h.d@swipnet.se>
15303
15304 * nsmenu.m (runDialogAt): Remove argument to timer_check.
15305
9af30bdf
GM
153062011-03-27 Glenn Morris <rgm@gnu.org>
15307
15308 * syssignal.h: Replace RETSIGTYPE with void.
15309 * atimer.c, data.c, dispnew.c, emacs.c, floatfns.c, keyboard.c:
15310 * keyboard.h, lisp.h, process.c, sysdep.c, xterm.c:
15311 Replace SIGTYPE with void everywhere.
15312 * s/usg5-4-common.h (SIGTYPE): Remove definition.
15313 * s/template.h (SIGTYPE): Remove commented out definition.
15314
e2abce01
JB
153152011-03-26 Eli Zaretskii <eliz@gnu.org>
15316
15317 * xdisp.c (redisplay_window): Don't check buffer's clip_changed
15318 flag as a prerequisite for invoking try_scrolling. (Bug#6671)
15319
f868cd8a
JB
153202011-03-26 Juanma Barranquero <lekktu@gmail.com>
15321
59eb0929
JB
15322 * w32.c (read_unc_volume): Use parameter `henum', instead of
15323 global variable `wget_enum_handle'.
15324
15325 * keymap.c (describe_vector): Remove parameters `indices' and
15326 `char_table_depth', unused since 2002-03-01T01:43:26Z!handa@m17n.org.
15327 (describe_map, Fdescribe_vector): Adjust calls to `describe_vector'.
15328
f868cd8a
JB
15329 * keyboard.h (timer_check, show_help_echo): Remove unused parameters.
15330
15331 * keyboard.c (timer_check): Remove parameter `do_it_now',
15332 unused since 1996-04-12T06:01:29Z!rms@gnu.org.
15333 (show_help_echo): Remove parameter `ok_to_overwrite_keystroke_echo',
15334 unused since 2008-04-19T19:30:53Z!monnier@iro.umontreal.ca.
15335
15336 * keyboard.c (read_char):
15337 * w32menu.c (w32_menu_display_help):
15338 * xmenu.c (show_help_event, menu_help_callback):
15339 Adjust calls to `show_help_echo'.
15340
15341 * gtkutil.c (xg_maybe_add_timer):
15342 * keyboard.c (readable_events):
15343 * process.c (wait_reading_process_output):
15344 * xmenu.c (x_menu_wait_for_event): Adjust calls to `timer_check'.
15345
15346 * insdel.c (adjust_markers_gap_motion):
15347 Remove; no-op since 1998-01-02T21:29:48Z!rms@gnu.org.
15348 (gap_left, gap_right): Don't call it.
15349
2ecf6fdb
CY
153502011-03-25 Chong Yidong <cyd@stupidchicken.com>
15351
15352 * xdisp.c (handle_fontified_prop): Discard changes to clip_changed
15353 incurred during fontification.
15354
6b1f9ba4
JB
153552011-03-25 Juanma Barranquero <lekktu@gmail.com>
15356
15357 * buffer.c (defvar_per_buffer): Remove unused parameter `doc'.
15358 (DEFVAR_PER_BUFFER): Don't pass it.
15359
15360 * dispnew.c (row_equal_p, add_row_entry): Remove unused parameter `w'.
15361 (scrolling_window): Don't pass it.
15362
0f4a96b5
JB
153632011-03-25 Juanma Barranquero <lekktu@gmail.com>
15364
15365 * dispextern.h (glyph_matric): Use #if GLYPH_DEBUG, not #ifdef.
15366
15367 * fileio.c (check_executable) [DOS_NT]: Remove unused variables `len'
15368 and `suffix'.
15369 (Fset_file_selinux_context) [HAVE_LIBSELINUX]: Move here declaration
15370 of variables specific to SELinux and computation of `encoded_absname'.
15371
15372 * image.c (XPutPixel): Remove unused variable `height'.
15373
15374 * keyboard.c (make_lispy_event): Remove unused variable `hpos'.
15375
15376 * unexw32.c (get_section_info): Remove unused variable `section'.
15377
15378 * w32.c (stat): Remove unused variables `drive_root' and `devtype'.
15379 (system_process_attributes): Remove unused variable `sess'.
15380 (sys_read): Remove unused variable `err'.
15381
15382 * w32fns.c (top): Wrap variables with #if GLYPH_DEBUG, not #ifdef.
15383 (w32_wnd_proc): Remove unused variable `isdead'.
15384 (unwind_create_frame): Use #if GLYPH_DEBUG, not #ifdef.
15385 (Fx_server_max_request_size): Remove unused variable `dpyinfo'.
15386 (x_create_tip_frame): Remove unused variable `tem'.
15387
15388 * w32inevt.c (w32_console_read_socket):
15389 Remove unused variable `no_events'.
15390
15391 * w32term.c (x_draw_composite_glyph_string_foreground):
15392 Remove unused variable `width'.
15393
1149507c
JB
153942011-03-24 Juanma Barranquero <lekktu@gmail.com>
15395
15396 * w32term.c (x_set_glyph_string_clipping):
15397 Don't pass uninitialized region to CombineRgn.
15398
9c88f339
JB
153992011-03-23 Juanma Barranquero <lekktu@gmail.com>
15400
15401 * w32fns.c (x_set_menu_bar_lines): Remove unused variable `olines'.
15402 (w32_wnd_proc): Pass NULL to Windows API, not uninitialized buffer.
15403 (Fx_close_connection): Remove unused variable `i'.
15404
15405 * w32font.c (w32font_draw): Return number of glyphs.
15406 (w32font_open_internal): Remove unused variable `i'.
15407 (w32font_driver): Add missing initializer.
15408
15409 * w32menu.c (utf8to16): Remove unused variable `utf16'.
15410 (fill_in_menu): Remove unused variable `items_added'.
15411
15412 * w32term.c (last_mouse_press_frame): Remove static global variable.
15413 (w32_clip_to_row): Remove unused variable `f'.
15414 (x_delete_terminal): Remove unused variable `i'.
15415
15416 * w32uniscribe.c (uniscribe_shape): Remove unused variable `nclusters'.
15417 (NOTHING): Remove unused static global variable.
15418 (uniscribe_check_otf): Remove unused variable `table'.
15419 (uniscribe_font_driver): Add missing initializers.
15420
dee091a3
JD
154212011-03-23 Julien Danjou <julien@danjou.info>
15422
15423 * term.c (Fsuspend_tty, Fresume_tty):
15424 * minibuf.c (read_minibuf, run_exit_minibuf_hook):
15425 * window.c (temp_output_buffer_show):
15426 * insdel.c (signal_before_change):
15427 * frame.c (Fhandle_switch_frame):
15428 * fileio.c (Fdo_auto_save):
15429 * emacs.c (Fkill_emacs):
15430 * editfns.c (save_excursion_restore):
15431 * cmds.c (internal_self_insert):
15432 * callint.c (Fcall_interactively):
15433 * buffer.c (Fkill_all_local_variables):
15434 * keyboard.c (Fcommand_execute, Fsuspend_emacs, safe_run_hooks_1):
15435 Use Frun_hooks.
0f4a96b5 15436 (command_loop_1): Use Frun_hooks. Call safe_run_hooks
e9fce1ac 15437 unconditionally since it does the check itself.
dee091a3 15438
2c520ab5 154392011-03-23 Paul Eggert <eggert@cs.ucla.edu>
f0641eff 15440
c9c49752
PE
15441 Fix more problems found by GCC 4.5.2's static checks.
15442
8abc3f12
PE
15443 * coding.c (encode_coding_raw_text): Avoid unnecessary test
15444 the first time through the loop, since we know p0 < p1 then.
15445 This also avoids a gcc -Wstrict-overflow warning.
15446
a2d26660
PE
15447 * lisp.h (SAFE_ALLOCA, SAFE_ALLOCA_LISP): Avoid 'int' overflow
15448 leading to a memory leak, possible in functions like
15449 load_charset_map_from_file that can allocate an unbounded number
b12ef411 15450 of objects (Bug#8318).
a2d26660 15451
916c72e9
PE
15452 * xmenu.c (set_frame_menubar): Use EMACS_UINT, not int, for indexes
15453 that could (at least in theory) be that large.
15454
19ab8a18
PE
15455 * xdisp.c (message_log_check_duplicate): Return unsigned long, not int.
15456 This is less likely to overflow, and avoids undefined behavior if
15457 overflow does occur. All callers changed. Use strtoul to scan
15458 for the unsigned long integer.
b7cbbd6f
PE
15459 (pint2hrstr): Simplify and tune code slightly.
15460 This also avoids a (bogus) GCC warning with gcc -Wstrict-overflow.
19ab8a18 15461
f0641eff
PE
15462 * scroll.c (do_scrolling): Work around GCC bug 48228.
15463 See <http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48228>.
15464
7f650bb9
PE
15465 * frame.c (Fmodify_frame_parameters): Simplify loop counter.
15466 This also avoids a warning with gcc -Wstrict-overflow.
39f5e519
PE
15467 (validate_x_resource_name): Simplify count usage.
15468 This also avoids a warning with gcc -Wstrict-overflow.
7f650bb9 15469
37dd57d1
PE
15470 * fileio.c (Fcopy_file): Report error if fchown or fchmod
15471 fail (Bug#8306).
81e56e61 15472
699979fc 15473 * emacs.c (Fdaemon_initialized): Do not ignore I/O errors (Bug#8303).
dc1ca6a8 15474
401bf9b4
PE
15475 * process.c (Fmake_network_process): Use socklen_t, not int,
15476 where POSIX says socklen_t is required in portable programs.
15477 This fixes a porting bug on hosts like 64-bit HP-UX, where
591b2973 15478 socklen_t is wider than int (Bug#8277).
401bf9b4
PE
15479 (Fmake_network_process, server_accept_connection):
15480 (wait_reading_process_output, read_process_output):
15481 Likewise.
15482
b93aacde
PE
15483 * process.c: Rename or move locals to avoid shadowing.
15484 (list_processes_1, Fmake_network_process):
15485 (read_process_output_error_handler, exec_sentinel_error_handler):
15486 Rename or move locals.
4dc343ee 15487 (Fmake_network_process): Define label "retry_connect" only if needed.
0da49335 15488 (Fnetwork_interface_info): Fix pointer signedness.
f990b4e5 15489 (process_send_signal): Add cast to avoid pointer signedness problem.
7b808126 15490 (FIRST_PROC_DESC, IF_NON_BLOCKING_CONNECT): Remove unused macros.
c939f91b 15491 (create_process): Use 'volatile' to avoid vfork clobbering (Bug#8298).
b93aacde 15492
af8a867c 15493 Make tparam.h and terminfo.c consistent.
44f230aa
SM
15494 * cm.c (tputs, tgoto, BC, UP): Remove extern decls.
15495 Include tparam.h instead, since it declares them.
af8a867c
PE
15496 * cm.h (PC): Remove extern decl; tparam.h now does this.
15497 * deps.mk (cm.o, terminfo.o): Depend on tparam.h.
15498 * terminfo.c: Include tparam.h, to check interfaces.
15499 (tparm): Make 1st arg a const pointer in decl. Put it at top level.
15500 (tparam): Adjust signature to match interface in tparam.h;
15501 this removes some undefined behavior. Check that outstring and len
15502 are zero, which they always are with Emacs.
15503 * tparam.h (PC, BC, UP): New extern decls.
15504
0248044d 15505 * xftfont.c (xftfont_shape): Now static, and defined only if needed.
001a7ab4 15506 (xftfont_open): Rename locals to avoid shadowing.
0248044d 15507
8ff096c1 15508 * ftfont.c (ftfont_resolve_generic_family): Fix pointer signedness.
a00924bb
PE
15509 (ftfont_otf_capability, ftfont_shape): Omit decls if not needed.
15510 (OTF_TAG_SYM): Omit macro if not needed.
e932860f 15511 (ftfont_list): Remove unused local.
49eaafba
PE
15512 (get_adstyle_property, ftfont_pattern_entity):
15513 (ftfont_lookup_cache, ftfont_open, ftfont_anchor_point):
15514 Rename locals to avoid shadowing.
8ff096c1 15515
e2be39f6
PE
15516 * xfont.c (xfont_list_family): Mark var as initialized.
15517
c9735e30
PE
15518 * xml.c (make_dom): Now static.
15519
8f5201ae
PE
15520 * composite.c (composition_compute_stop_pos): Rename local to
15521 avoid shadowing.
b246f932
PE
15522 (composition_reseat_it): Remove unused locals.
15523 (find_automatic_composition, composition_adjust_point): Likewise.
80e079b2 15524 (composition_update_it): Mark var as initialized.
11b61122
PE
15525 (find_automatic_composition): Mark vars as initialized,
15526 with a FIXME (Bug#8290).
8f5201ae 15527
760fbc2c
PE
15528 character.h: Rename locals to avoid shadowing.
15529 * character.h (PREV_CHAR_BOUNDARY, FETCH_STRING_CHAR_ADVANCE):
15530 (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE, FETCH_CHAR_ADVANCE):
15531 (FETCH_CHAR_ADVANCE_NO_CHECK, INC_POS, DEC_POS, BUF_INC_POS):
15532 (BUF_DEC_POS): Be more systematic about renaming local temporaries
15533 to avoid shadowing.
15534
ff08eb85
PE
15535 * textprop.c (property_change_between_p): Remove; unused.
15536
fc7bf025
PE
15537 * intervals.c (interval_start_pos): Now static.
15538
235d7abc
PE
15539 * intervals.h (CHECK_TOTAL_LENGTH): Avoid empty "else".
15540
44f230aa
SM
15541 * atimer.c (start_atimer, append_atimer_lists, set_alarm):
15542 Rename locals to avoid shadowing.
3e7d6594 15543
50060332
PE
15544 * sound.c (wav_play, au_play, Fplay_sound_internal):
15545 Fix pointer signedness.
d01f234b 15546 (alsa_choose_format): Remove unused local var.
c83b8872
PE
15547 (wav_play): Initialize a variable to 0, to prevent undefined
15548 behavior (Bug#8278).
50060332 15549
c4fc4e30
PE
15550 * region-cache.c (insert_cache_boundary): Redo var to avoid shadowing.
15551
918436ed
PE
15552 * region-cache.h (pp_cache): New decl, for gcc -Wmissing-prototypes.
15553
c939f91b
PE
15554 * callproc.c (Fcall_process): Use 'volatile' to avoid vfork
15555 clobbering (Bug#8298).
b9c7f648
PE
15556 * sysdep.c (sys_subshell): Likewise.
15557 Previously, the sys_subshell 'volatile' was incorrectly IF_LINTted out.
7e9123a2 15558
6bd8c144
PE
15559 * lisp.h (child_setup): Now NO_RETURN unless DOS_NT.
15560 This should get cleaned up, so that child_setup has the
15561 same signature on all platforms.
15562
7710357c 15563 * callproc.c (call_process_cleanup): Now static.
cb1d0ef7 15564 (relocate_fd): Rename locals to avoid shadowing.
7710357c 15565
c59da222
CY
155662011-03-22 Chong Yidong <cyd@stupidchicken.com>
15567
15568 * xterm.c (x_clear_frame): Remove XClearWindow call. This appears
15569 not to be necessary, and produces flickering.
15570
66b87493
GM
155712011-03-20 Glenn Morris <rgm@gnu.org>
15572
15573 * config.in: Remove file.
15574
45b6f6d5
JB
155752011-03-20 Juanma Barranquero <lekktu@gmail.com>
15576
15577 * minibuf.c (Vcompleting_read_function): Don't declare, global variables
15578 are now in src/globals.h.
15579 (syms_of_minibuf): Remove spurious & from previous change.
15580
cd394be1 155812011-03-20 Leo Liu <sdl.web@gmail.com>
3ec03f7e
LL
15582
15583 * minibuf.c (completing-read-function): New variable.
15584 (completing-read-default): Rename from completing-read.
15585 (completing-read): Call completing-read-function.
15586
b14e3e21
CY
155872011-03-19 Juanma Barranquero <lekktu@gmail.com>
15588
15589 * xfaces.c (Fx_load_color_file):
15590 Read color file from absolute filename (bug#8250).
15591
f2b726e6
JB
155922011-03-19 Juanma Barranquero <lekktu@gmail.com>
15593
15594 * makefile.w32-in: Update dependencies.
15595
09f6ff02
EZ
155962011-03-17 Eli Zaretskii <eliz@gnu.org>
15597
15598 * makefile.w32-in ($(BLD)/unexw32.$(O)): Depend on $(SRC)/unexec.h.
15599
29a6015a
PE
156002011-03-17 Paul Eggert <eggert@cs.ucla.edu>
15601
a3a6c54e
PE
15602 Fix more problems found by GCC 4.5.2's static checks.
15603
b766f867
PE
15604 * process.c (make_serial_process_unwind, send_process_trap):
15605 (sigchld_handler): Now static.
15606
be02381c
PE
15607 * process.c (allocate_pty): Let PTY_ITERATION declare iteration vars.
15608 That way, the code declares only the vars that it needs.
15609 * s/aix4-2.h (PTY_ITERATION): Declare iteration vars.
15610 * s/cygwin.h (PTY_ITERATION): Likewise.
15611 * s/darwin.h (PTY_ITERATION): Likewise.
15612 * s/gnu-linux.h (PTY_ITERATION): Likewise.
15613
57048744
PE
15614 * s/irix6-5.h (PTY_OPEN): Declare stb, to loosen coupling.
15615 * process.c (allocate_pty): Don't declare stb unless it's needed.
15616
7914961c 15617 * bytecode.c (MAYBE_GC): Rewrite so as not to use empty "else".
615f2d59
PE
15618 (CONSTANTLIM): Remove; unused.
15619 (METER_CODE, Bscan_buffer, Bread_char, Bset_mark):
15620 Define only if needed.
7914961c 15621
b3967b18
PE
15622 * unexelf.c (unexec): Name an expression,
15623 to avoid gcc -Wbad-function-cast warning.
9ae71512
PE
15624 Use a different way to cause a compilation error if anyone uses
15625 n rather than nn, a way that does not involve shadowing.
73366a00 15626 (ELF_BSS_SECTION_NAME, OLD_PROGRAM_H): Remove; unused.
b3967b18 15627
29a6015a
PE
15628 * deps.mk (unexalpha.o): Remove; unused.
15629
43cfc33e 15630 New file unexec.h, the (simple) interface for unexec (Bug#8267).
7feda0d2 15631 * unexec.h: New file.
ce701a33
PE
15632 * deps.mk (emacs.o, unexaix.o, unexcw.o, unexcoff.o, unexelf.o):
15633 (unexhp9k800.o, unexmacosx.o, unexsol.o, unexw32.o):
15634 Depend on unexec.h.
15635 * emacs.c [!defined CANNOT_DUMP]: Include unexec.h.
15636 * unexaix.c, unexcoff.c, unexcw.c, unexelf.c, unexhp9k800.c:
15637 * unexmacosx.c, unexsol.c, unexw32.c: Include unexec.h.
381259ef 15638 Change as necessary to match prototype in unexec.h.
ce701a33 15639
01f44d5a
PE
15640 * syntax.c (Fforward_comment, scan_lists): Rename locals to avoid
15641 shadowing.
4f63c6bb 15642 (back_comment, skip_chars): Mark vars as initialized.
01f44d5a 15643
a6670b0b
PE
15644 * character.h (FETCH_STRING_CHAR_ADVANCE_NO_CHECK, BUF_INC_POS):
15645 Rename locals to avoid shadowing.
15646
cef2010d 15647 * lread.c (read1): Rewrite so as not to use empty "else".
0902fe45 15648 (Fload, readevalloop, read1): Rename locals to avoid shadowing.
cef2010d 15649
d4d7173a
PE
15650 * print.c (Fredirect_debugging_output): Fix pointer signedess.
15651
f08b802a
PE
15652 * lisp.h (debug_output_compilation_hack): Add decl here, to avoid
15653 warning when compiling print.c.
15654
3ddb0639
PE
15655 * font.c (font_unparse_fcname): Abort in an "impossible" situation
15656 instead of using an uninitialized var.
5ad03b97 15657 (font_sort_entities): Mark var as initialized.
3ddb0639 15658
170a2692
PE
15659 * character.h (FETCH_CHAR_ADVANCE): Rename locals to avoid shadowing.
15660
e663c700
PE
15661 * font.c (font_unparse_xlfd): Don't mix pointers to variables with
15662 pointers to constants.
89bc529a 15663 (font_parse_fcname): Remove unused vars.
7b81e2d0 15664 (font_delete_unmatched): Now static.
ea838e10 15665 (font_get_spec): Remove; unused.
13a547c6
PE
15666 (font_style_to_value, font_prop_validate_style, font_unparse_fcname):
15667 (font_update_drivers, Ffont_get_glyphs, font_add_log):
15668 Rename or move locals to avoid shadowing.
e663c700 15669
2a80c887 15670 * fns.c (require_nesting_list, require_unwind): Now static.
612f56df 15671 (Ffillarray): Rename locals to avoid shadowing.
2a80c887 15672
1384fa33 15673 * floatfns.c (domain_error2): Define only if needed.
a885e2ed 15674 (Ffrexp, Fldexp): Rename locals to avoid shadowing.
1384fa33 15675
8b2c52e9
PE
15676 * alloc.c (mark_backtrace): Move decl from here ...
15677 * lisp.h: ... to here, so that it can be checked.
15678
475545b5 15679 * eval.c (call_debugger, do_debug_on_call, grow_specpdl): Now static.
d28a2170 15680 (Fdefvar): Rewrite so as not to use empty "else".
cfcbfb1a
PE
15681 (lisp_indirect_variable): Name an expression,
15682 to avoid gcc -Wbad-function-cast warning.
1faed8ae 15683 (Fdefvar): Rename locals to avoid shadowing.
475545b5 15684
b1349114 15685 * callint.c (quotify_arg, quotify_args): Now static.
a3e8cbda 15686 (Fcall_interactively): Rename locals to avoid shadowing.
b0e80955 15687 Use const pointer when appropriate.
b1349114 15688
a2928364
PE
15689 * lisp.h (get_system_name, get_operating_system_release):
15690 Move decls here, to check interfaces.
15691 * process.c (get_operating_system_release): Move decl to lisp.h.
15692 * xrdb.c (get_system_name): Likewise.
63c5d10b
PE
15693 * editfns.c (init_editfns, Fuser_login_name, Fuser_uid):
15694 (Fuser_real_uid, Fuser_full_name): Remove unnecessary casts,
15695 some of which prompt warnings from gcc -Wbad-function-cast.
545b49b4
PE
15696 (Fformat_time_string, Fencode_time, Finsert_char):
15697 (Ftranslate_region_internal, Fformat):
15698 Rename or remove local vars to avoid shadowing.
9710023e 15699 (Ftranslate_region_internal): Mark var as initialized.
63c5d10b 15700
a415e694
PE
15701 * doc.c (Fdocumentation, Fsnarf_documentation): Move locals to
15702 avoid shadowing.
15703
8ef4622d
PE
15704 * lisp.h (eassert): Check that the argument compiles, even if
15705 ENABLE_CHECKING is not defined.
15706
946f9a5b
PE
15707 * data.c (Findirect_variable): Name an expression, to avoid
15708 gcc -Wbad-function-cast warning.
112396d6 15709 (default_value, arithcompare, arith_driver, arith_error): Now static.
b9b84fa9 15710 (store_symval_forwarding): Rename local to avoid shadowing.
44f230aa
SM
15711 (Fmake_variable_buffer_local, Fmake_local_variable):
15712 Mark variables as initialized.
52746918 15713 (do_blv_forwarding, do_symval_forwarding): Remove; unused.
946f9a5b 15714
e5aab7e7 15715 * alloc.c (check_cons_list): Do not define unless GC_CHECK_CONS_LIST.
ae35e756
PE
15716 (Fmake_vector, Fvector, Fmake_byte_code, Fgarbage_collect):
15717 Rename locals to avoid shadowing.
dff45157
PE
15718 (mark_stack): Move local variables into the #ifdef region where
15719 they're used.
7bc26fdb
PE
15720 (BLOCK_INPUT_ALLOC, UNBLOCK_INPUT_ALLOC): Define only if
15721 ! defined SYSTEM_MALLOC && ! defined SYNC_INPUT, as they are not
15722 needed otherwise.
15723 (CHECK_ALLOCATED): Define only if GC_CHECK_MARKED_OBJECTS.
15724 (GC_STRING_CHARS): Remove; not used.
d40d4be1 15725 (Fmemory_limit): Cast sbrk's returned value to char *.
ae35e756 15726
e5aab7e7
PE
15727 * lisp.h (check_cons_list): Declare if GC_CHECK_CONS_LIST; this
15728 avoids undefined behavior in theory.
15729
4da60324
PE
15730 * regex.c (IF_LINT): Add defn, for benefit of ../lib-src.
15731
88043301
PE
15732 Use functions, not macros, for up- and down-casing (Bug#8254).
15733 * buffer.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15734 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Remove. All callers changed
15735 to use the following functions instead of these macros.
15736 (downcase): Adjust to lack of DOWNCASE_TABLE. Return int, not
15737 EMACS_INT, since callers assume the returned value fits in int.
15738 (upcase1): Likewise, for UPCASE_TABLE.
15739 (uppercasep, lowercasep, upcase): New static inline functions.
0da09c43 15740 * editfns.c (Fchar_equal): Remove no-longer-needed workaround for
db69b0cd 15741 the race-condition problem in the old DOWNCASE.
88043301 15742
19ed5445
PE
15743 * regex.c (CHARSET_LOOKUP_RANGE_TABLE_RAW, POP_FAILURE_REG_OR_COUNT):
15744 Rename locals to avoid shadowing.
15745 (regex_compile, re_match_2_internal): Move locals to avoid shadowing.
abbd1bcf
PE
15746 (regex_compile, re_search_2, re_match_2_internal):
15747 Remove unused local vars.
952db0d7
PE
15748 (FREE_VAR): Rewrite so as not to use empty "else",
15749 which gcc can warn about.
da053e48 15750 (regex_compile, re_match_2_internal): Mark locals as initialized.
b313f9d8
PE
15751 (RETALLOC_IF): Define only if needed.
15752 (WORDCHAR_P): Likewise. This one is never needed, but is used
15753 only in a comment talking about a compiler bug, so put inside
15754 the #if 0 of that comment.
15755 (CHARSET_LOOKUP_BITMAP, FAIL_STACK_FULL, RESET_FAIL_STACK):
15756 (PUSH_FAILURE_ELT, BUF_PUSH_3, STOP_ADDR_VSTRING):
15757 Remove; unused.
19ed5445 15758
1f3561e4 15759 * search.c (boyer_moore): Rename locals to avoid shadowing.
76ef09b7
PE
15760 * character.h (FETCH_STRING_CHAR_AS_MULTIBYTE_ADVANCE):
15761 (PREV_CHAR_BOUNDARY): Likewise.
1f3561e4 15762
ded6f8f7
PE
15763 * search.c (simple_search): Remove unused var.
15764
dbd37a95
PE
15765 * dired.c (compile_pattern): Move decl from here ...
15766 * lisp.h: ... to here, so that it can be checked.
15767 (struct re_registers): New forward decl.
15768
7e47afad
PE
15769 * character.h (INC_POS, DEC_POS): Rename locals to avoid shadowing.
15770
85f24f61
PE
15771 * indent.c (MULTIBYTE_BYTES_WIDTH): New args bytes, width.
15772 All uses changed.
15773 (MULTIBYTE_BYTES_WIDTH, scan_for_column, compute_motion):
15774 Rename locals to avoid shadowing.
5671df8f 15775 (Fvertical_motion): Mark locals as initialized.
85f24f61 15776
181aa2be 15777 * casefiddle.c (casify_object, casify_region): Now static.
e45a141a 15778 (casify_region): Mark local as initialized.
181aa2be 15779
930d429c
PE
15780 * cmds.c (internal_self_insert): Rename local to avoid shadowing.
15781
7082eac6
PE
15782 * lisp.h (GCPRO2_VAR, GCPRO3_VAR, GCPRO4_VAR, GCPRO5_VAR, GCPRO6_VAR):
15783 New macros, so that the caller can use some names other than
15784 gcpro1, gcpro2, etc.
15785 (GCPRO2, GCPRO3, GCPRO4, GCPRO5, GCPRO6): Reimplement in terms
15786 of the new macros.
15787 (GCPRO1_VAR, UNGCPRO_VAR): Change the meaning of the second
15788 argument, for consistency with GCPRO2_VAR, etc: it is now the
15789 prefix of the variable, not the variable itself. All uses
15790 changed.
38b2c076
PE
15791 * dired.c (directory_files_internal, file_name_completion):
15792 Rename locals to avoid shadowing.
15793
15206ed9
PE
15794 Fix a race condition diagnosed by gcc -Wsequence-point (Bug#8254).
15795 An expression of the form (DOWNCASE (x) == DOWNCASE (y)), found in
15796 dired.c's scmp function, had undefined behavior.
15797 * lisp.h (DOWNCASE_TABLE, UPCASE_TABLE, DOWNCASE, UPPERCASEP):
15798 (NOCASEP, LOWERCASEP, UPCASE, UPCASE1): Move from here ...
15799 * buffer.h: ... to here, because these macros use current_buffer,
15800 and the new implementation with inline functions needs to have
15801 current_buffer in scope now, rather than later when the macros
15802 are used.
15803 (downcase, upcase1): New static inline functions.
15804 (DOWNCASE, UPCASE1): Reimplement using these functions.
15805 This avoids undefined behavior in expressions like
15806 DOWNCASE (x) == DOWNCASE (y), which previously suffered
15807 from race conditions in accessing the global variables
15808 case_temp1 and case_temp2.
15809 * casetab.c (case_temp1, case_temp2): Remove; no longer needed.
15810 * lisp.h (case_temp1, case_temp2): Remove their decls.
15811 * character.h (ASCII_CHAR_P): Move from here ...
15812 * lisp.h: ... to here, so that the inline functions mentioned
15813 above can use them.
15814
4a6bea26
PE
15815 * dired.c (directory_files_internal_unwind): Now static.
15816
f14b7e14
PE
15817 * fileio.c (file_name_as_directory, directory_file_name):
15818 (barf_or_query_if_file_exists, auto_save_error, auto_save_1):
15819 Now static.
2893f146
PE
15820 (file_name_as_directory): Use const pointers when appropriate.
15821 (Fexpand_file_name): Likewise. In particular, newdir might
15822 point at constant storage, so make it a const pointer.
fd4ead52 15823 (Fmake_directory_internal, Fread_file_name): Remove unused vars.
b14aac08
PE
15824 (Ffile_selinux_context, Fset_file_selinux_context): Fix pointer
15825 signedness issues.
f839df0c
PE
15826 (Fset_file_times, Finsert_file_contents, auto_save_error):
15827 Rename locals to avoid shadowing.
f14b7e14 15828
5716756e 15829 * minibuf.c (choose_minibuf_frame_1): Now static.
62137a95
PE
15830 (Ftry_completion, Fall_completions): Rename or remove locals
15831 to avoid shadowing.
5716756e 15832
b4c3046a
PE
15833 * marker.c (bytepos_to_charpos): Remove; unused.
15834
b45db522
PE
15835 * lisp.h (verify_bytepos, count_markers): New decls,
15836 so that gcc does not warn that these functions aren't declared.
15837
85876d07
PE
15838 * insdel.c (check_markers, make_gap_larger, make_gap_smaller):
15839 (reset_var_on_error, Fcombine_after_change_execute_1): Now static.
f0cb4a60 15840 (CHECK_MARKERS): Redo to avoid gcc -Wempty-body diagnostic.
40ef059e 15841 (copy_text): Remove unused local var.
85876d07 15842
03d78a21 15843 * filelock.c (within_one_second): Now static.
b3dd38ab 15844 (lock_file_1): Rename local to avoid shadowing.
03d78a21 15845
5df8f01b
PE
15846 * buffer.c (fix_overlays_before): Mark locals as initialized.
15847 (fix_start_end_in_overlays): Likewise. This function should be
15848 simplified by using pointers-to-pointers, but that's a different
15849 matter.
b1d876f1 15850 (switch_to_buffer_1): Now static.
8f54f30a
PE
15851 (Fkill_buffer, record_buffer, Fbury_buffer, Fset_buffer_multibyte):
15852 (report_overlay_modification): Rename locals to avoid shadowing.
c3bd59b5 15853
a70072c9 15854 * sysdep.c (system_process_attributes): Rename vars to avoid shadowing.
fbd02d7b 15855 Fix pointer signedness issue.
edced198
PE
15856 (sys_subshell): Mark local as volatile if checking for lint,
15857 to suppress a gcc -Wclobbered warning that does not seem to be right.
15dfd3d9 15858 (MAXPATHLEN): Define only if needed.
a70072c9 15859
a0977c44
PE
15860 * process.c (serial_open, serial_configure): Move decls from here ...
15861 * systty.h: ... to here, so that they can be checked.
15862
a884fdcc
PE
15863 * fns.c (get_random, seed_random): Move extern decls from here ...
15864 * lisp.h: ... to here, so that they can be checked.
15865
604efe86 15866 * sysdep.c (reset_io): Now static.
b8950c94 15867 (wait_for_termination_signal): Remove; unused.
604efe86 15868
38fc62d9
PE
15869 * keymap.c (keymap_parent, keymap_memberp, map_keymap_internal):
15870 (copy_keymap_item, append_key, push_text_char_description):
15871 Now static.
1004a21a 15872 (Fwhere_is_internal): Don't test CONSP (sequences) unnecessarily.
dbbb8427 15873 (DENSE_TABLE_SIZE): Remove; unused.
c1141155
PE
15874 (get_keymap, access_keymap, Fdefine_key, Fwhere_is_internal):
15875 (describe_map_tree):
15876 Rename locals to avoid shadowing.
38fc62d9 15877
2f2650da
PE
15878 * keyboard.c: Declare functions static if they are not used elsewhere.
15879 (echo_char, echo_dash, cmd_error, top_level_2):
15880 (poll_for_input, handle_async_input): Now static.
69a058fa
PE
15881 (read_char, kbd_buffer_get_event, make_lispy_position):
15882 (make_lispy_event, make_lispy_movement, apply_modifiers):
15883 (decode_keyboard_code, tty_read_avail_input, menu_bar_items):
15884 (parse_tool_bar_item, read_key_sequence, Fread_key_sequence):
15885 (Fread_key_sequence_vector): Rename locals to avoid shadowing.
c8a06054 15886 (read_key_sequence, read_char): Mark locals as initialized.
3ac94672 15887 (Fexit_recursive_edit, Fabort_recursive_edit): Mark with NO_RETURN.
2f2650da 15888
a053e86c 15889 * keyboard.h (make_ctrl_char): New decl.
da2f2dd9
PE
15890 (mark_kboards): Move decl here ...
15891 * alloc.c (mark_kboards): ... from here.
a053e86c 15892
4752793e
PE
15893 * lisp.h (force_auto_save_soon): New decl.
15894
74f10ca7 15895 * emacs.c (init_cmdargs): Rename local to avoid shadowing.
244fc23d
PE
15896 (DEFINE_DUMMY_FUNCTION): New macro.
15897 (__do_global_ctors, __do_global_ctors_aux, __do_global_dtors, __main):
15898 Use it.
c03cd23f
PE
15899 (main): Add casts to avoid warnings
15900 if GCC considers string literals to be constants.
74f10ca7 15901
022e70d4
PE
15902 * lisp.h (fatal_error_signal): Add decl, since it's exported.
15903
59d6fe83
PE
15904 * dbusbind.c: Pointer signedness fixes.
15905 (xd_signature, xd_append_arg, xd_initialize):
15906 (Fdbus_call_method, Fdbus_call_method_asynchronously):
15907 (Fdbus_method_return_internal, Fdbus_method_error_internal):
15908 (Fdbus_send_signal, xd_read_message_1, Fdbus_register_service):
15909 (Fdbus_register_signal): Use SSDATA when the context wants char *.
15910
78320123
PE
15911 * dbusbind.c (Fdbus_init_bus): Add cast to avoid warning
15912 if GCC considers string literals to be constants.
49cebcca 15913 (Fdbus_register_service, Fdbus_register_method): Remove unused vars.
78320123 15914
35ac2a97
SM
159152011-03-16 Stefan Monnier <monnier@iro.umontreal.ca>
15916
fb103ca9
SM
15917 * print.c (PRINT_CIRCLE_CANDIDATE_P): New macro.
15918 (print_preprocess, print_object): New macro to fix last change.
15919
35ac2a97
SM
15920 * print.c (print_preprocess): Don't forget font objects.
15921
62973b41
JB
159222011-03-16 Juanma Barranquero <lekktu@gmail.com>
15923
15924 * emacs.c (USAGE3): Doc fixes.
15925
0e48bb22
AS
159262011-03-15 Andreas Schwab <schwab@linux-m68k.org>
15927
15928 * coding.c (detect_coding_iso_2022): Reorganize code to clarify
15929 structure.
15930
7684e57b
JB
159312011-03-14 Juanma Barranquero <lekktu@gmail.com>
15932
15933 * lisp.h (VWindow_system, Qfile_name_history):
15934 * keyboard.h (lispy_function_keys) [WINDOWSNT]:
15935 * w32term.h (w32_system_caret_hwnd, w32_system_caret_height)
15936 (w32_system_caret_x, w32_system_caret_y): Declare extern.
15937
15938 * w32select.c: Don't #include "keyboard.h".
c96bbc66 15939 (run_protected): Add extern declaration for waiting_for_input.
7684e57b
JB
15940
15941 * w32.c (Qlocal, noninteractive1, inhibit_window_system):
15942 * w32console.c (detect_input_pending, read_input_pending)
15943 (encode_terminal_code):
15944 * w32fns.c (quit_char, lispy_function_keys, Qtooltip)
15945 (w32_system_caret_hwnd, w32_system_caret_height, w32_system_caret_x)
15946 (w32_system_caret_y, Qfile_name_history):
15947 * w32font.c (w32font_driver, QCantialias, QCotf, QClang):
15948 * w32inevt.c (reinvoke_input_signal, lispy_function_keys):
15949 * w32menu.c (Qmenu_bar, QCtoggle, QCradio, Qoverriding_local_map)
15950 (Qoverriding_terminal_local_map, Qmenu_bar_update_hook):
15951 * w32proc.c (Qlocal, report_file_error):
15952 * w32term.c (Vwindow_system, updating_frame):
15953 * w32uniscribe.c (initialized, uniscribe_font_driver):
15954 Remove unneeded extern declarations.
15955
2aa46d6c
CY
159562011-03-14 Chong Yidong <cyd@stupidchicken.com>
15957
c96bbc66 15958 * buffer.c (Fmake_indirect_buffer): Fix incorrect assertions.
2aa46d6c 15959
cffc6f3b
CY
159602011-03-13 Chong Yidong <cyd@stupidchicken.com>
15961
15962 * buffer.h (BUF_BEGV, BUF_BEGV_BYTE, BUF_ZV, BUF_ZV_BYTE, BUF_PT)
15963 (BUF_PT_BYTE): Rewrite to handle indirect buffers (Bug#8219).
15964 These macros can no longer be used for assignment.
15965
44f230aa
SM
15966 * buffer.c (Fget_buffer_create, Fmake_indirect_buffer):
15967 Assign struct members directly, instead of using BUF_BEGV etc.
cffc6f3b
CY
15968 (record_buffer_markers, fetch_buffer_markers): New functions for
15969 recording and fetching special buffer markers.
15970 (set_buffer_internal_1, set_buffer_temp): Use them.
15971
15972 * lread.c (unreadchar): Use SET_BUF_PT_BOTH.
15973
15974 * insdel.c (adjust_point): Use SET_BUF_PT_BOTH.
15975
15976 * intervals.c (temp_set_point_both): Use SET_BUF_PT_BOTH.
15977 (get_local_map): Use SET_BUF_BEGV_BOTH and SET_BUF_ZV_BOTH.
15978
15979 * xdisp.c (hscroll_window_tree):
15980 (reconsider_clip_changes): Use PT instead of BUF_PT.
15981
d251f04b
EZ
159822011-03-13 Eli Zaretskii <eliz@gnu.org>
15983
15984 * makefile.w32-in ($(BLD)/editfns.$(O)): Depend on
15985 $(EMACS_ROOT)/lib/intprops.h.
15986
f0c77cd1
PE
159872011-03-13 Paul Eggert <eggert@cs.ucla.edu>
15988
3eca4629
PE
15989 Fix more problems found by GCC 4.5.2's static checks.
15990
7c86ee98
PE
15991 * gtkutil.c (xg_get_pixbuf_from_pixmap): Add cast from char *
15992 to unsigned char * to avoid compiler diagnostic.
b0afc268
PE
15993 (xg_free_frame_widgets): Make it clear that a local variable is
15994 needed only if USE_GTK_TOOLTIP.
01e0b5ad
PE
15995 (gdk_window_get_screen): Make it clear that this macro is needed
15996 only if USE_GTK_TOOLTIP.
1e5524e7
PE
15997 (int_gtk_range_get_value): New function, which avoids a diagnostic
15998 from gcc -Wbad-function-cast.
15999 (xg_set_toolkit_scroll_bar_thumb): Use it.
16000 (xg_tool_bar_callback, xg_tool_item_stale_p): Rewrite to avoid
16001 diagnostic from gcc -Wbad-function-cast.
65dc836c
PE
16002 (get_utf8_string, xg_get_file_with_chooser):
16003 Rename locals to avoid shadowing.
16004 (create_dialog): Move locals to avoid shadowing.
7c86ee98 16005
41729b81
PE
16006 * xgselect.c (xg_select): Remove unused var.
16007
f0c77cd1
PE
16008 * image.c (four_corners_best): Mark locals as initialized.
16009 (gif_load): Initialize transparent_p to zero (Bug#8238).
16010 Mark another local as initialized.
ec6cf4c6 16011 (my_png_error, my_error_exit): Mark with NO_RETURN.
f0c77cd1 16012
ce0ad53d 16013 * image.c (clear_image_cache): Now static.
d5d5a617 16014 (DIM, HAVE_STDLIB_H_1): Remove unused macros.
e22cffbc 16015 (xpm_load): Redo to avoid "discards qualifiers" gcc warning.
77a765fd
PE
16016 (x_edge_detection): Remove unnecessary cast that
16017 gcc -Wbad-function-cast diagnoses.
2037898d 16018 (gif_load): Fix pointer signedness.
6ae141d6
PE
16019 (clear_image_cache, xbm_read_bitmap_data, x_detect_edges):
16020 (jpeg_load, gif_load): Rename locals to avoid shadowing.
ce0ad53d 16021
33383987 160222011-03-12 Paul Eggert <eggert@cs.ucla.edu>
3eca4629 16023
d32df629
PE
16024 Improve quality of tests for time stamp overflow.
16025 For example, without this patch (encode-time 0 0 0 1 1
16026 1152921504606846976) returns the obviously-bogus value (-948597
16027 62170) on my RHEL 5.5 x86-64 host. With the patch, it correctly
16028 reports time overflow. See
16029 <http://lists.gnu.org/archive/html/emacs-devel/2011-03/msg00470.html>.
b8d9bd41
PE
16030 * deps.mk (editfns.o): Depend on ../lib/intprops.h.
16031 * editfns.c: Include limits.h and intprops.h.
16032 (TIME_T_MIN, TIME_T_MAX): New macros.
16033 (time_overflow): Move earlier, to before first use.
16034 (hi_time, lo_time): New functions, for an accurate test for
16035 out-of-range times.
16036 (Fcurrent_time, Fget_internal_run_time, make_time): Use them.
16037 (Fget_internal_run_time): Don't assume time_t fits in int.
16038 (make_time): Use list2 instead of Fcons twice.
16039 (Fdecode_time): More accurate test for out-of-range times.
16040 (check_tm_member): New function.
16041 (Fencode_time): Use it, to test for out-of-range times.
d32df629
PE
16042 (lisp_time_argument): Don't rely on undefined left-shift and
16043 right-shift behavior when checking for time stamp overflow.
8be6f318 16044
fe31d94c
PE
16045 * editfns.c (time_overflow): New function, refactoring common code.
16046 (Fformat_time_string, Fdecode_time, Fencode_time):
16047 (Fcurrent_time_string): Use it.
16048
8be6f318
PE
16049 Move 'make_time' to be next to its inverse 'lisp_time_argument'.
16050 * dired.c (make_time): Move to ...
16051 * editfns.c (make_time): ... here.
16052 * systime.h: Note the move.
16053
09d9db2c 160542011-03-12 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
c47cbdfd 16055
126bc0dc
YM
16056 * fringe.c (update_window_fringes): Remove unused variables.
16057
c47cbdfd
YM
16058 * unexmacosx.c (copy_data_segment): Also copy __got section.
16059 (Bug#8223)
16060
7ac80be9
EZ
160612011-03-12 Eli Zaretskii <eliz@gnu.org>
16062
c96bbc66 16063 * termcap.c [MSDOS]: Include "msdos.h".
058e5dad
EZ
16064 (find_capability, tgetnum, tgetflag, tgetstr, tputs, tgetent):
16065 Constify `char *' arguments and their references according to
16066 prototypes in tparam.h.
16067
ecb0f94d 16068 * deps.mk (termcap.o): Depend on tparam.h and msdos.h.
058e5dad 16069
7ac80be9
EZ
16070 * msdos.c (XMenuAddPane): 3rd argument is `const char *' now.
16071 Adapt all references accordingly.
16072
16073 * msdos.h (XMenuAddPane): 3rd argument is `const char *' now.
16074
ef1fd07e
TT
160752011-03-11 Tom Tromey <tromey@redhat.com>
16076
16077 * buffer.c (syms_of_buffer): Remove obsolete comment.
16078
7ef4b50c
EZ
160792011-03-11 Eli Zaretskii <eliz@gnu.org>
16080
16081 * termhooks.h (encode_terminal_code): Declare prototype.
16082
16083 * msdos.c (encode_terminal_code): Don't declare prototype.
16084
16085 * term.c (encode_terminal_code): Now external again, used by
16086 w32console.c and msdos.c.
16087
44f230aa
SM
16088 * makefile.w32-in ($(BLD)/term.$(O), ($(BLD)/tparam.$(O)):
16089 Depend on $(SRC)/tparam.h, see 2011-03-11T07:24:21Z!eggert@cs.ucla.edu.
7ef4b50c 16090
4b1ec863 160912011-03-11 Paul Eggert <eggert@cs.ucla.edu>
f78faa98 16092
1714f52b 16093 Fix some minor problems found by GCC 4.5.2's static checks.
83316bf4 16094
4b1ec863
PE
16095 * fringe.c (update_window_fringes): Mark locals as initialized
16096 (Bug#8227).
16097 (destroy_fringe_bitmap, init_fringe_bitmap): Now static.
bf60f616 16098
524c7aa6
PE
16099 * alloc.c (mark_fringe_data): Move decl from here ...
16100 * lisp.h (mark_fringe_data) [HAVE_WINDOW_SYSTEM]: ... to here,
16101 to check its interface.
16102 (init_fringe_once): Do not declare unless HAVE_WINDOW_SYSTEM.
16103
a5c0af81 16104 * fontset.c (free_realized_fontset): Now static.
7519b8cd 16105 (Fset_fontset_font): Rename local to avoid shadowing.
cc6e5db1 16106 (fontset_font): Mark local as initialized.
a9a06e0b 16107 (FONTSET_SPEC, FONTSET_REPERTORY, RFONT_DEF_REPERTORY): Remove; unused.
a5c0af81 16108
b4716021
PE
16109 * xrdb.c: Include "xterm.h", to check x_load_resources's interface.
16110
811e9bac 16111 * xselect.c (x_disown_buffer_selections): Remove; not used.
7b83e2f1 16112 (TRACE3) [!defined TRACE_SELECTION]: Remove; not used.
aa0daa9f
PE
16113 (x_own_selection, Fx_disown_selection_internal): Rename locals
16114 to avoid shadowing.
16115 (x_handle_dnd_message): Remove local to avoid shadowing.
811e9bac 16116
7e3ab302
PE
16117 * lisp.h (GCPRO1_VAR, UNGCPRO_VAR): New macros,
16118 so that the caller can use some name other than gcpro1.
16119 (GCPRO1, UNGCPRO): Reimplement in terms of the new macros.
58d2d479
PE
16120 * xfns.c (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16121 (Fx_backspace_delete_keys_p):
16122 Use them to avoid shadowing, and rename vars to avoid shadowing.
16123 (x_decode_color, x_set_name, x_window): Now static.
6b437900 16124 (Fx_create_frame): Add braces to silence GCC warning.
c0951e53 16125 (Fx_file_dialog, Fx_select_font): Fix pointer signedness.
06b0c8a0
PE
16126 (x_real_positions, xg_set_icon_from_xpm_data, x_create_tip_frame):
16127 Remove unused locals.
7e3ab302
PE
16128 (Fx_create_frame, x_create_tip_frame, Fx_show_tip):
16129 (Fx_backspace_delete_keys_p): Rename locals to avoid shadowing.
16130 Some of these renamings use the new GCPRO1_VAR and UNGCPRO_VAR
16131 macros.
f78faa98 16132
e2b13473
PE
16133 * xterm.h (x_mouse_leave): New decl.
16134
77f23912
PE
16135 * xterm.c (x_copy_dpy_color, x_focus_on_frame, x_unfocus_frame):
16136 Remove unused functions.
cdf4ba58
PE
16137 (x_shift_glyphs_for_insert, XTflash, XTring_bell):
16138 (x_calc_absolute_position): Now static.
7411c686 16139 (XTread_socket): Don't define label "out" unless it's used.
2b07bcff 16140 Don't declare local "event" unless it's used.
ed7bf3a5
PE
16141 (x_iconify_frame, x_free_frame_resources): Don't declare locals
16142 unless they are used.
38d0b34a
PE
16143 (XEMBED_VERSION, xembed_set_info): Don't define unless needed.
16144 (x_fatal_error_signal): Remove; not used.
a6067996
PE
16145 (x_draw_image_foreground, redo_mouse_highlight, XTmouse_position):
16146 (x_scroll_bar_report_motion, handle_one_xevent, x_draw_bar_cursor):
16147 (x_error_catcher, x_connection_closed, x_error_handler):
16148 (x_error_quitter, xembed_send_message, x_iconify_frame):
16149 (my_log_handler): Rename locals to avoid shadowing.
28f1c698 16150 (x_delete_glyphs, x_ins_del_lines): Mark with NO_RETURN.
2a8fade0 16151 (x_connection_closed): Tell GCC not to suggest NO_RETURN.
77f23912 16152
44f230aa
SM
16153 * xfaces.c (clear_face_cache, Fx_list_fonts, Fface_font):
16154 Rename or move locals to avoid shadowing.
6b463e58 16155 (tty_defined_color, merge_face_heights): Now static.
5967d051 16156 (free_realized_faces_for_fontset): Remove; not used.
1e9966ea
PE
16157 (Fx_list_fonts): Mark variable that gcc -Wuninitialized
16158 does not deduce is never used uninitialized.
73719eba
PE
16159 (STRDUPA, LSTRDUPA, FONT_POINT_SIZE_QUANTUM): Remove; not used.
16160 (LFACEP): Define only if XASSERTS, as it's not needed otherwise.
071048a3 16161
426994c3 16162 * terminal.c (store_terminal_param): Now static.
5489860b 16163
032f1620 16164 * xmenu.c (menu_highlight_callback): Now static.
9d66f88e 16165 (set_frame_menubar): Remove unused local.
d4323972 16166 (xmenu_show): Rename parameter to avoid shadowing.
6d1f7fee
PE
16167 (xmenu_show, xdialog_show, xmenu_show): Make local pointers "const"
16168 since they might point to immutable storage.
281585b0
PE
16169 (next_menubar_widget_id): Declare only if USE_X_TOOLKIT,
16170 since it's unused otherwise.
032f1620 16171
367c19e5 16172 * xdisp.c (produce_glyphless_glyph): Initialize lower_xoff.
53df7c11 16173 Add a FIXME, since the code still doesn't look right. (Bug#8215)
9f36b9fd
PE
16174 (Fcurrent_bidi_paragraph_direction): Simplify slightly; this
16175 avoids a gcc -Wuninitialized diagnostic.
0e086e8f 16176 (display_line, BUILD_COMPOSITE_GLYPH_STRING, draw_glyphs):
44a3a108
PE
16177 (note_mouse_highlight): Mark variables that gcc -Wuninitialized
16178 does not deduce are never used uninitialized.
70739cbe 16179
07b48fa9
PE
16180 * lisp.h (IF_LINT): New macro, copied from ../lib-src/emacsclient.c.
16181
8868a238 16182 * xdisp.c (redisplay_window): Rename local to avoid shadowing.
4554d213
PE
16183 * window.c (window_loop, size_window):
16184 (run_window_configuration_change_hook, enlarge_window): Likewise.
8868a238 16185
7e5cf297 16186 * window.c (display_buffer): Now static.
d6550a9f
PE
16187 (size_window): Mark variables that gcc -Wuninitialized
16188 does not deduce are never used uninitialized.
a586633d
PE
16189 * window.h (check_all_windows): New decl, to forestall
16190 gcc -Wmissing-prototypes diagnostic.
5b555da1 16191 * dispextern.h (bidi_dump_cached_states): Likewise.
7e5cf297 16192
f6095868
PE
16193 * charset.h (CHECK_CHARSET_GET_CHARSET): Rename locals to avoid
16194 shadowing.
16195 * charset.c (map_charset_for_dump, Fchar_charset): Likewise.
726929c4
PE
16196 Include <limits.h>.
16197 (Fsort_charsets): Redo min/max calculation to shorten the code a bit
16198 and to avoid gcc -Wuninitialized warning.
89ef49df
PE
16199 (load_charset_map): Mark variables that gcc -Wuninitialized
16200 does not deduce are never used uninitialized.
53df7c11 16201 (load_charset): Abort instead of using uninitialized var (Bug#8229).
f6095868 16202
f38b440c
PE
16203 * coding.c (coding_set_source, coding_set_destination):
16204 Use "else { /* comment */ }" rather than "else /* comment */;"
16205 for clarity, and to avoid gcc -Wempty-body warning.
2735d060
PE
16206 (Fdefine_coding_system_internal): Don't redeclare 'i' inside
16207 a block, when the outer 'i' will do.
16208 (decode_coding_utf_8, decode_coding_utf_16, detect_coding_emacs_mule):
16209 (emacs_mule_char, decode_coding_emacs_mule, detect_coding_iso_2022):
16210 (decode_coding_iso_2022, decode_coding_sjis, decode_coding_big5):
16211 (decode_coding_raw_text, decode_coding_charset, get_translation_table):
16212 (Fdecode_sjis_char, Fdefine_coding_system_internal):
16213 Rename locals to avoid shadowing.
16214 * character.h (FETCH_STRING_CHAR_ADVANCE): Likewise.
e2f1bab9
PE
16215 * coding.c (emacs_mule_char, encode_invocation_designation):
16216 Now static, since they're not used elsewhere.
413bb2db 16217 (decode_coding_iso_2022): Add "default: abort ();" as a safety check.
c4a63b12 16218 (decode_coding_object, encode_coding_object, detect_coding_system):
ee05f961
PE
16219 (decode_coding_emacs_mule): Mark variables that gcc
16220 -Wuninitialized does not deduce are never used uninitialized.
160b01f6
PE
16221 (detect_coding_iso_2022): Initialize a local variable that might
16222 be used uninitialized. Leave a FIXME because it's not clear that
53df7c11 16223 this initialization is needed. (Bug#8211)
5f58e762
PE
16224 (ISO_CODE_LF, ISO_CODE_CR, CODING_ISO_FLAG_EUC_TW_SHIFT):
16225 (ONE_MORE_BYTE_NO_CHECK, UTF_BOM, UTF_16_INVALID_P):
16226 (SHIFT_OUT_OK, ENCODE_CONTROL_SEQUENCE_INTRODUCER):
16227 (ENCODE_DIRECTION_R2L, ENCODE_DIRECTION_L2R):
16228 Remove unused macros.
f38b440c 16229
232b38b9 16230 * category.c (hash_get_category_set): Remove unused local var.
9f3b5e69 16231 (copy_category_table): Now static, since it's not used elsewhere.
d0891610 16232 * character.c (string_count_byte8): Likewise.
232b38b9 16233
fb90da1b
PE
16234 * ccl.c (CCL_WRITE_STRING, CCL_ENCODE_CHAR, Fccl_execute_on_string):
16235 (Fregister_code_conversion_map): Rename locals to avoid shadowing.
16236
fb93dbc2
PE
16237 * chartab.c (copy_sub_char_table): Now static, since it's not used
16238 elsewhere.
5c156ace
PE
16239 (sub_char_table_ref_and_range, char_table_ref_and_range):
16240 Rename locals to avoid shadowing.
bbcd0949 16241 (ASET_RANGE, GET_SUB_CHAR_TABLE): Remove unused macros.
fb93dbc2 16242
7d3b3862 16243 * bidi.c (bidi_check_type): Now static, since it's not used elsewhere.
630d6892 16244 (BIDI_BOB): Remove unused macro.
7d3b3862 16245
6be7d3da
PE
16246 * cm.c (cmgoto): Mark variables that gcc -Wuninitialized does not
16247 deduce are never used uninitialized.
c2ed9c8b 16248 * term.c (encode_terminal_code): Likewise.
6be7d3da 16249
75f8807f 16250 * term.c (encode_terminal_code): Now static. Remove unused local.
72abad34 16251
50938595
PE
16252 * tparam.h: New file.
16253 * term.c, tparam.h: Include it.
16254 * deps.mk (term.o, tparam.o): Depend on tparam.h.
16255 * term.c (tputs, tgetent, tgetflag, tgetnum, tparam, tgetstr):
16256 Move these decls to tparam.h, and make them agree with what
16257 is actually in tparam.c. The previous trick of using incompatible
16258 decls in different modules does not conform to the C standard.
16259 All callers of tparam changed to use tparam's actual API.
16260 * tparam.c (tparam1, tparam, tgoto):
16261 Use const pointers where appropriate.
16262
fbceeba2
PE
16263 * cm.c (calccost, cmgoto): Use const pointers where appropriate.
16264 * cm.h (struct cm): Likewise.
16265 * dispextern.h (do_line_insertion_deletion_costs): Likewise.
16266 * scroll.c (ins_del_costs, do_line_insertion_deletion_costs): Likewise.
16267 * term.c (tty_ins_del_lines, calculate_costs, struct fkey_table):
16268 (term_get_fkeys_1, append_glyphless_glyph, produce_glyphless_glyph):
16269 (turn_on_face, init_tty): Likewise.
16270 * termchar.h (struct tty_display_info): Likewise.
fbceeba2 16271
7f3f1250
PE
16272 * term.c (term_mouse_position): Rename local to avoid shadowing.
16273
e6ca6543
PE
16274 * alloc.c (mark_ttys): Move decl from here ...
16275 * lisp.h (mark_ttys): ... to here, so that it's checked against defn.
16276
c40f8d15
AS
162772011-03-11 Andreas Schwab <schwab@linux-m68k.org>
16278
16279 * .gdbinit (pwinx, xbuffer): Fix access to buffer name.
16280
cfe0661d
JB
162812011-03-09 Juanma Barranquero <lekktu@gmail.com>
16282
16283 * search.c (compile_pattern_1): Remove argument regp, unused since
16284 revid:rms@gnu.org-19941211082627-3x1g1wyqkjmwloig.
16285 (compile_pattern): Don't pass it.
16286
0afb4571
J
162872011-03-08 Jan Djärv <jan.h.d@swipnet.se>
16288
16289 * xterm.h (DEFAULT_GDK_DISPLAY): New define.
16290 (GDK_WINDOW_XID, gtk_widget_get_preferred_size): New defines
16291 for ! HAVE_GTK3.
16292 (GTK_WIDGET_TO_X_WIN): Use GDK_WINDOW_XID.
16293
16294 * xmenu.c (menu_position_func): Call gtk_widget_get_preferred_size.
16295
16296 * gtkutil.c: Include gtkx.h if HAVE_GTK3. If ! HAVE_GTK3, define
16297 gdk_window_get_screen, gdk_window_get_geometry,
16298 gdk_x11_window_lookup_for_display and GDK_KEY_g.
16299 (xg_set_screen): Use DEFAULT_GDK_DISPLAY.
16300 (xg_get_pixbuf_from_pixmap): New function.
16301 (xg_get_pixbuf_from_pix_and_mask): Change parameters from GdkPixmap
16302 to Pixmap, take frame as parameter, remove GdkColormap parameter.
16303 Call xg_get_pixbuf_from_pixmap instead of
16304 gdk_pixbuf_get_from_drawable.
16305 (xg_get_image_for_pixmap): Do not make GdkPixmaps, call
16306 xg_get_pixbuf_from_pix_and_mask with Pixmap parameters instead.
16307 (xg_check_special_colors): Use GtkStyleContext and its functions
16308 for HAVE_GTK3.
16309 (xg_prepare_tooltip, xg_hide_tooltip): Call gdk_window_get_screen.
16310 (xg_prepare_tooltip, create_dialog, menubar_map_cb)
16311 (xg_update_frame_menubar, xg_tool_bar_detach_callback)
44f230aa
SM
16312 (xg_tool_bar_attach_callback, xg_update_tool_bar_sizes):
16313 Call gtk_widget_get_preferred_size.
0afb4571
J
16314 (xg_frame_resized): gdk_window_get_geometry only takes 5
16315 parameters.
44f230aa
SM
16316 (xg_win_to_widget, xg_event_is_for_menubar):
16317 Call gdk_x11_window_lookup_for_display.
0afb4571
J
16318 (xg_set_widget_bg): New function.
16319 (delete_cb): New function.
895009e1 16320 (xg_create_frame_widgets): Connect delete-event to delete_cb.
5c32d3f2 16321 Call xg_set_widget_bg. Only set background pixmap for ! HAVE_GTK3
0afb4571
J
16322 (xg_set_background_color): Call xg_set_widget_bg.
16323 (xg_set_frame_icon): Call xg_get_pixbuf_from_pix_and_mask.
16324 (xg_create_scroll_bar): vadj is a GtkAdjustment for HAVE_GTK3.
16325 Only call gtk_range_set_update_policy if ! HAVE_GTK3.
16326 (xg_make_tool_item): Only connect xg_tool_bar_item_expose_callback
16327 if ! HAVE_GTK3.
16328 (update_frame_tool_bar): Call gtk_widget_hide.
16329 (xg_initialize): Use GDK_KEY_g.
16330
16331 * xsmfns.c (gdk_set_sm_client_id): Define to gdk_set_sm_client_id
16332 if ! HAVE_GTK3
16333 (x_session_initialize): Call gdk_x11_set_sm_client_id.
16334
16335 * xterm.c (XFillRectangle): Use cairo routines for HAVE_GTK3.
16336 (x_term_init): Disable Xinput(2) with GDK_CORE_DEVICE_EVENTS.
16337 Load ~/emacs.d/gtkrc only for ! HAVE_GTK3.
16338
1c2cc4ef
JB
163392011-03-08 Juanma Barranquero <lekktu@gmail.com>
16340
16341 * w32xfns.c (select_palette): Check success of RealizePalette against
16342 GDI_ERROR, not zero.
16343
33383987 16344See ChangeLog.11 for earlier changes.
aac0c6e3
MR
16345
16346;; Local Variables:
16347;; coding: utf-8
aac0c6e3
MR
16348;; End:
16349
2f097256 16350 Copyright (C) 2011-2012 Free Software Foundation, Inc.
aac0c6e3
MR
16351
16352 This file is part of GNU Emacs.
16353
16354 GNU Emacs is free software: you can redistribute it and/or modify
16355 it under the terms of the GNU General Public License as published by
16356 the Free Software Foundation, either version 3 of the License, or
16357 (at your option) any later version.
16358
16359 GNU Emacs is distributed in the hope that it will be useful,
16360 but WITHOUT ANY WARRANTY; without even the implied warranty of
16361 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16362 GNU General Public License for more details.
16363
16364 You should have received a copy of the GNU General Public License
16365 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.